openapi.json 346 KB

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