openapi.json 251 KB

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