2
0

openapi.json 307 KB

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