openapi.json 492 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144
  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": "Bad request",
  37. "content": {
  38. "application/json": {
  39. "schema": {
  40. "$ref": "#/components/schemas/BadRequestError"
  41. }
  42. }
  43. }
  44. }
  45. },
  46. "description": "Set authentication credentials",
  47. "summary": "Set auth credentials",
  48. "requestBody": {
  49. "content": {
  50. "application/json": {
  51. "schema": {
  52. "$ref": "#/components/schemas/Auth"
  53. }
  54. }
  55. }
  56. },
  57. "x-codeSamples": [
  58. {
  59. "lang": "js",
  60. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.auth.set({\n ...\n})"
  61. }
  62. ]
  63. },
  64. "delete": {
  65. "tags": ["control"],
  66. "operationId": "auth.remove",
  67. "parameters": [
  68. {
  69. "name": "providerID",
  70. "in": "path",
  71. "schema": {
  72. "type": "string"
  73. },
  74. "required": true
  75. }
  76. ],
  77. "responses": {
  78. "200": {
  79. "description": "Successfully removed authentication credentials",
  80. "content": {
  81. "application/json": {
  82. "schema": {
  83. "type": "boolean",
  84. "description": "Successfully removed authentication credentials"
  85. }
  86. }
  87. }
  88. },
  89. "400": {
  90. "description": "Bad request",
  91. "content": {
  92. "application/json": {
  93. "schema": {
  94. "$ref": "#/components/schemas/BadRequestError"
  95. }
  96. }
  97. }
  98. }
  99. },
  100. "description": "Remove authentication credentials",
  101. "summary": "Remove auth credentials",
  102. "x-codeSamples": [
  103. {
  104. "lang": "js",
  105. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.auth.remove({\n ...\n})"
  106. }
  107. ]
  108. }
  109. },
  110. "/log": {
  111. "post": {
  112. "tags": ["control"],
  113. "operationId": "app.log",
  114. "parameters": [
  115. {
  116. "name": "directory",
  117. "in": "query",
  118. "required": false,
  119. "schema": {
  120. "type": "string"
  121. }
  122. },
  123. {
  124. "name": "workspace",
  125. "in": "query",
  126. "required": false,
  127. "schema": {
  128. "type": "string"
  129. }
  130. }
  131. ],
  132. "responses": {
  133. "200": {
  134. "description": "Log entry written successfully",
  135. "content": {
  136. "application/json": {
  137. "schema": {
  138. "type": "boolean",
  139. "description": "Log entry written successfully"
  140. }
  141. }
  142. }
  143. },
  144. "400": {
  145. "description": "Bad request",
  146. "content": {
  147. "application/json": {
  148. "schema": {
  149. "$ref": "#/components/schemas/BadRequestError"
  150. }
  151. }
  152. }
  153. }
  154. },
  155. "description": "Write a log entry to the server logs with specified level and metadata.",
  156. "summary": "Write log",
  157. "requestBody": {
  158. "content": {
  159. "application/json": {
  160. "schema": {
  161. "type": "object",
  162. "properties": {
  163. "service": {
  164. "type": "string",
  165. "description": "Service name for the log entry"
  166. },
  167. "level": {
  168. "type": "string",
  169. "enum": ["debug", "info", "error", "warn"],
  170. "description": "Log level"
  171. },
  172. "message": {
  173. "type": "string",
  174. "description": "Log message"
  175. },
  176. "extra": {
  177. "type": "object"
  178. }
  179. },
  180. "required": ["service", "level", "message"],
  181. "additionalProperties": false
  182. }
  183. }
  184. }
  185. },
  186. "x-codeSamples": [
  187. {
  188. "lang": "js",
  189. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.app.log({\n ...\n})"
  190. }
  191. ]
  192. }
  193. },
  194. "/global/health": {
  195. "get": {
  196. "tags": ["global"],
  197. "operationId": "global.health",
  198. "parameters": [],
  199. "responses": {
  200. "200": {
  201. "description": "Health information",
  202. "content": {
  203. "application/json": {
  204. "schema": {
  205. "type": "object",
  206. "properties": {
  207. "healthy": {
  208. "type": "boolean",
  209. "enum": [true]
  210. },
  211. "version": {
  212. "type": "string"
  213. }
  214. },
  215. "required": ["healthy", "version"],
  216. "additionalProperties": false,
  217. "description": "Health information"
  218. }
  219. }
  220. }
  221. }
  222. },
  223. "description": "Get health information about the OpenCode server.",
  224. "summary": "Get health",
  225. "x-codeSamples": [
  226. {
  227. "lang": "js",
  228. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.health({\n ...\n})"
  229. }
  230. ]
  231. }
  232. },
  233. "/global/event": {
  234. "get": {
  235. "tags": ["global"],
  236. "operationId": "global.event",
  237. "parameters": [],
  238. "responses": {
  239. "200": {
  240. "description": "Event stream",
  241. "content": {
  242. "text/event-stream": {
  243. "schema": {
  244. "$ref": "#/components/schemas/GlobalEvent"
  245. }
  246. }
  247. }
  248. }
  249. },
  250. "description": "Subscribe to global events from the OpenCode system using server-sent events.",
  251. "summary": "Get global events",
  252. "x-codeSamples": [
  253. {
  254. "lang": "js",
  255. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.event({\n ...\n})"
  256. }
  257. ]
  258. }
  259. },
  260. "/global/config": {
  261. "get": {
  262. "tags": ["global"],
  263. "operationId": "global.config.get",
  264. "parameters": [],
  265. "responses": {
  266. "200": {
  267. "description": "Get global config info",
  268. "content": {
  269. "application/json": {
  270. "schema": {
  271. "$ref": "#/components/schemas/Config"
  272. }
  273. }
  274. }
  275. }
  276. },
  277. "description": "Retrieve the current global OpenCode configuration settings and preferences.",
  278. "summary": "Get global configuration",
  279. "x-codeSamples": [
  280. {
  281. "lang": "js",
  282. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.config.get({\n ...\n})"
  283. }
  284. ]
  285. },
  286. "patch": {
  287. "tags": ["global"],
  288. "operationId": "global.config.update",
  289. "parameters": [],
  290. "responses": {
  291. "200": {
  292. "description": "Successfully updated global config",
  293. "content": {
  294. "application/json": {
  295. "schema": {
  296. "$ref": "#/components/schemas/Config"
  297. }
  298. }
  299. }
  300. },
  301. "400": {
  302. "description": "Bad request",
  303. "content": {
  304. "application/json": {
  305. "schema": {
  306. "$ref": "#/components/schemas/BadRequestError"
  307. }
  308. }
  309. }
  310. }
  311. },
  312. "description": "Update global OpenCode configuration settings and preferences.",
  313. "summary": "Update global configuration",
  314. "requestBody": {
  315. "content": {
  316. "application/json": {
  317. "schema": {
  318. "$ref": "#/components/schemas/Config"
  319. }
  320. }
  321. }
  322. },
  323. "x-codeSamples": [
  324. {
  325. "lang": "js",
  326. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.config.update({\n ...\n})"
  327. }
  328. ]
  329. }
  330. },
  331. "/global/dispose": {
  332. "post": {
  333. "tags": ["global"],
  334. "operationId": "global.dispose",
  335. "parameters": [],
  336. "responses": {
  337. "200": {
  338. "description": "Global disposed",
  339. "content": {
  340. "application/json": {
  341. "schema": {
  342. "type": "boolean",
  343. "description": "Global disposed"
  344. }
  345. }
  346. }
  347. }
  348. },
  349. "description": "Clean up and dispose all OpenCode instances, releasing all resources.",
  350. "summary": "Dispose instance",
  351. "x-codeSamples": [
  352. {
  353. "lang": "js",
  354. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.dispose({\n ...\n})"
  355. }
  356. ]
  357. }
  358. },
  359. "/global/upgrade": {
  360. "post": {
  361. "tags": ["global"],
  362. "operationId": "global.upgrade",
  363. "parameters": [],
  364. "responses": {
  365. "200": {
  366. "description": "Upgrade result",
  367. "content": {
  368. "application/json": {
  369. "schema": {
  370. "anyOf": [
  371. {
  372. "type": "object",
  373. "properties": {
  374. "success": {
  375. "type": "boolean",
  376. "enum": [true]
  377. },
  378. "version": {
  379. "type": "string"
  380. }
  381. },
  382. "required": ["success", "version"],
  383. "additionalProperties": false
  384. },
  385. {
  386. "type": "object",
  387. "properties": {
  388. "success": {
  389. "type": "boolean",
  390. "enum": [false]
  391. },
  392. "error": {
  393. "type": "string"
  394. }
  395. },
  396. "required": ["success", "error"],
  397. "additionalProperties": false
  398. }
  399. ],
  400. "description": "Upgrade result"
  401. }
  402. }
  403. }
  404. },
  405. "400": {
  406. "description": "Bad request",
  407. "content": {
  408. "application/json": {
  409. "schema": {
  410. "$ref": "#/components/schemas/BadRequestError"
  411. }
  412. }
  413. }
  414. }
  415. },
  416. "description": "Upgrade opencode to the specified version or latest if not specified.",
  417. "summary": "Upgrade opencode",
  418. "requestBody": {
  419. "content": {
  420. "application/json": {
  421. "schema": {
  422. "type": "object",
  423. "properties": {
  424. "target": {
  425. "type": "string"
  426. }
  427. },
  428. "additionalProperties": false
  429. }
  430. }
  431. }
  432. },
  433. "x-codeSamples": [
  434. {
  435. "lang": "js",
  436. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.upgrade({\n ...\n})"
  437. }
  438. ]
  439. }
  440. },
  441. "/event": {
  442. "get": {
  443. "tags": ["event"],
  444. "operationId": "event.subscribe",
  445. "parameters": [
  446. {
  447. "name": "directory",
  448. "in": "query",
  449. "required": false,
  450. "schema": {
  451. "type": "string"
  452. }
  453. },
  454. {
  455. "name": "workspace",
  456. "in": "query",
  457. "required": false,
  458. "schema": {
  459. "type": "string"
  460. }
  461. }
  462. ],
  463. "responses": {
  464. "200": {
  465. "description": "Event stream",
  466. "content": {
  467. "text/event-stream": {
  468. "schema": {
  469. "$ref": "#/components/schemas/Event"
  470. }
  471. }
  472. }
  473. }
  474. },
  475. "description": "Get events",
  476. "summary": "Subscribe to events",
  477. "x-codeSamples": [
  478. {
  479. "lang": "js",
  480. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.event.subscribe({\n ...\n})"
  481. }
  482. ]
  483. }
  484. },
  485. "/config": {
  486. "get": {
  487. "tags": ["config"],
  488. "operationId": "config.get",
  489. "parameters": [
  490. {
  491. "name": "directory",
  492. "in": "query",
  493. "required": false,
  494. "schema": {
  495. "type": "string"
  496. }
  497. },
  498. {
  499. "name": "workspace",
  500. "in": "query",
  501. "required": false,
  502. "schema": {
  503. "type": "string"
  504. }
  505. }
  506. ],
  507. "responses": {
  508. "200": {
  509. "description": "Get config info",
  510. "content": {
  511. "application/json": {
  512. "schema": {
  513. "$ref": "#/components/schemas/Config"
  514. }
  515. }
  516. }
  517. }
  518. },
  519. "description": "Retrieve the current OpenCode configuration settings and preferences.",
  520. "summary": "Get configuration",
  521. "x-codeSamples": [
  522. {
  523. "lang": "js",
  524. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.config.get({\n ...\n})"
  525. }
  526. ]
  527. },
  528. "patch": {
  529. "tags": ["config"],
  530. "operationId": "config.update",
  531. "parameters": [
  532. {
  533. "name": "directory",
  534. "in": "query",
  535. "required": false,
  536. "schema": {
  537. "type": "string"
  538. }
  539. },
  540. {
  541. "name": "workspace",
  542. "in": "query",
  543. "required": false,
  544. "schema": {
  545. "type": "string"
  546. }
  547. }
  548. ],
  549. "responses": {
  550. "200": {
  551. "description": "Successfully updated config",
  552. "content": {
  553. "application/json": {
  554. "schema": {
  555. "$ref": "#/components/schemas/Config"
  556. }
  557. }
  558. }
  559. },
  560. "400": {
  561. "description": "Bad request",
  562. "content": {
  563. "application/json": {
  564. "schema": {
  565. "$ref": "#/components/schemas/BadRequestError"
  566. }
  567. }
  568. }
  569. }
  570. },
  571. "description": "Update OpenCode configuration settings and preferences.",
  572. "summary": "Update configuration",
  573. "requestBody": {
  574. "content": {
  575. "application/json": {
  576. "schema": {
  577. "$ref": "#/components/schemas/Config"
  578. }
  579. }
  580. }
  581. },
  582. "x-codeSamples": [
  583. {
  584. "lang": "js",
  585. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.config.update({\n ...\n})"
  586. }
  587. ]
  588. }
  589. },
  590. "/config/providers": {
  591. "get": {
  592. "tags": ["config"],
  593. "operationId": "config.providers",
  594. "parameters": [
  595. {
  596. "name": "directory",
  597. "in": "query",
  598. "required": false,
  599. "schema": {
  600. "type": "string"
  601. }
  602. },
  603. {
  604. "name": "workspace",
  605. "in": "query",
  606. "required": false,
  607. "schema": {
  608. "type": "string"
  609. }
  610. }
  611. ],
  612. "responses": {
  613. "200": {
  614. "description": "List of providers",
  615. "content": {
  616. "application/json": {
  617. "schema": {
  618. "type": "object",
  619. "properties": {
  620. "providers": {
  621. "type": "array",
  622. "items": {
  623. "$ref": "#/components/schemas/Provider"
  624. }
  625. },
  626. "default": {
  627. "type": "object",
  628. "additionalProperties": {
  629. "type": "string"
  630. }
  631. }
  632. },
  633. "required": ["providers", "default"],
  634. "additionalProperties": false,
  635. "description": "List of providers"
  636. }
  637. }
  638. }
  639. }
  640. },
  641. "description": "Get a list of all configured AI providers and their default models.",
  642. "summary": "List config providers",
  643. "x-codeSamples": [
  644. {
  645. "lang": "js",
  646. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.config.providers({\n ...\n})"
  647. }
  648. ]
  649. }
  650. },
  651. "/experimental/console": {
  652. "get": {
  653. "tags": ["experimental"],
  654. "operationId": "experimental.console.get",
  655. "parameters": [
  656. {
  657. "name": "directory",
  658. "in": "query",
  659. "required": false,
  660. "schema": {
  661. "type": "string"
  662. }
  663. },
  664. {
  665. "name": "workspace",
  666. "in": "query",
  667. "required": false,
  668. "schema": {
  669. "type": "string"
  670. }
  671. }
  672. ],
  673. "responses": {
  674. "200": {
  675. "description": "Active Console provider metadata",
  676. "content": {
  677. "application/json": {
  678. "schema": {
  679. "$ref": "#/components/schemas/ConsoleState"
  680. }
  681. }
  682. }
  683. }
  684. },
  685. "description": "Get the active Console org name and the set of provider IDs managed by that Console org.",
  686. "summary": "Get active Console provider metadata",
  687. "x-codeSamples": [
  688. {
  689. "lang": "js",
  690. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.console.get({\n ...\n})"
  691. }
  692. ]
  693. }
  694. },
  695. "/experimental/console/orgs": {
  696. "get": {
  697. "tags": ["experimental"],
  698. "operationId": "experimental.console.listOrgs",
  699. "parameters": [
  700. {
  701. "name": "directory",
  702. "in": "query",
  703. "required": false,
  704. "schema": {
  705. "type": "string"
  706. }
  707. },
  708. {
  709. "name": "workspace",
  710. "in": "query",
  711. "required": false,
  712. "schema": {
  713. "type": "string"
  714. }
  715. }
  716. ],
  717. "responses": {
  718. "200": {
  719. "description": "Switchable Console orgs",
  720. "content": {
  721. "application/json": {
  722. "schema": {
  723. "type": "object",
  724. "properties": {
  725. "orgs": {
  726. "type": "array",
  727. "items": {
  728. "type": "object",
  729. "properties": {
  730. "accountID": {
  731. "type": "string"
  732. },
  733. "accountEmail": {
  734. "type": "string"
  735. },
  736. "accountUrl": {
  737. "type": "string"
  738. },
  739. "orgID": {
  740. "type": "string"
  741. },
  742. "orgName": {
  743. "type": "string"
  744. },
  745. "active": {
  746. "type": "boolean"
  747. }
  748. },
  749. "required": ["accountID", "accountEmail", "accountUrl", "orgID", "orgName", "active"],
  750. "additionalProperties": false
  751. }
  752. }
  753. },
  754. "required": ["orgs"],
  755. "additionalProperties": false,
  756. "description": "Switchable Console orgs"
  757. }
  758. }
  759. }
  760. }
  761. },
  762. "description": "Get the available Console orgs across logged-in accounts, including the current active org.",
  763. "summary": "List switchable Console orgs",
  764. "x-codeSamples": [
  765. {
  766. "lang": "js",
  767. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.console.listOrgs({\n ...\n})"
  768. }
  769. ]
  770. }
  771. },
  772. "/experimental/console/switch": {
  773. "post": {
  774. "tags": ["experimental"],
  775. "operationId": "experimental.console.switchOrg",
  776. "parameters": [
  777. {
  778. "name": "directory",
  779. "in": "query",
  780. "required": false,
  781. "schema": {
  782. "type": "string"
  783. }
  784. },
  785. {
  786. "name": "workspace",
  787. "in": "query",
  788. "required": false,
  789. "schema": {
  790. "type": "string"
  791. }
  792. }
  793. ],
  794. "responses": {
  795. "200": {
  796. "description": "Switch success",
  797. "content": {
  798. "application/json": {
  799. "schema": {
  800. "type": "boolean",
  801. "description": "Switch success"
  802. }
  803. }
  804. }
  805. }
  806. },
  807. "description": "Persist a new active Console account/org selection for the current local OpenCode state.",
  808. "summary": "Switch active Console org",
  809. "requestBody": {
  810. "content": {
  811. "application/json": {
  812. "schema": {
  813. "type": "object",
  814. "properties": {
  815. "accountID": {
  816. "type": "string"
  817. },
  818. "orgID": {
  819. "type": "string"
  820. }
  821. },
  822. "required": ["accountID", "orgID"],
  823. "additionalProperties": false
  824. }
  825. }
  826. }
  827. },
  828. "x-codeSamples": [
  829. {
  830. "lang": "js",
  831. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.console.switchOrg({\n ...\n})"
  832. }
  833. ]
  834. }
  835. },
  836. "/experimental/tool": {
  837. "get": {
  838. "tags": ["experimental"],
  839. "operationId": "tool.list",
  840. "parameters": [
  841. {
  842. "name": "directory",
  843. "in": "query",
  844. "required": false,
  845. "schema": {
  846. "type": "string"
  847. }
  848. },
  849. {
  850. "name": "workspace",
  851. "in": "query",
  852. "required": false,
  853. "schema": {
  854. "type": "string"
  855. }
  856. },
  857. {
  858. "name": "provider",
  859. "in": "query",
  860. "schema": {
  861. "type": "string"
  862. },
  863. "required": true
  864. },
  865. {
  866. "name": "model",
  867. "in": "query",
  868. "schema": {
  869. "type": "string"
  870. },
  871. "required": true
  872. }
  873. ],
  874. "responses": {
  875. "200": {
  876. "description": "Tools",
  877. "content": {
  878. "application/json": {
  879. "schema": {
  880. "$ref": "#/components/schemas/ToolList"
  881. }
  882. }
  883. }
  884. },
  885. "400": {
  886. "description": "Bad request",
  887. "content": {
  888. "application/json": {
  889. "schema": {
  890. "$ref": "#/components/schemas/BadRequestError"
  891. }
  892. }
  893. }
  894. }
  895. },
  896. "description": "Get a list of available tools with their JSON schema parameters for a specific provider and model combination.",
  897. "summary": "List tools",
  898. "x-codeSamples": [
  899. {
  900. "lang": "js",
  901. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tool.list({\n ...\n})"
  902. }
  903. ]
  904. }
  905. },
  906. "/experimental/tool/ids": {
  907. "get": {
  908. "tags": ["experimental"],
  909. "operationId": "tool.ids",
  910. "parameters": [
  911. {
  912. "name": "directory",
  913. "in": "query",
  914. "required": false,
  915. "schema": {
  916. "type": "string"
  917. }
  918. },
  919. {
  920. "name": "workspace",
  921. "in": "query",
  922. "required": false,
  923. "schema": {
  924. "type": "string"
  925. }
  926. }
  927. ],
  928. "responses": {
  929. "200": {
  930. "description": "Tool IDs",
  931. "content": {
  932. "application/json": {
  933. "schema": {
  934. "$ref": "#/components/schemas/ToolIDs"
  935. }
  936. }
  937. }
  938. },
  939. "400": {
  940. "description": "Bad request",
  941. "content": {
  942. "application/json": {
  943. "schema": {
  944. "$ref": "#/components/schemas/BadRequestError"
  945. }
  946. }
  947. }
  948. }
  949. },
  950. "description": "Get a list of all available tool IDs, including both built-in tools and dynamically registered tools.",
  951. "summary": "List tool IDs",
  952. "x-codeSamples": [
  953. {
  954. "lang": "js",
  955. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tool.ids({\n ...\n})"
  956. }
  957. ]
  958. }
  959. },
  960. "/experimental/worktree": {
  961. "get": {
  962. "tags": ["experimental"],
  963. "operationId": "worktree.list",
  964. "parameters": [
  965. {
  966. "name": "directory",
  967. "in": "query",
  968. "required": false,
  969. "schema": {
  970. "type": "string"
  971. }
  972. },
  973. {
  974. "name": "workspace",
  975. "in": "query",
  976. "required": false,
  977. "schema": {
  978. "type": "string"
  979. }
  980. }
  981. ],
  982. "responses": {
  983. "200": {
  984. "description": "List of worktree directories",
  985. "content": {
  986. "application/json": {
  987. "schema": {
  988. "type": "array",
  989. "items": {
  990. "type": "string"
  991. },
  992. "description": "List of worktree directories"
  993. }
  994. }
  995. }
  996. }
  997. },
  998. "description": "List all sandbox worktrees for the current project.",
  999. "summary": "List worktrees",
  1000. "x-codeSamples": [
  1001. {
  1002. "lang": "js",
  1003. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.list({\n ...\n})"
  1004. }
  1005. ]
  1006. },
  1007. "post": {
  1008. "tags": ["experimental"],
  1009. "operationId": "worktree.create",
  1010. "parameters": [
  1011. {
  1012. "name": "directory",
  1013. "in": "query",
  1014. "required": false,
  1015. "schema": {
  1016. "type": "string"
  1017. }
  1018. },
  1019. {
  1020. "name": "workspace",
  1021. "in": "query",
  1022. "required": false,
  1023. "schema": {
  1024. "type": "string"
  1025. }
  1026. }
  1027. ],
  1028. "responses": {
  1029. "200": {
  1030. "description": "Worktree created",
  1031. "content": {
  1032. "application/json": {
  1033. "schema": {
  1034. "$ref": "#/components/schemas/Worktree"
  1035. }
  1036. }
  1037. }
  1038. },
  1039. "400": {
  1040. "description": "Bad request",
  1041. "content": {
  1042. "application/json": {
  1043. "schema": {
  1044. "$ref": "#/components/schemas/BadRequestError"
  1045. }
  1046. }
  1047. }
  1048. }
  1049. },
  1050. "description": "Create a new git worktree for the current project and run any configured startup scripts.",
  1051. "summary": "Create worktree",
  1052. "requestBody": {
  1053. "content": {
  1054. "application/json": {
  1055. "schema": {
  1056. "$ref": "#/components/schemas/WorktreeCreateInput"
  1057. }
  1058. }
  1059. }
  1060. },
  1061. "x-codeSamples": [
  1062. {
  1063. "lang": "js",
  1064. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.create({\n ...\n})"
  1065. }
  1066. ]
  1067. },
  1068. "delete": {
  1069. "tags": ["experimental"],
  1070. "operationId": "worktree.remove",
  1071. "parameters": [
  1072. {
  1073. "name": "directory",
  1074. "in": "query",
  1075. "required": false,
  1076. "schema": {
  1077. "type": "string"
  1078. }
  1079. },
  1080. {
  1081. "name": "workspace",
  1082. "in": "query",
  1083. "required": false,
  1084. "schema": {
  1085. "type": "string"
  1086. }
  1087. }
  1088. ],
  1089. "responses": {
  1090. "200": {
  1091. "description": "Worktree removed",
  1092. "content": {
  1093. "application/json": {
  1094. "schema": {
  1095. "type": "boolean",
  1096. "description": "Worktree removed"
  1097. }
  1098. }
  1099. }
  1100. },
  1101. "400": {
  1102. "description": "Bad request",
  1103. "content": {
  1104. "application/json": {
  1105. "schema": {
  1106. "$ref": "#/components/schemas/BadRequestError"
  1107. }
  1108. }
  1109. }
  1110. }
  1111. },
  1112. "description": "Remove a git worktree and delete its branch.",
  1113. "summary": "Remove worktree",
  1114. "requestBody": {
  1115. "content": {
  1116. "application/json": {
  1117. "schema": {
  1118. "$ref": "#/components/schemas/WorktreeRemoveInput"
  1119. }
  1120. }
  1121. }
  1122. },
  1123. "x-codeSamples": [
  1124. {
  1125. "lang": "js",
  1126. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.remove({\n ...\n})"
  1127. }
  1128. ]
  1129. }
  1130. },
  1131. "/experimental/worktree/reset": {
  1132. "post": {
  1133. "tags": ["experimental"],
  1134. "operationId": "worktree.reset",
  1135. "parameters": [
  1136. {
  1137. "name": "directory",
  1138. "in": "query",
  1139. "required": false,
  1140. "schema": {
  1141. "type": "string"
  1142. }
  1143. },
  1144. {
  1145. "name": "workspace",
  1146. "in": "query",
  1147. "required": false,
  1148. "schema": {
  1149. "type": "string"
  1150. }
  1151. }
  1152. ],
  1153. "responses": {
  1154. "200": {
  1155. "description": "Worktree reset",
  1156. "content": {
  1157. "application/json": {
  1158. "schema": {
  1159. "type": "boolean",
  1160. "description": "Worktree reset"
  1161. }
  1162. }
  1163. }
  1164. },
  1165. "400": {
  1166. "description": "Bad request",
  1167. "content": {
  1168. "application/json": {
  1169. "schema": {
  1170. "$ref": "#/components/schemas/BadRequestError"
  1171. }
  1172. }
  1173. }
  1174. }
  1175. },
  1176. "description": "Reset a worktree branch to the primary default branch.",
  1177. "summary": "Reset worktree",
  1178. "requestBody": {
  1179. "content": {
  1180. "application/json": {
  1181. "schema": {
  1182. "$ref": "#/components/schemas/WorktreeResetInput"
  1183. }
  1184. }
  1185. }
  1186. },
  1187. "x-codeSamples": [
  1188. {
  1189. "lang": "js",
  1190. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.reset({\n ...\n})"
  1191. }
  1192. ]
  1193. }
  1194. },
  1195. "/experimental/session": {
  1196. "get": {
  1197. "tags": ["experimental"],
  1198. "operationId": "experimental.session.list",
  1199. "parameters": [
  1200. {
  1201. "name": "directory",
  1202. "in": "query",
  1203. "required": false,
  1204. "schema": {
  1205. "type": "string"
  1206. }
  1207. },
  1208. {
  1209. "name": "workspace",
  1210. "in": "query",
  1211. "required": false,
  1212. "schema": {
  1213. "type": "string"
  1214. }
  1215. },
  1216. {
  1217. "name": "roots",
  1218. "in": "query",
  1219. "schema": {
  1220. "anyOf": [
  1221. {
  1222. "type": "boolean"
  1223. },
  1224. {
  1225. "type": "string",
  1226. "enum": ["true", "false"]
  1227. }
  1228. ]
  1229. },
  1230. "required": false
  1231. },
  1232. {
  1233. "name": "start",
  1234. "in": "query",
  1235. "schema": {
  1236. "type": "number"
  1237. },
  1238. "required": false
  1239. },
  1240. {
  1241. "name": "cursor",
  1242. "in": "query",
  1243. "schema": {
  1244. "type": "number"
  1245. },
  1246. "required": false
  1247. },
  1248. {
  1249. "name": "search",
  1250. "in": "query",
  1251. "schema": {
  1252. "type": "string"
  1253. },
  1254. "required": false
  1255. },
  1256. {
  1257. "name": "limit",
  1258. "in": "query",
  1259. "schema": {
  1260. "type": "number"
  1261. },
  1262. "required": false
  1263. },
  1264. {
  1265. "name": "archived",
  1266. "in": "query",
  1267. "schema": {
  1268. "anyOf": [
  1269. {
  1270. "type": "boolean"
  1271. },
  1272. {
  1273. "type": "string",
  1274. "enum": ["true", "false"]
  1275. }
  1276. ]
  1277. },
  1278. "required": false
  1279. }
  1280. ],
  1281. "responses": {
  1282. "200": {
  1283. "description": "List of sessions",
  1284. "content": {
  1285. "application/json": {
  1286. "schema": {
  1287. "type": "array",
  1288. "items": {
  1289. "$ref": "#/components/schemas/GlobalSession"
  1290. },
  1291. "description": "List of sessions"
  1292. }
  1293. }
  1294. }
  1295. }
  1296. },
  1297. "description": "Get a list of all OpenCode sessions across projects, sorted by most recently updated. Archived sessions are excluded by default.",
  1298. "summary": "List sessions",
  1299. "x-codeSamples": [
  1300. {
  1301. "lang": "js",
  1302. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.session.list({\n ...\n})"
  1303. }
  1304. ]
  1305. }
  1306. },
  1307. "/experimental/resource": {
  1308. "get": {
  1309. "tags": ["experimental"],
  1310. "operationId": "experimental.resource.list",
  1311. "parameters": [
  1312. {
  1313. "name": "directory",
  1314. "in": "query",
  1315. "required": false,
  1316. "schema": {
  1317. "type": "string"
  1318. }
  1319. },
  1320. {
  1321. "name": "workspace",
  1322. "in": "query",
  1323. "required": false,
  1324. "schema": {
  1325. "type": "string"
  1326. }
  1327. }
  1328. ],
  1329. "responses": {
  1330. "200": {
  1331. "description": "MCP resources",
  1332. "content": {
  1333. "application/json": {
  1334. "schema": {
  1335. "type": "object",
  1336. "additionalProperties": {
  1337. "$ref": "#/components/schemas/McpResource"
  1338. },
  1339. "description": "MCP resources"
  1340. }
  1341. }
  1342. }
  1343. }
  1344. },
  1345. "description": "Get all available MCP resources from connected servers. Optionally filter by name.",
  1346. "summary": "Get MCP resources",
  1347. "x-codeSamples": [
  1348. {
  1349. "lang": "js",
  1350. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.resource.list({\n ...\n})"
  1351. }
  1352. ]
  1353. }
  1354. },
  1355. "/find": {
  1356. "get": {
  1357. "tags": ["file"],
  1358. "operationId": "find.text",
  1359. "parameters": [
  1360. {
  1361. "name": "directory",
  1362. "in": "query",
  1363. "required": false,
  1364. "schema": {
  1365. "type": "string"
  1366. }
  1367. },
  1368. {
  1369. "name": "workspace",
  1370. "in": "query",
  1371. "required": false,
  1372. "schema": {
  1373. "type": "string"
  1374. }
  1375. },
  1376. {
  1377. "name": "pattern",
  1378. "in": "query",
  1379. "schema": {
  1380. "type": "string"
  1381. },
  1382. "required": true
  1383. }
  1384. ],
  1385. "responses": {
  1386. "200": {
  1387. "description": "Matches",
  1388. "content": {
  1389. "application/json": {
  1390. "schema": {
  1391. "type": "array",
  1392. "items": {
  1393. "type": "object",
  1394. "properties": {
  1395. "path": {
  1396. "type": "object",
  1397. "properties": {
  1398. "text": {
  1399. "type": "string"
  1400. }
  1401. },
  1402. "required": ["text"],
  1403. "additionalProperties": false
  1404. },
  1405. "lines": {
  1406. "type": "object",
  1407. "properties": {
  1408. "text": {
  1409. "type": "string"
  1410. }
  1411. },
  1412. "required": ["text"],
  1413. "additionalProperties": false
  1414. },
  1415. "line_number": {
  1416. "type": "integer",
  1417. "minimum": 0
  1418. },
  1419. "absolute_offset": {
  1420. "type": "integer",
  1421. "minimum": 0
  1422. },
  1423. "submatches": {
  1424. "type": "array",
  1425. "items": {
  1426. "type": "object",
  1427. "properties": {
  1428. "match": {
  1429. "type": "object",
  1430. "properties": {
  1431. "text": {
  1432. "type": "string"
  1433. }
  1434. },
  1435. "required": ["text"],
  1436. "additionalProperties": false
  1437. },
  1438. "start": {
  1439. "type": "integer",
  1440. "minimum": 0
  1441. },
  1442. "end": {
  1443. "type": "integer",
  1444. "minimum": 0
  1445. }
  1446. },
  1447. "required": ["match", "start", "end"],
  1448. "additionalProperties": false
  1449. }
  1450. }
  1451. },
  1452. "required": ["path", "lines", "line_number", "absolute_offset", "submatches"],
  1453. "additionalProperties": false
  1454. },
  1455. "description": "Matches"
  1456. }
  1457. }
  1458. }
  1459. }
  1460. },
  1461. "description": "Search for text patterns across files in the project using ripgrep.",
  1462. "summary": "Find text",
  1463. "x-codeSamples": [
  1464. {
  1465. "lang": "js",
  1466. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.find.text({\n ...\n})"
  1467. }
  1468. ]
  1469. }
  1470. },
  1471. "/find/file": {
  1472. "get": {
  1473. "tags": ["file"],
  1474. "operationId": "find.files",
  1475. "parameters": [
  1476. {
  1477. "name": "directory",
  1478. "in": "query",
  1479. "required": false,
  1480. "schema": {
  1481. "type": "string"
  1482. }
  1483. },
  1484. {
  1485. "name": "workspace",
  1486. "in": "query",
  1487. "required": false,
  1488. "schema": {
  1489. "type": "string"
  1490. }
  1491. },
  1492. {
  1493. "name": "query",
  1494. "in": "query",
  1495. "schema": {
  1496. "type": "string"
  1497. },
  1498. "required": true
  1499. },
  1500. {
  1501. "name": "dirs",
  1502. "in": "query",
  1503. "schema": {
  1504. "type": "string",
  1505. "enum": ["true", "false"]
  1506. },
  1507. "required": false
  1508. },
  1509. {
  1510. "name": "type",
  1511. "in": "query",
  1512. "schema": {
  1513. "type": "string",
  1514. "enum": ["file", "directory"]
  1515. },
  1516. "required": false
  1517. },
  1518. {
  1519. "name": "limit",
  1520. "in": "query",
  1521. "schema": {
  1522. "type": "integer",
  1523. "minimum": 1,
  1524. "maximum": 200
  1525. },
  1526. "required": false
  1527. }
  1528. ],
  1529. "responses": {
  1530. "200": {
  1531. "description": "File paths",
  1532. "content": {
  1533. "application/json": {
  1534. "schema": {
  1535. "type": "array",
  1536. "items": {
  1537. "type": "string"
  1538. },
  1539. "description": "File paths"
  1540. }
  1541. }
  1542. }
  1543. }
  1544. },
  1545. "description": "Search for files or directories by name or pattern in the project directory.",
  1546. "summary": "Find files",
  1547. "x-codeSamples": [
  1548. {
  1549. "lang": "js",
  1550. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.find.files({\n ...\n})"
  1551. }
  1552. ]
  1553. }
  1554. },
  1555. "/find/symbol": {
  1556. "get": {
  1557. "tags": ["file"],
  1558. "operationId": "find.symbols",
  1559. "parameters": [
  1560. {
  1561. "name": "directory",
  1562. "in": "query",
  1563. "required": false,
  1564. "schema": {
  1565. "type": "string"
  1566. }
  1567. },
  1568. {
  1569. "name": "workspace",
  1570. "in": "query",
  1571. "required": false,
  1572. "schema": {
  1573. "type": "string"
  1574. }
  1575. },
  1576. {
  1577. "name": "query",
  1578. "in": "query",
  1579. "schema": {
  1580. "type": "string"
  1581. },
  1582. "required": true
  1583. }
  1584. ],
  1585. "responses": {
  1586. "200": {
  1587. "description": "Symbols",
  1588. "content": {
  1589. "application/json": {
  1590. "schema": {
  1591. "type": "array",
  1592. "items": {
  1593. "$ref": "#/components/schemas/Symbol"
  1594. },
  1595. "description": "Symbols"
  1596. }
  1597. }
  1598. }
  1599. }
  1600. },
  1601. "description": "Search for workspace symbols like functions, classes, and variables using LSP.",
  1602. "summary": "Find symbols",
  1603. "x-codeSamples": [
  1604. {
  1605. "lang": "js",
  1606. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.find.symbols({\n ...\n})"
  1607. }
  1608. ]
  1609. }
  1610. },
  1611. "/file": {
  1612. "get": {
  1613. "tags": ["file"],
  1614. "operationId": "file.list",
  1615. "parameters": [
  1616. {
  1617. "name": "directory",
  1618. "in": "query",
  1619. "required": false,
  1620. "schema": {
  1621. "type": "string"
  1622. }
  1623. },
  1624. {
  1625. "name": "workspace",
  1626. "in": "query",
  1627. "required": false,
  1628. "schema": {
  1629. "type": "string"
  1630. }
  1631. },
  1632. {
  1633. "name": "path",
  1634. "in": "query",
  1635. "schema": {
  1636. "type": "string"
  1637. },
  1638. "required": true
  1639. }
  1640. ],
  1641. "responses": {
  1642. "200": {
  1643. "description": "Files and directories",
  1644. "content": {
  1645. "application/json": {
  1646. "schema": {
  1647. "type": "array",
  1648. "items": {
  1649. "$ref": "#/components/schemas/FileNode"
  1650. },
  1651. "description": "Files and directories"
  1652. }
  1653. }
  1654. }
  1655. }
  1656. },
  1657. "description": "List files and directories in a specified path.",
  1658. "summary": "List files",
  1659. "x-codeSamples": [
  1660. {
  1661. "lang": "js",
  1662. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.file.list({\n ...\n})"
  1663. }
  1664. ]
  1665. }
  1666. },
  1667. "/file/content": {
  1668. "get": {
  1669. "tags": ["file"],
  1670. "operationId": "file.read",
  1671. "parameters": [
  1672. {
  1673. "name": "directory",
  1674. "in": "query",
  1675. "required": false,
  1676. "schema": {
  1677. "type": "string"
  1678. }
  1679. },
  1680. {
  1681. "name": "workspace",
  1682. "in": "query",
  1683. "required": false,
  1684. "schema": {
  1685. "type": "string"
  1686. }
  1687. },
  1688. {
  1689. "name": "path",
  1690. "in": "query",
  1691. "schema": {
  1692. "type": "string"
  1693. },
  1694. "required": true
  1695. }
  1696. ],
  1697. "responses": {
  1698. "200": {
  1699. "description": "File content",
  1700. "content": {
  1701. "application/json": {
  1702. "schema": {
  1703. "$ref": "#/components/schemas/FileContent"
  1704. }
  1705. }
  1706. }
  1707. }
  1708. },
  1709. "description": "Read the content of a specified file.",
  1710. "summary": "Read file",
  1711. "x-codeSamples": [
  1712. {
  1713. "lang": "js",
  1714. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.file.read({\n ...\n})"
  1715. }
  1716. ]
  1717. }
  1718. },
  1719. "/file/status": {
  1720. "get": {
  1721. "tags": ["file"],
  1722. "operationId": "file.status",
  1723. "parameters": [
  1724. {
  1725. "name": "directory",
  1726. "in": "query",
  1727. "required": false,
  1728. "schema": {
  1729. "type": "string"
  1730. }
  1731. },
  1732. {
  1733. "name": "workspace",
  1734. "in": "query",
  1735. "required": false,
  1736. "schema": {
  1737. "type": "string"
  1738. }
  1739. }
  1740. ],
  1741. "responses": {
  1742. "200": {
  1743. "description": "File status",
  1744. "content": {
  1745. "application/json": {
  1746. "schema": {
  1747. "type": "array",
  1748. "items": {
  1749. "$ref": "#/components/schemas/File"
  1750. },
  1751. "description": "File status"
  1752. }
  1753. }
  1754. }
  1755. }
  1756. },
  1757. "description": "Get the git status of all files in the project.",
  1758. "summary": "Get file status",
  1759. "x-codeSamples": [
  1760. {
  1761. "lang": "js",
  1762. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.file.status({\n ...\n})"
  1763. }
  1764. ]
  1765. }
  1766. },
  1767. "/instance/dispose": {
  1768. "post": {
  1769. "tags": ["instance"],
  1770. "operationId": "instance.dispose",
  1771. "parameters": [
  1772. {
  1773. "name": "directory",
  1774. "in": "query",
  1775. "required": false,
  1776. "schema": {
  1777. "type": "string"
  1778. }
  1779. },
  1780. {
  1781. "name": "workspace",
  1782. "in": "query",
  1783. "required": false,
  1784. "schema": {
  1785. "type": "string"
  1786. }
  1787. }
  1788. ],
  1789. "responses": {
  1790. "200": {
  1791. "description": "Instance disposed",
  1792. "content": {
  1793. "application/json": {
  1794. "schema": {
  1795. "type": "boolean",
  1796. "description": "Instance disposed"
  1797. }
  1798. }
  1799. }
  1800. }
  1801. },
  1802. "description": "Clean up and dispose the current OpenCode instance, releasing all resources.",
  1803. "summary": "Dispose instance",
  1804. "x-codeSamples": [
  1805. {
  1806. "lang": "js",
  1807. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.instance.dispose({\n ...\n})"
  1808. }
  1809. ]
  1810. }
  1811. },
  1812. "/path": {
  1813. "get": {
  1814. "tags": ["instance"],
  1815. "operationId": "path.get",
  1816. "parameters": [
  1817. {
  1818. "name": "directory",
  1819. "in": "query",
  1820. "required": false,
  1821. "schema": {
  1822. "type": "string"
  1823. }
  1824. },
  1825. {
  1826. "name": "workspace",
  1827. "in": "query",
  1828. "required": false,
  1829. "schema": {
  1830. "type": "string"
  1831. }
  1832. }
  1833. ],
  1834. "responses": {
  1835. "200": {
  1836. "description": "Path",
  1837. "content": {
  1838. "application/json": {
  1839. "schema": {
  1840. "$ref": "#/components/schemas/Path"
  1841. }
  1842. }
  1843. }
  1844. }
  1845. },
  1846. "description": "Retrieve the current working directory and related path information for the OpenCode instance.",
  1847. "summary": "Get paths",
  1848. "x-codeSamples": [
  1849. {
  1850. "lang": "js",
  1851. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.path.get({\n ...\n})"
  1852. }
  1853. ]
  1854. }
  1855. },
  1856. "/vcs": {
  1857. "get": {
  1858. "tags": ["instance"],
  1859. "operationId": "vcs.get",
  1860. "parameters": [
  1861. {
  1862. "name": "directory",
  1863. "in": "query",
  1864. "required": false,
  1865. "schema": {
  1866. "type": "string"
  1867. }
  1868. },
  1869. {
  1870. "name": "workspace",
  1871. "in": "query",
  1872. "required": false,
  1873. "schema": {
  1874. "type": "string"
  1875. }
  1876. }
  1877. ],
  1878. "responses": {
  1879. "200": {
  1880. "description": "VCS info",
  1881. "content": {
  1882. "application/json": {
  1883. "schema": {
  1884. "$ref": "#/components/schemas/VcsInfo"
  1885. }
  1886. }
  1887. }
  1888. }
  1889. },
  1890. "description": "Retrieve version control system (VCS) information for the current project, such as git branch.",
  1891. "summary": "Get VCS info",
  1892. "x-codeSamples": [
  1893. {
  1894. "lang": "js",
  1895. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.vcs.get({\n ...\n})"
  1896. }
  1897. ]
  1898. }
  1899. },
  1900. "/vcs/diff": {
  1901. "get": {
  1902. "tags": ["instance"],
  1903. "operationId": "vcs.diff",
  1904. "parameters": [
  1905. {
  1906. "name": "directory",
  1907. "in": "query",
  1908. "required": false,
  1909. "schema": {
  1910. "type": "string"
  1911. }
  1912. },
  1913. {
  1914. "name": "workspace",
  1915. "in": "query",
  1916. "required": false,
  1917. "schema": {
  1918. "type": "string"
  1919. }
  1920. },
  1921. {
  1922. "name": "mode",
  1923. "in": "query",
  1924. "schema": {
  1925. "type": "string",
  1926. "enum": ["git", "branch"]
  1927. },
  1928. "required": true
  1929. }
  1930. ],
  1931. "responses": {
  1932. "200": {
  1933. "description": "VCS diff",
  1934. "content": {
  1935. "application/json": {
  1936. "schema": {
  1937. "type": "array",
  1938. "items": {
  1939. "$ref": "#/components/schemas/VcsFileDiff"
  1940. },
  1941. "description": "VCS diff"
  1942. }
  1943. }
  1944. }
  1945. }
  1946. },
  1947. "description": "Retrieve the current git diff for the working tree or against the default branch.",
  1948. "summary": "Get VCS diff",
  1949. "x-codeSamples": [
  1950. {
  1951. "lang": "js",
  1952. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.vcs.diff({\n ...\n})"
  1953. }
  1954. ]
  1955. }
  1956. },
  1957. "/command": {
  1958. "get": {
  1959. "tags": ["instance"],
  1960. "operationId": "command.list",
  1961. "parameters": [
  1962. {
  1963. "name": "directory",
  1964. "in": "query",
  1965. "required": false,
  1966. "schema": {
  1967. "type": "string"
  1968. }
  1969. },
  1970. {
  1971. "name": "workspace",
  1972. "in": "query",
  1973. "required": false,
  1974. "schema": {
  1975. "type": "string"
  1976. }
  1977. }
  1978. ],
  1979. "responses": {
  1980. "200": {
  1981. "description": "List of commands",
  1982. "content": {
  1983. "application/json": {
  1984. "schema": {
  1985. "type": "array",
  1986. "items": {
  1987. "$ref": "#/components/schemas/Command"
  1988. },
  1989. "description": "List of commands"
  1990. }
  1991. }
  1992. }
  1993. }
  1994. },
  1995. "description": "Get a list of all available commands in the OpenCode system.",
  1996. "summary": "List commands",
  1997. "x-codeSamples": [
  1998. {
  1999. "lang": "js",
  2000. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.command.list({\n ...\n})"
  2001. }
  2002. ]
  2003. }
  2004. },
  2005. "/agent": {
  2006. "get": {
  2007. "tags": ["instance"],
  2008. "operationId": "app.agents",
  2009. "parameters": [
  2010. {
  2011. "name": "directory",
  2012. "in": "query",
  2013. "required": false,
  2014. "schema": {
  2015. "type": "string"
  2016. }
  2017. },
  2018. {
  2019. "name": "workspace",
  2020. "in": "query",
  2021. "required": false,
  2022. "schema": {
  2023. "type": "string"
  2024. }
  2025. }
  2026. ],
  2027. "responses": {
  2028. "200": {
  2029. "description": "List of agents",
  2030. "content": {
  2031. "application/json": {
  2032. "schema": {
  2033. "type": "array",
  2034. "items": {
  2035. "$ref": "#/components/schemas/Agent"
  2036. },
  2037. "description": "List of agents"
  2038. }
  2039. }
  2040. }
  2041. }
  2042. },
  2043. "description": "Get a list of all available AI agents in the OpenCode system.",
  2044. "summary": "List agents",
  2045. "x-codeSamples": [
  2046. {
  2047. "lang": "js",
  2048. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.app.agents({\n ...\n})"
  2049. }
  2050. ]
  2051. }
  2052. },
  2053. "/skill": {
  2054. "get": {
  2055. "tags": ["instance"],
  2056. "operationId": "app.skills",
  2057. "parameters": [
  2058. {
  2059. "name": "directory",
  2060. "in": "query",
  2061. "required": false,
  2062. "schema": {
  2063. "type": "string"
  2064. }
  2065. },
  2066. {
  2067. "name": "workspace",
  2068. "in": "query",
  2069. "required": false,
  2070. "schema": {
  2071. "type": "string"
  2072. }
  2073. }
  2074. ],
  2075. "responses": {
  2076. "200": {
  2077. "description": "List of skills",
  2078. "content": {
  2079. "application/json": {
  2080. "schema": {
  2081. "type": "array",
  2082. "items": {
  2083. "type": "object",
  2084. "properties": {
  2085. "name": {
  2086. "type": "string"
  2087. },
  2088. "description": {
  2089. "type": "string"
  2090. },
  2091. "location": {
  2092. "type": "string"
  2093. },
  2094. "content": {
  2095. "type": "string"
  2096. }
  2097. },
  2098. "required": ["name", "description", "location", "content"],
  2099. "additionalProperties": false
  2100. },
  2101. "description": "List of skills"
  2102. }
  2103. }
  2104. }
  2105. }
  2106. },
  2107. "description": "Get a list of all available skills in the OpenCode system.",
  2108. "summary": "List skills",
  2109. "x-codeSamples": [
  2110. {
  2111. "lang": "js",
  2112. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.app.skills({\n ...\n})"
  2113. }
  2114. ]
  2115. }
  2116. },
  2117. "/lsp": {
  2118. "get": {
  2119. "tags": ["instance"],
  2120. "operationId": "lsp.status",
  2121. "parameters": [
  2122. {
  2123. "name": "directory",
  2124. "in": "query",
  2125. "required": false,
  2126. "schema": {
  2127. "type": "string"
  2128. }
  2129. },
  2130. {
  2131. "name": "workspace",
  2132. "in": "query",
  2133. "required": false,
  2134. "schema": {
  2135. "type": "string"
  2136. }
  2137. }
  2138. ],
  2139. "responses": {
  2140. "200": {
  2141. "description": "LSP server status",
  2142. "content": {
  2143. "application/json": {
  2144. "schema": {
  2145. "type": "array",
  2146. "items": {
  2147. "$ref": "#/components/schemas/LSPStatus"
  2148. },
  2149. "description": "LSP server status"
  2150. }
  2151. }
  2152. }
  2153. }
  2154. },
  2155. "description": "Get LSP server status",
  2156. "summary": "Get LSP status",
  2157. "x-codeSamples": [
  2158. {
  2159. "lang": "js",
  2160. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.lsp.status({\n ...\n})"
  2161. }
  2162. ]
  2163. }
  2164. },
  2165. "/formatter": {
  2166. "get": {
  2167. "tags": ["instance"],
  2168. "operationId": "formatter.status",
  2169. "parameters": [
  2170. {
  2171. "name": "directory",
  2172. "in": "query",
  2173. "required": false,
  2174. "schema": {
  2175. "type": "string"
  2176. }
  2177. },
  2178. {
  2179. "name": "workspace",
  2180. "in": "query",
  2181. "required": false,
  2182. "schema": {
  2183. "type": "string"
  2184. }
  2185. }
  2186. ],
  2187. "responses": {
  2188. "200": {
  2189. "description": "Formatter status",
  2190. "content": {
  2191. "application/json": {
  2192. "schema": {
  2193. "type": "array",
  2194. "items": {
  2195. "$ref": "#/components/schemas/FormatterStatus"
  2196. },
  2197. "description": "Formatter status"
  2198. }
  2199. }
  2200. }
  2201. }
  2202. },
  2203. "description": "Get formatter status",
  2204. "summary": "Get formatter status",
  2205. "x-codeSamples": [
  2206. {
  2207. "lang": "js",
  2208. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.formatter.status({\n ...\n})"
  2209. }
  2210. ]
  2211. }
  2212. },
  2213. "/mcp": {
  2214. "get": {
  2215. "tags": ["mcp"],
  2216. "operationId": "mcp.status",
  2217. "parameters": [
  2218. {
  2219. "name": "directory",
  2220. "in": "query",
  2221. "required": false,
  2222. "schema": {
  2223. "type": "string"
  2224. }
  2225. },
  2226. {
  2227. "name": "workspace",
  2228. "in": "query",
  2229. "required": false,
  2230. "schema": {
  2231. "type": "string"
  2232. }
  2233. }
  2234. ],
  2235. "responses": {
  2236. "200": {
  2237. "description": "MCP server status",
  2238. "content": {
  2239. "application/json": {
  2240. "schema": {
  2241. "type": "object",
  2242. "additionalProperties": {
  2243. "$ref": "#/components/schemas/MCPStatus"
  2244. },
  2245. "description": "MCP server status"
  2246. }
  2247. }
  2248. }
  2249. }
  2250. },
  2251. "description": "Get the status of all Model Context Protocol (MCP) servers.",
  2252. "summary": "Get MCP status",
  2253. "x-codeSamples": [
  2254. {
  2255. "lang": "js",
  2256. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.status({\n ...\n})"
  2257. }
  2258. ]
  2259. },
  2260. "post": {
  2261. "tags": ["mcp"],
  2262. "operationId": "mcp.add",
  2263. "parameters": [
  2264. {
  2265. "name": "directory",
  2266. "in": "query",
  2267. "required": false,
  2268. "schema": {
  2269. "type": "string"
  2270. }
  2271. },
  2272. {
  2273. "name": "workspace",
  2274. "in": "query",
  2275. "required": false,
  2276. "schema": {
  2277. "type": "string"
  2278. }
  2279. }
  2280. ],
  2281. "responses": {
  2282. "200": {
  2283. "description": "MCP server added successfully",
  2284. "content": {
  2285. "application/json": {
  2286. "schema": {
  2287. "type": "object",
  2288. "additionalProperties": {
  2289. "$ref": "#/components/schemas/MCPStatus"
  2290. },
  2291. "description": "MCP server added successfully"
  2292. }
  2293. }
  2294. }
  2295. },
  2296. "400": {
  2297. "description": "Bad request",
  2298. "content": {
  2299. "application/json": {
  2300. "schema": {
  2301. "$ref": "#/components/schemas/BadRequestError"
  2302. }
  2303. }
  2304. }
  2305. }
  2306. },
  2307. "description": "Dynamically add a new Model Context Protocol (MCP) server to the system.",
  2308. "summary": "Add MCP server",
  2309. "requestBody": {
  2310. "content": {
  2311. "application/json": {
  2312. "schema": {
  2313. "type": "object",
  2314. "properties": {
  2315. "name": {
  2316. "type": "string"
  2317. },
  2318. "config": {
  2319. "anyOf": [
  2320. {
  2321. "$ref": "#/components/schemas/McpLocalConfig"
  2322. },
  2323. {
  2324. "$ref": "#/components/schemas/McpRemoteConfig"
  2325. }
  2326. ]
  2327. }
  2328. },
  2329. "required": ["name", "config"],
  2330. "additionalProperties": false
  2331. }
  2332. }
  2333. }
  2334. },
  2335. "x-codeSamples": [
  2336. {
  2337. "lang": "js",
  2338. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.add({\n ...\n})"
  2339. }
  2340. ]
  2341. }
  2342. },
  2343. "/mcp/{name}/auth": {
  2344. "post": {
  2345. "tags": ["mcp"],
  2346. "operationId": "mcp.auth.start",
  2347. "parameters": [
  2348. {
  2349. "name": "directory",
  2350. "in": "query",
  2351. "required": false,
  2352. "schema": {
  2353. "type": "string"
  2354. }
  2355. },
  2356. {
  2357. "name": "workspace",
  2358. "in": "query",
  2359. "required": false,
  2360. "schema": {
  2361. "type": "string"
  2362. }
  2363. },
  2364. {
  2365. "name": "name",
  2366. "in": "path",
  2367. "schema": {
  2368. "type": "string"
  2369. },
  2370. "required": true
  2371. }
  2372. ],
  2373. "responses": {
  2374. "200": {
  2375. "description": "OAuth flow started",
  2376. "content": {
  2377. "application/json": {
  2378. "schema": {
  2379. "type": "object",
  2380. "properties": {
  2381. "authorizationUrl": {
  2382. "type": "string"
  2383. },
  2384. "oauthState": {
  2385. "type": "string"
  2386. }
  2387. },
  2388. "required": ["authorizationUrl", "oauthState"],
  2389. "additionalProperties": false,
  2390. "description": "OAuth flow started"
  2391. }
  2392. }
  2393. }
  2394. },
  2395. "400": {
  2396. "description": "McpUnsupportedOAuthError",
  2397. "content": {
  2398. "application/json": {
  2399. "schema": {
  2400. "$ref": "#/components/schemas/McpUnsupportedOAuthError"
  2401. }
  2402. }
  2403. }
  2404. },
  2405. "404": {
  2406. "description": "Not found",
  2407. "content": {
  2408. "application/json": {
  2409. "schema": {
  2410. "$ref": "#/components/schemas/NotFoundError"
  2411. }
  2412. }
  2413. }
  2414. }
  2415. },
  2416. "description": "Start OAuth authentication flow for a Model Context Protocol (MCP) server.",
  2417. "summary": "Start MCP OAuth",
  2418. "x-codeSamples": [
  2419. {
  2420. "lang": "js",
  2421. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.start({\n ...\n})"
  2422. }
  2423. ]
  2424. },
  2425. "delete": {
  2426. "tags": ["mcp"],
  2427. "operationId": "mcp.auth.remove",
  2428. "parameters": [
  2429. {
  2430. "name": "directory",
  2431. "in": "query",
  2432. "required": false,
  2433. "schema": {
  2434. "type": "string"
  2435. }
  2436. },
  2437. {
  2438. "name": "workspace",
  2439. "in": "query",
  2440. "required": false,
  2441. "schema": {
  2442. "type": "string"
  2443. }
  2444. },
  2445. {
  2446. "name": "name",
  2447. "in": "path",
  2448. "schema": {
  2449. "type": "string"
  2450. },
  2451. "required": true
  2452. }
  2453. ],
  2454. "responses": {
  2455. "200": {
  2456. "description": "OAuth credentials removed",
  2457. "content": {
  2458. "application/json": {
  2459. "schema": {
  2460. "type": "object",
  2461. "properties": {
  2462. "success": {
  2463. "type": "boolean",
  2464. "enum": [true]
  2465. }
  2466. },
  2467. "required": ["success"],
  2468. "additionalProperties": false,
  2469. "description": "OAuth credentials removed"
  2470. }
  2471. }
  2472. }
  2473. },
  2474. "404": {
  2475. "description": "Not found",
  2476. "content": {
  2477. "application/json": {
  2478. "schema": {
  2479. "$ref": "#/components/schemas/NotFoundError"
  2480. }
  2481. }
  2482. }
  2483. }
  2484. },
  2485. "description": "Remove OAuth credentials for an MCP server.",
  2486. "summary": "Remove MCP OAuth",
  2487. "x-codeSamples": [
  2488. {
  2489. "lang": "js",
  2490. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.remove({\n ...\n})"
  2491. }
  2492. ]
  2493. }
  2494. },
  2495. "/mcp/{name}/auth/callback": {
  2496. "post": {
  2497. "tags": ["mcp"],
  2498. "operationId": "mcp.auth.callback",
  2499. "parameters": [
  2500. {
  2501. "name": "directory",
  2502. "in": "query",
  2503. "required": false,
  2504. "schema": {
  2505. "type": "string"
  2506. }
  2507. },
  2508. {
  2509. "name": "workspace",
  2510. "in": "query",
  2511. "required": false,
  2512. "schema": {
  2513. "type": "string"
  2514. }
  2515. },
  2516. {
  2517. "name": "name",
  2518. "in": "path",
  2519. "schema": {
  2520. "type": "string"
  2521. },
  2522. "required": true
  2523. }
  2524. ],
  2525. "responses": {
  2526. "200": {
  2527. "description": "OAuth authentication completed",
  2528. "content": {
  2529. "application/json": {
  2530. "schema": {
  2531. "$ref": "#/components/schemas/MCPStatus"
  2532. }
  2533. }
  2534. }
  2535. },
  2536. "400": {
  2537. "description": "Bad request",
  2538. "content": {
  2539. "application/json": {
  2540. "schema": {
  2541. "$ref": "#/components/schemas/BadRequestError"
  2542. }
  2543. }
  2544. }
  2545. },
  2546. "404": {
  2547. "description": "Not found",
  2548. "content": {
  2549. "application/json": {
  2550. "schema": {
  2551. "$ref": "#/components/schemas/NotFoundError"
  2552. }
  2553. }
  2554. }
  2555. }
  2556. },
  2557. "description": "Complete OAuth authentication for a Model Context Protocol (MCP) server using the authorization code.",
  2558. "summary": "Complete MCP OAuth",
  2559. "requestBody": {
  2560. "content": {
  2561. "application/json": {
  2562. "schema": {
  2563. "type": "object",
  2564. "properties": {
  2565. "code": {
  2566. "type": "string"
  2567. }
  2568. },
  2569. "required": ["code"],
  2570. "additionalProperties": false
  2571. }
  2572. }
  2573. }
  2574. },
  2575. "x-codeSamples": [
  2576. {
  2577. "lang": "js",
  2578. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.callback({\n ...\n})"
  2579. }
  2580. ]
  2581. }
  2582. },
  2583. "/mcp/{name}/auth/authenticate": {
  2584. "post": {
  2585. "tags": ["mcp"],
  2586. "operationId": "mcp.auth.authenticate",
  2587. "parameters": [
  2588. {
  2589. "name": "directory",
  2590. "in": "query",
  2591. "required": false,
  2592. "schema": {
  2593. "type": "string"
  2594. }
  2595. },
  2596. {
  2597. "name": "workspace",
  2598. "in": "query",
  2599. "required": false,
  2600. "schema": {
  2601. "type": "string"
  2602. }
  2603. },
  2604. {
  2605. "name": "name",
  2606. "in": "path",
  2607. "schema": {
  2608. "type": "string"
  2609. },
  2610. "required": true
  2611. }
  2612. ],
  2613. "responses": {
  2614. "200": {
  2615. "description": "OAuth authentication completed",
  2616. "content": {
  2617. "application/json": {
  2618. "schema": {
  2619. "$ref": "#/components/schemas/MCPStatus"
  2620. }
  2621. }
  2622. }
  2623. },
  2624. "400": {
  2625. "description": "McpUnsupportedOAuthError",
  2626. "content": {
  2627. "application/json": {
  2628. "schema": {
  2629. "$ref": "#/components/schemas/McpUnsupportedOAuthError"
  2630. }
  2631. }
  2632. }
  2633. },
  2634. "404": {
  2635. "description": "Not found",
  2636. "content": {
  2637. "application/json": {
  2638. "schema": {
  2639. "$ref": "#/components/schemas/NotFoundError"
  2640. }
  2641. }
  2642. }
  2643. }
  2644. },
  2645. "description": "Start OAuth flow and wait for callback (opens browser).",
  2646. "summary": "Authenticate MCP OAuth",
  2647. "x-codeSamples": [
  2648. {
  2649. "lang": "js",
  2650. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.authenticate({\n ...\n})"
  2651. }
  2652. ]
  2653. }
  2654. },
  2655. "/mcp/{name}/connect": {
  2656. "post": {
  2657. "tags": ["mcp"],
  2658. "operationId": "mcp.connect",
  2659. "parameters": [
  2660. {
  2661. "name": "directory",
  2662. "in": "query",
  2663. "required": false,
  2664. "schema": {
  2665. "type": "string"
  2666. }
  2667. },
  2668. {
  2669. "name": "workspace",
  2670. "in": "query",
  2671. "required": false,
  2672. "schema": {
  2673. "type": "string"
  2674. }
  2675. },
  2676. {
  2677. "name": "name",
  2678. "in": "path",
  2679. "schema": {
  2680. "type": "string"
  2681. },
  2682. "required": true
  2683. }
  2684. ],
  2685. "responses": {
  2686. "200": {
  2687. "description": "MCP server connected successfully",
  2688. "content": {
  2689. "application/json": {
  2690. "schema": {
  2691. "type": "boolean",
  2692. "description": "MCP server connected successfully"
  2693. }
  2694. }
  2695. }
  2696. }
  2697. },
  2698. "description": "Connect an MCP server.",
  2699. "x-codeSamples": [
  2700. {
  2701. "lang": "js",
  2702. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.connect({\n ...\n})"
  2703. }
  2704. ]
  2705. }
  2706. },
  2707. "/mcp/{name}/disconnect": {
  2708. "post": {
  2709. "tags": ["mcp"],
  2710. "operationId": "mcp.disconnect",
  2711. "parameters": [
  2712. {
  2713. "name": "directory",
  2714. "in": "query",
  2715. "required": false,
  2716. "schema": {
  2717. "type": "string"
  2718. }
  2719. },
  2720. {
  2721. "name": "workspace",
  2722. "in": "query",
  2723. "required": false,
  2724. "schema": {
  2725. "type": "string"
  2726. }
  2727. },
  2728. {
  2729. "name": "name",
  2730. "in": "path",
  2731. "schema": {
  2732. "type": "string"
  2733. },
  2734. "required": true
  2735. }
  2736. ],
  2737. "responses": {
  2738. "200": {
  2739. "description": "MCP server disconnected successfully",
  2740. "content": {
  2741. "application/json": {
  2742. "schema": {
  2743. "type": "boolean",
  2744. "description": "MCP server disconnected successfully"
  2745. }
  2746. }
  2747. }
  2748. }
  2749. },
  2750. "description": "Disconnect an MCP server.",
  2751. "x-codeSamples": [
  2752. {
  2753. "lang": "js",
  2754. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.disconnect({\n ...\n})"
  2755. }
  2756. ]
  2757. }
  2758. },
  2759. "/project": {
  2760. "get": {
  2761. "tags": ["project"],
  2762. "operationId": "project.list",
  2763. "parameters": [
  2764. {
  2765. "name": "directory",
  2766. "in": "query",
  2767. "required": false,
  2768. "schema": {
  2769. "type": "string"
  2770. }
  2771. },
  2772. {
  2773. "name": "workspace",
  2774. "in": "query",
  2775. "required": false,
  2776. "schema": {
  2777. "type": "string"
  2778. }
  2779. }
  2780. ],
  2781. "responses": {
  2782. "200": {
  2783. "description": "List of projects",
  2784. "content": {
  2785. "application/json": {
  2786. "schema": {
  2787. "type": "array",
  2788. "items": {
  2789. "$ref": "#/components/schemas/Project"
  2790. },
  2791. "description": "List of projects"
  2792. }
  2793. }
  2794. }
  2795. }
  2796. },
  2797. "description": "Get a list of projects that have been opened with OpenCode.",
  2798. "summary": "List all projects",
  2799. "x-codeSamples": [
  2800. {
  2801. "lang": "js",
  2802. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.list({\n ...\n})"
  2803. }
  2804. ]
  2805. }
  2806. },
  2807. "/project/current": {
  2808. "get": {
  2809. "tags": ["project"],
  2810. "operationId": "project.current",
  2811. "parameters": [
  2812. {
  2813. "name": "directory",
  2814. "in": "query",
  2815. "required": false,
  2816. "schema": {
  2817. "type": "string"
  2818. }
  2819. },
  2820. {
  2821. "name": "workspace",
  2822. "in": "query",
  2823. "required": false,
  2824. "schema": {
  2825. "type": "string"
  2826. }
  2827. }
  2828. ],
  2829. "responses": {
  2830. "200": {
  2831. "description": "Current project information",
  2832. "content": {
  2833. "application/json": {
  2834. "schema": {
  2835. "$ref": "#/components/schemas/Project"
  2836. }
  2837. }
  2838. }
  2839. }
  2840. },
  2841. "description": "Retrieve the currently active project that OpenCode is working with.",
  2842. "summary": "Get current project",
  2843. "x-codeSamples": [
  2844. {
  2845. "lang": "js",
  2846. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.current({\n ...\n})"
  2847. }
  2848. ]
  2849. }
  2850. },
  2851. "/project/git/init": {
  2852. "post": {
  2853. "tags": ["project"],
  2854. "operationId": "project.initGit",
  2855. "parameters": [
  2856. {
  2857. "name": "directory",
  2858. "in": "query",
  2859. "required": false,
  2860. "schema": {
  2861. "type": "string"
  2862. }
  2863. },
  2864. {
  2865. "name": "workspace",
  2866. "in": "query",
  2867. "required": false,
  2868. "schema": {
  2869. "type": "string"
  2870. }
  2871. }
  2872. ],
  2873. "responses": {
  2874. "200": {
  2875. "description": "Project information after git initialization",
  2876. "content": {
  2877. "application/json": {
  2878. "schema": {
  2879. "$ref": "#/components/schemas/Project"
  2880. }
  2881. }
  2882. }
  2883. }
  2884. },
  2885. "description": "Create a git repository for the current project and return the refreshed project info.",
  2886. "summary": "Initialize git repository",
  2887. "x-codeSamples": [
  2888. {
  2889. "lang": "js",
  2890. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.initGit({\n ...\n})"
  2891. }
  2892. ]
  2893. }
  2894. },
  2895. "/project/{projectID}": {
  2896. "patch": {
  2897. "tags": ["project"],
  2898. "operationId": "project.update",
  2899. "parameters": [
  2900. {
  2901. "name": "directory",
  2902. "in": "query",
  2903. "required": false,
  2904. "schema": {
  2905. "type": "string"
  2906. }
  2907. },
  2908. {
  2909. "name": "workspace",
  2910. "in": "query",
  2911. "required": false,
  2912. "schema": {
  2913. "type": "string"
  2914. }
  2915. },
  2916. {
  2917. "name": "projectID",
  2918. "in": "path",
  2919. "schema": {
  2920. "type": "string"
  2921. },
  2922. "required": true
  2923. }
  2924. ],
  2925. "responses": {
  2926. "200": {
  2927. "description": "Updated project information",
  2928. "content": {
  2929. "application/json": {
  2930. "schema": {
  2931. "$ref": "#/components/schemas/Project"
  2932. }
  2933. }
  2934. }
  2935. },
  2936. "400": {
  2937. "description": "Bad request",
  2938. "content": {
  2939. "application/json": {
  2940. "schema": {
  2941. "$ref": "#/components/schemas/BadRequestError"
  2942. }
  2943. }
  2944. }
  2945. },
  2946. "404": {
  2947. "description": "Not found",
  2948. "content": {
  2949. "application/json": {
  2950. "schema": {
  2951. "$ref": "#/components/schemas/NotFoundError"
  2952. }
  2953. }
  2954. }
  2955. }
  2956. },
  2957. "description": "Update project properties such as name, icon, and commands.",
  2958. "summary": "Update project",
  2959. "requestBody": {
  2960. "content": {
  2961. "application/json": {
  2962. "schema": {
  2963. "type": "object",
  2964. "properties": {
  2965. "name": {
  2966. "type": "string"
  2967. },
  2968. "icon": {
  2969. "type": "object",
  2970. "properties": {
  2971. "url": {
  2972. "type": "string"
  2973. },
  2974. "override": {
  2975. "type": "string"
  2976. },
  2977. "color": {
  2978. "type": "string"
  2979. }
  2980. },
  2981. "additionalProperties": false
  2982. },
  2983. "commands": {
  2984. "type": "object",
  2985. "properties": {
  2986. "start": {
  2987. "type": "string",
  2988. "description": "Startup script to run when creating a new workspace (worktree)"
  2989. }
  2990. },
  2991. "additionalProperties": false
  2992. }
  2993. },
  2994. "additionalProperties": false
  2995. }
  2996. }
  2997. }
  2998. },
  2999. "x-codeSamples": [
  3000. {
  3001. "lang": "js",
  3002. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.update({\n ...\n})"
  3003. }
  3004. ]
  3005. }
  3006. },
  3007. "/pty/shells": {
  3008. "get": {
  3009. "tags": ["pty"],
  3010. "operationId": "pty.shells",
  3011. "parameters": [
  3012. {
  3013. "name": "directory",
  3014. "in": "query",
  3015. "required": false,
  3016. "schema": {
  3017. "type": "string"
  3018. }
  3019. },
  3020. {
  3021. "name": "workspace",
  3022. "in": "query",
  3023. "required": false,
  3024. "schema": {
  3025. "type": "string"
  3026. }
  3027. }
  3028. ],
  3029. "responses": {
  3030. "200": {
  3031. "description": "List of shells",
  3032. "content": {
  3033. "application/json": {
  3034. "schema": {
  3035. "type": "array",
  3036. "items": {
  3037. "type": "object",
  3038. "properties": {
  3039. "path": {
  3040. "type": "string"
  3041. },
  3042. "name": {
  3043. "type": "string"
  3044. },
  3045. "acceptable": {
  3046. "type": "boolean"
  3047. }
  3048. },
  3049. "required": ["path", "name", "acceptable"],
  3050. "additionalProperties": false
  3051. },
  3052. "description": "List of shells"
  3053. }
  3054. }
  3055. }
  3056. }
  3057. },
  3058. "description": "Get a list of available shells on the system.",
  3059. "summary": "List available shells",
  3060. "x-codeSamples": [
  3061. {
  3062. "lang": "js",
  3063. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.shells({\n ...\n})"
  3064. }
  3065. ]
  3066. }
  3067. },
  3068. "/pty": {
  3069. "get": {
  3070. "tags": ["pty"],
  3071. "operationId": "pty.list",
  3072. "parameters": [
  3073. {
  3074. "name": "directory",
  3075. "in": "query",
  3076. "required": false,
  3077. "schema": {
  3078. "type": "string"
  3079. }
  3080. },
  3081. {
  3082. "name": "workspace",
  3083. "in": "query",
  3084. "required": false,
  3085. "schema": {
  3086. "type": "string"
  3087. }
  3088. }
  3089. ],
  3090. "responses": {
  3091. "200": {
  3092. "description": "List of sessions",
  3093. "content": {
  3094. "application/json": {
  3095. "schema": {
  3096. "type": "array",
  3097. "items": {
  3098. "$ref": "#/components/schemas/Pty"
  3099. },
  3100. "description": "List of sessions"
  3101. }
  3102. }
  3103. }
  3104. }
  3105. },
  3106. "description": "Get a list of all active pseudo-terminal (PTY) sessions managed by OpenCode.",
  3107. "summary": "List PTY sessions",
  3108. "x-codeSamples": [
  3109. {
  3110. "lang": "js",
  3111. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.list({\n ...\n})"
  3112. }
  3113. ]
  3114. },
  3115. "post": {
  3116. "tags": ["pty"],
  3117. "operationId": "pty.create",
  3118. "parameters": [
  3119. {
  3120. "name": "directory",
  3121. "in": "query",
  3122. "required": false,
  3123. "schema": {
  3124. "type": "string"
  3125. }
  3126. },
  3127. {
  3128. "name": "workspace",
  3129. "in": "query",
  3130. "required": false,
  3131. "schema": {
  3132. "type": "string"
  3133. }
  3134. }
  3135. ],
  3136. "responses": {
  3137. "200": {
  3138. "description": "Created session",
  3139. "content": {
  3140. "application/json": {
  3141. "schema": {
  3142. "$ref": "#/components/schemas/Pty"
  3143. }
  3144. }
  3145. }
  3146. },
  3147. "400": {
  3148. "description": "Bad request",
  3149. "content": {
  3150. "application/json": {
  3151. "schema": {
  3152. "$ref": "#/components/schemas/BadRequestError"
  3153. }
  3154. }
  3155. }
  3156. }
  3157. },
  3158. "description": "Create a new pseudo-terminal (PTY) session for running shell commands and processes.",
  3159. "summary": "Create PTY session",
  3160. "requestBody": {
  3161. "content": {
  3162. "application/json": {
  3163. "schema": {
  3164. "type": "object",
  3165. "properties": {
  3166. "command": {
  3167. "type": "string"
  3168. },
  3169. "args": {
  3170. "type": "array",
  3171. "items": {
  3172. "type": "string"
  3173. }
  3174. },
  3175. "cwd": {
  3176. "type": "string"
  3177. },
  3178. "title": {
  3179. "type": "string"
  3180. },
  3181. "env": {
  3182. "type": "object",
  3183. "additionalProperties": {
  3184. "type": "string"
  3185. }
  3186. }
  3187. },
  3188. "additionalProperties": false
  3189. }
  3190. }
  3191. }
  3192. },
  3193. "x-codeSamples": [
  3194. {
  3195. "lang": "js",
  3196. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.create({\n ...\n})"
  3197. }
  3198. ]
  3199. }
  3200. },
  3201. "/pty/{ptyID}": {
  3202. "get": {
  3203. "tags": ["pty"],
  3204. "operationId": "pty.get",
  3205. "parameters": [
  3206. {
  3207. "name": "directory",
  3208. "in": "query",
  3209. "required": false,
  3210. "schema": {
  3211. "type": "string"
  3212. }
  3213. },
  3214. {
  3215. "name": "workspace",
  3216. "in": "query",
  3217. "required": false,
  3218. "schema": {
  3219. "type": "string"
  3220. }
  3221. },
  3222. {
  3223. "name": "ptyID",
  3224. "in": "path",
  3225. "schema": {
  3226. "type": "string",
  3227. "pattern": "^pty.*"
  3228. },
  3229. "required": true
  3230. }
  3231. ],
  3232. "responses": {
  3233. "200": {
  3234. "description": "Session info",
  3235. "content": {
  3236. "application/json": {
  3237. "schema": {
  3238. "$ref": "#/components/schemas/Pty"
  3239. }
  3240. }
  3241. }
  3242. },
  3243. "404": {
  3244. "description": "NotFoundError",
  3245. "content": {
  3246. "application/json": {
  3247. "schema": {
  3248. "$ref": "#/components/schemas/NotFoundError"
  3249. }
  3250. }
  3251. }
  3252. }
  3253. },
  3254. "description": "Retrieve detailed information about a specific pseudo-terminal (PTY) session.",
  3255. "summary": "Get PTY session",
  3256. "x-codeSamples": [
  3257. {
  3258. "lang": "js",
  3259. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.get({\n ...\n})"
  3260. }
  3261. ]
  3262. },
  3263. "put": {
  3264. "tags": ["pty"],
  3265. "operationId": "pty.update",
  3266. "parameters": [
  3267. {
  3268. "name": "directory",
  3269. "in": "query",
  3270. "required": false,
  3271. "schema": {
  3272. "type": "string"
  3273. }
  3274. },
  3275. {
  3276. "name": "workspace",
  3277. "in": "query",
  3278. "required": false,
  3279. "schema": {
  3280. "type": "string"
  3281. }
  3282. },
  3283. {
  3284. "name": "ptyID",
  3285. "in": "path",
  3286. "schema": {
  3287. "type": "string",
  3288. "pattern": "^pty.*"
  3289. },
  3290. "required": true
  3291. }
  3292. ],
  3293. "responses": {
  3294. "200": {
  3295. "description": "Updated session",
  3296. "content": {
  3297. "application/json": {
  3298. "schema": {
  3299. "$ref": "#/components/schemas/Pty"
  3300. }
  3301. }
  3302. }
  3303. },
  3304. "400": {
  3305. "description": "Bad request",
  3306. "content": {
  3307. "application/json": {
  3308. "schema": {
  3309. "$ref": "#/components/schemas/BadRequestError"
  3310. }
  3311. }
  3312. }
  3313. }
  3314. },
  3315. "description": "Update properties of an existing pseudo-terminal (PTY) session.",
  3316. "summary": "Update PTY session",
  3317. "requestBody": {
  3318. "content": {
  3319. "application/json": {
  3320. "schema": {
  3321. "type": "object",
  3322. "properties": {
  3323. "title": {
  3324. "type": "string"
  3325. },
  3326. "size": {
  3327. "type": "object",
  3328. "properties": {
  3329. "rows": {
  3330. "type": "integer",
  3331. "exclusiveMinimum": 0
  3332. },
  3333. "cols": {
  3334. "type": "integer",
  3335. "exclusiveMinimum": 0
  3336. }
  3337. },
  3338. "required": ["rows", "cols"],
  3339. "additionalProperties": false
  3340. }
  3341. },
  3342. "additionalProperties": false
  3343. }
  3344. }
  3345. }
  3346. },
  3347. "x-codeSamples": [
  3348. {
  3349. "lang": "js",
  3350. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.update({\n ...\n})"
  3351. }
  3352. ]
  3353. },
  3354. "delete": {
  3355. "tags": ["pty"],
  3356. "operationId": "pty.remove",
  3357. "parameters": [
  3358. {
  3359. "name": "directory",
  3360. "in": "query",
  3361. "required": false,
  3362. "schema": {
  3363. "type": "string"
  3364. }
  3365. },
  3366. {
  3367. "name": "workspace",
  3368. "in": "query",
  3369. "required": false,
  3370. "schema": {
  3371. "type": "string"
  3372. }
  3373. },
  3374. {
  3375. "name": "ptyID",
  3376. "in": "path",
  3377. "schema": {
  3378. "type": "string",
  3379. "pattern": "^pty.*"
  3380. },
  3381. "required": true
  3382. }
  3383. ],
  3384. "responses": {
  3385. "200": {
  3386. "description": "Session removed",
  3387. "content": {
  3388. "application/json": {
  3389. "schema": {
  3390. "type": "boolean",
  3391. "description": "Session removed"
  3392. }
  3393. }
  3394. }
  3395. },
  3396. "404": {
  3397. "description": "NotFoundError",
  3398. "content": {
  3399. "application/json": {
  3400. "schema": {
  3401. "$ref": "#/components/schemas/NotFoundError"
  3402. }
  3403. }
  3404. }
  3405. }
  3406. },
  3407. "description": "Remove and terminate a specific pseudo-terminal (PTY) session.",
  3408. "summary": "Remove PTY session",
  3409. "x-codeSamples": [
  3410. {
  3411. "lang": "js",
  3412. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.remove({\n ...\n})"
  3413. }
  3414. ]
  3415. }
  3416. },
  3417. "/pty/{ptyID}/connect-token": {
  3418. "post": {
  3419. "tags": ["pty"],
  3420. "operationId": "pty.connectToken",
  3421. "parameters": [
  3422. {
  3423. "name": "directory",
  3424. "in": "query",
  3425. "required": false,
  3426. "schema": {
  3427. "type": "string"
  3428. }
  3429. },
  3430. {
  3431. "name": "workspace",
  3432. "in": "query",
  3433. "required": false,
  3434. "schema": {
  3435. "type": "string"
  3436. }
  3437. },
  3438. {
  3439. "name": "ptyID",
  3440. "in": "path",
  3441. "schema": {
  3442. "type": "string",
  3443. "pattern": "^pty.*"
  3444. },
  3445. "required": true
  3446. }
  3447. ],
  3448. "responses": {
  3449. "200": {
  3450. "description": "WebSocket connect token",
  3451. "content": {
  3452. "application/json": {
  3453. "schema": {
  3454. "type": "object",
  3455. "properties": {
  3456. "ticket": {
  3457. "type": "string"
  3458. },
  3459. "expires_in": {
  3460. "type": "integer",
  3461. "exclusiveMinimum": 0
  3462. }
  3463. },
  3464. "required": ["ticket", "expires_in"],
  3465. "additionalProperties": false,
  3466. "description": "WebSocket connect token"
  3467. }
  3468. }
  3469. }
  3470. },
  3471. "403": {
  3472. "description": "Forbidden",
  3473. "content": {
  3474. "application/json": {
  3475. "schema": {
  3476. "$ref": "#/components/schemas/effect_HttpApiError_Forbidden"
  3477. }
  3478. }
  3479. }
  3480. },
  3481. "404": {
  3482. "description": "NotFoundError",
  3483. "content": {
  3484. "application/json": {
  3485. "schema": {
  3486. "$ref": "#/components/schemas/NotFoundError"
  3487. }
  3488. }
  3489. }
  3490. }
  3491. },
  3492. "description": "Create a short-lived ticket for opening a PTY WebSocket connection.",
  3493. "summary": "Create PTY WebSocket token",
  3494. "x-codeSamples": [
  3495. {
  3496. "lang": "js",
  3497. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.connectToken({\n ...\n})"
  3498. }
  3499. ]
  3500. }
  3501. },
  3502. "/question": {
  3503. "get": {
  3504. "tags": ["question"],
  3505. "operationId": "question.list",
  3506. "parameters": [
  3507. {
  3508. "name": "directory",
  3509. "in": "query",
  3510. "required": false,
  3511. "schema": {
  3512. "type": "string"
  3513. }
  3514. },
  3515. {
  3516. "name": "workspace",
  3517. "in": "query",
  3518. "required": false,
  3519. "schema": {
  3520. "type": "string"
  3521. }
  3522. }
  3523. ],
  3524. "responses": {
  3525. "200": {
  3526. "description": "List of pending questions",
  3527. "content": {
  3528. "application/json": {
  3529. "schema": {
  3530. "type": "array",
  3531. "items": {
  3532. "$ref": "#/components/schemas/QuestionRequest"
  3533. },
  3534. "description": "List of pending questions"
  3535. }
  3536. }
  3537. }
  3538. }
  3539. },
  3540. "description": "Get all pending question requests across all sessions.",
  3541. "summary": "List pending questions",
  3542. "x-codeSamples": [
  3543. {
  3544. "lang": "js",
  3545. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.question.list({\n ...\n})"
  3546. }
  3547. ]
  3548. }
  3549. },
  3550. "/question/{requestID}/reply": {
  3551. "post": {
  3552. "tags": ["question"],
  3553. "operationId": "question.reply",
  3554. "parameters": [
  3555. {
  3556. "name": "directory",
  3557. "in": "query",
  3558. "required": false,
  3559. "schema": {
  3560. "type": "string"
  3561. }
  3562. },
  3563. {
  3564. "name": "workspace",
  3565. "in": "query",
  3566. "required": false,
  3567. "schema": {
  3568. "type": "string"
  3569. }
  3570. },
  3571. {
  3572. "name": "requestID",
  3573. "in": "path",
  3574. "schema": {
  3575. "type": "string",
  3576. "pattern": "^que.*"
  3577. },
  3578. "required": true
  3579. }
  3580. ],
  3581. "responses": {
  3582. "200": {
  3583. "description": "Question answered successfully",
  3584. "content": {
  3585. "application/json": {
  3586. "schema": {
  3587. "type": "boolean",
  3588. "description": "Question answered successfully"
  3589. }
  3590. }
  3591. }
  3592. },
  3593. "400": {
  3594. "description": "Bad request",
  3595. "content": {
  3596. "application/json": {
  3597. "schema": {
  3598. "$ref": "#/components/schemas/BadRequestError"
  3599. }
  3600. }
  3601. }
  3602. },
  3603. "404": {
  3604. "description": "Not found",
  3605. "content": {
  3606. "application/json": {
  3607. "schema": {
  3608. "$ref": "#/components/schemas/NotFoundError"
  3609. }
  3610. }
  3611. }
  3612. }
  3613. },
  3614. "description": "Provide answers to a question request from the AI assistant.",
  3615. "summary": "Reply to question request",
  3616. "requestBody": {
  3617. "content": {
  3618. "application/json": {
  3619. "schema": {
  3620. "type": "object",
  3621. "properties": {
  3622. "answers": {
  3623. "type": "array",
  3624. "items": {
  3625. "$ref": "#/components/schemas/QuestionAnswer"
  3626. },
  3627. "description": "User answers in order of questions (each answer is an array of selected labels)"
  3628. }
  3629. },
  3630. "required": ["answers"],
  3631. "additionalProperties": false
  3632. }
  3633. }
  3634. }
  3635. },
  3636. "x-codeSamples": [
  3637. {
  3638. "lang": "js",
  3639. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.question.reply({\n ...\n})"
  3640. }
  3641. ]
  3642. }
  3643. },
  3644. "/question/{requestID}/reject": {
  3645. "post": {
  3646. "tags": ["question"],
  3647. "operationId": "question.reject",
  3648. "parameters": [
  3649. {
  3650. "name": "directory",
  3651. "in": "query",
  3652. "required": false,
  3653. "schema": {
  3654. "type": "string"
  3655. }
  3656. },
  3657. {
  3658. "name": "workspace",
  3659. "in": "query",
  3660. "required": false,
  3661. "schema": {
  3662. "type": "string"
  3663. }
  3664. },
  3665. {
  3666. "name": "requestID",
  3667. "in": "path",
  3668. "schema": {
  3669. "type": "string",
  3670. "pattern": "^que.*"
  3671. },
  3672. "required": true
  3673. }
  3674. ],
  3675. "responses": {
  3676. "200": {
  3677. "description": "Question rejected successfully",
  3678. "content": {
  3679. "application/json": {
  3680. "schema": {
  3681. "type": "boolean",
  3682. "description": "Question rejected successfully"
  3683. }
  3684. }
  3685. }
  3686. },
  3687. "400": {
  3688. "description": "Bad request",
  3689. "content": {
  3690. "application/json": {
  3691. "schema": {
  3692. "$ref": "#/components/schemas/BadRequestError"
  3693. }
  3694. }
  3695. }
  3696. },
  3697. "404": {
  3698. "description": "Not found",
  3699. "content": {
  3700. "application/json": {
  3701. "schema": {
  3702. "$ref": "#/components/schemas/NotFoundError"
  3703. }
  3704. }
  3705. }
  3706. }
  3707. },
  3708. "description": "Reject a question request from the AI assistant.",
  3709. "summary": "Reject question request",
  3710. "x-codeSamples": [
  3711. {
  3712. "lang": "js",
  3713. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.question.reject({\n ...\n})"
  3714. }
  3715. ]
  3716. }
  3717. },
  3718. "/permission": {
  3719. "get": {
  3720. "tags": ["permission"],
  3721. "operationId": "permission.list",
  3722. "parameters": [
  3723. {
  3724. "name": "directory",
  3725. "in": "query",
  3726. "required": false,
  3727. "schema": {
  3728. "type": "string"
  3729. }
  3730. },
  3731. {
  3732. "name": "workspace",
  3733. "in": "query",
  3734. "required": false,
  3735. "schema": {
  3736. "type": "string"
  3737. }
  3738. }
  3739. ],
  3740. "responses": {
  3741. "200": {
  3742. "description": "List of pending permissions",
  3743. "content": {
  3744. "application/json": {
  3745. "schema": {
  3746. "type": "array",
  3747. "items": {
  3748. "$ref": "#/components/schemas/PermissionRequest"
  3749. },
  3750. "description": "List of pending permissions"
  3751. }
  3752. }
  3753. }
  3754. }
  3755. },
  3756. "description": "Get all pending permission requests across all sessions.",
  3757. "summary": "List pending permissions",
  3758. "x-codeSamples": [
  3759. {
  3760. "lang": "js",
  3761. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.permission.list({\n ...\n})"
  3762. }
  3763. ]
  3764. }
  3765. },
  3766. "/permission/{requestID}/reply": {
  3767. "post": {
  3768. "tags": ["permission"],
  3769. "operationId": "permission.reply",
  3770. "parameters": [
  3771. {
  3772. "name": "directory",
  3773. "in": "query",
  3774. "required": false,
  3775. "schema": {
  3776. "type": "string"
  3777. }
  3778. },
  3779. {
  3780. "name": "workspace",
  3781. "in": "query",
  3782. "required": false,
  3783. "schema": {
  3784. "type": "string"
  3785. }
  3786. },
  3787. {
  3788. "name": "requestID",
  3789. "in": "path",
  3790. "schema": {
  3791. "type": "string",
  3792. "pattern": "^per.*"
  3793. },
  3794. "required": true
  3795. }
  3796. ],
  3797. "responses": {
  3798. "200": {
  3799. "description": "Permission processed successfully",
  3800. "content": {
  3801. "application/json": {
  3802. "schema": {
  3803. "type": "boolean",
  3804. "description": "Permission processed successfully"
  3805. }
  3806. }
  3807. }
  3808. },
  3809. "400": {
  3810. "description": "Bad request",
  3811. "content": {
  3812. "application/json": {
  3813. "schema": {
  3814. "$ref": "#/components/schemas/BadRequestError"
  3815. }
  3816. }
  3817. }
  3818. },
  3819. "404": {
  3820. "description": "Not found",
  3821. "content": {
  3822. "application/json": {
  3823. "schema": {
  3824. "$ref": "#/components/schemas/NotFoundError"
  3825. }
  3826. }
  3827. }
  3828. }
  3829. },
  3830. "description": "Approve or deny a permission request from the AI assistant.",
  3831. "summary": "Respond to permission request",
  3832. "requestBody": {
  3833. "content": {
  3834. "application/json": {
  3835. "schema": {
  3836. "type": "object",
  3837. "properties": {
  3838. "reply": {
  3839. "type": "string",
  3840. "enum": ["once", "always", "reject"]
  3841. },
  3842. "message": {
  3843. "type": "string"
  3844. }
  3845. },
  3846. "required": ["reply"],
  3847. "additionalProperties": false
  3848. }
  3849. }
  3850. }
  3851. },
  3852. "x-codeSamples": [
  3853. {
  3854. "lang": "js",
  3855. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.permission.reply({\n ...\n})"
  3856. }
  3857. ]
  3858. }
  3859. },
  3860. "/provider": {
  3861. "get": {
  3862. "tags": ["provider"],
  3863. "operationId": "provider.list",
  3864. "parameters": [
  3865. {
  3866. "name": "directory",
  3867. "in": "query",
  3868. "required": false,
  3869. "schema": {
  3870. "type": "string"
  3871. }
  3872. },
  3873. {
  3874. "name": "workspace",
  3875. "in": "query",
  3876. "required": false,
  3877. "schema": {
  3878. "type": "string"
  3879. }
  3880. }
  3881. ],
  3882. "responses": {
  3883. "200": {
  3884. "description": "List of providers",
  3885. "content": {
  3886. "application/json": {
  3887. "schema": {
  3888. "type": "object",
  3889. "properties": {
  3890. "all": {
  3891. "type": "array",
  3892. "items": {
  3893. "$ref": "#/components/schemas/Provider"
  3894. }
  3895. },
  3896. "default": {
  3897. "type": "object",
  3898. "additionalProperties": {
  3899. "type": "string"
  3900. }
  3901. },
  3902. "connected": {
  3903. "type": "array",
  3904. "items": {
  3905. "type": "string"
  3906. }
  3907. }
  3908. },
  3909. "required": ["all", "default", "connected"],
  3910. "additionalProperties": false,
  3911. "description": "List of providers"
  3912. }
  3913. }
  3914. }
  3915. }
  3916. },
  3917. "description": "Get a list of all available AI providers, including both available and connected ones.",
  3918. "summary": "List providers",
  3919. "x-codeSamples": [
  3920. {
  3921. "lang": "js",
  3922. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.list({\n ...\n})"
  3923. }
  3924. ]
  3925. }
  3926. },
  3927. "/provider/auth": {
  3928. "get": {
  3929. "tags": ["provider"],
  3930. "operationId": "provider.auth",
  3931. "parameters": [
  3932. {
  3933. "name": "directory",
  3934. "in": "query",
  3935. "required": false,
  3936. "schema": {
  3937. "type": "string"
  3938. }
  3939. },
  3940. {
  3941. "name": "workspace",
  3942. "in": "query",
  3943. "required": false,
  3944. "schema": {
  3945. "type": "string"
  3946. }
  3947. }
  3948. ],
  3949. "responses": {
  3950. "200": {
  3951. "description": "Provider auth methods",
  3952. "content": {
  3953. "application/json": {
  3954. "schema": {
  3955. "type": "object",
  3956. "additionalProperties": {
  3957. "type": "array",
  3958. "items": {
  3959. "$ref": "#/components/schemas/ProviderAuthMethod"
  3960. }
  3961. },
  3962. "description": "Provider auth methods"
  3963. }
  3964. }
  3965. }
  3966. }
  3967. },
  3968. "description": "Retrieve available authentication methods for all AI providers.",
  3969. "summary": "Get provider auth methods",
  3970. "x-codeSamples": [
  3971. {
  3972. "lang": "js",
  3973. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.auth({\n ...\n})"
  3974. }
  3975. ]
  3976. }
  3977. },
  3978. "/provider/{providerID}/oauth/authorize": {
  3979. "post": {
  3980. "tags": ["provider"],
  3981. "operationId": "provider.oauth.authorize",
  3982. "parameters": [
  3983. {
  3984. "name": "directory",
  3985. "in": "query",
  3986. "required": false,
  3987. "schema": {
  3988. "type": "string"
  3989. }
  3990. },
  3991. {
  3992. "name": "workspace",
  3993. "in": "query",
  3994. "required": false,
  3995. "schema": {
  3996. "type": "string"
  3997. }
  3998. },
  3999. {
  4000. "name": "providerID",
  4001. "in": "path",
  4002. "schema": {
  4003. "type": "string"
  4004. },
  4005. "required": true
  4006. }
  4007. ],
  4008. "responses": {
  4009. "200": {
  4010. "description": "Authorization URL and method",
  4011. "content": {
  4012. "application/json": {
  4013. "schema": {
  4014. "$ref": "#/components/schemas/ProviderAuthAuthorization"
  4015. }
  4016. }
  4017. }
  4018. },
  4019. "400": {
  4020. "description": "Bad request",
  4021. "content": {
  4022. "application/json": {
  4023. "schema": {
  4024. "$ref": "#/components/schemas/BadRequestError"
  4025. }
  4026. }
  4027. }
  4028. }
  4029. },
  4030. "description": "Start the OAuth authorization flow for a provider.",
  4031. "summary": "Start OAuth authorization",
  4032. "requestBody": {
  4033. "content": {
  4034. "application/json": {
  4035. "schema": {
  4036. "type": "object",
  4037. "properties": {
  4038. "method": {
  4039. "type": "number",
  4040. "description": "Auth method index"
  4041. },
  4042. "inputs": {
  4043. "type": "object",
  4044. "additionalProperties": {
  4045. "type": "string"
  4046. }
  4047. }
  4048. },
  4049. "required": ["method"],
  4050. "additionalProperties": false
  4051. }
  4052. }
  4053. }
  4054. },
  4055. "x-codeSamples": [
  4056. {
  4057. "lang": "js",
  4058. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.oauth.authorize({\n ...\n})"
  4059. }
  4060. ]
  4061. }
  4062. },
  4063. "/provider/{providerID}/oauth/callback": {
  4064. "post": {
  4065. "tags": ["provider"],
  4066. "operationId": "provider.oauth.callback",
  4067. "parameters": [
  4068. {
  4069. "name": "directory",
  4070. "in": "query",
  4071. "required": false,
  4072. "schema": {
  4073. "type": "string"
  4074. }
  4075. },
  4076. {
  4077. "name": "workspace",
  4078. "in": "query",
  4079. "required": false,
  4080. "schema": {
  4081. "type": "string"
  4082. }
  4083. },
  4084. {
  4085. "name": "providerID",
  4086. "in": "path",
  4087. "schema": {
  4088. "type": "string"
  4089. },
  4090. "required": true
  4091. }
  4092. ],
  4093. "responses": {
  4094. "200": {
  4095. "description": "OAuth callback processed successfully",
  4096. "content": {
  4097. "application/json": {
  4098. "schema": {
  4099. "type": "boolean",
  4100. "description": "OAuth callback processed successfully"
  4101. }
  4102. }
  4103. }
  4104. },
  4105. "400": {
  4106. "description": "Bad request",
  4107. "content": {
  4108. "application/json": {
  4109. "schema": {
  4110. "$ref": "#/components/schemas/BadRequestError"
  4111. }
  4112. }
  4113. }
  4114. }
  4115. },
  4116. "description": "Handle the OAuth callback from a provider after user authorization.",
  4117. "summary": "Handle OAuth callback",
  4118. "requestBody": {
  4119. "content": {
  4120. "application/json": {
  4121. "schema": {
  4122. "type": "object",
  4123. "properties": {
  4124. "method": {
  4125. "type": "number",
  4126. "description": "Auth method index"
  4127. },
  4128. "code": {
  4129. "type": "string"
  4130. }
  4131. },
  4132. "required": ["method"],
  4133. "additionalProperties": false
  4134. }
  4135. }
  4136. }
  4137. },
  4138. "x-codeSamples": [
  4139. {
  4140. "lang": "js",
  4141. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.oauth.callback({\n ...\n})"
  4142. }
  4143. ]
  4144. }
  4145. },
  4146. "/session": {
  4147. "get": {
  4148. "tags": ["session"],
  4149. "operationId": "session.list",
  4150. "parameters": [
  4151. {
  4152. "name": "directory",
  4153. "in": "query",
  4154. "required": false,
  4155. "schema": {
  4156. "type": "string"
  4157. }
  4158. },
  4159. {
  4160. "name": "workspace",
  4161. "in": "query",
  4162. "required": false,
  4163. "schema": {
  4164. "type": "string"
  4165. }
  4166. },
  4167. {
  4168. "name": "scope",
  4169. "in": "query",
  4170. "schema": {
  4171. "type": "string",
  4172. "enum": ["project"]
  4173. },
  4174. "required": false
  4175. },
  4176. {
  4177. "name": "path",
  4178. "in": "query",
  4179. "schema": {
  4180. "type": "string"
  4181. },
  4182. "required": false
  4183. },
  4184. {
  4185. "name": "roots",
  4186. "in": "query",
  4187. "schema": {
  4188. "anyOf": [
  4189. {
  4190. "type": "boolean"
  4191. },
  4192. {
  4193. "type": "string",
  4194. "enum": ["true", "false"]
  4195. }
  4196. ]
  4197. },
  4198. "required": false
  4199. },
  4200. {
  4201. "name": "start",
  4202. "in": "query",
  4203. "schema": {
  4204. "type": "number"
  4205. },
  4206. "required": false
  4207. },
  4208. {
  4209. "name": "search",
  4210. "in": "query",
  4211. "schema": {
  4212. "type": "string"
  4213. },
  4214. "required": false
  4215. },
  4216. {
  4217. "name": "limit",
  4218. "in": "query",
  4219. "schema": {
  4220. "type": "number"
  4221. },
  4222. "required": false
  4223. }
  4224. ],
  4225. "responses": {
  4226. "200": {
  4227. "description": "List of sessions",
  4228. "content": {
  4229. "application/json": {
  4230. "schema": {
  4231. "type": "array",
  4232. "items": {
  4233. "$ref": "#/components/schemas/Session"
  4234. },
  4235. "description": "List of sessions"
  4236. }
  4237. }
  4238. }
  4239. }
  4240. },
  4241. "description": "Get a list of all OpenCode sessions, sorted by most recently updated.",
  4242. "summary": "List sessions",
  4243. "x-codeSamples": [
  4244. {
  4245. "lang": "js",
  4246. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.list({\n ...\n})"
  4247. }
  4248. ]
  4249. },
  4250. "post": {
  4251. "tags": ["session"],
  4252. "operationId": "session.create",
  4253. "parameters": [
  4254. {
  4255. "name": "directory",
  4256. "in": "query",
  4257. "required": false,
  4258. "schema": {
  4259. "type": "string"
  4260. }
  4261. },
  4262. {
  4263. "name": "workspace",
  4264. "in": "query",
  4265. "required": false,
  4266. "schema": {
  4267. "type": "string"
  4268. }
  4269. }
  4270. ],
  4271. "responses": {
  4272. "200": {
  4273. "description": "Successfully created session",
  4274. "content": {
  4275. "application/json": {
  4276. "schema": {
  4277. "$ref": "#/components/schemas/Session"
  4278. }
  4279. }
  4280. }
  4281. },
  4282. "400": {
  4283. "description": "Bad request",
  4284. "content": {
  4285. "application/json": {
  4286. "schema": {
  4287. "$ref": "#/components/schemas/BadRequestError"
  4288. }
  4289. }
  4290. }
  4291. }
  4292. },
  4293. "description": "Create a new OpenCode session for interacting with AI assistants and managing conversations.",
  4294. "summary": "Create session",
  4295. "requestBody": {
  4296. "content": {
  4297. "application/json": {
  4298. "schema": {
  4299. "type": "object",
  4300. "properties": {
  4301. "parentID": {
  4302. "type": "string"
  4303. },
  4304. "title": {
  4305. "type": "string"
  4306. },
  4307. "agent": {
  4308. "type": "string"
  4309. },
  4310. "model": {
  4311. "type": "object",
  4312. "properties": {
  4313. "id": {
  4314. "type": "string"
  4315. },
  4316. "providerID": {
  4317. "type": "string"
  4318. },
  4319. "variant": {
  4320. "type": "string"
  4321. }
  4322. },
  4323. "required": ["id", "providerID"],
  4324. "additionalProperties": false
  4325. },
  4326. "permission": {
  4327. "$ref": "#/components/schemas/PermissionRuleset"
  4328. },
  4329. "workspaceID": {
  4330. "type": "string"
  4331. }
  4332. },
  4333. "additionalProperties": false
  4334. }
  4335. }
  4336. }
  4337. },
  4338. "x-codeSamples": [
  4339. {
  4340. "lang": "js",
  4341. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.create({\n ...\n})"
  4342. }
  4343. ]
  4344. }
  4345. },
  4346. "/session/status": {
  4347. "get": {
  4348. "tags": ["session"],
  4349. "operationId": "session.status",
  4350. "parameters": [
  4351. {
  4352. "name": "directory",
  4353. "in": "query",
  4354. "required": false,
  4355. "schema": {
  4356. "type": "string"
  4357. }
  4358. },
  4359. {
  4360. "name": "workspace",
  4361. "in": "query",
  4362. "required": false,
  4363. "schema": {
  4364. "type": "string"
  4365. }
  4366. }
  4367. ],
  4368. "responses": {
  4369. "200": {
  4370. "description": "Get session status",
  4371. "content": {
  4372. "application/json": {
  4373. "schema": {
  4374. "type": "object",
  4375. "additionalProperties": {
  4376. "$ref": "#/components/schemas/SessionStatus"
  4377. },
  4378. "description": "Get session status"
  4379. }
  4380. }
  4381. }
  4382. },
  4383. "400": {
  4384. "description": "Bad request",
  4385. "content": {
  4386. "application/json": {
  4387. "schema": {
  4388. "$ref": "#/components/schemas/BadRequestError"
  4389. }
  4390. }
  4391. }
  4392. }
  4393. },
  4394. "description": "Retrieve the current status of all sessions, including active, idle, and completed states.",
  4395. "summary": "Get session status",
  4396. "x-codeSamples": [
  4397. {
  4398. "lang": "js",
  4399. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.status({\n ...\n})"
  4400. }
  4401. ]
  4402. }
  4403. },
  4404. "/session/{sessionID}": {
  4405. "get": {
  4406. "tags": ["session"],
  4407. "operationId": "session.get",
  4408. "parameters": [
  4409. {
  4410. "name": "directory",
  4411. "in": "query",
  4412. "required": false,
  4413. "schema": {
  4414. "type": "string"
  4415. }
  4416. },
  4417. {
  4418. "name": "workspace",
  4419. "in": "query",
  4420. "required": false,
  4421. "schema": {
  4422. "type": "string"
  4423. }
  4424. },
  4425. {
  4426. "name": "sessionID",
  4427. "in": "path",
  4428. "schema": {
  4429. "type": "string",
  4430. "pattern": "^ses.*"
  4431. },
  4432. "required": true
  4433. }
  4434. ],
  4435. "responses": {
  4436. "200": {
  4437. "description": "Get session",
  4438. "content": {
  4439. "application/json": {
  4440. "schema": {
  4441. "$ref": "#/components/schemas/Session"
  4442. }
  4443. }
  4444. }
  4445. },
  4446. "400": {
  4447. "description": "Bad request",
  4448. "content": {
  4449. "application/json": {
  4450. "schema": {
  4451. "$ref": "#/components/schemas/BadRequestError"
  4452. }
  4453. }
  4454. }
  4455. },
  4456. "404": {
  4457. "description": "NotFoundError",
  4458. "content": {
  4459. "application/json": {
  4460. "schema": {
  4461. "$ref": "#/components/schemas/NotFoundError"
  4462. }
  4463. }
  4464. }
  4465. }
  4466. },
  4467. "description": "Retrieve detailed information about a specific OpenCode session.",
  4468. "summary": "Get session",
  4469. "x-codeSamples": [
  4470. {
  4471. "lang": "js",
  4472. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.get({\n ...\n})"
  4473. }
  4474. ]
  4475. },
  4476. "delete": {
  4477. "tags": ["session"],
  4478. "operationId": "session.delete",
  4479. "parameters": [
  4480. {
  4481. "name": "directory",
  4482. "in": "query",
  4483. "required": false,
  4484. "schema": {
  4485. "type": "string"
  4486. }
  4487. },
  4488. {
  4489. "name": "workspace",
  4490. "in": "query",
  4491. "required": false,
  4492. "schema": {
  4493. "type": "string"
  4494. }
  4495. },
  4496. {
  4497. "name": "sessionID",
  4498. "in": "path",
  4499. "schema": {
  4500. "type": "string",
  4501. "pattern": "^ses.*"
  4502. },
  4503. "required": true
  4504. }
  4505. ],
  4506. "responses": {
  4507. "200": {
  4508. "description": "Successfully deleted session",
  4509. "content": {
  4510. "application/json": {
  4511. "schema": {
  4512. "type": "boolean",
  4513. "description": "Successfully deleted session"
  4514. }
  4515. }
  4516. }
  4517. },
  4518. "400": {
  4519. "description": "Bad request",
  4520. "content": {
  4521. "application/json": {
  4522. "schema": {
  4523. "$ref": "#/components/schemas/BadRequestError"
  4524. }
  4525. }
  4526. }
  4527. },
  4528. "404": {
  4529. "description": "NotFoundError",
  4530. "content": {
  4531. "application/json": {
  4532. "schema": {
  4533. "$ref": "#/components/schemas/NotFoundError"
  4534. }
  4535. }
  4536. }
  4537. }
  4538. },
  4539. "description": "Delete a session and permanently remove all associated data, including messages and history.",
  4540. "summary": "Delete session",
  4541. "x-codeSamples": [
  4542. {
  4543. "lang": "js",
  4544. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.delete({\n ...\n})"
  4545. }
  4546. ]
  4547. },
  4548. "patch": {
  4549. "tags": ["session"],
  4550. "operationId": "session.update",
  4551. "parameters": [
  4552. {
  4553. "name": "directory",
  4554. "in": "query",
  4555. "required": false,
  4556. "schema": {
  4557. "type": "string"
  4558. }
  4559. },
  4560. {
  4561. "name": "workspace",
  4562. "in": "query",
  4563. "required": false,
  4564. "schema": {
  4565. "type": "string"
  4566. }
  4567. },
  4568. {
  4569. "name": "sessionID",
  4570. "in": "path",
  4571. "schema": {
  4572. "type": "string",
  4573. "pattern": "^ses.*"
  4574. },
  4575. "required": true
  4576. }
  4577. ],
  4578. "responses": {
  4579. "200": {
  4580. "description": "Successfully updated session",
  4581. "content": {
  4582. "application/json": {
  4583. "schema": {
  4584. "$ref": "#/components/schemas/Session"
  4585. }
  4586. }
  4587. }
  4588. },
  4589. "400": {
  4590. "description": "Bad request",
  4591. "content": {
  4592. "application/json": {
  4593. "schema": {
  4594. "$ref": "#/components/schemas/BadRequestError"
  4595. }
  4596. }
  4597. }
  4598. },
  4599. "404": {
  4600. "description": "NotFoundError",
  4601. "content": {
  4602. "application/json": {
  4603. "schema": {
  4604. "$ref": "#/components/schemas/NotFoundError"
  4605. }
  4606. }
  4607. }
  4608. }
  4609. },
  4610. "description": "Update properties of an existing session, such as title or other metadata.",
  4611. "summary": "Update session",
  4612. "requestBody": {
  4613. "content": {
  4614. "application/json": {
  4615. "schema": {
  4616. "type": "object",
  4617. "properties": {
  4618. "title": {
  4619. "type": "string"
  4620. },
  4621. "permission": {
  4622. "$ref": "#/components/schemas/PermissionRuleset"
  4623. },
  4624. "time": {
  4625. "type": "object",
  4626. "properties": {
  4627. "archived": {
  4628. "type": "number"
  4629. }
  4630. },
  4631. "additionalProperties": false
  4632. }
  4633. },
  4634. "additionalProperties": false
  4635. }
  4636. }
  4637. }
  4638. },
  4639. "x-codeSamples": [
  4640. {
  4641. "lang": "js",
  4642. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.update({\n ...\n})"
  4643. }
  4644. ]
  4645. }
  4646. },
  4647. "/session/{sessionID}/children": {
  4648. "get": {
  4649. "tags": ["session"],
  4650. "operationId": "session.children",
  4651. "parameters": [
  4652. {
  4653. "name": "directory",
  4654. "in": "query",
  4655. "required": false,
  4656. "schema": {
  4657. "type": "string"
  4658. }
  4659. },
  4660. {
  4661. "name": "workspace",
  4662. "in": "query",
  4663. "required": false,
  4664. "schema": {
  4665. "type": "string"
  4666. }
  4667. },
  4668. {
  4669. "name": "sessionID",
  4670. "in": "path",
  4671. "schema": {
  4672. "type": "string",
  4673. "pattern": "^ses.*"
  4674. },
  4675. "required": true
  4676. }
  4677. ],
  4678. "responses": {
  4679. "200": {
  4680. "description": "List of children",
  4681. "content": {
  4682. "application/json": {
  4683. "schema": {
  4684. "type": "array",
  4685. "items": {
  4686. "$ref": "#/components/schemas/Session"
  4687. },
  4688. "description": "List of children"
  4689. }
  4690. }
  4691. }
  4692. },
  4693. "400": {
  4694. "description": "Bad request",
  4695. "content": {
  4696. "application/json": {
  4697. "schema": {
  4698. "$ref": "#/components/schemas/BadRequestError"
  4699. }
  4700. }
  4701. }
  4702. },
  4703. "404": {
  4704. "description": "Not found",
  4705. "content": {
  4706. "application/json": {
  4707. "schema": {
  4708. "$ref": "#/components/schemas/NotFoundError"
  4709. }
  4710. }
  4711. }
  4712. }
  4713. },
  4714. "description": "Retrieve all child sessions that were forked from the specified parent session.",
  4715. "summary": "Get session children",
  4716. "x-codeSamples": [
  4717. {
  4718. "lang": "js",
  4719. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.children({\n ...\n})"
  4720. }
  4721. ]
  4722. }
  4723. },
  4724. "/session/{sessionID}/todo": {
  4725. "get": {
  4726. "tags": ["session"],
  4727. "operationId": "session.todo",
  4728. "parameters": [
  4729. {
  4730. "name": "directory",
  4731. "in": "query",
  4732. "required": false,
  4733. "schema": {
  4734. "type": "string"
  4735. }
  4736. },
  4737. {
  4738. "name": "workspace",
  4739. "in": "query",
  4740. "required": false,
  4741. "schema": {
  4742. "type": "string"
  4743. }
  4744. },
  4745. {
  4746. "name": "sessionID",
  4747. "in": "path",
  4748. "schema": {
  4749. "type": "string",
  4750. "pattern": "^ses.*"
  4751. },
  4752. "required": true
  4753. }
  4754. ],
  4755. "responses": {
  4756. "200": {
  4757. "description": "Todo list",
  4758. "content": {
  4759. "application/json": {
  4760. "schema": {
  4761. "type": "array",
  4762. "items": {
  4763. "$ref": "#/components/schemas/Todo"
  4764. },
  4765. "description": "Todo list"
  4766. }
  4767. }
  4768. }
  4769. },
  4770. "400": {
  4771. "description": "Bad request",
  4772. "content": {
  4773. "application/json": {
  4774. "schema": {
  4775. "$ref": "#/components/schemas/BadRequestError"
  4776. }
  4777. }
  4778. }
  4779. },
  4780. "404": {
  4781. "description": "Not found",
  4782. "content": {
  4783. "application/json": {
  4784. "schema": {
  4785. "$ref": "#/components/schemas/NotFoundError"
  4786. }
  4787. }
  4788. }
  4789. }
  4790. },
  4791. "description": "Retrieve the todo list associated with a specific session, showing tasks and action items.",
  4792. "summary": "Get session todos",
  4793. "x-codeSamples": [
  4794. {
  4795. "lang": "js",
  4796. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.todo({\n ...\n})"
  4797. }
  4798. ]
  4799. }
  4800. },
  4801. "/session/{sessionID}/diff": {
  4802. "get": {
  4803. "tags": ["session"],
  4804. "operationId": "session.diff",
  4805. "parameters": [
  4806. {
  4807. "name": "directory",
  4808. "in": "query",
  4809. "required": false,
  4810. "schema": {
  4811. "type": "string"
  4812. }
  4813. },
  4814. {
  4815. "name": "workspace",
  4816. "in": "query",
  4817. "required": false,
  4818. "schema": {
  4819. "type": "string"
  4820. }
  4821. },
  4822. {
  4823. "name": "sessionID",
  4824. "in": "path",
  4825. "schema": {
  4826. "type": "string",
  4827. "pattern": "^ses.*"
  4828. },
  4829. "required": true
  4830. },
  4831. {
  4832. "name": "messageID",
  4833. "in": "query",
  4834. "schema": {
  4835. "type": "string",
  4836. "pattern": "^msg.*"
  4837. },
  4838. "required": false
  4839. }
  4840. ],
  4841. "responses": {
  4842. "200": {
  4843. "description": "Successfully retrieved diff",
  4844. "content": {
  4845. "application/json": {
  4846. "schema": {
  4847. "type": "array",
  4848. "items": {
  4849. "$ref": "#/components/schemas/SnapshotFileDiff"
  4850. },
  4851. "description": "Successfully retrieved diff"
  4852. }
  4853. }
  4854. }
  4855. }
  4856. },
  4857. "description": "Get the file changes (diff) that resulted from a specific user message in the session.",
  4858. "summary": "Get message diff",
  4859. "x-codeSamples": [
  4860. {
  4861. "lang": "js",
  4862. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.diff({\n ...\n})"
  4863. }
  4864. ]
  4865. }
  4866. },
  4867. "/session/{sessionID}/message": {
  4868. "get": {
  4869. "tags": ["session"],
  4870. "operationId": "session.messages",
  4871. "parameters": [
  4872. {
  4873. "name": "directory",
  4874. "in": "query",
  4875. "required": false,
  4876. "schema": {
  4877. "type": "string"
  4878. }
  4879. },
  4880. {
  4881. "name": "workspace",
  4882. "in": "query",
  4883. "required": false,
  4884. "schema": {
  4885. "type": "string"
  4886. }
  4887. },
  4888. {
  4889. "name": "sessionID",
  4890. "in": "path",
  4891. "schema": {
  4892. "type": "string",
  4893. "pattern": "^ses.*"
  4894. },
  4895. "required": true
  4896. },
  4897. {
  4898. "name": "limit",
  4899. "in": "query",
  4900. "schema": {
  4901. "type": "integer",
  4902. "minimum": 0,
  4903. "maximum": 9007199254740991
  4904. },
  4905. "required": false
  4906. },
  4907. {
  4908. "name": "before",
  4909. "in": "query",
  4910. "schema": {
  4911. "type": "string"
  4912. },
  4913. "required": false
  4914. }
  4915. ],
  4916. "responses": {
  4917. "200": {
  4918. "description": "List of messages",
  4919. "content": {
  4920. "application/json": {
  4921. "schema": {
  4922. "type": "array",
  4923. "items": {
  4924. "type": "object",
  4925. "properties": {
  4926. "info": {
  4927. "$ref": "#/components/schemas/Message"
  4928. },
  4929. "parts": {
  4930. "type": "array",
  4931. "items": {
  4932. "$ref": "#/components/schemas/Part"
  4933. }
  4934. }
  4935. },
  4936. "required": ["info", "parts"],
  4937. "additionalProperties": false
  4938. },
  4939. "description": "List of messages"
  4940. }
  4941. }
  4942. }
  4943. },
  4944. "400": {
  4945. "description": "Bad request",
  4946. "content": {
  4947. "application/json": {
  4948. "schema": {
  4949. "$ref": "#/components/schemas/BadRequestError"
  4950. }
  4951. }
  4952. }
  4953. },
  4954. "404": {
  4955. "description": "NotFoundError",
  4956. "content": {
  4957. "application/json": {
  4958. "schema": {
  4959. "$ref": "#/components/schemas/NotFoundError"
  4960. }
  4961. }
  4962. }
  4963. }
  4964. },
  4965. "description": "Retrieve all messages in a session, including user prompts and AI responses.",
  4966. "summary": "Get session messages",
  4967. "x-codeSamples": [
  4968. {
  4969. "lang": "js",
  4970. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.messages({\n ...\n})"
  4971. }
  4972. ]
  4973. },
  4974. "post": {
  4975. "tags": ["session"],
  4976. "operationId": "session.prompt",
  4977. "parameters": [
  4978. {
  4979. "name": "directory",
  4980. "in": "query",
  4981. "required": false,
  4982. "schema": {
  4983. "type": "string"
  4984. }
  4985. },
  4986. {
  4987. "name": "workspace",
  4988. "in": "query",
  4989. "required": false,
  4990. "schema": {
  4991. "type": "string"
  4992. }
  4993. },
  4994. {
  4995. "name": "sessionID",
  4996. "in": "path",
  4997. "schema": {
  4998. "type": "string",
  4999. "pattern": "^ses.*"
  5000. },
  5001. "required": true
  5002. }
  5003. ],
  5004. "responses": {
  5005. "200": {
  5006. "description": "Created message",
  5007. "content": {
  5008. "application/json": {
  5009. "schema": {
  5010. "type": "object",
  5011. "required": ["info", "parts"],
  5012. "properties": {
  5013. "info": {
  5014. "$ref": "#/components/schemas/AssistantMessage"
  5015. },
  5016. "parts": {
  5017. "type": "array",
  5018. "items": {
  5019. "$ref": "#/components/schemas/Part"
  5020. }
  5021. }
  5022. }
  5023. }
  5024. }
  5025. }
  5026. },
  5027. "400": {
  5028. "description": "Bad request",
  5029. "content": {
  5030. "application/json": {
  5031. "schema": {
  5032. "$ref": "#/components/schemas/BadRequestError"
  5033. }
  5034. }
  5035. }
  5036. },
  5037. "404": {
  5038. "description": "Not found",
  5039. "content": {
  5040. "application/json": {
  5041. "schema": {
  5042. "$ref": "#/components/schemas/NotFoundError"
  5043. }
  5044. }
  5045. }
  5046. }
  5047. },
  5048. "description": "Create and send a new message to a session, streaming the AI response.",
  5049. "summary": "Send message",
  5050. "requestBody": {
  5051. "content": {
  5052. "application/json": {
  5053. "schema": {
  5054. "type": "object",
  5055. "properties": {
  5056. "messageID": {
  5057. "type": "string"
  5058. },
  5059. "model": {
  5060. "type": "object",
  5061. "properties": {
  5062. "providerID": {
  5063. "type": "string"
  5064. },
  5065. "modelID": {
  5066. "type": "string"
  5067. }
  5068. },
  5069. "required": ["providerID", "modelID"],
  5070. "additionalProperties": false
  5071. },
  5072. "agent": {
  5073. "type": "string"
  5074. },
  5075. "noReply": {
  5076. "type": "boolean"
  5077. },
  5078. "tools": {
  5079. "type": "object",
  5080. "additionalProperties": {
  5081. "type": "boolean"
  5082. }
  5083. },
  5084. "format": {
  5085. "$ref": "#/components/schemas/OutputFormat"
  5086. },
  5087. "system": {
  5088. "type": "string"
  5089. },
  5090. "variant": {
  5091. "type": "string"
  5092. },
  5093. "parts": {
  5094. "type": "array",
  5095. "items": {
  5096. "anyOf": [
  5097. {
  5098. "$ref": "#/components/schemas/TextPartInput"
  5099. },
  5100. {
  5101. "$ref": "#/components/schemas/FilePartInput"
  5102. },
  5103. {
  5104. "$ref": "#/components/schemas/AgentPartInput"
  5105. },
  5106. {
  5107. "$ref": "#/components/schemas/SubtaskPartInput"
  5108. }
  5109. ]
  5110. }
  5111. }
  5112. },
  5113. "required": ["parts"],
  5114. "additionalProperties": false
  5115. }
  5116. }
  5117. }
  5118. },
  5119. "x-codeSamples": [
  5120. {
  5121. "lang": "js",
  5122. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.prompt({\n ...\n})"
  5123. }
  5124. ]
  5125. }
  5126. },
  5127. "/session/{sessionID}/message/{messageID}": {
  5128. "get": {
  5129. "tags": ["session"],
  5130. "operationId": "session.message",
  5131. "parameters": [
  5132. {
  5133. "name": "directory",
  5134. "in": "query",
  5135. "required": false,
  5136. "schema": {
  5137. "type": "string"
  5138. }
  5139. },
  5140. {
  5141. "name": "workspace",
  5142. "in": "query",
  5143. "required": false,
  5144. "schema": {
  5145. "type": "string"
  5146. }
  5147. },
  5148. {
  5149. "name": "sessionID",
  5150. "in": "path",
  5151. "schema": {
  5152. "type": "string",
  5153. "pattern": "^ses.*"
  5154. },
  5155. "required": true
  5156. },
  5157. {
  5158. "name": "messageID",
  5159. "in": "path",
  5160. "schema": {
  5161. "type": "string",
  5162. "pattern": "^msg.*"
  5163. },
  5164. "required": true
  5165. }
  5166. ],
  5167. "responses": {
  5168. "200": {
  5169. "description": "Message",
  5170. "content": {
  5171. "application/json": {
  5172. "schema": {
  5173. "type": "object",
  5174. "properties": {
  5175. "info": {
  5176. "$ref": "#/components/schemas/Message"
  5177. },
  5178. "parts": {
  5179. "type": "array",
  5180. "items": {
  5181. "$ref": "#/components/schemas/Part"
  5182. }
  5183. }
  5184. },
  5185. "required": ["info", "parts"],
  5186. "additionalProperties": false,
  5187. "description": "Message"
  5188. }
  5189. }
  5190. }
  5191. },
  5192. "400": {
  5193. "description": "Bad request",
  5194. "content": {
  5195. "application/json": {
  5196. "schema": {
  5197. "$ref": "#/components/schemas/BadRequestError"
  5198. }
  5199. }
  5200. }
  5201. },
  5202. "404": {
  5203. "description": "NotFoundError",
  5204. "content": {
  5205. "application/json": {
  5206. "schema": {
  5207. "$ref": "#/components/schemas/NotFoundError"
  5208. }
  5209. }
  5210. }
  5211. }
  5212. },
  5213. "description": "Retrieve a specific message from a session by its message ID.",
  5214. "summary": "Get message",
  5215. "x-codeSamples": [
  5216. {
  5217. "lang": "js",
  5218. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.message({\n ...\n})"
  5219. }
  5220. ]
  5221. },
  5222. "delete": {
  5223. "tags": ["session"],
  5224. "operationId": "session.deleteMessage",
  5225. "parameters": [
  5226. {
  5227. "name": "directory",
  5228. "in": "query",
  5229. "required": false,
  5230. "schema": {
  5231. "type": "string"
  5232. }
  5233. },
  5234. {
  5235. "name": "workspace",
  5236. "in": "query",
  5237. "required": false,
  5238. "schema": {
  5239. "type": "string"
  5240. }
  5241. },
  5242. {
  5243. "name": "sessionID",
  5244. "in": "path",
  5245. "schema": {
  5246. "type": "string",
  5247. "pattern": "^ses.*"
  5248. },
  5249. "required": true
  5250. },
  5251. {
  5252. "name": "messageID",
  5253. "in": "path",
  5254. "schema": {
  5255. "type": "string",
  5256. "pattern": "^msg.*"
  5257. },
  5258. "required": true
  5259. }
  5260. ],
  5261. "responses": {
  5262. "200": {
  5263. "description": "Successfully deleted message",
  5264. "content": {
  5265. "application/json": {
  5266. "schema": {
  5267. "type": "boolean",
  5268. "description": "Successfully deleted message"
  5269. }
  5270. }
  5271. }
  5272. },
  5273. "400": {
  5274. "description": "Bad request",
  5275. "content": {
  5276. "application/json": {
  5277. "schema": {
  5278. "$ref": "#/components/schemas/BadRequestError"
  5279. }
  5280. }
  5281. }
  5282. },
  5283. "404": {
  5284. "description": "Not found",
  5285. "content": {
  5286. "application/json": {
  5287. "schema": {
  5288. "$ref": "#/components/schemas/NotFoundError"
  5289. }
  5290. }
  5291. }
  5292. }
  5293. },
  5294. "description": "Permanently delete a specific message and all of its parts from a session without reverting file changes.",
  5295. "summary": "Delete message",
  5296. "x-codeSamples": [
  5297. {
  5298. "lang": "js",
  5299. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.deleteMessage({\n ...\n})"
  5300. }
  5301. ]
  5302. }
  5303. },
  5304. "/session/{sessionID}/fork": {
  5305. "post": {
  5306. "tags": ["session"],
  5307. "operationId": "session.fork",
  5308. "parameters": [
  5309. {
  5310. "name": "directory",
  5311. "in": "query",
  5312. "required": false,
  5313. "schema": {
  5314. "type": "string"
  5315. }
  5316. },
  5317. {
  5318. "name": "workspace",
  5319. "in": "query",
  5320. "required": false,
  5321. "schema": {
  5322. "type": "string"
  5323. }
  5324. },
  5325. {
  5326. "name": "sessionID",
  5327. "in": "path",
  5328. "schema": {
  5329. "type": "string",
  5330. "pattern": "^ses.*"
  5331. },
  5332. "required": true
  5333. }
  5334. ],
  5335. "responses": {
  5336. "200": {
  5337. "description": "200",
  5338. "content": {
  5339. "application/json": {
  5340. "schema": {
  5341. "$ref": "#/components/schemas/Session"
  5342. }
  5343. }
  5344. }
  5345. },
  5346. "404": {
  5347. "description": "NotFoundError",
  5348. "content": {
  5349. "application/json": {
  5350. "schema": {
  5351. "$ref": "#/components/schemas/NotFoundError"
  5352. }
  5353. }
  5354. }
  5355. }
  5356. },
  5357. "description": "Create a new session by forking an existing session at a specific message point.",
  5358. "summary": "Fork session",
  5359. "requestBody": {
  5360. "content": {
  5361. "application/json": {
  5362. "schema": {
  5363. "type": "object",
  5364. "properties": {
  5365. "messageID": {
  5366. "type": "string"
  5367. }
  5368. },
  5369. "additionalProperties": false
  5370. }
  5371. }
  5372. }
  5373. },
  5374. "x-codeSamples": [
  5375. {
  5376. "lang": "js",
  5377. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.fork({\n ...\n})"
  5378. }
  5379. ]
  5380. }
  5381. },
  5382. "/session/{sessionID}/abort": {
  5383. "post": {
  5384. "tags": ["session"],
  5385. "operationId": "session.abort",
  5386. "parameters": [
  5387. {
  5388. "name": "directory",
  5389. "in": "query",
  5390. "required": false,
  5391. "schema": {
  5392. "type": "string"
  5393. }
  5394. },
  5395. {
  5396. "name": "workspace",
  5397. "in": "query",
  5398. "required": false,
  5399. "schema": {
  5400. "type": "string"
  5401. }
  5402. },
  5403. {
  5404. "name": "sessionID",
  5405. "in": "path",
  5406. "schema": {
  5407. "type": "string",
  5408. "pattern": "^ses.*"
  5409. },
  5410. "required": true
  5411. }
  5412. ],
  5413. "responses": {
  5414. "200": {
  5415. "description": "Aborted session",
  5416. "content": {
  5417. "application/json": {
  5418. "schema": {
  5419. "type": "boolean",
  5420. "description": "Aborted session"
  5421. }
  5422. }
  5423. }
  5424. },
  5425. "400": {
  5426. "description": "Bad request",
  5427. "content": {
  5428. "application/json": {
  5429. "schema": {
  5430. "$ref": "#/components/schemas/BadRequestError"
  5431. }
  5432. }
  5433. }
  5434. },
  5435. "404": {
  5436. "description": "Not found",
  5437. "content": {
  5438. "application/json": {
  5439. "schema": {
  5440. "$ref": "#/components/schemas/NotFoundError"
  5441. }
  5442. }
  5443. }
  5444. }
  5445. },
  5446. "description": "Abort an active session and stop any ongoing AI processing or command execution.",
  5447. "summary": "Abort session",
  5448. "x-codeSamples": [
  5449. {
  5450. "lang": "js",
  5451. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.abort({\n ...\n})"
  5452. }
  5453. ]
  5454. }
  5455. },
  5456. "/session/{sessionID}/init": {
  5457. "post": {
  5458. "tags": ["session"],
  5459. "operationId": "session.init",
  5460. "parameters": [
  5461. {
  5462. "name": "directory",
  5463. "in": "query",
  5464. "required": false,
  5465. "schema": {
  5466. "type": "string"
  5467. }
  5468. },
  5469. {
  5470. "name": "workspace",
  5471. "in": "query",
  5472. "required": false,
  5473. "schema": {
  5474. "type": "string"
  5475. }
  5476. },
  5477. {
  5478. "name": "sessionID",
  5479. "in": "path",
  5480. "schema": {
  5481. "type": "string",
  5482. "pattern": "^ses.*"
  5483. },
  5484. "required": true
  5485. }
  5486. ],
  5487. "responses": {
  5488. "200": {
  5489. "description": "200",
  5490. "content": {
  5491. "application/json": {
  5492. "schema": {
  5493. "type": "boolean",
  5494. "description": "200"
  5495. }
  5496. }
  5497. }
  5498. },
  5499. "400": {
  5500. "description": "Bad request",
  5501. "content": {
  5502. "application/json": {
  5503. "schema": {
  5504. "$ref": "#/components/schemas/BadRequestError"
  5505. }
  5506. }
  5507. }
  5508. },
  5509. "404": {
  5510. "description": "Not found",
  5511. "content": {
  5512. "application/json": {
  5513. "schema": {
  5514. "$ref": "#/components/schemas/NotFoundError"
  5515. }
  5516. }
  5517. }
  5518. }
  5519. },
  5520. "description": "Analyze the current application and create an AGENTS.md file with project-specific agent configurations.",
  5521. "summary": "Initialize session",
  5522. "requestBody": {
  5523. "content": {
  5524. "application/json": {
  5525. "schema": {
  5526. "type": "object",
  5527. "properties": {
  5528. "modelID": {
  5529. "type": "string"
  5530. },
  5531. "providerID": {
  5532. "type": "string"
  5533. },
  5534. "messageID": {
  5535. "type": "string"
  5536. }
  5537. },
  5538. "required": ["modelID", "providerID", "messageID"],
  5539. "additionalProperties": false
  5540. }
  5541. }
  5542. }
  5543. },
  5544. "x-codeSamples": [
  5545. {
  5546. "lang": "js",
  5547. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.init({\n ...\n})"
  5548. }
  5549. ]
  5550. }
  5551. },
  5552. "/session/{sessionID}/share": {
  5553. "post": {
  5554. "tags": ["session"],
  5555. "operationId": "session.share",
  5556. "parameters": [
  5557. {
  5558. "name": "directory",
  5559. "in": "query",
  5560. "required": false,
  5561. "schema": {
  5562. "type": "string"
  5563. }
  5564. },
  5565. {
  5566. "name": "workspace",
  5567. "in": "query",
  5568. "required": false,
  5569. "schema": {
  5570. "type": "string"
  5571. }
  5572. },
  5573. {
  5574. "name": "sessionID",
  5575. "in": "path",
  5576. "schema": {
  5577. "type": "string",
  5578. "pattern": "^ses.*"
  5579. },
  5580. "required": true
  5581. }
  5582. ],
  5583. "responses": {
  5584. "200": {
  5585. "description": "Successfully shared session",
  5586. "content": {
  5587. "application/json": {
  5588. "schema": {
  5589. "$ref": "#/components/schemas/Session"
  5590. }
  5591. }
  5592. }
  5593. },
  5594. "400": {
  5595. "description": "Bad request",
  5596. "content": {
  5597. "application/json": {
  5598. "schema": {
  5599. "$ref": "#/components/schemas/BadRequestError"
  5600. }
  5601. }
  5602. }
  5603. },
  5604. "404": {
  5605. "description": "NotFoundError",
  5606. "content": {
  5607. "application/json": {
  5608. "schema": {
  5609. "$ref": "#/components/schemas/NotFoundError"
  5610. }
  5611. }
  5612. }
  5613. }
  5614. },
  5615. "description": "Create a shareable link for a session, allowing others to view the conversation.",
  5616. "summary": "Share session",
  5617. "x-codeSamples": [
  5618. {
  5619. "lang": "js",
  5620. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.share({\n ...\n})"
  5621. }
  5622. ]
  5623. },
  5624. "delete": {
  5625. "tags": ["session"],
  5626. "operationId": "session.unshare",
  5627. "parameters": [
  5628. {
  5629. "name": "directory",
  5630. "in": "query",
  5631. "required": false,
  5632. "schema": {
  5633. "type": "string"
  5634. }
  5635. },
  5636. {
  5637. "name": "workspace",
  5638. "in": "query",
  5639. "required": false,
  5640. "schema": {
  5641. "type": "string"
  5642. }
  5643. },
  5644. {
  5645. "name": "sessionID",
  5646. "in": "path",
  5647. "schema": {
  5648. "type": "string",
  5649. "pattern": "^ses.*"
  5650. },
  5651. "required": true
  5652. }
  5653. ],
  5654. "responses": {
  5655. "200": {
  5656. "description": "Successfully unshared session",
  5657. "content": {
  5658. "application/json": {
  5659. "schema": {
  5660. "$ref": "#/components/schemas/Session"
  5661. }
  5662. }
  5663. }
  5664. },
  5665. "400": {
  5666. "description": "Bad request",
  5667. "content": {
  5668. "application/json": {
  5669. "schema": {
  5670. "$ref": "#/components/schemas/BadRequestError"
  5671. }
  5672. }
  5673. }
  5674. },
  5675. "404": {
  5676. "description": "NotFoundError",
  5677. "content": {
  5678. "application/json": {
  5679. "schema": {
  5680. "$ref": "#/components/schemas/NotFoundError"
  5681. }
  5682. }
  5683. }
  5684. }
  5685. },
  5686. "description": "Remove the shareable link for a session, making it private again.",
  5687. "summary": "Unshare session",
  5688. "x-codeSamples": [
  5689. {
  5690. "lang": "js",
  5691. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.unshare({\n ...\n})"
  5692. }
  5693. ]
  5694. }
  5695. },
  5696. "/session/{sessionID}/summarize": {
  5697. "post": {
  5698. "tags": ["session"],
  5699. "operationId": "session.summarize",
  5700. "parameters": [
  5701. {
  5702. "name": "directory",
  5703. "in": "query",
  5704. "required": false,
  5705. "schema": {
  5706. "type": "string"
  5707. }
  5708. },
  5709. {
  5710. "name": "workspace",
  5711. "in": "query",
  5712. "required": false,
  5713. "schema": {
  5714. "type": "string"
  5715. }
  5716. },
  5717. {
  5718. "name": "sessionID",
  5719. "in": "path",
  5720. "schema": {
  5721. "type": "string",
  5722. "pattern": "^ses.*"
  5723. },
  5724. "required": true
  5725. }
  5726. ],
  5727. "responses": {
  5728. "200": {
  5729. "description": "Summarized session",
  5730. "content": {
  5731. "application/json": {
  5732. "schema": {
  5733. "type": "boolean",
  5734. "description": "Summarized session"
  5735. }
  5736. }
  5737. }
  5738. },
  5739. "400": {
  5740. "description": "Bad request",
  5741. "content": {
  5742. "application/json": {
  5743. "schema": {
  5744. "$ref": "#/components/schemas/BadRequestError"
  5745. }
  5746. }
  5747. }
  5748. },
  5749. "404": {
  5750. "description": "NotFoundError",
  5751. "content": {
  5752. "application/json": {
  5753. "schema": {
  5754. "$ref": "#/components/schemas/NotFoundError"
  5755. }
  5756. }
  5757. }
  5758. }
  5759. },
  5760. "description": "Generate a concise summary of the session using AI compaction to preserve key information.",
  5761. "summary": "Summarize session",
  5762. "requestBody": {
  5763. "content": {
  5764. "application/json": {
  5765. "schema": {
  5766. "type": "object",
  5767. "properties": {
  5768. "providerID": {
  5769. "type": "string"
  5770. },
  5771. "modelID": {
  5772. "type": "string"
  5773. },
  5774. "auto": {
  5775. "type": "boolean"
  5776. }
  5777. },
  5778. "required": ["providerID", "modelID"],
  5779. "additionalProperties": false
  5780. }
  5781. }
  5782. }
  5783. },
  5784. "x-codeSamples": [
  5785. {
  5786. "lang": "js",
  5787. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.summarize({\n ...\n})"
  5788. }
  5789. ]
  5790. }
  5791. },
  5792. "/session/{sessionID}/prompt_async": {
  5793. "post": {
  5794. "tags": ["session"],
  5795. "operationId": "session.prompt_async",
  5796. "parameters": [
  5797. {
  5798. "name": "directory",
  5799. "in": "query",
  5800. "required": false,
  5801. "schema": {
  5802. "type": "string"
  5803. }
  5804. },
  5805. {
  5806. "name": "workspace",
  5807. "in": "query",
  5808. "required": false,
  5809. "schema": {
  5810. "type": "string"
  5811. }
  5812. },
  5813. {
  5814. "name": "sessionID",
  5815. "in": "path",
  5816. "schema": {
  5817. "type": "string",
  5818. "pattern": "^ses.*"
  5819. },
  5820. "required": true
  5821. }
  5822. ],
  5823. "responses": {
  5824. "204": {
  5825. "description": "Prompt accepted"
  5826. },
  5827. "400": {
  5828. "description": "Bad request",
  5829. "content": {
  5830. "application/json": {
  5831. "schema": {
  5832. "$ref": "#/components/schemas/BadRequestError"
  5833. }
  5834. }
  5835. }
  5836. },
  5837. "404": {
  5838. "description": "Not found",
  5839. "content": {
  5840. "application/json": {
  5841. "schema": {
  5842. "$ref": "#/components/schemas/NotFoundError"
  5843. }
  5844. }
  5845. }
  5846. }
  5847. },
  5848. "description": "Create and send a new message to a session asynchronously, starting the session if needed and returning immediately.",
  5849. "summary": "Send async message",
  5850. "requestBody": {
  5851. "content": {
  5852. "application/json": {
  5853. "schema": {
  5854. "type": "object",
  5855. "properties": {
  5856. "messageID": {
  5857. "type": "string"
  5858. },
  5859. "model": {
  5860. "type": "object",
  5861. "properties": {
  5862. "providerID": {
  5863. "type": "string"
  5864. },
  5865. "modelID": {
  5866. "type": "string"
  5867. }
  5868. },
  5869. "required": ["providerID", "modelID"],
  5870. "additionalProperties": false
  5871. },
  5872. "agent": {
  5873. "type": "string"
  5874. },
  5875. "noReply": {
  5876. "type": "boolean"
  5877. },
  5878. "tools": {
  5879. "type": "object",
  5880. "additionalProperties": {
  5881. "type": "boolean"
  5882. }
  5883. },
  5884. "format": {
  5885. "$ref": "#/components/schemas/OutputFormat"
  5886. },
  5887. "system": {
  5888. "type": "string"
  5889. },
  5890. "variant": {
  5891. "type": "string"
  5892. },
  5893. "parts": {
  5894. "type": "array",
  5895. "items": {
  5896. "anyOf": [
  5897. {
  5898. "$ref": "#/components/schemas/TextPartInput"
  5899. },
  5900. {
  5901. "$ref": "#/components/schemas/FilePartInput"
  5902. },
  5903. {
  5904. "$ref": "#/components/schemas/AgentPartInput"
  5905. },
  5906. {
  5907. "$ref": "#/components/schemas/SubtaskPartInput"
  5908. }
  5909. ]
  5910. }
  5911. }
  5912. },
  5913. "required": ["parts"],
  5914. "additionalProperties": false
  5915. }
  5916. }
  5917. }
  5918. },
  5919. "x-codeSamples": [
  5920. {
  5921. "lang": "js",
  5922. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.prompt_async({\n ...\n})"
  5923. }
  5924. ]
  5925. }
  5926. },
  5927. "/session/{sessionID}/command": {
  5928. "post": {
  5929. "tags": ["session"],
  5930. "operationId": "session.command",
  5931. "parameters": [
  5932. {
  5933. "name": "directory",
  5934. "in": "query",
  5935. "required": false,
  5936. "schema": {
  5937. "type": "string"
  5938. }
  5939. },
  5940. {
  5941. "name": "workspace",
  5942. "in": "query",
  5943. "required": false,
  5944. "schema": {
  5945. "type": "string"
  5946. }
  5947. },
  5948. {
  5949. "name": "sessionID",
  5950. "in": "path",
  5951. "schema": {
  5952. "type": "string",
  5953. "pattern": "^ses.*"
  5954. },
  5955. "required": true
  5956. }
  5957. ],
  5958. "responses": {
  5959. "200": {
  5960. "description": "Created message",
  5961. "content": {
  5962. "application/json": {
  5963. "schema": {
  5964. "type": "object",
  5965. "required": ["info", "parts"],
  5966. "properties": {
  5967. "info": {
  5968. "$ref": "#/components/schemas/AssistantMessage"
  5969. },
  5970. "parts": {
  5971. "type": "array",
  5972. "items": {
  5973. "$ref": "#/components/schemas/Part"
  5974. }
  5975. }
  5976. }
  5977. }
  5978. }
  5979. }
  5980. },
  5981. "400": {
  5982. "description": "Bad request",
  5983. "content": {
  5984. "application/json": {
  5985. "schema": {
  5986. "$ref": "#/components/schemas/BadRequestError"
  5987. }
  5988. }
  5989. }
  5990. },
  5991. "404": {
  5992. "description": "Not found",
  5993. "content": {
  5994. "application/json": {
  5995. "schema": {
  5996. "$ref": "#/components/schemas/NotFoundError"
  5997. }
  5998. }
  5999. }
  6000. }
  6001. },
  6002. "description": "Send a new command to a session for execution by the AI assistant.",
  6003. "summary": "Send command",
  6004. "requestBody": {
  6005. "content": {
  6006. "application/json": {
  6007. "schema": {
  6008. "type": "object",
  6009. "properties": {
  6010. "messageID": {
  6011. "type": "string"
  6012. },
  6013. "agent": {
  6014. "type": "string"
  6015. },
  6016. "model": {
  6017. "type": "string"
  6018. },
  6019. "arguments": {
  6020. "type": "string"
  6021. },
  6022. "command": {
  6023. "type": "string"
  6024. },
  6025. "variant": {
  6026. "type": "string"
  6027. },
  6028. "parts": {
  6029. "type": "array",
  6030. "items": {
  6031. "type": "object",
  6032. "properties": {
  6033. "id": {
  6034. "type": "string"
  6035. },
  6036. "type": {
  6037. "type": "string",
  6038. "enum": ["file"]
  6039. },
  6040. "mime": {
  6041. "type": "string"
  6042. },
  6043. "filename": {
  6044. "type": "string"
  6045. },
  6046. "url": {
  6047. "type": "string"
  6048. },
  6049. "source": {
  6050. "$ref": "#/components/schemas/FilePartSource"
  6051. }
  6052. },
  6053. "required": ["type", "mime", "url"],
  6054. "additionalProperties": false
  6055. }
  6056. }
  6057. },
  6058. "required": ["arguments", "command"],
  6059. "additionalProperties": false
  6060. }
  6061. }
  6062. }
  6063. },
  6064. "x-codeSamples": [
  6065. {
  6066. "lang": "js",
  6067. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.command({\n ...\n})"
  6068. }
  6069. ]
  6070. }
  6071. },
  6072. "/session/{sessionID}/shell": {
  6073. "post": {
  6074. "tags": ["session"],
  6075. "operationId": "session.shell",
  6076. "parameters": [
  6077. {
  6078. "name": "directory",
  6079. "in": "query",
  6080. "required": false,
  6081. "schema": {
  6082. "type": "string"
  6083. }
  6084. },
  6085. {
  6086. "name": "workspace",
  6087. "in": "query",
  6088. "required": false,
  6089. "schema": {
  6090. "type": "string"
  6091. }
  6092. },
  6093. {
  6094. "name": "sessionID",
  6095. "in": "path",
  6096. "schema": {
  6097. "type": "string",
  6098. "pattern": "^ses.*"
  6099. },
  6100. "required": true
  6101. }
  6102. ],
  6103. "responses": {
  6104. "200": {
  6105. "description": "Created message",
  6106. "content": {
  6107. "application/json": {
  6108. "schema": {
  6109. "type": "object",
  6110. "properties": {
  6111. "info": {
  6112. "$ref": "#/components/schemas/Message"
  6113. },
  6114. "parts": {
  6115. "type": "array",
  6116. "items": {
  6117. "$ref": "#/components/schemas/Part"
  6118. }
  6119. }
  6120. },
  6121. "required": ["info", "parts"],
  6122. "additionalProperties": false,
  6123. "description": "Created message"
  6124. }
  6125. }
  6126. }
  6127. },
  6128. "400": {
  6129. "description": "Bad request",
  6130. "content": {
  6131. "application/json": {
  6132. "schema": {
  6133. "$ref": "#/components/schemas/BadRequestError"
  6134. }
  6135. }
  6136. }
  6137. },
  6138. "404": {
  6139. "description": "Not found",
  6140. "content": {
  6141. "application/json": {
  6142. "schema": {
  6143. "$ref": "#/components/schemas/NotFoundError"
  6144. }
  6145. }
  6146. }
  6147. }
  6148. },
  6149. "description": "Execute a shell command within the session context and return the AI's response.",
  6150. "summary": "Run shell command",
  6151. "requestBody": {
  6152. "content": {
  6153. "application/json": {
  6154. "schema": {
  6155. "type": "object",
  6156. "properties": {
  6157. "messageID": {
  6158. "type": "string"
  6159. },
  6160. "agent": {
  6161. "type": "string"
  6162. },
  6163. "model": {
  6164. "type": "object",
  6165. "properties": {
  6166. "providerID": {
  6167. "type": "string"
  6168. },
  6169. "modelID": {
  6170. "type": "string"
  6171. }
  6172. },
  6173. "required": ["providerID", "modelID"],
  6174. "additionalProperties": false
  6175. },
  6176. "command": {
  6177. "type": "string"
  6178. }
  6179. },
  6180. "required": ["agent", "command"],
  6181. "additionalProperties": false
  6182. }
  6183. }
  6184. }
  6185. },
  6186. "x-codeSamples": [
  6187. {
  6188. "lang": "js",
  6189. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.shell({\n ...\n})"
  6190. }
  6191. ]
  6192. }
  6193. },
  6194. "/session/{sessionID}/revert": {
  6195. "post": {
  6196. "tags": ["session"],
  6197. "operationId": "session.revert",
  6198. "parameters": [
  6199. {
  6200. "name": "directory",
  6201. "in": "query",
  6202. "required": false,
  6203. "schema": {
  6204. "type": "string"
  6205. }
  6206. },
  6207. {
  6208. "name": "workspace",
  6209. "in": "query",
  6210. "required": false,
  6211. "schema": {
  6212. "type": "string"
  6213. }
  6214. },
  6215. {
  6216. "name": "sessionID",
  6217. "in": "path",
  6218. "schema": {
  6219. "type": "string",
  6220. "pattern": "^ses.*"
  6221. },
  6222. "required": true
  6223. }
  6224. ],
  6225. "responses": {
  6226. "200": {
  6227. "description": "Updated session",
  6228. "content": {
  6229. "application/json": {
  6230. "schema": {
  6231. "$ref": "#/components/schemas/Session"
  6232. }
  6233. }
  6234. }
  6235. },
  6236. "400": {
  6237. "description": "Bad request",
  6238. "content": {
  6239. "application/json": {
  6240. "schema": {
  6241. "$ref": "#/components/schemas/BadRequestError"
  6242. }
  6243. }
  6244. }
  6245. },
  6246. "404": {
  6247. "description": "Not found",
  6248. "content": {
  6249. "application/json": {
  6250. "schema": {
  6251. "$ref": "#/components/schemas/NotFoundError"
  6252. }
  6253. }
  6254. }
  6255. }
  6256. },
  6257. "description": "Revert a specific message in a session, undoing its effects and restoring the previous state.",
  6258. "summary": "Revert message",
  6259. "requestBody": {
  6260. "content": {
  6261. "application/json": {
  6262. "schema": {
  6263. "type": "object",
  6264. "properties": {
  6265. "messageID": {
  6266. "type": "string"
  6267. },
  6268. "partID": {
  6269. "type": "string"
  6270. }
  6271. },
  6272. "required": ["messageID"],
  6273. "additionalProperties": false
  6274. }
  6275. }
  6276. }
  6277. },
  6278. "x-codeSamples": [
  6279. {
  6280. "lang": "js",
  6281. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.revert({\n ...\n})"
  6282. }
  6283. ]
  6284. }
  6285. },
  6286. "/session/{sessionID}/unrevert": {
  6287. "post": {
  6288. "tags": ["session"],
  6289. "operationId": "session.unrevert",
  6290. "parameters": [
  6291. {
  6292. "name": "directory",
  6293. "in": "query",
  6294. "required": false,
  6295. "schema": {
  6296. "type": "string"
  6297. }
  6298. },
  6299. {
  6300. "name": "workspace",
  6301. "in": "query",
  6302. "required": false,
  6303. "schema": {
  6304. "type": "string"
  6305. }
  6306. },
  6307. {
  6308. "name": "sessionID",
  6309. "in": "path",
  6310. "schema": {
  6311. "type": "string",
  6312. "pattern": "^ses.*"
  6313. },
  6314. "required": true
  6315. }
  6316. ],
  6317. "responses": {
  6318. "200": {
  6319. "description": "Updated session",
  6320. "content": {
  6321. "application/json": {
  6322. "schema": {
  6323. "$ref": "#/components/schemas/Session"
  6324. }
  6325. }
  6326. }
  6327. },
  6328. "400": {
  6329. "description": "Bad request",
  6330. "content": {
  6331. "application/json": {
  6332. "schema": {
  6333. "$ref": "#/components/schemas/BadRequestError"
  6334. }
  6335. }
  6336. }
  6337. },
  6338. "404": {
  6339. "description": "Not found",
  6340. "content": {
  6341. "application/json": {
  6342. "schema": {
  6343. "$ref": "#/components/schemas/NotFoundError"
  6344. }
  6345. }
  6346. }
  6347. }
  6348. },
  6349. "description": "Restore all previously reverted messages in a session.",
  6350. "summary": "Restore reverted messages",
  6351. "x-codeSamples": [
  6352. {
  6353. "lang": "js",
  6354. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.unrevert({\n ...\n})"
  6355. }
  6356. ]
  6357. }
  6358. },
  6359. "/session/{sessionID}/permissions/{permissionID}": {
  6360. "post": {
  6361. "tags": ["session"],
  6362. "operationId": "permission.respond",
  6363. "parameters": [
  6364. {
  6365. "name": "directory",
  6366. "in": "query",
  6367. "required": false,
  6368. "schema": {
  6369. "type": "string"
  6370. }
  6371. },
  6372. {
  6373. "name": "workspace",
  6374. "in": "query",
  6375. "required": false,
  6376. "schema": {
  6377. "type": "string"
  6378. }
  6379. },
  6380. {
  6381. "name": "sessionID",
  6382. "in": "path",
  6383. "schema": {
  6384. "type": "string",
  6385. "pattern": "^ses.*"
  6386. },
  6387. "required": true
  6388. },
  6389. {
  6390. "name": "permissionID",
  6391. "in": "path",
  6392. "schema": {
  6393. "type": "string",
  6394. "pattern": "^per.*"
  6395. },
  6396. "required": true
  6397. }
  6398. ],
  6399. "responses": {
  6400. "200": {
  6401. "description": "Permission processed successfully",
  6402. "content": {
  6403. "application/json": {
  6404. "schema": {
  6405. "type": "boolean",
  6406. "description": "Permission processed successfully"
  6407. }
  6408. }
  6409. }
  6410. },
  6411. "400": {
  6412. "description": "Bad request",
  6413. "content": {
  6414. "application/json": {
  6415. "schema": {
  6416. "$ref": "#/components/schemas/BadRequestError"
  6417. }
  6418. }
  6419. }
  6420. },
  6421. "404": {
  6422. "description": "Not found",
  6423. "content": {
  6424. "application/json": {
  6425. "schema": {
  6426. "$ref": "#/components/schemas/NotFoundError"
  6427. }
  6428. }
  6429. }
  6430. }
  6431. },
  6432. "description": "Approve or deny a permission request from the AI assistant.",
  6433. "summary": "Respond to permission",
  6434. "deprecated": true,
  6435. "requestBody": {
  6436. "content": {
  6437. "application/json": {
  6438. "schema": {
  6439. "type": "object",
  6440. "properties": {
  6441. "response": {
  6442. "type": "string",
  6443. "enum": ["once", "always", "reject"]
  6444. }
  6445. },
  6446. "required": ["response"],
  6447. "additionalProperties": false
  6448. }
  6449. }
  6450. }
  6451. },
  6452. "x-codeSamples": [
  6453. {
  6454. "lang": "js",
  6455. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.permission.respond({\n ...\n})"
  6456. }
  6457. ]
  6458. }
  6459. },
  6460. "/session/{sessionID}/message/{messageID}/part/{partID}": {
  6461. "delete": {
  6462. "tags": ["session"],
  6463. "operationId": "part.delete",
  6464. "parameters": [
  6465. {
  6466. "name": "directory",
  6467. "in": "query",
  6468. "required": false,
  6469. "schema": {
  6470. "type": "string"
  6471. }
  6472. },
  6473. {
  6474. "name": "workspace",
  6475. "in": "query",
  6476. "required": false,
  6477. "schema": {
  6478. "type": "string"
  6479. }
  6480. },
  6481. {
  6482. "name": "sessionID",
  6483. "in": "path",
  6484. "schema": {
  6485. "type": "string",
  6486. "pattern": "^ses.*"
  6487. },
  6488. "required": true
  6489. },
  6490. {
  6491. "name": "messageID",
  6492. "in": "path",
  6493. "schema": {
  6494. "type": "string",
  6495. "pattern": "^msg.*"
  6496. },
  6497. "required": true
  6498. },
  6499. {
  6500. "name": "partID",
  6501. "in": "path",
  6502. "schema": {
  6503. "type": "string",
  6504. "pattern": "^prt.*"
  6505. },
  6506. "required": true
  6507. }
  6508. ],
  6509. "responses": {
  6510. "200": {
  6511. "description": "Successfully deleted part",
  6512. "content": {
  6513. "application/json": {
  6514. "schema": {
  6515. "type": "boolean",
  6516. "description": "Successfully deleted part"
  6517. }
  6518. }
  6519. }
  6520. },
  6521. "400": {
  6522. "description": "Bad request",
  6523. "content": {
  6524. "application/json": {
  6525. "schema": {
  6526. "$ref": "#/components/schemas/BadRequestError"
  6527. }
  6528. }
  6529. }
  6530. },
  6531. "404": {
  6532. "description": "Not found",
  6533. "content": {
  6534. "application/json": {
  6535. "schema": {
  6536. "$ref": "#/components/schemas/NotFoundError"
  6537. }
  6538. }
  6539. }
  6540. }
  6541. },
  6542. "description": "Delete a part from a message.",
  6543. "x-codeSamples": [
  6544. {
  6545. "lang": "js",
  6546. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.part.delete({\n ...\n})"
  6547. }
  6548. ]
  6549. },
  6550. "patch": {
  6551. "tags": ["session"],
  6552. "operationId": "part.update",
  6553. "parameters": [
  6554. {
  6555. "name": "directory",
  6556. "in": "query",
  6557. "required": false,
  6558. "schema": {
  6559. "type": "string"
  6560. }
  6561. },
  6562. {
  6563. "name": "workspace",
  6564. "in": "query",
  6565. "required": false,
  6566. "schema": {
  6567. "type": "string"
  6568. }
  6569. },
  6570. {
  6571. "name": "sessionID",
  6572. "in": "path",
  6573. "schema": {
  6574. "type": "string",
  6575. "pattern": "^ses.*"
  6576. },
  6577. "required": true
  6578. },
  6579. {
  6580. "name": "messageID",
  6581. "in": "path",
  6582. "schema": {
  6583. "type": "string",
  6584. "pattern": "^msg.*"
  6585. },
  6586. "required": true
  6587. },
  6588. {
  6589. "name": "partID",
  6590. "in": "path",
  6591. "schema": {
  6592. "type": "string",
  6593. "pattern": "^prt.*"
  6594. },
  6595. "required": true
  6596. }
  6597. ],
  6598. "responses": {
  6599. "200": {
  6600. "description": "Successfully updated part",
  6601. "content": {
  6602. "application/json": {
  6603. "schema": {
  6604. "$ref": "#/components/schemas/Part"
  6605. }
  6606. }
  6607. }
  6608. },
  6609. "400": {
  6610. "description": "Bad request",
  6611. "content": {
  6612. "application/json": {
  6613. "schema": {
  6614. "$ref": "#/components/schemas/BadRequestError"
  6615. }
  6616. }
  6617. }
  6618. },
  6619. "404": {
  6620. "description": "Not found",
  6621. "content": {
  6622. "application/json": {
  6623. "schema": {
  6624. "$ref": "#/components/schemas/NotFoundError"
  6625. }
  6626. }
  6627. }
  6628. }
  6629. },
  6630. "description": "Update a part in a message.",
  6631. "requestBody": {
  6632. "content": {
  6633. "application/json": {
  6634. "schema": {
  6635. "$ref": "#/components/schemas/Part"
  6636. }
  6637. }
  6638. }
  6639. },
  6640. "x-codeSamples": [
  6641. {
  6642. "lang": "js",
  6643. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.part.update({\n ...\n})"
  6644. }
  6645. ]
  6646. }
  6647. },
  6648. "/sync/start": {
  6649. "post": {
  6650. "tags": ["sync"],
  6651. "operationId": "sync.start",
  6652. "parameters": [
  6653. {
  6654. "name": "directory",
  6655. "in": "query",
  6656. "required": false,
  6657. "schema": {
  6658. "type": "string"
  6659. }
  6660. },
  6661. {
  6662. "name": "workspace",
  6663. "in": "query",
  6664. "required": false,
  6665. "schema": {
  6666. "type": "string"
  6667. }
  6668. }
  6669. ],
  6670. "responses": {
  6671. "200": {
  6672. "description": "Workspace sync started",
  6673. "content": {
  6674. "application/json": {
  6675. "schema": {
  6676. "type": "boolean",
  6677. "description": "Workspace sync started"
  6678. }
  6679. }
  6680. }
  6681. }
  6682. },
  6683. "description": "Start sync loops for workspaces in the current project that have active sessions.",
  6684. "summary": "Start workspace sync",
  6685. "x-codeSamples": [
  6686. {
  6687. "lang": "js",
  6688. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.sync.start({\n ...\n})"
  6689. }
  6690. ]
  6691. }
  6692. },
  6693. "/sync/replay": {
  6694. "post": {
  6695. "tags": ["sync"],
  6696. "operationId": "sync.replay",
  6697. "parameters": [
  6698. {
  6699. "name": "directory",
  6700. "in": "query",
  6701. "required": false,
  6702. "schema": {
  6703. "type": "string"
  6704. }
  6705. },
  6706. {
  6707. "name": "workspace",
  6708. "in": "query",
  6709. "required": false,
  6710. "schema": {
  6711. "type": "string"
  6712. }
  6713. }
  6714. ],
  6715. "responses": {
  6716. "200": {
  6717. "description": "Replayed sync events",
  6718. "content": {
  6719. "application/json": {
  6720. "schema": {
  6721. "type": "object",
  6722. "properties": {
  6723. "sessionID": {
  6724. "type": "string"
  6725. }
  6726. },
  6727. "required": ["sessionID"],
  6728. "additionalProperties": false,
  6729. "description": "Replayed sync events"
  6730. }
  6731. }
  6732. }
  6733. },
  6734. "400": {
  6735. "description": "Bad request",
  6736. "content": {
  6737. "application/json": {
  6738. "schema": {
  6739. "$ref": "#/components/schemas/BadRequestError"
  6740. }
  6741. }
  6742. }
  6743. }
  6744. },
  6745. "description": "Validate and replay a complete sync event history.",
  6746. "summary": "Replay sync events",
  6747. "requestBody": {
  6748. "content": {
  6749. "application/json": {
  6750. "schema": {
  6751. "type": "object",
  6752. "properties": {
  6753. "directory": {
  6754. "type": "string"
  6755. },
  6756. "events": {
  6757. "type": "array",
  6758. "minItems": 1,
  6759. "items": {
  6760. "type": "object",
  6761. "properties": {
  6762. "id": {
  6763. "type": "string"
  6764. },
  6765. "aggregateID": {
  6766. "type": "string"
  6767. },
  6768. "seq": {
  6769. "type": "integer",
  6770. "minimum": 0
  6771. },
  6772. "type": {
  6773. "type": "string"
  6774. },
  6775. "data": {
  6776. "type": "object"
  6777. }
  6778. },
  6779. "required": ["id", "aggregateID", "seq", "type", "data"],
  6780. "additionalProperties": false
  6781. }
  6782. }
  6783. },
  6784. "required": ["directory", "events"],
  6785. "additionalProperties": false
  6786. }
  6787. }
  6788. }
  6789. },
  6790. "x-codeSamples": [
  6791. {
  6792. "lang": "js",
  6793. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.sync.replay({\n ...\n})"
  6794. }
  6795. ]
  6796. }
  6797. },
  6798. "/sync/steal": {
  6799. "post": {
  6800. "tags": ["sync"],
  6801. "operationId": "sync.steal",
  6802. "parameters": [
  6803. {
  6804. "name": "directory",
  6805. "in": "query",
  6806. "required": false,
  6807. "schema": {
  6808. "type": "string"
  6809. }
  6810. },
  6811. {
  6812. "name": "workspace",
  6813. "in": "query",
  6814. "required": false,
  6815. "schema": {
  6816. "type": "string"
  6817. }
  6818. }
  6819. ],
  6820. "responses": {
  6821. "200": {
  6822. "description": "Session stolen into workspace",
  6823. "content": {
  6824. "application/json": {
  6825. "schema": {
  6826. "type": "object",
  6827. "properties": {
  6828. "sessionID": {
  6829. "type": "string"
  6830. }
  6831. },
  6832. "required": ["sessionID"],
  6833. "additionalProperties": false,
  6834. "description": "Session stolen into workspace"
  6835. }
  6836. }
  6837. }
  6838. },
  6839. "400": {
  6840. "description": "Bad request",
  6841. "content": {
  6842. "application/json": {
  6843. "schema": {
  6844. "$ref": "#/components/schemas/BadRequestError"
  6845. }
  6846. }
  6847. }
  6848. }
  6849. },
  6850. "description": "Update a session to belong to the current workspace through the sync event system.",
  6851. "summary": "Steal session into workspace",
  6852. "requestBody": {
  6853. "content": {
  6854. "application/json": {
  6855. "schema": {
  6856. "type": "object",
  6857. "properties": {
  6858. "sessionID": {
  6859. "type": "string"
  6860. }
  6861. },
  6862. "required": ["sessionID"],
  6863. "additionalProperties": false
  6864. }
  6865. }
  6866. }
  6867. },
  6868. "x-codeSamples": [
  6869. {
  6870. "lang": "js",
  6871. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.sync.steal({\n ...\n})"
  6872. }
  6873. ]
  6874. }
  6875. },
  6876. "/sync/history": {
  6877. "post": {
  6878. "tags": ["sync"],
  6879. "operationId": "sync.history.list",
  6880. "parameters": [
  6881. {
  6882. "name": "directory",
  6883. "in": "query",
  6884. "required": false,
  6885. "schema": {
  6886. "type": "string"
  6887. }
  6888. },
  6889. {
  6890. "name": "workspace",
  6891. "in": "query",
  6892. "required": false,
  6893. "schema": {
  6894. "type": "string"
  6895. }
  6896. }
  6897. ],
  6898. "responses": {
  6899. "200": {
  6900. "description": "Sync events",
  6901. "content": {
  6902. "application/json": {
  6903. "schema": {
  6904. "type": "array",
  6905. "items": {
  6906. "type": "object",
  6907. "properties": {
  6908. "id": {
  6909. "type": "string"
  6910. },
  6911. "aggregate_id": {
  6912. "type": "string"
  6913. },
  6914. "seq": {
  6915. "type": "integer",
  6916. "minimum": 0
  6917. },
  6918. "type": {
  6919. "type": "string"
  6920. },
  6921. "data": {
  6922. "type": "object"
  6923. }
  6924. },
  6925. "required": ["id", "aggregate_id", "seq", "type", "data"],
  6926. "additionalProperties": false
  6927. },
  6928. "description": "Sync events"
  6929. }
  6930. }
  6931. }
  6932. },
  6933. "400": {
  6934. "description": "Bad request",
  6935. "content": {
  6936. "application/json": {
  6937. "schema": {
  6938. "$ref": "#/components/schemas/BadRequestError"
  6939. }
  6940. }
  6941. }
  6942. }
  6943. },
  6944. "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.",
  6945. "summary": "List sync events",
  6946. "requestBody": {
  6947. "content": {
  6948. "application/json": {
  6949. "schema": {
  6950. "type": "object",
  6951. "additionalProperties": {
  6952. "type": "integer",
  6953. "minimum": 0
  6954. }
  6955. }
  6956. }
  6957. }
  6958. },
  6959. "x-codeSamples": [
  6960. {
  6961. "lang": "js",
  6962. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.sync.history.list({\n ...\n})"
  6963. }
  6964. ]
  6965. }
  6966. },
  6967. "/api/session": {
  6968. "get": {
  6969. "tags": ["v2"],
  6970. "operationId": "v2.session.list",
  6971. "parameters": [
  6972. {
  6973. "name": "directory",
  6974. "in": "query",
  6975. "required": false,
  6976. "schema": {
  6977. "type": "string"
  6978. }
  6979. },
  6980. {
  6981. "name": "workspace",
  6982. "in": "query",
  6983. "required": false,
  6984. "schema": {
  6985. "type": "string"
  6986. }
  6987. }
  6988. ],
  6989. "responses": {
  6990. "200": {
  6991. "description": "V2SessionsResponse",
  6992. "content": {
  6993. "application/json": {
  6994. "schema": {
  6995. "$ref": "#/components/schemas/V2SessionsResponse"
  6996. }
  6997. }
  6998. }
  6999. },
  7000. "400": {
  7001. "description": "Bad request",
  7002. "content": {
  7003. "application/json": {
  7004. "schema": {
  7005. "$ref": "#/components/schemas/BadRequestError"
  7006. }
  7007. }
  7008. }
  7009. }
  7010. },
  7011. "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.",
  7012. "summary": "List v2 sessions",
  7013. "x-codeSamples": [
  7014. {
  7015. "lang": "js",
  7016. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.list({\n ...\n})"
  7017. }
  7018. ]
  7019. }
  7020. },
  7021. "/api/session/{sessionID}/prompt": {
  7022. "post": {
  7023. "tags": ["v2"],
  7024. "operationId": "v2.session.prompt",
  7025. "parameters": [
  7026. {
  7027. "name": "directory",
  7028. "in": "query",
  7029. "required": false,
  7030. "schema": {
  7031. "type": "string"
  7032. }
  7033. },
  7034. {
  7035. "name": "workspace",
  7036. "in": "query",
  7037. "required": false,
  7038. "schema": {
  7039. "type": "string"
  7040. }
  7041. },
  7042. {
  7043. "name": "sessionID",
  7044. "in": "path",
  7045. "schema": {
  7046. "type": "string",
  7047. "pattern": "^ses.*"
  7048. },
  7049. "required": true
  7050. }
  7051. ],
  7052. "responses": {
  7053. "200": {
  7054. "description": "Session.Message",
  7055. "content": {
  7056. "application/json": {
  7057. "schema": {
  7058. "$ref": "#/components/schemas/SessionMessage"
  7059. }
  7060. }
  7061. }
  7062. }
  7063. },
  7064. "description": "Create a v2 session message and queue it for the agent loop.",
  7065. "summary": "Send v2 message",
  7066. "requestBody": {
  7067. "content": {
  7068. "application/json": {
  7069. "schema": {
  7070. "type": "object",
  7071. "properties": {
  7072. "prompt": {
  7073. "$ref": "#/components/schemas/Prompt"
  7074. },
  7075. "delivery": {
  7076. "$ref": "#/components/schemas/SessionDelivery"
  7077. }
  7078. },
  7079. "required": ["prompt"],
  7080. "additionalProperties": false
  7081. }
  7082. }
  7083. }
  7084. },
  7085. "x-codeSamples": [
  7086. {
  7087. "lang": "js",
  7088. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.prompt({\n ...\n})"
  7089. }
  7090. ]
  7091. }
  7092. },
  7093. "/api/session/{sessionID}/compact": {
  7094. "post": {
  7095. "tags": ["v2"],
  7096. "operationId": "v2.session.compact",
  7097. "parameters": [
  7098. {
  7099. "name": "directory",
  7100. "in": "query",
  7101. "required": false,
  7102. "schema": {
  7103. "type": "string"
  7104. }
  7105. },
  7106. {
  7107. "name": "workspace",
  7108. "in": "query",
  7109. "required": false,
  7110. "schema": {
  7111. "type": "string"
  7112. }
  7113. },
  7114. {
  7115. "name": "sessionID",
  7116. "in": "path",
  7117. "schema": {
  7118. "type": "string",
  7119. "pattern": "^ses.*"
  7120. },
  7121. "required": true
  7122. }
  7123. ],
  7124. "responses": {
  7125. "204": {
  7126. "description": "<No Content>"
  7127. }
  7128. },
  7129. "description": "Compact a v2 session conversation.",
  7130. "summary": "Compact v2 session",
  7131. "x-codeSamples": [
  7132. {
  7133. "lang": "js",
  7134. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.compact({\n ...\n})"
  7135. }
  7136. ]
  7137. }
  7138. },
  7139. "/api/session/{sessionID}/wait": {
  7140. "post": {
  7141. "tags": ["v2"],
  7142. "operationId": "v2.session.wait",
  7143. "parameters": [
  7144. {
  7145. "name": "directory",
  7146. "in": "query",
  7147. "required": false,
  7148. "schema": {
  7149. "type": "string"
  7150. }
  7151. },
  7152. {
  7153. "name": "workspace",
  7154. "in": "query",
  7155. "required": false,
  7156. "schema": {
  7157. "type": "string"
  7158. }
  7159. },
  7160. {
  7161. "name": "sessionID",
  7162. "in": "path",
  7163. "schema": {
  7164. "type": "string",
  7165. "pattern": "^ses.*"
  7166. },
  7167. "required": true
  7168. }
  7169. ],
  7170. "responses": {
  7171. "204": {
  7172. "description": "<No Content>"
  7173. }
  7174. },
  7175. "description": "Wait for a v2 session agent loop to become idle.",
  7176. "summary": "Wait for v2 session",
  7177. "x-codeSamples": [
  7178. {
  7179. "lang": "js",
  7180. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.wait({\n ...\n})"
  7181. }
  7182. ]
  7183. }
  7184. },
  7185. "/api/session/{sessionID}/context": {
  7186. "get": {
  7187. "tags": ["v2"],
  7188. "operationId": "v2.session.context",
  7189. "parameters": [
  7190. {
  7191. "name": "directory",
  7192. "in": "query",
  7193. "required": false,
  7194. "schema": {
  7195. "type": "string"
  7196. }
  7197. },
  7198. {
  7199. "name": "workspace",
  7200. "in": "query",
  7201. "required": false,
  7202. "schema": {
  7203. "type": "string"
  7204. }
  7205. },
  7206. {
  7207. "name": "sessionID",
  7208. "in": "path",
  7209. "schema": {
  7210. "type": "string",
  7211. "pattern": "^ses.*"
  7212. },
  7213. "required": true
  7214. }
  7215. ],
  7216. "responses": {
  7217. "200": {
  7218. "description": "Success",
  7219. "content": {
  7220. "application/json": {
  7221. "schema": {
  7222. "type": "array",
  7223. "items": {
  7224. "$ref": "#/components/schemas/SessionMessage"
  7225. }
  7226. }
  7227. }
  7228. }
  7229. }
  7230. },
  7231. "description": "Retrieve the active context messages for a v2 session (all messages after the last compaction).",
  7232. "summary": "Get v2 session context",
  7233. "x-codeSamples": [
  7234. {
  7235. "lang": "js",
  7236. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.context({\n ...\n})"
  7237. }
  7238. ]
  7239. }
  7240. },
  7241. "/api/session/{sessionID}/message": {
  7242. "get": {
  7243. "tags": ["v2 messages"],
  7244. "operationId": "v2.session.messages",
  7245. "parameters": [
  7246. {
  7247. "name": "directory",
  7248. "in": "query",
  7249. "required": false,
  7250. "schema": {
  7251. "type": "string"
  7252. }
  7253. },
  7254. {
  7255. "name": "workspace",
  7256. "in": "query",
  7257. "required": false,
  7258. "schema": {
  7259. "type": "string"
  7260. }
  7261. },
  7262. {
  7263. "name": "sessionID",
  7264. "in": "path",
  7265. "schema": {
  7266. "type": "string",
  7267. "pattern": "^ses.*"
  7268. },
  7269. "required": true
  7270. }
  7271. ],
  7272. "responses": {
  7273. "200": {
  7274. "description": "V2SessionMessagesResponse",
  7275. "content": {
  7276. "application/json": {
  7277. "schema": {
  7278. "$ref": "#/components/schemas/V2SessionMessagesResponse"
  7279. }
  7280. }
  7281. }
  7282. },
  7283. "400": {
  7284. "description": "Bad request",
  7285. "content": {
  7286. "application/json": {
  7287. "schema": {
  7288. "$ref": "#/components/schemas/BadRequestError"
  7289. }
  7290. }
  7291. }
  7292. }
  7293. },
  7294. "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.",
  7295. "summary": "Get v2 session messages",
  7296. "x-codeSamples": [
  7297. {
  7298. "lang": "js",
  7299. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.messages({\n ...\n})"
  7300. }
  7301. ]
  7302. }
  7303. },
  7304. "/tui/append-prompt": {
  7305. "post": {
  7306. "tags": ["tui"],
  7307. "operationId": "tui.appendPrompt",
  7308. "parameters": [
  7309. {
  7310. "name": "directory",
  7311. "in": "query",
  7312. "required": false,
  7313. "schema": {
  7314. "type": "string"
  7315. }
  7316. },
  7317. {
  7318. "name": "workspace",
  7319. "in": "query",
  7320. "required": false,
  7321. "schema": {
  7322. "type": "string"
  7323. }
  7324. }
  7325. ],
  7326. "responses": {
  7327. "200": {
  7328. "description": "Prompt processed successfully",
  7329. "content": {
  7330. "application/json": {
  7331. "schema": {
  7332. "type": "boolean",
  7333. "description": "Prompt processed successfully"
  7334. }
  7335. }
  7336. }
  7337. },
  7338. "400": {
  7339. "description": "Bad request",
  7340. "content": {
  7341. "application/json": {
  7342. "schema": {
  7343. "$ref": "#/components/schemas/BadRequestError"
  7344. }
  7345. }
  7346. }
  7347. }
  7348. },
  7349. "description": "Append prompt to the TUI.",
  7350. "summary": "Append TUI prompt",
  7351. "requestBody": {
  7352. "content": {
  7353. "application/json": {
  7354. "schema": {
  7355. "type": "object",
  7356. "properties": {
  7357. "text": {
  7358. "type": "string"
  7359. }
  7360. },
  7361. "required": ["text"],
  7362. "additionalProperties": false
  7363. }
  7364. }
  7365. }
  7366. },
  7367. "x-codeSamples": [
  7368. {
  7369. "lang": "js",
  7370. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.appendPrompt({\n ...\n})"
  7371. }
  7372. ]
  7373. }
  7374. },
  7375. "/tui/open-help": {
  7376. "post": {
  7377. "tags": ["tui"],
  7378. "operationId": "tui.openHelp",
  7379. "parameters": [
  7380. {
  7381. "name": "directory",
  7382. "in": "query",
  7383. "required": false,
  7384. "schema": {
  7385. "type": "string"
  7386. }
  7387. },
  7388. {
  7389. "name": "workspace",
  7390. "in": "query",
  7391. "required": false,
  7392. "schema": {
  7393. "type": "string"
  7394. }
  7395. }
  7396. ],
  7397. "responses": {
  7398. "200": {
  7399. "description": "Help dialog opened successfully",
  7400. "content": {
  7401. "application/json": {
  7402. "schema": {
  7403. "type": "boolean",
  7404. "description": "Help dialog opened successfully"
  7405. }
  7406. }
  7407. }
  7408. }
  7409. },
  7410. "description": "Open the help dialog in the TUI to display user assistance information.",
  7411. "summary": "Open help dialog",
  7412. "x-codeSamples": [
  7413. {
  7414. "lang": "js",
  7415. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openHelp({\n ...\n})"
  7416. }
  7417. ]
  7418. }
  7419. },
  7420. "/tui/open-sessions": {
  7421. "post": {
  7422. "tags": ["tui"],
  7423. "operationId": "tui.openSessions",
  7424. "parameters": [
  7425. {
  7426. "name": "directory",
  7427. "in": "query",
  7428. "required": false,
  7429. "schema": {
  7430. "type": "string"
  7431. }
  7432. },
  7433. {
  7434. "name": "workspace",
  7435. "in": "query",
  7436. "required": false,
  7437. "schema": {
  7438. "type": "string"
  7439. }
  7440. }
  7441. ],
  7442. "responses": {
  7443. "200": {
  7444. "description": "Session dialog opened successfully",
  7445. "content": {
  7446. "application/json": {
  7447. "schema": {
  7448. "type": "boolean",
  7449. "description": "Session dialog opened successfully"
  7450. }
  7451. }
  7452. }
  7453. }
  7454. },
  7455. "description": "Open the session dialog.",
  7456. "summary": "Open sessions dialog",
  7457. "x-codeSamples": [
  7458. {
  7459. "lang": "js",
  7460. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openSessions({\n ...\n})"
  7461. }
  7462. ]
  7463. }
  7464. },
  7465. "/tui/open-themes": {
  7466. "post": {
  7467. "tags": ["tui"],
  7468. "operationId": "tui.openThemes",
  7469. "parameters": [
  7470. {
  7471. "name": "directory",
  7472. "in": "query",
  7473. "required": false,
  7474. "schema": {
  7475. "type": "string"
  7476. }
  7477. },
  7478. {
  7479. "name": "workspace",
  7480. "in": "query",
  7481. "required": false,
  7482. "schema": {
  7483. "type": "string"
  7484. }
  7485. }
  7486. ],
  7487. "responses": {
  7488. "200": {
  7489. "description": "Theme dialog opened successfully",
  7490. "content": {
  7491. "application/json": {
  7492. "schema": {
  7493. "type": "boolean",
  7494. "description": "Theme dialog opened successfully"
  7495. }
  7496. }
  7497. }
  7498. }
  7499. },
  7500. "description": "Open the theme dialog.",
  7501. "summary": "Open themes dialog",
  7502. "x-codeSamples": [
  7503. {
  7504. "lang": "js",
  7505. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openThemes({\n ...\n})"
  7506. }
  7507. ]
  7508. }
  7509. },
  7510. "/tui/open-models": {
  7511. "post": {
  7512. "tags": ["tui"],
  7513. "operationId": "tui.openModels",
  7514. "parameters": [
  7515. {
  7516. "name": "directory",
  7517. "in": "query",
  7518. "required": false,
  7519. "schema": {
  7520. "type": "string"
  7521. }
  7522. },
  7523. {
  7524. "name": "workspace",
  7525. "in": "query",
  7526. "required": false,
  7527. "schema": {
  7528. "type": "string"
  7529. }
  7530. }
  7531. ],
  7532. "responses": {
  7533. "200": {
  7534. "description": "Model dialog opened successfully",
  7535. "content": {
  7536. "application/json": {
  7537. "schema": {
  7538. "type": "boolean",
  7539. "description": "Model dialog opened successfully"
  7540. }
  7541. }
  7542. }
  7543. }
  7544. },
  7545. "description": "Open the model dialog.",
  7546. "summary": "Open models dialog",
  7547. "x-codeSamples": [
  7548. {
  7549. "lang": "js",
  7550. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openModels({\n ...\n})"
  7551. }
  7552. ]
  7553. }
  7554. },
  7555. "/tui/submit-prompt": {
  7556. "post": {
  7557. "tags": ["tui"],
  7558. "operationId": "tui.submitPrompt",
  7559. "parameters": [
  7560. {
  7561. "name": "directory",
  7562. "in": "query",
  7563. "required": false,
  7564. "schema": {
  7565. "type": "string"
  7566. }
  7567. },
  7568. {
  7569. "name": "workspace",
  7570. "in": "query",
  7571. "required": false,
  7572. "schema": {
  7573. "type": "string"
  7574. }
  7575. }
  7576. ],
  7577. "responses": {
  7578. "200": {
  7579. "description": "Prompt submitted successfully",
  7580. "content": {
  7581. "application/json": {
  7582. "schema": {
  7583. "type": "boolean",
  7584. "description": "Prompt submitted successfully"
  7585. }
  7586. }
  7587. }
  7588. }
  7589. },
  7590. "description": "Submit the prompt.",
  7591. "summary": "Submit TUI prompt",
  7592. "x-codeSamples": [
  7593. {
  7594. "lang": "js",
  7595. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.submitPrompt({\n ...\n})"
  7596. }
  7597. ]
  7598. }
  7599. },
  7600. "/tui/clear-prompt": {
  7601. "post": {
  7602. "tags": ["tui"],
  7603. "operationId": "tui.clearPrompt",
  7604. "parameters": [
  7605. {
  7606. "name": "directory",
  7607. "in": "query",
  7608. "required": false,
  7609. "schema": {
  7610. "type": "string"
  7611. }
  7612. },
  7613. {
  7614. "name": "workspace",
  7615. "in": "query",
  7616. "required": false,
  7617. "schema": {
  7618. "type": "string"
  7619. }
  7620. }
  7621. ],
  7622. "responses": {
  7623. "200": {
  7624. "description": "Prompt cleared successfully",
  7625. "content": {
  7626. "application/json": {
  7627. "schema": {
  7628. "type": "boolean",
  7629. "description": "Prompt cleared successfully"
  7630. }
  7631. }
  7632. }
  7633. }
  7634. },
  7635. "description": "Clear the prompt.",
  7636. "summary": "Clear TUI prompt",
  7637. "x-codeSamples": [
  7638. {
  7639. "lang": "js",
  7640. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.clearPrompt({\n ...\n})"
  7641. }
  7642. ]
  7643. }
  7644. },
  7645. "/tui/execute-command": {
  7646. "post": {
  7647. "tags": ["tui"],
  7648. "operationId": "tui.executeCommand",
  7649. "parameters": [
  7650. {
  7651. "name": "directory",
  7652. "in": "query",
  7653. "required": false,
  7654. "schema": {
  7655. "type": "string"
  7656. }
  7657. },
  7658. {
  7659. "name": "workspace",
  7660. "in": "query",
  7661. "required": false,
  7662. "schema": {
  7663. "type": "string"
  7664. }
  7665. }
  7666. ],
  7667. "responses": {
  7668. "200": {
  7669. "description": "Command executed successfully",
  7670. "content": {
  7671. "application/json": {
  7672. "schema": {
  7673. "type": "boolean",
  7674. "description": "Command executed successfully"
  7675. }
  7676. }
  7677. }
  7678. },
  7679. "400": {
  7680. "description": "Bad request",
  7681. "content": {
  7682. "application/json": {
  7683. "schema": {
  7684. "$ref": "#/components/schemas/BadRequestError"
  7685. }
  7686. }
  7687. }
  7688. }
  7689. },
  7690. "description": "Execute a TUI command.",
  7691. "summary": "Execute TUI command",
  7692. "requestBody": {
  7693. "content": {
  7694. "application/json": {
  7695. "schema": {
  7696. "type": "object",
  7697. "properties": {
  7698. "command": {
  7699. "type": "string"
  7700. }
  7701. },
  7702. "required": ["command"],
  7703. "additionalProperties": false
  7704. }
  7705. }
  7706. }
  7707. },
  7708. "x-codeSamples": [
  7709. {
  7710. "lang": "js",
  7711. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.executeCommand({\n ...\n})"
  7712. }
  7713. ]
  7714. }
  7715. },
  7716. "/tui/show-toast": {
  7717. "post": {
  7718. "tags": ["tui"],
  7719. "operationId": "tui.showToast",
  7720. "parameters": [
  7721. {
  7722. "name": "directory",
  7723. "in": "query",
  7724. "required": false,
  7725. "schema": {
  7726. "type": "string"
  7727. }
  7728. },
  7729. {
  7730. "name": "workspace",
  7731. "in": "query",
  7732. "required": false,
  7733. "schema": {
  7734. "type": "string"
  7735. }
  7736. }
  7737. ],
  7738. "responses": {
  7739. "200": {
  7740. "description": "Toast notification shown successfully",
  7741. "content": {
  7742. "application/json": {
  7743. "schema": {
  7744. "type": "boolean",
  7745. "description": "Toast notification shown successfully"
  7746. }
  7747. }
  7748. }
  7749. }
  7750. },
  7751. "description": "Show a toast notification in the TUI.",
  7752. "summary": "Show TUI toast",
  7753. "requestBody": {
  7754. "content": {
  7755. "application/json": {
  7756. "schema": {
  7757. "type": "object",
  7758. "properties": {
  7759. "title": {
  7760. "type": "string"
  7761. },
  7762. "message": {
  7763. "type": "string"
  7764. },
  7765. "variant": {
  7766. "type": "string",
  7767. "enum": ["info", "success", "warning", "error"]
  7768. },
  7769. "duration": {
  7770. "type": "integer",
  7771. "exclusiveMinimum": 0
  7772. }
  7773. },
  7774. "required": ["message", "variant"],
  7775. "additionalProperties": false
  7776. }
  7777. }
  7778. }
  7779. },
  7780. "x-codeSamples": [
  7781. {
  7782. "lang": "js",
  7783. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.showToast({\n ...\n})"
  7784. }
  7785. ]
  7786. }
  7787. },
  7788. "/tui/publish": {
  7789. "post": {
  7790. "tags": ["tui"],
  7791. "operationId": "tui.publish",
  7792. "parameters": [
  7793. {
  7794. "name": "directory",
  7795. "in": "query",
  7796. "required": false,
  7797. "schema": {
  7798. "type": "string"
  7799. }
  7800. },
  7801. {
  7802. "name": "workspace",
  7803. "in": "query",
  7804. "required": false,
  7805. "schema": {
  7806. "type": "string"
  7807. }
  7808. }
  7809. ],
  7810. "responses": {
  7811. "200": {
  7812. "description": "Event published successfully",
  7813. "content": {
  7814. "application/json": {
  7815. "schema": {
  7816. "type": "boolean",
  7817. "description": "Event published successfully"
  7818. }
  7819. }
  7820. }
  7821. },
  7822. "400": {
  7823. "description": "Bad request",
  7824. "content": {
  7825. "application/json": {
  7826. "schema": {
  7827. "$ref": "#/components/schemas/BadRequestError"
  7828. }
  7829. }
  7830. }
  7831. }
  7832. },
  7833. "description": "Publish a TUI event.",
  7834. "summary": "Publish TUI event",
  7835. "requestBody": {
  7836. "content": {
  7837. "application/json": {
  7838. "schema": {
  7839. "anyOf": [
  7840. {
  7841. "$ref": "#/components/schemas/EventTuiPromptAppend"
  7842. },
  7843. {
  7844. "$ref": "#/components/schemas/EventTuiCommandExecute"
  7845. },
  7846. {
  7847. "$ref": "#/components/schemas/EventTuiToastShow"
  7848. },
  7849. {
  7850. "$ref": "#/components/schemas/EventTuiSessionSelect"
  7851. }
  7852. ]
  7853. }
  7854. }
  7855. }
  7856. },
  7857. "x-codeSamples": [
  7858. {
  7859. "lang": "js",
  7860. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.publish({\n ...\n})"
  7861. }
  7862. ]
  7863. }
  7864. },
  7865. "/tui/select-session": {
  7866. "post": {
  7867. "tags": ["tui"],
  7868. "operationId": "tui.selectSession",
  7869. "parameters": [
  7870. {
  7871. "name": "directory",
  7872. "in": "query",
  7873. "required": false,
  7874. "schema": {
  7875. "type": "string"
  7876. }
  7877. },
  7878. {
  7879. "name": "workspace",
  7880. "in": "query",
  7881. "required": false,
  7882. "schema": {
  7883. "type": "string"
  7884. }
  7885. }
  7886. ],
  7887. "responses": {
  7888. "200": {
  7889. "description": "Session selected successfully",
  7890. "content": {
  7891. "application/json": {
  7892. "schema": {
  7893. "type": "boolean",
  7894. "description": "Session selected successfully"
  7895. }
  7896. }
  7897. }
  7898. },
  7899. "400": {
  7900. "description": "Bad request",
  7901. "content": {
  7902. "application/json": {
  7903. "schema": {
  7904. "$ref": "#/components/schemas/BadRequestError"
  7905. }
  7906. }
  7907. }
  7908. },
  7909. "404": {
  7910. "description": "NotFoundError",
  7911. "content": {
  7912. "application/json": {
  7913. "schema": {
  7914. "$ref": "#/components/schemas/NotFoundError"
  7915. }
  7916. }
  7917. }
  7918. }
  7919. },
  7920. "description": "Navigate the TUI to display the specified session.",
  7921. "summary": "Select session",
  7922. "requestBody": {
  7923. "content": {
  7924. "application/json": {
  7925. "schema": {
  7926. "type": "object",
  7927. "properties": {
  7928. "sessionID": {
  7929. "type": "string",
  7930. "description": "Session ID to navigate to"
  7931. }
  7932. },
  7933. "required": ["sessionID"],
  7934. "additionalProperties": false
  7935. }
  7936. }
  7937. }
  7938. },
  7939. "x-codeSamples": [
  7940. {
  7941. "lang": "js",
  7942. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.selectSession({\n ...\n})"
  7943. }
  7944. ]
  7945. }
  7946. },
  7947. "/tui/control/next": {
  7948. "get": {
  7949. "tags": ["tui"],
  7950. "operationId": "tui.control.next",
  7951. "parameters": [
  7952. {
  7953. "name": "directory",
  7954. "in": "query",
  7955. "required": false,
  7956. "schema": {
  7957. "type": "string"
  7958. }
  7959. },
  7960. {
  7961. "name": "workspace",
  7962. "in": "query",
  7963. "required": false,
  7964. "schema": {
  7965. "type": "string"
  7966. }
  7967. }
  7968. ],
  7969. "responses": {
  7970. "200": {
  7971. "description": "Next TUI request",
  7972. "content": {
  7973. "application/json": {
  7974. "schema": {
  7975. "type": "object",
  7976. "properties": {
  7977. "path": {
  7978. "type": "string"
  7979. },
  7980. "body": {}
  7981. },
  7982. "required": ["path", "body"],
  7983. "additionalProperties": false,
  7984. "description": "Next TUI request"
  7985. }
  7986. }
  7987. }
  7988. }
  7989. },
  7990. "description": "Retrieve the next TUI request from the queue for processing.",
  7991. "summary": "Get next TUI request",
  7992. "x-codeSamples": [
  7993. {
  7994. "lang": "js",
  7995. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.control.next({\n ...\n})"
  7996. }
  7997. ]
  7998. }
  7999. },
  8000. "/tui/control/response": {
  8001. "post": {
  8002. "tags": ["tui"],
  8003. "operationId": "tui.control.response",
  8004. "parameters": [
  8005. {
  8006. "name": "directory",
  8007. "in": "query",
  8008. "required": false,
  8009. "schema": {
  8010. "type": "string"
  8011. }
  8012. },
  8013. {
  8014. "name": "workspace",
  8015. "in": "query",
  8016. "required": false,
  8017. "schema": {
  8018. "type": "string"
  8019. }
  8020. }
  8021. ],
  8022. "responses": {
  8023. "200": {
  8024. "description": "Response submitted successfully",
  8025. "content": {
  8026. "application/json": {
  8027. "schema": {
  8028. "type": "boolean",
  8029. "description": "Response submitted successfully"
  8030. }
  8031. }
  8032. }
  8033. }
  8034. },
  8035. "description": "Submit a response to the TUI request queue to complete a pending request.",
  8036. "summary": "Submit TUI response",
  8037. "requestBody": {
  8038. "content": {
  8039. "application/json": {
  8040. "schema": {}
  8041. }
  8042. }
  8043. },
  8044. "x-codeSamples": [
  8045. {
  8046. "lang": "js",
  8047. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.control.response({\n ...\n})"
  8048. }
  8049. ]
  8050. }
  8051. },
  8052. "/experimental/workspace/adapter": {
  8053. "get": {
  8054. "tags": ["workspace"],
  8055. "operationId": "experimental.workspace.adapter.list",
  8056. "parameters": [
  8057. {
  8058. "name": "directory",
  8059. "in": "query",
  8060. "required": false,
  8061. "schema": {
  8062. "type": "string"
  8063. }
  8064. },
  8065. {
  8066. "name": "workspace",
  8067. "in": "query",
  8068. "required": false,
  8069. "schema": {
  8070. "type": "string"
  8071. }
  8072. }
  8073. ],
  8074. "responses": {
  8075. "200": {
  8076. "description": "Workspace adapters",
  8077. "content": {
  8078. "application/json": {
  8079. "schema": {
  8080. "type": "array",
  8081. "items": {
  8082. "type": "object",
  8083. "properties": {
  8084. "type": {
  8085. "type": "string"
  8086. },
  8087. "name": {
  8088. "type": "string"
  8089. },
  8090. "description": {
  8091. "type": "string"
  8092. }
  8093. },
  8094. "required": ["type", "name", "description"],
  8095. "additionalProperties": false
  8096. },
  8097. "description": "Workspace adapters"
  8098. }
  8099. }
  8100. }
  8101. }
  8102. },
  8103. "description": "List all available workspace adapters for the current project.",
  8104. "summary": "List workspace adapters",
  8105. "x-codeSamples": [
  8106. {
  8107. "lang": "js",
  8108. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.adapter.list({\n ...\n})"
  8109. }
  8110. ]
  8111. }
  8112. },
  8113. "/experimental/workspace": {
  8114. "get": {
  8115. "tags": ["workspace"],
  8116. "operationId": "experimental.workspace.list",
  8117. "parameters": [
  8118. {
  8119. "name": "directory",
  8120. "in": "query",
  8121. "required": false,
  8122. "schema": {
  8123. "type": "string"
  8124. }
  8125. },
  8126. {
  8127. "name": "workspace",
  8128. "in": "query",
  8129. "required": false,
  8130. "schema": {
  8131. "type": "string"
  8132. }
  8133. }
  8134. ],
  8135. "responses": {
  8136. "200": {
  8137. "description": "Workspaces",
  8138. "content": {
  8139. "application/json": {
  8140. "schema": {
  8141. "type": "array",
  8142. "items": {
  8143. "$ref": "#/components/schemas/Workspace"
  8144. },
  8145. "description": "Workspaces"
  8146. }
  8147. }
  8148. }
  8149. }
  8150. },
  8151. "description": "List all workspaces.",
  8152. "summary": "List workspaces",
  8153. "x-codeSamples": [
  8154. {
  8155. "lang": "js",
  8156. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.list({\n ...\n})"
  8157. }
  8158. ]
  8159. },
  8160. "post": {
  8161. "tags": ["workspace"],
  8162. "operationId": "experimental.workspace.create",
  8163. "parameters": [
  8164. {
  8165. "name": "directory",
  8166. "in": "query",
  8167. "required": false,
  8168. "schema": {
  8169. "type": "string"
  8170. }
  8171. },
  8172. {
  8173. "name": "workspace",
  8174. "in": "query",
  8175. "required": false,
  8176. "schema": {
  8177. "type": "string"
  8178. }
  8179. }
  8180. ],
  8181. "responses": {
  8182. "200": {
  8183. "description": "Workspace created",
  8184. "content": {
  8185. "application/json": {
  8186. "schema": {
  8187. "$ref": "#/components/schemas/Workspace"
  8188. }
  8189. }
  8190. }
  8191. },
  8192. "400": {
  8193. "description": "Bad request",
  8194. "content": {
  8195. "application/json": {
  8196. "schema": {
  8197. "$ref": "#/components/schemas/BadRequestError"
  8198. }
  8199. }
  8200. }
  8201. }
  8202. },
  8203. "description": "Create a workspace for the current project.",
  8204. "summary": "Create workspace",
  8205. "requestBody": {
  8206. "content": {
  8207. "application/json": {
  8208. "schema": {
  8209. "type": "object",
  8210. "properties": {
  8211. "id": {
  8212. "type": "string"
  8213. },
  8214. "type": {
  8215. "type": "string"
  8216. },
  8217. "branch": {
  8218. "anyOf": [
  8219. {
  8220. "type": "string"
  8221. },
  8222. {
  8223. "type": "null"
  8224. }
  8225. ]
  8226. },
  8227. "extra": {
  8228. "anyOf": [
  8229. {},
  8230. {
  8231. "type": "null"
  8232. }
  8233. ]
  8234. }
  8235. },
  8236. "required": ["type", "branch"],
  8237. "additionalProperties": false
  8238. }
  8239. }
  8240. }
  8241. },
  8242. "x-codeSamples": [
  8243. {
  8244. "lang": "js",
  8245. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.create({\n ...\n})"
  8246. }
  8247. ]
  8248. }
  8249. },
  8250. "/experimental/workspace/status": {
  8251. "get": {
  8252. "tags": ["workspace"],
  8253. "operationId": "experimental.workspace.status",
  8254. "parameters": [
  8255. {
  8256. "name": "directory",
  8257. "in": "query",
  8258. "required": false,
  8259. "schema": {
  8260. "type": "string"
  8261. }
  8262. },
  8263. {
  8264. "name": "workspace",
  8265. "in": "query",
  8266. "required": false,
  8267. "schema": {
  8268. "type": "string"
  8269. }
  8270. }
  8271. ],
  8272. "responses": {
  8273. "200": {
  8274. "description": "Workspace status",
  8275. "content": {
  8276. "application/json": {
  8277. "schema": {
  8278. "type": "array",
  8279. "items": {
  8280. "type": "object",
  8281. "properties": {
  8282. "workspaceID": {
  8283. "type": "string"
  8284. },
  8285. "status": {
  8286. "type": "string",
  8287. "enum": ["connected", "connecting", "disconnected", "error"]
  8288. }
  8289. },
  8290. "required": ["workspaceID", "status"],
  8291. "additionalProperties": false
  8292. },
  8293. "description": "Workspace status"
  8294. }
  8295. }
  8296. }
  8297. }
  8298. },
  8299. "description": "Get connection status for workspaces in the current project.",
  8300. "summary": "Workspace status",
  8301. "x-codeSamples": [
  8302. {
  8303. "lang": "js",
  8304. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.status({\n ...\n})"
  8305. }
  8306. ]
  8307. }
  8308. },
  8309. "/experimental/workspace/{id}": {
  8310. "delete": {
  8311. "tags": ["workspace"],
  8312. "operationId": "experimental.workspace.remove",
  8313. "parameters": [
  8314. {
  8315. "name": "directory",
  8316. "in": "query",
  8317. "required": false,
  8318. "schema": {
  8319. "type": "string"
  8320. }
  8321. },
  8322. {
  8323. "name": "workspace",
  8324. "in": "query",
  8325. "required": false,
  8326. "schema": {
  8327. "type": "string"
  8328. }
  8329. },
  8330. {
  8331. "name": "id",
  8332. "in": "path",
  8333. "schema": {
  8334. "type": "string",
  8335. "pattern": "^wrk.*"
  8336. },
  8337. "required": true
  8338. }
  8339. ],
  8340. "responses": {
  8341. "200": {
  8342. "description": "Workspace removed",
  8343. "content": {
  8344. "application/json": {
  8345. "schema": {
  8346. "$ref": "#/components/schemas/Workspace"
  8347. }
  8348. }
  8349. }
  8350. },
  8351. "400": {
  8352. "description": "Bad request",
  8353. "content": {
  8354. "application/json": {
  8355. "schema": {
  8356. "$ref": "#/components/schemas/BadRequestError"
  8357. }
  8358. }
  8359. }
  8360. }
  8361. },
  8362. "description": "Remove an existing workspace.",
  8363. "summary": "Remove workspace",
  8364. "x-codeSamples": [
  8365. {
  8366. "lang": "js",
  8367. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.remove({\n ...\n})"
  8368. }
  8369. ]
  8370. }
  8371. },
  8372. "/experimental/workspace/warp": {
  8373. "post": {
  8374. "tags": ["workspace"],
  8375. "operationId": "experimental.workspace.warp",
  8376. "parameters": [
  8377. {
  8378. "name": "directory",
  8379. "in": "query",
  8380. "required": false,
  8381. "schema": {
  8382. "type": "string"
  8383. }
  8384. },
  8385. {
  8386. "name": "workspace",
  8387. "in": "query",
  8388. "required": false,
  8389. "schema": {
  8390. "type": "string"
  8391. }
  8392. }
  8393. ],
  8394. "responses": {
  8395. "204": {
  8396. "description": "Session warped"
  8397. },
  8398. "400": {
  8399. "description": "Bad request",
  8400. "content": {
  8401. "application/json": {
  8402. "schema": {
  8403. "$ref": "#/components/schemas/BadRequestError"
  8404. }
  8405. }
  8406. }
  8407. }
  8408. },
  8409. "description": "Move a session's sync history into the target workspace, or detach it to the local project.",
  8410. "summary": "Warp session into workspace",
  8411. "requestBody": {
  8412. "content": {
  8413. "application/json": {
  8414. "schema": {
  8415. "type": "object",
  8416. "properties": {
  8417. "id": {
  8418. "anyOf": [
  8419. {
  8420. "type": "string"
  8421. },
  8422. {
  8423. "type": "null"
  8424. }
  8425. ]
  8426. },
  8427. "sessionID": {
  8428. "type": "string"
  8429. }
  8430. },
  8431. "required": ["id", "sessionID"],
  8432. "additionalProperties": false
  8433. }
  8434. }
  8435. }
  8436. },
  8437. "x-codeSamples": [
  8438. {
  8439. "lang": "js",
  8440. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.warp({\n ...\n})"
  8441. }
  8442. ]
  8443. }
  8444. },
  8445. "/pty/{ptyID}/connect": {
  8446. "get": {
  8447. "tags": ["pty"],
  8448. "operationId": "pty.connect",
  8449. "parameters": [
  8450. {
  8451. "name": "directory",
  8452. "in": "query",
  8453. "required": false,
  8454. "schema": {
  8455. "type": "string"
  8456. }
  8457. },
  8458. {
  8459. "name": "workspace",
  8460. "in": "query",
  8461. "required": false,
  8462. "schema": {
  8463. "type": "string"
  8464. }
  8465. },
  8466. {
  8467. "name": "ptyID",
  8468. "in": "path",
  8469. "schema": {
  8470. "type": "string",
  8471. "pattern": "^pty.*"
  8472. },
  8473. "required": true
  8474. }
  8475. ],
  8476. "responses": {
  8477. "200": {
  8478. "description": "Connected session",
  8479. "content": {
  8480. "application/json": {
  8481. "schema": {
  8482. "type": "boolean",
  8483. "description": "Connected session"
  8484. }
  8485. }
  8486. }
  8487. },
  8488. "403": {
  8489. "description": "Forbidden",
  8490. "content": {
  8491. "application/json": {
  8492. "schema": {
  8493. "$ref": "#/components/schemas/effect_HttpApiError_Forbidden"
  8494. }
  8495. }
  8496. }
  8497. },
  8498. "404": {
  8499. "description": "Not found",
  8500. "content": {
  8501. "application/json": {
  8502. "schema": {
  8503. "$ref": "#/components/schemas/NotFoundError"
  8504. }
  8505. }
  8506. }
  8507. }
  8508. },
  8509. "description": "Establish a WebSocket connection to interact with a pseudo-terminal (PTY) session in real-time.",
  8510. "summary": "Connect to PTY session",
  8511. "x-codeSamples": [
  8512. {
  8513. "lang": "js",
  8514. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.connect({\n ...\n})"
  8515. }
  8516. ]
  8517. }
  8518. }
  8519. },
  8520. "components": {
  8521. "schemas": {
  8522. "Event": {
  8523. "anyOf": [
  8524. {
  8525. "$ref": "#/components/schemas/EventServerInstanceDisposed"
  8526. },
  8527. {
  8528. "$ref": "#/components/schemas/EventFileEdited"
  8529. },
  8530. {
  8531. "$ref": "#/components/schemas/EventFileWatcherUpdated"
  8532. },
  8533. {
  8534. "$ref": "#/components/schemas/EventLspClientDiagnostics"
  8535. },
  8536. {
  8537. "$ref": "#/components/schemas/EventLspUpdated"
  8538. },
  8539. {
  8540. "$ref": "#/components/schemas/EventMessagePartDelta"
  8541. },
  8542. {
  8543. "$ref": "#/components/schemas/EventPermissionAsked"
  8544. },
  8545. {
  8546. "$ref": "#/components/schemas/EventPermissionReplied"
  8547. },
  8548. {
  8549. "$ref": "#/components/schemas/EventSessionDiff"
  8550. },
  8551. {
  8552. "$ref": "#/components/schemas/EventSessionError"
  8553. },
  8554. {
  8555. "$ref": "#/components/schemas/EventInstallationUpdated"
  8556. },
  8557. {
  8558. "$ref": "#/components/schemas/EventInstallationUpdate-available"
  8559. },
  8560. {
  8561. "$ref": "#/components/schemas/EventQuestionAsked"
  8562. },
  8563. {
  8564. "$ref": "#/components/schemas/EventQuestionReplied"
  8565. },
  8566. {
  8567. "$ref": "#/components/schemas/EventQuestionRejected"
  8568. },
  8569. {
  8570. "$ref": "#/components/schemas/EventTodoUpdated"
  8571. },
  8572. {
  8573. "$ref": "#/components/schemas/EventSessionStatus"
  8574. },
  8575. {
  8576. "$ref": "#/components/schemas/EventSessionIdle"
  8577. },
  8578. {
  8579. "$ref": "#/components/schemas/EventSessionCompacted"
  8580. },
  8581. {
  8582. "$ref": "#/components/schemas/Event.tui.prompt.append"
  8583. },
  8584. {
  8585. "$ref": "#/components/schemas/Event.tui.command.execute"
  8586. },
  8587. {
  8588. "$ref": "#/components/schemas/EventTuiToastShow1"
  8589. },
  8590. {
  8591. "$ref": "#/components/schemas/Event.tui.session.select"
  8592. },
  8593. {
  8594. "$ref": "#/components/schemas/EventMcpToolsChanged"
  8595. },
  8596. {
  8597. "$ref": "#/components/schemas/EventMcpBrowserOpenFailed"
  8598. },
  8599. {
  8600. "$ref": "#/components/schemas/EventCommandExecuted"
  8601. },
  8602. {
  8603. "$ref": "#/components/schemas/EventProjectUpdated"
  8604. },
  8605. {
  8606. "$ref": "#/components/schemas/EventVcsBranchUpdated"
  8607. },
  8608. {
  8609. "$ref": "#/components/schemas/EventWorkspaceReady"
  8610. },
  8611. {
  8612. "$ref": "#/components/schemas/EventWorkspaceFailed"
  8613. },
  8614. {
  8615. "$ref": "#/components/schemas/EventWorkspaceStatus"
  8616. },
  8617. {
  8618. "$ref": "#/components/schemas/EventWorktreeReady"
  8619. },
  8620. {
  8621. "$ref": "#/components/schemas/EventWorktreeFailed"
  8622. },
  8623. {
  8624. "$ref": "#/components/schemas/EventPtyCreated"
  8625. },
  8626. {
  8627. "$ref": "#/components/schemas/EventPtyUpdated"
  8628. },
  8629. {
  8630. "$ref": "#/components/schemas/EventPtyExited"
  8631. },
  8632. {
  8633. "$ref": "#/components/schemas/EventPtyDeleted"
  8634. },
  8635. {
  8636. "$ref": "#/components/schemas/EventMessageUpdated"
  8637. },
  8638. {
  8639. "$ref": "#/components/schemas/EventMessageRemoved"
  8640. },
  8641. {
  8642. "$ref": "#/components/schemas/EventMessagePartUpdated"
  8643. },
  8644. {
  8645. "$ref": "#/components/schemas/EventMessagePartRemoved"
  8646. },
  8647. {
  8648. "$ref": "#/components/schemas/EventSessionCreated"
  8649. },
  8650. {
  8651. "$ref": "#/components/schemas/EventSessionUpdated"
  8652. },
  8653. {
  8654. "$ref": "#/components/schemas/EventSessionDeleted"
  8655. },
  8656. {
  8657. "$ref": "#/components/schemas/EventSessionNextAgentSwitched"
  8658. },
  8659. {
  8660. "$ref": "#/components/schemas/EventSessionNextModelSwitched"
  8661. },
  8662. {
  8663. "$ref": "#/components/schemas/EventSessionNextPrompted"
  8664. },
  8665. {
  8666. "$ref": "#/components/schemas/EventSessionNextSynthetic"
  8667. },
  8668. {
  8669. "$ref": "#/components/schemas/EventSessionNextShellStarted"
  8670. },
  8671. {
  8672. "$ref": "#/components/schemas/EventSessionNextShellEnded"
  8673. },
  8674. {
  8675. "$ref": "#/components/schemas/EventSessionNextStepStarted"
  8676. },
  8677. {
  8678. "$ref": "#/components/schemas/EventSessionNextStepEnded"
  8679. },
  8680. {
  8681. "$ref": "#/components/schemas/EventSessionNextStepFailed"
  8682. },
  8683. {
  8684. "$ref": "#/components/schemas/EventSessionNextTextStarted"
  8685. },
  8686. {
  8687. "$ref": "#/components/schemas/EventSessionNextTextDelta"
  8688. },
  8689. {
  8690. "$ref": "#/components/schemas/EventSessionNextTextEnded"
  8691. },
  8692. {
  8693. "$ref": "#/components/schemas/EventSessionNextReasoningStarted"
  8694. },
  8695. {
  8696. "$ref": "#/components/schemas/EventSessionNextReasoningDelta"
  8697. },
  8698. {
  8699. "$ref": "#/components/schemas/EventSessionNextReasoningEnded"
  8700. },
  8701. {
  8702. "$ref": "#/components/schemas/EventSessionNextToolInputStarted"
  8703. },
  8704. {
  8705. "$ref": "#/components/schemas/EventSessionNextToolInputDelta"
  8706. },
  8707. {
  8708. "$ref": "#/components/schemas/EventSessionNextToolInputEnded"
  8709. },
  8710. {
  8711. "$ref": "#/components/schemas/EventSessionNextToolCalled"
  8712. },
  8713. {
  8714. "$ref": "#/components/schemas/EventSessionNextToolProgress"
  8715. },
  8716. {
  8717. "$ref": "#/components/schemas/EventSessionNextToolSuccess"
  8718. },
  8719. {
  8720. "$ref": "#/components/schemas/EventSessionNextToolFailed"
  8721. },
  8722. {
  8723. "$ref": "#/components/schemas/EventSessionNextRetried"
  8724. },
  8725. {
  8726. "$ref": "#/components/schemas/EventSessionNextCompactionStarted"
  8727. },
  8728. {
  8729. "$ref": "#/components/schemas/EventSessionNextCompactionDelta"
  8730. },
  8731. {
  8732. "$ref": "#/components/schemas/EventSessionNextCompactionEnded"
  8733. },
  8734. {
  8735. "$ref": "#/components/schemas/EventServerConnected"
  8736. },
  8737. {
  8738. "$ref": "#/components/schemas/EventGlobalDisposed"
  8739. }
  8740. ]
  8741. },
  8742. "OAuth": {
  8743. "type": "object",
  8744. "properties": {
  8745. "type": {
  8746. "type": "string",
  8747. "enum": ["oauth"]
  8748. },
  8749. "refresh": {
  8750. "type": "string"
  8751. },
  8752. "access": {
  8753. "type": "string"
  8754. },
  8755. "expires": {
  8756. "type": "integer",
  8757. "minimum": 0
  8758. },
  8759. "accountId": {
  8760. "type": "string"
  8761. },
  8762. "enterpriseUrl": {
  8763. "type": "string"
  8764. }
  8765. },
  8766. "required": ["type", "refresh", "access", "expires"],
  8767. "additionalProperties": false
  8768. },
  8769. "ApiAuth": {
  8770. "type": "object",
  8771. "properties": {
  8772. "type": {
  8773. "type": "string",
  8774. "enum": ["api"]
  8775. },
  8776. "key": {
  8777. "type": "string"
  8778. },
  8779. "metadata": {
  8780. "type": "object",
  8781. "additionalProperties": {
  8782. "type": "string"
  8783. }
  8784. }
  8785. },
  8786. "required": ["type", "key"],
  8787. "additionalProperties": false
  8788. },
  8789. "WellKnownAuth": {
  8790. "type": "object",
  8791. "properties": {
  8792. "type": {
  8793. "type": "string",
  8794. "enum": ["wellknown"]
  8795. },
  8796. "key": {
  8797. "type": "string"
  8798. },
  8799. "token": {
  8800. "type": "string"
  8801. }
  8802. },
  8803. "required": ["type", "key", "token"],
  8804. "additionalProperties": false
  8805. },
  8806. "Auth": {
  8807. "anyOf": [
  8808. {
  8809. "$ref": "#/components/schemas/OAuth"
  8810. },
  8811. {
  8812. "$ref": "#/components/schemas/ApiAuth"
  8813. },
  8814. {
  8815. "$ref": "#/components/schemas/WellKnownAuth"
  8816. }
  8817. ]
  8818. },
  8819. "PermissionRequest": {
  8820. "type": "object",
  8821. "properties": {
  8822. "id": {
  8823. "type": "string"
  8824. },
  8825. "sessionID": {
  8826. "type": "string"
  8827. },
  8828. "permission": {
  8829. "type": "string"
  8830. },
  8831. "patterns": {
  8832. "type": "array",
  8833. "items": {
  8834. "type": "string"
  8835. }
  8836. },
  8837. "metadata": {
  8838. "type": "object"
  8839. },
  8840. "always": {
  8841. "type": "array",
  8842. "items": {
  8843. "type": "string"
  8844. }
  8845. },
  8846. "tool": {
  8847. "type": "object",
  8848. "properties": {
  8849. "messageID": {
  8850. "type": "string"
  8851. },
  8852. "callID": {
  8853. "type": "string"
  8854. }
  8855. },
  8856. "required": ["messageID", "callID"],
  8857. "additionalProperties": false
  8858. }
  8859. },
  8860. "required": ["id", "sessionID", "permission", "patterns", "metadata", "always"],
  8861. "additionalProperties": false
  8862. },
  8863. "SnapshotFileDiff": {
  8864. "type": "object",
  8865. "properties": {
  8866. "file": {
  8867. "type": "string"
  8868. },
  8869. "patch": {
  8870. "type": "string"
  8871. },
  8872. "additions": {
  8873. "type": "integer",
  8874. "minimum": 0
  8875. },
  8876. "deletions": {
  8877. "type": "integer",
  8878. "minimum": 0
  8879. },
  8880. "status": {
  8881. "type": "string",
  8882. "enum": ["added", "deleted", "modified"]
  8883. }
  8884. },
  8885. "required": ["file", "patch", "additions", "deletions"],
  8886. "additionalProperties": false
  8887. },
  8888. "ProviderAuthError": {
  8889. "type": "object",
  8890. "properties": {
  8891. "name": {
  8892. "type": "string",
  8893. "enum": ["ProviderAuthError"]
  8894. },
  8895. "data": {
  8896. "type": "object",
  8897. "properties": {
  8898. "providerID": {
  8899. "type": "string"
  8900. },
  8901. "message": {
  8902. "type": "string"
  8903. }
  8904. },
  8905. "required": ["providerID", "message"],
  8906. "additionalProperties": false
  8907. }
  8908. },
  8909. "required": ["name", "data"],
  8910. "additionalProperties": false
  8911. },
  8912. "UnknownError": {
  8913. "type": "object",
  8914. "properties": {
  8915. "name": {
  8916. "type": "string",
  8917. "enum": ["UnknownError"]
  8918. },
  8919. "data": {
  8920. "type": "object",
  8921. "properties": {
  8922. "message": {
  8923. "type": "string"
  8924. }
  8925. },
  8926. "required": ["message"],
  8927. "additionalProperties": false
  8928. }
  8929. },
  8930. "required": ["name", "data"],
  8931. "additionalProperties": false
  8932. },
  8933. "MessageOutputLengthError": {
  8934. "type": "object",
  8935. "properties": {
  8936. "name": {
  8937. "type": "string",
  8938. "enum": ["MessageOutputLengthError"]
  8939. },
  8940. "data": {
  8941. "type": "object",
  8942. "properties": {}
  8943. }
  8944. },
  8945. "required": ["name", "data"],
  8946. "additionalProperties": false
  8947. },
  8948. "MessageAbortedError": {
  8949. "type": "object",
  8950. "properties": {
  8951. "name": {
  8952. "type": "string",
  8953. "enum": ["MessageAbortedError"]
  8954. },
  8955. "data": {
  8956. "type": "object",
  8957. "properties": {
  8958. "message": {
  8959. "type": "string"
  8960. }
  8961. },
  8962. "required": ["message"],
  8963. "additionalProperties": false
  8964. }
  8965. },
  8966. "required": ["name", "data"],
  8967. "additionalProperties": false
  8968. },
  8969. "StructuredOutputError": {
  8970. "type": "object",
  8971. "properties": {
  8972. "name": {
  8973. "type": "string",
  8974. "enum": ["StructuredOutputError"]
  8975. },
  8976. "data": {
  8977. "type": "object",
  8978. "properties": {
  8979. "message": {
  8980. "type": "string"
  8981. },
  8982. "retries": {
  8983. "type": "integer",
  8984. "minimum": 0
  8985. }
  8986. },
  8987. "required": ["message", "retries"],
  8988. "additionalProperties": false
  8989. }
  8990. },
  8991. "required": ["name", "data"],
  8992. "additionalProperties": false
  8993. },
  8994. "ContextOverflowError": {
  8995. "type": "object",
  8996. "properties": {
  8997. "name": {
  8998. "type": "string",
  8999. "enum": ["ContextOverflowError"]
  9000. },
  9001. "data": {
  9002. "type": "object",
  9003. "properties": {
  9004. "message": {
  9005. "type": "string"
  9006. },
  9007. "responseBody": {
  9008. "type": "string"
  9009. }
  9010. },
  9011. "required": ["message"],
  9012. "additionalProperties": false
  9013. }
  9014. },
  9015. "required": ["name", "data"],
  9016. "additionalProperties": false
  9017. },
  9018. "APIError": {
  9019. "type": "object",
  9020. "properties": {
  9021. "name": {
  9022. "type": "string",
  9023. "enum": ["APIError"]
  9024. },
  9025. "data": {
  9026. "type": "object",
  9027. "properties": {
  9028. "message": {
  9029. "type": "string"
  9030. },
  9031. "statusCode": {
  9032. "type": "integer",
  9033. "minimum": 0
  9034. },
  9035. "isRetryable": {
  9036. "type": "boolean"
  9037. },
  9038. "responseHeaders": {
  9039. "type": "object",
  9040. "additionalProperties": {
  9041. "type": "string"
  9042. }
  9043. },
  9044. "responseBody": {
  9045. "type": "string"
  9046. },
  9047. "metadata": {
  9048. "type": "object",
  9049. "additionalProperties": {
  9050. "type": "string"
  9051. }
  9052. }
  9053. },
  9054. "required": ["message", "isRetryable"],
  9055. "additionalProperties": false
  9056. }
  9057. },
  9058. "required": ["name", "data"],
  9059. "additionalProperties": false
  9060. },
  9061. "QuestionOption": {
  9062. "type": "object",
  9063. "properties": {
  9064. "label": {
  9065. "type": "string",
  9066. "description": "Display text (1-5 words, concise)"
  9067. },
  9068. "description": {
  9069. "type": "string",
  9070. "description": "Explanation of choice"
  9071. }
  9072. },
  9073. "required": ["label", "description"],
  9074. "additionalProperties": false
  9075. },
  9076. "QuestionInfo": {
  9077. "type": "object",
  9078. "properties": {
  9079. "question": {
  9080. "type": "string",
  9081. "description": "Complete question"
  9082. },
  9083. "header": {
  9084. "type": "string",
  9085. "description": "Very short label (max 30 chars)"
  9086. },
  9087. "options": {
  9088. "type": "array",
  9089. "items": {
  9090. "$ref": "#/components/schemas/QuestionOption"
  9091. },
  9092. "description": "Available choices"
  9093. },
  9094. "multiple": {
  9095. "type": "boolean"
  9096. },
  9097. "custom": {
  9098. "type": "boolean"
  9099. }
  9100. },
  9101. "required": ["question", "header", "options"],
  9102. "additionalProperties": false
  9103. },
  9104. "QuestionTool": {
  9105. "type": "object",
  9106. "properties": {
  9107. "messageID": {
  9108. "type": "string"
  9109. },
  9110. "callID": {
  9111. "type": "string"
  9112. }
  9113. },
  9114. "required": ["messageID", "callID"],
  9115. "additionalProperties": false
  9116. },
  9117. "QuestionRequest": {
  9118. "type": "object",
  9119. "properties": {
  9120. "id": {
  9121. "type": "string"
  9122. },
  9123. "sessionID": {
  9124. "type": "string"
  9125. },
  9126. "questions": {
  9127. "type": "array",
  9128. "items": {
  9129. "$ref": "#/components/schemas/QuestionInfo"
  9130. },
  9131. "description": "Questions to ask"
  9132. },
  9133. "tool": {
  9134. "$ref": "#/components/schemas/QuestionTool"
  9135. }
  9136. },
  9137. "required": ["id", "sessionID", "questions"],
  9138. "additionalProperties": false
  9139. },
  9140. "QuestionAnswer": {
  9141. "type": "array",
  9142. "items": {
  9143. "type": "string"
  9144. }
  9145. },
  9146. "QuestionReplied": {
  9147. "type": "object",
  9148. "properties": {
  9149. "sessionID": {
  9150. "type": "string"
  9151. },
  9152. "requestID": {
  9153. "type": "string"
  9154. },
  9155. "answers": {
  9156. "type": "array",
  9157. "items": {
  9158. "$ref": "#/components/schemas/QuestionAnswer"
  9159. }
  9160. }
  9161. },
  9162. "required": ["sessionID", "requestID", "answers"],
  9163. "additionalProperties": false
  9164. },
  9165. "QuestionRejected": {
  9166. "type": "object",
  9167. "properties": {
  9168. "sessionID": {
  9169. "type": "string"
  9170. },
  9171. "requestID": {
  9172. "type": "string"
  9173. }
  9174. },
  9175. "required": ["sessionID", "requestID"],
  9176. "additionalProperties": false
  9177. },
  9178. "Todo": {
  9179. "type": "object",
  9180. "properties": {
  9181. "content": {
  9182. "type": "string",
  9183. "description": "Brief description of the task"
  9184. },
  9185. "status": {
  9186. "type": "string",
  9187. "description": "Current status of the task: pending, in_progress, completed, cancelled"
  9188. },
  9189. "priority": {
  9190. "type": "string",
  9191. "description": "Priority level of the task: high, medium, low"
  9192. }
  9193. },
  9194. "required": ["content", "status", "priority"],
  9195. "additionalProperties": false
  9196. },
  9197. "SessionStatus": {
  9198. "anyOf": [
  9199. {
  9200. "type": "object",
  9201. "properties": {
  9202. "type": {
  9203. "type": "string",
  9204. "enum": ["idle"]
  9205. }
  9206. },
  9207. "required": ["type"],
  9208. "additionalProperties": false
  9209. },
  9210. {
  9211. "type": "object",
  9212. "properties": {
  9213. "type": {
  9214. "type": "string",
  9215. "enum": ["retry"]
  9216. },
  9217. "attempt": {
  9218. "type": "integer",
  9219. "minimum": 0
  9220. },
  9221. "message": {
  9222. "type": "string"
  9223. },
  9224. "next": {
  9225. "type": "integer",
  9226. "minimum": 0
  9227. }
  9228. },
  9229. "required": ["type", "attempt", "message", "next"],
  9230. "additionalProperties": false
  9231. },
  9232. {
  9233. "type": "object",
  9234. "properties": {
  9235. "type": {
  9236. "type": "string",
  9237. "enum": ["busy"]
  9238. }
  9239. },
  9240. "required": ["type"],
  9241. "additionalProperties": false
  9242. }
  9243. ]
  9244. },
  9245. "Event.tui.prompt.append": {
  9246. "type": "object",
  9247. "properties": {
  9248. "id": {
  9249. "type": "string"
  9250. },
  9251. "type": {
  9252. "type": "string",
  9253. "enum": ["tui.prompt.append"]
  9254. },
  9255. "properties": {
  9256. "type": "object",
  9257. "properties": {
  9258. "text": {
  9259. "type": "string"
  9260. }
  9261. },
  9262. "required": ["text"],
  9263. "additionalProperties": false
  9264. }
  9265. },
  9266. "required": ["id", "type", "properties"],
  9267. "additionalProperties": false
  9268. },
  9269. "Event.tui.command.execute": {
  9270. "type": "object",
  9271. "properties": {
  9272. "id": {
  9273. "type": "string"
  9274. },
  9275. "type": {
  9276. "type": "string",
  9277. "enum": ["tui.command.execute"]
  9278. },
  9279. "properties": {
  9280. "type": "object",
  9281. "properties": {
  9282. "command": {
  9283. "anyOf": [
  9284. {
  9285. "type": "string",
  9286. "enum": [
  9287. "session.list",
  9288. "session.new",
  9289. "session.share",
  9290. "session.interrupt",
  9291. "session.compact",
  9292. "session.page.up",
  9293. "session.page.down",
  9294. "session.line.up",
  9295. "session.line.down",
  9296. "session.half.page.up",
  9297. "session.half.page.down",
  9298. "session.first",
  9299. "session.last",
  9300. "prompt.clear",
  9301. "prompt.submit",
  9302. "agent.cycle"
  9303. ]
  9304. },
  9305. {
  9306. "type": "string"
  9307. }
  9308. ]
  9309. }
  9310. },
  9311. "required": ["command"],
  9312. "additionalProperties": false
  9313. }
  9314. },
  9315. "required": ["id", "type", "properties"],
  9316. "additionalProperties": false
  9317. },
  9318. "Event.tui.toast.show": {
  9319. "type": "object",
  9320. "properties": {
  9321. "id": {
  9322. "type": "string"
  9323. },
  9324. "type": {
  9325. "type": "string",
  9326. "enum": ["tui.toast.show"]
  9327. },
  9328. "properties": {
  9329. "type": "object",
  9330. "properties": {
  9331. "title": {
  9332. "type": "string"
  9333. },
  9334. "message": {
  9335. "type": "string"
  9336. },
  9337. "variant": {
  9338. "type": "string",
  9339. "enum": ["info", "success", "warning", "error"]
  9340. },
  9341. "duration": {
  9342. "type": "integer",
  9343. "exclusiveMinimum": 0
  9344. }
  9345. },
  9346. "required": ["message", "variant"],
  9347. "additionalProperties": false
  9348. }
  9349. },
  9350. "required": ["id", "type", "properties"],
  9351. "additionalProperties": false
  9352. },
  9353. "Event.tui.session.select": {
  9354. "type": "object",
  9355. "properties": {
  9356. "id": {
  9357. "type": "string"
  9358. },
  9359. "type": {
  9360. "type": "string",
  9361. "enum": ["tui.session.select"]
  9362. },
  9363. "properties": {
  9364. "type": "object",
  9365. "properties": {
  9366. "sessionID": {
  9367. "type": "string",
  9368. "description": "Session ID to navigate to"
  9369. }
  9370. },
  9371. "required": ["sessionID"],
  9372. "additionalProperties": false
  9373. }
  9374. },
  9375. "required": ["id", "type", "properties"],
  9376. "additionalProperties": false
  9377. },
  9378. "Project": {
  9379. "type": "object",
  9380. "properties": {
  9381. "id": {
  9382. "type": "string"
  9383. },
  9384. "worktree": {
  9385. "type": "string"
  9386. },
  9387. "vcs": {
  9388. "type": "string",
  9389. "enum": ["git"]
  9390. },
  9391. "name": {
  9392. "type": "string"
  9393. },
  9394. "icon": {
  9395. "type": "object",
  9396. "properties": {
  9397. "url": {
  9398. "type": "string"
  9399. },
  9400. "override": {
  9401. "type": "string"
  9402. },
  9403. "color": {
  9404. "type": "string"
  9405. }
  9406. },
  9407. "additionalProperties": false
  9408. },
  9409. "commands": {
  9410. "type": "object",
  9411. "properties": {
  9412. "start": {
  9413. "type": "string",
  9414. "description": "Startup script to run when creating a new workspace (worktree)"
  9415. }
  9416. },
  9417. "additionalProperties": false
  9418. },
  9419. "time": {
  9420. "type": "object",
  9421. "properties": {
  9422. "created": {
  9423. "type": "integer",
  9424. "minimum": 0
  9425. },
  9426. "updated": {
  9427. "type": "integer",
  9428. "minimum": 0
  9429. },
  9430. "initialized": {
  9431. "type": "integer",
  9432. "minimum": 0
  9433. }
  9434. },
  9435. "required": ["created", "updated"],
  9436. "additionalProperties": false
  9437. },
  9438. "sandboxes": {
  9439. "type": "array",
  9440. "items": {
  9441. "type": "string"
  9442. }
  9443. }
  9444. },
  9445. "required": ["id", "worktree", "time", "sandboxes"],
  9446. "additionalProperties": false
  9447. },
  9448. "Pty": {
  9449. "type": "object",
  9450. "properties": {
  9451. "id": {
  9452. "type": "string"
  9453. },
  9454. "title": {
  9455. "type": "string"
  9456. },
  9457. "command": {
  9458. "type": "string"
  9459. },
  9460. "args": {
  9461. "type": "array",
  9462. "items": {
  9463. "type": "string"
  9464. }
  9465. },
  9466. "cwd": {
  9467. "type": "string"
  9468. },
  9469. "status": {
  9470. "type": "string",
  9471. "enum": ["running", "exited"]
  9472. },
  9473. "pid": {
  9474. "type": "integer",
  9475. "exclusiveMinimum": 0
  9476. }
  9477. },
  9478. "required": ["id", "title", "command", "args", "cwd", "status", "pid"],
  9479. "additionalProperties": false
  9480. },
  9481. "OutputFormatText": {
  9482. "type": "object",
  9483. "properties": {
  9484. "type": {
  9485. "type": "string",
  9486. "enum": ["text"]
  9487. }
  9488. },
  9489. "required": ["type"],
  9490. "additionalProperties": false
  9491. },
  9492. "JSONSchema": {
  9493. "type": "object"
  9494. },
  9495. "OutputFormatJsonSchema": {
  9496. "type": "object",
  9497. "properties": {
  9498. "type": {
  9499. "type": "string",
  9500. "enum": ["json_schema"]
  9501. },
  9502. "schema": {
  9503. "$ref": "#/components/schemas/JSONSchema"
  9504. },
  9505. "retryCount": {
  9506. "type": "integer",
  9507. "minimum": 0
  9508. }
  9509. },
  9510. "required": ["type", "schema"],
  9511. "additionalProperties": false
  9512. },
  9513. "OutputFormat": {
  9514. "anyOf": [
  9515. {
  9516. "$ref": "#/components/schemas/OutputFormatText"
  9517. },
  9518. {
  9519. "$ref": "#/components/schemas/OutputFormatJsonSchema"
  9520. }
  9521. ]
  9522. },
  9523. "UserMessage": {
  9524. "type": "object",
  9525. "properties": {
  9526. "id": {
  9527. "type": "string"
  9528. },
  9529. "sessionID": {
  9530. "type": "string"
  9531. },
  9532. "role": {
  9533. "type": "string",
  9534. "enum": ["user"]
  9535. },
  9536. "time": {
  9537. "type": "object",
  9538. "properties": {
  9539. "created": {
  9540. "type": "integer",
  9541. "minimum": 0
  9542. }
  9543. },
  9544. "required": ["created"],
  9545. "additionalProperties": false
  9546. },
  9547. "format": {
  9548. "$ref": "#/components/schemas/OutputFormat"
  9549. },
  9550. "summary": {
  9551. "type": "object",
  9552. "properties": {
  9553. "title": {
  9554. "type": "string"
  9555. },
  9556. "body": {
  9557. "type": "string"
  9558. },
  9559. "diffs": {
  9560. "type": "array",
  9561. "items": {
  9562. "$ref": "#/components/schemas/SnapshotFileDiff"
  9563. }
  9564. }
  9565. },
  9566. "required": ["diffs"],
  9567. "additionalProperties": false
  9568. },
  9569. "agent": {
  9570. "type": "string"
  9571. },
  9572. "model": {
  9573. "type": "object",
  9574. "properties": {
  9575. "providerID": {
  9576. "type": "string"
  9577. },
  9578. "modelID": {
  9579. "type": "string"
  9580. },
  9581. "variant": {
  9582. "type": "string"
  9583. }
  9584. },
  9585. "required": ["providerID", "modelID"],
  9586. "additionalProperties": false
  9587. },
  9588. "system": {
  9589. "type": "string"
  9590. },
  9591. "tools": {
  9592. "type": "object",
  9593. "additionalProperties": {
  9594. "type": "boolean"
  9595. }
  9596. }
  9597. },
  9598. "required": ["id", "sessionID", "role", "time", "agent", "model"],
  9599. "additionalProperties": false
  9600. },
  9601. "AssistantMessage": {
  9602. "type": "object",
  9603. "properties": {
  9604. "id": {
  9605. "type": "string"
  9606. },
  9607. "sessionID": {
  9608. "type": "string"
  9609. },
  9610. "role": {
  9611. "type": "string",
  9612. "enum": ["assistant"]
  9613. },
  9614. "time": {
  9615. "type": "object",
  9616. "properties": {
  9617. "created": {
  9618. "type": "integer",
  9619. "minimum": 0
  9620. },
  9621. "completed": {
  9622. "type": "integer",
  9623. "minimum": 0
  9624. }
  9625. },
  9626. "required": ["created"],
  9627. "additionalProperties": false
  9628. },
  9629. "error": {
  9630. "anyOf": [
  9631. {
  9632. "$ref": "#/components/schemas/ProviderAuthError"
  9633. },
  9634. {
  9635. "$ref": "#/components/schemas/UnknownError"
  9636. },
  9637. {
  9638. "$ref": "#/components/schemas/MessageOutputLengthError"
  9639. },
  9640. {
  9641. "$ref": "#/components/schemas/MessageAbortedError"
  9642. },
  9643. {
  9644. "$ref": "#/components/schemas/StructuredOutputError"
  9645. },
  9646. {
  9647. "$ref": "#/components/schemas/ContextOverflowError"
  9648. },
  9649. {
  9650. "$ref": "#/components/schemas/APIError"
  9651. }
  9652. ]
  9653. },
  9654. "parentID": {
  9655. "type": "string"
  9656. },
  9657. "modelID": {
  9658. "type": "string"
  9659. },
  9660. "providerID": {
  9661. "type": "string"
  9662. },
  9663. "mode": {
  9664. "type": "string"
  9665. },
  9666. "agent": {
  9667. "type": "string"
  9668. },
  9669. "path": {
  9670. "type": "object",
  9671. "properties": {
  9672. "cwd": {
  9673. "type": "string"
  9674. },
  9675. "root": {
  9676. "type": "string"
  9677. }
  9678. },
  9679. "required": ["cwd", "root"],
  9680. "additionalProperties": false
  9681. },
  9682. "summary": {
  9683. "type": "boolean"
  9684. },
  9685. "cost": {
  9686. "type": "number"
  9687. },
  9688. "tokens": {
  9689. "type": "object",
  9690. "properties": {
  9691. "total": {
  9692. "type": "integer",
  9693. "minimum": 0
  9694. },
  9695. "input": {
  9696. "type": "integer",
  9697. "minimum": 0
  9698. },
  9699. "output": {
  9700. "type": "integer",
  9701. "minimum": 0
  9702. },
  9703. "reasoning": {
  9704. "type": "integer",
  9705. "minimum": 0
  9706. },
  9707. "cache": {
  9708. "type": "object",
  9709. "properties": {
  9710. "read": {
  9711. "type": "integer",
  9712. "minimum": 0
  9713. },
  9714. "write": {
  9715. "type": "integer",
  9716. "minimum": 0
  9717. }
  9718. },
  9719. "required": ["read", "write"],
  9720. "additionalProperties": false
  9721. }
  9722. },
  9723. "required": ["input", "output", "reasoning", "cache"],
  9724. "additionalProperties": false
  9725. },
  9726. "structured": {},
  9727. "variant": {
  9728. "type": "string"
  9729. },
  9730. "finish": {
  9731. "type": "string"
  9732. }
  9733. },
  9734. "required": [
  9735. "id",
  9736. "sessionID",
  9737. "role",
  9738. "time",
  9739. "parentID",
  9740. "modelID",
  9741. "providerID",
  9742. "mode",
  9743. "agent",
  9744. "path",
  9745. "cost",
  9746. "tokens"
  9747. ],
  9748. "additionalProperties": false
  9749. },
  9750. "Message": {
  9751. "anyOf": [
  9752. {
  9753. "$ref": "#/components/schemas/UserMessage"
  9754. },
  9755. {
  9756. "$ref": "#/components/schemas/AssistantMessage"
  9757. }
  9758. ]
  9759. },
  9760. "TextPart": {
  9761. "type": "object",
  9762. "properties": {
  9763. "id": {
  9764. "type": "string"
  9765. },
  9766. "sessionID": {
  9767. "type": "string"
  9768. },
  9769. "messageID": {
  9770. "type": "string"
  9771. },
  9772. "type": {
  9773. "type": "string",
  9774. "enum": ["text"]
  9775. },
  9776. "text": {
  9777. "type": "string"
  9778. },
  9779. "synthetic": {
  9780. "type": "boolean"
  9781. },
  9782. "ignored": {
  9783. "type": "boolean"
  9784. },
  9785. "time": {
  9786. "type": "object",
  9787. "properties": {
  9788. "start": {
  9789. "type": "integer",
  9790. "minimum": 0
  9791. },
  9792. "end": {
  9793. "type": "integer",
  9794. "minimum": 0
  9795. }
  9796. },
  9797. "required": ["start"],
  9798. "additionalProperties": false
  9799. },
  9800. "metadata": {
  9801. "type": "object"
  9802. }
  9803. },
  9804. "required": ["id", "sessionID", "messageID", "type", "text"],
  9805. "additionalProperties": false
  9806. },
  9807. "SubtaskPart": {
  9808. "type": "object",
  9809. "properties": {
  9810. "id": {
  9811. "type": "string"
  9812. },
  9813. "sessionID": {
  9814. "type": "string"
  9815. },
  9816. "messageID": {
  9817. "type": "string"
  9818. },
  9819. "type": {
  9820. "type": "string",
  9821. "enum": ["subtask"]
  9822. },
  9823. "prompt": {
  9824. "type": "string"
  9825. },
  9826. "description": {
  9827. "type": "string"
  9828. },
  9829. "agent": {
  9830. "type": "string"
  9831. },
  9832. "model": {
  9833. "type": "object",
  9834. "properties": {
  9835. "providerID": {
  9836. "type": "string"
  9837. },
  9838. "modelID": {
  9839. "type": "string"
  9840. }
  9841. },
  9842. "required": ["providerID", "modelID"],
  9843. "additionalProperties": false
  9844. },
  9845. "command": {
  9846. "type": "string"
  9847. }
  9848. },
  9849. "required": ["id", "sessionID", "messageID", "type", "prompt", "description", "agent"],
  9850. "additionalProperties": false
  9851. },
  9852. "ReasoningPart": {
  9853. "type": "object",
  9854. "properties": {
  9855. "id": {
  9856. "type": "string"
  9857. },
  9858. "sessionID": {
  9859. "type": "string"
  9860. },
  9861. "messageID": {
  9862. "type": "string"
  9863. },
  9864. "type": {
  9865. "type": "string",
  9866. "enum": ["reasoning"]
  9867. },
  9868. "text": {
  9869. "type": "string"
  9870. },
  9871. "metadata": {
  9872. "type": "object"
  9873. },
  9874. "time": {
  9875. "type": "object",
  9876. "properties": {
  9877. "start": {
  9878. "type": "integer",
  9879. "minimum": 0
  9880. },
  9881. "end": {
  9882. "type": "integer",
  9883. "minimum": 0
  9884. }
  9885. },
  9886. "required": ["start"],
  9887. "additionalProperties": false
  9888. }
  9889. },
  9890. "required": ["id", "sessionID", "messageID", "type", "text", "time"],
  9891. "additionalProperties": false
  9892. },
  9893. "FilePartSourceText": {
  9894. "type": "object",
  9895. "properties": {
  9896. "value": {
  9897. "type": "string"
  9898. },
  9899. "start": {
  9900. "type": "integer",
  9901. "minimum": 0
  9902. },
  9903. "end": {
  9904. "type": "integer",
  9905. "minimum": 0
  9906. }
  9907. },
  9908. "required": ["value", "start", "end"],
  9909. "additionalProperties": false
  9910. },
  9911. "FileSource": {
  9912. "type": "object",
  9913. "properties": {
  9914. "text": {
  9915. "$ref": "#/components/schemas/FilePartSourceText"
  9916. },
  9917. "type": {
  9918. "type": "string",
  9919. "enum": ["file"]
  9920. },
  9921. "path": {
  9922. "type": "string"
  9923. }
  9924. },
  9925. "required": ["text", "type", "path"],
  9926. "additionalProperties": false
  9927. },
  9928. "Range": {
  9929. "type": "object",
  9930. "properties": {
  9931. "start": {
  9932. "type": "object",
  9933. "properties": {
  9934. "line": {
  9935. "type": "integer",
  9936. "minimum": 0
  9937. },
  9938. "character": {
  9939. "type": "integer",
  9940. "minimum": 0
  9941. }
  9942. },
  9943. "required": ["line", "character"],
  9944. "additionalProperties": false
  9945. },
  9946. "end": {
  9947. "type": "object",
  9948. "properties": {
  9949. "line": {
  9950. "type": "integer",
  9951. "minimum": 0
  9952. },
  9953. "character": {
  9954. "type": "integer",
  9955. "minimum": 0
  9956. }
  9957. },
  9958. "required": ["line", "character"],
  9959. "additionalProperties": false
  9960. }
  9961. },
  9962. "required": ["start", "end"],
  9963. "additionalProperties": false
  9964. },
  9965. "SymbolSource": {
  9966. "type": "object",
  9967. "properties": {
  9968. "text": {
  9969. "$ref": "#/components/schemas/FilePartSourceText"
  9970. },
  9971. "type": {
  9972. "type": "string",
  9973. "enum": ["symbol"]
  9974. },
  9975. "path": {
  9976. "type": "string"
  9977. },
  9978. "range": {
  9979. "$ref": "#/components/schemas/Range"
  9980. },
  9981. "name": {
  9982. "type": "string"
  9983. },
  9984. "kind": {
  9985. "type": "integer",
  9986. "minimum": 0
  9987. }
  9988. },
  9989. "required": ["text", "type", "path", "range", "name", "kind"],
  9990. "additionalProperties": false
  9991. },
  9992. "ResourceSource": {
  9993. "type": "object",
  9994. "properties": {
  9995. "text": {
  9996. "$ref": "#/components/schemas/FilePartSourceText"
  9997. },
  9998. "type": {
  9999. "type": "string",
  10000. "enum": ["resource"]
  10001. },
  10002. "clientName": {
  10003. "type": "string"
  10004. },
  10005. "uri": {
  10006. "type": "string"
  10007. }
  10008. },
  10009. "required": ["text", "type", "clientName", "uri"],
  10010. "additionalProperties": false
  10011. },
  10012. "FilePartSource": {
  10013. "anyOf": [
  10014. {
  10015. "$ref": "#/components/schemas/FileSource"
  10016. },
  10017. {
  10018. "$ref": "#/components/schemas/SymbolSource"
  10019. },
  10020. {
  10021. "$ref": "#/components/schemas/ResourceSource"
  10022. }
  10023. ]
  10024. },
  10025. "FilePart": {
  10026. "type": "object",
  10027. "properties": {
  10028. "id": {
  10029. "type": "string"
  10030. },
  10031. "sessionID": {
  10032. "type": "string"
  10033. },
  10034. "messageID": {
  10035. "type": "string"
  10036. },
  10037. "type": {
  10038. "type": "string",
  10039. "enum": ["file"]
  10040. },
  10041. "mime": {
  10042. "type": "string"
  10043. },
  10044. "filename": {
  10045. "type": "string"
  10046. },
  10047. "url": {
  10048. "type": "string"
  10049. },
  10050. "source": {
  10051. "$ref": "#/components/schemas/FilePartSource"
  10052. }
  10053. },
  10054. "required": ["id", "sessionID", "messageID", "type", "mime", "url"],
  10055. "additionalProperties": false
  10056. },
  10057. "ToolStatePending": {
  10058. "type": "object",
  10059. "properties": {
  10060. "status": {
  10061. "type": "string",
  10062. "enum": ["pending"]
  10063. },
  10064. "input": {
  10065. "type": "object"
  10066. },
  10067. "raw": {
  10068. "type": "string"
  10069. }
  10070. },
  10071. "required": ["status", "input", "raw"],
  10072. "additionalProperties": false
  10073. },
  10074. "ToolStateRunning": {
  10075. "type": "object",
  10076. "properties": {
  10077. "status": {
  10078. "type": "string",
  10079. "enum": ["running"]
  10080. },
  10081. "input": {
  10082. "type": "object"
  10083. },
  10084. "title": {
  10085. "type": "string"
  10086. },
  10087. "metadata": {
  10088. "type": "object"
  10089. },
  10090. "time": {
  10091. "type": "object",
  10092. "properties": {
  10093. "start": {
  10094. "type": "integer",
  10095. "minimum": 0
  10096. }
  10097. },
  10098. "required": ["start"],
  10099. "additionalProperties": false
  10100. }
  10101. },
  10102. "required": ["status", "input", "time"],
  10103. "additionalProperties": false
  10104. },
  10105. "ToolStateCompleted": {
  10106. "type": "object",
  10107. "properties": {
  10108. "status": {
  10109. "type": "string",
  10110. "enum": ["completed"]
  10111. },
  10112. "input": {
  10113. "type": "object"
  10114. },
  10115. "output": {
  10116. "type": "string"
  10117. },
  10118. "title": {
  10119. "type": "string"
  10120. },
  10121. "metadata": {
  10122. "type": "object"
  10123. },
  10124. "time": {
  10125. "type": "object",
  10126. "properties": {
  10127. "start": {
  10128. "type": "integer",
  10129. "minimum": 0
  10130. },
  10131. "end": {
  10132. "type": "integer",
  10133. "minimum": 0
  10134. },
  10135. "compacted": {
  10136. "type": "integer",
  10137. "minimum": 0
  10138. }
  10139. },
  10140. "required": ["start", "end"],
  10141. "additionalProperties": false
  10142. },
  10143. "attachments": {
  10144. "type": "array",
  10145. "items": {
  10146. "$ref": "#/components/schemas/FilePart"
  10147. }
  10148. }
  10149. },
  10150. "required": ["status", "input", "output", "title", "metadata", "time"],
  10151. "additionalProperties": false
  10152. },
  10153. "ToolStateError": {
  10154. "type": "object",
  10155. "properties": {
  10156. "status": {
  10157. "type": "string",
  10158. "enum": ["error"]
  10159. },
  10160. "input": {
  10161. "type": "object"
  10162. },
  10163. "error": {
  10164. "type": "string"
  10165. },
  10166. "metadata": {
  10167. "type": "object"
  10168. },
  10169. "time": {
  10170. "type": "object",
  10171. "properties": {
  10172. "start": {
  10173. "type": "integer",
  10174. "minimum": 0
  10175. },
  10176. "end": {
  10177. "type": "integer",
  10178. "minimum": 0
  10179. }
  10180. },
  10181. "required": ["start", "end"],
  10182. "additionalProperties": false
  10183. }
  10184. },
  10185. "required": ["status", "input", "error", "time"],
  10186. "additionalProperties": false
  10187. },
  10188. "ToolState": {
  10189. "anyOf": [
  10190. {
  10191. "$ref": "#/components/schemas/ToolStatePending"
  10192. },
  10193. {
  10194. "$ref": "#/components/schemas/ToolStateRunning"
  10195. },
  10196. {
  10197. "$ref": "#/components/schemas/ToolStateCompleted"
  10198. },
  10199. {
  10200. "$ref": "#/components/schemas/ToolStateError"
  10201. }
  10202. ]
  10203. },
  10204. "ToolPart": {
  10205. "type": "object",
  10206. "properties": {
  10207. "id": {
  10208. "type": "string"
  10209. },
  10210. "sessionID": {
  10211. "type": "string"
  10212. },
  10213. "messageID": {
  10214. "type": "string"
  10215. },
  10216. "type": {
  10217. "type": "string",
  10218. "enum": ["tool"]
  10219. },
  10220. "callID": {
  10221. "type": "string"
  10222. },
  10223. "tool": {
  10224. "type": "string"
  10225. },
  10226. "state": {
  10227. "$ref": "#/components/schemas/ToolState"
  10228. },
  10229. "metadata": {
  10230. "type": "object"
  10231. }
  10232. },
  10233. "required": ["id", "sessionID", "messageID", "type", "callID", "tool", "state"],
  10234. "additionalProperties": false
  10235. },
  10236. "StepStartPart": {
  10237. "type": "object",
  10238. "properties": {
  10239. "id": {
  10240. "type": "string"
  10241. },
  10242. "sessionID": {
  10243. "type": "string"
  10244. },
  10245. "messageID": {
  10246. "type": "string"
  10247. },
  10248. "type": {
  10249. "type": "string",
  10250. "enum": ["step-start"]
  10251. },
  10252. "snapshot": {
  10253. "type": "string"
  10254. }
  10255. },
  10256. "required": ["id", "sessionID", "messageID", "type"],
  10257. "additionalProperties": false
  10258. },
  10259. "StepFinishPart": {
  10260. "type": "object",
  10261. "properties": {
  10262. "id": {
  10263. "type": "string"
  10264. },
  10265. "sessionID": {
  10266. "type": "string"
  10267. },
  10268. "messageID": {
  10269. "type": "string"
  10270. },
  10271. "type": {
  10272. "type": "string",
  10273. "enum": ["step-finish"]
  10274. },
  10275. "reason": {
  10276. "type": "string"
  10277. },
  10278. "snapshot": {
  10279. "type": "string"
  10280. },
  10281. "cost": {
  10282. "type": "number"
  10283. },
  10284. "tokens": {
  10285. "type": "object",
  10286. "properties": {
  10287. "total": {
  10288. "type": "integer",
  10289. "minimum": 0
  10290. },
  10291. "input": {
  10292. "type": "integer",
  10293. "minimum": 0
  10294. },
  10295. "output": {
  10296. "type": "integer",
  10297. "minimum": 0
  10298. },
  10299. "reasoning": {
  10300. "type": "integer",
  10301. "minimum": 0
  10302. },
  10303. "cache": {
  10304. "type": "object",
  10305. "properties": {
  10306. "read": {
  10307. "type": "integer",
  10308. "minimum": 0
  10309. },
  10310. "write": {
  10311. "type": "integer",
  10312. "minimum": 0
  10313. }
  10314. },
  10315. "required": ["read", "write"],
  10316. "additionalProperties": false
  10317. }
  10318. },
  10319. "required": ["input", "output", "reasoning", "cache"],
  10320. "additionalProperties": false
  10321. }
  10322. },
  10323. "required": ["id", "sessionID", "messageID", "type", "reason", "cost", "tokens"],
  10324. "additionalProperties": false
  10325. },
  10326. "SnapshotPart": {
  10327. "type": "object",
  10328. "properties": {
  10329. "id": {
  10330. "type": "string"
  10331. },
  10332. "sessionID": {
  10333. "type": "string"
  10334. },
  10335. "messageID": {
  10336. "type": "string"
  10337. },
  10338. "type": {
  10339. "type": "string",
  10340. "enum": ["snapshot"]
  10341. },
  10342. "snapshot": {
  10343. "type": "string"
  10344. }
  10345. },
  10346. "required": ["id", "sessionID", "messageID", "type", "snapshot"],
  10347. "additionalProperties": false
  10348. },
  10349. "PatchPart": {
  10350. "type": "object",
  10351. "properties": {
  10352. "id": {
  10353. "type": "string"
  10354. },
  10355. "sessionID": {
  10356. "type": "string"
  10357. },
  10358. "messageID": {
  10359. "type": "string"
  10360. },
  10361. "type": {
  10362. "type": "string",
  10363. "enum": ["patch"]
  10364. },
  10365. "hash": {
  10366. "type": "string"
  10367. },
  10368. "files": {
  10369. "type": "array",
  10370. "items": {
  10371. "type": "string"
  10372. }
  10373. }
  10374. },
  10375. "required": ["id", "sessionID", "messageID", "type", "hash", "files"],
  10376. "additionalProperties": false
  10377. },
  10378. "AgentPart": {
  10379. "type": "object",
  10380. "properties": {
  10381. "id": {
  10382. "type": "string"
  10383. },
  10384. "sessionID": {
  10385. "type": "string"
  10386. },
  10387. "messageID": {
  10388. "type": "string"
  10389. },
  10390. "type": {
  10391. "type": "string",
  10392. "enum": ["agent"]
  10393. },
  10394. "name": {
  10395. "type": "string"
  10396. },
  10397. "source": {
  10398. "type": "object",
  10399. "properties": {
  10400. "value": {
  10401. "type": "string"
  10402. },
  10403. "start": {
  10404. "type": "integer",
  10405. "minimum": 0
  10406. },
  10407. "end": {
  10408. "type": "integer",
  10409. "minimum": 0
  10410. }
  10411. },
  10412. "required": ["value", "start", "end"],
  10413. "additionalProperties": false
  10414. }
  10415. },
  10416. "required": ["id", "sessionID", "messageID", "type", "name"],
  10417. "additionalProperties": false
  10418. },
  10419. "RetryPart": {
  10420. "type": "object",
  10421. "properties": {
  10422. "id": {
  10423. "type": "string"
  10424. },
  10425. "sessionID": {
  10426. "type": "string"
  10427. },
  10428. "messageID": {
  10429. "type": "string"
  10430. },
  10431. "type": {
  10432. "type": "string",
  10433. "enum": ["retry"]
  10434. },
  10435. "attempt": {
  10436. "type": "integer",
  10437. "minimum": 0
  10438. },
  10439. "error": {
  10440. "$ref": "#/components/schemas/APIError"
  10441. },
  10442. "time": {
  10443. "type": "object",
  10444. "properties": {
  10445. "created": {
  10446. "type": "integer",
  10447. "minimum": 0
  10448. }
  10449. },
  10450. "required": ["created"],
  10451. "additionalProperties": false
  10452. }
  10453. },
  10454. "required": ["id", "sessionID", "messageID", "type", "attempt", "error", "time"],
  10455. "additionalProperties": false
  10456. },
  10457. "CompactionPart": {
  10458. "type": "object",
  10459. "properties": {
  10460. "id": {
  10461. "type": "string"
  10462. },
  10463. "sessionID": {
  10464. "type": "string"
  10465. },
  10466. "messageID": {
  10467. "type": "string"
  10468. },
  10469. "type": {
  10470. "type": "string",
  10471. "enum": ["compaction"]
  10472. },
  10473. "auto": {
  10474. "type": "boolean"
  10475. },
  10476. "overflow": {
  10477. "type": "boolean"
  10478. },
  10479. "tail_start_id": {
  10480. "type": "string"
  10481. }
  10482. },
  10483. "required": ["id", "sessionID", "messageID", "type", "auto"],
  10484. "additionalProperties": false
  10485. },
  10486. "Part": {
  10487. "anyOf": [
  10488. {
  10489. "$ref": "#/components/schemas/TextPart"
  10490. },
  10491. {
  10492. "$ref": "#/components/schemas/SubtaskPart"
  10493. },
  10494. {
  10495. "$ref": "#/components/schemas/ReasoningPart"
  10496. },
  10497. {
  10498. "$ref": "#/components/schemas/FilePart"
  10499. },
  10500. {
  10501. "$ref": "#/components/schemas/ToolPart"
  10502. },
  10503. {
  10504. "$ref": "#/components/schemas/StepStartPart"
  10505. },
  10506. {
  10507. "$ref": "#/components/schemas/StepFinishPart"
  10508. },
  10509. {
  10510. "$ref": "#/components/schemas/SnapshotPart"
  10511. },
  10512. {
  10513. "$ref": "#/components/schemas/PatchPart"
  10514. },
  10515. {
  10516. "$ref": "#/components/schemas/AgentPart"
  10517. },
  10518. {
  10519. "$ref": "#/components/schemas/RetryPart"
  10520. },
  10521. {
  10522. "$ref": "#/components/schemas/CompactionPart"
  10523. }
  10524. ]
  10525. },
  10526. "PermissionAction": {
  10527. "type": "string",
  10528. "enum": ["allow", "deny", "ask"]
  10529. },
  10530. "PermissionRule": {
  10531. "type": "object",
  10532. "properties": {
  10533. "permission": {
  10534. "type": "string"
  10535. },
  10536. "pattern": {
  10537. "type": "string"
  10538. },
  10539. "action": {
  10540. "$ref": "#/components/schemas/PermissionAction"
  10541. }
  10542. },
  10543. "required": ["permission", "pattern", "action"],
  10544. "additionalProperties": false
  10545. },
  10546. "PermissionRuleset": {
  10547. "type": "array",
  10548. "items": {
  10549. "$ref": "#/components/schemas/PermissionRule"
  10550. }
  10551. },
  10552. "Session": {
  10553. "type": "object",
  10554. "properties": {
  10555. "id": {
  10556. "type": "string"
  10557. },
  10558. "slug": {
  10559. "type": "string"
  10560. },
  10561. "projectID": {
  10562. "type": "string"
  10563. },
  10564. "workspaceID": {
  10565. "type": "string"
  10566. },
  10567. "directory": {
  10568. "type": "string"
  10569. },
  10570. "path": {
  10571. "type": "string"
  10572. },
  10573. "parentID": {
  10574. "type": "string"
  10575. },
  10576. "summary": {
  10577. "type": "object",
  10578. "properties": {
  10579. "additions": {
  10580. "type": "integer",
  10581. "minimum": 0
  10582. },
  10583. "deletions": {
  10584. "type": "integer",
  10585. "minimum": 0
  10586. },
  10587. "files": {
  10588. "type": "integer",
  10589. "minimum": 0
  10590. },
  10591. "diffs": {
  10592. "type": "array",
  10593. "items": {
  10594. "$ref": "#/components/schemas/SnapshotFileDiff"
  10595. }
  10596. }
  10597. },
  10598. "required": ["additions", "deletions", "files"],
  10599. "additionalProperties": false
  10600. },
  10601. "share": {
  10602. "type": "object",
  10603. "properties": {
  10604. "url": {
  10605. "type": "string"
  10606. }
  10607. },
  10608. "required": ["url"],
  10609. "additionalProperties": false
  10610. },
  10611. "title": {
  10612. "type": "string"
  10613. },
  10614. "agent": {
  10615. "type": "string"
  10616. },
  10617. "model": {
  10618. "type": "object",
  10619. "properties": {
  10620. "id": {
  10621. "type": "string"
  10622. },
  10623. "providerID": {
  10624. "type": "string"
  10625. },
  10626. "variant": {
  10627. "type": "string"
  10628. }
  10629. },
  10630. "required": ["id", "providerID"],
  10631. "additionalProperties": false
  10632. },
  10633. "version": {
  10634. "type": "string"
  10635. },
  10636. "time": {
  10637. "type": "object",
  10638. "properties": {
  10639. "created": {
  10640. "type": "integer",
  10641. "minimum": 0
  10642. },
  10643. "updated": {
  10644. "type": "integer",
  10645. "minimum": 0
  10646. },
  10647. "compacting": {
  10648. "type": "integer",
  10649. "minimum": 0
  10650. },
  10651. "archived": {
  10652. "type": "number"
  10653. }
  10654. },
  10655. "required": ["created", "updated"],
  10656. "additionalProperties": false
  10657. },
  10658. "permission": {
  10659. "$ref": "#/components/schemas/PermissionRuleset"
  10660. },
  10661. "revert": {
  10662. "type": "object",
  10663. "properties": {
  10664. "messageID": {
  10665. "type": "string"
  10666. },
  10667. "partID": {
  10668. "type": "string"
  10669. },
  10670. "snapshot": {
  10671. "type": "string"
  10672. },
  10673. "diff": {
  10674. "type": "string"
  10675. }
  10676. },
  10677. "required": ["messageID"],
  10678. "additionalProperties": false
  10679. }
  10680. },
  10681. "required": ["id", "slug", "projectID", "directory", "title", "version", "time"],
  10682. "additionalProperties": false
  10683. },
  10684. "Prompt": {
  10685. "type": "object",
  10686. "properties": {
  10687. "text": {
  10688. "type": "string"
  10689. },
  10690. "files": {
  10691. "type": "array",
  10692. "items": {
  10693. "$ref": "#/components/schemas/PromptFileAttachment"
  10694. }
  10695. },
  10696. "agents": {
  10697. "type": "array",
  10698. "items": {
  10699. "$ref": "#/components/schemas/PromptAgentAttachment"
  10700. }
  10701. }
  10702. },
  10703. "required": ["text"],
  10704. "additionalProperties": false
  10705. },
  10706. "GlobalEvent": {
  10707. "type": "object",
  10708. "properties": {
  10709. "directory": {
  10710. "type": "string"
  10711. },
  10712. "project": {
  10713. "type": "string"
  10714. },
  10715. "workspace": {
  10716. "type": "string"
  10717. },
  10718. "payload": {
  10719. "anyOf": [
  10720. {
  10721. "$ref": "#/components/schemas/EventServerInstanceDisposed"
  10722. },
  10723. {
  10724. "$ref": "#/components/schemas/EventFileEdited"
  10725. },
  10726. {
  10727. "$ref": "#/components/schemas/EventFileWatcherUpdated"
  10728. },
  10729. {
  10730. "$ref": "#/components/schemas/EventLspClientDiagnostics"
  10731. },
  10732. {
  10733. "$ref": "#/components/schemas/EventLspUpdated"
  10734. },
  10735. {
  10736. "$ref": "#/components/schemas/EventMessagePartDelta"
  10737. },
  10738. {
  10739. "$ref": "#/components/schemas/EventPermissionAsked"
  10740. },
  10741. {
  10742. "$ref": "#/components/schemas/EventPermissionReplied"
  10743. },
  10744. {
  10745. "$ref": "#/components/schemas/EventSessionDiff"
  10746. },
  10747. {
  10748. "$ref": "#/components/schemas/EventSessionError"
  10749. },
  10750. {
  10751. "$ref": "#/components/schemas/EventInstallationUpdated"
  10752. },
  10753. {
  10754. "$ref": "#/components/schemas/EventInstallationUpdate-available"
  10755. },
  10756. {
  10757. "$ref": "#/components/schemas/EventQuestionAsked"
  10758. },
  10759. {
  10760. "$ref": "#/components/schemas/EventQuestionReplied"
  10761. },
  10762. {
  10763. "$ref": "#/components/schemas/EventQuestionRejected"
  10764. },
  10765. {
  10766. "$ref": "#/components/schemas/EventTodoUpdated"
  10767. },
  10768. {
  10769. "$ref": "#/components/schemas/EventSessionStatus"
  10770. },
  10771. {
  10772. "$ref": "#/components/schemas/EventSessionIdle"
  10773. },
  10774. {
  10775. "$ref": "#/components/schemas/EventSessionCompacted"
  10776. },
  10777. {
  10778. "$ref": "#/components/schemas/Event.tui.prompt.append"
  10779. },
  10780. {
  10781. "$ref": "#/components/schemas/Event.tui.command.execute"
  10782. },
  10783. {
  10784. "$ref": "#/components/schemas/Event.tui.toast.show"
  10785. },
  10786. {
  10787. "$ref": "#/components/schemas/Event.tui.session.select"
  10788. },
  10789. {
  10790. "$ref": "#/components/schemas/EventMcpToolsChanged"
  10791. },
  10792. {
  10793. "$ref": "#/components/schemas/EventMcpBrowserOpenFailed"
  10794. },
  10795. {
  10796. "$ref": "#/components/schemas/EventCommandExecuted"
  10797. },
  10798. {
  10799. "$ref": "#/components/schemas/EventProjectUpdated"
  10800. },
  10801. {
  10802. "$ref": "#/components/schemas/EventVcsBranchUpdated"
  10803. },
  10804. {
  10805. "$ref": "#/components/schemas/EventWorkspaceReady"
  10806. },
  10807. {
  10808. "$ref": "#/components/schemas/EventWorkspaceFailed"
  10809. },
  10810. {
  10811. "$ref": "#/components/schemas/EventWorkspaceStatus"
  10812. },
  10813. {
  10814. "$ref": "#/components/schemas/EventWorktreeReady"
  10815. },
  10816. {
  10817. "$ref": "#/components/schemas/EventWorktreeFailed"
  10818. },
  10819. {
  10820. "$ref": "#/components/schemas/EventPtyCreated"
  10821. },
  10822. {
  10823. "$ref": "#/components/schemas/EventPtyUpdated"
  10824. },
  10825. {
  10826. "$ref": "#/components/schemas/EventPtyExited"
  10827. },
  10828. {
  10829. "$ref": "#/components/schemas/EventPtyDeleted"
  10830. },
  10831. {
  10832. "$ref": "#/components/schemas/EventMessageUpdated"
  10833. },
  10834. {
  10835. "$ref": "#/components/schemas/EventMessageRemoved"
  10836. },
  10837. {
  10838. "$ref": "#/components/schemas/EventMessagePartUpdated"
  10839. },
  10840. {
  10841. "$ref": "#/components/schemas/EventMessagePartRemoved"
  10842. },
  10843. {
  10844. "$ref": "#/components/schemas/EventSessionCreated"
  10845. },
  10846. {
  10847. "$ref": "#/components/schemas/EventSessionUpdated"
  10848. },
  10849. {
  10850. "$ref": "#/components/schemas/EventSessionDeleted"
  10851. },
  10852. {
  10853. "$ref": "#/components/schemas/EventSessionNextAgentSwitched"
  10854. },
  10855. {
  10856. "$ref": "#/components/schemas/EventSessionNextModelSwitched"
  10857. },
  10858. {
  10859. "$ref": "#/components/schemas/EventSessionNextPrompted"
  10860. },
  10861. {
  10862. "$ref": "#/components/schemas/EventSessionNextSynthetic"
  10863. },
  10864. {
  10865. "$ref": "#/components/schemas/EventSessionNextShellStarted"
  10866. },
  10867. {
  10868. "$ref": "#/components/schemas/EventSessionNextShellEnded"
  10869. },
  10870. {
  10871. "$ref": "#/components/schemas/EventSessionNextStepStarted"
  10872. },
  10873. {
  10874. "$ref": "#/components/schemas/EventSessionNextStepEnded"
  10875. },
  10876. {
  10877. "$ref": "#/components/schemas/EventSessionNextStepFailed"
  10878. },
  10879. {
  10880. "$ref": "#/components/schemas/EventSessionNextTextStarted"
  10881. },
  10882. {
  10883. "$ref": "#/components/schemas/EventSessionNextTextDelta"
  10884. },
  10885. {
  10886. "$ref": "#/components/schemas/EventSessionNextTextEnded"
  10887. },
  10888. {
  10889. "$ref": "#/components/schemas/EventSessionNextReasoningStarted"
  10890. },
  10891. {
  10892. "$ref": "#/components/schemas/EventSessionNextReasoningDelta"
  10893. },
  10894. {
  10895. "$ref": "#/components/schemas/EventSessionNextReasoningEnded"
  10896. },
  10897. {
  10898. "$ref": "#/components/schemas/EventSessionNextToolInputStarted"
  10899. },
  10900. {
  10901. "$ref": "#/components/schemas/EventSessionNextToolInputDelta"
  10902. },
  10903. {
  10904. "$ref": "#/components/schemas/EventSessionNextToolInputEnded"
  10905. },
  10906. {
  10907. "$ref": "#/components/schemas/EventSessionNextToolCalled"
  10908. },
  10909. {
  10910. "$ref": "#/components/schemas/EventSessionNextToolProgress"
  10911. },
  10912. {
  10913. "$ref": "#/components/schemas/EventSessionNextToolSuccess"
  10914. },
  10915. {
  10916. "$ref": "#/components/schemas/EventSessionNextToolFailed"
  10917. },
  10918. {
  10919. "$ref": "#/components/schemas/EventSessionNextRetried"
  10920. },
  10921. {
  10922. "$ref": "#/components/schemas/EventSessionNextCompactionStarted"
  10923. },
  10924. {
  10925. "$ref": "#/components/schemas/EventSessionNextCompactionDelta"
  10926. },
  10927. {
  10928. "$ref": "#/components/schemas/EventSessionNextCompactionEnded"
  10929. },
  10930. {
  10931. "$ref": "#/components/schemas/EventServerConnected"
  10932. },
  10933. {
  10934. "$ref": "#/components/schemas/EventGlobalDisposed"
  10935. },
  10936. {
  10937. "$ref": "#/components/schemas/SyncEventMessageUpdated"
  10938. },
  10939. {
  10940. "$ref": "#/components/schemas/SyncEventMessageRemoved"
  10941. },
  10942. {
  10943. "$ref": "#/components/schemas/SyncEventMessagePartUpdated"
  10944. },
  10945. {
  10946. "$ref": "#/components/schemas/SyncEventMessagePartRemoved"
  10947. },
  10948. {
  10949. "$ref": "#/components/schemas/SyncEventSessionCreated"
  10950. },
  10951. {
  10952. "$ref": "#/components/schemas/SyncEventSessionUpdated"
  10953. },
  10954. {
  10955. "$ref": "#/components/schemas/SyncEventSessionDeleted"
  10956. },
  10957. {
  10958. "$ref": "#/components/schemas/SyncEventSessionNextAgentSwitched"
  10959. },
  10960. {
  10961. "$ref": "#/components/schemas/SyncEventSessionNextModelSwitched"
  10962. },
  10963. {
  10964. "$ref": "#/components/schemas/SyncEventSessionNextPrompted"
  10965. },
  10966. {
  10967. "$ref": "#/components/schemas/SyncEventSessionNextSynthetic"
  10968. },
  10969. {
  10970. "$ref": "#/components/schemas/SyncEventSessionNextShellStarted"
  10971. },
  10972. {
  10973. "$ref": "#/components/schemas/SyncEventSessionNextShellEnded"
  10974. },
  10975. {
  10976. "$ref": "#/components/schemas/SyncEventSessionNextStepStarted"
  10977. },
  10978. {
  10979. "$ref": "#/components/schemas/SyncEventSessionNextStepEnded"
  10980. },
  10981. {
  10982. "$ref": "#/components/schemas/SyncEventSessionNextStepFailed"
  10983. },
  10984. {
  10985. "$ref": "#/components/schemas/SyncEventSessionNextTextStarted"
  10986. },
  10987. {
  10988. "$ref": "#/components/schemas/SyncEventSessionNextTextDelta"
  10989. },
  10990. {
  10991. "$ref": "#/components/schemas/SyncEventSessionNextTextEnded"
  10992. },
  10993. {
  10994. "$ref": "#/components/schemas/SyncEventSessionNextReasoningStarted"
  10995. },
  10996. {
  10997. "$ref": "#/components/schemas/SyncEventSessionNextReasoningDelta"
  10998. },
  10999. {
  11000. "$ref": "#/components/schemas/SyncEventSessionNextReasoningEnded"
  11001. },
  11002. {
  11003. "$ref": "#/components/schemas/SyncEventSessionNextToolInputStarted"
  11004. },
  11005. {
  11006. "$ref": "#/components/schemas/SyncEventSessionNextToolInputDelta"
  11007. },
  11008. {
  11009. "$ref": "#/components/schemas/SyncEventSessionNextToolInputEnded"
  11010. },
  11011. {
  11012. "$ref": "#/components/schemas/SyncEventSessionNextToolCalled"
  11013. },
  11014. {
  11015. "$ref": "#/components/schemas/SyncEventSessionNextToolProgress"
  11016. },
  11017. {
  11018. "$ref": "#/components/schemas/SyncEventSessionNextToolSuccess"
  11019. },
  11020. {
  11021. "$ref": "#/components/schemas/SyncEventSessionNextToolFailed"
  11022. },
  11023. {
  11024. "$ref": "#/components/schemas/SyncEventSessionNextRetried"
  11025. },
  11026. {
  11027. "$ref": "#/components/schemas/SyncEventSessionNextCompactionStarted"
  11028. },
  11029. {
  11030. "$ref": "#/components/schemas/SyncEventSessionNextCompactionDelta"
  11031. },
  11032. {
  11033. "$ref": "#/components/schemas/SyncEventSessionNextCompactionEnded"
  11034. }
  11035. ]
  11036. }
  11037. },
  11038. "required": ["directory", "payload"],
  11039. "additionalProperties": false
  11040. },
  11041. "LogLevel": {
  11042. "type": "string",
  11043. "enum": ["DEBUG", "INFO", "WARN", "ERROR"],
  11044. "description": "Log level"
  11045. },
  11046. "ServerConfig": {
  11047. "type": "object",
  11048. "properties": {
  11049. "port": {
  11050. "type": "integer",
  11051. "exclusiveMinimum": 0
  11052. },
  11053. "hostname": {
  11054. "type": "string"
  11055. },
  11056. "mdns": {
  11057. "type": "boolean"
  11058. },
  11059. "mdnsDomain": {
  11060. "type": "string"
  11061. },
  11062. "cors": {
  11063. "type": "array",
  11064. "items": {
  11065. "type": "string"
  11066. }
  11067. }
  11068. },
  11069. "additionalProperties": false,
  11070. "description": "Server configuration for opencode serve and web commands"
  11071. },
  11072. "PermissionActionConfig": {
  11073. "type": "string",
  11074. "enum": ["ask", "allow", "deny"]
  11075. },
  11076. "PermissionObjectConfig": {
  11077. "type": "object",
  11078. "additionalProperties": {
  11079. "$ref": "#/components/schemas/PermissionActionConfig"
  11080. }
  11081. },
  11082. "PermissionRuleConfig": {
  11083. "anyOf": [
  11084. {
  11085. "$ref": "#/components/schemas/PermissionActionConfig"
  11086. },
  11087. {
  11088. "$ref": "#/components/schemas/PermissionObjectConfig"
  11089. }
  11090. ]
  11091. },
  11092. "PermissionConfig": {
  11093. "anyOf": [
  11094. {
  11095. "$ref": "#/components/schemas/PermissionActionConfig"
  11096. },
  11097. {
  11098. "type": "object",
  11099. "properties": {
  11100. "read": {
  11101. "$ref": "#/components/schemas/PermissionRuleConfig"
  11102. },
  11103. "edit": {
  11104. "$ref": "#/components/schemas/PermissionRuleConfig"
  11105. },
  11106. "glob": {
  11107. "$ref": "#/components/schemas/PermissionRuleConfig"
  11108. },
  11109. "grep": {
  11110. "$ref": "#/components/schemas/PermissionRuleConfig"
  11111. },
  11112. "list": {
  11113. "$ref": "#/components/schemas/PermissionRuleConfig"
  11114. },
  11115. "bash": {
  11116. "$ref": "#/components/schemas/PermissionRuleConfig"
  11117. },
  11118. "task": {
  11119. "$ref": "#/components/schemas/PermissionRuleConfig"
  11120. },
  11121. "external_directory": {
  11122. "$ref": "#/components/schemas/PermissionRuleConfig"
  11123. },
  11124. "todowrite": {
  11125. "$ref": "#/components/schemas/PermissionActionConfig"
  11126. },
  11127. "question": {
  11128. "$ref": "#/components/schemas/PermissionActionConfig"
  11129. },
  11130. "webfetch": {
  11131. "$ref": "#/components/schemas/PermissionActionConfig"
  11132. },
  11133. "websearch": {
  11134. "$ref": "#/components/schemas/PermissionActionConfig"
  11135. },
  11136. "lsp": {
  11137. "$ref": "#/components/schemas/PermissionRuleConfig"
  11138. },
  11139. "doom_loop": {
  11140. "$ref": "#/components/schemas/PermissionActionConfig"
  11141. },
  11142. "skill": {
  11143. "$ref": "#/components/schemas/PermissionRuleConfig"
  11144. }
  11145. },
  11146. "additionalProperties": {
  11147. "$ref": "#/components/schemas/PermissionRuleConfig"
  11148. }
  11149. }
  11150. ]
  11151. },
  11152. "AgentConfig": {
  11153. "type": "object",
  11154. "properties": {
  11155. "model": {
  11156. "type": "string"
  11157. },
  11158. "variant": {
  11159. "type": "string"
  11160. },
  11161. "temperature": {
  11162. "type": "number"
  11163. },
  11164. "top_p": {
  11165. "type": "number"
  11166. },
  11167. "prompt": {
  11168. "type": "string"
  11169. },
  11170. "tools": {
  11171. "type": "object",
  11172. "additionalProperties": {
  11173. "type": "boolean"
  11174. }
  11175. },
  11176. "disable": {
  11177. "type": "boolean"
  11178. },
  11179. "description": {
  11180. "type": "string"
  11181. },
  11182. "mode": {
  11183. "type": "string",
  11184. "enum": ["subagent", "primary", "all"]
  11185. },
  11186. "hidden": {
  11187. "type": "boolean"
  11188. },
  11189. "options": {
  11190. "type": "object"
  11191. },
  11192. "color": {
  11193. "anyOf": [
  11194. {
  11195. "type": "string",
  11196. "pattern": "^#[0-9a-fA-F]{6}$"
  11197. },
  11198. {
  11199. "type": "string",
  11200. "enum": ["primary", "secondary", "accent", "success", "warning", "error", "info"]
  11201. }
  11202. ],
  11203. "description": "Hex color code (e.g., #FF5733) or theme color (e.g., primary)"
  11204. },
  11205. "steps": {
  11206. "type": "integer",
  11207. "exclusiveMinimum": 0
  11208. },
  11209. "maxSteps": {
  11210. "type": "integer",
  11211. "exclusiveMinimum": 0
  11212. },
  11213. "permission": {
  11214. "$ref": "#/components/schemas/PermissionConfig"
  11215. }
  11216. },
  11217. "additionalProperties": {}
  11218. },
  11219. "ProviderConfig": {
  11220. "type": "object",
  11221. "properties": {
  11222. "api": {
  11223. "type": "string"
  11224. },
  11225. "name": {
  11226. "type": "string"
  11227. },
  11228. "env": {
  11229. "type": "array",
  11230. "items": {
  11231. "type": "string"
  11232. }
  11233. },
  11234. "id": {
  11235. "type": "string"
  11236. },
  11237. "npm": {
  11238. "type": "string"
  11239. },
  11240. "whitelist": {
  11241. "type": "array",
  11242. "items": {
  11243. "type": "string"
  11244. }
  11245. },
  11246. "blacklist": {
  11247. "type": "array",
  11248. "items": {
  11249. "type": "string"
  11250. }
  11251. },
  11252. "options": {
  11253. "type": "object",
  11254. "properties": {
  11255. "apiKey": {
  11256. "type": "string"
  11257. },
  11258. "baseURL": {
  11259. "type": "string"
  11260. },
  11261. "enterpriseUrl": {
  11262. "type": "string"
  11263. },
  11264. "setCacheKey": {
  11265. "type": "boolean"
  11266. },
  11267. "timeout": {
  11268. "anyOf": [
  11269. {
  11270. "type": "integer",
  11271. "exclusiveMinimum": 0
  11272. },
  11273. {
  11274. "type": "boolean",
  11275. "enum": [false]
  11276. }
  11277. ],
  11278. "description": "Timeout in milliseconds for requests to this provider. Default is 300000 (5 minutes). Set to false to disable timeout."
  11279. },
  11280. "chunkTimeout": {
  11281. "type": "integer",
  11282. "exclusiveMinimum": 0
  11283. }
  11284. },
  11285. "additionalProperties": {}
  11286. },
  11287. "models": {
  11288. "type": "object",
  11289. "additionalProperties": {
  11290. "type": "object",
  11291. "properties": {
  11292. "id": {
  11293. "type": "string"
  11294. },
  11295. "name": {
  11296. "type": "string"
  11297. },
  11298. "family": {
  11299. "type": "string"
  11300. },
  11301. "release_date": {
  11302. "type": "string"
  11303. },
  11304. "attachment": {
  11305. "type": "boolean"
  11306. },
  11307. "reasoning": {
  11308. "type": "boolean"
  11309. },
  11310. "temperature": {
  11311. "type": "boolean"
  11312. },
  11313. "tool_call": {
  11314. "type": "boolean"
  11315. },
  11316. "interleaved": {
  11317. "anyOf": [
  11318. {
  11319. "type": "boolean",
  11320. "enum": [true]
  11321. },
  11322. {
  11323. "type": "object",
  11324. "properties": {
  11325. "field": {
  11326. "type": "string",
  11327. "enum": ["reasoning_content", "reasoning_details"]
  11328. }
  11329. },
  11330. "required": ["field"],
  11331. "additionalProperties": false
  11332. }
  11333. ]
  11334. },
  11335. "cost": {
  11336. "type": "object",
  11337. "properties": {
  11338. "input": {
  11339. "type": "number"
  11340. },
  11341. "output": {
  11342. "type": "number"
  11343. },
  11344. "cache_read": {
  11345. "type": "number"
  11346. },
  11347. "cache_write": {
  11348. "type": "number"
  11349. },
  11350. "context_over_200k": {
  11351. "type": "object",
  11352. "properties": {
  11353. "input": {
  11354. "type": "number"
  11355. },
  11356. "output": {
  11357. "type": "number"
  11358. },
  11359. "cache_read": {
  11360. "type": "number"
  11361. },
  11362. "cache_write": {
  11363. "type": "number"
  11364. }
  11365. },
  11366. "required": ["input", "output"],
  11367. "additionalProperties": false
  11368. }
  11369. },
  11370. "required": ["input", "output"],
  11371. "additionalProperties": false
  11372. },
  11373. "limit": {
  11374. "type": "object",
  11375. "properties": {
  11376. "context": {
  11377. "type": "number"
  11378. },
  11379. "input": {
  11380. "type": "number"
  11381. },
  11382. "output": {
  11383. "type": "number"
  11384. }
  11385. },
  11386. "required": ["context", "output"],
  11387. "additionalProperties": false
  11388. },
  11389. "modalities": {
  11390. "type": "object",
  11391. "properties": {
  11392. "input": {
  11393. "type": "array",
  11394. "items": {
  11395. "type": "string",
  11396. "enum": ["text", "audio", "image", "video", "pdf"]
  11397. }
  11398. },
  11399. "output": {
  11400. "type": "array",
  11401. "items": {
  11402. "type": "string",
  11403. "enum": ["text", "audio", "image", "video", "pdf"]
  11404. }
  11405. }
  11406. },
  11407. "required": ["input", "output"],
  11408. "additionalProperties": false
  11409. },
  11410. "experimental": {
  11411. "type": "boolean"
  11412. },
  11413. "status": {
  11414. "type": "string",
  11415. "enum": ["alpha", "beta", "deprecated"]
  11416. },
  11417. "provider": {
  11418. "type": "object",
  11419. "properties": {
  11420. "npm": {
  11421. "type": "string"
  11422. },
  11423. "api": {
  11424. "type": "string"
  11425. }
  11426. },
  11427. "additionalProperties": false
  11428. },
  11429. "options": {
  11430. "type": "object"
  11431. },
  11432. "headers": {
  11433. "type": "object",
  11434. "additionalProperties": {
  11435. "type": "string"
  11436. }
  11437. },
  11438. "variants": {
  11439. "type": "object",
  11440. "additionalProperties": {
  11441. "type": "object",
  11442. "properties": {
  11443. "disabled": {
  11444. "type": "boolean"
  11445. }
  11446. },
  11447. "additionalProperties": {}
  11448. },
  11449. "description": "Variant-specific configuration"
  11450. }
  11451. },
  11452. "additionalProperties": false
  11453. }
  11454. }
  11455. },
  11456. "additionalProperties": false
  11457. },
  11458. "McpLocalConfig": {
  11459. "type": "object",
  11460. "properties": {
  11461. "type": {
  11462. "type": "string",
  11463. "enum": ["local"],
  11464. "description": "Type of MCP server connection"
  11465. },
  11466. "command": {
  11467. "type": "array",
  11468. "items": {
  11469. "type": "string"
  11470. },
  11471. "description": "Command and arguments to run the MCP server"
  11472. },
  11473. "environment": {
  11474. "type": "object",
  11475. "additionalProperties": {
  11476. "type": "string"
  11477. }
  11478. },
  11479. "enabled": {
  11480. "type": "boolean"
  11481. },
  11482. "timeout": {
  11483. "type": "integer",
  11484. "exclusiveMinimum": 0
  11485. }
  11486. },
  11487. "required": ["type", "command"],
  11488. "additionalProperties": false
  11489. },
  11490. "McpOAuthConfig": {
  11491. "type": "object",
  11492. "properties": {
  11493. "clientId": {
  11494. "type": "string"
  11495. },
  11496. "clientSecret": {
  11497. "type": "string"
  11498. },
  11499. "scope": {
  11500. "type": "string"
  11501. },
  11502. "redirectUri": {
  11503. "type": "string"
  11504. }
  11505. },
  11506. "additionalProperties": false
  11507. },
  11508. "McpRemoteConfig": {
  11509. "type": "object",
  11510. "properties": {
  11511. "type": {
  11512. "type": "string",
  11513. "enum": ["remote"],
  11514. "description": "Type of MCP server connection"
  11515. },
  11516. "url": {
  11517. "type": "string",
  11518. "description": "URL of the remote MCP server"
  11519. },
  11520. "enabled": {
  11521. "type": "boolean"
  11522. },
  11523. "headers": {
  11524. "type": "object",
  11525. "additionalProperties": {
  11526. "type": "string"
  11527. }
  11528. },
  11529. "oauth": {
  11530. "anyOf": [
  11531. {
  11532. "$ref": "#/components/schemas/McpOAuthConfig"
  11533. },
  11534. {
  11535. "type": "boolean",
  11536. "enum": [false]
  11537. }
  11538. ],
  11539. "description": "OAuth authentication configuration for the MCP server. Set to false to disable OAuth auto-detection."
  11540. },
  11541. "timeout": {
  11542. "type": "integer",
  11543. "exclusiveMinimum": 0
  11544. }
  11545. },
  11546. "required": ["type", "url"],
  11547. "additionalProperties": false
  11548. },
  11549. "LayoutConfig": {
  11550. "type": "string",
  11551. "enum": ["auto", "stretch"],
  11552. "description": "@deprecated Always uses stretch layout."
  11553. },
  11554. "Config": {
  11555. "type": "object",
  11556. "properties": {
  11557. "$schema": {
  11558. "type": "string"
  11559. },
  11560. "shell": {
  11561. "type": "string"
  11562. },
  11563. "logLevel": {
  11564. "$ref": "#/components/schemas/LogLevel"
  11565. },
  11566. "server": {
  11567. "$ref": "#/components/schemas/ServerConfig"
  11568. },
  11569. "command": {
  11570. "type": "object",
  11571. "additionalProperties": {
  11572. "type": "object",
  11573. "properties": {
  11574. "template": {
  11575. "type": "string"
  11576. },
  11577. "description": {
  11578. "type": "string"
  11579. },
  11580. "agent": {
  11581. "type": "string"
  11582. },
  11583. "model": {
  11584. "type": "string"
  11585. },
  11586. "subtask": {
  11587. "type": "boolean"
  11588. }
  11589. },
  11590. "required": ["template"],
  11591. "additionalProperties": false
  11592. }
  11593. },
  11594. "skills": {
  11595. "type": "object",
  11596. "properties": {
  11597. "paths": {
  11598. "type": "array",
  11599. "items": {
  11600. "type": "string"
  11601. }
  11602. },
  11603. "urls": {
  11604. "type": "array",
  11605. "items": {
  11606. "type": "string"
  11607. }
  11608. }
  11609. },
  11610. "additionalProperties": false
  11611. },
  11612. "watcher": {
  11613. "type": "object",
  11614. "properties": {
  11615. "ignore": {
  11616. "type": "array",
  11617. "items": {
  11618. "type": "string"
  11619. }
  11620. }
  11621. },
  11622. "additionalProperties": false
  11623. },
  11624. "snapshot": {
  11625. "type": "boolean"
  11626. },
  11627. "plugin": {
  11628. "type": "array",
  11629. "items": {
  11630. "anyOf": [
  11631. {
  11632. "type": "string"
  11633. },
  11634. {
  11635. "type": "array",
  11636. "prefixItems": [
  11637. {
  11638. "type": "string"
  11639. },
  11640. {
  11641. "type": "object"
  11642. }
  11643. ],
  11644. "maxItems": 2,
  11645. "minItems": 2
  11646. }
  11647. ]
  11648. }
  11649. },
  11650. "share": {
  11651. "type": "string",
  11652. "enum": ["manual", "auto", "disabled"]
  11653. },
  11654. "autoshare": {
  11655. "type": "boolean"
  11656. },
  11657. "autoupdate": {
  11658. "anyOf": [
  11659. {
  11660. "type": "boolean"
  11661. },
  11662. {
  11663. "type": "string",
  11664. "enum": ["notify"]
  11665. }
  11666. ],
  11667. "description": "Automatically update to the latest version. Set to true to auto-update, false to disable, or 'notify' to show update notifications"
  11668. },
  11669. "disabled_providers": {
  11670. "type": "array",
  11671. "items": {
  11672. "type": "string"
  11673. }
  11674. },
  11675. "enabled_providers": {
  11676. "type": "array",
  11677. "items": {
  11678. "type": "string"
  11679. }
  11680. },
  11681. "model": {
  11682. "type": "string"
  11683. },
  11684. "small_model": {
  11685. "type": "string"
  11686. },
  11687. "default_agent": {
  11688. "type": "string"
  11689. },
  11690. "username": {
  11691. "type": "string"
  11692. },
  11693. "mode": {
  11694. "type": "object",
  11695. "properties": {
  11696. "build": {
  11697. "$ref": "#/components/schemas/AgentConfig"
  11698. },
  11699. "plan": {
  11700. "$ref": "#/components/schemas/AgentConfig"
  11701. }
  11702. },
  11703. "additionalProperties": {
  11704. "$ref": "#/components/schemas/AgentConfig"
  11705. }
  11706. },
  11707. "agent": {
  11708. "type": "object",
  11709. "properties": {
  11710. "plan": {
  11711. "$ref": "#/components/schemas/AgentConfig"
  11712. },
  11713. "build": {
  11714. "$ref": "#/components/schemas/AgentConfig"
  11715. },
  11716. "general": {
  11717. "$ref": "#/components/schemas/AgentConfig"
  11718. },
  11719. "explore": {
  11720. "$ref": "#/components/schemas/AgentConfig"
  11721. },
  11722. "title": {
  11723. "$ref": "#/components/schemas/AgentConfig"
  11724. },
  11725. "summary": {
  11726. "$ref": "#/components/schemas/AgentConfig"
  11727. },
  11728. "compaction": {
  11729. "$ref": "#/components/schemas/AgentConfig"
  11730. }
  11731. },
  11732. "additionalProperties": {
  11733. "$ref": "#/components/schemas/AgentConfig"
  11734. }
  11735. },
  11736. "provider": {
  11737. "type": "object",
  11738. "additionalProperties": {
  11739. "$ref": "#/components/schemas/ProviderConfig"
  11740. }
  11741. },
  11742. "mcp": {
  11743. "type": "object",
  11744. "additionalProperties": {
  11745. "anyOf": [
  11746. {
  11747. "$ref": "#/components/schemas/McpLocalConfig"
  11748. },
  11749. {
  11750. "$ref": "#/components/schemas/McpRemoteConfig"
  11751. },
  11752. {
  11753. "type": "object",
  11754. "properties": {
  11755. "enabled": {
  11756. "type": "boolean"
  11757. }
  11758. },
  11759. "required": ["enabled"],
  11760. "additionalProperties": false
  11761. }
  11762. ]
  11763. }
  11764. },
  11765. "formatter": {
  11766. "anyOf": [
  11767. {
  11768. "type": "boolean"
  11769. },
  11770. {
  11771. "type": "object",
  11772. "additionalProperties": {
  11773. "type": "object",
  11774. "properties": {
  11775. "disabled": {
  11776. "type": "boolean"
  11777. },
  11778. "command": {
  11779. "type": "array",
  11780. "items": {
  11781. "type": "string"
  11782. }
  11783. },
  11784. "environment": {
  11785. "type": "object",
  11786. "additionalProperties": {
  11787. "type": "string"
  11788. }
  11789. },
  11790. "extensions": {
  11791. "type": "array",
  11792. "items": {
  11793. "type": "string"
  11794. }
  11795. }
  11796. },
  11797. "additionalProperties": false
  11798. }
  11799. }
  11800. ],
  11801. "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."
  11802. },
  11803. "lsp": {
  11804. "anyOf": [
  11805. {
  11806. "type": "boolean"
  11807. },
  11808. {
  11809. "type": "object",
  11810. "additionalProperties": {
  11811. "anyOf": [
  11812. {
  11813. "type": "object",
  11814. "properties": {
  11815. "disabled": {
  11816. "type": "boolean",
  11817. "enum": [true]
  11818. }
  11819. },
  11820. "required": ["disabled"],
  11821. "additionalProperties": false
  11822. },
  11823. {
  11824. "type": "object",
  11825. "properties": {
  11826. "command": {
  11827. "type": "array",
  11828. "items": {
  11829. "type": "string"
  11830. }
  11831. },
  11832. "extensions": {
  11833. "type": "array",
  11834. "items": {
  11835. "type": "string"
  11836. }
  11837. },
  11838. "disabled": {
  11839. "type": "boolean"
  11840. },
  11841. "env": {
  11842. "type": "object",
  11843. "additionalProperties": {
  11844. "type": "string"
  11845. }
  11846. },
  11847. "initialization": {
  11848. "type": "object"
  11849. }
  11850. },
  11851. "required": ["command"],
  11852. "additionalProperties": false
  11853. }
  11854. ]
  11855. }
  11856. }
  11857. ],
  11858. "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."
  11859. },
  11860. "instructions": {
  11861. "type": "array",
  11862. "items": {
  11863. "type": "string"
  11864. }
  11865. },
  11866. "layout": {
  11867. "$ref": "#/components/schemas/LayoutConfig"
  11868. },
  11869. "permission": {
  11870. "$ref": "#/components/schemas/PermissionConfig"
  11871. },
  11872. "tools": {
  11873. "type": "object",
  11874. "additionalProperties": {
  11875. "type": "boolean"
  11876. }
  11877. },
  11878. "enterprise": {
  11879. "type": "object",
  11880. "properties": {
  11881. "url": {
  11882. "type": "string"
  11883. }
  11884. },
  11885. "additionalProperties": false
  11886. },
  11887. "tool_output": {
  11888. "type": "object",
  11889. "properties": {
  11890. "max_lines": {
  11891. "type": "integer",
  11892. "exclusiveMinimum": 0
  11893. },
  11894. "max_bytes": {
  11895. "type": "integer",
  11896. "exclusiveMinimum": 0
  11897. }
  11898. },
  11899. "additionalProperties": false
  11900. },
  11901. "compaction": {
  11902. "type": "object",
  11903. "properties": {
  11904. "auto": {
  11905. "type": "boolean"
  11906. },
  11907. "prune": {
  11908. "type": "boolean"
  11909. },
  11910. "tail_turns": {
  11911. "type": "integer",
  11912. "minimum": 0
  11913. },
  11914. "preserve_recent_tokens": {
  11915. "type": "integer",
  11916. "minimum": 0
  11917. },
  11918. "reserved": {
  11919. "type": "integer",
  11920. "minimum": 0
  11921. }
  11922. },
  11923. "additionalProperties": false
  11924. },
  11925. "experimental": {
  11926. "type": "object",
  11927. "properties": {
  11928. "disable_paste_summary": {
  11929. "type": "boolean"
  11930. },
  11931. "batch_tool": {
  11932. "type": "boolean"
  11933. },
  11934. "openTelemetry": {
  11935. "type": "boolean"
  11936. },
  11937. "primary_tools": {
  11938. "type": "array",
  11939. "items": {
  11940. "type": "string"
  11941. }
  11942. },
  11943. "continue_loop_on_deny": {
  11944. "type": "boolean"
  11945. },
  11946. "mcp_timeout": {
  11947. "type": "integer",
  11948. "exclusiveMinimum": 0
  11949. }
  11950. },
  11951. "additionalProperties": false
  11952. }
  11953. },
  11954. "additionalProperties": false
  11955. },
  11956. "Model": {
  11957. "type": "object",
  11958. "properties": {
  11959. "id": {
  11960. "type": "string"
  11961. },
  11962. "providerID": {
  11963. "type": "string"
  11964. },
  11965. "api": {
  11966. "type": "object",
  11967. "properties": {
  11968. "id": {
  11969. "type": "string"
  11970. },
  11971. "url": {
  11972. "type": "string"
  11973. },
  11974. "npm": {
  11975. "type": "string"
  11976. }
  11977. },
  11978. "required": ["id", "url", "npm"],
  11979. "additionalProperties": false
  11980. },
  11981. "name": {
  11982. "type": "string"
  11983. },
  11984. "family": {
  11985. "type": "string"
  11986. },
  11987. "capabilities": {
  11988. "type": "object",
  11989. "properties": {
  11990. "temperature": {
  11991. "type": "boolean"
  11992. },
  11993. "reasoning": {
  11994. "type": "boolean"
  11995. },
  11996. "attachment": {
  11997. "type": "boolean"
  11998. },
  11999. "toolcall": {
  12000. "type": "boolean"
  12001. },
  12002. "input": {
  12003. "type": "object",
  12004. "properties": {
  12005. "text": {
  12006. "type": "boolean"
  12007. },
  12008. "audio": {
  12009. "type": "boolean"
  12010. },
  12011. "image": {
  12012. "type": "boolean"
  12013. },
  12014. "video": {
  12015. "type": "boolean"
  12016. },
  12017. "pdf": {
  12018. "type": "boolean"
  12019. }
  12020. },
  12021. "required": ["text", "audio", "image", "video", "pdf"],
  12022. "additionalProperties": false
  12023. },
  12024. "output": {
  12025. "type": "object",
  12026. "properties": {
  12027. "text": {
  12028. "type": "boolean"
  12029. },
  12030. "audio": {
  12031. "type": "boolean"
  12032. },
  12033. "image": {
  12034. "type": "boolean"
  12035. },
  12036. "video": {
  12037. "type": "boolean"
  12038. },
  12039. "pdf": {
  12040. "type": "boolean"
  12041. }
  12042. },
  12043. "required": ["text", "audio", "image", "video", "pdf"],
  12044. "additionalProperties": false
  12045. },
  12046. "interleaved": {
  12047. "anyOf": [
  12048. {
  12049. "type": "boolean"
  12050. },
  12051. {
  12052. "type": "object",
  12053. "properties": {
  12054. "field": {
  12055. "type": "string",
  12056. "enum": ["reasoning_content", "reasoning_details"]
  12057. }
  12058. },
  12059. "required": ["field"],
  12060. "additionalProperties": false
  12061. }
  12062. ]
  12063. }
  12064. },
  12065. "required": ["temperature", "reasoning", "attachment", "toolcall", "input", "output", "interleaved"],
  12066. "additionalProperties": false
  12067. },
  12068. "cost": {
  12069. "type": "object",
  12070. "properties": {
  12071. "input": {
  12072. "type": "number"
  12073. },
  12074. "output": {
  12075. "type": "number"
  12076. },
  12077. "cache": {
  12078. "type": "object",
  12079. "properties": {
  12080. "read": {
  12081. "type": "number"
  12082. },
  12083. "write": {
  12084. "type": "number"
  12085. }
  12086. },
  12087. "required": ["read", "write"],
  12088. "additionalProperties": false
  12089. },
  12090. "experimentalOver200K": {
  12091. "type": "object",
  12092. "properties": {
  12093. "input": {
  12094. "type": "number"
  12095. },
  12096. "output": {
  12097. "type": "number"
  12098. },
  12099. "cache": {
  12100. "type": "object",
  12101. "properties": {
  12102. "read": {
  12103. "type": "number"
  12104. },
  12105. "write": {
  12106. "type": "number"
  12107. }
  12108. },
  12109. "required": ["read", "write"],
  12110. "additionalProperties": false
  12111. }
  12112. },
  12113. "required": ["input", "output", "cache"],
  12114. "additionalProperties": false
  12115. }
  12116. },
  12117. "required": ["input", "output", "cache"],
  12118. "additionalProperties": false
  12119. },
  12120. "limit": {
  12121. "type": "object",
  12122. "properties": {
  12123. "context": {
  12124. "type": "number"
  12125. },
  12126. "input": {
  12127. "type": "number"
  12128. },
  12129. "output": {
  12130. "type": "number"
  12131. }
  12132. },
  12133. "required": ["context", "output"],
  12134. "additionalProperties": false
  12135. },
  12136. "status": {
  12137. "type": "string",
  12138. "enum": ["alpha", "beta", "deprecated", "active"]
  12139. },
  12140. "options": {
  12141. "type": "object"
  12142. },
  12143. "headers": {
  12144. "type": "object",
  12145. "additionalProperties": {
  12146. "type": "string"
  12147. }
  12148. },
  12149. "release_date": {
  12150. "type": "string"
  12151. },
  12152. "variants": {
  12153. "type": "object",
  12154. "additionalProperties": {
  12155. "type": "object"
  12156. }
  12157. }
  12158. },
  12159. "required": [
  12160. "id",
  12161. "providerID",
  12162. "api",
  12163. "name",
  12164. "capabilities",
  12165. "cost",
  12166. "limit",
  12167. "status",
  12168. "options",
  12169. "headers",
  12170. "release_date"
  12171. ],
  12172. "additionalProperties": false
  12173. },
  12174. "Provider": {
  12175. "type": "object",
  12176. "properties": {
  12177. "id": {
  12178. "type": "string"
  12179. },
  12180. "name": {
  12181. "type": "string"
  12182. },
  12183. "source": {
  12184. "type": "string",
  12185. "enum": ["env", "config", "custom", "api"]
  12186. },
  12187. "env": {
  12188. "type": "array",
  12189. "items": {
  12190. "type": "string"
  12191. }
  12192. },
  12193. "key": {
  12194. "type": "string"
  12195. },
  12196. "options": {
  12197. "type": "object"
  12198. },
  12199. "models": {
  12200. "type": "object",
  12201. "additionalProperties": {
  12202. "$ref": "#/components/schemas/Model"
  12203. }
  12204. }
  12205. },
  12206. "required": ["id", "name", "source", "env", "options", "models"],
  12207. "additionalProperties": false
  12208. },
  12209. "ConsoleState": {
  12210. "type": "object",
  12211. "properties": {
  12212. "consoleManagedProviders": {
  12213. "type": "array",
  12214. "items": {
  12215. "type": "string"
  12216. }
  12217. },
  12218. "activeOrgName": {
  12219. "type": "string"
  12220. },
  12221. "switchableOrgCount": {
  12222. "type": "integer",
  12223. "minimum": 0
  12224. }
  12225. },
  12226. "required": ["consoleManagedProviders", "switchableOrgCount"],
  12227. "additionalProperties": false
  12228. },
  12229. "ToolListItem": {
  12230. "type": "object",
  12231. "properties": {
  12232. "id": {
  12233. "type": "string"
  12234. },
  12235. "description": {
  12236. "type": "string"
  12237. },
  12238. "parameters": {}
  12239. },
  12240. "required": ["id", "description", "parameters"],
  12241. "additionalProperties": false
  12242. },
  12243. "ToolList": {
  12244. "type": "array",
  12245. "items": {
  12246. "$ref": "#/components/schemas/ToolListItem"
  12247. }
  12248. },
  12249. "ToolIDs": {
  12250. "type": "array",
  12251. "items": {
  12252. "type": "string"
  12253. }
  12254. },
  12255. "WorktreeCreateInput": {
  12256. "type": "object",
  12257. "properties": {
  12258. "name": {
  12259. "type": "string"
  12260. },
  12261. "startCommand": {
  12262. "type": "string",
  12263. "description": "Additional startup script to run after the project's start command"
  12264. }
  12265. },
  12266. "additionalProperties": false
  12267. },
  12268. "Worktree": {
  12269. "type": "object",
  12270. "properties": {
  12271. "name": {
  12272. "type": "string"
  12273. },
  12274. "branch": {
  12275. "type": "string"
  12276. },
  12277. "directory": {
  12278. "type": "string"
  12279. }
  12280. },
  12281. "required": ["name", "branch", "directory"],
  12282. "additionalProperties": false
  12283. },
  12284. "WorktreeRemoveInput": {
  12285. "type": "object",
  12286. "properties": {
  12287. "directory": {
  12288. "type": "string"
  12289. }
  12290. },
  12291. "required": ["directory"],
  12292. "additionalProperties": false
  12293. },
  12294. "WorktreeResetInput": {
  12295. "type": "object",
  12296. "properties": {
  12297. "directory": {
  12298. "type": "string"
  12299. }
  12300. },
  12301. "required": ["directory"],
  12302. "additionalProperties": false
  12303. },
  12304. "ProjectSummary": {
  12305. "type": "object",
  12306. "properties": {
  12307. "id": {
  12308. "type": "string"
  12309. },
  12310. "name": {
  12311. "type": "string"
  12312. },
  12313. "worktree": {
  12314. "type": "string"
  12315. }
  12316. },
  12317. "required": ["id", "worktree"],
  12318. "additionalProperties": false
  12319. },
  12320. "GlobalSession": {
  12321. "type": "object",
  12322. "properties": {
  12323. "id": {
  12324. "type": "string"
  12325. },
  12326. "slug": {
  12327. "type": "string"
  12328. },
  12329. "projectID": {
  12330. "type": "string"
  12331. },
  12332. "workspaceID": {
  12333. "type": "string"
  12334. },
  12335. "directory": {
  12336. "type": "string"
  12337. },
  12338. "path": {
  12339. "type": "string"
  12340. },
  12341. "parentID": {
  12342. "type": "string"
  12343. },
  12344. "summary": {
  12345. "type": "object",
  12346. "properties": {
  12347. "additions": {
  12348. "type": "integer",
  12349. "minimum": 0
  12350. },
  12351. "deletions": {
  12352. "type": "integer",
  12353. "minimum": 0
  12354. },
  12355. "files": {
  12356. "type": "integer",
  12357. "minimum": 0
  12358. },
  12359. "diffs": {
  12360. "type": "array",
  12361. "items": {
  12362. "$ref": "#/components/schemas/SnapshotFileDiff"
  12363. }
  12364. }
  12365. },
  12366. "required": ["additions", "deletions", "files"],
  12367. "additionalProperties": false
  12368. },
  12369. "share": {
  12370. "type": "object",
  12371. "properties": {
  12372. "url": {
  12373. "type": "string"
  12374. }
  12375. },
  12376. "required": ["url"],
  12377. "additionalProperties": false
  12378. },
  12379. "title": {
  12380. "type": "string"
  12381. },
  12382. "agent": {
  12383. "type": "string"
  12384. },
  12385. "model": {
  12386. "type": "object",
  12387. "properties": {
  12388. "id": {
  12389. "type": "string"
  12390. },
  12391. "providerID": {
  12392. "type": "string"
  12393. },
  12394. "variant": {
  12395. "type": "string"
  12396. }
  12397. },
  12398. "required": ["id", "providerID"],
  12399. "additionalProperties": false
  12400. },
  12401. "version": {
  12402. "type": "string"
  12403. },
  12404. "time": {
  12405. "type": "object",
  12406. "properties": {
  12407. "created": {
  12408. "type": "integer",
  12409. "minimum": 0
  12410. },
  12411. "updated": {
  12412. "type": "integer",
  12413. "minimum": 0
  12414. },
  12415. "compacting": {
  12416. "type": "integer",
  12417. "minimum": 0
  12418. },
  12419. "archived": {
  12420. "type": "number"
  12421. }
  12422. },
  12423. "required": ["created", "updated"],
  12424. "additionalProperties": false
  12425. },
  12426. "permission": {
  12427. "$ref": "#/components/schemas/PermissionRuleset"
  12428. },
  12429. "revert": {
  12430. "type": "object",
  12431. "properties": {
  12432. "messageID": {
  12433. "type": "string"
  12434. },
  12435. "partID": {
  12436. "type": "string"
  12437. },
  12438. "snapshot": {
  12439. "type": "string"
  12440. },
  12441. "diff": {
  12442. "type": "string"
  12443. }
  12444. },
  12445. "required": ["messageID"],
  12446. "additionalProperties": false
  12447. },
  12448. "project": {
  12449. "anyOf": [
  12450. {
  12451. "$ref": "#/components/schemas/ProjectSummary"
  12452. },
  12453. {
  12454. "type": "null"
  12455. }
  12456. ]
  12457. }
  12458. },
  12459. "required": ["id", "slug", "projectID", "directory", "title", "version", "time", "project"],
  12460. "additionalProperties": false
  12461. },
  12462. "McpResource": {
  12463. "type": "object",
  12464. "properties": {
  12465. "name": {
  12466. "type": "string"
  12467. },
  12468. "uri": {
  12469. "type": "string"
  12470. },
  12471. "description": {
  12472. "type": "string"
  12473. },
  12474. "mimeType": {
  12475. "type": "string"
  12476. },
  12477. "client": {
  12478. "type": "string"
  12479. }
  12480. },
  12481. "required": ["name", "uri", "client"],
  12482. "additionalProperties": false
  12483. },
  12484. "Symbol": {
  12485. "type": "object",
  12486. "properties": {
  12487. "name": {
  12488. "type": "string"
  12489. },
  12490. "kind": {
  12491. "type": "integer",
  12492. "minimum": 0
  12493. },
  12494. "location": {
  12495. "type": "object",
  12496. "properties": {
  12497. "uri": {
  12498. "type": "string"
  12499. },
  12500. "range": {
  12501. "$ref": "#/components/schemas/Range"
  12502. }
  12503. },
  12504. "required": ["uri", "range"],
  12505. "additionalProperties": false
  12506. }
  12507. },
  12508. "required": ["name", "kind", "location"],
  12509. "additionalProperties": false
  12510. },
  12511. "FileNode": {
  12512. "type": "object",
  12513. "properties": {
  12514. "name": {
  12515. "type": "string"
  12516. },
  12517. "path": {
  12518. "type": "string"
  12519. },
  12520. "absolute": {
  12521. "type": "string"
  12522. },
  12523. "type": {
  12524. "type": "string",
  12525. "enum": ["file", "directory"]
  12526. },
  12527. "ignored": {
  12528. "type": "boolean"
  12529. }
  12530. },
  12531. "required": ["name", "path", "absolute", "type", "ignored"],
  12532. "additionalProperties": false
  12533. },
  12534. "FileContent": {
  12535. "type": "object",
  12536. "properties": {
  12537. "type": {
  12538. "type": "string",
  12539. "enum": ["text", "binary"]
  12540. },
  12541. "content": {
  12542. "type": "string"
  12543. },
  12544. "diff": {
  12545. "type": "string"
  12546. },
  12547. "patch": {
  12548. "type": "object",
  12549. "properties": {
  12550. "oldFileName": {
  12551. "type": "string"
  12552. },
  12553. "newFileName": {
  12554. "type": "string"
  12555. },
  12556. "oldHeader": {
  12557. "type": "string"
  12558. },
  12559. "newHeader": {
  12560. "type": "string"
  12561. },
  12562. "hunks": {
  12563. "type": "array",
  12564. "items": {
  12565. "type": "object",
  12566. "properties": {
  12567. "oldStart": {
  12568. "type": "integer",
  12569. "minimum": 0
  12570. },
  12571. "oldLines": {
  12572. "type": "integer",
  12573. "minimum": 0
  12574. },
  12575. "newStart": {
  12576. "type": "integer",
  12577. "minimum": 0
  12578. },
  12579. "newLines": {
  12580. "type": "integer",
  12581. "minimum": 0
  12582. },
  12583. "lines": {
  12584. "type": "array",
  12585. "items": {
  12586. "type": "string"
  12587. }
  12588. }
  12589. },
  12590. "required": ["oldStart", "oldLines", "newStart", "newLines", "lines"],
  12591. "additionalProperties": false
  12592. }
  12593. },
  12594. "index": {
  12595. "type": "string"
  12596. }
  12597. },
  12598. "required": ["oldFileName", "newFileName", "hunks"],
  12599. "additionalProperties": false
  12600. },
  12601. "encoding": {
  12602. "type": "string",
  12603. "enum": ["base64"]
  12604. },
  12605. "mimeType": {
  12606. "type": "string"
  12607. }
  12608. },
  12609. "required": ["type", "content"],
  12610. "additionalProperties": false
  12611. },
  12612. "File": {
  12613. "type": "object",
  12614. "properties": {
  12615. "path": {
  12616. "type": "string"
  12617. },
  12618. "added": {
  12619. "type": "integer",
  12620. "minimum": 0
  12621. },
  12622. "removed": {
  12623. "type": "integer",
  12624. "minimum": 0
  12625. },
  12626. "status": {
  12627. "type": "string",
  12628. "enum": ["added", "deleted", "modified"]
  12629. }
  12630. },
  12631. "required": ["path", "added", "removed", "status"],
  12632. "additionalProperties": false
  12633. },
  12634. "Path": {
  12635. "type": "object",
  12636. "properties": {
  12637. "home": {
  12638. "type": "string"
  12639. },
  12640. "state": {
  12641. "type": "string"
  12642. },
  12643. "config": {
  12644. "type": "string"
  12645. },
  12646. "worktree": {
  12647. "type": "string"
  12648. },
  12649. "directory": {
  12650. "type": "string"
  12651. }
  12652. },
  12653. "required": ["home", "state", "config", "worktree", "directory"],
  12654. "additionalProperties": false
  12655. },
  12656. "VcsInfo": {
  12657. "type": "object",
  12658. "properties": {
  12659. "branch": {
  12660. "type": "string"
  12661. },
  12662. "default_branch": {
  12663. "type": "string"
  12664. }
  12665. },
  12666. "additionalProperties": false
  12667. },
  12668. "VcsFileDiff": {
  12669. "type": "object",
  12670. "properties": {
  12671. "file": {
  12672. "type": "string"
  12673. },
  12674. "patch": {
  12675. "type": "string"
  12676. },
  12677. "additions": {
  12678. "type": "integer",
  12679. "minimum": 0
  12680. },
  12681. "deletions": {
  12682. "type": "integer",
  12683. "minimum": 0
  12684. },
  12685. "status": {
  12686. "type": "string",
  12687. "enum": ["added", "deleted", "modified"]
  12688. }
  12689. },
  12690. "required": ["file", "patch", "additions", "deletions"],
  12691. "additionalProperties": false
  12692. },
  12693. "Command": {
  12694. "type": "object",
  12695. "properties": {
  12696. "name": {
  12697. "type": "string"
  12698. },
  12699. "description": {
  12700. "type": "string"
  12701. },
  12702. "agent": {
  12703. "type": "string"
  12704. },
  12705. "model": {
  12706. "type": "string"
  12707. },
  12708. "source": {
  12709. "type": "string",
  12710. "enum": ["command", "mcp", "skill"]
  12711. },
  12712. "template": {
  12713. "type": "string"
  12714. },
  12715. "subtask": {
  12716. "type": "boolean"
  12717. },
  12718. "hints": {
  12719. "type": "array",
  12720. "items": {
  12721. "type": "string"
  12722. }
  12723. }
  12724. },
  12725. "required": ["name", "template", "hints"],
  12726. "additionalProperties": false
  12727. },
  12728. "Agent": {
  12729. "type": "object",
  12730. "properties": {
  12731. "name": {
  12732. "type": "string"
  12733. },
  12734. "description": {
  12735. "type": "string"
  12736. },
  12737. "mode": {
  12738. "type": "string",
  12739. "enum": ["subagent", "primary", "all"]
  12740. },
  12741. "native": {
  12742. "type": "boolean"
  12743. },
  12744. "hidden": {
  12745. "type": "boolean"
  12746. },
  12747. "topP": {
  12748. "type": "number"
  12749. },
  12750. "temperature": {
  12751. "type": "number"
  12752. },
  12753. "color": {
  12754. "type": "string"
  12755. },
  12756. "permission": {
  12757. "$ref": "#/components/schemas/PermissionRuleset"
  12758. },
  12759. "model": {
  12760. "type": "object",
  12761. "properties": {
  12762. "modelID": {
  12763. "type": "string"
  12764. },
  12765. "providerID": {
  12766. "type": "string"
  12767. }
  12768. },
  12769. "required": ["modelID", "providerID"],
  12770. "additionalProperties": false
  12771. },
  12772. "variant": {
  12773. "type": "string"
  12774. },
  12775. "prompt": {
  12776. "type": "string"
  12777. },
  12778. "options": {
  12779. "type": "object"
  12780. },
  12781. "steps": {
  12782. "type": "number"
  12783. }
  12784. },
  12785. "required": ["name", "mode", "permission", "options"],
  12786. "additionalProperties": false
  12787. },
  12788. "LSPStatus": {
  12789. "type": "object",
  12790. "properties": {
  12791. "id": {
  12792. "type": "string"
  12793. },
  12794. "name": {
  12795. "type": "string"
  12796. },
  12797. "root": {
  12798. "type": "string"
  12799. },
  12800. "status": {
  12801. "type": "string",
  12802. "enum": ["connected", "error"]
  12803. }
  12804. },
  12805. "required": ["id", "name", "root", "status"],
  12806. "additionalProperties": false
  12807. },
  12808. "FormatterStatus": {
  12809. "type": "object",
  12810. "properties": {
  12811. "name": {
  12812. "type": "string"
  12813. },
  12814. "extensions": {
  12815. "type": "array",
  12816. "items": {
  12817. "type": "string"
  12818. }
  12819. },
  12820. "enabled": {
  12821. "type": "boolean"
  12822. }
  12823. },
  12824. "required": ["name", "extensions", "enabled"],
  12825. "additionalProperties": false
  12826. },
  12827. "MCPStatusConnected": {
  12828. "type": "object",
  12829. "properties": {
  12830. "status": {
  12831. "type": "string",
  12832. "enum": ["connected"]
  12833. }
  12834. },
  12835. "required": ["status"],
  12836. "additionalProperties": false
  12837. },
  12838. "MCPStatusDisabled": {
  12839. "type": "object",
  12840. "properties": {
  12841. "status": {
  12842. "type": "string",
  12843. "enum": ["disabled"]
  12844. }
  12845. },
  12846. "required": ["status"],
  12847. "additionalProperties": false
  12848. },
  12849. "MCPStatusFailed": {
  12850. "type": "object",
  12851. "properties": {
  12852. "status": {
  12853. "type": "string",
  12854. "enum": ["failed"]
  12855. },
  12856. "error": {
  12857. "type": "string"
  12858. }
  12859. },
  12860. "required": ["status", "error"],
  12861. "additionalProperties": false
  12862. },
  12863. "MCPStatusNeedsAuth": {
  12864. "type": "object",
  12865. "properties": {
  12866. "status": {
  12867. "type": "string",
  12868. "enum": ["needs_auth"]
  12869. }
  12870. },
  12871. "required": ["status"],
  12872. "additionalProperties": false
  12873. },
  12874. "MCPStatusNeedsClientRegistration": {
  12875. "type": "object",
  12876. "properties": {
  12877. "status": {
  12878. "type": "string",
  12879. "enum": ["needs_client_registration"]
  12880. },
  12881. "error": {
  12882. "type": "string"
  12883. }
  12884. },
  12885. "required": ["status", "error"],
  12886. "additionalProperties": false
  12887. },
  12888. "MCPStatus": {
  12889. "anyOf": [
  12890. {
  12891. "$ref": "#/components/schemas/MCPStatusConnected"
  12892. },
  12893. {
  12894. "$ref": "#/components/schemas/MCPStatusDisabled"
  12895. },
  12896. {
  12897. "$ref": "#/components/schemas/MCPStatusFailed"
  12898. },
  12899. {
  12900. "$ref": "#/components/schemas/MCPStatusNeedsAuth"
  12901. },
  12902. {
  12903. "$ref": "#/components/schemas/MCPStatusNeedsClientRegistration"
  12904. }
  12905. ]
  12906. },
  12907. "McpUnsupportedOAuthError": {
  12908. "type": "object",
  12909. "properties": {
  12910. "error": {
  12911. "type": "string"
  12912. }
  12913. },
  12914. "required": ["error"],
  12915. "additionalProperties": false
  12916. },
  12917. "NotFoundError": {
  12918. "type": "object",
  12919. "required": ["name", "data"],
  12920. "properties": {
  12921. "name": {
  12922. "type": "string",
  12923. "enum": ["NotFoundError"]
  12924. },
  12925. "data": {
  12926. "type": "object",
  12927. "required": ["message"],
  12928. "properties": {
  12929. "message": {
  12930. "type": "string"
  12931. }
  12932. }
  12933. }
  12934. }
  12935. },
  12936. "effect_HttpApiError_Forbidden": {
  12937. "type": "object",
  12938. "properties": {
  12939. "_tag": {
  12940. "type": "string",
  12941. "enum": ["Forbidden"]
  12942. }
  12943. },
  12944. "required": ["_tag"],
  12945. "additionalProperties": false
  12946. },
  12947. "ProviderAuthMethod": {
  12948. "type": "object",
  12949. "properties": {
  12950. "type": {
  12951. "type": "string",
  12952. "enum": ["oauth", "api"]
  12953. },
  12954. "label": {
  12955. "type": "string"
  12956. },
  12957. "prompts": {
  12958. "type": "array",
  12959. "items": {
  12960. "anyOf": [
  12961. {
  12962. "type": "object",
  12963. "properties": {
  12964. "type": {
  12965. "type": "string",
  12966. "enum": ["text"]
  12967. },
  12968. "key": {
  12969. "type": "string"
  12970. },
  12971. "message": {
  12972. "type": "string"
  12973. },
  12974. "placeholder": {
  12975. "type": "string"
  12976. },
  12977. "when": {
  12978. "type": "object",
  12979. "properties": {
  12980. "key": {
  12981. "type": "string"
  12982. },
  12983. "op": {
  12984. "type": "string",
  12985. "enum": ["eq", "neq"]
  12986. },
  12987. "value": {
  12988. "type": "string"
  12989. }
  12990. },
  12991. "required": ["key", "op", "value"],
  12992. "additionalProperties": false
  12993. }
  12994. },
  12995. "required": ["type", "key", "message"],
  12996. "additionalProperties": false
  12997. },
  12998. {
  12999. "type": "object",
  13000. "properties": {
  13001. "type": {
  13002. "type": "string",
  13003. "enum": ["select"]
  13004. },
  13005. "key": {
  13006. "type": "string"
  13007. },
  13008. "message": {
  13009. "type": "string"
  13010. },
  13011. "options": {
  13012. "type": "array",
  13013. "items": {
  13014. "type": "object",
  13015. "properties": {
  13016. "label": {
  13017. "type": "string"
  13018. },
  13019. "value": {
  13020. "type": "string"
  13021. },
  13022. "hint": {
  13023. "type": "string"
  13024. }
  13025. },
  13026. "required": ["label", "value"],
  13027. "additionalProperties": false
  13028. }
  13029. },
  13030. "when": {
  13031. "type": "object",
  13032. "properties": {
  13033. "key": {
  13034. "type": "string"
  13035. },
  13036. "op": {
  13037. "type": "string",
  13038. "enum": ["eq", "neq"]
  13039. },
  13040. "value": {
  13041. "type": "string"
  13042. }
  13043. },
  13044. "required": ["key", "op", "value"],
  13045. "additionalProperties": false
  13046. }
  13047. },
  13048. "required": ["type", "key", "message", "options"],
  13049. "additionalProperties": false
  13050. }
  13051. ]
  13052. }
  13053. }
  13054. },
  13055. "required": ["type", "label"],
  13056. "additionalProperties": false
  13057. },
  13058. "ProviderAuthAuthorization": {
  13059. "type": "object",
  13060. "properties": {
  13061. "url": {
  13062. "type": "string"
  13063. },
  13064. "method": {
  13065. "type": "string",
  13066. "enum": ["auto", "code"]
  13067. },
  13068. "instructions": {
  13069. "type": "string"
  13070. }
  13071. },
  13072. "required": ["url", "method", "instructions"],
  13073. "additionalProperties": false
  13074. },
  13075. "TextPartInput": {
  13076. "type": "object",
  13077. "properties": {
  13078. "id": {
  13079. "type": "string"
  13080. },
  13081. "type": {
  13082. "type": "string",
  13083. "enum": ["text"]
  13084. },
  13085. "text": {
  13086. "type": "string"
  13087. },
  13088. "synthetic": {
  13089. "type": "boolean"
  13090. },
  13091. "ignored": {
  13092. "type": "boolean"
  13093. },
  13094. "time": {
  13095. "type": "object",
  13096. "properties": {
  13097. "start": {
  13098. "type": "integer",
  13099. "minimum": 0
  13100. },
  13101. "end": {
  13102. "type": "integer",
  13103. "minimum": 0
  13104. }
  13105. },
  13106. "required": ["start"],
  13107. "additionalProperties": false
  13108. },
  13109. "metadata": {
  13110. "type": "object"
  13111. }
  13112. },
  13113. "required": ["type", "text"],
  13114. "additionalProperties": false
  13115. },
  13116. "FilePartInput": {
  13117. "type": "object",
  13118. "properties": {
  13119. "id": {
  13120. "type": "string"
  13121. },
  13122. "type": {
  13123. "type": "string",
  13124. "enum": ["file"]
  13125. },
  13126. "mime": {
  13127. "type": "string"
  13128. },
  13129. "filename": {
  13130. "type": "string"
  13131. },
  13132. "url": {
  13133. "type": "string"
  13134. },
  13135. "source": {
  13136. "$ref": "#/components/schemas/FilePartSource"
  13137. }
  13138. },
  13139. "required": ["type", "mime", "url"],
  13140. "additionalProperties": false
  13141. },
  13142. "AgentPartInput": {
  13143. "type": "object",
  13144. "properties": {
  13145. "id": {
  13146. "type": "string"
  13147. },
  13148. "type": {
  13149. "type": "string",
  13150. "enum": ["agent"]
  13151. },
  13152. "name": {
  13153. "type": "string"
  13154. },
  13155. "source": {
  13156. "type": "object",
  13157. "properties": {
  13158. "value": {
  13159. "type": "string"
  13160. },
  13161. "start": {
  13162. "type": "integer",
  13163. "minimum": 0
  13164. },
  13165. "end": {
  13166. "type": "integer",
  13167. "minimum": 0
  13168. }
  13169. },
  13170. "required": ["value", "start", "end"],
  13171. "additionalProperties": false
  13172. }
  13173. },
  13174. "required": ["type", "name"],
  13175. "additionalProperties": false
  13176. },
  13177. "SubtaskPartInput": {
  13178. "type": "object",
  13179. "properties": {
  13180. "id": {
  13181. "type": "string"
  13182. },
  13183. "type": {
  13184. "type": "string",
  13185. "enum": ["subtask"]
  13186. },
  13187. "prompt": {
  13188. "type": "string"
  13189. },
  13190. "description": {
  13191. "type": "string"
  13192. },
  13193. "agent": {
  13194. "type": "string"
  13195. },
  13196. "model": {
  13197. "type": "object",
  13198. "properties": {
  13199. "providerID": {
  13200. "type": "string"
  13201. },
  13202. "modelID": {
  13203. "type": "string"
  13204. }
  13205. },
  13206. "required": ["providerID", "modelID"],
  13207. "additionalProperties": false
  13208. },
  13209. "command": {
  13210. "type": "string"
  13211. }
  13212. },
  13213. "required": ["type", "prompt", "description", "agent"],
  13214. "additionalProperties": false
  13215. },
  13216. "V2SessionsResponse": {
  13217. "type": "object",
  13218. "properties": {
  13219. "items": {
  13220. "type": "array",
  13221. "items": {
  13222. "$ref": "#/components/schemas/SessionInfo"
  13223. }
  13224. },
  13225. "cursor": {
  13226. "type": "object",
  13227. "properties": {
  13228. "previous": {
  13229. "type": "string"
  13230. },
  13231. "next": {
  13232. "type": "string"
  13233. }
  13234. },
  13235. "additionalProperties": false
  13236. }
  13237. },
  13238. "required": ["items", "cursor"],
  13239. "additionalProperties": false
  13240. },
  13241. "V2SessionMessagesResponse": {
  13242. "type": "object",
  13243. "properties": {
  13244. "items": {
  13245. "type": "array",
  13246. "items": {
  13247. "$ref": "#/components/schemas/SessionMessage"
  13248. }
  13249. },
  13250. "cursor": {
  13251. "type": "object",
  13252. "properties": {
  13253. "previous": {
  13254. "type": "string"
  13255. },
  13256. "next": {
  13257. "type": "string"
  13258. }
  13259. },
  13260. "additionalProperties": false
  13261. }
  13262. },
  13263. "required": ["items", "cursor"],
  13264. "additionalProperties": false
  13265. },
  13266. "EventTuiPromptAppend": {
  13267. "type": "object",
  13268. "properties": {
  13269. "type": {
  13270. "type": "string",
  13271. "enum": ["tui.prompt.append"]
  13272. },
  13273. "properties": {
  13274. "type": "object",
  13275. "properties": {
  13276. "text": {
  13277. "type": "string"
  13278. }
  13279. },
  13280. "required": ["text"],
  13281. "additionalProperties": false
  13282. }
  13283. },
  13284. "required": ["type", "properties"],
  13285. "additionalProperties": false
  13286. },
  13287. "EventTuiCommandExecute": {
  13288. "type": "object",
  13289. "properties": {
  13290. "type": {
  13291. "type": "string",
  13292. "enum": ["tui.command.execute"]
  13293. },
  13294. "properties": {
  13295. "type": "object",
  13296. "properties": {
  13297. "command": {
  13298. "anyOf": [
  13299. {
  13300. "type": "string",
  13301. "enum": [
  13302. "session.list",
  13303. "session.new",
  13304. "session.share",
  13305. "session.interrupt",
  13306. "session.compact",
  13307. "session.page.up",
  13308. "session.page.down",
  13309. "session.line.up",
  13310. "session.line.down",
  13311. "session.half.page.up",
  13312. "session.half.page.down",
  13313. "session.first",
  13314. "session.last",
  13315. "prompt.clear",
  13316. "prompt.submit",
  13317. "agent.cycle"
  13318. ]
  13319. },
  13320. {
  13321. "type": "string"
  13322. }
  13323. ]
  13324. }
  13325. },
  13326. "required": ["command"],
  13327. "additionalProperties": false
  13328. }
  13329. },
  13330. "required": ["type", "properties"],
  13331. "additionalProperties": false
  13332. },
  13333. "EventTuiToastShow": {
  13334. "type": "object",
  13335. "properties": {
  13336. "type": {
  13337. "type": "string",
  13338. "enum": ["tui.toast.show"]
  13339. },
  13340. "properties": {
  13341. "type": "object",
  13342. "properties": {
  13343. "title": {
  13344. "type": "string"
  13345. },
  13346. "message": {
  13347. "type": "string"
  13348. },
  13349. "variant": {
  13350. "type": "string",
  13351. "enum": ["info", "success", "warning", "error"]
  13352. },
  13353. "duration": {
  13354. "type": "integer",
  13355. "exclusiveMinimum": 0
  13356. }
  13357. },
  13358. "required": ["message", "variant"],
  13359. "additionalProperties": false
  13360. }
  13361. },
  13362. "required": ["type", "properties"],
  13363. "additionalProperties": false
  13364. },
  13365. "EventTuiSessionSelect": {
  13366. "type": "object",
  13367. "properties": {
  13368. "type": {
  13369. "type": "string",
  13370. "enum": ["tui.session.select"]
  13371. },
  13372. "properties": {
  13373. "type": "object",
  13374. "properties": {
  13375. "sessionID": {
  13376. "type": "string",
  13377. "description": "Session ID to navigate to"
  13378. }
  13379. },
  13380. "required": ["sessionID"],
  13381. "additionalProperties": false
  13382. }
  13383. },
  13384. "required": ["type", "properties"],
  13385. "additionalProperties": false
  13386. },
  13387. "Workspace": {
  13388. "type": "object",
  13389. "properties": {
  13390. "id": {
  13391. "type": "string"
  13392. },
  13393. "type": {
  13394. "type": "string"
  13395. },
  13396. "name": {
  13397. "type": "string"
  13398. },
  13399. "branch": {
  13400. "anyOf": [
  13401. {
  13402. "type": "string"
  13403. },
  13404. {
  13405. "type": "null"
  13406. }
  13407. ]
  13408. },
  13409. "directory": {
  13410. "anyOf": [
  13411. {
  13412. "type": "string"
  13413. },
  13414. {
  13415. "type": "null"
  13416. }
  13417. ]
  13418. },
  13419. "extra": {
  13420. "anyOf": [
  13421. {},
  13422. {
  13423. "type": "null"
  13424. }
  13425. ]
  13426. },
  13427. "projectID": {
  13428. "type": "string"
  13429. }
  13430. },
  13431. "required": ["id", "type", "name", "branch", "directory", "extra", "projectID"],
  13432. "additionalProperties": false
  13433. },
  13434. "SyncEventMessageUpdated": {
  13435. "type": "object",
  13436. "properties": {
  13437. "type": {
  13438. "type": "string",
  13439. "enum": ["sync"]
  13440. },
  13441. "name": {
  13442. "type": "string",
  13443. "enum": ["message.updated.1"]
  13444. },
  13445. "id": {
  13446. "type": "string"
  13447. },
  13448. "seq": {
  13449. "type": "number"
  13450. },
  13451. "aggregateID": {
  13452. "type": "string",
  13453. "enum": ["sessionID"]
  13454. },
  13455. "data": {
  13456. "type": "object",
  13457. "properties": {
  13458. "sessionID": {
  13459. "type": "string"
  13460. },
  13461. "info": {
  13462. "$ref": "#/components/schemas/Message"
  13463. }
  13464. },
  13465. "required": ["sessionID", "info"],
  13466. "additionalProperties": false
  13467. }
  13468. },
  13469. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  13470. "additionalProperties": false
  13471. },
  13472. "SyncEventMessageRemoved": {
  13473. "type": "object",
  13474. "properties": {
  13475. "type": {
  13476. "type": "string",
  13477. "enum": ["sync"]
  13478. },
  13479. "name": {
  13480. "type": "string",
  13481. "enum": ["message.removed.1"]
  13482. },
  13483. "id": {
  13484. "type": "string"
  13485. },
  13486. "seq": {
  13487. "type": "number"
  13488. },
  13489. "aggregateID": {
  13490. "type": "string",
  13491. "enum": ["sessionID"]
  13492. },
  13493. "data": {
  13494. "type": "object",
  13495. "properties": {
  13496. "sessionID": {
  13497. "type": "string"
  13498. },
  13499. "messageID": {
  13500. "type": "string"
  13501. }
  13502. },
  13503. "required": ["sessionID", "messageID"],
  13504. "additionalProperties": false
  13505. }
  13506. },
  13507. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  13508. "additionalProperties": false
  13509. },
  13510. "SyncEventMessagePartUpdated": {
  13511. "type": "object",
  13512. "properties": {
  13513. "type": {
  13514. "type": "string",
  13515. "enum": ["sync"]
  13516. },
  13517. "name": {
  13518. "type": "string",
  13519. "enum": ["message.part.updated.1"]
  13520. },
  13521. "id": {
  13522. "type": "string"
  13523. },
  13524. "seq": {
  13525. "type": "number"
  13526. },
  13527. "aggregateID": {
  13528. "type": "string",
  13529. "enum": ["sessionID"]
  13530. },
  13531. "data": {
  13532. "type": "object",
  13533. "properties": {
  13534. "sessionID": {
  13535. "type": "string"
  13536. },
  13537. "part": {
  13538. "$ref": "#/components/schemas/Part"
  13539. },
  13540. "time": {
  13541. "type": "integer",
  13542. "minimum": 0
  13543. }
  13544. },
  13545. "required": ["sessionID", "part", "time"],
  13546. "additionalProperties": false
  13547. }
  13548. },
  13549. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  13550. "additionalProperties": false
  13551. },
  13552. "SyncEventMessagePartRemoved": {
  13553. "type": "object",
  13554. "properties": {
  13555. "type": {
  13556. "type": "string",
  13557. "enum": ["sync"]
  13558. },
  13559. "name": {
  13560. "type": "string",
  13561. "enum": ["message.part.removed.1"]
  13562. },
  13563. "id": {
  13564. "type": "string"
  13565. },
  13566. "seq": {
  13567. "type": "number"
  13568. },
  13569. "aggregateID": {
  13570. "type": "string",
  13571. "enum": ["sessionID"]
  13572. },
  13573. "data": {
  13574. "type": "object",
  13575. "properties": {
  13576. "sessionID": {
  13577. "type": "string"
  13578. },
  13579. "messageID": {
  13580. "type": "string"
  13581. },
  13582. "partID": {
  13583. "type": "string"
  13584. }
  13585. },
  13586. "required": ["sessionID", "messageID", "partID"],
  13587. "additionalProperties": false
  13588. }
  13589. },
  13590. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  13591. "additionalProperties": false
  13592. },
  13593. "SyncEventSessionCreated": {
  13594. "type": "object",
  13595. "properties": {
  13596. "type": {
  13597. "type": "string",
  13598. "enum": ["sync"]
  13599. },
  13600. "name": {
  13601. "type": "string",
  13602. "enum": ["session.created.1"]
  13603. },
  13604. "id": {
  13605. "type": "string"
  13606. },
  13607. "seq": {
  13608. "type": "number"
  13609. },
  13610. "aggregateID": {
  13611. "type": "string",
  13612. "enum": ["sessionID"]
  13613. },
  13614. "data": {
  13615. "type": "object",
  13616. "properties": {
  13617. "sessionID": {
  13618. "type": "string"
  13619. },
  13620. "info": {
  13621. "$ref": "#/components/schemas/Session"
  13622. }
  13623. },
  13624. "required": ["sessionID", "info"],
  13625. "additionalProperties": false
  13626. }
  13627. },
  13628. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  13629. "additionalProperties": false
  13630. },
  13631. "SyncEventSessionUpdated": {
  13632. "type": "object",
  13633. "properties": {
  13634. "type": {
  13635. "type": "string",
  13636. "enum": ["sync"]
  13637. },
  13638. "name": {
  13639. "type": "string",
  13640. "enum": ["session.updated.1"]
  13641. },
  13642. "id": {
  13643. "type": "string"
  13644. },
  13645. "seq": {
  13646. "type": "number"
  13647. },
  13648. "aggregateID": {
  13649. "type": "string",
  13650. "enum": ["sessionID"]
  13651. },
  13652. "data": {
  13653. "type": "object",
  13654. "properties": {
  13655. "sessionID": {
  13656. "type": "string"
  13657. },
  13658. "info": {
  13659. "type": "object",
  13660. "properties": {
  13661. "id": {
  13662. "anyOf": [
  13663. {
  13664. "type": "string"
  13665. },
  13666. {
  13667. "type": "null"
  13668. }
  13669. ]
  13670. },
  13671. "slug": {
  13672. "anyOf": [
  13673. {
  13674. "type": "string"
  13675. },
  13676. {
  13677. "type": "null"
  13678. }
  13679. ]
  13680. },
  13681. "projectID": {
  13682. "anyOf": [
  13683. {
  13684. "type": "string"
  13685. },
  13686. {
  13687. "type": "null"
  13688. }
  13689. ]
  13690. },
  13691. "workspaceID": {
  13692. "anyOf": [
  13693. {
  13694. "type": "string"
  13695. },
  13696. {
  13697. "type": "null"
  13698. }
  13699. ]
  13700. },
  13701. "directory": {
  13702. "anyOf": [
  13703. {
  13704. "type": "string"
  13705. },
  13706. {
  13707. "type": "null"
  13708. }
  13709. ]
  13710. },
  13711. "path": {
  13712. "anyOf": [
  13713. {
  13714. "type": "string"
  13715. },
  13716. {
  13717. "type": "null"
  13718. }
  13719. ]
  13720. },
  13721. "parentID": {
  13722. "anyOf": [
  13723. {
  13724. "type": "string"
  13725. },
  13726. {
  13727. "type": "null"
  13728. }
  13729. ]
  13730. },
  13731. "summary": {
  13732. "anyOf": [
  13733. {
  13734. "type": "object",
  13735. "properties": {
  13736. "additions": {
  13737. "type": "integer",
  13738. "minimum": 0
  13739. },
  13740. "deletions": {
  13741. "type": "integer",
  13742. "minimum": 0
  13743. },
  13744. "files": {
  13745. "type": "integer",
  13746. "minimum": 0
  13747. },
  13748. "diffs": {
  13749. "type": "array",
  13750. "items": {
  13751. "$ref": "#/components/schemas/SnapshotFileDiff"
  13752. }
  13753. }
  13754. },
  13755. "required": ["additions", "deletions", "files"],
  13756. "additionalProperties": false
  13757. },
  13758. {
  13759. "type": "null"
  13760. }
  13761. ]
  13762. },
  13763. "share": {
  13764. "type": "object",
  13765. "properties": {
  13766. "url": {
  13767. "anyOf": [
  13768. {
  13769. "type": "string"
  13770. },
  13771. {
  13772. "type": "null"
  13773. }
  13774. ]
  13775. }
  13776. },
  13777. "additionalProperties": false
  13778. },
  13779. "title": {
  13780. "anyOf": [
  13781. {
  13782. "type": "string"
  13783. },
  13784. {
  13785. "type": "null"
  13786. }
  13787. ]
  13788. },
  13789. "agent": {
  13790. "anyOf": [
  13791. {
  13792. "type": "string"
  13793. },
  13794. {
  13795. "type": "null"
  13796. }
  13797. ]
  13798. },
  13799. "model": {
  13800. "anyOf": [
  13801. {
  13802. "type": "object",
  13803. "properties": {
  13804. "id": {
  13805. "type": "string"
  13806. },
  13807. "providerID": {
  13808. "type": "string"
  13809. },
  13810. "variant": {
  13811. "type": "string"
  13812. }
  13813. },
  13814. "required": ["id", "providerID"],
  13815. "additionalProperties": false
  13816. },
  13817. {
  13818. "type": "null"
  13819. }
  13820. ]
  13821. },
  13822. "version": {
  13823. "anyOf": [
  13824. {
  13825. "type": "string"
  13826. },
  13827. {
  13828. "type": "null"
  13829. }
  13830. ]
  13831. },
  13832. "time": {
  13833. "type": "object",
  13834. "properties": {
  13835. "created": {
  13836. "anyOf": [
  13837. {
  13838. "type": "integer",
  13839. "minimum": 0
  13840. },
  13841. {
  13842. "type": "null"
  13843. }
  13844. ]
  13845. },
  13846. "updated": {
  13847. "anyOf": [
  13848. {
  13849. "type": "integer",
  13850. "minimum": 0
  13851. },
  13852. {
  13853. "type": "null"
  13854. }
  13855. ]
  13856. },
  13857. "compacting": {
  13858. "anyOf": [
  13859. {
  13860. "type": "integer",
  13861. "minimum": 0
  13862. },
  13863. {
  13864. "type": "null"
  13865. }
  13866. ]
  13867. },
  13868. "archived": {
  13869. "anyOf": [
  13870. {
  13871. "type": "number"
  13872. },
  13873. {
  13874. "type": "null"
  13875. }
  13876. ]
  13877. }
  13878. },
  13879. "additionalProperties": false
  13880. },
  13881. "permission": {
  13882. "anyOf": [
  13883. {
  13884. "$ref": "#/components/schemas/PermissionRuleset"
  13885. },
  13886. {
  13887. "type": "null"
  13888. }
  13889. ]
  13890. },
  13891. "revert": {
  13892. "anyOf": [
  13893. {
  13894. "type": "object",
  13895. "properties": {
  13896. "messageID": {
  13897. "type": "string"
  13898. },
  13899. "partID": {
  13900. "type": "string"
  13901. },
  13902. "snapshot": {
  13903. "type": "string"
  13904. },
  13905. "diff": {
  13906. "type": "string"
  13907. }
  13908. },
  13909. "required": ["messageID"],
  13910. "additionalProperties": false
  13911. },
  13912. {
  13913. "type": "null"
  13914. }
  13915. ]
  13916. }
  13917. },
  13918. "additionalProperties": false
  13919. }
  13920. },
  13921. "required": ["sessionID", "info"],
  13922. "additionalProperties": false
  13923. }
  13924. },
  13925. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  13926. "additionalProperties": false
  13927. },
  13928. "SyncEventSessionDeleted": {
  13929. "type": "object",
  13930. "properties": {
  13931. "type": {
  13932. "type": "string",
  13933. "enum": ["sync"]
  13934. },
  13935. "name": {
  13936. "type": "string",
  13937. "enum": ["session.deleted.1"]
  13938. },
  13939. "id": {
  13940. "type": "string"
  13941. },
  13942. "seq": {
  13943. "type": "number"
  13944. },
  13945. "aggregateID": {
  13946. "type": "string",
  13947. "enum": ["sessionID"]
  13948. },
  13949. "data": {
  13950. "type": "object",
  13951. "properties": {
  13952. "sessionID": {
  13953. "type": "string"
  13954. },
  13955. "info": {
  13956. "$ref": "#/components/schemas/Session"
  13957. }
  13958. },
  13959. "required": ["sessionID", "info"],
  13960. "additionalProperties": false
  13961. }
  13962. },
  13963. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  13964. "additionalProperties": false
  13965. },
  13966. "SyncEventSessionNextAgentSwitched": {
  13967. "type": "object",
  13968. "properties": {
  13969. "type": {
  13970. "type": "string",
  13971. "enum": ["sync"]
  13972. },
  13973. "name": {
  13974. "type": "string",
  13975. "enum": ["session.next.agent.switched.1"]
  13976. },
  13977. "id": {
  13978. "type": "string"
  13979. },
  13980. "seq": {
  13981. "type": "number"
  13982. },
  13983. "aggregateID": {
  13984. "type": "string",
  13985. "enum": ["sessionID"]
  13986. },
  13987. "data": {
  13988. "type": "object",
  13989. "properties": {
  13990. "timestamp": {
  13991. "type": "number"
  13992. },
  13993. "sessionID": {
  13994. "type": "string"
  13995. },
  13996. "agent": {
  13997. "type": "string"
  13998. }
  13999. },
  14000. "required": ["timestamp", "sessionID", "agent"],
  14001. "additionalProperties": false
  14002. }
  14003. },
  14004. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14005. "additionalProperties": false
  14006. },
  14007. "SyncEventSessionNextModelSwitched": {
  14008. "type": "object",
  14009. "properties": {
  14010. "type": {
  14011. "type": "string",
  14012. "enum": ["sync"]
  14013. },
  14014. "name": {
  14015. "type": "string",
  14016. "enum": ["session.next.model.switched.1"]
  14017. },
  14018. "id": {
  14019. "type": "string"
  14020. },
  14021. "seq": {
  14022. "type": "number"
  14023. },
  14024. "aggregateID": {
  14025. "type": "string",
  14026. "enum": ["sessionID"]
  14027. },
  14028. "data": {
  14029. "type": "object",
  14030. "properties": {
  14031. "timestamp": {
  14032. "type": "number"
  14033. },
  14034. "sessionID": {
  14035. "type": "string"
  14036. },
  14037. "model": {
  14038. "type": "object",
  14039. "properties": {
  14040. "id": {
  14041. "type": "string"
  14042. },
  14043. "providerID": {
  14044. "type": "string"
  14045. },
  14046. "variant": {
  14047. "type": "string"
  14048. }
  14049. },
  14050. "required": ["id", "providerID", "variant"],
  14051. "additionalProperties": false
  14052. }
  14053. },
  14054. "required": ["timestamp", "sessionID", "model"],
  14055. "additionalProperties": false
  14056. }
  14057. },
  14058. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14059. "additionalProperties": false
  14060. },
  14061. "SyncEventSessionNextPrompted": {
  14062. "type": "object",
  14063. "properties": {
  14064. "type": {
  14065. "type": "string",
  14066. "enum": ["sync"]
  14067. },
  14068. "name": {
  14069. "type": "string",
  14070. "enum": ["session.next.prompted.1"]
  14071. },
  14072. "id": {
  14073. "type": "string"
  14074. },
  14075. "seq": {
  14076. "type": "number"
  14077. },
  14078. "aggregateID": {
  14079. "type": "string",
  14080. "enum": ["sessionID"]
  14081. },
  14082. "data": {
  14083. "type": "object",
  14084. "properties": {
  14085. "timestamp": {
  14086. "type": "number"
  14087. },
  14088. "sessionID": {
  14089. "type": "string"
  14090. },
  14091. "prompt": {
  14092. "$ref": "#/components/schemas/Prompt"
  14093. }
  14094. },
  14095. "required": ["timestamp", "sessionID", "prompt"],
  14096. "additionalProperties": false
  14097. }
  14098. },
  14099. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14100. "additionalProperties": false
  14101. },
  14102. "SyncEventSessionNextSynthetic": {
  14103. "type": "object",
  14104. "properties": {
  14105. "type": {
  14106. "type": "string",
  14107. "enum": ["sync"]
  14108. },
  14109. "name": {
  14110. "type": "string",
  14111. "enum": ["session.next.synthetic.1"]
  14112. },
  14113. "id": {
  14114. "type": "string"
  14115. },
  14116. "seq": {
  14117. "type": "number"
  14118. },
  14119. "aggregateID": {
  14120. "type": "string",
  14121. "enum": ["sessionID"]
  14122. },
  14123. "data": {
  14124. "type": "object",
  14125. "properties": {
  14126. "timestamp": {
  14127. "type": "number"
  14128. },
  14129. "sessionID": {
  14130. "type": "string"
  14131. },
  14132. "text": {
  14133. "type": "string"
  14134. }
  14135. },
  14136. "required": ["timestamp", "sessionID", "text"],
  14137. "additionalProperties": false
  14138. }
  14139. },
  14140. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14141. "additionalProperties": false
  14142. },
  14143. "SyncEventSessionNextShellStarted": {
  14144. "type": "object",
  14145. "properties": {
  14146. "type": {
  14147. "type": "string",
  14148. "enum": ["sync"]
  14149. },
  14150. "name": {
  14151. "type": "string",
  14152. "enum": ["session.next.shell.started.1"]
  14153. },
  14154. "id": {
  14155. "type": "string"
  14156. },
  14157. "seq": {
  14158. "type": "number"
  14159. },
  14160. "aggregateID": {
  14161. "type": "string",
  14162. "enum": ["sessionID"]
  14163. },
  14164. "data": {
  14165. "type": "object",
  14166. "properties": {
  14167. "timestamp": {
  14168. "type": "number"
  14169. },
  14170. "sessionID": {
  14171. "type": "string"
  14172. },
  14173. "callID": {
  14174. "type": "string"
  14175. },
  14176. "command": {
  14177. "type": "string"
  14178. }
  14179. },
  14180. "required": ["timestamp", "sessionID", "callID", "command"],
  14181. "additionalProperties": false
  14182. }
  14183. },
  14184. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14185. "additionalProperties": false
  14186. },
  14187. "SyncEventSessionNextShellEnded": {
  14188. "type": "object",
  14189. "properties": {
  14190. "type": {
  14191. "type": "string",
  14192. "enum": ["sync"]
  14193. },
  14194. "name": {
  14195. "type": "string",
  14196. "enum": ["session.next.shell.ended.1"]
  14197. },
  14198. "id": {
  14199. "type": "string"
  14200. },
  14201. "seq": {
  14202. "type": "number"
  14203. },
  14204. "aggregateID": {
  14205. "type": "string",
  14206. "enum": ["sessionID"]
  14207. },
  14208. "data": {
  14209. "type": "object",
  14210. "properties": {
  14211. "timestamp": {
  14212. "type": "number"
  14213. },
  14214. "sessionID": {
  14215. "type": "string"
  14216. },
  14217. "callID": {
  14218. "type": "string"
  14219. },
  14220. "output": {
  14221. "type": "string"
  14222. }
  14223. },
  14224. "required": ["timestamp", "sessionID", "callID", "output"],
  14225. "additionalProperties": false
  14226. }
  14227. },
  14228. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14229. "additionalProperties": false
  14230. },
  14231. "SyncEventSessionNextStepStarted": {
  14232. "type": "object",
  14233. "properties": {
  14234. "type": {
  14235. "type": "string",
  14236. "enum": ["sync"]
  14237. },
  14238. "name": {
  14239. "type": "string",
  14240. "enum": ["session.next.step.started.1"]
  14241. },
  14242. "id": {
  14243. "type": "string"
  14244. },
  14245. "seq": {
  14246. "type": "number"
  14247. },
  14248. "aggregateID": {
  14249. "type": "string",
  14250. "enum": ["sessionID"]
  14251. },
  14252. "data": {
  14253. "type": "object",
  14254. "properties": {
  14255. "timestamp": {
  14256. "type": "number"
  14257. },
  14258. "sessionID": {
  14259. "type": "string"
  14260. },
  14261. "agent": {
  14262. "type": "string"
  14263. },
  14264. "model": {
  14265. "type": "object",
  14266. "properties": {
  14267. "id": {
  14268. "type": "string"
  14269. },
  14270. "providerID": {
  14271. "type": "string"
  14272. },
  14273. "variant": {
  14274. "type": "string"
  14275. }
  14276. },
  14277. "required": ["id", "providerID", "variant"],
  14278. "additionalProperties": false
  14279. },
  14280. "snapshot": {
  14281. "type": "string"
  14282. }
  14283. },
  14284. "required": ["timestamp", "sessionID", "agent", "model"],
  14285. "additionalProperties": false
  14286. }
  14287. },
  14288. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14289. "additionalProperties": false
  14290. },
  14291. "SyncEventSessionNextStepEnded": {
  14292. "type": "object",
  14293. "properties": {
  14294. "type": {
  14295. "type": "string",
  14296. "enum": ["sync"]
  14297. },
  14298. "name": {
  14299. "type": "string",
  14300. "enum": ["session.next.step.ended.1"]
  14301. },
  14302. "id": {
  14303. "type": "string"
  14304. },
  14305. "seq": {
  14306. "type": "number"
  14307. },
  14308. "aggregateID": {
  14309. "type": "string",
  14310. "enum": ["sessionID"]
  14311. },
  14312. "data": {
  14313. "type": "object",
  14314. "properties": {
  14315. "timestamp": {
  14316. "type": "number"
  14317. },
  14318. "sessionID": {
  14319. "type": "string"
  14320. },
  14321. "finish": {
  14322. "type": "string"
  14323. },
  14324. "cost": {
  14325. "type": "number"
  14326. },
  14327. "tokens": {
  14328. "type": "object",
  14329. "properties": {
  14330. "input": {
  14331. "type": "integer",
  14332. "minimum": 0
  14333. },
  14334. "output": {
  14335. "type": "integer",
  14336. "minimum": 0
  14337. },
  14338. "reasoning": {
  14339. "type": "integer",
  14340. "minimum": 0
  14341. },
  14342. "cache": {
  14343. "type": "object",
  14344. "properties": {
  14345. "read": {
  14346. "type": "integer",
  14347. "minimum": 0
  14348. },
  14349. "write": {
  14350. "type": "integer",
  14351. "minimum": 0
  14352. }
  14353. },
  14354. "required": ["read", "write"],
  14355. "additionalProperties": false
  14356. }
  14357. },
  14358. "required": ["input", "output", "reasoning", "cache"],
  14359. "additionalProperties": false
  14360. },
  14361. "snapshot": {
  14362. "type": "string"
  14363. }
  14364. },
  14365. "required": ["timestamp", "sessionID", "finish", "cost", "tokens"],
  14366. "additionalProperties": false
  14367. }
  14368. },
  14369. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14370. "additionalProperties": false
  14371. },
  14372. "SyncEventSessionNextStepFailed": {
  14373. "type": "object",
  14374. "properties": {
  14375. "type": {
  14376. "type": "string",
  14377. "enum": ["sync"]
  14378. },
  14379. "name": {
  14380. "type": "string",
  14381. "enum": ["session.next.step.failed.1"]
  14382. },
  14383. "id": {
  14384. "type": "string"
  14385. },
  14386. "seq": {
  14387. "type": "number"
  14388. },
  14389. "aggregateID": {
  14390. "type": "string",
  14391. "enum": ["sessionID"]
  14392. },
  14393. "data": {
  14394. "type": "object",
  14395. "properties": {
  14396. "timestamp": {
  14397. "type": "number"
  14398. },
  14399. "sessionID": {
  14400. "type": "string"
  14401. },
  14402. "error": {
  14403. "$ref": "#/components/schemas/SessionErrorUnknown"
  14404. }
  14405. },
  14406. "required": ["timestamp", "sessionID", "error"],
  14407. "additionalProperties": false
  14408. }
  14409. },
  14410. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14411. "additionalProperties": false
  14412. },
  14413. "SyncEventSessionNextTextStarted": {
  14414. "type": "object",
  14415. "properties": {
  14416. "type": {
  14417. "type": "string",
  14418. "enum": ["sync"]
  14419. },
  14420. "name": {
  14421. "type": "string",
  14422. "enum": ["session.next.text.started.1"]
  14423. },
  14424. "id": {
  14425. "type": "string"
  14426. },
  14427. "seq": {
  14428. "type": "number"
  14429. },
  14430. "aggregateID": {
  14431. "type": "string",
  14432. "enum": ["sessionID"]
  14433. },
  14434. "data": {
  14435. "type": "object",
  14436. "properties": {
  14437. "timestamp": {
  14438. "type": "number"
  14439. },
  14440. "sessionID": {
  14441. "type": "string"
  14442. }
  14443. },
  14444. "required": ["timestamp", "sessionID"],
  14445. "additionalProperties": false
  14446. }
  14447. },
  14448. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14449. "additionalProperties": false
  14450. },
  14451. "SyncEventSessionNextTextDelta": {
  14452. "type": "object",
  14453. "properties": {
  14454. "type": {
  14455. "type": "string",
  14456. "enum": ["sync"]
  14457. },
  14458. "name": {
  14459. "type": "string",
  14460. "enum": ["session.next.text.delta.1"]
  14461. },
  14462. "id": {
  14463. "type": "string"
  14464. },
  14465. "seq": {
  14466. "type": "number"
  14467. },
  14468. "aggregateID": {
  14469. "type": "string",
  14470. "enum": ["sessionID"]
  14471. },
  14472. "data": {
  14473. "type": "object",
  14474. "properties": {
  14475. "timestamp": {
  14476. "type": "number"
  14477. },
  14478. "sessionID": {
  14479. "type": "string"
  14480. },
  14481. "delta": {
  14482. "type": "string"
  14483. }
  14484. },
  14485. "required": ["timestamp", "sessionID", "delta"],
  14486. "additionalProperties": false
  14487. }
  14488. },
  14489. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14490. "additionalProperties": false
  14491. },
  14492. "SyncEventSessionNextTextEnded": {
  14493. "type": "object",
  14494. "properties": {
  14495. "type": {
  14496. "type": "string",
  14497. "enum": ["sync"]
  14498. },
  14499. "name": {
  14500. "type": "string",
  14501. "enum": ["session.next.text.ended.1"]
  14502. },
  14503. "id": {
  14504. "type": "string"
  14505. },
  14506. "seq": {
  14507. "type": "number"
  14508. },
  14509. "aggregateID": {
  14510. "type": "string",
  14511. "enum": ["sessionID"]
  14512. },
  14513. "data": {
  14514. "type": "object",
  14515. "properties": {
  14516. "timestamp": {
  14517. "type": "number"
  14518. },
  14519. "sessionID": {
  14520. "type": "string"
  14521. },
  14522. "text": {
  14523. "type": "string"
  14524. }
  14525. },
  14526. "required": ["timestamp", "sessionID", "text"],
  14527. "additionalProperties": false
  14528. }
  14529. },
  14530. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14531. "additionalProperties": false
  14532. },
  14533. "SyncEventSessionNextReasoningStarted": {
  14534. "type": "object",
  14535. "properties": {
  14536. "type": {
  14537. "type": "string",
  14538. "enum": ["sync"]
  14539. },
  14540. "name": {
  14541. "type": "string",
  14542. "enum": ["session.next.reasoning.started.1"]
  14543. },
  14544. "id": {
  14545. "type": "string"
  14546. },
  14547. "seq": {
  14548. "type": "number"
  14549. },
  14550. "aggregateID": {
  14551. "type": "string",
  14552. "enum": ["sessionID"]
  14553. },
  14554. "data": {
  14555. "type": "object",
  14556. "properties": {
  14557. "timestamp": {
  14558. "type": "number"
  14559. },
  14560. "sessionID": {
  14561. "type": "string"
  14562. },
  14563. "reasoningID": {
  14564. "type": "string"
  14565. }
  14566. },
  14567. "required": ["timestamp", "sessionID", "reasoningID"],
  14568. "additionalProperties": false
  14569. }
  14570. },
  14571. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14572. "additionalProperties": false
  14573. },
  14574. "SyncEventSessionNextReasoningDelta": {
  14575. "type": "object",
  14576. "properties": {
  14577. "type": {
  14578. "type": "string",
  14579. "enum": ["sync"]
  14580. },
  14581. "name": {
  14582. "type": "string",
  14583. "enum": ["session.next.reasoning.delta.1"]
  14584. },
  14585. "id": {
  14586. "type": "string"
  14587. },
  14588. "seq": {
  14589. "type": "number"
  14590. },
  14591. "aggregateID": {
  14592. "type": "string",
  14593. "enum": ["sessionID"]
  14594. },
  14595. "data": {
  14596. "type": "object",
  14597. "properties": {
  14598. "timestamp": {
  14599. "type": "number"
  14600. },
  14601. "sessionID": {
  14602. "type": "string"
  14603. },
  14604. "reasoningID": {
  14605. "type": "string"
  14606. },
  14607. "delta": {
  14608. "type": "string"
  14609. }
  14610. },
  14611. "required": ["timestamp", "sessionID", "reasoningID", "delta"],
  14612. "additionalProperties": false
  14613. }
  14614. },
  14615. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14616. "additionalProperties": false
  14617. },
  14618. "SyncEventSessionNextReasoningEnded": {
  14619. "type": "object",
  14620. "properties": {
  14621. "type": {
  14622. "type": "string",
  14623. "enum": ["sync"]
  14624. },
  14625. "name": {
  14626. "type": "string",
  14627. "enum": ["session.next.reasoning.ended.1"]
  14628. },
  14629. "id": {
  14630. "type": "string"
  14631. },
  14632. "seq": {
  14633. "type": "number"
  14634. },
  14635. "aggregateID": {
  14636. "type": "string",
  14637. "enum": ["sessionID"]
  14638. },
  14639. "data": {
  14640. "type": "object",
  14641. "properties": {
  14642. "timestamp": {
  14643. "type": "number"
  14644. },
  14645. "sessionID": {
  14646. "type": "string"
  14647. },
  14648. "reasoningID": {
  14649. "type": "string"
  14650. },
  14651. "text": {
  14652. "type": "string"
  14653. }
  14654. },
  14655. "required": ["timestamp", "sessionID", "reasoningID", "text"],
  14656. "additionalProperties": false
  14657. }
  14658. },
  14659. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14660. "additionalProperties": false
  14661. },
  14662. "SyncEventSessionNextToolInputStarted": {
  14663. "type": "object",
  14664. "properties": {
  14665. "type": {
  14666. "type": "string",
  14667. "enum": ["sync"]
  14668. },
  14669. "name": {
  14670. "type": "string",
  14671. "enum": ["session.next.tool.input.started.1"]
  14672. },
  14673. "id": {
  14674. "type": "string"
  14675. },
  14676. "seq": {
  14677. "type": "number"
  14678. },
  14679. "aggregateID": {
  14680. "type": "string",
  14681. "enum": ["sessionID"]
  14682. },
  14683. "data": {
  14684. "type": "object",
  14685. "properties": {
  14686. "timestamp": {
  14687. "type": "number"
  14688. },
  14689. "sessionID": {
  14690. "type": "string"
  14691. },
  14692. "callID": {
  14693. "type": "string"
  14694. },
  14695. "name": {
  14696. "type": "string"
  14697. }
  14698. },
  14699. "required": ["timestamp", "sessionID", "callID", "name"],
  14700. "additionalProperties": false
  14701. }
  14702. },
  14703. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14704. "additionalProperties": false
  14705. },
  14706. "SyncEventSessionNextToolInputDelta": {
  14707. "type": "object",
  14708. "properties": {
  14709. "type": {
  14710. "type": "string",
  14711. "enum": ["sync"]
  14712. },
  14713. "name": {
  14714. "type": "string",
  14715. "enum": ["session.next.tool.input.delta.1"]
  14716. },
  14717. "id": {
  14718. "type": "string"
  14719. },
  14720. "seq": {
  14721. "type": "number"
  14722. },
  14723. "aggregateID": {
  14724. "type": "string",
  14725. "enum": ["sessionID"]
  14726. },
  14727. "data": {
  14728. "type": "object",
  14729. "properties": {
  14730. "timestamp": {
  14731. "type": "number"
  14732. },
  14733. "sessionID": {
  14734. "type": "string"
  14735. },
  14736. "callID": {
  14737. "type": "string"
  14738. },
  14739. "delta": {
  14740. "type": "string"
  14741. }
  14742. },
  14743. "required": ["timestamp", "sessionID", "callID", "delta"],
  14744. "additionalProperties": false
  14745. }
  14746. },
  14747. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14748. "additionalProperties": false
  14749. },
  14750. "SyncEventSessionNextToolInputEnded": {
  14751. "type": "object",
  14752. "properties": {
  14753. "type": {
  14754. "type": "string",
  14755. "enum": ["sync"]
  14756. },
  14757. "name": {
  14758. "type": "string",
  14759. "enum": ["session.next.tool.input.ended.1"]
  14760. },
  14761. "id": {
  14762. "type": "string"
  14763. },
  14764. "seq": {
  14765. "type": "number"
  14766. },
  14767. "aggregateID": {
  14768. "type": "string",
  14769. "enum": ["sessionID"]
  14770. },
  14771. "data": {
  14772. "type": "object",
  14773. "properties": {
  14774. "timestamp": {
  14775. "type": "number"
  14776. },
  14777. "sessionID": {
  14778. "type": "string"
  14779. },
  14780. "callID": {
  14781. "type": "string"
  14782. },
  14783. "text": {
  14784. "type": "string"
  14785. }
  14786. },
  14787. "required": ["timestamp", "sessionID", "callID", "text"],
  14788. "additionalProperties": false
  14789. }
  14790. },
  14791. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14792. "additionalProperties": false
  14793. },
  14794. "SyncEventSessionNextToolCalled": {
  14795. "type": "object",
  14796. "properties": {
  14797. "type": {
  14798. "type": "string",
  14799. "enum": ["sync"]
  14800. },
  14801. "name": {
  14802. "type": "string",
  14803. "enum": ["session.next.tool.called.1"]
  14804. },
  14805. "id": {
  14806. "type": "string"
  14807. },
  14808. "seq": {
  14809. "type": "number"
  14810. },
  14811. "aggregateID": {
  14812. "type": "string",
  14813. "enum": ["sessionID"]
  14814. },
  14815. "data": {
  14816. "type": "object",
  14817. "properties": {
  14818. "timestamp": {
  14819. "type": "number"
  14820. },
  14821. "sessionID": {
  14822. "type": "string"
  14823. },
  14824. "callID": {
  14825. "type": "string"
  14826. },
  14827. "tool": {
  14828. "type": "string"
  14829. },
  14830. "input": {
  14831. "type": "object"
  14832. },
  14833. "provider": {
  14834. "type": "object",
  14835. "properties": {
  14836. "executed": {
  14837. "type": "boolean"
  14838. },
  14839. "metadata": {
  14840. "type": "object"
  14841. }
  14842. },
  14843. "required": ["executed"],
  14844. "additionalProperties": false
  14845. }
  14846. },
  14847. "required": ["timestamp", "sessionID", "callID", "tool", "input", "provider"],
  14848. "additionalProperties": false
  14849. }
  14850. },
  14851. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14852. "additionalProperties": false
  14853. },
  14854. "SyncEventSessionNextToolProgress": {
  14855. "type": "object",
  14856. "properties": {
  14857. "type": {
  14858. "type": "string",
  14859. "enum": ["sync"]
  14860. },
  14861. "name": {
  14862. "type": "string",
  14863. "enum": ["session.next.tool.progress.1"]
  14864. },
  14865. "id": {
  14866. "type": "string"
  14867. },
  14868. "seq": {
  14869. "type": "number"
  14870. },
  14871. "aggregateID": {
  14872. "type": "string",
  14873. "enum": ["sessionID"]
  14874. },
  14875. "data": {
  14876. "type": "object",
  14877. "properties": {
  14878. "timestamp": {
  14879. "type": "number"
  14880. },
  14881. "sessionID": {
  14882. "type": "string"
  14883. },
  14884. "callID": {
  14885. "type": "string"
  14886. },
  14887. "structured": {
  14888. "type": "object"
  14889. },
  14890. "content": {
  14891. "type": "array",
  14892. "items": {
  14893. "anyOf": [
  14894. {
  14895. "$ref": "#/components/schemas/ToolTextContent"
  14896. },
  14897. {
  14898. "$ref": "#/components/schemas/ToolFileContent"
  14899. }
  14900. ]
  14901. }
  14902. }
  14903. },
  14904. "required": ["timestamp", "sessionID", "callID", "structured", "content"],
  14905. "additionalProperties": false
  14906. }
  14907. },
  14908. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14909. "additionalProperties": false
  14910. },
  14911. "SyncEventSessionNextToolSuccess": {
  14912. "type": "object",
  14913. "properties": {
  14914. "type": {
  14915. "type": "string",
  14916. "enum": ["sync"]
  14917. },
  14918. "name": {
  14919. "type": "string",
  14920. "enum": ["session.next.tool.success.1"]
  14921. },
  14922. "id": {
  14923. "type": "string"
  14924. },
  14925. "seq": {
  14926. "type": "number"
  14927. },
  14928. "aggregateID": {
  14929. "type": "string",
  14930. "enum": ["sessionID"]
  14931. },
  14932. "data": {
  14933. "type": "object",
  14934. "properties": {
  14935. "timestamp": {
  14936. "type": "number"
  14937. },
  14938. "sessionID": {
  14939. "type": "string"
  14940. },
  14941. "callID": {
  14942. "type": "string"
  14943. },
  14944. "structured": {
  14945. "type": "object"
  14946. },
  14947. "content": {
  14948. "type": "array",
  14949. "items": {
  14950. "anyOf": [
  14951. {
  14952. "$ref": "#/components/schemas/ToolTextContent"
  14953. },
  14954. {
  14955. "$ref": "#/components/schemas/ToolFileContent"
  14956. }
  14957. ]
  14958. }
  14959. },
  14960. "provider": {
  14961. "type": "object",
  14962. "properties": {
  14963. "executed": {
  14964. "type": "boolean"
  14965. },
  14966. "metadata": {
  14967. "type": "object"
  14968. }
  14969. },
  14970. "required": ["executed"],
  14971. "additionalProperties": false
  14972. }
  14973. },
  14974. "required": ["timestamp", "sessionID", "callID", "structured", "content", "provider"],
  14975. "additionalProperties": false
  14976. }
  14977. },
  14978. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14979. "additionalProperties": false
  14980. },
  14981. "SyncEventSessionNextToolFailed": {
  14982. "type": "object",
  14983. "properties": {
  14984. "type": {
  14985. "type": "string",
  14986. "enum": ["sync"]
  14987. },
  14988. "name": {
  14989. "type": "string",
  14990. "enum": ["session.next.tool.failed.1"]
  14991. },
  14992. "id": {
  14993. "type": "string"
  14994. },
  14995. "seq": {
  14996. "type": "number"
  14997. },
  14998. "aggregateID": {
  14999. "type": "string",
  15000. "enum": ["sessionID"]
  15001. },
  15002. "data": {
  15003. "type": "object",
  15004. "properties": {
  15005. "timestamp": {
  15006. "type": "number"
  15007. },
  15008. "sessionID": {
  15009. "type": "string"
  15010. },
  15011. "callID": {
  15012. "type": "string"
  15013. },
  15014. "error": {
  15015. "$ref": "#/components/schemas/SessionErrorUnknown"
  15016. },
  15017. "provider": {
  15018. "type": "object",
  15019. "properties": {
  15020. "executed": {
  15021. "type": "boolean"
  15022. },
  15023. "metadata": {
  15024. "type": "object"
  15025. }
  15026. },
  15027. "required": ["executed"],
  15028. "additionalProperties": false
  15029. }
  15030. },
  15031. "required": ["timestamp", "sessionID", "callID", "error", "provider"],
  15032. "additionalProperties": false
  15033. }
  15034. },
  15035. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15036. "additionalProperties": false
  15037. },
  15038. "SyncEventSessionNextRetried": {
  15039. "type": "object",
  15040. "properties": {
  15041. "type": {
  15042. "type": "string",
  15043. "enum": ["sync"]
  15044. },
  15045. "name": {
  15046. "type": "string",
  15047. "enum": ["session.next.retried.1"]
  15048. },
  15049. "id": {
  15050. "type": "string"
  15051. },
  15052. "seq": {
  15053. "type": "number"
  15054. },
  15055. "aggregateID": {
  15056. "type": "string",
  15057. "enum": ["sessionID"]
  15058. },
  15059. "data": {
  15060. "type": "object",
  15061. "properties": {
  15062. "timestamp": {
  15063. "type": "number"
  15064. },
  15065. "sessionID": {
  15066. "type": "string"
  15067. },
  15068. "attempt": {
  15069. "type": "integer",
  15070. "minimum": 0
  15071. },
  15072. "error": {
  15073. "$ref": "#/components/schemas/SessionNextRetry_error"
  15074. }
  15075. },
  15076. "required": ["timestamp", "sessionID", "attempt", "error"],
  15077. "additionalProperties": false
  15078. }
  15079. },
  15080. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15081. "additionalProperties": false
  15082. },
  15083. "SyncEventSessionNextCompactionStarted": {
  15084. "type": "object",
  15085. "properties": {
  15086. "type": {
  15087. "type": "string",
  15088. "enum": ["sync"]
  15089. },
  15090. "name": {
  15091. "type": "string",
  15092. "enum": ["session.next.compaction.started.1"]
  15093. },
  15094. "id": {
  15095. "type": "string"
  15096. },
  15097. "seq": {
  15098. "type": "number"
  15099. },
  15100. "aggregateID": {
  15101. "type": "string",
  15102. "enum": ["sessionID"]
  15103. },
  15104. "data": {
  15105. "type": "object",
  15106. "properties": {
  15107. "timestamp": {
  15108. "type": "number"
  15109. },
  15110. "sessionID": {
  15111. "type": "string"
  15112. },
  15113. "reason": {
  15114. "type": "string",
  15115. "enum": ["auto", "manual"]
  15116. }
  15117. },
  15118. "required": ["timestamp", "sessionID", "reason"],
  15119. "additionalProperties": false
  15120. }
  15121. },
  15122. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15123. "additionalProperties": false
  15124. },
  15125. "SyncEventSessionNextCompactionDelta": {
  15126. "type": "object",
  15127. "properties": {
  15128. "type": {
  15129. "type": "string",
  15130. "enum": ["sync"]
  15131. },
  15132. "name": {
  15133. "type": "string",
  15134. "enum": ["session.next.compaction.delta.1"]
  15135. },
  15136. "id": {
  15137. "type": "string"
  15138. },
  15139. "seq": {
  15140. "type": "number"
  15141. },
  15142. "aggregateID": {
  15143. "type": "string",
  15144. "enum": ["sessionID"]
  15145. },
  15146. "data": {
  15147. "type": "object",
  15148. "properties": {
  15149. "timestamp": {
  15150. "type": "number"
  15151. },
  15152. "sessionID": {
  15153. "type": "string"
  15154. },
  15155. "text": {
  15156. "type": "string"
  15157. }
  15158. },
  15159. "required": ["timestamp", "sessionID", "text"],
  15160. "additionalProperties": false
  15161. }
  15162. },
  15163. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15164. "additionalProperties": false
  15165. },
  15166. "SyncEventSessionNextCompactionEnded": {
  15167. "type": "object",
  15168. "properties": {
  15169. "type": {
  15170. "type": "string",
  15171. "enum": ["sync"]
  15172. },
  15173. "name": {
  15174. "type": "string",
  15175. "enum": ["session.next.compaction.ended.1"]
  15176. },
  15177. "id": {
  15178. "type": "string"
  15179. },
  15180. "seq": {
  15181. "type": "number"
  15182. },
  15183. "aggregateID": {
  15184. "type": "string",
  15185. "enum": ["sessionID"]
  15186. },
  15187. "data": {
  15188. "type": "object",
  15189. "properties": {
  15190. "timestamp": {
  15191. "type": "number"
  15192. },
  15193. "sessionID": {
  15194. "type": "string"
  15195. },
  15196. "text": {
  15197. "type": "string"
  15198. },
  15199. "include": {
  15200. "type": "string"
  15201. }
  15202. },
  15203. "required": ["timestamp", "sessionID", "text"],
  15204. "additionalProperties": false
  15205. }
  15206. },
  15207. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15208. "additionalProperties": false
  15209. },
  15210. "EventServerInstanceDisposed": {
  15211. "type": "object",
  15212. "properties": {
  15213. "id": {
  15214. "type": "string"
  15215. },
  15216. "type": {
  15217. "type": "string",
  15218. "enum": ["server.instance.disposed"]
  15219. },
  15220. "properties": {
  15221. "type": "object",
  15222. "properties": {
  15223. "directory": {
  15224. "type": "string"
  15225. }
  15226. },
  15227. "required": ["directory"],
  15228. "additionalProperties": false
  15229. }
  15230. },
  15231. "required": ["id", "type", "properties"],
  15232. "additionalProperties": false
  15233. },
  15234. "EventFileEdited": {
  15235. "type": "object",
  15236. "properties": {
  15237. "id": {
  15238. "type": "string"
  15239. },
  15240. "type": {
  15241. "type": "string",
  15242. "enum": ["file.edited"]
  15243. },
  15244. "properties": {
  15245. "type": "object",
  15246. "properties": {
  15247. "file": {
  15248. "type": "string"
  15249. }
  15250. },
  15251. "required": ["file"],
  15252. "additionalProperties": false
  15253. }
  15254. },
  15255. "required": ["id", "type", "properties"],
  15256. "additionalProperties": false
  15257. },
  15258. "EventFileWatcherUpdated": {
  15259. "type": "object",
  15260. "properties": {
  15261. "id": {
  15262. "type": "string"
  15263. },
  15264. "type": {
  15265. "type": "string",
  15266. "enum": ["file.watcher.updated"]
  15267. },
  15268. "properties": {
  15269. "type": "object",
  15270. "properties": {
  15271. "file": {
  15272. "type": "string"
  15273. },
  15274. "event": {
  15275. "type": "string",
  15276. "enum": ["add", "change", "unlink"]
  15277. }
  15278. },
  15279. "required": ["file", "event"],
  15280. "additionalProperties": false
  15281. }
  15282. },
  15283. "required": ["id", "type", "properties"],
  15284. "additionalProperties": false
  15285. },
  15286. "EventLspClientDiagnostics": {
  15287. "type": "object",
  15288. "properties": {
  15289. "id": {
  15290. "type": "string"
  15291. },
  15292. "type": {
  15293. "type": "string",
  15294. "enum": ["lsp.client.diagnostics"]
  15295. },
  15296. "properties": {
  15297. "type": "object",
  15298. "properties": {
  15299. "serverID": {
  15300. "type": "string"
  15301. },
  15302. "path": {
  15303. "type": "string"
  15304. }
  15305. },
  15306. "required": ["serverID", "path"],
  15307. "additionalProperties": false
  15308. }
  15309. },
  15310. "required": ["id", "type", "properties"],
  15311. "additionalProperties": false
  15312. },
  15313. "EventLspUpdated": {
  15314. "type": "object",
  15315. "properties": {
  15316. "id": {
  15317. "type": "string"
  15318. },
  15319. "type": {
  15320. "type": "string",
  15321. "enum": ["lsp.updated"]
  15322. },
  15323. "properties": {
  15324. "type": "object",
  15325. "properties": {}
  15326. }
  15327. },
  15328. "required": ["id", "type", "properties"],
  15329. "additionalProperties": false
  15330. },
  15331. "EventMessagePartDelta": {
  15332. "type": "object",
  15333. "properties": {
  15334. "id": {
  15335. "type": "string"
  15336. },
  15337. "type": {
  15338. "type": "string",
  15339. "enum": ["message.part.delta"]
  15340. },
  15341. "properties": {
  15342. "type": "object",
  15343. "properties": {
  15344. "sessionID": {
  15345. "type": "string"
  15346. },
  15347. "messageID": {
  15348. "type": "string"
  15349. },
  15350. "partID": {
  15351. "type": "string"
  15352. },
  15353. "field": {
  15354. "type": "string"
  15355. },
  15356. "delta": {
  15357. "type": "string"
  15358. }
  15359. },
  15360. "required": ["sessionID", "messageID", "partID", "field", "delta"],
  15361. "additionalProperties": false
  15362. }
  15363. },
  15364. "required": ["id", "type", "properties"],
  15365. "additionalProperties": false
  15366. },
  15367. "EventPermissionAsked": {
  15368. "type": "object",
  15369. "properties": {
  15370. "id": {
  15371. "type": "string"
  15372. },
  15373. "type": {
  15374. "type": "string",
  15375. "enum": ["permission.asked"]
  15376. },
  15377. "properties": {
  15378. "$ref": "#/components/schemas/PermissionRequest"
  15379. }
  15380. },
  15381. "required": ["id", "type", "properties"],
  15382. "additionalProperties": false
  15383. },
  15384. "EventPermissionReplied": {
  15385. "type": "object",
  15386. "properties": {
  15387. "id": {
  15388. "type": "string"
  15389. },
  15390. "type": {
  15391. "type": "string",
  15392. "enum": ["permission.replied"]
  15393. },
  15394. "properties": {
  15395. "type": "object",
  15396. "properties": {
  15397. "sessionID": {
  15398. "type": "string"
  15399. },
  15400. "requestID": {
  15401. "type": "string"
  15402. },
  15403. "reply": {
  15404. "type": "string",
  15405. "enum": ["once", "always", "reject"]
  15406. }
  15407. },
  15408. "required": ["sessionID", "requestID", "reply"],
  15409. "additionalProperties": false
  15410. }
  15411. },
  15412. "required": ["id", "type", "properties"],
  15413. "additionalProperties": false
  15414. },
  15415. "EventSessionDiff": {
  15416. "type": "object",
  15417. "properties": {
  15418. "id": {
  15419. "type": "string"
  15420. },
  15421. "type": {
  15422. "type": "string",
  15423. "enum": ["session.diff"]
  15424. },
  15425. "properties": {
  15426. "type": "object",
  15427. "properties": {
  15428. "sessionID": {
  15429. "type": "string"
  15430. },
  15431. "diff": {
  15432. "type": "array",
  15433. "items": {
  15434. "$ref": "#/components/schemas/SnapshotFileDiff"
  15435. }
  15436. }
  15437. },
  15438. "required": ["sessionID", "diff"],
  15439. "additionalProperties": false
  15440. }
  15441. },
  15442. "required": ["id", "type", "properties"],
  15443. "additionalProperties": false
  15444. },
  15445. "EventSessionError": {
  15446. "type": "object",
  15447. "properties": {
  15448. "id": {
  15449. "type": "string"
  15450. },
  15451. "type": {
  15452. "type": "string",
  15453. "enum": ["session.error"]
  15454. },
  15455. "properties": {
  15456. "type": "object",
  15457. "properties": {
  15458. "sessionID": {
  15459. "type": "string"
  15460. },
  15461. "error": {
  15462. "anyOf": [
  15463. {
  15464. "$ref": "#/components/schemas/ProviderAuthError"
  15465. },
  15466. {
  15467. "$ref": "#/components/schemas/UnknownError"
  15468. },
  15469. {
  15470. "$ref": "#/components/schemas/MessageOutputLengthError"
  15471. },
  15472. {
  15473. "$ref": "#/components/schemas/MessageAbortedError"
  15474. },
  15475. {
  15476. "$ref": "#/components/schemas/StructuredOutputError"
  15477. },
  15478. {
  15479. "$ref": "#/components/schemas/ContextOverflowError"
  15480. },
  15481. {
  15482. "$ref": "#/components/schemas/APIError"
  15483. }
  15484. ]
  15485. }
  15486. },
  15487. "additionalProperties": false
  15488. }
  15489. },
  15490. "required": ["id", "type", "properties"],
  15491. "additionalProperties": false
  15492. },
  15493. "EventInstallationUpdated": {
  15494. "type": "object",
  15495. "properties": {
  15496. "id": {
  15497. "type": "string"
  15498. },
  15499. "type": {
  15500. "type": "string",
  15501. "enum": ["installation.updated"]
  15502. },
  15503. "properties": {
  15504. "type": "object",
  15505. "properties": {
  15506. "version": {
  15507. "type": "string"
  15508. }
  15509. },
  15510. "required": ["version"],
  15511. "additionalProperties": false
  15512. }
  15513. },
  15514. "required": ["id", "type", "properties"],
  15515. "additionalProperties": false
  15516. },
  15517. "EventInstallationUpdate-available": {
  15518. "type": "object",
  15519. "properties": {
  15520. "id": {
  15521. "type": "string"
  15522. },
  15523. "type": {
  15524. "type": "string",
  15525. "enum": ["installation.update-available"]
  15526. },
  15527. "properties": {
  15528. "type": "object",
  15529. "properties": {
  15530. "version": {
  15531. "type": "string"
  15532. }
  15533. },
  15534. "required": ["version"],
  15535. "additionalProperties": false
  15536. }
  15537. },
  15538. "required": ["id", "type", "properties"],
  15539. "additionalProperties": false
  15540. },
  15541. "EventQuestionAsked": {
  15542. "type": "object",
  15543. "properties": {
  15544. "id": {
  15545. "type": "string"
  15546. },
  15547. "type": {
  15548. "type": "string",
  15549. "enum": ["question.asked"]
  15550. },
  15551. "properties": {
  15552. "$ref": "#/components/schemas/QuestionRequest"
  15553. }
  15554. },
  15555. "required": ["id", "type", "properties"],
  15556. "additionalProperties": false
  15557. },
  15558. "EventQuestionReplied": {
  15559. "type": "object",
  15560. "properties": {
  15561. "id": {
  15562. "type": "string"
  15563. },
  15564. "type": {
  15565. "type": "string",
  15566. "enum": ["question.replied"]
  15567. },
  15568. "properties": {
  15569. "$ref": "#/components/schemas/QuestionReplied"
  15570. }
  15571. },
  15572. "required": ["id", "type", "properties"],
  15573. "additionalProperties": false
  15574. },
  15575. "EventQuestionRejected": {
  15576. "type": "object",
  15577. "properties": {
  15578. "id": {
  15579. "type": "string"
  15580. },
  15581. "type": {
  15582. "type": "string",
  15583. "enum": ["question.rejected"]
  15584. },
  15585. "properties": {
  15586. "$ref": "#/components/schemas/QuestionRejected"
  15587. }
  15588. },
  15589. "required": ["id", "type", "properties"],
  15590. "additionalProperties": false
  15591. },
  15592. "EventTodoUpdated": {
  15593. "type": "object",
  15594. "properties": {
  15595. "id": {
  15596. "type": "string"
  15597. },
  15598. "type": {
  15599. "type": "string",
  15600. "enum": ["todo.updated"]
  15601. },
  15602. "properties": {
  15603. "type": "object",
  15604. "properties": {
  15605. "sessionID": {
  15606. "type": "string"
  15607. },
  15608. "todos": {
  15609. "type": "array",
  15610. "items": {
  15611. "$ref": "#/components/schemas/Todo"
  15612. }
  15613. }
  15614. },
  15615. "required": ["sessionID", "todos"],
  15616. "additionalProperties": false
  15617. }
  15618. },
  15619. "required": ["id", "type", "properties"],
  15620. "additionalProperties": false
  15621. },
  15622. "EventSessionStatus": {
  15623. "type": "object",
  15624. "properties": {
  15625. "id": {
  15626. "type": "string"
  15627. },
  15628. "type": {
  15629. "type": "string",
  15630. "enum": ["session.status"]
  15631. },
  15632. "properties": {
  15633. "type": "object",
  15634. "properties": {
  15635. "sessionID": {
  15636. "type": "string"
  15637. },
  15638. "status": {
  15639. "$ref": "#/components/schemas/SessionStatus"
  15640. }
  15641. },
  15642. "required": ["sessionID", "status"],
  15643. "additionalProperties": false
  15644. }
  15645. },
  15646. "required": ["id", "type", "properties"],
  15647. "additionalProperties": false
  15648. },
  15649. "EventSessionIdle": {
  15650. "type": "object",
  15651. "properties": {
  15652. "id": {
  15653. "type": "string"
  15654. },
  15655. "type": {
  15656. "type": "string",
  15657. "enum": ["session.idle"]
  15658. },
  15659. "properties": {
  15660. "type": "object",
  15661. "properties": {
  15662. "sessionID": {
  15663. "type": "string"
  15664. }
  15665. },
  15666. "required": ["sessionID"],
  15667. "additionalProperties": false
  15668. }
  15669. },
  15670. "required": ["id", "type", "properties"],
  15671. "additionalProperties": false
  15672. },
  15673. "EventSessionCompacted": {
  15674. "type": "object",
  15675. "properties": {
  15676. "id": {
  15677. "type": "string"
  15678. },
  15679. "type": {
  15680. "type": "string",
  15681. "enum": ["session.compacted"]
  15682. },
  15683. "properties": {
  15684. "type": "object",
  15685. "properties": {
  15686. "sessionID": {
  15687. "type": "string"
  15688. }
  15689. },
  15690. "required": ["sessionID"],
  15691. "additionalProperties": false
  15692. }
  15693. },
  15694. "required": ["id", "type", "properties"],
  15695. "additionalProperties": false
  15696. },
  15697. "EventMcpToolsChanged": {
  15698. "type": "object",
  15699. "properties": {
  15700. "id": {
  15701. "type": "string"
  15702. },
  15703. "type": {
  15704. "type": "string",
  15705. "enum": ["mcp.tools.changed"]
  15706. },
  15707. "properties": {
  15708. "type": "object",
  15709. "properties": {
  15710. "server": {
  15711. "type": "string"
  15712. }
  15713. },
  15714. "required": ["server"],
  15715. "additionalProperties": false
  15716. }
  15717. },
  15718. "required": ["id", "type", "properties"],
  15719. "additionalProperties": false
  15720. },
  15721. "EventMcpBrowserOpenFailed": {
  15722. "type": "object",
  15723. "properties": {
  15724. "id": {
  15725. "type": "string"
  15726. },
  15727. "type": {
  15728. "type": "string",
  15729. "enum": ["mcp.browser.open.failed"]
  15730. },
  15731. "properties": {
  15732. "type": "object",
  15733. "properties": {
  15734. "mcpName": {
  15735. "type": "string"
  15736. },
  15737. "url": {
  15738. "type": "string"
  15739. }
  15740. },
  15741. "required": ["mcpName", "url"],
  15742. "additionalProperties": false
  15743. }
  15744. },
  15745. "required": ["id", "type", "properties"],
  15746. "additionalProperties": false
  15747. },
  15748. "EventCommandExecuted": {
  15749. "type": "object",
  15750. "properties": {
  15751. "id": {
  15752. "type": "string"
  15753. },
  15754. "type": {
  15755. "type": "string",
  15756. "enum": ["command.executed"]
  15757. },
  15758. "properties": {
  15759. "type": "object",
  15760. "properties": {
  15761. "name": {
  15762. "type": "string"
  15763. },
  15764. "sessionID": {
  15765. "type": "string"
  15766. },
  15767. "arguments": {
  15768. "type": "string"
  15769. },
  15770. "messageID": {
  15771. "type": "string"
  15772. }
  15773. },
  15774. "required": ["name", "sessionID", "arguments", "messageID"],
  15775. "additionalProperties": false
  15776. }
  15777. },
  15778. "required": ["id", "type", "properties"],
  15779. "additionalProperties": false
  15780. },
  15781. "EventProjectUpdated": {
  15782. "type": "object",
  15783. "properties": {
  15784. "id": {
  15785. "type": "string"
  15786. },
  15787. "type": {
  15788. "type": "string",
  15789. "enum": ["project.updated"]
  15790. },
  15791. "properties": {
  15792. "$ref": "#/components/schemas/Project"
  15793. }
  15794. },
  15795. "required": ["id", "type", "properties"],
  15796. "additionalProperties": false
  15797. },
  15798. "EventVcsBranchUpdated": {
  15799. "type": "object",
  15800. "properties": {
  15801. "id": {
  15802. "type": "string"
  15803. },
  15804. "type": {
  15805. "type": "string",
  15806. "enum": ["vcs.branch.updated"]
  15807. },
  15808. "properties": {
  15809. "type": "object",
  15810. "properties": {
  15811. "branch": {
  15812. "type": "string"
  15813. }
  15814. },
  15815. "additionalProperties": false
  15816. }
  15817. },
  15818. "required": ["id", "type", "properties"],
  15819. "additionalProperties": false
  15820. },
  15821. "EventWorkspaceReady": {
  15822. "type": "object",
  15823. "properties": {
  15824. "id": {
  15825. "type": "string"
  15826. },
  15827. "type": {
  15828. "type": "string",
  15829. "enum": ["workspace.ready"]
  15830. },
  15831. "properties": {
  15832. "type": "object",
  15833. "properties": {
  15834. "name": {
  15835. "type": "string"
  15836. }
  15837. },
  15838. "required": ["name"],
  15839. "additionalProperties": false
  15840. }
  15841. },
  15842. "required": ["id", "type", "properties"],
  15843. "additionalProperties": false
  15844. },
  15845. "EventWorkspaceFailed": {
  15846. "type": "object",
  15847. "properties": {
  15848. "id": {
  15849. "type": "string"
  15850. },
  15851. "type": {
  15852. "type": "string",
  15853. "enum": ["workspace.failed"]
  15854. },
  15855. "properties": {
  15856. "type": "object",
  15857. "properties": {
  15858. "message": {
  15859. "type": "string"
  15860. }
  15861. },
  15862. "required": ["message"],
  15863. "additionalProperties": false
  15864. }
  15865. },
  15866. "required": ["id", "type", "properties"],
  15867. "additionalProperties": false
  15868. },
  15869. "EventWorkspaceStatus": {
  15870. "type": "object",
  15871. "properties": {
  15872. "id": {
  15873. "type": "string"
  15874. },
  15875. "type": {
  15876. "type": "string",
  15877. "enum": ["workspace.status"]
  15878. },
  15879. "properties": {
  15880. "type": "object",
  15881. "properties": {
  15882. "workspaceID": {
  15883. "type": "string"
  15884. },
  15885. "status": {
  15886. "type": "string",
  15887. "enum": ["connected", "connecting", "disconnected", "error"]
  15888. }
  15889. },
  15890. "required": ["workspaceID", "status"],
  15891. "additionalProperties": false
  15892. }
  15893. },
  15894. "required": ["id", "type", "properties"],
  15895. "additionalProperties": false
  15896. },
  15897. "EventWorktreeReady": {
  15898. "type": "object",
  15899. "properties": {
  15900. "id": {
  15901. "type": "string"
  15902. },
  15903. "type": {
  15904. "type": "string",
  15905. "enum": ["worktree.ready"]
  15906. },
  15907. "properties": {
  15908. "type": "object",
  15909. "properties": {
  15910. "name": {
  15911. "type": "string"
  15912. },
  15913. "branch": {
  15914. "type": "string"
  15915. }
  15916. },
  15917. "required": ["name", "branch"],
  15918. "additionalProperties": false
  15919. }
  15920. },
  15921. "required": ["id", "type", "properties"],
  15922. "additionalProperties": false
  15923. },
  15924. "EventWorktreeFailed": {
  15925. "type": "object",
  15926. "properties": {
  15927. "id": {
  15928. "type": "string"
  15929. },
  15930. "type": {
  15931. "type": "string",
  15932. "enum": ["worktree.failed"]
  15933. },
  15934. "properties": {
  15935. "type": "object",
  15936. "properties": {
  15937. "message": {
  15938. "type": "string"
  15939. }
  15940. },
  15941. "required": ["message"],
  15942. "additionalProperties": false
  15943. }
  15944. },
  15945. "required": ["id", "type", "properties"],
  15946. "additionalProperties": false
  15947. },
  15948. "EventPtyCreated": {
  15949. "type": "object",
  15950. "properties": {
  15951. "id": {
  15952. "type": "string"
  15953. },
  15954. "type": {
  15955. "type": "string",
  15956. "enum": ["pty.created"]
  15957. },
  15958. "properties": {
  15959. "type": "object",
  15960. "properties": {
  15961. "info": {
  15962. "$ref": "#/components/schemas/Pty"
  15963. }
  15964. },
  15965. "required": ["info"],
  15966. "additionalProperties": false
  15967. }
  15968. },
  15969. "required": ["id", "type", "properties"],
  15970. "additionalProperties": false
  15971. },
  15972. "EventPtyUpdated": {
  15973. "type": "object",
  15974. "properties": {
  15975. "id": {
  15976. "type": "string"
  15977. },
  15978. "type": {
  15979. "type": "string",
  15980. "enum": ["pty.updated"]
  15981. },
  15982. "properties": {
  15983. "type": "object",
  15984. "properties": {
  15985. "info": {
  15986. "$ref": "#/components/schemas/Pty"
  15987. }
  15988. },
  15989. "required": ["info"],
  15990. "additionalProperties": false
  15991. }
  15992. },
  15993. "required": ["id", "type", "properties"],
  15994. "additionalProperties": false
  15995. },
  15996. "EventPtyExited": {
  15997. "type": "object",
  15998. "properties": {
  15999. "id": {
  16000. "type": "string"
  16001. },
  16002. "type": {
  16003. "type": "string",
  16004. "enum": ["pty.exited"]
  16005. },
  16006. "properties": {
  16007. "type": "object",
  16008. "properties": {
  16009. "id": {
  16010. "type": "string"
  16011. },
  16012. "exitCode": {
  16013. "type": "integer",
  16014. "minimum": 0
  16015. }
  16016. },
  16017. "required": ["id", "exitCode"],
  16018. "additionalProperties": false
  16019. }
  16020. },
  16021. "required": ["id", "type", "properties"],
  16022. "additionalProperties": false
  16023. },
  16024. "EventPtyDeleted": {
  16025. "type": "object",
  16026. "properties": {
  16027. "id": {
  16028. "type": "string"
  16029. },
  16030. "type": {
  16031. "type": "string",
  16032. "enum": ["pty.deleted"]
  16033. },
  16034. "properties": {
  16035. "type": "object",
  16036. "properties": {
  16037. "id": {
  16038. "type": "string"
  16039. }
  16040. },
  16041. "required": ["id"],
  16042. "additionalProperties": false
  16043. }
  16044. },
  16045. "required": ["id", "type", "properties"],
  16046. "additionalProperties": false
  16047. },
  16048. "EventMessageUpdated": {
  16049. "type": "object",
  16050. "properties": {
  16051. "id": {
  16052. "type": "string"
  16053. },
  16054. "type": {
  16055. "type": "string",
  16056. "enum": ["message.updated"]
  16057. },
  16058. "properties": {
  16059. "type": "object",
  16060. "properties": {
  16061. "sessionID": {
  16062. "type": "string"
  16063. },
  16064. "info": {
  16065. "$ref": "#/components/schemas/Message"
  16066. }
  16067. },
  16068. "required": ["sessionID", "info"],
  16069. "additionalProperties": false
  16070. }
  16071. },
  16072. "required": ["id", "type", "properties"],
  16073. "additionalProperties": false
  16074. },
  16075. "EventMessageRemoved": {
  16076. "type": "object",
  16077. "properties": {
  16078. "id": {
  16079. "type": "string"
  16080. },
  16081. "type": {
  16082. "type": "string",
  16083. "enum": ["message.removed"]
  16084. },
  16085. "properties": {
  16086. "type": "object",
  16087. "properties": {
  16088. "sessionID": {
  16089. "type": "string"
  16090. },
  16091. "messageID": {
  16092. "type": "string"
  16093. }
  16094. },
  16095. "required": ["sessionID", "messageID"],
  16096. "additionalProperties": false
  16097. }
  16098. },
  16099. "required": ["id", "type", "properties"],
  16100. "additionalProperties": false
  16101. },
  16102. "EventMessagePartUpdated": {
  16103. "type": "object",
  16104. "properties": {
  16105. "id": {
  16106. "type": "string"
  16107. },
  16108. "type": {
  16109. "type": "string",
  16110. "enum": ["message.part.updated"]
  16111. },
  16112. "properties": {
  16113. "type": "object",
  16114. "properties": {
  16115. "sessionID": {
  16116. "type": "string"
  16117. },
  16118. "part": {
  16119. "$ref": "#/components/schemas/Part"
  16120. },
  16121. "time": {
  16122. "type": "integer",
  16123. "minimum": 0
  16124. }
  16125. },
  16126. "required": ["sessionID", "part", "time"],
  16127. "additionalProperties": false
  16128. }
  16129. },
  16130. "required": ["id", "type", "properties"],
  16131. "additionalProperties": false
  16132. },
  16133. "EventMessagePartRemoved": {
  16134. "type": "object",
  16135. "properties": {
  16136. "id": {
  16137. "type": "string"
  16138. },
  16139. "type": {
  16140. "type": "string",
  16141. "enum": ["message.part.removed"]
  16142. },
  16143. "properties": {
  16144. "type": "object",
  16145. "properties": {
  16146. "sessionID": {
  16147. "type": "string"
  16148. },
  16149. "messageID": {
  16150. "type": "string"
  16151. },
  16152. "partID": {
  16153. "type": "string"
  16154. }
  16155. },
  16156. "required": ["sessionID", "messageID", "partID"],
  16157. "additionalProperties": false
  16158. }
  16159. },
  16160. "required": ["id", "type", "properties"],
  16161. "additionalProperties": false
  16162. },
  16163. "EventSessionCreated": {
  16164. "type": "object",
  16165. "properties": {
  16166. "id": {
  16167. "type": "string"
  16168. },
  16169. "type": {
  16170. "type": "string",
  16171. "enum": ["session.created"]
  16172. },
  16173. "properties": {
  16174. "type": "object",
  16175. "properties": {
  16176. "sessionID": {
  16177. "type": "string"
  16178. },
  16179. "info": {
  16180. "$ref": "#/components/schemas/Session"
  16181. }
  16182. },
  16183. "required": ["sessionID", "info"],
  16184. "additionalProperties": false
  16185. }
  16186. },
  16187. "required": ["id", "type", "properties"],
  16188. "additionalProperties": false
  16189. },
  16190. "EventSessionUpdated": {
  16191. "type": "object",
  16192. "properties": {
  16193. "id": {
  16194. "type": "string"
  16195. },
  16196. "type": {
  16197. "type": "string",
  16198. "enum": ["session.updated"]
  16199. },
  16200. "properties": {
  16201. "type": "object",
  16202. "properties": {
  16203. "sessionID": {
  16204. "type": "string"
  16205. },
  16206. "info": {
  16207. "$ref": "#/components/schemas/Session"
  16208. }
  16209. },
  16210. "required": ["sessionID", "info"],
  16211. "additionalProperties": false
  16212. }
  16213. },
  16214. "required": ["id", "type", "properties"],
  16215. "additionalProperties": false
  16216. },
  16217. "EventSessionDeleted": {
  16218. "type": "object",
  16219. "properties": {
  16220. "id": {
  16221. "type": "string"
  16222. },
  16223. "type": {
  16224. "type": "string",
  16225. "enum": ["session.deleted"]
  16226. },
  16227. "properties": {
  16228. "type": "object",
  16229. "properties": {
  16230. "sessionID": {
  16231. "type": "string"
  16232. },
  16233. "info": {
  16234. "$ref": "#/components/schemas/Session"
  16235. }
  16236. },
  16237. "required": ["sessionID", "info"],
  16238. "additionalProperties": false
  16239. }
  16240. },
  16241. "required": ["id", "type", "properties"],
  16242. "additionalProperties": false
  16243. },
  16244. "EventSessionNextAgentSwitched": {
  16245. "type": "object",
  16246. "properties": {
  16247. "id": {
  16248. "type": "string"
  16249. },
  16250. "type": {
  16251. "type": "string",
  16252. "enum": ["session.next.agent.switched"]
  16253. },
  16254. "properties": {
  16255. "type": "object",
  16256. "properties": {
  16257. "timestamp": {
  16258. "type": "number"
  16259. },
  16260. "sessionID": {
  16261. "type": "string"
  16262. },
  16263. "agent": {
  16264. "type": "string"
  16265. }
  16266. },
  16267. "required": ["timestamp", "sessionID", "agent"],
  16268. "additionalProperties": false
  16269. }
  16270. },
  16271. "required": ["id", "type", "properties"],
  16272. "additionalProperties": false
  16273. },
  16274. "EventSessionNextModelSwitched": {
  16275. "type": "object",
  16276. "properties": {
  16277. "id": {
  16278. "type": "string"
  16279. },
  16280. "type": {
  16281. "type": "string",
  16282. "enum": ["session.next.model.switched"]
  16283. },
  16284. "properties": {
  16285. "type": "object",
  16286. "properties": {
  16287. "timestamp": {
  16288. "type": "number"
  16289. },
  16290. "sessionID": {
  16291. "type": "string"
  16292. },
  16293. "model": {
  16294. "type": "object",
  16295. "properties": {
  16296. "id": {
  16297. "type": "string"
  16298. },
  16299. "providerID": {
  16300. "type": "string"
  16301. },
  16302. "variant": {
  16303. "type": "string"
  16304. }
  16305. },
  16306. "required": ["id", "providerID", "variant"],
  16307. "additionalProperties": false
  16308. }
  16309. },
  16310. "required": ["timestamp", "sessionID", "model"],
  16311. "additionalProperties": false
  16312. }
  16313. },
  16314. "required": ["id", "type", "properties"],
  16315. "additionalProperties": false
  16316. },
  16317. "PromptSource": {
  16318. "type": "object",
  16319. "properties": {
  16320. "start": {
  16321. "type": "number"
  16322. },
  16323. "end": {
  16324. "type": "number"
  16325. },
  16326. "text": {
  16327. "type": "string"
  16328. }
  16329. },
  16330. "required": ["start", "end", "text"],
  16331. "additionalProperties": false
  16332. },
  16333. "PromptFileAttachment": {
  16334. "type": "object",
  16335. "properties": {
  16336. "uri": {
  16337. "type": "string"
  16338. },
  16339. "mime": {
  16340. "type": "string"
  16341. },
  16342. "name": {
  16343. "type": "string"
  16344. },
  16345. "description": {
  16346. "type": "string"
  16347. },
  16348. "source": {
  16349. "$ref": "#/components/schemas/PromptSource"
  16350. }
  16351. },
  16352. "required": ["uri", "mime"],
  16353. "additionalProperties": false
  16354. },
  16355. "PromptAgentAttachment": {
  16356. "type": "object",
  16357. "properties": {
  16358. "name": {
  16359. "type": "string"
  16360. },
  16361. "source": {
  16362. "$ref": "#/components/schemas/PromptSource"
  16363. }
  16364. },
  16365. "required": ["name"],
  16366. "additionalProperties": false
  16367. },
  16368. "EventSessionNextPrompted": {
  16369. "type": "object",
  16370. "properties": {
  16371. "id": {
  16372. "type": "string"
  16373. },
  16374. "type": {
  16375. "type": "string",
  16376. "enum": ["session.next.prompted"]
  16377. },
  16378. "properties": {
  16379. "type": "object",
  16380. "properties": {
  16381. "timestamp": {
  16382. "type": "number"
  16383. },
  16384. "sessionID": {
  16385. "type": "string"
  16386. },
  16387. "prompt": {
  16388. "$ref": "#/components/schemas/Prompt"
  16389. }
  16390. },
  16391. "required": ["timestamp", "sessionID", "prompt"],
  16392. "additionalProperties": false
  16393. }
  16394. },
  16395. "required": ["id", "type", "properties"],
  16396. "additionalProperties": false
  16397. },
  16398. "EventSessionNextSynthetic": {
  16399. "type": "object",
  16400. "properties": {
  16401. "id": {
  16402. "type": "string"
  16403. },
  16404. "type": {
  16405. "type": "string",
  16406. "enum": ["session.next.synthetic"]
  16407. },
  16408. "properties": {
  16409. "type": "object",
  16410. "properties": {
  16411. "timestamp": {
  16412. "type": "number"
  16413. },
  16414. "sessionID": {
  16415. "type": "string"
  16416. },
  16417. "text": {
  16418. "type": "string"
  16419. }
  16420. },
  16421. "required": ["timestamp", "sessionID", "text"],
  16422. "additionalProperties": false
  16423. }
  16424. },
  16425. "required": ["id", "type", "properties"],
  16426. "additionalProperties": false
  16427. },
  16428. "EventSessionNextShellStarted": {
  16429. "type": "object",
  16430. "properties": {
  16431. "id": {
  16432. "type": "string"
  16433. },
  16434. "type": {
  16435. "type": "string",
  16436. "enum": ["session.next.shell.started"]
  16437. },
  16438. "properties": {
  16439. "type": "object",
  16440. "properties": {
  16441. "timestamp": {
  16442. "type": "number"
  16443. },
  16444. "sessionID": {
  16445. "type": "string"
  16446. },
  16447. "callID": {
  16448. "type": "string"
  16449. },
  16450. "command": {
  16451. "type": "string"
  16452. }
  16453. },
  16454. "required": ["timestamp", "sessionID", "callID", "command"],
  16455. "additionalProperties": false
  16456. }
  16457. },
  16458. "required": ["id", "type", "properties"],
  16459. "additionalProperties": false
  16460. },
  16461. "EventSessionNextShellEnded": {
  16462. "type": "object",
  16463. "properties": {
  16464. "id": {
  16465. "type": "string"
  16466. },
  16467. "type": {
  16468. "type": "string",
  16469. "enum": ["session.next.shell.ended"]
  16470. },
  16471. "properties": {
  16472. "type": "object",
  16473. "properties": {
  16474. "timestamp": {
  16475. "type": "number"
  16476. },
  16477. "sessionID": {
  16478. "type": "string"
  16479. },
  16480. "callID": {
  16481. "type": "string"
  16482. },
  16483. "output": {
  16484. "type": "string"
  16485. }
  16486. },
  16487. "required": ["timestamp", "sessionID", "callID", "output"],
  16488. "additionalProperties": false
  16489. }
  16490. },
  16491. "required": ["id", "type", "properties"],
  16492. "additionalProperties": false
  16493. },
  16494. "EventSessionNextStepStarted": {
  16495. "type": "object",
  16496. "properties": {
  16497. "id": {
  16498. "type": "string"
  16499. },
  16500. "type": {
  16501. "type": "string",
  16502. "enum": ["session.next.step.started"]
  16503. },
  16504. "properties": {
  16505. "type": "object",
  16506. "properties": {
  16507. "timestamp": {
  16508. "type": "number"
  16509. },
  16510. "sessionID": {
  16511. "type": "string"
  16512. },
  16513. "agent": {
  16514. "type": "string"
  16515. },
  16516. "model": {
  16517. "type": "object",
  16518. "properties": {
  16519. "id": {
  16520. "type": "string"
  16521. },
  16522. "providerID": {
  16523. "type": "string"
  16524. },
  16525. "variant": {
  16526. "type": "string"
  16527. }
  16528. },
  16529. "required": ["id", "providerID", "variant"],
  16530. "additionalProperties": false
  16531. },
  16532. "snapshot": {
  16533. "type": "string"
  16534. }
  16535. },
  16536. "required": ["timestamp", "sessionID", "agent", "model"],
  16537. "additionalProperties": false
  16538. }
  16539. },
  16540. "required": ["id", "type", "properties"],
  16541. "additionalProperties": false
  16542. },
  16543. "EventSessionNextStepEnded": {
  16544. "type": "object",
  16545. "properties": {
  16546. "id": {
  16547. "type": "string"
  16548. },
  16549. "type": {
  16550. "type": "string",
  16551. "enum": ["session.next.step.ended"]
  16552. },
  16553. "properties": {
  16554. "type": "object",
  16555. "properties": {
  16556. "timestamp": {
  16557. "type": "number"
  16558. },
  16559. "sessionID": {
  16560. "type": "string"
  16561. },
  16562. "finish": {
  16563. "type": "string"
  16564. },
  16565. "cost": {
  16566. "type": "number"
  16567. },
  16568. "tokens": {
  16569. "type": "object",
  16570. "properties": {
  16571. "input": {
  16572. "type": "integer",
  16573. "minimum": 0
  16574. },
  16575. "output": {
  16576. "type": "integer",
  16577. "minimum": 0
  16578. },
  16579. "reasoning": {
  16580. "type": "integer",
  16581. "minimum": 0
  16582. },
  16583. "cache": {
  16584. "type": "object",
  16585. "properties": {
  16586. "read": {
  16587. "type": "integer",
  16588. "minimum": 0
  16589. },
  16590. "write": {
  16591. "type": "integer",
  16592. "minimum": 0
  16593. }
  16594. },
  16595. "required": ["read", "write"],
  16596. "additionalProperties": false
  16597. }
  16598. },
  16599. "required": ["input", "output", "reasoning", "cache"],
  16600. "additionalProperties": false
  16601. },
  16602. "snapshot": {
  16603. "type": "string"
  16604. }
  16605. },
  16606. "required": ["timestamp", "sessionID", "finish", "cost", "tokens"],
  16607. "additionalProperties": false
  16608. }
  16609. },
  16610. "required": ["id", "type", "properties"],
  16611. "additionalProperties": false
  16612. },
  16613. "SessionErrorUnknown": {
  16614. "type": "object",
  16615. "properties": {
  16616. "type": {
  16617. "type": "string",
  16618. "enum": ["unknown"]
  16619. },
  16620. "message": {
  16621. "type": "string"
  16622. }
  16623. },
  16624. "required": ["type", "message"],
  16625. "additionalProperties": false
  16626. },
  16627. "EventSessionNextStepFailed": {
  16628. "type": "object",
  16629. "properties": {
  16630. "id": {
  16631. "type": "string"
  16632. },
  16633. "type": {
  16634. "type": "string",
  16635. "enum": ["session.next.step.failed"]
  16636. },
  16637. "properties": {
  16638. "type": "object",
  16639. "properties": {
  16640. "timestamp": {
  16641. "type": "number"
  16642. },
  16643. "sessionID": {
  16644. "type": "string"
  16645. },
  16646. "error": {
  16647. "$ref": "#/components/schemas/SessionErrorUnknown"
  16648. }
  16649. },
  16650. "required": ["timestamp", "sessionID", "error"],
  16651. "additionalProperties": false
  16652. }
  16653. },
  16654. "required": ["id", "type", "properties"],
  16655. "additionalProperties": false
  16656. },
  16657. "EventSessionNextTextStarted": {
  16658. "type": "object",
  16659. "properties": {
  16660. "id": {
  16661. "type": "string"
  16662. },
  16663. "type": {
  16664. "type": "string",
  16665. "enum": ["session.next.text.started"]
  16666. },
  16667. "properties": {
  16668. "type": "object",
  16669. "properties": {
  16670. "timestamp": {
  16671. "type": "number"
  16672. },
  16673. "sessionID": {
  16674. "type": "string"
  16675. }
  16676. },
  16677. "required": ["timestamp", "sessionID"],
  16678. "additionalProperties": false
  16679. }
  16680. },
  16681. "required": ["id", "type", "properties"],
  16682. "additionalProperties": false
  16683. },
  16684. "EventSessionNextTextDelta": {
  16685. "type": "object",
  16686. "properties": {
  16687. "id": {
  16688. "type": "string"
  16689. },
  16690. "type": {
  16691. "type": "string",
  16692. "enum": ["session.next.text.delta"]
  16693. },
  16694. "properties": {
  16695. "type": "object",
  16696. "properties": {
  16697. "timestamp": {
  16698. "type": "number"
  16699. },
  16700. "sessionID": {
  16701. "type": "string"
  16702. },
  16703. "delta": {
  16704. "type": "string"
  16705. }
  16706. },
  16707. "required": ["timestamp", "sessionID", "delta"],
  16708. "additionalProperties": false
  16709. }
  16710. },
  16711. "required": ["id", "type", "properties"],
  16712. "additionalProperties": false
  16713. },
  16714. "EventSessionNextTextEnded": {
  16715. "type": "object",
  16716. "properties": {
  16717. "id": {
  16718. "type": "string"
  16719. },
  16720. "type": {
  16721. "type": "string",
  16722. "enum": ["session.next.text.ended"]
  16723. },
  16724. "properties": {
  16725. "type": "object",
  16726. "properties": {
  16727. "timestamp": {
  16728. "type": "number"
  16729. },
  16730. "sessionID": {
  16731. "type": "string"
  16732. },
  16733. "text": {
  16734. "type": "string"
  16735. }
  16736. },
  16737. "required": ["timestamp", "sessionID", "text"],
  16738. "additionalProperties": false
  16739. }
  16740. },
  16741. "required": ["id", "type", "properties"],
  16742. "additionalProperties": false
  16743. },
  16744. "EventSessionNextReasoningStarted": {
  16745. "type": "object",
  16746. "properties": {
  16747. "id": {
  16748. "type": "string"
  16749. },
  16750. "type": {
  16751. "type": "string",
  16752. "enum": ["session.next.reasoning.started"]
  16753. },
  16754. "properties": {
  16755. "type": "object",
  16756. "properties": {
  16757. "timestamp": {
  16758. "type": "number"
  16759. },
  16760. "sessionID": {
  16761. "type": "string"
  16762. },
  16763. "reasoningID": {
  16764. "type": "string"
  16765. }
  16766. },
  16767. "required": ["timestamp", "sessionID", "reasoningID"],
  16768. "additionalProperties": false
  16769. }
  16770. },
  16771. "required": ["id", "type", "properties"],
  16772. "additionalProperties": false
  16773. },
  16774. "EventSessionNextReasoningDelta": {
  16775. "type": "object",
  16776. "properties": {
  16777. "id": {
  16778. "type": "string"
  16779. },
  16780. "type": {
  16781. "type": "string",
  16782. "enum": ["session.next.reasoning.delta"]
  16783. },
  16784. "properties": {
  16785. "type": "object",
  16786. "properties": {
  16787. "timestamp": {
  16788. "type": "number"
  16789. },
  16790. "sessionID": {
  16791. "type": "string"
  16792. },
  16793. "reasoningID": {
  16794. "type": "string"
  16795. },
  16796. "delta": {
  16797. "type": "string"
  16798. }
  16799. },
  16800. "required": ["timestamp", "sessionID", "reasoningID", "delta"],
  16801. "additionalProperties": false
  16802. }
  16803. },
  16804. "required": ["id", "type", "properties"],
  16805. "additionalProperties": false
  16806. },
  16807. "EventSessionNextReasoningEnded": {
  16808. "type": "object",
  16809. "properties": {
  16810. "id": {
  16811. "type": "string"
  16812. },
  16813. "type": {
  16814. "type": "string",
  16815. "enum": ["session.next.reasoning.ended"]
  16816. },
  16817. "properties": {
  16818. "type": "object",
  16819. "properties": {
  16820. "timestamp": {
  16821. "type": "number"
  16822. },
  16823. "sessionID": {
  16824. "type": "string"
  16825. },
  16826. "reasoningID": {
  16827. "type": "string"
  16828. },
  16829. "text": {
  16830. "type": "string"
  16831. }
  16832. },
  16833. "required": ["timestamp", "sessionID", "reasoningID", "text"],
  16834. "additionalProperties": false
  16835. }
  16836. },
  16837. "required": ["id", "type", "properties"],
  16838. "additionalProperties": false
  16839. },
  16840. "EventSessionNextToolInputStarted": {
  16841. "type": "object",
  16842. "properties": {
  16843. "id": {
  16844. "type": "string"
  16845. },
  16846. "type": {
  16847. "type": "string",
  16848. "enum": ["session.next.tool.input.started"]
  16849. },
  16850. "properties": {
  16851. "type": "object",
  16852. "properties": {
  16853. "timestamp": {
  16854. "type": "number"
  16855. },
  16856. "sessionID": {
  16857. "type": "string"
  16858. },
  16859. "callID": {
  16860. "type": "string"
  16861. },
  16862. "name": {
  16863. "type": "string"
  16864. }
  16865. },
  16866. "required": ["timestamp", "sessionID", "callID", "name"],
  16867. "additionalProperties": false
  16868. }
  16869. },
  16870. "required": ["id", "type", "properties"],
  16871. "additionalProperties": false
  16872. },
  16873. "EventSessionNextToolInputDelta": {
  16874. "type": "object",
  16875. "properties": {
  16876. "id": {
  16877. "type": "string"
  16878. },
  16879. "type": {
  16880. "type": "string",
  16881. "enum": ["session.next.tool.input.delta"]
  16882. },
  16883. "properties": {
  16884. "type": "object",
  16885. "properties": {
  16886. "timestamp": {
  16887. "type": "number"
  16888. },
  16889. "sessionID": {
  16890. "type": "string"
  16891. },
  16892. "callID": {
  16893. "type": "string"
  16894. },
  16895. "delta": {
  16896. "type": "string"
  16897. }
  16898. },
  16899. "required": ["timestamp", "sessionID", "callID", "delta"],
  16900. "additionalProperties": false
  16901. }
  16902. },
  16903. "required": ["id", "type", "properties"],
  16904. "additionalProperties": false
  16905. },
  16906. "EventSessionNextToolInputEnded": {
  16907. "type": "object",
  16908. "properties": {
  16909. "id": {
  16910. "type": "string"
  16911. },
  16912. "type": {
  16913. "type": "string",
  16914. "enum": ["session.next.tool.input.ended"]
  16915. },
  16916. "properties": {
  16917. "type": "object",
  16918. "properties": {
  16919. "timestamp": {
  16920. "type": "number"
  16921. },
  16922. "sessionID": {
  16923. "type": "string"
  16924. },
  16925. "callID": {
  16926. "type": "string"
  16927. },
  16928. "text": {
  16929. "type": "string"
  16930. }
  16931. },
  16932. "required": ["timestamp", "sessionID", "callID", "text"],
  16933. "additionalProperties": false
  16934. }
  16935. },
  16936. "required": ["id", "type", "properties"],
  16937. "additionalProperties": false
  16938. },
  16939. "EventSessionNextToolCalled": {
  16940. "type": "object",
  16941. "properties": {
  16942. "id": {
  16943. "type": "string"
  16944. },
  16945. "type": {
  16946. "type": "string",
  16947. "enum": ["session.next.tool.called"]
  16948. },
  16949. "properties": {
  16950. "type": "object",
  16951. "properties": {
  16952. "timestamp": {
  16953. "type": "number"
  16954. },
  16955. "sessionID": {
  16956. "type": "string"
  16957. },
  16958. "callID": {
  16959. "type": "string"
  16960. },
  16961. "tool": {
  16962. "type": "string"
  16963. },
  16964. "input": {
  16965. "type": "object"
  16966. },
  16967. "provider": {
  16968. "type": "object",
  16969. "properties": {
  16970. "executed": {
  16971. "type": "boolean"
  16972. },
  16973. "metadata": {
  16974. "type": "object"
  16975. }
  16976. },
  16977. "required": ["executed"],
  16978. "additionalProperties": false
  16979. }
  16980. },
  16981. "required": ["timestamp", "sessionID", "callID", "tool", "input", "provider"],
  16982. "additionalProperties": false
  16983. }
  16984. },
  16985. "required": ["id", "type", "properties"],
  16986. "additionalProperties": false
  16987. },
  16988. "ToolTextContent": {
  16989. "type": "object",
  16990. "properties": {
  16991. "type": {
  16992. "type": "string",
  16993. "enum": ["text"]
  16994. },
  16995. "text": {
  16996. "type": "string"
  16997. }
  16998. },
  16999. "required": ["type", "text"],
  17000. "additionalProperties": false
  17001. },
  17002. "ToolFileContent": {
  17003. "type": "object",
  17004. "properties": {
  17005. "type": {
  17006. "type": "string",
  17007. "enum": ["file"]
  17008. },
  17009. "uri": {
  17010. "type": "string"
  17011. },
  17012. "mime": {
  17013. "type": "string"
  17014. },
  17015. "name": {
  17016. "type": "string"
  17017. }
  17018. },
  17019. "required": ["type", "uri", "mime"],
  17020. "additionalProperties": false
  17021. },
  17022. "EventSessionNextToolProgress": {
  17023. "type": "object",
  17024. "properties": {
  17025. "id": {
  17026. "type": "string"
  17027. },
  17028. "type": {
  17029. "type": "string",
  17030. "enum": ["session.next.tool.progress"]
  17031. },
  17032. "properties": {
  17033. "type": "object",
  17034. "properties": {
  17035. "timestamp": {
  17036. "type": "number"
  17037. },
  17038. "sessionID": {
  17039. "type": "string"
  17040. },
  17041. "callID": {
  17042. "type": "string"
  17043. },
  17044. "structured": {
  17045. "type": "object"
  17046. },
  17047. "content": {
  17048. "type": "array",
  17049. "items": {
  17050. "anyOf": [
  17051. {
  17052. "$ref": "#/components/schemas/ToolTextContent"
  17053. },
  17054. {
  17055. "$ref": "#/components/schemas/ToolFileContent"
  17056. }
  17057. ]
  17058. }
  17059. }
  17060. },
  17061. "required": ["timestamp", "sessionID", "callID", "structured", "content"],
  17062. "additionalProperties": false
  17063. }
  17064. },
  17065. "required": ["id", "type", "properties"],
  17066. "additionalProperties": false
  17067. },
  17068. "EventSessionNextToolSuccess": {
  17069. "type": "object",
  17070. "properties": {
  17071. "id": {
  17072. "type": "string"
  17073. },
  17074. "type": {
  17075. "type": "string",
  17076. "enum": ["session.next.tool.success"]
  17077. },
  17078. "properties": {
  17079. "type": "object",
  17080. "properties": {
  17081. "timestamp": {
  17082. "type": "number"
  17083. },
  17084. "sessionID": {
  17085. "type": "string"
  17086. },
  17087. "callID": {
  17088. "type": "string"
  17089. },
  17090. "structured": {
  17091. "type": "object"
  17092. },
  17093. "content": {
  17094. "type": "array",
  17095. "items": {
  17096. "anyOf": [
  17097. {
  17098. "$ref": "#/components/schemas/ToolTextContent"
  17099. },
  17100. {
  17101. "$ref": "#/components/schemas/ToolFileContent"
  17102. }
  17103. ]
  17104. }
  17105. },
  17106. "provider": {
  17107. "type": "object",
  17108. "properties": {
  17109. "executed": {
  17110. "type": "boolean"
  17111. },
  17112. "metadata": {
  17113. "type": "object"
  17114. }
  17115. },
  17116. "required": ["executed"],
  17117. "additionalProperties": false
  17118. }
  17119. },
  17120. "required": ["timestamp", "sessionID", "callID", "structured", "content", "provider"],
  17121. "additionalProperties": false
  17122. }
  17123. },
  17124. "required": ["id", "type", "properties"],
  17125. "additionalProperties": false
  17126. },
  17127. "EventSessionNextToolFailed": {
  17128. "type": "object",
  17129. "properties": {
  17130. "id": {
  17131. "type": "string"
  17132. },
  17133. "type": {
  17134. "type": "string",
  17135. "enum": ["session.next.tool.failed"]
  17136. },
  17137. "properties": {
  17138. "type": "object",
  17139. "properties": {
  17140. "timestamp": {
  17141. "type": "number"
  17142. },
  17143. "sessionID": {
  17144. "type": "string"
  17145. },
  17146. "callID": {
  17147. "type": "string"
  17148. },
  17149. "error": {
  17150. "$ref": "#/components/schemas/SessionErrorUnknown"
  17151. },
  17152. "provider": {
  17153. "type": "object",
  17154. "properties": {
  17155. "executed": {
  17156. "type": "boolean"
  17157. },
  17158. "metadata": {
  17159. "type": "object"
  17160. }
  17161. },
  17162. "required": ["executed"],
  17163. "additionalProperties": false
  17164. }
  17165. },
  17166. "required": ["timestamp", "sessionID", "callID", "error", "provider"],
  17167. "additionalProperties": false
  17168. }
  17169. },
  17170. "required": ["id", "type", "properties"],
  17171. "additionalProperties": false
  17172. },
  17173. "SessionNextRetry_error": {
  17174. "type": "object",
  17175. "properties": {
  17176. "message": {
  17177. "type": "string"
  17178. },
  17179. "statusCode": {
  17180. "type": "integer",
  17181. "minimum": 0
  17182. },
  17183. "isRetryable": {
  17184. "type": "boolean"
  17185. },
  17186. "responseHeaders": {
  17187. "type": "object",
  17188. "additionalProperties": {
  17189. "type": "string"
  17190. }
  17191. },
  17192. "responseBody": {
  17193. "type": "string"
  17194. },
  17195. "metadata": {
  17196. "type": "object",
  17197. "additionalProperties": {
  17198. "type": "string"
  17199. }
  17200. }
  17201. },
  17202. "required": ["message", "isRetryable"],
  17203. "additionalProperties": false
  17204. },
  17205. "EventSessionNextRetried": {
  17206. "type": "object",
  17207. "properties": {
  17208. "id": {
  17209. "type": "string"
  17210. },
  17211. "type": {
  17212. "type": "string",
  17213. "enum": ["session.next.retried"]
  17214. },
  17215. "properties": {
  17216. "type": "object",
  17217. "properties": {
  17218. "timestamp": {
  17219. "type": "number"
  17220. },
  17221. "sessionID": {
  17222. "type": "string"
  17223. },
  17224. "attempt": {
  17225. "type": "integer",
  17226. "minimum": 0
  17227. },
  17228. "error": {
  17229. "$ref": "#/components/schemas/SessionNextRetry_error"
  17230. }
  17231. },
  17232. "required": ["timestamp", "sessionID", "attempt", "error"],
  17233. "additionalProperties": false
  17234. }
  17235. },
  17236. "required": ["id", "type", "properties"],
  17237. "additionalProperties": false
  17238. },
  17239. "EventSessionNextCompactionStarted": {
  17240. "type": "object",
  17241. "properties": {
  17242. "id": {
  17243. "type": "string"
  17244. },
  17245. "type": {
  17246. "type": "string",
  17247. "enum": ["session.next.compaction.started"]
  17248. },
  17249. "properties": {
  17250. "type": "object",
  17251. "properties": {
  17252. "timestamp": {
  17253. "type": "number"
  17254. },
  17255. "sessionID": {
  17256. "type": "string"
  17257. },
  17258. "reason": {
  17259. "type": "string",
  17260. "enum": ["auto", "manual"]
  17261. }
  17262. },
  17263. "required": ["timestamp", "sessionID", "reason"],
  17264. "additionalProperties": false
  17265. }
  17266. },
  17267. "required": ["id", "type", "properties"],
  17268. "additionalProperties": false
  17269. },
  17270. "EventSessionNextCompactionDelta": {
  17271. "type": "object",
  17272. "properties": {
  17273. "id": {
  17274. "type": "string"
  17275. },
  17276. "type": {
  17277. "type": "string",
  17278. "enum": ["session.next.compaction.delta"]
  17279. },
  17280. "properties": {
  17281. "type": "object",
  17282. "properties": {
  17283. "timestamp": {
  17284. "type": "number"
  17285. },
  17286. "sessionID": {
  17287. "type": "string"
  17288. },
  17289. "text": {
  17290. "type": "string"
  17291. }
  17292. },
  17293. "required": ["timestamp", "sessionID", "text"],
  17294. "additionalProperties": false
  17295. }
  17296. },
  17297. "required": ["id", "type", "properties"],
  17298. "additionalProperties": false
  17299. },
  17300. "EventSessionNextCompactionEnded": {
  17301. "type": "object",
  17302. "properties": {
  17303. "id": {
  17304. "type": "string"
  17305. },
  17306. "type": {
  17307. "type": "string",
  17308. "enum": ["session.next.compaction.ended"]
  17309. },
  17310. "properties": {
  17311. "type": "object",
  17312. "properties": {
  17313. "timestamp": {
  17314. "type": "number"
  17315. },
  17316. "sessionID": {
  17317. "type": "string"
  17318. },
  17319. "text": {
  17320. "type": "string"
  17321. },
  17322. "include": {
  17323. "type": "string"
  17324. }
  17325. },
  17326. "required": ["timestamp", "sessionID", "text"],
  17327. "additionalProperties": false
  17328. }
  17329. },
  17330. "required": ["id", "type", "properties"],
  17331. "additionalProperties": false
  17332. },
  17333. "EventServerConnected": {
  17334. "type": "object",
  17335. "properties": {
  17336. "id": {
  17337. "type": "string"
  17338. },
  17339. "type": {
  17340. "type": "string",
  17341. "enum": ["server.connected"]
  17342. },
  17343. "properties": {
  17344. "type": "object",
  17345. "properties": {}
  17346. }
  17347. },
  17348. "required": ["id", "type", "properties"],
  17349. "additionalProperties": false
  17350. },
  17351. "EventGlobalDisposed": {
  17352. "type": "object",
  17353. "properties": {
  17354. "id": {
  17355. "type": "string"
  17356. },
  17357. "type": {
  17358. "type": "string",
  17359. "enum": ["global.disposed"]
  17360. },
  17361. "properties": {
  17362. "type": "object",
  17363. "properties": {}
  17364. }
  17365. },
  17366. "required": ["id", "type", "properties"],
  17367. "additionalProperties": false
  17368. },
  17369. "SessionInfo": {
  17370. "type": "object",
  17371. "properties": {
  17372. "id": {
  17373. "type": "string"
  17374. },
  17375. "parentID": {
  17376. "type": "string"
  17377. },
  17378. "projectID": {
  17379. "type": "string"
  17380. },
  17381. "workspaceID": {
  17382. "type": "string"
  17383. },
  17384. "path": {
  17385. "type": "string"
  17386. },
  17387. "agent": {
  17388. "type": "string"
  17389. },
  17390. "model": {
  17391. "type": "object",
  17392. "properties": {
  17393. "id": {
  17394. "type": "string"
  17395. },
  17396. "providerID": {
  17397. "type": "string"
  17398. },
  17399. "variant": {
  17400. "type": "string"
  17401. }
  17402. },
  17403. "required": ["id", "providerID", "variant"],
  17404. "additionalProperties": false
  17405. },
  17406. "time": {
  17407. "type": "object",
  17408. "properties": {
  17409. "created": {
  17410. "type": "number"
  17411. },
  17412. "updated": {
  17413. "type": "number"
  17414. },
  17415. "archived": {
  17416. "type": "number"
  17417. }
  17418. },
  17419. "required": ["created", "updated"],
  17420. "additionalProperties": false
  17421. },
  17422. "title": {
  17423. "type": "string"
  17424. }
  17425. },
  17426. "required": ["id", "projectID", "time", "title"],
  17427. "additionalProperties": false
  17428. },
  17429. "SessionDelivery": {
  17430. "type": "string",
  17431. "enum": ["immediate", "deferred"]
  17432. },
  17433. "SessionMessageAgentSwitched": {
  17434. "type": "object",
  17435. "properties": {
  17436. "id": {
  17437. "type": "string"
  17438. },
  17439. "metadata": {
  17440. "type": "object"
  17441. },
  17442. "time": {
  17443. "type": "object",
  17444. "properties": {
  17445. "created": {
  17446. "type": "number"
  17447. }
  17448. },
  17449. "required": ["created"],
  17450. "additionalProperties": false
  17451. },
  17452. "type": {
  17453. "type": "string",
  17454. "enum": ["agent-switched"]
  17455. },
  17456. "agent": {
  17457. "type": "string"
  17458. }
  17459. },
  17460. "required": ["id", "time", "type", "agent"],
  17461. "additionalProperties": false
  17462. },
  17463. "SessionMessageModelSwitched": {
  17464. "type": "object",
  17465. "properties": {
  17466. "id": {
  17467. "type": "string"
  17468. },
  17469. "metadata": {
  17470. "type": "object"
  17471. },
  17472. "time": {
  17473. "type": "object",
  17474. "properties": {
  17475. "created": {
  17476. "type": "number"
  17477. }
  17478. },
  17479. "required": ["created"],
  17480. "additionalProperties": false
  17481. },
  17482. "type": {
  17483. "type": "string",
  17484. "enum": ["model-switched"]
  17485. },
  17486. "model": {
  17487. "type": "object",
  17488. "properties": {
  17489. "id": {
  17490. "type": "string"
  17491. },
  17492. "providerID": {
  17493. "type": "string"
  17494. },
  17495. "variant": {
  17496. "type": "string"
  17497. }
  17498. },
  17499. "required": ["id", "providerID", "variant"],
  17500. "additionalProperties": false
  17501. }
  17502. },
  17503. "required": ["id", "time", "type", "model"],
  17504. "additionalProperties": false
  17505. },
  17506. "SessionMessageUser": {
  17507. "type": "object",
  17508. "properties": {
  17509. "id": {
  17510. "type": "string"
  17511. },
  17512. "metadata": {
  17513. "type": "object"
  17514. },
  17515. "time": {
  17516. "type": "object",
  17517. "properties": {
  17518. "created": {
  17519. "type": "number"
  17520. }
  17521. },
  17522. "required": ["created"],
  17523. "additionalProperties": false
  17524. },
  17525. "text": {
  17526. "type": "string"
  17527. },
  17528. "files": {
  17529. "type": "array",
  17530. "items": {
  17531. "$ref": "#/components/schemas/PromptFileAttachment"
  17532. }
  17533. },
  17534. "agents": {
  17535. "type": "array",
  17536. "items": {
  17537. "$ref": "#/components/schemas/PromptAgentAttachment"
  17538. }
  17539. },
  17540. "type": {
  17541. "type": "string",
  17542. "enum": ["user"]
  17543. }
  17544. },
  17545. "required": ["id", "time", "text", "type"],
  17546. "additionalProperties": false
  17547. },
  17548. "SessionMessageSynthetic": {
  17549. "type": "object",
  17550. "properties": {
  17551. "id": {
  17552. "type": "string"
  17553. },
  17554. "metadata": {
  17555. "type": "object"
  17556. },
  17557. "time": {
  17558. "type": "object",
  17559. "properties": {
  17560. "created": {
  17561. "type": "number"
  17562. }
  17563. },
  17564. "required": ["created"],
  17565. "additionalProperties": false
  17566. },
  17567. "sessionID": {
  17568. "type": "string"
  17569. },
  17570. "text": {
  17571. "type": "string"
  17572. },
  17573. "type": {
  17574. "type": "string",
  17575. "enum": ["synthetic"]
  17576. }
  17577. },
  17578. "required": ["id", "time", "sessionID", "text", "type"],
  17579. "additionalProperties": false
  17580. },
  17581. "SessionMessageShell": {
  17582. "type": "object",
  17583. "properties": {
  17584. "id": {
  17585. "type": "string"
  17586. },
  17587. "metadata": {
  17588. "type": "object"
  17589. },
  17590. "time": {
  17591. "type": "object",
  17592. "properties": {
  17593. "created": {
  17594. "type": "number"
  17595. },
  17596. "completed": {
  17597. "type": "number"
  17598. }
  17599. },
  17600. "required": ["created"],
  17601. "additionalProperties": false
  17602. },
  17603. "type": {
  17604. "type": "string",
  17605. "enum": ["shell"]
  17606. },
  17607. "callID": {
  17608. "type": "string"
  17609. },
  17610. "command": {
  17611. "type": "string"
  17612. },
  17613. "output": {
  17614. "type": "string"
  17615. }
  17616. },
  17617. "required": ["id", "time", "type", "callID", "command", "output"],
  17618. "additionalProperties": false
  17619. },
  17620. "SessionMessageAssistantText": {
  17621. "type": "object",
  17622. "properties": {
  17623. "type": {
  17624. "type": "string",
  17625. "enum": ["text"]
  17626. },
  17627. "text": {
  17628. "type": "string"
  17629. }
  17630. },
  17631. "required": ["type", "text"],
  17632. "additionalProperties": false
  17633. },
  17634. "SessionMessageAssistantReasoning": {
  17635. "type": "object",
  17636. "properties": {
  17637. "type": {
  17638. "type": "string",
  17639. "enum": ["reasoning"]
  17640. },
  17641. "id": {
  17642. "type": "string"
  17643. },
  17644. "text": {
  17645. "type": "string"
  17646. }
  17647. },
  17648. "required": ["type", "id", "text"],
  17649. "additionalProperties": false
  17650. },
  17651. "SessionMessageToolStatePending": {
  17652. "type": "object",
  17653. "properties": {
  17654. "status": {
  17655. "type": "string",
  17656. "enum": ["pending"]
  17657. },
  17658. "input": {
  17659. "type": "string"
  17660. }
  17661. },
  17662. "required": ["status", "input"],
  17663. "additionalProperties": false
  17664. },
  17665. "SessionMessageToolStateRunning": {
  17666. "type": "object",
  17667. "properties": {
  17668. "status": {
  17669. "type": "string",
  17670. "enum": ["running"]
  17671. },
  17672. "input": {
  17673. "type": "object"
  17674. },
  17675. "structured": {
  17676. "type": "object"
  17677. },
  17678. "content": {
  17679. "type": "array",
  17680. "items": {
  17681. "anyOf": [
  17682. {
  17683. "$ref": "#/components/schemas/ToolTextContent"
  17684. },
  17685. {
  17686. "$ref": "#/components/schemas/ToolFileContent"
  17687. }
  17688. ]
  17689. }
  17690. }
  17691. },
  17692. "required": ["status", "input", "structured", "content"],
  17693. "additionalProperties": false
  17694. },
  17695. "SessionMessageToolStateCompleted": {
  17696. "type": "object",
  17697. "properties": {
  17698. "status": {
  17699. "type": "string",
  17700. "enum": ["completed"]
  17701. },
  17702. "input": {
  17703. "type": "object"
  17704. },
  17705. "attachments": {
  17706. "type": "array",
  17707. "items": {
  17708. "$ref": "#/components/schemas/PromptFileAttachment"
  17709. }
  17710. },
  17711. "content": {
  17712. "type": "array",
  17713. "items": {
  17714. "anyOf": [
  17715. {
  17716. "$ref": "#/components/schemas/ToolTextContent"
  17717. },
  17718. {
  17719. "$ref": "#/components/schemas/ToolFileContent"
  17720. }
  17721. ]
  17722. }
  17723. },
  17724. "structured": {
  17725. "type": "object"
  17726. }
  17727. },
  17728. "required": ["status", "input", "content", "structured"],
  17729. "additionalProperties": false
  17730. },
  17731. "SessionMessageToolStateError": {
  17732. "type": "object",
  17733. "properties": {
  17734. "status": {
  17735. "type": "string",
  17736. "enum": ["error"]
  17737. },
  17738. "input": {
  17739. "type": "object"
  17740. },
  17741. "content": {
  17742. "type": "array",
  17743. "items": {
  17744. "anyOf": [
  17745. {
  17746. "$ref": "#/components/schemas/ToolTextContent"
  17747. },
  17748. {
  17749. "$ref": "#/components/schemas/ToolFileContent"
  17750. }
  17751. ]
  17752. }
  17753. },
  17754. "structured": {
  17755. "type": "object"
  17756. },
  17757. "error": {
  17758. "$ref": "#/components/schemas/SessionErrorUnknown"
  17759. }
  17760. },
  17761. "required": ["status", "input", "content", "structured", "error"],
  17762. "additionalProperties": false
  17763. },
  17764. "SessionMessageAssistantTool": {
  17765. "type": "object",
  17766. "properties": {
  17767. "type": {
  17768. "type": "string",
  17769. "enum": ["tool"]
  17770. },
  17771. "id": {
  17772. "type": "string"
  17773. },
  17774. "name": {
  17775. "type": "string"
  17776. },
  17777. "provider": {
  17778. "type": "object",
  17779. "properties": {
  17780. "executed": {
  17781. "type": "boolean"
  17782. },
  17783. "metadata": {
  17784. "type": "object"
  17785. }
  17786. },
  17787. "required": ["executed"],
  17788. "additionalProperties": false
  17789. },
  17790. "state": {
  17791. "anyOf": [
  17792. {
  17793. "$ref": "#/components/schemas/SessionMessageToolStatePending"
  17794. },
  17795. {
  17796. "$ref": "#/components/schemas/SessionMessageToolStateRunning"
  17797. },
  17798. {
  17799. "$ref": "#/components/schemas/SessionMessageToolStateCompleted"
  17800. },
  17801. {
  17802. "$ref": "#/components/schemas/SessionMessageToolStateError"
  17803. }
  17804. ]
  17805. },
  17806. "time": {
  17807. "type": "object",
  17808. "properties": {
  17809. "created": {
  17810. "type": "number"
  17811. },
  17812. "ran": {
  17813. "type": "number"
  17814. },
  17815. "completed": {
  17816. "type": "number"
  17817. },
  17818. "pruned": {
  17819. "type": "number"
  17820. }
  17821. },
  17822. "required": ["created"],
  17823. "additionalProperties": false
  17824. }
  17825. },
  17826. "required": ["type", "id", "name", "state", "time"],
  17827. "additionalProperties": false
  17828. },
  17829. "SessionMessageAssistant": {
  17830. "type": "object",
  17831. "properties": {
  17832. "id": {
  17833. "type": "string"
  17834. },
  17835. "metadata": {
  17836. "type": "object"
  17837. },
  17838. "time": {
  17839. "type": "object",
  17840. "properties": {
  17841. "created": {
  17842. "type": "number"
  17843. },
  17844. "completed": {
  17845. "type": "number"
  17846. }
  17847. },
  17848. "required": ["created"],
  17849. "additionalProperties": false
  17850. },
  17851. "type": {
  17852. "type": "string",
  17853. "enum": ["assistant"]
  17854. },
  17855. "agent": {
  17856. "type": "string"
  17857. },
  17858. "model": {
  17859. "type": "object",
  17860. "properties": {
  17861. "id": {
  17862. "type": "string"
  17863. },
  17864. "providerID": {
  17865. "type": "string"
  17866. },
  17867. "variant": {
  17868. "type": "string"
  17869. }
  17870. },
  17871. "required": ["id", "providerID", "variant"],
  17872. "additionalProperties": false
  17873. },
  17874. "content": {
  17875. "type": "array",
  17876. "items": {
  17877. "anyOf": [
  17878. {
  17879. "$ref": "#/components/schemas/SessionMessageAssistantText"
  17880. },
  17881. {
  17882. "$ref": "#/components/schemas/SessionMessageAssistantReasoning"
  17883. },
  17884. {
  17885. "$ref": "#/components/schemas/SessionMessageAssistantTool"
  17886. }
  17887. ]
  17888. }
  17889. },
  17890. "snapshot": {
  17891. "type": "object",
  17892. "properties": {
  17893. "start": {
  17894. "type": "string"
  17895. },
  17896. "end": {
  17897. "type": "string"
  17898. }
  17899. },
  17900. "additionalProperties": false
  17901. },
  17902. "finish": {
  17903. "type": "string"
  17904. },
  17905. "cost": {
  17906. "type": "number"
  17907. },
  17908. "tokens": {
  17909. "type": "object",
  17910. "properties": {
  17911. "input": {
  17912. "type": "number"
  17913. },
  17914. "output": {
  17915. "type": "number"
  17916. },
  17917. "reasoning": {
  17918. "type": "number"
  17919. },
  17920. "cache": {
  17921. "type": "object",
  17922. "properties": {
  17923. "read": {
  17924. "type": "number"
  17925. },
  17926. "write": {
  17927. "type": "number"
  17928. }
  17929. },
  17930. "required": ["read", "write"],
  17931. "additionalProperties": false
  17932. }
  17933. },
  17934. "required": ["input", "output", "reasoning", "cache"],
  17935. "additionalProperties": false
  17936. },
  17937. "error": {
  17938. "$ref": "#/components/schemas/SessionErrorUnknown"
  17939. }
  17940. },
  17941. "required": ["id", "time", "type", "agent", "model", "content"],
  17942. "additionalProperties": false
  17943. },
  17944. "SessionMessageCompaction": {
  17945. "type": "object",
  17946. "properties": {
  17947. "type": {
  17948. "type": "string",
  17949. "enum": ["compaction"]
  17950. },
  17951. "reason": {
  17952. "type": "string",
  17953. "enum": ["auto", "manual"]
  17954. },
  17955. "summary": {
  17956. "type": "string"
  17957. },
  17958. "include": {
  17959. "type": "string"
  17960. },
  17961. "id": {
  17962. "type": "string"
  17963. },
  17964. "metadata": {
  17965. "type": "object"
  17966. },
  17967. "time": {
  17968. "type": "object",
  17969. "properties": {
  17970. "created": {
  17971. "type": "number"
  17972. }
  17973. },
  17974. "required": ["created"],
  17975. "additionalProperties": false
  17976. }
  17977. },
  17978. "required": ["type", "reason", "summary", "id", "time"],
  17979. "additionalProperties": false
  17980. },
  17981. "SessionMessage": {
  17982. "anyOf": [
  17983. {
  17984. "$ref": "#/components/schemas/SessionMessageAgentSwitched"
  17985. },
  17986. {
  17987. "$ref": "#/components/schemas/SessionMessageModelSwitched"
  17988. },
  17989. {
  17990. "$ref": "#/components/schemas/SessionMessageUser"
  17991. },
  17992. {
  17993. "$ref": "#/components/schemas/SessionMessageSynthetic"
  17994. },
  17995. {
  17996. "$ref": "#/components/schemas/SessionMessageShell"
  17997. },
  17998. {
  17999. "$ref": "#/components/schemas/SessionMessageAssistant"
  18000. },
  18001. {
  18002. "$ref": "#/components/schemas/SessionMessageCompaction"
  18003. }
  18004. ]
  18005. },
  18006. "EventTuiToastShow1": {
  18007. "type": "object",
  18008. "properties": {
  18009. "id": {
  18010. "type": "string"
  18011. },
  18012. "type": {
  18013. "type": "string",
  18014. "enum": ["tui.toast.show"]
  18015. },
  18016. "properties": {
  18017. "type": "object",
  18018. "properties": {
  18019. "title": {
  18020. "type": "string"
  18021. },
  18022. "message": {
  18023. "type": "string"
  18024. },
  18025. "variant": {
  18026. "type": "string",
  18027. "enum": ["info", "success", "warning", "error"]
  18028. },
  18029. "duration": {
  18030. "type": "integer",
  18031. "exclusiveMinimum": 0
  18032. }
  18033. },
  18034. "required": ["message", "variant"],
  18035. "additionalProperties": false
  18036. }
  18037. },
  18038. "required": ["id", "type", "properties"],
  18039. "additionalProperties": false
  18040. },
  18041. "BadRequestError": {
  18042. "type": "object",
  18043. "required": ["data", "errors", "success"],
  18044. "properties": {
  18045. "data": {},
  18046. "errors": {
  18047. "type": "array",
  18048. "items": {
  18049. "type": "object",
  18050. "additionalProperties": {}
  18051. }
  18052. },
  18053. "success": {
  18054. "type": "boolean",
  18055. "enum": [false]
  18056. }
  18057. }
  18058. }
  18059. }
  18060. },
  18061. "security": [],
  18062. "tags": [
  18063. {
  18064. "name": "control",
  18065. "description": "Control plane routes."
  18066. },
  18067. {
  18068. "name": "global",
  18069. "description": "Global server routes."
  18070. },
  18071. {
  18072. "name": "event",
  18073. "description": "Instance event stream route."
  18074. },
  18075. {
  18076. "name": "config",
  18077. "description": "Experimental HttpApi config routes."
  18078. },
  18079. {
  18080. "name": "experimental",
  18081. "description": "Experimental HttpApi read-only routes."
  18082. },
  18083. {
  18084. "name": "file",
  18085. "description": "Experimental HttpApi file routes."
  18086. },
  18087. {
  18088. "name": "instance",
  18089. "description": "Experimental HttpApi instance read routes."
  18090. },
  18091. {
  18092. "name": "mcp",
  18093. "description": "Experimental HttpApi MCP routes."
  18094. },
  18095. {
  18096. "name": "project",
  18097. "description": "Experimental HttpApi project routes."
  18098. },
  18099. {
  18100. "name": "pty",
  18101. "description": "Experimental HttpApi PTY routes."
  18102. },
  18103. {
  18104. "name": "question",
  18105. "description": "Question routes."
  18106. },
  18107. {
  18108. "name": "permission",
  18109. "description": "Experimental HttpApi permission routes."
  18110. },
  18111. {
  18112. "name": "provider",
  18113. "description": "Experimental HttpApi provider routes."
  18114. },
  18115. {
  18116. "name": "session",
  18117. "description": "Experimental HttpApi session routes."
  18118. },
  18119. {
  18120. "name": "sync",
  18121. "description": "Experimental HttpApi sync routes."
  18122. },
  18123. {
  18124. "name": "v2",
  18125. "description": "Experimental v2 routes."
  18126. },
  18127. {
  18128. "name": "v2 messages",
  18129. "description": "Experimental v2 message routes."
  18130. },
  18131. {
  18132. "name": "tui",
  18133. "description": "Experimental HttpApi TUI routes."
  18134. },
  18135. {
  18136. "name": "workspace",
  18137. "description": "Experimental HttpApi workspace routes."
  18138. },
  18139. {
  18140. "name": "pty",
  18141. "description": "PTY websocket route."
  18142. }
  18143. ]
  18144. }