openapi.json 346 KB

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