openapi.json 363 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418
  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. "/global/upgrade": {
  162. "post": {
  163. "operationId": "global.upgrade",
  164. "summary": "Upgrade opencode",
  165. "description": "Upgrade opencode to the specified version or latest if not specified.",
  166. "responses": {
  167. "200": {
  168. "description": "Upgrade result",
  169. "content": {
  170. "application/json": {
  171. "schema": {
  172. "anyOf": [
  173. {
  174. "type": "object",
  175. "properties": {
  176. "success": {
  177. "type": "boolean",
  178. "const": true
  179. },
  180. "version": {
  181. "type": "string"
  182. }
  183. },
  184. "required": ["success", "version"]
  185. },
  186. {
  187. "type": "object",
  188. "properties": {
  189. "success": {
  190. "type": "boolean",
  191. "const": false
  192. },
  193. "error": {
  194. "type": "string"
  195. }
  196. },
  197. "required": ["success", "error"]
  198. }
  199. ]
  200. }
  201. }
  202. }
  203. },
  204. "400": {
  205. "description": "Bad request",
  206. "content": {
  207. "application/json": {
  208. "schema": {
  209. "$ref": "#/components/schemas/BadRequestError"
  210. }
  211. }
  212. }
  213. }
  214. },
  215. "requestBody": {
  216. "content": {
  217. "application/json": {
  218. "schema": {
  219. "type": "object",
  220. "properties": {
  221. "target": {
  222. "type": "string"
  223. }
  224. }
  225. }
  226. }
  227. }
  228. },
  229. "x-codeSamples": [
  230. {
  231. "lang": "js",
  232. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.upgrade({\n ...\n})"
  233. }
  234. ]
  235. }
  236. },
  237. "/auth/{providerID}": {
  238. "put": {
  239. "operationId": "auth.set",
  240. "summary": "Set auth credentials",
  241. "description": "Set authentication credentials",
  242. "responses": {
  243. "200": {
  244. "description": "Successfully set authentication credentials",
  245. "content": {
  246. "application/json": {
  247. "schema": {
  248. "type": "boolean"
  249. }
  250. }
  251. }
  252. },
  253. "400": {
  254. "description": "Bad request",
  255. "content": {
  256. "application/json": {
  257. "schema": {
  258. "$ref": "#/components/schemas/BadRequestError"
  259. }
  260. }
  261. }
  262. }
  263. },
  264. "parameters": [
  265. {
  266. "in": "path",
  267. "name": "providerID",
  268. "schema": {
  269. "type": "string"
  270. },
  271. "required": true
  272. }
  273. ],
  274. "requestBody": {
  275. "content": {
  276. "application/json": {
  277. "schema": {
  278. "$ref": "#/components/schemas/Auth"
  279. }
  280. }
  281. }
  282. },
  283. "x-codeSamples": [
  284. {
  285. "lang": "js",
  286. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.auth.set({\n ...\n})"
  287. }
  288. ]
  289. },
  290. "delete": {
  291. "operationId": "auth.remove",
  292. "summary": "Remove auth credentials",
  293. "description": "Remove authentication credentials",
  294. "responses": {
  295. "200": {
  296. "description": "Successfully removed authentication credentials",
  297. "content": {
  298. "application/json": {
  299. "schema": {
  300. "type": "boolean"
  301. }
  302. }
  303. }
  304. },
  305. "400": {
  306. "description": "Bad request",
  307. "content": {
  308. "application/json": {
  309. "schema": {
  310. "$ref": "#/components/schemas/BadRequestError"
  311. }
  312. }
  313. }
  314. }
  315. },
  316. "parameters": [
  317. {
  318. "in": "path",
  319. "name": "providerID",
  320. "schema": {
  321. "type": "string"
  322. },
  323. "required": true
  324. }
  325. ],
  326. "x-codeSamples": [
  327. {
  328. "lang": "js",
  329. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.auth.remove({\n ...\n})"
  330. }
  331. ]
  332. }
  333. },
  334. "/log": {
  335. "post": {
  336. "operationId": "app.log",
  337. "parameters": [
  338. {
  339. "in": "query",
  340. "name": "directory",
  341. "schema": {
  342. "type": "string"
  343. }
  344. },
  345. {
  346. "in": "query",
  347. "name": "workspace",
  348. "schema": {
  349. "type": "string"
  350. }
  351. }
  352. ],
  353. "summary": "Write log",
  354. "description": "Write a log entry to the server logs with specified level and metadata.",
  355. "responses": {
  356. "200": {
  357. "description": "Log entry written successfully",
  358. "content": {
  359. "application/json": {
  360. "schema": {
  361. "type": "boolean"
  362. }
  363. }
  364. }
  365. },
  366. "400": {
  367. "description": "Bad request",
  368. "content": {
  369. "application/json": {
  370. "schema": {
  371. "$ref": "#/components/schemas/BadRequestError"
  372. }
  373. }
  374. }
  375. }
  376. },
  377. "requestBody": {
  378. "content": {
  379. "application/json": {
  380. "schema": {
  381. "type": "object",
  382. "properties": {
  383. "service": {
  384. "description": "Service name for the log entry",
  385. "type": "string"
  386. },
  387. "level": {
  388. "description": "Log level",
  389. "type": "string",
  390. "enum": ["debug", "info", "error", "warn"]
  391. },
  392. "message": {
  393. "description": "Log message",
  394. "type": "string"
  395. },
  396. "extra": {
  397. "description": "Additional metadata for the log entry",
  398. "type": "object",
  399. "propertyNames": {
  400. "type": "string"
  401. },
  402. "additionalProperties": {}
  403. }
  404. },
  405. "required": ["service", "level", "message"]
  406. }
  407. }
  408. }
  409. },
  410. "x-codeSamples": [
  411. {
  412. "lang": "js",
  413. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.app.log({\n ...\n})"
  414. }
  415. ]
  416. }
  417. },
  418. "/experimental/workspace/adaptor": {
  419. "get": {
  420. "operationId": "experimental.workspace.adaptor.list",
  421. "parameters": [
  422. {
  423. "in": "query",
  424. "name": "directory",
  425. "schema": {
  426. "type": "string"
  427. }
  428. },
  429. {
  430. "in": "query",
  431. "name": "workspace",
  432. "schema": {
  433. "type": "string"
  434. }
  435. }
  436. ],
  437. "summary": "List workspace adaptors",
  438. "description": "List all available workspace adaptors for the current project.",
  439. "responses": {
  440. "200": {
  441. "description": "Workspace adaptors",
  442. "content": {
  443. "application/json": {
  444. "schema": {
  445. "type": "array",
  446. "items": {
  447. "type": "object",
  448. "properties": {
  449. "type": {
  450. "type": "string"
  451. },
  452. "name": {
  453. "type": "string"
  454. },
  455. "description": {
  456. "type": "string"
  457. }
  458. },
  459. "required": ["type", "name", "description"]
  460. }
  461. }
  462. }
  463. }
  464. }
  465. },
  466. "x-codeSamples": [
  467. {
  468. "lang": "js",
  469. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.adaptor.list({\n ...\n})"
  470. }
  471. ]
  472. }
  473. },
  474. "/experimental/workspace": {
  475. "post": {
  476. "operationId": "experimental.workspace.create",
  477. "parameters": [
  478. {
  479. "in": "query",
  480. "name": "directory",
  481. "schema": {
  482. "type": "string"
  483. }
  484. },
  485. {
  486. "in": "query",
  487. "name": "workspace",
  488. "schema": {
  489. "type": "string"
  490. }
  491. }
  492. ],
  493. "summary": "Create workspace",
  494. "description": "Create a workspace for the current project.",
  495. "responses": {
  496. "200": {
  497. "description": "Workspace created",
  498. "content": {
  499. "application/json": {
  500. "schema": {
  501. "$ref": "#/components/schemas/Workspace"
  502. }
  503. }
  504. }
  505. },
  506. "400": {
  507. "description": "Bad request",
  508. "content": {
  509. "application/json": {
  510. "schema": {
  511. "$ref": "#/components/schemas/BadRequestError"
  512. }
  513. }
  514. }
  515. }
  516. },
  517. "requestBody": {
  518. "content": {
  519. "application/json": {
  520. "schema": {
  521. "type": "object",
  522. "properties": {
  523. "id": {
  524. "type": "string",
  525. "pattern": "^wrk.*"
  526. },
  527. "type": {
  528. "type": "string"
  529. },
  530. "branch": {
  531. "anyOf": [
  532. {
  533. "type": "string"
  534. },
  535. {
  536. "type": "null"
  537. }
  538. ]
  539. },
  540. "extra": {
  541. "anyOf": [
  542. {},
  543. {
  544. "type": "null"
  545. }
  546. ]
  547. }
  548. },
  549. "required": ["type", "branch", "extra"]
  550. }
  551. }
  552. }
  553. },
  554. "x-codeSamples": [
  555. {
  556. "lang": "js",
  557. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.create({\n ...\n})"
  558. }
  559. ]
  560. },
  561. "get": {
  562. "operationId": "experimental.workspace.list",
  563. "parameters": [
  564. {
  565. "in": "query",
  566. "name": "directory",
  567. "schema": {
  568. "type": "string"
  569. }
  570. },
  571. {
  572. "in": "query",
  573. "name": "workspace",
  574. "schema": {
  575. "type": "string"
  576. }
  577. }
  578. ],
  579. "summary": "List workspaces",
  580. "description": "List all workspaces.",
  581. "responses": {
  582. "200": {
  583. "description": "Workspaces",
  584. "content": {
  585. "application/json": {
  586. "schema": {
  587. "type": "array",
  588. "items": {
  589. "$ref": "#/components/schemas/Workspace"
  590. }
  591. }
  592. }
  593. }
  594. }
  595. },
  596. "x-codeSamples": [
  597. {
  598. "lang": "js",
  599. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.list({\n ...\n})"
  600. }
  601. ]
  602. }
  603. },
  604. "/experimental/workspace/status": {
  605. "get": {
  606. "operationId": "experimental.workspace.status",
  607. "parameters": [
  608. {
  609. "in": "query",
  610. "name": "directory",
  611. "schema": {
  612. "type": "string"
  613. }
  614. },
  615. {
  616. "in": "query",
  617. "name": "workspace",
  618. "schema": {
  619. "type": "string"
  620. }
  621. }
  622. ],
  623. "summary": "Workspace status",
  624. "description": "Get connection status for workspaces in the current project.",
  625. "responses": {
  626. "200": {
  627. "description": "Workspace status",
  628. "content": {
  629. "application/json": {
  630. "schema": {
  631. "type": "array",
  632. "items": {
  633. "type": "object",
  634. "properties": {
  635. "workspaceID": {
  636. "type": "string",
  637. "pattern": "^wrk.*"
  638. },
  639. "status": {
  640. "type": "string",
  641. "enum": ["connected", "connecting", "disconnected", "error"]
  642. }
  643. },
  644. "required": ["workspaceID", "status"]
  645. }
  646. }
  647. }
  648. }
  649. }
  650. },
  651. "x-codeSamples": [
  652. {
  653. "lang": "js",
  654. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.status({\n ...\n})"
  655. }
  656. ]
  657. }
  658. },
  659. "/experimental/workspace/{id}": {
  660. "delete": {
  661. "operationId": "experimental.workspace.remove",
  662. "parameters": [
  663. {
  664. "in": "query",
  665. "name": "directory",
  666. "schema": {
  667. "type": "string"
  668. }
  669. },
  670. {
  671. "in": "query",
  672. "name": "workspace",
  673. "schema": {
  674. "type": "string"
  675. }
  676. },
  677. {
  678. "in": "path",
  679. "name": "id",
  680. "schema": {
  681. "type": "string",
  682. "pattern": "^wrk.*"
  683. },
  684. "required": true
  685. }
  686. ],
  687. "summary": "Remove workspace",
  688. "description": "Remove an existing workspace.",
  689. "responses": {
  690. "200": {
  691. "description": "Workspace removed",
  692. "content": {
  693. "application/json": {
  694. "schema": {
  695. "$ref": "#/components/schemas/Workspace"
  696. }
  697. }
  698. }
  699. },
  700. "400": {
  701. "description": "Bad request",
  702. "content": {
  703. "application/json": {
  704. "schema": {
  705. "$ref": "#/components/schemas/BadRequestError"
  706. }
  707. }
  708. }
  709. }
  710. },
  711. "x-codeSamples": [
  712. {
  713. "lang": "js",
  714. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.remove({\n ...\n})"
  715. }
  716. ]
  717. }
  718. },
  719. "/experimental/workspace/{id}/session-restore": {
  720. "post": {
  721. "operationId": "experimental.workspace.sessionRestore",
  722. "parameters": [
  723. {
  724. "in": "query",
  725. "name": "directory",
  726. "schema": {
  727. "type": "string"
  728. }
  729. },
  730. {
  731. "in": "query",
  732. "name": "workspace",
  733. "schema": {
  734. "type": "string"
  735. }
  736. },
  737. {
  738. "in": "path",
  739. "name": "id",
  740. "schema": {
  741. "type": "string",
  742. "pattern": "^wrk.*"
  743. },
  744. "required": true
  745. }
  746. ],
  747. "summary": "Restore session into workspace",
  748. "description": "Replay a session's sync events into the target workspace in batches.",
  749. "responses": {
  750. "200": {
  751. "description": "Session replay started",
  752. "content": {
  753. "application/json": {
  754. "schema": {
  755. "type": "object",
  756. "properties": {
  757. "total": {
  758. "type": "integer",
  759. "minimum": 0,
  760. "maximum": 9007199254740991
  761. }
  762. },
  763. "required": ["total"]
  764. }
  765. }
  766. }
  767. },
  768. "400": {
  769. "description": "Bad request",
  770. "content": {
  771. "application/json": {
  772. "schema": {
  773. "$ref": "#/components/schemas/BadRequestError"
  774. }
  775. }
  776. }
  777. }
  778. },
  779. "requestBody": {
  780. "content": {
  781. "application/json": {
  782. "schema": {
  783. "type": "object",
  784. "properties": {
  785. "sessionID": {
  786. "type": "string",
  787. "pattern": "^ses.*"
  788. }
  789. },
  790. "required": ["sessionID"]
  791. }
  792. }
  793. }
  794. },
  795. "x-codeSamples": [
  796. {
  797. "lang": "js",
  798. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.sessionRestore({\n ...\n})"
  799. }
  800. ]
  801. }
  802. },
  803. "/project": {
  804. "get": {
  805. "operationId": "project.list",
  806. "parameters": [
  807. {
  808. "in": "query",
  809. "name": "directory",
  810. "schema": {
  811. "type": "string"
  812. }
  813. },
  814. {
  815. "in": "query",
  816. "name": "workspace",
  817. "schema": {
  818. "type": "string"
  819. }
  820. }
  821. ],
  822. "summary": "List all projects",
  823. "description": "Get a list of projects that have been opened with OpenCode.",
  824. "responses": {
  825. "200": {
  826. "description": "List of projects",
  827. "content": {
  828. "application/json": {
  829. "schema": {
  830. "type": "array",
  831. "items": {
  832. "$ref": "#/components/schemas/Project"
  833. }
  834. }
  835. }
  836. }
  837. }
  838. },
  839. "x-codeSamples": [
  840. {
  841. "lang": "js",
  842. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.list({\n ...\n})"
  843. }
  844. ]
  845. }
  846. },
  847. "/project/current": {
  848. "get": {
  849. "operationId": "project.current",
  850. "parameters": [
  851. {
  852. "in": "query",
  853. "name": "directory",
  854. "schema": {
  855. "type": "string"
  856. }
  857. },
  858. {
  859. "in": "query",
  860. "name": "workspace",
  861. "schema": {
  862. "type": "string"
  863. }
  864. }
  865. ],
  866. "summary": "Get current project",
  867. "description": "Retrieve the currently active project that OpenCode is working with.",
  868. "responses": {
  869. "200": {
  870. "description": "Current project information",
  871. "content": {
  872. "application/json": {
  873. "schema": {
  874. "$ref": "#/components/schemas/Project"
  875. }
  876. }
  877. }
  878. }
  879. },
  880. "x-codeSamples": [
  881. {
  882. "lang": "js",
  883. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.current({\n ...\n})"
  884. }
  885. ]
  886. }
  887. },
  888. "/project/git/init": {
  889. "post": {
  890. "operationId": "project.initGit",
  891. "parameters": [
  892. {
  893. "in": "query",
  894. "name": "directory",
  895. "schema": {
  896. "type": "string"
  897. }
  898. },
  899. {
  900. "in": "query",
  901. "name": "workspace",
  902. "schema": {
  903. "type": "string"
  904. }
  905. }
  906. ],
  907. "summary": "Initialize git repository",
  908. "description": "Create a git repository for the current project and return the refreshed project info.",
  909. "responses": {
  910. "200": {
  911. "description": "Project information after git initialization",
  912. "content": {
  913. "application/json": {
  914. "schema": {
  915. "$ref": "#/components/schemas/Project"
  916. }
  917. }
  918. }
  919. }
  920. },
  921. "x-codeSamples": [
  922. {
  923. "lang": "js",
  924. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.initGit({\n ...\n})"
  925. }
  926. ]
  927. }
  928. },
  929. "/project/{projectID}": {
  930. "patch": {
  931. "operationId": "project.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. "in": "path",
  949. "name": "projectID",
  950. "schema": {
  951. "type": "string"
  952. },
  953. "required": true
  954. }
  955. ],
  956. "summary": "Update project",
  957. "description": "Update project properties such as name, icon, and commands.",
  958. "responses": {
  959. "200": {
  960. "description": "Updated project information",
  961. "content": {
  962. "application/json": {
  963. "schema": {
  964. "$ref": "#/components/schemas/Project"
  965. }
  966. }
  967. }
  968. },
  969. "400": {
  970. "description": "Bad request",
  971. "content": {
  972. "application/json": {
  973. "schema": {
  974. "$ref": "#/components/schemas/BadRequestError"
  975. }
  976. }
  977. }
  978. },
  979. "404": {
  980. "description": "Not found",
  981. "content": {
  982. "application/json": {
  983. "schema": {
  984. "$ref": "#/components/schemas/NotFoundError"
  985. }
  986. }
  987. }
  988. }
  989. },
  990. "requestBody": {
  991. "content": {
  992. "application/json": {
  993. "schema": {
  994. "type": "object",
  995. "properties": {
  996. "name": {
  997. "type": "string"
  998. },
  999. "icon": {
  1000. "type": "object",
  1001. "properties": {
  1002. "url": {
  1003. "type": "string"
  1004. },
  1005. "override": {
  1006. "type": "string"
  1007. },
  1008. "color": {
  1009. "type": "string"
  1010. }
  1011. }
  1012. },
  1013. "commands": {
  1014. "type": "object",
  1015. "properties": {
  1016. "start": {
  1017. "description": "Startup script to run when creating a new workspace (worktree)",
  1018. "type": "string"
  1019. }
  1020. }
  1021. }
  1022. }
  1023. }
  1024. }
  1025. }
  1026. },
  1027. "x-codeSamples": [
  1028. {
  1029. "lang": "js",
  1030. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.update({\n ...\n})"
  1031. }
  1032. ]
  1033. }
  1034. },
  1035. "/pty": {
  1036. "get": {
  1037. "operationId": "pty.list",
  1038. "parameters": [
  1039. {
  1040. "in": "query",
  1041. "name": "directory",
  1042. "schema": {
  1043. "type": "string"
  1044. }
  1045. },
  1046. {
  1047. "in": "query",
  1048. "name": "workspace",
  1049. "schema": {
  1050. "type": "string"
  1051. }
  1052. }
  1053. ],
  1054. "summary": "List PTY sessions",
  1055. "description": "Get a list of all active pseudo-terminal (PTY) sessions managed by OpenCode.",
  1056. "responses": {
  1057. "200": {
  1058. "description": "List of sessions",
  1059. "content": {
  1060. "application/json": {
  1061. "schema": {
  1062. "type": "array",
  1063. "items": {
  1064. "$ref": "#/components/schemas/Pty"
  1065. }
  1066. }
  1067. }
  1068. }
  1069. }
  1070. },
  1071. "x-codeSamples": [
  1072. {
  1073. "lang": "js",
  1074. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.list({\n ...\n})"
  1075. }
  1076. ]
  1077. },
  1078. "post": {
  1079. "operationId": "pty.create",
  1080. "parameters": [
  1081. {
  1082. "in": "query",
  1083. "name": "directory",
  1084. "schema": {
  1085. "type": "string"
  1086. }
  1087. },
  1088. {
  1089. "in": "query",
  1090. "name": "workspace",
  1091. "schema": {
  1092. "type": "string"
  1093. }
  1094. }
  1095. ],
  1096. "summary": "Create PTY session",
  1097. "description": "Create a new pseudo-terminal (PTY) session for running shell commands and processes.",
  1098. "responses": {
  1099. "200": {
  1100. "description": "Created session",
  1101. "content": {
  1102. "application/json": {
  1103. "schema": {
  1104. "$ref": "#/components/schemas/Pty"
  1105. }
  1106. }
  1107. }
  1108. },
  1109. "400": {
  1110. "description": "Bad request",
  1111. "content": {
  1112. "application/json": {
  1113. "schema": {
  1114. "$ref": "#/components/schemas/BadRequestError"
  1115. }
  1116. }
  1117. }
  1118. }
  1119. },
  1120. "requestBody": {
  1121. "content": {
  1122. "application/json": {
  1123. "schema": {
  1124. "type": "object",
  1125. "properties": {
  1126. "command": {
  1127. "type": "string"
  1128. },
  1129. "args": {
  1130. "type": "array",
  1131. "items": {
  1132. "type": "string"
  1133. }
  1134. },
  1135. "cwd": {
  1136. "type": "string"
  1137. },
  1138. "title": {
  1139. "type": "string"
  1140. },
  1141. "env": {
  1142. "type": "object",
  1143. "propertyNames": {
  1144. "type": "string"
  1145. },
  1146. "additionalProperties": {
  1147. "type": "string"
  1148. }
  1149. }
  1150. }
  1151. }
  1152. }
  1153. }
  1154. },
  1155. "x-codeSamples": [
  1156. {
  1157. "lang": "js",
  1158. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.create({\n ...\n})"
  1159. }
  1160. ]
  1161. }
  1162. },
  1163. "/pty/{ptyID}": {
  1164. "get": {
  1165. "operationId": "pty.get",
  1166. "parameters": [
  1167. {
  1168. "in": "query",
  1169. "name": "directory",
  1170. "schema": {
  1171. "type": "string"
  1172. }
  1173. },
  1174. {
  1175. "in": "query",
  1176. "name": "workspace",
  1177. "schema": {
  1178. "type": "string"
  1179. }
  1180. },
  1181. {
  1182. "in": "path",
  1183. "name": "ptyID",
  1184. "schema": {
  1185. "type": "string",
  1186. "pattern": "^pty.*"
  1187. },
  1188. "required": true
  1189. }
  1190. ],
  1191. "summary": "Get PTY session",
  1192. "description": "Retrieve detailed information about a specific pseudo-terminal (PTY) session.",
  1193. "responses": {
  1194. "200": {
  1195. "description": "Session info",
  1196. "content": {
  1197. "application/json": {
  1198. "schema": {
  1199. "$ref": "#/components/schemas/Pty"
  1200. }
  1201. }
  1202. }
  1203. },
  1204. "404": {
  1205. "description": "Not found",
  1206. "content": {
  1207. "application/json": {
  1208. "schema": {
  1209. "$ref": "#/components/schemas/NotFoundError"
  1210. }
  1211. }
  1212. }
  1213. }
  1214. },
  1215. "x-codeSamples": [
  1216. {
  1217. "lang": "js",
  1218. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.get({\n ...\n})"
  1219. }
  1220. ]
  1221. },
  1222. "put": {
  1223. "operationId": "pty.update",
  1224. "parameters": [
  1225. {
  1226. "in": "query",
  1227. "name": "directory",
  1228. "schema": {
  1229. "type": "string"
  1230. }
  1231. },
  1232. {
  1233. "in": "query",
  1234. "name": "workspace",
  1235. "schema": {
  1236. "type": "string"
  1237. }
  1238. },
  1239. {
  1240. "in": "path",
  1241. "name": "ptyID",
  1242. "schema": {
  1243. "type": "string",
  1244. "pattern": "^pty.*"
  1245. },
  1246. "required": true
  1247. }
  1248. ],
  1249. "summary": "Update PTY session",
  1250. "description": "Update properties of an existing pseudo-terminal (PTY) session.",
  1251. "responses": {
  1252. "200": {
  1253. "description": "Updated session",
  1254. "content": {
  1255. "application/json": {
  1256. "schema": {
  1257. "$ref": "#/components/schemas/Pty"
  1258. }
  1259. }
  1260. }
  1261. },
  1262. "400": {
  1263. "description": "Bad request",
  1264. "content": {
  1265. "application/json": {
  1266. "schema": {
  1267. "$ref": "#/components/schemas/BadRequestError"
  1268. }
  1269. }
  1270. }
  1271. }
  1272. },
  1273. "requestBody": {
  1274. "content": {
  1275. "application/json": {
  1276. "schema": {
  1277. "type": "object",
  1278. "properties": {
  1279. "title": {
  1280. "type": "string"
  1281. },
  1282. "size": {
  1283. "type": "object",
  1284. "properties": {
  1285. "rows": {
  1286. "type": "number"
  1287. },
  1288. "cols": {
  1289. "type": "number"
  1290. }
  1291. },
  1292. "required": ["rows", "cols"]
  1293. }
  1294. }
  1295. }
  1296. }
  1297. }
  1298. },
  1299. "x-codeSamples": [
  1300. {
  1301. "lang": "js",
  1302. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.update({\n ...\n})"
  1303. }
  1304. ]
  1305. },
  1306. "delete": {
  1307. "operationId": "pty.remove",
  1308. "parameters": [
  1309. {
  1310. "in": "query",
  1311. "name": "directory",
  1312. "schema": {
  1313. "type": "string"
  1314. }
  1315. },
  1316. {
  1317. "in": "query",
  1318. "name": "workspace",
  1319. "schema": {
  1320. "type": "string"
  1321. }
  1322. },
  1323. {
  1324. "in": "path",
  1325. "name": "ptyID",
  1326. "schema": {
  1327. "type": "string",
  1328. "pattern": "^pty.*"
  1329. },
  1330. "required": true
  1331. }
  1332. ],
  1333. "summary": "Remove PTY session",
  1334. "description": "Remove and terminate a specific pseudo-terminal (PTY) session.",
  1335. "responses": {
  1336. "200": {
  1337. "description": "Session removed",
  1338. "content": {
  1339. "application/json": {
  1340. "schema": {
  1341. "type": "boolean"
  1342. }
  1343. }
  1344. }
  1345. },
  1346. "404": {
  1347. "description": "Not found",
  1348. "content": {
  1349. "application/json": {
  1350. "schema": {
  1351. "$ref": "#/components/schemas/NotFoundError"
  1352. }
  1353. }
  1354. }
  1355. }
  1356. },
  1357. "x-codeSamples": [
  1358. {
  1359. "lang": "js",
  1360. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.remove({\n ...\n})"
  1361. }
  1362. ]
  1363. }
  1364. },
  1365. "/pty/{ptyID}/connect": {
  1366. "get": {
  1367. "operationId": "pty.connect",
  1368. "parameters": [
  1369. {
  1370. "in": "query",
  1371. "name": "directory",
  1372. "schema": {
  1373. "type": "string"
  1374. }
  1375. },
  1376. {
  1377. "in": "query",
  1378. "name": "workspace",
  1379. "schema": {
  1380. "type": "string"
  1381. }
  1382. },
  1383. {
  1384. "in": "path",
  1385. "name": "ptyID",
  1386. "schema": {
  1387. "type": "string",
  1388. "pattern": "^pty.*"
  1389. },
  1390. "required": true
  1391. }
  1392. ],
  1393. "summary": "Connect to PTY session",
  1394. "description": "Establish a WebSocket connection to interact with a pseudo-terminal (PTY) session in real-time.",
  1395. "responses": {
  1396. "200": {
  1397. "description": "Connected session",
  1398. "content": {
  1399. "application/json": {
  1400. "schema": {
  1401. "type": "boolean"
  1402. }
  1403. }
  1404. }
  1405. },
  1406. "404": {
  1407. "description": "Not found",
  1408. "content": {
  1409. "application/json": {
  1410. "schema": {
  1411. "$ref": "#/components/schemas/NotFoundError"
  1412. }
  1413. }
  1414. }
  1415. }
  1416. },
  1417. "x-codeSamples": [
  1418. {
  1419. "lang": "js",
  1420. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.connect({\n ...\n})"
  1421. }
  1422. ]
  1423. }
  1424. },
  1425. "/config": {
  1426. "get": {
  1427. "operationId": "config.get",
  1428. "parameters": [
  1429. {
  1430. "in": "query",
  1431. "name": "directory",
  1432. "schema": {
  1433. "type": "string"
  1434. }
  1435. },
  1436. {
  1437. "in": "query",
  1438. "name": "workspace",
  1439. "schema": {
  1440. "type": "string"
  1441. }
  1442. }
  1443. ],
  1444. "summary": "Get configuration",
  1445. "description": "Retrieve the current OpenCode configuration settings and preferences.",
  1446. "responses": {
  1447. "200": {
  1448. "description": "Get config info",
  1449. "content": {
  1450. "application/json": {
  1451. "schema": {
  1452. "$ref": "#/components/schemas/Config"
  1453. }
  1454. }
  1455. }
  1456. }
  1457. },
  1458. "x-codeSamples": [
  1459. {
  1460. "lang": "js",
  1461. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.config.get({\n ...\n})"
  1462. }
  1463. ]
  1464. },
  1465. "patch": {
  1466. "operationId": "config.update",
  1467. "parameters": [
  1468. {
  1469. "in": "query",
  1470. "name": "directory",
  1471. "schema": {
  1472. "type": "string"
  1473. }
  1474. },
  1475. {
  1476. "in": "query",
  1477. "name": "workspace",
  1478. "schema": {
  1479. "type": "string"
  1480. }
  1481. }
  1482. ],
  1483. "summary": "Update configuration",
  1484. "description": "Update OpenCode configuration settings and preferences.",
  1485. "responses": {
  1486. "200": {
  1487. "description": "Successfully updated config",
  1488. "content": {
  1489. "application/json": {
  1490. "schema": {
  1491. "$ref": "#/components/schemas/Config"
  1492. }
  1493. }
  1494. }
  1495. },
  1496. "400": {
  1497. "description": "Bad request",
  1498. "content": {
  1499. "application/json": {
  1500. "schema": {
  1501. "$ref": "#/components/schemas/BadRequestError"
  1502. }
  1503. }
  1504. }
  1505. }
  1506. },
  1507. "requestBody": {
  1508. "content": {
  1509. "application/json": {
  1510. "schema": {
  1511. "$ref": "#/components/schemas/Config"
  1512. }
  1513. }
  1514. }
  1515. },
  1516. "x-codeSamples": [
  1517. {
  1518. "lang": "js",
  1519. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.config.update({\n ...\n})"
  1520. }
  1521. ]
  1522. }
  1523. },
  1524. "/config/providers": {
  1525. "get": {
  1526. "operationId": "config.providers",
  1527. "parameters": [
  1528. {
  1529. "in": "query",
  1530. "name": "directory",
  1531. "schema": {
  1532. "type": "string"
  1533. }
  1534. },
  1535. {
  1536. "in": "query",
  1537. "name": "workspace",
  1538. "schema": {
  1539. "type": "string"
  1540. }
  1541. }
  1542. ],
  1543. "summary": "List config providers",
  1544. "description": "Get a list of all configured AI providers and their default models.",
  1545. "responses": {
  1546. "200": {
  1547. "description": "List of providers",
  1548. "content": {
  1549. "application/json": {
  1550. "schema": {
  1551. "type": "object",
  1552. "properties": {
  1553. "providers": {
  1554. "type": "array",
  1555. "items": {
  1556. "$ref": "#/components/schemas/Provider"
  1557. }
  1558. },
  1559. "default": {
  1560. "type": "object",
  1561. "propertyNames": {
  1562. "type": "string"
  1563. },
  1564. "additionalProperties": {
  1565. "type": "string"
  1566. }
  1567. }
  1568. },
  1569. "required": ["providers", "default"]
  1570. }
  1571. }
  1572. }
  1573. }
  1574. },
  1575. "x-codeSamples": [
  1576. {
  1577. "lang": "js",
  1578. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.config.providers({\n ...\n})"
  1579. }
  1580. ]
  1581. }
  1582. },
  1583. "/experimental/console": {
  1584. "get": {
  1585. "operationId": "experimental.console.get",
  1586. "parameters": [
  1587. {
  1588. "in": "query",
  1589. "name": "directory",
  1590. "schema": {
  1591. "type": "string"
  1592. }
  1593. },
  1594. {
  1595. "in": "query",
  1596. "name": "workspace",
  1597. "schema": {
  1598. "type": "string"
  1599. }
  1600. }
  1601. ],
  1602. "summary": "Get active Console provider metadata",
  1603. "description": "Get the active Console org name and the set of provider IDs managed by that Console org.",
  1604. "responses": {
  1605. "200": {
  1606. "description": "Active Console provider metadata",
  1607. "content": {
  1608. "application/json": {
  1609. "schema": {
  1610. "type": "object",
  1611. "properties": {
  1612. "consoleManagedProviders": {
  1613. "type": "array",
  1614. "items": {
  1615. "type": "string"
  1616. }
  1617. },
  1618. "activeOrgName": {
  1619. "type": "string"
  1620. },
  1621. "switchableOrgCount": {
  1622. "type": "integer",
  1623. "minimum": 0,
  1624. "maximum": 9007199254740991
  1625. }
  1626. },
  1627. "required": ["consoleManagedProviders", "switchableOrgCount"]
  1628. }
  1629. }
  1630. }
  1631. }
  1632. },
  1633. "x-codeSamples": [
  1634. {
  1635. "lang": "js",
  1636. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.console.get({\n ...\n})"
  1637. }
  1638. ]
  1639. }
  1640. },
  1641. "/experimental/console/orgs": {
  1642. "get": {
  1643. "operationId": "experimental.console.listOrgs",
  1644. "parameters": [
  1645. {
  1646. "in": "query",
  1647. "name": "directory",
  1648. "schema": {
  1649. "type": "string"
  1650. }
  1651. },
  1652. {
  1653. "in": "query",
  1654. "name": "workspace",
  1655. "schema": {
  1656. "type": "string"
  1657. }
  1658. }
  1659. ],
  1660. "summary": "List switchable Console orgs",
  1661. "description": "Get the available Console orgs across logged-in accounts, including the current active org.",
  1662. "responses": {
  1663. "200": {
  1664. "description": "Switchable Console orgs",
  1665. "content": {
  1666. "application/json": {
  1667. "schema": {
  1668. "type": "object",
  1669. "properties": {
  1670. "orgs": {
  1671. "type": "array",
  1672. "items": {
  1673. "type": "object",
  1674. "properties": {
  1675. "accountID": {
  1676. "type": "string"
  1677. },
  1678. "accountEmail": {
  1679. "type": "string"
  1680. },
  1681. "accountUrl": {
  1682. "type": "string"
  1683. },
  1684. "orgID": {
  1685. "type": "string"
  1686. },
  1687. "orgName": {
  1688. "type": "string"
  1689. },
  1690. "active": {
  1691. "type": "boolean"
  1692. }
  1693. },
  1694. "required": ["accountID", "accountEmail", "accountUrl", "orgID", "orgName", "active"]
  1695. }
  1696. }
  1697. },
  1698. "required": ["orgs"]
  1699. }
  1700. }
  1701. }
  1702. }
  1703. },
  1704. "x-codeSamples": [
  1705. {
  1706. "lang": "js",
  1707. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.console.listOrgs({\n ...\n})"
  1708. }
  1709. ]
  1710. }
  1711. },
  1712. "/experimental/console/switch": {
  1713. "post": {
  1714. "operationId": "experimental.console.switchOrg",
  1715. "parameters": [
  1716. {
  1717. "in": "query",
  1718. "name": "directory",
  1719. "schema": {
  1720. "type": "string"
  1721. }
  1722. },
  1723. {
  1724. "in": "query",
  1725. "name": "workspace",
  1726. "schema": {
  1727. "type": "string"
  1728. }
  1729. }
  1730. ],
  1731. "summary": "Switch active Console org",
  1732. "description": "Persist a new active Console account/org selection for the current local OpenCode state.",
  1733. "responses": {
  1734. "200": {
  1735. "description": "Switch success",
  1736. "content": {
  1737. "application/json": {
  1738. "schema": {
  1739. "type": "boolean"
  1740. }
  1741. }
  1742. }
  1743. }
  1744. },
  1745. "requestBody": {
  1746. "content": {
  1747. "application/json": {
  1748. "schema": {
  1749. "type": "object",
  1750. "properties": {
  1751. "accountID": {
  1752. "type": "string"
  1753. },
  1754. "orgID": {
  1755. "type": "string"
  1756. }
  1757. },
  1758. "required": ["accountID", "orgID"]
  1759. }
  1760. }
  1761. }
  1762. },
  1763. "x-codeSamples": [
  1764. {
  1765. "lang": "js",
  1766. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.console.switchOrg({\n ...\n})"
  1767. }
  1768. ]
  1769. }
  1770. },
  1771. "/experimental/tool/ids": {
  1772. "get": {
  1773. "operationId": "tool.ids",
  1774. "parameters": [
  1775. {
  1776. "in": "query",
  1777. "name": "directory",
  1778. "schema": {
  1779. "type": "string"
  1780. }
  1781. },
  1782. {
  1783. "in": "query",
  1784. "name": "workspace",
  1785. "schema": {
  1786. "type": "string"
  1787. }
  1788. }
  1789. ],
  1790. "summary": "List tool IDs",
  1791. "description": "Get a list of all available tool IDs, including both built-in tools and dynamically registered tools.",
  1792. "responses": {
  1793. "200": {
  1794. "description": "Tool IDs",
  1795. "content": {
  1796. "application/json": {
  1797. "schema": {
  1798. "$ref": "#/components/schemas/ToolIDs"
  1799. }
  1800. }
  1801. }
  1802. },
  1803. "400": {
  1804. "description": "Bad request",
  1805. "content": {
  1806. "application/json": {
  1807. "schema": {
  1808. "$ref": "#/components/schemas/BadRequestError"
  1809. }
  1810. }
  1811. }
  1812. }
  1813. },
  1814. "x-codeSamples": [
  1815. {
  1816. "lang": "js",
  1817. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tool.ids({\n ...\n})"
  1818. }
  1819. ]
  1820. }
  1821. },
  1822. "/experimental/tool": {
  1823. "get": {
  1824. "operationId": "tool.list",
  1825. "parameters": [
  1826. {
  1827. "in": "query",
  1828. "name": "directory",
  1829. "schema": {
  1830. "type": "string"
  1831. }
  1832. },
  1833. {
  1834. "in": "query",
  1835. "name": "workspace",
  1836. "schema": {
  1837. "type": "string"
  1838. }
  1839. },
  1840. {
  1841. "in": "query",
  1842. "name": "provider",
  1843. "schema": {
  1844. "type": "string"
  1845. },
  1846. "required": true
  1847. },
  1848. {
  1849. "in": "query",
  1850. "name": "model",
  1851. "schema": {
  1852. "type": "string"
  1853. },
  1854. "required": true
  1855. }
  1856. ],
  1857. "summary": "List tools",
  1858. "description": "Get a list of available tools with their JSON schema parameters for a specific provider and model combination.",
  1859. "responses": {
  1860. "200": {
  1861. "description": "Tools",
  1862. "content": {
  1863. "application/json": {
  1864. "schema": {
  1865. "$ref": "#/components/schemas/ToolList"
  1866. }
  1867. }
  1868. }
  1869. },
  1870. "400": {
  1871. "description": "Bad request",
  1872. "content": {
  1873. "application/json": {
  1874. "schema": {
  1875. "$ref": "#/components/schemas/BadRequestError"
  1876. }
  1877. }
  1878. }
  1879. }
  1880. },
  1881. "x-codeSamples": [
  1882. {
  1883. "lang": "js",
  1884. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tool.list({\n ...\n})"
  1885. }
  1886. ]
  1887. }
  1888. },
  1889. "/experimental/worktree": {
  1890. "post": {
  1891. "operationId": "worktree.create",
  1892. "parameters": [
  1893. {
  1894. "in": "query",
  1895. "name": "directory",
  1896. "schema": {
  1897. "type": "string"
  1898. }
  1899. },
  1900. {
  1901. "in": "query",
  1902. "name": "workspace",
  1903. "schema": {
  1904. "type": "string"
  1905. }
  1906. }
  1907. ],
  1908. "summary": "Create worktree",
  1909. "description": "Create a new git worktree for the current project and run any configured startup scripts.",
  1910. "responses": {
  1911. "200": {
  1912. "description": "Worktree created",
  1913. "content": {
  1914. "application/json": {
  1915. "schema": {
  1916. "$ref": "#/components/schemas/Worktree"
  1917. }
  1918. }
  1919. }
  1920. },
  1921. "400": {
  1922. "description": "Bad request",
  1923. "content": {
  1924. "application/json": {
  1925. "schema": {
  1926. "$ref": "#/components/schemas/BadRequestError"
  1927. }
  1928. }
  1929. }
  1930. }
  1931. },
  1932. "requestBody": {
  1933. "content": {
  1934. "application/json": {
  1935. "schema": {
  1936. "$ref": "#/components/schemas/WorktreeCreateInput"
  1937. }
  1938. }
  1939. }
  1940. },
  1941. "x-codeSamples": [
  1942. {
  1943. "lang": "js",
  1944. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.create({\n ...\n})"
  1945. }
  1946. ]
  1947. },
  1948. "get": {
  1949. "operationId": "worktree.list",
  1950. "parameters": [
  1951. {
  1952. "in": "query",
  1953. "name": "directory",
  1954. "schema": {
  1955. "type": "string"
  1956. }
  1957. },
  1958. {
  1959. "in": "query",
  1960. "name": "workspace",
  1961. "schema": {
  1962. "type": "string"
  1963. }
  1964. }
  1965. ],
  1966. "summary": "List worktrees",
  1967. "description": "List all sandbox worktrees for the current project.",
  1968. "responses": {
  1969. "200": {
  1970. "description": "List of worktree directories",
  1971. "content": {
  1972. "application/json": {
  1973. "schema": {
  1974. "type": "array",
  1975. "items": {
  1976. "type": "string"
  1977. }
  1978. }
  1979. }
  1980. }
  1981. }
  1982. },
  1983. "x-codeSamples": [
  1984. {
  1985. "lang": "js",
  1986. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.list({\n ...\n})"
  1987. }
  1988. ]
  1989. },
  1990. "delete": {
  1991. "operationId": "worktree.remove",
  1992. "parameters": [
  1993. {
  1994. "in": "query",
  1995. "name": "directory",
  1996. "schema": {
  1997. "type": "string"
  1998. }
  1999. },
  2000. {
  2001. "in": "query",
  2002. "name": "workspace",
  2003. "schema": {
  2004. "type": "string"
  2005. }
  2006. }
  2007. ],
  2008. "summary": "Remove worktree",
  2009. "description": "Remove a git worktree and delete its branch.",
  2010. "responses": {
  2011. "200": {
  2012. "description": "Worktree removed",
  2013. "content": {
  2014. "application/json": {
  2015. "schema": {
  2016. "type": "boolean"
  2017. }
  2018. }
  2019. }
  2020. },
  2021. "400": {
  2022. "description": "Bad request",
  2023. "content": {
  2024. "application/json": {
  2025. "schema": {
  2026. "$ref": "#/components/schemas/BadRequestError"
  2027. }
  2028. }
  2029. }
  2030. }
  2031. },
  2032. "requestBody": {
  2033. "content": {
  2034. "application/json": {
  2035. "schema": {
  2036. "$ref": "#/components/schemas/WorktreeRemoveInput"
  2037. }
  2038. }
  2039. }
  2040. },
  2041. "x-codeSamples": [
  2042. {
  2043. "lang": "js",
  2044. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.remove({\n ...\n})"
  2045. }
  2046. ]
  2047. }
  2048. },
  2049. "/experimental/worktree/reset": {
  2050. "post": {
  2051. "operationId": "worktree.reset",
  2052. "parameters": [
  2053. {
  2054. "in": "query",
  2055. "name": "directory",
  2056. "schema": {
  2057. "type": "string"
  2058. }
  2059. },
  2060. {
  2061. "in": "query",
  2062. "name": "workspace",
  2063. "schema": {
  2064. "type": "string"
  2065. }
  2066. }
  2067. ],
  2068. "summary": "Reset worktree",
  2069. "description": "Reset a worktree branch to the primary default branch.",
  2070. "responses": {
  2071. "200": {
  2072. "description": "Worktree reset",
  2073. "content": {
  2074. "application/json": {
  2075. "schema": {
  2076. "type": "boolean"
  2077. }
  2078. }
  2079. }
  2080. },
  2081. "400": {
  2082. "description": "Bad request",
  2083. "content": {
  2084. "application/json": {
  2085. "schema": {
  2086. "$ref": "#/components/schemas/BadRequestError"
  2087. }
  2088. }
  2089. }
  2090. }
  2091. },
  2092. "requestBody": {
  2093. "content": {
  2094. "application/json": {
  2095. "schema": {
  2096. "$ref": "#/components/schemas/WorktreeResetInput"
  2097. }
  2098. }
  2099. }
  2100. },
  2101. "x-codeSamples": [
  2102. {
  2103. "lang": "js",
  2104. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.reset({\n ...\n})"
  2105. }
  2106. ]
  2107. }
  2108. },
  2109. "/experimental/session": {
  2110. "get": {
  2111. "operationId": "experimental.session.list",
  2112. "parameters": [
  2113. {
  2114. "in": "query",
  2115. "name": "directory",
  2116. "schema": {
  2117. "type": "string"
  2118. },
  2119. "description": "Filter sessions by project directory"
  2120. },
  2121. {
  2122. "in": "query",
  2123. "name": "workspace",
  2124. "schema": {
  2125. "type": "string"
  2126. }
  2127. },
  2128. {
  2129. "in": "query",
  2130. "name": "roots",
  2131. "schema": {
  2132. "type": "boolean"
  2133. },
  2134. "description": "Only return root sessions (no parentID)"
  2135. },
  2136. {
  2137. "in": "query",
  2138. "name": "start",
  2139. "schema": {
  2140. "type": "number"
  2141. },
  2142. "description": "Filter sessions updated on or after this timestamp (milliseconds since epoch)"
  2143. },
  2144. {
  2145. "in": "query",
  2146. "name": "cursor",
  2147. "schema": {
  2148. "type": "number"
  2149. },
  2150. "description": "Return sessions updated before this timestamp (milliseconds since epoch)"
  2151. },
  2152. {
  2153. "in": "query",
  2154. "name": "search",
  2155. "schema": {
  2156. "type": "string"
  2157. },
  2158. "description": "Filter sessions by title (case-insensitive)"
  2159. },
  2160. {
  2161. "in": "query",
  2162. "name": "limit",
  2163. "schema": {
  2164. "type": "number"
  2165. },
  2166. "description": "Maximum number of sessions to return"
  2167. },
  2168. {
  2169. "in": "query",
  2170. "name": "archived",
  2171. "schema": {
  2172. "type": "boolean"
  2173. },
  2174. "description": "Include archived sessions (default false)"
  2175. }
  2176. ],
  2177. "summary": "List sessions",
  2178. "description": "Get a list of all OpenCode sessions across projects, sorted by most recently updated. Archived sessions are excluded by default.",
  2179. "responses": {
  2180. "200": {
  2181. "description": "List of sessions",
  2182. "content": {
  2183. "application/json": {
  2184. "schema": {
  2185. "type": "array",
  2186. "items": {
  2187. "$ref": "#/components/schemas/GlobalSession"
  2188. }
  2189. }
  2190. }
  2191. }
  2192. }
  2193. },
  2194. "x-codeSamples": [
  2195. {
  2196. "lang": "js",
  2197. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.session.list({\n ...\n})"
  2198. }
  2199. ]
  2200. }
  2201. },
  2202. "/experimental/resource": {
  2203. "get": {
  2204. "operationId": "experimental.resource.list",
  2205. "parameters": [
  2206. {
  2207. "in": "query",
  2208. "name": "directory",
  2209. "schema": {
  2210. "type": "string"
  2211. }
  2212. },
  2213. {
  2214. "in": "query",
  2215. "name": "workspace",
  2216. "schema": {
  2217. "type": "string"
  2218. }
  2219. }
  2220. ],
  2221. "summary": "Get MCP resources",
  2222. "description": "Get all available MCP resources from connected servers. Optionally filter by name.",
  2223. "responses": {
  2224. "200": {
  2225. "description": "MCP resources",
  2226. "content": {
  2227. "application/json": {
  2228. "schema": {
  2229. "type": "object",
  2230. "propertyNames": {
  2231. "type": "string"
  2232. },
  2233. "additionalProperties": {
  2234. "$ref": "#/components/schemas/McpResource"
  2235. }
  2236. }
  2237. }
  2238. }
  2239. }
  2240. },
  2241. "x-codeSamples": [
  2242. {
  2243. "lang": "js",
  2244. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.resource.list({\n ...\n})"
  2245. }
  2246. ]
  2247. }
  2248. },
  2249. "/session": {
  2250. "get": {
  2251. "operationId": "session.list",
  2252. "parameters": [
  2253. {
  2254. "in": "query",
  2255. "name": "directory",
  2256. "schema": {
  2257. "type": "string"
  2258. },
  2259. "description": "Filter sessions by project directory"
  2260. },
  2261. {
  2262. "in": "query",
  2263. "name": "workspace",
  2264. "schema": {
  2265. "type": "string"
  2266. }
  2267. },
  2268. {
  2269. "in": "query",
  2270. "name": "roots",
  2271. "schema": {
  2272. "type": "boolean"
  2273. },
  2274. "description": "Only return root sessions (no parentID)"
  2275. },
  2276. {
  2277. "in": "query",
  2278. "name": "start",
  2279. "schema": {
  2280. "type": "number"
  2281. },
  2282. "description": "Filter sessions updated on or after this timestamp (milliseconds since epoch)"
  2283. },
  2284. {
  2285. "in": "query",
  2286. "name": "search",
  2287. "schema": {
  2288. "type": "string"
  2289. },
  2290. "description": "Filter sessions by title (case-insensitive)"
  2291. },
  2292. {
  2293. "in": "query",
  2294. "name": "limit",
  2295. "schema": {
  2296. "type": "number"
  2297. },
  2298. "description": "Maximum number of sessions to return"
  2299. }
  2300. ],
  2301. "summary": "List sessions",
  2302. "description": "Get a list of all OpenCode sessions, sorted by most recently updated.",
  2303. "responses": {
  2304. "200": {
  2305. "description": "List of sessions",
  2306. "content": {
  2307. "application/json": {
  2308. "schema": {
  2309. "type": "array",
  2310. "items": {
  2311. "$ref": "#/components/schemas/Session"
  2312. }
  2313. }
  2314. }
  2315. }
  2316. }
  2317. },
  2318. "x-codeSamples": [
  2319. {
  2320. "lang": "js",
  2321. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.list({\n ...\n})"
  2322. }
  2323. ]
  2324. },
  2325. "post": {
  2326. "operationId": "session.create",
  2327. "parameters": [
  2328. {
  2329. "in": "query",
  2330. "name": "directory",
  2331. "schema": {
  2332. "type": "string"
  2333. }
  2334. },
  2335. {
  2336. "in": "query",
  2337. "name": "workspace",
  2338. "schema": {
  2339. "type": "string"
  2340. }
  2341. }
  2342. ],
  2343. "summary": "Create session",
  2344. "description": "Create a new OpenCode session for interacting with AI assistants and managing conversations.",
  2345. "responses": {
  2346. "200": {
  2347. "description": "Successfully created session",
  2348. "content": {
  2349. "application/json": {
  2350. "schema": {
  2351. "$ref": "#/components/schemas/Session"
  2352. }
  2353. }
  2354. }
  2355. },
  2356. "400": {
  2357. "description": "Bad request",
  2358. "content": {
  2359. "application/json": {
  2360. "schema": {
  2361. "$ref": "#/components/schemas/BadRequestError"
  2362. }
  2363. }
  2364. }
  2365. }
  2366. },
  2367. "requestBody": {
  2368. "content": {
  2369. "application/json": {
  2370. "schema": {
  2371. "type": "object",
  2372. "properties": {
  2373. "parentID": {
  2374. "type": "string",
  2375. "pattern": "^ses.*"
  2376. },
  2377. "title": {
  2378. "type": "string"
  2379. },
  2380. "permission": {
  2381. "$ref": "#/components/schemas/PermissionRuleset"
  2382. },
  2383. "workspaceID": {
  2384. "type": "string",
  2385. "pattern": "^wrk.*"
  2386. }
  2387. }
  2388. }
  2389. }
  2390. }
  2391. },
  2392. "x-codeSamples": [
  2393. {
  2394. "lang": "js",
  2395. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.create({\n ...\n})"
  2396. }
  2397. ]
  2398. }
  2399. },
  2400. "/session/status": {
  2401. "get": {
  2402. "operationId": "session.status",
  2403. "parameters": [
  2404. {
  2405. "in": "query",
  2406. "name": "directory",
  2407. "schema": {
  2408. "type": "string"
  2409. }
  2410. },
  2411. {
  2412. "in": "query",
  2413. "name": "workspace",
  2414. "schema": {
  2415. "type": "string"
  2416. }
  2417. }
  2418. ],
  2419. "summary": "Get session status",
  2420. "description": "Retrieve the current status of all sessions, including active, idle, and completed states.",
  2421. "responses": {
  2422. "200": {
  2423. "description": "Get session status",
  2424. "content": {
  2425. "application/json": {
  2426. "schema": {
  2427. "type": "object",
  2428. "propertyNames": {
  2429. "type": "string"
  2430. },
  2431. "additionalProperties": {
  2432. "$ref": "#/components/schemas/SessionStatus"
  2433. }
  2434. }
  2435. }
  2436. }
  2437. },
  2438. "400": {
  2439. "description": "Bad request",
  2440. "content": {
  2441. "application/json": {
  2442. "schema": {
  2443. "$ref": "#/components/schemas/BadRequestError"
  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.status({\n ...\n})"
  2453. }
  2454. ]
  2455. }
  2456. },
  2457. "/session/{sessionID}": {
  2458. "get": {
  2459. "operationId": "session.get",
  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": "Get session",
  2486. "description": "Retrieve detailed information about a specific OpenCode session.",
  2487. "tags": ["Session"],
  2488. "responses": {
  2489. "200": {
  2490. "description": "Get session",
  2491. "content": {
  2492. "application/json": {
  2493. "schema": {
  2494. "$ref": "#/components/schemas/Session"
  2495. }
  2496. }
  2497. }
  2498. },
  2499. "400": {
  2500. "description": "Bad request",
  2501. "content": {
  2502. "application/json": {
  2503. "schema": {
  2504. "$ref": "#/components/schemas/BadRequestError"
  2505. }
  2506. }
  2507. }
  2508. },
  2509. "404": {
  2510. "description": "Not found",
  2511. "content": {
  2512. "application/json": {
  2513. "schema": {
  2514. "$ref": "#/components/schemas/NotFoundError"
  2515. }
  2516. }
  2517. }
  2518. }
  2519. },
  2520. "x-codeSamples": [
  2521. {
  2522. "lang": "js",
  2523. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.get({\n ...\n})"
  2524. }
  2525. ]
  2526. },
  2527. "delete": {
  2528. "operationId": "session.delete",
  2529. "parameters": [
  2530. {
  2531. "in": "query",
  2532. "name": "directory",
  2533. "schema": {
  2534. "type": "string"
  2535. }
  2536. },
  2537. {
  2538. "in": "query",
  2539. "name": "workspace",
  2540. "schema": {
  2541. "type": "string"
  2542. }
  2543. },
  2544. {
  2545. "in": "path",
  2546. "name": "sessionID",
  2547. "schema": {
  2548. "type": "string",
  2549. "pattern": "^ses.*"
  2550. },
  2551. "required": true
  2552. }
  2553. ],
  2554. "summary": "Delete session",
  2555. "description": "Delete a session and permanently remove all associated data, including messages and history.",
  2556. "responses": {
  2557. "200": {
  2558. "description": "Successfully deleted session",
  2559. "content": {
  2560. "application/json": {
  2561. "schema": {
  2562. "type": "boolean"
  2563. }
  2564. }
  2565. }
  2566. },
  2567. "400": {
  2568. "description": "Bad request",
  2569. "content": {
  2570. "application/json": {
  2571. "schema": {
  2572. "$ref": "#/components/schemas/BadRequestError"
  2573. }
  2574. }
  2575. }
  2576. },
  2577. "404": {
  2578. "description": "Not found",
  2579. "content": {
  2580. "application/json": {
  2581. "schema": {
  2582. "$ref": "#/components/schemas/NotFoundError"
  2583. }
  2584. }
  2585. }
  2586. }
  2587. },
  2588. "x-codeSamples": [
  2589. {
  2590. "lang": "js",
  2591. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.delete({\n ...\n})"
  2592. }
  2593. ]
  2594. },
  2595. "patch": {
  2596. "operationId": "session.update",
  2597. "parameters": [
  2598. {
  2599. "in": "query",
  2600. "name": "directory",
  2601. "schema": {
  2602. "type": "string"
  2603. }
  2604. },
  2605. {
  2606. "in": "query",
  2607. "name": "workspace",
  2608. "schema": {
  2609. "type": "string"
  2610. }
  2611. },
  2612. {
  2613. "in": "path",
  2614. "name": "sessionID",
  2615. "schema": {
  2616. "type": "string",
  2617. "pattern": "^ses.*"
  2618. },
  2619. "required": true
  2620. }
  2621. ],
  2622. "summary": "Update session",
  2623. "description": "Update properties of an existing session, such as title or other metadata.",
  2624. "responses": {
  2625. "200": {
  2626. "description": "Successfully updated session",
  2627. "content": {
  2628. "application/json": {
  2629. "schema": {
  2630. "$ref": "#/components/schemas/Session"
  2631. }
  2632. }
  2633. }
  2634. },
  2635. "400": {
  2636. "description": "Bad request",
  2637. "content": {
  2638. "application/json": {
  2639. "schema": {
  2640. "$ref": "#/components/schemas/BadRequestError"
  2641. }
  2642. }
  2643. }
  2644. },
  2645. "404": {
  2646. "description": "Not found",
  2647. "content": {
  2648. "application/json": {
  2649. "schema": {
  2650. "$ref": "#/components/schemas/NotFoundError"
  2651. }
  2652. }
  2653. }
  2654. }
  2655. },
  2656. "requestBody": {
  2657. "content": {
  2658. "application/json": {
  2659. "schema": {
  2660. "type": "object",
  2661. "properties": {
  2662. "title": {
  2663. "type": "string"
  2664. },
  2665. "permission": {
  2666. "$ref": "#/components/schemas/PermissionRuleset"
  2667. },
  2668. "time": {
  2669. "type": "object",
  2670. "properties": {
  2671. "archived": {
  2672. "type": "number"
  2673. }
  2674. }
  2675. }
  2676. }
  2677. }
  2678. }
  2679. }
  2680. },
  2681. "x-codeSamples": [
  2682. {
  2683. "lang": "js",
  2684. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.update({\n ...\n})"
  2685. }
  2686. ]
  2687. }
  2688. },
  2689. "/session/{sessionID}/children": {
  2690. "get": {
  2691. "operationId": "session.children",
  2692. "parameters": [
  2693. {
  2694. "in": "query",
  2695. "name": "directory",
  2696. "schema": {
  2697. "type": "string"
  2698. }
  2699. },
  2700. {
  2701. "in": "query",
  2702. "name": "workspace",
  2703. "schema": {
  2704. "type": "string"
  2705. }
  2706. },
  2707. {
  2708. "in": "path",
  2709. "name": "sessionID",
  2710. "schema": {
  2711. "type": "string",
  2712. "pattern": "^ses.*"
  2713. },
  2714. "required": true
  2715. }
  2716. ],
  2717. "summary": "Get session children",
  2718. "tags": ["Session"],
  2719. "description": "Retrieve all child sessions that were forked from the specified parent session.",
  2720. "responses": {
  2721. "200": {
  2722. "description": "List of children",
  2723. "content": {
  2724. "application/json": {
  2725. "schema": {
  2726. "type": "array",
  2727. "items": {
  2728. "$ref": "#/components/schemas/Session"
  2729. }
  2730. }
  2731. }
  2732. }
  2733. },
  2734. "400": {
  2735. "description": "Bad request",
  2736. "content": {
  2737. "application/json": {
  2738. "schema": {
  2739. "$ref": "#/components/schemas/BadRequestError"
  2740. }
  2741. }
  2742. }
  2743. },
  2744. "404": {
  2745. "description": "Not found",
  2746. "content": {
  2747. "application/json": {
  2748. "schema": {
  2749. "$ref": "#/components/schemas/NotFoundError"
  2750. }
  2751. }
  2752. }
  2753. }
  2754. },
  2755. "x-codeSamples": [
  2756. {
  2757. "lang": "js",
  2758. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.children({\n ...\n})"
  2759. }
  2760. ]
  2761. }
  2762. },
  2763. "/session/{sessionID}/todo": {
  2764. "get": {
  2765. "operationId": "session.todo",
  2766. "parameters": [
  2767. {
  2768. "in": "query",
  2769. "name": "directory",
  2770. "schema": {
  2771. "type": "string"
  2772. }
  2773. },
  2774. {
  2775. "in": "query",
  2776. "name": "workspace",
  2777. "schema": {
  2778. "type": "string"
  2779. }
  2780. },
  2781. {
  2782. "in": "path",
  2783. "name": "sessionID",
  2784. "schema": {
  2785. "type": "string",
  2786. "pattern": "^ses.*"
  2787. },
  2788. "required": true
  2789. }
  2790. ],
  2791. "summary": "Get session todos",
  2792. "description": "Retrieve the todo list associated with a specific session, showing tasks and action items.",
  2793. "responses": {
  2794. "200": {
  2795. "description": "Todo list",
  2796. "content": {
  2797. "application/json": {
  2798. "schema": {
  2799. "type": "array",
  2800. "items": {
  2801. "$ref": "#/components/schemas/Todo"
  2802. }
  2803. }
  2804. }
  2805. }
  2806. },
  2807. "400": {
  2808. "description": "Bad request",
  2809. "content": {
  2810. "application/json": {
  2811. "schema": {
  2812. "$ref": "#/components/schemas/BadRequestError"
  2813. }
  2814. }
  2815. }
  2816. },
  2817. "404": {
  2818. "description": "Not found",
  2819. "content": {
  2820. "application/json": {
  2821. "schema": {
  2822. "$ref": "#/components/schemas/NotFoundError"
  2823. }
  2824. }
  2825. }
  2826. }
  2827. },
  2828. "x-codeSamples": [
  2829. {
  2830. "lang": "js",
  2831. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.todo({\n ...\n})"
  2832. }
  2833. ]
  2834. }
  2835. },
  2836. "/session/{sessionID}/init": {
  2837. "post": {
  2838. "operationId": "session.init",
  2839. "parameters": [
  2840. {
  2841. "in": "query",
  2842. "name": "directory",
  2843. "schema": {
  2844. "type": "string"
  2845. }
  2846. },
  2847. {
  2848. "in": "query",
  2849. "name": "workspace",
  2850. "schema": {
  2851. "type": "string"
  2852. }
  2853. },
  2854. {
  2855. "in": "path",
  2856. "name": "sessionID",
  2857. "schema": {
  2858. "type": "string",
  2859. "pattern": "^ses.*"
  2860. },
  2861. "required": true
  2862. }
  2863. ],
  2864. "summary": "Initialize session",
  2865. "description": "Analyze the current application and create an AGENTS.md file with project-specific agent configurations.",
  2866. "responses": {
  2867. "200": {
  2868. "description": "200",
  2869. "content": {
  2870. "application/json": {
  2871. "schema": {
  2872. "type": "boolean"
  2873. }
  2874. }
  2875. }
  2876. },
  2877. "400": {
  2878. "description": "Bad request",
  2879. "content": {
  2880. "application/json": {
  2881. "schema": {
  2882. "$ref": "#/components/schemas/BadRequestError"
  2883. }
  2884. }
  2885. }
  2886. },
  2887. "404": {
  2888. "description": "Not found",
  2889. "content": {
  2890. "application/json": {
  2891. "schema": {
  2892. "$ref": "#/components/schemas/NotFoundError"
  2893. }
  2894. }
  2895. }
  2896. }
  2897. },
  2898. "requestBody": {
  2899. "content": {
  2900. "application/json": {
  2901. "schema": {
  2902. "type": "object",
  2903. "properties": {
  2904. "modelID": {
  2905. "type": "string"
  2906. },
  2907. "providerID": {
  2908. "type": "string"
  2909. },
  2910. "messageID": {
  2911. "type": "string",
  2912. "pattern": "^msg.*"
  2913. }
  2914. },
  2915. "required": ["modelID", "providerID", "messageID"]
  2916. }
  2917. }
  2918. }
  2919. },
  2920. "x-codeSamples": [
  2921. {
  2922. "lang": "js",
  2923. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.init({\n ...\n})"
  2924. }
  2925. ]
  2926. }
  2927. },
  2928. "/session/{sessionID}/fork": {
  2929. "post": {
  2930. "operationId": "session.fork",
  2931. "parameters": [
  2932. {
  2933. "in": "query",
  2934. "name": "directory",
  2935. "schema": {
  2936. "type": "string"
  2937. }
  2938. },
  2939. {
  2940. "in": "query",
  2941. "name": "workspace",
  2942. "schema": {
  2943. "type": "string"
  2944. }
  2945. },
  2946. {
  2947. "in": "path",
  2948. "name": "sessionID",
  2949. "schema": {
  2950. "type": "string",
  2951. "pattern": "^ses.*"
  2952. },
  2953. "required": true
  2954. }
  2955. ],
  2956. "summary": "Fork session",
  2957. "description": "Create a new session by forking an existing session at a specific message point.",
  2958. "responses": {
  2959. "200": {
  2960. "description": "200",
  2961. "content": {
  2962. "application/json": {
  2963. "schema": {
  2964. "$ref": "#/components/schemas/Session"
  2965. }
  2966. }
  2967. }
  2968. }
  2969. },
  2970. "requestBody": {
  2971. "content": {
  2972. "application/json": {
  2973. "schema": {
  2974. "type": "object",
  2975. "properties": {
  2976. "messageID": {
  2977. "type": "string",
  2978. "pattern": "^msg.*"
  2979. }
  2980. }
  2981. }
  2982. }
  2983. }
  2984. },
  2985. "x-codeSamples": [
  2986. {
  2987. "lang": "js",
  2988. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.fork({\n ...\n})"
  2989. }
  2990. ]
  2991. }
  2992. },
  2993. "/session/{sessionID}/abort": {
  2994. "post": {
  2995. "operationId": "session.abort",
  2996. "parameters": [
  2997. {
  2998. "in": "query",
  2999. "name": "directory",
  3000. "schema": {
  3001. "type": "string"
  3002. }
  3003. },
  3004. {
  3005. "in": "query",
  3006. "name": "workspace",
  3007. "schema": {
  3008. "type": "string"
  3009. }
  3010. },
  3011. {
  3012. "in": "path",
  3013. "name": "sessionID",
  3014. "schema": {
  3015. "type": "string",
  3016. "pattern": "^ses.*"
  3017. },
  3018. "required": true
  3019. }
  3020. ],
  3021. "summary": "Abort session",
  3022. "description": "Abort an active session and stop any ongoing AI processing or command execution.",
  3023. "responses": {
  3024. "200": {
  3025. "description": "Aborted session",
  3026. "content": {
  3027. "application/json": {
  3028. "schema": {
  3029. "type": "boolean"
  3030. }
  3031. }
  3032. }
  3033. },
  3034. "400": {
  3035. "description": "Bad request",
  3036. "content": {
  3037. "application/json": {
  3038. "schema": {
  3039. "$ref": "#/components/schemas/BadRequestError"
  3040. }
  3041. }
  3042. }
  3043. },
  3044. "404": {
  3045. "description": "Not found",
  3046. "content": {
  3047. "application/json": {
  3048. "schema": {
  3049. "$ref": "#/components/schemas/NotFoundError"
  3050. }
  3051. }
  3052. }
  3053. }
  3054. },
  3055. "x-codeSamples": [
  3056. {
  3057. "lang": "js",
  3058. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.abort({\n ...\n})"
  3059. }
  3060. ]
  3061. }
  3062. },
  3063. "/session/{sessionID}/share": {
  3064. "post": {
  3065. "operationId": "session.share",
  3066. "parameters": [
  3067. {
  3068. "in": "query",
  3069. "name": "directory",
  3070. "schema": {
  3071. "type": "string"
  3072. }
  3073. },
  3074. {
  3075. "in": "query",
  3076. "name": "workspace",
  3077. "schema": {
  3078. "type": "string"
  3079. }
  3080. },
  3081. {
  3082. "in": "path",
  3083. "name": "sessionID",
  3084. "schema": {
  3085. "type": "string",
  3086. "pattern": "^ses.*"
  3087. },
  3088. "required": true
  3089. }
  3090. ],
  3091. "summary": "Share session",
  3092. "description": "Create a shareable link for a session, allowing others to view the conversation.",
  3093. "responses": {
  3094. "200": {
  3095. "description": "Successfully shared session",
  3096. "content": {
  3097. "application/json": {
  3098. "schema": {
  3099. "$ref": "#/components/schemas/Session"
  3100. }
  3101. }
  3102. }
  3103. },
  3104. "400": {
  3105. "description": "Bad request",
  3106. "content": {
  3107. "application/json": {
  3108. "schema": {
  3109. "$ref": "#/components/schemas/BadRequestError"
  3110. }
  3111. }
  3112. }
  3113. },
  3114. "404": {
  3115. "description": "Not found",
  3116. "content": {
  3117. "application/json": {
  3118. "schema": {
  3119. "$ref": "#/components/schemas/NotFoundError"
  3120. }
  3121. }
  3122. }
  3123. }
  3124. },
  3125. "x-codeSamples": [
  3126. {
  3127. "lang": "js",
  3128. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.share({\n ...\n})"
  3129. }
  3130. ]
  3131. },
  3132. "delete": {
  3133. "operationId": "session.unshare",
  3134. "parameters": [
  3135. {
  3136. "in": "query",
  3137. "name": "directory",
  3138. "schema": {
  3139. "type": "string"
  3140. }
  3141. },
  3142. {
  3143. "in": "query",
  3144. "name": "workspace",
  3145. "schema": {
  3146. "type": "string"
  3147. }
  3148. },
  3149. {
  3150. "in": "path",
  3151. "name": "sessionID",
  3152. "schema": {
  3153. "type": "string",
  3154. "pattern": "^ses.*"
  3155. },
  3156. "required": true
  3157. }
  3158. ],
  3159. "summary": "Unshare session",
  3160. "description": "Remove the shareable link for a session, making it private again.",
  3161. "responses": {
  3162. "200": {
  3163. "description": "Successfully unshared session",
  3164. "content": {
  3165. "application/json": {
  3166. "schema": {
  3167. "$ref": "#/components/schemas/Session"
  3168. }
  3169. }
  3170. }
  3171. },
  3172. "400": {
  3173. "description": "Bad request",
  3174. "content": {
  3175. "application/json": {
  3176. "schema": {
  3177. "$ref": "#/components/schemas/BadRequestError"
  3178. }
  3179. }
  3180. }
  3181. },
  3182. "404": {
  3183. "description": "Not found",
  3184. "content": {
  3185. "application/json": {
  3186. "schema": {
  3187. "$ref": "#/components/schemas/NotFoundError"
  3188. }
  3189. }
  3190. }
  3191. }
  3192. },
  3193. "x-codeSamples": [
  3194. {
  3195. "lang": "js",
  3196. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.unshare({\n ...\n})"
  3197. }
  3198. ]
  3199. }
  3200. },
  3201. "/session/{sessionID}/diff": {
  3202. "get": {
  3203. "operationId": "session.diff",
  3204. "parameters": [
  3205. {
  3206. "in": "query",
  3207. "name": "directory",
  3208. "schema": {
  3209. "type": "string"
  3210. }
  3211. },
  3212. {
  3213. "in": "query",
  3214. "name": "workspace",
  3215. "schema": {
  3216. "type": "string"
  3217. }
  3218. },
  3219. {
  3220. "in": "path",
  3221. "name": "sessionID",
  3222. "schema": {
  3223. "type": "string",
  3224. "pattern": "^ses.*"
  3225. },
  3226. "required": true
  3227. },
  3228. {
  3229. "in": "query",
  3230. "name": "messageID",
  3231. "schema": {
  3232. "type": "string",
  3233. "pattern": "^msg.*"
  3234. }
  3235. }
  3236. ],
  3237. "summary": "Get message diff",
  3238. "description": "Get the file changes (diff) that resulted from a specific user message in the session.",
  3239. "responses": {
  3240. "200": {
  3241. "description": "Successfully retrieved diff",
  3242. "content": {
  3243. "application/json": {
  3244. "schema": {
  3245. "type": "array",
  3246. "items": {
  3247. "$ref": "#/components/schemas/SnapshotFileDiff"
  3248. }
  3249. }
  3250. }
  3251. }
  3252. }
  3253. },
  3254. "x-codeSamples": [
  3255. {
  3256. "lang": "js",
  3257. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.diff({\n ...\n})"
  3258. }
  3259. ]
  3260. }
  3261. },
  3262. "/session/{sessionID}/summarize": {
  3263. "post": {
  3264. "operationId": "session.summarize",
  3265. "parameters": [
  3266. {
  3267. "in": "query",
  3268. "name": "directory",
  3269. "schema": {
  3270. "type": "string"
  3271. }
  3272. },
  3273. {
  3274. "in": "query",
  3275. "name": "workspace",
  3276. "schema": {
  3277. "type": "string"
  3278. }
  3279. },
  3280. {
  3281. "in": "path",
  3282. "name": "sessionID",
  3283. "schema": {
  3284. "type": "string",
  3285. "pattern": "^ses.*"
  3286. },
  3287. "required": true
  3288. }
  3289. ],
  3290. "summary": "Summarize session",
  3291. "description": "Generate a concise summary of the session using AI compaction to preserve key information.",
  3292. "responses": {
  3293. "200": {
  3294. "description": "Summarized session",
  3295. "content": {
  3296. "application/json": {
  3297. "schema": {
  3298. "type": "boolean"
  3299. }
  3300. }
  3301. }
  3302. },
  3303. "400": {
  3304. "description": "Bad request",
  3305. "content": {
  3306. "application/json": {
  3307. "schema": {
  3308. "$ref": "#/components/schemas/BadRequestError"
  3309. }
  3310. }
  3311. }
  3312. },
  3313. "404": {
  3314. "description": "Not found",
  3315. "content": {
  3316. "application/json": {
  3317. "schema": {
  3318. "$ref": "#/components/schemas/NotFoundError"
  3319. }
  3320. }
  3321. }
  3322. }
  3323. },
  3324. "requestBody": {
  3325. "content": {
  3326. "application/json": {
  3327. "schema": {
  3328. "type": "object",
  3329. "properties": {
  3330. "providerID": {
  3331. "type": "string"
  3332. },
  3333. "modelID": {
  3334. "type": "string"
  3335. },
  3336. "auto": {
  3337. "default": false,
  3338. "type": "boolean"
  3339. }
  3340. },
  3341. "required": ["providerID", "modelID"]
  3342. }
  3343. }
  3344. }
  3345. },
  3346. "x-codeSamples": [
  3347. {
  3348. "lang": "js",
  3349. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.summarize({\n ...\n})"
  3350. }
  3351. ]
  3352. }
  3353. },
  3354. "/session/{sessionID}/message": {
  3355. "get": {
  3356. "operationId": "session.messages",
  3357. "parameters": [
  3358. {
  3359. "in": "query",
  3360. "name": "directory",
  3361. "schema": {
  3362. "type": "string"
  3363. }
  3364. },
  3365. {
  3366. "in": "query",
  3367. "name": "workspace",
  3368. "schema": {
  3369. "type": "string"
  3370. }
  3371. },
  3372. {
  3373. "in": "path",
  3374. "name": "sessionID",
  3375. "schema": {
  3376. "type": "string",
  3377. "pattern": "^ses.*"
  3378. },
  3379. "required": true
  3380. },
  3381. {
  3382. "in": "query",
  3383. "name": "limit",
  3384. "schema": {
  3385. "type": "integer",
  3386. "minimum": 0,
  3387. "maximum": 9007199254740991
  3388. },
  3389. "description": "Maximum number of messages to return"
  3390. },
  3391. {
  3392. "in": "query",
  3393. "name": "before",
  3394. "schema": {
  3395. "type": "string"
  3396. }
  3397. }
  3398. ],
  3399. "summary": "Get session messages",
  3400. "description": "Retrieve all messages in a session, including user prompts and AI responses.",
  3401. "responses": {
  3402. "200": {
  3403. "description": "List of messages",
  3404. "content": {
  3405. "application/json": {
  3406. "schema": {
  3407. "type": "array",
  3408. "items": {
  3409. "type": "object",
  3410. "properties": {
  3411. "info": {
  3412. "$ref": "#/components/schemas/Message"
  3413. },
  3414. "parts": {
  3415. "type": "array",
  3416. "items": {
  3417. "$ref": "#/components/schemas/Part"
  3418. }
  3419. }
  3420. },
  3421. "required": ["info", "parts"]
  3422. }
  3423. }
  3424. }
  3425. }
  3426. },
  3427. "400": {
  3428. "description": "Bad request",
  3429. "content": {
  3430. "application/json": {
  3431. "schema": {
  3432. "$ref": "#/components/schemas/BadRequestError"
  3433. }
  3434. }
  3435. }
  3436. },
  3437. "404": {
  3438. "description": "Not found",
  3439. "content": {
  3440. "application/json": {
  3441. "schema": {
  3442. "$ref": "#/components/schemas/NotFoundError"
  3443. }
  3444. }
  3445. }
  3446. }
  3447. },
  3448. "x-codeSamples": [
  3449. {
  3450. "lang": "js",
  3451. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.messages({\n ...\n})"
  3452. }
  3453. ]
  3454. },
  3455. "post": {
  3456. "operationId": "session.prompt",
  3457. "parameters": [
  3458. {
  3459. "in": "query",
  3460. "name": "directory",
  3461. "schema": {
  3462. "type": "string"
  3463. }
  3464. },
  3465. {
  3466. "in": "query",
  3467. "name": "workspace",
  3468. "schema": {
  3469. "type": "string"
  3470. }
  3471. },
  3472. {
  3473. "in": "path",
  3474. "name": "sessionID",
  3475. "schema": {
  3476. "type": "string",
  3477. "pattern": "^ses.*"
  3478. },
  3479. "required": true
  3480. }
  3481. ],
  3482. "summary": "Send message",
  3483. "description": "Create and send a new message to a session, streaming the AI response.",
  3484. "responses": {
  3485. "200": {
  3486. "description": "Created message",
  3487. "content": {
  3488. "application/json": {
  3489. "schema": {
  3490. "type": "object",
  3491. "properties": {
  3492. "info": {
  3493. "$ref": "#/components/schemas/AssistantMessage"
  3494. },
  3495. "parts": {
  3496. "type": "array",
  3497. "items": {
  3498. "$ref": "#/components/schemas/Part"
  3499. }
  3500. }
  3501. },
  3502. "required": ["info", "parts"]
  3503. }
  3504. }
  3505. }
  3506. },
  3507. "400": {
  3508. "description": "Bad request",
  3509. "content": {
  3510. "application/json": {
  3511. "schema": {
  3512. "$ref": "#/components/schemas/BadRequestError"
  3513. }
  3514. }
  3515. }
  3516. },
  3517. "404": {
  3518. "description": "Not found",
  3519. "content": {
  3520. "application/json": {
  3521. "schema": {
  3522. "$ref": "#/components/schemas/NotFoundError"
  3523. }
  3524. }
  3525. }
  3526. }
  3527. },
  3528. "requestBody": {
  3529. "content": {
  3530. "application/json": {
  3531. "schema": {
  3532. "type": "object",
  3533. "properties": {
  3534. "messageID": {
  3535. "type": "string",
  3536. "pattern": "^msg.*"
  3537. },
  3538. "model": {
  3539. "type": "object",
  3540. "properties": {
  3541. "providerID": {
  3542. "type": "string"
  3543. },
  3544. "modelID": {
  3545. "type": "string"
  3546. }
  3547. },
  3548. "required": ["providerID", "modelID"]
  3549. },
  3550. "agent": {
  3551. "type": "string"
  3552. },
  3553. "noReply": {
  3554. "type": "boolean"
  3555. },
  3556. "tools": {
  3557. "description": "@deprecated tools and permissions have been merged, you can set permissions on the session itself now",
  3558. "type": "object",
  3559. "propertyNames": {
  3560. "type": "string"
  3561. },
  3562. "additionalProperties": {
  3563. "type": "boolean"
  3564. }
  3565. },
  3566. "format": {
  3567. "$ref": "#/components/schemas/OutputFormat"
  3568. },
  3569. "system": {
  3570. "type": "string"
  3571. },
  3572. "variant": {
  3573. "type": "string"
  3574. },
  3575. "parts": {
  3576. "type": "array",
  3577. "items": {
  3578. "anyOf": [
  3579. {
  3580. "$ref": "#/components/schemas/TextPartInput"
  3581. },
  3582. {
  3583. "$ref": "#/components/schemas/FilePartInput"
  3584. },
  3585. {
  3586. "$ref": "#/components/schemas/AgentPartInput"
  3587. },
  3588. {
  3589. "$ref": "#/components/schemas/SubtaskPartInput"
  3590. }
  3591. ]
  3592. }
  3593. }
  3594. },
  3595. "required": ["parts"]
  3596. }
  3597. }
  3598. }
  3599. },
  3600. "x-codeSamples": [
  3601. {
  3602. "lang": "js",
  3603. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.prompt({\n ...\n})"
  3604. }
  3605. ]
  3606. }
  3607. },
  3608. "/session/{sessionID}/message/{messageID}": {
  3609. "get": {
  3610. "operationId": "session.message",
  3611. "parameters": [
  3612. {
  3613. "in": "query",
  3614. "name": "directory",
  3615. "schema": {
  3616. "type": "string"
  3617. }
  3618. },
  3619. {
  3620. "in": "query",
  3621. "name": "workspace",
  3622. "schema": {
  3623. "type": "string"
  3624. }
  3625. },
  3626. {
  3627. "in": "path",
  3628. "name": "sessionID",
  3629. "schema": {
  3630. "type": "string",
  3631. "pattern": "^ses.*"
  3632. },
  3633. "required": true
  3634. },
  3635. {
  3636. "in": "path",
  3637. "name": "messageID",
  3638. "schema": {
  3639. "type": "string",
  3640. "pattern": "^msg.*"
  3641. },
  3642. "required": true
  3643. }
  3644. ],
  3645. "summary": "Get message",
  3646. "description": "Retrieve a specific message from a session by its message ID.",
  3647. "responses": {
  3648. "200": {
  3649. "description": "Message",
  3650. "content": {
  3651. "application/json": {
  3652. "schema": {
  3653. "type": "object",
  3654. "properties": {
  3655. "info": {
  3656. "$ref": "#/components/schemas/Message"
  3657. },
  3658. "parts": {
  3659. "type": "array",
  3660. "items": {
  3661. "$ref": "#/components/schemas/Part"
  3662. }
  3663. }
  3664. },
  3665. "required": ["info", "parts"]
  3666. }
  3667. }
  3668. }
  3669. },
  3670. "400": {
  3671. "description": "Bad request",
  3672. "content": {
  3673. "application/json": {
  3674. "schema": {
  3675. "$ref": "#/components/schemas/BadRequestError"
  3676. }
  3677. }
  3678. }
  3679. },
  3680. "404": {
  3681. "description": "Not found",
  3682. "content": {
  3683. "application/json": {
  3684. "schema": {
  3685. "$ref": "#/components/schemas/NotFoundError"
  3686. }
  3687. }
  3688. }
  3689. }
  3690. },
  3691. "x-codeSamples": [
  3692. {
  3693. "lang": "js",
  3694. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.message({\n ...\n})"
  3695. }
  3696. ]
  3697. },
  3698. "delete": {
  3699. "operationId": "session.deleteMessage",
  3700. "parameters": [
  3701. {
  3702. "in": "query",
  3703. "name": "directory",
  3704. "schema": {
  3705. "type": "string"
  3706. }
  3707. },
  3708. {
  3709. "in": "query",
  3710. "name": "workspace",
  3711. "schema": {
  3712. "type": "string"
  3713. }
  3714. },
  3715. {
  3716. "in": "path",
  3717. "name": "sessionID",
  3718. "schema": {
  3719. "type": "string",
  3720. "pattern": "^ses.*"
  3721. },
  3722. "required": true
  3723. },
  3724. {
  3725. "in": "path",
  3726. "name": "messageID",
  3727. "schema": {
  3728. "type": "string",
  3729. "pattern": "^msg.*"
  3730. },
  3731. "required": true
  3732. }
  3733. ],
  3734. "summary": "Delete message",
  3735. "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.",
  3736. "responses": {
  3737. "200": {
  3738. "description": "Successfully deleted message",
  3739. "content": {
  3740. "application/json": {
  3741. "schema": {
  3742. "type": "boolean"
  3743. }
  3744. }
  3745. }
  3746. },
  3747. "400": {
  3748. "description": "Bad request",
  3749. "content": {
  3750. "application/json": {
  3751. "schema": {
  3752. "$ref": "#/components/schemas/BadRequestError"
  3753. }
  3754. }
  3755. }
  3756. },
  3757. "404": {
  3758. "description": "Not found",
  3759. "content": {
  3760. "application/json": {
  3761. "schema": {
  3762. "$ref": "#/components/schemas/NotFoundError"
  3763. }
  3764. }
  3765. }
  3766. }
  3767. },
  3768. "x-codeSamples": [
  3769. {
  3770. "lang": "js",
  3771. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.deleteMessage({\n ...\n})"
  3772. }
  3773. ]
  3774. }
  3775. },
  3776. "/session/{sessionID}/message/{messageID}/part/{partID}": {
  3777. "delete": {
  3778. "operationId": "part.delete",
  3779. "parameters": [
  3780. {
  3781. "in": "query",
  3782. "name": "directory",
  3783. "schema": {
  3784. "type": "string"
  3785. }
  3786. },
  3787. {
  3788. "in": "query",
  3789. "name": "workspace",
  3790. "schema": {
  3791. "type": "string"
  3792. }
  3793. },
  3794. {
  3795. "in": "path",
  3796. "name": "sessionID",
  3797. "schema": {
  3798. "type": "string",
  3799. "pattern": "^ses.*"
  3800. },
  3801. "required": true
  3802. },
  3803. {
  3804. "in": "path",
  3805. "name": "messageID",
  3806. "schema": {
  3807. "type": "string",
  3808. "pattern": "^msg.*"
  3809. },
  3810. "required": true
  3811. },
  3812. {
  3813. "in": "path",
  3814. "name": "partID",
  3815. "schema": {
  3816. "type": "string",
  3817. "pattern": "^prt.*"
  3818. },
  3819. "required": true
  3820. }
  3821. ],
  3822. "description": "Delete a part from a message",
  3823. "responses": {
  3824. "200": {
  3825. "description": "Successfully deleted part",
  3826. "content": {
  3827. "application/json": {
  3828. "schema": {
  3829. "type": "boolean"
  3830. }
  3831. }
  3832. }
  3833. },
  3834. "400": {
  3835. "description": "Bad request",
  3836. "content": {
  3837. "application/json": {
  3838. "schema": {
  3839. "$ref": "#/components/schemas/BadRequestError"
  3840. }
  3841. }
  3842. }
  3843. },
  3844. "404": {
  3845. "description": "Not found",
  3846. "content": {
  3847. "application/json": {
  3848. "schema": {
  3849. "$ref": "#/components/schemas/NotFoundError"
  3850. }
  3851. }
  3852. }
  3853. }
  3854. },
  3855. "x-codeSamples": [
  3856. {
  3857. "lang": "js",
  3858. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.part.delete({\n ...\n})"
  3859. }
  3860. ]
  3861. },
  3862. "patch": {
  3863. "operationId": "part.update",
  3864. "parameters": [
  3865. {
  3866. "in": "query",
  3867. "name": "directory",
  3868. "schema": {
  3869. "type": "string"
  3870. }
  3871. },
  3872. {
  3873. "in": "query",
  3874. "name": "workspace",
  3875. "schema": {
  3876. "type": "string"
  3877. }
  3878. },
  3879. {
  3880. "in": "path",
  3881. "name": "sessionID",
  3882. "schema": {
  3883. "type": "string",
  3884. "pattern": "^ses.*"
  3885. },
  3886. "required": true
  3887. },
  3888. {
  3889. "in": "path",
  3890. "name": "messageID",
  3891. "schema": {
  3892. "type": "string",
  3893. "pattern": "^msg.*"
  3894. },
  3895. "required": true
  3896. },
  3897. {
  3898. "in": "path",
  3899. "name": "partID",
  3900. "schema": {
  3901. "type": "string",
  3902. "pattern": "^prt.*"
  3903. },
  3904. "required": true
  3905. }
  3906. ],
  3907. "description": "Update a part in a message",
  3908. "responses": {
  3909. "200": {
  3910. "description": "Successfully updated part",
  3911. "content": {
  3912. "application/json": {
  3913. "schema": {
  3914. "$ref": "#/components/schemas/Part"
  3915. }
  3916. }
  3917. }
  3918. },
  3919. "400": {
  3920. "description": "Bad request",
  3921. "content": {
  3922. "application/json": {
  3923. "schema": {
  3924. "$ref": "#/components/schemas/BadRequestError"
  3925. }
  3926. }
  3927. }
  3928. },
  3929. "404": {
  3930. "description": "Not found",
  3931. "content": {
  3932. "application/json": {
  3933. "schema": {
  3934. "$ref": "#/components/schemas/NotFoundError"
  3935. }
  3936. }
  3937. }
  3938. }
  3939. },
  3940. "requestBody": {
  3941. "content": {
  3942. "application/json": {
  3943. "schema": {
  3944. "$ref": "#/components/schemas/Part"
  3945. }
  3946. }
  3947. }
  3948. },
  3949. "x-codeSamples": [
  3950. {
  3951. "lang": "js",
  3952. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.part.update({\n ...\n})"
  3953. }
  3954. ]
  3955. }
  3956. },
  3957. "/session/{sessionID}/prompt_async": {
  3958. "post": {
  3959. "operationId": "session.prompt_async",
  3960. "parameters": [
  3961. {
  3962. "in": "query",
  3963. "name": "directory",
  3964. "schema": {
  3965. "type": "string"
  3966. }
  3967. },
  3968. {
  3969. "in": "query",
  3970. "name": "workspace",
  3971. "schema": {
  3972. "type": "string"
  3973. }
  3974. },
  3975. {
  3976. "in": "path",
  3977. "name": "sessionID",
  3978. "schema": {
  3979. "type": "string",
  3980. "pattern": "^ses.*"
  3981. },
  3982. "required": true
  3983. }
  3984. ],
  3985. "summary": "Send async message",
  3986. "description": "Create and send a new message to a session asynchronously, starting the session if needed and returning immediately.",
  3987. "responses": {
  3988. "204": {
  3989. "description": "Prompt accepted"
  3990. },
  3991. "400": {
  3992. "description": "Bad request",
  3993. "content": {
  3994. "application/json": {
  3995. "schema": {
  3996. "$ref": "#/components/schemas/BadRequestError"
  3997. }
  3998. }
  3999. }
  4000. },
  4001. "404": {
  4002. "description": "Not found",
  4003. "content": {
  4004. "application/json": {
  4005. "schema": {
  4006. "$ref": "#/components/schemas/NotFoundError"
  4007. }
  4008. }
  4009. }
  4010. }
  4011. },
  4012. "requestBody": {
  4013. "content": {
  4014. "application/json": {
  4015. "schema": {
  4016. "type": "object",
  4017. "properties": {
  4018. "messageID": {
  4019. "type": "string",
  4020. "pattern": "^msg.*"
  4021. },
  4022. "model": {
  4023. "type": "object",
  4024. "properties": {
  4025. "providerID": {
  4026. "type": "string"
  4027. },
  4028. "modelID": {
  4029. "type": "string"
  4030. }
  4031. },
  4032. "required": ["providerID", "modelID"]
  4033. },
  4034. "agent": {
  4035. "type": "string"
  4036. },
  4037. "noReply": {
  4038. "type": "boolean"
  4039. },
  4040. "tools": {
  4041. "description": "@deprecated tools and permissions have been merged, you can set permissions on the session itself now",
  4042. "type": "object",
  4043. "propertyNames": {
  4044. "type": "string"
  4045. },
  4046. "additionalProperties": {
  4047. "type": "boolean"
  4048. }
  4049. },
  4050. "format": {
  4051. "$ref": "#/components/schemas/OutputFormat"
  4052. },
  4053. "system": {
  4054. "type": "string"
  4055. },
  4056. "variant": {
  4057. "type": "string"
  4058. },
  4059. "parts": {
  4060. "type": "array",
  4061. "items": {
  4062. "anyOf": [
  4063. {
  4064. "$ref": "#/components/schemas/TextPartInput"
  4065. },
  4066. {
  4067. "$ref": "#/components/schemas/FilePartInput"
  4068. },
  4069. {
  4070. "$ref": "#/components/schemas/AgentPartInput"
  4071. },
  4072. {
  4073. "$ref": "#/components/schemas/SubtaskPartInput"
  4074. }
  4075. ]
  4076. }
  4077. }
  4078. },
  4079. "required": ["parts"]
  4080. }
  4081. }
  4082. }
  4083. },
  4084. "x-codeSamples": [
  4085. {
  4086. "lang": "js",
  4087. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.prompt_async({\n ...\n})"
  4088. }
  4089. ]
  4090. }
  4091. },
  4092. "/session/{sessionID}/command": {
  4093. "post": {
  4094. "operationId": "session.command",
  4095. "parameters": [
  4096. {
  4097. "in": "query",
  4098. "name": "directory",
  4099. "schema": {
  4100. "type": "string"
  4101. }
  4102. },
  4103. {
  4104. "in": "query",
  4105. "name": "workspace",
  4106. "schema": {
  4107. "type": "string"
  4108. }
  4109. },
  4110. {
  4111. "in": "path",
  4112. "name": "sessionID",
  4113. "schema": {
  4114. "type": "string",
  4115. "pattern": "^ses.*"
  4116. },
  4117. "required": true
  4118. }
  4119. ],
  4120. "summary": "Send command",
  4121. "description": "Send a new command to a session for execution by the AI assistant.",
  4122. "responses": {
  4123. "200": {
  4124. "description": "Created message",
  4125. "content": {
  4126. "application/json": {
  4127. "schema": {
  4128. "type": "object",
  4129. "properties": {
  4130. "info": {
  4131. "$ref": "#/components/schemas/AssistantMessage"
  4132. },
  4133. "parts": {
  4134. "type": "array",
  4135. "items": {
  4136. "$ref": "#/components/schemas/Part"
  4137. }
  4138. }
  4139. },
  4140. "required": ["info", "parts"]
  4141. }
  4142. }
  4143. }
  4144. },
  4145. "400": {
  4146. "description": "Bad request",
  4147. "content": {
  4148. "application/json": {
  4149. "schema": {
  4150. "$ref": "#/components/schemas/BadRequestError"
  4151. }
  4152. }
  4153. }
  4154. },
  4155. "404": {
  4156. "description": "Not found",
  4157. "content": {
  4158. "application/json": {
  4159. "schema": {
  4160. "$ref": "#/components/schemas/NotFoundError"
  4161. }
  4162. }
  4163. }
  4164. }
  4165. },
  4166. "requestBody": {
  4167. "content": {
  4168. "application/json": {
  4169. "schema": {
  4170. "type": "object",
  4171. "properties": {
  4172. "messageID": {
  4173. "type": "string",
  4174. "pattern": "^msg.*"
  4175. },
  4176. "agent": {
  4177. "type": "string"
  4178. },
  4179. "model": {
  4180. "type": "string"
  4181. },
  4182. "arguments": {
  4183. "type": "string"
  4184. },
  4185. "command": {
  4186. "type": "string"
  4187. },
  4188. "variant": {
  4189. "type": "string"
  4190. },
  4191. "parts": {
  4192. "type": "array",
  4193. "items": {
  4194. "anyOf": [
  4195. {
  4196. "type": "object",
  4197. "properties": {
  4198. "id": {
  4199. "type": "string",
  4200. "pattern": "^prt.*"
  4201. },
  4202. "type": {
  4203. "type": "string",
  4204. "const": "file"
  4205. },
  4206. "mime": {
  4207. "type": "string"
  4208. },
  4209. "filename": {
  4210. "type": "string"
  4211. },
  4212. "url": {
  4213. "type": "string"
  4214. },
  4215. "source": {
  4216. "$ref": "#/components/schemas/FilePartSource"
  4217. }
  4218. },
  4219. "required": ["type", "mime", "url"]
  4220. }
  4221. ]
  4222. }
  4223. }
  4224. },
  4225. "required": ["arguments", "command"]
  4226. }
  4227. }
  4228. }
  4229. },
  4230. "x-codeSamples": [
  4231. {
  4232. "lang": "js",
  4233. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.command({\n ...\n})"
  4234. }
  4235. ]
  4236. }
  4237. },
  4238. "/session/{sessionID}/shell": {
  4239. "post": {
  4240. "operationId": "session.shell",
  4241. "parameters": [
  4242. {
  4243. "in": "query",
  4244. "name": "directory",
  4245. "schema": {
  4246. "type": "string"
  4247. }
  4248. },
  4249. {
  4250. "in": "query",
  4251. "name": "workspace",
  4252. "schema": {
  4253. "type": "string"
  4254. }
  4255. },
  4256. {
  4257. "in": "path",
  4258. "name": "sessionID",
  4259. "schema": {
  4260. "type": "string",
  4261. "pattern": "^ses.*"
  4262. },
  4263. "required": true
  4264. }
  4265. ],
  4266. "summary": "Run shell command",
  4267. "description": "Execute a shell command within the session context and return the AI's response.",
  4268. "responses": {
  4269. "200": {
  4270. "description": "Created message",
  4271. "content": {
  4272. "application/json": {
  4273. "schema": {
  4274. "type": "object",
  4275. "properties": {
  4276. "info": {
  4277. "$ref": "#/components/schemas/Message"
  4278. },
  4279. "parts": {
  4280. "type": "array",
  4281. "items": {
  4282. "$ref": "#/components/schemas/Part"
  4283. }
  4284. }
  4285. },
  4286. "required": ["info", "parts"]
  4287. }
  4288. }
  4289. }
  4290. },
  4291. "400": {
  4292. "description": "Bad request",
  4293. "content": {
  4294. "application/json": {
  4295. "schema": {
  4296. "$ref": "#/components/schemas/BadRequestError"
  4297. }
  4298. }
  4299. }
  4300. },
  4301. "404": {
  4302. "description": "Not found",
  4303. "content": {
  4304. "application/json": {
  4305. "schema": {
  4306. "$ref": "#/components/schemas/NotFoundError"
  4307. }
  4308. }
  4309. }
  4310. }
  4311. },
  4312. "requestBody": {
  4313. "content": {
  4314. "application/json": {
  4315. "schema": {
  4316. "type": "object",
  4317. "properties": {
  4318. "messageID": {
  4319. "type": "string",
  4320. "pattern": "^msg.*"
  4321. },
  4322. "agent": {
  4323. "type": "string"
  4324. },
  4325. "model": {
  4326. "type": "object",
  4327. "properties": {
  4328. "providerID": {
  4329. "type": "string"
  4330. },
  4331. "modelID": {
  4332. "type": "string"
  4333. }
  4334. },
  4335. "required": ["providerID", "modelID"]
  4336. },
  4337. "command": {
  4338. "type": "string"
  4339. }
  4340. },
  4341. "required": ["agent", "command"]
  4342. }
  4343. }
  4344. }
  4345. },
  4346. "x-codeSamples": [
  4347. {
  4348. "lang": "js",
  4349. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.shell({\n ...\n})"
  4350. }
  4351. ]
  4352. }
  4353. },
  4354. "/session/{sessionID}/revert": {
  4355. "post": {
  4356. "operationId": "session.revert",
  4357. "parameters": [
  4358. {
  4359. "in": "query",
  4360. "name": "directory",
  4361. "schema": {
  4362. "type": "string"
  4363. }
  4364. },
  4365. {
  4366. "in": "query",
  4367. "name": "workspace",
  4368. "schema": {
  4369. "type": "string"
  4370. }
  4371. },
  4372. {
  4373. "in": "path",
  4374. "name": "sessionID",
  4375. "schema": {
  4376. "type": "string",
  4377. "pattern": "^ses.*"
  4378. },
  4379. "required": true
  4380. }
  4381. ],
  4382. "summary": "Revert message",
  4383. "description": "Revert a specific message in a session, undoing its effects and restoring the previous state.",
  4384. "responses": {
  4385. "200": {
  4386. "description": "Updated session",
  4387. "content": {
  4388. "application/json": {
  4389. "schema": {
  4390. "$ref": "#/components/schemas/Session"
  4391. }
  4392. }
  4393. }
  4394. },
  4395. "400": {
  4396. "description": "Bad request",
  4397. "content": {
  4398. "application/json": {
  4399. "schema": {
  4400. "$ref": "#/components/schemas/BadRequestError"
  4401. }
  4402. }
  4403. }
  4404. },
  4405. "404": {
  4406. "description": "Not found",
  4407. "content": {
  4408. "application/json": {
  4409. "schema": {
  4410. "$ref": "#/components/schemas/NotFoundError"
  4411. }
  4412. }
  4413. }
  4414. }
  4415. },
  4416. "requestBody": {
  4417. "content": {
  4418. "application/json": {
  4419. "schema": {
  4420. "type": "object",
  4421. "properties": {
  4422. "messageID": {
  4423. "type": "string",
  4424. "pattern": "^msg.*"
  4425. },
  4426. "partID": {
  4427. "type": "string",
  4428. "pattern": "^prt.*"
  4429. }
  4430. },
  4431. "required": ["messageID"]
  4432. }
  4433. }
  4434. }
  4435. },
  4436. "x-codeSamples": [
  4437. {
  4438. "lang": "js",
  4439. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.revert({\n ...\n})"
  4440. }
  4441. ]
  4442. }
  4443. },
  4444. "/session/{sessionID}/unrevert": {
  4445. "post": {
  4446. "operationId": "session.unrevert",
  4447. "parameters": [
  4448. {
  4449. "in": "query",
  4450. "name": "directory",
  4451. "schema": {
  4452. "type": "string"
  4453. }
  4454. },
  4455. {
  4456. "in": "query",
  4457. "name": "workspace",
  4458. "schema": {
  4459. "type": "string"
  4460. }
  4461. },
  4462. {
  4463. "in": "path",
  4464. "name": "sessionID",
  4465. "schema": {
  4466. "type": "string",
  4467. "pattern": "^ses.*"
  4468. },
  4469. "required": true
  4470. }
  4471. ],
  4472. "summary": "Restore reverted messages",
  4473. "description": "Restore all previously reverted messages in a session.",
  4474. "responses": {
  4475. "200": {
  4476. "description": "Updated session",
  4477. "content": {
  4478. "application/json": {
  4479. "schema": {
  4480. "$ref": "#/components/schemas/Session"
  4481. }
  4482. }
  4483. }
  4484. },
  4485. "400": {
  4486. "description": "Bad request",
  4487. "content": {
  4488. "application/json": {
  4489. "schema": {
  4490. "$ref": "#/components/schemas/BadRequestError"
  4491. }
  4492. }
  4493. }
  4494. },
  4495. "404": {
  4496. "description": "Not found",
  4497. "content": {
  4498. "application/json": {
  4499. "schema": {
  4500. "$ref": "#/components/schemas/NotFoundError"
  4501. }
  4502. }
  4503. }
  4504. }
  4505. },
  4506. "x-codeSamples": [
  4507. {
  4508. "lang": "js",
  4509. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.unrevert({\n ...\n})"
  4510. }
  4511. ]
  4512. }
  4513. },
  4514. "/session/{sessionID}/permissions/{permissionID}": {
  4515. "post": {
  4516. "operationId": "permission.respond",
  4517. "parameters": [
  4518. {
  4519. "in": "query",
  4520. "name": "directory",
  4521. "schema": {
  4522. "type": "string"
  4523. }
  4524. },
  4525. {
  4526. "in": "query",
  4527. "name": "workspace",
  4528. "schema": {
  4529. "type": "string"
  4530. }
  4531. },
  4532. {
  4533. "in": "path",
  4534. "name": "sessionID",
  4535. "schema": {
  4536. "type": "string",
  4537. "pattern": "^ses.*"
  4538. },
  4539. "required": true
  4540. },
  4541. {
  4542. "in": "path",
  4543. "name": "permissionID",
  4544. "schema": {
  4545. "type": "string",
  4546. "pattern": "^per.*"
  4547. },
  4548. "required": true
  4549. }
  4550. ],
  4551. "summary": "Respond to permission",
  4552. "deprecated": true,
  4553. "description": "Approve or deny a permission request from the AI assistant.",
  4554. "responses": {
  4555. "200": {
  4556. "description": "Permission processed successfully",
  4557. "content": {
  4558. "application/json": {
  4559. "schema": {
  4560. "type": "boolean"
  4561. }
  4562. }
  4563. }
  4564. },
  4565. "400": {
  4566. "description": "Bad request",
  4567. "content": {
  4568. "application/json": {
  4569. "schema": {
  4570. "$ref": "#/components/schemas/BadRequestError"
  4571. }
  4572. }
  4573. }
  4574. },
  4575. "404": {
  4576. "description": "Not found",
  4577. "content": {
  4578. "application/json": {
  4579. "schema": {
  4580. "$ref": "#/components/schemas/NotFoundError"
  4581. }
  4582. }
  4583. }
  4584. }
  4585. },
  4586. "requestBody": {
  4587. "content": {
  4588. "application/json": {
  4589. "schema": {
  4590. "type": "object",
  4591. "properties": {
  4592. "response": {
  4593. "type": "string",
  4594. "enum": ["once", "always", "reject"]
  4595. }
  4596. },
  4597. "required": ["response"]
  4598. }
  4599. }
  4600. }
  4601. },
  4602. "x-codeSamples": [
  4603. {
  4604. "lang": "js",
  4605. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.permission.respond({\n ...\n})"
  4606. }
  4607. ]
  4608. }
  4609. },
  4610. "/permission/{requestID}/reply": {
  4611. "post": {
  4612. "operationId": "permission.reply",
  4613. "parameters": [
  4614. {
  4615. "in": "query",
  4616. "name": "directory",
  4617. "schema": {
  4618. "type": "string"
  4619. }
  4620. },
  4621. {
  4622. "in": "query",
  4623. "name": "workspace",
  4624. "schema": {
  4625. "type": "string"
  4626. }
  4627. },
  4628. {
  4629. "in": "path",
  4630. "name": "requestID",
  4631. "schema": {
  4632. "type": "string",
  4633. "pattern": "^per.*"
  4634. },
  4635. "required": true
  4636. }
  4637. ],
  4638. "summary": "Respond to permission request",
  4639. "description": "Approve or deny a permission request from the AI assistant.",
  4640. "responses": {
  4641. "200": {
  4642. "description": "Permission processed successfully",
  4643. "content": {
  4644. "application/json": {
  4645. "schema": {
  4646. "type": "boolean"
  4647. }
  4648. }
  4649. }
  4650. },
  4651. "400": {
  4652. "description": "Bad request",
  4653. "content": {
  4654. "application/json": {
  4655. "schema": {
  4656. "$ref": "#/components/schemas/BadRequestError"
  4657. }
  4658. }
  4659. }
  4660. },
  4661. "404": {
  4662. "description": "Not found",
  4663. "content": {
  4664. "application/json": {
  4665. "schema": {
  4666. "$ref": "#/components/schemas/NotFoundError"
  4667. }
  4668. }
  4669. }
  4670. }
  4671. },
  4672. "requestBody": {
  4673. "content": {
  4674. "application/json": {
  4675. "schema": {
  4676. "type": "object",
  4677. "properties": {
  4678. "reply": {
  4679. "type": "string",
  4680. "enum": ["once", "always", "reject"]
  4681. },
  4682. "message": {
  4683. "type": "string"
  4684. }
  4685. },
  4686. "required": ["reply"]
  4687. }
  4688. }
  4689. }
  4690. },
  4691. "x-codeSamples": [
  4692. {
  4693. "lang": "js",
  4694. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.permission.reply({\n ...\n})"
  4695. }
  4696. ]
  4697. }
  4698. },
  4699. "/permission": {
  4700. "get": {
  4701. "operationId": "permission.list",
  4702. "parameters": [
  4703. {
  4704. "in": "query",
  4705. "name": "directory",
  4706. "schema": {
  4707. "type": "string"
  4708. }
  4709. },
  4710. {
  4711. "in": "query",
  4712. "name": "workspace",
  4713. "schema": {
  4714. "type": "string"
  4715. }
  4716. }
  4717. ],
  4718. "summary": "List pending permissions",
  4719. "description": "Get all pending permission requests across all sessions.",
  4720. "responses": {
  4721. "200": {
  4722. "description": "List of pending permissions",
  4723. "content": {
  4724. "application/json": {
  4725. "schema": {
  4726. "type": "array",
  4727. "items": {
  4728. "$ref": "#/components/schemas/PermissionRequest"
  4729. }
  4730. }
  4731. }
  4732. }
  4733. }
  4734. },
  4735. "x-codeSamples": [
  4736. {
  4737. "lang": "js",
  4738. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.permission.list({\n ...\n})"
  4739. }
  4740. ]
  4741. }
  4742. },
  4743. "/question": {
  4744. "get": {
  4745. "operationId": "question.list",
  4746. "parameters": [
  4747. {
  4748. "in": "query",
  4749. "name": "directory",
  4750. "schema": {
  4751. "type": "string"
  4752. }
  4753. },
  4754. {
  4755. "in": "query",
  4756. "name": "workspace",
  4757. "schema": {
  4758. "type": "string"
  4759. }
  4760. }
  4761. ],
  4762. "summary": "List pending questions",
  4763. "description": "Get all pending question requests across all sessions.",
  4764. "responses": {
  4765. "200": {
  4766. "description": "List of pending questions",
  4767. "content": {
  4768. "application/json": {
  4769. "schema": {
  4770. "type": "array",
  4771. "items": {
  4772. "$ref": "#/components/schemas/QuestionRequest"
  4773. }
  4774. }
  4775. }
  4776. }
  4777. }
  4778. },
  4779. "x-codeSamples": [
  4780. {
  4781. "lang": "js",
  4782. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.question.list({\n ...\n})"
  4783. }
  4784. ]
  4785. }
  4786. },
  4787. "/question/{requestID}/reply": {
  4788. "post": {
  4789. "operationId": "question.reply",
  4790. "parameters": [
  4791. {
  4792. "in": "query",
  4793. "name": "directory",
  4794. "schema": {
  4795. "type": "string"
  4796. }
  4797. },
  4798. {
  4799. "in": "query",
  4800. "name": "workspace",
  4801. "schema": {
  4802. "type": "string"
  4803. }
  4804. },
  4805. {
  4806. "in": "path",
  4807. "name": "requestID",
  4808. "schema": {
  4809. "type": "string",
  4810. "pattern": "^que.*"
  4811. },
  4812. "required": true
  4813. }
  4814. ],
  4815. "summary": "Reply to question request",
  4816. "description": "Provide answers to a question request from the AI assistant.",
  4817. "responses": {
  4818. "200": {
  4819. "description": "Question answered successfully",
  4820. "content": {
  4821. "application/json": {
  4822. "schema": {
  4823. "type": "boolean"
  4824. }
  4825. }
  4826. }
  4827. },
  4828. "400": {
  4829. "description": "Bad request",
  4830. "content": {
  4831. "application/json": {
  4832. "schema": {
  4833. "$ref": "#/components/schemas/BadRequestError"
  4834. }
  4835. }
  4836. }
  4837. },
  4838. "404": {
  4839. "description": "Not found",
  4840. "content": {
  4841. "application/json": {
  4842. "schema": {
  4843. "$ref": "#/components/schemas/NotFoundError"
  4844. }
  4845. }
  4846. }
  4847. }
  4848. },
  4849. "requestBody": {
  4850. "content": {
  4851. "application/json": {
  4852. "schema": {
  4853. "type": "object",
  4854. "properties": {
  4855. "answers": {
  4856. "description": "User answers in order of questions (each answer is an array of selected labels)",
  4857. "type": "array",
  4858. "items": {
  4859. "$ref": "#/components/schemas/QuestionAnswer"
  4860. }
  4861. }
  4862. },
  4863. "required": ["answers"]
  4864. }
  4865. }
  4866. }
  4867. },
  4868. "x-codeSamples": [
  4869. {
  4870. "lang": "js",
  4871. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.question.reply({\n ...\n})"
  4872. }
  4873. ]
  4874. }
  4875. },
  4876. "/question/{requestID}/reject": {
  4877. "post": {
  4878. "operationId": "question.reject",
  4879. "parameters": [
  4880. {
  4881. "in": "query",
  4882. "name": "directory",
  4883. "schema": {
  4884. "type": "string"
  4885. }
  4886. },
  4887. {
  4888. "in": "query",
  4889. "name": "workspace",
  4890. "schema": {
  4891. "type": "string"
  4892. }
  4893. },
  4894. {
  4895. "in": "path",
  4896. "name": "requestID",
  4897. "schema": {
  4898. "type": "string",
  4899. "pattern": "^que.*"
  4900. },
  4901. "required": true
  4902. }
  4903. ],
  4904. "summary": "Reject question request",
  4905. "description": "Reject a question request from the AI assistant.",
  4906. "responses": {
  4907. "200": {
  4908. "description": "Question rejected successfully",
  4909. "content": {
  4910. "application/json": {
  4911. "schema": {
  4912. "type": "boolean"
  4913. }
  4914. }
  4915. }
  4916. },
  4917. "400": {
  4918. "description": "Bad request",
  4919. "content": {
  4920. "application/json": {
  4921. "schema": {
  4922. "$ref": "#/components/schemas/BadRequestError"
  4923. }
  4924. }
  4925. }
  4926. },
  4927. "404": {
  4928. "description": "Not found",
  4929. "content": {
  4930. "application/json": {
  4931. "schema": {
  4932. "$ref": "#/components/schemas/NotFoundError"
  4933. }
  4934. }
  4935. }
  4936. }
  4937. },
  4938. "x-codeSamples": [
  4939. {
  4940. "lang": "js",
  4941. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.question.reject({\n ...\n})"
  4942. }
  4943. ]
  4944. }
  4945. },
  4946. "/provider": {
  4947. "get": {
  4948. "operationId": "provider.list",
  4949. "parameters": [
  4950. {
  4951. "in": "query",
  4952. "name": "directory",
  4953. "schema": {
  4954. "type": "string"
  4955. }
  4956. },
  4957. {
  4958. "in": "query",
  4959. "name": "workspace",
  4960. "schema": {
  4961. "type": "string"
  4962. }
  4963. }
  4964. ],
  4965. "summary": "List providers",
  4966. "description": "Get a list of all available AI providers, including both available and connected ones.",
  4967. "responses": {
  4968. "200": {
  4969. "description": "List of providers",
  4970. "content": {
  4971. "application/json": {
  4972. "schema": {
  4973. "type": "object",
  4974. "properties": {
  4975. "all": {
  4976. "type": "array",
  4977. "items": {
  4978. "$ref": "#/components/schemas/Provider"
  4979. }
  4980. },
  4981. "default": {
  4982. "type": "object",
  4983. "propertyNames": {
  4984. "type": "string"
  4985. },
  4986. "additionalProperties": {
  4987. "type": "string"
  4988. }
  4989. },
  4990. "connected": {
  4991. "type": "array",
  4992. "items": {
  4993. "type": "string"
  4994. }
  4995. }
  4996. },
  4997. "required": ["all", "default", "connected"]
  4998. }
  4999. }
  5000. }
  5001. }
  5002. },
  5003. "x-codeSamples": [
  5004. {
  5005. "lang": "js",
  5006. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.list({\n ...\n})"
  5007. }
  5008. ]
  5009. }
  5010. },
  5011. "/provider/auth": {
  5012. "get": {
  5013. "operationId": "provider.auth",
  5014. "parameters": [
  5015. {
  5016. "in": "query",
  5017. "name": "directory",
  5018. "schema": {
  5019. "type": "string"
  5020. }
  5021. },
  5022. {
  5023. "in": "query",
  5024. "name": "workspace",
  5025. "schema": {
  5026. "type": "string"
  5027. }
  5028. }
  5029. ],
  5030. "summary": "Get provider auth methods",
  5031. "description": "Retrieve available authentication methods for all AI providers.",
  5032. "responses": {
  5033. "200": {
  5034. "description": "Provider auth methods",
  5035. "content": {
  5036. "application/json": {
  5037. "schema": {
  5038. "type": "object",
  5039. "propertyNames": {
  5040. "type": "string"
  5041. },
  5042. "additionalProperties": {
  5043. "type": "array",
  5044. "items": {
  5045. "$ref": "#/components/schemas/ProviderAuthMethod"
  5046. }
  5047. }
  5048. }
  5049. }
  5050. }
  5051. }
  5052. },
  5053. "x-codeSamples": [
  5054. {
  5055. "lang": "js",
  5056. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.auth({\n ...\n})"
  5057. }
  5058. ]
  5059. }
  5060. },
  5061. "/provider/{providerID}/oauth/authorize": {
  5062. "post": {
  5063. "operationId": "provider.oauth.authorize",
  5064. "parameters": [
  5065. {
  5066. "in": "query",
  5067. "name": "directory",
  5068. "schema": {
  5069. "type": "string"
  5070. }
  5071. },
  5072. {
  5073. "in": "query",
  5074. "name": "workspace",
  5075. "schema": {
  5076. "type": "string"
  5077. }
  5078. },
  5079. {
  5080. "in": "path",
  5081. "name": "providerID",
  5082. "schema": {
  5083. "type": "string"
  5084. },
  5085. "required": true,
  5086. "description": "Provider ID"
  5087. }
  5088. ],
  5089. "summary": "OAuth authorize",
  5090. "description": "Initiate OAuth authorization for a specific AI provider to get an authorization URL.",
  5091. "responses": {
  5092. "200": {
  5093. "description": "Authorization URL and method",
  5094. "content": {
  5095. "application/json": {
  5096. "schema": {
  5097. "$ref": "#/components/schemas/ProviderAuthAuthorization"
  5098. }
  5099. }
  5100. }
  5101. },
  5102. "400": {
  5103. "description": "Bad request",
  5104. "content": {
  5105. "application/json": {
  5106. "schema": {
  5107. "$ref": "#/components/schemas/BadRequestError"
  5108. }
  5109. }
  5110. }
  5111. }
  5112. },
  5113. "requestBody": {
  5114. "content": {
  5115. "application/json": {
  5116. "schema": {
  5117. "type": "object",
  5118. "properties": {
  5119. "method": {
  5120. "description": "Auth method index",
  5121. "type": "number"
  5122. },
  5123. "inputs": {
  5124. "description": "Prompt inputs",
  5125. "type": "object",
  5126. "propertyNames": {
  5127. "type": "string"
  5128. },
  5129. "additionalProperties": {
  5130. "type": "string"
  5131. }
  5132. }
  5133. },
  5134. "required": ["method"]
  5135. }
  5136. }
  5137. }
  5138. },
  5139. "x-codeSamples": [
  5140. {
  5141. "lang": "js",
  5142. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.oauth.authorize({\n ...\n})"
  5143. }
  5144. ]
  5145. }
  5146. },
  5147. "/provider/{providerID}/oauth/callback": {
  5148. "post": {
  5149. "operationId": "provider.oauth.callback",
  5150. "parameters": [
  5151. {
  5152. "in": "query",
  5153. "name": "directory",
  5154. "schema": {
  5155. "type": "string"
  5156. }
  5157. },
  5158. {
  5159. "in": "query",
  5160. "name": "workspace",
  5161. "schema": {
  5162. "type": "string"
  5163. }
  5164. },
  5165. {
  5166. "in": "path",
  5167. "name": "providerID",
  5168. "schema": {
  5169. "type": "string"
  5170. },
  5171. "required": true,
  5172. "description": "Provider ID"
  5173. }
  5174. ],
  5175. "summary": "OAuth callback",
  5176. "description": "Handle the OAuth callback from a provider after user authorization.",
  5177. "responses": {
  5178. "200": {
  5179. "description": "OAuth callback processed successfully",
  5180. "content": {
  5181. "application/json": {
  5182. "schema": {
  5183. "type": "boolean"
  5184. }
  5185. }
  5186. }
  5187. },
  5188. "400": {
  5189. "description": "Bad request",
  5190. "content": {
  5191. "application/json": {
  5192. "schema": {
  5193. "$ref": "#/components/schemas/BadRequestError"
  5194. }
  5195. }
  5196. }
  5197. }
  5198. },
  5199. "requestBody": {
  5200. "content": {
  5201. "application/json": {
  5202. "schema": {
  5203. "type": "object",
  5204. "properties": {
  5205. "method": {
  5206. "description": "Auth method index",
  5207. "type": "number"
  5208. },
  5209. "code": {
  5210. "description": "OAuth authorization code",
  5211. "type": "string"
  5212. }
  5213. },
  5214. "required": ["method"]
  5215. }
  5216. }
  5217. }
  5218. },
  5219. "x-codeSamples": [
  5220. {
  5221. "lang": "js",
  5222. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.oauth.callback({\n ...\n})"
  5223. }
  5224. ]
  5225. }
  5226. },
  5227. "/sync/start": {
  5228. "post": {
  5229. "operationId": "sync.start",
  5230. "parameters": [
  5231. {
  5232. "in": "query",
  5233. "name": "directory",
  5234. "schema": {
  5235. "type": "string"
  5236. }
  5237. },
  5238. {
  5239. "in": "query",
  5240. "name": "workspace",
  5241. "schema": {
  5242. "type": "string"
  5243. }
  5244. }
  5245. ],
  5246. "summary": "Start workspace sync",
  5247. "description": "Start sync loops for workspaces in the current project that have active sessions.",
  5248. "responses": {
  5249. "200": {
  5250. "description": "Workspace sync started",
  5251. "content": {
  5252. "application/json": {
  5253. "schema": {
  5254. "type": "boolean"
  5255. }
  5256. }
  5257. }
  5258. }
  5259. },
  5260. "x-codeSamples": [
  5261. {
  5262. "lang": "js",
  5263. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.sync.start({\n ...\n})"
  5264. }
  5265. ]
  5266. }
  5267. },
  5268. "/sync/replay": {
  5269. "post": {
  5270. "operationId": "sync.replay",
  5271. "parameters": [
  5272. {
  5273. "in": "query",
  5274. "name": "directory",
  5275. "schema": {
  5276. "type": "string"
  5277. }
  5278. },
  5279. {
  5280. "in": "query",
  5281. "name": "workspace",
  5282. "schema": {
  5283. "type": "string"
  5284. }
  5285. }
  5286. ],
  5287. "summary": "Replay sync events",
  5288. "description": "Validate and replay a complete sync event history.",
  5289. "responses": {
  5290. "200": {
  5291. "description": "Replayed sync events",
  5292. "content": {
  5293. "application/json": {
  5294. "schema": {
  5295. "type": "object",
  5296. "properties": {
  5297. "sessionID": {
  5298. "type": "string"
  5299. }
  5300. },
  5301. "required": ["sessionID"]
  5302. }
  5303. }
  5304. }
  5305. },
  5306. "400": {
  5307. "description": "Bad request",
  5308. "content": {
  5309. "application/json": {
  5310. "schema": {
  5311. "$ref": "#/components/schemas/BadRequestError"
  5312. }
  5313. }
  5314. }
  5315. }
  5316. },
  5317. "requestBody": {
  5318. "content": {
  5319. "application/json": {
  5320. "schema": {
  5321. "type": "object",
  5322. "properties": {
  5323. "directory": {
  5324. "type": "string"
  5325. },
  5326. "events": {
  5327. "minItems": 1,
  5328. "type": "array",
  5329. "items": {
  5330. "type": "object",
  5331. "properties": {
  5332. "id": {
  5333. "type": "string"
  5334. },
  5335. "aggregateID": {
  5336. "type": "string"
  5337. },
  5338. "seq": {
  5339. "type": "integer",
  5340. "minimum": 0,
  5341. "maximum": 9007199254740991
  5342. },
  5343. "type": {
  5344. "type": "string"
  5345. },
  5346. "data": {
  5347. "type": "object",
  5348. "propertyNames": {
  5349. "type": "string"
  5350. },
  5351. "additionalProperties": {}
  5352. }
  5353. },
  5354. "required": ["id", "aggregateID", "seq", "type", "data"]
  5355. }
  5356. }
  5357. },
  5358. "required": ["directory", "events"]
  5359. }
  5360. }
  5361. }
  5362. },
  5363. "x-codeSamples": [
  5364. {
  5365. "lang": "js",
  5366. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.sync.replay({\n ...\n})"
  5367. }
  5368. ]
  5369. }
  5370. },
  5371. "/sync/history": {
  5372. "post": {
  5373. "operationId": "sync.history.list",
  5374. "parameters": [
  5375. {
  5376. "in": "query",
  5377. "name": "directory",
  5378. "schema": {
  5379. "type": "string"
  5380. }
  5381. },
  5382. {
  5383. "in": "query",
  5384. "name": "workspace",
  5385. "schema": {
  5386. "type": "string"
  5387. }
  5388. }
  5389. ],
  5390. "summary": "List sync events",
  5391. "description": "List sync events for all aggregates. Keys are aggregate IDs the client already knows about, values are the last known sequence ID. Events with seq > value are returned for those aggregates. Aggregates not listed in the input get their full history.",
  5392. "responses": {
  5393. "200": {
  5394. "description": "Sync events",
  5395. "content": {
  5396. "application/json": {
  5397. "schema": {
  5398. "type": "array",
  5399. "items": {
  5400. "type": "object",
  5401. "properties": {
  5402. "id": {
  5403. "type": "string"
  5404. },
  5405. "aggregate_id": {
  5406. "type": "string"
  5407. },
  5408. "seq": {
  5409. "type": "number"
  5410. },
  5411. "type": {
  5412. "type": "string"
  5413. },
  5414. "data": {
  5415. "type": "object",
  5416. "propertyNames": {
  5417. "type": "string"
  5418. },
  5419. "additionalProperties": {}
  5420. }
  5421. },
  5422. "required": ["id", "aggregate_id", "seq", "type", "data"]
  5423. }
  5424. }
  5425. }
  5426. }
  5427. },
  5428. "400": {
  5429. "description": "Bad request",
  5430. "content": {
  5431. "application/json": {
  5432. "schema": {
  5433. "$ref": "#/components/schemas/BadRequestError"
  5434. }
  5435. }
  5436. }
  5437. }
  5438. },
  5439. "requestBody": {
  5440. "content": {
  5441. "application/json": {
  5442. "schema": {
  5443. "type": "object",
  5444. "propertyNames": {
  5445. "type": "string"
  5446. },
  5447. "additionalProperties": {
  5448. "type": "integer",
  5449. "minimum": 0,
  5450. "maximum": 9007199254740991
  5451. }
  5452. }
  5453. }
  5454. }
  5455. },
  5456. "x-codeSamples": [
  5457. {
  5458. "lang": "js",
  5459. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.sync.history.list({\n ...\n})"
  5460. }
  5461. ]
  5462. }
  5463. },
  5464. "/find": {
  5465. "get": {
  5466. "operationId": "find.text",
  5467. "parameters": [
  5468. {
  5469. "in": "query",
  5470. "name": "directory",
  5471. "schema": {
  5472. "type": "string"
  5473. }
  5474. },
  5475. {
  5476. "in": "query",
  5477. "name": "workspace",
  5478. "schema": {
  5479. "type": "string"
  5480. }
  5481. },
  5482. {
  5483. "in": "query",
  5484. "name": "pattern",
  5485. "schema": {
  5486. "type": "string"
  5487. },
  5488. "required": true
  5489. }
  5490. ],
  5491. "summary": "Find text",
  5492. "description": "Search for text patterns across files in the project using ripgrep.",
  5493. "responses": {
  5494. "200": {
  5495. "description": "Matches",
  5496. "content": {
  5497. "application/json": {
  5498. "schema": {
  5499. "type": "array",
  5500. "items": {
  5501. "type": "object",
  5502. "properties": {
  5503. "path": {
  5504. "type": "object",
  5505. "properties": {
  5506. "text": {
  5507. "type": "string"
  5508. }
  5509. },
  5510. "required": ["text"]
  5511. },
  5512. "lines": {
  5513. "type": "object",
  5514. "properties": {
  5515. "text": {
  5516. "type": "string"
  5517. }
  5518. },
  5519. "required": ["text"]
  5520. },
  5521. "line_number": {
  5522. "type": "number"
  5523. },
  5524. "absolute_offset": {
  5525. "type": "number"
  5526. },
  5527. "submatches": {
  5528. "type": "array",
  5529. "items": {
  5530. "type": "object",
  5531. "properties": {
  5532. "match": {
  5533. "type": "object",
  5534. "properties": {
  5535. "text": {
  5536. "type": "string"
  5537. }
  5538. },
  5539. "required": ["text"]
  5540. },
  5541. "start": {
  5542. "type": "number"
  5543. },
  5544. "end": {
  5545. "type": "number"
  5546. }
  5547. },
  5548. "required": ["match", "start", "end"]
  5549. }
  5550. }
  5551. },
  5552. "required": ["path", "lines", "line_number", "absolute_offset", "submatches"]
  5553. }
  5554. }
  5555. }
  5556. }
  5557. }
  5558. },
  5559. "x-codeSamples": [
  5560. {
  5561. "lang": "js",
  5562. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.find.text({\n ...\n})"
  5563. }
  5564. ]
  5565. }
  5566. },
  5567. "/find/file": {
  5568. "get": {
  5569. "operationId": "find.files",
  5570. "parameters": [
  5571. {
  5572. "in": "query",
  5573. "name": "directory",
  5574. "schema": {
  5575. "type": "string"
  5576. }
  5577. },
  5578. {
  5579. "in": "query",
  5580. "name": "workspace",
  5581. "schema": {
  5582. "type": "string"
  5583. }
  5584. },
  5585. {
  5586. "in": "query",
  5587. "name": "query",
  5588. "schema": {
  5589. "type": "string"
  5590. },
  5591. "required": true
  5592. },
  5593. {
  5594. "in": "query",
  5595. "name": "dirs",
  5596. "schema": {
  5597. "type": "string",
  5598. "enum": ["true", "false"]
  5599. }
  5600. },
  5601. {
  5602. "in": "query",
  5603. "name": "type",
  5604. "schema": {
  5605. "type": "string",
  5606. "enum": ["file", "directory"]
  5607. }
  5608. },
  5609. {
  5610. "in": "query",
  5611. "name": "limit",
  5612. "schema": {
  5613. "type": "integer",
  5614. "minimum": 1,
  5615. "maximum": 200
  5616. }
  5617. }
  5618. ],
  5619. "summary": "Find files",
  5620. "description": "Search for files or directories by name or pattern in the project directory.",
  5621. "responses": {
  5622. "200": {
  5623. "description": "File paths",
  5624. "content": {
  5625. "application/json": {
  5626. "schema": {
  5627. "type": "array",
  5628. "items": {
  5629. "type": "string"
  5630. }
  5631. }
  5632. }
  5633. }
  5634. }
  5635. },
  5636. "x-codeSamples": [
  5637. {
  5638. "lang": "js",
  5639. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.find.files({\n ...\n})"
  5640. }
  5641. ]
  5642. }
  5643. },
  5644. "/find/symbol": {
  5645. "get": {
  5646. "operationId": "find.symbols",
  5647. "parameters": [
  5648. {
  5649. "in": "query",
  5650. "name": "directory",
  5651. "schema": {
  5652. "type": "string"
  5653. }
  5654. },
  5655. {
  5656. "in": "query",
  5657. "name": "workspace",
  5658. "schema": {
  5659. "type": "string"
  5660. }
  5661. },
  5662. {
  5663. "in": "query",
  5664. "name": "query",
  5665. "schema": {
  5666. "type": "string"
  5667. },
  5668. "required": true
  5669. }
  5670. ],
  5671. "summary": "Find symbols",
  5672. "description": "Search for workspace symbols like functions, classes, and variables using LSP.",
  5673. "responses": {
  5674. "200": {
  5675. "description": "Symbols",
  5676. "content": {
  5677. "application/json": {
  5678. "schema": {
  5679. "type": "array",
  5680. "items": {
  5681. "$ref": "#/components/schemas/Symbol"
  5682. }
  5683. }
  5684. }
  5685. }
  5686. }
  5687. },
  5688. "x-codeSamples": [
  5689. {
  5690. "lang": "js",
  5691. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.find.symbols({\n ...\n})"
  5692. }
  5693. ]
  5694. }
  5695. },
  5696. "/file": {
  5697. "get": {
  5698. "operationId": "file.list",
  5699. "parameters": [
  5700. {
  5701. "in": "query",
  5702. "name": "directory",
  5703. "schema": {
  5704. "type": "string"
  5705. }
  5706. },
  5707. {
  5708. "in": "query",
  5709. "name": "workspace",
  5710. "schema": {
  5711. "type": "string"
  5712. }
  5713. },
  5714. {
  5715. "in": "query",
  5716. "name": "path",
  5717. "schema": {
  5718. "type": "string"
  5719. },
  5720. "required": true
  5721. }
  5722. ],
  5723. "summary": "List files",
  5724. "description": "List files and directories in a specified path.",
  5725. "responses": {
  5726. "200": {
  5727. "description": "Files and directories",
  5728. "content": {
  5729. "application/json": {
  5730. "schema": {
  5731. "type": "array",
  5732. "items": {
  5733. "$ref": "#/components/schemas/FileNode"
  5734. }
  5735. }
  5736. }
  5737. }
  5738. }
  5739. },
  5740. "x-codeSamples": [
  5741. {
  5742. "lang": "js",
  5743. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.file.list({\n ...\n})"
  5744. }
  5745. ]
  5746. }
  5747. },
  5748. "/file/content": {
  5749. "get": {
  5750. "operationId": "file.read",
  5751. "parameters": [
  5752. {
  5753. "in": "query",
  5754. "name": "directory",
  5755. "schema": {
  5756. "type": "string"
  5757. }
  5758. },
  5759. {
  5760. "in": "query",
  5761. "name": "workspace",
  5762. "schema": {
  5763. "type": "string"
  5764. }
  5765. },
  5766. {
  5767. "in": "query",
  5768. "name": "path",
  5769. "schema": {
  5770. "type": "string"
  5771. },
  5772. "required": true
  5773. }
  5774. ],
  5775. "summary": "Read file",
  5776. "description": "Read the content of a specified file.",
  5777. "responses": {
  5778. "200": {
  5779. "description": "File content",
  5780. "content": {
  5781. "application/json": {
  5782. "schema": {
  5783. "$ref": "#/components/schemas/FileContent"
  5784. }
  5785. }
  5786. }
  5787. }
  5788. },
  5789. "x-codeSamples": [
  5790. {
  5791. "lang": "js",
  5792. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.file.read({\n ...\n})"
  5793. }
  5794. ]
  5795. }
  5796. },
  5797. "/file/status": {
  5798. "get": {
  5799. "operationId": "file.status",
  5800. "parameters": [
  5801. {
  5802. "in": "query",
  5803. "name": "directory",
  5804. "schema": {
  5805. "type": "string"
  5806. }
  5807. },
  5808. {
  5809. "in": "query",
  5810. "name": "workspace",
  5811. "schema": {
  5812. "type": "string"
  5813. }
  5814. }
  5815. ],
  5816. "summary": "Get file status",
  5817. "description": "Get the git status of all files in the project.",
  5818. "responses": {
  5819. "200": {
  5820. "description": "File status",
  5821. "content": {
  5822. "application/json": {
  5823. "schema": {
  5824. "type": "array",
  5825. "items": {
  5826. "$ref": "#/components/schemas/File"
  5827. }
  5828. }
  5829. }
  5830. }
  5831. }
  5832. },
  5833. "x-codeSamples": [
  5834. {
  5835. "lang": "js",
  5836. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.file.status({\n ...\n})"
  5837. }
  5838. ]
  5839. }
  5840. },
  5841. "/event": {
  5842. "get": {
  5843. "operationId": "event.subscribe",
  5844. "parameters": [
  5845. {
  5846. "in": "query",
  5847. "name": "directory",
  5848. "schema": {
  5849. "type": "string"
  5850. }
  5851. },
  5852. {
  5853. "in": "query",
  5854. "name": "workspace",
  5855. "schema": {
  5856. "type": "string"
  5857. }
  5858. }
  5859. ],
  5860. "summary": "Subscribe to events",
  5861. "description": "Get events",
  5862. "responses": {
  5863. "200": {
  5864. "description": "Event stream",
  5865. "content": {
  5866. "text/event-stream": {
  5867. "schema": {
  5868. "$ref": "#/components/schemas/Event"
  5869. }
  5870. }
  5871. }
  5872. }
  5873. },
  5874. "x-codeSamples": [
  5875. {
  5876. "lang": "js",
  5877. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.event.subscribe({\n ...\n})"
  5878. }
  5879. ]
  5880. }
  5881. },
  5882. "/mcp": {
  5883. "get": {
  5884. "operationId": "mcp.status",
  5885. "parameters": [
  5886. {
  5887. "in": "query",
  5888. "name": "directory",
  5889. "schema": {
  5890. "type": "string"
  5891. }
  5892. },
  5893. {
  5894. "in": "query",
  5895. "name": "workspace",
  5896. "schema": {
  5897. "type": "string"
  5898. }
  5899. }
  5900. ],
  5901. "summary": "Get MCP status",
  5902. "description": "Get the status of all Model Context Protocol (MCP) servers.",
  5903. "responses": {
  5904. "200": {
  5905. "description": "MCP server status",
  5906. "content": {
  5907. "application/json": {
  5908. "schema": {
  5909. "type": "object",
  5910. "propertyNames": {
  5911. "type": "string"
  5912. },
  5913. "additionalProperties": {
  5914. "$ref": "#/components/schemas/MCPStatus"
  5915. }
  5916. }
  5917. }
  5918. }
  5919. }
  5920. },
  5921. "x-codeSamples": [
  5922. {
  5923. "lang": "js",
  5924. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.status({\n ...\n})"
  5925. }
  5926. ]
  5927. },
  5928. "post": {
  5929. "operationId": "mcp.add",
  5930. "parameters": [
  5931. {
  5932. "in": "query",
  5933. "name": "directory",
  5934. "schema": {
  5935. "type": "string"
  5936. }
  5937. },
  5938. {
  5939. "in": "query",
  5940. "name": "workspace",
  5941. "schema": {
  5942. "type": "string"
  5943. }
  5944. }
  5945. ],
  5946. "summary": "Add MCP server",
  5947. "description": "Dynamically add a new Model Context Protocol (MCP) server to the system.",
  5948. "responses": {
  5949. "200": {
  5950. "description": "MCP server added successfully",
  5951. "content": {
  5952. "application/json": {
  5953. "schema": {
  5954. "type": "object",
  5955. "propertyNames": {
  5956. "type": "string"
  5957. },
  5958. "additionalProperties": {
  5959. "$ref": "#/components/schemas/MCPStatus"
  5960. }
  5961. }
  5962. }
  5963. }
  5964. },
  5965. "400": {
  5966. "description": "Bad request",
  5967. "content": {
  5968. "application/json": {
  5969. "schema": {
  5970. "$ref": "#/components/schemas/BadRequestError"
  5971. }
  5972. }
  5973. }
  5974. }
  5975. },
  5976. "requestBody": {
  5977. "content": {
  5978. "application/json": {
  5979. "schema": {
  5980. "type": "object",
  5981. "properties": {
  5982. "name": {
  5983. "type": "string"
  5984. },
  5985. "config": {
  5986. "anyOf": [
  5987. {
  5988. "$ref": "#/components/schemas/McpLocalConfig"
  5989. },
  5990. {
  5991. "$ref": "#/components/schemas/McpRemoteConfig"
  5992. }
  5993. ]
  5994. }
  5995. },
  5996. "required": ["name", "config"]
  5997. }
  5998. }
  5999. }
  6000. },
  6001. "x-codeSamples": [
  6002. {
  6003. "lang": "js",
  6004. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.add({\n ...\n})"
  6005. }
  6006. ]
  6007. }
  6008. },
  6009. "/mcp/{name}/auth": {
  6010. "post": {
  6011. "operationId": "mcp.auth.start",
  6012. "parameters": [
  6013. {
  6014. "in": "query",
  6015. "name": "directory",
  6016. "schema": {
  6017. "type": "string"
  6018. }
  6019. },
  6020. {
  6021. "in": "query",
  6022. "name": "workspace",
  6023. "schema": {
  6024. "type": "string"
  6025. }
  6026. },
  6027. {
  6028. "schema": {
  6029. "type": "string"
  6030. },
  6031. "in": "path",
  6032. "name": "name",
  6033. "required": true
  6034. }
  6035. ],
  6036. "summary": "Start MCP OAuth",
  6037. "description": "Start OAuth authentication flow for a Model Context Protocol (MCP) server.",
  6038. "responses": {
  6039. "200": {
  6040. "description": "OAuth flow started",
  6041. "content": {
  6042. "application/json": {
  6043. "schema": {
  6044. "type": "object",
  6045. "properties": {
  6046. "authorizationUrl": {
  6047. "description": "URL to open in browser for authorization",
  6048. "type": "string"
  6049. }
  6050. },
  6051. "required": ["authorizationUrl"]
  6052. }
  6053. }
  6054. }
  6055. },
  6056. "400": {
  6057. "description": "Bad request",
  6058. "content": {
  6059. "application/json": {
  6060. "schema": {
  6061. "$ref": "#/components/schemas/BadRequestError"
  6062. }
  6063. }
  6064. }
  6065. },
  6066. "404": {
  6067. "description": "Not found",
  6068. "content": {
  6069. "application/json": {
  6070. "schema": {
  6071. "$ref": "#/components/schemas/NotFoundError"
  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.mcp.auth.start({\n ...\n})"
  6081. }
  6082. ]
  6083. },
  6084. "delete": {
  6085. "operationId": "mcp.auth.remove",
  6086. "parameters": [
  6087. {
  6088. "in": "query",
  6089. "name": "directory",
  6090. "schema": {
  6091. "type": "string"
  6092. }
  6093. },
  6094. {
  6095. "in": "query",
  6096. "name": "workspace",
  6097. "schema": {
  6098. "type": "string"
  6099. }
  6100. },
  6101. {
  6102. "schema": {
  6103. "type": "string"
  6104. },
  6105. "in": "path",
  6106. "name": "name",
  6107. "required": true
  6108. }
  6109. ],
  6110. "summary": "Remove MCP OAuth",
  6111. "description": "Remove OAuth credentials for an MCP server",
  6112. "responses": {
  6113. "200": {
  6114. "description": "OAuth credentials removed",
  6115. "content": {
  6116. "application/json": {
  6117. "schema": {
  6118. "type": "object",
  6119. "properties": {
  6120. "success": {
  6121. "type": "boolean",
  6122. "const": true
  6123. }
  6124. },
  6125. "required": ["success"]
  6126. }
  6127. }
  6128. }
  6129. },
  6130. "404": {
  6131. "description": "Not found",
  6132. "content": {
  6133. "application/json": {
  6134. "schema": {
  6135. "$ref": "#/components/schemas/NotFoundError"
  6136. }
  6137. }
  6138. }
  6139. }
  6140. },
  6141. "x-codeSamples": [
  6142. {
  6143. "lang": "js",
  6144. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.remove({\n ...\n})"
  6145. }
  6146. ]
  6147. }
  6148. },
  6149. "/mcp/{name}/auth/callback": {
  6150. "post": {
  6151. "operationId": "mcp.auth.callback",
  6152. "parameters": [
  6153. {
  6154. "in": "query",
  6155. "name": "directory",
  6156. "schema": {
  6157. "type": "string"
  6158. }
  6159. },
  6160. {
  6161. "in": "query",
  6162. "name": "workspace",
  6163. "schema": {
  6164. "type": "string"
  6165. }
  6166. },
  6167. {
  6168. "schema": {
  6169. "type": "string"
  6170. },
  6171. "in": "path",
  6172. "name": "name",
  6173. "required": true
  6174. }
  6175. ],
  6176. "summary": "Complete MCP OAuth",
  6177. "description": "Complete OAuth authentication for a Model Context Protocol (MCP) server using the authorization code.",
  6178. "responses": {
  6179. "200": {
  6180. "description": "OAuth authentication completed",
  6181. "content": {
  6182. "application/json": {
  6183. "schema": {
  6184. "$ref": "#/components/schemas/MCPStatus"
  6185. }
  6186. }
  6187. }
  6188. },
  6189. "400": {
  6190. "description": "Bad request",
  6191. "content": {
  6192. "application/json": {
  6193. "schema": {
  6194. "$ref": "#/components/schemas/BadRequestError"
  6195. }
  6196. }
  6197. }
  6198. },
  6199. "404": {
  6200. "description": "Not found",
  6201. "content": {
  6202. "application/json": {
  6203. "schema": {
  6204. "$ref": "#/components/schemas/NotFoundError"
  6205. }
  6206. }
  6207. }
  6208. }
  6209. },
  6210. "requestBody": {
  6211. "content": {
  6212. "application/json": {
  6213. "schema": {
  6214. "type": "object",
  6215. "properties": {
  6216. "code": {
  6217. "description": "Authorization code from OAuth callback",
  6218. "type": "string"
  6219. }
  6220. },
  6221. "required": ["code"]
  6222. }
  6223. }
  6224. }
  6225. },
  6226. "x-codeSamples": [
  6227. {
  6228. "lang": "js",
  6229. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.callback({\n ...\n})"
  6230. }
  6231. ]
  6232. }
  6233. },
  6234. "/mcp/{name}/auth/authenticate": {
  6235. "post": {
  6236. "operationId": "mcp.auth.authenticate",
  6237. "parameters": [
  6238. {
  6239. "in": "query",
  6240. "name": "directory",
  6241. "schema": {
  6242. "type": "string"
  6243. }
  6244. },
  6245. {
  6246. "in": "query",
  6247. "name": "workspace",
  6248. "schema": {
  6249. "type": "string"
  6250. }
  6251. },
  6252. {
  6253. "schema": {
  6254. "type": "string"
  6255. },
  6256. "in": "path",
  6257. "name": "name",
  6258. "required": true
  6259. }
  6260. ],
  6261. "summary": "Authenticate MCP OAuth",
  6262. "description": "Start OAuth flow and wait for callback (opens browser)",
  6263. "responses": {
  6264. "200": {
  6265. "description": "OAuth authentication completed",
  6266. "content": {
  6267. "application/json": {
  6268. "schema": {
  6269. "$ref": "#/components/schemas/MCPStatus"
  6270. }
  6271. }
  6272. }
  6273. },
  6274. "400": {
  6275. "description": "Bad request",
  6276. "content": {
  6277. "application/json": {
  6278. "schema": {
  6279. "$ref": "#/components/schemas/BadRequestError"
  6280. }
  6281. }
  6282. }
  6283. },
  6284. "404": {
  6285. "description": "Not found",
  6286. "content": {
  6287. "application/json": {
  6288. "schema": {
  6289. "$ref": "#/components/schemas/NotFoundError"
  6290. }
  6291. }
  6292. }
  6293. }
  6294. },
  6295. "x-codeSamples": [
  6296. {
  6297. "lang": "js",
  6298. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.authenticate({\n ...\n})"
  6299. }
  6300. ]
  6301. }
  6302. },
  6303. "/mcp/{name}/connect": {
  6304. "post": {
  6305. "operationId": "mcp.connect",
  6306. "parameters": [
  6307. {
  6308. "in": "query",
  6309. "name": "directory",
  6310. "schema": {
  6311. "type": "string"
  6312. }
  6313. },
  6314. {
  6315. "in": "query",
  6316. "name": "workspace",
  6317. "schema": {
  6318. "type": "string"
  6319. }
  6320. },
  6321. {
  6322. "in": "path",
  6323. "name": "name",
  6324. "schema": {
  6325. "type": "string"
  6326. },
  6327. "required": true
  6328. }
  6329. ],
  6330. "description": "Connect an MCP server",
  6331. "responses": {
  6332. "200": {
  6333. "description": "MCP server connected successfully",
  6334. "content": {
  6335. "application/json": {
  6336. "schema": {
  6337. "type": "boolean"
  6338. }
  6339. }
  6340. }
  6341. }
  6342. },
  6343. "x-codeSamples": [
  6344. {
  6345. "lang": "js",
  6346. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.connect({\n ...\n})"
  6347. }
  6348. ]
  6349. }
  6350. },
  6351. "/mcp/{name}/disconnect": {
  6352. "post": {
  6353. "operationId": "mcp.disconnect",
  6354. "parameters": [
  6355. {
  6356. "in": "query",
  6357. "name": "directory",
  6358. "schema": {
  6359. "type": "string"
  6360. }
  6361. },
  6362. {
  6363. "in": "query",
  6364. "name": "workspace",
  6365. "schema": {
  6366. "type": "string"
  6367. }
  6368. },
  6369. {
  6370. "in": "path",
  6371. "name": "name",
  6372. "schema": {
  6373. "type": "string"
  6374. },
  6375. "required": true
  6376. }
  6377. ],
  6378. "description": "Disconnect an MCP server",
  6379. "responses": {
  6380. "200": {
  6381. "description": "MCP server disconnected successfully",
  6382. "content": {
  6383. "application/json": {
  6384. "schema": {
  6385. "type": "boolean"
  6386. }
  6387. }
  6388. }
  6389. }
  6390. },
  6391. "x-codeSamples": [
  6392. {
  6393. "lang": "js",
  6394. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.disconnect({\n ...\n})"
  6395. }
  6396. ]
  6397. }
  6398. },
  6399. "/tui/append-prompt": {
  6400. "post": {
  6401. "operationId": "tui.appendPrompt",
  6402. "parameters": [
  6403. {
  6404. "in": "query",
  6405. "name": "directory",
  6406. "schema": {
  6407. "type": "string"
  6408. }
  6409. },
  6410. {
  6411. "in": "query",
  6412. "name": "workspace",
  6413. "schema": {
  6414. "type": "string"
  6415. }
  6416. }
  6417. ],
  6418. "summary": "Append TUI prompt",
  6419. "description": "Append prompt to the TUI",
  6420. "responses": {
  6421. "200": {
  6422. "description": "Prompt processed successfully",
  6423. "content": {
  6424. "application/json": {
  6425. "schema": {
  6426. "type": "boolean"
  6427. }
  6428. }
  6429. }
  6430. },
  6431. "400": {
  6432. "description": "Bad request",
  6433. "content": {
  6434. "application/json": {
  6435. "schema": {
  6436. "$ref": "#/components/schemas/BadRequestError"
  6437. }
  6438. }
  6439. }
  6440. }
  6441. },
  6442. "requestBody": {
  6443. "content": {
  6444. "application/json": {
  6445. "schema": {
  6446. "type": "object",
  6447. "properties": {
  6448. "text": {
  6449. "type": "string"
  6450. }
  6451. },
  6452. "required": ["text"]
  6453. }
  6454. }
  6455. }
  6456. },
  6457. "x-codeSamples": [
  6458. {
  6459. "lang": "js",
  6460. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.appendPrompt({\n ...\n})"
  6461. }
  6462. ]
  6463. }
  6464. },
  6465. "/tui/open-help": {
  6466. "post": {
  6467. "operationId": "tui.openHelp",
  6468. "parameters": [
  6469. {
  6470. "in": "query",
  6471. "name": "directory",
  6472. "schema": {
  6473. "type": "string"
  6474. }
  6475. },
  6476. {
  6477. "in": "query",
  6478. "name": "workspace",
  6479. "schema": {
  6480. "type": "string"
  6481. }
  6482. }
  6483. ],
  6484. "summary": "Open help dialog",
  6485. "description": "Open the help dialog in the TUI to display user assistance information.",
  6486. "responses": {
  6487. "200": {
  6488. "description": "Help dialog opened successfully",
  6489. "content": {
  6490. "application/json": {
  6491. "schema": {
  6492. "type": "boolean"
  6493. }
  6494. }
  6495. }
  6496. }
  6497. },
  6498. "x-codeSamples": [
  6499. {
  6500. "lang": "js",
  6501. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openHelp({\n ...\n})"
  6502. }
  6503. ]
  6504. }
  6505. },
  6506. "/tui/open-sessions": {
  6507. "post": {
  6508. "operationId": "tui.openSessions",
  6509. "parameters": [
  6510. {
  6511. "in": "query",
  6512. "name": "directory",
  6513. "schema": {
  6514. "type": "string"
  6515. }
  6516. },
  6517. {
  6518. "in": "query",
  6519. "name": "workspace",
  6520. "schema": {
  6521. "type": "string"
  6522. }
  6523. }
  6524. ],
  6525. "summary": "Open sessions dialog",
  6526. "description": "Open the session dialog",
  6527. "responses": {
  6528. "200": {
  6529. "description": "Session dialog opened successfully",
  6530. "content": {
  6531. "application/json": {
  6532. "schema": {
  6533. "type": "boolean"
  6534. }
  6535. }
  6536. }
  6537. }
  6538. },
  6539. "x-codeSamples": [
  6540. {
  6541. "lang": "js",
  6542. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openSessions({\n ...\n})"
  6543. }
  6544. ]
  6545. }
  6546. },
  6547. "/tui/open-themes": {
  6548. "post": {
  6549. "operationId": "tui.openThemes",
  6550. "parameters": [
  6551. {
  6552. "in": "query",
  6553. "name": "directory",
  6554. "schema": {
  6555. "type": "string"
  6556. }
  6557. },
  6558. {
  6559. "in": "query",
  6560. "name": "workspace",
  6561. "schema": {
  6562. "type": "string"
  6563. }
  6564. }
  6565. ],
  6566. "summary": "Open themes dialog",
  6567. "description": "Open the theme dialog",
  6568. "responses": {
  6569. "200": {
  6570. "description": "Theme dialog opened successfully",
  6571. "content": {
  6572. "application/json": {
  6573. "schema": {
  6574. "type": "boolean"
  6575. }
  6576. }
  6577. }
  6578. }
  6579. },
  6580. "x-codeSamples": [
  6581. {
  6582. "lang": "js",
  6583. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openThemes({\n ...\n})"
  6584. }
  6585. ]
  6586. }
  6587. },
  6588. "/tui/open-models": {
  6589. "post": {
  6590. "operationId": "tui.openModels",
  6591. "parameters": [
  6592. {
  6593. "in": "query",
  6594. "name": "directory",
  6595. "schema": {
  6596. "type": "string"
  6597. }
  6598. },
  6599. {
  6600. "in": "query",
  6601. "name": "workspace",
  6602. "schema": {
  6603. "type": "string"
  6604. }
  6605. }
  6606. ],
  6607. "summary": "Open models dialog",
  6608. "description": "Open the model dialog",
  6609. "responses": {
  6610. "200": {
  6611. "description": "Model dialog opened successfully",
  6612. "content": {
  6613. "application/json": {
  6614. "schema": {
  6615. "type": "boolean"
  6616. }
  6617. }
  6618. }
  6619. }
  6620. },
  6621. "x-codeSamples": [
  6622. {
  6623. "lang": "js",
  6624. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openModels({\n ...\n})"
  6625. }
  6626. ]
  6627. }
  6628. },
  6629. "/tui/submit-prompt": {
  6630. "post": {
  6631. "operationId": "tui.submitPrompt",
  6632. "parameters": [
  6633. {
  6634. "in": "query",
  6635. "name": "directory",
  6636. "schema": {
  6637. "type": "string"
  6638. }
  6639. },
  6640. {
  6641. "in": "query",
  6642. "name": "workspace",
  6643. "schema": {
  6644. "type": "string"
  6645. }
  6646. }
  6647. ],
  6648. "summary": "Submit TUI prompt",
  6649. "description": "Submit the prompt",
  6650. "responses": {
  6651. "200": {
  6652. "description": "Prompt submitted successfully",
  6653. "content": {
  6654. "application/json": {
  6655. "schema": {
  6656. "type": "boolean"
  6657. }
  6658. }
  6659. }
  6660. }
  6661. },
  6662. "x-codeSamples": [
  6663. {
  6664. "lang": "js",
  6665. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.submitPrompt({\n ...\n})"
  6666. }
  6667. ]
  6668. }
  6669. },
  6670. "/tui/clear-prompt": {
  6671. "post": {
  6672. "operationId": "tui.clearPrompt",
  6673. "parameters": [
  6674. {
  6675. "in": "query",
  6676. "name": "directory",
  6677. "schema": {
  6678. "type": "string"
  6679. }
  6680. },
  6681. {
  6682. "in": "query",
  6683. "name": "workspace",
  6684. "schema": {
  6685. "type": "string"
  6686. }
  6687. }
  6688. ],
  6689. "summary": "Clear TUI prompt",
  6690. "description": "Clear the prompt",
  6691. "responses": {
  6692. "200": {
  6693. "description": "Prompt cleared successfully",
  6694. "content": {
  6695. "application/json": {
  6696. "schema": {
  6697. "type": "boolean"
  6698. }
  6699. }
  6700. }
  6701. }
  6702. },
  6703. "x-codeSamples": [
  6704. {
  6705. "lang": "js",
  6706. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.clearPrompt({\n ...\n})"
  6707. }
  6708. ]
  6709. }
  6710. },
  6711. "/tui/execute-command": {
  6712. "post": {
  6713. "operationId": "tui.executeCommand",
  6714. "parameters": [
  6715. {
  6716. "in": "query",
  6717. "name": "directory",
  6718. "schema": {
  6719. "type": "string"
  6720. }
  6721. },
  6722. {
  6723. "in": "query",
  6724. "name": "workspace",
  6725. "schema": {
  6726. "type": "string"
  6727. }
  6728. }
  6729. ],
  6730. "summary": "Execute TUI command",
  6731. "description": "Execute a TUI command (e.g. agent_cycle)",
  6732. "responses": {
  6733. "200": {
  6734. "description": "Command executed successfully",
  6735. "content": {
  6736. "application/json": {
  6737. "schema": {
  6738. "type": "boolean"
  6739. }
  6740. }
  6741. }
  6742. },
  6743. "400": {
  6744. "description": "Bad request",
  6745. "content": {
  6746. "application/json": {
  6747. "schema": {
  6748. "$ref": "#/components/schemas/BadRequestError"
  6749. }
  6750. }
  6751. }
  6752. }
  6753. },
  6754. "requestBody": {
  6755. "content": {
  6756. "application/json": {
  6757. "schema": {
  6758. "type": "object",
  6759. "properties": {
  6760. "command": {
  6761. "type": "string"
  6762. }
  6763. },
  6764. "required": ["command"]
  6765. }
  6766. }
  6767. }
  6768. },
  6769. "x-codeSamples": [
  6770. {
  6771. "lang": "js",
  6772. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.executeCommand({\n ...\n})"
  6773. }
  6774. ]
  6775. }
  6776. },
  6777. "/tui/show-toast": {
  6778. "post": {
  6779. "operationId": "tui.showToast",
  6780. "parameters": [
  6781. {
  6782. "in": "query",
  6783. "name": "directory",
  6784. "schema": {
  6785. "type": "string"
  6786. }
  6787. },
  6788. {
  6789. "in": "query",
  6790. "name": "workspace",
  6791. "schema": {
  6792. "type": "string"
  6793. }
  6794. }
  6795. ],
  6796. "summary": "Show TUI toast",
  6797. "description": "Show a toast notification in the TUI",
  6798. "responses": {
  6799. "200": {
  6800. "description": "Toast notification shown successfully",
  6801. "content": {
  6802. "application/json": {
  6803. "schema": {
  6804. "type": "boolean"
  6805. }
  6806. }
  6807. }
  6808. }
  6809. },
  6810. "requestBody": {
  6811. "content": {
  6812. "application/json": {
  6813. "schema": {
  6814. "type": "object",
  6815. "properties": {
  6816. "title": {
  6817. "type": "string"
  6818. },
  6819. "message": {
  6820. "type": "string"
  6821. },
  6822. "variant": {
  6823. "type": "string",
  6824. "enum": ["info", "success", "warning", "error"]
  6825. },
  6826. "duration": {
  6827. "description": "Duration in milliseconds",
  6828. "default": 5000,
  6829. "type": "number"
  6830. }
  6831. },
  6832. "required": ["message", "variant"]
  6833. }
  6834. }
  6835. }
  6836. },
  6837. "x-codeSamples": [
  6838. {
  6839. "lang": "js",
  6840. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.showToast({\n ...\n})"
  6841. }
  6842. ]
  6843. }
  6844. },
  6845. "/tui/publish": {
  6846. "post": {
  6847. "operationId": "tui.publish",
  6848. "parameters": [
  6849. {
  6850. "in": "query",
  6851. "name": "directory",
  6852. "schema": {
  6853. "type": "string"
  6854. }
  6855. },
  6856. {
  6857. "in": "query",
  6858. "name": "workspace",
  6859. "schema": {
  6860. "type": "string"
  6861. }
  6862. }
  6863. ],
  6864. "summary": "Publish TUI event",
  6865. "description": "Publish a TUI event",
  6866. "responses": {
  6867. "200": {
  6868. "description": "Event published successfully",
  6869. "content": {
  6870. "application/json": {
  6871. "schema": {
  6872. "type": "boolean"
  6873. }
  6874. }
  6875. }
  6876. },
  6877. "400": {
  6878. "description": "Bad request",
  6879. "content": {
  6880. "application/json": {
  6881. "schema": {
  6882. "$ref": "#/components/schemas/BadRequestError"
  6883. }
  6884. }
  6885. }
  6886. }
  6887. },
  6888. "requestBody": {
  6889. "content": {
  6890. "application/json": {
  6891. "schema": {
  6892. "anyOf": [
  6893. {
  6894. "$ref": "#/components/schemas/Event.tui.prompt.append"
  6895. },
  6896. {
  6897. "$ref": "#/components/schemas/Event.tui.command.execute"
  6898. },
  6899. {
  6900. "$ref": "#/components/schemas/Event.tui.toast.show"
  6901. },
  6902. {
  6903. "$ref": "#/components/schemas/Event.tui.session.select"
  6904. }
  6905. ]
  6906. }
  6907. }
  6908. }
  6909. },
  6910. "x-codeSamples": [
  6911. {
  6912. "lang": "js",
  6913. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.publish({\n ...\n})"
  6914. }
  6915. ]
  6916. }
  6917. },
  6918. "/tui/select-session": {
  6919. "post": {
  6920. "operationId": "tui.selectSession",
  6921. "parameters": [
  6922. {
  6923. "in": "query",
  6924. "name": "directory",
  6925. "schema": {
  6926. "type": "string"
  6927. }
  6928. },
  6929. {
  6930. "in": "query",
  6931. "name": "workspace",
  6932. "schema": {
  6933. "type": "string"
  6934. }
  6935. }
  6936. ],
  6937. "summary": "Select session",
  6938. "description": "Navigate the TUI to display the specified session.",
  6939. "responses": {
  6940. "200": {
  6941. "description": "Session selected successfully",
  6942. "content": {
  6943. "application/json": {
  6944. "schema": {
  6945. "type": "boolean"
  6946. }
  6947. }
  6948. }
  6949. },
  6950. "400": {
  6951. "description": "Bad request",
  6952. "content": {
  6953. "application/json": {
  6954. "schema": {
  6955. "$ref": "#/components/schemas/BadRequestError"
  6956. }
  6957. }
  6958. }
  6959. },
  6960. "404": {
  6961. "description": "Not found",
  6962. "content": {
  6963. "application/json": {
  6964. "schema": {
  6965. "$ref": "#/components/schemas/NotFoundError"
  6966. }
  6967. }
  6968. }
  6969. }
  6970. },
  6971. "requestBody": {
  6972. "content": {
  6973. "application/json": {
  6974. "schema": {
  6975. "type": "object",
  6976. "properties": {
  6977. "sessionID": {
  6978. "description": "Session ID to navigate to",
  6979. "type": "string",
  6980. "pattern": "^ses.*"
  6981. }
  6982. },
  6983. "required": ["sessionID"]
  6984. }
  6985. }
  6986. }
  6987. },
  6988. "x-codeSamples": [
  6989. {
  6990. "lang": "js",
  6991. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.selectSession({\n ...\n})"
  6992. }
  6993. ]
  6994. }
  6995. },
  6996. "/tui/control/next": {
  6997. "get": {
  6998. "operationId": "tui.control.next",
  6999. "parameters": [
  7000. {
  7001. "in": "query",
  7002. "name": "directory",
  7003. "schema": {
  7004. "type": "string"
  7005. }
  7006. },
  7007. {
  7008. "in": "query",
  7009. "name": "workspace",
  7010. "schema": {
  7011. "type": "string"
  7012. }
  7013. }
  7014. ],
  7015. "summary": "Get next TUI request",
  7016. "description": "Retrieve the next TUI (Terminal User Interface) request from the queue for processing.",
  7017. "responses": {
  7018. "200": {
  7019. "description": "Next TUI request",
  7020. "content": {
  7021. "application/json": {
  7022. "schema": {
  7023. "type": "object",
  7024. "properties": {
  7025. "path": {
  7026. "type": "string"
  7027. },
  7028. "body": {}
  7029. },
  7030. "required": ["path", "body"]
  7031. }
  7032. }
  7033. }
  7034. }
  7035. },
  7036. "x-codeSamples": [
  7037. {
  7038. "lang": "js",
  7039. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.control.next({\n ...\n})"
  7040. }
  7041. ]
  7042. }
  7043. },
  7044. "/tui/control/response": {
  7045. "post": {
  7046. "operationId": "tui.control.response",
  7047. "parameters": [
  7048. {
  7049. "in": "query",
  7050. "name": "directory",
  7051. "schema": {
  7052. "type": "string"
  7053. }
  7054. },
  7055. {
  7056. "in": "query",
  7057. "name": "workspace",
  7058. "schema": {
  7059. "type": "string"
  7060. }
  7061. }
  7062. ],
  7063. "summary": "Submit TUI response",
  7064. "description": "Submit a response to the TUI request queue to complete a pending request.",
  7065. "responses": {
  7066. "200": {
  7067. "description": "Response submitted successfully",
  7068. "content": {
  7069. "application/json": {
  7070. "schema": {
  7071. "type": "boolean"
  7072. }
  7073. }
  7074. }
  7075. }
  7076. },
  7077. "requestBody": {
  7078. "content": {
  7079. "application/json": {
  7080. "schema": {}
  7081. }
  7082. }
  7083. },
  7084. "x-codeSamples": [
  7085. {
  7086. "lang": "js",
  7087. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.control.response({\n ...\n})"
  7088. }
  7089. ]
  7090. }
  7091. },
  7092. "/instance/dispose": {
  7093. "post": {
  7094. "operationId": "instance.dispose",
  7095. "parameters": [
  7096. {
  7097. "in": "query",
  7098. "name": "directory",
  7099. "schema": {
  7100. "type": "string"
  7101. }
  7102. },
  7103. {
  7104. "in": "query",
  7105. "name": "workspace",
  7106. "schema": {
  7107. "type": "string"
  7108. }
  7109. }
  7110. ],
  7111. "summary": "Dispose instance",
  7112. "description": "Clean up and dispose the current OpenCode instance, releasing all resources.",
  7113. "responses": {
  7114. "200": {
  7115. "description": "Instance disposed",
  7116. "content": {
  7117. "application/json": {
  7118. "schema": {
  7119. "type": "boolean"
  7120. }
  7121. }
  7122. }
  7123. }
  7124. },
  7125. "x-codeSamples": [
  7126. {
  7127. "lang": "js",
  7128. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.instance.dispose({\n ...\n})"
  7129. }
  7130. ]
  7131. }
  7132. },
  7133. "/path": {
  7134. "get": {
  7135. "operationId": "path.get",
  7136. "parameters": [
  7137. {
  7138. "in": "query",
  7139. "name": "directory",
  7140. "schema": {
  7141. "type": "string"
  7142. }
  7143. },
  7144. {
  7145. "in": "query",
  7146. "name": "workspace",
  7147. "schema": {
  7148. "type": "string"
  7149. }
  7150. }
  7151. ],
  7152. "summary": "Get paths",
  7153. "description": "Retrieve the current working directory and related path information for the OpenCode instance.",
  7154. "responses": {
  7155. "200": {
  7156. "description": "Path",
  7157. "content": {
  7158. "application/json": {
  7159. "schema": {
  7160. "$ref": "#/components/schemas/Path"
  7161. }
  7162. }
  7163. }
  7164. }
  7165. },
  7166. "x-codeSamples": [
  7167. {
  7168. "lang": "js",
  7169. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.path.get({\n ...\n})"
  7170. }
  7171. ]
  7172. }
  7173. },
  7174. "/vcs": {
  7175. "get": {
  7176. "operationId": "vcs.get",
  7177. "parameters": [
  7178. {
  7179. "in": "query",
  7180. "name": "directory",
  7181. "schema": {
  7182. "type": "string"
  7183. }
  7184. },
  7185. {
  7186. "in": "query",
  7187. "name": "workspace",
  7188. "schema": {
  7189. "type": "string"
  7190. }
  7191. }
  7192. ],
  7193. "summary": "Get VCS info",
  7194. "description": "Retrieve version control system (VCS) information for the current project, such as git branch.",
  7195. "responses": {
  7196. "200": {
  7197. "description": "VCS info",
  7198. "content": {
  7199. "application/json": {
  7200. "schema": {
  7201. "$ref": "#/components/schemas/VcsInfo"
  7202. }
  7203. }
  7204. }
  7205. }
  7206. },
  7207. "x-codeSamples": [
  7208. {
  7209. "lang": "js",
  7210. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.vcs.get({\n ...\n})"
  7211. }
  7212. ]
  7213. }
  7214. },
  7215. "/vcs/diff": {
  7216. "get": {
  7217. "operationId": "vcs.diff",
  7218. "parameters": [
  7219. {
  7220. "in": "query",
  7221. "name": "directory",
  7222. "schema": {
  7223. "type": "string"
  7224. }
  7225. },
  7226. {
  7227. "in": "query",
  7228. "name": "workspace",
  7229. "schema": {
  7230. "type": "string"
  7231. }
  7232. },
  7233. {
  7234. "in": "query",
  7235. "name": "mode",
  7236. "schema": {
  7237. "type": "string",
  7238. "enum": ["git", "branch"]
  7239. },
  7240. "required": true
  7241. }
  7242. ],
  7243. "summary": "Get VCS diff",
  7244. "description": "Retrieve the current git diff for the working tree or against the default branch.",
  7245. "responses": {
  7246. "200": {
  7247. "description": "VCS diff",
  7248. "content": {
  7249. "application/json": {
  7250. "schema": {
  7251. "type": "array",
  7252. "items": {
  7253. "$ref": "#/components/schemas/VcsFileDiff"
  7254. }
  7255. }
  7256. }
  7257. }
  7258. }
  7259. },
  7260. "x-codeSamples": [
  7261. {
  7262. "lang": "js",
  7263. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.vcs.diff({\n ...\n})"
  7264. }
  7265. ]
  7266. }
  7267. },
  7268. "/command": {
  7269. "get": {
  7270. "operationId": "command.list",
  7271. "parameters": [
  7272. {
  7273. "in": "query",
  7274. "name": "directory",
  7275. "schema": {
  7276. "type": "string"
  7277. }
  7278. },
  7279. {
  7280. "in": "query",
  7281. "name": "workspace",
  7282. "schema": {
  7283. "type": "string"
  7284. }
  7285. }
  7286. ],
  7287. "summary": "List commands",
  7288. "description": "Get a list of all available commands in the OpenCode system.",
  7289. "responses": {
  7290. "200": {
  7291. "description": "List of commands",
  7292. "content": {
  7293. "application/json": {
  7294. "schema": {
  7295. "type": "array",
  7296. "items": {
  7297. "$ref": "#/components/schemas/Command"
  7298. }
  7299. }
  7300. }
  7301. }
  7302. }
  7303. },
  7304. "x-codeSamples": [
  7305. {
  7306. "lang": "js",
  7307. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.command.list({\n ...\n})"
  7308. }
  7309. ]
  7310. }
  7311. },
  7312. "/agent": {
  7313. "get": {
  7314. "operationId": "app.agents",
  7315. "parameters": [
  7316. {
  7317. "in": "query",
  7318. "name": "directory",
  7319. "schema": {
  7320. "type": "string"
  7321. }
  7322. },
  7323. {
  7324. "in": "query",
  7325. "name": "workspace",
  7326. "schema": {
  7327. "type": "string"
  7328. }
  7329. }
  7330. ],
  7331. "summary": "List agents",
  7332. "description": "Get a list of all available AI agents in the OpenCode system.",
  7333. "responses": {
  7334. "200": {
  7335. "description": "List of agents",
  7336. "content": {
  7337. "application/json": {
  7338. "schema": {
  7339. "type": "array",
  7340. "items": {
  7341. "$ref": "#/components/schemas/Agent"
  7342. }
  7343. }
  7344. }
  7345. }
  7346. }
  7347. },
  7348. "x-codeSamples": [
  7349. {
  7350. "lang": "js",
  7351. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.app.agents({\n ...\n})"
  7352. }
  7353. ]
  7354. }
  7355. },
  7356. "/skill": {
  7357. "get": {
  7358. "operationId": "app.skills",
  7359. "parameters": [
  7360. {
  7361. "in": "query",
  7362. "name": "directory",
  7363. "schema": {
  7364. "type": "string"
  7365. }
  7366. },
  7367. {
  7368. "in": "query",
  7369. "name": "workspace",
  7370. "schema": {
  7371. "type": "string"
  7372. }
  7373. }
  7374. ],
  7375. "summary": "List skills",
  7376. "description": "Get a list of all available skills in the OpenCode system.",
  7377. "responses": {
  7378. "200": {
  7379. "description": "List of skills",
  7380. "content": {
  7381. "application/json": {
  7382. "schema": {
  7383. "type": "array",
  7384. "items": {
  7385. "type": "object",
  7386. "properties": {
  7387. "name": {
  7388. "type": "string"
  7389. },
  7390. "description": {
  7391. "type": "string"
  7392. },
  7393. "location": {
  7394. "type": "string"
  7395. },
  7396. "content": {
  7397. "type": "string"
  7398. }
  7399. },
  7400. "required": ["name", "description", "location", "content"]
  7401. }
  7402. }
  7403. }
  7404. }
  7405. }
  7406. },
  7407. "x-codeSamples": [
  7408. {
  7409. "lang": "js",
  7410. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.app.skills({\n ...\n})"
  7411. }
  7412. ]
  7413. }
  7414. },
  7415. "/lsp": {
  7416. "get": {
  7417. "operationId": "lsp.status",
  7418. "parameters": [
  7419. {
  7420. "in": "query",
  7421. "name": "directory",
  7422. "schema": {
  7423. "type": "string"
  7424. }
  7425. },
  7426. {
  7427. "in": "query",
  7428. "name": "workspace",
  7429. "schema": {
  7430. "type": "string"
  7431. }
  7432. }
  7433. ],
  7434. "summary": "Get LSP status",
  7435. "description": "Get LSP server status",
  7436. "responses": {
  7437. "200": {
  7438. "description": "LSP server status",
  7439. "content": {
  7440. "application/json": {
  7441. "schema": {
  7442. "type": "array",
  7443. "items": {
  7444. "$ref": "#/components/schemas/LSPStatus"
  7445. }
  7446. }
  7447. }
  7448. }
  7449. }
  7450. },
  7451. "x-codeSamples": [
  7452. {
  7453. "lang": "js",
  7454. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.lsp.status({\n ...\n})"
  7455. }
  7456. ]
  7457. }
  7458. },
  7459. "/formatter": {
  7460. "get": {
  7461. "operationId": "formatter.status",
  7462. "parameters": [
  7463. {
  7464. "in": "query",
  7465. "name": "directory",
  7466. "schema": {
  7467. "type": "string"
  7468. }
  7469. },
  7470. {
  7471. "in": "query",
  7472. "name": "workspace",
  7473. "schema": {
  7474. "type": "string"
  7475. }
  7476. }
  7477. ],
  7478. "summary": "Get formatter status",
  7479. "description": "Get formatter status",
  7480. "responses": {
  7481. "200": {
  7482. "description": "Formatter status",
  7483. "content": {
  7484. "application/json": {
  7485. "schema": {
  7486. "type": "array",
  7487. "items": {
  7488. "$ref": "#/components/schemas/FormatterStatus"
  7489. }
  7490. }
  7491. }
  7492. }
  7493. }
  7494. },
  7495. "x-codeSamples": [
  7496. {
  7497. "lang": "js",
  7498. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.formatter.status({\n ...\n})"
  7499. }
  7500. ]
  7501. }
  7502. }
  7503. },
  7504. "components": {
  7505. "schemas": {
  7506. "Project": {
  7507. "type": "object",
  7508. "properties": {
  7509. "id": {
  7510. "type": "string"
  7511. },
  7512. "worktree": {
  7513. "type": "string"
  7514. },
  7515. "vcs": {
  7516. "type": "string",
  7517. "const": "git"
  7518. },
  7519. "name": {
  7520. "type": "string"
  7521. },
  7522. "icon": {
  7523. "type": "object",
  7524. "properties": {
  7525. "url": {
  7526. "type": "string"
  7527. },
  7528. "override": {
  7529. "type": "string"
  7530. },
  7531. "color": {
  7532. "type": "string"
  7533. }
  7534. }
  7535. },
  7536. "commands": {
  7537. "type": "object",
  7538. "properties": {
  7539. "start": {
  7540. "description": "Startup script to run when creating a new workspace (worktree)",
  7541. "type": "string"
  7542. }
  7543. }
  7544. },
  7545. "time": {
  7546. "type": "object",
  7547. "properties": {
  7548. "created": {
  7549. "type": "number"
  7550. },
  7551. "updated": {
  7552. "type": "number"
  7553. },
  7554. "initialized": {
  7555. "type": "number"
  7556. }
  7557. },
  7558. "required": ["created", "updated"]
  7559. },
  7560. "sandboxes": {
  7561. "type": "array",
  7562. "items": {
  7563. "type": "string"
  7564. }
  7565. }
  7566. },
  7567. "required": ["id", "worktree", "time", "sandboxes"]
  7568. },
  7569. "Event.project.updated": {
  7570. "type": "object",
  7571. "properties": {
  7572. "type": {
  7573. "type": "string",
  7574. "const": "project.updated"
  7575. },
  7576. "properties": {
  7577. "$ref": "#/components/schemas/Project"
  7578. }
  7579. },
  7580. "required": ["type", "properties"]
  7581. },
  7582. "Event.server.instance.disposed": {
  7583. "type": "object",
  7584. "properties": {
  7585. "type": {
  7586. "type": "string",
  7587. "const": "server.instance.disposed"
  7588. },
  7589. "properties": {
  7590. "type": "object",
  7591. "properties": {
  7592. "directory": {
  7593. "type": "string"
  7594. }
  7595. },
  7596. "required": ["directory"]
  7597. }
  7598. },
  7599. "required": ["type", "properties"]
  7600. },
  7601. "Event.server.connected": {
  7602. "type": "object",
  7603. "properties": {
  7604. "type": {
  7605. "type": "string",
  7606. "const": "server.connected"
  7607. },
  7608. "properties": {
  7609. "type": "object",
  7610. "properties": {}
  7611. }
  7612. },
  7613. "required": ["type", "properties"]
  7614. },
  7615. "Event.global.disposed": {
  7616. "type": "object",
  7617. "properties": {
  7618. "type": {
  7619. "type": "string",
  7620. "const": "global.disposed"
  7621. },
  7622. "properties": {
  7623. "type": "object",
  7624. "properties": {}
  7625. }
  7626. },
  7627. "required": ["type", "properties"]
  7628. },
  7629. "Event.file.edited": {
  7630. "type": "object",
  7631. "properties": {
  7632. "type": {
  7633. "type": "string",
  7634. "const": "file.edited"
  7635. },
  7636. "properties": {
  7637. "type": "object",
  7638. "properties": {
  7639. "file": {
  7640. "type": "string"
  7641. }
  7642. },
  7643. "required": ["file"]
  7644. }
  7645. },
  7646. "required": ["type", "properties"]
  7647. },
  7648. "Event.file.watcher.updated": {
  7649. "type": "object",
  7650. "properties": {
  7651. "type": {
  7652. "type": "string",
  7653. "const": "file.watcher.updated"
  7654. },
  7655. "properties": {
  7656. "type": "object",
  7657. "properties": {
  7658. "file": {
  7659. "type": "string"
  7660. },
  7661. "event": {
  7662. "anyOf": [
  7663. {
  7664. "type": "string",
  7665. "const": "add"
  7666. },
  7667. {
  7668. "type": "string",
  7669. "const": "change"
  7670. },
  7671. {
  7672. "type": "string",
  7673. "const": "unlink"
  7674. }
  7675. ]
  7676. }
  7677. },
  7678. "required": ["file", "event"]
  7679. }
  7680. },
  7681. "required": ["type", "properties"]
  7682. },
  7683. "Event.lsp.client.diagnostics": {
  7684. "type": "object",
  7685. "properties": {
  7686. "type": {
  7687. "type": "string",
  7688. "const": "lsp.client.diagnostics"
  7689. },
  7690. "properties": {
  7691. "type": "object",
  7692. "properties": {
  7693. "serverID": {
  7694. "type": "string"
  7695. },
  7696. "path": {
  7697. "type": "string"
  7698. }
  7699. },
  7700. "required": ["serverID", "path"]
  7701. }
  7702. },
  7703. "required": ["type", "properties"]
  7704. },
  7705. "Event.lsp.updated": {
  7706. "type": "object",
  7707. "properties": {
  7708. "type": {
  7709. "type": "string",
  7710. "const": "lsp.updated"
  7711. },
  7712. "properties": {
  7713. "type": "object",
  7714. "properties": {}
  7715. }
  7716. },
  7717. "required": ["type", "properties"]
  7718. },
  7719. "Event.installation.updated": {
  7720. "type": "object",
  7721. "properties": {
  7722. "type": {
  7723. "type": "string",
  7724. "const": "installation.updated"
  7725. },
  7726. "properties": {
  7727. "type": "object",
  7728. "properties": {
  7729. "version": {
  7730. "type": "string"
  7731. }
  7732. },
  7733. "required": ["version"]
  7734. }
  7735. },
  7736. "required": ["type", "properties"]
  7737. },
  7738. "Event.installation.update-available": {
  7739. "type": "object",
  7740. "properties": {
  7741. "type": {
  7742. "type": "string",
  7743. "const": "installation.update-available"
  7744. },
  7745. "properties": {
  7746. "type": "object",
  7747. "properties": {
  7748. "version": {
  7749. "type": "string"
  7750. }
  7751. },
  7752. "required": ["version"]
  7753. }
  7754. },
  7755. "required": ["type", "properties"]
  7756. },
  7757. "Event.message.part.delta": {
  7758. "type": "object",
  7759. "properties": {
  7760. "type": {
  7761. "type": "string",
  7762. "const": "message.part.delta"
  7763. },
  7764. "properties": {
  7765. "type": "object",
  7766. "properties": {
  7767. "sessionID": {
  7768. "type": "string",
  7769. "pattern": "^ses.*"
  7770. },
  7771. "messageID": {
  7772. "type": "string",
  7773. "pattern": "^msg.*"
  7774. },
  7775. "partID": {
  7776. "type": "string",
  7777. "pattern": "^prt.*"
  7778. },
  7779. "field": {
  7780. "type": "string"
  7781. },
  7782. "delta": {
  7783. "type": "string"
  7784. }
  7785. },
  7786. "required": ["sessionID", "messageID", "partID", "field", "delta"]
  7787. }
  7788. },
  7789. "required": ["type", "properties"]
  7790. },
  7791. "PermissionRequest": {
  7792. "type": "object",
  7793. "properties": {
  7794. "id": {
  7795. "type": "string",
  7796. "pattern": "^per.*"
  7797. },
  7798. "sessionID": {
  7799. "type": "string",
  7800. "pattern": "^ses.*"
  7801. },
  7802. "permission": {
  7803. "type": "string"
  7804. },
  7805. "patterns": {
  7806. "type": "array",
  7807. "items": {
  7808. "type": "string"
  7809. }
  7810. },
  7811. "metadata": {
  7812. "type": "object",
  7813. "propertyNames": {
  7814. "type": "string"
  7815. },
  7816. "additionalProperties": {}
  7817. },
  7818. "always": {
  7819. "type": "array",
  7820. "items": {
  7821. "type": "string"
  7822. }
  7823. },
  7824. "tool": {
  7825. "type": "object",
  7826. "properties": {
  7827. "messageID": {
  7828. "type": "string",
  7829. "pattern": "^msg.*"
  7830. },
  7831. "callID": {
  7832. "type": "string"
  7833. }
  7834. },
  7835. "required": ["messageID", "callID"]
  7836. }
  7837. },
  7838. "required": ["id", "sessionID", "permission", "patterns", "metadata", "always"]
  7839. },
  7840. "Event.permission.asked": {
  7841. "type": "object",
  7842. "properties": {
  7843. "type": {
  7844. "type": "string",
  7845. "const": "permission.asked"
  7846. },
  7847. "properties": {
  7848. "$ref": "#/components/schemas/PermissionRequest"
  7849. }
  7850. },
  7851. "required": ["type", "properties"]
  7852. },
  7853. "Event.permission.replied": {
  7854. "type": "object",
  7855. "properties": {
  7856. "type": {
  7857. "type": "string",
  7858. "const": "permission.replied"
  7859. },
  7860. "properties": {
  7861. "type": "object",
  7862. "properties": {
  7863. "sessionID": {
  7864. "type": "string",
  7865. "pattern": "^ses.*"
  7866. },
  7867. "requestID": {
  7868. "type": "string",
  7869. "pattern": "^per.*"
  7870. },
  7871. "reply": {
  7872. "type": "string",
  7873. "enum": ["once", "always", "reject"]
  7874. }
  7875. },
  7876. "required": ["sessionID", "requestID", "reply"]
  7877. }
  7878. },
  7879. "required": ["type", "properties"]
  7880. },
  7881. "SnapshotFileDiff": {
  7882. "type": "object",
  7883. "properties": {
  7884. "file": {
  7885. "type": "string"
  7886. },
  7887. "patch": {
  7888. "type": "string"
  7889. },
  7890. "additions": {
  7891. "type": "number"
  7892. },
  7893. "deletions": {
  7894. "type": "number"
  7895. },
  7896. "status": {
  7897. "type": "string",
  7898. "enum": ["added", "deleted", "modified"]
  7899. }
  7900. },
  7901. "required": ["file", "patch", "additions", "deletions"]
  7902. },
  7903. "Event.session.diff": {
  7904. "type": "object",
  7905. "properties": {
  7906. "type": {
  7907. "type": "string",
  7908. "const": "session.diff"
  7909. },
  7910. "properties": {
  7911. "type": "object",
  7912. "properties": {
  7913. "sessionID": {
  7914. "type": "string",
  7915. "pattern": "^ses.*"
  7916. },
  7917. "diff": {
  7918. "type": "array",
  7919. "items": {
  7920. "$ref": "#/components/schemas/SnapshotFileDiff"
  7921. }
  7922. }
  7923. },
  7924. "required": ["sessionID", "diff"]
  7925. }
  7926. },
  7927. "required": ["type", "properties"]
  7928. },
  7929. "ProviderAuthError": {
  7930. "type": "object",
  7931. "properties": {
  7932. "name": {
  7933. "type": "string",
  7934. "const": "ProviderAuthError"
  7935. },
  7936. "data": {
  7937. "type": "object",
  7938. "properties": {
  7939. "providerID": {
  7940. "type": "string"
  7941. },
  7942. "message": {
  7943. "type": "string"
  7944. }
  7945. },
  7946. "required": ["providerID", "message"]
  7947. }
  7948. },
  7949. "required": ["name", "data"]
  7950. },
  7951. "UnknownError": {
  7952. "type": "object",
  7953. "properties": {
  7954. "name": {
  7955. "type": "string",
  7956. "const": "UnknownError"
  7957. },
  7958. "data": {
  7959. "type": "object",
  7960. "properties": {
  7961. "message": {
  7962. "type": "string"
  7963. }
  7964. },
  7965. "required": ["message"]
  7966. }
  7967. },
  7968. "required": ["name", "data"]
  7969. },
  7970. "MessageOutputLengthError": {
  7971. "type": "object",
  7972. "properties": {
  7973. "name": {
  7974. "type": "string",
  7975. "const": "MessageOutputLengthError"
  7976. },
  7977. "data": {
  7978. "type": "object",
  7979. "properties": {}
  7980. }
  7981. },
  7982. "required": ["name", "data"]
  7983. },
  7984. "MessageAbortedError": {
  7985. "type": "object",
  7986. "properties": {
  7987. "name": {
  7988. "type": "string",
  7989. "const": "MessageAbortedError"
  7990. },
  7991. "data": {
  7992. "type": "object",
  7993. "properties": {
  7994. "message": {
  7995. "type": "string"
  7996. }
  7997. },
  7998. "required": ["message"]
  7999. }
  8000. },
  8001. "required": ["name", "data"]
  8002. },
  8003. "StructuredOutputError": {
  8004. "type": "object",
  8005. "properties": {
  8006. "name": {
  8007. "type": "string",
  8008. "const": "StructuredOutputError"
  8009. },
  8010. "data": {
  8011. "type": "object",
  8012. "properties": {
  8013. "message": {
  8014. "type": "string"
  8015. },
  8016. "retries": {
  8017. "type": "number"
  8018. }
  8019. },
  8020. "required": ["message", "retries"]
  8021. }
  8022. },
  8023. "required": ["name", "data"]
  8024. },
  8025. "ContextOverflowError": {
  8026. "type": "object",
  8027. "properties": {
  8028. "name": {
  8029. "type": "string",
  8030. "const": "ContextOverflowError"
  8031. },
  8032. "data": {
  8033. "type": "object",
  8034. "properties": {
  8035. "message": {
  8036. "type": "string"
  8037. },
  8038. "responseBody": {
  8039. "type": "string"
  8040. }
  8041. },
  8042. "required": ["message"]
  8043. }
  8044. },
  8045. "required": ["name", "data"]
  8046. },
  8047. "APIError": {
  8048. "type": "object",
  8049. "properties": {
  8050. "name": {
  8051. "type": "string",
  8052. "const": "APIError"
  8053. },
  8054. "data": {
  8055. "type": "object",
  8056. "properties": {
  8057. "message": {
  8058. "type": "string"
  8059. },
  8060. "statusCode": {
  8061. "type": "number"
  8062. },
  8063. "isRetryable": {
  8064. "type": "boolean"
  8065. },
  8066. "responseHeaders": {
  8067. "type": "object",
  8068. "propertyNames": {
  8069. "type": "string"
  8070. },
  8071. "additionalProperties": {
  8072. "type": "string"
  8073. }
  8074. },
  8075. "responseBody": {
  8076. "type": "string"
  8077. },
  8078. "metadata": {
  8079. "type": "object",
  8080. "propertyNames": {
  8081. "type": "string"
  8082. },
  8083. "additionalProperties": {
  8084. "type": "string"
  8085. }
  8086. }
  8087. },
  8088. "required": ["message", "isRetryable"]
  8089. }
  8090. },
  8091. "required": ["name", "data"]
  8092. },
  8093. "Event.session.error": {
  8094. "type": "object",
  8095. "properties": {
  8096. "type": {
  8097. "type": "string",
  8098. "const": "session.error"
  8099. },
  8100. "properties": {
  8101. "type": "object",
  8102. "properties": {
  8103. "sessionID": {
  8104. "type": "string",
  8105. "pattern": "^ses.*"
  8106. },
  8107. "error": {
  8108. "anyOf": [
  8109. {
  8110. "$ref": "#/components/schemas/ProviderAuthError"
  8111. },
  8112. {
  8113. "$ref": "#/components/schemas/UnknownError"
  8114. },
  8115. {
  8116. "$ref": "#/components/schemas/MessageOutputLengthError"
  8117. },
  8118. {
  8119. "$ref": "#/components/schemas/MessageAbortedError"
  8120. },
  8121. {
  8122. "$ref": "#/components/schemas/StructuredOutputError"
  8123. },
  8124. {
  8125. "$ref": "#/components/schemas/ContextOverflowError"
  8126. },
  8127. {
  8128. "$ref": "#/components/schemas/APIError"
  8129. }
  8130. ]
  8131. }
  8132. }
  8133. }
  8134. },
  8135. "required": ["type", "properties"]
  8136. },
  8137. "QuestionOption": {
  8138. "type": "object",
  8139. "properties": {
  8140. "label": {
  8141. "description": "Display text (1-5 words, concise)",
  8142. "type": "string"
  8143. },
  8144. "description": {
  8145. "description": "Explanation of choice",
  8146. "type": "string"
  8147. }
  8148. },
  8149. "required": ["label", "description"]
  8150. },
  8151. "QuestionInfo": {
  8152. "type": "object",
  8153. "properties": {
  8154. "question": {
  8155. "description": "Complete question",
  8156. "type": "string"
  8157. },
  8158. "header": {
  8159. "description": "Very short label (max 30 chars)",
  8160. "type": "string"
  8161. },
  8162. "options": {
  8163. "description": "Available choices",
  8164. "type": "array",
  8165. "items": {
  8166. "$ref": "#/components/schemas/QuestionOption"
  8167. }
  8168. },
  8169. "multiple": {
  8170. "description": "Allow selecting multiple choices",
  8171. "type": "boolean"
  8172. },
  8173. "custom": {
  8174. "description": "Allow typing a custom answer (default: true)",
  8175. "type": "boolean"
  8176. }
  8177. },
  8178. "required": ["question", "header", "options"]
  8179. },
  8180. "QuestionTool": {
  8181. "type": "object",
  8182. "properties": {
  8183. "messageID": {
  8184. "type": "string",
  8185. "pattern": "^msg.*"
  8186. },
  8187. "callID": {
  8188. "type": "string"
  8189. }
  8190. },
  8191. "required": ["messageID", "callID"]
  8192. },
  8193. "QuestionRequest": {
  8194. "type": "object",
  8195. "properties": {
  8196. "id": {
  8197. "type": "string",
  8198. "pattern": "^que.*"
  8199. },
  8200. "sessionID": {
  8201. "type": "string",
  8202. "pattern": "^ses.*"
  8203. },
  8204. "questions": {
  8205. "description": "Questions to ask",
  8206. "type": "array",
  8207. "items": {
  8208. "$ref": "#/components/schemas/QuestionInfo"
  8209. }
  8210. },
  8211. "tool": {
  8212. "$ref": "#/components/schemas/QuestionTool"
  8213. }
  8214. },
  8215. "required": ["id", "sessionID", "questions"]
  8216. },
  8217. "Event.question.asked": {
  8218. "type": "object",
  8219. "properties": {
  8220. "type": {
  8221. "type": "string",
  8222. "const": "question.asked"
  8223. },
  8224. "properties": {
  8225. "$ref": "#/components/schemas/QuestionRequest"
  8226. }
  8227. },
  8228. "required": ["type", "properties"]
  8229. },
  8230. "QuestionAnswer": {
  8231. "type": "array",
  8232. "items": {
  8233. "type": "string"
  8234. }
  8235. },
  8236. "QuestionReplied": {
  8237. "type": "object",
  8238. "properties": {
  8239. "sessionID": {
  8240. "type": "string",
  8241. "pattern": "^ses.*"
  8242. },
  8243. "requestID": {
  8244. "type": "string",
  8245. "pattern": "^que.*"
  8246. },
  8247. "answers": {
  8248. "type": "array",
  8249. "items": {
  8250. "$ref": "#/components/schemas/QuestionAnswer"
  8251. }
  8252. }
  8253. },
  8254. "required": ["sessionID", "requestID", "answers"]
  8255. },
  8256. "Event.question.replied": {
  8257. "type": "object",
  8258. "properties": {
  8259. "type": {
  8260. "type": "string",
  8261. "const": "question.replied"
  8262. },
  8263. "properties": {
  8264. "$ref": "#/components/schemas/QuestionReplied"
  8265. }
  8266. },
  8267. "required": ["type", "properties"]
  8268. },
  8269. "QuestionRejected": {
  8270. "type": "object",
  8271. "properties": {
  8272. "sessionID": {
  8273. "type": "string",
  8274. "pattern": "^ses.*"
  8275. },
  8276. "requestID": {
  8277. "type": "string",
  8278. "pattern": "^que.*"
  8279. }
  8280. },
  8281. "required": ["sessionID", "requestID"]
  8282. },
  8283. "Event.question.rejected": {
  8284. "type": "object",
  8285. "properties": {
  8286. "type": {
  8287. "type": "string",
  8288. "const": "question.rejected"
  8289. },
  8290. "properties": {
  8291. "$ref": "#/components/schemas/QuestionRejected"
  8292. }
  8293. },
  8294. "required": ["type", "properties"]
  8295. },
  8296. "Todo": {
  8297. "type": "object",
  8298. "properties": {
  8299. "content": {
  8300. "description": "Brief description of the task",
  8301. "type": "string"
  8302. },
  8303. "status": {
  8304. "description": "Current status of the task: pending, in_progress, completed, cancelled",
  8305. "type": "string"
  8306. },
  8307. "priority": {
  8308. "description": "Priority level of the task: high, medium, low",
  8309. "type": "string"
  8310. }
  8311. },
  8312. "required": ["content", "status", "priority"]
  8313. },
  8314. "Event.todo.updated": {
  8315. "type": "object",
  8316. "properties": {
  8317. "type": {
  8318. "type": "string",
  8319. "const": "todo.updated"
  8320. },
  8321. "properties": {
  8322. "type": "object",
  8323. "properties": {
  8324. "sessionID": {
  8325. "type": "string",
  8326. "pattern": "^ses.*"
  8327. },
  8328. "todos": {
  8329. "type": "array",
  8330. "items": {
  8331. "$ref": "#/components/schemas/Todo"
  8332. }
  8333. }
  8334. },
  8335. "required": ["sessionID", "todos"]
  8336. }
  8337. },
  8338. "required": ["type", "properties"]
  8339. },
  8340. "SessionStatus": {
  8341. "anyOf": [
  8342. {
  8343. "type": "object",
  8344. "properties": {
  8345. "type": {
  8346. "type": "string",
  8347. "const": "idle"
  8348. }
  8349. },
  8350. "required": ["type"]
  8351. },
  8352. {
  8353. "type": "object",
  8354. "properties": {
  8355. "type": {
  8356. "type": "string",
  8357. "const": "retry"
  8358. },
  8359. "attempt": {
  8360. "type": "number"
  8361. },
  8362. "message": {
  8363. "type": "string"
  8364. },
  8365. "next": {
  8366. "type": "number"
  8367. }
  8368. },
  8369. "required": ["type", "attempt", "message", "next"]
  8370. },
  8371. {
  8372. "type": "object",
  8373. "properties": {
  8374. "type": {
  8375. "type": "string",
  8376. "const": "busy"
  8377. }
  8378. },
  8379. "required": ["type"]
  8380. }
  8381. ]
  8382. },
  8383. "Event.session.status": {
  8384. "type": "object",
  8385. "properties": {
  8386. "type": {
  8387. "type": "string",
  8388. "const": "session.status"
  8389. },
  8390. "properties": {
  8391. "type": "object",
  8392. "properties": {
  8393. "sessionID": {
  8394. "type": "string",
  8395. "pattern": "^ses.*"
  8396. },
  8397. "status": {
  8398. "$ref": "#/components/schemas/SessionStatus"
  8399. }
  8400. },
  8401. "required": ["sessionID", "status"]
  8402. }
  8403. },
  8404. "required": ["type", "properties"]
  8405. },
  8406. "Event.session.idle": {
  8407. "type": "object",
  8408. "properties": {
  8409. "type": {
  8410. "type": "string",
  8411. "const": "session.idle"
  8412. },
  8413. "properties": {
  8414. "type": "object",
  8415. "properties": {
  8416. "sessionID": {
  8417. "type": "string",
  8418. "pattern": "^ses.*"
  8419. }
  8420. },
  8421. "required": ["sessionID"]
  8422. }
  8423. },
  8424. "required": ["type", "properties"]
  8425. },
  8426. "Event.session.compacted": {
  8427. "type": "object",
  8428. "properties": {
  8429. "type": {
  8430. "type": "string",
  8431. "const": "session.compacted"
  8432. },
  8433. "properties": {
  8434. "type": "object",
  8435. "properties": {
  8436. "sessionID": {
  8437. "type": "string",
  8438. "pattern": "^ses.*"
  8439. }
  8440. },
  8441. "required": ["sessionID"]
  8442. }
  8443. },
  8444. "required": ["type", "properties"]
  8445. },
  8446. "Event.tui.prompt.append": {
  8447. "type": "object",
  8448. "properties": {
  8449. "type": {
  8450. "type": "string",
  8451. "const": "tui.prompt.append"
  8452. },
  8453. "properties": {
  8454. "type": "object",
  8455. "properties": {
  8456. "text": {
  8457. "type": "string"
  8458. }
  8459. },
  8460. "required": ["text"]
  8461. }
  8462. },
  8463. "required": ["type", "properties"]
  8464. },
  8465. "Event.tui.command.execute": {
  8466. "type": "object",
  8467. "properties": {
  8468. "type": {
  8469. "type": "string",
  8470. "const": "tui.command.execute"
  8471. },
  8472. "properties": {
  8473. "type": "object",
  8474. "properties": {
  8475. "command": {
  8476. "anyOf": [
  8477. {
  8478. "type": "string",
  8479. "enum": [
  8480. "session.list",
  8481. "session.new",
  8482. "session.share",
  8483. "session.interrupt",
  8484. "session.compact",
  8485. "session.page.up",
  8486. "session.page.down",
  8487. "session.line.up",
  8488. "session.line.down",
  8489. "session.half.page.up",
  8490. "session.half.page.down",
  8491. "session.first",
  8492. "session.last",
  8493. "prompt.clear",
  8494. "prompt.submit",
  8495. "agent.cycle"
  8496. ]
  8497. },
  8498. {
  8499. "type": "string"
  8500. }
  8501. ]
  8502. }
  8503. },
  8504. "required": ["command"]
  8505. }
  8506. },
  8507. "required": ["type", "properties"]
  8508. },
  8509. "Event.tui.toast.show": {
  8510. "type": "object",
  8511. "properties": {
  8512. "type": {
  8513. "type": "string",
  8514. "const": "tui.toast.show"
  8515. },
  8516. "properties": {
  8517. "type": "object",
  8518. "properties": {
  8519. "title": {
  8520. "type": "string"
  8521. },
  8522. "message": {
  8523. "type": "string"
  8524. },
  8525. "variant": {
  8526. "type": "string",
  8527. "enum": ["info", "success", "warning", "error"]
  8528. },
  8529. "duration": {
  8530. "description": "Duration in milliseconds",
  8531. "default": 5000,
  8532. "type": "number"
  8533. }
  8534. },
  8535. "required": ["message", "variant"]
  8536. }
  8537. },
  8538. "required": ["type", "properties"]
  8539. },
  8540. "Event.tui.session.select": {
  8541. "type": "object",
  8542. "properties": {
  8543. "type": {
  8544. "type": "string",
  8545. "const": "tui.session.select"
  8546. },
  8547. "properties": {
  8548. "type": "object",
  8549. "properties": {
  8550. "sessionID": {
  8551. "description": "Session ID to navigate to",
  8552. "type": "string",
  8553. "pattern": "^ses.*"
  8554. }
  8555. },
  8556. "required": ["sessionID"]
  8557. }
  8558. },
  8559. "required": ["type", "properties"]
  8560. },
  8561. "Event.mcp.tools.changed": {
  8562. "type": "object",
  8563. "properties": {
  8564. "type": {
  8565. "type": "string",
  8566. "const": "mcp.tools.changed"
  8567. },
  8568. "properties": {
  8569. "type": "object",
  8570. "properties": {
  8571. "server": {
  8572. "type": "string"
  8573. }
  8574. },
  8575. "required": ["server"]
  8576. }
  8577. },
  8578. "required": ["type", "properties"]
  8579. },
  8580. "Event.mcp.browser.open.failed": {
  8581. "type": "object",
  8582. "properties": {
  8583. "type": {
  8584. "type": "string",
  8585. "const": "mcp.browser.open.failed"
  8586. },
  8587. "properties": {
  8588. "type": "object",
  8589. "properties": {
  8590. "mcpName": {
  8591. "type": "string"
  8592. },
  8593. "url": {
  8594. "type": "string"
  8595. }
  8596. },
  8597. "required": ["mcpName", "url"]
  8598. }
  8599. },
  8600. "required": ["type", "properties"]
  8601. },
  8602. "Event.command.executed": {
  8603. "type": "object",
  8604. "properties": {
  8605. "type": {
  8606. "type": "string",
  8607. "const": "command.executed"
  8608. },
  8609. "properties": {
  8610. "type": "object",
  8611. "properties": {
  8612. "name": {
  8613. "type": "string"
  8614. },
  8615. "sessionID": {
  8616. "type": "string",
  8617. "pattern": "^ses.*"
  8618. },
  8619. "arguments": {
  8620. "type": "string"
  8621. },
  8622. "messageID": {
  8623. "type": "string",
  8624. "pattern": "^msg.*"
  8625. }
  8626. },
  8627. "required": ["name", "sessionID", "arguments", "messageID"]
  8628. }
  8629. },
  8630. "required": ["type", "properties"]
  8631. },
  8632. "Event.vcs.branch.updated": {
  8633. "type": "object",
  8634. "properties": {
  8635. "type": {
  8636. "type": "string",
  8637. "const": "vcs.branch.updated"
  8638. },
  8639. "properties": {
  8640. "type": "object",
  8641. "properties": {
  8642. "branch": {
  8643. "type": "string"
  8644. }
  8645. }
  8646. }
  8647. },
  8648. "required": ["type", "properties"]
  8649. },
  8650. "Event.worktree.ready": {
  8651. "type": "object",
  8652. "properties": {
  8653. "type": {
  8654. "type": "string",
  8655. "const": "worktree.ready"
  8656. },
  8657. "properties": {
  8658. "type": "object",
  8659. "properties": {
  8660. "name": {
  8661. "type": "string"
  8662. },
  8663. "branch": {
  8664. "type": "string"
  8665. }
  8666. },
  8667. "required": ["name", "branch"]
  8668. }
  8669. },
  8670. "required": ["type", "properties"]
  8671. },
  8672. "Event.worktree.failed": {
  8673. "type": "object",
  8674. "properties": {
  8675. "type": {
  8676. "type": "string",
  8677. "const": "worktree.failed"
  8678. },
  8679. "properties": {
  8680. "type": "object",
  8681. "properties": {
  8682. "message": {
  8683. "type": "string"
  8684. }
  8685. },
  8686. "required": ["message"]
  8687. }
  8688. },
  8689. "required": ["type", "properties"]
  8690. },
  8691. "Pty": {
  8692. "type": "object",
  8693. "properties": {
  8694. "id": {
  8695. "type": "string",
  8696. "pattern": "^pty.*"
  8697. },
  8698. "title": {
  8699. "type": "string"
  8700. },
  8701. "command": {
  8702. "type": "string"
  8703. },
  8704. "args": {
  8705. "type": "array",
  8706. "items": {
  8707. "type": "string"
  8708. }
  8709. },
  8710. "cwd": {
  8711. "type": "string"
  8712. },
  8713. "status": {
  8714. "type": "string",
  8715. "enum": ["running", "exited"]
  8716. },
  8717. "pid": {
  8718. "type": "number"
  8719. }
  8720. },
  8721. "required": ["id", "title", "command", "args", "cwd", "status", "pid"]
  8722. },
  8723. "Event.pty.created": {
  8724. "type": "object",
  8725. "properties": {
  8726. "type": {
  8727. "type": "string",
  8728. "const": "pty.created"
  8729. },
  8730. "properties": {
  8731. "type": "object",
  8732. "properties": {
  8733. "info": {
  8734. "$ref": "#/components/schemas/Pty"
  8735. }
  8736. },
  8737. "required": ["info"]
  8738. }
  8739. },
  8740. "required": ["type", "properties"]
  8741. },
  8742. "Event.pty.updated": {
  8743. "type": "object",
  8744. "properties": {
  8745. "type": {
  8746. "type": "string",
  8747. "const": "pty.updated"
  8748. },
  8749. "properties": {
  8750. "type": "object",
  8751. "properties": {
  8752. "info": {
  8753. "$ref": "#/components/schemas/Pty"
  8754. }
  8755. },
  8756. "required": ["info"]
  8757. }
  8758. },
  8759. "required": ["type", "properties"]
  8760. },
  8761. "Event.pty.exited": {
  8762. "type": "object",
  8763. "properties": {
  8764. "type": {
  8765. "type": "string",
  8766. "const": "pty.exited"
  8767. },
  8768. "properties": {
  8769. "type": "object",
  8770. "properties": {
  8771. "id": {
  8772. "type": "string",
  8773. "pattern": "^pty.*"
  8774. },
  8775. "exitCode": {
  8776. "type": "number"
  8777. }
  8778. },
  8779. "required": ["id", "exitCode"]
  8780. }
  8781. },
  8782. "required": ["type", "properties"]
  8783. },
  8784. "Event.pty.deleted": {
  8785. "type": "object",
  8786. "properties": {
  8787. "type": {
  8788. "type": "string",
  8789. "const": "pty.deleted"
  8790. },
  8791. "properties": {
  8792. "type": "object",
  8793. "properties": {
  8794. "id": {
  8795. "type": "string",
  8796. "pattern": "^pty.*"
  8797. }
  8798. },
  8799. "required": ["id"]
  8800. }
  8801. },
  8802. "required": ["type", "properties"]
  8803. },
  8804. "Event.workspace.ready": {
  8805. "type": "object",
  8806. "properties": {
  8807. "type": {
  8808. "type": "string",
  8809. "const": "workspace.ready"
  8810. },
  8811. "properties": {
  8812. "type": "object",
  8813. "properties": {
  8814. "name": {
  8815. "type": "string"
  8816. }
  8817. },
  8818. "required": ["name"]
  8819. }
  8820. },
  8821. "required": ["type", "properties"]
  8822. },
  8823. "Event.workspace.failed": {
  8824. "type": "object",
  8825. "properties": {
  8826. "type": {
  8827. "type": "string",
  8828. "const": "workspace.failed"
  8829. },
  8830. "properties": {
  8831. "type": "object",
  8832. "properties": {
  8833. "message": {
  8834. "type": "string"
  8835. }
  8836. },
  8837. "required": ["message"]
  8838. }
  8839. },
  8840. "required": ["type", "properties"]
  8841. },
  8842. "Event.workspace.restore": {
  8843. "type": "object",
  8844. "properties": {
  8845. "type": {
  8846. "type": "string",
  8847. "const": "workspace.restore"
  8848. },
  8849. "properties": {
  8850. "type": "object",
  8851. "properties": {
  8852. "workspaceID": {
  8853. "type": "string",
  8854. "pattern": "^wrk.*"
  8855. },
  8856. "sessionID": {
  8857. "type": "string",
  8858. "pattern": "^ses.*"
  8859. },
  8860. "total": {
  8861. "type": "integer",
  8862. "minimum": 0,
  8863. "maximum": 9007199254740991
  8864. },
  8865. "step": {
  8866. "type": "integer",
  8867. "minimum": 0,
  8868. "maximum": 9007199254740991
  8869. }
  8870. },
  8871. "required": ["workspaceID", "sessionID", "total", "step"]
  8872. }
  8873. },
  8874. "required": ["type", "properties"]
  8875. },
  8876. "Event.workspace.status": {
  8877. "type": "object",
  8878. "properties": {
  8879. "type": {
  8880. "type": "string",
  8881. "const": "workspace.status"
  8882. },
  8883. "properties": {
  8884. "type": "object",
  8885. "properties": {
  8886. "workspaceID": {
  8887. "type": "string",
  8888. "pattern": "^wrk.*"
  8889. },
  8890. "status": {
  8891. "type": "string",
  8892. "enum": ["connected", "connecting", "disconnected", "error"]
  8893. }
  8894. },
  8895. "required": ["workspaceID", "status"]
  8896. }
  8897. },
  8898. "required": ["type", "properties"]
  8899. },
  8900. "OutputFormatText": {
  8901. "type": "object",
  8902. "properties": {
  8903. "type": {
  8904. "type": "string",
  8905. "const": "text"
  8906. }
  8907. },
  8908. "required": ["type"]
  8909. },
  8910. "JSONSchema": {
  8911. "type": "object",
  8912. "propertyNames": {
  8913. "type": "string"
  8914. },
  8915. "additionalProperties": {}
  8916. },
  8917. "OutputFormatJsonSchema": {
  8918. "type": "object",
  8919. "properties": {
  8920. "type": {
  8921. "type": "string",
  8922. "const": "json_schema"
  8923. },
  8924. "schema": {
  8925. "$ref": "#/components/schemas/JSONSchema"
  8926. },
  8927. "retryCount": {
  8928. "default": 2,
  8929. "type": "integer",
  8930. "minimum": 0,
  8931. "maximum": 9007199254740991
  8932. }
  8933. },
  8934. "required": ["type", "schema"]
  8935. },
  8936. "OutputFormat": {
  8937. "anyOf": [
  8938. {
  8939. "$ref": "#/components/schemas/OutputFormatText"
  8940. },
  8941. {
  8942. "$ref": "#/components/schemas/OutputFormatJsonSchema"
  8943. }
  8944. ]
  8945. },
  8946. "UserMessage": {
  8947. "type": "object",
  8948. "properties": {
  8949. "id": {
  8950. "type": "string",
  8951. "pattern": "^msg.*"
  8952. },
  8953. "sessionID": {
  8954. "type": "string",
  8955. "pattern": "^ses.*"
  8956. },
  8957. "role": {
  8958. "type": "string",
  8959. "const": "user"
  8960. },
  8961. "time": {
  8962. "type": "object",
  8963. "properties": {
  8964. "created": {
  8965. "type": "number"
  8966. }
  8967. },
  8968. "required": ["created"]
  8969. },
  8970. "format": {
  8971. "$ref": "#/components/schemas/OutputFormat"
  8972. },
  8973. "summary": {
  8974. "type": "object",
  8975. "properties": {
  8976. "title": {
  8977. "type": "string"
  8978. },
  8979. "body": {
  8980. "type": "string"
  8981. },
  8982. "diffs": {
  8983. "type": "array",
  8984. "items": {
  8985. "$ref": "#/components/schemas/SnapshotFileDiff"
  8986. }
  8987. }
  8988. },
  8989. "required": ["diffs"]
  8990. },
  8991. "agent": {
  8992. "type": "string"
  8993. },
  8994. "model": {
  8995. "type": "object",
  8996. "properties": {
  8997. "providerID": {
  8998. "type": "string"
  8999. },
  9000. "modelID": {
  9001. "type": "string"
  9002. },
  9003. "variant": {
  9004. "type": "string"
  9005. }
  9006. },
  9007. "required": ["providerID", "modelID"]
  9008. },
  9009. "system": {
  9010. "type": "string"
  9011. },
  9012. "tools": {
  9013. "type": "object",
  9014. "propertyNames": {
  9015. "type": "string"
  9016. },
  9017. "additionalProperties": {
  9018. "type": "boolean"
  9019. }
  9020. }
  9021. },
  9022. "required": ["id", "sessionID", "role", "time", "agent", "model"]
  9023. },
  9024. "AssistantMessage": {
  9025. "type": "object",
  9026. "properties": {
  9027. "id": {
  9028. "type": "string",
  9029. "pattern": "^msg.*"
  9030. },
  9031. "sessionID": {
  9032. "type": "string",
  9033. "pattern": "^ses.*"
  9034. },
  9035. "role": {
  9036. "type": "string",
  9037. "const": "assistant"
  9038. },
  9039. "time": {
  9040. "type": "object",
  9041. "properties": {
  9042. "created": {
  9043. "type": "number"
  9044. },
  9045. "completed": {
  9046. "type": "number"
  9047. }
  9048. },
  9049. "required": ["created"]
  9050. },
  9051. "error": {
  9052. "anyOf": [
  9053. {
  9054. "$ref": "#/components/schemas/ProviderAuthError"
  9055. },
  9056. {
  9057. "$ref": "#/components/schemas/UnknownError"
  9058. },
  9059. {
  9060. "$ref": "#/components/schemas/MessageOutputLengthError"
  9061. },
  9062. {
  9063. "$ref": "#/components/schemas/MessageAbortedError"
  9064. },
  9065. {
  9066. "$ref": "#/components/schemas/StructuredOutputError"
  9067. },
  9068. {
  9069. "$ref": "#/components/schemas/ContextOverflowError"
  9070. },
  9071. {
  9072. "$ref": "#/components/schemas/APIError"
  9073. }
  9074. ]
  9075. },
  9076. "parentID": {
  9077. "type": "string",
  9078. "pattern": "^msg.*"
  9079. },
  9080. "modelID": {
  9081. "type": "string"
  9082. },
  9083. "providerID": {
  9084. "type": "string"
  9085. },
  9086. "mode": {
  9087. "type": "string"
  9088. },
  9089. "agent": {
  9090. "type": "string"
  9091. },
  9092. "path": {
  9093. "type": "object",
  9094. "properties": {
  9095. "cwd": {
  9096. "type": "string"
  9097. },
  9098. "root": {
  9099. "type": "string"
  9100. }
  9101. },
  9102. "required": ["cwd", "root"]
  9103. },
  9104. "summary": {
  9105. "type": "boolean"
  9106. },
  9107. "cost": {
  9108. "type": "number"
  9109. },
  9110. "tokens": {
  9111. "type": "object",
  9112. "properties": {
  9113. "total": {
  9114. "type": "number"
  9115. },
  9116. "input": {
  9117. "type": "number"
  9118. },
  9119. "output": {
  9120. "type": "number"
  9121. },
  9122. "reasoning": {
  9123. "type": "number"
  9124. },
  9125. "cache": {
  9126. "type": "object",
  9127. "properties": {
  9128. "read": {
  9129. "type": "number"
  9130. },
  9131. "write": {
  9132. "type": "number"
  9133. }
  9134. },
  9135. "required": ["read", "write"]
  9136. }
  9137. },
  9138. "required": ["input", "output", "reasoning", "cache"]
  9139. },
  9140. "structured": {},
  9141. "variant": {
  9142. "type": "string"
  9143. },
  9144. "finish": {
  9145. "type": "string"
  9146. }
  9147. },
  9148. "required": [
  9149. "id",
  9150. "sessionID",
  9151. "role",
  9152. "time",
  9153. "parentID",
  9154. "modelID",
  9155. "providerID",
  9156. "mode",
  9157. "agent",
  9158. "path",
  9159. "cost",
  9160. "tokens"
  9161. ]
  9162. },
  9163. "Message": {
  9164. "anyOf": [
  9165. {
  9166. "$ref": "#/components/schemas/UserMessage"
  9167. },
  9168. {
  9169. "$ref": "#/components/schemas/AssistantMessage"
  9170. }
  9171. ]
  9172. },
  9173. "Event.message.updated": {
  9174. "type": "object",
  9175. "properties": {
  9176. "type": {
  9177. "type": "string",
  9178. "const": "message.updated"
  9179. },
  9180. "properties": {
  9181. "type": "object",
  9182. "properties": {
  9183. "sessionID": {
  9184. "type": "string",
  9185. "pattern": "^ses.*"
  9186. },
  9187. "info": {
  9188. "$ref": "#/components/schemas/Message"
  9189. }
  9190. },
  9191. "required": ["sessionID", "info"]
  9192. }
  9193. },
  9194. "required": ["type", "properties"]
  9195. },
  9196. "Event.message.removed": {
  9197. "type": "object",
  9198. "properties": {
  9199. "type": {
  9200. "type": "string",
  9201. "const": "message.removed"
  9202. },
  9203. "properties": {
  9204. "type": "object",
  9205. "properties": {
  9206. "sessionID": {
  9207. "type": "string",
  9208. "pattern": "^ses.*"
  9209. },
  9210. "messageID": {
  9211. "type": "string",
  9212. "pattern": "^msg.*"
  9213. }
  9214. },
  9215. "required": ["sessionID", "messageID"]
  9216. }
  9217. },
  9218. "required": ["type", "properties"]
  9219. },
  9220. "TextPart": {
  9221. "type": "object",
  9222. "properties": {
  9223. "id": {
  9224. "type": "string",
  9225. "pattern": "^prt.*"
  9226. },
  9227. "sessionID": {
  9228. "type": "string",
  9229. "pattern": "^ses.*"
  9230. },
  9231. "messageID": {
  9232. "type": "string",
  9233. "pattern": "^msg.*"
  9234. },
  9235. "type": {
  9236. "type": "string",
  9237. "const": "text"
  9238. },
  9239. "text": {
  9240. "type": "string"
  9241. },
  9242. "synthetic": {
  9243. "type": "boolean"
  9244. },
  9245. "ignored": {
  9246. "type": "boolean"
  9247. },
  9248. "time": {
  9249. "type": "object",
  9250. "properties": {
  9251. "start": {
  9252. "type": "number"
  9253. },
  9254. "end": {
  9255. "type": "number"
  9256. }
  9257. },
  9258. "required": ["start"]
  9259. },
  9260. "metadata": {
  9261. "type": "object",
  9262. "propertyNames": {
  9263. "type": "string"
  9264. },
  9265. "additionalProperties": {}
  9266. }
  9267. },
  9268. "required": ["id", "sessionID", "messageID", "type", "text"]
  9269. },
  9270. "SubtaskPart": {
  9271. "type": "object",
  9272. "properties": {
  9273. "id": {
  9274. "type": "string",
  9275. "pattern": "^prt.*"
  9276. },
  9277. "sessionID": {
  9278. "type": "string",
  9279. "pattern": "^ses.*"
  9280. },
  9281. "messageID": {
  9282. "type": "string",
  9283. "pattern": "^msg.*"
  9284. },
  9285. "type": {
  9286. "type": "string",
  9287. "const": "subtask"
  9288. },
  9289. "prompt": {
  9290. "type": "string"
  9291. },
  9292. "description": {
  9293. "type": "string"
  9294. },
  9295. "agent": {
  9296. "type": "string"
  9297. },
  9298. "model": {
  9299. "type": "object",
  9300. "properties": {
  9301. "providerID": {
  9302. "type": "string"
  9303. },
  9304. "modelID": {
  9305. "type": "string"
  9306. }
  9307. },
  9308. "required": ["providerID", "modelID"]
  9309. },
  9310. "command": {
  9311. "type": "string"
  9312. }
  9313. },
  9314. "required": ["id", "sessionID", "messageID", "type", "prompt", "description", "agent"]
  9315. },
  9316. "ReasoningPart": {
  9317. "type": "object",
  9318. "properties": {
  9319. "id": {
  9320. "type": "string",
  9321. "pattern": "^prt.*"
  9322. },
  9323. "sessionID": {
  9324. "type": "string",
  9325. "pattern": "^ses.*"
  9326. },
  9327. "messageID": {
  9328. "type": "string",
  9329. "pattern": "^msg.*"
  9330. },
  9331. "type": {
  9332. "type": "string",
  9333. "const": "reasoning"
  9334. },
  9335. "text": {
  9336. "type": "string"
  9337. },
  9338. "metadata": {
  9339. "type": "object",
  9340. "propertyNames": {
  9341. "type": "string"
  9342. },
  9343. "additionalProperties": {}
  9344. },
  9345. "time": {
  9346. "type": "object",
  9347. "properties": {
  9348. "start": {
  9349. "type": "number"
  9350. },
  9351. "end": {
  9352. "type": "number"
  9353. }
  9354. },
  9355. "required": ["start"]
  9356. }
  9357. },
  9358. "required": ["id", "sessionID", "messageID", "type", "text", "time"]
  9359. },
  9360. "FilePartSourceText": {
  9361. "type": "object",
  9362. "properties": {
  9363. "value": {
  9364. "type": "string"
  9365. },
  9366. "start": {
  9367. "type": "integer",
  9368. "minimum": -9007199254740991,
  9369. "maximum": 9007199254740991
  9370. },
  9371. "end": {
  9372. "type": "integer",
  9373. "minimum": -9007199254740991,
  9374. "maximum": 9007199254740991
  9375. }
  9376. },
  9377. "required": ["value", "start", "end"]
  9378. },
  9379. "FileSource": {
  9380. "type": "object",
  9381. "properties": {
  9382. "text": {
  9383. "$ref": "#/components/schemas/FilePartSourceText"
  9384. },
  9385. "type": {
  9386. "type": "string",
  9387. "const": "file"
  9388. },
  9389. "path": {
  9390. "type": "string"
  9391. }
  9392. },
  9393. "required": ["text", "type", "path"]
  9394. },
  9395. "Range": {
  9396. "type": "object",
  9397. "properties": {
  9398. "start": {
  9399. "type": "object",
  9400. "properties": {
  9401. "line": {
  9402. "type": "number"
  9403. },
  9404. "character": {
  9405. "type": "number"
  9406. }
  9407. },
  9408. "required": ["line", "character"]
  9409. },
  9410. "end": {
  9411. "type": "object",
  9412. "properties": {
  9413. "line": {
  9414. "type": "number"
  9415. },
  9416. "character": {
  9417. "type": "number"
  9418. }
  9419. },
  9420. "required": ["line", "character"]
  9421. }
  9422. },
  9423. "required": ["start", "end"]
  9424. },
  9425. "SymbolSource": {
  9426. "type": "object",
  9427. "properties": {
  9428. "text": {
  9429. "$ref": "#/components/schemas/FilePartSourceText"
  9430. },
  9431. "type": {
  9432. "type": "string",
  9433. "const": "symbol"
  9434. },
  9435. "path": {
  9436. "type": "string"
  9437. },
  9438. "range": {
  9439. "$ref": "#/components/schemas/Range"
  9440. },
  9441. "name": {
  9442. "type": "string"
  9443. },
  9444. "kind": {
  9445. "type": "integer",
  9446. "minimum": -9007199254740991,
  9447. "maximum": 9007199254740991
  9448. }
  9449. },
  9450. "required": ["text", "type", "path", "range", "name", "kind"]
  9451. },
  9452. "ResourceSource": {
  9453. "type": "object",
  9454. "properties": {
  9455. "text": {
  9456. "$ref": "#/components/schemas/FilePartSourceText"
  9457. },
  9458. "type": {
  9459. "type": "string",
  9460. "const": "resource"
  9461. },
  9462. "clientName": {
  9463. "type": "string"
  9464. },
  9465. "uri": {
  9466. "type": "string"
  9467. }
  9468. },
  9469. "required": ["text", "type", "clientName", "uri"]
  9470. },
  9471. "FilePartSource": {
  9472. "anyOf": [
  9473. {
  9474. "$ref": "#/components/schemas/FileSource"
  9475. },
  9476. {
  9477. "$ref": "#/components/schemas/SymbolSource"
  9478. },
  9479. {
  9480. "$ref": "#/components/schemas/ResourceSource"
  9481. }
  9482. ]
  9483. },
  9484. "FilePart": {
  9485. "type": "object",
  9486. "properties": {
  9487. "id": {
  9488. "type": "string",
  9489. "pattern": "^prt.*"
  9490. },
  9491. "sessionID": {
  9492. "type": "string",
  9493. "pattern": "^ses.*"
  9494. },
  9495. "messageID": {
  9496. "type": "string",
  9497. "pattern": "^msg.*"
  9498. },
  9499. "type": {
  9500. "type": "string",
  9501. "const": "file"
  9502. },
  9503. "mime": {
  9504. "type": "string"
  9505. },
  9506. "filename": {
  9507. "type": "string"
  9508. },
  9509. "url": {
  9510. "type": "string"
  9511. },
  9512. "source": {
  9513. "$ref": "#/components/schemas/FilePartSource"
  9514. }
  9515. },
  9516. "required": ["id", "sessionID", "messageID", "type", "mime", "url"]
  9517. },
  9518. "ToolStatePending": {
  9519. "type": "object",
  9520. "properties": {
  9521. "status": {
  9522. "type": "string",
  9523. "const": "pending"
  9524. },
  9525. "input": {
  9526. "type": "object",
  9527. "propertyNames": {
  9528. "type": "string"
  9529. },
  9530. "additionalProperties": {}
  9531. },
  9532. "raw": {
  9533. "type": "string"
  9534. }
  9535. },
  9536. "required": ["status", "input", "raw"]
  9537. },
  9538. "ToolStateRunning": {
  9539. "type": "object",
  9540. "properties": {
  9541. "status": {
  9542. "type": "string",
  9543. "const": "running"
  9544. },
  9545. "input": {
  9546. "type": "object",
  9547. "propertyNames": {
  9548. "type": "string"
  9549. },
  9550. "additionalProperties": {}
  9551. },
  9552. "title": {
  9553. "type": "string"
  9554. },
  9555. "metadata": {
  9556. "type": "object",
  9557. "propertyNames": {
  9558. "type": "string"
  9559. },
  9560. "additionalProperties": {}
  9561. },
  9562. "time": {
  9563. "type": "object",
  9564. "properties": {
  9565. "start": {
  9566. "type": "number"
  9567. }
  9568. },
  9569. "required": ["start"]
  9570. }
  9571. },
  9572. "required": ["status", "input", "time"]
  9573. },
  9574. "ToolStateCompleted": {
  9575. "type": "object",
  9576. "properties": {
  9577. "status": {
  9578. "type": "string",
  9579. "const": "completed"
  9580. },
  9581. "input": {
  9582. "type": "object",
  9583. "propertyNames": {
  9584. "type": "string"
  9585. },
  9586. "additionalProperties": {}
  9587. },
  9588. "output": {
  9589. "type": "string"
  9590. },
  9591. "title": {
  9592. "type": "string"
  9593. },
  9594. "metadata": {
  9595. "type": "object",
  9596. "propertyNames": {
  9597. "type": "string"
  9598. },
  9599. "additionalProperties": {}
  9600. },
  9601. "time": {
  9602. "type": "object",
  9603. "properties": {
  9604. "start": {
  9605. "type": "number"
  9606. },
  9607. "end": {
  9608. "type": "number"
  9609. },
  9610. "compacted": {
  9611. "type": "number"
  9612. }
  9613. },
  9614. "required": ["start", "end"]
  9615. },
  9616. "attachments": {
  9617. "type": "array",
  9618. "items": {
  9619. "$ref": "#/components/schemas/FilePart"
  9620. }
  9621. }
  9622. },
  9623. "required": ["status", "input", "output", "title", "metadata", "time"]
  9624. },
  9625. "ToolStateError": {
  9626. "type": "object",
  9627. "properties": {
  9628. "status": {
  9629. "type": "string",
  9630. "const": "error"
  9631. },
  9632. "input": {
  9633. "type": "object",
  9634. "propertyNames": {
  9635. "type": "string"
  9636. },
  9637. "additionalProperties": {}
  9638. },
  9639. "error": {
  9640. "type": "string"
  9641. },
  9642. "metadata": {
  9643. "type": "object",
  9644. "propertyNames": {
  9645. "type": "string"
  9646. },
  9647. "additionalProperties": {}
  9648. },
  9649. "time": {
  9650. "type": "object",
  9651. "properties": {
  9652. "start": {
  9653. "type": "number"
  9654. },
  9655. "end": {
  9656. "type": "number"
  9657. }
  9658. },
  9659. "required": ["start", "end"]
  9660. }
  9661. },
  9662. "required": ["status", "input", "error", "time"]
  9663. },
  9664. "ToolState": {
  9665. "anyOf": [
  9666. {
  9667. "$ref": "#/components/schemas/ToolStatePending"
  9668. },
  9669. {
  9670. "$ref": "#/components/schemas/ToolStateRunning"
  9671. },
  9672. {
  9673. "$ref": "#/components/schemas/ToolStateCompleted"
  9674. },
  9675. {
  9676. "$ref": "#/components/schemas/ToolStateError"
  9677. }
  9678. ]
  9679. },
  9680. "ToolPart": {
  9681. "type": "object",
  9682. "properties": {
  9683. "id": {
  9684. "type": "string",
  9685. "pattern": "^prt.*"
  9686. },
  9687. "sessionID": {
  9688. "type": "string",
  9689. "pattern": "^ses.*"
  9690. },
  9691. "messageID": {
  9692. "type": "string",
  9693. "pattern": "^msg.*"
  9694. },
  9695. "type": {
  9696. "type": "string",
  9697. "const": "tool"
  9698. },
  9699. "callID": {
  9700. "type": "string"
  9701. },
  9702. "tool": {
  9703. "type": "string"
  9704. },
  9705. "state": {
  9706. "$ref": "#/components/schemas/ToolState"
  9707. },
  9708. "metadata": {
  9709. "type": "object",
  9710. "propertyNames": {
  9711. "type": "string"
  9712. },
  9713. "additionalProperties": {}
  9714. }
  9715. },
  9716. "required": ["id", "sessionID", "messageID", "type", "callID", "tool", "state"]
  9717. },
  9718. "StepStartPart": {
  9719. "type": "object",
  9720. "properties": {
  9721. "id": {
  9722. "type": "string",
  9723. "pattern": "^prt.*"
  9724. },
  9725. "sessionID": {
  9726. "type": "string",
  9727. "pattern": "^ses.*"
  9728. },
  9729. "messageID": {
  9730. "type": "string",
  9731. "pattern": "^msg.*"
  9732. },
  9733. "type": {
  9734. "type": "string",
  9735. "const": "step-start"
  9736. },
  9737. "snapshot": {
  9738. "type": "string"
  9739. }
  9740. },
  9741. "required": ["id", "sessionID", "messageID", "type"]
  9742. },
  9743. "StepFinishPart": {
  9744. "type": "object",
  9745. "properties": {
  9746. "id": {
  9747. "type": "string",
  9748. "pattern": "^prt.*"
  9749. },
  9750. "sessionID": {
  9751. "type": "string",
  9752. "pattern": "^ses.*"
  9753. },
  9754. "messageID": {
  9755. "type": "string",
  9756. "pattern": "^msg.*"
  9757. },
  9758. "type": {
  9759. "type": "string",
  9760. "const": "step-finish"
  9761. },
  9762. "reason": {
  9763. "type": "string"
  9764. },
  9765. "snapshot": {
  9766. "type": "string"
  9767. },
  9768. "cost": {
  9769. "type": "number"
  9770. },
  9771. "tokens": {
  9772. "type": "object",
  9773. "properties": {
  9774. "total": {
  9775. "type": "number"
  9776. },
  9777. "input": {
  9778. "type": "number"
  9779. },
  9780. "output": {
  9781. "type": "number"
  9782. },
  9783. "reasoning": {
  9784. "type": "number"
  9785. },
  9786. "cache": {
  9787. "type": "object",
  9788. "properties": {
  9789. "read": {
  9790. "type": "number"
  9791. },
  9792. "write": {
  9793. "type": "number"
  9794. }
  9795. },
  9796. "required": ["read", "write"]
  9797. }
  9798. },
  9799. "required": ["input", "output", "reasoning", "cache"]
  9800. }
  9801. },
  9802. "required": ["id", "sessionID", "messageID", "type", "reason", "cost", "tokens"]
  9803. },
  9804. "SnapshotPart": {
  9805. "type": "object",
  9806. "properties": {
  9807. "id": {
  9808. "type": "string",
  9809. "pattern": "^prt.*"
  9810. },
  9811. "sessionID": {
  9812. "type": "string",
  9813. "pattern": "^ses.*"
  9814. },
  9815. "messageID": {
  9816. "type": "string",
  9817. "pattern": "^msg.*"
  9818. },
  9819. "type": {
  9820. "type": "string",
  9821. "const": "snapshot"
  9822. },
  9823. "snapshot": {
  9824. "type": "string"
  9825. }
  9826. },
  9827. "required": ["id", "sessionID", "messageID", "type", "snapshot"]
  9828. },
  9829. "PatchPart": {
  9830. "type": "object",
  9831. "properties": {
  9832. "id": {
  9833. "type": "string",
  9834. "pattern": "^prt.*"
  9835. },
  9836. "sessionID": {
  9837. "type": "string",
  9838. "pattern": "^ses.*"
  9839. },
  9840. "messageID": {
  9841. "type": "string",
  9842. "pattern": "^msg.*"
  9843. },
  9844. "type": {
  9845. "type": "string",
  9846. "const": "patch"
  9847. },
  9848. "hash": {
  9849. "type": "string"
  9850. },
  9851. "files": {
  9852. "type": "array",
  9853. "items": {
  9854. "type": "string"
  9855. }
  9856. }
  9857. },
  9858. "required": ["id", "sessionID", "messageID", "type", "hash", "files"]
  9859. },
  9860. "AgentPart": {
  9861. "type": "object",
  9862. "properties": {
  9863. "id": {
  9864. "type": "string",
  9865. "pattern": "^prt.*"
  9866. },
  9867. "sessionID": {
  9868. "type": "string",
  9869. "pattern": "^ses.*"
  9870. },
  9871. "messageID": {
  9872. "type": "string",
  9873. "pattern": "^msg.*"
  9874. },
  9875. "type": {
  9876. "type": "string",
  9877. "const": "agent"
  9878. },
  9879. "name": {
  9880. "type": "string"
  9881. },
  9882. "source": {
  9883. "type": "object",
  9884. "properties": {
  9885. "value": {
  9886. "type": "string"
  9887. },
  9888. "start": {
  9889. "type": "integer",
  9890. "minimum": -9007199254740991,
  9891. "maximum": 9007199254740991
  9892. },
  9893. "end": {
  9894. "type": "integer",
  9895. "minimum": -9007199254740991,
  9896. "maximum": 9007199254740991
  9897. }
  9898. },
  9899. "required": ["value", "start", "end"]
  9900. }
  9901. },
  9902. "required": ["id", "sessionID", "messageID", "type", "name"]
  9903. },
  9904. "RetryPart": {
  9905. "type": "object",
  9906. "properties": {
  9907. "id": {
  9908. "type": "string",
  9909. "pattern": "^prt.*"
  9910. },
  9911. "sessionID": {
  9912. "type": "string",
  9913. "pattern": "^ses.*"
  9914. },
  9915. "messageID": {
  9916. "type": "string",
  9917. "pattern": "^msg.*"
  9918. },
  9919. "type": {
  9920. "type": "string",
  9921. "const": "retry"
  9922. },
  9923. "attempt": {
  9924. "type": "number"
  9925. },
  9926. "error": {
  9927. "$ref": "#/components/schemas/APIError"
  9928. },
  9929. "time": {
  9930. "type": "object",
  9931. "properties": {
  9932. "created": {
  9933. "type": "number"
  9934. }
  9935. },
  9936. "required": ["created"]
  9937. }
  9938. },
  9939. "required": ["id", "sessionID", "messageID", "type", "attempt", "error", "time"]
  9940. },
  9941. "CompactionPart": {
  9942. "type": "object",
  9943. "properties": {
  9944. "id": {
  9945. "type": "string",
  9946. "pattern": "^prt.*"
  9947. },
  9948. "sessionID": {
  9949. "type": "string",
  9950. "pattern": "^ses.*"
  9951. },
  9952. "messageID": {
  9953. "type": "string",
  9954. "pattern": "^msg.*"
  9955. },
  9956. "type": {
  9957. "type": "string",
  9958. "const": "compaction"
  9959. },
  9960. "auto": {
  9961. "type": "boolean"
  9962. },
  9963. "overflow": {
  9964. "type": "boolean"
  9965. }
  9966. },
  9967. "required": ["id", "sessionID", "messageID", "type", "auto"]
  9968. },
  9969. "Part": {
  9970. "anyOf": [
  9971. {
  9972. "$ref": "#/components/schemas/TextPart"
  9973. },
  9974. {
  9975. "$ref": "#/components/schemas/SubtaskPart"
  9976. },
  9977. {
  9978. "$ref": "#/components/schemas/ReasoningPart"
  9979. },
  9980. {
  9981. "$ref": "#/components/schemas/FilePart"
  9982. },
  9983. {
  9984. "$ref": "#/components/schemas/ToolPart"
  9985. },
  9986. {
  9987. "$ref": "#/components/schemas/StepStartPart"
  9988. },
  9989. {
  9990. "$ref": "#/components/schemas/StepFinishPart"
  9991. },
  9992. {
  9993. "$ref": "#/components/schemas/SnapshotPart"
  9994. },
  9995. {
  9996. "$ref": "#/components/schemas/PatchPart"
  9997. },
  9998. {
  9999. "$ref": "#/components/schemas/AgentPart"
  10000. },
  10001. {
  10002. "$ref": "#/components/schemas/RetryPart"
  10003. },
  10004. {
  10005. "$ref": "#/components/schemas/CompactionPart"
  10006. }
  10007. ]
  10008. },
  10009. "Event.message.part.updated": {
  10010. "type": "object",
  10011. "properties": {
  10012. "type": {
  10013. "type": "string",
  10014. "const": "message.part.updated"
  10015. },
  10016. "properties": {
  10017. "type": "object",
  10018. "properties": {
  10019. "sessionID": {
  10020. "type": "string",
  10021. "pattern": "^ses.*"
  10022. },
  10023. "part": {
  10024. "$ref": "#/components/schemas/Part"
  10025. },
  10026. "time": {
  10027. "type": "number"
  10028. }
  10029. },
  10030. "required": ["sessionID", "part", "time"]
  10031. }
  10032. },
  10033. "required": ["type", "properties"]
  10034. },
  10035. "Event.message.part.removed": {
  10036. "type": "object",
  10037. "properties": {
  10038. "type": {
  10039. "type": "string",
  10040. "const": "message.part.removed"
  10041. },
  10042. "properties": {
  10043. "type": "object",
  10044. "properties": {
  10045. "sessionID": {
  10046. "type": "string",
  10047. "pattern": "^ses.*"
  10048. },
  10049. "messageID": {
  10050. "type": "string",
  10051. "pattern": "^msg.*"
  10052. },
  10053. "partID": {
  10054. "type": "string",
  10055. "pattern": "^prt.*"
  10056. }
  10057. },
  10058. "required": ["sessionID", "messageID", "partID"]
  10059. }
  10060. },
  10061. "required": ["type", "properties"]
  10062. },
  10063. "PermissionAction": {
  10064. "type": "string",
  10065. "enum": ["allow", "deny", "ask"]
  10066. },
  10067. "PermissionRule": {
  10068. "type": "object",
  10069. "properties": {
  10070. "permission": {
  10071. "type": "string"
  10072. },
  10073. "pattern": {
  10074. "type": "string"
  10075. },
  10076. "action": {
  10077. "$ref": "#/components/schemas/PermissionAction"
  10078. }
  10079. },
  10080. "required": ["permission", "pattern", "action"]
  10081. },
  10082. "PermissionRuleset": {
  10083. "type": "array",
  10084. "items": {
  10085. "$ref": "#/components/schemas/PermissionRule"
  10086. }
  10087. },
  10088. "Session": {
  10089. "type": "object",
  10090. "properties": {
  10091. "id": {
  10092. "type": "string",
  10093. "pattern": "^ses.*"
  10094. },
  10095. "slug": {
  10096. "type": "string"
  10097. },
  10098. "projectID": {
  10099. "type": "string"
  10100. },
  10101. "workspaceID": {
  10102. "type": "string",
  10103. "pattern": "^wrk.*"
  10104. },
  10105. "directory": {
  10106. "type": "string"
  10107. },
  10108. "parentID": {
  10109. "type": "string",
  10110. "pattern": "^ses.*"
  10111. },
  10112. "summary": {
  10113. "type": "object",
  10114. "properties": {
  10115. "additions": {
  10116. "type": "number"
  10117. },
  10118. "deletions": {
  10119. "type": "number"
  10120. },
  10121. "files": {
  10122. "type": "number"
  10123. },
  10124. "diffs": {
  10125. "type": "array",
  10126. "items": {
  10127. "$ref": "#/components/schemas/SnapshotFileDiff"
  10128. }
  10129. }
  10130. },
  10131. "required": ["additions", "deletions", "files"]
  10132. },
  10133. "share": {
  10134. "type": "object",
  10135. "properties": {
  10136. "url": {
  10137. "type": "string"
  10138. }
  10139. },
  10140. "required": ["url"]
  10141. },
  10142. "title": {
  10143. "type": "string"
  10144. },
  10145. "version": {
  10146. "type": "string"
  10147. },
  10148. "time": {
  10149. "type": "object",
  10150. "properties": {
  10151. "created": {
  10152. "type": "number"
  10153. },
  10154. "updated": {
  10155. "type": "number"
  10156. },
  10157. "compacting": {
  10158. "type": "number"
  10159. },
  10160. "archived": {
  10161. "type": "number"
  10162. }
  10163. },
  10164. "required": ["created", "updated"]
  10165. },
  10166. "permission": {
  10167. "$ref": "#/components/schemas/PermissionRuleset"
  10168. },
  10169. "revert": {
  10170. "type": "object",
  10171. "properties": {
  10172. "messageID": {
  10173. "type": "string",
  10174. "pattern": "^msg.*"
  10175. },
  10176. "partID": {
  10177. "type": "string",
  10178. "pattern": "^prt.*"
  10179. },
  10180. "snapshot": {
  10181. "type": "string"
  10182. },
  10183. "diff": {
  10184. "type": "string"
  10185. }
  10186. },
  10187. "required": ["messageID"]
  10188. }
  10189. },
  10190. "required": ["id", "slug", "projectID", "directory", "title", "version", "time"]
  10191. },
  10192. "Event.session.created": {
  10193. "type": "object",
  10194. "properties": {
  10195. "type": {
  10196. "type": "string",
  10197. "const": "session.created"
  10198. },
  10199. "properties": {
  10200. "type": "object",
  10201. "properties": {
  10202. "sessionID": {
  10203. "type": "string",
  10204. "pattern": "^ses.*"
  10205. },
  10206. "info": {
  10207. "$ref": "#/components/schemas/Session"
  10208. }
  10209. },
  10210. "required": ["sessionID", "info"]
  10211. }
  10212. },
  10213. "required": ["type", "properties"]
  10214. },
  10215. "Event.session.updated": {
  10216. "type": "object",
  10217. "properties": {
  10218. "type": {
  10219. "type": "string",
  10220. "const": "session.updated"
  10221. },
  10222. "properties": {
  10223. "type": "object",
  10224. "properties": {
  10225. "sessionID": {
  10226. "type": "string",
  10227. "pattern": "^ses.*"
  10228. },
  10229. "info": {
  10230. "$ref": "#/components/schemas/Session"
  10231. }
  10232. },
  10233. "required": ["sessionID", "info"]
  10234. }
  10235. },
  10236. "required": ["type", "properties"]
  10237. },
  10238. "Event.session.deleted": {
  10239. "type": "object",
  10240. "properties": {
  10241. "type": {
  10242. "type": "string",
  10243. "const": "session.deleted"
  10244. },
  10245. "properties": {
  10246. "type": "object",
  10247. "properties": {
  10248. "sessionID": {
  10249. "type": "string",
  10250. "pattern": "^ses.*"
  10251. },
  10252. "info": {
  10253. "$ref": "#/components/schemas/Session"
  10254. }
  10255. },
  10256. "required": ["sessionID", "info"]
  10257. }
  10258. },
  10259. "required": ["type", "properties"]
  10260. },
  10261. "SyncEvent.message.updated": {
  10262. "type": "object",
  10263. "properties": {
  10264. "type": {
  10265. "type": "string",
  10266. "const": "sync"
  10267. },
  10268. "name": {
  10269. "type": "string",
  10270. "const": "message.updated.1"
  10271. },
  10272. "id": {
  10273. "type": "string"
  10274. },
  10275. "seq": {
  10276. "type": "number"
  10277. },
  10278. "aggregateID": {
  10279. "type": "string",
  10280. "const": "sessionID"
  10281. },
  10282. "data": {
  10283. "type": "object",
  10284. "properties": {
  10285. "sessionID": {
  10286. "type": "string",
  10287. "pattern": "^ses.*"
  10288. },
  10289. "info": {
  10290. "$ref": "#/components/schemas/Message"
  10291. }
  10292. },
  10293. "required": ["sessionID", "info"]
  10294. }
  10295. },
  10296. "required": ["type", "name", "id", "seq", "aggregateID", "data"]
  10297. },
  10298. "SyncEvent.message.removed": {
  10299. "type": "object",
  10300. "properties": {
  10301. "type": {
  10302. "type": "string",
  10303. "const": "sync"
  10304. },
  10305. "name": {
  10306. "type": "string",
  10307. "const": "message.removed.1"
  10308. },
  10309. "id": {
  10310. "type": "string"
  10311. },
  10312. "seq": {
  10313. "type": "number"
  10314. },
  10315. "aggregateID": {
  10316. "type": "string",
  10317. "const": "sessionID"
  10318. },
  10319. "data": {
  10320. "type": "object",
  10321. "properties": {
  10322. "sessionID": {
  10323. "type": "string",
  10324. "pattern": "^ses.*"
  10325. },
  10326. "messageID": {
  10327. "type": "string",
  10328. "pattern": "^msg.*"
  10329. }
  10330. },
  10331. "required": ["sessionID", "messageID"]
  10332. }
  10333. },
  10334. "required": ["type", "name", "id", "seq", "aggregateID", "data"]
  10335. },
  10336. "SyncEvent.message.part.updated": {
  10337. "type": "object",
  10338. "properties": {
  10339. "type": {
  10340. "type": "string",
  10341. "const": "sync"
  10342. },
  10343. "name": {
  10344. "type": "string",
  10345. "const": "message.part.updated.1"
  10346. },
  10347. "id": {
  10348. "type": "string"
  10349. },
  10350. "seq": {
  10351. "type": "number"
  10352. },
  10353. "aggregateID": {
  10354. "type": "string",
  10355. "const": "sessionID"
  10356. },
  10357. "data": {
  10358. "type": "object",
  10359. "properties": {
  10360. "sessionID": {
  10361. "type": "string",
  10362. "pattern": "^ses.*"
  10363. },
  10364. "part": {
  10365. "$ref": "#/components/schemas/Part"
  10366. },
  10367. "time": {
  10368. "type": "number"
  10369. }
  10370. },
  10371. "required": ["sessionID", "part", "time"]
  10372. }
  10373. },
  10374. "required": ["type", "name", "id", "seq", "aggregateID", "data"]
  10375. },
  10376. "SyncEvent.message.part.removed": {
  10377. "type": "object",
  10378. "properties": {
  10379. "type": {
  10380. "type": "string",
  10381. "const": "sync"
  10382. },
  10383. "name": {
  10384. "type": "string",
  10385. "const": "message.part.removed.1"
  10386. },
  10387. "id": {
  10388. "type": "string"
  10389. },
  10390. "seq": {
  10391. "type": "number"
  10392. },
  10393. "aggregateID": {
  10394. "type": "string",
  10395. "const": "sessionID"
  10396. },
  10397. "data": {
  10398. "type": "object",
  10399. "properties": {
  10400. "sessionID": {
  10401. "type": "string",
  10402. "pattern": "^ses.*"
  10403. },
  10404. "messageID": {
  10405. "type": "string",
  10406. "pattern": "^msg.*"
  10407. },
  10408. "partID": {
  10409. "type": "string",
  10410. "pattern": "^prt.*"
  10411. }
  10412. },
  10413. "required": ["sessionID", "messageID", "partID"]
  10414. }
  10415. },
  10416. "required": ["type", "name", "id", "seq", "aggregateID", "data"]
  10417. },
  10418. "SyncEvent.session.created": {
  10419. "type": "object",
  10420. "properties": {
  10421. "type": {
  10422. "type": "string",
  10423. "const": "sync"
  10424. },
  10425. "name": {
  10426. "type": "string",
  10427. "const": "session.created.1"
  10428. },
  10429. "id": {
  10430. "type": "string"
  10431. },
  10432. "seq": {
  10433. "type": "number"
  10434. },
  10435. "aggregateID": {
  10436. "type": "string",
  10437. "const": "sessionID"
  10438. },
  10439. "data": {
  10440. "type": "object",
  10441. "properties": {
  10442. "sessionID": {
  10443. "type": "string",
  10444. "pattern": "^ses.*"
  10445. },
  10446. "info": {
  10447. "$ref": "#/components/schemas/Session"
  10448. }
  10449. },
  10450. "required": ["sessionID", "info"]
  10451. }
  10452. },
  10453. "required": ["type", "name", "id", "seq", "aggregateID", "data"]
  10454. },
  10455. "SyncEvent.session.updated": {
  10456. "type": "object",
  10457. "properties": {
  10458. "type": {
  10459. "type": "string",
  10460. "const": "sync"
  10461. },
  10462. "name": {
  10463. "type": "string",
  10464. "const": "session.updated.1"
  10465. },
  10466. "id": {
  10467. "type": "string"
  10468. },
  10469. "seq": {
  10470. "type": "number"
  10471. },
  10472. "aggregateID": {
  10473. "type": "string",
  10474. "const": "sessionID"
  10475. },
  10476. "data": {
  10477. "type": "object",
  10478. "properties": {
  10479. "sessionID": {
  10480. "type": "string",
  10481. "pattern": "^ses.*"
  10482. },
  10483. "info": {
  10484. "type": "object",
  10485. "properties": {
  10486. "id": {
  10487. "anyOf": [
  10488. {
  10489. "type": "string",
  10490. "pattern": "^ses.*"
  10491. },
  10492. {
  10493. "type": "null"
  10494. }
  10495. ]
  10496. },
  10497. "slug": {
  10498. "anyOf": [
  10499. {
  10500. "type": "string"
  10501. },
  10502. {
  10503. "type": "null"
  10504. }
  10505. ]
  10506. },
  10507. "projectID": {
  10508. "anyOf": [
  10509. {
  10510. "type": "string"
  10511. },
  10512. {
  10513. "type": "null"
  10514. }
  10515. ]
  10516. },
  10517. "workspaceID": {
  10518. "anyOf": [
  10519. {
  10520. "type": "string",
  10521. "pattern": "^wrk.*"
  10522. },
  10523. {
  10524. "type": "null"
  10525. }
  10526. ]
  10527. },
  10528. "directory": {
  10529. "anyOf": [
  10530. {
  10531. "type": "string"
  10532. },
  10533. {
  10534. "type": "null"
  10535. }
  10536. ]
  10537. },
  10538. "parentID": {
  10539. "anyOf": [
  10540. {
  10541. "type": "string",
  10542. "pattern": "^ses.*"
  10543. },
  10544. {
  10545. "type": "null"
  10546. }
  10547. ]
  10548. },
  10549. "summary": {
  10550. "anyOf": [
  10551. {
  10552. "type": "object",
  10553. "properties": {
  10554. "additions": {
  10555. "type": "number"
  10556. },
  10557. "deletions": {
  10558. "type": "number"
  10559. },
  10560. "files": {
  10561. "type": "number"
  10562. },
  10563. "diffs": {
  10564. "type": "array",
  10565. "items": {
  10566. "$ref": "#/components/schemas/SnapshotFileDiff"
  10567. }
  10568. }
  10569. },
  10570. "required": ["additions", "deletions", "files"]
  10571. },
  10572. {
  10573. "type": "null"
  10574. }
  10575. ]
  10576. },
  10577. "share": {
  10578. "type": "object",
  10579. "properties": {
  10580. "url": {
  10581. "anyOf": [
  10582. {
  10583. "type": "string"
  10584. },
  10585. {
  10586. "type": "null"
  10587. }
  10588. ]
  10589. }
  10590. },
  10591. "required": ["url"]
  10592. },
  10593. "title": {
  10594. "anyOf": [
  10595. {
  10596. "type": "string"
  10597. },
  10598. {
  10599. "type": "null"
  10600. }
  10601. ]
  10602. },
  10603. "version": {
  10604. "anyOf": [
  10605. {
  10606. "type": "string"
  10607. },
  10608. {
  10609. "type": "null"
  10610. }
  10611. ]
  10612. },
  10613. "time": {
  10614. "type": "object",
  10615. "properties": {
  10616. "created": {
  10617. "anyOf": [
  10618. {
  10619. "type": "number"
  10620. },
  10621. {
  10622. "type": "null"
  10623. }
  10624. ]
  10625. },
  10626. "updated": {
  10627. "anyOf": [
  10628. {
  10629. "type": "number"
  10630. },
  10631. {
  10632. "type": "null"
  10633. }
  10634. ]
  10635. },
  10636. "compacting": {
  10637. "anyOf": [
  10638. {
  10639. "type": "number"
  10640. },
  10641. {
  10642. "type": "null"
  10643. }
  10644. ]
  10645. },
  10646. "archived": {
  10647. "anyOf": [
  10648. {
  10649. "type": "number"
  10650. },
  10651. {
  10652. "type": "null"
  10653. }
  10654. ]
  10655. }
  10656. },
  10657. "required": ["created", "updated", "compacting", "archived"]
  10658. },
  10659. "permission": {
  10660. "anyOf": [
  10661. {
  10662. "$ref": "#/components/schemas/PermissionRuleset"
  10663. },
  10664. {
  10665. "type": "null"
  10666. }
  10667. ]
  10668. },
  10669. "revert": {
  10670. "anyOf": [
  10671. {
  10672. "type": "object",
  10673. "properties": {
  10674. "messageID": {
  10675. "type": "string",
  10676. "pattern": "^msg.*"
  10677. },
  10678. "partID": {
  10679. "type": "string",
  10680. "pattern": "^prt.*"
  10681. },
  10682. "snapshot": {
  10683. "type": "string"
  10684. },
  10685. "diff": {
  10686. "type": "string"
  10687. }
  10688. },
  10689. "required": ["messageID"]
  10690. },
  10691. {
  10692. "type": "null"
  10693. }
  10694. ]
  10695. }
  10696. },
  10697. "required": [
  10698. "id",
  10699. "slug",
  10700. "projectID",
  10701. "workspaceID",
  10702. "directory",
  10703. "parentID",
  10704. "summary",
  10705. "title",
  10706. "version",
  10707. "permission",
  10708. "revert"
  10709. ]
  10710. }
  10711. },
  10712. "required": ["sessionID", "info"]
  10713. }
  10714. },
  10715. "required": ["type", "name", "id", "seq", "aggregateID", "data"]
  10716. },
  10717. "SyncEvent.session.deleted": {
  10718. "type": "object",
  10719. "properties": {
  10720. "type": {
  10721. "type": "string",
  10722. "const": "sync"
  10723. },
  10724. "name": {
  10725. "type": "string",
  10726. "const": "session.deleted.1"
  10727. },
  10728. "id": {
  10729. "type": "string"
  10730. },
  10731. "seq": {
  10732. "type": "number"
  10733. },
  10734. "aggregateID": {
  10735. "type": "string",
  10736. "const": "sessionID"
  10737. },
  10738. "data": {
  10739. "type": "object",
  10740. "properties": {
  10741. "sessionID": {
  10742. "type": "string",
  10743. "pattern": "^ses.*"
  10744. },
  10745. "info": {
  10746. "$ref": "#/components/schemas/Session"
  10747. }
  10748. },
  10749. "required": ["sessionID", "info"]
  10750. }
  10751. },
  10752. "required": ["type", "name", "id", "seq", "aggregateID", "data"]
  10753. },
  10754. "GlobalEvent": {
  10755. "type": "object",
  10756. "properties": {
  10757. "directory": {
  10758. "type": "string"
  10759. },
  10760. "project": {
  10761. "type": "string"
  10762. },
  10763. "workspace": {
  10764. "type": "string"
  10765. },
  10766. "payload": {
  10767. "anyOf": [
  10768. {
  10769. "$ref": "#/components/schemas/Event.project.updated"
  10770. },
  10771. {
  10772. "$ref": "#/components/schemas/Event.server.instance.disposed"
  10773. },
  10774. {
  10775. "$ref": "#/components/schemas/Event.server.connected"
  10776. },
  10777. {
  10778. "$ref": "#/components/schemas/Event.global.disposed"
  10779. },
  10780. {
  10781. "$ref": "#/components/schemas/Event.file.edited"
  10782. },
  10783. {
  10784. "$ref": "#/components/schemas/Event.file.watcher.updated"
  10785. },
  10786. {
  10787. "$ref": "#/components/schemas/Event.lsp.client.diagnostics"
  10788. },
  10789. {
  10790. "$ref": "#/components/schemas/Event.lsp.updated"
  10791. },
  10792. {
  10793. "$ref": "#/components/schemas/Event.installation.updated"
  10794. },
  10795. {
  10796. "$ref": "#/components/schemas/Event.installation.update-available"
  10797. },
  10798. {
  10799. "$ref": "#/components/schemas/Event.message.part.delta"
  10800. },
  10801. {
  10802. "$ref": "#/components/schemas/Event.permission.asked"
  10803. },
  10804. {
  10805. "$ref": "#/components/schemas/Event.permission.replied"
  10806. },
  10807. {
  10808. "$ref": "#/components/schemas/Event.session.diff"
  10809. },
  10810. {
  10811. "$ref": "#/components/schemas/Event.session.error"
  10812. },
  10813. {
  10814. "$ref": "#/components/schemas/Event.question.asked"
  10815. },
  10816. {
  10817. "$ref": "#/components/schemas/Event.question.replied"
  10818. },
  10819. {
  10820. "$ref": "#/components/schemas/Event.question.rejected"
  10821. },
  10822. {
  10823. "$ref": "#/components/schemas/Event.todo.updated"
  10824. },
  10825. {
  10826. "$ref": "#/components/schemas/Event.session.status"
  10827. },
  10828. {
  10829. "$ref": "#/components/schemas/Event.session.idle"
  10830. },
  10831. {
  10832. "$ref": "#/components/schemas/Event.session.compacted"
  10833. },
  10834. {
  10835. "$ref": "#/components/schemas/Event.tui.prompt.append"
  10836. },
  10837. {
  10838. "$ref": "#/components/schemas/Event.tui.command.execute"
  10839. },
  10840. {
  10841. "$ref": "#/components/schemas/Event.tui.toast.show"
  10842. },
  10843. {
  10844. "$ref": "#/components/schemas/Event.tui.session.select"
  10845. },
  10846. {
  10847. "$ref": "#/components/schemas/Event.mcp.tools.changed"
  10848. },
  10849. {
  10850. "$ref": "#/components/schemas/Event.mcp.browser.open.failed"
  10851. },
  10852. {
  10853. "$ref": "#/components/schemas/Event.command.executed"
  10854. },
  10855. {
  10856. "$ref": "#/components/schemas/Event.vcs.branch.updated"
  10857. },
  10858. {
  10859. "$ref": "#/components/schemas/Event.worktree.ready"
  10860. },
  10861. {
  10862. "$ref": "#/components/schemas/Event.worktree.failed"
  10863. },
  10864. {
  10865. "$ref": "#/components/schemas/Event.pty.created"
  10866. },
  10867. {
  10868. "$ref": "#/components/schemas/Event.pty.updated"
  10869. },
  10870. {
  10871. "$ref": "#/components/schemas/Event.pty.exited"
  10872. },
  10873. {
  10874. "$ref": "#/components/schemas/Event.pty.deleted"
  10875. },
  10876. {
  10877. "$ref": "#/components/schemas/Event.workspace.ready"
  10878. },
  10879. {
  10880. "$ref": "#/components/schemas/Event.workspace.failed"
  10881. },
  10882. {
  10883. "$ref": "#/components/schemas/Event.workspace.restore"
  10884. },
  10885. {
  10886. "$ref": "#/components/schemas/Event.workspace.status"
  10887. },
  10888. {
  10889. "$ref": "#/components/schemas/Event.message.updated"
  10890. },
  10891. {
  10892. "$ref": "#/components/schemas/Event.message.removed"
  10893. },
  10894. {
  10895. "$ref": "#/components/schemas/Event.message.part.updated"
  10896. },
  10897. {
  10898. "$ref": "#/components/schemas/Event.message.part.removed"
  10899. },
  10900. {
  10901. "$ref": "#/components/schemas/Event.session.created"
  10902. },
  10903. {
  10904. "$ref": "#/components/schemas/Event.session.updated"
  10905. },
  10906. {
  10907. "$ref": "#/components/schemas/Event.session.deleted"
  10908. },
  10909. {
  10910. "$ref": "#/components/schemas/SyncEvent.message.updated"
  10911. },
  10912. {
  10913. "$ref": "#/components/schemas/SyncEvent.message.removed"
  10914. },
  10915. {
  10916. "$ref": "#/components/schemas/SyncEvent.message.part.updated"
  10917. },
  10918. {
  10919. "$ref": "#/components/schemas/SyncEvent.message.part.removed"
  10920. },
  10921. {
  10922. "$ref": "#/components/schemas/SyncEvent.session.created"
  10923. },
  10924. {
  10925. "$ref": "#/components/schemas/SyncEvent.session.updated"
  10926. },
  10927. {
  10928. "$ref": "#/components/schemas/SyncEvent.session.deleted"
  10929. }
  10930. ]
  10931. }
  10932. },
  10933. "required": ["directory", "payload"]
  10934. },
  10935. "LogLevel": {
  10936. "description": "Log level",
  10937. "type": "string",
  10938. "enum": ["DEBUG", "INFO", "WARN", "ERROR"]
  10939. },
  10940. "ServerConfig": {
  10941. "description": "Server configuration for opencode serve and web commands",
  10942. "type": "object",
  10943. "properties": {
  10944. "port": {
  10945. "description": "Port to listen on",
  10946. "type": "integer",
  10947. "exclusiveMinimum": 0,
  10948. "maximum": 9007199254740991
  10949. },
  10950. "hostname": {
  10951. "description": "Hostname to listen on",
  10952. "type": "string"
  10953. },
  10954. "mdns": {
  10955. "description": "Enable mDNS service discovery",
  10956. "type": "boolean"
  10957. },
  10958. "mdnsDomain": {
  10959. "description": "Custom domain name for mDNS service (default: opencode.local)",
  10960. "type": "string"
  10961. },
  10962. "cors": {
  10963. "description": "Additional domains to allow for CORS",
  10964. "type": "array",
  10965. "items": {
  10966. "type": "string"
  10967. }
  10968. }
  10969. },
  10970. "additionalProperties": false
  10971. },
  10972. "PermissionActionConfig": {
  10973. "type": "string",
  10974. "enum": ["ask", "allow", "deny"]
  10975. },
  10976. "PermissionObjectConfig": {
  10977. "type": "object",
  10978. "propertyNames": {
  10979. "type": "string"
  10980. },
  10981. "additionalProperties": {
  10982. "$ref": "#/components/schemas/PermissionActionConfig"
  10983. }
  10984. },
  10985. "PermissionRuleConfig": {
  10986. "anyOf": [
  10987. {
  10988. "$ref": "#/components/schemas/PermissionActionConfig"
  10989. },
  10990. {
  10991. "$ref": "#/components/schemas/PermissionObjectConfig"
  10992. }
  10993. ]
  10994. },
  10995. "PermissionConfig": {
  10996. "anyOf": [
  10997. {
  10998. "type": "object",
  10999. "properties": {
  11000. "__originalKeys": {
  11001. "type": "array",
  11002. "items": {
  11003. "type": "string"
  11004. }
  11005. },
  11006. "read": {
  11007. "$ref": "#/components/schemas/PermissionRuleConfig"
  11008. },
  11009. "edit": {
  11010. "$ref": "#/components/schemas/PermissionRuleConfig"
  11011. },
  11012. "glob": {
  11013. "$ref": "#/components/schemas/PermissionRuleConfig"
  11014. },
  11015. "grep": {
  11016. "$ref": "#/components/schemas/PermissionRuleConfig"
  11017. },
  11018. "list": {
  11019. "$ref": "#/components/schemas/PermissionRuleConfig"
  11020. },
  11021. "bash": {
  11022. "$ref": "#/components/schemas/PermissionRuleConfig"
  11023. },
  11024. "task": {
  11025. "$ref": "#/components/schemas/PermissionRuleConfig"
  11026. },
  11027. "external_directory": {
  11028. "$ref": "#/components/schemas/PermissionRuleConfig"
  11029. },
  11030. "todowrite": {
  11031. "$ref": "#/components/schemas/PermissionActionConfig"
  11032. },
  11033. "question": {
  11034. "$ref": "#/components/schemas/PermissionActionConfig"
  11035. },
  11036. "webfetch": {
  11037. "$ref": "#/components/schemas/PermissionActionConfig"
  11038. },
  11039. "websearch": {
  11040. "$ref": "#/components/schemas/PermissionActionConfig"
  11041. },
  11042. "codesearch": {
  11043. "$ref": "#/components/schemas/PermissionActionConfig"
  11044. },
  11045. "lsp": {
  11046. "$ref": "#/components/schemas/PermissionRuleConfig"
  11047. },
  11048. "doom_loop": {
  11049. "$ref": "#/components/schemas/PermissionActionConfig"
  11050. },
  11051. "skill": {
  11052. "$ref": "#/components/schemas/PermissionRuleConfig"
  11053. }
  11054. },
  11055. "additionalProperties": {
  11056. "$ref": "#/components/schemas/PermissionRuleConfig"
  11057. }
  11058. },
  11059. {
  11060. "$ref": "#/components/schemas/PermissionActionConfig"
  11061. }
  11062. ]
  11063. },
  11064. "AgentConfig": {
  11065. "type": "object",
  11066. "properties": {
  11067. "model": {
  11068. "type": "string"
  11069. },
  11070. "variant": {
  11071. "description": "Default model variant for this agent (applies only when using the agent's configured model).",
  11072. "type": "string"
  11073. },
  11074. "temperature": {
  11075. "type": "number"
  11076. },
  11077. "top_p": {
  11078. "type": "number"
  11079. },
  11080. "prompt": {
  11081. "type": "string"
  11082. },
  11083. "tools": {
  11084. "description": "@deprecated Use 'permission' field instead",
  11085. "type": "object",
  11086. "propertyNames": {
  11087. "type": "string"
  11088. },
  11089. "additionalProperties": {
  11090. "type": "boolean"
  11091. }
  11092. },
  11093. "disable": {
  11094. "type": "boolean"
  11095. },
  11096. "description": {
  11097. "description": "Description of when to use the agent",
  11098. "type": "string"
  11099. },
  11100. "mode": {
  11101. "type": "string",
  11102. "enum": ["subagent", "primary", "all"]
  11103. },
  11104. "hidden": {
  11105. "description": "Hide this subagent from the @ autocomplete menu (default: false, only applies to mode: subagent)",
  11106. "type": "boolean"
  11107. },
  11108. "options": {
  11109. "type": "object",
  11110. "propertyNames": {
  11111. "type": "string"
  11112. },
  11113. "additionalProperties": {}
  11114. },
  11115. "color": {
  11116. "description": "Hex color code (e.g., #FF5733) or theme color (e.g., primary)",
  11117. "anyOf": [
  11118. {
  11119. "type": "string",
  11120. "pattern": "^#[0-9a-fA-F]{6}$"
  11121. },
  11122. {
  11123. "type": "string",
  11124. "enum": ["primary", "secondary", "accent", "success", "warning", "error", "info"]
  11125. }
  11126. ]
  11127. },
  11128. "steps": {
  11129. "description": "Maximum number of agentic iterations before forcing text-only response",
  11130. "type": "integer",
  11131. "exclusiveMinimum": 0,
  11132. "maximum": 9007199254740991
  11133. },
  11134. "maxSteps": {
  11135. "description": "@deprecated Use 'steps' field instead.",
  11136. "type": "integer",
  11137. "exclusiveMinimum": 0,
  11138. "maximum": 9007199254740991
  11139. },
  11140. "permission": {
  11141. "$ref": "#/components/schemas/PermissionConfig"
  11142. }
  11143. },
  11144. "additionalProperties": {}
  11145. },
  11146. "ProviderConfig": {
  11147. "type": "object",
  11148. "properties": {
  11149. "api": {
  11150. "type": "string"
  11151. },
  11152. "name": {
  11153. "type": "string"
  11154. },
  11155. "env": {
  11156. "type": "array",
  11157. "items": {
  11158. "type": "string"
  11159. }
  11160. },
  11161. "id": {
  11162. "type": "string"
  11163. },
  11164. "npm": {
  11165. "type": "string"
  11166. },
  11167. "whitelist": {
  11168. "type": "array",
  11169. "items": {
  11170. "type": "string"
  11171. }
  11172. },
  11173. "blacklist": {
  11174. "type": "array",
  11175. "items": {
  11176. "type": "string"
  11177. }
  11178. },
  11179. "options": {
  11180. "type": "object",
  11181. "properties": {
  11182. "apiKey": {
  11183. "type": "string"
  11184. },
  11185. "baseURL": {
  11186. "type": "string"
  11187. },
  11188. "enterpriseUrl": {
  11189. "description": "GitHub Enterprise URL for copilot authentication",
  11190. "type": "string"
  11191. },
  11192. "setCacheKey": {
  11193. "description": "Enable promptCacheKey for this provider (default false)",
  11194. "type": "boolean"
  11195. },
  11196. "timeout": {
  11197. "description": "Timeout in milliseconds for requests to this provider. Default is 300000 (5 minutes). Set to false to disable timeout.",
  11198. "anyOf": [
  11199. {
  11200. "description": "Timeout in milliseconds for requests to this provider. Default is 300000 (5 minutes). Set to false to disable timeout.",
  11201. "type": "integer",
  11202. "exclusiveMinimum": 0,
  11203. "maximum": 9007199254740991
  11204. },
  11205. {
  11206. "description": "Disable timeout for this provider entirely.",
  11207. "type": "boolean",
  11208. "const": false
  11209. }
  11210. ]
  11211. },
  11212. "chunkTimeout": {
  11213. "description": "Timeout in milliseconds between streamed SSE chunks for this provider. If no chunk arrives within this window, the request is aborted.",
  11214. "type": "integer",
  11215. "exclusiveMinimum": 0,
  11216. "maximum": 9007199254740991
  11217. }
  11218. },
  11219. "additionalProperties": {}
  11220. },
  11221. "models": {
  11222. "type": "object",
  11223. "propertyNames": {
  11224. "type": "string"
  11225. },
  11226. "additionalProperties": {
  11227. "type": "object",
  11228. "properties": {
  11229. "id": {
  11230. "type": "string"
  11231. },
  11232. "name": {
  11233. "type": "string"
  11234. },
  11235. "family": {
  11236. "type": "string"
  11237. },
  11238. "release_date": {
  11239. "type": "string"
  11240. },
  11241. "attachment": {
  11242. "type": "boolean"
  11243. },
  11244. "reasoning": {
  11245. "type": "boolean"
  11246. },
  11247. "temperature": {
  11248. "type": "boolean"
  11249. },
  11250. "tool_call": {
  11251. "type": "boolean"
  11252. },
  11253. "interleaved": {
  11254. "anyOf": [
  11255. {
  11256. "type": "boolean",
  11257. "const": true
  11258. },
  11259. {
  11260. "type": "object",
  11261. "properties": {
  11262. "field": {
  11263. "type": "string",
  11264. "enum": ["reasoning_content", "reasoning_details"]
  11265. }
  11266. },
  11267. "required": ["field"],
  11268. "additionalProperties": false
  11269. }
  11270. ]
  11271. },
  11272. "cost": {
  11273. "type": "object",
  11274. "properties": {
  11275. "input": {
  11276. "type": "number"
  11277. },
  11278. "output": {
  11279. "type": "number"
  11280. },
  11281. "cache_read": {
  11282. "type": "number"
  11283. },
  11284. "cache_write": {
  11285. "type": "number"
  11286. },
  11287. "context_over_200k": {
  11288. "type": "object",
  11289. "properties": {
  11290. "input": {
  11291. "type": "number"
  11292. },
  11293. "output": {
  11294. "type": "number"
  11295. },
  11296. "cache_read": {
  11297. "type": "number"
  11298. },
  11299. "cache_write": {
  11300. "type": "number"
  11301. }
  11302. },
  11303. "required": ["input", "output"]
  11304. }
  11305. },
  11306. "required": ["input", "output"]
  11307. },
  11308. "limit": {
  11309. "type": "object",
  11310. "properties": {
  11311. "context": {
  11312. "type": "number"
  11313. },
  11314. "input": {
  11315. "type": "number"
  11316. },
  11317. "output": {
  11318. "type": "number"
  11319. }
  11320. },
  11321. "required": ["context", "output"]
  11322. },
  11323. "modalities": {
  11324. "type": "object",
  11325. "properties": {
  11326. "input": {
  11327. "type": "array",
  11328. "items": {
  11329. "type": "string",
  11330. "enum": ["text", "audio", "image", "video", "pdf"]
  11331. }
  11332. },
  11333. "output": {
  11334. "type": "array",
  11335. "items": {
  11336. "type": "string",
  11337. "enum": ["text", "audio", "image", "video", "pdf"]
  11338. }
  11339. }
  11340. },
  11341. "required": ["input", "output"]
  11342. },
  11343. "experimental": {
  11344. "type": "boolean"
  11345. },
  11346. "status": {
  11347. "type": "string",
  11348. "enum": ["alpha", "beta", "deprecated"]
  11349. },
  11350. "provider": {
  11351. "type": "object",
  11352. "properties": {
  11353. "npm": {
  11354. "type": "string"
  11355. },
  11356. "api": {
  11357. "type": "string"
  11358. }
  11359. }
  11360. },
  11361. "options": {
  11362. "type": "object",
  11363. "propertyNames": {
  11364. "type": "string"
  11365. },
  11366. "additionalProperties": {}
  11367. },
  11368. "headers": {
  11369. "type": "object",
  11370. "propertyNames": {
  11371. "type": "string"
  11372. },
  11373. "additionalProperties": {
  11374. "type": "string"
  11375. }
  11376. },
  11377. "variants": {
  11378. "description": "Variant-specific configuration",
  11379. "type": "object",
  11380. "propertyNames": {
  11381. "type": "string"
  11382. },
  11383. "additionalProperties": {
  11384. "type": "object",
  11385. "properties": {
  11386. "disabled": {
  11387. "description": "Disable this variant for the model",
  11388. "type": "boolean"
  11389. }
  11390. },
  11391. "additionalProperties": {}
  11392. }
  11393. }
  11394. }
  11395. }
  11396. }
  11397. },
  11398. "additionalProperties": false
  11399. },
  11400. "McpLocalConfig": {
  11401. "type": "object",
  11402. "properties": {
  11403. "type": {
  11404. "description": "Type of MCP server connection",
  11405. "type": "string",
  11406. "const": "local"
  11407. },
  11408. "command": {
  11409. "description": "Command and arguments to run the MCP server",
  11410. "type": "array",
  11411. "items": {
  11412. "type": "string"
  11413. }
  11414. },
  11415. "environment": {
  11416. "description": "Environment variables to set when running the MCP server",
  11417. "type": "object",
  11418. "propertyNames": {
  11419. "type": "string"
  11420. },
  11421. "additionalProperties": {
  11422. "type": "string"
  11423. }
  11424. },
  11425. "enabled": {
  11426. "description": "Enable or disable the MCP server on startup",
  11427. "type": "boolean"
  11428. },
  11429. "timeout": {
  11430. "description": "Timeout in ms for MCP server requests. Defaults to 5000 (5 seconds) if not specified.",
  11431. "type": "integer",
  11432. "exclusiveMinimum": 0,
  11433. "maximum": 9007199254740991
  11434. }
  11435. },
  11436. "required": ["type", "command"],
  11437. "additionalProperties": false
  11438. },
  11439. "McpOAuthConfig": {
  11440. "type": "object",
  11441. "properties": {
  11442. "clientId": {
  11443. "description": "OAuth client ID. If not provided, dynamic client registration (RFC 7591) will be attempted.",
  11444. "type": "string"
  11445. },
  11446. "clientSecret": {
  11447. "description": "OAuth client secret (if required by the authorization server)",
  11448. "type": "string"
  11449. },
  11450. "scope": {
  11451. "description": "OAuth scopes to request during authorization",
  11452. "type": "string"
  11453. },
  11454. "redirectUri": {
  11455. "description": "OAuth redirect URI (default: http://127.0.0.1:19876/mcp/oauth/callback).",
  11456. "type": "string"
  11457. }
  11458. },
  11459. "additionalProperties": false
  11460. },
  11461. "McpRemoteConfig": {
  11462. "type": "object",
  11463. "properties": {
  11464. "type": {
  11465. "description": "Type of MCP server connection",
  11466. "type": "string",
  11467. "const": "remote"
  11468. },
  11469. "url": {
  11470. "description": "URL of the remote MCP server",
  11471. "type": "string"
  11472. },
  11473. "enabled": {
  11474. "description": "Enable or disable the MCP server on startup",
  11475. "type": "boolean"
  11476. },
  11477. "headers": {
  11478. "description": "Headers to send with the request",
  11479. "type": "object",
  11480. "propertyNames": {
  11481. "type": "string"
  11482. },
  11483. "additionalProperties": {
  11484. "type": "string"
  11485. }
  11486. },
  11487. "oauth": {
  11488. "description": "OAuth authentication configuration for the MCP server. Set to false to disable OAuth auto-detection.",
  11489. "anyOf": [
  11490. {
  11491. "$ref": "#/components/schemas/McpOAuthConfig"
  11492. },
  11493. {
  11494. "type": "boolean",
  11495. "const": false
  11496. }
  11497. ]
  11498. },
  11499. "timeout": {
  11500. "description": "Timeout in ms for MCP server requests. Defaults to 5000 (5 seconds) if not specified.",
  11501. "type": "integer",
  11502. "exclusiveMinimum": 0,
  11503. "maximum": 9007199254740991
  11504. }
  11505. },
  11506. "required": ["type", "url"],
  11507. "additionalProperties": false
  11508. },
  11509. "LayoutConfig": {
  11510. "description": "@deprecated Always uses stretch layout.",
  11511. "type": "string",
  11512. "enum": ["auto", "stretch"]
  11513. },
  11514. "Config": {
  11515. "type": "object",
  11516. "properties": {
  11517. "$schema": {
  11518. "description": "JSON schema reference for configuration validation",
  11519. "type": "string"
  11520. },
  11521. "logLevel": {
  11522. "$ref": "#/components/schemas/LogLevel"
  11523. },
  11524. "server": {
  11525. "$ref": "#/components/schemas/ServerConfig"
  11526. },
  11527. "command": {
  11528. "description": "Command configuration, see https://opencode.ai/docs/commands",
  11529. "type": "object",
  11530. "propertyNames": {
  11531. "type": "string"
  11532. },
  11533. "additionalProperties": {
  11534. "type": "object",
  11535. "properties": {
  11536. "template": {
  11537. "type": "string"
  11538. },
  11539. "description": {
  11540. "type": "string"
  11541. },
  11542. "agent": {
  11543. "type": "string"
  11544. },
  11545. "model": {
  11546. "type": "string"
  11547. },
  11548. "subtask": {
  11549. "type": "boolean"
  11550. }
  11551. },
  11552. "required": ["template"]
  11553. }
  11554. },
  11555. "skills": {
  11556. "description": "Additional skill folder paths",
  11557. "type": "object",
  11558. "properties": {
  11559. "paths": {
  11560. "description": "Additional paths to skill folders",
  11561. "type": "array",
  11562. "items": {
  11563. "type": "string"
  11564. }
  11565. },
  11566. "urls": {
  11567. "description": "URLs to fetch skills from (e.g., https://example.com/.well-known/skills/)",
  11568. "type": "array",
  11569. "items": {
  11570. "type": "string"
  11571. }
  11572. }
  11573. }
  11574. },
  11575. "watcher": {
  11576. "type": "object",
  11577. "properties": {
  11578. "ignore": {
  11579. "type": "array",
  11580. "items": {
  11581. "type": "string"
  11582. }
  11583. }
  11584. }
  11585. },
  11586. "snapshot": {
  11587. "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.",
  11588. "type": "boolean"
  11589. },
  11590. "plugin": {
  11591. "type": "array",
  11592. "items": {
  11593. "anyOf": [
  11594. {
  11595. "type": "string"
  11596. },
  11597. {
  11598. "type": "array",
  11599. "prefixItems": [
  11600. {
  11601. "type": "string"
  11602. },
  11603. {
  11604. "type": "object",
  11605. "propertyNames": {
  11606. "type": "string"
  11607. },
  11608. "additionalProperties": {}
  11609. }
  11610. ]
  11611. }
  11612. ]
  11613. }
  11614. },
  11615. "share": {
  11616. "description": "Control sharing behavior:'manual' allows manual sharing via commands, 'auto' enables automatic sharing, 'disabled' disables all sharing",
  11617. "type": "string",
  11618. "enum": ["manual", "auto", "disabled"]
  11619. },
  11620. "autoshare": {
  11621. "description": "@deprecated Use 'share' field instead. Share newly created sessions automatically",
  11622. "type": "boolean"
  11623. },
  11624. "autoupdate": {
  11625. "description": "Automatically update to the latest version. Set to true to auto-update, false to disable, or 'notify' to show update notifications",
  11626. "anyOf": [
  11627. {
  11628. "type": "boolean"
  11629. },
  11630. {
  11631. "type": "string",
  11632. "const": "notify"
  11633. }
  11634. ]
  11635. },
  11636. "disabled_providers": {
  11637. "description": "Disable providers that are loaded automatically",
  11638. "type": "array",
  11639. "items": {
  11640. "type": "string"
  11641. }
  11642. },
  11643. "enabled_providers": {
  11644. "description": "When set, ONLY these providers will be enabled. All other providers will be ignored",
  11645. "type": "array",
  11646. "items": {
  11647. "type": "string"
  11648. }
  11649. },
  11650. "model": {
  11651. "description": "Model to use in the format of provider/model, eg anthropic/claude-2",
  11652. "type": "string"
  11653. },
  11654. "small_model": {
  11655. "description": "Small model to use for tasks like title generation in the format of provider/model",
  11656. "type": "string"
  11657. },
  11658. "default_agent": {
  11659. "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.",
  11660. "type": "string"
  11661. },
  11662. "username": {
  11663. "description": "Custom username to display in conversations instead of system username",
  11664. "type": "string"
  11665. },
  11666. "mode": {
  11667. "description": "@deprecated Use `agent` field instead.",
  11668. "type": "object",
  11669. "properties": {
  11670. "build": {
  11671. "$ref": "#/components/schemas/AgentConfig"
  11672. },
  11673. "plan": {
  11674. "$ref": "#/components/schemas/AgentConfig"
  11675. }
  11676. },
  11677. "additionalProperties": {
  11678. "$ref": "#/components/schemas/AgentConfig"
  11679. }
  11680. },
  11681. "agent": {
  11682. "description": "Agent configuration, see https://opencode.ai/docs/agents",
  11683. "type": "object",
  11684. "properties": {
  11685. "plan": {
  11686. "$ref": "#/components/schemas/AgentConfig"
  11687. },
  11688. "build": {
  11689. "$ref": "#/components/schemas/AgentConfig"
  11690. },
  11691. "general": {
  11692. "$ref": "#/components/schemas/AgentConfig"
  11693. },
  11694. "explore": {
  11695. "$ref": "#/components/schemas/AgentConfig"
  11696. },
  11697. "title": {
  11698. "$ref": "#/components/schemas/AgentConfig"
  11699. },
  11700. "summary": {
  11701. "$ref": "#/components/schemas/AgentConfig"
  11702. },
  11703. "compaction": {
  11704. "$ref": "#/components/schemas/AgentConfig"
  11705. }
  11706. },
  11707. "additionalProperties": {
  11708. "$ref": "#/components/schemas/AgentConfig"
  11709. }
  11710. },
  11711. "provider": {
  11712. "description": "Custom provider configurations and model overrides",
  11713. "type": "object",
  11714. "propertyNames": {
  11715. "type": "string"
  11716. },
  11717. "additionalProperties": {
  11718. "$ref": "#/components/schemas/ProviderConfig"
  11719. }
  11720. },
  11721. "mcp": {
  11722. "description": "MCP (Model Context Protocol) server configurations",
  11723. "type": "object",
  11724. "propertyNames": {
  11725. "type": "string"
  11726. },
  11727. "additionalProperties": {
  11728. "anyOf": [
  11729. {
  11730. "anyOf": [
  11731. {
  11732. "$ref": "#/components/schemas/McpLocalConfig"
  11733. },
  11734. {
  11735. "$ref": "#/components/schemas/McpRemoteConfig"
  11736. }
  11737. ]
  11738. },
  11739. {
  11740. "type": "object",
  11741. "properties": {
  11742. "enabled": {
  11743. "type": "boolean"
  11744. }
  11745. },
  11746. "required": ["enabled"],
  11747. "additionalProperties": false
  11748. }
  11749. ]
  11750. }
  11751. },
  11752. "formatter": {
  11753. "anyOf": [
  11754. {
  11755. "type": "boolean"
  11756. },
  11757. {
  11758. "type": "object",
  11759. "propertyNames": {
  11760. "type": "string"
  11761. },
  11762. "additionalProperties": {
  11763. "type": "object",
  11764. "properties": {
  11765. "disabled": {
  11766. "type": "boolean"
  11767. },
  11768. "command": {
  11769. "type": "array",
  11770. "items": {
  11771. "type": "string"
  11772. }
  11773. },
  11774. "environment": {
  11775. "type": "object",
  11776. "propertyNames": {
  11777. "type": "string"
  11778. },
  11779. "additionalProperties": {
  11780. "type": "string"
  11781. }
  11782. },
  11783. "extensions": {
  11784. "type": "array",
  11785. "items": {
  11786. "type": "string"
  11787. }
  11788. }
  11789. }
  11790. }
  11791. }
  11792. ]
  11793. },
  11794. "lsp": {
  11795. "anyOf": [
  11796. {
  11797. "type": "boolean"
  11798. },
  11799. {
  11800. "type": "object",
  11801. "propertyNames": {
  11802. "type": "string"
  11803. },
  11804. "additionalProperties": {
  11805. "anyOf": [
  11806. {
  11807. "type": "object",
  11808. "properties": {
  11809. "disabled": {
  11810. "type": "boolean",
  11811. "const": true
  11812. }
  11813. },
  11814. "required": ["disabled"]
  11815. },
  11816. {
  11817. "type": "object",
  11818. "properties": {
  11819. "command": {
  11820. "type": "array",
  11821. "items": {
  11822. "type": "string"
  11823. }
  11824. },
  11825. "extensions": {
  11826. "type": "array",
  11827. "items": {
  11828. "type": "string"
  11829. }
  11830. },
  11831. "disabled": {
  11832. "type": "boolean"
  11833. },
  11834. "env": {
  11835. "type": "object",
  11836. "propertyNames": {
  11837. "type": "string"
  11838. },
  11839. "additionalProperties": {
  11840. "type": "string"
  11841. }
  11842. },
  11843. "initialization": {
  11844. "type": "object",
  11845. "propertyNames": {
  11846. "type": "string"
  11847. },
  11848. "additionalProperties": {}
  11849. }
  11850. },
  11851. "required": ["command"]
  11852. }
  11853. ]
  11854. }
  11855. }
  11856. ]
  11857. },
  11858. "instructions": {
  11859. "description": "Additional instruction files or patterns to include",
  11860. "type": "array",
  11861. "items": {
  11862. "type": "string"
  11863. }
  11864. },
  11865. "layout": {
  11866. "$ref": "#/components/schemas/LayoutConfig"
  11867. },
  11868. "permission": {
  11869. "$ref": "#/components/schemas/PermissionConfig"
  11870. },
  11871. "tools": {
  11872. "type": "object",
  11873. "propertyNames": {
  11874. "type": "string"
  11875. },
  11876. "additionalProperties": {
  11877. "type": "boolean"
  11878. }
  11879. },
  11880. "enterprise": {
  11881. "type": "object",
  11882. "properties": {
  11883. "url": {
  11884. "description": "Enterprise URL",
  11885. "type": "string"
  11886. }
  11887. }
  11888. },
  11889. "compaction": {
  11890. "type": "object",
  11891. "properties": {
  11892. "auto": {
  11893. "description": "Enable automatic compaction when context is full (default: true)",
  11894. "type": "boolean"
  11895. },
  11896. "prune": {
  11897. "description": "Enable pruning of old tool outputs (default: true)",
  11898. "type": "boolean"
  11899. },
  11900. "reserved": {
  11901. "description": "Token buffer for compaction. Leaves enough window to avoid overflow during compaction.",
  11902. "type": "integer",
  11903. "minimum": 0,
  11904. "maximum": 9007199254740991
  11905. }
  11906. }
  11907. },
  11908. "experimental": {
  11909. "type": "object",
  11910. "properties": {
  11911. "disable_paste_summary": {
  11912. "type": "boolean"
  11913. },
  11914. "batch_tool": {
  11915. "description": "Enable the batch tool",
  11916. "type": "boolean"
  11917. },
  11918. "openTelemetry": {
  11919. "description": "Enable OpenTelemetry spans for AI SDK calls (using the 'experimental_telemetry' flag)",
  11920. "type": "boolean"
  11921. },
  11922. "primary_tools": {
  11923. "description": "Tools that should only be available to primary agents.",
  11924. "type": "array",
  11925. "items": {
  11926. "type": "string"
  11927. }
  11928. },
  11929. "continue_loop_on_deny": {
  11930. "description": "Continue the agent loop when a tool call is denied",
  11931. "type": "boolean"
  11932. },
  11933. "mcp_timeout": {
  11934. "description": "Timeout in milliseconds for model context protocol (MCP) requests",
  11935. "type": "integer",
  11936. "exclusiveMinimum": 0,
  11937. "maximum": 9007199254740991
  11938. }
  11939. }
  11940. }
  11941. },
  11942. "additionalProperties": false
  11943. },
  11944. "BadRequestError": {
  11945. "type": "object",
  11946. "properties": {
  11947. "data": {},
  11948. "errors": {
  11949. "type": "array",
  11950. "items": {
  11951. "type": "object",
  11952. "propertyNames": {
  11953. "type": "string"
  11954. },
  11955. "additionalProperties": {}
  11956. }
  11957. },
  11958. "success": {
  11959. "type": "boolean",
  11960. "const": false
  11961. }
  11962. },
  11963. "required": ["data", "errors", "success"]
  11964. },
  11965. "OAuth": {
  11966. "type": "object",
  11967. "properties": {
  11968. "type": {
  11969. "type": "string",
  11970. "const": "oauth"
  11971. },
  11972. "refresh": {
  11973. "type": "string"
  11974. },
  11975. "access": {
  11976. "type": "string"
  11977. },
  11978. "expires": {
  11979. "type": "number"
  11980. },
  11981. "accountId": {
  11982. "type": "string"
  11983. },
  11984. "enterpriseUrl": {
  11985. "type": "string"
  11986. }
  11987. },
  11988. "required": ["type", "refresh", "access", "expires"]
  11989. },
  11990. "ApiAuth": {
  11991. "type": "object",
  11992. "properties": {
  11993. "type": {
  11994. "type": "string",
  11995. "const": "api"
  11996. },
  11997. "key": {
  11998. "type": "string"
  11999. },
  12000. "metadata": {
  12001. "type": "object",
  12002. "propertyNames": {
  12003. "type": "string"
  12004. },
  12005. "additionalProperties": {
  12006. "type": "string"
  12007. }
  12008. }
  12009. },
  12010. "required": ["type", "key"]
  12011. },
  12012. "WellKnownAuth": {
  12013. "type": "object",
  12014. "properties": {
  12015. "type": {
  12016. "type": "string",
  12017. "const": "wellknown"
  12018. },
  12019. "key": {
  12020. "type": "string"
  12021. },
  12022. "token": {
  12023. "type": "string"
  12024. }
  12025. },
  12026. "required": ["type", "key", "token"]
  12027. },
  12028. "Auth": {
  12029. "anyOf": [
  12030. {
  12031. "$ref": "#/components/schemas/OAuth"
  12032. },
  12033. {
  12034. "$ref": "#/components/schemas/ApiAuth"
  12035. },
  12036. {
  12037. "$ref": "#/components/schemas/WellKnownAuth"
  12038. }
  12039. ]
  12040. },
  12041. "Workspace": {
  12042. "type": "object",
  12043. "properties": {
  12044. "id": {
  12045. "type": "string",
  12046. "pattern": "^wrk.*"
  12047. },
  12048. "type": {
  12049. "type": "string"
  12050. },
  12051. "name": {
  12052. "type": "string"
  12053. },
  12054. "branch": {
  12055. "anyOf": [
  12056. {
  12057. "type": "string"
  12058. },
  12059. {
  12060. "type": "null"
  12061. }
  12062. ]
  12063. },
  12064. "directory": {
  12065. "anyOf": [
  12066. {
  12067. "type": "string"
  12068. },
  12069. {
  12070. "type": "null"
  12071. }
  12072. ]
  12073. },
  12074. "extra": {
  12075. "anyOf": [
  12076. {},
  12077. {
  12078. "type": "null"
  12079. }
  12080. ]
  12081. },
  12082. "projectID": {
  12083. "type": "string"
  12084. }
  12085. },
  12086. "required": ["id", "type", "name", "branch", "directory", "extra", "projectID"]
  12087. },
  12088. "NotFoundError": {
  12089. "type": "object",
  12090. "properties": {
  12091. "name": {
  12092. "type": "string",
  12093. "const": "NotFoundError"
  12094. },
  12095. "data": {
  12096. "type": "object",
  12097. "properties": {
  12098. "message": {
  12099. "type": "string"
  12100. }
  12101. },
  12102. "required": ["message"]
  12103. }
  12104. },
  12105. "required": ["name", "data"]
  12106. },
  12107. "Model": {
  12108. "type": "object",
  12109. "properties": {
  12110. "id": {
  12111. "type": "string"
  12112. },
  12113. "providerID": {
  12114. "type": "string"
  12115. },
  12116. "api": {
  12117. "type": "object",
  12118. "properties": {
  12119. "id": {
  12120. "type": "string"
  12121. },
  12122. "url": {
  12123. "type": "string"
  12124. },
  12125. "npm": {
  12126. "type": "string"
  12127. }
  12128. },
  12129. "required": ["id", "url", "npm"]
  12130. },
  12131. "name": {
  12132. "type": "string"
  12133. },
  12134. "family": {
  12135. "type": "string"
  12136. },
  12137. "capabilities": {
  12138. "type": "object",
  12139. "properties": {
  12140. "temperature": {
  12141. "type": "boolean"
  12142. },
  12143. "reasoning": {
  12144. "type": "boolean"
  12145. },
  12146. "attachment": {
  12147. "type": "boolean"
  12148. },
  12149. "toolcall": {
  12150. "type": "boolean"
  12151. },
  12152. "input": {
  12153. "type": "object",
  12154. "properties": {
  12155. "text": {
  12156. "type": "boolean"
  12157. },
  12158. "audio": {
  12159. "type": "boolean"
  12160. },
  12161. "image": {
  12162. "type": "boolean"
  12163. },
  12164. "video": {
  12165. "type": "boolean"
  12166. },
  12167. "pdf": {
  12168. "type": "boolean"
  12169. }
  12170. },
  12171. "required": ["text", "audio", "image", "video", "pdf"]
  12172. },
  12173. "output": {
  12174. "type": "object",
  12175. "properties": {
  12176. "text": {
  12177. "type": "boolean"
  12178. },
  12179. "audio": {
  12180. "type": "boolean"
  12181. },
  12182. "image": {
  12183. "type": "boolean"
  12184. },
  12185. "video": {
  12186. "type": "boolean"
  12187. },
  12188. "pdf": {
  12189. "type": "boolean"
  12190. }
  12191. },
  12192. "required": ["text", "audio", "image", "video", "pdf"]
  12193. },
  12194. "interleaved": {
  12195. "anyOf": [
  12196. {
  12197. "type": "boolean"
  12198. },
  12199. {
  12200. "type": "object",
  12201. "properties": {
  12202. "field": {
  12203. "type": "string",
  12204. "enum": ["reasoning_content", "reasoning_details"]
  12205. }
  12206. },
  12207. "required": ["field"]
  12208. }
  12209. ]
  12210. }
  12211. },
  12212. "required": ["temperature", "reasoning", "attachment", "toolcall", "input", "output", "interleaved"]
  12213. },
  12214. "cost": {
  12215. "type": "object",
  12216. "properties": {
  12217. "input": {
  12218. "type": "number"
  12219. },
  12220. "output": {
  12221. "type": "number"
  12222. },
  12223. "cache": {
  12224. "type": "object",
  12225. "properties": {
  12226. "read": {
  12227. "type": "number"
  12228. },
  12229. "write": {
  12230. "type": "number"
  12231. }
  12232. },
  12233. "required": ["read", "write"]
  12234. },
  12235. "experimentalOver200K": {
  12236. "type": "object",
  12237. "properties": {
  12238. "input": {
  12239. "type": "number"
  12240. },
  12241. "output": {
  12242. "type": "number"
  12243. },
  12244. "cache": {
  12245. "type": "object",
  12246. "properties": {
  12247. "read": {
  12248. "type": "number"
  12249. },
  12250. "write": {
  12251. "type": "number"
  12252. }
  12253. },
  12254. "required": ["read", "write"]
  12255. }
  12256. },
  12257. "required": ["input", "output", "cache"]
  12258. }
  12259. },
  12260. "required": ["input", "output", "cache"]
  12261. },
  12262. "limit": {
  12263. "type": "object",
  12264. "properties": {
  12265. "context": {
  12266. "type": "number"
  12267. },
  12268. "input": {
  12269. "type": "number"
  12270. },
  12271. "output": {
  12272. "type": "number"
  12273. }
  12274. },
  12275. "required": ["context", "output"]
  12276. },
  12277. "status": {
  12278. "type": "string",
  12279. "enum": ["alpha", "beta", "deprecated", "active"]
  12280. },
  12281. "options": {
  12282. "type": "object",
  12283. "propertyNames": {
  12284. "type": "string"
  12285. },
  12286. "additionalProperties": {}
  12287. },
  12288. "headers": {
  12289. "type": "object",
  12290. "propertyNames": {
  12291. "type": "string"
  12292. },
  12293. "additionalProperties": {
  12294. "type": "string"
  12295. }
  12296. },
  12297. "release_date": {
  12298. "type": "string"
  12299. },
  12300. "variants": {
  12301. "type": "object",
  12302. "propertyNames": {
  12303. "type": "string"
  12304. },
  12305. "additionalProperties": {
  12306. "type": "object",
  12307. "propertyNames": {
  12308. "type": "string"
  12309. },
  12310. "additionalProperties": {}
  12311. }
  12312. }
  12313. },
  12314. "required": [
  12315. "id",
  12316. "providerID",
  12317. "api",
  12318. "name",
  12319. "capabilities",
  12320. "cost",
  12321. "limit",
  12322. "status",
  12323. "options",
  12324. "headers",
  12325. "release_date"
  12326. ]
  12327. },
  12328. "Provider": {
  12329. "type": "object",
  12330. "properties": {
  12331. "id": {
  12332. "type": "string"
  12333. },
  12334. "name": {
  12335. "type": "string"
  12336. },
  12337. "source": {
  12338. "type": "string",
  12339. "enum": ["env", "config", "custom", "api"]
  12340. },
  12341. "env": {
  12342. "type": "array",
  12343. "items": {
  12344. "type": "string"
  12345. }
  12346. },
  12347. "key": {
  12348. "type": "string"
  12349. },
  12350. "options": {
  12351. "type": "object",
  12352. "propertyNames": {
  12353. "type": "string"
  12354. },
  12355. "additionalProperties": {}
  12356. },
  12357. "models": {
  12358. "type": "object",
  12359. "propertyNames": {
  12360. "type": "string"
  12361. },
  12362. "additionalProperties": {
  12363. "$ref": "#/components/schemas/Model"
  12364. }
  12365. }
  12366. },
  12367. "required": ["id", "name", "source", "env", "options", "models"]
  12368. },
  12369. "ToolIDs": {
  12370. "type": "array",
  12371. "items": {
  12372. "type": "string"
  12373. }
  12374. },
  12375. "ToolListItem": {
  12376. "type": "object",
  12377. "properties": {
  12378. "id": {
  12379. "type": "string"
  12380. },
  12381. "description": {
  12382. "type": "string"
  12383. },
  12384. "parameters": {}
  12385. },
  12386. "required": ["id", "description", "parameters"]
  12387. },
  12388. "ToolList": {
  12389. "type": "array",
  12390. "items": {
  12391. "$ref": "#/components/schemas/ToolListItem"
  12392. }
  12393. },
  12394. "Worktree": {
  12395. "type": "object",
  12396. "properties": {
  12397. "name": {
  12398. "type": "string"
  12399. },
  12400. "branch": {
  12401. "type": "string"
  12402. },
  12403. "directory": {
  12404. "type": "string"
  12405. }
  12406. },
  12407. "required": ["name", "branch", "directory"]
  12408. },
  12409. "WorktreeCreateInput": {
  12410. "type": "object",
  12411. "properties": {
  12412. "name": {
  12413. "type": "string"
  12414. },
  12415. "startCommand": {
  12416. "description": "Additional startup script to run after the project's start command",
  12417. "type": "string"
  12418. }
  12419. }
  12420. },
  12421. "WorktreeRemoveInput": {
  12422. "type": "object",
  12423. "properties": {
  12424. "directory": {
  12425. "type": "string"
  12426. }
  12427. },
  12428. "required": ["directory"]
  12429. },
  12430. "WorktreeResetInput": {
  12431. "type": "object",
  12432. "properties": {
  12433. "directory": {
  12434. "type": "string"
  12435. }
  12436. },
  12437. "required": ["directory"]
  12438. },
  12439. "ProjectSummary": {
  12440. "type": "object",
  12441. "properties": {
  12442. "id": {
  12443. "type": "string"
  12444. },
  12445. "name": {
  12446. "type": "string"
  12447. },
  12448. "worktree": {
  12449. "type": "string"
  12450. }
  12451. },
  12452. "required": ["id", "worktree"]
  12453. },
  12454. "GlobalSession": {
  12455. "type": "object",
  12456. "properties": {
  12457. "id": {
  12458. "type": "string",
  12459. "pattern": "^ses.*"
  12460. },
  12461. "slug": {
  12462. "type": "string"
  12463. },
  12464. "projectID": {
  12465. "type": "string"
  12466. },
  12467. "workspaceID": {
  12468. "type": "string",
  12469. "pattern": "^wrk.*"
  12470. },
  12471. "directory": {
  12472. "type": "string"
  12473. },
  12474. "parentID": {
  12475. "type": "string",
  12476. "pattern": "^ses.*"
  12477. },
  12478. "summary": {
  12479. "type": "object",
  12480. "properties": {
  12481. "additions": {
  12482. "type": "number"
  12483. },
  12484. "deletions": {
  12485. "type": "number"
  12486. },
  12487. "files": {
  12488. "type": "number"
  12489. },
  12490. "diffs": {
  12491. "type": "array",
  12492. "items": {
  12493. "$ref": "#/components/schemas/SnapshotFileDiff"
  12494. }
  12495. }
  12496. },
  12497. "required": ["additions", "deletions", "files"]
  12498. },
  12499. "share": {
  12500. "type": "object",
  12501. "properties": {
  12502. "url": {
  12503. "type": "string"
  12504. }
  12505. },
  12506. "required": ["url"]
  12507. },
  12508. "title": {
  12509. "type": "string"
  12510. },
  12511. "version": {
  12512. "type": "string"
  12513. },
  12514. "time": {
  12515. "type": "object",
  12516. "properties": {
  12517. "created": {
  12518. "type": "number"
  12519. },
  12520. "updated": {
  12521. "type": "number"
  12522. },
  12523. "compacting": {
  12524. "type": "number"
  12525. },
  12526. "archived": {
  12527. "type": "number"
  12528. }
  12529. },
  12530. "required": ["created", "updated"]
  12531. },
  12532. "permission": {
  12533. "$ref": "#/components/schemas/PermissionRuleset"
  12534. },
  12535. "revert": {
  12536. "type": "object",
  12537. "properties": {
  12538. "messageID": {
  12539. "type": "string",
  12540. "pattern": "^msg.*"
  12541. },
  12542. "partID": {
  12543. "type": "string",
  12544. "pattern": "^prt.*"
  12545. },
  12546. "snapshot": {
  12547. "type": "string"
  12548. },
  12549. "diff": {
  12550. "type": "string"
  12551. }
  12552. },
  12553. "required": ["messageID"]
  12554. },
  12555. "project": {
  12556. "anyOf": [
  12557. {
  12558. "$ref": "#/components/schemas/ProjectSummary"
  12559. },
  12560. {
  12561. "type": "null"
  12562. }
  12563. ]
  12564. }
  12565. },
  12566. "required": ["id", "slug", "projectID", "directory", "title", "version", "time", "project"]
  12567. },
  12568. "McpResource": {
  12569. "type": "object",
  12570. "properties": {
  12571. "name": {
  12572. "type": "string"
  12573. },
  12574. "uri": {
  12575. "type": "string"
  12576. },
  12577. "description": {
  12578. "type": "string"
  12579. },
  12580. "mimeType": {
  12581. "type": "string"
  12582. },
  12583. "client": {
  12584. "type": "string"
  12585. }
  12586. },
  12587. "required": ["name", "uri", "client"]
  12588. },
  12589. "TextPartInput": {
  12590. "type": "object",
  12591. "properties": {
  12592. "id": {
  12593. "type": "string",
  12594. "pattern": "^prt.*"
  12595. },
  12596. "type": {
  12597. "type": "string",
  12598. "const": "text"
  12599. },
  12600. "text": {
  12601. "type": "string"
  12602. },
  12603. "synthetic": {
  12604. "type": "boolean"
  12605. },
  12606. "ignored": {
  12607. "type": "boolean"
  12608. },
  12609. "time": {
  12610. "type": "object",
  12611. "properties": {
  12612. "start": {
  12613. "type": "number"
  12614. },
  12615. "end": {
  12616. "type": "number"
  12617. }
  12618. },
  12619. "required": ["start"]
  12620. },
  12621. "metadata": {
  12622. "type": "object",
  12623. "propertyNames": {
  12624. "type": "string"
  12625. },
  12626. "additionalProperties": {}
  12627. }
  12628. },
  12629. "required": ["type", "text"]
  12630. },
  12631. "FilePartInput": {
  12632. "type": "object",
  12633. "properties": {
  12634. "id": {
  12635. "type": "string",
  12636. "pattern": "^prt.*"
  12637. },
  12638. "type": {
  12639. "type": "string",
  12640. "const": "file"
  12641. },
  12642. "mime": {
  12643. "type": "string"
  12644. },
  12645. "filename": {
  12646. "type": "string"
  12647. },
  12648. "url": {
  12649. "type": "string"
  12650. },
  12651. "source": {
  12652. "$ref": "#/components/schemas/FilePartSource"
  12653. }
  12654. },
  12655. "required": ["type", "mime", "url"]
  12656. },
  12657. "AgentPartInput": {
  12658. "type": "object",
  12659. "properties": {
  12660. "id": {
  12661. "type": "string",
  12662. "pattern": "^prt.*"
  12663. },
  12664. "type": {
  12665. "type": "string",
  12666. "const": "agent"
  12667. },
  12668. "name": {
  12669. "type": "string"
  12670. },
  12671. "source": {
  12672. "type": "object",
  12673. "properties": {
  12674. "value": {
  12675. "type": "string"
  12676. },
  12677. "start": {
  12678. "type": "integer",
  12679. "minimum": -9007199254740991,
  12680. "maximum": 9007199254740991
  12681. },
  12682. "end": {
  12683. "type": "integer",
  12684. "minimum": -9007199254740991,
  12685. "maximum": 9007199254740991
  12686. }
  12687. },
  12688. "required": ["value", "start", "end"]
  12689. }
  12690. },
  12691. "required": ["type", "name"]
  12692. },
  12693. "SubtaskPartInput": {
  12694. "type": "object",
  12695. "properties": {
  12696. "id": {
  12697. "type": "string",
  12698. "pattern": "^prt.*"
  12699. },
  12700. "type": {
  12701. "type": "string",
  12702. "const": "subtask"
  12703. },
  12704. "prompt": {
  12705. "type": "string"
  12706. },
  12707. "description": {
  12708. "type": "string"
  12709. },
  12710. "agent": {
  12711. "type": "string"
  12712. },
  12713. "model": {
  12714. "type": "object",
  12715. "properties": {
  12716. "providerID": {
  12717. "type": "string"
  12718. },
  12719. "modelID": {
  12720. "type": "string"
  12721. }
  12722. },
  12723. "required": ["providerID", "modelID"]
  12724. },
  12725. "command": {
  12726. "type": "string"
  12727. }
  12728. },
  12729. "required": ["type", "prompt", "description", "agent"]
  12730. },
  12731. "ProviderAuthMethod": {
  12732. "type": "object",
  12733. "properties": {
  12734. "type": {
  12735. "type": "string",
  12736. "enum": ["oauth", "api"]
  12737. },
  12738. "label": {
  12739. "type": "string"
  12740. },
  12741. "prompts": {
  12742. "type": "array",
  12743. "items": {
  12744. "anyOf": [
  12745. {
  12746. "type": "object",
  12747. "properties": {
  12748. "type": {
  12749. "type": "string",
  12750. "const": "text"
  12751. },
  12752. "key": {
  12753. "type": "string"
  12754. },
  12755. "message": {
  12756. "type": "string"
  12757. },
  12758. "placeholder": {
  12759. "type": "string"
  12760. },
  12761. "when": {
  12762. "type": "object",
  12763. "properties": {
  12764. "key": {
  12765. "type": "string"
  12766. },
  12767. "op": {
  12768. "type": "string",
  12769. "enum": ["eq", "neq"]
  12770. },
  12771. "value": {
  12772. "type": "string"
  12773. }
  12774. },
  12775. "required": ["key", "op", "value"]
  12776. }
  12777. },
  12778. "required": ["type", "key", "message"]
  12779. },
  12780. {
  12781. "type": "object",
  12782. "properties": {
  12783. "type": {
  12784. "type": "string",
  12785. "const": "select"
  12786. },
  12787. "key": {
  12788. "type": "string"
  12789. },
  12790. "message": {
  12791. "type": "string"
  12792. },
  12793. "options": {
  12794. "type": "array",
  12795. "items": {
  12796. "type": "object",
  12797. "properties": {
  12798. "label": {
  12799. "type": "string"
  12800. },
  12801. "value": {
  12802. "type": "string"
  12803. },
  12804. "hint": {
  12805. "type": "string"
  12806. }
  12807. },
  12808. "required": ["label", "value"]
  12809. }
  12810. },
  12811. "when": {
  12812. "type": "object",
  12813. "properties": {
  12814. "key": {
  12815. "type": "string"
  12816. },
  12817. "op": {
  12818. "type": "string",
  12819. "enum": ["eq", "neq"]
  12820. },
  12821. "value": {
  12822. "type": "string"
  12823. }
  12824. },
  12825. "required": ["key", "op", "value"]
  12826. }
  12827. },
  12828. "required": ["type", "key", "message", "options"]
  12829. }
  12830. ]
  12831. }
  12832. }
  12833. },
  12834. "required": ["type", "label"]
  12835. },
  12836. "ProviderAuthAuthorization": {
  12837. "type": "object",
  12838. "properties": {
  12839. "url": {
  12840. "type": "string"
  12841. },
  12842. "method": {
  12843. "type": "string",
  12844. "enum": ["auto", "code"]
  12845. },
  12846. "instructions": {
  12847. "type": "string"
  12848. }
  12849. },
  12850. "required": ["url", "method", "instructions"]
  12851. },
  12852. "Symbol": {
  12853. "type": "object",
  12854. "properties": {
  12855. "name": {
  12856. "type": "string"
  12857. },
  12858. "kind": {
  12859. "type": "number"
  12860. },
  12861. "location": {
  12862. "type": "object",
  12863. "properties": {
  12864. "uri": {
  12865. "type": "string"
  12866. },
  12867. "range": {
  12868. "$ref": "#/components/schemas/Range"
  12869. }
  12870. },
  12871. "required": ["uri", "range"]
  12872. }
  12873. },
  12874. "required": ["name", "kind", "location"]
  12875. },
  12876. "FileNode": {
  12877. "type": "object",
  12878. "properties": {
  12879. "name": {
  12880. "type": "string"
  12881. },
  12882. "path": {
  12883. "type": "string"
  12884. },
  12885. "absolute": {
  12886. "type": "string"
  12887. },
  12888. "type": {
  12889. "type": "string",
  12890. "enum": ["file", "directory"]
  12891. },
  12892. "ignored": {
  12893. "type": "boolean"
  12894. }
  12895. },
  12896. "required": ["name", "path", "absolute", "type", "ignored"]
  12897. },
  12898. "FileContent": {
  12899. "type": "object",
  12900. "properties": {
  12901. "type": {
  12902. "type": "string",
  12903. "enum": ["text", "binary"]
  12904. },
  12905. "content": {
  12906. "type": "string"
  12907. },
  12908. "diff": {
  12909. "type": "string"
  12910. },
  12911. "patch": {
  12912. "type": "object",
  12913. "properties": {
  12914. "oldFileName": {
  12915. "type": "string"
  12916. },
  12917. "newFileName": {
  12918. "type": "string"
  12919. },
  12920. "oldHeader": {
  12921. "type": "string"
  12922. },
  12923. "newHeader": {
  12924. "type": "string"
  12925. },
  12926. "hunks": {
  12927. "type": "array",
  12928. "items": {
  12929. "type": "object",
  12930. "properties": {
  12931. "oldStart": {
  12932. "type": "number"
  12933. },
  12934. "oldLines": {
  12935. "type": "number"
  12936. },
  12937. "newStart": {
  12938. "type": "number"
  12939. },
  12940. "newLines": {
  12941. "type": "number"
  12942. },
  12943. "lines": {
  12944. "type": "array",
  12945. "items": {
  12946. "type": "string"
  12947. }
  12948. }
  12949. },
  12950. "required": ["oldStart", "oldLines", "newStart", "newLines", "lines"]
  12951. }
  12952. },
  12953. "index": {
  12954. "type": "string"
  12955. }
  12956. },
  12957. "required": ["oldFileName", "newFileName", "hunks"]
  12958. },
  12959. "encoding": {
  12960. "type": "string",
  12961. "const": "base64"
  12962. },
  12963. "mimeType": {
  12964. "type": "string"
  12965. }
  12966. },
  12967. "required": ["type", "content"]
  12968. },
  12969. "File": {
  12970. "type": "object",
  12971. "properties": {
  12972. "path": {
  12973. "type": "string"
  12974. },
  12975. "added": {
  12976. "type": "integer",
  12977. "minimum": -9007199254740991,
  12978. "maximum": 9007199254740991
  12979. },
  12980. "removed": {
  12981. "type": "integer",
  12982. "minimum": -9007199254740991,
  12983. "maximum": 9007199254740991
  12984. },
  12985. "status": {
  12986. "type": "string",
  12987. "enum": ["added", "deleted", "modified"]
  12988. }
  12989. },
  12990. "required": ["path", "added", "removed", "status"]
  12991. },
  12992. "Event": {
  12993. "anyOf": [
  12994. {
  12995. "$ref": "#/components/schemas/Event.project.updated"
  12996. },
  12997. {
  12998. "$ref": "#/components/schemas/Event.server.instance.disposed"
  12999. },
  13000. {
  13001. "$ref": "#/components/schemas/Event.server.connected"
  13002. },
  13003. {
  13004. "$ref": "#/components/schemas/Event.global.disposed"
  13005. },
  13006. {
  13007. "$ref": "#/components/schemas/Event.file.edited"
  13008. },
  13009. {
  13010. "$ref": "#/components/schemas/Event.file.watcher.updated"
  13011. },
  13012. {
  13013. "$ref": "#/components/schemas/Event.lsp.client.diagnostics"
  13014. },
  13015. {
  13016. "$ref": "#/components/schemas/Event.lsp.updated"
  13017. },
  13018. {
  13019. "$ref": "#/components/schemas/Event.installation.updated"
  13020. },
  13021. {
  13022. "$ref": "#/components/schemas/Event.installation.update-available"
  13023. },
  13024. {
  13025. "$ref": "#/components/schemas/Event.message.part.delta"
  13026. },
  13027. {
  13028. "$ref": "#/components/schemas/Event.permission.asked"
  13029. },
  13030. {
  13031. "$ref": "#/components/schemas/Event.permission.replied"
  13032. },
  13033. {
  13034. "$ref": "#/components/schemas/Event.session.diff"
  13035. },
  13036. {
  13037. "$ref": "#/components/schemas/Event.session.error"
  13038. },
  13039. {
  13040. "$ref": "#/components/schemas/Event.question.asked"
  13041. },
  13042. {
  13043. "$ref": "#/components/schemas/Event.question.replied"
  13044. },
  13045. {
  13046. "$ref": "#/components/schemas/Event.question.rejected"
  13047. },
  13048. {
  13049. "$ref": "#/components/schemas/Event.todo.updated"
  13050. },
  13051. {
  13052. "$ref": "#/components/schemas/Event.session.status"
  13053. },
  13054. {
  13055. "$ref": "#/components/schemas/Event.session.idle"
  13056. },
  13057. {
  13058. "$ref": "#/components/schemas/Event.session.compacted"
  13059. },
  13060. {
  13061. "$ref": "#/components/schemas/Event.tui.prompt.append"
  13062. },
  13063. {
  13064. "$ref": "#/components/schemas/Event.tui.command.execute"
  13065. },
  13066. {
  13067. "$ref": "#/components/schemas/Event.tui.toast.show"
  13068. },
  13069. {
  13070. "$ref": "#/components/schemas/Event.tui.session.select"
  13071. },
  13072. {
  13073. "$ref": "#/components/schemas/Event.mcp.tools.changed"
  13074. },
  13075. {
  13076. "$ref": "#/components/schemas/Event.mcp.browser.open.failed"
  13077. },
  13078. {
  13079. "$ref": "#/components/schemas/Event.command.executed"
  13080. },
  13081. {
  13082. "$ref": "#/components/schemas/Event.vcs.branch.updated"
  13083. },
  13084. {
  13085. "$ref": "#/components/schemas/Event.worktree.ready"
  13086. },
  13087. {
  13088. "$ref": "#/components/schemas/Event.worktree.failed"
  13089. },
  13090. {
  13091. "$ref": "#/components/schemas/Event.pty.created"
  13092. },
  13093. {
  13094. "$ref": "#/components/schemas/Event.pty.updated"
  13095. },
  13096. {
  13097. "$ref": "#/components/schemas/Event.pty.exited"
  13098. },
  13099. {
  13100. "$ref": "#/components/schemas/Event.pty.deleted"
  13101. },
  13102. {
  13103. "$ref": "#/components/schemas/Event.workspace.ready"
  13104. },
  13105. {
  13106. "$ref": "#/components/schemas/Event.workspace.failed"
  13107. },
  13108. {
  13109. "$ref": "#/components/schemas/Event.workspace.restore"
  13110. },
  13111. {
  13112. "$ref": "#/components/schemas/Event.workspace.status"
  13113. },
  13114. {
  13115. "$ref": "#/components/schemas/Event.message.updated"
  13116. },
  13117. {
  13118. "$ref": "#/components/schemas/Event.message.removed"
  13119. },
  13120. {
  13121. "$ref": "#/components/schemas/Event.message.part.updated"
  13122. },
  13123. {
  13124. "$ref": "#/components/schemas/Event.message.part.removed"
  13125. },
  13126. {
  13127. "$ref": "#/components/schemas/Event.session.created"
  13128. },
  13129. {
  13130. "$ref": "#/components/schemas/Event.session.updated"
  13131. },
  13132. {
  13133. "$ref": "#/components/schemas/Event.session.deleted"
  13134. }
  13135. ]
  13136. },
  13137. "MCPStatusConnected": {
  13138. "type": "object",
  13139. "properties": {
  13140. "status": {
  13141. "type": "string",
  13142. "const": "connected"
  13143. }
  13144. },
  13145. "required": ["status"]
  13146. },
  13147. "MCPStatusDisabled": {
  13148. "type": "object",
  13149. "properties": {
  13150. "status": {
  13151. "type": "string",
  13152. "const": "disabled"
  13153. }
  13154. },
  13155. "required": ["status"]
  13156. },
  13157. "MCPStatusFailed": {
  13158. "type": "object",
  13159. "properties": {
  13160. "status": {
  13161. "type": "string",
  13162. "const": "failed"
  13163. },
  13164. "error": {
  13165. "type": "string"
  13166. }
  13167. },
  13168. "required": ["status", "error"]
  13169. },
  13170. "MCPStatusNeedsAuth": {
  13171. "type": "object",
  13172. "properties": {
  13173. "status": {
  13174. "type": "string",
  13175. "const": "needs_auth"
  13176. }
  13177. },
  13178. "required": ["status"]
  13179. },
  13180. "MCPStatusNeedsClientRegistration": {
  13181. "type": "object",
  13182. "properties": {
  13183. "status": {
  13184. "type": "string",
  13185. "const": "needs_client_registration"
  13186. },
  13187. "error": {
  13188. "type": "string"
  13189. }
  13190. },
  13191. "required": ["status", "error"]
  13192. },
  13193. "MCPStatus": {
  13194. "anyOf": [
  13195. {
  13196. "$ref": "#/components/schemas/MCPStatusConnected"
  13197. },
  13198. {
  13199. "$ref": "#/components/schemas/MCPStatusDisabled"
  13200. },
  13201. {
  13202. "$ref": "#/components/schemas/MCPStatusFailed"
  13203. },
  13204. {
  13205. "$ref": "#/components/schemas/MCPStatusNeedsAuth"
  13206. },
  13207. {
  13208. "$ref": "#/components/schemas/MCPStatusNeedsClientRegistration"
  13209. }
  13210. ]
  13211. },
  13212. "Path": {
  13213. "type": "object",
  13214. "properties": {
  13215. "home": {
  13216. "type": "string"
  13217. },
  13218. "state": {
  13219. "type": "string"
  13220. },
  13221. "config": {
  13222. "type": "string"
  13223. },
  13224. "worktree": {
  13225. "type": "string"
  13226. },
  13227. "directory": {
  13228. "type": "string"
  13229. }
  13230. },
  13231. "required": ["home", "state", "config", "worktree", "directory"]
  13232. },
  13233. "VcsInfo": {
  13234. "type": "object",
  13235. "properties": {
  13236. "branch": {
  13237. "type": "string"
  13238. },
  13239. "default_branch": {
  13240. "type": "string"
  13241. }
  13242. }
  13243. },
  13244. "VcsFileDiff": {
  13245. "type": "object",
  13246. "properties": {
  13247. "file": {
  13248. "type": "string"
  13249. },
  13250. "patch": {
  13251. "type": "string"
  13252. },
  13253. "additions": {
  13254. "type": "number"
  13255. },
  13256. "deletions": {
  13257. "type": "number"
  13258. },
  13259. "status": {
  13260. "type": "string",
  13261. "enum": ["added", "deleted", "modified"]
  13262. }
  13263. },
  13264. "required": ["file", "patch", "additions", "deletions"]
  13265. },
  13266. "Command": {
  13267. "type": "object",
  13268. "properties": {
  13269. "name": {
  13270. "type": "string"
  13271. },
  13272. "description": {
  13273. "type": "string"
  13274. },
  13275. "agent": {
  13276. "type": "string"
  13277. },
  13278. "model": {
  13279. "type": "string"
  13280. },
  13281. "source": {
  13282. "type": "string",
  13283. "enum": ["command", "mcp", "skill"]
  13284. },
  13285. "template": {
  13286. "anyOf": [
  13287. {
  13288. "type": "string"
  13289. },
  13290. {
  13291. "type": "string"
  13292. }
  13293. ]
  13294. },
  13295. "subtask": {
  13296. "type": "boolean"
  13297. },
  13298. "hints": {
  13299. "type": "array",
  13300. "items": {
  13301. "type": "string"
  13302. }
  13303. }
  13304. },
  13305. "required": ["name", "template", "hints"]
  13306. },
  13307. "Agent": {
  13308. "type": "object",
  13309. "properties": {
  13310. "name": {
  13311. "type": "string"
  13312. },
  13313. "description": {
  13314. "type": "string"
  13315. },
  13316. "mode": {
  13317. "type": "string",
  13318. "enum": ["subagent", "primary", "all"]
  13319. },
  13320. "native": {
  13321. "type": "boolean"
  13322. },
  13323. "hidden": {
  13324. "type": "boolean"
  13325. },
  13326. "topP": {
  13327. "type": "number"
  13328. },
  13329. "temperature": {
  13330. "type": "number"
  13331. },
  13332. "color": {
  13333. "type": "string"
  13334. },
  13335. "permission": {
  13336. "$ref": "#/components/schemas/PermissionRuleset"
  13337. },
  13338. "model": {
  13339. "type": "object",
  13340. "properties": {
  13341. "modelID": {
  13342. "type": "string"
  13343. },
  13344. "providerID": {
  13345. "type": "string"
  13346. }
  13347. },
  13348. "required": ["modelID", "providerID"]
  13349. },
  13350. "variant": {
  13351. "type": "string"
  13352. },
  13353. "prompt": {
  13354. "type": "string"
  13355. },
  13356. "options": {
  13357. "type": "object",
  13358. "propertyNames": {
  13359. "type": "string"
  13360. },
  13361. "additionalProperties": {}
  13362. },
  13363. "steps": {
  13364. "type": "integer",
  13365. "exclusiveMinimum": 0,
  13366. "maximum": 9007199254740991
  13367. }
  13368. },
  13369. "required": ["name", "mode", "permission", "options"]
  13370. },
  13371. "LSPStatus": {
  13372. "type": "object",
  13373. "properties": {
  13374. "id": {
  13375. "type": "string"
  13376. },
  13377. "name": {
  13378. "type": "string"
  13379. },
  13380. "root": {
  13381. "type": "string"
  13382. },
  13383. "status": {
  13384. "anyOf": [
  13385. {
  13386. "type": "string",
  13387. "const": "connected"
  13388. },
  13389. {
  13390. "type": "string",
  13391. "const": "error"
  13392. }
  13393. ]
  13394. }
  13395. },
  13396. "required": ["id", "name", "root", "status"]
  13397. },
  13398. "FormatterStatus": {
  13399. "type": "object",
  13400. "properties": {
  13401. "name": {
  13402. "type": "string"
  13403. },
  13404. "extensions": {
  13405. "type": "array",
  13406. "items": {
  13407. "type": "string"
  13408. }
  13409. },
  13410. "enabled": {
  13411. "type": "boolean"
  13412. }
  13413. },
  13414. "required": ["name", "extensions", "enabled"]
  13415. }
  13416. }
  13417. }
  13418. }