openapi.json 363 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407
  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/config": {
  70. "get": {
  71. "operationId": "global.config.get",
  72. "summary": "Get global configuration",
  73. "description": "Retrieve the current global OpenCode configuration settings and preferences.",
  74. "responses": {
  75. "200": {
  76. "description": "Get global config info",
  77. "content": {
  78. "application/json": {
  79. "schema": {
  80. "$ref": "#/components/schemas/Config"
  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.config.get({\n ...\n})"
  90. }
  91. ]
  92. },
  93. "patch": {
  94. "operationId": "global.config.update",
  95. "summary": "Update global configuration",
  96. "description": "Update global OpenCode configuration settings and preferences.",
  97. "responses": {
  98. "200": {
  99. "description": "Successfully updated global config",
  100. "content": {
  101. "application/json": {
  102. "schema": {
  103. "$ref": "#/components/schemas/Config"
  104. }
  105. }
  106. }
  107. },
  108. "400": {
  109. "description": "Bad request",
  110. "content": {
  111. "application/json": {
  112. "schema": {
  113. "$ref": "#/components/schemas/BadRequestError"
  114. }
  115. }
  116. }
  117. }
  118. },
  119. "requestBody": {
  120. "content": {
  121. "application/json": {
  122. "schema": {
  123. "$ref": "#/components/schemas/Config"
  124. }
  125. }
  126. }
  127. },
  128. "x-codeSamples": [
  129. {
  130. "lang": "js",
  131. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.config.update({\n ...\n})"
  132. }
  133. ]
  134. }
  135. },
  136. "/global/dispose": {
  137. "post": {
  138. "operationId": "global.dispose",
  139. "summary": "Dispose instance",
  140. "description": "Clean up and dispose all OpenCode instances, releasing all resources.",
  141. "responses": {
  142. "200": {
  143. "description": "Global disposed",
  144. "content": {
  145. "application/json": {
  146. "schema": {
  147. "type": "boolean"
  148. }
  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.dispose({\n ...\n})"
  157. }
  158. ]
  159. }
  160. },
  161. "/global/upgrade": {
  162. "post": {
  163. "operationId": "global.upgrade",
  164. "summary": "Upgrade opencode",
  165. "description": "Upgrade opencode to the specified version or latest if not specified.",
  166. "responses": {
  167. "200": {
  168. "description": "Upgrade result",
  169. "content": {
  170. "application/json": {
  171. "schema": {
  172. "anyOf": [
  173. {
  174. "type": "object",
  175. "properties": {
  176. "success": {
  177. "type": "boolean",
  178. "const": true
  179. },
  180. "version": {
  181. "type": "string"
  182. }
  183. },
  184. "required": ["success", "version"]
  185. },
  186. {
  187. "type": "object",
  188. "properties": {
  189. "success": {
  190. "type": "boolean",
  191. "const": false
  192. },
  193. "error": {
  194. "type": "string"
  195. }
  196. },
  197. "required": ["success", "error"]
  198. }
  199. ]
  200. }
  201. }
  202. }
  203. },
  204. "400": {
  205. "description": "Bad request",
  206. "content": {
  207. "application/json": {
  208. "schema": {
  209. "$ref": "#/components/schemas/BadRequestError"
  210. }
  211. }
  212. }
  213. }
  214. },
  215. "requestBody": {
  216. "content": {
  217. "application/json": {
  218. "schema": {
  219. "type": "object",
  220. "properties": {
  221. "target": {
  222. "type": "string"
  223. }
  224. }
  225. }
  226. }
  227. }
  228. },
  229. "x-codeSamples": [
  230. {
  231. "lang": "js",
  232. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.upgrade({\n ...\n})"
  233. }
  234. ]
  235. }
  236. },
  237. "/auth/{providerID}": {
  238. "put": {
  239. "operationId": "auth.set",
  240. "summary": "Set auth credentials",
  241. "description": "Set authentication credentials",
  242. "responses": {
  243. "200": {
  244. "description": "Successfully set authentication credentials",
  245. "content": {
  246. "application/json": {
  247. "schema": {
  248. "type": "boolean"
  249. }
  250. }
  251. }
  252. },
  253. "400": {
  254. "description": "Bad request",
  255. "content": {
  256. "application/json": {
  257. "schema": {
  258. "$ref": "#/components/schemas/BadRequestError"
  259. }
  260. }
  261. }
  262. }
  263. },
  264. "parameters": [
  265. {
  266. "in": "path",
  267. "name": "providerID",
  268. "schema": {
  269. "type": "string"
  270. },
  271. "required": true
  272. }
  273. ],
  274. "requestBody": {
  275. "content": {
  276. "application/json": {
  277. "schema": {
  278. "$ref": "#/components/schemas/Auth"
  279. }
  280. }
  281. }
  282. },
  283. "x-codeSamples": [
  284. {
  285. "lang": "js",
  286. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.auth.set({\n ...\n})"
  287. }
  288. ]
  289. },
  290. "delete": {
  291. "operationId": "auth.remove",
  292. "summary": "Remove auth credentials",
  293. "description": "Remove authentication credentials",
  294. "responses": {
  295. "200": {
  296. "description": "Successfully removed authentication credentials",
  297. "content": {
  298. "application/json": {
  299. "schema": {
  300. "type": "boolean"
  301. }
  302. }
  303. }
  304. },
  305. "400": {
  306. "description": "Bad request",
  307. "content": {
  308. "application/json": {
  309. "schema": {
  310. "$ref": "#/components/schemas/BadRequestError"
  311. }
  312. }
  313. }
  314. }
  315. },
  316. "parameters": [
  317. {
  318. "in": "path",
  319. "name": "providerID",
  320. "schema": {
  321. "type": "string"
  322. },
  323. "required": true
  324. }
  325. ],
  326. "x-codeSamples": [
  327. {
  328. "lang": "js",
  329. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.auth.remove({\n ...\n})"
  330. }
  331. ]
  332. }
  333. },
  334. "/log": {
  335. "post": {
  336. "operationId": "app.log",
  337. "parameters": [
  338. {
  339. "in": "query",
  340. "name": "directory",
  341. "schema": {
  342. "type": "string"
  343. }
  344. },
  345. {
  346. "in": "query",
  347. "name": "workspace",
  348. "schema": {
  349. "type": "string"
  350. }
  351. }
  352. ],
  353. "summary": "Write log",
  354. "description": "Write a log entry to the server logs with specified level and metadata.",
  355. "responses": {
  356. "200": {
  357. "description": "Log entry written successfully",
  358. "content": {
  359. "application/json": {
  360. "schema": {
  361. "type": "boolean"
  362. }
  363. }
  364. }
  365. },
  366. "400": {
  367. "description": "Bad request",
  368. "content": {
  369. "application/json": {
  370. "schema": {
  371. "$ref": "#/components/schemas/BadRequestError"
  372. }
  373. }
  374. }
  375. }
  376. },
  377. "requestBody": {
  378. "content": {
  379. "application/json": {
  380. "schema": {
  381. "type": "object",
  382. "properties": {
  383. "service": {
  384. "description": "Service name for the log entry",
  385. "type": "string"
  386. },
  387. "level": {
  388. "description": "Log level",
  389. "type": "string",
  390. "enum": ["debug", "info", "error", "warn"]
  391. },
  392. "message": {
  393. "description": "Log message",
  394. "type": "string"
  395. },
  396. "extra": {
  397. "description": "Additional metadata for the log entry",
  398. "type": "object",
  399. "propertyNames": {
  400. "type": "string"
  401. },
  402. "additionalProperties": {}
  403. }
  404. },
  405. "required": ["service", "level", "message"]
  406. }
  407. }
  408. }
  409. },
  410. "x-codeSamples": [
  411. {
  412. "lang": "js",
  413. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.app.log({\n ...\n})"
  414. }
  415. ]
  416. }
  417. },
  418. "/experimental/workspace/adaptor": {
  419. "get": {
  420. "operationId": "experimental.workspace.adaptor.list",
  421. "parameters": [
  422. {
  423. "in": "query",
  424. "name": "directory",
  425. "schema": {
  426. "type": "string"
  427. }
  428. },
  429. {
  430. "in": "query",
  431. "name": "workspace",
  432. "schema": {
  433. "type": "string"
  434. }
  435. }
  436. ],
  437. "summary": "List workspace adaptors",
  438. "description": "List all available workspace adaptors for the current project.",
  439. "responses": {
  440. "200": {
  441. "description": "Workspace adaptors",
  442. "content": {
  443. "application/json": {
  444. "schema": {
  445. "type": "array",
  446. "items": {
  447. "type": "object",
  448. "properties": {
  449. "type": {
  450. "type": "string"
  451. },
  452. "name": {
  453. "type": "string"
  454. },
  455. "description": {
  456. "type": "string"
  457. }
  458. },
  459. "required": ["type", "name", "description"]
  460. }
  461. }
  462. }
  463. }
  464. }
  465. },
  466. "x-codeSamples": [
  467. {
  468. "lang": "js",
  469. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.adaptor.list({\n ...\n})"
  470. }
  471. ]
  472. }
  473. },
  474. "/experimental/workspace": {
  475. "post": {
  476. "operationId": "experimental.workspace.create",
  477. "parameters": [
  478. {
  479. "in": "query",
  480. "name": "directory",
  481. "schema": {
  482. "type": "string"
  483. }
  484. },
  485. {
  486. "in": "query",
  487. "name": "workspace",
  488. "schema": {
  489. "type": "string"
  490. }
  491. }
  492. ],
  493. "summary": "Create workspace",
  494. "description": "Create a workspace for the current project.",
  495. "responses": {
  496. "200": {
  497. "description": "Workspace created",
  498. "content": {
  499. "application/json": {
  500. "schema": {
  501. "$ref": "#/components/schemas/Workspace"
  502. }
  503. }
  504. }
  505. },
  506. "400": {
  507. "description": "Bad request",
  508. "content": {
  509. "application/json": {
  510. "schema": {
  511. "$ref": "#/components/schemas/BadRequestError"
  512. }
  513. }
  514. }
  515. }
  516. },
  517. "requestBody": {
  518. "content": {
  519. "application/json": {
  520. "schema": {
  521. "type": "object",
  522. "properties": {
  523. "id": {
  524. "type": "string",
  525. "pattern": "^wrk.*"
  526. },
  527. "type": {
  528. "type": "string"
  529. },
  530. "branch": {
  531. "anyOf": [
  532. {
  533. "type": "string"
  534. },
  535. {
  536. "type": "null"
  537. }
  538. ]
  539. },
  540. "extra": {
  541. "anyOf": [
  542. {},
  543. {
  544. "type": "null"
  545. }
  546. ]
  547. }
  548. },
  549. "required": ["type", "branch", "extra"]
  550. }
  551. }
  552. }
  553. },
  554. "x-codeSamples": [
  555. {
  556. "lang": "js",
  557. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.create({\n ...\n})"
  558. }
  559. ]
  560. },
  561. "get": {
  562. "operationId": "experimental.workspace.list",
  563. "parameters": [
  564. {
  565. "in": "query",
  566. "name": "directory",
  567. "schema": {
  568. "type": "string"
  569. }
  570. },
  571. {
  572. "in": "query",
  573. "name": "workspace",
  574. "schema": {
  575. "type": "string"
  576. }
  577. }
  578. ],
  579. "summary": "List workspaces",
  580. "description": "List all workspaces.",
  581. "responses": {
  582. "200": {
  583. "description": "Workspaces",
  584. "content": {
  585. "application/json": {
  586. "schema": {
  587. "type": "array",
  588. "items": {
  589. "$ref": "#/components/schemas/Workspace"
  590. }
  591. }
  592. }
  593. }
  594. }
  595. },
  596. "x-codeSamples": [
  597. {
  598. "lang": "js",
  599. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.list({\n ...\n})"
  600. }
  601. ]
  602. }
  603. },
  604. "/experimental/workspace/status": {
  605. "get": {
  606. "operationId": "experimental.workspace.status",
  607. "parameters": [
  608. {
  609. "in": "query",
  610. "name": "directory",
  611. "schema": {
  612. "type": "string"
  613. }
  614. },
  615. {
  616. "in": "query",
  617. "name": "workspace",
  618. "schema": {
  619. "type": "string"
  620. }
  621. }
  622. ],
  623. "summary": "Workspace status",
  624. "description": "Get connection status for workspaces in the current project.",
  625. "responses": {
  626. "200": {
  627. "description": "Workspace status",
  628. "content": {
  629. "application/json": {
  630. "schema": {
  631. "type": "array",
  632. "items": {
  633. "type": "object",
  634. "properties": {
  635. "workspaceID": {
  636. "type": "string",
  637. "pattern": "^wrk.*"
  638. },
  639. "status": {
  640. "type": "string",
  641. "enum": ["connected", "connecting", "disconnected", "error"]
  642. }
  643. },
  644. "required": ["workspaceID", "status"]
  645. }
  646. }
  647. }
  648. }
  649. }
  650. },
  651. "x-codeSamples": [
  652. {
  653. "lang": "js",
  654. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.status({\n ...\n})"
  655. }
  656. ]
  657. }
  658. },
  659. "/experimental/workspace/{id}": {
  660. "delete": {
  661. "operationId": "experimental.workspace.remove",
  662. "parameters": [
  663. {
  664. "in": "query",
  665. "name": "directory",
  666. "schema": {
  667. "type": "string"
  668. }
  669. },
  670. {
  671. "in": "query",
  672. "name": "workspace",
  673. "schema": {
  674. "type": "string"
  675. }
  676. },
  677. {
  678. "in": "path",
  679. "name": "id",
  680. "schema": {
  681. "type": "string",
  682. "pattern": "^wrk.*"
  683. },
  684. "required": true
  685. }
  686. ],
  687. "summary": "Remove workspace",
  688. "description": "Remove an existing workspace.",
  689. "responses": {
  690. "200": {
  691. "description": "Workspace removed",
  692. "content": {
  693. "application/json": {
  694. "schema": {
  695. "$ref": "#/components/schemas/Workspace"
  696. }
  697. }
  698. }
  699. },
  700. "400": {
  701. "description": "Bad request",
  702. "content": {
  703. "application/json": {
  704. "schema": {
  705. "$ref": "#/components/schemas/BadRequestError"
  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.experimental.workspace.remove({\n ...\n})"
  715. }
  716. ]
  717. }
  718. },
  719. "/experimental/workspace/{id}/session-restore": {
  720. "post": {
  721. "operationId": "experimental.workspace.sessionRestore",
  722. "parameters": [
  723. {
  724. "in": "query",
  725. "name": "directory",
  726. "schema": {
  727. "type": "string"
  728. }
  729. },
  730. {
  731. "in": "query",
  732. "name": "workspace",
  733. "schema": {
  734. "type": "string"
  735. }
  736. },
  737. {
  738. "in": "path",
  739. "name": "id",
  740. "schema": {
  741. "type": "string",
  742. "pattern": "^wrk.*"
  743. },
  744. "required": true
  745. }
  746. ],
  747. "summary": "Restore session into workspace",
  748. "description": "Replay a session's sync events into the target workspace in batches.",
  749. "responses": {
  750. "200": {
  751. "description": "Session replay started",
  752. "content": {
  753. "application/json": {
  754. "schema": {
  755. "type": "object",
  756. "properties": {
  757. "total": {
  758. "type": "integer",
  759. "minimum": 0,
  760. "maximum": 9007199254740991
  761. }
  762. },
  763. "required": ["total"]
  764. }
  765. }
  766. }
  767. },
  768. "400": {
  769. "description": "Bad request",
  770. "content": {
  771. "application/json": {
  772. "schema": {
  773. "$ref": "#/components/schemas/BadRequestError"
  774. }
  775. }
  776. }
  777. }
  778. },
  779. "requestBody": {
  780. "content": {
  781. "application/json": {
  782. "schema": {
  783. "type": "object",
  784. "properties": {
  785. "sessionID": {
  786. "type": "string",
  787. "pattern": "^ses.*"
  788. }
  789. },
  790. "required": ["sessionID"]
  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.experimental.workspace.sessionRestore({\n ...\n})"
  799. }
  800. ]
  801. }
  802. },
  803. "/project": {
  804. "get": {
  805. "operationId": "project.list",
  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. "summary": "List all projects",
  823. "description": "Get a list of projects that have been opened with OpenCode.",
  824. "responses": {
  825. "200": {
  826. "description": "List of projects",
  827. "content": {
  828. "application/json": {
  829. "schema": {
  830. "type": "array",
  831. "items": {
  832. "$ref": "#/components/schemas/Project"
  833. }
  834. }
  835. }
  836. }
  837. }
  838. },
  839. "x-codeSamples": [
  840. {
  841. "lang": "js",
  842. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.list({\n ...\n})"
  843. }
  844. ]
  845. }
  846. },
  847. "/project/current": {
  848. "get": {
  849. "operationId": "project.current",
  850. "parameters": [
  851. {
  852. "in": "query",
  853. "name": "directory",
  854. "schema": {
  855. "type": "string"
  856. }
  857. },
  858. {
  859. "in": "query",
  860. "name": "workspace",
  861. "schema": {
  862. "type": "string"
  863. }
  864. }
  865. ],
  866. "summary": "Get current project",
  867. "description": "Retrieve the currently active project that OpenCode is working with.",
  868. "responses": {
  869. "200": {
  870. "description": "Current project information",
  871. "content": {
  872. "application/json": {
  873. "schema": {
  874. "$ref": "#/components/schemas/Project"
  875. }
  876. }
  877. }
  878. }
  879. },
  880. "x-codeSamples": [
  881. {
  882. "lang": "js",
  883. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.current({\n ...\n})"
  884. }
  885. ]
  886. }
  887. },
  888. "/project/git/init": {
  889. "post": {
  890. "operationId": "project.initGit",
  891. "parameters": [
  892. {
  893. "in": "query",
  894. "name": "directory",
  895. "schema": {
  896. "type": "string"
  897. }
  898. },
  899. {
  900. "in": "query",
  901. "name": "workspace",
  902. "schema": {
  903. "type": "string"
  904. }
  905. }
  906. ],
  907. "summary": "Initialize git repository",
  908. "description": "Create a git repository for the current project and return the refreshed project info.",
  909. "responses": {
  910. "200": {
  911. "description": "Project information after git initialization",
  912. "content": {
  913. "application/json": {
  914. "schema": {
  915. "$ref": "#/components/schemas/Project"
  916. }
  917. }
  918. }
  919. }
  920. },
  921. "x-codeSamples": [
  922. {
  923. "lang": "js",
  924. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.initGit({\n ...\n})"
  925. }
  926. ]
  927. }
  928. },
  929. "/project/{projectID}": {
  930. "patch": {
  931. "operationId": "project.update",
  932. "parameters": [
  933. {
  934. "in": "query",
  935. "name": "directory",
  936. "schema": {
  937. "type": "string"
  938. }
  939. },
  940. {
  941. "in": "query",
  942. "name": "workspace",
  943. "schema": {
  944. "type": "string"
  945. }
  946. },
  947. {
  948. "in": "path",
  949. "name": "projectID",
  950. "schema": {
  951. "type": "string"
  952. },
  953. "required": true
  954. }
  955. ],
  956. "summary": "Update project",
  957. "description": "Update project properties such as name, icon, and commands.",
  958. "responses": {
  959. "200": {
  960. "description": "Updated project information",
  961. "content": {
  962. "application/json": {
  963. "schema": {
  964. "$ref": "#/components/schemas/Project"
  965. }
  966. }
  967. }
  968. },
  969. "400": {
  970. "description": "Bad request",
  971. "content": {
  972. "application/json": {
  973. "schema": {
  974. "$ref": "#/components/schemas/BadRequestError"
  975. }
  976. }
  977. }
  978. },
  979. "404": {
  980. "description": "Not found",
  981. "content": {
  982. "application/json": {
  983. "schema": {
  984. "$ref": "#/components/schemas/NotFoundError"
  985. }
  986. }
  987. }
  988. }
  989. },
  990. "requestBody": {
  991. "content": {
  992. "application/json": {
  993. "schema": {
  994. "type": "object",
  995. "properties": {
  996. "name": {
  997. "type": "string"
  998. },
  999. "icon": {
  1000. "type": "object",
  1001. "properties": {
  1002. "url": {
  1003. "type": "string"
  1004. },
  1005. "override": {
  1006. "type": "string"
  1007. },
  1008. "color": {
  1009. "type": "string"
  1010. }
  1011. }
  1012. },
  1013. "commands": {
  1014. "type": "object",
  1015. "properties": {
  1016. "start": {
  1017. "description": "Startup script to run when creating a new workspace (worktree)",
  1018. "type": "string"
  1019. }
  1020. }
  1021. }
  1022. }
  1023. }
  1024. }
  1025. }
  1026. },
  1027. "x-codeSamples": [
  1028. {
  1029. "lang": "js",
  1030. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.update({\n ...\n})"
  1031. }
  1032. ]
  1033. }
  1034. },
  1035. "/pty": {
  1036. "get": {
  1037. "operationId": "pty.list",
  1038. "parameters": [
  1039. {
  1040. "in": "query",
  1041. "name": "directory",
  1042. "schema": {
  1043. "type": "string"
  1044. }
  1045. },
  1046. {
  1047. "in": "query",
  1048. "name": "workspace",
  1049. "schema": {
  1050. "type": "string"
  1051. }
  1052. }
  1053. ],
  1054. "summary": "List PTY sessions",
  1055. "description": "Get a list of all active pseudo-terminal (PTY) sessions managed by OpenCode.",
  1056. "responses": {
  1057. "200": {
  1058. "description": "List of sessions",
  1059. "content": {
  1060. "application/json": {
  1061. "schema": {
  1062. "type": "array",
  1063. "items": {
  1064. "$ref": "#/components/schemas/Pty"
  1065. }
  1066. }
  1067. }
  1068. }
  1069. }
  1070. },
  1071. "x-codeSamples": [
  1072. {
  1073. "lang": "js",
  1074. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.list({\n ...\n})"
  1075. }
  1076. ]
  1077. },
  1078. "post": {
  1079. "operationId": "pty.create",
  1080. "parameters": [
  1081. {
  1082. "in": "query",
  1083. "name": "directory",
  1084. "schema": {
  1085. "type": "string"
  1086. }
  1087. },
  1088. {
  1089. "in": "query",
  1090. "name": "workspace",
  1091. "schema": {
  1092. "type": "string"
  1093. }
  1094. }
  1095. ],
  1096. "summary": "Create PTY session",
  1097. "description": "Create a new pseudo-terminal (PTY) session for running shell commands and processes.",
  1098. "responses": {
  1099. "200": {
  1100. "description": "Created session",
  1101. "content": {
  1102. "application/json": {
  1103. "schema": {
  1104. "$ref": "#/components/schemas/Pty"
  1105. }
  1106. }
  1107. }
  1108. },
  1109. "400": {
  1110. "description": "Bad request",
  1111. "content": {
  1112. "application/json": {
  1113. "schema": {
  1114. "$ref": "#/components/schemas/BadRequestError"
  1115. }
  1116. }
  1117. }
  1118. }
  1119. },
  1120. "requestBody": {
  1121. "content": {
  1122. "application/json": {
  1123. "schema": {
  1124. "type": "object",
  1125. "properties": {
  1126. "command": {
  1127. "type": "string"
  1128. },
  1129. "args": {
  1130. "type": "array",
  1131. "items": {
  1132. "type": "string"
  1133. }
  1134. },
  1135. "cwd": {
  1136. "type": "string"
  1137. },
  1138. "title": {
  1139. "type": "string"
  1140. },
  1141. "env": {
  1142. "type": "object",
  1143. "propertyNames": {
  1144. "type": "string"
  1145. },
  1146. "additionalProperties": {
  1147. "type": "string"
  1148. }
  1149. }
  1150. }
  1151. }
  1152. }
  1153. }
  1154. },
  1155. "x-codeSamples": [
  1156. {
  1157. "lang": "js",
  1158. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.create({\n ...\n})"
  1159. }
  1160. ]
  1161. }
  1162. },
  1163. "/pty/{ptyID}": {
  1164. "get": {
  1165. "operationId": "pty.get",
  1166. "parameters": [
  1167. {
  1168. "in": "query",
  1169. "name": "directory",
  1170. "schema": {
  1171. "type": "string"
  1172. }
  1173. },
  1174. {
  1175. "in": "query",
  1176. "name": "workspace",
  1177. "schema": {
  1178. "type": "string"
  1179. }
  1180. },
  1181. {
  1182. "in": "path",
  1183. "name": "ptyID",
  1184. "schema": {
  1185. "type": "string",
  1186. "pattern": "^pty.*"
  1187. },
  1188. "required": true
  1189. }
  1190. ],
  1191. "summary": "Get PTY session",
  1192. "description": "Retrieve detailed information about a specific pseudo-terminal (PTY) session.",
  1193. "responses": {
  1194. "200": {
  1195. "description": "Session info",
  1196. "content": {
  1197. "application/json": {
  1198. "schema": {
  1199. "$ref": "#/components/schemas/Pty"
  1200. }
  1201. }
  1202. }
  1203. },
  1204. "404": {
  1205. "description": "Not found",
  1206. "content": {
  1207. "application/json": {
  1208. "schema": {
  1209. "$ref": "#/components/schemas/NotFoundError"
  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.pty.get({\n ...\n})"
  1219. }
  1220. ]
  1221. },
  1222. "put": {
  1223. "operationId": "pty.update",
  1224. "parameters": [
  1225. {
  1226. "in": "query",
  1227. "name": "directory",
  1228. "schema": {
  1229. "type": "string"
  1230. }
  1231. },
  1232. {
  1233. "in": "query",
  1234. "name": "workspace",
  1235. "schema": {
  1236. "type": "string"
  1237. }
  1238. },
  1239. {
  1240. "in": "path",
  1241. "name": "ptyID",
  1242. "schema": {
  1243. "type": "string",
  1244. "pattern": "^pty.*"
  1245. },
  1246. "required": true
  1247. }
  1248. ],
  1249. "summary": "Update PTY session",
  1250. "description": "Update properties of an existing pseudo-terminal (PTY) session.",
  1251. "responses": {
  1252. "200": {
  1253. "description": "Updated session",
  1254. "content": {
  1255. "application/json": {
  1256. "schema": {
  1257. "$ref": "#/components/schemas/Pty"
  1258. }
  1259. }
  1260. }
  1261. },
  1262. "400": {
  1263. "description": "Bad request",
  1264. "content": {
  1265. "application/json": {
  1266. "schema": {
  1267. "$ref": "#/components/schemas/BadRequestError"
  1268. }
  1269. }
  1270. }
  1271. }
  1272. },
  1273. "requestBody": {
  1274. "content": {
  1275. "application/json": {
  1276. "schema": {
  1277. "type": "object",
  1278. "properties": {
  1279. "title": {
  1280. "type": "string"
  1281. },
  1282. "size": {
  1283. "type": "object",
  1284. "properties": {
  1285. "rows": {
  1286. "type": "number"
  1287. },
  1288. "cols": {
  1289. "type": "number"
  1290. }
  1291. },
  1292. "required": ["rows", "cols"]
  1293. }
  1294. }
  1295. }
  1296. }
  1297. }
  1298. },
  1299. "x-codeSamples": [
  1300. {
  1301. "lang": "js",
  1302. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.update({\n ...\n})"
  1303. }
  1304. ]
  1305. },
  1306. "delete": {
  1307. "operationId": "pty.remove",
  1308. "parameters": [
  1309. {
  1310. "in": "query",
  1311. "name": "directory",
  1312. "schema": {
  1313. "type": "string"
  1314. }
  1315. },
  1316. {
  1317. "in": "query",
  1318. "name": "workspace",
  1319. "schema": {
  1320. "type": "string"
  1321. }
  1322. },
  1323. {
  1324. "in": "path",
  1325. "name": "ptyID",
  1326. "schema": {
  1327. "type": "string",
  1328. "pattern": "^pty.*"
  1329. },
  1330. "required": true
  1331. }
  1332. ],
  1333. "summary": "Remove PTY session",
  1334. "description": "Remove and terminate a specific pseudo-terminal (PTY) session.",
  1335. "responses": {
  1336. "200": {
  1337. "description": "Session removed",
  1338. "content": {
  1339. "application/json": {
  1340. "schema": {
  1341. "type": "boolean"
  1342. }
  1343. }
  1344. }
  1345. },
  1346. "404": {
  1347. "description": "Not found",
  1348. "content": {
  1349. "application/json": {
  1350. "schema": {
  1351. "$ref": "#/components/schemas/NotFoundError"
  1352. }
  1353. }
  1354. }
  1355. }
  1356. },
  1357. "x-codeSamples": [
  1358. {
  1359. "lang": "js",
  1360. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.remove({\n ...\n})"
  1361. }
  1362. ]
  1363. }
  1364. },
  1365. "/pty/{ptyID}/connect": {
  1366. "get": {
  1367. "operationId": "pty.connect",
  1368. "parameters": [
  1369. {
  1370. "in": "query",
  1371. "name": "directory",
  1372. "schema": {
  1373. "type": "string"
  1374. }
  1375. },
  1376. {
  1377. "in": "query",
  1378. "name": "workspace",
  1379. "schema": {
  1380. "type": "string"
  1381. }
  1382. },
  1383. {
  1384. "in": "path",
  1385. "name": "ptyID",
  1386. "schema": {
  1387. "type": "string",
  1388. "pattern": "^pty.*"
  1389. },
  1390. "required": true
  1391. }
  1392. ],
  1393. "summary": "Connect to PTY session",
  1394. "description": "Establish a WebSocket connection to interact with a pseudo-terminal (PTY) session in real-time.",
  1395. "responses": {
  1396. "200": {
  1397. "description": "Connected session",
  1398. "content": {
  1399. "application/json": {
  1400. "schema": {
  1401. "type": "boolean"
  1402. }
  1403. }
  1404. }
  1405. },
  1406. "404": {
  1407. "description": "Not found",
  1408. "content": {
  1409. "application/json": {
  1410. "schema": {
  1411. "$ref": "#/components/schemas/NotFoundError"
  1412. }
  1413. }
  1414. }
  1415. }
  1416. },
  1417. "x-codeSamples": [
  1418. {
  1419. "lang": "js",
  1420. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.connect({\n ...\n})"
  1421. }
  1422. ]
  1423. }
  1424. },
  1425. "/config": {
  1426. "get": {
  1427. "operationId": "config.get",
  1428. "parameters": [
  1429. {
  1430. "in": "query",
  1431. "name": "directory",
  1432. "schema": {
  1433. "type": "string"
  1434. }
  1435. },
  1436. {
  1437. "in": "query",
  1438. "name": "workspace",
  1439. "schema": {
  1440. "type": "string"
  1441. }
  1442. }
  1443. ],
  1444. "summary": "Get configuration",
  1445. "description": "Retrieve the current OpenCode configuration settings and preferences.",
  1446. "responses": {
  1447. "200": {
  1448. "description": "Get config info",
  1449. "content": {
  1450. "application/json": {
  1451. "schema": {
  1452. "$ref": "#/components/schemas/Config"
  1453. }
  1454. }
  1455. }
  1456. }
  1457. },
  1458. "x-codeSamples": [
  1459. {
  1460. "lang": "js",
  1461. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.config.get({\n ...\n})"
  1462. }
  1463. ]
  1464. },
  1465. "patch": {
  1466. "operationId": "config.update",
  1467. "parameters": [
  1468. {
  1469. "in": "query",
  1470. "name": "directory",
  1471. "schema": {
  1472. "type": "string"
  1473. }
  1474. },
  1475. {
  1476. "in": "query",
  1477. "name": "workspace",
  1478. "schema": {
  1479. "type": "string"
  1480. }
  1481. }
  1482. ],
  1483. "summary": "Update configuration",
  1484. "description": "Update OpenCode configuration settings and preferences.",
  1485. "responses": {
  1486. "200": {
  1487. "description": "Successfully updated config",
  1488. "content": {
  1489. "application/json": {
  1490. "schema": {
  1491. "$ref": "#/components/schemas/Config"
  1492. }
  1493. }
  1494. }
  1495. },
  1496. "400": {
  1497. "description": "Bad request",
  1498. "content": {
  1499. "application/json": {
  1500. "schema": {
  1501. "$ref": "#/components/schemas/BadRequestError"
  1502. }
  1503. }
  1504. }
  1505. }
  1506. },
  1507. "requestBody": {
  1508. "content": {
  1509. "application/json": {
  1510. "schema": {
  1511. "$ref": "#/components/schemas/Config"
  1512. }
  1513. }
  1514. }
  1515. },
  1516. "x-codeSamples": [
  1517. {
  1518. "lang": "js",
  1519. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.config.update({\n ...\n})"
  1520. }
  1521. ]
  1522. }
  1523. },
  1524. "/config/providers": {
  1525. "get": {
  1526. "operationId": "config.providers",
  1527. "parameters": [
  1528. {
  1529. "in": "query",
  1530. "name": "directory",
  1531. "schema": {
  1532. "type": "string"
  1533. }
  1534. },
  1535. {
  1536. "in": "query",
  1537. "name": "workspace",
  1538. "schema": {
  1539. "type": "string"
  1540. }
  1541. }
  1542. ],
  1543. "summary": "List config providers",
  1544. "description": "Get a list of all configured AI providers and their default models.",
  1545. "responses": {
  1546. "200": {
  1547. "description": "List of providers",
  1548. "content": {
  1549. "application/json": {
  1550. "schema": {
  1551. "type": "object",
  1552. "properties": {
  1553. "providers": {
  1554. "type": "array",
  1555. "items": {
  1556. "$ref": "#/components/schemas/Provider"
  1557. }
  1558. },
  1559. "default": {
  1560. "type": "object",
  1561. "propertyNames": {
  1562. "type": "string"
  1563. },
  1564. "additionalProperties": {
  1565. "type": "string"
  1566. }
  1567. }
  1568. },
  1569. "required": ["providers", "default"]
  1570. }
  1571. }
  1572. }
  1573. }
  1574. },
  1575. "x-codeSamples": [
  1576. {
  1577. "lang": "js",
  1578. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.config.providers({\n ...\n})"
  1579. }
  1580. ]
  1581. }
  1582. },
  1583. "/experimental/console": {
  1584. "get": {
  1585. "operationId": "experimental.console.get",
  1586. "parameters": [
  1587. {
  1588. "in": "query",
  1589. "name": "directory",
  1590. "schema": {
  1591. "type": "string"
  1592. }
  1593. },
  1594. {
  1595. "in": "query",
  1596. "name": "workspace",
  1597. "schema": {
  1598. "type": "string"
  1599. }
  1600. }
  1601. ],
  1602. "summary": "Get active Console provider metadata",
  1603. "description": "Get the active Console org name and the set of provider IDs managed by that Console org.",
  1604. "responses": {
  1605. "200": {
  1606. "description": "Active Console provider metadata",
  1607. "content": {
  1608. "application/json": {
  1609. "schema": {
  1610. "$ref": "#/components/schemas/ConsoleState"
  1611. }
  1612. }
  1613. }
  1614. }
  1615. },
  1616. "x-codeSamples": [
  1617. {
  1618. "lang": "js",
  1619. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.console.get({\n ...\n})"
  1620. }
  1621. ]
  1622. }
  1623. },
  1624. "/experimental/console/orgs": {
  1625. "get": {
  1626. "operationId": "experimental.console.listOrgs",
  1627. "parameters": [
  1628. {
  1629. "in": "query",
  1630. "name": "directory",
  1631. "schema": {
  1632. "type": "string"
  1633. }
  1634. },
  1635. {
  1636. "in": "query",
  1637. "name": "workspace",
  1638. "schema": {
  1639. "type": "string"
  1640. }
  1641. }
  1642. ],
  1643. "summary": "List switchable Console orgs",
  1644. "description": "Get the available Console orgs across logged-in accounts, including the current active org.",
  1645. "responses": {
  1646. "200": {
  1647. "description": "Switchable Console orgs",
  1648. "content": {
  1649. "application/json": {
  1650. "schema": {
  1651. "type": "object",
  1652. "properties": {
  1653. "orgs": {
  1654. "type": "array",
  1655. "items": {
  1656. "type": "object",
  1657. "properties": {
  1658. "accountID": {
  1659. "type": "string"
  1660. },
  1661. "accountEmail": {
  1662. "type": "string"
  1663. },
  1664. "accountUrl": {
  1665. "type": "string"
  1666. },
  1667. "orgID": {
  1668. "type": "string"
  1669. },
  1670. "orgName": {
  1671. "type": "string"
  1672. },
  1673. "active": {
  1674. "type": "boolean"
  1675. }
  1676. },
  1677. "required": ["accountID", "accountEmail", "accountUrl", "orgID", "orgName", "active"]
  1678. }
  1679. }
  1680. },
  1681. "required": ["orgs"]
  1682. }
  1683. }
  1684. }
  1685. }
  1686. },
  1687. "x-codeSamples": [
  1688. {
  1689. "lang": "js",
  1690. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.console.listOrgs({\n ...\n})"
  1691. }
  1692. ]
  1693. }
  1694. },
  1695. "/experimental/console/switch": {
  1696. "post": {
  1697. "operationId": "experimental.console.switchOrg",
  1698. "parameters": [
  1699. {
  1700. "in": "query",
  1701. "name": "directory",
  1702. "schema": {
  1703. "type": "string"
  1704. }
  1705. },
  1706. {
  1707. "in": "query",
  1708. "name": "workspace",
  1709. "schema": {
  1710. "type": "string"
  1711. }
  1712. }
  1713. ],
  1714. "summary": "Switch active Console org",
  1715. "description": "Persist a new active Console account/org selection for the current local OpenCode state.",
  1716. "responses": {
  1717. "200": {
  1718. "description": "Switch success",
  1719. "content": {
  1720. "application/json": {
  1721. "schema": {
  1722. "type": "boolean"
  1723. }
  1724. }
  1725. }
  1726. }
  1727. },
  1728. "requestBody": {
  1729. "content": {
  1730. "application/json": {
  1731. "schema": {
  1732. "type": "object",
  1733. "properties": {
  1734. "accountID": {
  1735. "type": "string"
  1736. },
  1737. "orgID": {
  1738. "type": "string"
  1739. }
  1740. },
  1741. "required": ["accountID", "orgID"]
  1742. }
  1743. }
  1744. }
  1745. },
  1746. "x-codeSamples": [
  1747. {
  1748. "lang": "js",
  1749. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.console.switchOrg({\n ...\n})"
  1750. }
  1751. ]
  1752. }
  1753. },
  1754. "/experimental/tool/ids": {
  1755. "get": {
  1756. "operationId": "tool.ids",
  1757. "parameters": [
  1758. {
  1759. "in": "query",
  1760. "name": "directory",
  1761. "schema": {
  1762. "type": "string"
  1763. }
  1764. },
  1765. {
  1766. "in": "query",
  1767. "name": "workspace",
  1768. "schema": {
  1769. "type": "string"
  1770. }
  1771. }
  1772. ],
  1773. "summary": "List tool IDs",
  1774. "description": "Get a list of all available tool IDs, including both built-in tools and dynamically registered tools.",
  1775. "responses": {
  1776. "200": {
  1777. "description": "Tool IDs",
  1778. "content": {
  1779. "application/json": {
  1780. "schema": {
  1781. "$ref": "#/components/schemas/ToolIDs"
  1782. }
  1783. }
  1784. }
  1785. },
  1786. "400": {
  1787. "description": "Bad request",
  1788. "content": {
  1789. "application/json": {
  1790. "schema": {
  1791. "$ref": "#/components/schemas/BadRequestError"
  1792. }
  1793. }
  1794. }
  1795. }
  1796. },
  1797. "x-codeSamples": [
  1798. {
  1799. "lang": "js",
  1800. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tool.ids({\n ...\n})"
  1801. }
  1802. ]
  1803. }
  1804. },
  1805. "/experimental/tool": {
  1806. "get": {
  1807. "operationId": "tool.list",
  1808. "parameters": [
  1809. {
  1810. "in": "query",
  1811. "name": "directory",
  1812. "schema": {
  1813. "type": "string"
  1814. }
  1815. },
  1816. {
  1817. "in": "query",
  1818. "name": "workspace",
  1819. "schema": {
  1820. "type": "string"
  1821. }
  1822. },
  1823. {
  1824. "in": "query",
  1825. "name": "provider",
  1826. "schema": {
  1827. "type": "string"
  1828. },
  1829. "required": true
  1830. },
  1831. {
  1832. "in": "query",
  1833. "name": "model",
  1834. "schema": {
  1835. "type": "string"
  1836. },
  1837. "required": true
  1838. }
  1839. ],
  1840. "summary": "List tools",
  1841. "description": "Get a list of available tools with their JSON schema parameters for a specific provider and model combination.",
  1842. "responses": {
  1843. "200": {
  1844. "description": "Tools",
  1845. "content": {
  1846. "application/json": {
  1847. "schema": {
  1848. "$ref": "#/components/schemas/ToolList"
  1849. }
  1850. }
  1851. }
  1852. },
  1853. "400": {
  1854. "description": "Bad request",
  1855. "content": {
  1856. "application/json": {
  1857. "schema": {
  1858. "$ref": "#/components/schemas/BadRequestError"
  1859. }
  1860. }
  1861. }
  1862. }
  1863. },
  1864. "x-codeSamples": [
  1865. {
  1866. "lang": "js",
  1867. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tool.list({\n ...\n})"
  1868. }
  1869. ]
  1870. }
  1871. },
  1872. "/experimental/worktree": {
  1873. "post": {
  1874. "operationId": "worktree.create",
  1875. "parameters": [
  1876. {
  1877. "in": "query",
  1878. "name": "directory",
  1879. "schema": {
  1880. "type": "string"
  1881. }
  1882. },
  1883. {
  1884. "in": "query",
  1885. "name": "workspace",
  1886. "schema": {
  1887. "type": "string"
  1888. }
  1889. }
  1890. ],
  1891. "summary": "Create worktree",
  1892. "description": "Create a new git worktree for the current project and run any configured startup scripts.",
  1893. "responses": {
  1894. "200": {
  1895. "description": "Worktree created",
  1896. "content": {
  1897. "application/json": {
  1898. "schema": {
  1899. "$ref": "#/components/schemas/Worktree"
  1900. }
  1901. }
  1902. }
  1903. },
  1904. "400": {
  1905. "description": "Bad request",
  1906. "content": {
  1907. "application/json": {
  1908. "schema": {
  1909. "$ref": "#/components/schemas/BadRequestError"
  1910. }
  1911. }
  1912. }
  1913. }
  1914. },
  1915. "requestBody": {
  1916. "content": {
  1917. "application/json": {
  1918. "schema": {
  1919. "$ref": "#/components/schemas/WorktreeCreateInput"
  1920. }
  1921. }
  1922. }
  1923. },
  1924. "x-codeSamples": [
  1925. {
  1926. "lang": "js",
  1927. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.create({\n ...\n})"
  1928. }
  1929. ]
  1930. },
  1931. "get": {
  1932. "operationId": "worktree.list",
  1933. "parameters": [
  1934. {
  1935. "in": "query",
  1936. "name": "directory",
  1937. "schema": {
  1938. "type": "string"
  1939. }
  1940. },
  1941. {
  1942. "in": "query",
  1943. "name": "workspace",
  1944. "schema": {
  1945. "type": "string"
  1946. }
  1947. }
  1948. ],
  1949. "summary": "List worktrees",
  1950. "description": "List all sandbox worktrees for the current project.",
  1951. "responses": {
  1952. "200": {
  1953. "description": "List of worktree directories",
  1954. "content": {
  1955. "application/json": {
  1956. "schema": {
  1957. "type": "array",
  1958. "items": {
  1959. "type": "string"
  1960. }
  1961. }
  1962. }
  1963. }
  1964. }
  1965. },
  1966. "x-codeSamples": [
  1967. {
  1968. "lang": "js",
  1969. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.list({\n ...\n})"
  1970. }
  1971. ]
  1972. },
  1973. "delete": {
  1974. "operationId": "worktree.remove",
  1975. "parameters": [
  1976. {
  1977. "in": "query",
  1978. "name": "directory",
  1979. "schema": {
  1980. "type": "string"
  1981. }
  1982. },
  1983. {
  1984. "in": "query",
  1985. "name": "workspace",
  1986. "schema": {
  1987. "type": "string"
  1988. }
  1989. }
  1990. ],
  1991. "summary": "Remove worktree",
  1992. "description": "Remove a git worktree and delete its branch.",
  1993. "responses": {
  1994. "200": {
  1995. "description": "Worktree removed",
  1996. "content": {
  1997. "application/json": {
  1998. "schema": {
  1999. "type": "boolean"
  2000. }
  2001. }
  2002. }
  2003. },
  2004. "400": {
  2005. "description": "Bad request",
  2006. "content": {
  2007. "application/json": {
  2008. "schema": {
  2009. "$ref": "#/components/schemas/BadRequestError"
  2010. }
  2011. }
  2012. }
  2013. }
  2014. },
  2015. "requestBody": {
  2016. "content": {
  2017. "application/json": {
  2018. "schema": {
  2019. "$ref": "#/components/schemas/WorktreeRemoveInput"
  2020. }
  2021. }
  2022. }
  2023. },
  2024. "x-codeSamples": [
  2025. {
  2026. "lang": "js",
  2027. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.remove({\n ...\n})"
  2028. }
  2029. ]
  2030. }
  2031. },
  2032. "/experimental/worktree/reset": {
  2033. "post": {
  2034. "operationId": "worktree.reset",
  2035. "parameters": [
  2036. {
  2037. "in": "query",
  2038. "name": "directory",
  2039. "schema": {
  2040. "type": "string"
  2041. }
  2042. },
  2043. {
  2044. "in": "query",
  2045. "name": "workspace",
  2046. "schema": {
  2047. "type": "string"
  2048. }
  2049. }
  2050. ],
  2051. "summary": "Reset worktree",
  2052. "description": "Reset a worktree branch to the primary default branch.",
  2053. "responses": {
  2054. "200": {
  2055. "description": "Worktree reset",
  2056. "content": {
  2057. "application/json": {
  2058. "schema": {
  2059. "type": "boolean"
  2060. }
  2061. }
  2062. }
  2063. },
  2064. "400": {
  2065. "description": "Bad request",
  2066. "content": {
  2067. "application/json": {
  2068. "schema": {
  2069. "$ref": "#/components/schemas/BadRequestError"
  2070. }
  2071. }
  2072. }
  2073. }
  2074. },
  2075. "requestBody": {
  2076. "content": {
  2077. "application/json": {
  2078. "schema": {
  2079. "$ref": "#/components/schemas/WorktreeResetInput"
  2080. }
  2081. }
  2082. }
  2083. },
  2084. "x-codeSamples": [
  2085. {
  2086. "lang": "js",
  2087. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.reset({\n ...\n})"
  2088. }
  2089. ]
  2090. }
  2091. },
  2092. "/experimental/session": {
  2093. "get": {
  2094. "operationId": "experimental.session.list",
  2095. "parameters": [
  2096. {
  2097. "in": "query",
  2098. "name": "directory",
  2099. "schema": {
  2100. "type": "string"
  2101. },
  2102. "description": "Filter sessions by project directory"
  2103. },
  2104. {
  2105. "in": "query",
  2106. "name": "workspace",
  2107. "schema": {
  2108. "type": "string"
  2109. }
  2110. },
  2111. {
  2112. "in": "query",
  2113. "name": "roots",
  2114. "schema": {
  2115. "type": "boolean"
  2116. },
  2117. "description": "Only return root sessions (no parentID)"
  2118. },
  2119. {
  2120. "in": "query",
  2121. "name": "start",
  2122. "schema": {
  2123. "type": "number"
  2124. },
  2125. "description": "Filter sessions updated on or after this timestamp (milliseconds since epoch)"
  2126. },
  2127. {
  2128. "in": "query",
  2129. "name": "cursor",
  2130. "schema": {
  2131. "type": "number"
  2132. },
  2133. "description": "Return sessions updated before this timestamp (milliseconds since epoch)"
  2134. },
  2135. {
  2136. "in": "query",
  2137. "name": "search",
  2138. "schema": {
  2139. "type": "string"
  2140. },
  2141. "description": "Filter sessions by title (case-insensitive)"
  2142. },
  2143. {
  2144. "in": "query",
  2145. "name": "limit",
  2146. "schema": {
  2147. "type": "number"
  2148. },
  2149. "description": "Maximum number of sessions to return"
  2150. },
  2151. {
  2152. "in": "query",
  2153. "name": "archived",
  2154. "schema": {
  2155. "type": "boolean"
  2156. },
  2157. "description": "Include archived sessions (default false)"
  2158. }
  2159. ],
  2160. "summary": "List sessions",
  2161. "description": "Get a list of all OpenCode sessions across projects, sorted by most recently updated. Archived sessions are excluded by default.",
  2162. "responses": {
  2163. "200": {
  2164. "description": "List of sessions",
  2165. "content": {
  2166. "application/json": {
  2167. "schema": {
  2168. "type": "array",
  2169. "items": {
  2170. "$ref": "#/components/schemas/GlobalSession"
  2171. }
  2172. }
  2173. }
  2174. }
  2175. }
  2176. },
  2177. "x-codeSamples": [
  2178. {
  2179. "lang": "js",
  2180. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.session.list({\n ...\n})"
  2181. }
  2182. ]
  2183. }
  2184. },
  2185. "/experimental/resource": {
  2186. "get": {
  2187. "operationId": "experimental.resource.list",
  2188. "parameters": [
  2189. {
  2190. "in": "query",
  2191. "name": "directory",
  2192. "schema": {
  2193. "type": "string"
  2194. }
  2195. },
  2196. {
  2197. "in": "query",
  2198. "name": "workspace",
  2199. "schema": {
  2200. "type": "string"
  2201. }
  2202. }
  2203. ],
  2204. "summary": "Get MCP resources",
  2205. "description": "Get all available MCP resources from connected servers. Optionally filter by name.",
  2206. "responses": {
  2207. "200": {
  2208. "description": "MCP resources",
  2209. "content": {
  2210. "application/json": {
  2211. "schema": {
  2212. "type": "object",
  2213. "propertyNames": {
  2214. "type": "string"
  2215. },
  2216. "additionalProperties": {
  2217. "$ref": "#/components/schemas/McpResource"
  2218. }
  2219. }
  2220. }
  2221. }
  2222. }
  2223. },
  2224. "x-codeSamples": [
  2225. {
  2226. "lang": "js",
  2227. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.resource.list({\n ...\n})"
  2228. }
  2229. ]
  2230. }
  2231. },
  2232. "/session": {
  2233. "get": {
  2234. "operationId": "session.list",
  2235. "parameters": [
  2236. {
  2237. "in": "query",
  2238. "name": "directory",
  2239. "schema": {
  2240. "type": "string"
  2241. },
  2242. "description": "Filter sessions by project directory"
  2243. },
  2244. {
  2245. "in": "query",
  2246. "name": "workspace",
  2247. "schema": {
  2248. "type": "string"
  2249. }
  2250. },
  2251. {
  2252. "in": "query",
  2253. "name": "roots",
  2254. "schema": {
  2255. "type": "boolean"
  2256. },
  2257. "description": "Only return root sessions (no parentID)"
  2258. },
  2259. {
  2260. "in": "query",
  2261. "name": "start",
  2262. "schema": {
  2263. "type": "number"
  2264. },
  2265. "description": "Filter sessions updated on or after this timestamp (milliseconds since epoch)"
  2266. },
  2267. {
  2268. "in": "query",
  2269. "name": "search",
  2270. "schema": {
  2271. "type": "string"
  2272. },
  2273. "description": "Filter sessions by title (case-insensitive)"
  2274. },
  2275. {
  2276. "in": "query",
  2277. "name": "limit",
  2278. "schema": {
  2279. "type": "number"
  2280. },
  2281. "description": "Maximum number of sessions to return"
  2282. }
  2283. ],
  2284. "summary": "List sessions",
  2285. "description": "Get a list of all OpenCode sessions, sorted by most recently updated.",
  2286. "responses": {
  2287. "200": {
  2288. "description": "List of sessions",
  2289. "content": {
  2290. "application/json": {
  2291. "schema": {
  2292. "type": "array",
  2293. "items": {
  2294. "$ref": "#/components/schemas/Session"
  2295. }
  2296. }
  2297. }
  2298. }
  2299. }
  2300. },
  2301. "x-codeSamples": [
  2302. {
  2303. "lang": "js",
  2304. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.list({\n ...\n})"
  2305. }
  2306. ]
  2307. },
  2308. "post": {
  2309. "operationId": "session.create",
  2310. "parameters": [
  2311. {
  2312. "in": "query",
  2313. "name": "directory",
  2314. "schema": {
  2315. "type": "string"
  2316. }
  2317. },
  2318. {
  2319. "in": "query",
  2320. "name": "workspace",
  2321. "schema": {
  2322. "type": "string"
  2323. }
  2324. }
  2325. ],
  2326. "summary": "Create session",
  2327. "description": "Create a new OpenCode session for interacting with AI assistants and managing conversations.",
  2328. "responses": {
  2329. "200": {
  2330. "description": "Successfully created session",
  2331. "content": {
  2332. "application/json": {
  2333. "schema": {
  2334. "$ref": "#/components/schemas/Session"
  2335. }
  2336. }
  2337. }
  2338. },
  2339. "400": {
  2340. "description": "Bad request",
  2341. "content": {
  2342. "application/json": {
  2343. "schema": {
  2344. "$ref": "#/components/schemas/BadRequestError"
  2345. }
  2346. }
  2347. }
  2348. }
  2349. },
  2350. "requestBody": {
  2351. "content": {
  2352. "application/json": {
  2353. "schema": {
  2354. "type": "object",
  2355. "properties": {
  2356. "parentID": {
  2357. "type": "string",
  2358. "pattern": "^ses.*"
  2359. },
  2360. "title": {
  2361. "type": "string"
  2362. },
  2363. "permission": {
  2364. "$ref": "#/components/schemas/PermissionRuleset"
  2365. },
  2366. "workspaceID": {
  2367. "type": "string",
  2368. "pattern": "^wrk.*"
  2369. }
  2370. }
  2371. }
  2372. }
  2373. }
  2374. },
  2375. "x-codeSamples": [
  2376. {
  2377. "lang": "js",
  2378. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.create({\n ...\n})"
  2379. }
  2380. ]
  2381. }
  2382. },
  2383. "/session/status": {
  2384. "get": {
  2385. "operationId": "session.status",
  2386. "parameters": [
  2387. {
  2388. "in": "query",
  2389. "name": "directory",
  2390. "schema": {
  2391. "type": "string"
  2392. }
  2393. },
  2394. {
  2395. "in": "query",
  2396. "name": "workspace",
  2397. "schema": {
  2398. "type": "string"
  2399. }
  2400. }
  2401. ],
  2402. "summary": "Get session status",
  2403. "description": "Retrieve the current status of all sessions, including active, idle, and completed states.",
  2404. "responses": {
  2405. "200": {
  2406. "description": "Get session status",
  2407. "content": {
  2408. "application/json": {
  2409. "schema": {
  2410. "type": "object",
  2411. "propertyNames": {
  2412. "type": "string"
  2413. },
  2414. "additionalProperties": {
  2415. "$ref": "#/components/schemas/SessionStatus"
  2416. }
  2417. }
  2418. }
  2419. }
  2420. },
  2421. "400": {
  2422. "description": "Bad request",
  2423. "content": {
  2424. "application/json": {
  2425. "schema": {
  2426. "$ref": "#/components/schemas/BadRequestError"
  2427. }
  2428. }
  2429. }
  2430. }
  2431. },
  2432. "x-codeSamples": [
  2433. {
  2434. "lang": "js",
  2435. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.status({\n ...\n})"
  2436. }
  2437. ]
  2438. }
  2439. },
  2440. "/session/{sessionID}": {
  2441. "get": {
  2442. "operationId": "session.get",
  2443. "parameters": [
  2444. {
  2445. "in": "query",
  2446. "name": "directory",
  2447. "schema": {
  2448. "type": "string"
  2449. }
  2450. },
  2451. {
  2452. "in": "query",
  2453. "name": "workspace",
  2454. "schema": {
  2455. "type": "string"
  2456. }
  2457. },
  2458. {
  2459. "in": "path",
  2460. "name": "sessionID",
  2461. "schema": {
  2462. "type": "string",
  2463. "pattern": "^ses.*"
  2464. },
  2465. "required": true
  2466. }
  2467. ],
  2468. "summary": "Get session",
  2469. "description": "Retrieve detailed information about a specific OpenCode session.",
  2470. "tags": ["Session"],
  2471. "responses": {
  2472. "200": {
  2473. "description": "Get session",
  2474. "content": {
  2475. "application/json": {
  2476. "schema": {
  2477. "$ref": "#/components/schemas/Session"
  2478. }
  2479. }
  2480. }
  2481. },
  2482. "400": {
  2483. "description": "Bad request",
  2484. "content": {
  2485. "application/json": {
  2486. "schema": {
  2487. "$ref": "#/components/schemas/BadRequestError"
  2488. }
  2489. }
  2490. }
  2491. },
  2492. "404": {
  2493. "description": "Not found",
  2494. "content": {
  2495. "application/json": {
  2496. "schema": {
  2497. "$ref": "#/components/schemas/NotFoundError"
  2498. }
  2499. }
  2500. }
  2501. }
  2502. },
  2503. "x-codeSamples": [
  2504. {
  2505. "lang": "js",
  2506. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.get({\n ...\n})"
  2507. }
  2508. ]
  2509. },
  2510. "delete": {
  2511. "operationId": "session.delete",
  2512. "parameters": [
  2513. {
  2514. "in": "query",
  2515. "name": "directory",
  2516. "schema": {
  2517. "type": "string"
  2518. }
  2519. },
  2520. {
  2521. "in": "query",
  2522. "name": "workspace",
  2523. "schema": {
  2524. "type": "string"
  2525. }
  2526. },
  2527. {
  2528. "in": "path",
  2529. "name": "sessionID",
  2530. "schema": {
  2531. "type": "string",
  2532. "pattern": "^ses.*"
  2533. },
  2534. "required": true
  2535. }
  2536. ],
  2537. "summary": "Delete session",
  2538. "description": "Delete a session and permanently remove all associated data, including messages and history.",
  2539. "responses": {
  2540. "200": {
  2541. "description": "Successfully deleted session",
  2542. "content": {
  2543. "application/json": {
  2544. "schema": {
  2545. "type": "boolean"
  2546. }
  2547. }
  2548. }
  2549. },
  2550. "400": {
  2551. "description": "Bad request",
  2552. "content": {
  2553. "application/json": {
  2554. "schema": {
  2555. "$ref": "#/components/schemas/BadRequestError"
  2556. }
  2557. }
  2558. }
  2559. },
  2560. "404": {
  2561. "description": "Not found",
  2562. "content": {
  2563. "application/json": {
  2564. "schema": {
  2565. "$ref": "#/components/schemas/NotFoundError"
  2566. }
  2567. }
  2568. }
  2569. }
  2570. },
  2571. "x-codeSamples": [
  2572. {
  2573. "lang": "js",
  2574. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.delete({\n ...\n})"
  2575. }
  2576. ]
  2577. },
  2578. "patch": {
  2579. "operationId": "session.update",
  2580. "parameters": [
  2581. {
  2582. "in": "query",
  2583. "name": "directory",
  2584. "schema": {
  2585. "type": "string"
  2586. }
  2587. },
  2588. {
  2589. "in": "query",
  2590. "name": "workspace",
  2591. "schema": {
  2592. "type": "string"
  2593. }
  2594. },
  2595. {
  2596. "in": "path",
  2597. "name": "sessionID",
  2598. "schema": {
  2599. "type": "string",
  2600. "pattern": "^ses.*"
  2601. },
  2602. "required": true
  2603. }
  2604. ],
  2605. "summary": "Update session",
  2606. "description": "Update properties of an existing session, such as title or other metadata.",
  2607. "responses": {
  2608. "200": {
  2609. "description": "Successfully updated session",
  2610. "content": {
  2611. "application/json": {
  2612. "schema": {
  2613. "$ref": "#/components/schemas/Session"
  2614. }
  2615. }
  2616. }
  2617. },
  2618. "400": {
  2619. "description": "Bad request",
  2620. "content": {
  2621. "application/json": {
  2622. "schema": {
  2623. "$ref": "#/components/schemas/BadRequestError"
  2624. }
  2625. }
  2626. }
  2627. },
  2628. "404": {
  2629. "description": "Not found",
  2630. "content": {
  2631. "application/json": {
  2632. "schema": {
  2633. "$ref": "#/components/schemas/NotFoundError"
  2634. }
  2635. }
  2636. }
  2637. }
  2638. },
  2639. "requestBody": {
  2640. "content": {
  2641. "application/json": {
  2642. "schema": {
  2643. "type": "object",
  2644. "properties": {
  2645. "title": {
  2646. "type": "string"
  2647. },
  2648. "permission": {
  2649. "$ref": "#/components/schemas/PermissionRuleset"
  2650. },
  2651. "time": {
  2652. "type": "object",
  2653. "properties": {
  2654. "archived": {
  2655. "type": "number"
  2656. }
  2657. }
  2658. }
  2659. }
  2660. }
  2661. }
  2662. }
  2663. },
  2664. "x-codeSamples": [
  2665. {
  2666. "lang": "js",
  2667. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.update({\n ...\n})"
  2668. }
  2669. ]
  2670. }
  2671. },
  2672. "/session/{sessionID}/children": {
  2673. "get": {
  2674. "operationId": "session.children",
  2675. "parameters": [
  2676. {
  2677. "in": "query",
  2678. "name": "directory",
  2679. "schema": {
  2680. "type": "string"
  2681. }
  2682. },
  2683. {
  2684. "in": "query",
  2685. "name": "workspace",
  2686. "schema": {
  2687. "type": "string"
  2688. }
  2689. },
  2690. {
  2691. "in": "path",
  2692. "name": "sessionID",
  2693. "schema": {
  2694. "type": "string",
  2695. "pattern": "^ses.*"
  2696. },
  2697. "required": true
  2698. }
  2699. ],
  2700. "summary": "Get session children",
  2701. "tags": ["Session"],
  2702. "description": "Retrieve all child sessions that were forked from the specified parent session.",
  2703. "responses": {
  2704. "200": {
  2705. "description": "List of children",
  2706. "content": {
  2707. "application/json": {
  2708. "schema": {
  2709. "type": "array",
  2710. "items": {
  2711. "$ref": "#/components/schemas/Session"
  2712. }
  2713. }
  2714. }
  2715. }
  2716. },
  2717. "400": {
  2718. "description": "Bad request",
  2719. "content": {
  2720. "application/json": {
  2721. "schema": {
  2722. "$ref": "#/components/schemas/BadRequestError"
  2723. }
  2724. }
  2725. }
  2726. },
  2727. "404": {
  2728. "description": "Not found",
  2729. "content": {
  2730. "application/json": {
  2731. "schema": {
  2732. "$ref": "#/components/schemas/NotFoundError"
  2733. }
  2734. }
  2735. }
  2736. }
  2737. },
  2738. "x-codeSamples": [
  2739. {
  2740. "lang": "js",
  2741. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.children({\n ...\n})"
  2742. }
  2743. ]
  2744. }
  2745. },
  2746. "/session/{sessionID}/todo": {
  2747. "get": {
  2748. "operationId": "session.todo",
  2749. "parameters": [
  2750. {
  2751. "in": "query",
  2752. "name": "directory",
  2753. "schema": {
  2754. "type": "string"
  2755. }
  2756. },
  2757. {
  2758. "in": "query",
  2759. "name": "workspace",
  2760. "schema": {
  2761. "type": "string"
  2762. }
  2763. },
  2764. {
  2765. "in": "path",
  2766. "name": "sessionID",
  2767. "schema": {
  2768. "type": "string",
  2769. "pattern": "^ses.*"
  2770. },
  2771. "required": true
  2772. }
  2773. ],
  2774. "summary": "Get session todos",
  2775. "description": "Retrieve the todo list associated with a specific session, showing tasks and action items.",
  2776. "responses": {
  2777. "200": {
  2778. "description": "Todo list",
  2779. "content": {
  2780. "application/json": {
  2781. "schema": {
  2782. "type": "array",
  2783. "items": {
  2784. "$ref": "#/components/schemas/Todo"
  2785. }
  2786. }
  2787. }
  2788. }
  2789. },
  2790. "400": {
  2791. "description": "Bad request",
  2792. "content": {
  2793. "application/json": {
  2794. "schema": {
  2795. "$ref": "#/components/schemas/BadRequestError"
  2796. }
  2797. }
  2798. }
  2799. },
  2800. "404": {
  2801. "description": "Not found",
  2802. "content": {
  2803. "application/json": {
  2804. "schema": {
  2805. "$ref": "#/components/schemas/NotFoundError"
  2806. }
  2807. }
  2808. }
  2809. }
  2810. },
  2811. "x-codeSamples": [
  2812. {
  2813. "lang": "js",
  2814. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.todo({\n ...\n})"
  2815. }
  2816. ]
  2817. }
  2818. },
  2819. "/session/{sessionID}/init": {
  2820. "post": {
  2821. "operationId": "session.init",
  2822. "parameters": [
  2823. {
  2824. "in": "query",
  2825. "name": "directory",
  2826. "schema": {
  2827. "type": "string"
  2828. }
  2829. },
  2830. {
  2831. "in": "query",
  2832. "name": "workspace",
  2833. "schema": {
  2834. "type": "string"
  2835. }
  2836. },
  2837. {
  2838. "in": "path",
  2839. "name": "sessionID",
  2840. "schema": {
  2841. "type": "string",
  2842. "pattern": "^ses.*"
  2843. },
  2844. "required": true
  2845. }
  2846. ],
  2847. "summary": "Initialize session",
  2848. "description": "Analyze the current application and create an AGENTS.md file with project-specific agent configurations.",
  2849. "responses": {
  2850. "200": {
  2851. "description": "200",
  2852. "content": {
  2853. "application/json": {
  2854. "schema": {
  2855. "type": "boolean"
  2856. }
  2857. }
  2858. }
  2859. },
  2860. "400": {
  2861. "description": "Bad request",
  2862. "content": {
  2863. "application/json": {
  2864. "schema": {
  2865. "$ref": "#/components/schemas/BadRequestError"
  2866. }
  2867. }
  2868. }
  2869. },
  2870. "404": {
  2871. "description": "Not found",
  2872. "content": {
  2873. "application/json": {
  2874. "schema": {
  2875. "$ref": "#/components/schemas/NotFoundError"
  2876. }
  2877. }
  2878. }
  2879. }
  2880. },
  2881. "requestBody": {
  2882. "content": {
  2883. "application/json": {
  2884. "schema": {
  2885. "type": "object",
  2886. "properties": {
  2887. "modelID": {
  2888. "type": "string"
  2889. },
  2890. "providerID": {
  2891. "type": "string"
  2892. },
  2893. "messageID": {
  2894. "type": "string",
  2895. "pattern": "^msg.*"
  2896. }
  2897. },
  2898. "required": ["modelID", "providerID", "messageID"]
  2899. }
  2900. }
  2901. }
  2902. },
  2903. "x-codeSamples": [
  2904. {
  2905. "lang": "js",
  2906. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.init({\n ...\n})"
  2907. }
  2908. ]
  2909. }
  2910. },
  2911. "/session/{sessionID}/fork": {
  2912. "post": {
  2913. "operationId": "session.fork",
  2914. "parameters": [
  2915. {
  2916. "in": "query",
  2917. "name": "directory",
  2918. "schema": {
  2919. "type": "string"
  2920. }
  2921. },
  2922. {
  2923. "in": "query",
  2924. "name": "workspace",
  2925. "schema": {
  2926. "type": "string"
  2927. }
  2928. },
  2929. {
  2930. "in": "path",
  2931. "name": "sessionID",
  2932. "schema": {
  2933. "type": "string",
  2934. "pattern": "^ses.*"
  2935. },
  2936. "required": true
  2937. }
  2938. ],
  2939. "summary": "Fork session",
  2940. "description": "Create a new session by forking an existing session at a specific message point.",
  2941. "responses": {
  2942. "200": {
  2943. "description": "200",
  2944. "content": {
  2945. "application/json": {
  2946. "schema": {
  2947. "$ref": "#/components/schemas/Session"
  2948. }
  2949. }
  2950. }
  2951. }
  2952. },
  2953. "requestBody": {
  2954. "content": {
  2955. "application/json": {
  2956. "schema": {
  2957. "type": "object",
  2958. "properties": {
  2959. "messageID": {
  2960. "type": "string",
  2961. "pattern": "^msg.*"
  2962. }
  2963. }
  2964. }
  2965. }
  2966. }
  2967. },
  2968. "x-codeSamples": [
  2969. {
  2970. "lang": "js",
  2971. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.fork({\n ...\n})"
  2972. }
  2973. ]
  2974. }
  2975. },
  2976. "/session/{sessionID}/abort": {
  2977. "post": {
  2978. "operationId": "session.abort",
  2979. "parameters": [
  2980. {
  2981. "in": "query",
  2982. "name": "directory",
  2983. "schema": {
  2984. "type": "string"
  2985. }
  2986. },
  2987. {
  2988. "in": "query",
  2989. "name": "workspace",
  2990. "schema": {
  2991. "type": "string"
  2992. }
  2993. },
  2994. {
  2995. "in": "path",
  2996. "name": "sessionID",
  2997. "schema": {
  2998. "type": "string",
  2999. "pattern": "^ses.*"
  3000. },
  3001. "required": true
  3002. }
  3003. ],
  3004. "summary": "Abort session",
  3005. "description": "Abort an active session and stop any ongoing AI processing or command execution.",
  3006. "responses": {
  3007. "200": {
  3008. "description": "Aborted session",
  3009. "content": {
  3010. "application/json": {
  3011. "schema": {
  3012. "type": "boolean"
  3013. }
  3014. }
  3015. }
  3016. },
  3017. "400": {
  3018. "description": "Bad request",
  3019. "content": {
  3020. "application/json": {
  3021. "schema": {
  3022. "$ref": "#/components/schemas/BadRequestError"
  3023. }
  3024. }
  3025. }
  3026. },
  3027. "404": {
  3028. "description": "Not found",
  3029. "content": {
  3030. "application/json": {
  3031. "schema": {
  3032. "$ref": "#/components/schemas/NotFoundError"
  3033. }
  3034. }
  3035. }
  3036. }
  3037. },
  3038. "x-codeSamples": [
  3039. {
  3040. "lang": "js",
  3041. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.abort({\n ...\n})"
  3042. }
  3043. ]
  3044. }
  3045. },
  3046. "/session/{sessionID}/share": {
  3047. "post": {
  3048. "operationId": "session.share",
  3049. "parameters": [
  3050. {
  3051. "in": "query",
  3052. "name": "directory",
  3053. "schema": {
  3054. "type": "string"
  3055. }
  3056. },
  3057. {
  3058. "in": "query",
  3059. "name": "workspace",
  3060. "schema": {
  3061. "type": "string"
  3062. }
  3063. },
  3064. {
  3065. "in": "path",
  3066. "name": "sessionID",
  3067. "schema": {
  3068. "type": "string",
  3069. "pattern": "^ses.*"
  3070. },
  3071. "required": true
  3072. }
  3073. ],
  3074. "summary": "Share session",
  3075. "description": "Create a shareable link for a session, allowing others to view the conversation.",
  3076. "responses": {
  3077. "200": {
  3078. "description": "Successfully shared session",
  3079. "content": {
  3080. "application/json": {
  3081. "schema": {
  3082. "$ref": "#/components/schemas/Session"
  3083. }
  3084. }
  3085. }
  3086. },
  3087. "400": {
  3088. "description": "Bad request",
  3089. "content": {
  3090. "application/json": {
  3091. "schema": {
  3092. "$ref": "#/components/schemas/BadRequestError"
  3093. }
  3094. }
  3095. }
  3096. },
  3097. "404": {
  3098. "description": "Not found",
  3099. "content": {
  3100. "application/json": {
  3101. "schema": {
  3102. "$ref": "#/components/schemas/NotFoundError"
  3103. }
  3104. }
  3105. }
  3106. }
  3107. },
  3108. "x-codeSamples": [
  3109. {
  3110. "lang": "js",
  3111. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.share({\n ...\n})"
  3112. }
  3113. ]
  3114. },
  3115. "delete": {
  3116. "operationId": "session.unshare",
  3117. "parameters": [
  3118. {
  3119. "in": "query",
  3120. "name": "directory",
  3121. "schema": {
  3122. "type": "string"
  3123. }
  3124. },
  3125. {
  3126. "in": "query",
  3127. "name": "workspace",
  3128. "schema": {
  3129. "type": "string"
  3130. }
  3131. },
  3132. {
  3133. "in": "path",
  3134. "name": "sessionID",
  3135. "schema": {
  3136. "type": "string",
  3137. "pattern": "^ses.*"
  3138. },
  3139. "required": true
  3140. }
  3141. ],
  3142. "summary": "Unshare session",
  3143. "description": "Remove the shareable link for a session, making it private again.",
  3144. "responses": {
  3145. "200": {
  3146. "description": "Successfully unshared session",
  3147. "content": {
  3148. "application/json": {
  3149. "schema": {
  3150. "$ref": "#/components/schemas/Session"
  3151. }
  3152. }
  3153. }
  3154. },
  3155. "400": {
  3156. "description": "Bad request",
  3157. "content": {
  3158. "application/json": {
  3159. "schema": {
  3160. "$ref": "#/components/schemas/BadRequestError"
  3161. }
  3162. }
  3163. }
  3164. },
  3165. "404": {
  3166. "description": "Not found",
  3167. "content": {
  3168. "application/json": {
  3169. "schema": {
  3170. "$ref": "#/components/schemas/NotFoundError"
  3171. }
  3172. }
  3173. }
  3174. }
  3175. },
  3176. "x-codeSamples": [
  3177. {
  3178. "lang": "js",
  3179. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.unshare({\n ...\n})"
  3180. }
  3181. ]
  3182. }
  3183. },
  3184. "/session/{sessionID}/diff": {
  3185. "get": {
  3186. "operationId": "session.diff",
  3187. "parameters": [
  3188. {
  3189. "in": "query",
  3190. "name": "directory",
  3191. "schema": {
  3192. "type": "string"
  3193. }
  3194. },
  3195. {
  3196. "in": "query",
  3197. "name": "workspace",
  3198. "schema": {
  3199. "type": "string"
  3200. }
  3201. },
  3202. {
  3203. "in": "path",
  3204. "name": "sessionID",
  3205. "schema": {
  3206. "type": "string",
  3207. "pattern": "^ses.*"
  3208. },
  3209. "required": true
  3210. },
  3211. {
  3212. "in": "query",
  3213. "name": "messageID",
  3214. "schema": {
  3215. "type": "string",
  3216. "pattern": "^msg.*"
  3217. }
  3218. }
  3219. ],
  3220. "summary": "Get message diff",
  3221. "description": "Get the file changes (diff) that resulted from a specific user message in the session.",
  3222. "responses": {
  3223. "200": {
  3224. "description": "Successfully retrieved diff",
  3225. "content": {
  3226. "application/json": {
  3227. "schema": {
  3228. "type": "array",
  3229. "items": {
  3230. "$ref": "#/components/schemas/SnapshotFileDiff"
  3231. }
  3232. }
  3233. }
  3234. }
  3235. }
  3236. },
  3237. "x-codeSamples": [
  3238. {
  3239. "lang": "js",
  3240. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.diff({\n ...\n})"
  3241. }
  3242. ]
  3243. }
  3244. },
  3245. "/session/{sessionID}/summarize": {
  3246. "post": {
  3247. "operationId": "session.summarize",
  3248. "parameters": [
  3249. {
  3250. "in": "query",
  3251. "name": "directory",
  3252. "schema": {
  3253. "type": "string"
  3254. }
  3255. },
  3256. {
  3257. "in": "query",
  3258. "name": "workspace",
  3259. "schema": {
  3260. "type": "string"
  3261. }
  3262. },
  3263. {
  3264. "in": "path",
  3265. "name": "sessionID",
  3266. "schema": {
  3267. "type": "string",
  3268. "pattern": "^ses.*"
  3269. },
  3270. "required": true
  3271. }
  3272. ],
  3273. "summary": "Summarize session",
  3274. "description": "Generate a concise summary of the session using AI compaction to preserve key information.",
  3275. "responses": {
  3276. "200": {
  3277. "description": "Summarized session",
  3278. "content": {
  3279. "application/json": {
  3280. "schema": {
  3281. "type": "boolean"
  3282. }
  3283. }
  3284. }
  3285. },
  3286. "400": {
  3287. "description": "Bad request",
  3288. "content": {
  3289. "application/json": {
  3290. "schema": {
  3291. "$ref": "#/components/schemas/BadRequestError"
  3292. }
  3293. }
  3294. }
  3295. },
  3296. "404": {
  3297. "description": "Not found",
  3298. "content": {
  3299. "application/json": {
  3300. "schema": {
  3301. "$ref": "#/components/schemas/NotFoundError"
  3302. }
  3303. }
  3304. }
  3305. }
  3306. },
  3307. "requestBody": {
  3308. "content": {
  3309. "application/json": {
  3310. "schema": {
  3311. "type": "object",
  3312. "properties": {
  3313. "providerID": {
  3314. "type": "string"
  3315. },
  3316. "modelID": {
  3317. "type": "string"
  3318. },
  3319. "auto": {
  3320. "default": false,
  3321. "type": "boolean"
  3322. }
  3323. },
  3324. "required": ["providerID", "modelID"]
  3325. }
  3326. }
  3327. }
  3328. },
  3329. "x-codeSamples": [
  3330. {
  3331. "lang": "js",
  3332. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.summarize({\n ...\n})"
  3333. }
  3334. ]
  3335. }
  3336. },
  3337. "/session/{sessionID}/message": {
  3338. "get": {
  3339. "operationId": "session.messages",
  3340. "parameters": [
  3341. {
  3342. "in": "query",
  3343. "name": "directory",
  3344. "schema": {
  3345. "type": "string"
  3346. }
  3347. },
  3348. {
  3349. "in": "query",
  3350. "name": "workspace",
  3351. "schema": {
  3352. "type": "string"
  3353. }
  3354. },
  3355. {
  3356. "in": "path",
  3357. "name": "sessionID",
  3358. "schema": {
  3359. "type": "string",
  3360. "pattern": "^ses.*"
  3361. },
  3362. "required": true
  3363. },
  3364. {
  3365. "in": "query",
  3366. "name": "limit",
  3367. "schema": {
  3368. "type": "integer",
  3369. "minimum": 0,
  3370. "maximum": 9007199254740991
  3371. },
  3372. "description": "Maximum number of messages to return"
  3373. },
  3374. {
  3375. "in": "query",
  3376. "name": "before",
  3377. "schema": {
  3378. "type": "string"
  3379. }
  3380. }
  3381. ],
  3382. "summary": "Get session messages",
  3383. "description": "Retrieve all messages in a session, including user prompts and AI responses.",
  3384. "responses": {
  3385. "200": {
  3386. "description": "List of messages",
  3387. "content": {
  3388. "application/json": {
  3389. "schema": {
  3390. "type": "array",
  3391. "items": {
  3392. "type": "object",
  3393. "properties": {
  3394. "info": {
  3395. "$ref": "#/components/schemas/Message"
  3396. },
  3397. "parts": {
  3398. "type": "array",
  3399. "items": {
  3400. "$ref": "#/components/schemas/Part"
  3401. }
  3402. }
  3403. },
  3404. "required": ["info", "parts"]
  3405. }
  3406. }
  3407. }
  3408. }
  3409. },
  3410. "400": {
  3411. "description": "Bad request",
  3412. "content": {
  3413. "application/json": {
  3414. "schema": {
  3415. "$ref": "#/components/schemas/BadRequestError"
  3416. }
  3417. }
  3418. }
  3419. },
  3420. "404": {
  3421. "description": "Not found",
  3422. "content": {
  3423. "application/json": {
  3424. "schema": {
  3425. "$ref": "#/components/schemas/NotFoundError"
  3426. }
  3427. }
  3428. }
  3429. }
  3430. },
  3431. "x-codeSamples": [
  3432. {
  3433. "lang": "js",
  3434. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.messages({\n ...\n})"
  3435. }
  3436. ]
  3437. },
  3438. "post": {
  3439. "operationId": "session.prompt",
  3440. "parameters": [
  3441. {
  3442. "in": "query",
  3443. "name": "directory",
  3444. "schema": {
  3445. "type": "string"
  3446. }
  3447. },
  3448. {
  3449. "in": "query",
  3450. "name": "workspace",
  3451. "schema": {
  3452. "type": "string"
  3453. }
  3454. },
  3455. {
  3456. "in": "path",
  3457. "name": "sessionID",
  3458. "schema": {
  3459. "type": "string",
  3460. "pattern": "^ses.*"
  3461. },
  3462. "required": true
  3463. }
  3464. ],
  3465. "summary": "Send message",
  3466. "description": "Create and send a new message to a session, streaming the AI response.",
  3467. "responses": {
  3468. "200": {
  3469. "description": "Created message",
  3470. "content": {
  3471. "application/json": {
  3472. "schema": {
  3473. "type": "object",
  3474. "properties": {
  3475. "info": {
  3476. "$ref": "#/components/schemas/AssistantMessage"
  3477. },
  3478. "parts": {
  3479. "type": "array",
  3480. "items": {
  3481. "$ref": "#/components/schemas/Part"
  3482. }
  3483. }
  3484. },
  3485. "required": ["info", "parts"]
  3486. }
  3487. }
  3488. }
  3489. },
  3490. "400": {
  3491. "description": "Bad request",
  3492. "content": {
  3493. "application/json": {
  3494. "schema": {
  3495. "$ref": "#/components/schemas/BadRequestError"
  3496. }
  3497. }
  3498. }
  3499. },
  3500. "404": {
  3501. "description": "Not found",
  3502. "content": {
  3503. "application/json": {
  3504. "schema": {
  3505. "$ref": "#/components/schemas/NotFoundError"
  3506. }
  3507. }
  3508. }
  3509. }
  3510. },
  3511. "requestBody": {
  3512. "content": {
  3513. "application/json": {
  3514. "schema": {
  3515. "type": "object",
  3516. "properties": {
  3517. "messageID": {
  3518. "type": "string",
  3519. "pattern": "^msg.*"
  3520. },
  3521. "model": {
  3522. "type": "object",
  3523. "properties": {
  3524. "providerID": {
  3525. "type": "string"
  3526. },
  3527. "modelID": {
  3528. "type": "string"
  3529. }
  3530. },
  3531. "required": ["providerID", "modelID"]
  3532. },
  3533. "agent": {
  3534. "type": "string"
  3535. },
  3536. "noReply": {
  3537. "type": "boolean"
  3538. },
  3539. "tools": {
  3540. "description": "@deprecated tools and permissions have been merged, you can set permissions on the session itself now",
  3541. "type": "object",
  3542. "propertyNames": {
  3543. "type": "string"
  3544. },
  3545. "additionalProperties": {
  3546. "type": "boolean"
  3547. }
  3548. },
  3549. "format": {
  3550. "$ref": "#/components/schemas/OutputFormat"
  3551. },
  3552. "system": {
  3553. "type": "string"
  3554. },
  3555. "variant": {
  3556. "type": "string"
  3557. },
  3558. "parts": {
  3559. "type": "array",
  3560. "items": {
  3561. "anyOf": [
  3562. {
  3563. "$ref": "#/components/schemas/TextPartInput"
  3564. },
  3565. {
  3566. "$ref": "#/components/schemas/FilePartInput"
  3567. },
  3568. {
  3569. "$ref": "#/components/schemas/AgentPartInput"
  3570. },
  3571. {
  3572. "$ref": "#/components/schemas/SubtaskPartInput"
  3573. }
  3574. ]
  3575. }
  3576. }
  3577. },
  3578. "required": ["parts"]
  3579. }
  3580. }
  3581. }
  3582. },
  3583. "x-codeSamples": [
  3584. {
  3585. "lang": "js",
  3586. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.prompt({\n ...\n})"
  3587. }
  3588. ]
  3589. }
  3590. },
  3591. "/session/{sessionID}/message/{messageID}": {
  3592. "get": {
  3593. "operationId": "session.message",
  3594. "parameters": [
  3595. {
  3596. "in": "query",
  3597. "name": "directory",
  3598. "schema": {
  3599. "type": "string"
  3600. }
  3601. },
  3602. {
  3603. "in": "query",
  3604. "name": "workspace",
  3605. "schema": {
  3606. "type": "string"
  3607. }
  3608. },
  3609. {
  3610. "in": "path",
  3611. "name": "sessionID",
  3612. "schema": {
  3613. "type": "string",
  3614. "pattern": "^ses.*"
  3615. },
  3616. "required": true
  3617. },
  3618. {
  3619. "in": "path",
  3620. "name": "messageID",
  3621. "schema": {
  3622. "type": "string",
  3623. "pattern": "^msg.*"
  3624. },
  3625. "required": true
  3626. }
  3627. ],
  3628. "summary": "Get message",
  3629. "description": "Retrieve a specific message from a session by its message ID.",
  3630. "responses": {
  3631. "200": {
  3632. "description": "Message",
  3633. "content": {
  3634. "application/json": {
  3635. "schema": {
  3636. "type": "object",
  3637. "properties": {
  3638. "info": {
  3639. "$ref": "#/components/schemas/Message"
  3640. },
  3641. "parts": {
  3642. "type": "array",
  3643. "items": {
  3644. "$ref": "#/components/schemas/Part"
  3645. }
  3646. }
  3647. },
  3648. "required": ["info", "parts"]
  3649. }
  3650. }
  3651. }
  3652. },
  3653. "400": {
  3654. "description": "Bad request",
  3655. "content": {
  3656. "application/json": {
  3657. "schema": {
  3658. "$ref": "#/components/schemas/BadRequestError"
  3659. }
  3660. }
  3661. }
  3662. },
  3663. "404": {
  3664. "description": "Not found",
  3665. "content": {
  3666. "application/json": {
  3667. "schema": {
  3668. "$ref": "#/components/schemas/NotFoundError"
  3669. }
  3670. }
  3671. }
  3672. }
  3673. },
  3674. "x-codeSamples": [
  3675. {
  3676. "lang": "js",
  3677. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.message({\n ...\n})"
  3678. }
  3679. ]
  3680. },
  3681. "delete": {
  3682. "operationId": "session.deleteMessage",
  3683. "parameters": [
  3684. {
  3685. "in": "query",
  3686. "name": "directory",
  3687. "schema": {
  3688. "type": "string"
  3689. }
  3690. },
  3691. {
  3692. "in": "query",
  3693. "name": "workspace",
  3694. "schema": {
  3695. "type": "string"
  3696. }
  3697. },
  3698. {
  3699. "in": "path",
  3700. "name": "sessionID",
  3701. "schema": {
  3702. "type": "string",
  3703. "pattern": "^ses.*"
  3704. },
  3705. "required": true
  3706. },
  3707. {
  3708. "in": "path",
  3709. "name": "messageID",
  3710. "schema": {
  3711. "type": "string",
  3712. "pattern": "^msg.*"
  3713. },
  3714. "required": true
  3715. }
  3716. ],
  3717. "summary": "Delete message",
  3718. "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.",
  3719. "responses": {
  3720. "200": {
  3721. "description": "Successfully deleted message",
  3722. "content": {
  3723. "application/json": {
  3724. "schema": {
  3725. "type": "boolean"
  3726. }
  3727. }
  3728. }
  3729. },
  3730. "400": {
  3731. "description": "Bad request",
  3732. "content": {
  3733. "application/json": {
  3734. "schema": {
  3735. "$ref": "#/components/schemas/BadRequestError"
  3736. }
  3737. }
  3738. }
  3739. },
  3740. "404": {
  3741. "description": "Not found",
  3742. "content": {
  3743. "application/json": {
  3744. "schema": {
  3745. "$ref": "#/components/schemas/NotFoundError"
  3746. }
  3747. }
  3748. }
  3749. }
  3750. },
  3751. "x-codeSamples": [
  3752. {
  3753. "lang": "js",
  3754. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.deleteMessage({\n ...\n})"
  3755. }
  3756. ]
  3757. }
  3758. },
  3759. "/session/{sessionID}/message/{messageID}/part/{partID}": {
  3760. "delete": {
  3761. "operationId": "part.delete",
  3762. "parameters": [
  3763. {
  3764. "in": "query",
  3765. "name": "directory",
  3766. "schema": {
  3767. "type": "string"
  3768. }
  3769. },
  3770. {
  3771. "in": "query",
  3772. "name": "workspace",
  3773. "schema": {
  3774. "type": "string"
  3775. }
  3776. },
  3777. {
  3778. "in": "path",
  3779. "name": "sessionID",
  3780. "schema": {
  3781. "type": "string",
  3782. "pattern": "^ses.*"
  3783. },
  3784. "required": true
  3785. },
  3786. {
  3787. "in": "path",
  3788. "name": "messageID",
  3789. "schema": {
  3790. "type": "string",
  3791. "pattern": "^msg.*"
  3792. },
  3793. "required": true
  3794. },
  3795. {
  3796. "in": "path",
  3797. "name": "partID",
  3798. "schema": {
  3799. "type": "string",
  3800. "pattern": "^prt.*"
  3801. },
  3802. "required": true
  3803. }
  3804. ],
  3805. "description": "Delete a part from a message",
  3806. "responses": {
  3807. "200": {
  3808. "description": "Successfully deleted part",
  3809. "content": {
  3810. "application/json": {
  3811. "schema": {
  3812. "type": "boolean"
  3813. }
  3814. }
  3815. }
  3816. },
  3817. "400": {
  3818. "description": "Bad request",
  3819. "content": {
  3820. "application/json": {
  3821. "schema": {
  3822. "$ref": "#/components/schemas/BadRequestError"
  3823. }
  3824. }
  3825. }
  3826. },
  3827. "404": {
  3828. "description": "Not found",
  3829. "content": {
  3830. "application/json": {
  3831. "schema": {
  3832. "$ref": "#/components/schemas/NotFoundError"
  3833. }
  3834. }
  3835. }
  3836. }
  3837. },
  3838. "x-codeSamples": [
  3839. {
  3840. "lang": "js",
  3841. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.part.delete({\n ...\n})"
  3842. }
  3843. ]
  3844. },
  3845. "patch": {
  3846. "operationId": "part.update",
  3847. "parameters": [
  3848. {
  3849. "in": "query",
  3850. "name": "directory",
  3851. "schema": {
  3852. "type": "string"
  3853. }
  3854. },
  3855. {
  3856. "in": "query",
  3857. "name": "workspace",
  3858. "schema": {
  3859. "type": "string"
  3860. }
  3861. },
  3862. {
  3863. "in": "path",
  3864. "name": "sessionID",
  3865. "schema": {
  3866. "type": "string",
  3867. "pattern": "^ses.*"
  3868. },
  3869. "required": true
  3870. },
  3871. {
  3872. "in": "path",
  3873. "name": "messageID",
  3874. "schema": {
  3875. "type": "string",
  3876. "pattern": "^msg.*"
  3877. },
  3878. "required": true
  3879. },
  3880. {
  3881. "in": "path",
  3882. "name": "partID",
  3883. "schema": {
  3884. "type": "string",
  3885. "pattern": "^prt.*"
  3886. },
  3887. "required": true
  3888. }
  3889. ],
  3890. "description": "Update a part in a message",
  3891. "responses": {
  3892. "200": {
  3893. "description": "Successfully updated part",
  3894. "content": {
  3895. "application/json": {
  3896. "schema": {
  3897. "$ref": "#/components/schemas/Part"
  3898. }
  3899. }
  3900. }
  3901. },
  3902. "400": {
  3903. "description": "Bad request",
  3904. "content": {
  3905. "application/json": {
  3906. "schema": {
  3907. "$ref": "#/components/schemas/BadRequestError"
  3908. }
  3909. }
  3910. }
  3911. },
  3912. "404": {
  3913. "description": "Not found",
  3914. "content": {
  3915. "application/json": {
  3916. "schema": {
  3917. "$ref": "#/components/schemas/NotFoundError"
  3918. }
  3919. }
  3920. }
  3921. }
  3922. },
  3923. "requestBody": {
  3924. "content": {
  3925. "application/json": {
  3926. "schema": {
  3927. "$ref": "#/components/schemas/Part"
  3928. }
  3929. }
  3930. }
  3931. },
  3932. "x-codeSamples": [
  3933. {
  3934. "lang": "js",
  3935. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.part.update({\n ...\n})"
  3936. }
  3937. ]
  3938. }
  3939. },
  3940. "/session/{sessionID}/prompt_async": {
  3941. "post": {
  3942. "operationId": "session.prompt_async",
  3943. "parameters": [
  3944. {
  3945. "in": "query",
  3946. "name": "directory",
  3947. "schema": {
  3948. "type": "string"
  3949. }
  3950. },
  3951. {
  3952. "in": "query",
  3953. "name": "workspace",
  3954. "schema": {
  3955. "type": "string"
  3956. }
  3957. },
  3958. {
  3959. "in": "path",
  3960. "name": "sessionID",
  3961. "schema": {
  3962. "type": "string",
  3963. "pattern": "^ses.*"
  3964. },
  3965. "required": true
  3966. }
  3967. ],
  3968. "summary": "Send async message",
  3969. "description": "Create and send a new message to a session asynchronously, starting the session if needed and returning immediately.",
  3970. "responses": {
  3971. "204": {
  3972. "description": "Prompt accepted"
  3973. },
  3974. "400": {
  3975. "description": "Bad request",
  3976. "content": {
  3977. "application/json": {
  3978. "schema": {
  3979. "$ref": "#/components/schemas/BadRequestError"
  3980. }
  3981. }
  3982. }
  3983. },
  3984. "404": {
  3985. "description": "Not found",
  3986. "content": {
  3987. "application/json": {
  3988. "schema": {
  3989. "$ref": "#/components/schemas/NotFoundError"
  3990. }
  3991. }
  3992. }
  3993. }
  3994. },
  3995. "requestBody": {
  3996. "content": {
  3997. "application/json": {
  3998. "schema": {
  3999. "type": "object",
  4000. "properties": {
  4001. "messageID": {
  4002. "type": "string",
  4003. "pattern": "^msg.*"
  4004. },
  4005. "model": {
  4006. "type": "object",
  4007. "properties": {
  4008. "providerID": {
  4009. "type": "string"
  4010. },
  4011. "modelID": {
  4012. "type": "string"
  4013. }
  4014. },
  4015. "required": ["providerID", "modelID"]
  4016. },
  4017. "agent": {
  4018. "type": "string"
  4019. },
  4020. "noReply": {
  4021. "type": "boolean"
  4022. },
  4023. "tools": {
  4024. "description": "@deprecated tools and permissions have been merged, you can set permissions on the session itself now",
  4025. "type": "object",
  4026. "propertyNames": {
  4027. "type": "string"
  4028. },
  4029. "additionalProperties": {
  4030. "type": "boolean"
  4031. }
  4032. },
  4033. "format": {
  4034. "$ref": "#/components/schemas/OutputFormat"
  4035. },
  4036. "system": {
  4037. "type": "string"
  4038. },
  4039. "variant": {
  4040. "type": "string"
  4041. },
  4042. "parts": {
  4043. "type": "array",
  4044. "items": {
  4045. "anyOf": [
  4046. {
  4047. "$ref": "#/components/schemas/TextPartInput"
  4048. },
  4049. {
  4050. "$ref": "#/components/schemas/FilePartInput"
  4051. },
  4052. {
  4053. "$ref": "#/components/schemas/AgentPartInput"
  4054. },
  4055. {
  4056. "$ref": "#/components/schemas/SubtaskPartInput"
  4057. }
  4058. ]
  4059. }
  4060. }
  4061. },
  4062. "required": ["parts"]
  4063. }
  4064. }
  4065. }
  4066. },
  4067. "x-codeSamples": [
  4068. {
  4069. "lang": "js",
  4070. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.prompt_async({\n ...\n})"
  4071. }
  4072. ]
  4073. }
  4074. },
  4075. "/session/{sessionID}/command": {
  4076. "post": {
  4077. "operationId": "session.command",
  4078. "parameters": [
  4079. {
  4080. "in": "query",
  4081. "name": "directory",
  4082. "schema": {
  4083. "type": "string"
  4084. }
  4085. },
  4086. {
  4087. "in": "query",
  4088. "name": "workspace",
  4089. "schema": {
  4090. "type": "string"
  4091. }
  4092. },
  4093. {
  4094. "in": "path",
  4095. "name": "sessionID",
  4096. "schema": {
  4097. "type": "string",
  4098. "pattern": "^ses.*"
  4099. },
  4100. "required": true
  4101. }
  4102. ],
  4103. "summary": "Send command",
  4104. "description": "Send a new command to a session for execution by the AI assistant.",
  4105. "responses": {
  4106. "200": {
  4107. "description": "Created message",
  4108. "content": {
  4109. "application/json": {
  4110. "schema": {
  4111. "type": "object",
  4112. "properties": {
  4113. "info": {
  4114. "$ref": "#/components/schemas/AssistantMessage"
  4115. },
  4116. "parts": {
  4117. "type": "array",
  4118. "items": {
  4119. "$ref": "#/components/schemas/Part"
  4120. }
  4121. }
  4122. },
  4123. "required": ["info", "parts"]
  4124. }
  4125. }
  4126. }
  4127. },
  4128. "400": {
  4129. "description": "Bad request",
  4130. "content": {
  4131. "application/json": {
  4132. "schema": {
  4133. "$ref": "#/components/schemas/BadRequestError"
  4134. }
  4135. }
  4136. }
  4137. },
  4138. "404": {
  4139. "description": "Not found",
  4140. "content": {
  4141. "application/json": {
  4142. "schema": {
  4143. "$ref": "#/components/schemas/NotFoundError"
  4144. }
  4145. }
  4146. }
  4147. }
  4148. },
  4149. "requestBody": {
  4150. "content": {
  4151. "application/json": {
  4152. "schema": {
  4153. "type": "object",
  4154. "properties": {
  4155. "messageID": {
  4156. "type": "string",
  4157. "pattern": "^msg.*"
  4158. },
  4159. "agent": {
  4160. "type": "string"
  4161. },
  4162. "model": {
  4163. "type": "string"
  4164. },
  4165. "arguments": {
  4166. "type": "string"
  4167. },
  4168. "command": {
  4169. "type": "string"
  4170. },
  4171. "variant": {
  4172. "type": "string"
  4173. },
  4174. "parts": {
  4175. "type": "array",
  4176. "items": {
  4177. "anyOf": [
  4178. {
  4179. "type": "object",
  4180. "properties": {
  4181. "id": {
  4182. "type": "string",
  4183. "pattern": "^prt.*"
  4184. },
  4185. "type": {
  4186. "type": "string",
  4187. "const": "file"
  4188. },
  4189. "mime": {
  4190. "type": "string"
  4191. },
  4192. "filename": {
  4193. "type": "string"
  4194. },
  4195. "url": {
  4196. "type": "string"
  4197. },
  4198. "source": {
  4199. "$ref": "#/components/schemas/FilePartSource"
  4200. }
  4201. },
  4202. "required": ["type", "mime", "url"]
  4203. }
  4204. ]
  4205. }
  4206. }
  4207. },
  4208. "required": ["arguments", "command"]
  4209. }
  4210. }
  4211. }
  4212. },
  4213. "x-codeSamples": [
  4214. {
  4215. "lang": "js",
  4216. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.command({\n ...\n})"
  4217. }
  4218. ]
  4219. }
  4220. },
  4221. "/session/{sessionID}/shell": {
  4222. "post": {
  4223. "operationId": "session.shell",
  4224. "parameters": [
  4225. {
  4226. "in": "query",
  4227. "name": "directory",
  4228. "schema": {
  4229. "type": "string"
  4230. }
  4231. },
  4232. {
  4233. "in": "query",
  4234. "name": "workspace",
  4235. "schema": {
  4236. "type": "string"
  4237. }
  4238. },
  4239. {
  4240. "in": "path",
  4241. "name": "sessionID",
  4242. "schema": {
  4243. "type": "string",
  4244. "pattern": "^ses.*"
  4245. },
  4246. "required": true
  4247. }
  4248. ],
  4249. "summary": "Run shell command",
  4250. "description": "Execute a shell command within the session context and return the AI's response.",
  4251. "responses": {
  4252. "200": {
  4253. "description": "Created message",
  4254. "content": {
  4255. "application/json": {
  4256. "schema": {
  4257. "type": "object",
  4258. "properties": {
  4259. "info": {
  4260. "$ref": "#/components/schemas/Message"
  4261. },
  4262. "parts": {
  4263. "type": "array",
  4264. "items": {
  4265. "$ref": "#/components/schemas/Part"
  4266. }
  4267. }
  4268. },
  4269. "required": ["info", "parts"]
  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. "messageID": {
  4302. "type": "string",
  4303. "pattern": "^msg.*"
  4304. },
  4305. "agent": {
  4306. "type": "string"
  4307. },
  4308. "model": {
  4309. "type": "object",
  4310. "properties": {
  4311. "providerID": {
  4312. "type": "string"
  4313. },
  4314. "modelID": {
  4315. "type": "string"
  4316. }
  4317. },
  4318. "required": ["providerID", "modelID"]
  4319. },
  4320. "command": {
  4321. "type": "string"
  4322. }
  4323. },
  4324. "required": ["agent", "command"]
  4325. }
  4326. }
  4327. }
  4328. },
  4329. "x-codeSamples": [
  4330. {
  4331. "lang": "js",
  4332. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.shell({\n ...\n})"
  4333. }
  4334. ]
  4335. }
  4336. },
  4337. "/session/{sessionID}/revert": {
  4338. "post": {
  4339. "operationId": "session.revert",
  4340. "parameters": [
  4341. {
  4342. "in": "query",
  4343. "name": "directory",
  4344. "schema": {
  4345. "type": "string"
  4346. }
  4347. },
  4348. {
  4349. "in": "query",
  4350. "name": "workspace",
  4351. "schema": {
  4352. "type": "string"
  4353. }
  4354. },
  4355. {
  4356. "in": "path",
  4357. "name": "sessionID",
  4358. "schema": {
  4359. "type": "string",
  4360. "pattern": "^ses.*"
  4361. },
  4362. "required": true
  4363. }
  4364. ],
  4365. "summary": "Revert message",
  4366. "description": "Revert a specific message in a session, undoing its effects and restoring the previous state.",
  4367. "responses": {
  4368. "200": {
  4369. "description": "Updated session",
  4370. "content": {
  4371. "application/json": {
  4372. "schema": {
  4373. "$ref": "#/components/schemas/Session"
  4374. }
  4375. }
  4376. }
  4377. },
  4378. "400": {
  4379. "description": "Bad request",
  4380. "content": {
  4381. "application/json": {
  4382. "schema": {
  4383. "$ref": "#/components/schemas/BadRequestError"
  4384. }
  4385. }
  4386. }
  4387. },
  4388. "404": {
  4389. "description": "Not found",
  4390. "content": {
  4391. "application/json": {
  4392. "schema": {
  4393. "$ref": "#/components/schemas/NotFoundError"
  4394. }
  4395. }
  4396. }
  4397. }
  4398. },
  4399. "requestBody": {
  4400. "content": {
  4401. "application/json": {
  4402. "schema": {
  4403. "type": "object",
  4404. "properties": {
  4405. "messageID": {
  4406. "type": "string",
  4407. "pattern": "^msg.*"
  4408. },
  4409. "partID": {
  4410. "type": "string",
  4411. "pattern": "^prt.*"
  4412. }
  4413. },
  4414. "required": ["messageID"]
  4415. }
  4416. }
  4417. }
  4418. },
  4419. "x-codeSamples": [
  4420. {
  4421. "lang": "js",
  4422. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.revert({\n ...\n})"
  4423. }
  4424. ]
  4425. }
  4426. },
  4427. "/session/{sessionID}/unrevert": {
  4428. "post": {
  4429. "operationId": "session.unrevert",
  4430. "parameters": [
  4431. {
  4432. "in": "query",
  4433. "name": "directory",
  4434. "schema": {
  4435. "type": "string"
  4436. }
  4437. },
  4438. {
  4439. "in": "query",
  4440. "name": "workspace",
  4441. "schema": {
  4442. "type": "string"
  4443. }
  4444. },
  4445. {
  4446. "in": "path",
  4447. "name": "sessionID",
  4448. "schema": {
  4449. "type": "string",
  4450. "pattern": "^ses.*"
  4451. },
  4452. "required": true
  4453. }
  4454. ],
  4455. "summary": "Restore reverted messages",
  4456. "description": "Restore all previously reverted messages in a session.",
  4457. "responses": {
  4458. "200": {
  4459. "description": "Updated session",
  4460. "content": {
  4461. "application/json": {
  4462. "schema": {
  4463. "$ref": "#/components/schemas/Session"
  4464. }
  4465. }
  4466. }
  4467. },
  4468. "400": {
  4469. "description": "Bad request",
  4470. "content": {
  4471. "application/json": {
  4472. "schema": {
  4473. "$ref": "#/components/schemas/BadRequestError"
  4474. }
  4475. }
  4476. }
  4477. },
  4478. "404": {
  4479. "description": "Not found",
  4480. "content": {
  4481. "application/json": {
  4482. "schema": {
  4483. "$ref": "#/components/schemas/NotFoundError"
  4484. }
  4485. }
  4486. }
  4487. }
  4488. },
  4489. "x-codeSamples": [
  4490. {
  4491. "lang": "js",
  4492. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.unrevert({\n ...\n})"
  4493. }
  4494. ]
  4495. }
  4496. },
  4497. "/session/{sessionID}/permissions/{permissionID}": {
  4498. "post": {
  4499. "operationId": "permission.respond",
  4500. "parameters": [
  4501. {
  4502. "in": "query",
  4503. "name": "directory",
  4504. "schema": {
  4505. "type": "string"
  4506. }
  4507. },
  4508. {
  4509. "in": "query",
  4510. "name": "workspace",
  4511. "schema": {
  4512. "type": "string"
  4513. }
  4514. },
  4515. {
  4516. "in": "path",
  4517. "name": "sessionID",
  4518. "schema": {
  4519. "type": "string",
  4520. "pattern": "^ses.*"
  4521. },
  4522. "required": true
  4523. },
  4524. {
  4525. "in": "path",
  4526. "name": "permissionID",
  4527. "schema": {
  4528. "type": "string",
  4529. "pattern": "^per.*"
  4530. },
  4531. "required": true
  4532. }
  4533. ],
  4534. "summary": "Respond to permission",
  4535. "deprecated": true,
  4536. "description": "Approve or deny a permission request from the AI assistant.",
  4537. "responses": {
  4538. "200": {
  4539. "description": "Permission processed successfully",
  4540. "content": {
  4541. "application/json": {
  4542. "schema": {
  4543. "type": "boolean"
  4544. }
  4545. }
  4546. }
  4547. },
  4548. "400": {
  4549. "description": "Bad request",
  4550. "content": {
  4551. "application/json": {
  4552. "schema": {
  4553. "$ref": "#/components/schemas/BadRequestError"
  4554. }
  4555. }
  4556. }
  4557. },
  4558. "404": {
  4559. "description": "Not found",
  4560. "content": {
  4561. "application/json": {
  4562. "schema": {
  4563. "$ref": "#/components/schemas/NotFoundError"
  4564. }
  4565. }
  4566. }
  4567. }
  4568. },
  4569. "requestBody": {
  4570. "content": {
  4571. "application/json": {
  4572. "schema": {
  4573. "type": "object",
  4574. "properties": {
  4575. "response": {
  4576. "type": "string",
  4577. "enum": ["once", "always", "reject"]
  4578. }
  4579. },
  4580. "required": ["response"]
  4581. }
  4582. }
  4583. }
  4584. },
  4585. "x-codeSamples": [
  4586. {
  4587. "lang": "js",
  4588. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.permission.respond({\n ...\n})"
  4589. }
  4590. ]
  4591. }
  4592. },
  4593. "/permission/{requestID}/reply": {
  4594. "post": {
  4595. "operationId": "permission.reply",
  4596. "parameters": [
  4597. {
  4598. "in": "query",
  4599. "name": "directory",
  4600. "schema": {
  4601. "type": "string"
  4602. }
  4603. },
  4604. {
  4605. "in": "query",
  4606. "name": "workspace",
  4607. "schema": {
  4608. "type": "string"
  4609. }
  4610. },
  4611. {
  4612. "in": "path",
  4613. "name": "requestID",
  4614. "schema": {
  4615. "type": "string",
  4616. "pattern": "^per.*"
  4617. },
  4618. "required": true
  4619. }
  4620. ],
  4621. "summary": "Respond to permission request",
  4622. "description": "Approve or deny a permission request from the AI assistant.",
  4623. "responses": {
  4624. "200": {
  4625. "description": "Permission processed successfully",
  4626. "content": {
  4627. "application/json": {
  4628. "schema": {
  4629. "type": "boolean"
  4630. }
  4631. }
  4632. }
  4633. },
  4634. "400": {
  4635. "description": "Bad request",
  4636. "content": {
  4637. "application/json": {
  4638. "schema": {
  4639. "$ref": "#/components/schemas/BadRequestError"
  4640. }
  4641. }
  4642. }
  4643. },
  4644. "404": {
  4645. "description": "Not found",
  4646. "content": {
  4647. "application/json": {
  4648. "schema": {
  4649. "$ref": "#/components/schemas/NotFoundError"
  4650. }
  4651. }
  4652. }
  4653. }
  4654. },
  4655. "requestBody": {
  4656. "content": {
  4657. "application/json": {
  4658. "schema": {
  4659. "type": "object",
  4660. "properties": {
  4661. "reply": {
  4662. "type": "string",
  4663. "enum": ["once", "always", "reject"]
  4664. },
  4665. "message": {
  4666. "type": "string"
  4667. }
  4668. },
  4669. "required": ["reply"]
  4670. }
  4671. }
  4672. }
  4673. },
  4674. "x-codeSamples": [
  4675. {
  4676. "lang": "js",
  4677. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.permission.reply({\n ...\n})"
  4678. }
  4679. ]
  4680. }
  4681. },
  4682. "/permission": {
  4683. "get": {
  4684. "operationId": "permission.list",
  4685. "parameters": [
  4686. {
  4687. "in": "query",
  4688. "name": "directory",
  4689. "schema": {
  4690. "type": "string"
  4691. }
  4692. },
  4693. {
  4694. "in": "query",
  4695. "name": "workspace",
  4696. "schema": {
  4697. "type": "string"
  4698. }
  4699. }
  4700. ],
  4701. "summary": "List pending permissions",
  4702. "description": "Get all pending permission requests across all sessions.",
  4703. "responses": {
  4704. "200": {
  4705. "description": "List of pending permissions",
  4706. "content": {
  4707. "application/json": {
  4708. "schema": {
  4709. "type": "array",
  4710. "items": {
  4711. "$ref": "#/components/schemas/PermissionRequest"
  4712. }
  4713. }
  4714. }
  4715. }
  4716. }
  4717. },
  4718. "x-codeSamples": [
  4719. {
  4720. "lang": "js",
  4721. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.permission.list({\n ...\n})"
  4722. }
  4723. ]
  4724. }
  4725. },
  4726. "/question": {
  4727. "get": {
  4728. "operationId": "question.list",
  4729. "parameters": [
  4730. {
  4731. "in": "query",
  4732. "name": "directory",
  4733. "schema": {
  4734. "type": "string"
  4735. }
  4736. },
  4737. {
  4738. "in": "query",
  4739. "name": "workspace",
  4740. "schema": {
  4741. "type": "string"
  4742. }
  4743. }
  4744. ],
  4745. "summary": "List pending questions",
  4746. "description": "Get all pending question requests across all sessions.",
  4747. "responses": {
  4748. "200": {
  4749. "description": "List of pending questions",
  4750. "content": {
  4751. "application/json": {
  4752. "schema": {
  4753. "type": "array",
  4754. "items": {
  4755. "$ref": "#/components/schemas/QuestionRequest"
  4756. }
  4757. }
  4758. }
  4759. }
  4760. }
  4761. },
  4762. "x-codeSamples": [
  4763. {
  4764. "lang": "js",
  4765. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.question.list({\n ...\n})"
  4766. }
  4767. ]
  4768. }
  4769. },
  4770. "/question/{requestID}/reply": {
  4771. "post": {
  4772. "operationId": "question.reply",
  4773. "parameters": [
  4774. {
  4775. "in": "query",
  4776. "name": "directory",
  4777. "schema": {
  4778. "type": "string"
  4779. }
  4780. },
  4781. {
  4782. "in": "query",
  4783. "name": "workspace",
  4784. "schema": {
  4785. "type": "string"
  4786. }
  4787. },
  4788. {
  4789. "in": "path",
  4790. "name": "requestID",
  4791. "schema": {
  4792. "type": "string",
  4793. "pattern": "^que.*"
  4794. },
  4795. "required": true
  4796. }
  4797. ],
  4798. "summary": "Reply to question request",
  4799. "description": "Provide answers to a question request from the AI assistant.",
  4800. "responses": {
  4801. "200": {
  4802. "description": "Question answered successfully",
  4803. "content": {
  4804. "application/json": {
  4805. "schema": {
  4806. "type": "boolean"
  4807. }
  4808. }
  4809. }
  4810. },
  4811. "400": {
  4812. "description": "Bad request",
  4813. "content": {
  4814. "application/json": {
  4815. "schema": {
  4816. "$ref": "#/components/schemas/BadRequestError"
  4817. }
  4818. }
  4819. }
  4820. },
  4821. "404": {
  4822. "description": "Not found",
  4823. "content": {
  4824. "application/json": {
  4825. "schema": {
  4826. "$ref": "#/components/schemas/NotFoundError"
  4827. }
  4828. }
  4829. }
  4830. }
  4831. },
  4832. "requestBody": {
  4833. "content": {
  4834. "application/json": {
  4835. "schema": {
  4836. "type": "object",
  4837. "properties": {
  4838. "answers": {
  4839. "description": "User answers in order of questions (each answer is an array of selected labels)",
  4840. "type": "array",
  4841. "items": {
  4842. "$ref": "#/components/schemas/QuestionAnswer"
  4843. }
  4844. }
  4845. },
  4846. "required": ["answers"]
  4847. }
  4848. }
  4849. }
  4850. },
  4851. "x-codeSamples": [
  4852. {
  4853. "lang": "js",
  4854. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.question.reply({\n ...\n})"
  4855. }
  4856. ]
  4857. }
  4858. },
  4859. "/question/{requestID}/reject": {
  4860. "post": {
  4861. "operationId": "question.reject",
  4862. "parameters": [
  4863. {
  4864. "in": "query",
  4865. "name": "directory",
  4866. "schema": {
  4867. "type": "string"
  4868. }
  4869. },
  4870. {
  4871. "in": "query",
  4872. "name": "workspace",
  4873. "schema": {
  4874. "type": "string"
  4875. }
  4876. },
  4877. {
  4878. "in": "path",
  4879. "name": "requestID",
  4880. "schema": {
  4881. "type": "string",
  4882. "pattern": "^que.*"
  4883. },
  4884. "required": true
  4885. }
  4886. ],
  4887. "summary": "Reject question request",
  4888. "description": "Reject a question request from the AI assistant.",
  4889. "responses": {
  4890. "200": {
  4891. "description": "Question rejected successfully",
  4892. "content": {
  4893. "application/json": {
  4894. "schema": {
  4895. "type": "boolean"
  4896. }
  4897. }
  4898. }
  4899. },
  4900. "400": {
  4901. "description": "Bad request",
  4902. "content": {
  4903. "application/json": {
  4904. "schema": {
  4905. "$ref": "#/components/schemas/BadRequestError"
  4906. }
  4907. }
  4908. }
  4909. },
  4910. "404": {
  4911. "description": "Not found",
  4912. "content": {
  4913. "application/json": {
  4914. "schema": {
  4915. "$ref": "#/components/schemas/NotFoundError"
  4916. }
  4917. }
  4918. }
  4919. }
  4920. },
  4921. "x-codeSamples": [
  4922. {
  4923. "lang": "js",
  4924. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.question.reject({\n ...\n})"
  4925. }
  4926. ]
  4927. }
  4928. },
  4929. "/provider": {
  4930. "get": {
  4931. "operationId": "provider.list",
  4932. "parameters": [
  4933. {
  4934. "in": "query",
  4935. "name": "directory",
  4936. "schema": {
  4937. "type": "string"
  4938. }
  4939. },
  4940. {
  4941. "in": "query",
  4942. "name": "workspace",
  4943. "schema": {
  4944. "type": "string"
  4945. }
  4946. }
  4947. ],
  4948. "summary": "List providers",
  4949. "description": "Get a list of all available AI providers, including both available and connected ones.",
  4950. "responses": {
  4951. "200": {
  4952. "description": "List of providers",
  4953. "content": {
  4954. "application/json": {
  4955. "schema": {
  4956. "type": "object",
  4957. "properties": {
  4958. "all": {
  4959. "type": "array",
  4960. "items": {
  4961. "$ref": "#/components/schemas/Provider"
  4962. }
  4963. },
  4964. "default": {
  4965. "type": "object",
  4966. "propertyNames": {
  4967. "type": "string"
  4968. },
  4969. "additionalProperties": {
  4970. "type": "string"
  4971. }
  4972. },
  4973. "connected": {
  4974. "type": "array",
  4975. "items": {
  4976. "type": "string"
  4977. }
  4978. }
  4979. },
  4980. "required": ["all", "default", "connected"]
  4981. }
  4982. }
  4983. }
  4984. }
  4985. },
  4986. "x-codeSamples": [
  4987. {
  4988. "lang": "js",
  4989. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.list({\n ...\n})"
  4990. }
  4991. ]
  4992. }
  4993. },
  4994. "/provider/auth": {
  4995. "get": {
  4996. "operationId": "provider.auth",
  4997. "parameters": [
  4998. {
  4999. "in": "query",
  5000. "name": "directory",
  5001. "schema": {
  5002. "type": "string"
  5003. }
  5004. },
  5005. {
  5006. "in": "query",
  5007. "name": "workspace",
  5008. "schema": {
  5009. "type": "string"
  5010. }
  5011. }
  5012. ],
  5013. "summary": "Get provider auth methods",
  5014. "description": "Retrieve available authentication methods for all AI providers.",
  5015. "responses": {
  5016. "200": {
  5017. "description": "Provider auth methods",
  5018. "content": {
  5019. "application/json": {
  5020. "schema": {
  5021. "type": "object",
  5022. "propertyNames": {
  5023. "type": "string"
  5024. },
  5025. "additionalProperties": {
  5026. "type": "array",
  5027. "items": {
  5028. "$ref": "#/components/schemas/ProviderAuthMethod"
  5029. }
  5030. }
  5031. }
  5032. }
  5033. }
  5034. }
  5035. },
  5036. "x-codeSamples": [
  5037. {
  5038. "lang": "js",
  5039. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.auth({\n ...\n})"
  5040. }
  5041. ]
  5042. }
  5043. },
  5044. "/provider/{providerID}/oauth/authorize": {
  5045. "post": {
  5046. "operationId": "provider.oauth.authorize",
  5047. "parameters": [
  5048. {
  5049. "in": "query",
  5050. "name": "directory",
  5051. "schema": {
  5052. "type": "string"
  5053. }
  5054. },
  5055. {
  5056. "in": "query",
  5057. "name": "workspace",
  5058. "schema": {
  5059. "type": "string"
  5060. }
  5061. },
  5062. {
  5063. "in": "path",
  5064. "name": "providerID",
  5065. "schema": {
  5066. "type": "string"
  5067. },
  5068. "required": true,
  5069. "description": "Provider ID"
  5070. }
  5071. ],
  5072. "summary": "OAuth authorize",
  5073. "description": "Initiate OAuth authorization for a specific AI provider to get an authorization URL.",
  5074. "responses": {
  5075. "200": {
  5076. "description": "Authorization URL and method",
  5077. "content": {
  5078. "application/json": {
  5079. "schema": {
  5080. "$ref": "#/components/schemas/ProviderAuthAuthorization"
  5081. }
  5082. }
  5083. }
  5084. },
  5085. "400": {
  5086. "description": "Bad request",
  5087. "content": {
  5088. "application/json": {
  5089. "schema": {
  5090. "$ref": "#/components/schemas/BadRequestError"
  5091. }
  5092. }
  5093. }
  5094. }
  5095. },
  5096. "requestBody": {
  5097. "content": {
  5098. "application/json": {
  5099. "schema": {
  5100. "type": "object",
  5101. "properties": {
  5102. "method": {
  5103. "description": "Auth method index",
  5104. "type": "number"
  5105. },
  5106. "inputs": {
  5107. "description": "Prompt inputs",
  5108. "type": "object",
  5109. "propertyNames": {
  5110. "type": "string"
  5111. },
  5112. "additionalProperties": {
  5113. "type": "string"
  5114. }
  5115. }
  5116. },
  5117. "required": ["method"]
  5118. }
  5119. }
  5120. }
  5121. },
  5122. "x-codeSamples": [
  5123. {
  5124. "lang": "js",
  5125. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.oauth.authorize({\n ...\n})"
  5126. }
  5127. ]
  5128. }
  5129. },
  5130. "/provider/{providerID}/oauth/callback": {
  5131. "post": {
  5132. "operationId": "provider.oauth.callback",
  5133. "parameters": [
  5134. {
  5135. "in": "query",
  5136. "name": "directory",
  5137. "schema": {
  5138. "type": "string"
  5139. }
  5140. },
  5141. {
  5142. "in": "query",
  5143. "name": "workspace",
  5144. "schema": {
  5145. "type": "string"
  5146. }
  5147. },
  5148. {
  5149. "in": "path",
  5150. "name": "providerID",
  5151. "schema": {
  5152. "type": "string"
  5153. },
  5154. "required": true,
  5155. "description": "Provider ID"
  5156. }
  5157. ],
  5158. "summary": "OAuth callback",
  5159. "description": "Handle the OAuth callback from a provider after user authorization.",
  5160. "responses": {
  5161. "200": {
  5162. "description": "OAuth callback processed successfully",
  5163. "content": {
  5164. "application/json": {
  5165. "schema": {
  5166. "type": "boolean"
  5167. }
  5168. }
  5169. }
  5170. },
  5171. "400": {
  5172. "description": "Bad request",
  5173. "content": {
  5174. "application/json": {
  5175. "schema": {
  5176. "$ref": "#/components/schemas/BadRequestError"
  5177. }
  5178. }
  5179. }
  5180. }
  5181. },
  5182. "requestBody": {
  5183. "content": {
  5184. "application/json": {
  5185. "schema": {
  5186. "type": "object",
  5187. "properties": {
  5188. "method": {
  5189. "description": "Auth method index",
  5190. "type": "number"
  5191. },
  5192. "code": {
  5193. "description": "OAuth authorization code",
  5194. "type": "string"
  5195. }
  5196. },
  5197. "required": ["method"]
  5198. }
  5199. }
  5200. }
  5201. },
  5202. "x-codeSamples": [
  5203. {
  5204. "lang": "js",
  5205. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.oauth.callback({\n ...\n})"
  5206. }
  5207. ]
  5208. }
  5209. },
  5210. "/sync/start": {
  5211. "post": {
  5212. "operationId": "sync.start",
  5213. "parameters": [
  5214. {
  5215. "in": "query",
  5216. "name": "directory",
  5217. "schema": {
  5218. "type": "string"
  5219. }
  5220. },
  5221. {
  5222. "in": "query",
  5223. "name": "workspace",
  5224. "schema": {
  5225. "type": "string"
  5226. }
  5227. }
  5228. ],
  5229. "summary": "Start workspace sync",
  5230. "description": "Start sync loops for workspaces in the current project that have active sessions.",
  5231. "responses": {
  5232. "200": {
  5233. "description": "Workspace sync started",
  5234. "content": {
  5235. "application/json": {
  5236. "schema": {
  5237. "type": "boolean"
  5238. }
  5239. }
  5240. }
  5241. }
  5242. },
  5243. "x-codeSamples": [
  5244. {
  5245. "lang": "js",
  5246. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.sync.start({\n ...\n})"
  5247. }
  5248. ]
  5249. }
  5250. },
  5251. "/sync/replay": {
  5252. "post": {
  5253. "operationId": "sync.replay",
  5254. "parameters": [
  5255. {
  5256. "in": "query",
  5257. "name": "directory",
  5258. "schema": {
  5259. "type": "string"
  5260. }
  5261. },
  5262. {
  5263. "in": "query",
  5264. "name": "workspace",
  5265. "schema": {
  5266. "type": "string"
  5267. }
  5268. }
  5269. ],
  5270. "summary": "Replay sync events",
  5271. "description": "Validate and replay a complete sync event history.",
  5272. "responses": {
  5273. "200": {
  5274. "description": "Replayed sync events",
  5275. "content": {
  5276. "application/json": {
  5277. "schema": {
  5278. "type": "object",
  5279. "properties": {
  5280. "sessionID": {
  5281. "type": "string"
  5282. }
  5283. },
  5284. "required": ["sessionID"]
  5285. }
  5286. }
  5287. }
  5288. },
  5289. "400": {
  5290. "description": "Bad request",
  5291. "content": {
  5292. "application/json": {
  5293. "schema": {
  5294. "$ref": "#/components/schemas/BadRequestError"
  5295. }
  5296. }
  5297. }
  5298. }
  5299. },
  5300. "requestBody": {
  5301. "content": {
  5302. "application/json": {
  5303. "schema": {
  5304. "type": "object",
  5305. "properties": {
  5306. "directory": {
  5307. "type": "string"
  5308. },
  5309. "events": {
  5310. "minItems": 1,
  5311. "type": "array",
  5312. "items": {
  5313. "type": "object",
  5314. "properties": {
  5315. "id": {
  5316. "type": "string"
  5317. },
  5318. "aggregateID": {
  5319. "type": "string"
  5320. },
  5321. "seq": {
  5322. "type": "integer",
  5323. "minimum": 0,
  5324. "maximum": 9007199254740991
  5325. },
  5326. "type": {
  5327. "type": "string"
  5328. },
  5329. "data": {
  5330. "type": "object",
  5331. "propertyNames": {
  5332. "type": "string"
  5333. },
  5334. "additionalProperties": {}
  5335. }
  5336. },
  5337. "required": ["id", "aggregateID", "seq", "type", "data"]
  5338. }
  5339. }
  5340. },
  5341. "required": ["directory", "events"]
  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.sync.replay({\n ...\n})"
  5350. }
  5351. ]
  5352. }
  5353. },
  5354. "/sync/history": {
  5355. "post": {
  5356. "operationId": "sync.history.list",
  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": "List sync events",
  5374. "description": "List sync events for all aggregates. Keys are aggregate IDs the client already knows about, values are the last known sequence ID. Events with seq > value are returned for those aggregates. Aggregates not listed in the input get their full history.",
  5375. "responses": {
  5376. "200": {
  5377. "description": "Sync events",
  5378. "content": {
  5379. "application/json": {
  5380. "schema": {
  5381. "type": "array",
  5382. "items": {
  5383. "type": "object",
  5384. "properties": {
  5385. "id": {
  5386. "type": "string"
  5387. },
  5388. "aggregate_id": {
  5389. "type": "string"
  5390. },
  5391. "seq": {
  5392. "type": "number"
  5393. },
  5394. "type": {
  5395. "type": "string"
  5396. },
  5397. "data": {
  5398. "type": "object",
  5399. "propertyNames": {
  5400. "type": "string"
  5401. },
  5402. "additionalProperties": {}
  5403. }
  5404. },
  5405. "required": ["id", "aggregate_id", "seq", "type", "data"]
  5406. }
  5407. }
  5408. }
  5409. }
  5410. },
  5411. "400": {
  5412. "description": "Bad request",
  5413. "content": {
  5414. "application/json": {
  5415. "schema": {
  5416. "$ref": "#/components/schemas/BadRequestError"
  5417. }
  5418. }
  5419. }
  5420. }
  5421. },
  5422. "requestBody": {
  5423. "content": {
  5424. "application/json": {
  5425. "schema": {
  5426. "type": "object",
  5427. "propertyNames": {
  5428. "type": "string"
  5429. },
  5430. "additionalProperties": {
  5431. "type": "integer",
  5432. "minimum": 0,
  5433. "maximum": 9007199254740991
  5434. }
  5435. }
  5436. }
  5437. }
  5438. },
  5439. "x-codeSamples": [
  5440. {
  5441. "lang": "js",
  5442. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.sync.history.list({\n ...\n})"
  5443. }
  5444. ]
  5445. }
  5446. },
  5447. "/find": {
  5448. "get": {
  5449. "operationId": "find.text",
  5450. "parameters": [
  5451. {
  5452. "in": "query",
  5453. "name": "directory",
  5454. "schema": {
  5455. "type": "string"
  5456. }
  5457. },
  5458. {
  5459. "in": "query",
  5460. "name": "workspace",
  5461. "schema": {
  5462. "type": "string"
  5463. }
  5464. },
  5465. {
  5466. "in": "query",
  5467. "name": "pattern",
  5468. "schema": {
  5469. "type": "string"
  5470. },
  5471. "required": true
  5472. }
  5473. ],
  5474. "summary": "Find text",
  5475. "description": "Search for text patterns across files in the project using ripgrep.",
  5476. "responses": {
  5477. "200": {
  5478. "description": "Matches",
  5479. "content": {
  5480. "application/json": {
  5481. "schema": {
  5482. "type": "array",
  5483. "items": {
  5484. "type": "object",
  5485. "properties": {
  5486. "path": {
  5487. "type": "object",
  5488. "properties": {
  5489. "text": {
  5490. "type": "string"
  5491. }
  5492. },
  5493. "required": ["text"]
  5494. },
  5495. "lines": {
  5496. "type": "object",
  5497. "properties": {
  5498. "text": {
  5499. "type": "string"
  5500. }
  5501. },
  5502. "required": ["text"]
  5503. },
  5504. "line_number": {
  5505. "type": "number"
  5506. },
  5507. "absolute_offset": {
  5508. "type": "number"
  5509. },
  5510. "submatches": {
  5511. "type": "array",
  5512. "items": {
  5513. "type": "object",
  5514. "properties": {
  5515. "match": {
  5516. "type": "object",
  5517. "properties": {
  5518. "text": {
  5519. "type": "string"
  5520. }
  5521. },
  5522. "required": ["text"]
  5523. },
  5524. "start": {
  5525. "type": "number"
  5526. },
  5527. "end": {
  5528. "type": "number"
  5529. }
  5530. },
  5531. "required": ["match", "start", "end"]
  5532. }
  5533. }
  5534. },
  5535. "required": ["path", "lines", "line_number", "absolute_offset", "submatches"]
  5536. }
  5537. }
  5538. }
  5539. }
  5540. }
  5541. },
  5542. "x-codeSamples": [
  5543. {
  5544. "lang": "js",
  5545. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.find.text({\n ...\n})"
  5546. }
  5547. ]
  5548. }
  5549. },
  5550. "/find/file": {
  5551. "get": {
  5552. "operationId": "find.files",
  5553. "parameters": [
  5554. {
  5555. "in": "query",
  5556. "name": "directory",
  5557. "schema": {
  5558. "type": "string"
  5559. }
  5560. },
  5561. {
  5562. "in": "query",
  5563. "name": "workspace",
  5564. "schema": {
  5565. "type": "string"
  5566. }
  5567. },
  5568. {
  5569. "in": "query",
  5570. "name": "query",
  5571. "schema": {
  5572. "type": "string"
  5573. },
  5574. "required": true
  5575. },
  5576. {
  5577. "in": "query",
  5578. "name": "dirs",
  5579. "schema": {
  5580. "type": "string",
  5581. "enum": ["true", "false"]
  5582. }
  5583. },
  5584. {
  5585. "in": "query",
  5586. "name": "type",
  5587. "schema": {
  5588. "type": "string",
  5589. "enum": ["file", "directory"]
  5590. }
  5591. },
  5592. {
  5593. "in": "query",
  5594. "name": "limit",
  5595. "schema": {
  5596. "type": "integer",
  5597. "minimum": 1,
  5598. "maximum": 200
  5599. }
  5600. }
  5601. ],
  5602. "summary": "Find files",
  5603. "description": "Search for files or directories by name or pattern in the project directory.",
  5604. "responses": {
  5605. "200": {
  5606. "description": "File paths",
  5607. "content": {
  5608. "application/json": {
  5609. "schema": {
  5610. "type": "array",
  5611. "items": {
  5612. "type": "string"
  5613. }
  5614. }
  5615. }
  5616. }
  5617. }
  5618. },
  5619. "x-codeSamples": [
  5620. {
  5621. "lang": "js",
  5622. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.find.files({\n ...\n})"
  5623. }
  5624. ]
  5625. }
  5626. },
  5627. "/find/symbol": {
  5628. "get": {
  5629. "operationId": "find.symbols",
  5630. "parameters": [
  5631. {
  5632. "in": "query",
  5633. "name": "directory",
  5634. "schema": {
  5635. "type": "string"
  5636. }
  5637. },
  5638. {
  5639. "in": "query",
  5640. "name": "workspace",
  5641. "schema": {
  5642. "type": "string"
  5643. }
  5644. },
  5645. {
  5646. "in": "query",
  5647. "name": "query",
  5648. "schema": {
  5649. "type": "string"
  5650. },
  5651. "required": true
  5652. }
  5653. ],
  5654. "summary": "Find symbols",
  5655. "description": "Search for workspace symbols like functions, classes, and variables using LSP.",
  5656. "responses": {
  5657. "200": {
  5658. "description": "Symbols",
  5659. "content": {
  5660. "application/json": {
  5661. "schema": {
  5662. "type": "array",
  5663. "items": {
  5664. "$ref": "#/components/schemas/Symbol"
  5665. }
  5666. }
  5667. }
  5668. }
  5669. }
  5670. },
  5671. "x-codeSamples": [
  5672. {
  5673. "lang": "js",
  5674. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.find.symbols({\n ...\n})"
  5675. }
  5676. ]
  5677. }
  5678. },
  5679. "/file": {
  5680. "get": {
  5681. "operationId": "file.list",
  5682. "parameters": [
  5683. {
  5684. "in": "query",
  5685. "name": "directory",
  5686. "schema": {
  5687. "type": "string"
  5688. }
  5689. },
  5690. {
  5691. "in": "query",
  5692. "name": "workspace",
  5693. "schema": {
  5694. "type": "string"
  5695. }
  5696. },
  5697. {
  5698. "in": "query",
  5699. "name": "path",
  5700. "schema": {
  5701. "type": "string"
  5702. },
  5703. "required": true
  5704. }
  5705. ],
  5706. "summary": "List files",
  5707. "description": "List files and directories in a specified path.",
  5708. "responses": {
  5709. "200": {
  5710. "description": "Files and directories",
  5711. "content": {
  5712. "application/json": {
  5713. "schema": {
  5714. "type": "array",
  5715. "items": {
  5716. "$ref": "#/components/schemas/FileNode"
  5717. }
  5718. }
  5719. }
  5720. }
  5721. }
  5722. },
  5723. "x-codeSamples": [
  5724. {
  5725. "lang": "js",
  5726. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.file.list({\n ...\n})"
  5727. }
  5728. ]
  5729. }
  5730. },
  5731. "/file/content": {
  5732. "get": {
  5733. "operationId": "file.read",
  5734. "parameters": [
  5735. {
  5736. "in": "query",
  5737. "name": "directory",
  5738. "schema": {
  5739. "type": "string"
  5740. }
  5741. },
  5742. {
  5743. "in": "query",
  5744. "name": "workspace",
  5745. "schema": {
  5746. "type": "string"
  5747. }
  5748. },
  5749. {
  5750. "in": "query",
  5751. "name": "path",
  5752. "schema": {
  5753. "type": "string"
  5754. },
  5755. "required": true
  5756. }
  5757. ],
  5758. "summary": "Read file",
  5759. "description": "Read the content of a specified file.",
  5760. "responses": {
  5761. "200": {
  5762. "description": "File content",
  5763. "content": {
  5764. "application/json": {
  5765. "schema": {
  5766. "$ref": "#/components/schemas/FileContent"
  5767. }
  5768. }
  5769. }
  5770. }
  5771. },
  5772. "x-codeSamples": [
  5773. {
  5774. "lang": "js",
  5775. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.file.read({\n ...\n})"
  5776. }
  5777. ]
  5778. }
  5779. },
  5780. "/file/status": {
  5781. "get": {
  5782. "operationId": "file.status",
  5783. "parameters": [
  5784. {
  5785. "in": "query",
  5786. "name": "directory",
  5787. "schema": {
  5788. "type": "string"
  5789. }
  5790. },
  5791. {
  5792. "in": "query",
  5793. "name": "workspace",
  5794. "schema": {
  5795. "type": "string"
  5796. }
  5797. }
  5798. ],
  5799. "summary": "Get file status",
  5800. "description": "Get the git status of all files in the project.",
  5801. "responses": {
  5802. "200": {
  5803. "description": "File status",
  5804. "content": {
  5805. "application/json": {
  5806. "schema": {
  5807. "type": "array",
  5808. "items": {
  5809. "$ref": "#/components/schemas/File"
  5810. }
  5811. }
  5812. }
  5813. }
  5814. }
  5815. },
  5816. "x-codeSamples": [
  5817. {
  5818. "lang": "js",
  5819. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.file.status({\n ...\n})"
  5820. }
  5821. ]
  5822. }
  5823. },
  5824. "/event": {
  5825. "get": {
  5826. "operationId": "event.subscribe",
  5827. "parameters": [
  5828. {
  5829. "in": "query",
  5830. "name": "directory",
  5831. "schema": {
  5832. "type": "string"
  5833. }
  5834. },
  5835. {
  5836. "in": "query",
  5837. "name": "workspace",
  5838. "schema": {
  5839. "type": "string"
  5840. }
  5841. }
  5842. ],
  5843. "summary": "Subscribe to events",
  5844. "description": "Get events",
  5845. "responses": {
  5846. "200": {
  5847. "description": "Event stream",
  5848. "content": {
  5849. "text/event-stream": {
  5850. "schema": {
  5851. "$ref": "#/components/schemas/Event"
  5852. }
  5853. }
  5854. }
  5855. }
  5856. },
  5857. "x-codeSamples": [
  5858. {
  5859. "lang": "js",
  5860. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.event.subscribe({\n ...\n})"
  5861. }
  5862. ]
  5863. }
  5864. },
  5865. "/mcp": {
  5866. "get": {
  5867. "operationId": "mcp.status",
  5868. "parameters": [
  5869. {
  5870. "in": "query",
  5871. "name": "directory",
  5872. "schema": {
  5873. "type": "string"
  5874. }
  5875. },
  5876. {
  5877. "in": "query",
  5878. "name": "workspace",
  5879. "schema": {
  5880. "type": "string"
  5881. }
  5882. }
  5883. ],
  5884. "summary": "Get MCP status",
  5885. "description": "Get the status of all Model Context Protocol (MCP) servers.",
  5886. "responses": {
  5887. "200": {
  5888. "description": "MCP server status",
  5889. "content": {
  5890. "application/json": {
  5891. "schema": {
  5892. "type": "object",
  5893. "propertyNames": {
  5894. "type": "string"
  5895. },
  5896. "additionalProperties": {
  5897. "$ref": "#/components/schemas/MCPStatus"
  5898. }
  5899. }
  5900. }
  5901. }
  5902. }
  5903. },
  5904. "x-codeSamples": [
  5905. {
  5906. "lang": "js",
  5907. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.status({\n ...\n})"
  5908. }
  5909. ]
  5910. },
  5911. "post": {
  5912. "operationId": "mcp.add",
  5913. "parameters": [
  5914. {
  5915. "in": "query",
  5916. "name": "directory",
  5917. "schema": {
  5918. "type": "string"
  5919. }
  5920. },
  5921. {
  5922. "in": "query",
  5923. "name": "workspace",
  5924. "schema": {
  5925. "type": "string"
  5926. }
  5927. }
  5928. ],
  5929. "summary": "Add MCP server",
  5930. "description": "Dynamically add a new Model Context Protocol (MCP) server to the system.",
  5931. "responses": {
  5932. "200": {
  5933. "description": "MCP server added successfully",
  5934. "content": {
  5935. "application/json": {
  5936. "schema": {
  5937. "type": "object",
  5938. "propertyNames": {
  5939. "type": "string"
  5940. },
  5941. "additionalProperties": {
  5942. "$ref": "#/components/schemas/MCPStatus"
  5943. }
  5944. }
  5945. }
  5946. }
  5947. },
  5948. "400": {
  5949. "description": "Bad request",
  5950. "content": {
  5951. "application/json": {
  5952. "schema": {
  5953. "$ref": "#/components/schemas/BadRequestError"
  5954. }
  5955. }
  5956. }
  5957. }
  5958. },
  5959. "requestBody": {
  5960. "content": {
  5961. "application/json": {
  5962. "schema": {
  5963. "type": "object",
  5964. "properties": {
  5965. "name": {
  5966. "type": "string"
  5967. },
  5968. "config": {
  5969. "anyOf": [
  5970. {
  5971. "$ref": "#/components/schemas/McpLocalConfig"
  5972. },
  5973. {
  5974. "$ref": "#/components/schemas/McpRemoteConfig"
  5975. }
  5976. ]
  5977. }
  5978. },
  5979. "required": ["name", "config"]
  5980. }
  5981. }
  5982. }
  5983. },
  5984. "x-codeSamples": [
  5985. {
  5986. "lang": "js",
  5987. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.add({\n ...\n})"
  5988. }
  5989. ]
  5990. }
  5991. },
  5992. "/mcp/{name}/auth": {
  5993. "post": {
  5994. "operationId": "mcp.auth.start",
  5995. "parameters": [
  5996. {
  5997. "in": "query",
  5998. "name": "directory",
  5999. "schema": {
  6000. "type": "string"
  6001. }
  6002. },
  6003. {
  6004. "in": "query",
  6005. "name": "workspace",
  6006. "schema": {
  6007. "type": "string"
  6008. }
  6009. },
  6010. {
  6011. "schema": {
  6012. "type": "string"
  6013. },
  6014. "in": "path",
  6015. "name": "name",
  6016. "required": true
  6017. }
  6018. ],
  6019. "summary": "Start MCP OAuth",
  6020. "description": "Start OAuth authentication flow for a Model Context Protocol (MCP) server.",
  6021. "responses": {
  6022. "200": {
  6023. "description": "OAuth flow started",
  6024. "content": {
  6025. "application/json": {
  6026. "schema": {
  6027. "type": "object",
  6028. "properties": {
  6029. "authorizationUrl": {
  6030. "description": "URL to open in browser for authorization",
  6031. "type": "string"
  6032. }
  6033. },
  6034. "required": ["authorizationUrl"]
  6035. }
  6036. }
  6037. }
  6038. },
  6039. "400": {
  6040. "description": "Bad request",
  6041. "content": {
  6042. "application/json": {
  6043. "schema": {
  6044. "$ref": "#/components/schemas/BadRequestError"
  6045. }
  6046. }
  6047. }
  6048. },
  6049. "404": {
  6050. "description": "Not found",
  6051. "content": {
  6052. "application/json": {
  6053. "schema": {
  6054. "$ref": "#/components/schemas/NotFoundError"
  6055. }
  6056. }
  6057. }
  6058. }
  6059. },
  6060. "x-codeSamples": [
  6061. {
  6062. "lang": "js",
  6063. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.start({\n ...\n})"
  6064. }
  6065. ]
  6066. },
  6067. "delete": {
  6068. "operationId": "mcp.auth.remove",
  6069. "parameters": [
  6070. {
  6071. "in": "query",
  6072. "name": "directory",
  6073. "schema": {
  6074. "type": "string"
  6075. }
  6076. },
  6077. {
  6078. "in": "query",
  6079. "name": "workspace",
  6080. "schema": {
  6081. "type": "string"
  6082. }
  6083. },
  6084. {
  6085. "schema": {
  6086. "type": "string"
  6087. },
  6088. "in": "path",
  6089. "name": "name",
  6090. "required": true
  6091. }
  6092. ],
  6093. "summary": "Remove MCP OAuth",
  6094. "description": "Remove OAuth credentials for an MCP server",
  6095. "responses": {
  6096. "200": {
  6097. "description": "OAuth credentials removed",
  6098. "content": {
  6099. "application/json": {
  6100. "schema": {
  6101. "type": "object",
  6102. "properties": {
  6103. "success": {
  6104. "type": "boolean",
  6105. "const": true
  6106. }
  6107. },
  6108. "required": ["success"]
  6109. }
  6110. }
  6111. }
  6112. },
  6113. "404": {
  6114. "description": "Not found",
  6115. "content": {
  6116. "application/json": {
  6117. "schema": {
  6118. "$ref": "#/components/schemas/NotFoundError"
  6119. }
  6120. }
  6121. }
  6122. }
  6123. },
  6124. "x-codeSamples": [
  6125. {
  6126. "lang": "js",
  6127. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.remove({\n ...\n})"
  6128. }
  6129. ]
  6130. }
  6131. },
  6132. "/mcp/{name}/auth/callback": {
  6133. "post": {
  6134. "operationId": "mcp.auth.callback",
  6135. "parameters": [
  6136. {
  6137. "in": "query",
  6138. "name": "directory",
  6139. "schema": {
  6140. "type": "string"
  6141. }
  6142. },
  6143. {
  6144. "in": "query",
  6145. "name": "workspace",
  6146. "schema": {
  6147. "type": "string"
  6148. }
  6149. },
  6150. {
  6151. "schema": {
  6152. "type": "string"
  6153. },
  6154. "in": "path",
  6155. "name": "name",
  6156. "required": true
  6157. }
  6158. ],
  6159. "summary": "Complete MCP OAuth",
  6160. "description": "Complete OAuth authentication for a Model Context Protocol (MCP) server using the authorization code.",
  6161. "responses": {
  6162. "200": {
  6163. "description": "OAuth authentication completed",
  6164. "content": {
  6165. "application/json": {
  6166. "schema": {
  6167. "$ref": "#/components/schemas/MCPStatus"
  6168. }
  6169. }
  6170. }
  6171. },
  6172. "400": {
  6173. "description": "Bad request",
  6174. "content": {
  6175. "application/json": {
  6176. "schema": {
  6177. "$ref": "#/components/schemas/BadRequestError"
  6178. }
  6179. }
  6180. }
  6181. },
  6182. "404": {
  6183. "description": "Not found",
  6184. "content": {
  6185. "application/json": {
  6186. "schema": {
  6187. "$ref": "#/components/schemas/NotFoundError"
  6188. }
  6189. }
  6190. }
  6191. }
  6192. },
  6193. "requestBody": {
  6194. "content": {
  6195. "application/json": {
  6196. "schema": {
  6197. "type": "object",
  6198. "properties": {
  6199. "code": {
  6200. "description": "Authorization code from OAuth callback",
  6201. "type": "string"
  6202. }
  6203. },
  6204. "required": ["code"]
  6205. }
  6206. }
  6207. }
  6208. },
  6209. "x-codeSamples": [
  6210. {
  6211. "lang": "js",
  6212. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.callback({\n ...\n})"
  6213. }
  6214. ]
  6215. }
  6216. },
  6217. "/mcp/{name}/auth/authenticate": {
  6218. "post": {
  6219. "operationId": "mcp.auth.authenticate",
  6220. "parameters": [
  6221. {
  6222. "in": "query",
  6223. "name": "directory",
  6224. "schema": {
  6225. "type": "string"
  6226. }
  6227. },
  6228. {
  6229. "in": "query",
  6230. "name": "workspace",
  6231. "schema": {
  6232. "type": "string"
  6233. }
  6234. },
  6235. {
  6236. "schema": {
  6237. "type": "string"
  6238. },
  6239. "in": "path",
  6240. "name": "name",
  6241. "required": true
  6242. }
  6243. ],
  6244. "summary": "Authenticate MCP OAuth",
  6245. "description": "Start OAuth flow and wait for callback (opens browser)",
  6246. "responses": {
  6247. "200": {
  6248. "description": "OAuth authentication completed",
  6249. "content": {
  6250. "application/json": {
  6251. "schema": {
  6252. "$ref": "#/components/schemas/MCPStatus"
  6253. }
  6254. }
  6255. }
  6256. },
  6257. "400": {
  6258. "description": "Bad request",
  6259. "content": {
  6260. "application/json": {
  6261. "schema": {
  6262. "$ref": "#/components/schemas/BadRequestError"
  6263. }
  6264. }
  6265. }
  6266. },
  6267. "404": {
  6268. "description": "Not found",
  6269. "content": {
  6270. "application/json": {
  6271. "schema": {
  6272. "$ref": "#/components/schemas/NotFoundError"
  6273. }
  6274. }
  6275. }
  6276. }
  6277. },
  6278. "x-codeSamples": [
  6279. {
  6280. "lang": "js",
  6281. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.authenticate({\n ...\n})"
  6282. }
  6283. ]
  6284. }
  6285. },
  6286. "/mcp/{name}/connect": {
  6287. "post": {
  6288. "operationId": "mcp.connect",
  6289. "parameters": [
  6290. {
  6291. "in": "query",
  6292. "name": "directory",
  6293. "schema": {
  6294. "type": "string"
  6295. }
  6296. },
  6297. {
  6298. "in": "query",
  6299. "name": "workspace",
  6300. "schema": {
  6301. "type": "string"
  6302. }
  6303. },
  6304. {
  6305. "in": "path",
  6306. "name": "name",
  6307. "schema": {
  6308. "type": "string"
  6309. },
  6310. "required": true
  6311. }
  6312. ],
  6313. "description": "Connect an MCP server",
  6314. "responses": {
  6315. "200": {
  6316. "description": "MCP server connected successfully",
  6317. "content": {
  6318. "application/json": {
  6319. "schema": {
  6320. "type": "boolean"
  6321. }
  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.mcp.connect({\n ...\n})"
  6330. }
  6331. ]
  6332. }
  6333. },
  6334. "/mcp/{name}/disconnect": {
  6335. "post": {
  6336. "operationId": "mcp.disconnect",
  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. "in": "path",
  6354. "name": "name",
  6355. "schema": {
  6356. "type": "string"
  6357. },
  6358. "required": true
  6359. }
  6360. ],
  6361. "description": "Disconnect an MCP server",
  6362. "responses": {
  6363. "200": {
  6364. "description": "MCP server disconnected successfully",
  6365. "content": {
  6366. "application/json": {
  6367. "schema": {
  6368. "type": "boolean"
  6369. }
  6370. }
  6371. }
  6372. }
  6373. },
  6374. "x-codeSamples": [
  6375. {
  6376. "lang": "js",
  6377. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.disconnect({\n ...\n})"
  6378. }
  6379. ]
  6380. }
  6381. },
  6382. "/tui/append-prompt": {
  6383. "post": {
  6384. "operationId": "tui.appendPrompt",
  6385. "parameters": [
  6386. {
  6387. "in": "query",
  6388. "name": "directory",
  6389. "schema": {
  6390. "type": "string"
  6391. }
  6392. },
  6393. {
  6394. "in": "query",
  6395. "name": "workspace",
  6396. "schema": {
  6397. "type": "string"
  6398. }
  6399. }
  6400. ],
  6401. "summary": "Append TUI prompt",
  6402. "description": "Append prompt to the TUI",
  6403. "responses": {
  6404. "200": {
  6405. "description": "Prompt processed successfully",
  6406. "content": {
  6407. "application/json": {
  6408. "schema": {
  6409. "type": "boolean"
  6410. }
  6411. }
  6412. }
  6413. },
  6414. "400": {
  6415. "description": "Bad request",
  6416. "content": {
  6417. "application/json": {
  6418. "schema": {
  6419. "$ref": "#/components/schemas/BadRequestError"
  6420. }
  6421. }
  6422. }
  6423. }
  6424. },
  6425. "requestBody": {
  6426. "content": {
  6427. "application/json": {
  6428. "schema": {
  6429. "type": "object",
  6430. "properties": {
  6431. "text": {
  6432. "type": "string"
  6433. }
  6434. },
  6435. "required": ["text"]
  6436. }
  6437. }
  6438. }
  6439. },
  6440. "x-codeSamples": [
  6441. {
  6442. "lang": "js",
  6443. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.appendPrompt({\n ...\n})"
  6444. }
  6445. ]
  6446. }
  6447. },
  6448. "/tui/open-help": {
  6449. "post": {
  6450. "operationId": "tui.openHelp",
  6451. "parameters": [
  6452. {
  6453. "in": "query",
  6454. "name": "directory",
  6455. "schema": {
  6456. "type": "string"
  6457. }
  6458. },
  6459. {
  6460. "in": "query",
  6461. "name": "workspace",
  6462. "schema": {
  6463. "type": "string"
  6464. }
  6465. }
  6466. ],
  6467. "summary": "Open help dialog",
  6468. "description": "Open the help dialog in the TUI to display user assistance information.",
  6469. "responses": {
  6470. "200": {
  6471. "description": "Help dialog opened successfully",
  6472. "content": {
  6473. "application/json": {
  6474. "schema": {
  6475. "type": "boolean"
  6476. }
  6477. }
  6478. }
  6479. }
  6480. },
  6481. "x-codeSamples": [
  6482. {
  6483. "lang": "js",
  6484. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openHelp({\n ...\n})"
  6485. }
  6486. ]
  6487. }
  6488. },
  6489. "/tui/open-sessions": {
  6490. "post": {
  6491. "operationId": "tui.openSessions",
  6492. "parameters": [
  6493. {
  6494. "in": "query",
  6495. "name": "directory",
  6496. "schema": {
  6497. "type": "string"
  6498. }
  6499. },
  6500. {
  6501. "in": "query",
  6502. "name": "workspace",
  6503. "schema": {
  6504. "type": "string"
  6505. }
  6506. }
  6507. ],
  6508. "summary": "Open sessions dialog",
  6509. "description": "Open the session dialog",
  6510. "responses": {
  6511. "200": {
  6512. "description": "Session dialog opened successfully",
  6513. "content": {
  6514. "application/json": {
  6515. "schema": {
  6516. "type": "boolean"
  6517. }
  6518. }
  6519. }
  6520. }
  6521. },
  6522. "x-codeSamples": [
  6523. {
  6524. "lang": "js",
  6525. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openSessions({\n ...\n})"
  6526. }
  6527. ]
  6528. }
  6529. },
  6530. "/tui/open-themes": {
  6531. "post": {
  6532. "operationId": "tui.openThemes",
  6533. "parameters": [
  6534. {
  6535. "in": "query",
  6536. "name": "directory",
  6537. "schema": {
  6538. "type": "string"
  6539. }
  6540. },
  6541. {
  6542. "in": "query",
  6543. "name": "workspace",
  6544. "schema": {
  6545. "type": "string"
  6546. }
  6547. }
  6548. ],
  6549. "summary": "Open themes dialog",
  6550. "description": "Open the theme dialog",
  6551. "responses": {
  6552. "200": {
  6553. "description": "Theme dialog opened successfully",
  6554. "content": {
  6555. "application/json": {
  6556. "schema": {
  6557. "type": "boolean"
  6558. }
  6559. }
  6560. }
  6561. }
  6562. },
  6563. "x-codeSamples": [
  6564. {
  6565. "lang": "js",
  6566. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openThemes({\n ...\n})"
  6567. }
  6568. ]
  6569. }
  6570. },
  6571. "/tui/open-models": {
  6572. "post": {
  6573. "operationId": "tui.openModels",
  6574. "parameters": [
  6575. {
  6576. "in": "query",
  6577. "name": "directory",
  6578. "schema": {
  6579. "type": "string"
  6580. }
  6581. },
  6582. {
  6583. "in": "query",
  6584. "name": "workspace",
  6585. "schema": {
  6586. "type": "string"
  6587. }
  6588. }
  6589. ],
  6590. "summary": "Open models dialog",
  6591. "description": "Open the model dialog",
  6592. "responses": {
  6593. "200": {
  6594. "description": "Model dialog opened successfully",
  6595. "content": {
  6596. "application/json": {
  6597. "schema": {
  6598. "type": "boolean"
  6599. }
  6600. }
  6601. }
  6602. }
  6603. },
  6604. "x-codeSamples": [
  6605. {
  6606. "lang": "js",
  6607. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openModels({\n ...\n})"
  6608. }
  6609. ]
  6610. }
  6611. },
  6612. "/tui/submit-prompt": {
  6613. "post": {
  6614. "operationId": "tui.submitPrompt",
  6615. "parameters": [
  6616. {
  6617. "in": "query",
  6618. "name": "directory",
  6619. "schema": {
  6620. "type": "string"
  6621. }
  6622. },
  6623. {
  6624. "in": "query",
  6625. "name": "workspace",
  6626. "schema": {
  6627. "type": "string"
  6628. }
  6629. }
  6630. ],
  6631. "summary": "Submit TUI prompt",
  6632. "description": "Submit the prompt",
  6633. "responses": {
  6634. "200": {
  6635. "description": "Prompt submitted successfully",
  6636. "content": {
  6637. "application/json": {
  6638. "schema": {
  6639. "type": "boolean"
  6640. }
  6641. }
  6642. }
  6643. }
  6644. },
  6645. "x-codeSamples": [
  6646. {
  6647. "lang": "js",
  6648. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.submitPrompt({\n ...\n})"
  6649. }
  6650. ]
  6651. }
  6652. },
  6653. "/tui/clear-prompt": {
  6654. "post": {
  6655. "operationId": "tui.clearPrompt",
  6656. "parameters": [
  6657. {
  6658. "in": "query",
  6659. "name": "directory",
  6660. "schema": {
  6661. "type": "string"
  6662. }
  6663. },
  6664. {
  6665. "in": "query",
  6666. "name": "workspace",
  6667. "schema": {
  6668. "type": "string"
  6669. }
  6670. }
  6671. ],
  6672. "summary": "Clear TUI prompt",
  6673. "description": "Clear the prompt",
  6674. "responses": {
  6675. "200": {
  6676. "description": "Prompt cleared successfully",
  6677. "content": {
  6678. "application/json": {
  6679. "schema": {
  6680. "type": "boolean"
  6681. }
  6682. }
  6683. }
  6684. }
  6685. },
  6686. "x-codeSamples": [
  6687. {
  6688. "lang": "js",
  6689. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.clearPrompt({\n ...\n})"
  6690. }
  6691. ]
  6692. }
  6693. },
  6694. "/tui/execute-command": {
  6695. "post": {
  6696. "operationId": "tui.executeCommand",
  6697. "parameters": [
  6698. {
  6699. "in": "query",
  6700. "name": "directory",
  6701. "schema": {
  6702. "type": "string"
  6703. }
  6704. },
  6705. {
  6706. "in": "query",
  6707. "name": "workspace",
  6708. "schema": {
  6709. "type": "string"
  6710. }
  6711. }
  6712. ],
  6713. "summary": "Execute TUI command",
  6714. "description": "Execute a TUI command (e.g. agent_cycle)",
  6715. "responses": {
  6716. "200": {
  6717. "description": "Command executed successfully",
  6718. "content": {
  6719. "application/json": {
  6720. "schema": {
  6721. "type": "boolean"
  6722. }
  6723. }
  6724. }
  6725. },
  6726. "400": {
  6727. "description": "Bad request",
  6728. "content": {
  6729. "application/json": {
  6730. "schema": {
  6731. "$ref": "#/components/schemas/BadRequestError"
  6732. }
  6733. }
  6734. }
  6735. }
  6736. },
  6737. "requestBody": {
  6738. "content": {
  6739. "application/json": {
  6740. "schema": {
  6741. "type": "object",
  6742. "properties": {
  6743. "command": {
  6744. "type": "string"
  6745. }
  6746. },
  6747. "required": ["command"]
  6748. }
  6749. }
  6750. }
  6751. },
  6752. "x-codeSamples": [
  6753. {
  6754. "lang": "js",
  6755. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.executeCommand({\n ...\n})"
  6756. }
  6757. ]
  6758. }
  6759. },
  6760. "/tui/show-toast": {
  6761. "post": {
  6762. "operationId": "tui.showToast",
  6763. "parameters": [
  6764. {
  6765. "in": "query",
  6766. "name": "directory",
  6767. "schema": {
  6768. "type": "string"
  6769. }
  6770. },
  6771. {
  6772. "in": "query",
  6773. "name": "workspace",
  6774. "schema": {
  6775. "type": "string"
  6776. }
  6777. }
  6778. ],
  6779. "summary": "Show TUI toast",
  6780. "description": "Show a toast notification in the TUI",
  6781. "responses": {
  6782. "200": {
  6783. "description": "Toast notification shown successfully",
  6784. "content": {
  6785. "application/json": {
  6786. "schema": {
  6787. "type": "boolean"
  6788. }
  6789. }
  6790. }
  6791. }
  6792. },
  6793. "requestBody": {
  6794. "content": {
  6795. "application/json": {
  6796. "schema": {
  6797. "type": "object",
  6798. "properties": {
  6799. "title": {
  6800. "type": "string"
  6801. },
  6802. "message": {
  6803. "type": "string"
  6804. },
  6805. "variant": {
  6806. "type": "string",
  6807. "enum": ["info", "success", "warning", "error"]
  6808. },
  6809. "duration": {
  6810. "description": "Duration in milliseconds",
  6811. "default": 5000,
  6812. "type": "number"
  6813. }
  6814. },
  6815. "required": ["message", "variant"]
  6816. }
  6817. }
  6818. }
  6819. },
  6820. "x-codeSamples": [
  6821. {
  6822. "lang": "js",
  6823. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.showToast({\n ...\n})"
  6824. }
  6825. ]
  6826. }
  6827. },
  6828. "/tui/publish": {
  6829. "post": {
  6830. "operationId": "tui.publish",
  6831. "parameters": [
  6832. {
  6833. "in": "query",
  6834. "name": "directory",
  6835. "schema": {
  6836. "type": "string"
  6837. }
  6838. },
  6839. {
  6840. "in": "query",
  6841. "name": "workspace",
  6842. "schema": {
  6843. "type": "string"
  6844. }
  6845. }
  6846. ],
  6847. "summary": "Publish TUI event",
  6848. "description": "Publish a TUI event",
  6849. "responses": {
  6850. "200": {
  6851. "description": "Event published successfully",
  6852. "content": {
  6853. "application/json": {
  6854. "schema": {
  6855. "type": "boolean"
  6856. }
  6857. }
  6858. }
  6859. },
  6860. "400": {
  6861. "description": "Bad request",
  6862. "content": {
  6863. "application/json": {
  6864. "schema": {
  6865. "$ref": "#/components/schemas/BadRequestError"
  6866. }
  6867. }
  6868. }
  6869. }
  6870. },
  6871. "requestBody": {
  6872. "content": {
  6873. "application/json": {
  6874. "schema": {
  6875. "anyOf": [
  6876. {
  6877. "$ref": "#/components/schemas/Event.tui.prompt.append"
  6878. },
  6879. {
  6880. "$ref": "#/components/schemas/Event.tui.command.execute"
  6881. },
  6882. {
  6883. "$ref": "#/components/schemas/Event.tui.toast.show"
  6884. },
  6885. {
  6886. "$ref": "#/components/schemas/Event.tui.session.select"
  6887. }
  6888. ]
  6889. }
  6890. }
  6891. }
  6892. },
  6893. "x-codeSamples": [
  6894. {
  6895. "lang": "js",
  6896. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.publish({\n ...\n})"
  6897. }
  6898. ]
  6899. }
  6900. },
  6901. "/tui/select-session": {
  6902. "post": {
  6903. "operationId": "tui.selectSession",
  6904. "parameters": [
  6905. {
  6906. "in": "query",
  6907. "name": "directory",
  6908. "schema": {
  6909. "type": "string"
  6910. }
  6911. },
  6912. {
  6913. "in": "query",
  6914. "name": "workspace",
  6915. "schema": {
  6916. "type": "string"
  6917. }
  6918. }
  6919. ],
  6920. "summary": "Select session",
  6921. "description": "Navigate the TUI to display the specified session.",
  6922. "responses": {
  6923. "200": {
  6924. "description": "Session selected successfully",
  6925. "content": {
  6926. "application/json": {
  6927. "schema": {
  6928. "type": "boolean"
  6929. }
  6930. }
  6931. }
  6932. },
  6933. "400": {
  6934. "description": "Bad request",
  6935. "content": {
  6936. "application/json": {
  6937. "schema": {
  6938. "$ref": "#/components/schemas/BadRequestError"
  6939. }
  6940. }
  6941. }
  6942. },
  6943. "404": {
  6944. "description": "Not found",
  6945. "content": {
  6946. "application/json": {
  6947. "schema": {
  6948. "$ref": "#/components/schemas/NotFoundError"
  6949. }
  6950. }
  6951. }
  6952. }
  6953. },
  6954. "requestBody": {
  6955. "content": {
  6956. "application/json": {
  6957. "schema": {
  6958. "type": "object",
  6959. "properties": {
  6960. "sessionID": {
  6961. "description": "Session ID to navigate to",
  6962. "type": "string",
  6963. "pattern": "^ses.*"
  6964. }
  6965. },
  6966. "required": ["sessionID"]
  6967. }
  6968. }
  6969. }
  6970. },
  6971. "x-codeSamples": [
  6972. {
  6973. "lang": "js",
  6974. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.selectSession({\n ...\n})"
  6975. }
  6976. ]
  6977. }
  6978. },
  6979. "/tui/control/next": {
  6980. "get": {
  6981. "operationId": "tui.control.next",
  6982. "parameters": [
  6983. {
  6984. "in": "query",
  6985. "name": "directory",
  6986. "schema": {
  6987. "type": "string"
  6988. }
  6989. },
  6990. {
  6991. "in": "query",
  6992. "name": "workspace",
  6993. "schema": {
  6994. "type": "string"
  6995. }
  6996. }
  6997. ],
  6998. "summary": "Get next TUI request",
  6999. "description": "Retrieve the next TUI (Terminal User Interface) request from the queue for processing.",
  7000. "responses": {
  7001. "200": {
  7002. "description": "Next TUI request",
  7003. "content": {
  7004. "application/json": {
  7005. "schema": {
  7006. "type": "object",
  7007. "properties": {
  7008. "path": {
  7009. "type": "string"
  7010. },
  7011. "body": {}
  7012. },
  7013. "required": ["path", "body"]
  7014. }
  7015. }
  7016. }
  7017. }
  7018. },
  7019. "x-codeSamples": [
  7020. {
  7021. "lang": "js",
  7022. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.control.next({\n ...\n})"
  7023. }
  7024. ]
  7025. }
  7026. },
  7027. "/tui/control/response": {
  7028. "post": {
  7029. "operationId": "tui.control.response",
  7030. "parameters": [
  7031. {
  7032. "in": "query",
  7033. "name": "directory",
  7034. "schema": {
  7035. "type": "string"
  7036. }
  7037. },
  7038. {
  7039. "in": "query",
  7040. "name": "workspace",
  7041. "schema": {
  7042. "type": "string"
  7043. }
  7044. }
  7045. ],
  7046. "summary": "Submit TUI response",
  7047. "description": "Submit a response to the TUI request queue to complete a pending request.",
  7048. "responses": {
  7049. "200": {
  7050. "description": "Response submitted successfully",
  7051. "content": {
  7052. "application/json": {
  7053. "schema": {
  7054. "type": "boolean"
  7055. }
  7056. }
  7057. }
  7058. }
  7059. },
  7060. "requestBody": {
  7061. "content": {
  7062. "application/json": {
  7063. "schema": {}
  7064. }
  7065. }
  7066. },
  7067. "x-codeSamples": [
  7068. {
  7069. "lang": "js",
  7070. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.control.response({\n ...\n})"
  7071. }
  7072. ]
  7073. }
  7074. },
  7075. "/instance/dispose": {
  7076. "post": {
  7077. "operationId": "instance.dispose",
  7078. "parameters": [
  7079. {
  7080. "in": "query",
  7081. "name": "directory",
  7082. "schema": {
  7083. "type": "string"
  7084. }
  7085. },
  7086. {
  7087. "in": "query",
  7088. "name": "workspace",
  7089. "schema": {
  7090. "type": "string"
  7091. }
  7092. }
  7093. ],
  7094. "summary": "Dispose instance",
  7095. "description": "Clean up and dispose the current OpenCode instance, releasing all resources.",
  7096. "responses": {
  7097. "200": {
  7098. "description": "Instance disposed",
  7099. "content": {
  7100. "application/json": {
  7101. "schema": {
  7102. "type": "boolean"
  7103. }
  7104. }
  7105. }
  7106. }
  7107. },
  7108. "x-codeSamples": [
  7109. {
  7110. "lang": "js",
  7111. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.instance.dispose({\n ...\n})"
  7112. }
  7113. ]
  7114. }
  7115. },
  7116. "/path": {
  7117. "get": {
  7118. "operationId": "path.get",
  7119. "parameters": [
  7120. {
  7121. "in": "query",
  7122. "name": "directory",
  7123. "schema": {
  7124. "type": "string"
  7125. }
  7126. },
  7127. {
  7128. "in": "query",
  7129. "name": "workspace",
  7130. "schema": {
  7131. "type": "string"
  7132. }
  7133. }
  7134. ],
  7135. "summary": "Get paths",
  7136. "description": "Retrieve the current working directory and related path information for the OpenCode instance.",
  7137. "responses": {
  7138. "200": {
  7139. "description": "Path",
  7140. "content": {
  7141. "application/json": {
  7142. "schema": {
  7143. "$ref": "#/components/schemas/Path"
  7144. }
  7145. }
  7146. }
  7147. }
  7148. },
  7149. "x-codeSamples": [
  7150. {
  7151. "lang": "js",
  7152. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.path.get({\n ...\n})"
  7153. }
  7154. ]
  7155. }
  7156. },
  7157. "/vcs": {
  7158. "get": {
  7159. "operationId": "vcs.get",
  7160. "parameters": [
  7161. {
  7162. "in": "query",
  7163. "name": "directory",
  7164. "schema": {
  7165. "type": "string"
  7166. }
  7167. },
  7168. {
  7169. "in": "query",
  7170. "name": "workspace",
  7171. "schema": {
  7172. "type": "string"
  7173. }
  7174. }
  7175. ],
  7176. "summary": "Get VCS info",
  7177. "description": "Retrieve version control system (VCS) information for the current project, such as git branch.",
  7178. "responses": {
  7179. "200": {
  7180. "description": "VCS info",
  7181. "content": {
  7182. "application/json": {
  7183. "schema": {
  7184. "$ref": "#/components/schemas/VcsInfo"
  7185. }
  7186. }
  7187. }
  7188. }
  7189. },
  7190. "x-codeSamples": [
  7191. {
  7192. "lang": "js",
  7193. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.vcs.get({\n ...\n})"
  7194. }
  7195. ]
  7196. }
  7197. },
  7198. "/vcs/diff": {
  7199. "get": {
  7200. "operationId": "vcs.diff",
  7201. "parameters": [
  7202. {
  7203. "in": "query",
  7204. "name": "directory",
  7205. "schema": {
  7206. "type": "string"
  7207. }
  7208. },
  7209. {
  7210. "in": "query",
  7211. "name": "workspace",
  7212. "schema": {
  7213. "type": "string"
  7214. }
  7215. },
  7216. {
  7217. "in": "query",
  7218. "name": "mode",
  7219. "schema": {
  7220. "type": "string",
  7221. "enum": ["git", "branch"]
  7222. },
  7223. "required": true
  7224. }
  7225. ],
  7226. "summary": "Get VCS diff",
  7227. "description": "Retrieve the current git diff for the working tree or against the default branch.",
  7228. "responses": {
  7229. "200": {
  7230. "description": "VCS diff",
  7231. "content": {
  7232. "application/json": {
  7233. "schema": {
  7234. "type": "array",
  7235. "items": {
  7236. "$ref": "#/components/schemas/VcsFileDiff"
  7237. }
  7238. }
  7239. }
  7240. }
  7241. }
  7242. },
  7243. "x-codeSamples": [
  7244. {
  7245. "lang": "js",
  7246. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.vcs.diff({\n ...\n})"
  7247. }
  7248. ]
  7249. }
  7250. },
  7251. "/command": {
  7252. "get": {
  7253. "operationId": "command.list",
  7254. "parameters": [
  7255. {
  7256. "in": "query",
  7257. "name": "directory",
  7258. "schema": {
  7259. "type": "string"
  7260. }
  7261. },
  7262. {
  7263. "in": "query",
  7264. "name": "workspace",
  7265. "schema": {
  7266. "type": "string"
  7267. }
  7268. }
  7269. ],
  7270. "summary": "List commands",
  7271. "description": "Get a list of all available commands in the OpenCode system.",
  7272. "responses": {
  7273. "200": {
  7274. "description": "List of commands",
  7275. "content": {
  7276. "application/json": {
  7277. "schema": {
  7278. "type": "array",
  7279. "items": {
  7280. "$ref": "#/components/schemas/Command"
  7281. }
  7282. }
  7283. }
  7284. }
  7285. }
  7286. },
  7287. "x-codeSamples": [
  7288. {
  7289. "lang": "js",
  7290. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.command.list({\n ...\n})"
  7291. }
  7292. ]
  7293. }
  7294. },
  7295. "/agent": {
  7296. "get": {
  7297. "operationId": "app.agents",
  7298. "parameters": [
  7299. {
  7300. "in": "query",
  7301. "name": "directory",
  7302. "schema": {
  7303. "type": "string"
  7304. }
  7305. },
  7306. {
  7307. "in": "query",
  7308. "name": "workspace",
  7309. "schema": {
  7310. "type": "string"
  7311. }
  7312. }
  7313. ],
  7314. "summary": "List agents",
  7315. "description": "Get a list of all available AI agents in the OpenCode system.",
  7316. "responses": {
  7317. "200": {
  7318. "description": "List of agents",
  7319. "content": {
  7320. "application/json": {
  7321. "schema": {
  7322. "type": "array",
  7323. "items": {
  7324. "$ref": "#/components/schemas/Agent"
  7325. }
  7326. }
  7327. }
  7328. }
  7329. }
  7330. },
  7331. "x-codeSamples": [
  7332. {
  7333. "lang": "js",
  7334. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.app.agents({\n ...\n})"
  7335. }
  7336. ]
  7337. }
  7338. },
  7339. "/skill": {
  7340. "get": {
  7341. "operationId": "app.skills",
  7342. "parameters": [
  7343. {
  7344. "in": "query",
  7345. "name": "directory",
  7346. "schema": {
  7347. "type": "string"
  7348. }
  7349. },
  7350. {
  7351. "in": "query",
  7352. "name": "workspace",
  7353. "schema": {
  7354. "type": "string"
  7355. }
  7356. }
  7357. ],
  7358. "summary": "List skills",
  7359. "description": "Get a list of all available skills in the OpenCode system.",
  7360. "responses": {
  7361. "200": {
  7362. "description": "List of skills",
  7363. "content": {
  7364. "application/json": {
  7365. "schema": {
  7366. "type": "array",
  7367. "items": {
  7368. "type": "object",
  7369. "properties": {
  7370. "name": {
  7371. "type": "string"
  7372. },
  7373. "description": {
  7374. "type": "string"
  7375. },
  7376. "location": {
  7377. "type": "string"
  7378. },
  7379. "content": {
  7380. "type": "string"
  7381. }
  7382. },
  7383. "required": ["name", "description", "location", "content"]
  7384. }
  7385. }
  7386. }
  7387. }
  7388. }
  7389. },
  7390. "x-codeSamples": [
  7391. {
  7392. "lang": "js",
  7393. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.app.skills({\n ...\n})"
  7394. }
  7395. ]
  7396. }
  7397. },
  7398. "/lsp": {
  7399. "get": {
  7400. "operationId": "lsp.status",
  7401. "parameters": [
  7402. {
  7403. "in": "query",
  7404. "name": "directory",
  7405. "schema": {
  7406. "type": "string"
  7407. }
  7408. },
  7409. {
  7410. "in": "query",
  7411. "name": "workspace",
  7412. "schema": {
  7413. "type": "string"
  7414. }
  7415. }
  7416. ],
  7417. "summary": "Get LSP status",
  7418. "description": "Get LSP server status",
  7419. "responses": {
  7420. "200": {
  7421. "description": "LSP server status",
  7422. "content": {
  7423. "application/json": {
  7424. "schema": {
  7425. "type": "array",
  7426. "items": {
  7427. "$ref": "#/components/schemas/LSPStatus"
  7428. }
  7429. }
  7430. }
  7431. }
  7432. }
  7433. },
  7434. "x-codeSamples": [
  7435. {
  7436. "lang": "js",
  7437. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.lsp.status({\n ...\n})"
  7438. }
  7439. ]
  7440. }
  7441. },
  7442. "/formatter": {
  7443. "get": {
  7444. "operationId": "formatter.status",
  7445. "parameters": [
  7446. {
  7447. "in": "query",
  7448. "name": "directory",
  7449. "schema": {
  7450. "type": "string"
  7451. }
  7452. },
  7453. {
  7454. "in": "query",
  7455. "name": "workspace",
  7456. "schema": {
  7457. "type": "string"
  7458. }
  7459. }
  7460. ],
  7461. "summary": "Get formatter status",
  7462. "description": "Get formatter status",
  7463. "responses": {
  7464. "200": {
  7465. "description": "Formatter status",
  7466. "content": {
  7467. "application/json": {
  7468. "schema": {
  7469. "type": "array",
  7470. "items": {
  7471. "$ref": "#/components/schemas/FormatterStatus"
  7472. }
  7473. }
  7474. }
  7475. }
  7476. }
  7477. },
  7478. "x-codeSamples": [
  7479. {
  7480. "lang": "js",
  7481. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.formatter.status({\n ...\n})"
  7482. }
  7483. ]
  7484. }
  7485. }
  7486. },
  7487. "components": {
  7488. "schemas": {
  7489. "Project": {
  7490. "type": "object",
  7491. "properties": {
  7492. "id": {
  7493. "type": "string"
  7494. },
  7495. "worktree": {
  7496. "type": "string"
  7497. },
  7498. "vcs": {
  7499. "type": "string",
  7500. "const": "git"
  7501. },
  7502. "name": {
  7503. "type": "string"
  7504. },
  7505. "icon": {
  7506. "type": "object",
  7507. "properties": {
  7508. "url": {
  7509. "type": "string"
  7510. },
  7511. "override": {
  7512. "type": "string"
  7513. },
  7514. "color": {
  7515. "type": "string"
  7516. }
  7517. }
  7518. },
  7519. "commands": {
  7520. "type": "object",
  7521. "properties": {
  7522. "start": {
  7523. "description": "Startup script to run when creating a new workspace (worktree)",
  7524. "type": "string"
  7525. }
  7526. }
  7527. },
  7528. "time": {
  7529. "type": "object",
  7530. "properties": {
  7531. "created": {
  7532. "type": "number"
  7533. },
  7534. "updated": {
  7535. "type": "number"
  7536. },
  7537. "initialized": {
  7538. "type": "number"
  7539. }
  7540. },
  7541. "required": ["created", "updated"]
  7542. },
  7543. "sandboxes": {
  7544. "type": "array",
  7545. "items": {
  7546. "type": "string"
  7547. }
  7548. }
  7549. },
  7550. "required": ["id", "worktree", "time", "sandboxes"]
  7551. },
  7552. "Event.project.updated": {
  7553. "type": "object",
  7554. "properties": {
  7555. "type": {
  7556. "type": "string",
  7557. "const": "project.updated"
  7558. },
  7559. "properties": {
  7560. "$ref": "#/components/schemas/Project"
  7561. }
  7562. },
  7563. "required": ["type", "properties"]
  7564. },
  7565. "Event.server.instance.disposed": {
  7566. "type": "object",
  7567. "properties": {
  7568. "type": {
  7569. "type": "string",
  7570. "const": "server.instance.disposed"
  7571. },
  7572. "properties": {
  7573. "type": "object",
  7574. "properties": {
  7575. "directory": {
  7576. "type": "string"
  7577. }
  7578. },
  7579. "required": ["directory"]
  7580. }
  7581. },
  7582. "required": ["type", "properties"]
  7583. },
  7584. "Event.server.connected": {
  7585. "type": "object",
  7586. "properties": {
  7587. "type": {
  7588. "type": "string",
  7589. "const": "server.connected"
  7590. },
  7591. "properties": {
  7592. "type": "object",
  7593. "properties": {}
  7594. }
  7595. },
  7596. "required": ["type", "properties"]
  7597. },
  7598. "Event.global.disposed": {
  7599. "type": "object",
  7600. "properties": {
  7601. "type": {
  7602. "type": "string",
  7603. "const": "global.disposed"
  7604. },
  7605. "properties": {
  7606. "type": "object",
  7607. "properties": {}
  7608. }
  7609. },
  7610. "required": ["type", "properties"]
  7611. },
  7612. "Event.file.edited": {
  7613. "type": "object",
  7614. "properties": {
  7615. "type": {
  7616. "type": "string",
  7617. "const": "file.edited"
  7618. },
  7619. "properties": {
  7620. "type": "object",
  7621. "properties": {
  7622. "file": {
  7623. "type": "string"
  7624. }
  7625. },
  7626. "required": ["file"]
  7627. }
  7628. },
  7629. "required": ["type", "properties"]
  7630. },
  7631. "Event.file.watcher.updated": {
  7632. "type": "object",
  7633. "properties": {
  7634. "type": {
  7635. "type": "string",
  7636. "const": "file.watcher.updated"
  7637. },
  7638. "properties": {
  7639. "type": "object",
  7640. "properties": {
  7641. "file": {
  7642. "type": "string"
  7643. },
  7644. "event": {
  7645. "anyOf": [
  7646. {
  7647. "type": "string",
  7648. "const": "add"
  7649. },
  7650. {
  7651. "type": "string",
  7652. "const": "change"
  7653. },
  7654. {
  7655. "type": "string",
  7656. "const": "unlink"
  7657. }
  7658. ]
  7659. }
  7660. },
  7661. "required": ["file", "event"]
  7662. }
  7663. },
  7664. "required": ["type", "properties"]
  7665. },
  7666. "Event.lsp.client.diagnostics": {
  7667. "type": "object",
  7668. "properties": {
  7669. "type": {
  7670. "type": "string",
  7671. "const": "lsp.client.diagnostics"
  7672. },
  7673. "properties": {
  7674. "type": "object",
  7675. "properties": {
  7676. "serverID": {
  7677. "type": "string"
  7678. },
  7679. "path": {
  7680. "type": "string"
  7681. }
  7682. },
  7683. "required": ["serverID", "path"]
  7684. }
  7685. },
  7686. "required": ["type", "properties"]
  7687. },
  7688. "Event.lsp.updated": {
  7689. "type": "object",
  7690. "properties": {
  7691. "type": {
  7692. "type": "string",
  7693. "const": "lsp.updated"
  7694. },
  7695. "properties": {
  7696. "type": "object",
  7697. "properties": {}
  7698. }
  7699. },
  7700. "required": ["type", "properties"]
  7701. },
  7702. "Event.installation.updated": {
  7703. "type": "object",
  7704. "properties": {
  7705. "type": {
  7706. "type": "string",
  7707. "const": "installation.updated"
  7708. },
  7709. "properties": {
  7710. "type": "object",
  7711. "properties": {
  7712. "version": {
  7713. "type": "string"
  7714. }
  7715. },
  7716. "required": ["version"]
  7717. }
  7718. },
  7719. "required": ["type", "properties"]
  7720. },
  7721. "Event.installation.update-available": {
  7722. "type": "object",
  7723. "properties": {
  7724. "type": {
  7725. "type": "string",
  7726. "const": "installation.update-available"
  7727. },
  7728. "properties": {
  7729. "type": "object",
  7730. "properties": {
  7731. "version": {
  7732. "type": "string"
  7733. }
  7734. },
  7735. "required": ["version"]
  7736. }
  7737. },
  7738. "required": ["type", "properties"]
  7739. },
  7740. "Event.message.part.delta": {
  7741. "type": "object",
  7742. "properties": {
  7743. "type": {
  7744. "type": "string",
  7745. "const": "message.part.delta"
  7746. },
  7747. "properties": {
  7748. "type": "object",
  7749. "properties": {
  7750. "sessionID": {
  7751. "type": "string",
  7752. "pattern": "^ses.*"
  7753. },
  7754. "messageID": {
  7755. "type": "string",
  7756. "pattern": "^msg.*"
  7757. },
  7758. "partID": {
  7759. "type": "string",
  7760. "pattern": "^prt.*"
  7761. },
  7762. "field": {
  7763. "type": "string"
  7764. },
  7765. "delta": {
  7766. "type": "string"
  7767. }
  7768. },
  7769. "required": ["sessionID", "messageID", "partID", "field", "delta"]
  7770. }
  7771. },
  7772. "required": ["type", "properties"]
  7773. },
  7774. "PermissionRequest": {
  7775. "type": "object",
  7776. "properties": {
  7777. "id": {
  7778. "type": "string",
  7779. "pattern": "^per.*"
  7780. },
  7781. "sessionID": {
  7782. "type": "string",
  7783. "pattern": "^ses.*"
  7784. },
  7785. "permission": {
  7786. "type": "string"
  7787. },
  7788. "patterns": {
  7789. "type": "array",
  7790. "items": {
  7791. "type": "string"
  7792. }
  7793. },
  7794. "metadata": {
  7795. "type": "object",
  7796. "propertyNames": {
  7797. "type": "string"
  7798. },
  7799. "additionalProperties": {}
  7800. },
  7801. "always": {
  7802. "type": "array",
  7803. "items": {
  7804. "type": "string"
  7805. }
  7806. },
  7807. "tool": {
  7808. "type": "object",
  7809. "properties": {
  7810. "messageID": {
  7811. "type": "string",
  7812. "pattern": "^msg.*"
  7813. },
  7814. "callID": {
  7815. "type": "string"
  7816. }
  7817. },
  7818. "required": ["messageID", "callID"]
  7819. }
  7820. },
  7821. "required": ["id", "sessionID", "permission", "patterns", "metadata", "always"]
  7822. },
  7823. "Event.permission.asked": {
  7824. "type": "object",
  7825. "properties": {
  7826. "type": {
  7827. "type": "string",
  7828. "const": "permission.asked"
  7829. },
  7830. "properties": {
  7831. "$ref": "#/components/schemas/PermissionRequest"
  7832. }
  7833. },
  7834. "required": ["type", "properties"]
  7835. },
  7836. "Event.permission.replied": {
  7837. "type": "object",
  7838. "properties": {
  7839. "type": {
  7840. "type": "string",
  7841. "const": "permission.replied"
  7842. },
  7843. "properties": {
  7844. "type": "object",
  7845. "properties": {
  7846. "sessionID": {
  7847. "type": "string",
  7848. "pattern": "^ses.*"
  7849. },
  7850. "requestID": {
  7851. "type": "string",
  7852. "pattern": "^per.*"
  7853. },
  7854. "reply": {
  7855. "type": "string",
  7856. "enum": ["once", "always", "reject"]
  7857. }
  7858. },
  7859. "required": ["sessionID", "requestID", "reply"]
  7860. }
  7861. },
  7862. "required": ["type", "properties"]
  7863. },
  7864. "SnapshotFileDiff": {
  7865. "type": "object",
  7866. "properties": {
  7867. "file": {
  7868. "type": "string"
  7869. },
  7870. "patch": {
  7871. "type": "string"
  7872. },
  7873. "additions": {
  7874. "type": "number"
  7875. },
  7876. "deletions": {
  7877. "type": "number"
  7878. },
  7879. "status": {
  7880. "type": "string",
  7881. "enum": ["added", "deleted", "modified"]
  7882. }
  7883. },
  7884. "required": ["file", "patch", "additions", "deletions"]
  7885. },
  7886. "Event.session.diff": {
  7887. "type": "object",
  7888. "properties": {
  7889. "type": {
  7890. "type": "string",
  7891. "const": "session.diff"
  7892. },
  7893. "properties": {
  7894. "type": "object",
  7895. "properties": {
  7896. "sessionID": {
  7897. "type": "string",
  7898. "pattern": "^ses.*"
  7899. },
  7900. "diff": {
  7901. "type": "array",
  7902. "items": {
  7903. "$ref": "#/components/schemas/SnapshotFileDiff"
  7904. }
  7905. }
  7906. },
  7907. "required": ["sessionID", "diff"]
  7908. }
  7909. },
  7910. "required": ["type", "properties"]
  7911. },
  7912. "ProviderAuthError": {
  7913. "type": "object",
  7914. "properties": {
  7915. "name": {
  7916. "type": "string",
  7917. "const": "ProviderAuthError"
  7918. },
  7919. "data": {
  7920. "type": "object",
  7921. "properties": {
  7922. "providerID": {
  7923. "type": "string"
  7924. },
  7925. "message": {
  7926. "type": "string"
  7927. }
  7928. },
  7929. "required": ["providerID", "message"]
  7930. }
  7931. },
  7932. "required": ["name", "data"]
  7933. },
  7934. "UnknownError": {
  7935. "type": "object",
  7936. "properties": {
  7937. "name": {
  7938. "type": "string",
  7939. "const": "UnknownError"
  7940. },
  7941. "data": {
  7942. "type": "object",
  7943. "properties": {
  7944. "message": {
  7945. "type": "string"
  7946. }
  7947. },
  7948. "required": ["message"]
  7949. }
  7950. },
  7951. "required": ["name", "data"]
  7952. },
  7953. "MessageOutputLengthError": {
  7954. "type": "object",
  7955. "properties": {
  7956. "name": {
  7957. "type": "string",
  7958. "const": "MessageOutputLengthError"
  7959. },
  7960. "data": {
  7961. "type": "object",
  7962. "properties": {}
  7963. }
  7964. },
  7965. "required": ["name", "data"]
  7966. },
  7967. "MessageAbortedError": {
  7968. "type": "object",
  7969. "properties": {
  7970. "name": {
  7971. "type": "string",
  7972. "const": "MessageAbortedError"
  7973. },
  7974. "data": {
  7975. "type": "object",
  7976. "properties": {
  7977. "message": {
  7978. "type": "string"
  7979. }
  7980. },
  7981. "required": ["message"]
  7982. }
  7983. },
  7984. "required": ["name", "data"]
  7985. },
  7986. "StructuredOutputError": {
  7987. "type": "object",
  7988. "properties": {
  7989. "name": {
  7990. "type": "string",
  7991. "const": "StructuredOutputError"
  7992. },
  7993. "data": {
  7994. "type": "object",
  7995. "properties": {
  7996. "message": {
  7997. "type": "string"
  7998. },
  7999. "retries": {
  8000. "type": "number"
  8001. }
  8002. },
  8003. "required": ["message", "retries"]
  8004. }
  8005. },
  8006. "required": ["name", "data"]
  8007. },
  8008. "ContextOverflowError": {
  8009. "type": "object",
  8010. "properties": {
  8011. "name": {
  8012. "type": "string",
  8013. "const": "ContextOverflowError"
  8014. },
  8015. "data": {
  8016. "type": "object",
  8017. "properties": {
  8018. "message": {
  8019. "type": "string"
  8020. },
  8021. "responseBody": {
  8022. "type": "string"
  8023. }
  8024. },
  8025. "required": ["message"]
  8026. }
  8027. },
  8028. "required": ["name", "data"]
  8029. },
  8030. "APIError": {
  8031. "type": "object",
  8032. "properties": {
  8033. "name": {
  8034. "type": "string",
  8035. "const": "APIError"
  8036. },
  8037. "data": {
  8038. "type": "object",
  8039. "properties": {
  8040. "message": {
  8041. "type": "string"
  8042. },
  8043. "statusCode": {
  8044. "type": "number"
  8045. },
  8046. "isRetryable": {
  8047. "type": "boolean"
  8048. },
  8049. "responseHeaders": {
  8050. "type": "object",
  8051. "propertyNames": {
  8052. "type": "string"
  8053. },
  8054. "additionalProperties": {
  8055. "type": "string"
  8056. }
  8057. },
  8058. "responseBody": {
  8059. "type": "string"
  8060. },
  8061. "metadata": {
  8062. "type": "object",
  8063. "propertyNames": {
  8064. "type": "string"
  8065. },
  8066. "additionalProperties": {
  8067. "type": "string"
  8068. }
  8069. }
  8070. },
  8071. "required": ["message", "isRetryable"]
  8072. }
  8073. },
  8074. "required": ["name", "data"]
  8075. },
  8076. "Event.session.error": {
  8077. "type": "object",
  8078. "properties": {
  8079. "type": {
  8080. "type": "string",
  8081. "const": "session.error"
  8082. },
  8083. "properties": {
  8084. "type": "object",
  8085. "properties": {
  8086. "sessionID": {
  8087. "type": "string",
  8088. "pattern": "^ses.*"
  8089. },
  8090. "error": {
  8091. "anyOf": [
  8092. {
  8093. "$ref": "#/components/schemas/ProviderAuthError"
  8094. },
  8095. {
  8096. "$ref": "#/components/schemas/UnknownError"
  8097. },
  8098. {
  8099. "$ref": "#/components/schemas/MessageOutputLengthError"
  8100. },
  8101. {
  8102. "$ref": "#/components/schemas/MessageAbortedError"
  8103. },
  8104. {
  8105. "$ref": "#/components/schemas/StructuredOutputError"
  8106. },
  8107. {
  8108. "$ref": "#/components/schemas/ContextOverflowError"
  8109. },
  8110. {
  8111. "$ref": "#/components/schemas/APIError"
  8112. }
  8113. ]
  8114. }
  8115. }
  8116. }
  8117. },
  8118. "required": ["type", "properties"]
  8119. },
  8120. "QuestionOption": {
  8121. "type": "object",
  8122. "properties": {
  8123. "label": {
  8124. "description": "Display text (1-5 words, concise)",
  8125. "type": "string"
  8126. },
  8127. "description": {
  8128. "description": "Explanation of choice",
  8129. "type": "string"
  8130. }
  8131. },
  8132. "required": ["label", "description"]
  8133. },
  8134. "QuestionInfo": {
  8135. "type": "object",
  8136. "properties": {
  8137. "question": {
  8138. "description": "Complete question",
  8139. "type": "string"
  8140. },
  8141. "header": {
  8142. "description": "Very short label (max 30 chars)",
  8143. "type": "string"
  8144. },
  8145. "options": {
  8146. "description": "Available choices",
  8147. "type": "array",
  8148. "items": {
  8149. "$ref": "#/components/schemas/QuestionOption"
  8150. }
  8151. },
  8152. "multiple": {
  8153. "description": "Allow selecting multiple choices",
  8154. "type": "boolean"
  8155. },
  8156. "custom": {
  8157. "description": "Allow typing a custom answer (default: true)",
  8158. "type": "boolean"
  8159. }
  8160. },
  8161. "required": ["question", "header", "options"]
  8162. },
  8163. "QuestionTool": {
  8164. "type": "object",
  8165. "properties": {
  8166. "messageID": {
  8167. "type": "string",
  8168. "pattern": "^msg.*"
  8169. },
  8170. "callID": {
  8171. "type": "string"
  8172. }
  8173. },
  8174. "required": ["messageID", "callID"]
  8175. },
  8176. "QuestionRequest": {
  8177. "type": "object",
  8178. "properties": {
  8179. "id": {
  8180. "type": "string",
  8181. "pattern": "^que.*"
  8182. },
  8183. "sessionID": {
  8184. "type": "string",
  8185. "pattern": "^ses.*"
  8186. },
  8187. "questions": {
  8188. "description": "Questions to ask",
  8189. "type": "array",
  8190. "items": {
  8191. "$ref": "#/components/schemas/QuestionInfo"
  8192. }
  8193. },
  8194. "tool": {
  8195. "$ref": "#/components/schemas/QuestionTool"
  8196. }
  8197. },
  8198. "required": ["id", "sessionID", "questions"]
  8199. },
  8200. "Event.question.asked": {
  8201. "type": "object",
  8202. "properties": {
  8203. "type": {
  8204. "type": "string",
  8205. "const": "question.asked"
  8206. },
  8207. "properties": {
  8208. "$ref": "#/components/schemas/QuestionRequest"
  8209. }
  8210. },
  8211. "required": ["type", "properties"]
  8212. },
  8213. "QuestionAnswer": {
  8214. "type": "array",
  8215. "items": {
  8216. "type": "string"
  8217. }
  8218. },
  8219. "QuestionReplied": {
  8220. "type": "object",
  8221. "properties": {
  8222. "sessionID": {
  8223. "type": "string",
  8224. "pattern": "^ses.*"
  8225. },
  8226. "requestID": {
  8227. "type": "string",
  8228. "pattern": "^que.*"
  8229. },
  8230. "answers": {
  8231. "type": "array",
  8232. "items": {
  8233. "$ref": "#/components/schemas/QuestionAnswer"
  8234. }
  8235. }
  8236. },
  8237. "required": ["sessionID", "requestID", "answers"]
  8238. },
  8239. "Event.question.replied": {
  8240. "type": "object",
  8241. "properties": {
  8242. "type": {
  8243. "type": "string",
  8244. "const": "question.replied"
  8245. },
  8246. "properties": {
  8247. "$ref": "#/components/schemas/QuestionReplied"
  8248. }
  8249. },
  8250. "required": ["type", "properties"]
  8251. },
  8252. "QuestionRejected": {
  8253. "type": "object",
  8254. "properties": {
  8255. "sessionID": {
  8256. "type": "string",
  8257. "pattern": "^ses.*"
  8258. },
  8259. "requestID": {
  8260. "type": "string",
  8261. "pattern": "^que.*"
  8262. }
  8263. },
  8264. "required": ["sessionID", "requestID"]
  8265. },
  8266. "Event.question.rejected": {
  8267. "type": "object",
  8268. "properties": {
  8269. "type": {
  8270. "type": "string",
  8271. "const": "question.rejected"
  8272. },
  8273. "properties": {
  8274. "$ref": "#/components/schemas/QuestionRejected"
  8275. }
  8276. },
  8277. "required": ["type", "properties"]
  8278. },
  8279. "Todo": {
  8280. "type": "object",
  8281. "properties": {
  8282. "content": {
  8283. "description": "Brief description of the task",
  8284. "type": "string"
  8285. },
  8286. "status": {
  8287. "description": "Current status of the task: pending, in_progress, completed, cancelled",
  8288. "type": "string"
  8289. },
  8290. "priority": {
  8291. "description": "Priority level of the task: high, medium, low",
  8292. "type": "string"
  8293. }
  8294. },
  8295. "required": ["content", "status", "priority"]
  8296. },
  8297. "Event.todo.updated": {
  8298. "type": "object",
  8299. "properties": {
  8300. "type": {
  8301. "type": "string",
  8302. "const": "todo.updated"
  8303. },
  8304. "properties": {
  8305. "type": "object",
  8306. "properties": {
  8307. "sessionID": {
  8308. "type": "string",
  8309. "pattern": "^ses.*"
  8310. },
  8311. "todos": {
  8312. "type": "array",
  8313. "items": {
  8314. "$ref": "#/components/schemas/Todo"
  8315. }
  8316. }
  8317. },
  8318. "required": ["sessionID", "todos"]
  8319. }
  8320. },
  8321. "required": ["type", "properties"]
  8322. },
  8323. "SessionStatus": {
  8324. "anyOf": [
  8325. {
  8326. "type": "object",
  8327. "properties": {
  8328. "type": {
  8329. "type": "string",
  8330. "const": "idle"
  8331. }
  8332. },
  8333. "required": ["type"]
  8334. },
  8335. {
  8336. "type": "object",
  8337. "properties": {
  8338. "type": {
  8339. "type": "string",
  8340. "const": "retry"
  8341. },
  8342. "attempt": {
  8343. "type": "number"
  8344. },
  8345. "message": {
  8346. "type": "string"
  8347. },
  8348. "next": {
  8349. "type": "number"
  8350. }
  8351. },
  8352. "required": ["type", "attempt", "message", "next"]
  8353. },
  8354. {
  8355. "type": "object",
  8356. "properties": {
  8357. "type": {
  8358. "type": "string",
  8359. "const": "busy"
  8360. }
  8361. },
  8362. "required": ["type"]
  8363. }
  8364. ]
  8365. },
  8366. "Event.session.status": {
  8367. "type": "object",
  8368. "properties": {
  8369. "type": {
  8370. "type": "string",
  8371. "const": "session.status"
  8372. },
  8373. "properties": {
  8374. "type": "object",
  8375. "properties": {
  8376. "sessionID": {
  8377. "type": "string",
  8378. "pattern": "^ses.*"
  8379. },
  8380. "status": {
  8381. "$ref": "#/components/schemas/SessionStatus"
  8382. }
  8383. },
  8384. "required": ["sessionID", "status"]
  8385. }
  8386. },
  8387. "required": ["type", "properties"]
  8388. },
  8389. "Event.session.idle": {
  8390. "type": "object",
  8391. "properties": {
  8392. "type": {
  8393. "type": "string",
  8394. "const": "session.idle"
  8395. },
  8396. "properties": {
  8397. "type": "object",
  8398. "properties": {
  8399. "sessionID": {
  8400. "type": "string",
  8401. "pattern": "^ses.*"
  8402. }
  8403. },
  8404. "required": ["sessionID"]
  8405. }
  8406. },
  8407. "required": ["type", "properties"]
  8408. },
  8409. "Event.session.compacted": {
  8410. "type": "object",
  8411. "properties": {
  8412. "type": {
  8413. "type": "string",
  8414. "const": "session.compacted"
  8415. },
  8416. "properties": {
  8417. "type": "object",
  8418. "properties": {
  8419. "sessionID": {
  8420. "type": "string",
  8421. "pattern": "^ses.*"
  8422. }
  8423. },
  8424. "required": ["sessionID"]
  8425. }
  8426. },
  8427. "required": ["type", "properties"]
  8428. },
  8429. "Event.tui.prompt.append": {
  8430. "type": "object",
  8431. "properties": {
  8432. "type": {
  8433. "type": "string",
  8434. "const": "tui.prompt.append"
  8435. },
  8436. "properties": {
  8437. "type": "object",
  8438. "properties": {
  8439. "text": {
  8440. "type": "string"
  8441. }
  8442. },
  8443. "required": ["text"]
  8444. }
  8445. },
  8446. "required": ["type", "properties"]
  8447. },
  8448. "Event.tui.command.execute": {
  8449. "type": "object",
  8450. "properties": {
  8451. "type": {
  8452. "type": "string",
  8453. "const": "tui.command.execute"
  8454. },
  8455. "properties": {
  8456. "type": "object",
  8457. "properties": {
  8458. "command": {
  8459. "anyOf": [
  8460. {
  8461. "type": "string",
  8462. "enum": [
  8463. "session.list",
  8464. "session.new",
  8465. "session.share",
  8466. "session.interrupt",
  8467. "session.compact",
  8468. "session.page.up",
  8469. "session.page.down",
  8470. "session.line.up",
  8471. "session.line.down",
  8472. "session.half.page.up",
  8473. "session.half.page.down",
  8474. "session.first",
  8475. "session.last",
  8476. "prompt.clear",
  8477. "prompt.submit",
  8478. "agent.cycle"
  8479. ]
  8480. },
  8481. {
  8482. "type": "string"
  8483. }
  8484. ]
  8485. }
  8486. },
  8487. "required": ["command"]
  8488. }
  8489. },
  8490. "required": ["type", "properties"]
  8491. },
  8492. "Event.tui.toast.show": {
  8493. "type": "object",
  8494. "properties": {
  8495. "type": {
  8496. "type": "string",
  8497. "const": "tui.toast.show"
  8498. },
  8499. "properties": {
  8500. "type": "object",
  8501. "properties": {
  8502. "title": {
  8503. "type": "string"
  8504. },
  8505. "message": {
  8506. "type": "string"
  8507. },
  8508. "variant": {
  8509. "type": "string",
  8510. "enum": ["info", "success", "warning", "error"]
  8511. },
  8512. "duration": {
  8513. "description": "Duration in milliseconds",
  8514. "default": 5000,
  8515. "type": "number"
  8516. }
  8517. },
  8518. "required": ["message", "variant"]
  8519. }
  8520. },
  8521. "required": ["type", "properties"]
  8522. },
  8523. "Event.tui.session.select": {
  8524. "type": "object",
  8525. "properties": {
  8526. "type": {
  8527. "type": "string",
  8528. "const": "tui.session.select"
  8529. },
  8530. "properties": {
  8531. "type": "object",
  8532. "properties": {
  8533. "sessionID": {
  8534. "description": "Session ID to navigate to",
  8535. "type": "string",
  8536. "pattern": "^ses.*"
  8537. }
  8538. },
  8539. "required": ["sessionID"]
  8540. }
  8541. },
  8542. "required": ["type", "properties"]
  8543. },
  8544. "Event.mcp.tools.changed": {
  8545. "type": "object",
  8546. "properties": {
  8547. "type": {
  8548. "type": "string",
  8549. "const": "mcp.tools.changed"
  8550. },
  8551. "properties": {
  8552. "type": "object",
  8553. "properties": {
  8554. "server": {
  8555. "type": "string"
  8556. }
  8557. },
  8558. "required": ["server"]
  8559. }
  8560. },
  8561. "required": ["type", "properties"]
  8562. },
  8563. "Event.mcp.browser.open.failed": {
  8564. "type": "object",
  8565. "properties": {
  8566. "type": {
  8567. "type": "string",
  8568. "const": "mcp.browser.open.failed"
  8569. },
  8570. "properties": {
  8571. "type": "object",
  8572. "properties": {
  8573. "mcpName": {
  8574. "type": "string"
  8575. },
  8576. "url": {
  8577. "type": "string"
  8578. }
  8579. },
  8580. "required": ["mcpName", "url"]
  8581. }
  8582. },
  8583. "required": ["type", "properties"]
  8584. },
  8585. "Event.command.executed": {
  8586. "type": "object",
  8587. "properties": {
  8588. "type": {
  8589. "type": "string",
  8590. "const": "command.executed"
  8591. },
  8592. "properties": {
  8593. "type": "object",
  8594. "properties": {
  8595. "name": {
  8596. "type": "string"
  8597. },
  8598. "sessionID": {
  8599. "type": "string",
  8600. "pattern": "^ses.*"
  8601. },
  8602. "arguments": {
  8603. "type": "string"
  8604. },
  8605. "messageID": {
  8606. "type": "string",
  8607. "pattern": "^msg.*"
  8608. }
  8609. },
  8610. "required": ["name", "sessionID", "arguments", "messageID"]
  8611. }
  8612. },
  8613. "required": ["type", "properties"]
  8614. },
  8615. "Event.vcs.branch.updated": {
  8616. "type": "object",
  8617. "properties": {
  8618. "type": {
  8619. "type": "string",
  8620. "const": "vcs.branch.updated"
  8621. },
  8622. "properties": {
  8623. "type": "object",
  8624. "properties": {
  8625. "branch": {
  8626. "type": "string"
  8627. }
  8628. }
  8629. }
  8630. },
  8631. "required": ["type", "properties"]
  8632. },
  8633. "Event.worktree.ready": {
  8634. "type": "object",
  8635. "properties": {
  8636. "type": {
  8637. "type": "string",
  8638. "const": "worktree.ready"
  8639. },
  8640. "properties": {
  8641. "type": "object",
  8642. "properties": {
  8643. "name": {
  8644. "type": "string"
  8645. },
  8646. "branch": {
  8647. "type": "string"
  8648. }
  8649. },
  8650. "required": ["name", "branch"]
  8651. }
  8652. },
  8653. "required": ["type", "properties"]
  8654. },
  8655. "Event.worktree.failed": {
  8656. "type": "object",
  8657. "properties": {
  8658. "type": {
  8659. "type": "string",
  8660. "const": "worktree.failed"
  8661. },
  8662. "properties": {
  8663. "type": "object",
  8664. "properties": {
  8665. "message": {
  8666. "type": "string"
  8667. }
  8668. },
  8669. "required": ["message"]
  8670. }
  8671. },
  8672. "required": ["type", "properties"]
  8673. },
  8674. "Pty": {
  8675. "type": "object",
  8676. "properties": {
  8677. "id": {
  8678. "type": "string",
  8679. "pattern": "^pty.*"
  8680. },
  8681. "title": {
  8682. "type": "string"
  8683. },
  8684. "command": {
  8685. "type": "string"
  8686. },
  8687. "args": {
  8688. "type": "array",
  8689. "items": {
  8690. "type": "string"
  8691. }
  8692. },
  8693. "cwd": {
  8694. "type": "string"
  8695. },
  8696. "status": {
  8697. "type": "string",
  8698. "enum": ["running", "exited"]
  8699. },
  8700. "pid": {
  8701. "type": "number"
  8702. }
  8703. },
  8704. "required": ["id", "title", "command", "args", "cwd", "status", "pid"]
  8705. },
  8706. "Event.pty.created": {
  8707. "type": "object",
  8708. "properties": {
  8709. "type": {
  8710. "type": "string",
  8711. "const": "pty.created"
  8712. },
  8713. "properties": {
  8714. "type": "object",
  8715. "properties": {
  8716. "info": {
  8717. "$ref": "#/components/schemas/Pty"
  8718. }
  8719. },
  8720. "required": ["info"]
  8721. }
  8722. },
  8723. "required": ["type", "properties"]
  8724. },
  8725. "Event.pty.updated": {
  8726. "type": "object",
  8727. "properties": {
  8728. "type": {
  8729. "type": "string",
  8730. "const": "pty.updated"
  8731. },
  8732. "properties": {
  8733. "type": "object",
  8734. "properties": {
  8735. "info": {
  8736. "$ref": "#/components/schemas/Pty"
  8737. }
  8738. },
  8739. "required": ["info"]
  8740. }
  8741. },
  8742. "required": ["type", "properties"]
  8743. },
  8744. "Event.pty.exited": {
  8745. "type": "object",
  8746. "properties": {
  8747. "type": {
  8748. "type": "string",
  8749. "const": "pty.exited"
  8750. },
  8751. "properties": {
  8752. "type": "object",
  8753. "properties": {
  8754. "id": {
  8755. "type": "string",
  8756. "pattern": "^pty.*"
  8757. },
  8758. "exitCode": {
  8759. "type": "number"
  8760. }
  8761. },
  8762. "required": ["id", "exitCode"]
  8763. }
  8764. },
  8765. "required": ["type", "properties"]
  8766. },
  8767. "Event.pty.deleted": {
  8768. "type": "object",
  8769. "properties": {
  8770. "type": {
  8771. "type": "string",
  8772. "const": "pty.deleted"
  8773. },
  8774. "properties": {
  8775. "type": "object",
  8776. "properties": {
  8777. "id": {
  8778. "type": "string",
  8779. "pattern": "^pty.*"
  8780. }
  8781. },
  8782. "required": ["id"]
  8783. }
  8784. },
  8785. "required": ["type", "properties"]
  8786. },
  8787. "Event.workspace.ready": {
  8788. "type": "object",
  8789. "properties": {
  8790. "type": {
  8791. "type": "string",
  8792. "const": "workspace.ready"
  8793. },
  8794. "properties": {
  8795. "type": "object",
  8796. "properties": {
  8797. "name": {
  8798. "type": "string"
  8799. }
  8800. },
  8801. "required": ["name"]
  8802. }
  8803. },
  8804. "required": ["type", "properties"]
  8805. },
  8806. "Event.workspace.failed": {
  8807. "type": "object",
  8808. "properties": {
  8809. "type": {
  8810. "type": "string",
  8811. "const": "workspace.failed"
  8812. },
  8813. "properties": {
  8814. "type": "object",
  8815. "properties": {
  8816. "message": {
  8817. "type": "string"
  8818. }
  8819. },
  8820. "required": ["message"]
  8821. }
  8822. },
  8823. "required": ["type", "properties"]
  8824. },
  8825. "Event.workspace.restore": {
  8826. "type": "object",
  8827. "properties": {
  8828. "type": {
  8829. "type": "string",
  8830. "const": "workspace.restore"
  8831. },
  8832. "properties": {
  8833. "type": "object",
  8834. "properties": {
  8835. "workspaceID": {
  8836. "type": "string",
  8837. "pattern": "^wrk.*"
  8838. },
  8839. "sessionID": {
  8840. "type": "string",
  8841. "pattern": "^ses.*"
  8842. },
  8843. "total": {
  8844. "type": "integer",
  8845. "minimum": 0,
  8846. "maximum": 9007199254740991
  8847. },
  8848. "step": {
  8849. "type": "integer",
  8850. "minimum": 0,
  8851. "maximum": 9007199254740991
  8852. }
  8853. },
  8854. "required": ["workspaceID", "sessionID", "total", "step"]
  8855. }
  8856. },
  8857. "required": ["type", "properties"]
  8858. },
  8859. "Event.workspace.status": {
  8860. "type": "object",
  8861. "properties": {
  8862. "type": {
  8863. "type": "string",
  8864. "const": "workspace.status"
  8865. },
  8866. "properties": {
  8867. "type": "object",
  8868. "properties": {
  8869. "workspaceID": {
  8870. "type": "string",
  8871. "pattern": "^wrk.*"
  8872. },
  8873. "status": {
  8874. "type": "string",
  8875. "enum": ["connected", "connecting", "disconnected", "error"]
  8876. }
  8877. },
  8878. "required": ["workspaceID", "status"]
  8879. }
  8880. },
  8881. "required": ["type", "properties"]
  8882. },
  8883. "OutputFormatText": {
  8884. "type": "object",
  8885. "properties": {
  8886. "type": {
  8887. "type": "string",
  8888. "const": "text"
  8889. }
  8890. },
  8891. "required": ["type"]
  8892. },
  8893. "JSONSchema": {
  8894. "type": "object",
  8895. "propertyNames": {
  8896. "type": "string"
  8897. },
  8898. "additionalProperties": {}
  8899. },
  8900. "OutputFormatJsonSchema": {
  8901. "type": "object",
  8902. "properties": {
  8903. "type": {
  8904. "type": "string",
  8905. "const": "json_schema"
  8906. },
  8907. "schema": {
  8908. "$ref": "#/components/schemas/JSONSchema"
  8909. },
  8910. "retryCount": {
  8911. "default": 2,
  8912. "type": "integer",
  8913. "minimum": 0,
  8914. "maximum": 9007199254740991
  8915. }
  8916. },
  8917. "required": ["type", "schema"]
  8918. },
  8919. "OutputFormat": {
  8920. "anyOf": [
  8921. {
  8922. "$ref": "#/components/schemas/OutputFormatText"
  8923. },
  8924. {
  8925. "$ref": "#/components/schemas/OutputFormatJsonSchema"
  8926. }
  8927. ]
  8928. },
  8929. "UserMessage": {
  8930. "type": "object",
  8931. "properties": {
  8932. "id": {
  8933. "type": "string",
  8934. "pattern": "^msg.*"
  8935. },
  8936. "sessionID": {
  8937. "type": "string",
  8938. "pattern": "^ses.*"
  8939. },
  8940. "role": {
  8941. "type": "string",
  8942. "const": "user"
  8943. },
  8944. "time": {
  8945. "type": "object",
  8946. "properties": {
  8947. "created": {
  8948. "type": "number"
  8949. }
  8950. },
  8951. "required": ["created"]
  8952. },
  8953. "format": {
  8954. "$ref": "#/components/schemas/OutputFormat"
  8955. },
  8956. "summary": {
  8957. "type": "object",
  8958. "properties": {
  8959. "title": {
  8960. "type": "string"
  8961. },
  8962. "body": {
  8963. "type": "string"
  8964. },
  8965. "diffs": {
  8966. "type": "array",
  8967. "items": {
  8968. "$ref": "#/components/schemas/SnapshotFileDiff"
  8969. }
  8970. }
  8971. },
  8972. "required": ["diffs"]
  8973. },
  8974. "agent": {
  8975. "type": "string"
  8976. },
  8977. "model": {
  8978. "type": "object",
  8979. "properties": {
  8980. "providerID": {
  8981. "type": "string"
  8982. },
  8983. "modelID": {
  8984. "type": "string"
  8985. },
  8986. "variant": {
  8987. "type": "string"
  8988. }
  8989. },
  8990. "required": ["providerID", "modelID"]
  8991. },
  8992. "system": {
  8993. "type": "string"
  8994. },
  8995. "tools": {
  8996. "type": "object",
  8997. "propertyNames": {
  8998. "type": "string"
  8999. },
  9000. "additionalProperties": {
  9001. "type": "boolean"
  9002. }
  9003. }
  9004. },
  9005. "required": ["id", "sessionID", "role", "time", "agent", "model"]
  9006. },
  9007. "AssistantMessage": {
  9008. "type": "object",
  9009. "properties": {
  9010. "id": {
  9011. "type": "string",
  9012. "pattern": "^msg.*"
  9013. },
  9014. "sessionID": {
  9015. "type": "string",
  9016. "pattern": "^ses.*"
  9017. },
  9018. "role": {
  9019. "type": "string",
  9020. "const": "assistant"
  9021. },
  9022. "time": {
  9023. "type": "object",
  9024. "properties": {
  9025. "created": {
  9026. "type": "number"
  9027. },
  9028. "completed": {
  9029. "type": "number"
  9030. }
  9031. },
  9032. "required": ["created"]
  9033. },
  9034. "error": {
  9035. "anyOf": [
  9036. {
  9037. "$ref": "#/components/schemas/ProviderAuthError"
  9038. },
  9039. {
  9040. "$ref": "#/components/schemas/UnknownError"
  9041. },
  9042. {
  9043. "$ref": "#/components/schemas/MessageOutputLengthError"
  9044. },
  9045. {
  9046. "$ref": "#/components/schemas/MessageAbortedError"
  9047. },
  9048. {
  9049. "$ref": "#/components/schemas/StructuredOutputError"
  9050. },
  9051. {
  9052. "$ref": "#/components/schemas/ContextOverflowError"
  9053. },
  9054. {
  9055. "$ref": "#/components/schemas/APIError"
  9056. }
  9057. ]
  9058. },
  9059. "parentID": {
  9060. "type": "string",
  9061. "pattern": "^msg.*"
  9062. },
  9063. "modelID": {
  9064. "type": "string"
  9065. },
  9066. "providerID": {
  9067. "type": "string"
  9068. },
  9069. "mode": {
  9070. "type": "string"
  9071. },
  9072. "agent": {
  9073. "type": "string"
  9074. },
  9075. "path": {
  9076. "type": "object",
  9077. "properties": {
  9078. "cwd": {
  9079. "type": "string"
  9080. },
  9081. "root": {
  9082. "type": "string"
  9083. }
  9084. },
  9085. "required": ["cwd", "root"]
  9086. },
  9087. "summary": {
  9088. "type": "boolean"
  9089. },
  9090. "cost": {
  9091. "type": "number"
  9092. },
  9093. "tokens": {
  9094. "type": "object",
  9095. "properties": {
  9096. "total": {
  9097. "type": "number"
  9098. },
  9099. "input": {
  9100. "type": "number"
  9101. },
  9102. "output": {
  9103. "type": "number"
  9104. },
  9105. "reasoning": {
  9106. "type": "number"
  9107. },
  9108. "cache": {
  9109. "type": "object",
  9110. "properties": {
  9111. "read": {
  9112. "type": "number"
  9113. },
  9114. "write": {
  9115. "type": "number"
  9116. }
  9117. },
  9118. "required": ["read", "write"]
  9119. }
  9120. },
  9121. "required": ["input", "output", "reasoning", "cache"]
  9122. },
  9123. "structured": {},
  9124. "variant": {
  9125. "type": "string"
  9126. },
  9127. "finish": {
  9128. "type": "string"
  9129. }
  9130. },
  9131. "required": [
  9132. "id",
  9133. "sessionID",
  9134. "role",
  9135. "time",
  9136. "parentID",
  9137. "modelID",
  9138. "providerID",
  9139. "mode",
  9140. "agent",
  9141. "path",
  9142. "cost",
  9143. "tokens"
  9144. ]
  9145. },
  9146. "Message": {
  9147. "anyOf": [
  9148. {
  9149. "$ref": "#/components/schemas/UserMessage"
  9150. },
  9151. {
  9152. "$ref": "#/components/schemas/AssistantMessage"
  9153. }
  9154. ]
  9155. },
  9156. "Event.message.updated": {
  9157. "type": "object",
  9158. "properties": {
  9159. "type": {
  9160. "type": "string",
  9161. "const": "message.updated"
  9162. },
  9163. "properties": {
  9164. "type": "object",
  9165. "properties": {
  9166. "sessionID": {
  9167. "type": "string",
  9168. "pattern": "^ses.*"
  9169. },
  9170. "info": {
  9171. "$ref": "#/components/schemas/Message"
  9172. }
  9173. },
  9174. "required": ["sessionID", "info"]
  9175. }
  9176. },
  9177. "required": ["type", "properties"]
  9178. },
  9179. "Event.message.removed": {
  9180. "type": "object",
  9181. "properties": {
  9182. "type": {
  9183. "type": "string",
  9184. "const": "message.removed"
  9185. },
  9186. "properties": {
  9187. "type": "object",
  9188. "properties": {
  9189. "sessionID": {
  9190. "type": "string",
  9191. "pattern": "^ses.*"
  9192. },
  9193. "messageID": {
  9194. "type": "string",
  9195. "pattern": "^msg.*"
  9196. }
  9197. },
  9198. "required": ["sessionID", "messageID"]
  9199. }
  9200. },
  9201. "required": ["type", "properties"]
  9202. },
  9203. "TextPart": {
  9204. "type": "object",
  9205. "properties": {
  9206. "id": {
  9207. "type": "string",
  9208. "pattern": "^prt.*"
  9209. },
  9210. "sessionID": {
  9211. "type": "string",
  9212. "pattern": "^ses.*"
  9213. },
  9214. "messageID": {
  9215. "type": "string",
  9216. "pattern": "^msg.*"
  9217. },
  9218. "type": {
  9219. "type": "string",
  9220. "const": "text"
  9221. },
  9222. "text": {
  9223. "type": "string"
  9224. },
  9225. "synthetic": {
  9226. "type": "boolean"
  9227. },
  9228. "ignored": {
  9229. "type": "boolean"
  9230. },
  9231. "time": {
  9232. "type": "object",
  9233. "properties": {
  9234. "start": {
  9235. "type": "number"
  9236. },
  9237. "end": {
  9238. "type": "number"
  9239. }
  9240. },
  9241. "required": ["start"]
  9242. },
  9243. "metadata": {
  9244. "type": "object",
  9245. "propertyNames": {
  9246. "type": "string"
  9247. },
  9248. "additionalProperties": {}
  9249. }
  9250. },
  9251. "required": ["id", "sessionID", "messageID", "type", "text"]
  9252. },
  9253. "SubtaskPart": {
  9254. "type": "object",
  9255. "properties": {
  9256. "id": {
  9257. "type": "string",
  9258. "pattern": "^prt.*"
  9259. },
  9260. "sessionID": {
  9261. "type": "string",
  9262. "pattern": "^ses.*"
  9263. },
  9264. "messageID": {
  9265. "type": "string",
  9266. "pattern": "^msg.*"
  9267. },
  9268. "type": {
  9269. "type": "string",
  9270. "const": "subtask"
  9271. },
  9272. "prompt": {
  9273. "type": "string"
  9274. },
  9275. "description": {
  9276. "type": "string"
  9277. },
  9278. "agent": {
  9279. "type": "string"
  9280. },
  9281. "model": {
  9282. "type": "object",
  9283. "properties": {
  9284. "providerID": {
  9285. "type": "string"
  9286. },
  9287. "modelID": {
  9288. "type": "string"
  9289. }
  9290. },
  9291. "required": ["providerID", "modelID"]
  9292. },
  9293. "command": {
  9294. "type": "string"
  9295. }
  9296. },
  9297. "required": ["id", "sessionID", "messageID", "type", "prompt", "description", "agent"]
  9298. },
  9299. "ReasoningPart": {
  9300. "type": "object",
  9301. "properties": {
  9302. "id": {
  9303. "type": "string",
  9304. "pattern": "^prt.*"
  9305. },
  9306. "sessionID": {
  9307. "type": "string",
  9308. "pattern": "^ses.*"
  9309. },
  9310. "messageID": {
  9311. "type": "string",
  9312. "pattern": "^msg.*"
  9313. },
  9314. "type": {
  9315. "type": "string",
  9316. "const": "reasoning"
  9317. },
  9318. "text": {
  9319. "type": "string"
  9320. },
  9321. "metadata": {
  9322. "type": "object",
  9323. "propertyNames": {
  9324. "type": "string"
  9325. },
  9326. "additionalProperties": {}
  9327. },
  9328. "time": {
  9329. "type": "object",
  9330. "properties": {
  9331. "start": {
  9332. "type": "number"
  9333. },
  9334. "end": {
  9335. "type": "number"
  9336. }
  9337. },
  9338. "required": ["start"]
  9339. }
  9340. },
  9341. "required": ["id", "sessionID", "messageID", "type", "text", "time"]
  9342. },
  9343. "FilePartSourceText": {
  9344. "type": "object",
  9345. "properties": {
  9346. "value": {
  9347. "type": "string"
  9348. },
  9349. "start": {
  9350. "type": "integer",
  9351. "minimum": -9007199254740991,
  9352. "maximum": 9007199254740991
  9353. },
  9354. "end": {
  9355. "type": "integer",
  9356. "minimum": -9007199254740991,
  9357. "maximum": 9007199254740991
  9358. }
  9359. },
  9360. "required": ["value", "start", "end"]
  9361. },
  9362. "FileSource": {
  9363. "type": "object",
  9364. "properties": {
  9365. "text": {
  9366. "$ref": "#/components/schemas/FilePartSourceText"
  9367. },
  9368. "type": {
  9369. "type": "string",
  9370. "const": "file"
  9371. },
  9372. "path": {
  9373. "type": "string"
  9374. }
  9375. },
  9376. "required": ["text", "type", "path"]
  9377. },
  9378. "Range": {
  9379. "type": "object",
  9380. "properties": {
  9381. "start": {
  9382. "type": "object",
  9383. "properties": {
  9384. "line": {
  9385. "type": "number"
  9386. },
  9387. "character": {
  9388. "type": "number"
  9389. }
  9390. },
  9391. "required": ["line", "character"]
  9392. },
  9393. "end": {
  9394. "type": "object",
  9395. "properties": {
  9396. "line": {
  9397. "type": "number"
  9398. },
  9399. "character": {
  9400. "type": "number"
  9401. }
  9402. },
  9403. "required": ["line", "character"]
  9404. }
  9405. },
  9406. "required": ["start", "end"]
  9407. },
  9408. "SymbolSource": {
  9409. "type": "object",
  9410. "properties": {
  9411. "text": {
  9412. "$ref": "#/components/schemas/FilePartSourceText"
  9413. },
  9414. "type": {
  9415. "type": "string",
  9416. "const": "symbol"
  9417. },
  9418. "path": {
  9419. "type": "string"
  9420. },
  9421. "range": {
  9422. "$ref": "#/components/schemas/Range"
  9423. },
  9424. "name": {
  9425. "type": "string"
  9426. },
  9427. "kind": {
  9428. "type": "integer",
  9429. "minimum": -9007199254740991,
  9430. "maximum": 9007199254740991
  9431. }
  9432. },
  9433. "required": ["text", "type", "path", "range", "name", "kind"]
  9434. },
  9435. "ResourceSource": {
  9436. "type": "object",
  9437. "properties": {
  9438. "text": {
  9439. "$ref": "#/components/schemas/FilePartSourceText"
  9440. },
  9441. "type": {
  9442. "type": "string",
  9443. "const": "resource"
  9444. },
  9445. "clientName": {
  9446. "type": "string"
  9447. },
  9448. "uri": {
  9449. "type": "string"
  9450. }
  9451. },
  9452. "required": ["text", "type", "clientName", "uri"]
  9453. },
  9454. "FilePartSource": {
  9455. "anyOf": [
  9456. {
  9457. "$ref": "#/components/schemas/FileSource"
  9458. },
  9459. {
  9460. "$ref": "#/components/schemas/SymbolSource"
  9461. },
  9462. {
  9463. "$ref": "#/components/schemas/ResourceSource"
  9464. }
  9465. ]
  9466. },
  9467. "FilePart": {
  9468. "type": "object",
  9469. "properties": {
  9470. "id": {
  9471. "type": "string",
  9472. "pattern": "^prt.*"
  9473. },
  9474. "sessionID": {
  9475. "type": "string",
  9476. "pattern": "^ses.*"
  9477. },
  9478. "messageID": {
  9479. "type": "string",
  9480. "pattern": "^msg.*"
  9481. },
  9482. "type": {
  9483. "type": "string",
  9484. "const": "file"
  9485. },
  9486. "mime": {
  9487. "type": "string"
  9488. },
  9489. "filename": {
  9490. "type": "string"
  9491. },
  9492. "url": {
  9493. "type": "string"
  9494. },
  9495. "source": {
  9496. "$ref": "#/components/schemas/FilePartSource"
  9497. }
  9498. },
  9499. "required": ["id", "sessionID", "messageID", "type", "mime", "url"]
  9500. },
  9501. "ToolStatePending": {
  9502. "type": "object",
  9503. "properties": {
  9504. "status": {
  9505. "type": "string",
  9506. "const": "pending"
  9507. },
  9508. "input": {
  9509. "type": "object",
  9510. "propertyNames": {
  9511. "type": "string"
  9512. },
  9513. "additionalProperties": {}
  9514. },
  9515. "raw": {
  9516. "type": "string"
  9517. }
  9518. },
  9519. "required": ["status", "input", "raw"]
  9520. },
  9521. "ToolStateRunning": {
  9522. "type": "object",
  9523. "properties": {
  9524. "status": {
  9525. "type": "string",
  9526. "const": "running"
  9527. },
  9528. "input": {
  9529. "type": "object",
  9530. "propertyNames": {
  9531. "type": "string"
  9532. },
  9533. "additionalProperties": {}
  9534. },
  9535. "title": {
  9536. "type": "string"
  9537. },
  9538. "metadata": {
  9539. "type": "object",
  9540. "propertyNames": {
  9541. "type": "string"
  9542. },
  9543. "additionalProperties": {}
  9544. },
  9545. "time": {
  9546. "type": "object",
  9547. "properties": {
  9548. "start": {
  9549. "type": "number"
  9550. }
  9551. },
  9552. "required": ["start"]
  9553. }
  9554. },
  9555. "required": ["status", "input", "time"]
  9556. },
  9557. "ToolStateCompleted": {
  9558. "type": "object",
  9559. "properties": {
  9560. "status": {
  9561. "type": "string",
  9562. "const": "completed"
  9563. },
  9564. "input": {
  9565. "type": "object",
  9566. "propertyNames": {
  9567. "type": "string"
  9568. },
  9569. "additionalProperties": {}
  9570. },
  9571. "output": {
  9572. "type": "string"
  9573. },
  9574. "title": {
  9575. "type": "string"
  9576. },
  9577. "metadata": {
  9578. "type": "object",
  9579. "propertyNames": {
  9580. "type": "string"
  9581. },
  9582. "additionalProperties": {}
  9583. },
  9584. "time": {
  9585. "type": "object",
  9586. "properties": {
  9587. "start": {
  9588. "type": "number"
  9589. },
  9590. "end": {
  9591. "type": "number"
  9592. },
  9593. "compacted": {
  9594. "type": "number"
  9595. }
  9596. },
  9597. "required": ["start", "end"]
  9598. },
  9599. "attachments": {
  9600. "type": "array",
  9601. "items": {
  9602. "$ref": "#/components/schemas/FilePart"
  9603. }
  9604. }
  9605. },
  9606. "required": ["status", "input", "output", "title", "metadata", "time"]
  9607. },
  9608. "ToolStateError": {
  9609. "type": "object",
  9610. "properties": {
  9611. "status": {
  9612. "type": "string",
  9613. "const": "error"
  9614. },
  9615. "input": {
  9616. "type": "object",
  9617. "propertyNames": {
  9618. "type": "string"
  9619. },
  9620. "additionalProperties": {}
  9621. },
  9622. "error": {
  9623. "type": "string"
  9624. },
  9625. "metadata": {
  9626. "type": "object",
  9627. "propertyNames": {
  9628. "type": "string"
  9629. },
  9630. "additionalProperties": {}
  9631. },
  9632. "time": {
  9633. "type": "object",
  9634. "properties": {
  9635. "start": {
  9636. "type": "number"
  9637. },
  9638. "end": {
  9639. "type": "number"
  9640. }
  9641. },
  9642. "required": ["start", "end"]
  9643. }
  9644. },
  9645. "required": ["status", "input", "error", "time"]
  9646. },
  9647. "ToolState": {
  9648. "anyOf": [
  9649. {
  9650. "$ref": "#/components/schemas/ToolStatePending"
  9651. },
  9652. {
  9653. "$ref": "#/components/schemas/ToolStateRunning"
  9654. },
  9655. {
  9656. "$ref": "#/components/schemas/ToolStateCompleted"
  9657. },
  9658. {
  9659. "$ref": "#/components/schemas/ToolStateError"
  9660. }
  9661. ]
  9662. },
  9663. "ToolPart": {
  9664. "type": "object",
  9665. "properties": {
  9666. "id": {
  9667. "type": "string",
  9668. "pattern": "^prt.*"
  9669. },
  9670. "sessionID": {
  9671. "type": "string",
  9672. "pattern": "^ses.*"
  9673. },
  9674. "messageID": {
  9675. "type": "string",
  9676. "pattern": "^msg.*"
  9677. },
  9678. "type": {
  9679. "type": "string",
  9680. "const": "tool"
  9681. },
  9682. "callID": {
  9683. "type": "string"
  9684. },
  9685. "tool": {
  9686. "type": "string"
  9687. },
  9688. "state": {
  9689. "$ref": "#/components/schemas/ToolState"
  9690. },
  9691. "metadata": {
  9692. "type": "object",
  9693. "propertyNames": {
  9694. "type": "string"
  9695. },
  9696. "additionalProperties": {}
  9697. }
  9698. },
  9699. "required": ["id", "sessionID", "messageID", "type", "callID", "tool", "state"]
  9700. },
  9701. "StepStartPart": {
  9702. "type": "object",
  9703. "properties": {
  9704. "id": {
  9705. "type": "string",
  9706. "pattern": "^prt.*"
  9707. },
  9708. "sessionID": {
  9709. "type": "string",
  9710. "pattern": "^ses.*"
  9711. },
  9712. "messageID": {
  9713. "type": "string",
  9714. "pattern": "^msg.*"
  9715. },
  9716. "type": {
  9717. "type": "string",
  9718. "const": "step-start"
  9719. },
  9720. "snapshot": {
  9721. "type": "string"
  9722. }
  9723. },
  9724. "required": ["id", "sessionID", "messageID", "type"]
  9725. },
  9726. "StepFinishPart": {
  9727. "type": "object",
  9728. "properties": {
  9729. "id": {
  9730. "type": "string",
  9731. "pattern": "^prt.*"
  9732. },
  9733. "sessionID": {
  9734. "type": "string",
  9735. "pattern": "^ses.*"
  9736. },
  9737. "messageID": {
  9738. "type": "string",
  9739. "pattern": "^msg.*"
  9740. },
  9741. "type": {
  9742. "type": "string",
  9743. "const": "step-finish"
  9744. },
  9745. "reason": {
  9746. "type": "string"
  9747. },
  9748. "snapshot": {
  9749. "type": "string"
  9750. },
  9751. "cost": {
  9752. "type": "number"
  9753. },
  9754. "tokens": {
  9755. "type": "object",
  9756. "properties": {
  9757. "total": {
  9758. "type": "number"
  9759. },
  9760. "input": {
  9761. "type": "number"
  9762. },
  9763. "output": {
  9764. "type": "number"
  9765. },
  9766. "reasoning": {
  9767. "type": "number"
  9768. },
  9769. "cache": {
  9770. "type": "object",
  9771. "properties": {
  9772. "read": {
  9773. "type": "number"
  9774. },
  9775. "write": {
  9776. "type": "number"
  9777. }
  9778. },
  9779. "required": ["read", "write"]
  9780. }
  9781. },
  9782. "required": ["input", "output", "reasoning", "cache"]
  9783. }
  9784. },
  9785. "required": ["id", "sessionID", "messageID", "type", "reason", "cost", "tokens"]
  9786. },
  9787. "SnapshotPart": {
  9788. "type": "object",
  9789. "properties": {
  9790. "id": {
  9791. "type": "string",
  9792. "pattern": "^prt.*"
  9793. },
  9794. "sessionID": {
  9795. "type": "string",
  9796. "pattern": "^ses.*"
  9797. },
  9798. "messageID": {
  9799. "type": "string",
  9800. "pattern": "^msg.*"
  9801. },
  9802. "type": {
  9803. "type": "string",
  9804. "const": "snapshot"
  9805. },
  9806. "snapshot": {
  9807. "type": "string"
  9808. }
  9809. },
  9810. "required": ["id", "sessionID", "messageID", "type", "snapshot"]
  9811. },
  9812. "PatchPart": {
  9813. "type": "object",
  9814. "properties": {
  9815. "id": {
  9816. "type": "string",
  9817. "pattern": "^prt.*"
  9818. },
  9819. "sessionID": {
  9820. "type": "string",
  9821. "pattern": "^ses.*"
  9822. },
  9823. "messageID": {
  9824. "type": "string",
  9825. "pattern": "^msg.*"
  9826. },
  9827. "type": {
  9828. "type": "string",
  9829. "const": "patch"
  9830. },
  9831. "hash": {
  9832. "type": "string"
  9833. },
  9834. "files": {
  9835. "type": "array",
  9836. "items": {
  9837. "type": "string"
  9838. }
  9839. }
  9840. },
  9841. "required": ["id", "sessionID", "messageID", "type", "hash", "files"]
  9842. },
  9843. "AgentPart": {
  9844. "type": "object",
  9845. "properties": {
  9846. "id": {
  9847. "type": "string",
  9848. "pattern": "^prt.*"
  9849. },
  9850. "sessionID": {
  9851. "type": "string",
  9852. "pattern": "^ses.*"
  9853. },
  9854. "messageID": {
  9855. "type": "string",
  9856. "pattern": "^msg.*"
  9857. },
  9858. "type": {
  9859. "type": "string",
  9860. "const": "agent"
  9861. },
  9862. "name": {
  9863. "type": "string"
  9864. },
  9865. "source": {
  9866. "type": "object",
  9867. "properties": {
  9868. "value": {
  9869. "type": "string"
  9870. },
  9871. "start": {
  9872. "type": "integer",
  9873. "minimum": -9007199254740991,
  9874. "maximum": 9007199254740991
  9875. },
  9876. "end": {
  9877. "type": "integer",
  9878. "minimum": -9007199254740991,
  9879. "maximum": 9007199254740991
  9880. }
  9881. },
  9882. "required": ["value", "start", "end"]
  9883. }
  9884. },
  9885. "required": ["id", "sessionID", "messageID", "type", "name"]
  9886. },
  9887. "RetryPart": {
  9888. "type": "object",
  9889. "properties": {
  9890. "id": {
  9891. "type": "string",
  9892. "pattern": "^prt.*"
  9893. },
  9894. "sessionID": {
  9895. "type": "string",
  9896. "pattern": "^ses.*"
  9897. },
  9898. "messageID": {
  9899. "type": "string",
  9900. "pattern": "^msg.*"
  9901. },
  9902. "type": {
  9903. "type": "string",
  9904. "const": "retry"
  9905. },
  9906. "attempt": {
  9907. "type": "number"
  9908. },
  9909. "error": {
  9910. "$ref": "#/components/schemas/APIError"
  9911. },
  9912. "time": {
  9913. "type": "object",
  9914. "properties": {
  9915. "created": {
  9916. "type": "number"
  9917. }
  9918. },
  9919. "required": ["created"]
  9920. }
  9921. },
  9922. "required": ["id", "sessionID", "messageID", "type", "attempt", "error", "time"]
  9923. },
  9924. "CompactionPart": {
  9925. "type": "object",
  9926. "properties": {
  9927. "id": {
  9928. "type": "string",
  9929. "pattern": "^prt.*"
  9930. },
  9931. "sessionID": {
  9932. "type": "string",
  9933. "pattern": "^ses.*"
  9934. },
  9935. "messageID": {
  9936. "type": "string",
  9937. "pattern": "^msg.*"
  9938. },
  9939. "type": {
  9940. "type": "string",
  9941. "const": "compaction"
  9942. },
  9943. "auto": {
  9944. "type": "boolean"
  9945. },
  9946. "overflow": {
  9947. "type": "boolean"
  9948. }
  9949. },
  9950. "required": ["id", "sessionID", "messageID", "type", "auto"]
  9951. },
  9952. "Part": {
  9953. "anyOf": [
  9954. {
  9955. "$ref": "#/components/schemas/TextPart"
  9956. },
  9957. {
  9958. "$ref": "#/components/schemas/SubtaskPart"
  9959. },
  9960. {
  9961. "$ref": "#/components/schemas/ReasoningPart"
  9962. },
  9963. {
  9964. "$ref": "#/components/schemas/FilePart"
  9965. },
  9966. {
  9967. "$ref": "#/components/schemas/ToolPart"
  9968. },
  9969. {
  9970. "$ref": "#/components/schemas/StepStartPart"
  9971. },
  9972. {
  9973. "$ref": "#/components/schemas/StepFinishPart"
  9974. },
  9975. {
  9976. "$ref": "#/components/schemas/SnapshotPart"
  9977. },
  9978. {
  9979. "$ref": "#/components/schemas/PatchPart"
  9980. },
  9981. {
  9982. "$ref": "#/components/schemas/AgentPart"
  9983. },
  9984. {
  9985. "$ref": "#/components/schemas/RetryPart"
  9986. },
  9987. {
  9988. "$ref": "#/components/schemas/CompactionPart"
  9989. }
  9990. ]
  9991. },
  9992. "Event.message.part.updated": {
  9993. "type": "object",
  9994. "properties": {
  9995. "type": {
  9996. "type": "string",
  9997. "const": "message.part.updated"
  9998. },
  9999. "properties": {
  10000. "type": "object",
  10001. "properties": {
  10002. "sessionID": {
  10003. "type": "string",
  10004. "pattern": "^ses.*"
  10005. },
  10006. "part": {
  10007. "$ref": "#/components/schemas/Part"
  10008. },
  10009. "time": {
  10010. "type": "number"
  10011. }
  10012. },
  10013. "required": ["sessionID", "part", "time"]
  10014. }
  10015. },
  10016. "required": ["type", "properties"]
  10017. },
  10018. "Event.message.part.removed": {
  10019. "type": "object",
  10020. "properties": {
  10021. "type": {
  10022. "type": "string",
  10023. "const": "message.part.removed"
  10024. },
  10025. "properties": {
  10026. "type": "object",
  10027. "properties": {
  10028. "sessionID": {
  10029. "type": "string",
  10030. "pattern": "^ses.*"
  10031. },
  10032. "messageID": {
  10033. "type": "string",
  10034. "pattern": "^msg.*"
  10035. },
  10036. "partID": {
  10037. "type": "string",
  10038. "pattern": "^prt.*"
  10039. }
  10040. },
  10041. "required": ["sessionID", "messageID", "partID"]
  10042. }
  10043. },
  10044. "required": ["type", "properties"]
  10045. },
  10046. "PermissionAction": {
  10047. "type": "string",
  10048. "enum": ["allow", "deny", "ask"]
  10049. },
  10050. "PermissionRule": {
  10051. "type": "object",
  10052. "properties": {
  10053. "permission": {
  10054. "type": "string"
  10055. },
  10056. "pattern": {
  10057. "type": "string"
  10058. },
  10059. "action": {
  10060. "$ref": "#/components/schemas/PermissionAction"
  10061. }
  10062. },
  10063. "required": ["permission", "pattern", "action"]
  10064. },
  10065. "PermissionRuleset": {
  10066. "type": "array",
  10067. "items": {
  10068. "$ref": "#/components/schemas/PermissionRule"
  10069. }
  10070. },
  10071. "Session": {
  10072. "type": "object",
  10073. "properties": {
  10074. "id": {
  10075. "type": "string",
  10076. "pattern": "^ses.*"
  10077. },
  10078. "slug": {
  10079. "type": "string"
  10080. },
  10081. "projectID": {
  10082. "type": "string"
  10083. },
  10084. "workspaceID": {
  10085. "type": "string",
  10086. "pattern": "^wrk.*"
  10087. },
  10088. "directory": {
  10089. "type": "string"
  10090. },
  10091. "parentID": {
  10092. "type": "string",
  10093. "pattern": "^ses.*"
  10094. },
  10095. "summary": {
  10096. "type": "object",
  10097. "properties": {
  10098. "additions": {
  10099. "type": "number"
  10100. },
  10101. "deletions": {
  10102. "type": "number"
  10103. },
  10104. "files": {
  10105. "type": "number"
  10106. },
  10107. "diffs": {
  10108. "type": "array",
  10109. "items": {
  10110. "$ref": "#/components/schemas/SnapshotFileDiff"
  10111. }
  10112. }
  10113. },
  10114. "required": ["additions", "deletions", "files"]
  10115. },
  10116. "share": {
  10117. "type": "object",
  10118. "properties": {
  10119. "url": {
  10120. "type": "string"
  10121. }
  10122. },
  10123. "required": ["url"]
  10124. },
  10125. "title": {
  10126. "type": "string"
  10127. },
  10128. "version": {
  10129. "type": "string"
  10130. },
  10131. "time": {
  10132. "type": "object",
  10133. "properties": {
  10134. "created": {
  10135. "type": "number"
  10136. },
  10137. "updated": {
  10138. "type": "number"
  10139. },
  10140. "compacting": {
  10141. "type": "number"
  10142. },
  10143. "archived": {
  10144. "type": "number"
  10145. }
  10146. },
  10147. "required": ["created", "updated"]
  10148. },
  10149. "permission": {
  10150. "$ref": "#/components/schemas/PermissionRuleset"
  10151. },
  10152. "revert": {
  10153. "type": "object",
  10154. "properties": {
  10155. "messageID": {
  10156. "type": "string",
  10157. "pattern": "^msg.*"
  10158. },
  10159. "partID": {
  10160. "type": "string",
  10161. "pattern": "^prt.*"
  10162. },
  10163. "snapshot": {
  10164. "type": "string"
  10165. },
  10166. "diff": {
  10167. "type": "string"
  10168. }
  10169. },
  10170. "required": ["messageID"]
  10171. }
  10172. },
  10173. "required": ["id", "slug", "projectID", "directory", "title", "version", "time"]
  10174. },
  10175. "Event.session.created": {
  10176. "type": "object",
  10177. "properties": {
  10178. "type": {
  10179. "type": "string",
  10180. "const": "session.created"
  10181. },
  10182. "properties": {
  10183. "type": "object",
  10184. "properties": {
  10185. "sessionID": {
  10186. "type": "string",
  10187. "pattern": "^ses.*"
  10188. },
  10189. "info": {
  10190. "$ref": "#/components/schemas/Session"
  10191. }
  10192. },
  10193. "required": ["sessionID", "info"]
  10194. }
  10195. },
  10196. "required": ["type", "properties"]
  10197. },
  10198. "Event.session.updated": {
  10199. "type": "object",
  10200. "properties": {
  10201. "type": {
  10202. "type": "string",
  10203. "const": "session.updated"
  10204. },
  10205. "properties": {
  10206. "type": "object",
  10207. "properties": {
  10208. "sessionID": {
  10209. "type": "string",
  10210. "pattern": "^ses.*"
  10211. },
  10212. "info": {
  10213. "$ref": "#/components/schemas/Session"
  10214. }
  10215. },
  10216. "required": ["sessionID", "info"]
  10217. }
  10218. },
  10219. "required": ["type", "properties"]
  10220. },
  10221. "Event.session.deleted": {
  10222. "type": "object",
  10223. "properties": {
  10224. "type": {
  10225. "type": "string",
  10226. "const": "session.deleted"
  10227. },
  10228. "properties": {
  10229. "type": "object",
  10230. "properties": {
  10231. "sessionID": {
  10232. "type": "string",
  10233. "pattern": "^ses.*"
  10234. },
  10235. "info": {
  10236. "$ref": "#/components/schemas/Session"
  10237. }
  10238. },
  10239. "required": ["sessionID", "info"]
  10240. }
  10241. },
  10242. "required": ["type", "properties"]
  10243. },
  10244. "SyncEvent.message.updated": {
  10245. "type": "object",
  10246. "properties": {
  10247. "type": {
  10248. "type": "string",
  10249. "const": "sync"
  10250. },
  10251. "name": {
  10252. "type": "string",
  10253. "const": "message.updated.1"
  10254. },
  10255. "id": {
  10256. "type": "string"
  10257. },
  10258. "seq": {
  10259. "type": "number"
  10260. },
  10261. "aggregateID": {
  10262. "type": "string",
  10263. "const": "sessionID"
  10264. },
  10265. "data": {
  10266. "type": "object",
  10267. "properties": {
  10268. "sessionID": {
  10269. "type": "string",
  10270. "pattern": "^ses.*"
  10271. },
  10272. "info": {
  10273. "$ref": "#/components/schemas/Message"
  10274. }
  10275. },
  10276. "required": ["sessionID", "info"]
  10277. }
  10278. },
  10279. "required": ["type", "name", "id", "seq", "aggregateID", "data"]
  10280. },
  10281. "SyncEvent.message.removed": {
  10282. "type": "object",
  10283. "properties": {
  10284. "type": {
  10285. "type": "string",
  10286. "const": "sync"
  10287. },
  10288. "name": {
  10289. "type": "string",
  10290. "const": "message.removed.1"
  10291. },
  10292. "id": {
  10293. "type": "string"
  10294. },
  10295. "seq": {
  10296. "type": "number"
  10297. },
  10298. "aggregateID": {
  10299. "type": "string",
  10300. "const": "sessionID"
  10301. },
  10302. "data": {
  10303. "type": "object",
  10304. "properties": {
  10305. "sessionID": {
  10306. "type": "string",
  10307. "pattern": "^ses.*"
  10308. },
  10309. "messageID": {
  10310. "type": "string",
  10311. "pattern": "^msg.*"
  10312. }
  10313. },
  10314. "required": ["sessionID", "messageID"]
  10315. }
  10316. },
  10317. "required": ["type", "name", "id", "seq", "aggregateID", "data"]
  10318. },
  10319. "SyncEvent.message.part.updated": {
  10320. "type": "object",
  10321. "properties": {
  10322. "type": {
  10323. "type": "string",
  10324. "const": "sync"
  10325. },
  10326. "name": {
  10327. "type": "string",
  10328. "const": "message.part.updated.1"
  10329. },
  10330. "id": {
  10331. "type": "string"
  10332. },
  10333. "seq": {
  10334. "type": "number"
  10335. },
  10336. "aggregateID": {
  10337. "type": "string",
  10338. "const": "sessionID"
  10339. },
  10340. "data": {
  10341. "type": "object",
  10342. "properties": {
  10343. "sessionID": {
  10344. "type": "string",
  10345. "pattern": "^ses.*"
  10346. },
  10347. "part": {
  10348. "$ref": "#/components/schemas/Part"
  10349. },
  10350. "time": {
  10351. "type": "number"
  10352. }
  10353. },
  10354. "required": ["sessionID", "part", "time"]
  10355. }
  10356. },
  10357. "required": ["type", "name", "id", "seq", "aggregateID", "data"]
  10358. },
  10359. "SyncEvent.message.part.removed": {
  10360. "type": "object",
  10361. "properties": {
  10362. "type": {
  10363. "type": "string",
  10364. "const": "sync"
  10365. },
  10366. "name": {
  10367. "type": "string",
  10368. "const": "message.part.removed.1"
  10369. },
  10370. "id": {
  10371. "type": "string"
  10372. },
  10373. "seq": {
  10374. "type": "number"
  10375. },
  10376. "aggregateID": {
  10377. "type": "string",
  10378. "const": "sessionID"
  10379. },
  10380. "data": {
  10381. "type": "object",
  10382. "properties": {
  10383. "sessionID": {
  10384. "type": "string",
  10385. "pattern": "^ses.*"
  10386. },
  10387. "messageID": {
  10388. "type": "string",
  10389. "pattern": "^msg.*"
  10390. },
  10391. "partID": {
  10392. "type": "string",
  10393. "pattern": "^prt.*"
  10394. }
  10395. },
  10396. "required": ["sessionID", "messageID", "partID"]
  10397. }
  10398. },
  10399. "required": ["type", "name", "id", "seq", "aggregateID", "data"]
  10400. },
  10401. "SyncEvent.session.created": {
  10402. "type": "object",
  10403. "properties": {
  10404. "type": {
  10405. "type": "string",
  10406. "const": "sync"
  10407. },
  10408. "name": {
  10409. "type": "string",
  10410. "const": "session.created.1"
  10411. },
  10412. "id": {
  10413. "type": "string"
  10414. },
  10415. "seq": {
  10416. "type": "number"
  10417. },
  10418. "aggregateID": {
  10419. "type": "string",
  10420. "const": "sessionID"
  10421. },
  10422. "data": {
  10423. "type": "object",
  10424. "properties": {
  10425. "sessionID": {
  10426. "type": "string",
  10427. "pattern": "^ses.*"
  10428. },
  10429. "info": {
  10430. "$ref": "#/components/schemas/Session"
  10431. }
  10432. },
  10433. "required": ["sessionID", "info"]
  10434. }
  10435. },
  10436. "required": ["type", "name", "id", "seq", "aggregateID", "data"]
  10437. },
  10438. "SyncEvent.session.updated": {
  10439. "type": "object",
  10440. "properties": {
  10441. "type": {
  10442. "type": "string",
  10443. "const": "sync"
  10444. },
  10445. "name": {
  10446. "type": "string",
  10447. "const": "session.updated.1"
  10448. },
  10449. "id": {
  10450. "type": "string"
  10451. },
  10452. "seq": {
  10453. "type": "number"
  10454. },
  10455. "aggregateID": {
  10456. "type": "string",
  10457. "const": "sessionID"
  10458. },
  10459. "data": {
  10460. "type": "object",
  10461. "properties": {
  10462. "sessionID": {
  10463. "type": "string",
  10464. "pattern": "^ses.*"
  10465. },
  10466. "info": {
  10467. "type": "object",
  10468. "properties": {
  10469. "id": {
  10470. "anyOf": [
  10471. {
  10472. "type": "string",
  10473. "pattern": "^ses.*"
  10474. },
  10475. {
  10476. "type": "null"
  10477. }
  10478. ]
  10479. },
  10480. "slug": {
  10481. "anyOf": [
  10482. {
  10483. "type": "string"
  10484. },
  10485. {
  10486. "type": "null"
  10487. }
  10488. ]
  10489. },
  10490. "projectID": {
  10491. "anyOf": [
  10492. {
  10493. "type": "string"
  10494. },
  10495. {
  10496. "type": "null"
  10497. }
  10498. ]
  10499. },
  10500. "workspaceID": {
  10501. "anyOf": [
  10502. {
  10503. "type": "string",
  10504. "pattern": "^wrk.*"
  10505. },
  10506. {
  10507. "type": "null"
  10508. }
  10509. ]
  10510. },
  10511. "directory": {
  10512. "anyOf": [
  10513. {
  10514. "type": "string"
  10515. },
  10516. {
  10517. "type": "null"
  10518. }
  10519. ]
  10520. },
  10521. "parentID": {
  10522. "anyOf": [
  10523. {
  10524. "type": "string",
  10525. "pattern": "^ses.*"
  10526. },
  10527. {
  10528. "type": "null"
  10529. }
  10530. ]
  10531. },
  10532. "summary": {
  10533. "anyOf": [
  10534. {
  10535. "type": "object",
  10536. "properties": {
  10537. "additions": {
  10538. "type": "number"
  10539. },
  10540. "deletions": {
  10541. "type": "number"
  10542. },
  10543. "files": {
  10544. "type": "number"
  10545. },
  10546. "diffs": {
  10547. "type": "array",
  10548. "items": {
  10549. "$ref": "#/components/schemas/SnapshotFileDiff"
  10550. }
  10551. }
  10552. },
  10553. "required": ["additions", "deletions", "files"]
  10554. },
  10555. {
  10556. "type": "null"
  10557. }
  10558. ]
  10559. },
  10560. "share": {
  10561. "type": "object",
  10562. "properties": {
  10563. "url": {
  10564. "anyOf": [
  10565. {
  10566. "type": "string"
  10567. },
  10568. {
  10569. "type": "null"
  10570. }
  10571. ]
  10572. }
  10573. },
  10574. "required": ["url"]
  10575. },
  10576. "title": {
  10577. "anyOf": [
  10578. {
  10579. "type": "string"
  10580. },
  10581. {
  10582. "type": "null"
  10583. }
  10584. ]
  10585. },
  10586. "version": {
  10587. "anyOf": [
  10588. {
  10589. "type": "string"
  10590. },
  10591. {
  10592. "type": "null"
  10593. }
  10594. ]
  10595. },
  10596. "time": {
  10597. "type": "object",
  10598. "properties": {
  10599. "created": {
  10600. "anyOf": [
  10601. {
  10602. "type": "number"
  10603. },
  10604. {
  10605. "type": "null"
  10606. }
  10607. ]
  10608. },
  10609. "updated": {
  10610. "anyOf": [
  10611. {
  10612. "type": "number"
  10613. },
  10614. {
  10615. "type": "null"
  10616. }
  10617. ]
  10618. },
  10619. "compacting": {
  10620. "anyOf": [
  10621. {
  10622. "type": "number"
  10623. },
  10624. {
  10625. "type": "null"
  10626. }
  10627. ]
  10628. },
  10629. "archived": {
  10630. "anyOf": [
  10631. {
  10632. "type": "number"
  10633. },
  10634. {
  10635. "type": "null"
  10636. }
  10637. ]
  10638. }
  10639. },
  10640. "required": ["created", "updated", "compacting", "archived"]
  10641. },
  10642. "permission": {
  10643. "anyOf": [
  10644. {
  10645. "$ref": "#/components/schemas/PermissionRuleset"
  10646. },
  10647. {
  10648. "type": "null"
  10649. }
  10650. ]
  10651. },
  10652. "revert": {
  10653. "anyOf": [
  10654. {
  10655. "type": "object",
  10656. "properties": {
  10657. "messageID": {
  10658. "type": "string",
  10659. "pattern": "^msg.*"
  10660. },
  10661. "partID": {
  10662. "type": "string",
  10663. "pattern": "^prt.*"
  10664. },
  10665. "snapshot": {
  10666. "type": "string"
  10667. },
  10668. "diff": {
  10669. "type": "string"
  10670. }
  10671. },
  10672. "required": ["messageID"]
  10673. },
  10674. {
  10675. "type": "null"
  10676. }
  10677. ]
  10678. }
  10679. },
  10680. "required": [
  10681. "id",
  10682. "slug",
  10683. "projectID",
  10684. "workspaceID",
  10685. "directory",
  10686. "parentID",
  10687. "summary",
  10688. "title",
  10689. "version",
  10690. "permission",
  10691. "revert"
  10692. ]
  10693. }
  10694. },
  10695. "required": ["sessionID", "info"]
  10696. }
  10697. },
  10698. "required": ["type", "name", "id", "seq", "aggregateID", "data"]
  10699. },
  10700. "SyncEvent.session.deleted": {
  10701. "type": "object",
  10702. "properties": {
  10703. "type": {
  10704. "type": "string",
  10705. "const": "sync"
  10706. },
  10707. "name": {
  10708. "type": "string",
  10709. "const": "session.deleted.1"
  10710. },
  10711. "id": {
  10712. "type": "string"
  10713. },
  10714. "seq": {
  10715. "type": "number"
  10716. },
  10717. "aggregateID": {
  10718. "type": "string",
  10719. "const": "sessionID"
  10720. },
  10721. "data": {
  10722. "type": "object",
  10723. "properties": {
  10724. "sessionID": {
  10725. "type": "string",
  10726. "pattern": "^ses.*"
  10727. },
  10728. "info": {
  10729. "$ref": "#/components/schemas/Session"
  10730. }
  10731. },
  10732. "required": ["sessionID", "info"]
  10733. }
  10734. },
  10735. "required": ["type", "name", "id", "seq", "aggregateID", "data"]
  10736. },
  10737. "GlobalEvent": {
  10738. "type": "object",
  10739. "properties": {
  10740. "directory": {
  10741. "type": "string"
  10742. },
  10743. "project": {
  10744. "type": "string"
  10745. },
  10746. "workspace": {
  10747. "type": "string"
  10748. },
  10749. "payload": {
  10750. "anyOf": [
  10751. {
  10752. "$ref": "#/components/schemas/Event.project.updated"
  10753. },
  10754. {
  10755. "$ref": "#/components/schemas/Event.server.instance.disposed"
  10756. },
  10757. {
  10758. "$ref": "#/components/schemas/Event.server.connected"
  10759. },
  10760. {
  10761. "$ref": "#/components/schemas/Event.global.disposed"
  10762. },
  10763. {
  10764. "$ref": "#/components/schemas/Event.file.edited"
  10765. },
  10766. {
  10767. "$ref": "#/components/schemas/Event.file.watcher.updated"
  10768. },
  10769. {
  10770. "$ref": "#/components/schemas/Event.lsp.client.diagnostics"
  10771. },
  10772. {
  10773. "$ref": "#/components/schemas/Event.lsp.updated"
  10774. },
  10775. {
  10776. "$ref": "#/components/schemas/Event.installation.updated"
  10777. },
  10778. {
  10779. "$ref": "#/components/schemas/Event.installation.update-available"
  10780. },
  10781. {
  10782. "$ref": "#/components/schemas/Event.message.part.delta"
  10783. },
  10784. {
  10785. "$ref": "#/components/schemas/Event.permission.asked"
  10786. },
  10787. {
  10788. "$ref": "#/components/schemas/Event.permission.replied"
  10789. },
  10790. {
  10791. "$ref": "#/components/schemas/Event.session.diff"
  10792. },
  10793. {
  10794. "$ref": "#/components/schemas/Event.session.error"
  10795. },
  10796. {
  10797. "$ref": "#/components/schemas/Event.question.asked"
  10798. },
  10799. {
  10800. "$ref": "#/components/schemas/Event.question.replied"
  10801. },
  10802. {
  10803. "$ref": "#/components/schemas/Event.question.rejected"
  10804. },
  10805. {
  10806. "$ref": "#/components/schemas/Event.todo.updated"
  10807. },
  10808. {
  10809. "$ref": "#/components/schemas/Event.session.status"
  10810. },
  10811. {
  10812. "$ref": "#/components/schemas/Event.session.idle"
  10813. },
  10814. {
  10815. "$ref": "#/components/schemas/Event.session.compacted"
  10816. },
  10817. {
  10818. "$ref": "#/components/schemas/Event.tui.prompt.append"
  10819. },
  10820. {
  10821. "$ref": "#/components/schemas/Event.tui.command.execute"
  10822. },
  10823. {
  10824. "$ref": "#/components/schemas/Event.tui.toast.show"
  10825. },
  10826. {
  10827. "$ref": "#/components/schemas/Event.tui.session.select"
  10828. },
  10829. {
  10830. "$ref": "#/components/schemas/Event.mcp.tools.changed"
  10831. },
  10832. {
  10833. "$ref": "#/components/schemas/Event.mcp.browser.open.failed"
  10834. },
  10835. {
  10836. "$ref": "#/components/schemas/Event.command.executed"
  10837. },
  10838. {
  10839. "$ref": "#/components/schemas/Event.vcs.branch.updated"
  10840. },
  10841. {
  10842. "$ref": "#/components/schemas/Event.worktree.ready"
  10843. },
  10844. {
  10845. "$ref": "#/components/schemas/Event.worktree.failed"
  10846. },
  10847. {
  10848. "$ref": "#/components/schemas/Event.pty.created"
  10849. },
  10850. {
  10851. "$ref": "#/components/schemas/Event.pty.updated"
  10852. },
  10853. {
  10854. "$ref": "#/components/schemas/Event.pty.exited"
  10855. },
  10856. {
  10857. "$ref": "#/components/schemas/Event.pty.deleted"
  10858. },
  10859. {
  10860. "$ref": "#/components/schemas/Event.workspace.ready"
  10861. },
  10862. {
  10863. "$ref": "#/components/schemas/Event.workspace.failed"
  10864. },
  10865. {
  10866. "$ref": "#/components/schemas/Event.workspace.restore"
  10867. },
  10868. {
  10869. "$ref": "#/components/schemas/Event.workspace.status"
  10870. },
  10871. {
  10872. "$ref": "#/components/schemas/Event.message.updated"
  10873. },
  10874. {
  10875. "$ref": "#/components/schemas/Event.message.removed"
  10876. },
  10877. {
  10878. "$ref": "#/components/schemas/Event.message.part.updated"
  10879. },
  10880. {
  10881. "$ref": "#/components/schemas/Event.message.part.removed"
  10882. },
  10883. {
  10884. "$ref": "#/components/schemas/Event.session.created"
  10885. },
  10886. {
  10887. "$ref": "#/components/schemas/Event.session.updated"
  10888. },
  10889. {
  10890. "$ref": "#/components/schemas/Event.session.deleted"
  10891. },
  10892. {
  10893. "$ref": "#/components/schemas/SyncEvent.message.updated"
  10894. },
  10895. {
  10896. "$ref": "#/components/schemas/SyncEvent.message.removed"
  10897. },
  10898. {
  10899. "$ref": "#/components/schemas/SyncEvent.message.part.updated"
  10900. },
  10901. {
  10902. "$ref": "#/components/schemas/SyncEvent.message.part.removed"
  10903. },
  10904. {
  10905. "$ref": "#/components/schemas/SyncEvent.session.created"
  10906. },
  10907. {
  10908. "$ref": "#/components/schemas/SyncEvent.session.updated"
  10909. },
  10910. {
  10911. "$ref": "#/components/schemas/SyncEvent.session.deleted"
  10912. }
  10913. ]
  10914. }
  10915. },
  10916. "required": ["directory", "payload"]
  10917. },
  10918. "LogLevel": {
  10919. "description": "Log level",
  10920. "type": "string",
  10921. "enum": ["DEBUG", "INFO", "WARN", "ERROR"]
  10922. },
  10923. "ServerConfig": {
  10924. "description": "Server configuration for opencode serve and web commands",
  10925. "type": "object",
  10926. "properties": {
  10927. "port": {
  10928. "description": "Port to listen on",
  10929. "type": "integer",
  10930. "exclusiveMinimum": 0,
  10931. "maximum": 9007199254740991
  10932. },
  10933. "hostname": {
  10934. "description": "Hostname to listen on",
  10935. "type": "string"
  10936. },
  10937. "mdns": {
  10938. "description": "Enable mDNS service discovery",
  10939. "type": "boolean"
  10940. },
  10941. "mdnsDomain": {
  10942. "description": "Custom domain name for mDNS service (default: opencode.local)",
  10943. "type": "string"
  10944. },
  10945. "cors": {
  10946. "description": "Additional domains to allow for CORS",
  10947. "type": "array",
  10948. "items": {
  10949. "type": "string"
  10950. }
  10951. }
  10952. }
  10953. },
  10954. "PermissionActionConfig": {
  10955. "type": "string",
  10956. "enum": ["ask", "allow", "deny"]
  10957. },
  10958. "PermissionObjectConfig": {
  10959. "type": "object",
  10960. "propertyNames": {
  10961. "type": "string"
  10962. },
  10963. "additionalProperties": {
  10964. "$ref": "#/components/schemas/PermissionActionConfig"
  10965. }
  10966. },
  10967. "PermissionRuleConfig": {
  10968. "anyOf": [
  10969. {
  10970. "$ref": "#/components/schemas/PermissionActionConfig"
  10971. },
  10972. {
  10973. "$ref": "#/components/schemas/PermissionObjectConfig"
  10974. }
  10975. ]
  10976. },
  10977. "PermissionConfig": {
  10978. "anyOf": [
  10979. {
  10980. "type": "object",
  10981. "properties": {
  10982. "__originalKeys": {
  10983. "type": "array",
  10984. "items": {
  10985. "type": "string"
  10986. }
  10987. },
  10988. "read": {
  10989. "$ref": "#/components/schemas/PermissionRuleConfig"
  10990. },
  10991. "edit": {
  10992. "$ref": "#/components/schemas/PermissionRuleConfig"
  10993. },
  10994. "glob": {
  10995. "$ref": "#/components/schemas/PermissionRuleConfig"
  10996. },
  10997. "grep": {
  10998. "$ref": "#/components/schemas/PermissionRuleConfig"
  10999. },
  11000. "list": {
  11001. "$ref": "#/components/schemas/PermissionRuleConfig"
  11002. },
  11003. "bash": {
  11004. "$ref": "#/components/schemas/PermissionRuleConfig"
  11005. },
  11006. "task": {
  11007. "$ref": "#/components/schemas/PermissionRuleConfig"
  11008. },
  11009. "external_directory": {
  11010. "$ref": "#/components/schemas/PermissionRuleConfig"
  11011. },
  11012. "todowrite": {
  11013. "$ref": "#/components/schemas/PermissionActionConfig"
  11014. },
  11015. "question": {
  11016. "$ref": "#/components/schemas/PermissionActionConfig"
  11017. },
  11018. "webfetch": {
  11019. "$ref": "#/components/schemas/PermissionActionConfig"
  11020. },
  11021. "websearch": {
  11022. "$ref": "#/components/schemas/PermissionActionConfig"
  11023. },
  11024. "codesearch": {
  11025. "$ref": "#/components/schemas/PermissionActionConfig"
  11026. },
  11027. "lsp": {
  11028. "$ref": "#/components/schemas/PermissionRuleConfig"
  11029. },
  11030. "doom_loop": {
  11031. "$ref": "#/components/schemas/PermissionActionConfig"
  11032. },
  11033. "skill": {
  11034. "$ref": "#/components/schemas/PermissionRuleConfig"
  11035. }
  11036. },
  11037. "additionalProperties": {
  11038. "$ref": "#/components/schemas/PermissionRuleConfig"
  11039. }
  11040. },
  11041. {
  11042. "$ref": "#/components/schemas/PermissionActionConfig"
  11043. }
  11044. ]
  11045. },
  11046. "AgentConfig": {
  11047. "type": "object",
  11048. "properties": {
  11049. "model": {
  11050. "type": "string"
  11051. },
  11052. "variant": {
  11053. "description": "Default model variant for this agent (applies only when using the agent's configured model).",
  11054. "type": "string"
  11055. },
  11056. "temperature": {
  11057. "type": "number"
  11058. },
  11059. "top_p": {
  11060. "type": "number"
  11061. },
  11062. "prompt": {
  11063. "type": "string"
  11064. },
  11065. "tools": {
  11066. "description": "@deprecated Use 'permission' field instead",
  11067. "type": "object",
  11068. "propertyNames": {
  11069. "type": "string"
  11070. },
  11071. "additionalProperties": {
  11072. "type": "boolean"
  11073. }
  11074. },
  11075. "disable": {
  11076. "type": "boolean"
  11077. },
  11078. "description": {
  11079. "description": "Description of when to use the agent",
  11080. "type": "string"
  11081. },
  11082. "mode": {
  11083. "type": "string",
  11084. "enum": ["subagent", "primary", "all"]
  11085. },
  11086. "hidden": {
  11087. "description": "Hide this subagent from the @ autocomplete menu (default: false, only applies to mode: subagent)",
  11088. "type": "boolean"
  11089. },
  11090. "options": {
  11091. "type": "object",
  11092. "propertyNames": {
  11093. "type": "string"
  11094. },
  11095. "additionalProperties": {}
  11096. },
  11097. "color": {
  11098. "description": "Hex color code (e.g., #FF5733) or theme color (e.g., primary)",
  11099. "anyOf": [
  11100. {
  11101. "type": "string",
  11102. "pattern": "^#[0-9a-fA-F]{6}$"
  11103. },
  11104. {
  11105. "type": "string",
  11106. "enum": ["primary", "secondary", "accent", "success", "warning", "error", "info"]
  11107. }
  11108. ]
  11109. },
  11110. "steps": {
  11111. "description": "Maximum number of agentic iterations before forcing text-only response",
  11112. "type": "integer",
  11113. "exclusiveMinimum": 0,
  11114. "maximum": 9007199254740991
  11115. },
  11116. "maxSteps": {
  11117. "description": "@deprecated Use 'steps' field instead.",
  11118. "type": "integer",
  11119. "exclusiveMinimum": 0,
  11120. "maximum": 9007199254740991
  11121. },
  11122. "permission": {
  11123. "$ref": "#/components/schemas/PermissionConfig"
  11124. }
  11125. },
  11126. "additionalProperties": {}
  11127. },
  11128. "ProviderConfig": {
  11129. "type": "object",
  11130. "properties": {
  11131. "api": {
  11132. "type": "string"
  11133. },
  11134. "name": {
  11135. "type": "string"
  11136. },
  11137. "env": {
  11138. "type": "array",
  11139. "items": {
  11140. "type": "string"
  11141. }
  11142. },
  11143. "id": {
  11144. "type": "string"
  11145. },
  11146. "npm": {
  11147. "type": "string"
  11148. },
  11149. "whitelist": {
  11150. "type": "array",
  11151. "items": {
  11152. "type": "string"
  11153. }
  11154. },
  11155. "blacklist": {
  11156. "type": "array",
  11157. "items": {
  11158. "type": "string"
  11159. }
  11160. },
  11161. "options": {
  11162. "type": "object",
  11163. "properties": {
  11164. "apiKey": {
  11165. "type": "string"
  11166. },
  11167. "baseURL": {
  11168. "type": "string"
  11169. },
  11170. "enterpriseUrl": {
  11171. "description": "GitHub Enterprise URL for copilot authentication",
  11172. "type": "string"
  11173. },
  11174. "setCacheKey": {
  11175. "description": "Enable promptCacheKey for this provider (default false)",
  11176. "type": "boolean"
  11177. },
  11178. "timeout": {
  11179. "description": "Timeout in milliseconds for requests to this provider. Default is 300000 (5 minutes). Set to false to disable timeout.",
  11180. "anyOf": [
  11181. {
  11182. "type": "integer",
  11183. "exclusiveMinimum": 0,
  11184. "maximum": 9007199254740991
  11185. },
  11186. {
  11187. "type": "boolean",
  11188. "const": false
  11189. }
  11190. ]
  11191. },
  11192. "chunkTimeout": {
  11193. "description": "Timeout in milliseconds between streamed SSE chunks for this provider. If no chunk arrives within this window, the request is aborted.",
  11194. "type": "integer",
  11195. "exclusiveMinimum": 0,
  11196. "maximum": 9007199254740991
  11197. }
  11198. },
  11199. "additionalProperties": {}
  11200. },
  11201. "models": {
  11202. "type": "object",
  11203. "propertyNames": {
  11204. "type": "string"
  11205. },
  11206. "additionalProperties": {
  11207. "type": "object",
  11208. "properties": {
  11209. "id": {
  11210. "type": "string"
  11211. },
  11212. "name": {
  11213. "type": "string"
  11214. },
  11215. "family": {
  11216. "type": "string"
  11217. },
  11218. "release_date": {
  11219. "type": "string"
  11220. },
  11221. "attachment": {
  11222. "type": "boolean"
  11223. },
  11224. "reasoning": {
  11225. "type": "boolean"
  11226. },
  11227. "temperature": {
  11228. "type": "boolean"
  11229. },
  11230. "tool_call": {
  11231. "type": "boolean"
  11232. },
  11233. "interleaved": {
  11234. "anyOf": [
  11235. {
  11236. "type": "boolean",
  11237. "const": true
  11238. },
  11239. {
  11240. "type": "object",
  11241. "properties": {
  11242. "field": {
  11243. "type": "string",
  11244. "enum": ["reasoning_content", "reasoning_details"]
  11245. }
  11246. },
  11247. "required": ["field"]
  11248. }
  11249. ]
  11250. },
  11251. "cost": {
  11252. "type": "object",
  11253. "properties": {
  11254. "input": {
  11255. "type": "number"
  11256. },
  11257. "output": {
  11258. "type": "number"
  11259. },
  11260. "cache_read": {
  11261. "type": "number"
  11262. },
  11263. "cache_write": {
  11264. "type": "number"
  11265. },
  11266. "context_over_200k": {
  11267. "type": "object",
  11268. "properties": {
  11269. "input": {
  11270. "type": "number"
  11271. },
  11272. "output": {
  11273. "type": "number"
  11274. },
  11275. "cache_read": {
  11276. "type": "number"
  11277. },
  11278. "cache_write": {
  11279. "type": "number"
  11280. }
  11281. },
  11282. "required": ["input", "output"]
  11283. }
  11284. },
  11285. "required": ["input", "output"]
  11286. },
  11287. "limit": {
  11288. "type": "object",
  11289. "properties": {
  11290. "context": {
  11291. "type": "number"
  11292. },
  11293. "input": {
  11294. "type": "number"
  11295. },
  11296. "output": {
  11297. "type": "number"
  11298. }
  11299. },
  11300. "required": ["context", "output"]
  11301. },
  11302. "modalities": {
  11303. "type": "object",
  11304. "properties": {
  11305. "input": {
  11306. "type": "array",
  11307. "items": {
  11308. "type": "string",
  11309. "enum": ["text", "audio", "image", "video", "pdf"]
  11310. }
  11311. },
  11312. "output": {
  11313. "type": "array",
  11314. "items": {
  11315. "type": "string",
  11316. "enum": ["text", "audio", "image", "video", "pdf"]
  11317. }
  11318. }
  11319. },
  11320. "required": ["input", "output"]
  11321. },
  11322. "experimental": {
  11323. "type": "boolean"
  11324. },
  11325. "status": {
  11326. "type": "string",
  11327. "enum": ["alpha", "beta", "deprecated"]
  11328. },
  11329. "provider": {
  11330. "type": "object",
  11331. "properties": {
  11332. "npm": {
  11333. "type": "string"
  11334. },
  11335. "api": {
  11336. "type": "string"
  11337. }
  11338. }
  11339. },
  11340. "options": {
  11341. "type": "object",
  11342. "propertyNames": {
  11343. "type": "string"
  11344. },
  11345. "additionalProperties": {}
  11346. },
  11347. "headers": {
  11348. "type": "object",
  11349. "propertyNames": {
  11350. "type": "string"
  11351. },
  11352. "additionalProperties": {
  11353. "type": "string"
  11354. }
  11355. },
  11356. "variants": {
  11357. "description": "Variant-specific configuration",
  11358. "type": "object",
  11359. "propertyNames": {
  11360. "type": "string"
  11361. },
  11362. "additionalProperties": {
  11363. "type": "object",
  11364. "properties": {
  11365. "disabled": {
  11366. "description": "Disable this variant for the model",
  11367. "type": "boolean"
  11368. }
  11369. },
  11370. "additionalProperties": {}
  11371. }
  11372. }
  11373. }
  11374. }
  11375. }
  11376. }
  11377. },
  11378. "McpLocalConfig": {
  11379. "type": "object",
  11380. "properties": {
  11381. "type": {
  11382. "description": "Type of MCP server connection",
  11383. "type": "string",
  11384. "const": "local"
  11385. },
  11386. "command": {
  11387. "description": "Command and arguments to run the MCP server",
  11388. "type": "array",
  11389. "items": {
  11390. "type": "string"
  11391. }
  11392. },
  11393. "environment": {
  11394. "description": "Environment variables to set when running the MCP server",
  11395. "type": "object",
  11396. "propertyNames": {
  11397. "type": "string"
  11398. },
  11399. "additionalProperties": {
  11400. "type": "string"
  11401. }
  11402. },
  11403. "enabled": {
  11404. "description": "Enable or disable the MCP server on startup",
  11405. "type": "boolean"
  11406. },
  11407. "timeout": {
  11408. "description": "Timeout in ms for MCP server requests. Defaults to 5000 (5 seconds) if not specified.",
  11409. "type": "number"
  11410. }
  11411. },
  11412. "required": ["type", "command"]
  11413. },
  11414. "McpOAuthConfig": {
  11415. "type": "object",
  11416. "properties": {
  11417. "clientId": {
  11418. "description": "OAuth client ID. If not provided, dynamic client registration (RFC 7591) will be attempted.",
  11419. "type": "string"
  11420. },
  11421. "clientSecret": {
  11422. "description": "OAuth client secret (if required by the authorization server)",
  11423. "type": "string"
  11424. },
  11425. "scope": {
  11426. "description": "OAuth scopes to request during authorization",
  11427. "type": "string"
  11428. },
  11429. "redirectUri": {
  11430. "description": "OAuth redirect URI (default: http://127.0.0.1:19876/mcp/oauth/callback).",
  11431. "type": "string"
  11432. }
  11433. }
  11434. },
  11435. "McpRemoteConfig": {
  11436. "type": "object",
  11437. "properties": {
  11438. "type": {
  11439. "description": "Type of MCP server connection",
  11440. "type": "string",
  11441. "const": "remote"
  11442. },
  11443. "url": {
  11444. "description": "URL of the remote MCP server",
  11445. "type": "string"
  11446. },
  11447. "enabled": {
  11448. "description": "Enable or disable the MCP server on startup",
  11449. "type": "boolean"
  11450. },
  11451. "headers": {
  11452. "description": "Headers to send with the request",
  11453. "type": "object",
  11454. "propertyNames": {
  11455. "type": "string"
  11456. },
  11457. "additionalProperties": {
  11458. "type": "string"
  11459. }
  11460. },
  11461. "oauth": {
  11462. "description": "OAuth authentication configuration for the MCP server. Set to false to disable OAuth auto-detection.",
  11463. "anyOf": [
  11464. {
  11465. "$ref": "#/components/schemas/McpOAuthConfig"
  11466. },
  11467. {
  11468. "type": "boolean",
  11469. "const": false
  11470. }
  11471. ]
  11472. },
  11473. "timeout": {
  11474. "description": "Timeout in ms for MCP server requests. Defaults to 5000 (5 seconds) if not specified.",
  11475. "type": "number"
  11476. }
  11477. },
  11478. "required": ["type", "url"]
  11479. },
  11480. "LayoutConfig": {
  11481. "description": "@deprecated Always uses stretch layout.",
  11482. "type": "string",
  11483. "enum": ["auto", "stretch"]
  11484. },
  11485. "Config": {
  11486. "type": "object",
  11487. "properties": {
  11488. "$schema": {
  11489. "description": "JSON schema reference for configuration validation",
  11490. "type": "string"
  11491. },
  11492. "logLevel": {
  11493. "$ref": "#/components/schemas/LogLevel"
  11494. },
  11495. "server": {
  11496. "$ref": "#/components/schemas/ServerConfig"
  11497. },
  11498. "command": {
  11499. "description": "Command configuration, see https://opencode.ai/docs/commands",
  11500. "type": "object",
  11501. "propertyNames": {
  11502. "type": "string"
  11503. },
  11504. "additionalProperties": {
  11505. "type": "object",
  11506. "properties": {
  11507. "template": {
  11508. "type": "string"
  11509. },
  11510. "description": {
  11511. "type": "string"
  11512. },
  11513. "agent": {
  11514. "type": "string"
  11515. },
  11516. "model": {
  11517. "type": "string"
  11518. },
  11519. "subtask": {
  11520. "type": "boolean"
  11521. }
  11522. },
  11523. "required": ["template"]
  11524. }
  11525. },
  11526. "skills": {
  11527. "description": "Additional skill folder paths",
  11528. "type": "object",
  11529. "properties": {
  11530. "paths": {
  11531. "description": "Additional paths to skill folders",
  11532. "type": "array",
  11533. "items": {
  11534. "type": "string"
  11535. }
  11536. },
  11537. "urls": {
  11538. "description": "URLs to fetch skills from (e.g., https://example.com/.well-known/skills/)",
  11539. "type": "array",
  11540. "items": {
  11541. "type": "string"
  11542. }
  11543. }
  11544. }
  11545. },
  11546. "watcher": {
  11547. "type": "object",
  11548. "properties": {
  11549. "ignore": {
  11550. "type": "array",
  11551. "items": {
  11552. "type": "string"
  11553. }
  11554. }
  11555. }
  11556. },
  11557. "snapshot": {
  11558. "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.",
  11559. "type": "boolean"
  11560. },
  11561. "plugin": {
  11562. "type": "array",
  11563. "items": {
  11564. "anyOf": [
  11565. {
  11566. "type": "string"
  11567. },
  11568. {
  11569. "type": "array",
  11570. "prefixItems": [
  11571. {
  11572. "type": "string"
  11573. },
  11574. {
  11575. "type": "object",
  11576. "propertyNames": {
  11577. "type": "string"
  11578. },
  11579. "additionalProperties": {}
  11580. }
  11581. ]
  11582. }
  11583. ]
  11584. }
  11585. },
  11586. "share": {
  11587. "description": "Control sharing behavior:'manual' allows manual sharing via commands, 'auto' enables automatic sharing, 'disabled' disables all sharing",
  11588. "type": "string",
  11589. "enum": ["manual", "auto", "disabled"]
  11590. },
  11591. "autoshare": {
  11592. "description": "@deprecated Use 'share' field instead. Share newly created sessions automatically",
  11593. "type": "boolean"
  11594. },
  11595. "autoupdate": {
  11596. "description": "Automatically update to the latest version. Set to true to auto-update, false to disable, or 'notify' to show update notifications",
  11597. "anyOf": [
  11598. {
  11599. "type": "boolean"
  11600. },
  11601. {
  11602. "type": "string",
  11603. "const": "notify"
  11604. }
  11605. ]
  11606. },
  11607. "disabled_providers": {
  11608. "description": "Disable providers that are loaded automatically",
  11609. "type": "array",
  11610. "items": {
  11611. "type": "string"
  11612. }
  11613. },
  11614. "enabled_providers": {
  11615. "description": "When set, ONLY these providers will be enabled. All other providers will be ignored",
  11616. "type": "array",
  11617. "items": {
  11618. "type": "string"
  11619. }
  11620. },
  11621. "model": {
  11622. "description": "Model to use in the format of provider/model, eg anthropic/claude-2",
  11623. "type": "string"
  11624. },
  11625. "small_model": {
  11626. "description": "Small model to use for tasks like title generation in the format of provider/model",
  11627. "type": "string"
  11628. },
  11629. "default_agent": {
  11630. "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.",
  11631. "type": "string"
  11632. },
  11633. "username": {
  11634. "description": "Custom username to display in conversations instead of system username",
  11635. "type": "string"
  11636. },
  11637. "mode": {
  11638. "description": "@deprecated Use `agent` field instead.",
  11639. "type": "object",
  11640. "properties": {
  11641. "build": {
  11642. "$ref": "#/components/schemas/AgentConfig"
  11643. },
  11644. "plan": {
  11645. "$ref": "#/components/schemas/AgentConfig"
  11646. }
  11647. },
  11648. "additionalProperties": {
  11649. "$ref": "#/components/schemas/AgentConfig"
  11650. }
  11651. },
  11652. "agent": {
  11653. "description": "Agent configuration, see https://opencode.ai/docs/agents",
  11654. "type": "object",
  11655. "properties": {
  11656. "plan": {
  11657. "$ref": "#/components/schemas/AgentConfig"
  11658. },
  11659. "build": {
  11660. "$ref": "#/components/schemas/AgentConfig"
  11661. },
  11662. "general": {
  11663. "$ref": "#/components/schemas/AgentConfig"
  11664. },
  11665. "explore": {
  11666. "$ref": "#/components/schemas/AgentConfig"
  11667. },
  11668. "title": {
  11669. "$ref": "#/components/schemas/AgentConfig"
  11670. },
  11671. "summary": {
  11672. "$ref": "#/components/schemas/AgentConfig"
  11673. },
  11674. "compaction": {
  11675. "$ref": "#/components/schemas/AgentConfig"
  11676. }
  11677. },
  11678. "additionalProperties": {
  11679. "$ref": "#/components/schemas/AgentConfig"
  11680. }
  11681. },
  11682. "provider": {
  11683. "description": "Custom provider configurations and model overrides",
  11684. "type": "object",
  11685. "propertyNames": {
  11686. "type": "string"
  11687. },
  11688. "additionalProperties": {
  11689. "$ref": "#/components/schemas/ProviderConfig"
  11690. }
  11691. },
  11692. "mcp": {
  11693. "description": "MCP (Model Context Protocol) server configurations",
  11694. "type": "object",
  11695. "propertyNames": {
  11696. "type": "string"
  11697. },
  11698. "additionalProperties": {
  11699. "anyOf": [
  11700. {
  11701. "anyOf": [
  11702. {
  11703. "$ref": "#/components/schemas/McpLocalConfig"
  11704. },
  11705. {
  11706. "$ref": "#/components/schemas/McpRemoteConfig"
  11707. }
  11708. ]
  11709. },
  11710. {
  11711. "type": "object",
  11712. "properties": {
  11713. "enabled": {
  11714. "type": "boolean"
  11715. }
  11716. },
  11717. "required": ["enabled"],
  11718. "additionalProperties": false
  11719. }
  11720. ]
  11721. }
  11722. },
  11723. "formatter": {
  11724. "anyOf": [
  11725. {
  11726. "type": "boolean"
  11727. },
  11728. {
  11729. "type": "object",
  11730. "propertyNames": {
  11731. "type": "string"
  11732. },
  11733. "additionalProperties": {
  11734. "type": "object",
  11735. "properties": {
  11736. "disabled": {
  11737. "type": "boolean"
  11738. },
  11739. "command": {
  11740. "type": "array",
  11741. "items": {
  11742. "type": "string"
  11743. }
  11744. },
  11745. "environment": {
  11746. "type": "object",
  11747. "propertyNames": {
  11748. "type": "string"
  11749. },
  11750. "additionalProperties": {
  11751. "type": "string"
  11752. }
  11753. },
  11754. "extensions": {
  11755. "type": "array",
  11756. "items": {
  11757. "type": "string"
  11758. }
  11759. }
  11760. }
  11761. }
  11762. }
  11763. ]
  11764. },
  11765. "lsp": {
  11766. "anyOf": [
  11767. {
  11768. "type": "boolean"
  11769. },
  11770. {
  11771. "type": "object",
  11772. "propertyNames": {
  11773. "type": "string"
  11774. },
  11775. "additionalProperties": {
  11776. "anyOf": [
  11777. {
  11778. "type": "object",
  11779. "properties": {
  11780. "disabled": {
  11781. "type": "boolean",
  11782. "const": true
  11783. }
  11784. },
  11785. "required": ["disabled"]
  11786. },
  11787. {
  11788. "type": "object",
  11789. "properties": {
  11790. "command": {
  11791. "type": "array",
  11792. "items": {
  11793. "type": "string"
  11794. }
  11795. },
  11796. "extensions": {
  11797. "type": "array",
  11798. "items": {
  11799. "type": "string"
  11800. }
  11801. },
  11802. "disabled": {
  11803. "type": "boolean"
  11804. },
  11805. "env": {
  11806. "type": "object",
  11807. "propertyNames": {
  11808. "type": "string"
  11809. },
  11810. "additionalProperties": {
  11811. "type": "string"
  11812. }
  11813. },
  11814. "initialization": {
  11815. "type": "object",
  11816. "propertyNames": {
  11817. "type": "string"
  11818. },
  11819. "additionalProperties": {}
  11820. }
  11821. },
  11822. "required": ["command"]
  11823. }
  11824. ]
  11825. }
  11826. }
  11827. ]
  11828. },
  11829. "instructions": {
  11830. "description": "Additional instruction files or patterns to include",
  11831. "type": "array",
  11832. "items": {
  11833. "type": "string"
  11834. }
  11835. },
  11836. "layout": {
  11837. "$ref": "#/components/schemas/LayoutConfig"
  11838. },
  11839. "permission": {
  11840. "$ref": "#/components/schemas/PermissionConfig"
  11841. },
  11842. "tools": {
  11843. "type": "object",
  11844. "propertyNames": {
  11845. "type": "string"
  11846. },
  11847. "additionalProperties": {
  11848. "type": "boolean"
  11849. }
  11850. },
  11851. "enterprise": {
  11852. "type": "object",
  11853. "properties": {
  11854. "url": {
  11855. "description": "Enterprise URL",
  11856. "type": "string"
  11857. }
  11858. }
  11859. },
  11860. "compaction": {
  11861. "type": "object",
  11862. "properties": {
  11863. "auto": {
  11864. "description": "Enable automatic compaction when context is full (default: true)",
  11865. "type": "boolean"
  11866. },
  11867. "prune": {
  11868. "description": "Enable pruning of old tool outputs (default: true)",
  11869. "type": "boolean"
  11870. },
  11871. "reserved": {
  11872. "description": "Token buffer for compaction. Leaves enough window to avoid overflow during compaction.",
  11873. "type": "integer",
  11874. "minimum": 0,
  11875. "maximum": 9007199254740991
  11876. }
  11877. }
  11878. },
  11879. "experimental": {
  11880. "type": "object",
  11881. "properties": {
  11882. "disable_paste_summary": {
  11883. "type": "boolean"
  11884. },
  11885. "batch_tool": {
  11886. "description": "Enable the batch tool",
  11887. "type": "boolean"
  11888. },
  11889. "openTelemetry": {
  11890. "description": "Enable OpenTelemetry spans for AI SDK calls (using the 'experimental_telemetry' flag)",
  11891. "type": "boolean"
  11892. },
  11893. "primary_tools": {
  11894. "description": "Tools that should only be available to primary agents.",
  11895. "type": "array",
  11896. "items": {
  11897. "type": "string"
  11898. }
  11899. },
  11900. "continue_loop_on_deny": {
  11901. "description": "Continue the agent loop when a tool call is denied",
  11902. "type": "boolean"
  11903. },
  11904. "mcp_timeout": {
  11905. "description": "Timeout in milliseconds for model context protocol (MCP) requests",
  11906. "type": "integer",
  11907. "exclusiveMinimum": 0,
  11908. "maximum": 9007199254740991
  11909. }
  11910. }
  11911. }
  11912. },
  11913. "additionalProperties": false
  11914. },
  11915. "BadRequestError": {
  11916. "type": "object",
  11917. "properties": {
  11918. "data": {},
  11919. "errors": {
  11920. "type": "array",
  11921. "items": {
  11922. "type": "object",
  11923. "propertyNames": {
  11924. "type": "string"
  11925. },
  11926. "additionalProperties": {}
  11927. }
  11928. },
  11929. "success": {
  11930. "type": "boolean",
  11931. "const": false
  11932. }
  11933. },
  11934. "required": ["data", "errors", "success"]
  11935. },
  11936. "OAuth": {
  11937. "type": "object",
  11938. "properties": {
  11939. "type": {
  11940. "type": "string",
  11941. "const": "oauth"
  11942. },
  11943. "refresh": {
  11944. "type": "string"
  11945. },
  11946. "access": {
  11947. "type": "string"
  11948. },
  11949. "expires": {
  11950. "type": "number"
  11951. },
  11952. "accountId": {
  11953. "type": "string"
  11954. },
  11955. "enterpriseUrl": {
  11956. "type": "string"
  11957. }
  11958. },
  11959. "required": ["type", "refresh", "access", "expires"]
  11960. },
  11961. "ApiAuth": {
  11962. "type": "object",
  11963. "properties": {
  11964. "type": {
  11965. "type": "string",
  11966. "const": "api"
  11967. },
  11968. "key": {
  11969. "type": "string"
  11970. },
  11971. "metadata": {
  11972. "type": "object",
  11973. "propertyNames": {
  11974. "type": "string"
  11975. },
  11976. "additionalProperties": {
  11977. "type": "string"
  11978. }
  11979. }
  11980. },
  11981. "required": ["type", "key"]
  11982. },
  11983. "WellKnownAuth": {
  11984. "type": "object",
  11985. "properties": {
  11986. "type": {
  11987. "type": "string",
  11988. "const": "wellknown"
  11989. },
  11990. "key": {
  11991. "type": "string"
  11992. },
  11993. "token": {
  11994. "type": "string"
  11995. }
  11996. },
  11997. "required": ["type", "key", "token"]
  11998. },
  11999. "Auth": {
  12000. "anyOf": [
  12001. {
  12002. "$ref": "#/components/schemas/OAuth"
  12003. },
  12004. {
  12005. "$ref": "#/components/schemas/ApiAuth"
  12006. },
  12007. {
  12008. "$ref": "#/components/schemas/WellKnownAuth"
  12009. }
  12010. ]
  12011. },
  12012. "Workspace": {
  12013. "type": "object",
  12014. "properties": {
  12015. "id": {
  12016. "type": "string",
  12017. "pattern": "^wrk.*"
  12018. },
  12019. "type": {
  12020. "type": "string"
  12021. },
  12022. "name": {
  12023. "type": "string"
  12024. },
  12025. "branch": {
  12026. "anyOf": [
  12027. {
  12028. "type": "string"
  12029. },
  12030. {
  12031. "type": "null"
  12032. }
  12033. ]
  12034. },
  12035. "directory": {
  12036. "anyOf": [
  12037. {
  12038. "type": "string"
  12039. },
  12040. {
  12041. "type": "null"
  12042. }
  12043. ]
  12044. },
  12045. "extra": {
  12046. "anyOf": [
  12047. {},
  12048. {
  12049. "type": "null"
  12050. }
  12051. ]
  12052. },
  12053. "projectID": {
  12054. "type": "string"
  12055. }
  12056. },
  12057. "required": ["id", "type", "name", "branch", "directory", "extra", "projectID"]
  12058. },
  12059. "NotFoundError": {
  12060. "type": "object",
  12061. "properties": {
  12062. "name": {
  12063. "type": "string",
  12064. "const": "NotFoundError"
  12065. },
  12066. "data": {
  12067. "type": "object",
  12068. "properties": {
  12069. "message": {
  12070. "type": "string"
  12071. }
  12072. },
  12073. "required": ["message"]
  12074. }
  12075. },
  12076. "required": ["name", "data"]
  12077. },
  12078. "Model": {
  12079. "type": "object",
  12080. "properties": {
  12081. "id": {
  12082. "type": "string"
  12083. },
  12084. "providerID": {
  12085. "type": "string"
  12086. },
  12087. "api": {
  12088. "type": "object",
  12089. "properties": {
  12090. "id": {
  12091. "type": "string"
  12092. },
  12093. "url": {
  12094. "type": "string"
  12095. },
  12096. "npm": {
  12097. "type": "string"
  12098. }
  12099. },
  12100. "required": ["id", "url", "npm"]
  12101. },
  12102. "name": {
  12103. "type": "string"
  12104. },
  12105. "family": {
  12106. "type": "string"
  12107. },
  12108. "capabilities": {
  12109. "type": "object",
  12110. "properties": {
  12111. "temperature": {
  12112. "type": "boolean"
  12113. },
  12114. "reasoning": {
  12115. "type": "boolean"
  12116. },
  12117. "attachment": {
  12118. "type": "boolean"
  12119. },
  12120. "toolcall": {
  12121. "type": "boolean"
  12122. },
  12123. "input": {
  12124. "type": "object",
  12125. "properties": {
  12126. "text": {
  12127. "type": "boolean"
  12128. },
  12129. "audio": {
  12130. "type": "boolean"
  12131. },
  12132. "image": {
  12133. "type": "boolean"
  12134. },
  12135. "video": {
  12136. "type": "boolean"
  12137. },
  12138. "pdf": {
  12139. "type": "boolean"
  12140. }
  12141. },
  12142. "required": ["text", "audio", "image", "video", "pdf"]
  12143. },
  12144. "output": {
  12145. "type": "object",
  12146. "properties": {
  12147. "text": {
  12148. "type": "boolean"
  12149. },
  12150. "audio": {
  12151. "type": "boolean"
  12152. },
  12153. "image": {
  12154. "type": "boolean"
  12155. },
  12156. "video": {
  12157. "type": "boolean"
  12158. },
  12159. "pdf": {
  12160. "type": "boolean"
  12161. }
  12162. },
  12163. "required": ["text", "audio", "image", "video", "pdf"]
  12164. },
  12165. "interleaved": {
  12166. "anyOf": [
  12167. {
  12168. "type": "boolean"
  12169. },
  12170. {
  12171. "type": "object",
  12172. "properties": {
  12173. "field": {
  12174. "type": "string",
  12175. "enum": ["reasoning_content", "reasoning_details"]
  12176. }
  12177. },
  12178. "required": ["field"]
  12179. }
  12180. ]
  12181. }
  12182. },
  12183. "required": ["temperature", "reasoning", "attachment", "toolcall", "input", "output", "interleaved"]
  12184. },
  12185. "cost": {
  12186. "type": "object",
  12187. "properties": {
  12188. "input": {
  12189. "type": "number"
  12190. },
  12191. "output": {
  12192. "type": "number"
  12193. },
  12194. "cache": {
  12195. "type": "object",
  12196. "properties": {
  12197. "read": {
  12198. "type": "number"
  12199. },
  12200. "write": {
  12201. "type": "number"
  12202. }
  12203. },
  12204. "required": ["read", "write"]
  12205. },
  12206. "experimentalOver200K": {
  12207. "type": "object",
  12208. "properties": {
  12209. "input": {
  12210. "type": "number"
  12211. },
  12212. "output": {
  12213. "type": "number"
  12214. },
  12215. "cache": {
  12216. "type": "object",
  12217. "properties": {
  12218. "read": {
  12219. "type": "number"
  12220. },
  12221. "write": {
  12222. "type": "number"
  12223. }
  12224. },
  12225. "required": ["read", "write"]
  12226. }
  12227. },
  12228. "required": ["input", "output", "cache"]
  12229. }
  12230. },
  12231. "required": ["input", "output", "cache"]
  12232. },
  12233. "limit": {
  12234. "type": "object",
  12235. "properties": {
  12236. "context": {
  12237. "type": "number"
  12238. },
  12239. "input": {
  12240. "type": "number"
  12241. },
  12242. "output": {
  12243. "type": "number"
  12244. }
  12245. },
  12246. "required": ["context", "output"]
  12247. },
  12248. "status": {
  12249. "type": "string",
  12250. "enum": ["alpha", "beta", "deprecated", "active"]
  12251. },
  12252. "options": {
  12253. "type": "object",
  12254. "propertyNames": {
  12255. "type": "string"
  12256. },
  12257. "additionalProperties": {}
  12258. },
  12259. "headers": {
  12260. "type": "object",
  12261. "propertyNames": {
  12262. "type": "string"
  12263. },
  12264. "additionalProperties": {
  12265. "type": "string"
  12266. }
  12267. },
  12268. "release_date": {
  12269. "type": "string"
  12270. },
  12271. "variants": {
  12272. "type": "object",
  12273. "propertyNames": {
  12274. "type": "string"
  12275. },
  12276. "additionalProperties": {
  12277. "type": "object",
  12278. "propertyNames": {
  12279. "type": "string"
  12280. },
  12281. "additionalProperties": {}
  12282. }
  12283. }
  12284. },
  12285. "required": [
  12286. "id",
  12287. "providerID",
  12288. "api",
  12289. "name",
  12290. "capabilities",
  12291. "cost",
  12292. "limit",
  12293. "status",
  12294. "options",
  12295. "headers",
  12296. "release_date"
  12297. ]
  12298. },
  12299. "Provider": {
  12300. "type": "object",
  12301. "properties": {
  12302. "id": {
  12303. "type": "string"
  12304. },
  12305. "name": {
  12306. "type": "string"
  12307. },
  12308. "source": {
  12309. "type": "string",
  12310. "enum": ["env", "config", "custom", "api"]
  12311. },
  12312. "env": {
  12313. "type": "array",
  12314. "items": {
  12315. "type": "string"
  12316. }
  12317. },
  12318. "key": {
  12319. "type": "string"
  12320. },
  12321. "options": {
  12322. "type": "object",
  12323. "propertyNames": {
  12324. "type": "string"
  12325. },
  12326. "additionalProperties": {}
  12327. },
  12328. "models": {
  12329. "type": "object",
  12330. "propertyNames": {
  12331. "type": "string"
  12332. },
  12333. "additionalProperties": {
  12334. "$ref": "#/components/schemas/Model"
  12335. }
  12336. }
  12337. },
  12338. "required": ["id", "name", "source", "env", "options", "models"]
  12339. },
  12340. "ConsoleState": {
  12341. "type": "object",
  12342. "properties": {
  12343. "consoleManagedProviders": {
  12344. "type": "array",
  12345. "items": {
  12346. "type": "string"
  12347. }
  12348. },
  12349. "activeOrgName": {
  12350. "type": "string"
  12351. },
  12352. "switchableOrgCount": {
  12353. "type": "number"
  12354. }
  12355. },
  12356. "required": ["consoleManagedProviders", "switchableOrgCount"]
  12357. },
  12358. "ToolIDs": {
  12359. "type": "array",
  12360. "items": {
  12361. "type": "string"
  12362. }
  12363. },
  12364. "ToolListItem": {
  12365. "type": "object",
  12366. "properties": {
  12367. "id": {
  12368. "type": "string"
  12369. },
  12370. "description": {
  12371. "type": "string"
  12372. },
  12373. "parameters": {}
  12374. },
  12375. "required": ["id", "description", "parameters"]
  12376. },
  12377. "ToolList": {
  12378. "type": "array",
  12379. "items": {
  12380. "$ref": "#/components/schemas/ToolListItem"
  12381. }
  12382. },
  12383. "Worktree": {
  12384. "type": "object",
  12385. "properties": {
  12386. "name": {
  12387. "type": "string"
  12388. },
  12389. "branch": {
  12390. "type": "string"
  12391. },
  12392. "directory": {
  12393. "type": "string"
  12394. }
  12395. },
  12396. "required": ["name", "branch", "directory"]
  12397. },
  12398. "WorktreeCreateInput": {
  12399. "type": "object",
  12400. "properties": {
  12401. "name": {
  12402. "type": "string"
  12403. },
  12404. "startCommand": {
  12405. "description": "Additional startup script to run after the project's start command",
  12406. "type": "string"
  12407. }
  12408. }
  12409. },
  12410. "WorktreeRemoveInput": {
  12411. "type": "object",
  12412. "properties": {
  12413. "directory": {
  12414. "type": "string"
  12415. }
  12416. },
  12417. "required": ["directory"]
  12418. },
  12419. "WorktreeResetInput": {
  12420. "type": "object",
  12421. "properties": {
  12422. "directory": {
  12423. "type": "string"
  12424. }
  12425. },
  12426. "required": ["directory"]
  12427. },
  12428. "ProjectSummary": {
  12429. "type": "object",
  12430. "properties": {
  12431. "id": {
  12432. "type": "string"
  12433. },
  12434. "name": {
  12435. "type": "string"
  12436. },
  12437. "worktree": {
  12438. "type": "string"
  12439. }
  12440. },
  12441. "required": ["id", "worktree"]
  12442. },
  12443. "GlobalSession": {
  12444. "type": "object",
  12445. "properties": {
  12446. "id": {
  12447. "type": "string",
  12448. "pattern": "^ses.*"
  12449. },
  12450. "slug": {
  12451. "type": "string"
  12452. },
  12453. "projectID": {
  12454. "type": "string"
  12455. },
  12456. "workspaceID": {
  12457. "type": "string",
  12458. "pattern": "^wrk.*"
  12459. },
  12460. "directory": {
  12461. "type": "string"
  12462. },
  12463. "parentID": {
  12464. "type": "string",
  12465. "pattern": "^ses.*"
  12466. },
  12467. "summary": {
  12468. "type": "object",
  12469. "properties": {
  12470. "additions": {
  12471. "type": "number"
  12472. },
  12473. "deletions": {
  12474. "type": "number"
  12475. },
  12476. "files": {
  12477. "type": "number"
  12478. },
  12479. "diffs": {
  12480. "type": "array",
  12481. "items": {
  12482. "$ref": "#/components/schemas/SnapshotFileDiff"
  12483. }
  12484. }
  12485. },
  12486. "required": ["additions", "deletions", "files"]
  12487. },
  12488. "share": {
  12489. "type": "object",
  12490. "properties": {
  12491. "url": {
  12492. "type": "string"
  12493. }
  12494. },
  12495. "required": ["url"]
  12496. },
  12497. "title": {
  12498. "type": "string"
  12499. },
  12500. "version": {
  12501. "type": "string"
  12502. },
  12503. "time": {
  12504. "type": "object",
  12505. "properties": {
  12506. "created": {
  12507. "type": "number"
  12508. },
  12509. "updated": {
  12510. "type": "number"
  12511. },
  12512. "compacting": {
  12513. "type": "number"
  12514. },
  12515. "archived": {
  12516. "type": "number"
  12517. }
  12518. },
  12519. "required": ["created", "updated"]
  12520. },
  12521. "permission": {
  12522. "$ref": "#/components/schemas/PermissionRuleset"
  12523. },
  12524. "revert": {
  12525. "type": "object",
  12526. "properties": {
  12527. "messageID": {
  12528. "type": "string",
  12529. "pattern": "^msg.*"
  12530. },
  12531. "partID": {
  12532. "type": "string",
  12533. "pattern": "^prt.*"
  12534. },
  12535. "snapshot": {
  12536. "type": "string"
  12537. },
  12538. "diff": {
  12539. "type": "string"
  12540. }
  12541. },
  12542. "required": ["messageID"]
  12543. },
  12544. "project": {
  12545. "anyOf": [
  12546. {
  12547. "$ref": "#/components/schemas/ProjectSummary"
  12548. },
  12549. {
  12550. "type": "null"
  12551. }
  12552. ]
  12553. }
  12554. },
  12555. "required": ["id", "slug", "projectID", "directory", "title", "version", "time", "project"]
  12556. },
  12557. "McpResource": {
  12558. "type": "object",
  12559. "properties": {
  12560. "name": {
  12561. "type": "string"
  12562. },
  12563. "uri": {
  12564. "type": "string"
  12565. },
  12566. "description": {
  12567. "type": "string"
  12568. },
  12569. "mimeType": {
  12570. "type": "string"
  12571. },
  12572. "client": {
  12573. "type": "string"
  12574. }
  12575. },
  12576. "required": ["name", "uri", "client"]
  12577. },
  12578. "TextPartInput": {
  12579. "type": "object",
  12580. "properties": {
  12581. "id": {
  12582. "type": "string",
  12583. "pattern": "^prt.*"
  12584. },
  12585. "type": {
  12586. "type": "string",
  12587. "const": "text"
  12588. },
  12589. "text": {
  12590. "type": "string"
  12591. },
  12592. "synthetic": {
  12593. "type": "boolean"
  12594. },
  12595. "ignored": {
  12596. "type": "boolean"
  12597. },
  12598. "time": {
  12599. "type": "object",
  12600. "properties": {
  12601. "start": {
  12602. "type": "number"
  12603. },
  12604. "end": {
  12605. "type": "number"
  12606. }
  12607. },
  12608. "required": ["start"]
  12609. },
  12610. "metadata": {
  12611. "type": "object",
  12612. "propertyNames": {
  12613. "type": "string"
  12614. },
  12615. "additionalProperties": {}
  12616. }
  12617. },
  12618. "required": ["type", "text"]
  12619. },
  12620. "FilePartInput": {
  12621. "type": "object",
  12622. "properties": {
  12623. "id": {
  12624. "type": "string",
  12625. "pattern": "^prt.*"
  12626. },
  12627. "type": {
  12628. "type": "string",
  12629. "const": "file"
  12630. },
  12631. "mime": {
  12632. "type": "string"
  12633. },
  12634. "filename": {
  12635. "type": "string"
  12636. },
  12637. "url": {
  12638. "type": "string"
  12639. },
  12640. "source": {
  12641. "$ref": "#/components/schemas/FilePartSource"
  12642. }
  12643. },
  12644. "required": ["type", "mime", "url"]
  12645. },
  12646. "AgentPartInput": {
  12647. "type": "object",
  12648. "properties": {
  12649. "id": {
  12650. "type": "string",
  12651. "pattern": "^prt.*"
  12652. },
  12653. "type": {
  12654. "type": "string",
  12655. "const": "agent"
  12656. },
  12657. "name": {
  12658. "type": "string"
  12659. },
  12660. "source": {
  12661. "type": "object",
  12662. "properties": {
  12663. "value": {
  12664. "type": "string"
  12665. },
  12666. "start": {
  12667. "type": "integer",
  12668. "minimum": -9007199254740991,
  12669. "maximum": 9007199254740991
  12670. },
  12671. "end": {
  12672. "type": "integer",
  12673. "minimum": -9007199254740991,
  12674. "maximum": 9007199254740991
  12675. }
  12676. },
  12677. "required": ["value", "start", "end"]
  12678. }
  12679. },
  12680. "required": ["type", "name"]
  12681. },
  12682. "SubtaskPartInput": {
  12683. "type": "object",
  12684. "properties": {
  12685. "id": {
  12686. "type": "string",
  12687. "pattern": "^prt.*"
  12688. },
  12689. "type": {
  12690. "type": "string",
  12691. "const": "subtask"
  12692. },
  12693. "prompt": {
  12694. "type": "string"
  12695. },
  12696. "description": {
  12697. "type": "string"
  12698. },
  12699. "agent": {
  12700. "type": "string"
  12701. },
  12702. "model": {
  12703. "type": "object",
  12704. "properties": {
  12705. "providerID": {
  12706. "type": "string"
  12707. },
  12708. "modelID": {
  12709. "type": "string"
  12710. }
  12711. },
  12712. "required": ["providerID", "modelID"]
  12713. },
  12714. "command": {
  12715. "type": "string"
  12716. }
  12717. },
  12718. "required": ["type", "prompt", "description", "agent"]
  12719. },
  12720. "ProviderAuthMethod": {
  12721. "type": "object",
  12722. "properties": {
  12723. "type": {
  12724. "type": "string",
  12725. "enum": ["oauth", "api"]
  12726. },
  12727. "label": {
  12728. "type": "string"
  12729. },
  12730. "prompts": {
  12731. "type": "array",
  12732. "items": {
  12733. "anyOf": [
  12734. {
  12735. "type": "object",
  12736. "properties": {
  12737. "type": {
  12738. "type": "string",
  12739. "const": "text"
  12740. },
  12741. "key": {
  12742. "type": "string"
  12743. },
  12744. "message": {
  12745. "type": "string"
  12746. },
  12747. "placeholder": {
  12748. "type": "string"
  12749. },
  12750. "when": {
  12751. "type": "object",
  12752. "properties": {
  12753. "key": {
  12754. "type": "string"
  12755. },
  12756. "op": {
  12757. "type": "string",
  12758. "enum": ["eq", "neq"]
  12759. },
  12760. "value": {
  12761. "type": "string"
  12762. }
  12763. },
  12764. "required": ["key", "op", "value"]
  12765. }
  12766. },
  12767. "required": ["type", "key", "message"]
  12768. },
  12769. {
  12770. "type": "object",
  12771. "properties": {
  12772. "type": {
  12773. "type": "string",
  12774. "const": "select"
  12775. },
  12776. "key": {
  12777. "type": "string"
  12778. },
  12779. "message": {
  12780. "type": "string"
  12781. },
  12782. "options": {
  12783. "type": "array",
  12784. "items": {
  12785. "type": "object",
  12786. "properties": {
  12787. "label": {
  12788. "type": "string"
  12789. },
  12790. "value": {
  12791. "type": "string"
  12792. },
  12793. "hint": {
  12794. "type": "string"
  12795. }
  12796. },
  12797. "required": ["label", "value"]
  12798. }
  12799. },
  12800. "when": {
  12801. "type": "object",
  12802. "properties": {
  12803. "key": {
  12804. "type": "string"
  12805. },
  12806. "op": {
  12807. "type": "string",
  12808. "enum": ["eq", "neq"]
  12809. },
  12810. "value": {
  12811. "type": "string"
  12812. }
  12813. },
  12814. "required": ["key", "op", "value"]
  12815. }
  12816. },
  12817. "required": ["type", "key", "message", "options"]
  12818. }
  12819. ]
  12820. }
  12821. }
  12822. },
  12823. "required": ["type", "label"]
  12824. },
  12825. "ProviderAuthAuthorization": {
  12826. "type": "object",
  12827. "properties": {
  12828. "url": {
  12829. "type": "string"
  12830. },
  12831. "method": {
  12832. "type": "string",
  12833. "enum": ["auto", "code"]
  12834. },
  12835. "instructions": {
  12836. "type": "string"
  12837. }
  12838. },
  12839. "required": ["url", "method", "instructions"]
  12840. },
  12841. "Symbol": {
  12842. "type": "object",
  12843. "properties": {
  12844. "name": {
  12845. "type": "string"
  12846. },
  12847. "kind": {
  12848. "type": "number"
  12849. },
  12850. "location": {
  12851. "type": "object",
  12852. "properties": {
  12853. "uri": {
  12854. "type": "string"
  12855. },
  12856. "range": {
  12857. "$ref": "#/components/schemas/Range"
  12858. }
  12859. },
  12860. "required": ["uri", "range"]
  12861. }
  12862. },
  12863. "required": ["name", "kind", "location"]
  12864. },
  12865. "FileNode": {
  12866. "type": "object",
  12867. "properties": {
  12868. "name": {
  12869. "type": "string"
  12870. },
  12871. "path": {
  12872. "type": "string"
  12873. },
  12874. "absolute": {
  12875. "type": "string"
  12876. },
  12877. "type": {
  12878. "type": "string",
  12879. "enum": ["file", "directory"]
  12880. },
  12881. "ignored": {
  12882. "type": "boolean"
  12883. }
  12884. },
  12885. "required": ["name", "path", "absolute", "type", "ignored"]
  12886. },
  12887. "FileContent": {
  12888. "type": "object",
  12889. "properties": {
  12890. "type": {
  12891. "type": "string",
  12892. "enum": ["text", "binary"]
  12893. },
  12894. "content": {
  12895. "type": "string"
  12896. },
  12897. "diff": {
  12898. "type": "string"
  12899. },
  12900. "patch": {
  12901. "type": "object",
  12902. "properties": {
  12903. "oldFileName": {
  12904. "type": "string"
  12905. },
  12906. "newFileName": {
  12907. "type": "string"
  12908. },
  12909. "oldHeader": {
  12910. "type": "string"
  12911. },
  12912. "newHeader": {
  12913. "type": "string"
  12914. },
  12915. "hunks": {
  12916. "type": "array",
  12917. "items": {
  12918. "type": "object",
  12919. "properties": {
  12920. "oldStart": {
  12921. "type": "number"
  12922. },
  12923. "oldLines": {
  12924. "type": "number"
  12925. },
  12926. "newStart": {
  12927. "type": "number"
  12928. },
  12929. "newLines": {
  12930. "type": "number"
  12931. },
  12932. "lines": {
  12933. "type": "array",
  12934. "items": {
  12935. "type": "string"
  12936. }
  12937. }
  12938. },
  12939. "required": ["oldStart", "oldLines", "newStart", "newLines", "lines"]
  12940. }
  12941. },
  12942. "index": {
  12943. "type": "string"
  12944. }
  12945. },
  12946. "required": ["oldFileName", "newFileName", "hunks"]
  12947. },
  12948. "encoding": {
  12949. "type": "string",
  12950. "const": "base64"
  12951. },
  12952. "mimeType": {
  12953. "type": "string"
  12954. }
  12955. },
  12956. "required": ["type", "content"]
  12957. },
  12958. "File": {
  12959. "type": "object",
  12960. "properties": {
  12961. "path": {
  12962. "type": "string"
  12963. },
  12964. "added": {
  12965. "type": "integer",
  12966. "minimum": -9007199254740991,
  12967. "maximum": 9007199254740991
  12968. },
  12969. "removed": {
  12970. "type": "integer",
  12971. "minimum": -9007199254740991,
  12972. "maximum": 9007199254740991
  12973. },
  12974. "status": {
  12975. "type": "string",
  12976. "enum": ["added", "deleted", "modified"]
  12977. }
  12978. },
  12979. "required": ["path", "added", "removed", "status"]
  12980. },
  12981. "Event": {
  12982. "anyOf": [
  12983. {
  12984. "$ref": "#/components/schemas/Event.project.updated"
  12985. },
  12986. {
  12987. "$ref": "#/components/schemas/Event.server.instance.disposed"
  12988. },
  12989. {
  12990. "$ref": "#/components/schemas/Event.server.connected"
  12991. },
  12992. {
  12993. "$ref": "#/components/schemas/Event.global.disposed"
  12994. },
  12995. {
  12996. "$ref": "#/components/schemas/Event.file.edited"
  12997. },
  12998. {
  12999. "$ref": "#/components/schemas/Event.file.watcher.updated"
  13000. },
  13001. {
  13002. "$ref": "#/components/schemas/Event.lsp.client.diagnostics"
  13003. },
  13004. {
  13005. "$ref": "#/components/schemas/Event.lsp.updated"
  13006. },
  13007. {
  13008. "$ref": "#/components/schemas/Event.installation.updated"
  13009. },
  13010. {
  13011. "$ref": "#/components/schemas/Event.installation.update-available"
  13012. },
  13013. {
  13014. "$ref": "#/components/schemas/Event.message.part.delta"
  13015. },
  13016. {
  13017. "$ref": "#/components/schemas/Event.permission.asked"
  13018. },
  13019. {
  13020. "$ref": "#/components/schemas/Event.permission.replied"
  13021. },
  13022. {
  13023. "$ref": "#/components/schemas/Event.session.diff"
  13024. },
  13025. {
  13026. "$ref": "#/components/schemas/Event.session.error"
  13027. },
  13028. {
  13029. "$ref": "#/components/schemas/Event.question.asked"
  13030. },
  13031. {
  13032. "$ref": "#/components/schemas/Event.question.replied"
  13033. },
  13034. {
  13035. "$ref": "#/components/schemas/Event.question.rejected"
  13036. },
  13037. {
  13038. "$ref": "#/components/schemas/Event.todo.updated"
  13039. },
  13040. {
  13041. "$ref": "#/components/schemas/Event.session.status"
  13042. },
  13043. {
  13044. "$ref": "#/components/schemas/Event.session.idle"
  13045. },
  13046. {
  13047. "$ref": "#/components/schemas/Event.session.compacted"
  13048. },
  13049. {
  13050. "$ref": "#/components/schemas/Event.tui.prompt.append"
  13051. },
  13052. {
  13053. "$ref": "#/components/schemas/Event.tui.command.execute"
  13054. },
  13055. {
  13056. "$ref": "#/components/schemas/Event.tui.toast.show"
  13057. },
  13058. {
  13059. "$ref": "#/components/schemas/Event.tui.session.select"
  13060. },
  13061. {
  13062. "$ref": "#/components/schemas/Event.mcp.tools.changed"
  13063. },
  13064. {
  13065. "$ref": "#/components/schemas/Event.mcp.browser.open.failed"
  13066. },
  13067. {
  13068. "$ref": "#/components/schemas/Event.command.executed"
  13069. },
  13070. {
  13071. "$ref": "#/components/schemas/Event.vcs.branch.updated"
  13072. },
  13073. {
  13074. "$ref": "#/components/schemas/Event.worktree.ready"
  13075. },
  13076. {
  13077. "$ref": "#/components/schemas/Event.worktree.failed"
  13078. },
  13079. {
  13080. "$ref": "#/components/schemas/Event.pty.created"
  13081. },
  13082. {
  13083. "$ref": "#/components/schemas/Event.pty.updated"
  13084. },
  13085. {
  13086. "$ref": "#/components/schemas/Event.pty.exited"
  13087. },
  13088. {
  13089. "$ref": "#/components/schemas/Event.pty.deleted"
  13090. },
  13091. {
  13092. "$ref": "#/components/schemas/Event.workspace.ready"
  13093. },
  13094. {
  13095. "$ref": "#/components/schemas/Event.workspace.failed"
  13096. },
  13097. {
  13098. "$ref": "#/components/schemas/Event.workspace.restore"
  13099. },
  13100. {
  13101. "$ref": "#/components/schemas/Event.workspace.status"
  13102. },
  13103. {
  13104. "$ref": "#/components/schemas/Event.message.updated"
  13105. },
  13106. {
  13107. "$ref": "#/components/schemas/Event.message.removed"
  13108. },
  13109. {
  13110. "$ref": "#/components/schemas/Event.message.part.updated"
  13111. },
  13112. {
  13113. "$ref": "#/components/schemas/Event.message.part.removed"
  13114. },
  13115. {
  13116. "$ref": "#/components/schemas/Event.session.created"
  13117. },
  13118. {
  13119. "$ref": "#/components/schemas/Event.session.updated"
  13120. },
  13121. {
  13122. "$ref": "#/components/schemas/Event.session.deleted"
  13123. }
  13124. ]
  13125. },
  13126. "MCPStatusConnected": {
  13127. "type": "object",
  13128. "properties": {
  13129. "status": {
  13130. "type": "string",
  13131. "const": "connected"
  13132. }
  13133. },
  13134. "required": ["status"]
  13135. },
  13136. "MCPStatusDisabled": {
  13137. "type": "object",
  13138. "properties": {
  13139. "status": {
  13140. "type": "string",
  13141. "const": "disabled"
  13142. }
  13143. },
  13144. "required": ["status"]
  13145. },
  13146. "MCPStatusFailed": {
  13147. "type": "object",
  13148. "properties": {
  13149. "status": {
  13150. "type": "string",
  13151. "const": "failed"
  13152. },
  13153. "error": {
  13154. "type": "string"
  13155. }
  13156. },
  13157. "required": ["status", "error"]
  13158. },
  13159. "MCPStatusNeedsAuth": {
  13160. "type": "object",
  13161. "properties": {
  13162. "status": {
  13163. "type": "string",
  13164. "const": "needs_auth"
  13165. }
  13166. },
  13167. "required": ["status"]
  13168. },
  13169. "MCPStatusNeedsClientRegistration": {
  13170. "type": "object",
  13171. "properties": {
  13172. "status": {
  13173. "type": "string",
  13174. "const": "needs_client_registration"
  13175. },
  13176. "error": {
  13177. "type": "string"
  13178. }
  13179. },
  13180. "required": ["status", "error"]
  13181. },
  13182. "MCPStatus": {
  13183. "anyOf": [
  13184. {
  13185. "$ref": "#/components/schemas/MCPStatusConnected"
  13186. },
  13187. {
  13188. "$ref": "#/components/schemas/MCPStatusDisabled"
  13189. },
  13190. {
  13191. "$ref": "#/components/schemas/MCPStatusFailed"
  13192. },
  13193. {
  13194. "$ref": "#/components/schemas/MCPStatusNeedsAuth"
  13195. },
  13196. {
  13197. "$ref": "#/components/schemas/MCPStatusNeedsClientRegistration"
  13198. }
  13199. ]
  13200. },
  13201. "Path": {
  13202. "type": "object",
  13203. "properties": {
  13204. "home": {
  13205. "type": "string"
  13206. },
  13207. "state": {
  13208. "type": "string"
  13209. },
  13210. "config": {
  13211. "type": "string"
  13212. },
  13213. "worktree": {
  13214. "type": "string"
  13215. },
  13216. "directory": {
  13217. "type": "string"
  13218. }
  13219. },
  13220. "required": ["home", "state", "config", "worktree", "directory"]
  13221. },
  13222. "VcsInfo": {
  13223. "type": "object",
  13224. "properties": {
  13225. "branch": {
  13226. "type": "string"
  13227. },
  13228. "default_branch": {
  13229. "type": "string"
  13230. }
  13231. }
  13232. },
  13233. "VcsFileDiff": {
  13234. "type": "object",
  13235. "properties": {
  13236. "file": {
  13237. "type": "string"
  13238. },
  13239. "patch": {
  13240. "type": "string"
  13241. },
  13242. "additions": {
  13243. "type": "number"
  13244. },
  13245. "deletions": {
  13246. "type": "number"
  13247. },
  13248. "status": {
  13249. "type": "string",
  13250. "enum": ["added", "deleted", "modified"]
  13251. }
  13252. },
  13253. "required": ["file", "patch", "additions", "deletions"]
  13254. },
  13255. "Command": {
  13256. "type": "object",
  13257. "properties": {
  13258. "name": {
  13259. "type": "string"
  13260. },
  13261. "description": {
  13262. "type": "string"
  13263. },
  13264. "agent": {
  13265. "type": "string"
  13266. },
  13267. "model": {
  13268. "type": "string"
  13269. },
  13270. "source": {
  13271. "type": "string",
  13272. "enum": ["command", "mcp", "skill"]
  13273. },
  13274. "template": {
  13275. "anyOf": [
  13276. {
  13277. "type": "string"
  13278. },
  13279. {
  13280. "type": "string"
  13281. }
  13282. ]
  13283. },
  13284. "subtask": {
  13285. "type": "boolean"
  13286. },
  13287. "hints": {
  13288. "type": "array",
  13289. "items": {
  13290. "type": "string"
  13291. }
  13292. }
  13293. },
  13294. "required": ["name", "template", "hints"]
  13295. },
  13296. "Agent": {
  13297. "type": "object",
  13298. "properties": {
  13299. "name": {
  13300. "type": "string"
  13301. },
  13302. "description": {
  13303. "type": "string"
  13304. },
  13305. "mode": {
  13306. "type": "string",
  13307. "enum": ["subagent", "primary", "all"]
  13308. },
  13309. "native": {
  13310. "type": "boolean"
  13311. },
  13312. "hidden": {
  13313. "type": "boolean"
  13314. },
  13315. "topP": {
  13316. "type": "number"
  13317. },
  13318. "temperature": {
  13319. "type": "number"
  13320. },
  13321. "color": {
  13322. "type": "string"
  13323. },
  13324. "permission": {
  13325. "$ref": "#/components/schemas/PermissionRuleset"
  13326. },
  13327. "model": {
  13328. "type": "object",
  13329. "properties": {
  13330. "modelID": {
  13331. "type": "string"
  13332. },
  13333. "providerID": {
  13334. "type": "string"
  13335. }
  13336. },
  13337. "required": ["modelID", "providerID"]
  13338. },
  13339. "variant": {
  13340. "type": "string"
  13341. },
  13342. "prompt": {
  13343. "type": "string"
  13344. },
  13345. "options": {
  13346. "type": "object",
  13347. "propertyNames": {
  13348. "type": "string"
  13349. },
  13350. "additionalProperties": {}
  13351. },
  13352. "steps": {
  13353. "type": "integer",
  13354. "exclusiveMinimum": 0,
  13355. "maximum": 9007199254740991
  13356. }
  13357. },
  13358. "required": ["name", "mode", "permission", "options"]
  13359. },
  13360. "LSPStatus": {
  13361. "type": "object",
  13362. "properties": {
  13363. "id": {
  13364. "type": "string"
  13365. },
  13366. "name": {
  13367. "type": "string"
  13368. },
  13369. "root": {
  13370. "type": "string"
  13371. },
  13372. "status": {
  13373. "anyOf": [
  13374. {
  13375. "type": "string",
  13376. "const": "connected"
  13377. },
  13378. {
  13379. "type": "string",
  13380. "const": "error"
  13381. }
  13382. ]
  13383. }
  13384. },
  13385. "required": ["id", "name", "root", "status"]
  13386. },
  13387. "FormatterStatus": {
  13388. "type": "object",
  13389. "properties": {
  13390. "name": {
  13391. "type": "string"
  13392. },
  13393. "extensions": {
  13394. "type": "array",
  13395. "items": {
  13396. "type": "string"
  13397. }
  13398. },
  13399. "enabled": {
  13400. "type": "boolean"
  13401. }
  13402. },
  13403. "required": ["name", "extensions", "enabled"]
  13404. }
  13405. }
  13406. }
  13407. }