openapi.json 352 KB

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