openapi.json 363 KB

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