openapi.json 344 KB

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