openapi.json 252 KB

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