openapi.json 362 KB

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