openapi.json 246 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958
  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. "release_date": {
  2792. "type": "string"
  2793. },
  2794. "attachment": {
  2795. "type": "boolean"
  2796. },
  2797. "reasoning": {
  2798. "type": "boolean"
  2799. },
  2800. "temperature": {
  2801. "type": "boolean"
  2802. },
  2803. "tool_call": {
  2804. "type": "boolean"
  2805. },
  2806. "interleaved": {
  2807. "anyOf": [
  2808. {
  2809. "type": "boolean",
  2810. "const": true
  2811. },
  2812. {
  2813. "type": "object",
  2814. "properties": {
  2815. "field": {
  2816. "type": "string",
  2817. "enum": ["reasoning_content", "reasoning_details"]
  2818. }
  2819. },
  2820. "required": ["field"],
  2821. "additionalProperties": false
  2822. }
  2823. ]
  2824. },
  2825. "cost": {
  2826. "type": "object",
  2827. "properties": {
  2828. "input": {
  2829. "type": "number"
  2830. },
  2831. "output": {
  2832. "type": "number"
  2833. },
  2834. "cache_read": {
  2835. "type": "number"
  2836. },
  2837. "cache_write": {
  2838. "type": "number"
  2839. },
  2840. "context_over_200k": {
  2841. "type": "object",
  2842. "properties": {
  2843. "input": {
  2844. "type": "number"
  2845. },
  2846. "output": {
  2847. "type": "number"
  2848. },
  2849. "cache_read": {
  2850. "type": "number"
  2851. },
  2852. "cache_write": {
  2853. "type": "number"
  2854. }
  2855. },
  2856. "required": ["input", "output"]
  2857. }
  2858. },
  2859. "required": ["input", "output"]
  2860. },
  2861. "limit": {
  2862. "type": "object",
  2863. "properties": {
  2864. "context": {
  2865. "type": "number"
  2866. },
  2867. "output": {
  2868. "type": "number"
  2869. }
  2870. },
  2871. "required": ["context", "output"]
  2872. },
  2873. "modalities": {
  2874. "type": "object",
  2875. "properties": {
  2876. "input": {
  2877. "type": "array",
  2878. "items": {
  2879. "type": "string",
  2880. "enum": ["text", "audio", "image", "video", "pdf"]
  2881. }
  2882. },
  2883. "output": {
  2884. "type": "array",
  2885. "items": {
  2886. "type": "string",
  2887. "enum": ["text", "audio", "image", "video", "pdf"]
  2888. }
  2889. }
  2890. },
  2891. "required": ["input", "output"]
  2892. },
  2893. "experimental": {
  2894. "type": "boolean"
  2895. },
  2896. "status": {
  2897. "type": "string",
  2898. "enum": ["alpha", "beta", "deprecated"]
  2899. },
  2900. "options": {
  2901. "type": "object",
  2902. "propertyNames": {
  2903. "type": "string"
  2904. },
  2905. "additionalProperties": {}
  2906. },
  2907. "headers": {
  2908. "type": "object",
  2909. "propertyNames": {
  2910. "type": "string"
  2911. },
  2912. "additionalProperties": {
  2913. "type": "string"
  2914. }
  2915. },
  2916. "provider": {
  2917. "type": "object",
  2918. "properties": {
  2919. "npm": {
  2920. "type": "string"
  2921. }
  2922. },
  2923. "required": ["npm"]
  2924. }
  2925. },
  2926. "required": [
  2927. "id",
  2928. "name",
  2929. "release_date",
  2930. "attachment",
  2931. "reasoning",
  2932. "temperature",
  2933. "tool_call",
  2934. "limit",
  2935. "options"
  2936. ]
  2937. }
  2938. }
  2939. },
  2940. "required": ["name", "env", "id", "models"]
  2941. }
  2942. },
  2943. "default": {
  2944. "type": "object",
  2945. "propertyNames": {
  2946. "type": "string"
  2947. },
  2948. "additionalProperties": {
  2949. "type": "string"
  2950. }
  2951. },
  2952. "connected": {
  2953. "type": "array",
  2954. "items": {
  2955. "type": "string"
  2956. }
  2957. }
  2958. },
  2959. "required": ["all", "default", "connected"]
  2960. }
  2961. }
  2962. }
  2963. }
  2964. },
  2965. "x-codeSamples": [
  2966. {
  2967. "lang": "js",
  2968. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.list({\n ...\n})"
  2969. }
  2970. ]
  2971. }
  2972. },
  2973. "/provider/auth": {
  2974. "get": {
  2975. "operationId": "provider.auth",
  2976. "parameters": [
  2977. {
  2978. "in": "query",
  2979. "name": "directory",
  2980. "schema": {
  2981. "type": "string"
  2982. }
  2983. }
  2984. ],
  2985. "summary": "Get provider auth methods",
  2986. "description": "Retrieve available authentication methods for all AI providers.",
  2987. "responses": {
  2988. "200": {
  2989. "description": "Provider auth methods",
  2990. "content": {
  2991. "application/json": {
  2992. "schema": {
  2993. "type": "object",
  2994. "propertyNames": {
  2995. "type": "string"
  2996. },
  2997. "additionalProperties": {
  2998. "type": "array",
  2999. "items": {
  3000. "$ref": "#/components/schemas/ProviderAuthMethod"
  3001. }
  3002. }
  3003. }
  3004. }
  3005. }
  3006. }
  3007. },
  3008. "x-codeSamples": [
  3009. {
  3010. "lang": "js",
  3011. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.auth({\n ...\n})"
  3012. }
  3013. ]
  3014. }
  3015. },
  3016. "/provider/{providerID}/oauth/authorize": {
  3017. "post": {
  3018. "operationId": "provider.oauth.authorize",
  3019. "parameters": [
  3020. {
  3021. "in": "query",
  3022. "name": "directory",
  3023. "schema": {
  3024. "type": "string"
  3025. }
  3026. },
  3027. {
  3028. "in": "path",
  3029. "name": "providerID",
  3030. "schema": {
  3031. "type": "string"
  3032. },
  3033. "required": true,
  3034. "description": "Provider ID"
  3035. }
  3036. ],
  3037. "summary": "OAuth authorize",
  3038. "description": "Initiate OAuth authorization for a specific AI provider to get an authorization URL.",
  3039. "responses": {
  3040. "200": {
  3041. "description": "Authorization URL and method",
  3042. "content": {
  3043. "application/json": {
  3044. "schema": {
  3045. "$ref": "#/components/schemas/ProviderAuthAuthorization"
  3046. }
  3047. }
  3048. }
  3049. },
  3050. "400": {
  3051. "description": "Bad request",
  3052. "content": {
  3053. "application/json": {
  3054. "schema": {
  3055. "$ref": "#/components/schemas/BadRequestError"
  3056. }
  3057. }
  3058. }
  3059. }
  3060. },
  3061. "requestBody": {
  3062. "content": {
  3063. "application/json": {
  3064. "schema": {
  3065. "type": "object",
  3066. "properties": {
  3067. "method": {
  3068. "description": "Auth method index",
  3069. "type": "number"
  3070. }
  3071. },
  3072. "required": ["method"]
  3073. }
  3074. }
  3075. }
  3076. },
  3077. "x-codeSamples": [
  3078. {
  3079. "lang": "js",
  3080. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.oauth.authorize({\n ...\n})"
  3081. }
  3082. ]
  3083. }
  3084. },
  3085. "/provider/{providerID}/oauth/callback": {
  3086. "post": {
  3087. "operationId": "provider.oauth.callback",
  3088. "parameters": [
  3089. {
  3090. "in": "query",
  3091. "name": "directory",
  3092. "schema": {
  3093. "type": "string"
  3094. }
  3095. },
  3096. {
  3097. "in": "path",
  3098. "name": "providerID",
  3099. "schema": {
  3100. "type": "string"
  3101. },
  3102. "required": true,
  3103. "description": "Provider ID"
  3104. }
  3105. ],
  3106. "summary": "OAuth callback",
  3107. "description": "Handle the OAuth callback from a provider after user authorization.",
  3108. "responses": {
  3109. "200": {
  3110. "description": "OAuth callback processed successfully",
  3111. "content": {
  3112. "application/json": {
  3113. "schema": {
  3114. "type": "boolean"
  3115. }
  3116. }
  3117. }
  3118. },
  3119. "400": {
  3120. "description": "Bad request",
  3121. "content": {
  3122. "application/json": {
  3123. "schema": {
  3124. "$ref": "#/components/schemas/BadRequestError"
  3125. }
  3126. }
  3127. }
  3128. }
  3129. },
  3130. "requestBody": {
  3131. "content": {
  3132. "application/json": {
  3133. "schema": {
  3134. "type": "object",
  3135. "properties": {
  3136. "method": {
  3137. "description": "Auth method index",
  3138. "type": "number"
  3139. },
  3140. "code": {
  3141. "description": "OAuth authorization code",
  3142. "type": "string"
  3143. }
  3144. },
  3145. "required": ["method"]
  3146. }
  3147. }
  3148. }
  3149. },
  3150. "x-codeSamples": [
  3151. {
  3152. "lang": "js",
  3153. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.oauth.callback({\n ...\n})"
  3154. }
  3155. ]
  3156. }
  3157. },
  3158. "/find": {
  3159. "get": {
  3160. "operationId": "find.text",
  3161. "parameters": [
  3162. {
  3163. "in": "query",
  3164. "name": "directory",
  3165. "schema": {
  3166. "type": "string"
  3167. }
  3168. },
  3169. {
  3170. "in": "query",
  3171. "name": "pattern",
  3172. "schema": {
  3173. "type": "string"
  3174. },
  3175. "required": true
  3176. }
  3177. ],
  3178. "summary": "Find text",
  3179. "description": "Search for text patterns across files in the project using ripgrep.",
  3180. "responses": {
  3181. "200": {
  3182. "description": "Matches",
  3183. "content": {
  3184. "application/json": {
  3185. "schema": {
  3186. "type": "array",
  3187. "items": {
  3188. "type": "object",
  3189. "properties": {
  3190. "path": {
  3191. "type": "object",
  3192. "properties": {
  3193. "text": {
  3194. "type": "string"
  3195. }
  3196. },
  3197. "required": ["text"]
  3198. },
  3199. "lines": {
  3200. "type": "object",
  3201. "properties": {
  3202. "text": {
  3203. "type": "string"
  3204. }
  3205. },
  3206. "required": ["text"]
  3207. },
  3208. "line_number": {
  3209. "type": "number"
  3210. },
  3211. "absolute_offset": {
  3212. "type": "number"
  3213. },
  3214. "submatches": {
  3215. "type": "array",
  3216. "items": {
  3217. "type": "object",
  3218. "properties": {
  3219. "match": {
  3220. "type": "object",
  3221. "properties": {
  3222. "text": {
  3223. "type": "string"
  3224. }
  3225. },
  3226. "required": ["text"]
  3227. },
  3228. "start": {
  3229. "type": "number"
  3230. },
  3231. "end": {
  3232. "type": "number"
  3233. }
  3234. },
  3235. "required": ["match", "start", "end"]
  3236. }
  3237. }
  3238. },
  3239. "required": ["path", "lines", "line_number", "absolute_offset", "submatches"]
  3240. }
  3241. }
  3242. }
  3243. }
  3244. }
  3245. },
  3246. "x-codeSamples": [
  3247. {
  3248. "lang": "js",
  3249. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.find.text({\n ...\n})"
  3250. }
  3251. ]
  3252. }
  3253. },
  3254. "/find/file": {
  3255. "get": {
  3256. "operationId": "find.files",
  3257. "parameters": [
  3258. {
  3259. "in": "query",
  3260. "name": "directory",
  3261. "schema": {
  3262. "type": "string"
  3263. }
  3264. },
  3265. {
  3266. "in": "query",
  3267. "name": "query",
  3268. "schema": {
  3269. "type": "string"
  3270. },
  3271. "required": true
  3272. },
  3273. {
  3274. "in": "query",
  3275. "name": "dirs",
  3276. "schema": {
  3277. "type": "string",
  3278. "enum": ["true", "false"]
  3279. }
  3280. }
  3281. ],
  3282. "summary": "Find files",
  3283. "description": "Search for files by name or pattern in the project directory.",
  3284. "responses": {
  3285. "200": {
  3286. "description": "File paths",
  3287. "content": {
  3288. "application/json": {
  3289. "schema": {
  3290. "type": "array",
  3291. "items": {
  3292. "type": "string"
  3293. }
  3294. }
  3295. }
  3296. }
  3297. }
  3298. },
  3299. "x-codeSamples": [
  3300. {
  3301. "lang": "js",
  3302. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.find.files({\n ...\n})"
  3303. }
  3304. ]
  3305. }
  3306. },
  3307. "/find/symbol": {
  3308. "get": {
  3309. "operationId": "find.symbols",
  3310. "parameters": [
  3311. {
  3312. "in": "query",
  3313. "name": "directory",
  3314. "schema": {
  3315. "type": "string"
  3316. }
  3317. },
  3318. {
  3319. "in": "query",
  3320. "name": "query",
  3321. "schema": {
  3322. "type": "string"
  3323. },
  3324. "required": true
  3325. }
  3326. ],
  3327. "summary": "Find symbols",
  3328. "description": "Search for workspace symbols like functions, classes, and variables using LSP.",
  3329. "responses": {
  3330. "200": {
  3331. "description": "Symbols",
  3332. "content": {
  3333. "application/json": {
  3334. "schema": {
  3335. "type": "array",
  3336. "items": {
  3337. "$ref": "#/components/schemas/Symbol"
  3338. }
  3339. }
  3340. }
  3341. }
  3342. }
  3343. },
  3344. "x-codeSamples": [
  3345. {
  3346. "lang": "js",
  3347. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.find.symbols({\n ...\n})"
  3348. }
  3349. ]
  3350. }
  3351. },
  3352. "/file": {
  3353. "get": {
  3354. "operationId": "file.list",
  3355. "parameters": [
  3356. {
  3357. "in": "query",
  3358. "name": "directory",
  3359. "schema": {
  3360. "type": "string"
  3361. }
  3362. },
  3363. {
  3364. "in": "query",
  3365. "name": "path",
  3366. "schema": {
  3367. "type": "string"
  3368. },
  3369. "required": true
  3370. }
  3371. ],
  3372. "summary": "List files",
  3373. "description": "List files and directories in a specified path.",
  3374. "responses": {
  3375. "200": {
  3376. "description": "Files and directories",
  3377. "content": {
  3378. "application/json": {
  3379. "schema": {
  3380. "type": "array",
  3381. "items": {
  3382. "$ref": "#/components/schemas/FileNode"
  3383. }
  3384. }
  3385. }
  3386. }
  3387. }
  3388. },
  3389. "x-codeSamples": [
  3390. {
  3391. "lang": "js",
  3392. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.file.list({\n ...\n})"
  3393. }
  3394. ]
  3395. }
  3396. },
  3397. "/file/content": {
  3398. "get": {
  3399. "operationId": "file.read",
  3400. "parameters": [
  3401. {
  3402. "in": "query",
  3403. "name": "directory",
  3404. "schema": {
  3405. "type": "string"
  3406. }
  3407. },
  3408. {
  3409. "in": "query",
  3410. "name": "path",
  3411. "schema": {
  3412. "type": "string"
  3413. },
  3414. "required": true
  3415. }
  3416. ],
  3417. "summary": "Read file",
  3418. "description": "Read the content of a specified file.",
  3419. "responses": {
  3420. "200": {
  3421. "description": "File content",
  3422. "content": {
  3423. "application/json": {
  3424. "schema": {
  3425. "$ref": "#/components/schemas/FileContent"
  3426. }
  3427. }
  3428. }
  3429. }
  3430. },
  3431. "x-codeSamples": [
  3432. {
  3433. "lang": "js",
  3434. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.file.read({\n ...\n})"
  3435. }
  3436. ]
  3437. }
  3438. },
  3439. "/file/status": {
  3440. "get": {
  3441. "operationId": "file.status",
  3442. "parameters": [
  3443. {
  3444. "in": "query",
  3445. "name": "directory",
  3446. "schema": {
  3447. "type": "string"
  3448. }
  3449. }
  3450. ],
  3451. "summary": "Get file status",
  3452. "description": "Get the git status of all files in the project.",
  3453. "responses": {
  3454. "200": {
  3455. "description": "File status",
  3456. "content": {
  3457. "application/json": {
  3458. "schema": {
  3459. "type": "array",
  3460. "items": {
  3461. "$ref": "#/components/schemas/File"
  3462. }
  3463. }
  3464. }
  3465. }
  3466. }
  3467. },
  3468. "x-codeSamples": [
  3469. {
  3470. "lang": "js",
  3471. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.file.status({\n ...\n})"
  3472. }
  3473. ]
  3474. }
  3475. },
  3476. "/log": {
  3477. "post": {
  3478. "operationId": "app.log",
  3479. "parameters": [
  3480. {
  3481. "in": "query",
  3482. "name": "directory",
  3483. "schema": {
  3484. "type": "string"
  3485. }
  3486. }
  3487. ],
  3488. "summary": "Write log",
  3489. "description": "Write a log entry to the server logs with specified level and metadata.",
  3490. "responses": {
  3491. "200": {
  3492. "description": "Log entry written successfully",
  3493. "content": {
  3494. "application/json": {
  3495. "schema": {
  3496. "type": "boolean"
  3497. }
  3498. }
  3499. }
  3500. },
  3501. "400": {
  3502. "description": "Bad request",
  3503. "content": {
  3504. "application/json": {
  3505. "schema": {
  3506. "$ref": "#/components/schemas/BadRequestError"
  3507. }
  3508. }
  3509. }
  3510. }
  3511. },
  3512. "requestBody": {
  3513. "content": {
  3514. "application/json": {
  3515. "schema": {
  3516. "type": "object",
  3517. "properties": {
  3518. "service": {
  3519. "description": "Service name for the log entry",
  3520. "type": "string"
  3521. },
  3522. "level": {
  3523. "description": "Log level",
  3524. "type": "string",
  3525. "enum": ["debug", "info", "error", "warn"]
  3526. },
  3527. "message": {
  3528. "description": "Log message",
  3529. "type": "string"
  3530. },
  3531. "extra": {
  3532. "description": "Additional metadata for the log entry",
  3533. "type": "object",
  3534. "propertyNames": {
  3535. "type": "string"
  3536. },
  3537. "additionalProperties": {}
  3538. }
  3539. },
  3540. "required": ["service", "level", "message"]
  3541. }
  3542. }
  3543. }
  3544. },
  3545. "x-codeSamples": [
  3546. {
  3547. "lang": "js",
  3548. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.app.log({\n ...\n})"
  3549. }
  3550. ]
  3551. }
  3552. },
  3553. "/agent": {
  3554. "get": {
  3555. "operationId": "app.agents",
  3556. "parameters": [
  3557. {
  3558. "in": "query",
  3559. "name": "directory",
  3560. "schema": {
  3561. "type": "string"
  3562. }
  3563. }
  3564. ],
  3565. "summary": "List agents",
  3566. "description": "Get a list of all available AI agents in the OpenCode system.",
  3567. "responses": {
  3568. "200": {
  3569. "description": "List of agents",
  3570. "content": {
  3571. "application/json": {
  3572. "schema": {
  3573. "type": "array",
  3574. "items": {
  3575. "$ref": "#/components/schemas/Agent"
  3576. }
  3577. }
  3578. }
  3579. }
  3580. }
  3581. },
  3582. "x-codeSamples": [
  3583. {
  3584. "lang": "js",
  3585. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.app.agents({\n ...\n})"
  3586. }
  3587. ]
  3588. }
  3589. },
  3590. "/mcp": {
  3591. "get": {
  3592. "operationId": "mcp.status",
  3593. "parameters": [
  3594. {
  3595. "in": "query",
  3596. "name": "directory",
  3597. "schema": {
  3598. "type": "string"
  3599. }
  3600. }
  3601. ],
  3602. "summary": "Get MCP status",
  3603. "description": "Get the status of all Model Context Protocol (MCP) servers.",
  3604. "responses": {
  3605. "200": {
  3606. "description": "MCP server status",
  3607. "content": {
  3608. "application/json": {
  3609. "schema": {
  3610. "type": "object",
  3611. "propertyNames": {
  3612. "type": "string"
  3613. },
  3614. "additionalProperties": {
  3615. "$ref": "#/components/schemas/MCPStatus"
  3616. }
  3617. }
  3618. }
  3619. }
  3620. }
  3621. },
  3622. "x-codeSamples": [
  3623. {
  3624. "lang": "js",
  3625. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.status({\n ...\n})"
  3626. }
  3627. ]
  3628. },
  3629. "post": {
  3630. "operationId": "mcp.add",
  3631. "parameters": [
  3632. {
  3633. "in": "query",
  3634. "name": "directory",
  3635. "schema": {
  3636. "type": "string"
  3637. }
  3638. }
  3639. ],
  3640. "summary": "Add MCP server",
  3641. "description": "Dynamically add a new Model Context Protocol (MCP) server to the system.",
  3642. "responses": {
  3643. "200": {
  3644. "description": "MCP server added successfully",
  3645. "content": {
  3646. "application/json": {
  3647. "schema": {
  3648. "type": "object",
  3649. "propertyNames": {
  3650. "type": "string"
  3651. },
  3652. "additionalProperties": {
  3653. "$ref": "#/components/schemas/MCPStatus"
  3654. }
  3655. }
  3656. }
  3657. }
  3658. },
  3659. "400": {
  3660. "description": "Bad request",
  3661. "content": {
  3662. "application/json": {
  3663. "schema": {
  3664. "$ref": "#/components/schemas/BadRequestError"
  3665. }
  3666. }
  3667. }
  3668. }
  3669. },
  3670. "requestBody": {
  3671. "content": {
  3672. "application/json": {
  3673. "schema": {
  3674. "type": "object",
  3675. "properties": {
  3676. "name": {
  3677. "type": "string"
  3678. },
  3679. "config": {
  3680. "anyOf": [
  3681. {
  3682. "$ref": "#/components/schemas/McpLocalConfig"
  3683. },
  3684. {
  3685. "$ref": "#/components/schemas/McpRemoteConfig"
  3686. }
  3687. ]
  3688. }
  3689. },
  3690. "required": ["name", "config"]
  3691. }
  3692. }
  3693. }
  3694. },
  3695. "x-codeSamples": [
  3696. {
  3697. "lang": "js",
  3698. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.add({\n ...\n})"
  3699. }
  3700. ]
  3701. }
  3702. },
  3703. "/mcp/{name}/auth": {
  3704. "post": {
  3705. "operationId": "mcp.auth.start",
  3706. "parameters": [
  3707. {
  3708. "in": "query",
  3709. "name": "directory",
  3710. "schema": {
  3711. "type": "string"
  3712. }
  3713. },
  3714. {
  3715. "schema": {
  3716. "type": "string"
  3717. },
  3718. "in": "path",
  3719. "name": "name",
  3720. "required": true
  3721. }
  3722. ],
  3723. "summary": "Start MCP OAuth",
  3724. "description": "Start OAuth authentication flow for a Model Context Protocol (MCP) server.",
  3725. "responses": {
  3726. "200": {
  3727. "description": "OAuth flow started",
  3728. "content": {
  3729. "application/json": {
  3730. "schema": {
  3731. "type": "object",
  3732. "properties": {
  3733. "authorizationUrl": {
  3734. "description": "URL to open in browser for authorization",
  3735. "type": "string"
  3736. }
  3737. },
  3738. "required": ["authorizationUrl"]
  3739. }
  3740. }
  3741. }
  3742. },
  3743. "400": {
  3744. "description": "Bad request",
  3745. "content": {
  3746. "application/json": {
  3747. "schema": {
  3748. "$ref": "#/components/schemas/BadRequestError"
  3749. }
  3750. }
  3751. }
  3752. },
  3753. "404": {
  3754. "description": "Not found",
  3755. "content": {
  3756. "application/json": {
  3757. "schema": {
  3758. "$ref": "#/components/schemas/NotFoundError"
  3759. }
  3760. }
  3761. }
  3762. }
  3763. },
  3764. "x-codeSamples": [
  3765. {
  3766. "lang": "js",
  3767. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.start({\n ...\n})"
  3768. }
  3769. ]
  3770. },
  3771. "delete": {
  3772. "operationId": "mcp.auth.remove",
  3773. "parameters": [
  3774. {
  3775. "in": "query",
  3776. "name": "directory",
  3777. "schema": {
  3778. "type": "string"
  3779. }
  3780. },
  3781. {
  3782. "schema": {
  3783. "type": "string"
  3784. },
  3785. "in": "path",
  3786. "name": "name",
  3787. "required": true
  3788. }
  3789. ],
  3790. "summary": "Remove MCP OAuth",
  3791. "description": "Remove OAuth credentials for an MCP server",
  3792. "responses": {
  3793. "200": {
  3794. "description": "OAuth credentials removed",
  3795. "content": {
  3796. "application/json": {
  3797. "schema": {
  3798. "type": "object",
  3799. "properties": {
  3800. "success": {
  3801. "type": "boolean",
  3802. "const": true
  3803. }
  3804. },
  3805. "required": ["success"]
  3806. }
  3807. }
  3808. }
  3809. },
  3810. "404": {
  3811. "description": "Not found",
  3812. "content": {
  3813. "application/json": {
  3814. "schema": {
  3815. "$ref": "#/components/schemas/NotFoundError"
  3816. }
  3817. }
  3818. }
  3819. }
  3820. },
  3821. "x-codeSamples": [
  3822. {
  3823. "lang": "js",
  3824. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.remove({\n ...\n})"
  3825. }
  3826. ]
  3827. }
  3828. },
  3829. "/mcp/{name}/auth/callback": {
  3830. "post": {
  3831. "operationId": "mcp.auth.callback",
  3832. "parameters": [
  3833. {
  3834. "in": "query",
  3835. "name": "directory",
  3836. "schema": {
  3837. "type": "string"
  3838. }
  3839. },
  3840. {
  3841. "schema": {
  3842. "type": "string"
  3843. },
  3844. "in": "path",
  3845. "name": "name",
  3846. "required": true
  3847. }
  3848. ],
  3849. "summary": "Complete MCP OAuth",
  3850. "description": "Complete OAuth authentication for a Model Context Protocol (MCP) server using the authorization code.",
  3851. "responses": {
  3852. "200": {
  3853. "description": "OAuth authentication completed",
  3854. "content": {
  3855. "application/json": {
  3856. "schema": {
  3857. "$ref": "#/components/schemas/MCPStatus"
  3858. }
  3859. }
  3860. }
  3861. },
  3862. "400": {
  3863. "description": "Bad request",
  3864. "content": {
  3865. "application/json": {
  3866. "schema": {
  3867. "$ref": "#/components/schemas/BadRequestError"
  3868. }
  3869. }
  3870. }
  3871. },
  3872. "404": {
  3873. "description": "Not found",
  3874. "content": {
  3875. "application/json": {
  3876. "schema": {
  3877. "$ref": "#/components/schemas/NotFoundError"
  3878. }
  3879. }
  3880. }
  3881. }
  3882. },
  3883. "requestBody": {
  3884. "content": {
  3885. "application/json": {
  3886. "schema": {
  3887. "type": "object",
  3888. "properties": {
  3889. "code": {
  3890. "description": "Authorization code from OAuth callback",
  3891. "type": "string"
  3892. }
  3893. },
  3894. "required": ["code"]
  3895. }
  3896. }
  3897. }
  3898. },
  3899. "x-codeSamples": [
  3900. {
  3901. "lang": "js",
  3902. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.callback({\n ...\n})"
  3903. }
  3904. ]
  3905. }
  3906. },
  3907. "/mcp/{name}/auth/authenticate": {
  3908. "post": {
  3909. "operationId": "mcp.auth.authenticate",
  3910. "parameters": [
  3911. {
  3912. "in": "query",
  3913. "name": "directory",
  3914. "schema": {
  3915. "type": "string"
  3916. }
  3917. },
  3918. {
  3919. "schema": {
  3920. "type": "string"
  3921. },
  3922. "in": "path",
  3923. "name": "name",
  3924. "required": true
  3925. }
  3926. ],
  3927. "summary": "Authenticate MCP OAuth",
  3928. "description": "Start OAuth flow and wait for callback (opens browser)",
  3929. "responses": {
  3930. "200": {
  3931. "description": "OAuth authentication completed",
  3932. "content": {
  3933. "application/json": {
  3934. "schema": {
  3935. "$ref": "#/components/schemas/MCPStatus"
  3936. }
  3937. }
  3938. }
  3939. },
  3940. "400": {
  3941. "description": "Bad request",
  3942. "content": {
  3943. "application/json": {
  3944. "schema": {
  3945. "$ref": "#/components/schemas/BadRequestError"
  3946. }
  3947. }
  3948. }
  3949. },
  3950. "404": {
  3951. "description": "Not found",
  3952. "content": {
  3953. "application/json": {
  3954. "schema": {
  3955. "$ref": "#/components/schemas/NotFoundError"
  3956. }
  3957. }
  3958. }
  3959. }
  3960. },
  3961. "x-codeSamples": [
  3962. {
  3963. "lang": "js",
  3964. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.authenticate({\n ...\n})"
  3965. }
  3966. ]
  3967. }
  3968. },
  3969. "/mcp/{name}/connect": {
  3970. "post": {
  3971. "operationId": "mcp.connect",
  3972. "parameters": [
  3973. {
  3974. "in": "query",
  3975. "name": "directory",
  3976. "schema": {
  3977. "type": "string"
  3978. }
  3979. },
  3980. {
  3981. "in": "path",
  3982. "name": "name",
  3983. "schema": {
  3984. "type": "string"
  3985. },
  3986. "required": true
  3987. }
  3988. ],
  3989. "description": "Connect an MCP server",
  3990. "responses": {
  3991. "200": {
  3992. "description": "MCP server connected successfully",
  3993. "content": {
  3994. "application/json": {
  3995. "schema": {
  3996. "type": "boolean"
  3997. }
  3998. }
  3999. }
  4000. }
  4001. },
  4002. "x-codeSamples": [
  4003. {
  4004. "lang": "js",
  4005. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.connect({\n ...\n})"
  4006. }
  4007. ]
  4008. }
  4009. },
  4010. "/mcp/{name}/disconnect": {
  4011. "post": {
  4012. "operationId": "mcp.disconnect",
  4013. "parameters": [
  4014. {
  4015. "in": "query",
  4016. "name": "directory",
  4017. "schema": {
  4018. "type": "string"
  4019. }
  4020. },
  4021. {
  4022. "in": "path",
  4023. "name": "name",
  4024. "schema": {
  4025. "type": "string"
  4026. },
  4027. "required": true
  4028. }
  4029. ],
  4030. "description": "Disconnect an MCP server",
  4031. "responses": {
  4032. "200": {
  4033. "description": "MCP server disconnected successfully",
  4034. "content": {
  4035. "application/json": {
  4036. "schema": {
  4037. "type": "boolean"
  4038. }
  4039. }
  4040. }
  4041. }
  4042. },
  4043. "x-codeSamples": [
  4044. {
  4045. "lang": "js",
  4046. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.disconnect({\n ...\n})"
  4047. }
  4048. ]
  4049. }
  4050. },
  4051. "/lsp": {
  4052. "get": {
  4053. "operationId": "lsp.status",
  4054. "parameters": [
  4055. {
  4056. "in": "query",
  4057. "name": "directory",
  4058. "schema": {
  4059. "type": "string"
  4060. }
  4061. }
  4062. ],
  4063. "summary": "Get LSP status",
  4064. "description": "Get LSP server status",
  4065. "responses": {
  4066. "200": {
  4067. "description": "LSP server status",
  4068. "content": {
  4069. "application/json": {
  4070. "schema": {
  4071. "type": "array",
  4072. "items": {
  4073. "$ref": "#/components/schemas/LSPStatus"
  4074. }
  4075. }
  4076. }
  4077. }
  4078. }
  4079. },
  4080. "x-codeSamples": [
  4081. {
  4082. "lang": "js",
  4083. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.lsp.status({\n ...\n})"
  4084. }
  4085. ]
  4086. }
  4087. },
  4088. "/formatter": {
  4089. "get": {
  4090. "operationId": "formatter.status",
  4091. "parameters": [
  4092. {
  4093. "in": "query",
  4094. "name": "directory",
  4095. "schema": {
  4096. "type": "string"
  4097. }
  4098. }
  4099. ],
  4100. "summary": "Get formatter status",
  4101. "description": "Get formatter status",
  4102. "responses": {
  4103. "200": {
  4104. "description": "Formatter status",
  4105. "content": {
  4106. "application/json": {
  4107. "schema": {
  4108. "type": "array",
  4109. "items": {
  4110. "$ref": "#/components/schemas/FormatterStatus"
  4111. }
  4112. }
  4113. }
  4114. }
  4115. }
  4116. },
  4117. "x-codeSamples": [
  4118. {
  4119. "lang": "js",
  4120. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.formatter.status({\n ...\n})"
  4121. }
  4122. ]
  4123. }
  4124. },
  4125. "/tui/append-prompt": {
  4126. "post": {
  4127. "operationId": "tui.appendPrompt",
  4128. "parameters": [
  4129. {
  4130. "in": "query",
  4131. "name": "directory",
  4132. "schema": {
  4133. "type": "string"
  4134. }
  4135. }
  4136. ],
  4137. "summary": "Append TUI prompt",
  4138. "description": "Append prompt to the TUI",
  4139. "responses": {
  4140. "200": {
  4141. "description": "Prompt processed successfully",
  4142. "content": {
  4143. "application/json": {
  4144. "schema": {
  4145. "type": "boolean"
  4146. }
  4147. }
  4148. }
  4149. },
  4150. "400": {
  4151. "description": "Bad request",
  4152. "content": {
  4153. "application/json": {
  4154. "schema": {
  4155. "$ref": "#/components/schemas/BadRequestError"
  4156. }
  4157. }
  4158. }
  4159. }
  4160. },
  4161. "requestBody": {
  4162. "content": {
  4163. "application/json": {
  4164. "schema": {
  4165. "type": "object",
  4166. "properties": {
  4167. "text": {
  4168. "type": "string"
  4169. }
  4170. },
  4171. "required": ["text"]
  4172. }
  4173. }
  4174. }
  4175. },
  4176. "x-codeSamples": [
  4177. {
  4178. "lang": "js",
  4179. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.appendPrompt({\n ...\n})"
  4180. }
  4181. ]
  4182. }
  4183. },
  4184. "/tui/open-help": {
  4185. "post": {
  4186. "operationId": "tui.openHelp",
  4187. "parameters": [
  4188. {
  4189. "in": "query",
  4190. "name": "directory",
  4191. "schema": {
  4192. "type": "string"
  4193. }
  4194. }
  4195. ],
  4196. "summary": "Open help dialog",
  4197. "description": "Open the help dialog in the TUI to display user assistance information.",
  4198. "responses": {
  4199. "200": {
  4200. "description": "Help dialog opened successfully",
  4201. "content": {
  4202. "application/json": {
  4203. "schema": {
  4204. "type": "boolean"
  4205. }
  4206. }
  4207. }
  4208. }
  4209. },
  4210. "x-codeSamples": [
  4211. {
  4212. "lang": "js",
  4213. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openHelp({\n ...\n})"
  4214. }
  4215. ]
  4216. }
  4217. },
  4218. "/tui/open-sessions": {
  4219. "post": {
  4220. "operationId": "tui.openSessions",
  4221. "parameters": [
  4222. {
  4223. "in": "query",
  4224. "name": "directory",
  4225. "schema": {
  4226. "type": "string"
  4227. }
  4228. }
  4229. ],
  4230. "summary": "Open sessions dialog",
  4231. "description": "Open the session dialog",
  4232. "responses": {
  4233. "200": {
  4234. "description": "Session dialog opened successfully",
  4235. "content": {
  4236. "application/json": {
  4237. "schema": {
  4238. "type": "boolean"
  4239. }
  4240. }
  4241. }
  4242. }
  4243. },
  4244. "x-codeSamples": [
  4245. {
  4246. "lang": "js",
  4247. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openSessions({\n ...\n})"
  4248. }
  4249. ]
  4250. }
  4251. },
  4252. "/tui/open-themes": {
  4253. "post": {
  4254. "operationId": "tui.openThemes",
  4255. "parameters": [
  4256. {
  4257. "in": "query",
  4258. "name": "directory",
  4259. "schema": {
  4260. "type": "string"
  4261. }
  4262. }
  4263. ],
  4264. "summary": "Open themes dialog",
  4265. "description": "Open the theme dialog",
  4266. "responses": {
  4267. "200": {
  4268. "description": "Theme dialog opened successfully",
  4269. "content": {
  4270. "application/json": {
  4271. "schema": {
  4272. "type": "boolean"
  4273. }
  4274. }
  4275. }
  4276. }
  4277. },
  4278. "x-codeSamples": [
  4279. {
  4280. "lang": "js",
  4281. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openThemes({\n ...\n})"
  4282. }
  4283. ]
  4284. }
  4285. },
  4286. "/tui/open-models": {
  4287. "post": {
  4288. "operationId": "tui.openModels",
  4289. "parameters": [
  4290. {
  4291. "in": "query",
  4292. "name": "directory",
  4293. "schema": {
  4294. "type": "string"
  4295. }
  4296. }
  4297. ],
  4298. "summary": "Open models dialog",
  4299. "description": "Open the model dialog",
  4300. "responses": {
  4301. "200": {
  4302. "description": "Model dialog opened successfully",
  4303. "content": {
  4304. "application/json": {
  4305. "schema": {
  4306. "type": "boolean"
  4307. }
  4308. }
  4309. }
  4310. }
  4311. },
  4312. "x-codeSamples": [
  4313. {
  4314. "lang": "js",
  4315. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openModels({\n ...\n})"
  4316. }
  4317. ]
  4318. }
  4319. },
  4320. "/tui/submit-prompt": {
  4321. "post": {
  4322. "operationId": "tui.submitPrompt",
  4323. "parameters": [
  4324. {
  4325. "in": "query",
  4326. "name": "directory",
  4327. "schema": {
  4328. "type": "string"
  4329. }
  4330. }
  4331. ],
  4332. "summary": "Submit TUI prompt",
  4333. "description": "Submit the prompt",
  4334. "responses": {
  4335. "200": {
  4336. "description": "Prompt submitted successfully",
  4337. "content": {
  4338. "application/json": {
  4339. "schema": {
  4340. "type": "boolean"
  4341. }
  4342. }
  4343. }
  4344. }
  4345. },
  4346. "x-codeSamples": [
  4347. {
  4348. "lang": "js",
  4349. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.submitPrompt({\n ...\n})"
  4350. }
  4351. ]
  4352. }
  4353. },
  4354. "/tui/clear-prompt": {
  4355. "post": {
  4356. "operationId": "tui.clearPrompt",
  4357. "parameters": [
  4358. {
  4359. "in": "query",
  4360. "name": "directory",
  4361. "schema": {
  4362. "type": "string"
  4363. }
  4364. }
  4365. ],
  4366. "summary": "Clear TUI prompt",
  4367. "description": "Clear the prompt",
  4368. "responses": {
  4369. "200": {
  4370. "description": "Prompt cleared successfully",
  4371. "content": {
  4372. "application/json": {
  4373. "schema": {
  4374. "type": "boolean"
  4375. }
  4376. }
  4377. }
  4378. }
  4379. },
  4380. "x-codeSamples": [
  4381. {
  4382. "lang": "js",
  4383. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.clearPrompt({\n ...\n})"
  4384. }
  4385. ]
  4386. }
  4387. },
  4388. "/tui/execute-command": {
  4389. "post": {
  4390. "operationId": "tui.executeCommand",
  4391. "parameters": [
  4392. {
  4393. "in": "query",
  4394. "name": "directory",
  4395. "schema": {
  4396. "type": "string"
  4397. }
  4398. }
  4399. ],
  4400. "summary": "Execute TUI command",
  4401. "description": "Execute a TUI command (e.g. agent_cycle)",
  4402. "responses": {
  4403. "200": {
  4404. "description": "Command executed successfully",
  4405. "content": {
  4406. "application/json": {
  4407. "schema": {
  4408. "type": "boolean"
  4409. }
  4410. }
  4411. }
  4412. },
  4413. "400": {
  4414. "description": "Bad request",
  4415. "content": {
  4416. "application/json": {
  4417. "schema": {
  4418. "$ref": "#/components/schemas/BadRequestError"
  4419. }
  4420. }
  4421. }
  4422. }
  4423. },
  4424. "requestBody": {
  4425. "content": {
  4426. "application/json": {
  4427. "schema": {
  4428. "type": "object",
  4429. "properties": {
  4430. "command": {
  4431. "type": "string"
  4432. }
  4433. },
  4434. "required": ["command"]
  4435. }
  4436. }
  4437. }
  4438. },
  4439. "x-codeSamples": [
  4440. {
  4441. "lang": "js",
  4442. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.executeCommand({\n ...\n})"
  4443. }
  4444. ]
  4445. }
  4446. },
  4447. "/tui/show-toast": {
  4448. "post": {
  4449. "operationId": "tui.showToast",
  4450. "parameters": [
  4451. {
  4452. "in": "query",
  4453. "name": "directory",
  4454. "schema": {
  4455. "type": "string"
  4456. }
  4457. }
  4458. ],
  4459. "summary": "Show TUI toast",
  4460. "description": "Show a toast notification in the TUI",
  4461. "responses": {
  4462. "200": {
  4463. "description": "Toast notification shown successfully",
  4464. "content": {
  4465. "application/json": {
  4466. "schema": {
  4467. "type": "boolean"
  4468. }
  4469. }
  4470. }
  4471. }
  4472. },
  4473. "requestBody": {
  4474. "content": {
  4475. "application/json": {
  4476. "schema": {
  4477. "type": "object",
  4478. "properties": {
  4479. "title": {
  4480. "type": "string"
  4481. },
  4482. "message": {
  4483. "type": "string"
  4484. },
  4485. "variant": {
  4486. "type": "string",
  4487. "enum": ["info", "success", "warning", "error"]
  4488. },
  4489. "duration": {
  4490. "description": "Duration in milliseconds",
  4491. "default": 5000,
  4492. "type": "number"
  4493. }
  4494. },
  4495. "required": ["message", "variant"]
  4496. }
  4497. }
  4498. }
  4499. },
  4500. "x-codeSamples": [
  4501. {
  4502. "lang": "js",
  4503. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.showToast({\n ...\n})"
  4504. }
  4505. ]
  4506. }
  4507. },
  4508. "/tui/publish": {
  4509. "post": {
  4510. "operationId": "tui.publish",
  4511. "parameters": [
  4512. {
  4513. "in": "query",
  4514. "name": "directory",
  4515. "schema": {
  4516. "type": "string"
  4517. }
  4518. }
  4519. ],
  4520. "summary": "Publish TUI event",
  4521. "description": "Publish a TUI event",
  4522. "responses": {
  4523. "200": {
  4524. "description": "Event published successfully",
  4525. "content": {
  4526. "application/json": {
  4527. "schema": {
  4528. "type": "boolean"
  4529. }
  4530. }
  4531. }
  4532. },
  4533. "400": {
  4534. "description": "Bad request",
  4535. "content": {
  4536. "application/json": {
  4537. "schema": {
  4538. "$ref": "#/components/schemas/BadRequestError"
  4539. }
  4540. }
  4541. }
  4542. }
  4543. },
  4544. "requestBody": {
  4545. "content": {
  4546. "application/json": {
  4547. "schema": {
  4548. "anyOf": [
  4549. {
  4550. "$ref": "#/components/schemas/Event.tui.prompt.append"
  4551. },
  4552. {
  4553. "$ref": "#/components/schemas/Event.tui.command.execute"
  4554. },
  4555. {
  4556. "$ref": "#/components/schemas/Event.tui.toast.show"
  4557. }
  4558. ]
  4559. }
  4560. }
  4561. }
  4562. },
  4563. "x-codeSamples": [
  4564. {
  4565. "lang": "js",
  4566. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.publish({\n ...\n})"
  4567. }
  4568. ]
  4569. }
  4570. },
  4571. "/tui/control/next": {
  4572. "get": {
  4573. "operationId": "tui.control.next",
  4574. "parameters": [
  4575. {
  4576. "in": "query",
  4577. "name": "directory",
  4578. "schema": {
  4579. "type": "string"
  4580. }
  4581. }
  4582. ],
  4583. "summary": "Get next TUI request",
  4584. "description": "Retrieve the next TUI (Terminal User Interface) request from the queue for processing.",
  4585. "responses": {
  4586. "200": {
  4587. "description": "Next TUI request",
  4588. "content": {
  4589. "application/json": {
  4590. "schema": {
  4591. "type": "object",
  4592. "properties": {
  4593. "path": {
  4594. "type": "string"
  4595. },
  4596. "body": {}
  4597. },
  4598. "required": ["path", "body"]
  4599. }
  4600. }
  4601. }
  4602. }
  4603. },
  4604. "x-codeSamples": [
  4605. {
  4606. "lang": "js",
  4607. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.control.next({\n ...\n})"
  4608. }
  4609. ]
  4610. }
  4611. },
  4612. "/tui/control/response": {
  4613. "post": {
  4614. "operationId": "tui.control.response",
  4615. "parameters": [
  4616. {
  4617. "in": "query",
  4618. "name": "directory",
  4619. "schema": {
  4620. "type": "string"
  4621. }
  4622. }
  4623. ],
  4624. "summary": "Submit TUI response",
  4625. "description": "Submit a response to the TUI request queue to complete a pending request.",
  4626. "responses": {
  4627. "200": {
  4628. "description": "Response submitted successfully",
  4629. "content": {
  4630. "application/json": {
  4631. "schema": {
  4632. "type": "boolean"
  4633. }
  4634. }
  4635. }
  4636. }
  4637. },
  4638. "requestBody": {
  4639. "content": {
  4640. "application/json": {
  4641. "schema": {}
  4642. }
  4643. }
  4644. },
  4645. "x-codeSamples": [
  4646. {
  4647. "lang": "js",
  4648. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.control.response({\n ...\n})"
  4649. }
  4650. ]
  4651. }
  4652. },
  4653. "/auth/{providerID}": {
  4654. "put": {
  4655. "operationId": "auth.set",
  4656. "parameters": [
  4657. {
  4658. "in": "query",
  4659. "name": "directory",
  4660. "schema": {
  4661. "type": "string"
  4662. }
  4663. },
  4664. {
  4665. "in": "path",
  4666. "name": "providerID",
  4667. "schema": {
  4668. "type": "string"
  4669. },
  4670. "required": true
  4671. }
  4672. ],
  4673. "summary": "Set auth credentials",
  4674. "description": "Set authentication credentials",
  4675. "responses": {
  4676. "200": {
  4677. "description": "Successfully set authentication credentials",
  4678. "content": {
  4679. "application/json": {
  4680. "schema": {
  4681. "type": "boolean"
  4682. }
  4683. }
  4684. }
  4685. },
  4686. "400": {
  4687. "description": "Bad request",
  4688. "content": {
  4689. "application/json": {
  4690. "schema": {
  4691. "$ref": "#/components/schemas/BadRequestError"
  4692. }
  4693. }
  4694. }
  4695. }
  4696. },
  4697. "requestBody": {
  4698. "content": {
  4699. "application/json": {
  4700. "schema": {
  4701. "$ref": "#/components/schemas/Auth"
  4702. }
  4703. }
  4704. }
  4705. },
  4706. "x-codeSamples": [
  4707. {
  4708. "lang": "js",
  4709. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.auth.set({\n ...\n})"
  4710. }
  4711. ]
  4712. }
  4713. },
  4714. "/event": {
  4715. "get": {
  4716. "operationId": "event.subscribe",
  4717. "parameters": [
  4718. {
  4719. "in": "query",
  4720. "name": "directory",
  4721. "schema": {
  4722. "type": "string"
  4723. }
  4724. }
  4725. ],
  4726. "summary": "Subscribe to events",
  4727. "description": "Get events",
  4728. "responses": {
  4729. "200": {
  4730. "description": "Event stream",
  4731. "content": {
  4732. "text/event-stream": {
  4733. "schema": {
  4734. "$ref": "#/components/schemas/Event"
  4735. }
  4736. }
  4737. }
  4738. }
  4739. },
  4740. "x-codeSamples": [
  4741. {
  4742. "lang": "js",
  4743. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.event.subscribe({\n ...\n})"
  4744. }
  4745. ]
  4746. }
  4747. }
  4748. },
  4749. "components": {
  4750. "schemas": {
  4751. "Event.installation.updated": {
  4752. "type": "object",
  4753. "properties": {
  4754. "type": {
  4755. "type": "string",
  4756. "const": "installation.updated"
  4757. },
  4758. "properties": {
  4759. "type": "object",
  4760. "properties": {
  4761. "version": {
  4762. "type": "string"
  4763. }
  4764. },
  4765. "required": ["version"]
  4766. }
  4767. },
  4768. "required": ["type", "properties"]
  4769. },
  4770. "Event.installation.update-available": {
  4771. "type": "object",
  4772. "properties": {
  4773. "type": {
  4774. "type": "string",
  4775. "const": "installation.update-available"
  4776. },
  4777. "properties": {
  4778. "type": "object",
  4779. "properties": {
  4780. "version": {
  4781. "type": "string"
  4782. }
  4783. },
  4784. "required": ["version"]
  4785. }
  4786. },
  4787. "required": ["type", "properties"]
  4788. },
  4789. "Project": {
  4790. "type": "object",
  4791. "properties": {
  4792. "id": {
  4793. "type": "string"
  4794. },
  4795. "worktree": {
  4796. "type": "string"
  4797. },
  4798. "vcs": {
  4799. "type": "string",
  4800. "const": "git"
  4801. },
  4802. "name": {
  4803. "type": "string"
  4804. },
  4805. "icon": {
  4806. "type": "object",
  4807. "properties": {
  4808. "url": {
  4809. "type": "string"
  4810. },
  4811. "color": {
  4812. "type": "string"
  4813. }
  4814. }
  4815. },
  4816. "time": {
  4817. "type": "object",
  4818. "properties": {
  4819. "created": {
  4820. "type": "number"
  4821. },
  4822. "updated": {
  4823. "type": "number"
  4824. },
  4825. "initialized": {
  4826. "type": "number"
  4827. }
  4828. },
  4829. "required": ["created", "updated"]
  4830. }
  4831. },
  4832. "required": ["id", "worktree", "time"]
  4833. },
  4834. "Event.project.updated": {
  4835. "type": "object",
  4836. "properties": {
  4837. "type": {
  4838. "type": "string",
  4839. "const": "project.updated"
  4840. },
  4841. "properties": {
  4842. "$ref": "#/components/schemas/Project"
  4843. }
  4844. },
  4845. "required": ["type", "properties"]
  4846. },
  4847. "Event.server.instance.disposed": {
  4848. "type": "object",
  4849. "properties": {
  4850. "type": {
  4851. "type": "string",
  4852. "const": "server.instance.disposed"
  4853. },
  4854. "properties": {
  4855. "type": "object",
  4856. "properties": {
  4857. "directory": {
  4858. "type": "string"
  4859. }
  4860. },
  4861. "required": ["directory"]
  4862. }
  4863. },
  4864. "required": ["type", "properties"]
  4865. },
  4866. "Event.lsp.client.diagnostics": {
  4867. "type": "object",
  4868. "properties": {
  4869. "type": {
  4870. "type": "string",
  4871. "const": "lsp.client.diagnostics"
  4872. },
  4873. "properties": {
  4874. "type": "object",
  4875. "properties": {
  4876. "serverID": {
  4877. "type": "string"
  4878. },
  4879. "path": {
  4880. "type": "string"
  4881. }
  4882. },
  4883. "required": ["serverID", "path"]
  4884. }
  4885. },
  4886. "required": ["type", "properties"]
  4887. },
  4888. "Event.lsp.updated": {
  4889. "type": "object",
  4890. "properties": {
  4891. "type": {
  4892. "type": "string",
  4893. "const": "lsp.updated"
  4894. },
  4895. "properties": {
  4896. "type": "object",
  4897. "properties": {}
  4898. }
  4899. },
  4900. "required": ["type", "properties"]
  4901. },
  4902. "FileDiff": {
  4903. "type": "object",
  4904. "properties": {
  4905. "file": {
  4906. "type": "string"
  4907. },
  4908. "before": {
  4909. "type": "string"
  4910. },
  4911. "after": {
  4912. "type": "string"
  4913. },
  4914. "additions": {
  4915. "type": "number"
  4916. },
  4917. "deletions": {
  4918. "type": "number"
  4919. }
  4920. },
  4921. "required": ["file", "before", "after", "additions", "deletions"]
  4922. },
  4923. "UserMessage": {
  4924. "type": "object",
  4925. "properties": {
  4926. "id": {
  4927. "type": "string"
  4928. },
  4929. "sessionID": {
  4930. "type": "string"
  4931. },
  4932. "role": {
  4933. "type": "string",
  4934. "const": "user"
  4935. },
  4936. "time": {
  4937. "type": "object",
  4938. "properties": {
  4939. "created": {
  4940. "type": "number"
  4941. }
  4942. },
  4943. "required": ["created"]
  4944. },
  4945. "summary": {
  4946. "type": "object",
  4947. "properties": {
  4948. "title": {
  4949. "type": "string"
  4950. },
  4951. "body": {
  4952. "type": "string"
  4953. },
  4954. "diffs": {
  4955. "type": "array",
  4956. "items": {
  4957. "$ref": "#/components/schemas/FileDiff"
  4958. }
  4959. }
  4960. },
  4961. "required": ["diffs"]
  4962. },
  4963. "agent": {
  4964. "type": "string"
  4965. },
  4966. "model": {
  4967. "type": "object",
  4968. "properties": {
  4969. "providerID": {
  4970. "type": "string"
  4971. },
  4972. "modelID": {
  4973. "type": "string"
  4974. }
  4975. },
  4976. "required": ["providerID", "modelID"]
  4977. },
  4978. "system": {
  4979. "type": "string"
  4980. },
  4981. "tools": {
  4982. "type": "object",
  4983. "propertyNames": {
  4984. "type": "string"
  4985. },
  4986. "additionalProperties": {
  4987. "type": "boolean"
  4988. }
  4989. }
  4990. },
  4991. "required": ["id", "sessionID", "role", "time", "agent", "model"]
  4992. },
  4993. "ProviderAuthError": {
  4994. "type": "object",
  4995. "properties": {
  4996. "name": {
  4997. "type": "string",
  4998. "const": "ProviderAuthError"
  4999. },
  5000. "data": {
  5001. "type": "object",
  5002. "properties": {
  5003. "providerID": {
  5004. "type": "string"
  5005. },
  5006. "message": {
  5007. "type": "string"
  5008. }
  5009. },
  5010. "required": ["providerID", "message"]
  5011. }
  5012. },
  5013. "required": ["name", "data"]
  5014. },
  5015. "UnknownError": {
  5016. "type": "object",
  5017. "properties": {
  5018. "name": {
  5019. "type": "string",
  5020. "const": "UnknownError"
  5021. },
  5022. "data": {
  5023. "type": "object",
  5024. "properties": {
  5025. "message": {
  5026. "type": "string"
  5027. }
  5028. },
  5029. "required": ["message"]
  5030. }
  5031. },
  5032. "required": ["name", "data"]
  5033. },
  5034. "MessageOutputLengthError": {
  5035. "type": "object",
  5036. "properties": {
  5037. "name": {
  5038. "type": "string",
  5039. "const": "MessageOutputLengthError"
  5040. },
  5041. "data": {
  5042. "type": "object",
  5043. "properties": {}
  5044. }
  5045. },
  5046. "required": ["name", "data"]
  5047. },
  5048. "MessageAbortedError": {
  5049. "type": "object",
  5050. "properties": {
  5051. "name": {
  5052. "type": "string",
  5053. "const": "MessageAbortedError"
  5054. },
  5055. "data": {
  5056. "type": "object",
  5057. "properties": {
  5058. "message": {
  5059. "type": "string"
  5060. }
  5061. },
  5062. "required": ["message"]
  5063. }
  5064. },
  5065. "required": ["name", "data"]
  5066. },
  5067. "APIError": {
  5068. "type": "object",
  5069. "properties": {
  5070. "name": {
  5071. "type": "string",
  5072. "const": "APIError"
  5073. },
  5074. "data": {
  5075. "type": "object",
  5076. "properties": {
  5077. "message": {
  5078. "type": "string"
  5079. },
  5080. "statusCode": {
  5081. "type": "number"
  5082. },
  5083. "isRetryable": {
  5084. "type": "boolean"
  5085. },
  5086. "responseHeaders": {
  5087. "type": "object",
  5088. "propertyNames": {
  5089. "type": "string"
  5090. },
  5091. "additionalProperties": {
  5092. "type": "string"
  5093. }
  5094. },
  5095. "responseBody": {
  5096. "type": "string"
  5097. }
  5098. },
  5099. "required": ["message", "isRetryable"]
  5100. }
  5101. },
  5102. "required": ["name", "data"]
  5103. },
  5104. "AssistantMessage": {
  5105. "type": "object",
  5106. "properties": {
  5107. "id": {
  5108. "type": "string"
  5109. },
  5110. "sessionID": {
  5111. "type": "string"
  5112. },
  5113. "role": {
  5114. "type": "string",
  5115. "const": "assistant"
  5116. },
  5117. "time": {
  5118. "type": "object",
  5119. "properties": {
  5120. "created": {
  5121. "type": "number"
  5122. },
  5123. "completed": {
  5124. "type": "number"
  5125. }
  5126. },
  5127. "required": ["created"]
  5128. },
  5129. "error": {
  5130. "anyOf": [
  5131. {
  5132. "$ref": "#/components/schemas/ProviderAuthError"
  5133. },
  5134. {
  5135. "$ref": "#/components/schemas/UnknownError"
  5136. },
  5137. {
  5138. "$ref": "#/components/schemas/MessageOutputLengthError"
  5139. },
  5140. {
  5141. "$ref": "#/components/schemas/MessageAbortedError"
  5142. },
  5143. {
  5144. "$ref": "#/components/schemas/APIError"
  5145. }
  5146. ]
  5147. },
  5148. "parentID": {
  5149. "type": "string"
  5150. },
  5151. "modelID": {
  5152. "type": "string"
  5153. },
  5154. "providerID": {
  5155. "type": "string"
  5156. },
  5157. "mode": {
  5158. "type": "string"
  5159. },
  5160. "path": {
  5161. "type": "object",
  5162. "properties": {
  5163. "cwd": {
  5164. "type": "string"
  5165. },
  5166. "root": {
  5167. "type": "string"
  5168. }
  5169. },
  5170. "required": ["cwd", "root"]
  5171. },
  5172. "summary": {
  5173. "type": "boolean"
  5174. },
  5175. "cost": {
  5176. "type": "number"
  5177. },
  5178. "tokens": {
  5179. "type": "object",
  5180. "properties": {
  5181. "input": {
  5182. "type": "number"
  5183. },
  5184. "output": {
  5185. "type": "number"
  5186. },
  5187. "reasoning": {
  5188. "type": "number"
  5189. },
  5190. "cache": {
  5191. "type": "object",
  5192. "properties": {
  5193. "read": {
  5194. "type": "number"
  5195. },
  5196. "write": {
  5197. "type": "number"
  5198. }
  5199. },
  5200. "required": ["read", "write"]
  5201. }
  5202. },
  5203. "required": ["input", "output", "reasoning", "cache"]
  5204. },
  5205. "finish": {
  5206. "type": "string"
  5207. }
  5208. },
  5209. "required": [
  5210. "id",
  5211. "sessionID",
  5212. "role",
  5213. "time",
  5214. "parentID",
  5215. "modelID",
  5216. "providerID",
  5217. "mode",
  5218. "path",
  5219. "cost",
  5220. "tokens"
  5221. ]
  5222. },
  5223. "Message": {
  5224. "anyOf": [
  5225. {
  5226. "$ref": "#/components/schemas/UserMessage"
  5227. },
  5228. {
  5229. "$ref": "#/components/schemas/AssistantMessage"
  5230. }
  5231. ]
  5232. },
  5233. "Event.message.updated": {
  5234. "type": "object",
  5235. "properties": {
  5236. "type": {
  5237. "type": "string",
  5238. "const": "message.updated"
  5239. },
  5240. "properties": {
  5241. "type": "object",
  5242. "properties": {
  5243. "info": {
  5244. "$ref": "#/components/schemas/Message"
  5245. }
  5246. },
  5247. "required": ["info"]
  5248. }
  5249. },
  5250. "required": ["type", "properties"]
  5251. },
  5252. "Event.message.removed": {
  5253. "type": "object",
  5254. "properties": {
  5255. "type": {
  5256. "type": "string",
  5257. "const": "message.removed"
  5258. },
  5259. "properties": {
  5260. "type": "object",
  5261. "properties": {
  5262. "sessionID": {
  5263. "type": "string"
  5264. },
  5265. "messageID": {
  5266. "type": "string"
  5267. }
  5268. },
  5269. "required": ["sessionID", "messageID"]
  5270. }
  5271. },
  5272. "required": ["type", "properties"]
  5273. },
  5274. "TextPart": {
  5275. "type": "object",
  5276. "properties": {
  5277. "id": {
  5278. "type": "string"
  5279. },
  5280. "sessionID": {
  5281. "type": "string"
  5282. },
  5283. "messageID": {
  5284. "type": "string"
  5285. },
  5286. "type": {
  5287. "type": "string",
  5288. "const": "text"
  5289. },
  5290. "text": {
  5291. "type": "string"
  5292. },
  5293. "synthetic": {
  5294. "type": "boolean"
  5295. },
  5296. "ignored": {
  5297. "type": "boolean"
  5298. },
  5299. "time": {
  5300. "type": "object",
  5301. "properties": {
  5302. "start": {
  5303. "type": "number"
  5304. },
  5305. "end": {
  5306. "type": "number"
  5307. }
  5308. },
  5309. "required": ["start"]
  5310. },
  5311. "metadata": {
  5312. "type": "object",
  5313. "propertyNames": {
  5314. "type": "string"
  5315. },
  5316. "additionalProperties": {}
  5317. }
  5318. },
  5319. "required": ["id", "sessionID", "messageID", "type", "text"]
  5320. },
  5321. "ReasoningPart": {
  5322. "type": "object",
  5323. "properties": {
  5324. "id": {
  5325. "type": "string"
  5326. },
  5327. "sessionID": {
  5328. "type": "string"
  5329. },
  5330. "messageID": {
  5331. "type": "string"
  5332. },
  5333. "type": {
  5334. "type": "string",
  5335. "const": "reasoning"
  5336. },
  5337. "text": {
  5338. "type": "string"
  5339. },
  5340. "metadata": {
  5341. "type": "object",
  5342. "propertyNames": {
  5343. "type": "string"
  5344. },
  5345. "additionalProperties": {}
  5346. },
  5347. "time": {
  5348. "type": "object",
  5349. "properties": {
  5350. "start": {
  5351. "type": "number"
  5352. },
  5353. "end": {
  5354. "type": "number"
  5355. }
  5356. },
  5357. "required": ["start"]
  5358. }
  5359. },
  5360. "required": ["id", "sessionID", "messageID", "type", "text", "time"]
  5361. },
  5362. "FilePartSourceText": {
  5363. "type": "object",
  5364. "properties": {
  5365. "value": {
  5366. "type": "string"
  5367. },
  5368. "start": {
  5369. "type": "integer",
  5370. "minimum": -9007199254740991,
  5371. "maximum": 9007199254740991
  5372. },
  5373. "end": {
  5374. "type": "integer",
  5375. "minimum": -9007199254740991,
  5376. "maximum": 9007199254740991
  5377. }
  5378. },
  5379. "required": ["value", "start", "end"]
  5380. },
  5381. "FileSource": {
  5382. "type": "object",
  5383. "properties": {
  5384. "text": {
  5385. "$ref": "#/components/schemas/FilePartSourceText"
  5386. },
  5387. "type": {
  5388. "type": "string",
  5389. "const": "file"
  5390. },
  5391. "path": {
  5392. "type": "string"
  5393. }
  5394. },
  5395. "required": ["text", "type", "path"]
  5396. },
  5397. "Range": {
  5398. "type": "object",
  5399. "properties": {
  5400. "start": {
  5401. "type": "object",
  5402. "properties": {
  5403. "line": {
  5404. "type": "number"
  5405. },
  5406. "character": {
  5407. "type": "number"
  5408. }
  5409. },
  5410. "required": ["line", "character"]
  5411. },
  5412. "end": {
  5413. "type": "object",
  5414. "properties": {
  5415. "line": {
  5416. "type": "number"
  5417. },
  5418. "character": {
  5419. "type": "number"
  5420. }
  5421. },
  5422. "required": ["line", "character"]
  5423. }
  5424. },
  5425. "required": ["start", "end"]
  5426. },
  5427. "SymbolSource": {
  5428. "type": "object",
  5429. "properties": {
  5430. "text": {
  5431. "$ref": "#/components/schemas/FilePartSourceText"
  5432. },
  5433. "type": {
  5434. "type": "string",
  5435. "const": "symbol"
  5436. },
  5437. "path": {
  5438. "type": "string"
  5439. },
  5440. "range": {
  5441. "$ref": "#/components/schemas/Range"
  5442. },
  5443. "name": {
  5444. "type": "string"
  5445. },
  5446. "kind": {
  5447. "type": "integer",
  5448. "minimum": -9007199254740991,
  5449. "maximum": 9007199254740991
  5450. }
  5451. },
  5452. "required": ["text", "type", "path", "range", "name", "kind"]
  5453. },
  5454. "FilePartSource": {
  5455. "anyOf": [
  5456. {
  5457. "$ref": "#/components/schemas/FileSource"
  5458. },
  5459. {
  5460. "$ref": "#/components/schemas/SymbolSource"
  5461. }
  5462. ]
  5463. },
  5464. "FilePart": {
  5465. "type": "object",
  5466. "properties": {
  5467. "id": {
  5468. "type": "string"
  5469. },
  5470. "sessionID": {
  5471. "type": "string"
  5472. },
  5473. "messageID": {
  5474. "type": "string"
  5475. },
  5476. "type": {
  5477. "type": "string",
  5478. "const": "file"
  5479. },
  5480. "mime": {
  5481. "type": "string"
  5482. },
  5483. "filename": {
  5484. "type": "string"
  5485. },
  5486. "url": {
  5487. "type": "string"
  5488. },
  5489. "source": {
  5490. "$ref": "#/components/schemas/FilePartSource"
  5491. }
  5492. },
  5493. "required": ["id", "sessionID", "messageID", "type", "mime", "url"]
  5494. },
  5495. "ToolStatePending": {
  5496. "type": "object",
  5497. "properties": {
  5498. "status": {
  5499. "type": "string",
  5500. "const": "pending"
  5501. },
  5502. "input": {
  5503. "type": "object",
  5504. "propertyNames": {
  5505. "type": "string"
  5506. },
  5507. "additionalProperties": {}
  5508. },
  5509. "raw": {
  5510. "type": "string"
  5511. }
  5512. },
  5513. "required": ["status", "input", "raw"]
  5514. },
  5515. "ToolStateRunning": {
  5516. "type": "object",
  5517. "properties": {
  5518. "status": {
  5519. "type": "string",
  5520. "const": "running"
  5521. },
  5522. "input": {
  5523. "type": "object",
  5524. "propertyNames": {
  5525. "type": "string"
  5526. },
  5527. "additionalProperties": {}
  5528. },
  5529. "title": {
  5530. "type": "string"
  5531. },
  5532. "metadata": {
  5533. "type": "object",
  5534. "propertyNames": {
  5535. "type": "string"
  5536. },
  5537. "additionalProperties": {}
  5538. },
  5539. "time": {
  5540. "type": "object",
  5541. "properties": {
  5542. "start": {
  5543. "type": "number"
  5544. }
  5545. },
  5546. "required": ["start"]
  5547. }
  5548. },
  5549. "required": ["status", "input", "time"]
  5550. },
  5551. "ToolStateCompleted": {
  5552. "type": "object",
  5553. "properties": {
  5554. "status": {
  5555. "type": "string",
  5556. "const": "completed"
  5557. },
  5558. "input": {
  5559. "type": "object",
  5560. "propertyNames": {
  5561. "type": "string"
  5562. },
  5563. "additionalProperties": {}
  5564. },
  5565. "output": {
  5566. "type": "string"
  5567. },
  5568. "title": {
  5569. "type": "string"
  5570. },
  5571. "metadata": {
  5572. "type": "object",
  5573. "propertyNames": {
  5574. "type": "string"
  5575. },
  5576. "additionalProperties": {}
  5577. },
  5578. "time": {
  5579. "type": "object",
  5580. "properties": {
  5581. "start": {
  5582. "type": "number"
  5583. },
  5584. "end": {
  5585. "type": "number"
  5586. },
  5587. "compacted": {
  5588. "type": "number"
  5589. }
  5590. },
  5591. "required": ["start", "end"]
  5592. },
  5593. "attachments": {
  5594. "type": "array",
  5595. "items": {
  5596. "$ref": "#/components/schemas/FilePart"
  5597. }
  5598. }
  5599. },
  5600. "required": ["status", "input", "output", "title", "metadata", "time"]
  5601. },
  5602. "ToolStateError": {
  5603. "type": "object",
  5604. "properties": {
  5605. "status": {
  5606. "type": "string",
  5607. "const": "error"
  5608. },
  5609. "input": {
  5610. "type": "object",
  5611. "propertyNames": {
  5612. "type": "string"
  5613. },
  5614. "additionalProperties": {}
  5615. },
  5616. "error": {
  5617. "type": "string"
  5618. },
  5619. "metadata": {
  5620. "type": "object",
  5621. "propertyNames": {
  5622. "type": "string"
  5623. },
  5624. "additionalProperties": {}
  5625. },
  5626. "time": {
  5627. "type": "object",
  5628. "properties": {
  5629. "start": {
  5630. "type": "number"
  5631. },
  5632. "end": {
  5633. "type": "number"
  5634. }
  5635. },
  5636. "required": ["start", "end"]
  5637. }
  5638. },
  5639. "required": ["status", "input", "error", "time"]
  5640. },
  5641. "ToolState": {
  5642. "anyOf": [
  5643. {
  5644. "$ref": "#/components/schemas/ToolStatePending"
  5645. },
  5646. {
  5647. "$ref": "#/components/schemas/ToolStateRunning"
  5648. },
  5649. {
  5650. "$ref": "#/components/schemas/ToolStateCompleted"
  5651. },
  5652. {
  5653. "$ref": "#/components/schemas/ToolStateError"
  5654. }
  5655. ]
  5656. },
  5657. "ToolPart": {
  5658. "type": "object",
  5659. "properties": {
  5660. "id": {
  5661. "type": "string"
  5662. },
  5663. "sessionID": {
  5664. "type": "string"
  5665. },
  5666. "messageID": {
  5667. "type": "string"
  5668. },
  5669. "type": {
  5670. "type": "string",
  5671. "const": "tool"
  5672. },
  5673. "callID": {
  5674. "type": "string"
  5675. },
  5676. "tool": {
  5677. "type": "string"
  5678. },
  5679. "state": {
  5680. "$ref": "#/components/schemas/ToolState"
  5681. },
  5682. "metadata": {
  5683. "type": "object",
  5684. "propertyNames": {
  5685. "type": "string"
  5686. },
  5687. "additionalProperties": {}
  5688. }
  5689. },
  5690. "required": ["id", "sessionID", "messageID", "type", "callID", "tool", "state"]
  5691. },
  5692. "StepStartPart": {
  5693. "type": "object",
  5694. "properties": {
  5695. "id": {
  5696. "type": "string"
  5697. },
  5698. "sessionID": {
  5699. "type": "string"
  5700. },
  5701. "messageID": {
  5702. "type": "string"
  5703. },
  5704. "type": {
  5705. "type": "string",
  5706. "const": "step-start"
  5707. },
  5708. "snapshot": {
  5709. "type": "string"
  5710. }
  5711. },
  5712. "required": ["id", "sessionID", "messageID", "type"]
  5713. },
  5714. "StepFinishPart": {
  5715. "type": "object",
  5716. "properties": {
  5717. "id": {
  5718. "type": "string"
  5719. },
  5720. "sessionID": {
  5721. "type": "string"
  5722. },
  5723. "messageID": {
  5724. "type": "string"
  5725. },
  5726. "type": {
  5727. "type": "string",
  5728. "const": "step-finish"
  5729. },
  5730. "reason": {
  5731. "type": "string"
  5732. },
  5733. "snapshot": {
  5734. "type": "string"
  5735. },
  5736. "cost": {
  5737. "type": "number"
  5738. },
  5739. "tokens": {
  5740. "type": "object",
  5741. "properties": {
  5742. "input": {
  5743. "type": "number"
  5744. },
  5745. "output": {
  5746. "type": "number"
  5747. },
  5748. "reasoning": {
  5749. "type": "number"
  5750. },
  5751. "cache": {
  5752. "type": "object",
  5753. "properties": {
  5754. "read": {
  5755. "type": "number"
  5756. },
  5757. "write": {
  5758. "type": "number"
  5759. }
  5760. },
  5761. "required": ["read", "write"]
  5762. }
  5763. },
  5764. "required": ["input", "output", "reasoning", "cache"]
  5765. }
  5766. },
  5767. "required": ["id", "sessionID", "messageID", "type", "reason", "cost", "tokens"]
  5768. },
  5769. "SnapshotPart": {
  5770. "type": "object",
  5771. "properties": {
  5772. "id": {
  5773. "type": "string"
  5774. },
  5775. "sessionID": {
  5776. "type": "string"
  5777. },
  5778. "messageID": {
  5779. "type": "string"
  5780. },
  5781. "type": {
  5782. "type": "string",
  5783. "const": "snapshot"
  5784. },
  5785. "snapshot": {
  5786. "type": "string"
  5787. }
  5788. },
  5789. "required": ["id", "sessionID", "messageID", "type", "snapshot"]
  5790. },
  5791. "PatchPart": {
  5792. "type": "object",
  5793. "properties": {
  5794. "id": {
  5795. "type": "string"
  5796. },
  5797. "sessionID": {
  5798. "type": "string"
  5799. },
  5800. "messageID": {
  5801. "type": "string"
  5802. },
  5803. "type": {
  5804. "type": "string",
  5805. "const": "patch"
  5806. },
  5807. "hash": {
  5808. "type": "string"
  5809. },
  5810. "files": {
  5811. "type": "array",
  5812. "items": {
  5813. "type": "string"
  5814. }
  5815. }
  5816. },
  5817. "required": ["id", "sessionID", "messageID", "type", "hash", "files"]
  5818. },
  5819. "AgentPart": {
  5820. "type": "object",
  5821. "properties": {
  5822. "id": {
  5823. "type": "string"
  5824. },
  5825. "sessionID": {
  5826. "type": "string"
  5827. },
  5828. "messageID": {
  5829. "type": "string"
  5830. },
  5831. "type": {
  5832. "type": "string",
  5833. "const": "agent"
  5834. },
  5835. "name": {
  5836. "type": "string"
  5837. },
  5838. "source": {
  5839. "type": "object",
  5840. "properties": {
  5841. "value": {
  5842. "type": "string"
  5843. },
  5844. "start": {
  5845. "type": "integer",
  5846. "minimum": -9007199254740991,
  5847. "maximum": 9007199254740991
  5848. },
  5849. "end": {
  5850. "type": "integer",
  5851. "minimum": -9007199254740991,
  5852. "maximum": 9007199254740991
  5853. }
  5854. },
  5855. "required": ["value", "start", "end"]
  5856. }
  5857. },
  5858. "required": ["id", "sessionID", "messageID", "type", "name"]
  5859. },
  5860. "RetryPart": {
  5861. "type": "object",
  5862. "properties": {
  5863. "id": {
  5864. "type": "string"
  5865. },
  5866. "sessionID": {
  5867. "type": "string"
  5868. },
  5869. "messageID": {
  5870. "type": "string"
  5871. },
  5872. "type": {
  5873. "type": "string",
  5874. "const": "retry"
  5875. },
  5876. "attempt": {
  5877. "type": "number"
  5878. },
  5879. "error": {
  5880. "$ref": "#/components/schemas/APIError"
  5881. },
  5882. "time": {
  5883. "type": "object",
  5884. "properties": {
  5885. "created": {
  5886. "type": "number"
  5887. }
  5888. },
  5889. "required": ["created"]
  5890. }
  5891. },
  5892. "required": ["id", "sessionID", "messageID", "type", "attempt", "error", "time"]
  5893. },
  5894. "CompactionPart": {
  5895. "type": "object",
  5896. "properties": {
  5897. "id": {
  5898. "type": "string"
  5899. },
  5900. "sessionID": {
  5901. "type": "string"
  5902. },
  5903. "messageID": {
  5904. "type": "string"
  5905. },
  5906. "type": {
  5907. "type": "string",
  5908. "const": "compaction"
  5909. },
  5910. "auto": {
  5911. "type": "boolean"
  5912. }
  5913. },
  5914. "required": ["id", "sessionID", "messageID", "type", "auto"]
  5915. },
  5916. "Part": {
  5917. "anyOf": [
  5918. {
  5919. "$ref": "#/components/schemas/TextPart"
  5920. },
  5921. {
  5922. "type": "object",
  5923. "properties": {
  5924. "id": {
  5925. "type": "string"
  5926. },
  5927. "sessionID": {
  5928. "type": "string"
  5929. },
  5930. "messageID": {
  5931. "type": "string"
  5932. },
  5933. "type": {
  5934. "type": "string",
  5935. "const": "subtask"
  5936. },
  5937. "prompt": {
  5938. "type": "string"
  5939. },
  5940. "description": {
  5941. "type": "string"
  5942. },
  5943. "agent": {
  5944. "type": "string"
  5945. }
  5946. },
  5947. "required": ["id", "sessionID", "messageID", "type", "prompt", "description", "agent"]
  5948. },
  5949. {
  5950. "$ref": "#/components/schemas/ReasoningPart"
  5951. },
  5952. {
  5953. "$ref": "#/components/schemas/FilePart"
  5954. },
  5955. {
  5956. "$ref": "#/components/schemas/ToolPart"
  5957. },
  5958. {
  5959. "$ref": "#/components/schemas/StepStartPart"
  5960. },
  5961. {
  5962. "$ref": "#/components/schemas/StepFinishPart"
  5963. },
  5964. {
  5965. "$ref": "#/components/schemas/SnapshotPart"
  5966. },
  5967. {
  5968. "$ref": "#/components/schemas/PatchPart"
  5969. },
  5970. {
  5971. "$ref": "#/components/schemas/AgentPart"
  5972. },
  5973. {
  5974. "$ref": "#/components/schemas/RetryPart"
  5975. },
  5976. {
  5977. "$ref": "#/components/schemas/CompactionPart"
  5978. }
  5979. ]
  5980. },
  5981. "Event.message.part.updated": {
  5982. "type": "object",
  5983. "properties": {
  5984. "type": {
  5985. "type": "string",
  5986. "const": "message.part.updated"
  5987. },
  5988. "properties": {
  5989. "type": "object",
  5990. "properties": {
  5991. "part": {
  5992. "$ref": "#/components/schemas/Part"
  5993. },
  5994. "delta": {
  5995. "type": "string"
  5996. }
  5997. },
  5998. "required": ["part"]
  5999. }
  6000. },
  6001. "required": ["type", "properties"]
  6002. },
  6003. "Event.message.part.removed": {
  6004. "type": "object",
  6005. "properties": {
  6006. "type": {
  6007. "type": "string",
  6008. "const": "message.part.removed"
  6009. },
  6010. "properties": {
  6011. "type": "object",
  6012. "properties": {
  6013. "sessionID": {
  6014. "type": "string"
  6015. },
  6016. "messageID": {
  6017. "type": "string"
  6018. },
  6019. "partID": {
  6020. "type": "string"
  6021. }
  6022. },
  6023. "required": ["sessionID", "messageID", "partID"]
  6024. }
  6025. },
  6026. "required": ["type", "properties"]
  6027. },
  6028. "Permission": {
  6029. "type": "object",
  6030. "properties": {
  6031. "id": {
  6032. "type": "string"
  6033. },
  6034. "type": {
  6035. "type": "string"
  6036. },
  6037. "pattern": {
  6038. "anyOf": [
  6039. {
  6040. "type": "string"
  6041. },
  6042. {
  6043. "type": "array",
  6044. "items": {
  6045. "type": "string"
  6046. }
  6047. }
  6048. ]
  6049. },
  6050. "sessionID": {
  6051. "type": "string"
  6052. },
  6053. "messageID": {
  6054. "type": "string"
  6055. },
  6056. "callID": {
  6057. "type": "string"
  6058. },
  6059. "title": {
  6060. "type": "string"
  6061. },
  6062. "metadata": {
  6063. "type": "object",
  6064. "propertyNames": {
  6065. "type": "string"
  6066. },
  6067. "additionalProperties": {}
  6068. },
  6069. "time": {
  6070. "type": "object",
  6071. "properties": {
  6072. "created": {
  6073. "type": "number"
  6074. }
  6075. },
  6076. "required": ["created"]
  6077. }
  6078. },
  6079. "required": ["id", "type", "sessionID", "messageID", "title", "metadata", "time"]
  6080. },
  6081. "Event.permission.updated": {
  6082. "type": "object",
  6083. "properties": {
  6084. "type": {
  6085. "type": "string",
  6086. "const": "permission.updated"
  6087. },
  6088. "properties": {
  6089. "$ref": "#/components/schemas/Permission"
  6090. }
  6091. },
  6092. "required": ["type", "properties"]
  6093. },
  6094. "Event.permission.replied": {
  6095. "type": "object",
  6096. "properties": {
  6097. "type": {
  6098. "type": "string",
  6099. "const": "permission.replied"
  6100. },
  6101. "properties": {
  6102. "type": "object",
  6103. "properties": {
  6104. "sessionID": {
  6105. "type": "string"
  6106. },
  6107. "permissionID": {
  6108. "type": "string"
  6109. },
  6110. "response": {
  6111. "type": "string"
  6112. }
  6113. },
  6114. "required": ["sessionID", "permissionID", "response"]
  6115. }
  6116. },
  6117. "required": ["type", "properties"]
  6118. },
  6119. "SessionStatus": {
  6120. "anyOf": [
  6121. {
  6122. "type": "object",
  6123. "properties": {
  6124. "type": {
  6125. "type": "string",
  6126. "const": "idle"
  6127. }
  6128. },
  6129. "required": ["type"]
  6130. },
  6131. {
  6132. "type": "object",
  6133. "properties": {
  6134. "type": {
  6135. "type": "string",
  6136. "const": "retry"
  6137. },
  6138. "attempt": {
  6139. "type": "number"
  6140. },
  6141. "message": {
  6142. "type": "string"
  6143. },
  6144. "next": {
  6145. "type": "number"
  6146. }
  6147. },
  6148. "required": ["type", "attempt", "message", "next"]
  6149. },
  6150. {
  6151. "type": "object",
  6152. "properties": {
  6153. "type": {
  6154. "type": "string",
  6155. "const": "busy"
  6156. }
  6157. },
  6158. "required": ["type"]
  6159. }
  6160. ]
  6161. },
  6162. "Event.session.status": {
  6163. "type": "object",
  6164. "properties": {
  6165. "type": {
  6166. "type": "string",
  6167. "const": "session.status"
  6168. },
  6169. "properties": {
  6170. "type": "object",
  6171. "properties": {
  6172. "sessionID": {
  6173. "type": "string"
  6174. },
  6175. "status": {
  6176. "$ref": "#/components/schemas/SessionStatus"
  6177. }
  6178. },
  6179. "required": ["sessionID", "status"]
  6180. }
  6181. },
  6182. "required": ["type", "properties"]
  6183. },
  6184. "Event.session.idle": {
  6185. "type": "object",
  6186. "properties": {
  6187. "type": {
  6188. "type": "string",
  6189. "const": "session.idle"
  6190. },
  6191. "properties": {
  6192. "type": "object",
  6193. "properties": {
  6194. "sessionID": {
  6195. "type": "string"
  6196. }
  6197. },
  6198. "required": ["sessionID"]
  6199. }
  6200. },
  6201. "required": ["type", "properties"]
  6202. },
  6203. "Event.session.compacted": {
  6204. "type": "object",
  6205. "properties": {
  6206. "type": {
  6207. "type": "string",
  6208. "const": "session.compacted"
  6209. },
  6210. "properties": {
  6211. "type": "object",
  6212. "properties": {
  6213. "sessionID": {
  6214. "type": "string"
  6215. }
  6216. },
  6217. "required": ["sessionID"]
  6218. }
  6219. },
  6220. "required": ["type", "properties"]
  6221. },
  6222. "Event.file.edited": {
  6223. "type": "object",
  6224. "properties": {
  6225. "type": {
  6226. "type": "string",
  6227. "const": "file.edited"
  6228. },
  6229. "properties": {
  6230. "type": "object",
  6231. "properties": {
  6232. "file": {
  6233. "type": "string"
  6234. }
  6235. },
  6236. "required": ["file"]
  6237. }
  6238. },
  6239. "required": ["type", "properties"]
  6240. },
  6241. "Todo": {
  6242. "type": "object",
  6243. "properties": {
  6244. "content": {
  6245. "description": "Brief description of the task",
  6246. "type": "string"
  6247. },
  6248. "status": {
  6249. "description": "Current status of the task: pending, in_progress, completed, cancelled",
  6250. "type": "string"
  6251. },
  6252. "priority": {
  6253. "description": "Priority level of the task: high, medium, low",
  6254. "type": "string"
  6255. },
  6256. "id": {
  6257. "description": "Unique identifier for the todo item",
  6258. "type": "string"
  6259. }
  6260. },
  6261. "required": ["content", "status", "priority", "id"]
  6262. },
  6263. "Event.todo.updated": {
  6264. "type": "object",
  6265. "properties": {
  6266. "type": {
  6267. "type": "string",
  6268. "const": "todo.updated"
  6269. },
  6270. "properties": {
  6271. "type": "object",
  6272. "properties": {
  6273. "sessionID": {
  6274. "type": "string"
  6275. },
  6276. "todos": {
  6277. "type": "array",
  6278. "items": {
  6279. "$ref": "#/components/schemas/Todo"
  6280. }
  6281. }
  6282. },
  6283. "required": ["sessionID", "todos"]
  6284. }
  6285. },
  6286. "required": ["type", "properties"]
  6287. },
  6288. "Event.command.executed": {
  6289. "type": "object",
  6290. "properties": {
  6291. "type": {
  6292. "type": "string",
  6293. "const": "command.executed"
  6294. },
  6295. "properties": {
  6296. "type": "object",
  6297. "properties": {
  6298. "name": {
  6299. "type": "string"
  6300. },
  6301. "sessionID": {
  6302. "type": "string",
  6303. "pattern": "^ses.*"
  6304. },
  6305. "arguments": {
  6306. "type": "string"
  6307. },
  6308. "messageID": {
  6309. "type": "string",
  6310. "pattern": "^msg.*"
  6311. }
  6312. },
  6313. "required": ["name", "sessionID", "arguments", "messageID"]
  6314. }
  6315. },
  6316. "required": ["type", "properties"]
  6317. },
  6318. "Session": {
  6319. "type": "object",
  6320. "properties": {
  6321. "id": {
  6322. "type": "string",
  6323. "pattern": "^ses.*"
  6324. },
  6325. "projectID": {
  6326. "type": "string"
  6327. },
  6328. "directory": {
  6329. "type": "string"
  6330. },
  6331. "parentID": {
  6332. "type": "string",
  6333. "pattern": "^ses.*"
  6334. },
  6335. "summary": {
  6336. "type": "object",
  6337. "properties": {
  6338. "additions": {
  6339. "type": "number"
  6340. },
  6341. "deletions": {
  6342. "type": "number"
  6343. },
  6344. "files": {
  6345. "type": "number"
  6346. },
  6347. "diffs": {
  6348. "type": "array",
  6349. "items": {
  6350. "$ref": "#/components/schemas/FileDiff"
  6351. }
  6352. }
  6353. },
  6354. "required": ["additions", "deletions", "files"]
  6355. },
  6356. "share": {
  6357. "type": "object",
  6358. "properties": {
  6359. "url": {
  6360. "type": "string"
  6361. }
  6362. },
  6363. "required": ["url"]
  6364. },
  6365. "title": {
  6366. "type": "string"
  6367. },
  6368. "version": {
  6369. "type": "string"
  6370. },
  6371. "time": {
  6372. "type": "object",
  6373. "properties": {
  6374. "created": {
  6375. "type": "number"
  6376. },
  6377. "updated": {
  6378. "type": "number"
  6379. },
  6380. "compacting": {
  6381. "type": "number"
  6382. }
  6383. },
  6384. "required": ["created", "updated"]
  6385. },
  6386. "revert": {
  6387. "type": "object",
  6388. "properties": {
  6389. "messageID": {
  6390. "type": "string"
  6391. },
  6392. "partID": {
  6393. "type": "string"
  6394. },
  6395. "snapshot": {
  6396. "type": "string"
  6397. },
  6398. "diff": {
  6399. "type": "string"
  6400. }
  6401. },
  6402. "required": ["messageID"]
  6403. }
  6404. },
  6405. "required": ["id", "projectID", "directory", "title", "version", "time"]
  6406. },
  6407. "Event.session.created": {
  6408. "type": "object",
  6409. "properties": {
  6410. "type": {
  6411. "type": "string",
  6412. "const": "session.created"
  6413. },
  6414. "properties": {
  6415. "type": "object",
  6416. "properties": {
  6417. "info": {
  6418. "$ref": "#/components/schemas/Session"
  6419. }
  6420. },
  6421. "required": ["info"]
  6422. }
  6423. },
  6424. "required": ["type", "properties"]
  6425. },
  6426. "Event.session.updated": {
  6427. "type": "object",
  6428. "properties": {
  6429. "type": {
  6430. "type": "string",
  6431. "const": "session.updated"
  6432. },
  6433. "properties": {
  6434. "type": "object",
  6435. "properties": {
  6436. "info": {
  6437. "$ref": "#/components/schemas/Session"
  6438. }
  6439. },
  6440. "required": ["info"]
  6441. }
  6442. },
  6443. "required": ["type", "properties"]
  6444. },
  6445. "Event.session.deleted": {
  6446. "type": "object",
  6447. "properties": {
  6448. "type": {
  6449. "type": "string",
  6450. "const": "session.deleted"
  6451. },
  6452. "properties": {
  6453. "type": "object",
  6454. "properties": {
  6455. "info": {
  6456. "$ref": "#/components/schemas/Session"
  6457. }
  6458. },
  6459. "required": ["info"]
  6460. }
  6461. },
  6462. "required": ["type", "properties"]
  6463. },
  6464. "Event.session.diff": {
  6465. "type": "object",
  6466. "properties": {
  6467. "type": {
  6468. "type": "string",
  6469. "const": "session.diff"
  6470. },
  6471. "properties": {
  6472. "type": "object",
  6473. "properties": {
  6474. "sessionID": {
  6475. "type": "string"
  6476. },
  6477. "diff": {
  6478. "type": "array",
  6479. "items": {
  6480. "$ref": "#/components/schemas/FileDiff"
  6481. }
  6482. }
  6483. },
  6484. "required": ["sessionID", "diff"]
  6485. }
  6486. },
  6487. "required": ["type", "properties"]
  6488. },
  6489. "Event.session.error": {
  6490. "type": "object",
  6491. "properties": {
  6492. "type": {
  6493. "type": "string",
  6494. "const": "session.error"
  6495. },
  6496. "properties": {
  6497. "type": "object",
  6498. "properties": {
  6499. "sessionID": {
  6500. "type": "string"
  6501. },
  6502. "error": {
  6503. "anyOf": [
  6504. {
  6505. "$ref": "#/components/schemas/ProviderAuthError"
  6506. },
  6507. {
  6508. "$ref": "#/components/schemas/UnknownError"
  6509. },
  6510. {
  6511. "$ref": "#/components/schemas/MessageOutputLengthError"
  6512. },
  6513. {
  6514. "$ref": "#/components/schemas/MessageAbortedError"
  6515. },
  6516. {
  6517. "$ref": "#/components/schemas/APIError"
  6518. }
  6519. ]
  6520. }
  6521. }
  6522. }
  6523. },
  6524. "required": ["type", "properties"]
  6525. },
  6526. "Event.file.watcher.updated": {
  6527. "type": "object",
  6528. "properties": {
  6529. "type": {
  6530. "type": "string",
  6531. "const": "file.watcher.updated"
  6532. },
  6533. "properties": {
  6534. "type": "object",
  6535. "properties": {
  6536. "file": {
  6537. "type": "string"
  6538. },
  6539. "event": {
  6540. "anyOf": [
  6541. {
  6542. "type": "string",
  6543. "const": "add"
  6544. },
  6545. {
  6546. "type": "string",
  6547. "const": "change"
  6548. },
  6549. {
  6550. "type": "string",
  6551. "const": "unlink"
  6552. }
  6553. ]
  6554. }
  6555. },
  6556. "required": ["file", "event"]
  6557. }
  6558. },
  6559. "required": ["type", "properties"]
  6560. },
  6561. "Event.vcs.branch.updated": {
  6562. "type": "object",
  6563. "properties": {
  6564. "type": {
  6565. "type": "string",
  6566. "const": "vcs.branch.updated"
  6567. },
  6568. "properties": {
  6569. "type": "object",
  6570. "properties": {
  6571. "branch": {
  6572. "type": "string"
  6573. }
  6574. }
  6575. }
  6576. },
  6577. "required": ["type", "properties"]
  6578. },
  6579. "Event.tui.prompt.append": {
  6580. "type": "object",
  6581. "properties": {
  6582. "type": {
  6583. "type": "string",
  6584. "const": "tui.prompt.append"
  6585. },
  6586. "properties": {
  6587. "type": "object",
  6588. "properties": {
  6589. "text": {
  6590. "type": "string"
  6591. }
  6592. },
  6593. "required": ["text"]
  6594. }
  6595. },
  6596. "required": ["type", "properties"]
  6597. },
  6598. "Event.tui.command.execute": {
  6599. "type": "object",
  6600. "properties": {
  6601. "type": {
  6602. "type": "string",
  6603. "const": "tui.command.execute"
  6604. },
  6605. "properties": {
  6606. "type": "object",
  6607. "properties": {
  6608. "command": {
  6609. "anyOf": [
  6610. {
  6611. "type": "string",
  6612. "enum": [
  6613. "session.list",
  6614. "session.new",
  6615. "session.share",
  6616. "session.interrupt",
  6617. "session.compact",
  6618. "session.page.up",
  6619. "session.page.down",
  6620. "session.half.page.up",
  6621. "session.half.page.down",
  6622. "session.first",
  6623. "session.last",
  6624. "prompt.clear",
  6625. "prompt.submit",
  6626. "agent.cycle"
  6627. ]
  6628. },
  6629. {
  6630. "type": "string"
  6631. }
  6632. ]
  6633. }
  6634. },
  6635. "required": ["command"]
  6636. }
  6637. },
  6638. "required": ["type", "properties"]
  6639. },
  6640. "Event.tui.toast.show": {
  6641. "type": "object",
  6642. "properties": {
  6643. "type": {
  6644. "type": "string",
  6645. "const": "tui.toast.show"
  6646. },
  6647. "properties": {
  6648. "type": "object",
  6649. "properties": {
  6650. "title": {
  6651. "type": "string"
  6652. },
  6653. "message": {
  6654. "type": "string"
  6655. },
  6656. "variant": {
  6657. "type": "string",
  6658. "enum": ["info", "success", "warning", "error"]
  6659. },
  6660. "duration": {
  6661. "description": "Duration in milliseconds",
  6662. "default": 5000,
  6663. "type": "number"
  6664. }
  6665. },
  6666. "required": ["message", "variant"]
  6667. }
  6668. },
  6669. "required": ["type", "properties"]
  6670. },
  6671. "Pty": {
  6672. "type": "object",
  6673. "properties": {
  6674. "id": {
  6675. "type": "string",
  6676. "pattern": "^pty.*"
  6677. },
  6678. "title": {
  6679. "type": "string"
  6680. },
  6681. "command": {
  6682. "type": "string"
  6683. },
  6684. "args": {
  6685. "type": "array",
  6686. "items": {
  6687. "type": "string"
  6688. }
  6689. },
  6690. "cwd": {
  6691. "type": "string"
  6692. },
  6693. "status": {
  6694. "type": "string",
  6695. "enum": ["running", "exited"]
  6696. },
  6697. "pid": {
  6698. "type": "number"
  6699. }
  6700. },
  6701. "required": ["id", "title", "command", "args", "cwd", "status", "pid"]
  6702. },
  6703. "Event.pty.created": {
  6704. "type": "object",
  6705. "properties": {
  6706. "type": {
  6707. "type": "string",
  6708. "const": "pty.created"
  6709. },
  6710. "properties": {
  6711. "type": "object",
  6712. "properties": {
  6713. "info": {
  6714. "$ref": "#/components/schemas/Pty"
  6715. }
  6716. },
  6717. "required": ["info"]
  6718. }
  6719. },
  6720. "required": ["type", "properties"]
  6721. },
  6722. "Event.pty.updated": {
  6723. "type": "object",
  6724. "properties": {
  6725. "type": {
  6726. "type": "string",
  6727. "const": "pty.updated"
  6728. },
  6729. "properties": {
  6730. "type": "object",
  6731. "properties": {
  6732. "info": {
  6733. "$ref": "#/components/schemas/Pty"
  6734. }
  6735. },
  6736. "required": ["info"]
  6737. }
  6738. },
  6739. "required": ["type", "properties"]
  6740. },
  6741. "Event.pty.exited": {
  6742. "type": "object",
  6743. "properties": {
  6744. "type": {
  6745. "type": "string",
  6746. "const": "pty.exited"
  6747. },
  6748. "properties": {
  6749. "type": "object",
  6750. "properties": {
  6751. "id": {
  6752. "type": "string",
  6753. "pattern": "^pty.*"
  6754. },
  6755. "exitCode": {
  6756. "type": "number"
  6757. }
  6758. },
  6759. "required": ["id", "exitCode"]
  6760. }
  6761. },
  6762. "required": ["type", "properties"]
  6763. },
  6764. "Event.pty.deleted": {
  6765. "type": "object",
  6766. "properties": {
  6767. "type": {
  6768. "type": "string",
  6769. "const": "pty.deleted"
  6770. },
  6771. "properties": {
  6772. "type": "object",
  6773. "properties": {
  6774. "id": {
  6775. "type": "string",
  6776. "pattern": "^pty.*"
  6777. }
  6778. },
  6779. "required": ["id"]
  6780. }
  6781. },
  6782. "required": ["type", "properties"]
  6783. },
  6784. "Event.server.connected": {
  6785. "type": "object",
  6786. "properties": {
  6787. "type": {
  6788. "type": "string",
  6789. "const": "server.connected"
  6790. },
  6791. "properties": {
  6792. "type": "object",
  6793. "properties": {}
  6794. }
  6795. },
  6796. "required": ["type", "properties"]
  6797. },
  6798. "Event": {
  6799. "anyOf": [
  6800. {
  6801. "$ref": "#/components/schemas/Event.installation.updated"
  6802. },
  6803. {
  6804. "$ref": "#/components/schemas/Event.installation.update-available"
  6805. },
  6806. {
  6807. "$ref": "#/components/schemas/Event.project.updated"
  6808. },
  6809. {
  6810. "$ref": "#/components/schemas/Event.server.instance.disposed"
  6811. },
  6812. {
  6813. "$ref": "#/components/schemas/Event.lsp.client.diagnostics"
  6814. },
  6815. {
  6816. "$ref": "#/components/schemas/Event.lsp.updated"
  6817. },
  6818. {
  6819. "$ref": "#/components/schemas/Event.message.updated"
  6820. },
  6821. {
  6822. "$ref": "#/components/schemas/Event.message.removed"
  6823. },
  6824. {
  6825. "$ref": "#/components/schemas/Event.message.part.updated"
  6826. },
  6827. {
  6828. "$ref": "#/components/schemas/Event.message.part.removed"
  6829. },
  6830. {
  6831. "$ref": "#/components/schemas/Event.permission.updated"
  6832. },
  6833. {
  6834. "$ref": "#/components/schemas/Event.permission.replied"
  6835. },
  6836. {
  6837. "$ref": "#/components/schemas/Event.session.status"
  6838. },
  6839. {
  6840. "$ref": "#/components/schemas/Event.session.idle"
  6841. },
  6842. {
  6843. "$ref": "#/components/schemas/Event.session.compacted"
  6844. },
  6845. {
  6846. "$ref": "#/components/schemas/Event.file.edited"
  6847. },
  6848. {
  6849. "$ref": "#/components/schemas/Event.todo.updated"
  6850. },
  6851. {
  6852. "$ref": "#/components/schemas/Event.command.executed"
  6853. },
  6854. {
  6855. "$ref": "#/components/schemas/Event.session.created"
  6856. },
  6857. {
  6858. "$ref": "#/components/schemas/Event.session.updated"
  6859. },
  6860. {
  6861. "$ref": "#/components/schemas/Event.session.deleted"
  6862. },
  6863. {
  6864. "$ref": "#/components/schemas/Event.session.diff"
  6865. },
  6866. {
  6867. "$ref": "#/components/schemas/Event.session.error"
  6868. },
  6869. {
  6870. "$ref": "#/components/schemas/Event.file.watcher.updated"
  6871. },
  6872. {
  6873. "$ref": "#/components/schemas/Event.vcs.branch.updated"
  6874. },
  6875. {
  6876. "$ref": "#/components/schemas/Event.tui.prompt.append"
  6877. },
  6878. {
  6879. "$ref": "#/components/schemas/Event.tui.command.execute"
  6880. },
  6881. {
  6882. "$ref": "#/components/schemas/Event.tui.toast.show"
  6883. },
  6884. {
  6885. "$ref": "#/components/schemas/Event.pty.created"
  6886. },
  6887. {
  6888. "$ref": "#/components/schemas/Event.pty.updated"
  6889. },
  6890. {
  6891. "$ref": "#/components/schemas/Event.pty.exited"
  6892. },
  6893. {
  6894. "$ref": "#/components/schemas/Event.pty.deleted"
  6895. },
  6896. {
  6897. "$ref": "#/components/schemas/Event.server.connected"
  6898. }
  6899. ]
  6900. },
  6901. "GlobalEvent": {
  6902. "type": "object",
  6903. "properties": {
  6904. "directory": {
  6905. "type": "string"
  6906. },
  6907. "payload": {
  6908. "$ref": "#/components/schemas/Event"
  6909. }
  6910. },
  6911. "required": ["directory", "payload"]
  6912. },
  6913. "BadRequestError": {
  6914. "type": "object",
  6915. "properties": {
  6916. "data": {},
  6917. "errors": {
  6918. "type": "array",
  6919. "items": {
  6920. "type": "object",
  6921. "propertyNames": {
  6922. "type": "string"
  6923. },
  6924. "additionalProperties": {}
  6925. }
  6926. },
  6927. "success": {
  6928. "type": "boolean",
  6929. "const": false
  6930. }
  6931. },
  6932. "required": ["data", "errors", "success"]
  6933. },
  6934. "NotFoundError": {
  6935. "type": "object",
  6936. "properties": {
  6937. "name": {
  6938. "type": "string",
  6939. "const": "NotFoundError"
  6940. },
  6941. "data": {
  6942. "type": "object",
  6943. "properties": {
  6944. "message": {
  6945. "type": "string"
  6946. }
  6947. },
  6948. "required": ["message"]
  6949. }
  6950. },
  6951. "required": ["name", "data"]
  6952. },
  6953. "KeybindsConfig": {
  6954. "description": "Custom keybind configurations",
  6955. "type": "object",
  6956. "properties": {
  6957. "leader": {
  6958. "description": "Leader key for keybind combinations",
  6959. "default": "ctrl+x",
  6960. "type": "string"
  6961. },
  6962. "app_exit": {
  6963. "description": "Exit the application",
  6964. "default": "ctrl+c,ctrl+d,<leader>q",
  6965. "type": "string"
  6966. },
  6967. "editor_open": {
  6968. "description": "Open external editor",
  6969. "default": "<leader>e",
  6970. "type": "string"
  6971. },
  6972. "theme_list": {
  6973. "description": "List available themes",
  6974. "default": "<leader>t",
  6975. "type": "string"
  6976. },
  6977. "sidebar_toggle": {
  6978. "description": "Toggle sidebar",
  6979. "default": "<leader>b",
  6980. "type": "string"
  6981. },
  6982. "scrollbar_toggle": {
  6983. "description": "Toggle session scrollbar",
  6984. "default": "none",
  6985. "type": "string"
  6986. },
  6987. "username_toggle": {
  6988. "description": "Toggle username visibility",
  6989. "default": "none",
  6990. "type": "string"
  6991. },
  6992. "status_view": {
  6993. "description": "View status",
  6994. "default": "<leader>s",
  6995. "type": "string"
  6996. },
  6997. "session_export": {
  6998. "description": "Export session to editor",
  6999. "default": "<leader>x",
  7000. "type": "string"
  7001. },
  7002. "session_new": {
  7003. "description": "Create a new session",
  7004. "default": "<leader>n",
  7005. "type": "string"
  7006. },
  7007. "session_list": {
  7008. "description": "List all sessions",
  7009. "default": "<leader>l",
  7010. "type": "string"
  7011. },
  7012. "session_timeline": {
  7013. "description": "Show session timeline",
  7014. "default": "<leader>g",
  7015. "type": "string"
  7016. },
  7017. "session_share": {
  7018. "description": "Share current session",
  7019. "default": "none",
  7020. "type": "string"
  7021. },
  7022. "session_unshare": {
  7023. "description": "Unshare current session",
  7024. "default": "none",
  7025. "type": "string"
  7026. },
  7027. "session_interrupt": {
  7028. "description": "Interrupt current session",
  7029. "default": "escape",
  7030. "type": "string"
  7031. },
  7032. "session_compact": {
  7033. "description": "Compact the session",
  7034. "default": "<leader>c",
  7035. "type": "string"
  7036. },
  7037. "messages_page_up": {
  7038. "description": "Scroll messages up by one page",
  7039. "default": "pageup",
  7040. "type": "string"
  7041. },
  7042. "messages_page_down": {
  7043. "description": "Scroll messages down by one page",
  7044. "default": "pagedown",
  7045. "type": "string"
  7046. },
  7047. "messages_half_page_up": {
  7048. "description": "Scroll messages up by half page",
  7049. "default": "ctrl+alt+u",
  7050. "type": "string"
  7051. },
  7052. "messages_half_page_down": {
  7053. "description": "Scroll messages down by half page",
  7054. "default": "ctrl+alt+d",
  7055. "type": "string"
  7056. },
  7057. "messages_first": {
  7058. "description": "Navigate to first message",
  7059. "default": "ctrl+g,home",
  7060. "type": "string"
  7061. },
  7062. "messages_last": {
  7063. "description": "Navigate to last message",
  7064. "default": "ctrl+alt+g,end",
  7065. "type": "string"
  7066. },
  7067. "messages_last_user": {
  7068. "description": "Navigate to last user message",
  7069. "default": "none",
  7070. "type": "string"
  7071. },
  7072. "messages_copy": {
  7073. "description": "Copy message",
  7074. "default": "<leader>y",
  7075. "type": "string"
  7076. },
  7077. "messages_undo": {
  7078. "description": "Undo message",
  7079. "default": "<leader>u",
  7080. "type": "string"
  7081. },
  7082. "messages_redo": {
  7083. "description": "Redo message",
  7084. "default": "<leader>r",
  7085. "type": "string"
  7086. },
  7087. "messages_toggle_conceal": {
  7088. "description": "Toggle code block concealment in messages",
  7089. "default": "<leader>h",
  7090. "type": "string"
  7091. },
  7092. "tool_details": {
  7093. "description": "Toggle tool details visibility",
  7094. "default": "none",
  7095. "type": "string"
  7096. },
  7097. "model_list": {
  7098. "description": "List available models",
  7099. "default": "<leader>m",
  7100. "type": "string"
  7101. },
  7102. "model_cycle_recent": {
  7103. "description": "Next recently used model",
  7104. "default": "f2",
  7105. "type": "string"
  7106. },
  7107. "model_cycle_recent_reverse": {
  7108. "description": "Previous recently used model",
  7109. "default": "shift+f2",
  7110. "type": "string"
  7111. },
  7112. "command_list": {
  7113. "description": "List available commands",
  7114. "default": "ctrl+p",
  7115. "type": "string"
  7116. },
  7117. "agent_list": {
  7118. "description": "List agents",
  7119. "default": "<leader>a",
  7120. "type": "string"
  7121. },
  7122. "agent_cycle": {
  7123. "description": "Next agent",
  7124. "default": "tab",
  7125. "type": "string"
  7126. },
  7127. "agent_cycle_reverse": {
  7128. "description": "Previous agent",
  7129. "default": "shift+tab",
  7130. "type": "string"
  7131. },
  7132. "input_clear": {
  7133. "description": "Clear input field",
  7134. "default": "ctrl+c",
  7135. "type": "string"
  7136. },
  7137. "input_paste": {
  7138. "description": "Paste from clipboard",
  7139. "default": "ctrl+v",
  7140. "type": "string"
  7141. },
  7142. "input_submit": {
  7143. "description": "Submit input",
  7144. "default": "return",
  7145. "type": "string"
  7146. },
  7147. "input_newline": {
  7148. "description": "Insert newline in input",
  7149. "default": "shift+return,ctrl+j",
  7150. "type": "string"
  7151. },
  7152. "history_previous": {
  7153. "description": "Previous history item",
  7154. "default": "up",
  7155. "type": "string"
  7156. },
  7157. "history_next": {
  7158. "description": "Next history item",
  7159. "default": "down",
  7160. "type": "string"
  7161. },
  7162. "session_child_cycle": {
  7163. "description": "Next child session",
  7164. "default": "<leader>right",
  7165. "type": "string"
  7166. },
  7167. "session_child_cycle_reverse": {
  7168. "description": "Previous child session",
  7169. "default": "<leader>left",
  7170. "type": "string"
  7171. },
  7172. "terminal_suspend": {
  7173. "description": "Suspend terminal",
  7174. "default": "ctrl+z",
  7175. "type": "string"
  7176. }
  7177. },
  7178. "additionalProperties": false
  7179. },
  7180. "AgentConfig": {
  7181. "type": "object",
  7182. "properties": {
  7183. "model": {
  7184. "type": "string"
  7185. },
  7186. "temperature": {
  7187. "type": "number"
  7188. },
  7189. "top_p": {
  7190. "type": "number"
  7191. },
  7192. "prompt": {
  7193. "type": "string"
  7194. },
  7195. "tools": {
  7196. "type": "object",
  7197. "propertyNames": {
  7198. "type": "string"
  7199. },
  7200. "additionalProperties": {
  7201. "type": "boolean"
  7202. }
  7203. },
  7204. "disable": {
  7205. "type": "boolean"
  7206. },
  7207. "description": {
  7208. "description": "Description of when to use the agent",
  7209. "type": "string"
  7210. },
  7211. "mode": {
  7212. "type": "string",
  7213. "enum": ["subagent", "primary", "all"]
  7214. },
  7215. "color": {
  7216. "description": "Hex color code for the agent (e.g., #FF5733)",
  7217. "type": "string",
  7218. "pattern": "^#[0-9a-fA-F]{6}$"
  7219. },
  7220. "maxSteps": {
  7221. "description": "Maximum number of agentic iterations before forcing text-only response",
  7222. "type": "integer",
  7223. "exclusiveMinimum": 0,
  7224. "maximum": 9007199254740991
  7225. },
  7226. "permission": {
  7227. "type": "object",
  7228. "properties": {
  7229. "edit": {
  7230. "type": "string",
  7231. "enum": ["ask", "allow", "deny"]
  7232. },
  7233. "bash": {
  7234. "anyOf": [
  7235. {
  7236. "type": "string",
  7237. "enum": ["ask", "allow", "deny"]
  7238. },
  7239. {
  7240. "type": "object",
  7241. "propertyNames": {
  7242. "type": "string"
  7243. },
  7244. "additionalProperties": {
  7245. "type": "string",
  7246. "enum": ["ask", "allow", "deny"]
  7247. }
  7248. }
  7249. ]
  7250. },
  7251. "webfetch": {
  7252. "type": "string",
  7253. "enum": ["ask", "allow", "deny"]
  7254. },
  7255. "doom_loop": {
  7256. "type": "string",
  7257. "enum": ["ask", "allow", "deny"]
  7258. },
  7259. "external_directory": {
  7260. "type": "string",
  7261. "enum": ["ask", "allow", "deny"]
  7262. }
  7263. }
  7264. }
  7265. },
  7266. "additionalProperties": {}
  7267. },
  7268. "ProviderConfig": {
  7269. "type": "object",
  7270. "properties": {
  7271. "api": {
  7272. "type": "string"
  7273. },
  7274. "name": {
  7275. "type": "string"
  7276. },
  7277. "env": {
  7278. "type": "array",
  7279. "items": {
  7280. "type": "string"
  7281. }
  7282. },
  7283. "id": {
  7284. "type": "string"
  7285. },
  7286. "npm": {
  7287. "type": "string"
  7288. },
  7289. "models": {
  7290. "type": "object",
  7291. "propertyNames": {
  7292. "type": "string"
  7293. },
  7294. "additionalProperties": {
  7295. "type": "object",
  7296. "properties": {
  7297. "id": {
  7298. "type": "string"
  7299. },
  7300. "name": {
  7301. "type": "string"
  7302. },
  7303. "release_date": {
  7304. "type": "string"
  7305. },
  7306. "attachment": {
  7307. "type": "boolean"
  7308. },
  7309. "reasoning": {
  7310. "type": "boolean"
  7311. },
  7312. "temperature": {
  7313. "type": "boolean"
  7314. },
  7315. "tool_call": {
  7316. "type": "boolean"
  7317. },
  7318. "interleaved": {
  7319. "anyOf": [
  7320. {
  7321. "type": "boolean",
  7322. "const": true
  7323. },
  7324. {
  7325. "type": "object",
  7326. "properties": {
  7327. "field": {
  7328. "type": "string",
  7329. "enum": ["reasoning_content", "reasoning_details"]
  7330. }
  7331. },
  7332. "required": ["field"],
  7333. "additionalProperties": false
  7334. }
  7335. ]
  7336. },
  7337. "cost": {
  7338. "type": "object",
  7339. "properties": {
  7340. "input": {
  7341. "type": "number"
  7342. },
  7343. "output": {
  7344. "type": "number"
  7345. },
  7346. "cache_read": {
  7347. "type": "number"
  7348. },
  7349. "cache_write": {
  7350. "type": "number"
  7351. },
  7352. "context_over_200k": {
  7353. "type": "object",
  7354. "properties": {
  7355. "input": {
  7356. "type": "number"
  7357. },
  7358. "output": {
  7359. "type": "number"
  7360. },
  7361. "cache_read": {
  7362. "type": "number"
  7363. },
  7364. "cache_write": {
  7365. "type": "number"
  7366. }
  7367. },
  7368. "required": ["input", "output"]
  7369. }
  7370. },
  7371. "required": ["input", "output"]
  7372. },
  7373. "limit": {
  7374. "type": "object",
  7375. "properties": {
  7376. "context": {
  7377. "type": "number"
  7378. },
  7379. "output": {
  7380. "type": "number"
  7381. }
  7382. },
  7383. "required": ["context", "output"]
  7384. },
  7385. "modalities": {
  7386. "type": "object",
  7387. "properties": {
  7388. "input": {
  7389. "type": "array",
  7390. "items": {
  7391. "type": "string",
  7392. "enum": ["text", "audio", "image", "video", "pdf"]
  7393. }
  7394. },
  7395. "output": {
  7396. "type": "array",
  7397. "items": {
  7398. "type": "string",
  7399. "enum": ["text", "audio", "image", "video", "pdf"]
  7400. }
  7401. }
  7402. },
  7403. "required": ["input", "output"]
  7404. },
  7405. "experimental": {
  7406. "type": "boolean"
  7407. },
  7408. "status": {
  7409. "type": "string",
  7410. "enum": ["alpha", "beta", "deprecated"]
  7411. },
  7412. "options": {
  7413. "type": "object",
  7414. "propertyNames": {
  7415. "type": "string"
  7416. },
  7417. "additionalProperties": {}
  7418. },
  7419. "headers": {
  7420. "type": "object",
  7421. "propertyNames": {
  7422. "type": "string"
  7423. },
  7424. "additionalProperties": {
  7425. "type": "string"
  7426. }
  7427. },
  7428. "provider": {
  7429. "type": "object",
  7430. "properties": {
  7431. "npm": {
  7432. "type": "string"
  7433. }
  7434. },
  7435. "required": ["npm"]
  7436. }
  7437. }
  7438. }
  7439. },
  7440. "whitelist": {
  7441. "type": "array",
  7442. "items": {
  7443. "type": "string"
  7444. }
  7445. },
  7446. "blacklist": {
  7447. "type": "array",
  7448. "items": {
  7449. "type": "string"
  7450. }
  7451. },
  7452. "options": {
  7453. "type": "object",
  7454. "properties": {
  7455. "apiKey": {
  7456. "type": "string"
  7457. },
  7458. "baseURL": {
  7459. "type": "string"
  7460. },
  7461. "enterpriseUrl": {
  7462. "description": "GitHub Enterprise URL for copilot authentication",
  7463. "type": "string"
  7464. },
  7465. "setCacheKey": {
  7466. "description": "Enable promptCacheKey for this provider (default false)",
  7467. "type": "boolean"
  7468. },
  7469. "timeout": {
  7470. "description": "Timeout in milliseconds for requests to this provider. Default is 300000 (5 minutes). Set to false to disable timeout.",
  7471. "anyOf": [
  7472. {
  7473. "description": "Timeout in milliseconds for requests to this provider. Default is 300000 (5 minutes). Set to false to disable timeout.",
  7474. "type": "integer",
  7475. "exclusiveMinimum": 0,
  7476. "maximum": 9007199254740991
  7477. },
  7478. {
  7479. "description": "Disable timeout for this provider entirely.",
  7480. "type": "boolean",
  7481. "const": false
  7482. }
  7483. ]
  7484. }
  7485. },
  7486. "additionalProperties": {}
  7487. }
  7488. },
  7489. "additionalProperties": false
  7490. },
  7491. "McpLocalConfig": {
  7492. "type": "object",
  7493. "properties": {
  7494. "type": {
  7495. "description": "Type of MCP server connection",
  7496. "type": "string",
  7497. "const": "local"
  7498. },
  7499. "command": {
  7500. "description": "Command and arguments to run the MCP server",
  7501. "type": "array",
  7502. "items": {
  7503. "type": "string"
  7504. }
  7505. },
  7506. "environment": {
  7507. "description": "Environment variables to set when running the MCP server",
  7508. "type": "object",
  7509. "propertyNames": {
  7510. "type": "string"
  7511. },
  7512. "additionalProperties": {
  7513. "type": "string"
  7514. }
  7515. },
  7516. "enabled": {
  7517. "description": "Enable or disable the MCP server on startup",
  7518. "type": "boolean"
  7519. },
  7520. "timeout": {
  7521. "description": "Timeout in ms for fetching tools from the MCP server. Defaults to 5000 (5 seconds) if not specified.",
  7522. "type": "integer",
  7523. "exclusiveMinimum": 0,
  7524. "maximum": 9007199254740991
  7525. }
  7526. },
  7527. "required": ["type", "command"],
  7528. "additionalProperties": false
  7529. },
  7530. "McpOAuthConfig": {
  7531. "type": "object",
  7532. "properties": {
  7533. "clientId": {
  7534. "description": "OAuth client ID. If not provided, dynamic client registration (RFC 7591) will be attempted.",
  7535. "type": "string"
  7536. },
  7537. "clientSecret": {
  7538. "description": "OAuth client secret (if required by the authorization server)",
  7539. "type": "string"
  7540. },
  7541. "scope": {
  7542. "description": "OAuth scopes to request during authorization",
  7543. "type": "string"
  7544. }
  7545. },
  7546. "additionalProperties": false
  7547. },
  7548. "McpRemoteConfig": {
  7549. "type": "object",
  7550. "properties": {
  7551. "type": {
  7552. "description": "Type of MCP server connection",
  7553. "type": "string",
  7554. "const": "remote"
  7555. },
  7556. "url": {
  7557. "description": "URL of the remote MCP server",
  7558. "type": "string"
  7559. },
  7560. "enabled": {
  7561. "description": "Enable or disable the MCP server on startup",
  7562. "type": "boolean"
  7563. },
  7564. "headers": {
  7565. "description": "Headers to send with the request",
  7566. "type": "object",
  7567. "propertyNames": {
  7568. "type": "string"
  7569. },
  7570. "additionalProperties": {
  7571. "type": "string"
  7572. }
  7573. },
  7574. "oauth": {
  7575. "description": "OAuth authentication configuration for the MCP server. Set to false to disable OAuth auto-detection.",
  7576. "anyOf": [
  7577. {
  7578. "$ref": "#/components/schemas/McpOAuthConfig"
  7579. },
  7580. {
  7581. "type": "boolean",
  7582. "const": false
  7583. }
  7584. ]
  7585. },
  7586. "timeout": {
  7587. "description": "Timeout in ms for fetching tools from the MCP server. Defaults to 5000 (5 seconds) if not specified.",
  7588. "type": "integer",
  7589. "exclusiveMinimum": 0,
  7590. "maximum": 9007199254740991
  7591. }
  7592. },
  7593. "required": ["type", "url"],
  7594. "additionalProperties": false
  7595. },
  7596. "LayoutConfig": {
  7597. "description": "@deprecated Always uses stretch layout.",
  7598. "type": "string",
  7599. "enum": ["auto", "stretch"]
  7600. },
  7601. "Config": {
  7602. "type": "object",
  7603. "properties": {
  7604. "$schema": {
  7605. "description": "JSON schema reference for configuration validation",
  7606. "type": "string"
  7607. },
  7608. "theme": {
  7609. "description": "Theme name to use for the interface",
  7610. "type": "string"
  7611. },
  7612. "keybinds": {
  7613. "$ref": "#/components/schemas/KeybindsConfig"
  7614. },
  7615. "tui": {
  7616. "description": "TUI specific settings",
  7617. "type": "object",
  7618. "properties": {
  7619. "scroll_speed": {
  7620. "description": "TUI scroll speed",
  7621. "type": "number",
  7622. "minimum": 0.001
  7623. },
  7624. "scroll_acceleration": {
  7625. "description": "Scroll acceleration settings",
  7626. "type": "object",
  7627. "properties": {
  7628. "enabled": {
  7629. "description": "Enable scroll acceleration",
  7630. "type": "boolean"
  7631. }
  7632. },
  7633. "required": ["enabled"]
  7634. },
  7635. "diff_style": {
  7636. "description": "Control diff rendering style: 'auto' adapts to terminal width, 'stacked' always shows single column",
  7637. "type": "string",
  7638. "enum": ["auto", "stacked"]
  7639. }
  7640. }
  7641. },
  7642. "command": {
  7643. "description": "Command configuration, see https://opencode.ai/docs/commands",
  7644. "type": "object",
  7645. "propertyNames": {
  7646. "type": "string"
  7647. },
  7648. "additionalProperties": {
  7649. "type": "object",
  7650. "properties": {
  7651. "template": {
  7652. "type": "string"
  7653. },
  7654. "description": {
  7655. "type": "string"
  7656. },
  7657. "agent": {
  7658. "type": "string"
  7659. },
  7660. "model": {
  7661. "type": "string"
  7662. },
  7663. "subtask": {
  7664. "type": "boolean"
  7665. }
  7666. },
  7667. "required": ["template"]
  7668. }
  7669. },
  7670. "watcher": {
  7671. "type": "object",
  7672. "properties": {
  7673. "ignore": {
  7674. "type": "array",
  7675. "items": {
  7676. "type": "string"
  7677. }
  7678. }
  7679. }
  7680. },
  7681. "plugin": {
  7682. "type": "array",
  7683. "items": {
  7684. "type": "string"
  7685. }
  7686. },
  7687. "snapshot": {
  7688. "type": "boolean"
  7689. },
  7690. "share": {
  7691. "description": "Control sharing behavior:'manual' allows manual sharing via commands, 'auto' enables automatic sharing, 'disabled' disables all sharing",
  7692. "type": "string",
  7693. "enum": ["manual", "auto", "disabled"]
  7694. },
  7695. "autoshare": {
  7696. "description": "@deprecated Use 'share' field instead. Share newly created sessions automatically",
  7697. "type": "boolean"
  7698. },
  7699. "autoupdate": {
  7700. "description": "Automatically update to the latest version. Set to true to auto-update, false to disable, or 'notify' to show update notifications",
  7701. "anyOf": [
  7702. {
  7703. "type": "boolean"
  7704. },
  7705. {
  7706. "type": "string",
  7707. "const": "notify"
  7708. }
  7709. ]
  7710. },
  7711. "disabled_providers": {
  7712. "description": "Disable providers that are loaded automatically",
  7713. "type": "array",
  7714. "items": {
  7715. "type": "string"
  7716. }
  7717. },
  7718. "enabled_providers": {
  7719. "description": "When set, ONLY these providers will be enabled. All other providers will be ignored",
  7720. "type": "array",
  7721. "items": {
  7722. "type": "string"
  7723. }
  7724. },
  7725. "model": {
  7726. "description": "Model to use in the format of provider/model, eg anthropic/claude-2",
  7727. "type": "string"
  7728. },
  7729. "small_model": {
  7730. "description": "Small model to use for tasks like title generation in the format of provider/model",
  7731. "type": "string"
  7732. },
  7733. "username": {
  7734. "description": "Custom username to display in conversations instead of system username",
  7735. "type": "string"
  7736. },
  7737. "mode": {
  7738. "description": "@deprecated Use `agent` field instead.",
  7739. "type": "object",
  7740. "properties": {
  7741. "build": {
  7742. "$ref": "#/components/schemas/AgentConfig"
  7743. },
  7744. "plan": {
  7745. "$ref": "#/components/schemas/AgentConfig"
  7746. }
  7747. },
  7748. "additionalProperties": {
  7749. "$ref": "#/components/schemas/AgentConfig"
  7750. }
  7751. },
  7752. "agent": {
  7753. "description": "Agent configuration, see https://opencode.ai/docs/agent",
  7754. "type": "object",
  7755. "properties": {
  7756. "plan": {
  7757. "$ref": "#/components/schemas/AgentConfig"
  7758. },
  7759. "build": {
  7760. "$ref": "#/components/schemas/AgentConfig"
  7761. },
  7762. "general": {
  7763. "$ref": "#/components/schemas/AgentConfig"
  7764. },
  7765. "explore": {
  7766. "$ref": "#/components/schemas/AgentConfig"
  7767. }
  7768. },
  7769. "additionalProperties": {
  7770. "$ref": "#/components/schemas/AgentConfig"
  7771. }
  7772. },
  7773. "provider": {
  7774. "description": "Custom provider configurations and model overrides",
  7775. "type": "object",
  7776. "propertyNames": {
  7777. "type": "string"
  7778. },
  7779. "additionalProperties": {
  7780. "$ref": "#/components/schemas/ProviderConfig"
  7781. }
  7782. },
  7783. "mcp": {
  7784. "description": "MCP (Model Context Protocol) server configurations",
  7785. "type": "object",
  7786. "propertyNames": {
  7787. "type": "string"
  7788. },
  7789. "additionalProperties": {
  7790. "anyOf": [
  7791. {
  7792. "$ref": "#/components/schemas/McpLocalConfig"
  7793. },
  7794. {
  7795. "$ref": "#/components/schemas/McpRemoteConfig"
  7796. }
  7797. ]
  7798. }
  7799. },
  7800. "formatter": {
  7801. "anyOf": [
  7802. {
  7803. "type": "boolean",
  7804. "const": false
  7805. },
  7806. {
  7807. "type": "object",
  7808. "propertyNames": {
  7809. "type": "string"
  7810. },
  7811. "additionalProperties": {
  7812. "type": "object",
  7813. "properties": {
  7814. "disabled": {
  7815. "type": "boolean"
  7816. },
  7817. "command": {
  7818. "type": "array",
  7819. "items": {
  7820. "type": "string"
  7821. }
  7822. },
  7823. "environment": {
  7824. "type": "object",
  7825. "propertyNames": {
  7826. "type": "string"
  7827. },
  7828. "additionalProperties": {
  7829. "type": "string"
  7830. }
  7831. },
  7832. "extensions": {
  7833. "type": "array",
  7834. "items": {
  7835. "type": "string"
  7836. }
  7837. }
  7838. }
  7839. }
  7840. }
  7841. ]
  7842. },
  7843. "lsp": {
  7844. "anyOf": [
  7845. {
  7846. "type": "boolean",
  7847. "const": false
  7848. },
  7849. {
  7850. "type": "object",
  7851. "propertyNames": {
  7852. "type": "string"
  7853. },
  7854. "additionalProperties": {
  7855. "anyOf": [
  7856. {
  7857. "type": "object",
  7858. "properties": {
  7859. "disabled": {
  7860. "type": "boolean",
  7861. "const": true
  7862. }
  7863. },
  7864. "required": ["disabled"]
  7865. },
  7866. {
  7867. "type": "object",
  7868. "properties": {
  7869. "command": {
  7870. "type": "array",
  7871. "items": {
  7872. "type": "string"
  7873. }
  7874. },
  7875. "extensions": {
  7876. "type": "array",
  7877. "items": {
  7878. "type": "string"
  7879. }
  7880. },
  7881. "disabled": {
  7882. "type": "boolean"
  7883. },
  7884. "env": {
  7885. "type": "object",
  7886. "propertyNames": {
  7887. "type": "string"
  7888. },
  7889. "additionalProperties": {
  7890. "type": "string"
  7891. }
  7892. },
  7893. "initialization": {
  7894. "type": "object",
  7895. "propertyNames": {
  7896. "type": "string"
  7897. },
  7898. "additionalProperties": {}
  7899. }
  7900. },
  7901. "required": ["command"]
  7902. }
  7903. ]
  7904. }
  7905. }
  7906. ]
  7907. },
  7908. "instructions": {
  7909. "description": "Additional instruction files or patterns to include",
  7910. "type": "array",
  7911. "items": {
  7912. "type": "string"
  7913. }
  7914. },
  7915. "layout": {
  7916. "$ref": "#/components/schemas/LayoutConfig"
  7917. },
  7918. "permission": {
  7919. "type": "object",
  7920. "properties": {
  7921. "edit": {
  7922. "type": "string",
  7923. "enum": ["ask", "allow", "deny"]
  7924. },
  7925. "bash": {
  7926. "anyOf": [
  7927. {
  7928. "type": "string",
  7929. "enum": ["ask", "allow", "deny"]
  7930. },
  7931. {
  7932. "type": "object",
  7933. "propertyNames": {
  7934. "type": "string"
  7935. },
  7936. "additionalProperties": {
  7937. "type": "string",
  7938. "enum": ["ask", "allow", "deny"]
  7939. }
  7940. }
  7941. ]
  7942. },
  7943. "webfetch": {
  7944. "type": "string",
  7945. "enum": ["ask", "allow", "deny"]
  7946. },
  7947. "doom_loop": {
  7948. "type": "string",
  7949. "enum": ["ask", "allow", "deny"]
  7950. },
  7951. "external_directory": {
  7952. "type": "string",
  7953. "enum": ["ask", "allow", "deny"]
  7954. }
  7955. }
  7956. },
  7957. "tools": {
  7958. "type": "object",
  7959. "propertyNames": {
  7960. "type": "string"
  7961. },
  7962. "additionalProperties": {
  7963. "type": "boolean"
  7964. }
  7965. },
  7966. "enterprise": {
  7967. "type": "object",
  7968. "properties": {
  7969. "url": {
  7970. "description": "Enterprise URL",
  7971. "type": "string"
  7972. }
  7973. }
  7974. },
  7975. "experimental": {
  7976. "type": "object",
  7977. "properties": {
  7978. "hook": {
  7979. "type": "object",
  7980. "properties": {
  7981. "file_edited": {
  7982. "type": "object",
  7983. "propertyNames": {
  7984. "type": "string"
  7985. },
  7986. "additionalProperties": {
  7987. "type": "array",
  7988. "items": {
  7989. "type": "object",
  7990. "properties": {
  7991. "command": {
  7992. "type": "array",
  7993. "items": {
  7994. "type": "string"
  7995. }
  7996. },
  7997. "environment": {
  7998. "type": "object",
  7999. "propertyNames": {
  8000. "type": "string"
  8001. },
  8002. "additionalProperties": {
  8003. "type": "string"
  8004. }
  8005. }
  8006. },
  8007. "required": ["command"]
  8008. }
  8009. }
  8010. },
  8011. "session_completed": {
  8012. "type": "array",
  8013. "items": {
  8014. "type": "object",
  8015. "properties": {
  8016. "command": {
  8017. "type": "array",
  8018. "items": {
  8019. "type": "string"
  8020. }
  8021. },
  8022. "environment": {
  8023. "type": "object",
  8024. "propertyNames": {
  8025. "type": "string"
  8026. },
  8027. "additionalProperties": {
  8028. "type": "string"
  8029. }
  8030. }
  8031. },
  8032. "required": ["command"]
  8033. }
  8034. }
  8035. }
  8036. },
  8037. "chatMaxRetries": {
  8038. "description": "Number of retries for chat completions on failure",
  8039. "type": "number"
  8040. },
  8041. "disable_paste_summary": {
  8042. "type": "boolean"
  8043. },
  8044. "batch_tool": {
  8045. "description": "Enable the batch tool",
  8046. "type": "boolean"
  8047. },
  8048. "openTelemetry": {
  8049. "description": "Enable OpenTelemetry spans for AI SDK calls (using the 'experimental_telemetry' flag)",
  8050. "type": "boolean"
  8051. },
  8052. "primary_tools": {
  8053. "description": "Tools that should only be available to primary agents.",
  8054. "type": "array",
  8055. "items": {
  8056. "type": "string"
  8057. }
  8058. }
  8059. }
  8060. }
  8061. },
  8062. "additionalProperties": false
  8063. },
  8064. "ToolIDs": {
  8065. "type": "array",
  8066. "items": {
  8067. "type": "string"
  8068. }
  8069. },
  8070. "ToolListItem": {
  8071. "type": "object",
  8072. "properties": {
  8073. "id": {
  8074. "type": "string"
  8075. },
  8076. "description": {
  8077. "type": "string"
  8078. },
  8079. "parameters": {}
  8080. },
  8081. "required": ["id", "description", "parameters"]
  8082. },
  8083. "ToolList": {
  8084. "type": "array",
  8085. "items": {
  8086. "$ref": "#/components/schemas/ToolListItem"
  8087. }
  8088. },
  8089. "Path": {
  8090. "type": "object",
  8091. "properties": {
  8092. "state": {
  8093. "type": "string"
  8094. },
  8095. "config": {
  8096. "type": "string"
  8097. },
  8098. "worktree": {
  8099. "type": "string"
  8100. },
  8101. "directory": {
  8102. "type": "string"
  8103. }
  8104. },
  8105. "required": ["state", "config", "worktree", "directory"]
  8106. },
  8107. "VcsInfo": {
  8108. "type": "object",
  8109. "properties": {
  8110. "branch": {
  8111. "type": "string"
  8112. }
  8113. },
  8114. "required": ["branch"]
  8115. },
  8116. "TextPartInput": {
  8117. "type": "object",
  8118. "properties": {
  8119. "id": {
  8120. "type": "string"
  8121. },
  8122. "type": {
  8123. "type": "string",
  8124. "const": "text"
  8125. },
  8126. "text": {
  8127. "type": "string"
  8128. },
  8129. "synthetic": {
  8130. "type": "boolean"
  8131. },
  8132. "ignored": {
  8133. "type": "boolean"
  8134. },
  8135. "time": {
  8136. "type": "object",
  8137. "properties": {
  8138. "start": {
  8139. "type": "number"
  8140. },
  8141. "end": {
  8142. "type": "number"
  8143. }
  8144. },
  8145. "required": ["start"]
  8146. },
  8147. "metadata": {
  8148. "type": "object",
  8149. "propertyNames": {
  8150. "type": "string"
  8151. },
  8152. "additionalProperties": {}
  8153. }
  8154. },
  8155. "required": ["type", "text"]
  8156. },
  8157. "FilePartInput": {
  8158. "type": "object",
  8159. "properties": {
  8160. "id": {
  8161. "type": "string"
  8162. },
  8163. "type": {
  8164. "type": "string",
  8165. "const": "file"
  8166. },
  8167. "mime": {
  8168. "type": "string"
  8169. },
  8170. "filename": {
  8171. "type": "string"
  8172. },
  8173. "url": {
  8174. "type": "string"
  8175. },
  8176. "source": {
  8177. "$ref": "#/components/schemas/FilePartSource"
  8178. }
  8179. },
  8180. "required": ["type", "mime", "url"]
  8181. },
  8182. "AgentPartInput": {
  8183. "type": "object",
  8184. "properties": {
  8185. "id": {
  8186. "type": "string"
  8187. },
  8188. "type": {
  8189. "type": "string",
  8190. "const": "agent"
  8191. },
  8192. "name": {
  8193. "type": "string"
  8194. },
  8195. "source": {
  8196. "type": "object",
  8197. "properties": {
  8198. "value": {
  8199. "type": "string"
  8200. },
  8201. "start": {
  8202. "type": "integer",
  8203. "minimum": -9007199254740991,
  8204. "maximum": 9007199254740991
  8205. },
  8206. "end": {
  8207. "type": "integer",
  8208. "minimum": -9007199254740991,
  8209. "maximum": 9007199254740991
  8210. }
  8211. },
  8212. "required": ["value", "start", "end"]
  8213. }
  8214. },
  8215. "required": ["type", "name"]
  8216. },
  8217. "SubtaskPartInput": {
  8218. "type": "object",
  8219. "properties": {
  8220. "id": {
  8221. "type": "string"
  8222. },
  8223. "type": {
  8224. "type": "string",
  8225. "const": "subtask"
  8226. },
  8227. "prompt": {
  8228. "type": "string"
  8229. },
  8230. "description": {
  8231. "type": "string"
  8232. },
  8233. "agent": {
  8234. "type": "string"
  8235. }
  8236. },
  8237. "required": ["type", "prompt", "description", "agent"]
  8238. },
  8239. "Command": {
  8240. "type": "object",
  8241. "properties": {
  8242. "name": {
  8243. "type": "string"
  8244. },
  8245. "description": {
  8246. "type": "string"
  8247. },
  8248. "agent": {
  8249. "type": "string"
  8250. },
  8251. "model": {
  8252. "type": "string"
  8253. },
  8254. "template": {
  8255. "type": "string"
  8256. },
  8257. "subtask": {
  8258. "type": "boolean"
  8259. }
  8260. },
  8261. "required": ["name", "template"]
  8262. },
  8263. "Model": {
  8264. "type": "object",
  8265. "properties": {
  8266. "id": {
  8267. "type": "string"
  8268. },
  8269. "providerID": {
  8270. "type": "string"
  8271. },
  8272. "api": {
  8273. "type": "object",
  8274. "properties": {
  8275. "id": {
  8276. "type": "string"
  8277. },
  8278. "url": {
  8279. "type": "string"
  8280. },
  8281. "npm": {
  8282. "type": "string"
  8283. }
  8284. },
  8285. "required": ["id", "url", "npm"]
  8286. },
  8287. "name": {
  8288. "type": "string"
  8289. },
  8290. "capabilities": {
  8291. "type": "object",
  8292. "properties": {
  8293. "temperature": {
  8294. "type": "boolean"
  8295. },
  8296. "reasoning": {
  8297. "type": "boolean"
  8298. },
  8299. "attachment": {
  8300. "type": "boolean"
  8301. },
  8302. "toolcall": {
  8303. "type": "boolean"
  8304. },
  8305. "input": {
  8306. "type": "object",
  8307. "properties": {
  8308. "text": {
  8309. "type": "boolean"
  8310. },
  8311. "audio": {
  8312. "type": "boolean"
  8313. },
  8314. "image": {
  8315. "type": "boolean"
  8316. },
  8317. "video": {
  8318. "type": "boolean"
  8319. },
  8320. "pdf": {
  8321. "type": "boolean"
  8322. }
  8323. },
  8324. "required": ["text", "audio", "image", "video", "pdf"]
  8325. },
  8326. "output": {
  8327. "type": "object",
  8328. "properties": {
  8329. "text": {
  8330. "type": "boolean"
  8331. },
  8332. "audio": {
  8333. "type": "boolean"
  8334. },
  8335. "image": {
  8336. "type": "boolean"
  8337. },
  8338. "video": {
  8339. "type": "boolean"
  8340. },
  8341. "pdf": {
  8342. "type": "boolean"
  8343. }
  8344. },
  8345. "required": ["text", "audio", "image", "video", "pdf"]
  8346. },
  8347. "interleaved": {
  8348. "anyOf": [
  8349. {
  8350. "type": "boolean"
  8351. },
  8352. {
  8353. "type": "object",
  8354. "properties": {
  8355. "field": {
  8356. "type": "string",
  8357. "enum": ["reasoning_content", "reasoning_details"]
  8358. }
  8359. },
  8360. "required": ["field"]
  8361. }
  8362. ]
  8363. }
  8364. },
  8365. "required": ["temperature", "reasoning", "attachment", "toolcall", "input", "output", "interleaved"]
  8366. },
  8367. "cost": {
  8368. "type": "object",
  8369. "properties": {
  8370. "input": {
  8371. "type": "number"
  8372. },
  8373. "output": {
  8374. "type": "number"
  8375. },
  8376. "cache": {
  8377. "type": "object",
  8378. "properties": {
  8379. "read": {
  8380. "type": "number"
  8381. },
  8382. "write": {
  8383. "type": "number"
  8384. }
  8385. },
  8386. "required": ["read", "write"]
  8387. },
  8388. "experimentalOver200K": {
  8389. "type": "object",
  8390. "properties": {
  8391. "input": {
  8392. "type": "number"
  8393. },
  8394. "output": {
  8395. "type": "number"
  8396. },
  8397. "cache": {
  8398. "type": "object",
  8399. "properties": {
  8400. "read": {
  8401. "type": "number"
  8402. },
  8403. "write": {
  8404. "type": "number"
  8405. }
  8406. },
  8407. "required": ["read", "write"]
  8408. }
  8409. },
  8410. "required": ["input", "output", "cache"]
  8411. }
  8412. },
  8413. "required": ["input", "output", "cache"]
  8414. },
  8415. "limit": {
  8416. "type": "object",
  8417. "properties": {
  8418. "context": {
  8419. "type": "number"
  8420. },
  8421. "output": {
  8422. "type": "number"
  8423. }
  8424. },
  8425. "required": ["context", "output"]
  8426. },
  8427. "status": {
  8428. "type": "string",
  8429. "enum": ["alpha", "beta", "deprecated", "active"]
  8430. },
  8431. "options": {
  8432. "type": "object",
  8433. "propertyNames": {
  8434. "type": "string"
  8435. },
  8436. "additionalProperties": {}
  8437. },
  8438. "headers": {
  8439. "type": "object",
  8440. "propertyNames": {
  8441. "type": "string"
  8442. },
  8443. "additionalProperties": {
  8444. "type": "string"
  8445. }
  8446. }
  8447. },
  8448. "required": ["id", "providerID", "api", "name", "capabilities", "cost", "limit", "status", "options", "headers"]
  8449. },
  8450. "Provider": {
  8451. "type": "object",
  8452. "properties": {
  8453. "id": {
  8454. "type": "string"
  8455. },
  8456. "name": {
  8457. "type": "string"
  8458. },
  8459. "source": {
  8460. "type": "string",
  8461. "enum": ["env", "config", "custom", "api"]
  8462. },
  8463. "env": {
  8464. "type": "array",
  8465. "items": {
  8466. "type": "string"
  8467. }
  8468. },
  8469. "key": {
  8470. "type": "string"
  8471. },
  8472. "options": {
  8473. "type": "object",
  8474. "propertyNames": {
  8475. "type": "string"
  8476. },
  8477. "additionalProperties": {}
  8478. },
  8479. "models": {
  8480. "type": "object",
  8481. "propertyNames": {
  8482. "type": "string"
  8483. },
  8484. "additionalProperties": {
  8485. "$ref": "#/components/schemas/Model"
  8486. }
  8487. }
  8488. },
  8489. "required": ["id", "name", "source", "env", "options", "models"]
  8490. },
  8491. "ProviderAuthMethod": {
  8492. "type": "object",
  8493. "properties": {
  8494. "type": {
  8495. "anyOf": [
  8496. {
  8497. "type": "string",
  8498. "const": "oauth"
  8499. },
  8500. {
  8501. "type": "string",
  8502. "const": "api"
  8503. }
  8504. ]
  8505. },
  8506. "label": {
  8507. "type": "string"
  8508. }
  8509. },
  8510. "required": ["type", "label"]
  8511. },
  8512. "ProviderAuthAuthorization": {
  8513. "type": "object",
  8514. "properties": {
  8515. "url": {
  8516. "type": "string"
  8517. },
  8518. "method": {
  8519. "anyOf": [
  8520. {
  8521. "type": "string",
  8522. "const": "auto"
  8523. },
  8524. {
  8525. "type": "string",
  8526. "const": "code"
  8527. }
  8528. ]
  8529. },
  8530. "instructions": {
  8531. "type": "string"
  8532. }
  8533. },
  8534. "required": ["url", "method", "instructions"]
  8535. },
  8536. "Symbol": {
  8537. "type": "object",
  8538. "properties": {
  8539. "name": {
  8540. "type": "string"
  8541. },
  8542. "kind": {
  8543. "type": "number"
  8544. },
  8545. "location": {
  8546. "type": "object",
  8547. "properties": {
  8548. "uri": {
  8549. "type": "string"
  8550. },
  8551. "range": {
  8552. "$ref": "#/components/schemas/Range"
  8553. }
  8554. },
  8555. "required": ["uri", "range"]
  8556. }
  8557. },
  8558. "required": ["name", "kind", "location"]
  8559. },
  8560. "FileNode": {
  8561. "type": "object",
  8562. "properties": {
  8563. "name": {
  8564. "type": "string"
  8565. },
  8566. "path": {
  8567. "type": "string"
  8568. },
  8569. "absolute": {
  8570. "type": "string"
  8571. },
  8572. "type": {
  8573. "type": "string",
  8574. "enum": ["file", "directory"]
  8575. },
  8576. "ignored": {
  8577. "type": "boolean"
  8578. }
  8579. },
  8580. "required": ["name", "path", "absolute", "type", "ignored"]
  8581. },
  8582. "FileContent": {
  8583. "type": "object",
  8584. "properties": {
  8585. "type": {
  8586. "type": "string",
  8587. "const": "text"
  8588. },
  8589. "content": {
  8590. "type": "string"
  8591. },
  8592. "diff": {
  8593. "type": "string"
  8594. },
  8595. "patch": {
  8596. "type": "object",
  8597. "properties": {
  8598. "oldFileName": {
  8599. "type": "string"
  8600. },
  8601. "newFileName": {
  8602. "type": "string"
  8603. },
  8604. "oldHeader": {
  8605. "type": "string"
  8606. },
  8607. "newHeader": {
  8608. "type": "string"
  8609. },
  8610. "hunks": {
  8611. "type": "array",
  8612. "items": {
  8613. "type": "object",
  8614. "properties": {
  8615. "oldStart": {
  8616. "type": "number"
  8617. },
  8618. "oldLines": {
  8619. "type": "number"
  8620. },
  8621. "newStart": {
  8622. "type": "number"
  8623. },
  8624. "newLines": {
  8625. "type": "number"
  8626. },
  8627. "lines": {
  8628. "type": "array",
  8629. "items": {
  8630. "type": "string"
  8631. }
  8632. }
  8633. },
  8634. "required": ["oldStart", "oldLines", "newStart", "newLines", "lines"]
  8635. }
  8636. },
  8637. "index": {
  8638. "type": "string"
  8639. }
  8640. },
  8641. "required": ["oldFileName", "newFileName", "hunks"]
  8642. },
  8643. "encoding": {
  8644. "type": "string",
  8645. "const": "base64"
  8646. },
  8647. "mimeType": {
  8648. "type": "string"
  8649. }
  8650. },
  8651. "required": ["type", "content"]
  8652. },
  8653. "File": {
  8654. "type": "object",
  8655. "properties": {
  8656. "path": {
  8657. "type": "string"
  8658. },
  8659. "added": {
  8660. "type": "integer",
  8661. "minimum": -9007199254740991,
  8662. "maximum": 9007199254740991
  8663. },
  8664. "removed": {
  8665. "type": "integer",
  8666. "minimum": -9007199254740991,
  8667. "maximum": 9007199254740991
  8668. },
  8669. "status": {
  8670. "type": "string",
  8671. "enum": ["added", "deleted", "modified"]
  8672. }
  8673. },
  8674. "required": ["path", "added", "removed", "status"]
  8675. },
  8676. "Agent": {
  8677. "type": "object",
  8678. "properties": {
  8679. "name": {
  8680. "type": "string"
  8681. },
  8682. "description": {
  8683. "type": "string"
  8684. },
  8685. "mode": {
  8686. "type": "string",
  8687. "enum": ["subagent", "primary", "all"]
  8688. },
  8689. "builtIn": {
  8690. "type": "boolean"
  8691. },
  8692. "topP": {
  8693. "type": "number"
  8694. },
  8695. "temperature": {
  8696. "type": "number"
  8697. },
  8698. "color": {
  8699. "type": "string"
  8700. },
  8701. "permission": {
  8702. "type": "object",
  8703. "properties": {
  8704. "edit": {
  8705. "type": "string",
  8706. "enum": ["ask", "allow", "deny"]
  8707. },
  8708. "bash": {
  8709. "type": "object",
  8710. "propertyNames": {
  8711. "type": "string"
  8712. },
  8713. "additionalProperties": {
  8714. "type": "string",
  8715. "enum": ["ask", "allow", "deny"]
  8716. }
  8717. },
  8718. "webfetch": {
  8719. "type": "string",
  8720. "enum": ["ask", "allow", "deny"]
  8721. },
  8722. "doom_loop": {
  8723. "type": "string",
  8724. "enum": ["ask", "allow", "deny"]
  8725. },
  8726. "external_directory": {
  8727. "type": "string",
  8728. "enum": ["ask", "allow", "deny"]
  8729. }
  8730. },
  8731. "required": ["edit", "bash"]
  8732. },
  8733. "model": {
  8734. "type": "object",
  8735. "properties": {
  8736. "modelID": {
  8737. "type": "string"
  8738. },
  8739. "providerID": {
  8740. "type": "string"
  8741. }
  8742. },
  8743. "required": ["modelID", "providerID"]
  8744. },
  8745. "prompt": {
  8746. "type": "string"
  8747. },
  8748. "tools": {
  8749. "type": "object",
  8750. "propertyNames": {
  8751. "type": "string"
  8752. },
  8753. "additionalProperties": {
  8754. "type": "boolean"
  8755. }
  8756. },
  8757. "options": {
  8758. "type": "object",
  8759. "propertyNames": {
  8760. "type": "string"
  8761. },
  8762. "additionalProperties": {}
  8763. },
  8764. "maxSteps": {
  8765. "type": "integer",
  8766. "exclusiveMinimum": 0,
  8767. "maximum": 9007199254740991
  8768. }
  8769. },
  8770. "required": ["name", "mode", "builtIn", "permission", "tools", "options"]
  8771. },
  8772. "MCPStatusConnected": {
  8773. "type": "object",
  8774. "properties": {
  8775. "status": {
  8776. "type": "string",
  8777. "const": "connected"
  8778. }
  8779. },
  8780. "required": ["status"]
  8781. },
  8782. "MCPStatusDisabled": {
  8783. "type": "object",
  8784. "properties": {
  8785. "status": {
  8786. "type": "string",
  8787. "const": "disabled"
  8788. }
  8789. },
  8790. "required": ["status"]
  8791. },
  8792. "MCPStatusFailed": {
  8793. "type": "object",
  8794. "properties": {
  8795. "status": {
  8796. "type": "string",
  8797. "const": "failed"
  8798. },
  8799. "error": {
  8800. "type": "string"
  8801. }
  8802. },
  8803. "required": ["status", "error"]
  8804. },
  8805. "MCPStatusNeedsAuth": {
  8806. "type": "object",
  8807. "properties": {
  8808. "status": {
  8809. "type": "string",
  8810. "const": "needs_auth"
  8811. }
  8812. },
  8813. "required": ["status"]
  8814. },
  8815. "MCPStatusNeedsClientRegistration": {
  8816. "type": "object",
  8817. "properties": {
  8818. "status": {
  8819. "type": "string",
  8820. "const": "needs_client_registration"
  8821. },
  8822. "error": {
  8823. "type": "string"
  8824. }
  8825. },
  8826. "required": ["status", "error"]
  8827. },
  8828. "MCPStatus": {
  8829. "anyOf": [
  8830. {
  8831. "$ref": "#/components/schemas/MCPStatusConnected"
  8832. },
  8833. {
  8834. "$ref": "#/components/schemas/MCPStatusDisabled"
  8835. },
  8836. {
  8837. "$ref": "#/components/schemas/MCPStatusFailed"
  8838. },
  8839. {
  8840. "$ref": "#/components/schemas/MCPStatusNeedsAuth"
  8841. },
  8842. {
  8843. "$ref": "#/components/schemas/MCPStatusNeedsClientRegistration"
  8844. }
  8845. ]
  8846. },
  8847. "LSPStatus": {
  8848. "type": "object",
  8849. "properties": {
  8850. "id": {
  8851. "type": "string"
  8852. },
  8853. "name": {
  8854. "type": "string"
  8855. },
  8856. "root": {
  8857. "type": "string"
  8858. },
  8859. "status": {
  8860. "anyOf": [
  8861. {
  8862. "type": "string",
  8863. "const": "connected"
  8864. },
  8865. {
  8866. "type": "string",
  8867. "const": "error"
  8868. }
  8869. ]
  8870. }
  8871. },
  8872. "required": ["id", "name", "root", "status"]
  8873. },
  8874. "FormatterStatus": {
  8875. "type": "object",
  8876. "properties": {
  8877. "name": {
  8878. "type": "string"
  8879. },
  8880. "extensions": {
  8881. "type": "array",
  8882. "items": {
  8883. "type": "string"
  8884. }
  8885. },
  8886. "enabled": {
  8887. "type": "boolean"
  8888. }
  8889. },
  8890. "required": ["name", "extensions", "enabled"]
  8891. },
  8892. "OAuth": {
  8893. "type": "object",
  8894. "properties": {
  8895. "type": {
  8896. "type": "string",
  8897. "const": "oauth"
  8898. },
  8899. "refresh": {
  8900. "type": "string"
  8901. },
  8902. "access": {
  8903. "type": "string"
  8904. },
  8905. "expires": {
  8906. "type": "number"
  8907. },
  8908. "enterpriseUrl": {
  8909. "type": "string"
  8910. }
  8911. },
  8912. "required": ["type", "refresh", "access", "expires"]
  8913. },
  8914. "ApiAuth": {
  8915. "type": "object",
  8916. "properties": {
  8917. "type": {
  8918. "type": "string",
  8919. "const": "api"
  8920. },
  8921. "key": {
  8922. "type": "string"
  8923. }
  8924. },
  8925. "required": ["type", "key"]
  8926. },
  8927. "WellKnownAuth": {
  8928. "type": "object",
  8929. "properties": {
  8930. "type": {
  8931. "type": "string",
  8932. "const": "wellknown"
  8933. },
  8934. "key": {
  8935. "type": "string"
  8936. },
  8937. "token": {
  8938. "type": "string"
  8939. }
  8940. },
  8941. "required": ["type", "key", "token"]
  8942. },
  8943. "Auth": {
  8944. "anyOf": [
  8945. {
  8946. "$ref": "#/components/schemas/OAuth"
  8947. },
  8948. {
  8949. "$ref": "#/components/schemas/ApiAuth"
  8950. },
  8951. {
  8952. "$ref": "#/components/schemas/WellKnownAuth"
  8953. }
  8954. ]
  8955. }
  8956. }
  8957. }
  8958. }