openapi.json 328 KB

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