2
0

openapi.json 281 KB

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