openapi.json 253 KB

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