openapi.json 328 KB

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