openapi.json 253 KB

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