openapi.json 343 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625
  1. {
  2. "openapi": "3.1.1",
  3. "info": {
  4. "title": "opencode",
  5. "description": "opencode api",
  6. "version": "1.0.0"
  7. },
  8. "paths": {
  9. "/global/health": {
  10. "get": {
  11. "operationId": "global.health",
  12. "summary": "Get health",
  13. "description": "Get health information about the OpenCode server.",
  14. "responses": {
  15. "200": {
  16. "description": "Health information",
  17. "content": {
  18. "application/json": {
  19. "schema": {
  20. "type": "object",
  21. "properties": {
  22. "healthy": {
  23. "type": "boolean",
  24. "const": true
  25. },
  26. "version": {
  27. "type": "string"
  28. }
  29. },
  30. "required": ["healthy", "version"]
  31. }
  32. }
  33. }
  34. }
  35. },
  36. "x-codeSamples": [
  37. {
  38. "lang": "js",
  39. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.health({\n ...\n})"
  40. }
  41. ]
  42. }
  43. },
  44. "/global/event": {
  45. "get": {
  46. "operationId": "global.event",
  47. "summary": "Get global events",
  48. "description": "Subscribe to global events from the OpenCode system using server-sent events.",
  49. "responses": {
  50. "200": {
  51. "description": "Event stream",
  52. "content": {
  53. "text/event-stream": {
  54. "schema": {
  55. "$ref": "#/components/schemas/GlobalEvent"
  56. }
  57. }
  58. }
  59. }
  60. },
  61. "x-codeSamples": [
  62. {
  63. "lang": "js",
  64. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.event({\n ...\n})"
  65. }
  66. ]
  67. }
  68. },
  69. "/global/sync-event": {
  70. "get": {
  71. "operationId": "global.sync-event.subscribe",
  72. "summary": "Subscribe to global sync events",
  73. "description": "Get global sync events",
  74. "responses": {
  75. "200": {
  76. "description": "Event stream",
  77. "content": {
  78. "text/event-stream": {
  79. "schema": {
  80. "$ref": "#/components/schemas/SyncEvent"
  81. }
  82. }
  83. }
  84. }
  85. },
  86. "x-codeSamples": [
  87. {
  88. "lang": "js",
  89. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.sync-event.subscribe({\n ...\n})"
  90. }
  91. ]
  92. }
  93. },
  94. "/global/config": {
  95. "get": {
  96. "operationId": "global.config.get",
  97. "summary": "Get global configuration",
  98. "description": "Retrieve the current global OpenCode configuration settings and preferences.",
  99. "responses": {
  100. "200": {
  101. "description": "Get global config info",
  102. "content": {
  103. "application/json": {
  104. "schema": {
  105. "$ref": "#/components/schemas/Config"
  106. }
  107. }
  108. }
  109. }
  110. },
  111. "x-codeSamples": [
  112. {
  113. "lang": "js",
  114. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.config.get({\n ...\n})"
  115. }
  116. ]
  117. },
  118. "patch": {
  119. "operationId": "global.config.update",
  120. "summary": "Update global configuration",
  121. "description": "Update global OpenCode configuration settings and preferences.",
  122. "responses": {
  123. "200": {
  124. "description": "Successfully updated global config",
  125. "content": {
  126. "application/json": {
  127. "schema": {
  128. "$ref": "#/components/schemas/Config"
  129. }
  130. }
  131. }
  132. },
  133. "400": {
  134. "description": "Bad request",
  135. "content": {
  136. "application/json": {
  137. "schema": {
  138. "$ref": "#/components/schemas/BadRequestError"
  139. }
  140. }
  141. }
  142. }
  143. },
  144. "requestBody": {
  145. "content": {
  146. "application/json": {
  147. "schema": {
  148. "$ref": "#/components/schemas/Config"
  149. }
  150. }
  151. }
  152. },
  153. "x-codeSamples": [
  154. {
  155. "lang": "js",
  156. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.config.update({\n ...\n})"
  157. }
  158. ]
  159. }
  160. },
  161. "/global/dispose": {
  162. "post": {
  163. "operationId": "global.dispose",
  164. "summary": "Dispose instance",
  165. "description": "Clean up and dispose all OpenCode instances, releasing all resources.",
  166. "responses": {
  167. "200": {
  168. "description": "Global disposed",
  169. "content": {
  170. "application/json": {
  171. "schema": {
  172. "type": "boolean"
  173. }
  174. }
  175. }
  176. }
  177. },
  178. "x-codeSamples": [
  179. {
  180. "lang": "js",
  181. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.dispose({\n ...\n})"
  182. }
  183. ]
  184. }
  185. },
  186. "/global/upgrade": {
  187. "post": {
  188. "operationId": "global.upgrade",
  189. "summary": "Upgrade opencode",
  190. "description": "Upgrade opencode to the specified version or latest if not specified.",
  191. "responses": {
  192. "200": {
  193. "description": "Upgrade result",
  194. "content": {
  195. "application/json": {
  196. "schema": {
  197. "anyOf": [
  198. {
  199. "type": "object",
  200. "properties": {
  201. "success": {
  202. "type": "boolean",
  203. "const": true
  204. },
  205. "version": {
  206. "type": "string"
  207. }
  208. },
  209. "required": ["success", "version"]
  210. },
  211. {
  212. "type": "object",
  213. "properties": {
  214. "success": {
  215. "type": "boolean",
  216. "const": false
  217. },
  218. "error": {
  219. "type": "string"
  220. }
  221. },
  222. "required": ["success", "error"]
  223. }
  224. ]
  225. }
  226. }
  227. }
  228. },
  229. "400": {
  230. "description": "Bad request",
  231. "content": {
  232. "application/json": {
  233. "schema": {
  234. "$ref": "#/components/schemas/BadRequestError"
  235. }
  236. }
  237. }
  238. }
  239. },
  240. "requestBody": {
  241. "content": {
  242. "application/json": {
  243. "schema": {
  244. "type": "object",
  245. "properties": {
  246. "target": {
  247. "type": "string"
  248. }
  249. }
  250. }
  251. }
  252. }
  253. },
  254. "x-codeSamples": [
  255. {
  256. "lang": "js",
  257. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.upgrade({\n ...\n})"
  258. }
  259. ]
  260. }
  261. },
  262. "/auth/{providerID}": {
  263. "put": {
  264. "operationId": "auth.set",
  265. "summary": "Set auth credentials",
  266. "description": "Set authentication credentials",
  267. "responses": {
  268. "200": {
  269. "description": "Successfully set authentication credentials",
  270. "content": {
  271. "application/json": {
  272. "schema": {
  273. "type": "boolean"
  274. }
  275. }
  276. }
  277. },
  278. "400": {
  279. "description": "Bad request",
  280. "content": {
  281. "application/json": {
  282. "schema": {
  283. "$ref": "#/components/schemas/BadRequestError"
  284. }
  285. }
  286. }
  287. }
  288. },
  289. "parameters": [
  290. {
  291. "in": "path",
  292. "name": "providerID",
  293. "schema": {
  294. "type": "string"
  295. },
  296. "required": true
  297. }
  298. ],
  299. "requestBody": {
  300. "content": {
  301. "application/json": {
  302. "schema": {
  303. "$ref": "#/components/schemas/Auth"
  304. }
  305. }
  306. }
  307. },
  308. "x-codeSamples": [
  309. {
  310. "lang": "js",
  311. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.auth.set({\n ...\n})"
  312. }
  313. ]
  314. },
  315. "delete": {
  316. "operationId": "auth.remove",
  317. "summary": "Remove auth credentials",
  318. "description": "Remove authentication credentials",
  319. "responses": {
  320. "200": {
  321. "description": "Successfully removed authentication credentials",
  322. "content": {
  323. "application/json": {
  324. "schema": {
  325. "type": "boolean"
  326. }
  327. }
  328. }
  329. },
  330. "400": {
  331. "description": "Bad request",
  332. "content": {
  333. "application/json": {
  334. "schema": {
  335. "$ref": "#/components/schemas/BadRequestError"
  336. }
  337. }
  338. }
  339. }
  340. },
  341. "parameters": [
  342. {
  343. "in": "path",
  344. "name": "providerID",
  345. "schema": {
  346. "type": "string"
  347. },
  348. "required": true
  349. }
  350. ],
  351. "x-codeSamples": [
  352. {
  353. "lang": "js",
  354. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.auth.remove({\n ...\n})"
  355. }
  356. ]
  357. }
  358. },
  359. "/log": {
  360. "post": {
  361. "operationId": "app.log",
  362. "parameters": [
  363. {
  364. "in": "query",
  365. "name": "directory",
  366. "schema": {
  367. "type": "string"
  368. }
  369. },
  370. {
  371. "in": "query",
  372. "name": "workspace",
  373. "schema": {
  374. "type": "string"
  375. }
  376. }
  377. ],
  378. "summary": "Write log",
  379. "description": "Write a log entry to the server logs with specified level and metadata.",
  380. "responses": {
  381. "200": {
  382. "description": "Log entry written successfully",
  383. "content": {
  384. "application/json": {
  385. "schema": {
  386. "type": "boolean"
  387. }
  388. }
  389. }
  390. },
  391. "400": {
  392. "description": "Bad request",
  393. "content": {
  394. "application/json": {
  395. "schema": {
  396. "$ref": "#/components/schemas/BadRequestError"
  397. }
  398. }
  399. }
  400. }
  401. },
  402. "requestBody": {
  403. "content": {
  404. "application/json": {
  405. "schema": {
  406. "type": "object",
  407. "properties": {
  408. "service": {
  409. "description": "Service name for the log entry",
  410. "type": "string"
  411. },
  412. "level": {
  413. "description": "Log level",
  414. "type": "string",
  415. "enum": ["debug", "info", "error", "warn"]
  416. },
  417. "message": {
  418. "description": "Log message",
  419. "type": "string"
  420. },
  421. "extra": {
  422. "description": "Additional metadata for the log entry",
  423. "type": "object",
  424. "propertyNames": {
  425. "type": "string"
  426. },
  427. "additionalProperties": {}
  428. }
  429. },
  430. "required": ["service", "level", "message"]
  431. }
  432. }
  433. }
  434. },
  435. "x-codeSamples": [
  436. {
  437. "lang": "js",
  438. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.app.log({\n ...\n})"
  439. }
  440. ]
  441. }
  442. },
  443. "/project": {
  444. "get": {
  445. "operationId": "project.list",
  446. "parameters": [
  447. {
  448. "in": "query",
  449. "name": "directory",
  450. "schema": {
  451. "type": "string"
  452. }
  453. },
  454. {
  455. "in": "query",
  456. "name": "workspace",
  457. "schema": {
  458. "type": "string"
  459. }
  460. }
  461. ],
  462. "summary": "List all projects",
  463. "description": "Get a list of projects that have been opened with OpenCode.",
  464. "responses": {
  465. "200": {
  466. "description": "List of projects",
  467. "content": {
  468. "application/json": {
  469. "schema": {
  470. "type": "array",
  471. "items": {
  472. "$ref": "#/components/schemas/Project"
  473. }
  474. }
  475. }
  476. }
  477. }
  478. },
  479. "x-codeSamples": [
  480. {
  481. "lang": "js",
  482. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.list({\n ...\n})"
  483. }
  484. ]
  485. }
  486. },
  487. "/project/current": {
  488. "get": {
  489. "operationId": "project.current",
  490. "parameters": [
  491. {
  492. "in": "query",
  493. "name": "directory",
  494. "schema": {
  495. "type": "string"
  496. }
  497. },
  498. {
  499. "in": "query",
  500. "name": "workspace",
  501. "schema": {
  502. "type": "string"
  503. }
  504. }
  505. ],
  506. "summary": "Get current project",
  507. "description": "Retrieve the currently active project that OpenCode is working with.",
  508. "responses": {
  509. "200": {
  510. "description": "Current project information",
  511. "content": {
  512. "application/json": {
  513. "schema": {
  514. "$ref": "#/components/schemas/Project"
  515. }
  516. }
  517. }
  518. }
  519. },
  520. "x-codeSamples": [
  521. {
  522. "lang": "js",
  523. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.current({\n ...\n})"
  524. }
  525. ]
  526. }
  527. },
  528. "/project/git/init": {
  529. "post": {
  530. "operationId": "project.initGit",
  531. "parameters": [
  532. {
  533. "in": "query",
  534. "name": "directory",
  535. "schema": {
  536. "type": "string"
  537. }
  538. },
  539. {
  540. "in": "query",
  541. "name": "workspace",
  542. "schema": {
  543. "type": "string"
  544. }
  545. }
  546. ],
  547. "summary": "Initialize git repository",
  548. "description": "Create a git repository for the current project and return the refreshed project info.",
  549. "responses": {
  550. "200": {
  551. "description": "Project information after git initialization",
  552. "content": {
  553. "application/json": {
  554. "schema": {
  555. "$ref": "#/components/schemas/Project"
  556. }
  557. }
  558. }
  559. }
  560. },
  561. "x-codeSamples": [
  562. {
  563. "lang": "js",
  564. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.initGit({\n ...\n})"
  565. }
  566. ]
  567. }
  568. },
  569. "/project/{projectID}": {
  570. "patch": {
  571. "operationId": "project.update",
  572. "parameters": [
  573. {
  574. "in": "query",
  575. "name": "directory",
  576. "schema": {
  577. "type": "string"
  578. }
  579. },
  580. {
  581. "in": "query",
  582. "name": "workspace",
  583. "schema": {
  584. "type": "string"
  585. }
  586. },
  587. {
  588. "in": "path",
  589. "name": "projectID",
  590. "schema": {
  591. "type": "string"
  592. },
  593. "required": true
  594. }
  595. ],
  596. "summary": "Update project",
  597. "description": "Update project properties such as name, icon, and commands.",
  598. "responses": {
  599. "200": {
  600. "description": "Updated project information",
  601. "content": {
  602. "application/json": {
  603. "schema": {
  604. "$ref": "#/components/schemas/Project"
  605. }
  606. }
  607. }
  608. },
  609. "400": {
  610. "description": "Bad request",
  611. "content": {
  612. "application/json": {
  613. "schema": {
  614. "$ref": "#/components/schemas/BadRequestError"
  615. }
  616. }
  617. }
  618. },
  619. "404": {
  620. "description": "Not found",
  621. "content": {
  622. "application/json": {
  623. "schema": {
  624. "$ref": "#/components/schemas/NotFoundError"
  625. }
  626. }
  627. }
  628. }
  629. },
  630. "requestBody": {
  631. "content": {
  632. "application/json": {
  633. "schema": {
  634. "type": "object",
  635. "properties": {
  636. "name": {
  637. "type": "string"
  638. },
  639. "icon": {
  640. "type": "object",
  641. "properties": {
  642. "url": {
  643. "type": "string"
  644. },
  645. "override": {
  646. "type": "string"
  647. },
  648. "color": {
  649. "type": "string"
  650. }
  651. }
  652. },
  653. "commands": {
  654. "type": "object",
  655. "properties": {
  656. "start": {
  657. "description": "Startup script to run when creating a new workspace (worktree)",
  658. "type": "string"
  659. }
  660. }
  661. }
  662. }
  663. }
  664. }
  665. }
  666. },
  667. "x-codeSamples": [
  668. {
  669. "lang": "js",
  670. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.update({\n ...\n})"
  671. }
  672. ]
  673. }
  674. },
  675. "/pty": {
  676. "get": {
  677. "operationId": "pty.list",
  678. "parameters": [
  679. {
  680. "in": "query",
  681. "name": "directory",
  682. "schema": {
  683. "type": "string"
  684. }
  685. },
  686. {
  687. "in": "query",
  688. "name": "workspace",
  689. "schema": {
  690. "type": "string"
  691. }
  692. }
  693. ],
  694. "summary": "List PTY sessions",
  695. "description": "Get a list of all active pseudo-terminal (PTY) sessions managed by OpenCode.",
  696. "responses": {
  697. "200": {
  698. "description": "List of sessions",
  699. "content": {
  700. "application/json": {
  701. "schema": {
  702. "type": "array",
  703. "items": {
  704. "$ref": "#/components/schemas/Pty"
  705. }
  706. }
  707. }
  708. }
  709. }
  710. },
  711. "x-codeSamples": [
  712. {
  713. "lang": "js",
  714. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.list({\n ...\n})"
  715. }
  716. ]
  717. },
  718. "post": {
  719. "operationId": "pty.create",
  720. "parameters": [
  721. {
  722. "in": "query",
  723. "name": "directory",
  724. "schema": {
  725. "type": "string"
  726. }
  727. },
  728. {
  729. "in": "query",
  730. "name": "workspace",
  731. "schema": {
  732. "type": "string"
  733. }
  734. }
  735. ],
  736. "summary": "Create PTY session",
  737. "description": "Create a new pseudo-terminal (PTY) session for running shell commands and processes.",
  738. "responses": {
  739. "200": {
  740. "description": "Created session",
  741. "content": {
  742. "application/json": {
  743. "schema": {
  744. "$ref": "#/components/schemas/Pty"
  745. }
  746. }
  747. }
  748. },
  749. "400": {
  750. "description": "Bad request",
  751. "content": {
  752. "application/json": {
  753. "schema": {
  754. "$ref": "#/components/schemas/BadRequestError"
  755. }
  756. }
  757. }
  758. }
  759. },
  760. "requestBody": {
  761. "content": {
  762. "application/json": {
  763. "schema": {
  764. "type": "object",
  765. "properties": {
  766. "command": {
  767. "type": "string"
  768. },
  769. "args": {
  770. "type": "array",
  771. "items": {
  772. "type": "string"
  773. }
  774. },
  775. "cwd": {
  776. "type": "string"
  777. },
  778. "title": {
  779. "type": "string"
  780. },
  781. "env": {
  782. "type": "object",
  783. "propertyNames": {
  784. "type": "string"
  785. },
  786. "additionalProperties": {
  787. "type": "string"
  788. }
  789. }
  790. }
  791. }
  792. }
  793. }
  794. },
  795. "x-codeSamples": [
  796. {
  797. "lang": "js",
  798. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.create({\n ...\n})"
  799. }
  800. ]
  801. }
  802. },
  803. "/pty/{ptyID}": {
  804. "get": {
  805. "operationId": "pty.get",
  806. "parameters": [
  807. {
  808. "in": "query",
  809. "name": "directory",
  810. "schema": {
  811. "type": "string"
  812. }
  813. },
  814. {
  815. "in": "query",
  816. "name": "workspace",
  817. "schema": {
  818. "type": "string"
  819. }
  820. },
  821. {
  822. "in": "path",
  823. "name": "ptyID",
  824. "schema": {
  825. "type": "string",
  826. "pattern": "^pty.*"
  827. },
  828. "required": true
  829. }
  830. ],
  831. "summary": "Get PTY session",
  832. "description": "Retrieve detailed information about a specific pseudo-terminal (PTY) session.",
  833. "responses": {
  834. "200": {
  835. "description": "Session info",
  836. "content": {
  837. "application/json": {
  838. "schema": {
  839. "$ref": "#/components/schemas/Pty"
  840. }
  841. }
  842. }
  843. },
  844. "404": {
  845. "description": "Not found",
  846. "content": {
  847. "application/json": {
  848. "schema": {
  849. "$ref": "#/components/schemas/NotFoundError"
  850. }
  851. }
  852. }
  853. }
  854. },
  855. "x-codeSamples": [
  856. {
  857. "lang": "js",
  858. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.get({\n ...\n})"
  859. }
  860. ]
  861. },
  862. "put": {
  863. "operationId": "pty.update",
  864. "parameters": [
  865. {
  866. "in": "query",
  867. "name": "directory",
  868. "schema": {
  869. "type": "string"
  870. }
  871. },
  872. {
  873. "in": "query",
  874. "name": "workspace",
  875. "schema": {
  876. "type": "string"
  877. }
  878. },
  879. {
  880. "in": "path",
  881. "name": "ptyID",
  882. "schema": {
  883. "type": "string",
  884. "pattern": "^pty.*"
  885. },
  886. "required": true
  887. }
  888. ],
  889. "summary": "Update PTY session",
  890. "description": "Update properties of an existing pseudo-terminal (PTY) session.",
  891. "responses": {
  892. "200": {
  893. "description": "Updated session",
  894. "content": {
  895. "application/json": {
  896. "schema": {
  897. "$ref": "#/components/schemas/Pty"
  898. }
  899. }
  900. }
  901. },
  902. "400": {
  903. "description": "Bad request",
  904. "content": {
  905. "application/json": {
  906. "schema": {
  907. "$ref": "#/components/schemas/BadRequestError"
  908. }
  909. }
  910. }
  911. }
  912. },
  913. "requestBody": {
  914. "content": {
  915. "application/json": {
  916. "schema": {
  917. "type": "object",
  918. "properties": {
  919. "title": {
  920. "type": "string"
  921. },
  922. "size": {
  923. "type": "object",
  924. "properties": {
  925. "rows": {
  926. "type": "number"
  927. },
  928. "cols": {
  929. "type": "number"
  930. }
  931. },
  932. "required": ["rows", "cols"]
  933. }
  934. }
  935. }
  936. }
  937. }
  938. },
  939. "x-codeSamples": [
  940. {
  941. "lang": "js",
  942. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.update({\n ...\n})"
  943. }
  944. ]
  945. },
  946. "delete": {
  947. "operationId": "pty.remove",
  948. "parameters": [
  949. {
  950. "in": "query",
  951. "name": "directory",
  952. "schema": {
  953. "type": "string"
  954. }
  955. },
  956. {
  957. "in": "query",
  958. "name": "workspace",
  959. "schema": {
  960. "type": "string"
  961. }
  962. },
  963. {
  964. "in": "path",
  965. "name": "ptyID",
  966. "schema": {
  967. "type": "string",
  968. "pattern": "^pty.*"
  969. },
  970. "required": true
  971. }
  972. ],
  973. "summary": "Remove PTY session",
  974. "description": "Remove and terminate a specific pseudo-terminal (PTY) session.",
  975. "responses": {
  976. "200": {
  977. "description": "Session removed",
  978. "content": {
  979. "application/json": {
  980. "schema": {
  981. "type": "boolean"
  982. }
  983. }
  984. }
  985. },
  986. "404": {
  987. "description": "Not found",
  988. "content": {
  989. "application/json": {
  990. "schema": {
  991. "$ref": "#/components/schemas/NotFoundError"
  992. }
  993. }
  994. }
  995. }
  996. },
  997. "x-codeSamples": [
  998. {
  999. "lang": "js",
  1000. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.remove({\n ...\n})"
  1001. }
  1002. ]
  1003. }
  1004. },
  1005. "/pty/{ptyID}/connect": {
  1006. "get": {
  1007. "operationId": "pty.connect",
  1008. "parameters": [
  1009. {
  1010. "in": "query",
  1011. "name": "directory",
  1012. "schema": {
  1013. "type": "string"
  1014. }
  1015. },
  1016. {
  1017. "in": "query",
  1018. "name": "workspace",
  1019. "schema": {
  1020. "type": "string"
  1021. }
  1022. },
  1023. {
  1024. "in": "path",
  1025. "name": "ptyID",
  1026. "schema": {
  1027. "type": "string",
  1028. "pattern": "^pty.*"
  1029. },
  1030. "required": true
  1031. }
  1032. ],
  1033. "summary": "Connect to PTY session",
  1034. "description": "Establish a WebSocket connection to interact with a pseudo-terminal (PTY) session in real-time.",
  1035. "responses": {
  1036. "200": {
  1037. "description": "Connected session",
  1038. "content": {
  1039. "application/json": {
  1040. "schema": {
  1041. "type": "boolean"
  1042. }
  1043. }
  1044. }
  1045. },
  1046. "404": {
  1047. "description": "Not found",
  1048. "content": {
  1049. "application/json": {
  1050. "schema": {
  1051. "$ref": "#/components/schemas/NotFoundError"
  1052. }
  1053. }
  1054. }
  1055. }
  1056. },
  1057. "x-codeSamples": [
  1058. {
  1059. "lang": "js",
  1060. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.connect({\n ...\n})"
  1061. }
  1062. ]
  1063. }
  1064. },
  1065. "/config": {
  1066. "get": {
  1067. "operationId": "config.get",
  1068. "parameters": [
  1069. {
  1070. "in": "query",
  1071. "name": "directory",
  1072. "schema": {
  1073. "type": "string"
  1074. }
  1075. },
  1076. {
  1077. "in": "query",
  1078. "name": "workspace",
  1079. "schema": {
  1080. "type": "string"
  1081. }
  1082. }
  1083. ],
  1084. "summary": "Get configuration",
  1085. "description": "Retrieve the current OpenCode configuration settings and preferences.",
  1086. "responses": {
  1087. "200": {
  1088. "description": "Get config info",
  1089. "content": {
  1090. "application/json": {
  1091. "schema": {
  1092. "$ref": "#/components/schemas/Config"
  1093. }
  1094. }
  1095. }
  1096. }
  1097. },
  1098. "x-codeSamples": [
  1099. {
  1100. "lang": "js",
  1101. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.config.get({\n ...\n})"
  1102. }
  1103. ]
  1104. },
  1105. "patch": {
  1106. "operationId": "config.update",
  1107. "parameters": [
  1108. {
  1109. "in": "query",
  1110. "name": "directory",
  1111. "schema": {
  1112. "type": "string"
  1113. }
  1114. },
  1115. {
  1116. "in": "query",
  1117. "name": "workspace",
  1118. "schema": {
  1119. "type": "string"
  1120. }
  1121. }
  1122. ],
  1123. "summary": "Update configuration",
  1124. "description": "Update OpenCode configuration settings and preferences.",
  1125. "responses": {
  1126. "200": {
  1127. "description": "Successfully updated config",
  1128. "content": {
  1129. "application/json": {
  1130. "schema": {
  1131. "$ref": "#/components/schemas/Config"
  1132. }
  1133. }
  1134. }
  1135. },
  1136. "400": {
  1137. "description": "Bad request",
  1138. "content": {
  1139. "application/json": {
  1140. "schema": {
  1141. "$ref": "#/components/schemas/BadRequestError"
  1142. }
  1143. }
  1144. }
  1145. }
  1146. },
  1147. "requestBody": {
  1148. "content": {
  1149. "application/json": {
  1150. "schema": {
  1151. "$ref": "#/components/schemas/Config"
  1152. }
  1153. }
  1154. }
  1155. },
  1156. "x-codeSamples": [
  1157. {
  1158. "lang": "js",
  1159. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.config.update({\n ...\n})"
  1160. }
  1161. ]
  1162. }
  1163. },
  1164. "/config/providers": {
  1165. "get": {
  1166. "operationId": "config.providers",
  1167. "parameters": [
  1168. {
  1169. "in": "query",
  1170. "name": "directory",
  1171. "schema": {
  1172. "type": "string"
  1173. }
  1174. },
  1175. {
  1176. "in": "query",
  1177. "name": "workspace",
  1178. "schema": {
  1179. "type": "string"
  1180. }
  1181. }
  1182. ],
  1183. "summary": "List config providers",
  1184. "description": "Get a list of all configured AI providers and their default models.",
  1185. "responses": {
  1186. "200": {
  1187. "description": "List of providers",
  1188. "content": {
  1189. "application/json": {
  1190. "schema": {
  1191. "type": "object",
  1192. "properties": {
  1193. "providers": {
  1194. "type": "array",
  1195. "items": {
  1196. "$ref": "#/components/schemas/Provider"
  1197. }
  1198. },
  1199. "default": {
  1200. "type": "object",
  1201. "propertyNames": {
  1202. "type": "string"
  1203. },
  1204. "additionalProperties": {
  1205. "type": "string"
  1206. }
  1207. }
  1208. },
  1209. "required": ["providers", "default"]
  1210. }
  1211. }
  1212. }
  1213. }
  1214. },
  1215. "x-codeSamples": [
  1216. {
  1217. "lang": "js",
  1218. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.config.providers({\n ...\n})"
  1219. }
  1220. ]
  1221. }
  1222. },
  1223. "/experimental/tool/ids": {
  1224. "get": {
  1225. "operationId": "tool.ids",
  1226. "parameters": [
  1227. {
  1228. "in": "query",
  1229. "name": "directory",
  1230. "schema": {
  1231. "type": "string"
  1232. }
  1233. },
  1234. {
  1235. "in": "query",
  1236. "name": "workspace",
  1237. "schema": {
  1238. "type": "string"
  1239. }
  1240. }
  1241. ],
  1242. "summary": "List tool IDs",
  1243. "description": "Get a list of all available tool IDs, including both built-in tools and dynamically registered tools.",
  1244. "responses": {
  1245. "200": {
  1246. "description": "Tool IDs",
  1247. "content": {
  1248. "application/json": {
  1249. "schema": {
  1250. "$ref": "#/components/schemas/ToolIDs"
  1251. }
  1252. }
  1253. }
  1254. },
  1255. "400": {
  1256. "description": "Bad request",
  1257. "content": {
  1258. "application/json": {
  1259. "schema": {
  1260. "$ref": "#/components/schemas/BadRequestError"
  1261. }
  1262. }
  1263. }
  1264. }
  1265. },
  1266. "x-codeSamples": [
  1267. {
  1268. "lang": "js",
  1269. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tool.ids({\n ...\n})"
  1270. }
  1271. ]
  1272. }
  1273. },
  1274. "/experimental/tool": {
  1275. "get": {
  1276. "operationId": "tool.list",
  1277. "parameters": [
  1278. {
  1279. "in": "query",
  1280. "name": "directory",
  1281. "schema": {
  1282. "type": "string"
  1283. }
  1284. },
  1285. {
  1286. "in": "query",
  1287. "name": "workspace",
  1288. "schema": {
  1289. "type": "string"
  1290. }
  1291. },
  1292. {
  1293. "in": "query",
  1294. "name": "provider",
  1295. "schema": {
  1296. "type": "string"
  1297. },
  1298. "required": true
  1299. },
  1300. {
  1301. "in": "query",
  1302. "name": "model",
  1303. "schema": {
  1304. "type": "string"
  1305. },
  1306. "required": true
  1307. }
  1308. ],
  1309. "summary": "List tools",
  1310. "description": "Get a list of available tools with their JSON schema parameters for a specific provider and model combination.",
  1311. "responses": {
  1312. "200": {
  1313. "description": "Tools",
  1314. "content": {
  1315. "application/json": {
  1316. "schema": {
  1317. "$ref": "#/components/schemas/ToolList"
  1318. }
  1319. }
  1320. }
  1321. },
  1322. "400": {
  1323. "description": "Bad request",
  1324. "content": {
  1325. "application/json": {
  1326. "schema": {
  1327. "$ref": "#/components/schemas/BadRequestError"
  1328. }
  1329. }
  1330. }
  1331. }
  1332. },
  1333. "x-codeSamples": [
  1334. {
  1335. "lang": "js",
  1336. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tool.list({\n ...\n})"
  1337. }
  1338. ]
  1339. }
  1340. },
  1341. "/experimental/workspace": {
  1342. "post": {
  1343. "operationId": "experimental.workspace.create",
  1344. "parameters": [
  1345. {
  1346. "in": "query",
  1347. "name": "directory",
  1348. "schema": {
  1349. "type": "string"
  1350. }
  1351. },
  1352. {
  1353. "in": "query",
  1354. "name": "workspace",
  1355. "schema": {
  1356. "type": "string"
  1357. }
  1358. }
  1359. ],
  1360. "summary": "Create workspace",
  1361. "description": "Create a workspace for the current project.",
  1362. "responses": {
  1363. "200": {
  1364. "description": "Workspace created",
  1365. "content": {
  1366. "application/json": {
  1367. "schema": {
  1368. "$ref": "#/components/schemas/Workspace"
  1369. }
  1370. }
  1371. }
  1372. },
  1373. "400": {
  1374. "description": "Bad request",
  1375. "content": {
  1376. "application/json": {
  1377. "schema": {
  1378. "$ref": "#/components/schemas/BadRequestError"
  1379. }
  1380. }
  1381. }
  1382. }
  1383. },
  1384. "requestBody": {
  1385. "content": {
  1386. "application/json": {
  1387. "schema": {
  1388. "type": "object",
  1389. "properties": {
  1390. "id": {
  1391. "type": "string",
  1392. "pattern": "^wrk.*"
  1393. },
  1394. "type": {
  1395. "type": "string"
  1396. },
  1397. "branch": {
  1398. "anyOf": [
  1399. {
  1400. "type": "string"
  1401. },
  1402. {
  1403. "type": "null"
  1404. }
  1405. ]
  1406. },
  1407. "extra": {
  1408. "anyOf": [
  1409. {},
  1410. {
  1411. "type": "null"
  1412. }
  1413. ]
  1414. }
  1415. },
  1416. "required": ["type", "branch", "extra"]
  1417. }
  1418. }
  1419. }
  1420. },
  1421. "x-codeSamples": [
  1422. {
  1423. "lang": "js",
  1424. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.create({\n ...\n})"
  1425. }
  1426. ]
  1427. },
  1428. "get": {
  1429. "operationId": "experimental.workspace.list",
  1430. "parameters": [
  1431. {
  1432. "in": "query",
  1433. "name": "directory",
  1434. "schema": {
  1435. "type": "string"
  1436. }
  1437. },
  1438. {
  1439. "in": "query",
  1440. "name": "workspace",
  1441. "schema": {
  1442. "type": "string"
  1443. }
  1444. }
  1445. ],
  1446. "summary": "List workspaces",
  1447. "description": "List all workspaces.",
  1448. "responses": {
  1449. "200": {
  1450. "description": "Workspaces",
  1451. "content": {
  1452. "application/json": {
  1453. "schema": {
  1454. "type": "array",
  1455. "items": {
  1456. "$ref": "#/components/schemas/Workspace"
  1457. }
  1458. }
  1459. }
  1460. }
  1461. }
  1462. },
  1463. "x-codeSamples": [
  1464. {
  1465. "lang": "js",
  1466. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.list({\n ...\n})"
  1467. }
  1468. ]
  1469. }
  1470. },
  1471. "/experimental/workspace/{id}": {
  1472. "delete": {
  1473. "operationId": "experimental.workspace.remove",
  1474. "parameters": [
  1475. {
  1476. "in": "query",
  1477. "name": "directory",
  1478. "schema": {
  1479. "type": "string"
  1480. }
  1481. },
  1482. {
  1483. "in": "query",
  1484. "name": "workspace",
  1485. "schema": {
  1486. "type": "string"
  1487. }
  1488. },
  1489. {
  1490. "in": "path",
  1491. "name": "id",
  1492. "schema": {
  1493. "type": "string",
  1494. "pattern": "^wrk.*"
  1495. },
  1496. "required": true
  1497. }
  1498. ],
  1499. "summary": "Remove workspace",
  1500. "description": "Remove an existing workspace.",
  1501. "responses": {
  1502. "200": {
  1503. "description": "Workspace removed",
  1504. "content": {
  1505. "application/json": {
  1506. "schema": {
  1507. "$ref": "#/components/schemas/Workspace"
  1508. }
  1509. }
  1510. }
  1511. },
  1512. "400": {
  1513. "description": "Bad request",
  1514. "content": {
  1515. "application/json": {
  1516. "schema": {
  1517. "$ref": "#/components/schemas/BadRequestError"
  1518. }
  1519. }
  1520. }
  1521. }
  1522. },
  1523. "x-codeSamples": [
  1524. {
  1525. "lang": "js",
  1526. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.remove({\n ...\n})"
  1527. }
  1528. ]
  1529. }
  1530. },
  1531. "/experimental/worktree": {
  1532. "post": {
  1533. "operationId": "worktree.create",
  1534. "parameters": [
  1535. {
  1536. "in": "query",
  1537. "name": "directory",
  1538. "schema": {
  1539. "type": "string"
  1540. }
  1541. },
  1542. {
  1543. "in": "query",
  1544. "name": "workspace",
  1545. "schema": {
  1546. "type": "string"
  1547. }
  1548. }
  1549. ],
  1550. "summary": "Create worktree",
  1551. "description": "Create a new git worktree for the current project and run any configured startup scripts.",
  1552. "responses": {
  1553. "200": {
  1554. "description": "Worktree created",
  1555. "content": {
  1556. "application/json": {
  1557. "schema": {
  1558. "$ref": "#/components/schemas/Worktree"
  1559. }
  1560. }
  1561. }
  1562. },
  1563. "400": {
  1564. "description": "Bad request",
  1565. "content": {
  1566. "application/json": {
  1567. "schema": {
  1568. "$ref": "#/components/schemas/BadRequestError"
  1569. }
  1570. }
  1571. }
  1572. }
  1573. },
  1574. "requestBody": {
  1575. "content": {
  1576. "application/json": {
  1577. "schema": {
  1578. "$ref": "#/components/schemas/WorktreeCreateInput"
  1579. }
  1580. }
  1581. }
  1582. },
  1583. "x-codeSamples": [
  1584. {
  1585. "lang": "js",
  1586. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.create({\n ...\n})"
  1587. }
  1588. ]
  1589. },
  1590. "get": {
  1591. "operationId": "worktree.list",
  1592. "parameters": [
  1593. {
  1594. "in": "query",
  1595. "name": "directory",
  1596. "schema": {
  1597. "type": "string"
  1598. }
  1599. },
  1600. {
  1601. "in": "query",
  1602. "name": "workspace",
  1603. "schema": {
  1604. "type": "string"
  1605. }
  1606. }
  1607. ],
  1608. "summary": "List worktrees",
  1609. "description": "List all sandbox worktrees for the current project.",
  1610. "responses": {
  1611. "200": {
  1612. "description": "List of worktree directories",
  1613. "content": {
  1614. "application/json": {
  1615. "schema": {
  1616. "type": "array",
  1617. "items": {
  1618. "type": "string"
  1619. }
  1620. }
  1621. }
  1622. }
  1623. }
  1624. },
  1625. "x-codeSamples": [
  1626. {
  1627. "lang": "js",
  1628. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.list({\n ...\n})"
  1629. }
  1630. ]
  1631. },
  1632. "delete": {
  1633. "operationId": "worktree.remove",
  1634. "parameters": [
  1635. {
  1636. "in": "query",
  1637. "name": "directory",
  1638. "schema": {
  1639. "type": "string"
  1640. }
  1641. },
  1642. {
  1643. "in": "query",
  1644. "name": "workspace",
  1645. "schema": {
  1646. "type": "string"
  1647. }
  1648. }
  1649. ],
  1650. "summary": "Remove worktree",
  1651. "description": "Remove a git worktree and delete its branch.",
  1652. "responses": {
  1653. "200": {
  1654. "description": "Worktree removed",
  1655. "content": {
  1656. "application/json": {
  1657. "schema": {
  1658. "type": "boolean"
  1659. }
  1660. }
  1661. }
  1662. },
  1663. "400": {
  1664. "description": "Bad request",
  1665. "content": {
  1666. "application/json": {
  1667. "schema": {
  1668. "$ref": "#/components/schemas/BadRequestError"
  1669. }
  1670. }
  1671. }
  1672. }
  1673. },
  1674. "requestBody": {
  1675. "content": {
  1676. "application/json": {
  1677. "schema": {
  1678. "$ref": "#/components/schemas/WorktreeRemoveInput"
  1679. }
  1680. }
  1681. }
  1682. },
  1683. "x-codeSamples": [
  1684. {
  1685. "lang": "js",
  1686. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.remove({\n ...\n})"
  1687. }
  1688. ]
  1689. }
  1690. },
  1691. "/experimental/worktree/reset": {
  1692. "post": {
  1693. "operationId": "worktree.reset",
  1694. "parameters": [
  1695. {
  1696. "in": "query",
  1697. "name": "directory",
  1698. "schema": {
  1699. "type": "string"
  1700. }
  1701. },
  1702. {
  1703. "in": "query",
  1704. "name": "workspace",
  1705. "schema": {
  1706. "type": "string"
  1707. }
  1708. }
  1709. ],
  1710. "summary": "Reset worktree",
  1711. "description": "Reset a worktree branch to the primary default branch.",
  1712. "responses": {
  1713. "200": {
  1714. "description": "Worktree reset",
  1715. "content": {
  1716. "application/json": {
  1717. "schema": {
  1718. "type": "boolean"
  1719. }
  1720. }
  1721. }
  1722. },
  1723. "400": {
  1724. "description": "Bad request",
  1725. "content": {
  1726. "application/json": {
  1727. "schema": {
  1728. "$ref": "#/components/schemas/BadRequestError"
  1729. }
  1730. }
  1731. }
  1732. }
  1733. },
  1734. "requestBody": {
  1735. "content": {
  1736. "application/json": {
  1737. "schema": {
  1738. "$ref": "#/components/schemas/WorktreeResetInput"
  1739. }
  1740. }
  1741. }
  1742. },
  1743. "x-codeSamples": [
  1744. {
  1745. "lang": "js",
  1746. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.reset({\n ...\n})"
  1747. }
  1748. ]
  1749. }
  1750. },
  1751. "/experimental/session": {
  1752. "get": {
  1753. "operationId": "experimental.session.list",
  1754. "parameters": [
  1755. {
  1756. "in": "query",
  1757. "name": "directory",
  1758. "schema": {
  1759. "type": "string"
  1760. },
  1761. "description": "Filter sessions by project directory"
  1762. },
  1763. {
  1764. "in": "query",
  1765. "name": "workspace",
  1766. "schema": {
  1767. "type": "string"
  1768. }
  1769. },
  1770. {
  1771. "in": "query",
  1772. "name": "roots",
  1773. "schema": {
  1774. "type": "boolean"
  1775. },
  1776. "description": "Only return root sessions (no parentID)"
  1777. },
  1778. {
  1779. "in": "query",
  1780. "name": "start",
  1781. "schema": {
  1782. "type": "number"
  1783. },
  1784. "description": "Filter sessions updated on or after this timestamp (milliseconds since epoch)"
  1785. },
  1786. {
  1787. "in": "query",
  1788. "name": "cursor",
  1789. "schema": {
  1790. "type": "number"
  1791. },
  1792. "description": "Return sessions updated before this timestamp (milliseconds since epoch)"
  1793. },
  1794. {
  1795. "in": "query",
  1796. "name": "search",
  1797. "schema": {
  1798. "type": "string"
  1799. },
  1800. "description": "Filter sessions by title (case-insensitive)"
  1801. },
  1802. {
  1803. "in": "query",
  1804. "name": "limit",
  1805. "schema": {
  1806. "type": "number"
  1807. },
  1808. "description": "Maximum number of sessions to return"
  1809. },
  1810. {
  1811. "in": "query",
  1812. "name": "archived",
  1813. "schema": {
  1814. "type": "boolean"
  1815. },
  1816. "description": "Include archived sessions (default false)"
  1817. }
  1818. ],
  1819. "summary": "List sessions",
  1820. "description": "Get a list of all OpenCode sessions across projects, sorted by most recently updated. Archived sessions are excluded by default.",
  1821. "responses": {
  1822. "200": {
  1823. "description": "List of sessions",
  1824. "content": {
  1825. "application/json": {
  1826. "schema": {
  1827. "type": "array",
  1828. "items": {
  1829. "$ref": "#/components/schemas/GlobalSession"
  1830. }
  1831. }
  1832. }
  1833. }
  1834. }
  1835. },
  1836. "x-codeSamples": [
  1837. {
  1838. "lang": "js",
  1839. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.session.list({\n ...\n})"
  1840. }
  1841. ]
  1842. }
  1843. },
  1844. "/experimental/resource": {
  1845. "get": {
  1846. "operationId": "experimental.resource.list",
  1847. "parameters": [
  1848. {
  1849. "in": "query",
  1850. "name": "directory",
  1851. "schema": {
  1852. "type": "string"
  1853. }
  1854. },
  1855. {
  1856. "in": "query",
  1857. "name": "workspace",
  1858. "schema": {
  1859. "type": "string"
  1860. }
  1861. }
  1862. ],
  1863. "summary": "Get MCP resources",
  1864. "description": "Get all available MCP resources from connected servers. Optionally filter by name.",
  1865. "responses": {
  1866. "200": {
  1867. "description": "MCP resources",
  1868. "content": {
  1869. "application/json": {
  1870. "schema": {
  1871. "type": "object",
  1872. "propertyNames": {
  1873. "type": "string"
  1874. },
  1875. "additionalProperties": {
  1876. "$ref": "#/components/schemas/McpResource"
  1877. }
  1878. }
  1879. }
  1880. }
  1881. }
  1882. },
  1883. "x-codeSamples": [
  1884. {
  1885. "lang": "js",
  1886. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.resource.list({\n ...\n})"
  1887. }
  1888. ]
  1889. }
  1890. },
  1891. "/session": {
  1892. "get": {
  1893. "operationId": "session.list",
  1894. "parameters": [
  1895. {
  1896. "in": "query",
  1897. "name": "directory",
  1898. "schema": {
  1899. "type": "string"
  1900. },
  1901. "description": "Filter sessions by project directory"
  1902. },
  1903. {
  1904. "in": "query",
  1905. "name": "workspace",
  1906. "schema": {
  1907. "type": "string"
  1908. }
  1909. },
  1910. {
  1911. "in": "query",
  1912. "name": "roots",
  1913. "schema": {
  1914. "type": "boolean"
  1915. },
  1916. "description": "Only return root sessions (no parentID)"
  1917. },
  1918. {
  1919. "in": "query",
  1920. "name": "start",
  1921. "schema": {
  1922. "type": "number"
  1923. },
  1924. "description": "Filter sessions updated on or after this timestamp (milliseconds since epoch)"
  1925. },
  1926. {
  1927. "in": "query",
  1928. "name": "search",
  1929. "schema": {
  1930. "type": "string"
  1931. },
  1932. "description": "Filter sessions by title (case-insensitive)"
  1933. },
  1934. {
  1935. "in": "query",
  1936. "name": "limit",
  1937. "schema": {
  1938. "type": "number"
  1939. },
  1940. "description": "Maximum number of sessions to return"
  1941. }
  1942. ],
  1943. "summary": "List sessions",
  1944. "description": "Get a list of all OpenCode sessions, sorted by most recently updated.",
  1945. "responses": {
  1946. "200": {
  1947. "description": "List of sessions",
  1948. "content": {
  1949. "application/json": {
  1950. "schema": {
  1951. "type": "array",
  1952. "items": {
  1953. "$ref": "#/components/schemas/Session"
  1954. }
  1955. }
  1956. }
  1957. }
  1958. }
  1959. },
  1960. "x-codeSamples": [
  1961. {
  1962. "lang": "js",
  1963. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.list({\n ...\n})"
  1964. }
  1965. ]
  1966. },
  1967. "post": {
  1968. "operationId": "session.create",
  1969. "parameters": [
  1970. {
  1971. "in": "query",
  1972. "name": "directory",
  1973. "schema": {
  1974. "type": "string"
  1975. }
  1976. },
  1977. {
  1978. "in": "query",
  1979. "name": "workspace",
  1980. "schema": {
  1981. "type": "string"
  1982. }
  1983. }
  1984. ],
  1985. "summary": "Create session",
  1986. "description": "Create a new OpenCode session for interacting with AI assistants and managing conversations.",
  1987. "responses": {
  1988. "200": {
  1989. "description": "Successfully created session",
  1990. "content": {
  1991. "application/json": {
  1992. "schema": {
  1993. "$ref": "#/components/schemas/Session"
  1994. }
  1995. }
  1996. }
  1997. },
  1998. "400": {
  1999. "description": "Bad request",
  2000. "content": {
  2001. "application/json": {
  2002. "schema": {
  2003. "$ref": "#/components/schemas/BadRequestError"
  2004. }
  2005. }
  2006. }
  2007. }
  2008. },
  2009. "requestBody": {
  2010. "content": {
  2011. "application/json": {
  2012. "schema": {
  2013. "type": "object",
  2014. "properties": {
  2015. "parentID": {
  2016. "type": "string",
  2017. "pattern": "^ses.*"
  2018. },
  2019. "title": {
  2020. "type": "string"
  2021. },
  2022. "permission": {
  2023. "$ref": "#/components/schemas/PermissionRuleset"
  2024. },
  2025. "workspaceID": {
  2026. "type": "string",
  2027. "pattern": "^wrk.*"
  2028. }
  2029. }
  2030. }
  2031. }
  2032. }
  2033. },
  2034. "x-codeSamples": [
  2035. {
  2036. "lang": "js",
  2037. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.create({\n ...\n})"
  2038. }
  2039. ]
  2040. }
  2041. },
  2042. "/session/status": {
  2043. "get": {
  2044. "operationId": "session.status",
  2045. "parameters": [
  2046. {
  2047. "in": "query",
  2048. "name": "directory",
  2049. "schema": {
  2050. "type": "string"
  2051. }
  2052. },
  2053. {
  2054. "in": "query",
  2055. "name": "workspace",
  2056. "schema": {
  2057. "type": "string"
  2058. }
  2059. }
  2060. ],
  2061. "summary": "Get session status",
  2062. "description": "Retrieve the current status of all sessions, including active, idle, and completed states.",
  2063. "responses": {
  2064. "200": {
  2065. "description": "Get session status",
  2066. "content": {
  2067. "application/json": {
  2068. "schema": {
  2069. "type": "object",
  2070. "propertyNames": {
  2071. "type": "string"
  2072. },
  2073. "additionalProperties": {
  2074. "$ref": "#/components/schemas/SessionStatus"
  2075. }
  2076. }
  2077. }
  2078. }
  2079. },
  2080. "400": {
  2081. "description": "Bad request",
  2082. "content": {
  2083. "application/json": {
  2084. "schema": {
  2085. "$ref": "#/components/schemas/BadRequestError"
  2086. }
  2087. }
  2088. }
  2089. }
  2090. },
  2091. "x-codeSamples": [
  2092. {
  2093. "lang": "js",
  2094. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.status({\n ...\n})"
  2095. }
  2096. ]
  2097. }
  2098. },
  2099. "/session/{sessionID}": {
  2100. "get": {
  2101. "operationId": "session.get",
  2102. "parameters": [
  2103. {
  2104. "in": "query",
  2105. "name": "directory",
  2106. "schema": {
  2107. "type": "string"
  2108. }
  2109. },
  2110. {
  2111. "in": "query",
  2112. "name": "workspace",
  2113. "schema": {
  2114. "type": "string"
  2115. }
  2116. },
  2117. {
  2118. "in": "path",
  2119. "name": "sessionID",
  2120. "schema": {
  2121. "type": "string",
  2122. "pattern": "^ses.*"
  2123. },
  2124. "required": true
  2125. }
  2126. ],
  2127. "summary": "Get session",
  2128. "description": "Retrieve detailed information about a specific OpenCode session.",
  2129. "tags": ["Session"],
  2130. "responses": {
  2131. "200": {
  2132. "description": "Get session",
  2133. "content": {
  2134. "application/json": {
  2135. "schema": {
  2136. "$ref": "#/components/schemas/Session"
  2137. }
  2138. }
  2139. }
  2140. },
  2141. "400": {
  2142. "description": "Bad request",
  2143. "content": {
  2144. "application/json": {
  2145. "schema": {
  2146. "$ref": "#/components/schemas/BadRequestError"
  2147. }
  2148. }
  2149. }
  2150. },
  2151. "404": {
  2152. "description": "Not found",
  2153. "content": {
  2154. "application/json": {
  2155. "schema": {
  2156. "$ref": "#/components/schemas/NotFoundError"
  2157. }
  2158. }
  2159. }
  2160. }
  2161. },
  2162. "x-codeSamples": [
  2163. {
  2164. "lang": "js",
  2165. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.get({\n ...\n})"
  2166. }
  2167. ]
  2168. },
  2169. "delete": {
  2170. "operationId": "session.delete",
  2171. "parameters": [
  2172. {
  2173. "in": "query",
  2174. "name": "directory",
  2175. "schema": {
  2176. "type": "string"
  2177. }
  2178. },
  2179. {
  2180. "in": "query",
  2181. "name": "workspace",
  2182. "schema": {
  2183. "type": "string"
  2184. }
  2185. },
  2186. {
  2187. "in": "path",
  2188. "name": "sessionID",
  2189. "schema": {
  2190. "type": "string",
  2191. "pattern": "^ses.*"
  2192. },
  2193. "required": true
  2194. }
  2195. ],
  2196. "summary": "Delete session",
  2197. "description": "Delete a session and permanently remove all associated data, including messages and history.",
  2198. "responses": {
  2199. "200": {
  2200. "description": "Successfully deleted session",
  2201. "content": {
  2202. "application/json": {
  2203. "schema": {
  2204. "type": "boolean"
  2205. }
  2206. }
  2207. }
  2208. },
  2209. "400": {
  2210. "description": "Bad request",
  2211. "content": {
  2212. "application/json": {
  2213. "schema": {
  2214. "$ref": "#/components/schemas/BadRequestError"
  2215. }
  2216. }
  2217. }
  2218. },
  2219. "404": {
  2220. "description": "Not found",
  2221. "content": {
  2222. "application/json": {
  2223. "schema": {
  2224. "$ref": "#/components/schemas/NotFoundError"
  2225. }
  2226. }
  2227. }
  2228. }
  2229. },
  2230. "x-codeSamples": [
  2231. {
  2232. "lang": "js",
  2233. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.delete({\n ...\n})"
  2234. }
  2235. ]
  2236. },
  2237. "patch": {
  2238. "operationId": "session.update",
  2239. "parameters": [
  2240. {
  2241. "in": "query",
  2242. "name": "directory",
  2243. "schema": {
  2244. "type": "string"
  2245. }
  2246. },
  2247. {
  2248. "in": "query",
  2249. "name": "workspace",
  2250. "schema": {
  2251. "type": "string"
  2252. }
  2253. },
  2254. {
  2255. "in": "path",
  2256. "name": "sessionID",
  2257. "schema": {
  2258. "type": "string",
  2259. "pattern": "^ses.*"
  2260. },
  2261. "required": true
  2262. }
  2263. ],
  2264. "summary": "Update session",
  2265. "description": "Update properties of an existing session, such as title or other metadata.",
  2266. "responses": {
  2267. "200": {
  2268. "description": "Successfully updated session",
  2269. "content": {
  2270. "application/json": {
  2271. "schema": {
  2272. "$ref": "#/components/schemas/Session"
  2273. }
  2274. }
  2275. }
  2276. },
  2277. "400": {
  2278. "description": "Bad request",
  2279. "content": {
  2280. "application/json": {
  2281. "schema": {
  2282. "$ref": "#/components/schemas/BadRequestError"
  2283. }
  2284. }
  2285. }
  2286. },
  2287. "404": {
  2288. "description": "Not found",
  2289. "content": {
  2290. "application/json": {
  2291. "schema": {
  2292. "$ref": "#/components/schemas/NotFoundError"
  2293. }
  2294. }
  2295. }
  2296. }
  2297. },
  2298. "requestBody": {
  2299. "content": {
  2300. "application/json": {
  2301. "schema": {
  2302. "type": "object",
  2303. "properties": {
  2304. "title": {
  2305. "type": "string"
  2306. },
  2307. "time": {
  2308. "type": "object",
  2309. "properties": {
  2310. "archived": {
  2311. "type": "number"
  2312. }
  2313. }
  2314. }
  2315. }
  2316. }
  2317. }
  2318. }
  2319. },
  2320. "x-codeSamples": [
  2321. {
  2322. "lang": "js",
  2323. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.update({\n ...\n})"
  2324. }
  2325. ]
  2326. }
  2327. },
  2328. "/session/{sessionID}/children": {
  2329. "get": {
  2330. "operationId": "session.children",
  2331. "parameters": [
  2332. {
  2333. "in": "query",
  2334. "name": "directory",
  2335. "schema": {
  2336. "type": "string"
  2337. }
  2338. },
  2339. {
  2340. "in": "query",
  2341. "name": "workspace",
  2342. "schema": {
  2343. "type": "string"
  2344. }
  2345. },
  2346. {
  2347. "in": "path",
  2348. "name": "sessionID",
  2349. "schema": {
  2350. "type": "string",
  2351. "pattern": "^ses.*"
  2352. },
  2353. "required": true
  2354. }
  2355. ],
  2356. "summary": "Get session children",
  2357. "tags": ["Session"],
  2358. "description": "Retrieve all child sessions that were forked from the specified parent session.",
  2359. "responses": {
  2360. "200": {
  2361. "description": "List of children",
  2362. "content": {
  2363. "application/json": {
  2364. "schema": {
  2365. "type": "array",
  2366. "items": {
  2367. "$ref": "#/components/schemas/Session"
  2368. }
  2369. }
  2370. }
  2371. }
  2372. },
  2373. "400": {
  2374. "description": "Bad request",
  2375. "content": {
  2376. "application/json": {
  2377. "schema": {
  2378. "$ref": "#/components/schemas/BadRequestError"
  2379. }
  2380. }
  2381. }
  2382. },
  2383. "404": {
  2384. "description": "Not found",
  2385. "content": {
  2386. "application/json": {
  2387. "schema": {
  2388. "$ref": "#/components/schemas/NotFoundError"
  2389. }
  2390. }
  2391. }
  2392. }
  2393. },
  2394. "x-codeSamples": [
  2395. {
  2396. "lang": "js",
  2397. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.children({\n ...\n})"
  2398. }
  2399. ]
  2400. }
  2401. },
  2402. "/session/{sessionID}/todo": {
  2403. "get": {
  2404. "operationId": "session.todo",
  2405. "parameters": [
  2406. {
  2407. "in": "query",
  2408. "name": "directory",
  2409. "schema": {
  2410. "type": "string"
  2411. }
  2412. },
  2413. {
  2414. "in": "query",
  2415. "name": "workspace",
  2416. "schema": {
  2417. "type": "string"
  2418. }
  2419. },
  2420. {
  2421. "in": "path",
  2422. "name": "sessionID",
  2423. "schema": {
  2424. "type": "string",
  2425. "pattern": "^ses.*"
  2426. },
  2427. "required": true
  2428. }
  2429. ],
  2430. "summary": "Get session todos",
  2431. "description": "Retrieve the todo list associated with a specific session, showing tasks and action items.",
  2432. "responses": {
  2433. "200": {
  2434. "description": "Todo list",
  2435. "content": {
  2436. "application/json": {
  2437. "schema": {
  2438. "type": "array",
  2439. "items": {
  2440. "$ref": "#/components/schemas/Todo"
  2441. }
  2442. }
  2443. }
  2444. }
  2445. },
  2446. "400": {
  2447. "description": "Bad request",
  2448. "content": {
  2449. "application/json": {
  2450. "schema": {
  2451. "$ref": "#/components/schemas/BadRequestError"
  2452. }
  2453. }
  2454. }
  2455. },
  2456. "404": {
  2457. "description": "Not found",
  2458. "content": {
  2459. "application/json": {
  2460. "schema": {
  2461. "$ref": "#/components/schemas/NotFoundError"
  2462. }
  2463. }
  2464. }
  2465. }
  2466. },
  2467. "x-codeSamples": [
  2468. {
  2469. "lang": "js",
  2470. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.todo({\n ...\n})"
  2471. }
  2472. ]
  2473. }
  2474. },
  2475. "/session/{sessionID}/init": {
  2476. "post": {
  2477. "operationId": "session.init",
  2478. "parameters": [
  2479. {
  2480. "in": "query",
  2481. "name": "directory",
  2482. "schema": {
  2483. "type": "string"
  2484. }
  2485. },
  2486. {
  2487. "in": "query",
  2488. "name": "workspace",
  2489. "schema": {
  2490. "type": "string"
  2491. }
  2492. },
  2493. {
  2494. "in": "path",
  2495. "name": "sessionID",
  2496. "schema": {
  2497. "type": "string",
  2498. "pattern": "^ses.*"
  2499. },
  2500. "required": true
  2501. }
  2502. ],
  2503. "summary": "Initialize session",
  2504. "description": "Analyze the current application and create an AGENTS.md file with project-specific agent configurations.",
  2505. "responses": {
  2506. "200": {
  2507. "description": "200",
  2508. "content": {
  2509. "application/json": {
  2510. "schema": {
  2511. "type": "boolean"
  2512. }
  2513. }
  2514. }
  2515. },
  2516. "400": {
  2517. "description": "Bad request",
  2518. "content": {
  2519. "application/json": {
  2520. "schema": {
  2521. "$ref": "#/components/schemas/BadRequestError"
  2522. }
  2523. }
  2524. }
  2525. },
  2526. "404": {
  2527. "description": "Not found",
  2528. "content": {
  2529. "application/json": {
  2530. "schema": {
  2531. "$ref": "#/components/schemas/NotFoundError"
  2532. }
  2533. }
  2534. }
  2535. }
  2536. },
  2537. "requestBody": {
  2538. "content": {
  2539. "application/json": {
  2540. "schema": {
  2541. "type": "object",
  2542. "properties": {
  2543. "modelID": {
  2544. "type": "string"
  2545. },
  2546. "providerID": {
  2547. "type": "string"
  2548. },
  2549. "messageID": {
  2550. "type": "string",
  2551. "pattern": "^msg.*"
  2552. }
  2553. },
  2554. "required": ["modelID", "providerID", "messageID"]
  2555. }
  2556. }
  2557. }
  2558. },
  2559. "x-codeSamples": [
  2560. {
  2561. "lang": "js",
  2562. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.init({\n ...\n})"
  2563. }
  2564. ]
  2565. }
  2566. },
  2567. "/session/{sessionID}/fork": {
  2568. "post": {
  2569. "operationId": "session.fork",
  2570. "parameters": [
  2571. {
  2572. "in": "query",
  2573. "name": "directory",
  2574. "schema": {
  2575. "type": "string"
  2576. }
  2577. },
  2578. {
  2579. "in": "query",
  2580. "name": "workspace",
  2581. "schema": {
  2582. "type": "string"
  2583. }
  2584. },
  2585. {
  2586. "in": "path",
  2587. "name": "sessionID",
  2588. "schema": {
  2589. "type": "string",
  2590. "pattern": "^ses.*"
  2591. },
  2592. "required": true
  2593. }
  2594. ],
  2595. "summary": "Fork session",
  2596. "description": "Create a new session by forking an existing session at a specific message point.",
  2597. "responses": {
  2598. "200": {
  2599. "description": "200",
  2600. "content": {
  2601. "application/json": {
  2602. "schema": {
  2603. "$ref": "#/components/schemas/Session"
  2604. }
  2605. }
  2606. }
  2607. }
  2608. },
  2609. "requestBody": {
  2610. "content": {
  2611. "application/json": {
  2612. "schema": {
  2613. "type": "object",
  2614. "properties": {
  2615. "messageID": {
  2616. "type": "string",
  2617. "pattern": "^msg.*"
  2618. }
  2619. }
  2620. }
  2621. }
  2622. }
  2623. },
  2624. "x-codeSamples": [
  2625. {
  2626. "lang": "js",
  2627. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.fork({\n ...\n})"
  2628. }
  2629. ]
  2630. }
  2631. },
  2632. "/session/{sessionID}/abort": {
  2633. "post": {
  2634. "operationId": "session.abort",
  2635. "parameters": [
  2636. {
  2637. "in": "query",
  2638. "name": "directory",
  2639. "schema": {
  2640. "type": "string"
  2641. }
  2642. },
  2643. {
  2644. "in": "query",
  2645. "name": "workspace",
  2646. "schema": {
  2647. "type": "string"
  2648. }
  2649. },
  2650. {
  2651. "in": "path",
  2652. "name": "sessionID",
  2653. "schema": {
  2654. "type": "string",
  2655. "pattern": "^ses.*"
  2656. },
  2657. "required": true
  2658. }
  2659. ],
  2660. "summary": "Abort session",
  2661. "description": "Abort an active session and stop any ongoing AI processing or command execution.",
  2662. "responses": {
  2663. "200": {
  2664. "description": "Aborted session",
  2665. "content": {
  2666. "application/json": {
  2667. "schema": {
  2668. "type": "boolean"
  2669. }
  2670. }
  2671. }
  2672. },
  2673. "400": {
  2674. "description": "Bad request",
  2675. "content": {
  2676. "application/json": {
  2677. "schema": {
  2678. "$ref": "#/components/schemas/BadRequestError"
  2679. }
  2680. }
  2681. }
  2682. },
  2683. "404": {
  2684. "description": "Not found",
  2685. "content": {
  2686. "application/json": {
  2687. "schema": {
  2688. "$ref": "#/components/schemas/NotFoundError"
  2689. }
  2690. }
  2691. }
  2692. }
  2693. },
  2694. "x-codeSamples": [
  2695. {
  2696. "lang": "js",
  2697. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.abort({\n ...\n})"
  2698. }
  2699. ]
  2700. }
  2701. },
  2702. "/session/{sessionID}/share": {
  2703. "post": {
  2704. "operationId": "session.share",
  2705. "parameters": [
  2706. {
  2707. "in": "query",
  2708. "name": "directory",
  2709. "schema": {
  2710. "type": "string"
  2711. }
  2712. },
  2713. {
  2714. "in": "query",
  2715. "name": "workspace",
  2716. "schema": {
  2717. "type": "string"
  2718. }
  2719. },
  2720. {
  2721. "in": "path",
  2722. "name": "sessionID",
  2723. "schema": {
  2724. "type": "string",
  2725. "pattern": "^ses.*"
  2726. },
  2727. "required": true
  2728. }
  2729. ],
  2730. "summary": "Share session",
  2731. "description": "Create a shareable link for a session, allowing others to view the conversation.",
  2732. "responses": {
  2733. "200": {
  2734. "description": "Successfully shared session",
  2735. "content": {
  2736. "application/json": {
  2737. "schema": {
  2738. "$ref": "#/components/schemas/Session"
  2739. }
  2740. }
  2741. }
  2742. },
  2743. "400": {
  2744. "description": "Bad request",
  2745. "content": {
  2746. "application/json": {
  2747. "schema": {
  2748. "$ref": "#/components/schemas/BadRequestError"
  2749. }
  2750. }
  2751. }
  2752. },
  2753. "404": {
  2754. "description": "Not found",
  2755. "content": {
  2756. "application/json": {
  2757. "schema": {
  2758. "$ref": "#/components/schemas/NotFoundError"
  2759. }
  2760. }
  2761. }
  2762. }
  2763. },
  2764. "x-codeSamples": [
  2765. {
  2766. "lang": "js",
  2767. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.share({\n ...\n})"
  2768. }
  2769. ]
  2770. },
  2771. "delete": {
  2772. "operationId": "session.unshare",
  2773. "parameters": [
  2774. {
  2775. "in": "query",
  2776. "name": "directory",
  2777. "schema": {
  2778. "type": "string"
  2779. }
  2780. },
  2781. {
  2782. "in": "query",
  2783. "name": "workspace",
  2784. "schema": {
  2785. "type": "string"
  2786. }
  2787. },
  2788. {
  2789. "in": "path",
  2790. "name": "sessionID",
  2791. "schema": {
  2792. "type": "string",
  2793. "pattern": "^ses.*"
  2794. },
  2795. "required": true
  2796. }
  2797. ],
  2798. "summary": "Unshare session",
  2799. "description": "Remove the shareable link for a session, making it private again.",
  2800. "responses": {
  2801. "200": {
  2802. "description": "Successfully unshared session",
  2803. "content": {
  2804. "application/json": {
  2805. "schema": {
  2806. "$ref": "#/components/schemas/Session"
  2807. }
  2808. }
  2809. }
  2810. },
  2811. "400": {
  2812. "description": "Bad request",
  2813. "content": {
  2814. "application/json": {
  2815. "schema": {
  2816. "$ref": "#/components/schemas/BadRequestError"
  2817. }
  2818. }
  2819. }
  2820. },
  2821. "404": {
  2822. "description": "Not found",
  2823. "content": {
  2824. "application/json": {
  2825. "schema": {
  2826. "$ref": "#/components/schemas/NotFoundError"
  2827. }
  2828. }
  2829. }
  2830. }
  2831. },
  2832. "x-codeSamples": [
  2833. {
  2834. "lang": "js",
  2835. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.unshare({\n ...\n})"
  2836. }
  2837. ]
  2838. }
  2839. },
  2840. "/session/{sessionID}/diff": {
  2841. "get": {
  2842. "operationId": "session.diff",
  2843. "parameters": [
  2844. {
  2845. "in": "query",
  2846. "name": "directory",
  2847. "schema": {
  2848. "type": "string"
  2849. }
  2850. },
  2851. {
  2852. "in": "query",
  2853. "name": "workspace",
  2854. "schema": {
  2855. "type": "string"
  2856. }
  2857. },
  2858. {
  2859. "in": "path",
  2860. "name": "sessionID",
  2861. "schema": {
  2862. "type": "string",
  2863. "pattern": "^ses.*"
  2864. },
  2865. "required": true
  2866. },
  2867. {
  2868. "in": "query",
  2869. "name": "messageID",
  2870. "schema": {
  2871. "type": "string",
  2872. "pattern": "^msg.*"
  2873. }
  2874. }
  2875. ],
  2876. "summary": "Get message diff",
  2877. "description": "Get the file changes (diff) that resulted from a specific user message in the session.",
  2878. "responses": {
  2879. "200": {
  2880. "description": "Successfully retrieved diff",
  2881. "content": {
  2882. "application/json": {
  2883. "schema": {
  2884. "type": "array",
  2885. "items": {
  2886. "$ref": "#/components/schemas/FileDiff"
  2887. }
  2888. }
  2889. }
  2890. }
  2891. }
  2892. },
  2893. "x-codeSamples": [
  2894. {
  2895. "lang": "js",
  2896. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.diff({\n ...\n})"
  2897. }
  2898. ]
  2899. }
  2900. },
  2901. "/session/{sessionID}/summarize": {
  2902. "post": {
  2903. "operationId": "session.summarize",
  2904. "parameters": [
  2905. {
  2906. "in": "query",
  2907. "name": "directory",
  2908. "schema": {
  2909. "type": "string"
  2910. }
  2911. },
  2912. {
  2913. "in": "query",
  2914. "name": "workspace",
  2915. "schema": {
  2916. "type": "string"
  2917. }
  2918. },
  2919. {
  2920. "in": "path",
  2921. "name": "sessionID",
  2922. "schema": {
  2923. "type": "string",
  2924. "pattern": "^ses.*"
  2925. },
  2926. "required": true
  2927. }
  2928. ],
  2929. "summary": "Summarize session",
  2930. "description": "Generate a concise summary of the session using AI compaction to preserve key information.",
  2931. "responses": {
  2932. "200": {
  2933. "description": "Summarized session",
  2934. "content": {
  2935. "application/json": {
  2936. "schema": {
  2937. "type": "boolean"
  2938. }
  2939. }
  2940. }
  2941. },
  2942. "400": {
  2943. "description": "Bad request",
  2944. "content": {
  2945. "application/json": {
  2946. "schema": {
  2947. "$ref": "#/components/schemas/BadRequestError"
  2948. }
  2949. }
  2950. }
  2951. },
  2952. "404": {
  2953. "description": "Not found",
  2954. "content": {
  2955. "application/json": {
  2956. "schema": {
  2957. "$ref": "#/components/schemas/NotFoundError"
  2958. }
  2959. }
  2960. }
  2961. }
  2962. },
  2963. "requestBody": {
  2964. "content": {
  2965. "application/json": {
  2966. "schema": {
  2967. "type": "object",
  2968. "properties": {
  2969. "providerID": {
  2970. "type": "string"
  2971. },
  2972. "modelID": {
  2973. "type": "string"
  2974. },
  2975. "auto": {
  2976. "default": false,
  2977. "type": "boolean"
  2978. }
  2979. },
  2980. "required": ["providerID", "modelID"]
  2981. }
  2982. }
  2983. }
  2984. },
  2985. "x-codeSamples": [
  2986. {
  2987. "lang": "js",
  2988. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.summarize({\n ...\n})"
  2989. }
  2990. ]
  2991. }
  2992. },
  2993. "/session/{sessionID}/message": {
  2994. "get": {
  2995. "operationId": "session.messages",
  2996. "parameters": [
  2997. {
  2998. "in": "query",
  2999. "name": "directory",
  3000. "schema": {
  3001. "type": "string"
  3002. }
  3003. },
  3004. {
  3005. "in": "query",
  3006. "name": "workspace",
  3007. "schema": {
  3008. "type": "string"
  3009. }
  3010. },
  3011. {
  3012. "in": "path",
  3013. "name": "sessionID",
  3014. "schema": {
  3015. "type": "string",
  3016. "pattern": "^ses.*"
  3017. },
  3018. "required": true
  3019. },
  3020. {
  3021. "in": "query",
  3022. "name": "limit",
  3023. "schema": {
  3024. "type": "integer",
  3025. "minimum": 0,
  3026. "maximum": 9007199254740991
  3027. },
  3028. "description": "Maximum number of messages to return"
  3029. },
  3030. {
  3031. "in": "query",
  3032. "name": "before",
  3033. "schema": {
  3034. "type": "string"
  3035. }
  3036. }
  3037. ],
  3038. "summary": "Get session messages",
  3039. "description": "Retrieve all messages in a session, including user prompts and AI responses.",
  3040. "responses": {
  3041. "200": {
  3042. "description": "List of messages",
  3043. "content": {
  3044. "application/json": {
  3045. "schema": {
  3046. "type": "array",
  3047. "items": {
  3048. "type": "object",
  3049. "properties": {
  3050. "info": {
  3051. "$ref": "#/components/schemas/Message"
  3052. },
  3053. "parts": {
  3054. "type": "array",
  3055. "items": {
  3056. "$ref": "#/components/schemas/Part"
  3057. }
  3058. }
  3059. },
  3060. "required": ["info", "parts"]
  3061. }
  3062. }
  3063. }
  3064. }
  3065. },
  3066. "400": {
  3067. "description": "Bad request",
  3068. "content": {
  3069. "application/json": {
  3070. "schema": {
  3071. "$ref": "#/components/schemas/BadRequestError"
  3072. }
  3073. }
  3074. }
  3075. },
  3076. "404": {
  3077. "description": "Not found",
  3078. "content": {
  3079. "application/json": {
  3080. "schema": {
  3081. "$ref": "#/components/schemas/NotFoundError"
  3082. }
  3083. }
  3084. }
  3085. }
  3086. },
  3087. "x-codeSamples": [
  3088. {
  3089. "lang": "js",
  3090. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.messages({\n ...\n})"
  3091. }
  3092. ]
  3093. },
  3094. "post": {
  3095. "operationId": "session.prompt",
  3096. "parameters": [
  3097. {
  3098. "in": "query",
  3099. "name": "directory",
  3100. "schema": {
  3101. "type": "string"
  3102. }
  3103. },
  3104. {
  3105. "in": "query",
  3106. "name": "workspace",
  3107. "schema": {
  3108. "type": "string"
  3109. }
  3110. },
  3111. {
  3112. "in": "path",
  3113. "name": "sessionID",
  3114. "schema": {
  3115. "type": "string",
  3116. "pattern": "^ses.*"
  3117. },
  3118. "required": true
  3119. }
  3120. ],
  3121. "summary": "Send message",
  3122. "description": "Create and send a new message to a session, streaming the AI response.",
  3123. "responses": {
  3124. "200": {
  3125. "description": "Created message",
  3126. "content": {
  3127. "application/json": {
  3128. "schema": {
  3129. "type": "object",
  3130. "properties": {
  3131. "info": {
  3132. "$ref": "#/components/schemas/AssistantMessage"
  3133. },
  3134. "parts": {
  3135. "type": "array",
  3136. "items": {
  3137. "$ref": "#/components/schemas/Part"
  3138. }
  3139. }
  3140. },
  3141. "required": ["info", "parts"]
  3142. }
  3143. }
  3144. }
  3145. },
  3146. "400": {
  3147. "description": "Bad request",
  3148. "content": {
  3149. "application/json": {
  3150. "schema": {
  3151. "$ref": "#/components/schemas/BadRequestError"
  3152. }
  3153. }
  3154. }
  3155. },
  3156. "404": {
  3157. "description": "Not found",
  3158. "content": {
  3159. "application/json": {
  3160. "schema": {
  3161. "$ref": "#/components/schemas/NotFoundError"
  3162. }
  3163. }
  3164. }
  3165. }
  3166. },
  3167. "requestBody": {
  3168. "content": {
  3169. "application/json": {
  3170. "schema": {
  3171. "type": "object",
  3172. "properties": {
  3173. "messageID": {
  3174. "type": "string",
  3175. "pattern": "^msg.*"
  3176. },
  3177. "model": {
  3178. "type": "object",
  3179. "properties": {
  3180. "providerID": {
  3181. "type": "string"
  3182. },
  3183. "modelID": {
  3184. "type": "string"
  3185. }
  3186. },
  3187. "required": ["providerID", "modelID"]
  3188. },
  3189. "agent": {
  3190. "type": "string"
  3191. },
  3192. "noReply": {
  3193. "type": "boolean"
  3194. },
  3195. "tools": {
  3196. "description": "@deprecated tools and permissions have been merged, you can set permissions on the session itself now",
  3197. "type": "object",
  3198. "propertyNames": {
  3199. "type": "string"
  3200. },
  3201. "additionalProperties": {
  3202. "type": "boolean"
  3203. }
  3204. },
  3205. "format": {
  3206. "$ref": "#/components/schemas/OutputFormat"
  3207. },
  3208. "system": {
  3209. "type": "string"
  3210. },
  3211. "variant": {
  3212. "type": "string"
  3213. },
  3214. "parts": {
  3215. "type": "array",
  3216. "items": {
  3217. "anyOf": [
  3218. {
  3219. "$ref": "#/components/schemas/TextPartInput"
  3220. },
  3221. {
  3222. "$ref": "#/components/schemas/FilePartInput"
  3223. },
  3224. {
  3225. "$ref": "#/components/schemas/AgentPartInput"
  3226. },
  3227. {
  3228. "$ref": "#/components/schemas/SubtaskPartInput"
  3229. }
  3230. ]
  3231. }
  3232. }
  3233. },
  3234. "required": ["parts"]
  3235. }
  3236. }
  3237. }
  3238. },
  3239. "x-codeSamples": [
  3240. {
  3241. "lang": "js",
  3242. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.prompt({\n ...\n})"
  3243. }
  3244. ]
  3245. }
  3246. },
  3247. "/session/{sessionID}/message/{messageID}": {
  3248. "get": {
  3249. "operationId": "session.message",
  3250. "parameters": [
  3251. {
  3252. "in": "query",
  3253. "name": "directory",
  3254. "schema": {
  3255. "type": "string"
  3256. }
  3257. },
  3258. {
  3259. "in": "query",
  3260. "name": "workspace",
  3261. "schema": {
  3262. "type": "string"
  3263. }
  3264. },
  3265. {
  3266. "in": "path",
  3267. "name": "sessionID",
  3268. "schema": {
  3269. "type": "string",
  3270. "pattern": "^ses.*"
  3271. },
  3272. "required": true
  3273. },
  3274. {
  3275. "in": "path",
  3276. "name": "messageID",
  3277. "schema": {
  3278. "type": "string",
  3279. "pattern": "^msg.*"
  3280. },
  3281. "required": true
  3282. }
  3283. ],
  3284. "summary": "Get message",
  3285. "description": "Retrieve a specific message from a session by its message ID.",
  3286. "responses": {
  3287. "200": {
  3288. "description": "Message",
  3289. "content": {
  3290. "application/json": {
  3291. "schema": {
  3292. "type": "object",
  3293. "properties": {
  3294. "info": {
  3295. "$ref": "#/components/schemas/Message"
  3296. },
  3297. "parts": {
  3298. "type": "array",
  3299. "items": {
  3300. "$ref": "#/components/schemas/Part"
  3301. }
  3302. }
  3303. },
  3304. "required": ["info", "parts"]
  3305. }
  3306. }
  3307. }
  3308. },
  3309. "400": {
  3310. "description": "Bad request",
  3311. "content": {
  3312. "application/json": {
  3313. "schema": {
  3314. "$ref": "#/components/schemas/BadRequestError"
  3315. }
  3316. }
  3317. }
  3318. },
  3319. "404": {
  3320. "description": "Not found",
  3321. "content": {
  3322. "application/json": {
  3323. "schema": {
  3324. "$ref": "#/components/schemas/NotFoundError"
  3325. }
  3326. }
  3327. }
  3328. }
  3329. },
  3330. "x-codeSamples": [
  3331. {
  3332. "lang": "js",
  3333. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.message({\n ...\n})"
  3334. }
  3335. ]
  3336. },
  3337. "delete": {
  3338. "operationId": "session.deleteMessage",
  3339. "parameters": [
  3340. {
  3341. "in": "query",
  3342. "name": "directory",
  3343. "schema": {
  3344. "type": "string"
  3345. }
  3346. },
  3347. {
  3348. "in": "query",
  3349. "name": "workspace",
  3350. "schema": {
  3351. "type": "string"
  3352. }
  3353. },
  3354. {
  3355. "in": "path",
  3356. "name": "sessionID",
  3357. "schema": {
  3358. "type": "string",
  3359. "pattern": "^ses.*"
  3360. },
  3361. "required": true
  3362. },
  3363. {
  3364. "in": "path",
  3365. "name": "messageID",
  3366. "schema": {
  3367. "type": "string",
  3368. "pattern": "^msg.*"
  3369. },
  3370. "required": true
  3371. }
  3372. ],
  3373. "summary": "Delete message",
  3374. "description": "Permanently delete a specific message (and all of its parts) from a session. This does not revert any file changes that may have been made while processing the message.",
  3375. "responses": {
  3376. "200": {
  3377. "description": "Successfully deleted message",
  3378. "content": {
  3379. "application/json": {
  3380. "schema": {
  3381. "type": "boolean"
  3382. }
  3383. }
  3384. }
  3385. },
  3386. "400": {
  3387. "description": "Bad request",
  3388. "content": {
  3389. "application/json": {
  3390. "schema": {
  3391. "$ref": "#/components/schemas/BadRequestError"
  3392. }
  3393. }
  3394. }
  3395. },
  3396. "404": {
  3397. "description": "Not found",
  3398. "content": {
  3399. "application/json": {
  3400. "schema": {
  3401. "$ref": "#/components/schemas/NotFoundError"
  3402. }
  3403. }
  3404. }
  3405. }
  3406. },
  3407. "x-codeSamples": [
  3408. {
  3409. "lang": "js",
  3410. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.deleteMessage({\n ...\n})"
  3411. }
  3412. ]
  3413. }
  3414. },
  3415. "/session/{sessionID}/message/{messageID}/part/{partID}": {
  3416. "delete": {
  3417. "operationId": "part.delete",
  3418. "parameters": [
  3419. {
  3420. "in": "query",
  3421. "name": "directory",
  3422. "schema": {
  3423. "type": "string"
  3424. }
  3425. },
  3426. {
  3427. "in": "query",
  3428. "name": "workspace",
  3429. "schema": {
  3430. "type": "string"
  3431. }
  3432. },
  3433. {
  3434. "in": "path",
  3435. "name": "sessionID",
  3436. "schema": {
  3437. "type": "string",
  3438. "pattern": "^ses.*"
  3439. },
  3440. "required": true
  3441. },
  3442. {
  3443. "in": "path",
  3444. "name": "messageID",
  3445. "schema": {
  3446. "type": "string",
  3447. "pattern": "^msg.*"
  3448. },
  3449. "required": true
  3450. },
  3451. {
  3452. "in": "path",
  3453. "name": "partID",
  3454. "schema": {
  3455. "type": "string",
  3456. "pattern": "^prt.*"
  3457. },
  3458. "required": true
  3459. }
  3460. ],
  3461. "description": "Delete a part from a message",
  3462. "responses": {
  3463. "200": {
  3464. "description": "Successfully deleted part",
  3465. "content": {
  3466. "application/json": {
  3467. "schema": {
  3468. "type": "boolean"
  3469. }
  3470. }
  3471. }
  3472. },
  3473. "400": {
  3474. "description": "Bad request",
  3475. "content": {
  3476. "application/json": {
  3477. "schema": {
  3478. "$ref": "#/components/schemas/BadRequestError"
  3479. }
  3480. }
  3481. }
  3482. },
  3483. "404": {
  3484. "description": "Not found",
  3485. "content": {
  3486. "application/json": {
  3487. "schema": {
  3488. "$ref": "#/components/schemas/NotFoundError"
  3489. }
  3490. }
  3491. }
  3492. }
  3493. },
  3494. "x-codeSamples": [
  3495. {
  3496. "lang": "js",
  3497. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.part.delete({\n ...\n})"
  3498. }
  3499. ]
  3500. },
  3501. "patch": {
  3502. "operationId": "part.update",
  3503. "parameters": [
  3504. {
  3505. "in": "query",
  3506. "name": "directory",
  3507. "schema": {
  3508. "type": "string"
  3509. }
  3510. },
  3511. {
  3512. "in": "query",
  3513. "name": "workspace",
  3514. "schema": {
  3515. "type": "string"
  3516. }
  3517. },
  3518. {
  3519. "in": "path",
  3520. "name": "sessionID",
  3521. "schema": {
  3522. "type": "string",
  3523. "pattern": "^ses.*"
  3524. },
  3525. "required": true
  3526. },
  3527. {
  3528. "in": "path",
  3529. "name": "messageID",
  3530. "schema": {
  3531. "type": "string",
  3532. "pattern": "^msg.*"
  3533. },
  3534. "required": true
  3535. },
  3536. {
  3537. "in": "path",
  3538. "name": "partID",
  3539. "schema": {
  3540. "type": "string",
  3541. "pattern": "^prt.*"
  3542. },
  3543. "required": true
  3544. }
  3545. ],
  3546. "description": "Update a part in a message",
  3547. "responses": {
  3548. "200": {
  3549. "description": "Successfully updated part",
  3550. "content": {
  3551. "application/json": {
  3552. "schema": {
  3553. "$ref": "#/components/schemas/Part"
  3554. }
  3555. }
  3556. }
  3557. },
  3558. "400": {
  3559. "description": "Bad request",
  3560. "content": {
  3561. "application/json": {
  3562. "schema": {
  3563. "$ref": "#/components/schemas/BadRequestError"
  3564. }
  3565. }
  3566. }
  3567. },
  3568. "404": {
  3569. "description": "Not found",
  3570. "content": {
  3571. "application/json": {
  3572. "schema": {
  3573. "$ref": "#/components/schemas/NotFoundError"
  3574. }
  3575. }
  3576. }
  3577. }
  3578. },
  3579. "requestBody": {
  3580. "content": {
  3581. "application/json": {
  3582. "schema": {
  3583. "$ref": "#/components/schemas/Part"
  3584. }
  3585. }
  3586. }
  3587. },
  3588. "x-codeSamples": [
  3589. {
  3590. "lang": "js",
  3591. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.part.update({\n ...\n})"
  3592. }
  3593. ]
  3594. }
  3595. },
  3596. "/session/{sessionID}/prompt_async": {
  3597. "post": {
  3598. "operationId": "session.prompt_async",
  3599. "parameters": [
  3600. {
  3601. "in": "query",
  3602. "name": "directory",
  3603. "schema": {
  3604. "type": "string"
  3605. }
  3606. },
  3607. {
  3608. "in": "query",
  3609. "name": "workspace",
  3610. "schema": {
  3611. "type": "string"
  3612. }
  3613. },
  3614. {
  3615. "in": "path",
  3616. "name": "sessionID",
  3617. "schema": {
  3618. "type": "string",
  3619. "pattern": "^ses.*"
  3620. },
  3621. "required": true
  3622. }
  3623. ],
  3624. "summary": "Send async message",
  3625. "description": "Create and send a new message to a session asynchronously, starting the session if needed and returning immediately.",
  3626. "responses": {
  3627. "204": {
  3628. "description": "Prompt accepted"
  3629. },
  3630. "400": {
  3631. "description": "Bad request",
  3632. "content": {
  3633. "application/json": {
  3634. "schema": {
  3635. "$ref": "#/components/schemas/BadRequestError"
  3636. }
  3637. }
  3638. }
  3639. },
  3640. "404": {
  3641. "description": "Not found",
  3642. "content": {
  3643. "application/json": {
  3644. "schema": {
  3645. "$ref": "#/components/schemas/NotFoundError"
  3646. }
  3647. }
  3648. }
  3649. }
  3650. },
  3651. "requestBody": {
  3652. "content": {
  3653. "application/json": {
  3654. "schema": {
  3655. "type": "object",
  3656. "properties": {
  3657. "messageID": {
  3658. "type": "string",
  3659. "pattern": "^msg.*"
  3660. },
  3661. "model": {
  3662. "type": "object",
  3663. "properties": {
  3664. "providerID": {
  3665. "type": "string"
  3666. },
  3667. "modelID": {
  3668. "type": "string"
  3669. }
  3670. },
  3671. "required": ["providerID", "modelID"]
  3672. },
  3673. "agent": {
  3674. "type": "string"
  3675. },
  3676. "noReply": {
  3677. "type": "boolean"
  3678. },
  3679. "tools": {
  3680. "description": "@deprecated tools and permissions have been merged, you can set permissions on the session itself now",
  3681. "type": "object",
  3682. "propertyNames": {
  3683. "type": "string"
  3684. },
  3685. "additionalProperties": {
  3686. "type": "boolean"
  3687. }
  3688. },
  3689. "format": {
  3690. "$ref": "#/components/schemas/OutputFormat"
  3691. },
  3692. "system": {
  3693. "type": "string"
  3694. },
  3695. "variant": {
  3696. "type": "string"
  3697. },
  3698. "parts": {
  3699. "type": "array",
  3700. "items": {
  3701. "anyOf": [
  3702. {
  3703. "$ref": "#/components/schemas/TextPartInput"
  3704. },
  3705. {
  3706. "$ref": "#/components/schemas/FilePartInput"
  3707. },
  3708. {
  3709. "$ref": "#/components/schemas/AgentPartInput"
  3710. },
  3711. {
  3712. "$ref": "#/components/schemas/SubtaskPartInput"
  3713. }
  3714. ]
  3715. }
  3716. }
  3717. },
  3718. "required": ["parts"]
  3719. }
  3720. }
  3721. }
  3722. },
  3723. "x-codeSamples": [
  3724. {
  3725. "lang": "js",
  3726. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.prompt_async({\n ...\n})"
  3727. }
  3728. ]
  3729. }
  3730. },
  3731. "/session/{sessionID}/command": {
  3732. "post": {
  3733. "operationId": "session.command",
  3734. "parameters": [
  3735. {
  3736. "in": "query",
  3737. "name": "directory",
  3738. "schema": {
  3739. "type": "string"
  3740. }
  3741. },
  3742. {
  3743. "in": "query",
  3744. "name": "workspace",
  3745. "schema": {
  3746. "type": "string"
  3747. }
  3748. },
  3749. {
  3750. "in": "path",
  3751. "name": "sessionID",
  3752. "schema": {
  3753. "type": "string",
  3754. "pattern": "^ses.*"
  3755. },
  3756. "required": true
  3757. }
  3758. ],
  3759. "summary": "Send command",
  3760. "description": "Send a new command to a session for execution by the AI assistant.",
  3761. "responses": {
  3762. "200": {
  3763. "description": "Created message",
  3764. "content": {
  3765. "application/json": {
  3766. "schema": {
  3767. "type": "object",
  3768. "properties": {
  3769. "info": {
  3770. "$ref": "#/components/schemas/AssistantMessage"
  3771. },
  3772. "parts": {
  3773. "type": "array",
  3774. "items": {
  3775. "$ref": "#/components/schemas/Part"
  3776. }
  3777. }
  3778. },
  3779. "required": ["info", "parts"]
  3780. }
  3781. }
  3782. }
  3783. },
  3784. "400": {
  3785. "description": "Bad request",
  3786. "content": {
  3787. "application/json": {
  3788. "schema": {
  3789. "$ref": "#/components/schemas/BadRequestError"
  3790. }
  3791. }
  3792. }
  3793. },
  3794. "404": {
  3795. "description": "Not found",
  3796. "content": {
  3797. "application/json": {
  3798. "schema": {
  3799. "$ref": "#/components/schemas/NotFoundError"
  3800. }
  3801. }
  3802. }
  3803. }
  3804. },
  3805. "requestBody": {
  3806. "content": {
  3807. "application/json": {
  3808. "schema": {
  3809. "type": "object",
  3810. "properties": {
  3811. "messageID": {
  3812. "type": "string",
  3813. "pattern": "^msg.*"
  3814. },
  3815. "agent": {
  3816. "type": "string"
  3817. },
  3818. "model": {
  3819. "type": "string"
  3820. },
  3821. "arguments": {
  3822. "type": "string"
  3823. },
  3824. "command": {
  3825. "type": "string"
  3826. },
  3827. "variant": {
  3828. "type": "string"
  3829. },
  3830. "parts": {
  3831. "type": "array",
  3832. "items": {
  3833. "anyOf": [
  3834. {
  3835. "type": "object",
  3836. "properties": {
  3837. "id": {
  3838. "type": "string",
  3839. "pattern": "^prt.*"
  3840. },
  3841. "type": {
  3842. "type": "string",
  3843. "const": "file"
  3844. },
  3845. "mime": {
  3846. "type": "string"
  3847. },
  3848. "filename": {
  3849. "type": "string"
  3850. },
  3851. "url": {
  3852. "type": "string"
  3853. },
  3854. "source": {
  3855. "$ref": "#/components/schemas/FilePartSource"
  3856. }
  3857. },
  3858. "required": ["type", "mime", "url"]
  3859. }
  3860. ]
  3861. }
  3862. }
  3863. },
  3864. "required": ["arguments", "command"]
  3865. }
  3866. }
  3867. }
  3868. },
  3869. "x-codeSamples": [
  3870. {
  3871. "lang": "js",
  3872. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.command({\n ...\n})"
  3873. }
  3874. ]
  3875. }
  3876. },
  3877. "/session/{sessionID}/shell": {
  3878. "post": {
  3879. "operationId": "session.shell",
  3880. "parameters": [
  3881. {
  3882. "in": "query",
  3883. "name": "directory",
  3884. "schema": {
  3885. "type": "string"
  3886. }
  3887. },
  3888. {
  3889. "in": "query",
  3890. "name": "workspace",
  3891. "schema": {
  3892. "type": "string"
  3893. }
  3894. },
  3895. {
  3896. "in": "path",
  3897. "name": "sessionID",
  3898. "schema": {
  3899. "type": "string",
  3900. "pattern": "^ses.*"
  3901. },
  3902. "required": true
  3903. }
  3904. ],
  3905. "summary": "Run shell command",
  3906. "description": "Execute a shell command within the session context and return the AI's response.",
  3907. "responses": {
  3908. "200": {
  3909. "description": "Created message",
  3910. "content": {
  3911. "application/json": {
  3912. "schema": {
  3913. "$ref": "#/components/schemas/AssistantMessage"
  3914. }
  3915. }
  3916. }
  3917. },
  3918. "400": {
  3919. "description": "Bad request",
  3920. "content": {
  3921. "application/json": {
  3922. "schema": {
  3923. "$ref": "#/components/schemas/BadRequestError"
  3924. }
  3925. }
  3926. }
  3927. },
  3928. "404": {
  3929. "description": "Not found",
  3930. "content": {
  3931. "application/json": {
  3932. "schema": {
  3933. "$ref": "#/components/schemas/NotFoundError"
  3934. }
  3935. }
  3936. }
  3937. }
  3938. },
  3939. "requestBody": {
  3940. "content": {
  3941. "application/json": {
  3942. "schema": {
  3943. "type": "object",
  3944. "properties": {
  3945. "agent": {
  3946. "type": "string"
  3947. },
  3948. "model": {
  3949. "type": "object",
  3950. "properties": {
  3951. "providerID": {
  3952. "type": "string"
  3953. },
  3954. "modelID": {
  3955. "type": "string"
  3956. }
  3957. },
  3958. "required": ["providerID", "modelID"]
  3959. },
  3960. "command": {
  3961. "type": "string"
  3962. }
  3963. },
  3964. "required": ["agent", "command"]
  3965. }
  3966. }
  3967. }
  3968. },
  3969. "x-codeSamples": [
  3970. {
  3971. "lang": "js",
  3972. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.shell({\n ...\n})"
  3973. }
  3974. ]
  3975. }
  3976. },
  3977. "/session/{sessionID}/revert": {
  3978. "post": {
  3979. "operationId": "session.revert",
  3980. "parameters": [
  3981. {
  3982. "in": "query",
  3983. "name": "directory",
  3984. "schema": {
  3985. "type": "string"
  3986. }
  3987. },
  3988. {
  3989. "in": "query",
  3990. "name": "workspace",
  3991. "schema": {
  3992. "type": "string"
  3993. }
  3994. },
  3995. {
  3996. "in": "path",
  3997. "name": "sessionID",
  3998. "schema": {
  3999. "type": "string",
  4000. "pattern": "^ses.*"
  4001. },
  4002. "required": true
  4003. }
  4004. ],
  4005. "summary": "Revert message",
  4006. "description": "Revert a specific message in a session, undoing its effects and restoring the previous state.",
  4007. "responses": {
  4008. "200": {
  4009. "description": "Updated session",
  4010. "content": {
  4011. "application/json": {
  4012. "schema": {
  4013. "$ref": "#/components/schemas/Session"
  4014. }
  4015. }
  4016. }
  4017. },
  4018. "400": {
  4019. "description": "Bad request",
  4020. "content": {
  4021. "application/json": {
  4022. "schema": {
  4023. "$ref": "#/components/schemas/BadRequestError"
  4024. }
  4025. }
  4026. }
  4027. },
  4028. "404": {
  4029. "description": "Not found",
  4030. "content": {
  4031. "application/json": {
  4032. "schema": {
  4033. "$ref": "#/components/schemas/NotFoundError"
  4034. }
  4035. }
  4036. }
  4037. }
  4038. },
  4039. "requestBody": {
  4040. "content": {
  4041. "application/json": {
  4042. "schema": {
  4043. "type": "object",
  4044. "properties": {
  4045. "messageID": {
  4046. "type": "string",
  4047. "pattern": "^msg.*"
  4048. },
  4049. "partID": {
  4050. "type": "string",
  4051. "pattern": "^prt.*"
  4052. }
  4053. },
  4054. "required": ["messageID"]
  4055. }
  4056. }
  4057. }
  4058. },
  4059. "x-codeSamples": [
  4060. {
  4061. "lang": "js",
  4062. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.revert({\n ...\n})"
  4063. }
  4064. ]
  4065. }
  4066. },
  4067. "/session/{sessionID}/unrevert": {
  4068. "post": {
  4069. "operationId": "session.unrevert",
  4070. "parameters": [
  4071. {
  4072. "in": "query",
  4073. "name": "directory",
  4074. "schema": {
  4075. "type": "string"
  4076. }
  4077. },
  4078. {
  4079. "in": "query",
  4080. "name": "workspace",
  4081. "schema": {
  4082. "type": "string"
  4083. }
  4084. },
  4085. {
  4086. "in": "path",
  4087. "name": "sessionID",
  4088. "schema": {
  4089. "type": "string",
  4090. "pattern": "^ses.*"
  4091. },
  4092. "required": true
  4093. }
  4094. ],
  4095. "summary": "Restore reverted messages",
  4096. "description": "Restore all previously reverted messages in a session.",
  4097. "responses": {
  4098. "200": {
  4099. "description": "Updated session",
  4100. "content": {
  4101. "application/json": {
  4102. "schema": {
  4103. "$ref": "#/components/schemas/Session"
  4104. }
  4105. }
  4106. }
  4107. },
  4108. "400": {
  4109. "description": "Bad request",
  4110. "content": {
  4111. "application/json": {
  4112. "schema": {
  4113. "$ref": "#/components/schemas/BadRequestError"
  4114. }
  4115. }
  4116. }
  4117. },
  4118. "404": {
  4119. "description": "Not found",
  4120. "content": {
  4121. "application/json": {
  4122. "schema": {
  4123. "$ref": "#/components/schemas/NotFoundError"
  4124. }
  4125. }
  4126. }
  4127. }
  4128. },
  4129. "x-codeSamples": [
  4130. {
  4131. "lang": "js",
  4132. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.unrevert({\n ...\n})"
  4133. }
  4134. ]
  4135. }
  4136. },
  4137. "/session/{sessionID}/permissions/{permissionID}": {
  4138. "post": {
  4139. "operationId": "permission.respond",
  4140. "parameters": [
  4141. {
  4142. "in": "query",
  4143. "name": "directory",
  4144. "schema": {
  4145. "type": "string"
  4146. }
  4147. },
  4148. {
  4149. "in": "query",
  4150. "name": "workspace",
  4151. "schema": {
  4152. "type": "string"
  4153. }
  4154. },
  4155. {
  4156. "in": "path",
  4157. "name": "sessionID",
  4158. "schema": {
  4159. "type": "string",
  4160. "pattern": "^ses.*"
  4161. },
  4162. "required": true
  4163. },
  4164. {
  4165. "in": "path",
  4166. "name": "permissionID",
  4167. "schema": {
  4168. "type": "string",
  4169. "pattern": "^per.*"
  4170. },
  4171. "required": true
  4172. }
  4173. ],
  4174. "summary": "Respond to permission",
  4175. "deprecated": true,
  4176. "description": "Approve or deny a permission request from the AI assistant.",
  4177. "responses": {
  4178. "200": {
  4179. "description": "Permission processed successfully",
  4180. "content": {
  4181. "application/json": {
  4182. "schema": {
  4183. "type": "boolean"
  4184. }
  4185. }
  4186. }
  4187. },
  4188. "400": {
  4189. "description": "Bad request",
  4190. "content": {
  4191. "application/json": {
  4192. "schema": {
  4193. "$ref": "#/components/schemas/BadRequestError"
  4194. }
  4195. }
  4196. }
  4197. },
  4198. "404": {
  4199. "description": "Not found",
  4200. "content": {
  4201. "application/json": {
  4202. "schema": {
  4203. "$ref": "#/components/schemas/NotFoundError"
  4204. }
  4205. }
  4206. }
  4207. }
  4208. },
  4209. "requestBody": {
  4210. "content": {
  4211. "application/json": {
  4212. "schema": {
  4213. "type": "object",
  4214. "properties": {
  4215. "response": {
  4216. "type": "string",
  4217. "enum": ["once", "always", "reject"]
  4218. }
  4219. },
  4220. "required": ["response"]
  4221. }
  4222. }
  4223. }
  4224. },
  4225. "x-codeSamples": [
  4226. {
  4227. "lang": "js",
  4228. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.permission.respond({\n ...\n})"
  4229. }
  4230. ]
  4231. }
  4232. },
  4233. "/permission/{requestID}/reply": {
  4234. "post": {
  4235. "operationId": "permission.reply",
  4236. "parameters": [
  4237. {
  4238. "in": "query",
  4239. "name": "directory",
  4240. "schema": {
  4241. "type": "string"
  4242. }
  4243. },
  4244. {
  4245. "in": "query",
  4246. "name": "workspace",
  4247. "schema": {
  4248. "type": "string"
  4249. }
  4250. },
  4251. {
  4252. "in": "path",
  4253. "name": "requestID",
  4254. "schema": {
  4255. "type": "string",
  4256. "pattern": "^per.*"
  4257. },
  4258. "required": true
  4259. }
  4260. ],
  4261. "summary": "Respond to permission request",
  4262. "description": "Approve or deny a permission request from the AI assistant.",
  4263. "responses": {
  4264. "200": {
  4265. "description": "Permission processed successfully",
  4266. "content": {
  4267. "application/json": {
  4268. "schema": {
  4269. "type": "boolean"
  4270. }
  4271. }
  4272. }
  4273. },
  4274. "400": {
  4275. "description": "Bad request",
  4276. "content": {
  4277. "application/json": {
  4278. "schema": {
  4279. "$ref": "#/components/schemas/BadRequestError"
  4280. }
  4281. }
  4282. }
  4283. },
  4284. "404": {
  4285. "description": "Not found",
  4286. "content": {
  4287. "application/json": {
  4288. "schema": {
  4289. "$ref": "#/components/schemas/NotFoundError"
  4290. }
  4291. }
  4292. }
  4293. }
  4294. },
  4295. "requestBody": {
  4296. "content": {
  4297. "application/json": {
  4298. "schema": {
  4299. "type": "object",
  4300. "properties": {
  4301. "reply": {
  4302. "type": "string",
  4303. "enum": ["once", "always", "reject"]
  4304. },
  4305. "message": {
  4306. "type": "string"
  4307. }
  4308. },
  4309. "required": ["reply"]
  4310. }
  4311. }
  4312. }
  4313. },
  4314. "x-codeSamples": [
  4315. {
  4316. "lang": "js",
  4317. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.permission.reply({\n ...\n})"
  4318. }
  4319. ]
  4320. }
  4321. },
  4322. "/permission": {
  4323. "get": {
  4324. "operationId": "permission.list",
  4325. "parameters": [
  4326. {
  4327. "in": "query",
  4328. "name": "directory",
  4329. "schema": {
  4330. "type": "string"
  4331. }
  4332. },
  4333. {
  4334. "in": "query",
  4335. "name": "workspace",
  4336. "schema": {
  4337. "type": "string"
  4338. }
  4339. }
  4340. ],
  4341. "summary": "List pending permissions",
  4342. "description": "Get all pending permission requests across all sessions.",
  4343. "responses": {
  4344. "200": {
  4345. "description": "List of pending permissions",
  4346. "content": {
  4347. "application/json": {
  4348. "schema": {
  4349. "type": "array",
  4350. "items": {
  4351. "$ref": "#/components/schemas/PermissionRequest"
  4352. }
  4353. }
  4354. }
  4355. }
  4356. }
  4357. },
  4358. "x-codeSamples": [
  4359. {
  4360. "lang": "js",
  4361. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.permission.list({\n ...\n})"
  4362. }
  4363. ]
  4364. }
  4365. },
  4366. "/question": {
  4367. "get": {
  4368. "operationId": "question.list",
  4369. "parameters": [
  4370. {
  4371. "in": "query",
  4372. "name": "directory",
  4373. "schema": {
  4374. "type": "string"
  4375. }
  4376. },
  4377. {
  4378. "in": "query",
  4379. "name": "workspace",
  4380. "schema": {
  4381. "type": "string"
  4382. }
  4383. }
  4384. ],
  4385. "summary": "List pending questions",
  4386. "description": "Get all pending question requests across all sessions.",
  4387. "responses": {
  4388. "200": {
  4389. "description": "List of pending questions",
  4390. "content": {
  4391. "application/json": {
  4392. "schema": {
  4393. "type": "array",
  4394. "items": {
  4395. "$ref": "#/components/schemas/QuestionRequest"
  4396. }
  4397. }
  4398. }
  4399. }
  4400. }
  4401. },
  4402. "x-codeSamples": [
  4403. {
  4404. "lang": "js",
  4405. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.question.list({\n ...\n})"
  4406. }
  4407. ]
  4408. }
  4409. },
  4410. "/question/{requestID}/reply": {
  4411. "post": {
  4412. "operationId": "question.reply",
  4413. "parameters": [
  4414. {
  4415. "in": "query",
  4416. "name": "directory",
  4417. "schema": {
  4418. "type": "string"
  4419. }
  4420. },
  4421. {
  4422. "in": "query",
  4423. "name": "workspace",
  4424. "schema": {
  4425. "type": "string"
  4426. }
  4427. },
  4428. {
  4429. "in": "path",
  4430. "name": "requestID",
  4431. "schema": {
  4432. "type": "string",
  4433. "pattern": "^que.*"
  4434. },
  4435. "required": true
  4436. }
  4437. ],
  4438. "summary": "Reply to question request",
  4439. "description": "Provide answers to a question request from the AI assistant.",
  4440. "responses": {
  4441. "200": {
  4442. "description": "Question answered successfully",
  4443. "content": {
  4444. "application/json": {
  4445. "schema": {
  4446. "type": "boolean"
  4447. }
  4448. }
  4449. }
  4450. },
  4451. "400": {
  4452. "description": "Bad request",
  4453. "content": {
  4454. "application/json": {
  4455. "schema": {
  4456. "$ref": "#/components/schemas/BadRequestError"
  4457. }
  4458. }
  4459. }
  4460. },
  4461. "404": {
  4462. "description": "Not found",
  4463. "content": {
  4464. "application/json": {
  4465. "schema": {
  4466. "$ref": "#/components/schemas/NotFoundError"
  4467. }
  4468. }
  4469. }
  4470. }
  4471. },
  4472. "requestBody": {
  4473. "content": {
  4474. "application/json": {
  4475. "schema": {
  4476. "type": "object",
  4477. "properties": {
  4478. "answers": {
  4479. "description": "User answers in order of questions (each answer is an array of selected labels)",
  4480. "type": "array",
  4481. "items": {
  4482. "$ref": "#/components/schemas/QuestionAnswer"
  4483. }
  4484. }
  4485. },
  4486. "required": ["answers"]
  4487. }
  4488. }
  4489. }
  4490. },
  4491. "x-codeSamples": [
  4492. {
  4493. "lang": "js",
  4494. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.question.reply({\n ...\n})"
  4495. }
  4496. ]
  4497. }
  4498. },
  4499. "/question/{requestID}/reject": {
  4500. "post": {
  4501. "operationId": "question.reject",
  4502. "parameters": [
  4503. {
  4504. "in": "query",
  4505. "name": "directory",
  4506. "schema": {
  4507. "type": "string"
  4508. }
  4509. },
  4510. {
  4511. "in": "query",
  4512. "name": "workspace",
  4513. "schema": {
  4514. "type": "string"
  4515. }
  4516. },
  4517. {
  4518. "in": "path",
  4519. "name": "requestID",
  4520. "schema": {
  4521. "type": "string",
  4522. "pattern": "^que.*"
  4523. },
  4524. "required": true
  4525. }
  4526. ],
  4527. "summary": "Reject question request",
  4528. "description": "Reject a question request from the AI assistant.",
  4529. "responses": {
  4530. "200": {
  4531. "description": "Question rejected successfully",
  4532. "content": {
  4533. "application/json": {
  4534. "schema": {
  4535. "type": "boolean"
  4536. }
  4537. }
  4538. }
  4539. },
  4540. "400": {
  4541. "description": "Bad request",
  4542. "content": {
  4543. "application/json": {
  4544. "schema": {
  4545. "$ref": "#/components/schemas/BadRequestError"
  4546. }
  4547. }
  4548. }
  4549. },
  4550. "404": {
  4551. "description": "Not found",
  4552. "content": {
  4553. "application/json": {
  4554. "schema": {
  4555. "$ref": "#/components/schemas/NotFoundError"
  4556. }
  4557. }
  4558. }
  4559. }
  4560. },
  4561. "x-codeSamples": [
  4562. {
  4563. "lang": "js",
  4564. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.question.reject({\n ...\n})"
  4565. }
  4566. ]
  4567. }
  4568. },
  4569. "/provider": {
  4570. "get": {
  4571. "operationId": "provider.list",
  4572. "parameters": [
  4573. {
  4574. "in": "query",
  4575. "name": "directory",
  4576. "schema": {
  4577. "type": "string"
  4578. }
  4579. },
  4580. {
  4581. "in": "query",
  4582. "name": "workspace",
  4583. "schema": {
  4584. "type": "string"
  4585. }
  4586. }
  4587. ],
  4588. "summary": "List providers",
  4589. "description": "Get a list of all available AI providers, including both available and connected ones.",
  4590. "responses": {
  4591. "200": {
  4592. "description": "List of providers",
  4593. "content": {
  4594. "application/json": {
  4595. "schema": {
  4596. "type": "object",
  4597. "properties": {
  4598. "all": {
  4599. "type": "array",
  4600. "items": {
  4601. "type": "object",
  4602. "properties": {
  4603. "api": {
  4604. "type": "string"
  4605. },
  4606. "name": {
  4607. "type": "string"
  4608. },
  4609. "env": {
  4610. "type": "array",
  4611. "items": {
  4612. "type": "string"
  4613. }
  4614. },
  4615. "id": {
  4616. "type": "string"
  4617. },
  4618. "npm": {
  4619. "type": "string"
  4620. },
  4621. "models": {
  4622. "type": "object",
  4623. "propertyNames": {
  4624. "type": "string"
  4625. },
  4626. "additionalProperties": {
  4627. "type": "object",
  4628. "properties": {
  4629. "id": {
  4630. "type": "string"
  4631. },
  4632. "name": {
  4633. "type": "string"
  4634. },
  4635. "family": {
  4636. "type": "string"
  4637. },
  4638. "release_date": {
  4639. "type": "string"
  4640. },
  4641. "attachment": {
  4642. "type": "boolean"
  4643. },
  4644. "reasoning": {
  4645. "type": "boolean"
  4646. },
  4647. "temperature": {
  4648. "type": "boolean"
  4649. },
  4650. "tool_call": {
  4651. "type": "boolean"
  4652. },
  4653. "interleaved": {
  4654. "anyOf": [
  4655. {
  4656. "type": "boolean",
  4657. "const": true
  4658. },
  4659. {
  4660. "type": "object",
  4661. "properties": {
  4662. "field": {
  4663. "type": "string",
  4664. "enum": ["reasoning_content", "reasoning_details"]
  4665. }
  4666. },
  4667. "required": ["field"],
  4668. "additionalProperties": false
  4669. }
  4670. ]
  4671. },
  4672. "cost": {
  4673. "type": "object",
  4674. "properties": {
  4675. "input": {
  4676. "type": "number"
  4677. },
  4678. "output": {
  4679. "type": "number"
  4680. },
  4681. "cache_read": {
  4682. "type": "number"
  4683. },
  4684. "cache_write": {
  4685. "type": "number"
  4686. },
  4687. "context_over_200k": {
  4688. "type": "object",
  4689. "properties": {
  4690. "input": {
  4691. "type": "number"
  4692. },
  4693. "output": {
  4694. "type": "number"
  4695. },
  4696. "cache_read": {
  4697. "type": "number"
  4698. },
  4699. "cache_write": {
  4700. "type": "number"
  4701. }
  4702. },
  4703. "required": ["input", "output"]
  4704. }
  4705. },
  4706. "required": ["input", "output"]
  4707. },
  4708. "limit": {
  4709. "type": "object",
  4710. "properties": {
  4711. "context": {
  4712. "type": "number"
  4713. },
  4714. "input": {
  4715. "type": "number"
  4716. },
  4717. "output": {
  4718. "type": "number"
  4719. }
  4720. },
  4721. "required": ["context", "output"]
  4722. },
  4723. "modalities": {
  4724. "type": "object",
  4725. "properties": {
  4726. "input": {
  4727. "type": "array",
  4728. "items": {
  4729. "type": "string",
  4730. "enum": ["text", "audio", "image", "video", "pdf"]
  4731. }
  4732. },
  4733. "output": {
  4734. "type": "array",
  4735. "items": {
  4736. "type": "string",
  4737. "enum": ["text", "audio", "image", "video", "pdf"]
  4738. }
  4739. }
  4740. },
  4741. "required": ["input", "output"]
  4742. },
  4743. "status": {
  4744. "type": "string",
  4745. "enum": ["alpha", "beta", "deprecated"]
  4746. },
  4747. "provider": {
  4748. "type": "object",
  4749. "properties": {
  4750. "npm": {
  4751. "type": "string"
  4752. },
  4753. "api": {
  4754. "type": "string"
  4755. }
  4756. }
  4757. }
  4758. },
  4759. "required": [
  4760. "id",
  4761. "name",
  4762. "release_date",
  4763. "attachment",
  4764. "reasoning",
  4765. "temperature",
  4766. "tool_call",
  4767. "limit"
  4768. ]
  4769. }
  4770. }
  4771. },
  4772. "required": ["name", "env", "id", "models"]
  4773. }
  4774. },
  4775. "default": {
  4776. "type": "object",
  4777. "propertyNames": {
  4778. "type": "string"
  4779. },
  4780. "additionalProperties": {
  4781. "type": "string"
  4782. }
  4783. },
  4784. "connected": {
  4785. "type": "array",
  4786. "items": {
  4787. "type": "string"
  4788. }
  4789. }
  4790. },
  4791. "required": ["all", "default", "connected"]
  4792. }
  4793. }
  4794. }
  4795. }
  4796. },
  4797. "x-codeSamples": [
  4798. {
  4799. "lang": "js",
  4800. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.list({\n ...\n})"
  4801. }
  4802. ]
  4803. }
  4804. },
  4805. "/provider/auth": {
  4806. "get": {
  4807. "operationId": "provider.auth",
  4808. "parameters": [
  4809. {
  4810. "in": "query",
  4811. "name": "directory",
  4812. "schema": {
  4813. "type": "string"
  4814. }
  4815. },
  4816. {
  4817. "in": "query",
  4818. "name": "workspace",
  4819. "schema": {
  4820. "type": "string"
  4821. }
  4822. }
  4823. ],
  4824. "summary": "Get provider auth methods",
  4825. "description": "Retrieve available authentication methods for all AI providers.",
  4826. "responses": {
  4827. "200": {
  4828. "description": "Provider auth methods",
  4829. "content": {
  4830. "application/json": {
  4831. "schema": {
  4832. "type": "object",
  4833. "propertyNames": {
  4834. "type": "string"
  4835. },
  4836. "additionalProperties": {
  4837. "type": "array",
  4838. "items": {
  4839. "$ref": "#/components/schemas/ProviderAuthMethod"
  4840. }
  4841. }
  4842. }
  4843. }
  4844. }
  4845. }
  4846. },
  4847. "x-codeSamples": [
  4848. {
  4849. "lang": "js",
  4850. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.auth({\n ...\n})"
  4851. }
  4852. ]
  4853. }
  4854. },
  4855. "/provider/{providerID}/oauth/authorize": {
  4856. "post": {
  4857. "operationId": "provider.oauth.authorize",
  4858. "parameters": [
  4859. {
  4860. "in": "query",
  4861. "name": "directory",
  4862. "schema": {
  4863. "type": "string"
  4864. }
  4865. },
  4866. {
  4867. "in": "query",
  4868. "name": "workspace",
  4869. "schema": {
  4870. "type": "string"
  4871. }
  4872. },
  4873. {
  4874. "in": "path",
  4875. "name": "providerID",
  4876. "schema": {
  4877. "type": "string"
  4878. },
  4879. "required": true,
  4880. "description": "Provider ID"
  4881. }
  4882. ],
  4883. "summary": "OAuth authorize",
  4884. "description": "Initiate OAuth authorization for a specific AI provider to get an authorization URL.",
  4885. "responses": {
  4886. "200": {
  4887. "description": "Authorization URL and method",
  4888. "content": {
  4889. "application/json": {
  4890. "schema": {
  4891. "$ref": "#/components/schemas/ProviderAuthAuthorization"
  4892. }
  4893. }
  4894. }
  4895. },
  4896. "400": {
  4897. "description": "Bad request",
  4898. "content": {
  4899. "application/json": {
  4900. "schema": {
  4901. "$ref": "#/components/schemas/BadRequestError"
  4902. }
  4903. }
  4904. }
  4905. }
  4906. },
  4907. "requestBody": {
  4908. "content": {
  4909. "application/json": {
  4910. "schema": {
  4911. "type": "object",
  4912. "properties": {
  4913. "method": {
  4914. "description": "Auth method index",
  4915. "type": "number"
  4916. },
  4917. "inputs": {
  4918. "description": "Prompt inputs",
  4919. "type": "object",
  4920. "propertyNames": {
  4921. "type": "string"
  4922. },
  4923. "additionalProperties": {
  4924. "type": "string"
  4925. }
  4926. }
  4927. },
  4928. "required": ["method"]
  4929. }
  4930. }
  4931. }
  4932. },
  4933. "x-codeSamples": [
  4934. {
  4935. "lang": "js",
  4936. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.oauth.authorize({\n ...\n})"
  4937. }
  4938. ]
  4939. }
  4940. },
  4941. "/provider/{providerID}/oauth/callback": {
  4942. "post": {
  4943. "operationId": "provider.oauth.callback",
  4944. "parameters": [
  4945. {
  4946. "in": "query",
  4947. "name": "directory",
  4948. "schema": {
  4949. "type": "string"
  4950. }
  4951. },
  4952. {
  4953. "in": "query",
  4954. "name": "workspace",
  4955. "schema": {
  4956. "type": "string"
  4957. }
  4958. },
  4959. {
  4960. "in": "path",
  4961. "name": "providerID",
  4962. "schema": {
  4963. "type": "string"
  4964. },
  4965. "required": true,
  4966. "description": "Provider ID"
  4967. }
  4968. ],
  4969. "summary": "OAuth callback",
  4970. "description": "Handle the OAuth callback from a provider after user authorization.",
  4971. "responses": {
  4972. "200": {
  4973. "description": "OAuth callback processed successfully",
  4974. "content": {
  4975. "application/json": {
  4976. "schema": {
  4977. "type": "boolean"
  4978. }
  4979. }
  4980. }
  4981. },
  4982. "400": {
  4983. "description": "Bad request",
  4984. "content": {
  4985. "application/json": {
  4986. "schema": {
  4987. "$ref": "#/components/schemas/BadRequestError"
  4988. }
  4989. }
  4990. }
  4991. }
  4992. },
  4993. "requestBody": {
  4994. "content": {
  4995. "application/json": {
  4996. "schema": {
  4997. "type": "object",
  4998. "properties": {
  4999. "method": {
  5000. "description": "Auth method index",
  5001. "type": "number"
  5002. },
  5003. "code": {
  5004. "description": "OAuth authorization code",
  5005. "type": "string"
  5006. }
  5007. },
  5008. "required": ["method"]
  5009. }
  5010. }
  5011. }
  5012. },
  5013. "x-codeSamples": [
  5014. {
  5015. "lang": "js",
  5016. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.oauth.callback({\n ...\n})"
  5017. }
  5018. ]
  5019. }
  5020. },
  5021. "/find": {
  5022. "get": {
  5023. "operationId": "find.text",
  5024. "parameters": [
  5025. {
  5026. "in": "query",
  5027. "name": "directory",
  5028. "schema": {
  5029. "type": "string"
  5030. }
  5031. },
  5032. {
  5033. "in": "query",
  5034. "name": "workspace",
  5035. "schema": {
  5036. "type": "string"
  5037. }
  5038. },
  5039. {
  5040. "in": "query",
  5041. "name": "pattern",
  5042. "schema": {
  5043. "type": "string"
  5044. },
  5045. "required": true
  5046. }
  5047. ],
  5048. "summary": "Find text",
  5049. "description": "Search for text patterns across files in the project using ripgrep.",
  5050. "responses": {
  5051. "200": {
  5052. "description": "Matches",
  5053. "content": {
  5054. "application/json": {
  5055. "schema": {
  5056. "type": "array",
  5057. "items": {
  5058. "type": "object",
  5059. "properties": {
  5060. "path": {
  5061. "type": "object",
  5062. "properties": {
  5063. "text": {
  5064. "type": "string"
  5065. }
  5066. },
  5067. "required": ["text"]
  5068. },
  5069. "lines": {
  5070. "type": "object",
  5071. "properties": {
  5072. "text": {
  5073. "type": "string"
  5074. }
  5075. },
  5076. "required": ["text"]
  5077. },
  5078. "line_number": {
  5079. "type": "number"
  5080. },
  5081. "absolute_offset": {
  5082. "type": "number"
  5083. },
  5084. "submatches": {
  5085. "type": "array",
  5086. "items": {
  5087. "type": "object",
  5088. "properties": {
  5089. "match": {
  5090. "type": "object",
  5091. "properties": {
  5092. "text": {
  5093. "type": "string"
  5094. }
  5095. },
  5096. "required": ["text"]
  5097. },
  5098. "start": {
  5099. "type": "number"
  5100. },
  5101. "end": {
  5102. "type": "number"
  5103. }
  5104. },
  5105. "required": ["match", "start", "end"]
  5106. }
  5107. }
  5108. },
  5109. "required": ["path", "lines", "line_number", "absolute_offset", "submatches"]
  5110. }
  5111. }
  5112. }
  5113. }
  5114. }
  5115. },
  5116. "x-codeSamples": [
  5117. {
  5118. "lang": "js",
  5119. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.find.text({\n ...\n})"
  5120. }
  5121. ]
  5122. }
  5123. },
  5124. "/find/file": {
  5125. "get": {
  5126. "operationId": "find.files",
  5127. "parameters": [
  5128. {
  5129. "in": "query",
  5130. "name": "directory",
  5131. "schema": {
  5132. "type": "string"
  5133. }
  5134. },
  5135. {
  5136. "in": "query",
  5137. "name": "workspace",
  5138. "schema": {
  5139. "type": "string"
  5140. }
  5141. },
  5142. {
  5143. "in": "query",
  5144. "name": "query",
  5145. "schema": {
  5146. "type": "string"
  5147. },
  5148. "required": true
  5149. },
  5150. {
  5151. "in": "query",
  5152. "name": "dirs",
  5153. "schema": {
  5154. "type": "string",
  5155. "enum": ["true", "false"]
  5156. }
  5157. },
  5158. {
  5159. "in": "query",
  5160. "name": "type",
  5161. "schema": {
  5162. "type": "string",
  5163. "enum": ["file", "directory"]
  5164. }
  5165. },
  5166. {
  5167. "in": "query",
  5168. "name": "limit",
  5169. "schema": {
  5170. "type": "integer",
  5171. "minimum": 1,
  5172. "maximum": 200
  5173. }
  5174. }
  5175. ],
  5176. "summary": "Find files",
  5177. "description": "Search for files or directories by name or pattern in the project directory.",
  5178. "responses": {
  5179. "200": {
  5180. "description": "File paths",
  5181. "content": {
  5182. "application/json": {
  5183. "schema": {
  5184. "type": "array",
  5185. "items": {
  5186. "type": "string"
  5187. }
  5188. }
  5189. }
  5190. }
  5191. }
  5192. },
  5193. "x-codeSamples": [
  5194. {
  5195. "lang": "js",
  5196. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.find.files({\n ...\n})"
  5197. }
  5198. ]
  5199. }
  5200. },
  5201. "/find/symbol": {
  5202. "get": {
  5203. "operationId": "find.symbols",
  5204. "parameters": [
  5205. {
  5206. "in": "query",
  5207. "name": "directory",
  5208. "schema": {
  5209. "type": "string"
  5210. }
  5211. },
  5212. {
  5213. "in": "query",
  5214. "name": "workspace",
  5215. "schema": {
  5216. "type": "string"
  5217. }
  5218. },
  5219. {
  5220. "in": "query",
  5221. "name": "query",
  5222. "schema": {
  5223. "type": "string"
  5224. },
  5225. "required": true
  5226. }
  5227. ],
  5228. "summary": "Find symbols",
  5229. "description": "Search for workspace symbols like functions, classes, and variables using LSP.",
  5230. "responses": {
  5231. "200": {
  5232. "description": "Symbols",
  5233. "content": {
  5234. "application/json": {
  5235. "schema": {
  5236. "type": "array",
  5237. "items": {
  5238. "$ref": "#/components/schemas/Symbol"
  5239. }
  5240. }
  5241. }
  5242. }
  5243. }
  5244. },
  5245. "x-codeSamples": [
  5246. {
  5247. "lang": "js",
  5248. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.find.symbols({\n ...\n})"
  5249. }
  5250. ]
  5251. }
  5252. },
  5253. "/file": {
  5254. "get": {
  5255. "operationId": "file.list",
  5256. "parameters": [
  5257. {
  5258. "in": "query",
  5259. "name": "directory",
  5260. "schema": {
  5261. "type": "string"
  5262. }
  5263. },
  5264. {
  5265. "in": "query",
  5266. "name": "workspace",
  5267. "schema": {
  5268. "type": "string"
  5269. }
  5270. },
  5271. {
  5272. "in": "query",
  5273. "name": "path",
  5274. "schema": {
  5275. "type": "string"
  5276. },
  5277. "required": true
  5278. }
  5279. ],
  5280. "summary": "List files",
  5281. "description": "List files and directories in a specified path.",
  5282. "responses": {
  5283. "200": {
  5284. "description": "Files and directories",
  5285. "content": {
  5286. "application/json": {
  5287. "schema": {
  5288. "type": "array",
  5289. "items": {
  5290. "$ref": "#/components/schemas/FileNode"
  5291. }
  5292. }
  5293. }
  5294. }
  5295. }
  5296. },
  5297. "x-codeSamples": [
  5298. {
  5299. "lang": "js",
  5300. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.file.list({\n ...\n})"
  5301. }
  5302. ]
  5303. }
  5304. },
  5305. "/file/content": {
  5306. "get": {
  5307. "operationId": "file.read",
  5308. "parameters": [
  5309. {
  5310. "in": "query",
  5311. "name": "directory",
  5312. "schema": {
  5313. "type": "string"
  5314. }
  5315. },
  5316. {
  5317. "in": "query",
  5318. "name": "workspace",
  5319. "schema": {
  5320. "type": "string"
  5321. }
  5322. },
  5323. {
  5324. "in": "query",
  5325. "name": "path",
  5326. "schema": {
  5327. "type": "string"
  5328. },
  5329. "required": true
  5330. }
  5331. ],
  5332. "summary": "Read file",
  5333. "description": "Read the content of a specified file.",
  5334. "responses": {
  5335. "200": {
  5336. "description": "File content",
  5337. "content": {
  5338. "application/json": {
  5339. "schema": {
  5340. "$ref": "#/components/schemas/FileContent"
  5341. }
  5342. }
  5343. }
  5344. }
  5345. },
  5346. "x-codeSamples": [
  5347. {
  5348. "lang": "js",
  5349. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.file.read({\n ...\n})"
  5350. }
  5351. ]
  5352. }
  5353. },
  5354. "/file/status": {
  5355. "get": {
  5356. "operationId": "file.status",
  5357. "parameters": [
  5358. {
  5359. "in": "query",
  5360. "name": "directory",
  5361. "schema": {
  5362. "type": "string"
  5363. }
  5364. },
  5365. {
  5366. "in": "query",
  5367. "name": "workspace",
  5368. "schema": {
  5369. "type": "string"
  5370. }
  5371. }
  5372. ],
  5373. "summary": "Get file status",
  5374. "description": "Get the git status of all files in the project.",
  5375. "responses": {
  5376. "200": {
  5377. "description": "File status",
  5378. "content": {
  5379. "application/json": {
  5380. "schema": {
  5381. "type": "array",
  5382. "items": {
  5383. "$ref": "#/components/schemas/File"
  5384. }
  5385. }
  5386. }
  5387. }
  5388. }
  5389. },
  5390. "x-codeSamples": [
  5391. {
  5392. "lang": "js",
  5393. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.file.status({\n ...\n})"
  5394. }
  5395. ]
  5396. }
  5397. },
  5398. "/event": {
  5399. "get": {
  5400. "operationId": "event.subscribe",
  5401. "parameters": [
  5402. {
  5403. "in": "query",
  5404. "name": "directory",
  5405. "schema": {
  5406. "type": "string"
  5407. }
  5408. },
  5409. {
  5410. "in": "query",
  5411. "name": "workspace",
  5412. "schema": {
  5413. "type": "string"
  5414. }
  5415. }
  5416. ],
  5417. "summary": "Subscribe to events",
  5418. "description": "Get events",
  5419. "responses": {
  5420. "200": {
  5421. "description": "Event stream",
  5422. "content": {
  5423. "text/event-stream": {
  5424. "schema": {
  5425. "$ref": "#/components/schemas/Event"
  5426. }
  5427. }
  5428. }
  5429. }
  5430. },
  5431. "x-codeSamples": [
  5432. {
  5433. "lang": "js",
  5434. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.event.subscribe({\n ...\n})"
  5435. }
  5436. ]
  5437. }
  5438. },
  5439. "/mcp": {
  5440. "get": {
  5441. "operationId": "mcp.status",
  5442. "parameters": [
  5443. {
  5444. "in": "query",
  5445. "name": "directory",
  5446. "schema": {
  5447. "type": "string"
  5448. }
  5449. },
  5450. {
  5451. "in": "query",
  5452. "name": "workspace",
  5453. "schema": {
  5454. "type": "string"
  5455. }
  5456. }
  5457. ],
  5458. "summary": "Get MCP status",
  5459. "description": "Get the status of all Model Context Protocol (MCP) servers.",
  5460. "responses": {
  5461. "200": {
  5462. "description": "MCP server status",
  5463. "content": {
  5464. "application/json": {
  5465. "schema": {
  5466. "type": "object",
  5467. "propertyNames": {
  5468. "type": "string"
  5469. },
  5470. "additionalProperties": {
  5471. "$ref": "#/components/schemas/MCPStatus"
  5472. }
  5473. }
  5474. }
  5475. }
  5476. }
  5477. },
  5478. "x-codeSamples": [
  5479. {
  5480. "lang": "js",
  5481. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.status({\n ...\n})"
  5482. }
  5483. ]
  5484. },
  5485. "post": {
  5486. "operationId": "mcp.add",
  5487. "parameters": [
  5488. {
  5489. "in": "query",
  5490. "name": "directory",
  5491. "schema": {
  5492. "type": "string"
  5493. }
  5494. },
  5495. {
  5496. "in": "query",
  5497. "name": "workspace",
  5498. "schema": {
  5499. "type": "string"
  5500. }
  5501. }
  5502. ],
  5503. "summary": "Add MCP server",
  5504. "description": "Dynamically add a new Model Context Protocol (MCP) server to the system.",
  5505. "responses": {
  5506. "200": {
  5507. "description": "MCP server added successfully",
  5508. "content": {
  5509. "application/json": {
  5510. "schema": {
  5511. "type": "object",
  5512. "propertyNames": {
  5513. "type": "string"
  5514. },
  5515. "additionalProperties": {
  5516. "$ref": "#/components/schemas/MCPStatus"
  5517. }
  5518. }
  5519. }
  5520. }
  5521. },
  5522. "400": {
  5523. "description": "Bad request",
  5524. "content": {
  5525. "application/json": {
  5526. "schema": {
  5527. "$ref": "#/components/schemas/BadRequestError"
  5528. }
  5529. }
  5530. }
  5531. }
  5532. },
  5533. "requestBody": {
  5534. "content": {
  5535. "application/json": {
  5536. "schema": {
  5537. "type": "object",
  5538. "properties": {
  5539. "name": {
  5540. "type": "string"
  5541. },
  5542. "config": {
  5543. "anyOf": [
  5544. {
  5545. "$ref": "#/components/schemas/McpLocalConfig"
  5546. },
  5547. {
  5548. "$ref": "#/components/schemas/McpRemoteConfig"
  5549. }
  5550. ]
  5551. }
  5552. },
  5553. "required": ["name", "config"]
  5554. }
  5555. }
  5556. }
  5557. },
  5558. "x-codeSamples": [
  5559. {
  5560. "lang": "js",
  5561. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.add({\n ...\n})"
  5562. }
  5563. ]
  5564. }
  5565. },
  5566. "/mcp/{name}/auth": {
  5567. "post": {
  5568. "operationId": "mcp.auth.start",
  5569. "parameters": [
  5570. {
  5571. "in": "query",
  5572. "name": "directory",
  5573. "schema": {
  5574. "type": "string"
  5575. }
  5576. },
  5577. {
  5578. "in": "query",
  5579. "name": "workspace",
  5580. "schema": {
  5581. "type": "string"
  5582. }
  5583. },
  5584. {
  5585. "schema": {
  5586. "type": "string"
  5587. },
  5588. "in": "path",
  5589. "name": "name",
  5590. "required": true
  5591. }
  5592. ],
  5593. "summary": "Start MCP OAuth",
  5594. "description": "Start OAuth authentication flow for a Model Context Protocol (MCP) server.",
  5595. "responses": {
  5596. "200": {
  5597. "description": "OAuth flow started",
  5598. "content": {
  5599. "application/json": {
  5600. "schema": {
  5601. "type": "object",
  5602. "properties": {
  5603. "authorizationUrl": {
  5604. "description": "URL to open in browser for authorization",
  5605. "type": "string"
  5606. }
  5607. },
  5608. "required": ["authorizationUrl"]
  5609. }
  5610. }
  5611. }
  5612. },
  5613. "400": {
  5614. "description": "Bad request",
  5615. "content": {
  5616. "application/json": {
  5617. "schema": {
  5618. "$ref": "#/components/schemas/BadRequestError"
  5619. }
  5620. }
  5621. }
  5622. },
  5623. "404": {
  5624. "description": "Not found",
  5625. "content": {
  5626. "application/json": {
  5627. "schema": {
  5628. "$ref": "#/components/schemas/NotFoundError"
  5629. }
  5630. }
  5631. }
  5632. }
  5633. },
  5634. "x-codeSamples": [
  5635. {
  5636. "lang": "js",
  5637. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.start({\n ...\n})"
  5638. }
  5639. ]
  5640. },
  5641. "delete": {
  5642. "operationId": "mcp.auth.remove",
  5643. "parameters": [
  5644. {
  5645. "in": "query",
  5646. "name": "directory",
  5647. "schema": {
  5648. "type": "string"
  5649. }
  5650. },
  5651. {
  5652. "in": "query",
  5653. "name": "workspace",
  5654. "schema": {
  5655. "type": "string"
  5656. }
  5657. },
  5658. {
  5659. "schema": {
  5660. "type": "string"
  5661. },
  5662. "in": "path",
  5663. "name": "name",
  5664. "required": true
  5665. }
  5666. ],
  5667. "summary": "Remove MCP OAuth",
  5668. "description": "Remove OAuth credentials for an MCP server",
  5669. "responses": {
  5670. "200": {
  5671. "description": "OAuth credentials removed",
  5672. "content": {
  5673. "application/json": {
  5674. "schema": {
  5675. "type": "object",
  5676. "properties": {
  5677. "success": {
  5678. "type": "boolean",
  5679. "const": true
  5680. }
  5681. },
  5682. "required": ["success"]
  5683. }
  5684. }
  5685. }
  5686. },
  5687. "404": {
  5688. "description": "Not found",
  5689. "content": {
  5690. "application/json": {
  5691. "schema": {
  5692. "$ref": "#/components/schemas/NotFoundError"
  5693. }
  5694. }
  5695. }
  5696. }
  5697. },
  5698. "x-codeSamples": [
  5699. {
  5700. "lang": "js",
  5701. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.remove({\n ...\n})"
  5702. }
  5703. ]
  5704. }
  5705. },
  5706. "/mcp/{name}/auth/callback": {
  5707. "post": {
  5708. "operationId": "mcp.auth.callback",
  5709. "parameters": [
  5710. {
  5711. "in": "query",
  5712. "name": "directory",
  5713. "schema": {
  5714. "type": "string"
  5715. }
  5716. },
  5717. {
  5718. "in": "query",
  5719. "name": "workspace",
  5720. "schema": {
  5721. "type": "string"
  5722. }
  5723. },
  5724. {
  5725. "schema": {
  5726. "type": "string"
  5727. },
  5728. "in": "path",
  5729. "name": "name",
  5730. "required": true
  5731. }
  5732. ],
  5733. "summary": "Complete MCP OAuth",
  5734. "description": "Complete OAuth authentication for a Model Context Protocol (MCP) server using the authorization code.",
  5735. "responses": {
  5736. "200": {
  5737. "description": "OAuth authentication completed",
  5738. "content": {
  5739. "application/json": {
  5740. "schema": {
  5741. "$ref": "#/components/schemas/MCPStatus"
  5742. }
  5743. }
  5744. }
  5745. },
  5746. "400": {
  5747. "description": "Bad request",
  5748. "content": {
  5749. "application/json": {
  5750. "schema": {
  5751. "$ref": "#/components/schemas/BadRequestError"
  5752. }
  5753. }
  5754. }
  5755. },
  5756. "404": {
  5757. "description": "Not found",
  5758. "content": {
  5759. "application/json": {
  5760. "schema": {
  5761. "$ref": "#/components/schemas/NotFoundError"
  5762. }
  5763. }
  5764. }
  5765. }
  5766. },
  5767. "requestBody": {
  5768. "content": {
  5769. "application/json": {
  5770. "schema": {
  5771. "type": "object",
  5772. "properties": {
  5773. "code": {
  5774. "description": "Authorization code from OAuth callback",
  5775. "type": "string"
  5776. }
  5777. },
  5778. "required": ["code"]
  5779. }
  5780. }
  5781. }
  5782. },
  5783. "x-codeSamples": [
  5784. {
  5785. "lang": "js",
  5786. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.callback({\n ...\n})"
  5787. }
  5788. ]
  5789. }
  5790. },
  5791. "/mcp/{name}/auth/authenticate": {
  5792. "post": {
  5793. "operationId": "mcp.auth.authenticate",
  5794. "parameters": [
  5795. {
  5796. "in": "query",
  5797. "name": "directory",
  5798. "schema": {
  5799. "type": "string"
  5800. }
  5801. },
  5802. {
  5803. "in": "query",
  5804. "name": "workspace",
  5805. "schema": {
  5806. "type": "string"
  5807. }
  5808. },
  5809. {
  5810. "schema": {
  5811. "type": "string"
  5812. },
  5813. "in": "path",
  5814. "name": "name",
  5815. "required": true
  5816. }
  5817. ],
  5818. "summary": "Authenticate MCP OAuth",
  5819. "description": "Start OAuth flow and wait for callback (opens browser)",
  5820. "responses": {
  5821. "200": {
  5822. "description": "OAuth authentication completed",
  5823. "content": {
  5824. "application/json": {
  5825. "schema": {
  5826. "$ref": "#/components/schemas/MCPStatus"
  5827. }
  5828. }
  5829. }
  5830. },
  5831. "400": {
  5832. "description": "Bad request",
  5833. "content": {
  5834. "application/json": {
  5835. "schema": {
  5836. "$ref": "#/components/schemas/BadRequestError"
  5837. }
  5838. }
  5839. }
  5840. },
  5841. "404": {
  5842. "description": "Not found",
  5843. "content": {
  5844. "application/json": {
  5845. "schema": {
  5846. "$ref": "#/components/schemas/NotFoundError"
  5847. }
  5848. }
  5849. }
  5850. }
  5851. },
  5852. "x-codeSamples": [
  5853. {
  5854. "lang": "js",
  5855. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.authenticate({\n ...\n})"
  5856. }
  5857. ]
  5858. }
  5859. },
  5860. "/mcp/{name}/connect": {
  5861. "post": {
  5862. "operationId": "mcp.connect",
  5863. "parameters": [
  5864. {
  5865. "in": "query",
  5866. "name": "directory",
  5867. "schema": {
  5868. "type": "string"
  5869. }
  5870. },
  5871. {
  5872. "in": "query",
  5873. "name": "workspace",
  5874. "schema": {
  5875. "type": "string"
  5876. }
  5877. },
  5878. {
  5879. "in": "path",
  5880. "name": "name",
  5881. "schema": {
  5882. "type": "string"
  5883. },
  5884. "required": true
  5885. }
  5886. ],
  5887. "description": "Connect an MCP server",
  5888. "responses": {
  5889. "200": {
  5890. "description": "MCP server connected successfully",
  5891. "content": {
  5892. "application/json": {
  5893. "schema": {
  5894. "type": "boolean"
  5895. }
  5896. }
  5897. }
  5898. }
  5899. },
  5900. "x-codeSamples": [
  5901. {
  5902. "lang": "js",
  5903. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.connect({\n ...\n})"
  5904. }
  5905. ]
  5906. }
  5907. },
  5908. "/mcp/{name}/disconnect": {
  5909. "post": {
  5910. "operationId": "mcp.disconnect",
  5911. "parameters": [
  5912. {
  5913. "in": "query",
  5914. "name": "directory",
  5915. "schema": {
  5916. "type": "string"
  5917. }
  5918. },
  5919. {
  5920. "in": "query",
  5921. "name": "workspace",
  5922. "schema": {
  5923. "type": "string"
  5924. }
  5925. },
  5926. {
  5927. "in": "path",
  5928. "name": "name",
  5929. "schema": {
  5930. "type": "string"
  5931. },
  5932. "required": true
  5933. }
  5934. ],
  5935. "description": "Disconnect an MCP server",
  5936. "responses": {
  5937. "200": {
  5938. "description": "MCP server disconnected successfully",
  5939. "content": {
  5940. "application/json": {
  5941. "schema": {
  5942. "type": "boolean"
  5943. }
  5944. }
  5945. }
  5946. }
  5947. },
  5948. "x-codeSamples": [
  5949. {
  5950. "lang": "js",
  5951. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.disconnect({\n ...\n})"
  5952. }
  5953. ]
  5954. }
  5955. },
  5956. "/tui/append-prompt": {
  5957. "post": {
  5958. "operationId": "tui.appendPrompt",
  5959. "parameters": [
  5960. {
  5961. "in": "query",
  5962. "name": "directory",
  5963. "schema": {
  5964. "type": "string"
  5965. }
  5966. },
  5967. {
  5968. "in": "query",
  5969. "name": "workspace",
  5970. "schema": {
  5971. "type": "string"
  5972. }
  5973. }
  5974. ],
  5975. "summary": "Append TUI prompt",
  5976. "description": "Append prompt to the TUI",
  5977. "responses": {
  5978. "200": {
  5979. "description": "Prompt processed successfully",
  5980. "content": {
  5981. "application/json": {
  5982. "schema": {
  5983. "type": "boolean"
  5984. }
  5985. }
  5986. }
  5987. },
  5988. "400": {
  5989. "description": "Bad request",
  5990. "content": {
  5991. "application/json": {
  5992. "schema": {
  5993. "$ref": "#/components/schemas/BadRequestError"
  5994. }
  5995. }
  5996. }
  5997. }
  5998. },
  5999. "requestBody": {
  6000. "content": {
  6001. "application/json": {
  6002. "schema": {
  6003. "type": "object",
  6004. "properties": {
  6005. "text": {
  6006. "type": "string"
  6007. }
  6008. },
  6009. "required": ["text"]
  6010. }
  6011. }
  6012. }
  6013. },
  6014. "x-codeSamples": [
  6015. {
  6016. "lang": "js",
  6017. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.appendPrompt({\n ...\n})"
  6018. }
  6019. ]
  6020. }
  6021. },
  6022. "/tui/open-help": {
  6023. "post": {
  6024. "operationId": "tui.openHelp",
  6025. "parameters": [
  6026. {
  6027. "in": "query",
  6028. "name": "directory",
  6029. "schema": {
  6030. "type": "string"
  6031. }
  6032. },
  6033. {
  6034. "in": "query",
  6035. "name": "workspace",
  6036. "schema": {
  6037. "type": "string"
  6038. }
  6039. }
  6040. ],
  6041. "summary": "Open help dialog",
  6042. "description": "Open the help dialog in the TUI to display user assistance information.",
  6043. "responses": {
  6044. "200": {
  6045. "description": "Help dialog opened successfully",
  6046. "content": {
  6047. "application/json": {
  6048. "schema": {
  6049. "type": "boolean"
  6050. }
  6051. }
  6052. }
  6053. }
  6054. },
  6055. "x-codeSamples": [
  6056. {
  6057. "lang": "js",
  6058. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openHelp({\n ...\n})"
  6059. }
  6060. ]
  6061. }
  6062. },
  6063. "/tui/open-sessions": {
  6064. "post": {
  6065. "operationId": "tui.openSessions",
  6066. "parameters": [
  6067. {
  6068. "in": "query",
  6069. "name": "directory",
  6070. "schema": {
  6071. "type": "string"
  6072. }
  6073. },
  6074. {
  6075. "in": "query",
  6076. "name": "workspace",
  6077. "schema": {
  6078. "type": "string"
  6079. }
  6080. }
  6081. ],
  6082. "summary": "Open sessions dialog",
  6083. "description": "Open the session dialog",
  6084. "responses": {
  6085. "200": {
  6086. "description": "Session dialog opened successfully",
  6087. "content": {
  6088. "application/json": {
  6089. "schema": {
  6090. "type": "boolean"
  6091. }
  6092. }
  6093. }
  6094. }
  6095. },
  6096. "x-codeSamples": [
  6097. {
  6098. "lang": "js",
  6099. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openSessions({\n ...\n})"
  6100. }
  6101. ]
  6102. }
  6103. },
  6104. "/tui/open-themes": {
  6105. "post": {
  6106. "operationId": "tui.openThemes",
  6107. "parameters": [
  6108. {
  6109. "in": "query",
  6110. "name": "directory",
  6111. "schema": {
  6112. "type": "string"
  6113. }
  6114. },
  6115. {
  6116. "in": "query",
  6117. "name": "workspace",
  6118. "schema": {
  6119. "type": "string"
  6120. }
  6121. }
  6122. ],
  6123. "summary": "Open themes dialog",
  6124. "description": "Open the theme dialog",
  6125. "responses": {
  6126. "200": {
  6127. "description": "Theme dialog opened successfully",
  6128. "content": {
  6129. "application/json": {
  6130. "schema": {
  6131. "type": "boolean"
  6132. }
  6133. }
  6134. }
  6135. }
  6136. },
  6137. "x-codeSamples": [
  6138. {
  6139. "lang": "js",
  6140. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openThemes({\n ...\n})"
  6141. }
  6142. ]
  6143. }
  6144. },
  6145. "/tui/open-models": {
  6146. "post": {
  6147. "operationId": "tui.openModels",
  6148. "parameters": [
  6149. {
  6150. "in": "query",
  6151. "name": "directory",
  6152. "schema": {
  6153. "type": "string"
  6154. }
  6155. },
  6156. {
  6157. "in": "query",
  6158. "name": "workspace",
  6159. "schema": {
  6160. "type": "string"
  6161. }
  6162. }
  6163. ],
  6164. "summary": "Open models dialog",
  6165. "description": "Open the model dialog",
  6166. "responses": {
  6167. "200": {
  6168. "description": "Model dialog opened successfully",
  6169. "content": {
  6170. "application/json": {
  6171. "schema": {
  6172. "type": "boolean"
  6173. }
  6174. }
  6175. }
  6176. }
  6177. },
  6178. "x-codeSamples": [
  6179. {
  6180. "lang": "js",
  6181. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openModels({\n ...\n})"
  6182. }
  6183. ]
  6184. }
  6185. },
  6186. "/tui/submit-prompt": {
  6187. "post": {
  6188. "operationId": "tui.submitPrompt",
  6189. "parameters": [
  6190. {
  6191. "in": "query",
  6192. "name": "directory",
  6193. "schema": {
  6194. "type": "string"
  6195. }
  6196. },
  6197. {
  6198. "in": "query",
  6199. "name": "workspace",
  6200. "schema": {
  6201. "type": "string"
  6202. }
  6203. }
  6204. ],
  6205. "summary": "Submit TUI prompt",
  6206. "description": "Submit the prompt",
  6207. "responses": {
  6208. "200": {
  6209. "description": "Prompt submitted successfully",
  6210. "content": {
  6211. "application/json": {
  6212. "schema": {
  6213. "type": "boolean"
  6214. }
  6215. }
  6216. }
  6217. }
  6218. },
  6219. "x-codeSamples": [
  6220. {
  6221. "lang": "js",
  6222. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.submitPrompt({\n ...\n})"
  6223. }
  6224. ]
  6225. }
  6226. },
  6227. "/tui/clear-prompt": {
  6228. "post": {
  6229. "operationId": "tui.clearPrompt",
  6230. "parameters": [
  6231. {
  6232. "in": "query",
  6233. "name": "directory",
  6234. "schema": {
  6235. "type": "string"
  6236. }
  6237. },
  6238. {
  6239. "in": "query",
  6240. "name": "workspace",
  6241. "schema": {
  6242. "type": "string"
  6243. }
  6244. }
  6245. ],
  6246. "summary": "Clear TUI prompt",
  6247. "description": "Clear the prompt",
  6248. "responses": {
  6249. "200": {
  6250. "description": "Prompt cleared successfully",
  6251. "content": {
  6252. "application/json": {
  6253. "schema": {
  6254. "type": "boolean"
  6255. }
  6256. }
  6257. }
  6258. }
  6259. },
  6260. "x-codeSamples": [
  6261. {
  6262. "lang": "js",
  6263. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.clearPrompt({\n ...\n})"
  6264. }
  6265. ]
  6266. }
  6267. },
  6268. "/tui/execute-command": {
  6269. "post": {
  6270. "operationId": "tui.executeCommand",
  6271. "parameters": [
  6272. {
  6273. "in": "query",
  6274. "name": "directory",
  6275. "schema": {
  6276. "type": "string"
  6277. }
  6278. },
  6279. {
  6280. "in": "query",
  6281. "name": "workspace",
  6282. "schema": {
  6283. "type": "string"
  6284. }
  6285. }
  6286. ],
  6287. "summary": "Execute TUI command",
  6288. "description": "Execute a TUI command (e.g. agent_cycle)",
  6289. "responses": {
  6290. "200": {
  6291. "description": "Command executed successfully",
  6292. "content": {
  6293. "application/json": {
  6294. "schema": {
  6295. "type": "boolean"
  6296. }
  6297. }
  6298. }
  6299. },
  6300. "400": {
  6301. "description": "Bad request",
  6302. "content": {
  6303. "application/json": {
  6304. "schema": {
  6305. "$ref": "#/components/schemas/BadRequestError"
  6306. }
  6307. }
  6308. }
  6309. }
  6310. },
  6311. "requestBody": {
  6312. "content": {
  6313. "application/json": {
  6314. "schema": {
  6315. "type": "object",
  6316. "properties": {
  6317. "command": {
  6318. "type": "string"
  6319. }
  6320. },
  6321. "required": ["command"]
  6322. }
  6323. }
  6324. }
  6325. },
  6326. "x-codeSamples": [
  6327. {
  6328. "lang": "js",
  6329. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.executeCommand({\n ...\n})"
  6330. }
  6331. ]
  6332. }
  6333. },
  6334. "/tui/show-toast": {
  6335. "post": {
  6336. "operationId": "tui.showToast",
  6337. "parameters": [
  6338. {
  6339. "in": "query",
  6340. "name": "directory",
  6341. "schema": {
  6342. "type": "string"
  6343. }
  6344. },
  6345. {
  6346. "in": "query",
  6347. "name": "workspace",
  6348. "schema": {
  6349. "type": "string"
  6350. }
  6351. }
  6352. ],
  6353. "summary": "Show TUI toast",
  6354. "description": "Show a toast notification in the TUI",
  6355. "responses": {
  6356. "200": {
  6357. "description": "Toast notification shown successfully",
  6358. "content": {
  6359. "application/json": {
  6360. "schema": {
  6361. "type": "boolean"
  6362. }
  6363. }
  6364. }
  6365. }
  6366. },
  6367. "requestBody": {
  6368. "content": {
  6369. "application/json": {
  6370. "schema": {
  6371. "type": "object",
  6372. "properties": {
  6373. "title": {
  6374. "type": "string"
  6375. },
  6376. "message": {
  6377. "type": "string"
  6378. },
  6379. "variant": {
  6380. "type": "string",
  6381. "enum": ["info", "success", "warning", "error"]
  6382. },
  6383. "duration": {
  6384. "description": "Duration in milliseconds",
  6385. "default": 5000,
  6386. "type": "number"
  6387. }
  6388. },
  6389. "required": ["message", "variant"]
  6390. }
  6391. }
  6392. }
  6393. },
  6394. "x-codeSamples": [
  6395. {
  6396. "lang": "js",
  6397. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.showToast({\n ...\n})"
  6398. }
  6399. ]
  6400. }
  6401. },
  6402. "/tui/publish": {
  6403. "post": {
  6404. "operationId": "tui.publish",
  6405. "parameters": [
  6406. {
  6407. "in": "query",
  6408. "name": "directory",
  6409. "schema": {
  6410. "type": "string"
  6411. }
  6412. },
  6413. {
  6414. "in": "query",
  6415. "name": "workspace",
  6416. "schema": {
  6417. "type": "string"
  6418. }
  6419. }
  6420. ],
  6421. "summary": "Publish TUI event",
  6422. "description": "Publish a TUI event",
  6423. "responses": {
  6424. "200": {
  6425. "description": "Event published successfully",
  6426. "content": {
  6427. "application/json": {
  6428. "schema": {
  6429. "type": "boolean"
  6430. }
  6431. }
  6432. }
  6433. },
  6434. "400": {
  6435. "description": "Bad request",
  6436. "content": {
  6437. "application/json": {
  6438. "schema": {
  6439. "$ref": "#/components/schemas/BadRequestError"
  6440. }
  6441. }
  6442. }
  6443. }
  6444. },
  6445. "requestBody": {
  6446. "content": {
  6447. "application/json": {
  6448. "schema": {
  6449. "anyOf": [
  6450. {
  6451. "$ref": "#/components/schemas/Event.tui.prompt.append"
  6452. },
  6453. {
  6454. "$ref": "#/components/schemas/Event.tui.command.execute"
  6455. },
  6456. {
  6457. "$ref": "#/components/schemas/Event.tui.toast.show"
  6458. },
  6459. {
  6460. "$ref": "#/components/schemas/Event.tui.session.select"
  6461. }
  6462. ]
  6463. }
  6464. }
  6465. }
  6466. },
  6467. "x-codeSamples": [
  6468. {
  6469. "lang": "js",
  6470. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.publish({\n ...\n})"
  6471. }
  6472. ]
  6473. }
  6474. },
  6475. "/tui/select-session": {
  6476. "post": {
  6477. "operationId": "tui.selectSession",
  6478. "parameters": [
  6479. {
  6480. "in": "query",
  6481. "name": "directory",
  6482. "schema": {
  6483. "type": "string"
  6484. }
  6485. },
  6486. {
  6487. "in": "query",
  6488. "name": "workspace",
  6489. "schema": {
  6490. "type": "string"
  6491. }
  6492. }
  6493. ],
  6494. "summary": "Select session",
  6495. "description": "Navigate the TUI to display the specified session.",
  6496. "responses": {
  6497. "200": {
  6498. "description": "Session selected successfully",
  6499. "content": {
  6500. "application/json": {
  6501. "schema": {
  6502. "type": "boolean"
  6503. }
  6504. }
  6505. }
  6506. },
  6507. "400": {
  6508. "description": "Bad request",
  6509. "content": {
  6510. "application/json": {
  6511. "schema": {
  6512. "$ref": "#/components/schemas/BadRequestError"
  6513. }
  6514. }
  6515. }
  6516. },
  6517. "404": {
  6518. "description": "Not found",
  6519. "content": {
  6520. "application/json": {
  6521. "schema": {
  6522. "$ref": "#/components/schemas/NotFoundError"
  6523. }
  6524. }
  6525. }
  6526. }
  6527. },
  6528. "requestBody": {
  6529. "content": {
  6530. "application/json": {
  6531. "schema": {
  6532. "type": "object",
  6533. "properties": {
  6534. "sessionID": {
  6535. "description": "Session ID to navigate to",
  6536. "type": "string",
  6537. "pattern": "^ses.*"
  6538. }
  6539. },
  6540. "required": ["sessionID"]
  6541. }
  6542. }
  6543. }
  6544. },
  6545. "x-codeSamples": [
  6546. {
  6547. "lang": "js",
  6548. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.selectSession({\n ...\n})"
  6549. }
  6550. ]
  6551. }
  6552. },
  6553. "/tui/control/next": {
  6554. "get": {
  6555. "operationId": "tui.control.next",
  6556. "parameters": [
  6557. {
  6558. "in": "query",
  6559. "name": "directory",
  6560. "schema": {
  6561. "type": "string"
  6562. }
  6563. },
  6564. {
  6565. "in": "query",
  6566. "name": "workspace",
  6567. "schema": {
  6568. "type": "string"
  6569. }
  6570. }
  6571. ],
  6572. "summary": "Get next TUI request",
  6573. "description": "Retrieve the next TUI (Terminal User Interface) request from the queue for processing.",
  6574. "responses": {
  6575. "200": {
  6576. "description": "Next TUI request",
  6577. "content": {
  6578. "application/json": {
  6579. "schema": {
  6580. "type": "object",
  6581. "properties": {
  6582. "path": {
  6583. "type": "string"
  6584. },
  6585. "body": {}
  6586. },
  6587. "required": ["path", "body"]
  6588. }
  6589. }
  6590. }
  6591. }
  6592. },
  6593. "x-codeSamples": [
  6594. {
  6595. "lang": "js",
  6596. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.control.next({\n ...\n})"
  6597. }
  6598. ]
  6599. }
  6600. },
  6601. "/tui/control/response": {
  6602. "post": {
  6603. "operationId": "tui.control.response",
  6604. "parameters": [
  6605. {
  6606. "in": "query",
  6607. "name": "directory",
  6608. "schema": {
  6609. "type": "string"
  6610. }
  6611. },
  6612. {
  6613. "in": "query",
  6614. "name": "workspace",
  6615. "schema": {
  6616. "type": "string"
  6617. }
  6618. }
  6619. ],
  6620. "summary": "Submit TUI response",
  6621. "description": "Submit a response to the TUI request queue to complete a pending request.",
  6622. "responses": {
  6623. "200": {
  6624. "description": "Response submitted successfully",
  6625. "content": {
  6626. "application/json": {
  6627. "schema": {
  6628. "type": "boolean"
  6629. }
  6630. }
  6631. }
  6632. }
  6633. },
  6634. "requestBody": {
  6635. "content": {
  6636. "application/json": {
  6637. "schema": {}
  6638. }
  6639. }
  6640. },
  6641. "x-codeSamples": [
  6642. {
  6643. "lang": "js",
  6644. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.control.response({\n ...\n})"
  6645. }
  6646. ]
  6647. }
  6648. },
  6649. "/instance/dispose": {
  6650. "post": {
  6651. "operationId": "instance.dispose",
  6652. "parameters": [
  6653. {
  6654. "in": "query",
  6655. "name": "directory",
  6656. "schema": {
  6657. "type": "string"
  6658. }
  6659. },
  6660. {
  6661. "in": "query",
  6662. "name": "workspace",
  6663. "schema": {
  6664. "type": "string"
  6665. }
  6666. }
  6667. ],
  6668. "summary": "Dispose instance",
  6669. "description": "Clean up and dispose the current OpenCode instance, releasing all resources.",
  6670. "responses": {
  6671. "200": {
  6672. "description": "Instance disposed",
  6673. "content": {
  6674. "application/json": {
  6675. "schema": {
  6676. "type": "boolean"
  6677. }
  6678. }
  6679. }
  6680. }
  6681. },
  6682. "x-codeSamples": [
  6683. {
  6684. "lang": "js",
  6685. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.instance.dispose({\n ...\n})"
  6686. }
  6687. ]
  6688. }
  6689. },
  6690. "/path": {
  6691. "get": {
  6692. "operationId": "path.get",
  6693. "parameters": [
  6694. {
  6695. "in": "query",
  6696. "name": "directory",
  6697. "schema": {
  6698. "type": "string"
  6699. }
  6700. },
  6701. {
  6702. "in": "query",
  6703. "name": "workspace",
  6704. "schema": {
  6705. "type": "string"
  6706. }
  6707. }
  6708. ],
  6709. "summary": "Get paths",
  6710. "description": "Retrieve the current working directory and related path information for the OpenCode instance.",
  6711. "responses": {
  6712. "200": {
  6713. "description": "Path",
  6714. "content": {
  6715. "application/json": {
  6716. "schema": {
  6717. "$ref": "#/components/schemas/Path"
  6718. }
  6719. }
  6720. }
  6721. }
  6722. },
  6723. "x-codeSamples": [
  6724. {
  6725. "lang": "js",
  6726. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.path.get({\n ...\n})"
  6727. }
  6728. ]
  6729. }
  6730. },
  6731. "/vcs": {
  6732. "get": {
  6733. "operationId": "vcs.get",
  6734. "parameters": [
  6735. {
  6736. "in": "query",
  6737. "name": "directory",
  6738. "schema": {
  6739. "type": "string"
  6740. }
  6741. },
  6742. {
  6743. "in": "query",
  6744. "name": "workspace",
  6745. "schema": {
  6746. "type": "string"
  6747. }
  6748. }
  6749. ],
  6750. "summary": "Get VCS info",
  6751. "description": "Retrieve version control system (VCS) information for the current project, such as git branch.",
  6752. "responses": {
  6753. "200": {
  6754. "description": "VCS info",
  6755. "content": {
  6756. "application/json": {
  6757. "schema": {
  6758. "$ref": "#/components/schemas/VcsInfo"
  6759. }
  6760. }
  6761. }
  6762. }
  6763. },
  6764. "x-codeSamples": [
  6765. {
  6766. "lang": "js",
  6767. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.vcs.get({\n ...\n})"
  6768. }
  6769. ]
  6770. }
  6771. },
  6772. "/command": {
  6773. "get": {
  6774. "operationId": "command.list",
  6775. "parameters": [
  6776. {
  6777. "in": "query",
  6778. "name": "directory",
  6779. "schema": {
  6780. "type": "string"
  6781. }
  6782. },
  6783. {
  6784. "in": "query",
  6785. "name": "workspace",
  6786. "schema": {
  6787. "type": "string"
  6788. }
  6789. }
  6790. ],
  6791. "summary": "List commands",
  6792. "description": "Get a list of all available commands in the OpenCode system.",
  6793. "responses": {
  6794. "200": {
  6795. "description": "List of commands",
  6796. "content": {
  6797. "application/json": {
  6798. "schema": {
  6799. "type": "array",
  6800. "items": {
  6801. "$ref": "#/components/schemas/Command"
  6802. }
  6803. }
  6804. }
  6805. }
  6806. }
  6807. },
  6808. "x-codeSamples": [
  6809. {
  6810. "lang": "js",
  6811. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.command.list({\n ...\n})"
  6812. }
  6813. ]
  6814. }
  6815. },
  6816. "/agent": {
  6817. "get": {
  6818. "operationId": "app.agents",
  6819. "parameters": [
  6820. {
  6821. "in": "query",
  6822. "name": "directory",
  6823. "schema": {
  6824. "type": "string"
  6825. }
  6826. },
  6827. {
  6828. "in": "query",
  6829. "name": "workspace",
  6830. "schema": {
  6831. "type": "string"
  6832. }
  6833. }
  6834. ],
  6835. "summary": "List agents",
  6836. "description": "Get a list of all available AI agents in the OpenCode system.",
  6837. "responses": {
  6838. "200": {
  6839. "description": "List of agents",
  6840. "content": {
  6841. "application/json": {
  6842. "schema": {
  6843. "type": "array",
  6844. "items": {
  6845. "$ref": "#/components/schemas/Agent"
  6846. }
  6847. }
  6848. }
  6849. }
  6850. }
  6851. },
  6852. "x-codeSamples": [
  6853. {
  6854. "lang": "js",
  6855. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.app.agents({\n ...\n})"
  6856. }
  6857. ]
  6858. }
  6859. },
  6860. "/skill": {
  6861. "get": {
  6862. "operationId": "app.skills",
  6863. "parameters": [
  6864. {
  6865. "in": "query",
  6866. "name": "directory",
  6867. "schema": {
  6868. "type": "string"
  6869. }
  6870. },
  6871. {
  6872. "in": "query",
  6873. "name": "workspace",
  6874. "schema": {
  6875. "type": "string"
  6876. }
  6877. }
  6878. ],
  6879. "summary": "List skills",
  6880. "description": "Get a list of all available skills in the OpenCode system.",
  6881. "responses": {
  6882. "200": {
  6883. "description": "List of skills",
  6884. "content": {
  6885. "application/json": {
  6886. "schema": {
  6887. "type": "array",
  6888. "items": {
  6889. "type": "object",
  6890. "properties": {
  6891. "name": {
  6892. "type": "string"
  6893. },
  6894. "description": {
  6895. "type": "string"
  6896. },
  6897. "location": {
  6898. "type": "string"
  6899. },
  6900. "content": {
  6901. "type": "string"
  6902. }
  6903. },
  6904. "required": ["name", "description", "location", "content"]
  6905. }
  6906. }
  6907. }
  6908. }
  6909. }
  6910. },
  6911. "x-codeSamples": [
  6912. {
  6913. "lang": "js",
  6914. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.app.skills({\n ...\n})"
  6915. }
  6916. ]
  6917. }
  6918. },
  6919. "/lsp": {
  6920. "get": {
  6921. "operationId": "lsp.status",
  6922. "parameters": [
  6923. {
  6924. "in": "query",
  6925. "name": "directory",
  6926. "schema": {
  6927. "type": "string"
  6928. }
  6929. },
  6930. {
  6931. "in": "query",
  6932. "name": "workspace",
  6933. "schema": {
  6934. "type": "string"
  6935. }
  6936. }
  6937. ],
  6938. "summary": "Get LSP status",
  6939. "description": "Get LSP server status",
  6940. "responses": {
  6941. "200": {
  6942. "description": "LSP server status",
  6943. "content": {
  6944. "application/json": {
  6945. "schema": {
  6946. "type": "array",
  6947. "items": {
  6948. "$ref": "#/components/schemas/LSPStatus"
  6949. }
  6950. }
  6951. }
  6952. }
  6953. }
  6954. },
  6955. "x-codeSamples": [
  6956. {
  6957. "lang": "js",
  6958. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.lsp.status({\n ...\n})"
  6959. }
  6960. ]
  6961. }
  6962. },
  6963. "/formatter": {
  6964. "get": {
  6965. "operationId": "formatter.status",
  6966. "parameters": [
  6967. {
  6968. "in": "query",
  6969. "name": "directory",
  6970. "schema": {
  6971. "type": "string"
  6972. }
  6973. },
  6974. {
  6975. "in": "query",
  6976. "name": "workspace",
  6977. "schema": {
  6978. "type": "string"
  6979. }
  6980. }
  6981. ],
  6982. "summary": "Get formatter status",
  6983. "description": "Get formatter status",
  6984. "responses": {
  6985. "200": {
  6986. "description": "Formatter status",
  6987. "content": {
  6988. "application/json": {
  6989. "schema": {
  6990. "type": "array",
  6991. "items": {
  6992. "$ref": "#/components/schemas/FormatterStatus"
  6993. }
  6994. }
  6995. }
  6996. }
  6997. }
  6998. },
  6999. "x-codeSamples": [
  7000. {
  7001. "lang": "js",
  7002. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.formatter.status({\n ...\n})"
  7003. }
  7004. ]
  7005. }
  7006. }
  7007. },
  7008. "components": {
  7009. "schemas": {
  7010. "Project": {
  7011. "type": "object",
  7012. "properties": {
  7013. "id": {
  7014. "type": "string"
  7015. },
  7016. "worktree": {
  7017. "type": "string"
  7018. },
  7019. "vcs": {
  7020. "type": "string",
  7021. "const": "git"
  7022. },
  7023. "name": {
  7024. "type": "string"
  7025. },
  7026. "icon": {
  7027. "type": "object",
  7028. "properties": {
  7029. "url": {
  7030. "type": "string"
  7031. },
  7032. "override": {
  7033. "type": "string"
  7034. },
  7035. "color": {
  7036. "type": "string"
  7037. }
  7038. }
  7039. },
  7040. "commands": {
  7041. "type": "object",
  7042. "properties": {
  7043. "start": {
  7044. "description": "Startup script to run when creating a new workspace (worktree)",
  7045. "type": "string"
  7046. }
  7047. }
  7048. },
  7049. "time": {
  7050. "type": "object",
  7051. "properties": {
  7052. "created": {
  7053. "type": "number"
  7054. },
  7055. "updated": {
  7056. "type": "number"
  7057. },
  7058. "initialized": {
  7059. "type": "number"
  7060. }
  7061. },
  7062. "required": ["created", "updated"]
  7063. },
  7064. "sandboxes": {
  7065. "type": "array",
  7066. "items": {
  7067. "type": "string"
  7068. }
  7069. }
  7070. },
  7071. "required": ["id", "worktree", "time", "sandboxes"]
  7072. },
  7073. "Event.project.updated": {
  7074. "type": "object",
  7075. "properties": {
  7076. "type": {
  7077. "type": "string",
  7078. "const": "project.updated"
  7079. },
  7080. "properties": {
  7081. "$ref": "#/components/schemas/Project"
  7082. }
  7083. },
  7084. "required": ["type", "properties"]
  7085. },
  7086. "Event.installation.updated": {
  7087. "type": "object",
  7088. "properties": {
  7089. "type": {
  7090. "type": "string",
  7091. "const": "installation.updated"
  7092. },
  7093. "properties": {
  7094. "type": "object",
  7095. "properties": {
  7096. "version": {
  7097. "type": "string"
  7098. }
  7099. },
  7100. "required": ["version"]
  7101. }
  7102. },
  7103. "required": ["type", "properties"]
  7104. },
  7105. "Event.installation.update-available": {
  7106. "type": "object",
  7107. "properties": {
  7108. "type": {
  7109. "type": "string",
  7110. "const": "installation.update-available"
  7111. },
  7112. "properties": {
  7113. "type": "object",
  7114. "properties": {
  7115. "version": {
  7116. "type": "string"
  7117. }
  7118. },
  7119. "required": ["version"]
  7120. }
  7121. },
  7122. "required": ["type", "properties"]
  7123. },
  7124. "Event.server.instance.disposed": {
  7125. "type": "object",
  7126. "properties": {
  7127. "type": {
  7128. "type": "string",
  7129. "const": "server.instance.disposed"
  7130. },
  7131. "properties": {
  7132. "type": "object",
  7133. "properties": {
  7134. "directory": {
  7135. "type": "string"
  7136. }
  7137. },
  7138. "required": ["directory"]
  7139. }
  7140. },
  7141. "required": ["type", "properties"]
  7142. },
  7143. "Event.server.connected": {
  7144. "type": "object",
  7145. "properties": {
  7146. "type": {
  7147. "type": "string",
  7148. "const": "server.connected"
  7149. },
  7150. "properties": {
  7151. "type": "object",
  7152. "properties": {}
  7153. }
  7154. },
  7155. "required": ["type", "properties"]
  7156. },
  7157. "Event.global.disposed": {
  7158. "type": "object",
  7159. "properties": {
  7160. "type": {
  7161. "type": "string",
  7162. "const": "global.disposed"
  7163. },
  7164. "properties": {
  7165. "type": "object",
  7166. "properties": {}
  7167. }
  7168. },
  7169. "required": ["type", "properties"]
  7170. },
  7171. "Event.lsp.client.diagnostics": {
  7172. "type": "object",
  7173. "properties": {
  7174. "type": {
  7175. "type": "string",
  7176. "const": "lsp.client.diagnostics"
  7177. },
  7178. "properties": {
  7179. "type": "object",
  7180. "properties": {
  7181. "serverID": {
  7182. "type": "string"
  7183. },
  7184. "path": {
  7185. "type": "string"
  7186. }
  7187. },
  7188. "required": ["serverID", "path"]
  7189. }
  7190. },
  7191. "required": ["type", "properties"]
  7192. },
  7193. "Event.lsp.updated": {
  7194. "type": "object",
  7195. "properties": {
  7196. "type": {
  7197. "type": "string",
  7198. "const": "lsp.updated"
  7199. },
  7200. "properties": {
  7201. "type": "object",
  7202. "properties": {}
  7203. }
  7204. },
  7205. "required": ["type", "properties"]
  7206. },
  7207. "Event.message.part.delta": {
  7208. "type": "object",
  7209. "properties": {
  7210. "type": {
  7211. "type": "string",
  7212. "const": "message.part.delta"
  7213. },
  7214. "properties": {
  7215. "type": "object",
  7216. "properties": {
  7217. "sessionID": {
  7218. "type": "string",
  7219. "pattern": "^ses.*"
  7220. },
  7221. "messageID": {
  7222. "type": "string",
  7223. "pattern": "^msg.*"
  7224. },
  7225. "partID": {
  7226. "type": "string",
  7227. "pattern": "^prt.*"
  7228. },
  7229. "field": {
  7230. "type": "string"
  7231. },
  7232. "delta": {
  7233. "type": "string"
  7234. }
  7235. },
  7236. "required": ["sessionID", "messageID", "partID", "field", "delta"]
  7237. }
  7238. },
  7239. "required": ["type", "properties"]
  7240. },
  7241. "PermissionRequest": {
  7242. "type": "object",
  7243. "properties": {
  7244. "id": {
  7245. "type": "string",
  7246. "pattern": "^per.*"
  7247. },
  7248. "sessionID": {
  7249. "type": "string",
  7250. "pattern": "^ses.*"
  7251. },
  7252. "permission": {
  7253. "type": "string"
  7254. },
  7255. "patterns": {
  7256. "type": "array",
  7257. "items": {
  7258. "type": "string"
  7259. }
  7260. },
  7261. "metadata": {
  7262. "type": "object",
  7263. "propertyNames": {
  7264. "type": "string"
  7265. },
  7266. "additionalProperties": {}
  7267. },
  7268. "always": {
  7269. "type": "array",
  7270. "items": {
  7271. "type": "string"
  7272. }
  7273. },
  7274. "tool": {
  7275. "type": "object",
  7276. "properties": {
  7277. "messageID": {
  7278. "type": "string",
  7279. "pattern": "^msg.*"
  7280. },
  7281. "callID": {
  7282. "type": "string"
  7283. }
  7284. },
  7285. "required": ["messageID", "callID"]
  7286. }
  7287. },
  7288. "required": ["id", "sessionID", "permission", "patterns", "metadata", "always"]
  7289. },
  7290. "Event.permission.asked": {
  7291. "type": "object",
  7292. "properties": {
  7293. "type": {
  7294. "type": "string",
  7295. "const": "permission.asked"
  7296. },
  7297. "properties": {
  7298. "$ref": "#/components/schemas/PermissionRequest"
  7299. }
  7300. },
  7301. "required": ["type", "properties"]
  7302. },
  7303. "Event.permission.replied": {
  7304. "type": "object",
  7305. "properties": {
  7306. "type": {
  7307. "type": "string",
  7308. "const": "permission.replied"
  7309. },
  7310. "properties": {
  7311. "type": "object",
  7312. "properties": {
  7313. "sessionID": {
  7314. "type": "string",
  7315. "pattern": "^ses.*"
  7316. },
  7317. "requestID": {
  7318. "type": "string",
  7319. "pattern": "^per.*"
  7320. },
  7321. "reply": {
  7322. "type": "string",
  7323. "enum": ["once", "always", "reject"]
  7324. }
  7325. },
  7326. "required": ["sessionID", "requestID", "reply"]
  7327. }
  7328. },
  7329. "required": ["type", "properties"]
  7330. },
  7331. "SessionStatus": {
  7332. "anyOf": [
  7333. {
  7334. "type": "object",
  7335. "properties": {
  7336. "type": {
  7337. "type": "string",
  7338. "const": "idle"
  7339. }
  7340. },
  7341. "required": ["type"]
  7342. },
  7343. {
  7344. "type": "object",
  7345. "properties": {
  7346. "type": {
  7347. "type": "string",
  7348. "const": "retry"
  7349. },
  7350. "attempt": {
  7351. "type": "number"
  7352. },
  7353. "message": {
  7354. "type": "string"
  7355. },
  7356. "next": {
  7357. "type": "number"
  7358. }
  7359. },
  7360. "required": ["type", "attempt", "message", "next"]
  7361. },
  7362. {
  7363. "type": "object",
  7364. "properties": {
  7365. "type": {
  7366. "type": "string",
  7367. "const": "busy"
  7368. }
  7369. },
  7370. "required": ["type"]
  7371. }
  7372. ]
  7373. },
  7374. "Event.session.status": {
  7375. "type": "object",
  7376. "properties": {
  7377. "type": {
  7378. "type": "string",
  7379. "const": "session.status"
  7380. },
  7381. "properties": {
  7382. "type": "object",
  7383. "properties": {
  7384. "sessionID": {
  7385. "type": "string",
  7386. "pattern": "^ses.*"
  7387. },
  7388. "status": {
  7389. "$ref": "#/components/schemas/SessionStatus"
  7390. }
  7391. },
  7392. "required": ["sessionID", "status"]
  7393. }
  7394. },
  7395. "required": ["type", "properties"]
  7396. },
  7397. "Event.session.idle": {
  7398. "type": "object",
  7399. "properties": {
  7400. "type": {
  7401. "type": "string",
  7402. "const": "session.idle"
  7403. },
  7404. "properties": {
  7405. "type": "object",
  7406. "properties": {
  7407. "sessionID": {
  7408. "type": "string",
  7409. "pattern": "^ses.*"
  7410. }
  7411. },
  7412. "required": ["sessionID"]
  7413. }
  7414. },
  7415. "required": ["type", "properties"]
  7416. },
  7417. "QuestionOption": {
  7418. "type": "object",
  7419. "properties": {
  7420. "label": {
  7421. "description": "Display text (1-5 words, concise)",
  7422. "type": "string"
  7423. },
  7424. "description": {
  7425. "description": "Explanation of choice",
  7426. "type": "string"
  7427. }
  7428. },
  7429. "required": ["label", "description"]
  7430. },
  7431. "QuestionInfo": {
  7432. "type": "object",
  7433. "properties": {
  7434. "question": {
  7435. "description": "Complete question",
  7436. "type": "string"
  7437. },
  7438. "header": {
  7439. "description": "Very short label (max 30 chars)",
  7440. "type": "string"
  7441. },
  7442. "options": {
  7443. "description": "Available choices",
  7444. "type": "array",
  7445. "items": {
  7446. "$ref": "#/components/schemas/QuestionOption"
  7447. }
  7448. },
  7449. "multiple": {
  7450. "description": "Allow selecting multiple choices",
  7451. "type": "boolean"
  7452. },
  7453. "custom": {
  7454. "description": "Allow typing a custom answer (default: true)",
  7455. "type": "boolean"
  7456. }
  7457. },
  7458. "required": ["question", "header", "options"]
  7459. },
  7460. "QuestionRequest": {
  7461. "type": "object",
  7462. "properties": {
  7463. "id": {
  7464. "type": "string",
  7465. "pattern": "^que.*"
  7466. },
  7467. "sessionID": {
  7468. "type": "string",
  7469. "pattern": "^ses.*"
  7470. },
  7471. "questions": {
  7472. "description": "Questions to ask",
  7473. "type": "array",
  7474. "items": {
  7475. "$ref": "#/components/schemas/QuestionInfo"
  7476. }
  7477. },
  7478. "tool": {
  7479. "type": "object",
  7480. "properties": {
  7481. "messageID": {
  7482. "type": "string",
  7483. "pattern": "^msg.*"
  7484. },
  7485. "callID": {
  7486. "type": "string"
  7487. }
  7488. },
  7489. "required": ["messageID", "callID"]
  7490. }
  7491. },
  7492. "required": ["id", "sessionID", "questions"]
  7493. },
  7494. "Event.question.asked": {
  7495. "type": "object",
  7496. "properties": {
  7497. "type": {
  7498. "type": "string",
  7499. "const": "question.asked"
  7500. },
  7501. "properties": {
  7502. "$ref": "#/components/schemas/QuestionRequest"
  7503. }
  7504. },
  7505. "required": ["type", "properties"]
  7506. },
  7507. "QuestionAnswer": {
  7508. "type": "array",
  7509. "items": {
  7510. "type": "string"
  7511. }
  7512. },
  7513. "Event.question.replied": {
  7514. "type": "object",
  7515. "properties": {
  7516. "type": {
  7517. "type": "string",
  7518. "const": "question.replied"
  7519. },
  7520. "properties": {
  7521. "type": "object",
  7522. "properties": {
  7523. "sessionID": {
  7524. "type": "string",
  7525. "pattern": "^ses.*"
  7526. },
  7527. "requestID": {
  7528. "type": "string",
  7529. "pattern": "^que.*"
  7530. },
  7531. "answers": {
  7532. "type": "array",
  7533. "items": {
  7534. "$ref": "#/components/schemas/QuestionAnswer"
  7535. }
  7536. }
  7537. },
  7538. "required": ["sessionID", "requestID", "answers"]
  7539. }
  7540. },
  7541. "required": ["type", "properties"]
  7542. },
  7543. "Event.question.rejected": {
  7544. "type": "object",
  7545. "properties": {
  7546. "type": {
  7547. "type": "string",
  7548. "const": "question.rejected"
  7549. },
  7550. "properties": {
  7551. "type": "object",
  7552. "properties": {
  7553. "sessionID": {
  7554. "type": "string",
  7555. "pattern": "^ses.*"
  7556. },
  7557. "requestID": {
  7558. "type": "string",
  7559. "pattern": "^que.*"
  7560. }
  7561. },
  7562. "required": ["sessionID", "requestID"]
  7563. }
  7564. },
  7565. "required": ["type", "properties"]
  7566. },
  7567. "Event.session.compacted": {
  7568. "type": "object",
  7569. "properties": {
  7570. "type": {
  7571. "type": "string",
  7572. "const": "session.compacted"
  7573. },
  7574. "properties": {
  7575. "type": "object",
  7576. "properties": {
  7577. "sessionID": {
  7578. "type": "string",
  7579. "pattern": "^ses.*"
  7580. }
  7581. },
  7582. "required": ["sessionID"]
  7583. }
  7584. },
  7585. "required": ["type", "properties"]
  7586. },
  7587. "Event.file.edited": {
  7588. "type": "object",
  7589. "properties": {
  7590. "type": {
  7591. "type": "string",
  7592. "const": "file.edited"
  7593. },
  7594. "properties": {
  7595. "type": "object",
  7596. "properties": {
  7597. "file": {
  7598. "type": "string"
  7599. }
  7600. },
  7601. "required": ["file"]
  7602. }
  7603. },
  7604. "required": ["type", "properties"]
  7605. },
  7606. "Event.file.watcher.updated": {
  7607. "type": "object",
  7608. "properties": {
  7609. "type": {
  7610. "type": "string",
  7611. "const": "file.watcher.updated"
  7612. },
  7613. "properties": {
  7614. "type": "object",
  7615. "properties": {
  7616. "file": {
  7617. "type": "string"
  7618. },
  7619. "event": {
  7620. "anyOf": [
  7621. {
  7622. "type": "string",
  7623. "const": "add"
  7624. },
  7625. {
  7626. "type": "string",
  7627. "const": "change"
  7628. },
  7629. {
  7630. "type": "string",
  7631. "const": "unlink"
  7632. }
  7633. ]
  7634. }
  7635. },
  7636. "required": ["file", "event"]
  7637. }
  7638. },
  7639. "required": ["type", "properties"]
  7640. },
  7641. "Todo": {
  7642. "type": "object",
  7643. "properties": {
  7644. "content": {
  7645. "description": "Brief description of the task",
  7646. "type": "string"
  7647. },
  7648. "status": {
  7649. "description": "Current status of the task: pending, in_progress, completed, cancelled",
  7650. "type": "string"
  7651. },
  7652. "priority": {
  7653. "description": "Priority level of the task: high, medium, low",
  7654. "type": "string"
  7655. }
  7656. },
  7657. "required": ["content", "status", "priority"]
  7658. },
  7659. "Event.todo.updated": {
  7660. "type": "object",
  7661. "properties": {
  7662. "type": {
  7663. "type": "string",
  7664. "const": "todo.updated"
  7665. },
  7666. "properties": {
  7667. "type": "object",
  7668. "properties": {
  7669. "sessionID": {
  7670. "type": "string",
  7671. "pattern": "^ses.*"
  7672. },
  7673. "todos": {
  7674. "type": "array",
  7675. "items": {
  7676. "$ref": "#/components/schemas/Todo"
  7677. }
  7678. }
  7679. },
  7680. "required": ["sessionID", "todos"]
  7681. }
  7682. },
  7683. "required": ["type", "properties"]
  7684. },
  7685. "Event.tui.prompt.append": {
  7686. "type": "object",
  7687. "properties": {
  7688. "type": {
  7689. "type": "string",
  7690. "const": "tui.prompt.append"
  7691. },
  7692. "properties": {
  7693. "type": "object",
  7694. "properties": {
  7695. "text": {
  7696. "type": "string"
  7697. }
  7698. },
  7699. "required": ["text"]
  7700. }
  7701. },
  7702. "required": ["type", "properties"]
  7703. },
  7704. "Event.tui.command.execute": {
  7705. "type": "object",
  7706. "properties": {
  7707. "type": {
  7708. "type": "string",
  7709. "const": "tui.command.execute"
  7710. },
  7711. "properties": {
  7712. "type": "object",
  7713. "properties": {
  7714. "command": {
  7715. "anyOf": [
  7716. {
  7717. "type": "string",
  7718. "enum": [
  7719. "session.list",
  7720. "session.new",
  7721. "session.share",
  7722. "session.interrupt",
  7723. "session.compact",
  7724. "session.page.up",
  7725. "session.page.down",
  7726. "session.line.up",
  7727. "session.line.down",
  7728. "session.half.page.up",
  7729. "session.half.page.down",
  7730. "session.first",
  7731. "session.last",
  7732. "prompt.clear",
  7733. "prompt.submit",
  7734. "agent.cycle"
  7735. ]
  7736. },
  7737. {
  7738. "type": "string"
  7739. }
  7740. ]
  7741. }
  7742. },
  7743. "required": ["command"]
  7744. }
  7745. },
  7746. "required": ["type", "properties"]
  7747. },
  7748. "Event.tui.toast.show": {
  7749. "type": "object",
  7750. "properties": {
  7751. "type": {
  7752. "type": "string",
  7753. "const": "tui.toast.show"
  7754. },
  7755. "properties": {
  7756. "type": "object",
  7757. "properties": {
  7758. "title": {
  7759. "type": "string"
  7760. },
  7761. "message": {
  7762. "type": "string"
  7763. },
  7764. "variant": {
  7765. "type": "string",
  7766. "enum": ["info", "success", "warning", "error"]
  7767. },
  7768. "duration": {
  7769. "description": "Duration in milliseconds",
  7770. "default": 5000,
  7771. "type": "number"
  7772. }
  7773. },
  7774. "required": ["message", "variant"]
  7775. }
  7776. },
  7777. "required": ["type", "properties"]
  7778. },
  7779. "Event.tui.session.select": {
  7780. "type": "object",
  7781. "properties": {
  7782. "type": {
  7783. "type": "string",
  7784. "const": "tui.session.select"
  7785. },
  7786. "properties": {
  7787. "type": "object",
  7788. "properties": {
  7789. "sessionID": {
  7790. "description": "Session ID to navigate to",
  7791. "type": "string",
  7792. "pattern": "^ses.*"
  7793. }
  7794. },
  7795. "required": ["sessionID"]
  7796. }
  7797. },
  7798. "required": ["type", "properties"]
  7799. },
  7800. "Event.mcp.tools.changed": {
  7801. "type": "object",
  7802. "properties": {
  7803. "type": {
  7804. "type": "string",
  7805. "const": "mcp.tools.changed"
  7806. },
  7807. "properties": {
  7808. "type": "object",
  7809. "properties": {
  7810. "server": {
  7811. "type": "string"
  7812. }
  7813. },
  7814. "required": ["server"]
  7815. }
  7816. },
  7817. "required": ["type", "properties"]
  7818. },
  7819. "Event.mcp.browser.open.failed": {
  7820. "type": "object",
  7821. "properties": {
  7822. "type": {
  7823. "type": "string",
  7824. "const": "mcp.browser.open.failed"
  7825. },
  7826. "properties": {
  7827. "type": "object",
  7828. "properties": {
  7829. "mcpName": {
  7830. "type": "string"
  7831. },
  7832. "url": {
  7833. "type": "string"
  7834. }
  7835. },
  7836. "required": ["mcpName", "url"]
  7837. }
  7838. },
  7839. "required": ["type", "properties"]
  7840. },
  7841. "Event.command.executed": {
  7842. "type": "object",
  7843. "properties": {
  7844. "type": {
  7845. "type": "string",
  7846. "const": "command.executed"
  7847. },
  7848. "properties": {
  7849. "type": "object",
  7850. "properties": {
  7851. "name": {
  7852. "type": "string"
  7853. },
  7854. "sessionID": {
  7855. "type": "string",
  7856. "pattern": "^ses.*"
  7857. },
  7858. "arguments": {
  7859. "type": "string"
  7860. },
  7861. "messageID": {
  7862. "type": "string",
  7863. "pattern": "^msg.*"
  7864. }
  7865. },
  7866. "required": ["name", "sessionID", "arguments", "messageID"]
  7867. }
  7868. },
  7869. "required": ["type", "properties"]
  7870. },
  7871. "FileDiff": {
  7872. "type": "object",
  7873. "properties": {
  7874. "file": {
  7875. "type": "string"
  7876. },
  7877. "before": {
  7878. "type": "string"
  7879. },
  7880. "after": {
  7881. "type": "string"
  7882. },
  7883. "additions": {
  7884. "type": "number"
  7885. },
  7886. "deletions": {
  7887. "type": "number"
  7888. },
  7889. "status": {
  7890. "type": "string",
  7891. "enum": ["added", "deleted", "modified"]
  7892. }
  7893. },
  7894. "required": ["file", "before", "after", "additions", "deletions"]
  7895. },
  7896. "Event.session.diff": {
  7897. "type": "object",
  7898. "properties": {
  7899. "type": {
  7900. "type": "string",
  7901. "const": "session.diff"
  7902. },
  7903. "properties": {
  7904. "type": "object",
  7905. "properties": {
  7906. "sessionID": {
  7907. "type": "string",
  7908. "pattern": "^ses.*"
  7909. },
  7910. "diff": {
  7911. "type": "array",
  7912. "items": {
  7913. "$ref": "#/components/schemas/FileDiff"
  7914. }
  7915. }
  7916. },
  7917. "required": ["sessionID", "diff"]
  7918. }
  7919. },
  7920. "required": ["type", "properties"]
  7921. },
  7922. "ProviderAuthError": {
  7923. "type": "object",
  7924. "properties": {
  7925. "name": {
  7926. "type": "string",
  7927. "const": "ProviderAuthError"
  7928. },
  7929. "data": {
  7930. "type": "object",
  7931. "properties": {
  7932. "providerID": {
  7933. "type": "string"
  7934. },
  7935. "message": {
  7936. "type": "string"
  7937. }
  7938. },
  7939. "required": ["providerID", "message"]
  7940. }
  7941. },
  7942. "required": ["name", "data"]
  7943. },
  7944. "UnknownError": {
  7945. "type": "object",
  7946. "properties": {
  7947. "name": {
  7948. "type": "string",
  7949. "const": "UnknownError"
  7950. },
  7951. "data": {
  7952. "type": "object",
  7953. "properties": {
  7954. "message": {
  7955. "type": "string"
  7956. }
  7957. },
  7958. "required": ["message"]
  7959. }
  7960. },
  7961. "required": ["name", "data"]
  7962. },
  7963. "MessageOutputLengthError": {
  7964. "type": "object",
  7965. "properties": {
  7966. "name": {
  7967. "type": "string",
  7968. "const": "MessageOutputLengthError"
  7969. },
  7970. "data": {
  7971. "type": "object",
  7972. "properties": {}
  7973. }
  7974. },
  7975. "required": ["name", "data"]
  7976. },
  7977. "MessageAbortedError": {
  7978. "type": "object",
  7979. "properties": {
  7980. "name": {
  7981. "type": "string",
  7982. "const": "MessageAbortedError"
  7983. },
  7984. "data": {
  7985. "type": "object",
  7986. "properties": {
  7987. "message": {
  7988. "type": "string"
  7989. }
  7990. },
  7991. "required": ["message"]
  7992. }
  7993. },
  7994. "required": ["name", "data"]
  7995. },
  7996. "StructuredOutputError": {
  7997. "type": "object",
  7998. "properties": {
  7999. "name": {
  8000. "type": "string",
  8001. "const": "StructuredOutputError"
  8002. },
  8003. "data": {
  8004. "type": "object",
  8005. "properties": {
  8006. "message": {
  8007. "type": "string"
  8008. },
  8009. "retries": {
  8010. "type": "number"
  8011. }
  8012. },
  8013. "required": ["message", "retries"]
  8014. }
  8015. },
  8016. "required": ["name", "data"]
  8017. },
  8018. "ContextOverflowError": {
  8019. "type": "object",
  8020. "properties": {
  8021. "name": {
  8022. "type": "string",
  8023. "const": "ContextOverflowError"
  8024. },
  8025. "data": {
  8026. "type": "object",
  8027. "properties": {
  8028. "message": {
  8029. "type": "string"
  8030. },
  8031. "responseBody": {
  8032. "type": "string"
  8033. }
  8034. },
  8035. "required": ["message"]
  8036. }
  8037. },
  8038. "required": ["name", "data"]
  8039. },
  8040. "APIError": {
  8041. "type": "object",
  8042. "properties": {
  8043. "name": {
  8044. "type": "string",
  8045. "const": "APIError"
  8046. },
  8047. "data": {
  8048. "type": "object",
  8049. "properties": {
  8050. "message": {
  8051. "type": "string"
  8052. },
  8053. "statusCode": {
  8054. "type": "number"
  8055. },
  8056. "isRetryable": {
  8057. "type": "boolean"
  8058. },
  8059. "responseHeaders": {
  8060. "type": "object",
  8061. "propertyNames": {
  8062. "type": "string"
  8063. },
  8064. "additionalProperties": {
  8065. "type": "string"
  8066. }
  8067. },
  8068. "responseBody": {
  8069. "type": "string"
  8070. },
  8071. "metadata": {
  8072. "type": "object",
  8073. "propertyNames": {
  8074. "type": "string"
  8075. },
  8076. "additionalProperties": {
  8077. "type": "string"
  8078. }
  8079. }
  8080. },
  8081. "required": ["message", "isRetryable"]
  8082. }
  8083. },
  8084. "required": ["name", "data"]
  8085. },
  8086. "Event.session.error": {
  8087. "type": "object",
  8088. "properties": {
  8089. "type": {
  8090. "type": "string",
  8091. "const": "session.error"
  8092. },
  8093. "properties": {
  8094. "type": "object",
  8095. "properties": {
  8096. "sessionID": {
  8097. "type": "string",
  8098. "pattern": "^ses.*"
  8099. },
  8100. "error": {
  8101. "anyOf": [
  8102. {
  8103. "$ref": "#/components/schemas/ProviderAuthError"
  8104. },
  8105. {
  8106. "$ref": "#/components/schemas/UnknownError"
  8107. },
  8108. {
  8109. "$ref": "#/components/schemas/MessageOutputLengthError"
  8110. },
  8111. {
  8112. "$ref": "#/components/schemas/MessageAbortedError"
  8113. },
  8114. {
  8115. "$ref": "#/components/schemas/StructuredOutputError"
  8116. },
  8117. {
  8118. "$ref": "#/components/schemas/ContextOverflowError"
  8119. },
  8120. {
  8121. "$ref": "#/components/schemas/APIError"
  8122. }
  8123. ]
  8124. }
  8125. }
  8126. }
  8127. },
  8128. "required": ["type", "properties"]
  8129. },
  8130. "Event.vcs.branch.updated": {
  8131. "type": "object",
  8132. "properties": {
  8133. "type": {
  8134. "type": "string",
  8135. "const": "vcs.branch.updated"
  8136. },
  8137. "properties": {
  8138. "type": "object",
  8139. "properties": {
  8140. "branch": {
  8141. "type": "string"
  8142. }
  8143. }
  8144. }
  8145. },
  8146. "required": ["type", "properties"]
  8147. },
  8148. "Event.workspace.ready": {
  8149. "type": "object",
  8150. "properties": {
  8151. "type": {
  8152. "type": "string",
  8153. "const": "workspace.ready"
  8154. },
  8155. "properties": {
  8156. "type": "object",
  8157. "properties": {
  8158. "name": {
  8159. "type": "string"
  8160. }
  8161. },
  8162. "required": ["name"]
  8163. }
  8164. },
  8165. "required": ["type", "properties"]
  8166. },
  8167. "Event.workspace.failed": {
  8168. "type": "object",
  8169. "properties": {
  8170. "type": {
  8171. "type": "string",
  8172. "const": "workspace.failed"
  8173. },
  8174. "properties": {
  8175. "type": "object",
  8176. "properties": {
  8177. "message": {
  8178. "type": "string"
  8179. }
  8180. },
  8181. "required": ["message"]
  8182. }
  8183. },
  8184. "required": ["type", "properties"]
  8185. },
  8186. "Pty": {
  8187. "type": "object",
  8188. "properties": {
  8189. "id": {
  8190. "type": "string",
  8191. "pattern": "^pty.*"
  8192. },
  8193. "title": {
  8194. "type": "string"
  8195. },
  8196. "command": {
  8197. "type": "string"
  8198. },
  8199. "args": {
  8200. "type": "array",
  8201. "items": {
  8202. "type": "string"
  8203. }
  8204. },
  8205. "cwd": {
  8206. "type": "string"
  8207. },
  8208. "status": {
  8209. "type": "string",
  8210. "enum": ["running", "exited"]
  8211. },
  8212. "pid": {
  8213. "type": "number"
  8214. }
  8215. },
  8216. "required": ["id", "title", "command", "args", "cwd", "status", "pid"]
  8217. },
  8218. "Event.pty.created": {
  8219. "type": "object",
  8220. "properties": {
  8221. "type": {
  8222. "type": "string",
  8223. "const": "pty.created"
  8224. },
  8225. "properties": {
  8226. "type": "object",
  8227. "properties": {
  8228. "info": {
  8229. "$ref": "#/components/schemas/Pty"
  8230. }
  8231. },
  8232. "required": ["info"]
  8233. }
  8234. },
  8235. "required": ["type", "properties"]
  8236. },
  8237. "Event.pty.updated": {
  8238. "type": "object",
  8239. "properties": {
  8240. "type": {
  8241. "type": "string",
  8242. "const": "pty.updated"
  8243. },
  8244. "properties": {
  8245. "type": "object",
  8246. "properties": {
  8247. "info": {
  8248. "$ref": "#/components/schemas/Pty"
  8249. }
  8250. },
  8251. "required": ["info"]
  8252. }
  8253. },
  8254. "required": ["type", "properties"]
  8255. },
  8256. "Event.pty.exited": {
  8257. "type": "object",
  8258. "properties": {
  8259. "type": {
  8260. "type": "string",
  8261. "const": "pty.exited"
  8262. },
  8263. "properties": {
  8264. "type": "object",
  8265. "properties": {
  8266. "id": {
  8267. "type": "string",
  8268. "pattern": "^pty.*"
  8269. },
  8270. "exitCode": {
  8271. "type": "number"
  8272. }
  8273. },
  8274. "required": ["id", "exitCode"]
  8275. }
  8276. },
  8277. "required": ["type", "properties"]
  8278. },
  8279. "Event.pty.deleted": {
  8280. "type": "object",
  8281. "properties": {
  8282. "type": {
  8283. "type": "string",
  8284. "const": "pty.deleted"
  8285. },
  8286. "properties": {
  8287. "type": "object",
  8288. "properties": {
  8289. "id": {
  8290. "type": "string",
  8291. "pattern": "^pty.*"
  8292. }
  8293. },
  8294. "required": ["id"]
  8295. }
  8296. },
  8297. "required": ["type", "properties"]
  8298. },
  8299. "Event.worktree.ready": {
  8300. "type": "object",
  8301. "properties": {
  8302. "type": {
  8303. "type": "string",
  8304. "const": "worktree.ready"
  8305. },
  8306. "properties": {
  8307. "type": "object",
  8308. "properties": {
  8309. "name": {
  8310. "type": "string"
  8311. },
  8312. "branch": {
  8313. "type": "string"
  8314. }
  8315. },
  8316. "required": ["name", "branch"]
  8317. }
  8318. },
  8319. "required": ["type", "properties"]
  8320. },
  8321. "Event.worktree.failed": {
  8322. "type": "object",
  8323. "properties": {
  8324. "type": {
  8325. "type": "string",
  8326. "const": "worktree.failed"
  8327. },
  8328. "properties": {
  8329. "type": "object",
  8330. "properties": {
  8331. "message": {
  8332. "type": "string"
  8333. }
  8334. },
  8335. "required": ["message"]
  8336. }
  8337. },
  8338. "required": ["type", "properties"]
  8339. },
  8340. "OutputFormatText": {
  8341. "type": "object",
  8342. "properties": {
  8343. "type": {
  8344. "type": "string",
  8345. "const": "text"
  8346. }
  8347. },
  8348. "required": ["type"]
  8349. },
  8350. "JSONSchema": {
  8351. "type": "object",
  8352. "propertyNames": {
  8353. "type": "string"
  8354. },
  8355. "additionalProperties": {}
  8356. },
  8357. "OutputFormatJsonSchema": {
  8358. "type": "object",
  8359. "properties": {
  8360. "type": {
  8361. "type": "string",
  8362. "const": "json_schema"
  8363. },
  8364. "schema": {
  8365. "$ref": "#/components/schemas/JSONSchema"
  8366. },
  8367. "retryCount": {
  8368. "default": 2,
  8369. "type": "integer",
  8370. "minimum": 0,
  8371. "maximum": 9007199254740991
  8372. }
  8373. },
  8374. "required": ["type", "schema"]
  8375. },
  8376. "OutputFormat": {
  8377. "anyOf": [
  8378. {
  8379. "$ref": "#/components/schemas/OutputFormatText"
  8380. },
  8381. {
  8382. "$ref": "#/components/schemas/OutputFormatJsonSchema"
  8383. }
  8384. ]
  8385. },
  8386. "UserMessage": {
  8387. "type": "object",
  8388. "properties": {
  8389. "id": {
  8390. "type": "string",
  8391. "pattern": "^msg.*"
  8392. },
  8393. "sessionID": {
  8394. "type": "string",
  8395. "pattern": "^ses.*"
  8396. },
  8397. "role": {
  8398. "type": "string",
  8399. "const": "user"
  8400. },
  8401. "time": {
  8402. "type": "object",
  8403. "properties": {
  8404. "created": {
  8405. "type": "number"
  8406. }
  8407. },
  8408. "required": ["created"]
  8409. },
  8410. "format": {
  8411. "$ref": "#/components/schemas/OutputFormat"
  8412. },
  8413. "summary": {
  8414. "type": "object",
  8415. "properties": {
  8416. "title": {
  8417. "type": "string"
  8418. },
  8419. "body": {
  8420. "type": "string"
  8421. },
  8422. "diffs": {
  8423. "type": "array",
  8424. "items": {
  8425. "$ref": "#/components/schemas/FileDiff"
  8426. }
  8427. }
  8428. },
  8429. "required": ["diffs"]
  8430. },
  8431. "agent": {
  8432. "type": "string"
  8433. },
  8434. "model": {
  8435. "type": "object",
  8436. "properties": {
  8437. "providerID": {
  8438. "type": "string"
  8439. },
  8440. "modelID": {
  8441. "type": "string"
  8442. }
  8443. },
  8444. "required": ["providerID", "modelID"]
  8445. },
  8446. "system": {
  8447. "type": "string"
  8448. },
  8449. "tools": {
  8450. "type": "object",
  8451. "propertyNames": {
  8452. "type": "string"
  8453. },
  8454. "additionalProperties": {
  8455. "type": "boolean"
  8456. }
  8457. },
  8458. "variant": {
  8459. "type": "string"
  8460. }
  8461. },
  8462. "required": ["id", "sessionID", "role", "time", "agent", "model"]
  8463. },
  8464. "AssistantMessage": {
  8465. "type": "object",
  8466. "properties": {
  8467. "id": {
  8468. "type": "string",
  8469. "pattern": "^msg.*"
  8470. },
  8471. "sessionID": {
  8472. "type": "string",
  8473. "pattern": "^ses.*"
  8474. },
  8475. "role": {
  8476. "type": "string",
  8477. "const": "assistant"
  8478. },
  8479. "time": {
  8480. "type": "object",
  8481. "properties": {
  8482. "created": {
  8483. "type": "number"
  8484. },
  8485. "completed": {
  8486. "type": "number"
  8487. }
  8488. },
  8489. "required": ["created"]
  8490. },
  8491. "error": {
  8492. "anyOf": [
  8493. {
  8494. "$ref": "#/components/schemas/ProviderAuthError"
  8495. },
  8496. {
  8497. "$ref": "#/components/schemas/UnknownError"
  8498. },
  8499. {
  8500. "$ref": "#/components/schemas/MessageOutputLengthError"
  8501. },
  8502. {
  8503. "$ref": "#/components/schemas/MessageAbortedError"
  8504. },
  8505. {
  8506. "$ref": "#/components/schemas/StructuredOutputError"
  8507. },
  8508. {
  8509. "$ref": "#/components/schemas/ContextOverflowError"
  8510. },
  8511. {
  8512. "$ref": "#/components/schemas/APIError"
  8513. }
  8514. ]
  8515. },
  8516. "parentID": {
  8517. "type": "string",
  8518. "pattern": "^msg.*"
  8519. },
  8520. "modelID": {
  8521. "type": "string"
  8522. },
  8523. "providerID": {
  8524. "type": "string"
  8525. },
  8526. "mode": {
  8527. "type": "string"
  8528. },
  8529. "agent": {
  8530. "type": "string"
  8531. },
  8532. "path": {
  8533. "type": "object",
  8534. "properties": {
  8535. "cwd": {
  8536. "type": "string"
  8537. },
  8538. "root": {
  8539. "type": "string"
  8540. }
  8541. },
  8542. "required": ["cwd", "root"]
  8543. },
  8544. "summary": {
  8545. "type": "boolean"
  8546. },
  8547. "cost": {
  8548. "type": "number"
  8549. },
  8550. "tokens": {
  8551. "type": "object",
  8552. "properties": {
  8553. "total": {
  8554. "type": "number"
  8555. },
  8556. "input": {
  8557. "type": "number"
  8558. },
  8559. "output": {
  8560. "type": "number"
  8561. },
  8562. "reasoning": {
  8563. "type": "number"
  8564. },
  8565. "cache": {
  8566. "type": "object",
  8567. "properties": {
  8568. "read": {
  8569. "type": "number"
  8570. },
  8571. "write": {
  8572. "type": "number"
  8573. }
  8574. },
  8575. "required": ["read", "write"]
  8576. }
  8577. },
  8578. "required": ["input", "output", "reasoning", "cache"]
  8579. },
  8580. "structured": {},
  8581. "variant": {
  8582. "type": "string"
  8583. },
  8584. "finish": {
  8585. "type": "string"
  8586. }
  8587. },
  8588. "required": [
  8589. "id",
  8590. "sessionID",
  8591. "role",
  8592. "time",
  8593. "parentID",
  8594. "modelID",
  8595. "providerID",
  8596. "mode",
  8597. "agent",
  8598. "path",
  8599. "cost",
  8600. "tokens"
  8601. ]
  8602. },
  8603. "Message": {
  8604. "anyOf": [
  8605. {
  8606. "$ref": "#/components/schemas/UserMessage"
  8607. },
  8608. {
  8609. "$ref": "#/components/schemas/AssistantMessage"
  8610. }
  8611. ]
  8612. },
  8613. "Event.message.updated": {
  8614. "type": "object",
  8615. "properties": {
  8616. "type": {
  8617. "type": "string",
  8618. "const": "message.updated"
  8619. },
  8620. "properties": {
  8621. "type": "object",
  8622. "properties": {
  8623. "sessionID": {
  8624. "type": "string",
  8625. "pattern": "^ses.*"
  8626. },
  8627. "info": {
  8628. "$ref": "#/components/schemas/Message"
  8629. }
  8630. },
  8631. "required": ["sessionID", "info"]
  8632. }
  8633. },
  8634. "required": ["type", "properties"]
  8635. },
  8636. "Event.message.removed": {
  8637. "type": "object",
  8638. "properties": {
  8639. "type": {
  8640. "type": "string",
  8641. "const": "message.removed"
  8642. },
  8643. "properties": {
  8644. "type": "object",
  8645. "properties": {
  8646. "sessionID": {
  8647. "type": "string",
  8648. "pattern": "^ses.*"
  8649. },
  8650. "messageID": {
  8651. "type": "string",
  8652. "pattern": "^msg.*"
  8653. }
  8654. },
  8655. "required": ["sessionID", "messageID"]
  8656. }
  8657. },
  8658. "required": ["type", "properties"]
  8659. },
  8660. "TextPart": {
  8661. "type": "object",
  8662. "properties": {
  8663. "id": {
  8664. "type": "string",
  8665. "pattern": "^prt.*"
  8666. },
  8667. "sessionID": {
  8668. "type": "string",
  8669. "pattern": "^ses.*"
  8670. },
  8671. "messageID": {
  8672. "type": "string",
  8673. "pattern": "^msg.*"
  8674. },
  8675. "type": {
  8676. "type": "string",
  8677. "const": "text"
  8678. },
  8679. "text": {
  8680. "type": "string"
  8681. },
  8682. "synthetic": {
  8683. "type": "boolean"
  8684. },
  8685. "ignored": {
  8686. "type": "boolean"
  8687. },
  8688. "time": {
  8689. "type": "object",
  8690. "properties": {
  8691. "start": {
  8692. "type": "number"
  8693. },
  8694. "end": {
  8695. "type": "number"
  8696. }
  8697. },
  8698. "required": ["start"]
  8699. },
  8700. "metadata": {
  8701. "type": "object",
  8702. "propertyNames": {
  8703. "type": "string"
  8704. },
  8705. "additionalProperties": {}
  8706. }
  8707. },
  8708. "required": ["id", "sessionID", "messageID", "type", "text"]
  8709. },
  8710. "SubtaskPart": {
  8711. "type": "object",
  8712. "properties": {
  8713. "id": {
  8714. "type": "string",
  8715. "pattern": "^prt.*"
  8716. },
  8717. "sessionID": {
  8718. "type": "string",
  8719. "pattern": "^ses.*"
  8720. },
  8721. "messageID": {
  8722. "type": "string",
  8723. "pattern": "^msg.*"
  8724. },
  8725. "type": {
  8726. "type": "string",
  8727. "const": "subtask"
  8728. },
  8729. "prompt": {
  8730. "type": "string"
  8731. },
  8732. "description": {
  8733. "type": "string"
  8734. },
  8735. "agent": {
  8736. "type": "string"
  8737. },
  8738. "model": {
  8739. "type": "object",
  8740. "properties": {
  8741. "providerID": {
  8742. "type": "string"
  8743. },
  8744. "modelID": {
  8745. "type": "string"
  8746. }
  8747. },
  8748. "required": ["providerID", "modelID"]
  8749. },
  8750. "command": {
  8751. "type": "string"
  8752. }
  8753. },
  8754. "required": ["id", "sessionID", "messageID", "type", "prompt", "description", "agent"]
  8755. },
  8756. "ReasoningPart": {
  8757. "type": "object",
  8758. "properties": {
  8759. "id": {
  8760. "type": "string",
  8761. "pattern": "^prt.*"
  8762. },
  8763. "sessionID": {
  8764. "type": "string",
  8765. "pattern": "^ses.*"
  8766. },
  8767. "messageID": {
  8768. "type": "string",
  8769. "pattern": "^msg.*"
  8770. },
  8771. "type": {
  8772. "type": "string",
  8773. "const": "reasoning"
  8774. },
  8775. "text": {
  8776. "type": "string"
  8777. },
  8778. "metadata": {
  8779. "type": "object",
  8780. "propertyNames": {
  8781. "type": "string"
  8782. },
  8783. "additionalProperties": {}
  8784. },
  8785. "time": {
  8786. "type": "object",
  8787. "properties": {
  8788. "start": {
  8789. "type": "number"
  8790. },
  8791. "end": {
  8792. "type": "number"
  8793. }
  8794. },
  8795. "required": ["start"]
  8796. }
  8797. },
  8798. "required": ["id", "sessionID", "messageID", "type", "text", "time"]
  8799. },
  8800. "FilePartSourceText": {
  8801. "type": "object",
  8802. "properties": {
  8803. "value": {
  8804. "type": "string"
  8805. },
  8806. "start": {
  8807. "type": "integer",
  8808. "minimum": -9007199254740991,
  8809. "maximum": 9007199254740991
  8810. },
  8811. "end": {
  8812. "type": "integer",
  8813. "minimum": -9007199254740991,
  8814. "maximum": 9007199254740991
  8815. }
  8816. },
  8817. "required": ["value", "start", "end"]
  8818. },
  8819. "FileSource": {
  8820. "type": "object",
  8821. "properties": {
  8822. "text": {
  8823. "$ref": "#/components/schemas/FilePartSourceText"
  8824. },
  8825. "type": {
  8826. "type": "string",
  8827. "const": "file"
  8828. },
  8829. "path": {
  8830. "type": "string"
  8831. }
  8832. },
  8833. "required": ["text", "type", "path"]
  8834. },
  8835. "Range": {
  8836. "type": "object",
  8837. "properties": {
  8838. "start": {
  8839. "type": "object",
  8840. "properties": {
  8841. "line": {
  8842. "type": "number"
  8843. },
  8844. "character": {
  8845. "type": "number"
  8846. }
  8847. },
  8848. "required": ["line", "character"]
  8849. },
  8850. "end": {
  8851. "type": "object",
  8852. "properties": {
  8853. "line": {
  8854. "type": "number"
  8855. },
  8856. "character": {
  8857. "type": "number"
  8858. }
  8859. },
  8860. "required": ["line", "character"]
  8861. }
  8862. },
  8863. "required": ["start", "end"]
  8864. },
  8865. "SymbolSource": {
  8866. "type": "object",
  8867. "properties": {
  8868. "text": {
  8869. "$ref": "#/components/schemas/FilePartSourceText"
  8870. },
  8871. "type": {
  8872. "type": "string",
  8873. "const": "symbol"
  8874. },
  8875. "path": {
  8876. "type": "string"
  8877. },
  8878. "range": {
  8879. "$ref": "#/components/schemas/Range"
  8880. },
  8881. "name": {
  8882. "type": "string"
  8883. },
  8884. "kind": {
  8885. "type": "integer",
  8886. "minimum": -9007199254740991,
  8887. "maximum": 9007199254740991
  8888. }
  8889. },
  8890. "required": ["text", "type", "path", "range", "name", "kind"]
  8891. },
  8892. "ResourceSource": {
  8893. "type": "object",
  8894. "properties": {
  8895. "text": {
  8896. "$ref": "#/components/schemas/FilePartSourceText"
  8897. },
  8898. "type": {
  8899. "type": "string",
  8900. "const": "resource"
  8901. },
  8902. "clientName": {
  8903. "type": "string"
  8904. },
  8905. "uri": {
  8906. "type": "string"
  8907. }
  8908. },
  8909. "required": ["text", "type", "clientName", "uri"]
  8910. },
  8911. "FilePartSource": {
  8912. "anyOf": [
  8913. {
  8914. "$ref": "#/components/schemas/FileSource"
  8915. },
  8916. {
  8917. "$ref": "#/components/schemas/SymbolSource"
  8918. },
  8919. {
  8920. "$ref": "#/components/schemas/ResourceSource"
  8921. }
  8922. ]
  8923. },
  8924. "FilePart": {
  8925. "type": "object",
  8926. "properties": {
  8927. "id": {
  8928. "type": "string",
  8929. "pattern": "^prt.*"
  8930. },
  8931. "sessionID": {
  8932. "type": "string",
  8933. "pattern": "^ses.*"
  8934. },
  8935. "messageID": {
  8936. "type": "string",
  8937. "pattern": "^msg.*"
  8938. },
  8939. "type": {
  8940. "type": "string",
  8941. "const": "file"
  8942. },
  8943. "mime": {
  8944. "type": "string"
  8945. },
  8946. "filename": {
  8947. "type": "string"
  8948. },
  8949. "url": {
  8950. "type": "string"
  8951. },
  8952. "source": {
  8953. "$ref": "#/components/schemas/FilePartSource"
  8954. }
  8955. },
  8956. "required": ["id", "sessionID", "messageID", "type", "mime", "url"]
  8957. },
  8958. "ToolStatePending": {
  8959. "type": "object",
  8960. "properties": {
  8961. "status": {
  8962. "type": "string",
  8963. "const": "pending"
  8964. },
  8965. "input": {
  8966. "type": "object",
  8967. "propertyNames": {
  8968. "type": "string"
  8969. },
  8970. "additionalProperties": {}
  8971. },
  8972. "raw": {
  8973. "type": "string"
  8974. }
  8975. },
  8976. "required": ["status", "input", "raw"]
  8977. },
  8978. "ToolStateRunning": {
  8979. "type": "object",
  8980. "properties": {
  8981. "status": {
  8982. "type": "string",
  8983. "const": "running"
  8984. },
  8985. "input": {
  8986. "type": "object",
  8987. "propertyNames": {
  8988. "type": "string"
  8989. },
  8990. "additionalProperties": {}
  8991. },
  8992. "title": {
  8993. "type": "string"
  8994. },
  8995. "metadata": {
  8996. "type": "object",
  8997. "propertyNames": {
  8998. "type": "string"
  8999. },
  9000. "additionalProperties": {}
  9001. },
  9002. "time": {
  9003. "type": "object",
  9004. "properties": {
  9005. "start": {
  9006. "type": "number"
  9007. }
  9008. },
  9009. "required": ["start"]
  9010. }
  9011. },
  9012. "required": ["status", "input", "time"]
  9013. },
  9014. "ToolStateCompleted": {
  9015. "type": "object",
  9016. "properties": {
  9017. "status": {
  9018. "type": "string",
  9019. "const": "completed"
  9020. },
  9021. "input": {
  9022. "type": "object",
  9023. "propertyNames": {
  9024. "type": "string"
  9025. },
  9026. "additionalProperties": {}
  9027. },
  9028. "output": {
  9029. "type": "string"
  9030. },
  9031. "title": {
  9032. "type": "string"
  9033. },
  9034. "metadata": {
  9035. "type": "object",
  9036. "propertyNames": {
  9037. "type": "string"
  9038. },
  9039. "additionalProperties": {}
  9040. },
  9041. "time": {
  9042. "type": "object",
  9043. "properties": {
  9044. "start": {
  9045. "type": "number"
  9046. },
  9047. "end": {
  9048. "type": "number"
  9049. },
  9050. "compacted": {
  9051. "type": "number"
  9052. }
  9053. },
  9054. "required": ["start", "end"]
  9055. },
  9056. "attachments": {
  9057. "type": "array",
  9058. "items": {
  9059. "$ref": "#/components/schemas/FilePart"
  9060. }
  9061. }
  9062. },
  9063. "required": ["status", "input", "output", "title", "metadata", "time"]
  9064. },
  9065. "ToolStateError": {
  9066. "type": "object",
  9067. "properties": {
  9068. "status": {
  9069. "type": "string",
  9070. "const": "error"
  9071. },
  9072. "input": {
  9073. "type": "object",
  9074. "propertyNames": {
  9075. "type": "string"
  9076. },
  9077. "additionalProperties": {}
  9078. },
  9079. "error": {
  9080. "type": "string"
  9081. },
  9082. "metadata": {
  9083. "type": "object",
  9084. "propertyNames": {
  9085. "type": "string"
  9086. },
  9087. "additionalProperties": {}
  9088. },
  9089. "time": {
  9090. "type": "object",
  9091. "properties": {
  9092. "start": {
  9093. "type": "number"
  9094. },
  9095. "end": {
  9096. "type": "number"
  9097. }
  9098. },
  9099. "required": ["start", "end"]
  9100. }
  9101. },
  9102. "required": ["status", "input", "error", "time"]
  9103. },
  9104. "ToolState": {
  9105. "anyOf": [
  9106. {
  9107. "$ref": "#/components/schemas/ToolStatePending"
  9108. },
  9109. {
  9110. "$ref": "#/components/schemas/ToolStateRunning"
  9111. },
  9112. {
  9113. "$ref": "#/components/schemas/ToolStateCompleted"
  9114. },
  9115. {
  9116. "$ref": "#/components/schemas/ToolStateError"
  9117. }
  9118. ]
  9119. },
  9120. "ToolPart": {
  9121. "type": "object",
  9122. "properties": {
  9123. "id": {
  9124. "type": "string",
  9125. "pattern": "^prt.*"
  9126. },
  9127. "sessionID": {
  9128. "type": "string",
  9129. "pattern": "^ses.*"
  9130. },
  9131. "messageID": {
  9132. "type": "string",
  9133. "pattern": "^msg.*"
  9134. },
  9135. "type": {
  9136. "type": "string",
  9137. "const": "tool"
  9138. },
  9139. "callID": {
  9140. "type": "string"
  9141. },
  9142. "tool": {
  9143. "type": "string"
  9144. },
  9145. "state": {
  9146. "$ref": "#/components/schemas/ToolState"
  9147. },
  9148. "metadata": {
  9149. "type": "object",
  9150. "propertyNames": {
  9151. "type": "string"
  9152. },
  9153. "additionalProperties": {}
  9154. }
  9155. },
  9156. "required": ["id", "sessionID", "messageID", "type", "callID", "tool", "state"]
  9157. },
  9158. "StepStartPart": {
  9159. "type": "object",
  9160. "properties": {
  9161. "id": {
  9162. "type": "string",
  9163. "pattern": "^prt.*"
  9164. },
  9165. "sessionID": {
  9166. "type": "string",
  9167. "pattern": "^ses.*"
  9168. },
  9169. "messageID": {
  9170. "type": "string",
  9171. "pattern": "^msg.*"
  9172. },
  9173. "type": {
  9174. "type": "string",
  9175. "const": "step-start"
  9176. },
  9177. "snapshot": {
  9178. "type": "string"
  9179. }
  9180. },
  9181. "required": ["id", "sessionID", "messageID", "type"]
  9182. },
  9183. "StepFinishPart": {
  9184. "type": "object",
  9185. "properties": {
  9186. "id": {
  9187. "type": "string",
  9188. "pattern": "^prt.*"
  9189. },
  9190. "sessionID": {
  9191. "type": "string",
  9192. "pattern": "^ses.*"
  9193. },
  9194. "messageID": {
  9195. "type": "string",
  9196. "pattern": "^msg.*"
  9197. },
  9198. "type": {
  9199. "type": "string",
  9200. "const": "step-finish"
  9201. },
  9202. "reason": {
  9203. "type": "string"
  9204. },
  9205. "snapshot": {
  9206. "type": "string"
  9207. },
  9208. "cost": {
  9209. "type": "number"
  9210. },
  9211. "tokens": {
  9212. "type": "object",
  9213. "properties": {
  9214. "total": {
  9215. "type": "number"
  9216. },
  9217. "input": {
  9218. "type": "number"
  9219. },
  9220. "output": {
  9221. "type": "number"
  9222. },
  9223. "reasoning": {
  9224. "type": "number"
  9225. },
  9226. "cache": {
  9227. "type": "object",
  9228. "properties": {
  9229. "read": {
  9230. "type": "number"
  9231. },
  9232. "write": {
  9233. "type": "number"
  9234. }
  9235. },
  9236. "required": ["read", "write"]
  9237. }
  9238. },
  9239. "required": ["input", "output", "reasoning", "cache"]
  9240. }
  9241. },
  9242. "required": ["id", "sessionID", "messageID", "type", "reason", "cost", "tokens"]
  9243. },
  9244. "SnapshotPart": {
  9245. "type": "object",
  9246. "properties": {
  9247. "id": {
  9248. "type": "string",
  9249. "pattern": "^prt.*"
  9250. },
  9251. "sessionID": {
  9252. "type": "string",
  9253. "pattern": "^ses.*"
  9254. },
  9255. "messageID": {
  9256. "type": "string",
  9257. "pattern": "^msg.*"
  9258. },
  9259. "type": {
  9260. "type": "string",
  9261. "const": "snapshot"
  9262. },
  9263. "snapshot": {
  9264. "type": "string"
  9265. }
  9266. },
  9267. "required": ["id", "sessionID", "messageID", "type", "snapshot"]
  9268. },
  9269. "PatchPart": {
  9270. "type": "object",
  9271. "properties": {
  9272. "id": {
  9273. "type": "string",
  9274. "pattern": "^prt.*"
  9275. },
  9276. "sessionID": {
  9277. "type": "string",
  9278. "pattern": "^ses.*"
  9279. },
  9280. "messageID": {
  9281. "type": "string",
  9282. "pattern": "^msg.*"
  9283. },
  9284. "type": {
  9285. "type": "string",
  9286. "const": "patch"
  9287. },
  9288. "hash": {
  9289. "type": "string"
  9290. },
  9291. "files": {
  9292. "type": "array",
  9293. "items": {
  9294. "type": "string"
  9295. }
  9296. }
  9297. },
  9298. "required": ["id", "sessionID", "messageID", "type", "hash", "files"]
  9299. },
  9300. "AgentPart": {
  9301. "type": "object",
  9302. "properties": {
  9303. "id": {
  9304. "type": "string",
  9305. "pattern": "^prt.*"
  9306. },
  9307. "sessionID": {
  9308. "type": "string",
  9309. "pattern": "^ses.*"
  9310. },
  9311. "messageID": {
  9312. "type": "string",
  9313. "pattern": "^msg.*"
  9314. },
  9315. "type": {
  9316. "type": "string",
  9317. "const": "agent"
  9318. },
  9319. "name": {
  9320. "type": "string"
  9321. },
  9322. "source": {
  9323. "type": "object",
  9324. "properties": {
  9325. "value": {
  9326. "type": "string"
  9327. },
  9328. "start": {
  9329. "type": "integer",
  9330. "minimum": -9007199254740991,
  9331. "maximum": 9007199254740991
  9332. },
  9333. "end": {
  9334. "type": "integer",
  9335. "minimum": -9007199254740991,
  9336. "maximum": 9007199254740991
  9337. }
  9338. },
  9339. "required": ["value", "start", "end"]
  9340. }
  9341. },
  9342. "required": ["id", "sessionID", "messageID", "type", "name"]
  9343. },
  9344. "RetryPart": {
  9345. "type": "object",
  9346. "properties": {
  9347. "id": {
  9348. "type": "string",
  9349. "pattern": "^prt.*"
  9350. },
  9351. "sessionID": {
  9352. "type": "string",
  9353. "pattern": "^ses.*"
  9354. },
  9355. "messageID": {
  9356. "type": "string",
  9357. "pattern": "^msg.*"
  9358. },
  9359. "type": {
  9360. "type": "string",
  9361. "const": "retry"
  9362. },
  9363. "attempt": {
  9364. "type": "number"
  9365. },
  9366. "error": {
  9367. "$ref": "#/components/schemas/APIError"
  9368. },
  9369. "time": {
  9370. "type": "object",
  9371. "properties": {
  9372. "created": {
  9373. "type": "number"
  9374. }
  9375. },
  9376. "required": ["created"]
  9377. }
  9378. },
  9379. "required": ["id", "sessionID", "messageID", "type", "attempt", "error", "time"]
  9380. },
  9381. "CompactionPart": {
  9382. "type": "object",
  9383. "properties": {
  9384. "id": {
  9385. "type": "string",
  9386. "pattern": "^prt.*"
  9387. },
  9388. "sessionID": {
  9389. "type": "string",
  9390. "pattern": "^ses.*"
  9391. },
  9392. "messageID": {
  9393. "type": "string",
  9394. "pattern": "^msg.*"
  9395. },
  9396. "type": {
  9397. "type": "string",
  9398. "const": "compaction"
  9399. },
  9400. "auto": {
  9401. "type": "boolean"
  9402. },
  9403. "overflow": {
  9404. "type": "boolean"
  9405. }
  9406. },
  9407. "required": ["id", "sessionID", "messageID", "type", "auto"]
  9408. },
  9409. "Part": {
  9410. "anyOf": [
  9411. {
  9412. "$ref": "#/components/schemas/TextPart"
  9413. },
  9414. {
  9415. "$ref": "#/components/schemas/SubtaskPart"
  9416. },
  9417. {
  9418. "$ref": "#/components/schemas/ReasoningPart"
  9419. },
  9420. {
  9421. "$ref": "#/components/schemas/FilePart"
  9422. },
  9423. {
  9424. "$ref": "#/components/schemas/ToolPart"
  9425. },
  9426. {
  9427. "$ref": "#/components/schemas/StepStartPart"
  9428. },
  9429. {
  9430. "$ref": "#/components/schemas/StepFinishPart"
  9431. },
  9432. {
  9433. "$ref": "#/components/schemas/SnapshotPart"
  9434. },
  9435. {
  9436. "$ref": "#/components/schemas/PatchPart"
  9437. },
  9438. {
  9439. "$ref": "#/components/schemas/AgentPart"
  9440. },
  9441. {
  9442. "$ref": "#/components/schemas/RetryPart"
  9443. },
  9444. {
  9445. "$ref": "#/components/schemas/CompactionPart"
  9446. }
  9447. ]
  9448. },
  9449. "Event.message.part.updated": {
  9450. "type": "object",
  9451. "properties": {
  9452. "type": {
  9453. "type": "string",
  9454. "const": "message.part.updated"
  9455. },
  9456. "properties": {
  9457. "type": "object",
  9458. "properties": {
  9459. "sessionID": {
  9460. "type": "string",
  9461. "pattern": "^ses.*"
  9462. },
  9463. "part": {
  9464. "$ref": "#/components/schemas/Part"
  9465. },
  9466. "time": {
  9467. "type": "number"
  9468. }
  9469. },
  9470. "required": ["sessionID", "part", "time"]
  9471. }
  9472. },
  9473. "required": ["type", "properties"]
  9474. },
  9475. "Event.message.part.removed": {
  9476. "type": "object",
  9477. "properties": {
  9478. "type": {
  9479. "type": "string",
  9480. "const": "message.part.removed"
  9481. },
  9482. "properties": {
  9483. "type": "object",
  9484. "properties": {
  9485. "sessionID": {
  9486. "type": "string",
  9487. "pattern": "^ses.*"
  9488. },
  9489. "messageID": {
  9490. "type": "string",
  9491. "pattern": "^msg.*"
  9492. },
  9493. "partID": {
  9494. "type": "string",
  9495. "pattern": "^prt.*"
  9496. }
  9497. },
  9498. "required": ["sessionID", "messageID", "partID"]
  9499. }
  9500. },
  9501. "required": ["type", "properties"]
  9502. },
  9503. "PermissionAction": {
  9504. "type": "string",
  9505. "enum": ["allow", "deny", "ask"]
  9506. },
  9507. "PermissionRule": {
  9508. "type": "object",
  9509. "properties": {
  9510. "permission": {
  9511. "type": "string"
  9512. },
  9513. "pattern": {
  9514. "type": "string"
  9515. },
  9516. "action": {
  9517. "$ref": "#/components/schemas/PermissionAction"
  9518. }
  9519. },
  9520. "required": ["permission", "pattern", "action"]
  9521. },
  9522. "PermissionRuleset": {
  9523. "type": "array",
  9524. "items": {
  9525. "$ref": "#/components/schemas/PermissionRule"
  9526. }
  9527. },
  9528. "Session": {
  9529. "type": "object",
  9530. "properties": {
  9531. "id": {
  9532. "type": "string",
  9533. "pattern": "^ses.*"
  9534. },
  9535. "slug": {
  9536. "type": "string"
  9537. },
  9538. "projectID": {
  9539. "type": "string"
  9540. },
  9541. "workspaceID": {
  9542. "type": "string",
  9543. "pattern": "^wrk.*"
  9544. },
  9545. "directory": {
  9546. "type": "string"
  9547. },
  9548. "parentID": {
  9549. "type": "string",
  9550. "pattern": "^ses.*"
  9551. },
  9552. "summary": {
  9553. "type": "object",
  9554. "properties": {
  9555. "additions": {
  9556. "type": "number"
  9557. },
  9558. "deletions": {
  9559. "type": "number"
  9560. },
  9561. "files": {
  9562. "type": "number"
  9563. },
  9564. "diffs": {
  9565. "type": "array",
  9566. "items": {
  9567. "$ref": "#/components/schemas/FileDiff"
  9568. }
  9569. }
  9570. },
  9571. "required": ["additions", "deletions", "files"]
  9572. },
  9573. "share": {
  9574. "type": "object",
  9575. "properties": {
  9576. "url": {
  9577. "type": "string"
  9578. }
  9579. },
  9580. "required": ["url"]
  9581. },
  9582. "title": {
  9583. "type": "string"
  9584. },
  9585. "version": {
  9586. "type": "string"
  9587. },
  9588. "time": {
  9589. "type": "object",
  9590. "properties": {
  9591. "created": {
  9592. "type": "number"
  9593. },
  9594. "updated": {
  9595. "type": "number"
  9596. },
  9597. "compacting": {
  9598. "type": "number"
  9599. },
  9600. "archived": {
  9601. "type": "number"
  9602. }
  9603. },
  9604. "required": ["created", "updated"]
  9605. },
  9606. "permission": {
  9607. "$ref": "#/components/schemas/PermissionRuleset"
  9608. },
  9609. "revert": {
  9610. "type": "object",
  9611. "properties": {
  9612. "messageID": {
  9613. "type": "string",
  9614. "pattern": "^msg.*"
  9615. },
  9616. "partID": {
  9617. "type": "string",
  9618. "pattern": "^prt.*"
  9619. },
  9620. "snapshot": {
  9621. "type": "string"
  9622. },
  9623. "diff": {
  9624. "type": "string"
  9625. }
  9626. },
  9627. "required": ["messageID"]
  9628. }
  9629. },
  9630. "required": ["id", "slug", "projectID", "directory", "title", "version", "time"]
  9631. },
  9632. "Event.session.created": {
  9633. "type": "object",
  9634. "properties": {
  9635. "type": {
  9636. "type": "string",
  9637. "const": "session.created"
  9638. },
  9639. "properties": {
  9640. "type": "object",
  9641. "properties": {
  9642. "sessionID": {
  9643. "type": "string",
  9644. "pattern": "^ses.*"
  9645. },
  9646. "info": {
  9647. "$ref": "#/components/schemas/Session"
  9648. }
  9649. },
  9650. "required": ["sessionID", "info"]
  9651. }
  9652. },
  9653. "required": ["type", "properties"]
  9654. },
  9655. "Event.session.updated": {
  9656. "type": "object",
  9657. "properties": {
  9658. "type": {
  9659. "type": "string",
  9660. "const": "session.updated"
  9661. },
  9662. "properties": {
  9663. "type": "object",
  9664. "properties": {
  9665. "sessionID": {
  9666. "type": "string",
  9667. "pattern": "^ses.*"
  9668. },
  9669. "info": {
  9670. "$ref": "#/components/schemas/Session"
  9671. }
  9672. },
  9673. "required": ["sessionID", "info"]
  9674. }
  9675. },
  9676. "required": ["type", "properties"]
  9677. },
  9678. "Event.session.deleted": {
  9679. "type": "object",
  9680. "properties": {
  9681. "type": {
  9682. "type": "string",
  9683. "const": "session.deleted"
  9684. },
  9685. "properties": {
  9686. "type": "object",
  9687. "properties": {
  9688. "sessionID": {
  9689. "type": "string",
  9690. "pattern": "^ses.*"
  9691. },
  9692. "info": {
  9693. "$ref": "#/components/schemas/Session"
  9694. }
  9695. },
  9696. "required": ["sessionID", "info"]
  9697. }
  9698. },
  9699. "required": ["type", "properties"]
  9700. },
  9701. "Event": {
  9702. "anyOf": [
  9703. {
  9704. "$ref": "#/components/schemas/Event.project.updated"
  9705. },
  9706. {
  9707. "$ref": "#/components/schemas/Event.installation.updated"
  9708. },
  9709. {
  9710. "$ref": "#/components/schemas/Event.installation.update-available"
  9711. },
  9712. {
  9713. "$ref": "#/components/schemas/Event.server.instance.disposed"
  9714. },
  9715. {
  9716. "$ref": "#/components/schemas/Event.server.connected"
  9717. },
  9718. {
  9719. "$ref": "#/components/schemas/Event.global.disposed"
  9720. },
  9721. {
  9722. "$ref": "#/components/schemas/Event.lsp.client.diagnostics"
  9723. },
  9724. {
  9725. "$ref": "#/components/schemas/Event.lsp.updated"
  9726. },
  9727. {
  9728. "$ref": "#/components/schemas/Event.message.part.delta"
  9729. },
  9730. {
  9731. "$ref": "#/components/schemas/Event.permission.asked"
  9732. },
  9733. {
  9734. "$ref": "#/components/schemas/Event.permission.replied"
  9735. },
  9736. {
  9737. "$ref": "#/components/schemas/Event.session.status"
  9738. },
  9739. {
  9740. "$ref": "#/components/schemas/Event.session.idle"
  9741. },
  9742. {
  9743. "$ref": "#/components/schemas/Event.question.asked"
  9744. },
  9745. {
  9746. "$ref": "#/components/schemas/Event.question.replied"
  9747. },
  9748. {
  9749. "$ref": "#/components/schemas/Event.question.rejected"
  9750. },
  9751. {
  9752. "$ref": "#/components/schemas/Event.session.compacted"
  9753. },
  9754. {
  9755. "$ref": "#/components/schemas/Event.file.edited"
  9756. },
  9757. {
  9758. "$ref": "#/components/schemas/Event.file.watcher.updated"
  9759. },
  9760. {
  9761. "$ref": "#/components/schemas/Event.todo.updated"
  9762. },
  9763. {
  9764. "$ref": "#/components/schemas/Event.tui.prompt.append"
  9765. },
  9766. {
  9767. "$ref": "#/components/schemas/Event.tui.command.execute"
  9768. },
  9769. {
  9770. "$ref": "#/components/schemas/Event.tui.toast.show"
  9771. },
  9772. {
  9773. "$ref": "#/components/schemas/Event.tui.session.select"
  9774. },
  9775. {
  9776. "$ref": "#/components/schemas/Event.mcp.tools.changed"
  9777. },
  9778. {
  9779. "$ref": "#/components/schemas/Event.mcp.browser.open.failed"
  9780. },
  9781. {
  9782. "$ref": "#/components/schemas/Event.command.executed"
  9783. },
  9784. {
  9785. "$ref": "#/components/schemas/Event.session.diff"
  9786. },
  9787. {
  9788. "$ref": "#/components/schemas/Event.session.error"
  9789. },
  9790. {
  9791. "$ref": "#/components/schemas/Event.vcs.branch.updated"
  9792. },
  9793. {
  9794. "$ref": "#/components/schemas/Event.workspace.ready"
  9795. },
  9796. {
  9797. "$ref": "#/components/schemas/Event.workspace.failed"
  9798. },
  9799. {
  9800. "$ref": "#/components/schemas/Event.pty.created"
  9801. },
  9802. {
  9803. "$ref": "#/components/schemas/Event.pty.updated"
  9804. },
  9805. {
  9806. "$ref": "#/components/schemas/Event.pty.exited"
  9807. },
  9808. {
  9809. "$ref": "#/components/schemas/Event.pty.deleted"
  9810. },
  9811. {
  9812. "$ref": "#/components/schemas/Event.worktree.ready"
  9813. },
  9814. {
  9815. "$ref": "#/components/schemas/Event.worktree.failed"
  9816. },
  9817. {
  9818. "$ref": "#/components/schemas/Event.message.updated"
  9819. },
  9820. {
  9821. "$ref": "#/components/schemas/Event.message.removed"
  9822. },
  9823. {
  9824. "$ref": "#/components/schemas/Event.message.part.updated"
  9825. },
  9826. {
  9827. "$ref": "#/components/schemas/Event.message.part.removed"
  9828. },
  9829. {
  9830. "$ref": "#/components/schemas/Event.session.created"
  9831. },
  9832. {
  9833. "$ref": "#/components/schemas/Event.session.updated"
  9834. },
  9835. {
  9836. "$ref": "#/components/schemas/Event.session.deleted"
  9837. }
  9838. ]
  9839. },
  9840. "GlobalEvent": {
  9841. "type": "object",
  9842. "properties": {
  9843. "directory": {
  9844. "type": "string"
  9845. },
  9846. "payload": {
  9847. "$ref": "#/components/schemas/Event"
  9848. }
  9849. },
  9850. "required": ["directory", "payload"]
  9851. },
  9852. "SyncEvent.message.updated": {
  9853. "type": "object",
  9854. "properties": {
  9855. "type": {
  9856. "type": "string",
  9857. "const": "message.updated.1"
  9858. },
  9859. "aggregate": {
  9860. "type": "string",
  9861. "const": "sessionID"
  9862. },
  9863. "data": {
  9864. "type": "object",
  9865. "properties": {
  9866. "sessionID": {
  9867. "type": "string",
  9868. "pattern": "^ses.*"
  9869. },
  9870. "info": {
  9871. "$ref": "#/components/schemas/Message"
  9872. }
  9873. },
  9874. "required": ["sessionID", "info"]
  9875. }
  9876. },
  9877. "required": ["type", "aggregate", "data"]
  9878. },
  9879. "SyncEvent.message.removed": {
  9880. "type": "object",
  9881. "properties": {
  9882. "type": {
  9883. "type": "string",
  9884. "const": "message.removed.1"
  9885. },
  9886. "aggregate": {
  9887. "type": "string",
  9888. "const": "sessionID"
  9889. },
  9890. "data": {
  9891. "type": "object",
  9892. "properties": {
  9893. "sessionID": {
  9894. "type": "string",
  9895. "pattern": "^ses.*"
  9896. },
  9897. "messageID": {
  9898. "type": "string",
  9899. "pattern": "^msg.*"
  9900. }
  9901. },
  9902. "required": ["sessionID", "messageID"]
  9903. }
  9904. },
  9905. "required": ["type", "aggregate", "data"]
  9906. },
  9907. "SyncEvent.message.part.updated": {
  9908. "type": "object",
  9909. "properties": {
  9910. "type": {
  9911. "type": "string",
  9912. "const": "message.part.updated.1"
  9913. },
  9914. "aggregate": {
  9915. "type": "string",
  9916. "const": "sessionID"
  9917. },
  9918. "data": {
  9919. "type": "object",
  9920. "properties": {
  9921. "sessionID": {
  9922. "type": "string",
  9923. "pattern": "^ses.*"
  9924. },
  9925. "part": {
  9926. "$ref": "#/components/schemas/Part"
  9927. },
  9928. "time": {
  9929. "type": "number"
  9930. }
  9931. },
  9932. "required": ["sessionID", "part", "time"]
  9933. }
  9934. },
  9935. "required": ["type", "aggregate", "data"]
  9936. },
  9937. "SyncEvent.message.part.removed": {
  9938. "type": "object",
  9939. "properties": {
  9940. "type": {
  9941. "type": "string",
  9942. "const": "message.part.removed.1"
  9943. },
  9944. "aggregate": {
  9945. "type": "string",
  9946. "const": "sessionID"
  9947. },
  9948. "data": {
  9949. "type": "object",
  9950. "properties": {
  9951. "sessionID": {
  9952. "type": "string",
  9953. "pattern": "^ses.*"
  9954. },
  9955. "messageID": {
  9956. "type": "string",
  9957. "pattern": "^msg.*"
  9958. },
  9959. "partID": {
  9960. "type": "string",
  9961. "pattern": "^prt.*"
  9962. }
  9963. },
  9964. "required": ["sessionID", "messageID", "partID"]
  9965. }
  9966. },
  9967. "required": ["type", "aggregate", "data"]
  9968. },
  9969. "SyncEvent.session.created": {
  9970. "type": "object",
  9971. "properties": {
  9972. "type": {
  9973. "type": "string",
  9974. "const": "session.created.1"
  9975. },
  9976. "aggregate": {
  9977. "type": "string",
  9978. "const": "sessionID"
  9979. },
  9980. "data": {
  9981. "type": "object",
  9982. "properties": {
  9983. "sessionID": {
  9984. "type": "string",
  9985. "pattern": "^ses.*"
  9986. },
  9987. "info": {
  9988. "$ref": "#/components/schemas/Session"
  9989. }
  9990. },
  9991. "required": ["sessionID", "info"]
  9992. }
  9993. },
  9994. "required": ["type", "aggregate", "data"]
  9995. },
  9996. "SyncEvent.session.updated": {
  9997. "type": "object",
  9998. "properties": {
  9999. "type": {
  10000. "type": "string",
  10001. "const": "session.updated.1"
  10002. },
  10003. "aggregate": {
  10004. "type": "string",
  10005. "const": "sessionID"
  10006. },
  10007. "data": {
  10008. "type": "object",
  10009. "properties": {
  10010. "sessionID": {
  10011. "type": "string",
  10012. "pattern": "^ses.*"
  10013. },
  10014. "info": {
  10015. "type": "object",
  10016. "properties": {
  10017. "id": {
  10018. "anyOf": [
  10019. {
  10020. "type": "string",
  10021. "pattern": "^ses.*"
  10022. },
  10023. {
  10024. "type": "null"
  10025. }
  10026. ]
  10027. },
  10028. "slug": {
  10029. "anyOf": [
  10030. {
  10031. "type": "string"
  10032. },
  10033. {
  10034. "type": "null"
  10035. }
  10036. ]
  10037. },
  10038. "projectID": {
  10039. "anyOf": [
  10040. {
  10041. "type": "string"
  10042. },
  10043. {
  10044. "type": "null"
  10045. }
  10046. ]
  10047. },
  10048. "workspaceID": {
  10049. "anyOf": [
  10050. {
  10051. "type": "string",
  10052. "pattern": "^wrk.*"
  10053. },
  10054. {
  10055. "type": "null"
  10056. }
  10057. ]
  10058. },
  10059. "directory": {
  10060. "anyOf": [
  10061. {
  10062. "type": "string"
  10063. },
  10064. {
  10065. "type": "null"
  10066. }
  10067. ]
  10068. },
  10069. "parentID": {
  10070. "anyOf": [
  10071. {
  10072. "type": "string",
  10073. "pattern": "^ses.*"
  10074. },
  10075. {
  10076. "type": "null"
  10077. }
  10078. ]
  10079. },
  10080. "summary": {
  10081. "anyOf": [
  10082. {
  10083. "type": "object",
  10084. "properties": {
  10085. "additions": {
  10086. "type": "number"
  10087. },
  10088. "deletions": {
  10089. "type": "number"
  10090. },
  10091. "files": {
  10092. "type": "number"
  10093. },
  10094. "diffs": {
  10095. "type": "array",
  10096. "items": {
  10097. "$ref": "#/components/schemas/FileDiff"
  10098. }
  10099. }
  10100. },
  10101. "required": ["additions", "deletions", "files"]
  10102. },
  10103. {
  10104. "type": "null"
  10105. }
  10106. ]
  10107. },
  10108. "share": {
  10109. "type": "object",
  10110. "properties": {
  10111. "url": {
  10112. "anyOf": [
  10113. {
  10114. "type": "string"
  10115. },
  10116. {
  10117. "type": "null"
  10118. }
  10119. ]
  10120. }
  10121. },
  10122. "required": ["url"]
  10123. },
  10124. "title": {
  10125. "anyOf": [
  10126. {
  10127. "type": "string"
  10128. },
  10129. {
  10130. "type": "null"
  10131. }
  10132. ]
  10133. },
  10134. "version": {
  10135. "anyOf": [
  10136. {
  10137. "type": "string"
  10138. },
  10139. {
  10140. "type": "null"
  10141. }
  10142. ]
  10143. },
  10144. "time": {
  10145. "type": "object",
  10146. "properties": {
  10147. "created": {
  10148. "anyOf": [
  10149. {
  10150. "type": "number"
  10151. },
  10152. {
  10153. "type": "null"
  10154. }
  10155. ]
  10156. },
  10157. "updated": {
  10158. "anyOf": [
  10159. {
  10160. "type": "number"
  10161. },
  10162. {
  10163. "type": "null"
  10164. }
  10165. ]
  10166. },
  10167. "compacting": {
  10168. "anyOf": [
  10169. {
  10170. "type": "number"
  10171. },
  10172. {
  10173. "type": "null"
  10174. }
  10175. ]
  10176. },
  10177. "archived": {
  10178. "anyOf": [
  10179. {
  10180. "type": "number"
  10181. },
  10182. {
  10183. "type": "null"
  10184. }
  10185. ]
  10186. }
  10187. },
  10188. "required": ["created", "updated", "compacting", "archived"]
  10189. },
  10190. "permission": {
  10191. "anyOf": [
  10192. {
  10193. "$ref": "#/components/schemas/PermissionRuleset"
  10194. },
  10195. {
  10196. "type": "null"
  10197. }
  10198. ]
  10199. },
  10200. "revert": {
  10201. "anyOf": [
  10202. {
  10203. "type": "object",
  10204. "properties": {
  10205. "messageID": {
  10206. "type": "string",
  10207. "pattern": "^msg.*"
  10208. },
  10209. "partID": {
  10210. "type": "string",
  10211. "pattern": "^prt.*"
  10212. },
  10213. "snapshot": {
  10214. "type": "string"
  10215. },
  10216. "diff": {
  10217. "type": "string"
  10218. }
  10219. },
  10220. "required": ["messageID"]
  10221. },
  10222. {
  10223. "type": "null"
  10224. }
  10225. ]
  10226. }
  10227. },
  10228. "required": [
  10229. "id",
  10230. "slug",
  10231. "projectID",
  10232. "workspaceID",
  10233. "directory",
  10234. "parentID",
  10235. "summary",
  10236. "title",
  10237. "version",
  10238. "permission",
  10239. "revert"
  10240. ]
  10241. }
  10242. },
  10243. "required": ["sessionID", "info"]
  10244. }
  10245. },
  10246. "required": ["type", "aggregate", "data"]
  10247. },
  10248. "SyncEvent.session.deleted": {
  10249. "type": "object",
  10250. "properties": {
  10251. "type": {
  10252. "type": "string",
  10253. "const": "session.deleted.1"
  10254. },
  10255. "aggregate": {
  10256. "type": "string",
  10257. "const": "sessionID"
  10258. },
  10259. "data": {
  10260. "type": "object",
  10261. "properties": {
  10262. "sessionID": {
  10263. "type": "string",
  10264. "pattern": "^ses.*"
  10265. },
  10266. "info": {
  10267. "$ref": "#/components/schemas/Session"
  10268. }
  10269. },
  10270. "required": ["sessionID", "info"]
  10271. }
  10272. },
  10273. "required": ["type", "aggregate", "data"]
  10274. },
  10275. "SyncEvent": {
  10276. "type": "object",
  10277. "properties": {
  10278. "payload": {
  10279. "$ref": "#/components/schemas/SyncEvent"
  10280. }
  10281. },
  10282. "required": ["payload"]
  10283. },
  10284. "LogLevel": {
  10285. "description": "Log level",
  10286. "type": "string",
  10287. "enum": ["DEBUG", "INFO", "WARN", "ERROR"]
  10288. },
  10289. "ServerConfig": {
  10290. "description": "Server configuration for opencode serve and web commands",
  10291. "type": "object",
  10292. "properties": {
  10293. "port": {
  10294. "description": "Port to listen on",
  10295. "type": "integer",
  10296. "exclusiveMinimum": 0,
  10297. "maximum": 9007199254740991
  10298. },
  10299. "hostname": {
  10300. "description": "Hostname to listen on",
  10301. "type": "string"
  10302. },
  10303. "mdns": {
  10304. "description": "Enable mDNS service discovery",
  10305. "type": "boolean"
  10306. },
  10307. "mdnsDomain": {
  10308. "description": "Custom domain name for mDNS service (default: opencode.local)",
  10309. "type": "string"
  10310. },
  10311. "cors": {
  10312. "description": "Additional domains to allow for CORS",
  10313. "type": "array",
  10314. "items": {
  10315. "type": "string"
  10316. }
  10317. }
  10318. },
  10319. "additionalProperties": false
  10320. },
  10321. "PermissionActionConfig": {
  10322. "type": "string",
  10323. "enum": ["ask", "allow", "deny"]
  10324. },
  10325. "PermissionObjectConfig": {
  10326. "type": "object",
  10327. "propertyNames": {
  10328. "type": "string"
  10329. },
  10330. "additionalProperties": {
  10331. "$ref": "#/components/schemas/PermissionActionConfig"
  10332. }
  10333. },
  10334. "PermissionRuleConfig": {
  10335. "anyOf": [
  10336. {
  10337. "$ref": "#/components/schemas/PermissionActionConfig"
  10338. },
  10339. {
  10340. "$ref": "#/components/schemas/PermissionObjectConfig"
  10341. }
  10342. ]
  10343. },
  10344. "PermissionConfig": {
  10345. "anyOf": [
  10346. {
  10347. "type": "object",
  10348. "properties": {
  10349. "__originalKeys": {
  10350. "type": "array",
  10351. "items": {
  10352. "type": "string"
  10353. }
  10354. },
  10355. "read": {
  10356. "$ref": "#/components/schemas/PermissionRuleConfig"
  10357. },
  10358. "edit": {
  10359. "$ref": "#/components/schemas/PermissionRuleConfig"
  10360. },
  10361. "glob": {
  10362. "$ref": "#/components/schemas/PermissionRuleConfig"
  10363. },
  10364. "grep": {
  10365. "$ref": "#/components/schemas/PermissionRuleConfig"
  10366. },
  10367. "list": {
  10368. "$ref": "#/components/schemas/PermissionRuleConfig"
  10369. },
  10370. "bash": {
  10371. "$ref": "#/components/schemas/PermissionRuleConfig"
  10372. },
  10373. "task": {
  10374. "$ref": "#/components/schemas/PermissionRuleConfig"
  10375. },
  10376. "external_directory": {
  10377. "$ref": "#/components/schemas/PermissionRuleConfig"
  10378. },
  10379. "todowrite": {
  10380. "$ref": "#/components/schemas/PermissionActionConfig"
  10381. },
  10382. "question": {
  10383. "$ref": "#/components/schemas/PermissionActionConfig"
  10384. },
  10385. "webfetch": {
  10386. "$ref": "#/components/schemas/PermissionActionConfig"
  10387. },
  10388. "websearch": {
  10389. "$ref": "#/components/schemas/PermissionActionConfig"
  10390. },
  10391. "codesearch": {
  10392. "$ref": "#/components/schemas/PermissionActionConfig"
  10393. },
  10394. "lsp": {
  10395. "$ref": "#/components/schemas/PermissionRuleConfig"
  10396. },
  10397. "doom_loop": {
  10398. "$ref": "#/components/schemas/PermissionActionConfig"
  10399. },
  10400. "skill": {
  10401. "$ref": "#/components/schemas/PermissionRuleConfig"
  10402. }
  10403. },
  10404. "additionalProperties": {
  10405. "$ref": "#/components/schemas/PermissionRuleConfig"
  10406. }
  10407. },
  10408. {
  10409. "$ref": "#/components/schemas/PermissionActionConfig"
  10410. }
  10411. ]
  10412. },
  10413. "AgentConfig": {
  10414. "type": "object",
  10415. "properties": {
  10416. "model": {
  10417. "type": "string"
  10418. },
  10419. "variant": {
  10420. "description": "Default model variant for this agent (applies only when using the agent's configured model).",
  10421. "type": "string"
  10422. },
  10423. "temperature": {
  10424. "type": "number"
  10425. },
  10426. "top_p": {
  10427. "type": "number"
  10428. },
  10429. "prompt": {
  10430. "type": "string"
  10431. },
  10432. "tools": {
  10433. "description": "@deprecated Use 'permission' field instead",
  10434. "type": "object",
  10435. "propertyNames": {
  10436. "type": "string"
  10437. },
  10438. "additionalProperties": {
  10439. "type": "boolean"
  10440. }
  10441. },
  10442. "disable": {
  10443. "type": "boolean"
  10444. },
  10445. "description": {
  10446. "description": "Description of when to use the agent",
  10447. "type": "string"
  10448. },
  10449. "mode": {
  10450. "type": "string",
  10451. "enum": ["subagent", "primary", "all"]
  10452. },
  10453. "hidden": {
  10454. "description": "Hide this subagent from the @ autocomplete menu (default: false, only applies to mode: subagent)",
  10455. "type": "boolean"
  10456. },
  10457. "options": {
  10458. "type": "object",
  10459. "propertyNames": {
  10460. "type": "string"
  10461. },
  10462. "additionalProperties": {}
  10463. },
  10464. "color": {
  10465. "description": "Hex color code (e.g., #FF5733) or theme color (e.g., primary)",
  10466. "anyOf": [
  10467. {
  10468. "type": "string",
  10469. "pattern": "^#[0-9a-fA-F]{6}$"
  10470. },
  10471. {
  10472. "type": "string",
  10473. "enum": ["primary", "secondary", "accent", "success", "warning", "error", "info"]
  10474. }
  10475. ]
  10476. },
  10477. "steps": {
  10478. "description": "Maximum number of agentic iterations before forcing text-only response",
  10479. "type": "integer",
  10480. "exclusiveMinimum": 0,
  10481. "maximum": 9007199254740991
  10482. },
  10483. "maxSteps": {
  10484. "description": "@deprecated Use 'steps' field instead.",
  10485. "type": "integer",
  10486. "exclusiveMinimum": 0,
  10487. "maximum": 9007199254740991
  10488. },
  10489. "permission": {
  10490. "$ref": "#/components/schemas/PermissionConfig"
  10491. }
  10492. },
  10493. "additionalProperties": {}
  10494. },
  10495. "ProviderConfig": {
  10496. "type": "object",
  10497. "properties": {
  10498. "api": {
  10499. "type": "string"
  10500. },
  10501. "name": {
  10502. "type": "string"
  10503. },
  10504. "env": {
  10505. "type": "array",
  10506. "items": {
  10507. "type": "string"
  10508. }
  10509. },
  10510. "id": {
  10511. "type": "string"
  10512. },
  10513. "npm": {
  10514. "type": "string"
  10515. },
  10516. "models": {
  10517. "type": "object",
  10518. "propertyNames": {
  10519. "type": "string"
  10520. },
  10521. "additionalProperties": {
  10522. "type": "object",
  10523. "properties": {
  10524. "id": {
  10525. "type": "string"
  10526. },
  10527. "name": {
  10528. "type": "string"
  10529. },
  10530. "family": {
  10531. "type": "string"
  10532. },
  10533. "release_date": {
  10534. "type": "string"
  10535. },
  10536. "attachment": {
  10537. "type": "boolean"
  10538. },
  10539. "reasoning": {
  10540. "type": "boolean"
  10541. },
  10542. "temperature": {
  10543. "type": "boolean"
  10544. },
  10545. "tool_call": {
  10546. "type": "boolean"
  10547. },
  10548. "interleaved": {
  10549. "anyOf": [
  10550. {
  10551. "type": "boolean",
  10552. "const": true
  10553. },
  10554. {
  10555. "type": "object",
  10556. "properties": {
  10557. "field": {
  10558. "type": "string",
  10559. "enum": ["reasoning_content", "reasoning_details"]
  10560. }
  10561. },
  10562. "required": ["field"],
  10563. "additionalProperties": false
  10564. }
  10565. ]
  10566. },
  10567. "cost": {
  10568. "type": "object",
  10569. "properties": {
  10570. "input": {
  10571. "type": "number"
  10572. },
  10573. "output": {
  10574. "type": "number"
  10575. },
  10576. "cache_read": {
  10577. "type": "number"
  10578. },
  10579. "cache_write": {
  10580. "type": "number"
  10581. },
  10582. "context_over_200k": {
  10583. "type": "object",
  10584. "properties": {
  10585. "input": {
  10586. "type": "number"
  10587. },
  10588. "output": {
  10589. "type": "number"
  10590. },
  10591. "cache_read": {
  10592. "type": "number"
  10593. },
  10594. "cache_write": {
  10595. "type": "number"
  10596. }
  10597. },
  10598. "required": ["input", "output"]
  10599. }
  10600. },
  10601. "required": ["input", "output"]
  10602. },
  10603. "limit": {
  10604. "type": "object",
  10605. "properties": {
  10606. "context": {
  10607. "type": "number"
  10608. },
  10609. "input": {
  10610. "type": "number"
  10611. },
  10612. "output": {
  10613. "type": "number"
  10614. }
  10615. },
  10616. "required": ["context", "output"]
  10617. },
  10618. "modalities": {
  10619. "type": "object",
  10620. "properties": {
  10621. "input": {
  10622. "type": "array",
  10623. "items": {
  10624. "type": "string",
  10625. "enum": ["text", "audio", "image", "video", "pdf"]
  10626. }
  10627. },
  10628. "output": {
  10629. "type": "array",
  10630. "items": {
  10631. "type": "string",
  10632. "enum": ["text", "audio", "image", "video", "pdf"]
  10633. }
  10634. }
  10635. },
  10636. "required": ["input", "output"]
  10637. },
  10638. "experimental": {
  10639. "type": "boolean"
  10640. },
  10641. "status": {
  10642. "type": "string",
  10643. "enum": ["alpha", "beta", "deprecated"]
  10644. },
  10645. "options": {
  10646. "type": "object",
  10647. "propertyNames": {
  10648. "type": "string"
  10649. },
  10650. "additionalProperties": {}
  10651. },
  10652. "headers": {
  10653. "type": "object",
  10654. "propertyNames": {
  10655. "type": "string"
  10656. },
  10657. "additionalProperties": {
  10658. "type": "string"
  10659. }
  10660. },
  10661. "provider": {
  10662. "type": "object",
  10663. "properties": {
  10664. "npm": {
  10665. "type": "string"
  10666. },
  10667. "api": {
  10668. "type": "string"
  10669. }
  10670. }
  10671. },
  10672. "variants": {
  10673. "description": "Variant-specific configuration",
  10674. "type": "object",
  10675. "propertyNames": {
  10676. "type": "string"
  10677. },
  10678. "additionalProperties": {
  10679. "type": "object",
  10680. "properties": {
  10681. "disabled": {
  10682. "description": "Disable this variant for the model",
  10683. "type": "boolean"
  10684. }
  10685. },
  10686. "additionalProperties": {}
  10687. }
  10688. }
  10689. }
  10690. }
  10691. },
  10692. "whitelist": {
  10693. "type": "array",
  10694. "items": {
  10695. "type": "string"
  10696. }
  10697. },
  10698. "blacklist": {
  10699. "type": "array",
  10700. "items": {
  10701. "type": "string"
  10702. }
  10703. },
  10704. "options": {
  10705. "type": "object",
  10706. "properties": {
  10707. "apiKey": {
  10708. "type": "string"
  10709. },
  10710. "baseURL": {
  10711. "type": "string"
  10712. },
  10713. "enterpriseUrl": {
  10714. "description": "GitHub Enterprise URL for copilot authentication",
  10715. "type": "string"
  10716. },
  10717. "setCacheKey": {
  10718. "description": "Enable promptCacheKey for this provider (default false)",
  10719. "type": "boolean"
  10720. },
  10721. "timeout": {
  10722. "description": "Timeout in milliseconds for requests to this provider. Default is 300000 (5 minutes). Set to false to disable timeout.",
  10723. "anyOf": [
  10724. {
  10725. "description": "Timeout in milliseconds for requests to this provider. Default is 300000 (5 minutes). Set to false to disable timeout.",
  10726. "type": "integer",
  10727. "exclusiveMinimum": 0,
  10728. "maximum": 9007199254740991
  10729. },
  10730. {
  10731. "description": "Disable timeout for this provider entirely.",
  10732. "type": "boolean",
  10733. "const": false
  10734. }
  10735. ]
  10736. },
  10737. "chunkTimeout": {
  10738. "description": "Timeout in milliseconds between streamed SSE chunks for this provider. If no chunk arrives within this window, the request is aborted.",
  10739. "type": "integer",
  10740. "exclusiveMinimum": 0,
  10741. "maximum": 9007199254740991
  10742. }
  10743. },
  10744. "additionalProperties": {}
  10745. }
  10746. },
  10747. "additionalProperties": false
  10748. },
  10749. "McpLocalConfig": {
  10750. "type": "object",
  10751. "properties": {
  10752. "type": {
  10753. "description": "Type of MCP server connection",
  10754. "type": "string",
  10755. "const": "local"
  10756. },
  10757. "command": {
  10758. "description": "Command and arguments to run the MCP server",
  10759. "type": "array",
  10760. "items": {
  10761. "type": "string"
  10762. }
  10763. },
  10764. "environment": {
  10765. "description": "Environment variables to set when running the MCP server",
  10766. "type": "object",
  10767. "propertyNames": {
  10768. "type": "string"
  10769. },
  10770. "additionalProperties": {
  10771. "type": "string"
  10772. }
  10773. },
  10774. "enabled": {
  10775. "description": "Enable or disable the MCP server on startup",
  10776. "type": "boolean"
  10777. },
  10778. "timeout": {
  10779. "description": "Timeout in ms for MCP server requests. Defaults to 5000 (5 seconds) if not specified.",
  10780. "type": "integer",
  10781. "exclusiveMinimum": 0,
  10782. "maximum": 9007199254740991
  10783. }
  10784. },
  10785. "required": ["type", "command"],
  10786. "additionalProperties": false
  10787. },
  10788. "McpOAuthConfig": {
  10789. "type": "object",
  10790. "properties": {
  10791. "clientId": {
  10792. "description": "OAuth client ID. If not provided, dynamic client registration (RFC 7591) will be attempted.",
  10793. "type": "string"
  10794. },
  10795. "clientSecret": {
  10796. "description": "OAuth client secret (if required by the authorization server)",
  10797. "type": "string"
  10798. },
  10799. "scope": {
  10800. "description": "OAuth scopes to request during authorization",
  10801. "type": "string"
  10802. }
  10803. },
  10804. "additionalProperties": false
  10805. },
  10806. "McpRemoteConfig": {
  10807. "type": "object",
  10808. "properties": {
  10809. "type": {
  10810. "description": "Type of MCP server connection",
  10811. "type": "string",
  10812. "const": "remote"
  10813. },
  10814. "url": {
  10815. "description": "URL of the remote MCP server",
  10816. "type": "string"
  10817. },
  10818. "enabled": {
  10819. "description": "Enable or disable the MCP server on startup",
  10820. "type": "boolean"
  10821. },
  10822. "headers": {
  10823. "description": "Headers to send with the request",
  10824. "type": "object",
  10825. "propertyNames": {
  10826. "type": "string"
  10827. },
  10828. "additionalProperties": {
  10829. "type": "string"
  10830. }
  10831. },
  10832. "oauth": {
  10833. "description": "OAuth authentication configuration for the MCP server. Set to false to disable OAuth auto-detection.",
  10834. "anyOf": [
  10835. {
  10836. "$ref": "#/components/schemas/McpOAuthConfig"
  10837. },
  10838. {
  10839. "type": "boolean",
  10840. "const": false
  10841. }
  10842. ]
  10843. },
  10844. "timeout": {
  10845. "description": "Timeout in ms for MCP server requests. Defaults to 5000 (5 seconds) if not specified.",
  10846. "type": "integer",
  10847. "exclusiveMinimum": 0,
  10848. "maximum": 9007199254740991
  10849. }
  10850. },
  10851. "required": ["type", "url"],
  10852. "additionalProperties": false
  10853. },
  10854. "LayoutConfig": {
  10855. "description": "@deprecated Always uses stretch layout.",
  10856. "type": "string",
  10857. "enum": ["auto", "stretch"]
  10858. },
  10859. "Config": {
  10860. "type": "object",
  10861. "properties": {
  10862. "$schema": {
  10863. "description": "JSON schema reference for configuration validation",
  10864. "type": "string"
  10865. },
  10866. "logLevel": {
  10867. "$ref": "#/components/schemas/LogLevel"
  10868. },
  10869. "server": {
  10870. "$ref": "#/components/schemas/ServerConfig"
  10871. },
  10872. "command": {
  10873. "description": "Command configuration, see https://opencode.ai/docs/commands",
  10874. "type": "object",
  10875. "propertyNames": {
  10876. "type": "string"
  10877. },
  10878. "additionalProperties": {
  10879. "type": "object",
  10880. "properties": {
  10881. "template": {
  10882. "type": "string"
  10883. },
  10884. "description": {
  10885. "type": "string"
  10886. },
  10887. "agent": {
  10888. "type": "string"
  10889. },
  10890. "model": {
  10891. "type": "string"
  10892. },
  10893. "subtask": {
  10894. "type": "boolean"
  10895. }
  10896. },
  10897. "required": ["template"]
  10898. }
  10899. },
  10900. "skills": {
  10901. "description": "Additional skill folder paths",
  10902. "type": "object",
  10903. "properties": {
  10904. "paths": {
  10905. "description": "Additional paths to skill folders",
  10906. "type": "array",
  10907. "items": {
  10908. "type": "string"
  10909. }
  10910. },
  10911. "urls": {
  10912. "description": "URLs to fetch skills from (e.g., https://example.com/.well-known/skills/)",
  10913. "type": "array",
  10914. "items": {
  10915. "type": "string"
  10916. }
  10917. }
  10918. }
  10919. },
  10920. "watcher": {
  10921. "type": "object",
  10922. "properties": {
  10923. "ignore": {
  10924. "type": "array",
  10925. "items": {
  10926. "type": "string"
  10927. }
  10928. }
  10929. }
  10930. },
  10931. "snapshot": {
  10932. "description": "Enable or disable snapshot tracking. When false, filesystem snapshots are not recorded and undoing or reverting will not undo/redo file changes. Defaults to true.",
  10933. "type": "boolean"
  10934. },
  10935. "plugin": {
  10936. "type": "array",
  10937. "items": {
  10938. "anyOf": [
  10939. {
  10940. "type": "string"
  10941. },
  10942. {
  10943. "type": "array",
  10944. "prefixItems": [
  10945. {
  10946. "type": "string"
  10947. },
  10948. {
  10949. "type": "object",
  10950. "propertyNames": {
  10951. "type": "string"
  10952. },
  10953. "additionalProperties": {}
  10954. }
  10955. ]
  10956. }
  10957. ]
  10958. }
  10959. },
  10960. "share": {
  10961. "description": "Control sharing behavior:'manual' allows manual sharing via commands, 'auto' enables automatic sharing, 'disabled' disables all sharing",
  10962. "type": "string",
  10963. "enum": ["manual", "auto", "disabled"]
  10964. },
  10965. "autoshare": {
  10966. "description": "@deprecated Use 'share' field instead. Share newly created sessions automatically",
  10967. "type": "boolean"
  10968. },
  10969. "autoupdate": {
  10970. "description": "Automatically update to the latest version. Set to true to auto-update, false to disable, or 'notify' to show update notifications",
  10971. "anyOf": [
  10972. {
  10973. "type": "boolean"
  10974. },
  10975. {
  10976. "type": "string",
  10977. "const": "notify"
  10978. }
  10979. ]
  10980. },
  10981. "disabled_providers": {
  10982. "description": "Disable providers that are loaded automatically",
  10983. "type": "array",
  10984. "items": {
  10985. "type": "string"
  10986. }
  10987. },
  10988. "enabled_providers": {
  10989. "description": "When set, ONLY these providers will be enabled. All other providers will be ignored",
  10990. "type": "array",
  10991. "items": {
  10992. "type": "string"
  10993. }
  10994. },
  10995. "model": {
  10996. "description": "Model to use in the format of provider/model, eg anthropic/claude-2",
  10997. "type": "string"
  10998. },
  10999. "small_model": {
  11000. "description": "Small model to use for tasks like title generation in the format of provider/model",
  11001. "type": "string"
  11002. },
  11003. "default_agent": {
  11004. "description": "Default agent to use when none is specified. Must be a primary agent. Falls back to 'build' if not set or if the specified agent is invalid.",
  11005. "type": "string"
  11006. },
  11007. "username": {
  11008. "description": "Custom username to display in conversations instead of system username",
  11009. "type": "string"
  11010. },
  11011. "mode": {
  11012. "description": "@deprecated Use `agent` field instead.",
  11013. "type": "object",
  11014. "properties": {
  11015. "build": {
  11016. "$ref": "#/components/schemas/AgentConfig"
  11017. },
  11018. "plan": {
  11019. "$ref": "#/components/schemas/AgentConfig"
  11020. }
  11021. },
  11022. "additionalProperties": {
  11023. "$ref": "#/components/schemas/AgentConfig"
  11024. }
  11025. },
  11026. "agent": {
  11027. "description": "Agent configuration, see https://opencode.ai/docs/agents",
  11028. "type": "object",
  11029. "properties": {
  11030. "plan": {
  11031. "$ref": "#/components/schemas/AgentConfig"
  11032. },
  11033. "build": {
  11034. "$ref": "#/components/schemas/AgentConfig"
  11035. },
  11036. "general": {
  11037. "$ref": "#/components/schemas/AgentConfig"
  11038. },
  11039. "explore": {
  11040. "$ref": "#/components/schemas/AgentConfig"
  11041. },
  11042. "title": {
  11043. "$ref": "#/components/schemas/AgentConfig"
  11044. },
  11045. "summary": {
  11046. "$ref": "#/components/schemas/AgentConfig"
  11047. },
  11048. "compaction": {
  11049. "$ref": "#/components/schemas/AgentConfig"
  11050. }
  11051. },
  11052. "additionalProperties": {
  11053. "$ref": "#/components/schemas/AgentConfig"
  11054. }
  11055. },
  11056. "provider": {
  11057. "description": "Custom provider configurations and model overrides",
  11058. "type": "object",
  11059. "propertyNames": {
  11060. "type": "string"
  11061. },
  11062. "additionalProperties": {
  11063. "$ref": "#/components/schemas/ProviderConfig"
  11064. }
  11065. },
  11066. "mcp": {
  11067. "description": "MCP (Model Context Protocol) server configurations",
  11068. "type": "object",
  11069. "propertyNames": {
  11070. "type": "string"
  11071. },
  11072. "additionalProperties": {
  11073. "anyOf": [
  11074. {
  11075. "anyOf": [
  11076. {
  11077. "$ref": "#/components/schemas/McpLocalConfig"
  11078. },
  11079. {
  11080. "$ref": "#/components/schemas/McpRemoteConfig"
  11081. }
  11082. ]
  11083. },
  11084. {
  11085. "type": "object",
  11086. "properties": {
  11087. "enabled": {
  11088. "type": "boolean"
  11089. }
  11090. },
  11091. "required": ["enabled"],
  11092. "additionalProperties": false
  11093. }
  11094. ]
  11095. }
  11096. },
  11097. "formatter": {
  11098. "anyOf": [
  11099. {
  11100. "type": "boolean",
  11101. "const": false
  11102. },
  11103. {
  11104. "type": "object",
  11105. "propertyNames": {
  11106. "type": "string"
  11107. },
  11108. "additionalProperties": {
  11109. "type": "object",
  11110. "properties": {
  11111. "disabled": {
  11112. "type": "boolean"
  11113. },
  11114. "command": {
  11115. "type": "array",
  11116. "items": {
  11117. "type": "string"
  11118. }
  11119. },
  11120. "environment": {
  11121. "type": "object",
  11122. "propertyNames": {
  11123. "type": "string"
  11124. },
  11125. "additionalProperties": {
  11126. "type": "string"
  11127. }
  11128. },
  11129. "extensions": {
  11130. "type": "array",
  11131. "items": {
  11132. "type": "string"
  11133. }
  11134. }
  11135. }
  11136. }
  11137. }
  11138. ]
  11139. },
  11140. "lsp": {
  11141. "anyOf": [
  11142. {
  11143. "type": "boolean",
  11144. "const": false
  11145. },
  11146. {
  11147. "type": "object",
  11148. "propertyNames": {
  11149. "type": "string"
  11150. },
  11151. "additionalProperties": {
  11152. "anyOf": [
  11153. {
  11154. "type": "object",
  11155. "properties": {
  11156. "disabled": {
  11157. "type": "boolean",
  11158. "const": true
  11159. }
  11160. },
  11161. "required": ["disabled"]
  11162. },
  11163. {
  11164. "type": "object",
  11165. "properties": {
  11166. "command": {
  11167. "type": "array",
  11168. "items": {
  11169. "type": "string"
  11170. }
  11171. },
  11172. "extensions": {
  11173. "type": "array",
  11174. "items": {
  11175. "type": "string"
  11176. }
  11177. },
  11178. "disabled": {
  11179. "type": "boolean"
  11180. },
  11181. "env": {
  11182. "type": "object",
  11183. "propertyNames": {
  11184. "type": "string"
  11185. },
  11186. "additionalProperties": {
  11187. "type": "string"
  11188. }
  11189. },
  11190. "initialization": {
  11191. "type": "object",
  11192. "propertyNames": {
  11193. "type": "string"
  11194. },
  11195. "additionalProperties": {}
  11196. }
  11197. },
  11198. "required": ["command"]
  11199. }
  11200. ]
  11201. }
  11202. }
  11203. ]
  11204. },
  11205. "instructions": {
  11206. "description": "Additional instruction files or patterns to include",
  11207. "type": "array",
  11208. "items": {
  11209. "type": "string"
  11210. }
  11211. },
  11212. "layout": {
  11213. "$ref": "#/components/schemas/LayoutConfig"
  11214. },
  11215. "permission": {
  11216. "$ref": "#/components/schemas/PermissionConfig"
  11217. },
  11218. "tools": {
  11219. "type": "object",
  11220. "propertyNames": {
  11221. "type": "string"
  11222. },
  11223. "additionalProperties": {
  11224. "type": "boolean"
  11225. }
  11226. },
  11227. "enterprise": {
  11228. "type": "object",
  11229. "properties": {
  11230. "url": {
  11231. "description": "Enterprise URL",
  11232. "type": "string"
  11233. }
  11234. }
  11235. },
  11236. "compaction": {
  11237. "type": "object",
  11238. "properties": {
  11239. "auto": {
  11240. "description": "Enable automatic compaction when context is full (default: true)",
  11241. "type": "boolean"
  11242. },
  11243. "prune": {
  11244. "description": "Enable pruning of old tool outputs (default: true)",
  11245. "type": "boolean"
  11246. },
  11247. "reserved": {
  11248. "description": "Token buffer for compaction. Leaves enough window to avoid overflow during compaction.",
  11249. "type": "integer",
  11250. "minimum": 0,
  11251. "maximum": 9007199254740991
  11252. }
  11253. }
  11254. },
  11255. "experimental": {
  11256. "type": "object",
  11257. "properties": {
  11258. "disable_paste_summary": {
  11259. "type": "boolean"
  11260. },
  11261. "batch_tool": {
  11262. "description": "Enable the batch tool",
  11263. "type": "boolean"
  11264. },
  11265. "openTelemetry": {
  11266. "description": "Enable OpenTelemetry spans for AI SDK calls (using the 'experimental_telemetry' flag)",
  11267. "type": "boolean"
  11268. },
  11269. "primary_tools": {
  11270. "description": "Tools that should only be available to primary agents.",
  11271. "type": "array",
  11272. "items": {
  11273. "type": "string"
  11274. }
  11275. },
  11276. "continue_loop_on_deny": {
  11277. "description": "Continue the agent loop when a tool call is denied",
  11278. "type": "boolean"
  11279. },
  11280. "mcp_timeout": {
  11281. "description": "Timeout in milliseconds for model context protocol (MCP) requests",
  11282. "type": "integer",
  11283. "exclusiveMinimum": 0,
  11284. "maximum": 9007199254740991
  11285. }
  11286. }
  11287. }
  11288. },
  11289. "additionalProperties": false
  11290. },
  11291. "BadRequestError": {
  11292. "type": "object",
  11293. "properties": {
  11294. "data": {},
  11295. "errors": {
  11296. "type": "array",
  11297. "items": {
  11298. "type": "object",
  11299. "propertyNames": {
  11300. "type": "string"
  11301. },
  11302. "additionalProperties": {}
  11303. }
  11304. },
  11305. "success": {
  11306. "type": "boolean",
  11307. "const": false
  11308. }
  11309. },
  11310. "required": ["data", "errors", "success"]
  11311. },
  11312. "OAuth": {
  11313. "type": "object",
  11314. "properties": {
  11315. "type": {
  11316. "type": "string",
  11317. "const": "oauth"
  11318. },
  11319. "refresh": {
  11320. "type": "string"
  11321. },
  11322. "access": {
  11323. "type": "string"
  11324. },
  11325. "expires": {
  11326. "type": "number"
  11327. },
  11328. "accountId": {
  11329. "type": "string"
  11330. },
  11331. "enterpriseUrl": {
  11332. "type": "string"
  11333. }
  11334. },
  11335. "required": ["type", "refresh", "access", "expires"]
  11336. },
  11337. "ApiAuth": {
  11338. "type": "object",
  11339. "properties": {
  11340. "type": {
  11341. "type": "string",
  11342. "const": "api"
  11343. },
  11344. "key": {
  11345. "type": "string"
  11346. }
  11347. },
  11348. "required": ["type", "key"]
  11349. },
  11350. "WellKnownAuth": {
  11351. "type": "object",
  11352. "properties": {
  11353. "type": {
  11354. "type": "string",
  11355. "const": "wellknown"
  11356. },
  11357. "key": {
  11358. "type": "string"
  11359. },
  11360. "token": {
  11361. "type": "string"
  11362. }
  11363. },
  11364. "required": ["type", "key", "token"]
  11365. },
  11366. "Auth": {
  11367. "anyOf": [
  11368. {
  11369. "$ref": "#/components/schemas/OAuth"
  11370. },
  11371. {
  11372. "$ref": "#/components/schemas/ApiAuth"
  11373. },
  11374. {
  11375. "$ref": "#/components/schemas/WellKnownAuth"
  11376. }
  11377. ]
  11378. },
  11379. "NotFoundError": {
  11380. "type": "object",
  11381. "properties": {
  11382. "name": {
  11383. "type": "string",
  11384. "const": "NotFoundError"
  11385. },
  11386. "data": {
  11387. "type": "object",
  11388. "properties": {
  11389. "message": {
  11390. "type": "string"
  11391. }
  11392. },
  11393. "required": ["message"]
  11394. }
  11395. },
  11396. "required": ["name", "data"]
  11397. },
  11398. "Model": {
  11399. "type": "object",
  11400. "properties": {
  11401. "id": {
  11402. "type": "string"
  11403. },
  11404. "providerID": {
  11405. "type": "string"
  11406. },
  11407. "api": {
  11408. "type": "object",
  11409. "properties": {
  11410. "id": {
  11411. "type": "string"
  11412. },
  11413. "url": {
  11414. "type": "string"
  11415. },
  11416. "npm": {
  11417. "type": "string"
  11418. }
  11419. },
  11420. "required": ["id", "url", "npm"]
  11421. },
  11422. "name": {
  11423. "type": "string"
  11424. },
  11425. "family": {
  11426. "type": "string"
  11427. },
  11428. "capabilities": {
  11429. "type": "object",
  11430. "properties": {
  11431. "temperature": {
  11432. "type": "boolean"
  11433. },
  11434. "reasoning": {
  11435. "type": "boolean"
  11436. },
  11437. "attachment": {
  11438. "type": "boolean"
  11439. },
  11440. "toolcall": {
  11441. "type": "boolean"
  11442. },
  11443. "input": {
  11444. "type": "object",
  11445. "properties": {
  11446. "text": {
  11447. "type": "boolean"
  11448. },
  11449. "audio": {
  11450. "type": "boolean"
  11451. },
  11452. "image": {
  11453. "type": "boolean"
  11454. },
  11455. "video": {
  11456. "type": "boolean"
  11457. },
  11458. "pdf": {
  11459. "type": "boolean"
  11460. }
  11461. },
  11462. "required": ["text", "audio", "image", "video", "pdf"]
  11463. },
  11464. "output": {
  11465. "type": "object",
  11466. "properties": {
  11467. "text": {
  11468. "type": "boolean"
  11469. },
  11470. "audio": {
  11471. "type": "boolean"
  11472. },
  11473. "image": {
  11474. "type": "boolean"
  11475. },
  11476. "video": {
  11477. "type": "boolean"
  11478. },
  11479. "pdf": {
  11480. "type": "boolean"
  11481. }
  11482. },
  11483. "required": ["text", "audio", "image", "video", "pdf"]
  11484. },
  11485. "interleaved": {
  11486. "anyOf": [
  11487. {
  11488. "type": "boolean"
  11489. },
  11490. {
  11491. "type": "object",
  11492. "properties": {
  11493. "field": {
  11494. "type": "string",
  11495. "enum": ["reasoning_content", "reasoning_details"]
  11496. }
  11497. },
  11498. "required": ["field"]
  11499. }
  11500. ]
  11501. }
  11502. },
  11503. "required": ["temperature", "reasoning", "attachment", "toolcall", "input", "output", "interleaved"]
  11504. },
  11505. "cost": {
  11506. "type": "object",
  11507. "properties": {
  11508. "input": {
  11509. "type": "number"
  11510. },
  11511. "output": {
  11512. "type": "number"
  11513. },
  11514. "cache": {
  11515. "type": "object",
  11516. "properties": {
  11517. "read": {
  11518. "type": "number"
  11519. },
  11520. "write": {
  11521. "type": "number"
  11522. }
  11523. },
  11524. "required": ["read", "write"]
  11525. },
  11526. "experimentalOver200K": {
  11527. "type": "object",
  11528. "properties": {
  11529. "input": {
  11530. "type": "number"
  11531. },
  11532. "output": {
  11533. "type": "number"
  11534. },
  11535. "cache": {
  11536. "type": "object",
  11537. "properties": {
  11538. "read": {
  11539. "type": "number"
  11540. },
  11541. "write": {
  11542. "type": "number"
  11543. }
  11544. },
  11545. "required": ["read", "write"]
  11546. }
  11547. },
  11548. "required": ["input", "output", "cache"]
  11549. }
  11550. },
  11551. "required": ["input", "output", "cache"]
  11552. },
  11553. "limit": {
  11554. "type": "object",
  11555. "properties": {
  11556. "context": {
  11557. "type": "number"
  11558. },
  11559. "input": {
  11560. "type": "number"
  11561. },
  11562. "output": {
  11563. "type": "number"
  11564. }
  11565. },
  11566. "required": ["context", "output"]
  11567. },
  11568. "status": {
  11569. "type": "string",
  11570. "enum": ["alpha", "beta", "deprecated", "active"]
  11571. },
  11572. "options": {
  11573. "type": "object",
  11574. "propertyNames": {
  11575. "type": "string"
  11576. },
  11577. "additionalProperties": {}
  11578. },
  11579. "headers": {
  11580. "type": "object",
  11581. "propertyNames": {
  11582. "type": "string"
  11583. },
  11584. "additionalProperties": {
  11585. "type": "string"
  11586. }
  11587. },
  11588. "release_date": {
  11589. "type": "string"
  11590. },
  11591. "variants": {
  11592. "type": "object",
  11593. "propertyNames": {
  11594. "type": "string"
  11595. },
  11596. "additionalProperties": {
  11597. "type": "object",
  11598. "propertyNames": {
  11599. "type": "string"
  11600. },
  11601. "additionalProperties": {}
  11602. }
  11603. }
  11604. },
  11605. "required": [
  11606. "id",
  11607. "providerID",
  11608. "api",
  11609. "name",
  11610. "capabilities",
  11611. "cost",
  11612. "limit",
  11613. "status",
  11614. "options",
  11615. "headers",
  11616. "release_date"
  11617. ]
  11618. },
  11619. "Provider": {
  11620. "type": "object",
  11621. "properties": {
  11622. "id": {
  11623. "type": "string"
  11624. },
  11625. "name": {
  11626. "type": "string"
  11627. },
  11628. "source": {
  11629. "type": "string",
  11630. "enum": ["env", "config", "custom", "api"]
  11631. },
  11632. "env": {
  11633. "type": "array",
  11634. "items": {
  11635. "type": "string"
  11636. }
  11637. },
  11638. "key": {
  11639. "type": "string"
  11640. },
  11641. "options": {
  11642. "type": "object",
  11643. "propertyNames": {
  11644. "type": "string"
  11645. },
  11646. "additionalProperties": {}
  11647. },
  11648. "models": {
  11649. "type": "object",
  11650. "propertyNames": {
  11651. "type": "string"
  11652. },
  11653. "additionalProperties": {
  11654. "$ref": "#/components/schemas/Model"
  11655. }
  11656. }
  11657. },
  11658. "required": ["id", "name", "source", "env", "options", "models"]
  11659. },
  11660. "ToolIDs": {
  11661. "type": "array",
  11662. "items": {
  11663. "type": "string"
  11664. }
  11665. },
  11666. "ToolListItem": {
  11667. "type": "object",
  11668. "properties": {
  11669. "id": {
  11670. "type": "string"
  11671. },
  11672. "description": {
  11673. "type": "string"
  11674. },
  11675. "parameters": {}
  11676. },
  11677. "required": ["id", "description", "parameters"]
  11678. },
  11679. "ToolList": {
  11680. "type": "array",
  11681. "items": {
  11682. "$ref": "#/components/schemas/ToolListItem"
  11683. }
  11684. },
  11685. "Workspace": {
  11686. "type": "object",
  11687. "properties": {
  11688. "id": {
  11689. "type": "string",
  11690. "pattern": "^wrk.*"
  11691. },
  11692. "type": {
  11693. "type": "string"
  11694. },
  11695. "branch": {
  11696. "anyOf": [
  11697. {
  11698. "type": "string"
  11699. },
  11700. {
  11701. "type": "null"
  11702. }
  11703. ]
  11704. },
  11705. "name": {
  11706. "anyOf": [
  11707. {
  11708. "type": "string"
  11709. },
  11710. {
  11711. "type": "null"
  11712. }
  11713. ]
  11714. },
  11715. "directory": {
  11716. "anyOf": [
  11717. {
  11718. "type": "string"
  11719. },
  11720. {
  11721. "type": "null"
  11722. }
  11723. ]
  11724. },
  11725. "extra": {
  11726. "anyOf": [
  11727. {},
  11728. {
  11729. "type": "null"
  11730. }
  11731. ]
  11732. },
  11733. "projectID": {
  11734. "type": "string"
  11735. }
  11736. },
  11737. "required": ["id", "type", "branch", "name", "directory", "extra", "projectID"]
  11738. },
  11739. "Worktree": {
  11740. "type": "object",
  11741. "properties": {
  11742. "name": {
  11743. "type": "string"
  11744. },
  11745. "branch": {
  11746. "type": "string"
  11747. },
  11748. "directory": {
  11749. "type": "string"
  11750. }
  11751. },
  11752. "required": ["name", "branch", "directory"]
  11753. },
  11754. "WorktreeCreateInput": {
  11755. "type": "object",
  11756. "properties": {
  11757. "name": {
  11758. "type": "string"
  11759. },
  11760. "startCommand": {
  11761. "description": "Additional startup script to run after the project's start command",
  11762. "type": "string"
  11763. }
  11764. }
  11765. },
  11766. "WorktreeRemoveInput": {
  11767. "type": "object",
  11768. "properties": {
  11769. "directory": {
  11770. "type": "string"
  11771. }
  11772. },
  11773. "required": ["directory"]
  11774. },
  11775. "WorktreeResetInput": {
  11776. "type": "object",
  11777. "properties": {
  11778. "directory": {
  11779. "type": "string"
  11780. }
  11781. },
  11782. "required": ["directory"]
  11783. },
  11784. "ProjectSummary": {
  11785. "type": "object",
  11786. "properties": {
  11787. "id": {
  11788. "type": "string"
  11789. },
  11790. "name": {
  11791. "type": "string"
  11792. },
  11793. "worktree": {
  11794. "type": "string"
  11795. }
  11796. },
  11797. "required": ["id", "worktree"]
  11798. },
  11799. "GlobalSession": {
  11800. "type": "object",
  11801. "properties": {
  11802. "id": {
  11803. "type": "string",
  11804. "pattern": "^ses.*"
  11805. },
  11806. "slug": {
  11807. "type": "string"
  11808. },
  11809. "projectID": {
  11810. "type": "string"
  11811. },
  11812. "workspaceID": {
  11813. "type": "string",
  11814. "pattern": "^wrk.*"
  11815. },
  11816. "directory": {
  11817. "type": "string"
  11818. },
  11819. "parentID": {
  11820. "type": "string",
  11821. "pattern": "^ses.*"
  11822. },
  11823. "summary": {
  11824. "type": "object",
  11825. "properties": {
  11826. "additions": {
  11827. "type": "number"
  11828. },
  11829. "deletions": {
  11830. "type": "number"
  11831. },
  11832. "files": {
  11833. "type": "number"
  11834. },
  11835. "diffs": {
  11836. "type": "array",
  11837. "items": {
  11838. "$ref": "#/components/schemas/FileDiff"
  11839. }
  11840. }
  11841. },
  11842. "required": ["additions", "deletions", "files"]
  11843. },
  11844. "share": {
  11845. "type": "object",
  11846. "properties": {
  11847. "url": {
  11848. "type": "string"
  11849. }
  11850. },
  11851. "required": ["url"]
  11852. },
  11853. "title": {
  11854. "type": "string"
  11855. },
  11856. "version": {
  11857. "type": "string"
  11858. },
  11859. "time": {
  11860. "type": "object",
  11861. "properties": {
  11862. "created": {
  11863. "type": "number"
  11864. },
  11865. "updated": {
  11866. "type": "number"
  11867. },
  11868. "compacting": {
  11869. "type": "number"
  11870. },
  11871. "archived": {
  11872. "type": "number"
  11873. }
  11874. },
  11875. "required": ["created", "updated"]
  11876. },
  11877. "permission": {
  11878. "$ref": "#/components/schemas/PermissionRuleset"
  11879. },
  11880. "revert": {
  11881. "type": "object",
  11882. "properties": {
  11883. "messageID": {
  11884. "type": "string",
  11885. "pattern": "^msg.*"
  11886. },
  11887. "partID": {
  11888. "type": "string",
  11889. "pattern": "^prt.*"
  11890. },
  11891. "snapshot": {
  11892. "type": "string"
  11893. },
  11894. "diff": {
  11895. "type": "string"
  11896. }
  11897. },
  11898. "required": ["messageID"]
  11899. },
  11900. "project": {
  11901. "anyOf": [
  11902. {
  11903. "$ref": "#/components/schemas/ProjectSummary"
  11904. },
  11905. {
  11906. "type": "null"
  11907. }
  11908. ]
  11909. }
  11910. },
  11911. "required": ["id", "slug", "projectID", "directory", "title", "version", "time", "project"]
  11912. },
  11913. "McpResource": {
  11914. "type": "object",
  11915. "properties": {
  11916. "name": {
  11917. "type": "string"
  11918. },
  11919. "uri": {
  11920. "type": "string"
  11921. },
  11922. "description": {
  11923. "type": "string"
  11924. },
  11925. "mimeType": {
  11926. "type": "string"
  11927. },
  11928. "client": {
  11929. "type": "string"
  11930. }
  11931. },
  11932. "required": ["name", "uri", "client"]
  11933. },
  11934. "TextPartInput": {
  11935. "type": "object",
  11936. "properties": {
  11937. "id": {
  11938. "type": "string",
  11939. "pattern": "^prt.*"
  11940. },
  11941. "type": {
  11942. "type": "string",
  11943. "const": "text"
  11944. },
  11945. "text": {
  11946. "type": "string"
  11947. },
  11948. "synthetic": {
  11949. "type": "boolean"
  11950. },
  11951. "ignored": {
  11952. "type": "boolean"
  11953. },
  11954. "time": {
  11955. "type": "object",
  11956. "properties": {
  11957. "start": {
  11958. "type": "number"
  11959. },
  11960. "end": {
  11961. "type": "number"
  11962. }
  11963. },
  11964. "required": ["start"]
  11965. },
  11966. "metadata": {
  11967. "type": "object",
  11968. "propertyNames": {
  11969. "type": "string"
  11970. },
  11971. "additionalProperties": {}
  11972. }
  11973. },
  11974. "required": ["type", "text"]
  11975. },
  11976. "FilePartInput": {
  11977. "type": "object",
  11978. "properties": {
  11979. "id": {
  11980. "type": "string",
  11981. "pattern": "^prt.*"
  11982. },
  11983. "type": {
  11984. "type": "string",
  11985. "const": "file"
  11986. },
  11987. "mime": {
  11988. "type": "string"
  11989. },
  11990. "filename": {
  11991. "type": "string"
  11992. },
  11993. "url": {
  11994. "type": "string"
  11995. },
  11996. "source": {
  11997. "$ref": "#/components/schemas/FilePartSource"
  11998. }
  11999. },
  12000. "required": ["type", "mime", "url"]
  12001. },
  12002. "AgentPartInput": {
  12003. "type": "object",
  12004. "properties": {
  12005. "id": {
  12006. "type": "string",
  12007. "pattern": "^prt.*"
  12008. },
  12009. "type": {
  12010. "type": "string",
  12011. "const": "agent"
  12012. },
  12013. "name": {
  12014. "type": "string"
  12015. },
  12016. "source": {
  12017. "type": "object",
  12018. "properties": {
  12019. "value": {
  12020. "type": "string"
  12021. },
  12022. "start": {
  12023. "type": "integer",
  12024. "minimum": -9007199254740991,
  12025. "maximum": 9007199254740991
  12026. },
  12027. "end": {
  12028. "type": "integer",
  12029. "minimum": -9007199254740991,
  12030. "maximum": 9007199254740991
  12031. }
  12032. },
  12033. "required": ["value", "start", "end"]
  12034. }
  12035. },
  12036. "required": ["type", "name"]
  12037. },
  12038. "SubtaskPartInput": {
  12039. "type": "object",
  12040. "properties": {
  12041. "id": {
  12042. "type": "string",
  12043. "pattern": "^prt.*"
  12044. },
  12045. "type": {
  12046. "type": "string",
  12047. "const": "subtask"
  12048. },
  12049. "prompt": {
  12050. "type": "string"
  12051. },
  12052. "description": {
  12053. "type": "string"
  12054. },
  12055. "agent": {
  12056. "type": "string"
  12057. },
  12058. "model": {
  12059. "type": "object",
  12060. "properties": {
  12061. "providerID": {
  12062. "type": "string"
  12063. },
  12064. "modelID": {
  12065. "type": "string"
  12066. }
  12067. },
  12068. "required": ["providerID", "modelID"]
  12069. },
  12070. "command": {
  12071. "type": "string"
  12072. }
  12073. },
  12074. "required": ["type", "prompt", "description", "agent"]
  12075. },
  12076. "ProviderAuthMethod": {
  12077. "type": "object",
  12078. "properties": {
  12079. "type": {
  12080. "anyOf": [
  12081. {
  12082. "type": "string",
  12083. "const": "oauth"
  12084. },
  12085. {
  12086. "type": "string",
  12087. "const": "api"
  12088. }
  12089. ]
  12090. },
  12091. "label": {
  12092. "type": "string"
  12093. },
  12094. "prompts": {
  12095. "type": "array",
  12096. "items": {
  12097. "anyOf": [
  12098. {
  12099. "type": "object",
  12100. "properties": {
  12101. "type": {
  12102. "type": "string",
  12103. "const": "text"
  12104. },
  12105. "key": {
  12106. "type": "string"
  12107. },
  12108. "message": {
  12109. "type": "string"
  12110. },
  12111. "placeholder": {
  12112. "type": "string"
  12113. },
  12114. "when": {
  12115. "type": "object",
  12116. "properties": {
  12117. "key": {
  12118. "type": "string"
  12119. },
  12120. "op": {
  12121. "anyOf": [
  12122. {
  12123. "type": "string",
  12124. "const": "eq"
  12125. },
  12126. {
  12127. "type": "string",
  12128. "const": "neq"
  12129. }
  12130. ]
  12131. },
  12132. "value": {
  12133. "type": "string"
  12134. }
  12135. },
  12136. "required": ["key", "op", "value"]
  12137. }
  12138. },
  12139. "required": ["type", "key", "message"]
  12140. },
  12141. {
  12142. "type": "object",
  12143. "properties": {
  12144. "type": {
  12145. "type": "string",
  12146. "const": "select"
  12147. },
  12148. "key": {
  12149. "type": "string"
  12150. },
  12151. "message": {
  12152. "type": "string"
  12153. },
  12154. "options": {
  12155. "type": "array",
  12156. "items": {
  12157. "type": "object",
  12158. "properties": {
  12159. "label": {
  12160. "type": "string"
  12161. },
  12162. "value": {
  12163. "type": "string"
  12164. },
  12165. "hint": {
  12166. "type": "string"
  12167. }
  12168. },
  12169. "required": ["label", "value"]
  12170. }
  12171. },
  12172. "when": {
  12173. "type": "object",
  12174. "properties": {
  12175. "key": {
  12176. "type": "string"
  12177. },
  12178. "op": {
  12179. "anyOf": [
  12180. {
  12181. "type": "string",
  12182. "const": "eq"
  12183. },
  12184. {
  12185. "type": "string",
  12186. "const": "neq"
  12187. }
  12188. ]
  12189. },
  12190. "value": {
  12191. "type": "string"
  12192. }
  12193. },
  12194. "required": ["key", "op", "value"]
  12195. }
  12196. },
  12197. "required": ["type", "key", "message", "options"]
  12198. }
  12199. ]
  12200. }
  12201. }
  12202. },
  12203. "required": ["type", "label"]
  12204. },
  12205. "ProviderAuthAuthorization": {
  12206. "type": "object",
  12207. "properties": {
  12208. "url": {
  12209. "type": "string"
  12210. },
  12211. "method": {
  12212. "anyOf": [
  12213. {
  12214. "type": "string",
  12215. "const": "auto"
  12216. },
  12217. {
  12218. "type": "string",
  12219. "const": "code"
  12220. }
  12221. ]
  12222. },
  12223. "instructions": {
  12224. "type": "string"
  12225. }
  12226. },
  12227. "required": ["url", "method", "instructions"]
  12228. },
  12229. "Symbol": {
  12230. "type": "object",
  12231. "properties": {
  12232. "name": {
  12233. "type": "string"
  12234. },
  12235. "kind": {
  12236. "type": "number"
  12237. },
  12238. "location": {
  12239. "type": "object",
  12240. "properties": {
  12241. "uri": {
  12242. "type": "string"
  12243. },
  12244. "range": {
  12245. "$ref": "#/components/schemas/Range"
  12246. }
  12247. },
  12248. "required": ["uri", "range"]
  12249. }
  12250. },
  12251. "required": ["name", "kind", "location"]
  12252. },
  12253. "FileNode": {
  12254. "type": "object",
  12255. "properties": {
  12256. "name": {
  12257. "type": "string"
  12258. },
  12259. "path": {
  12260. "type": "string"
  12261. },
  12262. "absolute": {
  12263. "type": "string"
  12264. },
  12265. "type": {
  12266. "type": "string",
  12267. "enum": ["file", "directory"]
  12268. },
  12269. "ignored": {
  12270. "type": "boolean"
  12271. }
  12272. },
  12273. "required": ["name", "path", "absolute", "type", "ignored"]
  12274. },
  12275. "FileContent": {
  12276. "type": "object",
  12277. "properties": {
  12278. "type": {
  12279. "type": "string",
  12280. "enum": ["text", "binary"]
  12281. },
  12282. "content": {
  12283. "type": "string"
  12284. },
  12285. "diff": {
  12286. "type": "string"
  12287. },
  12288. "patch": {
  12289. "type": "object",
  12290. "properties": {
  12291. "oldFileName": {
  12292. "type": "string"
  12293. },
  12294. "newFileName": {
  12295. "type": "string"
  12296. },
  12297. "oldHeader": {
  12298. "type": "string"
  12299. },
  12300. "newHeader": {
  12301. "type": "string"
  12302. },
  12303. "hunks": {
  12304. "type": "array",
  12305. "items": {
  12306. "type": "object",
  12307. "properties": {
  12308. "oldStart": {
  12309. "type": "number"
  12310. },
  12311. "oldLines": {
  12312. "type": "number"
  12313. },
  12314. "newStart": {
  12315. "type": "number"
  12316. },
  12317. "newLines": {
  12318. "type": "number"
  12319. },
  12320. "lines": {
  12321. "type": "array",
  12322. "items": {
  12323. "type": "string"
  12324. }
  12325. }
  12326. },
  12327. "required": ["oldStart", "oldLines", "newStart", "newLines", "lines"]
  12328. }
  12329. },
  12330. "index": {
  12331. "type": "string"
  12332. }
  12333. },
  12334. "required": ["oldFileName", "newFileName", "hunks"]
  12335. },
  12336. "encoding": {
  12337. "type": "string",
  12338. "const": "base64"
  12339. },
  12340. "mimeType": {
  12341. "type": "string"
  12342. }
  12343. },
  12344. "required": ["type", "content"]
  12345. },
  12346. "File": {
  12347. "type": "object",
  12348. "properties": {
  12349. "path": {
  12350. "type": "string"
  12351. },
  12352. "added": {
  12353. "type": "integer",
  12354. "minimum": -9007199254740991,
  12355. "maximum": 9007199254740991
  12356. },
  12357. "removed": {
  12358. "type": "integer",
  12359. "minimum": -9007199254740991,
  12360. "maximum": 9007199254740991
  12361. },
  12362. "status": {
  12363. "type": "string",
  12364. "enum": ["added", "deleted", "modified"]
  12365. }
  12366. },
  12367. "required": ["path", "added", "removed", "status"]
  12368. },
  12369. "MCPStatusConnected": {
  12370. "type": "object",
  12371. "properties": {
  12372. "status": {
  12373. "type": "string",
  12374. "const": "connected"
  12375. }
  12376. },
  12377. "required": ["status"]
  12378. },
  12379. "MCPStatusDisabled": {
  12380. "type": "object",
  12381. "properties": {
  12382. "status": {
  12383. "type": "string",
  12384. "const": "disabled"
  12385. }
  12386. },
  12387. "required": ["status"]
  12388. },
  12389. "MCPStatusFailed": {
  12390. "type": "object",
  12391. "properties": {
  12392. "status": {
  12393. "type": "string",
  12394. "const": "failed"
  12395. },
  12396. "error": {
  12397. "type": "string"
  12398. }
  12399. },
  12400. "required": ["status", "error"]
  12401. },
  12402. "MCPStatusNeedsAuth": {
  12403. "type": "object",
  12404. "properties": {
  12405. "status": {
  12406. "type": "string",
  12407. "const": "needs_auth"
  12408. }
  12409. },
  12410. "required": ["status"]
  12411. },
  12412. "MCPStatusNeedsClientRegistration": {
  12413. "type": "object",
  12414. "properties": {
  12415. "status": {
  12416. "type": "string",
  12417. "const": "needs_client_registration"
  12418. },
  12419. "error": {
  12420. "type": "string"
  12421. }
  12422. },
  12423. "required": ["status", "error"]
  12424. },
  12425. "MCPStatus": {
  12426. "anyOf": [
  12427. {
  12428. "$ref": "#/components/schemas/MCPStatusConnected"
  12429. },
  12430. {
  12431. "$ref": "#/components/schemas/MCPStatusDisabled"
  12432. },
  12433. {
  12434. "$ref": "#/components/schemas/MCPStatusFailed"
  12435. },
  12436. {
  12437. "$ref": "#/components/schemas/MCPStatusNeedsAuth"
  12438. },
  12439. {
  12440. "$ref": "#/components/schemas/MCPStatusNeedsClientRegistration"
  12441. }
  12442. ]
  12443. },
  12444. "Path": {
  12445. "type": "object",
  12446. "properties": {
  12447. "home": {
  12448. "type": "string"
  12449. },
  12450. "state": {
  12451. "type": "string"
  12452. },
  12453. "config": {
  12454. "type": "string"
  12455. },
  12456. "worktree": {
  12457. "type": "string"
  12458. },
  12459. "directory": {
  12460. "type": "string"
  12461. }
  12462. },
  12463. "required": ["home", "state", "config", "worktree", "directory"]
  12464. },
  12465. "VcsInfo": {
  12466. "type": "object",
  12467. "properties": {
  12468. "branch": {
  12469. "type": "string"
  12470. }
  12471. }
  12472. },
  12473. "Command": {
  12474. "type": "object",
  12475. "properties": {
  12476. "name": {
  12477. "type": "string"
  12478. },
  12479. "description": {
  12480. "type": "string"
  12481. },
  12482. "agent": {
  12483. "type": "string"
  12484. },
  12485. "model": {
  12486. "type": "string"
  12487. },
  12488. "source": {
  12489. "type": "string",
  12490. "enum": ["command", "mcp", "skill"]
  12491. },
  12492. "template": {
  12493. "anyOf": [
  12494. {
  12495. "type": "string"
  12496. },
  12497. {
  12498. "type": "string"
  12499. }
  12500. ]
  12501. },
  12502. "subtask": {
  12503. "type": "boolean"
  12504. },
  12505. "hints": {
  12506. "type": "array",
  12507. "items": {
  12508. "type": "string"
  12509. }
  12510. }
  12511. },
  12512. "required": ["name", "template", "hints"]
  12513. },
  12514. "Agent": {
  12515. "type": "object",
  12516. "properties": {
  12517. "name": {
  12518. "type": "string"
  12519. },
  12520. "description": {
  12521. "type": "string"
  12522. },
  12523. "mode": {
  12524. "type": "string",
  12525. "enum": ["subagent", "primary", "all"]
  12526. },
  12527. "native": {
  12528. "type": "boolean"
  12529. },
  12530. "hidden": {
  12531. "type": "boolean"
  12532. },
  12533. "topP": {
  12534. "type": "number"
  12535. },
  12536. "temperature": {
  12537. "type": "number"
  12538. },
  12539. "color": {
  12540. "type": "string"
  12541. },
  12542. "permission": {
  12543. "$ref": "#/components/schemas/PermissionRuleset"
  12544. },
  12545. "model": {
  12546. "type": "object",
  12547. "properties": {
  12548. "modelID": {
  12549. "type": "string"
  12550. },
  12551. "providerID": {
  12552. "type": "string"
  12553. }
  12554. },
  12555. "required": ["modelID", "providerID"]
  12556. },
  12557. "variant": {
  12558. "type": "string"
  12559. },
  12560. "prompt": {
  12561. "type": "string"
  12562. },
  12563. "options": {
  12564. "type": "object",
  12565. "propertyNames": {
  12566. "type": "string"
  12567. },
  12568. "additionalProperties": {}
  12569. },
  12570. "steps": {
  12571. "type": "integer",
  12572. "exclusiveMinimum": 0,
  12573. "maximum": 9007199254740991
  12574. }
  12575. },
  12576. "required": ["name", "mode", "permission", "options"]
  12577. },
  12578. "LSPStatus": {
  12579. "type": "object",
  12580. "properties": {
  12581. "id": {
  12582. "type": "string"
  12583. },
  12584. "name": {
  12585. "type": "string"
  12586. },
  12587. "root": {
  12588. "type": "string"
  12589. },
  12590. "status": {
  12591. "anyOf": [
  12592. {
  12593. "type": "string",
  12594. "const": "connected"
  12595. },
  12596. {
  12597. "type": "string",
  12598. "const": "error"
  12599. }
  12600. ]
  12601. }
  12602. },
  12603. "required": ["id", "name", "root", "status"]
  12604. },
  12605. "FormatterStatus": {
  12606. "type": "object",
  12607. "properties": {
  12608. "name": {
  12609. "type": "string"
  12610. },
  12611. "extensions": {
  12612. "type": "array",
  12613. "items": {
  12614. "type": "string"
  12615. }
  12616. },
  12617. "enabled": {
  12618. "type": "boolean"
  12619. }
  12620. },
  12621. "required": ["name", "extensions", "enabled"]
  12622. }
  12623. }
  12624. }
  12625. }