openapi.json 362 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398
  1. {
  2. "openapi": "3.1.1",
  3. "info": {
  4. "title": "opencode",
  5. "description": "opencode api",
  6. "version": "1.0.0"
  7. },
  8. "paths": {
  9. "/global/health": {
  10. "get": {
  11. "operationId": "global.health",
  12. "summary": "Get health",
  13. "description": "Get health information about the OpenCode server.",
  14. "responses": {
  15. "200": {
  16. "description": "Health information",
  17. "content": {
  18. "application/json": {
  19. "schema": {
  20. "type": "object",
  21. "properties": {
  22. "healthy": {
  23. "type": "boolean",
  24. "const": true
  25. },
  26. "version": {
  27. "type": "string"
  28. }
  29. },
  30. "required": ["healthy", "version"]
  31. }
  32. }
  33. }
  34. }
  35. },
  36. "x-codeSamples": [
  37. {
  38. "lang": "js",
  39. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.health({\n ...\n})"
  40. }
  41. ]
  42. }
  43. },
  44. "/global/event": {
  45. "get": {
  46. "operationId": "global.event",
  47. "summary": "Get global events",
  48. "description": "Subscribe to global events from the OpenCode system using server-sent events.",
  49. "responses": {
  50. "200": {
  51. "description": "Event stream",
  52. "content": {
  53. "text/event-stream": {
  54. "schema": {
  55. "$ref": "#/components/schemas/GlobalEvent"
  56. }
  57. }
  58. }
  59. }
  60. },
  61. "x-codeSamples": [
  62. {
  63. "lang": "js",
  64. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.event({\n ...\n})"
  65. }
  66. ]
  67. }
  68. },
  69. "/global/config": {
  70. "get": {
  71. "operationId": "global.config.get",
  72. "summary": "Get global configuration",
  73. "description": "Retrieve the current global OpenCode configuration settings and preferences.",
  74. "responses": {
  75. "200": {
  76. "description": "Get global config info",
  77. "content": {
  78. "application/json": {
  79. "schema": {
  80. "$ref": "#/components/schemas/Config"
  81. }
  82. }
  83. }
  84. }
  85. },
  86. "x-codeSamples": [
  87. {
  88. "lang": "js",
  89. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.config.get({\n ...\n})"
  90. }
  91. ]
  92. },
  93. "patch": {
  94. "operationId": "global.config.update",
  95. "summary": "Update global configuration",
  96. "description": "Update global OpenCode configuration settings and preferences.",
  97. "responses": {
  98. "200": {
  99. "description": "Successfully updated global config",
  100. "content": {
  101. "application/json": {
  102. "schema": {
  103. "$ref": "#/components/schemas/Config"
  104. }
  105. }
  106. }
  107. },
  108. "400": {
  109. "description": "Bad request",
  110. "content": {
  111. "application/json": {
  112. "schema": {
  113. "$ref": "#/components/schemas/BadRequestError"
  114. }
  115. }
  116. }
  117. }
  118. },
  119. "requestBody": {
  120. "content": {
  121. "application/json": {
  122. "schema": {
  123. "$ref": "#/components/schemas/Config"
  124. }
  125. }
  126. }
  127. },
  128. "x-codeSamples": [
  129. {
  130. "lang": "js",
  131. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.config.update({\n ...\n})"
  132. }
  133. ]
  134. }
  135. },
  136. "/global/dispose": {
  137. "post": {
  138. "operationId": "global.dispose",
  139. "summary": "Dispose instance",
  140. "description": "Clean up and dispose all OpenCode instances, releasing all resources.",
  141. "responses": {
  142. "200": {
  143. "description": "Global disposed",
  144. "content": {
  145. "application/json": {
  146. "schema": {
  147. "type": "boolean"
  148. }
  149. }
  150. }
  151. }
  152. },
  153. "x-codeSamples": [
  154. {
  155. "lang": "js",
  156. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.dispose({\n ...\n})"
  157. }
  158. ]
  159. }
  160. },
  161. "/global/upgrade": {
  162. "post": {
  163. "operationId": "global.upgrade",
  164. "summary": "Upgrade opencode",
  165. "description": "Upgrade opencode to the specified version or latest if not specified.",
  166. "responses": {
  167. "200": {
  168. "description": "Upgrade result",
  169. "content": {
  170. "application/json": {
  171. "schema": {
  172. "anyOf": [
  173. {
  174. "type": "object",
  175. "properties": {
  176. "success": {
  177. "type": "boolean",
  178. "const": true
  179. },
  180. "version": {
  181. "type": "string"
  182. }
  183. },
  184. "required": ["success", "version"]
  185. },
  186. {
  187. "type": "object",
  188. "properties": {
  189. "success": {
  190. "type": "boolean",
  191. "const": false
  192. },
  193. "error": {
  194. "type": "string"
  195. }
  196. },
  197. "required": ["success", "error"]
  198. }
  199. ]
  200. }
  201. }
  202. }
  203. },
  204. "400": {
  205. "description": "Bad request",
  206. "content": {
  207. "application/json": {
  208. "schema": {
  209. "$ref": "#/components/schemas/BadRequestError"
  210. }
  211. }
  212. }
  213. }
  214. },
  215. "requestBody": {
  216. "content": {
  217. "application/json": {
  218. "schema": {
  219. "type": "object",
  220. "properties": {
  221. "target": {
  222. "type": "string"
  223. }
  224. }
  225. }
  226. }
  227. }
  228. },
  229. "x-codeSamples": [
  230. {
  231. "lang": "js",
  232. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.upgrade({\n ...\n})"
  233. }
  234. ]
  235. }
  236. },
  237. "/auth/{providerID}": {
  238. "put": {
  239. "operationId": "auth.set",
  240. "summary": "Set auth credentials",
  241. "description": "Set authentication credentials",
  242. "responses": {
  243. "200": {
  244. "description": "Successfully set authentication credentials",
  245. "content": {
  246. "application/json": {
  247. "schema": {
  248. "type": "boolean"
  249. }
  250. }
  251. }
  252. },
  253. "400": {
  254. "description": "Bad request",
  255. "content": {
  256. "application/json": {
  257. "schema": {
  258. "$ref": "#/components/schemas/BadRequestError"
  259. }
  260. }
  261. }
  262. }
  263. },
  264. "parameters": [
  265. {
  266. "in": "path",
  267. "name": "providerID",
  268. "schema": {
  269. "type": "string"
  270. },
  271. "required": true
  272. }
  273. ],
  274. "requestBody": {
  275. "content": {
  276. "application/json": {
  277. "schema": {
  278. "$ref": "#/components/schemas/Auth"
  279. }
  280. }
  281. }
  282. },
  283. "x-codeSamples": [
  284. {
  285. "lang": "js",
  286. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.auth.set({\n ...\n})"
  287. }
  288. ]
  289. },
  290. "delete": {
  291. "operationId": "auth.remove",
  292. "summary": "Remove auth credentials",
  293. "description": "Remove authentication credentials",
  294. "responses": {
  295. "200": {
  296. "description": "Successfully removed authentication credentials",
  297. "content": {
  298. "application/json": {
  299. "schema": {
  300. "type": "boolean"
  301. }
  302. }
  303. }
  304. },
  305. "400": {
  306. "description": "Bad request",
  307. "content": {
  308. "application/json": {
  309. "schema": {
  310. "$ref": "#/components/schemas/BadRequestError"
  311. }
  312. }
  313. }
  314. }
  315. },
  316. "parameters": [
  317. {
  318. "in": "path",
  319. "name": "providerID",
  320. "schema": {
  321. "type": "string"
  322. },
  323. "required": true
  324. }
  325. ],
  326. "x-codeSamples": [
  327. {
  328. "lang": "js",
  329. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.auth.remove({\n ...\n})"
  330. }
  331. ]
  332. }
  333. },
  334. "/log": {
  335. "post": {
  336. "operationId": "app.log",
  337. "parameters": [
  338. {
  339. "in": "query",
  340. "name": "directory",
  341. "schema": {
  342. "type": "string"
  343. }
  344. },
  345. {
  346. "in": "query",
  347. "name": "workspace",
  348. "schema": {
  349. "type": "string"
  350. }
  351. }
  352. ],
  353. "summary": "Write log",
  354. "description": "Write a log entry to the server logs with specified level and metadata.",
  355. "responses": {
  356. "200": {
  357. "description": "Log entry written successfully",
  358. "content": {
  359. "application/json": {
  360. "schema": {
  361. "type": "boolean"
  362. }
  363. }
  364. }
  365. },
  366. "400": {
  367. "description": "Bad request",
  368. "content": {
  369. "application/json": {
  370. "schema": {
  371. "$ref": "#/components/schemas/BadRequestError"
  372. }
  373. }
  374. }
  375. }
  376. },
  377. "requestBody": {
  378. "content": {
  379. "application/json": {
  380. "schema": {
  381. "type": "object",
  382. "properties": {
  383. "service": {
  384. "description": "Service name for the log entry",
  385. "type": "string"
  386. },
  387. "level": {
  388. "description": "Log level",
  389. "type": "string",
  390. "enum": ["debug", "info", "error", "warn"]
  391. },
  392. "message": {
  393. "description": "Log message",
  394. "type": "string"
  395. },
  396. "extra": {
  397. "description": "Additional metadata for the log entry",
  398. "type": "object",
  399. "propertyNames": {
  400. "type": "string"
  401. },
  402. "additionalProperties": {}
  403. }
  404. },
  405. "required": ["service", "level", "message"]
  406. }
  407. }
  408. }
  409. },
  410. "x-codeSamples": [
  411. {
  412. "lang": "js",
  413. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.app.log({\n ...\n})"
  414. }
  415. ]
  416. }
  417. },
  418. "/experimental/workspace/adaptor": {
  419. "get": {
  420. "operationId": "experimental.workspace.adaptor.list",
  421. "parameters": [
  422. {
  423. "in": "query",
  424. "name": "directory",
  425. "schema": {
  426. "type": "string"
  427. }
  428. },
  429. {
  430. "in": "query",
  431. "name": "workspace",
  432. "schema": {
  433. "type": "string"
  434. }
  435. }
  436. ],
  437. "summary": "List workspace adaptors",
  438. "description": "List all available workspace adaptors for the current project.",
  439. "responses": {
  440. "200": {
  441. "description": "Workspace adaptors",
  442. "content": {
  443. "application/json": {
  444. "schema": {
  445. "type": "array",
  446. "items": {
  447. "type": "object",
  448. "properties": {
  449. "type": {
  450. "type": "string"
  451. },
  452. "name": {
  453. "type": "string"
  454. },
  455. "description": {
  456. "type": "string"
  457. }
  458. },
  459. "required": ["type", "name", "description"]
  460. }
  461. }
  462. }
  463. }
  464. }
  465. },
  466. "x-codeSamples": [
  467. {
  468. "lang": "js",
  469. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.adaptor.list({\n ...\n})"
  470. }
  471. ]
  472. }
  473. },
  474. "/experimental/workspace": {
  475. "post": {
  476. "operationId": "experimental.workspace.create",
  477. "parameters": [
  478. {
  479. "in": "query",
  480. "name": "directory",
  481. "schema": {
  482. "type": "string"
  483. }
  484. },
  485. {
  486. "in": "query",
  487. "name": "workspace",
  488. "schema": {
  489. "type": "string"
  490. }
  491. }
  492. ],
  493. "summary": "Create workspace",
  494. "description": "Create a workspace for the current project.",
  495. "responses": {
  496. "200": {
  497. "description": "Workspace created",
  498. "content": {
  499. "application/json": {
  500. "schema": {
  501. "$ref": "#/components/schemas/Workspace"
  502. }
  503. }
  504. }
  505. },
  506. "400": {
  507. "description": "Bad request",
  508. "content": {
  509. "application/json": {
  510. "schema": {
  511. "$ref": "#/components/schemas/BadRequestError"
  512. }
  513. }
  514. }
  515. }
  516. },
  517. "requestBody": {
  518. "content": {
  519. "application/json": {
  520. "schema": {
  521. "type": "object",
  522. "properties": {
  523. "id": {
  524. "type": "string",
  525. "pattern": "^wrk.*"
  526. },
  527. "type": {
  528. "type": "string"
  529. },
  530. "branch": {
  531. "anyOf": [
  532. {
  533. "type": "string"
  534. },
  535. {
  536. "type": "null"
  537. }
  538. ]
  539. },
  540. "extra": {
  541. "anyOf": [
  542. {},
  543. {
  544. "type": "null"
  545. }
  546. ]
  547. }
  548. },
  549. "required": ["type", "branch", "extra"]
  550. }
  551. }
  552. }
  553. },
  554. "x-codeSamples": [
  555. {
  556. "lang": "js",
  557. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.create({\n ...\n})"
  558. }
  559. ]
  560. },
  561. "get": {
  562. "operationId": "experimental.workspace.list",
  563. "parameters": [
  564. {
  565. "in": "query",
  566. "name": "directory",
  567. "schema": {
  568. "type": "string"
  569. }
  570. },
  571. {
  572. "in": "query",
  573. "name": "workspace",
  574. "schema": {
  575. "type": "string"
  576. }
  577. }
  578. ],
  579. "summary": "List workspaces",
  580. "description": "List all workspaces.",
  581. "responses": {
  582. "200": {
  583. "description": "Workspaces",
  584. "content": {
  585. "application/json": {
  586. "schema": {
  587. "type": "array",
  588. "items": {
  589. "$ref": "#/components/schemas/Workspace"
  590. }
  591. }
  592. }
  593. }
  594. }
  595. },
  596. "x-codeSamples": [
  597. {
  598. "lang": "js",
  599. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.list({\n ...\n})"
  600. }
  601. ]
  602. }
  603. },
  604. "/experimental/workspace/status": {
  605. "get": {
  606. "operationId": "experimental.workspace.status",
  607. "parameters": [
  608. {
  609. "in": "query",
  610. "name": "directory",
  611. "schema": {
  612. "type": "string"
  613. }
  614. },
  615. {
  616. "in": "query",
  617. "name": "workspace",
  618. "schema": {
  619. "type": "string"
  620. }
  621. }
  622. ],
  623. "summary": "Workspace status",
  624. "description": "Get connection status for workspaces in the current project.",
  625. "responses": {
  626. "200": {
  627. "description": "Workspace status",
  628. "content": {
  629. "application/json": {
  630. "schema": {
  631. "type": "array",
  632. "items": {
  633. "type": "object",
  634. "properties": {
  635. "workspaceID": {
  636. "type": "string",
  637. "pattern": "^wrk.*"
  638. },
  639. "status": {
  640. "type": "string",
  641. "enum": ["connected", "connecting", "disconnected", "error"]
  642. }
  643. },
  644. "required": ["workspaceID", "status"]
  645. }
  646. }
  647. }
  648. }
  649. }
  650. },
  651. "x-codeSamples": [
  652. {
  653. "lang": "js",
  654. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.status({\n ...\n})"
  655. }
  656. ]
  657. }
  658. },
  659. "/experimental/workspace/{id}": {
  660. "delete": {
  661. "operationId": "experimental.workspace.remove",
  662. "parameters": [
  663. {
  664. "in": "query",
  665. "name": "directory",
  666. "schema": {
  667. "type": "string"
  668. }
  669. },
  670. {
  671. "in": "query",
  672. "name": "workspace",
  673. "schema": {
  674. "type": "string"
  675. }
  676. },
  677. {
  678. "in": "path",
  679. "name": "id",
  680. "schema": {
  681. "type": "string",
  682. "pattern": "^wrk.*"
  683. },
  684. "required": true
  685. }
  686. ],
  687. "summary": "Remove workspace",
  688. "description": "Remove an existing workspace.",
  689. "responses": {
  690. "200": {
  691. "description": "Workspace removed",
  692. "content": {
  693. "application/json": {
  694. "schema": {
  695. "$ref": "#/components/schemas/Workspace"
  696. }
  697. }
  698. }
  699. },
  700. "400": {
  701. "description": "Bad request",
  702. "content": {
  703. "application/json": {
  704. "schema": {
  705. "$ref": "#/components/schemas/BadRequestError"
  706. }
  707. }
  708. }
  709. }
  710. },
  711. "x-codeSamples": [
  712. {
  713. "lang": "js",
  714. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.remove({\n ...\n})"
  715. }
  716. ]
  717. }
  718. },
  719. "/experimental/workspace/{id}/session-restore": {
  720. "post": {
  721. "operationId": "experimental.workspace.sessionRestore",
  722. "parameters": [
  723. {
  724. "in": "query",
  725. "name": "directory",
  726. "schema": {
  727. "type": "string"
  728. }
  729. },
  730. {
  731. "in": "query",
  732. "name": "workspace",
  733. "schema": {
  734. "type": "string"
  735. }
  736. },
  737. {
  738. "in": "path",
  739. "name": "id",
  740. "schema": {
  741. "type": "string",
  742. "pattern": "^wrk.*"
  743. },
  744. "required": true
  745. }
  746. ],
  747. "summary": "Restore session into workspace",
  748. "description": "Replay a session's sync events into the target workspace in batches.",
  749. "responses": {
  750. "200": {
  751. "description": "Session replay started",
  752. "content": {
  753. "application/json": {
  754. "schema": {
  755. "type": "object",
  756. "properties": {
  757. "total": {
  758. "type": "integer",
  759. "minimum": 0,
  760. "maximum": 9007199254740991
  761. }
  762. },
  763. "required": ["total"]
  764. }
  765. }
  766. }
  767. },
  768. "400": {
  769. "description": "Bad request",
  770. "content": {
  771. "application/json": {
  772. "schema": {
  773. "$ref": "#/components/schemas/BadRequestError"
  774. }
  775. }
  776. }
  777. }
  778. },
  779. "requestBody": {
  780. "content": {
  781. "application/json": {
  782. "schema": {
  783. "type": "object",
  784. "properties": {
  785. "sessionID": {
  786. "type": "string",
  787. "pattern": "^ses.*"
  788. }
  789. },
  790. "required": ["sessionID"]
  791. }
  792. }
  793. }
  794. },
  795. "x-codeSamples": [
  796. {
  797. "lang": "js",
  798. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.sessionRestore({\n ...\n})"
  799. }
  800. ]
  801. }
  802. },
  803. "/project": {
  804. "get": {
  805. "operationId": "project.list",
  806. "parameters": [
  807. {
  808. "in": "query",
  809. "name": "directory",
  810. "schema": {
  811. "type": "string"
  812. }
  813. },
  814. {
  815. "in": "query",
  816. "name": "workspace",
  817. "schema": {
  818. "type": "string"
  819. }
  820. }
  821. ],
  822. "summary": "List all projects",
  823. "description": "Get a list of projects that have been opened with OpenCode.",
  824. "responses": {
  825. "200": {
  826. "description": "List of projects",
  827. "content": {
  828. "application/json": {
  829. "schema": {
  830. "type": "array",
  831. "items": {
  832. "$ref": "#/components/schemas/Project"
  833. }
  834. }
  835. }
  836. }
  837. }
  838. },
  839. "x-codeSamples": [
  840. {
  841. "lang": "js",
  842. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.list({\n ...\n})"
  843. }
  844. ]
  845. }
  846. },
  847. "/project/current": {
  848. "get": {
  849. "operationId": "project.current",
  850. "parameters": [
  851. {
  852. "in": "query",
  853. "name": "directory",
  854. "schema": {
  855. "type": "string"
  856. }
  857. },
  858. {
  859. "in": "query",
  860. "name": "workspace",
  861. "schema": {
  862. "type": "string"
  863. }
  864. }
  865. ],
  866. "summary": "Get current project",
  867. "description": "Retrieve the currently active project that OpenCode is working with.",
  868. "responses": {
  869. "200": {
  870. "description": "Current project information",
  871. "content": {
  872. "application/json": {
  873. "schema": {
  874. "$ref": "#/components/schemas/Project"
  875. }
  876. }
  877. }
  878. }
  879. },
  880. "x-codeSamples": [
  881. {
  882. "lang": "js",
  883. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.current({\n ...\n})"
  884. }
  885. ]
  886. }
  887. },
  888. "/project/git/init": {
  889. "post": {
  890. "operationId": "project.initGit",
  891. "parameters": [
  892. {
  893. "in": "query",
  894. "name": "directory",
  895. "schema": {
  896. "type": "string"
  897. }
  898. },
  899. {
  900. "in": "query",
  901. "name": "workspace",
  902. "schema": {
  903. "type": "string"
  904. }
  905. }
  906. ],
  907. "summary": "Initialize git repository",
  908. "description": "Create a git repository for the current project and return the refreshed project info.",
  909. "responses": {
  910. "200": {
  911. "description": "Project information after git initialization",
  912. "content": {
  913. "application/json": {
  914. "schema": {
  915. "$ref": "#/components/schemas/Project"
  916. }
  917. }
  918. }
  919. }
  920. },
  921. "x-codeSamples": [
  922. {
  923. "lang": "js",
  924. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.initGit({\n ...\n})"
  925. }
  926. ]
  927. }
  928. },
  929. "/project/{projectID}": {
  930. "patch": {
  931. "operationId": "project.update",
  932. "parameters": [
  933. {
  934. "in": "query",
  935. "name": "directory",
  936. "schema": {
  937. "type": "string"
  938. }
  939. },
  940. {
  941. "in": "query",
  942. "name": "workspace",
  943. "schema": {
  944. "type": "string"
  945. }
  946. },
  947. {
  948. "in": "path",
  949. "name": "projectID",
  950. "schema": {
  951. "type": "string"
  952. },
  953. "required": true
  954. }
  955. ],
  956. "summary": "Update project",
  957. "description": "Update project properties such as name, icon, and commands.",
  958. "responses": {
  959. "200": {
  960. "description": "Updated project information",
  961. "content": {
  962. "application/json": {
  963. "schema": {
  964. "$ref": "#/components/schemas/Project"
  965. }
  966. }
  967. }
  968. },
  969. "400": {
  970. "description": "Bad request",
  971. "content": {
  972. "application/json": {
  973. "schema": {
  974. "$ref": "#/components/schemas/BadRequestError"
  975. }
  976. }
  977. }
  978. },
  979. "404": {
  980. "description": "Not found",
  981. "content": {
  982. "application/json": {
  983. "schema": {
  984. "$ref": "#/components/schemas/NotFoundError"
  985. }
  986. }
  987. }
  988. }
  989. },
  990. "requestBody": {
  991. "content": {
  992. "application/json": {
  993. "schema": {
  994. "type": "object",
  995. "properties": {
  996. "name": {
  997. "type": "string"
  998. },
  999. "icon": {
  1000. "type": "object",
  1001. "properties": {
  1002. "url": {
  1003. "type": "string"
  1004. },
  1005. "override": {
  1006. "type": "string"
  1007. },
  1008. "color": {
  1009. "type": "string"
  1010. }
  1011. }
  1012. },
  1013. "commands": {
  1014. "type": "object",
  1015. "properties": {
  1016. "start": {
  1017. "description": "Startup script to run when creating a new workspace (worktree)",
  1018. "type": "string"
  1019. }
  1020. }
  1021. }
  1022. }
  1023. }
  1024. }
  1025. }
  1026. },
  1027. "x-codeSamples": [
  1028. {
  1029. "lang": "js",
  1030. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.update({\n ...\n})"
  1031. }
  1032. ]
  1033. }
  1034. },
  1035. "/pty": {
  1036. "get": {
  1037. "operationId": "pty.list",
  1038. "parameters": [
  1039. {
  1040. "in": "query",
  1041. "name": "directory",
  1042. "schema": {
  1043. "type": "string"
  1044. }
  1045. },
  1046. {
  1047. "in": "query",
  1048. "name": "workspace",
  1049. "schema": {
  1050. "type": "string"
  1051. }
  1052. }
  1053. ],
  1054. "summary": "List PTY sessions",
  1055. "description": "Get a list of all active pseudo-terminal (PTY) sessions managed by OpenCode.",
  1056. "responses": {
  1057. "200": {
  1058. "description": "List of sessions",
  1059. "content": {
  1060. "application/json": {
  1061. "schema": {
  1062. "type": "array",
  1063. "items": {
  1064. "$ref": "#/components/schemas/Pty"
  1065. }
  1066. }
  1067. }
  1068. }
  1069. }
  1070. },
  1071. "x-codeSamples": [
  1072. {
  1073. "lang": "js",
  1074. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.list({\n ...\n})"
  1075. }
  1076. ]
  1077. },
  1078. "post": {
  1079. "operationId": "pty.create",
  1080. "parameters": [
  1081. {
  1082. "in": "query",
  1083. "name": "directory",
  1084. "schema": {
  1085. "type": "string"
  1086. }
  1087. },
  1088. {
  1089. "in": "query",
  1090. "name": "workspace",
  1091. "schema": {
  1092. "type": "string"
  1093. }
  1094. }
  1095. ],
  1096. "summary": "Create PTY session",
  1097. "description": "Create a new pseudo-terminal (PTY) session for running shell commands and processes.",
  1098. "responses": {
  1099. "200": {
  1100. "description": "Created session",
  1101. "content": {
  1102. "application/json": {
  1103. "schema": {
  1104. "$ref": "#/components/schemas/Pty"
  1105. }
  1106. }
  1107. }
  1108. },
  1109. "400": {
  1110. "description": "Bad request",
  1111. "content": {
  1112. "application/json": {
  1113. "schema": {
  1114. "$ref": "#/components/schemas/BadRequestError"
  1115. }
  1116. }
  1117. }
  1118. }
  1119. },
  1120. "requestBody": {
  1121. "content": {
  1122. "application/json": {
  1123. "schema": {
  1124. "type": "object",
  1125. "properties": {
  1126. "command": {
  1127. "type": "string"
  1128. },
  1129. "args": {
  1130. "type": "array",
  1131. "items": {
  1132. "type": "string"
  1133. }
  1134. },
  1135. "cwd": {
  1136. "type": "string"
  1137. },
  1138. "title": {
  1139. "type": "string"
  1140. },
  1141. "env": {
  1142. "type": "object",
  1143. "propertyNames": {
  1144. "type": "string"
  1145. },
  1146. "additionalProperties": {
  1147. "type": "string"
  1148. }
  1149. }
  1150. }
  1151. }
  1152. }
  1153. }
  1154. },
  1155. "x-codeSamples": [
  1156. {
  1157. "lang": "js",
  1158. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.create({\n ...\n})"
  1159. }
  1160. ]
  1161. }
  1162. },
  1163. "/pty/{ptyID}": {
  1164. "get": {
  1165. "operationId": "pty.get",
  1166. "parameters": [
  1167. {
  1168. "in": "query",
  1169. "name": "directory",
  1170. "schema": {
  1171. "type": "string"
  1172. }
  1173. },
  1174. {
  1175. "in": "query",
  1176. "name": "workspace",
  1177. "schema": {
  1178. "type": "string"
  1179. }
  1180. },
  1181. {
  1182. "in": "path",
  1183. "name": "ptyID",
  1184. "schema": {
  1185. "type": "string",
  1186. "pattern": "^pty.*"
  1187. },
  1188. "required": true
  1189. }
  1190. ],
  1191. "summary": "Get PTY session",
  1192. "description": "Retrieve detailed information about a specific pseudo-terminal (PTY) session.",
  1193. "responses": {
  1194. "200": {
  1195. "description": "Session info",
  1196. "content": {
  1197. "application/json": {
  1198. "schema": {
  1199. "$ref": "#/components/schemas/Pty"
  1200. }
  1201. }
  1202. }
  1203. },
  1204. "404": {
  1205. "description": "Not found",
  1206. "content": {
  1207. "application/json": {
  1208. "schema": {
  1209. "$ref": "#/components/schemas/NotFoundError"
  1210. }
  1211. }
  1212. }
  1213. }
  1214. },
  1215. "x-codeSamples": [
  1216. {
  1217. "lang": "js",
  1218. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.get({\n ...\n})"
  1219. }
  1220. ]
  1221. },
  1222. "put": {
  1223. "operationId": "pty.update",
  1224. "parameters": [
  1225. {
  1226. "in": "query",
  1227. "name": "directory",
  1228. "schema": {
  1229. "type": "string"
  1230. }
  1231. },
  1232. {
  1233. "in": "query",
  1234. "name": "workspace",
  1235. "schema": {
  1236. "type": "string"
  1237. }
  1238. },
  1239. {
  1240. "in": "path",
  1241. "name": "ptyID",
  1242. "schema": {
  1243. "type": "string",
  1244. "pattern": "^pty.*"
  1245. },
  1246. "required": true
  1247. }
  1248. ],
  1249. "summary": "Update PTY session",
  1250. "description": "Update properties of an existing pseudo-terminal (PTY) session.",
  1251. "responses": {
  1252. "200": {
  1253. "description": "Updated session",
  1254. "content": {
  1255. "application/json": {
  1256. "schema": {
  1257. "$ref": "#/components/schemas/Pty"
  1258. }
  1259. }
  1260. }
  1261. },
  1262. "400": {
  1263. "description": "Bad request",
  1264. "content": {
  1265. "application/json": {
  1266. "schema": {
  1267. "$ref": "#/components/schemas/BadRequestError"
  1268. }
  1269. }
  1270. }
  1271. }
  1272. },
  1273. "requestBody": {
  1274. "content": {
  1275. "application/json": {
  1276. "schema": {
  1277. "type": "object",
  1278. "properties": {
  1279. "title": {
  1280. "type": "string"
  1281. },
  1282. "size": {
  1283. "type": "object",
  1284. "properties": {
  1285. "rows": {
  1286. "type": "number"
  1287. },
  1288. "cols": {
  1289. "type": "number"
  1290. }
  1291. },
  1292. "required": ["rows", "cols"]
  1293. }
  1294. }
  1295. }
  1296. }
  1297. }
  1298. },
  1299. "x-codeSamples": [
  1300. {
  1301. "lang": "js",
  1302. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.update({\n ...\n})"
  1303. }
  1304. ]
  1305. },
  1306. "delete": {
  1307. "operationId": "pty.remove",
  1308. "parameters": [
  1309. {
  1310. "in": "query",
  1311. "name": "directory",
  1312. "schema": {
  1313. "type": "string"
  1314. }
  1315. },
  1316. {
  1317. "in": "query",
  1318. "name": "workspace",
  1319. "schema": {
  1320. "type": "string"
  1321. }
  1322. },
  1323. {
  1324. "in": "path",
  1325. "name": "ptyID",
  1326. "schema": {
  1327. "type": "string",
  1328. "pattern": "^pty.*"
  1329. },
  1330. "required": true
  1331. }
  1332. ],
  1333. "summary": "Remove PTY session",
  1334. "description": "Remove and terminate a specific pseudo-terminal (PTY) session.",
  1335. "responses": {
  1336. "200": {
  1337. "description": "Session removed",
  1338. "content": {
  1339. "application/json": {
  1340. "schema": {
  1341. "type": "boolean"
  1342. }
  1343. }
  1344. }
  1345. },
  1346. "404": {
  1347. "description": "Not found",
  1348. "content": {
  1349. "application/json": {
  1350. "schema": {
  1351. "$ref": "#/components/schemas/NotFoundError"
  1352. }
  1353. }
  1354. }
  1355. }
  1356. },
  1357. "x-codeSamples": [
  1358. {
  1359. "lang": "js",
  1360. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.remove({\n ...\n})"
  1361. }
  1362. ]
  1363. }
  1364. },
  1365. "/pty/{ptyID}/connect": {
  1366. "get": {
  1367. "operationId": "pty.connect",
  1368. "parameters": [
  1369. {
  1370. "in": "query",
  1371. "name": "directory",
  1372. "schema": {
  1373. "type": "string"
  1374. }
  1375. },
  1376. {
  1377. "in": "query",
  1378. "name": "workspace",
  1379. "schema": {
  1380. "type": "string"
  1381. }
  1382. },
  1383. {
  1384. "in": "path",
  1385. "name": "ptyID",
  1386. "schema": {
  1387. "type": "string",
  1388. "pattern": "^pty.*"
  1389. },
  1390. "required": true
  1391. }
  1392. ],
  1393. "summary": "Connect to PTY session",
  1394. "description": "Establish a WebSocket connection to interact with a pseudo-terminal (PTY) session in real-time.",
  1395. "responses": {
  1396. "200": {
  1397. "description": "Connected session",
  1398. "content": {
  1399. "application/json": {
  1400. "schema": {
  1401. "type": "boolean"
  1402. }
  1403. }
  1404. }
  1405. },
  1406. "404": {
  1407. "description": "Not found",
  1408. "content": {
  1409. "application/json": {
  1410. "schema": {
  1411. "$ref": "#/components/schemas/NotFoundError"
  1412. }
  1413. }
  1414. }
  1415. }
  1416. },
  1417. "x-codeSamples": [
  1418. {
  1419. "lang": "js",
  1420. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.connect({\n ...\n})"
  1421. }
  1422. ]
  1423. }
  1424. },
  1425. "/config": {
  1426. "get": {
  1427. "operationId": "config.get",
  1428. "parameters": [
  1429. {
  1430. "in": "query",
  1431. "name": "directory",
  1432. "schema": {
  1433. "type": "string"
  1434. }
  1435. },
  1436. {
  1437. "in": "query",
  1438. "name": "workspace",
  1439. "schema": {
  1440. "type": "string"
  1441. }
  1442. }
  1443. ],
  1444. "summary": "Get configuration",
  1445. "description": "Retrieve the current OpenCode configuration settings and preferences.",
  1446. "responses": {
  1447. "200": {
  1448. "description": "Get config info",
  1449. "content": {
  1450. "application/json": {
  1451. "schema": {
  1452. "$ref": "#/components/schemas/Config"
  1453. }
  1454. }
  1455. }
  1456. }
  1457. },
  1458. "x-codeSamples": [
  1459. {
  1460. "lang": "js",
  1461. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.config.get({\n ...\n})"
  1462. }
  1463. ]
  1464. },
  1465. "patch": {
  1466. "operationId": "config.update",
  1467. "parameters": [
  1468. {
  1469. "in": "query",
  1470. "name": "directory",
  1471. "schema": {
  1472. "type": "string"
  1473. }
  1474. },
  1475. {
  1476. "in": "query",
  1477. "name": "workspace",
  1478. "schema": {
  1479. "type": "string"
  1480. }
  1481. }
  1482. ],
  1483. "summary": "Update configuration",
  1484. "description": "Update OpenCode configuration settings and preferences.",
  1485. "responses": {
  1486. "200": {
  1487. "description": "Successfully updated config",
  1488. "content": {
  1489. "application/json": {
  1490. "schema": {
  1491. "$ref": "#/components/schemas/Config"
  1492. }
  1493. }
  1494. }
  1495. },
  1496. "400": {
  1497. "description": "Bad request",
  1498. "content": {
  1499. "application/json": {
  1500. "schema": {
  1501. "$ref": "#/components/schemas/BadRequestError"
  1502. }
  1503. }
  1504. }
  1505. }
  1506. },
  1507. "requestBody": {
  1508. "content": {
  1509. "application/json": {
  1510. "schema": {
  1511. "$ref": "#/components/schemas/Config"
  1512. }
  1513. }
  1514. }
  1515. },
  1516. "x-codeSamples": [
  1517. {
  1518. "lang": "js",
  1519. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.config.update({\n ...\n})"
  1520. }
  1521. ]
  1522. }
  1523. },
  1524. "/config/providers": {
  1525. "get": {
  1526. "operationId": "config.providers",
  1527. "parameters": [
  1528. {
  1529. "in": "query",
  1530. "name": "directory",
  1531. "schema": {
  1532. "type": "string"
  1533. }
  1534. },
  1535. {
  1536. "in": "query",
  1537. "name": "workspace",
  1538. "schema": {
  1539. "type": "string"
  1540. }
  1541. }
  1542. ],
  1543. "summary": "List config providers",
  1544. "description": "Get a list of all configured AI providers and their default models.",
  1545. "responses": {
  1546. "200": {
  1547. "description": "List of providers",
  1548. "content": {
  1549. "application/json": {
  1550. "schema": {
  1551. "type": "object",
  1552. "properties": {
  1553. "providers": {
  1554. "type": "array",
  1555. "items": {
  1556. "$ref": "#/components/schemas/Provider"
  1557. }
  1558. },
  1559. "default": {
  1560. "type": "object",
  1561. "propertyNames": {
  1562. "type": "string"
  1563. },
  1564. "additionalProperties": {
  1565. "type": "string"
  1566. }
  1567. }
  1568. },
  1569. "required": ["providers", "default"]
  1570. }
  1571. }
  1572. }
  1573. }
  1574. },
  1575. "x-codeSamples": [
  1576. {
  1577. "lang": "js",
  1578. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.config.providers({\n ...\n})"
  1579. }
  1580. ]
  1581. }
  1582. },
  1583. "/experimental/console": {
  1584. "get": {
  1585. "operationId": "experimental.console.get",
  1586. "parameters": [
  1587. {
  1588. "in": "query",
  1589. "name": "directory",
  1590. "schema": {
  1591. "type": "string"
  1592. }
  1593. },
  1594. {
  1595. "in": "query",
  1596. "name": "workspace",
  1597. "schema": {
  1598. "type": "string"
  1599. }
  1600. }
  1601. ],
  1602. "summary": "Get active Console provider metadata",
  1603. "description": "Get the active Console org name and the set of provider IDs managed by that Console org.",
  1604. "responses": {
  1605. "200": {
  1606. "description": "Active Console provider metadata",
  1607. "content": {
  1608. "application/json": {
  1609. "schema": {
  1610. "$ref": "#/components/schemas/ConsoleState"
  1611. }
  1612. }
  1613. }
  1614. }
  1615. },
  1616. "x-codeSamples": [
  1617. {
  1618. "lang": "js",
  1619. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.console.get({\n ...\n})"
  1620. }
  1621. ]
  1622. }
  1623. },
  1624. "/experimental/console/orgs": {
  1625. "get": {
  1626. "operationId": "experimental.console.listOrgs",
  1627. "parameters": [
  1628. {
  1629. "in": "query",
  1630. "name": "directory",
  1631. "schema": {
  1632. "type": "string"
  1633. }
  1634. },
  1635. {
  1636. "in": "query",
  1637. "name": "workspace",
  1638. "schema": {
  1639. "type": "string"
  1640. }
  1641. }
  1642. ],
  1643. "summary": "List switchable Console orgs",
  1644. "description": "Get the available Console orgs across logged-in accounts, including the current active org.",
  1645. "responses": {
  1646. "200": {
  1647. "description": "Switchable Console orgs",
  1648. "content": {
  1649. "application/json": {
  1650. "schema": {
  1651. "type": "object",
  1652. "properties": {
  1653. "orgs": {
  1654. "type": "array",
  1655. "items": {
  1656. "type": "object",
  1657. "properties": {
  1658. "accountID": {
  1659. "type": "string"
  1660. },
  1661. "accountEmail": {
  1662. "type": "string"
  1663. },
  1664. "accountUrl": {
  1665. "type": "string"
  1666. },
  1667. "orgID": {
  1668. "type": "string"
  1669. },
  1670. "orgName": {
  1671. "type": "string"
  1672. },
  1673. "active": {
  1674. "type": "boolean"
  1675. }
  1676. },
  1677. "required": ["accountID", "accountEmail", "accountUrl", "orgID", "orgName", "active"]
  1678. }
  1679. }
  1680. },
  1681. "required": ["orgs"]
  1682. }
  1683. }
  1684. }
  1685. }
  1686. },
  1687. "x-codeSamples": [
  1688. {
  1689. "lang": "js",
  1690. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.console.listOrgs({\n ...\n})"
  1691. }
  1692. ]
  1693. }
  1694. },
  1695. "/experimental/console/switch": {
  1696. "post": {
  1697. "operationId": "experimental.console.switchOrg",
  1698. "parameters": [
  1699. {
  1700. "in": "query",
  1701. "name": "directory",
  1702. "schema": {
  1703. "type": "string"
  1704. }
  1705. },
  1706. {
  1707. "in": "query",
  1708. "name": "workspace",
  1709. "schema": {
  1710. "type": "string"
  1711. }
  1712. }
  1713. ],
  1714. "summary": "Switch active Console org",
  1715. "description": "Persist a new active Console account/org selection for the current local OpenCode state.",
  1716. "responses": {
  1717. "200": {
  1718. "description": "Switch success",
  1719. "content": {
  1720. "application/json": {
  1721. "schema": {
  1722. "type": "boolean"
  1723. }
  1724. }
  1725. }
  1726. }
  1727. },
  1728. "requestBody": {
  1729. "content": {
  1730. "application/json": {
  1731. "schema": {
  1732. "type": "object",
  1733. "properties": {
  1734. "accountID": {
  1735. "type": "string"
  1736. },
  1737. "orgID": {
  1738. "type": "string"
  1739. }
  1740. },
  1741. "required": ["accountID", "orgID"]
  1742. }
  1743. }
  1744. }
  1745. },
  1746. "x-codeSamples": [
  1747. {
  1748. "lang": "js",
  1749. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.console.switchOrg({\n ...\n})"
  1750. }
  1751. ]
  1752. }
  1753. },
  1754. "/experimental/tool/ids": {
  1755. "get": {
  1756. "operationId": "tool.ids",
  1757. "parameters": [
  1758. {
  1759. "in": "query",
  1760. "name": "directory",
  1761. "schema": {
  1762. "type": "string"
  1763. }
  1764. },
  1765. {
  1766. "in": "query",
  1767. "name": "workspace",
  1768. "schema": {
  1769. "type": "string"
  1770. }
  1771. }
  1772. ],
  1773. "summary": "List tool IDs",
  1774. "description": "Get a list of all available tool IDs, including both built-in tools and dynamically registered tools.",
  1775. "responses": {
  1776. "200": {
  1777. "description": "Tool IDs",
  1778. "content": {
  1779. "application/json": {
  1780. "schema": {
  1781. "$ref": "#/components/schemas/ToolIDs"
  1782. }
  1783. }
  1784. }
  1785. },
  1786. "400": {
  1787. "description": "Bad request",
  1788. "content": {
  1789. "application/json": {
  1790. "schema": {
  1791. "$ref": "#/components/schemas/BadRequestError"
  1792. }
  1793. }
  1794. }
  1795. }
  1796. },
  1797. "x-codeSamples": [
  1798. {
  1799. "lang": "js",
  1800. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tool.ids({\n ...\n})"
  1801. }
  1802. ]
  1803. }
  1804. },
  1805. "/experimental/tool": {
  1806. "get": {
  1807. "operationId": "tool.list",
  1808. "parameters": [
  1809. {
  1810. "in": "query",
  1811. "name": "directory",
  1812. "schema": {
  1813. "type": "string"
  1814. }
  1815. },
  1816. {
  1817. "in": "query",
  1818. "name": "workspace",
  1819. "schema": {
  1820. "type": "string"
  1821. }
  1822. },
  1823. {
  1824. "in": "query",
  1825. "name": "provider",
  1826. "schema": {
  1827. "type": "string"
  1828. },
  1829. "required": true
  1830. },
  1831. {
  1832. "in": "query",
  1833. "name": "model",
  1834. "schema": {
  1835. "type": "string"
  1836. },
  1837. "required": true
  1838. }
  1839. ],
  1840. "summary": "List tools",
  1841. "description": "Get a list of available tools with their JSON schema parameters for a specific provider and model combination.",
  1842. "responses": {
  1843. "200": {
  1844. "description": "Tools",
  1845. "content": {
  1846. "application/json": {
  1847. "schema": {
  1848. "$ref": "#/components/schemas/ToolList"
  1849. }
  1850. }
  1851. }
  1852. },
  1853. "400": {
  1854. "description": "Bad request",
  1855. "content": {
  1856. "application/json": {
  1857. "schema": {
  1858. "$ref": "#/components/schemas/BadRequestError"
  1859. }
  1860. }
  1861. }
  1862. }
  1863. },
  1864. "x-codeSamples": [
  1865. {
  1866. "lang": "js",
  1867. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tool.list({\n ...\n})"
  1868. }
  1869. ]
  1870. }
  1871. },
  1872. "/experimental/worktree": {
  1873. "post": {
  1874. "operationId": "worktree.create",
  1875. "parameters": [
  1876. {
  1877. "in": "query",
  1878. "name": "directory",
  1879. "schema": {
  1880. "type": "string"
  1881. }
  1882. },
  1883. {
  1884. "in": "query",
  1885. "name": "workspace",
  1886. "schema": {
  1887. "type": "string"
  1888. }
  1889. }
  1890. ],
  1891. "summary": "Create worktree",
  1892. "description": "Create a new git worktree for the current project and run any configured startup scripts.",
  1893. "responses": {
  1894. "200": {
  1895. "description": "Worktree created",
  1896. "content": {
  1897. "application/json": {
  1898. "schema": {
  1899. "$ref": "#/components/schemas/Worktree"
  1900. }
  1901. }
  1902. }
  1903. },
  1904. "400": {
  1905. "description": "Bad request",
  1906. "content": {
  1907. "application/json": {
  1908. "schema": {
  1909. "$ref": "#/components/schemas/BadRequestError"
  1910. }
  1911. }
  1912. }
  1913. }
  1914. },
  1915. "requestBody": {
  1916. "content": {
  1917. "application/json": {
  1918. "schema": {
  1919. "$ref": "#/components/schemas/WorktreeCreateInput"
  1920. }
  1921. }
  1922. }
  1923. },
  1924. "x-codeSamples": [
  1925. {
  1926. "lang": "js",
  1927. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.create({\n ...\n})"
  1928. }
  1929. ]
  1930. },
  1931. "get": {
  1932. "operationId": "worktree.list",
  1933. "parameters": [
  1934. {
  1935. "in": "query",
  1936. "name": "directory",
  1937. "schema": {
  1938. "type": "string"
  1939. }
  1940. },
  1941. {
  1942. "in": "query",
  1943. "name": "workspace",
  1944. "schema": {
  1945. "type": "string"
  1946. }
  1947. }
  1948. ],
  1949. "summary": "List worktrees",
  1950. "description": "List all sandbox worktrees for the current project.",
  1951. "responses": {
  1952. "200": {
  1953. "description": "List of worktree directories",
  1954. "content": {
  1955. "application/json": {
  1956. "schema": {
  1957. "type": "array",
  1958. "items": {
  1959. "type": "string"
  1960. }
  1961. }
  1962. }
  1963. }
  1964. }
  1965. },
  1966. "x-codeSamples": [
  1967. {
  1968. "lang": "js",
  1969. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.list({\n ...\n})"
  1970. }
  1971. ]
  1972. },
  1973. "delete": {
  1974. "operationId": "worktree.remove",
  1975. "parameters": [
  1976. {
  1977. "in": "query",
  1978. "name": "directory",
  1979. "schema": {
  1980. "type": "string"
  1981. }
  1982. },
  1983. {
  1984. "in": "query",
  1985. "name": "workspace",
  1986. "schema": {
  1987. "type": "string"
  1988. }
  1989. }
  1990. ],
  1991. "summary": "Remove worktree",
  1992. "description": "Remove a git worktree and delete its branch.",
  1993. "responses": {
  1994. "200": {
  1995. "description": "Worktree removed",
  1996. "content": {
  1997. "application/json": {
  1998. "schema": {
  1999. "type": "boolean"
  2000. }
  2001. }
  2002. }
  2003. },
  2004. "400": {
  2005. "description": "Bad request",
  2006. "content": {
  2007. "application/json": {
  2008. "schema": {
  2009. "$ref": "#/components/schemas/BadRequestError"
  2010. }
  2011. }
  2012. }
  2013. }
  2014. },
  2015. "requestBody": {
  2016. "content": {
  2017. "application/json": {
  2018. "schema": {
  2019. "$ref": "#/components/schemas/WorktreeRemoveInput"
  2020. }
  2021. }
  2022. }
  2023. },
  2024. "x-codeSamples": [
  2025. {
  2026. "lang": "js",
  2027. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.remove({\n ...\n})"
  2028. }
  2029. ]
  2030. }
  2031. },
  2032. "/experimental/worktree/reset": {
  2033. "post": {
  2034. "operationId": "worktree.reset",
  2035. "parameters": [
  2036. {
  2037. "in": "query",
  2038. "name": "directory",
  2039. "schema": {
  2040. "type": "string"
  2041. }
  2042. },
  2043. {
  2044. "in": "query",
  2045. "name": "workspace",
  2046. "schema": {
  2047. "type": "string"
  2048. }
  2049. }
  2050. ],
  2051. "summary": "Reset worktree",
  2052. "description": "Reset a worktree branch to the primary default branch.",
  2053. "responses": {
  2054. "200": {
  2055. "description": "Worktree reset",
  2056. "content": {
  2057. "application/json": {
  2058. "schema": {
  2059. "type": "boolean"
  2060. }
  2061. }
  2062. }
  2063. },
  2064. "400": {
  2065. "description": "Bad request",
  2066. "content": {
  2067. "application/json": {
  2068. "schema": {
  2069. "$ref": "#/components/schemas/BadRequestError"
  2070. }
  2071. }
  2072. }
  2073. }
  2074. },
  2075. "requestBody": {
  2076. "content": {
  2077. "application/json": {
  2078. "schema": {
  2079. "$ref": "#/components/schemas/WorktreeResetInput"
  2080. }
  2081. }
  2082. }
  2083. },
  2084. "x-codeSamples": [
  2085. {
  2086. "lang": "js",
  2087. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.reset({\n ...\n})"
  2088. }
  2089. ]
  2090. }
  2091. },
  2092. "/experimental/session": {
  2093. "get": {
  2094. "operationId": "experimental.session.list",
  2095. "parameters": [
  2096. {
  2097. "in": "query",
  2098. "name": "directory",
  2099. "schema": {
  2100. "type": "string"
  2101. },
  2102. "description": "Filter sessions by project directory"
  2103. },
  2104. {
  2105. "in": "query",
  2106. "name": "workspace",
  2107. "schema": {
  2108. "type": "string"
  2109. }
  2110. },
  2111. {
  2112. "in": "query",
  2113. "name": "roots",
  2114. "schema": {
  2115. "type": "boolean"
  2116. },
  2117. "description": "Only return root sessions (no parentID)"
  2118. },
  2119. {
  2120. "in": "query",
  2121. "name": "start",
  2122. "schema": {
  2123. "type": "number"
  2124. },
  2125. "description": "Filter sessions updated on or after this timestamp (milliseconds since epoch)"
  2126. },
  2127. {
  2128. "in": "query",
  2129. "name": "cursor",
  2130. "schema": {
  2131. "type": "number"
  2132. },
  2133. "description": "Return sessions updated before this timestamp (milliseconds since epoch)"
  2134. },
  2135. {
  2136. "in": "query",
  2137. "name": "search",
  2138. "schema": {
  2139. "type": "string"
  2140. },
  2141. "description": "Filter sessions by title (case-insensitive)"
  2142. },
  2143. {
  2144. "in": "query",
  2145. "name": "limit",
  2146. "schema": {
  2147. "type": "number"
  2148. },
  2149. "description": "Maximum number of sessions to return"
  2150. },
  2151. {
  2152. "in": "query",
  2153. "name": "archived",
  2154. "schema": {
  2155. "type": "boolean"
  2156. },
  2157. "description": "Include archived sessions (default false)"
  2158. }
  2159. ],
  2160. "summary": "List sessions",
  2161. "description": "Get a list of all OpenCode sessions across projects, sorted by most recently updated. Archived sessions are excluded by default.",
  2162. "responses": {
  2163. "200": {
  2164. "description": "List of sessions",
  2165. "content": {
  2166. "application/json": {
  2167. "schema": {
  2168. "type": "array",
  2169. "items": {
  2170. "$ref": "#/components/schemas/GlobalSession"
  2171. }
  2172. }
  2173. }
  2174. }
  2175. }
  2176. },
  2177. "x-codeSamples": [
  2178. {
  2179. "lang": "js",
  2180. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.session.list({\n ...\n})"
  2181. }
  2182. ]
  2183. }
  2184. },
  2185. "/experimental/resource": {
  2186. "get": {
  2187. "operationId": "experimental.resource.list",
  2188. "parameters": [
  2189. {
  2190. "in": "query",
  2191. "name": "directory",
  2192. "schema": {
  2193. "type": "string"
  2194. }
  2195. },
  2196. {
  2197. "in": "query",
  2198. "name": "workspace",
  2199. "schema": {
  2200. "type": "string"
  2201. }
  2202. }
  2203. ],
  2204. "summary": "Get MCP resources",
  2205. "description": "Get all available MCP resources from connected servers. Optionally filter by name.",
  2206. "responses": {
  2207. "200": {
  2208. "description": "MCP resources",
  2209. "content": {
  2210. "application/json": {
  2211. "schema": {
  2212. "type": "object",
  2213. "propertyNames": {
  2214. "type": "string"
  2215. },
  2216. "additionalProperties": {
  2217. "$ref": "#/components/schemas/McpResource"
  2218. }
  2219. }
  2220. }
  2221. }
  2222. }
  2223. },
  2224. "x-codeSamples": [
  2225. {
  2226. "lang": "js",
  2227. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.resource.list({\n ...\n})"
  2228. }
  2229. ]
  2230. }
  2231. },
  2232. "/session": {
  2233. "get": {
  2234. "operationId": "session.list",
  2235. "parameters": [
  2236. {
  2237. "in": "query",
  2238. "name": "directory",
  2239. "schema": {
  2240. "type": "string"
  2241. },
  2242. "description": "Filter sessions by project directory"
  2243. },
  2244. {
  2245. "in": "query",
  2246. "name": "workspace",
  2247. "schema": {
  2248. "type": "string"
  2249. }
  2250. },
  2251. {
  2252. "in": "query",
  2253. "name": "roots",
  2254. "schema": {
  2255. "type": "boolean"
  2256. },
  2257. "description": "Only return root sessions (no parentID)"
  2258. },
  2259. {
  2260. "in": "query",
  2261. "name": "start",
  2262. "schema": {
  2263. "type": "number"
  2264. },
  2265. "description": "Filter sessions updated on or after this timestamp (milliseconds since epoch)"
  2266. },
  2267. {
  2268. "in": "query",
  2269. "name": "search",
  2270. "schema": {
  2271. "type": "string"
  2272. },
  2273. "description": "Filter sessions by title (case-insensitive)"
  2274. },
  2275. {
  2276. "in": "query",
  2277. "name": "limit",
  2278. "schema": {
  2279. "type": "number"
  2280. },
  2281. "description": "Maximum number of sessions to return"
  2282. }
  2283. ],
  2284. "summary": "List sessions",
  2285. "description": "Get a list of all OpenCode sessions, sorted by most recently updated.",
  2286. "responses": {
  2287. "200": {
  2288. "description": "List of sessions",
  2289. "content": {
  2290. "application/json": {
  2291. "schema": {
  2292. "type": "array",
  2293. "items": {
  2294. "$ref": "#/components/schemas/Session"
  2295. }
  2296. }
  2297. }
  2298. }
  2299. }
  2300. },
  2301. "x-codeSamples": [
  2302. {
  2303. "lang": "js",
  2304. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.list({\n ...\n})"
  2305. }
  2306. ]
  2307. },
  2308. "post": {
  2309. "operationId": "session.create",
  2310. "parameters": [
  2311. {
  2312. "in": "query",
  2313. "name": "directory",
  2314. "schema": {
  2315. "type": "string"
  2316. }
  2317. },
  2318. {
  2319. "in": "query",
  2320. "name": "workspace",
  2321. "schema": {
  2322. "type": "string"
  2323. }
  2324. }
  2325. ],
  2326. "summary": "Create session",
  2327. "description": "Create a new OpenCode session for interacting with AI assistants and managing conversations.",
  2328. "responses": {
  2329. "200": {
  2330. "description": "Successfully created session",
  2331. "content": {
  2332. "application/json": {
  2333. "schema": {
  2334. "$ref": "#/components/schemas/Session"
  2335. }
  2336. }
  2337. }
  2338. },
  2339. "400": {
  2340. "description": "Bad request",
  2341. "content": {
  2342. "application/json": {
  2343. "schema": {
  2344. "$ref": "#/components/schemas/BadRequestError"
  2345. }
  2346. }
  2347. }
  2348. }
  2349. },
  2350. "requestBody": {
  2351. "content": {
  2352. "application/json": {
  2353. "schema": {
  2354. "type": "object",
  2355. "properties": {
  2356. "parentID": {
  2357. "type": "string",
  2358. "pattern": "^ses.*"
  2359. },
  2360. "title": {
  2361. "type": "string"
  2362. },
  2363. "permission": {
  2364. "$ref": "#/components/schemas/PermissionRuleset"
  2365. },
  2366. "workspaceID": {
  2367. "type": "string",
  2368. "pattern": "^wrk.*"
  2369. }
  2370. }
  2371. }
  2372. }
  2373. }
  2374. },
  2375. "x-codeSamples": [
  2376. {
  2377. "lang": "js",
  2378. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.create({\n ...\n})"
  2379. }
  2380. ]
  2381. }
  2382. },
  2383. "/session/status": {
  2384. "get": {
  2385. "operationId": "session.status",
  2386. "parameters": [
  2387. {
  2388. "in": "query",
  2389. "name": "directory",
  2390. "schema": {
  2391. "type": "string"
  2392. }
  2393. },
  2394. {
  2395. "in": "query",
  2396. "name": "workspace",
  2397. "schema": {
  2398. "type": "string"
  2399. }
  2400. }
  2401. ],
  2402. "summary": "Get session status",
  2403. "description": "Retrieve the current status of all sessions, including active, idle, and completed states.",
  2404. "responses": {
  2405. "200": {
  2406. "description": "Get session status",
  2407. "content": {
  2408. "application/json": {
  2409. "schema": {
  2410. "type": "object",
  2411. "propertyNames": {
  2412. "type": "string"
  2413. },
  2414. "additionalProperties": {
  2415. "$ref": "#/components/schemas/SessionStatus"
  2416. }
  2417. }
  2418. }
  2419. }
  2420. },
  2421. "400": {
  2422. "description": "Bad request",
  2423. "content": {
  2424. "application/json": {
  2425. "schema": {
  2426. "$ref": "#/components/schemas/BadRequestError"
  2427. }
  2428. }
  2429. }
  2430. }
  2431. },
  2432. "x-codeSamples": [
  2433. {
  2434. "lang": "js",
  2435. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.status({\n ...\n})"
  2436. }
  2437. ]
  2438. }
  2439. },
  2440. "/session/{sessionID}": {
  2441. "get": {
  2442. "operationId": "session.get",
  2443. "parameters": [
  2444. {
  2445. "in": "query",
  2446. "name": "directory",
  2447. "schema": {
  2448. "type": "string"
  2449. }
  2450. },
  2451. {
  2452. "in": "query",
  2453. "name": "workspace",
  2454. "schema": {
  2455. "type": "string"
  2456. }
  2457. },
  2458. {
  2459. "in": "path",
  2460. "name": "sessionID",
  2461. "schema": {
  2462. "type": "string",
  2463. "pattern": "^ses.*"
  2464. },
  2465. "required": true
  2466. }
  2467. ],
  2468. "summary": "Get session",
  2469. "description": "Retrieve detailed information about a specific OpenCode session.",
  2470. "tags": ["Session"],
  2471. "responses": {
  2472. "200": {
  2473. "description": "Get session",
  2474. "content": {
  2475. "application/json": {
  2476. "schema": {
  2477. "$ref": "#/components/schemas/Session"
  2478. }
  2479. }
  2480. }
  2481. },
  2482. "400": {
  2483. "description": "Bad request",
  2484. "content": {
  2485. "application/json": {
  2486. "schema": {
  2487. "$ref": "#/components/schemas/BadRequestError"
  2488. }
  2489. }
  2490. }
  2491. },
  2492. "404": {
  2493. "description": "Not found",
  2494. "content": {
  2495. "application/json": {
  2496. "schema": {
  2497. "$ref": "#/components/schemas/NotFoundError"
  2498. }
  2499. }
  2500. }
  2501. }
  2502. },
  2503. "x-codeSamples": [
  2504. {
  2505. "lang": "js",
  2506. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.get({\n ...\n})"
  2507. }
  2508. ]
  2509. },
  2510. "delete": {
  2511. "operationId": "session.delete",
  2512. "parameters": [
  2513. {
  2514. "in": "query",
  2515. "name": "directory",
  2516. "schema": {
  2517. "type": "string"
  2518. }
  2519. },
  2520. {
  2521. "in": "query",
  2522. "name": "workspace",
  2523. "schema": {
  2524. "type": "string"
  2525. }
  2526. },
  2527. {
  2528. "in": "path",
  2529. "name": "sessionID",
  2530. "schema": {
  2531. "type": "string",
  2532. "pattern": "^ses.*"
  2533. },
  2534. "required": true
  2535. }
  2536. ],
  2537. "summary": "Delete session",
  2538. "description": "Delete a session and permanently remove all associated data, including messages and history.",
  2539. "responses": {
  2540. "200": {
  2541. "description": "Successfully deleted session",
  2542. "content": {
  2543. "application/json": {
  2544. "schema": {
  2545. "type": "boolean"
  2546. }
  2547. }
  2548. }
  2549. },
  2550. "400": {
  2551. "description": "Bad request",
  2552. "content": {
  2553. "application/json": {
  2554. "schema": {
  2555. "$ref": "#/components/schemas/BadRequestError"
  2556. }
  2557. }
  2558. }
  2559. },
  2560. "404": {
  2561. "description": "Not found",
  2562. "content": {
  2563. "application/json": {
  2564. "schema": {
  2565. "$ref": "#/components/schemas/NotFoundError"
  2566. }
  2567. }
  2568. }
  2569. }
  2570. },
  2571. "x-codeSamples": [
  2572. {
  2573. "lang": "js",
  2574. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.delete({\n ...\n})"
  2575. }
  2576. ]
  2577. },
  2578. "patch": {
  2579. "operationId": "session.update",
  2580. "parameters": [
  2581. {
  2582. "in": "query",
  2583. "name": "directory",
  2584. "schema": {
  2585. "type": "string"
  2586. }
  2587. },
  2588. {
  2589. "in": "query",
  2590. "name": "workspace",
  2591. "schema": {
  2592. "type": "string"
  2593. }
  2594. },
  2595. {
  2596. "in": "path",
  2597. "name": "sessionID",
  2598. "schema": {
  2599. "type": "string",
  2600. "pattern": "^ses.*"
  2601. },
  2602. "required": true
  2603. }
  2604. ],
  2605. "summary": "Update session",
  2606. "description": "Update properties of an existing session, such as title or other metadata.",
  2607. "responses": {
  2608. "200": {
  2609. "description": "Successfully updated session",
  2610. "content": {
  2611. "application/json": {
  2612. "schema": {
  2613. "$ref": "#/components/schemas/Session"
  2614. }
  2615. }
  2616. }
  2617. },
  2618. "400": {
  2619. "description": "Bad request",
  2620. "content": {
  2621. "application/json": {
  2622. "schema": {
  2623. "$ref": "#/components/schemas/BadRequestError"
  2624. }
  2625. }
  2626. }
  2627. },
  2628. "404": {
  2629. "description": "Not found",
  2630. "content": {
  2631. "application/json": {
  2632. "schema": {
  2633. "$ref": "#/components/schemas/NotFoundError"
  2634. }
  2635. }
  2636. }
  2637. }
  2638. },
  2639. "requestBody": {
  2640. "content": {
  2641. "application/json": {
  2642. "schema": {
  2643. "type": "object",
  2644. "properties": {
  2645. "title": {
  2646. "type": "string"
  2647. },
  2648. "permission": {
  2649. "$ref": "#/components/schemas/PermissionRuleset"
  2650. },
  2651. "time": {
  2652. "type": "object",
  2653. "properties": {
  2654. "archived": {
  2655. "type": "number"
  2656. }
  2657. }
  2658. }
  2659. }
  2660. }
  2661. }
  2662. }
  2663. },
  2664. "x-codeSamples": [
  2665. {
  2666. "lang": "js",
  2667. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.update({\n ...\n})"
  2668. }
  2669. ]
  2670. }
  2671. },
  2672. "/session/{sessionID}/children": {
  2673. "get": {
  2674. "operationId": "session.children",
  2675. "parameters": [
  2676. {
  2677. "in": "query",
  2678. "name": "directory",
  2679. "schema": {
  2680. "type": "string"
  2681. }
  2682. },
  2683. {
  2684. "in": "query",
  2685. "name": "workspace",
  2686. "schema": {
  2687. "type": "string"
  2688. }
  2689. },
  2690. {
  2691. "in": "path",
  2692. "name": "sessionID",
  2693. "schema": {
  2694. "type": "string",
  2695. "pattern": "^ses.*"
  2696. },
  2697. "required": true
  2698. }
  2699. ],
  2700. "summary": "Get session children",
  2701. "tags": ["Session"],
  2702. "description": "Retrieve all child sessions that were forked from the specified parent session.",
  2703. "responses": {
  2704. "200": {
  2705. "description": "List of children",
  2706. "content": {
  2707. "application/json": {
  2708. "schema": {
  2709. "type": "array",
  2710. "items": {
  2711. "$ref": "#/components/schemas/Session"
  2712. }
  2713. }
  2714. }
  2715. }
  2716. },
  2717. "400": {
  2718. "description": "Bad request",
  2719. "content": {
  2720. "application/json": {
  2721. "schema": {
  2722. "$ref": "#/components/schemas/BadRequestError"
  2723. }
  2724. }
  2725. }
  2726. },
  2727. "404": {
  2728. "description": "Not found",
  2729. "content": {
  2730. "application/json": {
  2731. "schema": {
  2732. "$ref": "#/components/schemas/NotFoundError"
  2733. }
  2734. }
  2735. }
  2736. }
  2737. },
  2738. "x-codeSamples": [
  2739. {
  2740. "lang": "js",
  2741. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.children({\n ...\n})"
  2742. }
  2743. ]
  2744. }
  2745. },
  2746. "/session/{sessionID}/todo": {
  2747. "get": {
  2748. "operationId": "session.todo",
  2749. "parameters": [
  2750. {
  2751. "in": "query",
  2752. "name": "directory",
  2753. "schema": {
  2754. "type": "string"
  2755. }
  2756. },
  2757. {
  2758. "in": "query",
  2759. "name": "workspace",
  2760. "schema": {
  2761. "type": "string"
  2762. }
  2763. },
  2764. {
  2765. "in": "path",
  2766. "name": "sessionID",
  2767. "schema": {
  2768. "type": "string",
  2769. "pattern": "^ses.*"
  2770. },
  2771. "required": true
  2772. }
  2773. ],
  2774. "summary": "Get session todos",
  2775. "description": "Retrieve the todo list associated with a specific session, showing tasks and action items.",
  2776. "responses": {
  2777. "200": {
  2778. "description": "Todo list",
  2779. "content": {
  2780. "application/json": {
  2781. "schema": {
  2782. "type": "array",
  2783. "items": {
  2784. "$ref": "#/components/schemas/Todo"
  2785. }
  2786. }
  2787. }
  2788. }
  2789. },
  2790. "400": {
  2791. "description": "Bad request",
  2792. "content": {
  2793. "application/json": {
  2794. "schema": {
  2795. "$ref": "#/components/schemas/BadRequestError"
  2796. }
  2797. }
  2798. }
  2799. },
  2800. "404": {
  2801. "description": "Not found",
  2802. "content": {
  2803. "application/json": {
  2804. "schema": {
  2805. "$ref": "#/components/schemas/NotFoundError"
  2806. }
  2807. }
  2808. }
  2809. }
  2810. },
  2811. "x-codeSamples": [
  2812. {
  2813. "lang": "js",
  2814. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.todo({\n ...\n})"
  2815. }
  2816. ]
  2817. }
  2818. },
  2819. "/session/{sessionID}/init": {
  2820. "post": {
  2821. "operationId": "session.init",
  2822. "parameters": [
  2823. {
  2824. "in": "query",
  2825. "name": "directory",
  2826. "schema": {
  2827. "type": "string"
  2828. }
  2829. },
  2830. {
  2831. "in": "query",
  2832. "name": "workspace",
  2833. "schema": {
  2834. "type": "string"
  2835. }
  2836. },
  2837. {
  2838. "in": "path",
  2839. "name": "sessionID",
  2840. "schema": {
  2841. "type": "string",
  2842. "pattern": "^ses.*"
  2843. },
  2844. "required": true
  2845. }
  2846. ],
  2847. "summary": "Initialize session",
  2848. "description": "Analyze the current application and create an AGENTS.md file with project-specific agent configurations.",
  2849. "responses": {
  2850. "200": {
  2851. "description": "200",
  2852. "content": {
  2853. "application/json": {
  2854. "schema": {
  2855. "type": "boolean"
  2856. }
  2857. }
  2858. }
  2859. },
  2860. "400": {
  2861. "description": "Bad request",
  2862. "content": {
  2863. "application/json": {
  2864. "schema": {
  2865. "$ref": "#/components/schemas/BadRequestError"
  2866. }
  2867. }
  2868. }
  2869. },
  2870. "404": {
  2871. "description": "Not found",
  2872. "content": {
  2873. "application/json": {
  2874. "schema": {
  2875. "$ref": "#/components/schemas/NotFoundError"
  2876. }
  2877. }
  2878. }
  2879. }
  2880. },
  2881. "requestBody": {
  2882. "content": {
  2883. "application/json": {
  2884. "schema": {
  2885. "type": "object",
  2886. "properties": {
  2887. "modelID": {
  2888. "type": "string"
  2889. },
  2890. "providerID": {
  2891. "type": "string"
  2892. },
  2893. "messageID": {
  2894. "type": "string",
  2895. "pattern": "^msg.*"
  2896. }
  2897. },
  2898. "required": ["modelID", "providerID", "messageID"]
  2899. }
  2900. }
  2901. }
  2902. },
  2903. "x-codeSamples": [
  2904. {
  2905. "lang": "js",
  2906. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.init({\n ...\n})"
  2907. }
  2908. ]
  2909. }
  2910. },
  2911. "/session/{sessionID}/fork": {
  2912. "post": {
  2913. "operationId": "session.fork",
  2914. "parameters": [
  2915. {
  2916. "in": "query",
  2917. "name": "directory",
  2918. "schema": {
  2919. "type": "string"
  2920. }
  2921. },
  2922. {
  2923. "in": "query",
  2924. "name": "workspace",
  2925. "schema": {
  2926. "type": "string"
  2927. }
  2928. },
  2929. {
  2930. "in": "path",
  2931. "name": "sessionID",
  2932. "schema": {
  2933. "type": "string",
  2934. "pattern": "^ses.*"
  2935. },
  2936. "required": true
  2937. }
  2938. ],
  2939. "summary": "Fork session",
  2940. "description": "Create a new session by forking an existing session at a specific message point.",
  2941. "responses": {
  2942. "200": {
  2943. "description": "200",
  2944. "content": {
  2945. "application/json": {
  2946. "schema": {
  2947. "$ref": "#/components/schemas/Session"
  2948. }
  2949. }
  2950. }
  2951. }
  2952. },
  2953. "requestBody": {
  2954. "content": {
  2955. "application/json": {
  2956. "schema": {
  2957. "type": "object",
  2958. "properties": {
  2959. "messageID": {
  2960. "type": "string",
  2961. "pattern": "^msg.*"
  2962. }
  2963. }
  2964. }
  2965. }
  2966. }
  2967. },
  2968. "x-codeSamples": [
  2969. {
  2970. "lang": "js",
  2971. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.fork({\n ...\n})"
  2972. }
  2973. ]
  2974. }
  2975. },
  2976. "/session/{sessionID}/abort": {
  2977. "post": {
  2978. "operationId": "session.abort",
  2979. "parameters": [
  2980. {
  2981. "in": "query",
  2982. "name": "directory",
  2983. "schema": {
  2984. "type": "string"
  2985. }
  2986. },
  2987. {
  2988. "in": "query",
  2989. "name": "workspace",
  2990. "schema": {
  2991. "type": "string"
  2992. }
  2993. },
  2994. {
  2995. "in": "path",
  2996. "name": "sessionID",
  2997. "schema": {
  2998. "type": "string",
  2999. "pattern": "^ses.*"
  3000. },
  3001. "required": true
  3002. }
  3003. ],
  3004. "summary": "Abort session",
  3005. "description": "Abort an active session and stop any ongoing AI processing or command execution.",
  3006. "responses": {
  3007. "200": {
  3008. "description": "Aborted session",
  3009. "content": {
  3010. "application/json": {
  3011. "schema": {
  3012. "type": "boolean"
  3013. }
  3014. }
  3015. }
  3016. },
  3017. "400": {
  3018. "description": "Bad request",
  3019. "content": {
  3020. "application/json": {
  3021. "schema": {
  3022. "$ref": "#/components/schemas/BadRequestError"
  3023. }
  3024. }
  3025. }
  3026. },
  3027. "404": {
  3028. "description": "Not found",
  3029. "content": {
  3030. "application/json": {
  3031. "schema": {
  3032. "$ref": "#/components/schemas/NotFoundError"
  3033. }
  3034. }
  3035. }
  3036. }
  3037. },
  3038. "x-codeSamples": [
  3039. {
  3040. "lang": "js",
  3041. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.abort({\n ...\n})"
  3042. }
  3043. ]
  3044. }
  3045. },
  3046. "/session/{sessionID}/share": {
  3047. "post": {
  3048. "operationId": "session.share",
  3049. "parameters": [
  3050. {
  3051. "in": "query",
  3052. "name": "directory",
  3053. "schema": {
  3054. "type": "string"
  3055. }
  3056. },
  3057. {
  3058. "in": "query",
  3059. "name": "workspace",
  3060. "schema": {
  3061. "type": "string"
  3062. }
  3063. },
  3064. {
  3065. "in": "path",
  3066. "name": "sessionID",
  3067. "schema": {
  3068. "type": "string",
  3069. "pattern": "^ses.*"
  3070. },
  3071. "required": true
  3072. }
  3073. ],
  3074. "summary": "Share session",
  3075. "description": "Create a shareable link for a session, allowing others to view the conversation.",
  3076. "responses": {
  3077. "200": {
  3078. "description": "Successfully shared session",
  3079. "content": {
  3080. "application/json": {
  3081. "schema": {
  3082. "$ref": "#/components/schemas/Session"
  3083. }
  3084. }
  3085. }
  3086. },
  3087. "400": {
  3088. "description": "Bad request",
  3089. "content": {
  3090. "application/json": {
  3091. "schema": {
  3092. "$ref": "#/components/schemas/BadRequestError"
  3093. }
  3094. }
  3095. }
  3096. },
  3097. "404": {
  3098. "description": "Not found",
  3099. "content": {
  3100. "application/json": {
  3101. "schema": {
  3102. "$ref": "#/components/schemas/NotFoundError"
  3103. }
  3104. }
  3105. }
  3106. }
  3107. },
  3108. "x-codeSamples": [
  3109. {
  3110. "lang": "js",
  3111. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.share({\n ...\n})"
  3112. }
  3113. ]
  3114. },
  3115. "delete": {
  3116. "operationId": "session.unshare",
  3117. "parameters": [
  3118. {
  3119. "in": "query",
  3120. "name": "directory",
  3121. "schema": {
  3122. "type": "string"
  3123. }
  3124. },
  3125. {
  3126. "in": "query",
  3127. "name": "workspace",
  3128. "schema": {
  3129. "type": "string"
  3130. }
  3131. },
  3132. {
  3133. "in": "path",
  3134. "name": "sessionID",
  3135. "schema": {
  3136. "type": "string",
  3137. "pattern": "^ses.*"
  3138. },
  3139. "required": true
  3140. }
  3141. ],
  3142. "summary": "Unshare session",
  3143. "description": "Remove the shareable link for a session, making it private again.",
  3144. "responses": {
  3145. "200": {
  3146. "description": "Successfully unshared session",
  3147. "content": {
  3148. "application/json": {
  3149. "schema": {
  3150. "$ref": "#/components/schemas/Session"
  3151. }
  3152. }
  3153. }
  3154. },
  3155. "400": {
  3156. "description": "Bad request",
  3157. "content": {
  3158. "application/json": {
  3159. "schema": {
  3160. "$ref": "#/components/schemas/BadRequestError"
  3161. }
  3162. }
  3163. }
  3164. },
  3165. "404": {
  3166. "description": "Not found",
  3167. "content": {
  3168. "application/json": {
  3169. "schema": {
  3170. "$ref": "#/components/schemas/NotFoundError"
  3171. }
  3172. }
  3173. }
  3174. }
  3175. },
  3176. "x-codeSamples": [
  3177. {
  3178. "lang": "js",
  3179. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.unshare({\n ...\n})"
  3180. }
  3181. ]
  3182. }
  3183. },
  3184. "/session/{sessionID}/diff": {
  3185. "get": {
  3186. "operationId": "session.diff",
  3187. "parameters": [
  3188. {
  3189. "in": "query",
  3190. "name": "directory",
  3191. "schema": {
  3192. "type": "string"
  3193. }
  3194. },
  3195. {
  3196. "in": "query",
  3197. "name": "workspace",
  3198. "schema": {
  3199. "type": "string"
  3200. }
  3201. },
  3202. {
  3203. "in": "path",
  3204. "name": "sessionID",
  3205. "schema": {
  3206. "type": "string",
  3207. "pattern": "^ses.*"
  3208. },
  3209. "required": true
  3210. },
  3211. {
  3212. "in": "query",
  3213. "name": "messageID",
  3214. "schema": {
  3215. "type": "string",
  3216. "pattern": "^msg.*"
  3217. }
  3218. }
  3219. ],
  3220. "summary": "Get message diff",
  3221. "description": "Get the file changes (diff) that resulted from a specific user message in the session.",
  3222. "responses": {
  3223. "200": {
  3224. "description": "Successfully retrieved diff",
  3225. "content": {
  3226. "application/json": {
  3227. "schema": {
  3228. "type": "array",
  3229. "items": {
  3230. "$ref": "#/components/schemas/SnapshotFileDiff"
  3231. }
  3232. }
  3233. }
  3234. }
  3235. }
  3236. },
  3237. "x-codeSamples": [
  3238. {
  3239. "lang": "js",
  3240. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.diff({\n ...\n})"
  3241. }
  3242. ]
  3243. }
  3244. },
  3245. "/session/{sessionID}/summarize": {
  3246. "post": {
  3247. "operationId": "session.summarize",
  3248. "parameters": [
  3249. {
  3250. "in": "query",
  3251. "name": "directory",
  3252. "schema": {
  3253. "type": "string"
  3254. }
  3255. },
  3256. {
  3257. "in": "query",
  3258. "name": "workspace",
  3259. "schema": {
  3260. "type": "string"
  3261. }
  3262. },
  3263. {
  3264. "in": "path",
  3265. "name": "sessionID",
  3266. "schema": {
  3267. "type": "string",
  3268. "pattern": "^ses.*"
  3269. },
  3270. "required": true
  3271. }
  3272. ],
  3273. "summary": "Summarize session",
  3274. "description": "Generate a concise summary of the session using AI compaction to preserve key information.",
  3275. "responses": {
  3276. "200": {
  3277. "description": "Summarized session",
  3278. "content": {
  3279. "application/json": {
  3280. "schema": {
  3281. "type": "boolean"
  3282. }
  3283. }
  3284. }
  3285. },
  3286. "400": {
  3287. "description": "Bad request",
  3288. "content": {
  3289. "application/json": {
  3290. "schema": {
  3291. "$ref": "#/components/schemas/BadRequestError"
  3292. }
  3293. }
  3294. }
  3295. },
  3296. "404": {
  3297. "description": "Not found",
  3298. "content": {
  3299. "application/json": {
  3300. "schema": {
  3301. "$ref": "#/components/schemas/NotFoundError"
  3302. }
  3303. }
  3304. }
  3305. }
  3306. },
  3307. "requestBody": {
  3308. "content": {
  3309. "application/json": {
  3310. "schema": {
  3311. "type": "object",
  3312. "properties": {
  3313. "providerID": {
  3314. "type": "string"
  3315. },
  3316. "modelID": {
  3317. "type": "string"
  3318. },
  3319. "auto": {
  3320. "default": false,
  3321. "type": "boolean"
  3322. }
  3323. },
  3324. "required": ["providerID", "modelID"]
  3325. }
  3326. }
  3327. }
  3328. },
  3329. "x-codeSamples": [
  3330. {
  3331. "lang": "js",
  3332. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.summarize({\n ...\n})"
  3333. }
  3334. ]
  3335. }
  3336. },
  3337. "/session/{sessionID}/message": {
  3338. "get": {
  3339. "operationId": "session.messages",
  3340. "parameters": [
  3341. {
  3342. "in": "query",
  3343. "name": "directory",
  3344. "schema": {
  3345. "type": "string"
  3346. }
  3347. },
  3348. {
  3349. "in": "query",
  3350. "name": "workspace",
  3351. "schema": {
  3352. "type": "string"
  3353. }
  3354. },
  3355. {
  3356. "in": "path",
  3357. "name": "sessionID",
  3358. "schema": {
  3359. "type": "string",
  3360. "pattern": "^ses.*"
  3361. },
  3362. "required": true
  3363. },
  3364. {
  3365. "in": "query",
  3366. "name": "limit",
  3367. "schema": {
  3368. "type": "integer",
  3369. "minimum": 0,
  3370. "maximum": 9007199254740991
  3371. },
  3372. "description": "Maximum number of messages to return"
  3373. },
  3374. {
  3375. "in": "query",
  3376. "name": "before",
  3377. "schema": {
  3378. "type": "string"
  3379. }
  3380. }
  3381. ],
  3382. "summary": "Get session messages",
  3383. "description": "Retrieve all messages in a session, including user prompts and AI responses.",
  3384. "responses": {
  3385. "200": {
  3386. "description": "List of messages",
  3387. "content": {
  3388. "application/json": {
  3389. "schema": {
  3390. "type": "array",
  3391. "items": {
  3392. "type": "object",
  3393. "properties": {
  3394. "info": {
  3395. "$ref": "#/components/schemas/Message"
  3396. },
  3397. "parts": {
  3398. "type": "array",
  3399. "items": {
  3400. "$ref": "#/components/schemas/Part"
  3401. }
  3402. }
  3403. },
  3404. "required": ["info", "parts"]
  3405. }
  3406. }
  3407. }
  3408. }
  3409. },
  3410. "400": {
  3411. "description": "Bad request",
  3412. "content": {
  3413. "application/json": {
  3414. "schema": {
  3415. "$ref": "#/components/schemas/BadRequestError"
  3416. }
  3417. }
  3418. }
  3419. },
  3420. "404": {
  3421. "description": "Not found",
  3422. "content": {
  3423. "application/json": {
  3424. "schema": {
  3425. "$ref": "#/components/schemas/NotFoundError"
  3426. }
  3427. }
  3428. }
  3429. }
  3430. },
  3431. "x-codeSamples": [
  3432. {
  3433. "lang": "js",
  3434. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.messages({\n ...\n})"
  3435. }
  3436. ]
  3437. },
  3438. "post": {
  3439. "operationId": "session.prompt",
  3440. "parameters": [
  3441. {
  3442. "in": "query",
  3443. "name": "directory",
  3444. "schema": {
  3445. "type": "string"
  3446. }
  3447. },
  3448. {
  3449. "in": "query",
  3450. "name": "workspace",
  3451. "schema": {
  3452. "type": "string"
  3453. }
  3454. },
  3455. {
  3456. "in": "path",
  3457. "name": "sessionID",
  3458. "schema": {
  3459. "type": "string",
  3460. "pattern": "^ses.*"
  3461. },
  3462. "required": true
  3463. }
  3464. ],
  3465. "summary": "Send message",
  3466. "description": "Create and send a new message to a session, streaming the AI response.",
  3467. "responses": {
  3468. "200": {
  3469. "description": "Created message",
  3470. "content": {
  3471. "application/json": {
  3472. "schema": {
  3473. "type": "object",
  3474. "properties": {
  3475. "info": {
  3476. "$ref": "#/components/schemas/AssistantMessage"
  3477. },
  3478. "parts": {
  3479. "type": "array",
  3480. "items": {
  3481. "$ref": "#/components/schemas/Part"
  3482. }
  3483. }
  3484. },
  3485. "required": ["info", "parts"]
  3486. }
  3487. }
  3488. }
  3489. },
  3490. "400": {
  3491. "description": "Bad request",
  3492. "content": {
  3493. "application/json": {
  3494. "schema": {
  3495. "$ref": "#/components/schemas/BadRequestError"
  3496. }
  3497. }
  3498. }
  3499. },
  3500. "404": {
  3501. "description": "Not found",
  3502. "content": {
  3503. "application/json": {
  3504. "schema": {
  3505. "$ref": "#/components/schemas/NotFoundError"
  3506. }
  3507. }
  3508. }
  3509. }
  3510. },
  3511. "requestBody": {
  3512. "content": {
  3513. "application/json": {
  3514. "schema": {
  3515. "type": "object",
  3516. "properties": {
  3517. "messageID": {
  3518. "type": "string",
  3519. "pattern": "^msg.*"
  3520. },
  3521. "model": {
  3522. "type": "object",
  3523. "properties": {
  3524. "providerID": {
  3525. "type": "string"
  3526. },
  3527. "modelID": {
  3528. "type": "string"
  3529. }
  3530. },
  3531. "required": ["providerID", "modelID"]
  3532. },
  3533. "agent": {
  3534. "type": "string"
  3535. },
  3536. "noReply": {
  3537. "type": "boolean"
  3538. },
  3539. "tools": {
  3540. "description": "@deprecated tools and permissions have been merged, you can set permissions on the session itself now",
  3541. "type": "object",
  3542. "propertyNames": {
  3543. "type": "string"
  3544. },
  3545. "additionalProperties": {
  3546. "type": "boolean"
  3547. }
  3548. },
  3549. "format": {
  3550. "$ref": "#/components/schemas/OutputFormat"
  3551. },
  3552. "system": {
  3553. "type": "string"
  3554. },
  3555. "variant": {
  3556. "type": "string"
  3557. },
  3558. "parts": {
  3559. "type": "array",
  3560. "items": {
  3561. "anyOf": [
  3562. {
  3563. "$ref": "#/components/schemas/TextPartInput"
  3564. },
  3565. {
  3566. "$ref": "#/components/schemas/FilePartInput"
  3567. },
  3568. {
  3569. "$ref": "#/components/schemas/AgentPartInput"
  3570. },
  3571. {
  3572. "$ref": "#/components/schemas/SubtaskPartInput"
  3573. }
  3574. ]
  3575. }
  3576. }
  3577. },
  3578. "required": ["parts"]
  3579. }
  3580. }
  3581. }
  3582. },
  3583. "x-codeSamples": [
  3584. {
  3585. "lang": "js",
  3586. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.prompt({\n ...\n})"
  3587. }
  3588. ]
  3589. }
  3590. },
  3591. "/session/{sessionID}/message/{messageID}": {
  3592. "get": {
  3593. "operationId": "session.message",
  3594. "parameters": [
  3595. {
  3596. "in": "query",
  3597. "name": "directory",
  3598. "schema": {
  3599. "type": "string"
  3600. }
  3601. },
  3602. {
  3603. "in": "query",
  3604. "name": "workspace",
  3605. "schema": {
  3606. "type": "string"
  3607. }
  3608. },
  3609. {
  3610. "in": "path",
  3611. "name": "sessionID",
  3612. "schema": {
  3613. "type": "string",
  3614. "pattern": "^ses.*"
  3615. },
  3616. "required": true
  3617. },
  3618. {
  3619. "in": "path",
  3620. "name": "messageID",
  3621. "schema": {
  3622. "type": "string",
  3623. "pattern": "^msg.*"
  3624. },
  3625. "required": true
  3626. }
  3627. ],
  3628. "summary": "Get message",
  3629. "description": "Retrieve a specific message from a session by its message ID.",
  3630. "responses": {
  3631. "200": {
  3632. "description": "Message",
  3633. "content": {
  3634. "application/json": {
  3635. "schema": {
  3636. "type": "object",
  3637. "properties": {
  3638. "info": {
  3639. "$ref": "#/components/schemas/Message"
  3640. },
  3641. "parts": {
  3642. "type": "array",
  3643. "items": {
  3644. "$ref": "#/components/schemas/Part"
  3645. }
  3646. }
  3647. },
  3648. "required": ["info", "parts"]
  3649. }
  3650. }
  3651. }
  3652. },
  3653. "400": {
  3654. "description": "Bad request",
  3655. "content": {
  3656. "application/json": {
  3657. "schema": {
  3658. "$ref": "#/components/schemas/BadRequestError"
  3659. }
  3660. }
  3661. }
  3662. },
  3663. "404": {
  3664. "description": "Not found",
  3665. "content": {
  3666. "application/json": {
  3667. "schema": {
  3668. "$ref": "#/components/schemas/NotFoundError"
  3669. }
  3670. }
  3671. }
  3672. }
  3673. },
  3674. "x-codeSamples": [
  3675. {
  3676. "lang": "js",
  3677. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.message({\n ...\n})"
  3678. }
  3679. ]
  3680. },
  3681. "delete": {
  3682. "operationId": "session.deleteMessage",
  3683. "parameters": [
  3684. {
  3685. "in": "query",
  3686. "name": "directory",
  3687. "schema": {
  3688. "type": "string"
  3689. }
  3690. },
  3691. {
  3692. "in": "query",
  3693. "name": "workspace",
  3694. "schema": {
  3695. "type": "string"
  3696. }
  3697. },
  3698. {
  3699. "in": "path",
  3700. "name": "sessionID",
  3701. "schema": {
  3702. "type": "string",
  3703. "pattern": "^ses.*"
  3704. },
  3705. "required": true
  3706. },
  3707. {
  3708. "in": "path",
  3709. "name": "messageID",
  3710. "schema": {
  3711. "type": "string",
  3712. "pattern": "^msg.*"
  3713. },
  3714. "required": true
  3715. }
  3716. ],
  3717. "summary": "Delete message",
  3718. "description": "Permanently delete a specific message (and all of its parts) from a session. This does not revert any file changes that may have been made while processing the message.",
  3719. "responses": {
  3720. "200": {
  3721. "description": "Successfully deleted message",
  3722. "content": {
  3723. "application/json": {
  3724. "schema": {
  3725. "type": "boolean"
  3726. }
  3727. }
  3728. }
  3729. },
  3730. "400": {
  3731. "description": "Bad request",
  3732. "content": {
  3733. "application/json": {
  3734. "schema": {
  3735. "$ref": "#/components/schemas/BadRequestError"
  3736. }
  3737. }
  3738. }
  3739. },
  3740. "404": {
  3741. "description": "Not found",
  3742. "content": {
  3743. "application/json": {
  3744. "schema": {
  3745. "$ref": "#/components/schemas/NotFoundError"
  3746. }
  3747. }
  3748. }
  3749. }
  3750. },
  3751. "x-codeSamples": [
  3752. {
  3753. "lang": "js",
  3754. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.deleteMessage({\n ...\n})"
  3755. }
  3756. ]
  3757. }
  3758. },
  3759. "/session/{sessionID}/message/{messageID}/part/{partID}": {
  3760. "delete": {
  3761. "operationId": "part.delete",
  3762. "parameters": [
  3763. {
  3764. "in": "query",
  3765. "name": "directory",
  3766. "schema": {
  3767. "type": "string"
  3768. }
  3769. },
  3770. {
  3771. "in": "query",
  3772. "name": "workspace",
  3773. "schema": {
  3774. "type": "string"
  3775. }
  3776. },
  3777. {
  3778. "in": "path",
  3779. "name": "sessionID",
  3780. "schema": {
  3781. "type": "string",
  3782. "pattern": "^ses.*"
  3783. },
  3784. "required": true
  3785. },
  3786. {
  3787. "in": "path",
  3788. "name": "messageID",
  3789. "schema": {
  3790. "type": "string",
  3791. "pattern": "^msg.*"
  3792. },
  3793. "required": true
  3794. },
  3795. {
  3796. "in": "path",
  3797. "name": "partID",
  3798. "schema": {
  3799. "type": "string",
  3800. "pattern": "^prt.*"
  3801. },
  3802. "required": true
  3803. }
  3804. ],
  3805. "description": "Delete a part from a message",
  3806. "responses": {
  3807. "200": {
  3808. "description": "Successfully deleted part",
  3809. "content": {
  3810. "application/json": {
  3811. "schema": {
  3812. "type": "boolean"
  3813. }
  3814. }
  3815. }
  3816. },
  3817. "400": {
  3818. "description": "Bad request",
  3819. "content": {
  3820. "application/json": {
  3821. "schema": {
  3822. "$ref": "#/components/schemas/BadRequestError"
  3823. }
  3824. }
  3825. }
  3826. },
  3827. "404": {
  3828. "description": "Not found",
  3829. "content": {
  3830. "application/json": {
  3831. "schema": {
  3832. "$ref": "#/components/schemas/NotFoundError"
  3833. }
  3834. }
  3835. }
  3836. }
  3837. },
  3838. "x-codeSamples": [
  3839. {
  3840. "lang": "js",
  3841. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.part.delete({\n ...\n})"
  3842. }
  3843. ]
  3844. },
  3845. "patch": {
  3846. "operationId": "part.update",
  3847. "parameters": [
  3848. {
  3849. "in": "query",
  3850. "name": "directory",
  3851. "schema": {
  3852. "type": "string"
  3853. }
  3854. },
  3855. {
  3856. "in": "query",
  3857. "name": "workspace",
  3858. "schema": {
  3859. "type": "string"
  3860. }
  3861. },
  3862. {
  3863. "in": "path",
  3864. "name": "sessionID",
  3865. "schema": {
  3866. "type": "string",
  3867. "pattern": "^ses.*"
  3868. },
  3869. "required": true
  3870. },
  3871. {
  3872. "in": "path",
  3873. "name": "messageID",
  3874. "schema": {
  3875. "type": "string",
  3876. "pattern": "^msg.*"
  3877. },
  3878. "required": true
  3879. },
  3880. {
  3881. "in": "path",
  3882. "name": "partID",
  3883. "schema": {
  3884. "type": "string",
  3885. "pattern": "^prt.*"
  3886. },
  3887. "required": true
  3888. }
  3889. ],
  3890. "description": "Update a part in a message",
  3891. "responses": {
  3892. "200": {
  3893. "description": "Successfully updated part",
  3894. "content": {
  3895. "application/json": {
  3896. "schema": {
  3897. "$ref": "#/components/schemas/Part"
  3898. }
  3899. }
  3900. }
  3901. },
  3902. "400": {
  3903. "description": "Bad request",
  3904. "content": {
  3905. "application/json": {
  3906. "schema": {
  3907. "$ref": "#/components/schemas/BadRequestError"
  3908. }
  3909. }
  3910. }
  3911. },
  3912. "404": {
  3913. "description": "Not found",
  3914. "content": {
  3915. "application/json": {
  3916. "schema": {
  3917. "$ref": "#/components/schemas/NotFoundError"
  3918. }
  3919. }
  3920. }
  3921. }
  3922. },
  3923. "requestBody": {
  3924. "content": {
  3925. "application/json": {
  3926. "schema": {
  3927. "$ref": "#/components/schemas/Part"
  3928. }
  3929. }
  3930. }
  3931. },
  3932. "x-codeSamples": [
  3933. {
  3934. "lang": "js",
  3935. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.part.update({\n ...\n})"
  3936. }
  3937. ]
  3938. }
  3939. },
  3940. "/session/{sessionID}/prompt_async": {
  3941. "post": {
  3942. "operationId": "session.prompt_async",
  3943. "parameters": [
  3944. {
  3945. "in": "query",
  3946. "name": "directory",
  3947. "schema": {
  3948. "type": "string"
  3949. }
  3950. },
  3951. {
  3952. "in": "query",
  3953. "name": "workspace",
  3954. "schema": {
  3955. "type": "string"
  3956. }
  3957. },
  3958. {
  3959. "in": "path",
  3960. "name": "sessionID",
  3961. "schema": {
  3962. "type": "string",
  3963. "pattern": "^ses.*"
  3964. },
  3965. "required": true
  3966. }
  3967. ],
  3968. "summary": "Send async message",
  3969. "description": "Create and send a new message to a session asynchronously, starting the session if needed and returning immediately.",
  3970. "responses": {
  3971. "204": {
  3972. "description": "Prompt accepted"
  3973. },
  3974. "400": {
  3975. "description": "Bad request",
  3976. "content": {
  3977. "application/json": {
  3978. "schema": {
  3979. "$ref": "#/components/schemas/BadRequestError"
  3980. }
  3981. }
  3982. }
  3983. },
  3984. "404": {
  3985. "description": "Not found",
  3986. "content": {
  3987. "application/json": {
  3988. "schema": {
  3989. "$ref": "#/components/schemas/NotFoundError"
  3990. }
  3991. }
  3992. }
  3993. }
  3994. },
  3995. "requestBody": {
  3996. "content": {
  3997. "application/json": {
  3998. "schema": {
  3999. "type": "object",
  4000. "properties": {
  4001. "messageID": {
  4002. "type": "string",
  4003. "pattern": "^msg.*"
  4004. },
  4005. "model": {
  4006. "type": "object",
  4007. "properties": {
  4008. "providerID": {
  4009. "type": "string"
  4010. },
  4011. "modelID": {
  4012. "type": "string"
  4013. }
  4014. },
  4015. "required": ["providerID", "modelID"]
  4016. },
  4017. "agent": {
  4018. "type": "string"
  4019. },
  4020. "noReply": {
  4021. "type": "boolean"
  4022. },
  4023. "tools": {
  4024. "description": "@deprecated tools and permissions have been merged, you can set permissions on the session itself now",
  4025. "type": "object",
  4026. "propertyNames": {
  4027. "type": "string"
  4028. },
  4029. "additionalProperties": {
  4030. "type": "boolean"
  4031. }
  4032. },
  4033. "format": {
  4034. "$ref": "#/components/schemas/OutputFormat"
  4035. },
  4036. "system": {
  4037. "type": "string"
  4038. },
  4039. "variant": {
  4040. "type": "string"
  4041. },
  4042. "parts": {
  4043. "type": "array",
  4044. "items": {
  4045. "anyOf": [
  4046. {
  4047. "$ref": "#/components/schemas/TextPartInput"
  4048. },
  4049. {
  4050. "$ref": "#/components/schemas/FilePartInput"
  4051. },
  4052. {
  4053. "$ref": "#/components/schemas/AgentPartInput"
  4054. },
  4055. {
  4056. "$ref": "#/components/schemas/SubtaskPartInput"
  4057. }
  4058. ]
  4059. }
  4060. }
  4061. },
  4062. "required": ["parts"]
  4063. }
  4064. }
  4065. }
  4066. },
  4067. "x-codeSamples": [
  4068. {
  4069. "lang": "js",
  4070. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.prompt_async({\n ...\n})"
  4071. }
  4072. ]
  4073. }
  4074. },
  4075. "/session/{sessionID}/command": {
  4076. "post": {
  4077. "operationId": "session.command",
  4078. "parameters": [
  4079. {
  4080. "in": "query",
  4081. "name": "directory",
  4082. "schema": {
  4083. "type": "string"
  4084. }
  4085. },
  4086. {
  4087. "in": "query",
  4088. "name": "workspace",
  4089. "schema": {
  4090. "type": "string"
  4091. }
  4092. },
  4093. {
  4094. "in": "path",
  4095. "name": "sessionID",
  4096. "schema": {
  4097. "type": "string",
  4098. "pattern": "^ses.*"
  4099. },
  4100. "required": true
  4101. }
  4102. ],
  4103. "summary": "Send command",
  4104. "description": "Send a new command to a session for execution by the AI assistant.",
  4105. "responses": {
  4106. "200": {
  4107. "description": "Created message",
  4108. "content": {
  4109. "application/json": {
  4110. "schema": {
  4111. "type": "object",
  4112. "properties": {
  4113. "info": {
  4114. "$ref": "#/components/schemas/AssistantMessage"
  4115. },
  4116. "parts": {
  4117. "type": "array",
  4118. "items": {
  4119. "$ref": "#/components/schemas/Part"
  4120. }
  4121. }
  4122. },
  4123. "required": ["info", "parts"]
  4124. }
  4125. }
  4126. }
  4127. },
  4128. "400": {
  4129. "description": "Bad request",
  4130. "content": {
  4131. "application/json": {
  4132. "schema": {
  4133. "$ref": "#/components/schemas/BadRequestError"
  4134. }
  4135. }
  4136. }
  4137. },
  4138. "404": {
  4139. "description": "Not found",
  4140. "content": {
  4141. "application/json": {
  4142. "schema": {
  4143. "$ref": "#/components/schemas/NotFoundError"
  4144. }
  4145. }
  4146. }
  4147. }
  4148. },
  4149. "requestBody": {
  4150. "content": {
  4151. "application/json": {
  4152. "schema": {
  4153. "type": "object",
  4154. "properties": {
  4155. "messageID": {
  4156. "type": "string",
  4157. "pattern": "^msg.*"
  4158. },
  4159. "agent": {
  4160. "type": "string"
  4161. },
  4162. "model": {
  4163. "type": "string"
  4164. },
  4165. "arguments": {
  4166. "type": "string"
  4167. },
  4168. "command": {
  4169. "type": "string"
  4170. },
  4171. "variant": {
  4172. "type": "string"
  4173. },
  4174. "parts": {
  4175. "type": "array",
  4176. "items": {
  4177. "type": "object",
  4178. "properties": {
  4179. "id": {
  4180. "type": "string",
  4181. "pattern": "^prt.*"
  4182. },
  4183. "type": {
  4184. "type": "string",
  4185. "const": "file"
  4186. },
  4187. "mime": {
  4188. "type": "string"
  4189. },
  4190. "filename": {
  4191. "type": "string"
  4192. },
  4193. "url": {
  4194. "type": "string"
  4195. },
  4196. "source": {
  4197. "$ref": "#/components/schemas/FilePartSource"
  4198. }
  4199. },
  4200. "required": ["type", "mime", "url"]
  4201. }
  4202. }
  4203. },
  4204. "required": ["arguments", "command"]
  4205. }
  4206. }
  4207. }
  4208. },
  4209. "x-codeSamples": [
  4210. {
  4211. "lang": "js",
  4212. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.command({\n ...\n})"
  4213. }
  4214. ]
  4215. }
  4216. },
  4217. "/session/{sessionID}/shell": {
  4218. "post": {
  4219. "operationId": "session.shell",
  4220. "parameters": [
  4221. {
  4222. "in": "query",
  4223. "name": "directory",
  4224. "schema": {
  4225. "type": "string"
  4226. }
  4227. },
  4228. {
  4229. "in": "query",
  4230. "name": "workspace",
  4231. "schema": {
  4232. "type": "string"
  4233. }
  4234. },
  4235. {
  4236. "in": "path",
  4237. "name": "sessionID",
  4238. "schema": {
  4239. "type": "string",
  4240. "pattern": "^ses.*"
  4241. },
  4242. "required": true
  4243. }
  4244. ],
  4245. "summary": "Run shell command",
  4246. "description": "Execute a shell command within the session context and return the AI's response.",
  4247. "responses": {
  4248. "200": {
  4249. "description": "Created message",
  4250. "content": {
  4251. "application/json": {
  4252. "schema": {
  4253. "type": "object",
  4254. "properties": {
  4255. "info": {
  4256. "$ref": "#/components/schemas/Message"
  4257. },
  4258. "parts": {
  4259. "type": "array",
  4260. "items": {
  4261. "$ref": "#/components/schemas/Part"
  4262. }
  4263. }
  4264. },
  4265. "required": ["info", "parts"]
  4266. }
  4267. }
  4268. }
  4269. },
  4270. "400": {
  4271. "description": "Bad request",
  4272. "content": {
  4273. "application/json": {
  4274. "schema": {
  4275. "$ref": "#/components/schemas/BadRequestError"
  4276. }
  4277. }
  4278. }
  4279. },
  4280. "404": {
  4281. "description": "Not found",
  4282. "content": {
  4283. "application/json": {
  4284. "schema": {
  4285. "$ref": "#/components/schemas/NotFoundError"
  4286. }
  4287. }
  4288. }
  4289. }
  4290. },
  4291. "requestBody": {
  4292. "content": {
  4293. "application/json": {
  4294. "schema": {
  4295. "type": "object",
  4296. "properties": {
  4297. "messageID": {
  4298. "type": "string",
  4299. "pattern": "^msg.*"
  4300. },
  4301. "agent": {
  4302. "type": "string"
  4303. },
  4304. "model": {
  4305. "type": "object",
  4306. "properties": {
  4307. "providerID": {
  4308. "type": "string"
  4309. },
  4310. "modelID": {
  4311. "type": "string"
  4312. }
  4313. },
  4314. "required": ["providerID", "modelID"]
  4315. },
  4316. "command": {
  4317. "type": "string"
  4318. }
  4319. },
  4320. "required": ["agent", "command"]
  4321. }
  4322. }
  4323. }
  4324. },
  4325. "x-codeSamples": [
  4326. {
  4327. "lang": "js",
  4328. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.shell({\n ...\n})"
  4329. }
  4330. ]
  4331. }
  4332. },
  4333. "/session/{sessionID}/revert": {
  4334. "post": {
  4335. "operationId": "session.revert",
  4336. "parameters": [
  4337. {
  4338. "in": "query",
  4339. "name": "directory",
  4340. "schema": {
  4341. "type": "string"
  4342. }
  4343. },
  4344. {
  4345. "in": "query",
  4346. "name": "workspace",
  4347. "schema": {
  4348. "type": "string"
  4349. }
  4350. },
  4351. {
  4352. "in": "path",
  4353. "name": "sessionID",
  4354. "schema": {
  4355. "type": "string",
  4356. "pattern": "^ses.*"
  4357. },
  4358. "required": true
  4359. }
  4360. ],
  4361. "summary": "Revert message",
  4362. "description": "Revert a specific message in a session, undoing its effects and restoring the previous state.",
  4363. "responses": {
  4364. "200": {
  4365. "description": "Updated session",
  4366. "content": {
  4367. "application/json": {
  4368. "schema": {
  4369. "$ref": "#/components/schemas/Session"
  4370. }
  4371. }
  4372. }
  4373. },
  4374. "400": {
  4375. "description": "Bad request",
  4376. "content": {
  4377. "application/json": {
  4378. "schema": {
  4379. "$ref": "#/components/schemas/BadRequestError"
  4380. }
  4381. }
  4382. }
  4383. },
  4384. "404": {
  4385. "description": "Not found",
  4386. "content": {
  4387. "application/json": {
  4388. "schema": {
  4389. "$ref": "#/components/schemas/NotFoundError"
  4390. }
  4391. }
  4392. }
  4393. }
  4394. },
  4395. "requestBody": {
  4396. "content": {
  4397. "application/json": {
  4398. "schema": {
  4399. "type": "object",
  4400. "properties": {
  4401. "messageID": {
  4402. "type": "string",
  4403. "pattern": "^msg.*"
  4404. },
  4405. "partID": {
  4406. "type": "string",
  4407. "pattern": "^prt.*"
  4408. }
  4409. },
  4410. "required": ["messageID"]
  4411. }
  4412. }
  4413. }
  4414. },
  4415. "x-codeSamples": [
  4416. {
  4417. "lang": "js",
  4418. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.revert({\n ...\n})"
  4419. }
  4420. ]
  4421. }
  4422. },
  4423. "/session/{sessionID}/unrevert": {
  4424. "post": {
  4425. "operationId": "session.unrevert",
  4426. "parameters": [
  4427. {
  4428. "in": "query",
  4429. "name": "directory",
  4430. "schema": {
  4431. "type": "string"
  4432. }
  4433. },
  4434. {
  4435. "in": "query",
  4436. "name": "workspace",
  4437. "schema": {
  4438. "type": "string"
  4439. }
  4440. },
  4441. {
  4442. "in": "path",
  4443. "name": "sessionID",
  4444. "schema": {
  4445. "type": "string",
  4446. "pattern": "^ses.*"
  4447. },
  4448. "required": true
  4449. }
  4450. ],
  4451. "summary": "Restore reverted messages",
  4452. "description": "Restore all previously reverted messages in a session.",
  4453. "responses": {
  4454. "200": {
  4455. "description": "Updated session",
  4456. "content": {
  4457. "application/json": {
  4458. "schema": {
  4459. "$ref": "#/components/schemas/Session"
  4460. }
  4461. }
  4462. }
  4463. },
  4464. "400": {
  4465. "description": "Bad request",
  4466. "content": {
  4467. "application/json": {
  4468. "schema": {
  4469. "$ref": "#/components/schemas/BadRequestError"
  4470. }
  4471. }
  4472. }
  4473. },
  4474. "404": {
  4475. "description": "Not found",
  4476. "content": {
  4477. "application/json": {
  4478. "schema": {
  4479. "$ref": "#/components/schemas/NotFoundError"
  4480. }
  4481. }
  4482. }
  4483. }
  4484. },
  4485. "x-codeSamples": [
  4486. {
  4487. "lang": "js",
  4488. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.unrevert({\n ...\n})"
  4489. }
  4490. ]
  4491. }
  4492. },
  4493. "/session/{sessionID}/permissions/{permissionID}": {
  4494. "post": {
  4495. "operationId": "permission.respond",
  4496. "parameters": [
  4497. {
  4498. "in": "query",
  4499. "name": "directory",
  4500. "schema": {
  4501. "type": "string"
  4502. }
  4503. },
  4504. {
  4505. "in": "query",
  4506. "name": "workspace",
  4507. "schema": {
  4508. "type": "string"
  4509. }
  4510. },
  4511. {
  4512. "in": "path",
  4513. "name": "sessionID",
  4514. "schema": {
  4515. "type": "string",
  4516. "pattern": "^ses.*"
  4517. },
  4518. "required": true
  4519. },
  4520. {
  4521. "in": "path",
  4522. "name": "permissionID",
  4523. "schema": {
  4524. "type": "string",
  4525. "pattern": "^per.*"
  4526. },
  4527. "required": true
  4528. }
  4529. ],
  4530. "summary": "Respond to permission",
  4531. "deprecated": true,
  4532. "description": "Approve or deny a permission request from the AI assistant.",
  4533. "responses": {
  4534. "200": {
  4535. "description": "Permission processed successfully",
  4536. "content": {
  4537. "application/json": {
  4538. "schema": {
  4539. "type": "boolean"
  4540. }
  4541. }
  4542. }
  4543. },
  4544. "400": {
  4545. "description": "Bad request",
  4546. "content": {
  4547. "application/json": {
  4548. "schema": {
  4549. "$ref": "#/components/schemas/BadRequestError"
  4550. }
  4551. }
  4552. }
  4553. },
  4554. "404": {
  4555. "description": "Not found",
  4556. "content": {
  4557. "application/json": {
  4558. "schema": {
  4559. "$ref": "#/components/schemas/NotFoundError"
  4560. }
  4561. }
  4562. }
  4563. }
  4564. },
  4565. "requestBody": {
  4566. "content": {
  4567. "application/json": {
  4568. "schema": {
  4569. "type": "object",
  4570. "properties": {
  4571. "response": {
  4572. "type": "string",
  4573. "enum": ["once", "always", "reject"]
  4574. }
  4575. },
  4576. "required": ["response"]
  4577. }
  4578. }
  4579. }
  4580. },
  4581. "x-codeSamples": [
  4582. {
  4583. "lang": "js",
  4584. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.permission.respond({\n ...\n})"
  4585. }
  4586. ]
  4587. }
  4588. },
  4589. "/permission/{requestID}/reply": {
  4590. "post": {
  4591. "operationId": "permission.reply",
  4592. "parameters": [
  4593. {
  4594. "in": "query",
  4595. "name": "directory",
  4596. "schema": {
  4597. "type": "string"
  4598. }
  4599. },
  4600. {
  4601. "in": "query",
  4602. "name": "workspace",
  4603. "schema": {
  4604. "type": "string"
  4605. }
  4606. },
  4607. {
  4608. "in": "path",
  4609. "name": "requestID",
  4610. "schema": {
  4611. "type": "string",
  4612. "pattern": "^per.*"
  4613. },
  4614. "required": true
  4615. }
  4616. ],
  4617. "summary": "Respond to permission request",
  4618. "description": "Approve or deny a permission request from the AI assistant.",
  4619. "responses": {
  4620. "200": {
  4621. "description": "Permission processed successfully",
  4622. "content": {
  4623. "application/json": {
  4624. "schema": {
  4625. "type": "boolean"
  4626. }
  4627. }
  4628. }
  4629. },
  4630. "400": {
  4631. "description": "Bad request",
  4632. "content": {
  4633. "application/json": {
  4634. "schema": {
  4635. "$ref": "#/components/schemas/BadRequestError"
  4636. }
  4637. }
  4638. }
  4639. },
  4640. "404": {
  4641. "description": "Not found",
  4642. "content": {
  4643. "application/json": {
  4644. "schema": {
  4645. "$ref": "#/components/schemas/NotFoundError"
  4646. }
  4647. }
  4648. }
  4649. }
  4650. },
  4651. "requestBody": {
  4652. "content": {
  4653. "application/json": {
  4654. "schema": {
  4655. "type": "object",
  4656. "properties": {
  4657. "reply": {
  4658. "type": "string",
  4659. "enum": ["once", "always", "reject"]
  4660. },
  4661. "message": {
  4662. "type": "string"
  4663. }
  4664. },
  4665. "required": ["reply"]
  4666. }
  4667. }
  4668. }
  4669. },
  4670. "x-codeSamples": [
  4671. {
  4672. "lang": "js",
  4673. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.permission.reply({\n ...\n})"
  4674. }
  4675. ]
  4676. }
  4677. },
  4678. "/permission": {
  4679. "get": {
  4680. "operationId": "permission.list",
  4681. "parameters": [
  4682. {
  4683. "in": "query",
  4684. "name": "directory",
  4685. "schema": {
  4686. "type": "string"
  4687. }
  4688. },
  4689. {
  4690. "in": "query",
  4691. "name": "workspace",
  4692. "schema": {
  4693. "type": "string"
  4694. }
  4695. }
  4696. ],
  4697. "summary": "List pending permissions",
  4698. "description": "Get all pending permission requests across all sessions.",
  4699. "responses": {
  4700. "200": {
  4701. "description": "List of pending permissions",
  4702. "content": {
  4703. "application/json": {
  4704. "schema": {
  4705. "type": "array",
  4706. "items": {
  4707. "$ref": "#/components/schemas/PermissionRequest"
  4708. }
  4709. }
  4710. }
  4711. }
  4712. }
  4713. },
  4714. "x-codeSamples": [
  4715. {
  4716. "lang": "js",
  4717. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.permission.list({\n ...\n})"
  4718. }
  4719. ]
  4720. }
  4721. },
  4722. "/question": {
  4723. "get": {
  4724. "operationId": "question.list",
  4725. "parameters": [
  4726. {
  4727. "in": "query",
  4728. "name": "directory",
  4729. "schema": {
  4730. "type": "string"
  4731. }
  4732. },
  4733. {
  4734. "in": "query",
  4735. "name": "workspace",
  4736. "schema": {
  4737. "type": "string"
  4738. }
  4739. }
  4740. ],
  4741. "summary": "List pending questions",
  4742. "description": "Get all pending question requests across all sessions.",
  4743. "responses": {
  4744. "200": {
  4745. "description": "List of pending questions",
  4746. "content": {
  4747. "application/json": {
  4748. "schema": {
  4749. "type": "array",
  4750. "items": {
  4751. "$ref": "#/components/schemas/QuestionRequest"
  4752. }
  4753. }
  4754. }
  4755. }
  4756. }
  4757. },
  4758. "x-codeSamples": [
  4759. {
  4760. "lang": "js",
  4761. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.question.list({\n ...\n})"
  4762. }
  4763. ]
  4764. }
  4765. },
  4766. "/question/{requestID}/reply": {
  4767. "post": {
  4768. "operationId": "question.reply",
  4769. "parameters": [
  4770. {
  4771. "in": "query",
  4772. "name": "directory",
  4773. "schema": {
  4774. "type": "string"
  4775. }
  4776. },
  4777. {
  4778. "in": "query",
  4779. "name": "workspace",
  4780. "schema": {
  4781. "type": "string"
  4782. }
  4783. },
  4784. {
  4785. "in": "path",
  4786. "name": "requestID",
  4787. "schema": {
  4788. "type": "string",
  4789. "pattern": "^que.*"
  4790. },
  4791. "required": true
  4792. }
  4793. ],
  4794. "summary": "Reply to question request",
  4795. "description": "Provide answers to a question request from the AI assistant.",
  4796. "responses": {
  4797. "200": {
  4798. "description": "Question answered successfully",
  4799. "content": {
  4800. "application/json": {
  4801. "schema": {
  4802. "type": "boolean"
  4803. }
  4804. }
  4805. }
  4806. },
  4807. "400": {
  4808. "description": "Bad request",
  4809. "content": {
  4810. "application/json": {
  4811. "schema": {
  4812. "$ref": "#/components/schemas/BadRequestError"
  4813. }
  4814. }
  4815. }
  4816. },
  4817. "404": {
  4818. "description": "Not found",
  4819. "content": {
  4820. "application/json": {
  4821. "schema": {
  4822. "$ref": "#/components/schemas/NotFoundError"
  4823. }
  4824. }
  4825. }
  4826. }
  4827. },
  4828. "requestBody": {
  4829. "content": {
  4830. "application/json": {
  4831. "schema": {
  4832. "type": "object",
  4833. "properties": {
  4834. "answers": {
  4835. "description": "User answers in order of questions (each answer is an array of selected labels)",
  4836. "type": "array",
  4837. "items": {
  4838. "$ref": "#/components/schemas/QuestionAnswer"
  4839. }
  4840. }
  4841. },
  4842. "required": ["answers"]
  4843. }
  4844. }
  4845. }
  4846. },
  4847. "x-codeSamples": [
  4848. {
  4849. "lang": "js",
  4850. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.question.reply({\n ...\n})"
  4851. }
  4852. ]
  4853. }
  4854. },
  4855. "/question/{requestID}/reject": {
  4856. "post": {
  4857. "operationId": "question.reject",
  4858. "parameters": [
  4859. {
  4860. "in": "query",
  4861. "name": "directory",
  4862. "schema": {
  4863. "type": "string"
  4864. }
  4865. },
  4866. {
  4867. "in": "query",
  4868. "name": "workspace",
  4869. "schema": {
  4870. "type": "string"
  4871. }
  4872. },
  4873. {
  4874. "in": "path",
  4875. "name": "requestID",
  4876. "schema": {
  4877. "type": "string",
  4878. "pattern": "^que.*"
  4879. },
  4880. "required": true
  4881. }
  4882. ],
  4883. "summary": "Reject question request",
  4884. "description": "Reject a question request from the AI assistant.",
  4885. "responses": {
  4886. "200": {
  4887. "description": "Question rejected successfully",
  4888. "content": {
  4889. "application/json": {
  4890. "schema": {
  4891. "type": "boolean"
  4892. }
  4893. }
  4894. }
  4895. },
  4896. "400": {
  4897. "description": "Bad request",
  4898. "content": {
  4899. "application/json": {
  4900. "schema": {
  4901. "$ref": "#/components/schemas/BadRequestError"
  4902. }
  4903. }
  4904. }
  4905. },
  4906. "404": {
  4907. "description": "Not found",
  4908. "content": {
  4909. "application/json": {
  4910. "schema": {
  4911. "$ref": "#/components/schemas/NotFoundError"
  4912. }
  4913. }
  4914. }
  4915. }
  4916. },
  4917. "x-codeSamples": [
  4918. {
  4919. "lang": "js",
  4920. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.question.reject({\n ...\n})"
  4921. }
  4922. ]
  4923. }
  4924. },
  4925. "/provider": {
  4926. "get": {
  4927. "operationId": "provider.list",
  4928. "parameters": [
  4929. {
  4930. "in": "query",
  4931. "name": "directory",
  4932. "schema": {
  4933. "type": "string"
  4934. }
  4935. },
  4936. {
  4937. "in": "query",
  4938. "name": "workspace",
  4939. "schema": {
  4940. "type": "string"
  4941. }
  4942. }
  4943. ],
  4944. "summary": "List providers",
  4945. "description": "Get a list of all available AI providers, including both available and connected ones.",
  4946. "responses": {
  4947. "200": {
  4948. "description": "List of providers",
  4949. "content": {
  4950. "application/json": {
  4951. "schema": {
  4952. "type": "object",
  4953. "properties": {
  4954. "all": {
  4955. "type": "array",
  4956. "items": {
  4957. "$ref": "#/components/schemas/Provider"
  4958. }
  4959. },
  4960. "default": {
  4961. "type": "object",
  4962. "propertyNames": {
  4963. "type": "string"
  4964. },
  4965. "additionalProperties": {
  4966. "type": "string"
  4967. }
  4968. },
  4969. "connected": {
  4970. "type": "array",
  4971. "items": {
  4972. "type": "string"
  4973. }
  4974. }
  4975. },
  4976. "required": ["all", "default", "connected"]
  4977. }
  4978. }
  4979. }
  4980. }
  4981. },
  4982. "x-codeSamples": [
  4983. {
  4984. "lang": "js",
  4985. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.list({\n ...\n})"
  4986. }
  4987. ]
  4988. }
  4989. },
  4990. "/provider/auth": {
  4991. "get": {
  4992. "operationId": "provider.auth",
  4993. "parameters": [
  4994. {
  4995. "in": "query",
  4996. "name": "directory",
  4997. "schema": {
  4998. "type": "string"
  4999. }
  5000. },
  5001. {
  5002. "in": "query",
  5003. "name": "workspace",
  5004. "schema": {
  5005. "type": "string"
  5006. }
  5007. }
  5008. ],
  5009. "summary": "Get provider auth methods",
  5010. "description": "Retrieve available authentication methods for all AI providers.",
  5011. "responses": {
  5012. "200": {
  5013. "description": "Provider auth methods",
  5014. "content": {
  5015. "application/json": {
  5016. "schema": {
  5017. "type": "object",
  5018. "propertyNames": {
  5019. "type": "string"
  5020. },
  5021. "additionalProperties": {
  5022. "type": "array",
  5023. "items": {
  5024. "$ref": "#/components/schemas/ProviderAuthMethod"
  5025. }
  5026. }
  5027. }
  5028. }
  5029. }
  5030. }
  5031. },
  5032. "x-codeSamples": [
  5033. {
  5034. "lang": "js",
  5035. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.auth({\n ...\n})"
  5036. }
  5037. ]
  5038. }
  5039. },
  5040. "/provider/{providerID}/oauth/authorize": {
  5041. "post": {
  5042. "operationId": "provider.oauth.authorize",
  5043. "parameters": [
  5044. {
  5045. "in": "query",
  5046. "name": "directory",
  5047. "schema": {
  5048. "type": "string"
  5049. }
  5050. },
  5051. {
  5052. "in": "query",
  5053. "name": "workspace",
  5054. "schema": {
  5055. "type": "string"
  5056. }
  5057. },
  5058. {
  5059. "in": "path",
  5060. "name": "providerID",
  5061. "schema": {
  5062. "type": "string"
  5063. },
  5064. "required": true,
  5065. "description": "Provider ID"
  5066. }
  5067. ],
  5068. "summary": "OAuth authorize",
  5069. "description": "Initiate OAuth authorization for a specific AI provider to get an authorization URL.",
  5070. "responses": {
  5071. "200": {
  5072. "description": "Authorization URL and method",
  5073. "content": {
  5074. "application/json": {
  5075. "schema": {
  5076. "$ref": "#/components/schemas/ProviderAuthAuthorization"
  5077. }
  5078. }
  5079. }
  5080. },
  5081. "400": {
  5082. "description": "Bad request",
  5083. "content": {
  5084. "application/json": {
  5085. "schema": {
  5086. "$ref": "#/components/schemas/BadRequestError"
  5087. }
  5088. }
  5089. }
  5090. }
  5091. },
  5092. "requestBody": {
  5093. "content": {
  5094. "application/json": {
  5095. "schema": {
  5096. "type": "object",
  5097. "properties": {
  5098. "method": {
  5099. "description": "Auth method index",
  5100. "type": "number"
  5101. },
  5102. "inputs": {
  5103. "description": "Prompt inputs",
  5104. "type": "object",
  5105. "propertyNames": {
  5106. "type": "string"
  5107. },
  5108. "additionalProperties": {
  5109. "type": "string"
  5110. }
  5111. }
  5112. },
  5113. "required": ["method"]
  5114. }
  5115. }
  5116. }
  5117. },
  5118. "x-codeSamples": [
  5119. {
  5120. "lang": "js",
  5121. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.oauth.authorize({\n ...\n})"
  5122. }
  5123. ]
  5124. }
  5125. },
  5126. "/provider/{providerID}/oauth/callback": {
  5127. "post": {
  5128. "operationId": "provider.oauth.callback",
  5129. "parameters": [
  5130. {
  5131. "in": "query",
  5132. "name": "directory",
  5133. "schema": {
  5134. "type": "string"
  5135. }
  5136. },
  5137. {
  5138. "in": "query",
  5139. "name": "workspace",
  5140. "schema": {
  5141. "type": "string"
  5142. }
  5143. },
  5144. {
  5145. "in": "path",
  5146. "name": "providerID",
  5147. "schema": {
  5148. "type": "string"
  5149. },
  5150. "required": true,
  5151. "description": "Provider ID"
  5152. }
  5153. ],
  5154. "summary": "OAuth callback",
  5155. "description": "Handle the OAuth callback from a provider after user authorization.",
  5156. "responses": {
  5157. "200": {
  5158. "description": "OAuth callback processed successfully",
  5159. "content": {
  5160. "application/json": {
  5161. "schema": {
  5162. "type": "boolean"
  5163. }
  5164. }
  5165. }
  5166. },
  5167. "400": {
  5168. "description": "Bad request",
  5169. "content": {
  5170. "application/json": {
  5171. "schema": {
  5172. "$ref": "#/components/schemas/BadRequestError"
  5173. }
  5174. }
  5175. }
  5176. }
  5177. },
  5178. "requestBody": {
  5179. "content": {
  5180. "application/json": {
  5181. "schema": {
  5182. "type": "object",
  5183. "properties": {
  5184. "method": {
  5185. "description": "Auth method index",
  5186. "type": "number"
  5187. },
  5188. "code": {
  5189. "description": "OAuth authorization code",
  5190. "type": "string"
  5191. }
  5192. },
  5193. "required": ["method"]
  5194. }
  5195. }
  5196. }
  5197. },
  5198. "x-codeSamples": [
  5199. {
  5200. "lang": "js",
  5201. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.oauth.callback({\n ...\n})"
  5202. }
  5203. ]
  5204. }
  5205. },
  5206. "/sync/start": {
  5207. "post": {
  5208. "operationId": "sync.start",
  5209. "parameters": [
  5210. {
  5211. "in": "query",
  5212. "name": "directory",
  5213. "schema": {
  5214. "type": "string"
  5215. }
  5216. },
  5217. {
  5218. "in": "query",
  5219. "name": "workspace",
  5220. "schema": {
  5221. "type": "string"
  5222. }
  5223. }
  5224. ],
  5225. "summary": "Start workspace sync",
  5226. "description": "Start sync loops for workspaces in the current project that have active sessions.",
  5227. "responses": {
  5228. "200": {
  5229. "description": "Workspace sync started",
  5230. "content": {
  5231. "application/json": {
  5232. "schema": {
  5233. "type": "boolean"
  5234. }
  5235. }
  5236. }
  5237. }
  5238. },
  5239. "x-codeSamples": [
  5240. {
  5241. "lang": "js",
  5242. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.sync.start({\n ...\n})"
  5243. }
  5244. ]
  5245. }
  5246. },
  5247. "/sync/replay": {
  5248. "post": {
  5249. "operationId": "sync.replay",
  5250. "parameters": [
  5251. {
  5252. "in": "query",
  5253. "name": "directory",
  5254. "schema": {
  5255. "type": "string"
  5256. }
  5257. },
  5258. {
  5259. "in": "query",
  5260. "name": "workspace",
  5261. "schema": {
  5262. "type": "string"
  5263. }
  5264. }
  5265. ],
  5266. "summary": "Replay sync events",
  5267. "description": "Validate and replay a complete sync event history.",
  5268. "responses": {
  5269. "200": {
  5270. "description": "Replayed sync events",
  5271. "content": {
  5272. "application/json": {
  5273. "schema": {
  5274. "type": "object",
  5275. "properties": {
  5276. "sessionID": {
  5277. "type": "string"
  5278. }
  5279. },
  5280. "required": ["sessionID"]
  5281. }
  5282. }
  5283. }
  5284. },
  5285. "400": {
  5286. "description": "Bad request",
  5287. "content": {
  5288. "application/json": {
  5289. "schema": {
  5290. "$ref": "#/components/schemas/BadRequestError"
  5291. }
  5292. }
  5293. }
  5294. }
  5295. },
  5296. "requestBody": {
  5297. "content": {
  5298. "application/json": {
  5299. "schema": {
  5300. "type": "object",
  5301. "properties": {
  5302. "directory": {
  5303. "type": "string"
  5304. },
  5305. "events": {
  5306. "minItems": 1,
  5307. "type": "array",
  5308. "items": {
  5309. "type": "object",
  5310. "properties": {
  5311. "id": {
  5312. "type": "string"
  5313. },
  5314. "aggregateID": {
  5315. "type": "string"
  5316. },
  5317. "seq": {
  5318. "type": "integer",
  5319. "minimum": 0,
  5320. "maximum": 9007199254740991
  5321. },
  5322. "type": {
  5323. "type": "string"
  5324. },
  5325. "data": {
  5326. "type": "object",
  5327. "propertyNames": {
  5328. "type": "string"
  5329. },
  5330. "additionalProperties": {}
  5331. }
  5332. },
  5333. "required": ["id", "aggregateID", "seq", "type", "data"]
  5334. }
  5335. }
  5336. },
  5337. "required": ["directory", "events"]
  5338. }
  5339. }
  5340. }
  5341. },
  5342. "x-codeSamples": [
  5343. {
  5344. "lang": "js",
  5345. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.sync.replay({\n ...\n})"
  5346. }
  5347. ]
  5348. }
  5349. },
  5350. "/sync/history": {
  5351. "post": {
  5352. "operationId": "sync.history.list",
  5353. "parameters": [
  5354. {
  5355. "in": "query",
  5356. "name": "directory",
  5357. "schema": {
  5358. "type": "string"
  5359. }
  5360. },
  5361. {
  5362. "in": "query",
  5363. "name": "workspace",
  5364. "schema": {
  5365. "type": "string"
  5366. }
  5367. }
  5368. ],
  5369. "summary": "List sync events",
  5370. "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.",
  5371. "responses": {
  5372. "200": {
  5373. "description": "Sync events",
  5374. "content": {
  5375. "application/json": {
  5376. "schema": {
  5377. "type": "array",
  5378. "items": {
  5379. "type": "object",
  5380. "properties": {
  5381. "id": {
  5382. "type": "string"
  5383. },
  5384. "aggregate_id": {
  5385. "type": "string"
  5386. },
  5387. "seq": {
  5388. "type": "number"
  5389. },
  5390. "type": {
  5391. "type": "string"
  5392. },
  5393. "data": {
  5394. "type": "object",
  5395. "propertyNames": {
  5396. "type": "string"
  5397. },
  5398. "additionalProperties": {}
  5399. }
  5400. },
  5401. "required": ["id", "aggregate_id", "seq", "type", "data"]
  5402. }
  5403. }
  5404. }
  5405. }
  5406. },
  5407. "400": {
  5408. "description": "Bad request",
  5409. "content": {
  5410. "application/json": {
  5411. "schema": {
  5412. "$ref": "#/components/schemas/BadRequestError"
  5413. }
  5414. }
  5415. }
  5416. }
  5417. },
  5418. "requestBody": {
  5419. "content": {
  5420. "application/json": {
  5421. "schema": {
  5422. "type": "object",
  5423. "propertyNames": {
  5424. "type": "string"
  5425. },
  5426. "additionalProperties": {
  5427. "type": "integer",
  5428. "minimum": 0,
  5429. "maximum": 9007199254740991
  5430. }
  5431. }
  5432. }
  5433. }
  5434. },
  5435. "x-codeSamples": [
  5436. {
  5437. "lang": "js",
  5438. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.sync.history.list({\n ...\n})"
  5439. }
  5440. ]
  5441. }
  5442. },
  5443. "/find": {
  5444. "get": {
  5445. "operationId": "find.text",
  5446. "parameters": [
  5447. {
  5448. "in": "query",
  5449. "name": "directory",
  5450. "schema": {
  5451. "type": "string"
  5452. }
  5453. },
  5454. {
  5455. "in": "query",
  5456. "name": "workspace",
  5457. "schema": {
  5458. "type": "string"
  5459. }
  5460. },
  5461. {
  5462. "in": "query",
  5463. "name": "pattern",
  5464. "schema": {
  5465. "type": "string"
  5466. },
  5467. "required": true
  5468. }
  5469. ],
  5470. "summary": "Find text",
  5471. "description": "Search for text patterns across files in the project using ripgrep.",
  5472. "responses": {
  5473. "200": {
  5474. "description": "Matches",
  5475. "content": {
  5476. "application/json": {
  5477. "schema": {
  5478. "type": "array",
  5479. "items": {
  5480. "type": "object",
  5481. "properties": {
  5482. "path": {
  5483. "type": "object",
  5484. "properties": {
  5485. "text": {
  5486. "type": "string"
  5487. }
  5488. },
  5489. "required": ["text"]
  5490. },
  5491. "lines": {
  5492. "type": "object",
  5493. "properties": {
  5494. "text": {
  5495. "type": "string"
  5496. }
  5497. },
  5498. "required": ["text"]
  5499. },
  5500. "line_number": {
  5501. "type": "number"
  5502. },
  5503. "absolute_offset": {
  5504. "type": "number"
  5505. },
  5506. "submatches": {
  5507. "type": "array",
  5508. "items": {
  5509. "type": "object",
  5510. "properties": {
  5511. "match": {
  5512. "type": "object",
  5513. "properties": {
  5514. "text": {
  5515. "type": "string"
  5516. }
  5517. },
  5518. "required": ["text"]
  5519. },
  5520. "start": {
  5521. "type": "number"
  5522. },
  5523. "end": {
  5524. "type": "number"
  5525. }
  5526. },
  5527. "required": ["match", "start", "end"]
  5528. }
  5529. }
  5530. },
  5531. "required": ["path", "lines", "line_number", "absolute_offset", "submatches"]
  5532. }
  5533. }
  5534. }
  5535. }
  5536. }
  5537. },
  5538. "x-codeSamples": [
  5539. {
  5540. "lang": "js",
  5541. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.find.text({\n ...\n})"
  5542. }
  5543. ]
  5544. }
  5545. },
  5546. "/find/file": {
  5547. "get": {
  5548. "operationId": "find.files",
  5549. "parameters": [
  5550. {
  5551. "in": "query",
  5552. "name": "directory",
  5553. "schema": {
  5554. "type": "string"
  5555. }
  5556. },
  5557. {
  5558. "in": "query",
  5559. "name": "workspace",
  5560. "schema": {
  5561. "type": "string"
  5562. }
  5563. },
  5564. {
  5565. "in": "query",
  5566. "name": "query",
  5567. "schema": {
  5568. "type": "string"
  5569. },
  5570. "required": true
  5571. },
  5572. {
  5573. "in": "query",
  5574. "name": "dirs",
  5575. "schema": {
  5576. "type": "string",
  5577. "enum": ["true", "false"]
  5578. }
  5579. },
  5580. {
  5581. "in": "query",
  5582. "name": "type",
  5583. "schema": {
  5584. "type": "string",
  5585. "enum": ["file", "directory"]
  5586. }
  5587. },
  5588. {
  5589. "in": "query",
  5590. "name": "limit",
  5591. "schema": {
  5592. "type": "integer",
  5593. "minimum": 1,
  5594. "maximum": 200
  5595. }
  5596. }
  5597. ],
  5598. "summary": "Find files",
  5599. "description": "Search for files or directories by name or pattern in the project directory.",
  5600. "responses": {
  5601. "200": {
  5602. "description": "File paths",
  5603. "content": {
  5604. "application/json": {
  5605. "schema": {
  5606. "type": "array",
  5607. "items": {
  5608. "type": "string"
  5609. }
  5610. }
  5611. }
  5612. }
  5613. }
  5614. },
  5615. "x-codeSamples": [
  5616. {
  5617. "lang": "js",
  5618. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.find.files({\n ...\n})"
  5619. }
  5620. ]
  5621. }
  5622. },
  5623. "/find/symbol": {
  5624. "get": {
  5625. "operationId": "find.symbols",
  5626. "parameters": [
  5627. {
  5628. "in": "query",
  5629. "name": "directory",
  5630. "schema": {
  5631. "type": "string"
  5632. }
  5633. },
  5634. {
  5635. "in": "query",
  5636. "name": "workspace",
  5637. "schema": {
  5638. "type": "string"
  5639. }
  5640. },
  5641. {
  5642. "in": "query",
  5643. "name": "query",
  5644. "schema": {
  5645. "type": "string"
  5646. },
  5647. "required": true
  5648. }
  5649. ],
  5650. "summary": "Find symbols",
  5651. "description": "Search for workspace symbols like functions, classes, and variables using LSP.",
  5652. "responses": {
  5653. "200": {
  5654. "description": "Symbols",
  5655. "content": {
  5656. "application/json": {
  5657. "schema": {
  5658. "type": "array",
  5659. "items": {
  5660. "$ref": "#/components/schemas/Symbol"
  5661. }
  5662. }
  5663. }
  5664. }
  5665. }
  5666. },
  5667. "x-codeSamples": [
  5668. {
  5669. "lang": "js",
  5670. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.find.symbols({\n ...\n})"
  5671. }
  5672. ]
  5673. }
  5674. },
  5675. "/file": {
  5676. "get": {
  5677. "operationId": "file.list",
  5678. "parameters": [
  5679. {
  5680. "in": "query",
  5681. "name": "directory",
  5682. "schema": {
  5683. "type": "string"
  5684. }
  5685. },
  5686. {
  5687. "in": "query",
  5688. "name": "workspace",
  5689. "schema": {
  5690. "type": "string"
  5691. }
  5692. },
  5693. {
  5694. "in": "query",
  5695. "name": "path",
  5696. "schema": {
  5697. "type": "string"
  5698. },
  5699. "required": true
  5700. }
  5701. ],
  5702. "summary": "List files",
  5703. "description": "List files and directories in a specified path.",
  5704. "responses": {
  5705. "200": {
  5706. "description": "Files and directories",
  5707. "content": {
  5708. "application/json": {
  5709. "schema": {
  5710. "type": "array",
  5711. "items": {
  5712. "$ref": "#/components/schemas/FileNode"
  5713. }
  5714. }
  5715. }
  5716. }
  5717. }
  5718. },
  5719. "x-codeSamples": [
  5720. {
  5721. "lang": "js",
  5722. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.file.list({\n ...\n})"
  5723. }
  5724. ]
  5725. }
  5726. },
  5727. "/file/content": {
  5728. "get": {
  5729. "operationId": "file.read",
  5730. "parameters": [
  5731. {
  5732. "in": "query",
  5733. "name": "directory",
  5734. "schema": {
  5735. "type": "string"
  5736. }
  5737. },
  5738. {
  5739. "in": "query",
  5740. "name": "workspace",
  5741. "schema": {
  5742. "type": "string"
  5743. }
  5744. },
  5745. {
  5746. "in": "query",
  5747. "name": "path",
  5748. "schema": {
  5749. "type": "string"
  5750. },
  5751. "required": true
  5752. }
  5753. ],
  5754. "summary": "Read file",
  5755. "description": "Read the content of a specified file.",
  5756. "responses": {
  5757. "200": {
  5758. "description": "File content",
  5759. "content": {
  5760. "application/json": {
  5761. "schema": {
  5762. "$ref": "#/components/schemas/FileContent"
  5763. }
  5764. }
  5765. }
  5766. }
  5767. },
  5768. "x-codeSamples": [
  5769. {
  5770. "lang": "js",
  5771. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.file.read({\n ...\n})"
  5772. }
  5773. ]
  5774. }
  5775. },
  5776. "/file/status": {
  5777. "get": {
  5778. "operationId": "file.status",
  5779. "parameters": [
  5780. {
  5781. "in": "query",
  5782. "name": "directory",
  5783. "schema": {
  5784. "type": "string"
  5785. }
  5786. },
  5787. {
  5788. "in": "query",
  5789. "name": "workspace",
  5790. "schema": {
  5791. "type": "string"
  5792. }
  5793. }
  5794. ],
  5795. "summary": "Get file status",
  5796. "description": "Get the git status of all files in the project.",
  5797. "responses": {
  5798. "200": {
  5799. "description": "File status",
  5800. "content": {
  5801. "application/json": {
  5802. "schema": {
  5803. "type": "array",
  5804. "items": {
  5805. "$ref": "#/components/schemas/File"
  5806. }
  5807. }
  5808. }
  5809. }
  5810. }
  5811. },
  5812. "x-codeSamples": [
  5813. {
  5814. "lang": "js",
  5815. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.file.status({\n ...\n})"
  5816. }
  5817. ]
  5818. }
  5819. },
  5820. "/event": {
  5821. "get": {
  5822. "operationId": "event.subscribe",
  5823. "parameters": [
  5824. {
  5825. "in": "query",
  5826. "name": "directory",
  5827. "schema": {
  5828. "type": "string"
  5829. }
  5830. },
  5831. {
  5832. "in": "query",
  5833. "name": "workspace",
  5834. "schema": {
  5835. "type": "string"
  5836. }
  5837. }
  5838. ],
  5839. "summary": "Subscribe to events",
  5840. "description": "Get events",
  5841. "responses": {
  5842. "200": {
  5843. "description": "Event stream",
  5844. "content": {
  5845. "text/event-stream": {
  5846. "schema": {
  5847. "$ref": "#/components/schemas/Event"
  5848. }
  5849. }
  5850. }
  5851. }
  5852. },
  5853. "x-codeSamples": [
  5854. {
  5855. "lang": "js",
  5856. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.event.subscribe({\n ...\n})"
  5857. }
  5858. ]
  5859. }
  5860. },
  5861. "/mcp": {
  5862. "get": {
  5863. "operationId": "mcp.status",
  5864. "parameters": [
  5865. {
  5866. "in": "query",
  5867. "name": "directory",
  5868. "schema": {
  5869. "type": "string"
  5870. }
  5871. },
  5872. {
  5873. "in": "query",
  5874. "name": "workspace",
  5875. "schema": {
  5876. "type": "string"
  5877. }
  5878. }
  5879. ],
  5880. "summary": "Get MCP status",
  5881. "description": "Get the status of all Model Context Protocol (MCP) servers.",
  5882. "responses": {
  5883. "200": {
  5884. "description": "MCP server status",
  5885. "content": {
  5886. "application/json": {
  5887. "schema": {
  5888. "type": "object",
  5889. "propertyNames": {
  5890. "type": "string"
  5891. },
  5892. "additionalProperties": {
  5893. "$ref": "#/components/schemas/MCPStatus"
  5894. }
  5895. }
  5896. }
  5897. }
  5898. }
  5899. },
  5900. "x-codeSamples": [
  5901. {
  5902. "lang": "js",
  5903. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.status({\n ...\n})"
  5904. }
  5905. ]
  5906. },
  5907. "post": {
  5908. "operationId": "mcp.add",
  5909. "parameters": [
  5910. {
  5911. "in": "query",
  5912. "name": "directory",
  5913. "schema": {
  5914. "type": "string"
  5915. }
  5916. },
  5917. {
  5918. "in": "query",
  5919. "name": "workspace",
  5920. "schema": {
  5921. "type": "string"
  5922. }
  5923. }
  5924. ],
  5925. "summary": "Add MCP server",
  5926. "description": "Dynamically add a new Model Context Protocol (MCP) server to the system.",
  5927. "responses": {
  5928. "200": {
  5929. "description": "MCP server added successfully",
  5930. "content": {
  5931. "application/json": {
  5932. "schema": {
  5933. "type": "object",
  5934. "propertyNames": {
  5935. "type": "string"
  5936. },
  5937. "additionalProperties": {
  5938. "$ref": "#/components/schemas/MCPStatus"
  5939. }
  5940. }
  5941. }
  5942. }
  5943. },
  5944. "400": {
  5945. "description": "Bad request",
  5946. "content": {
  5947. "application/json": {
  5948. "schema": {
  5949. "$ref": "#/components/schemas/BadRequestError"
  5950. }
  5951. }
  5952. }
  5953. }
  5954. },
  5955. "requestBody": {
  5956. "content": {
  5957. "application/json": {
  5958. "schema": {
  5959. "type": "object",
  5960. "properties": {
  5961. "name": {
  5962. "type": "string"
  5963. },
  5964. "config": {
  5965. "anyOf": [
  5966. {
  5967. "$ref": "#/components/schemas/McpLocalConfig"
  5968. },
  5969. {
  5970. "$ref": "#/components/schemas/McpRemoteConfig"
  5971. }
  5972. ]
  5973. }
  5974. },
  5975. "required": ["name", "config"]
  5976. }
  5977. }
  5978. }
  5979. },
  5980. "x-codeSamples": [
  5981. {
  5982. "lang": "js",
  5983. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.add({\n ...\n})"
  5984. }
  5985. ]
  5986. }
  5987. },
  5988. "/mcp/{name}/auth": {
  5989. "post": {
  5990. "operationId": "mcp.auth.start",
  5991. "parameters": [
  5992. {
  5993. "in": "query",
  5994. "name": "directory",
  5995. "schema": {
  5996. "type": "string"
  5997. }
  5998. },
  5999. {
  6000. "in": "query",
  6001. "name": "workspace",
  6002. "schema": {
  6003. "type": "string"
  6004. }
  6005. },
  6006. {
  6007. "schema": {
  6008. "type": "string"
  6009. },
  6010. "in": "path",
  6011. "name": "name",
  6012. "required": true
  6013. }
  6014. ],
  6015. "summary": "Start MCP OAuth",
  6016. "description": "Start OAuth authentication flow for a Model Context Protocol (MCP) server.",
  6017. "responses": {
  6018. "200": {
  6019. "description": "OAuth flow started",
  6020. "content": {
  6021. "application/json": {
  6022. "schema": {
  6023. "type": "object",
  6024. "properties": {
  6025. "authorizationUrl": {
  6026. "description": "URL to open in browser for authorization",
  6027. "type": "string"
  6028. }
  6029. },
  6030. "required": ["authorizationUrl"]
  6031. }
  6032. }
  6033. }
  6034. },
  6035. "400": {
  6036. "description": "Bad request",
  6037. "content": {
  6038. "application/json": {
  6039. "schema": {
  6040. "$ref": "#/components/schemas/BadRequestError"
  6041. }
  6042. }
  6043. }
  6044. },
  6045. "404": {
  6046. "description": "Not found",
  6047. "content": {
  6048. "application/json": {
  6049. "schema": {
  6050. "$ref": "#/components/schemas/NotFoundError"
  6051. }
  6052. }
  6053. }
  6054. }
  6055. },
  6056. "x-codeSamples": [
  6057. {
  6058. "lang": "js",
  6059. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.start({\n ...\n})"
  6060. }
  6061. ]
  6062. },
  6063. "delete": {
  6064. "operationId": "mcp.auth.remove",
  6065. "parameters": [
  6066. {
  6067. "in": "query",
  6068. "name": "directory",
  6069. "schema": {
  6070. "type": "string"
  6071. }
  6072. },
  6073. {
  6074. "in": "query",
  6075. "name": "workspace",
  6076. "schema": {
  6077. "type": "string"
  6078. }
  6079. },
  6080. {
  6081. "schema": {
  6082. "type": "string"
  6083. },
  6084. "in": "path",
  6085. "name": "name",
  6086. "required": true
  6087. }
  6088. ],
  6089. "summary": "Remove MCP OAuth",
  6090. "description": "Remove OAuth credentials for an MCP server",
  6091. "responses": {
  6092. "200": {
  6093. "description": "OAuth credentials removed",
  6094. "content": {
  6095. "application/json": {
  6096. "schema": {
  6097. "type": "object",
  6098. "properties": {
  6099. "success": {
  6100. "type": "boolean",
  6101. "const": true
  6102. }
  6103. },
  6104. "required": ["success"]
  6105. }
  6106. }
  6107. }
  6108. },
  6109. "404": {
  6110. "description": "Not found",
  6111. "content": {
  6112. "application/json": {
  6113. "schema": {
  6114. "$ref": "#/components/schemas/NotFoundError"
  6115. }
  6116. }
  6117. }
  6118. }
  6119. },
  6120. "x-codeSamples": [
  6121. {
  6122. "lang": "js",
  6123. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.remove({\n ...\n})"
  6124. }
  6125. ]
  6126. }
  6127. },
  6128. "/mcp/{name}/auth/callback": {
  6129. "post": {
  6130. "operationId": "mcp.auth.callback",
  6131. "parameters": [
  6132. {
  6133. "in": "query",
  6134. "name": "directory",
  6135. "schema": {
  6136. "type": "string"
  6137. }
  6138. },
  6139. {
  6140. "in": "query",
  6141. "name": "workspace",
  6142. "schema": {
  6143. "type": "string"
  6144. }
  6145. },
  6146. {
  6147. "schema": {
  6148. "type": "string"
  6149. },
  6150. "in": "path",
  6151. "name": "name",
  6152. "required": true
  6153. }
  6154. ],
  6155. "summary": "Complete MCP OAuth",
  6156. "description": "Complete OAuth authentication for a Model Context Protocol (MCP) server using the authorization code.",
  6157. "responses": {
  6158. "200": {
  6159. "description": "OAuth authentication completed",
  6160. "content": {
  6161. "application/json": {
  6162. "schema": {
  6163. "$ref": "#/components/schemas/MCPStatus"
  6164. }
  6165. }
  6166. }
  6167. },
  6168. "400": {
  6169. "description": "Bad request",
  6170. "content": {
  6171. "application/json": {
  6172. "schema": {
  6173. "$ref": "#/components/schemas/BadRequestError"
  6174. }
  6175. }
  6176. }
  6177. },
  6178. "404": {
  6179. "description": "Not found",
  6180. "content": {
  6181. "application/json": {
  6182. "schema": {
  6183. "$ref": "#/components/schemas/NotFoundError"
  6184. }
  6185. }
  6186. }
  6187. }
  6188. },
  6189. "requestBody": {
  6190. "content": {
  6191. "application/json": {
  6192. "schema": {
  6193. "type": "object",
  6194. "properties": {
  6195. "code": {
  6196. "description": "Authorization code from OAuth callback",
  6197. "type": "string"
  6198. }
  6199. },
  6200. "required": ["code"]
  6201. }
  6202. }
  6203. }
  6204. },
  6205. "x-codeSamples": [
  6206. {
  6207. "lang": "js",
  6208. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.callback({\n ...\n})"
  6209. }
  6210. ]
  6211. }
  6212. },
  6213. "/mcp/{name}/auth/authenticate": {
  6214. "post": {
  6215. "operationId": "mcp.auth.authenticate",
  6216. "parameters": [
  6217. {
  6218. "in": "query",
  6219. "name": "directory",
  6220. "schema": {
  6221. "type": "string"
  6222. }
  6223. },
  6224. {
  6225. "in": "query",
  6226. "name": "workspace",
  6227. "schema": {
  6228. "type": "string"
  6229. }
  6230. },
  6231. {
  6232. "schema": {
  6233. "type": "string"
  6234. },
  6235. "in": "path",
  6236. "name": "name",
  6237. "required": true
  6238. }
  6239. ],
  6240. "summary": "Authenticate MCP OAuth",
  6241. "description": "Start OAuth flow and wait for callback (opens browser)",
  6242. "responses": {
  6243. "200": {
  6244. "description": "OAuth authentication completed",
  6245. "content": {
  6246. "application/json": {
  6247. "schema": {
  6248. "$ref": "#/components/schemas/MCPStatus"
  6249. }
  6250. }
  6251. }
  6252. },
  6253. "400": {
  6254. "description": "Bad request",
  6255. "content": {
  6256. "application/json": {
  6257. "schema": {
  6258. "$ref": "#/components/schemas/BadRequestError"
  6259. }
  6260. }
  6261. }
  6262. },
  6263. "404": {
  6264. "description": "Not found",
  6265. "content": {
  6266. "application/json": {
  6267. "schema": {
  6268. "$ref": "#/components/schemas/NotFoundError"
  6269. }
  6270. }
  6271. }
  6272. }
  6273. },
  6274. "x-codeSamples": [
  6275. {
  6276. "lang": "js",
  6277. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.authenticate({\n ...\n})"
  6278. }
  6279. ]
  6280. }
  6281. },
  6282. "/mcp/{name}/connect": {
  6283. "post": {
  6284. "operationId": "mcp.connect",
  6285. "parameters": [
  6286. {
  6287. "in": "query",
  6288. "name": "directory",
  6289. "schema": {
  6290. "type": "string"
  6291. }
  6292. },
  6293. {
  6294. "in": "query",
  6295. "name": "workspace",
  6296. "schema": {
  6297. "type": "string"
  6298. }
  6299. },
  6300. {
  6301. "in": "path",
  6302. "name": "name",
  6303. "schema": {
  6304. "type": "string"
  6305. },
  6306. "required": true
  6307. }
  6308. ],
  6309. "description": "Connect an MCP server",
  6310. "responses": {
  6311. "200": {
  6312. "description": "MCP server connected successfully",
  6313. "content": {
  6314. "application/json": {
  6315. "schema": {
  6316. "type": "boolean"
  6317. }
  6318. }
  6319. }
  6320. }
  6321. },
  6322. "x-codeSamples": [
  6323. {
  6324. "lang": "js",
  6325. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.connect({\n ...\n})"
  6326. }
  6327. ]
  6328. }
  6329. },
  6330. "/mcp/{name}/disconnect": {
  6331. "post": {
  6332. "operationId": "mcp.disconnect",
  6333. "parameters": [
  6334. {
  6335. "in": "query",
  6336. "name": "directory",
  6337. "schema": {
  6338. "type": "string"
  6339. }
  6340. },
  6341. {
  6342. "in": "query",
  6343. "name": "workspace",
  6344. "schema": {
  6345. "type": "string"
  6346. }
  6347. },
  6348. {
  6349. "in": "path",
  6350. "name": "name",
  6351. "schema": {
  6352. "type": "string"
  6353. },
  6354. "required": true
  6355. }
  6356. ],
  6357. "description": "Disconnect an MCP server",
  6358. "responses": {
  6359. "200": {
  6360. "description": "MCP server disconnected successfully",
  6361. "content": {
  6362. "application/json": {
  6363. "schema": {
  6364. "type": "boolean"
  6365. }
  6366. }
  6367. }
  6368. }
  6369. },
  6370. "x-codeSamples": [
  6371. {
  6372. "lang": "js",
  6373. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.disconnect({\n ...\n})"
  6374. }
  6375. ]
  6376. }
  6377. },
  6378. "/tui/append-prompt": {
  6379. "post": {
  6380. "operationId": "tui.appendPrompt",
  6381. "parameters": [
  6382. {
  6383. "in": "query",
  6384. "name": "directory",
  6385. "schema": {
  6386. "type": "string"
  6387. }
  6388. },
  6389. {
  6390. "in": "query",
  6391. "name": "workspace",
  6392. "schema": {
  6393. "type": "string"
  6394. }
  6395. }
  6396. ],
  6397. "summary": "Append TUI prompt",
  6398. "description": "Append prompt to the TUI",
  6399. "responses": {
  6400. "200": {
  6401. "description": "Prompt processed successfully",
  6402. "content": {
  6403. "application/json": {
  6404. "schema": {
  6405. "type": "boolean"
  6406. }
  6407. }
  6408. }
  6409. },
  6410. "400": {
  6411. "description": "Bad request",
  6412. "content": {
  6413. "application/json": {
  6414. "schema": {
  6415. "$ref": "#/components/schemas/BadRequestError"
  6416. }
  6417. }
  6418. }
  6419. }
  6420. },
  6421. "requestBody": {
  6422. "content": {
  6423. "application/json": {
  6424. "schema": {
  6425. "type": "object",
  6426. "properties": {
  6427. "text": {
  6428. "type": "string"
  6429. }
  6430. },
  6431. "required": ["text"]
  6432. }
  6433. }
  6434. }
  6435. },
  6436. "x-codeSamples": [
  6437. {
  6438. "lang": "js",
  6439. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.appendPrompt({\n ...\n})"
  6440. }
  6441. ]
  6442. }
  6443. },
  6444. "/tui/open-help": {
  6445. "post": {
  6446. "operationId": "tui.openHelp",
  6447. "parameters": [
  6448. {
  6449. "in": "query",
  6450. "name": "directory",
  6451. "schema": {
  6452. "type": "string"
  6453. }
  6454. },
  6455. {
  6456. "in": "query",
  6457. "name": "workspace",
  6458. "schema": {
  6459. "type": "string"
  6460. }
  6461. }
  6462. ],
  6463. "summary": "Open help dialog",
  6464. "description": "Open the help dialog in the TUI to display user assistance information.",
  6465. "responses": {
  6466. "200": {
  6467. "description": "Help dialog opened successfully",
  6468. "content": {
  6469. "application/json": {
  6470. "schema": {
  6471. "type": "boolean"
  6472. }
  6473. }
  6474. }
  6475. }
  6476. },
  6477. "x-codeSamples": [
  6478. {
  6479. "lang": "js",
  6480. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openHelp({\n ...\n})"
  6481. }
  6482. ]
  6483. }
  6484. },
  6485. "/tui/open-sessions": {
  6486. "post": {
  6487. "operationId": "tui.openSessions",
  6488. "parameters": [
  6489. {
  6490. "in": "query",
  6491. "name": "directory",
  6492. "schema": {
  6493. "type": "string"
  6494. }
  6495. },
  6496. {
  6497. "in": "query",
  6498. "name": "workspace",
  6499. "schema": {
  6500. "type": "string"
  6501. }
  6502. }
  6503. ],
  6504. "summary": "Open sessions dialog",
  6505. "description": "Open the session dialog",
  6506. "responses": {
  6507. "200": {
  6508. "description": "Session dialog opened successfully",
  6509. "content": {
  6510. "application/json": {
  6511. "schema": {
  6512. "type": "boolean"
  6513. }
  6514. }
  6515. }
  6516. }
  6517. },
  6518. "x-codeSamples": [
  6519. {
  6520. "lang": "js",
  6521. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openSessions({\n ...\n})"
  6522. }
  6523. ]
  6524. }
  6525. },
  6526. "/tui/open-themes": {
  6527. "post": {
  6528. "operationId": "tui.openThemes",
  6529. "parameters": [
  6530. {
  6531. "in": "query",
  6532. "name": "directory",
  6533. "schema": {
  6534. "type": "string"
  6535. }
  6536. },
  6537. {
  6538. "in": "query",
  6539. "name": "workspace",
  6540. "schema": {
  6541. "type": "string"
  6542. }
  6543. }
  6544. ],
  6545. "summary": "Open themes dialog",
  6546. "description": "Open the theme dialog",
  6547. "responses": {
  6548. "200": {
  6549. "description": "Theme dialog opened successfully",
  6550. "content": {
  6551. "application/json": {
  6552. "schema": {
  6553. "type": "boolean"
  6554. }
  6555. }
  6556. }
  6557. }
  6558. },
  6559. "x-codeSamples": [
  6560. {
  6561. "lang": "js",
  6562. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openThemes({\n ...\n})"
  6563. }
  6564. ]
  6565. }
  6566. },
  6567. "/tui/open-models": {
  6568. "post": {
  6569. "operationId": "tui.openModels",
  6570. "parameters": [
  6571. {
  6572. "in": "query",
  6573. "name": "directory",
  6574. "schema": {
  6575. "type": "string"
  6576. }
  6577. },
  6578. {
  6579. "in": "query",
  6580. "name": "workspace",
  6581. "schema": {
  6582. "type": "string"
  6583. }
  6584. }
  6585. ],
  6586. "summary": "Open models dialog",
  6587. "description": "Open the model dialog",
  6588. "responses": {
  6589. "200": {
  6590. "description": "Model dialog opened successfully",
  6591. "content": {
  6592. "application/json": {
  6593. "schema": {
  6594. "type": "boolean"
  6595. }
  6596. }
  6597. }
  6598. }
  6599. },
  6600. "x-codeSamples": [
  6601. {
  6602. "lang": "js",
  6603. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openModels({\n ...\n})"
  6604. }
  6605. ]
  6606. }
  6607. },
  6608. "/tui/submit-prompt": {
  6609. "post": {
  6610. "operationId": "tui.submitPrompt",
  6611. "parameters": [
  6612. {
  6613. "in": "query",
  6614. "name": "directory",
  6615. "schema": {
  6616. "type": "string"
  6617. }
  6618. },
  6619. {
  6620. "in": "query",
  6621. "name": "workspace",
  6622. "schema": {
  6623. "type": "string"
  6624. }
  6625. }
  6626. ],
  6627. "summary": "Submit TUI prompt",
  6628. "description": "Submit the prompt",
  6629. "responses": {
  6630. "200": {
  6631. "description": "Prompt submitted successfully",
  6632. "content": {
  6633. "application/json": {
  6634. "schema": {
  6635. "type": "boolean"
  6636. }
  6637. }
  6638. }
  6639. }
  6640. },
  6641. "x-codeSamples": [
  6642. {
  6643. "lang": "js",
  6644. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.submitPrompt({\n ...\n})"
  6645. }
  6646. ]
  6647. }
  6648. },
  6649. "/tui/clear-prompt": {
  6650. "post": {
  6651. "operationId": "tui.clearPrompt",
  6652. "parameters": [
  6653. {
  6654. "in": "query",
  6655. "name": "directory",
  6656. "schema": {
  6657. "type": "string"
  6658. }
  6659. },
  6660. {
  6661. "in": "query",
  6662. "name": "workspace",
  6663. "schema": {
  6664. "type": "string"
  6665. }
  6666. }
  6667. ],
  6668. "summary": "Clear TUI prompt",
  6669. "description": "Clear the prompt",
  6670. "responses": {
  6671. "200": {
  6672. "description": "Prompt cleared successfully",
  6673. "content": {
  6674. "application/json": {
  6675. "schema": {
  6676. "type": "boolean"
  6677. }
  6678. }
  6679. }
  6680. }
  6681. },
  6682. "x-codeSamples": [
  6683. {
  6684. "lang": "js",
  6685. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.clearPrompt({\n ...\n})"
  6686. }
  6687. ]
  6688. }
  6689. },
  6690. "/tui/execute-command": {
  6691. "post": {
  6692. "operationId": "tui.executeCommand",
  6693. "parameters": [
  6694. {
  6695. "in": "query",
  6696. "name": "directory",
  6697. "schema": {
  6698. "type": "string"
  6699. }
  6700. },
  6701. {
  6702. "in": "query",
  6703. "name": "workspace",
  6704. "schema": {
  6705. "type": "string"
  6706. }
  6707. }
  6708. ],
  6709. "summary": "Execute TUI command",
  6710. "description": "Execute a TUI command (e.g. agent_cycle)",
  6711. "responses": {
  6712. "200": {
  6713. "description": "Command executed successfully",
  6714. "content": {
  6715. "application/json": {
  6716. "schema": {
  6717. "type": "boolean"
  6718. }
  6719. }
  6720. }
  6721. },
  6722. "400": {
  6723. "description": "Bad request",
  6724. "content": {
  6725. "application/json": {
  6726. "schema": {
  6727. "$ref": "#/components/schemas/BadRequestError"
  6728. }
  6729. }
  6730. }
  6731. }
  6732. },
  6733. "requestBody": {
  6734. "content": {
  6735. "application/json": {
  6736. "schema": {
  6737. "type": "object",
  6738. "properties": {
  6739. "command": {
  6740. "type": "string"
  6741. }
  6742. },
  6743. "required": ["command"]
  6744. }
  6745. }
  6746. }
  6747. },
  6748. "x-codeSamples": [
  6749. {
  6750. "lang": "js",
  6751. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.executeCommand({\n ...\n})"
  6752. }
  6753. ]
  6754. }
  6755. },
  6756. "/tui/show-toast": {
  6757. "post": {
  6758. "operationId": "tui.showToast",
  6759. "parameters": [
  6760. {
  6761. "in": "query",
  6762. "name": "directory",
  6763. "schema": {
  6764. "type": "string"
  6765. }
  6766. },
  6767. {
  6768. "in": "query",
  6769. "name": "workspace",
  6770. "schema": {
  6771. "type": "string"
  6772. }
  6773. }
  6774. ],
  6775. "summary": "Show TUI toast",
  6776. "description": "Show a toast notification in the TUI",
  6777. "responses": {
  6778. "200": {
  6779. "description": "Toast notification shown successfully",
  6780. "content": {
  6781. "application/json": {
  6782. "schema": {
  6783. "type": "boolean"
  6784. }
  6785. }
  6786. }
  6787. }
  6788. },
  6789. "requestBody": {
  6790. "content": {
  6791. "application/json": {
  6792. "schema": {
  6793. "type": "object",
  6794. "properties": {
  6795. "title": {
  6796. "type": "string"
  6797. },
  6798. "message": {
  6799. "type": "string"
  6800. },
  6801. "variant": {
  6802. "type": "string",
  6803. "enum": ["info", "success", "warning", "error"]
  6804. },
  6805. "duration": {
  6806. "description": "Duration in milliseconds",
  6807. "default": 5000,
  6808. "type": "number"
  6809. }
  6810. },
  6811. "required": ["message", "variant"]
  6812. }
  6813. }
  6814. }
  6815. },
  6816. "x-codeSamples": [
  6817. {
  6818. "lang": "js",
  6819. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.showToast({\n ...\n})"
  6820. }
  6821. ]
  6822. }
  6823. },
  6824. "/tui/publish": {
  6825. "post": {
  6826. "operationId": "tui.publish",
  6827. "parameters": [
  6828. {
  6829. "in": "query",
  6830. "name": "directory",
  6831. "schema": {
  6832. "type": "string"
  6833. }
  6834. },
  6835. {
  6836. "in": "query",
  6837. "name": "workspace",
  6838. "schema": {
  6839. "type": "string"
  6840. }
  6841. }
  6842. ],
  6843. "summary": "Publish TUI event",
  6844. "description": "Publish a TUI event",
  6845. "responses": {
  6846. "200": {
  6847. "description": "Event published successfully",
  6848. "content": {
  6849. "application/json": {
  6850. "schema": {
  6851. "type": "boolean"
  6852. }
  6853. }
  6854. }
  6855. },
  6856. "400": {
  6857. "description": "Bad request",
  6858. "content": {
  6859. "application/json": {
  6860. "schema": {
  6861. "$ref": "#/components/schemas/BadRequestError"
  6862. }
  6863. }
  6864. }
  6865. }
  6866. },
  6867. "requestBody": {
  6868. "content": {
  6869. "application/json": {
  6870. "schema": {
  6871. "anyOf": [
  6872. {
  6873. "$ref": "#/components/schemas/Event.tui.prompt.append"
  6874. },
  6875. {
  6876. "$ref": "#/components/schemas/Event.tui.command.execute"
  6877. },
  6878. {
  6879. "$ref": "#/components/schemas/Event.tui.toast.show"
  6880. },
  6881. {
  6882. "$ref": "#/components/schemas/Event.tui.session.select"
  6883. }
  6884. ]
  6885. }
  6886. }
  6887. }
  6888. },
  6889. "x-codeSamples": [
  6890. {
  6891. "lang": "js",
  6892. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.publish({\n ...\n})"
  6893. }
  6894. ]
  6895. }
  6896. },
  6897. "/tui/select-session": {
  6898. "post": {
  6899. "operationId": "tui.selectSession",
  6900. "parameters": [
  6901. {
  6902. "in": "query",
  6903. "name": "directory",
  6904. "schema": {
  6905. "type": "string"
  6906. }
  6907. },
  6908. {
  6909. "in": "query",
  6910. "name": "workspace",
  6911. "schema": {
  6912. "type": "string"
  6913. }
  6914. }
  6915. ],
  6916. "summary": "Select session",
  6917. "description": "Navigate the TUI to display the specified session.",
  6918. "responses": {
  6919. "200": {
  6920. "description": "Session selected successfully",
  6921. "content": {
  6922. "application/json": {
  6923. "schema": {
  6924. "type": "boolean"
  6925. }
  6926. }
  6927. }
  6928. },
  6929. "400": {
  6930. "description": "Bad request",
  6931. "content": {
  6932. "application/json": {
  6933. "schema": {
  6934. "$ref": "#/components/schemas/BadRequestError"
  6935. }
  6936. }
  6937. }
  6938. },
  6939. "404": {
  6940. "description": "Not found",
  6941. "content": {
  6942. "application/json": {
  6943. "schema": {
  6944. "$ref": "#/components/schemas/NotFoundError"
  6945. }
  6946. }
  6947. }
  6948. }
  6949. },
  6950. "requestBody": {
  6951. "content": {
  6952. "application/json": {
  6953. "schema": {
  6954. "type": "object",
  6955. "properties": {
  6956. "sessionID": {
  6957. "description": "Session ID to navigate to",
  6958. "type": "string",
  6959. "pattern": "^ses.*"
  6960. }
  6961. },
  6962. "required": ["sessionID"]
  6963. }
  6964. }
  6965. }
  6966. },
  6967. "x-codeSamples": [
  6968. {
  6969. "lang": "js",
  6970. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.selectSession({\n ...\n})"
  6971. }
  6972. ]
  6973. }
  6974. },
  6975. "/tui/control/next": {
  6976. "get": {
  6977. "operationId": "tui.control.next",
  6978. "parameters": [
  6979. {
  6980. "in": "query",
  6981. "name": "directory",
  6982. "schema": {
  6983. "type": "string"
  6984. }
  6985. },
  6986. {
  6987. "in": "query",
  6988. "name": "workspace",
  6989. "schema": {
  6990. "type": "string"
  6991. }
  6992. }
  6993. ],
  6994. "summary": "Get next TUI request",
  6995. "description": "Retrieve the next TUI (Terminal User Interface) request from the queue for processing.",
  6996. "responses": {
  6997. "200": {
  6998. "description": "Next TUI request",
  6999. "content": {
  7000. "application/json": {
  7001. "schema": {
  7002. "type": "object",
  7003. "properties": {
  7004. "path": {
  7005. "type": "string"
  7006. },
  7007. "body": {}
  7008. },
  7009. "required": ["path", "body"]
  7010. }
  7011. }
  7012. }
  7013. }
  7014. },
  7015. "x-codeSamples": [
  7016. {
  7017. "lang": "js",
  7018. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.control.next({\n ...\n})"
  7019. }
  7020. ]
  7021. }
  7022. },
  7023. "/tui/control/response": {
  7024. "post": {
  7025. "operationId": "tui.control.response",
  7026. "parameters": [
  7027. {
  7028. "in": "query",
  7029. "name": "directory",
  7030. "schema": {
  7031. "type": "string"
  7032. }
  7033. },
  7034. {
  7035. "in": "query",
  7036. "name": "workspace",
  7037. "schema": {
  7038. "type": "string"
  7039. }
  7040. }
  7041. ],
  7042. "summary": "Submit TUI response",
  7043. "description": "Submit a response to the TUI request queue to complete a pending request.",
  7044. "responses": {
  7045. "200": {
  7046. "description": "Response submitted successfully",
  7047. "content": {
  7048. "application/json": {
  7049. "schema": {
  7050. "type": "boolean"
  7051. }
  7052. }
  7053. }
  7054. }
  7055. },
  7056. "requestBody": {
  7057. "content": {
  7058. "application/json": {
  7059. "schema": {}
  7060. }
  7061. }
  7062. },
  7063. "x-codeSamples": [
  7064. {
  7065. "lang": "js",
  7066. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.control.response({\n ...\n})"
  7067. }
  7068. ]
  7069. }
  7070. },
  7071. "/instance/dispose": {
  7072. "post": {
  7073. "operationId": "instance.dispose",
  7074. "parameters": [
  7075. {
  7076. "in": "query",
  7077. "name": "directory",
  7078. "schema": {
  7079. "type": "string"
  7080. }
  7081. },
  7082. {
  7083. "in": "query",
  7084. "name": "workspace",
  7085. "schema": {
  7086. "type": "string"
  7087. }
  7088. }
  7089. ],
  7090. "summary": "Dispose instance",
  7091. "description": "Clean up and dispose the current OpenCode instance, releasing all resources.",
  7092. "responses": {
  7093. "200": {
  7094. "description": "Instance disposed",
  7095. "content": {
  7096. "application/json": {
  7097. "schema": {
  7098. "type": "boolean"
  7099. }
  7100. }
  7101. }
  7102. }
  7103. },
  7104. "x-codeSamples": [
  7105. {
  7106. "lang": "js",
  7107. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.instance.dispose({\n ...\n})"
  7108. }
  7109. ]
  7110. }
  7111. },
  7112. "/path": {
  7113. "get": {
  7114. "operationId": "path.get",
  7115. "parameters": [
  7116. {
  7117. "in": "query",
  7118. "name": "directory",
  7119. "schema": {
  7120. "type": "string"
  7121. }
  7122. },
  7123. {
  7124. "in": "query",
  7125. "name": "workspace",
  7126. "schema": {
  7127. "type": "string"
  7128. }
  7129. }
  7130. ],
  7131. "summary": "Get paths",
  7132. "description": "Retrieve the current working directory and related path information for the OpenCode instance.",
  7133. "responses": {
  7134. "200": {
  7135. "description": "Path",
  7136. "content": {
  7137. "application/json": {
  7138. "schema": {
  7139. "$ref": "#/components/schemas/Path"
  7140. }
  7141. }
  7142. }
  7143. }
  7144. },
  7145. "x-codeSamples": [
  7146. {
  7147. "lang": "js",
  7148. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.path.get({\n ...\n})"
  7149. }
  7150. ]
  7151. }
  7152. },
  7153. "/vcs": {
  7154. "get": {
  7155. "operationId": "vcs.get",
  7156. "parameters": [
  7157. {
  7158. "in": "query",
  7159. "name": "directory",
  7160. "schema": {
  7161. "type": "string"
  7162. }
  7163. },
  7164. {
  7165. "in": "query",
  7166. "name": "workspace",
  7167. "schema": {
  7168. "type": "string"
  7169. }
  7170. }
  7171. ],
  7172. "summary": "Get VCS info",
  7173. "description": "Retrieve version control system (VCS) information for the current project, such as git branch.",
  7174. "responses": {
  7175. "200": {
  7176. "description": "VCS info",
  7177. "content": {
  7178. "application/json": {
  7179. "schema": {
  7180. "$ref": "#/components/schemas/VcsInfo"
  7181. }
  7182. }
  7183. }
  7184. }
  7185. },
  7186. "x-codeSamples": [
  7187. {
  7188. "lang": "js",
  7189. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.vcs.get({\n ...\n})"
  7190. }
  7191. ]
  7192. }
  7193. },
  7194. "/vcs/diff": {
  7195. "get": {
  7196. "operationId": "vcs.diff",
  7197. "parameters": [
  7198. {
  7199. "in": "query",
  7200. "name": "directory",
  7201. "schema": {
  7202. "type": "string"
  7203. }
  7204. },
  7205. {
  7206. "in": "query",
  7207. "name": "workspace",
  7208. "schema": {
  7209. "type": "string"
  7210. }
  7211. },
  7212. {
  7213. "in": "query",
  7214. "name": "mode",
  7215. "schema": {
  7216. "type": "string",
  7217. "enum": ["git", "branch"]
  7218. },
  7219. "required": true
  7220. }
  7221. ],
  7222. "summary": "Get VCS diff",
  7223. "description": "Retrieve the current git diff for the working tree or against the default branch.",
  7224. "responses": {
  7225. "200": {
  7226. "description": "VCS diff",
  7227. "content": {
  7228. "application/json": {
  7229. "schema": {
  7230. "type": "array",
  7231. "items": {
  7232. "$ref": "#/components/schemas/VcsFileDiff"
  7233. }
  7234. }
  7235. }
  7236. }
  7237. }
  7238. },
  7239. "x-codeSamples": [
  7240. {
  7241. "lang": "js",
  7242. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.vcs.diff({\n ...\n})"
  7243. }
  7244. ]
  7245. }
  7246. },
  7247. "/command": {
  7248. "get": {
  7249. "operationId": "command.list",
  7250. "parameters": [
  7251. {
  7252. "in": "query",
  7253. "name": "directory",
  7254. "schema": {
  7255. "type": "string"
  7256. }
  7257. },
  7258. {
  7259. "in": "query",
  7260. "name": "workspace",
  7261. "schema": {
  7262. "type": "string"
  7263. }
  7264. }
  7265. ],
  7266. "summary": "List commands",
  7267. "description": "Get a list of all available commands in the OpenCode system.",
  7268. "responses": {
  7269. "200": {
  7270. "description": "List of commands",
  7271. "content": {
  7272. "application/json": {
  7273. "schema": {
  7274. "type": "array",
  7275. "items": {
  7276. "$ref": "#/components/schemas/Command"
  7277. }
  7278. }
  7279. }
  7280. }
  7281. }
  7282. },
  7283. "x-codeSamples": [
  7284. {
  7285. "lang": "js",
  7286. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.command.list({\n ...\n})"
  7287. }
  7288. ]
  7289. }
  7290. },
  7291. "/agent": {
  7292. "get": {
  7293. "operationId": "app.agents",
  7294. "parameters": [
  7295. {
  7296. "in": "query",
  7297. "name": "directory",
  7298. "schema": {
  7299. "type": "string"
  7300. }
  7301. },
  7302. {
  7303. "in": "query",
  7304. "name": "workspace",
  7305. "schema": {
  7306. "type": "string"
  7307. }
  7308. }
  7309. ],
  7310. "summary": "List agents",
  7311. "description": "Get a list of all available AI agents in the OpenCode system.",
  7312. "responses": {
  7313. "200": {
  7314. "description": "List of agents",
  7315. "content": {
  7316. "application/json": {
  7317. "schema": {
  7318. "type": "array",
  7319. "items": {
  7320. "$ref": "#/components/schemas/Agent"
  7321. }
  7322. }
  7323. }
  7324. }
  7325. }
  7326. },
  7327. "x-codeSamples": [
  7328. {
  7329. "lang": "js",
  7330. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.app.agents({\n ...\n})"
  7331. }
  7332. ]
  7333. }
  7334. },
  7335. "/skill": {
  7336. "get": {
  7337. "operationId": "app.skills",
  7338. "parameters": [
  7339. {
  7340. "in": "query",
  7341. "name": "directory",
  7342. "schema": {
  7343. "type": "string"
  7344. }
  7345. },
  7346. {
  7347. "in": "query",
  7348. "name": "workspace",
  7349. "schema": {
  7350. "type": "string"
  7351. }
  7352. }
  7353. ],
  7354. "summary": "List skills",
  7355. "description": "Get a list of all available skills in the OpenCode system.",
  7356. "responses": {
  7357. "200": {
  7358. "description": "List of skills",
  7359. "content": {
  7360. "application/json": {
  7361. "schema": {
  7362. "type": "array",
  7363. "items": {
  7364. "type": "object",
  7365. "properties": {
  7366. "name": {
  7367. "type": "string"
  7368. },
  7369. "description": {
  7370. "type": "string"
  7371. },
  7372. "location": {
  7373. "type": "string"
  7374. },
  7375. "content": {
  7376. "type": "string"
  7377. }
  7378. },
  7379. "required": ["name", "description", "location", "content"]
  7380. }
  7381. }
  7382. }
  7383. }
  7384. }
  7385. },
  7386. "x-codeSamples": [
  7387. {
  7388. "lang": "js",
  7389. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.app.skills({\n ...\n})"
  7390. }
  7391. ]
  7392. }
  7393. },
  7394. "/lsp": {
  7395. "get": {
  7396. "operationId": "lsp.status",
  7397. "parameters": [
  7398. {
  7399. "in": "query",
  7400. "name": "directory",
  7401. "schema": {
  7402. "type": "string"
  7403. }
  7404. },
  7405. {
  7406. "in": "query",
  7407. "name": "workspace",
  7408. "schema": {
  7409. "type": "string"
  7410. }
  7411. }
  7412. ],
  7413. "summary": "Get LSP status",
  7414. "description": "Get LSP server status",
  7415. "responses": {
  7416. "200": {
  7417. "description": "LSP server status",
  7418. "content": {
  7419. "application/json": {
  7420. "schema": {
  7421. "type": "array",
  7422. "items": {
  7423. "$ref": "#/components/schemas/LSPStatus"
  7424. }
  7425. }
  7426. }
  7427. }
  7428. }
  7429. },
  7430. "x-codeSamples": [
  7431. {
  7432. "lang": "js",
  7433. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.lsp.status({\n ...\n})"
  7434. }
  7435. ]
  7436. }
  7437. },
  7438. "/formatter": {
  7439. "get": {
  7440. "operationId": "formatter.status",
  7441. "parameters": [
  7442. {
  7443. "in": "query",
  7444. "name": "directory",
  7445. "schema": {
  7446. "type": "string"
  7447. }
  7448. },
  7449. {
  7450. "in": "query",
  7451. "name": "workspace",
  7452. "schema": {
  7453. "type": "string"
  7454. }
  7455. }
  7456. ],
  7457. "summary": "Get formatter status",
  7458. "description": "Get formatter status",
  7459. "responses": {
  7460. "200": {
  7461. "description": "Formatter status",
  7462. "content": {
  7463. "application/json": {
  7464. "schema": {
  7465. "type": "array",
  7466. "items": {
  7467. "$ref": "#/components/schemas/FormatterStatus"
  7468. }
  7469. }
  7470. }
  7471. }
  7472. }
  7473. },
  7474. "x-codeSamples": [
  7475. {
  7476. "lang": "js",
  7477. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.formatter.status({\n ...\n})"
  7478. }
  7479. ]
  7480. }
  7481. }
  7482. },
  7483. "components": {
  7484. "schemas": {
  7485. "Project": {
  7486. "type": "object",
  7487. "properties": {
  7488. "id": {
  7489. "type": "string"
  7490. },
  7491. "worktree": {
  7492. "type": "string"
  7493. },
  7494. "vcs": {
  7495. "type": "string",
  7496. "const": "git"
  7497. },
  7498. "name": {
  7499. "type": "string"
  7500. },
  7501. "icon": {
  7502. "type": "object",
  7503. "properties": {
  7504. "url": {
  7505. "type": "string"
  7506. },
  7507. "override": {
  7508. "type": "string"
  7509. },
  7510. "color": {
  7511. "type": "string"
  7512. }
  7513. }
  7514. },
  7515. "commands": {
  7516. "type": "object",
  7517. "properties": {
  7518. "start": {
  7519. "description": "Startup script to run when creating a new workspace (worktree)",
  7520. "type": "string"
  7521. }
  7522. }
  7523. },
  7524. "time": {
  7525. "type": "object",
  7526. "properties": {
  7527. "created": {
  7528. "type": "number"
  7529. },
  7530. "updated": {
  7531. "type": "number"
  7532. },
  7533. "initialized": {
  7534. "type": "number"
  7535. }
  7536. },
  7537. "required": ["created", "updated"]
  7538. },
  7539. "sandboxes": {
  7540. "type": "array",
  7541. "items": {
  7542. "type": "string"
  7543. }
  7544. }
  7545. },
  7546. "required": ["id", "worktree", "time", "sandboxes"]
  7547. },
  7548. "Event.project.updated": {
  7549. "type": "object",
  7550. "properties": {
  7551. "type": {
  7552. "type": "string",
  7553. "const": "project.updated"
  7554. },
  7555. "properties": {
  7556. "$ref": "#/components/schemas/Project"
  7557. }
  7558. },
  7559. "required": ["type", "properties"]
  7560. },
  7561. "Event.server.instance.disposed": {
  7562. "type": "object",
  7563. "properties": {
  7564. "type": {
  7565. "type": "string",
  7566. "const": "server.instance.disposed"
  7567. },
  7568. "properties": {
  7569. "type": "object",
  7570. "properties": {
  7571. "directory": {
  7572. "type": "string"
  7573. }
  7574. },
  7575. "required": ["directory"]
  7576. }
  7577. },
  7578. "required": ["type", "properties"]
  7579. },
  7580. "Event.server.connected": {
  7581. "type": "object",
  7582. "properties": {
  7583. "type": {
  7584. "type": "string",
  7585. "const": "server.connected"
  7586. },
  7587. "properties": {
  7588. "type": "object",
  7589. "properties": {}
  7590. }
  7591. },
  7592. "required": ["type", "properties"]
  7593. },
  7594. "Event.global.disposed": {
  7595. "type": "object",
  7596. "properties": {
  7597. "type": {
  7598. "type": "string",
  7599. "const": "global.disposed"
  7600. },
  7601. "properties": {
  7602. "type": "object",
  7603. "properties": {}
  7604. }
  7605. },
  7606. "required": ["type", "properties"]
  7607. },
  7608. "Event.file.edited": {
  7609. "type": "object",
  7610. "properties": {
  7611. "type": {
  7612. "type": "string",
  7613. "const": "file.edited"
  7614. },
  7615. "properties": {
  7616. "type": "object",
  7617. "properties": {
  7618. "file": {
  7619. "type": "string"
  7620. }
  7621. },
  7622. "required": ["file"]
  7623. }
  7624. },
  7625. "required": ["type", "properties"]
  7626. },
  7627. "Event.file.watcher.updated": {
  7628. "type": "object",
  7629. "properties": {
  7630. "type": {
  7631. "type": "string",
  7632. "const": "file.watcher.updated"
  7633. },
  7634. "properties": {
  7635. "type": "object",
  7636. "properties": {
  7637. "file": {
  7638. "type": "string"
  7639. },
  7640. "event": {
  7641. "anyOf": [
  7642. {
  7643. "type": "string",
  7644. "const": "add"
  7645. },
  7646. {
  7647. "type": "string",
  7648. "const": "change"
  7649. },
  7650. {
  7651. "type": "string",
  7652. "const": "unlink"
  7653. }
  7654. ]
  7655. }
  7656. },
  7657. "required": ["file", "event"]
  7658. }
  7659. },
  7660. "required": ["type", "properties"]
  7661. },
  7662. "Event.lsp.client.diagnostics": {
  7663. "type": "object",
  7664. "properties": {
  7665. "type": {
  7666. "type": "string",
  7667. "const": "lsp.client.diagnostics"
  7668. },
  7669. "properties": {
  7670. "type": "object",
  7671. "properties": {
  7672. "serverID": {
  7673. "type": "string"
  7674. },
  7675. "path": {
  7676. "type": "string"
  7677. }
  7678. },
  7679. "required": ["serverID", "path"]
  7680. }
  7681. },
  7682. "required": ["type", "properties"]
  7683. },
  7684. "Event.lsp.updated": {
  7685. "type": "object",
  7686. "properties": {
  7687. "type": {
  7688. "type": "string",
  7689. "const": "lsp.updated"
  7690. },
  7691. "properties": {
  7692. "type": "object",
  7693. "properties": {}
  7694. }
  7695. },
  7696. "required": ["type", "properties"]
  7697. },
  7698. "Event.installation.updated": {
  7699. "type": "object",
  7700. "properties": {
  7701. "type": {
  7702. "type": "string",
  7703. "const": "installation.updated"
  7704. },
  7705. "properties": {
  7706. "type": "object",
  7707. "properties": {
  7708. "version": {
  7709. "type": "string"
  7710. }
  7711. },
  7712. "required": ["version"]
  7713. }
  7714. },
  7715. "required": ["type", "properties"]
  7716. },
  7717. "Event.installation.update-available": {
  7718. "type": "object",
  7719. "properties": {
  7720. "type": {
  7721. "type": "string",
  7722. "const": "installation.update-available"
  7723. },
  7724. "properties": {
  7725. "type": "object",
  7726. "properties": {
  7727. "version": {
  7728. "type": "string"
  7729. }
  7730. },
  7731. "required": ["version"]
  7732. }
  7733. },
  7734. "required": ["type", "properties"]
  7735. },
  7736. "Event.message.part.delta": {
  7737. "type": "object",
  7738. "properties": {
  7739. "type": {
  7740. "type": "string",
  7741. "const": "message.part.delta"
  7742. },
  7743. "properties": {
  7744. "type": "object",
  7745. "properties": {
  7746. "sessionID": {
  7747. "type": "string",
  7748. "pattern": "^ses.*"
  7749. },
  7750. "messageID": {
  7751. "type": "string",
  7752. "pattern": "^msg.*"
  7753. },
  7754. "partID": {
  7755. "type": "string",
  7756. "pattern": "^prt.*"
  7757. },
  7758. "field": {
  7759. "type": "string"
  7760. },
  7761. "delta": {
  7762. "type": "string"
  7763. }
  7764. },
  7765. "required": ["sessionID", "messageID", "partID", "field", "delta"]
  7766. }
  7767. },
  7768. "required": ["type", "properties"]
  7769. },
  7770. "PermissionRequest": {
  7771. "type": "object",
  7772. "properties": {
  7773. "id": {
  7774. "type": "string",
  7775. "pattern": "^per.*"
  7776. },
  7777. "sessionID": {
  7778. "type": "string",
  7779. "pattern": "^ses.*"
  7780. },
  7781. "permission": {
  7782. "type": "string"
  7783. },
  7784. "patterns": {
  7785. "type": "array",
  7786. "items": {
  7787. "type": "string"
  7788. }
  7789. },
  7790. "metadata": {
  7791. "type": "object",
  7792. "propertyNames": {
  7793. "type": "string"
  7794. },
  7795. "additionalProperties": {}
  7796. },
  7797. "always": {
  7798. "type": "array",
  7799. "items": {
  7800. "type": "string"
  7801. }
  7802. },
  7803. "tool": {
  7804. "type": "object",
  7805. "properties": {
  7806. "messageID": {
  7807. "type": "string",
  7808. "pattern": "^msg.*"
  7809. },
  7810. "callID": {
  7811. "type": "string"
  7812. }
  7813. },
  7814. "required": ["messageID", "callID"]
  7815. }
  7816. },
  7817. "required": ["id", "sessionID", "permission", "patterns", "metadata", "always"]
  7818. },
  7819. "Event.permission.asked": {
  7820. "type": "object",
  7821. "properties": {
  7822. "type": {
  7823. "type": "string",
  7824. "const": "permission.asked"
  7825. },
  7826. "properties": {
  7827. "$ref": "#/components/schemas/PermissionRequest"
  7828. }
  7829. },
  7830. "required": ["type", "properties"]
  7831. },
  7832. "Event.permission.replied": {
  7833. "type": "object",
  7834. "properties": {
  7835. "type": {
  7836. "type": "string",
  7837. "const": "permission.replied"
  7838. },
  7839. "properties": {
  7840. "type": "object",
  7841. "properties": {
  7842. "sessionID": {
  7843. "type": "string",
  7844. "pattern": "^ses.*"
  7845. },
  7846. "requestID": {
  7847. "type": "string",
  7848. "pattern": "^per.*"
  7849. },
  7850. "reply": {
  7851. "type": "string",
  7852. "enum": ["once", "always", "reject"]
  7853. }
  7854. },
  7855. "required": ["sessionID", "requestID", "reply"]
  7856. }
  7857. },
  7858. "required": ["type", "properties"]
  7859. },
  7860. "SnapshotFileDiff": {
  7861. "type": "object",
  7862. "properties": {
  7863. "file": {
  7864. "type": "string"
  7865. },
  7866. "patch": {
  7867. "type": "string"
  7868. },
  7869. "additions": {
  7870. "type": "number"
  7871. },
  7872. "deletions": {
  7873. "type": "number"
  7874. },
  7875. "status": {
  7876. "type": "string",
  7877. "enum": ["added", "deleted", "modified"]
  7878. }
  7879. },
  7880. "required": ["file", "patch", "additions", "deletions"]
  7881. },
  7882. "Event.session.diff": {
  7883. "type": "object",
  7884. "properties": {
  7885. "type": {
  7886. "type": "string",
  7887. "const": "session.diff"
  7888. },
  7889. "properties": {
  7890. "type": "object",
  7891. "properties": {
  7892. "sessionID": {
  7893. "type": "string",
  7894. "pattern": "^ses.*"
  7895. },
  7896. "diff": {
  7897. "type": "array",
  7898. "items": {
  7899. "$ref": "#/components/schemas/SnapshotFileDiff"
  7900. }
  7901. }
  7902. },
  7903. "required": ["sessionID", "diff"]
  7904. }
  7905. },
  7906. "required": ["type", "properties"]
  7907. },
  7908. "ProviderAuthError": {
  7909. "type": "object",
  7910. "properties": {
  7911. "name": {
  7912. "type": "string",
  7913. "const": "ProviderAuthError"
  7914. },
  7915. "data": {
  7916. "type": "object",
  7917. "properties": {
  7918. "providerID": {
  7919. "type": "string"
  7920. },
  7921. "message": {
  7922. "type": "string"
  7923. }
  7924. },
  7925. "required": ["providerID", "message"]
  7926. }
  7927. },
  7928. "required": ["name", "data"]
  7929. },
  7930. "UnknownError": {
  7931. "type": "object",
  7932. "properties": {
  7933. "name": {
  7934. "type": "string",
  7935. "const": "UnknownError"
  7936. },
  7937. "data": {
  7938. "type": "object",
  7939. "properties": {
  7940. "message": {
  7941. "type": "string"
  7942. }
  7943. },
  7944. "required": ["message"]
  7945. }
  7946. },
  7947. "required": ["name", "data"]
  7948. },
  7949. "MessageOutputLengthError": {
  7950. "type": "object",
  7951. "properties": {
  7952. "name": {
  7953. "type": "string",
  7954. "const": "MessageOutputLengthError"
  7955. },
  7956. "data": {
  7957. "type": "object",
  7958. "properties": {}
  7959. }
  7960. },
  7961. "required": ["name", "data"]
  7962. },
  7963. "MessageAbortedError": {
  7964. "type": "object",
  7965. "properties": {
  7966. "name": {
  7967. "type": "string",
  7968. "const": "MessageAbortedError"
  7969. },
  7970. "data": {
  7971. "type": "object",
  7972. "properties": {
  7973. "message": {
  7974. "type": "string"
  7975. }
  7976. },
  7977. "required": ["message"]
  7978. }
  7979. },
  7980. "required": ["name", "data"]
  7981. },
  7982. "StructuredOutputError": {
  7983. "type": "object",
  7984. "properties": {
  7985. "name": {
  7986. "type": "string",
  7987. "const": "StructuredOutputError"
  7988. },
  7989. "data": {
  7990. "type": "object",
  7991. "properties": {
  7992. "message": {
  7993. "type": "string"
  7994. },
  7995. "retries": {
  7996. "type": "number"
  7997. }
  7998. },
  7999. "required": ["message", "retries"]
  8000. }
  8001. },
  8002. "required": ["name", "data"]
  8003. },
  8004. "ContextOverflowError": {
  8005. "type": "object",
  8006. "properties": {
  8007. "name": {
  8008. "type": "string",
  8009. "const": "ContextOverflowError"
  8010. },
  8011. "data": {
  8012. "type": "object",
  8013. "properties": {
  8014. "message": {
  8015. "type": "string"
  8016. },
  8017. "responseBody": {
  8018. "type": "string"
  8019. }
  8020. },
  8021. "required": ["message"]
  8022. }
  8023. },
  8024. "required": ["name", "data"]
  8025. },
  8026. "APIError": {
  8027. "type": "object",
  8028. "properties": {
  8029. "name": {
  8030. "type": "string",
  8031. "const": "APIError"
  8032. },
  8033. "data": {
  8034. "type": "object",
  8035. "properties": {
  8036. "message": {
  8037. "type": "string"
  8038. },
  8039. "statusCode": {
  8040. "type": "number"
  8041. },
  8042. "isRetryable": {
  8043. "type": "boolean"
  8044. },
  8045. "responseHeaders": {
  8046. "type": "object",
  8047. "propertyNames": {
  8048. "type": "string"
  8049. },
  8050. "additionalProperties": {
  8051. "type": "string"
  8052. }
  8053. },
  8054. "responseBody": {
  8055. "type": "string"
  8056. },
  8057. "metadata": {
  8058. "type": "object",
  8059. "propertyNames": {
  8060. "type": "string"
  8061. },
  8062. "additionalProperties": {
  8063. "type": "string"
  8064. }
  8065. }
  8066. },
  8067. "required": ["message", "isRetryable"]
  8068. }
  8069. },
  8070. "required": ["name", "data"]
  8071. },
  8072. "Event.session.error": {
  8073. "type": "object",
  8074. "properties": {
  8075. "type": {
  8076. "type": "string",
  8077. "const": "session.error"
  8078. },
  8079. "properties": {
  8080. "type": "object",
  8081. "properties": {
  8082. "sessionID": {
  8083. "type": "string",
  8084. "pattern": "^ses.*"
  8085. },
  8086. "error": {
  8087. "anyOf": [
  8088. {
  8089. "$ref": "#/components/schemas/ProviderAuthError"
  8090. },
  8091. {
  8092. "$ref": "#/components/schemas/UnknownError"
  8093. },
  8094. {
  8095. "$ref": "#/components/schemas/MessageOutputLengthError"
  8096. },
  8097. {
  8098. "$ref": "#/components/schemas/MessageAbortedError"
  8099. },
  8100. {
  8101. "$ref": "#/components/schemas/StructuredOutputError"
  8102. },
  8103. {
  8104. "$ref": "#/components/schemas/ContextOverflowError"
  8105. },
  8106. {
  8107. "$ref": "#/components/schemas/APIError"
  8108. }
  8109. ]
  8110. }
  8111. }
  8112. }
  8113. },
  8114. "required": ["type", "properties"]
  8115. },
  8116. "QuestionOption": {
  8117. "type": "object",
  8118. "properties": {
  8119. "label": {
  8120. "description": "Display text (1-5 words, concise)",
  8121. "type": "string"
  8122. },
  8123. "description": {
  8124. "description": "Explanation of choice",
  8125. "type": "string"
  8126. }
  8127. },
  8128. "required": ["label", "description"]
  8129. },
  8130. "QuestionInfo": {
  8131. "type": "object",
  8132. "properties": {
  8133. "question": {
  8134. "description": "Complete question",
  8135. "type": "string"
  8136. },
  8137. "header": {
  8138. "description": "Very short label (max 30 chars)",
  8139. "type": "string"
  8140. },
  8141. "options": {
  8142. "description": "Available choices",
  8143. "type": "array",
  8144. "items": {
  8145. "$ref": "#/components/schemas/QuestionOption"
  8146. }
  8147. },
  8148. "multiple": {
  8149. "description": "Allow selecting multiple choices",
  8150. "type": "boolean"
  8151. },
  8152. "custom": {
  8153. "description": "Allow typing a custom answer (default: true)",
  8154. "type": "boolean"
  8155. }
  8156. },
  8157. "required": ["question", "header", "options"]
  8158. },
  8159. "QuestionTool": {
  8160. "type": "object",
  8161. "properties": {
  8162. "messageID": {
  8163. "type": "string",
  8164. "pattern": "^msg.*"
  8165. },
  8166. "callID": {
  8167. "type": "string"
  8168. }
  8169. },
  8170. "required": ["messageID", "callID"]
  8171. },
  8172. "QuestionRequest": {
  8173. "type": "object",
  8174. "properties": {
  8175. "id": {
  8176. "type": "string",
  8177. "pattern": "^que.*"
  8178. },
  8179. "sessionID": {
  8180. "type": "string",
  8181. "pattern": "^ses.*"
  8182. },
  8183. "questions": {
  8184. "description": "Questions to ask",
  8185. "type": "array",
  8186. "items": {
  8187. "$ref": "#/components/schemas/QuestionInfo"
  8188. }
  8189. },
  8190. "tool": {
  8191. "$ref": "#/components/schemas/QuestionTool"
  8192. }
  8193. },
  8194. "required": ["id", "sessionID", "questions"]
  8195. },
  8196. "Event.question.asked": {
  8197. "type": "object",
  8198. "properties": {
  8199. "type": {
  8200. "type": "string",
  8201. "const": "question.asked"
  8202. },
  8203. "properties": {
  8204. "$ref": "#/components/schemas/QuestionRequest"
  8205. }
  8206. },
  8207. "required": ["type", "properties"]
  8208. },
  8209. "QuestionAnswer": {
  8210. "type": "array",
  8211. "items": {
  8212. "type": "string"
  8213. }
  8214. },
  8215. "QuestionReplied": {
  8216. "type": "object",
  8217. "properties": {
  8218. "sessionID": {
  8219. "type": "string",
  8220. "pattern": "^ses.*"
  8221. },
  8222. "requestID": {
  8223. "type": "string",
  8224. "pattern": "^que.*"
  8225. },
  8226. "answers": {
  8227. "type": "array",
  8228. "items": {
  8229. "$ref": "#/components/schemas/QuestionAnswer"
  8230. }
  8231. }
  8232. },
  8233. "required": ["sessionID", "requestID", "answers"]
  8234. },
  8235. "Event.question.replied": {
  8236. "type": "object",
  8237. "properties": {
  8238. "type": {
  8239. "type": "string",
  8240. "const": "question.replied"
  8241. },
  8242. "properties": {
  8243. "$ref": "#/components/schemas/QuestionReplied"
  8244. }
  8245. },
  8246. "required": ["type", "properties"]
  8247. },
  8248. "QuestionRejected": {
  8249. "type": "object",
  8250. "properties": {
  8251. "sessionID": {
  8252. "type": "string",
  8253. "pattern": "^ses.*"
  8254. },
  8255. "requestID": {
  8256. "type": "string",
  8257. "pattern": "^que.*"
  8258. }
  8259. },
  8260. "required": ["sessionID", "requestID"]
  8261. },
  8262. "Event.question.rejected": {
  8263. "type": "object",
  8264. "properties": {
  8265. "type": {
  8266. "type": "string",
  8267. "const": "question.rejected"
  8268. },
  8269. "properties": {
  8270. "$ref": "#/components/schemas/QuestionRejected"
  8271. }
  8272. },
  8273. "required": ["type", "properties"]
  8274. },
  8275. "Todo": {
  8276. "type": "object",
  8277. "properties": {
  8278. "content": {
  8279. "description": "Brief description of the task",
  8280. "type": "string"
  8281. },
  8282. "status": {
  8283. "description": "Current status of the task: pending, in_progress, completed, cancelled",
  8284. "type": "string"
  8285. },
  8286. "priority": {
  8287. "description": "Priority level of the task: high, medium, low",
  8288. "type": "string"
  8289. }
  8290. },
  8291. "required": ["content", "status", "priority"]
  8292. },
  8293. "Event.todo.updated": {
  8294. "type": "object",
  8295. "properties": {
  8296. "type": {
  8297. "type": "string",
  8298. "const": "todo.updated"
  8299. },
  8300. "properties": {
  8301. "type": "object",
  8302. "properties": {
  8303. "sessionID": {
  8304. "type": "string",
  8305. "pattern": "^ses.*"
  8306. },
  8307. "todos": {
  8308. "type": "array",
  8309. "items": {
  8310. "$ref": "#/components/schemas/Todo"
  8311. }
  8312. }
  8313. },
  8314. "required": ["sessionID", "todos"]
  8315. }
  8316. },
  8317. "required": ["type", "properties"]
  8318. },
  8319. "SessionStatus": {
  8320. "anyOf": [
  8321. {
  8322. "type": "object",
  8323. "properties": {
  8324. "type": {
  8325. "type": "string",
  8326. "const": "idle"
  8327. }
  8328. },
  8329. "required": ["type"]
  8330. },
  8331. {
  8332. "type": "object",
  8333. "properties": {
  8334. "type": {
  8335. "type": "string",
  8336. "const": "retry"
  8337. },
  8338. "attempt": {
  8339. "type": "number"
  8340. },
  8341. "message": {
  8342. "type": "string"
  8343. },
  8344. "next": {
  8345. "type": "number"
  8346. }
  8347. },
  8348. "required": ["type", "attempt", "message", "next"]
  8349. },
  8350. {
  8351. "type": "object",
  8352. "properties": {
  8353. "type": {
  8354. "type": "string",
  8355. "const": "busy"
  8356. }
  8357. },
  8358. "required": ["type"]
  8359. }
  8360. ]
  8361. },
  8362. "Event.session.status": {
  8363. "type": "object",
  8364. "properties": {
  8365. "type": {
  8366. "type": "string",
  8367. "const": "session.status"
  8368. },
  8369. "properties": {
  8370. "type": "object",
  8371. "properties": {
  8372. "sessionID": {
  8373. "type": "string",
  8374. "pattern": "^ses.*"
  8375. },
  8376. "status": {
  8377. "$ref": "#/components/schemas/SessionStatus"
  8378. }
  8379. },
  8380. "required": ["sessionID", "status"]
  8381. }
  8382. },
  8383. "required": ["type", "properties"]
  8384. },
  8385. "Event.session.idle": {
  8386. "type": "object",
  8387. "properties": {
  8388. "type": {
  8389. "type": "string",
  8390. "const": "session.idle"
  8391. },
  8392. "properties": {
  8393. "type": "object",
  8394. "properties": {
  8395. "sessionID": {
  8396. "type": "string",
  8397. "pattern": "^ses.*"
  8398. }
  8399. },
  8400. "required": ["sessionID"]
  8401. }
  8402. },
  8403. "required": ["type", "properties"]
  8404. },
  8405. "Event.session.compacted": {
  8406. "type": "object",
  8407. "properties": {
  8408. "type": {
  8409. "type": "string",
  8410. "const": "session.compacted"
  8411. },
  8412. "properties": {
  8413. "type": "object",
  8414. "properties": {
  8415. "sessionID": {
  8416. "type": "string",
  8417. "pattern": "^ses.*"
  8418. }
  8419. },
  8420. "required": ["sessionID"]
  8421. }
  8422. },
  8423. "required": ["type", "properties"]
  8424. },
  8425. "Event.tui.prompt.append": {
  8426. "type": "object",
  8427. "properties": {
  8428. "type": {
  8429. "type": "string",
  8430. "const": "tui.prompt.append"
  8431. },
  8432. "properties": {
  8433. "type": "object",
  8434. "properties": {
  8435. "text": {
  8436. "type": "string"
  8437. }
  8438. },
  8439. "required": ["text"]
  8440. }
  8441. },
  8442. "required": ["type", "properties"]
  8443. },
  8444. "Event.tui.command.execute": {
  8445. "type": "object",
  8446. "properties": {
  8447. "type": {
  8448. "type": "string",
  8449. "const": "tui.command.execute"
  8450. },
  8451. "properties": {
  8452. "type": "object",
  8453. "properties": {
  8454. "command": {
  8455. "anyOf": [
  8456. {
  8457. "type": "string",
  8458. "enum": [
  8459. "session.list",
  8460. "session.new",
  8461. "session.share",
  8462. "session.interrupt",
  8463. "session.compact",
  8464. "session.page.up",
  8465. "session.page.down",
  8466. "session.line.up",
  8467. "session.line.down",
  8468. "session.half.page.up",
  8469. "session.half.page.down",
  8470. "session.first",
  8471. "session.last",
  8472. "prompt.clear",
  8473. "prompt.submit",
  8474. "agent.cycle"
  8475. ]
  8476. },
  8477. {
  8478. "type": "string"
  8479. }
  8480. ]
  8481. }
  8482. },
  8483. "required": ["command"]
  8484. }
  8485. },
  8486. "required": ["type", "properties"]
  8487. },
  8488. "Event.tui.toast.show": {
  8489. "type": "object",
  8490. "properties": {
  8491. "type": {
  8492. "type": "string",
  8493. "const": "tui.toast.show"
  8494. },
  8495. "properties": {
  8496. "type": "object",
  8497. "properties": {
  8498. "title": {
  8499. "type": "string"
  8500. },
  8501. "message": {
  8502. "type": "string"
  8503. },
  8504. "variant": {
  8505. "type": "string",
  8506. "enum": ["info", "success", "warning", "error"]
  8507. },
  8508. "duration": {
  8509. "description": "Duration in milliseconds",
  8510. "default": 5000,
  8511. "type": "number"
  8512. }
  8513. },
  8514. "required": ["message", "variant"]
  8515. }
  8516. },
  8517. "required": ["type", "properties"]
  8518. },
  8519. "Event.tui.session.select": {
  8520. "type": "object",
  8521. "properties": {
  8522. "type": {
  8523. "type": "string",
  8524. "const": "tui.session.select"
  8525. },
  8526. "properties": {
  8527. "type": "object",
  8528. "properties": {
  8529. "sessionID": {
  8530. "description": "Session ID to navigate to",
  8531. "type": "string",
  8532. "pattern": "^ses.*"
  8533. }
  8534. },
  8535. "required": ["sessionID"]
  8536. }
  8537. },
  8538. "required": ["type", "properties"]
  8539. },
  8540. "Event.mcp.tools.changed": {
  8541. "type": "object",
  8542. "properties": {
  8543. "type": {
  8544. "type": "string",
  8545. "const": "mcp.tools.changed"
  8546. },
  8547. "properties": {
  8548. "type": "object",
  8549. "properties": {
  8550. "server": {
  8551. "type": "string"
  8552. }
  8553. },
  8554. "required": ["server"]
  8555. }
  8556. },
  8557. "required": ["type", "properties"]
  8558. },
  8559. "Event.mcp.browser.open.failed": {
  8560. "type": "object",
  8561. "properties": {
  8562. "type": {
  8563. "type": "string",
  8564. "const": "mcp.browser.open.failed"
  8565. },
  8566. "properties": {
  8567. "type": "object",
  8568. "properties": {
  8569. "mcpName": {
  8570. "type": "string"
  8571. },
  8572. "url": {
  8573. "type": "string"
  8574. }
  8575. },
  8576. "required": ["mcpName", "url"]
  8577. }
  8578. },
  8579. "required": ["type", "properties"]
  8580. },
  8581. "Event.command.executed": {
  8582. "type": "object",
  8583. "properties": {
  8584. "type": {
  8585. "type": "string",
  8586. "const": "command.executed"
  8587. },
  8588. "properties": {
  8589. "type": "object",
  8590. "properties": {
  8591. "name": {
  8592. "type": "string"
  8593. },
  8594. "sessionID": {
  8595. "type": "string",
  8596. "pattern": "^ses.*"
  8597. },
  8598. "arguments": {
  8599. "type": "string"
  8600. },
  8601. "messageID": {
  8602. "type": "string",
  8603. "pattern": "^msg.*"
  8604. }
  8605. },
  8606. "required": ["name", "sessionID", "arguments", "messageID"]
  8607. }
  8608. },
  8609. "required": ["type", "properties"]
  8610. },
  8611. "Event.vcs.branch.updated": {
  8612. "type": "object",
  8613. "properties": {
  8614. "type": {
  8615. "type": "string",
  8616. "const": "vcs.branch.updated"
  8617. },
  8618. "properties": {
  8619. "type": "object",
  8620. "properties": {
  8621. "branch": {
  8622. "type": "string"
  8623. }
  8624. }
  8625. }
  8626. },
  8627. "required": ["type", "properties"]
  8628. },
  8629. "Event.worktree.ready": {
  8630. "type": "object",
  8631. "properties": {
  8632. "type": {
  8633. "type": "string",
  8634. "const": "worktree.ready"
  8635. },
  8636. "properties": {
  8637. "type": "object",
  8638. "properties": {
  8639. "name": {
  8640. "type": "string"
  8641. },
  8642. "branch": {
  8643. "type": "string"
  8644. }
  8645. },
  8646. "required": ["name", "branch"]
  8647. }
  8648. },
  8649. "required": ["type", "properties"]
  8650. },
  8651. "Event.worktree.failed": {
  8652. "type": "object",
  8653. "properties": {
  8654. "type": {
  8655. "type": "string",
  8656. "const": "worktree.failed"
  8657. },
  8658. "properties": {
  8659. "type": "object",
  8660. "properties": {
  8661. "message": {
  8662. "type": "string"
  8663. }
  8664. },
  8665. "required": ["message"]
  8666. }
  8667. },
  8668. "required": ["type", "properties"]
  8669. },
  8670. "Pty": {
  8671. "type": "object",
  8672. "properties": {
  8673. "id": {
  8674. "type": "string",
  8675. "pattern": "^pty.*"
  8676. },
  8677. "title": {
  8678. "type": "string"
  8679. },
  8680. "command": {
  8681. "type": "string"
  8682. },
  8683. "args": {
  8684. "type": "array",
  8685. "items": {
  8686. "type": "string"
  8687. }
  8688. },
  8689. "cwd": {
  8690. "type": "string"
  8691. },
  8692. "status": {
  8693. "type": "string",
  8694. "enum": ["running", "exited"]
  8695. },
  8696. "pid": {
  8697. "type": "number"
  8698. }
  8699. },
  8700. "required": ["id", "title", "command", "args", "cwd", "status", "pid"]
  8701. },
  8702. "Event.pty.created": {
  8703. "type": "object",
  8704. "properties": {
  8705. "type": {
  8706. "type": "string",
  8707. "const": "pty.created"
  8708. },
  8709. "properties": {
  8710. "type": "object",
  8711. "properties": {
  8712. "info": {
  8713. "$ref": "#/components/schemas/Pty"
  8714. }
  8715. },
  8716. "required": ["info"]
  8717. }
  8718. },
  8719. "required": ["type", "properties"]
  8720. },
  8721. "Event.pty.updated": {
  8722. "type": "object",
  8723. "properties": {
  8724. "type": {
  8725. "type": "string",
  8726. "const": "pty.updated"
  8727. },
  8728. "properties": {
  8729. "type": "object",
  8730. "properties": {
  8731. "info": {
  8732. "$ref": "#/components/schemas/Pty"
  8733. }
  8734. },
  8735. "required": ["info"]
  8736. }
  8737. },
  8738. "required": ["type", "properties"]
  8739. },
  8740. "Event.pty.exited": {
  8741. "type": "object",
  8742. "properties": {
  8743. "type": {
  8744. "type": "string",
  8745. "const": "pty.exited"
  8746. },
  8747. "properties": {
  8748. "type": "object",
  8749. "properties": {
  8750. "id": {
  8751. "type": "string",
  8752. "pattern": "^pty.*"
  8753. },
  8754. "exitCode": {
  8755. "type": "number"
  8756. }
  8757. },
  8758. "required": ["id", "exitCode"]
  8759. }
  8760. },
  8761. "required": ["type", "properties"]
  8762. },
  8763. "Event.pty.deleted": {
  8764. "type": "object",
  8765. "properties": {
  8766. "type": {
  8767. "type": "string",
  8768. "const": "pty.deleted"
  8769. },
  8770. "properties": {
  8771. "type": "object",
  8772. "properties": {
  8773. "id": {
  8774. "type": "string",
  8775. "pattern": "^pty.*"
  8776. }
  8777. },
  8778. "required": ["id"]
  8779. }
  8780. },
  8781. "required": ["type", "properties"]
  8782. },
  8783. "Event.workspace.ready": {
  8784. "type": "object",
  8785. "properties": {
  8786. "type": {
  8787. "type": "string",
  8788. "const": "workspace.ready"
  8789. },
  8790. "properties": {
  8791. "type": "object",
  8792. "properties": {
  8793. "name": {
  8794. "type": "string"
  8795. }
  8796. },
  8797. "required": ["name"]
  8798. }
  8799. },
  8800. "required": ["type", "properties"]
  8801. },
  8802. "Event.workspace.failed": {
  8803. "type": "object",
  8804. "properties": {
  8805. "type": {
  8806. "type": "string",
  8807. "const": "workspace.failed"
  8808. },
  8809. "properties": {
  8810. "type": "object",
  8811. "properties": {
  8812. "message": {
  8813. "type": "string"
  8814. }
  8815. },
  8816. "required": ["message"]
  8817. }
  8818. },
  8819. "required": ["type", "properties"]
  8820. },
  8821. "Event.workspace.restore": {
  8822. "type": "object",
  8823. "properties": {
  8824. "type": {
  8825. "type": "string",
  8826. "const": "workspace.restore"
  8827. },
  8828. "properties": {
  8829. "type": "object",
  8830. "properties": {
  8831. "workspaceID": {
  8832. "type": "string",
  8833. "pattern": "^wrk.*"
  8834. },
  8835. "sessionID": {
  8836. "type": "string",
  8837. "pattern": "^ses.*"
  8838. },
  8839. "total": {
  8840. "type": "integer",
  8841. "minimum": 0,
  8842. "maximum": 9007199254740991
  8843. },
  8844. "step": {
  8845. "type": "integer",
  8846. "minimum": 0,
  8847. "maximum": 9007199254740991
  8848. }
  8849. },
  8850. "required": ["workspaceID", "sessionID", "total", "step"]
  8851. }
  8852. },
  8853. "required": ["type", "properties"]
  8854. },
  8855. "Event.workspace.status": {
  8856. "type": "object",
  8857. "properties": {
  8858. "type": {
  8859. "type": "string",
  8860. "const": "workspace.status"
  8861. },
  8862. "properties": {
  8863. "type": "object",
  8864. "properties": {
  8865. "workspaceID": {
  8866. "type": "string",
  8867. "pattern": "^wrk.*"
  8868. },
  8869. "status": {
  8870. "type": "string",
  8871. "enum": ["connected", "connecting", "disconnected", "error"]
  8872. }
  8873. },
  8874. "required": ["workspaceID", "status"]
  8875. }
  8876. },
  8877. "required": ["type", "properties"]
  8878. },
  8879. "OutputFormatText": {
  8880. "type": "object",
  8881. "properties": {
  8882. "type": {
  8883. "type": "string",
  8884. "const": "text"
  8885. }
  8886. },
  8887. "required": ["type"]
  8888. },
  8889. "JSONSchema": {
  8890. "type": "object",
  8891. "propertyNames": {
  8892. "type": "string"
  8893. },
  8894. "additionalProperties": {}
  8895. },
  8896. "OutputFormatJsonSchema": {
  8897. "type": "object",
  8898. "properties": {
  8899. "type": {
  8900. "type": "string",
  8901. "const": "json_schema"
  8902. },
  8903. "schema": {
  8904. "$ref": "#/components/schemas/JSONSchema"
  8905. },
  8906. "retryCount": {
  8907. "default": 2,
  8908. "type": "integer",
  8909. "minimum": 0,
  8910. "maximum": 9007199254740991
  8911. }
  8912. },
  8913. "required": ["type", "schema"]
  8914. },
  8915. "OutputFormat": {
  8916. "anyOf": [
  8917. {
  8918. "$ref": "#/components/schemas/OutputFormatText"
  8919. },
  8920. {
  8921. "$ref": "#/components/schemas/OutputFormatJsonSchema"
  8922. }
  8923. ]
  8924. },
  8925. "UserMessage": {
  8926. "type": "object",
  8927. "properties": {
  8928. "id": {
  8929. "type": "string",
  8930. "pattern": "^msg.*"
  8931. },
  8932. "sessionID": {
  8933. "type": "string",
  8934. "pattern": "^ses.*"
  8935. },
  8936. "role": {
  8937. "type": "string",
  8938. "const": "user"
  8939. },
  8940. "time": {
  8941. "type": "object",
  8942. "properties": {
  8943. "created": {
  8944. "type": "number"
  8945. }
  8946. },
  8947. "required": ["created"]
  8948. },
  8949. "format": {
  8950. "$ref": "#/components/schemas/OutputFormat"
  8951. },
  8952. "summary": {
  8953. "type": "object",
  8954. "properties": {
  8955. "title": {
  8956. "type": "string"
  8957. },
  8958. "body": {
  8959. "type": "string"
  8960. },
  8961. "diffs": {
  8962. "type": "array",
  8963. "items": {
  8964. "$ref": "#/components/schemas/SnapshotFileDiff"
  8965. }
  8966. }
  8967. },
  8968. "required": ["diffs"]
  8969. },
  8970. "agent": {
  8971. "type": "string"
  8972. },
  8973. "model": {
  8974. "type": "object",
  8975. "properties": {
  8976. "providerID": {
  8977. "type": "string"
  8978. },
  8979. "modelID": {
  8980. "type": "string"
  8981. },
  8982. "variant": {
  8983. "type": "string"
  8984. }
  8985. },
  8986. "required": ["providerID", "modelID"]
  8987. },
  8988. "system": {
  8989. "type": "string"
  8990. },
  8991. "tools": {
  8992. "type": "object",
  8993. "propertyNames": {
  8994. "type": "string"
  8995. },
  8996. "additionalProperties": {
  8997. "type": "boolean"
  8998. }
  8999. }
  9000. },
  9001. "required": ["id", "sessionID", "role", "time", "agent", "model"]
  9002. },
  9003. "AssistantMessage": {
  9004. "type": "object",
  9005. "properties": {
  9006. "id": {
  9007. "type": "string",
  9008. "pattern": "^msg.*"
  9009. },
  9010. "sessionID": {
  9011. "type": "string",
  9012. "pattern": "^ses.*"
  9013. },
  9014. "role": {
  9015. "type": "string",
  9016. "const": "assistant"
  9017. },
  9018. "time": {
  9019. "type": "object",
  9020. "properties": {
  9021. "created": {
  9022. "type": "number"
  9023. },
  9024. "completed": {
  9025. "type": "number"
  9026. }
  9027. },
  9028. "required": ["created"]
  9029. },
  9030. "error": {
  9031. "anyOf": [
  9032. {
  9033. "$ref": "#/components/schemas/ProviderAuthError"
  9034. },
  9035. {
  9036. "$ref": "#/components/schemas/UnknownError"
  9037. },
  9038. {
  9039. "$ref": "#/components/schemas/MessageOutputLengthError"
  9040. },
  9041. {
  9042. "$ref": "#/components/schemas/MessageAbortedError"
  9043. },
  9044. {
  9045. "$ref": "#/components/schemas/StructuredOutputError"
  9046. },
  9047. {
  9048. "$ref": "#/components/schemas/ContextOverflowError"
  9049. },
  9050. {
  9051. "$ref": "#/components/schemas/APIError"
  9052. }
  9053. ]
  9054. },
  9055. "parentID": {
  9056. "type": "string",
  9057. "pattern": "^msg.*"
  9058. },
  9059. "modelID": {
  9060. "type": "string"
  9061. },
  9062. "providerID": {
  9063. "type": "string"
  9064. },
  9065. "mode": {
  9066. "type": "string"
  9067. },
  9068. "agent": {
  9069. "type": "string"
  9070. },
  9071. "path": {
  9072. "type": "object",
  9073. "properties": {
  9074. "cwd": {
  9075. "type": "string"
  9076. },
  9077. "root": {
  9078. "type": "string"
  9079. }
  9080. },
  9081. "required": ["cwd", "root"]
  9082. },
  9083. "summary": {
  9084. "type": "boolean"
  9085. },
  9086. "cost": {
  9087. "type": "number"
  9088. },
  9089. "tokens": {
  9090. "type": "object",
  9091. "properties": {
  9092. "total": {
  9093. "type": "number"
  9094. },
  9095. "input": {
  9096. "type": "number"
  9097. },
  9098. "output": {
  9099. "type": "number"
  9100. },
  9101. "reasoning": {
  9102. "type": "number"
  9103. },
  9104. "cache": {
  9105. "type": "object",
  9106. "properties": {
  9107. "read": {
  9108. "type": "number"
  9109. },
  9110. "write": {
  9111. "type": "number"
  9112. }
  9113. },
  9114. "required": ["read", "write"]
  9115. }
  9116. },
  9117. "required": ["input", "output", "reasoning", "cache"]
  9118. },
  9119. "structured": {},
  9120. "variant": {
  9121. "type": "string"
  9122. },
  9123. "finish": {
  9124. "type": "string"
  9125. }
  9126. },
  9127. "required": [
  9128. "id",
  9129. "sessionID",
  9130. "role",
  9131. "time",
  9132. "parentID",
  9133. "modelID",
  9134. "providerID",
  9135. "mode",
  9136. "agent",
  9137. "path",
  9138. "cost",
  9139. "tokens"
  9140. ]
  9141. },
  9142. "Message": {
  9143. "anyOf": [
  9144. {
  9145. "$ref": "#/components/schemas/UserMessage"
  9146. },
  9147. {
  9148. "$ref": "#/components/schemas/AssistantMessage"
  9149. }
  9150. ]
  9151. },
  9152. "Event.message.updated": {
  9153. "type": "object",
  9154. "properties": {
  9155. "type": {
  9156. "type": "string",
  9157. "const": "message.updated"
  9158. },
  9159. "properties": {
  9160. "type": "object",
  9161. "properties": {
  9162. "sessionID": {
  9163. "type": "string",
  9164. "pattern": "^ses.*"
  9165. },
  9166. "info": {
  9167. "$ref": "#/components/schemas/Message"
  9168. }
  9169. },
  9170. "required": ["sessionID", "info"]
  9171. }
  9172. },
  9173. "required": ["type", "properties"]
  9174. },
  9175. "Event.message.removed": {
  9176. "type": "object",
  9177. "properties": {
  9178. "type": {
  9179. "type": "string",
  9180. "const": "message.removed"
  9181. },
  9182. "properties": {
  9183. "type": "object",
  9184. "properties": {
  9185. "sessionID": {
  9186. "type": "string",
  9187. "pattern": "^ses.*"
  9188. },
  9189. "messageID": {
  9190. "type": "string",
  9191. "pattern": "^msg.*"
  9192. }
  9193. },
  9194. "required": ["sessionID", "messageID"]
  9195. }
  9196. },
  9197. "required": ["type", "properties"]
  9198. },
  9199. "TextPart": {
  9200. "type": "object",
  9201. "properties": {
  9202. "id": {
  9203. "type": "string",
  9204. "pattern": "^prt.*"
  9205. },
  9206. "sessionID": {
  9207. "type": "string",
  9208. "pattern": "^ses.*"
  9209. },
  9210. "messageID": {
  9211. "type": "string",
  9212. "pattern": "^msg.*"
  9213. },
  9214. "type": {
  9215. "type": "string",
  9216. "const": "text"
  9217. },
  9218. "text": {
  9219. "type": "string"
  9220. },
  9221. "synthetic": {
  9222. "type": "boolean"
  9223. },
  9224. "ignored": {
  9225. "type": "boolean"
  9226. },
  9227. "time": {
  9228. "type": "object",
  9229. "properties": {
  9230. "start": {
  9231. "type": "number"
  9232. },
  9233. "end": {
  9234. "type": "number"
  9235. }
  9236. },
  9237. "required": ["start"]
  9238. },
  9239. "metadata": {
  9240. "type": "object",
  9241. "propertyNames": {
  9242. "type": "string"
  9243. },
  9244. "additionalProperties": {}
  9245. }
  9246. },
  9247. "required": ["id", "sessionID", "messageID", "type", "text"]
  9248. },
  9249. "SubtaskPart": {
  9250. "type": "object",
  9251. "properties": {
  9252. "id": {
  9253. "type": "string",
  9254. "pattern": "^prt.*"
  9255. },
  9256. "sessionID": {
  9257. "type": "string",
  9258. "pattern": "^ses.*"
  9259. },
  9260. "messageID": {
  9261. "type": "string",
  9262. "pattern": "^msg.*"
  9263. },
  9264. "type": {
  9265. "type": "string",
  9266. "const": "subtask"
  9267. },
  9268. "prompt": {
  9269. "type": "string"
  9270. },
  9271. "description": {
  9272. "type": "string"
  9273. },
  9274. "agent": {
  9275. "type": "string"
  9276. },
  9277. "model": {
  9278. "type": "object",
  9279. "properties": {
  9280. "providerID": {
  9281. "type": "string"
  9282. },
  9283. "modelID": {
  9284. "type": "string"
  9285. }
  9286. },
  9287. "required": ["providerID", "modelID"]
  9288. },
  9289. "command": {
  9290. "type": "string"
  9291. }
  9292. },
  9293. "required": ["id", "sessionID", "messageID", "type", "prompt", "description", "agent"]
  9294. },
  9295. "ReasoningPart": {
  9296. "type": "object",
  9297. "properties": {
  9298. "id": {
  9299. "type": "string",
  9300. "pattern": "^prt.*"
  9301. },
  9302. "sessionID": {
  9303. "type": "string",
  9304. "pattern": "^ses.*"
  9305. },
  9306. "messageID": {
  9307. "type": "string",
  9308. "pattern": "^msg.*"
  9309. },
  9310. "type": {
  9311. "type": "string",
  9312. "const": "reasoning"
  9313. },
  9314. "text": {
  9315. "type": "string"
  9316. },
  9317. "metadata": {
  9318. "type": "object",
  9319. "propertyNames": {
  9320. "type": "string"
  9321. },
  9322. "additionalProperties": {}
  9323. },
  9324. "time": {
  9325. "type": "object",
  9326. "properties": {
  9327. "start": {
  9328. "type": "number"
  9329. },
  9330. "end": {
  9331. "type": "number"
  9332. }
  9333. },
  9334. "required": ["start"]
  9335. }
  9336. },
  9337. "required": ["id", "sessionID", "messageID", "type", "text", "time"]
  9338. },
  9339. "FilePartSourceText": {
  9340. "type": "object",
  9341. "properties": {
  9342. "value": {
  9343. "type": "string"
  9344. },
  9345. "start": {
  9346. "type": "integer",
  9347. "minimum": -9007199254740991,
  9348. "maximum": 9007199254740991
  9349. },
  9350. "end": {
  9351. "type": "integer",
  9352. "minimum": -9007199254740991,
  9353. "maximum": 9007199254740991
  9354. }
  9355. },
  9356. "required": ["value", "start", "end"]
  9357. },
  9358. "FileSource": {
  9359. "type": "object",
  9360. "properties": {
  9361. "text": {
  9362. "$ref": "#/components/schemas/FilePartSourceText"
  9363. },
  9364. "type": {
  9365. "type": "string",
  9366. "const": "file"
  9367. },
  9368. "path": {
  9369. "type": "string"
  9370. }
  9371. },
  9372. "required": ["text", "type", "path"]
  9373. },
  9374. "Range": {
  9375. "type": "object",
  9376. "properties": {
  9377. "start": {
  9378. "type": "object",
  9379. "properties": {
  9380. "line": {
  9381. "type": "number"
  9382. },
  9383. "character": {
  9384. "type": "number"
  9385. }
  9386. },
  9387. "required": ["line", "character"]
  9388. },
  9389. "end": {
  9390. "type": "object",
  9391. "properties": {
  9392. "line": {
  9393. "type": "number"
  9394. },
  9395. "character": {
  9396. "type": "number"
  9397. }
  9398. },
  9399. "required": ["line", "character"]
  9400. }
  9401. },
  9402. "required": ["start", "end"]
  9403. },
  9404. "SymbolSource": {
  9405. "type": "object",
  9406. "properties": {
  9407. "text": {
  9408. "$ref": "#/components/schemas/FilePartSourceText"
  9409. },
  9410. "type": {
  9411. "type": "string",
  9412. "const": "symbol"
  9413. },
  9414. "path": {
  9415. "type": "string"
  9416. },
  9417. "range": {
  9418. "$ref": "#/components/schemas/Range"
  9419. },
  9420. "name": {
  9421. "type": "string"
  9422. },
  9423. "kind": {
  9424. "type": "integer",
  9425. "minimum": -9007199254740991,
  9426. "maximum": 9007199254740991
  9427. }
  9428. },
  9429. "required": ["text", "type", "path", "range", "name", "kind"]
  9430. },
  9431. "ResourceSource": {
  9432. "type": "object",
  9433. "properties": {
  9434. "text": {
  9435. "$ref": "#/components/schemas/FilePartSourceText"
  9436. },
  9437. "type": {
  9438. "type": "string",
  9439. "const": "resource"
  9440. },
  9441. "clientName": {
  9442. "type": "string"
  9443. },
  9444. "uri": {
  9445. "type": "string"
  9446. }
  9447. },
  9448. "required": ["text", "type", "clientName", "uri"]
  9449. },
  9450. "FilePartSource": {
  9451. "anyOf": [
  9452. {
  9453. "$ref": "#/components/schemas/FileSource"
  9454. },
  9455. {
  9456. "$ref": "#/components/schemas/SymbolSource"
  9457. },
  9458. {
  9459. "$ref": "#/components/schemas/ResourceSource"
  9460. }
  9461. ]
  9462. },
  9463. "FilePart": {
  9464. "type": "object",
  9465. "properties": {
  9466. "id": {
  9467. "type": "string",
  9468. "pattern": "^prt.*"
  9469. },
  9470. "sessionID": {
  9471. "type": "string",
  9472. "pattern": "^ses.*"
  9473. },
  9474. "messageID": {
  9475. "type": "string",
  9476. "pattern": "^msg.*"
  9477. },
  9478. "type": {
  9479. "type": "string",
  9480. "const": "file"
  9481. },
  9482. "mime": {
  9483. "type": "string"
  9484. },
  9485. "filename": {
  9486. "type": "string"
  9487. },
  9488. "url": {
  9489. "type": "string"
  9490. },
  9491. "source": {
  9492. "$ref": "#/components/schemas/FilePartSource"
  9493. }
  9494. },
  9495. "required": ["id", "sessionID", "messageID", "type", "mime", "url"]
  9496. },
  9497. "ToolStatePending": {
  9498. "type": "object",
  9499. "properties": {
  9500. "status": {
  9501. "type": "string",
  9502. "const": "pending"
  9503. },
  9504. "input": {
  9505. "type": "object",
  9506. "propertyNames": {
  9507. "type": "string"
  9508. },
  9509. "additionalProperties": {}
  9510. },
  9511. "raw": {
  9512. "type": "string"
  9513. }
  9514. },
  9515. "required": ["status", "input", "raw"]
  9516. },
  9517. "ToolStateRunning": {
  9518. "type": "object",
  9519. "properties": {
  9520. "status": {
  9521. "type": "string",
  9522. "const": "running"
  9523. },
  9524. "input": {
  9525. "type": "object",
  9526. "propertyNames": {
  9527. "type": "string"
  9528. },
  9529. "additionalProperties": {}
  9530. },
  9531. "title": {
  9532. "type": "string"
  9533. },
  9534. "metadata": {
  9535. "type": "object",
  9536. "propertyNames": {
  9537. "type": "string"
  9538. },
  9539. "additionalProperties": {}
  9540. },
  9541. "time": {
  9542. "type": "object",
  9543. "properties": {
  9544. "start": {
  9545. "type": "number"
  9546. }
  9547. },
  9548. "required": ["start"]
  9549. }
  9550. },
  9551. "required": ["status", "input", "time"]
  9552. },
  9553. "ToolStateCompleted": {
  9554. "type": "object",
  9555. "properties": {
  9556. "status": {
  9557. "type": "string",
  9558. "const": "completed"
  9559. },
  9560. "input": {
  9561. "type": "object",
  9562. "propertyNames": {
  9563. "type": "string"
  9564. },
  9565. "additionalProperties": {}
  9566. },
  9567. "output": {
  9568. "type": "string"
  9569. },
  9570. "title": {
  9571. "type": "string"
  9572. },
  9573. "metadata": {
  9574. "type": "object",
  9575. "propertyNames": {
  9576. "type": "string"
  9577. },
  9578. "additionalProperties": {}
  9579. },
  9580. "time": {
  9581. "type": "object",
  9582. "properties": {
  9583. "start": {
  9584. "type": "number"
  9585. },
  9586. "end": {
  9587. "type": "number"
  9588. },
  9589. "compacted": {
  9590. "type": "number"
  9591. }
  9592. },
  9593. "required": ["start", "end"]
  9594. },
  9595. "attachments": {
  9596. "type": "array",
  9597. "items": {
  9598. "$ref": "#/components/schemas/FilePart"
  9599. }
  9600. }
  9601. },
  9602. "required": ["status", "input", "output", "title", "metadata", "time"]
  9603. },
  9604. "ToolStateError": {
  9605. "type": "object",
  9606. "properties": {
  9607. "status": {
  9608. "type": "string",
  9609. "const": "error"
  9610. },
  9611. "input": {
  9612. "type": "object",
  9613. "propertyNames": {
  9614. "type": "string"
  9615. },
  9616. "additionalProperties": {}
  9617. },
  9618. "error": {
  9619. "type": "string"
  9620. },
  9621. "metadata": {
  9622. "type": "object",
  9623. "propertyNames": {
  9624. "type": "string"
  9625. },
  9626. "additionalProperties": {}
  9627. },
  9628. "time": {
  9629. "type": "object",
  9630. "properties": {
  9631. "start": {
  9632. "type": "number"
  9633. },
  9634. "end": {
  9635. "type": "number"
  9636. }
  9637. },
  9638. "required": ["start", "end"]
  9639. }
  9640. },
  9641. "required": ["status", "input", "error", "time"]
  9642. },
  9643. "ToolState": {
  9644. "anyOf": [
  9645. {
  9646. "$ref": "#/components/schemas/ToolStatePending"
  9647. },
  9648. {
  9649. "$ref": "#/components/schemas/ToolStateRunning"
  9650. },
  9651. {
  9652. "$ref": "#/components/schemas/ToolStateCompleted"
  9653. },
  9654. {
  9655. "$ref": "#/components/schemas/ToolStateError"
  9656. }
  9657. ]
  9658. },
  9659. "ToolPart": {
  9660. "type": "object",
  9661. "properties": {
  9662. "id": {
  9663. "type": "string",
  9664. "pattern": "^prt.*"
  9665. },
  9666. "sessionID": {
  9667. "type": "string",
  9668. "pattern": "^ses.*"
  9669. },
  9670. "messageID": {
  9671. "type": "string",
  9672. "pattern": "^msg.*"
  9673. },
  9674. "type": {
  9675. "type": "string",
  9676. "const": "tool"
  9677. },
  9678. "callID": {
  9679. "type": "string"
  9680. },
  9681. "tool": {
  9682. "type": "string"
  9683. },
  9684. "state": {
  9685. "$ref": "#/components/schemas/ToolState"
  9686. },
  9687. "metadata": {
  9688. "type": "object",
  9689. "propertyNames": {
  9690. "type": "string"
  9691. },
  9692. "additionalProperties": {}
  9693. }
  9694. },
  9695. "required": ["id", "sessionID", "messageID", "type", "callID", "tool", "state"]
  9696. },
  9697. "StepStartPart": {
  9698. "type": "object",
  9699. "properties": {
  9700. "id": {
  9701. "type": "string",
  9702. "pattern": "^prt.*"
  9703. },
  9704. "sessionID": {
  9705. "type": "string",
  9706. "pattern": "^ses.*"
  9707. },
  9708. "messageID": {
  9709. "type": "string",
  9710. "pattern": "^msg.*"
  9711. },
  9712. "type": {
  9713. "type": "string",
  9714. "const": "step-start"
  9715. },
  9716. "snapshot": {
  9717. "type": "string"
  9718. }
  9719. },
  9720. "required": ["id", "sessionID", "messageID", "type"]
  9721. },
  9722. "StepFinishPart": {
  9723. "type": "object",
  9724. "properties": {
  9725. "id": {
  9726. "type": "string",
  9727. "pattern": "^prt.*"
  9728. },
  9729. "sessionID": {
  9730. "type": "string",
  9731. "pattern": "^ses.*"
  9732. },
  9733. "messageID": {
  9734. "type": "string",
  9735. "pattern": "^msg.*"
  9736. },
  9737. "type": {
  9738. "type": "string",
  9739. "const": "step-finish"
  9740. },
  9741. "reason": {
  9742. "type": "string"
  9743. },
  9744. "snapshot": {
  9745. "type": "string"
  9746. },
  9747. "cost": {
  9748. "type": "number"
  9749. },
  9750. "tokens": {
  9751. "type": "object",
  9752. "properties": {
  9753. "total": {
  9754. "type": "number"
  9755. },
  9756. "input": {
  9757. "type": "number"
  9758. },
  9759. "output": {
  9760. "type": "number"
  9761. },
  9762. "reasoning": {
  9763. "type": "number"
  9764. },
  9765. "cache": {
  9766. "type": "object",
  9767. "properties": {
  9768. "read": {
  9769. "type": "number"
  9770. },
  9771. "write": {
  9772. "type": "number"
  9773. }
  9774. },
  9775. "required": ["read", "write"]
  9776. }
  9777. },
  9778. "required": ["input", "output", "reasoning", "cache"]
  9779. }
  9780. },
  9781. "required": ["id", "sessionID", "messageID", "type", "reason", "cost", "tokens"]
  9782. },
  9783. "SnapshotPart": {
  9784. "type": "object",
  9785. "properties": {
  9786. "id": {
  9787. "type": "string",
  9788. "pattern": "^prt.*"
  9789. },
  9790. "sessionID": {
  9791. "type": "string",
  9792. "pattern": "^ses.*"
  9793. },
  9794. "messageID": {
  9795. "type": "string",
  9796. "pattern": "^msg.*"
  9797. },
  9798. "type": {
  9799. "type": "string",
  9800. "const": "snapshot"
  9801. },
  9802. "snapshot": {
  9803. "type": "string"
  9804. }
  9805. },
  9806. "required": ["id", "sessionID", "messageID", "type", "snapshot"]
  9807. },
  9808. "PatchPart": {
  9809. "type": "object",
  9810. "properties": {
  9811. "id": {
  9812. "type": "string",
  9813. "pattern": "^prt.*"
  9814. },
  9815. "sessionID": {
  9816. "type": "string",
  9817. "pattern": "^ses.*"
  9818. },
  9819. "messageID": {
  9820. "type": "string",
  9821. "pattern": "^msg.*"
  9822. },
  9823. "type": {
  9824. "type": "string",
  9825. "const": "patch"
  9826. },
  9827. "hash": {
  9828. "type": "string"
  9829. },
  9830. "files": {
  9831. "type": "array",
  9832. "items": {
  9833. "type": "string"
  9834. }
  9835. }
  9836. },
  9837. "required": ["id", "sessionID", "messageID", "type", "hash", "files"]
  9838. },
  9839. "AgentPart": {
  9840. "type": "object",
  9841. "properties": {
  9842. "id": {
  9843. "type": "string",
  9844. "pattern": "^prt.*"
  9845. },
  9846. "sessionID": {
  9847. "type": "string",
  9848. "pattern": "^ses.*"
  9849. },
  9850. "messageID": {
  9851. "type": "string",
  9852. "pattern": "^msg.*"
  9853. },
  9854. "type": {
  9855. "type": "string",
  9856. "const": "agent"
  9857. },
  9858. "name": {
  9859. "type": "string"
  9860. },
  9861. "source": {
  9862. "type": "object",
  9863. "properties": {
  9864. "value": {
  9865. "type": "string"
  9866. },
  9867. "start": {
  9868. "type": "integer",
  9869. "minimum": -9007199254740991,
  9870. "maximum": 9007199254740991
  9871. },
  9872. "end": {
  9873. "type": "integer",
  9874. "minimum": -9007199254740991,
  9875. "maximum": 9007199254740991
  9876. }
  9877. },
  9878. "required": ["value", "start", "end"]
  9879. }
  9880. },
  9881. "required": ["id", "sessionID", "messageID", "type", "name"]
  9882. },
  9883. "RetryPart": {
  9884. "type": "object",
  9885. "properties": {
  9886. "id": {
  9887. "type": "string",
  9888. "pattern": "^prt.*"
  9889. },
  9890. "sessionID": {
  9891. "type": "string",
  9892. "pattern": "^ses.*"
  9893. },
  9894. "messageID": {
  9895. "type": "string",
  9896. "pattern": "^msg.*"
  9897. },
  9898. "type": {
  9899. "type": "string",
  9900. "const": "retry"
  9901. },
  9902. "attempt": {
  9903. "type": "number"
  9904. },
  9905. "error": {
  9906. "$ref": "#/components/schemas/APIError"
  9907. },
  9908. "time": {
  9909. "type": "object",
  9910. "properties": {
  9911. "created": {
  9912. "type": "number"
  9913. }
  9914. },
  9915. "required": ["created"]
  9916. }
  9917. },
  9918. "required": ["id", "sessionID", "messageID", "type", "attempt", "error", "time"]
  9919. },
  9920. "CompactionPart": {
  9921. "type": "object",
  9922. "properties": {
  9923. "id": {
  9924. "type": "string",
  9925. "pattern": "^prt.*"
  9926. },
  9927. "sessionID": {
  9928. "type": "string",
  9929. "pattern": "^ses.*"
  9930. },
  9931. "messageID": {
  9932. "type": "string",
  9933. "pattern": "^msg.*"
  9934. },
  9935. "type": {
  9936. "type": "string",
  9937. "const": "compaction"
  9938. },
  9939. "auto": {
  9940. "type": "boolean"
  9941. },
  9942. "overflow": {
  9943. "type": "boolean"
  9944. },
  9945. "tail_start_id": {
  9946. "type": "string",
  9947. "pattern": "^msg.*"
  9948. }
  9949. },
  9950. "required": ["id", "sessionID", "messageID", "type", "auto"]
  9951. },
  9952. "Part": {
  9953. "anyOf": [
  9954. {
  9955. "$ref": "#/components/schemas/TextPart"
  9956. },
  9957. {
  9958. "$ref": "#/components/schemas/SubtaskPart"
  9959. },
  9960. {
  9961. "$ref": "#/components/schemas/ReasoningPart"
  9962. },
  9963. {
  9964. "$ref": "#/components/schemas/FilePart"
  9965. },
  9966. {
  9967. "$ref": "#/components/schemas/ToolPart"
  9968. },
  9969. {
  9970. "$ref": "#/components/schemas/StepStartPart"
  9971. },
  9972. {
  9973. "$ref": "#/components/schemas/StepFinishPart"
  9974. },
  9975. {
  9976. "$ref": "#/components/schemas/SnapshotPart"
  9977. },
  9978. {
  9979. "$ref": "#/components/schemas/PatchPart"
  9980. },
  9981. {
  9982. "$ref": "#/components/schemas/AgentPart"
  9983. },
  9984. {
  9985. "$ref": "#/components/schemas/RetryPart"
  9986. },
  9987. {
  9988. "$ref": "#/components/schemas/CompactionPart"
  9989. }
  9990. ]
  9991. },
  9992. "Event.message.part.updated": {
  9993. "type": "object",
  9994. "properties": {
  9995. "type": {
  9996. "type": "string",
  9997. "const": "message.part.updated"
  9998. },
  9999. "properties": {
  10000. "type": "object",
  10001. "properties": {
  10002. "sessionID": {
  10003. "type": "string",
  10004. "pattern": "^ses.*"
  10005. },
  10006. "part": {
  10007. "$ref": "#/components/schemas/Part"
  10008. },
  10009. "time": {
  10010. "type": "number"
  10011. }
  10012. },
  10013. "required": ["sessionID", "part", "time"]
  10014. }
  10015. },
  10016. "required": ["type", "properties"]
  10017. },
  10018. "Event.message.part.removed": {
  10019. "type": "object",
  10020. "properties": {
  10021. "type": {
  10022. "type": "string",
  10023. "const": "message.part.removed"
  10024. },
  10025. "properties": {
  10026. "type": "object",
  10027. "properties": {
  10028. "sessionID": {
  10029. "type": "string",
  10030. "pattern": "^ses.*"
  10031. },
  10032. "messageID": {
  10033. "type": "string",
  10034. "pattern": "^msg.*"
  10035. },
  10036. "partID": {
  10037. "type": "string",
  10038. "pattern": "^prt.*"
  10039. }
  10040. },
  10041. "required": ["sessionID", "messageID", "partID"]
  10042. }
  10043. },
  10044. "required": ["type", "properties"]
  10045. },
  10046. "PermissionAction": {
  10047. "type": "string",
  10048. "enum": ["allow", "deny", "ask"]
  10049. },
  10050. "PermissionRule": {
  10051. "type": "object",
  10052. "properties": {
  10053. "permission": {
  10054. "type": "string"
  10055. },
  10056. "pattern": {
  10057. "type": "string"
  10058. },
  10059. "action": {
  10060. "$ref": "#/components/schemas/PermissionAction"
  10061. }
  10062. },
  10063. "required": ["permission", "pattern", "action"]
  10064. },
  10065. "PermissionRuleset": {
  10066. "type": "array",
  10067. "items": {
  10068. "$ref": "#/components/schemas/PermissionRule"
  10069. }
  10070. },
  10071. "Session": {
  10072. "type": "object",
  10073. "properties": {
  10074. "id": {
  10075. "type": "string",
  10076. "pattern": "^ses.*"
  10077. },
  10078. "slug": {
  10079. "type": "string"
  10080. },
  10081. "projectID": {
  10082. "type": "string"
  10083. },
  10084. "workspaceID": {
  10085. "type": "string",
  10086. "pattern": "^wrk.*"
  10087. },
  10088. "directory": {
  10089. "type": "string"
  10090. },
  10091. "parentID": {
  10092. "type": "string",
  10093. "pattern": "^ses.*"
  10094. },
  10095. "summary": {
  10096. "type": "object",
  10097. "properties": {
  10098. "additions": {
  10099. "type": "number"
  10100. },
  10101. "deletions": {
  10102. "type": "number"
  10103. },
  10104. "files": {
  10105. "type": "number"
  10106. },
  10107. "diffs": {
  10108. "type": "array",
  10109. "items": {
  10110. "$ref": "#/components/schemas/SnapshotFileDiff"
  10111. }
  10112. }
  10113. },
  10114. "required": ["additions", "deletions", "files"]
  10115. },
  10116. "share": {
  10117. "type": "object",
  10118. "properties": {
  10119. "url": {
  10120. "type": "string"
  10121. }
  10122. },
  10123. "required": ["url"]
  10124. },
  10125. "title": {
  10126. "type": "string"
  10127. },
  10128. "version": {
  10129. "type": "string"
  10130. },
  10131. "time": {
  10132. "type": "object",
  10133. "properties": {
  10134. "created": {
  10135. "type": "number"
  10136. },
  10137. "updated": {
  10138. "type": "number"
  10139. },
  10140. "compacting": {
  10141. "type": "number"
  10142. },
  10143. "archived": {
  10144. "type": "number"
  10145. }
  10146. },
  10147. "required": ["created", "updated"]
  10148. },
  10149. "permission": {
  10150. "$ref": "#/components/schemas/PermissionRuleset"
  10151. },
  10152. "revert": {
  10153. "type": "object",
  10154. "properties": {
  10155. "messageID": {
  10156. "type": "string",
  10157. "pattern": "^msg.*"
  10158. },
  10159. "partID": {
  10160. "type": "string",
  10161. "pattern": "^prt.*"
  10162. },
  10163. "snapshot": {
  10164. "type": "string"
  10165. },
  10166. "diff": {
  10167. "type": "string"
  10168. }
  10169. },
  10170. "required": ["messageID"]
  10171. }
  10172. },
  10173. "required": ["id", "slug", "projectID", "directory", "title", "version", "time"]
  10174. },
  10175. "Event.session.created": {
  10176. "type": "object",
  10177. "properties": {
  10178. "type": {
  10179. "type": "string",
  10180. "const": "session.created"
  10181. },
  10182. "properties": {
  10183. "type": "object",
  10184. "properties": {
  10185. "sessionID": {
  10186. "type": "string",
  10187. "pattern": "^ses.*"
  10188. },
  10189. "info": {
  10190. "$ref": "#/components/schemas/Session"
  10191. }
  10192. },
  10193. "required": ["sessionID", "info"]
  10194. }
  10195. },
  10196. "required": ["type", "properties"]
  10197. },
  10198. "Event.session.updated": {
  10199. "type": "object",
  10200. "properties": {
  10201. "type": {
  10202. "type": "string",
  10203. "const": "session.updated"
  10204. },
  10205. "properties": {
  10206. "type": "object",
  10207. "properties": {
  10208. "sessionID": {
  10209. "type": "string",
  10210. "pattern": "^ses.*"
  10211. },
  10212. "info": {
  10213. "$ref": "#/components/schemas/Session"
  10214. }
  10215. },
  10216. "required": ["sessionID", "info"]
  10217. }
  10218. },
  10219. "required": ["type", "properties"]
  10220. },
  10221. "Event.session.deleted": {
  10222. "type": "object",
  10223. "properties": {
  10224. "type": {
  10225. "type": "string",
  10226. "const": "session.deleted"
  10227. },
  10228. "properties": {
  10229. "type": "object",
  10230. "properties": {
  10231. "sessionID": {
  10232. "type": "string",
  10233. "pattern": "^ses.*"
  10234. },
  10235. "info": {
  10236. "$ref": "#/components/schemas/Session"
  10237. }
  10238. },
  10239. "required": ["sessionID", "info"]
  10240. }
  10241. },
  10242. "required": ["type", "properties"]
  10243. },
  10244. "SyncEvent.message.updated": {
  10245. "type": "object",
  10246. "properties": {
  10247. "type": {
  10248. "type": "string",
  10249. "const": "sync"
  10250. },
  10251. "name": {
  10252. "type": "string",
  10253. "const": "message.updated.1"
  10254. },
  10255. "id": {
  10256. "type": "string"
  10257. },
  10258. "seq": {
  10259. "type": "number"
  10260. },
  10261. "aggregateID": {
  10262. "type": "string",
  10263. "const": "sessionID"
  10264. },
  10265. "data": {
  10266. "type": "object",
  10267. "properties": {
  10268. "sessionID": {
  10269. "type": "string",
  10270. "pattern": "^ses.*"
  10271. },
  10272. "info": {
  10273. "$ref": "#/components/schemas/Message"
  10274. }
  10275. },
  10276. "required": ["sessionID", "info"]
  10277. }
  10278. },
  10279. "required": ["type", "name", "id", "seq", "aggregateID", "data"]
  10280. },
  10281. "SyncEvent.message.removed": {
  10282. "type": "object",
  10283. "properties": {
  10284. "type": {
  10285. "type": "string",
  10286. "const": "sync"
  10287. },
  10288. "name": {
  10289. "type": "string",
  10290. "const": "message.removed.1"
  10291. },
  10292. "id": {
  10293. "type": "string"
  10294. },
  10295. "seq": {
  10296. "type": "number"
  10297. },
  10298. "aggregateID": {
  10299. "type": "string",
  10300. "const": "sessionID"
  10301. },
  10302. "data": {
  10303. "type": "object",
  10304. "properties": {
  10305. "sessionID": {
  10306. "type": "string",
  10307. "pattern": "^ses.*"
  10308. },
  10309. "messageID": {
  10310. "type": "string",
  10311. "pattern": "^msg.*"
  10312. }
  10313. },
  10314. "required": ["sessionID", "messageID"]
  10315. }
  10316. },
  10317. "required": ["type", "name", "id", "seq", "aggregateID", "data"]
  10318. },
  10319. "SyncEvent.message.part.updated": {
  10320. "type": "object",
  10321. "properties": {
  10322. "type": {
  10323. "type": "string",
  10324. "const": "sync"
  10325. },
  10326. "name": {
  10327. "type": "string",
  10328. "const": "message.part.updated.1"
  10329. },
  10330. "id": {
  10331. "type": "string"
  10332. },
  10333. "seq": {
  10334. "type": "number"
  10335. },
  10336. "aggregateID": {
  10337. "type": "string",
  10338. "const": "sessionID"
  10339. },
  10340. "data": {
  10341. "type": "object",
  10342. "properties": {
  10343. "sessionID": {
  10344. "type": "string",
  10345. "pattern": "^ses.*"
  10346. },
  10347. "part": {
  10348. "$ref": "#/components/schemas/Part"
  10349. },
  10350. "time": {
  10351. "type": "number"
  10352. }
  10353. },
  10354. "required": ["sessionID", "part", "time"]
  10355. }
  10356. },
  10357. "required": ["type", "name", "id", "seq", "aggregateID", "data"]
  10358. },
  10359. "SyncEvent.message.part.removed": {
  10360. "type": "object",
  10361. "properties": {
  10362. "type": {
  10363. "type": "string",
  10364. "const": "sync"
  10365. },
  10366. "name": {
  10367. "type": "string",
  10368. "const": "message.part.removed.1"
  10369. },
  10370. "id": {
  10371. "type": "string"
  10372. },
  10373. "seq": {
  10374. "type": "number"
  10375. },
  10376. "aggregateID": {
  10377. "type": "string",
  10378. "const": "sessionID"
  10379. },
  10380. "data": {
  10381. "type": "object",
  10382. "properties": {
  10383. "sessionID": {
  10384. "type": "string",
  10385. "pattern": "^ses.*"
  10386. },
  10387. "messageID": {
  10388. "type": "string",
  10389. "pattern": "^msg.*"
  10390. },
  10391. "partID": {
  10392. "type": "string",
  10393. "pattern": "^prt.*"
  10394. }
  10395. },
  10396. "required": ["sessionID", "messageID", "partID"]
  10397. }
  10398. },
  10399. "required": ["type", "name", "id", "seq", "aggregateID", "data"]
  10400. },
  10401. "SyncEvent.session.created": {
  10402. "type": "object",
  10403. "properties": {
  10404. "type": {
  10405. "type": "string",
  10406. "const": "sync"
  10407. },
  10408. "name": {
  10409. "type": "string",
  10410. "const": "session.created.1"
  10411. },
  10412. "id": {
  10413. "type": "string"
  10414. },
  10415. "seq": {
  10416. "type": "number"
  10417. },
  10418. "aggregateID": {
  10419. "type": "string",
  10420. "const": "sessionID"
  10421. },
  10422. "data": {
  10423. "type": "object",
  10424. "properties": {
  10425. "sessionID": {
  10426. "type": "string",
  10427. "pattern": "^ses.*"
  10428. },
  10429. "info": {
  10430. "$ref": "#/components/schemas/Session"
  10431. }
  10432. },
  10433. "required": ["sessionID", "info"]
  10434. }
  10435. },
  10436. "required": ["type", "name", "id", "seq", "aggregateID", "data"]
  10437. },
  10438. "SyncEvent.session.updated": {
  10439. "type": "object",
  10440. "properties": {
  10441. "type": {
  10442. "type": "string",
  10443. "const": "sync"
  10444. },
  10445. "name": {
  10446. "type": "string",
  10447. "const": "session.updated.1"
  10448. },
  10449. "id": {
  10450. "type": "string"
  10451. },
  10452. "seq": {
  10453. "type": "number"
  10454. },
  10455. "aggregateID": {
  10456. "type": "string",
  10457. "const": "sessionID"
  10458. },
  10459. "data": {
  10460. "type": "object",
  10461. "properties": {
  10462. "sessionID": {
  10463. "type": "string",
  10464. "pattern": "^ses.*"
  10465. },
  10466. "info": {
  10467. "type": "object",
  10468. "properties": {
  10469. "id": {
  10470. "anyOf": [
  10471. {
  10472. "type": "string",
  10473. "pattern": "^ses.*"
  10474. },
  10475. {
  10476. "type": "null"
  10477. }
  10478. ]
  10479. },
  10480. "slug": {
  10481. "anyOf": [
  10482. {
  10483. "type": "string"
  10484. },
  10485. {
  10486. "type": "null"
  10487. }
  10488. ]
  10489. },
  10490. "projectID": {
  10491. "anyOf": [
  10492. {
  10493. "type": "string"
  10494. },
  10495. {
  10496. "type": "null"
  10497. }
  10498. ]
  10499. },
  10500. "workspaceID": {
  10501. "anyOf": [
  10502. {
  10503. "type": "string",
  10504. "pattern": "^wrk.*"
  10505. },
  10506. {
  10507. "type": "null"
  10508. }
  10509. ]
  10510. },
  10511. "directory": {
  10512. "anyOf": [
  10513. {
  10514. "type": "string"
  10515. },
  10516. {
  10517. "type": "null"
  10518. }
  10519. ]
  10520. },
  10521. "parentID": {
  10522. "anyOf": [
  10523. {
  10524. "type": "string",
  10525. "pattern": "^ses.*"
  10526. },
  10527. {
  10528. "type": "null"
  10529. }
  10530. ]
  10531. },
  10532. "summary": {
  10533. "anyOf": [
  10534. {
  10535. "type": "object",
  10536. "properties": {
  10537. "additions": {
  10538. "type": "number"
  10539. },
  10540. "deletions": {
  10541. "type": "number"
  10542. },
  10543. "files": {
  10544. "type": "number"
  10545. },
  10546. "diffs": {
  10547. "type": "array",
  10548. "items": {
  10549. "$ref": "#/components/schemas/SnapshotFileDiff"
  10550. }
  10551. }
  10552. },
  10553. "required": ["additions", "deletions", "files"]
  10554. },
  10555. {
  10556. "type": "null"
  10557. }
  10558. ]
  10559. },
  10560. "share": {
  10561. "type": "object",
  10562. "properties": {
  10563. "url": {
  10564. "anyOf": [
  10565. {
  10566. "type": "string"
  10567. },
  10568. {
  10569. "type": "null"
  10570. }
  10571. ]
  10572. }
  10573. }
  10574. },
  10575. "title": {
  10576. "anyOf": [
  10577. {
  10578. "type": "string"
  10579. },
  10580. {
  10581. "type": "null"
  10582. }
  10583. ]
  10584. },
  10585. "version": {
  10586. "anyOf": [
  10587. {
  10588. "type": "string"
  10589. },
  10590. {
  10591. "type": "null"
  10592. }
  10593. ]
  10594. },
  10595. "time": {
  10596. "type": "object",
  10597. "properties": {
  10598. "created": {
  10599. "anyOf": [
  10600. {
  10601. "type": "number"
  10602. },
  10603. {
  10604. "type": "null"
  10605. }
  10606. ]
  10607. },
  10608. "updated": {
  10609. "anyOf": [
  10610. {
  10611. "type": "number"
  10612. },
  10613. {
  10614. "type": "null"
  10615. }
  10616. ]
  10617. },
  10618. "compacting": {
  10619. "anyOf": [
  10620. {
  10621. "type": "number"
  10622. },
  10623. {
  10624. "type": "null"
  10625. }
  10626. ]
  10627. },
  10628. "archived": {
  10629. "anyOf": [
  10630. {
  10631. "type": "number"
  10632. },
  10633. {
  10634. "type": "null"
  10635. }
  10636. ]
  10637. }
  10638. }
  10639. },
  10640. "permission": {
  10641. "anyOf": [
  10642. {
  10643. "$ref": "#/components/schemas/PermissionRuleset"
  10644. },
  10645. {
  10646. "type": "null"
  10647. }
  10648. ]
  10649. },
  10650. "revert": {
  10651. "anyOf": [
  10652. {
  10653. "type": "object",
  10654. "properties": {
  10655. "messageID": {
  10656. "type": "string",
  10657. "pattern": "^msg.*"
  10658. },
  10659. "partID": {
  10660. "type": "string",
  10661. "pattern": "^prt.*"
  10662. },
  10663. "snapshot": {
  10664. "type": "string"
  10665. },
  10666. "diff": {
  10667. "type": "string"
  10668. }
  10669. },
  10670. "required": ["messageID"]
  10671. },
  10672. {
  10673. "type": "null"
  10674. }
  10675. ]
  10676. }
  10677. }
  10678. }
  10679. },
  10680. "required": ["sessionID", "info"]
  10681. }
  10682. },
  10683. "required": ["type", "name", "id", "seq", "aggregateID", "data"]
  10684. },
  10685. "SyncEvent.session.deleted": {
  10686. "type": "object",
  10687. "properties": {
  10688. "type": {
  10689. "type": "string",
  10690. "const": "sync"
  10691. },
  10692. "name": {
  10693. "type": "string",
  10694. "const": "session.deleted.1"
  10695. },
  10696. "id": {
  10697. "type": "string"
  10698. },
  10699. "seq": {
  10700. "type": "number"
  10701. },
  10702. "aggregateID": {
  10703. "type": "string",
  10704. "const": "sessionID"
  10705. },
  10706. "data": {
  10707. "type": "object",
  10708. "properties": {
  10709. "sessionID": {
  10710. "type": "string",
  10711. "pattern": "^ses.*"
  10712. },
  10713. "info": {
  10714. "$ref": "#/components/schemas/Session"
  10715. }
  10716. },
  10717. "required": ["sessionID", "info"]
  10718. }
  10719. },
  10720. "required": ["type", "name", "id", "seq", "aggregateID", "data"]
  10721. },
  10722. "GlobalEvent": {
  10723. "type": "object",
  10724. "properties": {
  10725. "directory": {
  10726. "type": "string"
  10727. },
  10728. "project": {
  10729. "type": "string"
  10730. },
  10731. "workspace": {
  10732. "type": "string"
  10733. },
  10734. "payload": {
  10735. "anyOf": [
  10736. {
  10737. "$ref": "#/components/schemas/Event.project.updated"
  10738. },
  10739. {
  10740. "$ref": "#/components/schemas/Event.server.instance.disposed"
  10741. },
  10742. {
  10743. "$ref": "#/components/schemas/Event.server.connected"
  10744. },
  10745. {
  10746. "$ref": "#/components/schemas/Event.global.disposed"
  10747. },
  10748. {
  10749. "$ref": "#/components/schemas/Event.file.edited"
  10750. },
  10751. {
  10752. "$ref": "#/components/schemas/Event.file.watcher.updated"
  10753. },
  10754. {
  10755. "$ref": "#/components/schemas/Event.lsp.client.diagnostics"
  10756. },
  10757. {
  10758. "$ref": "#/components/schemas/Event.lsp.updated"
  10759. },
  10760. {
  10761. "$ref": "#/components/schemas/Event.installation.updated"
  10762. },
  10763. {
  10764. "$ref": "#/components/schemas/Event.installation.update-available"
  10765. },
  10766. {
  10767. "$ref": "#/components/schemas/Event.message.part.delta"
  10768. },
  10769. {
  10770. "$ref": "#/components/schemas/Event.permission.asked"
  10771. },
  10772. {
  10773. "$ref": "#/components/schemas/Event.permission.replied"
  10774. },
  10775. {
  10776. "$ref": "#/components/schemas/Event.session.diff"
  10777. },
  10778. {
  10779. "$ref": "#/components/schemas/Event.session.error"
  10780. },
  10781. {
  10782. "$ref": "#/components/schemas/Event.question.asked"
  10783. },
  10784. {
  10785. "$ref": "#/components/schemas/Event.question.replied"
  10786. },
  10787. {
  10788. "$ref": "#/components/schemas/Event.question.rejected"
  10789. },
  10790. {
  10791. "$ref": "#/components/schemas/Event.todo.updated"
  10792. },
  10793. {
  10794. "$ref": "#/components/schemas/Event.session.status"
  10795. },
  10796. {
  10797. "$ref": "#/components/schemas/Event.session.idle"
  10798. },
  10799. {
  10800. "$ref": "#/components/schemas/Event.session.compacted"
  10801. },
  10802. {
  10803. "$ref": "#/components/schemas/Event.tui.prompt.append"
  10804. },
  10805. {
  10806. "$ref": "#/components/schemas/Event.tui.command.execute"
  10807. },
  10808. {
  10809. "$ref": "#/components/schemas/Event.tui.toast.show"
  10810. },
  10811. {
  10812. "$ref": "#/components/schemas/Event.tui.session.select"
  10813. },
  10814. {
  10815. "$ref": "#/components/schemas/Event.mcp.tools.changed"
  10816. },
  10817. {
  10818. "$ref": "#/components/schemas/Event.mcp.browser.open.failed"
  10819. },
  10820. {
  10821. "$ref": "#/components/schemas/Event.command.executed"
  10822. },
  10823. {
  10824. "$ref": "#/components/schemas/Event.vcs.branch.updated"
  10825. },
  10826. {
  10827. "$ref": "#/components/schemas/Event.worktree.ready"
  10828. },
  10829. {
  10830. "$ref": "#/components/schemas/Event.worktree.failed"
  10831. },
  10832. {
  10833. "$ref": "#/components/schemas/Event.pty.created"
  10834. },
  10835. {
  10836. "$ref": "#/components/schemas/Event.pty.updated"
  10837. },
  10838. {
  10839. "$ref": "#/components/schemas/Event.pty.exited"
  10840. },
  10841. {
  10842. "$ref": "#/components/schemas/Event.pty.deleted"
  10843. },
  10844. {
  10845. "$ref": "#/components/schemas/Event.workspace.ready"
  10846. },
  10847. {
  10848. "$ref": "#/components/schemas/Event.workspace.failed"
  10849. },
  10850. {
  10851. "$ref": "#/components/schemas/Event.workspace.restore"
  10852. },
  10853. {
  10854. "$ref": "#/components/schemas/Event.workspace.status"
  10855. },
  10856. {
  10857. "$ref": "#/components/schemas/Event.message.updated"
  10858. },
  10859. {
  10860. "$ref": "#/components/schemas/Event.message.removed"
  10861. },
  10862. {
  10863. "$ref": "#/components/schemas/Event.message.part.updated"
  10864. },
  10865. {
  10866. "$ref": "#/components/schemas/Event.message.part.removed"
  10867. },
  10868. {
  10869. "$ref": "#/components/schemas/Event.session.created"
  10870. },
  10871. {
  10872. "$ref": "#/components/schemas/Event.session.updated"
  10873. },
  10874. {
  10875. "$ref": "#/components/schemas/Event.session.deleted"
  10876. },
  10877. {
  10878. "$ref": "#/components/schemas/SyncEvent.message.updated"
  10879. },
  10880. {
  10881. "$ref": "#/components/schemas/SyncEvent.message.removed"
  10882. },
  10883. {
  10884. "$ref": "#/components/schemas/SyncEvent.message.part.updated"
  10885. },
  10886. {
  10887. "$ref": "#/components/schemas/SyncEvent.message.part.removed"
  10888. },
  10889. {
  10890. "$ref": "#/components/schemas/SyncEvent.session.created"
  10891. },
  10892. {
  10893. "$ref": "#/components/schemas/SyncEvent.session.updated"
  10894. },
  10895. {
  10896. "$ref": "#/components/schemas/SyncEvent.session.deleted"
  10897. }
  10898. ]
  10899. }
  10900. },
  10901. "required": ["directory", "payload"]
  10902. },
  10903. "LogLevel": {
  10904. "description": "Log level",
  10905. "type": "string",
  10906. "enum": ["DEBUG", "INFO", "WARN", "ERROR"]
  10907. },
  10908. "ServerConfig": {
  10909. "description": "Server configuration for opencode serve and web commands",
  10910. "type": "object",
  10911. "properties": {
  10912. "port": {
  10913. "description": "Port to listen on",
  10914. "type": "integer",
  10915. "exclusiveMinimum": 0,
  10916. "maximum": 9007199254740991
  10917. },
  10918. "hostname": {
  10919. "description": "Hostname to listen on",
  10920. "type": "string"
  10921. },
  10922. "mdns": {
  10923. "description": "Enable mDNS service discovery",
  10924. "type": "boolean"
  10925. },
  10926. "mdnsDomain": {
  10927. "description": "Custom domain name for mDNS service (default: opencode.local)",
  10928. "type": "string"
  10929. },
  10930. "cors": {
  10931. "description": "Additional domains to allow for CORS",
  10932. "type": "array",
  10933. "items": {
  10934. "type": "string"
  10935. }
  10936. }
  10937. }
  10938. },
  10939. "PermissionActionConfig": {
  10940. "type": "string",
  10941. "enum": ["ask", "allow", "deny"]
  10942. },
  10943. "PermissionObjectConfig": {
  10944. "type": "object",
  10945. "propertyNames": {
  10946. "type": "string"
  10947. },
  10948. "additionalProperties": {
  10949. "$ref": "#/components/schemas/PermissionActionConfig"
  10950. }
  10951. },
  10952. "PermissionRuleConfig": {
  10953. "anyOf": [
  10954. {
  10955. "$ref": "#/components/schemas/PermissionActionConfig"
  10956. },
  10957. {
  10958. "$ref": "#/components/schemas/PermissionObjectConfig"
  10959. }
  10960. ]
  10961. },
  10962. "PermissionConfig": {
  10963. "anyOf": [
  10964. {
  10965. "$ref": "#/components/schemas/PermissionActionConfig"
  10966. },
  10967. {
  10968. "type": "object",
  10969. "properties": {
  10970. "read": {
  10971. "$ref": "#/components/schemas/PermissionRuleConfig"
  10972. },
  10973. "edit": {
  10974. "$ref": "#/components/schemas/PermissionRuleConfig"
  10975. },
  10976. "glob": {
  10977. "$ref": "#/components/schemas/PermissionRuleConfig"
  10978. },
  10979. "grep": {
  10980. "$ref": "#/components/schemas/PermissionRuleConfig"
  10981. },
  10982. "list": {
  10983. "$ref": "#/components/schemas/PermissionRuleConfig"
  10984. },
  10985. "bash": {
  10986. "$ref": "#/components/schemas/PermissionRuleConfig"
  10987. },
  10988. "task": {
  10989. "$ref": "#/components/schemas/PermissionRuleConfig"
  10990. },
  10991. "external_directory": {
  10992. "$ref": "#/components/schemas/PermissionRuleConfig"
  10993. },
  10994. "todowrite": {
  10995. "$ref": "#/components/schemas/PermissionActionConfig"
  10996. },
  10997. "question": {
  10998. "$ref": "#/components/schemas/PermissionActionConfig"
  10999. },
  11000. "webfetch": {
  11001. "$ref": "#/components/schemas/PermissionActionConfig"
  11002. },
  11003. "websearch": {
  11004. "$ref": "#/components/schemas/PermissionActionConfig"
  11005. },
  11006. "codesearch": {
  11007. "$ref": "#/components/schemas/PermissionActionConfig"
  11008. },
  11009. "lsp": {
  11010. "$ref": "#/components/schemas/PermissionRuleConfig"
  11011. },
  11012. "doom_loop": {
  11013. "$ref": "#/components/schemas/PermissionActionConfig"
  11014. },
  11015. "skill": {
  11016. "$ref": "#/components/schemas/PermissionRuleConfig"
  11017. }
  11018. },
  11019. "additionalProperties": {
  11020. "$ref": "#/components/schemas/PermissionRuleConfig"
  11021. }
  11022. }
  11023. ]
  11024. },
  11025. "AgentConfig": {
  11026. "type": "object",
  11027. "properties": {
  11028. "model": {
  11029. "type": "string"
  11030. },
  11031. "variant": {
  11032. "description": "Default model variant for this agent (applies only when using the agent's configured model).",
  11033. "type": "string"
  11034. },
  11035. "temperature": {
  11036. "type": "number"
  11037. },
  11038. "top_p": {
  11039. "type": "number"
  11040. },
  11041. "prompt": {
  11042. "type": "string"
  11043. },
  11044. "tools": {
  11045. "description": "@deprecated Use 'permission' field instead",
  11046. "type": "object",
  11047. "propertyNames": {
  11048. "type": "string"
  11049. },
  11050. "additionalProperties": {
  11051. "type": "boolean"
  11052. }
  11053. },
  11054. "disable": {
  11055. "type": "boolean"
  11056. },
  11057. "description": {
  11058. "description": "Description of when to use the agent",
  11059. "type": "string"
  11060. },
  11061. "mode": {
  11062. "type": "string",
  11063. "enum": ["subagent", "primary", "all"]
  11064. },
  11065. "hidden": {
  11066. "description": "Hide this subagent from the @ autocomplete menu (default: false, only applies to mode: subagent)",
  11067. "type": "boolean"
  11068. },
  11069. "options": {
  11070. "type": "object",
  11071. "propertyNames": {
  11072. "type": "string"
  11073. },
  11074. "additionalProperties": {}
  11075. },
  11076. "color": {
  11077. "description": "Hex color code (e.g., #FF5733) or theme color (e.g., primary)",
  11078. "anyOf": [
  11079. {
  11080. "type": "string",
  11081. "pattern": "^#[0-9a-fA-F]{6}$"
  11082. },
  11083. {
  11084. "type": "string",
  11085. "enum": ["primary", "secondary", "accent", "success", "warning", "error", "info"]
  11086. }
  11087. ]
  11088. },
  11089. "steps": {
  11090. "description": "Maximum number of agentic iterations before forcing text-only response",
  11091. "type": "integer",
  11092. "exclusiveMinimum": 0,
  11093. "maximum": 9007199254740991
  11094. },
  11095. "maxSteps": {
  11096. "description": "@deprecated Use 'steps' field instead.",
  11097. "type": "integer",
  11098. "exclusiveMinimum": 0,
  11099. "maximum": 9007199254740991
  11100. },
  11101. "permission": {
  11102. "$ref": "#/components/schemas/PermissionConfig"
  11103. }
  11104. },
  11105. "additionalProperties": {}
  11106. },
  11107. "ProviderConfig": {
  11108. "type": "object",
  11109. "properties": {
  11110. "api": {
  11111. "type": "string"
  11112. },
  11113. "name": {
  11114. "type": "string"
  11115. },
  11116. "env": {
  11117. "type": "array",
  11118. "items": {
  11119. "type": "string"
  11120. }
  11121. },
  11122. "id": {
  11123. "type": "string"
  11124. },
  11125. "npm": {
  11126. "type": "string"
  11127. },
  11128. "whitelist": {
  11129. "type": "array",
  11130. "items": {
  11131. "type": "string"
  11132. }
  11133. },
  11134. "blacklist": {
  11135. "type": "array",
  11136. "items": {
  11137. "type": "string"
  11138. }
  11139. },
  11140. "options": {
  11141. "type": "object",
  11142. "properties": {
  11143. "apiKey": {
  11144. "type": "string"
  11145. },
  11146. "baseURL": {
  11147. "type": "string"
  11148. },
  11149. "enterpriseUrl": {
  11150. "description": "GitHub Enterprise URL for copilot authentication",
  11151. "type": "string"
  11152. },
  11153. "setCacheKey": {
  11154. "description": "Enable promptCacheKey for this provider (default false)",
  11155. "type": "boolean"
  11156. },
  11157. "timeout": {
  11158. "description": "Timeout in milliseconds for requests to this provider. Default is 300000 (5 minutes). Set to false to disable timeout.",
  11159. "anyOf": [
  11160. {
  11161. "type": "integer",
  11162. "exclusiveMinimum": 0,
  11163. "maximum": 9007199254740991
  11164. },
  11165. {
  11166. "type": "boolean",
  11167. "const": false
  11168. }
  11169. ]
  11170. },
  11171. "chunkTimeout": {
  11172. "description": "Timeout in milliseconds between streamed SSE chunks for this provider. If no chunk arrives within this window, the request is aborted.",
  11173. "type": "integer",
  11174. "exclusiveMinimum": 0,
  11175. "maximum": 9007199254740991
  11176. }
  11177. },
  11178. "additionalProperties": {}
  11179. },
  11180. "models": {
  11181. "type": "object",
  11182. "propertyNames": {
  11183. "type": "string"
  11184. },
  11185. "additionalProperties": {
  11186. "type": "object",
  11187. "properties": {
  11188. "id": {
  11189. "type": "string"
  11190. },
  11191. "name": {
  11192. "type": "string"
  11193. },
  11194. "family": {
  11195. "type": "string"
  11196. },
  11197. "release_date": {
  11198. "type": "string"
  11199. },
  11200. "attachment": {
  11201. "type": "boolean"
  11202. },
  11203. "reasoning": {
  11204. "type": "boolean"
  11205. },
  11206. "temperature": {
  11207. "type": "boolean"
  11208. },
  11209. "tool_call": {
  11210. "type": "boolean"
  11211. },
  11212. "interleaved": {
  11213. "anyOf": [
  11214. {
  11215. "type": "boolean",
  11216. "const": true
  11217. },
  11218. {
  11219. "type": "object",
  11220. "properties": {
  11221. "field": {
  11222. "type": "string",
  11223. "enum": ["reasoning_content", "reasoning_details"]
  11224. }
  11225. },
  11226. "required": ["field"]
  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. },
  11357. "McpLocalConfig": {
  11358. "type": "object",
  11359. "properties": {
  11360. "type": {
  11361. "description": "Type of MCP server connection",
  11362. "type": "string",
  11363. "const": "local"
  11364. },
  11365. "command": {
  11366. "description": "Command and arguments to run the MCP server",
  11367. "type": "array",
  11368. "items": {
  11369. "type": "string"
  11370. }
  11371. },
  11372. "environment": {
  11373. "description": "Environment variables to set when running the MCP server",
  11374. "type": "object",
  11375. "propertyNames": {
  11376. "type": "string"
  11377. },
  11378. "additionalProperties": {
  11379. "type": "string"
  11380. }
  11381. },
  11382. "enabled": {
  11383. "description": "Enable or disable the MCP server on startup",
  11384. "type": "boolean"
  11385. },
  11386. "timeout": {
  11387. "description": "Timeout in ms for MCP server requests. Defaults to 5000 (5 seconds) if not specified.",
  11388. "type": "number"
  11389. }
  11390. },
  11391. "required": ["type", "command"]
  11392. },
  11393. "McpOAuthConfig": {
  11394. "type": "object",
  11395. "properties": {
  11396. "clientId": {
  11397. "description": "OAuth client ID. If not provided, dynamic client registration (RFC 7591) will be attempted.",
  11398. "type": "string"
  11399. },
  11400. "clientSecret": {
  11401. "description": "OAuth client secret (if required by the authorization server)",
  11402. "type": "string"
  11403. },
  11404. "scope": {
  11405. "description": "OAuth scopes to request during authorization",
  11406. "type": "string"
  11407. },
  11408. "redirectUri": {
  11409. "description": "OAuth redirect URI (default: http://127.0.0.1:19876/mcp/oauth/callback).",
  11410. "type": "string"
  11411. }
  11412. }
  11413. },
  11414. "McpRemoteConfig": {
  11415. "type": "object",
  11416. "properties": {
  11417. "type": {
  11418. "description": "Type of MCP server connection",
  11419. "type": "string",
  11420. "const": "remote"
  11421. },
  11422. "url": {
  11423. "description": "URL of the remote MCP server",
  11424. "type": "string"
  11425. },
  11426. "enabled": {
  11427. "description": "Enable or disable the MCP server on startup",
  11428. "type": "boolean"
  11429. },
  11430. "headers": {
  11431. "description": "Headers to send with the request",
  11432. "type": "object",
  11433. "propertyNames": {
  11434. "type": "string"
  11435. },
  11436. "additionalProperties": {
  11437. "type": "string"
  11438. }
  11439. },
  11440. "oauth": {
  11441. "description": "OAuth authentication configuration for the MCP server. Set to false to disable OAuth auto-detection.",
  11442. "anyOf": [
  11443. {
  11444. "$ref": "#/components/schemas/McpOAuthConfig"
  11445. },
  11446. {
  11447. "type": "boolean",
  11448. "const": false
  11449. }
  11450. ]
  11451. },
  11452. "timeout": {
  11453. "description": "Timeout in ms for MCP server requests. Defaults to 5000 (5 seconds) if not specified.",
  11454. "type": "number"
  11455. }
  11456. },
  11457. "required": ["type", "url"]
  11458. },
  11459. "LayoutConfig": {
  11460. "description": "@deprecated Always uses stretch layout.",
  11461. "type": "string",
  11462. "enum": ["auto", "stretch"]
  11463. },
  11464. "Config": {
  11465. "type": "object",
  11466. "properties": {
  11467. "$schema": {
  11468. "description": "JSON schema reference for configuration validation",
  11469. "type": "string"
  11470. },
  11471. "logLevel": {
  11472. "$ref": "#/components/schemas/LogLevel"
  11473. },
  11474. "server": {
  11475. "$ref": "#/components/schemas/ServerConfig"
  11476. },
  11477. "command": {
  11478. "description": "Command configuration, see https://opencode.ai/docs/commands",
  11479. "type": "object",
  11480. "propertyNames": {
  11481. "type": "string"
  11482. },
  11483. "additionalProperties": {
  11484. "type": "object",
  11485. "properties": {
  11486. "template": {
  11487. "type": "string"
  11488. },
  11489. "description": {
  11490. "type": "string"
  11491. },
  11492. "agent": {
  11493. "type": "string"
  11494. },
  11495. "model": {
  11496. "type": "string"
  11497. },
  11498. "subtask": {
  11499. "type": "boolean"
  11500. }
  11501. },
  11502. "required": ["template"]
  11503. }
  11504. },
  11505. "skills": {
  11506. "description": "Additional skill folder paths",
  11507. "type": "object",
  11508. "properties": {
  11509. "paths": {
  11510. "description": "Additional paths to skill folders",
  11511. "type": "array",
  11512. "items": {
  11513. "type": "string"
  11514. }
  11515. },
  11516. "urls": {
  11517. "description": "URLs to fetch skills from (e.g., https://example.com/.well-known/skills/)",
  11518. "type": "array",
  11519. "items": {
  11520. "type": "string"
  11521. }
  11522. }
  11523. }
  11524. },
  11525. "watcher": {
  11526. "type": "object",
  11527. "properties": {
  11528. "ignore": {
  11529. "type": "array",
  11530. "items": {
  11531. "type": "string"
  11532. }
  11533. }
  11534. }
  11535. },
  11536. "snapshot": {
  11537. "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.",
  11538. "type": "boolean"
  11539. },
  11540. "plugin": {
  11541. "type": "array",
  11542. "items": {
  11543. "anyOf": [
  11544. {
  11545. "type": "string"
  11546. },
  11547. {
  11548. "type": "array",
  11549. "prefixItems": [
  11550. {
  11551. "type": "string"
  11552. },
  11553. {
  11554. "type": "object",
  11555. "propertyNames": {
  11556. "type": "string"
  11557. },
  11558. "additionalProperties": {}
  11559. }
  11560. ]
  11561. }
  11562. ]
  11563. }
  11564. },
  11565. "share": {
  11566. "description": "Control sharing behavior:'manual' allows manual sharing via commands, 'auto' enables automatic sharing, 'disabled' disables all sharing",
  11567. "type": "string",
  11568. "enum": ["manual", "auto", "disabled"]
  11569. },
  11570. "autoshare": {
  11571. "description": "@deprecated Use 'share' field instead. Share newly created sessions automatically",
  11572. "type": "boolean"
  11573. },
  11574. "autoupdate": {
  11575. "description": "Automatically update to the latest version. Set to true to auto-update, false to disable, or 'notify' to show update notifications",
  11576. "anyOf": [
  11577. {
  11578. "type": "boolean"
  11579. },
  11580. {
  11581. "type": "string",
  11582. "const": "notify"
  11583. }
  11584. ]
  11585. },
  11586. "disabled_providers": {
  11587. "description": "Disable providers that are loaded automatically",
  11588. "type": "array",
  11589. "items": {
  11590. "type": "string"
  11591. }
  11592. },
  11593. "enabled_providers": {
  11594. "description": "When set, ONLY these providers will be enabled. All other providers will be ignored",
  11595. "type": "array",
  11596. "items": {
  11597. "type": "string"
  11598. }
  11599. },
  11600. "model": {
  11601. "description": "Model to use in the format of provider/model, eg anthropic/claude-2",
  11602. "type": "string"
  11603. },
  11604. "small_model": {
  11605. "description": "Small model to use for tasks like title generation in the format of provider/model",
  11606. "type": "string"
  11607. },
  11608. "default_agent": {
  11609. "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.",
  11610. "type": "string"
  11611. },
  11612. "username": {
  11613. "description": "Custom username to display in conversations instead of system username",
  11614. "type": "string"
  11615. },
  11616. "mode": {
  11617. "description": "@deprecated Use `agent` field instead.",
  11618. "type": "object",
  11619. "properties": {
  11620. "build": {
  11621. "$ref": "#/components/schemas/AgentConfig"
  11622. },
  11623. "plan": {
  11624. "$ref": "#/components/schemas/AgentConfig"
  11625. }
  11626. },
  11627. "additionalProperties": {
  11628. "$ref": "#/components/schemas/AgentConfig"
  11629. }
  11630. },
  11631. "agent": {
  11632. "description": "Agent configuration, see https://opencode.ai/docs/agents",
  11633. "type": "object",
  11634. "properties": {
  11635. "plan": {
  11636. "$ref": "#/components/schemas/AgentConfig"
  11637. },
  11638. "build": {
  11639. "$ref": "#/components/schemas/AgentConfig"
  11640. },
  11641. "general": {
  11642. "$ref": "#/components/schemas/AgentConfig"
  11643. },
  11644. "explore": {
  11645. "$ref": "#/components/schemas/AgentConfig"
  11646. },
  11647. "title": {
  11648. "$ref": "#/components/schemas/AgentConfig"
  11649. },
  11650. "summary": {
  11651. "$ref": "#/components/schemas/AgentConfig"
  11652. },
  11653. "compaction": {
  11654. "$ref": "#/components/schemas/AgentConfig"
  11655. }
  11656. },
  11657. "additionalProperties": {
  11658. "$ref": "#/components/schemas/AgentConfig"
  11659. }
  11660. },
  11661. "provider": {
  11662. "description": "Custom provider configurations and model overrides",
  11663. "type": "object",
  11664. "propertyNames": {
  11665. "type": "string"
  11666. },
  11667. "additionalProperties": {
  11668. "$ref": "#/components/schemas/ProviderConfig"
  11669. }
  11670. },
  11671. "mcp": {
  11672. "description": "MCP (Model Context Protocol) server configurations",
  11673. "type": "object",
  11674. "propertyNames": {
  11675. "type": "string"
  11676. },
  11677. "additionalProperties": {
  11678. "anyOf": [
  11679. {
  11680. "anyOf": [
  11681. {
  11682. "$ref": "#/components/schemas/McpLocalConfig"
  11683. },
  11684. {
  11685. "$ref": "#/components/schemas/McpRemoteConfig"
  11686. }
  11687. ]
  11688. },
  11689. {
  11690. "type": "object",
  11691. "properties": {
  11692. "enabled": {
  11693. "type": "boolean"
  11694. }
  11695. },
  11696. "required": ["enabled"],
  11697. "additionalProperties": false
  11698. }
  11699. ]
  11700. }
  11701. },
  11702. "formatter": {
  11703. "anyOf": [
  11704. {
  11705. "type": "boolean"
  11706. },
  11707. {
  11708. "type": "object",
  11709. "propertyNames": {
  11710. "type": "string"
  11711. },
  11712. "additionalProperties": {
  11713. "type": "object",
  11714. "properties": {
  11715. "disabled": {
  11716. "type": "boolean"
  11717. },
  11718. "command": {
  11719. "type": "array",
  11720. "items": {
  11721. "type": "string"
  11722. }
  11723. },
  11724. "environment": {
  11725. "type": "object",
  11726. "propertyNames": {
  11727. "type": "string"
  11728. },
  11729. "additionalProperties": {
  11730. "type": "string"
  11731. }
  11732. },
  11733. "extensions": {
  11734. "type": "array",
  11735. "items": {
  11736. "type": "string"
  11737. }
  11738. }
  11739. }
  11740. }
  11741. }
  11742. ]
  11743. },
  11744. "lsp": {
  11745. "anyOf": [
  11746. {
  11747. "type": "boolean"
  11748. },
  11749. {
  11750. "type": "object",
  11751. "propertyNames": {
  11752. "type": "string"
  11753. },
  11754. "additionalProperties": {
  11755. "anyOf": [
  11756. {
  11757. "type": "object",
  11758. "properties": {
  11759. "disabled": {
  11760. "type": "boolean",
  11761. "const": true
  11762. }
  11763. },
  11764. "required": ["disabled"]
  11765. },
  11766. {
  11767. "type": "object",
  11768. "properties": {
  11769. "command": {
  11770. "type": "array",
  11771. "items": {
  11772. "type": "string"
  11773. }
  11774. },
  11775. "extensions": {
  11776. "type": "array",
  11777. "items": {
  11778. "type": "string"
  11779. }
  11780. },
  11781. "disabled": {
  11782. "type": "boolean"
  11783. },
  11784. "env": {
  11785. "type": "object",
  11786. "propertyNames": {
  11787. "type": "string"
  11788. },
  11789. "additionalProperties": {
  11790. "type": "string"
  11791. }
  11792. },
  11793. "initialization": {
  11794. "type": "object",
  11795. "propertyNames": {
  11796. "type": "string"
  11797. },
  11798. "additionalProperties": {}
  11799. }
  11800. },
  11801. "required": ["command"]
  11802. }
  11803. ]
  11804. }
  11805. }
  11806. ]
  11807. },
  11808. "instructions": {
  11809. "description": "Additional instruction files or patterns to include",
  11810. "type": "array",
  11811. "items": {
  11812. "type": "string"
  11813. }
  11814. },
  11815. "layout": {
  11816. "$ref": "#/components/schemas/LayoutConfig"
  11817. },
  11818. "permission": {
  11819. "$ref": "#/components/schemas/PermissionConfig"
  11820. },
  11821. "tools": {
  11822. "type": "object",
  11823. "propertyNames": {
  11824. "type": "string"
  11825. },
  11826. "additionalProperties": {
  11827. "type": "boolean"
  11828. }
  11829. },
  11830. "enterprise": {
  11831. "type": "object",
  11832. "properties": {
  11833. "url": {
  11834. "description": "Enterprise URL",
  11835. "type": "string"
  11836. }
  11837. }
  11838. },
  11839. "compaction": {
  11840. "type": "object",
  11841. "properties": {
  11842. "auto": {
  11843. "description": "Enable automatic compaction when context is full (default: true)",
  11844. "type": "boolean"
  11845. },
  11846. "prune": {
  11847. "description": "Enable pruning of old tool outputs (default: true)",
  11848. "type": "boolean"
  11849. },
  11850. "tail_turns": {
  11851. "description": "Number of recent user turns, including their following assistant/tool responses, to keep verbatim during compaction (default: 2)",
  11852. "type": "integer",
  11853. "minimum": 0,
  11854. "maximum": 9007199254740991
  11855. },
  11856. "preserve_recent_tokens": {
  11857. "description": "Maximum number of tokens from recent turns to preserve verbatim after compaction",
  11858. "type": "integer",
  11859. "minimum": 0,
  11860. "maximum": 9007199254740991
  11861. },
  11862. "reserved": {
  11863. "description": "Token buffer for compaction. Leaves enough window to avoid overflow during compaction.",
  11864. "type": "integer",
  11865. "minimum": 0,
  11866. "maximum": 9007199254740991
  11867. }
  11868. }
  11869. },
  11870. "experimental": {
  11871. "type": "object",
  11872. "properties": {
  11873. "disable_paste_summary": {
  11874. "type": "boolean"
  11875. },
  11876. "batch_tool": {
  11877. "description": "Enable the batch tool",
  11878. "type": "boolean"
  11879. },
  11880. "openTelemetry": {
  11881. "description": "Enable OpenTelemetry spans for AI SDK calls (using the 'experimental_telemetry' flag)",
  11882. "type": "boolean"
  11883. },
  11884. "primary_tools": {
  11885. "description": "Tools that should only be available to primary agents.",
  11886. "type": "array",
  11887. "items": {
  11888. "type": "string"
  11889. }
  11890. },
  11891. "continue_loop_on_deny": {
  11892. "description": "Continue the agent loop when a tool call is denied",
  11893. "type": "boolean"
  11894. },
  11895. "mcp_timeout": {
  11896. "description": "Timeout in milliseconds for model context protocol (MCP) requests",
  11897. "type": "integer",
  11898. "exclusiveMinimum": 0,
  11899. "maximum": 9007199254740991
  11900. }
  11901. }
  11902. }
  11903. },
  11904. "additionalProperties": false
  11905. },
  11906. "BadRequestError": {
  11907. "type": "object",
  11908. "properties": {
  11909. "data": {},
  11910. "errors": {
  11911. "type": "array",
  11912. "items": {
  11913. "type": "object",
  11914. "propertyNames": {
  11915. "type": "string"
  11916. },
  11917. "additionalProperties": {}
  11918. }
  11919. },
  11920. "success": {
  11921. "type": "boolean",
  11922. "const": false
  11923. }
  11924. },
  11925. "required": ["data", "errors", "success"]
  11926. },
  11927. "OAuth": {
  11928. "type": "object",
  11929. "properties": {
  11930. "type": {
  11931. "type": "string",
  11932. "const": "oauth"
  11933. },
  11934. "refresh": {
  11935. "type": "string"
  11936. },
  11937. "access": {
  11938. "type": "string"
  11939. },
  11940. "expires": {
  11941. "type": "number"
  11942. },
  11943. "accountId": {
  11944. "type": "string"
  11945. },
  11946. "enterpriseUrl": {
  11947. "type": "string"
  11948. }
  11949. },
  11950. "required": ["type", "refresh", "access", "expires"]
  11951. },
  11952. "ApiAuth": {
  11953. "type": "object",
  11954. "properties": {
  11955. "type": {
  11956. "type": "string",
  11957. "const": "api"
  11958. },
  11959. "key": {
  11960. "type": "string"
  11961. },
  11962. "metadata": {
  11963. "type": "object",
  11964. "propertyNames": {
  11965. "type": "string"
  11966. },
  11967. "additionalProperties": {
  11968. "type": "string"
  11969. }
  11970. }
  11971. },
  11972. "required": ["type", "key"]
  11973. },
  11974. "WellKnownAuth": {
  11975. "type": "object",
  11976. "properties": {
  11977. "type": {
  11978. "type": "string",
  11979. "const": "wellknown"
  11980. },
  11981. "key": {
  11982. "type": "string"
  11983. },
  11984. "token": {
  11985. "type": "string"
  11986. }
  11987. },
  11988. "required": ["type", "key", "token"]
  11989. },
  11990. "Auth": {
  11991. "anyOf": [
  11992. {
  11993. "$ref": "#/components/schemas/OAuth"
  11994. },
  11995. {
  11996. "$ref": "#/components/schemas/ApiAuth"
  11997. },
  11998. {
  11999. "$ref": "#/components/schemas/WellKnownAuth"
  12000. }
  12001. ]
  12002. },
  12003. "Workspace": {
  12004. "type": "object",
  12005. "properties": {
  12006. "id": {
  12007. "type": "string",
  12008. "pattern": "^wrk.*"
  12009. },
  12010. "type": {
  12011. "type": "string"
  12012. },
  12013. "name": {
  12014. "type": "string"
  12015. },
  12016. "branch": {
  12017. "anyOf": [
  12018. {
  12019. "type": "string"
  12020. },
  12021. {
  12022. "type": "null"
  12023. }
  12024. ]
  12025. },
  12026. "directory": {
  12027. "anyOf": [
  12028. {
  12029. "type": "string"
  12030. },
  12031. {
  12032. "type": "null"
  12033. }
  12034. ]
  12035. },
  12036. "extra": {
  12037. "anyOf": [
  12038. {},
  12039. {
  12040. "type": "null"
  12041. }
  12042. ]
  12043. },
  12044. "projectID": {
  12045. "type": "string"
  12046. }
  12047. },
  12048. "required": ["id", "type", "name", "branch", "directory", "extra", "projectID"]
  12049. },
  12050. "NotFoundError": {
  12051. "type": "object",
  12052. "properties": {
  12053. "name": {
  12054. "type": "string",
  12055. "const": "NotFoundError"
  12056. },
  12057. "data": {
  12058. "type": "object",
  12059. "properties": {
  12060. "message": {
  12061. "type": "string"
  12062. }
  12063. },
  12064. "required": ["message"]
  12065. }
  12066. },
  12067. "required": ["name", "data"]
  12068. },
  12069. "Model": {
  12070. "type": "object",
  12071. "properties": {
  12072. "id": {
  12073. "type": "string"
  12074. },
  12075. "providerID": {
  12076. "type": "string"
  12077. },
  12078. "api": {
  12079. "type": "object",
  12080. "properties": {
  12081. "id": {
  12082. "type": "string"
  12083. },
  12084. "url": {
  12085. "type": "string"
  12086. },
  12087. "npm": {
  12088. "type": "string"
  12089. }
  12090. },
  12091. "required": ["id", "url", "npm"]
  12092. },
  12093. "name": {
  12094. "type": "string"
  12095. },
  12096. "family": {
  12097. "type": "string"
  12098. },
  12099. "capabilities": {
  12100. "type": "object",
  12101. "properties": {
  12102. "temperature": {
  12103. "type": "boolean"
  12104. },
  12105. "reasoning": {
  12106. "type": "boolean"
  12107. },
  12108. "attachment": {
  12109. "type": "boolean"
  12110. },
  12111. "toolcall": {
  12112. "type": "boolean"
  12113. },
  12114. "input": {
  12115. "type": "object",
  12116. "properties": {
  12117. "text": {
  12118. "type": "boolean"
  12119. },
  12120. "audio": {
  12121. "type": "boolean"
  12122. },
  12123. "image": {
  12124. "type": "boolean"
  12125. },
  12126. "video": {
  12127. "type": "boolean"
  12128. },
  12129. "pdf": {
  12130. "type": "boolean"
  12131. }
  12132. },
  12133. "required": ["text", "audio", "image", "video", "pdf"]
  12134. },
  12135. "output": {
  12136. "type": "object",
  12137. "properties": {
  12138. "text": {
  12139. "type": "boolean"
  12140. },
  12141. "audio": {
  12142. "type": "boolean"
  12143. },
  12144. "image": {
  12145. "type": "boolean"
  12146. },
  12147. "video": {
  12148. "type": "boolean"
  12149. },
  12150. "pdf": {
  12151. "type": "boolean"
  12152. }
  12153. },
  12154. "required": ["text", "audio", "image", "video", "pdf"]
  12155. },
  12156. "interleaved": {
  12157. "anyOf": [
  12158. {
  12159. "type": "boolean"
  12160. },
  12161. {
  12162. "type": "object",
  12163. "properties": {
  12164. "field": {
  12165. "type": "string",
  12166. "enum": ["reasoning_content", "reasoning_details"]
  12167. }
  12168. },
  12169. "required": ["field"]
  12170. }
  12171. ]
  12172. }
  12173. },
  12174. "required": ["temperature", "reasoning", "attachment", "toolcall", "input", "output", "interleaved"]
  12175. },
  12176. "cost": {
  12177. "type": "object",
  12178. "properties": {
  12179. "input": {
  12180. "type": "number"
  12181. },
  12182. "output": {
  12183. "type": "number"
  12184. },
  12185. "cache": {
  12186. "type": "object",
  12187. "properties": {
  12188. "read": {
  12189. "type": "number"
  12190. },
  12191. "write": {
  12192. "type": "number"
  12193. }
  12194. },
  12195. "required": ["read", "write"]
  12196. },
  12197. "experimentalOver200K": {
  12198. "type": "object",
  12199. "properties": {
  12200. "input": {
  12201. "type": "number"
  12202. },
  12203. "output": {
  12204. "type": "number"
  12205. },
  12206. "cache": {
  12207. "type": "object",
  12208. "properties": {
  12209. "read": {
  12210. "type": "number"
  12211. },
  12212. "write": {
  12213. "type": "number"
  12214. }
  12215. },
  12216. "required": ["read", "write"]
  12217. }
  12218. },
  12219. "required": ["input", "output", "cache"]
  12220. }
  12221. },
  12222. "required": ["input", "output", "cache"]
  12223. },
  12224. "limit": {
  12225. "type": "object",
  12226. "properties": {
  12227. "context": {
  12228. "type": "number"
  12229. },
  12230. "input": {
  12231. "type": "number"
  12232. },
  12233. "output": {
  12234. "type": "number"
  12235. }
  12236. },
  12237. "required": ["context", "output"]
  12238. },
  12239. "status": {
  12240. "type": "string",
  12241. "enum": ["alpha", "beta", "deprecated", "active"]
  12242. },
  12243. "options": {
  12244. "type": "object",
  12245. "propertyNames": {
  12246. "type": "string"
  12247. },
  12248. "additionalProperties": {}
  12249. },
  12250. "headers": {
  12251. "type": "object",
  12252. "propertyNames": {
  12253. "type": "string"
  12254. },
  12255. "additionalProperties": {
  12256. "type": "string"
  12257. }
  12258. },
  12259. "release_date": {
  12260. "type": "string"
  12261. },
  12262. "variants": {
  12263. "type": "object",
  12264. "propertyNames": {
  12265. "type": "string"
  12266. },
  12267. "additionalProperties": {
  12268. "type": "object",
  12269. "propertyNames": {
  12270. "type": "string"
  12271. },
  12272. "additionalProperties": {}
  12273. }
  12274. }
  12275. },
  12276. "required": [
  12277. "id",
  12278. "providerID",
  12279. "api",
  12280. "name",
  12281. "capabilities",
  12282. "cost",
  12283. "limit",
  12284. "status",
  12285. "options",
  12286. "headers",
  12287. "release_date"
  12288. ]
  12289. },
  12290. "Provider": {
  12291. "type": "object",
  12292. "properties": {
  12293. "id": {
  12294. "type": "string"
  12295. },
  12296. "name": {
  12297. "type": "string"
  12298. },
  12299. "source": {
  12300. "type": "string",
  12301. "enum": ["env", "config", "custom", "api"]
  12302. },
  12303. "env": {
  12304. "type": "array",
  12305. "items": {
  12306. "type": "string"
  12307. }
  12308. },
  12309. "key": {
  12310. "type": "string"
  12311. },
  12312. "options": {
  12313. "type": "object",
  12314. "propertyNames": {
  12315. "type": "string"
  12316. },
  12317. "additionalProperties": {}
  12318. },
  12319. "models": {
  12320. "type": "object",
  12321. "propertyNames": {
  12322. "type": "string"
  12323. },
  12324. "additionalProperties": {
  12325. "$ref": "#/components/schemas/Model"
  12326. }
  12327. }
  12328. },
  12329. "required": ["id", "name", "source", "env", "options", "models"]
  12330. },
  12331. "ConsoleState": {
  12332. "type": "object",
  12333. "properties": {
  12334. "consoleManagedProviders": {
  12335. "type": "array",
  12336. "items": {
  12337. "type": "string"
  12338. }
  12339. },
  12340. "activeOrgName": {
  12341. "type": "string"
  12342. },
  12343. "switchableOrgCount": {
  12344. "type": "number"
  12345. }
  12346. },
  12347. "required": ["consoleManagedProviders", "switchableOrgCount"]
  12348. },
  12349. "ToolIDs": {
  12350. "type": "array",
  12351. "items": {
  12352. "type": "string"
  12353. }
  12354. },
  12355. "ToolListItem": {
  12356. "type": "object",
  12357. "properties": {
  12358. "id": {
  12359. "type": "string"
  12360. },
  12361. "description": {
  12362. "type": "string"
  12363. },
  12364. "parameters": {}
  12365. },
  12366. "required": ["id", "description", "parameters"]
  12367. },
  12368. "ToolList": {
  12369. "type": "array",
  12370. "items": {
  12371. "$ref": "#/components/schemas/ToolListItem"
  12372. }
  12373. },
  12374. "Worktree": {
  12375. "type": "object",
  12376. "properties": {
  12377. "name": {
  12378. "type": "string"
  12379. },
  12380. "branch": {
  12381. "type": "string"
  12382. },
  12383. "directory": {
  12384. "type": "string"
  12385. }
  12386. },
  12387. "required": ["name", "branch", "directory"]
  12388. },
  12389. "WorktreeCreateInput": {
  12390. "type": "object",
  12391. "properties": {
  12392. "name": {
  12393. "type": "string"
  12394. },
  12395. "startCommand": {
  12396. "description": "Additional startup script to run after the project's start command",
  12397. "type": "string"
  12398. }
  12399. }
  12400. },
  12401. "WorktreeRemoveInput": {
  12402. "type": "object",
  12403. "properties": {
  12404. "directory": {
  12405. "type": "string"
  12406. }
  12407. },
  12408. "required": ["directory"]
  12409. },
  12410. "WorktreeResetInput": {
  12411. "type": "object",
  12412. "properties": {
  12413. "directory": {
  12414. "type": "string"
  12415. }
  12416. },
  12417. "required": ["directory"]
  12418. },
  12419. "ProjectSummary": {
  12420. "type": "object",
  12421. "properties": {
  12422. "id": {
  12423. "type": "string"
  12424. },
  12425. "name": {
  12426. "type": "string"
  12427. },
  12428. "worktree": {
  12429. "type": "string"
  12430. }
  12431. },
  12432. "required": ["id", "worktree"]
  12433. },
  12434. "GlobalSession": {
  12435. "type": "object",
  12436. "properties": {
  12437. "id": {
  12438. "type": "string",
  12439. "pattern": "^ses.*"
  12440. },
  12441. "slug": {
  12442. "type": "string"
  12443. },
  12444. "projectID": {
  12445. "type": "string"
  12446. },
  12447. "workspaceID": {
  12448. "type": "string",
  12449. "pattern": "^wrk.*"
  12450. },
  12451. "directory": {
  12452. "type": "string"
  12453. },
  12454. "parentID": {
  12455. "type": "string",
  12456. "pattern": "^ses.*"
  12457. },
  12458. "summary": {
  12459. "type": "object",
  12460. "properties": {
  12461. "additions": {
  12462. "type": "number"
  12463. },
  12464. "deletions": {
  12465. "type": "number"
  12466. },
  12467. "files": {
  12468. "type": "number"
  12469. },
  12470. "diffs": {
  12471. "type": "array",
  12472. "items": {
  12473. "$ref": "#/components/schemas/SnapshotFileDiff"
  12474. }
  12475. }
  12476. },
  12477. "required": ["additions", "deletions", "files"]
  12478. },
  12479. "share": {
  12480. "type": "object",
  12481. "properties": {
  12482. "url": {
  12483. "type": "string"
  12484. }
  12485. },
  12486. "required": ["url"]
  12487. },
  12488. "title": {
  12489. "type": "string"
  12490. },
  12491. "version": {
  12492. "type": "string"
  12493. },
  12494. "time": {
  12495. "type": "object",
  12496. "properties": {
  12497. "created": {
  12498. "type": "number"
  12499. },
  12500. "updated": {
  12501. "type": "number"
  12502. },
  12503. "compacting": {
  12504. "type": "number"
  12505. },
  12506. "archived": {
  12507. "type": "number"
  12508. }
  12509. },
  12510. "required": ["created", "updated"]
  12511. },
  12512. "permission": {
  12513. "$ref": "#/components/schemas/PermissionRuleset"
  12514. },
  12515. "revert": {
  12516. "type": "object",
  12517. "properties": {
  12518. "messageID": {
  12519. "type": "string",
  12520. "pattern": "^msg.*"
  12521. },
  12522. "partID": {
  12523. "type": "string",
  12524. "pattern": "^prt.*"
  12525. },
  12526. "snapshot": {
  12527. "type": "string"
  12528. },
  12529. "diff": {
  12530. "type": "string"
  12531. }
  12532. },
  12533. "required": ["messageID"]
  12534. },
  12535. "project": {
  12536. "anyOf": [
  12537. {
  12538. "$ref": "#/components/schemas/ProjectSummary"
  12539. },
  12540. {
  12541. "type": "null"
  12542. }
  12543. ]
  12544. }
  12545. },
  12546. "required": ["id", "slug", "projectID", "directory", "title", "version", "time", "project"]
  12547. },
  12548. "McpResource": {
  12549. "type": "object",
  12550. "properties": {
  12551. "name": {
  12552. "type": "string"
  12553. },
  12554. "uri": {
  12555. "type": "string"
  12556. },
  12557. "description": {
  12558. "type": "string"
  12559. },
  12560. "mimeType": {
  12561. "type": "string"
  12562. },
  12563. "client": {
  12564. "type": "string"
  12565. }
  12566. },
  12567. "required": ["name", "uri", "client"]
  12568. },
  12569. "TextPartInput": {
  12570. "type": "object",
  12571. "properties": {
  12572. "id": {
  12573. "type": "string",
  12574. "pattern": "^prt.*"
  12575. },
  12576. "type": {
  12577. "type": "string",
  12578. "const": "text"
  12579. },
  12580. "text": {
  12581. "type": "string"
  12582. },
  12583. "synthetic": {
  12584. "type": "boolean"
  12585. },
  12586. "ignored": {
  12587. "type": "boolean"
  12588. },
  12589. "time": {
  12590. "type": "object",
  12591. "properties": {
  12592. "start": {
  12593. "type": "number"
  12594. },
  12595. "end": {
  12596. "type": "number"
  12597. }
  12598. },
  12599. "required": ["start"]
  12600. },
  12601. "metadata": {
  12602. "type": "object",
  12603. "propertyNames": {
  12604. "type": "string"
  12605. },
  12606. "additionalProperties": {}
  12607. }
  12608. },
  12609. "required": ["type", "text"]
  12610. },
  12611. "FilePartInput": {
  12612. "type": "object",
  12613. "properties": {
  12614. "id": {
  12615. "type": "string",
  12616. "pattern": "^prt.*"
  12617. },
  12618. "type": {
  12619. "type": "string",
  12620. "const": "file"
  12621. },
  12622. "mime": {
  12623. "type": "string"
  12624. },
  12625. "filename": {
  12626. "type": "string"
  12627. },
  12628. "url": {
  12629. "type": "string"
  12630. },
  12631. "source": {
  12632. "$ref": "#/components/schemas/FilePartSource"
  12633. }
  12634. },
  12635. "required": ["type", "mime", "url"]
  12636. },
  12637. "AgentPartInput": {
  12638. "type": "object",
  12639. "properties": {
  12640. "id": {
  12641. "type": "string",
  12642. "pattern": "^prt.*"
  12643. },
  12644. "type": {
  12645. "type": "string",
  12646. "const": "agent"
  12647. },
  12648. "name": {
  12649. "type": "string"
  12650. },
  12651. "source": {
  12652. "type": "object",
  12653. "properties": {
  12654. "value": {
  12655. "type": "string"
  12656. },
  12657. "start": {
  12658. "type": "integer",
  12659. "minimum": -9007199254740991,
  12660. "maximum": 9007199254740991
  12661. },
  12662. "end": {
  12663. "type": "integer",
  12664. "minimum": -9007199254740991,
  12665. "maximum": 9007199254740991
  12666. }
  12667. },
  12668. "required": ["value", "start", "end"]
  12669. }
  12670. },
  12671. "required": ["type", "name"]
  12672. },
  12673. "SubtaskPartInput": {
  12674. "type": "object",
  12675. "properties": {
  12676. "id": {
  12677. "type": "string",
  12678. "pattern": "^prt.*"
  12679. },
  12680. "type": {
  12681. "type": "string",
  12682. "const": "subtask"
  12683. },
  12684. "prompt": {
  12685. "type": "string"
  12686. },
  12687. "description": {
  12688. "type": "string"
  12689. },
  12690. "agent": {
  12691. "type": "string"
  12692. },
  12693. "model": {
  12694. "type": "object",
  12695. "properties": {
  12696. "providerID": {
  12697. "type": "string"
  12698. },
  12699. "modelID": {
  12700. "type": "string"
  12701. }
  12702. },
  12703. "required": ["providerID", "modelID"]
  12704. },
  12705. "command": {
  12706. "type": "string"
  12707. }
  12708. },
  12709. "required": ["type", "prompt", "description", "agent"]
  12710. },
  12711. "ProviderAuthMethod": {
  12712. "type": "object",
  12713. "properties": {
  12714. "type": {
  12715. "type": "string",
  12716. "enum": ["oauth", "api"]
  12717. },
  12718. "label": {
  12719. "type": "string"
  12720. },
  12721. "prompts": {
  12722. "type": "array",
  12723. "items": {
  12724. "anyOf": [
  12725. {
  12726. "type": "object",
  12727. "properties": {
  12728. "type": {
  12729. "type": "string",
  12730. "const": "text"
  12731. },
  12732. "key": {
  12733. "type": "string"
  12734. },
  12735. "message": {
  12736. "type": "string"
  12737. },
  12738. "placeholder": {
  12739. "type": "string"
  12740. },
  12741. "when": {
  12742. "type": "object",
  12743. "properties": {
  12744. "key": {
  12745. "type": "string"
  12746. },
  12747. "op": {
  12748. "type": "string",
  12749. "enum": ["eq", "neq"]
  12750. },
  12751. "value": {
  12752. "type": "string"
  12753. }
  12754. },
  12755. "required": ["key", "op", "value"]
  12756. }
  12757. },
  12758. "required": ["type", "key", "message"]
  12759. },
  12760. {
  12761. "type": "object",
  12762. "properties": {
  12763. "type": {
  12764. "type": "string",
  12765. "const": "select"
  12766. },
  12767. "key": {
  12768. "type": "string"
  12769. },
  12770. "message": {
  12771. "type": "string"
  12772. },
  12773. "options": {
  12774. "type": "array",
  12775. "items": {
  12776. "type": "object",
  12777. "properties": {
  12778. "label": {
  12779. "type": "string"
  12780. },
  12781. "value": {
  12782. "type": "string"
  12783. },
  12784. "hint": {
  12785. "type": "string"
  12786. }
  12787. },
  12788. "required": ["label", "value"]
  12789. }
  12790. },
  12791. "when": {
  12792. "type": "object",
  12793. "properties": {
  12794. "key": {
  12795. "type": "string"
  12796. },
  12797. "op": {
  12798. "type": "string",
  12799. "enum": ["eq", "neq"]
  12800. },
  12801. "value": {
  12802. "type": "string"
  12803. }
  12804. },
  12805. "required": ["key", "op", "value"]
  12806. }
  12807. },
  12808. "required": ["type", "key", "message", "options"]
  12809. }
  12810. ]
  12811. }
  12812. }
  12813. },
  12814. "required": ["type", "label"]
  12815. },
  12816. "ProviderAuthAuthorization": {
  12817. "type": "object",
  12818. "properties": {
  12819. "url": {
  12820. "type": "string"
  12821. },
  12822. "method": {
  12823. "type": "string",
  12824. "enum": ["auto", "code"]
  12825. },
  12826. "instructions": {
  12827. "type": "string"
  12828. }
  12829. },
  12830. "required": ["url", "method", "instructions"]
  12831. },
  12832. "Symbol": {
  12833. "type": "object",
  12834. "properties": {
  12835. "name": {
  12836. "type": "string"
  12837. },
  12838. "kind": {
  12839. "type": "number"
  12840. },
  12841. "location": {
  12842. "type": "object",
  12843. "properties": {
  12844. "uri": {
  12845. "type": "string"
  12846. },
  12847. "range": {
  12848. "$ref": "#/components/schemas/Range"
  12849. }
  12850. },
  12851. "required": ["uri", "range"]
  12852. }
  12853. },
  12854. "required": ["name", "kind", "location"]
  12855. },
  12856. "FileNode": {
  12857. "type": "object",
  12858. "properties": {
  12859. "name": {
  12860. "type": "string"
  12861. },
  12862. "path": {
  12863. "type": "string"
  12864. },
  12865. "absolute": {
  12866. "type": "string"
  12867. },
  12868. "type": {
  12869. "type": "string",
  12870. "enum": ["file", "directory"]
  12871. },
  12872. "ignored": {
  12873. "type": "boolean"
  12874. }
  12875. },
  12876. "required": ["name", "path", "absolute", "type", "ignored"]
  12877. },
  12878. "FileContent": {
  12879. "type": "object",
  12880. "properties": {
  12881. "type": {
  12882. "type": "string",
  12883. "enum": ["text", "binary"]
  12884. },
  12885. "content": {
  12886. "type": "string"
  12887. },
  12888. "diff": {
  12889. "type": "string"
  12890. },
  12891. "patch": {
  12892. "type": "object",
  12893. "properties": {
  12894. "oldFileName": {
  12895. "type": "string"
  12896. },
  12897. "newFileName": {
  12898. "type": "string"
  12899. },
  12900. "oldHeader": {
  12901. "type": "string"
  12902. },
  12903. "newHeader": {
  12904. "type": "string"
  12905. },
  12906. "hunks": {
  12907. "type": "array",
  12908. "items": {
  12909. "type": "object",
  12910. "properties": {
  12911. "oldStart": {
  12912. "type": "number"
  12913. },
  12914. "oldLines": {
  12915. "type": "number"
  12916. },
  12917. "newStart": {
  12918. "type": "number"
  12919. },
  12920. "newLines": {
  12921. "type": "number"
  12922. },
  12923. "lines": {
  12924. "type": "array",
  12925. "items": {
  12926. "type": "string"
  12927. }
  12928. }
  12929. },
  12930. "required": ["oldStart", "oldLines", "newStart", "newLines", "lines"]
  12931. }
  12932. },
  12933. "index": {
  12934. "type": "string"
  12935. }
  12936. },
  12937. "required": ["oldFileName", "newFileName", "hunks"]
  12938. },
  12939. "encoding": {
  12940. "type": "string",
  12941. "const": "base64"
  12942. },
  12943. "mimeType": {
  12944. "type": "string"
  12945. }
  12946. },
  12947. "required": ["type", "content"]
  12948. },
  12949. "File": {
  12950. "type": "object",
  12951. "properties": {
  12952. "path": {
  12953. "type": "string"
  12954. },
  12955. "added": {
  12956. "type": "integer",
  12957. "minimum": -9007199254740991,
  12958. "maximum": 9007199254740991
  12959. },
  12960. "removed": {
  12961. "type": "integer",
  12962. "minimum": -9007199254740991,
  12963. "maximum": 9007199254740991
  12964. },
  12965. "status": {
  12966. "type": "string",
  12967. "enum": ["added", "deleted", "modified"]
  12968. }
  12969. },
  12970. "required": ["path", "added", "removed", "status"]
  12971. },
  12972. "Event": {
  12973. "anyOf": [
  12974. {
  12975. "$ref": "#/components/schemas/Event.project.updated"
  12976. },
  12977. {
  12978. "$ref": "#/components/schemas/Event.server.instance.disposed"
  12979. },
  12980. {
  12981. "$ref": "#/components/schemas/Event.server.connected"
  12982. },
  12983. {
  12984. "$ref": "#/components/schemas/Event.global.disposed"
  12985. },
  12986. {
  12987. "$ref": "#/components/schemas/Event.file.edited"
  12988. },
  12989. {
  12990. "$ref": "#/components/schemas/Event.file.watcher.updated"
  12991. },
  12992. {
  12993. "$ref": "#/components/schemas/Event.lsp.client.diagnostics"
  12994. },
  12995. {
  12996. "$ref": "#/components/schemas/Event.lsp.updated"
  12997. },
  12998. {
  12999. "$ref": "#/components/schemas/Event.installation.updated"
  13000. },
  13001. {
  13002. "$ref": "#/components/schemas/Event.installation.update-available"
  13003. },
  13004. {
  13005. "$ref": "#/components/schemas/Event.message.part.delta"
  13006. },
  13007. {
  13008. "$ref": "#/components/schemas/Event.permission.asked"
  13009. },
  13010. {
  13011. "$ref": "#/components/schemas/Event.permission.replied"
  13012. },
  13013. {
  13014. "$ref": "#/components/schemas/Event.session.diff"
  13015. },
  13016. {
  13017. "$ref": "#/components/schemas/Event.session.error"
  13018. },
  13019. {
  13020. "$ref": "#/components/schemas/Event.question.asked"
  13021. },
  13022. {
  13023. "$ref": "#/components/schemas/Event.question.replied"
  13024. },
  13025. {
  13026. "$ref": "#/components/schemas/Event.question.rejected"
  13027. },
  13028. {
  13029. "$ref": "#/components/schemas/Event.todo.updated"
  13030. },
  13031. {
  13032. "$ref": "#/components/schemas/Event.session.status"
  13033. },
  13034. {
  13035. "$ref": "#/components/schemas/Event.session.idle"
  13036. },
  13037. {
  13038. "$ref": "#/components/schemas/Event.session.compacted"
  13039. },
  13040. {
  13041. "$ref": "#/components/schemas/Event.tui.prompt.append"
  13042. },
  13043. {
  13044. "$ref": "#/components/schemas/Event.tui.command.execute"
  13045. },
  13046. {
  13047. "$ref": "#/components/schemas/Event.tui.toast.show"
  13048. },
  13049. {
  13050. "$ref": "#/components/schemas/Event.tui.session.select"
  13051. },
  13052. {
  13053. "$ref": "#/components/schemas/Event.mcp.tools.changed"
  13054. },
  13055. {
  13056. "$ref": "#/components/schemas/Event.mcp.browser.open.failed"
  13057. },
  13058. {
  13059. "$ref": "#/components/schemas/Event.command.executed"
  13060. },
  13061. {
  13062. "$ref": "#/components/schemas/Event.vcs.branch.updated"
  13063. },
  13064. {
  13065. "$ref": "#/components/schemas/Event.worktree.ready"
  13066. },
  13067. {
  13068. "$ref": "#/components/schemas/Event.worktree.failed"
  13069. },
  13070. {
  13071. "$ref": "#/components/schemas/Event.pty.created"
  13072. },
  13073. {
  13074. "$ref": "#/components/schemas/Event.pty.updated"
  13075. },
  13076. {
  13077. "$ref": "#/components/schemas/Event.pty.exited"
  13078. },
  13079. {
  13080. "$ref": "#/components/schemas/Event.pty.deleted"
  13081. },
  13082. {
  13083. "$ref": "#/components/schemas/Event.workspace.ready"
  13084. },
  13085. {
  13086. "$ref": "#/components/schemas/Event.workspace.failed"
  13087. },
  13088. {
  13089. "$ref": "#/components/schemas/Event.workspace.restore"
  13090. },
  13091. {
  13092. "$ref": "#/components/schemas/Event.workspace.status"
  13093. },
  13094. {
  13095. "$ref": "#/components/schemas/Event.message.updated"
  13096. },
  13097. {
  13098. "$ref": "#/components/schemas/Event.message.removed"
  13099. },
  13100. {
  13101. "$ref": "#/components/schemas/Event.message.part.updated"
  13102. },
  13103. {
  13104. "$ref": "#/components/schemas/Event.message.part.removed"
  13105. },
  13106. {
  13107. "$ref": "#/components/schemas/Event.session.created"
  13108. },
  13109. {
  13110. "$ref": "#/components/schemas/Event.session.updated"
  13111. },
  13112. {
  13113. "$ref": "#/components/schemas/Event.session.deleted"
  13114. }
  13115. ]
  13116. },
  13117. "MCPStatusConnected": {
  13118. "type": "object",
  13119. "properties": {
  13120. "status": {
  13121. "type": "string",
  13122. "const": "connected"
  13123. }
  13124. },
  13125. "required": ["status"]
  13126. },
  13127. "MCPStatusDisabled": {
  13128. "type": "object",
  13129. "properties": {
  13130. "status": {
  13131. "type": "string",
  13132. "const": "disabled"
  13133. }
  13134. },
  13135. "required": ["status"]
  13136. },
  13137. "MCPStatusFailed": {
  13138. "type": "object",
  13139. "properties": {
  13140. "status": {
  13141. "type": "string",
  13142. "const": "failed"
  13143. },
  13144. "error": {
  13145. "type": "string"
  13146. }
  13147. },
  13148. "required": ["status", "error"]
  13149. },
  13150. "MCPStatusNeedsAuth": {
  13151. "type": "object",
  13152. "properties": {
  13153. "status": {
  13154. "type": "string",
  13155. "const": "needs_auth"
  13156. }
  13157. },
  13158. "required": ["status"]
  13159. },
  13160. "MCPStatusNeedsClientRegistration": {
  13161. "type": "object",
  13162. "properties": {
  13163. "status": {
  13164. "type": "string",
  13165. "const": "needs_client_registration"
  13166. },
  13167. "error": {
  13168. "type": "string"
  13169. }
  13170. },
  13171. "required": ["status", "error"]
  13172. },
  13173. "MCPStatus": {
  13174. "anyOf": [
  13175. {
  13176. "$ref": "#/components/schemas/MCPStatusConnected"
  13177. },
  13178. {
  13179. "$ref": "#/components/schemas/MCPStatusDisabled"
  13180. },
  13181. {
  13182. "$ref": "#/components/schemas/MCPStatusFailed"
  13183. },
  13184. {
  13185. "$ref": "#/components/schemas/MCPStatusNeedsAuth"
  13186. },
  13187. {
  13188. "$ref": "#/components/schemas/MCPStatusNeedsClientRegistration"
  13189. }
  13190. ]
  13191. },
  13192. "Path": {
  13193. "type": "object",
  13194. "properties": {
  13195. "home": {
  13196. "type": "string"
  13197. },
  13198. "state": {
  13199. "type": "string"
  13200. },
  13201. "config": {
  13202. "type": "string"
  13203. },
  13204. "worktree": {
  13205. "type": "string"
  13206. },
  13207. "directory": {
  13208. "type": "string"
  13209. }
  13210. },
  13211. "required": ["home", "state", "config", "worktree", "directory"]
  13212. },
  13213. "VcsInfo": {
  13214. "type": "object",
  13215. "properties": {
  13216. "branch": {
  13217. "type": "string"
  13218. },
  13219. "default_branch": {
  13220. "type": "string"
  13221. }
  13222. }
  13223. },
  13224. "VcsFileDiff": {
  13225. "type": "object",
  13226. "properties": {
  13227. "file": {
  13228. "type": "string"
  13229. },
  13230. "patch": {
  13231. "type": "string"
  13232. },
  13233. "additions": {
  13234. "type": "number"
  13235. },
  13236. "deletions": {
  13237. "type": "number"
  13238. },
  13239. "status": {
  13240. "type": "string",
  13241. "enum": ["added", "deleted", "modified"]
  13242. }
  13243. },
  13244. "required": ["file", "patch", "additions", "deletions"]
  13245. },
  13246. "Command": {
  13247. "type": "object",
  13248. "properties": {
  13249. "name": {
  13250. "type": "string"
  13251. },
  13252. "description": {
  13253. "type": "string"
  13254. },
  13255. "agent": {
  13256. "type": "string"
  13257. },
  13258. "model": {
  13259. "type": "string"
  13260. },
  13261. "source": {
  13262. "type": "string",
  13263. "enum": ["command", "mcp", "skill"]
  13264. },
  13265. "template": {
  13266. "anyOf": [
  13267. {
  13268. "type": "string"
  13269. },
  13270. {
  13271. "type": "string"
  13272. }
  13273. ]
  13274. },
  13275. "subtask": {
  13276. "type": "boolean"
  13277. },
  13278. "hints": {
  13279. "type": "array",
  13280. "items": {
  13281. "type": "string"
  13282. }
  13283. }
  13284. },
  13285. "required": ["name", "template", "hints"]
  13286. },
  13287. "Agent": {
  13288. "type": "object",
  13289. "properties": {
  13290. "name": {
  13291. "type": "string"
  13292. },
  13293. "description": {
  13294. "type": "string"
  13295. },
  13296. "mode": {
  13297. "type": "string",
  13298. "enum": ["subagent", "primary", "all"]
  13299. },
  13300. "native": {
  13301. "type": "boolean"
  13302. },
  13303. "hidden": {
  13304. "type": "boolean"
  13305. },
  13306. "topP": {
  13307. "type": "number"
  13308. },
  13309. "temperature": {
  13310. "type": "number"
  13311. },
  13312. "color": {
  13313. "type": "string"
  13314. },
  13315. "permission": {
  13316. "$ref": "#/components/schemas/PermissionRuleset"
  13317. },
  13318. "model": {
  13319. "type": "object",
  13320. "properties": {
  13321. "modelID": {
  13322. "type": "string"
  13323. },
  13324. "providerID": {
  13325. "type": "string"
  13326. }
  13327. },
  13328. "required": ["modelID", "providerID"]
  13329. },
  13330. "variant": {
  13331. "type": "string"
  13332. },
  13333. "prompt": {
  13334. "type": "string"
  13335. },
  13336. "options": {
  13337. "type": "object",
  13338. "propertyNames": {
  13339. "type": "string"
  13340. },
  13341. "additionalProperties": {}
  13342. },
  13343. "steps": {
  13344. "type": "integer",
  13345. "exclusiveMinimum": 0,
  13346. "maximum": 9007199254740991
  13347. }
  13348. },
  13349. "required": ["name", "mode", "permission", "options"]
  13350. },
  13351. "LSPStatus": {
  13352. "type": "object",
  13353. "properties": {
  13354. "id": {
  13355. "type": "string"
  13356. },
  13357. "name": {
  13358. "type": "string"
  13359. },
  13360. "root": {
  13361. "type": "string"
  13362. },
  13363. "status": {
  13364. "anyOf": [
  13365. {
  13366. "type": "string",
  13367. "const": "connected"
  13368. },
  13369. {
  13370. "type": "string",
  13371. "const": "error"
  13372. }
  13373. ]
  13374. }
  13375. },
  13376. "required": ["id", "name", "root", "status"]
  13377. },
  13378. "FormatterStatus": {
  13379. "type": "object",
  13380. "properties": {
  13381. "name": {
  13382. "type": "string"
  13383. },
  13384. "extensions": {
  13385. "type": "array",
  13386. "items": {
  13387. "type": "string"
  13388. }
  13389. },
  13390. "enabled": {
  13391. "type": "boolean"
  13392. }
  13393. },
  13394. "required": ["name", "extensions", "enabled"]
  13395. }
  13396. }
  13397. }
  13398. }