openapi.json 278 KB

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