openapi.json 364 KB

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