openapi.json 244 KB

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