openapi.json 447 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402
  1. {
  2. "openapi": "3.1.1",
  3. "info": {
  4. "title": "opencode",
  5. "description": "opencode api",
  6. "version": "1.0.0"
  7. },
  8. "paths": {
  9. "/global/health": {
  10. "get": {
  11. "operationId": "global.health",
  12. "summary": "Get health",
  13. "description": "Get health information about the OpenCode server.",
  14. "responses": {
  15. "200": {
  16. "description": "Health information",
  17. "content": {
  18. "application/json": {
  19. "schema": {
  20. "type": "object",
  21. "properties": {
  22. "healthy": {
  23. "type": "boolean",
  24. "const": true
  25. },
  26. "version": {
  27. "type": "string"
  28. }
  29. },
  30. "required": ["healthy", "version"]
  31. }
  32. }
  33. }
  34. }
  35. },
  36. "x-codeSamples": [
  37. {
  38. "lang": "js",
  39. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.health({\n ...\n})"
  40. }
  41. ]
  42. }
  43. },
  44. "/global/event": {
  45. "get": {
  46. "operationId": "global.event",
  47. "summary": "Get global events",
  48. "description": "Subscribe to global events from the OpenCode system using server-sent events.",
  49. "responses": {
  50. "200": {
  51. "description": "Event stream",
  52. "content": {
  53. "text/event-stream": {
  54. "schema": {
  55. "$ref": "#/components/schemas/GlobalEvent"
  56. }
  57. }
  58. }
  59. }
  60. },
  61. "x-codeSamples": [
  62. {
  63. "lang": "js",
  64. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.event({\n ...\n})"
  65. }
  66. ]
  67. }
  68. },
  69. "/global/config": {
  70. "get": {
  71. "operationId": "global.config.get",
  72. "summary": "Get global configuration",
  73. "description": "Retrieve the current global OpenCode configuration settings and preferences.",
  74. "responses": {
  75. "200": {
  76. "description": "Get global config info",
  77. "content": {
  78. "application/json": {
  79. "schema": {
  80. "$ref": "#/components/schemas/Config"
  81. }
  82. }
  83. }
  84. }
  85. },
  86. "x-codeSamples": [
  87. {
  88. "lang": "js",
  89. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.config.get({\n ...\n})"
  90. }
  91. ]
  92. },
  93. "patch": {
  94. "operationId": "global.config.update",
  95. "summary": "Update global configuration",
  96. "description": "Update global OpenCode configuration settings and preferences.",
  97. "responses": {
  98. "200": {
  99. "description": "Successfully updated global config",
  100. "content": {
  101. "application/json": {
  102. "schema": {
  103. "$ref": "#/components/schemas/Config"
  104. }
  105. }
  106. }
  107. },
  108. "400": {
  109. "description": "Bad request",
  110. "content": {
  111. "application/json": {
  112. "schema": {
  113. "$ref": "#/components/schemas/BadRequestError"
  114. }
  115. }
  116. }
  117. }
  118. },
  119. "requestBody": {
  120. "content": {
  121. "application/json": {
  122. "schema": {
  123. "$ref": "#/components/schemas/Config"
  124. }
  125. }
  126. }
  127. },
  128. "x-codeSamples": [
  129. {
  130. "lang": "js",
  131. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.config.update({\n ...\n})"
  132. }
  133. ]
  134. }
  135. },
  136. "/global/dispose": {
  137. "post": {
  138. "operationId": "global.dispose",
  139. "summary": "Dispose instance",
  140. "description": "Clean up and dispose all OpenCode instances, releasing all resources.",
  141. "responses": {
  142. "200": {
  143. "description": "Global disposed",
  144. "content": {
  145. "application/json": {
  146. "schema": {
  147. "type": "boolean"
  148. }
  149. }
  150. }
  151. }
  152. },
  153. "x-codeSamples": [
  154. {
  155. "lang": "js",
  156. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.dispose({\n ...\n})"
  157. }
  158. ]
  159. }
  160. },
  161. "/global/upgrade": {
  162. "post": {
  163. "operationId": "global.upgrade",
  164. "summary": "Upgrade opencode",
  165. "description": "Upgrade opencode to the specified version or latest if not specified.",
  166. "responses": {
  167. "200": {
  168. "description": "Upgrade result",
  169. "content": {
  170. "application/json": {
  171. "schema": {
  172. "anyOf": [
  173. {
  174. "type": "object",
  175. "properties": {
  176. "success": {
  177. "type": "boolean",
  178. "const": true
  179. },
  180. "version": {
  181. "type": "string"
  182. }
  183. },
  184. "required": ["success", "version"]
  185. },
  186. {
  187. "type": "object",
  188. "properties": {
  189. "success": {
  190. "type": "boolean",
  191. "const": false
  192. },
  193. "error": {
  194. "type": "string"
  195. }
  196. },
  197. "required": ["success", "error"]
  198. }
  199. ]
  200. }
  201. }
  202. }
  203. },
  204. "400": {
  205. "description": "Bad request",
  206. "content": {
  207. "application/json": {
  208. "schema": {
  209. "$ref": "#/components/schemas/BadRequestError"
  210. }
  211. }
  212. }
  213. }
  214. },
  215. "requestBody": {
  216. "content": {
  217. "application/json": {
  218. "schema": {
  219. "type": "object",
  220. "properties": {
  221. "target": {
  222. "type": "string"
  223. }
  224. }
  225. }
  226. }
  227. }
  228. },
  229. "x-codeSamples": [
  230. {
  231. "lang": "js",
  232. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.upgrade({\n ...\n})"
  233. }
  234. ]
  235. }
  236. },
  237. "/auth/{providerID}": {
  238. "put": {
  239. "operationId": "auth.set",
  240. "summary": "Set auth credentials",
  241. "description": "Set authentication credentials",
  242. "responses": {
  243. "200": {
  244. "description": "Successfully set authentication credentials",
  245. "content": {
  246. "application/json": {
  247. "schema": {
  248. "type": "boolean"
  249. }
  250. }
  251. }
  252. },
  253. "400": {
  254. "description": "Bad request",
  255. "content": {
  256. "application/json": {
  257. "schema": {
  258. "$ref": "#/components/schemas/BadRequestError"
  259. }
  260. }
  261. }
  262. }
  263. },
  264. "parameters": [
  265. {
  266. "in": "path",
  267. "name": "providerID",
  268. "schema": {
  269. "type": "string"
  270. },
  271. "required": true
  272. }
  273. ],
  274. "requestBody": {
  275. "content": {
  276. "application/json": {
  277. "schema": {
  278. "$ref": "#/components/schemas/Auth"
  279. }
  280. }
  281. }
  282. },
  283. "x-codeSamples": [
  284. {
  285. "lang": "js",
  286. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.auth.set({\n ...\n})"
  287. }
  288. ]
  289. },
  290. "delete": {
  291. "operationId": "auth.remove",
  292. "summary": "Remove auth credentials",
  293. "description": "Remove authentication credentials",
  294. "responses": {
  295. "200": {
  296. "description": "Successfully removed authentication credentials",
  297. "content": {
  298. "application/json": {
  299. "schema": {
  300. "type": "boolean"
  301. }
  302. }
  303. }
  304. },
  305. "400": {
  306. "description": "Bad request",
  307. "content": {
  308. "application/json": {
  309. "schema": {
  310. "$ref": "#/components/schemas/BadRequestError"
  311. }
  312. }
  313. }
  314. }
  315. },
  316. "parameters": [
  317. {
  318. "in": "path",
  319. "name": "providerID",
  320. "schema": {
  321. "type": "string"
  322. },
  323. "required": true
  324. }
  325. ],
  326. "x-codeSamples": [
  327. {
  328. "lang": "js",
  329. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.auth.remove({\n ...\n})"
  330. }
  331. ]
  332. }
  333. },
  334. "/log": {
  335. "post": {
  336. "operationId": "app.log",
  337. "parameters": [
  338. {
  339. "in": "query",
  340. "name": "directory",
  341. "schema": {
  342. "type": "string"
  343. }
  344. },
  345. {
  346. "in": "query",
  347. "name": "workspace",
  348. "schema": {
  349. "type": "string"
  350. }
  351. }
  352. ],
  353. "summary": "Write log",
  354. "description": "Write a log entry to the server logs with specified level and metadata.",
  355. "responses": {
  356. "200": {
  357. "description": "Log entry written successfully",
  358. "content": {
  359. "application/json": {
  360. "schema": {
  361. "type": "boolean"
  362. }
  363. }
  364. }
  365. },
  366. "400": {
  367. "description": "Bad request",
  368. "content": {
  369. "application/json": {
  370. "schema": {
  371. "$ref": "#/components/schemas/BadRequestError"
  372. }
  373. }
  374. }
  375. }
  376. },
  377. "requestBody": {
  378. "content": {
  379. "application/json": {
  380. "schema": {
  381. "type": "object",
  382. "properties": {
  383. "service": {
  384. "description": "Service name for the log entry",
  385. "type": "string"
  386. },
  387. "level": {
  388. "description": "Log level",
  389. "type": "string",
  390. "enum": ["debug", "info", "error", "warn"]
  391. },
  392. "message": {
  393. "description": "Log message",
  394. "type": "string"
  395. },
  396. "extra": {
  397. "description": "Additional metadata for the log entry",
  398. "type": "object",
  399. "propertyNames": {
  400. "type": "string"
  401. },
  402. "additionalProperties": {}
  403. }
  404. },
  405. "required": ["service", "level", "message"]
  406. }
  407. }
  408. }
  409. },
  410. "x-codeSamples": [
  411. {
  412. "lang": "js",
  413. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.app.log({\n ...\n})"
  414. }
  415. ]
  416. }
  417. },
  418. "/experimental/workspace/adapter": {
  419. "get": {
  420. "operationId": "experimental.workspace.adapter.list",
  421. "parameters": [
  422. {
  423. "in": "query",
  424. "name": "directory",
  425. "schema": {
  426. "type": "string"
  427. }
  428. },
  429. {
  430. "in": "query",
  431. "name": "workspace",
  432. "schema": {
  433. "type": "string"
  434. }
  435. }
  436. ],
  437. "summary": "List workspace adapters",
  438. "description": "List all available workspace adapters for the current project.",
  439. "responses": {
  440. "200": {
  441. "description": "Workspace adapters",
  442. "content": {
  443. "application/json": {
  444. "schema": {
  445. "type": "array",
  446. "items": {
  447. "type": "object",
  448. "properties": {
  449. "type": {
  450. "type": "string"
  451. },
  452. "name": {
  453. "type": "string"
  454. },
  455. "description": {
  456. "type": "string"
  457. }
  458. },
  459. "required": ["type", "name", "description"]
  460. }
  461. }
  462. }
  463. }
  464. }
  465. },
  466. "x-codeSamples": [
  467. {
  468. "lang": "js",
  469. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.adapter.list({\n ...\n})"
  470. }
  471. ]
  472. }
  473. },
  474. "/experimental/workspace": {
  475. "post": {
  476. "operationId": "experimental.workspace.create",
  477. "parameters": [
  478. {
  479. "in": "query",
  480. "name": "directory",
  481. "schema": {
  482. "type": "string"
  483. }
  484. },
  485. {
  486. "in": "query",
  487. "name": "workspace",
  488. "schema": {
  489. "type": "string"
  490. }
  491. }
  492. ],
  493. "summary": "Create workspace",
  494. "description": "Create a workspace for the current project.",
  495. "responses": {
  496. "200": {
  497. "description": "Workspace created",
  498. "content": {
  499. "application/json": {
  500. "schema": {
  501. "$ref": "#/components/schemas/Workspace"
  502. }
  503. }
  504. }
  505. },
  506. "400": {
  507. "description": "Bad request",
  508. "content": {
  509. "application/json": {
  510. "schema": {
  511. "$ref": "#/components/schemas/BadRequestError"
  512. }
  513. }
  514. }
  515. }
  516. },
  517. "requestBody": {
  518. "content": {
  519. "application/json": {
  520. "schema": {
  521. "type": "object",
  522. "properties": {
  523. "id": {
  524. "type": "string",
  525. "pattern": "^wrk.*"
  526. },
  527. "type": {
  528. "type": "string"
  529. },
  530. "branch": {
  531. "anyOf": [
  532. {
  533. "type": "string"
  534. },
  535. {
  536. "type": "null"
  537. }
  538. ]
  539. },
  540. "extra": {
  541. "anyOf": [
  542. {},
  543. {
  544. "type": "null"
  545. }
  546. ]
  547. }
  548. },
  549. "required": ["type", "branch", "extra"]
  550. }
  551. }
  552. }
  553. },
  554. "x-codeSamples": [
  555. {
  556. "lang": "js",
  557. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.create({\n ...\n})"
  558. }
  559. ]
  560. },
  561. "get": {
  562. "operationId": "experimental.workspace.list",
  563. "parameters": [
  564. {
  565. "in": "query",
  566. "name": "directory",
  567. "schema": {
  568. "type": "string"
  569. }
  570. },
  571. {
  572. "in": "query",
  573. "name": "workspace",
  574. "schema": {
  575. "type": "string"
  576. }
  577. }
  578. ],
  579. "summary": "List workspaces",
  580. "description": "List all workspaces.",
  581. "responses": {
  582. "200": {
  583. "description": "Workspaces",
  584. "content": {
  585. "application/json": {
  586. "schema": {
  587. "type": "array",
  588. "items": {
  589. "$ref": "#/components/schemas/Workspace"
  590. }
  591. }
  592. }
  593. }
  594. }
  595. },
  596. "x-codeSamples": [
  597. {
  598. "lang": "js",
  599. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.list({\n ...\n})"
  600. }
  601. ]
  602. }
  603. },
  604. "/experimental/workspace/status": {
  605. "get": {
  606. "operationId": "experimental.workspace.status",
  607. "parameters": [
  608. {
  609. "in": "query",
  610. "name": "directory",
  611. "schema": {
  612. "type": "string"
  613. }
  614. },
  615. {
  616. "in": "query",
  617. "name": "workspace",
  618. "schema": {
  619. "type": "string"
  620. }
  621. }
  622. ],
  623. "summary": "Workspace status",
  624. "description": "Get connection status for workspaces in the current project.",
  625. "responses": {
  626. "200": {
  627. "description": "Workspace status",
  628. "content": {
  629. "application/json": {
  630. "schema": {
  631. "type": "array",
  632. "items": {
  633. "type": "object",
  634. "properties": {
  635. "workspaceID": {
  636. "type": "string",
  637. "pattern": "^wrk.*"
  638. },
  639. "status": {
  640. "type": "string",
  641. "enum": ["connected", "connecting", "disconnected", "error"]
  642. }
  643. },
  644. "required": ["workspaceID", "status"]
  645. }
  646. }
  647. }
  648. }
  649. }
  650. },
  651. "x-codeSamples": [
  652. {
  653. "lang": "js",
  654. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.status({\n ...\n})"
  655. }
  656. ]
  657. }
  658. },
  659. "/experimental/workspace/{id}": {
  660. "delete": {
  661. "operationId": "experimental.workspace.remove",
  662. "parameters": [
  663. {
  664. "in": "query",
  665. "name": "directory",
  666. "schema": {
  667. "type": "string"
  668. }
  669. },
  670. {
  671. "in": "query",
  672. "name": "workspace",
  673. "schema": {
  674. "type": "string"
  675. }
  676. },
  677. {
  678. "in": "path",
  679. "name": "id",
  680. "schema": {
  681. "type": "string",
  682. "pattern": "^wrk.*"
  683. },
  684. "required": true
  685. }
  686. ],
  687. "summary": "Remove workspace",
  688. "description": "Remove an existing workspace.",
  689. "responses": {
  690. "200": {
  691. "description": "Workspace removed",
  692. "content": {
  693. "application/json": {
  694. "schema": {
  695. "$ref": "#/components/schemas/Workspace"
  696. }
  697. }
  698. }
  699. },
  700. "400": {
  701. "description": "Bad request",
  702. "content": {
  703. "application/json": {
  704. "schema": {
  705. "$ref": "#/components/schemas/BadRequestError"
  706. }
  707. }
  708. }
  709. }
  710. },
  711. "x-codeSamples": [
  712. {
  713. "lang": "js",
  714. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.remove({\n ...\n})"
  715. }
  716. ]
  717. }
  718. },
  719. "/experimental/workspace/{id}/session-restore": {
  720. "post": {
  721. "operationId": "experimental.workspace.sessionRestore",
  722. "parameters": [
  723. {
  724. "in": "query",
  725. "name": "directory",
  726. "schema": {
  727. "type": "string"
  728. }
  729. },
  730. {
  731. "in": "query",
  732. "name": "workspace",
  733. "schema": {
  734. "type": "string"
  735. }
  736. },
  737. {
  738. "in": "path",
  739. "name": "id",
  740. "schema": {
  741. "type": "string",
  742. "pattern": "^wrk.*"
  743. },
  744. "required": true
  745. }
  746. ],
  747. "summary": "Restore session into workspace",
  748. "description": "Replay a session's sync events into the target workspace in batches.",
  749. "responses": {
  750. "200": {
  751. "description": "Session replay started",
  752. "content": {
  753. "application/json": {
  754. "schema": {
  755. "type": "object",
  756. "properties": {
  757. "total": {
  758. "type": "integer",
  759. "minimum": 0,
  760. "maximum": 9007199254740991
  761. }
  762. },
  763. "required": ["total"]
  764. }
  765. }
  766. }
  767. },
  768. "400": {
  769. "description": "Bad request",
  770. "content": {
  771. "application/json": {
  772. "schema": {
  773. "$ref": "#/components/schemas/BadRequestError"
  774. }
  775. }
  776. }
  777. }
  778. },
  779. "requestBody": {
  780. "content": {
  781. "application/json": {
  782. "schema": {
  783. "type": "object",
  784. "properties": {
  785. "sessionID": {
  786. "type": "string",
  787. "pattern": "^ses.*"
  788. }
  789. },
  790. "required": ["sessionID"]
  791. }
  792. }
  793. }
  794. },
  795. "x-codeSamples": [
  796. {
  797. "lang": "js",
  798. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.sessionRestore({\n ...\n})"
  799. }
  800. ]
  801. }
  802. },
  803. "/project": {
  804. "get": {
  805. "operationId": "project.list",
  806. "parameters": [
  807. {
  808. "in": "query",
  809. "name": "directory",
  810. "schema": {
  811. "type": "string"
  812. }
  813. },
  814. {
  815. "in": "query",
  816. "name": "workspace",
  817. "schema": {
  818. "type": "string"
  819. }
  820. }
  821. ],
  822. "summary": "List all projects",
  823. "description": "Get a list of projects that have been opened with OpenCode.",
  824. "responses": {
  825. "200": {
  826. "description": "List of projects",
  827. "content": {
  828. "application/json": {
  829. "schema": {
  830. "type": "array",
  831. "items": {
  832. "$ref": "#/components/schemas/Project"
  833. }
  834. }
  835. }
  836. }
  837. }
  838. },
  839. "x-codeSamples": [
  840. {
  841. "lang": "js",
  842. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.list({\n ...\n})"
  843. }
  844. ]
  845. }
  846. },
  847. "/project/current": {
  848. "get": {
  849. "operationId": "project.current",
  850. "parameters": [
  851. {
  852. "in": "query",
  853. "name": "directory",
  854. "schema": {
  855. "type": "string"
  856. }
  857. },
  858. {
  859. "in": "query",
  860. "name": "workspace",
  861. "schema": {
  862. "type": "string"
  863. }
  864. }
  865. ],
  866. "summary": "Get current project",
  867. "description": "Retrieve the currently active project that OpenCode is working with.",
  868. "responses": {
  869. "200": {
  870. "description": "Current project information",
  871. "content": {
  872. "application/json": {
  873. "schema": {
  874. "$ref": "#/components/schemas/Project"
  875. }
  876. }
  877. }
  878. }
  879. },
  880. "x-codeSamples": [
  881. {
  882. "lang": "js",
  883. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.current({\n ...\n})"
  884. }
  885. ]
  886. }
  887. },
  888. "/project/git/init": {
  889. "post": {
  890. "operationId": "project.initGit",
  891. "parameters": [
  892. {
  893. "in": "query",
  894. "name": "directory",
  895. "schema": {
  896. "type": "string"
  897. }
  898. },
  899. {
  900. "in": "query",
  901. "name": "workspace",
  902. "schema": {
  903. "type": "string"
  904. }
  905. }
  906. ],
  907. "summary": "Initialize git repository",
  908. "description": "Create a git repository for the current project and return the refreshed project info.",
  909. "responses": {
  910. "200": {
  911. "description": "Project information after git initialization",
  912. "content": {
  913. "application/json": {
  914. "schema": {
  915. "$ref": "#/components/schemas/Project"
  916. }
  917. }
  918. }
  919. }
  920. },
  921. "x-codeSamples": [
  922. {
  923. "lang": "js",
  924. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.initGit({\n ...\n})"
  925. }
  926. ]
  927. }
  928. },
  929. "/project/{projectID}": {
  930. "patch": {
  931. "operationId": "project.update",
  932. "parameters": [
  933. {
  934. "in": "query",
  935. "name": "directory",
  936. "schema": {
  937. "type": "string"
  938. }
  939. },
  940. {
  941. "in": "query",
  942. "name": "workspace",
  943. "schema": {
  944. "type": "string"
  945. }
  946. },
  947. {
  948. "in": "path",
  949. "name": "projectID",
  950. "schema": {
  951. "type": "string"
  952. },
  953. "required": true
  954. }
  955. ],
  956. "summary": "Update project",
  957. "description": "Update project properties such as name, icon, and commands.",
  958. "responses": {
  959. "200": {
  960. "description": "Updated project information",
  961. "content": {
  962. "application/json": {
  963. "schema": {
  964. "$ref": "#/components/schemas/Project"
  965. }
  966. }
  967. }
  968. },
  969. "400": {
  970. "description": "Bad request",
  971. "content": {
  972. "application/json": {
  973. "schema": {
  974. "$ref": "#/components/schemas/BadRequestError"
  975. }
  976. }
  977. }
  978. },
  979. "404": {
  980. "description": "Not found",
  981. "content": {
  982. "application/json": {
  983. "schema": {
  984. "$ref": "#/components/schemas/NotFoundError"
  985. }
  986. }
  987. }
  988. }
  989. },
  990. "requestBody": {
  991. "content": {
  992. "application/json": {
  993. "schema": {
  994. "type": "object",
  995. "properties": {
  996. "name": {
  997. "type": "string"
  998. },
  999. "icon": {
  1000. "type": "object",
  1001. "properties": {
  1002. "url": {
  1003. "type": "string"
  1004. },
  1005. "override": {
  1006. "type": "string"
  1007. },
  1008. "color": {
  1009. "type": "string"
  1010. }
  1011. }
  1012. },
  1013. "commands": {
  1014. "type": "object",
  1015. "properties": {
  1016. "start": {
  1017. "description": "Startup script to run when creating a new workspace (worktree)",
  1018. "type": "string"
  1019. }
  1020. }
  1021. }
  1022. }
  1023. }
  1024. }
  1025. }
  1026. },
  1027. "x-codeSamples": [
  1028. {
  1029. "lang": "js",
  1030. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.update({\n ...\n})"
  1031. }
  1032. ]
  1033. }
  1034. },
  1035. "/pty/shells": {
  1036. "get": {
  1037. "operationId": "pty.shells",
  1038. "parameters": [
  1039. {
  1040. "in": "query",
  1041. "name": "directory",
  1042. "schema": {
  1043. "type": "string"
  1044. }
  1045. },
  1046. {
  1047. "in": "query",
  1048. "name": "workspace",
  1049. "schema": {
  1050. "type": "string"
  1051. }
  1052. }
  1053. ],
  1054. "summary": "List available shells",
  1055. "description": "Get a list of available shells on the system.",
  1056. "responses": {
  1057. "200": {
  1058. "description": "List of shells",
  1059. "content": {
  1060. "application/json": {
  1061. "schema": {
  1062. "type": "array",
  1063. "items": {
  1064. "type": "object",
  1065. "properties": {
  1066. "path": {
  1067. "type": "string"
  1068. },
  1069. "name": {
  1070. "type": "string"
  1071. },
  1072. "acceptable": {
  1073. "type": "boolean"
  1074. }
  1075. },
  1076. "required": ["path", "name", "acceptable"]
  1077. }
  1078. }
  1079. }
  1080. }
  1081. }
  1082. },
  1083. "x-codeSamples": [
  1084. {
  1085. "lang": "js",
  1086. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.shells({\n ...\n})"
  1087. }
  1088. ]
  1089. }
  1090. },
  1091. "/pty": {
  1092. "get": {
  1093. "operationId": "pty.list",
  1094. "parameters": [
  1095. {
  1096. "in": "query",
  1097. "name": "directory",
  1098. "schema": {
  1099. "type": "string"
  1100. }
  1101. },
  1102. {
  1103. "in": "query",
  1104. "name": "workspace",
  1105. "schema": {
  1106. "type": "string"
  1107. }
  1108. }
  1109. ],
  1110. "summary": "List PTY sessions",
  1111. "description": "Get a list of all active pseudo-terminal (PTY) sessions managed by OpenCode.",
  1112. "responses": {
  1113. "200": {
  1114. "description": "List of sessions",
  1115. "content": {
  1116. "application/json": {
  1117. "schema": {
  1118. "type": "array",
  1119. "items": {
  1120. "$ref": "#/components/schemas/Pty"
  1121. }
  1122. }
  1123. }
  1124. }
  1125. }
  1126. },
  1127. "x-codeSamples": [
  1128. {
  1129. "lang": "js",
  1130. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.list({\n ...\n})"
  1131. }
  1132. ]
  1133. },
  1134. "post": {
  1135. "operationId": "pty.create",
  1136. "parameters": [
  1137. {
  1138. "in": "query",
  1139. "name": "directory",
  1140. "schema": {
  1141. "type": "string"
  1142. }
  1143. },
  1144. {
  1145. "in": "query",
  1146. "name": "workspace",
  1147. "schema": {
  1148. "type": "string"
  1149. }
  1150. }
  1151. ],
  1152. "summary": "Create PTY session",
  1153. "description": "Create a new pseudo-terminal (PTY) session for running shell commands and processes.",
  1154. "responses": {
  1155. "200": {
  1156. "description": "Created session",
  1157. "content": {
  1158. "application/json": {
  1159. "schema": {
  1160. "$ref": "#/components/schemas/Pty"
  1161. }
  1162. }
  1163. }
  1164. },
  1165. "400": {
  1166. "description": "Bad request",
  1167. "content": {
  1168. "application/json": {
  1169. "schema": {
  1170. "$ref": "#/components/schemas/BadRequestError"
  1171. }
  1172. }
  1173. }
  1174. }
  1175. },
  1176. "requestBody": {
  1177. "content": {
  1178. "application/json": {
  1179. "schema": {
  1180. "type": "object",
  1181. "properties": {
  1182. "command": {
  1183. "type": "string"
  1184. },
  1185. "args": {
  1186. "type": "array",
  1187. "items": {
  1188. "type": "string"
  1189. }
  1190. },
  1191. "cwd": {
  1192. "type": "string"
  1193. },
  1194. "title": {
  1195. "type": "string"
  1196. },
  1197. "env": {
  1198. "type": "object",
  1199. "propertyNames": {
  1200. "type": "string"
  1201. },
  1202. "additionalProperties": {
  1203. "type": "string"
  1204. }
  1205. }
  1206. }
  1207. }
  1208. }
  1209. }
  1210. },
  1211. "x-codeSamples": [
  1212. {
  1213. "lang": "js",
  1214. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.create({\n ...\n})"
  1215. }
  1216. ]
  1217. }
  1218. },
  1219. "/pty/{ptyID}": {
  1220. "get": {
  1221. "operationId": "pty.get",
  1222. "parameters": [
  1223. {
  1224. "in": "query",
  1225. "name": "directory",
  1226. "schema": {
  1227. "type": "string"
  1228. }
  1229. },
  1230. {
  1231. "in": "query",
  1232. "name": "workspace",
  1233. "schema": {
  1234. "type": "string"
  1235. }
  1236. },
  1237. {
  1238. "in": "path",
  1239. "name": "ptyID",
  1240. "schema": {
  1241. "type": "string",
  1242. "pattern": "^pty.*"
  1243. },
  1244. "required": true
  1245. }
  1246. ],
  1247. "summary": "Get PTY session",
  1248. "description": "Retrieve detailed information about a specific pseudo-terminal (PTY) session.",
  1249. "responses": {
  1250. "200": {
  1251. "description": "Session info",
  1252. "content": {
  1253. "application/json": {
  1254. "schema": {
  1255. "$ref": "#/components/schemas/Pty"
  1256. }
  1257. }
  1258. }
  1259. },
  1260. "404": {
  1261. "description": "Not found",
  1262. "content": {
  1263. "application/json": {
  1264. "schema": {
  1265. "$ref": "#/components/schemas/NotFoundError"
  1266. }
  1267. }
  1268. }
  1269. }
  1270. },
  1271. "x-codeSamples": [
  1272. {
  1273. "lang": "js",
  1274. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.get({\n ...\n})"
  1275. }
  1276. ]
  1277. },
  1278. "put": {
  1279. "operationId": "pty.update",
  1280. "parameters": [
  1281. {
  1282. "in": "query",
  1283. "name": "directory",
  1284. "schema": {
  1285. "type": "string"
  1286. }
  1287. },
  1288. {
  1289. "in": "query",
  1290. "name": "workspace",
  1291. "schema": {
  1292. "type": "string"
  1293. }
  1294. },
  1295. {
  1296. "in": "path",
  1297. "name": "ptyID",
  1298. "schema": {
  1299. "type": "string",
  1300. "pattern": "^pty.*"
  1301. },
  1302. "required": true
  1303. }
  1304. ],
  1305. "summary": "Update PTY session",
  1306. "description": "Update properties of an existing pseudo-terminal (PTY) session.",
  1307. "responses": {
  1308. "200": {
  1309. "description": "Updated session",
  1310. "content": {
  1311. "application/json": {
  1312. "schema": {
  1313. "$ref": "#/components/schemas/Pty"
  1314. }
  1315. }
  1316. }
  1317. },
  1318. "400": {
  1319. "description": "Bad request",
  1320. "content": {
  1321. "application/json": {
  1322. "schema": {
  1323. "$ref": "#/components/schemas/BadRequestError"
  1324. }
  1325. }
  1326. }
  1327. }
  1328. },
  1329. "requestBody": {
  1330. "content": {
  1331. "application/json": {
  1332. "schema": {
  1333. "type": "object",
  1334. "properties": {
  1335. "title": {
  1336. "type": "string"
  1337. },
  1338. "size": {
  1339. "type": "object",
  1340. "properties": {
  1341. "rows": {
  1342. "type": "integer",
  1343. "exclusiveMinimum": 0,
  1344. "maximum": 9007199254740991
  1345. },
  1346. "cols": {
  1347. "type": "integer",
  1348. "exclusiveMinimum": 0,
  1349. "maximum": 9007199254740991
  1350. }
  1351. },
  1352. "required": ["rows", "cols"]
  1353. }
  1354. }
  1355. }
  1356. }
  1357. }
  1358. },
  1359. "x-codeSamples": [
  1360. {
  1361. "lang": "js",
  1362. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.update({\n ...\n})"
  1363. }
  1364. ]
  1365. },
  1366. "delete": {
  1367. "operationId": "pty.remove",
  1368. "parameters": [
  1369. {
  1370. "in": "query",
  1371. "name": "directory",
  1372. "schema": {
  1373. "type": "string"
  1374. }
  1375. },
  1376. {
  1377. "in": "query",
  1378. "name": "workspace",
  1379. "schema": {
  1380. "type": "string"
  1381. }
  1382. },
  1383. {
  1384. "in": "path",
  1385. "name": "ptyID",
  1386. "schema": {
  1387. "type": "string",
  1388. "pattern": "^pty.*"
  1389. },
  1390. "required": true
  1391. }
  1392. ],
  1393. "summary": "Remove PTY session",
  1394. "description": "Remove and terminate a specific pseudo-terminal (PTY) session.",
  1395. "responses": {
  1396. "200": {
  1397. "description": "Session removed",
  1398. "content": {
  1399. "application/json": {
  1400. "schema": {
  1401. "type": "boolean"
  1402. }
  1403. }
  1404. }
  1405. },
  1406. "404": {
  1407. "description": "Not found",
  1408. "content": {
  1409. "application/json": {
  1410. "schema": {
  1411. "$ref": "#/components/schemas/NotFoundError"
  1412. }
  1413. }
  1414. }
  1415. }
  1416. },
  1417. "x-codeSamples": [
  1418. {
  1419. "lang": "js",
  1420. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.remove({\n ...\n})"
  1421. }
  1422. ]
  1423. }
  1424. },
  1425. "/pty/{ptyID}/connect": {
  1426. "get": {
  1427. "operationId": "pty.connect",
  1428. "parameters": [
  1429. {
  1430. "in": "query",
  1431. "name": "directory",
  1432. "schema": {
  1433. "type": "string"
  1434. }
  1435. },
  1436. {
  1437. "in": "query",
  1438. "name": "workspace",
  1439. "schema": {
  1440. "type": "string"
  1441. }
  1442. },
  1443. {
  1444. "in": "path",
  1445. "name": "ptyID",
  1446. "schema": {
  1447. "type": "string",
  1448. "pattern": "^pty.*"
  1449. },
  1450. "required": true
  1451. }
  1452. ],
  1453. "summary": "Connect to PTY session",
  1454. "description": "Establish a WebSocket connection to interact with a pseudo-terminal (PTY) session in real-time.",
  1455. "responses": {
  1456. "200": {
  1457. "description": "Connected session",
  1458. "content": {
  1459. "application/json": {
  1460. "schema": {
  1461. "type": "boolean"
  1462. }
  1463. }
  1464. }
  1465. },
  1466. "404": {
  1467. "description": "Not found",
  1468. "content": {
  1469. "application/json": {
  1470. "schema": {
  1471. "$ref": "#/components/schemas/NotFoundError"
  1472. }
  1473. }
  1474. }
  1475. }
  1476. },
  1477. "x-codeSamples": [
  1478. {
  1479. "lang": "js",
  1480. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.connect({\n ...\n})"
  1481. }
  1482. ]
  1483. }
  1484. },
  1485. "/config": {
  1486. "get": {
  1487. "operationId": "config.get",
  1488. "parameters": [
  1489. {
  1490. "in": "query",
  1491. "name": "directory",
  1492. "schema": {
  1493. "type": "string"
  1494. }
  1495. },
  1496. {
  1497. "in": "query",
  1498. "name": "workspace",
  1499. "schema": {
  1500. "type": "string"
  1501. }
  1502. }
  1503. ],
  1504. "summary": "Get configuration",
  1505. "description": "Retrieve the current OpenCode configuration settings and preferences.",
  1506. "responses": {
  1507. "200": {
  1508. "description": "Get config info",
  1509. "content": {
  1510. "application/json": {
  1511. "schema": {
  1512. "$ref": "#/components/schemas/Config"
  1513. }
  1514. }
  1515. }
  1516. }
  1517. },
  1518. "x-codeSamples": [
  1519. {
  1520. "lang": "js",
  1521. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.config.get({\n ...\n})"
  1522. }
  1523. ]
  1524. },
  1525. "patch": {
  1526. "operationId": "config.update",
  1527. "parameters": [
  1528. {
  1529. "in": "query",
  1530. "name": "directory",
  1531. "schema": {
  1532. "type": "string"
  1533. }
  1534. },
  1535. {
  1536. "in": "query",
  1537. "name": "workspace",
  1538. "schema": {
  1539. "type": "string"
  1540. }
  1541. }
  1542. ],
  1543. "summary": "Update configuration",
  1544. "description": "Update OpenCode configuration settings and preferences.",
  1545. "responses": {
  1546. "200": {
  1547. "description": "Successfully updated config",
  1548. "content": {
  1549. "application/json": {
  1550. "schema": {
  1551. "$ref": "#/components/schemas/Config"
  1552. }
  1553. }
  1554. }
  1555. },
  1556. "400": {
  1557. "description": "Bad request",
  1558. "content": {
  1559. "application/json": {
  1560. "schema": {
  1561. "$ref": "#/components/schemas/BadRequestError"
  1562. }
  1563. }
  1564. }
  1565. }
  1566. },
  1567. "requestBody": {
  1568. "content": {
  1569. "application/json": {
  1570. "schema": {
  1571. "$ref": "#/components/schemas/Config"
  1572. }
  1573. }
  1574. }
  1575. },
  1576. "x-codeSamples": [
  1577. {
  1578. "lang": "js",
  1579. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.config.update({\n ...\n})"
  1580. }
  1581. ]
  1582. }
  1583. },
  1584. "/config/providers": {
  1585. "get": {
  1586. "operationId": "config.providers",
  1587. "parameters": [
  1588. {
  1589. "in": "query",
  1590. "name": "directory",
  1591. "schema": {
  1592. "type": "string"
  1593. }
  1594. },
  1595. {
  1596. "in": "query",
  1597. "name": "workspace",
  1598. "schema": {
  1599. "type": "string"
  1600. }
  1601. }
  1602. ],
  1603. "summary": "List config providers",
  1604. "description": "Get a list of all configured AI providers and their default models.",
  1605. "responses": {
  1606. "200": {
  1607. "description": "List of providers",
  1608. "content": {
  1609. "application/json": {
  1610. "schema": {
  1611. "type": "object",
  1612. "properties": {
  1613. "providers": {
  1614. "type": "array",
  1615. "items": {
  1616. "$ref": "#/components/schemas/Provider"
  1617. }
  1618. },
  1619. "default": {
  1620. "type": "object",
  1621. "propertyNames": {
  1622. "type": "string"
  1623. },
  1624. "additionalProperties": {
  1625. "type": "string"
  1626. }
  1627. }
  1628. },
  1629. "required": ["providers", "default"]
  1630. }
  1631. }
  1632. }
  1633. }
  1634. },
  1635. "x-codeSamples": [
  1636. {
  1637. "lang": "js",
  1638. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.config.providers({\n ...\n})"
  1639. }
  1640. ]
  1641. }
  1642. },
  1643. "/experimental/console": {
  1644. "get": {
  1645. "operationId": "experimental.console.get",
  1646. "parameters": [
  1647. {
  1648. "in": "query",
  1649. "name": "directory",
  1650. "schema": {
  1651. "type": "string"
  1652. }
  1653. },
  1654. {
  1655. "in": "query",
  1656. "name": "workspace",
  1657. "schema": {
  1658. "type": "string"
  1659. }
  1660. }
  1661. ],
  1662. "summary": "Get active Console provider metadata",
  1663. "description": "Get the active Console org name and the set of provider IDs managed by that Console org.",
  1664. "responses": {
  1665. "200": {
  1666. "description": "Active Console provider metadata",
  1667. "content": {
  1668. "application/json": {
  1669. "schema": {
  1670. "$ref": "#/components/schemas/ConsoleState"
  1671. }
  1672. }
  1673. }
  1674. }
  1675. },
  1676. "x-codeSamples": [
  1677. {
  1678. "lang": "js",
  1679. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.console.get({\n ...\n})"
  1680. }
  1681. ]
  1682. }
  1683. },
  1684. "/experimental/console/orgs": {
  1685. "get": {
  1686. "operationId": "experimental.console.listOrgs",
  1687. "parameters": [
  1688. {
  1689. "in": "query",
  1690. "name": "directory",
  1691. "schema": {
  1692. "type": "string"
  1693. }
  1694. },
  1695. {
  1696. "in": "query",
  1697. "name": "workspace",
  1698. "schema": {
  1699. "type": "string"
  1700. }
  1701. }
  1702. ],
  1703. "summary": "List switchable Console orgs",
  1704. "description": "Get the available Console orgs across logged-in accounts, including the current active org.",
  1705. "responses": {
  1706. "200": {
  1707. "description": "Switchable Console orgs",
  1708. "content": {
  1709. "application/json": {
  1710. "schema": {
  1711. "type": "object",
  1712. "properties": {
  1713. "orgs": {
  1714. "type": "array",
  1715. "items": {
  1716. "type": "object",
  1717. "properties": {
  1718. "accountID": {
  1719. "type": "string"
  1720. },
  1721. "accountEmail": {
  1722. "type": "string"
  1723. },
  1724. "accountUrl": {
  1725. "type": "string"
  1726. },
  1727. "orgID": {
  1728. "type": "string"
  1729. },
  1730. "orgName": {
  1731. "type": "string"
  1732. },
  1733. "active": {
  1734. "type": "boolean"
  1735. }
  1736. },
  1737. "required": ["accountID", "accountEmail", "accountUrl", "orgID", "orgName", "active"]
  1738. }
  1739. }
  1740. },
  1741. "required": ["orgs"]
  1742. }
  1743. }
  1744. }
  1745. }
  1746. },
  1747. "x-codeSamples": [
  1748. {
  1749. "lang": "js",
  1750. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.console.listOrgs({\n ...\n})"
  1751. }
  1752. ]
  1753. }
  1754. },
  1755. "/experimental/console/switch": {
  1756. "post": {
  1757. "operationId": "experimental.console.switchOrg",
  1758. "parameters": [
  1759. {
  1760. "in": "query",
  1761. "name": "directory",
  1762. "schema": {
  1763. "type": "string"
  1764. }
  1765. },
  1766. {
  1767. "in": "query",
  1768. "name": "workspace",
  1769. "schema": {
  1770. "type": "string"
  1771. }
  1772. }
  1773. ],
  1774. "summary": "Switch active Console org",
  1775. "description": "Persist a new active Console account/org selection for the current local OpenCode state.",
  1776. "responses": {
  1777. "200": {
  1778. "description": "Switch success",
  1779. "content": {
  1780. "application/json": {
  1781. "schema": {
  1782. "type": "boolean"
  1783. }
  1784. }
  1785. }
  1786. }
  1787. },
  1788. "requestBody": {
  1789. "content": {
  1790. "application/json": {
  1791. "schema": {
  1792. "type": "object",
  1793. "properties": {
  1794. "accountID": {
  1795. "type": "string"
  1796. },
  1797. "orgID": {
  1798. "type": "string"
  1799. }
  1800. },
  1801. "required": ["accountID", "orgID"]
  1802. }
  1803. }
  1804. }
  1805. },
  1806. "x-codeSamples": [
  1807. {
  1808. "lang": "js",
  1809. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.console.switchOrg({\n ...\n})"
  1810. }
  1811. ]
  1812. }
  1813. },
  1814. "/experimental/tool/ids": {
  1815. "get": {
  1816. "operationId": "tool.ids",
  1817. "parameters": [
  1818. {
  1819. "in": "query",
  1820. "name": "directory",
  1821. "schema": {
  1822. "type": "string"
  1823. }
  1824. },
  1825. {
  1826. "in": "query",
  1827. "name": "workspace",
  1828. "schema": {
  1829. "type": "string"
  1830. }
  1831. }
  1832. ],
  1833. "summary": "List tool IDs",
  1834. "description": "Get a list of all available tool IDs, including both built-in tools and dynamically registered tools.",
  1835. "responses": {
  1836. "200": {
  1837. "description": "Tool IDs",
  1838. "content": {
  1839. "application/json": {
  1840. "schema": {
  1841. "$ref": "#/components/schemas/ToolIDs"
  1842. }
  1843. }
  1844. }
  1845. },
  1846. "400": {
  1847. "description": "Bad request",
  1848. "content": {
  1849. "application/json": {
  1850. "schema": {
  1851. "$ref": "#/components/schemas/BadRequestError"
  1852. }
  1853. }
  1854. }
  1855. }
  1856. },
  1857. "x-codeSamples": [
  1858. {
  1859. "lang": "js",
  1860. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tool.ids({\n ...\n})"
  1861. }
  1862. ]
  1863. }
  1864. },
  1865. "/experimental/tool": {
  1866. "get": {
  1867. "operationId": "tool.list",
  1868. "parameters": [
  1869. {
  1870. "in": "query",
  1871. "name": "directory",
  1872. "schema": {
  1873. "type": "string"
  1874. }
  1875. },
  1876. {
  1877. "in": "query",
  1878. "name": "workspace",
  1879. "schema": {
  1880. "type": "string"
  1881. }
  1882. },
  1883. {
  1884. "in": "query",
  1885. "name": "provider",
  1886. "schema": {
  1887. "type": "string"
  1888. },
  1889. "required": true
  1890. },
  1891. {
  1892. "in": "query",
  1893. "name": "model",
  1894. "schema": {
  1895. "type": "string"
  1896. },
  1897. "required": true
  1898. }
  1899. ],
  1900. "summary": "List tools",
  1901. "description": "Get a list of available tools with their JSON schema parameters for a specific provider and model combination.",
  1902. "responses": {
  1903. "200": {
  1904. "description": "Tools",
  1905. "content": {
  1906. "application/json": {
  1907. "schema": {
  1908. "$ref": "#/components/schemas/ToolList"
  1909. }
  1910. }
  1911. }
  1912. },
  1913. "400": {
  1914. "description": "Bad request",
  1915. "content": {
  1916. "application/json": {
  1917. "schema": {
  1918. "$ref": "#/components/schemas/BadRequestError"
  1919. }
  1920. }
  1921. }
  1922. }
  1923. },
  1924. "x-codeSamples": [
  1925. {
  1926. "lang": "js",
  1927. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tool.list({\n ...\n})"
  1928. }
  1929. ]
  1930. }
  1931. },
  1932. "/experimental/worktree": {
  1933. "post": {
  1934. "operationId": "worktree.create",
  1935. "parameters": [
  1936. {
  1937. "in": "query",
  1938. "name": "directory",
  1939. "schema": {
  1940. "type": "string"
  1941. }
  1942. },
  1943. {
  1944. "in": "query",
  1945. "name": "workspace",
  1946. "schema": {
  1947. "type": "string"
  1948. }
  1949. }
  1950. ],
  1951. "summary": "Create worktree",
  1952. "description": "Create a new git worktree for the current project and run any configured startup scripts.",
  1953. "responses": {
  1954. "200": {
  1955. "description": "Worktree created",
  1956. "content": {
  1957. "application/json": {
  1958. "schema": {
  1959. "$ref": "#/components/schemas/Worktree"
  1960. }
  1961. }
  1962. }
  1963. },
  1964. "400": {
  1965. "description": "Bad request",
  1966. "content": {
  1967. "application/json": {
  1968. "schema": {
  1969. "$ref": "#/components/schemas/BadRequestError"
  1970. }
  1971. }
  1972. }
  1973. }
  1974. },
  1975. "requestBody": {
  1976. "content": {
  1977. "application/json": {
  1978. "schema": {
  1979. "$ref": "#/components/schemas/WorktreeCreateInput"
  1980. }
  1981. }
  1982. }
  1983. },
  1984. "x-codeSamples": [
  1985. {
  1986. "lang": "js",
  1987. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.create({\n ...\n})"
  1988. }
  1989. ]
  1990. },
  1991. "get": {
  1992. "operationId": "worktree.list",
  1993. "parameters": [
  1994. {
  1995. "in": "query",
  1996. "name": "directory",
  1997. "schema": {
  1998. "type": "string"
  1999. }
  2000. },
  2001. {
  2002. "in": "query",
  2003. "name": "workspace",
  2004. "schema": {
  2005. "type": "string"
  2006. }
  2007. }
  2008. ],
  2009. "summary": "List worktrees",
  2010. "description": "List all sandbox worktrees for the current project.",
  2011. "responses": {
  2012. "200": {
  2013. "description": "List of worktree directories",
  2014. "content": {
  2015. "application/json": {
  2016. "schema": {
  2017. "type": "array",
  2018. "items": {
  2019. "type": "string"
  2020. }
  2021. }
  2022. }
  2023. }
  2024. }
  2025. },
  2026. "x-codeSamples": [
  2027. {
  2028. "lang": "js",
  2029. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.list({\n ...\n})"
  2030. }
  2031. ]
  2032. },
  2033. "delete": {
  2034. "operationId": "worktree.remove",
  2035. "parameters": [
  2036. {
  2037. "in": "query",
  2038. "name": "directory",
  2039. "schema": {
  2040. "type": "string"
  2041. }
  2042. },
  2043. {
  2044. "in": "query",
  2045. "name": "workspace",
  2046. "schema": {
  2047. "type": "string"
  2048. }
  2049. }
  2050. ],
  2051. "summary": "Remove worktree",
  2052. "description": "Remove a git worktree and delete its branch.",
  2053. "responses": {
  2054. "200": {
  2055. "description": "Worktree removed",
  2056. "content": {
  2057. "application/json": {
  2058. "schema": {
  2059. "type": "boolean"
  2060. }
  2061. }
  2062. }
  2063. },
  2064. "400": {
  2065. "description": "Bad request",
  2066. "content": {
  2067. "application/json": {
  2068. "schema": {
  2069. "$ref": "#/components/schemas/BadRequestError"
  2070. }
  2071. }
  2072. }
  2073. }
  2074. },
  2075. "requestBody": {
  2076. "content": {
  2077. "application/json": {
  2078. "schema": {
  2079. "$ref": "#/components/schemas/WorktreeRemoveInput"
  2080. }
  2081. }
  2082. }
  2083. },
  2084. "x-codeSamples": [
  2085. {
  2086. "lang": "js",
  2087. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.remove({\n ...\n})"
  2088. }
  2089. ]
  2090. }
  2091. },
  2092. "/experimental/worktree/reset": {
  2093. "post": {
  2094. "operationId": "worktree.reset",
  2095. "parameters": [
  2096. {
  2097. "in": "query",
  2098. "name": "directory",
  2099. "schema": {
  2100. "type": "string"
  2101. }
  2102. },
  2103. {
  2104. "in": "query",
  2105. "name": "workspace",
  2106. "schema": {
  2107. "type": "string"
  2108. }
  2109. }
  2110. ],
  2111. "summary": "Reset worktree",
  2112. "description": "Reset a worktree branch to the primary default branch.",
  2113. "responses": {
  2114. "200": {
  2115. "description": "Worktree reset",
  2116. "content": {
  2117. "application/json": {
  2118. "schema": {
  2119. "type": "boolean"
  2120. }
  2121. }
  2122. }
  2123. },
  2124. "400": {
  2125. "description": "Bad request",
  2126. "content": {
  2127. "application/json": {
  2128. "schema": {
  2129. "$ref": "#/components/schemas/BadRequestError"
  2130. }
  2131. }
  2132. }
  2133. }
  2134. },
  2135. "requestBody": {
  2136. "content": {
  2137. "application/json": {
  2138. "schema": {
  2139. "$ref": "#/components/schemas/WorktreeResetInput"
  2140. }
  2141. }
  2142. }
  2143. },
  2144. "x-codeSamples": [
  2145. {
  2146. "lang": "js",
  2147. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.reset({\n ...\n})"
  2148. }
  2149. ]
  2150. }
  2151. },
  2152. "/experimental/session": {
  2153. "get": {
  2154. "operationId": "experimental.session.list",
  2155. "parameters": [
  2156. {
  2157. "in": "query",
  2158. "name": "directory",
  2159. "schema": {
  2160. "type": "string"
  2161. },
  2162. "description": "Filter sessions by project directory"
  2163. },
  2164. {
  2165. "in": "query",
  2166. "name": "workspace",
  2167. "schema": {
  2168. "type": "string"
  2169. }
  2170. },
  2171. {
  2172. "in": "query",
  2173. "name": "roots",
  2174. "schema": {
  2175. "anyOf": [
  2176. {
  2177. "type": "boolean"
  2178. },
  2179. {
  2180. "type": "string",
  2181. "enum": ["true", "false"]
  2182. }
  2183. ]
  2184. },
  2185. "description": "Only return root sessions (no parentID)"
  2186. },
  2187. {
  2188. "in": "query",
  2189. "name": "start",
  2190. "schema": {
  2191. "type": "number"
  2192. },
  2193. "description": "Filter sessions updated on or after this timestamp (milliseconds since epoch)"
  2194. },
  2195. {
  2196. "in": "query",
  2197. "name": "cursor",
  2198. "schema": {
  2199. "type": "number"
  2200. },
  2201. "description": "Return sessions updated before this timestamp (milliseconds since epoch)"
  2202. },
  2203. {
  2204. "in": "query",
  2205. "name": "search",
  2206. "schema": {
  2207. "type": "string"
  2208. },
  2209. "description": "Filter sessions by title (case-insensitive)"
  2210. },
  2211. {
  2212. "in": "query",
  2213. "name": "limit",
  2214. "schema": {
  2215. "type": "number"
  2216. },
  2217. "description": "Maximum number of sessions to return"
  2218. },
  2219. {
  2220. "in": "query",
  2221. "name": "archived",
  2222. "schema": {
  2223. "anyOf": [
  2224. {
  2225. "type": "boolean"
  2226. },
  2227. {
  2228. "type": "string",
  2229. "enum": ["true", "false"]
  2230. }
  2231. ]
  2232. },
  2233. "description": "Include archived sessions (default false)"
  2234. }
  2235. ],
  2236. "summary": "List sessions",
  2237. "description": "Get a list of all OpenCode sessions across projects, sorted by most recently updated. Archived sessions are excluded by default.",
  2238. "responses": {
  2239. "200": {
  2240. "description": "List of sessions",
  2241. "content": {
  2242. "application/json": {
  2243. "schema": {
  2244. "type": "array",
  2245. "items": {
  2246. "$ref": "#/components/schemas/GlobalSession"
  2247. }
  2248. }
  2249. }
  2250. }
  2251. }
  2252. },
  2253. "x-codeSamples": [
  2254. {
  2255. "lang": "js",
  2256. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.session.list({\n ...\n})"
  2257. }
  2258. ]
  2259. }
  2260. },
  2261. "/experimental/resource": {
  2262. "get": {
  2263. "operationId": "experimental.resource.list",
  2264. "parameters": [
  2265. {
  2266. "in": "query",
  2267. "name": "directory",
  2268. "schema": {
  2269. "type": "string"
  2270. }
  2271. },
  2272. {
  2273. "in": "query",
  2274. "name": "workspace",
  2275. "schema": {
  2276. "type": "string"
  2277. }
  2278. }
  2279. ],
  2280. "summary": "Get MCP resources",
  2281. "description": "Get all available MCP resources from connected servers. Optionally filter by name.",
  2282. "responses": {
  2283. "200": {
  2284. "description": "MCP resources",
  2285. "content": {
  2286. "application/json": {
  2287. "schema": {
  2288. "type": "object",
  2289. "propertyNames": {
  2290. "type": "string"
  2291. },
  2292. "additionalProperties": {
  2293. "$ref": "#/components/schemas/McpResource"
  2294. }
  2295. }
  2296. }
  2297. }
  2298. }
  2299. },
  2300. "x-codeSamples": [
  2301. {
  2302. "lang": "js",
  2303. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.resource.list({\n ...\n})"
  2304. }
  2305. ]
  2306. }
  2307. },
  2308. "/session": {
  2309. "get": {
  2310. "operationId": "session.list",
  2311. "parameters": [
  2312. {
  2313. "in": "query",
  2314. "name": "directory",
  2315. "schema": {
  2316. "type": "string"
  2317. },
  2318. "description": "Filter sessions by directory"
  2319. },
  2320. {
  2321. "in": "query",
  2322. "name": "workspace",
  2323. "schema": {
  2324. "type": "string"
  2325. }
  2326. },
  2327. {
  2328. "in": "query",
  2329. "name": "scope",
  2330. "schema": {
  2331. "type": "string",
  2332. "enum": ["project"]
  2333. },
  2334. "description": "List all sessions for the current project"
  2335. },
  2336. {
  2337. "in": "query",
  2338. "name": "path",
  2339. "schema": {
  2340. "type": "string"
  2341. },
  2342. "description": "Filter sessions by project-relative path"
  2343. },
  2344. {
  2345. "in": "query",
  2346. "name": "roots",
  2347. "schema": {
  2348. "anyOf": [
  2349. {
  2350. "type": "boolean"
  2351. },
  2352. {
  2353. "type": "string",
  2354. "enum": ["true", "false"]
  2355. }
  2356. ]
  2357. },
  2358. "description": "Only return root sessions (no parentID)"
  2359. },
  2360. {
  2361. "in": "query",
  2362. "name": "start",
  2363. "schema": {
  2364. "type": "number"
  2365. },
  2366. "description": "Filter sessions updated on or after this timestamp (milliseconds since epoch)"
  2367. },
  2368. {
  2369. "in": "query",
  2370. "name": "search",
  2371. "schema": {
  2372. "type": "string"
  2373. },
  2374. "description": "Filter sessions by title (case-insensitive)"
  2375. },
  2376. {
  2377. "in": "query",
  2378. "name": "limit",
  2379. "schema": {
  2380. "type": "number"
  2381. },
  2382. "description": "Maximum number of sessions to return"
  2383. }
  2384. ],
  2385. "summary": "List sessions",
  2386. "description": "Get a list of all OpenCode sessions, sorted by most recently updated.",
  2387. "responses": {
  2388. "200": {
  2389. "description": "List of sessions",
  2390. "content": {
  2391. "application/json": {
  2392. "schema": {
  2393. "type": "array",
  2394. "items": {
  2395. "$ref": "#/components/schemas/Session"
  2396. }
  2397. }
  2398. }
  2399. }
  2400. }
  2401. },
  2402. "x-codeSamples": [
  2403. {
  2404. "lang": "js",
  2405. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.list({\n ...\n})"
  2406. }
  2407. ]
  2408. },
  2409. "post": {
  2410. "operationId": "session.create",
  2411. "parameters": [
  2412. {
  2413. "in": "query",
  2414. "name": "directory",
  2415. "schema": {
  2416. "type": "string"
  2417. }
  2418. },
  2419. {
  2420. "in": "query",
  2421. "name": "workspace",
  2422. "schema": {
  2423. "type": "string"
  2424. }
  2425. }
  2426. ],
  2427. "summary": "Create session",
  2428. "description": "Create a new OpenCode session for interacting with AI assistants and managing conversations.",
  2429. "responses": {
  2430. "200": {
  2431. "description": "Successfully created session",
  2432. "content": {
  2433. "application/json": {
  2434. "schema": {
  2435. "$ref": "#/components/schemas/Session"
  2436. }
  2437. }
  2438. }
  2439. },
  2440. "400": {
  2441. "description": "Bad request",
  2442. "content": {
  2443. "application/json": {
  2444. "schema": {
  2445. "$ref": "#/components/schemas/BadRequestError"
  2446. }
  2447. }
  2448. }
  2449. }
  2450. },
  2451. "requestBody": {
  2452. "content": {
  2453. "application/json": {
  2454. "schema": {
  2455. "type": "object",
  2456. "properties": {
  2457. "parentID": {
  2458. "type": "string",
  2459. "pattern": "^ses.*"
  2460. },
  2461. "title": {
  2462. "type": "string"
  2463. },
  2464. "agent": {
  2465. "type": "string"
  2466. },
  2467. "model": {
  2468. "type": "object",
  2469. "properties": {
  2470. "id": {
  2471. "type": "string"
  2472. },
  2473. "providerID": {
  2474. "type": "string"
  2475. },
  2476. "variant": {
  2477. "type": "string"
  2478. }
  2479. },
  2480. "required": ["id", "providerID"]
  2481. },
  2482. "permission": {
  2483. "$ref": "#/components/schemas/PermissionRuleset"
  2484. },
  2485. "workspaceID": {
  2486. "type": "string",
  2487. "pattern": "^wrk.*"
  2488. }
  2489. }
  2490. }
  2491. }
  2492. }
  2493. },
  2494. "x-codeSamples": [
  2495. {
  2496. "lang": "js",
  2497. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.create({\n ...\n})"
  2498. }
  2499. ]
  2500. }
  2501. },
  2502. "/session/status": {
  2503. "get": {
  2504. "operationId": "session.status",
  2505. "parameters": [
  2506. {
  2507. "in": "query",
  2508. "name": "directory",
  2509. "schema": {
  2510. "type": "string"
  2511. }
  2512. },
  2513. {
  2514. "in": "query",
  2515. "name": "workspace",
  2516. "schema": {
  2517. "type": "string"
  2518. }
  2519. }
  2520. ],
  2521. "summary": "Get session status",
  2522. "description": "Retrieve the current status of all sessions, including active, idle, and completed states.",
  2523. "responses": {
  2524. "200": {
  2525. "description": "Get session status",
  2526. "content": {
  2527. "application/json": {
  2528. "schema": {
  2529. "type": "object",
  2530. "propertyNames": {
  2531. "type": "string"
  2532. },
  2533. "additionalProperties": {
  2534. "$ref": "#/components/schemas/SessionStatus"
  2535. }
  2536. }
  2537. }
  2538. }
  2539. },
  2540. "400": {
  2541. "description": "Bad request",
  2542. "content": {
  2543. "application/json": {
  2544. "schema": {
  2545. "$ref": "#/components/schemas/BadRequestError"
  2546. }
  2547. }
  2548. }
  2549. }
  2550. },
  2551. "x-codeSamples": [
  2552. {
  2553. "lang": "js",
  2554. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.status({\n ...\n})"
  2555. }
  2556. ]
  2557. }
  2558. },
  2559. "/session/{sessionID}": {
  2560. "get": {
  2561. "operationId": "session.get",
  2562. "parameters": [
  2563. {
  2564. "in": "query",
  2565. "name": "directory",
  2566. "schema": {
  2567. "type": "string"
  2568. }
  2569. },
  2570. {
  2571. "in": "query",
  2572. "name": "workspace",
  2573. "schema": {
  2574. "type": "string"
  2575. }
  2576. },
  2577. {
  2578. "in": "path",
  2579. "name": "sessionID",
  2580. "schema": {
  2581. "type": "string",
  2582. "pattern": "^ses.*"
  2583. },
  2584. "required": true
  2585. }
  2586. ],
  2587. "summary": "Get session",
  2588. "description": "Retrieve detailed information about a specific OpenCode session.",
  2589. "tags": ["Session"],
  2590. "responses": {
  2591. "200": {
  2592. "description": "Get session",
  2593. "content": {
  2594. "application/json": {
  2595. "schema": {
  2596. "$ref": "#/components/schemas/Session"
  2597. }
  2598. }
  2599. }
  2600. },
  2601. "400": {
  2602. "description": "Bad request",
  2603. "content": {
  2604. "application/json": {
  2605. "schema": {
  2606. "$ref": "#/components/schemas/BadRequestError"
  2607. }
  2608. }
  2609. }
  2610. },
  2611. "404": {
  2612. "description": "Not found",
  2613. "content": {
  2614. "application/json": {
  2615. "schema": {
  2616. "$ref": "#/components/schemas/NotFoundError"
  2617. }
  2618. }
  2619. }
  2620. }
  2621. },
  2622. "x-codeSamples": [
  2623. {
  2624. "lang": "js",
  2625. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.get({\n ...\n})"
  2626. }
  2627. ]
  2628. },
  2629. "delete": {
  2630. "operationId": "session.delete",
  2631. "parameters": [
  2632. {
  2633. "in": "query",
  2634. "name": "directory",
  2635. "schema": {
  2636. "type": "string"
  2637. }
  2638. },
  2639. {
  2640. "in": "query",
  2641. "name": "workspace",
  2642. "schema": {
  2643. "type": "string"
  2644. }
  2645. },
  2646. {
  2647. "in": "path",
  2648. "name": "sessionID",
  2649. "schema": {
  2650. "type": "string",
  2651. "pattern": "^ses.*"
  2652. },
  2653. "required": true
  2654. }
  2655. ],
  2656. "summary": "Delete session",
  2657. "description": "Delete a session and permanently remove all associated data, including messages and history.",
  2658. "responses": {
  2659. "200": {
  2660. "description": "Successfully deleted session",
  2661. "content": {
  2662. "application/json": {
  2663. "schema": {
  2664. "type": "boolean"
  2665. }
  2666. }
  2667. }
  2668. },
  2669. "400": {
  2670. "description": "Bad request",
  2671. "content": {
  2672. "application/json": {
  2673. "schema": {
  2674. "$ref": "#/components/schemas/BadRequestError"
  2675. }
  2676. }
  2677. }
  2678. },
  2679. "404": {
  2680. "description": "Not found",
  2681. "content": {
  2682. "application/json": {
  2683. "schema": {
  2684. "$ref": "#/components/schemas/NotFoundError"
  2685. }
  2686. }
  2687. }
  2688. }
  2689. },
  2690. "x-codeSamples": [
  2691. {
  2692. "lang": "js",
  2693. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.delete({\n ...\n})"
  2694. }
  2695. ]
  2696. },
  2697. "patch": {
  2698. "operationId": "session.update",
  2699. "parameters": [
  2700. {
  2701. "in": "query",
  2702. "name": "directory",
  2703. "schema": {
  2704. "type": "string"
  2705. }
  2706. },
  2707. {
  2708. "in": "query",
  2709. "name": "workspace",
  2710. "schema": {
  2711. "type": "string"
  2712. }
  2713. },
  2714. {
  2715. "in": "path",
  2716. "name": "sessionID",
  2717. "schema": {
  2718. "type": "string",
  2719. "pattern": "^ses.*"
  2720. },
  2721. "required": true
  2722. }
  2723. ],
  2724. "summary": "Update session",
  2725. "description": "Update properties of an existing session, such as title or other metadata.",
  2726. "responses": {
  2727. "200": {
  2728. "description": "Successfully updated session",
  2729. "content": {
  2730. "application/json": {
  2731. "schema": {
  2732. "$ref": "#/components/schemas/Session"
  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. "requestBody": {
  2759. "content": {
  2760. "application/json": {
  2761. "schema": {
  2762. "type": "object",
  2763. "properties": {
  2764. "title": {
  2765. "type": "string"
  2766. },
  2767. "permission": {
  2768. "$ref": "#/components/schemas/PermissionRuleset"
  2769. },
  2770. "time": {
  2771. "type": "object",
  2772. "properties": {
  2773. "archived": {
  2774. "type": "number"
  2775. }
  2776. }
  2777. }
  2778. }
  2779. }
  2780. }
  2781. }
  2782. },
  2783. "x-codeSamples": [
  2784. {
  2785. "lang": "js",
  2786. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.update({\n ...\n})"
  2787. }
  2788. ]
  2789. }
  2790. },
  2791. "/session/{sessionID}/children": {
  2792. "get": {
  2793. "operationId": "session.children",
  2794. "parameters": [
  2795. {
  2796. "in": "query",
  2797. "name": "directory",
  2798. "schema": {
  2799. "type": "string"
  2800. }
  2801. },
  2802. {
  2803. "in": "query",
  2804. "name": "workspace",
  2805. "schema": {
  2806. "type": "string"
  2807. }
  2808. },
  2809. {
  2810. "in": "path",
  2811. "name": "sessionID",
  2812. "schema": {
  2813. "type": "string",
  2814. "pattern": "^ses.*"
  2815. },
  2816. "required": true
  2817. }
  2818. ],
  2819. "summary": "Get session children",
  2820. "tags": ["Session"],
  2821. "description": "Retrieve all child sessions that were forked from the specified parent session.",
  2822. "responses": {
  2823. "200": {
  2824. "description": "List of children",
  2825. "content": {
  2826. "application/json": {
  2827. "schema": {
  2828. "type": "array",
  2829. "items": {
  2830. "$ref": "#/components/schemas/Session"
  2831. }
  2832. }
  2833. }
  2834. }
  2835. },
  2836. "400": {
  2837. "description": "Bad request",
  2838. "content": {
  2839. "application/json": {
  2840. "schema": {
  2841. "$ref": "#/components/schemas/BadRequestError"
  2842. }
  2843. }
  2844. }
  2845. },
  2846. "404": {
  2847. "description": "Not found",
  2848. "content": {
  2849. "application/json": {
  2850. "schema": {
  2851. "$ref": "#/components/schemas/NotFoundError"
  2852. }
  2853. }
  2854. }
  2855. }
  2856. },
  2857. "x-codeSamples": [
  2858. {
  2859. "lang": "js",
  2860. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.children({\n ...\n})"
  2861. }
  2862. ]
  2863. }
  2864. },
  2865. "/session/{sessionID}/todo": {
  2866. "get": {
  2867. "operationId": "session.todo",
  2868. "parameters": [
  2869. {
  2870. "in": "query",
  2871. "name": "directory",
  2872. "schema": {
  2873. "type": "string"
  2874. }
  2875. },
  2876. {
  2877. "in": "query",
  2878. "name": "workspace",
  2879. "schema": {
  2880. "type": "string"
  2881. }
  2882. },
  2883. {
  2884. "in": "path",
  2885. "name": "sessionID",
  2886. "schema": {
  2887. "type": "string",
  2888. "pattern": "^ses.*"
  2889. },
  2890. "required": true
  2891. }
  2892. ],
  2893. "summary": "Get session todos",
  2894. "description": "Retrieve the todo list associated with a specific session, showing tasks and action items.",
  2895. "responses": {
  2896. "200": {
  2897. "description": "Todo list",
  2898. "content": {
  2899. "application/json": {
  2900. "schema": {
  2901. "type": "array",
  2902. "items": {
  2903. "$ref": "#/components/schemas/Todo"
  2904. }
  2905. }
  2906. }
  2907. }
  2908. },
  2909. "400": {
  2910. "description": "Bad request",
  2911. "content": {
  2912. "application/json": {
  2913. "schema": {
  2914. "$ref": "#/components/schemas/BadRequestError"
  2915. }
  2916. }
  2917. }
  2918. },
  2919. "404": {
  2920. "description": "Not found",
  2921. "content": {
  2922. "application/json": {
  2923. "schema": {
  2924. "$ref": "#/components/schemas/NotFoundError"
  2925. }
  2926. }
  2927. }
  2928. }
  2929. },
  2930. "x-codeSamples": [
  2931. {
  2932. "lang": "js",
  2933. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.todo({\n ...\n})"
  2934. }
  2935. ]
  2936. }
  2937. },
  2938. "/session/{sessionID}/init": {
  2939. "post": {
  2940. "operationId": "session.init",
  2941. "parameters": [
  2942. {
  2943. "in": "query",
  2944. "name": "directory",
  2945. "schema": {
  2946. "type": "string"
  2947. }
  2948. },
  2949. {
  2950. "in": "query",
  2951. "name": "workspace",
  2952. "schema": {
  2953. "type": "string"
  2954. }
  2955. },
  2956. {
  2957. "in": "path",
  2958. "name": "sessionID",
  2959. "schema": {
  2960. "type": "string",
  2961. "pattern": "^ses.*"
  2962. },
  2963. "required": true
  2964. }
  2965. ],
  2966. "summary": "Initialize session",
  2967. "description": "Analyze the current application and create an AGENTS.md file with project-specific agent configurations.",
  2968. "responses": {
  2969. "200": {
  2970. "description": "200",
  2971. "content": {
  2972. "application/json": {
  2973. "schema": {
  2974. "type": "boolean"
  2975. }
  2976. }
  2977. }
  2978. },
  2979. "400": {
  2980. "description": "Bad request",
  2981. "content": {
  2982. "application/json": {
  2983. "schema": {
  2984. "$ref": "#/components/schemas/BadRequestError"
  2985. }
  2986. }
  2987. }
  2988. },
  2989. "404": {
  2990. "description": "Not found",
  2991. "content": {
  2992. "application/json": {
  2993. "schema": {
  2994. "$ref": "#/components/schemas/NotFoundError"
  2995. }
  2996. }
  2997. }
  2998. }
  2999. },
  3000. "requestBody": {
  3001. "content": {
  3002. "application/json": {
  3003. "schema": {
  3004. "type": "object",
  3005. "properties": {
  3006. "modelID": {
  3007. "type": "string"
  3008. },
  3009. "providerID": {
  3010. "type": "string"
  3011. },
  3012. "messageID": {
  3013. "type": "string",
  3014. "pattern": "^msg.*"
  3015. }
  3016. },
  3017. "required": ["modelID", "providerID", "messageID"]
  3018. }
  3019. }
  3020. }
  3021. },
  3022. "x-codeSamples": [
  3023. {
  3024. "lang": "js",
  3025. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.init({\n ...\n})"
  3026. }
  3027. ]
  3028. }
  3029. },
  3030. "/session/{sessionID}/fork": {
  3031. "post": {
  3032. "operationId": "session.fork",
  3033. "parameters": [
  3034. {
  3035. "in": "query",
  3036. "name": "directory",
  3037. "schema": {
  3038. "type": "string"
  3039. }
  3040. },
  3041. {
  3042. "in": "query",
  3043. "name": "workspace",
  3044. "schema": {
  3045. "type": "string"
  3046. }
  3047. },
  3048. {
  3049. "in": "path",
  3050. "name": "sessionID",
  3051. "schema": {
  3052. "type": "string",
  3053. "pattern": "^ses.*"
  3054. },
  3055. "required": true
  3056. }
  3057. ],
  3058. "summary": "Fork session",
  3059. "description": "Create a new session by forking an existing session at a specific message point.",
  3060. "responses": {
  3061. "200": {
  3062. "description": "200",
  3063. "content": {
  3064. "application/json": {
  3065. "schema": {
  3066. "$ref": "#/components/schemas/Session"
  3067. }
  3068. }
  3069. }
  3070. }
  3071. },
  3072. "requestBody": {
  3073. "content": {
  3074. "application/json": {
  3075. "schema": {
  3076. "type": "object",
  3077. "properties": {
  3078. "messageID": {
  3079. "type": "string",
  3080. "pattern": "^msg.*"
  3081. }
  3082. }
  3083. }
  3084. }
  3085. }
  3086. },
  3087. "x-codeSamples": [
  3088. {
  3089. "lang": "js",
  3090. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.fork({\n ...\n})"
  3091. }
  3092. ]
  3093. }
  3094. },
  3095. "/session/{sessionID}/abort": {
  3096. "post": {
  3097. "operationId": "session.abort",
  3098. "parameters": [
  3099. {
  3100. "in": "query",
  3101. "name": "directory",
  3102. "schema": {
  3103. "type": "string"
  3104. }
  3105. },
  3106. {
  3107. "in": "query",
  3108. "name": "workspace",
  3109. "schema": {
  3110. "type": "string"
  3111. }
  3112. },
  3113. {
  3114. "in": "path",
  3115. "name": "sessionID",
  3116. "schema": {
  3117. "type": "string",
  3118. "pattern": "^ses.*"
  3119. },
  3120. "required": true
  3121. }
  3122. ],
  3123. "summary": "Abort session",
  3124. "description": "Abort an active session and stop any ongoing AI processing or command execution.",
  3125. "responses": {
  3126. "200": {
  3127. "description": "Aborted session",
  3128. "content": {
  3129. "application/json": {
  3130. "schema": {
  3131. "type": "boolean"
  3132. }
  3133. }
  3134. }
  3135. },
  3136. "400": {
  3137. "description": "Bad request",
  3138. "content": {
  3139. "application/json": {
  3140. "schema": {
  3141. "$ref": "#/components/schemas/BadRequestError"
  3142. }
  3143. }
  3144. }
  3145. },
  3146. "404": {
  3147. "description": "Not found",
  3148. "content": {
  3149. "application/json": {
  3150. "schema": {
  3151. "$ref": "#/components/schemas/NotFoundError"
  3152. }
  3153. }
  3154. }
  3155. }
  3156. },
  3157. "x-codeSamples": [
  3158. {
  3159. "lang": "js",
  3160. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.abort({\n ...\n})"
  3161. }
  3162. ]
  3163. }
  3164. },
  3165. "/session/{sessionID}/share": {
  3166. "post": {
  3167. "operationId": "session.share",
  3168. "parameters": [
  3169. {
  3170. "in": "query",
  3171. "name": "directory",
  3172. "schema": {
  3173. "type": "string"
  3174. }
  3175. },
  3176. {
  3177. "in": "query",
  3178. "name": "workspace",
  3179. "schema": {
  3180. "type": "string"
  3181. }
  3182. },
  3183. {
  3184. "in": "path",
  3185. "name": "sessionID",
  3186. "schema": {
  3187. "type": "string",
  3188. "pattern": "^ses.*"
  3189. },
  3190. "required": true
  3191. }
  3192. ],
  3193. "summary": "Share session",
  3194. "description": "Create a shareable link for a session, allowing others to view the conversation.",
  3195. "responses": {
  3196. "200": {
  3197. "description": "Successfully shared session",
  3198. "content": {
  3199. "application/json": {
  3200. "schema": {
  3201. "$ref": "#/components/schemas/Session"
  3202. }
  3203. }
  3204. }
  3205. },
  3206. "400": {
  3207. "description": "Bad request",
  3208. "content": {
  3209. "application/json": {
  3210. "schema": {
  3211. "$ref": "#/components/schemas/BadRequestError"
  3212. }
  3213. }
  3214. }
  3215. },
  3216. "404": {
  3217. "description": "Not found",
  3218. "content": {
  3219. "application/json": {
  3220. "schema": {
  3221. "$ref": "#/components/schemas/NotFoundError"
  3222. }
  3223. }
  3224. }
  3225. }
  3226. },
  3227. "x-codeSamples": [
  3228. {
  3229. "lang": "js",
  3230. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.share({\n ...\n})"
  3231. }
  3232. ]
  3233. },
  3234. "delete": {
  3235. "operationId": "session.unshare",
  3236. "parameters": [
  3237. {
  3238. "in": "query",
  3239. "name": "directory",
  3240. "schema": {
  3241. "type": "string"
  3242. }
  3243. },
  3244. {
  3245. "in": "query",
  3246. "name": "workspace",
  3247. "schema": {
  3248. "type": "string"
  3249. }
  3250. },
  3251. {
  3252. "in": "path",
  3253. "name": "sessionID",
  3254. "schema": {
  3255. "type": "string",
  3256. "pattern": "^ses.*"
  3257. },
  3258. "required": true
  3259. }
  3260. ],
  3261. "summary": "Unshare session",
  3262. "description": "Remove the shareable link for a session, making it private again.",
  3263. "responses": {
  3264. "200": {
  3265. "description": "Successfully unshared session",
  3266. "content": {
  3267. "application/json": {
  3268. "schema": {
  3269. "$ref": "#/components/schemas/Session"
  3270. }
  3271. }
  3272. }
  3273. },
  3274. "400": {
  3275. "description": "Bad request",
  3276. "content": {
  3277. "application/json": {
  3278. "schema": {
  3279. "$ref": "#/components/schemas/BadRequestError"
  3280. }
  3281. }
  3282. }
  3283. },
  3284. "404": {
  3285. "description": "Not found",
  3286. "content": {
  3287. "application/json": {
  3288. "schema": {
  3289. "$ref": "#/components/schemas/NotFoundError"
  3290. }
  3291. }
  3292. }
  3293. }
  3294. },
  3295. "x-codeSamples": [
  3296. {
  3297. "lang": "js",
  3298. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.unshare({\n ...\n})"
  3299. }
  3300. ]
  3301. }
  3302. },
  3303. "/session/{sessionID}/diff": {
  3304. "get": {
  3305. "operationId": "session.diff",
  3306. "parameters": [
  3307. {
  3308. "in": "query",
  3309. "name": "directory",
  3310. "schema": {
  3311. "type": "string"
  3312. }
  3313. },
  3314. {
  3315. "in": "query",
  3316. "name": "workspace",
  3317. "schema": {
  3318. "type": "string"
  3319. }
  3320. },
  3321. {
  3322. "in": "path",
  3323. "name": "sessionID",
  3324. "schema": {
  3325. "type": "string",
  3326. "pattern": "^ses.*"
  3327. },
  3328. "required": true
  3329. },
  3330. {
  3331. "in": "query",
  3332. "name": "messageID",
  3333. "schema": {
  3334. "type": "string",
  3335. "pattern": "^msg.*"
  3336. }
  3337. }
  3338. ],
  3339. "summary": "Get message diff",
  3340. "description": "Get the file changes (diff) that resulted from a specific user message in the session.",
  3341. "responses": {
  3342. "200": {
  3343. "description": "Successfully retrieved diff",
  3344. "content": {
  3345. "application/json": {
  3346. "schema": {
  3347. "type": "array",
  3348. "items": {
  3349. "$ref": "#/components/schemas/SnapshotFileDiff"
  3350. }
  3351. }
  3352. }
  3353. }
  3354. }
  3355. },
  3356. "x-codeSamples": [
  3357. {
  3358. "lang": "js",
  3359. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.diff({\n ...\n})"
  3360. }
  3361. ]
  3362. }
  3363. },
  3364. "/session/{sessionID}/summarize": {
  3365. "post": {
  3366. "operationId": "session.summarize",
  3367. "parameters": [
  3368. {
  3369. "in": "query",
  3370. "name": "directory",
  3371. "schema": {
  3372. "type": "string"
  3373. }
  3374. },
  3375. {
  3376. "in": "query",
  3377. "name": "workspace",
  3378. "schema": {
  3379. "type": "string"
  3380. }
  3381. },
  3382. {
  3383. "in": "path",
  3384. "name": "sessionID",
  3385. "schema": {
  3386. "type": "string",
  3387. "pattern": "^ses.*"
  3388. },
  3389. "required": true
  3390. }
  3391. ],
  3392. "summary": "Summarize session",
  3393. "description": "Generate a concise summary of the session using AI compaction to preserve key information.",
  3394. "responses": {
  3395. "200": {
  3396. "description": "Summarized session",
  3397. "content": {
  3398. "application/json": {
  3399. "schema": {
  3400. "type": "boolean"
  3401. }
  3402. }
  3403. }
  3404. },
  3405. "400": {
  3406. "description": "Bad request",
  3407. "content": {
  3408. "application/json": {
  3409. "schema": {
  3410. "$ref": "#/components/schemas/BadRequestError"
  3411. }
  3412. }
  3413. }
  3414. },
  3415. "404": {
  3416. "description": "Not found",
  3417. "content": {
  3418. "application/json": {
  3419. "schema": {
  3420. "$ref": "#/components/schemas/NotFoundError"
  3421. }
  3422. }
  3423. }
  3424. }
  3425. },
  3426. "requestBody": {
  3427. "content": {
  3428. "application/json": {
  3429. "schema": {
  3430. "type": "object",
  3431. "properties": {
  3432. "providerID": {
  3433. "type": "string"
  3434. },
  3435. "modelID": {
  3436. "type": "string"
  3437. },
  3438. "auto": {
  3439. "default": false,
  3440. "type": "boolean"
  3441. }
  3442. },
  3443. "required": ["providerID", "modelID"]
  3444. }
  3445. }
  3446. }
  3447. },
  3448. "x-codeSamples": [
  3449. {
  3450. "lang": "js",
  3451. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.summarize({\n ...\n})"
  3452. }
  3453. ]
  3454. }
  3455. },
  3456. "/session/{sessionID}/message": {
  3457. "get": {
  3458. "operationId": "session.messages",
  3459. "parameters": [
  3460. {
  3461. "in": "query",
  3462. "name": "directory",
  3463. "schema": {
  3464. "type": "string"
  3465. }
  3466. },
  3467. {
  3468. "in": "query",
  3469. "name": "workspace",
  3470. "schema": {
  3471. "type": "string"
  3472. }
  3473. },
  3474. {
  3475. "in": "path",
  3476. "name": "sessionID",
  3477. "schema": {
  3478. "type": "string",
  3479. "pattern": "^ses.*"
  3480. },
  3481. "required": true
  3482. },
  3483. {
  3484. "in": "query",
  3485. "name": "limit",
  3486. "schema": {
  3487. "type": "integer",
  3488. "minimum": 0,
  3489. "maximum": 9007199254740991
  3490. },
  3491. "description": "Maximum number of messages to return"
  3492. },
  3493. {
  3494. "in": "query",
  3495. "name": "before",
  3496. "schema": {
  3497. "type": "string"
  3498. }
  3499. }
  3500. ],
  3501. "summary": "Get session messages",
  3502. "description": "Retrieve all messages in a session, including user prompts and AI responses.",
  3503. "responses": {
  3504. "200": {
  3505. "description": "List of messages",
  3506. "content": {
  3507. "application/json": {
  3508. "schema": {
  3509. "type": "array",
  3510. "items": {
  3511. "type": "object",
  3512. "properties": {
  3513. "info": {
  3514. "$ref": "#/components/schemas/Message"
  3515. },
  3516. "parts": {
  3517. "type": "array",
  3518. "items": {
  3519. "$ref": "#/components/schemas/Part"
  3520. }
  3521. }
  3522. },
  3523. "required": ["info", "parts"]
  3524. }
  3525. }
  3526. }
  3527. }
  3528. },
  3529. "400": {
  3530. "description": "Bad request",
  3531. "content": {
  3532. "application/json": {
  3533. "schema": {
  3534. "$ref": "#/components/schemas/BadRequestError"
  3535. }
  3536. }
  3537. }
  3538. },
  3539. "404": {
  3540. "description": "Not found",
  3541. "content": {
  3542. "application/json": {
  3543. "schema": {
  3544. "$ref": "#/components/schemas/NotFoundError"
  3545. }
  3546. }
  3547. }
  3548. }
  3549. },
  3550. "x-codeSamples": [
  3551. {
  3552. "lang": "js",
  3553. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.messages({\n ...\n})"
  3554. }
  3555. ]
  3556. },
  3557. "post": {
  3558. "operationId": "session.prompt",
  3559. "parameters": [
  3560. {
  3561. "in": "query",
  3562. "name": "directory",
  3563. "schema": {
  3564. "type": "string"
  3565. }
  3566. },
  3567. {
  3568. "in": "query",
  3569. "name": "workspace",
  3570. "schema": {
  3571. "type": "string"
  3572. }
  3573. },
  3574. {
  3575. "in": "path",
  3576. "name": "sessionID",
  3577. "schema": {
  3578. "type": "string",
  3579. "pattern": "^ses.*"
  3580. },
  3581. "required": true
  3582. }
  3583. ],
  3584. "summary": "Send message",
  3585. "description": "Create and send a new message to a session, streaming the AI response.",
  3586. "responses": {
  3587. "200": {
  3588. "description": "Created message",
  3589. "content": {
  3590. "application/json": {
  3591. "schema": {
  3592. "type": "object",
  3593. "properties": {
  3594. "info": {
  3595. "$ref": "#/components/schemas/AssistantMessage"
  3596. },
  3597. "parts": {
  3598. "type": "array",
  3599. "items": {
  3600. "$ref": "#/components/schemas/Part"
  3601. }
  3602. }
  3603. },
  3604. "required": ["info", "parts"]
  3605. }
  3606. }
  3607. }
  3608. },
  3609. "400": {
  3610. "description": "Bad request",
  3611. "content": {
  3612. "application/json": {
  3613. "schema": {
  3614. "$ref": "#/components/schemas/BadRequestError"
  3615. }
  3616. }
  3617. }
  3618. },
  3619. "404": {
  3620. "description": "Not found",
  3621. "content": {
  3622. "application/json": {
  3623. "schema": {
  3624. "$ref": "#/components/schemas/NotFoundError"
  3625. }
  3626. }
  3627. }
  3628. }
  3629. },
  3630. "requestBody": {
  3631. "content": {
  3632. "application/json": {
  3633. "schema": {
  3634. "type": "object",
  3635. "properties": {
  3636. "messageID": {
  3637. "type": "string",
  3638. "pattern": "^msg.*"
  3639. },
  3640. "model": {
  3641. "type": "object",
  3642. "properties": {
  3643. "providerID": {
  3644. "type": "string"
  3645. },
  3646. "modelID": {
  3647. "type": "string"
  3648. }
  3649. },
  3650. "required": ["providerID", "modelID"]
  3651. },
  3652. "agent": {
  3653. "type": "string"
  3654. },
  3655. "noReply": {
  3656. "type": "boolean"
  3657. },
  3658. "tools": {
  3659. "description": "@deprecated tools and permissions have been merged, you can set permissions on the session itself now",
  3660. "type": "object",
  3661. "propertyNames": {
  3662. "type": "string"
  3663. },
  3664. "additionalProperties": {
  3665. "type": "boolean"
  3666. }
  3667. },
  3668. "format": {
  3669. "$ref": "#/components/schemas/OutputFormat"
  3670. },
  3671. "system": {
  3672. "type": "string"
  3673. },
  3674. "variant": {
  3675. "type": "string"
  3676. },
  3677. "parts": {
  3678. "type": "array",
  3679. "items": {
  3680. "anyOf": [
  3681. {
  3682. "$ref": "#/components/schemas/TextPartInput"
  3683. },
  3684. {
  3685. "$ref": "#/components/schemas/FilePartInput"
  3686. },
  3687. {
  3688. "$ref": "#/components/schemas/AgentPartInput"
  3689. },
  3690. {
  3691. "$ref": "#/components/schemas/SubtaskPartInput"
  3692. }
  3693. ]
  3694. }
  3695. }
  3696. },
  3697. "required": ["parts"]
  3698. }
  3699. }
  3700. }
  3701. },
  3702. "x-codeSamples": [
  3703. {
  3704. "lang": "js",
  3705. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.prompt({\n ...\n})"
  3706. }
  3707. ]
  3708. }
  3709. },
  3710. "/session/{sessionID}/message/{messageID}": {
  3711. "get": {
  3712. "operationId": "session.message",
  3713. "parameters": [
  3714. {
  3715. "in": "query",
  3716. "name": "directory",
  3717. "schema": {
  3718. "type": "string"
  3719. }
  3720. },
  3721. {
  3722. "in": "query",
  3723. "name": "workspace",
  3724. "schema": {
  3725. "type": "string"
  3726. }
  3727. },
  3728. {
  3729. "in": "path",
  3730. "name": "sessionID",
  3731. "schema": {
  3732. "type": "string",
  3733. "pattern": "^ses.*"
  3734. },
  3735. "required": true
  3736. },
  3737. {
  3738. "in": "path",
  3739. "name": "messageID",
  3740. "schema": {
  3741. "type": "string",
  3742. "pattern": "^msg.*"
  3743. },
  3744. "required": true
  3745. }
  3746. ],
  3747. "summary": "Get message",
  3748. "description": "Retrieve a specific message from a session by its message ID.",
  3749. "responses": {
  3750. "200": {
  3751. "description": "Message",
  3752. "content": {
  3753. "application/json": {
  3754. "schema": {
  3755. "type": "object",
  3756. "properties": {
  3757. "info": {
  3758. "$ref": "#/components/schemas/Message"
  3759. },
  3760. "parts": {
  3761. "type": "array",
  3762. "items": {
  3763. "$ref": "#/components/schemas/Part"
  3764. }
  3765. }
  3766. },
  3767. "required": ["info", "parts"]
  3768. }
  3769. }
  3770. }
  3771. },
  3772. "400": {
  3773. "description": "Bad request",
  3774. "content": {
  3775. "application/json": {
  3776. "schema": {
  3777. "$ref": "#/components/schemas/BadRequestError"
  3778. }
  3779. }
  3780. }
  3781. },
  3782. "404": {
  3783. "description": "Not found",
  3784. "content": {
  3785. "application/json": {
  3786. "schema": {
  3787. "$ref": "#/components/schemas/NotFoundError"
  3788. }
  3789. }
  3790. }
  3791. }
  3792. },
  3793. "x-codeSamples": [
  3794. {
  3795. "lang": "js",
  3796. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.message({\n ...\n})"
  3797. }
  3798. ]
  3799. },
  3800. "delete": {
  3801. "operationId": "session.deleteMessage",
  3802. "parameters": [
  3803. {
  3804. "in": "query",
  3805. "name": "directory",
  3806. "schema": {
  3807. "type": "string"
  3808. }
  3809. },
  3810. {
  3811. "in": "query",
  3812. "name": "workspace",
  3813. "schema": {
  3814. "type": "string"
  3815. }
  3816. },
  3817. {
  3818. "in": "path",
  3819. "name": "sessionID",
  3820. "schema": {
  3821. "type": "string",
  3822. "pattern": "^ses.*"
  3823. },
  3824. "required": true
  3825. },
  3826. {
  3827. "in": "path",
  3828. "name": "messageID",
  3829. "schema": {
  3830. "type": "string",
  3831. "pattern": "^msg.*"
  3832. },
  3833. "required": true
  3834. }
  3835. ],
  3836. "summary": "Delete message",
  3837. "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.",
  3838. "responses": {
  3839. "200": {
  3840. "description": "Successfully deleted message",
  3841. "content": {
  3842. "application/json": {
  3843. "schema": {
  3844. "type": "boolean"
  3845. }
  3846. }
  3847. }
  3848. },
  3849. "400": {
  3850. "description": "Bad request",
  3851. "content": {
  3852. "application/json": {
  3853. "schema": {
  3854. "$ref": "#/components/schemas/BadRequestError"
  3855. }
  3856. }
  3857. }
  3858. },
  3859. "404": {
  3860. "description": "Not found",
  3861. "content": {
  3862. "application/json": {
  3863. "schema": {
  3864. "$ref": "#/components/schemas/NotFoundError"
  3865. }
  3866. }
  3867. }
  3868. }
  3869. },
  3870. "x-codeSamples": [
  3871. {
  3872. "lang": "js",
  3873. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.deleteMessage({\n ...\n})"
  3874. }
  3875. ]
  3876. }
  3877. },
  3878. "/session/{sessionID}/message/{messageID}/part/{partID}": {
  3879. "delete": {
  3880. "operationId": "part.delete",
  3881. "parameters": [
  3882. {
  3883. "in": "query",
  3884. "name": "directory",
  3885. "schema": {
  3886. "type": "string"
  3887. }
  3888. },
  3889. {
  3890. "in": "query",
  3891. "name": "workspace",
  3892. "schema": {
  3893. "type": "string"
  3894. }
  3895. },
  3896. {
  3897. "in": "path",
  3898. "name": "sessionID",
  3899. "schema": {
  3900. "type": "string",
  3901. "pattern": "^ses.*"
  3902. },
  3903. "required": true
  3904. },
  3905. {
  3906. "in": "path",
  3907. "name": "messageID",
  3908. "schema": {
  3909. "type": "string",
  3910. "pattern": "^msg.*"
  3911. },
  3912. "required": true
  3913. },
  3914. {
  3915. "in": "path",
  3916. "name": "partID",
  3917. "schema": {
  3918. "type": "string",
  3919. "pattern": "^prt.*"
  3920. },
  3921. "required": true
  3922. }
  3923. ],
  3924. "description": "Delete a part from a message",
  3925. "responses": {
  3926. "200": {
  3927. "description": "Successfully deleted part",
  3928. "content": {
  3929. "application/json": {
  3930. "schema": {
  3931. "type": "boolean"
  3932. }
  3933. }
  3934. }
  3935. },
  3936. "400": {
  3937. "description": "Bad request",
  3938. "content": {
  3939. "application/json": {
  3940. "schema": {
  3941. "$ref": "#/components/schemas/BadRequestError"
  3942. }
  3943. }
  3944. }
  3945. },
  3946. "404": {
  3947. "description": "Not found",
  3948. "content": {
  3949. "application/json": {
  3950. "schema": {
  3951. "$ref": "#/components/schemas/NotFoundError"
  3952. }
  3953. }
  3954. }
  3955. }
  3956. },
  3957. "x-codeSamples": [
  3958. {
  3959. "lang": "js",
  3960. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.part.delete({\n ...\n})"
  3961. }
  3962. ]
  3963. },
  3964. "patch": {
  3965. "operationId": "part.update",
  3966. "parameters": [
  3967. {
  3968. "in": "query",
  3969. "name": "directory",
  3970. "schema": {
  3971. "type": "string"
  3972. }
  3973. },
  3974. {
  3975. "in": "query",
  3976. "name": "workspace",
  3977. "schema": {
  3978. "type": "string"
  3979. }
  3980. },
  3981. {
  3982. "in": "path",
  3983. "name": "sessionID",
  3984. "schema": {
  3985. "type": "string",
  3986. "pattern": "^ses.*"
  3987. },
  3988. "required": true
  3989. },
  3990. {
  3991. "in": "path",
  3992. "name": "messageID",
  3993. "schema": {
  3994. "type": "string",
  3995. "pattern": "^msg.*"
  3996. },
  3997. "required": true
  3998. },
  3999. {
  4000. "in": "path",
  4001. "name": "partID",
  4002. "schema": {
  4003. "type": "string",
  4004. "pattern": "^prt.*"
  4005. },
  4006. "required": true
  4007. }
  4008. ],
  4009. "description": "Update a part in a message",
  4010. "responses": {
  4011. "200": {
  4012. "description": "Successfully updated part",
  4013. "content": {
  4014. "application/json": {
  4015. "schema": {
  4016. "$ref": "#/components/schemas/Part"
  4017. }
  4018. }
  4019. }
  4020. },
  4021. "400": {
  4022. "description": "Bad request",
  4023. "content": {
  4024. "application/json": {
  4025. "schema": {
  4026. "$ref": "#/components/schemas/BadRequestError"
  4027. }
  4028. }
  4029. }
  4030. },
  4031. "404": {
  4032. "description": "Not found",
  4033. "content": {
  4034. "application/json": {
  4035. "schema": {
  4036. "$ref": "#/components/schemas/NotFoundError"
  4037. }
  4038. }
  4039. }
  4040. }
  4041. },
  4042. "requestBody": {
  4043. "content": {
  4044. "application/json": {
  4045. "schema": {
  4046. "$ref": "#/components/schemas/Part"
  4047. }
  4048. }
  4049. }
  4050. },
  4051. "x-codeSamples": [
  4052. {
  4053. "lang": "js",
  4054. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.part.update({\n ...\n})"
  4055. }
  4056. ]
  4057. }
  4058. },
  4059. "/session/{sessionID}/prompt_async": {
  4060. "post": {
  4061. "operationId": "session.prompt_async",
  4062. "parameters": [
  4063. {
  4064. "in": "query",
  4065. "name": "directory",
  4066. "schema": {
  4067. "type": "string"
  4068. }
  4069. },
  4070. {
  4071. "in": "query",
  4072. "name": "workspace",
  4073. "schema": {
  4074. "type": "string"
  4075. }
  4076. },
  4077. {
  4078. "in": "path",
  4079. "name": "sessionID",
  4080. "schema": {
  4081. "type": "string",
  4082. "pattern": "^ses.*"
  4083. },
  4084. "required": true
  4085. }
  4086. ],
  4087. "summary": "Send async message",
  4088. "description": "Create and send a new message to a session asynchronously, starting the session if needed and returning immediately.",
  4089. "responses": {
  4090. "204": {
  4091. "description": "Prompt accepted"
  4092. },
  4093. "400": {
  4094. "description": "Bad request",
  4095. "content": {
  4096. "application/json": {
  4097. "schema": {
  4098. "$ref": "#/components/schemas/BadRequestError"
  4099. }
  4100. }
  4101. }
  4102. },
  4103. "404": {
  4104. "description": "Not found",
  4105. "content": {
  4106. "application/json": {
  4107. "schema": {
  4108. "$ref": "#/components/schemas/NotFoundError"
  4109. }
  4110. }
  4111. }
  4112. }
  4113. },
  4114. "requestBody": {
  4115. "content": {
  4116. "application/json": {
  4117. "schema": {
  4118. "type": "object",
  4119. "properties": {
  4120. "messageID": {
  4121. "type": "string",
  4122. "pattern": "^msg.*"
  4123. },
  4124. "model": {
  4125. "type": "object",
  4126. "properties": {
  4127. "providerID": {
  4128. "type": "string"
  4129. },
  4130. "modelID": {
  4131. "type": "string"
  4132. }
  4133. },
  4134. "required": ["providerID", "modelID"]
  4135. },
  4136. "agent": {
  4137. "type": "string"
  4138. },
  4139. "noReply": {
  4140. "type": "boolean"
  4141. },
  4142. "tools": {
  4143. "description": "@deprecated tools and permissions have been merged, you can set permissions on the session itself now",
  4144. "type": "object",
  4145. "propertyNames": {
  4146. "type": "string"
  4147. },
  4148. "additionalProperties": {
  4149. "type": "boolean"
  4150. }
  4151. },
  4152. "format": {
  4153. "$ref": "#/components/schemas/OutputFormat"
  4154. },
  4155. "system": {
  4156. "type": "string"
  4157. },
  4158. "variant": {
  4159. "type": "string"
  4160. },
  4161. "parts": {
  4162. "type": "array",
  4163. "items": {
  4164. "anyOf": [
  4165. {
  4166. "$ref": "#/components/schemas/TextPartInput"
  4167. },
  4168. {
  4169. "$ref": "#/components/schemas/FilePartInput"
  4170. },
  4171. {
  4172. "$ref": "#/components/schemas/AgentPartInput"
  4173. },
  4174. {
  4175. "$ref": "#/components/schemas/SubtaskPartInput"
  4176. }
  4177. ]
  4178. }
  4179. }
  4180. },
  4181. "required": ["parts"]
  4182. }
  4183. }
  4184. }
  4185. },
  4186. "x-codeSamples": [
  4187. {
  4188. "lang": "js",
  4189. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.prompt_async({\n ...\n})"
  4190. }
  4191. ]
  4192. }
  4193. },
  4194. "/session/{sessionID}/command": {
  4195. "post": {
  4196. "operationId": "session.command",
  4197. "parameters": [
  4198. {
  4199. "in": "query",
  4200. "name": "directory",
  4201. "schema": {
  4202. "type": "string"
  4203. }
  4204. },
  4205. {
  4206. "in": "query",
  4207. "name": "workspace",
  4208. "schema": {
  4209. "type": "string"
  4210. }
  4211. },
  4212. {
  4213. "in": "path",
  4214. "name": "sessionID",
  4215. "schema": {
  4216. "type": "string",
  4217. "pattern": "^ses.*"
  4218. },
  4219. "required": true
  4220. }
  4221. ],
  4222. "summary": "Send command",
  4223. "description": "Send a new command to a session for execution by the AI assistant.",
  4224. "responses": {
  4225. "200": {
  4226. "description": "Created message",
  4227. "content": {
  4228. "application/json": {
  4229. "schema": {
  4230. "type": "object",
  4231. "properties": {
  4232. "info": {
  4233. "$ref": "#/components/schemas/AssistantMessage"
  4234. },
  4235. "parts": {
  4236. "type": "array",
  4237. "items": {
  4238. "$ref": "#/components/schemas/Part"
  4239. }
  4240. }
  4241. },
  4242. "required": ["info", "parts"]
  4243. }
  4244. }
  4245. }
  4246. },
  4247. "400": {
  4248. "description": "Bad request",
  4249. "content": {
  4250. "application/json": {
  4251. "schema": {
  4252. "$ref": "#/components/schemas/BadRequestError"
  4253. }
  4254. }
  4255. }
  4256. },
  4257. "404": {
  4258. "description": "Not found",
  4259. "content": {
  4260. "application/json": {
  4261. "schema": {
  4262. "$ref": "#/components/schemas/NotFoundError"
  4263. }
  4264. }
  4265. }
  4266. }
  4267. },
  4268. "requestBody": {
  4269. "content": {
  4270. "application/json": {
  4271. "schema": {
  4272. "type": "object",
  4273. "properties": {
  4274. "messageID": {
  4275. "type": "string",
  4276. "pattern": "^msg.*"
  4277. },
  4278. "agent": {
  4279. "type": "string"
  4280. },
  4281. "model": {
  4282. "type": "string"
  4283. },
  4284. "arguments": {
  4285. "type": "string"
  4286. },
  4287. "command": {
  4288. "type": "string"
  4289. },
  4290. "variant": {
  4291. "type": "string"
  4292. },
  4293. "parts": {
  4294. "type": "array",
  4295. "items": {
  4296. "type": "object",
  4297. "properties": {
  4298. "id": {
  4299. "type": "string",
  4300. "pattern": "^prt.*"
  4301. },
  4302. "type": {
  4303. "type": "string",
  4304. "const": "file"
  4305. },
  4306. "mime": {
  4307. "type": "string"
  4308. },
  4309. "filename": {
  4310. "type": "string"
  4311. },
  4312. "url": {
  4313. "type": "string"
  4314. },
  4315. "source": {
  4316. "$ref": "#/components/schemas/FilePartSource"
  4317. }
  4318. },
  4319. "required": ["type", "mime", "url"]
  4320. }
  4321. }
  4322. },
  4323. "required": ["arguments", "command"]
  4324. }
  4325. }
  4326. }
  4327. },
  4328. "x-codeSamples": [
  4329. {
  4330. "lang": "js",
  4331. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.command({\n ...\n})"
  4332. }
  4333. ]
  4334. }
  4335. },
  4336. "/session/{sessionID}/shell": {
  4337. "post": {
  4338. "operationId": "session.shell",
  4339. "parameters": [
  4340. {
  4341. "in": "query",
  4342. "name": "directory",
  4343. "schema": {
  4344. "type": "string"
  4345. }
  4346. },
  4347. {
  4348. "in": "query",
  4349. "name": "workspace",
  4350. "schema": {
  4351. "type": "string"
  4352. }
  4353. },
  4354. {
  4355. "in": "path",
  4356. "name": "sessionID",
  4357. "schema": {
  4358. "type": "string",
  4359. "pattern": "^ses.*"
  4360. },
  4361. "required": true
  4362. }
  4363. ],
  4364. "summary": "Run shell command",
  4365. "description": "Execute a shell command within the session context and return the AI's response.",
  4366. "responses": {
  4367. "200": {
  4368. "description": "Created message",
  4369. "content": {
  4370. "application/json": {
  4371. "schema": {
  4372. "type": "object",
  4373. "properties": {
  4374. "info": {
  4375. "$ref": "#/components/schemas/Message"
  4376. },
  4377. "parts": {
  4378. "type": "array",
  4379. "items": {
  4380. "$ref": "#/components/schemas/Part"
  4381. }
  4382. }
  4383. },
  4384. "required": ["info", "parts"]
  4385. }
  4386. }
  4387. }
  4388. },
  4389. "400": {
  4390. "description": "Bad request",
  4391. "content": {
  4392. "application/json": {
  4393. "schema": {
  4394. "$ref": "#/components/schemas/BadRequestError"
  4395. }
  4396. }
  4397. }
  4398. },
  4399. "404": {
  4400. "description": "Not found",
  4401. "content": {
  4402. "application/json": {
  4403. "schema": {
  4404. "$ref": "#/components/schemas/NotFoundError"
  4405. }
  4406. }
  4407. }
  4408. }
  4409. },
  4410. "requestBody": {
  4411. "content": {
  4412. "application/json": {
  4413. "schema": {
  4414. "type": "object",
  4415. "properties": {
  4416. "messageID": {
  4417. "type": "string",
  4418. "pattern": "^msg.*"
  4419. },
  4420. "agent": {
  4421. "type": "string"
  4422. },
  4423. "model": {
  4424. "type": "object",
  4425. "properties": {
  4426. "providerID": {
  4427. "type": "string"
  4428. },
  4429. "modelID": {
  4430. "type": "string"
  4431. }
  4432. },
  4433. "required": ["providerID", "modelID"]
  4434. },
  4435. "command": {
  4436. "type": "string"
  4437. }
  4438. },
  4439. "required": ["agent", "command"]
  4440. }
  4441. }
  4442. }
  4443. },
  4444. "x-codeSamples": [
  4445. {
  4446. "lang": "js",
  4447. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.shell({\n ...\n})"
  4448. }
  4449. ]
  4450. }
  4451. },
  4452. "/session/{sessionID}/revert": {
  4453. "post": {
  4454. "operationId": "session.revert",
  4455. "parameters": [
  4456. {
  4457. "in": "query",
  4458. "name": "directory",
  4459. "schema": {
  4460. "type": "string"
  4461. }
  4462. },
  4463. {
  4464. "in": "query",
  4465. "name": "workspace",
  4466. "schema": {
  4467. "type": "string"
  4468. }
  4469. },
  4470. {
  4471. "in": "path",
  4472. "name": "sessionID",
  4473. "schema": {
  4474. "type": "string",
  4475. "pattern": "^ses.*"
  4476. },
  4477. "required": true
  4478. }
  4479. ],
  4480. "summary": "Revert message",
  4481. "description": "Revert a specific message in a session, undoing its effects and restoring the previous state.",
  4482. "responses": {
  4483. "200": {
  4484. "description": "Updated session",
  4485. "content": {
  4486. "application/json": {
  4487. "schema": {
  4488. "$ref": "#/components/schemas/Session"
  4489. }
  4490. }
  4491. }
  4492. },
  4493. "400": {
  4494. "description": "Bad request",
  4495. "content": {
  4496. "application/json": {
  4497. "schema": {
  4498. "$ref": "#/components/schemas/BadRequestError"
  4499. }
  4500. }
  4501. }
  4502. },
  4503. "404": {
  4504. "description": "Not found",
  4505. "content": {
  4506. "application/json": {
  4507. "schema": {
  4508. "$ref": "#/components/schemas/NotFoundError"
  4509. }
  4510. }
  4511. }
  4512. }
  4513. },
  4514. "requestBody": {
  4515. "content": {
  4516. "application/json": {
  4517. "schema": {
  4518. "type": "object",
  4519. "properties": {
  4520. "messageID": {
  4521. "type": "string",
  4522. "pattern": "^msg.*"
  4523. },
  4524. "partID": {
  4525. "type": "string",
  4526. "pattern": "^prt.*"
  4527. }
  4528. },
  4529. "required": ["messageID"]
  4530. }
  4531. }
  4532. }
  4533. },
  4534. "x-codeSamples": [
  4535. {
  4536. "lang": "js",
  4537. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.revert({\n ...\n})"
  4538. }
  4539. ]
  4540. }
  4541. },
  4542. "/session/{sessionID}/unrevert": {
  4543. "post": {
  4544. "operationId": "session.unrevert",
  4545. "parameters": [
  4546. {
  4547. "in": "query",
  4548. "name": "directory",
  4549. "schema": {
  4550. "type": "string"
  4551. }
  4552. },
  4553. {
  4554. "in": "query",
  4555. "name": "workspace",
  4556. "schema": {
  4557. "type": "string"
  4558. }
  4559. },
  4560. {
  4561. "in": "path",
  4562. "name": "sessionID",
  4563. "schema": {
  4564. "type": "string",
  4565. "pattern": "^ses.*"
  4566. },
  4567. "required": true
  4568. }
  4569. ],
  4570. "summary": "Restore reverted messages",
  4571. "description": "Restore all previously reverted messages in a session.",
  4572. "responses": {
  4573. "200": {
  4574. "description": "Updated session",
  4575. "content": {
  4576. "application/json": {
  4577. "schema": {
  4578. "$ref": "#/components/schemas/Session"
  4579. }
  4580. }
  4581. }
  4582. },
  4583. "400": {
  4584. "description": "Bad request",
  4585. "content": {
  4586. "application/json": {
  4587. "schema": {
  4588. "$ref": "#/components/schemas/BadRequestError"
  4589. }
  4590. }
  4591. }
  4592. },
  4593. "404": {
  4594. "description": "Not found",
  4595. "content": {
  4596. "application/json": {
  4597. "schema": {
  4598. "$ref": "#/components/schemas/NotFoundError"
  4599. }
  4600. }
  4601. }
  4602. }
  4603. },
  4604. "x-codeSamples": [
  4605. {
  4606. "lang": "js",
  4607. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.unrevert({\n ...\n})"
  4608. }
  4609. ]
  4610. }
  4611. },
  4612. "/session/{sessionID}/permissions/{permissionID}": {
  4613. "post": {
  4614. "operationId": "permission.respond",
  4615. "parameters": [
  4616. {
  4617. "in": "query",
  4618. "name": "directory",
  4619. "schema": {
  4620. "type": "string"
  4621. }
  4622. },
  4623. {
  4624. "in": "query",
  4625. "name": "workspace",
  4626. "schema": {
  4627. "type": "string"
  4628. }
  4629. },
  4630. {
  4631. "in": "path",
  4632. "name": "sessionID",
  4633. "schema": {
  4634. "type": "string",
  4635. "pattern": "^ses.*"
  4636. },
  4637. "required": true
  4638. },
  4639. {
  4640. "in": "path",
  4641. "name": "permissionID",
  4642. "schema": {
  4643. "type": "string",
  4644. "pattern": "^per.*"
  4645. },
  4646. "required": true
  4647. }
  4648. ],
  4649. "summary": "Respond to permission",
  4650. "deprecated": true,
  4651. "description": "Approve or deny a permission request from the AI assistant.",
  4652. "responses": {
  4653. "200": {
  4654. "description": "Permission processed successfully",
  4655. "content": {
  4656. "application/json": {
  4657. "schema": {
  4658. "type": "boolean"
  4659. }
  4660. }
  4661. }
  4662. },
  4663. "400": {
  4664. "description": "Bad request",
  4665. "content": {
  4666. "application/json": {
  4667. "schema": {
  4668. "$ref": "#/components/schemas/BadRequestError"
  4669. }
  4670. }
  4671. }
  4672. },
  4673. "404": {
  4674. "description": "Not found",
  4675. "content": {
  4676. "application/json": {
  4677. "schema": {
  4678. "$ref": "#/components/schemas/NotFoundError"
  4679. }
  4680. }
  4681. }
  4682. }
  4683. },
  4684. "requestBody": {
  4685. "content": {
  4686. "application/json": {
  4687. "schema": {
  4688. "type": "object",
  4689. "properties": {
  4690. "response": {
  4691. "type": "string",
  4692. "enum": ["once", "always", "reject"]
  4693. }
  4694. },
  4695. "required": ["response"]
  4696. }
  4697. }
  4698. }
  4699. },
  4700. "x-codeSamples": [
  4701. {
  4702. "lang": "js",
  4703. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.permission.respond({\n ...\n})"
  4704. }
  4705. ]
  4706. }
  4707. },
  4708. "/permission/{requestID}/reply": {
  4709. "post": {
  4710. "operationId": "permission.reply",
  4711. "parameters": [
  4712. {
  4713. "in": "query",
  4714. "name": "directory",
  4715. "schema": {
  4716. "type": "string"
  4717. }
  4718. },
  4719. {
  4720. "in": "query",
  4721. "name": "workspace",
  4722. "schema": {
  4723. "type": "string"
  4724. }
  4725. },
  4726. {
  4727. "in": "path",
  4728. "name": "requestID",
  4729. "schema": {
  4730. "type": "string",
  4731. "pattern": "^per.*"
  4732. },
  4733. "required": true
  4734. }
  4735. ],
  4736. "summary": "Respond to permission request",
  4737. "description": "Approve or deny a permission request from the AI assistant.",
  4738. "responses": {
  4739. "200": {
  4740. "description": "Permission processed successfully",
  4741. "content": {
  4742. "application/json": {
  4743. "schema": {
  4744. "type": "boolean"
  4745. }
  4746. }
  4747. }
  4748. },
  4749. "400": {
  4750. "description": "Bad request",
  4751. "content": {
  4752. "application/json": {
  4753. "schema": {
  4754. "$ref": "#/components/schemas/BadRequestError"
  4755. }
  4756. }
  4757. }
  4758. },
  4759. "404": {
  4760. "description": "Not found",
  4761. "content": {
  4762. "application/json": {
  4763. "schema": {
  4764. "$ref": "#/components/schemas/NotFoundError"
  4765. }
  4766. }
  4767. }
  4768. }
  4769. },
  4770. "requestBody": {
  4771. "content": {
  4772. "application/json": {
  4773. "schema": {
  4774. "type": "object",
  4775. "properties": {
  4776. "reply": {
  4777. "type": "string",
  4778. "enum": ["once", "always", "reject"]
  4779. },
  4780. "message": {
  4781. "type": "string"
  4782. }
  4783. },
  4784. "required": ["reply"]
  4785. }
  4786. }
  4787. }
  4788. },
  4789. "x-codeSamples": [
  4790. {
  4791. "lang": "js",
  4792. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.permission.reply({\n ...\n})"
  4793. }
  4794. ]
  4795. }
  4796. },
  4797. "/permission": {
  4798. "get": {
  4799. "operationId": "permission.list",
  4800. "parameters": [
  4801. {
  4802. "in": "query",
  4803. "name": "directory",
  4804. "schema": {
  4805. "type": "string"
  4806. }
  4807. },
  4808. {
  4809. "in": "query",
  4810. "name": "workspace",
  4811. "schema": {
  4812. "type": "string"
  4813. }
  4814. }
  4815. ],
  4816. "summary": "List pending permissions",
  4817. "description": "Get all pending permission requests across all sessions.",
  4818. "responses": {
  4819. "200": {
  4820. "description": "List of pending permissions",
  4821. "content": {
  4822. "application/json": {
  4823. "schema": {
  4824. "type": "array",
  4825. "items": {
  4826. "$ref": "#/components/schemas/PermissionRequest"
  4827. }
  4828. }
  4829. }
  4830. }
  4831. }
  4832. },
  4833. "x-codeSamples": [
  4834. {
  4835. "lang": "js",
  4836. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.permission.list({\n ...\n})"
  4837. }
  4838. ]
  4839. }
  4840. },
  4841. "/question": {
  4842. "get": {
  4843. "operationId": "question.list",
  4844. "parameters": [
  4845. {
  4846. "in": "query",
  4847. "name": "directory",
  4848. "schema": {
  4849. "type": "string"
  4850. }
  4851. },
  4852. {
  4853. "in": "query",
  4854. "name": "workspace",
  4855. "schema": {
  4856. "type": "string"
  4857. }
  4858. }
  4859. ],
  4860. "summary": "List pending questions",
  4861. "description": "Get all pending question requests across all sessions.",
  4862. "responses": {
  4863. "200": {
  4864. "description": "List of pending questions",
  4865. "content": {
  4866. "application/json": {
  4867. "schema": {
  4868. "type": "array",
  4869. "items": {
  4870. "$ref": "#/components/schemas/QuestionRequest"
  4871. }
  4872. }
  4873. }
  4874. }
  4875. }
  4876. },
  4877. "x-codeSamples": [
  4878. {
  4879. "lang": "js",
  4880. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.question.list({\n ...\n})"
  4881. }
  4882. ]
  4883. }
  4884. },
  4885. "/question/{requestID}/reply": {
  4886. "post": {
  4887. "operationId": "question.reply",
  4888. "parameters": [
  4889. {
  4890. "in": "query",
  4891. "name": "directory",
  4892. "schema": {
  4893. "type": "string"
  4894. }
  4895. },
  4896. {
  4897. "in": "query",
  4898. "name": "workspace",
  4899. "schema": {
  4900. "type": "string"
  4901. }
  4902. },
  4903. {
  4904. "in": "path",
  4905. "name": "requestID",
  4906. "schema": {
  4907. "type": "string",
  4908. "pattern": "^que.*"
  4909. },
  4910. "required": true
  4911. }
  4912. ],
  4913. "summary": "Reply to question request",
  4914. "description": "Provide answers to a question request from the AI assistant.",
  4915. "responses": {
  4916. "200": {
  4917. "description": "Question answered successfully",
  4918. "content": {
  4919. "application/json": {
  4920. "schema": {
  4921. "type": "boolean"
  4922. }
  4923. }
  4924. }
  4925. },
  4926. "400": {
  4927. "description": "Bad request",
  4928. "content": {
  4929. "application/json": {
  4930. "schema": {
  4931. "$ref": "#/components/schemas/BadRequestError"
  4932. }
  4933. }
  4934. }
  4935. },
  4936. "404": {
  4937. "description": "Not found",
  4938. "content": {
  4939. "application/json": {
  4940. "schema": {
  4941. "$ref": "#/components/schemas/NotFoundError"
  4942. }
  4943. }
  4944. }
  4945. }
  4946. },
  4947. "requestBody": {
  4948. "content": {
  4949. "application/json": {
  4950. "schema": {
  4951. "type": "object",
  4952. "properties": {
  4953. "answers": {
  4954. "description": "User answers in order of questions (each answer is an array of selected labels)",
  4955. "type": "array",
  4956. "items": {
  4957. "$ref": "#/components/schemas/QuestionAnswer"
  4958. }
  4959. }
  4960. },
  4961. "required": ["answers"]
  4962. }
  4963. }
  4964. }
  4965. },
  4966. "x-codeSamples": [
  4967. {
  4968. "lang": "js",
  4969. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.question.reply({\n ...\n})"
  4970. }
  4971. ]
  4972. }
  4973. },
  4974. "/question/{requestID}/reject": {
  4975. "post": {
  4976. "operationId": "question.reject",
  4977. "parameters": [
  4978. {
  4979. "in": "query",
  4980. "name": "directory",
  4981. "schema": {
  4982. "type": "string"
  4983. }
  4984. },
  4985. {
  4986. "in": "query",
  4987. "name": "workspace",
  4988. "schema": {
  4989. "type": "string"
  4990. }
  4991. },
  4992. {
  4993. "in": "path",
  4994. "name": "requestID",
  4995. "schema": {
  4996. "type": "string",
  4997. "pattern": "^que.*"
  4998. },
  4999. "required": true
  5000. }
  5001. ],
  5002. "summary": "Reject question request",
  5003. "description": "Reject a question request from the AI assistant.",
  5004. "responses": {
  5005. "200": {
  5006. "description": "Question rejected successfully",
  5007. "content": {
  5008. "application/json": {
  5009. "schema": {
  5010. "type": "boolean"
  5011. }
  5012. }
  5013. }
  5014. },
  5015. "400": {
  5016. "description": "Bad request",
  5017. "content": {
  5018. "application/json": {
  5019. "schema": {
  5020. "$ref": "#/components/schemas/BadRequestError"
  5021. }
  5022. }
  5023. }
  5024. },
  5025. "404": {
  5026. "description": "Not found",
  5027. "content": {
  5028. "application/json": {
  5029. "schema": {
  5030. "$ref": "#/components/schemas/NotFoundError"
  5031. }
  5032. }
  5033. }
  5034. }
  5035. },
  5036. "x-codeSamples": [
  5037. {
  5038. "lang": "js",
  5039. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.question.reject({\n ...\n})"
  5040. }
  5041. ]
  5042. }
  5043. },
  5044. "/provider": {
  5045. "get": {
  5046. "operationId": "provider.list",
  5047. "parameters": [
  5048. {
  5049. "in": "query",
  5050. "name": "directory",
  5051. "schema": {
  5052. "type": "string"
  5053. }
  5054. },
  5055. {
  5056. "in": "query",
  5057. "name": "workspace",
  5058. "schema": {
  5059. "type": "string"
  5060. }
  5061. }
  5062. ],
  5063. "summary": "List providers",
  5064. "description": "Get a list of all available AI providers, including both available and connected ones.",
  5065. "responses": {
  5066. "200": {
  5067. "description": "List of providers",
  5068. "content": {
  5069. "application/json": {
  5070. "schema": {
  5071. "type": "object",
  5072. "properties": {
  5073. "all": {
  5074. "type": "array",
  5075. "items": {
  5076. "$ref": "#/components/schemas/Provider"
  5077. }
  5078. },
  5079. "default": {
  5080. "type": "object",
  5081. "propertyNames": {
  5082. "type": "string"
  5083. },
  5084. "additionalProperties": {
  5085. "type": "string"
  5086. }
  5087. },
  5088. "connected": {
  5089. "type": "array",
  5090. "items": {
  5091. "type": "string"
  5092. }
  5093. }
  5094. },
  5095. "required": ["all", "default", "connected"]
  5096. }
  5097. }
  5098. }
  5099. }
  5100. },
  5101. "x-codeSamples": [
  5102. {
  5103. "lang": "js",
  5104. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.list({\n ...\n})"
  5105. }
  5106. ]
  5107. }
  5108. },
  5109. "/provider/auth": {
  5110. "get": {
  5111. "operationId": "provider.auth",
  5112. "parameters": [
  5113. {
  5114. "in": "query",
  5115. "name": "directory",
  5116. "schema": {
  5117. "type": "string"
  5118. }
  5119. },
  5120. {
  5121. "in": "query",
  5122. "name": "workspace",
  5123. "schema": {
  5124. "type": "string"
  5125. }
  5126. }
  5127. ],
  5128. "summary": "Get provider auth methods",
  5129. "description": "Retrieve available authentication methods for all AI providers.",
  5130. "responses": {
  5131. "200": {
  5132. "description": "Provider auth methods",
  5133. "content": {
  5134. "application/json": {
  5135. "schema": {
  5136. "type": "object",
  5137. "propertyNames": {
  5138. "type": "string"
  5139. },
  5140. "additionalProperties": {
  5141. "type": "array",
  5142. "items": {
  5143. "$ref": "#/components/schemas/ProviderAuthMethod"
  5144. }
  5145. }
  5146. }
  5147. }
  5148. }
  5149. }
  5150. },
  5151. "x-codeSamples": [
  5152. {
  5153. "lang": "js",
  5154. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.auth({\n ...\n})"
  5155. }
  5156. ]
  5157. }
  5158. },
  5159. "/provider/{providerID}/oauth/authorize": {
  5160. "post": {
  5161. "operationId": "provider.oauth.authorize",
  5162. "parameters": [
  5163. {
  5164. "in": "query",
  5165. "name": "directory",
  5166. "schema": {
  5167. "type": "string"
  5168. }
  5169. },
  5170. {
  5171. "in": "query",
  5172. "name": "workspace",
  5173. "schema": {
  5174. "type": "string"
  5175. }
  5176. },
  5177. {
  5178. "in": "path",
  5179. "name": "providerID",
  5180. "schema": {
  5181. "type": "string"
  5182. },
  5183. "required": true,
  5184. "description": "Provider ID"
  5185. }
  5186. ],
  5187. "summary": "OAuth authorize",
  5188. "description": "Initiate OAuth authorization for a specific AI provider to get an authorization URL.",
  5189. "responses": {
  5190. "200": {
  5191. "description": "Authorization URL and method",
  5192. "content": {
  5193. "application/json": {
  5194. "schema": {
  5195. "$ref": "#/components/schemas/ProviderAuthAuthorization"
  5196. }
  5197. }
  5198. }
  5199. },
  5200. "400": {
  5201. "description": "Bad request",
  5202. "content": {
  5203. "application/json": {
  5204. "schema": {
  5205. "$ref": "#/components/schemas/BadRequestError"
  5206. }
  5207. }
  5208. }
  5209. }
  5210. },
  5211. "requestBody": {
  5212. "content": {
  5213. "application/json": {
  5214. "schema": {
  5215. "type": "object",
  5216. "properties": {
  5217. "method": {
  5218. "description": "Auth method index",
  5219. "type": "number"
  5220. },
  5221. "inputs": {
  5222. "description": "Prompt inputs",
  5223. "type": "object",
  5224. "propertyNames": {
  5225. "type": "string"
  5226. },
  5227. "additionalProperties": {
  5228. "type": "string"
  5229. }
  5230. }
  5231. },
  5232. "required": ["method"]
  5233. }
  5234. }
  5235. }
  5236. },
  5237. "x-codeSamples": [
  5238. {
  5239. "lang": "js",
  5240. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.oauth.authorize({\n ...\n})"
  5241. }
  5242. ]
  5243. }
  5244. },
  5245. "/provider/{providerID}/oauth/callback": {
  5246. "post": {
  5247. "operationId": "provider.oauth.callback",
  5248. "parameters": [
  5249. {
  5250. "in": "query",
  5251. "name": "directory",
  5252. "schema": {
  5253. "type": "string"
  5254. }
  5255. },
  5256. {
  5257. "in": "query",
  5258. "name": "workspace",
  5259. "schema": {
  5260. "type": "string"
  5261. }
  5262. },
  5263. {
  5264. "in": "path",
  5265. "name": "providerID",
  5266. "schema": {
  5267. "type": "string"
  5268. },
  5269. "required": true,
  5270. "description": "Provider ID"
  5271. }
  5272. ],
  5273. "summary": "OAuth callback",
  5274. "description": "Handle the OAuth callback from a provider after user authorization.",
  5275. "responses": {
  5276. "200": {
  5277. "description": "OAuth callback processed successfully",
  5278. "content": {
  5279. "application/json": {
  5280. "schema": {
  5281. "type": "boolean"
  5282. }
  5283. }
  5284. }
  5285. },
  5286. "400": {
  5287. "description": "Bad request",
  5288. "content": {
  5289. "application/json": {
  5290. "schema": {
  5291. "$ref": "#/components/schemas/BadRequestError"
  5292. }
  5293. }
  5294. }
  5295. }
  5296. },
  5297. "requestBody": {
  5298. "content": {
  5299. "application/json": {
  5300. "schema": {
  5301. "type": "object",
  5302. "properties": {
  5303. "method": {
  5304. "description": "Auth method index",
  5305. "type": "number"
  5306. },
  5307. "code": {
  5308. "description": "OAuth authorization code",
  5309. "type": "string"
  5310. }
  5311. },
  5312. "required": ["method"]
  5313. }
  5314. }
  5315. }
  5316. },
  5317. "x-codeSamples": [
  5318. {
  5319. "lang": "js",
  5320. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.oauth.callback({\n ...\n})"
  5321. }
  5322. ]
  5323. }
  5324. },
  5325. "/sync/start": {
  5326. "post": {
  5327. "operationId": "sync.start",
  5328. "parameters": [
  5329. {
  5330. "in": "query",
  5331. "name": "directory",
  5332. "schema": {
  5333. "type": "string"
  5334. }
  5335. },
  5336. {
  5337. "in": "query",
  5338. "name": "workspace",
  5339. "schema": {
  5340. "type": "string"
  5341. }
  5342. }
  5343. ],
  5344. "summary": "Start workspace sync",
  5345. "description": "Start sync loops for workspaces in the current project that have active sessions.",
  5346. "responses": {
  5347. "200": {
  5348. "description": "Workspace sync started",
  5349. "content": {
  5350. "application/json": {
  5351. "schema": {
  5352. "type": "boolean"
  5353. }
  5354. }
  5355. }
  5356. }
  5357. },
  5358. "x-codeSamples": [
  5359. {
  5360. "lang": "js",
  5361. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.sync.start({\n ...\n})"
  5362. }
  5363. ]
  5364. }
  5365. },
  5366. "/sync/replay": {
  5367. "post": {
  5368. "operationId": "sync.replay",
  5369. "parameters": [
  5370. {
  5371. "in": "query",
  5372. "name": "directory",
  5373. "schema": {
  5374. "type": "string"
  5375. }
  5376. },
  5377. {
  5378. "in": "query",
  5379. "name": "workspace",
  5380. "schema": {
  5381. "type": "string"
  5382. }
  5383. }
  5384. ],
  5385. "summary": "Replay sync events",
  5386. "description": "Validate and replay a complete sync event history.",
  5387. "responses": {
  5388. "200": {
  5389. "description": "Replayed sync events",
  5390. "content": {
  5391. "application/json": {
  5392. "schema": {
  5393. "type": "object",
  5394. "properties": {
  5395. "sessionID": {
  5396. "type": "string"
  5397. }
  5398. },
  5399. "required": ["sessionID"]
  5400. }
  5401. }
  5402. }
  5403. },
  5404. "400": {
  5405. "description": "Bad request",
  5406. "content": {
  5407. "application/json": {
  5408. "schema": {
  5409. "$ref": "#/components/schemas/BadRequestError"
  5410. }
  5411. }
  5412. }
  5413. }
  5414. },
  5415. "requestBody": {
  5416. "content": {
  5417. "application/json": {
  5418. "schema": {
  5419. "type": "object",
  5420. "properties": {
  5421. "directory": {
  5422. "type": "string"
  5423. },
  5424. "events": {
  5425. "minItems": 1,
  5426. "type": "array",
  5427. "items": {
  5428. "type": "object",
  5429. "properties": {
  5430. "id": {
  5431. "type": "string"
  5432. },
  5433. "aggregateID": {
  5434. "type": "string"
  5435. },
  5436. "seq": {
  5437. "type": "integer",
  5438. "minimum": 0,
  5439. "maximum": 9007199254740991
  5440. },
  5441. "type": {
  5442. "type": "string"
  5443. },
  5444. "data": {
  5445. "type": "object",
  5446. "propertyNames": {
  5447. "type": "string"
  5448. },
  5449. "additionalProperties": {}
  5450. }
  5451. },
  5452. "required": ["id", "aggregateID", "seq", "type", "data"]
  5453. }
  5454. }
  5455. },
  5456. "required": ["directory", "events"]
  5457. }
  5458. }
  5459. }
  5460. },
  5461. "x-codeSamples": [
  5462. {
  5463. "lang": "js",
  5464. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.sync.replay({\n ...\n})"
  5465. }
  5466. ]
  5467. }
  5468. },
  5469. "/sync/history": {
  5470. "post": {
  5471. "operationId": "sync.history.list",
  5472. "parameters": [
  5473. {
  5474. "in": "query",
  5475. "name": "directory",
  5476. "schema": {
  5477. "type": "string"
  5478. }
  5479. },
  5480. {
  5481. "in": "query",
  5482. "name": "workspace",
  5483. "schema": {
  5484. "type": "string"
  5485. }
  5486. }
  5487. ],
  5488. "summary": "List sync events",
  5489. "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.",
  5490. "responses": {
  5491. "200": {
  5492. "description": "Sync events",
  5493. "content": {
  5494. "application/json": {
  5495. "schema": {
  5496. "type": "array",
  5497. "items": {
  5498. "type": "object",
  5499. "properties": {
  5500. "id": {
  5501. "type": "string"
  5502. },
  5503. "aggregate_id": {
  5504. "type": "string"
  5505. },
  5506. "seq": {
  5507. "type": "number"
  5508. },
  5509. "type": {
  5510. "type": "string"
  5511. },
  5512. "data": {
  5513. "type": "object",
  5514. "propertyNames": {
  5515. "type": "string"
  5516. },
  5517. "additionalProperties": {}
  5518. }
  5519. },
  5520. "required": ["id", "aggregate_id", "seq", "type", "data"]
  5521. }
  5522. }
  5523. }
  5524. }
  5525. },
  5526. "400": {
  5527. "description": "Bad request",
  5528. "content": {
  5529. "application/json": {
  5530. "schema": {
  5531. "$ref": "#/components/schemas/BadRequestError"
  5532. }
  5533. }
  5534. }
  5535. }
  5536. },
  5537. "requestBody": {
  5538. "content": {
  5539. "application/json": {
  5540. "schema": {
  5541. "type": "object",
  5542. "propertyNames": {
  5543. "type": "string"
  5544. },
  5545. "additionalProperties": {
  5546. "type": "integer",
  5547. "minimum": 0,
  5548. "maximum": 9007199254740991
  5549. }
  5550. }
  5551. }
  5552. }
  5553. },
  5554. "x-codeSamples": [
  5555. {
  5556. "lang": "js",
  5557. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.sync.history.list({\n ...\n})"
  5558. }
  5559. ]
  5560. }
  5561. },
  5562. "/find": {
  5563. "get": {
  5564. "operationId": "find.text",
  5565. "parameters": [
  5566. {
  5567. "in": "query",
  5568. "name": "directory",
  5569. "schema": {
  5570. "type": "string"
  5571. }
  5572. },
  5573. {
  5574. "in": "query",
  5575. "name": "workspace",
  5576. "schema": {
  5577. "type": "string"
  5578. }
  5579. },
  5580. {
  5581. "in": "query",
  5582. "name": "pattern",
  5583. "schema": {
  5584. "type": "string"
  5585. },
  5586. "required": true
  5587. }
  5588. ],
  5589. "summary": "Find text",
  5590. "description": "Search for text patterns across files in the project using ripgrep.",
  5591. "responses": {
  5592. "200": {
  5593. "description": "Matches",
  5594. "content": {
  5595. "application/json": {
  5596. "schema": {
  5597. "type": "array",
  5598. "items": {
  5599. "type": "object",
  5600. "properties": {
  5601. "path": {
  5602. "type": "object",
  5603. "properties": {
  5604. "text": {
  5605. "type": "string"
  5606. }
  5607. },
  5608. "required": ["text"]
  5609. },
  5610. "lines": {
  5611. "type": "object",
  5612. "properties": {
  5613. "text": {
  5614. "type": "string"
  5615. }
  5616. },
  5617. "required": ["text"]
  5618. },
  5619. "line_number": {
  5620. "type": "integer",
  5621. "minimum": 0,
  5622. "maximum": 9007199254740991
  5623. },
  5624. "absolute_offset": {
  5625. "type": "integer",
  5626. "minimum": 0,
  5627. "maximum": 9007199254740991
  5628. },
  5629. "submatches": {
  5630. "type": "array",
  5631. "items": {
  5632. "type": "object",
  5633. "properties": {
  5634. "match": {
  5635. "type": "object",
  5636. "properties": {
  5637. "text": {
  5638. "type": "string"
  5639. }
  5640. },
  5641. "required": ["text"]
  5642. },
  5643. "start": {
  5644. "type": "integer",
  5645. "minimum": 0,
  5646. "maximum": 9007199254740991
  5647. },
  5648. "end": {
  5649. "type": "integer",
  5650. "minimum": 0,
  5651. "maximum": 9007199254740991
  5652. }
  5653. },
  5654. "required": ["match", "start", "end"]
  5655. }
  5656. }
  5657. },
  5658. "required": ["path", "lines", "line_number", "absolute_offset", "submatches"]
  5659. }
  5660. }
  5661. }
  5662. }
  5663. }
  5664. },
  5665. "x-codeSamples": [
  5666. {
  5667. "lang": "js",
  5668. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.find.text({\n ...\n})"
  5669. }
  5670. ]
  5671. }
  5672. },
  5673. "/find/file": {
  5674. "get": {
  5675. "operationId": "find.files",
  5676. "parameters": [
  5677. {
  5678. "in": "query",
  5679. "name": "directory",
  5680. "schema": {
  5681. "type": "string"
  5682. }
  5683. },
  5684. {
  5685. "in": "query",
  5686. "name": "workspace",
  5687. "schema": {
  5688. "type": "string"
  5689. }
  5690. },
  5691. {
  5692. "in": "query",
  5693. "name": "query",
  5694. "schema": {
  5695. "type": "string"
  5696. },
  5697. "required": true
  5698. },
  5699. {
  5700. "in": "query",
  5701. "name": "dirs",
  5702. "schema": {
  5703. "type": "string",
  5704. "enum": ["true", "false"]
  5705. }
  5706. },
  5707. {
  5708. "in": "query",
  5709. "name": "type",
  5710. "schema": {
  5711. "type": "string",
  5712. "enum": ["file", "directory"]
  5713. }
  5714. },
  5715. {
  5716. "in": "query",
  5717. "name": "limit",
  5718. "schema": {
  5719. "type": "integer",
  5720. "minimum": 1,
  5721. "maximum": 200
  5722. }
  5723. }
  5724. ],
  5725. "summary": "Find files",
  5726. "description": "Search for files or directories by name or pattern in the project directory.",
  5727. "responses": {
  5728. "200": {
  5729. "description": "File paths",
  5730. "content": {
  5731. "application/json": {
  5732. "schema": {
  5733. "type": "array",
  5734. "items": {
  5735. "type": "string"
  5736. }
  5737. }
  5738. }
  5739. }
  5740. }
  5741. },
  5742. "x-codeSamples": [
  5743. {
  5744. "lang": "js",
  5745. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.find.files({\n ...\n})"
  5746. }
  5747. ]
  5748. }
  5749. },
  5750. "/find/symbol": {
  5751. "get": {
  5752. "operationId": "find.symbols",
  5753. "parameters": [
  5754. {
  5755. "in": "query",
  5756. "name": "directory",
  5757. "schema": {
  5758. "type": "string"
  5759. }
  5760. },
  5761. {
  5762. "in": "query",
  5763. "name": "workspace",
  5764. "schema": {
  5765. "type": "string"
  5766. }
  5767. },
  5768. {
  5769. "in": "query",
  5770. "name": "query",
  5771. "schema": {
  5772. "type": "string"
  5773. },
  5774. "required": true
  5775. }
  5776. ],
  5777. "summary": "Find symbols",
  5778. "description": "Search for workspace symbols like functions, classes, and variables using LSP.",
  5779. "responses": {
  5780. "200": {
  5781. "description": "Symbols",
  5782. "content": {
  5783. "application/json": {
  5784. "schema": {
  5785. "type": "array",
  5786. "items": {
  5787. "$ref": "#/components/schemas/Symbol"
  5788. }
  5789. }
  5790. }
  5791. }
  5792. }
  5793. },
  5794. "x-codeSamples": [
  5795. {
  5796. "lang": "js",
  5797. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.find.symbols({\n ...\n})"
  5798. }
  5799. ]
  5800. }
  5801. },
  5802. "/file": {
  5803. "get": {
  5804. "operationId": "file.list",
  5805. "parameters": [
  5806. {
  5807. "in": "query",
  5808. "name": "directory",
  5809. "schema": {
  5810. "type": "string"
  5811. }
  5812. },
  5813. {
  5814. "in": "query",
  5815. "name": "workspace",
  5816. "schema": {
  5817. "type": "string"
  5818. }
  5819. },
  5820. {
  5821. "in": "query",
  5822. "name": "path",
  5823. "schema": {
  5824. "type": "string"
  5825. },
  5826. "required": true
  5827. }
  5828. ],
  5829. "summary": "List files",
  5830. "description": "List files and directories in a specified path.",
  5831. "responses": {
  5832. "200": {
  5833. "description": "Files and directories",
  5834. "content": {
  5835. "application/json": {
  5836. "schema": {
  5837. "type": "array",
  5838. "items": {
  5839. "$ref": "#/components/schemas/FileNode"
  5840. }
  5841. }
  5842. }
  5843. }
  5844. }
  5845. },
  5846. "x-codeSamples": [
  5847. {
  5848. "lang": "js",
  5849. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.file.list({\n ...\n})"
  5850. }
  5851. ]
  5852. }
  5853. },
  5854. "/file/content": {
  5855. "get": {
  5856. "operationId": "file.read",
  5857. "parameters": [
  5858. {
  5859. "in": "query",
  5860. "name": "directory",
  5861. "schema": {
  5862. "type": "string"
  5863. }
  5864. },
  5865. {
  5866. "in": "query",
  5867. "name": "workspace",
  5868. "schema": {
  5869. "type": "string"
  5870. }
  5871. },
  5872. {
  5873. "in": "query",
  5874. "name": "path",
  5875. "schema": {
  5876. "type": "string"
  5877. },
  5878. "required": true
  5879. }
  5880. ],
  5881. "summary": "Read file",
  5882. "description": "Read the content of a specified file.",
  5883. "responses": {
  5884. "200": {
  5885. "description": "File content",
  5886. "content": {
  5887. "application/json": {
  5888. "schema": {
  5889. "$ref": "#/components/schemas/FileContent"
  5890. }
  5891. }
  5892. }
  5893. }
  5894. },
  5895. "x-codeSamples": [
  5896. {
  5897. "lang": "js",
  5898. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.file.read({\n ...\n})"
  5899. }
  5900. ]
  5901. }
  5902. },
  5903. "/file/status": {
  5904. "get": {
  5905. "operationId": "file.status",
  5906. "parameters": [
  5907. {
  5908. "in": "query",
  5909. "name": "directory",
  5910. "schema": {
  5911. "type": "string"
  5912. }
  5913. },
  5914. {
  5915. "in": "query",
  5916. "name": "workspace",
  5917. "schema": {
  5918. "type": "string"
  5919. }
  5920. }
  5921. ],
  5922. "summary": "Get file status",
  5923. "description": "Get the git status of all files in the project.",
  5924. "responses": {
  5925. "200": {
  5926. "description": "File status",
  5927. "content": {
  5928. "application/json": {
  5929. "schema": {
  5930. "type": "array",
  5931. "items": {
  5932. "$ref": "#/components/schemas/File"
  5933. }
  5934. }
  5935. }
  5936. }
  5937. }
  5938. },
  5939. "x-codeSamples": [
  5940. {
  5941. "lang": "js",
  5942. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.file.status({\n ...\n})"
  5943. }
  5944. ]
  5945. }
  5946. },
  5947. "/event": {
  5948. "get": {
  5949. "operationId": "event.subscribe",
  5950. "parameters": [
  5951. {
  5952. "in": "query",
  5953. "name": "directory",
  5954. "schema": {
  5955. "type": "string"
  5956. }
  5957. },
  5958. {
  5959. "in": "query",
  5960. "name": "workspace",
  5961. "schema": {
  5962. "type": "string"
  5963. }
  5964. }
  5965. ],
  5966. "summary": "Subscribe to events",
  5967. "description": "Get events",
  5968. "responses": {
  5969. "200": {
  5970. "description": "Event stream",
  5971. "content": {
  5972. "text/event-stream": {
  5973. "schema": {
  5974. "$ref": "#/components/schemas/Event"
  5975. }
  5976. }
  5977. }
  5978. }
  5979. },
  5980. "x-codeSamples": [
  5981. {
  5982. "lang": "js",
  5983. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.event.subscribe({\n ...\n})"
  5984. }
  5985. ]
  5986. }
  5987. },
  5988. "/mcp": {
  5989. "get": {
  5990. "operationId": "mcp.status",
  5991. "parameters": [
  5992. {
  5993. "in": "query",
  5994. "name": "directory",
  5995. "schema": {
  5996. "type": "string"
  5997. }
  5998. },
  5999. {
  6000. "in": "query",
  6001. "name": "workspace",
  6002. "schema": {
  6003. "type": "string"
  6004. }
  6005. }
  6006. ],
  6007. "summary": "Get MCP status",
  6008. "description": "Get the status of all Model Context Protocol (MCP) servers.",
  6009. "responses": {
  6010. "200": {
  6011. "description": "MCP server status",
  6012. "content": {
  6013. "application/json": {
  6014. "schema": {
  6015. "type": "object",
  6016. "propertyNames": {
  6017. "type": "string"
  6018. },
  6019. "additionalProperties": {
  6020. "$ref": "#/components/schemas/MCPStatus"
  6021. }
  6022. }
  6023. }
  6024. }
  6025. }
  6026. },
  6027. "x-codeSamples": [
  6028. {
  6029. "lang": "js",
  6030. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.status({\n ...\n})"
  6031. }
  6032. ]
  6033. },
  6034. "post": {
  6035. "operationId": "mcp.add",
  6036. "parameters": [
  6037. {
  6038. "in": "query",
  6039. "name": "directory",
  6040. "schema": {
  6041. "type": "string"
  6042. }
  6043. },
  6044. {
  6045. "in": "query",
  6046. "name": "workspace",
  6047. "schema": {
  6048. "type": "string"
  6049. }
  6050. }
  6051. ],
  6052. "summary": "Add MCP server",
  6053. "description": "Dynamically add a new Model Context Protocol (MCP) server to the system.",
  6054. "responses": {
  6055. "200": {
  6056. "description": "MCP server added successfully",
  6057. "content": {
  6058. "application/json": {
  6059. "schema": {
  6060. "type": "object",
  6061. "propertyNames": {
  6062. "type": "string"
  6063. },
  6064. "additionalProperties": {
  6065. "$ref": "#/components/schemas/MCPStatus"
  6066. }
  6067. }
  6068. }
  6069. }
  6070. },
  6071. "400": {
  6072. "description": "Bad request",
  6073. "content": {
  6074. "application/json": {
  6075. "schema": {
  6076. "$ref": "#/components/schemas/BadRequestError"
  6077. }
  6078. }
  6079. }
  6080. }
  6081. },
  6082. "requestBody": {
  6083. "content": {
  6084. "application/json": {
  6085. "schema": {
  6086. "type": "object",
  6087. "properties": {
  6088. "name": {
  6089. "type": "string"
  6090. },
  6091. "config": {
  6092. "anyOf": [
  6093. {
  6094. "$ref": "#/components/schemas/McpLocalConfig"
  6095. },
  6096. {
  6097. "$ref": "#/components/schemas/McpRemoteConfig"
  6098. }
  6099. ]
  6100. }
  6101. },
  6102. "required": ["name", "config"]
  6103. }
  6104. }
  6105. }
  6106. },
  6107. "x-codeSamples": [
  6108. {
  6109. "lang": "js",
  6110. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.add({\n ...\n})"
  6111. }
  6112. ]
  6113. }
  6114. },
  6115. "/mcp/{name}/auth": {
  6116. "post": {
  6117. "operationId": "mcp.auth.start",
  6118. "parameters": [
  6119. {
  6120. "in": "query",
  6121. "name": "directory",
  6122. "schema": {
  6123. "type": "string"
  6124. }
  6125. },
  6126. {
  6127. "in": "query",
  6128. "name": "workspace",
  6129. "schema": {
  6130. "type": "string"
  6131. }
  6132. },
  6133. {
  6134. "schema": {
  6135. "type": "string"
  6136. },
  6137. "in": "path",
  6138. "name": "name",
  6139. "required": true
  6140. }
  6141. ],
  6142. "summary": "Start MCP OAuth",
  6143. "description": "Start OAuth authentication flow for a Model Context Protocol (MCP) server.",
  6144. "responses": {
  6145. "200": {
  6146. "description": "OAuth flow started",
  6147. "content": {
  6148. "application/json": {
  6149. "schema": {
  6150. "type": "object",
  6151. "properties": {
  6152. "authorizationUrl": {
  6153. "description": "URL to open in browser for authorization",
  6154. "type": "string"
  6155. }
  6156. },
  6157. "required": ["authorizationUrl"]
  6158. }
  6159. }
  6160. }
  6161. },
  6162. "400": {
  6163. "description": "MCP server does not support OAuth",
  6164. "content": {
  6165. "application/json": {
  6166. "schema": {
  6167. "$ref": "#/components/schemas/McpUnsupportedOAuthError"
  6168. }
  6169. }
  6170. }
  6171. },
  6172. "404": {
  6173. "description": "Not found",
  6174. "content": {
  6175. "application/json": {
  6176. "schema": {
  6177. "$ref": "#/components/schemas/NotFoundError"
  6178. }
  6179. }
  6180. }
  6181. }
  6182. },
  6183. "x-codeSamples": [
  6184. {
  6185. "lang": "js",
  6186. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.start({\n ...\n})"
  6187. }
  6188. ]
  6189. },
  6190. "delete": {
  6191. "operationId": "mcp.auth.remove",
  6192. "parameters": [
  6193. {
  6194. "in": "query",
  6195. "name": "directory",
  6196. "schema": {
  6197. "type": "string"
  6198. }
  6199. },
  6200. {
  6201. "in": "query",
  6202. "name": "workspace",
  6203. "schema": {
  6204. "type": "string"
  6205. }
  6206. },
  6207. {
  6208. "schema": {
  6209. "type": "string"
  6210. },
  6211. "in": "path",
  6212. "name": "name",
  6213. "required": true
  6214. }
  6215. ],
  6216. "summary": "Remove MCP OAuth",
  6217. "description": "Remove OAuth credentials for an MCP server",
  6218. "responses": {
  6219. "200": {
  6220. "description": "OAuth credentials removed",
  6221. "content": {
  6222. "application/json": {
  6223. "schema": {
  6224. "type": "object",
  6225. "properties": {
  6226. "success": {
  6227. "type": "boolean",
  6228. "const": true
  6229. }
  6230. },
  6231. "required": ["success"]
  6232. }
  6233. }
  6234. }
  6235. },
  6236. "404": {
  6237. "description": "Not found",
  6238. "content": {
  6239. "application/json": {
  6240. "schema": {
  6241. "$ref": "#/components/schemas/NotFoundError"
  6242. }
  6243. }
  6244. }
  6245. }
  6246. },
  6247. "x-codeSamples": [
  6248. {
  6249. "lang": "js",
  6250. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.remove({\n ...\n})"
  6251. }
  6252. ]
  6253. }
  6254. },
  6255. "/mcp/{name}/auth/callback": {
  6256. "post": {
  6257. "operationId": "mcp.auth.callback",
  6258. "parameters": [
  6259. {
  6260. "in": "query",
  6261. "name": "directory",
  6262. "schema": {
  6263. "type": "string"
  6264. }
  6265. },
  6266. {
  6267. "in": "query",
  6268. "name": "workspace",
  6269. "schema": {
  6270. "type": "string"
  6271. }
  6272. },
  6273. {
  6274. "schema": {
  6275. "type": "string"
  6276. },
  6277. "in": "path",
  6278. "name": "name",
  6279. "required": true
  6280. }
  6281. ],
  6282. "summary": "Complete MCP OAuth",
  6283. "description": "Complete OAuth authentication for a Model Context Protocol (MCP) server using the authorization code.",
  6284. "responses": {
  6285. "200": {
  6286. "description": "OAuth authentication completed",
  6287. "content": {
  6288. "application/json": {
  6289. "schema": {
  6290. "$ref": "#/components/schemas/MCPStatus"
  6291. }
  6292. }
  6293. }
  6294. },
  6295. "400": {
  6296. "description": "Bad request",
  6297. "content": {
  6298. "application/json": {
  6299. "schema": {
  6300. "$ref": "#/components/schemas/BadRequestError"
  6301. }
  6302. }
  6303. }
  6304. },
  6305. "404": {
  6306. "description": "Not found",
  6307. "content": {
  6308. "application/json": {
  6309. "schema": {
  6310. "$ref": "#/components/schemas/NotFoundError"
  6311. }
  6312. }
  6313. }
  6314. }
  6315. },
  6316. "requestBody": {
  6317. "content": {
  6318. "application/json": {
  6319. "schema": {
  6320. "type": "object",
  6321. "properties": {
  6322. "code": {
  6323. "description": "Authorization code from OAuth callback",
  6324. "type": "string"
  6325. }
  6326. },
  6327. "required": ["code"]
  6328. }
  6329. }
  6330. }
  6331. },
  6332. "x-codeSamples": [
  6333. {
  6334. "lang": "js",
  6335. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.callback({\n ...\n})"
  6336. }
  6337. ]
  6338. }
  6339. },
  6340. "/mcp/{name}/auth/authenticate": {
  6341. "post": {
  6342. "operationId": "mcp.auth.authenticate",
  6343. "parameters": [
  6344. {
  6345. "in": "query",
  6346. "name": "directory",
  6347. "schema": {
  6348. "type": "string"
  6349. }
  6350. },
  6351. {
  6352. "in": "query",
  6353. "name": "workspace",
  6354. "schema": {
  6355. "type": "string"
  6356. }
  6357. },
  6358. {
  6359. "schema": {
  6360. "type": "string"
  6361. },
  6362. "in": "path",
  6363. "name": "name",
  6364. "required": true
  6365. }
  6366. ],
  6367. "summary": "Authenticate MCP OAuth",
  6368. "description": "Start OAuth flow and wait for callback (opens browser)",
  6369. "responses": {
  6370. "200": {
  6371. "description": "OAuth authentication completed",
  6372. "content": {
  6373. "application/json": {
  6374. "schema": {
  6375. "$ref": "#/components/schemas/MCPStatus"
  6376. }
  6377. }
  6378. }
  6379. },
  6380. "400": {
  6381. "description": "MCP server does not support OAuth",
  6382. "content": {
  6383. "application/json": {
  6384. "schema": {
  6385. "$ref": "#/components/schemas/McpUnsupportedOAuthError"
  6386. }
  6387. }
  6388. }
  6389. },
  6390. "404": {
  6391. "description": "Not found",
  6392. "content": {
  6393. "application/json": {
  6394. "schema": {
  6395. "$ref": "#/components/schemas/NotFoundError"
  6396. }
  6397. }
  6398. }
  6399. }
  6400. },
  6401. "x-codeSamples": [
  6402. {
  6403. "lang": "js",
  6404. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.authenticate({\n ...\n})"
  6405. }
  6406. ]
  6407. }
  6408. },
  6409. "/mcp/{name}/connect": {
  6410. "post": {
  6411. "operationId": "mcp.connect",
  6412. "parameters": [
  6413. {
  6414. "in": "query",
  6415. "name": "directory",
  6416. "schema": {
  6417. "type": "string"
  6418. }
  6419. },
  6420. {
  6421. "in": "query",
  6422. "name": "workspace",
  6423. "schema": {
  6424. "type": "string"
  6425. }
  6426. },
  6427. {
  6428. "in": "path",
  6429. "name": "name",
  6430. "schema": {
  6431. "type": "string"
  6432. },
  6433. "required": true
  6434. }
  6435. ],
  6436. "description": "Connect an MCP server",
  6437. "responses": {
  6438. "200": {
  6439. "description": "MCP server connected successfully",
  6440. "content": {
  6441. "application/json": {
  6442. "schema": {
  6443. "type": "boolean"
  6444. }
  6445. }
  6446. }
  6447. }
  6448. },
  6449. "x-codeSamples": [
  6450. {
  6451. "lang": "js",
  6452. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.connect({\n ...\n})"
  6453. }
  6454. ]
  6455. }
  6456. },
  6457. "/mcp/{name}/disconnect": {
  6458. "post": {
  6459. "operationId": "mcp.disconnect",
  6460. "parameters": [
  6461. {
  6462. "in": "query",
  6463. "name": "directory",
  6464. "schema": {
  6465. "type": "string"
  6466. }
  6467. },
  6468. {
  6469. "in": "query",
  6470. "name": "workspace",
  6471. "schema": {
  6472. "type": "string"
  6473. }
  6474. },
  6475. {
  6476. "in": "path",
  6477. "name": "name",
  6478. "schema": {
  6479. "type": "string"
  6480. },
  6481. "required": true
  6482. }
  6483. ],
  6484. "description": "Disconnect an MCP server",
  6485. "responses": {
  6486. "200": {
  6487. "description": "MCP server disconnected successfully",
  6488. "content": {
  6489. "application/json": {
  6490. "schema": {
  6491. "type": "boolean"
  6492. }
  6493. }
  6494. }
  6495. }
  6496. },
  6497. "x-codeSamples": [
  6498. {
  6499. "lang": "js",
  6500. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.disconnect({\n ...\n})"
  6501. }
  6502. ]
  6503. }
  6504. },
  6505. "/tui/append-prompt": {
  6506. "post": {
  6507. "operationId": "tui.appendPrompt",
  6508. "parameters": [
  6509. {
  6510. "in": "query",
  6511. "name": "directory",
  6512. "schema": {
  6513. "type": "string"
  6514. }
  6515. },
  6516. {
  6517. "in": "query",
  6518. "name": "workspace",
  6519. "schema": {
  6520. "type": "string"
  6521. }
  6522. }
  6523. ],
  6524. "summary": "Append TUI prompt",
  6525. "description": "Append prompt to the TUI",
  6526. "responses": {
  6527. "200": {
  6528. "description": "Prompt processed successfully",
  6529. "content": {
  6530. "application/json": {
  6531. "schema": {
  6532. "type": "boolean"
  6533. }
  6534. }
  6535. }
  6536. },
  6537. "400": {
  6538. "description": "Bad request",
  6539. "content": {
  6540. "application/json": {
  6541. "schema": {
  6542. "$ref": "#/components/schemas/BadRequestError"
  6543. }
  6544. }
  6545. }
  6546. }
  6547. },
  6548. "requestBody": {
  6549. "content": {
  6550. "application/json": {
  6551. "schema": {
  6552. "type": "object",
  6553. "properties": {
  6554. "text": {
  6555. "type": "string"
  6556. }
  6557. },
  6558. "required": ["text"]
  6559. }
  6560. }
  6561. }
  6562. },
  6563. "x-codeSamples": [
  6564. {
  6565. "lang": "js",
  6566. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.appendPrompt({\n ...\n})"
  6567. }
  6568. ]
  6569. }
  6570. },
  6571. "/tui/open-help": {
  6572. "post": {
  6573. "operationId": "tui.openHelp",
  6574. "parameters": [
  6575. {
  6576. "in": "query",
  6577. "name": "directory",
  6578. "schema": {
  6579. "type": "string"
  6580. }
  6581. },
  6582. {
  6583. "in": "query",
  6584. "name": "workspace",
  6585. "schema": {
  6586. "type": "string"
  6587. }
  6588. }
  6589. ],
  6590. "summary": "Open help dialog",
  6591. "description": "Open the help dialog in the TUI to display user assistance information.",
  6592. "responses": {
  6593. "200": {
  6594. "description": "Help dialog opened successfully",
  6595. "content": {
  6596. "application/json": {
  6597. "schema": {
  6598. "type": "boolean"
  6599. }
  6600. }
  6601. }
  6602. }
  6603. },
  6604. "x-codeSamples": [
  6605. {
  6606. "lang": "js",
  6607. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openHelp({\n ...\n})"
  6608. }
  6609. ]
  6610. }
  6611. },
  6612. "/tui/open-sessions": {
  6613. "post": {
  6614. "operationId": "tui.openSessions",
  6615. "parameters": [
  6616. {
  6617. "in": "query",
  6618. "name": "directory",
  6619. "schema": {
  6620. "type": "string"
  6621. }
  6622. },
  6623. {
  6624. "in": "query",
  6625. "name": "workspace",
  6626. "schema": {
  6627. "type": "string"
  6628. }
  6629. }
  6630. ],
  6631. "summary": "Open sessions dialog",
  6632. "description": "Open the session dialog",
  6633. "responses": {
  6634. "200": {
  6635. "description": "Session dialog opened successfully",
  6636. "content": {
  6637. "application/json": {
  6638. "schema": {
  6639. "type": "boolean"
  6640. }
  6641. }
  6642. }
  6643. }
  6644. },
  6645. "x-codeSamples": [
  6646. {
  6647. "lang": "js",
  6648. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openSessions({\n ...\n})"
  6649. }
  6650. ]
  6651. }
  6652. },
  6653. "/tui/open-themes": {
  6654. "post": {
  6655. "operationId": "tui.openThemes",
  6656. "parameters": [
  6657. {
  6658. "in": "query",
  6659. "name": "directory",
  6660. "schema": {
  6661. "type": "string"
  6662. }
  6663. },
  6664. {
  6665. "in": "query",
  6666. "name": "workspace",
  6667. "schema": {
  6668. "type": "string"
  6669. }
  6670. }
  6671. ],
  6672. "summary": "Open themes dialog",
  6673. "description": "Open the theme dialog",
  6674. "responses": {
  6675. "200": {
  6676. "description": "Theme dialog opened successfully",
  6677. "content": {
  6678. "application/json": {
  6679. "schema": {
  6680. "type": "boolean"
  6681. }
  6682. }
  6683. }
  6684. }
  6685. },
  6686. "x-codeSamples": [
  6687. {
  6688. "lang": "js",
  6689. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openThemes({\n ...\n})"
  6690. }
  6691. ]
  6692. }
  6693. },
  6694. "/tui/open-models": {
  6695. "post": {
  6696. "operationId": "tui.openModels",
  6697. "parameters": [
  6698. {
  6699. "in": "query",
  6700. "name": "directory",
  6701. "schema": {
  6702. "type": "string"
  6703. }
  6704. },
  6705. {
  6706. "in": "query",
  6707. "name": "workspace",
  6708. "schema": {
  6709. "type": "string"
  6710. }
  6711. }
  6712. ],
  6713. "summary": "Open models dialog",
  6714. "description": "Open the model dialog",
  6715. "responses": {
  6716. "200": {
  6717. "description": "Model dialog opened successfully",
  6718. "content": {
  6719. "application/json": {
  6720. "schema": {
  6721. "type": "boolean"
  6722. }
  6723. }
  6724. }
  6725. }
  6726. },
  6727. "x-codeSamples": [
  6728. {
  6729. "lang": "js",
  6730. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openModels({\n ...\n})"
  6731. }
  6732. ]
  6733. }
  6734. },
  6735. "/tui/submit-prompt": {
  6736. "post": {
  6737. "operationId": "tui.submitPrompt",
  6738. "parameters": [
  6739. {
  6740. "in": "query",
  6741. "name": "directory",
  6742. "schema": {
  6743. "type": "string"
  6744. }
  6745. },
  6746. {
  6747. "in": "query",
  6748. "name": "workspace",
  6749. "schema": {
  6750. "type": "string"
  6751. }
  6752. }
  6753. ],
  6754. "summary": "Submit TUI prompt",
  6755. "description": "Submit the prompt",
  6756. "responses": {
  6757. "200": {
  6758. "description": "Prompt submitted successfully",
  6759. "content": {
  6760. "application/json": {
  6761. "schema": {
  6762. "type": "boolean"
  6763. }
  6764. }
  6765. }
  6766. }
  6767. },
  6768. "x-codeSamples": [
  6769. {
  6770. "lang": "js",
  6771. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.submitPrompt({\n ...\n})"
  6772. }
  6773. ]
  6774. }
  6775. },
  6776. "/tui/clear-prompt": {
  6777. "post": {
  6778. "operationId": "tui.clearPrompt",
  6779. "parameters": [
  6780. {
  6781. "in": "query",
  6782. "name": "directory",
  6783. "schema": {
  6784. "type": "string"
  6785. }
  6786. },
  6787. {
  6788. "in": "query",
  6789. "name": "workspace",
  6790. "schema": {
  6791. "type": "string"
  6792. }
  6793. }
  6794. ],
  6795. "summary": "Clear TUI prompt",
  6796. "description": "Clear the prompt",
  6797. "responses": {
  6798. "200": {
  6799. "description": "Prompt cleared successfully",
  6800. "content": {
  6801. "application/json": {
  6802. "schema": {
  6803. "type": "boolean"
  6804. }
  6805. }
  6806. }
  6807. }
  6808. },
  6809. "x-codeSamples": [
  6810. {
  6811. "lang": "js",
  6812. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.clearPrompt({\n ...\n})"
  6813. }
  6814. ]
  6815. }
  6816. },
  6817. "/tui/execute-command": {
  6818. "post": {
  6819. "operationId": "tui.executeCommand",
  6820. "parameters": [
  6821. {
  6822. "in": "query",
  6823. "name": "directory",
  6824. "schema": {
  6825. "type": "string"
  6826. }
  6827. },
  6828. {
  6829. "in": "query",
  6830. "name": "workspace",
  6831. "schema": {
  6832. "type": "string"
  6833. }
  6834. }
  6835. ],
  6836. "summary": "Execute TUI command",
  6837. "description": "Execute a TUI command (e.g. agent_cycle)",
  6838. "responses": {
  6839. "200": {
  6840. "description": "Command executed successfully",
  6841. "content": {
  6842. "application/json": {
  6843. "schema": {
  6844. "type": "boolean"
  6845. }
  6846. }
  6847. }
  6848. },
  6849. "400": {
  6850. "description": "Bad request",
  6851. "content": {
  6852. "application/json": {
  6853. "schema": {
  6854. "$ref": "#/components/schemas/BadRequestError"
  6855. }
  6856. }
  6857. }
  6858. }
  6859. },
  6860. "requestBody": {
  6861. "content": {
  6862. "application/json": {
  6863. "schema": {
  6864. "type": "object",
  6865. "properties": {
  6866. "command": {
  6867. "type": "string"
  6868. }
  6869. },
  6870. "required": ["command"]
  6871. }
  6872. }
  6873. }
  6874. },
  6875. "x-codeSamples": [
  6876. {
  6877. "lang": "js",
  6878. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.executeCommand({\n ...\n})"
  6879. }
  6880. ]
  6881. }
  6882. },
  6883. "/tui/show-toast": {
  6884. "post": {
  6885. "operationId": "tui.showToast",
  6886. "parameters": [
  6887. {
  6888. "in": "query",
  6889. "name": "directory",
  6890. "schema": {
  6891. "type": "string"
  6892. }
  6893. },
  6894. {
  6895. "in": "query",
  6896. "name": "workspace",
  6897. "schema": {
  6898. "type": "string"
  6899. }
  6900. }
  6901. ],
  6902. "summary": "Show TUI toast",
  6903. "description": "Show a toast notification in the TUI",
  6904. "responses": {
  6905. "200": {
  6906. "description": "Toast notification shown successfully",
  6907. "content": {
  6908. "application/json": {
  6909. "schema": {
  6910. "type": "boolean"
  6911. }
  6912. }
  6913. }
  6914. }
  6915. },
  6916. "requestBody": {
  6917. "content": {
  6918. "application/json": {
  6919. "schema": {
  6920. "type": "object",
  6921. "properties": {
  6922. "title": {
  6923. "type": "string"
  6924. },
  6925. "message": {
  6926. "type": "string"
  6927. },
  6928. "variant": {
  6929. "type": "string",
  6930. "enum": ["info", "success", "warning", "error"]
  6931. },
  6932. "duration": {
  6933. "description": "Duration in milliseconds",
  6934. "type": "integer",
  6935. "exclusiveMinimum": 0,
  6936. "maximum": 9007199254740991
  6937. }
  6938. },
  6939. "required": ["message", "variant"]
  6940. }
  6941. }
  6942. }
  6943. },
  6944. "x-codeSamples": [
  6945. {
  6946. "lang": "js",
  6947. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.showToast({\n ...\n})"
  6948. }
  6949. ]
  6950. }
  6951. },
  6952. "/tui/publish": {
  6953. "post": {
  6954. "operationId": "tui.publish",
  6955. "parameters": [
  6956. {
  6957. "in": "query",
  6958. "name": "directory",
  6959. "schema": {
  6960. "type": "string"
  6961. }
  6962. },
  6963. {
  6964. "in": "query",
  6965. "name": "workspace",
  6966. "schema": {
  6967. "type": "string"
  6968. }
  6969. }
  6970. ],
  6971. "summary": "Publish TUI event",
  6972. "description": "Publish a TUI event",
  6973. "responses": {
  6974. "200": {
  6975. "description": "Event published successfully",
  6976. "content": {
  6977. "application/json": {
  6978. "schema": {
  6979. "type": "boolean"
  6980. }
  6981. }
  6982. }
  6983. },
  6984. "400": {
  6985. "description": "Bad request",
  6986. "content": {
  6987. "application/json": {
  6988. "schema": {
  6989. "$ref": "#/components/schemas/BadRequestError"
  6990. }
  6991. }
  6992. }
  6993. }
  6994. },
  6995. "requestBody": {
  6996. "content": {
  6997. "application/json": {
  6998. "schema": {
  6999. "anyOf": [
  7000. {
  7001. "$ref": "#/components/schemas/Event.tui.prompt.append"
  7002. },
  7003. {
  7004. "$ref": "#/components/schemas/Event.tui.command.execute"
  7005. },
  7006. {
  7007. "$ref": "#/components/schemas/Event.tui.toast.show"
  7008. },
  7009. {
  7010. "$ref": "#/components/schemas/Event.tui.session.select"
  7011. }
  7012. ]
  7013. }
  7014. }
  7015. }
  7016. },
  7017. "x-codeSamples": [
  7018. {
  7019. "lang": "js",
  7020. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.publish({\n ...\n})"
  7021. }
  7022. ]
  7023. }
  7024. },
  7025. "/tui/select-session": {
  7026. "post": {
  7027. "operationId": "tui.selectSession",
  7028. "parameters": [
  7029. {
  7030. "in": "query",
  7031. "name": "directory",
  7032. "schema": {
  7033. "type": "string"
  7034. }
  7035. },
  7036. {
  7037. "in": "query",
  7038. "name": "workspace",
  7039. "schema": {
  7040. "type": "string"
  7041. }
  7042. }
  7043. ],
  7044. "summary": "Select session",
  7045. "description": "Navigate the TUI to display the specified session.",
  7046. "responses": {
  7047. "200": {
  7048. "description": "Session selected successfully",
  7049. "content": {
  7050. "application/json": {
  7051. "schema": {
  7052. "type": "boolean"
  7053. }
  7054. }
  7055. }
  7056. },
  7057. "400": {
  7058. "description": "Bad request",
  7059. "content": {
  7060. "application/json": {
  7061. "schema": {
  7062. "$ref": "#/components/schemas/BadRequestError"
  7063. }
  7064. }
  7065. }
  7066. },
  7067. "404": {
  7068. "description": "Not found",
  7069. "content": {
  7070. "application/json": {
  7071. "schema": {
  7072. "$ref": "#/components/schemas/NotFoundError"
  7073. }
  7074. }
  7075. }
  7076. }
  7077. },
  7078. "requestBody": {
  7079. "content": {
  7080. "application/json": {
  7081. "schema": {
  7082. "type": "object",
  7083. "properties": {
  7084. "sessionID": {
  7085. "description": "Session ID to navigate to",
  7086. "type": "string",
  7087. "pattern": "^ses.*"
  7088. }
  7089. },
  7090. "required": ["sessionID"]
  7091. }
  7092. }
  7093. }
  7094. },
  7095. "x-codeSamples": [
  7096. {
  7097. "lang": "js",
  7098. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.selectSession({\n ...\n})"
  7099. }
  7100. ]
  7101. }
  7102. },
  7103. "/tui/control/next": {
  7104. "get": {
  7105. "operationId": "tui.control.next",
  7106. "parameters": [
  7107. {
  7108. "in": "query",
  7109. "name": "directory",
  7110. "schema": {
  7111. "type": "string"
  7112. }
  7113. },
  7114. {
  7115. "in": "query",
  7116. "name": "workspace",
  7117. "schema": {
  7118. "type": "string"
  7119. }
  7120. }
  7121. ],
  7122. "summary": "Get next TUI request",
  7123. "description": "Retrieve the next TUI (Terminal User Interface) request from the queue for processing.",
  7124. "responses": {
  7125. "200": {
  7126. "description": "Next TUI request",
  7127. "content": {
  7128. "application/json": {
  7129. "schema": {
  7130. "type": "object",
  7131. "properties": {
  7132. "path": {
  7133. "type": "string"
  7134. },
  7135. "body": {}
  7136. },
  7137. "required": ["path", "body"]
  7138. }
  7139. }
  7140. }
  7141. }
  7142. },
  7143. "x-codeSamples": [
  7144. {
  7145. "lang": "js",
  7146. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.control.next({\n ...\n})"
  7147. }
  7148. ]
  7149. }
  7150. },
  7151. "/tui/control/response": {
  7152. "post": {
  7153. "operationId": "tui.control.response",
  7154. "parameters": [
  7155. {
  7156. "in": "query",
  7157. "name": "directory",
  7158. "schema": {
  7159. "type": "string"
  7160. }
  7161. },
  7162. {
  7163. "in": "query",
  7164. "name": "workspace",
  7165. "schema": {
  7166. "type": "string"
  7167. }
  7168. }
  7169. ],
  7170. "summary": "Submit TUI response",
  7171. "description": "Submit a response to the TUI request queue to complete a pending request.",
  7172. "responses": {
  7173. "200": {
  7174. "description": "Response submitted successfully",
  7175. "content": {
  7176. "application/json": {
  7177. "schema": {
  7178. "type": "boolean"
  7179. }
  7180. }
  7181. }
  7182. }
  7183. },
  7184. "requestBody": {
  7185. "content": {
  7186. "application/json": {
  7187. "schema": {}
  7188. }
  7189. }
  7190. },
  7191. "x-codeSamples": [
  7192. {
  7193. "lang": "js",
  7194. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.control.response({\n ...\n})"
  7195. }
  7196. ]
  7197. }
  7198. },
  7199. "/instance/dispose": {
  7200. "post": {
  7201. "operationId": "instance.dispose",
  7202. "parameters": [
  7203. {
  7204. "in": "query",
  7205. "name": "directory",
  7206. "schema": {
  7207. "type": "string"
  7208. }
  7209. },
  7210. {
  7211. "in": "query",
  7212. "name": "workspace",
  7213. "schema": {
  7214. "type": "string"
  7215. }
  7216. }
  7217. ],
  7218. "summary": "Dispose instance",
  7219. "description": "Clean up and dispose the current OpenCode instance, releasing all resources.",
  7220. "responses": {
  7221. "200": {
  7222. "description": "Instance disposed",
  7223. "content": {
  7224. "application/json": {
  7225. "schema": {
  7226. "type": "boolean"
  7227. }
  7228. }
  7229. }
  7230. }
  7231. },
  7232. "x-codeSamples": [
  7233. {
  7234. "lang": "js",
  7235. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.instance.dispose({\n ...\n})"
  7236. }
  7237. ]
  7238. }
  7239. },
  7240. "/path": {
  7241. "get": {
  7242. "operationId": "path.get",
  7243. "parameters": [
  7244. {
  7245. "in": "query",
  7246. "name": "directory",
  7247. "schema": {
  7248. "type": "string"
  7249. }
  7250. },
  7251. {
  7252. "in": "query",
  7253. "name": "workspace",
  7254. "schema": {
  7255. "type": "string"
  7256. }
  7257. }
  7258. ],
  7259. "summary": "Get paths",
  7260. "description": "Retrieve the current working directory and related path information for the OpenCode instance.",
  7261. "responses": {
  7262. "200": {
  7263. "description": "Path",
  7264. "content": {
  7265. "application/json": {
  7266. "schema": {
  7267. "$ref": "#/components/schemas/Path"
  7268. }
  7269. }
  7270. }
  7271. }
  7272. },
  7273. "x-codeSamples": [
  7274. {
  7275. "lang": "js",
  7276. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.path.get({\n ...\n})"
  7277. }
  7278. ]
  7279. }
  7280. },
  7281. "/vcs": {
  7282. "get": {
  7283. "operationId": "vcs.get",
  7284. "parameters": [
  7285. {
  7286. "in": "query",
  7287. "name": "directory",
  7288. "schema": {
  7289. "type": "string"
  7290. }
  7291. },
  7292. {
  7293. "in": "query",
  7294. "name": "workspace",
  7295. "schema": {
  7296. "type": "string"
  7297. }
  7298. }
  7299. ],
  7300. "summary": "Get VCS info",
  7301. "description": "Retrieve version control system (VCS) information for the current project, such as git branch.",
  7302. "responses": {
  7303. "200": {
  7304. "description": "VCS info",
  7305. "content": {
  7306. "application/json": {
  7307. "schema": {
  7308. "$ref": "#/components/schemas/VcsInfo"
  7309. }
  7310. }
  7311. }
  7312. }
  7313. },
  7314. "x-codeSamples": [
  7315. {
  7316. "lang": "js",
  7317. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.vcs.get({\n ...\n})"
  7318. }
  7319. ]
  7320. }
  7321. },
  7322. "/vcs/diff": {
  7323. "get": {
  7324. "operationId": "vcs.diff",
  7325. "parameters": [
  7326. {
  7327. "in": "query",
  7328. "name": "directory",
  7329. "schema": {
  7330. "type": "string"
  7331. }
  7332. },
  7333. {
  7334. "in": "query",
  7335. "name": "workspace",
  7336. "schema": {
  7337. "type": "string"
  7338. }
  7339. },
  7340. {
  7341. "in": "query",
  7342. "name": "mode",
  7343. "schema": {
  7344. "type": "string",
  7345. "enum": ["git", "branch"]
  7346. },
  7347. "required": true
  7348. }
  7349. ],
  7350. "summary": "Get VCS diff",
  7351. "description": "Retrieve the current git diff for the working tree or against the default branch.",
  7352. "responses": {
  7353. "200": {
  7354. "description": "VCS diff",
  7355. "content": {
  7356. "application/json": {
  7357. "schema": {
  7358. "type": "array",
  7359. "items": {
  7360. "$ref": "#/components/schemas/VcsFileDiff"
  7361. }
  7362. }
  7363. }
  7364. }
  7365. }
  7366. },
  7367. "x-codeSamples": [
  7368. {
  7369. "lang": "js",
  7370. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.vcs.diff({\n ...\n})"
  7371. }
  7372. ]
  7373. }
  7374. },
  7375. "/command": {
  7376. "get": {
  7377. "operationId": "command.list",
  7378. "parameters": [
  7379. {
  7380. "in": "query",
  7381. "name": "directory",
  7382. "schema": {
  7383. "type": "string"
  7384. }
  7385. },
  7386. {
  7387. "in": "query",
  7388. "name": "workspace",
  7389. "schema": {
  7390. "type": "string"
  7391. }
  7392. }
  7393. ],
  7394. "summary": "List commands",
  7395. "description": "Get a list of all available commands in the OpenCode system.",
  7396. "responses": {
  7397. "200": {
  7398. "description": "List of commands",
  7399. "content": {
  7400. "application/json": {
  7401. "schema": {
  7402. "type": "array",
  7403. "items": {
  7404. "$ref": "#/components/schemas/Command"
  7405. }
  7406. }
  7407. }
  7408. }
  7409. }
  7410. },
  7411. "x-codeSamples": [
  7412. {
  7413. "lang": "js",
  7414. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.command.list({\n ...\n})"
  7415. }
  7416. ]
  7417. }
  7418. },
  7419. "/agent": {
  7420. "get": {
  7421. "operationId": "app.agents",
  7422. "parameters": [
  7423. {
  7424. "in": "query",
  7425. "name": "directory",
  7426. "schema": {
  7427. "type": "string"
  7428. }
  7429. },
  7430. {
  7431. "in": "query",
  7432. "name": "workspace",
  7433. "schema": {
  7434. "type": "string"
  7435. }
  7436. }
  7437. ],
  7438. "summary": "List agents",
  7439. "description": "Get a list of all available AI agents in the OpenCode system.",
  7440. "responses": {
  7441. "200": {
  7442. "description": "List of agents",
  7443. "content": {
  7444. "application/json": {
  7445. "schema": {
  7446. "type": "array",
  7447. "items": {
  7448. "$ref": "#/components/schemas/Agent"
  7449. }
  7450. }
  7451. }
  7452. }
  7453. }
  7454. },
  7455. "x-codeSamples": [
  7456. {
  7457. "lang": "js",
  7458. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.app.agents({\n ...\n})"
  7459. }
  7460. ]
  7461. }
  7462. },
  7463. "/skill": {
  7464. "get": {
  7465. "operationId": "app.skills",
  7466. "parameters": [
  7467. {
  7468. "in": "query",
  7469. "name": "directory",
  7470. "schema": {
  7471. "type": "string"
  7472. }
  7473. },
  7474. {
  7475. "in": "query",
  7476. "name": "workspace",
  7477. "schema": {
  7478. "type": "string"
  7479. }
  7480. }
  7481. ],
  7482. "summary": "List skills",
  7483. "description": "Get a list of all available skills in the OpenCode system.",
  7484. "responses": {
  7485. "200": {
  7486. "description": "List of skills",
  7487. "content": {
  7488. "application/json": {
  7489. "schema": {
  7490. "type": "array",
  7491. "items": {
  7492. "type": "object",
  7493. "properties": {
  7494. "name": {
  7495. "type": "string"
  7496. },
  7497. "description": {
  7498. "type": "string"
  7499. },
  7500. "location": {
  7501. "type": "string"
  7502. },
  7503. "content": {
  7504. "type": "string"
  7505. }
  7506. },
  7507. "required": ["name", "description", "location", "content"]
  7508. }
  7509. }
  7510. }
  7511. }
  7512. }
  7513. },
  7514. "x-codeSamples": [
  7515. {
  7516. "lang": "js",
  7517. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.app.skills({\n ...\n})"
  7518. }
  7519. ]
  7520. }
  7521. },
  7522. "/lsp": {
  7523. "get": {
  7524. "operationId": "lsp.status",
  7525. "parameters": [
  7526. {
  7527. "in": "query",
  7528. "name": "directory",
  7529. "schema": {
  7530. "type": "string"
  7531. }
  7532. },
  7533. {
  7534. "in": "query",
  7535. "name": "workspace",
  7536. "schema": {
  7537. "type": "string"
  7538. }
  7539. }
  7540. ],
  7541. "summary": "Get LSP status",
  7542. "description": "Get LSP server status",
  7543. "responses": {
  7544. "200": {
  7545. "description": "LSP server status",
  7546. "content": {
  7547. "application/json": {
  7548. "schema": {
  7549. "type": "array",
  7550. "items": {
  7551. "$ref": "#/components/schemas/LSPStatus"
  7552. }
  7553. }
  7554. }
  7555. }
  7556. }
  7557. },
  7558. "x-codeSamples": [
  7559. {
  7560. "lang": "js",
  7561. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.lsp.status({\n ...\n})"
  7562. }
  7563. ]
  7564. }
  7565. },
  7566. "/formatter": {
  7567. "get": {
  7568. "operationId": "formatter.status",
  7569. "parameters": [
  7570. {
  7571. "in": "query",
  7572. "name": "directory",
  7573. "schema": {
  7574. "type": "string"
  7575. }
  7576. },
  7577. {
  7578. "in": "query",
  7579. "name": "workspace",
  7580. "schema": {
  7581. "type": "string"
  7582. }
  7583. }
  7584. ],
  7585. "summary": "Get formatter status",
  7586. "description": "Get formatter status",
  7587. "responses": {
  7588. "200": {
  7589. "description": "Formatter status",
  7590. "content": {
  7591. "application/json": {
  7592. "schema": {
  7593. "type": "array",
  7594. "items": {
  7595. "$ref": "#/components/schemas/FormatterStatus"
  7596. }
  7597. }
  7598. }
  7599. }
  7600. }
  7601. },
  7602. "x-codeSamples": [
  7603. {
  7604. "lang": "js",
  7605. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.formatter.status({\n ...\n})"
  7606. }
  7607. ]
  7608. }
  7609. }
  7610. },
  7611. "components": {
  7612. "schemas": {
  7613. "Event.server.instance.disposed": {
  7614. "type": "object",
  7615. "properties": {
  7616. "id": {
  7617. "type": "string"
  7618. },
  7619. "type": {
  7620. "type": "string",
  7621. "const": "server.instance.disposed"
  7622. },
  7623. "properties": {
  7624. "type": "object",
  7625. "properties": {
  7626. "directory": {
  7627. "type": "string"
  7628. }
  7629. },
  7630. "required": ["directory"]
  7631. }
  7632. },
  7633. "required": ["id", "type", "properties"]
  7634. },
  7635. "Event.file.edited": {
  7636. "type": "object",
  7637. "properties": {
  7638. "id": {
  7639. "type": "string"
  7640. },
  7641. "type": {
  7642. "type": "string",
  7643. "const": "file.edited"
  7644. },
  7645. "properties": {
  7646. "type": "object",
  7647. "properties": {
  7648. "file": {
  7649. "type": "string"
  7650. }
  7651. },
  7652. "required": ["file"]
  7653. }
  7654. },
  7655. "required": ["id", "type", "properties"]
  7656. },
  7657. "Event.file.watcher.updated": {
  7658. "type": "object",
  7659. "properties": {
  7660. "id": {
  7661. "type": "string"
  7662. },
  7663. "type": {
  7664. "type": "string",
  7665. "const": "file.watcher.updated"
  7666. },
  7667. "properties": {
  7668. "type": "object",
  7669. "properties": {
  7670. "file": {
  7671. "type": "string"
  7672. },
  7673. "event": {
  7674. "type": "string",
  7675. "enum": ["add", "change", "unlink"]
  7676. }
  7677. },
  7678. "required": ["file", "event"]
  7679. }
  7680. },
  7681. "required": ["id", "type", "properties"]
  7682. },
  7683. "Event.lsp.client.diagnostics": {
  7684. "type": "object",
  7685. "properties": {
  7686. "id": {
  7687. "type": "string"
  7688. },
  7689. "type": {
  7690. "type": "string",
  7691. "const": "lsp.client.diagnostics"
  7692. },
  7693. "properties": {
  7694. "type": "object",
  7695. "properties": {
  7696. "serverID": {
  7697. "type": "string"
  7698. },
  7699. "path": {
  7700. "type": "string"
  7701. }
  7702. },
  7703. "required": ["serverID", "path"]
  7704. }
  7705. },
  7706. "required": ["id", "type", "properties"]
  7707. },
  7708. "Event.lsp.updated": {
  7709. "type": "object",
  7710. "properties": {
  7711. "id": {
  7712. "type": "string"
  7713. },
  7714. "type": {
  7715. "type": "string",
  7716. "const": "lsp.updated"
  7717. },
  7718. "properties": {
  7719. "type": "object",
  7720. "properties": {}
  7721. }
  7722. },
  7723. "required": ["id", "type", "properties"]
  7724. },
  7725. "Event.message.part.delta": {
  7726. "type": "object",
  7727. "properties": {
  7728. "id": {
  7729. "type": "string"
  7730. },
  7731. "type": {
  7732. "type": "string",
  7733. "const": "message.part.delta"
  7734. },
  7735. "properties": {
  7736. "type": "object",
  7737. "properties": {
  7738. "sessionID": {
  7739. "type": "string",
  7740. "pattern": "^ses.*"
  7741. },
  7742. "messageID": {
  7743. "type": "string",
  7744. "pattern": "^msg.*"
  7745. },
  7746. "partID": {
  7747. "type": "string",
  7748. "pattern": "^prt.*"
  7749. },
  7750. "field": {
  7751. "type": "string"
  7752. },
  7753. "delta": {
  7754. "type": "string"
  7755. }
  7756. },
  7757. "required": ["sessionID", "messageID", "partID", "field", "delta"]
  7758. }
  7759. },
  7760. "required": ["id", "type", "properties"]
  7761. },
  7762. "PermissionRequest": {
  7763. "type": "object",
  7764. "properties": {
  7765. "id": {
  7766. "type": "string",
  7767. "pattern": "^per.*"
  7768. },
  7769. "sessionID": {
  7770. "type": "string",
  7771. "pattern": "^ses.*"
  7772. },
  7773. "permission": {
  7774. "type": "string"
  7775. },
  7776. "patterns": {
  7777. "type": "array",
  7778. "items": {
  7779. "type": "string"
  7780. }
  7781. },
  7782. "metadata": {
  7783. "type": "object",
  7784. "propertyNames": {
  7785. "type": "string"
  7786. },
  7787. "additionalProperties": {}
  7788. },
  7789. "always": {
  7790. "type": "array",
  7791. "items": {
  7792. "type": "string"
  7793. }
  7794. },
  7795. "tool": {
  7796. "type": "object",
  7797. "properties": {
  7798. "messageID": {
  7799. "type": "string",
  7800. "pattern": "^msg.*"
  7801. },
  7802. "callID": {
  7803. "type": "string"
  7804. }
  7805. },
  7806. "required": ["messageID", "callID"]
  7807. }
  7808. },
  7809. "required": ["id", "sessionID", "permission", "patterns", "metadata", "always"]
  7810. },
  7811. "Event.permission.asked": {
  7812. "type": "object",
  7813. "properties": {
  7814. "id": {
  7815. "type": "string"
  7816. },
  7817. "type": {
  7818. "type": "string",
  7819. "const": "permission.asked"
  7820. },
  7821. "properties": {
  7822. "$ref": "#/components/schemas/PermissionRequest"
  7823. }
  7824. },
  7825. "required": ["id", "type", "properties"]
  7826. },
  7827. "Event.permission.replied": {
  7828. "type": "object",
  7829. "properties": {
  7830. "id": {
  7831. "type": "string"
  7832. },
  7833. "type": {
  7834. "type": "string",
  7835. "const": "permission.replied"
  7836. },
  7837. "properties": {
  7838. "type": "object",
  7839. "properties": {
  7840. "sessionID": {
  7841. "type": "string",
  7842. "pattern": "^ses.*"
  7843. },
  7844. "requestID": {
  7845. "type": "string",
  7846. "pattern": "^per.*"
  7847. },
  7848. "reply": {
  7849. "type": "string",
  7850. "enum": ["once", "always", "reject"]
  7851. }
  7852. },
  7853. "required": ["sessionID", "requestID", "reply"]
  7854. }
  7855. },
  7856. "required": ["id", "type", "properties"]
  7857. },
  7858. "SnapshotFileDiff": {
  7859. "type": "object",
  7860. "properties": {
  7861. "file": {
  7862. "type": "string"
  7863. },
  7864. "patch": {
  7865. "type": "string"
  7866. },
  7867. "additions": {
  7868. "type": "integer",
  7869. "minimum": 0,
  7870. "maximum": 9007199254740991
  7871. },
  7872. "deletions": {
  7873. "type": "integer",
  7874. "minimum": 0,
  7875. "maximum": 9007199254740991
  7876. },
  7877. "status": {
  7878. "type": "string",
  7879. "enum": ["added", "deleted", "modified"]
  7880. }
  7881. },
  7882. "required": ["file", "patch", "additions", "deletions"]
  7883. },
  7884. "Event.session.diff": {
  7885. "type": "object",
  7886. "properties": {
  7887. "id": {
  7888. "type": "string"
  7889. },
  7890. "type": {
  7891. "type": "string",
  7892. "const": "session.diff"
  7893. },
  7894. "properties": {
  7895. "type": "object",
  7896. "properties": {
  7897. "sessionID": {
  7898. "type": "string",
  7899. "pattern": "^ses.*"
  7900. },
  7901. "diff": {
  7902. "type": "array",
  7903. "items": {
  7904. "$ref": "#/components/schemas/SnapshotFileDiff"
  7905. }
  7906. }
  7907. },
  7908. "required": ["sessionID", "diff"]
  7909. }
  7910. },
  7911. "required": ["id", "type", "properties"]
  7912. },
  7913. "ProviderAuthError": {
  7914. "type": "object",
  7915. "properties": {
  7916. "name": {
  7917. "type": "string",
  7918. "const": "ProviderAuthError"
  7919. },
  7920. "data": {
  7921. "type": "object",
  7922. "properties": {
  7923. "providerID": {
  7924. "type": "string"
  7925. },
  7926. "message": {
  7927. "type": "string"
  7928. }
  7929. },
  7930. "required": ["providerID", "message"]
  7931. }
  7932. },
  7933. "required": ["name", "data"]
  7934. },
  7935. "UnknownError": {
  7936. "type": "object",
  7937. "properties": {
  7938. "name": {
  7939. "type": "string",
  7940. "const": "UnknownError"
  7941. },
  7942. "data": {
  7943. "type": "object",
  7944. "properties": {
  7945. "message": {
  7946. "type": "string"
  7947. }
  7948. },
  7949. "required": ["message"]
  7950. }
  7951. },
  7952. "required": ["name", "data"]
  7953. },
  7954. "MessageOutputLengthError": {
  7955. "type": "object",
  7956. "properties": {
  7957. "name": {
  7958. "type": "string",
  7959. "const": "MessageOutputLengthError"
  7960. },
  7961. "data": {
  7962. "type": "object",
  7963. "properties": {}
  7964. }
  7965. },
  7966. "required": ["name", "data"]
  7967. },
  7968. "MessageAbortedError": {
  7969. "type": "object",
  7970. "properties": {
  7971. "name": {
  7972. "type": "string",
  7973. "const": "MessageAbortedError"
  7974. },
  7975. "data": {
  7976. "type": "object",
  7977. "properties": {
  7978. "message": {
  7979. "type": "string"
  7980. }
  7981. },
  7982. "required": ["message"]
  7983. }
  7984. },
  7985. "required": ["name", "data"]
  7986. },
  7987. "StructuredOutputError": {
  7988. "type": "object",
  7989. "properties": {
  7990. "name": {
  7991. "type": "string",
  7992. "const": "StructuredOutputError"
  7993. },
  7994. "data": {
  7995. "type": "object",
  7996. "properties": {
  7997. "message": {
  7998. "type": "string"
  7999. },
  8000. "retries": {
  8001. "type": "integer",
  8002. "minimum": 0,
  8003. "maximum": 9007199254740991
  8004. }
  8005. },
  8006. "required": ["message", "retries"]
  8007. }
  8008. },
  8009. "required": ["name", "data"]
  8010. },
  8011. "ContextOverflowError": {
  8012. "type": "object",
  8013. "properties": {
  8014. "name": {
  8015. "type": "string",
  8016. "const": "ContextOverflowError"
  8017. },
  8018. "data": {
  8019. "type": "object",
  8020. "properties": {
  8021. "message": {
  8022. "type": "string"
  8023. },
  8024. "responseBody": {
  8025. "type": "string"
  8026. }
  8027. },
  8028. "required": ["message"]
  8029. }
  8030. },
  8031. "required": ["name", "data"]
  8032. },
  8033. "APIError": {
  8034. "type": "object",
  8035. "properties": {
  8036. "name": {
  8037. "type": "string",
  8038. "const": "APIError"
  8039. },
  8040. "data": {
  8041. "type": "object",
  8042. "properties": {
  8043. "message": {
  8044. "type": "string"
  8045. },
  8046. "statusCode": {
  8047. "type": "integer",
  8048. "minimum": 0,
  8049. "maximum": 9007199254740991
  8050. },
  8051. "isRetryable": {
  8052. "type": "boolean"
  8053. },
  8054. "responseHeaders": {
  8055. "type": "object",
  8056. "propertyNames": {
  8057. "type": "string"
  8058. },
  8059. "additionalProperties": {
  8060. "type": "string"
  8061. }
  8062. },
  8063. "responseBody": {
  8064. "type": "string"
  8065. },
  8066. "metadata": {
  8067. "type": "object",
  8068. "propertyNames": {
  8069. "type": "string"
  8070. },
  8071. "additionalProperties": {
  8072. "type": "string"
  8073. }
  8074. }
  8075. },
  8076. "required": ["message", "isRetryable"]
  8077. }
  8078. },
  8079. "required": ["name", "data"]
  8080. },
  8081. "Event.session.error": {
  8082. "type": "object",
  8083. "properties": {
  8084. "id": {
  8085. "type": "string"
  8086. },
  8087. "type": {
  8088. "type": "string",
  8089. "const": "session.error"
  8090. },
  8091. "properties": {
  8092. "type": "object",
  8093. "properties": {
  8094. "sessionID": {
  8095. "type": "string",
  8096. "pattern": "^ses.*"
  8097. },
  8098. "error": {
  8099. "anyOf": [
  8100. {
  8101. "$ref": "#/components/schemas/ProviderAuthError"
  8102. },
  8103. {
  8104. "$ref": "#/components/schemas/UnknownError"
  8105. },
  8106. {
  8107. "$ref": "#/components/schemas/MessageOutputLengthError"
  8108. },
  8109. {
  8110. "$ref": "#/components/schemas/MessageAbortedError"
  8111. },
  8112. {
  8113. "$ref": "#/components/schemas/StructuredOutputError"
  8114. },
  8115. {
  8116. "$ref": "#/components/schemas/ContextOverflowError"
  8117. },
  8118. {
  8119. "$ref": "#/components/schemas/APIError"
  8120. }
  8121. ]
  8122. }
  8123. }
  8124. }
  8125. },
  8126. "required": ["id", "type", "properties"]
  8127. },
  8128. "Event.installation.updated": {
  8129. "type": "object",
  8130. "properties": {
  8131. "id": {
  8132. "type": "string"
  8133. },
  8134. "type": {
  8135. "type": "string",
  8136. "const": "installation.updated"
  8137. },
  8138. "properties": {
  8139. "type": "object",
  8140. "properties": {
  8141. "version": {
  8142. "type": "string"
  8143. }
  8144. },
  8145. "required": ["version"]
  8146. }
  8147. },
  8148. "required": ["id", "type", "properties"]
  8149. },
  8150. "Event.installation.update-available": {
  8151. "type": "object",
  8152. "properties": {
  8153. "id": {
  8154. "type": "string"
  8155. },
  8156. "type": {
  8157. "type": "string",
  8158. "const": "installation.update-available"
  8159. },
  8160. "properties": {
  8161. "type": "object",
  8162. "properties": {
  8163. "version": {
  8164. "type": "string"
  8165. }
  8166. },
  8167. "required": ["version"]
  8168. }
  8169. },
  8170. "required": ["id", "type", "properties"]
  8171. },
  8172. "QuestionOption": {
  8173. "type": "object",
  8174. "properties": {
  8175. "label": {
  8176. "description": "Display text (1-5 words, concise)",
  8177. "type": "string"
  8178. },
  8179. "description": {
  8180. "description": "Explanation of choice",
  8181. "type": "string"
  8182. }
  8183. },
  8184. "required": ["label", "description"]
  8185. },
  8186. "QuestionInfo": {
  8187. "type": "object",
  8188. "properties": {
  8189. "question": {
  8190. "description": "Complete question",
  8191. "type": "string"
  8192. },
  8193. "header": {
  8194. "description": "Very short label (max 30 chars)",
  8195. "type": "string"
  8196. },
  8197. "options": {
  8198. "description": "Available choices",
  8199. "type": "array",
  8200. "items": {
  8201. "$ref": "#/components/schemas/QuestionOption"
  8202. }
  8203. },
  8204. "multiple": {
  8205. "description": "Allow selecting multiple choices",
  8206. "type": "boolean"
  8207. },
  8208. "custom": {
  8209. "description": "Allow typing a custom answer (default: true)",
  8210. "type": "boolean"
  8211. }
  8212. },
  8213. "required": ["question", "header", "options"]
  8214. },
  8215. "QuestionTool": {
  8216. "type": "object",
  8217. "properties": {
  8218. "messageID": {
  8219. "type": "string",
  8220. "pattern": "^msg.*"
  8221. },
  8222. "callID": {
  8223. "type": "string"
  8224. }
  8225. },
  8226. "required": ["messageID", "callID"]
  8227. },
  8228. "QuestionRequest": {
  8229. "type": "object",
  8230. "properties": {
  8231. "id": {
  8232. "type": "string",
  8233. "pattern": "^que.*"
  8234. },
  8235. "sessionID": {
  8236. "type": "string",
  8237. "pattern": "^ses.*"
  8238. },
  8239. "questions": {
  8240. "description": "Questions to ask",
  8241. "type": "array",
  8242. "items": {
  8243. "$ref": "#/components/schemas/QuestionInfo"
  8244. }
  8245. },
  8246. "tool": {
  8247. "$ref": "#/components/schemas/QuestionTool"
  8248. }
  8249. },
  8250. "required": ["id", "sessionID", "questions"]
  8251. },
  8252. "Event.question.asked": {
  8253. "type": "object",
  8254. "properties": {
  8255. "id": {
  8256. "type": "string"
  8257. },
  8258. "type": {
  8259. "type": "string",
  8260. "const": "question.asked"
  8261. },
  8262. "properties": {
  8263. "$ref": "#/components/schemas/QuestionRequest"
  8264. }
  8265. },
  8266. "required": ["id", "type", "properties"]
  8267. },
  8268. "QuestionAnswer": {
  8269. "type": "array",
  8270. "items": {
  8271. "type": "string"
  8272. }
  8273. },
  8274. "QuestionReplied": {
  8275. "type": "object",
  8276. "properties": {
  8277. "sessionID": {
  8278. "type": "string",
  8279. "pattern": "^ses.*"
  8280. },
  8281. "requestID": {
  8282. "type": "string",
  8283. "pattern": "^que.*"
  8284. },
  8285. "answers": {
  8286. "type": "array",
  8287. "items": {
  8288. "$ref": "#/components/schemas/QuestionAnswer"
  8289. }
  8290. }
  8291. },
  8292. "required": ["sessionID", "requestID", "answers"]
  8293. },
  8294. "Event.question.replied": {
  8295. "type": "object",
  8296. "properties": {
  8297. "id": {
  8298. "type": "string"
  8299. },
  8300. "type": {
  8301. "type": "string",
  8302. "const": "question.replied"
  8303. },
  8304. "properties": {
  8305. "$ref": "#/components/schemas/QuestionReplied"
  8306. }
  8307. },
  8308. "required": ["id", "type", "properties"]
  8309. },
  8310. "QuestionRejected": {
  8311. "type": "object",
  8312. "properties": {
  8313. "sessionID": {
  8314. "type": "string",
  8315. "pattern": "^ses.*"
  8316. },
  8317. "requestID": {
  8318. "type": "string",
  8319. "pattern": "^que.*"
  8320. }
  8321. },
  8322. "required": ["sessionID", "requestID"]
  8323. },
  8324. "Event.question.rejected": {
  8325. "type": "object",
  8326. "properties": {
  8327. "id": {
  8328. "type": "string"
  8329. },
  8330. "type": {
  8331. "type": "string",
  8332. "const": "question.rejected"
  8333. },
  8334. "properties": {
  8335. "$ref": "#/components/schemas/QuestionRejected"
  8336. }
  8337. },
  8338. "required": ["id", "type", "properties"]
  8339. },
  8340. "Todo": {
  8341. "type": "object",
  8342. "properties": {
  8343. "content": {
  8344. "description": "Brief description of the task",
  8345. "type": "string"
  8346. },
  8347. "status": {
  8348. "description": "Current status of the task: pending, in_progress, completed, cancelled",
  8349. "type": "string"
  8350. },
  8351. "priority": {
  8352. "description": "Priority level of the task: high, medium, low",
  8353. "type": "string"
  8354. }
  8355. },
  8356. "required": ["content", "status", "priority"]
  8357. },
  8358. "Event.todo.updated": {
  8359. "type": "object",
  8360. "properties": {
  8361. "id": {
  8362. "type": "string"
  8363. },
  8364. "type": {
  8365. "type": "string",
  8366. "const": "todo.updated"
  8367. },
  8368. "properties": {
  8369. "type": "object",
  8370. "properties": {
  8371. "sessionID": {
  8372. "type": "string",
  8373. "pattern": "^ses.*"
  8374. },
  8375. "todos": {
  8376. "type": "array",
  8377. "items": {
  8378. "$ref": "#/components/schemas/Todo"
  8379. }
  8380. }
  8381. },
  8382. "required": ["sessionID", "todos"]
  8383. }
  8384. },
  8385. "required": ["id", "type", "properties"]
  8386. },
  8387. "SessionStatus": {
  8388. "anyOf": [
  8389. {
  8390. "type": "object",
  8391. "properties": {
  8392. "type": {
  8393. "type": "string",
  8394. "const": "idle"
  8395. }
  8396. },
  8397. "required": ["type"]
  8398. },
  8399. {
  8400. "type": "object",
  8401. "properties": {
  8402. "type": {
  8403. "type": "string",
  8404. "const": "retry"
  8405. },
  8406. "attempt": {
  8407. "type": "integer",
  8408. "minimum": 0,
  8409. "maximum": 9007199254740991
  8410. },
  8411. "message": {
  8412. "type": "string"
  8413. },
  8414. "next": {
  8415. "type": "integer",
  8416. "minimum": 0,
  8417. "maximum": 9007199254740991
  8418. }
  8419. },
  8420. "required": ["type", "attempt", "message", "next"]
  8421. },
  8422. {
  8423. "type": "object",
  8424. "properties": {
  8425. "type": {
  8426. "type": "string",
  8427. "const": "busy"
  8428. }
  8429. },
  8430. "required": ["type"]
  8431. }
  8432. ]
  8433. },
  8434. "Event.session.status": {
  8435. "type": "object",
  8436. "properties": {
  8437. "id": {
  8438. "type": "string"
  8439. },
  8440. "type": {
  8441. "type": "string",
  8442. "const": "session.status"
  8443. },
  8444. "properties": {
  8445. "type": "object",
  8446. "properties": {
  8447. "sessionID": {
  8448. "type": "string",
  8449. "pattern": "^ses.*"
  8450. },
  8451. "status": {
  8452. "$ref": "#/components/schemas/SessionStatus"
  8453. }
  8454. },
  8455. "required": ["sessionID", "status"]
  8456. }
  8457. },
  8458. "required": ["id", "type", "properties"]
  8459. },
  8460. "Event.session.idle": {
  8461. "type": "object",
  8462. "properties": {
  8463. "id": {
  8464. "type": "string"
  8465. },
  8466. "type": {
  8467. "type": "string",
  8468. "const": "session.idle"
  8469. },
  8470. "properties": {
  8471. "type": "object",
  8472. "properties": {
  8473. "sessionID": {
  8474. "type": "string",
  8475. "pattern": "^ses.*"
  8476. }
  8477. },
  8478. "required": ["sessionID"]
  8479. }
  8480. },
  8481. "required": ["id", "type", "properties"]
  8482. },
  8483. "Event.session.compacted": {
  8484. "type": "object",
  8485. "properties": {
  8486. "id": {
  8487. "type": "string"
  8488. },
  8489. "type": {
  8490. "type": "string",
  8491. "const": "session.compacted"
  8492. },
  8493. "properties": {
  8494. "type": "object",
  8495. "properties": {
  8496. "sessionID": {
  8497. "type": "string",
  8498. "pattern": "^ses.*"
  8499. }
  8500. },
  8501. "required": ["sessionID"]
  8502. }
  8503. },
  8504. "required": ["id", "type", "properties"]
  8505. },
  8506. "Event.tui.prompt.append": {
  8507. "type": "object",
  8508. "properties": {
  8509. "type": {
  8510. "type": "string",
  8511. "const": "tui.prompt.append"
  8512. },
  8513. "properties": {
  8514. "type": "object",
  8515. "properties": {
  8516. "text": {
  8517. "type": "string"
  8518. }
  8519. },
  8520. "required": ["text"]
  8521. }
  8522. },
  8523. "required": ["type", "properties"]
  8524. },
  8525. "Event.tui.command.execute": {
  8526. "type": "object",
  8527. "properties": {
  8528. "type": {
  8529. "type": "string",
  8530. "const": "tui.command.execute"
  8531. },
  8532. "properties": {
  8533. "type": "object",
  8534. "properties": {
  8535. "command": {
  8536. "anyOf": [
  8537. {
  8538. "type": "string",
  8539. "enum": [
  8540. "session.list",
  8541. "session.new",
  8542. "session.share",
  8543. "session.interrupt",
  8544. "session.compact",
  8545. "session.page.up",
  8546. "session.page.down",
  8547. "session.line.up",
  8548. "session.line.down",
  8549. "session.half.page.up",
  8550. "session.half.page.down",
  8551. "session.first",
  8552. "session.last",
  8553. "prompt.clear",
  8554. "prompt.submit",
  8555. "agent.cycle"
  8556. ]
  8557. },
  8558. {
  8559. "type": "string"
  8560. }
  8561. ]
  8562. }
  8563. },
  8564. "required": ["command"]
  8565. }
  8566. },
  8567. "required": ["type", "properties"]
  8568. },
  8569. "Event.tui.toast.show": {
  8570. "type": "object",
  8571. "properties": {
  8572. "type": {
  8573. "type": "string",
  8574. "const": "tui.toast.show"
  8575. },
  8576. "properties": {
  8577. "type": "object",
  8578. "properties": {
  8579. "title": {
  8580. "type": "string"
  8581. },
  8582. "message": {
  8583. "type": "string"
  8584. },
  8585. "variant": {
  8586. "type": "string",
  8587. "enum": ["info", "success", "warning", "error"]
  8588. },
  8589. "duration": {
  8590. "description": "Duration in milliseconds",
  8591. "type": "integer",
  8592. "exclusiveMinimum": 0,
  8593. "maximum": 9007199254740991
  8594. }
  8595. },
  8596. "required": ["message", "variant"]
  8597. }
  8598. },
  8599. "required": ["type", "properties"]
  8600. },
  8601. "Event.tui.session.select": {
  8602. "type": "object",
  8603. "properties": {
  8604. "type": {
  8605. "type": "string",
  8606. "const": "tui.session.select"
  8607. },
  8608. "properties": {
  8609. "type": "object",
  8610. "properties": {
  8611. "sessionID": {
  8612. "description": "Session ID to navigate to",
  8613. "type": "string",
  8614. "pattern": "^ses.*"
  8615. }
  8616. },
  8617. "required": ["sessionID"]
  8618. }
  8619. },
  8620. "required": ["type", "properties"]
  8621. },
  8622. "Event.mcp.tools.changed": {
  8623. "type": "object",
  8624. "properties": {
  8625. "id": {
  8626. "type": "string"
  8627. },
  8628. "type": {
  8629. "type": "string",
  8630. "const": "mcp.tools.changed"
  8631. },
  8632. "properties": {
  8633. "type": "object",
  8634. "properties": {
  8635. "server": {
  8636. "type": "string"
  8637. }
  8638. },
  8639. "required": ["server"]
  8640. }
  8641. },
  8642. "required": ["id", "type", "properties"]
  8643. },
  8644. "Event.mcp.browser.open.failed": {
  8645. "type": "object",
  8646. "properties": {
  8647. "id": {
  8648. "type": "string"
  8649. },
  8650. "type": {
  8651. "type": "string",
  8652. "const": "mcp.browser.open.failed"
  8653. },
  8654. "properties": {
  8655. "type": "object",
  8656. "properties": {
  8657. "mcpName": {
  8658. "type": "string"
  8659. },
  8660. "url": {
  8661. "type": "string"
  8662. }
  8663. },
  8664. "required": ["mcpName", "url"]
  8665. }
  8666. },
  8667. "required": ["id", "type", "properties"]
  8668. },
  8669. "Event.command.executed": {
  8670. "type": "object",
  8671. "properties": {
  8672. "id": {
  8673. "type": "string"
  8674. },
  8675. "type": {
  8676. "type": "string",
  8677. "const": "command.executed"
  8678. },
  8679. "properties": {
  8680. "type": "object",
  8681. "properties": {
  8682. "name": {
  8683. "type": "string"
  8684. },
  8685. "sessionID": {
  8686. "type": "string",
  8687. "pattern": "^ses.*"
  8688. },
  8689. "arguments": {
  8690. "type": "string"
  8691. },
  8692. "messageID": {
  8693. "type": "string",
  8694. "pattern": "^msg.*"
  8695. }
  8696. },
  8697. "required": ["name", "sessionID", "arguments", "messageID"]
  8698. }
  8699. },
  8700. "required": ["id", "type", "properties"]
  8701. },
  8702. "Project": {
  8703. "type": "object",
  8704. "properties": {
  8705. "id": {
  8706. "type": "string"
  8707. },
  8708. "worktree": {
  8709. "type": "string"
  8710. },
  8711. "vcs": {
  8712. "type": "string",
  8713. "const": "git"
  8714. },
  8715. "name": {
  8716. "type": "string"
  8717. },
  8718. "icon": {
  8719. "type": "object",
  8720. "properties": {
  8721. "url": {
  8722. "type": "string"
  8723. },
  8724. "override": {
  8725. "type": "string"
  8726. },
  8727. "color": {
  8728. "type": "string"
  8729. }
  8730. }
  8731. },
  8732. "commands": {
  8733. "type": "object",
  8734. "properties": {
  8735. "start": {
  8736. "description": "Startup script to run when creating a new workspace (worktree)",
  8737. "type": "string"
  8738. }
  8739. }
  8740. },
  8741. "time": {
  8742. "type": "object",
  8743. "properties": {
  8744. "created": {
  8745. "type": "integer",
  8746. "minimum": 0,
  8747. "maximum": 9007199254740991
  8748. },
  8749. "updated": {
  8750. "type": "integer",
  8751. "minimum": 0,
  8752. "maximum": 9007199254740991
  8753. },
  8754. "initialized": {
  8755. "type": "integer",
  8756. "minimum": 0,
  8757. "maximum": 9007199254740991
  8758. }
  8759. },
  8760. "required": ["created", "updated"]
  8761. },
  8762. "sandboxes": {
  8763. "type": "array",
  8764. "items": {
  8765. "type": "string"
  8766. }
  8767. }
  8768. },
  8769. "required": ["id", "worktree", "time", "sandboxes"]
  8770. },
  8771. "Event.project.updated": {
  8772. "type": "object",
  8773. "properties": {
  8774. "id": {
  8775. "type": "string"
  8776. },
  8777. "type": {
  8778. "type": "string",
  8779. "const": "project.updated"
  8780. },
  8781. "properties": {
  8782. "$ref": "#/components/schemas/Project"
  8783. }
  8784. },
  8785. "required": ["id", "type", "properties"]
  8786. },
  8787. "Event.vcs.branch.updated": {
  8788. "type": "object",
  8789. "properties": {
  8790. "id": {
  8791. "type": "string"
  8792. },
  8793. "type": {
  8794. "type": "string",
  8795. "const": "vcs.branch.updated"
  8796. },
  8797. "properties": {
  8798. "type": "object",
  8799. "properties": {
  8800. "branch": {
  8801. "type": "string"
  8802. }
  8803. }
  8804. }
  8805. },
  8806. "required": ["id", "type", "properties"]
  8807. },
  8808. "Event.workspace.ready": {
  8809. "type": "object",
  8810. "properties": {
  8811. "id": {
  8812. "type": "string"
  8813. },
  8814. "type": {
  8815. "type": "string",
  8816. "const": "workspace.ready"
  8817. },
  8818. "properties": {
  8819. "type": "object",
  8820. "properties": {
  8821. "name": {
  8822. "type": "string"
  8823. }
  8824. },
  8825. "required": ["name"]
  8826. }
  8827. },
  8828. "required": ["id", "type", "properties"]
  8829. },
  8830. "Event.workspace.failed": {
  8831. "type": "object",
  8832. "properties": {
  8833. "id": {
  8834. "type": "string"
  8835. },
  8836. "type": {
  8837. "type": "string",
  8838. "const": "workspace.failed"
  8839. },
  8840. "properties": {
  8841. "type": "object",
  8842. "properties": {
  8843. "message": {
  8844. "type": "string"
  8845. }
  8846. },
  8847. "required": ["message"]
  8848. }
  8849. },
  8850. "required": ["id", "type", "properties"]
  8851. },
  8852. "Event.workspace.restore": {
  8853. "type": "object",
  8854. "properties": {
  8855. "id": {
  8856. "type": "string"
  8857. },
  8858. "type": {
  8859. "type": "string",
  8860. "const": "workspace.restore"
  8861. },
  8862. "properties": {
  8863. "type": "object",
  8864. "properties": {
  8865. "workspaceID": {
  8866. "type": "string",
  8867. "pattern": "^wrk.*"
  8868. },
  8869. "sessionID": {
  8870. "type": "string",
  8871. "pattern": "^ses.*"
  8872. },
  8873. "total": {
  8874. "type": "integer",
  8875. "minimum": 0,
  8876. "maximum": 9007199254740991
  8877. },
  8878. "step": {
  8879. "type": "integer",
  8880. "minimum": 0,
  8881. "maximum": 9007199254740991
  8882. }
  8883. },
  8884. "required": ["workspaceID", "sessionID", "total", "step"]
  8885. }
  8886. },
  8887. "required": ["id", "type", "properties"]
  8888. },
  8889. "Event.workspace.status": {
  8890. "type": "object",
  8891. "properties": {
  8892. "id": {
  8893. "type": "string"
  8894. },
  8895. "type": {
  8896. "type": "string",
  8897. "const": "workspace.status"
  8898. },
  8899. "properties": {
  8900. "type": "object",
  8901. "properties": {
  8902. "workspaceID": {
  8903. "type": "string",
  8904. "pattern": "^wrk.*"
  8905. },
  8906. "status": {
  8907. "type": "string",
  8908. "enum": ["connected", "connecting", "disconnected", "error"]
  8909. }
  8910. },
  8911. "required": ["workspaceID", "status"]
  8912. }
  8913. },
  8914. "required": ["id", "type", "properties"]
  8915. },
  8916. "Event.worktree.ready": {
  8917. "type": "object",
  8918. "properties": {
  8919. "id": {
  8920. "type": "string"
  8921. },
  8922. "type": {
  8923. "type": "string",
  8924. "const": "worktree.ready"
  8925. },
  8926. "properties": {
  8927. "type": "object",
  8928. "properties": {
  8929. "name": {
  8930. "type": "string"
  8931. },
  8932. "branch": {
  8933. "type": "string"
  8934. }
  8935. },
  8936. "required": ["name", "branch"]
  8937. }
  8938. },
  8939. "required": ["id", "type", "properties"]
  8940. },
  8941. "Event.worktree.failed": {
  8942. "type": "object",
  8943. "properties": {
  8944. "id": {
  8945. "type": "string"
  8946. },
  8947. "type": {
  8948. "type": "string",
  8949. "const": "worktree.failed"
  8950. },
  8951. "properties": {
  8952. "type": "object",
  8953. "properties": {
  8954. "message": {
  8955. "type": "string"
  8956. }
  8957. },
  8958. "required": ["message"]
  8959. }
  8960. },
  8961. "required": ["id", "type", "properties"]
  8962. },
  8963. "Pty": {
  8964. "type": "object",
  8965. "properties": {
  8966. "id": {
  8967. "type": "string",
  8968. "pattern": "^pty.*"
  8969. },
  8970. "title": {
  8971. "type": "string"
  8972. },
  8973. "command": {
  8974. "type": "string"
  8975. },
  8976. "args": {
  8977. "type": "array",
  8978. "items": {
  8979. "type": "string"
  8980. }
  8981. },
  8982. "cwd": {
  8983. "type": "string"
  8984. },
  8985. "status": {
  8986. "type": "string",
  8987. "enum": ["running", "exited"]
  8988. },
  8989. "pid": {
  8990. "type": "integer",
  8991. "exclusiveMinimum": 0,
  8992. "maximum": 9007199254740991
  8993. }
  8994. },
  8995. "required": ["id", "title", "command", "args", "cwd", "status", "pid"]
  8996. },
  8997. "Event.pty.created": {
  8998. "type": "object",
  8999. "properties": {
  9000. "id": {
  9001. "type": "string"
  9002. },
  9003. "type": {
  9004. "type": "string",
  9005. "const": "pty.created"
  9006. },
  9007. "properties": {
  9008. "type": "object",
  9009. "properties": {
  9010. "info": {
  9011. "$ref": "#/components/schemas/Pty"
  9012. }
  9013. },
  9014. "required": ["info"]
  9015. }
  9016. },
  9017. "required": ["id", "type", "properties"]
  9018. },
  9019. "Event.pty.updated": {
  9020. "type": "object",
  9021. "properties": {
  9022. "id": {
  9023. "type": "string"
  9024. },
  9025. "type": {
  9026. "type": "string",
  9027. "const": "pty.updated"
  9028. },
  9029. "properties": {
  9030. "type": "object",
  9031. "properties": {
  9032. "info": {
  9033. "$ref": "#/components/schemas/Pty"
  9034. }
  9035. },
  9036. "required": ["info"]
  9037. }
  9038. },
  9039. "required": ["id", "type", "properties"]
  9040. },
  9041. "Event.pty.exited": {
  9042. "type": "object",
  9043. "properties": {
  9044. "id": {
  9045. "type": "string"
  9046. },
  9047. "type": {
  9048. "type": "string",
  9049. "const": "pty.exited"
  9050. },
  9051. "properties": {
  9052. "type": "object",
  9053. "properties": {
  9054. "id": {
  9055. "type": "string",
  9056. "pattern": "^pty.*"
  9057. },
  9058. "exitCode": {
  9059. "type": "integer",
  9060. "minimum": 0,
  9061. "maximum": 9007199254740991
  9062. }
  9063. },
  9064. "required": ["id", "exitCode"]
  9065. }
  9066. },
  9067. "required": ["id", "type", "properties"]
  9068. },
  9069. "Event.pty.deleted": {
  9070. "type": "object",
  9071. "properties": {
  9072. "id": {
  9073. "type": "string"
  9074. },
  9075. "type": {
  9076. "type": "string",
  9077. "const": "pty.deleted"
  9078. },
  9079. "properties": {
  9080. "type": "object",
  9081. "properties": {
  9082. "id": {
  9083. "type": "string",
  9084. "pattern": "^pty.*"
  9085. }
  9086. },
  9087. "required": ["id"]
  9088. }
  9089. },
  9090. "required": ["id", "type", "properties"]
  9091. },
  9092. "OutputFormatText": {
  9093. "type": "object",
  9094. "properties": {
  9095. "type": {
  9096. "type": "string",
  9097. "const": "text"
  9098. }
  9099. },
  9100. "required": ["type"]
  9101. },
  9102. "JSONSchema": {
  9103. "type": "object",
  9104. "propertyNames": {
  9105. "type": "string"
  9106. },
  9107. "additionalProperties": {}
  9108. },
  9109. "OutputFormatJsonSchema": {
  9110. "type": "object",
  9111. "properties": {
  9112. "type": {
  9113. "type": "string",
  9114. "const": "json_schema"
  9115. },
  9116. "schema": {
  9117. "$ref": "#/components/schemas/JSONSchema"
  9118. },
  9119. "retryCount": {
  9120. "default": 2,
  9121. "type": "integer",
  9122. "minimum": 0,
  9123. "maximum": 9007199254740991
  9124. }
  9125. },
  9126. "required": ["type", "schema"]
  9127. },
  9128. "OutputFormat": {
  9129. "anyOf": [
  9130. {
  9131. "$ref": "#/components/schemas/OutputFormatText"
  9132. },
  9133. {
  9134. "$ref": "#/components/schemas/OutputFormatJsonSchema"
  9135. }
  9136. ]
  9137. },
  9138. "UserMessage": {
  9139. "type": "object",
  9140. "properties": {
  9141. "id": {
  9142. "type": "string",
  9143. "pattern": "^msg.*"
  9144. },
  9145. "sessionID": {
  9146. "type": "string",
  9147. "pattern": "^ses.*"
  9148. },
  9149. "role": {
  9150. "type": "string",
  9151. "const": "user"
  9152. },
  9153. "time": {
  9154. "type": "object",
  9155. "properties": {
  9156. "created": {
  9157. "type": "integer",
  9158. "minimum": 0,
  9159. "maximum": 9007199254740991
  9160. }
  9161. },
  9162. "required": ["created"]
  9163. },
  9164. "format": {
  9165. "$ref": "#/components/schemas/OutputFormat"
  9166. },
  9167. "summary": {
  9168. "type": "object",
  9169. "properties": {
  9170. "title": {
  9171. "type": "string"
  9172. },
  9173. "body": {
  9174. "type": "string"
  9175. },
  9176. "diffs": {
  9177. "type": "array",
  9178. "items": {
  9179. "$ref": "#/components/schemas/SnapshotFileDiff"
  9180. }
  9181. }
  9182. },
  9183. "required": ["diffs"]
  9184. },
  9185. "agent": {
  9186. "type": "string"
  9187. },
  9188. "model": {
  9189. "type": "object",
  9190. "properties": {
  9191. "providerID": {
  9192. "type": "string"
  9193. },
  9194. "modelID": {
  9195. "type": "string"
  9196. },
  9197. "variant": {
  9198. "type": "string"
  9199. }
  9200. },
  9201. "required": ["providerID", "modelID"]
  9202. },
  9203. "system": {
  9204. "type": "string"
  9205. },
  9206. "tools": {
  9207. "type": "object",
  9208. "propertyNames": {
  9209. "type": "string"
  9210. },
  9211. "additionalProperties": {
  9212. "type": "boolean"
  9213. }
  9214. }
  9215. },
  9216. "required": ["id", "sessionID", "role", "time", "agent", "model"]
  9217. },
  9218. "AssistantMessage": {
  9219. "type": "object",
  9220. "properties": {
  9221. "id": {
  9222. "type": "string",
  9223. "pattern": "^msg.*"
  9224. },
  9225. "sessionID": {
  9226. "type": "string",
  9227. "pattern": "^ses.*"
  9228. },
  9229. "role": {
  9230. "type": "string",
  9231. "const": "assistant"
  9232. },
  9233. "time": {
  9234. "type": "object",
  9235. "properties": {
  9236. "created": {
  9237. "type": "integer",
  9238. "minimum": 0,
  9239. "maximum": 9007199254740991
  9240. },
  9241. "completed": {
  9242. "type": "integer",
  9243. "minimum": 0,
  9244. "maximum": 9007199254740991
  9245. }
  9246. },
  9247. "required": ["created"]
  9248. },
  9249. "error": {
  9250. "anyOf": [
  9251. {
  9252. "$ref": "#/components/schemas/ProviderAuthError"
  9253. },
  9254. {
  9255. "$ref": "#/components/schemas/UnknownError"
  9256. },
  9257. {
  9258. "$ref": "#/components/schemas/MessageOutputLengthError"
  9259. },
  9260. {
  9261. "$ref": "#/components/schemas/MessageAbortedError"
  9262. },
  9263. {
  9264. "$ref": "#/components/schemas/StructuredOutputError"
  9265. },
  9266. {
  9267. "$ref": "#/components/schemas/ContextOverflowError"
  9268. },
  9269. {
  9270. "$ref": "#/components/schemas/APIError"
  9271. }
  9272. ]
  9273. },
  9274. "parentID": {
  9275. "type": "string",
  9276. "pattern": "^msg.*"
  9277. },
  9278. "modelID": {
  9279. "type": "string"
  9280. },
  9281. "providerID": {
  9282. "type": "string"
  9283. },
  9284. "mode": {
  9285. "type": "string"
  9286. },
  9287. "agent": {
  9288. "type": "string"
  9289. },
  9290. "path": {
  9291. "type": "object",
  9292. "properties": {
  9293. "cwd": {
  9294. "type": "string"
  9295. },
  9296. "root": {
  9297. "type": "string"
  9298. }
  9299. },
  9300. "required": ["cwd", "root"]
  9301. },
  9302. "summary": {
  9303. "type": "boolean"
  9304. },
  9305. "cost": {
  9306. "type": "number"
  9307. },
  9308. "tokens": {
  9309. "type": "object",
  9310. "properties": {
  9311. "total": {
  9312. "type": "integer",
  9313. "minimum": 0,
  9314. "maximum": 9007199254740991
  9315. },
  9316. "input": {
  9317. "type": "integer",
  9318. "minimum": 0,
  9319. "maximum": 9007199254740991
  9320. },
  9321. "output": {
  9322. "type": "integer",
  9323. "minimum": 0,
  9324. "maximum": 9007199254740991
  9325. },
  9326. "reasoning": {
  9327. "type": "integer",
  9328. "minimum": 0,
  9329. "maximum": 9007199254740991
  9330. },
  9331. "cache": {
  9332. "type": "object",
  9333. "properties": {
  9334. "read": {
  9335. "type": "integer",
  9336. "minimum": 0,
  9337. "maximum": 9007199254740991
  9338. },
  9339. "write": {
  9340. "type": "integer",
  9341. "minimum": 0,
  9342. "maximum": 9007199254740991
  9343. }
  9344. },
  9345. "required": ["read", "write"]
  9346. }
  9347. },
  9348. "required": ["input", "output", "reasoning", "cache"]
  9349. },
  9350. "structured": {},
  9351. "variant": {
  9352. "type": "string"
  9353. },
  9354. "finish": {
  9355. "type": "string"
  9356. }
  9357. },
  9358. "required": [
  9359. "id",
  9360. "sessionID",
  9361. "role",
  9362. "time",
  9363. "parentID",
  9364. "modelID",
  9365. "providerID",
  9366. "mode",
  9367. "agent",
  9368. "path",
  9369. "cost",
  9370. "tokens"
  9371. ]
  9372. },
  9373. "Message": {
  9374. "anyOf": [
  9375. {
  9376. "$ref": "#/components/schemas/UserMessage"
  9377. },
  9378. {
  9379. "$ref": "#/components/schemas/AssistantMessage"
  9380. }
  9381. ]
  9382. },
  9383. "Event.message.updated": {
  9384. "type": "object",
  9385. "properties": {
  9386. "id": {
  9387. "type": "string"
  9388. },
  9389. "type": {
  9390. "type": "string",
  9391. "const": "message.updated"
  9392. },
  9393. "properties": {
  9394. "type": "object",
  9395. "properties": {
  9396. "sessionID": {
  9397. "type": "string",
  9398. "pattern": "^ses.*"
  9399. },
  9400. "info": {
  9401. "$ref": "#/components/schemas/Message"
  9402. }
  9403. },
  9404. "required": ["sessionID", "info"]
  9405. }
  9406. },
  9407. "required": ["id", "type", "properties"]
  9408. },
  9409. "Event.message.removed": {
  9410. "type": "object",
  9411. "properties": {
  9412. "id": {
  9413. "type": "string"
  9414. },
  9415. "type": {
  9416. "type": "string",
  9417. "const": "message.removed"
  9418. },
  9419. "properties": {
  9420. "type": "object",
  9421. "properties": {
  9422. "sessionID": {
  9423. "type": "string",
  9424. "pattern": "^ses.*"
  9425. },
  9426. "messageID": {
  9427. "type": "string",
  9428. "pattern": "^msg.*"
  9429. }
  9430. },
  9431. "required": ["sessionID", "messageID"]
  9432. }
  9433. },
  9434. "required": ["id", "type", "properties"]
  9435. },
  9436. "TextPart": {
  9437. "type": "object",
  9438. "properties": {
  9439. "id": {
  9440. "type": "string",
  9441. "pattern": "^prt.*"
  9442. },
  9443. "sessionID": {
  9444. "type": "string",
  9445. "pattern": "^ses.*"
  9446. },
  9447. "messageID": {
  9448. "type": "string",
  9449. "pattern": "^msg.*"
  9450. },
  9451. "type": {
  9452. "type": "string",
  9453. "const": "text"
  9454. },
  9455. "text": {
  9456. "type": "string"
  9457. },
  9458. "synthetic": {
  9459. "type": "boolean"
  9460. },
  9461. "ignored": {
  9462. "type": "boolean"
  9463. },
  9464. "time": {
  9465. "type": "object",
  9466. "properties": {
  9467. "start": {
  9468. "type": "integer",
  9469. "minimum": 0,
  9470. "maximum": 9007199254740991
  9471. },
  9472. "end": {
  9473. "type": "integer",
  9474. "minimum": 0,
  9475. "maximum": 9007199254740991
  9476. }
  9477. },
  9478. "required": ["start"]
  9479. },
  9480. "metadata": {
  9481. "type": "object",
  9482. "propertyNames": {
  9483. "type": "string"
  9484. },
  9485. "additionalProperties": {}
  9486. }
  9487. },
  9488. "required": ["id", "sessionID", "messageID", "type", "text"]
  9489. },
  9490. "SubtaskPart": {
  9491. "type": "object",
  9492. "properties": {
  9493. "id": {
  9494. "type": "string",
  9495. "pattern": "^prt.*"
  9496. },
  9497. "sessionID": {
  9498. "type": "string",
  9499. "pattern": "^ses.*"
  9500. },
  9501. "messageID": {
  9502. "type": "string",
  9503. "pattern": "^msg.*"
  9504. },
  9505. "type": {
  9506. "type": "string",
  9507. "const": "subtask"
  9508. },
  9509. "prompt": {
  9510. "type": "string"
  9511. },
  9512. "description": {
  9513. "type": "string"
  9514. },
  9515. "agent": {
  9516. "type": "string"
  9517. },
  9518. "model": {
  9519. "type": "object",
  9520. "properties": {
  9521. "providerID": {
  9522. "type": "string"
  9523. },
  9524. "modelID": {
  9525. "type": "string"
  9526. }
  9527. },
  9528. "required": ["providerID", "modelID"]
  9529. },
  9530. "command": {
  9531. "type": "string"
  9532. }
  9533. },
  9534. "required": ["id", "sessionID", "messageID", "type", "prompt", "description", "agent"]
  9535. },
  9536. "ReasoningPart": {
  9537. "type": "object",
  9538. "properties": {
  9539. "id": {
  9540. "type": "string",
  9541. "pattern": "^prt.*"
  9542. },
  9543. "sessionID": {
  9544. "type": "string",
  9545. "pattern": "^ses.*"
  9546. },
  9547. "messageID": {
  9548. "type": "string",
  9549. "pattern": "^msg.*"
  9550. },
  9551. "type": {
  9552. "type": "string",
  9553. "const": "reasoning"
  9554. },
  9555. "text": {
  9556. "type": "string"
  9557. },
  9558. "metadata": {
  9559. "type": "object",
  9560. "propertyNames": {
  9561. "type": "string"
  9562. },
  9563. "additionalProperties": {}
  9564. },
  9565. "time": {
  9566. "type": "object",
  9567. "properties": {
  9568. "start": {
  9569. "type": "integer",
  9570. "minimum": 0,
  9571. "maximum": 9007199254740991
  9572. },
  9573. "end": {
  9574. "type": "integer",
  9575. "minimum": 0,
  9576. "maximum": 9007199254740991
  9577. }
  9578. },
  9579. "required": ["start"]
  9580. }
  9581. },
  9582. "required": ["id", "sessionID", "messageID", "type", "text", "time"]
  9583. },
  9584. "FilePartSourceText": {
  9585. "type": "object",
  9586. "properties": {
  9587. "value": {
  9588. "type": "string"
  9589. },
  9590. "start": {
  9591. "type": "integer",
  9592. "minimum": 0,
  9593. "maximum": 9007199254740991
  9594. },
  9595. "end": {
  9596. "type": "integer",
  9597. "minimum": 0,
  9598. "maximum": 9007199254740991
  9599. }
  9600. },
  9601. "required": ["value", "start", "end"]
  9602. },
  9603. "FileSource": {
  9604. "type": "object",
  9605. "properties": {
  9606. "text": {
  9607. "$ref": "#/components/schemas/FilePartSourceText"
  9608. },
  9609. "type": {
  9610. "type": "string",
  9611. "const": "file"
  9612. },
  9613. "path": {
  9614. "type": "string"
  9615. }
  9616. },
  9617. "required": ["text", "type", "path"]
  9618. },
  9619. "Range": {
  9620. "type": "object",
  9621. "properties": {
  9622. "start": {
  9623. "type": "object",
  9624. "properties": {
  9625. "line": {
  9626. "type": "integer",
  9627. "minimum": 0,
  9628. "maximum": 9007199254740991
  9629. },
  9630. "character": {
  9631. "type": "integer",
  9632. "minimum": 0,
  9633. "maximum": 9007199254740991
  9634. }
  9635. },
  9636. "required": ["line", "character"]
  9637. },
  9638. "end": {
  9639. "type": "object",
  9640. "properties": {
  9641. "line": {
  9642. "type": "integer",
  9643. "minimum": 0,
  9644. "maximum": 9007199254740991
  9645. },
  9646. "character": {
  9647. "type": "integer",
  9648. "minimum": 0,
  9649. "maximum": 9007199254740991
  9650. }
  9651. },
  9652. "required": ["line", "character"]
  9653. }
  9654. },
  9655. "required": ["start", "end"]
  9656. },
  9657. "SymbolSource": {
  9658. "type": "object",
  9659. "properties": {
  9660. "text": {
  9661. "$ref": "#/components/schemas/FilePartSourceText"
  9662. },
  9663. "type": {
  9664. "type": "string",
  9665. "const": "symbol"
  9666. },
  9667. "path": {
  9668. "type": "string"
  9669. },
  9670. "range": {
  9671. "$ref": "#/components/schemas/Range"
  9672. },
  9673. "name": {
  9674. "type": "string"
  9675. },
  9676. "kind": {
  9677. "type": "integer",
  9678. "minimum": 0,
  9679. "maximum": 9007199254740991
  9680. }
  9681. },
  9682. "required": ["text", "type", "path", "range", "name", "kind"]
  9683. },
  9684. "ResourceSource": {
  9685. "type": "object",
  9686. "properties": {
  9687. "text": {
  9688. "$ref": "#/components/schemas/FilePartSourceText"
  9689. },
  9690. "type": {
  9691. "type": "string",
  9692. "const": "resource"
  9693. },
  9694. "clientName": {
  9695. "type": "string"
  9696. },
  9697. "uri": {
  9698. "type": "string"
  9699. }
  9700. },
  9701. "required": ["text", "type", "clientName", "uri"]
  9702. },
  9703. "FilePartSource": {
  9704. "anyOf": [
  9705. {
  9706. "$ref": "#/components/schemas/FileSource"
  9707. },
  9708. {
  9709. "$ref": "#/components/schemas/SymbolSource"
  9710. },
  9711. {
  9712. "$ref": "#/components/schemas/ResourceSource"
  9713. }
  9714. ]
  9715. },
  9716. "FilePart": {
  9717. "type": "object",
  9718. "properties": {
  9719. "id": {
  9720. "type": "string",
  9721. "pattern": "^prt.*"
  9722. },
  9723. "sessionID": {
  9724. "type": "string",
  9725. "pattern": "^ses.*"
  9726. },
  9727. "messageID": {
  9728. "type": "string",
  9729. "pattern": "^msg.*"
  9730. },
  9731. "type": {
  9732. "type": "string",
  9733. "const": "file"
  9734. },
  9735. "mime": {
  9736. "type": "string"
  9737. },
  9738. "filename": {
  9739. "type": "string"
  9740. },
  9741. "url": {
  9742. "type": "string"
  9743. },
  9744. "source": {
  9745. "$ref": "#/components/schemas/FilePartSource"
  9746. }
  9747. },
  9748. "required": ["id", "sessionID", "messageID", "type", "mime", "url"]
  9749. },
  9750. "ToolStatePending": {
  9751. "type": "object",
  9752. "properties": {
  9753. "status": {
  9754. "type": "string",
  9755. "const": "pending"
  9756. },
  9757. "input": {
  9758. "type": "object",
  9759. "propertyNames": {
  9760. "type": "string"
  9761. },
  9762. "additionalProperties": {}
  9763. },
  9764. "raw": {
  9765. "type": "string"
  9766. }
  9767. },
  9768. "required": ["status", "input", "raw"]
  9769. },
  9770. "ToolStateRunning": {
  9771. "type": "object",
  9772. "properties": {
  9773. "status": {
  9774. "type": "string",
  9775. "const": "running"
  9776. },
  9777. "input": {
  9778. "type": "object",
  9779. "propertyNames": {
  9780. "type": "string"
  9781. },
  9782. "additionalProperties": {}
  9783. },
  9784. "title": {
  9785. "type": "string"
  9786. },
  9787. "metadata": {
  9788. "type": "object",
  9789. "propertyNames": {
  9790. "type": "string"
  9791. },
  9792. "additionalProperties": {}
  9793. },
  9794. "time": {
  9795. "type": "object",
  9796. "properties": {
  9797. "start": {
  9798. "type": "integer",
  9799. "minimum": 0,
  9800. "maximum": 9007199254740991
  9801. }
  9802. },
  9803. "required": ["start"]
  9804. }
  9805. },
  9806. "required": ["status", "input", "time"]
  9807. },
  9808. "ToolStateCompleted": {
  9809. "type": "object",
  9810. "properties": {
  9811. "status": {
  9812. "type": "string",
  9813. "const": "completed"
  9814. },
  9815. "input": {
  9816. "type": "object",
  9817. "propertyNames": {
  9818. "type": "string"
  9819. },
  9820. "additionalProperties": {}
  9821. },
  9822. "output": {
  9823. "type": "string"
  9824. },
  9825. "title": {
  9826. "type": "string"
  9827. },
  9828. "metadata": {
  9829. "type": "object",
  9830. "propertyNames": {
  9831. "type": "string"
  9832. },
  9833. "additionalProperties": {}
  9834. },
  9835. "time": {
  9836. "type": "object",
  9837. "properties": {
  9838. "start": {
  9839. "type": "integer",
  9840. "minimum": 0,
  9841. "maximum": 9007199254740991
  9842. },
  9843. "end": {
  9844. "type": "integer",
  9845. "minimum": 0,
  9846. "maximum": 9007199254740991
  9847. },
  9848. "compacted": {
  9849. "type": "integer",
  9850. "minimum": 0,
  9851. "maximum": 9007199254740991
  9852. }
  9853. },
  9854. "required": ["start", "end"]
  9855. },
  9856. "attachments": {
  9857. "type": "array",
  9858. "items": {
  9859. "$ref": "#/components/schemas/FilePart"
  9860. }
  9861. }
  9862. },
  9863. "required": ["status", "input", "output", "title", "metadata", "time"]
  9864. },
  9865. "ToolStateError": {
  9866. "type": "object",
  9867. "properties": {
  9868. "status": {
  9869. "type": "string",
  9870. "const": "error"
  9871. },
  9872. "input": {
  9873. "type": "object",
  9874. "propertyNames": {
  9875. "type": "string"
  9876. },
  9877. "additionalProperties": {}
  9878. },
  9879. "error": {
  9880. "type": "string"
  9881. },
  9882. "metadata": {
  9883. "type": "object",
  9884. "propertyNames": {
  9885. "type": "string"
  9886. },
  9887. "additionalProperties": {}
  9888. },
  9889. "time": {
  9890. "type": "object",
  9891. "properties": {
  9892. "start": {
  9893. "type": "integer",
  9894. "minimum": 0,
  9895. "maximum": 9007199254740991
  9896. },
  9897. "end": {
  9898. "type": "integer",
  9899. "minimum": 0,
  9900. "maximum": 9007199254740991
  9901. }
  9902. },
  9903. "required": ["start", "end"]
  9904. }
  9905. },
  9906. "required": ["status", "input", "error", "time"]
  9907. },
  9908. "ToolState": {
  9909. "anyOf": [
  9910. {
  9911. "$ref": "#/components/schemas/ToolStatePending"
  9912. },
  9913. {
  9914. "$ref": "#/components/schemas/ToolStateRunning"
  9915. },
  9916. {
  9917. "$ref": "#/components/schemas/ToolStateCompleted"
  9918. },
  9919. {
  9920. "$ref": "#/components/schemas/ToolStateError"
  9921. }
  9922. ]
  9923. },
  9924. "ToolPart": {
  9925. "type": "object",
  9926. "properties": {
  9927. "id": {
  9928. "type": "string",
  9929. "pattern": "^prt.*"
  9930. },
  9931. "sessionID": {
  9932. "type": "string",
  9933. "pattern": "^ses.*"
  9934. },
  9935. "messageID": {
  9936. "type": "string",
  9937. "pattern": "^msg.*"
  9938. },
  9939. "type": {
  9940. "type": "string",
  9941. "const": "tool"
  9942. },
  9943. "callID": {
  9944. "type": "string"
  9945. },
  9946. "tool": {
  9947. "type": "string"
  9948. },
  9949. "state": {
  9950. "$ref": "#/components/schemas/ToolState"
  9951. },
  9952. "metadata": {
  9953. "type": "object",
  9954. "propertyNames": {
  9955. "type": "string"
  9956. },
  9957. "additionalProperties": {}
  9958. }
  9959. },
  9960. "required": ["id", "sessionID", "messageID", "type", "callID", "tool", "state"]
  9961. },
  9962. "StepStartPart": {
  9963. "type": "object",
  9964. "properties": {
  9965. "id": {
  9966. "type": "string",
  9967. "pattern": "^prt.*"
  9968. },
  9969. "sessionID": {
  9970. "type": "string",
  9971. "pattern": "^ses.*"
  9972. },
  9973. "messageID": {
  9974. "type": "string",
  9975. "pattern": "^msg.*"
  9976. },
  9977. "type": {
  9978. "type": "string",
  9979. "const": "step-start"
  9980. },
  9981. "snapshot": {
  9982. "type": "string"
  9983. }
  9984. },
  9985. "required": ["id", "sessionID", "messageID", "type"]
  9986. },
  9987. "StepFinishPart": {
  9988. "type": "object",
  9989. "properties": {
  9990. "id": {
  9991. "type": "string",
  9992. "pattern": "^prt.*"
  9993. },
  9994. "sessionID": {
  9995. "type": "string",
  9996. "pattern": "^ses.*"
  9997. },
  9998. "messageID": {
  9999. "type": "string",
  10000. "pattern": "^msg.*"
  10001. },
  10002. "type": {
  10003. "type": "string",
  10004. "const": "step-finish"
  10005. },
  10006. "reason": {
  10007. "type": "string"
  10008. },
  10009. "snapshot": {
  10010. "type": "string"
  10011. },
  10012. "cost": {
  10013. "type": "number"
  10014. },
  10015. "tokens": {
  10016. "type": "object",
  10017. "properties": {
  10018. "total": {
  10019. "type": "integer",
  10020. "minimum": 0,
  10021. "maximum": 9007199254740991
  10022. },
  10023. "input": {
  10024. "type": "integer",
  10025. "minimum": 0,
  10026. "maximum": 9007199254740991
  10027. },
  10028. "output": {
  10029. "type": "integer",
  10030. "minimum": 0,
  10031. "maximum": 9007199254740991
  10032. },
  10033. "reasoning": {
  10034. "type": "integer",
  10035. "minimum": 0,
  10036. "maximum": 9007199254740991
  10037. },
  10038. "cache": {
  10039. "type": "object",
  10040. "properties": {
  10041. "read": {
  10042. "type": "integer",
  10043. "minimum": 0,
  10044. "maximum": 9007199254740991
  10045. },
  10046. "write": {
  10047. "type": "integer",
  10048. "minimum": 0,
  10049. "maximum": 9007199254740991
  10050. }
  10051. },
  10052. "required": ["read", "write"]
  10053. }
  10054. },
  10055. "required": ["input", "output", "reasoning", "cache"]
  10056. }
  10057. },
  10058. "required": ["id", "sessionID", "messageID", "type", "reason", "cost", "tokens"]
  10059. },
  10060. "SnapshotPart": {
  10061. "type": "object",
  10062. "properties": {
  10063. "id": {
  10064. "type": "string",
  10065. "pattern": "^prt.*"
  10066. },
  10067. "sessionID": {
  10068. "type": "string",
  10069. "pattern": "^ses.*"
  10070. },
  10071. "messageID": {
  10072. "type": "string",
  10073. "pattern": "^msg.*"
  10074. },
  10075. "type": {
  10076. "type": "string",
  10077. "const": "snapshot"
  10078. },
  10079. "snapshot": {
  10080. "type": "string"
  10081. }
  10082. },
  10083. "required": ["id", "sessionID", "messageID", "type", "snapshot"]
  10084. },
  10085. "PatchPart": {
  10086. "type": "object",
  10087. "properties": {
  10088. "id": {
  10089. "type": "string",
  10090. "pattern": "^prt.*"
  10091. },
  10092. "sessionID": {
  10093. "type": "string",
  10094. "pattern": "^ses.*"
  10095. },
  10096. "messageID": {
  10097. "type": "string",
  10098. "pattern": "^msg.*"
  10099. },
  10100. "type": {
  10101. "type": "string",
  10102. "const": "patch"
  10103. },
  10104. "hash": {
  10105. "type": "string"
  10106. },
  10107. "files": {
  10108. "type": "array",
  10109. "items": {
  10110. "type": "string"
  10111. }
  10112. }
  10113. },
  10114. "required": ["id", "sessionID", "messageID", "type", "hash", "files"]
  10115. },
  10116. "AgentPart": {
  10117. "type": "object",
  10118. "properties": {
  10119. "id": {
  10120. "type": "string",
  10121. "pattern": "^prt.*"
  10122. },
  10123. "sessionID": {
  10124. "type": "string",
  10125. "pattern": "^ses.*"
  10126. },
  10127. "messageID": {
  10128. "type": "string",
  10129. "pattern": "^msg.*"
  10130. },
  10131. "type": {
  10132. "type": "string",
  10133. "const": "agent"
  10134. },
  10135. "name": {
  10136. "type": "string"
  10137. },
  10138. "source": {
  10139. "type": "object",
  10140. "properties": {
  10141. "value": {
  10142. "type": "string"
  10143. },
  10144. "start": {
  10145. "type": "integer",
  10146. "minimum": 0,
  10147. "maximum": 9007199254740991
  10148. },
  10149. "end": {
  10150. "type": "integer",
  10151. "minimum": 0,
  10152. "maximum": 9007199254740991
  10153. }
  10154. },
  10155. "required": ["value", "start", "end"]
  10156. }
  10157. },
  10158. "required": ["id", "sessionID", "messageID", "type", "name"]
  10159. },
  10160. "RetryPart": {
  10161. "type": "object",
  10162. "properties": {
  10163. "id": {
  10164. "type": "string",
  10165. "pattern": "^prt.*"
  10166. },
  10167. "sessionID": {
  10168. "type": "string",
  10169. "pattern": "^ses.*"
  10170. },
  10171. "messageID": {
  10172. "type": "string",
  10173. "pattern": "^msg.*"
  10174. },
  10175. "type": {
  10176. "type": "string",
  10177. "const": "retry"
  10178. },
  10179. "attempt": {
  10180. "type": "integer",
  10181. "minimum": 0,
  10182. "maximum": 9007199254740991
  10183. },
  10184. "error": {
  10185. "$ref": "#/components/schemas/APIError"
  10186. },
  10187. "time": {
  10188. "type": "object",
  10189. "properties": {
  10190. "created": {
  10191. "type": "integer",
  10192. "minimum": 0,
  10193. "maximum": 9007199254740991
  10194. }
  10195. },
  10196. "required": ["created"]
  10197. }
  10198. },
  10199. "required": ["id", "sessionID", "messageID", "type", "attempt", "error", "time"]
  10200. },
  10201. "CompactionPart": {
  10202. "type": "object",
  10203. "properties": {
  10204. "id": {
  10205. "type": "string",
  10206. "pattern": "^prt.*"
  10207. },
  10208. "sessionID": {
  10209. "type": "string",
  10210. "pattern": "^ses.*"
  10211. },
  10212. "messageID": {
  10213. "type": "string",
  10214. "pattern": "^msg.*"
  10215. },
  10216. "type": {
  10217. "type": "string",
  10218. "const": "compaction"
  10219. },
  10220. "auto": {
  10221. "type": "boolean"
  10222. },
  10223. "overflow": {
  10224. "type": "boolean"
  10225. },
  10226. "tail_start_id": {
  10227. "type": "string",
  10228. "pattern": "^msg.*"
  10229. }
  10230. },
  10231. "required": ["id", "sessionID", "messageID", "type", "auto"]
  10232. },
  10233. "Part": {
  10234. "anyOf": [
  10235. {
  10236. "$ref": "#/components/schemas/TextPart"
  10237. },
  10238. {
  10239. "$ref": "#/components/schemas/SubtaskPart"
  10240. },
  10241. {
  10242. "$ref": "#/components/schemas/ReasoningPart"
  10243. },
  10244. {
  10245. "$ref": "#/components/schemas/FilePart"
  10246. },
  10247. {
  10248. "$ref": "#/components/schemas/ToolPart"
  10249. },
  10250. {
  10251. "$ref": "#/components/schemas/StepStartPart"
  10252. },
  10253. {
  10254. "$ref": "#/components/schemas/StepFinishPart"
  10255. },
  10256. {
  10257. "$ref": "#/components/schemas/SnapshotPart"
  10258. },
  10259. {
  10260. "$ref": "#/components/schemas/PatchPart"
  10261. },
  10262. {
  10263. "$ref": "#/components/schemas/AgentPart"
  10264. },
  10265. {
  10266. "$ref": "#/components/schemas/RetryPart"
  10267. },
  10268. {
  10269. "$ref": "#/components/schemas/CompactionPart"
  10270. }
  10271. ]
  10272. },
  10273. "Event.message.part.updated": {
  10274. "type": "object",
  10275. "properties": {
  10276. "id": {
  10277. "type": "string"
  10278. },
  10279. "type": {
  10280. "type": "string",
  10281. "const": "message.part.updated"
  10282. },
  10283. "properties": {
  10284. "type": "object",
  10285. "properties": {
  10286. "sessionID": {
  10287. "type": "string",
  10288. "pattern": "^ses.*"
  10289. },
  10290. "part": {
  10291. "$ref": "#/components/schemas/Part"
  10292. },
  10293. "time": {
  10294. "type": "integer",
  10295. "minimum": 0,
  10296. "maximum": 9007199254740991
  10297. }
  10298. },
  10299. "required": ["sessionID", "part", "time"]
  10300. }
  10301. },
  10302. "required": ["id", "type", "properties"]
  10303. },
  10304. "Event.message.part.removed": {
  10305. "type": "object",
  10306. "properties": {
  10307. "id": {
  10308. "type": "string"
  10309. },
  10310. "type": {
  10311. "type": "string",
  10312. "const": "message.part.removed"
  10313. },
  10314. "properties": {
  10315. "type": "object",
  10316. "properties": {
  10317. "sessionID": {
  10318. "type": "string",
  10319. "pattern": "^ses.*"
  10320. },
  10321. "messageID": {
  10322. "type": "string",
  10323. "pattern": "^msg.*"
  10324. },
  10325. "partID": {
  10326. "type": "string",
  10327. "pattern": "^prt.*"
  10328. }
  10329. },
  10330. "required": ["sessionID", "messageID", "partID"]
  10331. }
  10332. },
  10333. "required": ["id", "type", "properties"]
  10334. },
  10335. "PermissionAction": {
  10336. "type": "string",
  10337. "enum": ["allow", "deny", "ask"]
  10338. },
  10339. "PermissionRule": {
  10340. "type": "object",
  10341. "properties": {
  10342. "permission": {
  10343. "type": "string"
  10344. },
  10345. "pattern": {
  10346. "type": "string"
  10347. },
  10348. "action": {
  10349. "$ref": "#/components/schemas/PermissionAction"
  10350. }
  10351. },
  10352. "required": ["permission", "pattern", "action"]
  10353. },
  10354. "PermissionRuleset": {
  10355. "type": "array",
  10356. "items": {
  10357. "$ref": "#/components/schemas/PermissionRule"
  10358. }
  10359. },
  10360. "Session": {
  10361. "type": "object",
  10362. "properties": {
  10363. "id": {
  10364. "type": "string",
  10365. "pattern": "^ses.*"
  10366. },
  10367. "slug": {
  10368. "type": "string"
  10369. },
  10370. "projectID": {
  10371. "type": "string"
  10372. },
  10373. "workspaceID": {
  10374. "type": "string",
  10375. "pattern": "^wrk.*"
  10376. },
  10377. "directory": {
  10378. "type": "string"
  10379. },
  10380. "path": {
  10381. "type": "string"
  10382. },
  10383. "parentID": {
  10384. "type": "string",
  10385. "pattern": "^ses.*"
  10386. },
  10387. "summary": {
  10388. "type": "object",
  10389. "properties": {
  10390. "additions": {
  10391. "type": "integer",
  10392. "minimum": 0,
  10393. "maximum": 9007199254740991
  10394. },
  10395. "deletions": {
  10396. "type": "integer",
  10397. "minimum": 0,
  10398. "maximum": 9007199254740991
  10399. },
  10400. "files": {
  10401. "type": "integer",
  10402. "minimum": 0,
  10403. "maximum": 9007199254740991
  10404. },
  10405. "diffs": {
  10406. "type": "array",
  10407. "items": {
  10408. "$ref": "#/components/schemas/SnapshotFileDiff"
  10409. }
  10410. }
  10411. },
  10412. "required": ["additions", "deletions", "files"]
  10413. },
  10414. "share": {
  10415. "type": "object",
  10416. "properties": {
  10417. "url": {
  10418. "type": "string"
  10419. }
  10420. },
  10421. "required": ["url"]
  10422. },
  10423. "title": {
  10424. "type": "string"
  10425. },
  10426. "agent": {
  10427. "type": "string"
  10428. },
  10429. "model": {
  10430. "type": "object",
  10431. "properties": {
  10432. "id": {
  10433. "type": "string"
  10434. },
  10435. "providerID": {
  10436. "type": "string"
  10437. },
  10438. "variant": {
  10439. "type": "string"
  10440. }
  10441. },
  10442. "required": ["id", "providerID"]
  10443. },
  10444. "version": {
  10445. "type": "string"
  10446. },
  10447. "time": {
  10448. "type": "object",
  10449. "properties": {
  10450. "created": {
  10451. "type": "integer",
  10452. "minimum": 0,
  10453. "maximum": 9007199254740991
  10454. },
  10455. "updated": {
  10456. "type": "integer",
  10457. "minimum": 0,
  10458. "maximum": 9007199254740991
  10459. },
  10460. "compacting": {
  10461. "type": "integer",
  10462. "minimum": 0,
  10463. "maximum": 9007199254740991
  10464. },
  10465. "archived": {
  10466. "type": "number"
  10467. }
  10468. },
  10469. "required": ["created", "updated"]
  10470. },
  10471. "permission": {
  10472. "$ref": "#/components/schemas/PermissionRuleset"
  10473. },
  10474. "revert": {
  10475. "type": "object",
  10476. "properties": {
  10477. "messageID": {
  10478. "type": "string",
  10479. "pattern": "^msg.*"
  10480. },
  10481. "partID": {
  10482. "type": "string",
  10483. "pattern": "^prt.*"
  10484. },
  10485. "snapshot": {
  10486. "type": "string"
  10487. },
  10488. "diff": {
  10489. "type": "string"
  10490. }
  10491. },
  10492. "required": ["messageID"]
  10493. }
  10494. },
  10495. "required": ["id", "slug", "projectID", "directory", "title", "version", "time"]
  10496. },
  10497. "Event.session.created": {
  10498. "type": "object",
  10499. "properties": {
  10500. "id": {
  10501. "type": "string"
  10502. },
  10503. "type": {
  10504. "type": "string",
  10505. "const": "session.created"
  10506. },
  10507. "properties": {
  10508. "type": "object",
  10509. "properties": {
  10510. "sessionID": {
  10511. "type": "string",
  10512. "pattern": "^ses.*"
  10513. },
  10514. "info": {
  10515. "$ref": "#/components/schemas/Session"
  10516. }
  10517. },
  10518. "required": ["sessionID", "info"]
  10519. }
  10520. },
  10521. "required": ["id", "type", "properties"]
  10522. },
  10523. "Event.session.updated": {
  10524. "type": "object",
  10525. "properties": {
  10526. "id": {
  10527. "type": "string"
  10528. },
  10529. "type": {
  10530. "type": "string",
  10531. "const": "session.updated"
  10532. },
  10533. "properties": {
  10534. "type": "object",
  10535. "properties": {
  10536. "sessionID": {
  10537. "type": "string",
  10538. "pattern": "^ses.*"
  10539. },
  10540. "info": {
  10541. "$ref": "#/components/schemas/Session"
  10542. }
  10543. },
  10544. "required": ["sessionID", "info"]
  10545. }
  10546. },
  10547. "required": ["id", "type", "properties"]
  10548. },
  10549. "Event.session.deleted": {
  10550. "type": "object",
  10551. "properties": {
  10552. "id": {
  10553. "type": "string"
  10554. },
  10555. "type": {
  10556. "type": "string",
  10557. "const": "session.deleted"
  10558. },
  10559. "properties": {
  10560. "type": "object",
  10561. "properties": {
  10562. "sessionID": {
  10563. "type": "string",
  10564. "pattern": "^ses.*"
  10565. },
  10566. "info": {
  10567. "$ref": "#/components/schemas/Session"
  10568. }
  10569. },
  10570. "required": ["sessionID", "info"]
  10571. }
  10572. },
  10573. "required": ["id", "type", "properties"]
  10574. },
  10575. "Event.session.next.agent.switched": {
  10576. "type": "object",
  10577. "properties": {
  10578. "id": {
  10579. "type": "string"
  10580. },
  10581. "type": {
  10582. "type": "string",
  10583. "const": "session.next.agent.switched"
  10584. },
  10585. "properties": {
  10586. "type": "object",
  10587. "properties": {
  10588. "timestamp": {
  10589. "type": "number"
  10590. },
  10591. "sessionID": {
  10592. "type": "string",
  10593. "pattern": "^ses.*"
  10594. },
  10595. "agent": {
  10596. "type": "string"
  10597. }
  10598. },
  10599. "required": ["timestamp", "sessionID", "agent"]
  10600. }
  10601. },
  10602. "required": ["id", "type", "properties"]
  10603. },
  10604. "Event.session.next.model.switched": {
  10605. "type": "object",
  10606. "properties": {
  10607. "id": {
  10608. "type": "string"
  10609. },
  10610. "type": {
  10611. "type": "string",
  10612. "const": "session.next.model.switched"
  10613. },
  10614. "properties": {
  10615. "type": "object",
  10616. "properties": {
  10617. "timestamp": {
  10618. "type": "number"
  10619. },
  10620. "sessionID": {
  10621. "type": "string",
  10622. "pattern": "^ses.*"
  10623. },
  10624. "id": {
  10625. "type": "string"
  10626. },
  10627. "providerID": {
  10628. "type": "string"
  10629. },
  10630. "variant": {
  10631. "type": "string"
  10632. }
  10633. },
  10634. "required": ["timestamp", "sessionID", "id", "providerID"]
  10635. }
  10636. },
  10637. "required": ["id", "type", "properties"]
  10638. },
  10639. "Prompt.Source": {
  10640. "type": "object",
  10641. "properties": {
  10642. "start": {
  10643. "type": "number"
  10644. },
  10645. "end": {
  10646. "type": "number"
  10647. },
  10648. "text": {
  10649. "type": "string"
  10650. }
  10651. },
  10652. "required": ["start", "end", "text"]
  10653. },
  10654. "Prompt.FileAttachment": {
  10655. "type": "object",
  10656. "properties": {
  10657. "uri": {
  10658. "type": "string"
  10659. },
  10660. "mime": {
  10661. "type": "string"
  10662. },
  10663. "name": {
  10664. "type": "string"
  10665. },
  10666. "description": {
  10667. "type": "string"
  10668. },
  10669. "source": {
  10670. "$ref": "#/components/schemas/Prompt.Source"
  10671. }
  10672. },
  10673. "required": ["uri", "mime"]
  10674. },
  10675. "Prompt.AgentAttachment": {
  10676. "type": "object",
  10677. "properties": {
  10678. "name": {
  10679. "type": "string"
  10680. },
  10681. "source": {
  10682. "$ref": "#/components/schemas/Prompt.Source"
  10683. }
  10684. },
  10685. "required": ["name"]
  10686. },
  10687. "Prompt": {
  10688. "type": "object",
  10689. "properties": {
  10690. "text": {
  10691. "type": "string"
  10692. },
  10693. "files": {
  10694. "type": "array",
  10695. "items": {
  10696. "$ref": "#/components/schemas/Prompt.FileAttachment"
  10697. }
  10698. },
  10699. "agents": {
  10700. "type": "array",
  10701. "items": {
  10702. "$ref": "#/components/schemas/Prompt.AgentAttachment"
  10703. }
  10704. }
  10705. },
  10706. "required": ["text"]
  10707. },
  10708. "Event.session.next.prompted": {
  10709. "type": "object",
  10710. "properties": {
  10711. "id": {
  10712. "type": "string"
  10713. },
  10714. "type": {
  10715. "type": "string",
  10716. "const": "session.next.prompted"
  10717. },
  10718. "properties": {
  10719. "type": "object",
  10720. "properties": {
  10721. "timestamp": {
  10722. "type": "number"
  10723. },
  10724. "sessionID": {
  10725. "type": "string",
  10726. "pattern": "^ses.*"
  10727. },
  10728. "prompt": {
  10729. "$ref": "#/components/schemas/Prompt"
  10730. }
  10731. },
  10732. "required": ["timestamp", "sessionID", "prompt"]
  10733. }
  10734. },
  10735. "required": ["id", "type", "properties"]
  10736. },
  10737. "Event.session.next.synthetic": {
  10738. "type": "object",
  10739. "properties": {
  10740. "id": {
  10741. "type": "string"
  10742. },
  10743. "type": {
  10744. "type": "string",
  10745. "const": "session.next.synthetic"
  10746. },
  10747. "properties": {
  10748. "type": "object",
  10749. "properties": {
  10750. "timestamp": {
  10751. "type": "number"
  10752. },
  10753. "sessionID": {
  10754. "type": "string",
  10755. "pattern": "^ses.*"
  10756. },
  10757. "text": {
  10758. "type": "string"
  10759. }
  10760. },
  10761. "required": ["timestamp", "sessionID", "text"]
  10762. }
  10763. },
  10764. "required": ["id", "type", "properties"]
  10765. },
  10766. "Event.session.next.shell.started": {
  10767. "type": "object",
  10768. "properties": {
  10769. "id": {
  10770. "type": "string"
  10771. },
  10772. "type": {
  10773. "type": "string",
  10774. "const": "session.next.shell.started"
  10775. },
  10776. "properties": {
  10777. "type": "object",
  10778. "properties": {
  10779. "timestamp": {
  10780. "type": "number"
  10781. },
  10782. "sessionID": {
  10783. "type": "string",
  10784. "pattern": "^ses.*"
  10785. },
  10786. "callID": {
  10787. "type": "string"
  10788. },
  10789. "command": {
  10790. "type": "string"
  10791. }
  10792. },
  10793. "required": ["timestamp", "sessionID", "callID", "command"]
  10794. }
  10795. },
  10796. "required": ["id", "type", "properties"]
  10797. },
  10798. "Event.session.next.shell.ended": {
  10799. "type": "object",
  10800. "properties": {
  10801. "id": {
  10802. "type": "string"
  10803. },
  10804. "type": {
  10805. "type": "string",
  10806. "const": "session.next.shell.ended"
  10807. },
  10808. "properties": {
  10809. "type": "object",
  10810. "properties": {
  10811. "timestamp": {
  10812. "type": "number"
  10813. },
  10814. "sessionID": {
  10815. "type": "string",
  10816. "pattern": "^ses.*"
  10817. },
  10818. "callID": {
  10819. "type": "string"
  10820. },
  10821. "output": {
  10822. "type": "string"
  10823. }
  10824. },
  10825. "required": ["timestamp", "sessionID", "callID", "output"]
  10826. }
  10827. },
  10828. "required": ["id", "type", "properties"]
  10829. },
  10830. "Event.session.next.step.started": {
  10831. "type": "object",
  10832. "properties": {
  10833. "id": {
  10834. "type": "string"
  10835. },
  10836. "type": {
  10837. "type": "string",
  10838. "const": "session.next.step.started"
  10839. },
  10840. "properties": {
  10841. "type": "object",
  10842. "properties": {
  10843. "timestamp": {
  10844. "type": "number"
  10845. },
  10846. "sessionID": {
  10847. "type": "string",
  10848. "pattern": "^ses.*"
  10849. },
  10850. "agent": {
  10851. "type": "string"
  10852. },
  10853. "model": {
  10854. "type": "object",
  10855. "properties": {
  10856. "id": {
  10857. "type": "string"
  10858. },
  10859. "providerID": {
  10860. "type": "string"
  10861. },
  10862. "variant": {
  10863. "type": "string"
  10864. }
  10865. },
  10866. "required": ["id", "providerID"]
  10867. },
  10868. "snapshot": {
  10869. "type": "string"
  10870. }
  10871. },
  10872. "required": ["timestamp", "sessionID", "agent", "model"]
  10873. }
  10874. },
  10875. "required": ["id", "type", "properties"]
  10876. },
  10877. "Event.session.next.step.ended": {
  10878. "type": "object",
  10879. "properties": {
  10880. "id": {
  10881. "type": "string"
  10882. },
  10883. "type": {
  10884. "type": "string",
  10885. "const": "session.next.step.ended"
  10886. },
  10887. "properties": {
  10888. "type": "object",
  10889. "properties": {
  10890. "timestamp": {
  10891. "type": "number"
  10892. },
  10893. "sessionID": {
  10894. "type": "string",
  10895. "pattern": "^ses.*"
  10896. },
  10897. "finish": {
  10898. "type": "string"
  10899. },
  10900. "cost": {
  10901. "type": "number"
  10902. },
  10903. "tokens": {
  10904. "type": "object",
  10905. "properties": {
  10906. "input": {
  10907. "type": "integer",
  10908. "minimum": 0,
  10909. "maximum": 9007199254740991
  10910. },
  10911. "output": {
  10912. "type": "integer",
  10913. "minimum": 0,
  10914. "maximum": 9007199254740991
  10915. },
  10916. "reasoning": {
  10917. "type": "integer",
  10918. "minimum": 0,
  10919. "maximum": 9007199254740991
  10920. },
  10921. "cache": {
  10922. "type": "object",
  10923. "properties": {
  10924. "read": {
  10925. "type": "integer",
  10926. "minimum": 0,
  10927. "maximum": 9007199254740991
  10928. },
  10929. "write": {
  10930. "type": "integer",
  10931. "minimum": 0,
  10932. "maximum": 9007199254740991
  10933. }
  10934. },
  10935. "required": ["read", "write"]
  10936. }
  10937. },
  10938. "required": ["input", "output", "reasoning", "cache"]
  10939. },
  10940. "snapshot": {
  10941. "type": "string"
  10942. }
  10943. },
  10944. "required": ["timestamp", "sessionID", "finish", "cost", "tokens"]
  10945. }
  10946. },
  10947. "required": ["id", "type", "properties"]
  10948. },
  10949. "Event.session.next.text.started": {
  10950. "type": "object",
  10951. "properties": {
  10952. "id": {
  10953. "type": "string"
  10954. },
  10955. "type": {
  10956. "type": "string",
  10957. "const": "session.next.text.started"
  10958. },
  10959. "properties": {
  10960. "type": "object",
  10961. "properties": {
  10962. "timestamp": {
  10963. "type": "number"
  10964. },
  10965. "sessionID": {
  10966. "type": "string",
  10967. "pattern": "^ses.*"
  10968. }
  10969. },
  10970. "required": ["timestamp", "sessionID"]
  10971. }
  10972. },
  10973. "required": ["id", "type", "properties"]
  10974. },
  10975. "Event.session.next.text.delta": {
  10976. "type": "object",
  10977. "properties": {
  10978. "id": {
  10979. "type": "string"
  10980. },
  10981. "type": {
  10982. "type": "string",
  10983. "const": "session.next.text.delta"
  10984. },
  10985. "properties": {
  10986. "type": "object",
  10987. "properties": {
  10988. "timestamp": {
  10989. "type": "number"
  10990. },
  10991. "sessionID": {
  10992. "type": "string",
  10993. "pattern": "^ses.*"
  10994. },
  10995. "delta": {
  10996. "type": "string"
  10997. }
  10998. },
  10999. "required": ["timestamp", "sessionID", "delta"]
  11000. }
  11001. },
  11002. "required": ["id", "type", "properties"]
  11003. },
  11004. "Event.session.next.text.ended": {
  11005. "type": "object",
  11006. "properties": {
  11007. "id": {
  11008. "type": "string"
  11009. },
  11010. "type": {
  11011. "type": "string",
  11012. "const": "session.next.text.ended"
  11013. },
  11014. "properties": {
  11015. "type": "object",
  11016. "properties": {
  11017. "timestamp": {
  11018. "type": "number"
  11019. },
  11020. "sessionID": {
  11021. "type": "string",
  11022. "pattern": "^ses.*"
  11023. },
  11024. "text": {
  11025. "type": "string"
  11026. }
  11027. },
  11028. "required": ["timestamp", "sessionID", "text"]
  11029. }
  11030. },
  11031. "required": ["id", "type", "properties"]
  11032. },
  11033. "Event.session.next.reasoning.started": {
  11034. "type": "object",
  11035. "properties": {
  11036. "id": {
  11037. "type": "string"
  11038. },
  11039. "type": {
  11040. "type": "string",
  11041. "const": "session.next.reasoning.started"
  11042. },
  11043. "properties": {
  11044. "type": "object",
  11045. "properties": {
  11046. "timestamp": {
  11047. "type": "number"
  11048. },
  11049. "sessionID": {
  11050. "type": "string",
  11051. "pattern": "^ses.*"
  11052. },
  11053. "reasoningID": {
  11054. "type": "string"
  11055. }
  11056. },
  11057. "required": ["timestamp", "sessionID", "reasoningID"]
  11058. }
  11059. },
  11060. "required": ["id", "type", "properties"]
  11061. },
  11062. "Event.session.next.reasoning.delta": {
  11063. "type": "object",
  11064. "properties": {
  11065. "id": {
  11066. "type": "string"
  11067. },
  11068. "type": {
  11069. "type": "string",
  11070. "const": "session.next.reasoning.delta"
  11071. },
  11072. "properties": {
  11073. "type": "object",
  11074. "properties": {
  11075. "timestamp": {
  11076. "type": "number"
  11077. },
  11078. "sessionID": {
  11079. "type": "string",
  11080. "pattern": "^ses.*"
  11081. },
  11082. "reasoningID": {
  11083. "type": "string"
  11084. },
  11085. "delta": {
  11086. "type": "string"
  11087. }
  11088. },
  11089. "required": ["timestamp", "sessionID", "reasoningID", "delta"]
  11090. }
  11091. },
  11092. "required": ["id", "type", "properties"]
  11093. },
  11094. "Event.session.next.reasoning.ended": {
  11095. "type": "object",
  11096. "properties": {
  11097. "id": {
  11098. "type": "string"
  11099. },
  11100. "type": {
  11101. "type": "string",
  11102. "const": "session.next.reasoning.ended"
  11103. },
  11104. "properties": {
  11105. "type": "object",
  11106. "properties": {
  11107. "timestamp": {
  11108. "type": "number"
  11109. },
  11110. "sessionID": {
  11111. "type": "string",
  11112. "pattern": "^ses.*"
  11113. },
  11114. "reasoningID": {
  11115. "type": "string"
  11116. },
  11117. "text": {
  11118. "type": "string"
  11119. }
  11120. },
  11121. "required": ["timestamp", "sessionID", "reasoningID", "text"]
  11122. }
  11123. },
  11124. "required": ["id", "type", "properties"]
  11125. },
  11126. "Event.session.next.tool.input.started": {
  11127. "type": "object",
  11128. "properties": {
  11129. "id": {
  11130. "type": "string"
  11131. },
  11132. "type": {
  11133. "type": "string",
  11134. "const": "session.next.tool.input.started"
  11135. },
  11136. "properties": {
  11137. "type": "object",
  11138. "properties": {
  11139. "timestamp": {
  11140. "type": "number"
  11141. },
  11142. "sessionID": {
  11143. "type": "string",
  11144. "pattern": "^ses.*"
  11145. },
  11146. "callID": {
  11147. "type": "string"
  11148. },
  11149. "name": {
  11150. "type": "string"
  11151. }
  11152. },
  11153. "required": ["timestamp", "sessionID", "callID", "name"]
  11154. }
  11155. },
  11156. "required": ["id", "type", "properties"]
  11157. },
  11158. "Event.session.next.tool.input.delta": {
  11159. "type": "object",
  11160. "properties": {
  11161. "id": {
  11162. "type": "string"
  11163. },
  11164. "type": {
  11165. "type": "string",
  11166. "const": "session.next.tool.input.delta"
  11167. },
  11168. "properties": {
  11169. "type": "object",
  11170. "properties": {
  11171. "timestamp": {
  11172. "type": "number"
  11173. },
  11174. "sessionID": {
  11175. "type": "string",
  11176. "pattern": "^ses.*"
  11177. },
  11178. "callID": {
  11179. "type": "string"
  11180. },
  11181. "delta": {
  11182. "type": "string"
  11183. }
  11184. },
  11185. "required": ["timestamp", "sessionID", "callID", "delta"]
  11186. }
  11187. },
  11188. "required": ["id", "type", "properties"]
  11189. },
  11190. "Event.session.next.tool.input.ended": {
  11191. "type": "object",
  11192. "properties": {
  11193. "id": {
  11194. "type": "string"
  11195. },
  11196. "type": {
  11197. "type": "string",
  11198. "const": "session.next.tool.input.ended"
  11199. },
  11200. "properties": {
  11201. "type": "object",
  11202. "properties": {
  11203. "timestamp": {
  11204. "type": "number"
  11205. },
  11206. "sessionID": {
  11207. "type": "string",
  11208. "pattern": "^ses.*"
  11209. },
  11210. "callID": {
  11211. "type": "string"
  11212. },
  11213. "text": {
  11214. "type": "string"
  11215. }
  11216. },
  11217. "required": ["timestamp", "sessionID", "callID", "text"]
  11218. }
  11219. },
  11220. "required": ["id", "type", "properties"]
  11221. },
  11222. "Event.session.next.tool.called": {
  11223. "type": "object",
  11224. "properties": {
  11225. "id": {
  11226. "type": "string"
  11227. },
  11228. "type": {
  11229. "type": "string",
  11230. "const": "session.next.tool.called"
  11231. },
  11232. "properties": {
  11233. "type": "object",
  11234. "properties": {
  11235. "timestamp": {
  11236. "type": "number"
  11237. },
  11238. "sessionID": {
  11239. "type": "string",
  11240. "pattern": "^ses.*"
  11241. },
  11242. "callID": {
  11243. "type": "string"
  11244. },
  11245. "tool": {
  11246. "type": "string"
  11247. },
  11248. "input": {
  11249. "type": "object",
  11250. "propertyNames": {
  11251. "type": "string"
  11252. },
  11253. "additionalProperties": {}
  11254. },
  11255. "provider": {
  11256. "type": "object",
  11257. "properties": {
  11258. "executed": {
  11259. "type": "boolean"
  11260. },
  11261. "metadata": {
  11262. "type": "object",
  11263. "propertyNames": {
  11264. "type": "string"
  11265. },
  11266. "additionalProperties": {}
  11267. }
  11268. },
  11269. "required": ["executed"]
  11270. }
  11271. },
  11272. "required": ["timestamp", "sessionID", "callID", "tool", "input", "provider"]
  11273. }
  11274. },
  11275. "required": ["id", "type", "properties"]
  11276. },
  11277. "Tool.TextContent": {
  11278. "type": "object",
  11279. "properties": {
  11280. "type": {
  11281. "type": "string",
  11282. "const": "text"
  11283. },
  11284. "text": {
  11285. "type": "string"
  11286. }
  11287. },
  11288. "required": ["type", "text"]
  11289. },
  11290. "Tool.FileContent": {
  11291. "type": "object",
  11292. "properties": {
  11293. "type": {
  11294. "type": "string",
  11295. "const": "file"
  11296. },
  11297. "uri": {
  11298. "type": "string"
  11299. },
  11300. "mime": {
  11301. "type": "string"
  11302. },
  11303. "name": {
  11304. "type": "string"
  11305. }
  11306. },
  11307. "required": ["type", "uri", "mime"]
  11308. },
  11309. "Event.session.next.tool.progress": {
  11310. "type": "object",
  11311. "properties": {
  11312. "id": {
  11313. "type": "string"
  11314. },
  11315. "type": {
  11316. "type": "string",
  11317. "const": "session.next.tool.progress"
  11318. },
  11319. "properties": {
  11320. "type": "object",
  11321. "properties": {
  11322. "timestamp": {
  11323. "type": "number"
  11324. },
  11325. "sessionID": {
  11326. "type": "string",
  11327. "pattern": "^ses.*"
  11328. },
  11329. "callID": {
  11330. "type": "string"
  11331. },
  11332. "structured": {
  11333. "type": "object",
  11334. "propertyNames": {
  11335. "type": "string"
  11336. },
  11337. "additionalProperties": {}
  11338. },
  11339. "content": {
  11340. "type": "array",
  11341. "items": {
  11342. "anyOf": [
  11343. {
  11344. "$ref": "#/components/schemas/Tool.TextContent"
  11345. },
  11346. {
  11347. "$ref": "#/components/schemas/Tool.FileContent"
  11348. }
  11349. ]
  11350. }
  11351. }
  11352. },
  11353. "required": ["timestamp", "sessionID", "callID", "structured", "content"]
  11354. }
  11355. },
  11356. "required": ["id", "type", "properties"]
  11357. },
  11358. "Event.session.next.tool.success": {
  11359. "type": "object",
  11360. "properties": {
  11361. "id": {
  11362. "type": "string"
  11363. },
  11364. "type": {
  11365. "type": "string",
  11366. "const": "session.next.tool.success"
  11367. },
  11368. "properties": {
  11369. "type": "object",
  11370. "properties": {
  11371. "timestamp": {
  11372. "type": "number"
  11373. },
  11374. "sessionID": {
  11375. "type": "string",
  11376. "pattern": "^ses.*"
  11377. },
  11378. "callID": {
  11379. "type": "string"
  11380. },
  11381. "structured": {
  11382. "type": "object",
  11383. "propertyNames": {
  11384. "type": "string"
  11385. },
  11386. "additionalProperties": {}
  11387. },
  11388. "content": {
  11389. "type": "array",
  11390. "items": {
  11391. "anyOf": [
  11392. {
  11393. "$ref": "#/components/schemas/Tool.TextContent"
  11394. },
  11395. {
  11396. "$ref": "#/components/schemas/Tool.FileContent"
  11397. }
  11398. ]
  11399. }
  11400. },
  11401. "provider": {
  11402. "type": "object",
  11403. "properties": {
  11404. "executed": {
  11405. "type": "boolean"
  11406. },
  11407. "metadata": {
  11408. "type": "object",
  11409. "propertyNames": {
  11410. "type": "string"
  11411. },
  11412. "additionalProperties": {}
  11413. }
  11414. },
  11415. "required": ["executed"]
  11416. }
  11417. },
  11418. "required": ["timestamp", "sessionID", "callID", "structured", "content", "provider"]
  11419. }
  11420. },
  11421. "required": ["id", "type", "properties"]
  11422. },
  11423. "Event.session.next.tool.error": {
  11424. "type": "object",
  11425. "properties": {
  11426. "id": {
  11427. "type": "string"
  11428. },
  11429. "type": {
  11430. "type": "string",
  11431. "const": "session.next.tool.error"
  11432. },
  11433. "properties": {
  11434. "type": "object",
  11435. "properties": {
  11436. "timestamp": {
  11437. "type": "number"
  11438. },
  11439. "sessionID": {
  11440. "type": "string",
  11441. "pattern": "^ses.*"
  11442. },
  11443. "callID": {
  11444. "type": "string"
  11445. },
  11446. "error": {
  11447. "type": "object",
  11448. "properties": {
  11449. "type": {
  11450. "type": "string"
  11451. },
  11452. "message": {
  11453. "type": "string"
  11454. }
  11455. },
  11456. "required": ["type", "message"]
  11457. },
  11458. "provider": {
  11459. "type": "object",
  11460. "properties": {
  11461. "executed": {
  11462. "type": "boolean"
  11463. },
  11464. "metadata": {
  11465. "type": "object",
  11466. "propertyNames": {
  11467. "type": "string"
  11468. },
  11469. "additionalProperties": {}
  11470. }
  11471. },
  11472. "required": ["executed"]
  11473. }
  11474. },
  11475. "required": ["timestamp", "sessionID", "callID", "error", "provider"]
  11476. }
  11477. },
  11478. "required": ["id", "type", "properties"]
  11479. },
  11480. "session.next.retry_error": {
  11481. "type": "object",
  11482. "properties": {
  11483. "message": {
  11484. "type": "string"
  11485. },
  11486. "statusCode": {
  11487. "type": "integer",
  11488. "minimum": 0,
  11489. "maximum": 9007199254740991
  11490. },
  11491. "isRetryable": {
  11492. "type": "boolean"
  11493. },
  11494. "responseHeaders": {
  11495. "type": "object",
  11496. "propertyNames": {
  11497. "type": "string"
  11498. },
  11499. "additionalProperties": {
  11500. "type": "string"
  11501. }
  11502. },
  11503. "responseBody": {
  11504. "type": "string"
  11505. },
  11506. "metadata": {
  11507. "type": "object",
  11508. "propertyNames": {
  11509. "type": "string"
  11510. },
  11511. "additionalProperties": {
  11512. "type": "string"
  11513. }
  11514. }
  11515. },
  11516. "required": ["message", "isRetryable"]
  11517. },
  11518. "Event.session.next.retried": {
  11519. "type": "object",
  11520. "properties": {
  11521. "id": {
  11522. "type": "string"
  11523. },
  11524. "type": {
  11525. "type": "string",
  11526. "const": "session.next.retried"
  11527. },
  11528. "properties": {
  11529. "type": "object",
  11530. "properties": {
  11531. "timestamp": {
  11532. "type": "number"
  11533. },
  11534. "sessionID": {
  11535. "type": "string",
  11536. "pattern": "^ses.*"
  11537. },
  11538. "attempt": {
  11539. "type": "integer",
  11540. "minimum": 0,
  11541. "maximum": 9007199254740991
  11542. },
  11543. "error": {
  11544. "$ref": "#/components/schemas/session.next.retry_error"
  11545. }
  11546. },
  11547. "required": ["timestamp", "sessionID", "attempt", "error"]
  11548. }
  11549. },
  11550. "required": ["id", "type", "properties"]
  11551. },
  11552. "Event.session.next.compaction.started": {
  11553. "type": "object",
  11554. "properties": {
  11555. "id": {
  11556. "type": "string"
  11557. },
  11558. "type": {
  11559. "type": "string",
  11560. "const": "session.next.compaction.started"
  11561. },
  11562. "properties": {
  11563. "type": "object",
  11564. "properties": {
  11565. "timestamp": {
  11566. "type": "number"
  11567. },
  11568. "sessionID": {
  11569. "type": "string",
  11570. "pattern": "^ses.*"
  11571. },
  11572. "reason": {
  11573. "type": "string",
  11574. "enum": ["auto", "manual"]
  11575. }
  11576. },
  11577. "required": ["timestamp", "sessionID", "reason"]
  11578. }
  11579. },
  11580. "required": ["id", "type", "properties"]
  11581. },
  11582. "Event.session.next.compaction.delta": {
  11583. "type": "object",
  11584. "properties": {
  11585. "id": {
  11586. "type": "string"
  11587. },
  11588. "type": {
  11589. "type": "string",
  11590. "const": "session.next.compaction.delta"
  11591. },
  11592. "properties": {
  11593. "type": "object",
  11594. "properties": {
  11595. "timestamp": {
  11596. "type": "number"
  11597. },
  11598. "sessionID": {
  11599. "type": "string",
  11600. "pattern": "^ses.*"
  11601. },
  11602. "text": {
  11603. "type": "string"
  11604. }
  11605. },
  11606. "required": ["timestamp", "sessionID", "text"]
  11607. }
  11608. },
  11609. "required": ["id", "type", "properties"]
  11610. },
  11611. "Event.session.next.compaction.ended": {
  11612. "type": "object",
  11613. "properties": {
  11614. "id": {
  11615. "type": "string"
  11616. },
  11617. "type": {
  11618. "type": "string",
  11619. "const": "session.next.compaction.ended"
  11620. },
  11621. "properties": {
  11622. "type": "object",
  11623. "properties": {
  11624. "timestamp": {
  11625. "type": "number"
  11626. },
  11627. "sessionID": {
  11628. "type": "string",
  11629. "pattern": "^ses.*"
  11630. },
  11631. "text": {
  11632. "type": "string"
  11633. },
  11634. "include": {
  11635. "type": "string"
  11636. }
  11637. },
  11638. "required": ["timestamp", "sessionID", "text"]
  11639. }
  11640. },
  11641. "required": ["id", "type", "properties"]
  11642. },
  11643. "Event.server.connected": {
  11644. "type": "object",
  11645. "properties": {
  11646. "id": {
  11647. "type": "string"
  11648. },
  11649. "type": {
  11650. "type": "string",
  11651. "const": "server.connected"
  11652. },
  11653. "properties": {
  11654. "type": "object",
  11655. "properties": {}
  11656. }
  11657. },
  11658. "required": ["id", "type", "properties"]
  11659. },
  11660. "Event.global.disposed": {
  11661. "type": "object",
  11662. "properties": {
  11663. "id": {
  11664. "type": "string"
  11665. },
  11666. "type": {
  11667. "type": "string",
  11668. "const": "global.disposed"
  11669. },
  11670. "properties": {
  11671. "type": "object",
  11672. "properties": {}
  11673. }
  11674. },
  11675. "required": ["id", "type", "properties"]
  11676. },
  11677. "SyncEvent.message.updated": {
  11678. "type": "object",
  11679. "properties": {
  11680. "type": {
  11681. "type": "string",
  11682. "const": "sync"
  11683. },
  11684. "name": {
  11685. "type": "string",
  11686. "const": "message.updated.1"
  11687. },
  11688. "id": {
  11689. "type": "string"
  11690. },
  11691. "seq": {
  11692. "type": "number"
  11693. },
  11694. "aggregateID": {
  11695. "type": "string",
  11696. "const": "sessionID"
  11697. },
  11698. "data": {
  11699. "type": "object",
  11700. "properties": {
  11701. "sessionID": {
  11702. "type": "string",
  11703. "pattern": "^ses.*"
  11704. },
  11705. "info": {
  11706. "$ref": "#/components/schemas/Message"
  11707. }
  11708. },
  11709. "required": ["sessionID", "info"]
  11710. }
  11711. },
  11712. "required": ["type", "name", "id", "seq", "aggregateID", "data"]
  11713. },
  11714. "SyncEvent.message.removed": {
  11715. "type": "object",
  11716. "properties": {
  11717. "type": {
  11718. "type": "string",
  11719. "const": "sync"
  11720. },
  11721. "name": {
  11722. "type": "string",
  11723. "const": "message.removed.1"
  11724. },
  11725. "id": {
  11726. "type": "string"
  11727. },
  11728. "seq": {
  11729. "type": "number"
  11730. },
  11731. "aggregateID": {
  11732. "type": "string",
  11733. "const": "sessionID"
  11734. },
  11735. "data": {
  11736. "type": "object",
  11737. "properties": {
  11738. "sessionID": {
  11739. "type": "string",
  11740. "pattern": "^ses.*"
  11741. },
  11742. "messageID": {
  11743. "type": "string",
  11744. "pattern": "^msg.*"
  11745. }
  11746. },
  11747. "required": ["sessionID", "messageID"]
  11748. }
  11749. },
  11750. "required": ["type", "name", "id", "seq", "aggregateID", "data"]
  11751. },
  11752. "SyncEvent.message.part.updated": {
  11753. "type": "object",
  11754. "properties": {
  11755. "type": {
  11756. "type": "string",
  11757. "const": "sync"
  11758. },
  11759. "name": {
  11760. "type": "string",
  11761. "const": "message.part.updated.1"
  11762. },
  11763. "id": {
  11764. "type": "string"
  11765. },
  11766. "seq": {
  11767. "type": "number"
  11768. },
  11769. "aggregateID": {
  11770. "type": "string",
  11771. "const": "sessionID"
  11772. },
  11773. "data": {
  11774. "type": "object",
  11775. "properties": {
  11776. "sessionID": {
  11777. "type": "string",
  11778. "pattern": "^ses.*"
  11779. },
  11780. "part": {
  11781. "$ref": "#/components/schemas/Part"
  11782. },
  11783. "time": {
  11784. "type": "integer",
  11785. "minimum": 0,
  11786. "maximum": 9007199254740991
  11787. }
  11788. },
  11789. "required": ["sessionID", "part", "time"]
  11790. }
  11791. },
  11792. "required": ["type", "name", "id", "seq", "aggregateID", "data"]
  11793. },
  11794. "SyncEvent.message.part.removed": {
  11795. "type": "object",
  11796. "properties": {
  11797. "type": {
  11798. "type": "string",
  11799. "const": "sync"
  11800. },
  11801. "name": {
  11802. "type": "string",
  11803. "const": "message.part.removed.1"
  11804. },
  11805. "id": {
  11806. "type": "string"
  11807. },
  11808. "seq": {
  11809. "type": "number"
  11810. },
  11811. "aggregateID": {
  11812. "type": "string",
  11813. "const": "sessionID"
  11814. },
  11815. "data": {
  11816. "type": "object",
  11817. "properties": {
  11818. "sessionID": {
  11819. "type": "string",
  11820. "pattern": "^ses.*"
  11821. },
  11822. "messageID": {
  11823. "type": "string",
  11824. "pattern": "^msg.*"
  11825. },
  11826. "partID": {
  11827. "type": "string",
  11828. "pattern": "^prt.*"
  11829. }
  11830. },
  11831. "required": ["sessionID", "messageID", "partID"]
  11832. }
  11833. },
  11834. "required": ["type", "name", "id", "seq", "aggregateID", "data"]
  11835. },
  11836. "SyncEvent.session.created": {
  11837. "type": "object",
  11838. "properties": {
  11839. "type": {
  11840. "type": "string",
  11841. "const": "sync"
  11842. },
  11843. "name": {
  11844. "type": "string",
  11845. "const": "session.created.1"
  11846. },
  11847. "id": {
  11848. "type": "string"
  11849. },
  11850. "seq": {
  11851. "type": "number"
  11852. },
  11853. "aggregateID": {
  11854. "type": "string",
  11855. "const": "sessionID"
  11856. },
  11857. "data": {
  11858. "type": "object",
  11859. "properties": {
  11860. "sessionID": {
  11861. "type": "string",
  11862. "pattern": "^ses.*"
  11863. },
  11864. "info": {
  11865. "$ref": "#/components/schemas/Session"
  11866. }
  11867. },
  11868. "required": ["sessionID", "info"]
  11869. }
  11870. },
  11871. "required": ["type", "name", "id", "seq", "aggregateID", "data"]
  11872. },
  11873. "SyncEvent.session.updated": {
  11874. "type": "object",
  11875. "properties": {
  11876. "type": {
  11877. "type": "string",
  11878. "const": "sync"
  11879. },
  11880. "name": {
  11881. "type": "string",
  11882. "const": "session.updated.1"
  11883. },
  11884. "id": {
  11885. "type": "string"
  11886. },
  11887. "seq": {
  11888. "type": "number"
  11889. },
  11890. "aggregateID": {
  11891. "type": "string",
  11892. "const": "sessionID"
  11893. },
  11894. "data": {
  11895. "type": "object",
  11896. "properties": {
  11897. "sessionID": {
  11898. "type": "string",
  11899. "pattern": "^ses.*"
  11900. },
  11901. "info": {
  11902. "type": "object",
  11903. "properties": {
  11904. "id": {
  11905. "anyOf": [
  11906. {
  11907. "type": "string",
  11908. "pattern": "^ses.*"
  11909. },
  11910. {
  11911. "type": "null"
  11912. }
  11913. ]
  11914. },
  11915. "slug": {
  11916. "anyOf": [
  11917. {
  11918. "type": "string"
  11919. },
  11920. {
  11921. "type": "null"
  11922. }
  11923. ]
  11924. },
  11925. "projectID": {
  11926. "anyOf": [
  11927. {
  11928. "type": "string"
  11929. },
  11930. {
  11931. "type": "null"
  11932. }
  11933. ]
  11934. },
  11935. "workspaceID": {
  11936. "anyOf": [
  11937. {
  11938. "type": "string",
  11939. "pattern": "^wrk.*"
  11940. },
  11941. {
  11942. "type": "null"
  11943. }
  11944. ]
  11945. },
  11946. "directory": {
  11947. "anyOf": [
  11948. {
  11949. "type": "string"
  11950. },
  11951. {
  11952. "type": "null"
  11953. }
  11954. ]
  11955. },
  11956. "path": {
  11957. "anyOf": [
  11958. {
  11959. "type": "string"
  11960. },
  11961. {
  11962. "type": "null"
  11963. }
  11964. ]
  11965. },
  11966. "parentID": {
  11967. "anyOf": [
  11968. {
  11969. "type": "string",
  11970. "pattern": "^ses.*"
  11971. },
  11972. {
  11973. "type": "null"
  11974. }
  11975. ]
  11976. },
  11977. "summary": {
  11978. "anyOf": [
  11979. {
  11980. "type": "object",
  11981. "properties": {
  11982. "additions": {
  11983. "type": "integer",
  11984. "minimum": 0,
  11985. "maximum": 9007199254740991
  11986. },
  11987. "deletions": {
  11988. "type": "integer",
  11989. "minimum": 0,
  11990. "maximum": 9007199254740991
  11991. },
  11992. "files": {
  11993. "type": "integer",
  11994. "minimum": 0,
  11995. "maximum": 9007199254740991
  11996. },
  11997. "diffs": {
  11998. "type": "array",
  11999. "items": {
  12000. "$ref": "#/components/schemas/SnapshotFileDiff"
  12001. }
  12002. }
  12003. },
  12004. "required": ["additions", "deletions", "files"]
  12005. },
  12006. {
  12007. "type": "null"
  12008. }
  12009. ]
  12010. },
  12011. "share": {
  12012. "type": "object",
  12013. "properties": {
  12014. "url": {
  12015. "anyOf": [
  12016. {
  12017. "type": "string"
  12018. },
  12019. {
  12020. "type": "null"
  12021. }
  12022. ]
  12023. }
  12024. }
  12025. },
  12026. "title": {
  12027. "anyOf": [
  12028. {
  12029. "type": "string"
  12030. },
  12031. {
  12032. "type": "null"
  12033. }
  12034. ]
  12035. },
  12036. "agent": {
  12037. "anyOf": [
  12038. {
  12039. "type": "string"
  12040. },
  12041. {
  12042. "type": "null"
  12043. }
  12044. ]
  12045. },
  12046. "model": {
  12047. "anyOf": [
  12048. {
  12049. "type": "object",
  12050. "properties": {
  12051. "id": {
  12052. "type": "string"
  12053. },
  12054. "providerID": {
  12055. "type": "string"
  12056. },
  12057. "variant": {
  12058. "type": "string"
  12059. }
  12060. },
  12061. "required": ["id", "providerID"]
  12062. },
  12063. {
  12064. "type": "null"
  12065. }
  12066. ]
  12067. },
  12068. "version": {
  12069. "anyOf": [
  12070. {
  12071. "type": "string"
  12072. },
  12073. {
  12074. "type": "null"
  12075. }
  12076. ]
  12077. },
  12078. "time": {
  12079. "type": "object",
  12080. "properties": {
  12081. "created": {
  12082. "anyOf": [
  12083. {
  12084. "type": "integer",
  12085. "minimum": 0,
  12086. "maximum": 9007199254740991
  12087. },
  12088. {
  12089. "type": "null"
  12090. }
  12091. ]
  12092. },
  12093. "updated": {
  12094. "anyOf": [
  12095. {
  12096. "type": "integer",
  12097. "minimum": 0,
  12098. "maximum": 9007199254740991
  12099. },
  12100. {
  12101. "type": "null"
  12102. }
  12103. ]
  12104. },
  12105. "compacting": {
  12106. "anyOf": [
  12107. {
  12108. "type": "integer",
  12109. "minimum": 0,
  12110. "maximum": 9007199254740991
  12111. },
  12112. {
  12113. "type": "null"
  12114. }
  12115. ]
  12116. },
  12117. "archived": {
  12118. "anyOf": [
  12119. {
  12120. "type": "number"
  12121. },
  12122. {
  12123. "type": "null"
  12124. }
  12125. ]
  12126. }
  12127. }
  12128. },
  12129. "permission": {
  12130. "anyOf": [
  12131. {
  12132. "$ref": "#/components/schemas/PermissionRuleset"
  12133. },
  12134. {
  12135. "type": "null"
  12136. }
  12137. ]
  12138. },
  12139. "revert": {
  12140. "anyOf": [
  12141. {
  12142. "type": "object",
  12143. "properties": {
  12144. "messageID": {
  12145. "type": "string",
  12146. "pattern": "^msg.*"
  12147. },
  12148. "partID": {
  12149. "type": "string",
  12150. "pattern": "^prt.*"
  12151. },
  12152. "snapshot": {
  12153. "type": "string"
  12154. },
  12155. "diff": {
  12156. "type": "string"
  12157. }
  12158. },
  12159. "required": ["messageID"]
  12160. },
  12161. {
  12162. "type": "null"
  12163. }
  12164. ]
  12165. }
  12166. }
  12167. }
  12168. },
  12169. "required": ["sessionID", "info"]
  12170. }
  12171. },
  12172. "required": ["type", "name", "id", "seq", "aggregateID", "data"]
  12173. },
  12174. "SyncEvent.session.deleted": {
  12175. "type": "object",
  12176. "properties": {
  12177. "type": {
  12178. "type": "string",
  12179. "const": "sync"
  12180. },
  12181. "name": {
  12182. "type": "string",
  12183. "const": "session.deleted.1"
  12184. },
  12185. "id": {
  12186. "type": "string"
  12187. },
  12188. "seq": {
  12189. "type": "number"
  12190. },
  12191. "aggregateID": {
  12192. "type": "string",
  12193. "const": "sessionID"
  12194. },
  12195. "data": {
  12196. "type": "object",
  12197. "properties": {
  12198. "sessionID": {
  12199. "type": "string",
  12200. "pattern": "^ses.*"
  12201. },
  12202. "info": {
  12203. "$ref": "#/components/schemas/Session"
  12204. }
  12205. },
  12206. "required": ["sessionID", "info"]
  12207. }
  12208. },
  12209. "required": ["type", "name", "id", "seq", "aggregateID", "data"]
  12210. },
  12211. "SyncEvent.session.next.agent.switched": {
  12212. "type": "object",
  12213. "properties": {
  12214. "type": {
  12215. "type": "string",
  12216. "const": "sync"
  12217. },
  12218. "name": {
  12219. "type": "string",
  12220. "const": "session.next.agent.switched.1"
  12221. },
  12222. "id": {
  12223. "type": "string"
  12224. },
  12225. "seq": {
  12226. "type": "number"
  12227. },
  12228. "aggregateID": {
  12229. "type": "string",
  12230. "const": "sessionID"
  12231. },
  12232. "data": {
  12233. "type": "object",
  12234. "properties": {
  12235. "timestamp": {
  12236. "type": "number"
  12237. },
  12238. "sessionID": {
  12239. "type": "string",
  12240. "pattern": "^ses.*"
  12241. },
  12242. "agent": {
  12243. "type": "string"
  12244. }
  12245. },
  12246. "required": ["timestamp", "sessionID", "agent"]
  12247. }
  12248. },
  12249. "required": ["type", "name", "id", "seq", "aggregateID", "data"]
  12250. },
  12251. "SyncEvent.session.next.model.switched": {
  12252. "type": "object",
  12253. "properties": {
  12254. "type": {
  12255. "type": "string",
  12256. "const": "sync"
  12257. },
  12258. "name": {
  12259. "type": "string",
  12260. "const": "session.next.model.switched.1"
  12261. },
  12262. "id": {
  12263. "type": "string"
  12264. },
  12265. "seq": {
  12266. "type": "number"
  12267. },
  12268. "aggregateID": {
  12269. "type": "string",
  12270. "const": "sessionID"
  12271. },
  12272. "data": {
  12273. "type": "object",
  12274. "properties": {
  12275. "timestamp": {
  12276. "type": "number"
  12277. },
  12278. "sessionID": {
  12279. "type": "string",
  12280. "pattern": "^ses.*"
  12281. },
  12282. "id": {
  12283. "type": "string"
  12284. },
  12285. "providerID": {
  12286. "type": "string"
  12287. },
  12288. "variant": {
  12289. "type": "string"
  12290. }
  12291. },
  12292. "required": ["timestamp", "sessionID", "id", "providerID"]
  12293. }
  12294. },
  12295. "required": ["type", "name", "id", "seq", "aggregateID", "data"]
  12296. },
  12297. "SyncEvent.session.next.prompted": {
  12298. "type": "object",
  12299. "properties": {
  12300. "type": {
  12301. "type": "string",
  12302. "const": "sync"
  12303. },
  12304. "name": {
  12305. "type": "string",
  12306. "const": "session.next.prompted.1"
  12307. },
  12308. "id": {
  12309. "type": "string"
  12310. },
  12311. "seq": {
  12312. "type": "number"
  12313. },
  12314. "aggregateID": {
  12315. "type": "string",
  12316. "const": "sessionID"
  12317. },
  12318. "data": {
  12319. "type": "object",
  12320. "properties": {
  12321. "timestamp": {
  12322. "type": "number"
  12323. },
  12324. "sessionID": {
  12325. "type": "string",
  12326. "pattern": "^ses.*"
  12327. },
  12328. "prompt": {
  12329. "$ref": "#/components/schemas/Prompt"
  12330. }
  12331. },
  12332. "required": ["timestamp", "sessionID", "prompt"]
  12333. }
  12334. },
  12335. "required": ["type", "name", "id", "seq", "aggregateID", "data"]
  12336. },
  12337. "SyncEvent.session.next.synthetic": {
  12338. "type": "object",
  12339. "properties": {
  12340. "type": {
  12341. "type": "string",
  12342. "const": "sync"
  12343. },
  12344. "name": {
  12345. "type": "string",
  12346. "const": "session.next.synthetic.1"
  12347. },
  12348. "id": {
  12349. "type": "string"
  12350. },
  12351. "seq": {
  12352. "type": "number"
  12353. },
  12354. "aggregateID": {
  12355. "type": "string",
  12356. "const": "sessionID"
  12357. },
  12358. "data": {
  12359. "type": "object",
  12360. "properties": {
  12361. "timestamp": {
  12362. "type": "number"
  12363. },
  12364. "sessionID": {
  12365. "type": "string",
  12366. "pattern": "^ses.*"
  12367. },
  12368. "text": {
  12369. "type": "string"
  12370. }
  12371. },
  12372. "required": ["timestamp", "sessionID", "text"]
  12373. }
  12374. },
  12375. "required": ["type", "name", "id", "seq", "aggregateID", "data"]
  12376. },
  12377. "SyncEvent.session.next.shell.started": {
  12378. "type": "object",
  12379. "properties": {
  12380. "type": {
  12381. "type": "string",
  12382. "const": "sync"
  12383. },
  12384. "name": {
  12385. "type": "string",
  12386. "const": "session.next.shell.started.1"
  12387. },
  12388. "id": {
  12389. "type": "string"
  12390. },
  12391. "seq": {
  12392. "type": "number"
  12393. },
  12394. "aggregateID": {
  12395. "type": "string",
  12396. "const": "sessionID"
  12397. },
  12398. "data": {
  12399. "type": "object",
  12400. "properties": {
  12401. "timestamp": {
  12402. "type": "number"
  12403. },
  12404. "sessionID": {
  12405. "type": "string",
  12406. "pattern": "^ses.*"
  12407. },
  12408. "callID": {
  12409. "type": "string"
  12410. },
  12411. "command": {
  12412. "type": "string"
  12413. }
  12414. },
  12415. "required": ["timestamp", "sessionID", "callID", "command"]
  12416. }
  12417. },
  12418. "required": ["type", "name", "id", "seq", "aggregateID", "data"]
  12419. },
  12420. "SyncEvent.session.next.shell.ended": {
  12421. "type": "object",
  12422. "properties": {
  12423. "type": {
  12424. "type": "string",
  12425. "const": "sync"
  12426. },
  12427. "name": {
  12428. "type": "string",
  12429. "const": "session.next.shell.ended.1"
  12430. },
  12431. "id": {
  12432. "type": "string"
  12433. },
  12434. "seq": {
  12435. "type": "number"
  12436. },
  12437. "aggregateID": {
  12438. "type": "string",
  12439. "const": "sessionID"
  12440. },
  12441. "data": {
  12442. "type": "object",
  12443. "properties": {
  12444. "timestamp": {
  12445. "type": "number"
  12446. },
  12447. "sessionID": {
  12448. "type": "string",
  12449. "pattern": "^ses.*"
  12450. },
  12451. "callID": {
  12452. "type": "string"
  12453. },
  12454. "output": {
  12455. "type": "string"
  12456. }
  12457. },
  12458. "required": ["timestamp", "sessionID", "callID", "output"]
  12459. }
  12460. },
  12461. "required": ["type", "name", "id", "seq", "aggregateID", "data"]
  12462. },
  12463. "SyncEvent.session.next.step.started": {
  12464. "type": "object",
  12465. "properties": {
  12466. "type": {
  12467. "type": "string",
  12468. "const": "sync"
  12469. },
  12470. "name": {
  12471. "type": "string",
  12472. "const": "session.next.step.started.1"
  12473. },
  12474. "id": {
  12475. "type": "string"
  12476. },
  12477. "seq": {
  12478. "type": "number"
  12479. },
  12480. "aggregateID": {
  12481. "type": "string",
  12482. "const": "sessionID"
  12483. },
  12484. "data": {
  12485. "type": "object",
  12486. "properties": {
  12487. "timestamp": {
  12488. "type": "number"
  12489. },
  12490. "sessionID": {
  12491. "type": "string",
  12492. "pattern": "^ses.*"
  12493. },
  12494. "agent": {
  12495. "type": "string"
  12496. },
  12497. "model": {
  12498. "type": "object",
  12499. "properties": {
  12500. "id": {
  12501. "type": "string"
  12502. },
  12503. "providerID": {
  12504. "type": "string"
  12505. },
  12506. "variant": {
  12507. "type": "string"
  12508. }
  12509. },
  12510. "required": ["id", "providerID"]
  12511. },
  12512. "snapshot": {
  12513. "type": "string"
  12514. }
  12515. },
  12516. "required": ["timestamp", "sessionID", "agent", "model"]
  12517. }
  12518. },
  12519. "required": ["type", "name", "id", "seq", "aggregateID", "data"]
  12520. },
  12521. "SyncEvent.session.next.step.ended": {
  12522. "type": "object",
  12523. "properties": {
  12524. "type": {
  12525. "type": "string",
  12526. "const": "sync"
  12527. },
  12528. "name": {
  12529. "type": "string",
  12530. "const": "session.next.step.ended.1"
  12531. },
  12532. "id": {
  12533. "type": "string"
  12534. },
  12535. "seq": {
  12536. "type": "number"
  12537. },
  12538. "aggregateID": {
  12539. "type": "string",
  12540. "const": "sessionID"
  12541. },
  12542. "data": {
  12543. "type": "object",
  12544. "properties": {
  12545. "timestamp": {
  12546. "type": "number"
  12547. },
  12548. "sessionID": {
  12549. "type": "string",
  12550. "pattern": "^ses.*"
  12551. },
  12552. "finish": {
  12553. "type": "string"
  12554. },
  12555. "cost": {
  12556. "type": "number"
  12557. },
  12558. "tokens": {
  12559. "type": "object",
  12560. "properties": {
  12561. "input": {
  12562. "type": "integer",
  12563. "minimum": 0,
  12564. "maximum": 9007199254740991
  12565. },
  12566. "output": {
  12567. "type": "integer",
  12568. "minimum": 0,
  12569. "maximum": 9007199254740991
  12570. },
  12571. "reasoning": {
  12572. "type": "integer",
  12573. "minimum": 0,
  12574. "maximum": 9007199254740991
  12575. },
  12576. "cache": {
  12577. "type": "object",
  12578. "properties": {
  12579. "read": {
  12580. "type": "integer",
  12581. "minimum": 0,
  12582. "maximum": 9007199254740991
  12583. },
  12584. "write": {
  12585. "type": "integer",
  12586. "minimum": 0,
  12587. "maximum": 9007199254740991
  12588. }
  12589. },
  12590. "required": ["read", "write"]
  12591. }
  12592. },
  12593. "required": ["input", "output", "reasoning", "cache"]
  12594. },
  12595. "snapshot": {
  12596. "type": "string"
  12597. }
  12598. },
  12599. "required": ["timestamp", "sessionID", "finish", "cost", "tokens"]
  12600. }
  12601. },
  12602. "required": ["type", "name", "id", "seq", "aggregateID", "data"]
  12603. },
  12604. "SyncEvent.session.next.text.started": {
  12605. "type": "object",
  12606. "properties": {
  12607. "type": {
  12608. "type": "string",
  12609. "const": "sync"
  12610. },
  12611. "name": {
  12612. "type": "string",
  12613. "const": "session.next.text.started.1"
  12614. },
  12615. "id": {
  12616. "type": "string"
  12617. },
  12618. "seq": {
  12619. "type": "number"
  12620. },
  12621. "aggregateID": {
  12622. "type": "string",
  12623. "const": "sessionID"
  12624. },
  12625. "data": {
  12626. "type": "object",
  12627. "properties": {
  12628. "timestamp": {
  12629. "type": "number"
  12630. },
  12631. "sessionID": {
  12632. "type": "string",
  12633. "pattern": "^ses.*"
  12634. }
  12635. },
  12636. "required": ["timestamp", "sessionID"]
  12637. }
  12638. },
  12639. "required": ["type", "name", "id", "seq", "aggregateID", "data"]
  12640. },
  12641. "SyncEvent.session.next.text.delta": {
  12642. "type": "object",
  12643. "properties": {
  12644. "type": {
  12645. "type": "string",
  12646. "const": "sync"
  12647. },
  12648. "name": {
  12649. "type": "string",
  12650. "const": "session.next.text.delta.1"
  12651. },
  12652. "id": {
  12653. "type": "string"
  12654. },
  12655. "seq": {
  12656. "type": "number"
  12657. },
  12658. "aggregateID": {
  12659. "type": "string",
  12660. "const": "sessionID"
  12661. },
  12662. "data": {
  12663. "type": "object",
  12664. "properties": {
  12665. "timestamp": {
  12666. "type": "number"
  12667. },
  12668. "sessionID": {
  12669. "type": "string",
  12670. "pattern": "^ses.*"
  12671. },
  12672. "delta": {
  12673. "type": "string"
  12674. }
  12675. },
  12676. "required": ["timestamp", "sessionID", "delta"]
  12677. }
  12678. },
  12679. "required": ["type", "name", "id", "seq", "aggregateID", "data"]
  12680. },
  12681. "SyncEvent.session.next.text.ended": {
  12682. "type": "object",
  12683. "properties": {
  12684. "type": {
  12685. "type": "string",
  12686. "const": "sync"
  12687. },
  12688. "name": {
  12689. "type": "string",
  12690. "const": "session.next.text.ended.1"
  12691. },
  12692. "id": {
  12693. "type": "string"
  12694. },
  12695. "seq": {
  12696. "type": "number"
  12697. },
  12698. "aggregateID": {
  12699. "type": "string",
  12700. "const": "sessionID"
  12701. },
  12702. "data": {
  12703. "type": "object",
  12704. "properties": {
  12705. "timestamp": {
  12706. "type": "number"
  12707. },
  12708. "sessionID": {
  12709. "type": "string",
  12710. "pattern": "^ses.*"
  12711. },
  12712. "text": {
  12713. "type": "string"
  12714. }
  12715. },
  12716. "required": ["timestamp", "sessionID", "text"]
  12717. }
  12718. },
  12719. "required": ["type", "name", "id", "seq", "aggregateID", "data"]
  12720. },
  12721. "SyncEvent.session.next.reasoning.started": {
  12722. "type": "object",
  12723. "properties": {
  12724. "type": {
  12725. "type": "string",
  12726. "const": "sync"
  12727. },
  12728. "name": {
  12729. "type": "string",
  12730. "const": "session.next.reasoning.started.1"
  12731. },
  12732. "id": {
  12733. "type": "string"
  12734. },
  12735. "seq": {
  12736. "type": "number"
  12737. },
  12738. "aggregateID": {
  12739. "type": "string",
  12740. "const": "sessionID"
  12741. },
  12742. "data": {
  12743. "type": "object",
  12744. "properties": {
  12745. "timestamp": {
  12746. "type": "number"
  12747. },
  12748. "sessionID": {
  12749. "type": "string",
  12750. "pattern": "^ses.*"
  12751. },
  12752. "reasoningID": {
  12753. "type": "string"
  12754. }
  12755. },
  12756. "required": ["timestamp", "sessionID", "reasoningID"]
  12757. }
  12758. },
  12759. "required": ["type", "name", "id", "seq", "aggregateID", "data"]
  12760. },
  12761. "SyncEvent.session.next.reasoning.delta": {
  12762. "type": "object",
  12763. "properties": {
  12764. "type": {
  12765. "type": "string",
  12766. "const": "sync"
  12767. },
  12768. "name": {
  12769. "type": "string",
  12770. "const": "session.next.reasoning.delta.1"
  12771. },
  12772. "id": {
  12773. "type": "string"
  12774. },
  12775. "seq": {
  12776. "type": "number"
  12777. },
  12778. "aggregateID": {
  12779. "type": "string",
  12780. "const": "sessionID"
  12781. },
  12782. "data": {
  12783. "type": "object",
  12784. "properties": {
  12785. "timestamp": {
  12786. "type": "number"
  12787. },
  12788. "sessionID": {
  12789. "type": "string",
  12790. "pattern": "^ses.*"
  12791. },
  12792. "reasoningID": {
  12793. "type": "string"
  12794. },
  12795. "delta": {
  12796. "type": "string"
  12797. }
  12798. },
  12799. "required": ["timestamp", "sessionID", "reasoningID", "delta"]
  12800. }
  12801. },
  12802. "required": ["type", "name", "id", "seq", "aggregateID", "data"]
  12803. },
  12804. "SyncEvent.session.next.reasoning.ended": {
  12805. "type": "object",
  12806. "properties": {
  12807. "type": {
  12808. "type": "string",
  12809. "const": "sync"
  12810. },
  12811. "name": {
  12812. "type": "string",
  12813. "const": "session.next.reasoning.ended.1"
  12814. },
  12815. "id": {
  12816. "type": "string"
  12817. },
  12818. "seq": {
  12819. "type": "number"
  12820. },
  12821. "aggregateID": {
  12822. "type": "string",
  12823. "const": "sessionID"
  12824. },
  12825. "data": {
  12826. "type": "object",
  12827. "properties": {
  12828. "timestamp": {
  12829. "type": "number"
  12830. },
  12831. "sessionID": {
  12832. "type": "string",
  12833. "pattern": "^ses.*"
  12834. },
  12835. "reasoningID": {
  12836. "type": "string"
  12837. },
  12838. "text": {
  12839. "type": "string"
  12840. }
  12841. },
  12842. "required": ["timestamp", "sessionID", "reasoningID", "text"]
  12843. }
  12844. },
  12845. "required": ["type", "name", "id", "seq", "aggregateID", "data"]
  12846. },
  12847. "SyncEvent.session.next.tool.input.started": {
  12848. "type": "object",
  12849. "properties": {
  12850. "type": {
  12851. "type": "string",
  12852. "const": "sync"
  12853. },
  12854. "name": {
  12855. "type": "string",
  12856. "const": "session.next.tool.input.started.1"
  12857. },
  12858. "id": {
  12859. "type": "string"
  12860. },
  12861. "seq": {
  12862. "type": "number"
  12863. },
  12864. "aggregateID": {
  12865. "type": "string",
  12866. "const": "sessionID"
  12867. },
  12868. "data": {
  12869. "type": "object",
  12870. "properties": {
  12871. "timestamp": {
  12872. "type": "number"
  12873. },
  12874. "sessionID": {
  12875. "type": "string",
  12876. "pattern": "^ses.*"
  12877. },
  12878. "callID": {
  12879. "type": "string"
  12880. },
  12881. "name": {
  12882. "type": "string"
  12883. }
  12884. },
  12885. "required": ["timestamp", "sessionID", "callID", "name"]
  12886. }
  12887. },
  12888. "required": ["type", "name", "id", "seq", "aggregateID", "data"]
  12889. },
  12890. "SyncEvent.session.next.tool.input.delta": {
  12891. "type": "object",
  12892. "properties": {
  12893. "type": {
  12894. "type": "string",
  12895. "const": "sync"
  12896. },
  12897. "name": {
  12898. "type": "string",
  12899. "const": "session.next.tool.input.delta.1"
  12900. },
  12901. "id": {
  12902. "type": "string"
  12903. },
  12904. "seq": {
  12905. "type": "number"
  12906. },
  12907. "aggregateID": {
  12908. "type": "string",
  12909. "const": "sessionID"
  12910. },
  12911. "data": {
  12912. "type": "object",
  12913. "properties": {
  12914. "timestamp": {
  12915. "type": "number"
  12916. },
  12917. "sessionID": {
  12918. "type": "string",
  12919. "pattern": "^ses.*"
  12920. },
  12921. "callID": {
  12922. "type": "string"
  12923. },
  12924. "delta": {
  12925. "type": "string"
  12926. }
  12927. },
  12928. "required": ["timestamp", "sessionID", "callID", "delta"]
  12929. }
  12930. },
  12931. "required": ["type", "name", "id", "seq", "aggregateID", "data"]
  12932. },
  12933. "SyncEvent.session.next.tool.input.ended": {
  12934. "type": "object",
  12935. "properties": {
  12936. "type": {
  12937. "type": "string",
  12938. "const": "sync"
  12939. },
  12940. "name": {
  12941. "type": "string",
  12942. "const": "session.next.tool.input.ended.1"
  12943. },
  12944. "id": {
  12945. "type": "string"
  12946. },
  12947. "seq": {
  12948. "type": "number"
  12949. },
  12950. "aggregateID": {
  12951. "type": "string",
  12952. "const": "sessionID"
  12953. },
  12954. "data": {
  12955. "type": "object",
  12956. "properties": {
  12957. "timestamp": {
  12958. "type": "number"
  12959. },
  12960. "sessionID": {
  12961. "type": "string",
  12962. "pattern": "^ses.*"
  12963. },
  12964. "callID": {
  12965. "type": "string"
  12966. },
  12967. "text": {
  12968. "type": "string"
  12969. }
  12970. },
  12971. "required": ["timestamp", "sessionID", "callID", "text"]
  12972. }
  12973. },
  12974. "required": ["type", "name", "id", "seq", "aggregateID", "data"]
  12975. },
  12976. "SyncEvent.session.next.tool.called": {
  12977. "type": "object",
  12978. "properties": {
  12979. "type": {
  12980. "type": "string",
  12981. "const": "sync"
  12982. },
  12983. "name": {
  12984. "type": "string",
  12985. "const": "session.next.tool.called.1"
  12986. },
  12987. "id": {
  12988. "type": "string"
  12989. },
  12990. "seq": {
  12991. "type": "number"
  12992. },
  12993. "aggregateID": {
  12994. "type": "string",
  12995. "const": "sessionID"
  12996. },
  12997. "data": {
  12998. "type": "object",
  12999. "properties": {
  13000. "timestamp": {
  13001. "type": "number"
  13002. },
  13003. "sessionID": {
  13004. "type": "string",
  13005. "pattern": "^ses.*"
  13006. },
  13007. "callID": {
  13008. "type": "string"
  13009. },
  13010. "tool": {
  13011. "type": "string"
  13012. },
  13013. "input": {
  13014. "type": "object",
  13015. "propertyNames": {
  13016. "type": "string"
  13017. },
  13018. "additionalProperties": {}
  13019. },
  13020. "provider": {
  13021. "type": "object",
  13022. "properties": {
  13023. "executed": {
  13024. "type": "boolean"
  13025. },
  13026. "metadata": {
  13027. "type": "object",
  13028. "propertyNames": {
  13029. "type": "string"
  13030. },
  13031. "additionalProperties": {}
  13032. }
  13033. },
  13034. "required": ["executed"]
  13035. }
  13036. },
  13037. "required": ["timestamp", "sessionID", "callID", "tool", "input", "provider"]
  13038. }
  13039. },
  13040. "required": ["type", "name", "id", "seq", "aggregateID", "data"]
  13041. },
  13042. "SyncEvent.session.next.tool.progress": {
  13043. "type": "object",
  13044. "properties": {
  13045. "type": {
  13046. "type": "string",
  13047. "const": "sync"
  13048. },
  13049. "name": {
  13050. "type": "string",
  13051. "const": "session.next.tool.progress.1"
  13052. },
  13053. "id": {
  13054. "type": "string"
  13055. },
  13056. "seq": {
  13057. "type": "number"
  13058. },
  13059. "aggregateID": {
  13060. "type": "string",
  13061. "const": "sessionID"
  13062. },
  13063. "data": {
  13064. "type": "object",
  13065. "properties": {
  13066. "timestamp": {
  13067. "type": "number"
  13068. },
  13069. "sessionID": {
  13070. "type": "string",
  13071. "pattern": "^ses.*"
  13072. },
  13073. "callID": {
  13074. "type": "string"
  13075. },
  13076. "structured": {
  13077. "type": "object",
  13078. "propertyNames": {
  13079. "type": "string"
  13080. },
  13081. "additionalProperties": {}
  13082. },
  13083. "content": {
  13084. "type": "array",
  13085. "items": {
  13086. "anyOf": [
  13087. {
  13088. "$ref": "#/components/schemas/Tool.TextContent"
  13089. },
  13090. {
  13091. "$ref": "#/components/schemas/Tool.FileContent"
  13092. }
  13093. ]
  13094. }
  13095. }
  13096. },
  13097. "required": ["timestamp", "sessionID", "callID", "structured", "content"]
  13098. }
  13099. },
  13100. "required": ["type", "name", "id", "seq", "aggregateID", "data"]
  13101. },
  13102. "SyncEvent.session.next.tool.success": {
  13103. "type": "object",
  13104. "properties": {
  13105. "type": {
  13106. "type": "string",
  13107. "const": "sync"
  13108. },
  13109. "name": {
  13110. "type": "string",
  13111. "const": "session.next.tool.success.1"
  13112. },
  13113. "id": {
  13114. "type": "string"
  13115. },
  13116. "seq": {
  13117. "type": "number"
  13118. },
  13119. "aggregateID": {
  13120. "type": "string",
  13121. "const": "sessionID"
  13122. },
  13123. "data": {
  13124. "type": "object",
  13125. "properties": {
  13126. "timestamp": {
  13127. "type": "number"
  13128. },
  13129. "sessionID": {
  13130. "type": "string",
  13131. "pattern": "^ses.*"
  13132. },
  13133. "callID": {
  13134. "type": "string"
  13135. },
  13136. "structured": {
  13137. "type": "object",
  13138. "propertyNames": {
  13139. "type": "string"
  13140. },
  13141. "additionalProperties": {}
  13142. },
  13143. "content": {
  13144. "type": "array",
  13145. "items": {
  13146. "anyOf": [
  13147. {
  13148. "$ref": "#/components/schemas/Tool.TextContent"
  13149. },
  13150. {
  13151. "$ref": "#/components/schemas/Tool.FileContent"
  13152. }
  13153. ]
  13154. }
  13155. },
  13156. "provider": {
  13157. "type": "object",
  13158. "properties": {
  13159. "executed": {
  13160. "type": "boolean"
  13161. },
  13162. "metadata": {
  13163. "type": "object",
  13164. "propertyNames": {
  13165. "type": "string"
  13166. },
  13167. "additionalProperties": {}
  13168. }
  13169. },
  13170. "required": ["executed"]
  13171. }
  13172. },
  13173. "required": ["timestamp", "sessionID", "callID", "structured", "content", "provider"]
  13174. }
  13175. },
  13176. "required": ["type", "name", "id", "seq", "aggregateID", "data"]
  13177. },
  13178. "SyncEvent.session.next.tool.error": {
  13179. "type": "object",
  13180. "properties": {
  13181. "type": {
  13182. "type": "string",
  13183. "const": "sync"
  13184. },
  13185. "name": {
  13186. "type": "string",
  13187. "const": "session.next.tool.error.1"
  13188. },
  13189. "id": {
  13190. "type": "string"
  13191. },
  13192. "seq": {
  13193. "type": "number"
  13194. },
  13195. "aggregateID": {
  13196. "type": "string",
  13197. "const": "sessionID"
  13198. },
  13199. "data": {
  13200. "type": "object",
  13201. "properties": {
  13202. "timestamp": {
  13203. "type": "number"
  13204. },
  13205. "sessionID": {
  13206. "type": "string",
  13207. "pattern": "^ses.*"
  13208. },
  13209. "callID": {
  13210. "type": "string"
  13211. },
  13212. "error": {
  13213. "type": "object",
  13214. "properties": {
  13215. "type": {
  13216. "type": "string"
  13217. },
  13218. "message": {
  13219. "type": "string"
  13220. }
  13221. },
  13222. "required": ["type", "message"]
  13223. },
  13224. "provider": {
  13225. "type": "object",
  13226. "properties": {
  13227. "executed": {
  13228. "type": "boolean"
  13229. },
  13230. "metadata": {
  13231. "type": "object",
  13232. "propertyNames": {
  13233. "type": "string"
  13234. },
  13235. "additionalProperties": {}
  13236. }
  13237. },
  13238. "required": ["executed"]
  13239. }
  13240. },
  13241. "required": ["timestamp", "sessionID", "callID", "error", "provider"]
  13242. }
  13243. },
  13244. "required": ["type", "name", "id", "seq", "aggregateID", "data"]
  13245. },
  13246. "SyncEvent.session.next.retried": {
  13247. "type": "object",
  13248. "properties": {
  13249. "type": {
  13250. "type": "string",
  13251. "const": "sync"
  13252. },
  13253. "name": {
  13254. "type": "string",
  13255. "const": "session.next.retried.1"
  13256. },
  13257. "id": {
  13258. "type": "string"
  13259. },
  13260. "seq": {
  13261. "type": "number"
  13262. },
  13263. "aggregateID": {
  13264. "type": "string",
  13265. "const": "sessionID"
  13266. },
  13267. "data": {
  13268. "type": "object",
  13269. "properties": {
  13270. "timestamp": {
  13271. "type": "number"
  13272. },
  13273. "sessionID": {
  13274. "type": "string",
  13275. "pattern": "^ses.*"
  13276. },
  13277. "attempt": {
  13278. "type": "integer",
  13279. "minimum": 0,
  13280. "maximum": 9007199254740991
  13281. },
  13282. "error": {
  13283. "$ref": "#/components/schemas/session.next.retry_error"
  13284. }
  13285. },
  13286. "required": ["timestamp", "sessionID", "attempt", "error"]
  13287. }
  13288. },
  13289. "required": ["type", "name", "id", "seq", "aggregateID", "data"]
  13290. },
  13291. "SyncEvent.session.next.compaction.started": {
  13292. "type": "object",
  13293. "properties": {
  13294. "type": {
  13295. "type": "string",
  13296. "const": "sync"
  13297. },
  13298. "name": {
  13299. "type": "string",
  13300. "const": "session.next.compaction.started.1"
  13301. },
  13302. "id": {
  13303. "type": "string"
  13304. },
  13305. "seq": {
  13306. "type": "number"
  13307. },
  13308. "aggregateID": {
  13309. "type": "string",
  13310. "const": "sessionID"
  13311. },
  13312. "data": {
  13313. "type": "object",
  13314. "properties": {
  13315. "timestamp": {
  13316. "type": "number"
  13317. },
  13318. "sessionID": {
  13319. "type": "string",
  13320. "pattern": "^ses.*"
  13321. },
  13322. "reason": {
  13323. "type": "string",
  13324. "enum": ["auto", "manual"]
  13325. }
  13326. },
  13327. "required": ["timestamp", "sessionID", "reason"]
  13328. }
  13329. },
  13330. "required": ["type", "name", "id", "seq", "aggregateID", "data"]
  13331. },
  13332. "SyncEvent.session.next.compaction.delta": {
  13333. "type": "object",
  13334. "properties": {
  13335. "type": {
  13336. "type": "string",
  13337. "const": "sync"
  13338. },
  13339. "name": {
  13340. "type": "string",
  13341. "const": "session.next.compaction.delta.1"
  13342. },
  13343. "id": {
  13344. "type": "string"
  13345. },
  13346. "seq": {
  13347. "type": "number"
  13348. },
  13349. "aggregateID": {
  13350. "type": "string",
  13351. "const": "sessionID"
  13352. },
  13353. "data": {
  13354. "type": "object",
  13355. "properties": {
  13356. "timestamp": {
  13357. "type": "number"
  13358. },
  13359. "sessionID": {
  13360. "type": "string",
  13361. "pattern": "^ses.*"
  13362. },
  13363. "text": {
  13364. "type": "string"
  13365. }
  13366. },
  13367. "required": ["timestamp", "sessionID", "text"]
  13368. }
  13369. },
  13370. "required": ["type", "name", "id", "seq", "aggregateID", "data"]
  13371. },
  13372. "SyncEvent.session.next.compaction.ended": {
  13373. "type": "object",
  13374. "properties": {
  13375. "type": {
  13376. "type": "string",
  13377. "const": "sync"
  13378. },
  13379. "name": {
  13380. "type": "string",
  13381. "const": "session.next.compaction.ended.1"
  13382. },
  13383. "id": {
  13384. "type": "string"
  13385. },
  13386. "seq": {
  13387. "type": "number"
  13388. },
  13389. "aggregateID": {
  13390. "type": "string",
  13391. "const": "sessionID"
  13392. },
  13393. "data": {
  13394. "type": "object",
  13395. "properties": {
  13396. "timestamp": {
  13397. "type": "number"
  13398. },
  13399. "sessionID": {
  13400. "type": "string",
  13401. "pattern": "^ses.*"
  13402. },
  13403. "text": {
  13404. "type": "string"
  13405. },
  13406. "include": {
  13407. "type": "string"
  13408. }
  13409. },
  13410. "required": ["timestamp", "sessionID", "text"]
  13411. }
  13412. },
  13413. "required": ["type", "name", "id", "seq", "aggregateID", "data"]
  13414. },
  13415. "GlobalEvent": {
  13416. "type": "object",
  13417. "properties": {
  13418. "directory": {
  13419. "type": "string"
  13420. },
  13421. "project": {
  13422. "type": "string"
  13423. },
  13424. "workspace": {
  13425. "type": "string"
  13426. },
  13427. "payload": {
  13428. "anyOf": [
  13429. {
  13430. "$ref": "#/components/schemas/Event.server.instance.disposed"
  13431. },
  13432. {
  13433. "$ref": "#/components/schemas/Event.file.edited"
  13434. },
  13435. {
  13436. "$ref": "#/components/schemas/Event.file.watcher.updated"
  13437. },
  13438. {
  13439. "$ref": "#/components/schemas/Event.lsp.client.diagnostics"
  13440. },
  13441. {
  13442. "$ref": "#/components/schemas/Event.lsp.updated"
  13443. },
  13444. {
  13445. "$ref": "#/components/schemas/Event.message.part.delta"
  13446. },
  13447. {
  13448. "$ref": "#/components/schemas/Event.permission.asked"
  13449. },
  13450. {
  13451. "$ref": "#/components/schemas/Event.permission.replied"
  13452. },
  13453. {
  13454. "$ref": "#/components/schemas/Event.session.diff"
  13455. },
  13456. {
  13457. "$ref": "#/components/schemas/Event.session.error"
  13458. },
  13459. {
  13460. "$ref": "#/components/schemas/Event.installation.updated"
  13461. },
  13462. {
  13463. "$ref": "#/components/schemas/Event.installation.update-available"
  13464. },
  13465. {
  13466. "$ref": "#/components/schemas/Event.question.asked"
  13467. },
  13468. {
  13469. "$ref": "#/components/schemas/Event.question.replied"
  13470. },
  13471. {
  13472. "$ref": "#/components/schemas/Event.question.rejected"
  13473. },
  13474. {
  13475. "$ref": "#/components/schemas/Event.todo.updated"
  13476. },
  13477. {
  13478. "$ref": "#/components/schemas/Event.session.status"
  13479. },
  13480. {
  13481. "$ref": "#/components/schemas/Event.session.idle"
  13482. },
  13483. {
  13484. "$ref": "#/components/schemas/Event.session.compacted"
  13485. },
  13486. {
  13487. "$ref": "#/components/schemas/Event.tui.prompt.append"
  13488. },
  13489. {
  13490. "$ref": "#/components/schemas/Event.tui.command.execute"
  13491. },
  13492. {
  13493. "$ref": "#/components/schemas/Event.tui.toast.show"
  13494. },
  13495. {
  13496. "$ref": "#/components/schemas/Event.tui.session.select"
  13497. },
  13498. {
  13499. "$ref": "#/components/schemas/Event.mcp.tools.changed"
  13500. },
  13501. {
  13502. "$ref": "#/components/schemas/Event.mcp.browser.open.failed"
  13503. },
  13504. {
  13505. "$ref": "#/components/schemas/Event.command.executed"
  13506. },
  13507. {
  13508. "$ref": "#/components/schemas/Event.project.updated"
  13509. },
  13510. {
  13511. "$ref": "#/components/schemas/Event.vcs.branch.updated"
  13512. },
  13513. {
  13514. "$ref": "#/components/schemas/Event.workspace.ready"
  13515. },
  13516. {
  13517. "$ref": "#/components/schemas/Event.workspace.failed"
  13518. },
  13519. {
  13520. "$ref": "#/components/schemas/Event.workspace.restore"
  13521. },
  13522. {
  13523. "$ref": "#/components/schemas/Event.workspace.status"
  13524. },
  13525. {
  13526. "$ref": "#/components/schemas/Event.worktree.ready"
  13527. },
  13528. {
  13529. "$ref": "#/components/schemas/Event.worktree.failed"
  13530. },
  13531. {
  13532. "$ref": "#/components/schemas/Event.pty.created"
  13533. },
  13534. {
  13535. "$ref": "#/components/schemas/Event.pty.updated"
  13536. },
  13537. {
  13538. "$ref": "#/components/schemas/Event.pty.exited"
  13539. },
  13540. {
  13541. "$ref": "#/components/schemas/Event.pty.deleted"
  13542. },
  13543. {
  13544. "$ref": "#/components/schemas/Event.message.updated"
  13545. },
  13546. {
  13547. "$ref": "#/components/schemas/Event.message.removed"
  13548. },
  13549. {
  13550. "$ref": "#/components/schemas/Event.message.part.updated"
  13551. },
  13552. {
  13553. "$ref": "#/components/schemas/Event.message.part.removed"
  13554. },
  13555. {
  13556. "$ref": "#/components/schemas/Event.session.created"
  13557. },
  13558. {
  13559. "$ref": "#/components/schemas/Event.session.updated"
  13560. },
  13561. {
  13562. "$ref": "#/components/schemas/Event.session.deleted"
  13563. },
  13564. {
  13565. "$ref": "#/components/schemas/Event.session.next.agent.switched"
  13566. },
  13567. {
  13568. "$ref": "#/components/schemas/Event.session.next.model.switched"
  13569. },
  13570. {
  13571. "$ref": "#/components/schemas/Event.session.next.prompted"
  13572. },
  13573. {
  13574. "$ref": "#/components/schemas/Event.session.next.synthetic"
  13575. },
  13576. {
  13577. "$ref": "#/components/schemas/Event.session.next.shell.started"
  13578. },
  13579. {
  13580. "$ref": "#/components/schemas/Event.session.next.shell.ended"
  13581. },
  13582. {
  13583. "$ref": "#/components/schemas/Event.session.next.step.started"
  13584. },
  13585. {
  13586. "$ref": "#/components/schemas/Event.session.next.step.ended"
  13587. },
  13588. {
  13589. "$ref": "#/components/schemas/Event.session.next.text.started"
  13590. },
  13591. {
  13592. "$ref": "#/components/schemas/Event.session.next.text.delta"
  13593. },
  13594. {
  13595. "$ref": "#/components/schemas/Event.session.next.text.ended"
  13596. },
  13597. {
  13598. "$ref": "#/components/schemas/Event.session.next.reasoning.started"
  13599. },
  13600. {
  13601. "$ref": "#/components/schemas/Event.session.next.reasoning.delta"
  13602. },
  13603. {
  13604. "$ref": "#/components/schemas/Event.session.next.reasoning.ended"
  13605. },
  13606. {
  13607. "$ref": "#/components/schemas/Event.session.next.tool.input.started"
  13608. },
  13609. {
  13610. "$ref": "#/components/schemas/Event.session.next.tool.input.delta"
  13611. },
  13612. {
  13613. "$ref": "#/components/schemas/Event.session.next.tool.input.ended"
  13614. },
  13615. {
  13616. "$ref": "#/components/schemas/Event.session.next.tool.called"
  13617. },
  13618. {
  13619. "$ref": "#/components/schemas/Event.session.next.tool.progress"
  13620. },
  13621. {
  13622. "$ref": "#/components/schemas/Event.session.next.tool.success"
  13623. },
  13624. {
  13625. "$ref": "#/components/schemas/Event.session.next.tool.error"
  13626. },
  13627. {
  13628. "$ref": "#/components/schemas/Event.session.next.retried"
  13629. },
  13630. {
  13631. "$ref": "#/components/schemas/Event.session.next.compaction.started"
  13632. },
  13633. {
  13634. "$ref": "#/components/schemas/Event.session.next.compaction.delta"
  13635. },
  13636. {
  13637. "$ref": "#/components/schemas/Event.session.next.compaction.ended"
  13638. },
  13639. {
  13640. "$ref": "#/components/schemas/Event.server.connected"
  13641. },
  13642. {
  13643. "$ref": "#/components/schemas/Event.global.disposed"
  13644. },
  13645. {
  13646. "$ref": "#/components/schemas/SyncEvent.message.updated"
  13647. },
  13648. {
  13649. "$ref": "#/components/schemas/SyncEvent.message.removed"
  13650. },
  13651. {
  13652. "$ref": "#/components/schemas/SyncEvent.message.part.updated"
  13653. },
  13654. {
  13655. "$ref": "#/components/schemas/SyncEvent.message.part.removed"
  13656. },
  13657. {
  13658. "$ref": "#/components/schemas/SyncEvent.session.created"
  13659. },
  13660. {
  13661. "$ref": "#/components/schemas/SyncEvent.session.updated"
  13662. },
  13663. {
  13664. "$ref": "#/components/schemas/SyncEvent.session.deleted"
  13665. },
  13666. {
  13667. "$ref": "#/components/schemas/SyncEvent.session.next.agent.switched"
  13668. },
  13669. {
  13670. "$ref": "#/components/schemas/SyncEvent.session.next.model.switched"
  13671. },
  13672. {
  13673. "$ref": "#/components/schemas/SyncEvent.session.next.prompted"
  13674. },
  13675. {
  13676. "$ref": "#/components/schemas/SyncEvent.session.next.synthetic"
  13677. },
  13678. {
  13679. "$ref": "#/components/schemas/SyncEvent.session.next.shell.started"
  13680. },
  13681. {
  13682. "$ref": "#/components/schemas/SyncEvent.session.next.shell.ended"
  13683. },
  13684. {
  13685. "$ref": "#/components/schemas/SyncEvent.session.next.step.started"
  13686. },
  13687. {
  13688. "$ref": "#/components/schemas/SyncEvent.session.next.step.ended"
  13689. },
  13690. {
  13691. "$ref": "#/components/schemas/SyncEvent.session.next.text.started"
  13692. },
  13693. {
  13694. "$ref": "#/components/schemas/SyncEvent.session.next.text.delta"
  13695. },
  13696. {
  13697. "$ref": "#/components/schemas/SyncEvent.session.next.text.ended"
  13698. },
  13699. {
  13700. "$ref": "#/components/schemas/SyncEvent.session.next.reasoning.started"
  13701. },
  13702. {
  13703. "$ref": "#/components/schemas/SyncEvent.session.next.reasoning.delta"
  13704. },
  13705. {
  13706. "$ref": "#/components/schemas/SyncEvent.session.next.reasoning.ended"
  13707. },
  13708. {
  13709. "$ref": "#/components/schemas/SyncEvent.session.next.tool.input.started"
  13710. },
  13711. {
  13712. "$ref": "#/components/schemas/SyncEvent.session.next.tool.input.delta"
  13713. },
  13714. {
  13715. "$ref": "#/components/schemas/SyncEvent.session.next.tool.input.ended"
  13716. },
  13717. {
  13718. "$ref": "#/components/schemas/SyncEvent.session.next.tool.called"
  13719. },
  13720. {
  13721. "$ref": "#/components/schemas/SyncEvent.session.next.tool.progress"
  13722. },
  13723. {
  13724. "$ref": "#/components/schemas/SyncEvent.session.next.tool.success"
  13725. },
  13726. {
  13727. "$ref": "#/components/schemas/SyncEvent.session.next.tool.error"
  13728. },
  13729. {
  13730. "$ref": "#/components/schemas/SyncEvent.session.next.retried"
  13731. },
  13732. {
  13733. "$ref": "#/components/schemas/SyncEvent.session.next.compaction.started"
  13734. },
  13735. {
  13736. "$ref": "#/components/schemas/SyncEvent.session.next.compaction.delta"
  13737. },
  13738. {
  13739. "$ref": "#/components/schemas/SyncEvent.session.next.compaction.ended"
  13740. }
  13741. ]
  13742. }
  13743. },
  13744. "required": ["directory", "payload"]
  13745. },
  13746. "LogLevel": {
  13747. "description": "Log level",
  13748. "type": "string",
  13749. "enum": ["DEBUG", "INFO", "WARN", "ERROR"]
  13750. },
  13751. "ServerConfig": {
  13752. "description": "Server configuration for opencode serve and web commands",
  13753. "type": "object",
  13754. "properties": {
  13755. "port": {
  13756. "description": "Port to listen on",
  13757. "type": "integer",
  13758. "exclusiveMinimum": 0,
  13759. "maximum": 9007199254740991
  13760. },
  13761. "hostname": {
  13762. "description": "Hostname to listen on",
  13763. "type": "string"
  13764. },
  13765. "mdns": {
  13766. "description": "Enable mDNS service discovery",
  13767. "type": "boolean"
  13768. },
  13769. "mdnsDomain": {
  13770. "description": "Custom domain name for mDNS service (default: opencode.local)",
  13771. "type": "string"
  13772. },
  13773. "cors": {
  13774. "description": "Additional domains to allow for CORS",
  13775. "type": "array",
  13776. "items": {
  13777. "type": "string"
  13778. }
  13779. }
  13780. }
  13781. },
  13782. "PermissionActionConfig": {
  13783. "type": "string",
  13784. "enum": ["ask", "allow", "deny"]
  13785. },
  13786. "PermissionObjectConfig": {
  13787. "type": "object",
  13788. "propertyNames": {
  13789. "type": "string"
  13790. },
  13791. "additionalProperties": {
  13792. "$ref": "#/components/schemas/PermissionActionConfig"
  13793. }
  13794. },
  13795. "PermissionRuleConfig": {
  13796. "anyOf": [
  13797. {
  13798. "$ref": "#/components/schemas/PermissionActionConfig"
  13799. },
  13800. {
  13801. "$ref": "#/components/schemas/PermissionObjectConfig"
  13802. }
  13803. ]
  13804. },
  13805. "PermissionConfig": {
  13806. "anyOf": [
  13807. {
  13808. "$ref": "#/components/schemas/PermissionActionConfig"
  13809. },
  13810. {
  13811. "type": "object",
  13812. "properties": {
  13813. "read": {
  13814. "$ref": "#/components/schemas/PermissionRuleConfig"
  13815. },
  13816. "edit": {
  13817. "$ref": "#/components/schemas/PermissionRuleConfig"
  13818. },
  13819. "glob": {
  13820. "$ref": "#/components/schemas/PermissionRuleConfig"
  13821. },
  13822. "grep": {
  13823. "$ref": "#/components/schemas/PermissionRuleConfig"
  13824. },
  13825. "list": {
  13826. "$ref": "#/components/schemas/PermissionRuleConfig"
  13827. },
  13828. "bash": {
  13829. "$ref": "#/components/schemas/PermissionRuleConfig"
  13830. },
  13831. "task": {
  13832. "$ref": "#/components/schemas/PermissionRuleConfig"
  13833. },
  13834. "external_directory": {
  13835. "$ref": "#/components/schemas/PermissionRuleConfig"
  13836. },
  13837. "todowrite": {
  13838. "$ref": "#/components/schemas/PermissionActionConfig"
  13839. },
  13840. "question": {
  13841. "$ref": "#/components/schemas/PermissionActionConfig"
  13842. },
  13843. "webfetch": {
  13844. "$ref": "#/components/schemas/PermissionActionConfig"
  13845. },
  13846. "websearch": {
  13847. "$ref": "#/components/schemas/PermissionActionConfig"
  13848. },
  13849. "lsp": {
  13850. "$ref": "#/components/schemas/PermissionRuleConfig"
  13851. },
  13852. "doom_loop": {
  13853. "$ref": "#/components/schemas/PermissionActionConfig"
  13854. },
  13855. "skill": {
  13856. "$ref": "#/components/schemas/PermissionRuleConfig"
  13857. }
  13858. },
  13859. "additionalProperties": {
  13860. "$ref": "#/components/schemas/PermissionRuleConfig"
  13861. }
  13862. }
  13863. ]
  13864. },
  13865. "AgentConfig": {
  13866. "type": "object",
  13867. "properties": {
  13868. "model": {
  13869. "type": "string"
  13870. },
  13871. "variant": {
  13872. "description": "Default model variant for this agent (applies only when using the agent's configured model).",
  13873. "type": "string"
  13874. },
  13875. "temperature": {
  13876. "type": "number"
  13877. },
  13878. "top_p": {
  13879. "type": "number"
  13880. },
  13881. "prompt": {
  13882. "type": "string"
  13883. },
  13884. "tools": {
  13885. "description": "@deprecated Use 'permission' field instead",
  13886. "type": "object",
  13887. "propertyNames": {
  13888. "type": "string"
  13889. },
  13890. "additionalProperties": {
  13891. "type": "boolean"
  13892. }
  13893. },
  13894. "disable": {
  13895. "type": "boolean"
  13896. },
  13897. "description": {
  13898. "description": "Description of when to use the agent",
  13899. "type": "string"
  13900. },
  13901. "mode": {
  13902. "type": "string",
  13903. "enum": ["subagent", "primary", "all"]
  13904. },
  13905. "hidden": {
  13906. "description": "Hide this subagent from the @ autocomplete menu (default: false, only applies to mode: subagent)",
  13907. "type": "boolean"
  13908. },
  13909. "options": {
  13910. "type": "object",
  13911. "propertyNames": {
  13912. "type": "string"
  13913. },
  13914. "additionalProperties": {}
  13915. },
  13916. "color": {
  13917. "description": "Hex color code (e.g., #FF5733) or theme color (e.g., primary)",
  13918. "anyOf": [
  13919. {
  13920. "type": "string",
  13921. "pattern": "^#[0-9a-fA-F]{6}$"
  13922. },
  13923. {
  13924. "type": "string",
  13925. "enum": ["primary", "secondary", "accent", "success", "warning", "error", "info"]
  13926. }
  13927. ]
  13928. },
  13929. "steps": {
  13930. "description": "Maximum number of agentic iterations before forcing text-only response",
  13931. "type": "integer",
  13932. "exclusiveMinimum": 0,
  13933. "maximum": 9007199254740991
  13934. },
  13935. "maxSteps": {
  13936. "description": "@deprecated Use 'steps' field instead.",
  13937. "type": "integer",
  13938. "exclusiveMinimum": 0,
  13939. "maximum": 9007199254740991
  13940. },
  13941. "permission": {
  13942. "$ref": "#/components/schemas/PermissionConfig"
  13943. }
  13944. },
  13945. "additionalProperties": {}
  13946. },
  13947. "ProviderConfig": {
  13948. "type": "object",
  13949. "properties": {
  13950. "api": {
  13951. "type": "string"
  13952. },
  13953. "name": {
  13954. "type": "string"
  13955. },
  13956. "env": {
  13957. "type": "array",
  13958. "items": {
  13959. "type": "string"
  13960. }
  13961. },
  13962. "id": {
  13963. "type": "string"
  13964. },
  13965. "npm": {
  13966. "type": "string"
  13967. },
  13968. "whitelist": {
  13969. "type": "array",
  13970. "items": {
  13971. "type": "string"
  13972. }
  13973. },
  13974. "blacklist": {
  13975. "type": "array",
  13976. "items": {
  13977. "type": "string"
  13978. }
  13979. },
  13980. "options": {
  13981. "type": "object",
  13982. "properties": {
  13983. "apiKey": {
  13984. "type": "string"
  13985. },
  13986. "baseURL": {
  13987. "type": "string"
  13988. },
  13989. "enterpriseUrl": {
  13990. "description": "GitHub Enterprise URL for copilot authentication",
  13991. "type": "string"
  13992. },
  13993. "setCacheKey": {
  13994. "description": "Enable promptCacheKey for this provider (default false)",
  13995. "type": "boolean"
  13996. },
  13997. "timeout": {
  13998. "description": "Timeout in milliseconds for requests to this provider. Default is 300000 (5 minutes). Set to false to disable timeout.",
  13999. "anyOf": [
  14000. {
  14001. "type": "integer",
  14002. "exclusiveMinimum": 0,
  14003. "maximum": 9007199254740991
  14004. },
  14005. {
  14006. "type": "boolean",
  14007. "const": false
  14008. }
  14009. ]
  14010. },
  14011. "chunkTimeout": {
  14012. "description": "Timeout in milliseconds between streamed SSE chunks for this provider. If no chunk arrives within this window, the request is aborted.",
  14013. "type": "integer",
  14014. "exclusiveMinimum": 0,
  14015. "maximum": 9007199254740991
  14016. }
  14017. },
  14018. "additionalProperties": {}
  14019. },
  14020. "models": {
  14021. "type": "object",
  14022. "propertyNames": {
  14023. "type": "string"
  14024. },
  14025. "additionalProperties": {
  14026. "type": "object",
  14027. "properties": {
  14028. "id": {
  14029. "type": "string"
  14030. },
  14031. "name": {
  14032. "type": "string"
  14033. },
  14034. "family": {
  14035. "type": "string"
  14036. },
  14037. "release_date": {
  14038. "type": "string"
  14039. },
  14040. "attachment": {
  14041. "type": "boolean"
  14042. },
  14043. "reasoning": {
  14044. "type": "boolean"
  14045. },
  14046. "temperature": {
  14047. "type": "boolean"
  14048. },
  14049. "tool_call": {
  14050. "type": "boolean"
  14051. },
  14052. "interleaved": {
  14053. "anyOf": [
  14054. {
  14055. "type": "boolean",
  14056. "const": true
  14057. },
  14058. {
  14059. "type": "object",
  14060. "properties": {
  14061. "field": {
  14062. "type": "string",
  14063. "enum": ["reasoning_content", "reasoning_details"]
  14064. }
  14065. },
  14066. "required": ["field"]
  14067. }
  14068. ]
  14069. },
  14070. "cost": {
  14071. "type": "object",
  14072. "properties": {
  14073. "input": {
  14074. "type": "number"
  14075. },
  14076. "output": {
  14077. "type": "number"
  14078. },
  14079. "cache_read": {
  14080. "type": "number"
  14081. },
  14082. "cache_write": {
  14083. "type": "number"
  14084. },
  14085. "context_over_200k": {
  14086. "type": "object",
  14087. "properties": {
  14088. "input": {
  14089. "type": "number"
  14090. },
  14091. "output": {
  14092. "type": "number"
  14093. },
  14094. "cache_read": {
  14095. "type": "number"
  14096. },
  14097. "cache_write": {
  14098. "type": "number"
  14099. }
  14100. },
  14101. "required": ["input", "output"]
  14102. }
  14103. },
  14104. "required": ["input", "output"]
  14105. },
  14106. "limit": {
  14107. "type": "object",
  14108. "properties": {
  14109. "context": {
  14110. "type": "number"
  14111. },
  14112. "input": {
  14113. "type": "number"
  14114. },
  14115. "output": {
  14116. "type": "number"
  14117. }
  14118. },
  14119. "required": ["context", "output"]
  14120. },
  14121. "modalities": {
  14122. "type": "object",
  14123. "properties": {
  14124. "input": {
  14125. "type": "array",
  14126. "items": {
  14127. "type": "string",
  14128. "enum": ["text", "audio", "image", "video", "pdf"]
  14129. }
  14130. },
  14131. "output": {
  14132. "type": "array",
  14133. "items": {
  14134. "type": "string",
  14135. "enum": ["text", "audio", "image", "video", "pdf"]
  14136. }
  14137. }
  14138. },
  14139. "required": ["input", "output"]
  14140. },
  14141. "experimental": {
  14142. "type": "boolean"
  14143. },
  14144. "status": {
  14145. "type": "string",
  14146. "enum": ["alpha", "beta", "deprecated"]
  14147. },
  14148. "provider": {
  14149. "type": "object",
  14150. "properties": {
  14151. "npm": {
  14152. "type": "string"
  14153. },
  14154. "api": {
  14155. "type": "string"
  14156. }
  14157. }
  14158. },
  14159. "options": {
  14160. "type": "object",
  14161. "propertyNames": {
  14162. "type": "string"
  14163. },
  14164. "additionalProperties": {}
  14165. },
  14166. "headers": {
  14167. "type": "object",
  14168. "propertyNames": {
  14169. "type": "string"
  14170. },
  14171. "additionalProperties": {
  14172. "type": "string"
  14173. }
  14174. },
  14175. "variants": {
  14176. "description": "Variant-specific configuration",
  14177. "type": "object",
  14178. "propertyNames": {
  14179. "type": "string"
  14180. },
  14181. "additionalProperties": {
  14182. "type": "object",
  14183. "properties": {
  14184. "disabled": {
  14185. "description": "Disable this variant for the model",
  14186. "type": "boolean"
  14187. }
  14188. },
  14189. "additionalProperties": {}
  14190. }
  14191. }
  14192. }
  14193. }
  14194. }
  14195. }
  14196. },
  14197. "McpLocalConfig": {
  14198. "type": "object",
  14199. "properties": {
  14200. "type": {
  14201. "description": "Type of MCP server connection",
  14202. "type": "string",
  14203. "const": "local"
  14204. },
  14205. "command": {
  14206. "description": "Command and arguments to run the MCP server",
  14207. "type": "array",
  14208. "items": {
  14209. "type": "string"
  14210. }
  14211. },
  14212. "environment": {
  14213. "description": "Environment variables to set when running the MCP server",
  14214. "type": "object",
  14215. "propertyNames": {
  14216. "type": "string"
  14217. },
  14218. "additionalProperties": {
  14219. "type": "string"
  14220. }
  14221. },
  14222. "enabled": {
  14223. "description": "Enable or disable the MCP server on startup",
  14224. "type": "boolean"
  14225. },
  14226. "timeout": {
  14227. "description": "Timeout in ms for MCP server requests. Defaults to 5000 (5 seconds) if not specified.",
  14228. "type": "integer",
  14229. "exclusiveMinimum": 0,
  14230. "maximum": 9007199254740991
  14231. }
  14232. },
  14233. "required": ["type", "command"]
  14234. },
  14235. "McpOAuthConfig": {
  14236. "type": "object",
  14237. "properties": {
  14238. "clientId": {
  14239. "description": "OAuth client ID. If not provided, dynamic client registration (RFC 7591) will be attempted.",
  14240. "type": "string"
  14241. },
  14242. "clientSecret": {
  14243. "description": "OAuth client secret (if required by the authorization server)",
  14244. "type": "string"
  14245. },
  14246. "scope": {
  14247. "description": "OAuth scopes to request during authorization",
  14248. "type": "string"
  14249. },
  14250. "redirectUri": {
  14251. "description": "OAuth redirect URI (default: http://127.0.0.1:19876/mcp/oauth/callback).",
  14252. "type": "string"
  14253. }
  14254. }
  14255. },
  14256. "McpRemoteConfig": {
  14257. "type": "object",
  14258. "properties": {
  14259. "type": {
  14260. "description": "Type of MCP server connection",
  14261. "type": "string",
  14262. "const": "remote"
  14263. },
  14264. "url": {
  14265. "description": "URL of the remote MCP server",
  14266. "type": "string"
  14267. },
  14268. "enabled": {
  14269. "description": "Enable or disable the MCP server on startup",
  14270. "type": "boolean"
  14271. },
  14272. "headers": {
  14273. "description": "Headers to send with the request",
  14274. "type": "object",
  14275. "propertyNames": {
  14276. "type": "string"
  14277. },
  14278. "additionalProperties": {
  14279. "type": "string"
  14280. }
  14281. },
  14282. "oauth": {
  14283. "description": "OAuth authentication configuration for the MCP server. Set to false to disable OAuth auto-detection.",
  14284. "anyOf": [
  14285. {
  14286. "$ref": "#/components/schemas/McpOAuthConfig"
  14287. },
  14288. {
  14289. "type": "boolean",
  14290. "const": false
  14291. }
  14292. ]
  14293. },
  14294. "timeout": {
  14295. "description": "Timeout in ms for MCP server requests. Defaults to 5000 (5 seconds) if not specified.",
  14296. "type": "integer",
  14297. "exclusiveMinimum": 0,
  14298. "maximum": 9007199254740991
  14299. }
  14300. },
  14301. "required": ["type", "url"]
  14302. },
  14303. "LayoutConfig": {
  14304. "description": "@deprecated Always uses stretch layout.",
  14305. "type": "string",
  14306. "enum": ["auto", "stretch"]
  14307. },
  14308. "Config": {
  14309. "type": "object",
  14310. "properties": {
  14311. "$schema": {
  14312. "description": "JSON schema reference for configuration validation",
  14313. "type": "string"
  14314. },
  14315. "shell": {
  14316. "description": "Default shell to use for terminal and bash tool",
  14317. "type": "string"
  14318. },
  14319. "logLevel": {
  14320. "$ref": "#/components/schemas/LogLevel"
  14321. },
  14322. "server": {
  14323. "$ref": "#/components/schemas/ServerConfig"
  14324. },
  14325. "command": {
  14326. "description": "Command configuration, see https://opencode.ai/docs/commands",
  14327. "type": "object",
  14328. "propertyNames": {
  14329. "type": "string"
  14330. },
  14331. "additionalProperties": {
  14332. "type": "object",
  14333. "properties": {
  14334. "template": {
  14335. "type": "string"
  14336. },
  14337. "description": {
  14338. "type": "string"
  14339. },
  14340. "agent": {
  14341. "type": "string"
  14342. },
  14343. "model": {
  14344. "type": "string"
  14345. },
  14346. "subtask": {
  14347. "type": "boolean"
  14348. }
  14349. },
  14350. "required": ["template"]
  14351. }
  14352. },
  14353. "skills": {
  14354. "description": "Additional skill folder paths",
  14355. "type": "object",
  14356. "properties": {
  14357. "paths": {
  14358. "description": "Additional paths to skill folders",
  14359. "type": "array",
  14360. "items": {
  14361. "type": "string"
  14362. }
  14363. },
  14364. "urls": {
  14365. "description": "URLs to fetch skills from (e.g., https://example.com/.well-known/skills/)",
  14366. "type": "array",
  14367. "items": {
  14368. "type": "string"
  14369. }
  14370. }
  14371. }
  14372. },
  14373. "watcher": {
  14374. "type": "object",
  14375. "properties": {
  14376. "ignore": {
  14377. "type": "array",
  14378. "items": {
  14379. "type": "string"
  14380. }
  14381. }
  14382. }
  14383. },
  14384. "snapshot": {
  14385. "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.",
  14386. "type": "boolean"
  14387. },
  14388. "plugin": {
  14389. "type": "array",
  14390. "items": {
  14391. "anyOf": [
  14392. {
  14393. "type": "string"
  14394. },
  14395. {
  14396. "type": "array",
  14397. "prefixItems": [
  14398. {
  14399. "type": "string"
  14400. },
  14401. {
  14402. "type": "object",
  14403. "propertyNames": {
  14404. "type": "string"
  14405. },
  14406. "additionalProperties": {}
  14407. }
  14408. ]
  14409. }
  14410. ]
  14411. }
  14412. },
  14413. "share": {
  14414. "description": "Control sharing behavior:'manual' allows manual sharing via commands, 'auto' enables automatic sharing, 'disabled' disables all sharing",
  14415. "type": "string",
  14416. "enum": ["manual", "auto", "disabled"]
  14417. },
  14418. "autoshare": {
  14419. "description": "@deprecated Use 'share' field instead. Share newly created sessions automatically",
  14420. "type": "boolean"
  14421. },
  14422. "autoupdate": {
  14423. "description": "Automatically update to the latest version. Set to true to auto-update, false to disable, or 'notify' to show update notifications",
  14424. "anyOf": [
  14425. {
  14426. "type": "boolean"
  14427. },
  14428. {
  14429. "type": "string",
  14430. "const": "notify"
  14431. }
  14432. ]
  14433. },
  14434. "disabled_providers": {
  14435. "description": "Disable providers that are loaded automatically",
  14436. "type": "array",
  14437. "items": {
  14438. "type": "string"
  14439. }
  14440. },
  14441. "enabled_providers": {
  14442. "description": "When set, ONLY these providers will be enabled. All other providers will be ignored",
  14443. "type": "array",
  14444. "items": {
  14445. "type": "string"
  14446. }
  14447. },
  14448. "model": {
  14449. "description": "Model to use in the format of provider/model, eg anthropic/claude-2",
  14450. "type": "string"
  14451. },
  14452. "small_model": {
  14453. "description": "Small model to use for tasks like title generation in the format of provider/model",
  14454. "type": "string"
  14455. },
  14456. "default_agent": {
  14457. "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.",
  14458. "type": "string"
  14459. },
  14460. "username": {
  14461. "description": "Custom username to display in conversations instead of system username",
  14462. "type": "string"
  14463. },
  14464. "mode": {
  14465. "description": "@deprecated Use `agent` field instead.",
  14466. "type": "object",
  14467. "properties": {
  14468. "build": {
  14469. "$ref": "#/components/schemas/AgentConfig"
  14470. },
  14471. "plan": {
  14472. "$ref": "#/components/schemas/AgentConfig"
  14473. }
  14474. },
  14475. "additionalProperties": {
  14476. "$ref": "#/components/schemas/AgentConfig"
  14477. }
  14478. },
  14479. "agent": {
  14480. "description": "Agent configuration, see https://opencode.ai/docs/agents",
  14481. "type": "object",
  14482. "properties": {
  14483. "plan": {
  14484. "$ref": "#/components/schemas/AgentConfig"
  14485. },
  14486. "build": {
  14487. "$ref": "#/components/schemas/AgentConfig"
  14488. },
  14489. "general": {
  14490. "$ref": "#/components/schemas/AgentConfig"
  14491. },
  14492. "explore": {
  14493. "$ref": "#/components/schemas/AgentConfig"
  14494. },
  14495. "title": {
  14496. "$ref": "#/components/schemas/AgentConfig"
  14497. },
  14498. "summary": {
  14499. "$ref": "#/components/schemas/AgentConfig"
  14500. },
  14501. "compaction": {
  14502. "$ref": "#/components/schemas/AgentConfig"
  14503. }
  14504. },
  14505. "additionalProperties": {
  14506. "$ref": "#/components/schemas/AgentConfig"
  14507. }
  14508. },
  14509. "provider": {
  14510. "description": "Custom provider configurations and model overrides",
  14511. "type": "object",
  14512. "propertyNames": {
  14513. "type": "string"
  14514. },
  14515. "additionalProperties": {
  14516. "$ref": "#/components/schemas/ProviderConfig"
  14517. }
  14518. },
  14519. "mcp": {
  14520. "description": "MCP (Model Context Protocol) server configurations",
  14521. "type": "object",
  14522. "propertyNames": {
  14523. "type": "string"
  14524. },
  14525. "additionalProperties": {
  14526. "anyOf": [
  14527. {
  14528. "anyOf": [
  14529. {
  14530. "$ref": "#/components/schemas/McpLocalConfig"
  14531. },
  14532. {
  14533. "$ref": "#/components/schemas/McpRemoteConfig"
  14534. }
  14535. ]
  14536. },
  14537. {
  14538. "type": "object",
  14539. "properties": {
  14540. "enabled": {
  14541. "type": "boolean"
  14542. }
  14543. },
  14544. "required": ["enabled"]
  14545. }
  14546. ]
  14547. }
  14548. },
  14549. "formatter": {
  14550. "description": "Enable or configure formatters. Omit or set to false to disable, true to enable built-ins, or an object to enable built-ins with overrides.",
  14551. "anyOf": [
  14552. {
  14553. "type": "boolean"
  14554. },
  14555. {
  14556. "type": "object",
  14557. "propertyNames": {
  14558. "type": "string"
  14559. },
  14560. "additionalProperties": {
  14561. "type": "object",
  14562. "properties": {
  14563. "disabled": {
  14564. "type": "boolean"
  14565. },
  14566. "command": {
  14567. "type": "array",
  14568. "items": {
  14569. "type": "string"
  14570. }
  14571. },
  14572. "environment": {
  14573. "type": "object",
  14574. "propertyNames": {
  14575. "type": "string"
  14576. },
  14577. "additionalProperties": {
  14578. "type": "string"
  14579. }
  14580. },
  14581. "extensions": {
  14582. "type": "array",
  14583. "items": {
  14584. "type": "string"
  14585. }
  14586. }
  14587. }
  14588. }
  14589. }
  14590. ]
  14591. },
  14592. "lsp": {
  14593. "description": "Enable or configure LSP servers. Omit or set to false to disable, true to enable built-ins, or an object to enable built-ins with overrides.",
  14594. "anyOf": [
  14595. {
  14596. "type": "boolean"
  14597. },
  14598. {
  14599. "type": "object",
  14600. "propertyNames": {
  14601. "type": "string"
  14602. },
  14603. "additionalProperties": {
  14604. "anyOf": [
  14605. {
  14606. "type": "object",
  14607. "properties": {
  14608. "disabled": {
  14609. "type": "boolean",
  14610. "const": true
  14611. }
  14612. },
  14613. "required": ["disabled"]
  14614. },
  14615. {
  14616. "type": "object",
  14617. "properties": {
  14618. "command": {
  14619. "type": "array",
  14620. "items": {
  14621. "type": "string"
  14622. }
  14623. },
  14624. "extensions": {
  14625. "type": "array",
  14626. "items": {
  14627. "type": "string"
  14628. }
  14629. },
  14630. "disabled": {
  14631. "type": "boolean"
  14632. },
  14633. "env": {
  14634. "type": "object",
  14635. "propertyNames": {
  14636. "type": "string"
  14637. },
  14638. "additionalProperties": {
  14639. "type": "string"
  14640. }
  14641. },
  14642. "initialization": {
  14643. "type": "object",
  14644. "propertyNames": {
  14645. "type": "string"
  14646. },
  14647. "additionalProperties": {}
  14648. }
  14649. },
  14650. "required": ["command"]
  14651. }
  14652. ]
  14653. }
  14654. }
  14655. ]
  14656. },
  14657. "instructions": {
  14658. "description": "Additional instruction files or patterns to include",
  14659. "type": "array",
  14660. "items": {
  14661. "type": "string"
  14662. }
  14663. },
  14664. "layout": {
  14665. "$ref": "#/components/schemas/LayoutConfig"
  14666. },
  14667. "permission": {
  14668. "$ref": "#/components/schemas/PermissionConfig"
  14669. },
  14670. "tools": {
  14671. "type": "object",
  14672. "propertyNames": {
  14673. "type": "string"
  14674. },
  14675. "additionalProperties": {
  14676. "type": "boolean"
  14677. }
  14678. },
  14679. "enterprise": {
  14680. "type": "object",
  14681. "properties": {
  14682. "url": {
  14683. "description": "Enterprise URL",
  14684. "type": "string"
  14685. }
  14686. }
  14687. },
  14688. "tool_output": {
  14689. "description": "Thresholds for truncating tool output. When output exceeds either limit, the full text is written to the truncation directory and a preview is returned.",
  14690. "type": "object",
  14691. "properties": {
  14692. "max_lines": {
  14693. "description": "Maximum lines of tool output before it is truncated and saved to disk (default: 2000)",
  14694. "type": "integer",
  14695. "exclusiveMinimum": 0,
  14696. "maximum": 9007199254740991
  14697. },
  14698. "max_bytes": {
  14699. "description": "Maximum bytes of tool output before it is truncated and saved to disk (default: 51200)",
  14700. "type": "integer",
  14701. "exclusiveMinimum": 0,
  14702. "maximum": 9007199254740991
  14703. }
  14704. }
  14705. },
  14706. "compaction": {
  14707. "type": "object",
  14708. "properties": {
  14709. "auto": {
  14710. "description": "Enable automatic compaction when context is full (default: true)",
  14711. "type": "boolean"
  14712. },
  14713. "prune": {
  14714. "description": "Enable pruning of old tool outputs (default: true)",
  14715. "type": "boolean"
  14716. },
  14717. "tail_turns": {
  14718. "description": "Number of recent user turns, including their following assistant/tool responses, to keep verbatim during compaction (default: 2)",
  14719. "type": "integer",
  14720. "minimum": 0,
  14721. "maximum": 9007199254740991
  14722. },
  14723. "preserve_recent_tokens": {
  14724. "description": "Maximum number of tokens from recent turns to preserve verbatim after compaction",
  14725. "type": "integer",
  14726. "minimum": 0,
  14727. "maximum": 9007199254740991
  14728. },
  14729. "reserved": {
  14730. "description": "Token buffer for compaction. Leaves enough window to avoid overflow during compaction.",
  14731. "type": "integer",
  14732. "minimum": 0,
  14733. "maximum": 9007199254740991
  14734. }
  14735. }
  14736. },
  14737. "experimental": {
  14738. "type": "object",
  14739. "properties": {
  14740. "disable_paste_summary": {
  14741. "type": "boolean"
  14742. },
  14743. "batch_tool": {
  14744. "description": "Enable the batch tool",
  14745. "type": "boolean"
  14746. },
  14747. "openTelemetry": {
  14748. "description": "Enable OpenTelemetry spans for AI SDK calls (using the 'experimental_telemetry' flag)",
  14749. "type": "boolean"
  14750. },
  14751. "primary_tools": {
  14752. "description": "Tools that should only be available to primary agents.",
  14753. "type": "array",
  14754. "items": {
  14755. "type": "string"
  14756. }
  14757. },
  14758. "continue_loop_on_deny": {
  14759. "description": "Continue the agent loop when a tool call is denied",
  14760. "type": "boolean"
  14761. },
  14762. "mcp_timeout": {
  14763. "description": "Timeout in milliseconds for model context protocol (MCP) requests",
  14764. "type": "integer",
  14765. "exclusiveMinimum": 0,
  14766. "maximum": 9007199254740991
  14767. }
  14768. }
  14769. }
  14770. },
  14771. "additionalProperties": false
  14772. },
  14773. "BadRequestError": {
  14774. "type": "object",
  14775. "properties": {
  14776. "data": {},
  14777. "errors": {
  14778. "type": "array",
  14779. "items": {
  14780. "type": "object",
  14781. "propertyNames": {
  14782. "type": "string"
  14783. },
  14784. "additionalProperties": {}
  14785. }
  14786. },
  14787. "success": {
  14788. "type": "boolean",
  14789. "const": false
  14790. }
  14791. },
  14792. "required": ["data", "errors", "success"]
  14793. },
  14794. "OAuth": {
  14795. "type": "object",
  14796. "properties": {
  14797. "type": {
  14798. "type": "string",
  14799. "const": "oauth"
  14800. },
  14801. "refresh": {
  14802. "type": "string"
  14803. },
  14804. "access": {
  14805. "type": "string"
  14806. },
  14807. "expires": {
  14808. "type": "integer",
  14809. "minimum": 0,
  14810. "maximum": 9007199254740991
  14811. },
  14812. "accountId": {
  14813. "type": "string"
  14814. },
  14815. "enterpriseUrl": {
  14816. "type": "string"
  14817. }
  14818. },
  14819. "required": ["type", "refresh", "access", "expires"]
  14820. },
  14821. "ApiAuth": {
  14822. "type": "object",
  14823. "properties": {
  14824. "type": {
  14825. "type": "string",
  14826. "const": "api"
  14827. },
  14828. "key": {
  14829. "type": "string"
  14830. },
  14831. "metadata": {
  14832. "type": "object",
  14833. "propertyNames": {
  14834. "type": "string"
  14835. },
  14836. "additionalProperties": {
  14837. "type": "string"
  14838. }
  14839. }
  14840. },
  14841. "required": ["type", "key"]
  14842. },
  14843. "WellKnownAuth": {
  14844. "type": "object",
  14845. "properties": {
  14846. "type": {
  14847. "type": "string",
  14848. "const": "wellknown"
  14849. },
  14850. "key": {
  14851. "type": "string"
  14852. },
  14853. "token": {
  14854. "type": "string"
  14855. }
  14856. },
  14857. "required": ["type", "key", "token"]
  14858. },
  14859. "Auth": {
  14860. "anyOf": [
  14861. {
  14862. "$ref": "#/components/schemas/OAuth"
  14863. },
  14864. {
  14865. "$ref": "#/components/schemas/ApiAuth"
  14866. },
  14867. {
  14868. "$ref": "#/components/schemas/WellKnownAuth"
  14869. }
  14870. ]
  14871. },
  14872. "Workspace": {
  14873. "type": "object",
  14874. "properties": {
  14875. "id": {
  14876. "type": "string",
  14877. "pattern": "^wrk.*"
  14878. },
  14879. "type": {
  14880. "type": "string"
  14881. },
  14882. "name": {
  14883. "type": "string"
  14884. },
  14885. "branch": {
  14886. "anyOf": [
  14887. {
  14888. "type": "string"
  14889. },
  14890. {
  14891. "type": "null"
  14892. }
  14893. ]
  14894. },
  14895. "directory": {
  14896. "anyOf": [
  14897. {
  14898. "type": "string"
  14899. },
  14900. {
  14901. "type": "null"
  14902. }
  14903. ]
  14904. },
  14905. "extra": {
  14906. "anyOf": [
  14907. {},
  14908. {
  14909. "type": "null"
  14910. }
  14911. ]
  14912. },
  14913. "projectID": {
  14914. "type": "string"
  14915. }
  14916. },
  14917. "required": ["id", "type", "name", "branch", "directory", "extra", "projectID"]
  14918. },
  14919. "NotFoundError": {
  14920. "type": "object",
  14921. "properties": {
  14922. "name": {
  14923. "type": "string",
  14924. "const": "NotFoundError"
  14925. },
  14926. "data": {
  14927. "type": "object",
  14928. "properties": {
  14929. "message": {
  14930. "type": "string"
  14931. }
  14932. },
  14933. "required": ["message"]
  14934. }
  14935. },
  14936. "required": ["name", "data"]
  14937. },
  14938. "Model": {
  14939. "type": "object",
  14940. "properties": {
  14941. "id": {
  14942. "type": "string"
  14943. },
  14944. "providerID": {
  14945. "type": "string"
  14946. },
  14947. "api": {
  14948. "type": "object",
  14949. "properties": {
  14950. "id": {
  14951. "type": "string"
  14952. },
  14953. "url": {
  14954. "type": "string"
  14955. },
  14956. "npm": {
  14957. "type": "string"
  14958. }
  14959. },
  14960. "required": ["id", "url", "npm"]
  14961. },
  14962. "name": {
  14963. "type": "string"
  14964. },
  14965. "family": {
  14966. "type": "string"
  14967. },
  14968. "capabilities": {
  14969. "type": "object",
  14970. "properties": {
  14971. "temperature": {
  14972. "type": "boolean"
  14973. },
  14974. "reasoning": {
  14975. "type": "boolean"
  14976. },
  14977. "attachment": {
  14978. "type": "boolean"
  14979. },
  14980. "toolcall": {
  14981. "type": "boolean"
  14982. },
  14983. "input": {
  14984. "type": "object",
  14985. "properties": {
  14986. "text": {
  14987. "type": "boolean"
  14988. },
  14989. "audio": {
  14990. "type": "boolean"
  14991. },
  14992. "image": {
  14993. "type": "boolean"
  14994. },
  14995. "video": {
  14996. "type": "boolean"
  14997. },
  14998. "pdf": {
  14999. "type": "boolean"
  15000. }
  15001. },
  15002. "required": ["text", "audio", "image", "video", "pdf"]
  15003. },
  15004. "output": {
  15005. "type": "object",
  15006. "properties": {
  15007. "text": {
  15008. "type": "boolean"
  15009. },
  15010. "audio": {
  15011. "type": "boolean"
  15012. },
  15013. "image": {
  15014. "type": "boolean"
  15015. },
  15016. "video": {
  15017. "type": "boolean"
  15018. },
  15019. "pdf": {
  15020. "type": "boolean"
  15021. }
  15022. },
  15023. "required": ["text", "audio", "image", "video", "pdf"]
  15024. },
  15025. "interleaved": {
  15026. "anyOf": [
  15027. {
  15028. "type": "boolean"
  15029. },
  15030. {
  15031. "type": "object",
  15032. "properties": {
  15033. "field": {
  15034. "type": "string",
  15035. "enum": ["reasoning_content", "reasoning_details"]
  15036. }
  15037. },
  15038. "required": ["field"]
  15039. }
  15040. ]
  15041. }
  15042. },
  15043. "required": ["temperature", "reasoning", "attachment", "toolcall", "input", "output", "interleaved"]
  15044. },
  15045. "cost": {
  15046. "type": "object",
  15047. "properties": {
  15048. "input": {
  15049. "type": "number"
  15050. },
  15051. "output": {
  15052. "type": "number"
  15053. },
  15054. "cache": {
  15055. "type": "object",
  15056. "properties": {
  15057. "read": {
  15058. "type": "number"
  15059. },
  15060. "write": {
  15061. "type": "number"
  15062. }
  15063. },
  15064. "required": ["read", "write"]
  15065. },
  15066. "experimentalOver200K": {
  15067. "type": "object",
  15068. "properties": {
  15069. "input": {
  15070. "type": "number"
  15071. },
  15072. "output": {
  15073. "type": "number"
  15074. },
  15075. "cache": {
  15076. "type": "object",
  15077. "properties": {
  15078. "read": {
  15079. "type": "number"
  15080. },
  15081. "write": {
  15082. "type": "number"
  15083. }
  15084. },
  15085. "required": ["read", "write"]
  15086. }
  15087. },
  15088. "required": ["input", "output", "cache"]
  15089. }
  15090. },
  15091. "required": ["input", "output", "cache"]
  15092. },
  15093. "limit": {
  15094. "type": "object",
  15095. "properties": {
  15096. "context": {
  15097. "type": "number"
  15098. },
  15099. "input": {
  15100. "type": "number"
  15101. },
  15102. "output": {
  15103. "type": "number"
  15104. }
  15105. },
  15106. "required": ["context", "output"]
  15107. },
  15108. "status": {
  15109. "type": "string",
  15110. "enum": ["alpha", "beta", "deprecated", "active"]
  15111. },
  15112. "options": {
  15113. "type": "object",
  15114. "propertyNames": {
  15115. "type": "string"
  15116. },
  15117. "additionalProperties": {}
  15118. },
  15119. "headers": {
  15120. "type": "object",
  15121. "propertyNames": {
  15122. "type": "string"
  15123. },
  15124. "additionalProperties": {
  15125. "type": "string"
  15126. }
  15127. },
  15128. "release_date": {
  15129. "type": "string"
  15130. },
  15131. "variants": {
  15132. "type": "object",
  15133. "propertyNames": {
  15134. "type": "string"
  15135. },
  15136. "additionalProperties": {
  15137. "type": "object",
  15138. "propertyNames": {
  15139. "type": "string"
  15140. },
  15141. "additionalProperties": {}
  15142. }
  15143. }
  15144. },
  15145. "required": [
  15146. "id",
  15147. "providerID",
  15148. "api",
  15149. "name",
  15150. "capabilities",
  15151. "cost",
  15152. "limit",
  15153. "status",
  15154. "options",
  15155. "headers",
  15156. "release_date"
  15157. ]
  15158. },
  15159. "Provider": {
  15160. "type": "object",
  15161. "properties": {
  15162. "id": {
  15163. "type": "string"
  15164. },
  15165. "name": {
  15166. "type": "string"
  15167. },
  15168. "source": {
  15169. "type": "string",
  15170. "enum": ["env", "config", "custom", "api"]
  15171. },
  15172. "env": {
  15173. "type": "array",
  15174. "items": {
  15175. "type": "string"
  15176. }
  15177. },
  15178. "key": {
  15179. "type": "string"
  15180. },
  15181. "options": {
  15182. "type": "object",
  15183. "propertyNames": {
  15184. "type": "string"
  15185. },
  15186. "additionalProperties": {}
  15187. },
  15188. "models": {
  15189. "type": "object",
  15190. "propertyNames": {
  15191. "type": "string"
  15192. },
  15193. "additionalProperties": {
  15194. "$ref": "#/components/schemas/Model"
  15195. }
  15196. }
  15197. },
  15198. "required": ["id", "name", "source", "env", "options", "models"]
  15199. },
  15200. "ConsoleState": {
  15201. "type": "object",
  15202. "properties": {
  15203. "consoleManagedProviders": {
  15204. "type": "array",
  15205. "items": {
  15206. "type": "string"
  15207. }
  15208. },
  15209. "activeOrgName": {
  15210. "type": "string"
  15211. },
  15212. "switchableOrgCount": {
  15213. "type": "integer",
  15214. "minimum": 0,
  15215. "maximum": 9007199254740991
  15216. }
  15217. },
  15218. "required": ["consoleManagedProviders", "switchableOrgCount"]
  15219. },
  15220. "ToolIDs": {
  15221. "type": "array",
  15222. "items": {
  15223. "type": "string"
  15224. }
  15225. },
  15226. "ToolListItem": {
  15227. "type": "object",
  15228. "properties": {
  15229. "id": {
  15230. "type": "string"
  15231. },
  15232. "description": {
  15233. "type": "string"
  15234. },
  15235. "parameters": {}
  15236. },
  15237. "required": ["id", "description", "parameters"]
  15238. },
  15239. "ToolList": {
  15240. "type": "array",
  15241. "items": {
  15242. "$ref": "#/components/schemas/ToolListItem"
  15243. }
  15244. },
  15245. "Worktree": {
  15246. "type": "object",
  15247. "properties": {
  15248. "name": {
  15249. "type": "string"
  15250. },
  15251. "branch": {
  15252. "type": "string"
  15253. },
  15254. "directory": {
  15255. "type": "string"
  15256. }
  15257. },
  15258. "required": ["name", "branch", "directory"]
  15259. },
  15260. "WorktreeCreateInput": {
  15261. "type": "object",
  15262. "properties": {
  15263. "name": {
  15264. "type": "string"
  15265. },
  15266. "startCommand": {
  15267. "description": "Additional startup script to run after the project's start command",
  15268. "type": "string"
  15269. }
  15270. }
  15271. },
  15272. "WorktreeRemoveInput": {
  15273. "type": "object",
  15274. "properties": {
  15275. "directory": {
  15276. "type": "string"
  15277. }
  15278. },
  15279. "required": ["directory"]
  15280. },
  15281. "WorktreeResetInput": {
  15282. "type": "object",
  15283. "properties": {
  15284. "directory": {
  15285. "type": "string"
  15286. }
  15287. },
  15288. "required": ["directory"]
  15289. },
  15290. "ProjectSummary": {
  15291. "type": "object",
  15292. "properties": {
  15293. "id": {
  15294. "type": "string"
  15295. },
  15296. "name": {
  15297. "type": "string"
  15298. },
  15299. "worktree": {
  15300. "type": "string"
  15301. }
  15302. },
  15303. "required": ["id", "worktree"]
  15304. },
  15305. "GlobalSession": {
  15306. "type": "object",
  15307. "properties": {
  15308. "id": {
  15309. "type": "string",
  15310. "pattern": "^ses.*"
  15311. },
  15312. "slug": {
  15313. "type": "string"
  15314. },
  15315. "projectID": {
  15316. "type": "string"
  15317. },
  15318. "workspaceID": {
  15319. "type": "string",
  15320. "pattern": "^wrk.*"
  15321. },
  15322. "directory": {
  15323. "type": "string"
  15324. },
  15325. "path": {
  15326. "type": "string"
  15327. },
  15328. "parentID": {
  15329. "type": "string",
  15330. "pattern": "^ses.*"
  15331. },
  15332. "summary": {
  15333. "type": "object",
  15334. "properties": {
  15335. "additions": {
  15336. "type": "integer",
  15337. "minimum": 0,
  15338. "maximum": 9007199254740991
  15339. },
  15340. "deletions": {
  15341. "type": "integer",
  15342. "minimum": 0,
  15343. "maximum": 9007199254740991
  15344. },
  15345. "files": {
  15346. "type": "integer",
  15347. "minimum": 0,
  15348. "maximum": 9007199254740991
  15349. },
  15350. "diffs": {
  15351. "type": "array",
  15352. "items": {
  15353. "$ref": "#/components/schemas/SnapshotFileDiff"
  15354. }
  15355. }
  15356. },
  15357. "required": ["additions", "deletions", "files"]
  15358. },
  15359. "share": {
  15360. "type": "object",
  15361. "properties": {
  15362. "url": {
  15363. "type": "string"
  15364. }
  15365. },
  15366. "required": ["url"]
  15367. },
  15368. "title": {
  15369. "type": "string"
  15370. },
  15371. "agent": {
  15372. "type": "string"
  15373. },
  15374. "model": {
  15375. "type": "object",
  15376. "properties": {
  15377. "id": {
  15378. "type": "string"
  15379. },
  15380. "providerID": {
  15381. "type": "string"
  15382. },
  15383. "variant": {
  15384. "type": "string"
  15385. }
  15386. },
  15387. "required": ["id", "providerID"]
  15388. },
  15389. "version": {
  15390. "type": "string"
  15391. },
  15392. "time": {
  15393. "type": "object",
  15394. "properties": {
  15395. "created": {
  15396. "type": "integer",
  15397. "minimum": 0,
  15398. "maximum": 9007199254740991
  15399. },
  15400. "updated": {
  15401. "type": "integer",
  15402. "minimum": 0,
  15403. "maximum": 9007199254740991
  15404. },
  15405. "compacting": {
  15406. "type": "integer",
  15407. "minimum": 0,
  15408. "maximum": 9007199254740991
  15409. },
  15410. "archived": {
  15411. "type": "number"
  15412. }
  15413. },
  15414. "required": ["created", "updated"]
  15415. },
  15416. "permission": {
  15417. "$ref": "#/components/schemas/PermissionRuleset"
  15418. },
  15419. "revert": {
  15420. "type": "object",
  15421. "properties": {
  15422. "messageID": {
  15423. "type": "string",
  15424. "pattern": "^msg.*"
  15425. },
  15426. "partID": {
  15427. "type": "string",
  15428. "pattern": "^prt.*"
  15429. },
  15430. "snapshot": {
  15431. "type": "string"
  15432. },
  15433. "diff": {
  15434. "type": "string"
  15435. }
  15436. },
  15437. "required": ["messageID"]
  15438. },
  15439. "project": {
  15440. "anyOf": [
  15441. {
  15442. "$ref": "#/components/schemas/ProjectSummary"
  15443. },
  15444. {
  15445. "type": "null"
  15446. }
  15447. ]
  15448. }
  15449. },
  15450. "required": ["id", "slug", "projectID", "directory", "title", "version", "time", "project"]
  15451. },
  15452. "McpResource": {
  15453. "type": "object",
  15454. "properties": {
  15455. "name": {
  15456. "type": "string"
  15457. },
  15458. "uri": {
  15459. "type": "string"
  15460. },
  15461. "description": {
  15462. "type": "string"
  15463. },
  15464. "mimeType": {
  15465. "type": "string"
  15466. },
  15467. "client": {
  15468. "type": "string"
  15469. }
  15470. },
  15471. "required": ["name", "uri", "client"]
  15472. },
  15473. "TextPartInput": {
  15474. "type": "object",
  15475. "properties": {
  15476. "id": {
  15477. "type": "string",
  15478. "pattern": "^prt.*"
  15479. },
  15480. "type": {
  15481. "type": "string",
  15482. "const": "text"
  15483. },
  15484. "text": {
  15485. "type": "string"
  15486. },
  15487. "synthetic": {
  15488. "type": "boolean"
  15489. },
  15490. "ignored": {
  15491. "type": "boolean"
  15492. },
  15493. "time": {
  15494. "type": "object",
  15495. "properties": {
  15496. "start": {
  15497. "type": "integer",
  15498. "minimum": 0,
  15499. "maximum": 9007199254740991
  15500. },
  15501. "end": {
  15502. "type": "integer",
  15503. "minimum": 0,
  15504. "maximum": 9007199254740991
  15505. }
  15506. },
  15507. "required": ["start"]
  15508. },
  15509. "metadata": {
  15510. "type": "object",
  15511. "propertyNames": {
  15512. "type": "string"
  15513. },
  15514. "additionalProperties": {}
  15515. }
  15516. },
  15517. "required": ["type", "text"]
  15518. },
  15519. "FilePartInput": {
  15520. "type": "object",
  15521. "properties": {
  15522. "id": {
  15523. "type": "string",
  15524. "pattern": "^prt.*"
  15525. },
  15526. "type": {
  15527. "type": "string",
  15528. "const": "file"
  15529. },
  15530. "mime": {
  15531. "type": "string"
  15532. },
  15533. "filename": {
  15534. "type": "string"
  15535. },
  15536. "url": {
  15537. "type": "string"
  15538. },
  15539. "source": {
  15540. "$ref": "#/components/schemas/FilePartSource"
  15541. }
  15542. },
  15543. "required": ["type", "mime", "url"]
  15544. },
  15545. "AgentPartInput": {
  15546. "type": "object",
  15547. "properties": {
  15548. "id": {
  15549. "type": "string",
  15550. "pattern": "^prt.*"
  15551. },
  15552. "type": {
  15553. "type": "string",
  15554. "const": "agent"
  15555. },
  15556. "name": {
  15557. "type": "string"
  15558. },
  15559. "source": {
  15560. "type": "object",
  15561. "properties": {
  15562. "value": {
  15563. "type": "string"
  15564. },
  15565. "start": {
  15566. "type": "integer",
  15567. "minimum": 0,
  15568. "maximum": 9007199254740991
  15569. },
  15570. "end": {
  15571. "type": "integer",
  15572. "minimum": 0,
  15573. "maximum": 9007199254740991
  15574. }
  15575. },
  15576. "required": ["value", "start", "end"]
  15577. }
  15578. },
  15579. "required": ["type", "name"]
  15580. },
  15581. "SubtaskPartInput": {
  15582. "type": "object",
  15583. "properties": {
  15584. "id": {
  15585. "type": "string",
  15586. "pattern": "^prt.*"
  15587. },
  15588. "type": {
  15589. "type": "string",
  15590. "const": "subtask"
  15591. },
  15592. "prompt": {
  15593. "type": "string"
  15594. },
  15595. "description": {
  15596. "type": "string"
  15597. },
  15598. "agent": {
  15599. "type": "string"
  15600. },
  15601. "model": {
  15602. "type": "object",
  15603. "properties": {
  15604. "providerID": {
  15605. "type": "string"
  15606. },
  15607. "modelID": {
  15608. "type": "string"
  15609. }
  15610. },
  15611. "required": ["providerID", "modelID"]
  15612. },
  15613. "command": {
  15614. "type": "string"
  15615. }
  15616. },
  15617. "required": ["type", "prompt", "description", "agent"]
  15618. },
  15619. "ProviderAuthMethod": {
  15620. "type": "object",
  15621. "properties": {
  15622. "type": {
  15623. "type": "string",
  15624. "enum": ["oauth", "api"]
  15625. },
  15626. "label": {
  15627. "type": "string"
  15628. },
  15629. "prompts": {
  15630. "type": "array",
  15631. "items": {
  15632. "anyOf": [
  15633. {
  15634. "type": "object",
  15635. "properties": {
  15636. "type": {
  15637. "type": "string",
  15638. "const": "text"
  15639. },
  15640. "key": {
  15641. "type": "string"
  15642. },
  15643. "message": {
  15644. "type": "string"
  15645. },
  15646. "placeholder": {
  15647. "type": "string"
  15648. },
  15649. "when": {
  15650. "type": "object",
  15651. "properties": {
  15652. "key": {
  15653. "type": "string"
  15654. },
  15655. "op": {
  15656. "type": "string",
  15657. "enum": ["eq", "neq"]
  15658. },
  15659. "value": {
  15660. "type": "string"
  15661. }
  15662. },
  15663. "required": ["key", "op", "value"]
  15664. }
  15665. },
  15666. "required": ["type", "key", "message"]
  15667. },
  15668. {
  15669. "type": "object",
  15670. "properties": {
  15671. "type": {
  15672. "type": "string",
  15673. "const": "select"
  15674. },
  15675. "key": {
  15676. "type": "string"
  15677. },
  15678. "message": {
  15679. "type": "string"
  15680. },
  15681. "options": {
  15682. "type": "array",
  15683. "items": {
  15684. "type": "object",
  15685. "properties": {
  15686. "label": {
  15687. "type": "string"
  15688. },
  15689. "value": {
  15690. "type": "string"
  15691. },
  15692. "hint": {
  15693. "type": "string"
  15694. }
  15695. },
  15696. "required": ["label", "value"]
  15697. }
  15698. },
  15699. "when": {
  15700. "type": "object",
  15701. "properties": {
  15702. "key": {
  15703. "type": "string"
  15704. },
  15705. "op": {
  15706. "type": "string",
  15707. "enum": ["eq", "neq"]
  15708. },
  15709. "value": {
  15710. "type": "string"
  15711. }
  15712. },
  15713. "required": ["key", "op", "value"]
  15714. }
  15715. },
  15716. "required": ["type", "key", "message", "options"]
  15717. }
  15718. ]
  15719. }
  15720. }
  15721. },
  15722. "required": ["type", "label"]
  15723. },
  15724. "ProviderAuthAuthorization": {
  15725. "type": "object",
  15726. "properties": {
  15727. "url": {
  15728. "type": "string"
  15729. },
  15730. "method": {
  15731. "type": "string",
  15732. "enum": ["auto", "code"]
  15733. },
  15734. "instructions": {
  15735. "type": "string"
  15736. }
  15737. },
  15738. "required": ["url", "method", "instructions"]
  15739. },
  15740. "Symbol": {
  15741. "type": "object",
  15742. "properties": {
  15743. "name": {
  15744. "type": "string"
  15745. },
  15746. "kind": {
  15747. "type": "integer",
  15748. "minimum": 0,
  15749. "maximum": 9007199254740991
  15750. },
  15751. "location": {
  15752. "type": "object",
  15753. "properties": {
  15754. "uri": {
  15755. "type": "string"
  15756. },
  15757. "range": {
  15758. "$ref": "#/components/schemas/Range"
  15759. }
  15760. },
  15761. "required": ["uri", "range"]
  15762. }
  15763. },
  15764. "required": ["name", "kind", "location"]
  15765. },
  15766. "FileNode": {
  15767. "type": "object",
  15768. "properties": {
  15769. "name": {
  15770. "type": "string"
  15771. },
  15772. "path": {
  15773. "type": "string"
  15774. },
  15775. "absolute": {
  15776. "type": "string"
  15777. },
  15778. "type": {
  15779. "type": "string",
  15780. "enum": ["file", "directory"]
  15781. },
  15782. "ignored": {
  15783. "type": "boolean"
  15784. }
  15785. },
  15786. "required": ["name", "path", "absolute", "type", "ignored"]
  15787. },
  15788. "FileContent": {
  15789. "type": "object",
  15790. "properties": {
  15791. "type": {
  15792. "type": "string",
  15793. "enum": ["text", "binary"]
  15794. },
  15795. "content": {
  15796. "type": "string"
  15797. },
  15798. "diff": {
  15799. "type": "string"
  15800. },
  15801. "patch": {
  15802. "type": "object",
  15803. "properties": {
  15804. "oldFileName": {
  15805. "type": "string"
  15806. },
  15807. "newFileName": {
  15808. "type": "string"
  15809. },
  15810. "oldHeader": {
  15811. "type": "string"
  15812. },
  15813. "newHeader": {
  15814. "type": "string"
  15815. },
  15816. "hunks": {
  15817. "type": "array",
  15818. "items": {
  15819. "type": "object",
  15820. "properties": {
  15821. "oldStart": {
  15822. "type": "integer",
  15823. "minimum": 0,
  15824. "maximum": 9007199254740991
  15825. },
  15826. "oldLines": {
  15827. "type": "integer",
  15828. "minimum": 0,
  15829. "maximum": 9007199254740991
  15830. },
  15831. "newStart": {
  15832. "type": "integer",
  15833. "minimum": 0,
  15834. "maximum": 9007199254740991
  15835. },
  15836. "newLines": {
  15837. "type": "integer",
  15838. "minimum": 0,
  15839. "maximum": 9007199254740991
  15840. },
  15841. "lines": {
  15842. "type": "array",
  15843. "items": {
  15844. "type": "string"
  15845. }
  15846. }
  15847. },
  15848. "required": ["oldStart", "oldLines", "newStart", "newLines", "lines"]
  15849. }
  15850. },
  15851. "index": {
  15852. "type": "string"
  15853. }
  15854. },
  15855. "required": ["oldFileName", "newFileName", "hunks"]
  15856. },
  15857. "encoding": {
  15858. "type": "string",
  15859. "const": "base64"
  15860. },
  15861. "mimeType": {
  15862. "type": "string"
  15863. }
  15864. },
  15865. "required": ["type", "content"]
  15866. },
  15867. "File": {
  15868. "type": "object",
  15869. "properties": {
  15870. "path": {
  15871. "type": "string"
  15872. },
  15873. "added": {
  15874. "type": "integer",
  15875. "minimum": 0,
  15876. "maximum": 9007199254740991
  15877. },
  15878. "removed": {
  15879. "type": "integer",
  15880. "minimum": 0,
  15881. "maximum": 9007199254740991
  15882. },
  15883. "status": {
  15884. "type": "string",
  15885. "enum": ["added", "deleted", "modified"]
  15886. }
  15887. },
  15888. "required": ["path", "added", "removed", "status"]
  15889. },
  15890. "Event": {
  15891. "anyOf": [
  15892. {
  15893. "$ref": "#/components/schemas/Event.server.instance.disposed"
  15894. },
  15895. {
  15896. "$ref": "#/components/schemas/Event.file.edited"
  15897. },
  15898. {
  15899. "$ref": "#/components/schemas/Event.file.watcher.updated"
  15900. },
  15901. {
  15902. "$ref": "#/components/schemas/Event.lsp.client.diagnostics"
  15903. },
  15904. {
  15905. "$ref": "#/components/schemas/Event.lsp.updated"
  15906. },
  15907. {
  15908. "$ref": "#/components/schemas/Event.message.part.delta"
  15909. },
  15910. {
  15911. "$ref": "#/components/schemas/Event.permission.asked"
  15912. },
  15913. {
  15914. "$ref": "#/components/schemas/Event.permission.replied"
  15915. },
  15916. {
  15917. "$ref": "#/components/schemas/Event.session.diff"
  15918. },
  15919. {
  15920. "$ref": "#/components/schemas/Event.session.error"
  15921. },
  15922. {
  15923. "$ref": "#/components/schemas/Event.installation.updated"
  15924. },
  15925. {
  15926. "$ref": "#/components/schemas/Event.installation.update-available"
  15927. },
  15928. {
  15929. "$ref": "#/components/schemas/Event.question.asked"
  15930. },
  15931. {
  15932. "$ref": "#/components/schemas/Event.question.replied"
  15933. },
  15934. {
  15935. "$ref": "#/components/schemas/Event.question.rejected"
  15936. },
  15937. {
  15938. "$ref": "#/components/schemas/Event.todo.updated"
  15939. },
  15940. {
  15941. "$ref": "#/components/schemas/Event.session.status"
  15942. },
  15943. {
  15944. "$ref": "#/components/schemas/Event.session.idle"
  15945. },
  15946. {
  15947. "$ref": "#/components/schemas/Event.session.compacted"
  15948. },
  15949. {
  15950. "$ref": "#/components/schemas/Event.tui.prompt.append"
  15951. },
  15952. {
  15953. "$ref": "#/components/schemas/Event.tui.command.execute"
  15954. },
  15955. {
  15956. "$ref": "#/components/schemas/Event.tui.toast.show"
  15957. },
  15958. {
  15959. "$ref": "#/components/schemas/Event.tui.session.select"
  15960. },
  15961. {
  15962. "$ref": "#/components/schemas/Event.mcp.tools.changed"
  15963. },
  15964. {
  15965. "$ref": "#/components/schemas/Event.mcp.browser.open.failed"
  15966. },
  15967. {
  15968. "$ref": "#/components/schemas/Event.command.executed"
  15969. },
  15970. {
  15971. "$ref": "#/components/schemas/Event.project.updated"
  15972. },
  15973. {
  15974. "$ref": "#/components/schemas/Event.vcs.branch.updated"
  15975. },
  15976. {
  15977. "$ref": "#/components/schemas/Event.workspace.ready"
  15978. },
  15979. {
  15980. "$ref": "#/components/schemas/Event.workspace.failed"
  15981. },
  15982. {
  15983. "$ref": "#/components/schemas/Event.workspace.restore"
  15984. },
  15985. {
  15986. "$ref": "#/components/schemas/Event.workspace.status"
  15987. },
  15988. {
  15989. "$ref": "#/components/schemas/Event.worktree.ready"
  15990. },
  15991. {
  15992. "$ref": "#/components/schemas/Event.worktree.failed"
  15993. },
  15994. {
  15995. "$ref": "#/components/schemas/Event.pty.created"
  15996. },
  15997. {
  15998. "$ref": "#/components/schemas/Event.pty.updated"
  15999. },
  16000. {
  16001. "$ref": "#/components/schemas/Event.pty.exited"
  16002. },
  16003. {
  16004. "$ref": "#/components/schemas/Event.pty.deleted"
  16005. },
  16006. {
  16007. "$ref": "#/components/schemas/Event.message.updated"
  16008. },
  16009. {
  16010. "$ref": "#/components/schemas/Event.message.removed"
  16011. },
  16012. {
  16013. "$ref": "#/components/schemas/Event.message.part.updated"
  16014. },
  16015. {
  16016. "$ref": "#/components/schemas/Event.message.part.removed"
  16017. },
  16018. {
  16019. "$ref": "#/components/schemas/Event.session.created"
  16020. },
  16021. {
  16022. "$ref": "#/components/schemas/Event.session.updated"
  16023. },
  16024. {
  16025. "$ref": "#/components/schemas/Event.session.deleted"
  16026. },
  16027. {
  16028. "$ref": "#/components/schemas/Event.session.next.agent.switched"
  16029. },
  16030. {
  16031. "$ref": "#/components/schemas/Event.session.next.model.switched"
  16032. },
  16033. {
  16034. "$ref": "#/components/schemas/Event.session.next.prompted"
  16035. },
  16036. {
  16037. "$ref": "#/components/schemas/Event.session.next.synthetic"
  16038. },
  16039. {
  16040. "$ref": "#/components/schemas/Event.session.next.shell.started"
  16041. },
  16042. {
  16043. "$ref": "#/components/schemas/Event.session.next.shell.ended"
  16044. },
  16045. {
  16046. "$ref": "#/components/schemas/Event.session.next.step.started"
  16047. },
  16048. {
  16049. "$ref": "#/components/schemas/Event.session.next.step.ended"
  16050. },
  16051. {
  16052. "$ref": "#/components/schemas/Event.session.next.text.started"
  16053. },
  16054. {
  16055. "$ref": "#/components/schemas/Event.session.next.text.delta"
  16056. },
  16057. {
  16058. "$ref": "#/components/schemas/Event.session.next.text.ended"
  16059. },
  16060. {
  16061. "$ref": "#/components/schemas/Event.session.next.reasoning.started"
  16062. },
  16063. {
  16064. "$ref": "#/components/schemas/Event.session.next.reasoning.delta"
  16065. },
  16066. {
  16067. "$ref": "#/components/schemas/Event.session.next.reasoning.ended"
  16068. },
  16069. {
  16070. "$ref": "#/components/schemas/Event.session.next.tool.input.started"
  16071. },
  16072. {
  16073. "$ref": "#/components/schemas/Event.session.next.tool.input.delta"
  16074. },
  16075. {
  16076. "$ref": "#/components/schemas/Event.session.next.tool.input.ended"
  16077. },
  16078. {
  16079. "$ref": "#/components/schemas/Event.session.next.tool.called"
  16080. },
  16081. {
  16082. "$ref": "#/components/schemas/Event.session.next.tool.progress"
  16083. },
  16084. {
  16085. "$ref": "#/components/schemas/Event.session.next.tool.success"
  16086. },
  16087. {
  16088. "$ref": "#/components/schemas/Event.session.next.tool.error"
  16089. },
  16090. {
  16091. "$ref": "#/components/schemas/Event.session.next.retried"
  16092. },
  16093. {
  16094. "$ref": "#/components/schemas/Event.session.next.compaction.started"
  16095. },
  16096. {
  16097. "$ref": "#/components/schemas/Event.session.next.compaction.delta"
  16098. },
  16099. {
  16100. "$ref": "#/components/schemas/Event.session.next.compaction.ended"
  16101. },
  16102. {
  16103. "$ref": "#/components/schemas/Event.server.connected"
  16104. },
  16105. {
  16106. "$ref": "#/components/schemas/Event.global.disposed"
  16107. }
  16108. ]
  16109. },
  16110. "MCPStatusConnected": {
  16111. "type": "object",
  16112. "properties": {
  16113. "status": {
  16114. "type": "string",
  16115. "const": "connected"
  16116. }
  16117. },
  16118. "required": ["status"]
  16119. },
  16120. "MCPStatusDisabled": {
  16121. "type": "object",
  16122. "properties": {
  16123. "status": {
  16124. "type": "string",
  16125. "const": "disabled"
  16126. }
  16127. },
  16128. "required": ["status"]
  16129. },
  16130. "MCPStatusFailed": {
  16131. "type": "object",
  16132. "properties": {
  16133. "status": {
  16134. "type": "string",
  16135. "const": "failed"
  16136. },
  16137. "error": {
  16138. "type": "string"
  16139. }
  16140. },
  16141. "required": ["status", "error"]
  16142. },
  16143. "MCPStatusNeedsAuth": {
  16144. "type": "object",
  16145. "properties": {
  16146. "status": {
  16147. "type": "string",
  16148. "const": "needs_auth"
  16149. }
  16150. },
  16151. "required": ["status"]
  16152. },
  16153. "MCPStatusNeedsClientRegistration": {
  16154. "type": "object",
  16155. "properties": {
  16156. "status": {
  16157. "type": "string",
  16158. "const": "needs_client_registration"
  16159. },
  16160. "error": {
  16161. "type": "string"
  16162. }
  16163. },
  16164. "required": ["status", "error"]
  16165. },
  16166. "MCPStatus": {
  16167. "anyOf": [
  16168. {
  16169. "$ref": "#/components/schemas/MCPStatusConnected"
  16170. },
  16171. {
  16172. "$ref": "#/components/schemas/MCPStatusDisabled"
  16173. },
  16174. {
  16175. "$ref": "#/components/schemas/MCPStatusFailed"
  16176. },
  16177. {
  16178. "$ref": "#/components/schemas/MCPStatusNeedsAuth"
  16179. },
  16180. {
  16181. "$ref": "#/components/schemas/MCPStatusNeedsClientRegistration"
  16182. }
  16183. ]
  16184. },
  16185. "McpUnsupportedOAuthError": {
  16186. "type": "object",
  16187. "properties": {
  16188. "error": {
  16189. "type": "string"
  16190. }
  16191. },
  16192. "required": ["error"]
  16193. },
  16194. "Path": {
  16195. "type": "object",
  16196. "properties": {
  16197. "home": {
  16198. "type": "string"
  16199. },
  16200. "state": {
  16201. "type": "string"
  16202. },
  16203. "config": {
  16204. "type": "string"
  16205. },
  16206. "worktree": {
  16207. "type": "string"
  16208. },
  16209. "directory": {
  16210. "type": "string"
  16211. }
  16212. },
  16213. "required": ["home", "state", "config", "worktree", "directory"]
  16214. },
  16215. "VcsInfo": {
  16216. "type": "object",
  16217. "properties": {
  16218. "branch": {
  16219. "type": "string"
  16220. },
  16221. "default_branch": {
  16222. "type": "string"
  16223. }
  16224. }
  16225. },
  16226. "VcsFileDiff": {
  16227. "type": "object",
  16228. "properties": {
  16229. "file": {
  16230. "type": "string"
  16231. },
  16232. "patch": {
  16233. "type": "string"
  16234. },
  16235. "additions": {
  16236. "type": "integer",
  16237. "minimum": 0,
  16238. "maximum": 9007199254740991
  16239. },
  16240. "deletions": {
  16241. "type": "integer",
  16242. "minimum": 0,
  16243. "maximum": 9007199254740991
  16244. },
  16245. "status": {
  16246. "type": "string",
  16247. "enum": ["added", "deleted", "modified"]
  16248. }
  16249. },
  16250. "required": ["file", "patch", "additions", "deletions"]
  16251. },
  16252. "Command": {
  16253. "type": "object",
  16254. "properties": {
  16255. "name": {
  16256. "type": "string"
  16257. },
  16258. "description": {
  16259. "type": "string"
  16260. },
  16261. "agent": {
  16262. "type": "string"
  16263. },
  16264. "model": {
  16265. "type": "string"
  16266. },
  16267. "source": {
  16268. "type": "string",
  16269. "enum": ["command", "mcp", "skill"]
  16270. },
  16271. "template": {
  16272. "anyOf": [
  16273. {
  16274. "type": "string"
  16275. },
  16276. {
  16277. "type": "string"
  16278. }
  16279. ]
  16280. },
  16281. "subtask": {
  16282. "type": "boolean"
  16283. },
  16284. "hints": {
  16285. "type": "array",
  16286. "items": {
  16287. "type": "string"
  16288. }
  16289. }
  16290. },
  16291. "required": ["name", "template", "hints"]
  16292. },
  16293. "Agent": {
  16294. "type": "object",
  16295. "properties": {
  16296. "name": {
  16297. "type": "string"
  16298. },
  16299. "description": {
  16300. "type": "string"
  16301. },
  16302. "mode": {
  16303. "type": "string",
  16304. "enum": ["subagent", "primary", "all"]
  16305. },
  16306. "native": {
  16307. "type": "boolean"
  16308. },
  16309. "hidden": {
  16310. "type": "boolean"
  16311. },
  16312. "topP": {
  16313. "type": "number"
  16314. },
  16315. "temperature": {
  16316. "type": "number"
  16317. },
  16318. "color": {
  16319. "type": "string"
  16320. },
  16321. "permission": {
  16322. "$ref": "#/components/schemas/PermissionRuleset"
  16323. },
  16324. "model": {
  16325. "type": "object",
  16326. "properties": {
  16327. "modelID": {
  16328. "type": "string"
  16329. },
  16330. "providerID": {
  16331. "type": "string"
  16332. }
  16333. },
  16334. "required": ["modelID", "providerID"]
  16335. },
  16336. "variant": {
  16337. "type": "string"
  16338. },
  16339. "prompt": {
  16340. "type": "string"
  16341. },
  16342. "options": {
  16343. "type": "object",
  16344. "propertyNames": {
  16345. "type": "string"
  16346. },
  16347. "additionalProperties": {}
  16348. },
  16349. "steps": {
  16350. "type": "number"
  16351. }
  16352. },
  16353. "required": ["name", "mode", "permission", "options"]
  16354. },
  16355. "LSPStatus": {
  16356. "type": "object",
  16357. "properties": {
  16358. "id": {
  16359. "type": "string"
  16360. },
  16361. "name": {
  16362. "type": "string"
  16363. },
  16364. "root": {
  16365. "type": "string"
  16366. },
  16367. "status": {
  16368. "anyOf": [
  16369. {
  16370. "type": "string",
  16371. "const": "connected"
  16372. },
  16373. {
  16374. "type": "string",
  16375. "const": "error"
  16376. }
  16377. ]
  16378. }
  16379. },
  16380. "required": ["id", "name", "root", "status"]
  16381. },
  16382. "FormatterStatus": {
  16383. "type": "object",
  16384. "properties": {
  16385. "name": {
  16386. "type": "string"
  16387. },
  16388. "extensions": {
  16389. "type": "array",
  16390. "items": {
  16391. "type": "string"
  16392. }
  16393. },
  16394. "enabled": {
  16395. "type": "boolean"
  16396. }
  16397. },
  16398. "required": ["name", "extensions", "enabled"]
  16399. }
  16400. }
  16401. }
  16402. }