openapi.json 246 KB

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