openapi.json 246 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967
  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/event": {
  10. "get": {
  11. "operationId": "global.event",
  12. "summary": "Get global events",
  13. "description": "Subscribe to global events from the OpenCode system using server-sent events.",
  14. "responses": {
  15. "200": {
  16. "description": "Event stream",
  17. "content": {
  18. "text/event-stream": {
  19. "schema": {
  20. "$ref": "#/components/schemas/GlobalEvent"
  21. }
  22. }
  23. }
  24. }
  25. },
  26. "x-codeSamples": [
  27. {
  28. "lang": "js",
  29. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.event({\n ...\n})"
  30. }
  31. ]
  32. }
  33. },
  34. "/project": {
  35. "get": {
  36. "operationId": "project.list",
  37. "parameters": [
  38. {
  39. "in": "query",
  40. "name": "directory",
  41. "schema": {
  42. "type": "string"
  43. }
  44. }
  45. ],
  46. "summary": "List all projects",
  47. "description": "Get a list of projects that have been opened with OpenCode.",
  48. "responses": {
  49. "200": {
  50. "description": "List of projects",
  51. "content": {
  52. "application/json": {
  53. "schema": {
  54. "type": "array",
  55. "items": {
  56. "$ref": "#/components/schemas/Project"
  57. }
  58. }
  59. }
  60. }
  61. }
  62. },
  63. "x-codeSamples": [
  64. {
  65. "lang": "js",
  66. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.list({\n ...\n})"
  67. }
  68. ]
  69. }
  70. },
  71. "/project/current": {
  72. "get": {
  73. "operationId": "project.current",
  74. "parameters": [
  75. {
  76. "in": "query",
  77. "name": "directory",
  78. "schema": {
  79. "type": "string"
  80. }
  81. }
  82. ],
  83. "summary": "Get current project",
  84. "description": "Retrieve the currently active project that OpenCode is working with.",
  85. "responses": {
  86. "200": {
  87. "description": "Current project information",
  88. "content": {
  89. "application/json": {
  90. "schema": {
  91. "$ref": "#/components/schemas/Project"
  92. }
  93. }
  94. }
  95. }
  96. },
  97. "x-codeSamples": [
  98. {
  99. "lang": "js",
  100. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.current({\n ...\n})"
  101. }
  102. ]
  103. }
  104. },
  105. "/project/{projectID}": {
  106. "patch": {
  107. "operationId": "project.update",
  108. "parameters": [
  109. {
  110. "in": "query",
  111. "name": "directory",
  112. "schema": {
  113. "type": "string"
  114. }
  115. },
  116. {
  117. "in": "path",
  118. "name": "projectID",
  119. "schema": {
  120. "type": "string"
  121. },
  122. "required": true
  123. }
  124. ],
  125. "summary": "Update project",
  126. "description": "Update project properties such as name, icon and color.",
  127. "responses": {
  128. "200": {
  129. "description": "Updated project information",
  130. "content": {
  131. "application/json": {
  132. "schema": {
  133. "$ref": "#/components/schemas/Project"
  134. }
  135. }
  136. }
  137. },
  138. "400": {
  139. "description": "Bad request",
  140. "content": {
  141. "application/json": {
  142. "schema": {
  143. "$ref": "#/components/schemas/BadRequestError"
  144. }
  145. }
  146. }
  147. },
  148. "404": {
  149. "description": "Not found",
  150. "content": {
  151. "application/json": {
  152. "schema": {
  153. "$ref": "#/components/schemas/NotFoundError"
  154. }
  155. }
  156. }
  157. }
  158. },
  159. "requestBody": {
  160. "content": {
  161. "application/json": {
  162. "schema": {
  163. "type": "object",
  164. "properties": {
  165. "name": {
  166. "type": "string"
  167. },
  168. "icon": {
  169. "type": "object",
  170. "properties": {
  171. "url": {
  172. "type": "string"
  173. },
  174. "color": {
  175. "type": "string"
  176. }
  177. }
  178. }
  179. }
  180. }
  181. }
  182. }
  183. },
  184. "x-codeSamples": [
  185. {
  186. "lang": "js",
  187. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.update({\n ...\n})"
  188. }
  189. ]
  190. }
  191. },
  192. "/pty": {
  193. "get": {
  194. "operationId": "pty.list",
  195. "parameters": [
  196. {
  197. "in": "query",
  198. "name": "directory",
  199. "schema": {
  200. "type": "string"
  201. }
  202. }
  203. ],
  204. "summary": "List PTY sessions",
  205. "description": "Get a list of all active pseudo-terminal (PTY) sessions managed by OpenCode.",
  206. "responses": {
  207. "200": {
  208. "description": "List of sessions",
  209. "content": {
  210. "application/json": {
  211. "schema": {
  212. "type": "array",
  213. "items": {
  214. "$ref": "#/components/schemas/Pty"
  215. }
  216. }
  217. }
  218. }
  219. }
  220. },
  221. "x-codeSamples": [
  222. {
  223. "lang": "js",
  224. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.list({\n ...\n})"
  225. }
  226. ]
  227. },
  228. "post": {
  229. "operationId": "pty.create",
  230. "parameters": [
  231. {
  232. "in": "query",
  233. "name": "directory",
  234. "schema": {
  235. "type": "string"
  236. }
  237. }
  238. ],
  239. "summary": "Create PTY session",
  240. "description": "Create a new pseudo-terminal (PTY) session for running shell commands and processes.",
  241. "responses": {
  242. "200": {
  243. "description": "Created session",
  244. "content": {
  245. "application/json": {
  246. "schema": {
  247. "$ref": "#/components/schemas/Pty"
  248. }
  249. }
  250. }
  251. },
  252. "400": {
  253. "description": "Bad request",
  254. "content": {
  255. "application/json": {
  256. "schema": {
  257. "$ref": "#/components/schemas/BadRequestError"
  258. }
  259. }
  260. }
  261. }
  262. },
  263. "requestBody": {
  264. "content": {
  265. "application/json": {
  266. "schema": {
  267. "type": "object",
  268. "properties": {
  269. "command": {
  270. "type": "string"
  271. },
  272. "args": {
  273. "type": "array",
  274. "items": {
  275. "type": "string"
  276. }
  277. },
  278. "cwd": {
  279. "type": "string"
  280. },
  281. "title": {
  282. "type": "string"
  283. },
  284. "env": {
  285. "type": "object",
  286. "propertyNames": {
  287. "type": "string"
  288. },
  289. "additionalProperties": {
  290. "type": "string"
  291. }
  292. }
  293. }
  294. }
  295. }
  296. }
  297. },
  298. "x-codeSamples": [
  299. {
  300. "lang": "js",
  301. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.create({\n ...\n})"
  302. }
  303. ]
  304. }
  305. },
  306. "/pty/{ptyID}": {
  307. "get": {
  308. "operationId": "pty.get",
  309. "parameters": [
  310. {
  311. "in": "query",
  312. "name": "directory",
  313. "schema": {
  314. "type": "string"
  315. }
  316. },
  317. {
  318. "in": "path",
  319. "name": "ptyID",
  320. "schema": {
  321. "type": "string"
  322. },
  323. "required": true
  324. }
  325. ],
  326. "summary": "Get PTY session",
  327. "description": "Retrieve detailed information about a specific pseudo-terminal (PTY) session.",
  328. "responses": {
  329. "200": {
  330. "description": "Session info",
  331. "content": {
  332. "application/json": {
  333. "schema": {
  334. "$ref": "#/components/schemas/Pty"
  335. }
  336. }
  337. }
  338. },
  339. "404": {
  340. "description": "Not found",
  341. "content": {
  342. "application/json": {
  343. "schema": {
  344. "$ref": "#/components/schemas/NotFoundError"
  345. }
  346. }
  347. }
  348. }
  349. },
  350. "x-codeSamples": [
  351. {
  352. "lang": "js",
  353. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.get({\n ...\n})"
  354. }
  355. ]
  356. },
  357. "put": {
  358. "operationId": "pty.update",
  359. "parameters": [
  360. {
  361. "in": "query",
  362. "name": "directory",
  363. "schema": {
  364. "type": "string"
  365. }
  366. },
  367. {
  368. "in": "path",
  369. "name": "ptyID",
  370. "schema": {
  371. "type": "string"
  372. },
  373. "required": true
  374. }
  375. ],
  376. "summary": "Update PTY session",
  377. "description": "Update properties of an existing pseudo-terminal (PTY) session.",
  378. "responses": {
  379. "200": {
  380. "description": "Updated session",
  381. "content": {
  382. "application/json": {
  383. "schema": {
  384. "$ref": "#/components/schemas/Pty"
  385. }
  386. }
  387. }
  388. },
  389. "400": {
  390. "description": "Bad request",
  391. "content": {
  392. "application/json": {
  393. "schema": {
  394. "$ref": "#/components/schemas/BadRequestError"
  395. }
  396. }
  397. }
  398. }
  399. },
  400. "requestBody": {
  401. "content": {
  402. "application/json": {
  403. "schema": {
  404. "type": "object",
  405. "properties": {
  406. "title": {
  407. "type": "string"
  408. },
  409. "size": {
  410. "type": "object",
  411. "properties": {
  412. "rows": {
  413. "type": "number"
  414. },
  415. "cols": {
  416. "type": "number"
  417. }
  418. },
  419. "required": ["rows", "cols"]
  420. }
  421. }
  422. }
  423. }
  424. }
  425. },
  426. "x-codeSamples": [
  427. {
  428. "lang": "js",
  429. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.update({\n ...\n})"
  430. }
  431. ]
  432. },
  433. "delete": {
  434. "operationId": "pty.remove",
  435. "parameters": [
  436. {
  437. "in": "query",
  438. "name": "directory",
  439. "schema": {
  440. "type": "string"
  441. }
  442. },
  443. {
  444. "in": "path",
  445. "name": "ptyID",
  446. "schema": {
  447. "type": "string"
  448. },
  449. "required": true
  450. }
  451. ],
  452. "summary": "Remove PTY session",
  453. "description": "Remove and terminate a specific pseudo-terminal (PTY) session.",
  454. "responses": {
  455. "200": {
  456. "description": "Session removed",
  457. "content": {
  458. "application/json": {
  459. "schema": {
  460. "type": "boolean"
  461. }
  462. }
  463. }
  464. },
  465. "404": {
  466. "description": "Not found",
  467. "content": {
  468. "application/json": {
  469. "schema": {
  470. "$ref": "#/components/schemas/NotFoundError"
  471. }
  472. }
  473. }
  474. }
  475. },
  476. "x-codeSamples": [
  477. {
  478. "lang": "js",
  479. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.remove({\n ...\n})"
  480. }
  481. ]
  482. }
  483. },
  484. "/pty/{ptyID}/connect": {
  485. "get": {
  486. "operationId": "pty.connect",
  487. "parameters": [
  488. {
  489. "in": "query",
  490. "name": "directory",
  491. "schema": {
  492. "type": "string"
  493. }
  494. },
  495. {
  496. "in": "path",
  497. "name": "ptyID",
  498. "schema": {
  499. "type": "string"
  500. },
  501. "required": true
  502. }
  503. ],
  504. "summary": "Connect to PTY session",
  505. "description": "Establish a WebSocket connection to interact with a pseudo-terminal (PTY) session in real-time.",
  506. "responses": {
  507. "200": {
  508. "description": "Connected session",
  509. "content": {
  510. "application/json": {
  511. "schema": {
  512. "type": "boolean"
  513. }
  514. }
  515. }
  516. },
  517. "404": {
  518. "description": "Not found",
  519. "content": {
  520. "application/json": {
  521. "schema": {
  522. "$ref": "#/components/schemas/NotFoundError"
  523. }
  524. }
  525. }
  526. }
  527. },
  528. "x-codeSamples": [
  529. {
  530. "lang": "js",
  531. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.connect({\n ...\n})"
  532. }
  533. ]
  534. }
  535. },
  536. "/config": {
  537. "get": {
  538. "operationId": "config.get",
  539. "parameters": [
  540. {
  541. "in": "query",
  542. "name": "directory",
  543. "schema": {
  544. "type": "string"
  545. }
  546. }
  547. ],
  548. "summary": "Get configuration",
  549. "description": "Retrieve the current OpenCode configuration settings and preferences.",
  550. "responses": {
  551. "200": {
  552. "description": "Get config info",
  553. "content": {
  554. "application/json": {
  555. "schema": {
  556. "$ref": "#/components/schemas/Config"
  557. }
  558. }
  559. }
  560. }
  561. },
  562. "x-codeSamples": [
  563. {
  564. "lang": "js",
  565. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.config.get({\n ...\n})"
  566. }
  567. ]
  568. },
  569. "patch": {
  570. "operationId": "config.update",
  571. "parameters": [
  572. {
  573. "in": "query",
  574. "name": "directory",
  575. "schema": {
  576. "type": "string"
  577. }
  578. }
  579. ],
  580. "summary": "Update configuration",
  581. "description": "Update OpenCode configuration settings and preferences.",
  582. "responses": {
  583. "200": {
  584. "description": "Successfully updated config",
  585. "content": {
  586. "application/json": {
  587. "schema": {
  588. "$ref": "#/components/schemas/Config"
  589. }
  590. }
  591. }
  592. },
  593. "400": {
  594. "description": "Bad request",
  595. "content": {
  596. "application/json": {
  597. "schema": {
  598. "$ref": "#/components/schemas/BadRequestError"
  599. }
  600. }
  601. }
  602. }
  603. },
  604. "requestBody": {
  605. "content": {
  606. "application/json": {
  607. "schema": {
  608. "$ref": "#/components/schemas/Config"
  609. }
  610. }
  611. }
  612. },
  613. "x-codeSamples": [
  614. {
  615. "lang": "js",
  616. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.config.update({\n ...\n})"
  617. }
  618. ]
  619. }
  620. },
  621. "/experimental/tool/ids": {
  622. "get": {
  623. "operationId": "tool.ids",
  624. "parameters": [
  625. {
  626. "in": "query",
  627. "name": "directory",
  628. "schema": {
  629. "type": "string"
  630. }
  631. }
  632. ],
  633. "summary": "List tool IDs",
  634. "description": "Get a list of all available tool IDs, including both built-in tools and dynamically registered tools.",
  635. "responses": {
  636. "200": {
  637. "description": "Tool IDs",
  638. "content": {
  639. "application/json": {
  640. "schema": {
  641. "$ref": "#/components/schemas/ToolIDs"
  642. }
  643. }
  644. }
  645. },
  646. "400": {
  647. "description": "Bad request",
  648. "content": {
  649. "application/json": {
  650. "schema": {
  651. "$ref": "#/components/schemas/BadRequestError"
  652. }
  653. }
  654. }
  655. }
  656. },
  657. "x-codeSamples": [
  658. {
  659. "lang": "js",
  660. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tool.ids({\n ...\n})"
  661. }
  662. ]
  663. }
  664. },
  665. "/experimental/tool": {
  666. "get": {
  667. "operationId": "tool.list",
  668. "parameters": [
  669. {
  670. "in": "query",
  671. "name": "directory",
  672. "schema": {
  673. "type": "string"
  674. }
  675. },
  676. {
  677. "in": "query",
  678. "name": "provider",
  679. "schema": {
  680. "type": "string"
  681. },
  682. "required": true
  683. },
  684. {
  685. "in": "query",
  686. "name": "model",
  687. "schema": {
  688. "type": "string"
  689. },
  690. "required": true
  691. }
  692. ],
  693. "summary": "List tools",
  694. "description": "Get a list of available tools with their JSON schema parameters for a specific provider and model combination.",
  695. "responses": {
  696. "200": {
  697. "description": "Tools",
  698. "content": {
  699. "application/json": {
  700. "schema": {
  701. "$ref": "#/components/schemas/ToolList"
  702. }
  703. }
  704. }
  705. },
  706. "400": {
  707. "description": "Bad request",
  708. "content": {
  709. "application/json": {
  710. "schema": {
  711. "$ref": "#/components/schemas/BadRequestError"
  712. }
  713. }
  714. }
  715. }
  716. },
  717. "x-codeSamples": [
  718. {
  719. "lang": "js",
  720. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tool.list({\n ...\n})"
  721. }
  722. ]
  723. }
  724. },
  725. "/instance/dispose": {
  726. "post": {
  727. "operationId": "instance.dispose",
  728. "parameters": [
  729. {
  730. "in": "query",
  731. "name": "directory",
  732. "schema": {
  733. "type": "string"
  734. }
  735. }
  736. ],
  737. "summary": "Dispose instance",
  738. "description": "Clean up and dispose the current OpenCode instance, releasing all resources.",
  739. "responses": {
  740. "200": {
  741. "description": "Instance disposed",
  742. "content": {
  743. "application/json": {
  744. "schema": {
  745. "type": "boolean"
  746. }
  747. }
  748. }
  749. }
  750. },
  751. "x-codeSamples": [
  752. {
  753. "lang": "js",
  754. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.instance.dispose({\n ...\n})"
  755. }
  756. ]
  757. }
  758. },
  759. "/path": {
  760. "get": {
  761. "operationId": "path.get",
  762. "parameters": [
  763. {
  764. "in": "query",
  765. "name": "directory",
  766. "schema": {
  767. "type": "string"
  768. }
  769. }
  770. ],
  771. "summary": "Get paths",
  772. "description": "Retrieve the current working directory and related path information for the OpenCode instance.",
  773. "responses": {
  774. "200": {
  775. "description": "Path",
  776. "content": {
  777. "application/json": {
  778. "schema": {
  779. "$ref": "#/components/schemas/Path"
  780. }
  781. }
  782. }
  783. }
  784. },
  785. "x-codeSamples": [
  786. {
  787. "lang": "js",
  788. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.path.get({\n ...\n})"
  789. }
  790. ]
  791. }
  792. },
  793. "/vcs": {
  794. "get": {
  795. "operationId": "vcs.get",
  796. "parameters": [
  797. {
  798. "in": "query",
  799. "name": "directory",
  800. "schema": {
  801. "type": "string"
  802. }
  803. }
  804. ],
  805. "summary": "Get VCS info",
  806. "description": "Retrieve version control system (VCS) information for the current project, such as git branch.",
  807. "responses": {
  808. "200": {
  809. "description": "VCS info",
  810. "content": {
  811. "application/json": {
  812. "schema": {
  813. "$ref": "#/components/schemas/VcsInfo"
  814. }
  815. }
  816. }
  817. }
  818. },
  819. "x-codeSamples": [
  820. {
  821. "lang": "js",
  822. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.vcs.get({\n ...\n})"
  823. }
  824. ]
  825. }
  826. },
  827. "/session": {
  828. "get": {
  829. "operationId": "session.list",
  830. "parameters": [
  831. {
  832. "in": "query",
  833. "name": "directory",
  834. "schema": {
  835. "type": "string"
  836. }
  837. }
  838. ],
  839. "summary": "List sessions",
  840. "description": "Get a list of all OpenCode sessions, sorted by most recently updated.",
  841. "responses": {
  842. "200": {
  843. "description": "List of sessions",
  844. "content": {
  845. "application/json": {
  846. "schema": {
  847. "type": "array",
  848. "items": {
  849. "$ref": "#/components/schemas/Session"
  850. }
  851. }
  852. }
  853. }
  854. }
  855. },
  856. "x-codeSamples": [
  857. {
  858. "lang": "js",
  859. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.list({\n ...\n})"
  860. }
  861. ]
  862. },
  863. "post": {
  864. "operationId": "session.create",
  865. "parameters": [
  866. {
  867. "in": "query",
  868. "name": "directory",
  869. "schema": {
  870. "type": "string"
  871. }
  872. }
  873. ],
  874. "summary": "Create session",
  875. "description": "Create a new OpenCode session for interacting with AI assistants and managing conversations.",
  876. "responses": {
  877. "200": {
  878. "description": "Successfully created session",
  879. "content": {
  880. "application/json": {
  881. "schema": {
  882. "$ref": "#/components/schemas/Session"
  883. }
  884. }
  885. }
  886. },
  887. "400": {
  888. "description": "Bad request",
  889. "content": {
  890. "application/json": {
  891. "schema": {
  892. "$ref": "#/components/schemas/BadRequestError"
  893. }
  894. }
  895. }
  896. }
  897. },
  898. "requestBody": {
  899. "content": {
  900. "application/json": {
  901. "schema": {
  902. "type": "object",
  903. "properties": {
  904. "parentID": {
  905. "type": "string",
  906. "pattern": "^ses.*"
  907. },
  908. "title": {
  909. "type": "string"
  910. }
  911. }
  912. }
  913. }
  914. }
  915. },
  916. "x-codeSamples": [
  917. {
  918. "lang": "js",
  919. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.create({\n ...\n})"
  920. }
  921. ]
  922. }
  923. },
  924. "/session/status": {
  925. "get": {
  926. "operationId": "session.status",
  927. "parameters": [
  928. {
  929. "in": "query",
  930. "name": "directory",
  931. "schema": {
  932. "type": "string"
  933. }
  934. }
  935. ],
  936. "summary": "Get session status",
  937. "description": "Retrieve the current status of all sessions, including active, idle, and completed states.",
  938. "responses": {
  939. "200": {
  940. "description": "Get session status",
  941. "content": {
  942. "application/json": {
  943. "schema": {
  944. "type": "object",
  945. "propertyNames": {
  946. "type": "string"
  947. },
  948. "additionalProperties": {
  949. "$ref": "#/components/schemas/SessionStatus"
  950. }
  951. }
  952. }
  953. }
  954. },
  955. "400": {
  956. "description": "Bad request",
  957. "content": {
  958. "application/json": {
  959. "schema": {
  960. "$ref": "#/components/schemas/BadRequestError"
  961. }
  962. }
  963. }
  964. }
  965. },
  966. "x-codeSamples": [
  967. {
  968. "lang": "js",
  969. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.status({\n ...\n})"
  970. }
  971. ]
  972. }
  973. },
  974. "/session/{sessionID}": {
  975. "get": {
  976. "operationId": "session.get",
  977. "parameters": [
  978. {
  979. "in": "query",
  980. "name": "directory",
  981. "schema": {
  982. "type": "string"
  983. }
  984. },
  985. {
  986. "in": "path",
  987. "name": "sessionID",
  988. "schema": {
  989. "type": "string",
  990. "pattern": "^ses.*"
  991. },
  992. "required": true
  993. }
  994. ],
  995. "summary": "Get session",
  996. "description": "Retrieve detailed information about a specific OpenCode session.",
  997. "tags": ["Session"],
  998. "responses": {
  999. "200": {
  1000. "description": "Get session",
  1001. "content": {
  1002. "application/json": {
  1003. "schema": {
  1004. "$ref": "#/components/schemas/Session"
  1005. }
  1006. }
  1007. }
  1008. },
  1009. "400": {
  1010. "description": "Bad request",
  1011. "content": {
  1012. "application/json": {
  1013. "schema": {
  1014. "$ref": "#/components/schemas/BadRequestError"
  1015. }
  1016. }
  1017. }
  1018. },
  1019. "404": {
  1020. "description": "Not found",
  1021. "content": {
  1022. "application/json": {
  1023. "schema": {
  1024. "$ref": "#/components/schemas/NotFoundError"
  1025. }
  1026. }
  1027. }
  1028. }
  1029. },
  1030. "x-codeSamples": [
  1031. {
  1032. "lang": "js",
  1033. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.get({\n ...\n})"
  1034. }
  1035. ]
  1036. },
  1037. "delete": {
  1038. "operationId": "session.delete",
  1039. "parameters": [
  1040. {
  1041. "in": "query",
  1042. "name": "directory",
  1043. "schema": {
  1044. "type": "string"
  1045. }
  1046. },
  1047. {
  1048. "in": "path",
  1049. "name": "sessionID",
  1050. "schema": {
  1051. "type": "string",
  1052. "pattern": "^ses.*"
  1053. },
  1054. "required": true
  1055. }
  1056. ],
  1057. "summary": "Delete session",
  1058. "description": "Delete a session and permanently remove all associated data, including messages and history.",
  1059. "responses": {
  1060. "200": {
  1061. "description": "Successfully deleted session",
  1062. "content": {
  1063. "application/json": {
  1064. "schema": {
  1065. "type": "boolean"
  1066. }
  1067. }
  1068. }
  1069. },
  1070. "400": {
  1071. "description": "Bad request",
  1072. "content": {
  1073. "application/json": {
  1074. "schema": {
  1075. "$ref": "#/components/schemas/BadRequestError"
  1076. }
  1077. }
  1078. }
  1079. },
  1080. "404": {
  1081. "description": "Not found",
  1082. "content": {
  1083. "application/json": {
  1084. "schema": {
  1085. "$ref": "#/components/schemas/NotFoundError"
  1086. }
  1087. }
  1088. }
  1089. }
  1090. },
  1091. "x-codeSamples": [
  1092. {
  1093. "lang": "js",
  1094. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.delete({\n ...\n})"
  1095. }
  1096. ]
  1097. },
  1098. "patch": {
  1099. "operationId": "session.update",
  1100. "parameters": [
  1101. {
  1102. "in": "query",
  1103. "name": "directory",
  1104. "schema": {
  1105. "type": "string"
  1106. }
  1107. },
  1108. {
  1109. "in": "path",
  1110. "name": "sessionID",
  1111. "schema": {
  1112. "type": "string"
  1113. },
  1114. "required": true
  1115. }
  1116. ],
  1117. "summary": "Update session",
  1118. "description": "Update properties of an existing session, such as title or other metadata.",
  1119. "responses": {
  1120. "200": {
  1121. "description": "Successfully updated session",
  1122. "content": {
  1123. "application/json": {
  1124. "schema": {
  1125. "$ref": "#/components/schemas/Session"
  1126. }
  1127. }
  1128. }
  1129. },
  1130. "400": {
  1131. "description": "Bad request",
  1132. "content": {
  1133. "application/json": {
  1134. "schema": {
  1135. "$ref": "#/components/schemas/BadRequestError"
  1136. }
  1137. }
  1138. }
  1139. },
  1140. "404": {
  1141. "description": "Not found",
  1142. "content": {
  1143. "application/json": {
  1144. "schema": {
  1145. "$ref": "#/components/schemas/NotFoundError"
  1146. }
  1147. }
  1148. }
  1149. }
  1150. },
  1151. "requestBody": {
  1152. "content": {
  1153. "application/json": {
  1154. "schema": {
  1155. "type": "object",
  1156. "properties": {
  1157. "title": {
  1158. "type": "string"
  1159. }
  1160. }
  1161. }
  1162. }
  1163. }
  1164. },
  1165. "x-codeSamples": [
  1166. {
  1167. "lang": "js",
  1168. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.update({\n ...\n})"
  1169. }
  1170. ]
  1171. }
  1172. },
  1173. "/session/{sessionID}/children": {
  1174. "get": {
  1175. "operationId": "session.children",
  1176. "parameters": [
  1177. {
  1178. "in": "query",
  1179. "name": "directory",
  1180. "schema": {
  1181. "type": "string"
  1182. }
  1183. },
  1184. {
  1185. "in": "path",
  1186. "name": "sessionID",
  1187. "schema": {
  1188. "type": "string",
  1189. "pattern": "^ses.*"
  1190. },
  1191. "required": true
  1192. }
  1193. ],
  1194. "summary": "Get session children",
  1195. "tags": ["Session"],
  1196. "description": "Retrieve all child sessions that were forked from the specified parent session.",
  1197. "responses": {
  1198. "200": {
  1199. "description": "List of children",
  1200. "content": {
  1201. "application/json": {
  1202. "schema": {
  1203. "type": "array",
  1204. "items": {
  1205. "$ref": "#/components/schemas/Session"
  1206. }
  1207. }
  1208. }
  1209. }
  1210. },
  1211. "400": {
  1212. "description": "Bad request",
  1213. "content": {
  1214. "application/json": {
  1215. "schema": {
  1216. "$ref": "#/components/schemas/BadRequestError"
  1217. }
  1218. }
  1219. }
  1220. },
  1221. "404": {
  1222. "description": "Not found",
  1223. "content": {
  1224. "application/json": {
  1225. "schema": {
  1226. "$ref": "#/components/schemas/NotFoundError"
  1227. }
  1228. }
  1229. }
  1230. }
  1231. },
  1232. "x-codeSamples": [
  1233. {
  1234. "lang": "js",
  1235. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.children({\n ...\n})"
  1236. }
  1237. ]
  1238. }
  1239. },
  1240. "/session/{sessionID}/todo": {
  1241. "get": {
  1242. "operationId": "session.todo",
  1243. "parameters": [
  1244. {
  1245. "in": "query",
  1246. "name": "directory",
  1247. "schema": {
  1248. "type": "string"
  1249. }
  1250. },
  1251. {
  1252. "in": "path",
  1253. "name": "sessionID",
  1254. "schema": {
  1255. "type": "string"
  1256. },
  1257. "required": true,
  1258. "description": "Session ID"
  1259. }
  1260. ],
  1261. "summary": "Get session todos",
  1262. "description": "Retrieve the todo list associated with a specific session, showing tasks and action items.",
  1263. "responses": {
  1264. "200": {
  1265. "description": "Todo list",
  1266. "content": {
  1267. "application/json": {
  1268. "schema": {
  1269. "type": "array",
  1270. "items": {
  1271. "$ref": "#/components/schemas/Todo"
  1272. }
  1273. }
  1274. }
  1275. }
  1276. },
  1277. "400": {
  1278. "description": "Bad request",
  1279. "content": {
  1280. "application/json": {
  1281. "schema": {
  1282. "$ref": "#/components/schemas/BadRequestError"
  1283. }
  1284. }
  1285. }
  1286. },
  1287. "404": {
  1288. "description": "Not found",
  1289. "content": {
  1290. "application/json": {
  1291. "schema": {
  1292. "$ref": "#/components/schemas/NotFoundError"
  1293. }
  1294. }
  1295. }
  1296. }
  1297. },
  1298. "x-codeSamples": [
  1299. {
  1300. "lang": "js",
  1301. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.todo({\n ...\n})"
  1302. }
  1303. ]
  1304. }
  1305. },
  1306. "/session/{sessionID}/init": {
  1307. "post": {
  1308. "operationId": "session.init",
  1309. "parameters": [
  1310. {
  1311. "in": "query",
  1312. "name": "directory",
  1313. "schema": {
  1314. "type": "string"
  1315. }
  1316. },
  1317. {
  1318. "in": "path",
  1319. "name": "sessionID",
  1320. "schema": {
  1321. "type": "string"
  1322. },
  1323. "required": true,
  1324. "description": "Session ID"
  1325. }
  1326. ],
  1327. "summary": "Initialize session",
  1328. "description": "Analyze the current application and create an AGENTS.md file with project-specific agent configurations.",
  1329. "responses": {
  1330. "200": {
  1331. "description": "200",
  1332. "content": {
  1333. "application/json": {
  1334. "schema": {
  1335. "type": "boolean"
  1336. }
  1337. }
  1338. }
  1339. },
  1340. "400": {
  1341. "description": "Bad request",
  1342. "content": {
  1343. "application/json": {
  1344. "schema": {
  1345. "$ref": "#/components/schemas/BadRequestError"
  1346. }
  1347. }
  1348. }
  1349. },
  1350. "404": {
  1351. "description": "Not found",
  1352. "content": {
  1353. "application/json": {
  1354. "schema": {
  1355. "$ref": "#/components/schemas/NotFoundError"
  1356. }
  1357. }
  1358. }
  1359. }
  1360. },
  1361. "requestBody": {
  1362. "content": {
  1363. "application/json": {
  1364. "schema": {
  1365. "type": "object",
  1366. "properties": {
  1367. "modelID": {
  1368. "type": "string"
  1369. },
  1370. "providerID": {
  1371. "type": "string"
  1372. },
  1373. "messageID": {
  1374. "type": "string",
  1375. "pattern": "^msg.*"
  1376. }
  1377. },
  1378. "required": ["modelID", "providerID", "messageID"]
  1379. }
  1380. }
  1381. }
  1382. },
  1383. "x-codeSamples": [
  1384. {
  1385. "lang": "js",
  1386. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.init({\n ...\n})"
  1387. }
  1388. ]
  1389. }
  1390. },
  1391. "/session/{sessionID}/fork": {
  1392. "post": {
  1393. "operationId": "session.fork",
  1394. "parameters": [
  1395. {
  1396. "in": "query",
  1397. "name": "directory",
  1398. "schema": {
  1399. "type": "string"
  1400. }
  1401. },
  1402. {
  1403. "in": "path",
  1404. "name": "sessionID",
  1405. "schema": {
  1406. "type": "string",
  1407. "pattern": "^ses.*"
  1408. },
  1409. "required": true
  1410. }
  1411. ],
  1412. "summary": "Fork session",
  1413. "description": "Create a new session by forking an existing session at a specific message point.",
  1414. "responses": {
  1415. "200": {
  1416. "description": "200",
  1417. "content": {
  1418. "application/json": {
  1419. "schema": {
  1420. "$ref": "#/components/schemas/Session"
  1421. }
  1422. }
  1423. }
  1424. }
  1425. },
  1426. "requestBody": {
  1427. "content": {
  1428. "application/json": {
  1429. "schema": {
  1430. "type": "object",
  1431. "properties": {
  1432. "messageID": {
  1433. "type": "string",
  1434. "pattern": "^msg.*"
  1435. }
  1436. }
  1437. }
  1438. }
  1439. }
  1440. },
  1441. "x-codeSamples": [
  1442. {
  1443. "lang": "js",
  1444. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.fork({\n ...\n})"
  1445. }
  1446. ]
  1447. }
  1448. },
  1449. "/session/{sessionID}/abort": {
  1450. "post": {
  1451. "operationId": "session.abort",
  1452. "parameters": [
  1453. {
  1454. "in": "query",
  1455. "name": "directory",
  1456. "schema": {
  1457. "type": "string"
  1458. }
  1459. },
  1460. {
  1461. "in": "path",
  1462. "name": "sessionID",
  1463. "schema": {
  1464. "type": "string"
  1465. },
  1466. "required": true
  1467. }
  1468. ],
  1469. "summary": "Abort session",
  1470. "description": "Abort an active session and stop any ongoing AI processing or command execution.",
  1471. "responses": {
  1472. "200": {
  1473. "description": "Aborted session",
  1474. "content": {
  1475. "application/json": {
  1476. "schema": {
  1477. "type": "boolean"
  1478. }
  1479. }
  1480. }
  1481. },
  1482. "400": {
  1483. "description": "Bad request",
  1484. "content": {
  1485. "application/json": {
  1486. "schema": {
  1487. "$ref": "#/components/schemas/BadRequestError"
  1488. }
  1489. }
  1490. }
  1491. },
  1492. "404": {
  1493. "description": "Not found",
  1494. "content": {
  1495. "application/json": {
  1496. "schema": {
  1497. "$ref": "#/components/schemas/NotFoundError"
  1498. }
  1499. }
  1500. }
  1501. }
  1502. },
  1503. "x-codeSamples": [
  1504. {
  1505. "lang": "js",
  1506. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.abort({\n ...\n})"
  1507. }
  1508. ]
  1509. }
  1510. },
  1511. "/session/{sessionID}/share": {
  1512. "post": {
  1513. "operationId": "session.share",
  1514. "parameters": [
  1515. {
  1516. "in": "query",
  1517. "name": "directory",
  1518. "schema": {
  1519. "type": "string"
  1520. }
  1521. },
  1522. {
  1523. "in": "path",
  1524. "name": "sessionID",
  1525. "schema": {
  1526. "type": "string"
  1527. },
  1528. "required": true
  1529. }
  1530. ],
  1531. "summary": "Share session",
  1532. "description": "Create a shareable link for a session, allowing others to view the conversation.",
  1533. "responses": {
  1534. "200": {
  1535. "description": "Successfully shared session",
  1536. "content": {
  1537. "application/json": {
  1538. "schema": {
  1539. "$ref": "#/components/schemas/Session"
  1540. }
  1541. }
  1542. }
  1543. },
  1544. "400": {
  1545. "description": "Bad request",
  1546. "content": {
  1547. "application/json": {
  1548. "schema": {
  1549. "$ref": "#/components/schemas/BadRequestError"
  1550. }
  1551. }
  1552. }
  1553. },
  1554. "404": {
  1555. "description": "Not found",
  1556. "content": {
  1557. "application/json": {
  1558. "schema": {
  1559. "$ref": "#/components/schemas/NotFoundError"
  1560. }
  1561. }
  1562. }
  1563. }
  1564. },
  1565. "x-codeSamples": [
  1566. {
  1567. "lang": "js",
  1568. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.share({\n ...\n})"
  1569. }
  1570. ]
  1571. },
  1572. "delete": {
  1573. "operationId": "session.unshare",
  1574. "parameters": [
  1575. {
  1576. "in": "query",
  1577. "name": "directory",
  1578. "schema": {
  1579. "type": "string"
  1580. }
  1581. },
  1582. {
  1583. "in": "path",
  1584. "name": "sessionID",
  1585. "schema": {
  1586. "type": "string",
  1587. "pattern": "^ses.*"
  1588. },
  1589. "required": true
  1590. }
  1591. ],
  1592. "summary": "Unshare session",
  1593. "description": "Remove the shareable link for a session, making it private again.",
  1594. "responses": {
  1595. "200": {
  1596. "description": "Successfully unshared session",
  1597. "content": {
  1598. "application/json": {
  1599. "schema": {
  1600. "$ref": "#/components/schemas/Session"
  1601. }
  1602. }
  1603. }
  1604. },
  1605. "400": {
  1606. "description": "Bad request",
  1607. "content": {
  1608. "application/json": {
  1609. "schema": {
  1610. "$ref": "#/components/schemas/BadRequestError"
  1611. }
  1612. }
  1613. }
  1614. },
  1615. "404": {
  1616. "description": "Not found",
  1617. "content": {
  1618. "application/json": {
  1619. "schema": {
  1620. "$ref": "#/components/schemas/NotFoundError"
  1621. }
  1622. }
  1623. }
  1624. }
  1625. },
  1626. "x-codeSamples": [
  1627. {
  1628. "lang": "js",
  1629. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.unshare({\n ...\n})"
  1630. }
  1631. ]
  1632. }
  1633. },
  1634. "/session/{sessionID}/diff": {
  1635. "get": {
  1636. "operationId": "session.diff",
  1637. "parameters": [
  1638. {
  1639. "in": "query",
  1640. "name": "directory",
  1641. "schema": {
  1642. "type": "string"
  1643. }
  1644. },
  1645. {
  1646. "in": "path",
  1647. "name": "sessionID",
  1648. "schema": {
  1649. "type": "string"
  1650. },
  1651. "required": true,
  1652. "description": "Session ID"
  1653. },
  1654. {
  1655. "in": "query",
  1656. "name": "messageID",
  1657. "schema": {
  1658. "type": "string",
  1659. "pattern": "^msg.*"
  1660. }
  1661. }
  1662. ],
  1663. "summary": "Get session diff",
  1664. "description": "Get all file changes (diffs) made during this session.",
  1665. "responses": {
  1666. "200": {
  1667. "description": "List of diffs",
  1668. "content": {
  1669. "application/json": {
  1670. "schema": {
  1671. "type": "array",
  1672. "items": {
  1673. "$ref": "#/components/schemas/FileDiff"
  1674. }
  1675. }
  1676. }
  1677. }
  1678. },
  1679. "400": {
  1680. "description": "Bad request",
  1681. "content": {
  1682. "application/json": {
  1683. "schema": {
  1684. "$ref": "#/components/schemas/BadRequestError"
  1685. }
  1686. }
  1687. }
  1688. },
  1689. "404": {
  1690. "description": "Not found",
  1691. "content": {
  1692. "application/json": {
  1693. "schema": {
  1694. "$ref": "#/components/schemas/NotFoundError"
  1695. }
  1696. }
  1697. }
  1698. }
  1699. },
  1700. "x-codeSamples": [
  1701. {
  1702. "lang": "js",
  1703. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.diff({\n ...\n})"
  1704. }
  1705. ]
  1706. }
  1707. },
  1708. "/session/{sessionID}/summarize": {
  1709. "post": {
  1710. "operationId": "session.summarize",
  1711. "parameters": [
  1712. {
  1713. "in": "query",
  1714. "name": "directory",
  1715. "schema": {
  1716. "type": "string"
  1717. }
  1718. },
  1719. {
  1720. "in": "path",
  1721. "name": "sessionID",
  1722. "schema": {
  1723. "type": "string"
  1724. },
  1725. "required": true,
  1726. "description": "Session ID"
  1727. }
  1728. ],
  1729. "summary": "Summarize session",
  1730. "description": "Generate a concise summary of the session using AI compaction to preserve key information.",
  1731. "responses": {
  1732. "200": {
  1733. "description": "Summarized session",
  1734. "content": {
  1735. "application/json": {
  1736. "schema": {
  1737. "type": "boolean"
  1738. }
  1739. }
  1740. }
  1741. },
  1742. "400": {
  1743. "description": "Bad request",
  1744. "content": {
  1745. "application/json": {
  1746. "schema": {
  1747. "$ref": "#/components/schemas/BadRequestError"
  1748. }
  1749. }
  1750. }
  1751. },
  1752. "404": {
  1753. "description": "Not found",
  1754. "content": {
  1755. "application/json": {
  1756. "schema": {
  1757. "$ref": "#/components/schemas/NotFoundError"
  1758. }
  1759. }
  1760. }
  1761. }
  1762. },
  1763. "requestBody": {
  1764. "content": {
  1765. "application/json": {
  1766. "schema": {
  1767. "type": "object",
  1768. "properties": {
  1769. "providerID": {
  1770. "type": "string"
  1771. },
  1772. "modelID": {
  1773. "type": "string"
  1774. }
  1775. },
  1776. "required": ["providerID", "modelID"]
  1777. }
  1778. }
  1779. }
  1780. },
  1781. "x-codeSamples": [
  1782. {
  1783. "lang": "js",
  1784. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.summarize({\n ...\n})"
  1785. }
  1786. ]
  1787. }
  1788. },
  1789. "/session/{sessionID}/message": {
  1790. "get": {
  1791. "operationId": "session.messages",
  1792. "parameters": [
  1793. {
  1794. "in": "query",
  1795. "name": "directory",
  1796. "schema": {
  1797. "type": "string"
  1798. }
  1799. },
  1800. {
  1801. "in": "path",
  1802. "name": "sessionID",
  1803. "schema": {
  1804. "type": "string"
  1805. },
  1806. "required": true,
  1807. "description": "Session ID"
  1808. },
  1809. {
  1810. "in": "query",
  1811. "name": "limit",
  1812. "schema": {
  1813. "type": "number"
  1814. }
  1815. }
  1816. ],
  1817. "summary": "Get session messages",
  1818. "description": "Retrieve all messages in a session, including user prompts and AI responses.",
  1819. "responses": {
  1820. "200": {
  1821. "description": "List of messages",
  1822. "content": {
  1823. "application/json": {
  1824. "schema": {
  1825. "type": "array",
  1826. "items": {
  1827. "type": "object",
  1828. "properties": {
  1829. "info": {
  1830. "$ref": "#/components/schemas/Message"
  1831. },
  1832. "parts": {
  1833. "type": "array",
  1834. "items": {
  1835. "$ref": "#/components/schemas/Part"
  1836. }
  1837. }
  1838. },
  1839. "required": ["info", "parts"]
  1840. }
  1841. }
  1842. }
  1843. }
  1844. },
  1845. "400": {
  1846. "description": "Bad request",
  1847. "content": {
  1848. "application/json": {
  1849. "schema": {
  1850. "$ref": "#/components/schemas/BadRequestError"
  1851. }
  1852. }
  1853. }
  1854. },
  1855. "404": {
  1856. "description": "Not found",
  1857. "content": {
  1858. "application/json": {
  1859. "schema": {
  1860. "$ref": "#/components/schemas/NotFoundError"
  1861. }
  1862. }
  1863. }
  1864. }
  1865. },
  1866. "x-codeSamples": [
  1867. {
  1868. "lang": "js",
  1869. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.messages({\n ...\n})"
  1870. }
  1871. ]
  1872. },
  1873. "post": {
  1874. "operationId": "session.prompt",
  1875. "parameters": [
  1876. {
  1877. "in": "query",
  1878. "name": "directory",
  1879. "schema": {
  1880. "type": "string"
  1881. }
  1882. },
  1883. {
  1884. "in": "path",
  1885. "name": "sessionID",
  1886. "schema": {
  1887. "type": "string"
  1888. },
  1889. "required": true,
  1890. "description": "Session ID"
  1891. }
  1892. ],
  1893. "summary": "Send message",
  1894. "description": "Create and send a new message to a session, streaming the AI response.",
  1895. "responses": {
  1896. "200": {
  1897. "description": "Created message",
  1898. "content": {
  1899. "application/json": {
  1900. "schema": {
  1901. "type": "object",
  1902. "properties": {
  1903. "info": {
  1904. "$ref": "#/components/schemas/AssistantMessage"
  1905. },
  1906. "parts": {
  1907. "type": "array",
  1908. "items": {
  1909. "$ref": "#/components/schemas/Part"
  1910. }
  1911. }
  1912. },
  1913. "required": ["info", "parts"]
  1914. }
  1915. }
  1916. }
  1917. },
  1918. "400": {
  1919. "description": "Bad request",
  1920. "content": {
  1921. "application/json": {
  1922. "schema": {
  1923. "$ref": "#/components/schemas/BadRequestError"
  1924. }
  1925. }
  1926. }
  1927. },
  1928. "404": {
  1929. "description": "Not found",
  1930. "content": {
  1931. "application/json": {
  1932. "schema": {
  1933. "$ref": "#/components/schemas/NotFoundError"
  1934. }
  1935. }
  1936. }
  1937. }
  1938. },
  1939. "requestBody": {
  1940. "content": {
  1941. "application/json": {
  1942. "schema": {
  1943. "type": "object",
  1944. "properties": {
  1945. "messageID": {
  1946. "type": "string",
  1947. "pattern": "^msg.*"
  1948. },
  1949. "model": {
  1950. "type": "object",
  1951. "properties": {
  1952. "providerID": {
  1953. "type": "string"
  1954. },
  1955. "modelID": {
  1956. "type": "string"
  1957. }
  1958. },
  1959. "required": ["providerID", "modelID"]
  1960. },
  1961. "agent": {
  1962. "type": "string"
  1963. },
  1964. "noReply": {
  1965. "type": "boolean"
  1966. },
  1967. "system": {
  1968. "type": "string"
  1969. },
  1970. "tools": {
  1971. "type": "object",
  1972. "propertyNames": {
  1973. "type": "string"
  1974. },
  1975. "additionalProperties": {
  1976. "type": "boolean"
  1977. }
  1978. },
  1979. "parts": {
  1980. "type": "array",
  1981. "items": {
  1982. "anyOf": [
  1983. {
  1984. "$ref": "#/components/schemas/TextPartInput"
  1985. },
  1986. {
  1987. "$ref": "#/components/schemas/FilePartInput"
  1988. },
  1989. {
  1990. "$ref": "#/components/schemas/AgentPartInput"
  1991. },
  1992. {
  1993. "$ref": "#/components/schemas/SubtaskPartInput"
  1994. }
  1995. ]
  1996. }
  1997. }
  1998. },
  1999. "required": ["parts"]
  2000. }
  2001. }
  2002. }
  2003. },
  2004. "x-codeSamples": [
  2005. {
  2006. "lang": "js",
  2007. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.prompt({\n ...\n})"
  2008. }
  2009. ]
  2010. }
  2011. },
  2012. "/session/{sessionID}/message/{messageID}": {
  2013. "get": {
  2014. "operationId": "session.message",
  2015. "parameters": [
  2016. {
  2017. "in": "query",
  2018. "name": "directory",
  2019. "schema": {
  2020. "type": "string"
  2021. }
  2022. },
  2023. {
  2024. "in": "path",
  2025. "name": "sessionID",
  2026. "schema": {
  2027. "type": "string"
  2028. },
  2029. "required": true,
  2030. "description": "Session ID"
  2031. },
  2032. {
  2033. "in": "path",
  2034. "name": "messageID",
  2035. "schema": {
  2036. "type": "string"
  2037. },
  2038. "required": true,
  2039. "description": "Message ID"
  2040. }
  2041. ],
  2042. "summary": "Get message",
  2043. "description": "Retrieve a specific message from a session by its message ID.",
  2044. "responses": {
  2045. "200": {
  2046. "description": "Message",
  2047. "content": {
  2048. "application/json": {
  2049. "schema": {
  2050. "type": "object",
  2051. "properties": {
  2052. "info": {
  2053. "$ref": "#/components/schemas/Message"
  2054. },
  2055. "parts": {
  2056. "type": "array",
  2057. "items": {
  2058. "$ref": "#/components/schemas/Part"
  2059. }
  2060. }
  2061. },
  2062. "required": ["info", "parts"]
  2063. }
  2064. }
  2065. }
  2066. },
  2067. "400": {
  2068. "description": "Bad request",
  2069. "content": {
  2070. "application/json": {
  2071. "schema": {
  2072. "$ref": "#/components/schemas/BadRequestError"
  2073. }
  2074. }
  2075. }
  2076. },
  2077. "404": {
  2078. "description": "Not found",
  2079. "content": {
  2080. "application/json": {
  2081. "schema": {
  2082. "$ref": "#/components/schemas/NotFoundError"
  2083. }
  2084. }
  2085. }
  2086. }
  2087. },
  2088. "x-codeSamples": [
  2089. {
  2090. "lang": "js",
  2091. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.message({\n ...\n})"
  2092. }
  2093. ]
  2094. }
  2095. },
  2096. "/session/{sessionID}/prompt_async": {
  2097. "post": {
  2098. "operationId": "session.prompt_async",
  2099. "parameters": [
  2100. {
  2101. "in": "query",
  2102. "name": "directory",
  2103. "schema": {
  2104. "type": "string"
  2105. }
  2106. },
  2107. {
  2108. "in": "path",
  2109. "name": "sessionID",
  2110. "schema": {
  2111. "type": "string"
  2112. },
  2113. "required": true,
  2114. "description": "Session ID"
  2115. }
  2116. ],
  2117. "summary": "Send async message",
  2118. "description": "Create and send a new message to a session asynchronously, starting the session if needed and returning immediately.",
  2119. "responses": {
  2120. "204": {
  2121. "description": "Prompt accepted"
  2122. },
  2123. "400": {
  2124. "description": "Bad request",
  2125. "content": {
  2126. "application/json": {
  2127. "schema": {
  2128. "$ref": "#/components/schemas/BadRequestError"
  2129. }
  2130. }
  2131. }
  2132. },
  2133. "404": {
  2134. "description": "Not found",
  2135. "content": {
  2136. "application/json": {
  2137. "schema": {
  2138. "$ref": "#/components/schemas/NotFoundError"
  2139. }
  2140. }
  2141. }
  2142. }
  2143. },
  2144. "requestBody": {
  2145. "content": {
  2146. "application/json": {
  2147. "schema": {
  2148. "type": "object",
  2149. "properties": {
  2150. "messageID": {
  2151. "type": "string",
  2152. "pattern": "^msg.*"
  2153. },
  2154. "model": {
  2155. "type": "object",
  2156. "properties": {
  2157. "providerID": {
  2158. "type": "string"
  2159. },
  2160. "modelID": {
  2161. "type": "string"
  2162. }
  2163. },
  2164. "required": ["providerID", "modelID"]
  2165. },
  2166. "agent": {
  2167. "type": "string"
  2168. },
  2169. "noReply": {
  2170. "type": "boolean"
  2171. },
  2172. "system": {
  2173. "type": "string"
  2174. },
  2175. "tools": {
  2176. "type": "object",
  2177. "propertyNames": {
  2178. "type": "string"
  2179. },
  2180. "additionalProperties": {
  2181. "type": "boolean"
  2182. }
  2183. },
  2184. "parts": {
  2185. "type": "array",
  2186. "items": {
  2187. "anyOf": [
  2188. {
  2189. "$ref": "#/components/schemas/TextPartInput"
  2190. },
  2191. {
  2192. "$ref": "#/components/schemas/FilePartInput"
  2193. },
  2194. {
  2195. "$ref": "#/components/schemas/AgentPartInput"
  2196. },
  2197. {
  2198. "$ref": "#/components/schemas/SubtaskPartInput"
  2199. }
  2200. ]
  2201. }
  2202. }
  2203. },
  2204. "required": ["parts"]
  2205. }
  2206. }
  2207. }
  2208. },
  2209. "x-codeSamples": [
  2210. {
  2211. "lang": "js",
  2212. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.prompt_async({\n ...\n})"
  2213. }
  2214. ]
  2215. }
  2216. },
  2217. "/session/{sessionID}/command": {
  2218. "post": {
  2219. "operationId": "session.command",
  2220. "parameters": [
  2221. {
  2222. "in": "query",
  2223. "name": "directory",
  2224. "schema": {
  2225. "type": "string"
  2226. }
  2227. },
  2228. {
  2229. "in": "path",
  2230. "name": "sessionID",
  2231. "schema": {
  2232. "type": "string"
  2233. },
  2234. "required": true,
  2235. "description": "Session ID"
  2236. }
  2237. ],
  2238. "summary": "Send command",
  2239. "description": "Send a new command to a session for execution by the AI assistant.",
  2240. "responses": {
  2241. "200": {
  2242. "description": "Created message",
  2243. "content": {
  2244. "application/json": {
  2245. "schema": {
  2246. "type": "object",
  2247. "properties": {
  2248. "info": {
  2249. "$ref": "#/components/schemas/AssistantMessage"
  2250. },
  2251. "parts": {
  2252. "type": "array",
  2253. "items": {
  2254. "$ref": "#/components/schemas/Part"
  2255. }
  2256. }
  2257. },
  2258. "required": ["info", "parts"]
  2259. }
  2260. }
  2261. }
  2262. },
  2263. "400": {
  2264. "description": "Bad request",
  2265. "content": {
  2266. "application/json": {
  2267. "schema": {
  2268. "$ref": "#/components/schemas/BadRequestError"
  2269. }
  2270. }
  2271. }
  2272. },
  2273. "404": {
  2274. "description": "Not found",
  2275. "content": {
  2276. "application/json": {
  2277. "schema": {
  2278. "$ref": "#/components/schemas/NotFoundError"
  2279. }
  2280. }
  2281. }
  2282. }
  2283. },
  2284. "requestBody": {
  2285. "content": {
  2286. "application/json": {
  2287. "schema": {
  2288. "type": "object",
  2289. "properties": {
  2290. "messageID": {
  2291. "type": "string",
  2292. "pattern": "^msg.*"
  2293. },
  2294. "agent": {
  2295. "type": "string"
  2296. },
  2297. "model": {
  2298. "type": "string"
  2299. },
  2300. "arguments": {
  2301. "type": "string"
  2302. },
  2303. "command": {
  2304. "type": "string"
  2305. }
  2306. },
  2307. "required": ["arguments", "command"]
  2308. }
  2309. }
  2310. }
  2311. },
  2312. "x-codeSamples": [
  2313. {
  2314. "lang": "js",
  2315. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.command({\n ...\n})"
  2316. }
  2317. ]
  2318. }
  2319. },
  2320. "/session/{sessionID}/shell": {
  2321. "post": {
  2322. "operationId": "session.shell",
  2323. "parameters": [
  2324. {
  2325. "in": "query",
  2326. "name": "directory",
  2327. "schema": {
  2328. "type": "string"
  2329. }
  2330. },
  2331. {
  2332. "in": "path",
  2333. "name": "sessionID",
  2334. "schema": {
  2335. "type": "string"
  2336. },
  2337. "required": true,
  2338. "description": "Session ID"
  2339. }
  2340. ],
  2341. "summary": "Run shell command",
  2342. "description": "Execute a shell command within the session context and return the AI's response.",
  2343. "responses": {
  2344. "200": {
  2345. "description": "Created message",
  2346. "content": {
  2347. "application/json": {
  2348. "schema": {
  2349. "$ref": "#/components/schemas/AssistantMessage"
  2350. }
  2351. }
  2352. }
  2353. },
  2354. "400": {
  2355. "description": "Bad request",
  2356. "content": {
  2357. "application/json": {
  2358. "schema": {
  2359. "$ref": "#/components/schemas/BadRequestError"
  2360. }
  2361. }
  2362. }
  2363. },
  2364. "404": {
  2365. "description": "Not found",
  2366. "content": {
  2367. "application/json": {
  2368. "schema": {
  2369. "$ref": "#/components/schemas/NotFoundError"
  2370. }
  2371. }
  2372. }
  2373. }
  2374. },
  2375. "requestBody": {
  2376. "content": {
  2377. "application/json": {
  2378. "schema": {
  2379. "type": "object",
  2380. "properties": {
  2381. "agent": {
  2382. "type": "string"
  2383. },
  2384. "model": {
  2385. "type": "object",
  2386. "properties": {
  2387. "providerID": {
  2388. "type": "string"
  2389. },
  2390. "modelID": {
  2391. "type": "string"
  2392. }
  2393. },
  2394. "required": ["providerID", "modelID"]
  2395. },
  2396. "command": {
  2397. "type": "string"
  2398. }
  2399. },
  2400. "required": ["agent", "command"]
  2401. }
  2402. }
  2403. }
  2404. },
  2405. "x-codeSamples": [
  2406. {
  2407. "lang": "js",
  2408. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.shell({\n ...\n})"
  2409. }
  2410. ]
  2411. }
  2412. },
  2413. "/session/{sessionID}/revert": {
  2414. "post": {
  2415. "operationId": "session.revert",
  2416. "parameters": [
  2417. {
  2418. "in": "query",
  2419. "name": "directory",
  2420. "schema": {
  2421. "type": "string"
  2422. }
  2423. },
  2424. {
  2425. "in": "path",
  2426. "name": "sessionID",
  2427. "schema": {
  2428. "type": "string"
  2429. },
  2430. "required": true
  2431. }
  2432. ],
  2433. "summary": "Revert message",
  2434. "description": "Revert a specific message in a session, undoing its effects and restoring the previous state.",
  2435. "responses": {
  2436. "200": {
  2437. "description": "Updated session",
  2438. "content": {
  2439. "application/json": {
  2440. "schema": {
  2441. "$ref": "#/components/schemas/Session"
  2442. }
  2443. }
  2444. }
  2445. },
  2446. "400": {
  2447. "description": "Bad request",
  2448. "content": {
  2449. "application/json": {
  2450. "schema": {
  2451. "$ref": "#/components/schemas/BadRequestError"
  2452. }
  2453. }
  2454. }
  2455. },
  2456. "404": {
  2457. "description": "Not found",
  2458. "content": {
  2459. "application/json": {
  2460. "schema": {
  2461. "$ref": "#/components/schemas/NotFoundError"
  2462. }
  2463. }
  2464. }
  2465. }
  2466. },
  2467. "requestBody": {
  2468. "content": {
  2469. "application/json": {
  2470. "schema": {
  2471. "type": "object",
  2472. "properties": {
  2473. "messageID": {
  2474. "type": "string",
  2475. "pattern": "^msg.*"
  2476. },
  2477. "partID": {
  2478. "type": "string",
  2479. "pattern": "^prt.*"
  2480. }
  2481. },
  2482. "required": ["messageID"]
  2483. }
  2484. }
  2485. }
  2486. },
  2487. "x-codeSamples": [
  2488. {
  2489. "lang": "js",
  2490. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.revert({\n ...\n})"
  2491. }
  2492. ]
  2493. }
  2494. },
  2495. "/session/{sessionID}/unrevert": {
  2496. "post": {
  2497. "operationId": "session.unrevert",
  2498. "parameters": [
  2499. {
  2500. "in": "query",
  2501. "name": "directory",
  2502. "schema": {
  2503. "type": "string"
  2504. }
  2505. },
  2506. {
  2507. "in": "path",
  2508. "name": "sessionID",
  2509. "schema": {
  2510. "type": "string"
  2511. },
  2512. "required": true
  2513. }
  2514. ],
  2515. "summary": "Restore reverted messages",
  2516. "description": "Restore all previously reverted messages in a session.",
  2517. "responses": {
  2518. "200": {
  2519. "description": "Updated session",
  2520. "content": {
  2521. "application/json": {
  2522. "schema": {
  2523. "$ref": "#/components/schemas/Session"
  2524. }
  2525. }
  2526. }
  2527. },
  2528. "400": {
  2529. "description": "Bad request",
  2530. "content": {
  2531. "application/json": {
  2532. "schema": {
  2533. "$ref": "#/components/schemas/BadRequestError"
  2534. }
  2535. }
  2536. }
  2537. },
  2538. "404": {
  2539. "description": "Not found",
  2540. "content": {
  2541. "application/json": {
  2542. "schema": {
  2543. "$ref": "#/components/schemas/NotFoundError"
  2544. }
  2545. }
  2546. }
  2547. }
  2548. },
  2549. "x-codeSamples": [
  2550. {
  2551. "lang": "js",
  2552. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.unrevert({\n ...\n})"
  2553. }
  2554. ]
  2555. }
  2556. },
  2557. "/session/{sessionID}/permissions/{permissionID}": {
  2558. "post": {
  2559. "operationId": "permission.respond",
  2560. "parameters": [
  2561. {
  2562. "in": "query",
  2563. "name": "directory",
  2564. "schema": {
  2565. "type": "string"
  2566. }
  2567. },
  2568. {
  2569. "in": "path",
  2570. "name": "sessionID",
  2571. "schema": {
  2572. "type": "string"
  2573. },
  2574. "required": true
  2575. },
  2576. {
  2577. "in": "path",
  2578. "name": "permissionID",
  2579. "schema": {
  2580. "type": "string"
  2581. },
  2582. "required": true
  2583. }
  2584. ],
  2585. "summary": "Respond to permission",
  2586. "description": "Approve or deny a permission request from the AI assistant.",
  2587. "responses": {
  2588. "200": {
  2589. "description": "Permission processed successfully",
  2590. "content": {
  2591. "application/json": {
  2592. "schema": {
  2593. "type": "boolean"
  2594. }
  2595. }
  2596. }
  2597. },
  2598. "400": {
  2599. "description": "Bad request",
  2600. "content": {
  2601. "application/json": {
  2602. "schema": {
  2603. "$ref": "#/components/schemas/BadRequestError"
  2604. }
  2605. }
  2606. }
  2607. },
  2608. "404": {
  2609. "description": "Not found",
  2610. "content": {
  2611. "application/json": {
  2612. "schema": {
  2613. "$ref": "#/components/schemas/NotFoundError"
  2614. }
  2615. }
  2616. }
  2617. }
  2618. },
  2619. "requestBody": {
  2620. "content": {
  2621. "application/json": {
  2622. "schema": {
  2623. "type": "object",
  2624. "properties": {
  2625. "response": {
  2626. "type": "string",
  2627. "enum": ["once", "always", "reject"]
  2628. }
  2629. },
  2630. "required": ["response"]
  2631. }
  2632. }
  2633. }
  2634. },
  2635. "x-codeSamples": [
  2636. {
  2637. "lang": "js",
  2638. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.permission.respond({\n ...\n})"
  2639. }
  2640. ]
  2641. }
  2642. },
  2643. "/command": {
  2644. "get": {
  2645. "operationId": "command.list",
  2646. "parameters": [
  2647. {
  2648. "in": "query",
  2649. "name": "directory",
  2650. "schema": {
  2651. "type": "string"
  2652. }
  2653. }
  2654. ],
  2655. "summary": "List commands",
  2656. "description": "Get a list of all available commands in the OpenCode system.",
  2657. "responses": {
  2658. "200": {
  2659. "description": "List of commands",
  2660. "content": {
  2661. "application/json": {
  2662. "schema": {
  2663. "type": "array",
  2664. "items": {
  2665. "$ref": "#/components/schemas/Command"
  2666. }
  2667. }
  2668. }
  2669. }
  2670. }
  2671. },
  2672. "x-codeSamples": [
  2673. {
  2674. "lang": "js",
  2675. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.command.list({\n ...\n})"
  2676. }
  2677. ]
  2678. }
  2679. },
  2680. "/config/providers": {
  2681. "get": {
  2682. "operationId": "config.providers",
  2683. "parameters": [
  2684. {
  2685. "in": "query",
  2686. "name": "directory",
  2687. "schema": {
  2688. "type": "string"
  2689. }
  2690. }
  2691. ],
  2692. "summary": "List config providers",
  2693. "description": "Get a list of all configured AI providers and their default models.",
  2694. "responses": {
  2695. "200": {
  2696. "description": "List of providers",
  2697. "content": {
  2698. "application/json": {
  2699. "schema": {
  2700. "type": "object",
  2701. "properties": {
  2702. "providers": {
  2703. "type": "array",
  2704. "items": {
  2705. "$ref": "#/components/schemas/Provider"
  2706. }
  2707. },
  2708. "default": {
  2709. "type": "object",
  2710. "propertyNames": {
  2711. "type": "string"
  2712. },
  2713. "additionalProperties": {
  2714. "type": "string"
  2715. }
  2716. }
  2717. },
  2718. "required": ["providers", "default"]
  2719. }
  2720. }
  2721. }
  2722. }
  2723. },
  2724. "x-codeSamples": [
  2725. {
  2726. "lang": "js",
  2727. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.config.providers({\n ...\n})"
  2728. }
  2729. ]
  2730. }
  2731. },
  2732. "/provider": {
  2733. "get": {
  2734. "operationId": "provider.list",
  2735. "parameters": [
  2736. {
  2737. "in": "query",
  2738. "name": "directory",
  2739. "schema": {
  2740. "type": "string"
  2741. }
  2742. }
  2743. ],
  2744. "summary": "List providers",
  2745. "description": "Get a list of all available AI providers, including both available and connected ones.",
  2746. "responses": {
  2747. "200": {
  2748. "description": "List of providers",
  2749. "content": {
  2750. "application/json": {
  2751. "schema": {
  2752. "type": "object",
  2753. "properties": {
  2754. "all": {
  2755. "type": "array",
  2756. "items": {
  2757. "type": "object",
  2758. "properties": {
  2759. "api": {
  2760. "type": "string"
  2761. },
  2762. "name": {
  2763. "type": "string"
  2764. },
  2765. "env": {
  2766. "type": "array",
  2767. "items": {
  2768. "type": "string"
  2769. }
  2770. },
  2771. "id": {
  2772. "type": "string"
  2773. },
  2774. "npm": {
  2775. "type": "string"
  2776. },
  2777. "models": {
  2778. "type": "object",
  2779. "propertyNames": {
  2780. "type": "string"
  2781. },
  2782. "additionalProperties": {
  2783. "type": "object",
  2784. "properties": {
  2785. "id": {
  2786. "type": "string"
  2787. },
  2788. "name": {
  2789. "type": "string"
  2790. },
  2791. "family": {
  2792. "type": "string"
  2793. },
  2794. "release_date": {
  2795. "type": "string"
  2796. },
  2797. "attachment": {
  2798. "type": "boolean"
  2799. },
  2800. "reasoning": {
  2801. "type": "boolean"
  2802. },
  2803. "temperature": {
  2804. "type": "boolean"
  2805. },
  2806. "tool_call": {
  2807. "type": "boolean"
  2808. },
  2809. "interleaved": {
  2810. "anyOf": [
  2811. {
  2812. "type": "boolean",
  2813. "const": true
  2814. },
  2815. {
  2816. "type": "object",
  2817. "properties": {
  2818. "field": {
  2819. "type": "string",
  2820. "enum": ["reasoning_content", "reasoning_details"]
  2821. }
  2822. },
  2823. "required": ["field"],
  2824. "additionalProperties": false
  2825. }
  2826. ]
  2827. },
  2828. "cost": {
  2829. "type": "object",
  2830. "properties": {
  2831. "input": {
  2832. "type": "number"
  2833. },
  2834. "output": {
  2835. "type": "number"
  2836. },
  2837. "cache_read": {
  2838. "type": "number"
  2839. },
  2840. "cache_write": {
  2841. "type": "number"
  2842. },
  2843. "context_over_200k": {
  2844. "type": "object",
  2845. "properties": {
  2846. "input": {
  2847. "type": "number"
  2848. },
  2849. "output": {
  2850. "type": "number"
  2851. },
  2852. "cache_read": {
  2853. "type": "number"
  2854. },
  2855. "cache_write": {
  2856. "type": "number"
  2857. }
  2858. },
  2859. "required": ["input", "output"]
  2860. }
  2861. },
  2862. "required": ["input", "output"]
  2863. },
  2864. "limit": {
  2865. "type": "object",
  2866. "properties": {
  2867. "context": {
  2868. "type": "number"
  2869. },
  2870. "output": {
  2871. "type": "number"
  2872. }
  2873. },
  2874. "required": ["context", "output"]
  2875. },
  2876. "modalities": {
  2877. "type": "object",
  2878. "properties": {
  2879. "input": {
  2880. "type": "array",
  2881. "items": {
  2882. "type": "string",
  2883. "enum": ["text", "audio", "image", "video", "pdf"]
  2884. }
  2885. },
  2886. "output": {
  2887. "type": "array",
  2888. "items": {
  2889. "type": "string",
  2890. "enum": ["text", "audio", "image", "video", "pdf"]
  2891. }
  2892. }
  2893. },
  2894. "required": ["input", "output"]
  2895. },
  2896. "experimental": {
  2897. "type": "boolean"
  2898. },
  2899. "status": {
  2900. "type": "string",
  2901. "enum": ["alpha", "beta", "deprecated"]
  2902. },
  2903. "options": {
  2904. "type": "object",
  2905. "propertyNames": {
  2906. "type": "string"
  2907. },
  2908. "additionalProperties": {}
  2909. },
  2910. "headers": {
  2911. "type": "object",
  2912. "propertyNames": {
  2913. "type": "string"
  2914. },
  2915. "additionalProperties": {
  2916. "type": "string"
  2917. }
  2918. },
  2919. "provider": {
  2920. "type": "object",
  2921. "properties": {
  2922. "npm": {
  2923. "type": "string"
  2924. }
  2925. },
  2926. "required": ["npm"]
  2927. }
  2928. },
  2929. "required": [
  2930. "id",
  2931. "name",
  2932. "release_date",
  2933. "attachment",
  2934. "reasoning",
  2935. "temperature",
  2936. "tool_call",
  2937. "limit",
  2938. "options"
  2939. ]
  2940. }
  2941. }
  2942. },
  2943. "required": ["name", "env", "id", "models"]
  2944. }
  2945. },
  2946. "default": {
  2947. "type": "object",
  2948. "propertyNames": {
  2949. "type": "string"
  2950. },
  2951. "additionalProperties": {
  2952. "type": "string"
  2953. }
  2954. },
  2955. "connected": {
  2956. "type": "array",
  2957. "items": {
  2958. "type": "string"
  2959. }
  2960. }
  2961. },
  2962. "required": ["all", "default", "connected"]
  2963. }
  2964. }
  2965. }
  2966. }
  2967. },
  2968. "x-codeSamples": [
  2969. {
  2970. "lang": "js",
  2971. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.list({\n ...\n})"
  2972. }
  2973. ]
  2974. }
  2975. },
  2976. "/provider/auth": {
  2977. "get": {
  2978. "operationId": "provider.auth",
  2979. "parameters": [
  2980. {
  2981. "in": "query",
  2982. "name": "directory",
  2983. "schema": {
  2984. "type": "string"
  2985. }
  2986. }
  2987. ],
  2988. "summary": "Get provider auth methods",
  2989. "description": "Retrieve available authentication methods for all AI providers.",
  2990. "responses": {
  2991. "200": {
  2992. "description": "Provider auth methods",
  2993. "content": {
  2994. "application/json": {
  2995. "schema": {
  2996. "type": "object",
  2997. "propertyNames": {
  2998. "type": "string"
  2999. },
  3000. "additionalProperties": {
  3001. "type": "array",
  3002. "items": {
  3003. "$ref": "#/components/schemas/ProviderAuthMethod"
  3004. }
  3005. }
  3006. }
  3007. }
  3008. }
  3009. }
  3010. },
  3011. "x-codeSamples": [
  3012. {
  3013. "lang": "js",
  3014. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.auth({\n ...\n})"
  3015. }
  3016. ]
  3017. }
  3018. },
  3019. "/provider/{providerID}/oauth/authorize": {
  3020. "post": {
  3021. "operationId": "provider.oauth.authorize",
  3022. "parameters": [
  3023. {
  3024. "in": "query",
  3025. "name": "directory",
  3026. "schema": {
  3027. "type": "string"
  3028. }
  3029. },
  3030. {
  3031. "in": "path",
  3032. "name": "providerID",
  3033. "schema": {
  3034. "type": "string"
  3035. },
  3036. "required": true,
  3037. "description": "Provider ID"
  3038. }
  3039. ],
  3040. "summary": "OAuth authorize",
  3041. "description": "Initiate OAuth authorization for a specific AI provider to get an authorization URL.",
  3042. "responses": {
  3043. "200": {
  3044. "description": "Authorization URL and method",
  3045. "content": {
  3046. "application/json": {
  3047. "schema": {
  3048. "$ref": "#/components/schemas/ProviderAuthAuthorization"
  3049. }
  3050. }
  3051. }
  3052. },
  3053. "400": {
  3054. "description": "Bad request",
  3055. "content": {
  3056. "application/json": {
  3057. "schema": {
  3058. "$ref": "#/components/schemas/BadRequestError"
  3059. }
  3060. }
  3061. }
  3062. }
  3063. },
  3064. "requestBody": {
  3065. "content": {
  3066. "application/json": {
  3067. "schema": {
  3068. "type": "object",
  3069. "properties": {
  3070. "method": {
  3071. "description": "Auth method index",
  3072. "type": "number"
  3073. }
  3074. },
  3075. "required": ["method"]
  3076. }
  3077. }
  3078. }
  3079. },
  3080. "x-codeSamples": [
  3081. {
  3082. "lang": "js",
  3083. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.oauth.authorize({\n ...\n})"
  3084. }
  3085. ]
  3086. }
  3087. },
  3088. "/provider/{providerID}/oauth/callback": {
  3089. "post": {
  3090. "operationId": "provider.oauth.callback",
  3091. "parameters": [
  3092. {
  3093. "in": "query",
  3094. "name": "directory",
  3095. "schema": {
  3096. "type": "string"
  3097. }
  3098. },
  3099. {
  3100. "in": "path",
  3101. "name": "providerID",
  3102. "schema": {
  3103. "type": "string"
  3104. },
  3105. "required": true,
  3106. "description": "Provider ID"
  3107. }
  3108. ],
  3109. "summary": "OAuth callback",
  3110. "description": "Handle the OAuth callback from a provider after user authorization.",
  3111. "responses": {
  3112. "200": {
  3113. "description": "OAuth callback processed successfully",
  3114. "content": {
  3115. "application/json": {
  3116. "schema": {
  3117. "type": "boolean"
  3118. }
  3119. }
  3120. }
  3121. },
  3122. "400": {
  3123. "description": "Bad request",
  3124. "content": {
  3125. "application/json": {
  3126. "schema": {
  3127. "$ref": "#/components/schemas/BadRequestError"
  3128. }
  3129. }
  3130. }
  3131. }
  3132. },
  3133. "requestBody": {
  3134. "content": {
  3135. "application/json": {
  3136. "schema": {
  3137. "type": "object",
  3138. "properties": {
  3139. "method": {
  3140. "description": "Auth method index",
  3141. "type": "number"
  3142. },
  3143. "code": {
  3144. "description": "OAuth authorization code",
  3145. "type": "string"
  3146. }
  3147. },
  3148. "required": ["method"]
  3149. }
  3150. }
  3151. }
  3152. },
  3153. "x-codeSamples": [
  3154. {
  3155. "lang": "js",
  3156. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.oauth.callback({\n ...\n})"
  3157. }
  3158. ]
  3159. }
  3160. },
  3161. "/find": {
  3162. "get": {
  3163. "operationId": "find.text",
  3164. "parameters": [
  3165. {
  3166. "in": "query",
  3167. "name": "directory",
  3168. "schema": {
  3169. "type": "string"
  3170. }
  3171. },
  3172. {
  3173. "in": "query",
  3174. "name": "pattern",
  3175. "schema": {
  3176. "type": "string"
  3177. },
  3178. "required": true
  3179. }
  3180. ],
  3181. "summary": "Find text",
  3182. "description": "Search for text patterns across files in the project using ripgrep.",
  3183. "responses": {
  3184. "200": {
  3185. "description": "Matches",
  3186. "content": {
  3187. "application/json": {
  3188. "schema": {
  3189. "type": "array",
  3190. "items": {
  3191. "type": "object",
  3192. "properties": {
  3193. "path": {
  3194. "type": "object",
  3195. "properties": {
  3196. "text": {
  3197. "type": "string"
  3198. }
  3199. },
  3200. "required": ["text"]
  3201. },
  3202. "lines": {
  3203. "type": "object",
  3204. "properties": {
  3205. "text": {
  3206. "type": "string"
  3207. }
  3208. },
  3209. "required": ["text"]
  3210. },
  3211. "line_number": {
  3212. "type": "number"
  3213. },
  3214. "absolute_offset": {
  3215. "type": "number"
  3216. },
  3217. "submatches": {
  3218. "type": "array",
  3219. "items": {
  3220. "type": "object",
  3221. "properties": {
  3222. "match": {
  3223. "type": "object",
  3224. "properties": {
  3225. "text": {
  3226. "type": "string"
  3227. }
  3228. },
  3229. "required": ["text"]
  3230. },
  3231. "start": {
  3232. "type": "number"
  3233. },
  3234. "end": {
  3235. "type": "number"
  3236. }
  3237. },
  3238. "required": ["match", "start", "end"]
  3239. }
  3240. }
  3241. },
  3242. "required": ["path", "lines", "line_number", "absolute_offset", "submatches"]
  3243. }
  3244. }
  3245. }
  3246. }
  3247. }
  3248. },
  3249. "x-codeSamples": [
  3250. {
  3251. "lang": "js",
  3252. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.find.text({\n ...\n})"
  3253. }
  3254. ]
  3255. }
  3256. },
  3257. "/find/file": {
  3258. "get": {
  3259. "operationId": "find.files",
  3260. "parameters": [
  3261. {
  3262. "in": "query",
  3263. "name": "directory",
  3264. "schema": {
  3265. "type": "string"
  3266. }
  3267. },
  3268. {
  3269. "in": "query",
  3270. "name": "query",
  3271. "schema": {
  3272. "type": "string"
  3273. },
  3274. "required": true
  3275. },
  3276. {
  3277. "in": "query",
  3278. "name": "dirs",
  3279. "schema": {
  3280. "type": "string",
  3281. "enum": ["true", "false"]
  3282. }
  3283. }
  3284. ],
  3285. "summary": "Find files",
  3286. "description": "Search for files by name or pattern in the project directory.",
  3287. "responses": {
  3288. "200": {
  3289. "description": "File paths",
  3290. "content": {
  3291. "application/json": {
  3292. "schema": {
  3293. "type": "array",
  3294. "items": {
  3295. "type": "string"
  3296. }
  3297. }
  3298. }
  3299. }
  3300. }
  3301. },
  3302. "x-codeSamples": [
  3303. {
  3304. "lang": "js",
  3305. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.find.files({\n ...\n})"
  3306. }
  3307. ]
  3308. }
  3309. },
  3310. "/find/symbol": {
  3311. "get": {
  3312. "operationId": "find.symbols",
  3313. "parameters": [
  3314. {
  3315. "in": "query",
  3316. "name": "directory",
  3317. "schema": {
  3318. "type": "string"
  3319. }
  3320. },
  3321. {
  3322. "in": "query",
  3323. "name": "query",
  3324. "schema": {
  3325. "type": "string"
  3326. },
  3327. "required": true
  3328. }
  3329. ],
  3330. "summary": "Find symbols",
  3331. "description": "Search for workspace symbols like functions, classes, and variables using LSP.",
  3332. "responses": {
  3333. "200": {
  3334. "description": "Symbols",
  3335. "content": {
  3336. "application/json": {
  3337. "schema": {
  3338. "type": "array",
  3339. "items": {
  3340. "$ref": "#/components/schemas/Symbol"
  3341. }
  3342. }
  3343. }
  3344. }
  3345. }
  3346. },
  3347. "x-codeSamples": [
  3348. {
  3349. "lang": "js",
  3350. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.find.symbols({\n ...\n})"
  3351. }
  3352. ]
  3353. }
  3354. },
  3355. "/file": {
  3356. "get": {
  3357. "operationId": "file.list",
  3358. "parameters": [
  3359. {
  3360. "in": "query",
  3361. "name": "directory",
  3362. "schema": {
  3363. "type": "string"
  3364. }
  3365. },
  3366. {
  3367. "in": "query",
  3368. "name": "path",
  3369. "schema": {
  3370. "type": "string"
  3371. },
  3372. "required": true
  3373. }
  3374. ],
  3375. "summary": "List files",
  3376. "description": "List files and directories in a specified path.",
  3377. "responses": {
  3378. "200": {
  3379. "description": "Files and directories",
  3380. "content": {
  3381. "application/json": {
  3382. "schema": {
  3383. "type": "array",
  3384. "items": {
  3385. "$ref": "#/components/schemas/FileNode"
  3386. }
  3387. }
  3388. }
  3389. }
  3390. }
  3391. },
  3392. "x-codeSamples": [
  3393. {
  3394. "lang": "js",
  3395. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.file.list({\n ...\n})"
  3396. }
  3397. ]
  3398. }
  3399. },
  3400. "/file/content": {
  3401. "get": {
  3402. "operationId": "file.read",
  3403. "parameters": [
  3404. {
  3405. "in": "query",
  3406. "name": "directory",
  3407. "schema": {
  3408. "type": "string"
  3409. }
  3410. },
  3411. {
  3412. "in": "query",
  3413. "name": "path",
  3414. "schema": {
  3415. "type": "string"
  3416. },
  3417. "required": true
  3418. }
  3419. ],
  3420. "summary": "Read file",
  3421. "description": "Read the content of a specified file.",
  3422. "responses": {
  3423. "200": {
  3424. "description": "File content",
  3425. "content": {
  3426. "application/json": {
  3427. "schema": {
  3428. "$ref": "#/components/schemas/FileContent"
  3429. }
  3430. }
  3431. }
  3432. }
  3433. },
  3434. "x-codeSamples": [
  3435. {
  3436. "lang": "js",
  3437. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.file.read({\n ...\n})"
  3438. }
  3439. ]
  3440. }
  3441. },
  3442. "/file/status": {
  3443. "get": {
  3444. "operationId": "file.status",
  3445. "parameters": [
  3446. {
  3447. "in": "query",
  3448. "name": "directory",
  3449. "schema": {
  3450. "type": "string"
  3451. }
  3452. }
  3453. ],
  3454. "summary": "Get file status",
  3455. "description": "Get the git status of all files in the project.",
  3456. "responses": {
  3457. "200": {
  3458. "description": "File status",
  3459. "content": {
  3460. "application/json": {
  3461. "schema": {
  3462. "type": "array",
  3463. "items": {
  3464. "$ref": "#/components/schemas/File"
  3465. }
  3466. }
  3467. }
  3468. }
  3469. }
  3470. },
  3471. "x-codeSamples": [
  3472. {
  3473. "lang": "js",
  3474. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.file.status({\n ...\n})"
  3475. }
  3476. ]
  3477. }
  3478. },
  3479. "/log": {
  3480. "post": {
  3481. "operationId": "app.log",
  3482. "parameters": [
  3483. {
  3484. "in": "query",
  3485. "name": "directory",
  3486. "schema": {
  3487. "type": "string"
  3488. }
  3489. }
  3490. ],
  3491. "summary": "Write log",
  3492. "description": "Write a log entry to the server logs with specified level and metadata.",
  3493. "responses": {
  3494. "200": {
  3495. "description": "Log entry written successfully",
  3496. "content": {
  3497. "application/json": {
  3498. "schema": {
  3499. "type": "boolean"
  3500. }
  3501. }
  3502. }
  3503. },
  3504. "400": {
  3505. "description": "Bad request",
  3506. "content": {
  3507. "application/json": {
  3508. "schema": {
  3509. "$ref": "#/components/schemas/BadRequestError"
  3510. }
  3511. }
  3512. }
  3513. }
  3514. },
  3515. "requestBody": {
  3516. "content": {
  3517. "application/json": {
  3518. "schema": {
  3519. "type": "object",
  3520. "properties": {
  3521. "service": {
  3522. "description": "Service name for the log entry",
  3523. "type": "string"
  3524. },
  3525. "level": {
  3526. "description": "Log level",
  3527. "type": "string",
  3528. "enum": ["debug", "info", "error", "warn"]
  3529. },
  3530. "message": {
  3531. "description": "Log message",
  3532. "type": "string"
  3533. },
  3534. "extra": {
  3535. "description": "Additional metadata for the log entry",
  3536. "type": "object",
  3537. "propertyNames": {
  3538. "type": "string"
  3539. },
  3540. "additionalProperties": {}
  3541. }
  3542. },
  3543. "required": ["service", "level", "message"]
  3544. }
  3545. }
  3546. }
  3547. },
  3548. "x-codeSamples": [
  3549. {
  3550. "lang": "js",
  3551. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.app.log({\n ...\n})"
  3552. }
  3553. ]
  3554. }
  3555. },
  3556. "/agent": {
  3557. "get": {
  3558. "operationId": "app.agents",
  3559. "parameters": [
  3560. {
  3561. "in": "query",
  3562. "name": "directory",
  3563. "schema": {
  3564. "type": "string"
  3565. }
  3566. }
  3567. ],
  3568. "summary": "List agents",
  3569. "description": "Get a list of all available AI agents in the OpenCode system.",
  3570. "responses": {
  3571. "200": {
  3572. "description": "List of agents",
  3573. "content": {
  3574. "application/json": {
  3575. "schema": {
  3576. "type": "array",
  3577. "items": {
  3578. "$ref": "#/components/schemas/Agent"
  3579. }
  3580. }
  3581. }
  3582. }
  3583. }
  3584. },
  3585. "x-codeSamples": [
  3586. {
  3587. "lang": "js",
  3588. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.app.agents({\n ...\n})"
  3589. }
  3590. ]
  3591. }
  3592. },
  3593. "/mcp": {
  3594. "get": {
  3595. "operationId": "mcp.status",
  3596. "parameters": [
  3597. {
  3598. "in": "query",
  3599. "name": "directory",
  3600. "schema": {
  3601. "type": "string"
  3602. }
  3603. }
  3604. ],
  3605. "summary": "Get MCP status",
  3606. "description": "Get the status of all Model Context Protocol (MCP) servers.",
  3607. "responses": {
  3608. "200": {
  3609. "description": "MCP server status",
  3610. "content": {
  3611. "application/json": {
  3612. "schema": {
  3613. "type": "object",
  3614. "propertyNames": {
  3615. "type": "string"
  3616. },
  3617. "additionalProperties": {
  3618. "$ref": "#/components/schemas/MCPStatus"
  3619. }
  3620. }
  3621. }
  3622. }
  3623. }
  3624. },
  3625. "x-codeSamples": [
  3626. {
  3627. "lang": "js",
  3628. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.status({\n ...\n})"
  3629. }
  3630. ]
  3631. },
  3632. "post": {
  3633. "operationId": "mcp.add",
  3634. "parameters": [
  3635. {
  3636. "in": "query",
  3637. "name": "directory",
  3638. "schema": {
  3639. "type": "string"
  3640. }
  3641. }
  3642. ],
  3643. "summary": "Add MCP server",
  3644. "description": "Dynamically add a new Model Context Protocol (MCP) server to the system.",
  3645. "responses": {
  3646. "200": {
  3647. "description": "MCP server added successfully",
  3648. "content": {
  3649. "application/json": {
  3650. "schema": {
  3651. "type": "object",
  3652. "propertyNames": {
  3653. "type": "string"
  3654. },
  3655. "additionalProperties": {
  3656. "$ref": "#/components/schemas/MCPStatus"
  3657. }
  3658. }
  3659. }
  3660. }
  3661. },
  3662. "400": {
  3663. "description": "Bad request",
  3664. "content": {
  3665. "application/json": {
  3666. "schema": {
  3667. "$ref": "#/components/schemas/BadRequestError"
  3668. }
  3669. }
  3670. }
  3671. }
  3672. },
  3673. "requestBody": {
  3674. "content": {
  3675. "application/json": {
  3676. "schema": {
  3677. "type": "object",
  3678. "properties": {
  3679. "name": {
  3680. "type": "string"
  3681. },
  3682. "config": {
  3683. "anyOf": [
  3684. {
  3685. "$ref": "#/components/schemas/McpLocalConfig"
  3686. },
  3687. {
  3688. "$ref": "#/components/schemas/McpRemoteConfig"
  3689. }
  3690. ]
  3691. }
  3692. },
  3693. "required": ["name", "config"]
  3694. }
  3695. }
  3696. }
  3697. },
  3698. "x-codeSamples": [
  3699. {
  3700. "lang": "js",
  3701. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.add({\n ...\n})"
  3702. }
  3703. ]
  3704. }
  3705. },
  3706. "/mcp/{name}/auth": {
  3707. "post": {
  3708. "operationId": "mcp.auth.start",
  3709. "parameters": [
  3710. {
  3711. "in": "query",
  3712. "name": "directory",
  3713. "schema": {
  3714. "type": "string"
  3715. }
  3716. },
  3717. {
  3718. "schema": {
  3719. "type": "string"
  3720. },
  3721. "in": "path",
  3722. "name": "name",
  3723. "required": true
  3724. }
  3725. ],
  3726. "summary": "Start MCP OAuth",
  3727. "description": "Start OAuth authentication flow for a Model Context Protocol (MCP) server.",
  3728. "responses": {
  3729. "200": {
  3730. "description": "OAuth flow started",
  3731. "content": {
  3732. "application/json": {
  3733. "schema": {
  3734. "type": "object",
  3735. "properties": {
  3736. "authorizationUrl": {
  3737. "description": "URL to open in browser for authorization",
  3738. "type": "string"
  3739. }
  3740. },
  3741. "required": ["authorizationUrl"]
  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. "x-codeSamples": [
  3768. {
  3769. "lang": "js",
  3770. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.start({\n ...\n})"
  3771. }
  3772. ]
  3773. },
  3774. "delete": {
  3775. "operationId": "mcp.auth.remove",
  3776. "parameters": [
  3777. {
  3778. "in": "query",
  3779. "name": "directory",
  3780. "schema": {
  3781. "type": "string"
  3782. }
  3783. },
  3784. {
  3785. "schema": {
  3786. "type": "string"
  3787. },
  3788. "in": "path",
  3789. "name": "name",
  3790. "required": true
  3791. }
  3792. ],
  3793. "summary": "Remove MCP OAuth",
  3794. "description": "Remove OAuth credentials for an MCP server",
  3795. "responses": {
  3796. "200": {
  3797. "description": "OAuth credentials removed",
  3798. "content": {
  3799. "application/json": {
  3800. "schema": {
  3801. "type": "object",
  3802. "properties": {
  3803. "success": {
  3804. "type": "boolean",
  3805. "const": true
  3806. }
  3807. },
  3808. "required": ["success"]
  3809. }
  3810. }
  3811. }
  3812. },
  3813. "404": {
  3814. "description": "Not found",
  3815. "content": {
  3816. "application/json": {
  3817. "schema": {
  3818. "$ref": "#/components/schemas/NotFoundError"
  3819. }
  3820. }
  3821. }
  3822. }
  3823. },
  3824. "x-codeSamples": [
  3825. {
  3826. "lang": "js",
  3827. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.remove({\n ...\n})"
  3828. }
  3829. ]
  3830. }
  3831. },
  3832. "/mcp/{name}/auth/callback": {
  3833. "post": {
  3834. "operationId": "mcp.auth.callback",
  3835. "parameters": [
  3836. {
  3837. "in": "query",
  3838. "name": "directory",
  3839. "schema": {
  3840. "type": "string"
  3841. }
  3842. },
  3843. {
  3844. "schema": {
  3845. "type": "string"
  3846. },
  3847. "in": "path",
  3848. "name": "name",
  3849. "required": true
  3850. }
  3851. ],
  3852. "summary": "Complete MCP OAuth",
  3853. "description": "Complete OAuth authentication for a Model Context Protocol (MCP) server using the authorization code.",
  3854. "responses": {
  3855. "200": {
  3856. "description": "OAuth authentication completed",
  3857. "content": {
  3858. "application/json": {
  3859. "schema": {
  3860. "$ref": "#/components/schemas/MCPStatus"
  3861. }
  3862. }
  3863. }
  3864. },
  3865. "400": {
  3866. "description": "Bad request",
  3867. "content": {
  3868. "application/json": {
  3869. "schema": {
  3870. "$ref": "#/components/schemas/BadRequestError"
  3871. }
  3872. }
  3873. }
  3874. },
  3875. "404": {
  3876. "description": "Not found",
  3877. "content": {
  3878. "application/json": {
  3879. "schema": {
  3880. "$ref": "#/components/schemas/NotFoundError"
  3881. }
  3882. }
  3883. }
  3884. }
  3885. },
  3886. "requestBody": {
  3887. "content": {
  3888. "application/json": {
  3889. "schema": {
  3890. "type": "object",
  3891. "properties": {
  3892. "code": {
  3893. "description": "Authorization code from OAuth callback",
  3894. "type": "string"
  3895. }
  3896. },
  3897. "required": ["code"]
  3898. }
  3899. }
  3900. }
  3901. },
  3902. "x-codeSamples": [
  3903. {
  3904. "lang": "js",
  3905. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.callback({\n ...\n})"
  3906. }
  3907. ]
  3908. }
  3909. },
  3910. "/mcp/{name}/auth/authenticate": {
  3911. "post": {
  3912. "operationId": "mcp.auth.authenticate",
  3913. "parameters": [
  3914. {
  3915. "in": "query",
  3916. "name": "directory",
  3917. "schema": {
  3918. "type": "string"
  3919. }
  3920. },
  3921. {
  3922. "schema": {
  3923. "type": "string"
  3924. },
  3925. "in": "path",
  3926. "name": "name",
  3927. "required": true
  3928. }
  3929. ],
  3930. "summary": "Authenticate MCP OAuth",
  3931. "description": "Start OAuth flow and wait for callback (opens browser)",
  3932. "responses": {
  3933. "200": {
  3934. "description": "OAuth authentication completed",
  3935. "content": {
  3936. "application/json": {
  3937. "schema": {
  3938. "$ref": "#/components/schemas/MCPStatus"
  3939. }
  3940. }
  3941. }
  3942. },
  3943. "400": {
  3944. "description": "Bad request",
  3945. "content": {
  3946. "application/json": {
  3947. "schema": {
  3948. "$ref": "#/components/schemas/BadRequestError"
  3949. }
  3950. }
  3951. }
  3952. },
  3953. "404": {
  3954. "description": "Not found",
  3955. "content": {
  3956. "application/json": {
  3957. "schema": {
  3958. "$ref": "#/components/schemas/NotFoundError"
  3959. }
  3960. }
  3961. }
  3962. }
  3963. },
  3964. "x-codeSamples": [
  3965. {
  3966. "lang": "js",
  3967. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.authenticate({\n ...\n})"
  3968. }
  3969. ]
  3970. }
  3971. },
  3972. "/mcp/{name}/connect": {
  3973. "post": {
  3974. "operationId": "mcp.connect",
  3975. "parameters": [
  3976. {
  3977. "in": "query",
  3978. "name": "directory",
  3979. "schema": {
  3980. "type": "string"
  3981. }
  3982. },
  3983. {
  3984. "in": "path",
  3985. "name": "name",
  3986. "schema": {
  3987. "type": "string"
  3988. },
  3989. "required": true
  3990. }
  3991. ],
  3992. "description": "Connect an MCP server",
  3993. "responses": {
  3994. "200": {
  3995. "description": "MCP server connected successfully",
  3996. "content": {
  3997. "application/json": {
  3998. "schema": {
  3999. "type": "boolean"
  4000. }
  4001. }
  4002. }
  4003. }
  4004. },
  4005. "x-codeSamples": [
  4006. {
  4007. "lang": "js",
  4008. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.connect({\n ...\n})"
  4009. }
  4010. ]
  4011. }
  4012. },
  4013. "/mcp/{name}/disconnect": {
  4014. "post": {
  4015. "operationId": "mcp.disconnect",
  4016. "parameters": [
  4017. {
  4018. "in": "query",
  4019. "name": "directory",
  4020. "schema": {
  4021. "type": "string"
  4022. }
  4023. },
  4024. {
  4025. "in": "path",
  4026. "name": "name",
  4027. "schema": {
  4028. "type": "string"
  4029. },
  4030. "required": true
  4031. }
  4032. ],
  4033. "description": "Disconnect an MCP server",
  4034. "responses": {
  4035. "200": {
  4036. "description": "MCP server disconnected successfully",
  4037. "content": {
  4038. "application/json": {
  4039. "schema": {
  4040. "type": "boolean"
  4041. }
  4042. }
  4043. }
  4044. }
  4045. },
  4046. "x-codeSamples": [
  4047. {
  4048. "lang": "js",
  4049. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.disconnect({\n ...\n})"
  4050. }
  4051. ]
  4052. }
  4053. },
  4054. "/lsp": {
  4055. "get": {
  4056. "operationId": "lsp.status",
  4057. "parameters": [
  4058. {
  4059. "in": "query",
  4060. "name": "directory",
  4061. "schema": {
  4062. "type": "string"
  4063. }
  4064. }
  4065. ],
  4066. "summary": "Get LSP status",
  4067. "description": "Get LSP server status",
  4068. "responses": {
  4069. "200": {
  4070. "description": "LSP server status",
  4071. "content": {
  4072. "application/json": {
  4073. "schema": {
  4074. "type": "array",
  4075. "items": {
  4076. "$ref": "#/components/schemas/LSPStatus"
  4077. }
  4078. }
  4079. }
  4080. }
  4081. }
  4082. },
  4083. "x-codeSamples": [
  4084. {
  4085. "lang": "js",
  4086. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.lsp.status({\n ...\n})"
  4087. }
  4088. ]
  4089. }
  4090. },
  4091. "/formatter": {
  4092. "get": {
  4093. "operationId": "formatter.status",
  4094. "parameters": [
  4095. {
  4096. "in": "query",
  4097. "name": "directory",
  4098. "schema": {
  4099. "type": "string"
  4100. }
  4101. }
  4102. ],
  4103. "summary": "Get formatter status",
  4104. "description": "Get formatter status",
  4105. "responses": {
  4106. "200": {
  4107. "description": "Formatter status",
  4108. "content": {
  4109. "application/json": {
  4110. "schema": {
  4111. "type": "array",
  4112. "items": {
  4113. "$ref": "#/components/schemas/FormatterStatus"
  4114. }
  4115. }
  4116. }
  4117. }
  4118. }
  4119. },
  4120. "x-codeSamples": [
  4121. {
  4122. "lang": "js",
  4123. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.formatter.status({\n ...\n})"
  4124. }
  4125. ]
  4126. }
  4127. },
  4128. "/tui/append-prompt": {
  4129. "post": {
  4130. "operationId": "tui.appendPrompt",
  4131. "parameters": [
  4132. {
  4133. "in": "query",
  4134. "name": "directory",
  4135. "schema": {
  4136. "type": "string"
  4137. }
  4138. }
  4139. ],
  4140. "summary": "Append TUI prompt",
  4141. "description": "Append prompt to the TUI",
  4142. "responses": {
  4143. "200": {
  4144. "description": "Prompt processed successfully",
  4145. "content": {
  4146. "application/json": {
  4147. "schema": {
  4148. "type": "boolean"
  4149. }
  4150. }
  4151. }
  4152. },
  4153. "400": {
  4154. "description": "Bad request",
  4155. "content": {
  4156. "application/json": {
  4157. "schema": {
  4158. "$ref": "#/components/schemas/BadRequestError"
  4159. }
  4160. }
  4161. }
  4162. }
  4163. },
  4164. "requestBody": {
  4165. "content": {
  4166. "application/json": {
  4167. "schema": {
  4168. "type": "object",
  4169. "properties": {
  4170. "text": {
  4171. "type": "string"
  4172. }
  4173. },
  4174. "required": ["text"]
  4175. }
  4176. }
  4177. }
  4178. },
  4179. "x-codeSamples": [
  4180. {
  4181. "lang": "js",
  4182. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.appendPrompt({\n ...\n})"
  4183. }
  4184. ]
  4185. }
  4186. },
  4187. "/tui/open-help": {
  4188. "post": {
  4189. "operationId": "tui.openHelp",
  4190. "parameters": [
  4191. {
  4192. "in": "query",
  4193. "name": "directory",
  4194. "schema": {
  4195. "type": "string"
  4196. }
  4197. }
  4198. ],
  4199. "summary": "Open help dialog",
  4200. "description": "Open the help dialog in the TUI to display user assistance information.",
  4201. "responses": {
  4202. "200": {
  4203. "description": "Help dialog opened successfully",
  4204. "content": {
  4205. "application/json": {
  4206. "schema": {
  4207. "type": "boolean"
  4208. }
  4209. }
  4210. }
  4211. }
  4212. },
  4213. "x-codeSamples": [
  4214. {
  4215. "lang": "js",
  4216. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openHelp({\n ...\n})"
  4217. }
  4218. ]
  4219. }
  4220. },
  4221. "/tui/open-sessions": {
  4222. "post": {
  4223. "operationId": "tui.openSessions",
  4224. "parameters": [
  4225. {
  4226. "in": "query",
  4227. "name": "directory",
  4228. "schema": {
  4229. "type": "string"
  4230. }
  4231. }
  4232. ],
  4233. "summary": "Open sessions dialog",
  4234. "description": "Open the session dialog",
  4235. "responses": {
  4236. "200": {
  4237. "description": "Session dialog opened successfully",
  4238. "content": {
  4239. "application/json": {
  4240. "schema": {
  4241. "type": "boolean"
  4242. }
  4243. }
  4244. }
  4245. }
  4246. },
  4247. "x-codeSamples": [
  4248. {
  4249. "lang": "js",
  4250. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openSessions({\n ...\n})"
  4251. }
  4252. ]
  4253. }
  4254. },
  4255. "/tui/open-themes": {
  4256. "post": {
  4257. "operationId": "tui.openThemes",
  4258. "parameters": [
  4259. {
  4260. "in": "query",
  4261. "name": "directory",
  4262. "schema": {
  4263. "type": "string"
  4264. }
  4265. }
  4266. ],
  4267. "summary": "Open themes dialog",
  4268. "description": "Open the theme dialog",
  4269. "responses": {
  4270. "200": {
  4271. "description": "Theme dialog opened successfully",
  4272. "content": {
  4273. "application/json": {
  4274. "schema": {
  4275. "type": "boolean"
  4276. }
  4277. }
  4278. }
  4279. }
  4280. },
  4281. "x-codeSamples": [
  4282. {
  4283. "lang": "js",
  4284. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openThemes({\n ...\n})"
  4285. }
  4286. ]
  4287. }
  4288. },
  4289. "/tui/open-models": {
  4290. "post": {
  4291. "operationId": "tui.openModels",
  4292. "parameters": [
  4293. {
  4294. "in": "query",
  4295. "name": "directory",
  4296. "schema": {
  4297. "type": "string"
  4298. }
  4299. }
  4300. ],
  4301. "summary": "Open models dialog",
  4302. "description": "Open the model dialog",
  4303. "responses": {
  4304. "200": {
  4305. "description": "Model dialog opened successfully",
  4306. "content": {
  4307. "application/json": {
  4308. "schema": {
  4309. "type": "boolean"
  4310. }
  4311. }
  4312. }
  4313. }
  4314. },
  4315. "x-codeSamples": [
  4316. {
  4317. "lang": "js",
  4318. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openModels({\n ...\n})"
  4319. }
  4320. ]
  4321. }
  4322. },
  4323. "/tui/submit-prompt": {
  4324. "post": {
  4325. "operationId": "tui.submitPrompt",
  4326. "parameters": [
  4327. {
  4328. "in": "query",
  4329. "name": "directory",
  4330. "schema": {
  4331. "type": "string"
  4332. }
  4333. }
  4334. ],
  4335. "summary": "Submit TUI prompt",
  4336. "description": "Submit the prompt",
  4337. "responses": {
  4338. "200": {
  4339. "description": "Prompt submitted successfully",
  4340. "content": {
  4341. "application/json": {
  4342. "schema": {
  4343. "type": "boolean"
  4344. }
  4345. }
  4346. }
  4347. }
  4348. },
  4349. "x-codeSamples": [
  4350. {
  4351. "lang": "js",
  4352. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.submitPrompt({\n ...\n})"
  4353. }
  4354. ]
  4355. }
  4356. },
  4357. "/tui/clear-prompt": {
  4358. "post": {
  4359. "operationId": "tui.clearPrompt",
  4360. "parameters": [
  4361. {
  4362. "in": "query",
  4363. "name": "directory",
  4364. "schema": {
  4365. "type": "string"
  4366. }
  4367. }
  4368. ],
  4369. "summary": "Clear TUI prompt",
  4370. "description": "Clear the prompt",
  4371. "responses": {
  4372. "200": {
  4373. "description": "Prompt cleared successfully",
  4374. "content": {
  4375. "application/json": {
  4376. "schema": {
  4377. "type": "boolean"
  4378. }
  4379. }
  4380. }
  4381. }
  4382. },
  4383. "x-codeSamples": [
  4384. {
  4385. "lang": "js",
  4386. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.clearPrompt({\n ...\n})"
  4387. }
  4388. ]
  4389. }
  4390. },
  4391. "/tui/execute-command": {
  4392. "post": {
  4393. "operationId": "tui.executeCommand",
  4394. "parameters": [
  4395. {
  4396. "in": "query",
  4397. "name": "directory",
  4398. "schema": {
  4399. "type": "string"
  4400. }
  4401. }
  4402. ],
  4403. "summary": "Execute TUI command",
  4404. "description": "Execute a TUI command (e.g. agent_cycle)",
  4405. "responses": {
  4406. "200": {
  4407. "description": "Command executed successfully",
  4408. "content": {
  4409. "application/json": {
  4410. "schema": {
  4411. "type": "boolean"
  4412. }
  4413. }
  4414. }
  4415. },
  4416. "400": {
  4417. "description": "Bad request",
  4418. "content": {
  4419. "application/json": {
  4420. "schema": {
  4421. "$ref": "#/components/schemas/BadRequestError"
  4422. }
  4423. }
  4424. }
  4425. }
  4426. },
  4427. "requestBody": {
  4428. "content": {
  4429. "application/json": {
  4430. "schema": {
  4431. "type": "object",
  4432. "properties": {
  4433. "command": {
  4434. "type": "string"
  4435. }
  4436. },
  4437. "required": ["command"]
  4438. }
  4439. }
  4440. }
  4441. },
  4442. "x-codeSamples": [
  4443. {
  4444. "lang": "js",
  4445. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.executeCommand({\n ...\n})"
  4446. }
  4447. ]
  4448. }
  4449. },
  4450. "/tui/show-toast": {
  4451. "post": {
  4452. "operationId": "tui.showToast",
  4453. "parameters": [
  4454. {
  4455. "in": "query",
  4456. "name": "directory",
  4457. "schema": {
  4458. "type": "string"
  4459. }
  4460. }
  4461. ],
  4462. "summary": "Show TUI toast",
  4463. "description": "Show a toast notification in the TUI",
  4464. "responses": {
  4465. "200": {
  4466. "description": "Toast notification shown successfully",
  4467. "content": {
  4468. "application/json": {
  4469. "schema": {
  4470. "type": "boolean"
  4471. }
  4472. }
  4473. }
  4474. }
  4475. },
  4476. "requestBody": {
  4477. "content": {
  4478. "application/json": {
  4479. "schema": {
  4480. "type": "object",
  4481. "properties": {
  4482. "title": {
  4483. "type": "string"
  4484. },
  4485. "message": {
  4486. "type": "string"
  4487. },
  4488. "variant": {
  4489. "type": "string",
  4490. "enum": ["info", "success", "warning", "error"]
  4491. },
  4492. "duration": {
  4493. "description": "Duration in milliseconds",
  4494. "default": 5000,
  4495. "type": "number"
  4496. }
  4497. },
  4498. "required": ["message", "variant"]
  4499. }
  4500. }
  4501. }
  4502. },
  4503. "x-codeSamples": [
  4504. {
  4505. "lang": "js",
  4506. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.showToast({\n ...\n})"
  4507. }
  4508. ]
  4509. }
  4510. },
  4511. "/tui/publish": {
  4512. "post": {
  4513. "operationId": "tui.publish",
  4514. "parameters": [
  4515. {
  4516. "in": "query",
  4517. "name": "directory",
  4518. "schema": {
  4519. "type": "string"
  4520. }
  4521. }
  4522. ],
  4523. "summary": "Publish TUI event",
  4524. "description": "Publish a TUI event",
  4525. "responses": {
  4526. "200": {
  4527. "description": "Event published successfully",
  4528. "content": {
  4529. "application/json": {
  4530. "schema": {
  4531. "type": "boolean"
  4532. }
  4533. }
  4534. }
  4535. },
  4536. "400": {
  4537. "description": "Bad request",
  4538. "content": {
  4539. "application/json": {
  4540. "schema": {
  4541. "$ref": "#/components/schemas/BadRequestError"
  4542. }
  4543. }
  4544. }
  4545. }
  4546. },
  4547. "requestBody": {
  4548. "content": {
  4549. "application/json": {
  4550. "schema": {
  4551. "anyOf": [
  4552. {
  4553. "$ref": "#/components/schemas/Event.tui.prompt.append"
  4554. },
  4555. {
  4556. "$ref": "#/components/schemas/Event.tui.command.execute"
  4557. },
  4558. {
  4559. "$ref": "#/components/schemas/Event.tui.toast.show"
  4560. }
  4561. ]
  4562. }
  4563. }
  4564. }
  4565. },
  4566. "x-codeSamples": [
  4567. {
  4568. "lang": "js",
  4569. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.publish({\n ...\n})"
  4570. }
  4571. ]
  4572. }
  4573. },
  4574. "/tui/control/next": {
  4575. "get": {
  4576. "operationId": "tui.control.next",
  4577. "parameters": [
  4578. {
  4579. "in": "query",
  4580. "name": "directory",
  4581. "schema": {
  4582. "type": "string"
  4583. }
  4584. }
  4585. ],
  4586. "summary": "Get next TUI request",
  4587. "description": "Retrieve the next TUI (Terminal User Interface) request from the queue for processing.",
  4588. "responses": {
  4589. "200": {
  4590. "description": "Next TUI request",
  4591. "content": {
  4592. "application/json": {
  4593. "schema": {
  4594. "type": "object",
  4595. "properties": {
  4596. "path": {
  4597. "type": "string"
  4598. },
  4599. "body": {}
  4600. },
  4601. "required": ["path", "body"]
  4602. }
  4603. }
  4604. }
  4605. }
  4606. },
  4607. "x-codeSamples": [
  4608. {
  4609. "lang": "js",
  4610. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.control.next({\n ...\n})"
  4611. }
  4612. ]
  4613. }
  4614. },
  4615. "/tui/control/response": {
  4616. "post": {
  4617. "operationId": "tui.control.response",
  4618. "parameters": [
  4619. {
  4620. "in": "query",
  4621. "name": "directory",
  4622. "schema": {
  4623. "type": "string"
  4624. }
  4625. }
  4626. ],
  4627. "summary": "Submit TUI response",
  4628. "description": "Submit a response to the TUI request queue to complete a pending request.",
  4629. "responses": {
  4630. "200": {
  4631. "description": "Response submitted successfully",
  4632. "content": {
  4633. "application/json": {
  4634. "schema": {
  4635. "type": "boolean"
  4636. }
  4637. }
  4638. }
  4639. }
  4640. },
  4641. "requestBody": {
  4642. "content": {
  4643. "application/json": {
  4644. "schema": {}
  4645. }
  4646. }
  4647. },
  4648. "x-codeSamples": [
  4649. {
  4650. "lang": "js",
  4651. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.control.response({\n ...\n})"
  4652. }
  4653. ]
  4654. }
  4655. },
  4656. "/auth/{providerID}": {
  4657. "put": {
  4658. "operationId": "auth.set",
  4659. "parameters": [
  4660. {
  4661. "in": "query",
  4662. "name": "directory",
  4663. "schema": {
  4664. "type": "string"
  4665. }
  4666. },
  4667. {
  4668. "in": "path",
  4669. "name": "providerID",
  4670. "schema": {
  4671. "type": "string"
  4672. },
  4673. "required": true
  4674. }
  4675. ],
  4676. "summary": "Set auth credentials",
  4677. "description": "Set authentication credentials",
  4678. "responses": {
  4679. "200": {
  4680. "description": "Successfully set authentication credentials",
  4681. "content": {
  4682. "application/json": {
  4683. "schema": {
  4684. "type": "boolean"
  4685. }
  4686. }
  4687. }
  4688. },
  4689. "400": {
  4690. "description": "Bad request",
  4691. "content": {
  4692. "application/json": {
  4693. "schema": {
  4694. "$ref": "#/components/schemas/BadRequestError"
  4695. }
  4696. }
  4697. }
  4698. }
  4699. },
  4700. "requestBody": {
  4701. "content": {
  4702. "application/json": {
  4703. "schema": {
  4704. "$ref": "#/components/schemas/Auth"
  4705. }
  4706. }
  4707. }
  4708. },
  4709. "x-codeSamples": [
  4710. {
  4711. "lang": "js",
  4712. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.auth.set({\n ...\n})"
  4713. }
  4714. ]
  4715. }
  4716. },
  4717. "/event": {
  4718. "get": {
  4719. "operationId": "event.subscribe",
  4720. "parameters": [
  4721. {
  4722. "in": "query",
  4723. "name": "directory",
  4724. "schema": {
  4725. "type": "string"
  4726. }
  4727. }
  4728. ],
  4729. "summary": "Subscribe to events",
  4730. "description": "Get events",
  4731. "responses": {
  4732. "200": {
  4733. "description": "Event stream",
  4734. "content": {
  4735. "text/event-stream": {
  4736. "schema": {
  4737. "$ref": "#/components/schemas/Event"
  4738. }
  4739. }
  4740. }
  4741. }
  4742. },
  4743. "x-codeSamples": [
  4744. {
  4745. "lang": "js",
  4746. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.event.subscribe({\n ...\n})"
  4747. }
  4748. ]
  4749. }
  4750. }
  4751. },
  4752. "components": {
  4753. "schemas": {
  4754. "Event.installation.updated": {
  4755. "type": "object",
  4756. "properties": {
  4757. "type": {
  4758. "type": "string",
  4759. "const": "installation.updated"
  4760. },
  4761. "properties": {
  4762. "type": "object",
  4763. "properties": {
  4764. "version": {
  4765. "type": "string"
  4766. }
  4767. },
  4768. "required": ["version"]
  4769. }
  4770. },
  4771. "required": ["type", "properties"]
  4772. },
  4773. "Event.installation.update-available": {
  4774. "type": "object",
  4775. "properties": {
  4776. "type": {
  4777. "type": "string",
  4778. "const": "installation.update-available"
  4779. },
  4780. "properties": {
  4781. "type": "object",
  4782. "properties": {
  4783. "version": {
  4784. "type": "string"
  4785. }
  4786. },
  4787. "required": ["version"]
  4788. }
  4789. },
  4790. "required": ["type", "properties"]
  4791. },
  4792. "Project": {
  4793. "type": "object",
  4794. "properties": {
  4795. "id": {
  4796. "type": "string"
  4797. },
  4798. "worktree": {
  4799. "type": "string"
  4800. },
  4801. "vcs": {
  4802. "type": "string",
  4803. "const": "git"
  4804. },
  4805. "name": {
  4806. "type": "string"
  4807. },
  4808. "icon": {
  4809. "type": "object",
  4810. "properties": {
  4811. "url": {
  4812. "type": "string"
  4813. },
  4814. "color": {
  4815. "type": "string"
  4816. }
  4817. }
  4818. },
  4819. "time": {
  4820. "type": "object",
  4821. "properties": {
  4822. "created": {
  4823. "type": "number"
  4824. },
  4825. "updated": {
  4826. "type": "number"
  4827. },
  4828. "initialized": {
  4829. "type": "number"
  4830. }
  4831. },
  4832. "required": ["created", "updated"]
  4833. }
  4834. },
  4835. "required": ["id", "worktree", "time"]
  4836. },
  4837. "Event.project.updated": {
  4838. "type": "object",
  4839. "properties": {
  4840. "type": {
  4841. "type": "string",
  4842. "const": "project.updated"
  4843. },
  4844. "properties": {
  4845. "$ref": "#/components/schemas/Project"
  4846. }
  4847. },
  4848. "required": ["type", "properties"]
  4849. },
  4850. "Event.server.instance.disposed": {
  4851. "type": "object",
  4852. "properties": {
  4853. "type": {
  4854. "type": "string",
  4855. "const": "server.instance.disposed"
  4856. },
  4857. "properties": {
  4858. "type": "object",
  4859. "properties": {
  4860. "directory": {
  4861. "type": "string"
  4862. }
  4863. },
  4864. "required": ["directory"]
  4865. }
  4866. },
  4867. "required": ["type", "properties"]
  4868. },
  4869. "Event.lsp.client.diagnostics": {
  4870. "type": "object",
  4871. "properties": {
  4872. "type": {
  4873. "type": "string",
  4874. "const": "lsp.client.diagnostics"
  4875. },
  4876. "properties": {
  4877. "type": "object",
  4878. "properties": {
  4879. "serverID": {
  4880. "type": "string"
  4881. },
  4882. "path": {
  4883. "type": "string"
  4884. }
  4885. },
  4886. "required": ["serverID", "path"]
  4887. }
  4888. },
  4889. "required": ["type", "properties"]
  4890. },
  4891. "Event.lsp.updated": {
  4892. "type": "object",
  4893. "properties": {
  4894. "type": {
  4895. "type": "string",
  4896. "const": "lsp.updated"
  4897. },
  4898. "properties": {
  4899. "type": "object",
  4900. "properties": {}
  4901. }
  4902. },
  4903. "required": ["type", "properties"]
  4904. },
  4905. "FileDiff": {
  4906. "type": "object",
  4907. "properties": {
  4908. "file": {
  4909. "type": "string"
  4910. },
  4911. "before": {
  4912. "type": "string"
  4913. },
  4914. "after": {
  4915. "type": "string"
  4916. },
  4917. "additions": {
  4918. "type": "number"
  4919. },
  4920. "deletions": {
  4921. "type": "number"
  4922. }
  4923. },
  4924. "required": ["file", "before", "after", "additions", "deletions"]
  4925. },
  4926. "UserMessage": {
  4927. "type": "object",
  4928. "properties": {
  4929. "id": {
  4930. "type": "string"
  4931. },
  4932. "sessionID": {
  4933. "type": "string"
  4934. },
  4935. "role": {
  4936. "type": "string",
  4937. "const": "user"
  4938. },
  4939. "time": {
  4940. "type": "object",
  4941. "properties": {
  4942. "created": {
  4943. "type": "number"
  4944. }
  4945. },
  4946. "required": ["created"]
  4947. },
  4948. "summary": {
  4949. "type": "object",
  4950. "properties": {
  4951. "title": {
  4952. "type": "string"
  4953. },
  4954. "body": {
  4955. "type": "string"
  4956. },
  4957. "diffs": {
  4958. "type": "array",
  4959. "items": {
  4960. "$ref": "#/components/schemas/FileDiff"
  4961. }
  4962. }
  4963. },
  4964. "required": ["diffs"]
  4965. },
  4966. "agent": {
  4967. "type": "string"
  4968. },
  4969. "model": {
  4970. "type": "object",
  4971. "properties": {
  4972. "providerID": {
  4973. "type": "string"
  4974. },
  4975. "modelID": {
  4976. "type": "string"
  4977. }
  4978. },
  4979. "required": ["providerID", "modelID"]
  4980. },
  4981. "system": {
  4982. "type": "string"
  4983. },
  4984. "tools": {
  4985. "type": "object",
  4986. "propertyNames": {
  4987. "type": "string"
  4988. },
  4989. "additionalProperties": {
  4990. "type": "boolean"
  4991. }
  4992. }
  4993. },
  4994. "required": ["id", "sessionID", "role", "time", "agent", "model"]
  4995. },
  4996. "ProviderAuthError": {
  4997. "type": "object",
  4998. "properties": {
  4999. "name": {
  5000. "type": "string",
  5001. "const": "ProviderAuthError"
  5002. },
  5003. "data": {
  5004. "type": "object",
  5005. "properties": {
  5006. "providerID": {
  5007. "type": "string"
  5008. },
  5009. "message": {
  5010. "type": "string"
  5011. }
  5012. },
  5013. "required": ["providerID", "message"]
  5014. }
  5015. },
  5016. "required": ["name", "data"]
  5017. },
  5018. "UnknownError": {
  5019. "type": "object",
  5020. "properties": {
  5021. "name": {
  5022. "type": "string",
  5023. "const": "UnknownError"
  5024. },
  5025. "data": {
  5026. "type": "object",
  5027. "properties": {
  5028. "message": {
  5029. "type": "string"
  5030. }
  5031. },
  5032. "required": ["message"]
  5033. }
  5034. },
  5035. "required": ["name", "data"]
  5036. },
  5037. "MessageOutputLengthError": {
  5038. "type": "object",
  5039. "properties": {
  5040. "name": {
  5041. "type": "string",
  5042. "const": "MessageOutputLengthError"
  5043. },
  5044. "data": {
  5045. "type": "object",
  5046. "properties": {}
  5047. }
  5048. },
  5049. "required": ["name", "data"]
  5050. },
  5051. "MessageAbortedError": {
  5052. "type": "object",
  5053. "properties": {
  5054. "name": {
  5055. "type": "string",
  5056. "const": "MessageAbortedError"
  5057. },
  5058. "data": {
  5059. "type": "object",
  5060. "properties": {
  5061. "message": {
  5062. "type": "string"
  5063. }
  5064. },
  5065. "required": ["message"]
  5066. }
  5067. },
  5068. "required": ["name", "data"]
  5069. },
  5070. "APIError": {
  5071. "type": "object",
  5072. "properties": {
  5073. "name": {
  5074. "type": "string",
  5075. "const": "APIError"
  5076. },
  5077. "data": {
  5078. "type": "object",
  5079. "properties": {
  5080. "message": {
  5081. "type": "string"
  5082. },
  5083. "statusCode": {
  5084. "type": "number"
  5085. },
  5086. "isRetryable": {
  5087. "type": "boolean"
  5088. },
  5089. "responseHeaders": {
  5090. "type": "object",
  5091. "propertyNames": {
  5092. "type": "string"
  5093. },
  5094. "additionalProperties": {
  5095. "type": "string"
  5096. }
  5097. },
  5098. "responseBody": {
  5099. "type": "string"
  5100. }
  5101. },
  5102. "required": ["message", "isRetryable"]
  5103. }
  5104. },
  5105. "required": ["name", "data"]
  5106. },
  5107. "AssistantMessage": {
  5108. "type": "object",
  5109. "properties": {
  5110. "id": {
  5111. "type": "string"
  5112. },
  5113. "sessionID": {
  5114. "type": "string"
  5115. },
  5116. "role": {
  5117. "type": "string",
  5118. "const": "assistant"
  5119. },
  5120. "time": {
  5121. "type": "object",
  5122. "properties": {
  5123. "created": {
  5124. "type": "number"
  5125. },
  5126. "completed": {
  5127. "type": "number"
  5128. }
  5129. },
  5130. "required": ["created"]
  5131. },
  5132. "error": {
  5133. "anyOf": [
  5134. {
  5135. "$ref": "#/components/schemas/ProviderAuthError"
  5136. },
  5137. {
  5138. "$ref": "#/components/schemas/UnknownError"
  5139. },
  5140. {
  5141. "$ref": "#/components/schemas/MessageOutputLengthError"
  5142. },
  5143. {
  5144. "$ref": "#/components/schemas/MessageAbortedError"
  5145. },
  5146. {
  5147. "$ref": "#/components/schemas/APIError"
  5148. }
  5149. ]
  5150. },
  5151. "parentID": {
  5152. "type": "string"
  5153. },
  5154. "modelID": {
  5155. "type": "string"
  5156. },
  5157. "providerID": {
  5158. "type": "string"
  5159. },
  5160. "mode": {
  5161. "type": "string"
  5162. },
  5163. "path": {
  5164. "type": "object",
  5165. "properties": {
  5166. "cwd": {
  5167. "type": "string"
  5168. },
  5169. "root": {
  5170. "type": "string"
  5171. }
  5172. },
  5173. "required": ["cwd", "root"]
  5174. },
  5175. "summary": {
  5176. "type": "boolean"
  5177. },
  5178. "cost": {
  5179. "type": "number"
  5180. },
  5181. "tokens": {
  5182. "type": "object",
  5183. "properties": {
  5184. "input": {
  5185. "type": "number"
  5186. },
  5187. "output": {
  5188. "type": "number"
  5189. },
  5190. "reasoning": {
  5191. "type": "number"
  5192. },
  5193. "cache": {
  5194. "type": "object",
  5195. "properties": {
  5196. "read": {
  5197. "type": "number"
  5198. },
  5199. "write": {
  5200. "type": "number"
  5201. }
  5202. },
  5203. "required": ["read", "write"]
  5204. }
  5205. },
  5206. "required": ["input", "output", "reasoning", "cache"]
  5207. },
  5208. "finish": {
  5209. "type": "string"
  5210. }
  5211. },
  5212. "required": [
  5213. "id",
  5214. "sessionID",
  5215. "role",
  5216. "time",
  5217. "parentID",
  5218. "modelID",
  5219. "providerID",
  5220. "mode",
  5221. "path",
  5222. "cost",
  5223. "tokens"
  5224. ]
  5225. },
  5226. "Message": {
  5227. "anyOf": [
  5228. {
  5229. "$ref": "#/components/schemas/UserMessage"
  5230. },
  5231. {
  5232. "$ref": "#/components/schemas/AssistantMessage"
  5233. }
  5234. ]
  5235. },
  5236. "Event.message.updated": {
  5237. "type": "object",
  5238. "properties": {
  5239. "type": {
  5240. "type": "string",
  5241. "const": "message.updated"
  5242. },
  5243. "properties": {
  5244. "type": "object",
  5245. "properties": {
  5246. "info": {
  5247. "$ref": "#/components/schemas/Message"
  5248. }
  5249. },
  5250. "required": ["info"]
  5251. }
  5252. },
  5253. "required": ["type", "properties"]
  5254. },
  5255. "Event.message.removed": {
  5256. "type": "object",
  5257. "properties": {
  5258. "type": {
  5259. "type": "string",
  5260. "const": "message.removed"
  5261. },
  5262. "properties": {
  5263. "type": "object",
  5264. "properties": {
  5265. "sessionID": {
  5266. "type": "string"
  5267. },
  5268. "messageID": {
  5269. "type": "string"
  5270. }
  5271. },
  5272. "required": ["sessionID", "messageID"]
  5273. }
  5274. },
  5275. "required": ["type", "properties"]
  5276. },
  5277. "TextPart": {
  5278. "type": "object",
  5279. "properties": {
  5280. "id": {
  5281. "type": "string"
  5282. },
  5283. "sessionID": {
  5284. "type": "string"
  5285. },
  5286. "messageID": {
  5287. "type": "string"
  5288. },
  5289. "type": {
  5290. "type": "string",
  5291. "const": "text"
  5292. },
  5293. "text": {
  5294. "type": "string"
  5295. },
  5296. "synthetic": {
  5297. "type": "boolean"
  5298. },
  5299. "ignored": {
  5300. "type": "boolean"
  5301. },
  5302. "time": {
  5303. "type": "object",
  5304. "properties": {
  5305. "start": {
  5306. "type": "number"
  5307. },
  5308. "end": {
  5309. "type": "number"
  5310. }
  5311. },
  5312. "required": ["start"]
  5313. },
  5314. "metadata": {
  5315. "type": "object",
  5316. "propertyNames": {
  5317. "type": "string"
  5318. },
  5319. "additionalProperties": {}
  5320. }
  5321. },
  5322. "required": ["id", "sessionID", "messageID", "type", "text"]
  5323. },
  5324. "ReasoningPart": {
  5325. "type": "object",
  5326. "properties": {
  5327. "id": {
  5328. "type": "string"
  5329. },
  5330. "sessionID": {
  5331. "type": "string"
  5332. },
  5333. "messageID": {
  5334. "type": "string"
  5335. },
  5336. "type": {
  5337. "type": "string",
  5338. "const": "reasoning"
  5339. },
  5340. "text": {
  5341. "type": "string"
  5342. },
  5343. "metadata": {
  5344. "type": "object",
  5345. "propertyNames": {
  5346. "type": "string"
  5347. },
  5348. "additionalProperties": {}
  5349. },
  5350. "time": {
  5351. "type": "object",
  5352. "properties": {
  5353. "start": {
  5354. "type": "number"
  5355. },
  5356. "end": {
  5357. "type": "number"
  5358. }
  5359. },
  5360. "required": ["start"]
  5361. }
  5362. },
  5363. "required": ["id", "sessionID", "messageID", "type", "text", "time"]
  5364. },
  5365. "FilePartSourceText": {
  5366. "type": "object",
  5367. "properties": {
  5368. "value": {
  5369. "type": "string"
  5370. },
  5371. "start": {
  5372. "type": "integer",
  5373. "minimum": -9007199254740991,
  5374. "maximum": 9007199254740991
  5375. },
  5376. "end": {
  5377. "type": "integer",
  5378. "minimum": -9007199254740991,
  5379. "maximum": 9007199254740991
  5380. }
  5381. },
  5382. "required": ["value", "start", "end"]
  5383. },
  5384. "FileSource": {
  5385. "type": "object",
  5386. "properties": {
  5387. "text": {
  5388. "$ref": "#/components/schemas/FilePartSourceText"
  5389. },
  5390. "type": {
  5391. "type": "string",
  5392. "const": "file"
  5393. },
  5394. "path": {
  5395. "type": "string"
  5396. }
  5397. },
  5398. "required": ["text", "type", "path"]
  5399. },
  5400. "Range": {
  5401. "type": "object",
  5402. "properties": {
  5403. "start": {
  5404. "type": "object",
  5405. "properties": {
  5406. "line": {
  5407. "type": "number"
  5408. },
  5409. "character": {
  5410. "type": "number"
  5411. }
  5412. },
  5413. "required": ["line", "character"]
  5414. },
  5415. "end": {
  5416. "type": "object",
  5417. "properties": {
  5418. "line": {
  5419. "type": "number"
  5420. },
  5421. "character": {
  5422. "type": "number"
  5423. }
  5424. },
  5425. "required": ["line", "character"]
  5426. }
  5427. },
  5428. "required": ["start", "end"]
  5429. },
  5430. "SymbolSource": {
  5431. "type": "object",
  5432. "properties": {
  5433. "text": {
  5434. "$ref": "#/components/schemas/FilePartSourceText"
  5435. },
  5436. "type": {
  5437. "type": "string",
  5438. "const": "symbol"
  5439. },
  5440. "path": {
  5441. "type": "string"
  5442. },
  5443. "range": {
  5444. "$ref": "#/components/schemas/Range"
  5445. },
  5446. "name": {
  5447. "type": "string"
  5448. },
  5449. "kind": {
  5450. "type": "integer",
  5451. "minimum": -9007199254740991,
  5452. "maximum": 9007199254740991
  5453. }
  5454. },
  5455. "required": ["text", "type", "path", "range", "name", "kind"]
  5456. },
  5457. "FilePartSource": {
  5458. "anyOf": [
  5459. {
  5460. "$ref": "#/components/schemas/FileSource"
  5461. },
  5462. {
  5463. "$ref": "#/components/schemas/SymbolSource"
  5464. }
  5465. ]
  5466. },
  5467. "FilePart": {
  5468. "type": "object",
  5469. "properties": {
  5470. "id": {
  5471. "type": "string"
  5472. },
  5473. "sessionID": {
  5474. "type": "string"
  5475. },
  5476. "messageID": {
  5477. "type": "string"
  5478. },
  5479. "type": {
  5480. "type": "string",
  5481. "const": "file"
  5482. },
  5483. "mime": {
  5484. "type": "string"
  5485. },
  5486. "filename": {
  5487. "type": "string"
  5488. },
  5489. "url": {
  5490. "type": "string"
  5491. },
  5492. "source": {
  5493. "$ref": "#/components/schemas/FilePartSource"
  5494. }
  5495. },
  5496. "required": ["id", "sessionID", "messageID", "type", "mime", "url"]
  5497. },
  5498. "ToolStatePending": {
  5499. "type": "object",
  5500. "properties": {
  5501. "status": {
  5502. "type": "string",
  5503. "const": "pending"
  5504. },
  5505. "input": {
  5506. "type": "object",
  5507. "propertyNames": {
  5508. "type": "string"
  5509. },
  5510. "additionalProperties": {}
  5511. },
  5512. "raw": {
  5513. "type": "string"
  5514. }
  5515. },
  5516. "required": ["status", "input", "raw"]
  5517. },
  5518. "ToolStateRunning": {
  5519. "type": "object",
  5520. "properties": {
  5521. "status": {
  5522. "type": "string",
  5523. "const": "running"
  5524. },
  5525. "input": {
  5526. "type": "object",
  5527. "propertyNames": {
  5528. "type": "string"
  5529. },
  5530. "additionalProperties": {}
  5531. },
  5532. "title": {
  5533. "type": "string"
  5534. },
  5535. "metadata": {
  5536. "type": "object",
  5537. "propertyNames": {
  5538. "type": "string"
  5539. },
  5540. "additionalProperties": {}
  5541. },
  5542. "time": {
  5543. "type": "object",
  5544. "properties": {
  5545. "start": {
  5546. "type": "number"
  5547. }
  5548. },
  5549. "required": ["start"]
  5550. }
  5551. },
  5552. "required": ["status", "input", "time"]
  5553. },
  5554. "ToolStateCompleted": {
  5555. "type": "object",
  5556. "properties": {
  5557. "status": {
  5558. "type": "string",
  5559. "const": "completed"
  5560. },
  5561. "input": {
  5562. "type": "object",
  5563. "propertyNames": {
  5564. "type": "string"
  5565. },
  5566. "additionalProperties": {}
  5567. },
  5568. "output": {
  5569. "type": "string"
  5570. },
  5571. "title": {
  5572. "type": "string"
  5573. },
  5574. "metadata": {
  5575. "type": "object",
  5576. "propertyNames": {
  5577. "type": "string"
  5578. },
  5579. "additionalProperties": {}
  5580. },
  5581. "time": {
  5582. "type": "object",
  5583. "properties": {
  5584. "start": {
  5585. "type": "number"
  5586. },
  5587. "end": {
  5588. "type": "number"
  5589. },
  5590. "compacted": {
  5591. "type": "number"
  5592. }
  5593. },
  5594. "required": ["start", "end"]
  5595. },
  5596. "attachments": {
  5597. "type": "array",
  5598. "items": {
  5599. "$ref": "#/components/schemas/FilePart"
  5600. }
  5601. }
  5602. },
  5603. "required": ["status", "input", "output", "title", "metadata", "time"]
  5604. },
  5605. "ToolStateError": {
  5606. "type": "object",
  5607. "properties": {
  5608. "status": {
  5609. "type": "string",
  5610. "const": "error"
  5611. },
  5612. "input": {
  5613. "type": "object",
  5614. "propertyNames": {
  5615. "type": "string"
  5616. },
  5617. "additionalProperties": {}
  5618. },
  5619. "error": {
  5620. "type": "string"
  5621. },
  5622. "metadata": {
  5623. "type": "object",
  5624. "propertyNames": {
  5625. "type": "string"
  5626. },
  5627. "additionalProperties": {}
  5628. },
  5629. "time": {
  5630. "type": "object",
  5631. "properties": {
  5632. "start": {
  5633. "type": "number"
  5634. },
  5635. "end": {
  5636. "type": "number"
  5637. }
  5638. },
  5639. "required": ["start", "end"]
  5640. }
  5641. },
  5642. "required": ["status", "input", "error", "time"]
  5643. },
  5644. "ToolState": {
  5645. "anyOf": [
  5646. {
  5647. "$ref": "#/components/schemas/ToolStatePending"
  5648. },
  5649. {
  5650. "$ref": "#/components/schemas/ToolStateRunning"
  5651. },
  5652. {
  5653. "$ref": "#/components/schemas/ToolStateCompleted"
  5654. },
  5655. {
  5656. "$ref": "#/components/schemas/ToolStateError"
  5657. }
  5658. ]
  5659. },
  5660. "ToolPart": {
  5661. "type": "object",
  5662. "properties": {
  5663. "id": {
  5664. "type": "string"
  5665. },
  5666. "sessionID": {
  5667. "type": "string"
  5668. },
  5669. "messageID": {
  5670. "type": "string"
  5671. },
  5672. "type": {
  5673. "type": "string",
  5674. "const": "tool"
  5675. },
  5676. "callID": {
  5677. "type": "string"
  5678. },
  5679. "tool": {
  5680. "type": "string"
  5681. },
  5682. "state": {
  5683. "$ref": "#/components/schemas/ToolState"
  5684. },
  5685. "metadata": {
  5686. "type": "object",
  5687. "propertyNames": {
  5688. "type": "string"
  5689. },
  5690. "additionalProperties": {}
  5691. }
  5692. },
  5693. "required": ["id", "sessionID", "messageID", "type", "callID", "tool", "state"]
  5694. },
  5695. "StepStartPart": {
  5696. "type": "object",
  5697. "properties": {
  5698. "id": {
  5699. "type": "string"
  5700. },
  5701. "sessionID": {
  5702. "type": "string"
  5703. },
  5704. "messageID": {
  5705. "type": "string"
  5706. },
  5707. "type": {
  5708. "type": "string",
  5709. "const": "step-start"
  5710. },
  5711. "snapshot": {
  5712. "type": "string"
  5713. }
  5714. },
  5715. "required": ["id", "sessionID", "messageID", "type"]
  5716. },
  5717. "StepFinishPart": {
  5718. "type": "object",
  5719. "properties": {
  5720. "id": {
  5721. "type": "string"
  5722. },
  5723. "sessionID": {
  5724. "type": "string"
  5725. },
  5726. "messageID": {
  5727. "type": "string"
  5728. },
  5729. "type": {
  5730. "type": "string",
  5731. "const": "step-finish"
  5732. },
  5733. "reason": {
  5734. "type": "string"
  5735. },
  5736. "snapshot": {
  5737. "type": "string"
  5738. },
  5739. "cost": {
  5740. "type": "number"
  5741. },
  5742. "tokens": {
  5743. "type": "object",
  5744. "properties": {
  5745. "input": {
  5746. "type": "number"
  5747. },
  5748. "output": {
  5749. "type": "number"
  5750. },
  5751. "reasoning": {
  5752. "type": "number"
  5753. },
  5754. "cache": {
  5755. "type": "object",
  5756. "properties": {
  5757. "read": {
  5758. "type": "number"
  5759. },
  5760. "write": {
  5761. "type": "number"
  5762. }
  5763. },
  5764. "required": ["read", "write"]
  5765. }
  5766. },
  5767. "required": ["input", "output", "reasoning", "cache"]
  5768. }
  5769. },
  5770. "required": ["id", "sessionID", "messageID", "type", "reason", "cost", "tokens"]
  5771. },
  5772. "SnapshotPart": {
  5773. "type": "object",
  5774. "properties": {
  5775. "id": {
  5776. "type": "string"
  5777. },
  5778. "sessionID": {
  5779. "type": "string"
  5780. },
  5781. "messageID": {
  5782. "type": "string"
  5783. },
  5784. "type": {
  5785. "type": "string",
  5786. "const": "snapshot"
  5787. },
  5788. "snapshot": {
  5789. "type": "string"
  5790. }
  5791. },
  5792. "required": ["id", "sessionID", "messageID", "type", "snapshot"]
  5793. },
  5794. "PatchPart": {
  5795. "type": "object",
  5796. "properties": {
  5797. "id": {
  5798. "type": "string"
  5799. },
  5800. "sessionID": {
  5801. "type": "string"
  5802. },
  5803. "messageID": {
  5804. "type": "string"
  5805. },
  5806. "type": {
  5807. "type": "string",
  5808. "const": "patch"
  5809. },
  5810. "hash": {
  5811. "type": "string"
  5812. },
  5813. "files": {
  5814. "type": "array",
  5815. "items": {
  5816. "type": "string"
  5817. }
  5818. }
  5819. },
  5820. "required": ["id", "sessionID", "messageID", "type", "hash", "files"]
  5821. },
  5822. "AgentPart": {
  5823. "type": "object",
  5824. "properties": {
  5825. "id": {
  5826. "type": "string"
  5827. },
  5828. "sessionID": {
  5829. "type": "string"
  5830. },
  5831. "messageID": {
  5832. "type": "string"
  5833. },
  5834. "type": {
  5835. "type": "string",
  5836. "const": "agent"
  5837. },
  5838. "name": {
  5839. "type": "string"
  5840. },
  5841. "source": {
  5842. "type": "object",
  5843. "properties": {
  5844. "value": {
  5845. "type": "string"
  5846. },
  5847. "start": {
  5848. "type": "integer",
  5849. "minimum": -9007199254740991,
  5850. "maximum": 9007199254740991
  5851. },
  5852. "end": {
  5853. "type": "integer",
  5854. "minimum": -9007199254740991,
  5855. "maximum": 9007199254740991
  5856. }
  5857. },
  5858. "required": ["value", "start", "end"]
  5859. }
  5860. },
  5861. "required": ["id", "sessionID", "messageID", "type", "name"]
  5862. },
  5863. "RetryPart": {
  5864. "type": "object",
  5865. "properties": {
  5866. "id": {
  5867. "type": "string"
  5868. },
  5869. "sessionID": {
  5870. "type": "string"
  5871. },
  5872. "messageID": {
  5873. "type": "string"
  5874. },
  5875. "type": {
  5876. "type": "string",
  5877. "const": "retry"
  5878. },
  5879. "attempt": {
  5880. "type": "number"
  5881. },
  5882. "error": {
  5883. "$ref": "#/components/schemas/APIError"
  5884. },
  5885. "time": {
  5886. "type": "object",
  5887. "properties": {
  5888. "created": {
  5889. "type": "number"
  5890. }
  5891. },
  5892. "required": ["created"]
  5893. }
  5894. },
  5895. "required": ["id", "sessionID", "messageID", "type", "attempt", "error", "time"]
  5896. },
  5897. "CompactionPart": {
  5898. "type": "object",
  5899. "properties": {
  5900. "id": {
  5901. "type": "string"
  5902. },
  5903. "sessionID": {
  5904. "type": "string"
  5905. },
  5906. "messageID": {
  5907. "type": "string"
  5908. },
  5909. "type": {
  5910. "type": "string",
  5911. "const": "compaction"
  5912. },
  5913. "auto": {
  5914. "type": "boolean"
  5915. }
  5916. },
  5917. "required": ["id", "sessionID", "messageID", "type", "auto"]
  5918. },
  5919. "Part": {
  5920. "anyOf": [
  5921. {
  5922. "$ref": "#/components/schemas/TextPart"
  5923. },
  5924. {
  5925. "type": "object",
  5926. "properties": {
  5927. "id": {
  5928. "type": "string"
  5929. },
  5930. "sessionID": {
  5931. "type": "string"
  5932. },
  5933. "messageID": {
  5934. "type": "string"
  5935. },
  5936. "type": {
  5937. "type": "string",
  5938. "const": "subtask"
  5939. },
  5940. "prompt": {
  5941. "type": "string"
  5942. },
  5943. "description": {
  5944. "type": "string"
  5945. },
  5946. "agent": {
  5947. "type": "string"
  5948. }
  5949. },
  5950. "required": ["id", "sessionID", "messageID", "type", "prompt", "description", "agent"]
  5951. },
  5952. {
  5953. "$ref": "#/components/schemas/ReasoningPart"
  5954. },
  5955. {
  5956. "$ref": "#/components/schemas/FilePart"
  5957. },
  5958. {
  5959. "$ref": "#/components/schemas/ToolPart"
  5960. },
  5961. {
  5962. "$ref": "#/components/schemas/StepStartPart"
  5963. },
  5964. {
  5965. "$ref": "#/components/schemas/StepFinishPart"
  5966. },
  5967. {
  5968. "$ref": "#/components/schemas/SnapshotPart"
  5969. },
  5970. {
  5971. "$ref": "#/components/schemas/PatchPart"
  5972. },
  5973. {
  5974. "$ref": "#/components/schemas/AgentPart"
  5975. },
  5976. {
  5977. "$ref": "#/components/schemas/RetryPart"
  5978. },
  5979. {
  5980. "$ref": "#/components/schemas/CompactionPart"
  5981. }
  5982. ]
  5983. },
  5984. "Event.message.part.updated": {
  5985. "type": "object",
  5986. "properties": {
  5987. "type": {
  5988. "type": "string",
  5989. "const": "message.part.updated"
  5990. },
  5991. "properties": {
  5992. "type": "object",
  5993. "properties": {
  5994. "part": {
  5995. "$ref": "#/components/schemas/Part"
  5996. },
  5997. "delta": {
  5998. "type": "string"
  5999. }
  6000. },
  6001. "required": ["part"]
  6002. }
  6003. },
  6004. "required": ["type", "properties"]
  6005. },
  6006. "Event.message.part.removed": {
  6007. "type": "object",
  6008. "properties": {
  6009. "type": {
  6010. "type": "string",
  6011. "const": "message.part.removed"
  6012. },
  6013. "properties": {
  6014. "type": "object",
  6015. "properties": {
  6016. "sessionID": {
  6017. "type": "string"
  6018. },
  6019. "messageID": {
  6020. "type": "string"
  6021. },
  6022. "partID": {
  6023. "type": "string"
  6024. }
  6025. },
  6026. "required": ["sessionID", "messageID", "partID"]
  6027. }
  6028. },
  6029. "required": ["type", "properties"]
  6030. },
  6031. "Permission": {
  6032. "type": "object",
  6033. "properties": {
  6034. "id": {
  6035. "type": "string"
  6036. },
  6037. "type": {
  6038. "type": "string"
  6039. },
  6040. "pattern": {
  6041. "anyOf": [
  6042. {
  6043. "type": "string"
  6044. },
  6045. {
  6046. "type": "array",
  6047. "items": {
  6048. "type": "string"
  6049. }
  6050. }
  6051. ]
  6052. },
  6053. "sessionID": {
  6054. "type": "string"
  6055. },
  6056. "messageID": {
  6057. "type": "string"
  6058. },
  6059. "callID": {
  6060. "type": "string"
  6061. },
  6062. "title": {
  6063. "type": "string"
  6064. },
  6065. "metadata": {
  6066. "type": "object",
  6067. "propertyNames": {
  6068. "type": "string"
  6069. },
  6070. "additionalProperties": {}
  6071. },
  6072. "time": {
  6073. "type": "object",
  6074. "properties": {
  6075. "created": {
  6076. "type": "number"
  6077. }
  6078. },
  6079. "required": ["created"]
  6080. }
  6081. },
  6082. "required": ["id", "type", "sessionID", "messageID", "title", "metadata", "time"]
  6083. },
  6084. "Event.permission.updated": {
  6085. "type": "object",
  6086. "properties": {
  6087. "type": {
  6088. "type": "string",
  6089. "const": "permission.updated"
  6090. },
  6091. "properties": {
  6092. "$ref": "#/components/schemas/Permission"
  6093. }
  6094. },
  6095. "required": ["type", "properties"]
  6096. },
  6097. "Event.permission.replied": {
  6098. "type": "object",
  6099. "properties": {
  6100. "type": {
  6101. "type": "string",
  6102. "const": "permission.replied"
  6103. },
  6104. "properties": {
  6105. "type": "object",
  6106. "properties": {
  6107. "sessionID": {
  6108. "type": "string"
  6109. },
  6110. "permissionID": {
  6111. "type": "string"
  6112. },
  6113. "response": {
  6114. "type": "string"
  6115. }
  6116. },
  6117. "required": ["sessionID", "permissionID", "response"]
  6118. }
  6119. },
  6120. "required": ["type", "properties"]
  6121. },
  6122. "SessionStatus": {
  6123. "anyOf": [
  6124. {
  6125. "type": "object",
  6126. "properties": {
  6127. "type": {
  6128. "type": "string",
  6129. "const": "idle"
  6130. }
  6131. },
  6132. "required": ["type"]
  6133. },
  6134. {
  6135. "type": "object",
  6136. "properties": {
  6137. "type": {
  6138. "type": "string",
  6139. "const": "retry"
  6140. },
  6141. "attempt": {
  6142. "type": "number"
  6143. },
  6144. "message": {
  6145. "type": "string"
  6146. },
  6147. "next": {
  6148. "type": "number"
  6149. }
  6150. },
  6151. "required": ["type", "attempt", "message", "next"]
  6152. },
  6153. {
  6154. "type": "object",
  6155. "properties": {
  6156. "type": {
  6157. "type": "string",
  6158. "const": "busy"
  6159. }
  6160. },
  6161. "required": ["type"]
  6162. }
  6163. ]
  6164. },
  6165. "Event.session.status": {
  6166. "type": "object",
  6167. "properties": {
  6168. "type": {
  6169. "type": "string",
  6170. "const": "session.status"
  6171. },
  6172. "properties": {
  6173. "type": "object",
  6174. "properties": {
  6175. "sessionID": {
  6176. "type": "string"
  6177. },
  6178. "status": {
  6179. "$ref": "#/components/schemas/SessionStatus"
  6180. }
  6181. },
  6182. "required": ["sessionID", "status"]
  6183. }
  6184. },
  6185. "required": ["type", "properties"]
  6186. },
  6187. "Event.session.idle": {
  6188. "type": "object",
  6189. "properties": {
  6190. "type": {
  6191. "type": "string",
  6192. "const": "session.idle"
  6193. },
  6194. "properties": {
  6195. "type": "object",
  6196. "properties": {
  6197. "sessionID": {
  6198. "type": "string"
  6199. }
  6200. },
  6201. "required": ["sessionID"]
  6202. }
  6203. },
  6204. "required": ["type", "properties"]
  6205. },
  6206. "Event.session.compacted": {
  6207. "type": "object",
  6208. "properties": {
  6209. "type": {
  6210. "type": "string",
  6211. "const": "session.compacted"
  6212. },
  6213. "properties": {
  6214. "type": "object",
  6215. "properties": {
  6216. "sessionID": {
  6217. "type": "string"
  6218. }
  6219. },
  6220. "required": ["sessionID"]
  6221. }
  6222. },
  6223. "required": ["type", "properties"]
  6224. },
  6225. "Event.file.edited": {
  6226. "type": "object",
  6227. "properties": {
  6228. "type": {
  6229. "type": "string",
  6230. "const": "file.edited"
  6231. },
  6232. "properties": {
  6233. "type": "object",
  6234. "properties": {
  6235. "file": {
  6236. "type": "string"
  6237. }
  6238. },
  6239. "required": ["file"]
  6240. }
  6241. },
  6242. "required": ["type", "properties"]
  6243. },
  6244. "Todo": {
  6245. "type": "object",
  6246. "properties": {
  6247. "content": {
  6248. "description": "Brief description of the task",
  6249. "type": "string"
  6250. },
  6251. "status": {
  6252. "description": "Current status of the task: pending, in_progress, completed, cancelled",
  6253. "type": "string"
  6254. },
  6255. "priority": {
  6256. "description": "Priority level of the task: high, medium, low",
  6257. "type": "string"
  6258. },
  6259. "id": {
  6260. "description": "Unique identifier for the todo item",
  6261. "type": "string"
  6262. }
  6263. },
  6264. "required": ["content", "status", "priority", "id"]
  6265. },
  6266. "Event.todo.updated": {
  6267. "type": "object",
  6268. "properties": {
  6269. "type": {
  6270. "type": "string",
  6271. "const": "todo.updated"
  6272. },
  6273. "properties": {
  6274. "type": "object",
  6275. "properties": {
  6276. "sessionID": {
  6277. "type": "string"
  6278. },
  6279. "todos": {
  6280. "type": "array",
  6281. "items": {
  6282. "$ref": "#/components/schemas/Todo"
  6283. }
  6284. }
  6285. },
  6286. "required": ["sessionID", "todos"]
  6287. }
  6288. },
  6289. "required": ["type", "properties"]
  6290. },
  6291. "Event.command.executed": {
  6292. "type": "object",
  6293. "properties": {
  6294. "type": {
  6295. "type": "string",
  6296. "const": "command.executed"
  6297. },
  6298. "properties": {
  6299. "type": "object",
  6300. "properties": {
  6301. "name": {
  6302. "type": "string"
  6303. },
  6304. "sessionID": {
  6305. "type": "string",
  6306. "pattern": "^ses.*"
  6307. },
  6308. "arguments": {
  6309. "type": "string"
  6310. },
  6311. "messageID": {
  6312. "type": "string",
  6313. "pattern": "^msg.*"
  6314. }
  6315. },
  6316. "required": ["name", "sessionID", "arguments", "messageID"]
  6317. }
  6318. },
  6319. "required": ["type", "properties"]
  6320. },
  6321. "Session": {
  6322. "type": "object",
  6323. "properties": {
  6324. "id": {
  6325. "type": "string",
  6326. "pattern": "^ses.*"
  6327. },
  6328. "projectID": {
  6329. "type": "string"
  6330. },
  6331. "directory": {
  6332. "type": "string"
  6333. },
  6334. "parentID": {
  6335. "type": "string",
  6336. "pattern": "^ses.*"
  6337. },
  6338. "summary": {
  6339. "type": "object",
  6340. "properties": {
  6341. "additions": {
  6342. "type": "number"
  6343. },
  6344. "deletions": {
  6345. "type": "number"
  6346. },
  6347. "files": {
  6348. "type": "number"
  6349. },
  6350. "diffs": {
  6351. "type": "array",
  6352. "items": {
  6353. "$ref": "#/components/schemas/FileDiff"
  6354. }
  6355. }
  6356. },
  6357. "required": ["additions", "deletions", "files"]
  6358. },
  6359. "share": {
  6360. "type": "object",
  6361. "properties": {
  6362. "url": {
  6363. "type": "string"
  6364. }
  6365. },
  6366. "required": ["url"]
  6367. },
  6368. "title": {
  6369. "type": "string"
  6370. },
  6371. "version": {
  6372. "type": "string"
  6373. },
  6374. "time": {
  6375. "type": "object",
  6376. "properties": {
  6377. "created": {
  6378. "type": "number"
  6379. },
  6380. "updated": {
  6381. "type": "number"
  6382. },
  6383. "compacting": {
  6384. "type": "number"
  6385. }
  6386. },
  6387. "required": ["created", "updated"]
  6388. },
  6389. "revert": {
  6390. "type": "object",
  6391. "properties": {
  6392. "messageID": {
  6393. "type": "string"
  6394. },
  6395. "partID": {
  6396. "type": "string"
  6397. },
  6398. "snapshot": {
  6399. "type": "string"
  6400. },
  6401. "diff": {
  6402. "type": "string"
  6403. }
  6404. },
  6405. "required": ["messageID"]
  6406. }
  6407. },
  6408. "required": ["id", "projectID", "directory", "title", "version", "time"]
  6409. },
  6410. "Event.session.created": {
  6411. "type": "object",
  6412. "properties": {
  6413. "type": {
  6414. "type": "string",
  6415. "const": "session.created"
  6416. },
  6417. "properties": {
  6418. "type": "object",
  6419. "properties": {
  6420. "info": {
  6421. "$ref": "#/components/schemas/Session"
  6422. }
  6423. },
  6424. "required": ["info"]
  6425. }
  6426. },
  6427. "required": ["type", "properties"]
  6428. },
  6429. "Event.session.updated": {
  6430. "type": "object",
  6431. "properties": {
  6432. "type": {
  6433. "type": "string",
  6434. "const": "session.updated"
  6435. },
  6436. "properties": {
  6437. "type": "object",
  6438. "properties": {
  6439. "info": {
  6440. "$ref": "#/components/schemas/Session"
  6441. }
  6442. },
  6443. "required": ["info"]
  6444. }
  6445. },
  6446. "required": ["type", "properties"]
  6447. },
  6448. "Event.session.deleted": {
  6449. "type": "object",
  6450. "properties": {
  6451. "type": {
  6452. "type": "string",
  6453. "const": "session.deleted"
  6454. },
  6455. "properties": {
  6456. "type": "object",
  6457. "properties": {
  6458. "info": {
  6459. "$ref": "#/components/schemas/Session"
  6460. }
  6461. },
  6462. "required": ["info"]
  6463. }
  6464. },
  6465. "required": ["type", "properties"]
  6466. },
  6467. "Event.session.diff": {
  6468. "type": "object",
  6469. "properties": {
  6470. "type": {
  6471. "type": "string",
  6472. "const": "session.diff"
  6473. },
  6474. "properties": {
  6475. "type": "object",
  6476. "properties": {
  6477. "sessionID": {
  6478. "type": "string"
  6479. },
  6480. "diff": {
  6481. "type": "array",
  6482. "items": {
  6483. "$ref": "#/components/schemas/FileDiff"
  6484. }
  6485. }
  6486. },
  6487. "required": ["sessionID", "diff"]
  6488. }
  6489. },
  6490. "required": ["type", "properties"]
  6491. },
  6492. "Event.session.error": {
  6493. "type": "object",
  6494. "properties": {
  6495. "type": {
  6496. "type": "string",
  6497. "const": "session.error"
  6498. },
  6499. "properties": {
  6500. "type": "object",
  6501. "properties": {
  6502. "sessionID": {
  6503. "type": "string"
  6504. },
  6505. "error": {
  6506. "anyOf": [
  6507. {
  6508. "$ref": "#/components/schemas/ProviderAuthError"
  6509. },
  6510. {
  6511. "$ref": "#/components/schemas/UnknownError"
  6512. },
  6513. {
  6514. "$ref": "#/components/schemas/MessageOutputLengthError"
  6515. },
  6516. {
  6517. "$ref": "#/components/schemas/MessageAbortedError"
  6518. },
  6519. {
  6520. "$ref": "#/components/schemas/APIError"
  6521. }
  6522. ]
  6523. }
  6524. }
  6525. }
  6526. },
  6527. "required": ["type", "properties"]
  6528. },
  6529. "Event.file.watcher.updated": {
  6530. "type": "object",
  6531. "properties": {
  6532. "type": {
  6533. "type": "string",
  6534. "const": "file.watcher.updated"
  6535. },
  6536. "properties": {
  6537. "type": "object",
  6538. "properties": {
  6539. "file": {
  6540. "type": "string"
  6541. },
  6542. "event": {
  6543. "anyOf": [
  6544. {
  6545. "type": "string",
  6546. "const": "add"
  6547. },
  6548. {
  6549. "type": "string",
  6550. "const": "change"
  6551. },
  6552. {
  6553. "type": "string",
  6554. "const": "unlink"
  6555. }
  6556. ]
  6557. }
  6558. },
  6559. "required": ["file", "event"]
  6560. }
  6561. },
  6562. "required": ["type", "properties"]
  6563. },
  6564. "Event.vcs.branch.updated": {
  6565. "type": "object",
  6566. "properties": {
  6567. "type": {
  6568. "type": "string",
  6569. "const": "vcs.branch.updated"
  6570. },
  6571. "properties": {
  6572. "type": "object",
  6573. "properties": {
  6574. "branch": {
  6575. "type": "string"
  6576. }
  6577. }
  6578. }
  6579. },
  6580. "required": ["type", "properties"]
  6581. },
  6582. "Event.tui.prompt.append": {
  6583. "type": "object",
  6584. "properties": {
  6585. "type": {
  6586. "type": "string",
  6587. "const": "tui.prompt.append"
  6588. },
  6589. "properties": {
  6590. "type": "object",
  6591. "properties": {
  6592. "text": {
  6593. "type": "string"
  6594. }
  6595. },
  6596. "required": ["text"]
  6597. }
  6598. },
  6599. "required": ["type", "properties"]
  6600. },
  6601. "Event.tui.command.execute": {
  6602. "type": "object",
  6603. "properties": {
  6604. "type": {
  6605. "type": "string",
  6606. "const": "tui.command.execute"
  6607. },
  6608. "properties": {
  6609. "type": "object",
  6610. "properties": {
  6611. "command": {
  6612. "anyOf": [
  6613. {
  6614. "type": "string",
  6615. "enum": [
  6616. "session.list",
  6617. "session.new",
  6618. "session.share",
  6619. "session.interrupt",
  6620. "session.compact",
  6621. "session.page.up",
  6622. "session.page.down",
  6623. "session.half.page.up",
  6624. "session.half.page.down",
  6625. "session.first",
  6626. "session.last",
  6627. "prompt.clear",
  6628. "prompt.submit",
  6629. "agent.cycle"
  6630. ]
  6631. },
  6632. {
  6633. "type": "string"
  6634. }
  6635. ]
  6636. }
  6637. },
  6638. "required": ["command"]
  6639. }
  6640. },
  6641. "required": ["type", "properties"]
  6642. },
  6643. "Event.tui.toast.show": {
  6644. "type": "object",
  6645. "properties": {
  6646. "type": {
  6647. "type": "string",
  6648. "const": "tui.toast.show"
  6649. },
  6650. "properties": {
  6651. "type": "object",
  6652. "properties": {
  6653. "title": {
  6654. "type": "string"
  6655. },
  6656. "message": {
  6657. "type": "string"
  6658. },
  6659. "variant": {
  6660. "type": "string",
  6661. "enum": ["info", "success", "warning", "error"]
  6662. },
  6663. "duration": {
  6664. "description": "Duration in milliseconds",
  6665. "default": 5000,
  6666. "type": "number"
  6667. }
  6668. },
  6669. "required": ["message", "variant"]
  6670. }
  6671. },
  6672. "required": ["type", "properties"]
  6673. },
  6674. "Pty": {
  6675. "type": "object",
  6676. "properties": {
  6677. "id": {
  6678. "type": "string",
  6679. "pattern": "^pty.*"
  6680. },
  6681. "title": {
  6682. "type": "string"
  6683. },
  6684. "command": {
  6685. "type": "string"
  6686. },
  6687. "args": {
  6688. "type": "array",
  6689. "items": {
  6690. "type": "string"
  6691. }
  6692. },
  6693. "cwd": {
  6694. "type": "string"
  6695. },
  6696. "status": {
  6697. "type": "string",
  6698. "enum": ["running", "exited"]
  6699. },
  6700. "pid": {
  6701. "type": "number"
  6702. }
  6703. },
  6704. "required": ["id", "title", "command", "args", "cwd", "status", "pid"]
  6705. },
  6706. "Event.pty.created": {
  6707. "type": "object",
  6708. "properties": {
  6709. "type": {
  6710. "type": "string",
  6711. "const": "pty.created"
  6712. },
  6713. "properties": {
  6714. "type": "object",
  6715. "properties": {
  6716. "info": {
  6717. "$ref": "#/components/schemas/Pty"
  6718. }
  6719. },
  6720. "required": ["info"]
  6721. }
  6722. },
  6723. "required": ["type", "properties"]
  6724. },
  6725. "Event.pty.updated": {
  6726. "type": "object",
  6727. "properties": {
  6728. "type": {
  6729. "type": "string",
  6730. "const": "pty.updated"
  6731. },
  6732. "properties": {
  6733. "type": "object",
  6734. "properties": {
  6735. "info": {
  6736. "$ref": "#/components/schemas/Pty"
  6737. }
  6738. },
  6739. "required": ["info"]
  6740. }
  6741. },
  6742. "required": ["type", "properties"]
  6743. },
  6744. "Event.pty.exited": {
  6745. "type": "object",
  6746. "properties": {
  6747. "type": {
  6748. "type": "string",
  6749. "const": "pty.exited"
  6750. },
  6751. "properties": {
  6752. "type": "object",
  6753. "properties": {
  6754. "id": {
  6755. "type": "string",
  6756. "pattern": "^pty.*"
  6757. },
  6758. "exitCode": {
  6759. "type": "number"
  6760. }
  6761. },
  6762. "required": ["id", "exitCode"]
  6763. }
  6764. },
  6765. "required": ["type", "properties"]
  6766. },
  6767. "Event.pty.deleted": {
  6768. "type": "object",
  6769. "properties": {
  6770. "type": {
  6771. "type": "string",
  6772. "const": "pty.deleted"
  6773. },
  6774. "properties": {
  6775. "type": "object",
  6776. "properties": {
  6777. "id": {
  6778. "type": "string",
  6779. "pattern": "^pty.*"
  6780. }
  6781. },
  6782. "required": ["id"]
  6783. }
  6784. },
  6785. "required": ["type", "properties"]
  6786. },
  6787. "Event.server.connected": {
  6788. "type": "object",
  6789. "properties": {
  6790. "type": {
  6791. "type": "string",
  6792. "const": "server.connected"
  6793. },
  6794. "properties": {
  6795. "type": "object",
  6796. "properties": {}
  6797. }
  6798. },
  6799. "required": ["type", "properties"]
  6800. },
  6801. "Event": {
  6802. "anyOf": [
  6803. {
  6804. "$ref": "#/components/schemas/Event.installation.updated"
  6805. },
  6806. {
  6807. "$ref": "#/components/schemas/Event.installation.update-available"
  6808. },
  6809. {
  6810. "$ref": "#/components/schemas/Event.project.updated"
  6811. },
  6812. {
  6813. "$ref": "#/components/schemas/Event.server.instance.disposed"
  6814. },
  6815. {
  6816. "$ref": "#/components/schemas/Event.lsp.client.diagnostics"
  6817. },
  6818. {
  6819. "$ref": "#/components/schemas/Event.lsp.updated"
  6820. },
  6821. {
  6822. "$ref": "#/components/schemas/Event.message.updated"
  6823. },
  6824. {
  6825. "$ref": "#/components/schemas/Event.message.removed"
  6826. },
  6827. {
  6828. "$ref": "#/components/schemas/Event.message.part.updated"
  6829. },
  6830. {
  6831. "$ref": "#/components/schemas/Event.message.part.removed"
  6832. },
  6833. {
  6834. "$ref": "#/components/schemas/Event.permission.updated"
  6835. },
  6836. {
  6837. "$ref": "#/components/schemas/Event.permission.replied"
  6838. },
  6839. {
  6840. "$ref": "#/components/schemas/Event.session.status"
  6841. },
  6842. {
  6843. "$ref": "#/components/schemas/Event.session.idle"
  6844. },
  6845. {
  6846. "$ref": "#/components/schemas/Event.session.compacted"
  6847. },
  6848. {
  6849. "$ref": "#/components/schemas/Event.file.edited"
  6850. },
  6851. {
  6852. "$ref": "#/components/schemas/Event.todo.updated"
  6853. },
  6854. {
  6855. "$ref": "#/components/schemas/Event.command.executed"
  6856. },
  6857. {
  6858. "$ref": "#/components/schemas/Event.session.created"
  6859. },
  6860. {
  6861. "$ref": "#/components/schemas/Event.session.updated"
  6862. },
  6863. {
  6864. "$ref": "#/components/schemas/Event.session.deleted"
  6865. },
  6866. {
  6867. "$ref": "#/components/schemas/Event.session.diff"
  6868. },
  6869. {
  6870. "$ref": "#/components/schemas/Event.session.error"
  6871. },
  6872. {
  6873. "$ref": "#/components/schemas/Event.file.watcher.updated"
  6874. },
  6875. {
  6876. "$ref": "#/components/schemas/Event.vcs.branch.updated"
  6877. },
  6878. {
  6879. "$ref": "#/components/schemas/Event.tui.prompt.append"
  6880. },
  6881. {
  6882. "$ref": "#/components/schemas/Event.tui.command.execute"
  6883. },
  6884. {
  6885. "$ref": "#/components/schemas/Event.tui.toast.show"
  6886. },
  6887. {
  6888. "$ref": "#/components/schemas/Event.pty.created"
  6889. },
  6890. {
  6891. "$ref": "#/components/schemas/Event.pty.updated"
  6892. },
  6893. {
  6894. "$ref": "#/components/schemas/Event.pty.exited"
  6895. },
  6896. {
  6897. "$ref": "#/components/schemas/Event.pty.deleted"
  6898. },
  6899. {
  6900. "$ref": "#/components/schemas/Event.server.connected"
  6901. }
  6902. ]
  6903. },
  6904. "GlobalEvent": {
  6905. "type": "object",
  6906. "properties": {
  6907. "directory": {
  6908. "type": "string"
  6909. },
  6910. "payload": {
  6911. "$ref": "#/components/schemas/Event"
  6912. }
  6913. },
  6914. "required": ["directory", "payload"]
  6915. },
  6916. "BadRequestError": {
  6917. "type": "object",
  6918. "properties": {
  6919. "data": {},
  6920. "errors": {
  6921. "type": "array",
  6922. "items": {
  6923. "type": "object",
  6924. "propertyNames": {
  6925. "type": "string"
  6926. },
  6927. "additionalProperties": {}
  6928. }
  6929. },
  6930. "success": {
  6931. "type": "boolean",
  6932. "const": false
  6933. }
  6934. },
  6935. "required": ["data", "errors", "success"]
  6936. },
  6937. "NotFoundError": {
  6938. "type": "object",
  6939. "properties": {
  6940. "name": {
  6941. "type": "string",
  6942. "const": "NotFoundError"
  6943. },
  6944. "data": {
  6945. "type": "object",
  6946. "properties": {
  6947. "message": {
  6948. "type": "string"
  6949. }
  6950. },
  6951. "required": ["message"]
  6952. }
  6953. },
  6954. "required": ["name", "data"]
  6955. },
  6956. "KeybindsConfig": {
  6957. "description": "Custom keybind configurations",
  6958. "type": "object",
  6959. "properties": {
  6960. "leader": {
  6961. "description": "Leader key for keybind combinations",
  6962. "default": "ctrl+x",
  6963. "type": "string"
  6964. },
  6965. "app_exit": {
  6966. "description": "Exit the application",
  6967. "default": "ctrl+c,ctrl+d,<leader>q",
  6968. "type": "string"
  6969. },
  6970. "editor_open": {
  6971. "description": "Open external editor",
  6972. "default": "<leader>e",
  6973. "type": "string"
  6974. },
  6975. "theme_list": {
  6976. "description": "List available themes",
  6977. "default": "<leader>t",
  6978. "type": "string"
  6979. },
  6980. "sidebar_toggle": {
  6981. "description": "Toggle sidebar",
  6982. "default": "<leader>b",
  6983. "type": "string"
  6984. },
  6985. "scrollbar_toggle": {
  6986. "description": "Toggle session scrollbar",
  6987. "default": "none",
  6988. "type": "string"
  6989. },
  6990. "username_toggle": {
  6991. "description": "Toggle username visibility",
  6992. "default": "none",
  6993. "type": "string"
  6994. },
  6995. "status_view": {
  6996. "description": "View status",
  6997. "default": "<leader>s",
  6998. "type": "string"
  6999. },
  7000. "session_export": {
  7001. "description": "Export session to editor",
  7002. "default": "<leader>x",
  7003. "type": "string"
  7004. },
  7005. "session_new": {
  7006. "description": "Create a new session",
  7007. "default": "<leader>n",
  7008. "type": "string"
  7009. },
  7010. "session_list": {
  7011. "description": "List all sessions",
  7012. "default": "<leader>l",
  7013. "type": "string"
  7014. },
  7015. "session_timeline": {
  7016. "description": "Show session timeline",
  7017. "default": "<leader>g",
  7018. "type": "string"
  7019. },
  7020. "session_share": {
  7021. "description": "Share current session",
  7022. "default": "none",
  7023. "type": "string"
  7024. },
  7025. "session_unshare": {
  7026. "description": "Unshare current session",
  7027. "default": "none",
  7028. "type": "string"
  7029. },
  7030. "session_interrupt": {
  7031. "description": "Interrupt current session",
  7032. "default": "escape",
  7033. "type": "string"
  7034. },
  7035. "session_compact": {
  7036. "description": "Compact the session",
  7037. "default": "<leader>c",
  7038. "type": "string"
  7039. },
  7040. "messages_page_up": {
  7041. "description": "Scroll messages up by one page",
  7042. "default": "pageup",
  7043. "type": "string"
  7044. },
  7045. "messages_page_down": {
  7046. "description": "Scroll messages down by one page",
  7047. "default": "pagedown",
  7048. "type": "string"
  7049. },
  7050. "messages_half_page_up": {
  7051. "description": "Scroll messages up by half page",
  7052. "default": "ctrl+alt+u",
  7053. "type": "string"
  7054. },
  7055. "messages_half_page_down": {
  7056. "description": "Scroll messages down by half page",
  7057. "default": "ctrl+alt+d",
  7058. "type": "string"
  7059. },
  7060. "messages_first": {
  7061. "description": "Navigate to first message",
  7062. "default": "ctrl+g,home",
  7063. "type": "string"
  7064. },
  7065. "messages_last": {
  7066. "description": "Navigate to last message",
  7067. "default": "ctrl+alt+g,end",
  7068. "type": "string"
  7069. },
  7070. "messages_last_user": {
  7071. "description": "Navigate to last user message",
  7072. "default": "none",
  7073. "type": "string"
  7074. },
  7075. "messages_copy": {
  7076. "description": "Copy message",
  7077. "default": "<leader>y",
  7078. "type": "string"
  7079. },
  7080. "messages_undo": {
  7081. "description": "Undo message",
  7082. "default": "<leader>u",
  7083. "type": "string"
  7084. },
  7085. "messages_redo": {
  7086. "description": "Redo message",
  7087. "default": "<leader>r",
  7088. "type": "string"
  7089. },
  7090. "messages_toggle_conceal": {
  7091. "description": "Toggle code block concealment in messages",
  7092. "default": "<leader>h",
  7093. "type": "string"
  7094. },
  7095. "tool_details": {
  7096. "description": "Toggle tool details visibility",
  7097. "default": "none",
  7098. "type": "string"
  7099. },
  7100. "model_list": {
  7101. "description": "List available models",
  7102. "default": "<leader>m",
  7103. "type": "string"
  7104. },
  7105. "model_cycle_recent": {
  7106. "description": "Next recently used model",
  7107. "default": "f2",
  7108. "type": "string"
  7109. },
  7110. "model_cycle_recent_reverse": {
  7111. "description": "Previous recently used model",
  7112. "default": "shift+f2",
  7113. "type": "string"
  7114. },
  7115. "command_list": {
  7116. "description": "List available commands",
  7117. "default": "ctrl+p",
  7118. "type": "string"
  7119. },
  7120. "agent_list": {
  7121. "description": "List agents",
  7122. "default": "<leader>a",
  7123. "type": "string"
  7124. },
  7125. "agent_cycle": {
  7126. "description": "Next agent",
  7127. "default": "tab",
  7128. "type": "string"
  7129. },
  7130. "agent_cycle_reverse": {
  7131. "description": "Previous agent",
  7132. "default": "shift+tab",
  7133. "type": "string"
  7134. },
  7135. "input_clear": {
  7136. "description": "Clear input field",
  7137. "default": "ctrl+c",
  7138. "type": "string"
  7139. },
  7140. "input_paste": {
  7141. "description": "Paste from clipboard",
  7142. "default": "ctrl+v",
  7143. "type": "string"
  7144. },
  7145. "input_submit": {
  7146. "description": "Submit input",
  7147. "default": "return",
  7148. "type": "string"
  7149. },
  7150. "input_newline": {
  7151. "description": "Insert newline in input",
  7152. "default": "shift+return,ctrl+j",
  7153. "type": "string"
  7154. },
  7155. "history_previous": {
  7156. "description": "Previous history item",
  7157. "default": "up",
  7158. "type": "string"
  7159. },
  7160. "history_next": {
  7161. "description": "Next history item",
  7162. "default": "down",
  7163. "type": "string"
  7164. },
  7165. "session_child_cycle": {
  7166. "description": "Next child session",
  7167. "default": "<leader>right",
  7168. "type": "string"
  7169. },
  7170. "session_child_cycle_reverse": {
  7171. "description": "Previous child session",
  7172. "default": "<leader>left",
  7173. "type": "string"
  7174. },
  7175. "terminal_suspend": {
  7176. "description": "Suspend terminal",
  7177. "default": "ctrl+z",
  7178. "type": "string"
  7179. }
  7180. },
  7181. "additionalProperties": false
  7182. },
  7183. "AgentConfig": {
  7184. "type": "object",
  7185. "properties": {
  7186. "model": {
  7187. "type": "string"
  7188. },
  7189. "temperature": {
  7190. "type": "number"
  7191. },
  7192. "top_p": {
  7193. "type": "number"
  7194. },
  7195. "prompt": {
  7196. "type": "string"
  7197. },
  7198. "tools": {
  7199. "type": "object",
  7200. "propertyNames": {
  7201. "type": "string"
  7202. },
  7203. "additionalProperties": {
  7204. "type": "boolean"
  7205. }
  7206. },
  7207. "disable": {
  7208. "type": "boolean"
  7209. },
  7210. "description": {
  7211. "description": "Description of when to use the agent",
  7212. "type": "string"
  7213. },
  7214. "mode": {
  7215. "type": "string",
  7216. "enum": ["subagent", "primary", "all"]
  7217. },
  7218. "color": {
  7219. "description": "Hex color code for the agent (e.g., #FF5733)",
  7220. "type": "string",
  7221. "pattern": "^#[0-9a-fA-F]{6}$"
  7222. },
  7223. "maxSteps": {
  7224. "description": "Maximum number of agentic iterations before forcing text-only response",
  7225. "type": "integer",
  7226. "exclusiveMinimum": 0,
  7227. "maximum": 9007199254740991
  7228. },
  7229. "permission": {
  7230. "type": "object",
  7231. "properties": {
  7232. "edit": {
  7233. "type": "string",
  7234. "enum": ["ask", "allow", "deny"]
  7235. },
  7236. "bash": {
  7237. "anyOf": [
  7238. {
  7239. "type": "string",
  7240. "enum": ["ask", "allow", "deny"]
  7241. },
  7242. {
  7243. "type": "object",
  7244. "propertyNames": {
  7245. "type": "string"
  7246. },
  7247. "additionalProperties": {
  7248. "type": "string",
  7249. "enum": ["ask", "allow", "deny"]
  7250. }
  7251. }
  7252. ]
  7253. },
  7254. "webfetch": {
  7255. "type": "string",
  7256. "enum": ["ask", "allow", "deny"]
  7257. },
  7258. "doom_loop": {
  7259. "type": "string",
  7260. "enum": ["ask", "allow", "deny"]
  7261. },
  7262. "external_directory": {
  7263. "type": "string",
  7264. "enum": ["ask", "allow", "deny"]
  7265. }
  7266. }
  7267. }
  7268. },
  7269. "additionalProperties": {}
  7270. },
  7271. "ProviderConfig": {
  7272. "type": "object",
  7273. "properties": {
  7274. "api": {
  7275. "type": "string"
  7276. },
  7277. "name": {
  7278. "type": "string"
  7279. },
  7280. "env": {
  7281. "type": "array",
  7282. "items": {
  7283. "type": "string"
  7284. }
  7285. },
  7286. "id": {
  7287. "type": "string"
  7288. },
  7289. "npm": {
  7290. "type": "string"
  7291. },
  7292. "models": {
  7293. "type": "object",
  7294. "propertyNames": {
  7295. "type": "string"
  7296. },
  7297. "additionalProperties": {
  7298. "type": "object",
  7299. "properties": {
  7300. "id": {
  7301. "type": "string"
  7302. },
  7303. "name": {
  7304. "type": "string"
  7305. },
  7306. "family": {
  7307. "type": "string"
  7308. },
  7309. "release_date": {
  7310. "type": "string"
  7311. },
  7312. "attachment": {
  7313. "type": "boolean"
  7314. },
  7315. "reasoning": {
  7316. "type": "boolean"
  7317. },
  7318. "temperature": {
  7319. "type": "boolean"
  7320. },
  7321. "tool_call": {
  7322. "type": "boolean"
  7323. },
  7324. "interleaved": {
  7325. "anyOf": [
  7326. {
  7327. "type": "boolean",
  7328. "const": true
  7329. },
  7330. {
  7331. "type": "object",
  7332. "properties": {
  7333. "field": {
  7334. "type": "string",
  7335. "enum": ["reasoning_content", "reasoning_details"]
  7336. }
  7337. },
  7338. "required": ["field"],
  7339. "additionalProperties": false
  7340. }
  7341. ]
  7342. },
  7343. "cost": {
  7344. "type": "object",
  7345. "properties": {
  7346. "input": {
  7347. "type": "number"
  7348. },
  7349. "output": {
  7350. "type": "number"
  7351. },
  7352. "cache_read": {
  7353. "type": "number"
  7354. },
  7355. "cache_write": {
  7356. "type": "number"
  7357. },
  7358. "context_over_200k": {
  7359. "type": "object",
  7360. "properties": {
  7361. "input": {
  7362. "type": "number"
  7363. },
  7364. "output": {
  7365. "type": "number"
  7366. },
  7367. "cache_read": {
  7368. "type": "number"
  7369. },
  7370. "cache_write": {
  7371. "type": "number"
  7372. }
  7373. },
  7374. "required": ["input", "output"]
  7375. }
  7376. },
  7377. "required": ["input", "output"]
  7378. },
  7379. "limit": {
  7380. "type": "object",
  7381. "properties": {
  7382. "context": {
  7383. "type": "number"
  7384. },
  7385. "output": {
  7386. "type": "number"
  7387. }
  7388. },
  7389. "required": ["context", "output"]
  7390. },
  7391. "modalities": {
  7392. "type": "object",
  7393. "properties": {
  7394. "input": {
  7395. "type": "array",
  7396. "items": {
  7397. "type": "string",
  7398. "enum": ["text", "audio", "image", "video", "pdf"]
  7399. }
  7400. },
  7401. "output": {
  7402. "type": "array",
  7403. "items": {
  7404. "type": "string",
  7405. "enum": ["text", "audio", "image", "video", "pdf"]
  7406. }
  7407. }
  7408. },
  7409. "required": ["input", "output"]
  7410. },
  7411. "experimental": {
  7412. "type": "boolean"
  7413. },
  7414. "status": {
  7415. "type": "string",
  7416. "enum": ["alpha", "beta", "deprecated"]
  7417. },
  7418. "options": {
  7419. "type": "object",
  7420. "propertyNames": {
  7421. "type": "string"
  7422. },
  7423. "additionalProperties": {}
  7424. },
  7425. "headers": {
  7426. "type": "object",
  7427. "propertyNames": {
  7428. "type": "string"
  7429. },
  7430. "additionalProperties": {
  7431. "type": "string"
  7432. }
  7433. },
  7434. "provider": {
  7435. "type": "object",
  7436. "properties": {
  7437. "npm": {
  7438. "type": "string"
  7439. }
  7440. },
  7441. "required": ["npm"]
  7442. }
  7443. }
  7444. }
  7445. },
  7446. "whitelist": {
  7447. "type": "array",
  7448. "items": {
  7449. "type": "string"
  7450. }
  7451. },
  7452. "blacklist": {
  7453. "type": "array",
  7454. "items": {
  7455. "type": "string"
  7456. }
  7457. },
  7458. "options": {
  7459. "type": "object",
  7460. "properties": {
  7461. "apiKey": {
  7462. "type": "string"
  7463. },
  7464. "baseURL": {
  7465. "type": "string"
  7466. },
  7467. "enterpriseUrl": {
  7468. "description": "GitHub Enterprise URL for copilot authentication",
  7469. "type": "string"
  7470. },
  7471. "setCacheKey": {
  7472. "description": "Enable promptCacheKey for this provider (default false)",
  7473. "type": "boolean"
  7474. },
  7475. "timeout": {
  7476. "description": "Timeout in milliseconds for requests to this provider. Default is 300000 (5 minutes). Set to false to disable timeout.",
  7477. "anyOf": [
  7478. {
  7479. "description": "Timeout in milliseconds for requests to this provider. Default is 300000 (5 minutes). Set to false to disable timeout.",
  7480. "type": "integer",
  7481. "exclusiveMinimum": 0,
  7482. "maximum": 9007199254740991
  7483. },
  7484. {
  7485. "description": "Disable timeout for this provider entirely.",
  7486. "type": "boolean",
  7487. "const": false
  7488. }
  7489. ]
  7490. }
  7491. },
  7492. "additionalProperties": {}
  7493. }
  7494. },
  7495. "additionalProperties": false
  7496. },
  7497. "McpLocalConfig": {
  7498. "type": "object",
  7499. "properties": {
  7500. "type": {
  7501. "description": "Type of MCP server connection",
  7502. "type": "string",
  7503. "const": "local"
  7504. },
  7505. "command": {
  7506. "description": "Command and arguments to run the MCP server",
  7507. "type": "array",
  7508. "items": {
  7509. "type": "string"
  7510. }
  7511. },
  7512. "environment": {
  7513. "description": "Environment variables to set when running the MCP server",
  7514. "type": "object",
  7515. "propertyNames": {
  7516. "type": "string"
  7517. },
  7518. "additionalProperties": {
  7519. "type": "string"
  7520. }
  7521. },
  7522. "enabled": {
  7523. "description": "Enable or disable the MCP server on startup",
  7524. "type": "boolean"
  7525. },
  7526. "timeout": {
  7527. "description": "Timeout in ms for fetching tools from the MCP server. Defaults to 5000 (5 seconds) if not specified.",
  7528. "type": "integer",
  7529. "exclusiveMinimum": 0,
  7530. "maximum": 9007199254740991
  7531. }
  7532. },
  7533. "required": ["type", "command"],
  7534. "additionalProperties": false
  7535. },
  7536. "McpOAuthConfig": {
  7537. "type": "object",
  7538. "properties": {
  7539. "clientId": {
  7540. "description": "OAuth client ID. If not provided, dynamic client registration (RFC 7591) will be attempted.",
  7541. "type": "string"
  7542. },
  7543. "clientSecret": {
  7544. "description": "OAuth client secret (if required by the authorization server)",
  7545. "type": "string"
  7546. },
  7547. "scope": {
  7548. "description": "OAuth scopes to request during authorization",
  7549. "type": "string"
  7550. }
  7551. },
  7552. "additionalProperties": false
  7553. },
  7554. "McpRemoteConfig": {
  7555. "type": "object",
  7556. "properties": {
  7557. "type": {
  7558. "description": "Type of MCP server connection",
  7559. "type": "string",
  7560. "const": "remote"
  7561. },
  7562. "url": {
  7563. "description": "URL of the remote MCP server",
  7564. "type": "string"
  7565. },
  7566. "enabled": {
  7567. "description": "Enable or disable the MCP server on startup",
  7568. "type": "boolean"
  7569. },
  7570. "headers": {
  7571. "description": "Headers to send with the request",
  7572. "type": "object",
  7573. "propertyNames": {
  7574. "type": "string"
  7575. },
  7576. "additionalProperties": {
  7577. "type": "string"
  7578. }
  7579. },
  7580. "oauth": {
  7581. "description": "OAuth authentication configuration for the MCP server. Set to false to disable OAuth auto-detection.",
  7582. "anyOf": [
  7583. {
  7584. "$ref": "#/components/schemas/McpOAuthConfig"
  7585. },
  7586. {
  7587. "type": "boolean",
  7588. "const": false
  7589. }
  7590. ]
  7591. },
  7592. "timeout": {
  7593. "description": "Timeout in ms for fetching tools from the MCP server. Defaults to 5000 (5 seconds) if not specified.",
  7594. "type": "integer",
  7595. "exclusiveMinimum": 0,
  7596. "maximum": 9007199254740991
  7597. }
  7598. },
  7599. "required": ["type", "url"],
  7600. "additionalProperties": false
  7601. },
  7602. "LayoutConfig": {
  7603. "description": "@deprecated Always uses stretch layout.",
  7604. "type": "string",
  7605. "enum": ["auto", "stretch"]
  7606. },
  7607. "Config": {
  7608. "type": "object",
  7609. "properties": {
  7610. "$schema": {
  7611. "description": "JSON schema reference for configuration validation",
  7612. "type": "string"
  7613. },
  7614. "theme": {
  7615. "description": "Theme name to use for the interface",
  7616. "type": "string"
  7617. },
  7618. "keybinds": {
  7619. "$ref": "#/components/schemas/KeybindsConfig"
  7620. },
  7621. "tui": {
  7622. "description": "TUI specific settings",
  7623. "type": "object",
  7624. "properties": {
  7625. "scroll_speed": {
  7626. "description": "TUI scroll speed",
  7627. "type": "number",
  7628. "minimum": 0.001
  7629. },
  7630. "scroll_acceleration": {
  7631. "description": "Scroll acceleration settings",
  7632. "type": "object",
  7633. "properties": {
  7634. "enabled": {
  7635. "description": "Enable scroll acceleration",
  7636. "type": "boolean"
  7637. }
  7638. },
  7639. "required": ["enabled"]
  7640. },
  7641. "diff_style": {
  7642. "description": "Control diff rendering style: 'auto' adapts to terminal width, 'stacked' always shows single column",
  7643. "type": "string",
  7644. "enum": ["auto", "stacked"]
  7645. }
  7646. }
  7647. },
  7648. "command": {
  7649. "description": "Command configuration, see https://opencode.ai/docs/commands",
  7650. "type": "object",
  7651. "propertyNames": {
  7652. "type": "string"
  7653. },
  7654. "additionalProperties": {
  7655. "type": "object",
  7656. "properties": {
  7657. "template": {
  7658. "type": "string"
  7659. },
  7660. "description": {
  7661. "type": "string"
  7662. },
  7663. "agent": {
  7664. "type": "string"
  7665. },
  7666. "model": {
  7667. "type": "string"
  7668. },
  7669. "subtask": {
  7670. "type": "boolean"
  7671. }
  7672. },
  7673. "required": ["template"]
  7674. }
  7675. },
  7676. "watcher": {
  7677. "type": "object",
  7678. "properties": {
  7679. "ignore": {
  7680. "type": "array",
  7681. "items": {
  7682. "type": "string"
  7683. }
  7684. }
  7685. }
  7686. },
  7687. "plugin": {
  7688. "type": "array",
  7689. "items": {
  7690. "type": "string"
  7691. }
  7692. },
  7693. "snapshot": {
  7694. "type": "boolean"
  7695. },
  7696. "share": {
  7697. "description": "Control sharing behavior:'manual' allows manual sharing via commands, 'auto' enables automatic sharing, 'disabled' disables all sharing",
  7698. "type": "string",
  7699. "enum": ["manual", "auto", "disabled"]
  7700. },
  7701. "autoshare": {
  7702. "description": "@deprecated Use 'share' field instead. Share newly created sessions automatically",
  7703. "type": "boolean"
  7704. },
  7705. "autoupdate": {
  7706. "description": "Automatically update to the latest version. Set to true to auto-update, false to disable, or 'notify' to show update notifications",
  7707. "anyOf": [
  7708. {
  7709. "type": "boolean"
  7710. },
  7711. {
  7712. "type": "string",
  7713. "const": "notify"
  7714. }
  7715. ]
  7716. },
  7717. "disabled_providers": {
  7718. "description": "Disable providers that are loaded automatically",
  7719. "type": "array",
  7720. "items": {
  7721. "type": "string"
  7722. }
  7723. },
  7724. "enabled_providers": {
  7725. "description": "When set, ONLY these providers will be enabled. All other providers will be ignored",
  7726. "type": "array",
  7727. "items": {
  7728. "type": "string"
  7729. }
  7730. },
  7731. "model": {
  7732. "description": "Model to use in the format of provider/model, eg anthropic/claude-2",
  7733. "type": "string"
  7734. },
  7735. "small_model": {
  7736. "description": "Small model to use for tasks like title generation in the format of provider/model",
  7737. "type": "string"
  7738. },
  7739. "username": {
  7740. "description": "Custom username to display in conversations instead of system username",
  7741. "type": "string"
  7742. },
  7743. "mode": {
  7744. "description": "@deprecated Use `agent` field instead.",
  7745. "type": "object",
  7746. "properties": {
  7747. "build": {
  7748. "$ref": "#/components/schemas/AgentConfig"
  7749. },
  7750. "plan": {
  7751. "$ref": "#/components/schemas/AgentConfig"
  7752. }
  7753. },
  7754. "additionalProperties": {
  7755. "$ref": "#/components/schemas/AgentConfig"
  7756. }
  7757. },
  7758. "agent": {
  7759. "description": "Agent configuration, see https://opencode.ai/docs/agent",
  7760. "type": "object",
  7761. "properties": {
  7762. "plan": {
  7763. "$ref": "#/components/schemas/AgentConfig"
  7764. },
  7765. "build": {
  7766. "$ref": "#/components/schemas/AgentConfig"
  7767. },
  7768. "general": {
  7769. "$ref": "#/components/schemas/AgentConfig"
  7770. },
  7771. "explore": {
  7772. "$ref": "#/components/schemas/AgentConfig"
  7773. }
  7774. },
  7775. "additionalProperties": {
  7776. "$ref": "#/components/schemas/AgentConfig"
  7777. }
  7778. },
  7779. "provider": {
  7780. "description": "Custom provider configurations and model overrides",
  7781. "type": "object",
  7782. "propertyNames": {
  7783. "type": "string"
  7784. },
  7785. "additionalProperties": {
  7786. "$ref": "#/components/schemas/ProviderConfig"
  7787. }
  7788. },
  7789. "mcp": {
  7790. "description": "MCP (Model Context Protocol) server configurations",
  7791. "type": "object",
  7792. "propertyNames": {
  7793. "type": "string"
  7794. },
  7795. "additionalProperties": {
  7796. "anyOf": [
  7797. {
  7798. "$ref": "#/components/schemas/McpLocalConfig"
  7799. },
  7800. {
  7801. "$ref": "#/components/schemas/McpRemoteConfig"
  7802. }
  7803. ]
  7804. }
  7805. },
  7806. "formatter": {
  7807. "anyOf": [
  7808. {
  7809. "type": "boolean",
  7810. "const": false
  7811. },
  7812. {
  7813. "type": "object",
  7814. "propertyNames": {
  7815. "type": "string"
  7816. },
  7817. "additionalProperties": {
  7818. "type": "object",
  7819. "properties": {
  7820. "disabled": {
  7821. "type": "boolean"
  7822. },
  7823. "command": {
  7824. "type": "array",
  7825. "items": {
  7826. "type": "string"
  7827. }
  7828. },
  7829. "environment": {
  7830. "type": "object",
  7831. "propertyNames": {
  7832. "type": "string"
  7833. },
  7834. "additionalProperties": {
  7835. "type": "string"
  7836. }
  7837. },
  7838. "extensions": {
  7839. "type": "array",
  7840. "items": {
  7841. "type": "string"
  7842. }
  7843. }
  7844. }
  7845. }
  7846. }
  7847. ]
  7848. },
  7849. "lsp": {
  7850. "anyOf": [
  7851. {
  7852. "type": "boolean",
  7853. "const": false
  7854. },
  7855. {
  7856. "type": "object",
  7857. "propertyNames": {
  7858. "type": "string"
  7859. },
  7860. "additionalProperties": {
  7861. "anyOf": [
  7862. {
  7863. "type": "object",
  7864. "properties": {
  7865. "disabled": {
  7866. "type": "boolean",
  7867. "const": true
  7868. }
  7869. },
  7870. "required": ["disabled"]
  7871. },
  7872. {
  7873. "type": "object",
  7874. "properties": {
  7875. "command": {
  7876. "type": "array",
  7877. "items": {
  7878. "type": "string"
  7879. }
  7880. },
  7881. "extensions": {
  7882. "type": "array",
  7883. "items": {
  7884. "type": "string"
  7885. }
  7886. },
  7887. "disabled": {
  7888. "type": "boolean"
  7889. },
  7890. "env": {
  7891. "type": "object",
  7892. "propertyNames": {
  7893. "type": "string"
  7894. },
  7895. "additionalProperties": {
  7896. "type": "string"
  7897. }
  7898. },
  7899. "initialization": {
  7900. "type": "object",
  7901. "propertyNames": {
  7902. "type": "string"
  7903. },
  7904. "additionalProperties": {}
  7905. }
  7906. },
  7907. "required": ["command"]
  7908. }
  7909. ]
  7910. }
  7911. }
  7912. ]
  7913. },
  7914. "instructions": {
  7915. "description": "Additional instruction files or patterns to include",
  7916. "type": "array",
  7917. "items": {
  7918. "type": "string"
  7919. }
  7920. },
  7921. "layout": {
  7922. "$ref": "#/components/schemas/LayoutConfig"
  7923. },
  7924. "permission": {
  7925. "type": "object",
  7926. "properties": {
  7927. "edit": {
  7928. "type": "string",
  7929. "enum": ["ask", "allow", "deny"]
  7930. },
  7931. "bash": {
  7932. "anyOf": [
  7933. {
  7934. "type": "string",
  7935. "enum": ["ask", "allow", "deny"]
  7936. },
  7937. {
  7938. "type": "object",
  7939. "propertyNames": {
  7940. "type": "string"
  7941. },
  7942. "additionalProperties": {
  7943. "type": "string",
  7944. "enum": ["ask", "allow", "deny"]
  7945. }
  7946. }
  7947. ]
  7948. },
  7949. "webfetch": {
  7950. "type": "string",
  7951. "enum": ["ask", "allow", "deny"]
  7952. },
  7953. "doom_loop": {
  7954. "type": "string",
  7955. "enum": ["ask", "allow", "deny"]
  7956. },
  7957. "external_directory": {
  7958. "type": "string",
  7959. "enum": ["ask", "allow", "deny"]
  7960. }
  7961. }
  7962. },
  7963. "tools": {
  7964. "type": "object",
  7965. "propertyNames": {
  7966. "type": "string"
  7967. },
  7968. "additionalProperties": {
  7969. "type": "boolean"
  7970. }
  7971. },
  7972. "enterprise": {
  7973. "type": "object",
  7974. "properties": {
  7975. "url": {
  7976. "description": "Enterprise URL",
  7977. "type": "string"
  7978. }
  7979. }
  7980. },
  7981. "experimental": {
  7982. "type": "object",
  7983. "properties": {
  7984. "hook": {
  7985. "type": "object",
  7986. "properties": {
  7987. "file_edited": {
  7988. "type": "object",
  7989. "propertyNames": {
  7990. "type": "string"
  7991. },
  7992. "additionalProperties": {
  7993. "type": "array",
  7994. "items": {
  7995. "type": "object",
  7996. "properties": {
  7997. "command": {
  7998. "type": "array",
  7999. "items": {
  8000. "type": "string"
  8001. }
  8002. },
  8003. "environment": {
  8004. "type": "object",
  8005. "propertyNames": {
  8006. "type": "string"
  8007. },
  8008. "additionalProperties": {
  8009. "type": "string"
  8010. }
  8011. }
  8012. },
  8013. "required": ["command"]
  8014. }
  8015. }
  8016. },
  8017. "session_completed": {
  8018. "type": "array",
  8019. "items": {
  8020. "type": "object",
  8021. "properties": {
  8022. "command": {
  8023. "type": "array",
  8024. "items": {
  8025. "type": "string"
  8026. }
  8027. },
  8028. "environment": {
  8029. "type": "object",
  8030. "propertyNames": {
  8031. "type": "string"
  8032. },
  8033. "additionalProperties": {
  8034. "type": "string"
  8035. }
  8036. }
  8037. },
  8038. "required": ["command"]
  8039. }
  8040. }
  8041. }
  8042. },
  8043. "chatMaxRetries": {
  8044. "description": "Number of retries for chat completions on failure",
  8045. "type": "number"
  8046. },
  8047. "disable_paste_summary": {
  8048. "type": "boolean"
  8049. },
  8050. "batch_tool": {
  8051. "description": "Enable the batch tool",
  8052. "type": "boolean"
  8053. },
  8054. "openTelemetry": {
  8055. "description": "Enable OpenTelemetry spans for AI SDK calls (using the 'experimental_telemetry' flag)",
  8056. "type": "boolean"
  8057. },
  8058. "primary_tools": {
  8059. "description": "Tools that should only be available to primary agents.",
  8060. "type": "array",
  8061. "items": {
  8062. "type": "string"
  8063. }
  8064. }
  8065. }
  8066. }
  8067. },
  8068. "additionalProperties": false
  8069. },
  8070. "ToolIDs": {
  8071. "type": "array",
  8072. "items": {
  8073. "type": "string"
  8074. }
  8075. },
  8076. "ToolListItem": {
  8077. "type": "object",
  8078. "properties": {
  8079. "id": {
  8080. "type": "string"
  8081. },
  8082. "description": {
  8083. "type": "string"
  8084. },
  8085. "parameters": {}
  8086. },
  8087. "required": ["id", "description", "parameters"]
  8088. },
  8089. "ToolList": {
  8090. "type": "array",
  8091. "items": {
  8092. "$ref": "#/components/schemas/ToolListItem"
  8093. }
  8094. },
  8095. "Path": {
  8096. "type": "object",
  8097. "properties": {
  8098. "state": {
  8099. "type": "string"
  8100. },
  8101. "config": {
  8102. "type": "string"
  8103. },
  8104. "worktree": {
  8105. "type": "string"
  8106. },
  8107. "directory": {
  8108. "type": "string"
  8109. }
  8110. },
  8111. "required": ["state", "config", "worktree", "directory"]
  8112. },
  8113. "VcsInfo": {
  8114. "type": "object",
  8115. "properties": {
  8116. "branch": {
  8117. "type": "string"
  8118. }
  8119. },
  8120. "required": ["branch"]
  8121. },
  8122. "TextPartInput": {
  8123. "type": "object",
  8124. "properties": {
  8125. "id": {
  8126. "type": "string"
  8127. },
  8128. "type": {
  8129. "type": "string",
  8130. "const": "text"
  8131. },
  8132. "text": {
  8133. "type": "string"
  8134. },
  8135. "synthetic": {
  8136. "type": "boolean"
  8137. },
  8138. "ignored": {
  8139. "type": "boolean"
  8140. },
  8141. "time": {
  8142. "type": "object",
  8143. "properties": {
  8144. "start": {
  8145. "type": "number"
  8146. },
  8147. "end": {
  8148. "type": "number"
  8149. }
  8150. },
  8151. "required": ["start"]
  8152. },
  8153. "metadata": {
  8154. "type": "object",
  8155. "propertyNames": {
  8156. "type": "string"
  8157. },
  8158. "additionalProperties": {}
  8159. }
  8160. },
  8161. "required": ["type", "text"]
  8162. },
  8163. "FilePartInput": {
  8164. "type": "object",
  8165. "properties": {
  8166. "id": {
  8167. "type": "string"
  8168. },
  8169. "type": {
  8170. "type": "string",
  8171. "const": "file"
  8172. },
  8173. "mime": {
  8174. "type": "string"
  8175. },
  8176. "filename": {
  8177. "type": "string"
  8178. },
  8179. "url": {
  8180. "type": "string"
  8181. },
  8182. "source": {
  8183. "$ref": "#/components/schemas/FilePartSource"
  8184. }
  8185. },
  8186. "required": ["type", "mime", "url"]
  8187. },
  8188. "AgentPartInput": {
  8189. "type": "object",
  8190. "properties": {
  8191. "id": {
  8192. "type": "string"
  8193. },
  8194. "type": {
  8195. "type": "string",
  8196. "const": "agent"
  8197. },
  8198. "name": {
  8199. "type": "string"
  8200. },
  8201. "source": {
  8202. "type": "object",
  8203. "properties": {
  8204. "value": {
  8205. "type": "string"
  8206. },
  8207. "start": {
  8208. "type": "integer",
  8209. "minimum": -9007199254740991,
  8210. "maximum": 9007199254740991
  8211. },
  8212. "end": {
  8213. "type": "integer",
  8214. "minimum": -9007199254740991,
  8215. "maximum": 9007199254740991
  8216. }
  8217. },
  8218. "required": ["value", "start", "end"]
  8219. }
  8220. },
  8221. "required": ["type", "name"]
  8222. },
  8223. "SubtaskPartInput": {
  8224. "type": "object",
  8225. "properties": {
  8226. "id": {
  8227. "type": "string"
  8228. },
  8229. "type": {
  8230. "type": "string",
  8231. "const": "subtask"
  8232. },
  8233. "prompt": {
  8234. "type": "string"
  8235. },
  8236. "description": {
  8237. "type": "string"
  8238. },
  8239. "agent": {
  8240. "type": "string"
  8241. }
  8242. },
  8243. "required": ["type", "prompt", "description", "agent"]
  8244. },
  8245. "Command": {
  8246. "type": "object",
  8247. "properties": {
  8248. "name": {
  8249. "type": "string"
  8250. },
  8251. "description": {
  8252. "type": "string"
  8253. },
  8254. "agent": {
  8255. "type": "string"
  8256. },
  8257. "model": {
  8258. "type": "string"
  8259. },
  8260. "template": {
  8261. "type": "string"
  8262. },
  8263. "subtask": {
  8264. "type": "boolean"
  8265. }
  8266. },
  8267. "required": ["name", "template"]
  8268. },
  8269. "Model": {
  8270. "type": "object",
  8271. "properties": {
  8272. "id": {
  8273. "type": "string"
  8274. },
  8275. "providerID": {
  8276. "type": "string"
  8277. },
  8278. "api": {
  8279. "type": "object",
  8280. "properties": {
  8281. "id": {
  8282. "type": "string"
  8283. },
  8284. "url": {
  8285. "type": "string"
  8286. },
  8287. "npm": {
  8288. "type": "string"
  8289. }
  8290. },
  8291. "required": ["id", "url", "npm"]
  8292. },
  8293. "name": {
  8294. "type": "string"
  8295. },
  8296. "family": {
  8297. "type": "string"
  8298. },
  8299. "capabilities": {
  8300. "type": "object",
  8301. "properties": {
  8302. "temperature": {
  8303. "type": "boolean"
  8304. },
  8305. "reasoning": {
  8306. "type": "boolean"
  8307. },
  8308. "attachment": {
  8309. "type": "boolean"
  8310. },
  8311. "toolcall": {
  8312. "type": "boolean"
  8313. },
  8314. "input": {
  8315. "type": "object",
  8316. "properties": {
  8317. "text": {
  8318. "type": "boolean"
  8319. },
  8320. "audio": {
  8321. "type": "boolean"
  8322. },
  8323. "image": {
  8324. "type": "boolean"
  8325. },
  8326. "video": {
  8327. "type": "boolean"
  8328. },
  8329. "pdf": {
  8330. "type": "boolean"
  8331. }
  8332. },
  8333. "required": ["text", "audio", "image", "video", "pdf"]
  8334. },
  8335. "output": {
  8336. "type": "object",
  8337. "properties": {
  8338. "text": {
  8339. "type": "boolean"
  8340. },
  8341. "audio": {
  8342. "type": "boolean"
  8343. },
  8344. "image": {
  8345. "type": "boolean"
  8346. },
  8347. "video": {
  8348. "type": "boolean"
  8349. },
  8350. "pdf": {
  8351. "type": "boolean"
  8352. }
  8353. },
  8354. "required": ["text", "audio", "image", "video", "pdf"]
  8355. },
  8356. "interleaved": {
  8357. "anyOf": [
  8358. {
  8359. "type": "boolean"
  8360. },
  8361. {
  8362. "type": "object",
  8363. "properties": {
  8364. "field": {
  8365. "type": "string",
  8366. "enum": ["reasoning_content", "reasoning_details"]
  8367. }
  8368. },
  8369. "required": ["field"]
  8370. }
  8371. ]
  8372. }
  8373. },
  8374. "required": ["temperature", "reasoning", "attachment", "toolcall", "input", "output", "interleaved"]
  8375. },
  8376. "cost": {
  8377. "type": "object",
  8378. "properties": {
  8379. "input": {
  8380. "type": "number"
  8381. },
  8382. "output": {
  8383. "type": "number"
  8384. },
  8385. "cache": {
  8386. "type": "object",
  8387. "properties": {
  8388. "read": {
  8389. "type": "number"
  8390. },
  8391. "write": {
  8392. "type": "number"
  8393. }
  8394. },
  8395. "required": ["read", "write"]
  8396. },
  8397. "experimentalOver200K": {
  8398. "type": "object",
  8399. "properties": {
  8400. "input": {
  8401. "type": "number"
  8402. },
  8403. "output": {
  8404. "type": "number"
  8405. },
  8406. "cache": {
  8407. "type": "object",
  8408. "properties": {
  8409. "read": {
  8410. "type": "number"
  8411. },
  8412. "write": {
  8413. "type": "number"
  8414. }
  8415. },
  8416. "required": ["read", "write"]
  8417. }
  8418. },
  8419. "required": ["input", "output", "cache"]
  8420. }
  8421. },
  8422. "required": ["input", "output", "cache"]
  8423. },
  8424. "limit": {
  8425. "type": "object",
  8426. "properties": {
  8427. "context": {
  8428. "type": "number"
  8429. },
  8430. "output": {
  8431. "type": "number"
  8432. }
  8433. },
  8434. "required": ["context", "output"]
  8435. },
  8436. "status": {
  8437. "type": "string",
  8438. "enum": ["alpha", "beta", "deprecated", "active"]
  8439. },
  8440. "options": {
  8441. "type": "object",
  8442. "propertyNames": {
  8443. "type": "string"
  8444. },
  8445. "additionalProperties": {}
  8446. },
  8447. "headers": {
  8448. "type": "object",
  8449. "propertyNames": {
  8450. "type": "string"
  8451. },
  8452. "additionalProperties": {
  8453. "type": "string"
  8454. }
  8455. }
  8456. },
  8457. "required": ["id", "providerID", "api", "name", "capabilities", "cost", "limit", "status", "options", "headers"]
  8458. },
  8459. "Provider": {
  8460. "type": "object",
  8461. "properties": {
  8462. "id": {
  8463. "type": "string"
  8464. },
  8465. "name": {
  8466. "type": "string"
  8467. },
  8468. "source": {
  8469. "type": "string",
  8470. "enum": ["env", "config", "custom", "api"]
  8471. },
  8472. "env": {
  8473. "type": "array",
  8474. "items": {
  8475. "type": "string"
  8476. }
  8477. },
  8478. "key": {
  8479. "type": "string"
  8480. },
  8481. "options": {
  8482. "type": "object",
  8483. "propertyNames": {
  8484. "type": "string"
  8485. },
  8486. "additionalProperties": {}
  8487. },
  8488. "models": {
  8489. "type": "object",
  8490. "propertyNames": {
  8491. "type": "string"
  8492. },
  8493. "additionalProperties": {
  8494. "$ref": "#/components/schemas/Model"
  8495. }
  8496. }
  8497. },
  8498. "required": ["id", "name", "source", "env", "options", "models"]
  8499. },
  8500. "ProviderAuthMethod": {
  8501. "type": "object",
  8502. "properties": {
  8503. "type": {
  8504. "anyOf": [
  8505. {
  8506. "type": "string",
  8507. "const": "oauth"
  8508. },
  8509. {
  8510. "type": "string",
  8511. "const": "api"
  8512. }
  8513. ]
  8514. },
  8515. "label": {
  8516. "type": "string"
  8517. }
  8518. },
  8519. "required": ["type", "label"]
  8520. },
  8521. "ProviderAuthAuthorization": {
  8522. "type": "object",
  8523. "properties": {
  8524. "url": {
  8525. "type": "string"
  8526. },
  8527. "method": {
  8528. "anyOf": [
  8529. {
  8530. "type": "string",
  8531. "const": "auto"
  8532. },
  8533. {
  8534. "type": "string",
  8535. "const": "code"
  8536. }
  8537. ]
  8538. },
  8539. "instructions": {
  8540. "type": "string"
  8541. }
  8542. },
  8543. "required": ["url", "method", "instructions"]
  8544. },
  8545. "Symbol": {
  8546. "type": "object",
  8547. "properties": {
  8548. "name": {
  8549. "type": "string"
  8550. },
  8551. "kind": {
  8552. "type": "number"
  8553. },
  8554. "location": {
  8555. "type": "object",
  8556. "properties": {
  8557. "uri": {
  8558. "type": "string"
  8559. },
  8560. "range": {
  8561. "$ref": "#/components/schemas/Range"
  8562. }
  8563. },
  8564. "required": ["uri", "range"]
  8565. }
  8566. },
  8567. "required": ["name", "kind", "location"]
  8568. },
  8569. "FileNode": {
  8570. "type": "object",
  8571. "properties": {
  8572. "name": {
  8573. "type": "string"
  8574. },
  8575. "path": {
  8576. "type": "string"
  8577. },
  8578. "absolute": {
  8579. "type": "string"
  8580. },
  8581. "type": {
  8582. "type": "string",
  8583. "enum": ["file", "directory"]
  8584. },
  8585. "ignored": {
  8586. "type": "boolean"
  8587. }
  8588. },
  8589. "required": ["name", "path", "absolute", "type", "ignored"]
  8590. },
  8591. "FileContent": {
  8592. "type": "object",
  8593. "properties": {
  8594. "type": {
  8595. "type": "string",
  8596. "const": "text"
  8597. },
  8598. "content": {
  8599. "type": "string"
  8600. },
  8601. "diff": {
  8602. "type": "string"
  8603. },
  8604. "patch": {
  8605. "type": "object",
  8606. "properties": {
  8607. "oldFileName": {
  8608. "type": "string"
  8609. },
  8610. "newFileName": {
  8611. "type": "string"
  8612. },
  8613. "oldHeader": {
  8614. "type": "string"
  8615. },
  8616. "newHeader": {
  8617. "type": "string"
  8618. },
  8619. "hunks": {
  8620. "type": "array",
  8621. "items": {
  8622. "type": "object",
  8623. "properties": {
  8624. "oldStart": {
  8625. "type": "number"
  8626. },
  8627. "oldLines": {
  8628. "type": "number"
  8629. },
  8630. "newStart": {
  8631. "type": "number"
  8632. },
  8633. "newLines": {
  8634. "type": "number"
  8635. },
  8636. "lines": {
  8637. "type": "array",
  8638. "items": {
  8639. "type": "string"
  8640. }
  8641. }
  8642. },
  8643. "required": ["oldStart", "oldLines", "newStart", "newLines", "lines"]
  8644. }
  8645. },
  8646. "index": {
  8647. "type": "string"
  8648. }
  8649. },
  8650. "required": ["oldFileName", "newFileName", "hunks"]
  8651. },
  8652. "encoding": {
  8653. "type": "string",
  8654. "const": "base64"
  8655. },
  8656. "mimeType": {
  8657. "type": "string"
  8658. }
  8659. },
  8660. "required": ["type", "content"]
  8661. },
  8662. "File": {
  8663. "type": "object",
  8664. "properties": {
  8665. "path": {
  8666. "type": "string"
  8667. },
  8668. "added": {
  8669. "type": "integer",
  8670. "minimum": -9007199254740991,
  8671. "maximum": 9007199254740991
  8672. },
  8673. "removed": {
  8674. "type": "integer",
  8675. "minimum": -9007199254740991,
  8676. "maximum": 9007199254740991
  8677. },
  8678. "status": {
  8679. "type": "string",
  8680. "enum": ["added", "deleted", "modified"]
  8681. }
  8682. },
  8683. "required": ["path", "added", "removed", "status"]
  8684. },
  8685. "Agent": {
  8686. "type": "object",
  8687. "properties": {
  8688. "name": {
  8689. "type": "string"
  8690. },
  8691. "description": {
  8692. "type": "string"
  8693. },
  8694. "mode": {
  8695. "type": "string",
  8696. "enum": ["subagent", "primary", "all"]
  8697. },
  8698. "builtIn": {
  8699. "type": "boolean"
  8700. },
  8701. "topP": {
  8702. "type": "number"
  8703. },
  8704. "temperature": {
  8705. "type": "number"
  8706. },
  8707. "color": {
  8708. "type": "string"
  8709. },
  8710. "permission": {
  8711. "type": "object",
  8712. "properties": {
  8713. "edit": {
  8714. "type": "string",
  8715. "enum": ["ask", "allow", "deny"]
  8716. },
  8717. "bash": {
  8718. "type": "object",
  8719. "propertyNames": {
  8720. "type": "string"
  8721. },
  8722. "additionalProperties": {
  8723. "type": "string",
  8724. "enum": ["ask", "allow", "deny"]
  8725. }
  8726. },
  8727. "webfetch": {
  8728. "type": "string",
  8729. "enum": ["ask", "allow", "deny"]
  8730. },
  8731. "doom_loop": {
  8732. "type": "string",
  8733. "enum": ["ask", "allow", "deny"]
  8734. },
  8735. "external_directory": {
  8736. "type": "string",
  8737. "enum": ["ask", "allow", "deny"]
  8738. }
  8739. },
  8740. "required": ["edit", "bash"]
  8741. },
  8742. "model": {
  8743. "type": "object",
  8744. "properties": {
  8745. "modelID": {
  8746. "type": "string"
  8747. },
  8748. "providerID": {
  8749. "type": "string"
  8750. }
  8751. },
  8752. "required": ["modelID", "providerID"]
  8753. },
  8754. "prompt": {
  8755. "type": "string"
  8756. },
  8757. "tools": {
  8758. "type": "object",
  8759. "propertyNames": {
  8760. "type": "string"
  8761. },
  8762. "additionalProperties": {
  8763. "type": "boolean"
  8764. }
  8765. },
  8766. "options": {
  8767. "type": "object",
  8768. "propertyNames": {
  8769. "type": "string"
  8770. },
  8771. "additionalProperties": {}
  8772. },
  8773. "maxSteps": {
  8774. "type": "integer",
  8775. "exclusiveMinimum": 0,
  8776. "maximum": 9007199254740991
  8777. }
  8778. },
  8779. "required": ["name", "mode", "builtIn", "permission", "tools", "options"]
  8780. },
  8781. "MCPStatusConnected": {
  8782. "type": "object",
  8783. "properties": {
  8784. "status": {
  8785. "type": "string",
  8786. "const": "connected"
  8787. }
  8788. },
  8789. "required": ["status"]
  8790. },
  8791. "MCPStatusDisabled": {
  8792. "type": "object",
  8793. "properties": {
  8794. "status": {
  8795. "type": "string",
  8796. "const": "disabled"
  8797. }
  8798. },
  8799. "required": ["status"]
  8800. },
  8801. "MCPStatusFailed": {
  8802. "type": "object",
  8803. "properties": {
  8804. "status": {
  8805. "type": "string",
  8806. "const": "failed"
  8807. },
  8808. "error": {
  8809. "type": "string"
  8810. }
  8811. },
  8812. "required": ["status", "error"]
  8813. },
  8814. "MCPStatusNeedsAuth": {
  8815. "type": "object",
  8816. "properties": {
  8817. "status": {
  8818. "type": "string",
  8819. "const": "needs_auth"
  8820. }
  8821. },
  8822. "required": ["status"]
  8823. },
  8824. "MCPStatusNeedsClientRegistration": {
  8825. "type": "object",
  8826. "properties": {
  8827. "status": {
  8828. "type": "string",
  8829. "const": "needs_client_registration"
  8830. },
  8831. "error": {
  8832. "type": "string"
  8833. }
  8834. },
  8835. "required": ["status", "error"]
  8836. },
  8837. "MCPStatus": {
  8838. "anyOf": [
  8839. {
  8840. "$ref": "#/components/schemas/MCPStatusConnected"
  8841. },
  8842. {
  8843. "$ref": "#/components/schemas/MCPStatusDisabled"
  8844. },
  8845. {
  8846. "$ref": "#/components/schemas/MCPStatusFailed"
  8847. },
  8848. {
  8849. "$ref": "#/components/schemas/MCPStatusNeedsAuth"
  8850. },
  8851. {
  8852. "$ref": "#/components/schemas/MCPStatusNeedsClientRegistration"
  8853. }
  8854. ]
  8855. },
  8856. "LSPStatus": {
  8857. "type": "object",
  8858. "properties": {
  8859. "id": {
  8860. "type": "string"
  8861. },
  8862. "name": {
  8863. "type": "string"
  8864. },
  8865. "root": {
  8866. "type": "string"
  8867. },
  8868. "status": {
  8869. "anyOf": [
  8870. {
  8871. "type": "string",
  8872. "const": "connected"
  8873. },
  8874. {
  8875. "type": "string",
  8876. "const": "error"
  8877. }
  8878. ]
  8879. }
  8880. },
  8881. "required": ["id", "name", "root", "status"]
  8882. },
  8883. "FormatterStatus": {
  8884. "type": "object",
  8885. "properties": {
  8886. "name": {
  8887. "type": "string"
  8888. },
  8889. "extensions": {
  8890. "type": "array",
  8891. "items": {
  8892. "type": "string"
  8893. }
  8894. },
  8895. "enabled": {
  8896. "type": "boolean"
  8897. }
  8898. },
  8899. "required": ["name", "extensions", "enabled"]
  8900. },
  8901. "OAuth": {
  8902. "type": "object",
  8903. "properties": {
  8904. "type": {
  8905. "type": "string",
  8906. "const": "oauth"
  8907. },
  8908. "refresh": {
  8909. "type": "string"
  8910. },
  8911. "access": {
  8912. "type": "string"
  8913. },
  8914. "expires": {
  8915. "type": "number"
  8916. },
  8917. "enterpriseUrl": {
  8918. "type": "string"
  8919. }
  8920. },
  8921. "required": ["type", "refresh", "access", "expires"]
  8922. },
  8923. "ApiAuth": {
  8924. "type": "object",
  8925. "properties": {
  8926. "type": {
  8927. "type": "string",
  8928. "const": "api"
  8929. },
  8930. "key": {
  8931. "type": "string"
  8932. }
  8933. },
  8934. "required": ["type", "key"]
  8935. },
  8936. "WellKnownAuth": {
  8937. "type": "object",
  8938. "properties": {
  8939. "type": {
  8940. "type": "string",
  8941. "const": "wellknown"
  8942. },
  8943. "key": {
  8944. "type": "string"
  8945. },
  8946. "token": {
  8947. "type": "string"
  8948. }
  8949. },
  8950. "required": ["type", "key", "token"]
  8951. },
  8952. "Auth": {
  8953. "anyOf": [
  8954. {
  8955. "$ref": "#/components/schemas/OAuth"
  8956. },
  8957. {
  8958. "$ref": "#/components/schemas/ApiAuth"
  8959. },
  8960. {
  8961. "$ref": "#/components/schemas/WellKnownAuth"
  8962. }
  8963. ]
  8964. }
  8965. }
  8966. }
  8967. }