openapi.json 324 KB

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