openapi.json 314 KB

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