openapi.json 271 KB

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