openapi.json 783 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678
  1. {
  2. "openapi": "3.1.0",
  3. "info": {
  4. "title": "opencode",
  5. "version": "1.0.0",
  6. "description": "opencode api"
  7. },
  8. "paths": {
  9. "/auth/{providerID}": {
  10. "put": {
  11. "tags": ["control"],
  12. "operationId": "auth.set",
  13. "parameters": [
  14. {
  15. "name": "providerID",
  16. "in": "path",
  17. "schema": {
  18. "type": "string"
  19. },
  20. "required": true
  21. }
  22. ],
  23. "responses": {
  24. "200": {
  25. "description": "Successfully set authentication credentials",
  26. "content": {
  27. "application/json": {
  28. "schema": {
  29. "type": "boolean",
  30. "description": "Successfully set authentication credentials"
  31. }
  32. }
  33. }
  34. },
  35. "400": {
  36. "description": "BadRequest | InvalidRequestError",
  37. "content": {
  38. "application/json": {
  39. "schema": {
  40. "anyOf": [
  41. {
  42. "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
  43. },
  44. {
  45. "$ref": "#/components/schemas/InvalidRequestError"
  46. }
  47. ]
  48. }
  49. }
  50. }
  51. }
  52. },
  53. "description": "Set authentication credentials",
  54. "summary": "Set auth credentials",
  55. "requestBody": {
  56. "content": {
  57. "application/json": {
  58. "schema": {
  59. "$ref": "#/components/schemas/Auth"
  60. }
  61. }
  62. }
  63. },
  64. "x-codeSamples": [
  65. {
  66. "lang": "js",
  67. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.auth.set({\n ...\n})"
  68. }
  69. ]
  70. },
  71. "delete": {
  72. "tags": ["control"],
  73. "operationId": "auth.remove",
  74. "parameters": [
  75. {
  76. "name": "providerID",
  77. "in": "path",
  78. "schema": {
  79. "type": "string"
  80. },
  81. "required": true
  82. }
  83. ],
  84. "responses": {
  85. "200": {
  86. "description": "Successfully removed authentication credentials",
  87. "content": {
  88. "application/json": {
  89. "schema": {
  90. "type": "boolean",
  91. "description": "Successfully removed authentication credentials"
  92. }
  93. }
  94. }
  95. },
  96. "400": {
  97. "description": "BadRequest | InvalidRequestError",
  98. "content": {
  99. "application/json": {
  100. "schema": {
  101. "anyOf": [
  102. {
  103. "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
  104. },
  105. {
  106. "$ref": "#/components/schemas/InvalidRequestError"
  107. }
  108. ]
  109. }
  110. }
  111. }
  112. }
  113. },
  114. "description": "Remove authentication credentials",
  115. "summary": "Remove auth credentials",
  116. "x-codeSamples": [
  117. {
  118. "lang": "js",
  119. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.auth.remove({\n ...\n})"
  120. }
  121. ]
  122. }
  123. },
  124. "/log": {
  125. "post": {
  126. "tags": ["control"],
  127. "operationId": "app.log",
  128. "parameters": [
  129. {
  130. "name": "directory",
  131. "in": "query",
  132. "schema": {
  133. "type": "string"
  134. },
  135. "required": false
  136. },
  137. {
  138. "name": "workspace",
  139. "in": "query",
  140. "schema": {
  141. "type": "string"
  142. },
  143. "required": false
  144. }
  145. ],
  146. "responses": {
  147. "200": {
  148. "description": "Log entry written successfully",
  149. "content": {
  150. "application/json": {
  151. "schema": {
  152. "type": "boolean",
  153. "description": "Log entry written successfully"
  154. }
  155. }
  156. }
  157. },
  158. "400": {
  159. "description": "BadRequest | InvalidRequestError",
  160. "content": {
  161. "application/json": {
  162. "schema": {
  163. "anyOf": [
  164. {
  165. "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
  166. },
  167. {
  168. "$ref": "#/components/schemas/InvalidRequestError"
  169. }
  170. ]
  171. }
  172. }
  173. }
  174. }
  175. },
  176. "description": "Write a log entry to the server logs with specified level and metadata.",
  177. "summary": "Write log",
  178. "requestBody": {
  179. "content": {
  180. "application/json": {
  181. "schema": {
  182. "type": "object",
  183. "properties": {
  184. "service": {
  185. "type": "string",
  186. "description": "Service name for the log entry"
  187. },
  188. "level": {
  189. "type": "string",
  190. "enum": ["debug", "info", "error", "warn"],
  191. "description": "Log level"
  192. },
  193. "message": {
  194. "type": "string",
  195. "description": "Log message"
  196. },
  197. "extra": {
  198. "type": "object"
  199. }
  200. },
  201. "required": ["service", "level", "message"],
  202. "additionalProperties": false
  203. }
  204. }
  205. }
  206. },
  207. "x-codeSamples": [
  208. {
  209. "lang": "js",
  210. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.app.log({\n ...\n})"
  211. }
  212. ]
  213. }
  214. },
  215. "/experimental/control-plane/move-session": {
  216. "post": {
  217. "tags": ["controlPlane"],
  218. "operationId": "experimental.controlPlane.moveSession",
  219. "parameters": [],
  220. "responses": {
  221. "204": {
  222. "description": "Session moved"
  223. },
  224. "400": {
  225. "description": "MoveSessionError | InvalidRequestError",
  226. "content": {
  227. "application/json": {
  228. "schema": {
  229. "anyOf": [
  230. {
  231. "$ref": "#/components/schemas/MoveSessionError"
  232. },
  233. {
  234. "$ref": "#/components/schemas/InvalidRequestError"
  235. }
  236. ]
  237. }
  238. }
  239. }
  240. }
  241. },
  242. "description": "Move a session to another project directory, optionally transferring local changes.",
  243. "summary": "Move session",
  244. "requestBody": {
  245. "content": {
  246. "application/json": {
  247. "schema": {
  248. "type": "object",
  249. "properties": {
  250. "sessionID": {
  251. "type": "string",
  252. "pattern": "^ses"
  253. },
  254. "destination": {
  255. "$ref": "#/components/schemas/MoveSessionDestination"
  256. },
  257. "moveChanges": {
  258. "type": "boolean"
  259. }
  260. },
  261. "required": ["sessionID", "destination"],
  262. "additionalProperties": false
  263. }
  264. }
  265. }
  266. },
  267. "x-codeSamples": [
  268. {
  269. "lang": "js",
  270. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.controlPlane.moveSession({\n ...\n})"
  271. }
  272. ]
  273. }
  274. },
  275. "/global/health": {
  276. "get": {
  277. "tags": ["global"],
  278. "operationId": "global.health",
  279. "parameters": [],
  280. "responses": {
  281. "200": {
  282. "description": "Health information",
  283. "content": {
  284. "application/json": {
  285. "schema": {
  286. "type": "object",
  287. "properties": {
  288. "healthy": {
  289. "type": "boolean",
  290. "enum": [true]
  291. },
  292. "version": {
  293. "type": "string"
  294. }
  295. },
  296. "required": ["healthy", "version"],
  297. "additionalProperties": false,
  298. "description": "Health information"
  299. }
  300. }
  301. }
  302. },
  303. "400": {
  304. "description": "Bad request",
  305. "content": {
  306. "application/json": {
  307. "schema": {
  308. "$ref": "#/components/schemas/BadRequestError"
  309. }
  310. }
  311. }
  312. }
  313. },
  314. "description": "Get health information about the OpenCode server.",
  315. "summary": "Get health",
  316. "x-codeSamples": [
  317. {
  318. "lang": "js",
  319. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.health({\n ...\n})"
  320. }
  321. ]
  322. }
  323. },
  324. "/global/event": {
  325. "get": {
  326. "tags": ["global"],
  327. "operationId": "global.event",
  328. "parameters": [],
  329. "responses": {
  330. "200": {
  331. "description": "Event stream",
  332. "content": {
  333. "text/event-stream": {
  334. "schema": {
  335. "$ref": "#/components/schemas/GlobalEvent"
  336. }
  337. }
  338. }
  339. },
  340. "400": {
  341. "description": "Bad request",
  342. "content": {
  343. "application/json": {
  344. "schema": {
  345. "$ref": "#/components/schemas/BadRequestError"
  346. }
  347. }
  348. }
  349. }
  350. },
  351. "description": "Subscribe to global events from the OpenCode system using server-sent events.",
  352. "summary": "Get global events",
  353. "x-codeSamples": [
  354. {
  355. "lang": "js",
  356. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.event({\n ...\n})"
  357. }
  358. ]
  359. }
  360. },
  361. "/global/config": {
  362. "get": {
  363. "tags": ["global"],
  364. "operationId": "global.config.get",
  365. "parameters": [],
  366. "responses": {
  367. "200": {
  368. "description": "Get global config info",
  369. "content": {
  370. "application/json": {
  371. "schema": {
  372. "$ref": "#/components/schemas/Config"
  373. }
  374. }
  375. }
  376. },
  377. "400": {
  378. "description": "Bad request",
  379. "content": {
  380. "application/json": {
  381. "schema": {
  382. "$ref": "#/components/schemas/BadRequestError"
  383. }
  384. }
  385. }
  386. }
  387. },
  388. "description": "Retrieve the current global OpenCode configuration settings and preferences.",
  389. "summary": "Get global configuration",
  390. "x-codeSamples": [
  391. {
  392. "lang": "js",
  393. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.config.get({\n ...\n})"
  394. }
  395. ]
  396. },
  397. "patch": {
  398. "tags": ["global"],
  399. "operationId": "global.config.update",
  400. "parameters": [],
  401. "responses": {
  402. "200": {
  403. "description": "Successfully updated global config",
  404. "content": {
  405. "application/json": {
  406. "schema": {
  407. "$ref": "#/components/schemas/Config"
  408. }
  409. }
  410. }
  411. },
  412. "400": {
  413. "description": "BadRequest | InvalidRequestError",
  414. "content": {
  415. "application/json": {
  416. "schema": {
  417. "anyOf": [
  418. {
  419. "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
  420. },
  421. {
  422. "$ref": "#/components/schemas/InvalidRequestError"
  423. }
  424. ]
  425. }
  426. }
  427. }
  428. }
  429. },
  430. "description": "Update global OpenCode configuration settings and preferences.",
  431. "summary": "Update global configuration",
  432. "requestBody": {
  433. "content": {
  434. "application/json": {
  435. "schema": {
  436. "$ref": "#/components/schemas/Config"
  437. }
  438. }
  439. }
  440. },
  441. "x-codeSamples": [
  442. {
  443. "lang": "js",
  444. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.config.update({\n ...\n})"
  445. }
  446. ]
  447. }
  448. },
  449. "/global/dispose": {
  450. "post": {
  451. "tags": ["global"],
  452. "operationId": "global.dispose",
  453. "parameters": [],
  454. "responses": {
  455. "200": {
  456. "description": "Global disposed",
  457. "content": {
  458. "application/json": {
  459. "schema": {
  460. "type": "boolean",
  461. "description": "Global disposed"
  462. }
  463. }
  464. }
  465. },
  466. "400": {
  467. "description": "Bad request",
  468. "content": {
  469. "application/json": {
  470. "schema": {
  471. "$ref": "#/components/schemas/BadRequestError"
  472. }
  473. }
  474. }
  475. }
  476. },
  477. "description": "Clean up and dispose all OpenCode instances, releasing all resources.",
  478. "summary": "Dispose instance",
  479. "x-codeSamples": [
  480. {
  481. "lang": "js",
  482. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.dispose({\n ...\n})"
  483. }
  484. ]
  485. }
  486. },
  487. "/global/upgrade": {
  488. "post": {
  489. "tags": ["global"],
  490. "operationId": "global.upgrade",
  491. "parameters": [],
  492. "responses": {
  493. "200": {
  494. "description": "Upgrade result",
  495. "content": {
  496. "application/json": {
  497. "schema": {
  498. "anyOf": [
  499. {
  500. "type": "object",
  501. "properties": {
  502. "success": {
  503. "type": "boolean",
  504. "enum": [true]
  505. },
  506. "version": {
  507. "type": "string"
  508. }
  509. },
  510. "required": ["success", "version"],
  511. "additionalProperties": false
  512. },
  513. {
  514. "type": "object",
  515. "properties": {
  516. "success": {
  517. "type": "boolean",
  518. "enum": [false]
  519. },
  520. "error": {
  521. "type": "string"
  522. }
  523. },
  524. "required": ["success", "error"],
  525. "additionalProperties": false
  526. }
  527. ],
  528. "description": "Upgrade result"
  529. }
  530. }
  531. }
  532. },
  533. "400": {
  534. "description": "BadRequest | InvalidRequestError",
  535. "content": {
  536. "application/json": {
  537. "schema": {
  538. "anyOf": [
  539. {
  540. "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
  541. },
  542. {
  543. "$ref": "#/components/schemas/InvalidRequestError"
  544. }
  545. ]
  546. }
  547. }
  548. }
  549. }
  550. },
  551. "description": "Upgrade opencode to the specified version or latest if not specified.",
  552. "summary": "Upgrade opencode",
  553. "requestBody": {
  554. "content": {
  555. "application/json": {
  556. "schema": {
  557. "type": "object",
  558. "properties": {
  559. "target": {
  560. "type": "string"
  561. }
  562. },
  563. "additionalProperties": false
  564. }
  565. }
  566. }
  567. },
  568. "x-codeSamples": [
  569. {
  570. "lang": "js",
  571. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.upgrade({\n ...\n})"
  572. }
  573. ]
  574. }
  575. },
  576. "/event": {
  577. "get": {
  578. "tags": ["event"],
  579. "operationId": "event.subscribe",
  580. "parameters": [
  581. {
  582. "name": "directory",
  583. "in": "query",
  584. "schema": {
  585. "type": "string"
  586. },
  587. "required": false
  588. },
  589. {
  590. "name": "workspace",
  591. "in": "query",
  592. "schema": {
  593. "type": "string"
  594. },
  595. "required": false
  596. }
  597. ],
  598. "responses": {
  599. "200": {
  600. "description": "Event stream",
  601. "content": {
  602. "text/event-stream": {
  603. "schema": {
  604. "$ref": "#/components/schemas/Event"
  605. }
  606. }
  607. }
  608. }
  609. },
  610. "description": "Get events",
  611. "summary": "Subscribe to events",
  612. "x-codeSamples": [
  613. {
  614. "lang": "js",
  615. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.event.subscribe({\n ...\n})"
  616. }
  617. ]
  618. }
  619. },
  620. "/config": {
  621. "get": {
  622. "tags": ["config"],
  623. "operationId": "config.get",
  624. "parameters": [
  625. {
  626. "name": "directory",
  627. "in": "query",
  628. "schema": {
  629. "type": "string"
  630. },
  631. "required": false
  632. },
  633. {
  634. "name": "workspace",
  635. "in": "query",
  636. "schema": {
  637. "type": "string"
  638. },
  639. "required": false
  640. }
  641. ],
  642. "responses": {
  643. "200": {
  644. "description": "Get config info",
  645. "content": {
  646. "application/json": {
  647. "schema": {
  648. "$ref": "#/components/schemas/Config"
  649. }
  650. }
  651. }
  652. },
  653. "400": {
  654. "description": "Bad request",
  655. "content": {
  656. "application/json": {
  657. "schema": {
  658. "$ref": "#/components/schemas/BadRequestError"
  659. }
  660. }
  661. }
  662. }
  663. },
  664. "description": "Retrieve the current OpenCode configuration settings and preferences.",
  665. "summary": "Get configuration",
  666. "x-codeSamples": [
  667. {
  668. "lang": "js",
  669. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.config.get({\n ...\n})"
  670. }
  671. ]
  672. },
  673. "patch": {
  674. "tags": ["config"],
  675. "operationId": "config.update",
  676. "parameters": [
  677. {
  678. "name": "directory",
  679. "in": "query",
  680. "schema": {
  681. "type": "string"
  682. },
  683. "required": false
  684. },
  685. {
  686. "name": "workspace",
  687. "in": "query",
  688. "schema": {
  689. "type": "string"
  690. },
  691. "required": false
  692. }
  693. ],
  694. "responses": {
  695. "200": {
  696. "description": "Successfully updated config",
  697. "content": {
  698. "application/json": {
  699. "schema": {
  700. "$ref": "#/components/schemas/Config"
  701. }
  702. }
  703. }
  704. },
  705. "400": {
  706. "description": "BadRequest | InvalidRequestError",
  707. "content": {
  708. "application/json": {
  709. "schema": {
  710. "anyOf": [
  711. {
  712. "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
  713. },
  714. {
  715. "$ref": "#/components/schemas/InvalidRequestError"
  716. }
  717. ]
  718. }
  719. }
  720. }
  721. }
  722. },
  723. "description": "Update OpenCode configuration settings and preferences.",
  724. "summary": "Update configuration",
  725. "requestBody": {
  726. "content": {
  727. "application/json": {
  728. "schema": {
  729. "$ref": "#/components/schemas/Config"
  730. }
  731. }
  732. }
  733. },
  734. "x-codeSamples": [
  735. {
  736. "lang": "js",
  737. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.config.update({\n ...\n})"
  738. }
  739. ]
  740. }
  741. },
  742. "/config/providers": {
  743. "get": {
  744. "tags": ["config"],
  745. "operationId": "config.providers",
  746. "parameters": [
  747. {
  748. "name": "directory",
  749. "in": "query",
  750. "schema": {
  751. "type": "string"
  752. },
  753. "required": false
  754. },
  755. {
  756. "name": "workspace",
  757. "in": "query",
  758. "schema": {
  759. "type": "string"
  760. },
  761. "required": false
  762. }
  763. ],
  764. "responses": {
  765. "200": {
  766. "description": "List of providers",
  767. "content": {
  768. "application/json": {
  769. "schema": {
  770. "type": "object",
  771. "properties": {
  772. "providers": {
  773. "type": "array",
  774. "items": {
  775. "$ref": "#/components/schemas/Provider"
  776. }
  777. },
  778. "default": {
  779. "type": "object",
  780. "additionalProperties": {
  781. "type": "string"
  782. }
  783. }
  784. },
  785. "required": ["providers", "default"],
  786. "additionalProperties": false,
  787. "description": "List of providers"
  788. }
  789. }
  790. }
  791. },
  792. "400": {
  793. "description": "Bad request",
  794. "content": {
  795. "application/json": {
  796. "schema": {
  797. "$ref": "#/components/schemas/BadRequestError"
  798. }
  799. }
  800. }
  801. }
  802. },
  803. "description": "Get a list of all configured AI providers and their default models.",
  804. "summary": "List config providers",
  805. "x-codeSamples": [
  806. {
  807. "lang": "js",
  808. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.config.providers({\n ...\n})"
  809. }
  810. ]
  811. }
  812. },
  813. "/experimental/console": {
  814. "get": {
  815. "tags": ["experimental"],
  816. "operationId": "experimental.console.get",
  817. "parameters": [
  818. {
  819. "name": "directory",
  820. "in": "query",
  821. "schema": {
  822. "type": "string"
  823. },
  824. "required": false
  825. },
  826. {
  827. "name": "workspace",
  828. "in": "query",
  829. "schema": {
  830. "type": "string"
  831. },
  832. "required": false
  833. }
  834. ],
  835. "responses": {
  836. "200": {
  837. "description": "Active Console provider metadata",
  838. "content": {
  839. "application/json": {
  840. "schema": {
  841. "$ref": "#/components/schemas/ConsoleState"
  842. }
  843. }
  844. }
  845. },
  846. "400": {
  847. "description": "Bad request",
  848. "content": {
  849. "application/json": {
  850. "schema": {
  851. "$ref": "#/components/schemas/BadRequestError"
  852. }
  853. }
  854. }
  855. },
  856. "500": {
  857. "description": "InternalServerError",
  858. "content": {
  859. "application/json": {
  860. "schema": {
  861. "$ref": "#/components/schemas/effect_HttpApiError_InternalServerError"
  862. }
  863. }
  864. }
  865. }
  866. },
  867. "description": "Get the active Console org name and the set of provider IDs managed by that Console org.",
  868. "summary": "Get active Console provider metadata",
  869. "x-codeSamples": [
  870. {
  871. "lang": "js",
  872. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.console.get({\n ...\n})"
  873. }
  874. ]
  875. }
  876. },
  877. "/experimental/console/orgs": {
  878. "get": {
  879. "tags": ["experimental"],
  880. "operationId": "experimental.console.listOrgs",
  881. "parameters": [
  882. {
  883. "name": "directory",
  884. "in": "query",
  885. "schema": {
  886. "type": "string"
  887. },
  888. "required": false
  889. },
  890. {
  891. "name": "workspace",
  892. "in": "query",
  893. "schema": {
  894. "type": "string"
  895. },
  896. "required": false
  897. }
  898. ],
  899. "responses": {
  900. "200": {
  901. "description": "Switchable Console orgs",
  902. "content": {
  903. "application/json": {
  904. "schema": {
  905. "type": "object",
  906. "properties": {
  907. "orgs": {
  908. "type": "array",
  909. "items": {
  910. "type": "object",
  911. "properties": {
  912. "accountID": {
  913. "type": "string"
  914. },
  915. "accountEmail": {
  916. "type": "string"
  917. },
  918. "accountUrl": {
  919. "type": "string"
  920. },
  921. "orgID": {
  922. "type": "string"
  923. },
  924. "orgName": {
  925. "type": "string"
  926. },
  927. "active": {
  928. "type": "boolean"
  929. }
  930. },
  931. "required": ["accountID", "accountEmail", "accountUrl", "orgID", "orgName", "active"],
  932. "additionalProperties": false
  933. }
  934. }
  935. },
  936. "required": ["orgs"],
  937. "additionalProperties": false,
  938. "description": "Switchable Console orgs"
  939. }
  940. }
  941. }
  942. },
  943. "400": {
  944. "description": "Bad request",
  945. "content": {
  946. "application/json": {
  947. "schema": {
  948. "$ref": "#/components/schemas/BadRequestError"
  949. }
  950. }
  951. }
  952. },
  953. "500": {
  954. "description": "InternalServerError",
  955. "content": {
  956. "application/json": {
  957. "schema": {
  958. "$ref": "#/components/schemas/effect_HttpApiError_InternalServerError"
  959. }
  960. }
  961. }
  962. }
  963. },
  964. "description": "Get the available Console orgs across logged-in accounts, including the current active org.",
  965. "summary": "List switchable Console orgs",
  966. "x-codeSamples": [
  967. {
  968. "lang": "js",
  969. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.console.listOrgs({\n ...\n})"
  970. }
  971. ]
  972. }
  973. },
  974. "/experimental/console/switch": {
  975. "post": {
  976. "tags": ["experimental"],
  977. "operationId": "experimental.console.switchOrg",
  978. "parameters": [
  979. {
  980. "name": "directory",
  981. "in": "query",
  982. "schema": {
  983. "type": "string"
  984. },
  985. "required": false
  986. },
  987. {
  988. "name": "workspace",
  989. "in": "query",
  990. "schema": {
  991. "type": "string"
  992. },
  993. "required": false
  994. }
  995. ],
  996. "responses": {
  997. "200": {
  998. "description": "Switch success",
  999. "content": {
  1000. "application/json": {
  1001. "schema": {
  1002. "type": "boolean",
  1003. "description": "Switch success"
  1004. }
  1005. }
  1006. }
  1007. }
  1008. },
  1009. "description": "Persist a new active Console account/org selection for the current local OpenCode state.",
  1010. "summary": "Switch active Console org",
  1011. "requestBody": {
  1012. "content": {
  1013. "application/json": {
  1014. "schema": {
  1015. "type": "object",
  1016. "properties": {
  1017. "accountID": {
  1018. "type": "string"
  1019. },
  1020. "orgID": {
  1021. "type": "string"
  1022. }
  1023. },
  1024. "required": ["accountID", "orgID"],
  1025. "additionalProperties": false
  1026. }
  1027. }
  1028. }
  1029. },
  1030. "x-codeSamples": [
  1031. {
  1032. "lang": "js",
  1033. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.console.switchOrg({\n ...\n})"
  1034. }
  1035. ]
  1036. }
  1037. },
  1038. "/experimental/tool": {
  1039. "get": {
  1040. "tags": ["experimental"],
  1041. "operationId": "tool.list",
  1042. "parameters": [
  1043. {
  1044. "name": "directory",
  1045. "in": "query",
  1046. "schema": {
  1047. "type": "string"
  1048. },
  1049. "required": false
  1050. },
  1051. {
  1052. "name": "workspace",
  1053. "in": "query",
  1054. "schema": {
  1055. "type": "string"
  1056. },
  1057. "required": false
  1058. },
  1059. {
  1060. "name": "provider",
  1061. "in": "query",
  1062. "schema": {
  1063. "type": "string"
  1064. },
  1065. "required": true
  1066. },
  1067. {
  1068. "name": "model",
  1069. "in": "query",
  1070. "schema": {
  1071. "type": "string"
  1072. },
  1073. "required": true
  1074. }
  1075. ],
  1076. "responses": {
  1077. "200": {
  1078. "description": "Tools",
  1079. "content": {
  1080. "application/json": {
  1081. "schema": {
  1082. "$ref": "#/components/schemas/ToolList"
  1083. }
  1084. }
  1085. }
  1086. },
  1087. "400": {
  1088. "description": "BadRequest | InvalidRequestError",
  1089. "content": {
  1090. "application/json": {
  1091. "schema": {
  1092. "anyOf": [
  1093. {
  1094. "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
  1095. },
  1096. {
  1097. "$ref": "#/components/schemas/InvalidRequestError"
  1098. }
  1099. ]
  1100. }
  1101. }
  1102. }
  1103. }
  1104. },
  1105. "description": "Get a list of available tools with their JSON schema parameters for a specific provider and model combination.",
  1106. "summary": "List tools",
  1107. "x-codeSamples": [
  1108. {
  1109. "lang": "js",
  1110. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tool.list({\n ...\n})"
  1111. }
  1112. ]
  1113. }
  1114. },
  1115. "/experimental/tool/ids": {
  1116. "get": {
  1117. "tags": ["experimental"],
  1118. "operationId": "tool.ids",
  1119. "parameters": [
  1120. {
  1121. "name": "directory",
  1122. "in": "query",
  1123. "schema": {
  1124. "type": "string"
  1125. },
  1126. "required": false
  1127. },
  1128. {
  1129. "name": "workspace",
  1130. "in": "query",
  1131. "schema": {
  1132. "type": "string"
  1133. },
  1134. "required": false
  1135. }
  1136. ],
  1137. "responses": {
  1138. "200": {
  1139. "description": "Tool IDs",
  1140. "content": {
  1141. "application/json": {
  1142. "schema": {
  1143. "$ref": "#/components/schemas/ToolIDs"
  1144. }
  1145. }
  1146. }
  1147. },
  1148. "400": {
  1149. "description": "BadRequest | InvalidRequestError",
  1150. "content": {
  1151. "application/json": {
  1152. "schema": {
  1153. "anyOf": [
  1154. {
  1155. "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
  1156. },
  1157. {
  1158. "$ref": "#/components/schemas/InvalidRequestError"
  1159. }
  1160. ]
  1161. }
  1162. }
  1163. }
  1164. }
  1165. },
  1166. "description": "Get a list of all available tool IDs, including both built-in tools and dynamically registered tools.",
  1167. "summary": "List tool IDs",
  1168. "x-codeSamples": [
  1169. {
  1170. "lang": "js",
  1171. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tool.ids({\n ...\n})"
  1172. }
  1173. ]
  1174. }
  1175. },
  1176. "/experimental/worktree": {
  1177. "get": {
  1178. "tags": ["experimental"],
  1179. "operationId": "worktree.list",
  1180. "parameters": [
  1181. {
  1182. "name": "directory",
  1183. "in": "query",
  1184. "schema": {
  1185. "type": "string"
  1186. },
  1187. "required": false
  1188. },
  1189. {
  1190. "name": "workspace",
  1191. "in": "query",
  1192. "schema": {
  1193. "type": "string"
  1194. },
  1195. "required": false
  1196. }
  1197. ],
  1198. "responses": {
  1199. "200": {
  1200. "description": "List of worktree directories",
  1201. "content": {
  1202. "application/json": {
  1203. "schema": {
  1204. "type": "array",
  1205. "items": {
  1206. "type": "string"
  1207. },
  1208. "description": "List of worktree directories"
  1209. }
  1210. }
  1211. }
  1212. },
  1213. "400": {
  1214. "description": "WorktreeError | InvalidRequestError",
  1215. "content": {
  1216. "application/json": {
  1217. "schema": {
  1218. "anyOf": [
  1219. {
  1220. "$ref": "#/components/schemas/WorktreeError"
  1221. },
  1222. {
  1223. "$ref": "#/components/schemas/InvalidRequestError"
  1224. }
  1225. ]
  1226. }
  1227. }
  1228. }
  1229. }
  1230. },
  1231. "description": "List all sandbox worktrees for the current project.",
  1232. "summary": "List worktrees",
  1233. "x-codeSamples": [
  1234. {
  1235. "lang": "js",
  1236. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.list({\n ...\n})"
  1237. }
  1238. ]
  1239. },
  1240. "post": {
  1241. "tags": ["experimental"],
  1242. "operationId": "worktree.create",
  1243. "parameters": [
  1244. {
  1245. "name": "directory",
  1246. "in": "query",
  1247. "schema": {
  1248. "type": "string"
  1249. },
  1250. "required": false
  1251. },
  1252. {
  1253. "name": "workspace",
  1254. "in": "query",
  1255. "schema": {
  1256. "type": "string"
  1257. },
  1258. "required": false
  1259. }
  1260. ],
  1261. "responses": {
  1262. "200": {
  1263. "description": "Worktree created",
  1264. "content": {
  1265. "application/json": {
  1266. "schema": {
  1267. "$ref": "#/components/schemas/Worktree"
  1268. }
  1269. }
  1270. }
  1271. },
  1272. "400": {
  1273. "description": "WorktreeError | InvalidRequestError",
  1274. "content": {
  1275. "application/json": {
  1276. "schema": {
  1277. "anyOf": [
  1278. {
  1279. "$ref": "#/components/schemas/WorktreeError"
  1280. },
  1281. {
  1282. "$ref": "#/components/schemas/InvalidRequestError"
  1283. }
  1284. ]
  1285. }
  1286. }
  1287. }
  1288. }
  1289. },
  1290. "description": "Create a new git worktree for the current project and run any configured startup scripts.",
  1291. "summary": "Create worktree",
  1292. "requestBody": {
  1293. "content": {
  1294. "application/json": {
  1295. "schema": {
  1296. "$ref": "#/components/schemas/WorktreeCreateInput"
  1297. }
  1298. }
  1299. }
  1300. },
  1301. "x-codeSamples": [
  1302. {
  1303. "lang": "js",
  1304. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.create({\n ...\n})"
  1305. }
  1306. ]
  1307. },
  1308. "delete": {
  1309. "tags": ["experimental"],
  1310. "operationId": "worktree.remove",
  1311. "parameters": [
  1312. {
  1313. "name": "directory",
  1314. "in": "query",
  1315. "schema": {
  1316. "type": "string"
  1317. },
  1318. "required": false
  1319. },
  1320. {
  1321. "name": "workspace",
  1322. "in": "query",
  1323. "schema": {
  1324. "type": "string"
  1325. },
  1326. "required": false
  1327. }
  1328. ],
  1329. "responses": {
  1330. "200": {
  1331. "description": "Worktree removed",
  1332. "content": {
  1333. "application/json": {
  1334. "schema": {
  1335. "type": "boolean",
  1336. "description": "Worktree removed"
  1337. }
  1338. }
  1339. }
  1340. },
  1341. "400": {
  1342. "description": "WorktreeError | InvalidRequestError",
  1343. "content": {
  1344. "application/json": {
  1345. "schema": {
  1346. "anyOf": [
  1347. {
  1348. "$ref": "#/components/schemas/WorktreeError"
  1349. },
  1350. {
  1351. "$ref": "#/components/schemas/InvalidRequestError"
  1352. }
  1353. ]
  1354. }
  1355. }
  1356. }
  1357. }
  1358. },
  1359. "description": "Remove a git worktree and delete its branch.",
  1360. "summary": "Remove worktree",
  1361. "requestBody": {
  1362. "content": {
  1363. "application/json": {
  1364. "schema": {
  1365. "$ref": "#/components/schemas/WorktreeRemoveInput"
  1366. }
  1367. }
  1368. }
  1369. },
  1370. "x-codeSamples": [
  1371. {
  1372. "lang": "js",
  1373. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.remove({\n ...\n})"
  1374. }
  1375. ]
  1376. }
  1377. },
  1378. "/experimental/worktree/reset": {
  1379. "post": {
  1380. "tags": ["experimental"],
  1381. "operationId": "worktree.reset",
  1382. "parameters": [
  1383. {
  1384. "name": "directory",
  1385. "in": "query",
  1386. "schema": {
  1387. "type": "string"
  1388. },
  1389. "required": false
  1390. },
  1391. {
  1392. "name": "workspace",
  1393. "in": "query",
  1394. "schema": {
  1395. "type": "string"
  1396. },
  1397. "required": false
  1398. }
  1399. ],
  1400. "responses": {
  1401. "200": {
  1402. "description": "Worktree reset",
  1403. "content": {
  1404. "application/json": {
  1405. "schema": {
  1406. "type": "boolean",
  1407. "description": "Worktree reset"
  1408. }
  1409. }
  1410. }
  1411. },
  1412. "400": {
  1413. "description": "WorktreeError | InvalidRequestError",
  1414. "content": {
  1415. "application/json": {
  1416. "schema": {
  1417. "anyOf": [
  1418. {
  1419. "$ref": "#/components/schemas/WorktreeError"
  1420. },
  1421. {
  1422. "$ref": "#/components/schemas/InvalidRequestError"
  1423. }
  1424. ]
  1425. }
  1426. }
  1427. }
  1428. }
  1429. },
  1430. "description": "Reset a worktree branch to the primary default branch.",
  1431. "summary": "Reset worktree",
  1432. "requestBody": {
  1433. "content": {
  1434. "application/json": {
  1435. "schema": {
  1436. "$ref": "#/components/schemas/WorktreeResetInput"
  1437. }
  1438. }
  1439. }
  1440. },
  1441. "x-codeSamples": [
  1442. {
  1443. "lang": "js",
  1444. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.reset({\n ...\n})"
  1445. }
  1446. ]
  1447. }
  1448. },
  1449. "/experimental/session": {
  1450. "get": {
  1451. "tags": ["experimental"],
  1452. "operationId": "experimental.session.list",
  1453. "parameters": [
  1454. {
  1455. "name": "directory",
  1456. "in": "query",
  1457. "schema": {
  1458. "type": "string"
  1459. },
  1460. "required": false
  1461. },
  1462. {
  1463. "name": "workspace",
  1464. "in": "query",
  1465. "schema": {
  1466. "type": "string"
  1467. },
  1468. "required": false
  1469. },
  1470. {
  1471. "name": "roots",
  1472. "in": "query",
  1473. "schema": {
  1474. "anyOf": [
  1475. {
  1476. "type": "boolean"
  1477. },
  1478. {
  1479. "type": "string",
  1480. "enum": ["true", "false"]
  1481. }
  1482. ]
  1483. },
  1484. "required": false
  1485. },
  1486. {
  1487. "name": "start",
  1488. "in": "query",
  1489. "schema": {
  1490. "type": "number"
  1491. },
  1492. "required": false
  1493. },
  1494. {
  1495. "name": "cursor",
  1496. "in": "query",
  1497. "schema": {
  1498. "type": "number"
  1499. },
  1500. "required": false
  1501. },
  1502. {
  1503. "name": "search",
  1504. "in": "query",
  1505. "schema": {
  1506. "type": "string"
  1507. },
  1508. "required": false
  1509. },
  1510. {
  1511. "name": "limit",
  1512. "in": "query",
  1513. "schema": {
  1514. "type": "number"
  1515. },
  1516. "required": false
  1517. },
  1518. {
  1519. "name": "archived",
  1520. "in": "query",
  1521. "schema": {
  1522. "anyOf": [
  1523. {
  1524. "type": "boolean"
  1525. },
  1526. {
  1527. "type": "string",
  1528. "enum": ["true", "false"]
  1529. }
  1530. ]
  1531. },
  1532. "required": false
  1533. }
  1534. ],
  1535. "responses": {
  1536. "200": {
  1537. "description": "List of sessions",
  1538. "content": {
  1539. "application/json": {
  1540. "schema": {
  1541. "type": "array",
  1542. "items": {
  1543. "$ref": "#/components/schemas/GlobalSession"
  1544. },
  1545. "description": "List of sessions"
  1546. }
  1547. }
  1548. }
  1549. },
  1550. "400": {
  1551. "description": "Bad request",
  1552. "content": {
  1553. "application/json": {
  1554. "schema": {
  1555. "$ref": "#/components/schemas/BadRequestError"
  1556. }
  1557. }
  1558. }
  1559. }
  1560. },
  1561. "description": "Get a list of all OpenCode sessions across projects, sorted by most recently updated. Archived sessions are excluded by default.",
  1562. "summary": "List sessions",
  1563. "x-codeSamples": [
  1564. {
  1565. "lang": "js",
  1566. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.session.list({\n ...\n})"
  1567. }
  1568. ]
  1569. }
  1570. },
  1571. "/experimental/resource": {
  1572. "get": {
  1573. "tags": ["experimental"],
  1574. "operationId": "experimental.resource.list",
  1575. "parameters": [
  1576. {
  1577. "name": "directory",
  1578. "in": "query",
  1579. "schema": {
  1580. "type": "string"
  1581. },
  1582. "required": false
  1583. },
  1584. {
  1585. "name": "workspace",
  1586. "in": "query",
  1587. "schema": {
  1588. "type": "string"
  1589. },
  1590. "required": false
  1591. }
  1592. ],
  1593. "responses": {
  1594. "200": {
  1595. "description": "MCP resources",
  1596. "content": {
  1597. "application/json": {
  1598. "schema": {
  1599. "type": "object",
  1600. "additionalProperties": {
  1601. "$ref": "#/components/schemas/McpResource"
  1602. },
  1603. "description": "MCP resources"
  1604. }
  1605. }
  1606. }
  1607. },
  1608. "400": {
  1609. "description": "Bad request",
  1610. "content": {
  1611. "application/json": {
  1612. "schema": {
  1613. "$ref": "#/components/schemas/BadRequestError"
  1614. }
  1615. }
  1616. }
  1617. }
  1618. },
  1619. "description": "Get all available MCP resources from connected servers. Optionally filter by name.",
  1620. "summary": "Get MCP resources",
  1621. "x-codeSamples": [
  1622. {
  1623. "lang": "js",
  1624. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.resource.list({\n ...\n})"
  1625. }
  1626. ]
  1627. }
  1628. },
  1629. "/find": {
  1630. "get": {
  1631. "tags": ["file"],
  1632. "operationId": "find.text",
  1633. "parameters": [
  1634. {
  1635. "name": "directory",
  1636. "in": "query",
  1637. "schema": {
  1638. "type": "string"
  1639. },
  1640. "required": false
  1641. },
  1642. {
  1643. "name": "workspace",
  1644. "in": "query",
  1645. "schema": {
  1646. "type": "string"
  1647. },
  1648. "required": false
  1649. },
  1650. {
  1651. "name": "pattern",
  1652. "in": "query",
  1653. "schema": {
  1654. "type": "string"
  1655. },
  1656. "required": true
  1657. }
  1658. ],
  1659. "responses": {
  1660. "200": {
  1661. "description": "Matches",
  1662. "content": {
  1663. "application/json": {
  1664. "schema": {
  1665. "type": "array",
  1666. "items": {
  1667. "type": "object",
  1668. "properties": {
  1669. "path": {
  1670. "type": "object",
  1671. "properties": {
  1672. "text": {
  1673. "type": "string"
  1674. }
  1675. },
  1676. "required": ["text"],
  1677. "additionalProperties": false
  1678. },
  1679. "lines": {
  1680. "type": "object",
  1681. "properties": {
  1682. "text": {
  1683. "type": "string"
  1684. }
  1685. },
  1686. "required": ["text"],
  1687. "additionalProperties": false
  1688. },
  1689. "line_number": {
  1690. "type": "integer",
  1691. "minimum": 0
  1692. },
  1693. "absolute_offset": {
  1694. "type": "integer",
  1695. "minimum": 0
  1696. },
  1697. "submatches": {
  1698. "type": "array",
  1699. "items": {
  1700. "type": "object",
  1701. "properties": {
  1702. "match": {
  1703. "type": "object",
  1704. "properties": {
  1705. "text": {
  1706. "type": "string"
  1707. }
  1708. },
  1709. "required": ["text"],
  1710. "additionalProperties": false
  1711. },
  1712. "start": {
  1713. "type": "integer",
  1714. "minimum": 0
  1715. },
  1716. "end": {
  1717. "type": "integer",
  1718. "minimum": 0
  1719. }
  1720. },
  1721. "required": ["match", "start", "end"],
  1722. "additionalProperties": false
  1723. }
  1724. }
  1725. },
  1726. "required": ["path", "lines", "line_number", "absolute_offset", "submatches"],
  1727. "additionalProperties": false
  1728. },
  1729. "description": "Matches"
  1730. }
  1731. }
  1732. }
  1733. },
  1734. "400": {
  1735. "description": "Bad request",
  1736. "content": {
  1737. "application/json": {
  1738. "schema": {
  1739. "$ref": "#/components/schemas/BadRequestError"
  1740. }
  1741. }
  1742. }
  1743. }
  1744. },
  1745. "description": "Search for text patterns across files in the project using ripgrep.",
  1746. "summary": "Find text",
  1747. "x-codeSamples": [
  1748. {
  1749. "lang": "js",
  1750. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.find.text({\n ...\n})"
  1751. }
  1752. ]
  1753. }
  1754. },
  1755. "/find/file": {
  1756. "get": {
  1757. "tags": ["file"],
  1758. "operationId": "find.files",
  1759. "parameters": [
  1760. {
  1761. "name": "directory",
  1762. "in": "query",
  1763. "schema": {
  1764. "type": "string"
  1765. },
  1766. "required": false
  1767. },
  1768. {
  1769. "name": "workspace",
  1770. "in": "query",
  1771. "schema": {
  1772. "type": "string"
  1773. },
  1774. "required": false
  1775. },
  1776. {
  1777. "name": "query",
  1778. "in": "query",
  1779. "schema": {
  1780. "type": "string"
  1781. },
  1782. "required": true
  1783. },
  1784. {
  1785. "name": "dirs",
  1786. "in": "query",
  1787. "schema": {
  1788. "type": "string",
  1789. "enum": ["true", "false"]
  1790. },
  1791. "required": false
  1792. },
  1793. {
  1794. "name": "type",
  1795. "in": "query",
  1796. "schema": {
  1797. "type": "string",
  1798. "enum": ["file", "directory"]
  1799. },
  1800. "required": false
  1801. },
  1802. {
  1803. "name": "limit",
  1804. "in": "query",
  1805. "schema": {
  1806. "type": "integer",
  1807. "minimum": 1,
  1808. "maximum": 200
  1809. },
  1810. "required": false
  1811. }
  1812. ],
  1813. "responses": {
  1814. "200": {
  1815. "description": "File paths",
  1816. "content": {
  1817. "application/json": {
  1818. "schema": {
  1819. "type": "array",
  1820. "items": {
  1821. "type": "string"
  1822. },
  1823. "description": "File paths"
  1824. }
  1825. }
  1826. }
  1827. },
  1828. "400": {
  1829. "description": "Bad request",
  1830. "content": {
  1831. "application/json": {
  1832. "schema": {
  1833. "$ref": "#/components/schemas/BadRequestError"
  1834. }
  1835. }
  1836. }
  1837. }
  1838. },
  1839. "description": "Search for files or directories by name or pattern in the project directory.",
  1840. "summary": "Find files",
  1841. "x-codeSamples": [
  1842. {
  1843. "lang": "js",
  1844. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.find.files({\n ...\n})"
  1845. }
  1846. ]
  1847. }
  1848. },
  1849. "/find/symbol": {
  1850. "get": {
  1851. "tags": ["file"],
  1852. "operationId": "find.symbols",
  1853. "parameters": [
  1854. {
  1855. "name": "directory",
  1856. "in": "query",
  1857. "schema": {
  1858. "type": "string"
  1859. },
  1860. "required": false
  1861. },
  1862. {
  1863. "name": "workspace",
  1864. "in": "query",
  1865. "schema": {
  1866. "type": "string"
  1867. },
  1868. "required": false
  1869. },
  1870. {
  1871. "name": "query",
  1872. "in": "query",
  1873. "schema": {
  1874. "type": "string"
  1875. },
  1876. "required": true
  1877. }
  1878. ],
  1879. "responses": {
  1880. "200": {
  1881. "description": "Symbols",
  1882. "content": {
  1883. "application/json": {
  1884. "schema": {
  1885. "type": "array",
  1886. "items": {
  1887. "$ref": "#/components/schemas/Symbol"
  1888. },
  1889. "description": "Symbols"
  1890. }
  1891. }
  1892. }
  1893. },
  1894. "400": {
  1895. "description": "Bad request",
  1896. "content": {
  1897. "application/json": {
  1898. "schema": {
  1899. "$ref": "#/components/schemas/BadRequestError"
  1900. }
  1901. }
  1902. }
  1903. }
  1904. },
  1905. "description": "Search for workspace symbols like functions, classes, and variables using LSP.",
  1906. "summary": "Find symbols",
  1907. "x-codeSamples": [
  1908. {
  1909. "lang": "js",
  1910. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.find.symbols({\n ...\n})"
  1911. }
  1912. ]
  1913. }
  1914. },
  1915. "/file": {
  1916. "get": {
  1917. "tags": ["file"],
  1918. "operationId": "file.list",
  1919. "parameters": [
  1920. {
  1921. "name": "directory",
  1922. "in": "query",
  1923. "schema": {
  1924. "type": "string"
  1925. },
  1926. "required": false
  1927. },
  1928. {
  1929. "name": "workspace",
  1930. "in": "query",
  1931. "schema": {
  1932. "type": "string"
  1933. },
  1934. "required": false
  1935. },
  1936. {
  1937. "name": "path",
  1938. "in": "query",
  1939. "schema": {
  1940. "type": "string"
  1941. },
  1942. "required": true
  1943. }
  1944. ],
  1945. "responses": {
  1946. "200": {
  1947. "description": "Files and directories",
  1948. "content": {
  1949. "application/json": {
  1950. "schema": {
  1951. "type": "array",
  1952. "items": {
  1953. "$ref": "#/components/schemas/FileNode"
  1954. },
  1955. "description": "Files and directories"
  1956. }
  1957. }
  1958. }
  1959. },
  1960. "400": {
  1961. "description": "Bad request",
  1962. "content": {
  1963. "application/json": {
  1964. "schema": {
  1965. "$ref": "#/components/schemas/BadRequestError"
  1966. }
  1967. }
  1968. }
  1969. }
  1970. },
  1971. "description": "List files and directories in a specified path.",
  1972. "summary": "List files",
  1973. "x-codeSamples": [
  1974. {
  1975. "lang": "js",
  1976. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.file.list({\n ...\n})"
  1977. }
  1978. ]
  1979. }
  1980. },
  1981. "/file/content": {
  1982. "get": {
  1983. "tags": ["file"],
  1984. "operationId": "file.read",
  1985. "parameters": [
  1986. {
  1987. "name": "directory",
  1988. "in": "query",
  1989. "schema": {
  1990. "type": "string"
  1991. },
  1992. "required": false
  1993. },
  1994. {
  1995. "name": "workspace",
  1996. "in": "query",
  1997. "schema": {
  1998. "type": "string"
  1999. },
  2000. "required": false
  2001. },
  2002. {
  2003. "name": "path",
  2004. "in": "query",
  2005. "schema": {
  2006. "type": "string"
  2007. },
  2008. "required": true
  2009. }
  2010. ],
  2011. "responses": {
  2012. "200": {
  2013. "description": "File content",
  2014. "content": {
  2015. "application/json": {
  2016. "schema": {
  2017. "$ref": "#/components/schemas/FileContent"
  2018. }
  2019. }
  2020. }
  2021. },
  2022. "400": {
  2023. "description": "Bad request",
  2024. "content": {
  2025. "application/json": {
  2026. "schema": {
  2027. "$ref": "#/components/schemas/BadRequestError"
  2028. }
  2029. }
  2030. }
  2031. }
  2032. },
  2033. "description": "Read the content of a specified file.",
  2034. "summary": "Read file",
  2035. "x-codeSamples": [
  2036. {
  2037. "lang": "js",
  2038. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.file.read({\n ...\n})"
  2039. }
  2040. ]
  2041. }
  2042. },
  2043. "/file/status": {
  2044. "get": {
  2045. "tags": ["file"],
  2046. "operationId": "file.status",
  2047. "parameters": [
  2048. {
  2049. "name": "directory",
  2050. "in": "query",
  2051. "schema": {
  2052. "type": "string"
  2053. },
  2054. "required": false
  2055. },
  2056. {
  2057. "name": "workspace",
  2058. "in": "query",
  2059. "schema": {
  2060. "type": "string"
  2061. },
  2062. "required": false
  2063. }
  2064. ],
  2065. "responses": {
  2066. "200": {
  2067. "description": "File status",
  2068. "content": {
  2069. "application/json": {
  2070. "schema": {
  2071. "type": "array",
  2072. "items": {
  2073. "$ref": "#/components/schemas/File"
  2074. },
  2075. "description": "File status"
  2076. }
  2077. }
  2078. }
  2079. },
  2080. "400": {
  2081. "description": "Bad request",
  2082. "content": {
  2083. "application/json": {
  2084. "schema": {
  2085. "$ref": "#/components/schemas/BadRequestError"
  2086. }
  2087. }
  2088. }
  2089. }
  2090. },
  2091. "description": "Get the git status of all files in the project.",
  2092. "summary": "Get file status",
  2093. "x-codeSamples": [
  2094. {
  2095. "lang": "js",
  2096. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.file.status({\n ...\n})"
  2097. }
  2098. ]
  2099. }
  2100. },
  2101. "/instance/dispose": {
  2102. "post": {
  2103. "tags": ["instance"],
  2104. "operationId": "instance.dispose",
  2105. "parameters": [
  2106. {
  2107. "name": "directory",
  2108. "in": "query",
  2109. "schema": {
  2110. "type": "string"
  2111. },
  2112. "required": false
  2113. },
  2114. {
  2115. "name": "workspace",
  2116. "in": "query",
  2117. "schema": {
  2118. "type": "string"
  2119. },
  2120. "required": false
  2121. }
  2122. ],
  2123. "responses": {
  2124. "200": {
  2125. "description": "Instance disposed",
  2126. "content": {
  2127. "application/json": {
  2128. "schema": {
  2129. "type": "boolean",
  2130. "description": "Instance disposed"
  2131. }
  2132. }
  2133. }
  2134. },
  2135. "400": {
  2136. "description": "Bad request",
  2137. "content": {
  2138. "application/json": {
  2139. "schema": {
  2140. "$ref": "#/components/schemas/BadRequestError"
  2141. }
  2142. }
  2143. }
  2144. }
  2145. },
  2146. "description": "Clean up and dispose the current OpenCode instance, releasing all resources.",
  2147. "summary": "Dispose instance",
  2148. "x-codeSamples": [
  2149. {
  2150. "lang": "js",
  2151. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.instance.dispose({\n ...\n})"
  2152. }
  2153. ]
  2154. }
  2155. },
  2156. "/path": {
  2157. "get": {
  2158. "tags": ["instance"],
  2159. "operationId": "path.get",
  2160. "parameters": [
  2161. {
  2162. "name": "directory",
  2163. "in": "query",
  2164. "schema": {
  2165. "type": "string"
  2166. },
  2167. "required": false
  2168. },
  2169. {
  2170. "name": "workspace",
  2171. "in": "query",
  2172. "schema": {
  2173. "type": "string"
  2174. },
  2175. "required": false
  2176. }
  2177. ],
  2178. "responses": {
  2179. "200": {
  2180. "description": "Path",
  2181. "content": {
  2182. "application/json": {
  2183. "schema": {
  2184. "$ref": "#/components/schemas/Path"
  2185. }
  2186. }
  2187. }
  2188. },
  2189. "400": {
  2190. "description": "Bad request",
  2191. "content": {
  2192. "application/json": {
  2193. "schema": {
  2194. "$ref": "#/components/schemas/BadRequestError"
  2195. }
  2196. }
  2197. }
  2198. }
  2199. },
  2200. "description": "Retrieve the current working directory and related path information for the OpenCode instance.",
  2201. "summary": "Get paths",
  2202. "x-codeSamples": [
  2203. {
  2204. "lang": "js",
  2205. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.path.get({\n ...\n})"
  2206. }
  2207. ]
  2208. }
  2209. },
  2210. "/vcs": {
  2211. "get": {
  2212. "tags": ["instance"],
  2213. "operationId": "vcs.get",
  2214. "parameters": [
  2215. {
  2216. "name": "directory",
  2217. "in": "query",
  2218. "schema": {
  2219. "type": "string"
  2220. },
  2221. "required": false
  2222. },
  2223. {
  2224. "name": "workspace",
  2225. "in": "query",
  2226. "schema": {
  2227. "type": "string"
  2228. },
  2229. "required": false
  2230. }
  2231. ],
  2232. "responses": {
  2233. "200": {
  2234. "description": "VCS info",
  2235. "content": {
  2236. "application/json": {
  2237. "schema": {
  2238. "$ref": "#/components/schemas/VcsInfo"
  2239. }
  2240. }
  2241. }
  2242. },
  2243. "400": {
  2244. "description": "Bad request",
  2245. "content": {
  2246. "application/json": {
  2247. "schema": {
  2248. "$ref": "#/components/schemas/BadRequestError"
  2249. }
  2250. }
  2251. }
  2252. }
  2253. },
  2254. "description": "Retrieve version control system (VCS) information for the current project, such as git branch.",
  2255. "summary": "Get VCS info",
  2256. "x-codeSamples": [
  2257. {
  2258. "lang": "js",
  2259. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.vcs.get({\n ...\n})"
  2260. }
  2261. ]
  2262. }
  2263. },
  2264. "/vcs/status": {
  2265. "get": {
  2266. "tags": ["instance"],
  2267. "operationId": "vcs.status",
  2268. "parameters": [
  2269. {
  2270. "name": "directory",
  2271. "in": "query",
  2272. "schema": {
  2273. "type": "string"
  2274. },
  2275. "required": false
  2276. },
  2277. {
  2278. "name": "workspace",
  2279. "in": "query",
  2280. "schema": {
  2281. "type": "string"
  2282. },
  2283. "required": false
  2284. }
  2285. ],
  2286. "responses": {
  2287. "200": {
  2288. "description": "VCS status",
  2289. "content": {
  2290. "application/json": {
  2291. "schema": {
  2292. "type": "array",
  2293. "items": {
  2294. "$ref": "#/components/schemas/VcsFileStatus"
  2295. },
  2296. "description": "VCS status"
  2297. }
  2298. }
  2299. }
  2300. },
  2301. "400": {
  2302. "description": "Bad request",
  2303. "content": {
  2304. "application/json": {
  2305. "schema": {
  2306. "$ref": "#/components/schemas/BadRequestError"
  2307. }
  2308. }
  2309. }
  2310. }
  2311. },
  2312. "description": "Retrieve changed files in the current working tree without patches.",
  2313. "summary": "Get VCS status",
  2314. "x-codeSamples": [
  2315. {
  2316. "lang": "js",
  2317. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.vcs.status({\n ...\n})"
  2318. }
  2319. ]
  2320. }
  2321. },
  2322. "/vcs/diff": {
  2323. "get": {
  2324. "tags": ["instance"],
  2325. "operationId": "vcs.diff",
  2326. "parameters": [
  2327. {
  2328. "name": "directory",
  2329. "in": "query",
  2330. "schema": {
  2331. "type": "string"
  2332. },
  2333. "required": false
  2334. },
  2335. {
  2336. "name": "workspace",
  2337. "in": "query",
  2338. "schema": {
  2339. "type": "string"
  2340. },
  2341. "required": false
  2342. },
  2343. {
  2344. "name": "mode",
  2345. "in": "query",
  2346. "schema": {
  2347. "type": "string",
  2348. "enum": ["git", "branch"]
  2349. },
  2350. "required": true
  2351. },
  2352. {
  2353. "name": "context",
  2354. "in": "query",
  2355. "schema": {
  2356. "type": "integer",
  2357. "minimum": 0
  2358. },
  2359. "required": false
  2360. }
  2361. ],
  2362. "responses": {
  2363. "200": {
  2364. "description": "VCS diff",
  2365. "content": {
  2366. "application/json": {
  2367. "schema": {
  2368. "type": "array",
  2369. "items": {
  2370. "$ref": "#/components/schemas/VcsFileDiff"
  2371. },
  2372. "description": "VCS diff"
  2373. }
  2374. }
  2375. }
  2376. },
  2377. "400": {
  2378. "description": "Bad request",
  2379. "content": {
  2380. "application/json": {
  2381. "schema": {
  2382. "$ref": "#/components/schemas/BadRequestError"
  2383. }
  2384. }
  2385. }
  2386. }
  2387. },
  2388. "description": "Retrieve the current git diff for the working tree or against the default branch.",
  2389. "summary": "Get VCS diff",
  2390. "x-codeSamples": [
  2391. {
  2392. "lang": "js",
  2393. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.vcs.diff({\n ...\n})"
  2394. }
  2395. ]
  2396. }
  2397. },
  2398. "/vcs/diff/raw": {
  2399. "get": {
  2400. "tags": ["instance"],
  2401. "operationId": "vcs.diff.raw",
  2402. "parameters": [
  2403. {
  2404. "name": "directory",
  2405. "in": "query",
  2406. "schema": {
  2407. "type": "string"
  2408. },
  2409. "required": false
  2410. },
  2411. {
  2412. "name": "workspace",
  2413. "in": "query",
  2414. "schema": {
  2415. "type": "string"
  2416. },
  2417. "required": false
  2418. }
  2419. ],
  2420. "responses": {
  2421. "200": {
  2422. "description": "Raw VCS diff",
  2423. "content": {
  2424. "text/x-diff; charset=utf-8": {
  2425. "schema": {
  2426. "type": "string"
  2427. }
  2428. }
  2429. }
  2430. },
  2431. "400": {
  2432. "description": "Bad request",
  2433. "content": {
  2434. "application/json": {
  2435. "schema": {
  2436. "$ref": "#/components/schemas/BadRequestError"
  2437. }
  2438. }
  2439. }
  2440. }
  2441. },
  2442. "description": "Retrieve a raw patch for current uncommitted changes.",
  2443. "summary": "Get raw VCS diff",
  2444. "x-codeSamples": [
  2445. {
  2446. "lang": "js",
  2447. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.vcs.diff.raw({\n ...\n})"
  2448. }
  2449. ]
  2450. }
  2451. },
  2452. "/vcs/apply": {
  2453. "post": {
  2454. "tags": ["instance"],
  2455. "operationId": "vcs.apply",
  2456. "parameters": [
  2457. {
  2458. "name": "directory",
  2459. "in": "query",
  2460. "schema": {
  2461. "type": "string"
  2462. },
  2463. "required": false
  2464. },
  2465. {
  2466. "name": "workspace",
  2467. "in": "query",
  2468. "schema": {
  2469. "type": "string"
  2470. },
  2471. "required": false
  2472. }
  2473. ],
  2474. "responses": {
  2475. "200": {
  2476. "description": "VCS patch applied",
  2477. "content": {
  2478. "application/json": {
  2479. "schema": {
  2480. "type": "object",
  2481. "properties": {
  2482. "applied": {
  2483. "type": "boolean"
  2484. }
  2485. },
  2486. "required": ["applied"],
  2487. "additionalProperties": false,
  2488. "description": "VCS patch applied"
  2489. }
  2490. }
  2491. }
  2492. },
  2493. "400": {
  2494. "description": "VcsApplyError | InvalidRequestError",
  2495. "content": {
  2496. "application/json": {
  2497. "schema": {
  2498. "anyOf": [
  2499. {
  2500. "$ref": "#/components/schemas/VcsApplyError"
  2501. },
  2502. {
  2503. "$ref": "#/components/schemas/InvalidRequestError"
  2504. }
  2505. ]
  2506. }
  2507. }
  2508. }
  2509. }
  2510. },
  2511. "description": "Apply a raw patch to the current working tree.",
  2512. "summary": "Apply VCS patch",
  2513. "requestBody": {
  2514. "content": {
  2515. "application/json": {
  2516. "schema": {
  2517. "type": "object",
  2518. "properties": {
  2519. "patch": {
  2520. "type": "string"
  2521. }
  2522. },
  2523. "required": ["patch"],
  2524. "additionalProperties": false
  2525. }
  2526. }
  2527. }
  2528. },
  2529. "x-codeSamples": [
  2530. {
  2531. "lang": "js",
  2532. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.vcs.apply({\n ...\n})"
  2533. }
  2534. ]
  2535. }
  2536. },
  2537. "/command": {
  2538. "get": {
  2539. "tags": ["instance"],
  2540. "operationId": "command.list",
  2541. "parameters": [
  2542. {
  2543. "name": "directory",
  2544. "in": "query",
  2545. "schema": {
  2546. "type": "string"
  2547. },
  2548. "required": false
  2549. },
  2550. {
  2551. "name": "workspace",
  2552. "in": "query",
  2553. "schema": {
  2554. "type": "string"
  2555. },
  2556. "required": false
  2557. }
  2558. ],
  2559. "responses": {
  2560. "200": {
  2561. "description": "List of commands",
  2562. "content": {
  2563. "application/json": {
  2564. "schema": {
  2565. "type": "array",
  2566. "items": {
  2567. "$ref": "#/components/schemas/Command"
  2568. },
  2569. "description": "List of commands"
  2570. }
  2571. }
  2572. }
  2573. },
  2574. "400": {
  2575. "description": "Bad request",
  2576. "content": {
  2577. "application/json": {
  2578. "schema": {
  2579. "$ref": "#/components/schemas/BadRequestError"
  2580. }
  2581. }
  2582. }
  2583. }
  2584. },
  2585. "description": "Get a list of all available commands in the OpenCode system.",
  2586. "summary": "List commands",
  2587. "x-codeSamples": [
  2588. {
  2589. "lang": "js",
  2590. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.command.list({\n ...\n})"
  2591. }
  2592. ]
  2593. }
  2594. },
  2595. "/agent": {
  2596. "get": {
  2597. "tags": ["instance"],
  2598. "operationId": "app.agents",
  2599. "parameters": [
  2600. {
  2601. "name": "directory",
  2602. "in": "query",
  2603. "schema": {
  2604. "type": "string"
  2605. },
  2606. "required": false
  2607. },
  2608. {
  2609. "name": "workspace",
  2610. "in": "query",
  2611. "schema": {
  2612. "type": "string"
  2613. },
  2614. "required": false
  2615. }
  2616. ],
  2617. "responses": {
  2618. "200": {
  2619. "description": "List of agents",
  2620. "content": {
  2621. "application/json": {
  2622. "schema": {
  2623. "type": "array",
  2624. "items": {
  2625. "$ref": "#/components/schemas/Agent"
  2626. },
  2627. "description": "List of agents"
  2628. }
  2629. }
  2630. }
  2631. },
  2632. "400": {
  2633. "description": "Bad request",
  2634. "content": {
  2635. "application/json": {
  2636. "schema": {
  2637. "$ref": "#/components/schemas/BadRequestError"
  2638. }
  2639. }
  2640. }
  2641. }
  2642. },
  2643. "description": "Get a list of all available AI agents in the OpenCode system.",
  2644. "summary": "List agents",
  2645. "x-codeSamples": [
  2646. {
  2647. "lang": "js",
  2648. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.app.agents({\n ...\n})"
  2649. }
  2650. ]
  2651. }
  2652. },
  2653. "/skill": {
  2654. "get": {
  2655. "tags": ["instance"],
  2656. "operationId": "app.skills",
  2657. "parameters": [
  2658. {
  2659. "name": "directory",
  2660. "in": "query",
  2661. "schema": {
  2662. "type": "string"
  2663. },
  2664. "required": false
  2665. },
  2666. {
  2667. "name": "workspace",
  2668. "in": "query",
  2669. "schema": {
  2670. "type": "string"
  2671. },
  2672. "required": false
  2673. }
  2674. ],
  2675. "responses": {
  2676. "200": {
  2677. "description": "List of skills",
  2678. "content": {
  2679. "application/json": {
  2680. "schema": {
  2681. "type": "array",
  2682. "items": {
  2683. "type": "object",
  2684. "properties": {
  2685. "name": {
  2686. "type": "string"
  2687. },
  2688. "description": {
  2689. "type": "string"
  2690. },
  2691. "location": {
  2692. "type": "string"
  2693. },
  2694. "content": {
  2695. "type": "string"
  2696. }
  2697. },
  2698. "required": ["name", "location", "content"],
  2699. "additionalProperties": false
  2700. },
  2701. "description": "List of skills"
  2702. }
  2703. }
  2704. }
  2705. },
  2706. "400": {
  2707. "description": "Bad request",
  2708. "content": {
  2709. "application/json": {
  2710. "schema": {
  2711. "$ref": "#/components/schemas/BadRequestError"
  2712. }
  2713. }
  2714. }
  2715. }
  2716. },
  2717. "description": "Get a list of all available skills in the OpenCode system.",
  2718. "summary": "List skills",
  2719. "x-codeSamples": [
  2720. {
  2721. "lang": "js",
  2722. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.app.skills({\n ...\n})"
  2723. }
  2724. ]
  2725. }
  2726. },
  2727. "/lsp": {
  2728. "get": {
  2729. "tags": ["instance"],
  2730. "operationId": "lsp.status",
  2731. "parameters": [
  2732. {
  2733. "name": "directory",
  2734. "in": "query",
  2735. "schema": {
  2736. "type": "string"
  2737. },
  2738. "required": false
  2739. },
  2740. {
  2741. "name": "workspace",
  2742. "in": "query",
  2743. "schema": {
  2744. "type": "string"
  2745. },
  2746. "required": false
  2747. }
  2748. ],
  2749. "responses": {
  2750. "200": {
  2751. "description": "LSP server status",
  2752. "content": {
  2753. "application/json": {
  2754. "schema": {
  2755. "type": "array",
  2756. "items": {
  2757. "$ref": "#/components/schemas/LSPStatus"
  2758. },
  2759. "description": "LSP server status"
  2760. }
  2761. }
  2762. }
  2763. },
  2764. "400": {
  2765. "description": "Bad request",
  2766. "content": {
  2767. "application/json": {
  2768. "schema": {
  2769. "$ref": "#/components/schemas/BadRequestError"
  2770. }
  2771. }
  2772. }
  2773. }
  2774. },
  2775. "description": "Get LSP server status",
  2776. "summary": "Get LSP status",
  2777. "x-codeSamples": [
  2778. {
  2779. "lang": "js",
  2780. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.lsp.status({\n ...\n})"
  2781. }
  2782. ]
  2783. }
  2784. },
  2785. "/formatter": {
  2786. "get": {
  2787. "tags": ["instance"],
  2788. "operationId": "formatter.status",
  2789. "parameters": [
  2790. {
  2791. "name": "directory",
  2792. "in": "query",
  2793. "schema": {
  2794. "type": "string"
  2795. },
  2796. "required": false
  2797. },
  2798. {
  2799. "name": "workspace",
  2800. "in": "query",
  2801. "schema": {
  2802. "type": "string"
  2803. },
  2804. "required": false
  2805. }
  2806. ],
  2807. "responses": {
  2808. "200": {
  2809. "description": "Formatter status",
  2810. "content": {
  2811. "application/json": {
  2812. "schema": {
  2813. "type": "array",
  2814. "items": {
  2815. "$ref": "#/components/schemas/FormatterStatus"
  2816. },
  2817. "description": "Formatter status"
  2818. }
  2819. }
  2820. }
  2821. },
  2822. "400": {
  2823. "description": "Bad request",
  2824. "content": {
  2825. "application/json": {
  2826. "schema": {
  2827. "$ref": "#/components/schemas/BadRequestError"
  2828. }
  2829. }
  2830. }
  2831. }
  2832. },
  2833. "description": "Get formatter status",
  2834. "summary": "Get formatter status",
  2835. "x-codeSamples": [
  2836. {
  2837. "lang": "js",
  2838. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.formatter.status({\n ...\n})"
  2839. }
  2840. ]
  2841. }
  2842. },
  2843. "/mcp": {
  2844. "get": {
  2845. "tags": ["mcp"],
  2846. "operationId": "mcp.status",
  2847. "parameters": [
  2848. {
  2849. "name": "directory",
  2850. "in": "query",
  2851. "schema": {
  2852. "type": "string"
  2853. },
  2854. "required": false
  2855. },
  2856. {
  2857. "name": "workspace",
  2858. "in": "query",
  2859. "schema": {
  2860. "type": "string"
  2861. },
  2862. "required": false
  2863. }
  2864. ],
  2865. "responses": {
  2866. "200": {
  2867. "description": "MCP server status",
  2868. "content": {
  2869. "application/json": {
  2870. "schema": {
  2871. "type": "object",
  2872. "additionalProperties": {
  2873. "$ref": "#/components/schemas/MCPStatus"
  2874. },
  2875. "description": "MCP server status"
  2876. }
  2877. }
  2878. }
  2879. },
  2880. "400": {
  2881. "description": "Bad request",
  2882. "content": {
  2883. "application/json": {
  2884. "schema": {
  2885. "$ref": "#/components/schemas/BadRequestError"
  2886. }
  2887. }
  2888. }
  2889. }
  2890. },
  2891. "description": "Get the status of all Model Context Protocol (MCP) servers.",
  2892. "summary": "Get MCP status",
  2893. "x-codeSamples": [
  2894. {
  2895. "lang": "js",
  2896. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.status({\n ...\n})"
  2897. }
  2898. ]
  2899. },
  2900. "post": {
  2901. "tags": ["mcp"],
  2902. "operationId": "mcp.add",
  2903. "parameters": [
  2904. {
  2905. "name": "directory",
  2906. "in": "query",
  2907. "schema": {
  2908. "type": "string"
  2909. },
  2910. "required": false
  2911. },
  2912. {
  2913. "name": "workspace",
  2914. "in": "query",
  2915. "schema": {
  2916. "type": "string"
  2917. },
  2918. "required": false
  2919. }
  2920. ],
  2921. "responses": {
  2922. "200": {
  2923. "description": "MCP server added successfully",
  2924. "content": {
  2925. "application/json": {
  2926. "schema": {
  2927. "type": "object",
  2928. "additionalProperties": {
  2929. "$ref": "#/components/schemas/MCPStatus"
  2930. },
  2931. "description": "MCP server added successfully"
  2932. }
  2933. }
  2934. }
  2935. },
  2936. "400": {
  2937. "description": "BadRequest | InvalidRequestError",
  2938. "content": {
  2939. "application/json": {
  2940. "schema": {
  2941. "anyOf": [
  2942. {
  2943. "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
  2944. },
  2945. {
  2946. "$ref": "#/components/schemas/InvalidRequestError"
  2947. }
  2948. ]
  2949. }
  2950. }
  2951. }
  2952. }
  2953. },
  2954. "description": "Dynamically add a new Model Context Protocol (MCP) server to the system.",
  2955. "summary": "Add MCP server",
  2956. "requestBody": {
  2957. "content": {
  2958. "application/json": {
  2959. "schema": {
  2960. "type": "object",
  2961. "properties": {
  2962. "name": {
  2963. "type": "string"
  2964. },
  2965. "config": {
  2966. "anyOf": [
  2967. {
  2968. "$ref": "#/components/schemas/McpLocalConfig"
  2969. },
  2970. {
  2971. "$ref": "#/components/schemas/McpRemoteConfig"
  2972. }
  2973. ]
  2974. }
  2975. },
  2976. "required": ["name", "config"],
  2977. "additionalProperties": false
  2978. }
  2979. }
  2980. }
  2981. },
  2982. "x-codeSamples": [
  2983. {
  2984. "lang": "js",
  2985. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.add({\n ...\n})"
  2986. }
  2987. ]
  2988. }
  2989. },
  2990. "/mcp/{name}/auth": {
  2991. "post": {
  2992. "tags": ["mcp"],
  2993. "operationId": "mcp.auth.start",
  2994. "parameters": [
  2995. {
  2996. "name": "name",
  2997. "in": "path",
  2998. "schema": {
  2999. "type": "string"
  3000. },
  3001. "required": true
  3002. },
  3003. {
  3004. "name": "directory",
  3005. "in": "query",
  3006. "schema": {
  3007. "type": "string"
  3008. },
  3009. "required": false
  3010. },
  3011. {
  3012. "name": "workspace",
  3013. "in": "query",
  3014. "schema": {
  3015. "type": "string"
  3016. },
  3017. "required": false
  3018. }
  3019. ],
  3020. "responses": {
  3021. "200": {
  3022. "description": "OAuth flow started",
  3023. "content": {
  3024. "application/json": {
  3025. "schema": {
  3026. "type": "object",
  3027. "properties": {
  3028. "authorizationUrl": {
  3029. "type": "string"
  3030. },
  3031. "oauthState": {
  3032. "type": "string"
  3033. }
  3034. },
  3035. "required": ["authorizationUrl", "oauthState"],
  3036. "additionalProperties": false,
  3037. "description": "OAuth flow started"
  3038. }
  3039. }
  3040. }
  3041. },
  3042. "400": {
  3043. "description": "McpUnsupportedOAuthError | InvalidRequestError",
  3044. "content": {
  3045. "application/json": {
  3046. "schema": {
  3047. "anyOf": [
  3048. {
  3049. "$ref": "#/components/schemas/McpUnsupportedOAuthError"
  3050. },
  3051. {
  3052. "$ref": "#/components/schemas/InvalidRequestError"
  3053. }
  3054. ]
  3055. }
  3056. }
  3057. }
  3058. },
  3059. "404": {
  3060. "description": "McpServerNotFoundError",
  3061. "content": {
  3062. "application/json": {
  3063. "schema": {
  3064. "$ref": "#/components/schemas/McpServerNotFoundError"
  3065. }
  3066. }
  3067. }
  3068. }
  3069. },
  3070. "description": "Start OAuth authentication flow for a Model Context Protocol (MCP) server.",
  3071. "summary": "Start MCP OAuth",
  3072. "x-codeSamples": [
  3073. {
  3074. "lang": "js",
  3075. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.start({\n ...\n})"
  3076. }
  3077. ]
  3078. },
  3079. "delete": {
  3080. "tags": ["mcp"],
  3081. "operationId": "mcp.auth.remove",
  3082. "parameters": [
  3083. {
  3084. "name": "name",
  3085. "in": "path",
  3086. "schema": {
  3087. "type": "string"
  3088. },
  3089. "required": true
  3090. },
  3091. {
  3092. "name": "directory",
  3093. "in": "query",
  3094. "schema": {
  3095. "type": "string"
  3096. },
  3097. "required": false
  3098. },
  3099. {
  3100. "name": "workspace",
  3101. "in": "query",
  3102. "schema": {
  3103. "type": "string"
  3104. },
  3105. "required": false
  3106. }
  3107. ],
  3108. "responses": {
  3109. "200": {
  3110. "description": "OAuth credentials removed",
  3111. "content": {
  3112. "application/json": {
  3113. "schema": {
  3114. "type": "object",
  3115. "properties": {
  3116. "success": {
  3117. "type": "boolean",
  3118. "enum": [true]
  3119. }
  3120. },
  3121. "required": ["success"],
  3122. "additionalProperties": false,
  3123. "description": "OAuth credentials removed"
  3124. }
  3125. }
  3126. }
  3127. },
  3128. "400": {
  3129. "description": "Bad request",
  3130. "content": {
  3131. "application/json": {
  3132. "schema": {
  3133. "$ref": "#/components/schemas/BadRequestError"
  3134. }
  3135. }
  3136. }
  3137. },
  3138. "404": {
  3139. "description": "McpServerNotFoundError",
  3140. "content": {
  3141. "application/json": {
  3142. "schema": {
  3143. "$ref": "#/components/schemas/McpServerNotFoundError"
  3144. }
  3145. }
  3146. }
  3147. }
  3148. },
  3149. "description": "Remove OAuth credentials for an MCP server.",
  3150. "summary": "Remove MCP OAuth",
  3151. "x-codeSamples": [
  3152. {
  3153. "lang": "js",
  3154. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.remove({\n ...\n})"
  3155. }
  3156. ]
  3157. }
  3158. },
  3159. "/mcp/{name}/auth/callback": {
  3160. "post": {
  3161. "tags": ["mcp"],
  3162. "operationId": "mcp.auth.callback",
  3163. "parameters": [
  3164. {
  3165. "name": "name",
  3166. "in": "path",
  3167. "schema": {
  3168. "type": "string"
  3169. },
  3170. "required": true
  3171. },
  3172. {
  3173. "name": "directory",
  3174. "in": "query",
  3175. "schema": {
  3176. "type": "string"
  3177. },
  3178. "required": false
  3179. },
  3180. {
  3181. "name": "workspace",
  3182. "in": "query",
  3183. "schema": {
  3184. "type": "string"
  3185. },
  3186. "required": false
  3187. }
  3188. ],
  3189. "responses": {
  3190. "200": {
  3191. "description": "OAuth authentication completed",
  3192. "content": {
  3193. "application/json": {
  3194. "schema": {
  3195. "$ref": "#/components/schemas/MCPStatus"
  3196. }
  3197. }
  3198. }
  3199. },
  3200. "400": {
  3201. "description": "BadRequest | InvalidRequestError",
  3202. "content": {
  3203. "application/json": {
  3204. "schema": {
  3205. "anyOf": [
  3206. {
  3207. "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
  3208. },
  3209. {
  3210. "$ref": "#/components/schemas/InvalidRequestError"
  3211. }
  3212. ]
  3213. }
  3214. }
  3215. }
  3216. },
  3217. "404": {
  3218. "description": "McpServerNotFoundError",
  3219. "content": {
  3220. "application/json": {
  3221. "schema": {
  3222. "$ref": "#/components/schemas/McpServerNotFoundError"
  3223. }
  3224. }
  3225. }
  3226. }
  3227. },
  3228. "description": "Complete OAuth authentication for a Model Context Protocol (MCP) server using the authorization code.",
  3229. "summary": "Complete MCP OAuth",
  3230. "requestBody": {
  3231. "content": {
  3232. "application/json": {
  3233. "schema": {
  3234. "type": "object",
  3235. "properties": {
  3236. "code": {
  3237. "type": "string"
  3238. }
  3239. },
  3240. "required": ["code"],
  3241. "additionalProperties": false
  3242. }
  3243. }
  3244. }
  3245. },
  3246. "x-codeSamples": [
  3247. {
  3248. "lang": "js",
  3249. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.callback({\n ...\n})"
  3250. }
  3251. ]
  3252. }
  3253. },
  3254. "/mcp/{name}/auth/authenticate": {
  3255. "post": {
  3256. "tags": ["mcp"],
  3257. "operationId": "mcp.auth.authenticate",
  3258. "parameters": [
  3259. {
  3260. "name": "name",
  3261. "in": "path",
  3262. "schema": {
  3263. "type": "string"
  3264. },
  3265. "required": true
  3266. },
  3267. {
  3268. "name": "directory",
  3269. "in": "query",
  3270. "schema": {
  3271. "type": "string"
  3272. },
  3273. "required": false
  3274. },
  3275. {
  3276. "name": "workspace",
  3277. "in": "query",
  3278. "schema": {
  3279. "type": "string"
  3280. },
  3281. "required": false
  3282. }
  3283. ],
  3284. "responses": {
  3285. "200": {
  3286. "description": "OAuth authentication completed",
  3287. "content": {
  3288. "application/json": {
  3289. "schema": {
  3290. "$ref": "#/components/schemas/MCPStatus"
  3291. }
  3292. }
  3293. }
  3294. },
  3295. "400": {
  3296. "description": "McpUnsupportedOAuthError | InvalidRequestError",
  3297. "content": {
  3298. "application/json": {
  3299. "schema": {
  3300. "anyOf": [
  3301. {
  3302. "$ref": "#/components/schemas/McpUnsupportedOAuthError"
  3303. },
  3304. {
  3305. "$ref": "#/components/schemas/InvalidRequestError"
  3306. }
  3307. ]
  3308. }
  3309. }
  3310. }
  3311. },
  3312. "404": {
  3313. "description": "McpServerNotFoundError",
  3314. "content": {
  3315. "application/json": {
  3316. "schema": {
  3317. "$ref": "#/components/schemas/McpServerNotFoundError"
  3318. }
  3319. }
  3320. }
  3321. }
  3322. },
  3323. "description": "Start OAuth flow and wait for callback (opens browser).",
  3324. "summary": "Authenticate MCP OAuth",
  3325. "x-codeSamples": [
  3326. {
  3327. "lang": "js",
  3328. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.authenticate({\n ...\n})"
  3329. }
  3330. ]
  3331. }
  3332. },
  3333. "/mcp/{name}/connect": {
  3334. "post": {
  3335. "tags": ["mcp"],
  3336. "operationId": "mcp.connect",
  3337. "parameters": [
  3338. {
  3339. "name": "name",
  3340. "in": "path",
  3341. "schema": {
  3342. "type": "string"
  3343. },
  3344. "required": true
  3345. },
  3346. {
  3347. "name": "directory",
  3348. "in": "query",
  3349. "schema": {
  3350. "type": "string"
  3351. },
  3352. "required": false
  3353. },
  3354. {
  3355. "name": "workspace",
  3356. "in": "query",
  3357. "schema": {
  3358. "type": "string"
  3359. },
  3360. "required": false
  3361. }
  3362. ],
  3363. "responses": {
  3364. "200": {
  3365. "description": "MCP server connected successfully",
  3366. "content": {
  3367. "application/json": {
  3368. "schema": {
  3369. "type": "boolean",
  3370. "description": "MCP server connected successfully"
  3371. }
  3372. }
  3373. }
  3374. },
  3375. "400": {
  3376. "description": "Bad request",
  3377. "content": {
  3378. "application/json": {
  3379. "schema": {
  3380. "$ref": "#/components/schemas/BadRequestError"
  3381. }
  3382. }
  3383. }
  3384. },
  3385. "404": {
  3386. "description": "McpServerNotFoundError",
  3387. "content": {
  3388. "application/json": {
  3389. "schema": {
  3390. "$ref": "#/components/schemas/McpServerNotFoundError"
  3391. }
  3392. }
  3393. }
  3394. }
  3395. },
  3396. "description": "Connect an MCP server.",
  3397. "x-codeSamples": [
  3398. {
  3399. "lang": "js",
  3400. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.connect({\n ...\n})"
  3401. }
  3402. ]
  3403. }
  3404. },
  3405. "/mcp/{name}/disconnect": {
  3406. "post": {
  3407. "tags": ["mcp"],
  3408. "operationId": "mcp.disconnect",
  3409. "parameters": [
  3410. {
  3411. "name": "name",
  3412. "in": "path",
  3413. "schema": {
  3414. "type": "string"
  3415. },
  3416. "required": true
  3417. },
  3418. {
  3419. "name": "directory",
  3420. "in": "query",
  3421. "schema": {
  3422. "type": "string"
  3423. },
  3424. "required": false
  3425. },
  3426. {
  3427. "name": "workspace",
  3428. "in": "query",
  3429. "schema": {
  3430. "type": "string"
  3431. },
  3432. "required": false
  3433. }
  3434. ],
  3435. "responses": {
  3436. "200": {
  3437. "description": "MCP server disconnected successfully",
  3438. "content": {
  3439. "application/json": {
  3440. "schema": {
  3441. "type": "boolean",
  3442. "description": "MCP server disconnected successfully"
  3443. }
  3444. }
  3445. }
  3446. },
  3447. "400": {
  3448. "description": "Bad request",
  3449. "content": {
  3450. "application/json": {
  3451. "schema": {
  3452. "$ref": "#/components/schemas/BadRequestError"
  3453. }
  3454. }
  3455. }
  3456. },
  3457. "404": {
  3458. "description": "McpServerNotFoundError",
  3459. "content": {
  3460. "application/json": {
  3461. "schema": {
  3462. "$ref": "#/components/schemas/McpServerNotFoundError"
  3463. }
  3464. }
  3465. }
  3466. }
  3467. },
  3468. "description": "Disconnect an MCP server.",
  3469. "x-codeSamples": [
  3470. {
  3471. "lang": "js",
  3472. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.disconnect({\n ...\n})"
  3473. }
  3474. ]
  3475. }
  3476. },
  3477. "/project": {
  3478. "get": {
  3479. "tags": ["project"],
  3480. "operationId": "project.list",
  3481. "parameters": [
  3482. {
  3483. "name": "directory",
  3484. "in": "query",
  3485. "schema": {
  3486. "type": "string"
  3487. },
  3488. "required": false
  3489. },
  3490. {
  3491. "name": "workspace",
  3492. "in": "query",
  3493. "schema": {
  3494. "type": "string"
  3495. },
  3496. "required": false
  3497. }
  3498. ],
  3499. "responses": {
  3500. "200": {
  3501. "description": "List of projects",
  3502. "content": {
  3503. "application/json": {
  3504. "schema": {
  3505. "type": "array",
  3506. "items": {
  3507. "$ref": "#/components/schemas/Project"
  3508. },
  3509. "description": "List of projects"
  3510. }
  3511. }
  3512. }
  3513. },
  3514. "400": {
  3515. "description": "Bad request",
  3516. "content": {
  3517. "application/json": {
  3518. "schema": {
  3519. "$ref": "#/components/schemas/BadRequestError"
  3520. }
  3521. }
  3522. }
  3523. }
  3524. },
  3525. "description": "Get a list of projects that have been opened with OpenCode.",
  3526. "summary": "List all projects",
  3527. "x-codeSamples": [
  3528. {
  3529. "lang": "js",
  3530. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.list({\n ...\n})"
  3531. }
  3532. ]
  3533. }
  3534. },
  3535. "/project/current": {
  3536. "get": {
  3537. "tags": ["project"],
  3538. "operationId": "project.current",
  3539. "parameters": [
  3540. {
  3541. "name": "directory",
  3542. "in": "query",
  3543. "schema": {
  3544. "type": "string"
  3545. },
  3546. "required": false
  3547. },
  3548. {
  3549. "name": "workspace",
  3550. "in": "query",
  3551. "schema": {
  3552. "type": "string"
  3553. },
  3554. "required": false
  3555. }
  3556. ],
  3557. "responses": {
  3558. "200": {
  3559. "description": "Current project information",
  3560. "content": {
  3561. "application/json": {
  3562. "schema": {
  3563. "$ref": "#/components/schemas/Project"
  3564. }
  3565. }
  3566. }
  3567. },
  3568. "400": {
  3569. "description": "Bad request",
  3570. "content": {
  3571. "application/json": {
  3572. "schema": {
  3573. "$ref": "#/components/schemas/BadRequestError"
  3574. }
  3575. }
  3576. }
  3577. }
  3578. },
  3579. "description": "Retrieve the currently active project that OpenCode is working with.",
  3580. "summary": "Get current project",
  3581. "x-codeSamples": [
  3582. {
  3583. "lang": "js",
  3584. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.current({\n ...\n})"
  3585. }
  3586. ]
  3587. }
  3588. },
  3589. "/project/git/init": {
  3590. "post": {
  3591. "tags": ["project"],
  3592. "operationId": "project.initGit",
  3593. "parameters": [
  3594. {
  3595. "name": "directory",
  3596. "in": "query",
  3597. "schema": {
  3598. "type": "string"
  3599. },
  3600. "required": false
  3601. },
  3602. {
  3603. "name": "workspace",
  3604. "in": "query",
  3605. "schema": {
  3606. "type": "string"
  3607. },
  3608. "required": false
  3609. }
  3610. ],
  3611. "responses": {
  3612. "200": {
  3613. "description": "Project information after git initialization",
  3614. "content": {
  3615. "application/json": {
  3616. "schema": {
  3617. "$ref": "#/components/schemas/Project"
  3618. }
  3619. }
  3620. }
  3621. },
  3622. "400": {
  3623. "description": "Bad request",
  3624. "content": {
  3625. "application/json": {
  3626. "schema": {
  3627. "$ref": "#/components/schemas/BadRequestError"
  3628. }
  3629. }
  3630. }
  3631. }
  3632. },
  3633. "description": "Create a git repository for the current project and return the refreshed project info.",
  3634. "summary": "Initialize git repository",
  3635. "x-codeSamples": [
  3636. {
  3637. "lang": "js",
  3638. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.initGit({\n ...\n})"
  3639. }
  3640. ]
  3641. }
  3642. },
  3643. "/project/{projectID}": {
  3644. "patch": {
  3645. "tags": ["project"],
  3646. "operationId": "project.update",
  3647. "parameters": [
  3648. {
  3649. "name": "projectID",
  3650. "in": "path",
  3651. "schema": {
  3652. "type": "string"
  3653. },
  3654. "required": true
  3655. },
  3656. {
  3657. "name": "directory",
  3658. "in": "query",
  3659. "schema": {
  3660. "type": "string"
  3661. },
  3662. "required": false
  3663. },
  3664. {
  3665. "name": "workspace",
  3666. "in": "query",
  3667. "schema": {
  3668. "type": "string"
  3669. },
  3670. "required": false
  3671. }
  3672. ],
  3673. "responses": {
  3674. "200": {
  3675. "description": "Updated project information",
  3676. "content": {
  3677. "application/json": {
  3678. "schema": {
  3679. "$ref": "#/components/schemas/Project"
  3680. }
  3681. }
  3682. }
  3683. },
  3684. "400": {
  3685. "description": "BadRequest | InvalidRequestError",
  3686. "content": {
  3687. "application/json": {
  3688. "schema": {
  3689. "anyOf": [
  3690. {
  3691. "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
  3692. },
  3693. {
  3694. "$ref": "#/components/schemas/InvalidRequestError"
  3695. }
  3696. ]
  3697. }
  3698. }
  3699. }
  3700. },
  3701. "404": {
  3702. "description": "ProjectNotFoundError",
  3703. "content": {
  3704. "application/json": {
  3705. "schema": {
  3706. "$ref": "#/components/schemas/ProjectNotFoundError"
  3707. }
  3708. }
  3709. }
  3710. }
  3711. },
  3712. "description": "Update project properties such as name, icon, and commands.",
  3713. "summary": "Update project",
  3714. "requestBody": {
  3715. "content": {
  3716. "application/json": {
  3717. "schema": {
  3718. "type": "object",
  3719. "properties": {
  3720. "name": {
  3721. "type": "string"
  3722. },
  3723. "icon": {
  3724. "type": "object",
  3725. "properties": {
  3726. "url": {
  3727. "type": "string"
  3728. },
  3729. "override": {
  3730. "type": "string"
  3731. },
  3732. "color": {
  3733. "type": "string"
  3734. }
  3735. },
  3736. "additionalProperties": false
  3737. },
  3738. "commands": {
  3739. "type": "object",
  3740. "properties": {
  3741. "start": {
  3742. "type": "string",
  3743. "description": "Startup script to run when creating a new workspace (worktree)"
  3744. }
  3745. },
  3746. "additionalProperties": false
  3747. }
  3748. },
  3749. "additionalProperties": false
  3750. }
  3751. }
  3752. }
  3753. },
  3754. "x-codeSamples": [
  3755. {
  3756. "lang": "js",
  3757. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.update({\n ...\n})"
  3758. }
  3759. ]
  3760. }
  3761. },
  3762. "/project/{projectID}/directories": {
  3763. "get": {
  3764. "tags": ["project"],
  3765. "operationId": "project.directories",
  3766. "parameters": [
  3767. {
  3768. "name": "projectID",
  3769. "in": "path",
  3770. "schema": {
  3771. "type": "string"
  3772. },
  3773. "required": true
  3774. },
  3775. {
  3776. "name": "directory",
  3777. "in": "query",
  3778. "schema": {
  3779. "type": "string"
  3780. },
  3781. "required": false
  3782. },
  3783. {
  3784. "name": "workspace",
  3785. "in": "query",
  3786. "schema": {
  3787. "type": "string"
  3788. },
  3789. "required": false
  3790. }
  3791. ],
  3792. "responses": {
  3793. "200": {
  3794. "description": "Project directories",
  3795. "content": {
  3796. "application/json": {
  3797. "schema": {
  3798. "$ref": "#/components/schemas/ProjectDirectories"
  3799. }
  3800. }
  3801. }
  3802. },
  3803. "400": {
  3804. "description": "Bad request",
  3805. "content": {
  3806. "application/json": {
  3807. "schema": {
  3808. "$ref": "#/components/schemas/BadRequestError"
  3809. }
  3810. }
  3811. }
  3812. }
  3813. },
  3814. "description": "List known local absolute directories for a project.",
  3815. "summary": "List project directories",
  3816. "x-codeSamples": [
  3817. {
  3818. "lang": "js",
  3819. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.directories({\n ...\n})"
  3820. }
  3821. ]
  3822. }
  3823. },
  3824. "/experimental/project/{projectID}/copy": {
  3825. "post": {
  3826. "tags": ["projectCopy"],
  3827. "operationId": "experimental.projectCopy.create",
  3828. "parameters": [
  3829. {
  3830. "name": "projectID",
  3831. "in": "path",
  3832. "schema": {
  3833. "type": "string"
  3834. },
  3835. "required": true
  3836. },
  3837. {
  3838. "name": "workspace",
  3839. "in": "query",
  3840. "schema": {
  3841. "type": "string"
  3842. },
  3843. "required": false
  3844. }
  3845. ],
  3846. "responses": {
  3847. "200": {
  3848. "description": "Project copy created",
  3849. "content": {
  3850. "application/json": {
  3851. "schema": {
  3852. "$ref": "#/components/schemas/ProjectCopyCopy"
  3853. }
  3854. }
  3855. }
  3856. },
  3857. "400": {
  3858. "description": "ProjectCopyError | InvalidRequestError",
  3859. "content": {
  3860. "application/json": {
  3861. "schema": {
  3862. "anyOf": [
  3863. {
  3864. "$ref": "#/components/schemas/ProjectCopyError"
  3865. },
  3866. {
  3867. "$ref": "#/components/schemas/InvalidRequestError"
  3868. }
  3869. ]
  3870. }
  3871. }
  3872. }
  3873. }
  3874. },
  3875. "description": "Create a local physical copy of a project using the selected strategy.",
  3876. "summary": "Create project copy",
  3877. "requestBody": {
  3878. "content": {
  3879. "application/json": {
  3880. "schema": {
  3881. "type": "object",
  3882. "properties": {
  3883. "strategy": {
  3884. "type": "string",
  3885. "enum": ["git_worktree"]
  3886. },
  3887. "directory": {
  3888. "type": "string"
  3889. },
  3890. "name": {
  3891. "type": "string"
  3892. },
  3893. "context": {
  3894. "type": "string"
  3895. }
  3896. },
  3897. "required": ["strategy", "directory"],
  3898. "additionalProperties": false
  3899. }
  3900. }
  3901. }
  3902. },
  3903. "x-codeSamples": [
  3904. {
  3905. "lang": "js",
  3906. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.projectCopy.create({\n ...\n})"
  3907. }
  3908. ]
  3909. },
  3910. "delete": {
  3911. "tags": ["projectCopy"],
  3912. "operationId": "experimental.projectCopy.remove",
  3913. "parameters": [
  3914. {
  3915. "name": "projectID",
  3916. "in": "path",
  3917. "schema": {
  3918. "type": "string"
  3919. },
  3920. "required": true
  3921. },
  3922. {
  3923. "name": "directory",
  3924. "in": "query",
  3925. "schema": {
  3926. "type": "string"
  3927. },
  3928. "required": false
  3929. },
  3930. {
  3931. "name": "workspace",
  3932. "in": "query",
  3933. "schema": {
  3934. "type": "string"
  3935. },
  3936. "required": false
  3937. }
  3938. ],
  3939. "responses": {
  3940. "204": {
  3941. "description": "Project copy removed"
  3942. },
  3943. "400": {
  3944. "description": "ProjectCopyError | InvalidRequestError",
  3945. "content": {
  3946. "application/json": {
  3947. "schema": {
  3948. "anyOf": [
  3949. {
  3950. "$ref": "#/components/schemas/ProjectCopyError"
  3951. },
  3952. {
  3953. "$ref": "#/components/schemas/InvalidRequestError"
  3954. }
  3955. ]
  3956. }
  3957. }
  3958. }
  3959. }
  3960. },
  3961. "description": "Remove a local physical copy of a project using the selected strategy.",
  3962. "summary": "Remove project copy",
  3963. "requestBody": {
  3964. "content": {
  3965. "application/json": {
  3966. "schema": {
  3967. "type": "object",
  3968. "properties": {
  3969. "directory": {
  3970. "type": "string"
  3971. }
  3972. },
  3973. "required": ["directory"],
  3974. "additionalProperties": false
  3975. }
  3976. }
  3977. }
  3978. },
  3979. "x-codeSamples": [
  3980. {
  3981. "lang": "js",
  3982. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.projectCopy.remove({\n ...\n})"
  3983. }
  3984. ]
  3985. }
  3986. },
  3987. "/experimental/project/{projectID}/copy/refresh": {
  3988. "post": {
  3989. "tags": ["projectCopy"],
  3990. "operationId": "experimental.projectCopy.refresh",
  3991. "parameters": [
  3992. {
  3993. "name": "projectID",
  3994. "in": "path",
  3995. "schema": {
  3996. "type": "string"
  3997. },
  3998. "required": true
  3999. },
  4000. {
  4001. "name": "directory",
  4002. "in": "query",
  4003. "schema": {
  4004. "type": "string"
  4005. },
  4006. "required": false
  4007. },
  4008. {
  4009. "name": "workspace",
  4010. "in": "query",
  4011. "schema": {
  4012. "type": "string"
  4013. },
  4014. "required": false
  4015. }
  4016. ],
  4017. "responses": {
  4018. "204": {
  4019. "description": "Project copies refreshed"
  4020. },
  4021. "400": {
  4022. "description": "ProjectCopyError | InvalidRequestError",
  4023. "content": {
  4024. "application/json": {
  4025. "schema": {
  4026. "anyOf": [
  4027. {
  4028. "$ref": "#/components/schemas/ProjectCopyError"
  4029. },
  4030. {
  4031. "$ref": "#/components/schemas/InvalidRequestError"
  4032. }
  4033. ]
  4034. }
  4035. }
  4036. }
  4037. }
  4038. },
  4039. "description": "Discover local project copies using one or all configured strategies.",
  4040. "summary": "Refresh project copies",
  4041. "x-codeSamples": [
  4042. {
  4043. "lang": "js",
  4044. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.projectCopy.refresh({\n ...\n})"
  4045. }
  4046. ]
  4047. }
  4048. },
  4049. "/pty/shells": {
  4050. "get": {
  4051. "tags": ["pty"],
  4052. "operationId": "pty.shells",
  4053. "parameters": [
  4054. {
  4055. "name": "directory",
  4056. "in": "query",
  4057. "schema": {
  4058. "type": "string"
  4059. },
  4060. "required": false
  4061. },
  4062. {
  4063. "name": "workspace",
  4064. "in": "query",
  4065. "schema": {
  4066. "type": "string"
  4067. },
  4068. "required": false
  4069. }
  4070. ],
  4071. "responses": {
  4072. "200": {
  4073. "description": "List of shells",
  4074. "content": {
  4075. "application/json": {
  4076. "schema": {
  4077. "type": "array",
  4078. "items": {
  4079. "type": "object",
  4080. "properties": {
  4081. "path": {
  4082. "type": "string"
  4083. },
  4084. "name": {
  4085. "type": "string"
  4086. },
  4087. "acceptable": {
  4088. "type": "boolean"
  4089. }
  4090. },
  4091. "required": ["path", "name", "acceptable"],
  4092. "additionalProperties": false
  4093. },
  4094. "description": "List of shells"
  4095. }
  4096. }
  4097. }
  4098. },
  4099. "400": {
  4100. "description": "Bad request",
  4101. "content": {
  4102. "application/json": {
  4103. "schema": {
  4104. "$ref": "#/components/schemas/BadRequestError"
  4105. }
  4106. }
  4107. }
  4108. }
  4109. },
  4110. "description": "Get a list of available shells on the system.",
  4111. "summary": "List available shells",
  4112. "x-codeSamples": [
  4113. {
  4114. "lang": "js",
  4115. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.shells({\n ...\n})"
  4116. }
  4117. ]
  4118. }
  4119. },
  4120. "/pty": {
  4121. "get": {
  4122. "tags": ["pty"],
  4123. "operationId": "pty.list",
  4124. "parameters": [
  4125. {
  4126. "name": "directory",
  4127. "in": "query",
  4128. "schema": {
  4129. "type": "string"
  4130. },
  4131. "required": false
  4132. },
  4133. {
  4134. "name": "workspace",
  4135. "in": "query",
  4136. "schema": {
  4137. "type": "string"
  4138. },
  4139. "required": false
  4140. }
  4141. ],
  4142. "responses": {
  4143. "200": {
  4144. "description": "List of sessions",
  4145. "content": {
  4146. "application/json": {
  4147. "schema": {
  4148. "type": "array",
  4149. "items": {
  4150. "$ref": "#/components/schemas/Pty"
  4151. },
  4152. "description": "List of sessions"
  4153. }
  4154. }
  4155. }
  4156. },
  4157. "400": {
  4158. "description": "Bad request",
  4159. "content": {
  4160. "application/json": {
  4161. "schema": {
  4162. "$ref": "#/components/schemas/BadRequestError"
  4163. }
  4164. }
  4165. }
  4166. }
  4167. },
  4168. "description": "Get a list of all active pseudo-terminal (PTY) sessions managed by OpenCode.",
  4169. "summary": "List PTY sessions",
  4170. "x-codeSamples": [
  4171. {
  4172. "lang": "js",
  4173. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.list({\n ...\n})"
  4174. }
  4175. ]
  4176. },
  4177. "post": {
  4178. "tags": ["pty"],
  4179. "operationId": "pty.create",
  4180. "parameters": [
  4181. {
  4182. "name": "directory",
  4183. "in": "query",
  4184. "schema": {
  4185. "type": "string"
  4186. },
  4187. "required": false
  4188. },
  4189. {
  4190. "name": "workspace",
  4191. "in": "query",
  4192. "schema": {
  4193. "type": "string"
  4194. },
  4195. "required": false
  4196. }
  4197. ],
  4198. "responses": {
  4199. "200": {
  4200. "description": "Created session",
  4201. "content": {
  4202. "application/json": {
  4203. "schema": {
  4204. "$ref": "#/components/schemas/Pty"
  4205. }
  4206. }
  4207. }
  4208. },
  4209. "400": {
  4210. "description": "BadRequest | InvalidRequestError",
  4211. "content": {
  4212. "application/json": {
  4213. "schema": {
  4214. "anyOf": [
  4215. {
  4216. "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
  4217. },
  4218. {
  4219. "$ref": "#/components/schemas/InvalidRequestError"
  4220. }
  4221. ]
  4222. }
  4223. }
  4224. }
  4225. }
  4226. },
  4227. "description": "Create a new pseudo-terminal (PTY) session for running shell commands and processes.",
  4228. "summary": "Create PTY session",
  4229. "requestBody": {
  4230. "content": {
  4231. "application/json": {
  4232. "schema": {
  4233. "type": "object",
  4234. "properties": {
  4235. "command": {
  4236. "type": "string"
  4237. },
  4238. "args": {
  4239. "type": "array",
  4240. "items": {
  4241. "type": "string"
  4242. }
  4243. },
  4244. "cwd": {
  4245. "type": "string"
  4246. },
  4247. "title": {
  4248. "type": "string"
  4249. },
  4250. "env": {
  4251. "type": "object",
  4252. "additionalProperties": {
  4253. "type": "string"
  4254. }
  4255. }
  4256. },
  4257. "additionalProperties": false
  4258. }
  4259. }
  4260. }
  4261. },
  4262. "x-codeSamples": [
  4263. {
  4264. "lang": "js",
  4265. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.create({\n ...\n})"
  4266. }
  4267. ]
  4268. }
  4269. },
  4270. "/pty/{ptyID}": {
  4271. "get": {
  4272. "tags": ["pty"],
  4273. "operationId": "pty.get",
  4274. "parameters": [
  4275. {
  4276. "name": "ptyID",
  4277. "in": "path",
  4278. "schema": {
  4279. "type": "string",
  4280. "pattern": "^pty"
  4281. },
  4282. "required": true
  4283. },
  4284. {
  4285. "name": "directory",
  4286. "in": "query",
  4287. "schema": {
  4288. "type": "string"
  4289. },
  4290. "required": false
  4291. },
  4292. {
  4293. "name": "workspace",
  4294. "in": "query",
  4295. "schema": {
  4296. "type": "string"
  4297. },
  4298. "required": false
  4299. }
  4300. ],
  4301. "responses": {
  4302. "200": {
  4303. "description": "Session info",
  4304. "content": {
  4305. "application/json": {
  4306. "schema": {
  4307. "$ref": "#/components/schemas/Pty"
  4308. }
  4309. }
  4310. }
  4311. },
  4312. "400": {
  4313. "description": "Bad request",
  4314. "content": {
  4315. "application/json": {
  4316. "schema": {
  4317. "$ref": "#/components/schemas/BadRequestError"
  4318. }
  4319. }
  4320. }
  4321. },
  4322. "404": {
  4323. "description": "PtyNotFoundError",
  4324. "content": {
  4325. "application/json": {
  4326. "schema": {
  4327. "$ref": "#/components/schemas/PtyNotFoundError"
  4328. }
  4329. }
  4330. }
  4331. }
  4332. },
  4333. "description": "Retrieve detailed information about a specific pseudo-terminal (PTY) session.",
  4334. "summary": "Get PTY session",
  4335. "x-codeSamples": [
  4336. {
  4337. "lang": "js",
  4338. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.get({\n ...\n})"
  4339. }
  4340. ]
  4341. },
  4342. "put": {
  4343. "tags": ["pty"],
  4344. "operationId": "pty.update",
  4345. "parameters": [
  4346. {
  4347. "name": "ptyID",
  4348. "in": "path",
  4349. "schema": {
  4350. "type": "string",
  4351. "pattern": "^pty"
  4352. },
  4353. "required": true
  4354. },
  4355. {
  4356. "name": "directory",
  4357. "in": "query",
  4358. "schema": {
  4359. "type": "string"
  4360. },
  4361. "required": false
  4362. },
  4363. {
  4364. "name": "workspace",
  4365. "in": "query",
  4366. "schema": {
  4367. "type": "string"
  4368. },
  4369. "required": false
  4370. }
  4371. ],
  4372. "responses": {
  4373. "200": {
  4374. "description": "Updated session",
  4375. "content": {
  4376. "application/json": {
  4377. "schema": {
  4378. "$ref": "#/components/schemas/Pty"
  4379. }
  4380. }
  4381. }
  4382. },
  4383. "400": {
  4384. "description": "BadRequest | InvalidRequestError",
  4385. "content": {
  4386. "application/json": {
  4387. "schema": {
  4388. "anyOf": [
  4389. {
  4390. "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
  4391. },
  4392. {
  4393. "$ref": "#/components/schemas/InvalidRequestError"
  4394. }
  4395. ]
  4396. }
  4397. }
  4398. }
  4399. },
  4400. "404": {
  4401. "description": "PtyNotFoundError",
  4402. "content": {
  4403. "application/json": {
  4404. "schema": {
  4405. "$ref": "#/components/schemas/PtyNotFoundError"
  4406. }
  4407. }
  4408. }
  4409. }
  4410. },
  4411. "description": "Update properties of an existing pseudo-terminal (PTY) session.",
  4412. "summary": "Update PTY session",
  4413. "requestBody": {
  4414. "content": {
  4415. "application/json": {
  4416. "schema": {
  4417. "type": "object",
  4418. "properties": {
  4419. "title": {
  4420. "type": "string"
  4421. },
  4422. "size": {
  4423. "type": "object",
  4424. "properties": {
  4425. "rows": {
  4426. "type": "integer",
  4427. "exclusiveMinimum": 0
  4428. },
  4429. "cols": {
  4430. "type": "integer",
  4431. "exclusiveMinimum": 0
  4432. }
  4433. },
  4434. "required": ["rows", "cols"],
  4435. "additionalProperties": false
  4436. }
  4437. },
  4438. "additionalProperties": false
  4439. }
  4440. }
  4441. }
  4442. },
  4443. "x-codeSamples": [
  4444. {
  4445. "lang": "js",
  4446. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.update({\n ...\n})"
  4447. }
  4448. ]
  4449. },
  4450. "delete": {
  4451. "tags": ["pty"],
  4452. "operationId": "pty.remove",
  4453. "parameters": [
  4454. {
  4455. "name": "ptyID",
  4456. "in": "path",
  4457. "schema": {
  4458. "type": "string",
  4459. "pattern": "^pty"
  4460. },
  4461. "required": true
  4462. },
  4463. {
  4464. "name": "directory",
  4465. "in": "query",
  4466. "schema": {
  4467. "type": "string"
  4468. },
  4469. "required": false
  4470. },
  4471. {
  4472. "name": "workspace",
  4473. "in": "query",
  4474. "schema": {
  4475. "type": "string"
  4476. },
  4477. "required": false
  4478. }
  4479. ],
  4480. "responses": {
  4481. "200": {
  4482. "description": "Session removed",
  4483. "content": {
  4484. "application/json": {
  4485. "schema": {
  4486. "type": "boolean",
  4487. "description": "Session removed"
  4488. }
  4489. }
  4490. }
  4491. },
  4492. "400": {
  4493. "description": "Bad request",
  4494. "content": {
  4495. "application/json": {
  4496. "schema": {
  4497. "$ref": "#/components/schemas/BadRequestError"
  4498. }
  4499. }
  4500. }
  4501. },
  4502. "404": {
  4503. "description": "PtyNotFoundError",
  4504. "content": {
  4505. "application/json": {
  4506. "schema": {
  4507. "$ref": "#/components/schemas/PtyNotFoundError"
  4508. }
  4509. }
  4510. }
  4511. }
  4512. },
  4513. "description": "Remove and terminate a specific pseudo-terminal (PTY) session.",
  4514. "summary": "Remove PTY session",
  4515. "x-codeSamples": [
  4516. {
  4517. "lang": "js",
  4518. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.remove({\n ...\n})"
  4519. }
  4520. ]
  4521. }
  4522. },
  4523. "/pty/{ptyID}/connect-token": {
  4524. "post": {
  4525. "tags": ["pty"],
  4526. "operationId": "pty.connectToken",
  4527. "parameters": [
  4528. {
  4529. "name": "ptyID",
  4530. "in": "path",
  4531. "schema": {
  4532. "type": "string",
  4533. "pattern": "^pty"
  4534. },
  4535. "required": true
  4536. },
  4537. {
  4538. "name": "directory",
  4539. "in": "query",
  4540. "schema": {
  4541. "type": "string"
  4542. },
  4543. "required": false
  4544. },
  4545. {
  4546. "name": "workspace",
  4547. "in": "query",
  4548. "schema": {
  4549. "type": "string"
  4550. },
  4551. "required": false
  4552. }
  4553. ],
  4554. "responses": {
  4555. "200": {
  4556. "description": "WebSocket connect token",
  4557. "content": {
  4558. "application/json": {
  4559. "schema": {
  4560. "type": "object",
  4561. "properties": {
  4562. "ticket": {
  4563. "type": "string"
  4564. },
  4565. "expires_in": {
  4566. "type": "integer",
  4567. "exclusiveMinimum": 0
  4568. }
  4569. },
  4570. "required": ["ticket", "expires_in"],
  4571. "additionalProperties": false,
  4572. "description": "WebSocket connect token"
  4573. }
  4574. }
  4575. }
  4576. },
  4577. "400": {
  4578. "description": "Bad request",
  4579. "content": {
  4580. "application/json": {
  4581. "schema": {
  4582. "$ref": "#/components/schemas/BadRequestError"
  4583. }
  4584. }
  4585. }
  4586. },
  4587. "403": {
  4588. "description": "PtyForbiddenError",
  4589. "content": {
  4590. "application/json": {
  4591. "schema": {
  4592. "$ref": "#/components/schemas/PtyForbiddenError"
  4593. }
  4594. }
  4595. }
  4596. },
  4597. "404": {
  4598. "description": "PtyNotFoundError",
  4599. "content": {
  4600. "application/json": {
  4601. "schema": {
  4602. "$ref": "#/components/schemas/PtyNotFoundError"
  4603. }
  4604. }
  4605. }
  4606. }
  4607. },
  4608. "description": "Create a short-lived ticket for opening a PTY WebSocket connection.",
  4609. "summary": "Create PTY WebSocket token",
  4610. "x-codeSamples": [
  4611. {
  4612. "lang": "js",
  4613. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.connectToken({\n ...\n})"
  4614. }
  4615. ]
  4616. }
  4617. },
  4618. "/question": {
  4619. "get": {
  4620. "tags": ["question"],
  4621. "operationId": "question.list",
  4622. "parameters": [
  4623. {
  4624. "name": "directory",
  4625. "in": "query",
  4626. "schema": {
  4627. "type": "string"
  4628. },
  4629. "required": false
  4630. },
  4631. {
  4632. "name": "workspace",
  4633. "in": "query",
  4634. "schema": {
  4635. "type": "string"
  4636. },
  4637. "required": false
  4638. }
  4639. ],
  4640. "responses": {
  4641. "200": {
  4642. "description": "List of pending questions",
  4643. "content": {
  4644. "application/json": {
  4645. "schema": {
  4646. "type": "array",
  4647. "items": {
  4648. "$ref": "#/components/schemas/QuestionRequest"
  4649. },
  4650. "description": "List of pending questions"
  4651. }
  4652. }
  4653. }
  4654. },
  4655. "400": {
  4656. "description": "Bad request",
  4657. "content": {
  4658. "application/json": {
  4659. "schema": {
  4660. "$ref": "#/components/schemas/BadRequestError"
  4661. }
  4662. }
  4663. }
  4664. }
  4665. },
  4666. "description": "Get all pending question requests across all sessions.",
  4667. "summary": "List pending questions",
  4668. "x-codeSamples": [
  4669. {
  4670. "lang": "js",
  4671. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.question.list({\n ...\n})"
  4672. }
  4673. ]
  4674. }
  4675. },
  4676. "/question/{requestID}/reply": {
  4677. "post": {
  4678. "tags": ["question"],
  4679. "operationId": "question.reply",
  4680. "parameters": [
  4681. {
  4682. "name": "requestID",
  4683. "in": "path",
  4684. "schema": {
  4685. "type": "string",
  4686. "pattern": "^que"
  4687. },
  4688. "required": true
  4689. },
  4690. {
  4691. "name": "directory",
  4692. "in": "query",
  4693. "schema": {
  4694. "type": "string"
  4695. },
  4696. "required": false
  4697. },
  4698. {
  4699. "name": "workspace",
  4700. "in": "query",
  4701. "schema": {
  4702. "type": "string"
  4703. },
  4704. "required": false
  4705. }
  4706. ],
  4707. "responses": {
  4708. "200": {
  4709. "description": "Question answered successfully",
  4710. "content": {
  4711. "application/json": {
  4712. "schema": {
  4713. "type": "boolean",
  4714. "description": "Question answered successfully"
  4715. }
  4716. }
  4717. }
  4718. },
  4719. "400": {
  4720. "description": "BadRequest | InvalidRequestError",
  4721. "content": {
  4722. "application/json": {
  4723. "schema": {
  4724. "anyOf": [
  4725. {
  4726. "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
  4727. },
  4728. {
  4729. "$ref": "#/components/schemas/InvalidRequestError"
  4730. }
  4731. ]
  4732. }
  4733. }
  4734. }
  4735. },
  4736. "404": {
  4737. "description": "QuestionNotFoundError",
  4738. "content": {
  4739. "application/json": {
  4740. "schema": {
  4741. "$ref": "#/components/schemas/QuestionNotFoundError"
  4742. }
  4743. }
  4744. }
  4745. }
  4746. },
  4747. "description": "Provide answers to a question request from the AI assistant.",
  4748. "summary": "Reply to question request",
  4749. "requestBody": {
  4750. "content": {
  4751. "application/json": {
  4752. "schema": {
  4753. "type": "object",
  4754. "properties": {
  4755. "answers": {
  4756. "type": "array",
  4757. "items": {
  4758. "$ref": "#/components/schemas/QuestionAnswer"
  4759. },
  4760. "description": "User answers in order of questions (each answer is an array of selected labels)"
  4761. }
  4762. },
  4763. "required": ["answers"],
  4764. "additionalProperties": false
  4765. }
  4766. }
  4767. }
  4768. },
  4769. "x-codeSamples": [
  4770. {
  4771. "lang": "js",
  4772. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.question.reply({\n ...\n})"
  4773. }
  4774. ]
  4775. }
  4776. },
  4777. "/question/{requestID}/reject": {
  4778. "post": {
  4779. "tags": ["question"],
  4780. "operationId": "question.reject",
  4781. "parameters": [
  4782. {
  4783. "name": "requestID",
  4784. "in": "path",
  4785. "schema": {
  4786. "type": "string",
  4787. "pattern": "^que"
  4788. },
  4789. "required": true
  4790. },
  4791. {
  4792. "name": "directory",
  4793. "in": "query",
  4794. "schema": {
  4795. "type": "string"
  4796. },
  4797. "required": false
  4798. },
  4799. {
  4800. "name": "workspace",
  4801. "in": "query",
  4802. "schema": {
  4803. "type": "string"
  4804. },
  4805. "required": false
  4806. }
  4807. ],
  4808. "responses": {
  4809. "200": {
  4810. "description": "Question rejected successfully",
  4811. "content": {
  4812. "application/json": {
  4813. "schema": {
  4814. "type": "boolean",
  4815. "description": "Question rejected successfully"
  4816. }
  4817. }
  4818. }
  4819. },
  4820. "400": {
  4821. "description": "BadRequest | InvalidRequestError",
  4822. "content": {
  4823. "application/json": {
  4824. "schema": {
  4825. "anyOf": [
  4826. {
  4827. "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
  4828. },
  4829. {
  4830. "$ref": "#/components/schemas/InvalidRequestError"
  4831. }
  4832. ]
  4833. }
  4834. }
  4835. }
  4836. },
  4837. "404": {
  4838. "description": "QuestionNotFoundError",
  4839. "content": {
  4840. "application/json": {
  4841. "schema": {
  4842. "$ref": "#/components/schemas/QuestionNotFoundError"
  4843. }
  4844. }
  4845. }
  4846. }
  4847. },
  4848. "description": "Reject a question request from the AI assistant.",
  4849. "summary": "Reject question request",
  4850. "x-codeSamples": [
  4851. {
  4852. "lang": "js",
  4853. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.question.reject({\n ...\n})"
  4854. }
  4855. ]
  4856. }
  4857. },
  4858. "/permission": {
  4859. "get": {
  4860. "tags": ["permission"],
  4861. "operationId": "permission.list",
  4862. "parameters": [
  4863. {
  4864. "name": "directory",
  4865. "in": "query",
  4866. "schema": {
  4867. "type": "string"
  4868. },
  4869. "required": false
  4870. },
  4871. {
  4872. "name": "workspace",
  4873. "in": "query",
  4874. "schema": {
  4875. "type": "string"
  4876. },
  4877. "required": false
  4878. }
  4879. ],
  4880. "responses": {
  4881. "200": {
  4882. "description": "List of pending permissions",
  4883. "content": {
  4884. "application/json": {
  4885. "schema": {
  4886. "type": "array",
  4887. "items": {
  4888. "$ref": "#/components/schemas/PermissionRequest"
  4889. },
  4890. "description": "List of pending permissions"
  4891. }
  4892. }
  4893. }
  4894. },
  4895. "400": {
  4896. "description": "Bad request",
  4897. "content": {
  4898. "application/json": {
  4899. "schema": {
  4900. "$ref": "#/components/schemas/BadRequestError"
  4901. }
  4902. }
  4903. }
  4904. }
  4905. },
  4906. "description": "Get all pending permission requests across all sessions.",
  4907. "summary": "List pending permissions",
  4908. "x-codeSamples": [
  4909. {
  4910. "lang": "js",
  4911. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.permission.list({\n ...\n})"
  4912. }
  4913. ]
  4914. }
  4915. },
  4916. "/permission/{requestID}/reply": {
  4917. "post": {
  4918. "tags": ["permission"],
  4919. "operationId": "permission.reply",
  4920. "parameters": [
  4921. {
  4922. "name": "requestID",
  4923. "in": "path",
  4924. "schema": {
  4925. "type": "string",
  4926. "pattern": "^per"
  4927. },
  4928. "required": true
  4929. },
  4930. {
  4931. "name": "directory",
  4932. "in": "query",
  4933. "schema": {
  4934. "type": "string"
  4935. },
  4936. "required": false
  4937. },
  4938. {
  4939. "name": "workspace",
  4940. "in": "query",
  4941. "schema": {
  4942. "type": "string"
  4943. },
  4944. "required": false
  4945. }
  4946. ],
  4947. "responses": {
  4948. "200": {
  4949. "description": "Permission processed successfully",
  4950. "content": {
  4951. "application/json": {
  4952. "schema": {
  4953. "type": "boolean",
  4954. "description": "Permission processed successfully"
  4955. }
  4956. }
  4957. }
  4958. },
  4959. "400": {
  4960. "description": "BadRequest | InvalidRequestError",
  4961. "content": {
  4962. "application/json": {
  4963. "schema": {
  4964. "anyOf": [
  4965. {
  4966. "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
  4967. },
  4968. {
  4969. "$ref": "#/components/schemas/InvalidRequestError"
  4970. }
  4971. ]
  4972. }
  4973. }
  4974. }
  4975. },
  4976. "404": {
  4977. "description": "PermissionNotFoundError",
  4978. "content": {
  4979. "application/json": {
  4980. "schema": {
  4981. "$ref": "#/components/schemas/PermissionNotFoundError"
  4982. }
  4983. }
  4984. }
  4985. }
  4986. },
  4987. "description": "Approve or deny a permission request from the AI assistant.",
  4988. "summary": "Respond to permission request",
  4989. "requestBody": {
  4990. "content": {
  4991. "application/json": {
  4992. "schema": {
  4993. "type": "object",
  4994. "properties": {
  4995. "reply": {
  4996. "type": "string",
  4997. "enum": ["once", "always", "reject"]
  4998. },
  4999. "message": {
  5000. "type": "string"
  5001. }
  5002. },
  5003. "required": ["reply"],
  5004. "additionalProperties": false
  5005. }
  5006. }
  5007. }
  5008. },
  5009. "x-codeSamples": [
  5010. {
  5011. "lang": "js",
  5012. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.permission.reply({\n ...\n})"
  5013. }
  5014. ]
  5015. }
  5016. },
  5017. "/provider": {
  5018. "get": {
  5019. "tags": ["provider"],
  5020. "operationId": "provider.list",
  5021. "parameters": [
  5022. {
  5023. "name": "directory",
  5024. "in": "query",
  5025. "schema": {
  5026. "type": "string"
  5027. },
  5028. "required": false
  5029. },
  5030. {
  5031. "name": "workspace",
  5032. "in": "query",
  5033. "schema": {
  5034. "type": "string"
  5035. },
  5036. "required": false
  5037. }
  5038. ],
  5039. "responses": {
  5040. "200": {
  5041. "description": "List of providers",
  5042. "content": {
  5043. "application/json": {
  5044. "schema": {
  5045. "type": "object",
  5046. "properties": {
  5047. "all": {
  5048. "type": "array",
  5049. "items": {
  5050. "$ref": "#/components/schemas/Provider"
  5051. }
  5052. },
  5053. "default": {
  5054. "type": "object",
  5055. "additionalProperties": {
  5056. "type": "string"
  5057. }
  5058. },
  5059. "connected": {
  5060. "type": "array",
  5061. "items": {
  5062. "type": "string"
  5063. }
  5064. }
  5065. },
  5066. "required": ["all", "default", "connected"],
  5067. "additionalProperties": false,
  5068. "description": "List of providers"
  5069. }
  5070. }
  5071. }
  5072. },
  5073. "400": {
  5074. "description": "Bad request",
  5075. "content": {
  5076. "application/json": {
  5077. "schema": {
  5078. "$ref": "#/components/schemas/BadRequestError"
  5079. }
  5080. }
  5081. }
  5082. }
  5083. },
  5084. "description": "Get a list of all available AI providers, including both available and connected ones.",
  5085. "summary": "List providers",
  5086. "x-codeSamples": [
  5087. {
  5088. "lang": "js",
  5089. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.list({\n ...\n})"
  5090. }
  5091. ]
  5092. }
  5093. },
  5094. "/provider/auth": {
  5095. "get": {
  5096. "tags": ["provider"],
  5097. "operationId": "provider.auth",
  5098. "parameters": [
  5099. {
  5100. "name": "directory",
  5101. "in": "query",
  5102. "schema": {
  5103. "type": "string"
  5104. },
  5105. "required": false
  5106. },
  5107. {
  5108. "name": "workspace",
  5109. "in": "query",
  5110. "schema": {
  5111. "type": "string"
  5112. },
  5113. "required": false
  5114. }
  5115. ],
  5116. "responses": {
  5117. "200": {
  5118. "description": "Provider auth methods",
  5119. "content": {
  5120. "application/json": {
  5121. "schema": {
  5122. "type": "object",
  5123. "additionalProperties": {
  5124. "type": "array",
  5125. "items": {
  5126. "$ref": "#/components/schemas/ProviderAuthMethod"
  5127. }
  5128. },
  5129. "description": "Provider auth methods"
  5130. }
  5131. }
  5132. }
  5133. },
  5134. "400": {
  5135. "description": "Bad request",
  5136. "content": {
  5137. "application/json": {
  5138. "schema": {
  5139. "$ref": "#/components/schemas/BadRequestError"
  5140. }
  5141. }
  5142. }
  5143. }
  5144. },
  5145. "description": "Retrieve available authentication methods for all AI providers.",
  5146. "summary": "Get provider auth methods",
  5147. "x-codeSamples": [
  5148. {
  5149. "lang": "js",
  5150. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.auth({\n ...\n})"
  5151. }
  5152. ]
  5153. }
  5154. },
  5155. "/provider/{providerID}/oauth/authorize": {
  5156. "post": {
  5157. "tags": ["provider"],
  5158. "operationId": "provider.oauth.authorize",
  5159. "parameters": [
  5160. {
  5161. "name": "providerID",
  5162. "in": "path",
  5163. "schema": {
  5164. "type": "string"
  5165. },
  5166. "required": true
  5167. },
  5168. {
  5169. "name": "directory",
  5170. "in": "query",
  5171. "schema": {
  5172. "type": "string"
  5173. },
  5174. "required": false
  5175. },
  5176. {
  5177. "name": "workspace",
  5178. "in": "query",
  5179. "schema": {
  5180. "type": "string"
  5181. },
  5182. "required": false
  5183. }
  5184. ],
  5185. "responses": {
  5186. "200": {
  5187. "description": "Authorization URL and method",
  5188. "content": {
  5189. "application/json": {
  5190. "schema": {
  5191. "$ref": "#/components/schemas/ProviderAuthAuthorization"
  5192. }
  5193. }
  5194. }
  5195. },
  5196. "400": {
  5197. "description": "ProviderAuthError | InvalidRequestError",
  5198. "content": {
  5199. "application/json": {
  5200. "schema": {
  5201. "anyOf": [
  5202. {
  5203. "$ref": "#/components/schemas/ProviderAuthError1"
  5204. },
  5205. {
  5206. "$ref": "#/components/schemas/InvalidRequestError"
  5207. }
  5208. ]
  5209. }
  5210. }
  5211. }
  5212. }
  5213. },
  5214. "description": "Start the OAuth authorization flow for a provider.",
  5215. "summary": "Start OAuth authorization",
  5216. "requestBody": {
  5217. "content": {
  5218. "application/json": {
  5219. "schema": {
  5220. "type": "object",
  5221. "properties": {
  5222. "method": {
  5223. "type": "number",
  5224. "description": "Auth method index"
  5225. },
  5226. "inputs": {
  5227. "type": "object",
  5228. "additionalProperties": {
  5229. "type": "string"
  5230. }
  5231. }
  5232. },
  5233. "required": ["method"],
  5234. "additionalProperties": false
  5235. }
  5236. }
  5237. }
  5238. },
  5239. "x-codeSamples": [
  5240. {
  5241. "lang": "js",
  5242. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.oauth.authorize({\n ...\n})"
  5243. }
  5244. ]
  5245. }
  5246. },
  5247. "/provider/{providerID}/oauth/callback": {
  5248. "post": {
  5249. "tags": ["provider"],
  5250. "operationId": "provider.oauth.callback",
  5251. "parameters": [
  5252. {
  5253. "name": "providerID",
  5254. "in": "path",
  5255. "schema": {
  5256. "type": "string"
  5257. },
  5258. "required": true
  5259. },
  5260. {
  5261. "name": "directory",
  5262. "in": "query",
  5263. "schema": {
  5264. "type": "string"
  5265. },
  5266. "required": false
  5267. },
  5268. {
  5269. "name": "workspace",
  5270. "in": "query",
  5271. "schema": {
  5272. "type": "string"
  5273. },
  5274. "required": false
  5275. }
  5276. ],
  5277. "responses": {
  5278. "200": {
  5279. "description": "OAuth callback processed successfully",
  5280. "content": {
  5281. "application/json": {
  5282. "schema": {
  5283. "type": "boolean",
  5284. "description": "OAuth callback processed successfully"
  5285. }
  5286. }
  5287. }
  5288. },
  5289. "400": {
  5290. "description": "ProviderAuthError | InvalidRequestError",
  5291. "content": {
  5292. "application/json": {
  5293. "schema": {
  5294. "anyOf": [
  5295. {
  5296. "$ref": "#/components/schemas/ProviderAuthError1"
  5297. },
  5298. {
  5299. "$ref": "#/components/schemas/InvalidRequestError"
  5300. }
  5301. ]
  5302. }
  5303. }
  5304. }
  5305. }
  5306. },
  5307. "description": "Handle the OAuth callback from a provider after user authorization.",
  5308. "summary": "Handle OAuth callback",
  5309. "requestBody": {
  5310. "content": {
  5311. "application/json": {
  5312. "schema": {
  5313. "type": "object",
  5314. "properties": {
  5315. "method": {
  5316. "type": "number",
  5317. "description": "Auth method index"
  5318. },
  5319. "code": {
  5320. "type": "string"
  5321. }
  5322. },
  5323. "required": ["method"],
  5324. "additionalProperties": false
  5325. }
  5326. }
  5327. }
  5328. },
  5329. "x-codeSamples": [
  5330. {
  5331. "lang": "js",
  5332. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.oauth.callback({\n ...\n})"
  5333. }
  5334. ]
  5335. }
  5336. },
  5337. "/session": {
  5338. "get": {
  5339. "tags": ["session"],
  5340. "operationId": "session.list",
  5341. "parameters": [
  5342. {
  5343. "name": "directory",
  5344. "in": "query",
  5345. "schema": {
  5346. "type": "string"
  5347. },
  5348. "required": false
  5349. },
  5350. {
  5351. "name": "workspace",
  5352. "in": "query",
  5353. "schema": {
  5354. "type": "string"
  5355. },
  5356. "required": false
  5357. },
  5358. {
  5359. "name": "scope",
  5360. "in": "query",
  5361. "schema": {
  5362. "type": "string",
  5363. "enum": ["project"]
  5364. },
  5365. "required": false
  5366. },
  5367. {
  5368. "name": "path",
  5369. "in": "query",
  5370. "schema": {
  5371. "type": "string"
  5372. },
  5373. "required": false
  5374. },
  5375. {
  5376. "name": "roots",
  5377. "in": "query",
  5378. "schema": {
  5379. "anyOf": [
  5380. {
  5381. "type": "boolean"
  5382. },
  5383. {
  5384. "type": "string",
  5385. "enum": ["true", "false"]
  5386. }
  5387. ]
  5388. },
  5389. "required": false
  5390. },
  5391. {
  5392. "name": "start",
  5393. "in": "query",
  5394. "schema": {
  5395. "type": "number"
  5396. },
  5397. "required": false
  5398. },
  5399. {
  5400. "name": "search",
  5401. "in": "query",
  5402. "schema": {
  5403. "type": "string"
  5404. },
  5405. "required": false
  5406. },
  5407. {
  5408. "name": "limit",
  5409. "in": "query",
  5410. "schema": {
  5411. "type": "number"
  5412. },
  5413. "required": false
  5414. }
  5415. ],
  5416. "responses": {
  5417. "200": {
  5418. "description": "List of sessions",
  5419. "content": {
  5420. "application/json": {
  5421. "schema": {
  5422. "type": "array",
  5423. "items": {
  5424. "$ref": "#/components/schemas/Session"
  5425. },
  5426. "description": "List of sessions"
  5427. }
  5428. }
  5429. }
  5430. },
  5431. "400": {
  5432. "description": "Bad request",
  5433. "content": {
  5434. "application/json": {
  5435. "schema": {
  5436. "$ref": "#/components/schemas/BadRequestError"
  5437. }
  5438. }
  5439. }
  5440. }
  5441. },
  5442. "description": "Get a list of all OpenCode sessions, sorted by most recently updated.",
  5443. "summary": "List sessions",
  5444. "x-codeSamples": [
  5445. {
  5446. "lang": "js",
  5447. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.list({\n ...\n})"
  5448. }
  5449. ]
  5450. },
  5451. "post": {
  5452. "tags": ["session"],
  5453. "operationId": "session.create",
  5454. "parameters": [
  5455. {
  5456. "name": "directory",
  5457. "in": "query",
  5458. "schema": {
  5459. "type": "string"
  5460. },
  5461. "required": false
  5462. },
  5463. {
  5464. "name": "workspace",
  5465. "in": "query",
  5466. "schema": {
  5467. "type": "string"
  5468. },
  5469. "required": false
  5470. }
  5471. ],
  5472. "responses": {
  5473. "200": {
  5474. "description": "Successfully created session",
  5475. "content": {
  5476. "application/json": {
  5477. "schema": {
  5478. "$ref": "#/components/schemas/Session"
  5479. }
  5480. }
  5481. }
  5482. },
  5483. "400": {
  5484. "description": "BadRequest | InvalidRequestError",
  5485. "content": {
  5486. "application/json": {
  5487. "schema": {
  5488. "anyOf": [
  5489. {
  5490. "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
  5491. },
  5492. {
  5493. "$ref": "#/components/schemas/InvalidRequestError"
  5494. }
  5495. ]
  5496. }
  5497. }
  5498. }
  5499. }
  5500. },
  5501. "description": "Create a new OpenCode session for interacting with AI assistants and managing conversations.",
  5502. "summary": "Create session",
  5503. "requestBody": {
  5504. "content": {
  5505. "application/json": {
  5506. "schema": {
  5507. "type": "object",
  5508. "properties": {
  5509. "parentID": {
  5510. "type": "string",
  5511. "pattern": "^ses"
  5512. },
  5513. "title": {
  5514. "type": "string"
  5515. },
  5516. "agent": {
  5517. "type": "string"
  5518. },
  5519. "model": {
  5520. "type": "object",
  5521. "properties": {
  5522. "id": {
  5523. "type": "string"
  5524. },
  5525. "providerID": {
  5526. "type": "string"
  5527. },
  5528. "variant": {
  5529. "type": "string"
  5530. }
  5531. },
  5532. "required": ["id", "providerID"],
  5533. "additionalProperties": false
  5534. },
  5535. "metadata": {
  5536. "type": "object"
  5537. },
  5538. "permission": {
  5539. "$ref": "#/components/schemas/PermissionRuleset"
  5540. },
  5541. "workspaceID": {
  5542. "type": "string",
  5543. "pattern": "^wrk"
  5544. }
  5545. },
  5546. "additionalProperties": false
  5547. }
  5548. }
  5549. }
  5550. },
  5551. "x-codeSamples": [
  5552. {
  5553. "lang": "js",
  5554. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.create({\n ...\n})"
  5555. }
  5556. ]
  5557. }
  5558. },
  5559. "/session/status": {
  5560. "get": {
  5561. "tags": ["session"],
  5562. "operationId": "session.status",
  5563. "parameters": [
  5564. {
  5565. "name": "directory",
  5566. "in": "query",
  5567. "schema": {
  5568. "type": "string"
  5569. },
  5570. "required": false
  5571. },
  5572. {
  5573. "name": "workspace",
  5574. "in": "query",
  5575. "schema": {
  5576. "type": "string"
  5577. },
  5578. "required": false
  5579. }
  5580. ],
  5581. "responses": {
  5582. "200": {
  5583. "description": "Get session status",
  5584. "content": {
  5585. "application/json": {
  5586. "schema": {
  5587. "type": "object",
  5588. "additionalProperties": {
  5589. "$ref": "#/components/schemas/SessionStatus"
  5590. },
  5591. "description": "Get session status"
  5592. }
  5593. }
  5594. }
  5595. },
  5596. "400": {
  5597. "description": "BadRequest | InvalidRequestError",
  5598. "content": {
  5599. "application/json": {
  5600. "schema": {
  5601. "anyOf": [
  5602. {
  5603. "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
  5604. },
  5605. {
  5606. "$ref": "#/components/schemas/InvalidRequestError"
  5607. }
  5608. ]
  5609. }
  5610. }
  5611. }
  5612. }
  5613. },
  5614. "description": "Retrieve the current status of all sessions, including active, idle, and completed states.",
  5615. "summary": "Get session status",
  5616. "x-codeSamples": [
  5617. {
  5618. "lang": "js",
  5619. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.status({\n ...\n})"
  5620. }
  5621. ]
  5622. }
  5623. },
  5624. "/session/{sessionID}": {
  5625. "get": {
  5626. "tags": ["session"],
  5627. "operationId": "session.get",
  5628. "parameters": [
  5629. {
  5630. "name": "sessionID",
  5631. "in": "path",
  5632. "schema": {
  5633. "type": "string",
  5634. "pattern": "^ses"
  5635. },
  5636. "required": true
  5637. },
  5638. {
  5639. "name": "directory",
  5640. "in": "query",
  5641. "schema": {
  5642. "type": "string"
  5643. },
  5644. "required": false
  5645. },
  5646. {
  5647. "name": "workspace",
  5648. "in": "query",
  5649. "schema": {
  5650. "type": "string"
  5651. },
  5652. "required": false
  5653. }
  5654. ],
  5655. "responses": {
  5656. "200": {
  5657. "description": "Get session",
  5658. "content": {
  5659. "application/json": {
  5660. "schema": {
  5661. "$ref": "#/components/schemas/Session"
  5662. }
  5663. }
  5664. }
  5665. },
  5666. "400": {
  5667. "description": "BadRequest | InvalidRequestError",
  5668. "content": {
  5669. "application/json": {
  5670. "schema": {
  5671. "anyOf": [
  5672. {
  5673. "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
  5674. },
  5675. {
  5676. "$ref": "#/components/schemas/InvalidRequestError"
  5677. }
  5678. ]
  5679. }
  5680. }
  5681. }
  5682. },
  5683. "404": {
  5684. "description": "NotFoundError",
  5685. "content": {
  5686. "application/json": {
  5687. "schema": {
  5688. "$ref": "#/components/schemas/NotFoundError"
  5689. }
  5690. }
  5691. }
  5692. }
  5693. },
  5694. "description": "Retrieve detailed information about a specific OpenCode session.",
  5695. "summary": "Get session",
  5696. "x-codeSamples": [
  5697. {
  5698. "lang": "js",
  5699. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.get({\n ...\n})"
  5700. }
  5701. ]
  5702. },
  5703. "delete": {
  5704. "tags": ["session"],
  5705. "operationId": "session.delete",
  5706. "parameters": [
  5707. {
  5708. "name": "sessionID",
  5709. "in": "path",
  5710. "schema": {
  5711. "type": "string",
  5712. "pattern": "^ses"
  5713. },
  5714. "required": true
  5715. },
  5716. {
  5717. "name": "directory",
  5718. "in": "query",
  5719. "schema": {
  5720. "type": "string"
  5721. },
  5722. "required": false
  5723. },
  5724. {
  5725. "name": "workspace",
  5726. "in": "query",
  5727. "schema": {
  5728. "type": "string"
  5729. },
  5730. "required": false
  5731. }
  5732. ],
  5733. "responses": {
  5734. "200": {
  5735. "description": "Successfully deleted session",
  5736. "content": {
  5737. "application/json": {
  5738. "schema": {
  5739. "type": "boolean",
  5740. "description": "Successfully deleted session"
  5741. }
  5742. }
  5743. }
  5744. },
  5745. "400": {
  5746. "description": "BadRequest | InvalidRequestError",
  5747. "content": {
  5748. "application/json": {
  5749. "schema": {
  5750. "anyOf": [
  5751. {
  5752. "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
  5753. },
  5754. {
  5755. "$ref": "#/components/schemas/InvalidRequestError"
  5756. }
  5757. ]
  5758. }
  5759. }
  5760. }
  5761. },
  5762. "404": {
  5763. "description": "NotFoundError",
  5764. "content": {
  5765. "application/json": {
  5766. "schema": {
  5767. "$ref": "#/components/schemas/NotFoundError"
  5768. }
  5769. }
  5770. }
  5771. }
  5772. },
  5773. "description": "Delete a session and permanently remove all associated data, including messages and history.",
  5774. "summary": "Delete session",
  5775. "x-codeSamples": [
  5776. {
  5777. "lang": "js",
  5778. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.delete({\n ...\n})"
  5779. }
  5780. ]
  5781. },
  5782. "patch": {
  5783. "tags": ["session"],
  5784. "operationId": "session.update",
  5785. "parameters": [
  5786. {
  5787. "name": "sessionID",
  5788. "in": "path",
  5789. "schema": {
  5790. "type": "string",
  5791. "pattern": "^ses"
  5792. },
  5793. "required": true
  5794. },
  5795. {
  5796. "name": "directory",
  5797. "in": "query",
  5798. "schema": {
  5799. "type": "string"
  5800. },
  5801. "required": false
  5802. },
  5803. {
  5804. "name": "workspace",
  5805. "in": "query",
  5806. "schema": {
  5807. "type": "string"
  5808. },
  5809. "required": false
  5810. }
  5811. ],
  5812. "responses": {
  5813. "200": {
  5814. "description": "Successfully updated session",
  5815. "content": {
  5816. "application/json": {
  5817. "schema": {
  5818. "$ref": "#/components/schemas/Session"
  5819. }
  5820. }
  5821. }
  5822. },
  5823. "400": {
  5824. "description": "BadRequest | InvalidRequestError",
  5825. "content": {
  5826. "application/json": {
  5827. "schema": {
  5828. "anyOf": [
  5829. {
  5830. "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
  5831. },
  5832. {
  5833. "$ref": "#/components/schemas/InvalidRequestError"
  5834. }
  5835. ]
  5836. }
  5837. }
  5838. }
  5839. },
  5840. "404": {
  5841. "description": "NotFoundError",
  5842. "content": {
  5843. "application/json": {
  5844. "schema": {
  5845. "$ref": "#/components/schemas/NotFoundError"
  5846. }
  5847. }
  5848. }
  5849. }
  5850. },
  5851. "description": "Update properties of an existing session, such as title or other metadata.",
  5852. "summary": "Update session",
  5853. "requestBody": {
  5854. "content": {
  5855. "application/json": {
  5856. "schema": {
  5857. "type": "object",
  5858. "properties": {
  5859. "title": {
  5860. "type": "string"
  5861. },
  5862. "metadata": {
  5863. "type": "object"
  5864. },
  5865. "permission": {
  5866. "$ref": "#/components/schemas/PermissionRuleset"
  5867. },
  5868. "time": {
  5869. "type": "object",
  5870. "properties": {
  5871. "archived": {
  5872. "type": "number"
  5873. }
  5874. },
  5875. "additionalProperties": false
  5876. }
  5877. },
  5878. "additionalProperties": false
  5879. }
  5880. }
  5881. }
  5882. },
  5883. "x-codeSamples": [
  5884. {
  5885. "lang": "js",
  5886. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.update({\n ...\n})"
  5887. }
  5888. ]
  5889. }
  5890. },
  5891. "/session/{sessionID}/children": {
  5892. "get": {
  5893. "tags": ["session"],
  5894. "operationId": "session.children",
  5895. "parameters": [
  5896. {
  5897. "name": "sessionID",
  5898. "in": "path",
  5899. "schema": {
  5900. "type": "string",
  5901. "pattern": "^ses"
  5902. },
  5903. "required": true
  5904. },
  5905. {
  5906. "name": "directory",
  5907. "in": "query",
  5908. "schema": {
  5909. "type": "string"
  5910. },
  5911. "required": false
  5912. },
  5913. {
  5914. "name": "workspace",
  5915. "in": "query",
  5916. "schema": {
  5917. "type": "string"
  5918. },
  5919. "required": false
  5920. }
  5921. ],
  5922. "responses": {
  5923. "200": {
  5924. "description": "List of children",
  5925. "content": {
  5926. "application/json": {
  5927. "schema": {
  5928. "type": "array",
  5929. "items": {
  5930. "$ref": "#/components/schemas/Session"
  5931. },
  5932. "description": "List of children"
  5933. }
  5934. }
  5935. }
  5936. },
  5937. "400": {
  5938. "description": "BadRequest | InvalidRequestError",
  5939. "content": {
  5940. "application/json": {
  5941. "schema": {
  5942. "anyOf": [
  5943. {
  5944. "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
  5945. },
  5946. {
  5947. "$ref": "#/components/schemas/InvalidRequestError"
  5948. }
  5949. ]
  5950. }
  5951. }
  5952. }
  5953. },
  5954. "404": {
  5955. "description": "NotFoundError",
  5956. "content": {
  5957. "application/json": {
  5958. "schema": {
  5959. "$ref": "#/components/schemas/NotFoundError"
  5960. }
  5961. }
  5962. }
  5963. }
  5964. },
  5965. "description": "Retrieve all child sessions that were forked from the specified parent session.",
  5966. "summary": "Get session children",
  5967. "x-codeSamples": [
  5968. {
  5969. "lang": "js",
  5970. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.children({\n ...\n})"
  5971. }
  5972. ]
  5973. }
  5974. },
  5975. "/session/{sessionID}/todo": {
  5976. "get": {
  5977. "tags": ["session"],
  5978. "operationId": "session.todo",
  5979. "parameters": [
  5980. {
  5981. "name": "sessionID",
  5982. "in": "path",
  5983. "schema": {
  5984. "type": "string",
  5985. "pattern": "^ses"
  5986. },
  5987. "required": true
  5988. },
  5989. {
  5990. "name": "directory",
  5991. "in": "query",
  5992. "schema": {
  5993. "type": "string"
  5994. },
  5995. "required": false
  5996. },
  5997. {
  5998. "name": "workspace",
  5999. "in": "query",
  6000. "schema": {
  6001. "type": "string"
  6002. },
  6003. "required": false
  6004. }
  6005. ],
  6006. "responses": {
  6007. "200": {
  6008. "description": "Todo list",
  6009. "content": {
  6010. "application/json": {
  6011. "schema": {
  6012. "type": "array",
  6013. "items": {
  6014. "$ref": "#/components/schemas/Todo"
  6015. },
  6016. "description": "Todo list"
  6017. }
  6018. }
  6019. }
  6020. },
  6021. "400": {
  6022. "description": "BadRequest | InvalidRequestError",
  6023. "content": {
  6024. "application/json": {
  6025. "schema": {
  6026. "anyOf": [
  6027. {
  6028. "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
  6029. },
  6030. {
  6031. "$ref": "#/components/schemas/InvalidRequestError"
  6032. }
  6033. ]
  6034. }
  6035. }
  6036. }
  6037. },
  6038. "404": {
  6039. "description": "NotFoundError",
  6040. "content": {
  6041. "application/json": {
  6042. "schema": {
  6043. "$ref": "#/components/schemas/NotFoundError"
  6044. }
  6045. }
  6046. }
  6047. }
  6048. },
  6049. "description": "Retrieve the todo list associated with a specific session, showing tasks and action items.",
  6050. "summary": "Get session todos",
  6051. "x-codeSamples": [
  6052. {
  6053. "lang": "js",
  6054. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.todo({\n ...\n})"
  6055. }
  6056. ]
  6057. }
  6058. },
  6059. "/session/{sessionID}/diff": {
  6060. "get": {
  6061. "tags": ["session"],
  6062. "operationId": "session.diff",
  6063. "parameters": [
  6064. {
  6065. "name": "sessionID",
  6066. "in": "path",
  6067. "schema": {
  6068. "type": "string",
  6069. "pattern": "^ses"
  6070. },
  6071. "required": true
  6072. },
  6073. {
  6074. "name": "directory",
  6075. "in": "query",
  6076. "schema": {
  6077. "type": "string"
  6078. },
  6079. "required": false
  6080. },
  6081. {
  6082. "name": "workspace",
  6083. "in": "query",
  6084. "schema": {
  6085. "type": "string"
  6086. },
  6087. "required": false
  6088. },
  6089. {
  6090. "name": "messageID",
  6091. "in": "query",
  6092. "schema": {
  6093. "type": "string",
  6094. "pattern": "^msg"
  6095. },
  6096. "required": false
  6097. }
  6098. ],
  6099. "responses": {
  6100. "200": {
  6101. "description": "Successfully retrieved diff",
  6102. "content": {
  6103. "application/json": {
  6104. "schema": {
  6105. "type": "array",
  6106. "items": {
  6107. "$ref": "#/components/schemas/SnapshotFileDiff"
  6108. },
  6109. "description": "Successfully retrieved diff"
  6110. }
  6111. }
  6112. }
  6113. },
  6114. "400": {
  6115. "description": "Bad request",
  6116. "content": {
  6117. "application/json": {
  6118. "schema": {
  6119. "$ref": "#/components/schemas/BadRequestError"
  6120. }
  6121. }
  6122. }
  6123. }
  6124. },
  6125. "description": "Get the file changes (diff) that resulted from a specific user message in the session.",
  6126. "summary": "Get message diff",
  6127. "x-codeSamples": [
  6128. {
  6129. "lang": "js",
  6130. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.diff({\n ...\n})"
  6131. }
  6132. ]
  6133. }
  6134. },
  6135. "/session/{sessionID}/message": {
  6136. "get": {
  6137. "tags": ["session"],
  6138. "operationId": "session.messages",
  6139. "parameters": [
  6140. {
  6141. "name": "sessionID",
  6142. "in": "path",
  6143. "schema": {
  6144. "type": "string",
  6145. "pattern": "^ses"
  6146. },
  6147. "required": true
  6148. },
  6149. {
  6150. "name": "directory",
  6151. "in": "query",
  6152. "schema": {
  6153. "type": "string"
  6154. },
  6155. "required": false
  6156. },
  6157. {
  6158. "name": "workspace",
  6159. "in": "query",
  6160. "schema": {
  6161. "type": "string"
  6162. },
  6163. "required": false
  6164. },
  6165. {
  6166. "name": "limit",
  6167. "in": "query",
  6168. "schema": {
  6169. "type": "integer",
  6170. "minimum": 0,
  6171. "maximum": 9007199254740991
  6172. },
  6173. "required": false
  6174. },
  6175. {
  6176. "name": "before",
  6177. "in": "query",
  6178. "schema": {
  6179. "type": "string"
  6180. },
  6181. "required": false
  6182. }
  6183. ],
  6184. "responses": {
  6185. "200": {
  6186. "description": "List of messages",
  6187. "content": {
  6188. "application/json": {
  6189. "schema": {
  6190. "type": "array",
  6191. "items": {
  6192. "type": "object",
  6193. "properties": {
  6194. "info": {
  6195. "$ref": "#/components/schemas/Message"
  6196. },
  6197. "parts": {
  6198. "type": "array",
  6199. "items": {
  6200. "$ref": "#/components/schemas/Part"
  6201. }
  6202. }
  6203. },
  6204. "required": ["info", "parts"],
  6205. "additionalProperties": false
  6206. },
  6207. "description": "List of messages"
  6208. }
  6209. }
  6210. }
  6211. },
  6212. "400": {
  6213. "description": "BadRequest | InvalidRequestError",
  6214. "content": {
  6215. "application/json": {
  6216. "schema": {
  6217. "anyOf": [
  6218. {
  6219. "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
  6220. },
  6221. {
  6222. "$ref": "#/components/schemas/InvalidRequestError"
  6223. }
  6224. ]
  6225. }
  6226. }
  6227. }
  6228. },
  6229. "404": {
  6230. "description": "NotFoundError",
  6231. "content": {
  6232. "application/json": {
  6233. "schema": {
  6234. "$ref": "#/components/schemas/NotFoundError"
  6235. }
  6236. }
  6237. }
  6238. }
  6239. },
  6240. "description": "Retrieve all messages in a session, including user prompts and AI responses.",
  6241. "summary": "Get session messages",
  6242. "x-codeSamples": [
  6243. {
  6244. "lang": "js",
  6245. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.messages({\n ...\n})"
  6246. }
  6247. ]
  6248. },
  6249. "post": {
  6250. "tags": ["session"],
  6251. "operationId": "session.prompt",
  6252. "parameters": [
  6253. {
  6254. "name": "sessionID",
  6255. "in": "path",
  6256. "schema": {
  6257. "type": "string",
  6258. "pattern": "^ses"
  6259. },
  6260. "required": true
  6261. },
  6262. {
  6263. "name": "directory",
  6264. "in": "query",
  6265. "schema": {
  6266. "type": "string"
  6267. },
  6268. "required": false
  6269. },
  6270. {
  6271. "name": "workspace",
  6272. "in": "query",
  6273. "schema": {
  6274. "type": "string"
  6275. },
  6276. "required": false
  6277. }
  6278. ],
  6279. "responses": {
  6280. "200": {
  6281. "description": "Created message",
  6282. "content": {
  6283. "application/json": {
  6284. "schema": {
  6285. "type": "object",
  6286. "required": ["info", "parts"],
  6287. "properties": {
  6288. "info": {
  6289. "$ref": "#/components/schemas/AssistantMessage"
  6290. },
  6291. "parts": {
  6292. "type": "array",
  6293. "items": {
  6294. "$ref": "#/components/schemas/Part"
  6295. }
  6296. }
  6297. }
  6298. }
  6299. }
  6300. }
  6301. },
  6302. "400": {
  6303. "description": "BadRequest | InvalidRequestError",
  6304. "content": {
  6305. "application/json": {
  6306. "schema": {
  6307. "anyOf": [
  6308. {
  6309. "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
  6310. },
  6311. {
  6312. "$ref": "#/components/schemas/InvalidRequestError"
  6313. }
  6314. ]
  6315. }
  6316. }
  6317. }
  6318. },
  6319. "404": {
  6320. "description": "NotFoundError",
  6321. "content": {
  6322. "application/json": {
  6323. "schema": {
  6324. "$ref": "#/components/schemas/NotFoundError"
  6325. }
  6326. }
  6327. }
  6328. }
  6329. },
  6330. "description": "Create and send a new message to a session, streaming the AI response.",
  6331. "summary": "Send message",
  6332. "requestBody": {
  6333. "content": {
  6334. "application/json": {
  6335. "schema": {
  6336. "type": "object",
  6337. "properties": {
  6338. "messageID": {
  6339. "type": "string",
  6340. "pattern": "^msg"
  6341. },
  6342. "model": {
  6343. "type": "object",
  6344. "properties": {
  6345. "providerID": {
  6346. "type": "string"
  6347. },
  6348. "modelID": {
  6349. "type": "string"
  6350. }
  6351. },
  6352. "required": ["providerID", "modelID"],
  6353. "additionalProperties": false
  6354. },
  6355. "agent": {
  6356. "type": "string"
  6357. },
  6358. "noReply": {
  6359. "type": "boolean"
  6360. },
  6361. "tools": {
  6362. "type": "object",
  6363. "additionalProperties": {
  6364. "type": "boolean"
  6365. }
  6366. },
  6367. "format": {
  6368. "$ref": "#/components/schemas/OutputFormat"
  6369. },
  6370. "system": {
  6371. "type": "string"
  6372. },
  6373. "variant": {
  6374. "type": "string"
  6375. },
  6376. "parts": {
  6377. "type": "array",
  6378. "items": {
  6379. "anyOf": [
  6380. {
  6381. "$ref": "#/components/schemas/TextPartInput"
  6382. },
  6383. {
  6384. "$ref": "#/components/schemas/FilePartInput"
  6385. },
  6386. {
  6387. "$ref": "#/components/schemas/AgentPartInput"
  6388. },
  6389. {
  6390. "$ref": "#/components/schemas/SubtaskPartInput"
  6391. }
  6392. ]
  6393. }
  6394. }
  6395. },
  6396. "required": ["parts"],
  6397. "additionalProperties": false
  6398. }
  6399. }
  6400. }
  6401. },
  6402. "x-codeSamples": [
  6403. {
  6404. "lang": "js",
  6405. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.prompt({\n ...\n})"
  6406. }
  6407. ]
  6408. }
  6409. },
  6410. "/session/{sessionID}/message/{messageID}": {
  6411. "get": {
  6412. "tags": ["session"],
  6413. "operationId": "session.message",
  6414. "parameters": [
  6415. {
  6416. "name": "sessionID",
  6417. "in": "path",
  6418. "schema": {
  6419. "type": "string",
  6420. "pattern": "^ses"
  6421. },
  6422. "required": true
  6423. },
  6424. {
  6425. "name": "messageID",
  6426. "in": "path",
  6427. "schema": {
  6428. "type": "string",
  6429. "pattern": "^msg"
  6430. },
  6431. "required": true
  6432. },
  6433. {
  6434. "name": "directory",
  6435. "in": "query",
  6436. "schema": {
  6437. "type": "string"
  6438. },
  6439. "required": false
  6440. },
  6441. {
  6442. "name": "workspace",
  6443. "in": "query",
  6444. "schema": {
  6445. "type": "string"
  6446. },
  6447. "required": false
  6448. }
  6449. ],
  6450. "responses": {
  6451. "200": {
  6452. "description": "Message",
  6453. "content": {
  6454. "application/json": {
  6455. "schema": {
  6456. "type": "object",
  6457. "properties": {
  6458. "info": {
  6459. "$ref": "#/components/schemas/Message"
  6460. },
  6461. "parts": {
  6462. "type": "array",
  6463. "items": {
  6464. "$ref": "#/components/schemas/Part"
  6465. }
  6466. }
  6467. },
  6468. "required": ["info", "parts"],
  6469. "additionalProperties": false,
  6470. "description": "Message"
  6471. }
  6472. }
  6473. }
  6474. },
  6475. "400": {
  6476. "description": "BadRequest | InvalidRequestError",
  6477. "content": {
  6478. "application/json": {
  6479. "schema": {
  6480. "anyOf": [
  6481. {
  6482. "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
  6483. },
  6484. {
  6485. "$ref": "#/components/schemas/InvalidRequestError"
  6486. }
  6487. ]
  6488. }
  6489. }
  6490. }
  6491. },
  6492. "404": {
  6493. "description": "NotFoundError",
  6494. "content": {
  6495. "application/json": {
  6496. "schema": {
  6497. "$ref": "#/components/schemas/NotFoundError"
  6498. }
  6499. }
  6500. }
  6501. }
  6502. },
  6503. "description": "Retrieve a specific message from a session by its message ID.",
  6504. "summary": "Get message",
  6505. "x-codeSamples": [
  6506. {
  6507. "lang": "js",
  6508. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.message({\n ...\n})"
  6509. }
  6510. ]
  6511. },
  6512. "delete": {
  6513. "tags": ["session"],
  6514. "operationId": "session.deleteMessage",
  6515. "parameters": [
  6516. {
  6517. "name": "sessionID",
  6518. "in": "path",
  6519. "schema": {
  6520. "type": "string",
  6521. "pattern": "^ses"
  6522. },
  6523. "required": true
  6524. },
  6525. {
  6526. "name": "messageID",
  6527. "in": "path",
  6528. "schema": {
  6529. "type": "string",
  6530. "pattern": "^msg"
  6531. },
  6532. "required": true
  6533. },
  6534. {
  6535. "name": "directory",
  6536. "in": "query",
  6537. "schema": {
  6538. "type": "string"
  6539. },
  6540. "required": false
  6541. },
  6542. {
  6543. "name": "workspace",
  6544. "in": "query",
  6545. "schema": {
  6546. "type": "string"
  6547. },
  6548. "required": false
  6549. }
  6550. ],
  6551. "responses": {
  6552. "200": {
  6553. "description": "Successfully deleted message",
  6554. "content": {
  6555. "application/json": {
  6556. "schema": {
  6557. "type": "boolean",
  6558. "description": "Successfully deleted message"
  6559. }
  6560. }
  6561. }
  6562. },
  6563. "400": {
  6564. "description": "BadRequest | InvalidRequestError",
  6565. "content": {
  6566. "application/json": {
  6567. "schema": {
  6568. "anyOf": [
  6569. {
  6570. "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
  6571. },
  6572. {
  6573. "$ref": "#/components/schemas/InvalidRequestError"
  6574. }
  6575. ]
  6576. }
  6577. }
  6578. }
  6579. },
  6580. "404": {
  6581. "description": "NotFoundError",
  6582. "content": {
  6583. "application/json": {
  6584. "schema": {
  6585. "$ref": "#/components/schemas/NotFoundError"
  6586. }
  6587. }
  6588. }
  6589. },
  6590. "409": {
  6591. "description": "SessionBusyError",
  6592. "content": {
  6593. "application/json": {
  6594. "schema": {
  6595. "$ref": "#/components/schemas/SessionBusyError"
  6596. }
  6597. }
  6598. }
  6599. }
  6600. },
  6601. "description": "Permanently delete a specific message and all of its parts from a session without reverting file changes.",
  6602. "summary": "Delete message",
  6603. "x-codeSamples": [
  6604. {
  6605. "lang": "js",
  6606. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.deleteMessage({\n ...\n})"
  6607. }
  6608. ]
  6609. }
  6610. },
  6611. "/session/{sessionID}/fork": {
  6612. "post": {
  6613. "tags": ["session"],
  6614. "operationId": "session.fork",
  6615. "parameters": [
  6616. {
  6617. "name": "sessionID",
  6618. "in": "path",
  6619. "schema": {
  6620. "type": "string",
  6621. "pattern": "^ses"
  6622. },
  6623. "required": true
  6624. },
  6625. {
  6626. "name": "directory",
  6627. "in": "query",
  6628. "schema": {
  6629. "type": "string"
  6630. },
  6631. "required": false
  6632. },
  6633. {
  6634. "name": "workspace",
  6635. "in": "query",
  6636. "schema": {
  6637. "type": "string"
  6638. },
  6639. "required": false
  6640. }
  6641. ],
  6642. "responses": {
  6643. "200": {
  6644. "description": "200",
  6645. "content": {
  6646. "application/json": {
  6647. "schema": {
  6648. "$ref": "#/components/schemas/Session"
  6649. }
  6650. }
  6651. }
  6652. },
  6653. "400": {
  6654. "description": "BadRequest | InvalidRequestError",
  6655. "content": {
  6656. "application/json": {
  6657. "schema": {
  6658. "anyOf": [
  6659. {
  6660. "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
  6661. },
  6662. {
  6663. "$ref": "#/components/schemas/InvalidRequestError"
  6664. }
  6665. ]
  6666. }
  6667. }
  6668. }
  6669. },
  6670. "404": {
  6671. "description": "NotFoundError",
  6672. "content": {
  6673. "application/json": {
  6674. "schema": {
  6675. "$ref": "#/components/schemas/NotFoundError"
  6676. }
  6677. }
  6678. }
  6679. }
  6680. },
  6681. "description": "Create a new session by forking an existing session at a specific message point.",
  6682. "summary": "Fork session",
  6683. "requestBody": {
  6684. "content": {
  6685. "application/json": {
  6686. "schema": {
  6687. "type": "object",
  6688. "properties": {
  6689. "messageID": {
  6690. "type": "string",
  6691. "pattern": "^msg"
  6692. }
  6693. },
  6694. "additionalProperties": false
  6695. }
  6696. }
  6697. }
  6698. },
  6699. "x-codeSamples": [
  6700. {
  6701. "lang": "js",
  6702. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.fork({\n ...\n})"
  6703. }
  6704. ]
  6705. }
  6706. },
  6707. "/session/{sessionID}/abort": {
  6708. "post": {
  6709. "tags": ["session"],
  6710. "operationId": "session.abort",
  6711. "parameters": [
  6712. {
  6713. "name": "sessionID",
  6714. "in": "path",
  6715. "schema": {
  6716. "type": "string",
  6717. "pattern": "^ses"
  6718. },
  6719. "required": true
  6720. },
  6721. {
  6722. "name": "directory",
  6723. "in": "query",
  6724. "schema": {
  6725. "type": "string"
  6726. },
  6727. "required": false
  6728. },
  6729. {
  6730. "name": "workspace",
  6731. "in": "query",
  6732. "schema": {
  6733. "type": "string"
  6734. },
  6735. "required": false
  6736. }
  6737. ],
  6738. "responses": {
  6739. "200": {
  6740. "description": "Aborted session",
  6741. "content": {
  6742. "application/json": {
  6743. "schema": {
  6744. "type": "boolean",
  6745. "description": "Aborted session"
  6746. }
  6747. }
  6748. }
  6749. },
  6750. "400": {
  6751. "description": "BadRequest | InvalidRequestError",
  6752. "content": {
  6753. "application/json": {
  6754. "schema": {
  6755. "anyOf": [
  6756. {
  6757. "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
  6758. },
  6759. {
  6760. "$ref": "#/components/schemas/InvalidRequestError"
  6761. }
  6762. ]
  6763. }
  6764. }
  6765. }
  6766. }
  6767. },
  6768. "description": "Abort an active session and stop any ongoing AI processing or command execution.",
  6769. "summary": "Abort session",
  6770. "x-codeSamples": [
  6771. {
  6772. "lang": "js",
  6773. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.abort({\n ...\n})"
  6774. }
  6775. ]
  6776. }
  6777. },
  6778. "/session/{sessionID}/init": {
  6779. "post": {
  6780. "tags": ["session"],
  6781. "operationId": "session.init",
  6782. "parameters": [
  6783. {
  6784. "name": "sessionID",
  6785. "in": "path",
  6786. "schema": {
  6787. "type": "string",
  6788. "pattern": "^ses"
  6789. },
  6790. "required": true
  6791. },
  6792. {
  6793. "name": "directory",
  6794. "in": "query",
  6795. "schema": {
  6796. "type": "string"
  6797. },
  6798. "required": false
  6799. },
  6800. {
  6801. "name": "workspace",
  6802. "in": "query",
  6803. "schema": {
  6804. "type": "string"
  6805. },
  6806. "required": false
  6807. }
  6808. ],
  6809. "responses": {
  6810. "200": {
  6811. "description": "200",
  6812. "content": {
  6813. "application/json": {
  6814. "schema": {
  6815. "type": "boolean",
  6816. "description": "200"
  6817. }
  6818. }
  6819. }
  6820. },
  6821. "400": {
  6822. "description": "BadRequest | InvalidRequestError",
  6823. "content": {
  6824. "application/json": {
  6825. "schema": {
  6826. "anyOf": [
  6827. {
  6828. "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
  6829. },
  6830. {
  6831. "$ref": "#/components/schemas/InvalidRequestError"
  6832. }
  6833. ]
  6834. }
  6835. }
  6836. }
  6837. },
  6838. "404": {
  6839. "description": "NotFoundError",
  6840. "content": {
  6841. "application/json": {
  6842. "schema": {
  6843. "$ref": "#/components/schemas/NotFoundError"
  6844. }
  6845. }
  6846. }
  6847. }
  6848. },
  6849. "description": "Analyze the current application and create an AGENTS.md file with project-specific agent configurations.",
  6850. "summary": "Initialize session",
  6851. "requestBody": {
  6852. "content": {
  6853. "application/json": {
  6854. "schema": {
  6855. "type": "object",
  6856. "properties": {
  6857. "modelID": {
  6858. "type": "string"
  6859. },
  6860. "providerID": {
  6861. "type": "string"
  6862. },
  6863. "messageID": {
  6864. "type": "string",
  6865. "pattern": "^msg"
  6866. }
  6867. },
  6868. "required": ["modelID", "providerID", "messageID"],
  6869. "additionalProperties": false
  6870. }
  6871. }
  6872. }
  6873. },
  6874. "x-codeSamples": [
  6875. {
  6876. "lang": "js",
  6877. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.init({\n ...\n})"
  6878. }
  6879. ]
  6880. }
  6881. },
  6882. "/session/{sessionID}/share": {
  6883. "post": {
  6884. "tags": ["session"],
  6885. "operationId": "session.share",
  6886. "parameters": [
  6887. {
  6888. "name": "sessionID",
  6889. "in": "path",
  6890. "schema": {
  6891. "type": "string",
  6892. "pattern": "^ses"
  6893. },
  6894. "required": true
  6895. },
  6896. {
  6897. "name": "directory",
  6898. "in": "query",
  6899. "schema": {
  6900. "type": "string"
  6901. },
  6902. "required": false
  6903. },
  6904. {
  6905. "name": "workspace",
  6906. "in": "query",
  6907. "schema": {
  6908. "type": "string"
  6909. },
  6910. "required": false
  6911. }
  6912. ],
  6913. "responses": {
  6914. "200": {
  6915. "description": "Successfully shared session",
  6916. "content": {
  6917. "application/json": {
  6918. "schema": {
  6919. "$ref": "#/components/schemas/Session"
  6920. }
  6921. }
  6922. }
  6923. },
  6924. "400": {
  6925. "description": "Bad request",
  6926. "content": {
  6927. "application/json": {
  6928. "schema": {
  6929. "$ref": "#/components/schemas/BadRequestError"
  6930. }
  6931. }
  6932. }
  6933. },
  6934. "404": {
  6935. "description": "NotFoundError",
  6936. "content": {
  6937. "application/json": {
  6938. "schema": {
  6939. "$ref": "#/components/schemas/NotFoundError"
  6940. }
  6941. }
  6942. }
  6943. },
  6944. "500": {
  6945. "description": "InternalServerError",
  6946. "content": {
  6947. "application/json": {
  6948. "schema": {
  6949. "$ref": "#/components/schemas/effect_HttpApiError_InternalServerError"
  6950. }
  6951. }
  6952. }
  6953. }
  6954. },
  6955. "description": "Create a shareable link for a session, allowing others to view the conversation.",
  6956. "summary": "Share session",
  6957. "x-codeSamples": [
  6958. {
  6959. "lang": "js",
  6960. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.share({\n ...\n})"
  6961. }
  6962. ]
  6963. },
  6964. "delete": {
  6965. "tags": ["session"],
  6966. "operationId": "session.unshare",
  6967. "parameters": [
  6968. {
  6969. "name": "sessionID",
  6970. "in": "path",
  6971. "schema": {
  6972. "type": "string",
  6973. "pattern": "^ses"
  6974. },
  6975. "required": true
  6976. },
  6977. {
  6978. "name": "directory",
  6979. "in": "query",
  6980. "schema": {
  6981. "type": "string"
  6982. },
  6983. "required": false
  6984. },
  6985. {
  6986. "name": "workspace",
  6987. "in": "query",
  6988. "schema": {
  6989. "type": "string"
  6990. },
  6991. "required": false
  6992. }
  6993. ],
  6994. "responses": {
  6995. "200": {
  6996. "description": "Successfully unshared session",
  6997. "content": {
  6998. "application/json": {
  6999. "schema": {
  7000. "$ref": "#/components/schemas/Session"
  7001. }
  7002. }
  7003. }
  7004. },
  7005. "400": {
  7006. "description": "Bad request",
  7007. "content": {
  7008. "application/json": {
  7009. "schema": {
  7010. "$ref": "#/components/schemas/BadRequestError"
  7011. }
  7012. }
  7013. }
  7014. },
  7015. "404": {
  7016. "description": "NotFoundError",
  7017. "content": {
  7018. "application/json": {
  7019. "schema": {
  7020. "$ref": "#/components/schemas/NotFoundError"
  7021. }
  7022. }
  7023. }
  7024. },
  7025. "500": {
  7026. "description": "InternalServerError",
  7027. "content": {
  7028. "application/json": {
  7029. "schema": {
  7030. "$ref": "#/components/schemas/effect_HttpApiError_InternalServerError"
  7031. }
  7032. }
  7033. }
  7034. }
  7035. },
  7036. "description": "Remove the shareable link for a session, making it private again.",
  7037. "summary": "Unshare session",
  7038. "x-codeSamples": [
  7039. {
  7040. "lang": "js",
  7041. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.unshare({\n ...\n})"
  7042. }
  7043. ]
  7044. }
  7045. },
  7046. "/session/{sessionID}/summarize": {
  7047. "post": {
  7048. "tags": ["session"],
  7049. "operationId": "session.summarize",
  7050. "parameters": [
  7051. {
  7052. "name": "sessionID",
  7053. "in": "path",
  7054. "schema": {
  7055. "type": "string",
  7056. "pattern": "^ses"
  7057. },
  7058. "required": true
  7059. },
  7060. {
  7061. "name": "directory",
  7062. "in": "query",
  7063. "schema": {
  7064. "type": "string"
  7065. },
  7066. "required": false
  7067. },
  7068. {
  7069. "name": "workspace",
  7070. "in": "query",
  7071. "schema": {
  7072. "type": "string"
  7073. },
  7074. "required": false
  7075. }
  7076. ],
  7077. "responses": {
  7078. "200": {
  7079. "description": "Summarized session",
  7080. "content": {
  7081. "application/json": {
  7082. "schema": {
  7083. "type": "boolean",
  7084. "description": "Summarized session"
  7085. }
  7086. }
  7087. }
  7088. },
  7089. "400": {
  7090. "description": "BadRequest | InvalidRequestError",
  7091. "content": {
  7092. "application/json": {
  7093. "schema": {
  7094. "anyOf": [
  7095. {
  7096. "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
  7097. },
  7098. {
  7099. "$ref": "#/components/schemas/InvalidRequestError"
  7100. }
  7101. ]
  7102. }
  7103. }
  7104. }
  7105. },
  7106. "404": {
  7107. "description": "NotFoundError",
  7108. "content": {
  7109. "application/json": {
  7110. "schema": {
  7111. "$ref": "#/components/schemas/NotFoundError"
  7112. }
  7113. }
  7114. }
  7115. }
  7116. },
  7117. "description": "Generate a concise summary of the session using AI compaction to preserve key information.",
  7118. "summary": "Summarize session",
  7119. "requestBody": {
  7120. "content": {
  7121. "application/json": {
  7122. "schema": {
  7123. "type": "object",
  7124. "properties": {
  7125. "providerID": {
  7126. "type": "string"
  7127. },
  7128. "modelID": {
  7129. "type": "string"
  7130. },
  7131. "auto": {
  7132. "type": "boolean"
  7133. }
  7134. },
  7135. "required": ["providerID", "modelID"],
  7136. "additionalProperties": false
  7137. }
  7138. }
  7139. }
  7140. },
  7141. "x-codeSamples": [
  7142. {
  7143. "lang": "js",
  7144. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.summarize({\n ...\n})"
  7145. }
  7146. ]
  7147. }
  7148. },
  7149. "/session/{sessionID}/prompt_async": {
  7150. "post": {
  7151. "tags": ["session"],
  7152. "operationId": "session.prompt_async",
  7153. "parameters": [
  7154. {
  7155. "name": "sessionID",
  7156. "in": "path",
  7157. "schema": {
  7158. "type": "string",
  7159. "pattern": "^ses"
  7160. },
  7161. "required": true
  7162. },
  7163. {
  7164. "name": "directory",
  7165. "in": "query",
  7166. "schema": {
  7167. "type": "string"
  7168. },
  7169. "required": false
  7170. },
  7171. {
  7172. "name": "workspace",
  7173. "in": "query",
  7174. "schema": {
  7175. "type": "string"
  7176. },
  7177. "required": false
  7178. }
  7179. ],
  7180. "responses": {
  7181. "204": {
  7182. "description": "Prompt accepted"
  7183. },
  7184. "400": {
  7185. "description": "BadRequest | InvalidRequestError",
  7186. "content": {
  7187. "application/json": {
  7188. "schema": {
  7189. "anyOf": [
  7190. {
  7191. "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
  7192. },
  7193. {
  7194. "$ref": "#/components/schemas/InvalidRequestError"
  7195. }
  7196. ]
  7197. }
  7198. }
  7199. }
  7200. },
  7201. "404": {
  7202. "description": "NotFoundError",
  7203. "content": {
  7204. "application/json": {
  7205. "schema": {
  7206. "$ref": "#/components/schemas/NotFoundError"
  7207. }
  7208. }
  7209. }
  7210. }
  7211. },
  7212. "description": "Create and send a new message to a session asynchronously, starting the session if needed and returning immediately.",
  7213. "summary": "Send async message",
  7214. "requestBody": {
  7215. "content": {
  7216. "application/json": {
  7217. "schema": {
  7218. "type": "object",
  7219. "properties": {
  7220. "messageID": {
  7221. "type": "string",
  7222. "pattern": "^msg"
  7223. },
  7224. "model": {
  7225. "type": "object",
  7226. "properties": {
  7227. "providerID": {
  7228. "type": "string"
  7229. },
  7230. "modelID": {
  7231. "type": "string"
  7232. }
  7233. },
  7234. "required": ["providerID", "modelID"],
  7235. "additionalProperties": false
  7236. },
  7237. "agent": {
  7238. "type": "string"
  7239. },
  7240. "noReply": {
  7241. "type": "boolean"
  7242. },
  7243. "tools": {
  7244. "type": "object",
  7245. "additionalProperties": {
  7246. "type": "boolean"
  7247. }
  7248. },
  7249. "format": {
  7250. "$ref": "#/components/schemas/OutputFormat"
  7251. },
  7252. "system": {
  7253. "type": "string"
  7254. },
  7255. "variant": {
  7256. "type": "string"
  7257. },
  7258. "parts": {
  7259. "type": "array",
  7260. "items": {
  7261. "anyOf": [
  7262. {
  7263. "$ref": "#/components/schemas/TextPartInput"
  7264. },
  7265. {
  7266. "$ref": "#/components/schemas/FilePartInput"
  7267. },
  7268. {
  7269. "$ref": "#/components/schemas/AgentPartInput"
  7270. },
  7271. {
  7272. "$ref": "#/components/schemas/SubtaskPartInput"
  7273. }
  7274. ]
  7275. }
  7276. }
  7277. },
  7278. "required": ["parts"],
  7279. "additionalProperties": false
  7280. }
  7281. }
  7282. }
  7283. },
  7284. "x-codeSamples": [
  7285. {
  7286. "lang": "js",
  7287. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.prompt_async({\n ...\n})"
  7288. }
  7289. ]
  7290. }
  7291. },
  7292. "/session/{sessionID}/command": {
  7293. "post": {
  7294. "tags": ["session"],
  7295. "operationId": "session.command",
  7296. "parameters": [
  7297. {
  7298. "name": "sessionID",
  7299. "in": "path",
  7300. "schema": {
  7301. "type": "string",
  7302. "pattern": "^ses"
  7303. },
  7304. "required": true
  7305. },
  7306. {
  7307. "name": "directory",
  7308. "in": "query",
  7309. "schema": {
  7310. "type": "string"
  7311. },
  7312. "required": false
  7313. },
  7314. {
  7315. "name": "workspace",
  7316. "in": "query",
  7317. "schema": {
  7318. "type": "string"
  7319. },
  7320. "required": false
  7321. }
  7322. ],
  7323. "responses": {
  7324. "200": {
  7325. "description": "Created message",
  7326. "content": {
  7327. "application/json": {
  7328. "schema": {
  7329. "type": "object",
  7330. "required": ["info", "parts"],
  7331. "properties": {
  7332. "info": {
  7333. "$ref": "#/components/schemas/AssistantMessage"
  7334. },
  7335. "parts": {
  7336. "type": "array",
  7337. "items": {
  7338. "$ref": "#/components/schemas/Part"
  7339. }
  7340. }
  7341. }
  7342. }
  7343. }
  7344. }
  7345. },
  7346. "400": {
  7347. "description": "BadRequest | InvalidRequestError",
  7348. "content": {
  7349. "application/json": {
  7350. "schema": {
  7351. "anyOf": [
  7352. {
  7353. "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
  7354. },
  7355. {
  7356. "$ref": "#/components/schemas/InvalidRequestError"
  7357. }
  7358. ]
  7359. }
  7360. }
  7361. }
  7362. },
  7363. "404": {
  7364. "description": "NotFoundError",
  7365. "content": {
  7366. "application/json": {
  7367. "schema": {
  7368. "$ref": "#/components/schemas/NotFoundError"
  7369. }
  7370. }
  7371. }
  7372. }
  7373. },
  7374. "description": "Send a new command to a session for execution by the AI assistant.",
  7375. "summary": "Send command",
  7376. "requestBody": {
  7377. "content": {
  7378. "application/json": {
  7379. "schema": {
  7380. "type": "object",
  7381. "properties": {
  7382. "messageID": {
  7383. "type": "string",
  7384. "pattern": "^msg"
  7385. },
  7386. "agent": {
  7387. "type": "string"
  7388. },
  7389. "model": {
  7390. "type": "string"
  7391. },
  7392. "arguments": {
  7393. "type": "string"
  7394. },
  7395. "command": {
  7396. "type": "string"
  7397. },
  7398. "variant": {
  7399. "type": "string"
  7400. },
  7401. "parts": {
  7402. "type": "array",
  7403. "items": {
  7404. "type": "object",
  7405. "properties": {
  7406. "id": {
  7407. "type": "string",
  7408. "pattern": "^prt"
  7409. },
  7410. "type": {
  7411. "type": "string",
  7412. "enum": ["file"]
  7413. },
  7414. "mime": {
  7415. "type": "string"
  7416. },
  7417. "filename": {
  7418. "type": "string"
  7419. },
  7420. "url": {
  7421. "type": "string"
  7422. },
  7423. "source": {
  7424. "$ref": "#/components/schemas/FilePartSource"
  7425. }
  7426. },
  7427. "required": ["type", "mime", "url"],
  7428. "additionalProperties": false
  7429. }
  7430. }
  7431. },
  7432. "required": ["arguments", "command"],
  7433. "additionalProperties": false
  7434. }
  7435. }
  7436. }
  7437. },
  7438. "x-codeSamples": [
  7439. {
  7440. "lang": "js",
  7441. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.command({\n ...\n})"
  7442. }
  7443. ]
  7444. }
  7445. },
  7446. "/session/{sessionID}/shell": {
  7447. "post": {
  7448. "tags": ["session"],
  7449. "operationId": "session.shell",
  7450. "parameters": [
  7451. {
  7452. "name": "sessionID",
  7453. "in": "path",
  7454. "schema": {
  7455. "type": "string",
  7456. "pattern": "^ses"
  7457. },
  7458. "required": true
  7459. },
  7460. {
  7461. "name": "directory",
  7462. "in": "query",
  7463. "schema": {
  7464. "type": "string"
  7465. },
  7466. "required": false
  7467. },
  7468. {
  7469. "name": "workspace",
  7470. "in": "query",
  7471. "schema": {
  7472. "type": "string"
  7473. },
  7474. "required": false
  7475. }
  7476. ],
  7477. "responses": {
  7478. "200": {
  7479. "description": "Created message",
  7480. "content": {
  7481. "application/json": {
  7482. "schema": {
  7483. "type": "object",
  7484. "properties": {
  7485. "info": {
  7486. "$ref": "#/components/schemas/Message"
  7487. },
  7488. "parts": {
  7489. "type": "array",
  7490. "items": {
  7491. "$ref": "#/components/schemas/Part"
  7492. }
  7493. }
  7494. },
  7495. "required": ["info", "parts"],
  7496. "additionalProperties": false,
  7497. "description": "Created message"
  7498. }
  7499. }
  7500. }
  7501. },
  7502. "400": {
  7503. "description": "BadRequest | InvalidRequestError",
  7504. "content": {
  7505. "application/json": {
  7506. "schema": {
  7507. "anyOf": [
  7508. {
  7509. "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
  7510. },
  7511. {
  7512. "$ref": "#/components/schemas/InvalidRequestError"
  7513. }
  7514. ]
  7515. }
  7516. }
  7517. }
  7518. },
  7519. "404": {
  7520. "description": "NotFoundError",
  7521. "content": {
  7522. "application/json": {
  7523. "schema": {
  7524. "$ref": "#/components/schemas/NotFoundError"
  7525. }
  7526. }
  7527. }
  7528. },
  7529. "409": {
  7530. "description": "SessionBusyError",
  7531. "content": {
  7532. "application/json": {
  7533. "schema": {
  7534. "$ref": "#/components/schemas/SessionBusyError"
  7535. }
  7536. }
  7537. }
  7538. }
  7539. },
  7540. "description": "Execute a shell command within the session context and return the AI's response.",
  7541. "summary": "Run shell command",
  7542. "requestBody": {
  7543. "content": {
  7544. "application/json": {
  7545. "schema": {
  7546. "type": "object",
  7547. "properties": {
  7548. "messageID": {
  7549. "type": "string",
  7550. "pattern": "^msg"
  7551. },
  7552. "agent": {
  7553. "type": "string"
  7554. },
  7555. "model": {
  7556. "type": "object",
  7557. "properties": {
  7558. "providerID": {
  7559. "type": "string"
  7560. },
  7561. "modelID": {
  7562. "type": "string"
  7563. }
  7564. },
  7565. "required": ["providerID", "modelID"],
  7566. "additionalProperties": false
  7567. },
  7568. "command": {
  7569. "type": "string"
  7570. }
  7571. },
  7572. "required": ["agent", "command"],
  7573. "additionalProperties": false
  7574. }
  7575. }
  7576. }
  7577. },
  7578. "x-codeSamples": [
  7579. {
  7580. "lang": "js",
  7581. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.shell({\n ...\n})"
  7582. }
  7583. ]
  7584. }
  7585. },
  7586. "/session/{sessionID}/revert": {
  7587. "post": {
  7588. "tags": ["session"],
  7589. "operationId": "session.revert",
  7590. "parameters": [
  7591. {
  7592. "name": "sessionID",
  7593. "in": "path",
  7594. "schema": {
  7595. "type": "string",
  7596. "pattern": "^ses"
  7597. },
  7598. "required": true
  7599. },
  7600. {
  7601. "name": "directory",
  7602. "in": "query",
  7603. "schema": {
  7604. "type": "string"
  7605. },
  7606. "required": false
  7607. },
  7608. {
  7609. "name": "workspace",
  7610. "in": "query",
  7611. "schema": {
  7612. "type": "string"
  7613. },
  7614. "required": false
  7615. }
  7616. ],
  7617. "responses": {
  7618. "200": {
  7619. "description": "Updated session",
  7620. "content": {
  7621. "application/json": {
  7622. "schema": {
  7623. "$ref": "#/components/schemas/Session"
  7624. }
  7625. }
  7626. }
  7627. },
  7628. "400": {
  7629. "description": "BadRequest | InvalidRequestError",
  7630. "content": {
  7631. "application/json": {
  7632. "schema": {
  7633. "anyOf": [
  7634. {
  7635. "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
  7636. },
  7637. {
  7638. "$ref": "#/components/schemas/InvalidRequestError"
  7639. }
  7640. ]
  7641. }
  7642. }
  7643. }
  7644. },
  7645. "404": {
  7646. "description": "NotFoundError",
  7647. "content": {
  7648. "application/json": {
  7649. "schema": {
  7650. "$ref": "#/components/schemas/NotFoundError"
  7651. }
  7652. }
  7653. }
  7654. },
  7655. "409": {
  7656. "description": "SessionBusyError",
  7657. "content": {
  7658. "application/json": {
  7659. "schema": {
  7660. "$ref": "#/components/schemas/SessionBusyError"
  7661. }
  7662. }
  7663. }
  7664. }
  7665. },
  7666. "description": "Revert a specific message in a session, undoing its effects and restoring the previous state.",
  7667. "summary": "Revert message",
  7668. "requestBody": {
  7669. "content": {
  7670. "application/json": {
  7671. "schema": {
  7672. "type": "object",
  7673. "properties": {
  7674. "messageID": {
  7675. "type": "string",
  7676. "pattern": "^msg"
  7677. },
  7678. "partID": {
  7679. "type": "string",
  7680. "pattern": "^prt"
  7681. }
  7682. },
  7683. "required": ["messageID"],
  7684. "additionalProperties": false
  7685. }
  7686. }
  7687. }
  7688. },
  7689. "x-codeSamples": [
  7690. {
  7691. "lang": "js",
  7692. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.revert({\n ...\n})"
  7693. }
  7694. ]
  7695. }
  7696. },
  7697. "/session/{sessionID}/unrevert": {
  7698. "post": {
  7699. "tags": ["session"],
  7700. "operationId": "session.unrevert",
  7701. "parameters": [
  7702. {
  7703. "name": "sessionID",
  7704. "in": "path",
  7705. "schema": {
  7706. "type": "string",
  7707. "pattern": "^ses"
  7708. },
  7709. "required": true
  7710. },
  7711. {
  7712. "name": "directory",
  7713. "in": "query",
  7714. "schema": {
  7715. "type": "string"
  7716. },
  7717. "required": false
  7718. },
  7719. {
  7720. "name": "workspace",
  7721. "in": "query",
  7722. "schema": {
  7723. "type": "string"
  7724. },
  7725. "required": false
  7726. }
  7727. ],
  7728. "responses": {
  7729. "200": {
  7730. "description": "Updated session",
  7731. "content": {
  7732. "application/json": {
  7733. "schema": {
  7734. "$ref": "#/components/schemas/Session"
  7735. }
  7736. }
  7737. }
  7738. },
  7739. "400": {
  7740. "description": "BadRequest | InvalidRequestError",
  7741. "content": {
  7742. "application/json": {
  7743. "schema": {
  7744. "anyOf": [
  7745. {
  7746. "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
  7747. },
  7748. {
  7749. "$ref": "#/components/schemas/InvalidRequestError"
  7750. }
  7751. ]
  7752. }
  7753. }
  7754. }
  7755. },
  7756. "404": {
  7757. "description": "NotFoundError",
  7758. "content": {
  7759. "application/json": {
  7760. "schema": {
  7761. "$ref": "#/components/schemas/NotFoundError"
  7762. }
  7763. }
  7764. }
  7765. },
  7766. "409": {
  7767. "description": "SessionBusyError",
  7768. "content": {
  7769. "application/json": {
  7770. "schema": {
  7771. "$ref": "#/components/schemas/SessionBusyError"
  7772. }
  7773. }
  7774. }
  7775. }
  7776. },
  7777. "description": "Restore all previously reverted messages in a session.",
  7778. "summary": "Restore reverted messages",
  7779. "x-codeSamples": [
  7780. {
  7781. "lang": "js",
  7782. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.unrevert({\n ...\n})"
  7783. }
  7784. ]
  7785. }
  7786. },
  7787. "/session/{sessionID}/permissions/{permissionID}": {
  7788. "post": {
  7789. "tags": ["session"],
  7790. "operationId": "permission.respond",
  7791. "parameters": [
  7792. {
  7793. "name": "sessionID",
  7794. "in": "path",
  7795. "schema": {
  7796. "type": "string",
  7797. "pattern": "^ses"
  7798. },
  7799. "required": true
  7800. },
  7801. {
  7802. "name": "permissionID",
  7803. "in": "path",
  7804. "schema": {
  7805. "type": "string",
  7806. "pattern": "^per"
  7807. },
  7808. "required": true
  7809. },
  7810. {
  7811. "name": "directory",
  7812. "in": "query",
  7813. "schema": {
  7814. "type": "string"
  7815. },
  7816. "required": false
  7817. },
  7818. {
  7819. "name": "workspace",
  7820. "in": "query",
  7821. "schema": {
  7822. "type": "string"
  7823. },
  7824. "required": false
  7825. }
  7826. ],
  7827. "responses": {
  7828. "200": {
  7829. "description": "Permission processed successfully",
  7830. "content": {
  7831. "application/json": {
  7832. "schema": {
  7833. "type": "boolean",
  7834. "description": "Permission processed successfully"
  7835. }
  7836. }
  7837. }
  7838. },
  7839. "400": {
  7840. "description": "BadRequest | InvalidRequestError",
  7841. "content": {
  7842. "application/json": {
  7843. "schema": {
  7844. "anyOf": [
  7845. {
  7846. "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
  7847. },
  7848. {
  7849. "$ref": "#/components/schemas/InvalidRequestError"
  7850. }
  7851. ]
  7852. }
  7853. }
  7854. }
  7855. },
  7856. "404": {
  7857. "description": "NotFoundError | PermissionNotFoundError",
  7858. "content": {
  7859. "application/json": {
  7860. "schema": {
  7861. "anyOf": [
  7862. {
  7863. "$ref": "#/components/schemas/NotFoundError"
  7864. },
  7865. {
  7866. "$ref": "#/components/schemas/PermissionNotFoundError"
  7867. }
  7868. ]
  7869. }
  7870. }
  7871. }
  7872. }
  7873. },
  7874. "description": "Approve or deny a permission request from the AI assistant.",
  7875. "summary": "Respond to permission",
  7876. "deprecated": true,
  7877. "requestBody": {
  7878. "content": {
  7879. "application/json": {
  7880. "schema": {
  7881. "type": "object",
  7882. "properties": {
  7883. "response": {
  7884. "type": "string",
  7885. "enum": ["once", "always", "reject"]
  7886. }
  7887. },
  7888. "required": ["response"],
  7889. "additionalProperties": false
  7890. }
  7891. }
  7892. }
  7893. },
  7894. "x-codeSamples": [
  7895. {
  7896. "lang": "js",
  7897. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.permission.respond({\n ...\n})"
  7898. }
  7899. ]
  7900. }
  7901. },
  7902. "/session/{sessionID}/message/{messageID}/part/{partID}": {
  7903. "delete": {
  7904. "tags": ["session"],
  7905. "operationId": "part.delete",
  7906. "parameters": [
  7907. {
  7908. "name": "sessionID",
  7909. "in": "path",
  7910. "schema": {
  7911. "type": "string",
  7912. "pattern": "^ses"
  7913. },
  7914. "required": true
  7915. },
  7916. {
  7917. "name": "messageID",
  7918. "in": "path",
  7919. "schema": {
  7920. "type": "string",
  7921. "pattern": "^msg"
  7922. },
  7923. "required": true
  7924. },
  7925. {
  7926. "name": "partID",
  7927. "in": "path",
  7928. "schema": {
  7929. "type": "string",
  7930. "pattern": "^prt"
  7931. },
  7932. "required": true
  7933. },
  7934. {
  7935. "name": "directory",
  7936. "in": "query",
  7937. "schema": {
  7938. "type": "string"
  7939. },
  7940. "required": false
  7941. },
  7942. {
  7943. "name": "workspace",
  7944. "in": "query",
  7945. "schema": {
  7946. "type": "string"
  7947. },
  7948. "required": false
  7949. }
  7950. ],
  7951. "responses": {
  7952. "200": {
  7953. "description": "Successfully deleted part",
  7954. "content": {
  7955. "application/json": {
  7956. "schema": {
  7957. "type": "boolean",
  7958. "description": "Successfully deleted part"
  7959. }
  7960. }
  7961. }
  7962. },
  7963. "400": {
  7964. "description": "BadRequest | InvalidRequestError",
  7965. "content": {
  7966. "application/json": {
  7967. "schema": {
  7968. "anyOf": [
  7969. {
  7970. "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
  7971. },
  7972. {
  7973. "$ref": "#/components/schemas/InvalidRequestError"
  7974. }
  7975. ]
  7976. }
  7977. }
  7978. }
  7979. },
  7980. "404": {
  7981. "description": "NotFoundError",
  7982. "content": {
  7983. "application/json": {
  7984. "schema": {
  7985. "$ref": "#/components/schemas/NotFoundError"
  7986. }
  7987. }
  7988. }
  7989. }
  7990. },
  7991. "description": "Delete a part from a message.",
  7992. "x-codeSamples": [
  7993. {
  7994. "lang": "js",
  7995. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.part.delete({\n ...\n})"
  7996. }
  7997. ]
  7998. },
  7999. "patch": {
  8000. "tags": ["session"],
  8001. "operationId": "part.update",
  8002. "parameters": [
  8003. {
  8004. "name": "sessionID",
  8005. "in": "path",
  8006. "schema": {
  8007. "type": "string",
  8008. "pattern": "^ses"
  8009. },
  8010. "required": true
  8011. },
  8012. {
  8013. "name": "messageID",
  8014. "in": "path",
  8015. "schema": {
  8016. "type": "string",
  8017. "pattern": "^msg"
  8018. },
  8019. "required": true
  8020. },
  8021. {
  8022. "name": "partID",
  8023. "in": "path",
  8024. "schema": {
  8025. "type": "string",
  8026. "pattern": "^prt"
  8027. },
  8028. "required": true
  8029. },
  8030. {
  8031. "name": "directory",
  8032. "in": "query",
  8033. "schema": {
  8034. "type": "string"
  8035. },
  8036. "required": false
  8037. },
  8038. {
  8039. "name": "workspace",
  8040. "in": "query",
  8041. "schema": {
  8042. "type": "string"
  8043. },
  8044. "required": false
  8045. }
  8046. ],
  8047. "responses": {
  8048. "200": {
  8049. "description": "Successfully updated part",
  8050. "content": {
  8051. "application/json": {
  8052. "schema": {
  8053. "$ref": "#/components/schemas/Part"
  8054. }
  8055. }
  8056. }
  8057. },
  8058. "400": {
  8059. "description": "BadRequest | InvalidRequestError",
  8060. "content": {
  8061. "application/json": {
  8062. "schema": {
  8063. "anyOf": [
  8064. {
  8065. "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
  8066. },
  8067. {
  8068. "$ref": "#/components/schemas/InvalidRequestError"
  8069. }
  8070. ]
  8071. }
  8072. }
  8073. }
  8074. },
  8075. "404": {
  8076. "description": "NotFoundError",
  8077. "content": {
  8078. "application/json": {
  8079. "schema": {
  8080. "$ref": "#/components/schemas/NotFoundError"
  8081. }
  8082. }
  8083. }
  8084. }
  8085. },
  8086. "description": "Update a part in a message.",
  8087. "requestBody": {
  8088. "content": {
  8089. "application/json": {
  8090. "schema": {
  8091. "$ref": "#/components/schemas/Part"
  8092. }
  8093. }
  8094. }
  8095. },
  8096. "x-codeSamples": [
  8097. {
  8098. "lang": "js",
  8099. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.part.update({\n ...\n})"
  8100. }
  8101. ]
  8102. }
  8103. },
  8104. "/sync/start": {
  8105. "post": {
  8106. "tags": ["sync"],
  8107. "operationId": "sync.start",
  8108. "parameters": [
  8109. {
  8110. "name": "directory",
  8111. "in": "query",
  8112. "schema": {
  8113. "type": "string"
  8114. },
  8115. "required": false
  8116. },
  8117. {
  8118. "name": "workspace",
  8119. "in": "query",
  8120. "schema": {
  8121. "type": "string"
  8122. },
  8123. "required": false
  8124. }
  8125. ],
  8126. "responses": {
  8127. "200": {
  8128. "description": "Workspace sync started",
  8129. "content": {
  8130. "application/json": {
  8131. "schema": {
  8132. "type": "boolean",
  8133. "description": "Workspace sync started"
  8134. }
  8135. }
  8136. }
  8137. },
  8138. "400": {
  8139. "description": "Bad request",
  8140. "content": {
  8141. "application/json": {
  8142. "schema": {
  8143. "$ref": "#/components/schemas/BadRequestError"
  8144. }
  8145. }
  8146. }
  8147. }
  8148. },
  8149. "description": "Start sync loops for workspaces in the current project that have active sessions.",
  8150. "summary": "Start workspace sync",
  8151. "x-codeSamples": [
  8152. {
  8153. "lang": "js",
  8154. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.sync.start({\n ...\n})"
  8155. }
  8156. ]
  8157. }
  8158. },
  8159. "/sync/replay": {
  8160. "post": {
  8161. "tags": ["sync"],
  8162. "operationId": "sync.replay",
  8163. "parameters": [
  8164. {
  8165. "name": "directory",
  8166. "in": "query",
  8167. "schema": {
  8168. "type": "string"
  8169. },
  8170. "required": false
  8171. },
  8172. {
  8173. "name": "workspace",
  8174. "in": "query",
  8175. "schema": {
  8176. "type": "string"
  8177. },
  8178. "required": false
  8179. }
  8180. ],
  8181. "responses": {
  8182. "200": {
  8183. "description": "Replayed sync events",
  8184. "content": {
  8185. "application/json": {
  8186. "schema": {
  8187. "type": "object",
  8188. "properties": {
  8189. "sessionID": {
  8190. "type": "string"
  8191. }
  8192. },
  8193. "required": ["sessionID"],
  8194. "additionalProperties": false,
  8195. "description": "Replayed sync events"
  8196. }
  8197. }
  8198. }
  8199. },
  8200. "400": {
  8201. "description": "BadRequest | InvalidRequestError",
  8202. "content": {
  8203. "application/json": {
  8204. "schema": {
  8205. "anyOf": [
  8206. {
  8207. "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
  8208. },
  8209. {
  8210. "$ref": "#/components/schemas/InvalidRequestError"
  8211. }
  8212. ]
  8213. }
  8214. }
  8215. }
  8216. }
  8217. },
  8218. "description": "Validate and replay a complete sync event history.",
  8219. "summary": "Replay sync events",
  8220. "requestBody": {
  8221. "content": {
  8222. "application/json": {
  8223. "schema": {
  8224. "type": "object",
  8225. "properties": {
  8226. "directory": {
  8227. "type": "string"
  8228. },
  8229. "events": {
  8230. "type": "array",
  8231. "minItems": 1,
  8232. "items": {
  8233. "type": "object",
  8234. "properties": {
  8235. "id": {
  8236. "type": "string",
  8237. "pattern": "^evt_"
  8238. },
  8239. "aggregateID": {
  8240. "type": "string"
  8241. },
  8242. "seq": {
  8243. "type": "integer",
  8244. "minimum": 0
  8245. },
  8246. "type": {
  8247. "type": "string"
  8248. },
  8249. "data": {
  8250. "type": "object"
  8251. }
  8252. },
  8253. "required": ["id", "aggregateID", "seq", "type", "data"],
  8254. "additionalProperties": false
  8255. }
  8256. }
  8257. },
  8258. "required": ["directory", "events"],
  8259. "additionalProperties": false
  8260. }
  8261. }
  8262. }
  8263. },
  8264. "x-codeSamples": [
  8265. {
  8266. "lang": "js",
  8267. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.sync.replay({\n ...\n})"
  8268. }
  8269. ]
  8270. }
  8271. },
  8272. "/sync/steal": {
  8273. "post": {
  8274. "tags": ["sync"],
  8275. "operationId": "sync.steal",
  8276. "parameters": [
  8277. {
  8278. "name": "directory",
  8279. "in": "query",
  8280. "schema": {
  8281. "type": "string"
  8282. },
  8283. "required": false
  8284. },
  8285. {
  8286. "name": "workspace",
  8287. "in": "query",
  8288. "schema": {
  8289. "type": "string"
  8290. },
  8291. "required": false
  8292. }
  8293. ],
  8294. "responses": {
  8295. "200": {
  8296. "description": "Session stolen into workspace",
  8297. "content": {
  8298. "application/json": {
  8299. "schema": {
  8300. "type": "object",
  8301. "properties": {
  8302. "sessionID": {
  8303. "type": "string",
  8304. "pattern": "^ses"
  8305. }
  8306. },
  8307. "required": ["sessionID"],
  8308. "additionalProperties": false,
  8309. "description": "Session stolen into workspace"
  8310. }
  8311. }
  8312. }
  8313. },
  8314. "400": {
  8315. "description": "BadRequest | InvalidRequestError",
  8316. "content": {
  8317. "application/json": {
  8318. "schema": {
  8319. "anyOf": [
  8320. {
  8321. "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
  8322. },
  8323. {
  8324. "$ref": "#/components/schemas/InvalidRequestError"
  8325. }
  8326. ]
  8327. }
  8328. }
  8329. }
  8330. }
  8331. },
  8332. "description": "Update a session to belong to the current workspace through the sync event system.",
  8333. "summary": "Steal session into workspace",
  8334. "requestBody": {
  8335. "content": {
  8336. "application/json": {
  8337. "schema": {
  8338. "type": "object",
  8339. "properties": {
  8340. "sessionID": {
  8341. "type": "string",
  8342. "pattern": "^ses"
  8343. }
  8344. },
  8345. "required": ["sessionID"],
  8346. "additionalProperties": false
  8347. }
  8348. }
  8349. }
  8350. },
  8351. "x-codeSamples": [
  8352. {
  8353. "lang": "js",
  8354. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.sync.steal({\n ...\n})"
  8355. }
  8356. ]
  8357. }
  8358. },
  8359. "/sync/history": {
  8360. "post": {
  8361. "tags": ["sync"],
  8362. "operationId": "sync.history.list",
  8363. "parameters": [
  8364. {
  8365. "name": "directory",
  8366. "in": "query",
  8367. "schema": {
  8368. "type": "string"
  8369. },
  8370. "required": false
  8371. },
  8372. {
  8373. "name": "workspace",
  8374. "in": "query",
  8375. "schema": {
  8376. "type": "string"
  8377. },
  8378. "required": false
  8379. }
  8380. ],
  8381. "responses": {
  8382. "200": {
  8383. "description": "Sync events",
  8384. "content": {
  8385. "application/json": {
  8386. "schema": {
  8387. "type": "array",
  8388. "items": {
  8389. "type": "object",
  8390. "properties": {
  8391. "id": {
  8392. "type": "string",
  8393. "pattern": "^evt_"
  8394. },
  8395. "aggregate_id": {
  8396. "type": "string"
  8397. },
  8398. "seq": {
  8399. "type": "integer",
  8400. "minimum": 0
  8401. },
  8402. "type": {
  8403. "type": "string"
  8404. },
  8405. "data": {
  8406. "type": "object"
  8407. }
  8408. },
  8409. "required": ["id", "aggregate_id", "seq", "type", "data"],
  8410. "additionalProperties": false
  8411. },
  8412. "description": "Sync events"
  8413. }
  8414. }
  8415. }
  8416. },
  8417. "400": {
  8418. "description": "BadRequest | InvalidRequestError",
  8419. "content": {
  8420. "application/json": {
  8421. "schema": {
  8422. "anyOf": [
  8423. {
  8424. "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
  8425. },
  8426. {
  8427. "$ref": "#/components/schemas/InvalidRequestError"
  8428. }
  8429. ]
  8430. }
  8431. }
  8432. }
  8433. }
  8434. },
  8435. "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.",
  8436. "summary": "List sync events",
  8437. "requestBody": {
  8438. "content": {
  8439. "application/json": {
  8440. "schema": {
  8441. "type": "object",
  8442. "additionalProperties": {
  8443. "type": "integer",
  8444. "minimum": 0
  8445. }
  8446. }
  8447. }
  8448. }
  8449. },
  8450. "x-codeSamples": [
  8451. {
  8452. "lang": "js",
  8453. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.sync.history.list({\n ...\n})"
  8454. }
  8455. ]
  8456. }
  8457. },
  8458. "/tui/append-prompt": {
  8459. "post": {
  8460. "tags": ["tui"],
  8461. "operationId": "tui.appendPrompt",
  8462. "parameters": [
  8463. {
  8464. "name": "directory",
  8465. "in": "query",
  8466. "schema": {
  8467. "type": "string"
  8468. },
  8469. "required": false
  8470. },
  8471. {
  8472. "name": "workspace",
  8473. "in": "query",
  8474. "schema": {
  8475. "type": "string"
  8476. },
  8477. "required": false
  8478. }
  8479. ],
  8480. "responses": {
  8481. "200": {
  8482. "description": "Prompt processed successfully",
  8483. "content": {
  8484. "application/json": {
  8485. "schema": {
  8486. "type": "boolean",
  8487. "description": "Prompt processed successfully"
  8488. }
  8489. }
  8490. }
  8491. },
  8492. "400": {
  8493. "description": "BadRequest | InvalidRequestError",
  8494. "content": {
  8495. "application/json": {
  8496. "schema": {
  8497. "anyOf": [
  8498. {
  8499. "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
  8500. },
  8501. {
  8502. "$ref": "#/components/schemas/InvalidRequestError"
  8503. }
  8504. ]
  8505. }
  8506. }
  8507. }
  8508. }
  8509. },
  8510. "description": "Append prompt to the TUI.",
  8511. "summary": "Append TUI prompt",
  8512. "requestBody": {
  8513. "content": {
  8514. "application/json": {
  8515. "schema": {
  8516. "type": "object",
  8517. "properties": {
  8518. "text": {
  8519. "type": "string"
  8520. }
  8521. },
  8522. "required": ["text"],
  8523. "additionalProperties": false
  8524. }
  8525. }
  8526. }
  8527. },
  8528. "x-codeSamples": [
  8529. {
  8530. "lang": "js",
  8531. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.appendPrompt({\n ...\n})"
  8532. }
  8533. ]
  8534. }
  8535. },
  8536. "/tui/open-help": {
  8537. "post": {
  8538. "tags": ["tui"],
  8539. "operationId": "tui.openHelp",
  8540. "parameters": [
  8541. {
  8542. "name": "directory",
  8543. "in": "query",
  8544. "schema": {
  8545. "type": "string"
  8546. },
  8547. "required": false
  8548. },
  8549. {
  8550. "name": "workspace",
  8551. "in": "query",
  8552. "schema": {
  8553. "type": "string"
  8554. },
  8555. "required": false
  8556. }
  8557. ],
  8558. "responses": {
  8559. "200": {
  8560. "description": "Help dialog opened successfully",
  8561. "content": {
  8562. "application/json": {
  8563. "schema": {
  8564. "type": "boolean",
  8565. "description": "Help dialog opened successfully"
  8566. }
  8567. }
  8568. }
  8569. },
  8570. "400": {
  8571. "description": "Bad request",
  8572. "content": {
  8573. "application/json": {
  8574. "schema": {
  8575. "$ref": "#/components/schemas/BadRequestError"
  8576. }
  8577. }
  8578. }
  8579. }
  8580. },
  8581. "description": "Open the help dialog in the TUI to display user assistance information.",
  8582. "summary": "Open help dialog",
  8583. "x-codeSamples": [
  8584. {
  8585. "lang": "js",
  8586. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openHelp({\n ...\n})"
  8587. }
  8588. ]
  8589. }
  8590. },
  8591. "/tui/open-sessions": {
  8592. "post": {
  8593. "tags": ["tui"],
  8594. "operationId": "tui.openSessions",
  8595. "parameters": [
  8596. {
  8597. "name": "directory",
  8598. "in": "query",
  8599. "schema": {
  8600. "type": "string"
  8601. },
  8602. "required": false
  8603. },
  8604. {
  8605. "name": "workspace",
  8606. "in": "query",
  8607. "schema": {
  8608. "type": "string"
  8609. },
  8610. "required": false
  8611. }
  8612. ],
  8613. "responses": {
  8614. "200": {
  8615. "description": "Session dialog opened successfully",
  8616. "content": {
  8617. "application/json": {
  8618. "schema": {
  8619. "type": "boolean",
  8620. "description": "Session dialog opened successfully"
  8621. }
  8622. }
  8623. }
  8624. },
  8625. "400": {
  8626. "description": "Bad request",
  8627. "content": {
  8628. "application/json": {
  8629. "schema": {
  8630. "$ref": "#/components/schemas/BadRequestError"
  8631. }
  8632. }
  8633. }
  8634. }
  8635. },
  8636. "description": "Open the session dialog.",
  8637. "summary": "Open sessions dialog",
  8638. "x-codeSamples": [
  8639. {
  8640. "lang": "js",
  8641. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openSessions({\n ...\n})"
  8642. }
  8643. ]
  8644. }
  8645. },
  8646. "/tui/open-themes": {
  8647. "post": {
  8648. "tags": ["tui"],
  8649. "operationId": "tui.openThemes",
  8650. "parameters": [
  8651. {
  8652. "name": "directory",
  8653. "in": "query",
  8654. "schema": {
  8655. "type": "string"
  8656. },
  8657. "required": false
  8658. },
  8659. {
  8660. "name": "workspace",
  8661. "in": "query",
  8662. "schema": {
  8663. "type": "string"
  8664. },
  8665. "required": false
  8666. }
  8667. ],
  8668. "responses": {
  8669. "200": {
  8670. "description": "Theme dialog opened successfully",
  8671. "content": {
  8672. "application/json": {
  8673. "schema": {
  8674. "type": "boolean",
  8675. "description": "Theme dialog opened successfully"
  8676. }
  8677. }
  8678. }
  8679. },
  8680. "400": {
  8681. "description": "Bad request",
  8682. "content": {
  8683. "application/json": {
  8684. "schema": {
  8685. "$ref": "#/components/schemas/BadRequestError"
  8686. }
  8687. }
  8688. }
  8689. }
  8690. },
  8691. "description": "Open the theme dialog.",
  8692. "summary": "Open themes dialog",
  8693. "x-codeSamples": [
  8694. {
  8695. "lang": "js",
  8696. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openThemes({\n ...\n})"
  8697. }
  8698. ]
  8699. }
  8700. },
  8701. "/tui/open-models": {
  8702. "post": {
  8703. "tags": ["tui"],
  8704. "operationId": "tui.openModels",
  8705. "parameters": [
  8706. {
  8707. "name": "directory",
  8708. "in": "query",
  8709. "schema": {
  8710. "type": "string"
  8711. },
  8712. "required": false
  8713. },
  8714. {
  8715. "name": "workspace",
  8716. "in": "query",
  8717. "schema": {
  8718. "type": "string"
  8719. },
  8720. "required": false
  8721. }
  8722. ],
  8723. "responses": {
  8724. "200": {
  8725. "description": "Model dialog opened successfully",
  8726. "content": {
  8727. "application/json": {
  8728. "schema": {
  8729. "type": "boolean",
  8730. "description": "Model dialog opened successfully"
  8731. }
  8732. }
  8733. }
  8734. },
  8735. "400": {
  8736. "description": "Bad request",
  8737. "content": {
  8738. "application/json": {
  8739. "schema": {
  8740. "$ref": "#/components/schemas/BadRequestError"
  8741. }
  8742. }
  8743. }
  8744. }
  8745. },
  8746. "description": "Open the model dialog.",
  8747. "summary": "Open models dialog",
  8748. "x-codeSamples": [
  8749. {
  8750. "lang": "js",
  8751. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openModels({\n ...\n})"
  8752. }
  8753. ]
  8754. }
  8755. },
  8756. "/tui/submit-prompt": {
  8757. "post": {
  8758. "tags": ["tui"],
  8759. "operationId": "tui.submitPrompt",
  8760. "parameters": [
  8761. {
  8762. "name": "directory",
  8763. "in": "query",
  8764. "schema": {
  8765. "type": "string"
  8766. },
  8767. "required": false
  8768. },
  8769. {
  8770. "name": "workspace",
  8771. "in": "query",
  8772. "schema": {
  8773. "type": "string"
  8774. },
  8775. "required": false
  8776. }
  8777. ],
  8778. "responses": {
  8779. "200": {
  8780. "description": "Prompt submitted successfully",
  8781. "content": {
  8782. "application/json": {
  8783. "schema": {
  8784. "type": "boolean",
  8785. "description": "Prompt submitted successfully"
  8786. }
  8787. }
  8788. }
  8789. },
  8790. "400": {
  8791. "description": "Bad request",
  8792. "content": {
  8793. "application/json": {
  8794. "schema": {
  8795. "$ref": "#/components/schemas/BadRequestError"
  8796. }
  8797. }
  8798. }
  8799. }
  8800. },
  8801. "description": "Submit the prompt.",
  8802. "summary": "Submit TUI prompt",
  8803. "x-codeSamples": [
  8804. {
  8805. "lang": "js",
  8806. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.submitPrompt({\n ...\n})"
  8807. }
  8808. ]
  8809. }
  8810. },
  8811. "/tui/clear-prompt": {
  8812. "post": {
  8813. "tags": ["tui"],
  8814. "operationId": "tui.clearPrompt",
  8815. "parameters": [
  8816. {
  8817. "name": "directory",
  8818. "in": "query",
  8819. "schema": {
  8820. "type": "string"
  8821. },
  8822. "required": false
  8823. },
  8824. {
  8825. "name": "workspace",
  8826. "in": "query",
  8827. "schema": {
  8828. "type": "string"
  8829. },
  8830. "required": false
  8831. }
  8832. ],
  8833. "responses": {
  8834. "200": {
  8835. "description": "Prompt cleared successfully",
  8836. "content": {
  8837. "application/json": {
  8838. "schema": {
  8839. "type": "boolean",
  8840. "description": "Prompt cleared successfully"
  8841. }
  8842. }
  8843. }
  8844. },
  8845. "400": {
  8846. "description": "Bad request",
  8847. "content": {
  8848. "application/json": {
  8849. "schema": {
  8850. "$ref": "#/components/schemas/BadRequestError"
  8851. }
  8852. }
  8853. }
  8854. }
  8855. },
  8856. "description": "Clear the prompt.",
  8857. "summary": "Clear TUI prompt",
  8858. "x-codeSamples": [
  8859. {
  8860. "lang": "js",
  8861. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.clearPrompt({\n ...\n})"
  8862. }
  8863. ]
  8864. }
  8865. },
  8866. "/tui/execute-command": {
  8867. "post": {
  8868. "tags": ["tui"],
  8869. "operationId": "tui.executeCommand",
  8870. "parameters": [
  8871. {
  8872. "name": "directory",
  8873. "in": "query",
  8874. "schema": {
  8875. "type": "string"
  8876. },
  8877. "required": false
  8878. },
  8879. {
  8880. "name": "workspace",
  8881. "in": "query",
  8882. "schema": {
  8883. "type": "string"
  8884. },
  8885. "required": false
  8886. }
  8887. ],
  8888. "responses": {
  8889. "200": {
  8890. "description": "Command executed successfully",
  8891. "content": {
  8892. "application/json": {
  8893. "schema": {
  8894. "type": "boolean",
  8895. "description": "Command executed successfully"
  8896. }
  8897. }
  8898. }
  8899. },
  8900. "400": {
  8901. "description": "BadRequest | InvalidRequestError",
  8902. "content": {
  8903. "application/json": {
  8904. "schema": {
  8905. "anyOf": [
  8906. {
  8907. "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
  8908. },
  8909. {
  8910. "$ref": "#/components/schemas/InvalidRequestError"
  8911. }
  8912. ]
  8913. }
  8914. }
  8915. }
  8916. }
  8917. },
  8918. "description": "Execute a TUI command.",
  8919. "summary": "Execute TUI command",
  8920. "requestBody": {
  8921. "content": {
  8922. "application/json": {
  8923. "schema": {
  8924. "type": "object",
  8925. "properties": {
  8926. "command": {
  8927. "type": "string"
  8928. }
  8929. },
  8930. "required": ["command"],
  8931. "additionalProperties": false
  8932. }
  8933. }
  8934. }
  8935. },
  8936. "x-codeSamples": [
  8937. {
  8938. "lang": "js",
  8939. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.executeCommand({\n ...\n})"
  8940. }
  8941. ]
  8942. }
  8943. },
  8944. "/tui/show-toast": {
  8945. "post": {
  8946. "tags": ["tui"],
  8947. "operationId": "tui.showToast",
  8948. "parameters": [
  8949. {
  8950. "name": "directory",
  8951. "in": "query",
  8952. "schema": {
  8953. "type": "string"
  8954. },
  8955. "required": false
  8956. },
  8957. {
  8958. "name": "workspace",
  8959. "in": "query",
  8960. "schema": {
  8961. "type": "string"
  8962. },
  8963. "required": false
  8964. }
  8965. ],
  8966. "responses": {
  8967. "200": {
  8968. "description": "Toast notification shown successfully",
  8969. "content": {
  8970. "application/json": {
  8971. "schema": {
  8972. "type": "boolean",
  8973. "description": "Toast notification shown successfully"
  8974. }
  8975. }
  8976. }
  8977. },
  8978. "400": {
  8979. "description": "Bad request",
  8980. "content": {
  8981. "application/json": {
  8982. "schema": {
  8983. "$ref": "#/components/schemas/BadRequestError"
  8984. }
  8985. }
  8986. }
  8987. }
  8988. },
  8989. "description": "Show a toast notification in the TUI.",
  8990. "summary": "Show TUI toast",
  8991. "requestBody": {
  8992. "content": {
  8993. "application/json": {
  8994. "schema": {
  8995. "type": "object",
  8996. "properties": {
  8997. "title": {
  8998. "type": "string"
  8999. },
  9000. "message": {
  9001. "type": "string"
  9002. },
  9003. "variant": {
  9004. "type": "string",
  9005. "enum": ["info", "success", "warning", "error"]
  9006. },
  9007. "duration": {
  9008. "type": "integer",
  9009. "exclusiveMinimum": 0
  9010. }
  9011. },
  9012. "required": ["message", "variant"],
  9013. "additionalProperties": false
  9014. }
  9015. }
  9016. }
  9017. },
  9018. "x-codeSamples": [
  9019. {
  9020. "lang": "js",
  9021. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.showToast({\n ...\n})"
  9022. }
  9023. ]
  9024. }
  9025. },
  9026. "/tui/publish": {
  9027. "post": {
  9028. "tags": ["tui"],
  9029. "operationId": "tui.publish",
  9030. "parameters": [
  9031. {
  9032. "name": "directory",
  9033. "in": "query",
  9034. "schema": {
  9035. "type": "string"
  9036. },
  9037. "required": false
  9038. },
  9039. {
  9040. "name": "workspace",
  9041. "in": "query",
  9042. "schema": {
  9043. "type": "string"
  9044. },
  9045. "required": false
  9046. }
  9047. ],
  9048. "responses": {
  9049. "200": {
  9050. "description": "Event published successfully",
  9051. "content": {
  9052. "application/json": {
  9053. "schema": {
  9054. "type": "boolean",
  9055. "description": "Event published successfully"
  9056. }
  9057. }
  9058. }
  9059. },
  9060. "400": {
  9061. "description": "BadRequest | InvalidRequestError",
  9062. "content": {
  9063. "application/json": {
  9064. "schema": {
  9065. "anyOf": [
  9066. {
  9067. "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
  9068. },
  9069. {
  9070. "$ref": "#/components/schemas/InvalidRequestError"
  9071. }
  9072. ]
  9073. }
  9074. }
  9075. }
  9076. }
  9077. },
  9078. "description": "Publish a TUI event.",
  9079. "summary": "Publish TUI event",
  9080. "requestBody": {
  9081. "content": {
  9082. "application/json": {
  9083. "schema": {
  9084. "anyOf": [
  9085. {
  9086. "$ref": "#/components/schemas/EventTuiPromptAppend"
  9087. },
  9088. {
  9089. "$ref": "#/components/schemas/EventTuiCommandExecute"
  9090. },
  9091. {
  9092. "$ref": "#/components/schemas/EventTuiToastShow"
  9093. },
  9094. {
  9095. "$ref": "#/components/schemas/EventTuiSessionSelect"
  9096. }
  9097. ]
  9098. }
  9099. }
  9100. }
  9101. },
  9102. "x-codeSamples": [
  9103. {
  9104. "lang": "js",
  9105. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.publish({\n ...\n})"
  9106. }
  9107. ]
  9108. }
  9109. },
  9110. "/tui/select-session": {
  9111. "post": {
  9112. "tags": ["tui"],
  9113. "operationId": "tui.selectSession",
  9114. "parameters": [
  9115. {
  9116. "name": "directory",
  9117. "in": "query",
  9118. "schema": {
  9119. "type": "string"
  9120. },
  9121. "required": false
  9122. },
  9123. {
  9124. "name": "workspace",
  9125. "in": "query",
  9126. "schema": {
  9127. "type": "string"
  9128. },
  9129. "required": false
  9130. }
  9131. ],
  9132. "responses": {
  9133. "200": {
  9134. "description": "Session selected successfully",
  9135. "content": {
  9136. "application/json": {
  9137. "schema": {
  9138. "type": "boolean",
  9139. "description": "Session selected successfully"
  9140. }
  9141. }
  9142. }
  9143. },
  9144. "400": {
  9145. "description": "BadRequest | InvalidRequestError",
  9146. "content": {
  9147. "application/json": {
  9148. "schema": {
  9149. "anyOf": [
  9150. {
  9151. "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
  9152. },
  9153. {
  9154. "$ref": "#/components/schemas/InvalidRequestError"
  9155. }
  9156. ]
  9157. }
  9158. }
  9159. }
  9160. },
  9161. "404": {
  9162. "description": "NotFoundError",
  9163. "content": {
  9164. "application/json": {
  9165. "schema": {
  9166. "$ref": "#/components/schemas/NotFoundError"
  9167. }
  9168. }
  9169. }
  9170. }
  9171. },
  9172. "description": "Navigate the TUI to display the specified session.",
  9173. "summary": "Select session",
  9174. "requestBody": {
  9175. "content": {
  9176. "application/json": {
  9177. "schema": {
  9178. "type": "object",
  9179. "properties": {
  9180. "sessionID": {
  9181. "type": "string",
  9182. "pattern": "^ses",
  9183. "description": "Session ID to navigate to"
  9184. }
  9185. },
  9186. "required": ["sessionID"],
  9187. "additionalProperties": false
  9188. }
  9189. }
  9190. }
  9191. },
  9192. "x-codeSamples": [
  9193. {
  9194. "lang": "js",
  9195. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.selectSession({\n ...\n})"
  9196. }
  9197. ]
  9198. }
  9199. },
  9200. "/tui/control/next": {
  9201. "get": {
  9202. "tags": ["tui"],
  9203. "operationId": "tui.control.next",
  9204. "parameters": [
  9205. {
  9206. "name": "directory",
  9207. "in": "query",
  9208. "schema": {
  9209. "type": "string"
  9210. },
  9211. "required": false
  9212. },
  9213. {
  9214. "name": "workspace",
  9215. "in": "query",
  9216. "schema": {
  9217. "type": "string"
  9218. },
  9219. "required": false
  9220. }
  9221. ],
  9222. "responses": {
  9223. "200": {
  9224. "description": "Next TUI request",
  9225. "content": {
  9226. "application/json": {
  9227. "schema": {
  9228. "type": "object",
  9229. "properties": {
  9230. "path": {
  9231. "type": "string"
  9232. },
  9233. "body": {}
  9234. },
  9235. "required": ["path", "body"],
  9236. "additionalProperties": false,
  9237. "description": "Next TUI request"
  9238. }
  9239. }
  9240. }
  9241. },
  9242. "400": {
  9243. "description": "Bad request",
  9244. "content": {
  9245. "application/json": {
  9246. "schema": {
  9247. "$ref": "#/components/schemas/BadRequestError"
  9248. }
  9249. }
  9250. }
  9251. }
  9252. },
  9253. "description": "Retrieve the next TUI request from the queue for processing.",
  9254. "summary": "Get next TUI request",
  9255. "x-codeSamples": [
  9256. {
  9257. "lang": "js",
  9258. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.control.next({\n ...\n})"
  9259. }
  9260. ]
  9261. }
  9262. },
  9263. "/tui/control/response": {
  9264. "post": {
  9265. "tags": ["tui"],
  9266. "operationId": "tui.control.response",
  9267. "parameters": [
  9268. {
  9269. "name": "directory",
  9270. "in": "query",
  9271. "schema": {
  9272. "type": "string"
  9273. },
  9274. "required": false
  9275. },
  9276. {
  9277. "name": "workspace",
  9278. "in": "query",
  9279. "schema": {
  9280. "type": "string"
  9281. },
  9282. "required": false
  9283. }
  9284. ],
  9285. "responses": {
  9286. "200": {
  9287. "description": "Response submitted successfully",
  9288. "content": {
  9289. "application/json": {
  9290. "schema": {
  9291. "type": "boolean",
  9292. "description": "Response submitted successfully"
  9293. }
  9294. }
  9295. }
  9296. },
  9297. "400": {
  9298. "description": "Bad request",
  9299. "content": {
  9300. "application/json": {
  9301. "schema": {
  9302. "$ref": "#/components/schemas/BadRequestError"
  9303. }
  9304. }
  9305. }
  9306. }
  9307. },
  9308. "description": "Submit a response to the TUI request queue to complete a pending request.",
  9309. "summary": "Submit TUI response",
  9310. "requestBody": {
  9311. "content": {
  9312. "application/json": {
  9313. "schema": {}
  9314. }
  9315. }
  9316. },
  9317. "x-codeSamples": [
  9318. {
  9319. "lang": "js",
  9320. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.control.response({\n ...\n})"
  9321. }
  9322. ]
  9323. }
  9324. },
  9325. "/experimental/workspace/adapter": {
  9326. "get": {
  9327. "tags": ["workspace"],
  9328. "operationId": "experimental.workspace.adapter.list",
  9329. "parameters": [
  9330. {
  9331. "name": "directory",
  9332. "in": "query",
  9333. "schema": {
  9334. "type": "string"
  9335. },
  9336. "required": false
  9337. },
  9338. {
  9339. "name": "workspace",
  9340. "in": "query",
  9341. "schema": {
  9342. "type": "string"
  9343. },
  9344. "required": false
  9345. }
  9346. ],
  9347. "responses": {
  9348. "200": {
  9349. "description": "Workspace adapters",
  9350. "content": {
  9351. "application/json": {
  9352. "schema": {
  9353. "type": "array",
  9354. "items": {
  9355. "type": "object",
  9356. "properties": {
  9357. "type": {
  9358. "type": "string"
  9359. },
  9360. "name": {
  9361. "type": "string"
  9362. },
  9363. "description": {
  9364. "type": "string"
  9365. }
  9366. },
  9367. "required": ["type", "name", "description"],
  9368. "additionalProperties": false
  9369. },
  9370. "description": "Workspace adapters"
  9371. }
  9372. }
  9373. }
  9374. },
  9375. "400": {
  9376. "description": "Bad request",
  9377. "content": {
  9378. "application/json": {
  9379. "schema": {
  9380. "$ref": "#/components/schemas/BadRequestError"
  9381. }
  9382. }
  9383. }
  9384. }
  9385. },
  9386. "description": "List all available workspace adapters for the current project.",
  9387. "summary": "List workspace adapters",
  9388. "x-codeSamples": [
  9389. {
  9390. "lang": "js",
  9391. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.adapter.list({\n ...\n})"
  9392. }
  9393. ]
  9394. }
  9395. },
  9396. "/experimental/workspace": {
  9397. "get": {
  9398. "tags": ["workspace"],
  9399. "operationId": "experimental.workspace.list",
  9400. "parameters": [
  9401. {
  9402. "name": "directory",
  9403. "in": "query",
  9404. "schema": {
  9405. "type": "string"
  9406. },
  9407. "required": false
  9408. },
  9409. {
  9410. "name": "workspace",
  9411. "in": "query",
  9412. "schema": {
  9413. "type": "string"
  9414. },
  9415. "required": false
  9416. }
  9417. ],
  9418. "responses": {
  9419. "200": {
  9420. "description": "Workspaces",
  9421. "content": {
  9422. "application/json": {
  9423. "schema": {
  9424. "type": "array",
  9425. "items": {
  9426. "$ref": "#/components/schemas/Workspace"
  9427. },
  9428. "description": "Workspaces"
  9429. }
  9430. }
  9431. }
  9432. },
  9433. "400": {
  9434. "description": "Bad request",
  9435. "content": {
  9436. "application/json": {
  9437. "schema": {
  9438. "$ref": "#/components/schemas/BadRequestError"
  9439. }
  9440. }
  9441. }
  9442. }
  9443. },
  9444. "description": "List all workspaces.",
  9445. "summary": "List workspaces",
  9446. "x-codeSamples": [
  9447. {
  9448. "lang": "js",
  9449. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.list({\n ...\n})"
  9450. }
  9451. ]
  9452. },
  9453. "post": {
  9454. "tags": ["workspace"],
  9455. "operationId": "experimental.workspace.create",
  9456. "parameters": [
  9457. {
  9458. "name": "directory",
  9459. "in": "query",
  9460. "schema": {
  9461. "type": "string"
  9462. },
  9463. "required": false
  9464. },
  9465. {
  9466. "name": "workspace",
  9467. "in": "query",
  9468. "schema": {
  9469. "type": "string"
  9470. },
  9471. "required": false
  9472. }
  9473. ],
  9474. "responses": {
  9475. "200": {
  9476. "description": "Workspace created",
  9477. "content": {
  9478. "application/json": {
  9479. "schema": {
  9480. "$ref": "#/components/schemas/Workspace"
  9481. }
  9482. }
  9483. }
  9484. },
  9485. "400": {
  9486. "description": "WorkspaceCreateError | BadRequest | InvalidRequestError",
  9487. "content": {
  9488. "application/json": {
  9489. "schema": {
  9490. "anyOf": [
  9491. {
  9492. "$ref": "#/components/schemas/WorkspaceCreateError"
  9493. },
  9494. {
  9495. "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
  9496. },
  9497. {
  9498. "$ref": "#/components/schemas/InvalidRequestError"
  9499. }
  9500. ]
  9501. }
  9502. }
  9503. }
  9504. }
  9505. },
  9506. "description": "Create a workspace for the current project.",
  9507. "summary": "Create workspace",
  9508. "requestBody": {
  9509. "content": {
  9510. "application/json": {
  9511. "schema": {
  9512. "type": "object",
  9513. "properties": {
  9514. "id": {
  9515. "type": "string",
  9516. "pattern": "^wrk"
  9517. },
  9518. "type": {
  9519. "type": "string"
  9520. },
  9521. "branch": {
  9522. "anyOf": [
  9523. {
  9524. "type": "string"
  9525. },
  9526. {
  9527. "type": "null"
  9528. }
  9529. ]
  9530. },
  9531. "extra": {
  9532. "anyOf": [
  9533. {},
  9534. {
  9535. "type": "null"
  9536. }
  9537. ]
  9538. }
  9539. },
  9540. "required": ["type"],
  9541. "additionalProperties": false
  9542. }
  9543. }
  9544. }
  9545. },
  9546. "x-codeSamples": [
  9547. {
  9548. "lang": "js",
  9549. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.create({\n ...\n})"
  9550. }
  9551. ]
  9552. }
  9553. },
  9554. "/experimental/workspace/sync-list": {
  9555. "post": {
  9556. "tags": ["workspace"],
  9557. "operationId": "experimental.workspace.syncList",
  9558. "parameters": [
  9559. {
  9560. "name": "directory",
  9561. "in": "query",
  9562. "schema": {
  9563. "type": "string"
  9564. },
  9565. "required": false
  9566. },
  9567. {
  9568. "name": "workspace",
  9569. "in": "query",
  9570. "schema": {
  9571. "type": "string"
  9572. },
  9573. "required": false
  9574. }
  9575. ],
  9576. "responses": {
  9577. "204": {
  9578. "description": "Workspace list synced"
  9579. },
  9580. "400": {
  9581. "description": "Bad request",
  9582. "content": {
  9583. "application/json": {
  9584. "schema": {
  9585. "$ref": "#/components/schemas/BadRequestError"
  9586. }
  9587. }
  9588. }
  9589. }
  9590. },
  9591. "description": "Register missing workspaces returned by workspace adapters.",
  9592. "summary": "Sync workspace list",
  9593. "x-codeSamples": [
  9594. {
  9595. "lang": "js",
  9596. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.syncList({\n ...\n})"
  9597. }
  9598. ]
  9599. }
  9600. },
  9601. "/experimental/workspace/status": {
  9602. "get": {
  9603. "tags": ["workspace"],
  9604. "operationId": "experimental.workspace.status",
  9605. "parameters": [
  9606. {
  9607. "name": "directory",
  9608. "in": "query",
  9609. "schema": {
  9610. "type": "string"
  9611. },
  9612. "required": false
  9613. },
  9614. {
  9615. "name": "workspace",
  9616. "in": "query",
  9617. "schema": {
  9618. "type": "string"
  9619. },
  9620. "required": false
  9621. }
  9622. ],
  9623. "responses": {
  9624. "200": {
  9625. "description": "Workspace status",
  9626. "content": {
  9627. "application/json": {
  9628. "schema": {
  9629. "type": "array",
  9630. "items": {
  9631. "type": "object",
  9632. "properties": {
  9633. "workspaceID": {
  9634. "type": "string",
  9635. "pattern": "^wrk"
  9636. },
  9637. "status": {
  9638. "type": "string",
  9639. "enum": ["connected", "connecting", "disconnected", "error"]
  9640. }
  9641. },
  9642. "required": ["workspaceID", "status"],
  9643. "additionalProperties": false
  9644. },
  9645. "description": "Workspace status"
  9646. }
  9647. }
  9648. }
  9649. },
  9650. "400": {
  9651. "description": "Bad request",
  9652. "content": {
  9653. "application/json": {
  9654. "schema": {
  9655. "$ref": "#/components/schemas/BadRequestError"
  9656. }
  9657. }
  9658. }
  9659. }
  9660. },
  9661. "description": "Get connection status for workspaces in the current project.",
  9662. "summary": "Workspace status",
  9663. "x-codeSamples": [
  9664. {
  9665. "lang": "js",
  9666. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.status({\n ...\n})"
  9667. }
  9668. ]
  9669. }
  9670. },
  9671. "/experimental/workspace/{id}": {
  9672. "delete": {
  9673. "tags": ["workspace"],
  9674. "operationId": "experimental.workspace.remove",
  9675. "parameters": [
  9676. {
  9677. "name": "id",
  9678. "in": "path",
  9679. "schema": {
  9680. "type": "string",
  9681. "pattern": "^wrk"
  9682. },
  9683. "required": true
  9684. },
  9685. {
  9686. "name": "directory",
  9687. "in": "query",
  9688. "schema": {
  9689. "type": "string"
  9690. },
  9691. "required": false
  9692. },
  9693. {
  9694. "name": "workspace",
  9695. "in": "query",
  9696. "schema": {
  9697. "type": "string"
  9698. },
  9699. "required": false
  9700. }
  9701. ],
  9702. "responses": {
  9703. "200": {
  9704. "description": "Workspace removed",
  9705. "content": {
  9706. "application/json": {
  9707. "schema": {
  9708. "$ref": "#/components/schemas/Workspace"
  9709. }
  9710. }
  9711. }
  9712. },
  9713. "400": {
  9714. "description": "BadRequest | InvalidRequestError",
  9715. "content": {
  9716. "application/json": {
  9717. "schema": {
  9718. "anyOf": [
  9719. {
  9720. "$ref": "#/components/schemas/effect_HttpApiError_BadRequest"
  9721. },
  9722. {
  9723. "$ref": "#/components/schemas/InvalidRequestError"
  9724. }
  9725. ]
  9726. }
  9727. }
  9728. }
  9729. }
  9730. },
  9731. "description": "Remove an existing workspace.",
  9732. "summary": "Remove workspace",
  9733. "x-codeSamples": [
  9734. {
  9735. "lang": "js",
  9736. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.remove({\n ...\n})"
  9737. }
  9738. ]
  9739. }
  9740. },
  9741. "/experimental/workspace/warp": {
  9742. "post": {
  9743. "tags": ["workspace"],
  9744. "operationId": "experimental.workspace.warp",
  9745. "parameters": [
  9746. {
  9747. "name": "directory",
  9748. "in": "query",
  9749. "schema": {
  9750. "type": "string"
  9751. },
  9752. "required": false
  9753. },
  9754. {
  9755. "name": "workspace",
  9756. "in": "query",
  9757. "schema": {
  9758. "type": "string"
  9759. },
  9760. "required": false
  9761. }
  9762. ],
  9763. "responses": {
  9764. "204": {
  9765. "description": "Session warped"
  9766. },
  9767. "400": {
  9768. "description": "WorkspaceWarpError | VcsApplyError | InvalidRequestError",
  9769. "content": {
  9770. "application/json": {
  9771. "schema": {
  9772. "anyOf": [
  9773. {
  9774. "$ref": "#/components/schemas/WorkspaceWarpError"
  9775. },
  9776. {
  9777. "$ref": "#/components/schemas/VcsApplyError"
  9778. },
  9779. {
  9780. "$ref": "#/components/schemas/InvalidRequestError"
  9781. }
  9782. ]
  9783. }
  9784. }
  9785. }
  9786. },
  9787. "404": {
  9788. "description": "NotFoundError",
  9789. "content": {
  9790. "application/json": {
  9791. "schema": {
  9792. "$ref": "#/components/schemas/NotFoundError"
  9793. }
  9794. }
  9795. }
  9796. }
  9797. },
  9798. "description": "Move a session's sync history into the target workspace, or detach it to the local project.",
  9799. "summary": "Warp session into workspace",
  9800. "requestBody": {
  9801. "content": {
  9802. "application/json": {
  9803. "schema": {
  9804. "type": "object",
  9805. "properties": {
  9806. "id": {
  9807. "anyOf": [
  9808. {
  9809. "type": "string",
  9810. "pattern": "^wrk"
  9811. },
  9812. {
  9813. "type": "null"
  9814. }
  9815. ]
  9816. },
  9817. "sessionID": {
  9818. "type": "string",
  9819. "pattern": "^ses"
  9820. },
  9821. "copyChanges": {
  9822. "type": "boolean"
  9823. }
  9824. },
  9825. "required": ["id", "sessionID"],
  9826. "additionalProperties": false
  9827. }
  9828. }
  9829. }
  9830. },
  9831. "x-codeSamples": [
  9832. {
  9833. "lang": "js",
  9834. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.warp({\n ...\n})"
  9835. }
  9836. ]
  9837. }
  9838. },
  9839. "/api/health": {
  9840. "get": {
  9841. "tags": ["opencode experimental HttpApi"],
  9842. "operationId": "v2.health.get",
  9843. "parameters": [],
  9844. "security": [],
  9845. "responses": {
  9846. "200": {
  9847. "description": "Success",
  9848. "content": {
  9849. "application/json": {
  9850. "schema": {
  9851. "type": "object",
  9852. "properties": {
  9853. "healthy": {
  9854. "type": "boolean",
  9855. "enum": [true]
  9856. }
  9857. },
  9858. "required": ["healthy"],
  9859. "additionalProperties": false
  9860. }
  9861. }
  9862. }
  9863. },
  9864. "400": {
  9865. "description": "InvalidRequestError",
  9866. "content": {
  9867. "application/json": {
  9868. "schema": {
  9869. "$ref": "#/components/schemas/InvalidRequestError"
  9870. }
  9871. }
  9872. }
  9873. },
  9874. "401": {
  9875. "description": "UnauthorizedError",
  9876. "content": {
  9877. "application/json": {
  9878. "schema": {
  9879. "$ref": "#/components/schemas/UnauthorizedError"
  9880. }
  9881. }
  9882. }
  9883. }
  9884. },
  9885. "description": "Check whether the v2 API server is ready to accept requests.",
  9886. "summary": "Check v2 server health",
  9887. "x-codeSamples": [
  9888. {
  9889. "lang": "js",
  9890. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.health.get({\n ...\n})"
  9891. }
  9892. ]
  9893. }
  9894. },
  9895. "/api/agent": {
  9896. "get": {
  9897. "tags": ["opencode experimental HttpApi"],
  9898. "operationId": "v2.agent.list",
  9899. "parameters": [
  9900. {
  9901. "name": "location",
  9902. "in": "query",
  9903. "schema": {
  9904. "type": "object",
  9905. "properties": {
  9906. "directory": {
  9907. "type": "string"
  9908. },
  9909. "workspace": {
  9910. "type": "string"
  9911. }
  9912. },
  9913. "additionalProperties": false
  9914. },
  9915. "required": false,
  9916. "style": "deepObject",
  9917. "explode": true
  9918. }
  9919. ],
  9920. "security": [],
  9921. "responses": {
  9922. "200": {
  9923. "description": "Success",
  9924. "content": {
  9925. "application/json": {
  9926. "schema": {
  9927. "type": "object",
  9928. "properties": {
  9929. "location": {
  9930. "$ref": "#/components/schemas/LocationInfo"
  9931. },
  9932. "data": {
  9933. "type": "array",
  9934. "items": {
  9935. "$ref": "#/components/schemas/AgentV2Info"
  9936. }
  9937. }
  9938. },
  9939. "required": ["location", "data"],
  9940. "additionalProperties": false
  9941. }
  9942. }
  9943. }
  9944. },
  9945. "400": {
  9946. "description": "InvalidRequestError",
  9947. "content": {
  9948. "application/json": {
  9949. "schema": {
  9950. "$ref": "#/components/schemas/InvalidRequestError"
  9951. }
  9952. }
  9953. }
  9954. },
  9955. "401": {
  9956. "description": "UnauthorizedError",
  9957. "content": {
  9958. "application/json": {
  9959. "schema": {
  9960. "$ref": "#/components/schemas/UnauthorizedError"
  9961. }
  9962. }
  9963. }
  9964. }
  9965. },
  9966. "description": "Retrieve currently registered v2 agents.",
  9967. "summary": "List v2 agents",
  9968. "x-codeSamples": [
  9969. {
  9970. "lang": "js",
  9971. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.agent.list({\n ...\n})"
  9972. }
  9973. ]
  9974. }
  9975. },
  9976. "/api/session": {
  9977. "get": {
  9978. "tags": ["v2"],
  9979. "operationId": "v2.session.list",
  9980. "parameters": [
  9981. {
  9982. "name": "workspace",
  9983. "in": "query",
  9984. "schema": {
  9985. "type": "string",
  9986. "pattern": "^wrk"
  9987. },
  9988. "required": false
  9989. },
  9990. {
  9991. "name": "limit",
  9992. "in": "query",
  9993. "schema": {
  9994. "type": "number"
  9995. },
  9996. "required": false
  9997. },
  9998. {
  9999. "name": "order",
  10000. "in": "query",
  10001. "schema": {
  10002. "type": "string",
  10003. "enum": ["asc", "desc"]
  10004. },
  10005. "required": false
  10006. },
  10007. {
  10008. "name": "search",
  10009. "in": "query",
  10010. "schema": {
  10011. "type": "string"
  10012. },
  10013. "required": false
  10014. },
  10015. {
  10016. "name": "directory",
  10017. "in": "query",
  10018. "schema": {
  10019. "type": "string"
  10020. },
  10021. "required": false
  10022. },
  10023. {
  10024. "name": "project",
  10025. "in": "query",
  10026. "schema": {
  10027. "type": "string"
  10028. },
  10029. "required": false
  10030. },
  10031. {
  10032. "name": "subpath",
  10033. "in": "query",
  10034. "schema": {
  10035. "type": "string"
  10036. },
  10037. "required": false
  10038. },
  10039. {
  10040. "name": "cursor",
  10041. "in": "query",
  10042. "schema": {
  10043. "type": "string",
  10044. "description": "Opaque pagination cursor returned as cursor.previous or cursor.next in the previous response."
  10045. },
  10046. "required": false
  10047. }
  10048. ],
  10049. "security": [],
  10050. "responses": {
  10051. "200": {
  10052. "description": "V2SessionsResponse",
  10053. "content": {
  10054. "application/json": {
  10055. "schema": {
  10056. "$ref": "#/components/schemas/V2SessionsResponse"
  10057. }
  10058. }
  10059. }
  10060. },
  10061. "400": {
  10062. "description": "InvalidCursorError | InvalidRequestError",
  10063. "content": {
  10064. "application/json": {
  10065. "schema": {
  10066. "anyOf": [
  10067. {
  10068. "$ref": "#/components/schemas/InvalidCursorError"
  10069. },
  10070. {
  10071. "$ref": "#/components/schemas/InvalidRequestError"
  10072. },
  10073. {
  10074. "$ref": "#/components/schemas/InvalidRequestError"
  10075. }
  10076. ]
  10077. }
  10078. }
  10079. }
  10080. },
  10081. "401": {
  10082. "description": "UnauthorizedError",
  10083. "content": {
  10084. "application/json": {
  10085. "schema": {
  10086. "$ref": "#/components/schemas/UnauthorizedError"
  10087. }
  10088. }
  10089. }
  10090. }
  10091. },
  10092. "description": "Retrieve sessions in the requested order. Items keep that order across pages; use cursor.next or cursor.previous to move through the ordered list.",
  10093. "summary": "List v2 sessions",
  10094. "x-codeSamples": [
  10095. {
  10096. "lang": "js",
  10097. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.list({\n ...\n})"
  10098. }
  10099. ]
  10100. }
  10101. },
  10102. "/api/session/{sessionID}/prompt": {
  10103. "post": {
  10104. "tags": ["v2"],
  10105. "operationId": "v2.session.prompt",
  10106. "parameters": [
  10107. {
  10108. "name": "sessionID",
  10109. "in": "path",
  10110. "schema": {
  10111. "type": "string",
  10112. "pattern": "^ses"
  10113. },
  10114. "required": true
  10115. }
  10116. ],
  10117. "security": [],
  10118. "responses": {
  10119. "200": {
  10120. "description": "Success",
  10121. "content": {
  10122. "application/json": {
  10123. "schema": {
  10124. "type": "object",
  10125. "properties": {
  10126. "data": {
  10127. "$ref": "#/components/schemas/SessionInputAdmitted"
  10128. }
  10129. },
  10130. "required": ["data"],
  10131. "additionalProperties": false
  10132. }
  10133. }
  10134. }
  10135. },
  10136. "400": {
  10137. "description": "InvalidRequestError",
  10138. "content": {
  10139. "application/json": {
  10140. "schema": {
  10141. "$ref": "#/components/schemas/InvalidRequestError"
  10142. }
  10143. }
  10144. }
  10145. },
  10146. "401": {
  10147. "description": "UnauthorizedError",
  10148. "content": {
  10149. "application/json": {
  10150. "schema": {
  10151. "$ref": "#/components/schemas/UnauthorizedError"
  10152. }
  10153. }
  10154. }
  10155. },
  10156. "404": {
  10157. "description": "SessionNotFoundError",
  10158. "content": {
  10159. "application/json": {
  10160. "schema": {
  10161. "$ref": "#/components/schemas/SessionNotFoundError"
  10162. }
  10163. }
  10164. }
  10165. },
  10166. "409": {
  10167. "description": "ConflictError",
  10168. "content": {
  10169. "application/json": {
  10170. "schema": {
  10171. "$ref": "#/components/schemas/ConflictError"
  10172. }
  10173. }
  10174. }
  10175. }
  10176. },
  10177. "description": "Durably admit one v2 session input and schedule agent-loop execution unless resume is false.",
  10178. "summary": "Send v2 message",
  10179. "requestBody": {
  10180. "content": {
  10181. "application/json": {
  10182. "schema": {
  10183. "type": "object",
  10184. "properties": {
  10185. "id": {
  10186. "type": "string",
  10187. "pattern": "^msg_"
  10188. },
  10189. "prompt": {
  10190. "$ref": "#/components/schemas/Prompt"
  10191. },
  10192. "delivery": {
  10193. "type": "string",
  10194. "enum": ["steer", "queue"]
  10195. },
  10196. "resume": {
  10197. "type": "boolean"
  10198. }
  10199. },
  10200. "required": ["prompt"],
  10201. "additionalProperties": false
  10202. }
  10203. }
  10204. },
  10205. "required": true
  10206. },
  10207. "x-codeSamples": [
  10208. {
  10209. "lang": "js",
  10210. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.prompt({\n ...\n})"
  10211. }
  10212. ]
  10213. }
  10214. },
  10215. "/api/session/{sessionID}/compact": {
  10216. "post": {
  10217. "tags": ["v2"],
  10218. "operationId": "v2.session.compact",
  10219. "parameters": [
  10220. {
  10221. "name": "sessionID",
  10222. "in": "path",
  10223. "schema": {
  10224. "type": "string",
  10225. "pattern": "^ses"
  10226. },
  10227. "required": true
  10228. }
  10229. ],
  10230. "security": [],
  10231. "responses": {
  10232. "204": {
  10233. "description": "<No Content>"
  10234. },
  10235. "400": {
  10236. "description": "InvalidRequestError",
  10237. "content": {
  10238. "application/json": {
  10239. "schema": {
  10240. "$ref": "#/components/schemas/InvalidRequestError"
  10241. }
  10242. }
  10243. }
  10244. },
  10245. "401": {
  10246. "description": "UnauthorizedError",
  10247. "content": {
  10248. "application/json": {
  10249. "schema": {
  10250. "$ref": "#/components/schemas/UnauthorizedError"
  10251. }
  10252. }
  10253. }
  10254. },
  10255. "404": {
  10256. "description": "SessionNotFoundError",
  10257. "content": {
  10258. "application/json": {
  10259. "schema": {
  10260. "$ref": "#/components/schemas/SessionNotFoundError"
  10261. }
  10262. }
  10263. }
  10264. },
  10265. "503": {
  10266. "description": "ServiceUnavailableError",
  10267. "content": {
  10268. "application/json": {
  10269. "schema": {
  10270. "$ref": "#/components/schemas/ServiceUnavailableError"
  10271. }
  10272. }
  10273. }
  10274. }
  10275. },
  10276. "description": "Compact a v2 session conversation.",
  10277. "summary": "Compact v2 session",
  10278. "x-codeSamples": [
  10279. {
  10280. "lang": "js",
  10281. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.compact({\n ...\n})"
  10282. }
  10283. ]
  10284. }
  10285. },
  10286. "/api/session/{sessionID}/wait": {
  10287. "post": {
  10288. "tags": ["v2"],
  10289. "operationId": "v2.session.wait",
  10290. "parameters": [
  10291. {
  10292. "name": "sessionID",
  10293. "in": "path",
  10294. "schema": {
  10295. "type": "string",
  10296. "pattern": "^ses"
  10297. },
  10298. "required": true
  10299. }
  10300. ],
  10301. "security": [],
  10302. "responses": {
  10303. "204": {
  10304. "description": "<No Content>"
  10305. },
  10306. "400": {
  10307. "description": "InvalidRequestError",
  10308. "content": {
  10309. "application/json": {
  10310. "schema": {
  10311. "$ref": "#/components/schemas/InvalidRequestError"
  10312. }
  10313. }
  10314. }
  10315. },
  10316. "401": {
  10317. "description": "UnauthorizedError",
  10318. "content": {
  10319. "application/json": {
  10320. "schema": {
  10321. "$ref": "#/components/schemas/UnauthorizedError"
  10322. }
  10323. }
  10324. }
  10325. },
  10326. "404": {
  10327. "description": "SessionNotFoundError",
  10328. "content": {
  10329. "application/json": {
  10330. "schema": {
  10331. "$ref": "#/components/schemas/SessionNotFoundError"
  10332. }
  10333. }
  10334. }
  10335. },
  10336. "503": {
  10337. "description": "ServiceUnavailableError",
  10338. "content": {
  10339. "application/json": {
  10340. "schema": {
  10341. "$ref": "#/components/schemas/ServiceUnavailableError"
  10342. }
  10343. }
  10344. }
  10345. }
  10346. },
  10347. "description": "Wait for a v2 session agent loop to become idle.",
  10348. "summary": "Wait for v2 session",
  10349. "x-codeSamples": [
  10350. {
  10351. "lang": "js",
  10352. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.wait({\n ...\n})"
  10353. }
  10354. ]
  10355. }
  10356. },
  10357. "/api/session/{sessionID}/context": {
  10358. "get": {
  10359. "tags": ["v2"],
  10360. "operationId": "v2.session.context",
  10361. "parameters": [
  10362. {
  10363. "name": "sessionID",
  10364. "in": "path",
  10365. "schema": {
  10366. "type": "string",
  10367. "pattern": "^ses"
  10368. },
  10369. "required": true
  10370. }
  10371. ],
  10372. "security": [],
  10373. "responses": {
  10374. "200": {
  10375. "description": "Success",
  10376. "content": {
  10377. "application/json": {
  10378. "schema": {
  10379. "type": "object",
  10380. "properties": {
  10381. "data": {
  10382. "type": "array",
  10383. "items": {
  10384. "$ref": "#/components/schemas/SessionMessage"
  10385. }
  10386. }
  10387. },
  10388. "required": ["data"],
  10389. "additionalProperties": false
  10390. }
  10391. }
  10392. }
  10393. },
  10394. "400": {
  10395. "description": "InvalidRequestError",
  10396. "content": {
  10397. "application/json": {
  10398. "schema": {
  10399. "$ref": "#/components/schemas/InvalidRequestError"
  10400. }
  10401. }
  10402. }
  10403. },
  10404. "401": {
  10405. "description": "UnauthorizedError",
  10406. "content": {
  10407. "application/json": {
  10408. "schema": {
  10409. "$ref": "#/components/schemas/UnauthorizedError"
  10410. }
  10411. }
  10412. }
  10413. },
  10414. "404": {
  10415. "description": "SessionNotFoundError",
  10416. "content": {
  10417. "application/json": {
  10418. "schema": {
  10419. "$ref": "#/components/schemas/SessionNotFoundError"
  10420. }
  10421. }
  10422. }
  10423. },
  10424. "500": {
  10425. "description": "UnknownError",
  10426. "content": {
  10427. "application/json": {
  10428. "schema": {
  10429. "$ref": "#/components/schemas/UnknownError1"
  10430. }
  10431. }
  10432. }
  10433. }
  10434. },
  10435. "description": "Retrieve the active context messages for a v2 session (all messages after the last compaction).",
  10436. "summary": "Get v2 session context",
  10437. "x-codeSamples": [
  10438. {
  10439. "lang": "js",
  10440. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.context({\n ...\n})"
  10441. }
  10442. ]
  10443. }
  10444. },
  10445. "/api/session/{sessionID}/message": {
  10446. "get": {
  10447. "tags": ["v2 messages"],
  10448. "operationId": "v2.session.messages",
  10449. "parameters": [
  10450. {
  10451. "name": "sessionID",
  10452. "in": "path",
  10453. "schema": {
  10454. "type": "string",
  10455. "pattern": "^ses"
  10456. },
  10457. "required": true
  10458. },
  10459. {
  10460. "name": "limit",
  10461. "in": "query",
  10462. "schema": {
  10463. "type": "number"
  10464. },
  10465. "required": false
  10466. },
  10467. {
  10468. "name": "order",
  10469. "in": "query",
  10470. "schema": {
  10471. "type": "string",
  10472. "enum": ["asc", "desc"]
  10473. },
  10474. "required": false
  10475. },
  10476. {
  10477. "name": "cursor",
  10478. "in": "query",
  10479. "schema": {
  10480. "type": "string",
  10481. "description": "Opaque pagination cursor returned as cursor.previous or cursor.next in the previous response. Do not combine with order."
  10482. },
  10483. "required": false
  10484. }
  10485. ],
  10486. "security": [],
  10487. "responses": {
  10488. "200": {
  10489. "description": "V2SessionMessagesResponse",
  10490. "content": {
  10491. "application/json": {
  10492. "schema": {
  10493. "$ref": "#/components/schemas/V2SessionMessagesResponse"
  10494. }
  10495. }
  10496. }
  10497. },
  10498. "400": {
  10499. "description": "InvalidCursorError | InvalidRequestError",
  10500. "content": {
  10501. "application/json": {
  10502. "schema": {
  10503. "anyOf": [
  10504. {
  10505. "$ref": "#/components/schemas/InvalidCursorError"
  10506. },
  10507. {
  10508. "$ref": "#/components/schemas/InvalidRequestError"
  10509. }
  10510. ]
  10511. }
  10512. }
  10513. }
  10514. },
  10515. "401": {
  10516. "description": "UnauthorizedError",
  10517. "content": {
  10518. "application/json": {
  10519. "schema": {
  10520. "$ref": "#/components/schemas/UnauthorizedError"
  10521. }
  10522. }
  10523. }
  10524. },
  10525. "404": {
  10526. "description": "SessionNotFoundError",
  10527. "content": {
  10528. "application/json": {
  10529. "schema": {
  10530. "$ref": "#/components/schemas/SessionNotFoundError"
  10531. }
  10532. }
  10533. }
  10534. },
  10535. "500": {
  10536. "description": "UnknownError",
  10537. "content": {
  10538. "application/json": {
  10539. "schema": {
  10540. "$ref": "#/components/schemas/UnknownError1"
  10541. }
  10542. }
  10543. }
  10544. }
  10545. },
  10546. "description": "Retrieve projected v2 messages for a session. Items keep the requested order across pages; use cursor.next or cursor.previous to move through the ordered timeline.",
  10547. "summary": "Get v2 session messages",
  10548. "x-codeSamples": [
  10549. {
  10550. "lang": "js",
  10551. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.messages({\n ...\n})"
  10552. }
  10553. ]
  10554. }
  10555. },
  10556. "/api/model": {
  10557. "get": {
  10558. "tags": ["v2 models"],
  10559. "operationId": "v2.model.list",
  10560. "parameters": [
  10561. {
  10562. "name": "location",
  10563. "in": "query",
  10564. "schema": {
  10565. "type": "object",
  10566. "properties": {
  10567. "directory": {
  10568. "type": "string"
  10569. },
  10570. "workspace": {
  10571. "type": "string"
  10572. }
  10573. },
  10574. "additionalProperties": false
  10575. },
  10576. "required": false,
  10577. "style": "deepObject",
  10578. "explode": true
  10579. }
  10580. ],
  10581. "security": [],
  10582. "responses": {
  10583. "200": {
  10584. "description": "Success",
  10585. "content": {
  10586. "application/json": {
  10587. "schema": {
  10588. "type": "object",
  10589. "properties": {
  10590. "location": {
  10591. "$ref": "#/components/schemas/LocationInfo"
  10592. },
  10593. "data": {
  10594. "type": "array",
  10595. "items": {
  10596. "$ref": "#/components/schemas/ModelV2Info"
  10597. }
  10598. }
  10599. },
  10600. "required": ["location", "data"],
  10601. "additionalProperties": false
  10602. }
  10603. }
  10604. }
  10605. },
  10606. "400": {
  10607. "description": "InvalidRequestError",
  10608. "content": {
  10609. "application/json": {
  10610. "schema": {
  10611. "$ref": "#/components/schemas/InvalidRequestError"
  10612. }
  10613. }
  10614. }
  10615. },
  10616. "401": {
  10617. "description": "UnauthorizedError",
  10618. "content": {
  10619. "application/json": {
  10620. "schema": {
  10621. "$ref": "#/components/schemas/UnauthorizedError"
  10622. }
  10623. }
  10624. }
  10625. },
  10626. "503": {
  10627. "description": "ServiceUnavailableError",
  10628. "content": {
  10629. "application/json": {
  10630. "schema": {
  10631. "$ref": "#/components/schemas/ServiceUnavailableError"
  10632. }
  10633. }
  10634. }
  10635. }
  10636. },
  10637. "description": "Retrieve available v2 models ordered by release date.",
  10638. "summary": "List v2 models",
  10639. "x-codeSamples": [
  10640. {
  10641. "lang": "js",
  10642. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.model.list({\n ...\n})"
  10643. }
  10644. ]
  10645. }
  10646. },
  10647. "/api/provider": {
  10648. "get": {
  10649. "tags": ["v2 providers"],
  10650. "operationId": "v2.provider.list",
  10651. "parameters": [
  10652. {
  10653. "name": "location",
  10654. "in": "query",
  10655. "schema": {
  10656. "type": "object",
  10657. "properties": {
  10658. "directory": {
  10659. "type": "string"
  10660. },
  10661. "workspace": {
  10662. "type": "string"
  10663. }
  10664. },
  10665. "additionalProperties": false
  10666. },
  10667. "required": false,
  10668. "style": "deepObject",
  10669. "explode": true
  10670. }
  10671. ],
  10672. "security": [],
  10673. "responses": {
  10674. "200": {
  10675. "description": "Success",
  10676. "content": {
  10677. "application/json": {
  10678. "schema": {
  10679. "type": "object",
  10680. "properties": {
  10681. "location": {
  10682. "$ref": "#/components/schemas/LocationInfo"
  10683. },
  10684. "data": {
  10685. "type": "array",
  10686. "items": {
  10687. "$ref": "#/components/schemas/ProviderV2Info"
  10688. }
  10689. }
  10690. },
  10691. "required": ["location", "data"],
  10692. "additionalProperties": false
  10693. }
  10694. }
  10695. }
  10696. },
  10697. "400": {
  10698. "description": "InvalidRequestError",
  10699. "content": {
  10700. "application/json": {
  10701. "schema": {
  10702. "$ref": "#/components/schemas/InvalidRequestError"
  10703. }
  10704. }
  10705. }
  10706. },
  10707. "401": {
  10708. "description": "UnauthorizedError",
  10709. "content": {
  10710. "application/json": {
  10711. "schema": {
  10712. "$ref": "#/components/schemas/UnauthorizedError"
  10713. }
  10714. }
  10715. }
  10716. },
  10717. "503": {
  10718. "description": "ServiceUnavailableError",
  10719. "content": {
  10720. "application/json": {
  10721. "schema": {
  10722. "$ref": "#/components/schemas/ServiceUnavailableError"
  10723. }
  10724. }
  10725. }
  10726. }
  10727. },
  10728. "description": "Retrieve active v2 AI providers so clients can show provider availability and configuration.",
  10729. "summary": "List v2 providers",
  10730. "x-codeSamples": [
  10731. {
  10732. "lang": "js",
  10733. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.provider.list({\n ...\n})"
  10734. }
  10735. ]
  10736. }
  10737. },
  10738. "/api/provider/{providerID}": {
  10739. "get": {
  10740. "tags": ["v2 providers"],
  10741. "operationId": "v2.provider.get",
  10742. "parameters": [
  10743. {
  10744. "name": "providerID",
  10745. "in": "path",
  10746. "schema": {
  10747. "type": "string"
  10748. },
  10749. "required": true
  10750. },
  10751. {
  10752. "name": "location",
  10753. "in": "query",
  10754. "schema": {
  10755. "type": "object",
  10756. "properties": {
  10757. "directory": {
  10758. "type": "string"
  10759. },
  10760. "workspace": {
  10761. "type": "string"
  10762. }
  10763. },
  10764. "additionalProperties": false
  10765. },
  10766. "required": false,
  10767. "style": "deepObject",
  10768. "explode": true
  10769. }
  10770. ],
  10771. "security": [],
  10772. "responses": {
  10773. "200": {
  10774. "description": "Success",
  10775. "content": {
  10776. "application/json": {
  10777. "schema": {
  10778. "type": "object",
  10779. "properties": {
  10780. "location": {
  10781. "$ref": "#/components/schemas/LocationInfo"
  10782. },
  10783. "data": {
  10784. "$ref": "#/components/schemas/ProviderV2Info"
  10785. }
  10786. },
  10787. "required": ["location", "data"],
  10788. "additionalProperties": false
  10789. }
  10790. }
  10791. }
  10792. },
  10793. "400": {
  10794. "description": "InvalidRequestError",
  10795. "content": {
  10796. "application/json": {
  10797. "schema": {
  10798. "$ref": "#/components/schemas/InvalidRequestError"
  10799. }
  10800. }
  10801. }
  10802. },
  10803. "401": {
  10804. "description": "UnauthorizedError",
  10805. "content": {
  10806. "application/json": {
  10807. "schema": {
  10808. "$ref": "#/components/schemas/UnauthorizedError"
  10809. }
  10810. }
  10811. }
  10812. },
  10813. "404": {
  10814. "description": "ProviderNotFoundError",
  10815. "content": {
  10816. "application/json": {
  10817. "schema": {
  10818. "$ref": "#/components/schemas/ProviderNotFoundError"
  10819. }
  10820. }
  10821. }
  10822. },
  10823. "503": {
  10824. "description": "ServiceUnavailableError",
  10825. "content": {
  10826. "application/json": {
  10827. "schema": {
  10828. "$ref": "#/components/schemas/ServiceUnavailableError"
  10829. }
  10830. }
  10831. }
  10832. }
  10833. },
  10834. "description": "Retrieve a single v2 AI provider so clients can inspect its availability and endpoint settings.",
  10835. "summary": "Get v2 provider",
  10836. "x-codeSamples": [
  10837. {
  10838. "lang": "js",
  10839. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.provider.get({\n ...\n})"
  10840. }
  10841. ]
  10842. }
  10843. },
  10844. "/api/permission/request": {
  10845. "get": {
  10846. "tags": ["v2 permissions"],
  10847. "operationId": "v2.permission.request.list",
  10848. "parameters": [
  10849. {
  10850. "name": "location",
  10851. "in": "query",
  10852. "schema": {
  10853. "type": "object",
  10854. "properties": {
  10855. "directory": {
  10856. "type": "string"
  10857. },
  10858. "workspace": {
  10859. "type": "string"
  10860. }
  10861. },
  10862. "additionalProperties": false
  10863. },
  10864. "required": false,
  10865. "style": "deepObject",
  10866. "explode": true
  10867. }
  10868. ],
  10869. "security": [],
  10870. "responses": {
  10871. "200": {
  10872. "description": "Success",
  10873. "content": {
  10874. "application/json": {
  10875. "schema": {
  10876. "type": "object",
  10877. "properties": {
  10878. "location": {
  10879. "$ref": "#/components/schemas/LocationInfo"
  10880. },
  10881. "data": {
  10882. "type": "array",
  10883. "items": {
  10884. "$ref": "#/components/schemas/PermissionV2Request"
  10885. }
  10886. }
  10887. },
  10888. "required": ["location", "data"],
  10889. "additionalProperties": false
  10890. }
  10891. }
  10892. }
  10893. },
  10894. "400": {
  10895. "description": "InvalidRequestError",
  10896. "content": {
  10897. "application/json": {
  10898. "schema": {
  10899. "$ref": "#/components/schemas/InvalidRequestError"
  10900. }
  10901. }
  10902. }
  10903. },
  10904. "401": {
  10905. "description": "UnauthorizedError",
  10906. "content": {
  10907. "application/json": {
  10908. "schema": {
  10909. "$ref": "#/components/schemas/UnauthorizedError"
  10910. }
  10911. }
  10912. }
  10913. }
  10914. },
  10915. "description": "Retrieve pending permission requests for a location.",
  10916. "summary": "List pending permission requests",
  10917. "x-codeSamples": [
  10918. {
  10919. "lang": "js",
  10920. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.permission.request.list({\n ...\n})"
  10921. }
  10922. ]
  10923. }
  10924. },
  10925. "/api/session/{sessionID}/permission/request": {
  10926. "get": {
  10927. "tags": ["v2 session permissions"],
  10928. "operationId": "v2.session.permission.list",
  10929. "parameters": [
  10930. {
  10931. "name": "sessionID",
  10932. "in": "path",
  10933. "schema": {
  10934. "type": "string",
  10935. "pattern": "^ses"
  10936. },
  10937. "required": true
  10938. }
  10939. ],
  10940. "security": [],
  10941. "responses": {
  10942. "200": {
  10943. "description": "Success",
  10944. "content": {
  10945. "application/json": {
  10946. "schema": {
  10947. "type": "object",
  10948. "properties": {
  10949. "data": {
  10950. "type": "array",
  10951. "items": {
  10952. "$ref": "#/components/schemas/PermissionV2Request"
  10953. }
  10954. }
  10955. },
  10956. "required": ["data"],
  10957. "additionalProperties": false
  10958. }
  10959. }
  10960. }
  10961. },
  10962. "400": {
  10963. "description": "InvalidRequestError",
  10964. "content": {
  10965. "application/json": {
  10966. "schema": {
  10967. "$ref": "#/components/schemas/InvalidRequestError"
  10968. }
  10969. }
  10970. }
  10971. },
  10972. "401": {
  10973. "description": "UnauthorizedError",
  10974. "content": {
  10975. "application/json": {
  10976. "schema": {
  10977. "$ref": "#/components/schemas/UnauthorizedError"
  10978. }
  10979. }
  10980. }
  10981. },
  10982. "404": {
  10983. "description": "SessionNotFoundError",
  10984. "content": {
  10985. "application/json": {
  10986. "schema": {
  10987. "$ref": "#/components/schemas/SessionNotFoundError"
  10988. }
  10989. }
  10990. }
  10991. }
  10992. },
  10993. "description": "Retrieve pending permission requests owned by a session.",
  10994. "summary": "List session permission requests",
  10995. "x-codeSamples": [
  10996. {
  10997. "lang": "js",
  10998. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.permission.list({\n ...\n})"
  10999. }
  11000. ]
  11001. }
  11002. },
  11003. "/api/session/{sessionID}/permission/request/{requestID}/reply": {
  11004. "post": {
  11005. "tags": ["v2 session permissions"],
  11006. "operationId": "v2.session.permission.reply",
  11007. "parameters": [
  11008. {
  11009. "name": "sessionID",
  11010. "in": "path",
  11011. "schema": {
  11012. "type": "string",
  11013. "pattern": "^ses"
  11014. },
  11015. "required": true
  11016. },
  11017. {
  11018. "name": "requestID",
  11019. "in": "path",
  11020. "schema": {
  11021. "type": "string",
  11022. "pattern": "^per"
  11023. },
  11024. "required": true
  11025. }
  11026. ],
  11027. "security": [],
  11028. "responses": {
  11029. "204": {
  11030. "description": "<No Content>"
  11031. },
  11032. "400": {
  11033. "description": "InvalidRequestError",
  11034. "content": {
  11035. "application/json": {
  11036. "schema": {
  11037. "$ref": "#/components/schemas/InvalidRequestError"
  11038. }
  11039. }
  11040. }
  11041. },
  11042. "401": {
  11043. "description": "UnauthorizedError",
  11044. "content": {
  11045. "application/json": {
  11046. "schema": {
  11047. "$ref": "#/components/schemas/UnauthorizedError"
  11048. }
  11049. }
  11050. }
  11051. },
  11052. "404": {
  11053. "description": "SessionNotFoundError | PermissionNotFoundError",
  11054. "content": {
  11055. "application/json": {
  11056. "schema": {
  11057. "anyOf": [
  11058. {
  11059. "$ref": "#/components/schemas/SessionNotFoundError"
  11060. },
  11061. {
  11062. "$ref": "#/components/schemas/PermissionNotFoundError"
  11063. }
  11064. ]
  11065. }
  11066. }
  11067. }
  11068. }
  11069. },
  11070. "description": "Respond to a pending permission request owned by a session.",
  11071. "summary": "Reply to pending permission request",
  11072. "requestBody": {
  11073. "content": {
  11074. "application/json": {
  11075. "schema": {
  11076. "type": "object",
  11077. "properties": {
  11078. "reply": {
  11079. "$ref": "#/components/schemas/PermissionV2Reply"
  11080. },
  11081. "message": {
  11082. "type": "string"
  11083. }
  11084. },
  11085. "required": ["reply"],
  11086. "additionalProperties": false
  11087. }
  11088. }
  11089. },
  11090. "required": true
  11091. },
  11092. "x-codeSamples": [
  11093. {
  11094. "lang": "js",
  11095. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.permission.reply({\n ...\n})"
  11096. }
  11097. ]
  11098. }
  11099. },
  11100. "/api/permission/saved": {
  11101. "get": {
  11102. "tags": ["v2 saved permissions"],
  11103. "operationId": "v2.permission.saved.list",
  11104. "parameters": [
  11105. {
  11106. "name": "projectID",
  11107. "in": "query",
  11108. "schema": {
  11109. "type": "string"
  11110. },
  11111. "required": false
  11112. }
  11113. ],
  11114. "security": [],
  11115. "responses": {
  11116. "200": {
  11117. "description": "Success",
  11118. "content": {
  11119. "application/json": {
  11120. "schema": {
  11121. "type": "object",
  11122. "properties": {
  11123. "data": {
  11124. "type": "array",
  11125. "items": {
  11126. "$ref": "#/components/schemas/PermissionSavedInfo"
  11127. }
  11128. }
  11129. },
  11130. "required": ["data"],
  11131. "additionalProperties": false
  11132. }
  11133. }
  11134. }
  11135. },
  11136. "400": {
  11137. "description": "InvalidRequestError",
  11138. "content": {
  11139. "application/json": {
  11140. "schema": {
  11141. "$ref": "#/components/schemas/InvalidRequestError"
  11142. }
  11143. }
  11144. }
  11145. },
  11146. "401": {
  11147. "description": "UnauthorizedError",
  11148. "content": {
  11149. "application/json": {
  11150. "schema": {
  11151. "$ref": "#/components/schemas/UnauthorizedError"
  11152. }
  11153. }
  11154. }
  11155. }
  11156. },
  11157. "description": "Retrieve saved permissions, optionally filtered by project.",
  11158. "summary": "List saved permissions",
  11159. "x-codeSamples": [
  11160. {
  11161. "lang": "js",
  11162. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.permission.saved.list({\n ...\n})"
  11163. }
  11164. ]
  11165. }
  11166. },
  11167. "/api/permission/saved/{id}": {
  11168. "delete": {
  11169. "tags": ["v2 saved permissions"],
  11170. "operationId": "v2.permission.saved.remove",
  11171. "parameters": [
  11172. {
  11173. "name": "id",
  11174. "in": "path",
  11175. "schema": {
  11176. "type": "string"
  11177. },
  11178. "required": true
  11179. }
  11180. ],
  11181. "security": [],
  11182. "responses": {
  11183. "204": {
  11184. "description": "<No Content>"
  11185. },
  11186. "400": {
  11187. "description": "InvalidRequestError",
  11188. "content": {
  11189. "application/json": {
  11190. "schema": {
  11191. "$ref": "#/components/schemas/InvalidRequestError"
  11192. }
  11193. }
  11194. }
  11195. },
  11196. "401": {
  11197. "description": "UnauthorizedError",
  11198. "content": {
  11199. "application/json": {
  11200. "schema": {
  11201. "$ref": "#/components/schemas/UnauthorizedError"
  11202. }
  11203. }
  11204. }
  11205. }
  11206. },
  11207. "description": "Remove a saved permission by ID.",
  11208. "summary": "Remove saved permission",
  11209. "x-codeSamples": [
  11210. {
  11211. "lang": "js",
  11212. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.permission.saved.remove({\n ...\n})"
  11213. }
  11214. ]
  11215. }
  11216. },
  11217. "/api/fs/read": {
  11218. "get": {
  11219. "tags": ["v2 filesystem"],
  11220. "operationId": "v2.fs.read",
  11221. "parameters": [
  11222. {
  11223. "name": "location",
  11224. "in": "query",
  11225. "schema": {
  11226. "type": "object",
  11227. "properties": {
  11228. "directory": {
  11229. "type": "string"
  11230. },
  11231. "workspace": {
  11232. "type": "string"
  11233. }
  11234. },
  11235. "additionalProperties": false
  11236. },
  11237. "required": false,
  11238. "style": "deepObject",
  11239. "explode": true
  11240. },
  11241. {
  11242. "name": "path",
  11243. "in": "query",
  11244. "schema": {
  11245. "type": "string"
  11246. },
  11247. "required": true
  11248. },
  11249. {
  11250. "name": "reference",
  11251. "in": "query",
  11252. "schema": {
  11253. "type": "string"
  11254. },
  11255. "required": false
  11256. }
  11257. ],
  11258. "security": [],
  11259. "responses": {
  11260. "200": {
  11261. "description": "Success",
  11262. "content": {
  11263. "application/json": {
  11264. "schema": {
  11265. "type": "object",
  11266. "properties": {
  11267. "location": {
  11268. "$ref": "#/components/schemas/LocationInfo"
  11269. },
  11270. "data": {
  11271. "anyOf": [
  11272. {
  11273. "$ref": "#/components/schemas/FileSystemTextContent"
  11274. },
  11275. {
  11276. "$ref": "#/components/schemas/FileSystemBinaryContent"
  11277. }
  11278. ]
  11279. }
  11280. },
  11281. "required": ["location", "data"],
  11282. "additionalProperties": false
  11283. }
  11284. }
  11285. }
  11286. },
  11287. "400": {
  11288. "description": "InvalidRequestError",
  11289. "content": {
  11290. "application/json": {
  11291. "schema": {
  11292. "$ref": "#/components/schemas/InvalidRequestError"
  11293. }
  11294. }
  11295. }
  11296. },
  11297. "401": {
  11298. "description": "UnauthorizedError",
  11299. "content": {
  11300. "application/json": {
  11301. "schema": {
  11302. "$ref": "#/components/schemas/UnauthorizedError"
  11303. }
  11304. }
  11305. }
  11306. }
  11307. },
  11308. "description": "Read one file relative to the requested location.",
  11309. "summary": "Read file",
  11310. "x-codeSamples": [
  11311. {
  11312. "lang": "js",
  11313. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.fs.read({\n ...\n})"
  11314. }
  11315. ]
  11316. }
  11317. },
  11318. "/api/fs/list": {
  11319. "get": {
  11320. "tags": ["v2 filesystem"],
  11321. "operationId": "v2.fs.list",
  11322. "parameters": [
  11323. {
  11324. "name": "location",
  11325. "in": "query",
  11326. "schema": {
  11327. "type": "object",
  11328. "properties": {
  11329. "directory": {
  11330. "type": "string"
  11331. },
  11332. "workspace": {
  11333. "type": "string"
  11334. }
  11335. },
  11336. "additionalProperties": false
  11337. },
  11338. "required": false,
  11339. "style": "deepObject",
  11340. "explode": true
  11341. },
  11342. {
  11343. "name": "path",
  11344. "in": "query",
  11345. "schema": {
  11346. "type": "string"
  11347. },
  11348. "required": false
  11349. },
  11350. {
  11351. "name": "reference",
  11352. "in": "query",
  11353. "schema": {
  11354. "type": "string"
  11355. },
  11356. "required": false
  11357. }
  11358. ],
  11359. "security": [],
  11360. "responses": {
  11361. "200": {
  11362. "description": "Success",
  11363. "content": {
  11364. "application/json": {
  11365. "schema": {
  11366. "type": "object",
  11367. "properties": {
  11368. "location": {
  11369. "$ref": "#/components/schemas/LocationInfo"
  11370. },
  11371. "data": {
  11372. "type": "array",
  11373. "items": {
  11374. "$ref": "#/components/schemas/FileSystemEntry"
  11375. }
  11376. }
  11377. },
  11378. "required": ["location", "data"],
  11379. "additionalProperties": false
  11380. }
  11381. }
  11382. }
  11383. },
  11384. "400": {
  11385. "description": "InvalidRequestError",
  11386. "content": {
  11387. "application/json": {
  11388. "schema": {
  11389. "$ref": "#/components/schemas/InvalidRequestError"
  11390. }
  11391. }
  11392. }
  11393. },
  11394. "401": {
  11395. "description": "UnauthorizedError",
  11396. "content": {
  11397. "application/json": {
  11398. "schema": {
  11399. "$ref": "#/components/schemas/UnauthorizedError"
  11400. }
  11401. }
  11402. }
  11403. }
  11404. },
  11405. "description": "List direct children of one directory relative to the requested location.",
  11406. "summary": "List directory",
  11407. "x-codeSamples": [
  11408. {
  11409. "lang": "js",
  11410. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.fs.list({\n ...\n})"
  11411. }
  11412. ]
  11413. }
  11414. },
  11415. "/api/command": {
  11416. "get": {
  11417. "tags": ["v2 commands"],
  11418. "operationId": "v2.command.list",
  11419. "parameters": [
  11420. {
  11421. "name": "location",
  11422. "in": "query",
  11423. "schema": {
  11424. "type": "object",
  11425. "properties": {
  11426. "directory": {
  11427. "type": "string"
  11428. },
  11429. "workspace": {
  11430. "type": "string"
  11431. }
  11432. },
  11433. "additionalProperties": false
  11434. },
  11435. "required": false,
  11436. "style": "deepObject",
  11437. "explode": true
  11438. }
  11439. ],
  11440. "security": [],
  11441. "responses": {
  11442. "200": {
  11443. "description": "Success",
  11444. "content": {
  11445. "application/json": {
  11446. "schema": {
  11447. "type": "object",
  11448. "properties": {
  11449. "location": {
  11450. "$ref": "#/components/schemas/LocationInfo"
  11451. },
  11452. "data": {
  11453. "type": "array",
  11454. "items": {
  11455. "$ref": "#/components/schemas/CommandV2Info"
  11456. }
  11457. }
  11458. },
  11459. "required": ["location", "data"],
  11460. "additionalProperties": false
  11461. }
  11462. }
  11463. }
  11464. },
  11465. "400": {
  11466. "description": "InvalidRequestError",
  11467. "content": {
  11468. "application/json": {
  11469. "schema": {
  11470. "$ref": "#/components/schemas/InvalidRequestError"
  11471. }
  11472. }
  11473. }
  11474. },
  11475. "401": {
  11476. "description": "UnauthorizedError",
  11477. "content": {
  11478. "application/json": {
  11479. "schema": {
  11480. "$ref": "#/components/schemas/UnauthorizedError"
  11481. }
  11482. }
  11483. }
  11484. }
  11485. },
  11486. "description": "Retrieve currently registered v2 commands.",
  11487. "summary": "List v2 commands",
  11488. "x-codeSamples": [
  11489. {
  11490. "lang": "js",
  11491. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.command.list({\n ...\n})"
  11492. }
  11493. ]
  11494. }
  11495. },
  11496. "/api/skill": {
  11497. "get": {
  11498. "tags": ["v2 skills"],
  11499. "operationId": "v2.skill.list",
  11500. "parameters": [
  11501. {
  11502. "name": "location",
  11503. "in": "query",
  11504. "schema": {
  11505. "type": "object",
  11506. "properties": {
  11507. "directory": {
  11508. "type": "string"
  11509. },
  11510. "workspace": {
  11511. "type": "string"
  11512. }
  11513. },
  11514. "additionalProperties": false
  11515. },
  11516. "required": false,
  11517. "style": "deepObject",
  11518. "explode": true
  11519. }
  11520. ],
  11521. "security": [],
  11522. "responses": {
  11523. "200": {
  11524. "description": "Success",
  11525. "content": {
  11526. "application/json": {
  11527. "schema": {
  11528. "type": "object",
  11529. "properties": {
  11530. "location": {
  11531. "$ref": "#/components/schemas/LocationInfo"
  11532. },
  11533. "data": {
  11534. "type": "array",
  11535. "items": {
  11536. "$ref": "#/components/schemas/SkillV2Info"
  11537. }
  11538. }
  11539. },
  11540. "required": ["location", "data"],
  11541. "additionalProperties": false
  11542. }
  11543. }
  11544. }
  11545. },
  11546. "400": {
  11547. "description": "InvalidRequestError",
  11548. "content": {
  11549. "application/json": {
  11550. "schema": {
  11551. "$ref": "#/components/schemas/InvalidRequestError"
  11552. }
  11553. }
  11554. }
  11555. },
  11556. "401": {
  11557. "description": "UnauthorizedError",
  11558. "content": {
  11559. "application/json": {
  11560. "schema": {
  11561. "$ref": "#/components/schemas/UnauthorizedError"
  11562. }
  11563. }
  11564. }
  11565. }
  11566. },
  11567. "description": "Retrieve currently registered v2 skills.",
  11568. "summary": "List v2 skills",
  11569. "x-codeSamples": [
  11570. {
  11571. "lang": "js",
  11572. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.skill.list({\n ...\n})"
  11573. }
  11574. ]
  11575. }
  11576. },
  11577. "/api/event": {
  11578. "get": {
  11579. "tags": ["v2 events"],
  11580. "operationId": "v2.event.subscribe",
  11581. "parameters": [
  11582. {
  11583. "name": "location",
  11584. "in": "query",
  11585. "schema": {
  11586. "type": "object",
  11587. "properties": {
  11588. "directory": {
  11589. "type": "string"
  11590. },
  11591. "workspace": {
  11592. "type": "string"
  11593. }
  11594. },
  11595. "additionalProperties": false
  11596. },
  11597. "required": false,
  11598. "style": "deepObject",
  11599. "explode": true
  11600. }
  11601. ],
  11602. "security": [],
  11603. "responses": {
  11604. "200": {
  11605. "description": "Success",
  11606. "content": {
  11607. "text/event-stream": {
  11608. "schema": {
  11609. "type": "string"
  11610. }
  11611. }
  11612. }
  11613. },
  11614. "400": {
  11615. "description": "InvalidRequestError",
  11616. "content": {
  11617. "application/json": {
  11618. "schema": {
  11619. "$ref": "#/components/schemas/InvalidRequestError"
  11620. }
  11621. }
  11622. }
  11623. },
  11624. "401": {
  11625. "description": "UnauthorizedError",
  11626. "content": {
  11627. "application/json": {
  11628. "schema": {
  11629. "$ref": "#/components/schemas/UnauthorizedError"
  11630. }
  11631. }
  11632. }
  11633. }
  11634. },
  11635. "description": "Subscribe to native EventV2 payloads for a location.",
  11636. "summary": "Subscribe to v2 events",
  11637. "x-codeSamples": [
  11638. {
  11639. "lang": "js",
  11640. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.event.subscribe({\n ...\n})"
  11641. }
  11642. ]
  11643. }
  11644. },
  11645. "/api/question/request": {
  11646. "get": {
  11647. "tags": ["v2 questions"],
  11648. "operationId": "v2.question.request.list",
  11649. "parameters": [
  11650. {
  11651. "name": "location",
  11652. "in": "query",
  11653. "schema": {
  11654. "type": "object",
  11655. "properties": {
  11656. "directory": {
  11657. "type": "string"
  11658. },
  11659. "workspace": {
  11660. "type": "string"
  11661. }
  11662. },
  11663. "additionalProperties": false
  11664. },
  11665. "required": false,
  11666. "style": "deepObject",
  11667. "explode": true
  11668. }
  11669. ],
  11670. "security": [],
  11671. "responses": {
  11672. "200": {
  11673. "description": "Success",
  11674. "content": {
  11675. "application/json": {
  11676. "schema": {
  11677. "type": "object",
  11678. "properties": {
  11679. "location": {
  11680. "$ref": "#/components/schemas/LocationInfo"
  11681. },
  11682. "data": {
  11683. "type": "array",
  11684. "items": {
  11685. "$ref": "#/components/schemas/QuestionV2Request"
  11686. }
  11687. }
  11688. },
  11689. "required": ["location", "data"],
  11690. "additionalProperties": false
  11691. }
  11692. }
  11693. }
  11694. },
  11695. "400": {
  11696. "description": "InvalidRequestError",
  11697. "content": {
  11698. "application/json": {
  11699. "schema": {
  11700. "$ref": "#/components/schemas/InvalidRequestError"
  11701. }
  11702. }
  11703. }
  11704. },
  11705. "401": {
  11706. "description": "UnauthorizedError",
  11707. "content": {
  11708. "application/json": {
  11709. "schema": {
  11710. "$ref": "#/components/schemas/UnauthorizedError"
  11711. }
  11712. }
  11713. }
  11714. }
  11715. },
  11716. "description": "Retrieve pending question requests for a location.",
  11717. "summary": "List pending question requests",
  11718. "x-codeSamples": [
  11719. {
  11720. "lang": "js",
  11721. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.question.request.list({\n ...\n})"
  11722. }
  11723. ]
  11724. }
  11725. },
  11726. "/api/session/{sessionID}/question/request/{requestID}/reply": {
  11727. "post": {
  11728. "tags": ["v2 session questions"],
  11729. "operationId": "v2.session.question.reply",
  11730. "parameters": [
  11731. {
  11732. "name": "sessionID",
  11733. "in": "path",
  11734. "schema": {
  11735. "type": "string",
  11736. "pattern": "^ses"
  11737. },
  11738. "required": true
  11739. },
  11740. {
  11741. "name": "requestID",
  11742. "in": "path",
  11743. "schema": {
  11744. "type": "string",
  11745. "pattern": "^que"
  11746. },
  11747. "required": true
  11748. }
  11749. ],
  11750. "security": [],
  11751. "responses": {
  11752. "204": {
  11753. "description": "<No Content>"
  11754. },
  11755. "400": {
  11756. "description": "InvalidRequestError",
  11757. "content": {
  11758. "application/json": {
  11759. "schema": {
  11760. "$ref": "#/components/schemas/InvalidRequestError"
  11761. }
  11762. }
  11763. }
  11764. },
  11765. "401": {
  11766. "description": "UnauthorizedError",
  11767. "content": {
  11768. "application/json": {
  11769. "schema": {
  11770. "$ref": "#/components/schemas/UnauthorizedError"
  11771. }
  11772. }
  11773. }
  11774. },
  11775. "404": {
  11776. "description": "SessionNotFoundError | QuestionNotFoundError",
  11777. "content": {
  11778. "application/json": {
  11779. "schema": {
  11780. "anyOf": [
  11781. {
  11782. "$ref": "#/components/schemas/SessionNotFoundError"
  11783. },
  11784. {
  11785. "$ref": "#/components/schemas/QuestionNotFoundError"
  11786. }
  11787. ]
  11788. }
  11789. }
  11790. }
  11791. }
  11792. },
  11793. "description": "Answer a pending question request owned by a session.",
  11794. "summary": "Reply to pending question request",
  11795. "requestBody": {
  11796. "content": {
  11797. "application/json": {
  11798. "schema": {
  11799. "$ref": "#/components/schemas/QuestionV2Reply"
  11800. }
  11801. }
  11802. },
  11803. "required": true
  11804. },
  11805. "x-codeSamples": [
  11806. {
  11807. "lang": "js",
  11808. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.question.reply({\n ...\n})"
  11809. }
  11810. ]
  11811. }
  11812. },
  11813. "/api/session/{sessionID}/question/request/{requestID}/reject": {
  11814. "post": {
  11815. "tags": ["v2 session questions"],
  11816. "operationId": "v2.session.question.reject",
  11817. "parameters": [
  11818. {
  11819. "name": "sessionID",
  11820. "in": "path",
  11821. "schema": {
  11822. "type": "string",
  11823. "pattern": "^ses"
  11824. },
  11825. "required": true
  11826. },
  11827. {
  11828. "name": "requestID",
  11829. "in": "path",
  11830. "schema": {
  11831. "type": "string",
  11832. "pattern": "^que"
  11833. },
  11834. "required": true
  11835. }
  11836. ],
  11837. "security": [],
  11838. "responses": {
  11839. "204": {
  11840. "description": "<No Content>"
  11841. },
  11842. "400": {
  11843. "description": "InvalidRequestError",
  11844. "content": {
  11845. "application/json": {
  11846. "schema": {
  11847. "$ref": "#/components/schemas/InvalidRequestError"
  11848. }
  11849. }
  11850. }
  11851. },
  11852. "401": {
  11853. "description": "UnauthorizedError",
  11854. "content": {
  11855. "application/json": {
  11856. "schema": {
  11857. "$ref": "#/components/schemas/UnauthorizedError"
  11858. }
  11859. }
  11860. }
  11861. },
  11862. "404": {
  11863. "description": "SessionNotFoundError | QuestionNotFoundError",
  11864. "content": {
  11865. "application/json": {
  11866. "schema": {
  11867. "anyOf": [
  11868. {
  11869. "$ref": "#/components/schemas/SessionNotFoundError"
  11870. },
  11871. {
  11872. "$ref": "#/components/schemas/QuestionNotFoundError"
  11873. }
  11874. ]
  11875. }
  11876. }
  11877. }
  11878. }
  11879. },
  11880. "description": "Reject a pending question request owned by a session.",
  11881. "summary": "Reject pending question request",
  11882. "x-codeSamples": [
  11883. {
  11884. "lang": "js",
  11885. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.question.reject({\n ...\n})"
  11886. }
  11887. ]
  11888. }
  11889. },
  11890. "/pty/{ptyID}/connect": {
  11891. "get": {
  11892. "tags": ["pty"],
  11893. "operationId": "pty.connect",
  11894. "parameters": [
  11895. {
  11896. "name": "ptyID",
  11897. "in": "path",
  11898. "schema": {
  11899. "type": "string",
  11900. "pattern": "^pty"
  11901. },
  11902. "required": true
  11903. },
  11904. {
  11905. "in": "query",
  11906. "name": "directory",
  11907. "schema": {
  11908. "type": "string"
  11909. }
  11910. },
  11911. {
  11912. "in": "query",
  11913. "name": "workspace",
  11914. "schema": {
  11915. "type": "string"
  11916. }
  11917. },
  11918. {
  11919. "in": "query",
  11920. "name": "cursor",
  11921. "schema": {
  11922. "type": "string"
  11923. }
  11924. },
  11925. {
  11926. "in": "query",
  11927. "name": "ticket",
  11928. "schema": {
  11929. "type": "string"
  11930. }
  11931. }
  11932. ],
  11933. "responses": {
  11934. "200": {
  11935. "description": "Connected session",
  11936. "content": {
  11937. "application/json": {
  11938. "schema": {
  11939. "type": "boolean",
  11940. "description": "Connected session"
  11941. }
  11942. }
  11943. }
  11944. },
  11945. "403": {
  11946. "description": "Forbidden",
  11947. "content": {
  11948. "application/json": {
  11949. "schema": {
  11950. "$ref": "#/components/schemas/effect_HttpApiError_Forbidden"
  11951. }
  11952. }
  11953. }
  11954. },
  11955. "404": {
  11956. "description": "Not found",
  11957. "content": {
  11958. "application/json": {
  11959. "schema": {
  11960. "$ref": "#/components/schemas/NotFoundError"
  11961. }
  11962. }
  11963. }
  11964. }
  11965. },
  11966. "description": "Establish a WebSocket connection to interact with a pseudo-terminal (PTY) session in real-time.",
  11967. "summary": "Connect to PTY session",
  11968. "x-codeSamples": [
  11969. {
  11970. "lang": "js",
  11971. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.connect({\n ...\n})"
  11972. }
  11973. ]
  11974. }
  11975. }
  11976. },
  11977. "components": {
  11978. "schemas": {
  11979. "Event": {
  11980. "anyOf": [
  11981. {
  11982. "$ref": "#/components/schemas/EventModels-devRefreshed"
  11983. },
  11984. {
  11985. "$ref": "#/components/schemas/EventPluginAdded"
  11986. },
  11987. {
  11988. "$ref": "#/components/schemas/EventCatalogModelUpdated"
  11989. },
  11990. {
  11991. "$ref": "#/components/schemas/EventSessionCreated"
  11992. },
  11993. {
  11994. "$ref": "#/components/schemas/EventSessionUpdated"
  11995. },
  11996. {
  11997. "$ref": "#/components/schemas/EventSessionDeleted"
  11998. },
  11999. {
  12000. "$ref": "#/components/schemas/EventMessageUpdated"
  12001. },
  12002. {
  12003. "$ref": "#/components/schemas/EventMessageRemoved"
  12004. },
  12005. {
  12006. "$ref": "#/components/schemas/EventMessagePartUpdated"
  12007. },
  12008. {
  12009. "$ref": "#/components/schemas/EventMessagePartRemoved"
  12010. },
  12011. {
  12012. "$ref": "#/components/schemas/EventSessionNextAgentSwitched"
  12013. },
  12014. {
  12015. "$ref": "#/components/schemas/EventSessionNextModelSwitched"
  12016. },
  12017. {
  12018. "$ref": "#/components/schemas/EventSessionNextMoved"
  12019. },
  12020. {
  12021. "$ref": "#/components/schemas/EventSessionNextPrompted"
  12022. },
  12023. {
  12024. "$ref": "#/components/schemas/EventSessionNextPromptAdmitted"
  12025. },
  12026. {
  12027. "$ref": "#/components/schemas/EventSessionNextPromptPromoted"
  12028. },
  12029. {
  12030. "$ref": "#/components/schemas/EventSessionNextSynthetic"
  12031. },
  12032. {
  12033. "$ref": "#/components/schemas/EventSessionNextShellStarted"
  12034. },
  12035. {
  12036. "$ref": "#/components/schemas/EventSessionNextShellEnded"
  12037. },
  12038. {
  12039. "$ref": "#/components/schemas/EventSessionNextStepStarted"
  12040. },
  12041. {
  12042. "$ref": "#/components/schemas/EventSessionNextStepEnded"
  12043. },
  12044. {
  12045. "$ref": "#/components/schemas/EventSessionNextStepFailed"
  12046. },
  12047. {
  12048. "$ref": "#/components/schemas/EventSessionNextTextStarted"
  12049. },
  12050. {
  12051. "$ref": "#/components/schemas/EventSessionNextTextDelta"
  12052. },
  12053. {
  12054. "$ref": "#/components/schemas/EventSessionNextTextEnded"
  12055. },
  12056. {
  12057. "$ref": "#/components/schemas/EventSessionNextReasoningStarted"
  12058. },
  12059. {
  12060. "$ref": "#/components/schemas/EventSessionNextReasoningDelta"
  12061. },
  12062. {
  12063. "$ref": "#/components/schemas/EventSessionNextReasoningEnded"
  12064. },
  12065. {
  12066. "$ref": "#/components/schemas/EventSessionNextToolInputStarted"
  12067. },
  12068. {
  12069. "$ref": "#/components/schemas/EventSessionNextToolInputDelta"
  12070. },
  12071. {
  12072. "$ref": "#/components/schemas/EventSessionNextToolInputEnded"
  12073. },
  12074. {
  12075. "$ref": "#/components/schemas/EventSessionNextToolCalled"
  12076. },
  12077. {
  12078. "$ref": "#/components/schemas/EventSessionNextToolProgress"
  12079. },
  12080. {
  12081. "$ref": "#/components/schemas/EventSessionNextToolSuccess"
  12082. },
  12083. {
  12084. "$ref": "#/components/schemas/EventSessionNextToolFailed"
  12085. },
  12086. {
  12087. "$ref": "#/components/schemas/EventSessionNextRetried"
  12088. },
  12089. {
  12090. "$ref": "#/components/schemas/EventSessionNextCompactionStarted"
  12091. },
  12092. {
  12093. "$ref": "#/components/schemas/EventSessionNextCompactionDelta"
  12094. },
  12095. {
  12096. "$ref": "#/components/schemas/EventSessionNextCompactionEnded"
  12097. },
  12098. {
  12099. "$ref": "#/components/schemas/EventMessagePartDelta"
  12100. },
  12101. {
  12102. "$ref": "#/components/schemas/EventSessionDiff"
  12103. },
  12104. {
  12105. "$ref": "#/components/schemas/EventSessionError"
  12106. },
  12107. {
  12108. "$ref": "#/components/schemas/EventInstallationUpdated"
  12109. },
  12110. {
  12111. "$ref": "#/components/schemas/EventInstallationUpdate-available"
  12112. },
  12113. {
  12114. "$ref": "#/components/schemas/EventFileEdited"
  12115. },
  12116. {
  12117. "$ref": "#/components/schemas/EventAccountAdded"
  12118. },
  12119. {
  12120. "$ref": "#/components/schemas/EventAccountRemoved"
  12121. },
  12122. {
  12123. "$ref": "#/components/schemas/EventAccountSwitched"
  12124. },
  12125. {
  12126. "$ref": "#/components/schemas/EventPermissionV2Asked"
  12127. },
  12128. {
  12129. "$ref": "#/components/schemas/EventPermissionV2Replied"
  12130. },
  12131. {
  12132. "$ref": "#/components/schemas/EventFileWatcherUpdated"
  12133. },
  12134. {
  12135. "$ref": "#/components/schemas/EventPtyCreated"
  12136. },
  12137. {
  12138. "$ref": "#/components/schemas/EventPtyUpdated"
  12139. },
  12140. {
  12141. "$ref": "#/components/schemas/EventPtyExited"
  12142. },
  12143. {
  12144. "$ref": "#/components/schemas/EventPtyDeleted"
  12145. },
  12146. {
  12147. "$ref": "#/components/schemas/EventQuestionV2Asked"
  12148. },
  12149. {
  12150. "$ref": "#/components/schemas/EventQuestionV2Replied"
  12151. },
  12152. {
  12153. "$ref": "#/components/schemas/EventQuestionV2Rejected"
  12154. },
  12155. {
  12156. "$ref": "#/components/schemas/EventTodoUpdated"
  12157. },
  12158. {
  12159. "$ref": "#/components/schemas/EventLspUpdated"
  12160. },
  12161. {
  12162. "$ref": "#/components/schemas/EventPermissionAsked"
  12163. },
  12164. {
  12165. "$ref": "#/components/schemas/EventPermissionReplied"
  12166. },
  12167. {
  12168. "$ref": "#/components/schemas/Event.tui.prompt.append"
  12169. },
  12170. {
  12171. "$ref": "#/components/schemas/Event.tui.command.execute"
  12172. },
  12173. {
  12174. "$ref": "#/components/schemas/Event.tui.toast.show"
  12175. },
  12176. {
  12177. "$ref": "#/components/schemas/Event.tui.session.select"
  12178. },
  12179. {
  12180. "$ref": "#/components/schemas/EventMcpToolsChanged"
  12181. },
  12182. {
  12183. "$ref": "#/components/schemas/EventMcpBrowserOpenFailed"
  12184. },
  12185. {
  12186. "$ref": "#/components/schemas/EventCommandExecuted"
  12187. },
  12188. {
  12189. "$ref": "#/components/schemas/EventProjectDirectoriesUpdated"
  12190. },
  12191. {
  12192. "$ref": "#/components/schemas/EventProjectUpdated"
  12193. },
  12194. {
  12195. "$ref": "#/components/schemas/EventQuestionAsked"
  12196. },
  12197. {
  12198. "$ref": "#/components/schemas/EventQuestionReplied"
  12199. },
  12200. {
  12201. "$ref": "#/components/schemas/EventQuestionRejected"
  12202. },
  12203. {
  12204. "$ref": "#/components/schemas/EventSessionStatus"
  12205. },
  12206. {
  12207. "$ref": "#/components/schemas/EventSessionIdle"
  12208. },
  12209. {
  12210. "$ref": "#/components/schemas/EventSessionCompacted"
  12211. },
  12212. {
  12213. "$ref": "#/components/schemas/EventVcsBranchUpdated"
  12214. },
  12215. {
  12216. "$ref": "#/components/schemas/EventWorktreeReady"
  12217. },
  12218. {
  12219. "$ref": "#/components/schemas/EventWorktreeFailed"
  12220. },
  12221. {
  12222. "$ref": "#/components/schemas/EventWorkspaceReady"
  12223. },
  12224. {
  12225. "$ref": "#/components/schemas/EventWorkspaceFailed"
  12226. },
  12227. {
  12228. "$ref": "#/components/schemas/EventWorkspaceStatus"
  12229. },
  12230. {
  12231. "$ref": "#/components/schemas/EventServerConnected"
  12232. },
  12233. {
  12234. "$ref": "#/components/schemas/EventGlobalDisposed"
  12235. },
  12236. {
  12237. "$ref": "#/components/schemas/EventServerInstanceDisposed"
  12238. }
  12239. ]
  12240. },
  12241. "QuestionReplied": {
  12242. "type": "object",
  12243. "properties": {
  12244. "sessionID": {
  12245. "type": "string",
  12246. "pattern": "^ses"
  12247. },
  12248. "requestID": {
  12249. "type": "string",
  12250. "pattern": "^que"
  12251. },
  12252. "answers": {
  12253. "type": "array",
  12254. "items": {
  12255. "$ref": "#/components/schemas/QuestionAnswer"
  12256. }
  12257. }
  12258. },
  12259. "required": ["sessionID", "requestID", "answers"],
  12260. "additionalProperties": false
  12261. },
  12262. "QuestionRejected": {
  12263. "type": "object",
  12264. "properties": {
  12265. "sessionID": {
  12266. "type": "string",
  12267. "pattern": "^ses"
  12268. },
  12269. "requestID": {
  12270. "type": "string",
  12271. "pattern": "^que"
  12272. }
  12273. },
  12274. "required": ["sessionID", "requestID"],
  12275. "additionalProperties": false
  12276. },
  12277. "OAuth": {
  12278. "type": "object",
  12279. "properties": {
  12280. "type": {
  12281. "type": "string",
  12282. "enum": ["oauth"]
  12283. },
  12284. "refresh": {
  12285. "type": "string"
  12286. },
  12287. "access": {
  12288. "type": "string"
  12289. },
  12290. "expires": {
  12291. "type": "integer",
  12292. "minimum": 0
  12293. },
  12294. "accountId": {
  12295. "type": "string"
  12296. },
  12297. "enterpriseUrl": {
  12298. "type": "string"
  12299. }
  12300. },
  12301. "required": ["type", "refresh", "access", "expires"],
  12302. "additionalProperties": false
  12303. },
  12304. "ApiAuth": {
  12305. "type": "object",
  12306. "properties": {
  12307. "type": {
  12308. "type": "string",
  12309. "enum": ["api"]
  12310. },
  12311. "key": {
  12312. "type": "string"
  12313. },
  12314. "metadata": {
  12315. "type": "object",
  12316. "additionalProperties": {
  12317. "type": "string"
  12318. }
  12319. }
  12320. },
  12321. "required": ["type", "key"],
  12322. "additionalProperties": false
  12323. },
  12324. "WellKnownAuth": {
  12325. "type": "object",
  12326. "properties": {
  12327. "type": {
  12328. "type": "string",
  12329. "enum": ["wellknown"]
  12330. },
  12331. "key": {
  12332. "type": "string"
  12333. },
  12334. "token": {
  12335. "type": "string"
  12336. }
  12337. },
  12338. "required": ["type", "key", "token"],
  12339. "additionalProperties": false
  12340. },
  12341. "Auth": {
  12342. "anyOf": [
  12343. {
  12344. "$ref": "#/components/schemas/OAuth"
  12345. },
  12346. {
  12347. "$ref": "#/components/schemas/ApiAuth"
  12348. },
  12349. {
  12350. "$ref": "#/components/schemas/WellKnownAuth"
  12351. }
  12352. ]
  12353. },
  12354. "effect_HttpApiError_BadRequest": {
  12355. "type": "object",
  12356. "properties": {
  12357. "_tag": {
  12358. "type": "string",
  12359. "enum": ["BadRequest"]
  12360. }
  12361. },
  12362. "required": ["_tag"],
  12363. "additionalProperties": false
  12364. },
  12365. "InvalidRequestError": {
  12366. "type": "object",
  12367. "properties": {
  12368. "_tag": {
  12369. "type": "string",
  12370. "enum": ["InvalidRequestError"]
  12371. },
  12372. "message": {
  12373. "type": "string"
  12374. },
  12375. "kind": {
  12376. "type": "string"
  12377. },
  12378. "field": {
  12379. "type": "string"
  12380. }
  12381. },
  12382. "required": ["_tag", "message"],
  12383. "additionalProperties": false
  12384. },
  12385. "MoveSessionError": {
  12386. "type": "object",
  12387. "properties": {
  12388. "name": {
  12389. "type": "string",
  12390. "enum": ["MoveSessionError"]
  12391. },
  12392. "data": {
  12393. "type": "object",
  12394. "properties": {
  12395. "message": {
  12396. "type": "string"
  12397. }
  12398. },
  12399. "required": ["message"],
  12400. "additionalProperties": false
  12401. }
  12402. },
  12403. "required": ["name", "data"],
  12404. "additionalProperties": false
  12405. },
  12406. "SnapshotFileDiff": {
  12407. "type": "object",
  12408. "properties": {
  12409. "file": {
  12410. "type": "string"
  12411. },
  12412. "patch": {
  12413. "type": "string"
  12414. },
  12415. "additions": {
  12416. "type": "number"
  12417. },
  12418. "deletions": {
  12419. "type": "number"
  12420. },
  12421. "status": {
  12422. "type": "string",
  12423. "enum": ["added", "deleted", "modified"]
  12424. }
  12425. },
  12426. "required": ["additions", "deletions"],
  12427. "additionalProperties": false
  12428. },
  12429. "PermissionAction": {
  12430. "type": "string",
  12431. "enum": ["allow", "deny", "ask"]
  12432. },
  12433. "PermissionRule": {
  12434. "type": "object",
  12435. "properties": {
  12436. "permission": {
  12437. "type": "string"
  12438. },
  12439. "pattern": {
  12440. "type": "string"
  12441. },
  12442. "action": {
  12443. "$ref": "#/components/schemas/PermissionAction"
  12444. }
  12445. },
  12446. "required": ["permission", "pattern", "action"],
  12447. "additionalProperties": false
  12448. },
  12449. "PermissionRuleset": {
  12450. "type": "array",
  12451. "items": {
  12452. "$ref": "#/components/schemas/PermissionRule"
  12453. }
  12454. },
  12455. "Session": {
  12456. "type": "object",
  12457. "properties": {
  12458. "id": {
  12459. "type": "string",
  12460. "pattern": "^ses"
  12461. },
  12462. "slug": {
  12463. "type": "string"
  12464. },
  12465. "projectID": {
  12466. "type": "string"
  12467. },
  12468. "workspaceID": {
  12469. "type": "string",
  12470. "pattern": "^wrk"
  12471. },
  12472. "directory": {
  12473. "type": "string"
  12474. },
  12475. "path": {
  12476. "type": "string"
  12477. },
  12478. "parentID": {
  12479. "type": "string",
  12480. "pattern": "^ses"
  12481. },
  12482. "summary": {
  12483. "type": "object",
  12484. "properties": {
  12485. "additions": {
  12486. "type": "number"
  12487. },
  12488. "deletions": {
  12489. "type": "number"
  12490. },
  12491. "files": {
  12492. "type": "number"
  12493. },
  12494. "diffs": {
  12495. "type": "array",
  12496. "items": {
  12497. "$ref": "#/components/schemas/SnapshotFileDiff"
  12498. }
  12499. }
  12500. },
  12501. "required": ["additions", "deletions", "files"],
  12502. "additionalProperties": false
  12503. },
  12504. "cost": {
  12505. "type": "number"
  12506. },
  12507. "tokens": {
  12508. "type": "object",
  12509. "properties": {
  12510. "input": {
  12511. "type": "number"
  12512. },
  12513. "output": {
  12514. "type": "number"
  12515. },
  12516. "reasoning": {
  12517. "type": "number"
  12518. },
  12519. "cache": {
  12520. "type": "object",
  12521. "properties": {
  12522. "read": {
  12523. "type": "number"
  12524. },
  12525. "write": {
  12526. "type": "number"
  12527. }
  12528. },
  12529. "required": ["read", "write"],
  12530. "additionalProperties": false
  12531. }
  12532. },
  12533. "required": ["input", "output", "reasoning", "cache"],
  12534. "additionalProperties": false
  12535. },
  12536. "share": {
  12537. "type": "object",
  12538. "properties": {
  12539. "url": {
  12540. "type": "string"
  12541. }
  12542. },
  12543. "required": ["url"],
  12544. "additionalProperties": false
  12545. },
  12546. "title": {
  12547. "type": "string"
  12548. },
  12549. "agent": {
  12550. "type": "string"
  12551. },
  12552. "model": {
  12553. "type": "object",
  12554. "properties": {
  12555. "id": {
  12556. "type": "string"
  12557. },
  12558. "providerID": {
  12559. "type": "string"
  12560. },
  12561. "variant": {
  12562. "type": "string"
  12563. }
  12564. },
  12565. "required": ["id", "providerID"],
  12566. "additionalProperties": false
  12567. },
  12568. "version": {
  12569. "type": "string"
  12570. },
  12571. "metadata": {
  12572. "type": "object"
  12573. },
  12574. "time": {
  12575. "type": "object",
  12576. "properties": {
  12577. "created": {
  12578. "type": "integer",
  12579. "minimum": 0
  12580. },
  12581. "updated": {
  12582. "type": "integer",
  12583. "minimum": 0
  12584. },
  12585. "compacting": {
  12586. "type": "integer",
  12587. "minimum": 0
  12588. },
  12589. "archived": {
  12590. "type": "number"
  12591. }
  12592. },
  12593. "required": ["created", "updated"],
  12594. "additionalProperties": false
  12595. },
  12596. "permission": {
  12597. "$ref": "#/components/schemas/PermissionRuleset"
  12598. },
  12599. "revert": {
  12600. "type": "object",
  12601. "properties": {
  12602. "messageID": {
  12603. "type": "string",
  12604. "pattern": "^msg"
  12605. },
  12606. "partID": {
  12607. "type": "string",
  12608. "pattern": "^prt"
  12609. },
  12610. "snapshot": {
  12611. "type": "string"
  12612. },
  12613. "diff": {
  12614. "type": "string"
  12615. }
  12616. },
  12617. "required": ["messageID"],
  12618. "additionalProperties": false
  12619. }
  12620. },
  12621. "required": ["id", "slug", "projectID", "directory", "title", "version", "time"],
  12622. "additionalProperties": false
  12623. },
  12624. "OutputFormatText": {
  12625. "type": "object",
  12626. "properties": {
  12627. "type": {
  12628. "type": "string",
  12629. "enum": ["text"]
  12630. }
  12631. },
  12632. "required": ["type"],
  12633. "additionalProperties": false
  12634. },
  12635. "JSONSchema": {
  12636. "type": "object"
  12637. },
  12638. "OutputFormatJsonSchema": {
  12639. "type": "object",
  12640. "properties": {
  12641. "type": {
  12642. "type": "string",
  12643. "enum": ["json_schema"]
  12644. },
  12645. "schema": {
  12646. "$ref": "#/components/schemas/JSONSchema"
  12647. },
  12648. "retryCount": {
  12649. "type": "integer",
  12650. "minimum": 0
  12651. }
  12652. },
  12653. "required": ["type", "schema"],
  12654. "additionalProperties": false
  12655. },
  12656. "OutputFormat": {
  12657. "anyOf": [
  12658. {
  12659. "$ref": "#/components/schemas/OutputFormatText"
  12660. },
  12661. {
  12662. "$ref": "#/components/schemas/OutputFormatJsonSchema"
  12663. }
  12664. ]
  12665. },
  12666. "UserMessage": {
  12667. "type": "object",
  12668. "properties": {
  12669. "id": {
  12670. "type": "string",
  12671. "pattern": "^msg"
  12672. },
  12673. "sessionID": {
  12674. "type": "string",
  12675. "pattern": "^ses"
  12676. },
  12677. "role": {
  12678. "type": "string",
  12679. "enum": ["user"]
  12680. },
  12681. "time": {
  12682. "type": "object",
  12683. "properties": {
  12684. "created": {
  12685. "type": "number",
  12686. "minimum": 0
  12687. }
  12688. },
  12689. "required": ["created"],
  12690. "additionalProperties": false
  12691. },
  12692. "format": {
  12693. "$ref": "#/components/schemas/OutputFormat"
  12694. },
  12695. "summary": {
  12696. "type": "object",
  12697. "properties": {
  12698. "title": {
  12699. "type": "string"
  12700. },
  12701. "body": {
  12702. "type": "string"
  12703. },
  12704. "diffs": {
  12705. "type": "array",
  12706. "items": {
  12707. "$ref": "#/components/schemas/SnapshotFileDiff"
  12708. }
  12709. }
  12710. },
  12711. "required": ["diffs"],
  12712. "additionalProperties": false
  12713. },
  12714. "agent": {
  12715. "type": "string"
  12716. },
  12717. "model": {
  12718. "type": "object",
  12719. "properties": {
  12720. "providerID": {
  12721. "type": "string"
  12722. },
  12723. "modelID": {
  12724. "type": "string"
  12725. },
  12726. "variant": {
  12727. "type": "string"
  12728. }
  12729. },
  12730. "required": ["providerID", "modelID"],
  12731. "additionalProperties": false
  12732. },
  12733. "system": {
  12734. "type": "string"
  12735. },
  12736. "tools": {
  12737. "type": "object",
  12738. "additionalProperties": {
  12739. "type": "boolean"
  12740. }
  12741. }
  12742. },
  12743. "required": ["id", "sessionID", "role", "time", "agent", "model"],
  12744. "additionalProperties": false
  12745. },
  12746. "ProviderAuthError": {
  12747. "type": "object",
  12748. "properties": {
  12749. "name": {
  12750. "type": "string",
  12751. "enum": ["ProviderAuthError"]
  12752. },
  12753. "data": {
  12754. "type": "object",
  12755. "properties": {
  12756. "providerID": {
  12757. "type": "string"
  12758. },
  12759. "message": {
  12760. "type": "string"
  12761. }
  12762. },
  12763. "required": ["providerID", "message"],
  12764. "additionalProperties": false
  12765. }
  12766. },
  12767. "required": ["name", "data"],
  12768. "additionalProperties": false
  12769. },
  12770. "UnknownError": {
  12771. "type": "object",
  12772. "properties": {
  12773. "name": {
  12774. "type": "string",
  12775. "enum": ["UnknownError"]
  12776. },
  12777. "data": {
  12778. "type": "object",
  12779. "properties": {
  12780. "message": {
  12781. "type": "string"
  12782. },
  12783. "ref": {
  12784. "type": "string"
  12785. }
  12786. },
  12787. "required": ["message"],
  12788. "additionalProperties": false
  12789. }
  12790. },
  12791. "required": ["name", "data"],
  12792. "additionalProperties": false
  12793. },
  12794. "MessageOutputLengthError": {
  12795. "type": "object",
  12796. "properties": {
  12797. "name": {
  12798. "type": "string",
  12799. "enum": ["MessageOutputLengthError"]
  12800. },
  12801. "data": {
  12802. "type": "object",
  12803. "properties": {}
  12804. }
  12805. },
  12806. "required": ["name", "data"],
  12807. "additionalProperties": false
  12808. },
  12809. "MessageAbortedError": {
  12810. "type": "object",
  12811. "properties": {
  12812. "name": {
  12813. "type": "string",
  12814. "enum": ["MessageAbortedError"]
  12815. },
  12816. "data": {
  12817. "type": "object",
  12818. "properties": {
  12819. "message": {
  12820. "type": "string"
  12821. }
  12822. },
  12823. "required": ["message"],
  12824. "additionalProperties": false
  12825. }
  12826. },
  12827. "required": ["name", "data"],
  12828. "additionalProperties": false
  12829. },
  12830. "StructuredOutputError": {
  12831. "type": "object",
  12832. "properties": {
  12833. "name": {
  12834. "type": "string",
  12835. "enum": ["StructuredOutputError"]
  12836. },
  12837. "data": {
  12838. "type": "object",
  12839. "properties": {
  12840. "message": {
  12841. "type": "string"
  12842. },
  12843. "retries": {
  12844. "type": "integer",
  12845. "minimum": 0
  12846. }
  12847. },
  12848. "required": ["message", "retries"],
  12849. "additionalProperties": false
  12850. }
  12851. },
  12852. "required": ["name", "data"],
  12853. "additionalProperties": false
  12854. },
  12855. "ContextOverflowError": {
  12856. "type": "object",
  12857. "properties": {
  12858. "name": {
  12859. "type": "string",
  12860. "enum": ["ContextOverflowError"]
  12861. },
  12862. "data": {
  12863. "type": "object",
  12864. "properties": {
  12865. "message": {
  12866. "type": "string"
  12867. },
  12868. "responseBody": {
  12869. "type": "string"
  12870. }
  12871. },
  12872. "required": ["message"],
  12873. "additionalProperties": false
  12874. }
  12875. },
  12876. "required": ["name", "data"],
  12877. "additionalProperties": false
  12878. },
  12879. "APIError": {
  12880. "type": "object",
  12881. "properties": {
  12882. "name": {
  12883. "type": "string",
  12884. "enum": ["APIError"]
  12885. },
  12886. "data": {
  12887. "type": "object",
  12888. "properties": {
  12889. "message": {
  12890. "type": "string"
  12891. },
  12892. "statusCode": {
  12893. "type": "integer",
  12894. "minimum": 0
  12895. },
  12896. "isRetryable": {
  12897. "type": "boolean"
  12898. },
  12899. "responseHeaders": {
  12900. "type": "object",
  12901. "additionalProperties": {
  12902. "type": "string"
  12903. }
  12904. },
  12905. "responseBody": {
  12906. "type": "string"
  12907. },
  12908. "metadata": {
  12909. "type": "object",
  12910. "additionalProperties": {
  12911. "type": "string"
  12912. }
  12913. }
  12914. },
  12915. "required": ["message", "isRetryable"],
  12916. "additionalProperties": false
  12917. }
  12918. },
  12919. "required": ["name", "data"],
  12920. "additionalProperties": false
  12921. },
  12922. "AssistantMessage": {
  12923. "type": "object",
  12924. "properties": {
  12925. "id": {
  12926. "type": "string",
  12927. "pattern": "^msg"
  12928. },
  12929. "sessionID": {
  12930. "type": "string",
  12931. "pattern": "^ses"
  12932. },
  12933. "role": {
  12934. "type": "string",
  12935. "enum": ["assistant"]
  12936. },
  12937. "time": {
  12938. "type": "object",
  12939. "properties": {
  12940. "created": {
  12941. "type": "integer",
  12942. "minimum": 0
  12943. },
  12944. "completed": {
  12945. "type": "integer",
  12946. "minimum": 0
  12947. }
  12948. },
  12949. "required": ["created"],
  12950. "additionalProperties": false
  12951. },
  12952. "error": {
  12953. "anyOf": [
  12954. {
  12955. "$ref": "#/components/schemas/ProviderAuthError"
  12956. },
  12957. {
  12958. "$ref": "#/components/schemas/UnknownError"
  12959. },
  12960. {
  12961. "$ref": "#/components/schemas/MessageOutputLengthError"
  12962. },
  12963. {
  12964. "$ref": "#/components/schemas/MessageAbortedError"
  12965. },
  12966. {
  12967. "$ref": "#/components/schemas/StructuredOutputError"
  12968. },
  12969. {
  12970. "$ref": "#/components/schemas/ContextOverflowError"
  12971. },
  12972. {
  12973. "$ref": "#/components/schemas/APIError"
  12974. }
  12975. ]
  12976. },
  12977. "parentID": {
  12978. "type": "string",
  12979. "pattern": "^msg"
  12980. },
  12981. "modelID": {
  12982. "type": "string"
  12983. },
  12984. "providerID": {
  12985. "type": "string"
  12986. },
  12987. "mode": {
  12988. "type": "string"
  12989. },
  12990. "agent": {
  12991. "type": "string"
  12992. },
  12993. "path": {
  12994. "type": "object",
  12995. "properties": {
  12996. "cwd": {
  12997. "type": "string"
  12998. },
  12999. "root": {
  13000. "type": "string"
  13001. }
  13002. },
  13003. "required": ["cwd", "root"],
  13004. "additionalProperties": false
  13005. },
  13006. "summary": {
  13007. "type": "boolean"
  13008. },
  13009. "cost": {
  13010. "type": "number"
  13011. },
  13012. "tokens": {
  13013. "type": "object",
  13014. "properties": {
  13015. "total": {
  13016. "type": "number"
  13017. },
  13018. "input": {
  13019. "type": "number"
  13020. },
  13021. "output": {
  13022. "type": "number"
  13023. },
  13024. "reasoning": {
  13025. "type": "number"
  13026. },
  13027. "cache": {
  13028. "type": "object",
  13029. "properties": {
  13030. "read": {
  13031. "type": "number"
  13032. },
  13033. "write": {
  13034. "type": "number"
  13035. }
  13036. },
  13037. "required": ["read", "write"],
  13038. "additionalProperties": false
  13039. }
  13040. },
  13041. "required": ["input", "output", "reasoning", "cache"],
  13042. "additionalProperties": false
  13043. },
  13044. "structured": {},
  13045. "variant": {
  13046. "type": "string"
  13047. },
  13048. "finish": {
  13049. "type": "string"
  13050. }
  13051. },
  13052. "required": [
  13053. "id",
  13054. "sessionID",
  13055. "role",
  13056. "time",
  13057. "parentID",
  13058. "modelID",
  13059. "providerID",
  13060. "mode",
  13061. "agent",
  13062. "path",
  13063. "cost",
  13064. "tokens"
  13065. ],
  13066. "additionalProperties": false
  13067. },
  13068. "Message": {
  13069. "anyOf": [
  13070. {
  13071. "$ref": "#/components/schemas/UserMessage"
  13072. },
  13073. {
  13074. "$ref": "#/components/schemas/AssistantMessage"
  13075. }
  13076. ]
  13077. },
  13078. "TextPart": {
  13079. "type": "object",
  13080. "properties": {
  13081. "id": {
  13082. "type": "string",
  13083. "pattern": "^prt"
  13084. },
  13085. "sessionID": {
  13086. "type": "string",
  13087. "pattern": "^ses"
  13088. },
  13089. "messageID": {
  13090. "type": "string",
  13091. "pattern": "^msg"
  13092. },
  13093. "type": {
  13094. "type": "string",
  13095. "enum": ["text"]
  13096. },
  13097. "text": {
  13098. "type": "string"
  13099. },
  13100. "synthetic": {
  13101. "type": "boolean"
  13102. },
  13103. "ignored": {
  13104. "type": "boolean"
  13105. },
  13106. "time": {
  13107. "type": "object",
  13108. "properties": {
  13109. "start": {
  13110. "type": "integer",
  13111. "minimum": 0
  13112. },
  13113. "end": {
  13114. "type": "integer",
  13115. "minimum": 0
  13116. }
  13117. },
  13118. "required": ["start"],
  13119. "additionalProperties": false
  13120. },
  13121. "metadata": {
  13122. "type": "object"
  13123. }
  13124. },
  13125. "required": ["id", "sessionID", "messageID", "type", "text"],
  13126. "additionalProperties": false
  13127. },
  13128. "SubtaskPart": {
  13129. "type": "object",
  13130. "properties": {
  13131. "id": {
  13132. "type": "string",
  13133. "pattern": "^prt"
  13134. },
  13135. "sessionID": {
  13136. "type": "string",
  13137. "pattern": "^ses"
  13138. },
  13139. "messageID": {
  13140. "type": "string",
  13141. "pattern": "^msg"
  13142. },
  13143. "type": {
  13144. "type": "string",
  13145. "enum": ["subtask"]
  13146. },
  13147. "prompt": {
  13148. "type": "string"
  13149. },
  13150. "description": {
  13151. "type": "string"
  13152. },
  13153. "agent": {
  13154. "type": "string"
  13155. },
  13156. "model": {
  13157. "type": "object",
  13158. "properties": {
  13159. "providerID": {
  13160. "type": "string"
  13161. },
  13162. "modelID": {
  13163. "type": "string"
  13164. }
  13165. },
  13166. "required": ["providerID", "modelID"],
  13167. "additionalProperties": false
  13168. },
  13169. "command": {
  13170. "type": "string"
  13171. }
  13172. },
  13173. "required": ["id", "sessionID", "messageID", "type", "prompt", "description", "agent"],
  13174. "additionalProperties": false
  13175. },
  13176. "ReasoningPart": {
  13177. "type": "object",
  13178. "properties": {
  13179. "id": {
  13180. "type": "string",
  13181. "pattern": "^prt"
  13182. },
  13183. "sessionID": {
  13184. "type": "string",
  13185. "pattern": "^ses"
  13186. },
  13187. "messageID": {
  13188. "type": "string",
  13189. "pattern": "^msg"
  13190. },
  13191. "type": {
  13192. "type": "string",
  13193. "enum": ["reasoning"]
  13194. },
  13195. "text": {
  13196. "type": "string"
  13197. },
  13198. "metadata": {
  13199. "type": "object"
  13200. },
  13201. "time": {
  13202. "type": "object",
  13203. "properties": {
  13204. "start": {
  13205. "type": "integer",
  13206. "minimum": 0
  13207. },
  13208. "end": {
  13209. "type": "integer",
  13210. "minimum": 0
  13211. }
  13212. },
  13213. "required": ["start"],
  13214. "additionalProperties": false
  13215. }
  13216. },
  13217. "required": ["id", "sessionID", "messageID", "type", "text", "time"],
  13218. "additionalProperties": false
  13219. },
  13220. "FilePartSourceText": {
  13221. "type": "object",
  13222. "properties": {
  13223. "value": {
  13224. "type": "string"
  13225. },
  13226. "start": {
  13227. "type": "number"
  13228. },
  13229. "end": {
  13230. "type": "number"
  13231. }
  13232. },
  13233. "required": ["value", "start", "end"],
  13234. "additionalProperties": false
  13235. },
  13236. "FileSource": {
  13237. "type": "object",
  13238. "properties": {
  13239. "text": {
  13240. "$ref": "#/components/schemas/FilePartSourceText"
  13241. },
  13242. "type": {
  13243. "type": "string",
  13244. "enum": ["file"]
  13245. },
  13246. "path": {
  13247. "type": "string"
  13248. }
  13249. },
  13250. "required": ["text", "type", "path"],
  13251. "additionalProperties": false
  13252. },
  13253. "Range": {
  13254. "type": "object",
  13255. "properties": {
  13256. "start": {
  13257. "type": "object",
  13258. "properties": {
  13259. "line": {
  13260. "type": "integer",
  13261. "minimum": 0
  13262. },
  13263. "character": {
  13264. "type": "integer",
  13265. "minimum": 0
  13266. }
  13267. },
  13268. "required": ["line", "character"],
  13269. "additionalProperties": false
  13270. },
  13271. "end": {
  13272. "type": "object",
  13273. "properties": {
  13274. "line": {
  13275. "type": "integer",
  13276. "minimum": 0
  13277. },
  13278. "character": {
  13279. "type": "integer",
  13280. "minimum": 0
  13281. }
  13282. },
  13283. "required": ["line", "character"],
  13284. "additionalProperties": false
  13285. }
  13286. },
  13287. "required": ["start", "end"],
  13288. "additionalProperties": false
  13289. },
  13290. "SymbolSource": {
  13291. "type": "object",
  13292. "properties": {
  13293. "text": {
  13294. "$ref": "#/components/schemas/FilePartSourceText"
  13295. },
  13296. "type": {
  13297. "type": "string",
  13298. "enum": ["symbol"]
  13299. },
  13300. "path": {
  13301. "type": "string"
  13302. },
  13303. "range": {
  13304. "$ref": "#/components/schemas/Range"
  13305. },
  13306. "name": {
  13307. "type": "string"
  13308. },
  13309. "kind": {
  13310. "type": "integer",
  13311. "minimum": 0
  13312. }
  13313. },
  13314. "required": ["text", "type", "path", "range", "name", "kind"],
  13315. "additionalProperties": false
  13316. },
  13317. "ResourceSource": {
  13318. "type": "object",
  13319. "properties": {
  13320. "text": {
  13321. "$ref": "#/components/schemas/FilePartSourceText"
  13322. },
  13323. "type": {
  13324. "type": "string",
  13325. "enum": ["resource"]
  13326. },
  13327. "clientName": {
  13328. "type": "string"
  13329. },
  13330. "uri": {
  13331. "type": "string"
  13332. }
  13333. },
  13334. "required": ["text", "type", "clientName", "uri"],
  13335. "additionalProperties": false
  13336. },
  13337. "FilePartSource": {
  13338. "anyOf": [
  13339. {
  13340. "$ref": "#/components/schemas/FileSource"
  13341. },
  13342. {
  13343. "$ref": "#/components/schemas/SymbolSource"
  13344. },
  13345. {
  13346. "$ref": "#/components/schemas/ResourceSource"
  13347. }
  13348. ]
  13349. },
  13350. "FilePart": {
  13351. "type": "object",
  13352. "properties": {
  13353. "id": {
  13354. "type": "string",
  13355. "pattern": "^prt"
  13356. },
  13357. "sessionID": {
  13358. "type": "string",
  13359. "pattern": "^ses"
  13360. },
  13361. "messageID": {
  13362. "type": "string",
  13363. "pattern": "^msg"
  13364. },
  13365. "type": {
  13366. "type": "string",
  13367. "enum": ["file"]
  13368. },
  13369. "mime": {
  13370. "type": "string"
  13371. },
  13372. "filename": {
  13373. "type": "string"
  13374. },
  13375. "url": {
  13376. "type": "string"
  13377. },
  13378. "source": {
  13379. "$ref": "#/components/schemas/FilePartSource"
  13380. }
  13381. },
  13382. "required": ["id", "sessionID", "messageID", "type", "mime", "url"],
  13383. "additionalProperties": false
  13384. },
  13385. "ToolStatePending": {
  13386. "type": "object",
  13387. "properties": {
  13388. "status": {
  13389. "type": "string",
  13390. "enum": ["pending"]
  13391. },
  13392. "input": {
  13393. "type": "object"
  13394. },
  13395. "raw": {
  13396. "type": "string"
  13397. }
  13398. },
  13399. "required": ["status", "input", "raw"],
  13400. "additionalProperties": false
  13401. },
  13402. "ToolStateRunning": {
  13403. "type": "object",
  13404. "properties": {
  13405. "status": {
  13406. "type": "string",
  13407. "enum": ["running"]
  13408. },
  13409. "input": {
  13410. "type": "object"
  13411. },
  13412. "title": {
  13413. "type": "string"
  13414. },
  13415. "metadata": {
  13416. "type": "object"
  13417. },
  13418. "time": {
  13419. "type": "object",
  13420. "properties": {
  13421. "start": {
  13422. "type": "integer",
  13423. "minimum": 0
  13424. }
  13425. },
  13426. "required": ["start"],
  13427. "additionalProperties": false
  13428. }
  13429. },
  13430. "required": ["status", "input", "time"],
  13431. "additionalProperties": false
  13432. },
  13433. "ToolStateCompleted": {
  13434. "type": "object",
  13435. "properties": {
  13436. "status": {
  13437. "type": "string",
  13438. "enum": ["completed"]
  13439. },
  13440. "input": {
  13441. "type": "object"
  13442. },
  13443. "output": {
  13444. "type": "string"
  13445. },
  13446. "title": {
  13447. "type": "string"
  13448. },
  13449. "metadata": {
  13450. "type": "object"
  13451. },
  13452. "time": {
  13453. "type": "object",
  13454. "properties": {
  13455. "start": {
  13456. "type": "integer",
  13457. "minimum": 0
  13458. },
  13459. "end": {
  13460. "type": "integer",
  13461. "minimum": 0
  13462. },
  13463. "compacted": {
  13464. "type": "integer",
  13465. "minimum": 0
  13466. }
  13467. },
  13468. "required": ["start", "end"],
  13469. "additionalProperties": false
  13470. },
  13471. "attachments": {
  13472. "type": "array",
  13473. "items": {
  13474. "$ref": "#/components/schemas/FilePart"
  13475. }
  13476. }
  13477. },
  13478. "required": ["status", "input", "output", "title", "metadata", "time"],
  13479. "additionalProperties": false
  13480. },
  13481. "ToolStateError": {
  13482. "type": "object",
  13483. "properties": {
  13484. "status": {
  13485. "type": "string",
  13486. "enum": ["error"]
  13487. },
  13488. "input": {
  13489. "type": "object"
  13490. },
  13491. "error": {
  13492. "type": "string"
  13493. },
  13494. "metadata": {
  13495. "type": "object"
  13496. },
  13497. "time": {
  13498. "type": "object",
  13499. "properties": {
  13500. "start": {
  13501. "type": "integer",
  13502. "minimum": 0
  13503. },
  13504. "end": {
  13505. "type": "integer",
  13506. "minimum": 0
  13507. }
  13508. },
  13509. "required": ["start", "end"],
  13510. "additionalProperties": false
  13511. }
  13512. },
  13513. "required": ["status", "input", "error", "time"],
  13514. "additionalProperties": false
  13515. },
  13516. "ToolState": {
  13517. "anyOf": [
  13518. {
  13519. "$ref": "#/components/schemas/ToolStatePending"
  13520. },
  13521. {
  13522. "$ref": "#/components/schemas/ToolStateRunning"
  13523. },
  13524. {
  13525. "$ref": "#/components/schemas/ToolStateCompleted"
  13526. },
  13527. {
  13528. "$ref": "#/components/schemas/ToolStateError"
  13529. }
  13530. ]
  13531. },
  13532. "ToolPart": {
  13533. "type": "object",
  13534. "properties": {
  13535. "id": {
  13536. "type": "string",
  13537. "pattern": "^prt"
  13538. },
  13539. "sessionID": {
  13540. "type": "string",
  13541. "pattern": "^ses"
  13542. },
  13543. "messageID": {
  13544. "type": "string",
  13545. "pattern": "^msg"
  13546. },
  13547. "type": {
  13548. "type": "string",
  13549. "enum": ["tool"]
  13550. },
  13551. "callID": {
  13552. "type": "string"
  13553. },
  13554. "tool": {
  13555. "type": "string"
  13556. },
  13557. "state": {
  13558. "$ref": "#/components/schemas/ToolState"
  13559. },
  13560. "metadata": {
  13561. "type": "object"
  13562. }
  13563. },
  13564. "required": ["id", "sessionID", "messageID", "type", "callID", "tool", "state"],
  13565. "additionalProperties": false
  13566. },
  13567. "StepStartPart": {
  13568. "type": "object",
  13569. "properties": {
  13570. "id": {
  13571. "type": "string",
  13572. "pattern": "^prt"
  13573. },
  13574. "sessionID": {
  13575. "type": "string",
  13576. "pattern": "^ses"
  13577. },
  13578. "messageID": {
  13579. "type": "string",
  13580. "pattern": "^msg"
  13581. },
  13582. "type": {
  13583. "type": "string",
  13584. "enum": ["step-start"]
  13585. },
  13586. "snapshot": {
  13587. "type": "string"
  13588. }
  13589. },
  13590. "required": ["id", "sessionID", "messageID", "type"],
  13591. "additionalProperties": false
  13592. },
  13593. "StepFinishPart": {
  13594. "type": "object",
  13595. "properties": {
  13596. "id": {
  13597. "type": "string",
  13598. "pattern": "^prt"
  13599. },
  13600. "sessionID": {
  13601. "type": "string",
  13602. "pattern": "^ses"
  13603. },
  13604. "messageID": {
  13605. "type": "string",
  13606. "pattern": "^msg"
  13607. },
  13608. "type": {
  13609. "type": "string",
  13610. "enum": ["step-finish"]
  13611. },
  13612. "reason": {
  13613. "type": "string"
  13614. },
  13615. "snapshot": {
  13616. "type": "string"
  13617. },
  13618. "cost": {
  13619. "type": "number"
  13620. },
  13621. "tokens": {
  13622. "type": "object",
  13623. "properties": {
  13624. "total": {
  13625. "type": "number"
  13626. },
  13627. "input": {
  13628. "type": "number"
  13629. },
  13630. "output": {
  13631. "type": "number"
  13632. },
  13633. "reasoning": {
  13634. "type": "number"
  13635. },
  13636. "cache": {
  13637. "type": "object",
  13638. "properties": {
  13639. "read": {
  13640. "type": "number"
  13641. },
  13642. "write": {
  13643. "type": "number"
  13644. }
  13645. },
  13646. "required": ["read", "write"],
  13647. "additionalProperties": false
  13648. }
  13649. },
  13650. "required": ["input", "output", "reasoning", "cache"],
  13651. "additionalProperties": false
  13652. }
  13653. },
  13654. "required": ["id", "sessionID", "messageID", "type", "reason", "cost", "tokens"],
  13655. "additionalProperties": false
  13656. },
  13657. "SnapshotPart": {
  13658. "type": "object",
  13659. "properties": {
  13660. "id": {
  13661. "type": "string",
  13662. "pattern": "^prt"
  13663. },
  13664. "sessionID": {
  13665. "type": "string",
  13666. "pattern": "^ses"
  13667. },
  13668. "messageID": {
  13669. "type": "string",
  13670. "pattern": "^msg"
  13671. },
  13672. "type": {
  13673. "type": "string",
  13674. "enum": ["snapshot"]
  13675. },
  13676. "snapshot": {
  13677. "type": "string"
  13678. }
  13679. },
  13680. "required": ["id", "sessionID", "messageID", "type", "snapshot"],
  13681. "additionalProperties": false
  13682. },
  13683. "PatchPart": {
  13684. "type": "object",
  13685. "properties": {
  13686. "id": {
  13687. "type": "string",
  13688. "pattern": "^prt"
  13689. },
  13690. "sessionID": {
  13691. "type": "string",
  13692. "pattern": "^ses"
  13693. },
  13694. "messageID": {
  13695. "type": "string",
  13696. "pattern": "^msg"
  13697. },
  13698. "type": {
  13699. "type": "string",
  13700. "enum": ["patch"]
  13701. },
  13702. "hash": {
  13703. "type": "string"
  13704. },
  13705. "files": {
  13706. "type": "array",
  13707. "items": {
  13708. "type": "string"
  13709. }
  13710. }
  13711. },
  13712. "required": ["id", "sessionID", "messageID", "type", "hash", "files"],
  13713. "additionalProperties": false
  13714. },
  13715. "AgentPart": {
  13716. "type": "object",
  13717. "properties": {
  13718. "id": {
  13719. "type": "string",
  13720. "pattern": "^prt"
  13721. },
  13722. "sessionID": {
  13723. "type": "string",
  13724. "pattern": "^ses"
  13725. },
  13726. "messageID": {
  13727. "type": "string",
  13728. "pattern": "^msg"
  13729. },
  13730. "type": {
  13731. "type": "string",
  13732. "enum": ["agent"]
  13733. },
  13734. "name": {
  13735. "type": "string"
  13736. },
  13737. "source": {
  13738. "type": "object",
  13739. "properties": {
  13740. "value": {
  13741. "type": "string"
  13742. },
  13743. "start": {
  13744. "type": "integer",
  13745. "minimum": 0
  13746. },
  13747. "end": {
  13748. "type": "integer",
  13749. "minimum": 0
  13750. }
  13751. },
  13752. "required": ["value", "start", "end"],
  13753. "additionalProperties": false
  13754. }
  13755. },
  13756. "required": ["id", "sessionID", "messageID", "type", "name"],
  13757. "additionalProperties": false
  13758. },
  13759. "RetryPart": {
  13760. "type": "object",
  13761. "properties": {
  13762. "id": {
  13763. "type": "string",
  13764. "pattern": "^prt"
  13765. },
  13766. "sessionID": {
  13767. "type": "string",
  13768. "pattern": "^ses"
  13769. },
  13770. "messageID": {
  13771. "type": "string",
  13772. "pattern": "^msg"
  13773. },
  13774. "type": {
  13775. "type": "string",
  13776. "enum": ["retry"]
  13777. },
  13778. "attempt": {
  13779. "type": "integer",
  13780. "minimum": 0
  13781. },
  13782. "error": {
  13783. "$ref": "#/components/schemas/APIError"
  13784. },
  13785. "time": {
  13786. "type": "object",
  13787. "properties": {
  13788. "created": {
  13789. "type": "integer",
  13790. "minimum": 0
  13791. }
  13792. },
  13793. "required": ["created"],
  13794. "additionalProperties": false
  13795. }
  13796. },
  13797. "required": ["id", "sessionID", "messageID", "type", "attempt", "error", "time"],
  13798. "additionalProperties": false
  13799. },
  13800. "CompactionPart": {
  13801. "type": "object",
  13802. "properties": {
  13803. "id": {
  13804. "type": "string",
  13805. "pattern": "^prt"
  13806. },
  13807. "sessionID": {
  13808. "type": "string",
  13809. "pattern": "^ses"
  13810. },
  13811. "messageID": {
  13812. "type": "string",
  13813. "pattern": "^msg"
  13814. },
  13815. "type": {
  13816. "type": "string",
  13817. "enum": ["compaction"]
  13818. },
  13819. "auto": {
  13820. "type": "boolean"
  13821. },
  13822. "overflow": {
  13823. "type": "boolean"
  13824. },
  13825. "tail_start_id": {
  13826. "type": "string",
  13827. "pattern": "^msg"
  13828. }
  13829. },
  13830. "required": ["id", "sessionID", "messageID", "type", "auto"],
  13831. "additionalProperties": false
  13832. },
  13833. "Part": {
  13834. "anyOf": [
  13835. {
  13836. "$ref": "#/components/schemas/TextPart"
  13837. },
  13838. {
  13839. "$ref": "#/components/schemas/SubtaskPart"
  13840. },
  13841. {
  13842. "$ref": "#/components/schemas/ReasoningPart"
  13843. },
  13844. {
  13845. "$ref": "#/components/schemas/FilePart"
  13846. },
  13847. {
  13848. "$ref": "#/components/schemas/ToolPart"
  13849. },
  13850. {
  13851. "$ref": "#/components/schemas/StepStartPart"
  13852. },
  13853. {
  13854. "$ref": "#/components/schemas/StepFinishPart"
  13855. },
  13856. {
  13857. "$ref": "#/components/schemas/SnapshotPart"
  13858. },
  13859. {
  13860. "$ref": "#/components/schemas/PatchPart"
  13861. },
  13862. {
  13863. "$ref": "#/components/schemas/AgentPart"
  13864. },
  13865. {
  13866. "$ref": "#/components/schemas/RetryPart"
  13867. },
  13868. {
  13869. "$ref": "#/components/schemas/CompactionPart"
  13870. }
  13871. ]
  13872. },
  13873. "Prompt": {
  13874. "type": "object",
  13875. "properties": {
  13876. "text": {
  13877. "type": "string"
  13878. },
  13879. "files": {
  13880. "type": "array",
  13881. "items": {
  13882. "$ref": "#/components/schemas/PromptFileAttachment"
  13883. }
  13884. },
  13885. "agents": {
  13886. "type": "array",
  13887. "items": {
  13888. "$ref": "#/components/schemas/PromptAgentAttachment"
  13889. }
  13890. },
  13891. "references": {
  13892. "type": "array",
  13893. "items": {
  13894. "$ref": "#/components/schemas/PromptReferenceAttachment"
  13895. }
  13896. }
  13897. },
  13898. "required": ["text"],
  13899. "additionalProperties": false
  13900. },
  13901. "Pty": {
  13902. "type": "object",
  13903. "properties": {
  13904. "id": {
  13905. "type": "string",
  13906. "pattern": "^pty"
  13907. },
  13908. "title": {
  13909. "type": "string"
  13910. },
  13911. "command": {
  13912. "type": "string"
  13913. },
  13914. "args": {
  13915. "type": "array",
  13916. "items": {
  13917. "type": "string"
  13918. }
  13919. },
  13920. "cwd": {
  13921. "type": "string"
  13922. },
  13923. "status": {
  13924. "type": "string",
  13925. "enum": ["running", "exited"]
  13926. },
  13927. "pid": {
  13928. "type": "integer",
  13929. "minimum": 0
  13930. }
  13931. },
  13932. "required": ["id", "title", "command", "args", "cwd", "status", "pid"],
  13933. "additionalProperties": false
  13934. },
  13935. "Todo": {
  13936. "type": "object",
  13937. "properties": {
  13938. "content": {
  13939. "type": "string",
  13940. "description": "Brief description of the task"
  13941. },
  13942. "status": {
  13943. "type": "string",
  13944. "description": "Current status of the task: pending, in_progress, completed, cancelled"
  13945. },
  13946. "priority": {
  13947. "type": "string",
  13948. "description": "Priority level of the task: high, medium, low"
  13949. }
  13950. },
  13951. "required": ["content", "status", "priority"],
  13952. "additionalProperties": false
  13953. },
  13954. "QuestionOption": {
  13955. "type": "object",
  13956. "properties": {
  13957. "label": {
  13958. "type": "string",
  13959. "description": "Display text (1-5 words, concise)"
  13960. },
  13961. "description": {
  13962. "type": "string",
  13963. "description": "Explanation of choice"
  13964. }
  13965. },
  13966. "required": ["label", "description"],
  13967. "additionalProperties": false
  13968. },
  13969. "QuestionInfo": {
  13970. "type": "object",
  13971. "properties": {
  13972. "question": {
  13973. "type": "string",
  13974. "description": "Complete question"
  13975. },
  13976. "header": {
  13977. "type": "string",
  13978. "description": "Very short label (max 30 chars)"
  13979. },
  13980. "options": {
  13981. "type": "array",
  13982. "items": {
  13983. "$ref": "#/components/schemas/QuestionOption"
  13984. },
  13985. "description": "Available choices"
  13986. },
  13987. "multiple": {
  13988. "type": "boolean"
  13989. },
  13990. "custom": {
  13991. "type": "boolean"
  13992. }
  13993. },
  13994. "required": ["question", "header", "options"],
  13995. "additionalProperties": false
  13996. },
  13997. "QuestionTool": {
  13998. "type": "object",
  13999. "properties": {
  14000. "messageID": {
  14001. "type": "string",
  14002. "pattern": "^msg"
  14003. },
  14004. "callID": {
  14005. "type": "string"
  14006. }
  14007. },
  14008. "required": ["messageID", "callID"],
  14009. "additionalProperties": false
  14010. },
  14011. "QuestionAnswer": {
  14012. "type": "array",
  14013. "items": {
  14014. "type": "string"
  14015. }
  14016. },
  14017. "SessionStatus": {
  14018. "anyOf": [
  14019. {
  14020. "type": "object",
  14021. "properties": {
  14022. "type": {
  14023. "type": "string",
  14024. "enum": ["idle"]
  14025. }
  14026. },
  14027. "required": ["type"],
  14028. "additionalProperties": false
  14029. },
  14030. {
  14031. "type": "object",
  14032. "properties": {
  14033. "type": {
  14034. "type": "string",
  14035. "enum": ["retry"]
  14036. },
  14037. "attempt": {
  14038. "type": "integer",
  14039. "minimum": 0
  14040. },
  14041. "message": {
  14042. "type": "string"
  14043. },
  14044. "action": {
  14045. "type": "object",
  14046. "properties": {
  14047. "reason": {
  14048. "type": "string"
  14049. },
  14050. "provider": {
  14051. "type": "string"
  14052. },
  14053. "title": {
  14054. "type": "string"
  14055. },
  14056. "message": {
  14057. "type": "string"
  14058. },
  14059. "label": {
  14060. "type": "string"
  14061. },
  14062. "link": {
  14063. "type": "string"
  14064. }
  14065. },
  14066. "required": ["reason", "provider", "title", "message", "label"],
  14067. "additionalProperties": false
  14068. },
  14069. "next": {
  14070. "type": "integer",
  14071. "minimum": 0
  14072. }
  14073. },
  14074. "required": ["type", "attempt", "message", "next"],
  14075. "additionalProperties": false
  14076. },
  14077. {
  14078. "type": "object",
  14079. "properties": {
  14080. "type": {
  14081. "type": "string",
  14082. "enum": ["busy"]
  14083. }
  14084. },
  14085. "required": ["type"],
  14086. "additionalProperties": false
  14087. }
  14088. ]
  14089. },
  14090. "GlobalEvent": {
  14091. "type": "object",
  14092. "properties": {
  14093. "directory": {
  14094. "type": "string"
  14095. },
  14096. "project": {
  14097. "type": "string"
  14098. },
  14099. "workspace": {
  14100. "type": "string"
  14101. },
  14102. "payload": {
  14103. "anyOf": [
  14104. {
  14105. "type": "object",
  14106. "properties": {
  14107. "id": {
  14108. "type": "string",
  14109. "pattern": "^evt_"
  14110. },
  14111. "type": {
  14112. "type": "string",
  14113. "enum": ["models-dev.refreshed"]
  14114. },
  14115. "properties": {
  14116. "type": "object",
  14117. "properties": {}
  14118. }
  14119. },
  14120. "required": ["id", "type", "properties"],
  14121. "additionalProperties": false
  14122. },
  14123. {
  14124. "type": "object",
  14125. "properties": {
  14126. "id": {
  14127. "type": "string",
  14128. "pattern": "^evt_"
  14129. },
  14130. "type": {
  14131. "type": "string",
  14132. "enum": ["plugin.added"]
  14133. },
  14134. "properties": {
  14135. "type": "object",
  14136. "properties": {
  14137. "id": {
  14138. "type": "string"
  14139. }
  14140. },
  14141. "required": ["id"],
  14142. "additionalProperties": false
  14143. }
  14144. },
  14145. "required": ["id", "type", "properties"],
  14146. "additionalProperties": false
  14147. },
  14148. {
  14149. "type": "object",
  14150. "properties": {
  14151. "id": {
  14152. "type": "string",
  14153. "pattern": "^evt_"
  14154. },
  14155. "type": {
  14156. "type": "string",
  14157. "enum": ["catalog.model.updated"]
  14158. },
  14159. "properties": {
  14160. "type": "object",
  14161. "properties": {
  14162. "model": {
  14163. "$ref": "#/components/schemas/ModelV2Info"
  14164. }
  14165. },
  14166. "required": ["model"],
  14167. "additionalProperties": false
  14168. }
  14169. },
  14170. "required": ["id", "type", "properties"],
  14171. "additionalProperties": false
  14172. },
  14173. {
  14174. "type": "object",
  14175. "properties": {
  14176. "id": {
  14177. "type": "string",
  14178. "pattern": "^evt_"
  14179. },
  14180. "type": {
  14181. "type": "string",
  14182. "enum": ["session.created"]
  14183. },
  14184. "properties": {
  14185. "type": "object",
  14186. "properties": {
  14187. "sessionID": {
  14188. "type": "string",
  14189. "pattern": "^ses"
  14190. },
  14191. "info": {
  14192. "$ref": "#/components/schemas/Session"
  14193. }
  14194. },
  14195. "required": ["sessionID", "info"],
  14196. "additionalProperties": false
  14197. }
  14198. },
  14199. "required": ["id", "type", "properties"],
  14200. "additionalProperties": false
  14201. },
  14202. {
  14203. "type": "object",
  14204. "properties": {
  14205. "id": {
  14206. "type": "string",
  14207. "pattern": "^evt_"
  14208. },
  14209. "type": {
  14210. "type": "string",
  14211. "enum": ["session.updated"]
  14212. },
  14213. "properties": {
  14214. "type": "object",
  14215. "properties": {
  14216. "sessionID": {
  14217. "type": "string",
  14218. "pattern": "^ses"
  14219. },
  14220. "info": {
  14221. "$ref": "#/components/schemas/Session"
  14222. }
  14223. },
  14224. "required": ["sessionID", "info"],
  14225. "additionalProperties": false
  14226. }
  14227. },
  14228. "required": ["id", "type", "properties"],
  14229. "additionalProperties": false
  14230. },
  14231. {
  14232. "type": "object",
  14233. "properties": {
  14234. "id": {
  14235. "type": "string",
  14236. "pattern": "^evt_"
  14237. },
  14238. "type": {
  14239. "type": "string",
  14240. "enum": ["session.deleted"]
  14241. },
  14242. "properties": {
  14243. "type": "object",
  14244. "properties": {
  14245. "sessionID": {
  14246. "type": "string",
  14247. "pattern": "^ses"
  14248. },
  14249. "info": {
  14250. "$ref": "#/components/schemas/Session"
  14251. }
  14252. },
  14253. "required": ["sessionID", "info"],
  14254. "additionalProperties": false
  14255. }
  14256. },
  14257. "required": ["id", "type", "properties"],
  14258. "additionalProperties": false
  14259. },
  14260. {
  14261. "type": "object",
  14262. "properties": {
  14263. "id": {
  14264. "type": "string",
  14265. "pattern": "^evt_"
  14266. },
  14267. "type": {
  14268. "type": "string",
  14269. "enum": ["message.updated"]
  14270. },
  14271. "properties": {
  14272. "type": "object",
  14273. "properties": {
  14274. "sessionID": {
  14275. "type": "string",
  14276. "pattern": "^ses"
  14277. },
  14278. "info": {
  14279. "$ref": "#/components/schemas/Message"
  14280. }
  14281. },
  14282. "required": ["sessionID", "info"],
  14283. "additionalProperties": false
  14284. }
  14285. },
  14286. "required": ["id", "type", "properties"],
  14287. "additionalProperties": false
  14288. },
  14289. {
  14290. "type": "object",
  14291. "properties": {
  14292. "id": {
  14293. "type": "string",
  14294. "pattern": "^evt_"
  14295. },
  14296. "type": {
  14297. "type": "string",
  14298. "enum": ["message.removed"]
  14299. },
  14300. "properties": {
  14301. "type": "object",
  14302. "properties": {
  14303. "sessionID": {
  14304. "type": "string",
  14305. "pattern": "^ses"
  14306. },
  14307. "messageID": {
  14308. "type": "string",
  14309. "pattern": "^msg"
  14310. }
  14311. },
  14312. "required": ["sessionID", "messageID"],
  14313. "additionalProperties": false
  14314. }
  14315. },
  14316. "required": ["id", "type", "properties"],
  14317. "additionalProperties": false
  14318. },
  14319. {
  14320. "type": "object",
  14321. "properties": {
  14322. "id": {
  14323. "type": "string",
  14324. "pattern": "^evt_"
  14325. },
  14326. "type": {
  14327. "type": "string",
  14328. "enum": ["message.part.updated"]
  14329. },
  14330. "properties": {
  14331. "type": "object",
  14332. "properties": {
  14333. "sessionID": {
  14334. "type": "string",
  14335. "pattern": "^ses"
  14336. },
  14337. "part": {
  14338. "$ref": "#/components/schemas/Part"
  14339. },
  14340. "time": {
  14341. "type": "number"
  14342. }
  14343. },
  14344. "required": ["sessionID", "part", "time"],
  14345. "additionalProperties": false
  14346. }
  14347. },
  14348. "required": ["id", "type", "properties"],
  14349. "additionalProperties": false
  14350. },
  14351. {
  14352. "type": "object",
  14353. "properties": {
  14354. "id": {
  14355. "type": "string",
  14356. "pattern": "^evt_"
  14357. },
  14358. "type": {
  14359. "type": "string",
  14360. "enum": ["message.part.removed"]
  14361. },
  14362. "properties": {
  14363. "type": "object",
  14364. "properties": {
  14365. "sessionID": {
  14366. "type": "string",
  14367. "pattern": "^ses"
  14368. },
  14369. "messageID": {
  14370. "type": "string",
  14371. "pattern": "^msg"
  14372. },
  14373. "partID": {
  14374. "type": "string",
  14375. "pattern": "^prt"
  14376. }
  14377. },
  14378. "required": ["sessionID", "messageID", "partID"],
  14379. "additionalProperties": false
  14380. }
  14381. },
  14382. "required": ["id", "type", "properties"],
  14383. "additionalProperties": false
  14384. },
  14385. {
  14386. "type": "object",
  14387. "properties": {
  14388. "id": {
  14389. "type": "string",
  14390. "pattern": "^evt_"
  14391. },
  14392. "type": {
  14393. "type": "string",
  14394. "enum": ["session.next.agent.switched"]
  14395. },
  14396. "properties": {
  14397. "type": "object",
  14398. "properties": {
  14399. "timestamp": {
  14400. "type": "number"
  14401. },
  14402. "sessionID": {
  14403. "type": "string",
  14404. "pattern": "^ses"
  14405. },
  14406. "messageID": {
  14407. "type": "string",
  14408. "pattern": "^msg_"
  14409. },
  14410. "agent": {
  14411. "type": "string"
  14412. }
  14413. },
  14414. "required": ["timestamp", "sessionID", "messageID", "agent"],
  14415. "additionalProperties": false
  14416. }
  14417. },
  14418. "required": ["id", "type", "properties"],
  14419. "additionalProperties": false
  14420. },
  14421. {
  14422. "type": "object",
  14423. "properties": {
  14424. "id": {
  14425. "type": "string",
  14426. "pattern": "^evt_"
  14427. },
  14428. "type": {
  14429. "type": "string",
  14430. "enum": ["session.next.model.switched"]
  14431. },
  14432. "properties": {
  14433. "type": "object",
  14434. "properties": {
  14435. "timestamp": {
  14436. "type": "number"
  14437. },
  14438. "sessionID": {
  14439. "type": "string",
  14440. "pattern": "^ses"
  14441. },
  14442. "messageID": {
  14443. "type": "string",
  14444. "pattern": "^msg_"
  14445. },
  14446. "model": {
  14447. "type": "object",
  14448. "properties": {
  14449. "id": {
  14450. "type": "string"
  14451. },
  14452. "providerID": {
  14453. "type": "string"
  14454. },
  14455. "variant": {
  14456. "type": "string"
  14457. }
  14458. },
  14459. "required": ["id", "providerID"],
  14460. "additionalProperties": false
  14461. }
  14462. },
  14463. "required": ["timestamp", "sessionID", "messageID", "model"],
  14464. "additionalProperties": false
  14465. }
  14466. },
  14467. "required": ["id", "type", "properties"],
  14468. "additionalProperties": false
  14469. },
  14470. {
  14471. "type": "object",
  14472. "properties": {
  14473. "id": {
  14474. "type": "string",
  14475. "pattern": "^evt_"
  14476. },
  14477. "type": {
  14478. "type": "string",
  14479. "enum": ["session.next.moved"]
  14480. },
  14481. "properties": {
  14482. "type": "object",
  14483. "properties": {
  14484. "timestamp": {
  14485. "type": "number"
  14486. },
  14487. "sessionID": {
  14488. "type": "string",
  14489. "pattern": "^ses"
  14490. },
  14491. "location": {
  14492. "$ref": "#/components/schemas/LocationRef"
  14493. },
  14494. "subdirectory": {
  14495. "type": "string"
  14496. }
  14497. },
  14498. "required": ["timestamp", "sessionID", "location"],
  14499. "additionalProperties": false
  14500. }
  14501. },
  14502. "required": ["id", "type", "properties"],
  14503. "additionalProperties": false
  14504. },
  14505. {
  14506. "type": "object",
  14507. "properties": {
  14508. "id": {
  14509. "type": "string",
  14510. "pattern": "^evt_"
  14511. },
  14512. "type": {
  14513. "type": "string",
  14514. "enum": ["session.next.prompted"]
  14515. },
  14516. "properties": {
  14517. "type": "object",
  14518. "properties": {
  14519. "timestamp": {
  14520. "type": "number"
  14521. },
  14522. "sessionID": {
  14523. "type": "string",
  14524. "pattern": "^ses"
  14525. },
  14526. "messageID": {
  14527. "type": "string",
  14528. "pattern": "^msg_"
  14529. },
  14530. "prompt": {
  14531. "$ref": "#/components/schemas/Prompt"
  14532. },
  14533. "delivery": {
  14534. "type": "string",
  14535. "enum": ["steer", "queue"]
  14536. }
  14537. },
  14538. "required": ["timestamp", "sessionID", "messageID", "prompt", "delivery"],
  14539. "additionalProperties": false
  14540. }
  14541. },
  14542. "required": ["id", "type", "properties"],
  14543. "additionalProperties": false
  14544. },
  14545. {
  14546. "type": "object",
  14547. "properties": {
  14548. "id": {
  14549. "type": "string",
  14550. "pattern": "^evt_"
  14551. },
  14552. "type": {
  14553. "type": "string",
  14554. "enum": ["session.next.prompt.admitted"]
  14555. },
  14556. "properties": {
  14557. "type": "object",
  14558. "properties": {
  14559. "timestamp": {
  14560. "type": "number"
  14561. },
  14562. "sessionID": {
  14563. "type": "string",
  14564. "pattern": "^ses"
  14565. },
  14566. "messageID": {
  14567. "type": "string",
  14568. "pattern": "^msg_"
  14569. },
  14570. "prompt": {
  14571. "$ref": "#/components/schemas/Prompt"
  14572. },
  14573. "delivery": {
  14574. "type": "string",
  14575. "enum": ["steer", "queue"]
  14576. }
  14577. },
  14578. "required": ["timestamp", "sessionID", "messageID", "prompt", "delivery"],
  14579. "additionalProperties": false
  14580. }
  14581. },
  14582. "required": ["id", "type", "properties"],
  14583. "additionalProperties": false
  14584. },
  14585. {
  14586. "type": "object",
  14587. "properties": {
  14588. "id": {
  14589. "type": "string",
  14590. "pattern": "^evt_"
  14591. },
  14592. "type": {
  14593. "type": "string",
  14594. "enum": ["session.next.prompt.promoted"]
  14595. },
  14596. "properties": {
  14597. "type": "object",
  14598. "properties": {
  14599. "timestamp": {
  14600. "type": "number"
  14601. },
  14602. "sessionID": {
  14603. "type": "string",
  14604. "pattern": "^ses"
  14605. },
  14606. "messageID": {
  14607. "type": "string",
  14608. "pattern": "^msg_"
  14609. },
  14610. "prompt": {
  14611. "$ref": "#/components/schemas/Prompt"
  14612. },
  14613. "timeCreated": {
  14614. "type": "number"
  14615. }
  14616. },
  14617. "required": ["timestamp", "sessionID", "messageID", "prompt", "timeCreated"],
  14618. "additionalProperties": false
  14619. }
  14620. },
  14621. "required": ["id", "type", "properties"],
  14622. "additionalProperties": false
  14623. },
  14624. {
  14625. "type": "object",
  14626. "properties": {
  14627. "id": {
  14628. "type": "string",
  14629. "pattern": "^evt_"
  14630. },
  14631. "type": {
  14632. "type": "string",
  14633. "enum": ["session.next.synthetic"]
  14634. },
  14635. "properties": {
  14636. "type": "object",
  14637. "properties": {
  14638. "timestamp": {
  14639. "type": "number"
  14640. },
  14641. "sessionID": {
  14642. "type": "string",
  14643. "pattern": "^ses"
  14644. },
  14645. "messageID": {
  14646. "type": "string",
  14647. "pattern": "^msg_"
  14648. },
  14649. "text": {
  14650. "type": "string"
  14651. }
  14652. },
  14653. "required": ["timestamp", "sessionID", "messageID", "text"],
  14654. "additionalProperties": false
  14655. }
  14656. },
  14657. "required": ["id", "type", "properties"],
  14658. "additionalProperties": false
  14659. },
  14660. {
  14661. "type": "object",
  14662. "properties": {
  14663. "id": {
  14664. "type": "string",
  14665. "pattern": "^evt_"
  14666. },
  14667. "type": {
  14668. "type": "string",
  14669. "enum": ["session.next.shell.started"]
  14670. },
  14671. "properties": {
  14672. "type": "object",
  14673. "properties": {
  14674. "timestamp": {
  14675. "type": "number"
  14676. },
  14677. "sessionID": {
  14678. "type": "string",
  14679. "pattern": "^ses"
  14680. },
  14681. "messageID": {
  14682. "type": "string",
  14683. "pattern": "^msg_"
  14684. },
  14685. "callID": {
  14686. "type": "string"
  14687. },
  14688. "command": {
  14689. "type": "string"
  14690. }
  14691. },
  14692. "required": ["timestamp", "sessionID", "messageID", "callID", "command"],
  14693. "additionalProperties": false
  14694. }
  14695. },
  14696. "required": ["id", "type", "properties"],
  14697. "additionalProperties": false
  14698. },
  14699. {
  14700. "type": "object",
  14701. "properties": {
  14702. "id": {
  14703. "type": "string",
  14704. "pattern": "^evt_"
  14705. },
  14706. "type": {
  14707. "type": "string",
  14708. "enum": ["session.next.shell.ended"]
  14709. },
  14710. "properties": {
  14711. "type": "object",
  14712. "properties": {
  14713. "timestamp": {
  14714. "type": "number"
  14715. },
  14716. "sessionID": {
  14717. "type": "string",
  14718. "pattern": "^ses"
  14719. },
  14720. "callID": {
  14721. "type": "string"
  14722. },
  14723. "output": {
  14724. "type": "string"
  14725. }
  14726. },
  14727. "required": ["timestamp", "sessionID", "callID", "output"],
  14728. "additionalProperties": false
  14729. }
  14730. },
  14731. "required": ["id", "type", "properties"],
  14732. "additionalProperties": false
  14733. },
  14734. {
  14735. "type": "object",
  14736. "properties": {
  14737. "id": {
  14738. "type": "string",
  14739. "pattern": "^evt_"
  14740. },
  14741. "type": {
  14742. "type": "string",
  14743. "enum": ["session.next.step.started"]
  14744. },
  14745. "properties": {
  14746. "type": "object",
  14747. "properties": {
  14748. "timestamp": {
  14749. "type": "number"
  14750. },
  14751. "sessionID": {
  14752. "type": "string",
  14753. "pattern": "^ses"
  14754. },
  14755. "assistantMessageID": {
  14756. "type": "string",
  14757. "pattern": "^msg_"
  14758. },
  14759. "agent": {
  14760. "type": "string"
  14761. },
  14762. "model": {
  14763. "type": "object",
  14764. "properties": {
  14765. "id": {
  14766. "type": "string"
  14767. },
  14768. "providerID": {
  14769. "type": "string"
  14770. },
  14771. "variant": {
  14772. "type": "string"
  14773. }
  14774. },
  14775. "required": ["id", "providerID"],
  14776. "additionalProperties": false
  14777. },
  14778. "snapshot": {
  14779. "type": "string"
  14780. }
  14781. },
  14782. "required": ["timestamp", "sessionID", "assistantMessageID", "agent", "model"],
  14783. "additionalProperties": false
  14784. }
  14785. },
  14786. "required": ["id", "type", "properties"],
  14787. "additionalProperties": false
  14788. },
  14789. {
  14790. "type": "object",
  14791. "properties": {
  14792. "id": {
  14793. "type": "string",
  14794. "pattern": "^evt_"
  14795. },
  14796. "type": {
  14797. "type": "string",
  14798. "enum": ["session.next.step.ended"]
  14799. },
  14800. "properties": {
  14801. "type": "object",
  14802. "properties": {
  14803. "timestamp": {
  14804. "type": "number"
  14805. },
  14806. "sessionID": {
  14807. "type": "string",
  14808. "pattern": "^ses"
  14809. },
  14810. "assistantMessageID": {
  14811. "type": "string",
  14812. "pattern": "^msg_"
  14813. },
  14814. "finish": {
  14815. "type": "string"
  14816. },
  14817. "cost": {
  14818. "type": "number"
  14819. },
  14820. "tokens": {
  14821. "type": "object",
  14822. "properties": {
  14823. "input": {
  14824. "type": "number"
  14825. },
  14826. "output": {
  14827. "type": "number"
  14828. },
  14829. "reasoning": {
  14830. "type": "number"
  14831. },
  14832. "cache": {
  14833. "type": "object",
  14834. "properties": {
  14835. "read": {
  14836. "type": "number"
  14837. },
  14838. "write": {
  14839. "type": "number"
  14840. }
  14841. },
  14842. "required": ["read", "write"],
  14843. "additionalProperties": false
  14844. }
  14845. },
  14846. "required": ["input", "output", "reasoning", "cache"],
  14847. "additionalProperties": false
  14848. },
  14849. "snapshot": {
  14850. "type": "string"
  14851. }
  14852. },
  14853. "required": ["timestamp", "sessionID", "assistantMessageID", "finish", "cost", "tokens"],
  14854. "additionalProperties": false
  14855. }
  14856. },
  14857. "required": ["id", "type", "properties"],
  14858. "additionalProperties": false
  14859. },
  14860. {
  14861. "type": "object",
  14862. "properties": {
  14863. "id": {
  14864. "type": "string",
  14865. "pattern": "^evt_"
  14866. },
  14867. "type": {
  14868. "type": "string",
  14869. "enum": ["session.next.step.failed"]
  14870. },
  14871. "properties": {
  14872. "type": "object",
  14873. "properties": {
  14874. "timestamp": {
  14875. "type": "number"
  14876. },
  14877. "sessionID": {
  14878. "type": "string",
  14879. "pattern": "^ses"
  14880. },
  14881. "assistantMessageID": {
  14882. "type": "string",
  14883. "pattern": "^msg_"
  14884. },
  14885. "error": {
  14886. "$ref": "#/components/schemas/SessionErrorUnknown"
  14887. }
  14888. },
  14889. "required": ["timestamp", "sessionID", "assistantMessageID", "error"],
  14890. "additionalProperties": false
  14891. }
  14892. },
  14893. "required": ["id", "type", "properties"],
  14894. "additionalProperties": false
  14895. },
  14896. {
  14897. "type": "object",
  14898. "properties": {
  14899. "id": {
  14900. "type": "string",
  14901. "pattern": "^evt_"
  14902. },
  14903. "type": {
  14904. "type": "string",
  14905. "enum": ["session.next.text.started"]
  14906. },
  14907. "properties": {
  14908. "type": "object",
  14909. "properties": {
  14910. "timestamp": {
  14911. "type": "number"
  14912. },
  14913. "sessionID": {
  14914. "type": "string",
  14915. "pattern": "^ses"
  14916. },
  14917. "assistantMessageID": {
  14918. "type": "string",
  14919. "pattern": "^msg_"
  14920. },
  14921. "textID": {
  14922. "type": "string"
  14923. }
  14924. },
  14925. "required": ["timestamp", "sessionID", "assistantMessageID", "textID"],
  14926. "additionalProperties": false
  14927. }
  14928. },
  14929. "required": ["id", "type", "properties"],
  14930. "additionalProperties": false
  14931. },
  14932. {
  14933. "type": "object",
  14934. "properties": {
  14935. "id": {
  14936. "type": "string",
  14937. "pattern": "^evt_"
  14938. },
  14939. "type": {
  14940. "type": "string",
  14941. "enum": ["session.next.text.delta"]
  14942. },
  14943. "properties": {
  14944. "type": "object",
  14945. "properties": {
  14946. "timestamp": {
  14947. "type": "number"
  14948. },
  14949. "sessionID": {
  14950. "type": "string",
  14951. "pattern": "^ses"
  14952. },
  14953. "assistantMessageID": {
  14954. "type": "string",
  14955. "pattern": "^msg_"
  14956. },
  14957. "textID": {
  14958. "type": "string"
  14959. },
  14960. "delta": {
  14961. "type": "string"
  14962. }
  14963. },
  14964. "required": ["timestamp", "sessionID", "assistantMessageID", "textID", "delta"],
  14965. "additionalProperties": false
  14966. }
  14967. },
  14968. "required": ["id", "type", "properties"],
  14969. "additionalProperties": false
  14970. },
  14971. {
  14972. "type": "object",
  14973. "properties": {
  14974. "id": {
  14975. "type": "string",
  14976. "pattern": "^evt_"
  14977. },
  14978. "type": {
  14979. "type": "string",
  14980. "enum": ["session.next.text.ended"]
  14981. },
  14982. "properties": {
  14983. "type": "object",
  14984. "properties": {
  14985. "timestamp": {
  14986. "type": "number"
  14987. },
  14988. "sessionID": {
  14989. "type": "string",
  14990. "pattern": "^ses"
  14991. },
  14992. "assistantMessageID": {
  14993. "type": "string",
  14994. "pattern": "^msg_"
  14995. },
  14996. "textID": {
  14997. "type": "string"
  14998. },
  14999. "text": {
  15000. "type": "string"
  15001. }
  15002. },
  15003. "required": ["timestamp", "sessionID", "assistantMessageID", "textID", "text"],
  15004. "additionalProperties": false
  15005. }
  15006. },
  15007. "required": ["id", "type", "properties"],
  15008. "additionalProperties": false
  15009. },
  15010. {
  15011. "type": "object",
  15012. "properties": {
  15013. "id": {
  15014. "type": "string",
  15015. "pattern": "^evt_"
  15016. },
  15017. "type": {
  15018. "type": "string",
  15019. "enum": ["session.next.reasoning.started"]
  15020. },
  15021. "properties": {
  15022. "type": "object",
  15023. "properties": {
  15024. "timestamp": {
  15025. "type": "number"
  15026. },
  15027. "sessionID": {
  15028. "type": "string",
  15029. "pattern": "^ses"
  15030. },
  15031. "assistantMessageID": {
  15032. "type": "string",
  15033. "pattern": "^msg_"
  15034. },
  15035. "reasoningID": {
  15036. "type": "string"
  15037. },
  15038. "providerMetadata": {
  15039. "type": "object",
  15040. "additionalProperties": {
  15041. "type": "object"
  15042. }
  15043. }
  15044. },
  15045. "required": ["timestamp", "sessionID", "assistantMessageID", "reasoningID"],
  15046. "additionalProperties": false
  15047. }
  15048. },
  15049. "required": ["id", "type", "properties"],
  15050. "additionalProperties": false
  15051. },
  15052. {
  15053. "type": "object",
  15054. "properties": {
  15055. "id": {
  15056. "type": "string",
  15057. "pattern": "^evt_"
  15058. },
  15059. "type": {
  15060. "type": "string",
  15061. "enum": ["session.next.reasoning.delta"]
  15062. },
  15063. "properties": {
  15064. "type": "object",
  15065. "properties": {
  15066. "timestamp": {
  15067. "type": "number"
  15068. },
  15069. "sessionID": {
  15070. "type": "string",
  15071. "pattern": "^ses"
  15072. },
  15073. "assistantMessageID": {
  15074. "type": "string",
  15075. "pattern": "^msg_"
  15076. },
  15077. "reasoningID": {
  15078. "type": "string"
  15079. },
  15080. "delta": {
  15081. "type": "string"
  15082. }
  15083. },
  15084. "required": ["timestamp", "sessionID", "assistantMessageID", "reasoningID", "delta"],
  15085. "additionalProperties": false
  15086. }
  15087. },
  15088. "required": ["id", "type", "properties"],
  15089. "additionalProperties": false
  15090. },
  15091. {
  15092. "type": "object",
  15093. "properties": {
  15094. "id": {
  15095. "type": "string",
  15096. "pattern": "^evt_"
  15097. },
  15098. "type": {
  15099. "type": "string",
  15100. "enum": ["session.next.reasoning.ended"]
  15101. },
  15102. "properties": {
  15103. "type": "object",
  15104. "properties": {
  15105. "timestamp": {
  15106. "type": "number"
  15107. },
  15108. "sessionID": {
  15109. "type": "string",
  15110. "pattern": "^ses"
  15111. },
  15112. "assistantMessageID": {
  15113. "type": "string",
  15114. "pattern": "^msg_"
  15115. },
  15116. "reasoningID": {
  15117. "type": "string"
  15118. },
  15119. "text": {
  15120. "type": "string"
  15121. },
  15122. "providerMetadata": {
  15123. "type": "object",
  15124. "additionalProperties": {
  15125. "type": "object"
  15126. }
  15127. }
  15128. },
  15129. "required": ["timestamp", "sessionID", "assistantMessageID", "reasoningID", "text"],
  15130. "additionalProperties": false
  15131. }
  15132. },
  15133. "required": ["id", "type", "properties"],
  15134. "additionalProperties": false
  15135. },
  15136. {
  15137. "type": "object",
  15138. "properties": {
  15139. "id": {
  15140. "type": "string",
  15141. "pattern": "^evt_"
  15142. },
  15143. "type": {
  15144. "type": "string",
  15145. "enum": ["session.next.tool.input.started"]
  15146. },
  15147. "properties": {
  15148. "type": "object",
  15149. "properties": {
  15150. "timestamp": {
  15151. "type": "number"
  15152. },
  15153. "sessionID": {
  15154. "type": "string",
  15155. "pattern": "^ses"
  15156. },
  15157. "assistantMessageID": {
  15158. "type": "string",
  15159. "pattern": "^msg_"
  15160. },
  15161. "callID": {
  15162. "type": "string"
  15163. },
  15164. "name": {
  15165. "type": "string"
  15166. }
  15167. },
  15168. "required": ["timestamp", "sessionID", "assistantMessageID", "callID", "name"],
  15169. "additionalProperties": false
  15170. }
  15171. },
  15172. "required": ["id", "type", "properties"],
  15173. "additionalProperties": false
  15174. },
  15175. {
  15176. "type": "object",
  15177. "properties": {
  15178. "id": {
  15179. "type": "string",
  15180. "pattern": "^evt_"
  15181. },
  15182. "type": {
  15183. "type": "string",
  15184. "enum": ["session.next.tool.input.delta"]
  15185. },
  15186. "properties": {
  15187. "type": "object",
  15188. "properties": {
  15189. "timestamp": {
  15190. "type": "number"
  15191. },
  15192. "sessionID": {
  15193. "type": "string",
  15194. "pattern": "^ses"
  15195. },
  15196. "assistantMessageID": {
  15197. "type": "string",
  15198. "pattern": "^msg_"
  15199. },
  15200. "callID": {
  15201. "type": "string"
  15202. },
  15203. "delta": {
  15204. "type": "string"
  15205. }
  15206. },
  15207. "required": ["timestamp", "sessionID", "assistantMessageID", "callID", "delta"],
  15208. "additionalProperties": false
  15209. }
  15210. },
  15211. "required": ["id", "type", "properties"],
  15212. "additionalProperties": false
  15213. },
  15214. {
  15215. "type": "object",
  15216. "properties": {
  15217. "id": {
  15218. "type": "string",
  15219. "pattern": "^evt_"
  15220. },
  15221. "type": {
  15222. "type": "string",
  15223. "enum": ["session.next.tool.input.ended"]
  15224. },
  15225. "properties": {
  15226. "type": "object",
  15227. "properties": {
  15228. "timestamp": {
  15229. "type": "number"
  15230. },
  15231. "sessionID": {
  15232. "type": "string",
  15233. "pattern": "^ses"
  15234. },
  15235. "assistantMessageID": {
  15236. "type": "string",
  15237. "pattern": "^msg_"
  15238. },
  15239. "callID": {
  15240. "type": "string"
  15241. },
  15242. "text": {
  15243. "type": "string"
  15244. }
  15245. },
  15246. "required": ["timestamp", "sessionID", "assistantMessageID", "callID", "text"],
  15247. "additionalProperties": false
  15248. }
  15249. },
  15250. "required": ["id", "type", "properties"],
  15251. "additionalProperties": false
  15252. },
  15253. {
  15254. "type": "object",
  15255. "properties": {
  15256. "id": {
  15257. "type": "string",
  15258. "pattern": "^evt_"
  15259. },
  15260. "type": {
  15261. "type": "string",
  15262. "enum": ["session.next.tool.called"]
  15263. },
  15264. "properties": {
  15265. "type": "object",
  15266. "properties": {
  15267. "timestamp": {
  15268. "type": "number"
  15269. },
  15270. "sessionID": {
  15271. "type": "string",
  15272. "pattern": "^ses"
  15273. },
  15274. "assistantMessageID": {
  15275. "type": "string",
  15276. "pattern": "^msg_"
  15277. },
  15278. "callID": {
  15279. "type": "string"
  15280. },
  15281. "tool": {
  15282. "type": "string"
  15283. },
  15284. "input": {
  15285. "type": "object"
  15286. },
  15287. "provider": {
  15288. "type": "object",
  15289. "properties": {
  15290. "executed": {
  15291. "type": "boolean"
  15292. },
  15293. "metadata": {
  15294. "type": "object",
  15295. "additionalProperties": {
  15296. "type": "object"
  15297. }
  15298. }
  15299. },
  15300. "required": ["executed"],
  15301. "additionalProperties": false
  15302. }
  15303. },
  15304. "required": ["timestamp", "sessionID", "assistantMessageID", "callID", "tool", "input", "provider"],
  15305. "additionalProperties": false
  15306. }
  15307. },
  15308. "required": ["id", "type", "properties"],
  15309. "additionalProperties": false
  15310. },
  15311. {
  15312. "type": "object",
  15313. "properties": {
  15314. "id": {
  15315. "type": "string",
  15316. "pattern": "^evt_"
  15317. },
  15318. "type": {
  15319. "type": "string",
  15320. "enum": ["session.next.tool.progress"]
  15321. },
  15322. "properties": {
  15323. "type": "object",
  15324. "properties": {
  15325. "timestamp": {
  15326. "type": "number"
  15327. },
  15328. "sessionID": {
  15329. "type": "string",
  15330. "pattern": "^ses"
  15331. },
  15332. "assistantMessageID": {
  15333. "type": "string",
  15334. "pattern": "^msg_"
  15335. },
  15336. "callID": {
  15337. "type": "string"
  15338. },
  15339. "structured": {
  15340. "type": "object"
  15341. },
  15342. "content": {
  15343. "type": "array",
  15344. "items": {
  15345. "anyOf": [
  15346. {
  15347. "$ref": "#/components/schemas/ToolTextContent"
  15348. },
  15349. {
  15350. "$ref": "#/components/schemas/ToolFileContent"
  15351. }
  15352. ]
  15353. }
  15354. }
  15355. },
  15356. "required": ["timestamp", "sessionID", "assistantMessageID", "callID", "structured", "content"],
  15357. "additionalProperties": false
  15358. }
  15359. },
  15360. "required": ["id", "type", "properties"],
  15361. "additionalProperties": false
  15362. },
  15363. {
  15364. "type": "object",
  15365. "properties": {
  15366. "id": {
  15367. "type": "string",
  15368. "pattern": "^evt_"
  15369. },
  15370. "type": {
  15371. "type": "string",
  15372. "enum": ["session.next.tool.success"]
  15373. },
  15374. "properties": {
  15375. "type": "object",
  15376. "properties": {
  15377. "timestamp": {
  15378. "type": "number"
  15379. },
  15380. "sessionID": {
  15381. "type": "string",
  15382. "pattern": "^ses"
  15383. },
  15384. "assistantMessageID": {
  15385. "type": "string",
  15386. "pattern": "^msg_"
  15387. },
  15388. "callID": {
  15389. "type": "string"
  15390. },
  15391. "structured": {
  15392. "type": "object"
  15393. },
  15394. "content": {
  15395. "type": "array",
  15396. "items": {
  15397. "anyOf": [
  15398. {
  15399. "$ref": "#/components/schemas/ToolTextContent"
  15400. },
  15401. {
  15402. "$ref": "#/components/schemas/ToolFileContent"
  15403. }
  15404. ]
  15405. }
  15406. },
  15407. "result": {},
  15408. "provider": {
  15409. "type": "object",
  15410. "properties": {
  15411. "executed": {
  15412. "type": "boolean"
  15413. },
  15414. "metadata": {
  15415. "type": "object",
  15416. "additionalProperties": {
  15417. "type": "object"
  15418. }
  15419. }
  15420. },
  15421. "required": ["executed"],
  15422. "additionalProperties": false
  15423. }
  15424. },
  15425. "required": [
  15426. "timestamp",
  15427. "sessionID",
  15428. "assistantMessageID",
  15429. "callID",
  15430. "structured",
  15431. "content",
  15432. "provider"
  15433. ],
  15434. "additionalProperties": false
  15435. }
  15436. },
  15437. "required": ["id", "type", "properties"],
  15438. "additionalProperties": false
  15439. },
  15440. {
  15441. "type": "object",
  15442. "properties": {
  15443. "id": {
  15444. "type": "string",
  15445. "pattern": "^evt_"
  15446. },
  15447. "type": {
  15448. "type": "string",
  15449. "enum": ["session.next.tool.failed"]
  15450. },
  15451. "properties": {
  15452. "type": "object",
  15453. "properties": {
  15454. "timestamp": {
  15455. "type": "number"
  15456. },
  15457. "sessionID": {
  15458. "type": "string",
  15459. "pattern": "^ses"
  15460. },
  15461. "assistantMessageID": {
  15462. "type": "string",
  15463. "pattern": "^msg_"
  15464. },
  15465. "callID": {
  15466. "type": "string"
  15467. },
  15468. "error": {
  15469. "$ref": "#/components/schemas/SessionErrorUnknown"
  15470. },
  15471. "result": {},
  15472. "provider": {
  15473. "type": "object",
  15474. "properties": {
  15475. "executed": {
  15476. "type": "boolean"
  15477. },
  15478. "metadata": {
  15479. "type": "object",
  15480. "additionalProperties": {
  15481. "type": "object"
  15482. }
  15483. }
  15484. },
  15485. "required": ["executed"],
  15486. "additionalProperties": false
  15487. }
  15488. },
  15489. "required": ["timestamp", "sessionID", "assistantMessageID", "callID", "error", "provider"],
  15490. "additionalProperties": false
  15491. }
  15492. },
  15493. "required": ["id", "type", "properties"],
  15494. "additionalProperties": false
  15495. },
  15496. {
  15497. "type": "object",
  15498. "properties": {
  15499. "id": {
  15500. "type": "string",
  15501. "pattern": "^evt_"
  15502. },
  15503. "type": {
  15504. "type": "string",
  15505. "enum": ["session.next.retried"]
  15506. },
  15507. "properties": {
  15508. "type": "object",
  15509. "properties": {
  15510. "timestamp": {
  15511. "type": "number"
  15512. },
  15513. "sessionID": {
  15514. "type": "string",
  15515. "pattern": "^ses"
  15516. },
  15517. "attempt": {
  15518. "type": "number"
  15519. },
  15520. "error": {
  15521. "$ref": "#/components/schemas/SessionNextRetry_error"
  15522. }
  15523. },
  15524. "required": ["timestamp", "sessionID", "attempt", "error"],
  15525. "additionalProperties": false
  15526. }
  15527. },
  15528. "required": ["id", "type", "properties"],
  15529. "additionalProperties": false
  15530. },
  15531. {
  15532. "type": "object",
  15533. "properties": {
  15534. "id": {
  15535. "type": "string",
  15536. "pattern": "^evt_"
  15537. },
  15538. "type": {
  15539. "type": "string",
  15540. "enum": ["session.next.compaction.started"]
  15541. },
  15542. "properties": {
  15543. "type": "object",
  15544. "properties": {
  15545. "timestamp": {
  15546. "type": "number"
  15547. },
  15548. "sessionID": {
  15549. "type": "string",
  15550. "pattern": "^ses"
  15551. },
  15552. "messageID": {
  15553. "type": "string",
  15554. "pattern": "^msg_"
  15555. },
  15556. "reason": {
  15557. "type": "string",
  15558. "enum": ["auto", "manual"]
  15559. }
  15560. },
  15561. "required": ["timestamp", "sessionID", "messageID", "reason"],
  15562. "additionalProperties": false
  15563. }
  15564. },
  15565. "required": ["id", "type", "properties"],
  15566. "additionalProperties": false
  15567. },
  15568. {
  15569. "type": "object",
  15570. "properties": {
  15571. "id": {
  15572. "type": "string",
  15573. "pattern": "^evt_"
  15574. },
  15575. "type": {
  15576. "type": "string",
  15577. "enum": ["session.next.compaction.delta"]
  15578. },
  15579. "properties": {
  15580. "type": "object",
  15581. "properties": {
  15582. "timestamp": {
  15583. "type": "number"
  15584. },
  15585. "sessionID": {
  15586. "type": "string",
  15587. "pattern": "^ses"
  15588. },
  15589. "text": {
  15590. "type": "string"
  15591. }
  15592. },
  15593. "required": ["timestamp", "sessionID", "text"],
  15594. "additionalProperties": false
  15595. }
  15596. },
  15597. "required": ["id", "type", "properties"],
  15598. "additionalProperties": false
  15599. },
  15600. {
  15601. "type": "object",
  15602. "properties": {
  15603. "id": {
  15604. "type": "string",
  15605. "pattern": "^evt_"
  15606. },
  15607. "type": {
  15608. "type": "string",
  15609. "enum": ["session.next.compaction.ended"]
  15610. },
  15611. "properties": {
  15612. "type": "object",
  15613. "properties": {
  15614. "timestamp": {
  15615. "type": "number"
  15616. },
  15617. "sessionID": {
  15618. "type": "string",
  15619. "pattern": "^ses"
  15620. },
  15621. "text": {
  15622. "type": "string"
  15623. },
  15624. "include": {
  15625. "type": "string"
  15626. }
  15627. },
  15628. "required": ["timestamp", "sessionID", "text"],
  15629. "additionalProperties": false
  15630. }
  15631. },
  15632. "required": ["id", "type", "properties"],
  15633. "additionalProperties": false
  15634. },
  15635. {
  15636. "type": "object",
  15637. "properties": {
  15638. "id": {
  15639. "type": "string",
  15640. "pattern": "^evt_"
  15641. },
  15642. "type": {
  15643. "type": "string",
  15644. "enum": ["message.part.delta"]
  15645. },
  15646. "properties": {
  15647. "type": "object",
  15648. "properties": {
  15649. "sessionID": {
  15650. "type": "string",
  15651. "pattern": "^ses"
  15652. },
  15653. "messageID": {
  15654. "type": "string",
  15655. "pattern": "^msg"
  15656. },
  15657. "partID": {
  15658. "type": "string",
  15659. "pattern": "^prt"
  15660. },
  15661. "field": {
  15662. "type": "string"
  15663. },
  15664. "delta": {
  15665. "type": "string"
  15666. }
  15667. },
  15668. "required": ["sessionID", "messageID", "partID", "field", "delta"],
  15669. "additionalProperties": false
  15670. }
  15671. },
  15672. "required": ["id", "type", "properties"],
  15673. "additionalProperties": false
  15674. },
  15675. {
  15676. "type": "object",
  15677. "properties": {
  15678. "id": {
  15679. "type": "string",
  15680. "pattern": "^evt_"
  15681. },
  15682. "type": {
  15683. "type": "string",
  15684. "enum": ["session.diff"]
  15685. },
  15686. "properties": {
  15687. "type": "object",
  15688. "properties": {
  15689. "sessionID": {
  15690. "type": "string",
  15691. "pattern": "^ses"
  15692. },
  15693. "diff": {
  15694. "type": "array",
  15695. "items": {
  15696. "$ref": "#/components/schemas/SnapshotFileDiff"
  15697. }
  15698. }
  15699. },
  15700. "required": ["sessionID", "diff"],
  15701. "additionalProperties": false
  15702. }
  15703. },
  15704. "required": ["id", "type", "properties"],
  15705. "additionalProperties": false
  15706. },
  15707. {
  15708. "type": "object",
  15709. "properties": {
  15710. "id": {
  15711. "type": "string",
  15712. "pattern": "^evt_"
  15713. },
  15714. "type": {
  15715. "type": "string",
  15716. "enum": ["session.error"]
  15717. },
  15718. "properties": {
  15719. "type": "object",
  15720. "properties": {
  15721. "sessionID": {
  15722. "type": "string",
  15723. "pattern": "^ses"
  15724. },
  15725. "error": {
  15726. "anyOf": [
  15727. {
  15728. "$ref": "#/components/schemas/ProviderAuthError"
  15729. },
  15730. {
  15731. "$ref": "#/components/schemas/UnknownError"
  15732. },
  15733. {
  15734. "$ref": "#/components/schemas/MessageOutputLengthError"
  15735. },
  15736. {
  15737. "$ref": "#/components/schemas/MessageAbortedError"
  15738. },
  15739. {
  15740. "$ref": "#/components/schemas/StructuredOutputError"
  15741. },
  15742. {
  15743. "$ref": "#/components/schemas/ContextOverflowError"
  15744. },
  15745. {
  15746. "$ref": "#/components/schemas/APIError"
  15747. }
  15748. ]
  15749. }
  15750. },
  15751. "additionalProperties": false
  15752. }
  15753. },
  15754. "required": ["id", "type", "properties"],
  15755. "additionalProperties": false
  15756. },
  15757. {
  15758. "type": "object",
  15759. "properties": {
  15760. "id": {
  15761. "type": "string",
  15762. "pattern": "^evt_"
  15763. },
  15764. "type": {
  15765. "type": "string",
  15766. "enum": ["installation.updated"]
  15767. },
  15768. "properties": {
  15769. "type": "object",
  15770. "properties": {
  15771. "version": {
  15772. "type": "string"
  15773. }
  15774. },
  15775. "required": ["version"],
  15776. "additionalProperties": false
  15777. }
  15778. },
  15779. "required": ["id", "type", "properties"],
  15780. "additionalProperties": false
  15781. },
  15782. {
  15783. "type": "object",
  15784. "properties": {
  15785. "id": {
  15786. "type": "string",
  15787. "pattern": "^evt_"
  15788. },
  15789. "type": {
  15790. "type": "string",
  15791. "enum": ["installation.update-available"]
  15792. },
  15793. "properties": {
  15794. "type": "object",
  15795. "properties": {
  15796. "version": {
  15797. "type": "string"
  15798. }
  15799. },
  15800. "required": ["version"],
  15801. "additionalProperties": false
  15802. }
  15803. },
  15804. "required": ["id", "type", "properties"],
  15805. "additionalProperties": false
  15806. },
  15807. {
  15808. "type": "object",
  15809. "properties": {
  15810. "id": {
  15811. "type": "string",
  15812. "pattern": "^evt_"
  15813. },
  15814. "type": {
  15815. "type": "string",
  15816. "enum": ["file.edited"]
  15817. },
  15818. "properties": {
  15819. "type": "object",
  15820. "properties": {
  15821. "file": {
  15822. "type": "string"
  15823. }
  15824. },
  15825. "required": ["file"],
  15826. "additionalProperties": false
  15827. }
  15828. },
  15829. "required": ["id", "type", "properties"],
  15830. "additionalProperties": false
  15831. },
  15832. {
  15833. "type": "object",
  15834. "properties": {
  15835. "id": {
  15836. "type": "string",
  15837. "pattern": "^evt_"
  15838. },
  15839. "type": {
  15840. "type": "string",
  15841. "enum": ["account.added"]
  15842. },
  15843. "properties": {
  15844. "type": "object",
  15845. "properties": {
  15846. "account": {
  15847. "$ref": "#/components/schemas/AuthInfo"
  15848. }
  15849. },
  15850. "required": ["account"],
  15851. "additionalProperties": false
  15852. }
  15853. },
  15854. "required": ["id", "type", "properties"],
  15855. "additionalProperties": false
  15856. },
  15857. {
  15858. "type": "object",
  15859. "properties": {
  15860. "id": {
  15861. "type": "string",
  15862. "pattern": "^evt_"
  15863. },
  15864. "type": {
  15865. "type": "string",
  15866. "enum": ["account.removed"]
  15867. },
  15868. "properties": {
  15869. "type": "object",
  15870. "properties": {
  15871. "account": {
  15872. "$ref": "#/components/schemas/AuthInfo"
  15873. }
  15874. },
  15875. "required": ["account"],
  15876. "additionalProperties": false
  15877. }
  15878. },
  15879. "required": ["id", "type", "properties"],
  15880. "additionalProperties": false
  15881. },
  15882. {
  15883. "type": "object",
  15884. "properties": {
  15885. "id": {
  15886. "type": "string",
  15887. "pattern": "^evt_"
  15888. },
  15889. "type": {
  15890. "type": "string",
  15891. "enum": ["account.switched"]
  15892. },
  15893. "properties": {
  15894. "type": "object",
  15895. "properties": {
  15896. "serviceID": {
  15897. "type": "string"
  15898. },
  15899. "from": {
  15900. "type": "string"
  15901. },
  15902. "to": {
  15903. "type": "string"
  15904. }
  15905. },
  15906. "required": ["serviceID"],
  15907. "additionalProperties": false
  15908. }
  15909. },
  15910. "required": ["id", "type", "properties"],
  15911. "additionalProperties": false
  15912. },
  15913. {
  15914. "type": "object",
  15915. "properties": {
  15916. "id": {
  15917. "type": "string",
  15918. "pattern": "^evt_"
  15919. },
  15920. "type": {
  15921. "type": "string",
  15922. "enum": ["permission.v2.asked"]
  15923. },
  15924. "properties": {
  15925. "type": "object",
  15926. "properties": {
  15927. "id": {
  15928. "type": "string",
  15929. "pattern": "^per"
  15930. },
  15931. "sessionID": {
  15932. "type": "string",
  15933. "pattern": "^ses"
  15934. },
  15935. "action": {
  15936. "type": "string"
  15937. },
  15938. "resources": {
  15939. "type": "array",
  15940. "items": {
  15941. "type": "string"
  15942. }
  15943. },
  15944. "save": {
  15945. "type": "array",
  15946. "items": {
  15947. "type": "string"
  15948. }
  15949. },
  15950. "metadata": {
  15951. "type": "object"
  15952. },
  15953. "source": {
  15954. "$ref": "#/components/schemas/PermissionV2Source"
  15955. }
  15956. },
  15957. "required": ["id", "sessionID", "action", "resources"],
  15958. "additionalProperties": false
  15959. }
  15960. },
  15961. "required": ["id", "type", "properties"],
  15962. "additionalProperties": false
  15963. },
  15964. {
  15965. "type": "object",
  15966. "properties": {
  15967. "id": {
  15968. "type": "string",
  15969. "pattern": "^evt_"
  15970. },
  15971. "type": {
  15972. "type": "string",
  15973. "enum": ["permission.v2.replied"]
  15974. },
  15975. "properties": {
  15976. "type": "object",
  15977. "properties": {
  15978. "sessionID": {
  15979. "type": "string",
  15980. "pattern": "^ses"
  15981. },
  15982. "requestID": {
  15983. "type": "string",
  15984. "pattern": "^per"
  15985. },
  15986. "reply": {
  15987. "$ref": "#/components/schemas/PermissionV2Reply"
  15988. }
  15989. },
  15990. "required": ["sessionID", "requestID", "reply"],
  15991. "additionalProperties": false
  15992. }
  15993. },
  15994. "required": ["id", "type", "properties"],
  15995. "additionalProperties": false
  15996. },
  15997. {
  15998. "type": "object",
  15999. "properties": {
  16000. "id": {
  16001. "type": "string",
  16002. "pattern": "^evt_"
  16003. },
  16004. "type": {
  16005. "type": "string",
  16006. "enum": ["file.watcher.updated"]
  16007. },
  16008. "properties": {
  16009. "type": "object",
  16010. "properties": {
  16011. "file": {
  16012. "type": "string"
  16013. },
  16014. "event": {
  16015. "type": "string",
  16016. "enum": ["add", "change", "unlink"]
  16017. }
  16018. },
  16019. "required": ["file", "event"],
  16020. "additionalProperties": false
  16021. }
  16022. },
  16023. "required": ["id", "type", "properties"],
  16024. "additionalProperties": false
  16025. },
  16026. {
  16027. "type": "object",
  16028. "properties": {
  16029. "id": {
  16030. "type": "string",
  16031. "pattern": "^evt_"
  16032. },
  16033. "type": {
  16034. "type": "string",
  16035. "enum": ["pty.created"]
  16036. },
  16037. "properties": {
  16038. "type": "object",
  16039. "properties": {
  16040. "info": {
  16041. "$ref": "#/components/schemas/Pty"
  16042. }
  16043. },
  16044. "required": ["info"],
  16045. "additionalProperties": false
  16046. }
  16047. },
  16048. "required": ["id", "type", "properties"],
  16049. "additionalProperties": false
  16050. },
  16051. {
  16052. "type": "object",
  16053. "properties": {
  16054. "id": {
  16055. "type": "string",
  16056. "pattern": "^evt_"
  16057. },
  16058. "type": {
  16059. "type": "string",
  16060. "enum": ["pty.updated"]
  16061. },
  16062. "properties": {
  16063. "type": "object",
  16064. "properties": {
  16065. "info": {
  16066. "$ref": "#/components/schemas/Pty"
  16067. }
  16068. },
  16069. "required": ["info"],
  16070. "additionalProperties": false
  16071. }
  16072. },
  16073. "required": ["id", "type", "properties"],
  16074. "additionalProperties": false
  16075. },
  16076. {
  16077. "type": "object",
  16078. "properties": {
  16079. "id": {
  16080. "type": "string",
  16081. "pattern": "^evt_"
  16082. },
  16083. "type": {
  16084. "type": "string",
  16085. "enum": ["pty.exited"]
  16086. },
  16087. "properties": {
  16088. "type": "object",
  16089. "properties": {
  16090. "id": {
  16091. "type": "string",
  16092. "pattern": "^pty"
  16093. },
  16094. "exitCode": {
  16095. "type": "integer",
  16096. "minimum": 0
  16097. }
  16098. },
  16099. "required": ["id", "exitCode"],
  16100. "additionalProperties": false
  16101. }
  16102. },
  16103. "required": ["id", "type", "properties"],
  16104. "additionalProperties": false
  16105. },
  16106. {
  16107. "type": "object",
  16108. "properties": {
  16109. "id": {
  16110. "type": "string",
  16111. "pattern": "^evt_"
  16112. },
  16113. "type": {
  16114. "type": "string",
  16115. "enum": ["pty.deleted"]
  16116. },
  16117. "properties": {
  16118. "type": "object",
  16119. "properties": {
  16120. "id": {
  16121. "type": "string",
  16122. "pattern": "^pty"
  16123. }
  16124. },
  16125. "required": ["id"],
  16126. "additionalProperties": false
  16127. }
  16128. },
  16129. "required": ["id", "type", "properties"],
  16130. "additionalProperties": false
  16131. },
  16132. {
  16133. "type": "object",
  16134. "properties": {
  16135. "id": {
  16136. "type": "string",
  16137. "pattern": "^evt_"
  16138. },
  16139. "type": {
  16140. "type": "string",
  16141. "enum": ["question.v2.asked"]
  16142. },
  16143. "properties": {
  16144. "type": "object",
  16145. "properties": {
  16146. "id": {
  16147. "type": "string",
  16148. "pattern": "^que"
  16149. },
  16150. "sessionID": {
  16151. "type": "string",
  16152. "pattern": "^ses"
  16153. },
  16154. "questions": {
  16155. "type": "array",
  16156. "items": {
  16157. "$ref": "#/components/schemas/QuestionV2Info"
  16158. },
  16159. "description": "Questions to ask"
  16160. },
  16161. "tool": {
  16162. "$ref": "#/components/schemas/QuestionV2Tool"
  16163. }
  16164. },
  16165. "required": ["id", "sessionID", "questions"],
  16166. "additionalProperties": false
  16167. }
  16168. },
  16169. "required": ["id", "type", "properties"],
  16170. "additionalProperties": false
  16171. },
  16172. {
  16173. "type": "object",
  16174. "properties": {
  16175. "id": {
  16176. "type": "string",
  16177. "pattern": "^evt_"
  16178. },
  16179. "type": {
  16180. "type": "string",
  16181. "enum": ["question.v2.replied"]
  16182. },
  16183. "properties": {
  16184. "type": "object",
  16185. "properties": {
  16186. "sessionID": {
  16187. "type": "string",
  16188. "pattern": "^ses"
  16189. },
  16190. "requestID": {
  16191. "type": "string",
  16192. "pattern": "^que"
  16193. },
  16194. "answers": {
  16195. "type": "array",
  16196. "items": {
  16197. "$ref": "#/components/schemas/QuestionV2Answer"
  16198. }
  16199. }
  16200. },
  16201. "required": ["sessionID", "requestID", "answers"],
  16202. "additionalProperties": false
  16203. }
  16204. },
  16205. "required": ["id", "type", "properties"],
  16206. "additionalProperties": false
  16207. },
  16208. {
  16209. "type": "object",
  16210. "properties": {
  16211. "id": {
  16212. "type": "string",
  16213. "pattern": "^evt_"
  16214. },
  16215. "type": {
  16216. "type": "string",
  16217. "enum": ["question.v2.rejected"]
  16218. },
  16219. "properties": {
  16220. "type": "object",
  16221. "properties": {
  16222. "sessionID": {
  16223. "type": "string",
  16224. "pattern": "^ses"
  16225. },
  16226. "requestID": {
  16227. "type": "string",
  16228. "pattern": "^que"
  16229. }
  16230. },
  16231. "required": ["sessionID", "requestID"],
  16232. "additionalProperties": false
  16233. }
  16234. },
  16235. "required": ["id", "type", "properties"],
  16236. "additionalProperties": false
  16237. },
  16238. {
  16239. "type": "object",
  16240. "properties": {
  16241. "id": {
  16242. "type": "string",
  16243. "pattern": "^evt_"
  16244. },
  16245. "type": {
  16246. "type": "string",
  16247. "enum": ["todo.updated"]
  16248. },
  16249. "properties": {
  16250. "type": "object",
  16251. "properties": {
  16252. "sessionID": {
  16253. "type": "string",
  16254. "pattern": "^ses"
  16255. },
  16256. "todos": {
  16257. "type": "array",
  16258. "items": {
  16259. "$ref": "#/components/schemas/Todo"
  16260. }
  16261. }
  16262. },
  16263. "required": ["sessionID", "todos"],
  16264. "additionalProperties": false
  16265. }
  16266. },
  16267. "required": ["id", "type", "properties"],
  16268. "additionalProperties": false
  16269. },
  16270. {
  16271. "type": "object",
  16272. "properties": {
  16273. "id": {
  16274. "type": "string",
  16275. "pattern": "^evt_"
  16276. },
  16277. "type": {
  16278. "type": "string",
  16279. "enum": ["lsp.updated"]
  16280. },
  16281. "properties": {
  16282. "type": "object",
  16283. "properties": {}
  16284. }
  16285. },
  16286. "required": ["id", "type", "properties"],
  16287. "additionalProperties": false
  16288. },
  16289. {
  16290. "type": "object",
  16291. "properties": {
  16292. "id": {
  16293. "type": "string",
  16294. "pattern": "^evt_"
  16295. },
  16296. "type": {
  16297. "type": "string",
  16298. "enum": ["permission.asked"]
  16299. },
  16300. "properties": {
  16301. "type": "object",
  16302. "properties": {
  16303. "id": {
  16304. "type": "string",
  16305. "pattern": "^per"
  16306. },
  16307. "sessionID": {
  16308. "type": "string",
  16309. "pattern": "^ses"
  16310. },
  16311. "permission": {
  16312. "type": "string"
  16313. },
  16314. "patterns": {
  16315. "type": "array",
  16316. "items": {
  16317. "type": "string"
  16318. }
  16319. },
  16320. "metadata": {
  16321. "type": "object"
  16322. },
  16323. "always": {
  16324. "type": "array",
  16325. "items": {
  16326. "type": "string"
  16327. }
  16328. },
  16329. "tool": {
  16330. "type": "object",
  16331. "properties": {
  16332. "messageID": {
  16333. "type": "string"
  16334. },
  16335. "callID": {
  16336. "type": "string"
  16337. }
  16338. },
  16339. "required": ["messageID", "callID"],
  16340. "additionalProperties": false
  16341. }
  16342. },
  16343. "required": ["id", "sessionID", "permission", "patterns", "metadata", "always"],
  16344. "additionalProperties": false
  16345. }
  16346. },
  16347. "required": ["id", "type", "properties"],
  16348. "additionalProperties": false
  16349. },
  16350. {
  16351. "type": "object",
  16352. "properties": {
  16353. "id": {
  16354. "type": "string",
  16355. "pattern": "^evt_"
  16356. },
  16357. "type": {
  16358. "type": "string",
  16359. "enum": ["permission.replied"]
  16360. },
  16361. "properties": {
  16362. "type": "object",
  16363. "properties": {
  16364. "sessionID": {
  16365. "type": "string",
  16366. "pattern": "^ses"
  16367. },
  16368. "requestID": {
  16369. "type": "string",
  16370. "pattern": "^per"
  16371. },
  16372. "reply": {
  16373. "type": "string",
  16374. "enum": ["once", "always", "reject"]
  16375. }
  16376. },
  16377. "required": ["sessionID", "requestID", "reply"],
  16378. "additionalProperties": false
  16379. }
  16380. },
  16381. "required": ["id", "type", "properties"],
  16382. "additionalProperties": false
  16383. },
  16384. {
  16385. "type": "object",
  16386. "properties": {
  16387. "id": {
  16388. "type": "string",
  16389. "pattern": "^evt_"
  16390. },
  16391. "type": {
  16392. "type": "string",
  16393. "enum": ["tui.prompt.append"]
  16394. },
  16395. "properties": {
  16396. "type": "object",
  16397. "properties": {
  16398. "text": {
  16399. "type": "string"
  16400. }
  16401. },
  16402. "required": ["text"],
  16403. "additionalProperties": false
  16404. }
  16405. },
  16406. "required": ["id", "type", "properties"],
  16407. "additionalProperties": false
  16408. },
  16409. {
  16410. "type": "object",
  16411. "properties": {
  16412. "id": {
  16413. "type": "string",
  16414. "pattern": "^evt_"
  16415. },
  16416. "type": {
  16417. "type": "string",
  16418. "enum": ["tui.command.execute"]
  16419. },
  16420. "properties": {
  16421. "type": "object",
  16422. "properties": {
  16423. "command": {
  16424. "anyOf": [
  16425. {
  16426. "type": "string",
  16427. "enum": [
  16428. "session.list",
  16429. "session.new",
  16430. "session.share",
  16431. "session.interrupt",
  16432. "session.compact",
  16433. "session.page.up",
  16434. "session.page.down",
  16435. "session.line.up",
  16436. "session.line.down",
  16437. "session.half.page.up",
  16438. "session.half.page.down",
  16439. "session.first",
  16440. "session.last",
  16441. "prompt.clear",
  16442. "prompt.submit",
  16443. "agent.cycle"
  16444. ]
  16445. },
  16446. {
  16447. "type": "string"
  16448. }
  16449. ]
  16450. }
  16451. },
  16452. "required": ["command"],
  16453. "additionalProperties": false
  16454. }
  16455. },
  16456. "required": ["id", "type", "properties"],
  16457. "additionalProperties": false
  16458. },
  16459. {
  16460. "type": "object",
  16461. "properties": {
  16462. "id": {
  16463. "type": "string",
  16464. "pattern": "^evt_"
  16465. },
  16466. "type": {
  16467. "type": "string",
  16468. "enum": ["tui.toast.show"]
  16469. },
  16470. "properties": {
  16471. "type": "object",
  16472. "properties": {
  16473. "title": {
  16474. "type": "string"
  16475. },
  16476. "message": {
  16477. "type": "string"
  16478. },
  16479. "variant": {
  16480. "type": "string",
  16481. "enum": ["info", "success", "warning", "error"]
  16482. },
  16483. "duration": {
  16484. "type": "integer",
  16485. "exclusiveMinimum": 0
  16486. }
  16487. },
  16488. "required": ["message", "variant"],
  16489. "additionalProperties": false
  16490. }
  16491. },
  16492. "required": ["id", "type", "properties"],
  16493. "additionalProperties": false
  16494. },
  16495. {
  16496. "type": "object",
  16497. "properties": {
  16498. "id": {
  16499. "type": "string",
  16500. "pattern": "^evt_"
  16501. },
  16502. "type": {
  16503. "type": "string",
  16504. "enum": ["tui.session.select"]
  16505. },
  16506. "properties": {
  16507. "type": "object",
  16508. "properties": {
  16509. "sessionID": {
  16510. "type": "string",
  16511. "pattern": "^ses",
  16512. "description": "Session ID to navigate to"
  16513. }
  16514. },
  16515. "required": ["sessionID"],
  16516. "additionalProperties": false
  16517. }
  16518. },
  16519. "required": ["id", "type", "properties"],
  16520. "additionalProperties": false
  16521. },
  16522. {
  16523. "type": "object",
  16524. "properties": {
  16525. "id": {
  16526. "type": "string",
  16527. "pattern": "^evt_"
  16528. },
  16529. "type": {
  16530. "type": "string",
  16531. "enum": ["mcp.tools.changed"]
  16532. },
  16533. "properties": {
  16534. "type": "object",
  16535. "properties": {
  16536. "server": {
  16537. "type": "string"
  16538. }
  16539. },
  16540. "required": ["server"],
  16541. "additionalProperties": false
  16542. }
  16543. },
  16544. "required": ["id", "type", "properties"],
  16545. "additionalProperties": false
  16546. },
  16547. {
  16548. "type": "object",
  16549. "properties": {
  16550. "id": {
  16551. "type": "string",
  16552. "pattern": "^evt_"
  16553. },
  16554. "type": {
  16555. "type": "string",
  16556. "enum": ["mcp.browser.open.failed"]
  16557. },
  16558. "properties": {
  16559. "type": "object",
  16560. "properties": {
  16561. "mcpName": {
  16562. "type": "string"
  16563. },
  16564. "url": {
  16565. "type": "string"
  16566. }
  16567. },
  16568. "required": ["mcpName", "url"],
  16569. "additionalProperties": false
  16570. }
  16571. },
  16572. "required": ["id", "type", "properties"],
  16573. "additionalProperties": false
  16574. },
  16575. {
  16576. "type": "object",
  16577. "properties": {
  16578. "id": {
  16579. "type": "string",
  16580. "pattern": "^evt_"
  16581. },
  16582. "type": {
  16583. "type": "string",
  16584. "enum": ["command.executed"]
  16585. },
  16586. "properties": {
  16587. "type": "object",
  16588. "properties": {
  16589. "name": {
  16590. "type": "string"
  16591. },
  16592. "sessionID": {
  16593. "type": "string",
  16594. "pattern": "^ses"
  16595. },
  16596. "arguments": {
  16597. "type": "string"
  16598. },
  16599. "messageID": {
  16600. "type": "string",
  16601. "pattern": "^msg"
  16602. }
  16603. },
  16604. "required": ["name", "sessionID", "arguments", "messageID"],
  16605. "additionalProperties": false
  16606. }
  16607. },
  16608. "required": ["id", "type", "properties"],
  16609. "additionalProperties": false
  16610. },
  16611. {
  16612. "type": "object",
  16613. "properties": {
  16614. "id": {
  16615. "type": "string",
  16616. "pattern": "^evt_"
  16617. },
  16618. "type": {
  16619. "type": "string",
  16620. "enum": ["project.directories.updated"]
  16621. },
  16622. "properties": {
  16623. "type": "object",
  16624. "properties": {
  16625. "projectID": {
  16626. "type": "string"
  16627. }
  16628. },
  16629. "required": ["projectID"],
  16630. "additionalProperties": false
  16631. }
  16632. },
  16633. "required": ["id", "type", "properties"],
  16634. "additionalProperties": false
  16635. },
  16636. {
  16637. "type": "object",
  16638. "properties": {
  16639. "id": {
  16640. "type": "string",
  16641. "pattern": "^evt_"
  16642. },
  16643. "type": {
  16644. "type": "string",
  16645. "enum": ["project.updated"]
  16646. },
  16647. "properties": {
  16648. "type": "object",
  16649. "properties": {
  16650. "id": {
  16651. "type": "string"
  16652. },
  16653. "worktree": {
  16654. "type": "string"
  16655. },
  16656. "vcs": {
  16657. "type": "string",
  16658. "enum": ["git"]
  16659. },
  16660. "name": {
  16661. "type": "string"
  16662. },
  16663. "icon": {
  16664. "type": "object",
  16665. "properties": {
  16666. "url": {
  16667. "type": "string"
  16668. },
  16669. "override": {
  16670. "type": "string"
  16671. },
  16672. "color": {
  16673. "type": "string"
  16674. }
  16675. },
  16676. "additionalProperties": false
  16677. },
  16678. "commands": {
  16679. "type": "object",
  16680. "properties": {
  16681. "start": {
  16682. "type": "string",
  16683. "description": "Startup script to run when creating a new workspace (worktree)"
  16684. }
  16685. },
  16686. "additionalProperties": false
  16687. },
  16688. "time": {
  16689. "type": "object",
  16690. "properties": {
  16691. "created": {
  16692. "type": "integer",
  16693. "minimum": 0
  16694. },
  16695. "updated": {
  16696. "type": "integer",
  16697. "minimum": 0
  16698. },
  16699. "initialized": {
  16700. "type": "integer",
  16701. "minimum": 0
  16702. }
  16703. },
  16704. "required": ["created", "updated"],
  16705. "additionalProperties": false
  16706. },
  16707. "sandboxes": {
  16708. "type": "array",
  16709. "items": {
  16710. "type": "string"
  16711. }
  16712. }
  16713. },
  16714. "required": ["id", "worktree", "time", "sandboxes"],
  16715. "additionalProperties": false
  16716. }
  16717. },
  16718. "required": ["id", "type", "properties"],
  16719. "additionalProperties": false
  16720. },
  16721. {
  16722. "type": "object",
  16723. "properties": {
  16724. "id": {
  16725. "type": "string",
  16726. "pattern": "^evt_"
  16727. },
  16728. "type": {
  16729. "type": "string",
  16730. "enum": ["question.asked"]
  16731. },
  16732. "properties": {
  16733. "type": "object",
  16734. "properties": {
  16735. "id": {
  16736. "type": "string",
  16737. "pattern": "^que"
  16738. },
  16739. "sessionID": {
  16740. "type": "string",
  16741. "pattern": "^ses"
  16742. },
  16743. "questions": {
  16744. "type": "array",
  16745. "items": {
  16746. "$ref": "#/components/schemas/QuestionInfo"
  16747. },
  16748. "description": "Questions to ask"
  16749. },
  16750. "tool": {
  16751. "$ref": "#/components/schemas/QuestionTool"
  16752. }
  16753. },
  16754. "required": ["id", "sessionID", "questions"],
  16755. "additionalProperties": false
  16756. }
  16757. },
  16758. "required": ["id", "type", "properties"],
  16759. "additionalProperties": false
  16760. },
  16761. {
  16762. "type": "object",
  16763. "properties": {
  16764. "id": {
  16765. "type": "string",
  16766. "pattern": "^evt_"
  16767. },
  16768. "type": {
  16769. "type": "string",
  16770. "enum": ["question.replied"]
  16771. },
  16772. "properties": {
  16773. "type": "object",
  16774. "properties": {
  16775. "sessionID": {
  16776. "type": "string",
  16777. "pattern": "^ses"
  16778. },
  16779. "requestID": {
  16780. "type": "string",
  16781. "pattern": "^que"
  16782. },
  16783. "answers": {
  16784. "type": "array",
  16785. "items": {
  16786. "$ref": "#/components/schemas/QuestionAnswer"
  16787. }
  16788. }
  16789. },
  16790. "required": ["sessionID", "requestID", "answers"],
  16791. "additionalProperties": false
  16792. }
  16793. },
  16794. "required": ["id", "type", "properties"],
  16795. "additionalProperties": false
  16796. },
  16797. {
  16798. "type": "object",
  16799. "properties": {
  16800. "id": {
  16801. "type": "string",
  16802. "pattern": "^evt_"
  16803. },
  16804. "type": {
  16805. "type": "string",
  16806. "enum": ["question.rejected"]
  16807. },
  16808. "properties": {
  16809. "type": "object",
  16810. "properties": {
  16811. "sessionID": {
  16812. "type": "string",
  16813. "pattern": "^ses"
  16814. },
  16815. "requestID": {
  16816. "type": "string",
  16817. "pattern": "^que"
  16818. }
  16819. },
  16820. "required": ["sessionID", "requestID"],
  16821. "additionalProperties": false
  16822. }
  16823. },
  16824. "required": ["id", "type", "properties"],
  16825. "additionalProperties": false
  16826. },
  16827. {
  16828. "type": "object",
  16829. "properties": {
  16830. "id": {
  16831. "type": "string",
  16832. "pattern": "^evt_"
  16833. },
  16834. "type": {
  16835. "type": "string",
  16836. "enum": ["session.status"]
  16837. },
  16838. "properties": {
  16839. "type": "object",
  16840. "properties": {
  16841. "sessionID": {
  16842. "type": "string",
  16843. "pattern": "^ses"
  16844. },
  16845. "status": {
  16846. "$ref": "#/components/schemas/SessionStatus"
  16847. }
  16848. },
  16849. "required": ["sessionID", "status"],
  16850. "additionalProperties": false
  16851. }
  16852. },
  16853. "required": ["id", "type", "properties"],
  16854. "additionalProperties": false
  16855. },
  16856. {
  16857. "type": "object",
  16858. "properties": {
  16859. "id": {
  16860. "type": "string",
  16861. "pattern": "^evt_"
  16862. },
  16863. "type": {
  16864. "type": "string",
  16865. "enum": ["session.idle"]
  16866. },
  16867. "properties": {
  16868. "type": "object",
  16869. "properties": {
  16870. "sessionID": {
  16871. "type": "string",
  16872. "pattern": "^ses"
  16873. }
  16874. },
  16875. "required": ["sessionID"],
  16876. "additionalProperties": false
  16877. }
  16878. },
  16879. "required": ["id", "type", "properties"],
  16880. "additionalProperties": false
  16881. },
  16882. {
  16883. "type": "object",
  16884. "properties": {
  16885. "id": {
  16886. "type": "string",
  16887. "pattern": "^evt_"
  16888. },
  16889. "type": {
  16890. "type": "string",
  16891. "enum": ["session.compacted"]
  16892. },
  16893. "properties": {
  16894. "type": "object",
  16895. "properties": {
  16896. "sessionID": {
  16897. "type": "string",
  16898. "pattern": "^ses"
  16899. }
  16900. },
  16901. "required": ["sessionID"],
  16902. "additionalProperties": false
  16903. }
  16904. },
  16905. "required": ["id", "type", "properties"],
  16906. "additionalProperties": false
  16907. },
  16908. {
  16909. "type": "object",
  16910. "properties": {
  16911. "id": {
  16912. "type": "string",
  16913. "pattern": "^evt_"
  16914. },
  16915. "type": {
  16916. "type": "string",
  16917. "enum": ["vcs.branch.updated"]
  16918. },
  16919. "properties": {
  16920. "type": "object",
  16921. "properties": {
  16922. "branch": {
  16923. "type": "string"
  16924. }
  16925. },
  16926. "additionalProperties": false
  16927. }
  16928. },
  16929. "required": ["id", "type", "properties"],
  16930. "additionalProperties": false
  16931. },
  16932. {
  16933. "type": "object",
  16934. "properties": {
  16935. "id": {
  16936. "type": "string",
  16937. "pattern": "^evt_"
  16938. },
  16939. "type": {
  16940. "type": "string",
  16941. "enum": ["worktree.ready"]
  16942. },
  16943. "properties": {
  16944. "type": "object",
  16945. "properties": {
  16946. "name": {
  16947. "type": "string"
  16948. },
  16949. "branch": {
  16950. "type": "string"
  16951. }
  16952. },
  16953. "required": ["name"],
  16954. "additionalProperties": false
  16955. }
  16956. },
  16957. "required": ["id", "type", "properties"],
  16958. "additionalProperties": false
  16959. },
  16960. {
  16961. "type": "object",
  16962. "properties": {
  16963. "id": {
  16964. "type": "string",
  16965. "pattern": "^evt_"
  16966. },
  16967. "type": {
  16968. "type": "string",
  16969. "enum": ["worktree.failed"]
  16970. },
  16971. "properties": {
  16972. "type": "object",
  16973. "properties": {
  16974. "message": {
  16975. "type": "string"
  16976. }
  16977. },
  16978. "required": ["message"],
  16979. "additionalProperties": false
  16980. }
  16981. },
  16982. "required": ["id", "type", "properties"],
  16983. "additionalProperties": false
  16984. },
  16985. {
  16986. "type": "object",
  16987. "properties": {
  16988. "id": {
  16989. "type": "string",
  16990. "pattern": "^evt_"
  16991. },
  16992. "type": {
  16993. "type": "string",
  16994. "enum": ["workspace.ready"]
  16995. },
  16996. "properties": {
  16997. "type": "object",
  16998. "properties": {
  16999. "name": {
  17000. "type": "string"
  17001. }
  17002. },
  17003. "required": ["name"],
  17004. "additionalProperties": false
  17005. }
  17006. },
  17007. "required": ["id", "type", "properties"],
  17008. "additionalProperties": false
  17009. },
  17010. {
  17011. "type": "object",
  17012. "properties": {
  17013. "id": {
  17014. "type": "string",
  17015. "pattern": "^evt_"
  17016. },
  17017. "type": {
  17018. "type": "string",
  17019. "enum": ["workspace.failed"]
  17020. },
  17021. "properties": {
  17022. "type": "object",
  17023. "properties": {
  17024. "message": {
  17025. "type": "string"
  17026. }
  17027. },
  17028. "required": ["message"],
  17029. "additionalProperties": false
  17030. }
  17031. },
  17032. "required": ["id", "type", "properties"],
  17033. "additionalProperties": false
  17034. },
  17035. {
  17036. "type": "object",
  17037. "properties": {
  17038. "id": {
  17039. "type": "string",
  17040. "pattern": "^evt_"
  17041. },
  17042. "type": {
  17043. "type": "string",
  17044. "enum": ["workspace.status"]
  17045. },
  17046. "properties": {
  17047. "type": "object",
  17048. "properties": {
  17049. "workspaceID": {
  17050. "type": "string",
  17051. "pattern": "^wrk"
  17052. },
  17053. "status": {
  17054. "type": "string",
  17055. "enum": ["connected", "connecting", "disconnected", "error"]
  17056. }
  17057. },
  17058. "required": ["workspaceID", "status"],
  17059. "additionalProperties": false
  17060. }
  17061. },
  17062. "required": ["id", "type", "properties"],
  17063. "additionalProperties": false
  17064. },
  17065. {
  17066. "type": "object",
  17067. "properties": {
  17068. "id": {
  17069. "type": "string",
  17070. "pattern": "^evt_"
  17071. },
  17072. "type": {
  17073. "type": "string",
  17074. "enum": ["server.connected"]
  17075. },
  17076. "properties": {
  17077. "type": "object",
  17078. "properties": {}
  17079. }
  17080. },
  17081. "required": ["id", "type", "properties"],
  17082. "additionalProperties": false
  17083. },
  17084. {
  17085. "type": "object",
  17086. "properties": {
  17087. "id": {
  17088. "type": "string",
  17089. "pattern": "^evt_"
  17090. },
  17091. "type": {
  17092. "type": "string",
  17093. "enum": ["global.disposed"]
  17094. },
  17095. "properties": {
  17096. "type": "object",
  17097. "properties": {}
  17098. }
  17099. },
  17100. "required": ["id", "type", "properties"],
  17101. "additionalProperties": false
  17102. },
  17103. {
  17104. "$ref": "#/components/schemas/EventServerInstanceDisposed"
  17105. },
  17106. {
  17107. "$ref": "#/components/schemas/SyncEventSessionCreated"
  17108. },
  17109. {
  17110. "$ref": "#/components/schemas/SyncEventSessionUpdated"
  17111. },
  17112. {
  17113. "$ref": "#/components/schemas/SyncEventSessionDeleted"
  17114. },
  17115. {
  17116. "$ref": "#/components/schemas/SyncEventMessageUpdated"
  17117. },
  17118. {
  17119. "$ref": "#/components/schemas/SyncEventMessageRemoved"
  17120. },
  17121. {
  17122. "$ref": "#/components/schemas/SyncEventMessagePartUpdated"
  17123. },
  17124. {
  17125. "$ref": "#/components/schemas/SyncEventMessagePartRemoved"
  17126. },
  17127. {
  17128. "$ref": "#/components/schemas/SyncEventSessionNextAgentSwitched"
  17129. },
  17130. {
  17131. "$ref": "#/components/schemas/SyncEventSessionNextModelSwitched"
  17132. },
  17133. {
  17134. "$ref": "#/components/schemas/SyncEventSessionNextMoved"
  17135. },
  17136. {
  17137. "$ref": "#/components/schemas/SyncEventSessionNextPrompted"
  17138. },
  17139. {
  17140. "$ref": "#/components/schemas/SyncEventSessionNextPromptAdmitted"
  17141. },
  17142. {
  17143. "$ref": "#/components/schemas/SyncEventSessionNextPromptPromoted"
  17144. },
  17145. {
  17146. "$ref": "#/components/schemas/SyncEventSessionNextSynthetic"
  17147. },
  17148. {
  17149. "$ref": "#/components/schemas/SyncEventSessionNextShellStarted"
  17150. },
  17151. {
  17152. "$ref": "#/components/schemas/SyncEventSessionNextShellEnded"
  17153. },
  17154. {
  17155. "$ref": "#/components/schemas/SyncEventSessionNextStepStarted"
  17156. },
  17157. {
  17158. "$ref": "#/components/schemas/SyncEventSessionNextStepEnded"
  17159. },
  17160. {
  17161. "$ref": "#/components/schemas/SyncEventSessionNextStepFailed"
  17162. },
  17163. {
  17164. "$ref": "#/components/schemas/SyncEventSessionNextTextStarted"
  17165. },
  17166. {
  17167. "$ref": "#/components/schemas/SyncEventSessionNextTextEnded"
  17168. },
  17169. {
  17170. "$ref": "#/components/schemas/SyncEventSessionNextReasoningStarted"
  17171. },
  17172. {
  17173. "$ref": "#/components/schemas/SyncEventSessionNextReasoningEnded"
  17174. },
  17175. {
  17176. "$ref": "#/components/schemas/SyncEventSessionNextToolInputStarted"
  17177. },
  17178. {
  17179. "$ref": "#/components/schemas/SyncEventSessionNextToolInputEnded"
  17180. },
  17181. {
  17182. "$ref": "#/components/schemas/SyncEventSessionNextToolCalled"
  17183. },
  17184. {
  17185. "$ref": "#/components/schemas/SyncEventSessionNextToolProgress"
  17186. },
  17187. {
  17188. "$ref": "#/components/schemas/SyncEventSessionNextToolSuccess"
  17189. },
  17190. {
  17191. "$ref": "#/components/schemas/SyncEventSessionNextToolFailed"
  17192. },
  17193. {
  17194. "$ref": "#/components/schemas/SyncEventSessionNextRetried"
  17195. },
  17196. {
  17197. "$ref": "#/components/schemas/SyncEventSessionNextCompactionStarted"
  17198. },
  17199. {
  17200. "$ref": "#/components/schemas/SyncEventSessionNextCompactionDelta"
  17201. },
  17202. {
  17203. "$ref": "#/components/schemas/SyncEventSessionNextCompactionEnded"
  17204. }
  17205. ]
  17206. }
  17207. },
  17208. "required": ["directory", "payload"],
  17209. "additionalProperties": false
  17210. },
  17211. "LogLevel": {
  17212. "type": "string",
  17213. "enum": ["DEBUG", "INFO", "WARN", "ERROR"],
  17214. "description": "Log level"
  17215. },
  17216. "ServerConfig": {
  17217. "type": "object",
  17218. "properties": {
  17219. "port": {
  17220. "type": "integer",
  17221. "exclusiveMinimum": 0
  17222. },
  17223. "hostname": {
  17224. "type": "string"
  17225. },
  17226. "mdns": {
  17227. "type": "boolean"
  17228. },
  17229. "mdnsDomain": {
  17230. "type": "string"
  17231. },
  17232. "cors": {
  17233. "type": "array",
  17234. "items": {
  17235. "type": "string"
  17236. }
  17237. }
  17238. },
  17239. "additionalProperties": false,
  17240. "description": "Server configuration for opencode serve and web commands"
  17241. },
  17242. "ReferenceConfigEntry": {
  17243. "anyOf": [
  17244. {
  17245. "type": "string"
  17246. },
  17247. {
  17248. "type": "object",
  17249. "properties": {
  17250. "repository": {
  17251. "type": "string",
  17252. "description": "Git repository URL, host/path reference, or GitHub owner/repo shorthand"
  17253. },
  17254. "branch": {
  17255. "type": "string"
  17256. }
  17257. },
  17258. "required": ["repository"],
  17259. "additionalProperties": false
  17260. },
  17261. {
  17262. "type": "object",
  17263. "properties": {
  17264. "path": {
  17265. "type": "string",
  17266. "description": "Absolute path, ~/ path, or workspace-relative path to a local reference directory"
  17267. }
  17268. },
  17269. "required": ["path"],
  17270. "additionalProperties": false
  17271. }
  17272. ]
  17273. },
  17274. "ReferenceConfig": {
  17275. "type": "object",
  17276. "additionalProperties": {
  17277. "$ref": "#/components/schemas/ReferenceConfigEntry"
  17278. }
  17279. },
  17280. "PermissionActionConfig": {
  17281. "type": "string",
  17282. "enum": ["ask", "allow", "deny"]
  17283. },
  17284. "PermissionObjectConfig": {
  17285. "type": "object",
  17286. "additionalProperties": {
  17287. "$ref": "#/components/schemas/PermissionActionConfig"
  17288. }
  17289. },
  17290. "PermissionRuleConfig": {
  17291. "anyOf": [
  17292. {
  17293. "$ref": "#/components/schemas/PermissionActionConfig"
  17294. },
  17295. {
  17296. "$ref": "#/components/schemas/PermissionObjectConfig"
  17297. }
  17298. ]
  17299. },
  17300. "PermissionConfig": {
  17301. "anyOf": [
  17302. {
  17303. "$ref": "#/components/schemas/PermissionActionConfig"
  17304. },
  17305. {
  17306. "type": "object",
  17307. "properties": {
  17308. "read": {
  17309. "$ref": "#/components/schemas/PermissionRuleConfig"
  17310. },
  17311. "edit": {
  17312. "$ref": "#/components/schemas/PermissionRuleConfig"
  17313. },
  17314. "glob": {
  17315. "$ref": "#/components/schemas/PermissionRuleConfig"
  17316. },
  17317. "grep": {
  17318. "$ref": "#/components/schemas/PermissionRuleConfig"
  17319. },
  17320. "list": {
  17321. "$ref": "#/components/schemas/PermissionRuleConfig"
  17322. },
  17323. "bash": {
  17324. "$ref": "#/components/schemas/PermissionRuleConfig"
  17325. },
  17326. "task": {
  17327. "$ref": "#/components/schemas/PermissionRuleConfig"
  17328. },
  17329. "external_directory": {
  17330. "$ref": "#/components/schemas/PermissionRuleConfig"
  17331. },
  17332. "todowrite": {
  17333. "$ref": "#/components/schemas/PermissionActionConfig"
  17334. },
  17335. "question": {
  17336. "$ref": "#/components/schemas/PermissionActionConfig"
  17337. },
  17338. "webfetch": {
  17339. "$ref": "#/components/schemas/PermissionActionConfig"
  17340. },
  17341. "websearch": {
  17342. "$ref": "#/components/schemas/PermissionActionConfig"
  17343. },
  17344. "lsp": {
  17345. "$ref": "#/components/schemas/PermissionRuleConfig"
  17346. },
  17347. "doom_loop": {
  17348. "$ref": "#/components/schemas/PermissionActionConfig"
  17349. },
  17350. "skill": {
  17351. "$ref": "#/components/schemas/PermissionRuleConfig"
  17352. }
  17353. },
  17354. "additionalProperties": {
  17355. "$ref": "#/components/schemas/PermissionRuleConfig"
  17356. }
  17357. }
  17358. ]
  17359. },
  17360. "AgentConfig": {
  17361. "type": "object",
  17362. "properties": {
  17363. "model": {
  17364. "type": "string"
  17365. },
  17366. "variant": {
  17367. "type": "string"
  17368. },
  17369. "temperature": {
  17370. "type": "number"
  17371. },
  17372. "top_p": {
  17373. "type": "number"
  17374. },
  17375. "prompt": {
  17376. "type": "string"
  17377. },
  17378. "tools": {
  17379. "type": "object",
  17380. "additionalProperties": {
  17381. "type": "boolean"
  17382. }
  17383. },
  17384. "disable": {
  17385. "type": "boolean"
  17386. },
  17387. "description": {
  17388. "type": "string"
  17389. },
  17390. "mode": {
  17391. "type": "string",
  17392. "enum": ["subagent", "primary", "all"]
  17393. },
  17394. "hidden": {
  17395. "type": "boolean"
  17396. },
  17397. "options": {
  17398. "type": "object"
  17399. },
  17400. "color": {
  17401. "anyOf": [
  17402. {
  17403. "type": "string",
  17404. "pattern": "^#[0-9a-fA-F]{6}$"
  17405. },
  17406. {
  17407. "type": "string",
  17408. "enum": ["primary", "secondary", "accent", "success", "warning", "error", "info"]
  17409. }
  17410. ],
  17411. "description": "Hex color code (e.g., #FF5733) or theme color (e.g., primary)"
  17412. },
  17413. "steps": {
  17414. "type": "integer",
  17415. "exclusiveMinimum": 0
  17416. },
  17417. "maxSteps": {
  17418. "type": "integer",
  17419. "exclusiveMinimum": 0
  17420. },
  17421. "permission": {
  17422. "$ref": "#/components/schemas/PermissionConfig"
  17423. }
  17424. },
  17425. "additionalProperties": {}
  17426. },
  17427. "ProviderConfig": {
  17428. "type": "object",
  17429. "properties": {
  17430. "api": {
  17431. "type": "string"
  17432. },
  17433. "name": {
  17434. "type": "string"
  17435. },
  17436. "env": {
  17437. "type": "array",
  17438. "items": {
  17439. "type": "string"
  17440. }
  17441. },
  17442. "id": {
  17443. "type": "string"
  17444. },
  17445. "npm": {
  17446. "type": "string"
  17447. },
  17448. "whitelist": {
  17449. "type": "array",
  17450. "items": {
  17451. "type": "string"
  17452. }
  17453. },
  17454. "blacklist": {
  17455. "type": "array",
  17456. "items": {
  17457. "type": "string"
  17458. }
  17459. },
  17460. "options": {
  17461. "type": "object",
  17462. "properties": {
  17463. "apiKey": {
  17464. "type": "string"
  17465. },
  17466. "baseURL": {
  17467. "type": "string"
  17468. },
  17469. "enterpriseUrl": {
  17470. "type": "string"
  17471. },
  17472. "setCacheKey": {
  17473. "type": "boolean"
  17474. },
  17475. "timeout": {
  17476. "anyOf": [
  17477. {
  17478. "type": "integer",
  17479. "exclusiveMinimum": 0
  17480. },
  17481. {
  17482. "type": "boolean",
  17483. "enum": [false]
  17484. }
  17485. ],
  17486. "description": "Timeout in milliseconds for full requests to this provider. Set to false to disable timeout."
  17487. },
  17488. "headerTimeout": {
  17489. "anyOf": [
  17490. {
  17491. "type": "integer",
  17492. "exclusiveMinimum": 0
  17493. },
  17494. {
  17495. "type": "boolean",
  17496. "enum": [false]
  17497. }
  17498. ],
  17499. "description": "Timeout in milliseconds to wait for response headers. Provider integrations may set defaults. Set to false to disable timeout."
  17500. },
  17501. "chunkTimeout": {
  17502. "type": "integer",
  17503. "exclusiveMinimum": 0
  17504. }
  17505. },
  17506. "additionalProperties": {}
  17507. },
  17508. "models": {
  17509. "type": "object",
  17510. "additionalProperties": {
  17511. "type": "object",
  17512. "properties": {
  17513. "id": {
  17514. "type": "string"
  17515. },
  17516. "name": {
  17517. "type": "string"
  17518. },
  17519. "family": {
  17520. "type": "string"
  17521. },
  17522. "release_date": {
  17523. "type": "string"
  17524. },
  17525. "attachment": {
  17526. "type": "boolean"
  17527. },
  17528. "reasoning": {
  17529. "type": "boolean"
  17530. },
  17531. "temperature": {
  17532. "type": "boolean"
  17533. },
  17534. "tool_call": {
  17535. "type": "boolean"
  17536. },
  17537. "interleaved": {
  17538. "anyOf": [
  17539. {
  17540. "type": "boolean",
  17541. "enum": [true]
  17542. },
  17543. {
  17544. "type": "object",
  17545. "properties": {
  17546. "field": {
  17547. "type": "string",
  17548. "enum": ["reasoning_content", "reasoning_details"]
  17549. }
  17550. },
  17551. "required": ["field"],
  17552. "additionalProperties": false
  17553. }
  17554. ]
  17555. },
  17556. "cost": {
  17557. "type": "object",
  17558. "properties": {
  17559. "input": {
  17560. "type": "number"
  17561. },
  17562. "output": {
  17563. "type": "number"
  17564. },
  17565. "cache_read": {
  17566. "type": "number"
  17567. },
  17568. "cache_write": {
  17569. "type": "number"
  17570. },
  17571. "context_over_200k": {
  17572. "type": "object",
  17573. "properties": {
  17574. "input": {
  17575. "type": "number"
  17576. },
  17577. "output": {
  17578. "type": "number"
  17579. },
  17580. "cache_read": {
  17581. "type": "number"
  17582. },
  17583. "cache_write": {
  17584. "type": "number"
  17585. }
  17586. },
  17587. "required": ["input", "output"],
  17588. "additionalProperties": false
  17589. }
  17590. },
  17591. "required": ["input", "output"],
  17592. "additionalProperties": false
  17593. },
  17594. "limit": {
  17595. "type": "object",
  17596. "properties": {
  17597. "context": {
  17598. "type": "number"
  17599. },
  17600. "input": {
  17601. "type": "number"
  17602. },
  17603. "output": {
  17604. "type": "number"
  17605. }
  17606. },
  17607. "required": ["context", "output"],
  17608. "additionalProperties": false
  17609. },
  17610. "modalities": {
  17611. "type": "object",
  17612. "properties": {
  17613. "input": {
  17614. "type": "array",
  17615. "items": {
  17616. "type": "string",
  17617. "enum": ["text", "audio", "image", "video", "pdf"]
  17618. }
  17619. },
  17620. "output": {
  17621. "type": "array",
  17622. "items": {
  17623. "type": "string",
  17624. "enum": ["text", "audio", "image", "video", "pdf"]
  17625. }
  17626. }
  17627. },
  17628. "additionalProperties": false
  17629. },
  17630. "experimental": {
  17631. "type": "boolean"
  17632. },
  17633. "status": {
  17634. "type": "string",
  17635. "enum": ["alpha", "beta", "deprecated", "active"]
  17636. },
  17637. "provider": {
  17638. "type": "object",
  17639. "properties": {
  17640. "npm": {
  17641. "type": "string"
  17642. },
  17643. "api": {
  17644. "type": "string"
  17645. }
  17646. },
  17647. "additionalProperties": false
  17648. },
  17649. "options": {
  17650. "type": "object"
  17651. },
  17652. "headers": {
  17653. "type": "object",
  17654. "additionalProperties": {
  17655. "type": "string"
  17656. }
  17657. },
  17658. "variants": {
  17659. "type": "object",
  17660. "additionalProperties": {
  17661. "type": "object",
  17662. "properties": {
  17663. "disabled": {
  17664. "type": "boolean"
  17665. }
  17666. },
  17667. "additionalProperties": {}
  17668. },
  17669. "description": "Variant-specific configuration"
  17670. }
  17671. },
  17672. "additionalProperties": false
  17673. }
  17674. }
  17675. },
  17676. "additionalProperties": false
  17677. },
  17678. "McpLocalConfig": {
  17679. "type": "object",
  17680. "properties": {
  17681. "type": {
  17682. "type": "string",
  17683. "enum": ["local"],
  17684. "description": "Type of MCP server connection"
  17685. },
  17686. "command": {
  17687. "type": "array",
  17688. "items": {
  17689. "type": "string"
  17690. },
  17691. "description": "Command and arguments to run the MCP server"
  17692. },
  17693. "environment": {
  17694. "type": "object",
  17695. "additionalProperties": {
  17696. "type": "string"
  17697. }
  17698. },
  17699. "enabled": {
  17700. "type": "boolean"
  17701. },
  17702. "timeout": {
  17703. "type": "integer",
  17704. "exclusiveMinimum": 0
  17705. }
  17706. },
  17707. "required": ["type", "command"],
  17708. "additionalProperties": false
  17709. },
  17710. "McpOAuthConfig": {
  17711. "type": "object",
  17712. "properties": {
  17713. "clientId": {
  17714. "type": "string"
  17715. },
  17716. "clientSecret": {
  17717. "type": "string"
  17718. },
  17719. "scope": {
  17720. "type": "string"
  17721. },
  17722. "callbackPort": {
  17723. "type": "integer",
  17724. "minimum": 1,
  17725. "maximum": 65535
  17726. },
  17727. "redirectUri": {
  17728. "type": "string"
  17729. }
  17730. },
  17731. "additionalProperties": false
  17732. },
  17733. "McpRemoteConfig": {
  17734. "type": "object",
  17735. "properties": {
  17736. "type": {
  17737. "type": "string",
  17738. "enum": ["remote"],
  17739. "description": "Type of MCP server connection"
  17740. },
  17741. "url": {
  17742. "type": "string",
  17743. "description": "URL of the remote MCP server"
  17744. },
  17745. "enabled": {
  17746. "type": "boolean"
  17747. },
  17748. "headers": {
  17749. "type": "object",
  17750. "additionalProperties": {
  17751. "type": "string"
  17752. }
  17753. },
  17754. "oauth": {
  17755. "anyOf": [
  17756. {
  17757. "$ref": "#/components/schemas/McpOAuthConfig"
  17758. },
  17759. {
  17760. "type": "boolean",
  17761. "enum": [false]
  17762. }
  17763. ],
  17764. "description": "OAuth authentication configuration for the MCP server. Set to false to disable OAuth auto-detection."
  17765. },
  17766. "timeout": {
  17767. "type": "integer",
  17768. "exclusiveMinimum": 0
  17769. }
  17770. },
  17771. "required": ["type", "url"],
  17772. "additionalProperties": false
  17773. },
  17774. "LayoutConfig": {
  17775. "type": "string",
  17776. "enum": ["auto", "stretch"],
  17777. "description": "@deprecated Always uses stretch layout."
  17778. },
  17779. "ImageAttachmentConfig": {
  17780. "type": "object",
  17781. "properties": {
  17782. "auto_resize": {
  17783. "type": "boolean"
  17784. },
  17785. "max_width": {
  17786. "type": "integer",
  17787. "exclusiveMinimum": 0
  17788. },
  17789. "max_height": {
  17790. "type": "integer",
  17791. "exclusiveMinimum": 0
  17792. },
  17793. "max_base64_bytes": {
  17794. "type": "integer",
  17795. "exclusiveMinimum": 0
  17796. }
  17797. },
  17798. "additionalProperties": false
  17799. },
  17800. "AttachmentConfig": {
  17801. "type": "object",
  17802. "properties": {
  17803. "image": {
  17804. "$ref": "#/components/schemas/ImageAttachmentConfig"
  17805. }
  17806. },
  17807. "additionalProperties": false
  17808. },
  17809. "Config": {
  17810. "type": "object",
  17811. "properties": {
  17812. "$schema": {
  17813. "type": "string"
  17814. },
  17815. "shell": {
  17816. "type": "string"
  17817. },
  17818. "logLevel": {
  17819. "$ref": "#/components/schemas/LogLevel"
  17820. },
  17821. "server": {
  17822. "$ref": "#/components/schemas/ServerConfig"
  17823. },
  17824. "command": {
  17825. "type": "object",
  17826. "additionalProperties": {
  17827. "type": "object",
  17828. "properties": {
  17829. "template": {
  17830. "type": "string"
  17831. },
  17832. "description": {
  17833. "type": "string"
  17834. },
  17835. "agent": {
  17836. "type": "string"
  17837. },
  17838. "model": {
  17839. "type": "string"
  17840. },
  17841. "variant": {
  17842. "type": "string"
  17843. },
  17844. "subtask": {
  17845. "type": "boolean"
  17846. }
  17847. },
  17848. "required": ["template"],
  17849. "additionalProperties": false
  17850. }
  17851. },
  17852. "skills": {
  17853. "type": "object",
  17854. "properties": {
  17855. "paths": {
  17856. "type": "array",
  17857. "items": {
  17858. "type": "string"
  17859. }
  17860. },
  17861. "urls": {
  17862. "type": "array",
  17863. "items": {
  17864. "type": "string"
  17865. }
  17866. }
  17867. },
  17868. "additionalProperties": false
  17869. },
  17870. "reference": {
  17871. "$ref": "#/components/schemas/ReferenceConfig"
  17872. },
  17873. "watcher": {
  17874. "type": "object",
  17875. "properties": {
  17876. "ignore": {
  17877. "type": "array",
  17878. "items": {
  17879. "type": "string"
  17880. }
  17881. }
  17882. },
  17883. "additionalProperties": false
  17884. },
  17885. "snapshot": {
  17886. "type": "boolean"
  17887. },
  17888. "plugin": {
  17889. "type": "array",
  17890. "items": {
  17891. "anyOf": [
  17892. {
  17893. "type": "string"
  17894. },
  17895. {
  17896. "type": "array",
  17897. "prefixItems": [
  17898. {
  17899. "type": "string"
  17900. },
  17901. {
  17902. "type": "object"
  17903. }
  17904. ],
  17905. "maxItems": 2,
  17906. "minItems": 2
  17907. }
  17908. ]
  17909. }
  17910. },
  17911. "share": {
  17912. "type": "string",
  17913. "enum": ["manual", "auto", "disabled"]
  17914. },
  17915. "autoshare": {
  17916. "type": "boolean"
  17917. },
  17918. "autoupdate": {
  17919. "anyOf": [
  17920. {
  17921. "type": "boolean"
  17922. },
  17923. {
  17924. "type": "string",
  17925. "enum": ["notify"]
  17926. }
  17927. ],
  17928. "description": "Automatically update to the latest version. Set to true to auto-update, false to disable, or 'notify' to show update notifications"
  17929. },
  17930. "disabled_providers": {
  17931. "type": "array",
  17932. "items": {
  17933. "type": "string"
  17934. }
  17935. },
  17936. "enabled_providers": {
  17937. "type": "array",
  17938. "items": {
  17939. "type": "string"
  17940. }
  17941. },
  17942. "model": {
  17943. "type": "string"
  17944. },
  17945. "small_model": {
  17946. "type": "string"
  17947. },
  17948. "default_agent": {
  17949. "type": "string"
  17950. },
  17951. "username": {
  17952. "type": "string"
  17953. },
  17954. "mode": {
  17955. "type": "object",
  17956. "properties": {
  17957. "build": {
  17958. "$ref": "#/components/schemas/AgentConfig"
  17959. },
  17960. "plan": {
  17961. "$ref": "#/components/schemas/AgentConfig"
  17962. }
  17963. },
  17964. "additionalProperties": {
  17965. "$ref": "#/components/schemas/AgentConfig"
  17966. }
  17967. },
  17968. "agent": {
  17969. "type": "object",
  17970. "properties": {
  17971. "plan": {
  17972. "$ref": "#/components/schemas/AgentConfig"
  17973. },
  17974. "build": {
  17975. "$ref": "#/components/schemas/AgentConfig"
  17976. },
  17977. "general": {
  17978. "$ref": "#/components/schemas/AgentConfig"
  17979. },
  17980. "explore": {
  17981. "$ref": "#/components/schemas/AgentConfig"
  17982. },
  17983. "title": {
  17984. "$ref": "#/components/schemas/AgentConfig"
  17985. },
  17986. "summary": {
  17987. "$ref": "#/components/schemas/AgentConfig"
  17988. },
  17989. "compaction": {
  17990. "$ref": "#/components/schemas/AgentConfig"
  17991. }
  17992. },
  17993. "additionalProperties": {
  17994. "$ref": "#/components/schemas/AgentConfig"
  17995. }
  17996. },
  17997. "provider": {
  17998. "type": "object",
  17999. "additionalProperties": {
  18000. "$ref": "#/components/schemas/ProviderConfig"
  18001. }
  18002. },
  18003. "mcp": {
  18004. "type": "object",
  18005. "additionalProperties": {
  18006. "anyOf": [
  18007. {
  18008. "$ref": "#/components/schemas/McpLocalConfig"
  18009. },
  18010. {
  18011. "$ref": "#/components/schemas/McpRemoteConfig"
  18012. },
  18013. {
  18014. "type": "object",
  18015. "properties": {
  18016. "enabled": {
  18017. "type": "boolean"
  18018. }
  18019. },
  18020. "required": ["enabled"],
  18021. "additionalProperties": false
  18022. }
  18023. ]
  18024. }
  18025. },
  18026. "formatter": {
  18027. "anyOf": [
  18028. {
  18029. "type": "boolean"
  18030. },
  18031. {
  18032. "type": "object",
  18033. "additionalProperties": {
  18034. "type": "object",
  18035. "properties": {
  18036. "disabled": {
  18037. "type": "boolean"
  18038. },
  18039. "command": {
  18040. "type": "array",
  18041. "items": {
  18042. "type": "string"
  18043. }
  18044. },
  18045. "environment": {
  18046. "type": "object",
  18047. "additionalProperties": {
  18048. "type": "string"
  18049. }
  18050. },
  18051. "extensions": {
  18052. "type": "array",
  18053. "items": {
  18054. "type": "string"
  18055. }
  18056. }
  18057. },
  18058. "additionalProperties": false
  18059. }
  18060. }
  18061. ],
  18062. "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."
  18063. },
  18064. "lsp": {
  18065. "anyOf": [
  18066. {
  18067. "type": "boolean"
  18068. },
  18069. {
  18070. "type": "object",
  18071. "additionalProperties": {
  18072. "anyOf": [
  18073. {
  18074. "type": "object",
  18075. "properties": {
  18076. "disabled": {
  18077. "type": "boolean",
  18078. "enum": [true]
  18079. }
  18080. },
  18081. "required": ["disabled"],
  18082. "additionalProperties": false
  18083. },
  18084. {
  18085. "type": "object",
  18086. "properties": {
  18087. "command": {
  18088. "type": "array",
  18089. "items": {
  18090. "type": "string"
  18091. }
  18092. },
  18093. "extensions": {
  18094. "type": "array",
  18095. "items": {
  18096. "type": "string"
  18097. }
  18098. },
  18099. "disabled": {
  18100. "type": "boolean"
  18101. },
  18102. "env": {
  18103. "type": "object",
  18104. "additionalProperties": {
  18105. "type": "string"
  18106. }
  18107. },
  18108. "initialization": {
  18109. "type": "object"
  18110. }
  18111. },
  18112. "required": ["command"],
  18113. "additionalProperties": false
  18114. }
  18115. ]
  18116. }
  18117. }
  18118. ],
  18119. "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."
  18120. },
  18121. "instructions": {
  18122. "type": "array",
  18123. "items": {
  18124. "type": "string"
  18125. }
  18126. },
  18127. "layout": {
  18128. "$ref": "#/components/schemas/LayoutConfig"
  18129. },
  18130. "permission": {
  18131. "$ref": "#/components/schemas/PermissionConfig"
  18132. },
  18133. "tools": {
  18134. "type": "object",
  18135. "additionalProperties": {
  18136. "type": "boolean"
  18137. }
  18138. },
  18139. "attachment": {
  18140. "$ref": "#/components/schemas/AttachmentConfig"
  18141. },
  18142. "enterprise": {
  18143. "type": "object",
  18144. "properties": {
  18145. "url": {
  18146. "type": "string"
  18147. }
  18148. },
  18149. "additionalProperties": false
  18150. },
  18151. "tool_output": {
  18152. "type": "object",
  18153. "properties": {
  18154. "max_lines": {
  18155. "type": "integer",
  18156. "exclusiveMinimum": 0
  18157. },
  18158. "max_bytes": {
  18159. "type": "integer",
  18160. "exclusiveMinimum": 0
  18161. }
  18162. },
  18163. "additionalProperties": false
  18164. },
  18165. "compaction": {
  18166. "type": "object",
  18167. "properties": {
  18168. "auto": {
  18169. "type": "boolean"
  18170. },
  18171. "prune": {
  18172. "type": "boolean"
  18173. },
  18174. "tail_turns": {
  18175. "type": "integer",
  18176. "minimum": 0
  18177. },
  18178. "preserve_recent_tokens": {
  18179. "type": "integer",
  18180. "minimum": 0
  18181. },
  18182. "reserved": {
  18183. "type": "integer",
  18184. "minimum": 0
  18185. }
  18186. },
  18187. "additionalProperties": false
  18188. },
  18189. "experimental": {
  18190. "type": "object",
  18191. "properties": {
  18192. "disable_paste_summary": {
  18193. "type": "boolean"
  18194. },
  18195. "batch_tool": {
  18196. "type": "boolean"
  18197. },
  18198. "openTelemetry": {
  18199. "type": "boolean"
  18200. },
  18201. "primary_tools": {
  18202. "type": "array",
  18203. "items": {
  18204. "type": "string"
  18205. }
  18206. },
  18207. "continue_loop_on_deny": {
  18208. "type": "boolean"
  18209. },
  18210. "mcp_timeout": {
  18211. "type": "integer",
  18212. "exclusiveMinimum": 0
  18213. },
  18214. "policies": {
  18215. "type": "array",
  18216. "items": {
  18217. "$ref": "#/components/schemas/ConfigV2ExperimentalPolicy"
  18218. }
  18219. }
  18220. },
  18221. "additionalProperties": false
  18222. }
  18223. },
  18224. "additionalProperties": false
  18225. },
  18226. "Model": {
  18227. "type": "object",
  18228. "properties": {
  18229. "id": {
  18230. "type": "string"
  18231. },
  18232. "providerID": {
  18233. "type": "string"
  18234. },
  18235. "api": {
  18236. "type": "object",
  18237. "properties": {
  18238. "id": {
  18239. "type": "string"
  18240. },
  18241. "url": {
  18242. "type": "string"
  18243. },
  18244. "npm": {
  18245. "type": "string"
  18246. }
  18247. },
  18248. "required": ["id", "url", "npm"],
  18249. "additionalProperties": false
  18250. },
  18251. "name": {
  18252. "type": "string"
  18253. },
  18254. "family": {
  18255. "type": "string"
  18256. },
  18257. "capabilities": {
  18258. "type": "object",
  18259. "properties": {
  18260. "temperature": {
  18261. "type": "boolean"
  18262. },
  18263. "reasoning": {
  18264. "type": "boolean"
  18265. },
  18266. "attachment": {
  18267. "type": "boolean"
  18268. },
  18269. "toolcall": {
  18270. "type": "boolean"
  18271. },
  18272. "input": {
  18273. "type": "object",
  18274. "properties": {
  18275. "text": {
  18276. "type": "boolean"
  18277. },
  18278. "audio": {
  18279. "type": "boolean"
  18280. },
  18281. "image": {
  18282. "type": "boolean"
  18283. },
  18284. "video": {
  18285. "type": "boolean"
  18286. },
  18287. "pdf": {
  18288. "type": "boolean"
  18289. }
  18290. },
  18291. "required": ["text", "audio", "image", "video", "pdf"],
  18292. "additionalProperties": false
  18293. },
  18294. "output": {
  18295. "type": "object",
  18296. "properties": {
  18297. "text": {
  18298. "type": "boolean"
  18299. },
  18300. "audio": {
  18301. "type": "boolean"
  18302. },
  18303. "image": {
  18304. "type": "boolean"
  18305. },
  18306. "video": {
  18307. "type": "boolean"
  18308. },
  18309. "pdf": {
  18310. "type": "boolean"
  18311. }
  18312. },
  18313. "required": ["text", "audio", "image", "video", "pdf"],
  18314. "additionalProperties": false
  18315. },
  18316. "interleaved": {
  18317. "anyOf": [
  18318. {
  18319. "type": "boolean"
  18320. },
  18321. {
  18322. "type": "object",
  18323. "properties": {
  18324. "field": {
  18325. "type": "string",
  18326. "enum": ["reasoning_content", "reasoning_details"]
  18327. }
  18328. },
  18329. "required": ["field"],
  18330. "additionalProperties": false
  18331. }
  18332. ]
  18333. }
  18334. },
  18335. "required": ["temperature", "reasoning", "attachment", "toolcall", "input", "output", "interleaved"],
  18336. "additionalProperties": false
  18337. },
  18338. "cost": {
  18339. "type": "object",
  18340. "properties": {
  18341. "input": {
  18342. "type": "number"
  18343. },
  18344. "output": {
  18345. "type": "number"
  18346. },
  18347. "cache": {
  18348. "type": "object",
  18349. "properties": {
  18350. "read": {
  18351. "type": "number"
  18352. },
  18353. "write": {
  18354. "type": "number"
  18355. }
  18356. },
  18357. "required": ["read", "write"],
  18358. "additionalProperties": false
  18359. },
  18360. "tiers": {
  18361. "type": "array",
  18362. "items": {
  18363. "type": "object",
  18364. "properties": {
  18365. "input": {
  18366. "type": "number"
  18367. },
  18368. "output": {
  18369. "type": "number"
  18370. },
  18371. "cache": {
  18372. "type": "object",
  18373. "properties": {
  18374. "read": {
  18375. "type": "number"
  18376. },
  18377. "write": {
  18378. "type": "number"
  18379. }
  18380. },
  18381. "required": ["read", "write"],
  18382. "additionalProperties": false
  18383. },
  18384. "tier": {
  18385. "type": "object",
  18386. "properties": {
  18387. "type": {
  18388. "type": "string",
  18389. "enum": ["context"]
  18390. },
  18391. "size": {
  18392. "type": "number"
  18393. }
  18394. },
  18395. "required": ["type", "size"],
  18396. "additionalProperties": false
  18397. }
  18398. },
  18399. "required": ["input", "output", "cache", "tier"],
  18400. "additionalProperties": false
  18401. }
  18402. },
  18403. "experimentalOver200K": {
  18404. "type": "object",
  18405. "properties": {
  18406. "input": {
  18407. "type": "number"
  18408. },
  18409. "output": {
  18410. "type": "number"
  18411. },
  18412. "cache": {
  18413. "type": "object",
  18414. "properties": {
  18415. "read": {
  18416. "type": "number"
  18417. },
  18418. "write": {
  18419. "type": "number"
  18420. }
  18421. },
  18422. "required": ["read", "write"],
  18423. "additionalProperties": false
  18424. }
  18425. },
  18426. "required": ["input", "output", "cache"],
  18427. "additionalProperties": false
  18428. }
  18429. },
  18430. "required": ["input", "output", "cache"],
  18431. "additionalProperties": false
  18432. },
  18433. "limit": {
  18434. "type": "object",
  18435. "properties": {
  18436. "context": {
  18437. "type": "number"
  18438. },
  18439. "input": {
  18440. "type": "number"
  18441. },
  18442. "output": {
  18443. "type": "number"
  18444. }
  18445. },
  18446. "required": ["context", "output"],
  18447. "additionalProperties": false
  18448. },
  18449. "status": {
  18450. "type": "string",
  18451. "enum": ["alpha", "beta", "deprecated", "active"]
  18452. },
  18453. "options": {
  18454. "type": "object"
  18455. },
  18456. "headers": {
  18457. "type": "object",
  18458. "additionalProperties": {
  18459. "type": "string"
  18460. }
  18461. },
  18462. "release_date": {
  18463. "type": "string"
  18464. },
  18465. "variants": {
  18466. "type": "object",
  18467. "additionalProperties": {
  18468. "type": "object"
  18469. }
  18470. }
  18471. },
  18472. "required": [
  18473. "id",
  18474. "providerID",
  18475. "api",
  18476. "name",
  18477. "capabilities",
  18478. "cost",
  18479. "limit",
  18480. "status",
  18481. "options",
  18482. "headers",
  18483. "release_date"
  18484. ],
  18485. "additionalProperties": false
  18486. },
  18487. "Provider": {
  18488. "type": "object",
  18489. "properties": {
  18490. "id": {
  18491. "type": "string"
  18492. },
  18493. "name": {
  18494. "type": "string"
  18495. },
  18496. "source": {
  18497. "type": "string",
  18498. "enum": ["env", "config", "custom", "api"]
  18499. },
  18500. "env": {
  18501. "type": "array",
  18502. "items": {
  18503. "type": "string"
  18504. }
  18505. },
  18506. "key": {
  18507. "type": "string"
  18508. },
  18509. "options": {
  18510. "type": "object"
  18511. },
  18512. "models": {
  18513. "type": "object",
  18514. "additionalProperties": {
  18515. "$ref": "#/components/schemas/Model"
  18516. }
  18517. }
  18518. },
  18519. "required": ["id", "name", "source", "env", "options", "models"],
  18520. "additionalProperties": false
  18521. },
  18522. "ConsoleState": {
  18523. "type": "object",
  18524. "properties": {
  18525. "consoleManagedProviders": {
  18526. "type": "array",
  18527. "items": {
  18528. "type": "string"
  18529. }
  18530. },
  18531. "activeOrgName": {
  18532. "type": "string"
  18533. },
  18534. "switchableOrgCount": {
  18535. "type": "integer",
  18536. "minimum": 0
  18537. }
  18538. },
  18539. "required": ["consoleManagedProviders", "switchableOrgCount"],
  18540. "additionalProperties": false
  18541. },
  18542. "effect_HttpApiError_InternalServerError": {
  18543. "type": "object",
  18544. "properties": {
  18545. "_tag": {
  18546. "type": "string",
  18547. "enum": ["InternalServerError"]
  18548. }
  18549. },
  18550. "required": ["_tag"],
  18551. "additionalProperties": false
  18552. },
  18553. "ToolListItem": {
  18554. "type": "object",
  18555. "properties": {
  18556. "id": {
  18557. "type": "string"
  18558. },
  18559. "description": {
  18560. "type": "string"
  18561. },
  18562. "parameters": {}
  18563. },
  18564. "required": ["id", "description", "parameters"],
  18565. "additionalProperties": false
  18566. },
  18567. "ToolList": {
  18568. "type": "array",
  18569. "items": {
  18570. "$ref": "#/components/schemas/ToolListItem"
  18571. }
  18572. },
  18573. "ToolIDs": {
  18574. "type": "array",
  18575. "items": {
  18576. "type": "string"
  18577. }
  18578. },
  18579. "WorktreeError": {
  18580. "type": "object",
  18581. "properties": {
  18582. "name": {
  18583. "type": "string",
  18584. "enum": [
  18585. "WorktreeNotGitError",
  18586. "WorktreeNameGenerationFailedError",
  18587. "WorktreeCreateFailedError",
  18588. "WorktreeStartCommandFailedError",
  18589. "WorktreeRemoveFailedError",
  18590. "WorktreeResetFailedError",
  18591. "WorktreeListFailedError"
  18592. ]
  18593. },
  18594. "data": {
  18595. "type": "object",
  18596. "properties": {
  18597. "message": {
  18598. "type": "string"
  18599. }
  18600. },
  18601. "required": ["message"],
  18602. "additionalProperties": false
  18603. }
  18604. },
  18605. "required": ["name", "data"],
  18606. "additionalProperties": false
  18607. },
  18608. "WorktreeCreateInput": {
  18609. "type": "object",
  18610. "properties": {
  18611. "name": {
  18612. "type": "string"
  18613. },
  18614. "startCommand": {
  18615. "type": "string",
  18616. "description": "Additional startup script to run after the project's start command"
  18617. }
  18618. },
  18619. "additionalProperties": false
  18620. },
  18621. "Worktree": {
  18622. "type": "object",
  18623. "properties": {
  18624. "name": {
  18625. "type": "string"
  18626. },
  18627. "branch": {
  18628. "type": "string"
  18629. },
  18630. "directory": {
  18631. "type": "string"
  18632. }
  18633. },
  18634. "required": ["name", "directory"],
  18635. "additionalProperties": false
  18636. },
  18637. "WorktreeRemoveInput": {
  18638. "type": "object",
  18639. "properties": {
  18640. "directory": {
  18641. "type": "string"
  18642. }
  18643. },
  18644. "required": ["directory"],
  18645. "additionalProperties": false
  18646. },
  18647. "WorktreeResetInput": {
  18648. "type": "object",
  18649. "properties": {
  18650. "directory": {
  18651. "type": "string"
  18652. }
  18653. },
  18654. "required": ["directory"],
  18655. "additionalProperties": false
  18656. },
  18657. "ProjectSummary": {
  18658. "type": "object",
  18659. "properties": {
  18660. "id": {
  18661. "type": "string"
  18662. },
  18663. "name": {
  18664. "type": "string"
  18665. },
  18666. "worktree": {
  18667. "type": "string"
  18668. }
  18669. },
  18670. "required": ["id", "worktree"],
  18671. "additionalProperties": false
  18672. },
  18673. "GlobalSession": {
  18674. "type": "object",
  18675. "properties": {
  18676. "id": {
  18677. "type": "string",
  18678. "pattern": "^ses"
  18679. },
  18680. "slug": {
  18681. "type": "string"
  18682. },
  18683. "projectID": {
  18684. "type": "string"
  18685. },
  18686. "workspaceID": {
  18687. "type": "string",
  18688. "pattern": "^wrk"
  18689. },
  18690. "directory": {
  18691. "type": "string"
  18692. },
  18693. "path": {
  18694. "type": "string"
  18695. },
  18696. "parentID": {
  18697. "type": "string",
  18698. "pattern": "^ses"
  18699. },
  18700. "summary": {
  18701. "type": "object",
  18702. "properties": {
  18703. "additions": {
  18704. "type": "number"
  18705. },
  18706. "deletions": {
  18707. "type": "number"
  18708. },
  18709. "files": {
  18710. "type": "number"
  18711. },
  18712. "diffs": {
  18713. "type": "array",
  18714. "items": {
  18715. "$ref": "#/components/schemas/SnapshotFileDiff"
  18716. }
  18717. }
  18718. },
  18719. "required": ["additions", "deletions", "files"],
  18720. "additionalProperties": false
  18721. },
  18722. "cost": {
  18723. "type": "number"
  18724. },
  18725. "tokens": {
  18726. "type": "object",
  18727. "properties": {
  18728. "input": {
  18729. "type": "number"
  18730. },
  18731. "output": {
  18732. "type": "number"
  18733. },
  18734. "reasoning": {
  18735. "type": "number"
  18736. },
  18737. "cache": {
  18738. "type": "object",
  18739. "properties": {
  18740. "read": {
  18741. "type": "number"
  18742. },
  18743. "write": {
  18744. "type": "number"
  18745. }
  18746. },
  18747. "required": ["read", "write"],
  18748. "additionalProperties": false
  18749. }
  18750. },
  18751. "required": ["input", "output", "reasoning", "cache"],
  18752. "additionalProperties": false
  18753. },
  18754. "share": {
  18755. "type": "object",
  18756. "properties": {
  18757. "url": {
  18758. "type": "string"
  18759. }
  18760. },
  18761. "required": ["url"],
  18762. "additionalProperties": false
  18763. },
  18764. "title": {
  18765. "type": "string"
  18766. },
  18767. "agent": {
  18768. "type": "string"
  18769. },
  18770. "model": {
  18771. "type": "object",
  18772. "properties": {
  18773. "id": {
  18774. "type": "string"
  18775. },
  18776. "providerID": {
  18777. "type": "string"
  18778. },
  18779. "variant": {
  18780. "type": "string"
  18781. }
  18782. },
  18783. "required": ["id", "providerID"],
  18784. "additionalProperties": false
  18785. },
  18786. "version": {
  18787. "type": "string"
  18788. },
  18789. "metadata": {
  18790. "type": "object"
  18791. },
  18792. "time": {
  18793. "type": "object",
  18794. "properties": {
  18795. "created": {
  18796. "type": "integer",
  18797. "minimum": 0
  18798. },
  18799. "updated": {
  18800. "type": "integer",
  18801. "minimum": 0
  18802. },
  18803. "compacting": {
  18804. "type": "integer",
  18805. "minimum": 0
  18806. },
  18807. "archived": {
  18808. "type": "number"
  18809. }
  18810. },
  18811. "required": ["created", "updated"],
  18812. "additionalProperties": false
  18813. },
  18814. "permission": {
  18815. "$ref": "#/components/schemas/PermissionRuleset"
  18816. },
  18817. "revert": {
  18818. "type": "object",
  18819. "properties": {
  18820. "messageID": {
  18821. "type": "string",
  18822. "pattern": "^msg"
  18823. },
  18824. "partID": {
  18825. "type": "string",
  18826. "pattern": "^prt"
  18827. },
  18828. "snapshot": {
  18829. "type": "string"
  18830. },
  18831. "diff": {
  18832. "type": "string"
  18833. }
  18834. },
  18835. "required": ["messageID"],
  18836. "additionalProperties": false
  18837. },
  18838. "project": {
  18839. "anyOf": [
  18840. {
  18841. "$ref": "#/components/schemas/ProjectSummary"
  18842. },
  18843. {
  18844. "type": "null"
  18845. }
  18846. ]
  18847. }
  18848. },
  18849. "required": ["id", "slug", "projectID", "directory", "title", "version", "time", "project"],
  18850. "additionalProperties": false
  18851. },
  18852. "McpResource": {
  18853. "type": "object",
  18854. "properties": {
  18855. "name": {
  18856. "type": "string"
  18857. },
  18858. "uri": {
  18859. "type": "string"
  18860. },
  18861. "description": {
  18862. "type": "string"
  18863. },
  18864. "mimeType": {
  18865. "type": "string"
  18866. },
  18867. "client": {
  18868. "type": "string"
  18869. }
  18870. },
  18871. "required": ["name", "uri", "client"],
  18872. "additionalProperties": false
  18873. },
  18874. "Symbol": {
  18875. "type": "object",
  18876. "properties": {
  18877. "name": {
  18878. "type": "string"
  18879. },
  18880. "kind": {
  18881. "type": "integer",
  18882. "minimum": 0
  18883. },
  18884. "location": {
  18885. "type": "object",
  18886. "properties": {
  18887. "uri": {
  18888. "type": "string"
  18889. },
  18890. "range": {
  18891. "$ref": "#/components/schemas/Range"
  18892. }
  18893. },
  18894. "required": ["uri", "range"],
  18895. "additionalProperties": false
  18896. }
  18897. },
  18898. "required": ["name", "kind", "location"],
  18899. "additionalProperties": false
  18900. },
  18901. "FileNode": {
  18902. "type": "object",
  18903. "properties": {
  18904. "name": {
  18905. "type": "string"
  18906. },
  18907. "path": {
  18908. "type": "string"
  18909. },
  18910. "absolute": {
  18911. "type": "string"
  18912. },
  18913. "type": {
  18914. "type": "string",
  18915. "enum": ["file", "directory"]
  18916. },
  18917. "ignored": {
  18918. "type": "boolean"
  18919. }
  18920. },
  18921. "required": ["name", "path", "absolute", "type", "ignored"],
  18922. "additionalProperties": false
  18923. },
  18924. "FileContent": {
  18925. "type": "object",
  18926. "properties": {
  18927. "type": {
  18928. "type": "string",
  18929. "enum": ["text", "binary"]
  18930. },
  18931. "content": {
  18932. "type": "string"
  18933. },
  18934. "diff": {
  18935. "type": "string"
  18936. },
  18937. "patch": {
  18938. "type": "object",
  18939. "properties": {
  18940. "oldFileName": {
  18941. "type": "string"
  18942. },
  18943. "newFileName": {
  18944. "type": "string"
  18945. },
  18946. "oldHeader": {
  18947. "type": "string"
  18948. },
  18949. "newHeader": {
  18950. "type": "string"
  18951. },
  18952. "hunks": {
  18953. "type": "array",
  18954. "items": {
  18955. "type": "object",
  18956. "properties": {
  18957. "oldStart": {
  18958. "type": "integer",
  18959. "minimum": 0
  18960. },
  18961. "oldLines": {
  18962. "type": "integer",
  18963. "minimum": 0
  18964. },
  18965. "newStart": {
  18966. "type": "integer",
  18967. "minimum": 0
  18968. },
  18969. "newLines": {
  18970. "type": "integer",
  18971. "minimum": 0
  18972. },
  18973. "lines": {
  18974. "type": "array",
  18975. "items": {
  18976. "type": "string"
  18977. }
  18978. }
  18979. },
  18980. "required": ["oldStart", "oldLines", "newStart", "newLines", "lines"],
  18981. "additionalProperties": false
  18982. }
  18983. },
  18984. "index": {
  18985. "type": "string"
  18986. }
  18987. },
  18988. "required": ["oldFileName", "newFileName", "hunks"],
  18989. "additionalProperties": false
  18990. },
  18991. "encoding": {
  18992. "type": "string",
  18993. "enum": ["base64"]
  18994. },
  18995. "mimeType": {
  18996. "type": "string"
  18997. }
  18998. },
  18999. "required": ["type", "content"],
  19000. "additionalProperties": false
  19001. },
  19002. "File": {
  19003. "type": "object",
  19004. "properties": {
  19005. "path": {
  19006. "type": "string"
  19007. },
  19008. "added": {
  19009. "type": "integer",
  19010. "minimum": 0
  19011. },
  19012. "removed": {
  19013. "type": "integer",
  19014. "minimum": 0
  19015. },
  19016. "status": {
  19017. "type": "string",
  19018. "enum": ["added", "deleted", "modified"]
  19019. }
  19020. },
  19021. "required": ["path", "added", "removed", "status"],
  19022. "additionalProperties": false
  19023. },
  19024. "Path": {
  19025. "type": "object",
  19026. "properties": {
  19027. "home": {
  19028. "type": "string"
  19029. },
  19030. "state": {
  19031. "type": "string"
  19032. },
  19033. "config": {
  19034. "type": "string"
  19035. },
  19036. "worktree": {
  19037. "type": "string"
  19038. },
  19039. "directory": {
  19040. "type": "string"
  19041. }
  19042. },
  19043. "required": ["home", "state", "config", "worktree", "directory"],
  19044. "additionalProperties": false
  19045. },
  19046. "VcsInfo": {
  19047. "type": "object",
  19048. "properties": {
  19049. "branch": {
  19050. "type": "string"
  19051. },
  19052. "default_branch": {
  19053. "type": "string"
  19054. }
  19055. },
  19056. "additionalProperties": false
  19057. },
  19058. "VcsFileStatus": {
  19059. "type": "object",
  19060. "properties": {
  19061. "file": {
  19062. "type": "string"
  19063. },
  19064. "additions": {
  19065. "type": "number"
  19066. },
  19067. "deletions": {
  19068. "type": "number"
  19069. },
  19070. "status": {
  19071. "type": "string",
  19072. "enum": ["added", "deleted", "modified"]
  19073. }
  19074. },
  19075. "required": ["file", "additions", "deletions", "status"],
  19076. "additionalProperties": false
  19077. },
  19078. "VcsFileDiff": {
  19079. "type": "object",
  19080. "properties": {
  19081. "file": {
  19082. "type": "string"
  19083. },
  19084. "patch": {
  19085. "type": "string"
  19086. },
  19087. "additions": {
  19088. "type": "number"
  19089. },
  19090. "deletions": {
  19091. "type": "number"
  19092. },
  19093. "status": {
  19094. "type": "string",
  19095. "enum": ["added", "deleted", "modified"]
  19096. }
  19097. },
  19098. "required": ["file", "additions", "deletions"],
  19099. "additionalProperties": false
  19100. },
  19101. "VcsApplyError": {
  19102. "type": "object",
  19103. "properties": {
  19104. "name": {
  19105. "type": "string",
  19106. "enum": ["VcsApplyError"]
  19107. },
  19108. "data": {
  19109. "type": "object",
  19110. "properties": {
  19111. "message": {
  19112. "type": "string"
  19113. },
  19114. "reason": {
  19115. "type": "string",
  19116. "enum": ["non-git", "not-clean"]
  19117. }
  19118. },
  19119. "required": ["message", "reason"],
  19120. "additionalProperties": false
  19121. }
  19122. },
  19123. "required": ["name", "data"],
  19124. "additionalProperties": false
  19125. },
  19126. "Command": {
  19127. "type": "object",
  19128. "properties": {
  19129. "name": {
  19130. "type": "string"
  19131. },
  19132. "description": {
  19133. "type": "string"
  19134. },
  19135. "agent": {
  19136. "type": "string"
  19137. },
  19138. "model": {
  19139. "type": "string"
  19140. },
  19141. "source": {
  19142. "type": "string",
  19143. "enum": ["command", "mcp", "skill"]
  19144. },
  19145. "template": {
  19146. "type": "string"
  19147. },
  19148. "subtask": {
  19149. "type": "boolean"
  19150. },
  19151. "hints": {
  19152. "type": "array",
  19153. "items": {
  19154. "type": "string"
  19155. }
  19156. }
  19157. },
  19158. "required": ["name", "template", "hints"],
  19159. "additionalProperties": false
  19160. },
  19161. "Agent": {
  19162. "type": "object",
  19163. "properties": {
  19164. "name": {
  19165. "type": "string"
  19166. },
  19167. "description": {
  19168. "type": "string"
  19169. },
  19170. "mode": {
  19171. "type": "string",
  19172. "enum": ["subagent", "primary", "all"]
  19173. },
  19174. "native": {
  19175. "type": "boolean"
  19176. },
  19177. "hidden": {
  19178. "type": "boolean"
  19179. },
  19180. "topP": {
  19181. "type": "number"
  19182. },
  19183. "temperature": {
  19184. "type": "number"
  19185. },
  19186. "color": {
  19187. "type": "string"
  19188. },
  19189. "permission": {
  19190. "$ref": "#/components/schemas/PermissionRuleset"
  19191. },
  19192. "model": {
  19193. "type": "object",
  19194. "properties": {
  19195. "modelID": {
  19196. "type": "string"
  19197. },
  19198. "providerID": {
  19199. "type": "string"
  19200. }
  19201. },
  19202. "required": ["modelID", "providerID"],
  19203. "additionalProperties": false
  19204. },
  19205. "variant": {
  19206. "type": "string"
  19207. },
  19208. "prompt": {
  19209. "type": "string"
  19210. },
  19211. "options": {
  19212. "type": "object"
  19213. },
  19214. "steps": {
  19215. "type": "number"
  19216. }
  19217. },
  19218. "required": ["name", "mode", "permission", "options"],
  19219. "additionalProperties": false
  19220. },
  19221. "LSPStatus": {
  19222. "type": "object",
  19223. "properties": {
  19224. "id": {
  19225. "type": "string"
  19226. },
  19227. "name": {
  19228. "type": "string"
  19229. },
  19230. "root": {
  19231. "type": "string"
  19232. },
  19233. "status": {
  19234. "type": "string",
  19235. "enum": ["connected", "error"]
  19236. }
  19237. },
  19238. "required": ["id", "name", "root", "status"],
  19239. "additionalProperties": false
  19240. },
  19241. "FormatterStatus": {
  19242. "type": "object",
  19243. "properties": {
  19244. "name": {
  19245. "type": "string"
  19246. },
  19247. "extensions": {
  19248. "type": "array",
  19249. "items": {
  19250. "type": "string"
  19251. }
  19252. },
  19253. "enabled": {
  19254. "type": "boolean"
  19255. }
  19256. },
  19257. "required": ["name", "extensions", "enabled"],
  19258. "additionalProperties": false
  19259. },
  19260. "MCPStatusConnected": {
  19261. "type": "object",
  19262. "properties": {
  19263. "status": {
  19264. "type": "string",
  19265. "enum": ["connected"]
  19266. }
  19267. },
  19268. "required": ["status"],
  19269. "additionalProperties": false
  19270. },
  19271. "MCPStatusDisabled": {
  19272. "type": "object",
  19273. "properties": {
  19274. "status": {
  19275. "type": "string",
  19276. "enum": ["disabled"]
  19277. }
  19278. },
  19279. "required": ["status"],
  19280. "additionalProperties": false
  19281. },
  19282. "MCPStatusFailed": {
  19283. "type": "object",
  19284. "properties": {
  19285. "status": {
  19286. "type": "string",
  19287. "enum": ["failed"]
  19288. },
  19289. "error": {
  19290. "type": "string"
  19291. }
  19292. },
  19293. "required": ["status", "error"],
  19294. "additionalProperties": false
  19295. },
  19296. "MCPStatusNeedsAuth": {
  19297. "type": "object",
  19298. "properties": {
  19299. "status": {
  19300. "type": "string",
  19301. "enum": ["needs_auth"]
  19302. }
  19303. },
  19304. "required": ["status"],
  19305. "additionalProperties": false
  19306. },
  19307. "MCPStatusNeedsClientRegistration": {
  19308. "type": "object",
  19309. "properties": {
  19310. "status": {
  19311. "type": "string",
  19312. "enum": ["needs_client_registration"]
  19313. },
  19314. "error": {
  19315. "type": "string"
  19316. }
  19317. },
  19318. "required": ["status", "error"],
  19319. "additionalProperties": false
  19320. },
  19321. "MCPStatus": {
  19322. "anyOf": [
  19323. {
  19324. "$ref": "#/components/schemas/MCPStatusConnected"
  19325. },
  19326. {
  19327. "$ref": "#/components/schemas/MCPStatusDisabled"
  19328. },
  19329. {
  19330. "$ref": "#/components/schemas/MCPStatusFailed"
  19331. },
  19332. {
  19333. "$ref": "#/components/schemas/MCPStatusNeedsAuth"
  19334. },
  19335. {
  19336. "$ref": "#/components/schemas/MCPStatusNeedsClientRegistration"
  19337. }
  19338. ]
  19339. },
  19340. "McpUnsupportedOAuthError": {
  19341. "type": "object",
  19342. "properties": {
  19343. "error": {
  19344. "type": "string"
  19345. }
  19346. },
  19347. "required": ["error"],
  19348. "additionalProperties": false
  19349. },
  19350. "McpServerNotFoundError": {
  19351. "type": "object",
  19352. "properties": {
  19353. "_tag": {
  19354. "type": "string",
  19355. "enum": ["McpServerNotFoundError"]
  19356. },
  19357. "name": {
  19358. "type": "string"
  19359. },
  19360. "message": {
  19361. "type": "string"
  19362. }
  19363. },
  19364. "required": ["_tag", "name", "message"],
  19365. "additionalProperties": false
  19366. },
  19367. "Project": {
  19368. "type": "object",
  19369. "properties": {
  19370. "id": {
  19371. "type": "string"
  19372. },
  19373. "worktree": {
  19374. "type": "string"
  19375. },
  19376. "vcs": {
  19377. "type": "string",
  19378. "enum": ["git"]
  19379. },
  19380. "name": {
  19381. "type": "string"
  19382. },
  19383. "icon": {
  19384. "type": "object",
  19385. "properties": {
  19386. "url": {
  19387. "type": "string"
  19388. },
  19389. "override": {
  19390. "type": "string"
  19391. },
  19392. "color": {
  19393. "type": "string"
  19394. }
  19395. },
  19396. "additionalProperties": false
  19397. },
  19398. "commands": {
  19399. "type": "object",
  19400. "properties": {
  19401. "start": {
  19402. "type": "string",
  19403. "description": "Startup script to run when creating a new workspace (worktree)"
  19404. }
  19405. },
  19406. "additionalProperties": false
  19407. },
  19408. "time": {
  19409. "type": "object",
  19410. "properties": {
  19411. "created": {
  19412. "type": "integer",
  19413. "minimum": 0
  19414. },
  19415. "updated": {
  19416. "type": "integer",
  19417. "minimum": 0
  19418. },
  19419. "initialized": {
  19420. "type": "integer",
  19421. "minimum": 0
  19422. }
  19423. },
  19424. "required": ["created", "updated"],
  19425. "additionalProperties": false
  19426. },
  19427. "sandboxes": {
  19428. "type": "array",
  19429. "items": {
  19430. "type": "string"
  19431. }
  19432. }
  19433. },
  19434. "required": ["id", "worktree", "time", "sandboxes"],
  19435. "additionalProperties": false
  19436. },
  19437. "ProjectNotFoundError": {
  19438. "type": "object",
  19439. "properties": {
  19440. "_tag": {
  19441. "type": "string",
  19442. "enum": ["ProjectNotFoundError"]
  19443. },
  19444. "projectID": {
  19445. "type": "string"
  19446. },
  19447. "message": {
  19448. "type": "string"
  19449. }
  19450. },
  19451. "required": ["_tag", "projectID", "message"],
  19452. "additionalProperties": false
  19453. },
  19454. "ProjectCopyError": {
  19455. "type": "object",
  19456. "properties": {
  19457. "name": {
  19458. "type": "string",
  19459. "enum": ["ProjectCopyError"]
  19460. },
  19461. "data": {
  19462. "type": "object",
  19463. "properties": {
  19464. "message": {
  19465. "type": "string"
  19466. }
  19467. },
  19468. "required": ["message"],
  19469. "additionalProperties": false
  19470. }
  19471. },
  19472. "required": ["name", "data"],
  19473. "additionalProperties": false
  19474. },
  19475. "PtyNotFoundError": {
  19476. "type": "object",
  19477. "properties": {
  19478. "_tag": {
  19479. "type": "string",
  19480. "enum": ["PtyNotFoundError"]
  19481. },
  19482. "ptyID": {
  19483. "type": "string"
  19484. },
  19485. "message": {
  19486. "type": "string"
  19487. }
  19488. },
  19489. "required": ["_tag", "ptyID", "message"],
  19490. "additionalProperties": false
  19491. },
  19492. "PtyForbiddenError": {
  19493. "type": "object",
  19494. "properties": {
  19495. "_tag": {
  19496. "type": "string",
  19497. "enum": ["PtyForbiddenError"]
  19498. },
  19499. "message": {
  19500. "type": "string"
  19501. }
  19502. },
  19503. "required": ["_tag", "message"],
  19504. "additionalProperties": false
  19505. },
  19506. "QuestionRequest": {
  19507. "type": "object",
  19508. "properties": {
  19509. "id": {
  19510. "type": "string",
  19511. "pattern": "^que"
  19512. },
  19513. "sessionID": {
  19514. "type": "string",
  19515. "pattern": "^ses"
  19516. },
  19517. "questions": {
  19518. "type": "array",
  19519. "items": {
  19520. "$ref": "#/components/schemas/QuestionInfo"
  19521. },
  19522. "description": "Questions to ask"
  19523. },
  19524. "tool": {
  19525. "$ref": "#/components/schemas/QuestionTool"
  19526. }
  19527. },
  19528. "required": ["id", "sessionID", "questions"],
  19529. "additionalProperties": false
  19530. },
  19531. "QuestionNotFoundError": {
  19532. "type": "object",
  19533. "properties": {
  19534. "_tag": {
  19535. "type": "string",
  19536. "enum": ["QuestionNotFoundError"]
  19537. },
  19538. "requestID": {
  19539. "type": "string"
  19540. },
  19541. "message": {
  19542. "type": "string"
  19543. }
  19544. },
  19545. "required": ["_tag", "requestID", "message"],
  19546. "additionalProperties": false
  19547. },
  19548. "PermissionRequest": {
  19549. "type": "object",
  19550. "properties": {
  19551. "id": {
  19552. "type": "string",
  19553. "pattern": "^per"
  19554. },
  19555. "sessionID": {
  19556. "type": "string",
  19557. "pattern": "^ses"
  19558. },
  19559. "permission": {
  19560. "type": "string"
  19561. },
  19562. "patterns": {
  19563. "type": "array",
  19564. "items": {
  19565. "type": "string"
  19566. }
  19567. },
  19568. "metadata": {
  19569. "type": "object"
  19570. },
  19571. "always": {
  19572. "type": "array",
  19573. "items": {
  19574. "type": "string"
  19575. }
  19576. },
  19577. "tool": {
  19578. "type": "object",
  19579. "properties": {
  19580. "messageID": {
  19581. "type": "string"
  19582. },
  19583. "callID": {
  19584. "type": "string"
  19585. }
  19586. },
  19587. "required": ["messageID", "callID"],
  19588. "additionalProperties": false
  19589. }
  19590. },
  19591. "required": ["id", "sessionID", "permission", "patterns", "metadata", "always"],
  19592. "additionalProperties": false
  19593. },
  19594. "PermissionNotFoundError": {
  19595. "type": "object",
  19596. "properties": {
  19597. "_tag": {
  19598. "type": "string",
  19599. "enum": ["PermissionNotFoundError"]
  19600. },
  19601. "requestID": {
  19602. "type": "string"
  19603. },
  19604. "message": {
  19605. "type": "string"
  19606. }
  19607. },
  19608. "required": ["_tag", "requestID", "message"],
  19609. "additionalProperties": false
  19610. },
  19611. "ProviderAuthMethod": {
  19612. "type": "object",
  19613. "properties": {
  19614. "type": {
  19615. "type": "string",
  19616. "enum": ["oauth", "api"]
  19617. },
  19618. "label": {
  19619. "type": "string"
  19620. },
  19621. "prompts": {
  19622. "type": "array",
  19623. "items": {
  19624. "anyOf": [
  19625. {
  19626. "type": "object",
  19627. "properties": {
  19628. "type": {
  19629. "type": "string",
  19630. "enum": ["text"]
  19631. },
  19632. "key": {
  19633. "type": "string"
  19634. },
  19635. "message": {
  19636. "type": "string"
  19637. },
  19638. "placeholder": {
  19639. "type": "string"
  19640. },
  19641. "when": {
  19642. "type": "object",
  19643. "properties": {
  19644. "key": {
  19645. "type": "string"
  19646. },
  19647. "op": {
  19648. "type": "string",
  19649. "enum": ["eq", "neq"]
  19650. },
  19651. "value": {
  19652. "type": "string"
  19653. }
  19654. },
  19655. "required": ["key", "op", "value"],
  19656. "additionalProperties": false
  19657. }
  19658. },
  19659. "required": ["type", "key", "message"],
  19660. "additionalProperties": false
  19661. },
  19662. {
  19663. "type": "object",
  19664. "properties": {
  19665. "type": {
  19666. "type": "string",
  19667. "enum": ["select"]
  19668. },
  19669. "key": {
  19670. "type": "string"
  19671. },
  19672. "message": {
  19673. "type": "string"
  19674. },
  19675. "options": {
  19676. "type": "array",
  19677. "items": {
  19678. "type": "object",
  19679. "properties": {
  19680. "label": {
  19681. "type": "string"
  19682. },
  19683. "value": {
  19684. "type": "string"
  19685. },
  19686. "hint": {
  19687. "type": "string"
  19688. }
  19689. },
  19690. "required": ["label", "value"],
  19691. "additionalProperties": false
  19692. }
  19693. },
  19694. "when": {
  19695. "type": "object",
  19696. "properties": {
  19697. "key": {
  19698. "type": "string"
  19699. },
  19700. "op": {
  19701. "type": "string",
  19702. "enum": ["eq", "neq"]
  19703. },
  19704. "value": {
  19705. "type": "string"
  19706. }
  19707. },
  19708. "required": ["key", "op", "value"],
  19709. "additionalProperties": false
  19710. }
  19711. },
  19712. "required": ["type", "key", "message", "options"],
  19713. "additionalProperties": false
  19714. }
  19715. ]
  19716. }
  19717. }
  19718. },
  19719. "required": ["type", "label"],
  19720. "additionalProperties": false
  19721. },
  19722. "ProviderAuthAuthorization": {
  19723. "type": "object",
  19724. "properties": {
  19725. "url": {
  19726. "type": "string"
  19727. },
  19728. "method": {
  19729. "type": "string",
  19730. "enum": ["auto", "code"]
  19731. },
  19732. "instructions": {
  19733. "type": "string"
  19734. }
  19735. },
  19736. "required": ["url", "method", "instructions"],
  19737. "additionalProperties": false
  19738. },
  19739. "ProviderAuthError1": {
  19740. "type": "object",
  19741. "properties": {
  19742. "name": {
  19743. "type": "string",
  19744. "enum": [
  19745. "BadRequest",
  19746. "ProviderAuthOauthMissing",
  19747. "ProviderAuthOauthCodeMissing",
  19748. "ProviderAuthOauthCallbackFailed",
  19749. "ProviderAuthValidationFailed"
  19750. ]
  19751. },
  19752. "data": {
  19753. "type": "object",
  19754. "properties": {
  19755. "providerID": {
  19756. "type": "string"
  19757. },
  19758. "field": {
  19759. "type": "string"
  19760. },
  19761. "message": {
  19762. "type": "string"
  19763. },
  19764. "kind": {
  19765. "type": "string"
  19766. }
  19767. },
  19768. "additionalProperties": false
  19769. }
  19770. },
  19771. "required": ["name", "data"],
  19772. "additionalProperties": false
  19773. },
  19774. "NotFoundError": {
  19775. "type": "object",
  19776. "required": ["name", "data"],
  19777. "properties": {
  19778. "name": {
  19779. "type": "string",
  19780. "enum": ["NotFoundError"]
  19781. },
  19782. "data": {
  19783. "type": "object",
  19784. "required": ["message"],
  19785. "properties": {
  19786. "message": {
  19787. "type": "string"
  19788. }
  19789. }
  19790. }
  19791. }
  19792. },
  19793. "TextPartInput": {
  19794. "type": "object",
  19795. "properties": {
  19796. "id": {
  19797. "type": "string",
  19798. "pattern": "^prt"
  19799. },
  19800. "type": {
  19801. "type": "string",
  19802. "enum": ["text"]
  19803. },
  19804. "text": {
  19805. "type": "string"
  19806. },
  19807. "synthetic": {
  19808. "type": "boolean"
  19809. },
  19810. "ignored": {
  19811. "type": "boolean"
  19812. },
  19813. "time": {
  19814. "type": "object",
  19815. "properties": {
  19816. "start": {
  19817. "type": "integer",
  19818. "minimum": 0
  19819. },
  19820. "end": {
  19821. "type": "integer",
  19822. "minimum": 0
  19823. }
  19824. },
  19825. "required": ["start"],
  19826. "additionalProperties": false
  19827. },
  19828. "metadata": {
  19829. "type": "object"
  19830. }
  19831. },
  19832. "required": ["type", "text"],
  19833. "additionalProperties": false
  19834. },
  19835. "FilePartInput": {
  19836. "type": "object",
  19837. "properties": {
  19838. "id": {
  19839. "type": "string",
  19840. "pattern": "^prt"
  19841. },
  19842. "type": {
  19843. "type": "string",
  19844. "enum": ["file"]
  19845. },
  19846. "mime": {
  19847. "type": "string"
  19848. },
  19849. "filename": {
  19850. "type": "string"
  19851. },
  19852. "url": {
  19853. "type": "string"
  19854. },
  19855. "source": {
  19856. "$ref": "#/components/schemas/FilePartSource"
  19857. }
  19858. },
  19859. "required": ["type", "mime", "url"],
  19860. "additionalProperties": false
  19861. },
  19862. "AgentPartInput": {
  19863. "type": "object",
  19864. "properties": {
  19865. "id": {
  19866. "type": "string",
  19867. "pattern": "^prt"
  19868. },
  19869. "type": {
  19870. "type": "string",
  19871. "enum": ["agent"]
  19872. },
  19873. "name": {
  19874. "type": "string"
  19875. },
  19876. "source": {
  19877. "type": "object",
  19878. "properties": {
  19879. "value": {
  19880. "type": "string"
  19881. },
  19882. "start": {
  19883. "type": "integer",
  19884. "minimum": 0
  19885. },
  19886. "end": {
  19887. "type": "integer",
  19888. "minimum": 0
  19889. }
  19890. },
  19891. "required": ["value", "start", "end"],
  19892. "additionalProperties": false
  19893. }
  19894. },
  19895. "required": ["type", "name"],
  19896. "additionalProperties": false
  19897. },
  19898. "SubtaskPartInput": {
  19899. "type": "object",
  19900. "properties": {
  19901. "id": {
  19902. "type": "string",
  19903. "pattern": "^prt"
  19904. },
  19905. "type": {
  19906. "type": "string",
  19907. "enum": ["subtask"]
  19908. },
  19909. "prompt": {
  19910. "type": "string"
  19911. },
  19912. "description": {
  19913. "type": "string"
  19914. },
  19915. "agent": {
  19916. "type": "string"
  19917. },
  19918. "model": {
  19919. "type": "object",
  19920. "properties": {
  19921. "providerID": {
  19922. "type": "string"
  19923. },
  19924. "modelID": {
  19925. "type": "string"
  19926. }
  19927. },
  19928. "required": ["providerID", "modelID"],
  19929. "additionalProperties": false
  19930. },
  19931. "command": {
  19932. "type": "string"
  19933. }
  19934. },
  19935. "required": ["type", "prompt", "description", "agent"],
  19936. "additionalProperties": false
  19937. },
  19938. "SessionBusyError": {
  19939. "type": "object",
  19940. "properties": {
  19941. "_tag": {
  19942. "type": "string",
  19943. "enum": ["SessionBusyError"]
  19944. },
  19945. "sessionID": {
  19946. "type": "string"
  19947. },
  19948. "message": {
  19949. "type": "string"
  19950. }
  19951. },
  19952. "required": ["_tag", "sessionID", "message"],
  19953. "additionalProperties": false
  19954. },
  19955. "EventTuiPromptAppend": {
  19956. "type": "object",
  19957. "properties": {
  19958. "type": {
  19959. "type": "string",
  19960. "enum": ["tui.prompt.append"]
  19961. },
  19962. "properties": {
  19963. "type": "object",
  19964. "properties": {
  19965. "text": {
  19966. "type": "string"
  19967. }
  19968. },
  19969. "required": ["text"],
  19970. "additionalProperties": false
  19971. }
  19972. },
  19973. "required": ["type", "properties"],
  19974. "additionalProperties": false
  19975. },
  19976. "EventTuiCommandExecute": {
  19977. "type": "object",
  19978. "properties": {
  19979. "type": {
  19980. "type": "string",
  19981. "enum": ["tui.command.execute"]
  19982. },
  19983. "properties": {
  19984. "type": "object",
  19985. "properties": {
  19986. "command": {
  19987. "anyOf": [
  19988. {
  19989. "type": "string",
  19990. "enum": [
  19991. "session.list",
  19992. "session.new",
  19993. "session.share",
  19994. "session.interrupt",
  19995. "session.compact",
  19996. "session.page.up",
  19997. "session.page.down",
  19998. "session.line.up",
  19999. "session.line.down",
  20000. "session.half.page.up",
  20001. "session.half.page.down",
  20002. "session.first",
  20003. "session.last",
  20004. "prompt.clear",
  20005. "prompt.submit",
  20006. "agent.cycle"
  20007. ]
  20008. },
  20009. {
  20010. "type": "string"
  20011. }
  20012. ]
  20013. }
  20014. },
  20015. "required": ["command"],
  20016. "additionalProperties": false
  20017. }
  20018. },
  20019. "required": ["type", "properties"],
  20020. "additionalProperties": false
  20021. },
  20022. "EventTuiToastShow": {
  20023. "type": "object",
  20024. "properties": {
  20025. "type": {
  20026. "type": "string",
  20027. "enum": ["tui.toast.show"]
  20028. },
  20029. "properties": {
  20030. "type": "object",
  20031. "properties": {
  20032. "title": {
  20033. "type": "string"
  20034. },
  20035. "message": {
  20036. "type": "string"
  20037. },
  20038. "variant": {
  20039. "type": "string",
  20040. "enum": ["info", "success", "warning", "error"]
  20041. },
  20042. "duration": {
  20043. "type": "integer",
  20044. "exclusiveMinimum": 0
  20045. }
  20046. },
  20047. "required": ["message", "variant"],
  20048. "additionalProperties": false
  20049. }
  20050. },
  20051. "required": ["type", "properties"],
  20052. "additionalProperties": false
  20053. },
  20054. "EventTuiSessionSelect": {
  20055. "type": "object",
  20056. "properties": {
  20057. "type": {
  20058. "type": "string",
  20059. "enum": ["tui.session.select"]
  20060. },
  20061. "properties": {
  20062. "type": "object",
  20063. "properties": {
  20064. "sessionID": {
  20065. "type": "string",
  20066. "pattern": "^ses",
  20067. "description": "Session ID to navigate to"
  20068. }
  20069. },
  20070. "required": ["sessionID"],
  20071. "additionalProperties": false
  20072. }
  20073. },
  20074. "required": ["type", "properties"],
  20075. "additionalProperties": false
  20076. },
  20077. "Workspace": {
  20078. "type": "object",
  20079. "properties": {
  20080. "id": {
  20081. "type": "string",
  20082. "pattern": "^wrk"
  20083. },
  20084. "type": {
  20085. "type": "string"
  20086. },
  20087. "name": {
  20088. "type": "string"
  20089. },
  20090. "branch": {
  20091. "anyOf": [
  20092. {
  20093. "type": "string"
  20094. },
  20095. {
  20096. "type": "null"
  20097. }
  20098. ]
  20099. },
  20100. "directory": {
  20101. "anyOf": [
  20102. {
  20103. "type": "string"
  20104. },
  20105. {
  20106. "type": "null"
  20107. }
  20108. ]
  20109. },
  20110. "extra": {
  20111. "anyOf": [
  20112. {},
  20113. {
  20114. "type": "null"
  20115. }
  20116. ]
  20117. },
  20118. "projectID": {
  20119. "type": "string"
  20120. },
  20121. "timeUsed": {
  20122. "anyOf": [
  20123. {
  20124. "type": "number"
  20125. },
  20126. {
  20127. "type": "string",
  20128. "enum": ["NaN"]
  20129. },
  20130. {
  20131. "type": "string",
  20132. "enum": ["Infinity"]
  20133. },
  20134. {
  20135. "type": "string",
  20136. "enum": ["-Infinity"]
  20137. },
  20138. {
  20139. "type": "string",
  20140. "enum": ["Infinity", "-Infinity", "NaN"]
  20141. }
  20142. ]
  20143. }
  20144. },
  20145. "required": ["id", "type", "name", "projectID", "timeUsed"],
  20146. "additionalProperties": false
  20147. },
  20148. "WorkspaceCreateError": {
  20149. "type": "object",
  20150. "properties": {
  20151. "name": {
  20152. "type": "string",
  20153. "enum": ["WorkspaceCreateError"]
  20154. },
  20155. "data": {
  20156. "type": "object",
  20157. "properties": {
  20158. "message": {
  20159. "type": "string"
  20160. }
  20161. },
  20162. "required": ["message"],
  20163. "additionalProperties": false
  20164. }
  20165. },
  20166. "required": ["name", "data"],
  20167. "additionalProperties": false
  20168. },
  20169. "WorkspaceWarpError": {
  20170. "type": "object",
  20171. "properties": {
  20172. "name": {
  20173. "type": "string",
  20174. "enum": ["WorkspaceWarpError"]
  20175. },
  20176. "data": {
  20177. "type": "object",
  20178. "properties": {
  20179. "message": {
  20180. "type": "string"
  20181. }
  20182. },
  20183. "required": ["message"],
  20184. "additionalProperties": false
  20185. }
  20186. },
  20187. "required": ["name", "data"],
  20188. "additionalProperties": false
  20189. },
  20190. "UnauthorizedError": {
  20191. "type": "object",
  20192. "properties": {
  20193. "_tag": {
  20194. "type": "string",
  20195. "enum": ["UnauthorizedError"]
  20196. },
  20197. "message": {
  20198. "type": "string"
  20199. }
  20200. },
  20201. "required": ["_tag", "message"],
  20202. "additionalProperties": false
  20203. },
  20204. "V2SessionsResponse": {
  20205. "type": "object",
  20206. "properties": {
  20207. "data": {
  20208. "type": "array",
  20209. "items": {
  20210. "$ref": "#/components/schemas/SessionV2Info"
  20211. }
  20212. },
  20213. "cursor": {
  20214. "type": "object",
  20215. "properties": {
  20216. "previous": {
  20217. "type": "string"
  20218. },
  20219. "next": {
  20220. "type": "string"
  20221. }
  20222. },
  20223. "additionalProperties": false
  20224. }
  20225. },
  20226. "required": ["data", "cursor"],
  20227. "additionalProperties": false
  20228. },
  20229. "InvalidCursorError": {
  20230. "type": "object",
  20231. "properties": {
  20232. "_tag": {
  20233. "type": "string",
  20234. "enum": ["InvalidCursorError"]
  20235. },
  20236. "message": {
  20237. "type": "string"
  20238. }
  20239. },
  20240. "required": ["_tag", "message"],
  20241. "additionalProperties": false
  20242. },
  20243. "ConflictError": {
  20244. "type": "object",
  20245. "properties": {
  20246. "_tag": {
  20247. "type": "string",
  20248. "enum": ["ConflictError"]
  20249. },
  20250. "message": {
  20251. "type": "string"
  20252. },
  20253. "resource": {
  20254. "type": "string"
  20255. }
  20256. },
  20257. "required": ["_tag", "message"],
  20258. "additionalProperties": false
  20259. },
  20260. "SessionNotFoundError": {
  20261. "type": "object",
  20262. "properties": {
  20263. "_tag": {
  20264. "type": "string",
  20265. "enum": ["SessionNotFoundError"]
  20266. },
  20267. "sessionID": {
  20268. "type": "string"
  20269. },
  20270. "message": {
  20271. "type": "string"
  20272. }
  20273. },
  20274. "required": ["_tag", "sessionID", "message"],
  20275. "additionalProperties": false
  20276. },
  20277. "ServiceUnavailableError": {
  20278. "type": "object",
  20279. "properties": {
  20280. "_tag": {
  20281. "type": "string",
  20282. "enum": ["ServiceUnavailableError"]
  20283. },
  20284. "message": {
  20285. "type": "string"
  20286. },
  20287. "service": {
  20288. "type": "string"
  20289. }
  20290. },
  20291. "required": ["_tag", "message"],
  20292. "additionalProperties": false
  20293. },
  20294. "UnknownError1": {
  20295. "type": "object",
  20296. "properties": {
  20297. "_tag": {
  20298. "type": "string",
  20299. "enum": ["UnknownError"]
  20300. },
  20301. "message": {
  20302. "type": "string"
  20303. },
  20304. "ref": {
  20305. "type": "string"
  20306. }
  20307. },
  20308. "required": ["_tag", "message"],
  20309. "additionalProperties": false
  20310. },
  20311. "V2SessionMessagesResponse": {
  20312. "type": "object",
  20313. "properties": {
  20314. "data": {
  20315. "type": "array",
  20316. "items": {
  20317. "$ref": "#/components/schemas/SessionMessage"
  20318. }
  20319. },
  20320. "cursor": {
  20321. "type": "object",
  20322. "properties": {
  20323. "previous": {
  20324. "type": "string"
  20325. },
  20326. "next": {
  20327. "type": "string"
  20328. }
  20329. },
  20330. "additionalProperties": false
  20331. }
  20332. },
  20333. "required": ["data", "cursor"],
  20334. "additionalProperties": false
  20335. },
  20336. "ProviderNotFoundError": {
  20337. "type": "object",
  20338. "properties": {
  20339. "_tag": {
  20340. "type": "string",
  20341. "enum": ["ProviderNotFoundError"]
  20342. },
  20343. "providerID": {
  20344. "type": "string"
  20345. },
  20346. "message": {
  20347. "type": "string"
  20348. }
  20349. },
  20350. "required": ["_tag", "providerID", "message"],
  20351. "additionalProperties": false
  20352. },
  20353. "effect_HttpApiError_Forbidden": {
  20354. "type": "object",
  20355. "properties": {
  20356. "_tag": {
  20357. "type": "string",
  20358. "enum": ["Forbidden"]
  20359. }
  20360. },
  20361. "required": ["_tag"],
  20362. "additionalProperties": false
  20363. },
  20364. "Event.tui.prompt.append": {
  20365. "type": "object",
  20366. "properties": {
  20367. "id": {
  20368. "type": "string",
  20369. "pattern": "^evt_"
  20370. },
  20371. "type": {
  20372. "type": "string",
  20373. "enum": ["tui.prompt.append"]
  20374. },
  20375. "properties": {
  20376. "type": "object",
  20377. "properties": {
  20378. "text": {
  20379. "type": "string"
  20380. }
  20381. },
  20382. "required": ["text"],
  20383. "additionalProperties": false
  20384. }
  20385. },
  20386. "required": ["id", "type", "properties"],
  20387. "additionalProperties": false
  20388. },
  20389. "Event.tui.command.execute": {
  20390. "type": "object",
  20391. "properties": {
  20392. "id": {
  20393. "type": "string",
  20394. "pattern": "^evt_"
  20395. },
  20396. "type": {
  20397. "type": "string",
  20398. "enum": ["tui.command.execute"]
  20399. },
  20400. "properties": {
  20401. "type": "object",
  20402. "properties": {
  20403. "command": {
  20404. "anyOf": [
  20405. {
  20406. "type": "string",
  20407. "enum": [
  20408. "session.list",
  20409. "session.new",
  20410. "session.share",
  20411. "session.interrupt",
  20412. "session.compact",
  20413. "session.page.up",
  20414. "session.page.down",
  20415. "session.line.up",
  20416. "session.line.down",
  20417. "session.half.page.up",
  20418. "session.half.page.down",
  20419. "session.first",
  20420. "session.last",
  20421. "prompt.clear",
  20422. "prompt.submit",
  20423. "agent.cycle"
  20424. ]
  20425. },
  20426. {
  20427. "type": "string"
  20428. }
  20429. ]
  20430. }
  20431. },
  20432. "required": ["command"],
  20433. "additionalProperties": false
  20434. }
  20435. },
  20436. "required": ["id", "type", "properties"],
  20437. "additionalProperties": false
  20438. },
  20439. "Event.tui.toast.show": {
  20440. "type": "object",
  20441. "properties": {
  20442. "id": {
  20443. "type": "string",
  20444. "pattern": "^evt_"
  20445. },
  20446. "type": {
  20447. "type": "string",
  20448. "enum": ["tui.toast.show"]
  20449. },
  20450. "properties": {
  20451. "type": "object",
  20452. "properties": {
  20453. "title": {
  20454. "type": "string"
  20455. },
  20456. "message": {
  20457. "type": "string"
  20458. },
  20459. "variant": {
  20460. "type": "string",
  20461. "enum": ["info", "success", "warning", "error"]
  20462. },
  20463. "duration": {
  20464. "type": "integer",
  20465. "exclusiveMinimum": 0
  20466. }
  20467. },
  20468. "required": ["message", "variant"],
  20469. "additionalProperties": false
  20470. }
  20471. },
  20472. "required": ["id", "type", "properties"],
  20473. "additionalProperties": false
  20474. },
  20475. "Event.tui.session.select": {
  20476. "type": "object",
  20477. "properties": {
  20478. "id": {
  20479. "type": "string",
  20480. "pattern": "^evt_"
  20481. },
  20482. "type": {
  20483. "type": "string",
  20484. "enum": ["tui.session.select"]
  20485. },
  20486. "properties": {
  20487. "type": "object",
  20488. "properties": {
  20489. "sessionID": {
  20490. "type": "string",
  20491. "pattern": "^ses",
  20492. "description": "Session ID to navigate to"
  20493. }
  20494. },
  20495. "required": ["sessionID"],
  20496. "additionalProperties": false
  20497. }
  20498. },
  20499. "required": ["id", "type", "properties"],
  20500. "additionalProperties": false
  20501. },
  20502. "MoveSessionDestination": {
  20503. "type": "object",
  20504. "properties": {
  20505. "directory": {
  20506. "type": "string"
  20507. }
  20508. },
  20509. "required": ["directory"],
  20510. "additionalProperties": false
  20511. },
  20512. "ModelV2Info": {
  20513. "type": "object",
  20514. "properties": {
  20515. "id": {
  20516. "type": "string"
  20517. },
  20518. "providerID": {
  20519. "type": "string"
  20520. },
  20521. "family": {
  20522. "type": "string"
  20523. },
  20524. "name": {
  20525. "type": "string"
  20526. },
  20527. "api": {
  20528. "anyOf": [
  20529. {
  20530. "type": "object",
  20531. "properties": {
  20532. "id": {
  20533. "type": "string"
  20534. },
  20535. "type": {
  20536. "type": "string",
  20537. "enum": ["aisdk"]
  20538. },
  20539. "package": {
  20540. "type": "string"
  20541. },
  20542. "url": {
  20543. "type": "string"
  20544. },
  20545. "settings": {
  20546. "type": "object"
  20547. }
  20548. },
  20549. "required": ["id", "type", "package"],
  20550. "additionalProperties": false
  20551. },
  20552. {
  20553. "type": "object",
  20554. "properties": {
  20555. "id": {
  20556. "type": "string"
  20557. },
  20558. "type": {
  20559. "type": "string",
  20560. "enum": ["native"]
  20561. },
  20562. "url": {
  20563. "type": "string"
  20564. },
  20565. "settings": {
  20566. "type": "object"
  20567. }
  20568. },
  20569. "required": ["id", "type", "settings"],
  20570. "additionalProperties": false
  20571. }
  20572. ]
  20573. },
  20574. "capabilities": {
  20575. "type": "object",
  20576. "properties": {
  20577. "tools": {
  20578. "type": "boolean"
  20579. },
  20580. "input": {
  20581. "type": "array",
  20582. "items": {
  20583. "type": "string"
  20584. }
  20585. },
  20586. "output": {
  20587. "type": "array",
  20588. "items": {
  20589. "type": "string"
  20590. }
  20591. }
  20592. },
  20593. "required": ["tools", "input", "output"],
  20594. "additionalProperties": false
  20595. },
  20596. "request": {
  20597. "type": "object",
  20598. "properties": {
  20599. "headers": {
  20600. "type": "object",
  20601. "additionalProperties": {
  20602. "type": "string"
  20603. }
  20604. },
  20605. "body": {
  20606. "type": "object"
  20607. },
  20608. "variant": {
  20609. "type": "string"
  20610. }
  20611. },
  20612. "required": ["headers", "body"],
  20613. "additionalProperties": false
  20614. },
  20615. "variants": {
  20616. "type": "array",
  20617. "items": {
  20618. "type": "object",
  20619. "properties": {
  20620. "id": {
  20621. "type": "string"
  20622. },
  20623. "headers": {
  20624. "type": "object",
  20625. "additionalProperties": {
  20626. "type": "string"
  20627. }
  20628. },
  20629. "body": {
  20630. "type": "object"
  20631. }
  20632. },
  20633. "required": ["id", "headers", "body"],
  20634. "additionalProperties": false
  20635. }
  20636. },
  20637. "time": {
  20638. "type": "object",
  20639. "properties": {
  20640. "released": {
  20641. "anyOf": [
  20642. {
  20643. "type": "number"
  20644. },
  20645. {
  20646. "type": "string",
  20647. "enum": ["NaN"]
  20648. },
  20649. {
  20650. "type": "string",
  20651. "enum": ["Infinity"]
  20652. },
  20653. {
  20654. "type": "string",
  20655. "enum": ["-Infinity"]
  20656. },
  20657. {
  20658. "type": "string",
  20659. "enum": ["Infinity", "-Infinity", "NaN"]
  20660. }
  20661. ]
  20662. }
  20663. },
  20664. "required": ["released"],
  20665. "additionalProperties": false
  20666. },
  20667. "cost": {
  20668. "type": "array",
  20669. "items": {
  20670. "type": "object",
  20671. "properties": {
  20672. "tier": {
  20673. "type": "object",
  20674. "properties": {
  20675. "type": {
  20676. "type": "string",
  20677. "enum": ["context"]
  20678. },
  20679. "size": {
  20680. "type": "integer"
  20681. }
  20682. },
  20683. "required": ["type", "size"],
  20684. "additionalProperties": false
  20685. },
  20686. "input": {
  20687. "type": "number"
  20688. },
  20689. "output": {
  20690. "type": "number"
  20691. },
  20692. "cache": {
  20693. "type": "object",
  20694. "properties": {
  20695. "read": {
  20696. "type": "number"
  20697. },
  20698. "write": {
  20699. "type": "number"
  20700. }
  20701. },
  20702. "required": ["read", "write"],
  20703. "additionalProperties": false
  20704. }
  20705. },
  20706. "required": ["input", "output", "cache"],
  20707. "additionalProperties": false
  20708. }
  20709. },
  20710. "status": {
  20711. "type": "string",
  20712. "enum": ["alpha", "beta", "deprecated", "active"]
  20713. },
  20714. "enabled": {
  20715. "type": "boolean"
  20716. },
  20717. "limit": {
  20718. "type": "object",
  20719. "properties": {
  20720. "context": {
  20721. "type": "integer"
  20722. },
  20723. "input": {
  20724. "type": "integer"
  20725. },
  20726. "output": {
  20727. "type": "integer"
  20728. }
  20729. },
  20730. "required": ["context", "output"],
  20731. "additionalProperties": false
  20732. }
  20733. },
  20734. "required": [
  20735. "id",
  20736. "providerID",
  20737. "name",
  20738. "api",
  20739. "capabilities",
  20740. "request",
  20741. "variants",
  20742. "time",
  20743. "cost",
  20744. "status",
  20745. "enabled",
  20746. "limit"
  20747. ],
  20748. "additionalProperties": false
  20749. },
  20750. "LocationRef": {
  20751. "type": "object",
  20752. "properties": {
  20753. "directory": {
  20754. "type": "string"
  20755. },
  20756. "workspaceID": {
  20757. "type": "string",
  20758. "pattern": "^wrk"
  20759. }
  20760. },
  20761. "required": ["directory"],
  20762. "additionalProperties": false
  20763. },
  20764. "PromptSource": {
  20765. "type": "object",
  20766. "properties": {
  20767. "start": {
  20768. "type": "number"
  20769. },
  20770. "end": {
  20771. "type": "number"
  20772. },
  20773. "text": {
  20774. "type": "string"
  20775. }
  20776. },
  20777. "required": ["start", "end", "text"],
  20778. "additionalProperties": false
  20779. },
  20780. "PromptFileAttachment": {
  20781. "type": "object",
  20782. "properties": {
  20783. "uri": {
  20784. "type": "string"
  20785. },
  20786. "mime": {
  20787. "type": "string"
  20788. },
  20789. "name": {
  20790. "type": "string"
  20791. },
  20792. "description": {
  20793. "type": "string"
  20794. },
  20795. "source": {
  20796. "$ref": "#/components/schemas/PromptSource"
  20797. }
  20798. },
  20799. "required": ["uri", "mime"],
  20800. "additionalProperties": false
  20801. },
  20802. "PromptAgentAttachment": {
  20803. "type": "object",
  20804. "properties": {
  20805. "name": {
  20806. "type": "string"
  20807. },
  20808. "source": {
  20809. "$ref": "#/components/schemas/PromptSource"
  20810. }
  20811. },
  20812. "required": ["name"],
  20813. "additionalProperties": false
  20814. },
  20815. "PromptReferenceAttachment": {
  20816. "type": "object",
  20817. "properties": {
  20818. "name": {
  20819. "type": "string"
  20820. },
  20821. "kind": {
  20822. "type": "string",
  20823. "enum": ["local", "git", "invalid"]
  20824. },
  20825. "uri": {
  20826. "type": "string"
  20827. },
  20828. "repository": {
  20829. "type": "string"
  20830. },
  20831. "branch": {
  20832. "type": "string"
  20833. },
  20834. "target": {
  20835. "type": "string"
  20836. },
  20837. "targetUri": {
  20838. "type": "string"
  20839. },
  20840. "problem": {
  20841. "type": "string"
  20842. },
  20843. "source": {
  20844. "$ref": "#/components/schemas/PromptSource"
  20845. }
  20846. },
  20847. "required": ["name", "kind"],
  20848. "additionalProperties": false
  20849. },
  20850. "SessionErrorUnknown": {
  20851. "type": "object",
  20852. "properties": {
  20853. "type": {
  20854. "type": "string",
  20855. "enum": ["unknown"]
  20856. },
  20857. "message": {
  20858. "type": "string"
  20859. }
  20860. },
  20861. "required": ["type", "message"],
  20862. "additionalProperties": false
  20863. },
  20864. "ToolTextContent": {
  20865. "type": "object",
  20866. "properties": {
  20867. "type": {
  20868. "type": "string",
  20869. "enum": ["text"]
  20870. },
  20871. "text": {
  20872. "type": "string"
  20873. }
  20874. },
  20875. "required": ["type", "text"],
  20876. "additionalProperties": false
  20877. },
  20878. "ToolFileContent": {
  20879. "type": "object",
  20880. "properties": {
  20881. "type": {
  20882. "type": "string",
  20883. "enum": ["file"]
  20884. },
  20885. "source": {
  20886. "anyOf": [
  20887. {
  20888. "type": "object",
  20889. "properties": {
  20890. "type": {
  20891. "type": "string",
  20892. "enum": ["data"]
  20893. },
  20894. "data": {
  20895. "type": "string"
  20896. }
  20897. },
  20898. "required": ["type", "data"],
  20899. "additionalProperties": false
  20900. },
  20901. {
  20902. "type": "object",
  20903. "properties": {
  20904. "type": {
  20905. "type": "string",
  20906. "enum": ["url"]
  20907. },
  20908. "url": {
  20909. "type": "string"
  20910. }
  20911. },
  20912. "required": ["type", "url"],
  20913. "additionalProperties": false
  20914. },
  20915. {
  20916. "type": "object",
  20917. "properties": {
  20918. "type": {
  20919. "type": "string",
  20920. "enum": ["file"]
  20921. },
  20922. "uri": {
  20923. "type": "string"
  20924. }
  20925. },
  20926. "required": ["type", "uri"],
  20927. "additionalProperties": false
  20928. }
  20929. ]
  20930. },
  20931. "mime": {
  20932. "type": "string"
  20933. },
  20934. "name": {
  20935. "type": "string"
  20936. }
  20937. },
  20938. "required": ["type", "source", "mime"],
  20939. "additionalProperties": false
  20940. },
  20941. "SessionNextRetry_error": {
  20942. "type": "object",
  20943. "properties": {
  20944. "message": {
  20945. "type": "string"
  20946. },
  20947. "statusCode": {
  20948. "type": "number"
  20949. },
  20950. "isRetryable": {
  20951. "type": "boolean"
  20952. },
  20953. "responseHeaders": {
  20954. "type": "object",
  20955. "additionalProperties": {
  20956. "type": "string"
  20957. }
  20958. },
  20959. "responseBody": {
  20960. "type": "string"
  20961. },
  20962. "metadata": {
  20963. "type": "object",
  20964. "additionalProperties": {
  20965. "type": "string"
  20966. }
  20967. }
  20968. },
  20969. "required": ["message", "isRetryable"],
  20970. "additionalProperties": false
  20971. },
  20972. "AuthOAuthCredential": {
  20973. "type": "object",
  20974. "properties": {
  20975. "type": {
  20976. "type": "string",
  20977. "enum": ["oauth"]
  20978. },
  20979. "refresh": {
  20980. "type": "string"
  20981. },
  20982. "access": {
  20983. "type": "string"
  20984. },
  20985. "expires": {
  20986. "type": "integer",
  20987. "minimum": 0
  20988. }
  20989. },
  20990. "required": ["type", "refresh", "access", "expires"],
  20991. "additionalProperties": false
  20992. },
  20993. "AuthApiKeyCredential": {
  20994. "type": "object",
  20995. "properties": {
  20996. "type": {
  20997. "type": "string",
  20998. "enum": ["api"]
  20999. },
  21000. "key": {
  21001. "type": "string"
  21002. },
  21003. "metadata": {
  21004. "type": "object",
  21005. "additionalProperties": {
  21006. "type": "string"
  21007. }
  21008. }
  21009. },
  21010. "required": ["type", "key"],
  21011. "additionalProperties": false
  21012. },
  21013. "AuthCredential": {
  21014. "anyOf": [
  21015. {
  21016. "$ref": "#/components/schemas/AuthOAuthCredential"
  21017. },
  21018. {
  21019. "$ref": "#/components/schemas/AuthApiKeyCredential"
  21020. }
  21021. ]
  21022. },
  21023. "AuthInfo": {
  21024. "type": "object",
  21025. "properties": {
  21026. "id": {
  21027. "type": "string"
  21028. },
  21029. "serviceID": {
  21030. "type": "string"
  21031. },
  21032. "description": {
  21033. "type": "string"
  21034. },
  21035. "credential": {
  21036. "$ref": "#/components/schemas/AuthCredential"
  21037. }
  21038. },
  21039. "required": ["id", "serviceID", "description", "credential"],
  21040. "additionalProperties": false
  21041. },
  21042. "PermissionV2Source": {
  21043. "type": "object",
  21044. "properties": {
  21045. "type": {
  21046. "type": "string",
  21047. "enum": ["tool"]
  21048. },
  21049. "messageID": {
  21050. "type": "string"
  21051. },
  21052. "callID": {
  21053. "type": "string"
  21054. }
  21055. },
  21056. "required": ["type", "messageID", "callID"],
  21057. "additionalProperties": false
  21058. },
  21059. "PermissionV2Reply": {
  21060. "type": "string",
  21061. "enum": ["once", "always", "reject"]
  21062. },
  21063. "QuestionV2Option": {
  21064. "type": "object",
  21065. "properties": {
  21066. "label": {
  21067. "type": "string",
  21068. "description": "Display text (1-5 words, concise)"
  21069. },
  21070. "description": {
  21071. "type": "string",
  21072. "description": "Explanation of choice"
  21073. }
  21074. },
  21075. "required": ["label", "description"],
  21076. "additionalProperties": false
  21077. },
  21078. "QuestionV2Info": {
  21079. "type": "object",
  21080. "properties": {
  21081. "question": {
  21082. "type": "string",
  21083. "description": "Complete question"
  21084. },
  21085. "header": {
  21086. "type": "string",
  21087. "description": "Very short label (max 30 chars)"
  21088. },
  21089. "options": {
  21090. "type": "array",
  21091. "items": {
  21092. "$ref": "#/components/schemas/QuestionV2Option"
  21093. },
  21094. "description": "Available choices"
  21095. },
  21096. "multiple": {
  21097. "type": "boolean"
  21098. },
  21099. "custom": {
  21100. "type": "boolean"
  21101. }
  21102. },
  21103. "required": ["question", "header", "options"],
  21104. "additionalProperties": false
  21105. },
  21106. "QuestionV2Tool": {
  21107. "type": "object",
  21108. "properties": {
  21109. "messageID": {
  21110. "type": "string"
  21111. },
  21112. "callID": {
  21113. "type": "string"
  21114. }
  21115. },
  21116. "required": ["messageID", "callID"],
  21117. "additionalProperties": false
  21118. },
  21119. "QuestionV2Answer": {
  21120. "type": "array",
  21121. "items": {
  21122. "type": "string"
  21123. }
  21124. },
  21125. "EventServerInstanceDisposed": {
  21126. "type": "object",
  21127. "properties": {
  21128. "id": {
  21129. "type": "string"
  21130. },
  21131. "type": {
  21132. "type": "string",
  21133. "enum": ["server.instance.disposed"]
  21134. },
  21135. "properties": {
  21136. "type": "object",
  21137. "properties": {
  21138. "directory": {
  21139. "type": "string"
  21140. }
  21141. },
  21142. "required": ["directory"],
  21143. "additionalProperties": false
  21144. }
  21145. },
  21146. "required": ["id", "type", "properties"],
  21147. "additionalProperties": false
  21148. },
  21149. "SyncEventSessionCreated": {
  21150. "type": "object",
  21151. "properties": {
  21152. "type": {
  21153. "type": "string",
  21154. "enum": ["sync"]
  21155. },
  21156. "id": {
  21157. "type": "string",
  21158. "pattern": "^evt_"
  21159. },
  21160. "syncEvent": {
  21161. "type": "object",
  21162. "properties": {
  21163. "type": {
  21164. "type": "string",
  21165. "enum": ["session.created.1"]
  21166. },
  21167. "id": {
  21168. "type": "string",
  21169. "pattern": "^evt_"
  21170. },
  21171. "seq": {
  21172. "type": "number"
  21173. },
  21174. "aggregateID": {
  21175. "type": "string"
  21176. },
  21177. "data": {
  21178. "type": "object",
  21179. "properties": {
  21180. "sessionID": {
  21181. "type": "string",
  21182. "pattern": "^ses"
  21183. },
  21184. "info": {
  21185. "$ref": "#/components/schemas/Session"
  21186. }
  21187. },
  21188. "required": ["sessionID", "info"],
  21189. "additionalProperties": false
  21190. }
  21191. },
  21192. "required": ["type", "id", "seq", "aggregateID", "data"],
  21193. "additionalProperties": false
  21194. }
  21195. },
  21196. "required": ["type", "id", "syncEvent"],
  21197. "additionalProperties": false
  21198. },
  21199. "SyncEventSessionUpdated": {
  21200. "type": "object",
  21201. "properties": {
  21202. "type": {
  21203. "type": "string",
  21204. "enum": ["sync"]
  21205. },
  21206. "id": {
  21207. "type": "string",
  21208. "pattern": "^evt_"
  21209. },
  21210. "syncEvent": {
  21211. "type": "object",
  21212. "properties": {
  21213. "type": {
  21214. "type": "string",
  21215. "enum": ["session.updated.1"]
  21216. },
  21217. "id": {
  21218. "type": "string",
  21219. "pattern": "^evt_"
  21220. },
  21221. "seq": {
  21222. "type": "number"
  21223. },
  21224. "aggregateID": {
  21225. "type": "string"
  21226. },
  21227. "data": {
  21228. "type": "object",
  21229. "properties": {
  21230. "sessionID": {
  21231. "type": "string",
  21232. "pattern": "^ses"
  21233. },
  21234. "info": {
  21235. "$ref": "#/components/schemas/Session"
  21236. }
  21237. },
  21238. "required": ["sessionID", "info"],
  21239. "additionalProperties": false
  21240. }
  21241. },
  21242. "required": ["type", "id", "seq", "aggregateID", "data"],
  21243. "additionalProperties": false
  21244. }
  21245. },
  21246. "required": ["type", "id", "syncEvent"],
  21247. "additionalProperties": false
  21248. },
  21249. "SyncEventSessionDeleted": {
  21250. "type": "object",
  21251. "properties": {
  21252. "type": {
  21253. "type": "string",
  21254. "enum": ["sync"]
  21255. },
  21256. "id": {
  21257. "type": "string",
  21258. "pattern": "^evt_"
  21259. },
  21260. "syncEvent": {
  21261. "type": "object",
  21262. "properties": {
  21263. "type": {
  21264. "type": "string",
  21265. "enum": ["session.deleted.1"]
  21266. },
  21267. "id": {
  21268. "type": "string",
  21269. "pattern": "^evt_"
  21270. },
  21271. "seq": {
  21272. "type": "number"
  21273. },
  21274. "aggregateID": {
  21275. "type": "string"
  21276. },
  21277. "data": {
  21278. "type": "object",
  21279. "properties": {
  21280. "sessionID": {
  21281. "type": "string",
  21282. "pattern": "^ses"
  21283. },
  21284. "info": {
  21285. "$ref": "#/components/schemas/Session"
  21286. }
  21287. },
  21288. "required": ["sessionID", "info"],
  21289. "additionalProperties": false
  21290. }
  21291. },
  21292. "required": ["type", "id", "seq", "aggregateID", "data"],
  21293. "additionalProperties": false
  21294. }
  21295. },
  21296. "required": ["type", "id", "syncEvent"],
  21297. "additionalProperties": false
  21298. },
  21299. "SyncEventMessageUpdated": {
  21300. "type": "object",
  21301. "properties": {
  21302. "type": {
  21303. "type": "string",
  21304. "enum": ["sync"]
  21305. },
  21306. "id": {
  21307. "type": "string",
  21308. "pattern": "^evt_"
  21309. },
  21310. "syncEvent": {
  21311. "type": "object",
  21312. "properties": {
  21313. "type": {
  21314. "type": "string",
  21315. "enum": ["message.updated.1"]
  21316. },
  21317. "id": {
  21318. "type": "string",
  21319. "pattern": "^evt_"
  21320. },
  21321. "seq": {
  21322. "type": "number"
  21323. },
  21324. "aggregateID": {
  21325. "type": "string"
  21326. },
  21327. "data": {
  21328. "type": "object",
  21329. "properties": {
  21330. "sessionID": {
  21331. "type": "string",
  21332. "pattern": "^ses"
  21333. },
  21334. "info": {
  21335. "$ref": "#/components/schemas/Message"
  21336. }
  21337. },
  21338. "required": ["sessionID", "info"],
  21339. "additionalProperties": false
  21340. }
  21341. },
  21342. "required": ["type", "id", "seq", "aggregateID", "data"],
  21343. "additionalProperties": false
  21344. }
  21345. },
  21346. "required": ["type", "id", "syncEvent"],
  21347. "additionalProperties": false
  21348. },
  21349. "SyncEventMessageRemoved": {
  21350. "type": "object",
  21351. "properties": {
  21352. "type": {
  21353. "type": "string",
  21354. "enum": ["sync"]
  21355. },
  21356. "id": {
  21357. "type": "string",
  21358. "pattern": "^evt_"
  21359. },
  21360. "syncEvent": {
  21361. "type": "object",
  21362. "properties": {
  21363. "type": {
  21364. "type": "string",
  21365. "enum": ["message.removed.1"]
  21366. },
  21367. "id": {
  21368. "type": "string",
  21369. "pattern": "^evt_"
  21370. },
  21371. "seq": {
  21372. "type": "number"
  21373. },
  21374. "aggregateID": {
  21375. "type": "string"
  21376. },
  21377. "data": {
  21378. "type": "object",
  21379. "properties": {
  21380. "sessionID": {
  21381. "type": "string",
  21382. "pattern": "^ses"
  21383. },
  21384. "messageID": {
  21385. "type": "string",
  21386. "pattern": "^msg"
  21387. }
  21388. },
  21389. "required": ["sessionID", "messageID"],
  21390. "additionalProperties": false
  21391. }
  21392. },
  21393. "required": ["type", "id", "seq", "aggregateID", "data"],
  21394. "additionalProperties": false
  21395. }
  21396. },
  21397. "required": ["type", "id", "syncEvent"],
  21398. "additionalProperties": false
  21399. },
  21400. "SyncEventMessagePartUpdated": {
  21401. "type": "object",
  21402. "properties": {
  21403. "type": {
  21404. "type": "string",
  21405. "enum": ["sync"]
  21406. },
  21407. "id": {
  21408. "type": "string",
  21409. "pattern": "^evt_"
  21410. },
  21411. "syncEvent": {
  21412. "type": "object",
  21413. "properties": {
  21414. "type": {
  21415. "type": "string",
  21416. "enum": ["message.part.updated.1"]
  21417. },
  21418. "id": {
  21419. "type": "string",
  21420. "pattern": "^evt_"
  21421. },
  21422. "seq": {
  21423. "type": "number"
  21424. },
  21425. "aggregateID": {
  21426. "type": "string"
  21427. },
  21428. "data": {
  21429. "type": "object",
  21430. "properties": {
  21431. "sessionID": {
  21432. "type": "string",
  21433. "pattern": "^ses"
  21434. },
  21435. "part": {
  21436. "$ref": "#/components/schemas/Part"
  21437. },
  21438. "time": {
  21439. "type": "number"
  21440. }
  21441. },
  21442. "required": ["sessionID", "part", "time"],
  21443. "additionalProperties": false
  21444. }
  21445. },
  21446. "required": ["type", "id", "seq", "aggregateID", "data"],
  21447. "additionalProperties": false
  21448. }
  21449. },
  21450. "required": ["type", "id", "syncEvent"],
  21451. "additionalProperties": false
  21452. },
  21453. "SyncEventMessagePartRemoved": {
  21454. "type": "object",
  21455. "properties": {
  21456. "type": {
  21457. "type": "string",
  21458. "enum": ["sync"]
  21459. },
  21460. "id": {
  21461. "type": "string",
  21462. "pattern": "^evt_"
  21463. },
  21464. "syncEvent": {
  21465. "type": "object",
  21466. "properties": {
  21467. "type": {
  21468. "type": "string",
  21469. "enum": ["message.part.removed.1"]
  21470. },
  21471. "id": {
  21472. "type": "string",
  21473. "pattern": "^evt_"
  21474. },
  21475. "seq": {
  21476. "type": "number"
  21477. },
  21478. "aggregateID": {
  21479. "type": "string"
  21480. },
  21481. "data": {
  21482. "type": "object",
  21483. "properties": {
  21484. "sessionID": {
  21485. "type": "string",
  21486. "pattern": "^ses"
  21487. },
  21488. "messageID": {
  21489. "type": "string",
  21490. "pattern": "^msg"
  21491. },
  21492. "partID": {
  21493. "type": "string",
  21494. "pattern": "^prt"
  21495. }
  21496. },
  21497. "required": ["sessionID", "messageID", "partID"],
  21498. "additionalProperties": false
  21499. }
  21500. },
  21501. "required": ["type", "id", "seq", "aggregateID", "data"],
  21502. "additionalProperties": false
  21503. }
  21504. },
  21505. "required": ["type", "id", "syncEvent"],
  21506. "additionalProperties": false
  21507. },
  21508. "SyncEventSessionNextAgentSwitched": {
  21509. "type": "object",
  21510. "properties": {
  21511. "type": {
  21512. "type": "string",
  21513. "enum": ["sync"]
  21514. },
  21515. "id": {
  21516. "type": "string",
  21517. "pattern": "^evt_"
  21518. },
  21519. "syncEvent": {
  21520. "type": "object",
  21521. "properties": {
  21522. "type": {
  21523. "type": "string",
  21524. "enum": ["session.next.agent.switched.1"]
  21525. },
  21526. "id": {
  21527. "type": "string",
  21528. "pattern": "^evt_"
  21529. },
  21530. "seq": {
  21531. "type": "number"
  21532. },
  21533. "aggregateID": {
  21534. "type": "string"
  21535. },
  21536. "data": {
  21537. "type": "object",
  21538. "properties": {
  21539. "timestamp": {
  21540. "type": "number"
  21541. },
  21542. "sessionID": {
  21543. "type": "string",
  21544. "pattern": "^ses"
  21545. },
  21546. "messageID": {
  21547. "type": "string",
  21548. "pattern": "^msg_"
  21549. },
  21550. "agent": {
  21551. "type": "string"
  21552. }
  21553. },
  21554. "required": ["timestamp", "sessionID", "messageID", "agent"],
  21555. "additionalProperties": false
  21556. }
  21557. },
  21558. "required": ["type", "id", "seq", "aggregateID", "data"],
  21559. "additionalProperties": false
  21560. }
  21561. },
  21562. "required": ["type", "id", "syncEvent"],
  21563. "additionalProperties": false
  21564. },
  21565. "SyncEventSessionNextModelSwitched": {
  21566. "type": "object",
  21567. "properties": {
  21568. "type": {
  21569. "type": "string",
  21570. "enum": ["sync"]
  21571. },
  21572. "id": {
  21573. "type": "string",
  21574. "pattern": "^evt_"
  21575. },
  21576. "syncEvent": {
  21577. "type": "object",
  21578. "properties": {
  21579. "type": {
  21580. "type": "string",
  21581. "enum": ["session.next.model.switched.1"]
  21582. },
  21583. "id": {
  21584. "type": "string",
  21585. "pattern": "^evt_"
  21586. },
  21587. "seq": {
  21588. "type": "number"
  21589. },
  21590. "aggregateID": {
  21591. "type": "string"
  21592. },
  21593. "data": {
  21594. "type": "object",
  21595. "properties": {
  21596. "timestamp": {
  21597. "type": "number"
  21598. },
  21599. "sessionID": {
  21600. "type": "string",
  21601. "pattern": "^ses"
  21602. },
  21603. "messageID": {
  21604. "type": "string",
  21605. "pattern": "^msg_"
  21606. },
  21607. "model": {
  21608. "type": "object",
  21609. "properties": {
  21610. "id": {
  21611. "type": "string"
  21612. },
  21613. "providerID": {
  21614. "type": "string"
  21615. },
  21616. "variant": {
  21617. "type": "string"
  21618. }
  21619. },
  21620. "required": ["id", "providerID"],
  21621. "additionalProperties": false
  21622. }
  21623. },
  21624. "required": ["timestamp", "sessionID", "messageID", "model"],
  21625. "additionalProperties": false
  21626. }
  21627. },
  21628. "required": ["type", "id", "seq", "aggregateID", "data"],
  21629. "additionalProperties": false
  21630. }
  21631. },
  21632. "required": ["type", "id", "syncEvent"],
  21633. "additionalProperties": false
  21634. },
  21635. "SyncEventSessionNextMoved": {
  21636. "type": "object",
  21637. "properties": {
  21638. "type": {
  21639. "type": "string",
  21640. "enum": ["sync"]
  21641. },
  21642. "id": {
  21643. "type": "string",
  21644. "pattern": "^evt_"
  21645. },
  21646. "syncEvent": {
  21647. "type": "object",
  21648. "properties": {
  21649. "type": {
  21650. "type": "string",
  21651. "enum": ["session.next.moved.1"]
  21652. },
  21653. "id": {
  21654. "type": "string",
  21655. "pattern": "^evt_"
  21656. },
  21657. "seq": {
  21658. "type": "number"
  21659. },
  21660. "aggregateID": {
  21661. "type": "string"
  21662. },
  21663. "data": {
  21664. "type": "object",
  21665. "properties": {
  21666. "timestamp": {
  21667. "type": "number"
  21668. },
  21669. "sessionID": {
  21670. "type": "string",
  21671. "pattern": "^ses"
  21672. },
  21673. "location": {
  21674. "$ref": "#/components/schemas/LocationRef"
  21675. },
  21676. "subdirectory": {
  21677. "type": "string"
  21678. }
  21679. },
  21680. "required": ["timestamp", "sessionID", "location"],
  21681. "additionalProperties": false
  21682. }
  21683. },
  21684. "required": ["type", "id", "seq", "aggregateID", "data"],
  21685. "additionalProperties": false
  21686. }
  21687. },
  21688. "required": ["type", "id", "syncEvent"],
  21689. "additionalProperties": false
  21690. },
  21691. "SyncEventSessionNextPrompted": {
  21692. "type": "object",
  21693. "properties": {
  21694. "type": {
  21695. "type": "string",
  21696. "enum": ["sync"]
  21697. },
  21698. "id": {
  21699. "type": "string",
  21700. "pattern": "^evt_"
  21701. },
  21702. "syncEvent": {
  21703. "type": "object",
  21704. "properties": {
  21705. "type": {
  21706. "type": "string",
  21707. "enum": ["session.next.prompted.1"]
  21708. },
  21709. "id": {
  21710. "type": "string",
  21711. "pattern": "^evt_"
  21712. },
  21713. "seq": {
  21714. "type": "number"
  21715. },
  21716. "aggregateID": {
  21717. "type": "string"
  21718. },
  21719. "data": {
  21720. "type": "object",
  21721. "properties": {
  21722. "timestamp": {
  21723. "type": "number"
  21724. },
  21725. "sessionID": {
  21726. "type": "string",
  21727. "pattern": "^ses"
  21728. },
  21729. "messageID": {
  21730. "type": "string",
  21731. "pattern": "^msg_"
  21732. },
  21733. "prompt": {
  21734. "$ref": "#/components/schemas/Prompt"
  21735. },
  21736. "delivery": {
  21737. "type": "string",
  21738. "enum": ["steer", "queue"]
  21739. }
  21740. },
  21741. "required": ["timestamp", "sessionID", "messageID", "prompt", "delivery"],
  21742. "additionalProperties": false
  21743. }
  21744. },
  21745. "required": ["type", "id", "seq", "aggregateID", "data"],
  21746. "additionalProperties": false
  21747. }
  21748. },
  21749. "required": ["type", "id", "syncEvent"],
  21750. "additionalProperties": false
  21751. },
  21752. "SyncEventSessionNextPromptAdmitted": {
  21753. "type": "object",
  21754. "properties": {
  21755. "type": {
  21756. "type": "string",
  21757. "enum": ["sync"]
  21758. },
  21759. "id": {
  21760. "type": "string",
  21761. "pattern": "^evt_"
  21762. },
  21763. "syncEvent": {
  21764. "type": "object",
  21765. "properties": {
  21766. "type": {
  21767. "type": "string",
  21768. "enum": ["session.next.prompt.admitted.1"]
  21769. },
  21770. "id": {
  21771. "type": "string",
  21772. "pattern": "^evt_"
  21773. },
  21774. "seq": {
  21775. "type": "number"
  21776. },
  21777. "aggregateID": {
  21778. "type": "string"
  21779. },
  21780. "data": {
  21781. "type": "object",
  21782. "properties": {
  21783. "timestamp": {
  21784. "type": "number"
  21785. },
  21786. "sessionID": {
  21787. "type": "string",
  21788. "pattern": "^ses"
  21789. },
  21790. "messageID": {
  21791. "type": "string",
  21792. "pattern": "^msg_"
  21793. },
  21794. "prompt": {
  21795. "$ref": "#/components/schemas/Prompt"
  21796. },
  21797. "delivery": {
  21798. "type": "string",
  21799. "enum": ["steer", "queue"]
  21800. }
  21801. },
  21802. "required": ["timestamp", "sessionID", "messageID", "prompt", "delivery"],
  21803. "additionalProperties": false
  21804. }
  21805. },
  21806. "required": ["type", "id", "seq", "aggregateID", "data"],
  21807. "additionalProperties": false
  21808. }
  21809. },
  21810. "required": ["type", "id", "syncEvent"],
  21811. "additionalProperties": false
  21812. },
  21813. "SyncEventSessionNextPromptPromoted": {
  21814. "type": "object",
  21815. "properties": {
  21816. "type": {
  21817. "type": "string",
  21818. "enum": ["sync"]
  21819. },
  21820. "id": {
  21821. "type": "string",
  21822. "pattern": "^evt_"
  21823. },
  21824. "syncEvent": {
  21825. "type": "object",
  21826. "properties": {
  21827. "type": {
  21828. "type": "string",
  21829. "enum": ["session.next.prompt.promoted.1"]
  21830. },
  21831. "id": {
  21832. "type": "string",
  21833. "pattern": "^evt_"
  21834. },
  21835. "seq": {
  21836. "type": "number"
  21837. },
  21838. "aggregateID": {
  21839. "type": "string"
  21840. },
  21841. "data": {
  21842. "type": "object",
  21843. "properties": {
  21844. "timestamp": {
  21845. "type": "number"
  21846. },
  21847. "sessionID": {
  21848. "type": "string",
  21849. "pattern": "^ses"
  21850. },
  21851. "messageID": {
  21852. "type": "string",
  21853. "pattern": "^msg_"
  21854. },
  21855. "prompt": {
  21856. "$ref": "#/components/schemas/Prompt"
  21857. },
  21858. "timeCreated": {
  21859. "type": "number"
  21860. }
  21861. },
  21862. "required": ["timestamp", "sessionID", "messageID", "prompt", "timeCreated"],
  21863. "additionalProperties": false
  21864. }
  21865. },
  21866. "required": ["type", "id", "seq", "aggregateID", "data"],
  21867. "additionalProperties": false
  21868. }
  21869. },
  21870. "required": ["type", "id", "syncEvent"],
  21871. "additionalProperties": false
  21872. },
  21873. "SyncEventSessionNextSynthetic": {
  21874. "type": "object",
  21875. "properties": {
  21876. "type": {
  21877. "type": "string",
  21878. "enum": ["sync"]
  21879. },
  21880. "id": {
  21881. "type": "string",
  21882. "pattern": "^evt_"
  21883. },
  21884. "syncEvent": {
  21885. "type": "object",
  21886. "properties": {
  21887. "type": {
  21888. "type": "string",
  21889. "enum": ["session.next.synthetic.1"]
  21890. },
  21891. "id": {
  21892. "type": "string",
  21893. "pattern": "^evt_"
  21894. },
  21895. "seq": {
  21896. "type": "number"
  21897. },
  21898. "aggregateID": {
  21899. "type": "string"
  21900. },
  21901. "data": {
  21902. "type": "object",
  21903. "properties": {
  21904. "timestamp": {
  21905. "type": "number"
  21906. },
  21907. "sessionID": {
  21908. "type": "string",
  21909. "pattern": "^ses"
  21910. },
  21911. "messageID": {
  21912. "type": "string",
  21913. "pattern": "^msg_"
  21914. },
  21915. "text": {
  21916. "type": "string"
  21917. }
  21918. },
  21919. "required": ["timestamp", "sessionID", "messageID", "text"],
  21920. "additionalProperties": false
  21921. }
  21922. },
  21923. "required": ["type", "id", "seq", "aggregateID", "data"],
  21924. "additionalProperties": false
  21925. }
  21926. },
  21927. "required": ["type", "id", "syncEvent"],
  21928. "additionalProperties": false
  21929. },
  21930. "SyncEventSessionNextShellStarted": {
  21931. "type": "object",
  21932. "properties": {
  21933. "type": {
  21934. "type": "string",
  21935. "enum": ["sync"]
  21936. },
  21937. "id": {
  21938. "type": "string",
  21939. "pattern": "^evt_"
  21940. },
  21941. "syncEvent": {
  21942. "type": "object",
  21943. "properties": {
  21944. "type": {
  21945. "type": "string",
  21946. "enum": ["session.next.shell.started.1"]
  21947. },
  21948. "id": {
  21949. "type": "string",
  21950. "pattern": "^evt_"
  21951. },
  21952. "seq": {
  21953. "type": "number"
  21954. },
  21955. "aggregateID": {
  21956. "type": "string"
  21957. },
  21958. "data": {
  21959. "type": "object",
  21960. "properties": {
  21961. "timestamp": {
  21962. "type": "number"
  21963. },
  21964. "sessionID": {
  21965. "type": "string",
  21966. "pattern": "^ses"
  21967. },
  21968. "messageID": {
  21969. "type": "string",
  21970. "pattern": "^msg_"
  21971. },
  21972. "callID": {
  21973. "type": "string"
  21974. },
  21975. "command": {
  21976. "type": "string"
  21977. }
  21978. },
  21979. "required": ["timestamp", "sessionID", "messageID", "callID", "command"],
  21980. "additionalProperties": false
  21981. }
  21982. },
  21983. "required": ["type", "id", "seq", "aggregateID", "data"],
  21984. "additionalProperties": false
  21985. }
  21986. },
  21987. "required": ["type", "id", "syncEvent"],
  21988. "additionalProperties": false
  21989. },
  21990. "SyncEventSessionNextShellEnded": {
  21991. "type": "object",
  21992. "properties": {
  21993. "type": {
  21994. "type": "string",
  21995. "enum": ["sync"]
  21996. },
  21997. "id": {
  21998. "type": "string",
  21999. "pattern": "^evt_"
  22000. },
  22001. "syncEvent": {
  22002. "type": "object",
  22003. "properties": {
  22004. "type": {
  22005. "type": "string",
  22006. "enum": ["session.next.shell.ended.1"]
  22007. },
  22008. "id": {
  22009. "type": "string",
  22010. "pattern": "^evt_"
  22011. },
  22012. "seq": {
  22013. "type": "number"
  22014. },
  22015. "aggregateID": {
  22016. "type": "string"
  22017. },
  22018. "data": {
  22019. "type": "object",
  22020. "properties": {
  22021. "timestamp": {
  22022. "type": "number"
  22023. },
  22024. "sessionID": {
  22025. "type": "string",
  22026. "pattern": "^ses"
  22027. },
  22028. "callID": {
  22029. "type": "string"
  22030. },
  22031. "output": {
  22032. "type": "string"
  22033. }
  22034. },
  22035. "required": ["timestamp", "sessionID", "callID", "output"],
  22036. "additionalProperties": false
  22037. }
  22038. },
  22039. "required": ["type", "id", "seq", "aggregateID", "data"],
  22040. "additionalProperties": false
  22041. }
  22042. },
  22043. "required": ["type", "id", "syncEvent"],
  22044. "additionalProperties": false
  22045. },
  22046. "SyncEventSessionNextStepStarted": {
  22047. "type": "object",
  22048. "properties": {
  22049. "type": {
  22050. "type": "string",
  22051. "enum": ["sync"]
  22052. },
  22053. "id": {
  22054. "type": "string",
  22055. "pattern": "^evt_"
  22056. },
  22057. "syncEvent": {
  22058. "type": "object",
  22059. "properties": {
  22060. "type": {
  22061. "type": "string",
  22062. "enum": ["session.next.step.started.1"]
  22063. },
  22064. "id": {
  22065. "type": "string",
  22066. "pattern": "^evt_"
  22067. },
  22068. "seq": {
  22069. "type": "number"
  22070. },
  22071. "aggregateID": {
  22072. "type": "string"
  22073. },
  22074. "data": {
  22075. "type": "object",
  22076. "properties": {
  22077. "timestamp": {
  22078. "type": "number"
  22079. },
  22080. "sessionID": {
  22081. "type": "string",
  22082. "pattern": "^ses"
  22083. },
  22084. "assistantMessageID": {
  22085. "type": "string",
  22086. "pattern": "^msg_"
  22087. },
  22088. "agent": {
  22089. "type": "string"
  22090. },
  22091. "model": {
  22092. "type": "object",
  22093. "properties": {
  22094. "id": {
  22095. "type": "string"
  22096. },
  22097. "providerID": {
  22098. "type": "string"
  22099. },
  22100. "variant": {
  22101. "type": "string"
  22102. }
  22103. },
  22104. "required": ["id", "providerID"],
  22105. "additionalProperties": false
  22106. },
  22107. "snapshot": {
  22108. "type": "string"
  22109. }
  22110. },
  22111. "required": ["timestamp", "sessionID", "assistantMessageID", "agent", "model"],
  22112. "additionalProperties": false
  22113. }
  22114. },
  22115. "required": ["type", "id", "seq", "aggregateID", "data"],
  22116. "additionalProperties": false
  22117. }
  22118. },
  22119. "required": ["type", "id", "syncEvent"],
  22120. "additionalProperties": false
  22121. },
  22122. "SyncEventSessionNextStepEnded": {
  22123. "type": "object",
  22124. "properties": {
  22125. "type": {
  22126. "type": "string",
  22127. "enum": ["sync"]
  22128. },
  22129. "id": {
  22130. "type": "string",
  22131. "pattern": "^evt_"
  22132. },
  22133. "syncEvent": {
  22134. "type": "object",
  22135. "properties": {
  22136. "type": {
  22137. "type": "string",
  22138. "enum": ["session.next.step.ended.2"]
  22139. },
  22140. "id": {
  22141. "type": "string",
  22142. "pattern": "^evt_"
  22143. },
  22144. "seq": {
  22145. "type": "number"
  22146. },
  22147. "aggregateID": {
  22148. "type": "string"
  22149. },
  22150. "data": {
  22151. "type": "object",
  22152. "properties": {
  22153. "timestamp": {
  22154. "type": "number"
  22155. },
  22156. "sessionID": {
  22157. "type": "string",
  22158. "pattern": "^ses"
  22159. },
  22160. "assistantMessageID": {
  22161. "type": "string",
  22162. "pattern": "^msg_"
  22163. },
  22164. "finish": {
  22165. "type": "string"
  22166. },
  22167. "cost": {
  22168. "type": "number"
  22169. },
  22170. "tokens": {
  22171. "type": "object",
  22172. "properties": {
  22173. "input": {
  22174. "type": "number"
  22175. },
  22176. "output": {
  22177. "type": "number"
  22178. },
  22179. "reasoning": {
  22180. "type": "number"
  22181. },
  22182. "cache": {
  22183. "type": "object",
  22184. "properties": {
  22185. "read": {
  22186. "type": "number"
  22187. },
  22188. "write": {
  22189. "type": "number"
  22190. }
  22191. },
  22192. "required": ["read", "write"],
  22193. "additionalProperties": false
  22194. }
  22195. },
  22196. "required": ["input", "output", "reasoning", "cache"],
  22197. "additionalProperties": false
  22198. },
  22199. "snapshot": {
  22200. "type": "string"
  22201. }
  22202. },
  22203. "required": ["timestamp", "sessionID", "assistantMessageID", "finish", "cost", "tokens"],
  22204. "additionalProperties": false
  22205. }
  22206. },
  22207. "required": ["type", "id", "seq", "aggregateID", "data"],
  22208. "additionalProperties": false
  22209. }
  22210. },
  22211. "required": ["type", "id", "syncEvent"],
  22212. "additionalProperties": false
  22213. },
  22214. "SyncEventSessionNextStepFailed": {
  22215. "type": "object",
  22216. "properties": {
  22217. "type": {
  22218. "type": "string",
  22219. "enum": ["sync"]
  22220. },
  22221. "id": {
  22222. "type": "string",
  22223. "pattern": "^evt_"
  22224. },
  22225. "syncEvent": {
  22226. "type": "object",
  22227. "properties": {
  22228. "type": {
  22229. "type": "string",
  22230. "enum": ["session.next.step.failed.2"]
  22231. },
  22232. "id": {
  22233. "type": "string",
  22234. "pattern": "^evt_"
  22235. },
  22236. "seq": {
  22237. "type": "number"
  22238. },
  22239. "aggregateID": {
  22240. "type": "string"
  22241. },
  22242. "data": {
  22243. "type": "object",
  22244. "properties": {
  22245. "timestamp": {
  22246. "type": "number"
  22247. },
  22248. "sessionID": {
  22249. "type": "string",
  22250. "pattern": "^ses"
  22251. },
  22252. "assistantMessageID": {
  22253. "type": "string",
  22254. "pattern": "^msg_"
  22255. },
  22256. "error": {
  22257. "$ref": "#/components/schemas/SessionErrorUnknown"
  22258. }
  22259. },
  22260. "required": ["timestamp", "sessionID", "assistantMessageID", "error"],
  22261. "additionalProperties": false
  22262. }
  22263. },
  22264. "required": ["type", "id", "seq", "aggregateID", "data"],
  22265. "additionalProperties": false
  22266. }
  22267. },
  22268. "required": ["type", "id", "syncEvent"],
  22269. "additionalProperties": false
  22270. },
  22271. "SyncEventSessionNextTextStarted": {
  22272. "type": "object",
  22273. "properties": {
  22274. "type": {
  22275. "type": "string",
  22276. "enum": ["sync"]
  22277. },
  22278. "id": {
  22279. "type": "string",
  22280. "pattern": "^evt_"
  22281. },
  22282. "syncEvent": {
  22283. "type": "object",
  22284. "properties": {
  22285. "type": {
  22286. "type": "string",
  22287. "enum": ["session.next.text.started.1"]
  22288. },
  22289. "id": {
  22290. "type": "string",
  22291. "pattern": "^evt_"
  22292. },
  22293. "seq": {
  22294. "type": "number"
  22295. },
  22296. "aggregateID": {
  22297. "type": "string"
  22298. },
  22299. "data": {
  22300. "type": "object",
  22301. "properties": {
  22302. "timestamp": {
  22303. "type": "number"
  22304. },
  22305. "sessionID": {
  22306. "type": "string",
  22307. "pattern": "^ses"
  22308. },
  22309. "assistantMessageID": {
  22310. "type": "string",
  22311. "pattern": "^msg_"
  22312. },
  22313. "textID": {
  22314. "type": "string"
  22315. }
  22316. },
  22317. "required": ["timestamp", "sessionID", "assistantMessageID", "textID"],
  22318. "additionalProperties": false
  22319. }
  22320. },
  22321. "required": ["type", "id", "seq", "aggregateID", "data"],
  22322. "additionalProperties": false
  22323. }
  22324. },
  22325. "required": ["type", "id", "syncEvent"],
  22326. "additionalProperties": false
  22327. },
  22328. "SyncEventSessionNextTextEnded": {
  22329. "type": "object",
  22330. "properties": {
  22331. "type": {
  22332. "type": "string",
  22333. "enum": ["sync"]
  22334. },
  22335. "id": {
  22336. "type": "string",
  22337. "pattern": "^evt_"
  22338. },
  22339. "syncEvent": {
  22340. "type": "object",
  22341. "properties": {
  22342. "type": {
  22343. "type": "string",
  22344. "enum": ["session.next.text.ended.1"]
  22345. },
  22346. "id": {
  22347. "type": "string",
  22348. "pattern": "^evt_"
  22349. },
  22350. "seq": {
  22351. "type": "number"
  22352. },
  22353. "aggregateID": {
  22354. "type": "string"
  22355. },
  22356. "data": {
  22357. "type": "object",
  22358. "properties": {
  22359. "timestamp": {
  22360. "type": "number"
  22361. },
  22362. "sessionID": {
  22363. "type": "string",
  22364. "pattern": "^ses"
  22365. },
  22366. "assistantMessageID": {
  22367. "type": "string",
  22368. "pattern": "^msg_"
  22369. },
  22370. "textID": {
  22371. "type": "string"
  22372. },
  22373. "text": {
  22374. "type": "string"
  22375. }
  22376. },
  22377. "required": ["timestamp", "sessionID", "assistantMessageID", "textID", "text"],
  22378. "additionalProperties": false
  22379. }
  22380. },
  22381. "required": ["type", "id", "seq", "aggregateID", "data"],
  22382. "additionalProperties": false
  22383. }
  22384. },
  22385. "required": ["type", "id", "syncEvent"],
  22386. "additionalProperties": false
  22387. },
  22388. "SyncEventSessionNextReasoningStarted": {
  22389. "type": "object",
  22390. "properties": {
  22391. "type": {
  22392. "type": "string",
  22393. "enum": ["sync"]
  22394. },
  22395. "id": {
  22396. "type": "string",
  22397. "pattern": "^evt_"
  22398. },
  22399. "syncEvent": {
  22400. "type": "object",
  22401. "properties": {
  22402. "type": {
  22403. "type": "string",
  22404. "enum": ["session.next.reasoning.started.1"]
  22405. },
  22406. "id": {
  22407. "type": "string",
  22408. "pattern": "^evt_"
  22409. },
  22410. "seq": {
  22411. "type": "number"
  22412. },
  22413. "aggregateID": {
  22414. "type": "string"
  22415. },
  22416. "data": {
  22417. "type": "object",
  22418. "properties": {
  22419. "timestamp": {
  22420. "type": "number"
  22421. },
  22422. "sessionID": {
  22423. "type": "string",
  22424. "pattern": "^ses"
  22425. },
  22426. "assistantMessageID": {
  22427. "type": "string",
  22428. "pattern": "^msg_"
  22429. },
  22430. "reasoningID": {
  22431. "type": "string"
  22432. },
  22433. "providerMetadata": {
  22434. "type": "object",
  22435. "additionalProperties": {
  22436. "type": "object"
  22437. }
  22438. }
  22439. },
  22440. "required": ["timestamp", "sessionID", "assistantMessageID", "reasoningID"],
  22441. "additionalProperties": false
  22442. }
  22443. },
  22444. "required": ["type", "id", "seq", "aggregateID", "data"],
  22445. "additionalProperties": false
  22446. }
  22447. },
  22448. "required": ["type", "id", "syncEvent"],
  22449. "additionalProperties": false
  22450. },
  22451. "SyncEventSessionNextReasoningEnded": {
  22452. "type": "object",
  22453. "properties": {
  22454. "type": {
  22455. "type": "string",
  22456. "enum": ["sync"]
  22457. },
  22458. "id": {
  22459. "type": "string",
  22460. "pattern": "^evt_"
  22461. },
  22462. "syncEvent": {
  22463. "type": "object",
  22464. "properties": {
  22465. "type": {
  22466. "type": "string",
  22467. "enum": ["session.next.reasoning.ended.1"]
  22468. },
  22469. "id": {
  22470. "type": "string",
  22471. "pattern": "^evt_"
  22472. },
  22473. "seq": {
  22474. "type": "number"
  22475. },
  22476. "aggregateID": {
  22477. "type": "string"
  22478. },
  22479. "data": {
  22480. "type": "object",
  22481. "properties": {
  22482. "timestamp": {
  22483. "type": "number"
  22484. },
  22485. "sessionID": {
  22486. "type": "string",
  22487. "pattern": "^ses"
  22488. },
  22489. "assistantMessageID": {
  22490. "type": "string",
  22491. "pattern": "^msg_"
  22492. },
  22493. "reasoningID": {
  22494. "type": "string"
  22495. },
  22496. "text": {
  22497. "type": "string"
  22498. },
  22499. "providerMetadata": {
  22500. "type": "object",
  22501. "additionalProperties": {
  22502. "type": "object"
  22503. }
  22504. }
  22505. },
  22506. "required": ["timestamp", "sessionID", "assistantMessageID", "reasoningID", "text"],
  22507. "additionalProperties": false
  22508. }
  22509. },
  22510. "required": ["type", "id", "seq", "aggregateID", "data"],
  22511. "additionalProperties": false
  22512. }
  22513. },
  22514. "required": ["type", "id", "syncEvent"],
  22515. "additionalProperties": false
  22516. },
  22517. "SyncEventSessionNextToolInputStarted": {
  22518. "type": "object",
  22519. "properties": {
  22520. "type": {
  22521. "type": "string",
  22522. "enum": ["sync"]
  22523. },
  22524. "id": {
  22525. "type": "string",
  22526. "pattern": "^evt_"
  22527. },
  22528. "syncEvent": {
  22529. "type": "object",
  22530. "properties": {
  22531. "type": {
  22532. "type": "string",
  22533. "enum": ["session.next.tool.input.started.1"]
  22534. },
  22535. "id": {
  22536. "type": "string",
  22537. "pattern": "^evt_"
  22538. },
  22539. "seq": {
  22540. "type": "number"
  22541. },
  22542. "aggregateID": {
  22543. "type": "string"
  22544. },
  22545. "data": {
  22546. "type": "object",
  22547. "properties": {
  22548. "timestamp": {
  22549. "type": "number"
  22550. },
  22551. "sessionID": {
  22552. "type": "string",
  22553. "pattern": "^ses"
  22554. },
  22555. "assistantMessageID": {
  22556. "type": "string",
  22557. "pattern": "^msg_"
  22558. },
  22559. "callID": {
  22560. "type": "string"
  22561. },
  22562. "name": {
  22563. "type": "string"
  22564. }
  22565. },
  22566. "required": ["timestamp", "sessionID", "assistantMessageID", "callID", "name"],
  22567. "additionalProperties": false
  22568. }
  22569. },
  22570. "required": ["type", "id", "seq", "aggregateID", "data"],
  22571. "additionalProperties": false
  22572. }
  22573. },
  22574. "required": ["type", "id", "syncEvent"],
  22575. "additionalProperties": false
  22576. },
  22577. "SyncEventSessionNextToolInputEnded": {
  22578. "type": "object",
  22579. "properties": {
  22580. "type": {
  22581. "type": "string",
  22582. "enum": ["sync"]
  22583. },
  22584. "id": {
  22585. "type": "string",
  22586. "pattern": "^evt_"
  22587. },
  22588. "syncEvent": {
  22589. "type": "object",
  22590. "properties": {
  22591. "type": {
  22592. "type": "string",
  22593. "enum": ["session.next.tool.input.ended.1"]
  22594. },
  22595. "id": {
  22596. "type": "string",
  22597. "pattern": "^evt_"
  22598. },
  22599. "seq": {
  22600. "type": "number"
  22601. },
  22602. "aggregateID": {
  22603. "type": "string"
  22604. },
  22605. "data": {
  22606. "type": "object",
  22607. "properties": {
  22608. "timestamp": {
  22609. "type": "number"
  22610. },
  22611. "sessionID": {
  22612. "type": "string",
  22613. "pattern": "^ses"
  22614. },
  22615. "assistantMessageID": {
  22616. "type": "string",
  22617. "pattern": "^msg_"
  22618. },
  22619. "callID": {
  22620. "type": "string"
  22621. },
  22622. "text": {
  22623. "type": "string"
  22624. }
  22625. },
  22626. "required": ["timestamp", "sessionID", "assistantMessageID", "callID", "text"],
  22627. "additionalProperties": false
  22628. }
  22629. },
  22630. "required": ["type", "id", "seq", "aggregateID", "data"],
  22631. "additionalProperties": false
  22632. }
  22633. },
  22634. "required": ["type", "id", "syncEvent"],
  22635. "additionalProperties": false
  22636. },
  22637. "SyncEventSessionNextToolCalled": {
  22638. "type": "object",
  22639. "properties": {
  22640. "type": {
  22641. "type": "string",
  22642. "enum": ["sync"]
  22643. },
  22644. "id": {
  22645. "type": "string",
  22646. "pattern": "^evt_"
  22647. },
  22648. "syncEvent": {
  22649. "type": "object",
  22650. "properties": {
  22651. "type": {
  22652. "type": "string",
  22653. "enum": ["session.next.tool.called.1"]
  22654. },
  22655. "id": {
  22656. "type": "string",
  22657. "pattern": "^evt_"
  22658. },
  22659. "seq": {
  22660. "type": "number"
  22661. },
  22662. "aggregateID": {
  22663. "type": "string"
  22664. },
  22665. "data": {
  22666. "type": "object",
  22667. "properties": {
  22668. "timestamp": {
  22669. "type": "number"
  22670. },
  22671. "sessionID": {
  22672. "type": "string",
  22673. "pattern": "^ses"
  22674. },
  22675. "assistantMessageID": {
  22676. "type": "string",
  22677. "pattern": "^msg_"
  22678. },
  22679. "callID": {
  22680. "type": "string"
  22681. },
  22682. "tool": {
  22683. "type": "string"
  22684. },
  22685. "input": {
  22686. "type": "object"
  22687. },
  22688. "provider": {
  22689. "type": "object",
  22690. "properties": {
  22691. "executed": {
  22692. "type": "boolean"
  22693. },
  22694. "metadata": {
  22695. "type": "object",
  22696. "additionalProperties": {
  22697. "type": "object"
  22698. }
  22699. }
  22700. },
  22701. "required": ["executed"],
  22702. "additionalProperties": false
  22703. }
  22704. },
  22705. "required": ["timestamp", "sessionID", "assistantMessageID", "callID", "tool", "input", "provider"],
  22706. "additionalProperties": false
  22707. }
  22708. },
  22709. "required": ["type", "id", "seq", "aggregateID", "data"],
  22710. "additionalProperties": false
  22711. }
  22712. },
  22713. "required": ["type", "id", "syncEvent"],
  22714. "additionalProperties": false
  22715. },
  22716. "SyncEventSessionNextToolProgress": {
  22717. "type": "object",
  22718. "properties": {
  22719. "type": {
  22720. "type": "string",
  22721. "enum": ["sync"]
  22722. },
  22723. "id": {
  22724. "type": "string",
  22725. "pattern": "^evt_"
  22726. },
  22727. "syncEvent": {
  22728. "type": "object",
  22729. "properties": {
  22730. "type": {
  22731. "type": "string",
  22732. "enum": ["session.next.tool.progress.1"]
  22733. },
  22734. "id": {
  22735. "type": "string",
  22736. "pattern": "^evt_"
  22737. },
  22738. "seq": {
  22739. "type": "number"
  22740. },
  22741. "aggregateID": {
  22742. "type": "string"
  22743. },
  22744. "data": {
  22745. "type": "object",
  22746. "properties": {
  22747. "timestamp": {
  22748. "type": "number"
  22749. },
  22750. "sessionID": {
  22751. "type": "string",
  22752. "pattern": "^ses"
  22753. },
  22754. "assistantMessageID": {
  22755. "type": "string",
  22756. "pattern": "^msg_"
  22757. },
  22758. "callID": {
  22759. "type": "string"
  22760. },
  22761. "structured": {
  22762. "type": "object"
  22763. },
  22764. "content": {
  22765. "type": "array",
  22766. "items": {
  22767. "anyOf": [
  22768. {
  22769. "$ref": "#/components/schemas/ToolTextContent"
  22770. },
  22771. {
  22772. "$ref": "#/components/schemas/ToolFileContent"
  22773. }
  22774. ]
  22775. }
  22776. }
  22777. },
  22778. "required": ["timestamp", "sessionID", "assistantMessageID", "callID", "structured", "content"],
  22779. "additionalProperties": false
  22780. }
  22781. },
  22782. "required": ["type", "id", "seq", "aggregateID", "data"],
  22783. "additionalProperties": false
  22784. }
  22785. },
  22786. "required": ["type", "id", "syncEvent"],
  22787. "additionalProperties": false
  22788. },
  22789. "SyncEventSessionNextToolSuccess": {
  22790. "type": "object",
  22791. "properties": {
  22792. "type": {
  22793. "type": "string",
  22794. "enum": ["sync"]
  22795. },
  22796. "id": {
  22797. "type": "string",
  22798. "pattern": "^evt_"
  22799. },
  22800. "syncEvent": {
  22801. "type": "object",
  22802. "properties": {
  22803. "type": {
  22804. "type": "string",
  22805. "enum": ["session.next.tool.success.1"]
  22806. },
  22807. "id": {
  22808. "type": "string",
  22809. "pattern": "^evt_"
  22810. },
  22811. "seq": {
  22812. "type": "number"
  22813. },
  22814. "aggregateID": {
  22815. "type": "string"
  22816. },
  22817. "data": {
  22818. "type": "object",
  22819. "properties": {
  22820. "timestamp": {
  22821. "type": "number"
  22822. },
  22823. "sessionID": {
  22824. "type": "string",
  22825. "pattern": "^ses"
  22826. },
  22827. "assistantMessageID": {
  22828. "type": "string",
  22829. "pattern": "^msg_"
  22830. },
  22831. "callID": {
  22832. "type": "string"
  22833. },
  22834. "structured": {
  22835. "type": "object"
  22836. },
  22837. "content": {
  22838. "type": "array",
  22839. "items": {
  22840. "anyOf": [
  22841. {
  22842. "$ref": "#/components/schemas/ToolTextContent"
  22843. },
  22844. {
  22845. "$ref": "#/components/schemas/ToolFileContent"
  22846. }
  22847. ]
  22848. }
  22849. },
  22850. "result": {},
  22851. "provider": {
  22852. "type": "object",
  22853. "properties": {
  22854. "executed": {
  22855. "type": "boolean"
  22856. },
  22857. "metadata": {
  22858. "type": "object",
  22859. "additionalProperties": {
  22860. "type": "object"
  22861. }
  22862. }
  22863. },
  22864. "required": ["executed"],
  22865. "additionalProperties": false
  22866. }
  22867. },
  22868. "required": [
  22869. "timestamp",
  22870. "sessionID",
  22871. "assistantMessageID",
  22872. "callID",
  22873. "structured",
  22874. "content",
  22875. "provider"
  22876. ],
  22877. "additionalProperties": false
  22878. }
  22879. },
  22880. "required": ["type", "id", "seq", "aggregateID", "data"],
  22881. "additionalProperties": false
  22882. }
  22883. },
  22884. "required": ["type", "id", "syncEvent"],
  22885. "additionalProperties": false
  22886. },
  22887. "SyncEventSessionNextToolFailed": {
  22888. "type": "object",
  22889. "properties": {
  22890. "type": {
  22891. "type": "string",
  22892. "enum": ["sync"]
  22893. },
  22894. "id": {
  22895. "type": "string",
  22896. "pattern": "^evt_"
  22897. },
  22898. "syncEvent": {
  22899. "type": "object",
  22900. "properties": {
  22901. "type": {
  22902. "type": "string",
  22903. "enum": ["session.next.tool.failed.1"]
  22904. },
  22905. "id": {
  22906. "type": "string",
  22907. "pattern": "^evt_"
  22908. },
  22909. "seq": {
  22910. "type": "number"
  22911. },
  22912. "aggregateID": {
  22913. "type": "string"
  22914. },
  22915. "data": {
  22916. "type": "object",
  22917. "properties": {
  22918. "timestamp": {
  22919. "type": "number"
  22920. },
  22921. "sessionID": {
  22922. "type": "string",
  22923. "pattern": "^ses"
  22924. },
  22925. "assistantMessageID": {
  22926. "type": "string",
  22927. "pattern": "^msg_"
  22928. },
  22929. "callID": {
  22930. "type": "string"
  22931. },
  22932. "error": {
  22933. "$ref": "#/components/schemas/SessionErrorUnknown"
  22934. },
  22935. "result": {},
  22936. "provider": {
  22937. "type": "object",
  22938. "properties": {
  22939. "executed": {
  22940. "type": "boolean"
  22941. },
  22942. "metadata": {
  22943. "type": "object",
  22944. "additionalProperties": {
  22945. "type": "object"
  22946. }
  22947. }
  22948. },
  22949. "required": ["executed"],
  22950. "additionalProperties": false
  22951. }
  22952. },
  22953. "required": ["timestamp", "sessionID", "assistantMessageID", "callID", "error", "provider"],
  22954. "additionalProperties": false
  22955. }
  22956. },
  22957. "required": ["type", "id", "seq", "aggregateID", "data"],
  22958. "additionalProperties": false
  22959. }
  22960. },
  22961. "required": ["type", "id", "syncEvent"],
  22962. "additionalProperties": false
  22963. },
  22964. "SyncEventSessionNextRetried": {
  22965. "type": "object",
  22966. "properties": {
  22967. "type": {
  22968. "type": "string",
  22969. "enum": ["sync"]
  22970. },
  22971. "id": {
  22972. "type": "string",
  22973. "pattern": "^evt_"
  22974. },
  22975. "syncEvent": {
  22976. "type": "object",
  22977. "properties": {
  22978. "type": {
  22979. "type": "string",
  22980. "enum": ["session.next.retried.1"]
  22981. },
  22982. "id": {
  22983. "type": "string",
  22984. "pattern": "^evt_"
  22985. },
  22986. "seq": {
  22987. "type": "number"
  22988. },
  22989. "aggregateID": {
  22990. "type": "string"
  22991. },
  22992. "data": {
  22993. "type": "object",
  22994. "properties": {
  22995. "timestamp": {
  22996. "type": "number"
  22997. },
  22998. "sessionID": {
  22999. "type": "string",
  23000. "pattern": "^ses"
  23001. },
  23002. "attempt": {
  23003. "type": "number"
  23004. },
  23005. "error": {
  23006. "$ref": "#/components/schemas/SessionNextRetry_error"
  23007. }
  23008. },
  23009. "required": ["timestamp", "sessionID", "attempt", "error"],
  23010. "additionalProperties": false
  23011. }
  23012. },
  23013. "required": ["type", "id", "seq", "aggregateID", "data"],
  23014. "additionalProperties": false
  23015. }
  23016. },
  23017. "required": ["type", "id", "syncEvent"],
  23018. "additionalProperties": false
  23019. },
  23020. "SyncEventSessionNextCompactionStarted": {
  23021. "type": "object",
  23022. "properties": {
  23023. "type": {
  23024. "type": "string",
  23025. "enum": ["sync"]
  23026. },
  23027. "id": {
  23028. "type": "string",
  23029. "pattern": "^evt_"
  23030. },
  23031. "syncEvent": {
  23032. "type": "object",
  23033. "properties": {
  23034. "type": {
  23035. "type": "string",
  23036. "enum": ["session.next.compaction.started.1"]
  23037. },
  23038. "id": {
  23039. "type": "string",
  23040. "pattern": "^evt_"
  23041. },
  23042. "seq": {
  23043. "type": "number"
  23044. },
  23045. "aggregateID": {
  23046. "type": "string"
  23047. },
  23048. "data": {
  23049. "type": "object",
  23050. "properties": {
  23051. "timestamp": {
  23052. "type": "number"
  23053. },
  23054. "sessionID": {
  23055. "type": "string",
  23056. "pattern": "^ses"
  23057. },
  23058. "messageID": {
  23059. "type": "string",
  23060. "pattern": "^msg_"
  23061. },
  23062. "reason": {
  23063. "type": "string",
  23064. "enum": ["auto", "manual"]
  23065. }
  23066. },
  23067. "required": ["timestamp", "sessionID", "messageID", "reason"],
  23068. "additionalProperties": false
  23069. }
  23070. },
  23071. "required": ["type", "id", "seq", "aggregateID", "data"],
  23072. "additionalProperties": false
  23073. }
  23074. },
  23075. "required": ["type", "id", "syncEvent"],
  23076. "additionalProperties": false
  23077. },
  23078. "SyncEventSessionNextCompactionDelta": {
  23079. "type": "object",
  23080. "properties": {
  23081. "type": {
  23082. "type": "string",
  23083. "enum": ["sync"]
  23084. },
  23085. "id": {
  23086. "type": "string",
  23087. "pattern": "^evt_"
  23088. },
  23089. "syncEvent": {
  23090. "type": "object",
  23091. "properties": {
  23092. "type": {
  23093. "type": "string",
  23094. "enum": ["session.next.compaction.delta.1"]
  23095. },
  23096. "id": {
  23097. "type": "string",
  23098. "pattern": "^evt_"
  23099. },
  23100. "seq": {
  23101. "type": "number"
  23102. },
  23103. "aggregateID": {
  23104. "type": "string"
  23105. },
  23106. "data": {
  23107. "type": "object",
  23108. "properties": {
  23109. "timestamp": {
  23110. "type": "number"
  23111. },
  23112. "sessionID": {
  23113. "type": "string",
  23114. "pattern": "^ses"
  23115. },
  23116. "text": {
  23117. "type": "string"
  23118. }
  23119. },
  23120. "required": ["timestamp", "sessionID", "text"],
  23121. "additionalProperties": false
  23122. }
  23123. },
  23124. "required": ["type", "id", "seq", "aggregateID", "data"],
  23125. "additionalProperties": false
  23126. }
  23127. },
  23128. "required": ["type", "id", "syncEvent"],
  23129. "additionalProperties": false
  23130. },
  23131. "SyncEventSessionNextCompactionEnded": {
  23132. "type": "object",
  23133. "properties": {
  23134. "type": {
  23135. "type": "string",
  23136. "enum": ["sync"]
  23137. },
  23138. "id": {
  23139. "type": "string",
  23140. "pattern": "^evt_"
  23141. },
  23142. "syncEvent": {
  23143. "type": "object",
  23144. "properties": {
  23145. "type": {
  23146. "type": "string",
  23147. "enum": ["session.next.compaction.ended.1"]
  23148. },
  23149. "id": {
  23150. "type": "string",
  23151. "pattern": "^evt_"
  23152. },
  23153. "seq": {
  23154. "type": "number"
  23155. },
  23156. "aggregateID": {
  23157. "type": "string"
  23158. },
  23159. "data": {
  23160. "type": "object",
  23161. "properties": {
  23162. "timestamp": {
  23163. "type": "number"
  23164. },
  23165. "sessionID": {
  23166. "type": "string",
  23167. "pattern": "^ses"
  23168. },
  23169. "text": {
  23170. "type": "string"
  23171. },
  23172. "include": {
  23173. "type": "string"
  23174. }
  23175. },
  23176. "required": ["timestamp", "sessionID", "text"],
  23177. "additionalProperties": false
  23178. }
  23179. },
  23180. "required": ["type", "id", "seq", "aggregateID", "data"],
  23181. "additionalProperties": false
  23182. }
  23183. },
  23184. "required": ["type", "id", "syncEvent"],
  23185. "additionalProperties": false
  23186. },
  23187. "PolicyEffect": {
  23188. "type": "string",
  23189. "enum": ["allow", "deny"]
  23190. },
  23191. "ConfigV2ExperimentalPolicy": {
  23192. "type": "object",
  23193. "properties": {
  23194. "action": {
  23195. "type": "string",
  23196. "enum": ["provider.use"]
  23197. },
  23198. "effect": {
  23199. "$ref": "#/components/schemas/PolicyEffect"
  23200. },
  23201. "resource": {
  23202. "type": "string"
  23203. }
  23204. },
  23205. "required": ["action", "effect", "resource"],
  23206. "additionalProperties": false
  23207. },
  23208. "ProjectDirectories": {
  23209. "type": "array",
  23210. "items": {
  23211. "type": "string"
  23212. }
  23213. },
  23214. "ProjectCopyCopy": {
  23215. "type": "object",
  23216. "properties": {
  23217. "directory": {
  23218. "type": "string"
  23219. }
  23220. },
  23221. "required": ["directory"],
  23222. "additionalProperties": false
  23223. },
  23224. "LocationInfo": {
  23225. "type": "object",
  23226. "properties": {
  23227. "directory": {
  23228. "type": "string"
  23229. },
  23230. "workspaceID": {
  23231. "type": "string",
  23232. "pattern": "^wrk"
  23233. },
  23234. "project": {
  23235. "type": "object",
  23236. "properties": {
  23237. "id": {
  23238. "type": "string"
  23239. },
  23240. "directory": {
  23241. "type": "string"
  23242. }
  23243. },
  23244. "required": ["id", "directory"],
  23245. "additionalProperties": false
  23246. }
  23247. },
  23248. "required": ["directory", "project"],
  23249. "additionalProperties": false
  23250. },
  23251. "PermissionV2Effect": {
  23252. "type": "string",
  23253. "enum": ["allow", "deny", "ask"]
  23254. },
  23255. "PermissionV2Rule": {
  23256. "type": "object",
  23257. "properties": {
  23258. "action": {
  23259. "type": "string"
  23260. },
  23261. "resource": {
  23262. "type": "string"
  23263. },
  23264. "effect": {
  23265. "$ref": "#/components/schemas/PermissionV2Effect"
  23266. }
  23267. },
  23268. "required": ["action", "resource", "effect"],
  23269. "additionalProperties": false
  23270. },
  23271. "PermissionV2Ruleset": {
  23272. "type": "array",
  23273. "items": {
  23274. "$ref": "#/components/schemas/PermissionV2Rule"
  23275. }
  23276. },
  23277. "AgentV2Info": {
  23278. "type": "object",
  23279. "properties": {
  23280. "id": {
  23281. "type": "string"
  23282. },
  23283. "model": {
  23284. "type": "object",
  23285. "properties": {
  23286. "id": {
  23287. "type": "string"
  23288. },
  23289. "providerID": {
  23290. "type": "string"
  23291. },
  23292. "variant": {
  23293. "type": "string"
  23294. }
  23295. },
  23296. "required": ["id", "providerID"],
  23297. "additionalProperties": false
  23298. },
  23299. "request": {
  23300. "type": "object",
  23301. "properties": {
  23302. "headers": {
  23303. "type": "object",
  23304. "additionalProperties": {
  23305. "type": "string"
  23306. }
  23307. },
  23308. "body": {
  23309. "type": "object"
  23310. }
  23311. },
  23312. "required": ["headers", "body"],
  23313. "additionalProperties": false
  23314. },
  23315. "system": {
  23316. "type": "string"
  23317. },
  23318. "description": {
  23319. "type": "string"
  23320. },
  23321. "mode": {
  23322. "type": "string",
  23323. "enum": ["subagent", "primary", "all"]
  23324. },
  23325. "hidden": {
  23326. "type": "boolean"
  23327. },
  23328. "color": {
  23329. "anyOf": [
  23330. {
  23331. "type": "string",
  23332. "pattern": "^#[0-9a-fA-F]{6}$"
  23333. },
  23334. {
  23335. "type": "string",
  23336. "enum": ["primary", "secondary", "accent", "success", "warning", "error", "info"]
  23337. }
  23338. ]
  23339. },
  23340. "steps": {
  23341. "type": "integer",
  23342. "exclusiveMinimum": 0
  23343. },
  23344. "permissions": {
  23345. "$ref": "#/components/schemas/PermissionV2Ruleset"
  23346. }
  23347. },
  23348. "required": ["id", "request", "mode", "hidden", "permissions"],
  23349. "additionalProperties": false
  23350. },
  23351. "SessionV2Info": {
  23352. "type": "object",
  23353. "properties": {
  23354. "id": {
  23355. "type": "string",
  23356. "pattern": "^ses"
  23357. },
  23358. "parentID": {
  23359. "type": "string",
  23360. "pattern": "^ses"
  23361. },
  23362. "projectID": {
  23363. "type": "string"
  23364. },
  23365. "agent": {
  23366. "type": "string"
  23367. },
  23368. "model": {
  23369. "type": "object",
  23370. "properties": {
  23371. "id": {
  23372. "type": "string"
  23373. },
  23374. "providerID": {
  23375. "type": "string"
  23376. },
  23377. "variant": {
  23378. "type": "string"
  23379. }
  23380. },
  23381. "required": ["id", "providerID"],
  23382. "additionalProperties": false
  23383. },
  23384. "cost": {
  23385. "type": "number"
  23386. },
  23387. "tokens": {
  23388. "type": "object",
  23389. "properties": {
  23390. "input": {
  23391. "type": "number"
  23392. },
  23393. "output": {
  23394. "type": "number"
  23395. },
  23396. "reasoning": {
  23397. "type": "number"
  23398. },
  23399. "cache": {
  23400. "type": "object",
  23401. "properties": {
  23402. "read": {
  23403. "type": "number"
  23404. },
  23405. "write": {
  23406. "type": "number"
  23407. }
  23408. },
  23409. "required": ["read", "write"],
  23410. "additionalProperties": false
  23411. }
  23412. },
  23413. "required": ["input", "output", "reasoning", "cache"],
  23414. "additionalProperties": false
  23415. },
  23416. "time": {
  23417. "type": "object",
  23418. "properties": {
  23419. "created": {
  23420. "type": "number"
  23421. },
  23422. "updated": {
  23423. "type": "number"
  23424. },
  23425. "archived": {
  23426. "type": "number"
  23427. }
  23428. },
  23429. "required": ["created", "updated"],
  23430. "additionalProperties": false
  23431. },
  23432. "title": {
  23433. "type": "string"
  23434. },
  23435. "location": {
  23436. "$ref": "#/components/schemas/LocationRef"
  23437. },
  23438. "subpath": {
  23439. "type": "string"
  23440. }
  23441. },
  23442. "required": ["id", "projectID", "cost", "tokens", "time", "title", "location"],
  23443. "additionalProperties": false
  23444. },
  23445. "SessionInputAdmitted": {
  23446. "type": "object",
  23447. "properties": {
  23448. "admittedSeq": {
  23449. "type": "integer",
  23450. "minimum": 0
  23451. },
  23452. "id": {
  23453. "type": "string",
  23454. "pattern": "^msg_"
  23455. },
  23456. "sessionID": {
  23457. "type": "string",
  23458. "pattern": "^ses"
  23459. },
  23460. "prompt": {
  23461. "$ref": "#/components/schemas/Prompt"
  23462. },
  23463. "delivery": {
  23464. "type": "string",
  23465. "enum": ["steer", "queue"]
  23466. },
  23467. "timeCreated": {
  23468. "type": "number"
  23469. },
  23470. "promotedSeq": {
  23471. "type": "integer",
  23472. "minimum": 0
  23473. }
  23474. },
  23475. "required": ["admittedSeq", "id", "sessionID", "prompt", "delivery", "timeCreated"],
  23476. "additionalProperties": false
  23477. },
  23478. "SessionMessageAgentSwitched": {
  23479. "type": "object",
  23480. "properties": {
  23481. "id": {
  23482. "type": "string",
  23483. "pattern": "^msg_"
  23484. },
  23485. "metadata": {
  23486. "type": "object"
  23487. },
  23488. "time": {
  23489. "type": "object",
  23490. "properties": {
  23491. "created": {
  23492. "type": "number"
  23493. }
  23494. },
  23495. "required": ["created"],
  23496. "additionalProperties": false
  23497. },
  23498. "type": {
  23499. "type": "string",
  23500. "enum": ["agent-switched"]
  23501. },
  23502. "agent": {
  23503. "type": "string"
  23504. }
  23505. },
  23506. "required": ["id", "time", "type", "agent"],
  23507. "additionalProperties": false
  23508. },
  23509. "SessionMessageModelSwitched": {
  23510. "type": "object",
  23511. "properties": {
  23512. "id": {
  23513. "type": "string",
  23514. "pattern": "^msg_"
  23515. },
  23516. "metadata": {
  23517. "type": "object"
  23518. },
  23519. "time": {
  23520. "type": "object",
  23521. "properties": {
  23522. "created": {
  23523. "type": "number"
  23524. }
  23525. },
  23526. "required": ["created"],
  23527. "additionalProperties": false
  23528. },
  23529. "type": {
  23530. "type": "string",
  23531. "enum": ["model-switched"]
  23532. },
  23533. "model": {
  23534. "type": "object",
  23535. "properties": {
  23536. "id": {
  23537. "type": "string"
  23538. },
  23539. "providerID": {
  23540. "type": "string"
  23541. },
  23542. "variant": {
  23543. "type": "string"
  23544. }
  23545. },
  23546. "required": ["id", "providerID"],
  23547. "additionalProperties": false
  23548. }
  23549. },
  23550. "required": ["id", "time", "type", "model"],
  23551. "additionalProperties": false
  23552. },
  23553. "SessionMessageUser": {
  23554. "type": "object",
  23555. "properties": {
  23556. "id": {
  23557. "type": "string",
  23558. "pattern": "^msg_"
  23559. },
  23560. "metadata": {
  23561. "type": "object"
  23562. },
  23563. "time": {
  23564. "type": "object",
  23565. "properties": {
  23566. "created": {
  23567. "type": "number"
  23568. }
  23569. },
  23570. "required": ["created"],
  23571. "additionalProperties": false
  23572. },
  23573. "text": {
  23574. "type": "string"
  23575. },
  23576. "files": {
  23577. "type": "array",
  23578. "items": {
  23579. "$ref": "#/components/schemas/PromptFileAttachment"
  23580. }
  23581. },
  23582. "agents": {
  23583. "type": "array",
  23584. "items": {
  23585. "$ref": "#/components/schemas/PromptAgentAttachment"
  23586. }
  23587. },
  23588. "references": {
  23589. "type": "array",
  23590. "items": {
  23591. "$ref": "#/components/schemas/PromptReferenceAttachment"
  23592. }
  23593. },
  23594. "type": {
  23595. "type": "string",
  23596. "enum": ["user"]
  23597. }
  23598. },
  23599. "required": ["id", "time", "text", "type"],
  23600. "additionalProperties": false
  23601. },
  23602. "SessionMessageSynthetic": {
  23603. "type": "object",
  23604. "properties": {
  23605. "id": {
  23606. "type": "string",
  23607. "pattern": "^msg_"
  23608. },
  23609. "metadata": {
  23610. "type": "object"
  23611. },
  23612. "time": {
  23613. "type": "object",
  23614. "properties": {
  23615. "created": {
  23616. "type": "number"
  23617. }
  23618. },
  23619. "required": ["created"],
  23620. "additionalProperties": false
  23621. },
  23622. "sessionID": {
  23623. "type": "string",
  23624. "pattern": "^ses"
  23625. },
  23626. "text": {
  23627. "type": "string"
  23628. },
  23629. "type": {
  23630. "type": "string",
  23631. "enum": ["synthetic"]
  23632. }
  23633. },
  23634. "required": ["id", "time", "sessionID", "text", "type"],
  23635. "additionalProperties": false
  23636. },
  23637. "SessionMessageShell": {
  23638. "type": "object",
  23639. "properties": {
  23640. "id": {
  23641. "type": "string",
  23642. "pattern": "^msg_"
  23643. },
  23644. "metadata": {
  23645. "type": "object"
  23646. },
  23647. "time": {
  23648. "type": "object",
  23649. "properties": {
  23650. "created": {
  23651. "type": "number"
  23652. },
  23653. "completed": {
  23654. "type": "number"
  23655. }
  23656. },
  23657. "required": ["created"],
  23658. "additionalProperties": false
  23659. },
  23660. "type": {
  23661. "type": "string",
  23662. "enum": ["shell"]
  23663. },
  23664. "callID": {
  23665. "type": "string"
  23666. },
  23667. "command": {
  23668. "type": "string"
  23669. },
  23670. "output": {
  23671. "type": "string"
  23672. }
  23673. },
  23674. "required": ["id", "time", "type", "callID", "command", "output"],
  23675. "additionalProperties": false
  23676. },
  23677. "SessionMessageAssistantText": {
  23678. "type": "object",
  23679. "properties": {
  23680. "type": {
  23681. "type": "string",
  23682. "enum": ["text"]
  23683. },
  23684. "id": {
  23685. "type": "string"
  23686. },
  23687. "text": {
  23688. "type": "string"
  23689. }
  23690. },
  23691. "required": ["type", "id", "text"],
  23692. "additionalProperties": false
  23693. },
  23694. "SessionMessageAssistantReasoning": {
  23695. "type": "object",
  23696. "properties": {
  23697. "type": {
  23698. "type": "string",
  23699. "enum": ["reasoning"]
  23700. },
  23701. "id": {
  23702. "type": "string"
  23703. },
  23704. "text": {
  23705. "type": "string"
  23706. },
  23707. "providerMetadata": {
  23708. "type": "object",
  23709. "additionalProperties": {
  23710. "type": "object"
  23711. }
  23712. }
  23713. },
  23714. "required": ["type", "id", "text"],
  23715. "additionalProperties": false
  23716. },
  23717. "SessionMessageToolStatePending": {
  23718. "type": "object",
  23719. "properties": {
  23720. "status": {
  23721. "type": "string",
  23722. "enum": ["pending"]
  23723. },
  23724. "input": {
  23725. "type": "string"
  23726. }
  23727. },
  23728. "required": ["status", "input"],
  23729. "additionalProperties": false
  23730. },
  23731. "SessionMessageToolStateRunning": {
  23732. "type": "object",
  23733. "properties": {
  23734. "status": {
  23735. "type": "string",
  23736. "enum": ["running"]
  23737. },
  23738. "input": {
  23739. "type": "object"
  23740. },
  23741. "structured": {
  23742. "type": "object"
  23743. },
  23744. "content": {
  23745. "type": "array",
  23746. "items": {
  23747. "anyOf": [
  23748. {
  23749. "$ref": "#/components/schemas/ToolTextContent"
  23750. },
  23751. {
  23752. "$ref": "#/components/schemas/ToolFileContent"
  23753. }
  23754. ]
  23755. }
  23756. }
  23757. },
  23758. "required": ["status", "input", "structured", "content"],
  23759. "additionalProperties": false
  23760. },
  23761. "SessionMessageToolStateCompleted": {
  23762. "type": "object",
  23763. "properties": {
  23764. "status": {
  23765. "type": "string",
  23766. "enum": ["completed"]
  23767. },
  23768. "input": {
  23769. "type": "object"
  23770. },
  23771. "attachments": {
  23772. "type": "array",
  23773. "items": {
  23774. "$ref": "#/components/schemas/PromptFileAttachment"
  23775. }
  23776. },
  23777. "content": {
  23778. "type": "array",
  23779. "items": {
  23780. "anyOf": [
  23781. {
  23782. "$ref": "#/components/schemas/ToolTextContent"
  23783. },
  23784. {
  23785. "$ref": "#/components/schemas/ToolFileContent"
  23786. }
  23787. ]
  23788. }
  23789. },
  23790. "structured": {
  23791. "type": "object"
  23792. },
  23793. "result": {}
  23794. },
  23795. "required": ["status", "input", "content", "structured"],
  23796. "additionalProperties": false
  23797. },
  23798. "SessionMessageToolStateError": {
  23799. "type": "object",
  23800. "properties": {
  23801. "status": {
  23802. "type": "string",
  23803. "enum": ["error"]
  23804. },
  23805. "input": {
  23806. "type": "object"
  23807. },
  23808. "content": {
  23809. "type": "array",
  23810. "items": {
  23811. "anyOf": [
  23812. {
  23813. "$ref": "#/components/schemas/ToolTextContent"
  23814. },
  23815. {
  23816. "$ref": "#/components/schemas/ToolFileContent"
  23817. }
  23818. ]
  23819. }
  23820. },
  23821. "structured": {
  23822. "type": "object"
  23823. },
  23824. "error": {
  23825. "$ref": "#/components/schemas/SessionErrorUnknown"
  23826. },
  23827. "result": {}
  23828. },
  23829. "required": ["status", "input", "content", "structured", "error"],
  23830. "additionalProperties": false
  23831. },
  23832. "SessionMessageAssistantTool": {
  23833. "type": "object",
  23834. "properties": {
  23835. "type": {
  23836. "type": "string",
  23837. "enum": ["tool"]
  23838. },
  23839. "id": {
  23840. "type": "string"
  23841. },
  23842. "name": {
  23843. "type": "string"
  23844. },
  23845. "provider": {
  23846. "type": "object",
  23847. "properties": {
  23848. "executed": {
  23849. "type": "boolean"
  23850. },
  23851. "metadata": {
  23852. "type": "object",
  23853. "additionalProperties": {
  23854. "type": "object"
  23855. }
  23856. },
  23857. "resultMetadata": {
  23858. "type": "object",
  23859. "additionalProperties": {
  23860. "type": "object"
  23861. }
  23862. }
  23863. },
  23864. "required": ["executed"],
  23865. "additionalProperties": false
  23866. },
  23867. "state": {
  23868. "anyOf": [
  23869. {
  23870. "$ref": "#/components/schemas/SessionMessageToolStatePending"
  23871. },
  23872. {
  23873. "$ref": "#/components/schemas/SessionMessageToolStateRunning"
  23874. },
  23875. {
  23876. "$ref": "#/components/schemas/SessionMessageToolStateCompleted"
  23877. },
  23878. {
  23879. "$ref": "#/components/schemas/SessionMessageToolStateError"
  23880. }
  23881. ]
  23882. },
  23883. "time": {
  23884. "type": "object",
  23885. "properties": {
  23886. "created": {
  23887. "type": "number"
  23888. },
  23889. "ran": {
  23890. "type": "number"
  23891. },
  23892. "completed": {
  23893. "type": "number"
  23894. },
  23895. "pruned": {
  23896. "type": "number"
  23897. }
  23898. },
  23899. "required": ["created"],
  23900. "additionalProperties": false
  23901. }
  23902. },
  23903. "required": ["type", "id", "name", "state", "time"],
  23904. "additionalProperties": false
  23905. },
  23906. "SessionMessageAssistant": {
  23907. "type": "object",
  23908. "properties": {
  23909. "id": {
  23910. "type": "string",
  23911. "pattern": "^msg_"
  23912. },
  23913. "metadata": {
  23914. "type": "object"
  23915. },
  23916. "time": {
  23917. "type": "object",
  23918. "properties": {
  23919. "created": {
  23920. "type": "number"
  23921. },
  23922. "completed": {
  23923. "type": "number"
  23924. }
  23925. },
  23926. "required": ["created"],
  23927. "additionalProperties": false
  23928. },
  23929. "type": {
  23930. "type": "string",
  23931. "enum": ["assistant"]
  23932. },
  23933. "agent": {
  23934. "type": "string"
  23935. },
  23936. "model": {
  23937. "type": "object",
  23938. "properties": {
  23939. "id": {
  23940. "type": "string"
  23941. },
  23942. "providerID": {
  23943. "type": "string"
  23944. },
  23945. "variant": {
  23946. "type": "string"
  23947. }
  23948. },
  23949. "required": ["id", "providerID"],
  23950. "additionalProperties": false
  23951. },
  23952. "content": {
  23953. "type": "array",
  23954. "items": {
  23955. "anyOf": [
  23956. {
  23957. "$ref": "#/components/schemas/SessionMessageAssistantText"
  23958. },
  23959. {
  23960. "$ref": "#/components/schemas/SessionMessageAssistantReasoning"
  23961. },
  23962. {
  23963. "$ref": "#/components/schemas/SessionMessageAssistantTool"
  23964. }
  23965. ]
  23966. }
  23967. },
  23968. "snapshot": {
  23969. "type": "object",
  23970. "properties": {
  23971. "start": {
  23972. "type": "string"
  23973. },
  23974. "end": {
  23975. "type": "string"
  23976. }
  23977. },
  23978. "additionalProperties": false
  23979. },
  23980. "finish": {
  23981. "type": "string"
  23982. },
  23983. "cost": {
  23984. "type": "number"
  23985. },
  23986. "tokens": {
  23987. "type": "object",
  23988. "properties": {
  23989. "input": {
  23990. "type": "number"
  23991. },
  23992. "output": {
  23993. "type": "number"
  23994. },
  23995. "reasoning": {
  23996. "type": "number"
  23997. },
  23998. "cache": {
  23999. "type": "object",
  24000. "properties": {
  24001. "read": {
  24002. "type": "number"
  24003. },
  24004. "write": {
  24005. "type": "number"
  24006. }
  24007. },
  24008. "required": ["read", "write"],
  24009. "additionalProperties": false
  24010. }
  24011. },
  24012. "required": ["input", "output", "reasoning", "cache"],
  24013. "additionalProperties": false
  24014. },
  24015. "error": {
  24016. "$ref": "#/components/schemas/SessionErrorUnknown"
  24017. }
  24018. },
  24019. "required": ["id", "time", "type", "agent", "model", "content"],
  24020. "additionalProperties": false
  24021. },
  24022. "SessionMessageCompaction": {
  24023. "type": "object",
  24024. "properties": {
  24025. "type": {
  24026. "type": "string",
  24027. "enum": ["compaction"]
  24028. },
  24029. "reason": {
  24030. "type": "string",
  24031. "enum": ["auto", "manual"]
  24032. },
  24033. "summary": {
  24034. "type": "string"
  24035. },
  24036. "include": {
  24037. "type": "string"
  24038. },
  24039. "id": {
  24040. "type": "string",
  24041. "pattern": "^msg_"
  24042. },
  24043. "metadata": {
  24044. "type": "object"
  24045. },
  24046. "time": {
  24047. "type": "object",
  24048. "properties": {
  24049. "created": {
  24050. "type": "number"
  24051. }
  24052. },
  24053. "required": ["created"],
  24054. "additionalProperties": false
  24055. }
  24056. },
  24057. "required": ["type", "reason", "summary", "id", "time"],
  24058. "additionalProperties": false
  24059. },
  24060. "SessionMessage": {
  24061. "anyOf": [
  24062. {
  24063. "$ref": "#/components/schemas/SessionMessageAgentSwitched"
  24064. },
  24065. {
  24066. "$ref": "#/components/schemas/SessionMessageModelSwitched"
  24067. },
  24068. {
  24069. "$ref": "#/components/schemas/SessionMessageUser"
  24070. },
  24071. {
  24072. "$ref": "#/components/schemas/SessionMessageSynthetic"
  24073. },
  24074. {
  24075. "$ref": "#/components/schemas/SessionMessageShell"
  24076. },
  24077. {
  24078. "$ref": "#/components/schemas/SessionMessageAssistant"
  24079. },
  24080. {
  24081. "$ref": "#/components/schemas/SessionMessageCompaction"
  24082. }
  24083. ]
  24084. },
  24085. "ProviderV2Info": {
  24086. "type": "object",
  24087. "properties": {
  24088. "id": {
  24089. "type": "string"
  24090. },
  24091. "name": {
  24092. "type": "string"
  24093. },
  24094. "enabled": {
  24095. "anyOf": [
  24096. {
  24097. "type": "boolean",
  24098. "enum": [false]
  24099. },
  24100. {
  24101. "type": "object",
  24102. "properties": {
  24103. "via": {
  24104. "type": "string",
  24105. "enum": ["env"]
  24106. },
  24107. "name": {
  24108. "type": "string"
  24109. }
  24110. },
  24111. "required": ["via", "name"],
  24112. "additionalProperties": false
  24113. },
  24114. {
  24115. "type": "object",
  24116. "properties": {
  24117. "via": {
  24118. "type": "string",
  24119. "enum": ["account"]
  24120. },
  24121. "service": {
  24122. "type": "string"
  24123. }
  24124. },
  24125. "required": ["via", "service"],
  24126. "additionalProperties": false
  24127. },
  24128. {
  24129. "type": "object",
  24130. "properties": {
  24131. "via": {
  24132. "type": "string",
  24133. "enum": ["custom"]
  24134. },
  24135. "data": {
  24136. "type": "object"
  24137. }
  24138. },
  24139. "required": ["via", "data"],
  24140. "additionalProperties": false
  24141. }
  24142. ]
  24143. },
  24144. "env": {
  24145. "type": "array",
  24146. "items": {
  24147. "type": "string"
  24148. }
  24149. },
  24150. "api": {
  24151. "anyOf": [
  24152. {
  24153. "type": "object",
  24154. "properties": {
  24155. "type": {
  24156. "type": "string",
  24157. "enum": ["aisdk"]
  24158. },
  24159. "package": {
  24160. "type": "string"
  24161. },
  24162. "url": {
  24163. "type": "string"
  24164. },
  24165. "settings": {
  24166. "type": "object"
  24167. }
  24168. },
  24169. "required": ["type", "package"],
  24170. "additionalProperties": false
  24171. },
  24172. {
  24173. "type": "object",
  24174. "properties": {
  24175. "type": {
  24176. "type": "string",
  24177. "enum": ["native"]
  24178. },
  24179. "url": {
  24180. "type": "string"
  24181. },
  24182. "settings": {
  24183. "type": "object"
  24184. }
  24185. },
  24186. "required": ["type", "settings"],
  24187. "additionalProperties": false
  24188. }
  24189. ]
  24190. },
  24191. "request": {
  24192. "type": "object",
  24193. "properties": {
  24194. "headers": {
  24195. "type": "object",
  24196. "additionalProperties": {
  24197. "type": "string"
  24198. }
  24199. },
  24200. "body": {
  24201. "type": "object"
  24202. }
  24203. },
  24204. "required": ["headers", "body"],
  24205. "additionalProperties": false
  24206. }
  24207. },
  24208. "required": ["id", "name", "enabled", "env", "api", "request"],
  24209. "additionalProperties": false
  24210. },
  24211. "PermissionV2Request": {
  24212. "type": "object",
  24213. "properties": {
  24214. "id": {
  24215. "type": "string",
  24216. "pattern": "^per"
  24217. },
  24218. "sessionID": {
  24219. "type": "string",
  24220. "pattern": "^ses"
  24221. },
  24222. "action": {
  24223. "type": "string"
  24224. },
  24225. "resources": {
  24226. "type": "array",
  24227. "items": {
  24228. "type": "string"
  24229. }
  24230. },
  24231. "save": {
  24232. "type": "array",
  24233. "items": {
  24234. "type": "string"
  24235. }
  24236. },
  24237. "metadata": {
  24238. "type": "object"
  24239. },
  24240. "source": {
  24241. "$ref": "#/components/schemas/PermissionV2Source"
  24242. }
  24243. },
  24244. "required": ["id", "sessionID", "action", "resources"],
  24245. "additionalProperties": false
  24246. },
  24247. "PermissionSavedInfo": {
  24248. "type": "object",
  24249. "properties": {
  24250. "id": {
  24251. "type": "string"
  24252. },
  24253. "projectID": {
  24254. "type": "string"
  24255. },
  24256. "action": {
  24257. "type": "string"
  24258. },
  24259. "resource": {
  24260. "type": "string"
  24261. }
  24262. },
  24263. "required": ["id", "projectID", "action", "resource"],
  24264. "additionalProperties": false
  24265. },
  24266. "FileSystemTextContent": {
  24267. "type": "object",
  24268. "properties": {
  24269. "type": {
  24270. "type": "string",
  24271. "enum": ["text"]
  24272. },
  24273. "content": {
  24274. "type": "string"
  24275. },
  24276. "mime": {
  24277. "type": "string"
  24278. }
  24279. },
  24280. "required": ["type", "content", "mime"],
  24281. "additionalProperties": false
  24282. },
  24283. "FileSystemBinaryContent": {
  24284. "type": "object",
  24285. "properties": {
  24286. "type": {
  24287. "type": "string",
  24288. "enum": ["binary"]
  24289. },
  24290. "content": {
  24291. "type": "string"
  24292. },
  24293. "encoding": {
  24294. "type": "string",
  24295. "enum": ["base64"]
  24296. },
  24297. "mime": {
  24298. "type": "string"
  24299. }
  24300. },
  24301. "required": ["type", "content", "encoding", "mime"],
  24302. "additionalProperties": false
  24303. },
  24304. "FileSystemEntry": {
  24305. "type": "object",
  24306. "properties": {
  24307. "path": {
  24308. "type": "string"
  24309. },
  24310. "uri": {
  24311. "type": "string"
  24312. },
  24313. "type": {
  24314. "type": "string",
  24315. "enum": ["file", "directory"]
  24316. },
  24317. "mime": {
  24318. "type": "string"
  24319. }
  24320. },
  24321. "required": ["path", "uri", "type", "mime"],
  24322. "additionalProperties": false
  24323. },
  24324. "CommandV2Info": {
  24325. "type": "object",
  24326. "properties": {
  24327. "name": {
  24328. "type": "string"
  24329. },
  24330. "template": {
  24331. "type": "string"
  24332. },
  24333. "description": {
  24334. "type": "string"
  24335. },
  24336. "agent": {
  24337. "type": "string"
  24338. },
  24339. "model": {
  24340. "type": "object",
  24341. "properties": {
  24342. "id": {
  24343. "type": "string"
  24344. },
  24345. "providerID": {
  24346. "type": "string"
  24347. },
  24348. "variant": {
  24349. "type": "string"
  24350. }
  24351. },
  24352. "required": ["id", "providerID"],
  24353. "additionalProperties": false
  24354. },
  24355. "subtask": {
  24356. "type": "boolean"
  24357. }
  24358. },
  24359. "required": ["name", "template"],
  24360. "additionalProperties": false
  24361. },
  24362. "SkillV2Info": {
  24363. "type": "object",
  24364. "properties": {
  24365. "name": {
  24366. "type": "string"
  24367. },
  24368. "description": {
  24369. "type": "string"
  24370. },
  24371. "slash": {
  24372. "type": "boolean"
  24373. },
  24374. "location": {
  24375. "type": "string"
  24376. },
  24377. "content": {
  24378. "type": "string"
  24379. }
  24380. },
  24381. "required": ["name", "location", "content"],
  24382. "additionalProperties": false
  24383. },
  24384. "QuestionV2Request": {
  24385. "type": "object",
  24386. "properties": {
  24387. "id": {
  24388. "type": "string",
  24389. "pattern": "^que"
  24390. },
  24391. "sessionID": {
  24392. "type": "string",
  24393. "pattern": "^ses"
  24394. },
  24395. "questions": {
  24396. "type": "array",
  24397. "items": {
  24398. "$ref": "#/components/schemas/QuestionV2Info"
  24399. },
  24400. "description": "Questions to ask"
  24401. },
  24402. "tool": {
  24403. "$ref": "#/components/schemas/QuestionV2Tool"
  24404. }
  24405. },
  24406. "required": ["id", "sessionID", "questions"],
  24407. "additionalProperties": false
  24408. },
  24409. "QuestionV2Reply": {
  24410. "type": "object",
  24411. "properties": {
  24412. "answers": {
  24413. "type": "array",
  24414. "items": {
  24415. "$ref": "#/components/schemas/QuestionV2Answer"
  24416. },
  24417. "description": "User answers in order of questions (each answer is an array of selected labels)"
  24418. }
  24419. },
  24420. "required": ["answers"],
  24421. "additionalProperties": false
  24422. },
  24423. "EventModels-devRefreshed": {
  24424. "type": "object",
  24425. "properties": {
  24426. "id": {
  24427. "type": "string",
  24428. "pattern": "^evt_"
  24429. },
  24430. "type": {
  24431. "type": "string",
  24432. "enum": ["models-dev.refreshed"]
  24433. },
  24434. "properties": {
  24435. "type": "object",
  24436. "properties": {}
  24437. }
  24438. },
  24439. "required": ["id", "type", "properties"],
  24440. "additionalProperties": false
  24441. },
  24442. "EventPluginAdded": {
  24443. "type": "object",
  24444. "properties": {
  24445. "id": {
  24446. "type": "string",
  24447. "pattern": "^evt_"
  24448. },
  24449. "type": {
  24450. "type": "string",
  24451. "enum": ["plugin.added"]
  24452. },
  24453. "properties": {
  24454. "type": "object",
  24455. "properties": {
  24456. "id": {
  24457. "type": "string"
  24458. }
  24459. },
  24460. "required": ["id"],
  24461. "additionalProperties": false
  24462. }
  24463. },
  24464. "required": ["id", "type", "properties"],
  24465. "additionalProperties": false
  24466. },
  24467. "ModelV2Info1": {
  24468. "type": "object",
  24469. "properties": {
  24470. "id": {
  24471. "type": "string"
  24472. },
  24473. "providerID": {
  24474. "type": "string"
  24475. },
  24476. "family": {
  24477. "type": "string"
  24478. },
  24479. "name": {
  24480. "type": "string"
  24481. },
  24482. "api": {
  24483. "anyOf": [
  24484. {
  24485. "type": "object",
  24486. "properties": {
  24487. "id": {
  24488. "type": "string"
  24489. },
  24490. "type": {
  24491. "type": "string",
  24492. "enum": ["aisdk"]
  24493. },
  24494. "package": {
  24495. "type": "string"
  24496. },
  24497. "url": {
  24498. "type": "string"
  24499. },
  24500. "settings": {
  24501. "type": "object"
  24502. }
  24503. },
  24504. "required": ["id", "type", "package"],
  24505. "additionalProperties": false
  24506. },
  24507. {
  24508. "type": "object",
  24509. "properties": {
  24510. "id": {
  24511. "type": "string"
  24512. },
  24513. "type": {
  24514. "type": "string",
  24515. "enum": ["native"]
  24516. },
  24517. "url": {
  24518. "type": "string"
  24519. },
  24520. "settings": {
  24521. "type": "object"
  24522. }
  24523. },
  24524. "required": ["id", "type", "settings"],
  24525. "additionalProperties": false
  24526. }
  24527. ]
  24528. },
  24529. "capabilities": {
  24530. "type": "object",
  24531. "properties": {
  24532. "tools": {
  24533. "type": "boolean"
  24534. },
  24535. "input": {
  24536. "type": "array",
  24537. "items": {
  24538. "type": "string"
  24539. }
  24540. },
  24541. "output": {
  24542. "type": "array",
  24543. "items": {
  24544. "type": "string"
  24545. }
  24546. }
  24547. },
  24548. "required": ["tools", "input", "output"],
  24549. "additionalProperties": false
  24550. },
  24551. "request": {
  24552. "type": "object",
  24553. "properties": {
  24554. "headers": {
  24555. "type": "object",
  24556. "additionalProperties": {
  24557. "type": "string"
  24558. }
  24559. },
  24560. "body": {
  24561. "type": "object"
  24562. },
  24563. "variant": {
  24564. "type": "string"
  24565. }
  24566. },
  24567. "required": ["headers", "body"],
  24568. "additionalProperties": false
  24569. },
  24570. "variants": {
  24571. "type": "array",
  24572. "items": {
  24573. "type": "object",
  24574. "properties": {
  24575. "id": {
  24576. "type": "string"
  24577. },
  24578. "headers": {
  24579. "type": "object",
  24580. "additionalProperties": {
  24581. "type": "string"
  24582. }
  24583. },
  24584. "body": {
  24585. "type": "object"
  24586. }
  24587. },
  24588. "required": ["id", "headers", "body"],
  24589. "additionalProperties": false
  24590. }
  24591. },
  24592. "time": {
  24593. "type": "object",
  24594. "properties": {
  24595. "released": {
  24596. "anyOf": [
  24597. {
  24598. "type": "number"
  24599. },
  24600. {
  24601. "type": "string",
  24602. "enum": ["NaN"]
  24603. },
  24604. {
  24605. "type": "string",
  24606. "enum": ["Infinity"]
  24607. },
  24608. {
  24609. "type": "string",
  24610. "enum": ["-Infinity"]
  24611. }
  24612. ]
  24613. }
  24614. },
  24615. "required": ["released"],
  24616. "additionalProperties": false
  24617. },
  24618. "cost": {
  24619. "type": "array",
  24620. "items": {
  24621. "type": "object",
  24622. "properties": {
  24623. "tier": {
  24624. "type": "object",
  24625. "properties": {
  24626. "type": {
  24627. "type": "string",
  24628. "enum": ["context"]
  24629. },
  24630. "size": {
  24631. "type": "integer"
  24632. }
  24633. },
  24634. "required": ["type", "size"],
  24635. "additionalProperties": false
  24636. },
  24637. "input": {
  24638. "type": "number"
  24639. },
  24640. "output": {
  24641. "type": "number"
  24642. },
  24643. "cache": {
  24644. "type": "object",
  24645. "properties": {
  24646. "read": {
  24647. "type": "number"
  24648. },
  24649. "write": {
  24650. "type": "number"
  24651. }
  24652. },
  24653. "required": ["read", "write"],
  24654. "additionalProperties": false
  24655. }
  24656. },
  24657. "required": ["input", "output", "cache"],
  24658. "additionalProperties": false
  24659. }
  24660. },
  24661. "status": {
  24662. "type": "string",
  24663. "enum": ["alpha", "beta", "deprecated", "active"]
  24664. },
  24665. "enabled": {
  24666. "type": "boolean"
  24667. },
  24668. "limit": {
  24669. "type": "object",
  24670. "properties": {
  24671. "context": {
  24672. "type": "integer"
  24673. },
  24674. "input": {
  24675. "type": "integer"
  24676. },
  24677. "output": {
  24678. "type": "integer"
  24679. }
  24680. },
  24681. "required": ["context", "output"],
  24682. "additionalProperties": false
  24683. }
  24684. },
  24685. "required": [
  24686. "id",
  24687. "providerID",
  24688. "name",
  24689. "api",
  24690. "capabilities",
  24691. "request",
  24692. "variants",
  24693. "time",
  24694. "cost",
  24695. "status",
  24696. "enabled",
  24697. "limit"
  24698. ],
  24699. "additionalProperties": false
  24700. },
  24701. "EventCatalogModelUpdated": {
  24702. "type": "object",
  24703. "properties": {
  24704. "id": {
  24705. "type": "string",
  24706. "pattern": "^evt_"
  24707. },
  24708. "type": {
  24709. "type": "string",
  24710. "enum": ["catalog.model.updated"]
  24711. },
  24712. "properties": {
  24713. "type": "object",
  24714. "properties": {
  24715. "model": {
  24716. "$ref": "#/components/schemas/ModelV2Info1"
  24717. }
  24718. },
  24719. "required": ["model"],
  24720. "additionalProperties": false
  24721. }
  24722. },
  24723. "required": ["id", "type", "properties"],
  24724. "additionalProperties": false
  24725. },
  24726. "EventSessionCreated": {
  24727. "type": "object",
  24728. "properties": {
  24729. "id": {
  24730. "type": "string",
  24731. "pattern": "^evt_"
  24732. },
  24733. "type": {
  24734. "type": "string",
  24735. "enum": ["session.created"]
  24736. },
  24737. "properties": {
  24738. "type": "object",
  24739. "properties": {
  24740. "sessionID": {
  24741. "type": "string",
  24742. "pattern": "^ses"
  24743. },
  24744. "info": {
  24745. "$ref": "#/components/schemas/Session"
  24746. }
  24747. },
  24748. "required": ["sessionID", "info"],
  24749. "additionalProperties": false
  24750. }
  24751. },
  24752. "required": ["id", "type", "properties"],
  24753. "additionalProperties": false
  24754. },
  24755. "EventSessionUpdated": {
  24756. "type": "object",
  24757. "properties": {
  24758. "id": {
  24759. "type": "string",
  24760. "pattern": "^evt_"
  24761. },
  24762. "type": {
  24763. "type": "string",
  24764. "enum": ["session.updated"]
  24765. },
  24766. "properties": {
  24767. "type": "object",
  24768. "properties": {
  24769. "sessionID": {
  24770. "type": "string",
  24771. "pattern": "^ses"
  24772. },
  24773. "info": {
  24774. "$ref": "#/components/schemas/Session"
  24775. }
  24776. },
  24777. "required": ["sessionID", "info"],
  24778. "additionalProperties": false
  24779. }
  24780. },
  24781. "required": ["id", "type", "properties"],
  24782. "additionalProperties": false
  24783. },
  24784. "EventSessionDeleted": {
  24785. "type": "object",
  24786. "properties": {
  24787. "id": {
  24788. "type": "string",
  24789. "pattern": "^evt_"
  24790. },
  24791. "type": {
  24792. "type": "string",
  24793. "enum": ["session.deleted"]
  24794. },
  24795. "properties": {
  24796. "type": "object",
  24797. "properties": {
  24798. "sessionID": {
  24799. "type": "string",
  24800. "pattern": "^ses"
  24801. },
  24802. "info": {
  24803. "$ref": "#/components/schemas/Session"
  24804. }
  24805. },
  24806. "required": ["sessionID", "info"],
  24807. "additionalProperties": false
  24808. }
  24809. },
  24810. "required": ["id", "type", "properties"],
  24811. "additionalProperties": false
  24812. },
  24813. "EventMessageUpdated": {
  24814. "type": "object",
  24815. "properties": {
  24816. "id": {
  24817. "type": "string",
  24818. "pattern": "^evt_"
  24819. },
  24820. "type": {
  24821. "type": "string",
  24822. "enum": ["message.updated"]
  24823. },
  24824. "properties": {
  24825. "type": "object",
  24826. "properties": {
  24827. "sessionID": {
  24828. "type": "string",
  24829. "pattern": "^ses"
  24830. },
  24831. "info": {
  24832. "$ref": "#/components/schemas/Message"
  24833. }
  24834. },
  24835. "required": ["sessionID", "info"],
  24836. "additionalProperties": false
  24837. }
  24838. },
  24839. "required": ["id", "type", "properties"],
  24840. "additionalProperties": false
  24841. },
  24842. "EventMessageRemoved": {
  24843. "type": "object",
  24844. "properties": {
  24845. "id": {
  24846. "type": "string",
  24847. "pattern": "^evt_"
  24848. },
  24849. "type": {
  24850. "type": "string",
  24851. "enum": ["message.removed"]
  24852. },
  24853. "properties": {
  24854. "type": "object",
  24855. "properties": {
  24856. "sessionID": {
  24857. "type": "string",
  24858. "pattern": "^ses"
  24859. },
  24860. "messageID": {
  24861. "type": "string",
  24862. "pattern": "^msg"
  24863. }
  24864. },
  24865. "required": ["sessionID", "messageID"],
  24866. "additionalProperties": false
  24867. }
  24868. },
  24869. "required": ["id", "type", "properties"],
  24870. "additionalProperties": false
  24871. },
  24872. "EventMessagePartUpdated": {
  24873. "type": "object",
  24874. "properties": {
  24875. "id": {
  24876. "type": "string",
  24877. "pattern": "^evt_"
  24878. },
  24879. "type": {
  24880. "type": "string",
  24881. "enum": ["message.part.updated"]
  24882. },
  24883. "properties": {
  24884. "type": "object",
  24885. "properties": {
  24886. "sessionID": {
  24887. "type": "string",
  24888. "pattern": "^ses"
  24889. },
  24890. "part": {
  24891. "$ref": "#/components/schemas/Part"
  24892. },
  24893. "time": {
  24894. "type": "number"
  24895. }
  24896. },
  24897. "required": ["sessionID", "part", "time"],
  24898. "additionalProperties": false
  24899. }
  24900. },
  24901. "required": ["id", "type", "properties"],
  24902. "additionalProperties": false
  24903. },
  24904. "EventMessagePartRemoved": {
  24905. "type": "object",
  24906. "properties": {
  24907. "id": {
  24908. "type": "string",
  24909. "pattern": "^evt_"
  24910. },
  24911. "type": {
  24912. "type": "string",
  24913. "enum": ["message.part.removed"]
  24914. },
  24915. "properties": {
  24916. "type": "object",
  24917. "properties": {
  24918. "sessionID": {
  24919. "type": "string",
  24920. "pattern": "^ses"
  24921. },
  24922. "messageID": {
  24923. "type": "string",
  24924. "pattern": "^msg"
  24925. },
  24926. "partID": {
  24927. "type": "string",
  24928. "pattern": "^prt"
  24929. }
  24930. },
  24931. "required": ["sessionID", "messageID", "partID"],
  24932. "additionalProperties": false
  24933. }
  24934. },
  24935. "required": ["id", "type", "properties"],
  24936. "additionalProperties": false
  24937. },
  24938. "EventSessionNextAgentSwitched": {
  24939. "type": "object",
  24940. "properties": {
  24941. "id": {
  24942. "type": "string",
  24943. "pattern": "^evt_"
  24944. },
  24945. "type": {
  24946. "type": "string",
  24947. "enum": ["session.next.agent.switched"]
  24948. },
  24949. "properties": {
  24950. "type": "object",
  24951. "properties": {
  24952. "timestamp": {
  24953. "type": "number"
  24954. },
  24955. "sessionID": {
  24956. "type": "string",
  24957. "pattern": "^ses"
  24958. },
  24959. "messageID": {
  24960. "type": "string",
  24961. "pattern": "^msg_"
  24962. },
  24963. "agent": {
  24964. "type": "string"
  24965. }
  24966. },
  24967. "required": ["timestamp", "sessionID", "messageID", "agent"],
  24968. "additionalProperties": false
  24969. }
  24970. },
  24971. "required": ["id", "type", "properties"],
  24972. "additionalProperties": false
  24973. },
  24974. "EventSessionNextModelSwitched": {
  24975. "type": "object",
  24976. "properties": {
  24977. "id": {
  24978. "type": "string",
  24979. "pattern": "^evt_"
  24980. },
  24981. "type": {
  24982. "type": "string",
  24983. "enum": ["session.next.model.switched"]
  24984. },
  24985. "properties": {
  24986. "type": "object",
  24987. "properties": {
  24988. "timestamp": {
  24989. "type": "number"
  24990. },
  24991. "sessionID": {
  24992. "type": "string",
  24993. "pattern": "^ses"
  24994. },
  24995. "messageID": {
  24996. "type": "string",
  24997. "pattern": "^msg_"
  24998. },
  24999. "model": {
  25000. "type": "object",
  25001. "properties": {
  25002. "id": {
  25003. "type": "string"
  25004. },
  25005. "providerID": {
  25006. "type": "string"
  25007. },
  25008. "variant": {
  25009. "type": "string"
  25010. }
  25011. },
  25012. "required": ["id", "providerID"],
  25013. "additionalProperties": false
  25014. }
  25015. },
  25016. "required": ["timestamp", "sessionID", "messageID", "model"],
  25017. "additionalProperties": false
  25018. }
  25019. },
  25020. "required": ["id", "type", "properties"],
  25021. "additionalProperties": false
  25022. },
  25023. "EventSessionNextMoved": {
  25024. "type": "object",
  25025. "properties": {
  25026. "id": {
  25027. "type": "string",
  25028. "pattern": "^evt_"
  25029. },
  25030. "type": {
  25031. "type": "string",
  25032. "enum": ["session.next.moved"]
  25033. },
  25034. "properties": {
  25035. "type": "object",
  25036. "properties": {
  25037. "timestamp": {
  25038. "type": "number"
  25039. },
  25040. "sessionID": {
  25041. "type": "string",
  25042. "pattern": "^ses"
  25043. },
  25044. "location": {
  25045. "$ref": "#/components/schemas/LocationRef"
  25046. },
  25047. "subdirectory": {
  25048. "type": "string"
  25049. }
  25050. },
  25051. "required": ["timestamp", "sessionID", "location"],
  25052. "additionalProperties": false
  25053. }
  25054. },
  25055. "required": ["id", "type", "properties"],
  25056. "additionalProperties": false
  25057. },
  25058. "EventSessionNextPrompted": {
  25059. "type": "object",
  25060. "properties": {
  25061. "id": {
  25062. "type": "string",
  25063. "pattern": "^evt_"
  25064. },
  25065. "type": {
  25066. "type": "string",
  25067. "enum": ["session.next.prompted"]
  25068. },
  25069. "properties": {
  25070. "type": "object",
  25071. "properties": {
  25072. "timestamp": {
  25073. "type": "number"
  25074. },
  25075. "sessionID": {
  25076. "type": "string",
  25077. "pattern": "^ses"
  25078. },
  25079. "messageID": {
  25080. "type": "string",
  25081. "pattern": "^msg_"
  25082. },
  25083. "prompt": {
  25084. "$ref": "#/components/schemas/Prompt"
  25085. },
  25086. "delivery": {
  25087. "type": "string",
  25088. "enum": ["steer", "queue"]
  25089. }
  25090. },
  25091. "required": ["timestamp", "sessionID", "messageID", "prompt", "delivery"],
  25092. "additionalProperties": false
  25093. }
  25094. },
  25095. "required": ["id", "type", "properties"],
  25096. "additionalProperties": false
  25097. },
  25098. "EventSessionNextPromptAdmitted": {
  25099. "type": "object",
  25100. "properties": {
  25101. "id": {
  25102. "type": "string",
  25103. "pattern": "^evt_"
  25104. },
  25105. "type": {
  25106. "type": "string",
  25107. "enum": ["session.next.prompt.admitted"]
  25108. },
  25109. "properties": {
  25110. "type": "object",
  25111. "properties": {
  25112. "timestamp": {
  25113. "type": "number"
  25114. },
  25115. "sessionID": {
  25116. "type": "string",
  25117. "pattern": "^ses"
  25118. },
  25119. "messageID": {
  25120. "type": "string",
  25121. "pattern": "^msg_"
  25122. },
  25123. "prompt": {
  25124. "$ref": "#/components/schemas/Prompt"
  25125. },
  25126. "delivery": {
  25127. "type": "string",
  25128. "enum": ["steer", "queue"]
  25129. }
  25130. },
  25131. "required": ["timestamp", "sessionID", "messageID", "prompt", "delivery"],
  25132. "additionalProperties": false
  25133. }
  25134. },
  25135. "required": ["id", "type", "properties"],
  25136. "additionalProperties": false
  25137. },
  25138. "EventSessionNextPromptPromoted": {
  25139. "type": "object",
  25140. "properties": {
  25141. "id": {
  25142. "type": "string",
  25143. "pattern": "^evt_"
  25144. },
  25145. "type": {
  25146. "type": "string",
  25147. "enum": ["session.next.prompt.promoted"]
  25148. },
  25149. "properties": {
  25150. "type": "object",
  25151. "properties": {
  25152. "timestamp": {
  25153. "type": "number"
  25154. },
  25155. "sessionID": {
  25156. "type": "string",
  25157. "pattern": "^ses"
  25158. },
  25159. "messageID": {
  25160. "type": "string",
  25161. "pattern": "^msg_"
  25162. },
  25163. "prompt": {
  25164. "$ref": "#/components/schemas/Prompt"
  25165. },
  25166. "timeCreated": {
  25167. "type": "number"
  25168. }
  25169. },
  25170. "required": ["timestamp", "sessionID", "messageID", "prompt", "timeCreated"],
  25171. "additionalProperties": false
  25172. }
  25173. },
  25174. "required": ["id", "type", "properties"],
  25175. "additionalProperties": false
  25176. },
  25177. "EventSessionNextSynthetic": {
  25178. "type": "object",
  25179. "properties": {
  25180. "id": {
  25181. "type": "string",
  25182. "pattern": "^evt_"
  25183. },
  25184. "type": {
  25185. "type": "string",
  25186. "enum": ["session.next.synthetic"]
  25187. },
  25188. "properties": {
  25189. "type": "object",
  25190. "properties": {
  25191. "timestamp": {
  25192. "type": "number"
  25193. },
  25194. "sessionID": {
  25195. "type": "string",
  25196. "pattern": "^ses"
  25197. },
  25198. "messageID": {
  25199. "type": "string",
  25200. "pattern": "^msg_"
  25201. },
  25202. "text": {
  25203. "type": "string"
  25204. }
  25205. },
  25206. "required": ["timestamp", "sessionID", "messageID", "text"],
  25207. "additionalProperties": false
  25208. }
  25209. },
  25210. "required": ["id", "type", "properties"],
  25211. "additionalProperties": false
  25212. },
  25213. "EventSessionNextShellStarted": {
  25214. "type": "object",
  25215. "properties": {
  25216. "id": {
  25217. "type": "string",
  25218. "pattern": "^evt_"
  25219. },
  25220. "type": {
  25221. "type": "string",
  25222. "enum": ["session.next.shell.started"]
  25223. },
  25224. "properties": {
  25225. "type": "object",
  25226. "properties": {
  25227. "timestamp": {
  25228. "type": "number"
  25229. },
  25230. "sessionID": {
  25231. "type": "string",
  25232. "pattern": "^ses"
  25233. },
  25234. "messageID": {
  25235. "type": "string",
  25236. "pattern": "^msg_"
  25237. },
  25238. "callID": {
  25239. "type": "string"
  25240. },
  25241. "command": {
  25242. "type": "string"
  25243. }
  25244. },
  25245. "required": ["timestamp", "sessionID", "messageID", "callID", "command"],
  25246. "additionalProperties": false
  25247. }
  25248. },
  25249. "required": ["id", "type", "properties"],
  25250. "additionalProperties": false
  25251. },
  25252. "EventSessionNextShellEnded": {
  25253. "type": "object",
  25254. "properties": {
  25255. "id": {
  25256. "type": "string",
  25257. "pattern": "^evt_"
  25258. },
  25259. "type": {
  25260. "type": "string",
  25261. "enum": ["session.next.shell.ended"]
  25262. },
  25263. "properties": {
  25264. "type": "object",
  25265. "properties": {
  25266. "timestamp": {
  25267. "type": "number"
  25268. },
  25269. "sessionID": {
  25270. "type": "string",
  25271. "pattern": "^ses"
  25272. },
  25273. "callID": {
  25274. "type": "string"
  25275. },
  25276. "output": {
  25277. "type": "string"
  25278. }
  25279. },
  25280. "required": ["timestamp", "sessionID", "callID", "output"],
  25281. "additionalProperties": false
  25282. }
  25283. },
  25284. "required": ["id", "type", "properties"],
  25285. "additionalProperties": false
  25286. },
  25287. "EventSessionNextStepStarted": {
  25288. "type": "object",
  25289. "properties": {
  25290. "id": {
  25291. "type": "string",
  25292. "pattern": "^evt_"
  25293. },
  25294. "type": {
  25295. "type": "string",
  25296. "enum": ["session.next.step.started"]
  25297. },
  25298. "properties": {
  25299. "type": "object",
  25300. "properties": {
  25301. "timestamp": {
  25302. "type": "number"
  25303. },
  25304. "sessionID": {
  25305. "type": "string",
  25306. "pattern": "^ses"
  25307. },
  25308. "assistantMessageID": {
  25309. "type": "string",
  25310. "pattern": "^msg_"
  25311. },
  25312. "agent": {
  25313. "type": "string"
  25314. },
  25315. "model": {
  25316. "type": "object",
  25317. "properties": {
  25318. "id": {
  25319. "type": "string"
  25320. },
  25321. "providerID": {
  25322. "type": "string"
  25323. },
  25324. "variant": {
  25325. "type": "string"
  25326. }
  25327. },
  25328. "required": ["id", "providerID"],
  25329. "additionalProperties": false
  25330. },
  25331. "snapshot": {
  25332. "type": "string"
  25333. }
  25334. },
  25335. "required": ["timestamp", "sessionID", "assistantMessageID", "agent", "model"],
  25336. "additionalProperties": false
  25337. }
  25338. },
  25339. "required": ["id", "type", "properties"],
  25340. "additionalProperties": false
  25341. },
  25342. "EventSessionNextStepEnded": {
  25343. "type": "object",
  25344. "properties": {
  25345. "id": {
  25346. "type": "string",
  25347. "pattern": "^evt_"
  25348. },
  25349. "type": {
  25350. "type": "string",
  25351. "enum": ["session.next.step.ended"]
  25352. },
  25353. "properties": {
  25354. "type": "object",
  25355. "properties": {
  25356. "timestamp": {
  25357. "type": "number"
  25358. },
  25359. "sessionID": {
  25360. "type": "string",
  25361. "pattern": "^ses"
  25362. },
  25363. "assistantMessageID": {
  25364. "type": "string",
  25365. "pattern": "^msg_"
  25366. },
  25367. "finish": {
  25368. "type": "string"
  25369. },
  25370. "cost": {
  25371. "type": "number"
  25372. },
  25373. "tokens": {
  25374. "type": "object",
  25375. "properties": {
  25376. "input": {
  25377. "type": "number"
  25378. },
  25379. "output": {
  25380. "type": "number"
  25381. },
  25382. "reasoning": {
  25383. "type": "number"
  25384. },
  25385. "cache": {
  25386. "type": "object",
  25387. "properties": {
  25388. "read": {
  25389. "type": "number"
  25390. },
  25391. "write": {
  25392. "type": "number"
  25393. }
  25394. },
  25395. "required": ["read", "write"],
  25396. "additionalProperties": false
  25397. }
  25398. },
  25399. "required": ["input", "output", "reasoning", "cache"],
  25400. "additionalProperties": false
  25401. },
  25402. "snapshot": {
  25403. "type": "string"
  25404. }
  25405. },
  25406. "required": ["timestamp", "sessionID", "assistantMessageID", "finish", "cost", "tokens"],
  25407. "additionalProperties": false
  25408. }
  25409. },
  25410. "required": ["id", "type", "properties"],
  25411. "additionalProperties": false
  25412. },
  25413. "EventSessionNextStepFailed": {
  25414. "type": "object",
  25415. "properties": {
  25416. "id": {
  25417. "type": "string",
  25418. "pattern": "^evt_"
  25419. },
  25420. "type": {
  25421. "type": "string",
  25422. "enum": ["session.next.step.failed"]
  25423. },
  25424. "properties": {
  25425. "type": "object",
  25426. "properties": {
  25427. "timestamp": {
  25428. "type": "number"
  25429. },
  25430. "sessionID": {
  25431. "type": "string",
  25432. "pattern": "^ses"
  25433. },
  25434. "assistantMessageID": {
  25435. "type": "string",
  25436. "pattern": "^msg_"
  25437. },
  25438. "error": {
  25439. "$ref": "#/components/schemas/SessionErrorUnknown"
  25440. }
  25441. },
  25442. "required": ["timestamp", "sessionID", "assistantMessageID", "error"],
  25443. "additionalProperties": false
  25444. }
  25445. },
  25446. "required": ["id", "type", "properties"],
  25447. "additionalProperties": false
  25448. },
  25449. "EventSessionNextTextStarted": {
  25450. "type": "object",
  25451. "properties": {
  25452. "id": {
  25453. "type": "string",
  25454. "pattern": "^evt_"
  25455. },
  25456. "type": {
  25457. "type": "string",
  25458. "enum": ["session.next.text.started"]
  25459. },
  25460. "properties": {
  25461. "type": "object",
  25462. "properties": {
  25463. "timestamp": {
  25464. "type": "number"
  25465. },
  25466. "sessionID": {
  25467. "type": "string",
  25468. "pattern": "^ses"
  25469. },
  25470. "assistantMessageID": {
  25471. "type": "string",
  25472. "pattern": "^msg_"
  25473. },
  25474. "textID": {
  25475. "type": "string"
  25476. }
  25477. },
  25478. "required": ["timestamp", "sessionID", "assistantMessageID", "textID"],
  25479. "additionalProperties": false
  25480. }
  25481. },
  25482. "required": ["id", "type", "properties"],
  25483. "additionalProperties": false
  25484. },
  25485. "EventSessionNextTextDelta": {
  25486. "type": "object",
  25487. "properties": {
  25488. "id": {
  25489. "type": "string",
  25490. "pattern": "^evt_"
  25491. },
  25492. "type": {
  25493. "type": "string",
  25494. "enum": ["session.next.text.delta"]
  25495. },
  25496. "properties": {
  25497. "type": "object",
  25498. "properties": {
  25499. "timestamp": {
  25500. "type": "number"
  25501. },
  25502. "sessionID": {
  25503. "type": "string",
  25504. "pattern": "^ses"
  25505. },
  25506. "assistantMessageID": {
  25507. "type": "string",
  25508. "pattern": "^msg_"
  25509. },
  25510. "textID": {
  25511. "type": "string"
  25512. },
  25513. "delta": {
  25514. "type": "string"
  25515. }
  25516. },
  25517. "required": ["timestamp", "sessionID", "assistantMessageID", "textID", "delta"],
  25518. "additionalProperties": false
  25519. }
  25520. },
  25521. "required": ["id", "type", "properties"],
  25522. "additionalProperties": false
  25523. },
  25524. "EventSessionNextTextEnded": {
  25525. "type": "object",
  25526. "properties": {
  25527. "id": {
  25528. "type": "string",
  25529. "pattern": "^evt_"
  25530. },
  25531. "type": {
  25532. "type": "string",
  25533. "enum": ["session.next.text.ended"]
  25534. },
  25535. "properties": {
  25536. "type": "object",
  25537. "properties": {
  25538. "timestamp": {
  25539. "type": "number"
  25540. },
  25541. "sessionID": {
  25542. "type": "string",
  25543. "pattern": "^ses"
  25544. },
  25545. "assistantMessageID": {
  25546. "type": "string",
  25547. "pattern": "^msg_"
  25548. },
  25549. "textID": {
  25550. "type": "string"
  25551. },
  25552. "text": {
  25553. "type": "string"
  25554. }
  25555. },
  25556. "required": ["timestamp", "sessionID", "assistantMessageID", "textID", "text"],
  25557. "additionalProperties": false
  25558. }
  25559. },
  25560. "required": ["id", "type", "properties"],
  25561. "additionalProperties": false
  25562. },
  25563. "EventSessionNextReasoningStarted": {
  25564. "type": "object",
  25565. "properties": {
  25566. "id": {
  25567. "type": "string",
  25568. "pattern": "^evt_"
  25569. },
  25570. "type": {
  25571. "type": "string",
  25572. "enum": ["session.next.reasoning.started"]
  25573. },
  25574. "properties": {
  25575. "type": "object",
  25576. "properties": {
  25577. "timestamp": {
  25578. "type": "number"
  25579. },
  25580. "sessionID": {
  25581. "type": "string",
  25582. "pattern": "^ses"
  25583. },
  25584. "assistantMessageID": {
  25585. "type": "string",
  25586. "pattern": "^msg_"
  25587. },
  25588. "reasoningID": {
  25589. "type": "string"
  25590. },
  25591. "providerMetadata": {
  25592. "type": "object",
  25593. "additionalProperties": {
  25594. "type": "object"
  25595. }
  25596. }
  25597. },
  25598. "required": ["timestamp", "sessionID", "assistantMessageID", "reasoningID"],
  25599. "additionalProperties": false
  25600. }
  25601. },
  25602. "required": ["id", "type", "properties"],
  25603. "additionalProperties": false
  25604. },
  25605. "EventSessionNextReasoningDelta": {
  25606. "type": "object",
  25607. "properties": {
  25608. "id": {
  25609. "type": "string",
  25610. "pattern": "^evt_"
  25611. },
  25612. "type": {
  25613. "type": "string",
  25614. "enum": ["session.next.reasoning.delta"]
  25615. },
  25616. "properties": {
  25617. "type": "object",
  25618. "properties": {
  25619. "timestamp": {
  25620. "type": "number"
  25621. },
  25622. "sessionID": {
  25623. "type": "string",
  25624. "pattern": "^ses"
  25625. },
  25626. "assistantMessageID": {
  25627. "type": "string",
  25628. "pattern": "^msg_"
  25629. },
  25630. "reasoningID": {
  25631. "type": "string"
  25632. },
  25633. "delta": {
  25634. "type": "string"
  25635. }
  25636. },
  25637. "required": ["timestamp", "sessionID", "assistantMessageID", "reasoningID", "delta"],
  25638. "additionalProperties": false
  25639. }
  25640. },
  25641. "required": ["id", "type", "properties"],
  25642. "additionalProperties": false
  25643. },
  25644. "EventSessionNextReasoningEnded": {
  25645. "type": "object",
  25646. "properties": {
  25647. "id": {
  25648. "type": "string",
  25649. "pattern": "^evt_"
  25650. },
  25651. "type": {
  25652. "type": "string",
  25653. "enum": ["session.next.reasoning.ended"]
  25654. },
  25655. "properties": {
  25656. "type": "object",
  25657. "properties": {
  25658. "timestamp": {
  25659. "type": "number"
  25660. },
  25661. "sessionID": {
  25662. "type": "string",
  25663. "pattern": "^ses"
  25664. },
  25665. "assistantMessageID": {
  25666. "type": "string",
  25667. "pattern": "^msg_"
  25668. },
  25669. "reasoningID": {
  25670. "type": "string"
  25671. },
  25672. "text": {
  25673. "type": "string"
  25674. },
  25675. "providerMetadata": {
  25676. "type": "object",
  25677. "additionalProperties": {
  25678. "type": "object"
  25679. }
  25680. }
  25681. },
  25682. "required": ["timestamp", "sessionID", "assistantMessageID", "reasoningID", "text"],
  25683. "additionalProperties": false
  25684. }
  25685. },
  25686. "required": ["id", "type", "properties"],
  25687. "additionalProperties": false
  25688. },
  25689. "EventSessionNextToolInputStarted": {
  25690. "type": "object",
  25691. "properties": {
  25692. "id": {
  25693. "type": "string",
  25694. "pattern": "^evt_"
  25695. },
  25696. "type": {
  25697. "type": "string",
  25698. "enum": ["session.next.tool.input.started"]
  25699. },
  25700. "properties": {
  25701. "type": "object",
  25702. "properties": {
  25703. "timestamp": {
  25704. "type": "number"
  25705. },
  25706. "sessionID": {
  25707. "type": "string",
  25708. "pattern": "^ses"
  25709. },
  25710. "assistantMessageID": {
  25711. "type": "string",
  25712. "pattern": "^msg_"
  25713. },
  25714. "callID": {
  25715. "type": "string"
  25716. },
  25717. "name": {
  25718. "type": "string"
  25719. }
  25720. },
  25721. "required": ["timestamp", "sessionID", "assistantMessageID", "callID", "name"],
  25722. "additionalProperties": false
  25723. }
  25724. },
  25725. "required": ["id", "type", "properties"],
  25726. "additionalProperties": false
  25727. },
  25728. "EventSessionNextToolInputDelta": {
  25729. "type": "object",
  25730. "properties": {
  25731. "id": {
  25732. "type": "string",
  25733. "pattern": "^evt_"
  25734. },
  25735. "type": {
  25736. "type": "string",
  25737. "enum": ["session.next.tool.input.delta"]
  25738. },
  25739. "properties": {
  25740. "type": "object",
  25741. "properties": {
  25742. "timestamp": {
  25743. "type": "number"
  25744. },
  25745. "sessionID": {
  25746. "type": "string",
  25747. "pattern": "^ses"
  25748. },
  25749. "assistantMessageID": {
  25750. "type": "string",
  25751. "pattern": "^msg_"
  25752. },
  25753. "callID": {
  25754. "type": "string"
  25755. },
  25756. "delta": {
  25757. "type": "string"
  25758. }
  25759. },
  25760. "required": ["timestamp", "sessionID", "assistantMessageID", "callID", "delta"],
  25761. "additionalProperties": false
  25762. }
  25763. },
  25764. "required": ["id", "type", "properties"],
  25765. "additionalProperties": false
  25766. },
  25767. "EventSessionNextToolInputEnded": {
  25768. "type": "object",
  25769. "properties": {
  25770. "id": {
  25771. "type": "string",
  25772. "pattern": "^evt_"
  25773. },
  25774. "type": {
  25775. "type": "string",
  25776. "enum": ["session.next.tool.input.ended"]
  25777. },
  25778. "properties": {
  25779. "type": "object",
  25780. "properties": {
  25781. "timestamp": {
  25782. "type": "number"
  25783. },
  25784. "sessionID": {
  25785. "type": "string",
  25786. "pattern": "^ses"
  25787. },
  25788. "assistantMessageID": {
  25789. "type": "string",
  25790. "pattern": "^msg_"
  25791. },
  25792. "callID": {
  25793. "type": "string"
  25794. },
  25795. "text": {
  25796. "type": "string"
  25797. }
  25798. },
  25799. "required": ["timestamp", "sessionID", "assistantMessageID", "callID", "text"],
  25800. "additionalProperties": false
  25801. }
  25802. },
  25803. "required": ["id", "type", "properties"],
  25804. "additionalProperties": false
  25805. },
  25806. "EventSessionNextToolCalled": {
  25807. "type": "object",
  25808. "properties": {
  25809. "id": {
  25810. "type": "string",
  25811. "pattern": "^evt_"
  25812. },
  25813. "type": {
  25814. "type": "string",
  25815. "enum": ["session.next.tool.called"]
  25816. },
  25817. "properties": {
  25818. "type": "object",
  25819. "properties": {
  25820. "timestamp": {
  25821. "type": "number"
  25822. },
  25823. "sessionID": {
  25824. "type": "string",
  25825. "pattern": "^ses"
  25826. },
  25827. "assistantMessageID": {
  25828. "type": "string",
  25829. "pattern": "^msg_"
  25830. },
  25831. "callID": {
  25832. "type": "string"
  25833. },
  25834. "tool": {
  25835. "type": "string"
  25836. },
  25837. "input": {
  25838. "type": "object"
  25839. },
  25840. "provider": {
  25841. "type": "object",
  25842. "properties": {
  25843. "executed": {
  25844. "type": "boolean"
  25845. },
  25846. "metadata": {
  25847. "type": "object",
  25848. "additionalProperties": {
  25849. "type": "object"
  25850. }
  25851. }
  25852. },
  25853. "required": ["executed"],
  25854. "additionalProperties": false
  25855. }
  25856. },
  25857. "required": ["timestamp", "sessionID", "assistantMessageID", "callID", "tool", "input", "provider"],
  25858. "additionalProperties": false
  25859. }
  25860. },
  25861. "required": ["id", "type", "properties"],
  25862. "additionalProperties": false
  25863. },
  25864. "EventSessionNextToolProgress": {
  25865. "type": "object",
  25866. "properties": {
  25867. "id": {
  25868. "type": "string",
  25869. "pattern": "^evt_"
  25870. },
  25871. "type": {
  25872. "type": "string",
  25873. "enum": ["session.next.tool.progress"]
  25874. },
  25875. "properties": {
  25876. "type": "object",
  25877. "properties": {
  25878. "timestamp": {
  25879. "type": "number"
  25880. },
  25881. "sessionID": {
  25882. "type": "string",
  25883. "pattern": "^ses"
  25884. },
  25885. "assistantMessageID": {
  25886. "type": "string",
  25887. "pattern": "^msg_"
  25888. },
  25889. "callID": {
  25890. "type": "string"
  25891. },
  25892. "structured": {
  25893. "type": "object"
  25894. },
  25895. "content": {
  25896. "type": "array",
  25897. "items": {
  25898. "anyOf": [
  25899. {
  25900. "$ref": "#/components/schemas/ToolTextContent"
  25901. },
  25902. {
  25903. "$ref": "#/components/schemas/ToolFileContent"
  25904. }
  25905. ]
  25906. }
  25907. }
  25908. },
  25909. "required": ["timestamp", "sessionID", "assistantMessageID", "callID", "structured", "content"],
  25910. "additionalProperties": false
  25911. }
  25912. },
  25913. "required": ["id", "type", "properties"],
  25914. "additionalProperties": false
  25915. },
  25916. "EventSessionNextToolSuccess": {
  25917. "type": "object",
  25918. "properties": {
  25919. "id": {
  25920. "type": "string",
  25921. "pattern": "^evt_"
  25922. },
  25923. "type": {
  25924. "type": "string",
  25925. "enum": ["session.next.tool.success"]
  25926. },
  25927. "properties": {
  25928. "type": "object",
  25929. "properties": {
  25930. "timestamp": {
  25931. "type": "number"
  25932. },
  25933. "sessionID": {
  25934. "type": "string",
  25935. "pattern": "^ses"
  25936. },
  25937. "assistantMessageID": {
  25938. "type": "string",
  25939. "pattern": "^msg_"
  25940. },
  25941. "callID": {
  25942. "type": "string"
  25943. },
  25944. "structured": {
  25945. "type": "object"
  25946. },
  25947. "content": {
  25948. "type": "array",
  25949. "items": {
  25950. "anyOf": [
  25951. {
  25952. "$ref": "#/components/schemas/ToolTextContent"
  25953. },
  25954. {
  25955. "$ref": "#/components/schemas/ToolFileContent"
  25956. }
  25957. ]
  25958. }
  25959. },
  25960. "result": {},
  25961. "provider": {
  25962. "type": "object",
  25963. "properties": {
  25964. "executed": {
  25965. "type": "boolean"
  25966. },
  25967. "metadata": {
  25968. "type": "object",
  25969. "additionalProperties": {
  25970. "type": "object"
  25971. }
  25972. }
  25973. },
  25974. "required": ["executed"],
  25975. "additionalProperties": false
  25976. }
  25977. },
  25978. "required": ["timestamp", "sessionID", "assistantMessageID", "callID", "structured", "content", "provider"],
  25979. "additionalProperties": false
  25980. }
  25981. },
  25982. "required": ["id", "type", "properties"],
  25983. "additionalProperties": false
  25984. },
  25985. "EventSessionNextToolFailed": {
  25986. "type": "object",
  25987. "properties": {
  25988. "id": {
  25989. "type": "string",
  25990. "pattern": "^evt_"
  25991. },
  25992. "type": {
  25993. "type": "string",
  25994. "enum": ["session.next.tool.failed"]
  25995. },
  25996. "properties": {
  25997. "type": "object",
  25998. "properties": {
  25999. "timestamp": {
  26000. "type": "number"
  26001. },
  26002. "sessionID": {
  26003. "type": "string",
  26004. "pattern": "^ses"
  26005. },
  26006. "assistantMessageID": {
  26007. "type": "string",
  26008. "pattern": "^msg_"
  26009. },
  26010. "callID": {
  26011. "type": "string"
  26012. },
  26013. "error": {
  26014. "$ref": "#/components/schemas/SessionErrorUnknown"
  26015. },
  26016. "result": {},
  26017. "provider": {
  26018. "type": "object",
  26019. "properties": {
  26020. "executed": {
  26021. "type": "boolean"
  26022. },
  26023. "metadata": {
  26024. "type": "object",
  26025. "additionalProperties": {
  26026. "type": "object"
  26027. }
  26028. }
  26029. },
  26030. "required": ["executed"],
  26031. "additionalProperties": false
  26032. }
  26033. },
  26034. "required": ["timestamp", "sessionID", "assistantMessageID", "callID", "error", "provider"],
  26035. "additionalProperties": false
  26036. }
  26037. },
  26038. "required": ["id", "type", "properties"],
  26039. "additionalProperties": false
  26040. },
  26041. "EventSessionNextRetried": {
  26042. "type": "object",
  26043. "properties": {
  26044. "id": {
  26045. "type": "string",
  26046. "pattern": "^evt_"
  26047. },
  26048. "type": {
  26049. "type": "string",
  26050. "enum": ["session.next.retried"]
  26051. },
  26052. "properties": {
  26053. "type": "object",
  26054. "properties": {
  26055. "timestamp": {
  26056. "type": "number"
  26057. },
  26058. "sessionID": {
  26059. "type": "string",
  26060. "pattern": "^ses"
  26061. },
  26062. "attempt": {
  26063. "type": "number"
  26064. },
  26065. "error": {
  26066. "$ref": "#/components/schemas/SessionNextRetry_error"
  26067. }
  26068. },
  26069. "required": ["timestamp", "sessionID", "attempt", "error"],
  26070. "additionalProperties": false
  26071. }
  26072. },
  26073. "required": ["id", "type", "properties"],
  26074. "additionalProperties": false
  26075. },
  26076. "EventSessionNextCompactionStarted": {
  26077. "type": "object",
  26078. "properties": {
  26079. "id": {
  26080. "type": "string",
  26081. "pattern": "^evt_"
  26082. },
  26083. "type": {
  26084. "type": "string",
  26085. "enum": ["session.next.compaction.started"]
  26086. },
  26087. "properties": {
  26088. "type": "object",
  26089. "properties": {
  26090. "timestamp": {
  26091. "type": "number"
  26092. },
  26093. "sessionID": {
  26094. "type": "string",
  26095. "pattern": "^ses"
  26096. },
  26097. "messageID": {
  26098. "type": "string",
  26099. "pattern": "^msg_"
  26100. },
  26101. "reason": {
  26102. "type": "string",
  26103. "enum": ["auto", "manual"]
  26104. }
  26105. },
  26106. "required": ["timestamp", "sessionID", "messageID", "reason"],
  26107. "additionalProperties": false
  26108. }
  26109. },
  26110. "required": ["id", "type", "properties"],
  26111. "additionalProperties": false
  26112. },
  26113. "EventSessionNextCompactionDelta": {
  26114. "type": "object",
  26115. "properties": {
  26116. "id": {
  26117. "type": "string",
  26118. "pattern": "^evt_"
  26119. },
  26120. "type": {
  26121. "type": "string",
  26122. "enum": ["session.next.compaction.delta"]
  26123. },
  26124. "properties": {
  26125. "type": "object",
  26126. "properties": {
  26127. "timestamp": {
  26128. "type": "number"
  26129. },
  26130. "sessionID": {
  26131. "type": "string",
  26132. "pattern": "^ses"
  26133. },
  26134. "text": {
  26135. "type": "string"
  26136. }
  26137. },
  26138. "required": ["timestamp", "sessionID", "text"],
  26139. "additionalProperties": false
  26140. }
  26141. },
  26142. "required": ["id", "type", "properties"],
  26143. "additionalProperties": false
  26144. },
  26145. "EventSessionNextCompactionEnded": {
  26146. "type": "object",
  26147. "properties": {
  26148. "id": {
  26149. "type": "string",
  26150. "pattern": "^evt_"
  26151. },
  26152. "type": {
  26153. "type": "string",
  26154. "enum": ["session.next.compaction.ended"]
  26155. },
  26156. "properties": {
  26157. "type": "object",
  26158. "properties": {
  26159. "timestamp": {
  26160. "type": "number"
  26161. },
  26162. "sessionID": {
  26163. "type": "string",
  26164. "pattern": "^ses"
  26165. },
  26166. "text": {
  26167. "type": "string"
  26168. },
  26169. "include": {
  26170. "type": "string"
  26171. }
  26172. },
  26173. "required": ["timestamp", "sessionID", "text"],
  26174. "additionalProperties": false
  26175. }
  26176. },
  26177. "required": ["id", "type", "properties"],
  26178. "additionalProperties": false
  26179. },
  26180. "EventMessagePartDelta": {
  26181. "type": "object",
  26182. "properties": {
  26183. "id": {
  26184. "type": "string",
  26185. "pattern": "^evt_"
  26186. },
  26187. "type": {
  26188. "type": "string",
  26189. "enum": ["message.part.delta"]
  26190. },
  26191. "properties": {
  26192. "type": "object",
  26193. "properties": {
  26194. "sessionID": {
  26195. "type": "string",
  26196. "pattern": "^ses"
  26197. },
  26198. "messageID": {
  26199. "type": "string",
  26200. "pattern": "^msg"
  26201. },
  26202. "partID": {
  26203. "type": "string",
  26204. "pattern": "^prt"
  26205. },
  26206. "field": {
  26207. "type": "string"
  26208. },
  26209. "delta": {
  26210. "type": "string"
  26211. }
  26212. },
  26213. "required": ["sessionID", "messageID", "partID", "field", "delta"],
  26214. "additionalProperties": false
  26215. }
  26216. },
  26217. "required": ["id", "type", "properties"],
  26218. "additionalProperties": false
  26219. },
  26220. "EventSessionDiff": {
  26221. "type": "object",
  26222. "properties": {
  26223. "id": {
  26224. "type": "string",
  26225. "pattern": "^evt_"
  26226. },
  26227. "type": {
  26228. "type": "string",
  26229. "enum": ["session.diff"]
  26230. },
  26231. "properties": {
  26232. "type": "object",
  26233. "properties": {
  26234. "sessionID": {
  26235. "type": "string",
  26236. "pattern": "^ses"
  26237. },
  26238. "diff": {
  26239. "type": "array",
  26240. "items": {
  26241. "$ref": "#/components/schemas/SnapshotFileDiff"
  26242. }
  26243. }
  26244. },
  26245. "required": ["sessionID", "diff"],
  26246. "additionalProperties": false
  26247. }
  26248. },
  26249. "required": ["id", "type", "properties"],
  26250. "additionalProperties": false
  26251. },
  26252. "EventSessionError": {
  26253. "type": "object",
  26254. "properties": {
  26255. "id": {
  26256. "type": "string",
  26257. "pattern": "^evt_"
  26258. },
  26259. "type": {
  26260. "type": "string",
  26261. "enum": ["session.error"]
  26262. },
  26263. "properties": {
  26264. "type": "object",
  26265. "properties": {
  26266. "sessionID": {
  26267. "type": "string",
  26268. "pattern": "^ses"
  26269. },
  26270. "error": {
  26271. "anyOf": [
  26272. {
  26273. "$ref": "#/components/schemas/ProviderAuthError"
  26274. },
  26275. {
  26276. "$ref": "#/components/schemas/UnknownError"
  26277. },
  26278. {
  26279. "$ref": "#/components/schemas/MessageOutputLengthError"
  26280. },
  26281. {
  26282. "$ref": "#/components/schemas/MessageAbortedError"
  26283. },
  26284. {
  26285. "$ref": "#/components/schemas/StructuredOutputError"
  26286. },
  26287. {
  26288. "$ref": "#/components/schemas/ContextOverflowError"
  26289. },
  26290. {
  26291. "$ref": "#/components/schemas/APIError"
  26292. }
  26293. ]
  26294. }
  26295. },
  26296. "additionalProperties": false
  26297. }
  26298. },
  26299. "required": ["id", "type", "properties"],
  26300. "additionalProperties": false
  26301. },
  26302. "EventInstallationUpdated": {
  26303. "type": "object",
  26304. "properties": {
  26305. "id": {
  26306. "type": "string",
  26307. "pattern": "^evt_"
  26308. },
  26309. "type": {
  26310. "type": "string",
  26311. "enum": ["installation.updated"]
  26312. },
  26313. "properties": {
  26314. "type": "object",
  26315. "properties": {
  26316. "version": {
  26317. "type": "string"
  26318. }
  26319. },
  26320. "required": ["version"],
  26321. "additionalProperties": false
  26322. }
  26323. },
  26324. "required": ["id", "type", "properties"],
  26325. "additionalProperties": false
  26326. },
  26327. "EventInstallationUpdate-available": {
  26328. "type": "object",
  26329. "properties": {
  26330. "id": {
  26331. "type": "string",
  26332. "pattern": "^evt_"
  26333. },
  26334. "type": {
  26335. "type": "string",
  26336. "enum": ["installation.update-available"]
  26337. },
  26338. "properties": {
  26339. "type": "object",
  26340. "properties": {
  26341. "version": {
  26342. "type": "string"
  26343. }
  26344. },
  26345. "required": ["version"],
  26346. "additionalProperties": false
  26347. }
  26348. },
  26349. "required": ["id", "type", "properties"],
  26350. "additionalProperties": false
  26351. },
  26352. "EventFileEdited": {
  26353. "type": "object",
  26354. "properties": {
  26355. "id": {
  26356. "type": "string",
  26357. "pattern": "^evt_"
  26358. },
  26359. "type": {
  26360. "type": "string",
  26361. "enum": ["file.edited"]
  26362. },
  26363. "properties": {
  26364. "type": "object",
  26365. "properties": {
  26366. "file": {
  26367. "type": "string"
  26368. }
  26369. },
  26370. "required": ["file"],
  26371. "additionalProperties": false
  26372. }
  26373. },
  26374. "required": ["id", "type", "properties"],
  26375. "additionalProperties": false
  26376. },
  26377. "EventAccountAdded": {
  26378. "type": "object",
  26379. "properties": {
  26380. "id": {
  26381. "type": "string",
  26382. "pattern": "^evt_"
  26383. },
  26384. "type": {
  26385. "type": "string",
  26386. "enum": ["account.added"]
  26387. },
  26388. "properties": {
  26389. "type": "object",
  26390. "properties": {
  26391. "account": {
  26392. "$ref": "#/components/schemas/AuthInfo"
  26393. }
  26394. },
  26395. "required": ["account"],
  26396. "additionalProperties": false
  26397. }
  26398. },
  26399. "required": ["id", "type", "properties"],
  26400. "additionalProperties": false
  26401. },
  26402. "EventAccountRemoved": {
  26403. "type": "object",
  26404. "properties": {
  26405. "id": {
  26406. "type": "string",
  26407. "pattern": "^evt_"
  26408. },
  26409. "type": {
  26410. "type": "string",
  26411. "enum": ["account.removed"]
  26412. },
  26413. "properties": {
  26414. "type": "object",
  26415. "properties": {
  26416. "account": {
  26417. "$ref": "#/components/schemas/AuthInfo"
  26418. }
  26419. },
  26420. "required": ["account"],
  26421. "additionalProperties": false
  26422. }
  26423. },
  26424. "required": ["id", "type", "properties"],
  26425. "additionalProperties": false
  26426. },
  26427. "EventAccountSwitched": {
  26428. "type": "object",
  26429. "properties": {
  26430. "id": {
  26431. "type": "string",
  26432. "pattern": "^evt_"
  26433. },
  26434. "type": {
  26435. "type": "string",
  26436. "enum": ["account.switched"]
  26437. },
  26438. "properties": {
  26439. "type": "object",
  26440. "properties": {
  26441. "serviceID": {
  26442. "type": "string"
  26443. },
  26444. "from": {
  26445. "type": "string"
  26446. },
  26447. "to": {
  26448. "type": "string"
  26449. }
  26450. },
  26451. "required": ["serviceID"],
  26452. "additionalProperties": false
  26453. }
  26454. },
  26455. "required": ["id", "type", "properties"],
  26456. "additionalProperties": false
  26457. },
  26458. "EventPermissionV2Asked": {
  26459. "type": "object",
  26460. "properties": {
  26461. "id": {
  26462. "type": "string",
  26463. "pattern": "^evt_"
  26464. },
  26465. "type": {
  26466. "type": "string",
  26467. "enum": ["permission.v2.asked"]
  26468. },
  26469. "properties": {
  26470. "type": "object",
  26471. "properties": {
  26472. "id": {
  26473. "type": "string",
  26474. "pattern": "^per"
  26475. },
  26476. "sessionID": {
  26477. "type": "string",
  26478. "pattern": "^ses"
  26479. },
  26480. "action": {
  26481. "type": "string"
  26482. },
  26483. "resources": {
  26484. "type": "array",
  26485. "items": {
  26486. "type": "string"
  26487. }
  26488. },
  26489. "save": {
  26490. "type": "array",
  26491. "items": {
  26492. "type": "string"
  26493. }
  26494. },
  26495. "metadata": {
  26496. "type": "object"
  26497. },
  26498. "source": {
  26499. "$ref": "#/components/schemas/PermissionV2Source"
  26500. }
  26501. },
  26502. "required": ["id", "sessionID", "action", "resources"],
  26503. "additionalProperties": false
  26504. }
  26505. },
  26506. "required": ["id", "type", "properties"],
  26507. "additionalProperties": false
  26508. },
  26509. "EventPermissionV2Replied": {
  26510. "type": "object",
  26511. "properties": {
  26512. "id": {
  26513. "type": "string",
  26514. "pattern": "^evt_"
  26515. },
  26516. "type": {
  26517. "type": "string",
  26518. "enum": ["permission.v2.replied"]
  26519. },
  26520. "properties": {
  26521. "type": "object",
  26522. "properties": {
  26523. "sessionID": {
  26524. "type": "string",
  26525. "pattern": "^ses"
  26526. },
  26527. "requestID": {
  26528. "type": "string",
  26529. "pattern": "^per"
  26530. },
  26531. "reply": {
  26532. "$ref": "#/components/schemas/PermissionV2Reply"
  26533. }
  26534. },
  26535. "required": ["sessionID", "requestID", "reply"],
  26536. "additionalProperties": false
  26537. }
  26538. },
  26539. "required": ["id", "type", "properties"],
  26540. "additionalProperties": false
  26541. },
  26542. "EventFileWatcherUpdated": {
  26543. "type": "object",
  26544. "properties": {
  26545. "id": {
  26546. "type": "string",
  26547. "pattern": "^evt_"
  26548. },
  26549. "type": {
  26550. "type": "string",
  26551. "enum": ["file.watcher.updated"]
  26552. },
  26553. "properties": {
  26554. "type": "object",
  26555. "properties": {
  26556. "file": {
  26557. "type": "string"
  26558. },
  26559. "event": {
  26560. "type": "string",
  26561. "enum": ["add", "change", "unlink"]
  26562. }
  26563. },
  26564. "required": ["file", "event"],
  26565. "additionalProperties": false
  26566. }
  26567. },
  26568. "required": ["id", "type", "properties"],
  26569. "additionalProperties": false
  26570. },
  26571. "EventPtyCreated": {
  26572. "type": "object",
  26573. "properties": {
  26574. "id": {
  26575. "type": "string",
  26576. "pattern": "^evt_"
  26577. },
  26578. "type": {
  26579. "type": "string",
  26580. "enum": ["pty.created"]
  26581. },
  26582. "properties": {
  26583. "type": "object",
  26584. "properties": {
  26585. "info": {
  26586. "$ref": "#/components/schemas/Pty"
  26587. }
  26588. },
  26589. "required": ["info"],
  26590. "additionalProperties": false
  26591. }
  26592. },
  26593. "required": ["id", "type", "properties"],
  26594. "additionalProperties": false
  26595. },
  26596. "EventPtyUpdated": {
  26597. "type": "object",
  26598. "properties": {
  26599. "id": {
  26600. "type": "string",
  26601. "pattern": "^evt_"
  26602. },
  26603. "type": {
  26604. "type": "string",
  26605. "enum": ["pty.updated"]
  26606. },
  26607. "properties": {
  26608. "type": "object",
  26609. "properties": {
  26610. "info": {
  26611. "$ref": "#/components/schemas/Pty"
  26612. }
  26613. },
  26614. "required": ["info"],
  26615. "additionalProperties": false
  26616. }
  26617. },
  26618. "required": ["id", "type", "properties"],
  26619. "additionalProperties": false
  26620. },
  26621. "EventPtyExited": {
  26622. "type": "object",
  26623. "properties": {
  26624. "id": {
  26625. "type": "string",
  26626. "pattern": "^evt_"
  26627. },
  26628. "type": {
  26629. "type": "string",
  26630. "enum": ["pty.exited"]
  26631. },
  26632. "properties": {
  26633. "type": "object",
  26634. "properties": {
  26635. "id": {
  26636. "type": "string",
  26637. "pattern": "^pty"
  26638. },
  26639. "exitCode": {
  26640. "type": "integer",
  26641. "minimum": 0
  26642. }
  26643. },
  26644. "required": ["id", "exitCode"],
  26645. "additionalProperties": false
  26646. }
  26647. },
  26648. "required": ["id", "type", "properties"],
  26649. "additionalProperties": false
  26650. },
  26651. "EventPtyDeleted": {
  26652. "type": "object",
  26653. "properties": {
  26654. "id": {
  26655. "type": "string",
  26656. "pattern": "^evt_"
  26657. },
  26658. "type": {
  26659. "type": "string",
  26660. "enum": ["pty.deleted"]
  26661. },
  26662. "properties": {
  26663. "type": "object",
  26664. "properties": {
  26665. "id": {
  26666. "type": "string",
  26667. "pattern": "^pty"
  26668. }
  26669. },
  26670. "required": ["id"],
  26671. "additionalProperties": false
  26672. }
  26673. },
  26674. "required": ["id", "type", "properties"],
  26675. "additionalProperties": false
  26676. },
  26677. "EventQuestionV2Asked": {
  26678. "type": "object",
  26679. "properties": {
  26680. "id": {
  26681. "type": "string",
  26682. "pattern": "^evt_"
  26683. },
  26684. "type": {
  26685. "type": "string",
  26686. "enum": ["question.v2.asked"]
  26687. },
  26688. "properties": {
  26689. "type": "object",
  26690. "properties": {
  26691. "id": {
  26692. "type": "string",
  26693. "pattern": "^que"
  26694. },
  26695. "sessionID": {
  26696. "type": "string",
  26697. "pattern": "^ses"
  26698. },
  26699. "questions": {
  26700. "type": "array",
  26701. "items": {
  26702. "$ref": "#/components/schemas/QuestionV2Info"
  26703. },
  26704. "description": "Questions to ask"
  26705. },
  26706. "tool": {
  26707. "$ref": "#/components/schemas/QuestionV2Tool"
  26708. }
  26709. },
  26710. "required": ["id", "sessionID", "questions"],
  26711. "additionalProperties": false
  26712. }
  26713. },
  26714. "required": ["id", "type", "properties"],
  26715. "additionalProperties": false
  26716. },
  26717. "EventQuestionV2Replied": {
  26718. "type": "object",
  26719. "properties": {
  26720. "id": {
  26721. "type": "string",
  26722. "pattern": "^evt_"
  26723. },
  26724. "type": {
  26725. "type": "string",
  26726. "enum": ["question.v2.replied"]
  26727. },
  26728. "properties": {
  26729. "type": "object",
  26730. "properties": {
  26731. "sessionID": {
  26732. "type": "string",
  26733. "pattern": "^ses"
  26734. },
  26735. "requestID": {
  26736. "type": "string",
  26737. "pattern": "^que"
  26738. },
  26739. "answers": {
  26740. "type": "array",
  26741. "items": {
  26742. "$ref": "#/components/schemas/QuestionV2Answer"
  26743. }
  26744. }
  26745. },
  26746. "required": ["sessionID", "requestID", "answers"],
  26747. "additionalProperties": false
  26748. }
  26749. },
  26750. "required": ["id", "type", "properties"],
  26751. "additionalProperties": false
  26752. },
  26753. "EventQuestionV2Rejected": {
  26754. "type": "object",
  26755. "properties": {
  26756. "id": {
  26757. "type": "string",
  26758. "pattern": "^evt_"
  26759. },
  26760. "type": {
  26761. "type": "string",
  26762. "enum": ["question.v2.rejected"]
  26763. },
  26764. "properties": {
  26765. "type": "object",
  26766. "properties": {
  26767. "sessionID": {
  26768. "type": "string",
  26769. "pattern": "^ses"
  26770. },
  26771. "requestID": {
  26772. "type": "string",
  26773. "pattern": "^que"
  26774. }
  26775. },
  26776. "required": ["sessionID", "requestID"],
  26777. "additionalProperties": false
  26778. }
  26779. },
  26780. "required": ["id", "type", "properties"],
  26781. "additionalProperties": false
  26782. },
  26783. "EventTodoUpdated": {
  26784. "type": "object",
  26785. "properties": {
  26786. "id": {
  26787. "type": "string",
  26788. "pattern": "^evt_"
  26789. },
  26790. "type": {
  26791. "type": "string",
  26792. "enum": ["todo.updated"]
  26793. },
  26794. "properties": {
  26795. "type": "object",
  26796. "properties": {
  26797. "sessionID": {
  26798. "type": "string",
  26799. "pattern": "^ses"
  26800. },
  26801. "todos": {
  26802. "type": "array",
  26803. "items": {
  26804. "$ref": "#/components/schemas/Todo"
  26805. }
  26806. }
  26807. },
  26808. "required": ["sessionID", "todos"],
  26809. "additionalProperties": false
  26810. }
  26811. },
  26812. "required": ["id", "type", "properties"],
  26813. "additionalProperties": false
  26814. },
  26815. "EventLspUpdated": {
  26816. "type": "object",
  26817. "properties": {
  26818. "id": {
  26819. "type": "string",
  26820. "pattern": "^evt_"
  26821. },
  26822. "type": {
  26823. "type": "string",
  26824. "enum": ["lsp.updated"]
  26825. },
  26826. "properties": {
  26827. "type": "object",
  26828. "properties": {}
  26829. }
  26830. },
  26831. "required": ["id", "type", "properties"],
  26832. "additionalProperties": false
  26833. },
  26834. "EventPermissionAsked": {
  26835. "type": "object",
  26836. "properties": {
  26837. "id": {
  26838. "type": "string",
  26839. "pattern": "^evt_"
  26840. },
  26841. "type": {
  26842. "type": "string",
  26843. "enum": ["permission.asked"]
  26844. },
  26845. "properties": {
  26846. "type": "object",
  26847. "properties": {
  26848. "id": {
  26849. "type": "string",
  26850. "pattern": "^per"
  26851. },
  26852. "sessionID": {
  26853. "type": "string",
  26854. "pattern": "^ses"
  26855. },
  26856. "permission": {
  26857. "type": "string"
  26858. },
  26859. "patterns": {
  26860. "type": "array",
  26861. "items": {
  26862. "type": "string"
  26863. }
  26864. },
  26865. "metadata": {
  26866. "type": "object"
  26867. },
  26868. "always": {
  26869. "type": "array",
  26870. "items": {
  26871. "type": "string"
  26872. }
  26873. },
  26874. "tool": {
  26875. "type": "object",
  26876. "properties": {
  26877. "messageID": {
  26878. "type": "string"
  26879. },
  26880. "callID": {
  26881. "type": "string"
  26882. }
  26883. },
  26884. "required": ["messageID", "callID"],
  26885. "additionalProperties": false
  26886. }
  26887. },
  26888. "required": ["id", "sessionID", "permission", "patterns", "metadata", "always"],
  26889. "additionalProperties": false
  26890. }
  26891. },
  26892. "required": ["id", "type", "properties"],
  26893. "additionalProperties": false
  26894. },
  26895. "EventPermissionReplied": {
  26896. "type": "object",
  26897. "properties": {
  26898. "id": {
  26899. "type": "string",
  26900. "pattern": "^evt_"
  26901. },
  26902. "type": {
  26903. "type": "string",
  26904. "enum": ["permission.replied"]
  26905. },
  26906. "properties": {
  26907. "type": "object",
  26908. "properties": {
  26909. "sessionID": {
  26910. "type": "string",
  26911. "pattern": "^ses"
  26912. },
  26913. "requestID": {
  26914. "type": "string",
  26915. "pattern": "^per"
  26916. },
  26917. "reply": {
  26918. "type": "string",
  26919. "enum": ["once", "always", "reject"]
  26920. }
  26921. },
  26922. "required": ["sessionID", "requestID", "reply"],
  26923. "additionalProperties": false
  26924. }
  26925. },
  26926. "required": ["id", "type", "properties"],
  26927. "additionalProperties": false
  26928. },
  26929. "EventMcpToolsChanged": {
  26930. "type": "object",
  26931. "properties": {
  26932. "id": {
  26933. "type": "string",
  26934. "pattern": "^evt_"
  26935. },
  26936. "type": {
  26937. "type": "string",
  26938. "enum": ["mcp.tools.changed"]
  26939. },
  26940. "properties": {
  26941. "type": "object",
  26942. "properties": {
  26943. "server": {
  26944. "type": "string"
  26945. }
  26946. },
  26947. "required": ["server"],
  26948. "additionalProperties": false
  26949. }
  26950. },
  26951. "required": ["id", "type", "properties"],
  26952. "additionalProperties": false
  26953. },
  26954. "EventMcpBrowserOpenFailed": {
  26955. "type": "object",
  26956. "properties": {
  26957. "id": {
  26958. "type": "string",
  26959. "pattern": "^evt_"
  26960. },
  26961. "type": {
  26962. "type": "string",
  26963. "enum": ["mcp.browser.open.failed"]
  26964. },
  26965. "properties": {
  26966. "type": "object",
  26967. "properties": {
  26968. "mcpName": {
  26969. "type": "string"
  26970. },
  26971. "url": {
  26972. "type": "string"
  26973. }
  26974. },
  26975. "required": ["mcpName", "url"],
  26976. "additionalProperties": false
  26977. }
  26978. },
  26979. "required": ["id", "type", "properties"],
  26980. "additionalProperties": false
  26981. },
  26982. "EventCommandExecuted": {
  26983. "type": "object",
  26984. "properties": {
  26985. "id": {
  26986. "type": "string",
  26987. "pattern": "^evt_"
  26988. },
  26989. "type": {
  26990. "type": "string",
  26991. "enum": ["command.executed"]
  26992. },
  26993. "properties": {
  26994. "type": "object",
  26995. "properties": {
  26996. "name": {
  26997. "type": "string"
  26998. },
  26999. "sessionID": {
  27000. "type": "string",
  27001. "pattern": "^ses"
  27002. },
  27003. "arguments": {
  27004. "type": "string"
  27005. },
  27006. "messageID": {
  27007. "type": "string",
  27008. "pattern": "^msg"
  27009. }
  27010. },
  27011. "required": ["name", "sessionID", "arguments", "messageID"],
  27012. "additionalProperties": false
  27013. }
  27014. },
  27015. "required": ["id", "type", "properties"],
  27016. "additionalProperties": false
  27017. },
  27018. "EventProjectDirectoriesUpdated": {
  27019. "type": "object",
  27020. "properties": {
  27021. "id": {
  27022. "type": "string",
  27023. "pattern": "^evt_"
  27024. },
  27025. "type": {
  27026. "type": "string",
  27027. "enum": ["project.directories.updated"]
  27028. },
  27029. "properties": {
  27030. "type": "object",
  27031. "properties": {
  27032. "projectID": {
  27033. "type": "string"
  27034. }
  27035. },
  27036. "required": ["projectID"],
  27037. "additionalProperties": false
  27038. }
  27039. },
  27040. "required": ["id", "type", "properties"],
  27041. "additionalProperties": false
  27042. },
  27043. "EventProjectUpdated": {
  27044. "type": "object",
  27045. "properties": {
  27046. "id": {
  27047. "type": "string",
  27048. "pattern": "^evt_"
  27049. },
  27050. "type": {
  27051. "type": "string",
  27052. "enum": ["project.updated"]
  27053. },
  27054. "properties": {
  27055. "type": "object",
  27056. "properties": {
  27057. "id": {
  27058. "type": "string"
  27059. },
  27060. "worktree": {
  27061. "type": "string"
  27062. },
  27063. "vcs": {
  27064. "type": "string",
  27065. "enum": ["git"]
  27066. },
  27067. "name": {
  27068. "type": "string"
  27069. },
  27070. "icon": {
  27071. "type": "object",
  27072. "properties": {
  27073. "url": {
  27074. "type": "string"
  27075. },
  27076. "override": {
  27077. "type": "string"
  27078. },
  27079. "color": {
  27080. "type": "string"
  27081. }
  27082. },
  27083. "additionalProperties": false
  27084. },
  27085. "commands": {
  27086. "type": "object",
  27087. "properties": {
  27088. "start": {
  27089. "type": "string",
  27090. "description": "Startup script to run when creating a new workspace (worktree)"
  27091. }
  27092. },
  27093. "additionalProperties": false
  27094. },
  27095. "time": {
  27096. "type": "object",
  27097. "properties": {
  27098. "created": {
  27099. "type": "integer",
  27100. "minimum": 0
  27101. },
  27102. "updated": {
  27103. "type": "integer",
  27104. "minimum": 0
  27105. },
  27106. "initialized": {
  27107. "type": "integer",
  27108. "minimum": 0
  27109. }
  27110. },
  27111. "required": ["created", "updated"],
  27112. "additionalProperties": false
  27113. },
  27114. "sandboxes": {
  27115. "type": "array",
  27116. "items": {
  27117. "type": "string"
  27118. }
  27119. }
  27120. },
  27121. "required": ["id", "worktree", "time", "sandboxes"],
  27122. "additionalProperties": false
  27123. }
  27124. },
  27125. "required": ["id", "type", "properties"],
  27126. "additionalProperties": false
  27127. },
  27128. "EventQuestionAsked": {
  27129. "type": "object",
  27130. "properties": {
  27131. "id": {
  27132. "type": "string",
  27133. "pattern": "^evt_"
  27134. },
  27135. "type": {
  27136. "type": "string",
  27137. "enum": ["question.asked"]
  27138. },
  27139. "properties": {
  27140. "type": "object",
  27141. "properties": {
  27142. "id": {
  27143. "type": "string",
  27144. "pattern": "^que"
  27145. },
  27146. "sessionID": {
  27147. "type": "string",
  27148. "pattern": "^ses"
  27149. },
  27150. "questions": {
  27151. "type": "array",
  27152. "items": {
  27153. "$ref": "#/components/schemas/QuestionInfo"
  27154. },
  27155. "description": "Questions to ask"
  27156. },
  27157. "tool": {
  27158. "$ref": "#/components/schemas/QuestionTool"
  27159. }
  27160. },
  27161. "required": ["id", "sessionID", "questions"],
  27162. "additionalProperties": false
  27163. }
  27164. },
  27165. "required": ["id", "type", "properties"],
  27166. "additionalProperties": false
  27167. },
  27168. "EventQuestionReplied": {
  27169. "type": "object",
  27170. "properties": {
  27171. "id": {
  27172. "type": "string",
  27173. "pattern": "^evt_"
  27174. },
  27175. "type": {
  27176. "type": "string",
  27177. "enum": ["question.replied"]
  27178. },
  27179. "properties": {
  27180. "type": "object",
  27181. "properties": {
  27182. "sessionID": {
  27183. "type": "string",
  27184. "pattern": "^ses"
  27185. },
  27186. "requestID": {
  27187. "type": "string",
  27188. "pattern": "^que"
  27189. },
  27190. "answers": {
  27191. "type": "array",
  27192. "items": {
  27193. "$ref": "#/components/schemas/QuestionAnswer"
  27194. }
  27195. }
  27196. },
  27197. "required": ["sessionID", "requestID", "answers"],
  27198. "additionalProperties": false
  27199. }
  27200. },
  27201. "required": ["id", "type", "properties"],
  27202. "additionalProperties": false
  27203. },
  27204. "EventQuestionRejected": {
  27205. "type": "object",
  27206. "properties": {
  27207. "id": {
  27208. "type": "string",
  27209. "pattern": "^evt_"
  27210. },
  27211. "type": {
  27212. "type": "string",
  27213. "enum": ["question.rejected"]
  27214. },
  27215. "properties": {
  27216. "type": "object",
  27217. "properties": {
  27218. "sessionID": {
  27219. "type": "string",
  27220. "pattern": "^ses"
  27221. },
  27222. "requestID": {
  27223. "type": "string",
  27224. "pattern": "^que"
  27225. }
  27226. },
  27227. "required": ["sessionID", "requestID"],
  27228. "additionalProperties": false
  27229. }
  27230. },
  27231. "required": ["id", "type", "properties"],
  27232. "additionalProperties": false
  27233. },
  27234. "EventSessionStatus": {
  27235. "type": "object",
  27236. "properties": {
  27237. "id": {
  27238. "type": "string",
  27239. "pattern": "^evt_"
  27240. },
  27241. "type": {
  27242. "type": "string",
  27243. "enum": ["session.status"]
  27244. },
  27245. "properties": {
  27246. "type": "object",
  27247. "properties": {
  27248. "sessionID": {
  27249. "type": "string",
  27250. "pattern": "^ses"
  27251. },
  27252. "status": {
  27253. "$ref": "#/components/schemas/SessionStatus"
  27254. }
  27255. },
  27256. "required": ["sessionID", "status"],
  27257. "additionalProperties": false
  27258. }
  27259. },
  27260. "required": ["id", "type", "properties"],
  27261. "additionalProperties": false
  27262. },
  27263. "EventSessionIdle": {
  27264. "type": "object",
  27265. "properties": {
  27266. "id": {
  27267. "type": "string",
  27268. "pattern": "^evt_"
  27269. },
  27270. "type": {
  27271. "type": "string",
  27272. "enum": ["session.idle"]
  27273. },
  27274. "properties": {
  27275. "type": "object",
  27276. "properties": {
  27277. "sessionID": {
  27278. "type": "string",
  27279. "pattern": "^ses"
  27280. }
  27281. },
  27282. "required": ["sessionID"],
  27283. "additionalProperties": false
  27284. }
  27285. },
  27286. "required": ["id", "type", "properties"],
  27287. "additionalProperties": false
  27288. },
  27289. "EventSessionCompacted": {
  27290. "type": "object",
  27291. "properties": {
  27292. "id": {
  27293. "type": "string",
  27294. "pattern": "^evt_"
  27295. },
  27296. "type": {
  27297. "type": "string",
  27298. "enum": ["session.compacted"]
  27299. },
  27300. "properties": {
  27301. "type": "object",
  27302. "properties": {
  27303. "sessionID": {
  27304. "type": "string",
  27305. "pattern": "^ses"
  27306. }
  27307. },
  27308. "required": ["sessionID"],
  27309. "additionalProperties": false
  27310. }
  27311. },
  27312. "required": ["id", "type", "properties"],
  27313. "additionalProperties": false
  27314. },
  27315. "EventVcsBranchUpdated": {
  27316. "type": "object",
  27317. "properties": {
  27318. "id": {
  27319. "type": "string",
  27320. "pattern": "^evt_"
  27321. },
  27322. "type": {
  27323. "type": "string",
  27324. "enum": ["vcs.branch.updated"]
  27325. },
  27326. "properties": {
  27327. "type": "object",
  27328. "properties": {
  27329. "branch": {
  27330. "type": "string"
  27331. }
  27332. },
  27333. "additionalProperties": false
  27334. }
  27335. },
  27336. "required": ["id", "type", "properties"],
  27337. "additionalProperties": false
  27338. },
  27339. "EventWorktreeReady": {
  27340. "type": "object",
  27341. "properties": {
  27342. "id": {
  27343. "type": "string",
  27344. "pattern": "^evt_"
  27345. },
  27346. "type": {
  27347. "type": "string",
  27348. "enum": ["worktree.ready"]
  27349. },
  27350. "properties": {
  27351. "type": "object",
  27352. "properties": {
  27353. "name": {
  27354. "type": "string"
  27355. },
  27356. "branch": {
  27357. "type": "string"
  27358. }
  27359. },
  27360. "required": ["name"],
  27361. "additionalProperties": false
  27362. }
  27363. },
  27364. "required": ["id", "type", "properties"],
  27365. "additionalProperties": false
  27366. },
  27367. "EventWorktreeFailed": {
  27368. "type": "object",
  27369. "properties": {
  27370. "id": {
  27371. "type": "string",
  27372. "pattern": "^evt_"
  27373. },
  27374. "type": {
  27375. "type": "string",
  27376. "enum": ["worktree.failed"]
  27377. },
  27378. "properties": {
  27379. "type": "object",
  27380. "properties": {
  27381. "message": {
  27382. "type": "string"
  27383. }
  27384. },
  27385. "required": ["message"],
  27386. "additionalProperties": false
  27387. }
  27388. },
  27389. "required": ["id", "type", "properties"],
  27390. "additionalProperties": false
  27391. },
  27392. "EventWorkspaceReady": {
  27393. "type": "object",
  27394. "properties": {
  27395. "id": {
  27396. "type": "string",
  27397. "pattern": "^evt_"
  27398. },
  27399. "type": {
  27400. "type": "string",
  27401. "enum": ["workspace.ready"]
  27402. },
  27403. "properties": {
  27404. "type": "object",
  27405. "properties": {
  27406. "name": {
  27407. "type": "string"
  27408. }
  27409. },
  27410. "required": ["name"],
  27411. "additionalProperties": false
  27412. }
  27413. },
  27414. "required": ["id", "type", "properties"],
  27415. "additionalProperties": false
  27416. },
  27417. "EventWorkspaceFailed": {
  27418. "type": "object",
  27419. "properties": {
  27420. "id": {
  27421. "type": "string",
  27422. "pattern": "^evt_"
  27423. },
  27424. "type": {
  27425. "type": "string",
  27426. "enum": ["workspace.failed"]
  27427. },
  27428. "properties": {
  27429. "type": "object",
  27430. "properties": {
  27431. "message": {
  27432. "type": "string"
  27433. }
  27434. },
  27435. "required": ["message"],
  27436. "additionalProperties": false
  27437. }
  27438. },
  27439. "required": ["id", "type", "properties"],
  27440. "additionalProperties": false
  27441. },
  27442. "EventWorkspaceStatus": {
  27443. "type": "object",
  27444. "properties": {
  27445. "id": {
  27446. "type": "string",
  27447. "pattern": "^evt_"
  27448. },
  27449. "type": {
  27450. "type": "string",
  27451. "enum": ["workspace.status"]
  27452. },
  27453. "properties": {
  27454. "type": "object",
  27455. "properties": {
  27456. "workspaceID": {
  27457. "type": "string",
  27458. "pattern": "^wrk"
  27459. },
  27460. "status": {
  27461. "type": "string",
  27462. "enum": ["connected", "connecting", "disconnected", "error"]
  27463. }
  27464. },
  27465. "required": ["workspaceID", "status"],
  27466. "additionalProperties": false
  27467. }
  27468. },
  27469. "required": ["id", "type", "properties"],
  27470. "additionalProperties": false
  27471. },
  27472. "EventServerConnected": {
  27473. "type": "object",
  27474. "properties": {
  27475. "id": {
  27476. "type": "string",
  27477. "pattern": "^evt_"
  27478. },
  27479. "type": {
  27480. "type": "string",
  27481. "enum": ["server.connected"]
  27482. },
  27483. "properties": {
  27484. "type": "object",
  27485. "properties": {}
  27486. }
  27487. },
  27488. "required": ["id", "type", "properties"],
  27489. "additionalProperties": false
  27490. },
  27491. "EventGlobalDisposed": {
  27492. "type": "object",
  27493. "properties": {
  27494. "id": {
  27495. "type": "string",
  27496. "pattern": "^evt_"
  27497. },
  27498. "type": {
  27499. "type": "string",
  27500. "enum": ["global.disposed"]
  27501. },
  27502. "properties": {
  27503. "type": "object",
  27504. "properties": {}
  27505. }
  27506. },
  27507. "required": ["id", "type", "properties"],
  27508. "additionalProperties": false
  27509. },
  27510. "BadRequestError": {
  27511. "type": "object",
  27512. "required": ["name", "data"],
  27513. "properties": {
  27514. "name": {
  27515. "type": "string",
  27516. "enum": ["BadRequest"]
  27517. },
  27518. "data": {
  27519. "type": "object",
  27520. "required": ["message"],
  27521. "properties": {
  27522. "message": {
  27523. "type": "string"
  27524. },
  27525. "kind": {
  27526. "type": "string",
  27527. "enum": ["Params", "Headers", "Query", "Body", "Payload"]
  27528. }
  27529. }
  27530. }
  27531. }
  27532. }
  27533. }
  27534. },
  27535. "security": [],
  27536. "tags": [
  27537. {
  27538. "name": "control",
  27539. "description": "Control plane routes."
  27540. },
  27541. {
  27542. "name": "controlPlane",
  27543. "description": "Control-plane orchestration routes."
  27544. },
  27545. {
  27546. "name": "global",
  27547. "description": "Global server routes."
  27548. },
  27549. {
  27550. "name": "event",
  27551. "description": "Instance event stream route."
  27552. },
  27553. {
  27554. "name": "config",
  27555. "description": "Experimental HttpApi config routes."
  27556. },
  27557. {
  27558. "name": "experimental",
  27559. "description": "Experimental HttpApi read-only routes."
  27560. },
  27561. {
  27562. "name": "file",
  27563. "description": "Experimental HttpApi file routes."
  27564. },
  27565. {
  27566. "name": "instance",
  27567. "description": "Experimental HttpApi instance read routes."
  27568. },
  27569. {
  27570. "name": "mcp",
  27571. "description": "Experimental HttpApi MCP routes."
  27572. },
  27573. {
  27574. "name": "project",
  27575. "description": "Experimental HttpApi project routes."
  27576. },
  27577. {
  27578. "name": "projectCopy",
  27579. "description": "Project copy management routes."
  27580. },
  27581. {
  27582. "name": "pty",
  27583. "description": "Experimental HttpApi PTY routes."
  27584. },
  27585. {
  27586. "name": "question",
  27587. "description": "Question routes."
  27588. },
  27589. {
  27590. "name": "permission",
  27591. "description": "Experimental HttpApi permission routes."
  27592. },
  27593. {
  27594. "name": "provider",
  27595. "description": "Experimental HttpApi provider routes."
  27596. },
  27597. {
  27598. "name": "session",
  27599. "description": "Experimental HttpApi session routes."
  27600. },
  27601. {
  27602. "name": "sync",
  27603. "description": "Experimental HttpApi sync routes."
  27604. },
  27605. {
  27606. "name": "tui",
  27607. "description": "Experimental HttpApi TUI routes."
  27608. },
  27609. {
  27610. "name": "workspace",
  27611. "description": "Experimental HttpApi workspace routes."
  27612. },
  27613. {
  27614. "name": "opencode experimental HttpApi",
  27615. "description": "Experimental HttpApi surface for selected instance routes."
  27616. },
  27617. {
  27618. "name": "opencode experimental HttpApi",
  27619. "description": "Experimental HttpApi surface for selected instance routes."
  27620. },
  27621. {
  27622. "name": "v2",
  27623. "description": "Experimental v2 routes."
  27624. },
  27625. {
  27626. "name": "v2 messages",
  27627. "description": "Experimental v2 message routes."
  27628. },
  27629. {
  27630. "name": "v2 models",
  27631. "description": "Experimental v2 model routes."
  27632. },
  27633. {
  27634. "name": "v2 providers",
  27635. "description": "Experimental v2 provider routes."
  27636. },
  27637. {
  27638. "name": "v2 permissions",
  27639. "description": "Experimental v2 permission routes."
  27640. },
  27641. {
  27642. "name": "v2 session permissions",
  27643. "description": "Experimental v2 session permission routes."
  27644. },
  27645. {
  27646. "name": "v2 saved permissions",
  27647. "description": "Experimental v2 saved permission routes."
  27648. },
  27649. {
  27650. "name": "v2 filesystem",
  27651. "description": "Experimental v2 location-scoped filesystem routes."
  27652. },
  27653. {
  27654. "name": "v2 commands",
  27655. "description": "Experimental v2 command routes."
  27656. },
  27657. {
  27658. "name": "v2 skills",
  27659. "description": "Experimental v2 skill routes."
  27660. },
  27661. {
  27662. "name": "v2 events",
  27663. "description": "Experimental v2 event stream route."
  27664. },
  27665. {
  27666. "name": "v2 questions",
  27667. "description": "Experimental v2 question routes."
  27668. },
  27669. {
  27670. "name": "v2 session questions",
  27671. "description": "Experimental v2 session question routes."
  27672. },
  27673. {
  27674. "name": "pty",
  27675. "description": "PTY websocket route."
  27676. }
  27677. ]
  27678. }