openapi.json 363 KB

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