openapi.json 493 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159
  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": "Not found",
  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": "Not found",
  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": "Not found",
  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": "Not found",
  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": "Not found",
  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": "Not found",
  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": "Not found",
  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": "Not found",
  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. },
  5347. "description": "Create a new session by forking an existing session at a specific message point.",
  5348. "summary": "Fork session",
  5349. "requestBody": {
  5350. "content": {
  5351. "application/json": {
  5352. "schema": {
  5353. "type": "object",
  5354. "properties": {
  5355. "messageID": {
  5356. "type": "string"
  5357. }
  5358. },
  5359. "additionalProperties": false
  5360. }
  5361. }
  5362. }
  5363. },
  5364. "x-codeSamples": [
  5365. {
  5366. "lang": "js",
  5367. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.fork({\n ...\n})"
  5368. }
  5369. ]
  5370. }
  5371. },
  5372. "/session/{sessionID}/abort": {
  5373. "post": {
  5374. "tags": ["session"],
  5375. "operationId": "session.abort",
  5376. "parameters": [
  5377. {
  5378. "name": "directory",
  5379. "in": "query",
  5380. "required": false,
  5381. "schema": {
  5382. "type": "string"
  5383. }
  5384. },
  5385. {
  5386. "name": "workspace",
  5387. "in": "query",
  5388. "required": false,
  5389. "schema": {
  5390. "type": "string"
  5391. }
  5392. },
  5393. {
  5394. "name": "sessionID",
  5395. "in": "path",
  5396. "schema": {
  5397. "type": "string",
  5398. "pattern": "^ses.*"
  5399. },
  5400. "required": true
  5401. }
  5402. ],
  5403. "responses": {
  5404. "200": {
  5405. "description": "Aborted session",
  5406. "content": {
  5407. "application/json": {
  5408. "schema": {
  5409. "type": "boolean",
  5410. "description": "Aborted session"
  5411. }
  5412. }
  5413. }
  5414. },
  5415. "400": {
  5416. "description": "Bad request",
  5417. "content": {
  5418. "application/json": {
  5419. "schema": {
  5420. "$ref": "#/components/schemas/BadRequestError"
  5421. }
  5422. }
  5423. }
  5424. },
  5425. "404": {
  5426. "description": "Not found",
  5427. "content": {
  5428. "application/json": {
  5429. "schema": {
  5430. "$ref": "#/components/schemas/NotFoundError"
  5431. }
  5432. }
  5433. }
  5434. }
  5435. },
  5436. "description": "Abort an active session and stop any ongoing AI processing or command execution.",
  5437. "summary": "Abort session",
  5438. "x-codeSamples": [
  5439. {
  5440. "lang": "js",
  5441. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.abort({\n ...\n})"
  5442. }
  5443. ]
  5444. }
  5445. },
  5446. "/session/{sessionID}/init": {
  5447. "post": {
  5448. "tags": ["session"],
  5449. "operationId": "session.init",
  5450. "parameters": [
  5451. {
  5452. "name": "directory",
  5453. "in": "query",
  5454. "required": false,
  5455. "schema": {
  5456. "type": "string"
  5457. }
  5458. },
  5459. {
  5460. "name": "workspace",
  5461. "in": "query",
  5462. "required": false,
  5463. "schema": {
  5464. "type": "string"
  5465. }
  5466. },
  5467. {
  5468. "name": "sessionID",
  5469. "in": "path",
  5470. "schema": {
  5471. "type": "string",
  5472. "pattern": "^ses.*"
  5473. },
  5474. "required": true
  5475. }
  5476. ],
  5477. "responses": {
  5478. "200": {
  5479. "description": "200",
  5480. "content": {
  5481. "application/json": {
  5482. "schema": {
  5483. "type": "boolean",
  5484. "description": "200"
  5485. }
  5486. }
  5487. }
  5488. },
  5489. "400": {
  5490. "description": "Bad request",
  5491. "content": {
  5492. "application/json": {
  5493. "schema": {
  5494. "$ref": "#/components/schemas/BadRequestError"
  5495. }
  5496. }
  5497. }
  5498. },
  5499. "404": {
  5500. "description": "Not found",
  5501. "content": {
  5502. "application/json": {
  5503. "schema": {
  5504. "$ref": "#/components/schemas/NotFoundError"
  5505. }
  5506. }
  5507. }
  5508. }
  5509. },
  5510. "description": "Analyze the current application and create an AGENTS.md file with project-specific agent configurations.",
  5511. "summary": "Initialize session",
  5512. "requestBody": {
  5513. "content": {
  5514. "application/json": {
  5515. "schema": {
  5516. "type": "object",
  5517. "properties": {
  5518. "modelID": {
  5519. "type": "string"
  5520. },
  5521. "providerID": {
  5522. "type": "string"
  5523. },
  5524. "messageID": {
  5525. "type": "string"
  5526. }
  5527. },
  5528. "required": ["modelID", "providerID", "messageID"],
  5529. "additionalProperties": false
  5530. }
  5531. }
  5532. }
  5533. },
  5534. "x-codeSamples": [
  5535. {
  5536. "lang": "js",
  5537. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.init({\n ...\n})"
  5538. }
  5539. ]
  5540. }
  5541. },
  5542. "/session/{sessionID}/share": {
  5543. "post": {
  5544. "tags": ["session"],
  5545. "operationId": "session.share",
  5546. "parameters": [
  5547. {
  5548. "name": "directory",
  5549. "in": "query",
  5550. "required": false,
  5551. "schema": {
  5552. "type": "string"
  5553. }
  5554. },
  5555. {
  5556. "name": "workspace",
  5557. "in": "query",
  5558. "required": false,
  5559. "schema": {
  5560. "type": "string"
  5561. }
  5562. },
  5563. {
  5564. "name": "sessionID",
  5565. "in": "path",
  5566. "schema": {
  5567. "type": "string",
  5568. "pattern": "^ses.*"
  5569. },
  5570. "required": true
  5571. }
  5572. ],
  5573. "responses": {
  5574. "200": {
  5575. "description": "Successfully shared session",
  5576. "content": {
  5577. "application/json": {
  5578. "schema": {
  5579. "$ref": "#/components/schemas/Session"
  5580. }
  5581. }
  5582. }
  5583. },
  5584. "400": {
  5585. "description": "Bad request",
  5586. "content": {
  5587. "application/json": {
  5588. "schema": {
  5589. "$ref": "#/components/schemas/BadRequestError"
  5590. }
  5591. }
  5592. }
  5593. },
  5594. "404": {
  5595. "description": "Not found",
  5596. "content": {
  5597. "application/json": {
  5598. "schema": {
  5599. "$ref": "#/components/schemas/NotFoundError"
  5600. }
  5601. }
  5602. }
  5603. }
  5604. },
  5605. "description": "Create a shareable link for a session, allowing others to view the conversation.",
  5606. "summary": "Share session",
  5607. "x-codeSamples": [
  5608. {
  5609. "lang": "js",
  5610. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.share({\n ...\n})"
  5611. }
  5612. ]
  5613. },
  5614. "delete": {
  5615. "tags": ["session"],
  5616. "operationId": "session.unshare",
  5617. "parameters": [
  5618. {
  5619. "name": "directory",
  5620. "in": "query",
  5621. "required": false,
  5622. "schema": {
  5623. "type": "string"
  5624. }
  5625. },
  5626. {
  5627. "name": "workspace",
  5628. "in": "query",
  5629. "required": false,
  5630. "schema": {
  5631. "type": "string"
  5632. }
  5633. },
  5634. {
  5635. "name": "sessionID",
  5636. "in": "path",
  5637. "schema": {
  5638. "type": "string",
  5639. "pattern": "^ses.*"
  5640. },
  5641. "required": true
  5642. }
  5643. ],
  5644. "responses": {
  5645. "200": {
  5646. "description": "Successfully unshared session",
  5647. "content": {
  5648. "application/json": {
  5649. "schema": {
  5650. "$ref": "#/components/schemas/Session"
  5651. }
  5652. }
  5653. }
  5654. },
  5655. "400": {
  5656. "description": "Bad request",
  5657. "content": {
  5658. "application/json": {
  5659. "schema": {
  5660. "$ref": "#/components/schemas/BadRequestError"
  5661. }
  5662. }
  5663. }
  5664. },
  5665. "404": {
  5666. "description": "Not found",
  5667. "content": {
  5668. "application/json": {
  5669. "schema": {
  5670. "$ref": "#/components/schemas/NotFoundError"
  5671. }
  5672. }
  5673. }
  5674. }
  5675. },
  5676. "description": "Remove the shareable link for a session, making it private again.",
  5677. "summary": "Unshare session",
  5678. "x-codeSamples": [
  5679. {
  5680. "lang": "js",
  5681. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.unshare({\n ...\n})"
  5682. }
  5683. ]
  5684. }
  5685. },
  5686. "/session/{sessionID}/summarize": {
  5687. "post": {
  5688. "tags": ["session"],
  5689. "operationId": "session.summarize",
  5690. "parameters": [
  5691. {
  5692. "name": "directory",
  5693. "in": "query",
  5694. "required": false,
  5695. "schema": {
  5696. "type": "string"
  5697. }
  5698. },
  5699. {
  5700. "name": "workspace",
  5701. "in": "query",
  5702. "required": false,
  5703. "schema": {
  5704. "type": "string"
  5705. }
  5706. },
  5707. {
  5708. "name": "sessionID",
  5709. "in": "path",
  5710. "schema": {
  5711. "type": "string",
  5712. "pattern": "^ses.*"
  5713. },
  5714. "required": true
  5715. }
  5716. ],
  5717. "responses": {
  5718. "200": {
  5719. "description": "Summarized session",
  5720. "content": {
  5721. "application/json": {
  5722. "schema": {
  5723. "type": "boolean",
  5724. "description": "Summarized session"
  5725. }
  5726. }
  5727. }
  5728. },
  5729. "400": {
  5730. "description": "Bad request",
  5731. "content": {
  5732. "application/json": {
  5733. "schema": {
  5734. "$ref": "#/components/schemas/BadRequestError"
  5735. }
  5736. }
  5737. }
  5738. },
  5739. "404": {
  5740. "description": "Not found",
  5741. "content": {
  5742. "application/json": {
  5743. "schema": {
  5744. "$ref": "#/components/schemas/NotFoundError"
  5745. }
  5746. }
  5747. }
  5748. }
  5749. },
  5750. "description": "Generate a concise summary of the session using AI compaction to preserve key information.",
  5751. "summary": "Summarize session",
  5752. "requestBody": {
  5753. "content": {
  5754. "application/json": {
  5755. "schema": {
  5756. "type": "object",
  5757. "properties": {
  5758. "providerID": {
  5759. "type": "string"
  5760. },
  5761. "modelID": {
  5762. "type": "string"
  5763. },
  5764. "auto": {
  5765. "type": "boolean"
  5766. }
  5767. },
  5768. "required": ["providerID", "modelID"],
  5769. "additionalProperties": false
  5770. }
  5771. }
  5772. }
  5773. },
  5774. "x-codeSamples": [
  5775. {
  5776. "lang": "js",
  5777. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.summarize({\n ...\n})"
  5778. }
  5779. ]
  5780. }
  5781. },
  5782. "/session/{sessionID}/prompt_async": {
  5783. "post": {
  5784. "tags": ["session"],
  5785. "operationId": "session.prompt_async",
  5786. "parameters": [
  5787. {
  5788. "name": "directory",
  5789. "in": "query",
  5790. "required": false,
  5791. "schema": {
  5792. "type": "string"
  5793. }
  5794. },
  5795. {
  5796. "name": "workspace",
  5797. "in": "query",
  5798. "required": false,
  5799. "schema": {
  5800. "type": "string"
  5801. }
  5802. },
  5803. {
  5804. "name": "sessionID",
  5805. "in": "path",
  5806. "schema": {
  5807. "type": "string",
  5808. "pattern": "^ses.*"
  5809. },
  5810. "required": true
  5811. }
  5812. ],
  5813. "responses": {
  5814. "204": {
  5815. "description": "Prompt accepted"
  5816. },
  5817. "400": {
  5818. "description": "Bad request",
  5819. "content": {
  5820. "application/json": {
  5821. "schema": {
  5822. "$ref": "#/components/schemas/BadRequestError"
  5823. }
  5824. }
  5825. }
  5826. },
  5827. "404": {
  5828. "description": "Not found",
  5829. "content": {
  5830. "application/json": {
  5831. "schema": {
  5832. "$ref": "#/components/schemas/NotFoundError"
  5833. }
  5834. }
  5835. }
  5836. }
  5837. },
  5838. "description": "Create and send a new message to a session asynchronously, starting the session if needed and returning immediately.",
  5839. "summary": "Send async message",
  5840. "requestBody": {
  5841. "content": {
  5842. "application/json": {
  5843. "schema": {
  5844. "type": "object",
  5845. "properties": {
  5846. "messageID": {
  5847. "type": "string"
  5848. },
  5849. "model": {
  5850. "type": "object",
  5851. "properties": {
  5852. "providerID": {
  5853. "type": "string"
  5854. },
  5855. "modelID": {
  5856. "type": "string"
  5857. }
  5858. },
  5859. "required": ["providerID", "modelID"],
  5860. "additionalProperties": false
  5861. },
  5862. "agent": {
  5863. "type": "string"
  5864. },
  5865. "noReply": {
  5866. "type": "boolean"
  5867. },
  5868. "tools": {
  5869. "type": "object",
  5870. "additionalProperties": {
  5871. "type": "boolean"
  5872. }
  5873. },
  5874. "format": {
  5875. "$ref": "#/components/schemas/OutputFormat"
  5876. },
  5877. "system": {
  5878. "type": "string"
  5879. },
  5880. "variant": {
  5881. "type": "string"
  5882. },
  5883. "parts": {
  5884. "type": "array",
  5885. "items": {
  5886. "anyOf": [
  5887. {
  5888. "$ref": "#/components/schemas/TextPartInput"
  5889. },
  5890. {
  5891. "$ref": "#/components/schemas/FilePartInput"
  5892. },
  5893. {
  5894. "$ref": "#/components/schemas/AgentPartInput"
  5895. },
  5896. {
  5897. "$ref": "#/components/schemas/SubtaskPartInput"
  5898. }
  5899. ]
  5900. }
  5901. }
  5902. },
  5903. "required": ["parts"],
  5904. "additionalProperties": false
  5905. }
  5906. }
  5907. }
  5908. },
  5909. "x-codeSamples": [
  5910. {
  5911. "lang": "js",
  5912. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.prompt_async({\n ...\n})"
  5913. }
  5914. ]
  5915. }
  5916. },
  5917. "/session/{sessionID}/command": {
  5918. "post": {
  5919. "tags": ["session"],
  5920. "operationId": "session.command",
  5921. "parameters": [
  5922. {
  5923. "name": "directory",
  5924. "in": "query",
  5925. "required": false,
  5926. "schema": {
  5927. "type": "string"
  5928. }
  5929. },
  5930. {
  5931. "name": "workspace",
  5932. "in": "query",
  5933. "required": false,
  5934. "schema": {
  5935. "type": "string"
  5936. }
  5937. },
  5938. {
  5939. "name": "sessionID",
  5940. "in": "path",
  5941. "schema": {
  5942. "type": "string",
  5943. "pattern": "^ses.*"
  5944. },
  5945. "required": true
  5946. }
  5947. ],
  5948. "responses": {
  5949. "200": {
  5950. "description": "Created message",
  5951. "content": {
  5952. "application/json": {
  5953. "schema": {
  5954. "type": "object",
  5955. "required": ["info", "parts"],
  5956. "properties": {
  5957. "info": {
  5958. "$ref": "#/components/schemas/AssistantMessage"
  5959. },
  5960. "parts": {
  5961. "type": "array",
  5962. "items": {
  5963. "$ref": "#/components/schemas/Part"
  5964. }
  5965. }
  5966. }
  5967. }
  5968. }
  5969. }
  5970. },
  5971. "400": {
  5972. "description": "Bad request",
  5973. "content": {
  5974. "application/json": {
  5975. "schema": {
  5976. "$ref": "#/components/schemas/BadRequestError"
  5977. }
  5978. }
  5979. }
  5980. },
  5981. "404": {
  5982. "description": "Not found",
  5983. "content": {
  5984. "application/json": {
  5985. "schema": {
  5986. "$ref": "#/components/schemas/NotFoundError"
  5987. }
  5988. }
  5989. }
  5990. }
  5991. },
  5992. "description": "Send a new command to a session for execution by the AI assistant.",
  5993. "summary": "Send command",
  5994. "requestBody": {
  5995. "content": {
  5996. "application/json": {
  5997. "schema": {
  5998. "type": "object",
  5999. "properties": {
  6000. "messageID": {
  6001. "type": "string"
  6002. },
  6003. "agent": {
  6004. "type": "string"
  6005. },
  6006. "model": {
  6007. "type": "string"
  6008. },
  6009. "arguments": {
  6010. "type": "string"
  6011. },
  6012. "command": {
  6013. "type": "string"
  6014. },
  6015. "variant": {
  6016. "type": "string"
  6017. },
  6018. "parts": {
  6019. "type": "array",
  6020. "items": {
  6021. "type": "object",
  6022. "properties": {
  6023. "id": {
  6024. "type": "string"
  6025. },
  6026. "type": {
  6027. "type": "string",
  6028. "enum": ["file"]
  6029. },
  6030. "mime": {
  6031. "type": "string"
  6032. },
  6033. "filename": {
  6034. "type": "string"
  6035. },
  6036. "url": {
  6037. "type": "string"
  6038. },
  6039. "source": {
  6040. "$ref": "#/components/schemas/FilePartSource"
  6041. }
  6042. },
  6043. "required": ["type", "mime", "url"],
  6044. "additionalProperties": false
  6045. }
  6046. }
  6047. },
  6048. "required": ["arguments", "command"],
  6049. "additionalProperties": false
  6050. }
  6051. }
  6052. }
  6053. },
  6054. "x-codeSamples": [
  6055. {
  6056. "lang": "js",
  6057. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.command({\n ...\n})"
  6058. }
  6059. ]
  6060. }
  6061. },
  6062. "/session/{sessionID}/shell": {
  6063. "post": {
  6064. "tags": ["session"],
  6065. "operationId": "session.shell",
  6066. "parameters": [
  6067. {
  6068. "name": "directory",
  6069. "in": "query",
  6070. "required": false,
  6071. "schema": {
  6072. "type": "string"
  6073. }
  6074. },
  6075. {
  6076. "name": "workspace",
  6077. "in": "query",
  6078. "required": false,
  6079. "schema": {
  6080. "type": "string"
  6081. }
  6082. },
  6083. {
  6084. "name": "sessionID",
  6085. "in": "path",
  6086. "schema": {
  6087. "type": "string",
  6088. "pattern": "^ses.*"
  6089. },
  6090. "required": true
  6091. }
  6092. ],
  6093. "responses": {
  6094. "200": {
  6095. "description": "Created message",
  6096. "content": {
  6097. "application/json": {
  6098. "schema": {
  6099. "type": "object",
  6100. "properties": {
  6101. "info": {
  6102. "$ref": "#/components/schemas/Message"
  6103. },
  6104. "parts": {
  6105. "type": "array",
  6106. "items": {
  6107. "$ref": "#/components/schemas/Part"
  6108. }
  6109. }
  6110. },
  6111. "required": ["info", "parts"],
  6112. "additionalProperties": false,
  6113. "description": "Created message"
  6114. }
  6115. }
  6116. }
  6117. },
  6118. "400": {
  6119. "description": "Bad request",
  6120. "content": {
  6121. "application/json": {
  6122. "schema": {
  6123. "$ref": "#/components/schemas/BadRequestError"
  6124. }
  6125. }
  6126. }
  6127. },
  6128. "404": {
  6129. "description": "Not found",
  6130. "content": {
  6131. "application/json": {
  6132. "schema": {
  6133. "$ref": "#/components/schemas/NotFoundError"
  6134. }
  6135. }
  6136. }
  6137. }
  6138. },
  6139. "description": "Execute a shell command within the session context and return the AI's response.",
  6140. "summary": "Run shell command",
  6141. "requestBody": {
  6142. "content": {
  6143. "application/json": {
  6144. "schema": {
  6145. "type": "object",
  6146. "properties": {
  6147. "messageID": {
  6148. "type": "string"
  6149. },
  6150. "agent": {
  6151. "type": "string"
  6152. },
  6153. "model": {
  6154. "type": "object",
  6155. "properties": {
  6156. "providerID": {
  6157. "type": "string"
  6158. },
  6159. "modelID": {
  6160. "type": "string"
  6161. }
  6162. },
  6163. "required": ["providerID", "modelID"],
  6164. "additionalProperties": false
  6165. },
  6166. "command": {
  6167. "type": "string"
  6168. }
  6169. },
  6170. "required": ["agent", "command"],
  6171. "additionalProperties": false
  6172. }
  6173. }
  6174. }
  6175. },
  6176. "x-codeSamples": [
  6177. {
  6178. "lang": "js",
  6179. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.shell({\n ...\n})"
  6180. }
  6181. ]
  6182. }
  6183. },
  6184. "/session/{sessionID}/revert": {
  6185. "post": {
  6186. "tags": ["session"],
  6187. "operationId": "session.revert",
  6188. "parameters": [
  6189. {
  6190. "name": "directory",
  6191. "in": "query",
  6192. "required": false,
  6193. "schema": {
  6194. "type": "string"
  6195. }
  6196. },
  6197. {
  6198. "name": "workspace",
  6199. "in": "query",
  6200. "required": false,
  6201. "schema": {
  6202. "type": "string"
  6203. }
  6204. },
  6205. {
  6206. "name": "sessionID",
  6207. "in": "path",
  6208. "schema": {
  6209. "type": "string",
  6210. "pattern": "^ses.*"
  6211. },
  6212. "required": true
  6213. }
  6214. ],
  6215. "responses": {
  6216. "200": {
  6217. "description": "Updated session",
  6218. "content": {
  6219. "application/json": {
  6220. "schema": {
  6221. "$ref": "#/components/schemas/Session"
  6222. }
  6223. }
  6224. }
  6225. },
  6226. "400": {
  6227. "description": "Bad request",
  6228. "content": {
  6229. "application/json": {
  6230. "schema": {
  6231. "$ref": "#/components/schemas/BadRequestError"
  6232. }
  6233. }
  6234. }
  6235. },
  6236. "404": {
  6237. "description": "Not found",
  6238. "content": {
  6239. "application/json": {
  6240. "schema": {
  6241. "$ref": "#/components/schemas/NotFoundError"
  6242. }
  6243. }
  6244. }
  6245. }
  6246. },
  6247. "description": "Revert a specific message in a session, undoing its effects and restoring the previous state.",
  6248. "summary": "Revert message",
  6249. "requestBody": {
  6250. "content": {
  6251. "application/json": {
  6252. "schema": {
  6253. "type": "object",
  6254. "properties": {
  6255. "messageID": {
  6256. "type": "string"
  6257. },
  6258. "partID": {
  6259. "type": "string"
  6260. }
  6261. },
  6262. "required": ["messageID"],
  6263. "additionalProperties": false
  6264. }
  6265. }
  6266. }
  6267. },
  6268. "x-codeSamples": [
  6269. {
  6270. "lang": "js",
  6271. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.revert({\n ...\n})"
  6272. }
  6273. ]
  6274. }
  6275. },
  6276. "/session/{sessionID}/unrevert": {
  6277. "post": {
  6278. "tags": ["session"],
  6279. "operationId": "session.unrevert",
  6280. "parameters": [
  6281. {
  6282. "name": "directory",
  6283. "in": "query",
  6284. "required": false,
  6285. "schema": {
  6286. "type": "string"
  6287. }
  6288. },
  6289. {
  6290. "name": "workspace",
  6291. "in": "query",
  6292. "required": false,
  6293. "schema": {
  6294. "type": "string"
  6295. }
  6296. },
  6297. {
  6298. "name": "sessionID",
  6299. "in": "path",
  6300. "schema": {
  6301. "type": "string",
  6302. "pattern": "^ses.*"
  6303. },
  6304. "required": true
  6305. }
  6306. ],
  6307. "responses": {
  6308. "200": {
  6309. "description": "Updated session",
  6310. "content": {
  6311. "application/json": {
  6312. "schema": {
  6313. "$ref": "#/components/schemas/Session"
  6314. }
  6315. }
  6316. }
  6317. },
  6318. "400": {
  6319. "description": "Bad request",
  6320. "content": {
  6321. "application/json": {
  6322. "schema": {
  6323. "$ref": "#/components/schemas/BadRequestError"
  6324. }
  6325. }
  6326. }
  6327. },
  6328. "404": {
  6329. "description": "Not found",
  6330. "content": {
  6331. "application/json": {
  6332. "schema": {
  6333. "$ref": "#/components/schemas/NotFoundError"
  6334. }
  6335. }
  6336. }
  6337. }
  6338. },
  6339. "description": "Restore all previously reverted messages in a session.",
  6340. "summary": "Restore reverted messages",
  6341. "x-codeSamples": [
  6342. {
  6343. "lang": "js",
  6344. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.unrevert({\n ...\n})"
  6345. }
  6346. ]
  6347. }
  6348. },
  6349. "/session/{sessionID}/permissions/{permissionID}": {
  6350. "post": {
  6351. "tags": ["session"],
  6352. "operationId": "permission.respond",
  6353. "parameters": [
  6354. {
  6355. "name": "directory",
  6356. "in": "query",
  6357. "required": false,
  6358. "schema": {
  6359. "type": "string"
  6360. }
  6361. },
  6362. {
  6363. "name": "workspace",
  6364. "in": "query",
  6365. "required": false,
  6366. "schema": {
  6367. "type": "string"
  6368. }
  6369. },
  6370. {
  6371. "name": "sessionID",
  6372. "in": "path",
  6373. "schema": {
  6374. "type": "string",
  6375. "pattern": "^ses.*"
  6376. },
  6377. "required": true
  6378. },
  6379. {
  6380. "name": "permissionID",
  6381. "in": "path",
  6382. "schema": {
  6383. "type": "string",
  6384. "pattern": "^per.*"
  6385. },
  6386. "required": true
  6387. }
  6388. ],
  6389. "responses": {
  6390. "200": {
  6391. "description": "Permission processed successfully",
  6392. "content": {
  6393. "application/json": {
  6394. "schema": {
  6395. "type": "boolean",
  6396. "description": "Permission processed successfully"
  6397. }
  6398. }
  6399. }
  6400. },
  6401. "400": {
  6402. "description": "Bad request",
  6403. "content": {
  6404. "application/json": {
  6405. "schema": {
  6406. "$ref": "#/components/schemas/BadRequestError"
  6407. }
  6408. }
  6409. }
  6410. },
  6411. "404": {
  6412. "description": "Not found",
  6413. "content": {
  6414. "application/json": {
  6415. "schema": {
  6416. "$ref": "#/components/schemas/NotFoundError"
  6417. }
  6418. }
  6419. }
  6420. }
  6421. },
  6422. "description": "Approve or deny a permission request from the AI assistant.",
  6423. "summary": "Respond to permission",
  6424. "deprecated": true,
  6425. "requestBody": {
  6426. "content": {
  6427. "application/json": {
  6428. "schema": {
  6429. "type": "object",
  6430. "properties": {
  6431. "response": {
  6432. "type": "string",
  6433. "enum": ["once", "always", "reject"]
  6434. }
  6435. },
  6436. "required": ["response"],
  6437. "additionalProperties": false
  6438. }
  6439. }
  6440. }
  6441. },
  6442. "x-codeSamples": [
  6443. {
  6444. "lang": "js",
  6445. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.permission.respond({\n ...\n})"
  6446. }
  6447. ]
  6448. }
  6449. },
  6450. "/session/{sessionID}/message/{messageID}/part/{partID}": {
  6451. "delete": {
  6452. "tags": ["session"],
  6453. "operationId": "part.delete",
  6454. "parameters": [
  6455. {
  6456. "name": "directory",
  6457. "in": "query",
  6458. "required": false,
  6459. "schema": {
  6460. "type": "string"
  6461. }
  6462. },
  6463. {
  6464. "name": "workspace",
  6465. "in": "query",
  6466. "required": false,
  6467. "schema": {
  6468. "type": "string"
  6469. }
  6470. },
  6471. {
  6472. "name": "sessionID",
  6473. "in": "path",
  6474. "schema": {
  6475. "type": "string",
  6476. "pattern": "^ses.*"
  6477. },
  6478. "required": true
  6479. },
  6480. {
  6481. "name": "messageID",
  6482. "in": "path",
  6483. "schema": {
  6484. "type": "string",
  6485. "pattern": "^msg.*"
  6486. },
  6487. "required": true
  6488. },
  6489. {
  6490. "name": "partID",
  6491. "in": "path",
  6492. "schema": {
  6493. "type": "string",
  6494. "pattern": "^prt.*"
  6495. },
  6496. "required": true
  6497. }
  6498. ],
  6499. "responses": {
  6500. "200": {
  6501. "description": "Successfully deleted part",
  6502. "content": {
  6503. "application/json": {
  6504. "schema": {
  6505. "type": "boolean",
  6506. "description": "Successfully deleted part"
  6507. }
  6508. }
  6509. }
  6510. },
  6511. "400": {
  6512. "description": "Bad request",
  6513. "content": {
  6514. "application/json": {
  6515. "schema": {
  6516. "$ref": "#/components/schemas/BadRequestError"
  6517. }
  6518. }
  6519. }
  6520. },
  6521. "404": {
  6522. "description": "Not found",
  6523. "content": {
  6524. "application/json": {
  6525. "schema": {
  6526. "$ref": "#/components/schemas/NotFoundError"
  6527. }
  6528. }
  6529. }
  6530. }
  6531. },
  6532. "description": "Delete a part from a message.",
  6533. "x-codeSamples": [
  6534. {
  6535. "lang": "js",
  6536. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.part.delete({\n ...\n})"
  6537. }
  6538. ]
  6539. },
  6540. "patch": {
  6541. "tags": ["session"],
  6542. "operationId": "part.update",
  6543. "parameters": [
  6544. {
  6545. "name": "directory",
  6546. "in": "query",
  6547. "required": false,
  6548. "schema": {
  6549. "type": "string"
  6550. }
  6551. },
  6552. {
  6553. "name": "workspace",
  6554. "in": "query",
  6555. "required": false,
  6556. "schema": {
  6557. "type": "string"
  6558. }
  6559. },
  6560. {
  6561. "name": "sessionID",
  6562. "in": "path",
  6563. "schema": {
  6564. "type": "string",
  6565. "pattern": "^ses.*"
  6566. },
  6567. "required": true
  6568. },
  6569. {
  6570. "name": "messageID",
  6571. "in": "path",
  6572. "schema": {
  6573. "type": "string",
  6574. "pattern": "^msg.*"
  6575. },
  6576. "required": true
  6577. },
  6578. {
  6579. "name": "partID",
  6580. "in": "path",
  6581. "schema": {
  6582. "type": "string",
  6583. "pattern": "^prt.*"
  6584. },
  6585. "required": true
  6586. }
  6587. ],
  6588. "responses": {
  6589. "200": {
  6590. "description": "Successfully updated part",
  6591. "content": {
  6592. "application/json": {
  6593. "schema": {
  6594. "$ref": "#/components/schemas/Part"
  6595. }
  6596. }
  6597. }
  6598. },
  6599. "400": {
  6600. "description": "Bad request",
  6601. "content": {
  6602. "application/json": {
  6603. "schema": {
  6604. "$ref": "#/components/schemas/BadRequestError"
  6605. }
  6606. }
  6607. }
  6608. },
  6609. "404": {
  6610. "description": "Not found",
  6611. "content": {
  6612. "application/json": {
  6613. "schema": {
  6614. "$ref": "#/components/schemas/NotFoundError"
  6615. }
  6616. }
  6617. }
  6618. }
  6619. },
  6620. "description": "Update a part in a message.",
  6621. "requestBody": {
  6622. "content": {
  6623. "application/json": {
  6624. "schema": {
  6625. "$ref": "#/components/schemas/Part"
  6626. }
  6627. }
  6628. }
  6629. },
  6630. "x-codeSamples": [
  6631. {
  6632. "lang": "js",
  6633. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.part.update({\n ...\n})"
  6634. }
  6635. ]
  6636. }
  6637. },
  6638. "/sync/start": {
  6639. "post": {
  6640. "tags": ["sync"],
  6641. "operationId": "sync.start",
  6642. "parameters": [
  6643. {
  6644. "name": "directory",
  6645. "in": "query",
  6646. "required": false,
  6647. "schema": {
  6648. "type": "string"
  6649. }
  6650. },
  6651. {
  6652. "name": "workspace",
  6653. "in": "query",
  6654. "required": false,
  6655. "schema": {
  6656. "type": "string"
  6657. }
  6658. }
  6659. ],
  6660. "responses": {
  6661. "200": {
  6662. "description": "Workspace sync started",
  6663. "content": {
  6664. "application/json": {
  6665. "schema": {
  6666. "type": "boolean",
  6667. "description": "Workspace sync started"
  6668. }
  6669. }
  6670. }
  6671. }
  6672. },
  6673. "description": "Start sync loops for workspaces in the current project that have active sessions.",
  6674. "summary": "Start workspace sync",
  6675. "x-codeSamples": [
  6676. {
  6677. "lang": "js",
  6678. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.sync.start({\n ...\n})"
  6679. }
  6680. ]
  6681. }
  6682. },
  6683. "/sync/replay": {
  6684. "post": {
  6685. "tags": ["sync"],
  6686. "operationId": "sync.replay",
  6687. "parameters": [
  6688. {
  6689. "name": "directory",
  6690. "in": "query",
  6691. "required": false,
  6692. "schema": {
  6693. "type": "string"
  6694. }
  6695. },
  6696. {
  6697. "name": "workspace",
  6698. "in": "query",
  6699. "required": false,
  6700. "schema": {
  6701. "type": "string"
  6702. }
  6703. }
  6704. ],
  6705. "responses": {
  6706. "200": {
  6707. "description": "Replayed sync events",
  6708. "content": {
  6709. "application/json": {
  6710. "schema": {
  6711. "type": "object",
  6712. "properties": {
  6713. "sessionID": {
  6714. "type": "string"
  6715. }
  6716. },
  6717. "required": ["sessionID"],
  6718. "additionalProperties": false,
  6719. "description": "Replayed sync events"
  6720. }
  6721. }
  6722. }
  6723. },
  6724. "400": {
  6725. "description": "Bad request",
  6726. "content": {
  6727. "application/json": {
  6728. "schema": {
  6729. "$ref": "#/components/schemas/BadRequestError"
  6730. }
  6731. }
  6732. }
  6733. }
  6734. },
  6735. "description": "Validate and replay a complete sync event history.",
  6736. "summary": "Replay sync events",
  6737. "requestBody": {
  6738. "content": {
  6739. "application/json": {
  6740. "schema": {
  6741. "type": "object",
  6742. "properties": {
  6743. "directory": {
  6744. "type": "string"
  6745. },
  6746. "events": {
  6747. "type": "array",
  6748. "minItems": 1,
  6749. "items": {
  6750. "type": "object",
  6751. "properties": {
  6752. "id": {
  6753. "type": "string"
  6754. },
  6755. "aggregateID": {
  6756. "type": "string"
  6757. },
  6758. "seq": {
  6759. "type": "integer",
  6760. "minimum": 0
  6761. },
  6762. "type": {
  6763. "type": "string"
  6764. },
  6765. "data": {
  6766. "type": "object"
  6767. }
  6768. },
  6769. "required": ["id", "aggregateID", "seq", "type", "data"],
  6770. "additionalProperties": false
  6771. }
  6772. }
  6773. },
  6774. "required": ["directory", "events"],
  6775. "additionalProperties": false
  6776. }
  6777. }
  6778. }
  6779. },
  6780. "x-codeSamples": [
  6781. {
  6782. "lang": "js",
  6783. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.sync.replay({\n ...\n})"
  6784. }
  6785. ]
  6786. }
  6787. },
  6788. "/sync/steal": {
  6789. "post": {
  6790. "tags": ["sync"],
  6791. "operationId": "sync.steal",
  6792. "parameters": [
  6793. {
  6794. "name": "directory",
  6795. "in": "query",
  6796. "required": false,
  6797. "schema": {
  6798. "type": "string"
  6799. }
  6800. },
  6801. {
  6802. "name": "workspace",
  6803. "in": "query",
  6804. "required": false,
  6805. "schema": {
  6806. "type": "string"
  6807. }
  6808. }
  6809. ],
  6810. "responses": {
  6811. "200": {
  6812. "description": "Session stolen into workspace",
  6813. "content": {
  6814. "application/json": {
  6815. "schema": {
  6816. "type": "object",
  6817. "properties": {
  6818. "sessionID": {
  6819. "type": "string"
  6820. }
  6821. },
  6822. "required": ["sessionID"],
  6823. "additionalProperties": false,
  6824. "description": "Session stolen into workspace"
  6825. }
  6826. }
  6827. }
  6828. },
  6829. "400": {
  6830. "description": "Bad request",
  6831. "content": {
  6832. "application/json": {
  6833. "schema": {
  6834. "$ref": "#/components/schemas/BadRequestError"
  6835. }
  6836. }
  6837. }
  6838. }
  6839. },
  6840. "description": "Update a session to belong to the current workspace through the sync event system.",
  6841. "summary": "Steal session into workspace",
  6842. "requestBody": {
  6843. "content": {
  6844. "application/json": {
  6845. "schema": {
  6846. "type": "object",
  6847. "properties": {
  6848. "sessionID": {
  6849. "type": "string"
  6850. }
  6851. },
  6852. "required": ["sessionID"],
  6853. "additionalProperties": false
  6854. }
  6855. }
  6856. }
  6857. },
  6858. "x-codeSamples": [
  6859. {
  6860. "lang": "js",
  6861. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.sync.steal({\n ...\n})"
  6862. }
  6863. ]
  6864. }
  6865. },
  6866. "/sync/history": {
  6867. "post": {
  6868. "tags": ["sync"],
  6869. "operationId": "sync.history.list",
  6870. "parameters": [
  6871. {
  6872. "name": "directory",
  6873. "in": "query",
  6874. "required": false,
  6875. "schema": {
  6876. "type": "string"
  6877. }
  6878. },
  6879. {
  6880. "name": "workspace",
  6881. "in": "query",
  6882. "required": false,
  6883. "schema": {
  6884. "type": "string"
  6885. }
  6886. }
  6887. ],
  6888. "responses": {
  6889. "200": {
  6890. "description": "Sync events",
  6891. "content": {
  6892. "application/json": {
  6893. "schema": {
  6894. "type": "array",
  6895. "items": {
  6896. "type": "object",
  6897. "properties": {
  6898. "id": {
  6899. "type": "string"
  6900. },
  6901. "aggregate_id": {
  6902. "type": "string"
  6903. },
  6904. "seq": {
  6905. "type": "integer",
  6906. "minimum": 0
  6907. },
  6908. "type": {
  6909. "type": "string"
  6910. },
  6911. "data": {
  6912. "type": "object"
  6913. }
  6914. },
  6915. "required": ["id", "aggregate_id", "seq", "type", "data"],
  6916. "additionalProperties": false
  6917. },
  6918. "description": "Sync events"
  6919. }
  6920. }
  6921. }
  6922. },
  6923. "400": {
  6924. "description": "Bad request",
  6925. "content": {
  6926. "application/json": {
  6927. "schema": {
  6928. "$ref": "#/components/schemas/BadRequestError"
  6929. }
  6930. }
  6931. }
  6932. }
  6933. },
  6934. "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.",
  6935. "summary": "List sync events",
  6936. "requestBody": {
  6937. "content": {
  6938. "application/json": {
  6939. "schema": {
  6940. "type": "object",
  6941. "additionalProperties": {
  6942. "type": "integer",
  6943. "minimum": 0
  6944. }
  6945. }
  6946. }
  6947. }
  6948. },
  6949. "x-codeSamples": [
  6950. {
  6951. "lang": "js",
  6952. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.sync.history.list({\n ...\n})"
  6953. }
  6954. ]
  6955. }
  6956. },
  6957. "/api/session": {
  6958. "get": {
  6959. "tags": ["v2"],
  6960. "operationId": "v2.session.list",
  6961. "parameters": [
  6962. {
  6963. "name": "directory",
  6964. "in": "query",
  6965. "required": false,
  6966. "schema": {
  6967. "type": "string"
  6968. }
  6969. },
  6970. {
  6971. "name": "workspace",
  6972. "in": "query",
  6973. "required": false,
  6974. "schema": {
  6975. "type": "string"
  6976. }
  6977. }
  6978. ],
  6979. "responses": {
  6980. "200": {
  6981. "description": "V2SessionsResponse",
  6982. "content": {
  6983. "application/json": {
  6984. "schema": {
  6985. "$ref": "#/components/schemas/V2SessionsResponse"
  6986. }
  6987. }
  6988. }
  6989. },
  6990. "400": {
  6991. "description": "Bad request",
  6992. "content": {
  6993. "application/json": {
  6994. "schema": {
  6995. "$ref": "#/components/schemas/BadRequestError"
  6996. }
  6997. }
  6998. }
  6999. }
  7000. },
  7001. "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.",
  7002. "summary": "List v2 sessions",
  7003. "x-codeSamples": [
  7004. {
  7005. "lang": "js",
  7006. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.list({\n ...\n})"
  7007. }
  7008. ]
  7009. }
  7010. },
  7011. "/api/session/{sessionID}/prompt": {
  7012. "post": {
  7013. "tags": ["v2"],
  7014. "operationId": "v2.session.prompt",
  7015. "parameters": [
  7016. {
  7017. "name": "directory",
  7018. "in": "query",
  7019. "required": false,
  7020. "schema": {
  7021. "type": "string"
  7022. }
  7023. },
  7024. {
  7025. "name": "workspace",
  7026. "in": "query",
  7027. "required": false,
  7028. "schema": {
  7029. "type": "string"
  7030. }
  7031. },
  7032. {
  7033. "name": "sessionID",
  7034. "in": "path",
  7035. "schema": {
  7036. "type": "string",
  7037. "pattern": "^ses.*"
  7038. },
  7039. "required": true
  7040. }
  7041. ],
  7042. "responses": {
  7043. "200": {
  7044. "description": "Session.Message",
  7045. "content": {
  7046. "application/json": {
  7047. "schema": {
  7048. "$ref": "#/components/schemas/SessionMessage"
  7049. }
  7050. }
  7051. }
  7052. }
  7053. },
  7054. "description": "Create a v2 session message and queue it for the agent loop.",
  7055. "summary": "Send v2 message",
  7056. "requestBody": {
  7057. "content": {
  7058. "application/json": {
  7059. "schema": {
  7060. "type": "object",
  7061. "properties": {
  7062. "prompt": {
  7063. "$ref": "#/components/schemas/Prompt"
  7064. },
  7065. "delivery": {
  7066. "$ref": "#/components/schemas/SessionDelivery"
  7067. }
  7068. },
  7069. "required": ["prompt"],
  7070. "additionalProperties": false
  7071. }
  7072. }
  7073. }
  7074. },
  7075. "x-codeSamples": [
  7076. {
  7077. "lang": "js",
  7078. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.prompt({\n ...\n})"
  7079. }
  7080. ]
  7081. }
  7082. },
  7083. "/api/session/{sessionID}/compact": {
  7084. "post": {
  7085. "tags": ["v2"],
  7086. "operationId": "v2.session.compact",
  7087. "parameters": [
  7088. {
  7089. "name": "directory",
  7090. "in": "query",
  7091. "required": false,
  7092. "schema": {
  7093. "type": "string"
  7094. }
  7095. },
  7096. {
  7097. "name": "workspace",
  7098. "in": "query",
  7099. "required": false,
  7100. "schema": {
  7101. "type": "string"
  7102. }
  7103. },
  7104. {
  7105. "name": "sessionID",
  7106. "in": "path",
  7107. "schema": {
  7108. "type": "string",
  7109. "pattern": "^ses.*"
  7110. },
  7111. "required": true
  7112. }
  7113. ],
  7114. "responses": {
  7115. "204": {
  7116. "description": "<No Content>"
  7117. }
  7118. },
  7119. "description": "Compact a v2 session conversation.",
  7120. "summary": "Compact v2 session",
  7121. "x-codeSamples": [
  7122. {
  7123. "lang": "js",
  7124. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.compact({\n ...\n})"
  7125. }
  7126. ]
  7127. }
  7128. },
  7129. "/api/session/{sessionID}/wait": {
  7130. "post": {
  7131. "tags": ["v2"],
  7132. "operationId": "v2.session.wait",
  7133. "parameters": [
  7134. {
  7135. "name": "directory",
  7136. "in": "query",
  7137. "required": false,
  7138. "schema": {
  7139. "type": "string"
  7140. }
  7141. },
  7142. {
  7143. "name": "workspace",
  7144. "in": "query",
  7145. "required": false,
  7146. "schema": {
  7147. "type": "string"
  7148. }
  7149. },
  7150. {
  7151. "name": "sessionID",
  7152. "in": "path",
  7153. "schema": {
  7154. "type": "string",
  7155. "pattern": "^ses.*"
  7156. },
  7157. "required": true
  7158. }
  7159. ],
  7160. "responses": {
  7161. "204": {
  7162. "description": "<No Content>"
  7163. }
  7164. },
  7165. "description": "Wait for a v2 session agent loop to become idle.",
  7166. "summary": "Wait for v2 session",
  7167. "x-codeSamples": [
  7168. {
  7169. "lang": "js",
  7170. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.wait({\n ...\n})"
  7171. }
  7172. ]
  7173. }
  7174. },
  7175. "/api/session/{sessionID}/context": {
  7176. "get": {
  7177. "tags": ["v2"],
  7178. "operationId": "v2.session.context",
  7179. "parameters": [
  7180. {
  7181. "name": "directory",
  7182. "in": "query",
  7183. "required": false,
  7184. "schema": {
  7185. "type": "string"
  7186. }
  7187. },
  7188. {
  7189. "name": "workspace",
  7190. "in": "query",
  7191. "required": false,
  7192. "schema": {
  7193. "type": "string"
  7194. }
  7195. },
  7196. {
  7197. "name": "sessionID",
  7198. "in": "path",
  7199. "schema": {
  7200. "type": "string",
  7201. "pattern": "^ses.*"
  7202. },
  7203. "required": true
  7204. }
  7205. ],
  7206. "responses": {
  7207. "200": {
  7208. "description": "Success",
  7209. "content": {
  7210. "application/json": {
  7211. "schema": {
  7212. "type": "array",
  7213. "items": {
  7214. "$ref": "#/components/schemas/SessionMessage"
  7215. }
  7216. }
  7217. }
  7218. }
  7219. }
  7220. },
  7221. "description": "Retrieve the active context messages for a v2 session (all messages after the last compaction).",
  7222. "summary": "Get v2 session context",
  7223. "x-codeSamples": [
  7224. {
  7225. "lang": "js",
  7226. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.context({\n ...\n})"
  7227. }
  7228. ]
  7229. }
  7230. },
  7231. "/api/session/{sessionID}/message": {
  7232. "get": {
  7233. "tags": ["v2 messages"],
  7234. "operationId": "v2.session.messages",
  7235. "parameters": [
  7236. {
  7237. "name": "directory",
  7238. "in": "query",
  7239. "required": false,
  7240. "schema": {
  7241. "type": "string"
  7242. }
  7243. },
  7244. {
  7245. "name": "workspace",
  7246. "in": "query",
  7247. "required": false,
  7248. "schema": {
  7249. "type": "string"
  7250. }
  7251. },
  7252. {
  7253. "name": "sessionID",
  7254. "in": "path",
  7255. "schema": {
  7256. "type": "string",
  7257. "pattern": "^ses.*"
  7258. },
  7259. "required": true
  7260. }
  7261. ],
  7262. "responses": {
  7263. "200": {
  7264. "description": "V2SessionMessagesResponse",
  7265. "content": {
  7266. "application/json": {
  7267. "schema": {
  7268. "$ref": "#/components/schemas/V2SessionMessagesResponse"
  7269. }
  7270. }
  7271. }
  7272. },
  7273. "400": {
  7274. "description": "Bad request",
  7275. "content": {
  7276. "application/json": {
  7277. "schema": {
  7278. "$ref": "#/components/schemas/BadRequestError"
  7279. }
  7280. }
  7281. }
  7282. }
  7283. },
  7284. "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.",
  7285. "summary": "Get v2 session messages",
  7286. "x-codeSamples": [
  7287. {
  7288. "lang": "js",
  7289. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.messages({\n ...\n})"
  7290. }
  7291. ]
  7292. }
  7293. },
  7294. "/tui/append-prompt": {
  7295. "post": {
  7296. "tags": ["tui"],
  7297. "operationId": "tui.appendPrompt",
  7298. "parameters": [
  7299. {
  7300. "name": "directory",
  7301. "in": "query",
  7302. "required": false,
  7303. "schema": {
  7304. "type": "string"
  7305. }
  7306. },
  7307. {
  7308. "name": "workspace",
  7309. "in": "query",
  7310. "required": false,
  7311. "schema": {
  7312. "type": "string"
  7313. }
  7314. }
  7315. ],
  7316. "responses": {
  7317. "200": {
  7318. "description": "Prompt processed successfully",
  7319. "content": {
  7320. "application/json": {
  7321. "schema": {
  7322. "type": "boolean",
  7323. "description": "Prompt processed successfully"
  7324. }
  7325. }
  7326. }
  7327. },
  7328. "400": {
  7329. "description": "Bad request",
  7330. "content": {
  7331. "application/json": {
  7332. "schema": {
  7333. "$ref": "#/components/schemas/BadRequestError"
  7334. }
  7335. }
  7336. }
  7337. }
  7338. },
  7339. "description": "Append prompt to the TUI.",
  7340. "summary": "Append TUI prompt",
  7341. "requestBody": {
  7342. "content": {
  7343. "application/json": {
  7344. "schema": {
  7345. "type": "object",
  7346. "properties": {
  7347. "text": {
  7348. "type": "string"
  7349. }
  7350. },
  7351. "required": ["text"],
  7352. "additionalProperties": false
  7353. }
  7354. }
  7355. }
  7356. },
  7357. "x-codeSamples": [
  7358. {
  7359. "lang": "js",
  7360. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.appendPrompt({\n ...\n})"
  7361. }
  7362. ]
  7363. }
  7364. },
  7365. "/tui/open-help": {
  7366. "post": {
  7367. "tags": ["tui"],
  7368. "operationId": "tui.openHelp",
  7369. "parameters": [
  7370. {
  7371. "name": "directory",
  7372. "in": "query",
  7373. "required": false,
  7374. "schema": {
  7375. "type": "string"
  7376. }
  7377. },
  7378. {
  7379. "name": "workspace",
  7380. "in": "query",
  7381. "required": false,
  7382. "schema": {
  7383. "type": "string"
  7384. }
  7385. }
  7386. ],
  7387. "responses": {
  7388. "200": {
  7389. "description": "Help dialog opened successfully",
  7390. "content": {
  7391. "application/json": {
  7392. "schema": {
  7393. "type": "boolean",
  7394. "description": "Help dialog opened successfully"
  7395. }
  7396. }
  7397. }
  7398. }
  7399. },
  7400. "description": "Open the help dialog in the TUI to display user assistance information.",
  7401. "summary": "Open help dialog",
  7402. "x-codeSamples": [
  7403. {
  7404. "lang": "js",
  7405. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openHelp({\n ...\n})"
  7406. }
  7407. ]
  7408. }
  7409. },
  7410. "/tui/open-sessions": {
  7411. "post": {
  7412. "tags": ["tui"],
  7413. "operationId": "tui.openSessions",
  7414. "parameters": [
  7415. {
  7416. "name": "directory",
  7417. "in": "query",
  7418. "required": false,
  7419. "schema": {
  7420. "type": "string"
  7421. }
  7422. },
  7423. {
  7424. "name": "workspace",
  7425. "in": "query",
  7426. "required": false,
  7427. "schema": {
  7428. "type": "string"
  7429. }
  7430. }
  7431. ],
  7432. "responses": {
  7433. "200": {
  7434. "description": "Session dialog opened successfully",
  7435. "content": {
  7436. "application/json": {
  7437. "schema": {
  7438. "type": "boolean",
  7439. "description": "Session dialog opened successfully"
  7440. }
  7441. }
  7442. }
  7443. }
  7444. },
  7445. "description": "Open the session dialog.",
  7446. "summary": "Open sessions dialog",
  7447. "x-codeSamples": [
  7448. {
  7449. "lang": "js",
  7450. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openSessions({\n ...\n})"
  7451. }
  7452. ]
  7453. }
  7454. },
  7455. "/tui/open-themes": {
  7456. "post": {
  7457. "tags": ["tui"],
  7458. "operationId": "tui.openThemes",
  7459. "parameters": [
  7460. {
  7461. "name": "directory",
  7462. "in": "query",
  7463. "required": false,
  7464. "schema": {
  7465. "type": "string"
  7466. }
  7467. },
  7468. {
  7469. "name": "workspace",
  7470. "in": "query",
  7471. "required": false,
  7472. "schema": {
  7473. "type": "string"
  7474. }
  7475. }
  7476. ],
  7477. "responses": {
  7478. "200": {
  7479. "description": "Theme dialog opened successfully",
  7480. "content": {
  7481. "application/json": {
  7482. "schema": {
  7483. "type": "boolean",
  7484. "description": "Theme dialog opened successfully"
  7485. }
  7486. }
  7487. }
  7488. }
  7489. },
  7490. "description": "Open the theme dialog.",
  7491. "summary": "Open themes dialog",
  7492. "x-codeSamples": [
  7493. {
  7494. "lang": "js",
  7495. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openThemes({\n ...\n})"
  7496. }
  7497. ]
  7498. }
  7499. },
  7500. "/tui/open-models": {
  7501. "post": {
  7502. "tags": ["tui"],
  7503. "operationId": "tui.openModels",
  7504. "parameters": [
  7505. {
  7506. "name": "directory",
  7507. "in": "query",
  7508. "required": false,
  7509. "schema": {
  7510. "type": "string"
  7511. }
  7512. },
  7513. {
  7514. "name": "workspace",
  7515. "in": "query",
  7516. "required": false,
  7517. "schema": {
  7518. "type": "string"
  7519. }
  7520. }
  7521. ],
  7522. "responses": {
  7523. "200": {
  7524. "description": "Model dialog opened successfully",
  7525. "content": {
  7526. "application/json": {
  7527. "schema": {
  7528. "type": "boolean",
  7529. "description": "Model dialog opened successfully"
  7530. }
  7531. }
  7532. }
  7533. }
  7534. },
  7535. "description": "Open the model dialog.",
  7536. "summary": "Open models dialog",
  7537. "x-codeSamples": [
  7538. {
  7539. "lang": "js",
  7540. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openModels({\n ...\n})"
  7541. }
  7542. ]
  7543. }
  7544. },
  7545. "/tui/submit-prompt": {
  7546. "post": {
  7547. "tags": ["tui"],
  7548. "operationId": "tui.submitPrompt",
  7549. "parameters": [
  7550. {
  7551. "name": "directory",
  7552. "in": "query",
  7553. "required": false,
  7554. "schema": {
  7555. "type": "string"
  7556. }
  7557. },
  7558. {
  7559. "name": "workspace",
  7560. "in": "query",
  7561. "required": false,
  7562. "schema": {
  7563. "type": "string"
  7564. }
  7565. }
  7566. ],
  7567. "responses": {
  7568. "200": {
  7569. "description": "Prompt submitted successfully",
  7570. "content": {
  7571. "application/json": {
  7572. "schema": {
  7573. "type": "boolean",
  7574. "description": "Prompt submitted successfully"
  7575. }
  7576. }
  7577. }
  7578. }
  7579. },
  7580. "description": "Submit the prompt.",
  7581. "summary": "Submit TUI prompt",
  7582. "x-codeSamples": [
  7583. {
  7584. "lang": "js",
  7585. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.submitPrompt({\n ...\n})"
  7586. }
  7587. ]
  7588. }
  7589. },
  7590. "/tui/clear-prompt": {
  7591. "post": {
  7592. "tags": ["tui"],
  7593. "operationId": "tui.clearPrompt",
  7594. "parameters": [
  7595. {
  7596. "name": "directory",
  7597. "in": "query",
  7598. "required": false,
  7599. "schema": {
  7600. "type": "string"
  7601. }
  7602. },
  7603. {
  7604. "name": "workspace",
  7605. "in": "query",
  7606. "required": false,
  7607. "schema": {
  7608. "type": "string"
  7609. }
  7610. }
  7611. ],
  7612. "responses": {
  7613. "200": {
  7614. "description": "Prompt cleared successfully",
  7615. "content": {
  7616. "application/json": {
  7617. "schema": {
  7618. "type": "boolean",
  7619. "description": "Prompt cleared successfully"
  7620. }
  7621. }
  7622. }
  7623. }
  7624. },
  7625. "description": "Clear the prompt.",
  7626. "summary": "Clear TUI prompt",
  7627. "x-codeSamples": [
  7628. {
  7629. "lang": "js",
  7630. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.clearPrompt({\n ...\n})"
  7631. }
  7632. ]
  7633. }
  7634. },
  7635. "/tui/execute-command": {
  7636. "post": {
  7637. "tags": ["tui"],
  7638. "operationId": "tui.executeCommand",
  7639. "parameters": [
  7640. {
  7641. "name": "directory",
  7642. "in": "query",
  7643. "required": false,
  7644. "schema": {
  7645. "type": "string"
  7646. }
  7647. },
  7648. {
  7649. "name": "workspace",
  7650. "in": "query",
  7651. "required": false,
  7652. "schema": {
  7653. "type": "string"
  7654. }
  7655. }
  7656. ],
  7657. "responses": {
  7658. "200": {
  7659. "description": "Command executed successfully",
  7660. "content": {
  7661. "application/json": {
  7662. "schema": {
  7663. "type": "boolean",
  7664. "description": "Command executed successfully"
  7665. }
  7666. }
  7667. }
  7668. },
  7669. "400": {
  7670. "description": "Bad request",
  7671. "content": {
  7672. "application/json": {
  7673. "schema": {
  7674. "$ref": "#/components/schemas/BadRequestError"
  7675. }
  7676. }
  7677. }
  7678. }
  7679. },
  7680. "description": "Execute a TUI command.",
  7681. "summary": "Execute TUI command",
  7682. "requestBody": {
  7683. "content": {
  7684. "application/json": {
  7685. "schema": {
  7686. "type": "object",
  7687. "properties": {
  7688. "command": {
  7689. "type": "string"
  7690. }
  7691. },
  7692. "required": ["command"],
  7693. "additionalProperties": false
  7694. }
  7695. }
  7696. }
  7697. },
  7698. "x-codeSamples": [
  7699. {
  7700. "lang": "js",
  7701. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.executeCommand({\n ...\n})"
  7702. }
  7703. ]
  7704. }
  7705. },
  7706. "/tui/show-toast": {
  7707. "post": {
  7708. "tags": ["tui"],
  7709. "operationId": "tui.showToast",
  7710. "parameters": [
  7711. {
  7712. "name": "directory",
  7713. "in": "query",
  7714. "required": false,
  7715. "schema": {
  7716. "type": "string"
  7717. }
  7718. },
  7719. {
  7720. "name": "workspace",
  7721. "in": "query",
  7722. "required": false,
  7723. "schema": {
  7724. "type": "string"
  7725. }
  7726. }
  7727. ],
  7728. "responses": {
  7729. "200": {
  7730. "description": "Toast notification shown successfully",
  7731. "content": {
  7732. "application/json": {
  7733. "schema": {
  7734. "type": "boolean",
  7735. "description": "Toast notification shown successfully"
  7736. }
  7737. }
  7738. }
  7739. }
  7740. },
  7741. "description": "Show a toast notification in the TUI.",
  7742. "summary": "Show TUI toast",
  7743. "requestBody": {
  7744. "content": {
  7745. "application/json": {
  7746. "schema": {
  7747. "type": "object",
  7748. "properties": {
  7749. "title": {
  7750. "type": "string"
  7751. },
  7752. "message": {
  7753. "type": "string"
  7754. },
  7755. "variant": {
  7756. "type": "string",
  7757. "enum": ["info", "success", "warning", "error"]
  7758. },
  7759. "duration": {
  7760. "type": "integer",
  7761. "exclusiveMinimum": 0
  7762. }
  7763. },
  7764. "required": ["message", "variant"],
  7765. "additionalProperties": false
  7766. }
  7767. }
  7768. }
  7769. },
  7770. "x-codeSamples": [
  7771. {
  7772. "lang": "js",
  7773. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.showToast({\n ...\n})"
  7774. }
  7775. ]
  7776. }
  7777. },
  7778. "/tui/publish": {
  7779. "post": {
  7780. "tags": ["tui"],
  7781. "operationId": "tui.publish",
  7782. "parameters": [
  7783. {
  7784. "name": "directory",
  7785. "in": "query",
  7786. "required": false,
  7787. "schema": {
  7788. "type": "string"
  7789. }
  7790. },
  7791. {
  7792. "name": "workspace",
  7793. "in": "query",
  7794. "required": false,
  7795. "schema": {
  7796. "type": "string"
  7797. }
  7798. }
  7799. ],
  7800. "responses": {
  7801. "200": {
  7802. "description": "Event published successfully",
  7803. "content": {
  7804. "application/json": {
  7805. "schema": {
  7806. "type": "boolean",
  7807. "description": "Event published successfully"
  7808. }
  7809. }
  7810. }
  7811. },
  7812. "400": {
  7813. "description": "Bad request",
  7814. "content": {
  7815. "application/json": {
  7816. "schema": {
  7817. "$ref": "#/components/schemas/BadRequestError"
  7818. }
  7819. }
  7820. }
  7821. }
  7822. },
  7823. "description": "Publish a TUI event.",
  7824. "summary": "Publish TUI event",
  7825. "requestBody": {
  7826. "content": {
  7827. "application/json": {
  7828. "schema": {
  7829. "anyOf": [
  7830. {
  7831. "$ref": "#/components/schemas/EventTuiPromptAppend"
  7832. },
  7833. {
  7834. "$ref": "#/components/schemas/EventTuiCommandExecute"
  7835. },
  7836. {
  7837. "$ref": "#/components/schemas/EventTuiToastShow"
  7838. },
  7839. {
  7840. "$ref": "#/components/schemas/EventTuiSessionSelect"
  7841. }
  7842. ]
  7843. }
  7844. }
  7845. }
  7846. },
  7847. "x-codeSamples": [
  7848. {
  7849. "lang": "js",
  7850. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.publish({\n ...\n})"
  7851. }
  7852. ]
  7853. }
  7854. },
  7855. "/tui/select-session": {
  7856. "post": {
  7857. "tags": ["tui"],
  7858. "operationId": "tui.selectSession",
  7859. "parameters": [
  7860. {
  7861. "name": "directory",
  7862. "in": "query",
  7863. "required": false,
  7864. "schema": {
  7865. "type": "string"
  7866. }
  7867. },
  7868. {
  7869. "name": "workspace",
  7870. "in": "query",
  7871. "required": false,
  7872. "schema": {
  7873. "type": "string"
  7874. }
  7875. }
  7876. ],
  7877. "responses": {
  7878. "200": {
  7879. "description": "Session selected successfully",
  7880. "content": {
  7881. "application/json": {
  7882. "schema": {
  7883. "type": "boolean",
  7884. "description": "Session selected successfully"
  7885. }
  7886. }
  7887. }
  7888. },
  7889. "400": {
  7890. "description": "Bad request",
  7891. "content": {
  7892. "application/json": {
  7893. "schema": {
  7894. "$ref": "#/components/schemas/BadRequestError"
  7895. }
  7896. }
  7897. }
  7898. },
  7899. "404": {
  7900. "description": "Not found",
  7901. "content": {
  7902. "application/json": {
  7903. "schema": {
  7904. "$ref": "#/components/schemas/NotFoundError"
  7905. }
  7906. }
  7907. }
  7908. }
  7909. },
  7910. "description": "Navigate the TUI to display the specified session.",
  7911. "summary": "Select session",
  7912. "requestBody": {
  7913. "content": {
  7914. "application/json": {
  7915. "schema": {
  7916. "type": "object",
  7917. "properties": {
  7918. "sessionID": {
  7919. "type": "string",
  7920. "description": "Session ID to navigate to"
  7921. }
  7922. },
  7923. "required": ["sessionID"],
  7924. "additionalProperties": false
  7925. }
  7926. }
  7927. }
  7928. },
  7929. "x-codeSamples": [
  7930. {
  7931. "lang": "js",
  7932. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.selectSession({\n ...\n})"
  7933. }
  7934. ]
  7935. }
  7936. },
  7937. "/tui/control/next": {
  7938. "get": {
  7939. "tags": ["tui"],
  7940. "operationId": "tui.control.next",
  7941. "parameters": [
  7942. {
  7943. "name": "directory",
  7944. "in": "query",
  7945. "required": false,
  7946. "schema": {
  7947. "type": "string"
  7948. }
  7949. },
  7950. {
  7951. "name": "workspace",
  7952. "in": "query",
  7953. "required": false,
  7954. "schema": {
  7955. "type": "string"
  7956. }
  7957. }
  7958. ],
  7959. "responses": {
  7960. "200": {
  7961. "description": "Next TUI request",
  7962. "content": {
  7963. "application/json": {
  7964. "schema": {
  7965. "type": "object",
  7966. "properties": {
  7967. "path": {
  7968. "type": "string"
  7969. },
  7970. "body": {}
  7971. },
  7972. "required": ["path", "body"],
  7973. "additionalProperties": false,
  7974. "description": "Next TUI request"
  7975. }
  7976. }
  7977. }
  7978. }
  7979. },
  7980. "description": "Retrieve the next TUI request from the queue for processing.",
  7981. "summary": "Get next TUI request",
  7982. "x-codeSamples": [
  7983. {
  7984. "lang": "js",
  7985. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.control.next({\n ...\n})"
  7986. }
  7987. ]
  7988. }
  7989. },
  7990. "/tui/control/response": {
  7991. "post": {
  7992. "tags": ["tui"],
  7993. "operationId": "tui.control.response",
  7994. "parameters": [
  7995. {
  7996. "name": "directory",
  7997. "in": "query",
  7998. "required": false,
  7999. "schema": {
  8000. "type": "string"
  8001. }
  8002. },
  8003. {
  8004. "name": "workspace",
  8005. "in": "query",
  8006. "required": false,
  8007. "schema": {
  8008. "type": "string"
  8009. }
  8010. }
  8011. ],
  8012. "responses": {
  8013. "200": {
  8014. "description": "Response submitted successfully",
  8015. "content": {
  8016. "application/json": {
  8017. "schema": {
  8018. "type": "boolean",
  8019. "description": "Response submitted successfully"
  8020. }
  8021. }
  8022. }
  8023. }
  8024. },
  8025. "description": "Submit a response to the TUI request queue to complete a pending request.",
  8026. "summary": "Submit TUI response",
  8027. "requestBody": {
  8028. "content": {
  8029. "application/json": {
  8030. "schema": {}
  8031. }
  8032. }
  8033. },
  8034. "x-codeSamples": [
  8035. {
  8036. "lang": "js",
  8037. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.control.response({\n ...\n})"
  8038. }
  8039. ]
  8040. }
  8041. },
  8042. "/experimental/workspace/adapter": {
  8043. "get": {
  8044. "tags": ["workspace"],
  8045. "operationId": "experimental.workspace.adapter.list",
  8046. "parameters": [
  8047. {
  8048. "name": "directory",
  8049. "in": "query",
  8050. "required": false,
  8051. "schema": {
  8052. "type": "string"
  8053. }
  8054. },
  8055. {
  8056. "name": "workspace",
  8057. "in": "query",
  8058. "required": false,
  8059. "schema": {
  8060. "type": "string"
  8061. }
  8062. }
  8063. ],
  8064. "responses": {
  8065. "200": {
  8066. "description": "Workspace adapters",
  8067. "content": {
  8068. "application/json": {
  8069. "schema": {
  8070. "type": "array",
  8071. "items": {
  8072. "type": "object",
  8073. "properties": {
  8074. "type": {
  8075. "type": "string"
  8076. },
  8077. "name": {
  8078. "type": "string"
  8079. },
  8080. "description": {
  8081. "type": "string"
  8082. }
  8083. },
  8084. "required": ["type", "name", "description"],
  8085. "additionalProperties": false
  8086. },
  8087. "description": "Workspace adapters"
  8088. }
  8089. }
  8090. }
  8091. }
  8092. },
  8093. "description": "List all available workspace adapters for the current project.",
  8094. "summary": "List workspace adapters",
  8095. "x-codeSamples": [
  8096. {
  8097. "lang": "js",
  8098. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.adapter.list({\n ...\n})"
  8099. }
  8100. ]
  8101. }
  8102. },
  8103. "/experimental/workspace": {
  8104. "get": {
  8105. "tags": ["workspace"],
  8106. "operationId": "experimental.workspace.list",
  8107. "parameters": [
  8108. {
  8109. "name": "directory",
  8110. "in": "query",
  8111. "required": false,
  8112. "schema": {
  8113. "type": "string"
  8114. }
  8115. },
  8116. {
  8117. "name": "workspace",
  8118. "in": "query",
  8119. "required": false,
  8120. "schema": {
  8121. "type": "string"
  8122. }
  8123. }
  8124. ],
  8125. "responses": {
  8126. "200": {
  8127. "description": "Workspaces",
  8128. "content": {
  8129. "application/json": {
  8130. "schema": {
  8131. "type": "array",
  8132. "items": {
  8133. "$ref": "#/components/schemas/Workspace"
  8134. },
  8135. "description": "Workspaces"
  8136. }
  8137. }
  8138. }
  8139. }
  8140. },
  8141. "description": "List all workspaces.",
  8142. "summary": "List workspaces",
  8143. "x-codeSamples": [
  8144. {
  8145. "lang": "js",
  8146. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.list({\n ...\n})"
  8147. }
  8148. ]
  8149. },
  8150. "post": {
  8151. "tags": ["workspace"],
  8152. "operationId": "experimental.workspace.create",
  8153. "parameters": [
  8154. {
  8155. "name": "directory",
  8156. "in": "query",
  8157. "required": false,
  8158. "schema": {
  8159. "type": "string"
  8160. }
  8161. },
  8162. {
  8163. "name": "workspace",
  8164. "in": "query",
  8165. "required": false,
  8166. "schema": {
  8167. "type": "string"
  8168. }
  8169. }
  8170. ],
  8171. "responses": {
  8172. "200": {
  8173. "description": "Workspace created",
  8174. "content": {
  8175. "application/json": {
  8176. "schema": {
  8177. "$ref": "#/components/schemas/Workspace"
  8178. }
  8179. }
  8180. }
  8181. },
  8182. "400": {
  8183. "description": "Bad request",
  8184. "content": {
  8185. "application/json": {
  8186. "schema": {
  8187. "$ref": "#/components/schemas/BadRequestError"
  8188. }
  8189. }
  8190. }
  8191. }
  8192. },
  8193. "description": "Create a workspace for the current project.",
  8194. "summary": "Create workspace",
  8195. "requestBody": {
  8196. "content": {
  8197. "application/json": {
  8198. "schema": {
  8199. "type": "object",
  8200. "properties": {
  8201. "id": {
  8202. "type": "string"
  8203. },
  8204. "type": {
  8205. "type": "string"
  8206. },
  8207. "branch": {
  8208. "anyOf": [
  8209. {
  8210. "type": "string"
  8211. },
  8212. {
  8213. "type": "null"
  8214. }
  8215. ]
  8216. },
  8217. "extra": {
  8218. "anyOf": [
  8219. {},
  8220. {
  8221. "type": "null"
  8222. }
  8223. ]
  8224. }
  8225. },
  8226. "required": ["type", "branch"],
  8227. "additionalProperties": false
  8228. }
  8229. }
  8230. }
  8231. },
  8232. "x-codeSamples": [
  8233. {
  8234. "lang": "js",
  8235. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.create({\n ...\n})"
  8236. }
  8237. ]
  8238. }
  8239. },
  8240. "/experimental/workspace/status": {
  8241. "get": {
  8242. "tags": ["workspace"],
  8243. "operationId": "experimental.workspace.status",
  8244. "parameters": [
  8245. {
  8246. "name": "directory",
  8247. "in": "query",
  8248. "required": false,
  8249. "schema": {
  8250. "type": "string"
  8251. }
  8252. },
  8253. {
  8254. "name": "workspace",
  8255. "in": "query",
  8256. "required": false,
  8257. "schema": {
  8258. "type": "string"
  8259. }
  8260. }
  8261. ],
  8262. "responses": {
  8263. "200": {
  8264. "description": "Workspace status",
  8265. "content": {
  8266. "application/json": {
  8267. "schema": {
  8268. "type": "array",
  8269. "items": {
  8270. "type": "object",
  8271. "properties": {
  8272. "workspaceID": {
  8273. "type": "string"
  8274. },
  8275. "status": {
  8276. "type": "string",
  8277. "enum": ["connected", "connecting", "disconnected", "error"]
  8278. }
  8279. },
  8280. "required": ["workspaceID", "status"],
  8281. "additionalProperties": false
  8282. },
  8283. "description": "Workspace status"
  8284. }
  8285. }
  8286. }
  8287. }
  8288. },
  8289. "description": "Get connection status for workspaces in the current project.",
  8290. "summary": "Workspace status",
  8291. "x-codeSamples": [
  8292. {
  8293. "lang": "js",
  8294. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.status({\n ...\n})"
  8295. }
  8296. ]
  8297. }
  8298. },
  8299. "/experimental/workspace/{id}": {
  8300. "delete": {
  8301. "tags": ["workspace"],
  8302. "operationId": "experimental.workspace.remove",
  8303. "parameters": [
  8304. {
  8305. "name": "directory",
  8306. "in": "query",
  8307. "required": false,
  8308. "schema": {
  8309. "type": "string"
  8310. }
  8311. },
  8312. {
  8313. "name": "workspace",
  8314. "in": "query",
  8315. "required": false,
  8316. "schema": {
  8317. "type": "string"
  8318. }
  8319. },
  8320. {
  8321. "name": "id",
  8322. "in": "path",
  8323. "schema": {
  8324. "type": "string",
  8325. "pattern": "^wrk.*"
  8326. },
  8327. "required": true
  8328. }
  8329. ],
  8330. "responses": {
  8331. "200": {
  8332. "description": "Workspace removed",
  8333. "content": {
  8334. "application/json": {
  8335. "schema": {
  8336. "$ref": "#/components/schemas/Workspace"
  8337. }
  8338. }
  8339. }
  8340. },
  8341. "400": {
  8342. "description": "Bad request",
  8343. "content": {
  8344. "application/json": {
  8345. "schema": {
  8346. "$ref": "#/components/schemas/BadRequestError"
  8347. }
  8348. }
  8349. }
  8350. }
  8351. },
  8352. "description": "Remove an existing workspace.",
  8353. "summary": "Remove workspace",
  8354. "x-codeSamples": [
  8355. {
  8356. "lang": "js",
  8357. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.remove({\n ...\n})"
  8358. }
  8359. ]
  8360. }
  8361. },
  8362. "/experimental/workspace/warp": {
  8363. "post": {
  8364. "tags": ["workspace"],
  8365. "operationId": "experimental.workspace.warp",
  8366. "parameters": [
  8367. {
  8368. "name": "directory",
  8369. "in": "query",
  8370. "required": false,
  8371. "schema": {
  8372. "type": "string"
  8373. }
  8374. },
  8375. {
  8376. "name": "workspace",
  8377. "in": "query",
  8378. "required": false,
  8379. "schema": {
  8380. "type": "string"
  8381. }
  8382. }
  8383. ],
  8384. "responses": {
  8385. "204": {
  8386. "description": "Session warped"
  8387. },
  8388. "400": {
  8389. "description": "Bad request",
  8390. "content": {
  8391. "application/json": {
  8392. "schema": {
  8393. "$ref": "#/components/schemas/BadRequestError"
  8394. }
  8395. }
  8396. }
  8397. }
  8398. },
  8399. "description": "Move a session's sync history into the target workspace, or detach it to the local project.",
  8400. "summary": "Warp session into workspace",
  8401. "requestBody": {
  8402. "content": {
  8403. "application/json": {
  8404. "schema": {
  8405. "type": "object",
  8406. "properties": {
  8407. "id": {
  8408. "type": "string"
  8409. },
  8410. "sessionID": {
  8411. "type": "string"
  8412. }
  8413. },
  8414. "required": ["id", "sessionID"],
  8415. "additionalProperties": false
  8416. }
  8417. }
  8418. }
  8419. },
  8420. "x-codeSamples": [
  8421. {
  8422. "lang": "js",
  8423. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.warp({\n ...\n})"
  8424. }
  8425. ]
  8426. }
  8427. },
  8428. "/pty/{ptyID}/connect": {
  8429. "get": {
  8430. "tags": ["pty"],
  8431. "operationId": "pty.connect",
  8432. "parameters": [
  8433. {
  8434. "name": "directory",
  8435. "in": "query",
  8436. "required": false,
  8437. "schema": {
  8438. "type": "string"
  8439. }
  8440. },
  8441. {
  8442. "name": "workspace",
  8443. "in": "query",
  8444. "required": false,
  8445. "schema": {
  8446. "type": "string"
  8447. }
  8448. },
  8449. {
  8450. "name": "ptyID",
  8451. "in": "path",
  8452. "schema": {
  8453. "type": "string",
  8454. "pattern": "^pty.*"
  8455. },
  8456. "required": true
  8457. }
  8458. ],
  8459. "responses": {
  8460. "200": {
  8461. "description": "Connected session",
  8462. "content": {
  8463. "application/json": {
  8464. "schema": {
  8465. "type": "boolean",
  8466. "description": "Connected session"
  8467. }
  8468. }
  8469. }
  8470. },
  8471. "403": {
  8472. "description": "Forbidden",
  8473. "content": {
  8474. "application/json": {
  8475. "schema": {
  8476. "$ref": "#/components/schemas/effect_HttpApiError_Forbidden"
  8477. }
  8478. }
  8479. }
  8480. },
  8481. "404": {
  8482. "description": "Not found",
  8483. "content": {
  8484. "application/json": {
  8485. "schema": {
  8486. "$ref": "#/components/schemas/NotFoundError"
  8487. }
  8488. }
  8489. }
  8490. }
  8491. },
  8492. "description": "Establish a WebSocket connection to interact with a pseudo-terminal (PTY) session in real-time.",
  8493. "summary": "Connect to PTY session",
  8494. "x-codeSamples": [
  8495. {
  8496. "lang": "js",
  8497. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.connect({\n ...\n})"
  8498. }
  8499. ]
  8500. }
  8501. }
  8502. },
  8503. "components": {
  8504. "schemas": {
  8505. "Event": {
  8506. "anyOf": [
  8507. {
  8508. "$ref": "#/components/schemas/EventServerInstanceDisposed"
  8509. },
  8510. {
  8511. "$ref": "#/components/schemas/EventFileEdited"
  8512. },
  8513. {
  8514. "$ref": "#/components/schemas/EventFileWatcherUpdated"
  8515. },
  8516. {
  8517. "$ref": "#/components/schemas/EventLspClientDiagnostics"
  8518. },
  8519. {
  8520. "$ref": "#/components/schemas/EventLspUpdated"
  8521. },
  8522. {
  8523. "$ref": "#/components/schemas/EventMessagePartDelta"
  8524. },
  8525. {
  8526. "$ref": "#/components/schemas/EventPermissionAsked"
  8527. },
  8528. {
  8529. "$ref": "#/components/schemas/EventPermissionReplied"
  8530. },
  8531. {
  8532. "$ref": "#/components/schemas/EventSessionDiff"
  8533. },
  8534. {
  8535. "$ref": "#/components/schemas/EventSessionError"
  8536. },
  8537. {
  8538. "$ref": "#/components/schemas/EventInstallationUpdated"
  8539. },
  8540. {
  8541. "$ref": "#/components/schemas/EventInstallationUpdate-available"
  8542. },
  8543. {
  8544. "$ref": "#/components/schemas/EventQuestionAsked"
  8545. },
  8546. {
  8547. "$ref": "#/components/schemas/EventQuestionReplied"
  8548. },
  8549. {
  8550. "$ref": "#/components/schemas/EventQuestionRejected"
  8551. },
  8552. {
  8553. "$ref": "#/components/schemas/EventTodoUpdated"
  8554. },
  8555. {
  8556. "$ref": "#/components/schemas/EventSessionStatus"
  8557. },
  8558. {
  8559. "$ref": "#/components/schemas/EventSessionIdle"
  8560. },
  8561. {
  8562. "$ref": "#/components/schemas/EventSessionCompacted"
  8563. },
  8564. {
  8565. "$ref": "#/components/schemas/Event.tui.prompt.append"
  8566. },
  8567. {
  8568. "$ref": "#/components/schemas/Event.tui.command.execute"
  8569. },
  8570. {
  8571. "$ref": "#/components/schemas/EventTuiToastShow1"
  8572. },
  8573. {
  8574. "$ref": "#/components/schemas/Event.tui.session.select"
  8575. },
  8576. {
  8577. "$ref": "#/components/schemas/EventMcpToolsChanged"
  8578. },
  8579. {
  8580. "$ref": "#/components/schemas/EventMcpBrowserOpenFailed"
  8581. },
  8582. {
  8583. "$ref": "#/components/schemas/EventCommandExecuted"
  8584. },
  8585. {
  8586. "$ref": "#/components/schemas/EventProjectUpdated"
  8587. },
  8588. {
  8589. "$ref": "#/components/schemas/EventVcsBranchUpdated"
  8590. },
  8591. {
  8592. "$ref": "#/components/schemas/EventWorkspaceReady"
  8593. },
  8594. {
  8595. "$ref": "#/components/schemas/EventWorkspaceFailed"
  8596. },
  8597. {
  8598. "$ref": "#/components/schemas/EventWorkspaceStatus"
  8599. },
  8600. {
  8601. "$ref": "#/components/schemas/EventWorktreeReady"
  8602. },
  8603. {
  8604. "$ref": "#/components/schemas/EventWorktreeFailed"
  8605. },
  8606. {
  8607. "$ref": "#/components/schemas/EventPtyCreated"
  8608. },
  8609. {
  8610. "$ref": "#/components/schemas/EventPtyUpdated"
  8611. },
  8612. {
  8613. "$ref": "#/components/schemas/EventPtyExited"
  8614. },
  8615. {
  8616. "$ref": "#/components/schemas/EventPtyDeleted"
  8617. },
  8618. {
  8619. "$ref": "#/components/schemas/EventMessageUpdated"
  8620. },
  8621. {
  8622. "$ref": "#/components/schemas/EventMessageRemoved"
  8623. },
  8624. {
  8625. "$ref": "#/components/schemas/EventMessagePartUpdated"
  8626. },
  8627. {
  8628. "$ref": "#/components/schemas/EventMessagePartRemoved"
  8629. },
  8630. {
  8631. "$ref": "#/components/schemas/EventSessionCreated"
  8632. },
  8633. {
  8634. "$ref": "#/components/schemas/EventSessionUpdated"
  8635. },
  8636. {
  8637. "$ref": "#/components/schemas/EventSessionDeleted"
  8638. },
  8639. {
  8640. "$ref": "#/components/schemas/EventSessionNextAgentSwitched"
  8641. },
  8642. {
  8643. "$ref": "#/components/schemas/EventSessionNextModelSwitched"
  8644. },
  8645. {
  8646. "$ref": "#/components/schemas/EventSessionNextPrompted"
  8647. },
  8648. {
  8649. "$ref": "#/components/schemas/EventSessionNextSynthetic"
  8650. },
  8651. {
  8652. "$ref": "#/components/schemas/EventSessionNextShellStarted"
  8653. },
  8654. {
  8655. "$ref": "#/components/schemas/EventSessionNextShellEnded"
  8656. },
  8657. {
  8658. "$ref": "#/components/schemas/EventSessionNextStepStarted"
  8659. },
  8660. {
  8661. "$ref": "#/components/schemas/EventSessionNextStepEnded"
  8662. },
  8663. {
  8664. "$ref": "#/components/schemas/EventSessionNextStepFailed"
  8665. },
  8666. {
  8667. "$ref": "#/components/schemas/EventSessionNextTextStarted"
  8668. },
  8669. {
  8670. "$ref": "#/components/schemas/EventSessionNextTextDelta"
  8671. },
  8672. {
  8673. "$ref": "#/components/schemas/EventSessionNextTextEnded"
  8674. },
  8675. {
  8676. "$ref": "#/components/schemas/EventSessionNextReasoningStarted"
  8677. },
  8678. {
  8679. "$ref": "#/components/schemas/EventSessionNextReasoningDelta"
  8680. },
  8681. {
  8682. "$ref": "#/components/schemas/EventSessionNextReasoningEnded"
  8683. },
  8684. {
  8685. "$ref": "#/components/schemas/EventSessionNextToolInputStarted"
  8686. },
  8687. {
  8688. "$ref": "#/components/schemas/EventSessionNextToolInputDelta"
  8689. },
  8690. {
  8691. "$ref": "#/components/schemas/EventSessionNextToolInputEnded"
  8692. },
  8693. {
  8694. "$ref": "#/components/schemas/EventSessionNextToolCalled"
  8695. },
  8696. {
  8697. "$ref": "#/components/schemas/EventSessionNextToolProgress"
  8698. },
  8699. {
  8700. "$ref": "#/components/schemas/EventSessionNextToolSuccess"
  8701. },
  8702. {
  8703. "$ref": "#/components/schemas/EventSessionNextToolFailed"
  8704. },
  8705. {
  8706. "$ref": "#/components/schemas/EventSessionNextRetried"
  8707. },
  8708. {
  8709. "$ref": "#/components/schemas/EventSessionNextCompactionStarted"
  8710. },
  8711. {
  8712. "$ref": "#/components/schemas/EventSessionNextCompactionDelta"
  8713. },
  8714. {
  8715. "$ref": "#/components/schemas/EventSessionNextCompactionEnded"
  8716. },
  8717. {
  8718. "$ref": "#/components/schemas/EventServerConnected"
  8719. },
  8720. {
  8721. "$ref": "#/components/schemas/EventGlobalDisposed"
  8722. }
  8723. ]
  8724. },
  8725. "OAuth": {
  8726. "type": "object",
  8727. "properties": {
  8728. "type": {
  8729. "type": "string",
  8730. "enum": ["oauth"]
  8731. },
  8732. "refresh": {
  8733. "type": "string"
  8734. },
  8735. "access": {
  8736. "type": "string"
  8737. },
  8738. "expires": {
  8739. "type": "integer",
  8740. "minimum": 0
  8741. },
  8742. "accountId": {
  8743. "type": "string"
  8744. },
  8745. "enterpriseUrl": {
  8746. "type": "string"
  8747. }
  8748. },
  8749. "required": ["type", "refresh", "access", "expires"],
  8750. "additionalProperties": false
  8751. },
  8752. "ApiAuth": {
  8753. "type": "object",
  8754. "properties": {
  8755. "type": {
  8756. "type": "string",
  8757. "enum": ["api"]
  8758. },
  8759. "key": {
  8760. "type": "string"
  8761. },
  8762. "metadata": {
  8763. "type": "object",
  8764. "additionalProperties": {
  8765. "type": "string"
  8766. }
  8767. }
  8768. },
  8769. "required": ["type", "key"],
  8770. "additionalProperties": false
  8771. },
  8772. "WellKnownAuth": {
  8773. "type": "object",
  8774. "properties": {
  8775. "type": {
  8776. "type": "string",
  8777. "enum": ["wellknown"]
  8778. },
  8779. "key": {
  8780. "type": "string"
  8781. },
  8782. "token": {
  8783. "type": "string"
  8784. }
  8785. },
  8786. "required": ["type", "key", "token"],
  8787. "additionalProperties": false
  8788. },
  8789. "Auth": {
  8790. "anyOf": [
  8791. {
  8792. "$ref": "#/components/schemas/OAuth"
  8793. },
  8794. {
  8795. "$ref": "#/components/schemas/ApiAuth"
  8796. },
  8797. {
  8798. "$ref": "#/components/schemas/WellKnownAuth"
  8799. }
  8800. ]
  8801. },
  8802. "PermissionRequest": {
  8803. "type": "object",
  8804. "properties": {
  8805. "id": {
  8806. "type": "string"
  8807. },
  8808. "sessionID": {
  8809. "type": "string"
  8810. },
  8811. "permission": {
  8812. "type": "string"
  8813. },
  8814. "patterns": {
  8815. "type": "array",
  8816. "items": {
  8817. "type": "string"
  8818. }
  8819. },
  8820. "metadata": {
  8821. "type": "object"
  8822. },
  8823. "always": {
  8824. "type": "array",
  8825. "items": {
  8826. "type": "string"
  8827. }
  8828. },
  8829. "tool": {
  8830. "type": "object",
  8831. "properties": {
  8832. "messageID": {
  8833. "type": "string"
  8834. },
  8835. "callID": {
  8836. "type": "string"
  8837. }
  8838. },
  8839. "required": ["messageID", "callID"],
  8840. "additionalProperties": false
  8841. }
  8842. },
  8843. "required": ["id", "sessionID", "permission", "patterns", "metadata", "always"],
  8844. "additionalProperties": false
  8845. },
  8846. "SnapshotFileDiff": {
  8847. "type": "object",
  8848. "properties": {
  8849. "file": {
  8850. "type": "string"
  8851. },
  8852. "patch": {
  8853. "type": "string"
  8854. },
  8855. "additions": {
  8856. "type": "integer",
  8857. "minimum": 0
  8858. },
  8859. "deletions": {
  8860. "type": "integer",
  8861. "minimum": 0
  8862. },
  8863. "status": {
  8864. "type": "string",
  8865. "enum": ["added", "deleted", "modified"]
  8866. }
  8867. },
  8868. "required": ["file", "patch", "additions", "deletions"],
  8869. "additionalProperties": false
  8870. },
  8871. "ProviderAuthError": {
  8872. "type": "object",
  8873. "properties": {
  8874. "name": {
  8875. "type": "string",
  8876. "enum": ["ProviderAuthError"]
  8877. },
  8878. "data": {
  8879. "type": "object",
  8880. "properties": {
  8881. "providerID": {
  8882. "type": "string"
  8883. },
  8884. "message": {
  8885. "type": "string"
  8886. }
  8887. },
  8888. "required": ["providerID", "message"],
  8889. "additionalProperties": false
  8890. }
  8891. },
  8892. "required": ["name", "data"],
  8893. "additionalProperties": false
  8894. },
  8895. "UnknownError": {
  8896. "type": "object",
  8897. "properties": {
  8898. "name": {
  8899. "type": "string",
  8900. "enum": ["UnknownError"]
  8901. },
  8902. "data": {
  8903. "type": "object",
  8904. "properties": {
  8905. "message": {
  8906. "type": "string"
  8907. }
  8908. },
  8909. "required": ["message"],
  8910. "additionalProperties": false
  8911. }
  8912. },
  8913. "required": ["name", "data"],
  8914. "additionalProperties": false
  8915. },
  8916. "MessageOutputLengthError": {
  8917. "type": "object",
  8918. "properties": {
  8919. "name": {
  8920. "type": "string",
  8921. "enum": ["MessageOutputLengthError"]
  8922. },
  8923. "data": {
  8924. "type": "object",
  8925. "properties": {}
  8926. }
  8927. },
  8928. "required": ["name", "data"],
  8929. "additionalProperties": false
  8930. },
  8931. "MessageAbortedError": {
  8932. "type": "object",
  8933. "properties": {
  8934. "name": {
  8935. "type": "string",
  8936. "enum": ["MessageAbortedError"]
  8937. },
  8938. "data": {
  8939. "type": "object",
  8940. "properties": {
  8941. "message": {
  8942. "type": "string"
  8943. }
  8944. },
  8945. "required": ["message"],
  8946. "additionalProperties": false
  8947. }
  8948. },
  8949. "required": ["name", "data"],
  8950. "additionalProperties": false
  8951. },
  8952. "StructuredOutputError": {
  8953. "type": "object",
  8954. "properties": {
  8955. "name": {
  8956. "type": "string",
  8957. "enum": ["StructuredOutputError"]
  8958. },
  8959. "data": {
  8960. "type": "object",
  8961. "properties": {
  8962. "message": {
  8963. "type": "string"
  8964. },
  8965. "retries": {
  8966. "type": "integer",
  8967. "minimum": 0
  8968. }
  8969. },
  8970. "required": ["message", "retries"],
  8971. "additionalProperties": false
  8972. }
  8973. },
  8974. "required": ["name", "data"],
  8975. "additionalProperties": false
  8976. },
  8977. "ContextOverflowError": {
  8978. "type": "object",
  8979. "properties": {
  8980. "name": {
  8981. "type": "string",
  8982. "enum": ["ContextOverflowError"]
  8983. },
  8984. "data": {
  8985. "type": "object",
  8986. "properties": {
  8987. "message": {
  8988. "type": "string"
  8989. },
  8990. "responseBody": {
  8991. "type": "string"
  8992. }
  8993. },
  8994. "required": ["message"],
  8995. "additionalProperties": false
  8996. }
  8997. },
  8998. "required": ["name", "data"],
  8999. "additionalProperties": false
  9000. },
  9001. "APIError": {
  9002. "type": "object",
  9003. "properties": {
  9004. "name": {
  9005. "type": "string",
  9006. "enum": ["APIError"]
  9007. },
  9008. "data": {
  9009. "type": "object",
  9010. "properties": {
  9011. "message": {
  9012. "type": "string"
  9013. },
  9014. "statusCode": {
  9015. "type": "integer",
  9016. "minimum": 0
  9017. },
  9018. "isRetryable": {
  9019. "type": "boolean"
  9020. },
  9021. "responseHeaders": {
  9022. "type": "object",
  9023. "additionalProperties": {
  9024. "type": "string"
  9025. }
  9026. },
  9027. "responseBody": {
  9028. "type": "string"
  9029. },
  9030. "metadata": {
  9031. "type": "object",
  9032. "additionalProperties": {
  9033. "type": "string"
  9034. }
  9035. }
  9036. },
  9037. "required": ["message", "isRetryable"],
  9038. "additionalProperties": false
  9039. }
  9040. },
  9041. "required": ["name", "data"],
  9042. "additionalProperties": false
  9043. },
  9044. "QuestionOption": {
  9045. "type": "object",
  9046. "properties": {
  9047. "label": {
  9048. "type": "string",
  9049. "description": "Display text (1-5 words, concise)"
  9050. },
  9051. "description": {
  9052. "type": "string",
  9053. "description": "Explanation of choice"
  9054. }
  9055. },
  9056. "required": ["label", "description"],
  9057. "additionalProperties": false
  9058. },
  9059. "QuestionInfo": {
  9060. "type": "object",
  9061. "properties": {
  9062. "question": {
  9063. "type": "string",
  9064. "description": "Complete question"
  9065. },
  9066. "header": {
  9067. "type": "string",
  9068. "description": "Very short label (max 30 chars)"
  9069. },
  9070. "options": {
  9071. "type": "array",
  9072. "items": {
  9073. "$ref": "#/components/schemas/QuestionOption"
  9074. },
  9075. "description": "Available choices"
  9076. },
  9077. "multiple": {
  9078. "type": "boolean"
  9079. },
  9080. "custom": {
  9081. "type": "boolean"
  9082. }
  9083. },
  9084. "required": ["question", "header", "options"],
  9085. "additionalProperties": false
  9086. },
  9087. "QuestionTool": {
  9088. "type": "object",
  9089. "properties": {
  9090. "messageID": {
  9091. "type": "string"
  9092. },
  9093. "callID": {
  9094. "type": "string"
  9095. }
  9096. },
  9097. "required": ["messageID", "callID"],
  9098. "additionalProperties": false
  9099. },
  9100. "QuestionRequest": {
  9101. "type": "object",
  9102. "properties": {
  9103. "id": {
  9104. "type": "string"
  9105. },
  9106. "sessionID": {
  9107. "type": "string"
  9108. },
  9109. "questions": {
  9110. "type": "array",
  9111. "items": {
  9112. "$ref": "#/components/schemas/QuestionInfo"
  9113. },
  9114. "description": "Questions to ask"
  9115. },
  9116. "tool": {
  9117. "$ref": "#/components/schemas/QuestionTool"
  9118. }
  9119. },
  9120. "required": ["id", "sessionID", "questions"],
  9121. "additionalProperties": false
  9122. },
  9123. "QuestionAnswer": {
  9124. "type": "array",
  9125. "items": {
  9126. "type": "string"
  9127. }
  9128. },
  9129. "QuestionReplied": {
  9130. "type": "object",
  9131. "properties": {
  9132. "sessionID": {
  9133. "type": "string"
  9134. },
  9135. "requestID": {
  9136. "type": "string"
  9137. },
  9138. "answers": {
  9139. "type": "array",
  9140. "items": {
  9141. "$ref": "#/components/schemas/QuestionAnswer"
  9142. }
  9143. }
  9144. },
  9145. "required": ["sessionID", "requestID", "answers"],
  9146. "additionalProperties": false
  9147. },
  9148. "QuestionRejected": {
  9149. "type": "object",
  9150. "properties": {
  9151. "sessionID": {
  9152. "type": "string"
  9153. },
  9154. "requestID": {
  9155. "type": "string"
  9156. }
  9157. },
  9158. "required": ["sessionID", "requestID"],
  9159. "additionalProperties": false
  9160. },
  9161. "Todo": {
  9162. "type": "object",
  9163. "properties": {
  9164. "content": {
  9165. "type": "string",
  9166. "description": "Brief description of the task"
  9167. },
  9168. "status": {
  9169. "type": "string",
  9170. "description": "Current status of the task: pending, in_progress, completed, cancelled"
  9171. },
  9172. "priority": {
  9173. "type": "string",
  9174. "description": "Priority level of the task: high, medium, low"
  9175. }
  9176. },
  9177. "required": ["content", "status", "priority"],
  9178. "additionalProperties": false
  9179. },
  9180. "SessionStatus": {
  9181. "anyOf": [
  9182. {
  9183. "type": "object",
  9184. "properties": {
  9185. "type": {
  9186. "type": "string",
  9187. "enum": ["idle"]
  9188. }
  9189. },
  9190. "required": ["type"],
  9191. "additionalProperties": false
  9192. },
  9193. {
  9194. "type": "object",
  9195. "properties": {
  9196. "type": {
  9197. "type": "string",
  9198. "enum": ["retry"]
  9199. },
  9200. "attempt": {
  9201. "type": "integer",
  9202. "minimum": 0
  9203. },
  9204. "message": {
  9205. "type": "string"
  9206. },
  9207. "next": {
  9208. "type": "integer",
  9209. "minimum": 0
  9210. }
  9211. },
  9212. "required": ["type", "attempt", "message", "next"],
  9213. "additionalProperties": false
  9214. },
  9215. {
  9216. "type": "object",
  9217. "properties": {
  9218. "type": {
  9219. "type": "string",
  9220. "enum": ["busy"]
  9221. }
  9222. },
  9223. "required": ["type"],
  9224. "additionalProperties": false
  9225. }
  9226. ]
  9227. },
  9228. "Event.tui.prompt.append": {
  9229. "type": "object",
  9230. "properties": {
  9231. "id": {
  9232. "type": "string"
  9233. },
  9234. "type": {
  9235. "type": "string",
  9236. "enum": ["tui.prompt.append"]
  9237. },
  9238. "properties": {
  9239. "type": "object",
  9240. "properties": {
  9241. "text": {
  9242. "type": "string"
  9243. }
  9244. },
  9245. "required": ["text"],
  9246. "additionalProperties": false
  9247. }
  9248. },
  9249. "required": ["id", "type", "properties"],
  9250. "additionalProperties": false
  9251. },
  9252. "Event.tui.command.execute": {
  9253. "type": "object",
  9254. "properties": {
  9255. "id": {
  9256. "type": "string"
  9257. },
  9258. "type": {
  9259. "type": "string",
  9260. "enum": ["tui.command.execute"]
  9261. },
  9262. "properties": {
  9263. "type": "object",
  9264. "properties": {
  9265. "command": {
  9266. "anyOf": [
  9267. {
  9268. "type": "string",
  9269. "enum": [
  9270. "session.list",
  9271. "session.new",
  9272. "session.share",
  9273. "session.interrupt",
  9274. "session.compact",
  9275. "session.page.up",
  9276. "session.page.down",
  9277. "session.line.up",
  9278. "session.line.down",
  9279. "session.half.page.up",
  9280. "session.half.page.down",
  9281. "session.first",
  9282. "session.last",
  9283. "prompt.clear",
  9284. "prompt.submit",
  9285. "agent.cycle"
  9286. ]
  9287. },
  9288. {
  9289. "type": "string"
  9290. }
  9291. ]
  9292. }
  9293. },
  9294. "required": ["command"],
  9295. "additionalProperties": false
  9296. }
  9297. },
  9298. "required": ["id", "type", "properties"],
  9299. "additionalProperties": false
  9300. },
  9301. "Event.tui.toast.show": {
  9302. "type": "object",
  9303. "properties": {
  9304. "id": {
  9305. "type": "string"
  9306. },
  9307. "type": {
  9308. "type": "string",
  9309. "enum": ["tui.toast.show"]
  9310. },
  9311. "properties": {
  9312. "type": "object",
  9313. "properties": {
  9314. "title": {
  9315. "type": "string"
  9316. },
  9317. "message": {
  9318. "type": "string"
  9319. },
  9320. "variant": {
  9321. "type": "string",
  9322. "enum": ["info", "success", "warning", "error"]
  9323. },
  9324. "duration": {
  9325. "type": "integer",
  9326. "exclusiveMinimum": 0
  9327. }
  9328. },
  9329. "required": ["message", "variant"],
  9330. "additionalProperties": false
  9331. }
  9332. },
  9333. "required": ["id", "type", "properties"],
  9334. "additionalProperties": false
  9335. },
  9336. "Event.tui.session.select": {
  9337. "type": "object",
  9338. "properties": {
  9339. "id": {
  9340. "type": "string"
  9341. },
  9342. "type": {
  9343. "type": "string",
  9344. "enum": ["tui.session.select"]
  9345. },
  9346. "properties": {
  9347. "type": "object",
  9348. "properties": {
  9349. "sessionID": {
  9350. "type": "string",
  9351. "description": "Session ID to navigate to"
  9352. }
  9353. },
  9354. "required": ["sessionID"],
  9355. "additionalProperties": false
  9356. }
  9357. },
  9358. "required": ["id", "type", "properties"],
  9359. "additionalProperties": false
  9360. },
  9361. "Project": {
  9362. "type": "object",
  9363. "properties": {
  9364. "id": {
  9365. "type": "string"
  9366. },
  9367. "worktree": {
  9368. "type": "string"
  9369. },
  9370. "vcs": {
  9371. "type": "string",
  9372. "enum": ["git"]
  9373. },
  9374. "name": {
  9375. "type": "string"
  9376. },
  9377. "icon": {
  9378. "type": "object",
  9379. "properties": {
  9380. "url": {
  9381. "type": "string"
  9382. },
  9383. "override": {
  9384. "type": "string"
  9385. },
  9386. "color": {
  9387. "type": "string"
  9388. }
  9389. },
  9390. "additionalProperties": false
  9391. },
  9392. "commands": {
  9393. "type": "object",
  9394. "properties": {
  9395. "start": {
  9396. "type": "string",
  9397. "description": "Startup script to run when creating a new workspace (worktree)"
  9398. }
  9399. },
  9400. "additionalProperties": false
  9401. },
  9402. "time": {
  9403. "type": "object",
  9404. "properties": {
  9405. "created": {
  9406. "type": "integer",
  9407. "minimum": 0
  9408. },
  9409. "updated": {
  9410. "type": "integer",
  9411. "minimum": 0
  9412. },
  9413. "initialized": {
  9414. "type": "integer",
  9415. "minimum": 0
  9416. }
  9417. },
  9418. "required": ["created", "updated"],
  9419. "additionalProperties": false
  9420. },
  9421. "sandboxes": {
  9422. "type": "array",
  9423. "items": {
  9424. "type": "string"
  9425. }
  9426. }
  9427. },
  9428. "required": ["id", "worktree", "time", "sandboxes"],
  9429. "additionalProperties": false
  9430. },
  9431. "Pty": {
  9432. "type": "object",
  9433. "properties": {
  9434. "id": {
  9435. "type": "string"
  9436. },
  9437. "title": {
  9438. "type": "string"
  9439. },
  9440. "command": {
  9441. "type": "string"
  9442. },
  9443. "args": {
  9444. "type": "array",
  9445. "items": {
  9446. "type": "string"
  9447. }
  9448. },
  9449. "cwd": {
  9450. "type": "string"
  9451. },
  9452. "status": {
  9453. "type": "string",
  9454. "enum": ["running", "exited"]
  9455. },
  9456. "pid": {
  9457. "type": "integer",
  9458. "exclusiveMinimum": 0
  9459. }
  9460. },
  9461. "required": ["id", "title", "command", "args", "cwd", "status", "pid"],
  9462. "additionalProperties": false
  9463. },
  9464. "OutputFormatText": {
  9465. "type": "object",
  9466. "properties": {
  9467. "type": {
  9468. "type": "string",
  9469. "enum": ["text"]
  9470. }
  9471. },
  9472. "required": ["type"],
  9473. "additionalProperties": false
  9474. },
  9475. "JSONSchema": {
  9476. "type": "object"
  9477. },
  9478. "OutputFormatJsonSchema": {
  9479. "type": "object",
  9480. "properties": {
  9481. "type": {
  9482. "type": "string",
  9483. "enum": ["json_schema"]
  9484. },
  9485. "schema": {
  9486. "$ref": "#/components/schemas/JSONSchema"
  9487. },
  9488. "retryCount": {
  9489. "type": "integer",
  9490. "minimum": 0
  9491. }
  9492. },
  9493. "required": ["type", "schema"],
  9494. "additionalProperties": false
  9495. },
  9496. "OutputFormat": {
  9497. "anyOf": [
  9498. {
  9499. "$ref": "#/components/schemas/OutputFormatText"
  9500. },
  9501. {
  9502. "$ref": "#/components/schemas/OutputFormatJsonSchema"
  9503. }
  9504. ]
  9505. },
  9506. "UserMessage": {
  9507. "type": "object",
  9508. "properties": {
  9509. "id": {
  9510. "type": "string"
  9511. },
  9512. "sessionID": {
  9513. "type": "string"
  9514. },
  9515. "role": {
  9516. "type": "string",
  9517. "enum": ["user"]
  9518. },
  9519. "time": {
  9520. "type": "object",
  9521. "properties": {
  9522. "created": {
  9523. "type": "integer",
  9524. "minimum": 0
  9525. }
  9526. },
  9527. "required": ["created"],
  9528. "additionalProperties": false
  9529. },
  9530. "format": {
  9531. "$ref": "#/components/schemas/OutputFormat"
  9532. },
  9533. "summary": {
  9534. "type": "object",
  9535. "properties": {
  9536. "title": {
  9537. "type": "string"
  9538. },
  9539. "body": {
  9540. "type": "string"
  9541. },
  9542. "diffs": {
  9543. "type": "array",
  9544. "items": {
  9545. "$ref": "#/components/schemas/SnapshotFileDiff"
  9546. }
  9547. }
  9548. },
  9549. "required": ["diffs"],
  9550. "additionalProperties": false
  9551. },
  9552. "agent": {
  9553. "type": "string"
  9554. },
  9555. "model": {
  9556. "type": "object",
  9557. "properties": {
  9558. "providerID": {
  9559. "type": "string"
  9560. },
  9561. "modelID": {
  9562. "type": "string"
  9563. },
  9564. "variant": {
  9565. "type": "string"
  9566. }
  9567. },
  9568. "required": ["providerID", "modelID"],
  9569. "additionalProperties": false
  9570. },
  9571. "system": {
  9572. "type": "string"
  9573. },
  9574. "tools": {
  9575. "type": "object",
  9576. "additionalProperties": {
  9577. "type": "boolean"
  9578. }
  9579. }
  9580. },
  9581. "required": ["id", "sessionID", "role", "time", "agent", "model"],
  9582. "additionalProperties": false
  9583. },
  9584. "AssistantMessage": {
  9585. "type": "object",
  9586. "properties": {
  9587. "id": {
  9588. "type": "string"
  9589. },
  9590. "sessionID": {
  9591. "type": "string"
  9592. },
  9593. "role": {
  9594. "type": "string",
  9595. "enum": ["assistant"]
  9596. },
  9597. "time": {
  9598. "type": "object",
  9599. "properties": {
  9600. "created": {
  9601. "type": "integer",
  9602. "minimum": 0
  9603. },
  9604. "completed": {
  9605. "type": "integer",
  9606. "minimum": 0
  9607. }
  9608. },
  9609. "required": ["created"],
  9610. "additionalProperties": false
  9611. },
  9612. "error": {
  9613. "anyOf": [
  9614. {
  9615. "$ref": "#/components/schemas/ProviderAuthError"
  9616. },
  9617. {
  9618. "$ref": "#/components/schemas/UnknownError"
  9619. },
  9620. {
  9621. "$ref": "#/components/schemas/MessageOutputLengthError"
  9622. },
  9623. {
  9624. "$ref": "#/components/schemas/MessageAbortedError"
  9625. },
  9626. {
  9627. "$ref": "#/components/schemas/StructuredOutputError"
  9628. },
  9629. {
  9630. "$ref": "#/components/schemas/ContextOverflowError"
  9631. },
  9632. {
  9633. "$ref": "#/components/schemas/APIError"
  9634. }
  9635. ]
  9636. },
  9637. "parentID": {
  9638. "type": "string"
  9639. },
  9640. "modelID": {
  9641. "type": "string"
  9642. },
  9643. "providerID": {
  9644. "type": "string"
  9645. },
  9646. "mode": {
  9647. "type": "string"
  9648. },
  9649. "agent": {
  9650. "type": "string"
  9651. },
  9652. "path": {
  9653. "type": "object",
  9654. "properties": {
  9655. "cwd": {
  9656. "type": "string"
  9657. },
  9658. "root": {
  9659. "type": "string"
  9660. }
  9661. },
  9662. "required": ["cwd", "root"],
  9663. "additionalProperties": false
  9664. },
  9665. "summary": {
  9666. "type": "boolean"
  9667. },
  9668. "cost": {
  9669. "type": "number"
  9670. },
  9671. "tokens": {
  9672. "type": "object",
  9673. "properties": {
  9674. "total": {
  9675. "type": "integer",
  9676. "minimum": 0
  9677. },
  9678. "input": {
  9679. "type": "integer",
  9680. "minimum": 0
  9681. },
  9682. "output": {
  9683. "type": "integer",
  9684. "minimum": 0
  9685. },
  9686. "reasoning": {
  9687. "type": "integer",
  9688. "minimum": 0
  9689. },
  9690. "cache": {
  9691. "type": "object",
  9692. "properties": {
  9693. "read": {
  9694. "type": "integer",
  9695. "minimum": 0
  9696. },
  9697. "write": {
  9698. "type": "integer",
  9699. "minimum": 0
  9700. }
  9701. },
  9702. "required": ["read", "write"],
  9703. "additionalProperties": false
  9704. }
  9705. },
  9706. "required": ["input", "output", "reasoning", "cache"],
  9707. "additionalProperties": false
  9708. },
  9709. "structured": {},
  9710. "variant": {
  9711. "type": "string"
  9712. },
  9713. "finish": {
  9714. "type": "string"
  9715. }
  9716. },
  9717. "required": [
  9718. "id",
  9719. "sessionID",
  9720. "role",
  9721. "time",
  9722. "parentID",
  9723. "modelID",
  9724. "providerID",
  9725. "mode",
  9726. "agent",
  9727. "path",
  9728. "cost",
  9729. "tokens"
  9730. ],
  9731. "additionalProperties": false
  9732. },
  9733. "Message": {
  9734. "anyOf": [
  9735. {
  9736. "$ref": "#/components/schemas/UserMessage"
  9737. },
  9738. {
  9739. "$ref": "#/components/schemas/AssistantMessage"
  9740. }
  9741. ]
  9742. },
  9743. "TextPart": {
  9744. "type": "object",
  9745. "properties": {
  9746. "id": {
  9747. "type": "string"
  9748. },
  9749. "sessionID": {
  9750. "type": "string"
  9751. },
  9752. "messageID": {
  9753. "type": "string"
  9754. },
  9755. "type": {
  9756. "type": "string",
  9757. "enum": ["text"]
  9758. },
  9759. "text": {
  9760. "type": "string"
  9761. },
  9762. "synthetic": {
  9763. "type": "boolean"
  9764. },
  9765. "ignored": {
  9766. "type": "boolean"
  9767. },
  9768. "time": {
  9769. "type": "object",
  9770. "properties": {
  9771. "start": {
  9772. "type": "integer",
  9773. "minimum": 0
  9774. },
  9775. "end": {
  9776. "type": "integer",
  9777. "minimum": 0
  9778. }
  9779. },
  9780. "required": ["start"],
  9781. "additionalProperties": false
  9782. },
  9783. "metadata": {
  9784. "type": "object"
  9785. }
  9786. },
  9787. "required": ["id", "sessionID", "messageID", "type", "text"],
  9788. "additionalProperties": false
  9789. },
  9790. "SubtaskPart": {
  9791. "type": "object",
  9792. "properties": {
  9793. "id": {
  9794. "type": "string"
  9795. },
  9796. "sessionID": {
  9797. "type": "string"
  9798. },
  9799. "messageID": {
  9800. "type": "string"
  9801. },
  9802. "type": {
  9803. "type": "string",
  9804. "enum": ["subtask"]
  9805. },
  9806. "prompt": {
  9807. "type": "string"
  9808. },
  9809. "description": {
  9810. "type": "string"
  9811. },
  9812. "agent": {
  9813. "type": "string"
  9814. },
  9815. "model": {
  9816. "type": "object",
  9817. "properties": {
  9818. "providerID": {
  9819. "type": "string"
  9820. },
  9821. "modelID": {
  9822. "type": "string"
  9823. }
  9824. },
  9825. "required": ["providerID", "modelID"],
  9826. "additionalProperties": false
  9827. },
  9828. "command": {
  9829. "type": "string"
  9830. }
  9831. },
  9832. "required": ["id", "sessionID", "messageID", "type", "prompt", "description", "agent"],
  9833. "additionalProperties": false
  9834. },
  9835. "ReasoningPart": {
  9836. "type": "object",
  9837. "properties": {
  9838. "id": {
  9839. "type": "string"
  9840. },
  9841. "sessionID": {
  9842. "type": "string"
  9843. },
  9844. "messageID": {
  9845. "type": "string"
  9846. },
  9847. "type": {
  9848. "type": "string",
  9849. "enum": ["reasoning"]
  9850. },
  9851. "text": {
  9852. "type": "string"
  9853. },
  9854. "metadata": {
  9855. "type": "object"
  9856. },
  9857. "time": {
  9858. "type": "object",
  9859. "properties": {
  9860. "start": {
  9861. "type": "integer",
  9862. "minimum": 0
  9863. },
  9864. "end": {
  9865. "type": "integer",
  9866. "minimum": 0
  9867. }
  9868. },
  9869. "required": ["start"],
  9870. "additionalProperties": false
  9871. }
  9872. },
  9873. "required": ["id", "sessionID", "messageID", "type", "text", "time"],
  9874. "additionalProperties": false
  9875. },
  9876. "FilePartSourceText": {
  9877. "type": "object",
  9878. "properties": {
  9879. "value": {
  9880. "type": "string"
  9881. },
  9882. "start": {
  9883. "type": "integer",
  9884. "minimum": 0
  9885. },
  9886. "end": {
  9887. "type": "integer",
  9888. "minimum": 0
  9889. }
  9890. },
  9891. "required": ["value", "start", "end"],
  9892. "additionalProperties": false
  9893. },
  9894. "FileSource": {
  9895. "type": "object",
  9896. "properties": {
  9897. "text": {
  9898. "$ref": "#/components/schemas/FilePartSourceText"
  9899. },
  9900. "type": {
  9901. "type": "string",
  9902. "enum": ["file"]
  9903. },
  9904. "path": {
  9905. "type": "string"
  9906. }
  9907. },
  9908. "required": ["text", "type", "path"],
  9909. "additionalProperties": false
  9910. },
  9911. "Range": {
  9912. "type": "object",
  9913. "properties": {
  9914. "start": {
  9915. "type": "object",
  9916. "properties": {
  9917. "line": {
  9918. "type": "integer",
  9919. "minimum": 0
  9920. },
  9921. "character": {
  9922. "type": "integer",
  9923. "minimum": 0
  9924. }
  9925. },
  9926. "required": ["line", "character"],
  9927. "additionalProperties": false
  9928. },
  9929. "end": {
  9930. "type": "object",
  9931. "properties": {
  9932. "line": {
  9933. "type": "integer",
  9934. "minimum": 0
  9935. },
  9936. "character": {
  9937. "type": "integer",
  9938. "minimum": 0
  9939. }
  9940. },
  9941. "required": ["line", "character"],
  9942. "additionalProperties": false
  9943. }
  9944. },
  9945. "required": ["start", "end"],
  9946. "additionalProperties": false
  9947. },
  9948. "SymbolSource": {
  9949. "type": "object",
  9950. "properties": {
  9951. "text": {
  9952. "$ref": "#/components/schemas/FilePartSourceText"
  9953. },
  9954. "type": {
  9955. "type": "string",
  9956. "enum": ["symbol"]
  9957. },
  9958. "path": {
  9959. "type": "string"
  9960. },
  9961. "range": {
  9962. "$ref": "#/components/schemas/Range"
  9963. },
  9964. "name": {
  9965. "type": "string"
  9966. },
  9967. "kind": {
  9968. "type": "integer",
  9969. "minimum": 0
  9970. }
  9971. },
  9972. "required": ["text", "type", "path", "range", "name", "kind"],
  9973. "additionalProperties": false
  9974. },
  9975. "ResourceSource": {
  9976. "type": "object",
  9977. "properties": {
  9978. "text": {
  9979. "$ref": "#/components/schemas/FilePartSourceText"
  9980. },
  9981. "type": {
  9982. "type": "string",
  9983. "enum": ["resource"]
  9984. },
  9985. "clientName": {
  9986. "type": "string"
  9987. },
  9988. "uri": {
  9989. "type": "string"
  9990. }
  9991. },
  9992. "required": ["text", "type", "clientName", "uri"],
  9993. "additionalProperties": false
  9994. },
  9995. "FilePartSource": {
  9996. "anyOf": [
  9997. {
  9998. "$ref": "#/components/schemas/FileSource"
  9999. },
  10000. {
  10001. "$ref": "#/components/schemas/SymbolSource"
  10002. },
  10003. {
  10004. "$ref": "#/components/schemas/ResourceSource"
  10005. }
  10006. ]
  10007. },
  10008. "FilePart": {
  10009. "type": "object",
  10010. "properties": {
  10011. "id": {
  10012. "type": "string"
  10013. },
  10014. "sessionID": {
  10015. "type": "string"
  10016. },
  10017. "messageID": {
  10018. "type": "string"
  10019. },
  10020. "type": {
  10021. "type": "string",
  10022. "enum": ["file"]
  10023. },
  10024. "mime": {
  10025. "type": "string"
  10026. },
  10027. "filename": {
  10028. "type": "string"
  10029. },
  10030. "url": {
  10031. "type": "string"
  10032. },
  10033. "source": {
  10034. "$ref": "#/components/schemas/FilePartSource"
  10035. }
  10036. },
  10037. "required": ["id", "sessionID", "messageID", "type", "mime", "url"],
  10038. "additionalProperties": false
  10039. },
  10040. "ToolStatePending": {
  10041. "type": "object",
  10042. "properties": {
  10043. "status": {
  10044. "type": "string",
  10045. "enum": ["pending"]
  10046. },
  10047. "input": {
  10048. "type": "object"
  10049. },
  10050. "raw": {
  10051. "type": "string"
  10052. }
  10053. },
  10054. "required": ["status", "input", "raw"],
  10055. "additionalProperties": false
  10056. },
  10057. "ToolStateRunning": {
  10058. "type": "object",
  10059. "properties": {
  10060. "status": {
  10061. "type": "string",
  10062. "enum": ["running"]
  10063. },
  10064. "input": {
  10065. "type": "object"
  10066. },
  10067. "title": {
  10068. "type": "string"
  10069. },
  10070. "metadata": {
  10071. "type": "object"
  10072. },
  10073. "time": {
  10074. "type": "object",
  10075. "properties": {
  10076. "start": {
  10077. "type": "integer",
  10078. "minimum": 0
  10079. }
  10080. },
  10081. "required": ["start"],
  10082. "additionalProperties": false
  10083. }
  10084. },
  10085. "required": ["status", "input", "time"],
  10086. "additionalProperties": false
  10087. },
  10088. "ToolStateCompleted": {
  10089. "type": "object",
  10090. "properties": {
  10091. "status": {
  10092. "type": "string",
  10093. "enum": ["completed"]
  10094. },
  10095. "input": {
  10096. "type": "object"
  10097. },
  10098. "output": {
  10099. "type": "string"
  10100. },
  10101. "title": {
  10102. "type": "string"
  10103. },
  10104. "metadata": {
  10105. "type": "object"
  10106. },
  10107. "time": {
  10108. "type": "object",
  10109. "properties": {
  10110. "start": {
  10111. "type": "integer",
  10112. "minimum": 0
  10113. },
  10114. "end": {
  10115. "type": "integer",
  10116. "minimum": 0
  10117. },
  10118. "compacted": {
  10119. "type": "integer",
  10120. "minimum": 0
  10121. }
  10122. },
  10123. "required": ["start", "end"],
  10124. "additionalProperties": false
  10125. },
  10126. "attachments": {
  10127. "type": "array",
  10128. "items": {
  10129. "$ref": "#/components/schemas/FilePart"
  10130. }
  10131. }
  10132. },
  10133. "required": ["status", "input", "output", "title", "metadata", "time"],
  10134. "additionalProperties": false
  10135. },
  10136. "ToolStateError": {
  10137. "type": "object",
  10138. "properties": {
  10139. "status": {
  10140. "type": "string",
  10141. "enum": ["error"]
  10142. },
  10143. "input": {
  10144. "type": "object"
  10145. },
  10146. "error": {
  10147. "type": "string"
  10148. },
  10149. "metadata": {
  10150. "type": "object"
  10151. },
  10152. "time": {
  10153. "type": "object",
  10154. "properties": {
  10155. "start": {
  10156. "type": "integer",
  10157. "minimum": 0
  10158. },
  10159. "end": {
  10160. "type": "integer",
  10161. "minimum": 0
  10162. }
  10163. },
  10164. "required": ["start", "end"],
  10165. "additionalProperties": false
  10166. }
  10167. },
  10168. "required": ["status", "input", "error", "time"],
  10169. "additionalProperties": false
  10170. },
  10171. "ToolState": {
  10172. "anyOf": [
  10173. {
  10174. "$ref": "#/components/schemas/ToolStatePending"
  10175. },
  10176. {
  10177. "$ref": "#/components/schemas/ToolStateRunning"
  10178. },
  10179. {
  10180. "$ref": "#/components/schemas/ToolStateCompleted"
  10181. },
  10182. {
  10183. "$ref": "#/components/schemas/ToolStateError"
  10184. }
  10185. ]
  10186. },
  10187. "ToolPart": {
  10188. "type": "object",
  10189. "properties": {
  10190. "id": {
  10191. "type": "string"
  10192. },
  10193. "sessionID": {
  10194. "type": "string"
  10195. },
  10196. "messageID": {
  10197. "type": "string"
  10198. },
  10199. "type": {
  10200. "type": "string",
  10201. "enum": ["tool"]
  10202. },
  10203. "callID": {
  10204. "type": "string"
  10205. },
  10206. "tool": {
  10207. "type": "string"
  10208. },
  10209. "state": {
  10210. "$ref": "#/components/schemas/ToolState"
  10211. },
  10212. "metadata": {
  10213. "type": "object"
  10214. }
  10215. },
  10216. "required": ["id", "sessionID", "messageID", "type", "callID", "tool", "state"],
  10217. "additionalProperties": false
  10218. },
  10219. "StepStartPart": {
  10220. "type": "object",
  10221. "properties": {
  10222. "id": {
  10223. "type": "string"
  10224. },
  10225. "sessionID": {
  10226. "type": "string"
  10227. },
  10228. "messageID": {
  10229. "type": "string"
  10230. },
  10231. "type": {
  10232. "type": "string",
  10233. "enum": ["step-start"]
  10234. },
  10235. "snapshot": {
  10236. "type": "string"
  10237. }
  10238. },
  10239. "required": ["id", "sessionID", "messageID", "type"],
  10240. "additionalProperties": false
  10241. },
  10242. "StepFinishPart": {
  10243. "type": "object",
  10244. "properties": {
  10245. "id": {
  10246. "type": "string"
  10247. },
  10248. "sessionID": {
  10249. "type": "string"
  10250. },
  10251. "messageID": {
  10252. "type": "string"
  10253. },
  10254. "type": {
  10255. "type": "string",
  10256. "enum": ["step-finish"]
  10257. },
  10258. "reason": {
  10259. "type": "string"
  10260. },
  10261. "snapshot": {
  10262. "type": "string"
  10263. },
  10264. "cost": {
  10265. "type": "number"
  10266. },
  10267. "tokens": {
  10268. "type": "object",
  10269. "properties": {
  10270. "total": {
  10271. "type": "integer",
  10272. "minimum": 0
  10273. },
  10274. "input": {
  10275. "type": "integer",
  10276. "minimum": 0
  10277. },
  10278. "output": {
  10279. "type": "integer",
  10280. "minimum": 0
  10281. },
  10282. "reasoning": {
  10283. "type": "integer",
  10284. "minimum": 0
  10285. },
  10286. "cache": {
  10287. "type": "object",
  10288. "properties": {
  10289. "read": {
  10290. "type": "integer",
  10291. "minimum": 0
  10292. },
  10293. "write": {
  10294. "type": "integer",
  10295. "minimum": 0
  10296. }
  10297. },
  10298. "required": ["read", "write"],
  10299. "additionalProperties": false
  10300. }
  10301. },
  10302. "required": ["input", "output", "reasoning", "cache"],
  10303. "additionalProperties": false
  10304. }
  10305. },
  10306. "required": ["id", "sessionID", "messageID", "type", "reason", "cost", "tokens"],
  10307. "additionalProperties": false
  10308. },
  10309. "SnapshotPart": {
  10310. "type": "object",
  10311. "properties": {
  10312. "id": {
  10313. "type": "string"
  10314. },
  10315. "sessionID": {
  10316. "type": "string"
  10317. },
  10318. "messageID": {
  10319. "type": "string"
  10320. },
  10321. "type": {
  10322. "type": "string",
  10323. "enum": ["snapshot"]
  10324. },
  10325. "snapshot": {
  10326. "type": "string"
  10327. }
  10328. },
  10329. "required": ["id", "sessionID", "messageID", "type", "snapshot"],
  10330. "additionalProperties": false
  10331. },
  10332. "PatchPart": {
  10333. "type": "object",
  10334. "properties": {
  10335. "id": {
  10336. "type": "string"
  10337. },
  10338. "sessionID": {
  10339. "type": "string"
  10340. },
  10341. "messageID": {
  10342. "type": "string"
  10343. },
  10344. "type": {
  10345. "type": "string",
  10346. "enum": ["patch"]
  10347. },
  10348. "hash": {
  10349. "type": "string"
  10350. },
  10351. "files": {
  10352. "type": "array",
  10353. "items": {
  10354. "type": "string"
  10355. }
  10356. }
  10357. },
  10358. "required": ["id", "sessionID", "messageID", "type", "hash", "files"],
  10359. "additionalProperties": false
  10360. },
  10361. "AgentPart": {
  10362. "type": "object",
  10363. "properties": {
  10364. "id": {
  10365. "type": "string"
  10366. },
  10367. "sessionID": {
  10368. "type": "string"
  10369. },
  10370. "messageID": {
  10371. "type": "string"
  10372. },
  10373. "type": {
  10374. "type": "string",
  10375. "enum": ["agent"]
  10376. },
  10377. "name": {
  10378. "type": "string"
  10379. },
  10380. "source": {
  10381. "type": "object",
  10382. "properties": {
  10383. "value": {
  10384. "type": "string"
  10385. },
  10386. "start": {
  10387. "type": "integer",
  10388. "minimum": 0
  10389. },
  10390. "end": {
  10391. "type": "integer",
  10392. "minimum": 0
  10393. }
  10394. },
  10395. "required": ["value", "start", "end"],
  10396. "additionalProperties": false
  10397. }
  10398. },
  10399. "required": ["id", "sessionID", "messageID", "type", "name"],
  10400. "additionalProperties": false
  10401. },
  10402. "RetryPart": {
  10403. "type": "object",
  10404. "properties": {
  10405. "id": {
  10406. "type": "string"
  10407. },
  10408. "sessionID": {
  10409. "type": "string"
  10410. },
  10411. "messageID": {
  10412. "type": "string"
  10413. },
  10414. "type": {
  10415. "type": "string",
  10416. "enum": ["retry"]
  10417. },
  10418. "attempt": {
  10419. "type": "integer",
  10420. "minimum": 0
  10421. },
  10422. "error": {
  10423. "$ref": "#/components/schemas/APIError"
  10424. },
  10425. "time": {
  10426. "type": "object",
  10427. "properties": {
  10428. "created": {
  10429. "type": "integer",
  10430. "minimum": 0
  10431. }
  10432. },
  10433. "required": ["created"],
  10434. "additionalProperties": false
  10435. }
  10436. },
  10437. "required": ["id", "sessionID", "messageID", "type", "attempt", "error", "time"],
  10438. "additionalProperties": false
  10439. },
  10440. "CompactionPart": {
  10441. "type": "object",
  10442. "properties": {
  10443. "id": {
  10444. "type": "string"
  10445. },
  10446. "sessionID": {
  10447. "type": "string"
  10448. },
  10449. "messageID": {
  10450. "type": "string"
  10451. },
  10452. "type": {
  10453. "type": "string",
  10454. "enum": ["compaction"]
  10455. },
  10456. "auto": {
  10457. "type": "boolean"
  10458. },
  10459. "overflow": {
  10460. "type": "boolean"
  10461. },
  10462. "tail_start_id": {
  10463. "type": "string"
  10464. }
  10465. },
  10466. "required": ["id", "sessionID", "messageID", "type", "auto"],
  10467. "additionalProperties": false
  10468. },
  10469. "Part": {
  10470. "anyOf": [
  10471. {
  10472. "$ref": "#/components/schemas/TextPart"
  10473. },
  10474. {
  10475. "$ref": "#/components/schemas/SubtaskPart"
  10476. },
  10477. {
  10478. "$ref": "#/components/schemas/ReasoningPart"
  10479. },
  10480. {
  10481. "$ref": "#/components/schemas/FilePart"
  10482. },
  10483. {
  10484. "$ref": "#/components/schemas/ToolPart"
  10485. },
  10486. {
  10487. "$ref": "#/components/schemas/StepStartPart"
  10488. },
  10489. {
  10490. "$ref": "#/components/schemas/StepFinishPart"
  10491. },
  10492. {
  10493. "$ref": "#/components/schemas/SnapshotPart"
  10494. },
  10495. {
  10496. "$ref": "#/components/schemas/PatchPart"
  10497. },
  10498. {
  10499. "$ref": "#/components/schemas/AgentPart"
  10500. },
  10501. {
  10502. "$ref": "#/components/schemas/RetryPart"
  10503. },
  10504. {
  10505. "$ref": "#/components/schemas/CompactionPart"
  10506. }
  10507. ]
  10508. },
  10509. "PermissionAction": {
  10510. "type": "string",
  10511. "enum": ["allow", "deny", "ask"]
  10512. },
  10513. "PermissionRule": {
  10514. "type": "object",
  10515. "properties": {
  10516. "permission": {
  10517. "type": "string"
  10518. },
  10519. "pattern": {
  10520. "type": "string"
  10521. },
  10522. "action": {
  10523. "$ref": "#/components/schemas/PermissionAction"
  10524. }
  10525. },
  10526. "required": ["permission", "pattern", "action"],
  10527. "additionalProperties": false
  10528. },
  10529. "PermissionRuleset": {
  10530. "type": "array",
  10531. "items": {
  10532. "$ref": "#/components/schemas/PermissionRule"
  10533. }
  10534. },
  10535. "Session": {
  10536. "type": "object",
  10537. "properties": {
  10538. "id": {
  10539. "type": "string"
  10540. },
  10541. "slug": {
  10542. "type": "string"
  10543. },
  10544. "projectID": {
  10545. "type": "string"
  10546. },
  10547. "workspaceID": {
  10548. "type": "string"
  10549. },
  10550. "directory": {
  10551. "type": "string"
  10552. },
  10553. "path": {
  10554. "type": "string"
  10555. },
  10556. "parentID": {
  10557. "type": "string"
  10558. },
  10559. "summary": {
  10560. "type": "object",
  10561. "properties": {
  10562. "additions": {
  10563. "type": "integer",
  10564. "minimum": 0
  10565. },
  10566. "deletions": {
  10567. "type": "integer",
  10568. "minimum": 0
  10569. },
  10570. "files": {
  10571. "type": "integer",
  10572. "minimum": 0
  10573. },
  10574. "diffs": {
  10575. "type": "array",
  10576. "items": {
  10577. "$ref": "#/components/schemas/SnapshotFileDiff"
  10578. }
  10579. }
  10580. },
  10581. "required": ["additions", "deletions", "files"],
  10582. "additionalProperties": false
  10583. },
  10584. "share": {
  10585. "type": "object",
  10586. "properties": {
  10587. "url": {
  10588. "type": "string"
  10589. }
  10590. },
  10591. "required": ["url"],
  10592. "additionalProperties": false
  10593. },
  10594. "title": {
  10595. "type": "string"
  10596. },
  10597. "agent": {
  10598. "type": "string"
  10599. },
  10600. "model": {
  10601. "type": "object",
  10602. "properties": {
  10603. "id": {
  10604. "type": "string"
  10605. },
  10606. "providerID": {
  10607. "type": "string"
  10608. },
  10609. "variant": {
  10610. "type": "string"
  10611. }
  10612. },
  10613. "required": ["id", "providerID"],
  10614. "additionalProperties": false
  10615. },
  10616. "version": {
  10617. "type": "string"
  10618. },
  10619. "time": {
  10620. "type": "object",
  10621. "properties": {
  10622. "created": {
  10623. "type": "integer",
  10624. "minimum": 0
  10625. },
  10626. "updated": {
  10627. "type": "integer",
  10628. "minimum": 0
  10629. },
  10630. "compacting": {
  10631. "type": "integer",
  10632. "minimum": 0
  10633. },
  10634. "archived": {
  10635. "type": "number"
  10636. }
  10637. },
  10638. "required": ["created", "updated"],
  10639. "additionalProperties": false
  10640. },
  10641. "permission": {
  10642. "$ref": "#/components/schemas/PermissionRuleset"
  10643. },
  10644. "revert": {
  10645. "type": "object",
  10646. "properties": {
  10647. "messageID": {
  10648. "type": "string"
  10649. },
  10650. "partID": {
  10651. "type": "string"
  10652. },
  10653. "snapshot": {
  10654. "type": "string"
  10655. },
  10656. "diff": {
  10657. "type": "string"
  10658. }
  10659. },
  10660. "required": ["messageID"],
  10661. "additionalProperties": false
  10662. }
  10663. },
  10664. "required": ["id", "slug", "projectID", "directory", "title", "version", "time"],
  10665. "additionalProperties": false
  10666. },
  10667. "Prompt": {
  10668. "type": "object",
  10669. "properties": {
  10670. "text": {
  10671. "type": "string"
  10672. },
  10673. "files": {
  10674. "type": "array",
  10675. "items": {
  10676. "$ref": "#/components/schemas/PromptFileAttachment"
  10677. }
  10678. },
  10679. "agents": {
  10680. "type": "array",
  10681. "items": {
  10682. "$ref": "#/components/schemas/PromptAgentAttachment"
  10683. }
  10684. }
  10685. },
  10686. "required": ["text"],
  10687. "additionalProperties": false
  10688. },
  10689. "GlobalEvent": {
  10690. "type": "object",
  10691. "properties": {
  10692. "directory": {
  10693. "type": "string"
  10694. },
  10695. "project": {
  10696. "type": "string"
  10697. },
  10698. "workspace": {
  10699. "type": "string"
  10700. },
  10701. "payload": {
  10702. "anyOf": [
  10703. {
  10704. "$ref": "#/components/schemas/EventServerInstanceDisposed"
  10705. },
  10706. {
  10707. "$ref": "#/components/schemas/EventFileEdited"
  10708. },
  10709. {
  10710. "$ref": "#/components/schemas/EventFileWatcherUpdated"
  10711. },
  10712. {
  10713. "$ref": "#/components/schemas/EventLspClientDiagnostics"
  10714. },
  10715. {
  10716. "$ref": "#/components/schemas/EventLspUpdated"
  10717. },
  10718. {
  10719. "$ref": "#/components/schemas/EventMessagePartDelta"
  10720. },
  10721. {
  10722. "$ref": "#/components/schemas/EventPermissionAsked"
  10723. },
  10724. {
  10725. "$ref": "#/components/schemas/EventPermissionReplied"
  10726. },
  10727. {
  10728. "$ref": "#/components/schemas/EventSessionDiff"
  10729. },
  10730. {
  10731. "$ref": "#/components/schemas/EventSessionError"
  10732. },
  10733. {
  10734. "$ref": "#/components/schemas/EventInstallationUpdated"
  10735. },
  10736. {
  10737. "$ref": "#/components/schemas/EventInstallationUpdate-available"
  10738. },
  10739. {
  10740. "$ref": "#/components/schemas/EventQuestionAsked"
  10741. },
  10742. {
  10743. "$ref": "#/components/schemas/EventQuestionReplied"
  10744. },
  10745. {
  10746. "$ref": "#/components/schemas/EventQuestionRejected"
  10747. },
  10748. {
  10749. "$ref": "#/components/schemas/EventTodoUpdated"
  10750. },
  10751. {
  10752. "$ref": "#/components/schemas/EventSessionStatus"
  10753. },
  10754. {
  10755. "$ref": "#/components/schemas/EventSessionIdle"
  10756. },
  10757. {
  10758. "$ref": "#/components/schemas/EventSessionCompacted"
  10759. },
  10760. {
  10761. "$ref": "#/components/schemas/Event.tui.prompt.append"
  10762. },
  10763. {
  10764. "$ref": "#/components/schemas/Event.tui.command.execute"
  10765. },
  10766. {
  10767. "$ref": "#/components/schemas/Event.tui.toast.show"
  10768. },
  10769. {
  10770. "$ref": "#/components/schemas/Event.tui.session.select"
  10771. },
  10772. {
  10773. "$ref": "#/components/schemas/EventMcpToolsChanged"
  10774. },
  10775. {
  10776. "$ref": "#/components/schemas/EventMcpBrowserOpenFailed"
  10777. },
  10778. {
  10779. "$ref": "#/components/schemas/EventCommandExecuted"
  10780. },
  10781. {
  10782. "$ref": "#/components/schemas/EventProjectUpdated"
  10783. },
  10784. {
  10785. "$ref": "#/components/schemas/EventVcsBranchUpdated"
  10786. },
  10787. {
  10788. "$ref": "#/components/schemas/EventWorkspaceReady"
  10789. },
  10790. {
  10791. "$ref": "#/components/schemas/EventWorkspaceFailed"
  10792. },
  10793. {
  10794. "$ref": "#/components/schemas/EventWorkspaceStatus"
  10795. },
  10796. {
  10797. "$ref": "#/components/schemas/EventWorktreeReady"
  10798. },
  10799. {
  10800. "$ref": "#/components/schemas/EventWorktreeFailed"
  10801. },
  10802. {
  10803. "$ref": "#/components/schemas/EventPtyCreated"
  10804. },
  10805. {
  10806. "$ref": "#/components/schemas/EventPtyUpdated"
  10807. },
  10808. {
  10809. "$ref": "#/components/schemas/EventPtyExited"
  10810. },
  10811. {
  10812. "$ref": "#/components/schemas/EventPtyDeleted"
  10813. },
  10814. {
  10815. "$ref": "#/components/schemas/EventMessageUpdated"
  10816. },
  10817. {
  10818. "$ref": "#/components/schemas/EventMessageRemoved"
  10819. },
  10820. {
  10821. "$ref": "#/components/schemas/EventMessagePartUpdated"
  10822. },
  10823. {
  10824. "$ref": "#/components/schemas/EventMessagePartRemoved"
  10825. },
  10826. {
  10827. "$ref": "#/components/schemas/EventSessionCreated"
  10828. },
  10829. {
  10830. "$ref": "#/components/schemas/EventSessionUpdated"
  10831. },
  10832. {
  10833. "$ref": "#/components/schemas/EventSessionDeleted"
  10834. },
  10835. {
  10836. "$ref": "#/components/schemas/EventSessionNextAgentSwitched"
  10837. },
  10838. {
  10839. "$ref": "#/components/schemas/EventSessionNextModelSwitched"
  10840. },
  10841. {
  10842. "$ref": "#/components/schemas/EventSessionNextPrompted"
  10843. },
  10844. {
  10845. "$ref": "#/components/schemas/EventSessionNextSynthetic"
  10846. },
  10847. {
  10848. "$ref": "#/components/schemas/EventSessionNextShellStarted"
  10849. },
  10850. {
  10851. "$ref": "#/components/schemas/EventSessionNextShellEnded"
  10852. },
  10853. {
  10854. "$ref": "#/components/schemas/EventSessionNextStepStarted"
  10855. },
  10856. {
  10857. "$ref": "#/components/schemas/EventSessionNextStepEnded"
  10858. },
  10859. {
  10860. "$ref": "#/components/schemas/EventSessionNextStepFailed"
  10861. },
  10862. {
  10863. "$ref": "#/components/schemas/EventSessionNextTextStarted"
  10864. },
  10865. {
  10866. "$ref": "#/components/schemas/EventSessionNextTextDelta"
  10867. },
  10868. {
  10869. "$ref": "#/components/schemas/EventSessionNextTextEnded"
  10870. },
  10871. {
  10872. "$ref": "#/components/schemas/EventSessionNextReasoningStarted"
  10873. },
  10874. {
  10875. "$ref": "#/components/schemas/EventSessionNextReasoningDelta"
  10876. },
  10877. {
  10878. "$ref": "#/components/schemas/EventSessionNextReasoningEnded"
  10879. },
  10880. {
  10881. "$ref": "#/components/schemas/EventSessionNextToolInputStarted"
  10882. },
  10883. {
  10884. "$ref": "#/components/schemas/EventSessionNextToolInputDelta"
  10885. },
  10886. {
  10887. "$ref": "#/components/schemas/EventSessionNextToolInputEnded"
  10888. },
  10889. {
  10890. "$ref": "#/components/schemas/EventSessionNextToolCalled"
  10891. },
  10892. {
  10893. "$ref": "#/components/schemas/EventSessionNextToolProgress"
  10894. },
  10895. {
  10896. "$ref": "#/components/schemas/EventSessionNextToolSuccess"
  10897. },
  10898. {
  10899. "$ref": "#/components/schemas/EventSessionNextToolFailed"
  10900. },
  10901. {
  10902. "$ref": "#/components/schemas/EventSessionNextRetried"
  10903. },
  10904. {
  10905. "$ref": "#/components/schemas/EventSessionNextCompactionStarted"
  10906. },
  10907. {
  10908. "$ref": "#/components/schemas/EventSessionNextCompactionDelta"
  10909. },
  10910. {
  10911. "$ref": "#/components/schemas/EventSessionNextCompactionEnded"
  10912. },
  10913. {
  10914. "$ref": "#/components/schemas/EventServerConnected"
  10915. },
  10916. {
  10917. "$ref": "#/components/schemas/EventGlobalDisposed"
  10918. },
  10919. {
  10920. "$ref": "#/components/schemas/SyncEventMessageUpdated"
  10921. },
  10922. {
  10923. "$ref": "#/components/schemas/SyncEventMessageRemoved"
  10924. },
  10925. {
  10926. "$ref": "#/components/schemas/SyncEventMessagePartUpdated"
  10927. },
  10928. {
  10929. "$ref": "#/components/schemas/SyncEventMessagePartRemoved"
  10930. },
  10931. {
  10932. "$ref": "#/components/schemas/SyncEventSessionCreated"
  10933. },
  10934. {
  10935. "$ref": "#/components/schemas/SyncEventSessionUpdated"
  10936. },
  10937. {
  10938. "$ref": "#/components/schemas/SyncEventSessionDeleted"
  10939. },
  10940. {
  10941. "$ref": "#/components/schemas/SyncEventSessionNextAgentSwitched"
  10942. },
  10943. {
  10944. "$ref": "#/components/schemas/SyncEventSessionNextModelSwitched"
  10945. },
  10946. {
  10947. "$ref": "#/components/schemas/SyncEventSessionNextPrompted"
  10948. },
  10949. {
  10950. "$ref": "#/components/schemas/SyncEventSessionNextSynthetic"
  10951. },
  10952. {
  10953. "$ref": "#/components/schemas/SyncEventSessionNextShellStarted"
  10954. },
  10955. {
  10956. "$ref": "#/components/schemas/SyncEventSessionNextShellEnded"
  10957. },
  10958. {
  10959. "$ref": "#/components/schemas/SyncEventSessionNextStepStarted"
  10960. },
  10961. {
  10962. "$ref": "#/components/schemas/SyncEventSessionNextStepEnded"
  10963. },
  10964. {
  10965. "$ref": "#/components/schemas/SyncEventSessionNextStepFailed"
  10966. },
  10967. {
  10968. "$ref": "#/components/schemas/SyncEventSessionNextTextStarted"
  10969. },
  10970. {
  10971. "$ref": "#/components/schemas/SyncEventSessionNextTextDelta"
  10972. },
  10973. {
  10974. "$ref": "#/components/schemas/SyncEventSessionNextTextEnded"
  10975. },
  10976. {
  10977. "$ref": "#/components/schemas/SyncEventSessionNextReasoningStarted"
  10978. },
  10979. {
  10980. "$ref": "#/components/schemas/SyncEventSessionNextReasoningDelta"
  10981. },
  10982. {
  10983. "$ref": "#/components/schemas/SyncEventSessionNextReasoningEnded"
  10984. },
  10985. {
  10986. "$ref": "#/components/schemas/SyncEventSessionNextToolInputStarted"
  10987. },
  10988. {
  10989. "$ref": "#/components/schemas/SyncEventSessionNextToolInputDelta"
  10990. },
  10991. {
  10992. "$ref": "#/components/schemas/SyncEventSessionNextToolInputEnded"
  10993. },
  10994. {
  10995. "$ref": "#/components/schemas/SyncEventSessionNextToolCalled"
  10996. },
  10997. {
  10998. "$ref": "#/components/schemas/SyncEventSessionNextToolProgress"
  10999. },
  11000. {
  11001. "$ref": "#/components/schemas/SyncEventSessionNextToolSuccess"
  11002. },
  11003. {
  11004. "$ref": "#/components/schemas/SyncEventSessionNextToolFailed"
  11005. },
  11006. {
  11007. "$ref": "#/components/schemas/SyncEventSessionNextRetried"
  11008. },
  11009. {
  11010. "$ref": "#/components/schemas/SyncEventSessionNextCompactionStarted"
  11011. },
  11012. {
  11013. "$ref": "#/components/schemas/SyncEventSessionNextCompactionDelta"
  11014. },
  11015. {
  11016. "$ref": "#/components/schemas/SyncEventSessionNextCompactionEnded"
  11017. }
  11018. ]
  11019. }
  11020. },
  11021. "required": ["directory", "payload"],
  11022. "additionalProperties": false
  11023. },
  11024. "LogLevel": {
  11025. "type": "string",
  11026. "enum": ["DEBUG", "INFO", "WARN", "ERROR"],
  11027. "description": "Log level"
  11028. },
  11029. "ServerConfig": {
  11030. "type": "object",
  11031. "properties": {
  11032. "port": {
  11033. "type": "integer",
  11034. "exclusiveMinimum": 0
  11035. },
  11036. "hostname": {
  11037. "type": "string"
  11038. },
  11039. "mdns": {
  11040. "type": "boolean"
  11041. },
  11042. "mdnsDomain": {
  11043. "type": "string"
  11044. },
  11045. "cors": {
  11046. "type": "array",
  11047. "items": {
  11048. "type": "string"
  11049. }
  11050. }
  11051. },
  11052. "additionalProperties": false,
  11053. "description": "Server configuration for opencode serve and web commands"
  11054. },
  11055. "PermissionActionConfig": {
  11056. "type": "string",
  11057. "enum": ["ask", "allow", "deny"]
  11058. },
  11059. "PermissionObjectConfig": {
  11060. "type": "object",
  11061. "additionalProperties": {
  11062. "$ref": "#/components/schemas/PermissionActionConfig"
  11063. }
  11064. },
  11065. "PermissionRuleConfig": {
  11066. "anyOf": [
  11067. {
  11068. "$ref": "#/components/schemas/PermissionActionConfig"
  11069. },
  11070. {
  11071. "$ref": "#/components/schemas/PermissionObjectConfig"
  11072. }
  11073. ]
  11074. },
  11075. "PermissionConfig": {
  11076. "anyOf": [
  11077. {
  11078. "$ref": "#/components/schemas/PermissionActionConfig"
  11079. },
  11080. {
  11081. "type": "object",
  11082. "properties": {
  11083. "read": {
  11084. "$ref": "#/components/schemas/PermissionRuleConfig"
  11085. },
  11086. "edit": {
  11087. "$ref": "#/components/schemas/PermissionRuleConfig"
  11088. },
  11089. "glob": {
  11090. "$ref": "#/components/schemas/PermissionRuleConfig"
  11091. },
  11092. "grep": {
  11093. "$ref": "#/components/schemas/PermissionRuleConfig"
  11094. },
  11095. "list": {
  11096. "$ref": "#/components/schemas/PermissionRuleConfig"
  11097. },
  11098. "bash": {
  11099. "$ref": "#/components/schemas/PermissionRuleConfig"
  11100. },
  11101. "task": {
  11102. "$ref": "#/components/schemas/PermissionRuleConfig"
  11103. },
  11104. "external_directory": {
  11105. "$ref": "#/components/schemas/PermissionRuleConfig"
  11106. },
  11107. "todowrite": {
  11108. "$ref": "#/components/schemas/PermissionActionConfig"
  11109. },
  11110. "question": {
  11111. "$ref": "#/components/schemas/PermissionActionConfig"
  11112. },
  11113. "webfetch": {
  11114. "$ref": "#/components/schemas/PermissionActionConfig"
  11115. },
  11116. "websearch": {
  11117. "$ref": "#/components/schemas/PermissionActionConfig"
  11118. },
  11119. "lsp": {
  11120. "$ref": "#/components/schemas/PermissionRuleConfig"
  11121. },
  11122. "doom_loop": {
  11123. "$ref": "#/components/schemas/PermissionActionConfig"
  11124. },
  11125. "skill": {
  11126. "$ref": "#/components/schemas/PermissionRuleConfig"
  11127. }
  11128. },
  11129. "additionalProperties": {
  11130. "$ref": "#/components/schemas/PermissionRuleConfig"
  11131. }
  11132. }
  11133. ]
  11134. },
  11135. "AgentConfig": {
  11136. "type": "object",
  11137. "properties": {
  11138. "model": {
  11139. "type": "string"
  11140. },
  11141. "variant": {
  11142. "type": "string"
  11143. },
  11144. "temperature": {
  11145. "type": "number"
  11146. },
  11147. "top_p": {
  11148. "type": "number"
  11149. },
  11150. "prompt": {
  11151. "type": "string"
  11152. },
  11153. "tools": {
  11154. "type": "object",
  11155. "additionalProperties": {
  11156. "type": "boolean"
  11157. }
  11158. },
  11159. "disable": {
  11160. "type": "boolean"
  11161. },
  11162. "description": {
  11163. "type": "string"
  11164. },
  11165. "mode": {
  11166. "type": "string",
  11167. "enum": ["subagent", "primary", "all"]
  11168. },
  11169. "hidden": {
  11170. "type": "boolean"
  11171. },
  11172. "options": {
  11173. "type": "object"
  11174. },
  11175. "color": {
  11176. "anyOf": [
  11177. {
  11178. "type": "string",
  11179. "pattern": "^#[0-9a-fA-F]{6}$"
  11180. },
  11181. {
  11182. "type": "string",
  11183. "enum": ["primary", "secondary", "accent", "success", "warning", "error", "info"]
  11184. }
  11185. ],
  11186. "description": "Hex color code (e.g., #FF5733) or theme color (e.g., primary)"
  11187. },
  11188. "steps": {
  11189. "type": "integer",
  11190. "exclusiveMinimum": 0
  11191. },
  11192. "maxSteps": {
  11193. "type": "integer",
  11194. "exclusiveMinimum": 0
  11195. },
  11196. "permission": {
  11197. "$ref": "#/components/schemas/PermissionConfig"
  11198. }
  11199. },
  11200. "additionalProperties": {}
  11201. },
  11202. "ProviderConfig": {
  11203. "type": "object",
  11204. "properties": {
  11205. "api": {
  11206. "type": "string"
  11207. },
  11208. "name": {
  11209. "type": "string"
  11210. },
  11211. "env": {
  11212. "type": "array",
  11213. "items": {
  11214. "type": "string"
  11215. }
  11216. },
  11217. "id": {
  11218. "type": "string"
  11219. },
  11220. "npm": {
  11221. "type": "string"
  11222. },
  11223. "whitelist": {
  11224. "type": "array",
  11225. "items": {
  11226. "type": "string"
  11227. }
  11228. },
  11229. "blacklist": {
  11230. "type": "array",
  11231. "items": {
  11232. "type": "string"
  11233. }
  11234. },
  11235. "options": {
  11236. "type": "object",
  11237. "properties": {
  11238. "apiKey": {
  11239. "type": "string"
  11240. },
  11241. "baseURL": {
  11242. "type": "string"
  11243. },
  11244. "enterpriseUrl": {
  11245. "type": "string"
  11246. },
  11247. "setCacheKey": {
  11248. "type": "boolean"
  11249. },
  11250. "timeout": {
  11251. "anyOf": [
  11252. {
  11253. "type": "integer",
  11254. "exclusiveMinimum": 0
  11255. },
  11256. {
  11257. "type": "boolean",
  11258. "enum": [false]
  11259. }
  11260. ],
  11261. "description": "Timeout in milliseconds for requests to this provider. Default is 300000 (5 minutes). Set to false to disable timeout."
  11262. },
  11263. "chunkTimeout": {
  11264. "type": "integer",
  11265. "exclusiveMinimum": 0
  11266. }
  11267. },
  11268. "additionalProperties": {}
  11269. },
  11270. "models": {
  11271. "type": "object",
  11272. "additionalProperties": {
  11273. "type": "object",
  11274. "properties": {
  11275. "id": {
  11276. "type": "string"
  11277. },
  11278. "name": {
  11279. "type": "string"
  11280. },
  11281. "family": {
  11282. "type": "string"
  11283. },
  11284. "release_date": {
  11285. "type": "string"
  11286. },
  11287. "attachment": {
  11288. "type": "boolean"
  11289. },
  11290. "reasoning": {
  11291. "type": "boolean"
  11292. },
  11293. "temperature": {
  11294. "type": "boolean"
  11295. },
  11296. "tool_call": {
  11297. "type": "boolean"
  11298. },
  11299. "interleaved": {
  11300. "anyOf": [
  11301. {
  11302. "type": "boolean",
  11303. "enum": [true]
  11304. },
  11305. {
  11306. "type": "object",
  11307. "properties": {
  11308. "field": {
  11309. "type": "string",
  11310. "enum": ["reasoning_content", "reasoning_details"]
  11311. }
  11312. },
  11313. "required": ["field"],
  11314. "additionalProperties": false
  11315. }
  11316. ]
  11317. },
  11318. "cost": {
  11319. "type": "object",
  11320. "properties": {
  11321. "input": {
  11322. "type": "number"
  11323. },
  11324. "output": {
  11325. "type": "number"
  11326. },
  11327. "cache_read": {
  11328. "type": "number"
  11329. },
  11330. "cache_write": {
  11331. "type": "number"
  11332. },
  11333. "context_over_200k": {
  11334. "type": "object",
  11335. "properties": {
  11336. "input": {
  11337. "type": "number"
  11338. },
  11339. "output": {
  11340. "type": "number"
  11341. },
  11342. "cache_read": {
  11343. "type": "number"
  11344. },
  11345. "cache_write": {
  11346. "type": "number"
  11347. }
  11348. },
  11349. "required": ["input", "output"],
  11350. "additionalProperties": false
  11351. }
  11352. },
  11353. "required": ["input", "output"],
  11354. "additionalProperties": false
  11355. },
  11356. "limit": {
  11357. "type": "object",
  11358. "properties": {
  11359. "context": {
  11360. "type": "number"
  11361. },
  11362. "input": {
  11363. "type": "number"
  11364. },
  11365. "output": {
  11366. "type": "number"
  11367. }
  11368. },
  11369. "required": ["context", "output"],
  11370. "additionalProperties": false
  11371. },
  11372. "modalities": {
  11373. "type": "object",
  11374. "properties": {
  11375. "input": {
  11376. "type": "array",
  11377. "items": {
  11378. "type": "string",
  11379. "enum": ["text", "audio", "image", "video", "pdf"]
  11380. }
  11381. },
  11382. "output": {
  11383. "type": "array",
  11384. "items": {
  11385. "type": "string",
  11386. "enum": ["text", "audio", "image", "video", "pdf"]
  11387. }
  11388. }
  11389. },
  11390. "required": ["input", "output"],
  11391. "additionalProperties": false
  11392. },
  11393. "experimental": {
  11394. "type": "boolean"
  11395. },
  11396. "status": {
  11397. "type": "string",
  11398. "enum": ["alpha", "beta", "deprecated"]
  11399. },
  11400. "provider": {
  11401. "type": "object",
  11402. "properties": {
  11403. "npm": {
  11404. "type": "string"
  11405. },
  11406. "api": {
  11407. "type": "string"
  11408. }
  11409. },
  11410. "additionalProperties": false
  11411. },
  11412. "options": {
  11413. "type": "object"
  11414. },
  11415. "headers": {
  11416. "type": "object",
  11417. "additionalProperties": {
  11418. "type": "string"
  11419. }
  11420. },
  11421. "variants": {
  11422. "type": "object",
  11423. "additionalProperties": {
  11424. "type": "object",
  11425. "properties": {
  11426. "disabled": {
  11427. "type": "boolean"
  11428. }
  11429. },
  11430. "additionalProperties": {}
  11431. },
  11432. "description": "Variant-specific configuration"
  11433. }
  11434. },
  11435. "additionalProperties": false
  11436. }
  11437. }
  11438. },
  11439. "additionalProperties": false
  11440. },
  11441. "McpLocalConfig": {
  11442. "type": "object",
  11443. "properties": {
  11444. "type": {
  11445. "type": "string",
  11446. "enum": ["local"],
  11447. "description": "Type of MCP server connection"
  11448. },
  11449. "command": {
  11450. "type": "array",
  11451. "items": {
  11452. "type": "string"
  11453. },
  11454. "description": "Command and arguments to run the MCP server"
  11455. },
  11456. "environment": {
  11457. "type": "object",
  11458. "additionalProperties": {
  11459. "type": "string"
  11460. }
  11461. },
  11462. "enabled": {
  11463. "type": "boolean"
  11464. },
  11465. "timeout": {
  11466. "type": "integer",
  11467. "exclusiveMinimum": 0
  11468. }
  11469. },
  11470. "required": ["type", "command"],
  11471. "additionalProperties": false
  11472. },
  11473. "McpOAuthConfig": {
  11474. "type": "object",
  11475. "properties": {
  11476. "clientId": {
  11477. "type": "string"
  11478. },
  11479. "clientSecret": {
  11480. "type": "string"
  11481. },
  11482. "scope": {
  11483. "type": "string"
  11484. },
  11485. "redirectUri": {
  11486. "type": "string"
  11487. }
  11488. },
  11489. "additionalProperties": false
  11490. },
  11491. "McpRemoteConfig": {
  11492. "type": "object",
  11493. "properties": {
  11494. "type": {
  11495. "type": "string",
  11496. "enum": ["remote"],
  11497. "description": "Type of MCP server connection"
  11498. },
  11499. "url": {
  11500. "type": "string",
  11501. "description": "URL of the remote MCP server"
  11502. },
  11503. "enabled": {
  11504. "type": "boolean"
  11505. },
  11506. "headers": {
  11507. "type": "object",
  11508. "additionalProperties": {
  11509. "type": "string"
  11510. }
  11511. },
  11512. "oauth": {
  11513. "anyOf": [
  11514. {
  11515. "$ref": "#/components/schemas/McpOAuthConfig"
  11516. },
  11517. {
  11518. "type": "boolean",
  11519. "enum": [false]
  11520. }
  11521. ],
  11522. "description": "OAuth authentication configuration for the MCP server. Set to false to disable OAuth auto-detection."
  11523. },
  11524. "timeout": {
  11525. "type": "integer",
  11526. "exclusiveMinimum": 0
  11527. }
  11528. },
  11529. "required": ["type", "url"],
  11530. "additionalProperties": false
  11531. },
  11532. "LayoutConfig": {
  11533. "type": "string",
  11534. "enum": ["auto", "stretch"],
  11535. "description": "@deprecated Always uses stretch layout."
  11536. },
  11537. "Config": {
  11538. "type": "object",
  11539. "properties": {
  11540. "$schema": {
  11541. "type": "string"
  11542. },
  11543. "shell": {
  11544. "type": "string"
  11545. },
  11546. "logLevel": {
  11547. "$ref": "#/components/schemas/LogLevel"
  11548. },
  11549. "server": {
  11550. "$ref": "#/components/schemas/ServerConfig"
  11551. },
  11552. "command": {
  11553. "type": "object",
  11554. "additionalProperties": {
  11555. "type": "object",
  11556. "properties": {
  11557. "template": {
  11558. "type": "string"
  11559. },
  11560. "description": {
  11561. "type": "string"
  11562. },
  11563. "agent": {
  11564. "type": "string"
  11565. },
  11566. "model": {
  11567. "type": "string"
  11568. },
  11569. "subtask": {
  11570. "type": "boolean"
  11571. }
  11572. },
  11573. "required": ["template"],
  11574. "additionalProperties": false
  11575. }
  11576. },
  11577. "skills": {
  11578. "type": "object",
  11579. "properties": {
  11580. "paths": {
  11581. "type": "array",
  11582. "items": {
  11583. "type": "string"
  11584. }
  11585. },
  11586. "urls": {
  11587. "type": "array",
  11588. "items": {
  11589. "type": "string"
  11590. }
  11591. }
  11592. },
  11593. "additionalProperties": false
  11594. },
  11595. "watcher": {
  11596. "type": "object",
  11597. "properties": {
  11598. "ignore": {
  11599. "type": "array",
  11600. "items": {
  11601. "type": "string"
  11602. }
  11603. }
  11604. },
  11605. "additionalProperties": false
  11606. },
  11607. "snapshot": {
  11608. "type": "boolean"
  11609. },
  11610. "plugin": {
  11611. "type": "array",
  11612. "items": {
  11613. "anyOf": [
  11614. {
  11615. "type": "string"
  11616. },
  11617. {
  11618. "type": "array",
  11619. "prefixItems": [
  11620. {
  11621. "type": "string"
  11622. },
  11623. {
  11624. "type": "object"
  11625. }
  11626. ],
  11627. "maxItems": 2,
  11628. "minItems": 2
  11629. }
  11630. ]
  11631. }
  11632. },
  11633. "share": {
  11634. "type": "string",
  11635. "enum": ["manual", "auto", "disabled"]
  11636. },
  11637. "autoshare": {
  11638. "type": "boolean"
  11639. },
  11640. "autoupdate": {
  11641. "anyOf": [
  11642. {
  11643. "type": "boolean"
  11644. },
  11645. {
  11646. "type": "string",
  11647. "enum": ["notify"]
  11648. }
  11649. ],
  11650. "description": "Automatically update to the latest version. Set to true to auto-update, false to disable, or 'notify' to show update notifications"
  11651. },
  11652. "disabled_providers": {
  11653. "type": "array",
  11654. "items": {
  11655. "type": "string"
  11656. }
  11657. },
  11658. "enabled_providers": {
  11659. "type": "array",
  11660. "items": {
  11661. "type": "string"
  11662. }
  11663. },
  11664. "model": {
  11665. "type": "string"
  11666. },
  11667. "small_model": {
  11668. "type": "string"
  11669. },
  11670. "default_agent": {
  11671. "type": "string"
  11672. },
  11673. "username": {
  11674. "type": "string"
  11675. },
  11676. "mode": {
  11677. "type": "object",
  11678. "properties": {
  11679. "build": {
  11680. "$ref": "#/components/schemas/AgentConfig"
  11681. },
  11682. "plan": {
  11683. "$ref": "#/components/schemas/AgentConfig"
  11684. }
  11685. },
  11686. "additionalProperties": {
  11687. "$ref": "#/components/schemas/AgentConfig"
  11688. }
  11689. },
  11690. "agent": {
  11691. "type": "object",
  11692. "properties": {
  11693. "plan": {
  11694. "$ref": "#/components/schemas/AgentConfig"
  11695. },
  11696. "build": {
  11697. "$ref": "#/components/schemas/AgentConfig"
  11698. },
  11699. "general": {
  11700. "$ref": "#/components/schemas/AgentConfig"
  11701. },
  11702. "explore": {
  11703. "$ref": "#/components/schemas/AgentConfig"
  11704. },
  11705. "title": {
  11706. "$ref": "#/components/schemas/AgentConfig"
  11707. },
  11708. "summary": {
  11709. "$ref": "#/components/schemas/AgentConfig"
  11710. },
  11711. "compaction": {
  11712. "$ref": "#/components/schemas/AgentConfig"
  11713. }
  11714. },
  11715. "additionalProperties": {
  11716. "$ref": "#/components/schemas/AgentConfig"
  11717. }
  11718. },
  11719. "provider": {
  11720. "type": "object",
  11721. "additionalProperties": {
  11722. "$ref": "#/components/schemas/ProviderConfig"
  11723. }
  11724. },
  11725. "mcp": {
  11726. "type": "object",
  11727. "additionalProperties": {
  11728. "anyOf": [
  11729. {
  11730. "$ref": "#/components/schemas/McpLocalConfig"
  11731. },
  11732. {
  11733. "$ref": "#/components/schemas/McpRemoteConfig"
  11734. },
  11735. {
  11736. "type": "object",
  11737. "properties": {
  11738. "enabled": {
  11739. "type": "boolean"
  11740. }
  11741. },
  11742. "required": ["enabled"],
  11743. "additionalProperties": false
  11744. }
  11745. ]
  11746. }
  11747. },
  11748. "formatter": {
  11749. "anyOf": [
  11750. {
  11751. "type": "boolean"
  11752. },
  11753. {
  11754. "type": "object",
  11755. "additionalProperties": {
  11756. "type": "object",
  11757. "properties": {
  11758. "disabled": {
  11759. "type": "boolean"
  11760. },
  11761. "command": {
  11762. "type": "array",
  11763. "items": {
  11764. "type": "string"
  11765. }
  11766. },
  11767. "environment": {
  11768. "type": "object",
  11769. "additionalProperties": {
  11770. "type": "string"
  11771. }
  11772. },
  11773. "extensions": {
  11774. "type": "array",
  11775. "items": {
  11776. "type": "string"
  11777. }
  11778. }
  11779. },
  11780. "additionalProperties": false
  11781. }
  11782. }
  11783. ],
  11784. "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."
  11785. },
  11786. "lsp": {
  11787. "anyOf": [
  11788. {
  11789. "type": "boolean"
  11790. },
  11791. {
  11792. "type": "object",
  11793. "additionalProperties": {
  11794. "anyOf": [
  11795. {
  11796. "type": "object",
  11797. "properties": {
  11798. "disabled": {
  11799. "type": "boolean",
  11800. "enum": [true]
  11801. }
  11802. },
  11803. "required": ["disabled"],
  11804. "additionalProperties": false
  11805. },
  11806. {
  11807. "type": "object",
  11808. "properties": {
  11809. "command": {
  11810. "type": "array",
  11811. "items": {
  11812. "type": "string"
  11813. }
  11814. },
  11815. "extensions": {
  11816. "type": "array",
  11817. "items": {
  11818. "type": "string"
  11819. }
  11820. },
  11821. "disabled": {
  11822. "type": "boolean"
  11823. },
  11824. "env": {
  11825. "type": "object",
  11826. "additionalProperties": {
  11827. "type": "string"
  11828. }
  11829. },
  11830. "initialization": {
  11831. "type": "object"
  11832. }
  11833. },
  11834. "required": ["command"],
  11835. "additionalProperties": false
  11836. }
  11837. ]
  11838. }
  11839. }
  11840. ],
  11841. "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."
  11842. },
  11843. "instructions": {
  11844. "type": "array",
  11845. "items": {
  11846. "type": "string"
  11847. }
  11848. },
  11849. "layout": {
  11850. "$ref": "#/components/schemas/LayoutConfig"
  11851. },
  11852. "permission": {
  11853. "$ref": "#/components/schemas/PermissionConfig"
  11854. },
  11855. "tools": {
  11856. "type": "object",
  11857. "additionalProperties": {
  11858. "type": "boolean"
  11859. }
  11860. },
  11861. "enterprise": {
  11862. "type": "object",
  11863. "properties": {
  11864. "url": {
  11865. "type": "string"
  11866. }
  11867. },
  11868. "additionalProperties": false
  11869. },
  11870. "tool_output": {
  11871. "type": "object",
  11872. "properties": {
  11873. "max_lines": {
  11874. "type": "integer",
  11875. "exclusiveMinimum": 0
  11876. },
  11877. "max_bytes": {
  11878. "type": "integer",
  11879. "exclusiveMinimum": 0
  11880. }
  11881. },
  11882. "additionalProperties": false
  11883. },
  11884. "compaction": {
  11885. "type": "object",
  11886. "properties": {
  11887. "auto": {
  11888. "type": "boolean"
  11889. },
  11890. "prune": {
  11891. "type": "boolean"
  11892. },
  11893. "tail_turns": {
  11894. "type": "integer",
  11895. "minimum": 0
  11896. },
  11897. "preserve_recent_tokens": {
  11898. "type": "integer",
  11899. "minimum": 0
  11900. },
  11901. "reserved": {
  11902. "type": "integer",
  11903. "minimum": 0
  11904. }
  11905. },
  11906. "additionalProperties": false
  11907. },
  11908. "experimental": {
  11909. "type": "object",
  11910. "properties": {
  11911. "disable_paste_summary": {
  11912. "type": "boolean"
  11913. },
  11914. "batch_tool": {
  11915. "type": "boolean"
  11916. },
  11917. "openTelemetry": {
  11918. "type": "boolean"
  11919. },
  11920. "primary_tools": {
  11921. "type": "array",
  11922. "items": {
  11923. "type": "string"
  11924. }
  11925. },
  11926. "continue_loop_on_deny": {
  11927. "type": "boolean"
  11928. },
  11929. "mcp_timeout": {
  11930. "type": "integer",
  11931. "exclusiveMinimum": 0
  11932. }
  11933. },
  11934. "additionalProperties": false
  11935. }
  11936. },
  11937. "additionalProperties": false
  11938. },
  11939. "Model": {
  11940. "type": "object",
  11941. "properties": {
  11942. "id": {
  11943. "type": "string"
  11944. },
  11945. "providerID": {
  11946. "type": "string"
  11947. },
  11948. "api": {
  11949. "type": "object",
  11950. "properties": {
  11951. "id": {
  11952. "type": "string"
  11953. },
  11954. "url": {
  11955. "type": "string"
  11956. },
  11957. "npm": {
  11958. "type": "string"
  11959. }
  11960. },
  11961. "required": ["id", "url", "npm"],
  11962. "additionalProperties": false
  11963. },
  11964. "name": {
  11965. "type": "string"
  11966. },
  11967. "family": {
  11968. "type": "string"
  11969. },
  11970. "capabilities": {
  11971. "type": "object",
  11972. "properties": {
  11973. "temperature": {
  11974. "type": "boolean"
  11975. },
  11976. "reasoning": {
  11977. "type": "boolean"
  11978. },
  11979. "attachment": {
  11980. "type": "boolean"
  11981. },
  11982. "toolcall": {
  11983. "type": "boolean"
  11984. },
  11985. "input": {
  11986. "type": "object",
  11987. "properties": {
  11988. "text": {
  11989. "type": "boolean"
  11990. },
  11991. "audio": {
  11992. "type": "boolean"
  11993. },
  11994. "image": {
  11995. "type": "boolean"
  11996. },
  11997. "video": {
  11998. "type": "boolean"
  11999. },
  12000. "pdf": {
  12001. "type": "boolean"
  12002. }
  12003. },
  12004. "required": ["text", "audio", "image", "video", "pdf"],
  12005. "additionalProperties": false
  12006. },
  12007. "output": {
  12008. "type": "object",
  12009. "properties": {
  12010. "text": {
  12011. "type": "boolean"
  12012. },
  12013. "audio": {
  12014. "type": "boolean"
  12015. },
  12016. "image": {
  12017. "type": "boolean"
  12018. },
  12019. "video": {
  12020. "type": "boolean"
  12021. },
  12022. "pdf": {
  12023. "type": "boolean"
  12024. }
  12025. },
  12026. "required": ["text", "audio", "image", "video", "pdf"],
  12027. "additionalProperties": false
  12028. },
  12029. "interleaved": {
  12030. "anyOf": [
  12031. {
  12032. "type": "boolean"
  12033. },
  12034. {
  12035. "type": "object",
  12036. "properties": {
  12037. "field": {
  12038. "type": "string",
  12039. "enum": ["reasoning_content", "reasoning_details"]
  12040. }
  12041. },
  12042. "required": ["field"],
  12043. "additionalProperties": false
  12044. }
  12045. ]
  12046. }
  12047. },
  12048. "required": ["temperature", "reasoning", "attachment", "toolcall", "input", "output", "interleaved"],
  12049. "additionalProperties": false
  12050. },
  12051. "cost": {
  12052. "type": "object",
  12053. "properties": {
  12054. "input": {
  12055. "type": "number"
  12056. },
  12057. "output": {
  12058. "type": "number"
  12059. },
  12060. "cache": {
  12061. "type": "object",
  12062. "properties": {
  12063. "read": {
  12064. "type": "number"
  12065. },
  12066. "write": {
  12067. "type": "number"
  12068. }
  12069. },
  12070. "required": ["read", "write"],
  12071. "additionalProperties": false
  12072. },
  12073. "experimentalOver200K": {
  12074. "type": "object",
  12075. "properties": {
  12076. "input": {
  12077. "type": "number"
  12078. },
  12079. "output": {
  12080. "type": "number"
  12081. },
  12082. "cache": {
  12083. "type": "object",
  12084. "properties": {
  12085. "read": {
  12086. "type": "number"
  12087. },
  12088. "write": {
  12089. "type": "number"
  12090. }
  12091. },
  12092. "required": ["read", "write"],
  12093. "additionalProperties": false
  12094. }
  12095. },
  12096. "required": ["input", "output", "cache"],
  12097. "additionalProperties": false
  12098. }
  12099. },
  12100. "required": ["input", "output", "cache"],
  12101. "additionalProperties": false
  12102. },
  12103. "limit": {
  12104. "type": "object",
  12105. "properties": {
  12106. "context": {
  12107. "type": "number"
  12108. },
  12109. "input": {
  12110. "type": "number"
  12111. },
  12112. "output": {
  12113. "type": "number"
  12114. }
  12115. },
  12116. "required": ["context", "output"],
  12117. "additionalProperties": false
  12118. },
  12119. "status": {
  12120. "type": "string",
  12121. "enum": ["alpha", "beta", "deprecated", "active"]
  12122. },
  12123. "options": {
  12124. "type": "object"
  12125. },
  12126. "headers": {
  12127. "type": "object",
  12128. "additionalProperties": {
  12129. "type": "string"
  12130. }
  12131. },
  12132. "release_date": {
  12133. "type": "string"
  12134. },
  12135. "variants": {
  12136. "type": "object",
  12137. "additionalProperties": {
  12138. "type": "object"
  12139. }
  12140. }
  12141. },
  12142. "required": [
  12143. "id",
  12144. "providerID",
  12145. "api",
  12146. "name",
  12147. "capabilities",
  12148. "cost",
  12149. "limit",
  12150. "status",
  12151. "options",
  12152. "headers",
  12153. "release_date"
  12154. ],
  12155. "additionalProperties": false
  12156. },
  12157. "Provider": {
  12158. "type": "object",
  12159. "properties": {
  12160. "id": {
  12161. "type": "string"
  12162. },
  12163. "name": {
  12164. "type": "string"
  12165. },
  12166. "source": {
  12167. "type": "string",
  12168. "enum": ["env", "config", "custom", "api"]
  12169. },
  12170. "env": {
  12171. "type": "array",
  12172. "items": {
  12173. "type": "string"
  12174. }
  12175. },
  12176. "key": {
  12177. "type": "string"
  12178. },
  12179. "options": {
  12180. "type": "object"
  12181. },
  12182. "models": {
  12183. "type": "object",
  12184. "additionalProperties": {
  12185. "$ref": "#/components/schemas/Model"
  12186. }
  12187. }
  12188. },
  12189. "required": ["id", "name", "source", "env", "options", "models"],
  12190. "additionalProperties": false
  12191. },
  12192. "ConsoleState": {
  12193. "type": "object",
  12194. "properties": {
  12195. "consoleManagedProviders": {
  12196. "type": "array",
  12197. "items": {
  12198. "type": "string"
  12199. }
  12200. },
  12201. "activeOrgName": {
  12202. "type": "string"
  12203. },
  12204. "switchableOrgCount": {
  12205. "type": "integer",
  12206. "minimum": 0
  12207. }
  12208. },
  12209. "required": ["consoleManagedProviders", "switchableOrgCount"],
  12210. "additionalProperties": false
  12211. },
  12212. "ToolListItem": {
  12213. "type": "object",
  12214. "properties": {
  12215. "id": {
  12216. "type": "string"
  12217. },
  12218. "description": {
  12219. "type": "string"
  12220. },
  12221. "parameters": {}
  12222. },
  12223. "required": ["id", "description", "parameters"],
  12224. "additionalProperties": false
  12225. },
  12226. "ToolList": {
  12227. "type": "array",
  12228. "items": {
  12229. "$ref": "#/components/schemas/ToolListItem"
  12230. }
  12231. },
  12232. "ToolIDs": {
  12233. "type": "array",
  12234. "items": {
  12235. "type": "string"
  12236. }
  12237. },
  12238. "WorktreeCreateInput": {
  12239. "type": "object",
  12240. "properties": {
  12241. "name": {
  12242. "type": "string"
  12243. },
  12244. "startCommand": {
  12245. "type": "string",
  12246. "description": "Additional startup script to run after the project's start command"
  12247. }
  12248. },
  12249. "additionalProperties": false
  12250. },
  12251. "Worktree": {
  12252. "type": "object",
  12253. "properties": {
  12254. "name": {
  12255. "type": "string"
  12256. },
  12257. "branch": {
  12258. "type": "string"
  12259. },
  12260. "directory": {
  12261. "type": "string"
  12262. }
  12263. },
  12264. "required": ["name", "branch", "directory"],
  12265. "additionalProperties": false
  12266. },
  12267. "WorktreeRemoveInput": {
  12268. "type": "object",
  12269. "properties": {
  12270. "directory": {
  12271. "type": "string"
  12272. }
  12273. },
  12274. "required": ["directory"],
  12275. "additionalProperties": false
  12276. },
  12277. "WorktreeResetInput": {
  12278. "type": "object",
  12279. "properties": {
  12280. "directory": {
  12281. "type": "string"
  12282. }
  12283. },
  12284. "required": ["directory"],
  12285. "additionalProperties": false
  12286. },
  12287. "ProjectSummary": {
  12288. "type": "object",
  12289. "properties": {
  12290. "id": {
  12291. "type": "string"
  12292. },
  12293. "name": {
  12294. "type": "string"
  12295. },
  12296. "worktree": {
  12297. "type": "string"
  12298. }
  12299. },
  12300. "required": ["id", "worktree"],
  12301. "additionalProperties": false
  12302. },
  12303. "GlobalSession": {
  12304. "type": "object",
  12305. "properties": {
  12306. "id": {
  12307. "type": "string"
  12308. },
  12309. "slug": {
  12310. "type": "string"
  12311. },
  12312. "projectID": {
  12313. "type": "string"
  12314. },
  12315. "workspaceID": {
  12316. "type": "string"
  12317. },
  12318. "directory": {
  12319. "type": "string"
  12320. },
  12321. "path": {
  12322. "type": "string"
  12323. },
  12324. "parentID": {
  12325. "type": "string"
  12326. },
  12327. "summary": {
  12328. "type": "object",
  12329. "properties": {
  12330. "additions": {
  12331. "type": "integer",
  12332. "minimum": 0
  12333. },
  12334. "deletions": {
  12335. "type": "integer",
  12336. "minimum": 0
  12337. },
  12338. "files": {
  12339. "type": "integer",
  12340. "minimum": 0
  12341. },
  12342. "diffs": {
  12343. "type": "array",
  12344. "items": {
  12345. "$ref": "#/components/schemas/SnapshotFileDiff"
  12346. }
  12347. }
  12348. },
  12349. "required": ["additions", "deletions", "files"],
  12350. "additionalProperties": false
  12351. },
  12352. "share": {
  12353. "type": "object",
  12354. "properties": {
  12355. "url": {
  12356. "type": "string"
  12357. }
  12358. },
  12359. "required": ["url"],
  12360. "additionalProperties": false
  12361. },
  12362. "title": {
  12363. "type": "string"
  12364. },
  12365. "agent": {
  12366. "type": "string"
  12367. },
  12368. "model": {
  12369. "type": "object",
  12370. "properties": {
  12371. "id": {
  12372. "type": "string"
  12373. },
  12374. "providerID": {
  12375. "type": "string"
  12376. },
  12377. "variant": {
  12378. "type": "string"
  12379. }
  12380. },
  12381. "required": ["id", "providerID"],
  12382. "additionalProperties": false
  12383. },
  12384. "version": {
  12385. "type": "string"
  12386. },
  12387. "time": {
  12388. "type": "object",
  12389. "properties": {
  12390. "created": {
  12391. "type": "integer",
  12392. "minimum": 0
  12393. },
  12394. "updated": {
  12395. "type": "integer",
  12396. "minimum": 0
  12397. },
  12398. "compacting": {
  12399. "type": "integer",
  12400. "minimum": 0
  12401. },
  12402. "archived": {
  12403. "type": "number"
  12404. }
  12405. },
  12406. "required": ["created", "updated"],
  12407. "additionalProperties": false
  12408. },
  12409. "permission": {
  12410. "$ref": "#/components/schemas/PermissionRuleset"
  12411. },
  12412. "revert": {
  12413. "type": "object",
  12414. "properties": {
  12415. "messageID": {
  12416. "type": "string"
  12417. },
  12418. "partID": {
  12419. "type": "string"
  12420. },
  12421. "snapshot": {
  12422. "type": "string"
  12423. },
  12424. "diff": {
  12425. "type": "string"
  12426. }
  12427. },
  12428. "required": ["messageID"],
  12429. "additionalProperties": false
  12430. },
  12431. "project": {
  12432. "anyOf": [
  12433. {
  12434. "$ref": "#/components/schemas/ProjectSummary"
  12435. },
  12436. {
  12437. "type": "null"
  12438. }
  12439. ]
  12440. }
  12441. },
  12442. "required": ["id", "slug", "projectID", "directory", "title", "version", "time", "project"],
  12443. "additionalProperties": false
  12444. },
  12445. "McpResource": {
  12446. "type": "object",
  12447. "properties": {
  12448. "name": {
  12449. "type": "string"
  12450. },
  12451. "uri": {
  12452. "type": "string"
  12453. },
  12454. "description": {
  12455. "type": "string"
  12456. },
  12457. "mimeType": {
  12458. "type": "string"
  12459. },
  12460. "client": {
  12461. "type": "string"
  12462. }
  12463. },
  12464. "required": ["name", "uri", "client"],
  12465. "additionalProperties": false
  12466. },
  12467. "Symbol": {
  12468. "type": "object",
  12469. "properties": {
  12470. "name": {
  12471. "type": "string"
  12472. },
  12473. "kind": {
  12474. "type": "integer",
  12475. "minimum": 0
  12476. },
  12477. "location": {
  12478. "type": "object",
  12479. "properties": {
  12480. "uri": {
  12481. "type": "string"
  12482. },
  12483. "range": {
  12484. "$ref": "#/components/schemas/Range"
  12485. }
  12486. },
  12487. "required": ["uri", "range"],
  12488. "additionalProperties": false
  12489. }
  12490. },
  12491. "required": ["name", "kind", "location"],
  12492. "additionalProperties": false
  12493. },
  12494. "FileNode": {
  12495. "type": "object",
  12496. "properties": {
  12497. "name": {
  12498. "type": "string"
  12499. },
  12500. "path": {
  12501. "type": "string"
  12502. },
  12503. "absolute": {
  12504. "type": "string"
  12505. },
  12506. "type": {
  12507. "type": "string",
  12508. "enum": ["file", "directory"]
  12509. },
  12510. "ignored": {
  12511. "type": "boolean"
  12512. }
  12513. },
  12514. "required": ["name", "path", "absolute", "type", "ignored"],
  12515. "additionalProperties": false
  12516. },
  12517. "FileContent": {
  12518. "type": "object",
  12519. "properties": {
  12520. "type": {
  12521. "type": "string",
  12522. "enum": ["text", "binary"]
  12523. },
  12524. "content": {
  12525. "type": "string"
  12526. },
  12527. "diff": {
  12528. "type": "string"
  12529. },
  12530. "patch": {
  12531. "type": "object",
  12532. "properties": {
  12533. "oldFileName": {
  12534. "type": "string"
  12535. },
  12536. "newFileName": {
  12537. "type": "string"
  12538. },
  12539. "oldHeader": {
  12540. "type": "string"
  12541. },
  12542. "newHeader": {
  12543. "type": "string"
  12544. },
  12545. "hunks": {
  12546. "type": "array",
  12547. "items": {
  12548. "type": "object",
  12549. "properties": {
  12550. "oldStart": {
  12551. "type": "integer",
  12552. "minimum": 0
  12553. },
  12554. "oldLines": {
  12555. "type": "integer",
  12556. "minimum": 0
  12557. },
  12558. "newStart": {
  12559. "type": "integer",
  12560. "minimum": 0
  12561. },
  12562. "newLines": {
  12563. "type": "integer",
  12564. "minimum": 0
  12565. },
  12566. "lines": {
  12567. "type": "array",
  12568. "items": {
  12569. "type": "string"
  12570. }
  12571. }
  12572. },
  12573. "required": ["oldStart", "oldLines", "newStart", "newLines", "lines"],
  12574. "additionalProperties": false
  12575. }
  12576. },
  12577. "index": {
  12578. "type": "string"
  12579. }
  12580. },
  12581. "required": ["oldFileName", "newFileName", "hunks"],
  12582. "additionalProperties": false
  12583. },
  12584. "encoding": {
  12585. "type": "string",
  12586. "enum": ["base64"]
  12587. },
  12588. "mimeType": {
  12589. "type": "string"
  12590. }
  12591. },
  12592. "required": ["type", "content"],
  12593. "additionalProperties": false
  12594. },
  12595. "File": {
  12596. "type": "object",
  12597. "properties": {
  12598. "path": {
  12599. "type": "string"
  12600. },
  12601. "added": {
  12602. "type": "integer",
  12603. "minimum": 0
  12604. },
  12605. "removed": {
  12606. "type": "integer",
  12607. "minimum": 0
  12608. },
  12609. "status": {
  12610. "type": "string",
  12611. "enum": ["added", "deleted", "modified"]
  12612. }
  12613. },
  12614. "required": ["path", "added", "removed", "status"],
  12615. "additionalProperties": false
  12616. },
  12617. "Path": {
  12618. "type": "object",
  12619. "properties": {
  12620. "home": {
  12621. "type": "string"
  12622. },
  12623. "state": {
  12624. "type": "string"
  12625. },
  12626. "config": {
  12627. "type": "string"
  12628. },
  12629. "worktree": {
  12630. "type": "string"
  12631. },
  12632. "directory": {
  12633. "type": "string"
  12634. }
  12635. },
  12636. "required": ["home", "state", "config", "worktree", "directory"],
  12637. "additionalProperties": false
  12638. },
  12639. "VcsInfo": {
  12640. "type": "object",
  12641. "properties": {
  12642. "branch": {
  12643. "type": "string"
  12644. },
  12645. "default_branch": {
  12646. "type": "string"
  12647. }
  12648. },
  12649. "additionalProperties": false
  12650. },
  12651. "VcsFileDiff": {
  12652. "type": "object",
  12653. "properties": {
  12654. "file": {
  12655. "type": "string"
  12656. },
  12657. "patch": {
  12658. "type": "string"
  12659. },
  12660. "additions": {
  12661. "type": "integer",
  12662. "minimum": 0
  12663. },
  12664. "deletions": {
  12665. "type": "integer",
  12666. "minimum": 0
  12667. },
  12668. "status": {
  12669. "type": "string",
  12670. "enum": ["added", "deleted", "modified"]
  12671. }
  12672. },
  12673. "required": ["file", "patch", "additions", "deletions"],
  12674. "additionalProperties": false
  12675. },
  12676. "Command": {
  12677. "type": "object",
  12678. "properties": {
  12679. "name": {
  12680. "type": "string"
  12681. },
  12682. "description": {
  12683. "type": "string"
  12684. },
  12685. "agent": {
  12686. "type": "string"
  12687. },
  12688. "model": {
  12689. "type": "string"
  12690. },
  12691. "source": {
  12692. "type": "string",
  12693. "enum": ["command", "mcp", "skill"]
  12694. },
  12695. "template": {
  12696. "type": "string"
  12697. },
  12698. "subtask": {
  12699. "type": "boolean"
  12700. },
  12701. "hints": {
  12702. "type": "array",
  12703. "items": {
  12704. "type": "string"
  12705. }
  12706. }
  12707. },
  12708. "required": ["name", "template", "hints"],
  12709. "additionalProperties": false
  12710. },
  12711. "Agent": {
  12712. "type": "object",
  12713. "properties": {
  12714. "name": {
  12715. "type": "string"
  12716. },
  12717. "description": {
  12718. "type": "string"
  12719. },
  12720. "mode": {
  12721. "type": "string",
  12722. "enum": ["subagent", "primary", "all"]
  12723. },
  12724. "native": {
  12725. "type": "boolean"
  12726. },
  12727. "hidden": {
  12728. "type": "boolean"
  12729. },
  12730. "topP": {
  12731. "type": "number"
  12732. },
  12733. "temperature": {
  12734. "type": "number"
  12735. },
  12736. "color": {
  12737. "type": "string"
  12738. },
  12739. "permission": {
  12740. "$ref": "#/components/schemas/PermissionRuleset"
  12741. },
  12742. "model": {
  12743. "type": "object",
  12744. "properties": {
  12745. "modelID": {
  12746. "type": "string"
  12747. },
  12748. "providerID": {
  12749. "type": "string"
  12750. }
  12751. },
  12752. "required": ["modelID", "providerID"],
  12753. "additionalProperties": false
  12754. },
  12755. "variant": {
  12756. "type": "string"
  12757. },
  12758. "prompt": {
  12759. "type": "string"
  12760. },
  12761. "options": {
  12762. "type": "object"
  12763. },
  12764. "steps": {
  12765. "type": "number"
  12766. }
  12767. },
  12768. "required": ["name", "mode", "permission", "options"],
  12769. "additionalProperties": false
  12770. },
  12771. "LSPStatus": {
  12772. "type": "object",
  12773. "properties": {
  12774. "id": {
  12775. "type": "string"
  12776. },
  12777. "name": {
  12778. "type": "string"
  12779. },
  12780. "root": {
  12781. "type": "string"
  12782. },
  12783. "status": {
  12784. "type": "string",
  12785. "enum": ["connected", "error"]
  12786. }
  12787. },
  12788. "required": ["id", "name", "root", "status"],
  12789. "additionalProperties": false
  12790. },
  12791. "FormatterStatus": {
  12792. "type": "object",
  12793. "properties": {
  12794. "name": {
  12795. "type": "string"
  12796. },
  12797. "extensions": {
  12798. "type": "array",
  12799. "items": {
  12800. "type": "string"
  12801. }
  12802. },
  12803. "enabled": {
  12804. "type": "boolean"
  12805. }
  12806. },
  12807. "required": ["name", "extensions", "enabled"],
  12808. "additionalProperties": false
  12809. },
  12810. "MCPStatusConnected": {
  12811. "type": "object",
  12812. "properties": {
  12813. "status": {
  12814. "type": "string",
  12815. "enum": ["connected"]
  12816. }
  12817. },
  12818. "required": ["status"],
  12819. "additionalProperties": false
  12820. },
  12821. "MCPStatusDisabled": {
  12822. "type": "object",
  12823. "properties": {
  12824. "status": {
  12825. "type": "string",
  12826. "enum": ["disabled"]
  12827. }
  12828. },
  12829. "required": ["status"],
  12830. "additionalProperties": false
  12831. },
  12832. "MCPStatusFailed": {
  12833. "type": "object",
  12834. "properties": {
  12835. "status": {
  12836. "type": "string",
  12837. "enum": ["failed"]
  12838. },
  12839. "error": {
  12840. "type": "string"
  12841. }
  12842. },
  12843. "required": ["status", "error"],
  12844. "additionalProperties": false
  12845. },
  12846. "MCPStatusNeedsAuth": {
  12847. "type": "object",
  12848. "properties": {
  12849. "status": {
  12850. "type": "string",
  12851. "enum": ["needs_auth"]
  12852. }
  12853. },
  12854. "required": ["status"],
  12855. "additionalProperties": false
  12856. },
  12857. "MCPStatusNeedsClientRegistration": {
  12858. "type": "object",
  12859. "properties": {
  12860. "status": {
  12861. "type": "string",
  12862. "enum": ["needs_client_registration"]
  12863. },
  12864. "error": {
  12865. "type": "string"
  12866. }
  12867. },
  12868. "required": ["status", "error"],
  12869. "additionalProperties": false
  12870. },
  12871. "MCPStatus": {
  12872. "anyOf": [
  12873. {
  12874. "$ref": "#/components/schemas/MCPStatusConnected"
  12875. },
  12876. {
  12877. "$ref": "#/components/schemas/MCPStatusDisabled"
  12878. },
  12879. {
  12880. "$ref": "#/components/schemas/MCPStatusFailed"
  12881. },
  12882. {
  12883. "$ref": "#/components/schemas/MCPStatusNeedsAuth"
  12884. },
  12885. {
  12886. "$ref": "#/components/schemas/MCPStatusNeedsClientRegistration"
  12887. }
  12888. ]
  12889. },
  12890. "McpUnsupportedOAuthError": {
  12891. "type": "object",
  12892. "properties": {
  12893. "error": {
  12894. "type": "string"
  12895. }
  12896. },
  12897. "required": ["error"],
  12898. "additionalProperties": false
  12899. },
  12900. "effect_HttpApiError_Forbidden": {
  12901. "type": "object",
  12902. "properties": {
  12903. "_tag": {
  12904. "type": "string",
  12905. "enum": ["Forbidden"]
  12906. }
  12907. },
  12908. "required": ["_tag"],
  12909. "additionalProperties": false
  12910. },
  12911. "ProviderAuthMethod": {
  12912. "type": "object",
  12913. "properties": {
  12914. "type": {
  12915. "type": "string",
  12916. "enum": ["oauth", "api"]
  12917. },
  12918. "label": {
  12919. "type": "string"
  12920. },
  12921. "prompts": {
  12922. "type": "array",
  12923. "items": {
  12924. "anyOf": [
  12925. {
  12926. "type": "object",
  12927. "properties": {
  12928. "type": {
  12929. "type": "string",
  12930. "enum": ["text"]
  12931. },
  12932. "key": {
  12933. "type": "string"
  12934. },
  12935. "message": {
  12936. "type": "string"
  12937. },
  12938. "placeholder": {
  12939. "type": "string"
  12940. },
  12941. "when": {
  12942. "type": "object",
  12943. "properties": {
  12944. "key": {
  12945. "type": "string"
  12946. },
  12947. "op": {
  12948. "type": "string",
  12949. "enum": ["eq", "neq"]
  12950. },
  12951. "value": {
  12952. "type": "string"
  12953. }
  12954. },
  12955. "required": ["key", "op", "value"],
  12956. "additionalProperties": false
  12957. }
  12958. },
  12959. "required": ["type", "key", "message"],
  12960. "additionalProperties": false
  12961. },
  12962. {
  12963. "type": "object",
  12964. "properties": {
  12965. "type": {
  12966. "type": "string",
  12967. "enum": ["select"]
  12968. },
  12969. "key": {
  12970. "type": "string"
  12971. },
  12972. "message": {
  12973. "type": "string"
  12974. },
  12975. "options": {
  12976. "type": "array",
  12977. "items": {
  12978. "type": "object",
  12979. "properties": {
  12980. "label": {
  12981. "type": "string"
  12982. },
  12983. "value": {
  12984. "type": "string"
  12985. },
  12986. "hint": {
  12987. "type": "string"
  12988. }
  12989. },
  12990. "required": ["label", "value"],
  12991. "additionalProperties": false
  12992. }
  12993. },
  12994. "when": {
  12995. "type": "object",
  12996. "properties": {
  12997. "key": {
  12998. "type": "string"
  12999. },
  13000. "op": {
  13001. "type": "string",
  13002. "enum": ["eq", "neq"]
  13003. },
  13004. "value": {
  13005. "type": "string"
  13006. }
  13007. },
  13008. "required": ["key", "op", "value"],
  13009. "additionalProperties": false
  13010. }
  13011. },
  13012. "required": ["type", "key", "message", "options"],
  13013. "additionalProperties": false
  13014. }
  13015. ]
  13016. }
  13017. }
  13018. },
  13019. "required": ["type", "label"],
  13020. "additionalProperties": false
  13021. },
  13022. "ProviderAuthAuthorization": {
  13023. "type": "object",
  13024. "properties": {
  13025. "url": {
  13026. "type": "string"
  13027. },
  13028. "method": {
  13029. "type": "string",
  13030. "enum": ["auto", "code"]
  13031. },
  13032. "instructions": {
  13033. "type": "string"
  13034. }
  13035. },
  13036. "required": ["url", "method", "instructions"],
  13037. "additionalProperties": false
  13038. },
  13039. "TextPartInput": {
  13040. "type": "object",
  13041. "properties": {
  13042. "id": {
  13043. "type": "string"
  13044. },
  13045. "type": {
  13046. "type": "string",
  13047. "enum": ["text"]
  13048. },
  13049. "text": {
  13050. "type": "string"
  13051. },
  13052. "synthetic": {
  13053. "type": "boolean"
  13054. },
  13055. "ignored": {
  13056. "type": "boolean"
  13057. },
  13058. "time": {
  13059. "type": "object",
  13060. "properties": {
  13061. "start": {
  13062. "type": "integer",
  13063. "minimum": 0
  13064. },
  13065. "end": {
  13066. "type": "integer",
  13067. "minimum": 0
  13068. }
  13069. },
  13070. "required": ["start"],
  13071. "additionalProperties": false
  13072. },
  13073. "metadata": {
  13074. "type": "object"
  13075. }
  13076. },
  13077. "required": ["type", "text"],
  13078. "additionalProperties": false
  13079. },
  13080. "FilePartInput": {
  13081. "type": "object",
  13082. "properties": {
  13083. "id": {
  13084. "type": "string"
  13085. },
  13086. "type": {
  13087. "type": "string",
  13088. "enum": ["file"]
  13089. },
  13090. "mime": {
  13091. "type": "string"
  13092. },
  13093. "filename": {
  13094. "type": "string"
  13095. },
  13096. "url": {
  13097. "type": "string"
  13098. },
  13099. "source": {
  13100. "$ref": "#/components/schemas/FilePartSource"
  13101. }
  13102. },
  13103. "required": ["type", "mime", "url"],
  13104. "additionalProperties": false
  13105. },
  13106. "AgentPartInput": {
  13107. "type": "object",
  13108. "properties": {
  13109. "id": {
  13110. "type": "string"
  13111. },
  13112. "type": {
  13113. "type": "string",
  13114. "enum": ["agent"]
  13115. },
  13116. "name": {
  13117. "type": "string"
  13118. },
  13119. "source": {
  13120. "type": "object",
  13121. "properties": {
  13122. "value": {
  13123. "type": "string"
  13124. },
  13125. "start": {
  13126. "type": "integer",
  13127. "minimum": 0
  13128. },
  13129. "end": {
  13130. "type": "integer",
  13131. "minimum": 0
  13132. }
  13133. },
  13134. "required": ["value", "start", "end"],
  13135. "additionalProperties": false
  13136. }
  13137. },
  13138. "required": ["type", "name"],
  13139. "additionalProperties": false
  13140. },
  13141. "SubtaskPartInput": {
  13142. "type": "object",
  13143. "properties": {
  13144. "id": {
  13145. "type": "string"
  13146. },
  13147. "type": {
  13148. "type": "string",
  13149. "enum": ["subtask"]
  13150. },
  13151. "prompt": {
  13152. "type": "string"
  13153. },
  13154. "description": {
  13155. "type": "string"
  13156. },
  13157. "agent": {
  13158. "type": "string"
  13159. },
  13160. "model": {
  13161. "type": "object",
  13162. "properties": {
  13163. "providerID": {
  13164. "type": "string"
  13165. },
  13166. "modelID": {
  13167. "type": "string"
  13168. }
  13169. },
  13170. "required": ["providerID", "modelID"],
  13171. "additionalProperties": false
  13172. },
  13173. "command": {
  13174. "type": "string"
  13175. }
  13176. },
  13177. "required": ["type", "prompt", "description", "agent"],
  13178. "additionalProperties": false
  13179. },
  13180. "V2SessionsResponse": {
  13181. "type": "object",
  13182. "properties": {
  13183. "items": {
  13184. "type": "array",
  13185. "items": {
  13186. "$ref": "#/components/schemas/SessionInfo"
  13187. }
  13188. },
  13189. "cursor": {
  13190. "type": "object",
  13191. "properties": {
  13192. "previous": {
  13193. "type": "string"
  13194. },
  13195. "next": {
  13196. "type": "string"
  13197. }
  13198. },
  13199. "additionalProperties": false
  13200. }
  13201. },
  13202. "required": ["items", "cursor"],
  13203. "additionalProperties": false
  13204. },
  13205. "V2SessionMessagesResponse": {
  13206. "type": "object",
  13207. "properties": {
  13208. "items": {
  13209. "type": "array",
  13210. "items": {
  13211. "$ref": "#/components/schemas/SessionMessage"
  13212. }
  13213. },
  13214. "cursor": {
  13215. "type": "object",
  13216. "properties": {
  13217. "previous": {
  13218. "type": "string"
  13219. },
  13220. "next": {
  13221. "type": "string"
  13222. }
  13223. },
  13224. "additionalProperties": false
  13225. }
  13226. },
  13227. "required": ["items", "cursor"],
  13228. "additionalProperties": false
  13229. },
  13230. "EventTuiPromptAppend": {
  13231. "type": "object",
  13232. "properties": {
  13233. "type": {
  13234. "type": "string",
  13235. "enum": ["tui.prompt.append"]
  13236. },
  13237. "properties": {
  13238. "type": "object",
  13239. "properties": {
  13240. "text": {
  13241. "type": "string"
  13242. }
  13243. },
  13244. "required": ["text"],
  13245. "additionalProperties": false
  13246. }
  13247. },
  13248. "required": ["type", "properties"],
  13249. "additionalProperties": false
  13250. },
  13251. "EventTuiCommandExecute": {
  13252. "type": "object",
  13253. "properties": {
  13254. "type": {
  13255. "type": "string",
  13256. "enum": ["tui.command.execute"]
  13257. },
  13258. "properties": {
  13259. "type": "object",
  13260. "properties": {
  13261. "command": {
  13262. "anyOf": [
  13263. {
  13264. "type": "string",
  13265. "enum": [
  13266. "session.list",
  13267. "session.new",
  13268. "session.share",
  13269. "session.interrupt",
  13270. "session.compact",
  13271. "session.page.up",
  13272. "session.page.down",
  13273. "session.line.up",
  13274. "session.line.down",
  13275. "session.half.page.up",
  13276. "session.half.page.down",
  13277. "session.first",
  13278. "session.last",
  13279. "prompt.clear",
  13280. "prompt.submit",
  13281. "agent.cycle"
  13282. ]
  13283. },
  13284. {
  13285. "type": "string"
  13286. }
  13287. ]
  13288. }
  13289. },
  13290. "required": ["command"],
  13291. "additionalProperties": false
  13292. }
  13293. },
  13294. "required": ["type", "properties"],
  13295. "additionalProperties": false
  13296. },
  13297. "EventTuiToastShow": {
  13298. "type": "object",
  13299. "properties": {
  13300. "type": {
  13301. "type": "string",
  13302. "enum": ["tui.toast.show"]
  13303. },
  13304. "properties": {
  13305. "type": "object",
  13306. "properties": {
  13307. "title": {
  13308. "type": "string"
  13309. },
  13310. "message": {
  13311. "type": "string"
  13312. },
  13313. "variant": {
  13314. "type": "string",
  13315. "enum": ["info", "success", "warning", "error"]
  13316. },
  13317. "duration": {
  13318. "type": "integer",
  13319. "exclusiveMinimum": 0
  13320. }
  13321. },
  13322. "required": ["message", "variant"],
  13323. "additionalProperties": false
  13324. }
  13325. },
  13326. "required": ["type", "properties"],
  13327. "additionalProperties": false
  13328. },
  13329. "EventTuiSessionSelect": {
  13330. "type": "object",
  13331. "properties": {
  13332. "type": {
  13333. "type": "string",
  13334. "enum": ["tui.session.select"]
  13335. },
  13336. "properties": {
  13337. "type": "object",
  13338. "properties": {
  13339. "sessionID": {
  13340. "type": "string",
  13341. "description": "Session ID to navigate to"
  13342. }
  13343. },
  13344. "required": ["sessionID"],
  13345. "additionalProperties": false
  13346. }
  13347. },
  13348. "required": ["type", "properties"],
  13349. "additionalProperties": false
  13350. },
  13351. "Workspace": {
  13352. "type": "object",
  13353. "properties": {
  13354. "id": {
  13355. "type": "string"
  13356. },
  13357. "type": {
  13358. "type": "string"
  13359. },
  13360. "name": {
  13361. "type": "string"
  13362. },
  13363. "branch": {
  13364. "anyOf": [
  13365. {
  13366. "type": "string"
  13367. },
  13368. {
  13369. "type": "null"
  13370. }
  13371. ]
  13372. },
  13373. "directory": {
  13374. "anyOf": [
  13375. {
  13376. "type": "string"
  13377. },
  13378. {
  13379. "type": "null"
  13380. }
  13381. ]
  13382. },
  13383. "extra": {
  13384. "anyOf": [
  13385. {},
  13386. {
  13387. "type": "null"
  13388. }
  13389. ]
  13390. },
  13391. "projectID": {
  13392. "type": "string"
  13393. }
  13394. },
  13395. "required": ["id", "type", "name", "branch", "directory", "extra", "projectID"],
  13396. "additionalProperties": false
  13397. },
  13398. "SyncEventMessageUpdated": {
  13399. "type": "object",
  13400. "properties": {
  13401. "type": {
  13402. "type": "string",
  13403. "enum": ["sync"]
  13404. },
  13405. "name": {
  13406. "type": "string",
  13407. "enum": ["message.updated.1"]
  13408. },
  13409. "id": {
  13410. "type": "string"
  13411. },
  13412. "seq": {
  13413. "type": "number"
  13414. },
  13415. "aggregateID": {
  13416. "type": "string",
  13417. "enum": ["sessionID"]
  13418. },
  13419. "data": {
  13420. "type": "object",
  13421. "properties": {
  13422. "sessionID": {
  13423. "type": "string"
  13424. },
  13425. "info": {
  13426. "$ref": "#/components/schemas/Message"
  13427. }
  13428. },
  13429. "required": ["sessionID", "info"],
  13430. "additionalProperties": false
  13431. }
  13432. },
  13433. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  13434. "additionalProperties": false
  13435. },
  13436. "SyncEventMessageRemoved": {
  13437. "type": "object",
  13438. "properties": {
  13439. "type": {
  13440. "type": "string",
  13441. "enum": ["sync"]
  13442. },
  13443. "name": {
  13444. "type": "string",
  13445. "enum": ["message.removed.1"]
  13446. },
  13447. "id": {
  13448. "type": "string"
  13449. },
  13450. "seq": {
  13451. "type": "number"
  13452. },
  13453. "aggregateID": {
  13454. "type": "string",
  13455. "enum": ["sessionID"]
  13456. },
  13457. "data": {
  13458. "type": "object",
  13459. "properties": {
  13460. "sessionID": {
  13461. "type": "string"
  13462. },
  13463. "messageID": {
  13464. "type": "string"
  13465. }
  13466. },
  13467. "required": ["sessionID", "messageID"],
  13468. "additionalProperties": false
  13469. }
  13470. },
  13471. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  13472. "additionalProperties": false
  13473. },
  13474. "SyncEventMessagePartUpdated": {
  13475. "type": "object",
  13476. "properties": {
  13477. "type": {
  13478. "type": "string",
  13479. "enum": ["sync"]
  13480. },
  13481. "name": {
  13482. "type": "string",
  13483. "enum": ["message.part.updated.1"]
  13484. },
  13485. "id": {
  13486. "type": "string"
  13487. },
  13488. "seq": {
  13489. "type": "number"
  13490. },
  13491. "aggregateID": {
  13492. "type": "string",
  13493. "enum": ["sessionID"]
  13494. },
  13495. "data": {
  13496. "type": "object",
  13497. "properties": {
  13498. "sessionID": {
  13499. "type": "string"
  13500. },
  13501. "part": {
  13502. "$ref": "#/components/schemas/Part"
  13503. },
  13504. "time": {
  13505. "type": "integer",
  13506. "minimum": 0
  13507. }
  13508. },
  13509. "required": ["sessionID", "part", "time"],
  13510. "additionalProperties": false
  13511. }
  13512. },
  13513. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  13514. "additionalProperties": false
  13515. },
  13516. "SyncEventMessagePartRemoved": {
  13517. "type": "object",
  13518. "properties": {
  13519. "type": {
  13520. "type": "string",
  13521. "enum": ["sync"]
  13522. },
  13523. "name": {
  13524. "type": "string",
  13525. "enum": ["message.part.removed.1"]
  13526. },
  13527. "id": {
  13528. "type": "string"
  13529. },
  13530. "seq": {
  13531. "type": "number"
  13532. },
  13533. "aggregateID": {
  13534. "type": "string",
  13535. "enum": ["sessionID"]
  13536. },
  13537. "data": {
  13538. "type": "object",
  13539. "properties": {
  13540. "sessionID": {
  13541. "type": "string"
  13542. },
  13543. "messageID": {
  13544. "type": "string"
  13545. },
  13546. "partID": {
  13547. "type": "string"
  13548. }
  13549. },
  13550. "required": ["sessionID", "messageID", "partID"],
  13551. "additionalProperties": false
  13552. }
  13553. },
  13554. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  13555. "additionalProperties": false
  13556. },
  13557. "SyncEventSessionCreated": {
  13558. "type": "object",
  13559. "properties": {
  13560. "type": {
  13561. "type": "string",
  13562. "enum": ["sync"]
  13563. },
  13564. "name": {
  13565. "type": "string",
  13566. "enum": ["session.created.1"]
  13567. },
  13568. "id": {
  13569. "type": "string"
  13570. },
  13571. "seq": {
  13572. "type": "number"
  13573. },
  13574. "aggregateID": {
  13575. "type": "string",
  13576. "enum": ["sessionID"]
  13577. },
  13578. "data": {
  13579. "type": "object",
  13580. "properties": {
  13581. "sessionID": {
  13582. "type": "string"
  13583. },
  13584. "info": {
  13585. "$ref": "#/components/schemas/Session"
  13586. }
  13587. },
  13588. "required": ["sessionID", "info"],
  13589. "additionalProperties": false
  13590. }
  13591. },
  13592. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  13593. "additionalProperties": false
  13594. },
  13595. "SyncEventSessionUpdated": {
  13596. "type": "object",
  13597. "properties": {
  13598. "type": {
  13599. "type": "string",
  13600. "enum": ["sync"]
  13601. },
  13602. "name": {
  13603. "type": "string",
  13604. "enum": ["session.updated.1"]
  13605. },
  13606. "id": {
  13607. "type": "string"
  13608. },
  13609. "seq": {
  13610. "type": "number"
  13611. },
  13612. "aggregateID": {
  13613. "type": "string",
  13614. "enum": ["sessionID"]
  13615. },
  13616. "data": {
  13617. "type": "object",
  13618. "properties": {
  13619. "sessionID": {
  13620. "type": "string"
  13621. },
  13622. "info": {
  13623. "type": "object",
  13624. "properties": {
  13625. "id": {
  13626. "anyOf": [
  13627. {
  13628. "type": "string"
  13629. },
  13630. {
  13631. "type": "null"
  13632. }
  13633. ]
  13634. },
  13635. "slug": {
  13636. "anyOf": [
  13637. {
  13638. "type": "string"
  13639. },
  13640. {
  13641. "type": "null"
  13642. }
  13643. ]
  13644. },
  13645. "projectID": {
  13646. "anyOf": [
  13647. {
  13648. "type": "string"
  13649. },
  13650. {
  13651. "type": "null"
  13652. }
  13653. ]
  13654. },
  13655. "workspaceID": {
  13656. "anyOf": [
  13657. {
  13658. "type": "string"
  13659. },
  13660. {
  13661. "type": "null"
  13662. }
  13663. ]
  13664. },
  13665. "directory": {
  13666. "anyOf": [
  13667. {
  13668. "type": "string"
  13669. },
  13670. {
  13671. "type": "null"
  13672. }
  13673. ]
  13674. },
  13675. "path": {
  13676. "anyOf": [
  13677. {
  13678. "type": "string"
  13679. },
  13680. {
  13681. "type": "null"
  13682. }
  13683. ]
  13684. },
  13685. "parentID": {
  13686. "anyOf": [
  13687. {
  13688. "type": "string"
  13689. },
  13690. {
  13691. "type": "null"
  13692. }
  13693. ]
  13694. },
  13695. "summary": {
  13696. "anyOf": [
  13697. {
  13698. "type": "object",
  13699. "properties": {
  13700. "additions": {
  13701. "type": "integer",
  13702. "minimum": 0
  13703. },
  13704. "deletions": {
  13705. "type": "integer",
  13706. "minimum": 0
  13707. },
  13708. "files": {
  13709. "type": "integer",
  13710. "minimum": 0
  13711. },
  13712. "diffs": {
  13713. "type": "array",
  13714. "items": {
  13715. "$ref": "#/components/schemas/SnapshotFileDiff"
  13716. }
  13717. }
  13718. },
  13719. "required": ["additions", "deletions", "files"],
  13720. "additionalProperties": false
  13721. },
  13722. {
  13723. "type": "null"
  13724. }
  13725. ]
  13726. },
  13727. "share": {
  13728. "type": "object",
  13729. "properties": {
  13730. "url": {
  13731. "anyOf": [
  13732. {
  13733. "type": "string"
  13734. },
  13735. {
  13736. "type": "null"
  13737. }
  13738. ]
  13739. }
  13740. },
  13741. "additionalProperties": false
  13742. },
  13743. "title": {
  13744. "anyOf": [
  13745. {
  13746. "type": "string"
  13747. },
  13748. {
  13749. "type": "null"
  13750. }
  13751. ]
  13752. },
  13753. "agent": {
  13754. "anyOf": [
  13755. {
  13756. "type": "string"
  13757. },
  13758. {
  13759. "type": "null"
  13760. }
  13761. ]
  13762. },
  13763. "model": {
  13764. "anyOf": [
  13765. {
  13766. "type": "object",
  13767. "properties": {
  13768. "id": {
  13769. "type": "string"
  13770. },
  13771. "providerID": {
  13772. "type": "string"
  13773. },
  13774. "variant": {
  13775. "type": "string"
  13776. }
  13777. },
  13778. "required": ["id", "providerID"],
  13779. "additionalProperties": false
  13780. },
  13781. {
  13782. "type": "null"
  13783. }
  13784. ]
  13785. },
  13786. "version": {
  13787. "anyOf": [
  13788. {
  13789. "type": "string"
  13790. },
  13791. {
  13792. "type": "null"
  13793. }
  13794. ]
  13795. },
  13796. "time": {
  13797. "type": "object",
  13798. "properties": {
  13799. "created": {
  13800. "anyOf": [
  13801. {
  13802. "type": "integer",
  13803. "minimum": 0
  13804. },
  13805. {
  13806. "type": "null"
  13807. }
  13808. ]
  13809. },
  13810. "updated": {
  13811. "anyOf": [
  13812. {
  13813. "type": "integer",
  13814. "minimum": 0
  13815. },
  13816. {
  13817. "type": "null"
  13818. }
  13819. ]
  13820. },
  13821. "compacting": {
  13822. "anyOf": [
  13823. {
  13824. "type": "integer",
  13825. "minimum": 0
  13826. },
  13827. {
  13828. "type": "null"
  13829. }
  13830. ]
  13831. },
  13832. "archived": {
  13833. "anyOf": [
  13834. {
  13835. "type": "number"
  13836. },
  13837. {
  13838. "type": "null"
  13839. }
  13840. ]
  13841. }
  13842. },
  13843. "additionalProperties": false
  13844. },
  13845. "permission": {
  13846. "anyOf": [
  13847. {
  13848. "$ref": "#/components/schemas/PermissionRuleset"
  13849. },
  13850. {
  13851. "type": "null"
  13852. }
  13853. ]
  13854. },
  13855. "revert": {
  13856. "anyOf": [
  13857. {
  13858. "type": "object",
  13859. "properties": {
  13860. "messageID": {
  13861. "type": "string"
  13862. },
  13863. "partID": {
  13864. "type": "string"
  13865. },
  13866. "snapshot": {
  13867. "type": "string"
  13868. },
  13869. "diff": {
  13870. "type": "string"
  13871. }
  13872. },
  13873. "required": ["messageID"],
  13874. "additionalProperties": false
  13875. },
  13876. {
  13877. "type": "null"
  13878. }
  13879. ]
  13880. }
  13881. },
  13882. "additionalProperties": false
  13883. }
  13884. },
  13885. "required": ["sessionID", "info"],
  13886. "additionalProperties": false
  13887. }
  13888. },
  13889. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  13890. "additionalProperties": false
  13891. },
  13892. "SyncEventSessionDeleted": {
  13893. "type": "object",
  13894. "properties": {
  13895. "type": {
  13896. "type": "string",
  13897. "enum": ["sync"]
  13898. },
  13899. "name": {
  13900. "type": "string",
  13901. "enum": ["session.deleted.1"]
  13902. },
  13903. "id": {
  13904. "type": "string"
  13905. },
  13906. "seq": {
  13907. "type": "number"
  13908. },
  13909. "aggregateID": {
  13910. "type": "string",
  13911. "enum": ["sessionID"]
  13912. },
  13913. "data": {
  13914. "type": "object",
  13915. "properties": {
  13916. "sessionID": {
  13917. "type": "string"
  13918. },
  13919. "info": {
  13920. "$ref": "#/components/schemas/Session"
  13921. }
  13922. },
  13923. "required": ["sessionID", "info"],
  13924. "additionalProperties": false
  13925. }
  13926. },
  13927. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  13928. "additionalProperties": false
  13929. },
  13930. "SyncEventSessionNextAgentSwitched": {
  13931. "type": "object",
  13932. "properties": {
  13933. "type": {
  13934. "type": "string",
  13935. "enum": ["sync"]
  13936. },
  13937. "name": {
  13938. "type": "string",
  13939. "enum": ["session.next.agent.switched.1"]
  13940. },
  13941. "id": {
  13942. "type": "string"
  13943. },
  13944. "seq": {
  13945. "type": "number"
  13946. },
  13947. "aggregateID": {
  13948. "type": "string",
  13949. "enum": ["sessionID"]
  13950. },
  13951. "data": {
  13952. "type": "object",
  13953. "properties": {
  13954. "timestamp": {
  13955. "type": "number"
  13956. },
  13957. "sessionID": {
  13958. "type": "string"
  13959. },
  13960. "agent": {
  13961. "type": "string"
  13962. }
  13963. },
  13964. "required": ["timestamp", "sessionID", "agent"],
  13965. "additionalProperties": false
  13966. }
  13967. },
  13968. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  13969. "additionalProperties": false
  13970. },
  13971. "SyncEventSessionNextModelSwitched": {
  13972. "type": "object",
  13973. "properties": {
  13974. "type": {
  13975. "type": "string",
  13976. "enum": ["sync"]
  13977. },
  13978. "name": {
  13979. "type": "string",
  13980. "enum": ["session.next.model.switched.1"]
  13981. },
  13982. "id": {
  13983. "type": "string"
  13984. },
  13985. "seq": {
  13986. "type": "number"
  13987. },
  13988. "aggregateID": {
  13989. "type": "string",
  13990. "enum": ["sessionID"]
  13991. },
  13992. "data": {
  13993. "type": "object",
  13994. "properties": {
  13995. "timestamp": {
  13996. "type": "number"
  13997. },
  13998. "sessionID": {
  13999. "type": "string"
  14000. },
  14001. "id": {
  14002. "type": "string"
  14003. },
  14004. "providerID": {
  14005. "type": "string"
  14006. },
  14007. "variant": {
  14008. "type": "string"
  14009. }
  14010. },
  14011. "required": ["timestamp", "sessionID", "id", "providerID"],
  14012. "additionalProperties": false
  14013. }
  14014. },
  14015. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14016. "additionalProperties": false
  14017. },
  14018. "SyncEventSessionNextPrompted": {
  14019. "type": "object",
  14020. "properties": {
  14021. "type": {
  14022. "type": "string",
  14023. "enum": ["sync"]
  14024. },
  14025. "name": {
  14026. "type": "string",
  14027. "enum": ["session.next.prompted.1"]
  14028. },
  14029. "id": {
  14030. "type": "string"
  14031. },
  14032. "seq": {
  14033. "type": "number"
  14034. },
  14035. "aggregateID": {
  14036. "type": "string",
  14037. "enum": ["sessionID"]
  14038. },
  14039. "data": {
  14040. "type": "object",
  14041. "properties": {
  14042. "timestamp": {
  14043. "type": "number"
  14044. },
  14045. "sessionID": {
  14046. "type": "string"
  14047. },
  14048. "prompt": {
  14049. "$ref": "#/components/schemas/Prompt"
  14050. }
  14051. },
  14052. "required": ["timestamp", "sessionID", "prompt"],
  14053. "additionalProperties": false
  14054. }
  14055. },
  14056. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14057. "additionalProperties": false
  14058. },
  14059. "SyncEventSessionNextSynthetic": {
  14060. "type": "object",
  14061. "properties": {
  14062. "type": {
  14063. "type": "string",
  14064. "enum": ["sync"]
  14065. },
  14066. "name": {
  14067. "type": "string",
  14068. "enum": ["session.next.synthetic.1"]
  14069. },
  14070. "id": {
  14071. "type": "string"
  14072. },
  14073. "seq": {
  14074. "type": "number"
  14075. },
  14076. "aggregateID": {
  14077. "type": "string",
  14078. "enum": ["sessionID"]
  14079. },
  14080. "data": {
  14081. "type": "object",
  14082. "properties": {
  14083. "timestamp": {
  14084. "type": "number"
  14085. },
  14086. "sessionID": {
  14087. "type": "string"
  14088. },
  14089. "text": {
  14090. "type": "string"
  14091. }
  14092. },
  14093. "required": ["timestamp", "sessionID", "text"],
  14094. "additionalProperties": false
  14095. }
  14096. },
  14097. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14098. "additionalProperties": false
  14099. },
  14100. "SyncEventSessionNextShellStarted": {
  14101. "type": "object",
  14102. "properties": {
  14103. "type": {
  14104. "type": "string",
  14105. "enum": ["sync"]
  14106. },
  14107. "name": {
  14108. "type": "string",
  14109. "enum": ["session.next.shell.started.1"]
  14110. },
  14111. "id": {
  14112. "type": "string"
  14113. },
  14114. "seq": {
  14115. "type": "number"
  14116. },
  14117. "aggregateID": {
  14118. "type": "string",
  14119. "enum": ["sessionID"]
  14120. },
  14121. "data": {
  14122. "type": "object",
  14123. "properties": {
  14124. "timestamp": {
  14125. "type": "number"
  14126. },
  14127. "sessionID": {
  14128. "type": "string"
  14129. },
  14130. "callID": {
  14131. "type": "string"
  14132. },
  14133. "command": {
  14134. "type": "string"
  14135. }
  14136. },
  14137. "required": ["timestamp", "sessionID", "callID", "command"],
  14138. "additionalProperties": false
  14139. }
  14140. },
  14141. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14142. "additionalProperties": false
  14143. },
  14144. "SyncEventSessionNextShellEnded": {
  14145. "type": "object",
  14146. "properties": {
  14147. "type": {
  14148. "type": "string",
  14149. "enum": ["sync"]
  14150. },
  14151. "name": {
  14152. "type": "string",
  14153. "enum": ["session.next.shell.ended.1"]
  14154. },
  14155. "id": {
  14156. "type": "string"
  14157. },
  14158. "seq": {
  14159. "type": "number"
  14160. },
  14161. "aggregateID": {
  14162. "type": "string",
  14163. "enum": ["sessionID"]
  14164. },
  14165. "data": {
  14166. "type": "object",
  14167. "properties": {
  14168. "timestamp": {
  14169. "type": "number"
  14170. },
  14171. "sessionID": {
  14172. "type": "string"
  14173. },
  14174. "callID": {
  14175. "type": "string"
  14176. },
  14177. "output": {
  14178. "type": "string"
  14179. }
  14180. },
  14181. "required": ["timestamp", "sessionID", "callID", "output"],
  14182. "additionalProperties": false
  14183. }
  14184. },
  14185. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14186. "additionalProperties": false
  14187. },
  14188. "SyncEventSessionNextStepStarted": {
  14189. "type": "object",
  14190. "properties": {
  14191. "type": {
  14192. "type": "string",
  14193. "enum": ["sync"]
  14194. },
  14195. "name": {
  14196. "type": "string",
  14197. "enum": ["session.next.step.started.1"]
  14198. },
  14199. "id": {
  14200. "type": "string"
  14201. },
  14202. "seq": {
  14203. "type": "number"
  14204. },
  14205. "aggregateID": {
  14206. "type": "string",
  14207. "enum": ["sessionID"]
  14208. },
  14209. "data": {
  14210. "type": "object",
  14211. "properties": {
  14212. "timestamp": {
  14213. "type": "number"
  14214. },
  14215. "sessionID": {
  14216. "type": "string"
  14217. },
  14218. "agent": {
  14219. "type": "string"
  14220. },
  14221. "model": {
  14222. "type": "object",
  14223. "properties": {
  14224. "id": {
  14225. "type": "string"
  14226. },
  14227. "providerID": {
  14228. "type": "string"
  14229. },
  14230. "variant": {
  14231. "type": "string"
  14232. }
  14233. },
  14234. "required": ["id", "providerID"],
  14235. "additionalProperties": false
  14236. },
  14237. "snapshot": {
  14238. "type": "string"
  14239. }
  14240. },
  14241. "required": ["timestamp", "sessionID", "agent", "model"],
  14242. "additionalProperties": false
  14243. }
  14244. },
  14245. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14246. "additionalProperties": false
  14247. },
  14248. "SyncEventSessionNextStepEnded": {
  14249. "type": "object",
  14250. "properties": {
  14251. "type": {
  14252. "type": "string",
  14253. "enum": ["sync"]
  14254. },
  14255. "name": {
  14256. "type": "string",
  14257. "enum": ["session.next.step.ended.1"]
  14258. },
  14259. "id": {
  14260. "type": "string"
  14261. },
  14262. "seq": {
  14263. "type": "number"
  14264. },
  14265. "aggregateID": {
  14266. "type": "string",
  14267. "enum": ["sessionID"]
  14268. },
  14269. "data": {
  14270. "type": "object",
  14271. "properties": {
  14272. "timestamp": {
  14273. "type": "number"
  14274. },
  14275. "sessionID": {
  14276. "type": "string"
  14277. },
  14278. "finish": {
  14279. "type": "string"
  14280. },
  14281. "cost": {
  14282. "type": "number"
  14283. },
  14284. "tokens": {
  14285. "type": "object",
  14286. "properties": {
  14287. "input": {
  14288. "type": "integer",
  14289. "minimum": 0
  14290. },
  14291. "output": {
  14292. "type": "integer",
  14293. "minimum": 0
  14294. },
  14295. "reasoning": {
  14296. "type": "integer",
  14297. "minimum": 0
  14298. },
  14299. "cache": {
  14300. "type": "object",
  14301. "properties": {
  14302. "read": {
  14303. "type": "integer",
  14304. "minimum": 0
  14305. },
  14306. "write": {
  14307. "type": "integer",
  14308. "minimum": 0
  14309. }
  14310. },
  14311. "required": ["read", "write"],
  14312. "additionalProperties": false
  14313. }
  14314. },
  14315. "required": ["input", "output", "reasoning", "cache"],
  14316. "additionalProperties": false
  14317. },
  14318. "snapshot": {
  14319. "type": "string"
  14320. }
  14321. },
  14322. "required": ["timestamp", "sessionID", "finish", "cost", "tokens"],
  14323. "additionalProperties": false
  14324. }
  14325. },
  14326. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14327. "additionalProperties": false
  14328. },
  14329. "SyncEventSessionNextStepFailed": {
  14330. "type": "object",
  14331. "properties": {
  14332. "type": {
  14333. "type": "string",
  14334. "enum": ["sync"]
  14335. },
  14336. "name": {
  14337. "type": "string",
  14338. "enum": ["session.next.step.failed.1"]
  14339. },
  14340. "id": {
  14341. "type": "string"
  14342. },
  14343. "seq": {
  14344. "type": "number"
  14345. },
  14346. "aggregateID": {
  14347. "type": "string",
  14348. "enum": ["sessionID"]
  14349. },
  14350. "data": {
  14351. "type": "object",
  14352. "properties": {
  14353. "timestamp": {
  14354. "type": "number"
  14355. },
  14356. "sessionID": {
  14357. "type": "string"
  14358. },
  14359. "error": {
  14360. "type": "object",
  14361. "properties": {
  14362. "type": {
  14363. "type": "string"
  14364. },
  14365. "message": {
  14366. "type": "string"
  14367. }
  14368. },
  14369. "required": ["type", "message"],
  14370. "additionalProperties": false
  14371. }
  14372. },
  14373. "required": ["timestamp", "sessionID", "error"],
  14374. "additionalProperties": false
  14375. }
  14376. },
  14377. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14378. "additionalProperties": false
  14379. },
  14380. "SyncEventSessionNextTextStarted": {
  14381. "type": "object",
  14382. "properties": {
  14383. "type": {
  14384. "type": "string",
  14385. "enum": ["sync"]
  14386. },
  14387. "name": {
  14388. "type": "string",
  14389. "enum": ["session.next.text.started.1"]
  14390. },
  14391. "id": {
  14392. "type": "string"
  14393. },
  14394. "seq": {
  14395. "type": "number"
  14396. },
  14397. "aggregateID": {
  14398. "type": "string",
  14399. "enum": ["sessionID"]
  14400. },
  14401. "data": {
  14402. "type": "object",
  14403. "properties": {
  14404. "timestamp": {
  14405. "type": "number"
  14406. },
  14407. "sessionID": {
  14408. "type": "string"
  14409. }
  14410. },
  14411. "required": ["timestamp", "sessionID"],
  14412. "additionalProperties": false
  14413. }
  14414. },
  14415. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14416. "additionalProperties": false
  14417. },
  14418. "SyncEventSessionNextTextDelta": {
  14419. "type": "object",
  14420. "properties": {
  14421. "type": {
  14422. "type": "string",
  14423. "enum": ["sync"]
  14424. },
  14425. "name": {
  14426. "type": "string",
  14427. "enum": ["session.next.text.delta.1"]
  14428. },
  14429. "id": {
  14430. "type": "string"
  14431. },
  14432. "seq": {
  14433. "type": "number"
  14434. },
  14435. "aggregateID": {
  14436. "type": "string",
  14437. "enum": ["sessionID"]
  14438. },
  14439. "data": {
  14440. "type": "object",
  14441. "properties": {
  14442. "timestamp": {
  14443. "type": "number"
  14444. },
  14445. "sessionID": {
  14446. "type": "string"
  14447. },
  14448. "delta": {
  14449. "type": "string"
  14450. }
  14451. },
  14452. "required": ["timestamp", "sessionID", "delta"],
  14453. "additionalProperties": false
  14454. }
  14455. },
  14456. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14457. "additionalProperties": false
  14458. },
  14459. "SyncEventSessionNextTextEnded": {
  14460. "type": "object",
  14461. "properties": {
  14462. "type": {
  14463. "type": "string",
  14464. "enum": ["sync"]
  14465. },
  14466. "name": {
  14467. "type": "string",
  14468. "enum": ["session.next.text.ended.1"]
  14469. },
  14470. "id": {
  14471. "type": "string"
  14472. },
  14473. "seq": {
  14474. "type": "number"
  14475. },
  14476. "aggregateID": {
  14477. "type": "string",
  14478. "enum": ["sessionID"]
  14479. },
  14480. "data": {
  14481. "type": "object",
  14482. "properties": {
  14483. "timestamp": {
  14484. "type": "number"
  14485. },
  14486. "sessionID": {
  14487. "type": "string"
  14488. },
  14489. "text": {
  14490. "type": "string"
  14491. }
  14492. },
  14493. "required": ["timestamp", "sessionID", "text"],
  14494. "additionalProperties": false
  14495. }
  14496. },
  14497. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14498. "additionalProperties": false
  14499. },
  14500. "SyncEventSessionNextReasoningStarted": {
  14501. "type": "object",
  14502. "properties": {
  14503. "type": {
  14504. "type": "string",
  14505. "enum": ["sync"]
  14506. },
  14507. "name": {
  14508. "type": "string",
  14509. "enum": ["session.next.reasoning.started.1"]
  14510. },
  14511. "id": {
  14512. "type": "string"
  14513. },
  14514. "seq": {
  14515. "type": "number"
  14516. },
  14517. "aggregateID": {
  14518. "type": "string",
  14519. "enum": ["sessionID"]
  14520. },
  14521. "data": {
  14522. "type": "object",
  14523. "properties": {
  14524. "timestamp": {
  14525. "type": "number"
  14526. },
  14527. "sessionID": {
  14528. "type": "string"
  14529. },
  14530. "reasoningID": {
  14531. "type": "string"
  14532. }
  14533. },
  14534. "required": ["timestamp", "sessionID", "reasoningID"],
  14535. "additionalProperties": false
  14536. }
  14537. },
  14538. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14539. "additionalProperties": false
  14540. },
  14541. "SyncEventSessionNextReasoningDelta": {
  14542. "type": "object",
  14543. "properties": {
  14544. "type": {
  14545. "type": "string",
  14546. "enum": ["sync"]
  14547. },
  14548. "name": {
  14549. "type": "string",
  14550. "enum": ["session.next.reasoning.delta.1"]
  14551. },
  14552. "id": {
  14553. "type": "string"
  14554. },
  14555. "seq": {
  14556. "type": "number"
  14557. },
  14558. "aggregateID": {
  14559. "type": "string",
  14560. "enum": ["sessionID"]
  14561. },
  14562. "data": {
  14563. "type": "object",
  14564. "properties": {
  14565. "timestamp": {
  14566. "type": "number"
  14567. },
  14568. "sessionID": {
  14569. "type": "string"
  14570. },
  14571. "reasoningID": {
  14572. "type": "string"
  14573. },
  14574. "delta": {
  14575. "type": "string"
  14576. }
  14577. },
  14578. "required": ["timestamp", "sessionID", "reasoningID", "delta"],
  14579. "additionalProperties": false
  14580. }
  14581. },
  14582. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14583. "additionalProperties": false
  14584. },
  14585. "SyncEventSessionNextReasoningEnded": {
  14586. "type": "object",
  14587. "properties": {
  14588. "type": {
  14589. "type": "string",
  14590. "enum": ["sync"]
  14591. },
  14592. "name": {
  14593. "type": "string",
  14594. "enum": ["session.next.reasoning.ended.1"]
  14595. },
  14596. "id": {
  14597. "type": "string"
  14598. },
  14599. "seq": {
  14600. "type": "number"
  14601. },
  14602. "aggregateID": {
  14603. "type": "string",
  14604. "enum": ["sessionID"]
  14605. },
  14606. "data": {
  14607. "type": "object",
  14608. "properties": {
  14609. "timestamp": {
  14610. "type": "number"
  14611. },
  14612. "sessionID": {
  14613. "type": "string"
  14614. },
  14615. "reasoningID": {
  14616. "type": "string"
  14617. },
  14618. "text": {
  14619. "type": "string"
  14620. }
  14621. },
  14622. "required": ["timestamp", "sessionID", "reasoningID", "text"],
  14623. "additionalProperties": false
  14624. }
  14625. },
  14626. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14627. "additionalProperties": false
  14628. },
  14629. "SyncEventSessionNextToolInputStarted": {
  14630. "type": "object",
  14631. "properties": {
  14632. "type": {
  14633. "type": "string",
  14634. "enum": ["sync"]
  14635. },
  14636. "name": {
  14637. "type": "string",
  14638. "enum": ["session.next.tool.input.started.1"]
  14639. },
  14640. "id": {
  14641. "type": "string"
  14642. },
  14643. "seq": {
  14644. "type": "number"
  14645. },
  14646. "aggregateID": {
  14647. "type": "string",
  14648. "enum": ["sessionID"]
  14649. },
  14650. "data": {
  14651. "type": "object",
  14652. "properties": {
  14653. "timestamp": {
  14654. "type": "number"
  14655. },
  14656. "sessionID": {
  14657. "type": "string"
  14658. },
  14659. "callID": {
  14660. "type": "string"
  14661. },
  14662. "name": {
  14663. "type": "string"
  14664. }
  14665. },
  14666. "required": ["timestamp", "sessionID", "callID", "name"],
  14667. "additionalProperties": false
  14668. }
  14669. },
  14670. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14671. "additionalProperties": false
  14672. },
  14673. "SyncEventSessionNextToolInputDelta": {
  14674. "type": "object",
  14675. "properties": {
  14676. "type": {
  14677. "type": "string",
  14678. "enum": ["sync"]
  14679. },
  14680. "name": {
  14681. "type": "string",
  14682. "enum": ["session.next.tool.input.delta.1"]
  14683. },
  14684. "id": {
  14685. "type": "string"
  14686. },
  14687. "seq": {
  14688. "type": "number"
  14689. },
  14690. "aggregateID": {
  14691. "type": "string",
  14692. "enum": ["sessionID"]
  14693. },
  14694. "data": {
  14695. "type": "object",
  14696. "properties": {
  14697. "timestamp": {
  14698. "type": "number"
  14699. },
  14700. "sessionID": {
  14701. "type": "string"
  14702. },
  14703. "callID": {
  14704. "type": "string"
  14705. },
  14706. "delta": {
  14707. "type": "string"
  14708. }
  14709. },
  14710. "required": ["timestamp", "sessionID", "callID", "delta"],
  14711. "additionalProperties": false
  14712. }
  14713. },
  14714. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14715. "additionalProperties": false
  14716. },
  14717. "SyncEventSessionNextToolInputEnded": {
  14718. "type": "object",
  14719. "properties": {
  14720. "type": {
  14721. "type": "string",
  14722. "enum": ["sync"]
  14723. },
  14724. "name": {
  14725. "type": "string",
  14726. "enum": ["session.next.tool.input.ended.1"]
  14727. },
  14728. "id": {
  14729. "type": "string"
  14730. },
  14731. "seq": {
  14732. "type": "number"
  14733. },
  14734. "aggregateID": {
  14735. "type": "string",
  14736. "enum": ["sessionID"]
  14737. },
  14738. "data": {
  14739. "type": "object",
  14740. "properties": {
  14741. "timestamp": {
  14742. "type": "number"
  14743. },
  14744. "sessionID": {
  14745. "type": "string"
  14746. },
  14747. "callID": {
  14748. "type": "string"
  14749. },
  14750. "text": {
  14751. "type": "string"
  14752. }
  14753. },
  14754. "required": ["timestamp", "sessionID", "callID", "text"],
  14755. "additionalProperties": false
  14756. }
  14757. },
  14758. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14759. "additionalProperties": false
  14760. },
  14761. "SyncEventSessionNextToolCalled": {
  14762. "type": "object",
  14763. "properties": {
  14764. "type": {
  14765. "type": "string",
  14766. "enum": ["sync"]
  14767. },
  14768. "name": {
  14769. "type": "string",
  14770. "enum": ["session.next.tool.called.1"]
  14771. },
  14772. "id": {
  14773. "type": "string"
  14774. },
  14775. "seq": {
  14776. "type": "number"
  14777. },
  14778. "aggregateID": {
  14779. "type": "string",
  14780. "enum": ["sessionID"]
  14781. },
  14782. "data": {
  14783. "type": "object",
  14784. "properties": {
  14785. "timestamp": {
  14786. "type": "number"
  14787. },
  14788. "sessionID": {
  14789. "type": "string"
  14790. },
  14791. "callID": {
  14792. "type": "string"
  14793. },
  14794. "tool": {
  14795. "type": "string"
  14796. },
  14797. "input": {
  14798. "type": "object"
  14799. },
  14800. "provider": {
  14801. "type": "object",
  14802. "properties": {
  14803. "executed": {
  14804. "type": "boolean"
  14805. },
  14806. "metadata": {
  14807. "type": "object"
  14808. }
  14809. },
  14810. "required": ["executed"],
  14811. "additionalProperties": false
  14812. }
  14813. },
  14814. "required": ["timestamp", "sessionID", "callID", "tool", "input", "provider"],
  14815. "additionalProperties": false
  14816. }
  14817. },
  14818. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14819. "additionalProperties": false
  14820. },
  14821. "SyncEventSessionNextToolProgress": {
  14822. "type": "object",
  14823. "properties": {
  14824. "type": {
  14825. "type": "string",
  14826. "enum": ["sync"]
  14827. },
  14828. "name": {
  14829. "type": "string",
  14830. "enum": ["session.next.tool.progress.1"]
  14831. },
  14832. "id": {
  14833. "type": "string"
  14834. },
  14835. "seq": {
  14836. "type": "number"
  14837. },
  14838. "aggregateID": {
  14839. "type": "string",
  14840. "enum": ["sessionID"]
  14841. },
  14842. "data": {
  14843. "type": "object",
  14844. "properties": {
  14845. "timestamp": {
  14846. "type": "number"
  14847. },
  14848. "sessionID": {
  14849. "type": "string"
  14850. },
  14851. "callID": {
  14852. "type": "string"
  14853. },
  14854. "structured": {
  14855. "type": "object"
  14856. },
  14857. "content": {
  14858. "type": "array",
  14859. "items": {
  14860. "anyOf": [
  14861. {
  14862. "$ref": "#/components/schemas/ToolTextContent"
  14863. },
  14864. {
  14865. "$ref": "#/components/schemas/ToolFileContent"
  14866. }
  14867. ]
  14868. }
  14869. }
  14870. },
  14871. "required": ["timestamp", "sessionID", "callID", "structured", "content"],
  14872. "additionalProperties": false
  14873. }
  14874. },
  14875. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14876. "additionalProperties": false
  14877. },
  14878. "SyncEventSessionNextToolSuccess": {
  14879. "type": "object",
  14880. "properties": {
  14881. "type": {
  14882. "type": "string",
  14883. "enum": ["sync"]
  14884. },
  14885. "name": {
  14886. "type": "string",
  14887. "enum": ["session.next.tool.success.1"]
  14888. },
  14889. "id": {
  14890. "type": "string"
  14891. },
  14892. "seq": {
  14893. "type": "number"
  14894. },
  14895. "aggregateID": {
  14896. "type": "string",
  14897. "enum": ["sessionID"]
  14898. },
  14899. "data": {
  14900. "type": "object",
  14901. "properties": {
  14902. "timestamp": {
  14903. "type": "number"
  14904. },
  14905. "sessionID": {
  14906. "type": "string"
  14907. },
  14908. "callID": {
  14909. "type": "string"
  14910. },
  14911. "structured": {
  14912. "type": "object"
  14913. },
  14914. "content": {
  14915. "type": "array",
  14916. "items": {
  14917. "anyOf": [
  14918. {
  14919. "$ref": "#/components/schemas/ToolTextContent"
  14920. },
  14921. {
  14922. "$ref": "#/components/schemas/ToolFileContent"
  14923. }
  14924. ]
  14925. }
  14926. },
  14927. "provider": {
  14928. "type": "object",
  14929. "properties": {
  14930. "executed": {
  14931. "type": "boolean"
  14932. },
  14933. "metadata": {
  14934. "type": "object"
  14935. }
  14936. },
  14937. "required": ["executed"],
  14938. "additionalProperties": false
  14939. }
  14940. },
  14941. "required": ["timestamp", "sessionID", "callID", "structured", "content", "provider"],
  14942. "additionalProperties": false
  14943. }
  14944. },
  14945. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14946. "additionalProperties": false
  14947. },
  14948. "SyncEventSessionNextToolFailed": {
  14949. "type": "object",
  14950. "properties": {
  14951. "type": {
  14952. "type": "string",
  14953. "enum": ["sync"]
  14954. },
  14955. "name": {
  14956. "type": "string",
  14957. "enum": ["session.next.tool.failed.1"]
  14958. },
  14959. "id": {
  14960. "type": "string"
  14961. },
  14962. "seq": {
  14963. "type": "number"
  14964. },
  14965. "aggregateID": {
  14966. "type": "string",
  14967. "enum": ["sessionID"]
  14968. },
  14969. "data": {
  14970. "type": "object",
  14971. "properties": {
  14972. "timestamp": {
  14973. "type": "number"
  14974. },
  14975. "sessionID": {
  14976. "type": "string"
  14977. },
  14978. "callID": {
  14979. "type": "string"
  14980. },
  14981. "error": {
  14982. "type": "object",
  14983. "properties": {
  14984. "type": {
  14985. "type": "string"
  14986. },
  14987. "message": {
  14988. "type": "string"
  14989. }
  14990. },
  14991. "required": ["type", "message"],
  14992. "additionalProperties": false
  14993. },
  14994. "provider": {
  14995. "type": "object",
  14996. "properties": {
  14997. "executed": {
  14998. "type": "boolean"
  14999. },
  15000. "metadata": {
  15001. "type": "object"
  15002. }
  15003. },
  15004. "required": ["executed"],
  15005. "additionalProperties": false
  15006. }
  15007. },
  15008. "required": ["timestamp", "sessionID", "callID", "error", "provider"],
  15009. "additionalProperties": false
  15010. }
  15011. },
  15012. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15013. "additionalProperties": false
  15014. },
  15015. "SyncEventSessionNextRetried": {
  15016. "type": "object",
  15017. "properties": {
  15018. "type": {
  15019. "type": "string",
  15020. "enum": ["sync"]
  15021. },
  15022. "name": {
  15023. "type": "string",
  15024. "enum": ["session.next.retried.1"]
  15025. },
  15026. "id": {
  15027. "type": "string"
  15028. },
  15029. "seq": {
  15030. "type": "number"
  15031. },
  15032. "aggregateID": {
  15033. "type": "string",
  15034. "enum": ["sessionID"]
  15035. },
  15036. "data": {
  15037. "type": "object",
  15038. "properties": {
  15039. "timestamp": {
  15040. "type": "number"
  15041. },
  15042. "sessionID": {
  15043. "type": "string"
  15044. },
  15045. "attempt": {
  15046. "type": "integer",
  15047. "minimum": 0
  15048. },
  15049. "error": {
  15050. "$ref": "#/components/schemas/SessionNextRetry_error"
  15051. }
  15052. },
  15053. "required": ["timestamp", "sessionID", "attempt", "error"],
  15054. "additionalProperties": false
  15055. }
  15056. },
  15057. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15058. "additionalProperties": false
  15059. },
  15060. "SyncEventSessionNextCompactionStarted": {
  15061. "type": "object",
  15062. "properties": {
  15063. "type": {
  15064. "type": "string",
  15065. "enum": ["sync"]
  15066. },
  15067. "name": {
  15068. "type": "string",
  15069. "enum": ["session.next.compaction.started.1"]
  15070. },
  15071. "id": {
  15072. "type": "string"
  15073. },
  15074. "seq": {
  15075. "type": "number"
  15076. },
  15077. "aggregateID": {
  15078. "type": "string",
  15079. "enum": ["sessionID"]
  15080. },
  15081. "data": {
  15082. "type": "object",
  15083. "properties": {
  15084. "timestamp": {
  15085. "type": "number"
  15086. },
  15087. "sessionID": {
  15088. "type": "string"
  15089. },
  15090. "reason": {
  15091. "type": "string",
  15092. "enum": ["auto", "manual"]
  15093. }
  15094. },
  15095. "required": ["timestamp", "sessionID", "reason"],
  15096. "additionalProperties": false
  15097. }
  15098. },
  15099. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15100. "additionalProperties": false
  15101. },
  15102. "SyncEventSessionNextCompactionDelta": {
  15103. "type": "object",
  15104. "properties": {
  15105. "type": {
  15106. "type": "string",
  15107. "enum": ["sync"]
  15108. },
  15109. "name": {
  15110. "type": "string",
  15111. "enum": ["session.next.compaction.delta.1"]
  15112. },
  15113. "id": {
  15114. "type": "string"
  15115. },
  15116. "seq": {
  15117. "type": "number"
  15118. },
  15119. "aggregateID": {
  15120. "type": "string",
  15121. "enum": ["sessionID"]
  15122. },
  15123. "data": {
  15124. "type": "object",
  15125. "properties": {
  15126. "timestamp": {
  15127. "type": "number"
  15128. },
  15129. "sessionID": {
  15130. "type": "string"
  15131. },
  15132. "text": {
  15133. "type": "string"
  15134. }
  15135. },
  15136. "required": ["timestamp", "sessionID", "text"],
  15137. "additionalProperties": false
  15138. }
  15139. },
  15140. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15141. "additionalProperties": false
  15142. },
  15143. "SyncEventSessionNextCompactionEnded": {
  15144. "type": "object",
  15145. "properties": {
  15146. "type": {
  15147. "type": "string",
  15148. "enum": ["sync"]
  15149. },
  15150. "name": {
  15151. "type": "string",
  15152. "enum": ["session.next.compaction.ended.1"]
  15153. },
  15154. "id": {
  15155. "type": "string"
  15156. },
  15157. "seq": {
  15158. "type": "number"
  15159. },
  15160. "aggregateID": {
  15161. "type": "string",
  15162. "enum": ["sessionID"]
  15163. },
  15164. "data": {
  15165. "type": "object",
  15166. "properties": {
  15167. "timestamp": {
  15168. "type": "number"
  15169. },
  15170. "sessionID": {
  15171. "type": "string"
  15172. },
  15173. "text": {
  15174. "type": "string"
  15175. },
  15176. "include": {
  15177. "type": "string"
  15178. }
  15179. },
  15180. "required": ["timestamp", "sessionID", "text"],
  15181. "additionalProperties": false
  15182. }
  15183. },
  15184. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15185. "additionalProperties": false
  15186. },
  15187. "EventServerInstanceDisposed": {
  15188. "type": "object",
  15189. "properties": {
  15190. "id": {
  15191. "type": "string"
  15192. },
  15193. "type": {
  15194. "type": "string",
  15195. "enum": ["server.instance.disposed"]
  15196. },
  15197. "properties": {
  15198. "type": "object",
  15199. "properties": {
  15200. "directory": {
  15201. "type": "string"
  15202. }
  15203. },
  15204. "required": ["directory"],
  15205. "additionalProperties": false
  15206. }
  15207. },
  15208. "required": ["id", "type", "properties"],
  15209. "additionalProperties": false
  15210. },
  15211. "EventFileEdited": {
  15212. "type": "object",
  15213. "properties": {
  15214. "id": {
  15215. "type": "string"
  15216. },
  15217. "type": {
  15218. "type": "string",
  15219. "enum": ["file.edited"]
  15220. },
  15221. "properties": {
  15222. "type": "object",
  15223. "properties": {
  15224. "file": {
  15225. "type": "string"
  15226. }
  15227. },
  15228. "required": ["file"],
  15229. "additionalProperties": false
  15230. }
  15231. },
  15232. "required": ["id", "type", "properties"],
  15233. "additionalProperties": false
  15234. },
  15235. "EventFileWatcherUpdated": {
  15236. "type": "object",
  15237. "properties": {
  15238. "id": {
  15239. "type": "string"
  15240. },
  15241. "type": {
  15242. "type": "string",
  15243. "enum": ["file.watcher.updated"]
  15244. },
  15245. "properties": {
  15246. "type": "object",
  15247. "properties": {
  15248. "file": {
  15249. "type": "string"
  15250. },
  15251. "event": {
  15252. "type": "string",
  15253. "enum": ["add", "change", "unlink"]
  15254. }
  15255. },
  15256. "required": ["file", "event"],
  15257. "additionalProperties": false
  15258. }
  15259. },
  15260. "required": ["id", "type", "properties"],
  15261. "additionalProperties": false
  15262. },
  15263. "EventLspClientDiagnostics": {
  15264. "type": "object",
  15265. "properties": {
  15266. "id": {
  15267. "type": "string"
  15268. },
  15269. "type": {
  15270. "type": "string",
  15271. "enum": ["lsp.client.diagnostics"]
  15272. },
  15273. "properties": {
  15274. "type": "object",
  15275. "properties": {
  15276. "serverID": {
  15277. "type": "string"
  15278. },
  15279. "path": {
  15280. "type": "string"
  15281. }
  15282. },
  15283. "required": ["serverID", "path"],
  15284. "additionalProperties": false
  15285. }
  15286. },
  15287. "required": ["id", "type", "properties"],
  15288. "additionalProperties": false
  15289. },
  15290. "EventLspUpdated": {
  15291. "type": "object",
  15292. "properties": {
  15293. "id": {
  15294. "type": "string"
  15295. },
  15296. "type": {
  15297. "type": "string",
  15298. "enum": ["lsp.updated"]
  15299. },
  15300. "properties": {
  15301. "type": "object",
  15302. "properties": {}
  15303. }
  15304. },
  15305. "required": ["id", "type", "properties"],
  15306. "additionalProperties": false
  15307. },
  15308. "EventMessagePartDelta": {
  15309. "type": "object",
  15310. "properties": {
  15311. "id": {
  15312. "type": "string"
  15313. },
  15314. "type": {
  15315. "type": "string",
  15316. "enum": ["message.part.delta"]
  15317. },
  15318. "properties": {
  15319. "type": "object",
  15320. "properties": {
  15321. "sessionID": {
  15322. "type": "string"
  15323. },
  15324. "messageID": {
  15325. "type": "string"
  15326. },
  15327. "partID": {
  15328. "type": "string"
  15329. },
  15330. "field": {
  15331. "type": "string"
  15332. },
  15333. "delta": {
  15334. "type": "string"
  15335. }
  15336. },
  15337. "required": ["sessionID", "messageID", "partID", "field", "delta"],
  15338. "additionalProperties": false
  15339. }
  15340. },
  15341. "required": ["id", "type", "properties"],
  15342. "additionalProperties": false
  15343. },
  15344. "EventPermissionAsked": {
  15345. "type": "object",
  15346. "properties": {
  15347. "id": {
  15348. "type": "string"
  15349. },
  15350. "type": {
  15351. "type": "string",
  15352. "enum": ["permission.asked"]
  15353. },
  15354. "properties": {
  15355. "$ref": "#/components/schemas/PermissionRequest"
  15356. }
  15357. },
  15358. "required": ["id", "type", "properties"],
  15359. "additionalProperties": false
  15360. },
  15361. "EventPermissionReplied": {
  15362. "type": "object",
  15363. "properties": {
  15364. "id": {
  15365. "type": "string"
  15366. },
  15367. "type": {
  15368. "type": "string",
  15369. "enum": ["permission.replied"]
  15370. },
  15371. "properties": {
  15372. "type": "object",
  15373. "properties": {
  15374. "sessionID": {
  15375. "type": "string"
  15376. },
  15377. "requestID": {
  15378. "type": "string"
  15379. },
  15380. "reply": {
  15381. "type": "string",
  15382. "enum": ["once", "always", "reject"]
  15383. }
  15384. },
  15385. "required": ["sessionID", "requestID", "reply"],
  15386. "additionalProperties": false
  15387. }
  15388. },
  15389. "required": ["id", "type", "properties"],
  15390. "additionalProperties": false
  15391. },
  15392. "EventSessionDiff": {
  15393. "type": "object",
  15394. "properties": {
  15395. "id": {
  15396. "type": "string"
  15397. },
  15398. "type": {
  15399. "type": "string",
  15400. "enum": ["session.diff"]
  15401. },
  15402. "properties": {
  15403. "type": "object",
  15404. "properties": {
  15405. "sessionID": {
  15406. "type": "string"
  15407. },
  15408. "diff": {
  15409. "type": "array",
  15410. "items": {
  15411. "$ref": "#/components/schemas/SnapshotFileDiff"
  15412. }
  15413. }
  15414. },
  15415. "required": ["sessionID", "diff"],
  15416. "additionalProperties": false
  15417. }
  15418. },
  15419. "required": ["id", "type", "properties"],
  15420. "additionalProperties": false
  15421. },
  15422. "EventSessionError": {
  15423. "type": "object",
  15424. "properties": {
  15425. "id": {
  15426. "type": "string"
  15427. },
  15428. "type": {
  15429. "type": "string",
  15430. "enum": ["session.error"]
  15431. },
  15432. "properties": {
  15433. "type": "object",
  15434. "properties": {
  15435. "sessionID": {
  15436. "type": "string"
  15437. },
  15438. "error": {
  15439. "anyOf": [
  15440. {
  15441. "$ref": "#/components/schemas/ProviderAuthError"
  15442. },
  15443. {
  15444. "$ref": "#/components/schemas/UnknownError"
  15445. },
  15446. {
  15447. "$ref": "#/components/schemas/MessageOutputLengthError"
  15448. },
  15449. {
  15450. "$ref": "#/components/schemas/MessageAbortedError"
  15451. },
  15452. {
  15453. "$ref": "#/components/schemas/StructuredOutputError"
  15454. },
  15455. {
  15456. "$ref": "#/components/schemas/ContextOverflowError"
  15457. },
  15458. {
  15459. "$ref": "#/components/schemas/APIError"
  15460. }
  15461. ]
  15462. }
  15463. },
  15464. "additionalProperties": false
  15465. }
  15466. },
  15467. "required": ["id", "type", "properties"],
  15468. "additionalProperties": false
  15469. },
  15470. "EventInstallationUpdated": {
  15471. "type": "object",
  15472. "properties": {
  15473. "id": {
  15474. "type": "string"
  15475. },
  15476. "type": {
  15477. "type": "string",
  15478. "enum": ["installation.updated"]
  15479. },
  15480. "properties": {
  15481. "type": "object",
  15482. "properties": {
  15483. "version": {
  15484. "type": "string"
  15485. }
  15486. },
  15487. "required": ["version"],
  15488. "additionalProperties": false
  15489. }
  15490. },
  15491. "required": ["id", "type", "properties"],
  15492. "additionalProperties": false
  15493. },
  15494. "EventInstallationUpdate-available": {
  15495. "type": "object",
  15496. "properties": {
  15497. "id": {
  15498. "type": "string"
  15499. },
  15500. "type": {
  15501. "type": "string",
  15502. "enum": ["installation.update-available"]
  15503. },
  15504. "properties": {
  15505. "type": "object",
  15506. "properties": {
  15507. "version": {
  15508. "type": "string"
  15509. }
  15510. },
  15511. "required": ["version"],
  15512. "additionalProperties": false
  15513. }
  15514. },
  15515. "required": ["id", "type", "properties"],
  15516. "additionalProperties": false
  15517. },
  15518. "EventQuestionAsked": {
  15519. "type": "object",
  15520. "properties": {
  15521. "id": {
  15522. "type": "string"
  15523. },
  15524. "type": {
  15525. "type": "string",
  15526. "enum": ["question.asked"]
  15527. },
  15528. "properties": {
  15529. "$ref": "#/components/schemas/QuestionRequest"
  15530. }
  15531. },
  15532. "required": ["id", "type", "properties"],
  15533. "additionalProperties": false
  15534. },
  15535. "EventQuestionReplied": {
  15536. "type": "object",
  15537. "properties": {
  15538. "id": {
  15539. "type": "string"
  15540. },
  15541. "type": {
  15542. "type": "string",
  15543. "enum": ["question.replied"]
  15544. },
  15545. "properties": {
  15546. "$ref": "#/components/schemas/QuestionReplied"
  15547. }
  15548. },
  15549. "required": ["id", "type", "properties"],
  15550. "additionalProperties": false
  15551. },
  15552. "EventQuestionRejected": {
  15553. "type": "object",
  15554. "properties": {
  15555. "id": {
  15556. "type": "string"
  15557. },
  15558. "type": {
  15559. "type": "string",
  15560. "enum": ["question.rejected"]
  15561. },
  15562. "properties": {
  15563. "$ref": "#/components/schemas/QuestionRejected"
  15564. }
  15565. },
  15566. "required": ["id", "type", "properties"],
  15567. "additionalProperties": false
  15568. },
  15569. "EventTodoUpdated": {
  15570. "type": "object",
  15571. "properties": {
  15572. "id": {
  15573. "type": "string"
  15574. },
  15575. "type": {
  15576. "type": "string",
  15577. "enum": ["todo.updated"]
  15578. },
  15579. "properties": {
  15580. "type": "object",
  15581. "properties": {
  15582. "sessionID": {
  15583. "type": "string"
  15584. },
  15585. "todos": {
  15586. "type": "array",
  15587. "items": {
  15588. "$ref": "#/components/schemas/Todo"
  15589. }
  15590. }
  15591. },
  15592. "required": ["sessionID", "todos"],
  15593. "additionalProperties": false
  15594. }
  15595. },
  15596. "required": ["id", "type", "properties"],
  15597. "additionalProperties": false
  15598. },
  15599. "EventSessionStatus": {
  15600. "type": "object",
  15601. "properties": {
  15602. "id": {
  15603. "type": "string"
  15604. },
  15605. "type": {
  15606. "type": "string",
  15607. "enum": ["session.status"]
  15608. },
  15609. "properties": {
  15610. "type": "object",
  15611. "properties": {
  15612. "sessionID": {
  15613. "type": "string"
  15614. },
  15615. "status": {
  15616. "$ref": "#/components/schemas/SessionStatus"
  15617. }
  15618. },
  15619. "required": ["sessionID", "status"],
  15620. "additionalProperties": false
  15621. }
  15622. },
  15623. "required": ["id", "type", "properties"],
  15624. "additionalProperties": false
  15625. },
  15626. "EventSessionIdle": {
  15627. "type": "object",
  15628. "properties": {
  15629. "id": {
  15630. "type": "string"
  15631. },
  15632. "type": {
  15633. "type": "string",
  15634. "enum": ["session.idle"]
  15635. },
  15636. "properties": {
  15637. "type": "object",
  15638. "properties": {
  15639. "sessionID": {
  15640. "type": "string"
  15641. }
  15642. },
  15643. "required": ["sessionID"],
  15644. "additionalProperties": false
  15645. }
  15646. },
  15647. "required": ["id", "type", "properties"],
  15648. "additionalProperties": false
  15649. },
  15650. "EventSessionCompacted": {
  15651. "type": "object",
  15652. "properties": {
  15653. "id": {
  15654. "type": "string"
  15655. },
  15656. "type": {
  15657. "type": "string",
  15658. "enum": ["session.compacted"]
  15659. },
  15660. "properties": {
  15661. "type": "object",
  15662. "properties": {
  15663. "sessionID": {
  15664. "type": "string"
  15665. }
  15666. },
  15667. "required": ["sessionID"],
  15668. "additionalProperties": false
  15669. }
  15670. },
  15671. "required": ["id", "type", "properties"],
  15672. "additionalProperties": false
  15673. },
  15674. "EventMcpToolsChanged": {
  15675. "type": "object",
  15676. "properties": {
  15677. "id": {
  15678. "type": "string"
  15679. },
  15680. "type": {
  15681. "type": "string",
  15682. "enum": ["mcp.tools.changed"]
  15683. },
  15684. "properties": {
  15685. "type": "object",
  15686. "properties": {
  15687. "server": {
  15688. "type": "string"
  15689. }
  15690. },
  15691. "required": ["server"],
  15692. "additionalProperties": false
  15693. }
  15694. },
  15695. "required": ["id", "type", "properties"],
  15696. "additionalProperties": false
  15697. },
  15698. "EventMcpBrowserOpenFailed": {
  15699. "type": "object",
  15700. "properties": {
  15701. "id": {
  15702. "type": "string"
  15703. },
  15704. "type": {
  15705. "type": "string",
  15706. "enum": ["mcp.browser.open.failed"]
  15707. },
  15708. "properties": {
  15709. "type": "object",
  15710. "properties": {
  15711. "mcpName": {
  15712. "type": "string"
  15713. },
  15714. "url": {
  15715. "type": "string"
  15716. }
  15717. },
  15718. "required": ["mcpName", "url"],
  15719. "additionalProperties": false
  15720. }
  15721. },
  15722. "required": ["id", "type", "properties"],
  15723. "additionalProperties": false
  15724. },
  15725. "EventCommandExecuted": {
  15726. "type": "object",
  15727. "properties": {
  15728. "id": {
  15729. "type": "string"
  15730. },
  15731. "type": {
  15732. "type": "string",
  15733. "enum": ["command.executed"]
  15734. },
  15735. "properties": {
  15736. "type": "object",
  15737. "properties": {
  15738. "name": {
  15739. "type": "string"
  15740. },
  15741. "sessionID": {
  15742. "type": "string"
  15743. },
  15744. "arguments": {
  15745. "type": "string"
  15746. },
  15747. "messageID": {
  15748. "type": "string"
  15749. }
  15750. },
  15751. "required": ["name", "sessionID", "arguments", "messageID"],
  15752. "additionalProperties": false
  15753. }
  15754. },
  15755. "required": ["id", "type", "properties"],
  15756. "additionalProperties": false
  15757. },
  15758. "EventProjectUpdated": {
  15759. "type": "object",
  15760. "properties": {
  15761. "id": {
  15762. "type": "string"
  15763. },
  15764. "type": {
  15765. "type": "string",
  15766. "enum": ["project.updated"]
  15767. },
  15768. "properties": {
  15769. "$ref": "#/components/schemas/Project"
  15770. }
  15771. },
  15772. "required": ["id", "type", "properties"],
  15773. "additionalProperties": false
  15774. },
  15775. "EventVcsBranchUpdated": {
  15776. "type": "object",
  15777. "properties": {
  15778. "id": {
  15779. "type": "string"
  15780. },
  15781. "type": {
  15782. "type": "string",
  15783. "enum": ["vcs.branch.updated"]
  15784. },
  15785. "properties": {
  15786. "type": "object",
  15787. "properties": {
  15788. "branch": {
  15789. "type": "string"
  15790. }
  15791. },
  15792. "additionalProperties": false
  15793. }
  15794. },
  15795. "required": ["id", "type", "properties"],
  15796. "additionalProperties": false
  15797. },
  15798. "EventWorkspaceReady": {
  15799. "type": "object",
  15800. "properties": {
  15801. "id": {
  15802. "type": "string"
  15803. },
  15804. "type": {
  15805. "type": "string",
  15806. "enum": ["workspace.ready"]
  15807. },
  15808. "properties": {
  15809. "type": "object",
  15810. "properties": {
  15811. "name": {
  15812. "type": "string"
  15813. }
  15814. },
  15815. "required": ["name"],
  15816. "additionalProperties": false
  15817. }
  15818. },
  15819. "required": ["id", "type", "properties"],
  15820. "additionalProperties": false
  15821. },
  15822. "EventWorkspaceFailed": {
  15823. "type": "object",
  15824. "properties": {
  15825. "id": {
  15826. "type": "string"
  15827. },
  15828. "type": {
  15829. "type": "string",
  15830. "enum": ["workspace.failed"]
  15831. },
  15832. "properties": {
  15833. "type": "object",
  15834. "properties": {
  15835. "message": {
  15836. "type": "string"
  15837. }
  15838. },
  15839. "required": ["message"],
  15840. "additionalProperties": false
  15841. }
  15842. },
  15843. "required": ["id", "type", "properties"],
  15844. "additionalProperties": false
  15845. },
  15846. "EventWorkspaceStatus": {
  15847. "type": "object",
  15848. "properties": {
  15849. "id": {
  15850. "type": "string"
  15851. },
  15852. "type": {
  15853. "type": "string",
  15854. "enum": ["workspace.status"]
  15855. },
  15856. "properties": {
  15857. "type": "object",
  15858. "properties": {
  15859. "workspaceID": {
  15860. "type": "string"
  15861. },
  15862. "status": {
  15863. "type": "string",
  15864. "enum": ["connected", "connecting", "disconnected", "error"]
  15865. }
  15866. },
  15867. "required": ["workspaceID", "status"],
  15868. "additionalProperties": false
  15869. }
  15870. },
  15871. "required": ["id", "type", "properties"],
  15872. "additionalProperties": false
  15873. },
  15874. "EventWorktreeReady": {
  15875. "type": "object",
  15876. "properties": {
  15877. "id": {
  15878. "type": "string"
  15879. },
  15880. "type": {
  15881. "type": "string",
  15882. "enum": ["worktree.ready"]
  15883. },
  15884. "properties": {
  15885. "type": "object",
  15886. "properties": {
  15887. "name": {
  15888. "type": "string"
  15889. },
  15890. "branch": {
  15891. "type": "string"
  15892. }
  15893. },
  15894. "required": ["name", "branch"],
  15895. "additionalProperties": false
  15896. }
  15897. },
  15898. "required": ["id", "type", "properties"],
  15899. "additionalProperties": false
  15900. },
  15901. "EventWorktreeFailed": {
  15902. "type": "object",
  15903. "properties": {
  15904. "id": {
  15905. "type": "string"
  15906. },
  15907. "type": {
  15908. "type": "string",
  15909. "enum": ["worktree.failed"]
  15910. },
  15911. "properties": {
  15912. "type": "object",
  15913. "properties": {
  15914. "message": {
  15915. "type": "string"
  15916. }
  15917. },
  15918. "required": ["message"],
  15919. "additionalProperties": false
  15920. }
  15921. },
  15922. "required": ["id", "type", "properties"],
  15923. "additionalProperties": false
  15924. },
  15925. "EventPtyCreated": {
  15926. "type": "object",
  15927. "properties": {
  15928. "id": {
  15929. "type": "string"
  15930. },
  15931. "type": {
  15932. "type": "string",
  15933. "enum": ["pty.created"]
  15934. },
  15935. "properties": {
  15936. "type": "object",
  15937. "properties": {
  15938. "info": {
  15939. "$ref": "#/components/schemas/Pty"
  15940. }
  15941. },
  15942. "required": ["info"],
  15943. "additionalProperties": false
  15944. }
  15945. },
  15946. "required": ["id", "type", "properties"],
  15947. "additionalProperties": false
  15948. },
  15949. "EventPtyUpdated": {
  15950. "type": "object",
  15951. "properties": {
  15952. "id": {
  15953. "type": "string"
  15954. },
  15955. "type": {
  15956. "type": "string",
  15957. "enum": ["pty.updated"]
  15958. },
  15959. "properties": {
  15960. "type": "object",
  15961. "properties": {
  15962. "info": {
  15963. "$ref": "#/components/schemas/Pty"
  15964. }
  15965. },
  15966. "required": ["info"],
  15967. "additionalProperties": false
  15968. }
  15969. },
  15970. "required": ["id", "type", "properties"],
  15971. "additionalProperties": false
  15972. },
  15973. "EventPtyExited": {
  15974. "type": "object",
  15975. "properties": {
  15976. "id": {
  15977. "type": "string"
  15978. },
  15979. "type": {
  15980. "type": "string",
  15981. "enum": ["pty.exited"]
  15982. },
  15983. "properties": {
  15984. "type": "object",
  15985. "properties": {
  15986. "id": {
  15987. "type": "string"
  15988. },
  15989. "exitCode": {
  15990. "type": "integer",
  15991. "minimum": 0
  15992. }
  15993. },
  15994. "required": ["id", "exitCode"],
  15995. "additionalProperties": false
  15996. }
  15997. },
  15998. "required": ["id", "type", "properties"],
  15999. "additionalProperties": false
  16000. },
  16001. "EventPtyDeleted": {
  16002. "type": "object",
  16003. "properties": {
  16004. "id": {
  16005. "type": "string"
  16006. },
  16007. "type": {
  16008. "type": "string",
  16009. "enum": ["pty.deleted"]
  16010. },
  16011. "properties": {
  16012. "type": "object",
  16013. "properties": {
  16014. "id": {
  16015. "type": "string"
  16016. }
  16017. },
  16018. "required": ["id"],
  16019. "additionalProperties": false
  16020. }
  16021. },
  16022. "required": ["id", "type", "properties"],
  16023. "additionalProperties": false
  16024. },
  16025. "EventMessageUpdated": {
  16026. "type": "object",
  16027. "properties": {
  16028. "id": {
  16029. "type": "string"
  16030. },
  16031. "type": {
  16032. "type": "string",
  16033. "enum": ["message.updated"]
  16034. },
  16035. "properties": {
  16036. "type": "object",
  16037. "properties": {
  16038. "sessionID": {
  16039. "type": "string"
  16040. },
  16041. "info": {
  16042. "$ref": "#/components/schemas/Message"
  16043. }
  16044. },
  16045. "required": ["sessionID", "info"],
  16046. "additionalProperties": false
  16047. }
  16048. },
  16049. "required": ["id", "type", "properties"],
  16050. "additionalProperties": false
  16051. },
  16052. "EventMessageRemoved": {
  16053. "type": "object",
  16054. "properties": {
  16055. "id": {
  16056. "type": "string"
  16057. },
  16058. "type": {
  16059. "type": "string",
  16060. "enum": ["message.removed"]
  16061. },
  16062. "properties": {
  16063. "type": "object",
  16064. "properties": {
  16065. "sessionID": {
  16066. "type": "string"
  16067. },
  16068. "messageID": {
  16069. "type": "string"
  16070. }
  16071. },
  16072. "required": ["sessionID", "messageID"],
  16073. "additionalProperties": false
  16074. }
  16075. },
  16076. "required": ["id", "type", "properties"],
  16077. "additionalProperties": false
  16078. },
  16079. "EventMessagePartUpdated": {
  16080. "type": "object",
  16081. "properties": {
  16082. "id": {
  16083. "type": "string"
  16084. },
  16085. "type": {
  16086. "type": "string",
  16087. "enum": ["message.part.updated"]
  16088. },
  16089. "properties": {
  16090. "type": "object",
  16091. "properties": {
  16092. "sessionID": {
  16093. "type": "string"
  16094. },
  16095. "part": {
  16096. "$ref": "#/components/schemas/Part"
  16097. },
  16098. "time": {
  16099. "type": "integer",
  16100. "minimum": 0
  16101. }
  16102. },
  16103. "required": ["sessionID", "part", "time"],
  16104. "additionalProperties": false
  16105. }
  16106. },
  16107. "required": ["id", "type", "properties"],
  16108. "additionalProperties": false
  16109. },
  16110. "EventMessagePartRemoved": {
  16111. "type": "object",
  16112. "properties": {
  16113. "id": {
  16114. "type": "string"
  16115. },
  16116. "type": {
  16117. "type": "string",
  16118. "enum": ["message.part.removed"]
  16119. },
  16120. "properties": {
  16121. "type": "object",
  16122. "properties": {
  16123. "sessionID": {
  16124. "type": "string"
  16125. },
  16126. "messageID": {
  16127. "type": "string"
  16128. },
  16129. "partID": {
  16130. "type": "string"
  16131. }
  16132. },
  16133. "required": ["sessionID", "messageID", "partID"],
  16134. "additionalProperties": false
  16135. }
  16136. },
  16137. "required": ["id", "type", "properties"],
  16138. "additionalProperties": false
  16139. },
  16140. "EventSessionCreated": {
  16141. "type": "object",
  16142. "properties": {
  16143. "id": {
  16144. "type": "string"
  16145. },
  16146. "type": {
  16147. "type": "string",
  16148. "enum": ["session.created"]
  16149. },
  16150. "properties": {
  16151. "type": "object",
  16152. "properties": {
  16153. "sessionID": {
  16154. "type": "string"
  16155. },
  16156. "info": {
  16157. "$ref": "#/components/schemas/Session"
  16158. }
  16159. },
  16160. "required": ["sessionID", "info"],
  16161. "additionalProperties": false
  16162. }
  16163. },
  16164. "required": ["id", "type", "properties"],
  16165. "additionalProperties": false
  16166. },
  16167. "EventSessionUpdated": {
  16168. "type": "object",
  16169. "properties": {
  16170. "id": {
  16171. "type": "string"
  16172. },
  16173. "type": {
  16174. "type": "string",
  16175. "enum": ["session.updated"]
  16176. },
  16177. "properties": {
  16178. "type": "object",
  16179. "properties": {
  16180. "sessionID": {
  16181. "type": "string"
  16182. },
  16183. "info": {
  16184. "$ref": "#/components/schemas/Session"
  16185. }
  16186. },
  16187. "required": ["sessionID", "info"],
  16188. "additionalProperties": false
  16189. }
  16190. },
  16191. "required": ["id", "type", "properties"],
  16192. "additionalProperties": false
  16193. },
  16194. "EventSessionDeleted": {
  16195. "type": "object",
  16196. "properties": {
  16197. "id": {
  16198. "type": "string"
  16199. },
  16200. "type": {
  16201. "type": "string",
  16202. "enum": ["session.deleted"]
  16203. },
  16204. "properties": {
  16205. "type": "object",
  16206. "properties": {
  16207. "sessionID": {
  16208. "type": "string"
  16209. },
  16210. "info": {
  16211. "$ref": "#/components/schemas/Session"
  16212. }
  16213. },
  16214. "required": ["sessionID", "info"],
  16215. "additionalProperties": false
  16216. }
  16217. },
  16218. "required": ["id", "type", "properties"],
  16219. "additionalProperties": false
  16220. },
  16221. "EventSessionNextAgentSwitched": {
  16222. "type": "object",
  16223. "properties": {
  16224. "id": {
  16225. "type": "string"
  16226. },
  16227. "type": {
  16228. "type": "string",
  16229. "enum": ["session.next.agent.switched"]
  16230. },
  16231. "properties": {
  16232. "type": "object",
  16233. "properties": {
  16234. "timestamp": {
  16235. "type": "number"
  16236. },
  16237. "sessionID": {
  16238. "type": "string"
  16239. },
  16240. "agent": {
  16241. "type": "string"
  16242. }
  16243. },
  16244. "required": ["timestamp", "sessionID", "agent"],
  16245. "additionalProperties": false
  16246. }
  16247. },
  16248. "required": ["id", "type", "properties"],
  16249. "additionalProperties": false
  16250. },
  16251. "EventSessionNextModelSwitched": {
  16252. "type": "object",
  16253. "properties": {
  16254. "id": {
  16255. "type": "string"
  16256. },
  16257. "type": {
  16258. "type": "string",
  16259. "enum": ["session.next.model.switched"]
  16260. },
  16261. "properties": {
  16262. "type": "object",
  16263. "properties": {
  16264. "timestamp": {
  16265. "type": "number"
  16266. },
  16267. "sessionID": {
  16268. "type": "string"
  16269. },
  16270. "id": {
  16271. "type": "string"
  16272. },
  16273. "providerID": {
  16274. "type": "string"
  16275. },
  16276. "variant": {
  16277. "type": "string"
  16278. }
  16279. },
  16280. "required": ["timestamp", "sessionID", "id", "providerID"],
  16281. "additionalProperties": false
  16282. }
  16283. },
  16284. "required": ["id", "type", "properties"],
  16285. "additionalProperties": false
  16286. },
  16287. "PromptSource": {
  16288. "type": "object",
  16289. "properties": {
  16290. "start": {
  16291. "type": "number"
  16292. },
  16293. "end": {
  16294. "type": "number"
  16295. },
  16296. "text": {
  16297. "type": "string"
  16298. }
  16299. },
  16300. "required": ["start", "end", "text"],
  16301. "additionalProperties": false
  16302. },
  16303. "PromptFileAttachment": {
  16304. "type": "object",
  16305. "properties": {
  16306. "uri": {
  16307. "type": "string"
  16308. },
  16309. "mime": {
  16310. "type": "string"
  16311. },
  16312. "name": {
  16313. "type": "string"
  16314. },
  16315. "description": {
  16316. "type": "string"
  16317. },
  16318. "source": {
  16319. "$ref": "#/components/schemas/PromptSource"
  16320. }
  16321. },
  16322. "required": ["uri", "mime"],
  16323. "additionalProperties": false
  16324. },
  16325. "PromptAgentAttachment": {
  16326. "type": "object",
  16327. "properties": {
  16328. "name": {
  16329. "type": "string"
  16330. },
  16331. "source": {
  16332. "$ref": "#/components/schemas/PromptSource"
  16333. }
  16334. },
  16335. "required": ["name"],
  16336. "additionalProperties": false
  16337. },
  16338. "EventSessionNextPrompted": {
  16339. "type": "object",
  16340. "properties": {
  16341. "id": {
  16342. "type": "string"
  16343. },
  16344. "type": {
  16345. "type": "string",
  16346. "enum": ["session.next.prompted"]
  16347. },
  16348. "properties": {
  16349. "type": "object",
  16350. "properties": {
  16351. "timestamp": {
  16352. "type": "number"
  16353. },
  16354. "sessionID": {
  16355. "type": "string"
  16356. },
  16357. "prompt": {
  16358. "$ref": "#/components/schemas/Prompt"
  16359. }
  16360. },
  16361. "required": ["timestamp", "sessionID", "prompt"],
  16362. "additionalProperties": false
  16363. }
  16364. },
  16365. "required": ["id", "type", "properties"],
  16366. "additionalProperties": false
  16367. },
  16368. "EventSessionNextSynthetic": {
  16369. "type": "object",
  16370. "properties": {
  16371. "id": {
  16372. "type": "string"
  16373. },
  16374. "type": {
  16375. "type": "string",
  16376. "enum": ["session.next.synthetic"]
  16377. },
  16378. "properties": {
  16379. "type": "object",
  16380. "properties": {
  16381. "timestamp": {
  16382. "type": "number"
  16383. },
  16384. "sessionID": {
  16385. "type": "string"
  16386. },
  16387. "text": {
  16388. "type": "string"
  16389. }
  16390. },
  16391. "required": ["timestamp", "sessionID", "text"],
  16392. "additionalProperties": false
  16393. }
  16394. },
  16395. "required": ["id", "type", "properties"],
  16396. "additionalProperties": false
  16397. },
  16398. "EventSessionNextShellStarted": {
  16399. "type": "object",
  16400. "properties": {
  16401. "id": {
  16402. "type": "string"
  16403. },
  16404. "type": {
  16405. "type": "string",
  16406. "enum": ["session.next.shell.started"]
  16407. },
  16408. "properties": {
  16409. "type": "object",
  16410. "properties": {
  16411. "timestamp": {
  16412. "type": "number"
  16413. },
  16414. "sessionID": {
  16415. "type": "string"
  16416. },
  16417. "callID": {
  16418. "type": "string"
  16419. },
  16420. "command": {
  16421. "type": "string"
  16422. }
  16423. },
  16424. "required": ["timestamp", "sessionID", "callID", "command"],
  16425. "additionalProperties": false
  16426. }
  16427. },
  16428. "required": ["id", "type", "properties"],
  16429. "additionalProperties": false
  16430. },
  16431. "EventSessionNextShellEnded": {
  16432. "type": "object",
  16433. "properties": {
  16434. "id": {
  16435. "type": "string"
  16436. },
  16437. "type": {
  16438. "type": "string",
  16439. "enum": ["session.next.shell.ended"]
  16440. },
  16441. "properties": {
  16442. "type": "object",
  16443. "properties": {
  16444. "timestamp": {
  16445. "type": "number"
  16446. },
  16447. "sessionID": {
  16448. "type": "string"
  16449. },
  16450. "callID": {
  16451. "type": "string"
  16452. },
  16453. "output": {
  16454. "type": "string"
  16455. }
  16456. },
  16457. "required": ["timestamp", "sessionID", "callID", "output"],
  16458. "additionalProperties": false
  16459. }
  16460. },
  16461. "required": ["id", "type", "properties"],
  16462. "additionalProperties": false
  16463. },
  16464. "EventSessionNextStepStarted": {
  16465. "type": "object",
  16466. "properties": {
  16467. "id": {
  16468. "type": "string"
  16469. },
  16470. "type": {
  16471. "type": "string",
  16472. "enum": ["session.next.step.started"]
  16473. },
  16474. "properties": {
  16475. "type": "object",
  16476. "properties": {
  16477. "timestamp": {
  16478. "type": "number"
  16479. },
  16480. "sessionID": {
  16481. "type": "string"
  16482. },
  16483. "agent": {
  16484. "type": "string"
  16485. },
  16486. "model": {
  16487. "type": "object",
  16488. "properties": {
  16489. "id": {
  16490. "type": "string"
  16491. },
  16492. "providerID": {
  16493. "type": "string"
  16494. },
  16495. "variant": {
  16496. "type": "string"
  16497. }
  16498. },
  16499. "required": ["id", "providerID"],
  16500. "additionalProperties": false
  16501. },
  16502. "snapshot": {
  16503. "type": "string"
  16504. }
  16505. },
  16506. "required": ["timestamp", "sessionID", "agent", "model"],
  16507. "additionalProperties": false
  16508. }
  16509. },
  16510. "required": ["id", "type", "properties"],
  16511. "additionalProperties": false
  16512. },
  16513. "EventSessionNextStepEnded": {
  16514. "type": "object",
  16515. "properties": {
  16516. "id": {
  16517. "type": "string"
  16518. },
  16519. "type": {
  16520. "type": "string",
  16521. "enum": ["session.next.step.ended"]
  16522. },
  16523. "properties": {
  16524. "type": "object",
  16525. "properties": {
  16526. "timestamp": {
  16527. "type": "number"
  16528. },
  16529. "sessionID": {
  16530. "type": "string"
  16531. },
  16532. "finish": {
  16533. "type": "string"
  16534. },
  16535. "cost": {
  16536. "type": "number"
  16537. },
  16538. "tokens": {
  16539. "type": "object",
  16540. "properties": {
  16541. "input": {
  16542. "type": "integer",
  16543. "minimum": 0
  16544. },
  16545. "output": {
  16546. "type": "integer",
  16547. "minimum": 0
  16548. },
  16549. "reasoning": {
  16550. "type": "integer",
  16551. "minimum": 0
  16552. },
  16553. "cache": {
  16554. "type": "object",
  16555. "properties": {
  16556. "read": {
  16557. "type": "integer",
  16558. "minimum": 0
  16559. },
  16560. "write": {
  16561. "type": "integer",
  16562. "minimum": 0
  16563. }
  16564. },
  16565. "required": ["read", "write"],
  16566. "additionalProperties": false
  16567. }
  16568. },
  16569. "required": ["input", "output", "reasoning", "cache"],
  16570. "additionalProperties": false
  16571. },
  16572. "snapshot": {
  16573. "type": "string"
  16574. }
  16575. },
  16576. "required": ["timestamp", "sessionID", "finish", "cost", "tokens"],
  16577. "additionalProperties": false
  16578. }
  16579. },
  16580. "required": ["id", "type", "properties"],
  16581. "additionalProperties": false
  16582. },
  16583. "EventSessionNextStepFailed": {
  16584. "type": "object",
  16585. "properties": {
  16586. "id": {
  16587. "type": "string"
  16588. },
  16589. "type": {
  16590. "type": "string",
  16591. "enum": ["session.next.step.failed"]
  16592. },
  16593. "properties": {
  16594. "type": "object",
  16595. "properties": {
  16596. "timestamp": {
  16597. "type": "number"
  16598. },
  16599. "sessionID": {
  16600. "type": "string"
  16601. },
  16602. "error": {
  16603. "type": "object",
  16604. "properties": {
  16605. "type": {
  16606. "type": "string"
  16607. },
  16608. "message": {
  16609. "type": "string"
  16610. }
  16611. },
  16612. "required": ["type", "message"],
  16613. "additionalProperties": false
  16614. }
  16615. },
  16616. "required": ["timestamp", "sessionID", "error"],
  16617. "additionalProperties": false
  16618. }
  16619. },
  16620. "required": ["id", "type", "properties"],
  16621. "additionalProperties": false
  16622. },
  16623. "EventSessionNextTextStarted": {
  16624. "type": "object",
  16625. "properties": {
  16626. "id": {
  16627. "type": "string"
  16628. },
  16629. "type": {
  16630. "type": "string",
  16631. "enum": ["session.next.text.started"]
  16632. },
  16633. "properties": {
  16634. "type": "object",
  16635. "properties": {
  16636. "timestamp": {
  16637. "type": "number"
  16638. },
  16639. "sessionID": {
  16640. "type": "string"
  16641. }
  16642. },
  16643. "required": ["timestamp", "sessionID"],
  16644. "additionalProperties": false
  16645. }
  16646. },
  16647. "required": ["id", "type", "properties"],
  16648. "additionalProperties": false
  16649. },
  16650. "EventSessionNextTextDelta": {
  16651. "type": "object",
  16652. "properties": {
  16653. "id": {
  16654. "type": "string"
  16655. },
  16656. "type": {
  16657. "type": "string",
  16658. "enum": ["session.next.text.delta"]
  16659. },
  16660. "properties": {
  16661. "type": "object",
  16662. "properties": {
  16663. "timestamp": {
  16664. "type": "number"
  16665. },
  16666. "sessionID": {
  16667. "type": "string"
  16668. },
  16669. "delta": {
  16670. "type": "string"
  16671. }
  16672. },
  16673. "required": ["timestamp", "sessionID", "delta"],
  16674. "additionalProperties": false
  16675. }
  16676. },
  16677. "required": ["id", "type", "properties"],
  16678. "additionalProperties": false
  16679. },
  16680. "EventSessionNextTextEnded": {
  16681. "type": "object",
  16682. "properties": {
  16683. "id": {
  16684. "type": "string"
  16685. },
  16686. "type": {
  16687. "type": "string",
  16688. "enum": ["session.next.text.ended"]
  16689. },
  16690. "properties": {
  16691. "type": "object",
  16692. "properties": {
  16693. "timestamp": {
  16694. "type": "number"
  16695. },
  16696. "sessionID": {
  16697. "type": "string"
  16698. },
  16699. "text": {
  16700. "type": "string"
  16701. }
  16702. },
  16703. "required": ["timestamp", "sessionID", "text"],
  16704. "additionalProperties": false
  16705. }
  16706. },
  16707. "required": ["id", "type", "properties"],
  16708. "additionalProperties": false
  16709. },
  16710. "EventSessionNextReasoningStarted": {
  16711. "type": "object",
  16712. "properties": {
  16713. "id": {
  16714. "type": "string"
  16715. },
  16716. "type": {
  16717. "type": "string",
  16718. "enum": ["session.next.reasoning.started"]
  16719. },
  16720. "properties": {
  16721. "type": "object",
  16722. "properties": {
  16723. "timestamp": {
  16724. "type": "number"
  16725. },
  16726. "sessionID": {
  16727. "type": "string"
  16728. },
  16729. "reasoningID": {
  16730. "type": "string"
  16731. }
  16732. },
  16733. "required": ["timestamp", "sessionID", "reasoningID"],
  16734. "additionalProperties": false
  16735. }
  16736. },
  16737. "required": ["id", "type", "properties"],
  16738. "additionalProperties": false
  16739. },
  16740. "EventSessionNextReasoningDelta": {
  16741. "type": "object",
  16742. "properties": {
  16743. "id": {
  16744. "type": "string"
  16745. },
  16746. "type": {
  16747. "type": "string",
  16748. "enum": ["session.next.reasoning.delta"]
  16749. },
  16750. "properties": {
  16751. "type": "object",
  16752. "properties": {
  16753. "timestamp": {
  16754. "type": "number"
  16755. },
  16756. "sessionID": {
  16757. "type": "string"
  16758. },
  16759. "reasoningID": {
  16760. "type": "string"
  16761. },
  16762. "delta": {
  16763. "type": "string"
  16764. }
  16765. },
  16766. "required": ["timestamp", "sessionID", "reasoningID", "delta"],
  16767. "additionalProperties": false
  16768. }
  16769. },
  16770. "required": ["id", "type", "properties"],
  16771. "additionalProperties": false
  16772. },
  16773. "EventSessionNextReasoningEnded": {
  16774. "type": "object",
  16775. "properties": {
  16776. "id": {
  16777. "type": "string"
  16778. },
  16779. "type": {
  16780. "type": "string",
  16781. "enum": ["session.next.reasoning.ended"]
  16782. },
  16783. "properties": {
  16784. "type": "object",
  16785. "properties": {
  16786. "timestamp": {
  16787. "type": "number"
  16788. },
  16789. "sessionID": {
  16790. "type": "string"
  16791. },
  16792. "reasoningID": {
  16793. "type": "string"
  16794. },
  16795. "text": {
  16796. "type": "string"
  16797. }
  16798. },
  16799. "required": ["timestamp", "sessionID", "reasoningID", "text"],
  16800. "additionalProperties": false
  16801. }
  16802. },
  16803. "required": ["id", "type", "properties"],
  16804. "additionalProperties": false
  16805. },
  16806. "EventSessionNextToolInputStarted": {
  16807. "type": "object",
  16808. "properties": {
  16809. "id": {
  16810. "type": "string"
  16811. },
  16812. "type": {
  16813. "type": "string",
  16814. "enum": ["session.next.tool.input.started"]
  16815. },
  16816. "properties": {
  16817. "type": "object",
  16818. "properties": {
  16819. "timestamp": {
  16820. "type": "number"
  16821. },
  16822. "sessionID": {
  16823. "type": "string"
  16824. },
  16825. "callID": {
  16826. "type": "string"
  16827. },
  16828. "name": {
  16829. "type": "string"
  16830. }
  16831. },
  16832. "required": ["timestamp", "sessionID", "callID", "name"],
  16833. "additionalProperties": false
  16834. }
  16835. },
  16836. "required": ["id", "type", "properties"],
  16837. "additionalProperties": false
  16838. },
  16839. "EventSessionNextToolInputDelta": {
  16840. "type": "object",
  16841. "properties": {
  16842. "id": {
  16843. "type": "string"
  16844. },
  16845. "type": {
  16846. "type": "string",
  16847. "enum": ["session.next.tool.input.delta"]
  16848. },
  16849. "properties": {
  16850. "type": "object",
  16851. "properties": {
  16852. "timestamp": {
  16853. "type": "number"
  16854. },
  16855. "sessionID": {
  16856. "type": "string"
  16857. },
  16858. "callID": {
  16859. "type": "string"
  16860. },
  16861. "delta": {
  16862. "type": "string"
  16863. }
  16864. },
  16865. "required": ["timestamp", "sessionID", "callID", "delta"],
  16866. "additionalProperties": false
  16867. }
  16868. },
  16869. "required": ["id", "type", "properties"],
  16870. "additionalProperties": false
  16871. },
  16872. "EventSessionNextToolInputEnded": {
  16873. "type": "object",
  16874. "properties": {
  16875. "id": {
  16876. "type": "string"
  16877. },
  16878. "type": {
  16879. "type": "string",
  16880. "enum": ["session.next.tool.input.ended"]
  16881. },
  16882. "properties": {
  16883. "type": "object",
  16884. "properties": {
  16885. "timestamp": {
  16886. "type": "number"
  16887. },
  16888. "sessionID": {
  16889. "type": "string"
  16890. },
  16891. "callID": {
  16892. "type": "string"
  16893. },
  16894. "text": {
  16895. "type": "string"
  16896. }
  16897. },
  16898. "required": ["timestamp", "sessionID", "callID", "text"],
  16899. "additionalProperties": false
  16900. }
  16901. },
  16902. "required": ["id", "type", "properties"],
  16903. "additionalProperties": false
  16904. },
  16905. "EventSessionNextToolCalled": {
  16906. "type": "object",
  16907. "properties": {
  16908. "id": {
  16909. "type": "string"
  16910. },
  16911. "type": {
  16912. "type": "string",
  16913. "enum": ["session.next.tool.called"]
  16914. },
  16915. "properties": {
  16916. "type": "object",
  16917. "properties": {
  16918. "timestamp": {
  16919. "type": "number"
  16920. },
  16921. "sessionID": {
  16922. "type": "string"
  16923. },
  16924. "callID": {
  16925. "type": "string"
  16926. },
  16927. "tool": {
  16928. "type": "string"
  16929. },
  16930. "input": {
  16931. "type": "object"
  16932. },
  16933. "provider": {
  16934. "type": "object",
  16935. "properties": {
  16936. "executed": {
  16937. "type": "boolean"
  16938. },
  16939. "metadata": {
  16940. "type": "object"
  16941. }
  16942. },
  16943. "required": ["executed"],
  16944. "additionalProperties": false
  16945. }
  16946. },
  16947. "required": ["timestamp", "sessionID", "callID", "tool", "input", "provider"],
  16948. "additionalProperties": false
  16949. }
  16950. },
  16951. "required": ["id", "type", "properties"],
  16952. "additionalProperties": false
  16953. },
  16954. "ToolTextContent": {
  16955. "type": "object",
  16956. "properties": {
  16957. "type": {
  16958. "type": "string",
  16959. "enum": ["text"]
  16960. },
  16961. "text": {
  16962. "type": "string"
  16963. }
  16964. },
  16965. "required": ["type", "text"],
  16966. "additionalProperties": false
  16967. },
  16968. "ToolFileContent": {
  16969. "type": "object",
  16970. "properties": {
  16971. "type": {
  16972. "type": "string",
  16973. "enum": ["file"]
  16974. },
  16975. "uri": {
  16976. "type": "string"
  16977. },
  16978. "mime": {
  16979. "type": "string"
  16980. },
  16981. "name": {
  16982. "type": "string"
  16983. }
  16984. },
  16985. "required": ["type", "uri", "mime"],
  16986. "additionalProperties": false
  16987. },
  16988. "EventSessionNextToolProgress": {
  16989. "type": "object",
  16990. "properties": {
  16991. "id": {
  16992. "type": "string"
  16993. },
  16994. "type": {
  16995. "type": "string",
  16996. "enum": ["session.next.tool.progress"]
  16997. },
  16998. "properties": {
  16999. "type": "object",
  17000. "properties": {
  17001. "timestamp": {
  17002. "type": "number"
  17003. },
  17004. "sessionID": {
  17005. "type": "string"
  17006. },
  17007. "callID": {
  17008. "type": "string"
  17009. },
  17010. "structured": {
  17011. "type": "object"
  17012. },
  17013. "content": {
  17014. "type": "array",
  17015. "items": {
  17016. "anyOf": [
  17017. {
  17018. "$ref": "#/components/schemas/ToolTextContent"
  17019. },
  17020. {
  17021. "$ref": "#/components/schemas/ToolFileContent"
  17022. }
  17023. ]
  17024. }
  17025. }
  17026. },
  17027. "required": ["timestamp", "sessionID", "callID", "structured", "content"],
  17028. "additionalProperties": false
  17029. }
  17030. },
  17031. "required": ["id", "type", "properties"],
  17032. "additionalProperties": false
  17033. },
  17034. "EventSessionNextToolSuccess": {
  17035. "type": "object",
  17036. "properties": {
  17037. "id": {
  17038. "type": "string"
  17039. },
  17040. "type": {
  17041. "type": "string",
  17042. "enum": ["session.next.tool.success"]
  17043. },
  17044. "properties": {
  17045. "type": "object",
  17046. "properties": {
  17047. "timestamp": {
  17048. "type": "number"
  17049. },
  17050. "sessionID": {
  17051. "type": "string"
  17052. },
  17053. "callID": {
  17054. "type": "string"
  17055. },
  17056. "structured": {
  17057. "type": "object"
  17058. },
  17059. "content": {
  17060. "type": "array",
  17061. "items": {
  17062. "anyOf": [
  17063. {
  17064. "$ref": "#/components/schemas/ToolTextContent"
  17065. },
  17066. {
  17067. "$ref": "#/components/schemas/ToolFileContent"
  17068. }
  17069. ]
  17070. }
  17071. },
  17072. "provider": {
  17073. "type": "object",
  17074. "properties": {
  17075. "executed": {
  17076. "type": "boolean"
  17077. },
  17078. "metadata": {
  17079. "type": "object"
  17080. }
  17081. },
  17082. "required": ["executed"],
  17083. "additionalProperties": false
  17084. }
  17085. },
  17086. "required": ["timestamp", "sessionID", "callID", "structured", "content", "provider"],
  17087. "additionalProperties": false
  17088. }
  17089. },
  17090. "required": ["id", "type", "properties"],
  17091. "additionalProperties": false
  17092. },
  17093. "EventSessionNextToolFailed": {
  17094. "type": "object",
  17095. "properties": {
  17096. "id": {
  17097. "type": "string"
  17098. },
  17099. "type": {
  17100. "type": "string",
  17101. "enum": ["session.next.tool.failed"]
  17102. },
  17103. "properties": {
  17104. "type": "object",
  17105. "properties": {
  17106. "timestamp": {
  17107. "type": "number"
  17108. },
  17109. "sessionID": {
  17110. "type": "string"
  17111. },
  17112. "callID": {
  17113. "type": "string"
  17114. },
  17115. "error": {
  17116. "type": "object",
  17117. "properties": {
  17118. "type": {
  17119. "type": "string"
  17120. },
  17121. "message": {
  17122. "type": "string"
  17123. }
  17124. },
  17125. "required": ["type", "message"],
  17126. "additionalProperties": false
  17127. },
  17128. "provider": {
  17129. "type": "object",
  17130. "properties": {
  17131. "executed": {
  17132. "type": "boolean"
  17133. },
  17134. "metadata": {
  17135. "type": "object"
  17136. }
  17137. },
  17138. "required": ["executed"],
  17139. "additionalProperties": false
  17140. }
  17141. },
  17142. "required": ["timestamp", "sessionID", "callID", "error", "provider"],
  17143. "additionalProperties": false
  17144. }
  17145. },
  17146. "required": ["id", "type", "properties"],
  17147. "additionalProperties": false
  17148. },
  17149. "SessionNextRetry_error": {
  17150. "type": "object",
  17151. "properties": {
  17152. "message": {
  17153. "type": "string"
  17154. },
  17155. "statusCode": {
  17156. "type": "integer",
  17157. "minimum": 0
  17158. },
  17159. "isRetryable": {
  17160. "type": "boolean"
  17161. },
  17162. "responseHeaders": {
  17163. "type": "object",
  17164. "additionalProperties": {
  17165. "type": "string"
  17166. }
  17167. },
  17168. "responseBody": {
  17169. "type": "string"
  17170. },
  17171. "metadata": {
  17172. "type": "object",
  17173. "additionalProperties": {
  17174. "type": "string"
  17175. }
  17176. }
  17177. },
  17178. "required": ["message", "isRetryable"],
  17179. "additionalProperties": false
  17180. },
  17181. "EventSessionNextRetried": {
  17182. "type": "object",
  17183. "properties": {
  17184. "id": {
  17185. "type": "string"
  17186. },
  17187. "type": {
  17188. "type": "string",
  17189. "enum": ["session.next.retried"]
  17190. },
  17191. "properties": {
  17192. "type": "object",
  17193. "properties": {
  17194. "timestamp": {
  17195. "type": "number"
  17196. },
  17197. "sessionID": {
  17198. "type": "string"
  17199. },
  17200. "attempt": {
  17201. "type": "integer",
  17202. "minimum": 0
  17203. },
  17204. "error": {
  17205. "$ref": "#/components/schemas/SessionNextRetry_error"
  17206. }
  17207. },
  17208. "required": ["timestamp", "sessionID", "attempt", "error"],
  17209. "additionalProperties": false
  17210. }
  17211. },
  17212. "required": ["id", "type", "properties"],
  17213. "additionalProperties": false
  17214. },
  17215. "EventSessionNextCompactionStarted": {
  17216. "type": "object",
  17217. "properties": {
  17218. "id": {
  17219. "type": "string"
  17220. },
  17221. "type": {
  17222. "type": "string",
  17223. "enum": ["session.next.compaction.started"]
  17224. },
  17225. "properties": {
  17226. "type": "object",
  17227. "properties": {
  17228. "timestamp": {
  17229. "type": "number"
  17230. },
  17231. "sessionID": {
  17232. "type": "string"
  17233. },
  17234. "reason": {
  17235. "type": "string",
  17236. "enum": ["auto", "manual"]
  17237. }
  17238. },
  17239. "required": ["timestamp", "sessionID", "reason"],
  17240. "additionalProperties": false
  17241. }
  17242. },
  17243. "required": ["id", "type", "properties"],
  17244. "additionalProperties": false
  17245. },
  17246. "EventSessionNextCompactionDelta": {
  17247. "type": "object",
  17248. "properties": {
  17249. "id": {
  17250. "type": "string"
  17251. },
  17252. "type": {
  17253. "type": "string",
  17254. "enum": ["session.next.compaction.delta"]
  17255. },
  17256. "properties": {
  17257. "type": "object",
  17258. "properties": {
  17259. "timestamp": {
  17260. "type": "number"
  17261. },
  17262. "sessionID": {
  17263. "type": "string"
  17264. },
  17265. "text": {
  17266. "type": "string"
  17267. }
  17268. },
  17269. "required": ["timestamp", "sessionID", "text"],
  17270. "additionalProperties": false
  17271. }
  17272. },
  17273. "required": ["id", "type", "properties"],
  17274. "additionalProperties": false
  17275. },
  17276. "EventSessionNextCompactionEnded": {
  17277. "type": "object",
  17278. "properties": {
  17279. "id": {
  17280. "type": "string"
  17281. },
  17282. "type": {
  17283. "type": "string",
  17284. "enum": ["session.next.compaction.ended"]
  17285. },
  17286. "properties": {
  17287. "type": "object",
  17288. "properties": {
  17289. "timestamp": {
  17290. "type": "number"
  17291. },
  17292. "sessionID": {
  17293. "type": "string"
  17294. },
  17295. "text": {
  17296. "type": "string"
  17297. },
  17298. "include": {
  17299. "type": "string"
  17300. }
  17301. },
  17302. "required": ["timestamp", "sessionID", "text"],
  17303. "additionalProperties": false
  17304. }
  17305. },
  17306. "required": ["id", "type", "properties"],
  17307. "additionalProperties": false
  17308. },
  17309. "EventServerConnected": {
  17310. "type": "object",
  17311. "properties": {
  17312. "id": {
  17313. "type": "string"
  17314. },
  17315. "type": {
  17316. "type": "string",
  17317. "enum": ["server.connected"]
  17318. },
  17319. "properties": {
  17320. "type": "object",
  17321. "properties": {}
  17322. }
  17323. },
  17324. "required": ["id", "type", "properties"],
  17325. "additionalProperties": false
  17326. },
  17327. "EventGlobalDisposed": {
  17328. "type": "object",
  17329. "properties": {
  17330. "id": {
  17331. "type": "string"
  17332. },
  17333. "type": {
  17334. "type": "string",
  17335. "enum": ["global.disposed"]
  17336. },
  17337. "properties": {
  17338. "type": "object",
  17339. "properties": {}
  17340. }
  17341. },
  17342. "required": ["id", "type", "properties"],
  17343. "additionalProperties": false
  17344. },
  17345. "SessionInfo": {
  17346. "type": "object",
  17347. "properties": {
  17348. "id": {
  17349. "type": "string"
  17350. },
  17351. "parentID": {
  17352. "type": "string"
  17353. },
  17354. "projectID": {
  17355. "type": "string"
  17356. },
  17357. "workspaceID": {
  17358. "type": "string"
  17359. },
  17360. "path": {
  17361. "type": "string"
  17362. },
  17363. "agent": {
  17364. "type": "string"
  17365. },
  17366. "model": {
  17367. "type": "object",
  17368. "properties": {
  17369. "id": {
  17370. "type": "string"
  17371. },
  17372. "providerID": {
  17373. "type": "string"
  17374. },
  17375. "variant": {
  17376. "type": "string"
  17377. }
  17378. },
  17379. "required": ["id", "providerID"],
  17380. "additionalProperties": false
  17381. },
  17382. "time": {
  17383. "type": "object",
  17384. "properties": {
  17385. "created": {
  17386. "type": "number"
  17387. },
  17388. "updated": {
  17389. "type": "number"
  17390. },
  17391. "archived": {
  17392. "type": "number"
  17393. }
  17394. },
  17395. "required": ["created", "updated"],
  17396. "additionalProperties": false
  17397. },
  17398. "title": {
  17399. "type": "string"
  17400. }
  17401. },
  17402. "required": ["id", "projectID", "time", "title"],
  17403. "additionalProperties": false
  17404. },
  17405. "SessionDelivery": {
  17406. "type": "string",
  17407. "enum": ["immediate", "deferred"]
  17408. },
  17409. "SessionMessageAgentSwitched": {
  17410. "type": "object",
  17411. "properties": {
  17412. "id": {
  17413. "type": "string"
  17414. },
  17415. "metadata": {
  17416. "type": "object"
  17417. },
  17418. "time": {
  17419. "type": "object",
  17420. "properties": {
  17421. "created": {
  17422. "type": "number"
  17423. }
  17424. },
  17425. "required": ["created"],
  17426. "additionalProperties": false
  17427. },
  17428. "type": {
  17429. "type": "string",
  17430. "enum": ["agent-switched"]
  17431. },
  17432. "agent": {
  17433. "type": "string"
  17434. }
  17435. },
  17436. "required": ["id", "time", "type", "agent"],
  17437. "additionalProperties": false
  17438. },
  17439. "SessionMessageModelSwitched": {
  17440. "type": "object",
  17441. "properties": {
  17442. "id": {
  17443. "type": "string"
  17444. },
  17445. "metadata": {
  17446. "type": "object"
  17447. },
  17448. "time": {
  17449. "type": "object",
  17450. "properties": {
  17451. "created": {
  17452. "type": "number"
  17453. }
  17454. },
  17455. "required": ["created"],
  17456. "additionalProperties": false
  17457. },
  17458. "type": {
  17459. "type": "string",
  17460. "enum": ["model-switched"]
  17461. },
  17462. "model": {
  17463. "type": "object",
  17464. "properties": {
  17465. "id": {
  17466. "type": "string"
  17467. },
  17468. "providerID": {
  17469. "type": "string"
  17470. },
  17471. "variant": {
  17472. "type": "string"
  17473. }
  17474. },
  17475. "required": ["id", "providerID"],
  17476. "additionalProperties": false
  17477. }
  17478. },
  17479. "required": ["id", "time", "type", "model"],
  17480. "additionalProperties": false
  17481. },
  17482. "SessionMessageUser": {
  17483. "type": "object",
  17484. "properties": {
  17485. "id": {
  17486. "type": "string"
  17487. },
  17488. "metadata": {
  17489. "type": "object"
  17490. },
  17491. "time": {
  17492. "type": "object",
  17493. "properties": {
  17494. "created": {
  17495. "type": "number"
  17496. }
  17497. },
  17498. "required": ["created"],
  17499. "additionalProperties": false
  17500. },
  17501. "text": {
  17502. "type": "string"
  17503. },
  17504. "files": {
  17505. "type": "array",
  17506. "items": {
  17507. "$ref": "#/components/schemas/PromptFileAttachment"
  17508. }
  17509. },
  17510. "agents": {
  17511. "type": "array",
  17512. "items": {
  17513. "$ref": "#/components/schemas/PromptAgentAttachment"
  17514. }
  17515. },
  17516. "type": {
  17517. "type": "string",
  17518. "enum": ["user"]
  17519. }
  17520. },
  17521. "required": ["id", "time", "text", "type"],
  17522. "additionalProperties": false
  17523. },
  17524. "SessionMessageSynthetic": {
  17525. "type": "object",
  17526. "properties": {
  17527. "id": {
  17528. "type": "string"
  17529. },
  17530. "metadata": {
  17531. "type": "object"
  17532. },
  17533. "time": {
  17534. "type": "object",
  17535. "properties": {
  17536. "created": {
  17537. "type": "number"
  17538. }
  17539. },
  17540. "required": ["created"],
  17541. "additionalProperties": false
  17542. },
  17543. "sessionID": {
  17544. "type": "string"
  17545. },
  17546. "text": {
  17547. "type": "string"
  17548. },
  17549. "type": {
  17550. "type": "string",
  17551. "enum": ["synthetic"]
  17552. }
  17553. },
  17554. "required": ["id", "time", "sessionID", "text", "type"],
  17555. "additionalProperties": false
  17556. },
  17557. "SessionMessageShell": {
  17558. "type": "object",
  17559. "properties": {
  17560. "id": {
  17561. "type": "string"
  17562. },
  17563. "metadata": {
  17564. "type": "object"
  17565. },
  17566. "time": {
  17567. "type": "object",
  17568. "properties": {
  17569. "created": {
  17570. "type": "number"
  17571. },
  17572. "completed": {
  17573. "type": "number"
  17574. }
  17575. },
  17576. "required": ["created"],
  17577. "additionalProperties": false
  17578. },
  17579. "type": {
  17580. "type": "string",
  17581. "enum": ["shell"]
  17582. },
  17583. "callID": {
  17584. "type": "string"
  17585. },
  17586. "command": {
  17587. "type": "string"
  17588. },
  17589. "output": {
  17590. "type": "string"
  17591. }
  17592. },
  17593. "required": ["id", "time", "type", "callID", "command", "output"],
  17594. "additionalProperties": false
  17595. },
  17596. "SessionMessageAssistantText": {
  17597. "type": "object",
  17598. "properties": {
  17599. "type": {
  17600. "type": "string",
  17601. "enum": ["text"]
  17602. },
  17603. "text": {
  17604. "type": "string"
  17605. }
  17606. },
  17607. "required": ["type", "text"],
  17608. "additionalProperties": false
  17609. },
  17610. "SessionMessageAssistantReasoning": {
  17611. "type": "object",
  17612. "properties": {
  17613. "type": {
  17614. "type": "string",
  17615. "enum": ["reasoning"]
  17616. },
  17617. "id": {
  17618. "type": "string"
  17619. },
  17620. "text": {
  17621. "type": "string"
  17622. }
  17623. },
  17624. "required": ["type", "id", "text"],
  17625. "additionalProperties": false
  17626. },
  17627. "SessionMessageToolStatePending": {
  17628. "type": "object",
  17629. "properties": {
  17630. "status": {
  17631. "type": "string",
  17632. "enum": ["pending"]
  17633. },
  17634. "input": {
  17635. "type": "string"
  17636. }
  17637. },
  17638. "required": ["status", "input"],
  17639. "additionalProperties": false
  17640. },
  17641. "SessionMessageToolStateRunning": {
  17642. "type": "object",
  17643. "properties": {
  17644. "status": {
  17645. "type": "string",
  17646. "enum": ["running"]
  17647. },
  17648. "input": {
  17649. "type": "object"
  17650. },
  17651. "structured": {
  17652. "type": "object"
  17653. },
  17654. "content": {
  17655. "type": "array",
  17656. "items": {
  17657. "anyOf": [
  17658. {
  17659. "$ref": "#/components/schemas/ToolTextContent"
  17660. },
  17661. {
  17662. "$ref": "#/components/schemas/ToolFileContent"
  17663. }
  17664. ]
  17665. }
  17666. }
  17667. },
  17668. "required": ["status", "input", "structured", "content"],
  17669. "additionalProperties": false
  17670. },
  17671. "SessionMessageToolStateCompleted": {
  17672. "type": "object",
  17673. "properties": {
  17674. "status": {
  17675. "type": "string",
  17676. "enum": ["completed"]
  17677. },
  17678. "input": {
  17679. "type": "object"
  17680. },
  17681. "attachments": {
  17682. "type": "array",
  17683. "items": {
  17684. "$ref": "#/components/schemas/PromptFileAttachment"
  17685. }
  17686. },
  17687. "content": {
  17688. "type": "array",
  17689. "items": {
  17690. "anyOf": [
  17691. {
  17692. "$ref": "#/components/schemas/ToolTextContent"
  17693. },
  17694. {
  17695. "$ref": "#/components/schemas/ToolFileContent"
  17696. }
  17697. ]
  17698. }
  17699. },
  17700. "structured": {
  17701. "type": "object"
  17702. }
  17703. },
  17704. "required": ["status", "input", "content", "structured"],
  17705. "additionalProperties": false
  17706. },
  17707. "SessionMessageToolStateError": {
  17708. "type": "object",
  17709. "properties": {
  17710. "status": {
  17711. "type": "string",
  17712. "enum": ["error"]
  17713. },
  17714. "input": {
  17715. "type": "object"
  17716. },
  17717. "content": {
  17718. "type": "array",
  17719. "items": {
  17720. "anyOf": [
  17721. {
  17722. "$ref": "#/components/schemas/ToolTextContent"
  17723. },
  17724. {
  17725. "$ref": "#/components/schemas/ToolFileContent"
  17726. }
  17727. ]
  17728. }
  17729. },
  17730. "structured": {
  17731. "type": "object"
  17732. },
  17733. "error": {
  17734. "type": "object",
  17735. "properties": {
  17736. "type": {
  17737. "type": "string"
  17738. },
  17739. "message": {
  17740. "type": "string"
  17741. }
  17742. },
  17743. "required": ["type", "message"],
  17744. "additionalProperties": false
  17745. }
  17746. },
  17747. "required": ["status", "input", "content", "structured", "error"],
  17748. "additionalProperties": false
  17749. },
  17750. "SessionMessageAssistantTool": {
  17751. "type": "object",
  17752. "properties": {
  17753. "type": {
  17754. "type": "string",
  17755. "enum": ["tool"]
  17756. },
  17757. "id": {
  17758. "type": "string"
  17759. },
  17760. "name": {
  17761. "type": "string"
  17762. },
  17763. "provider": {
  17764. "type": "object",
  17765. "properties": {
  17766. "executed": {
  17767. "type": "boolean"
  17768. },
  17769. "metadata": {
  17770. "type": "object"
  17771. }
  17772. },
  17773. "required": ["executed"],
  17774. "additionalProperties": false
  17775. },
  17776. "state": {
  17777. "anyOf": [
  17778. {
  17779. "$ref": "#/components/schemas/SessionMessageToolStatePending"
  17780. },
  17781. {
  17782. "$ref": "#/components/schemas/SessionMessageToolStateRunning"
  17783. },
  17784. {
  17785. "$ref": "#/components/schemas/SessionMessageToolStateCompleted"
  17786. },
  17787. {
  17788. "$ref": "#/components/schemas/SessionMessageToolStateError"
  17789. }
  17790. ]
  17791. },
  17792. "time": {
  17793. "type": "object",
  17794. "properties": {
  17795. "created": {
  17796. "type": "number"
  17797. },
  17798. "ran": {
  17799. "type": "number"
  17800. },
  17801. "completed": {
  17802. "type": "number"
  17803. },
  17804. "pruned": {
  17805. "type": "number"
  17806. }
  17807. },
  17808. "required": ["created"],
  17809. "additionalProperties": false
  17810. }
  17811. },
  17812. "required": ["type", "id", "name", "state", "time"],
  17813. "additionalProperties": false
  17814. },
  17815. "SessionMessageAssistant": {
  17816. "type": "object",
  17817. "properties": {
  17818. "id": {
  17819. "type": "string"
  17820. },
  17821. "metadata": {
  17822. "type": "object"
  17823. },
  17824. "time": {
  17825. "type": "object",
  17826. "properties": {
  17827. "created": {
  17828. "type": "number"
  17829. },
  17830. "completed": {
  17831. "type": "number"
  17832. }
  17833. },
  17834. "required": ["created"],
  17835. "additionalProperties": false
  17836. },
  17837. "type": {
  17838. "type": "string",
  17839. "enum": ["assistant"]
  17840. },
  17841. "agent": {
  17842. "type": "string"
  17843. },
  17844. "model": {
  17845. "type": "object",
  17846. "properties": {
  17847. "id": {
  17848. "type": "string"
  17849. },
  17850. "providerID": {
  17851. "type": "string"
  17852. },
  17853. "variant": {
  17854. "type": "string"
  17855. }
  17856. },
  17857. "required": ["id", "providerID"],
  17858. "additionalProperties": false
  17859. },
  17860. "content": {
  17861. "type": "array",
  17862. "items": {
  17863. "anyOf": [
  17864. {
  17865. "$ref": "#/components/schemas/SessionMessageAssistantText"
  17866. },
  17867. {
  17868. "$ref": "#/components/schemas/SessionMessageAssistantReasoning"
  17869. },
  17870. {
  17871. "$ref": "#/components/schemas/SessionMessageAssistantTool"
  17872. }
  17873. ]
  17874. }
  17875. },
  17876. "snapshot": {
  17877. "type": "object",
  17878. "properties": {
  17879. "start": {
  17880. "type": "string"
  17881. },
  17882. "end": {
  17883. "type": "string"
  17884. }
  17885. },
  17886. "additionalProperties": false
  17887. },
  17888. "finish": {
  17889. "type": "string"
  17890. },
  17891. "cost": {
  17892. "type": "number"
  17893. },
  17894. "tokens": {
  17895. "type": "object",
  17896. "properties": {
  17897. "input": {
  17898. "type": "number"
  17899. },
  17900. "output": {
  17901. "type": "number"
  17902. },
  17903. "reasoning": {
  17904. "type": "number"
  17905. },
  17906. "cache": {
  17907. "type": "object",
  17908. "properties": {
  17909. "read": {
  17910. "type": "number"
  17911. },
  17912. "write": {
  17913. "type": "number"
  17914. }
  17915. },
  17916. "required": ["read", "write"],
  17917. "additionalProperties": false
  17918. }
  17919. },
  17920. "required": ["input", "output", "reasoning", "cache"],
  17921. "additionalProperties": false
  17922. },
  17923. "error": {
  17924. "type": "object",
  17925. "properties": {
  17926. "type": {
  17927. "type": "string"
  17928. },
  17929. "message": {
  17930. "type": "string"
  17931. }
  17932. },
  17933. "required": ["type", "message"],
  17934. "additionalProperties": false
  17935. }
  17936. },
  17937. "required": ["id", "time", "type", "agent", "model", "content"],
  17938. "additionalProperties": false
  17939. },
  17940. "SessionMessageCompaction": {
  17941. "type": "object",
  17942. "properties": {
  17943. "type": {
  17944. "type": "string",
  17945. "enum": ["compaction"]
  17946. },
  17947. "reason": {
  17948. "type": "string",
  17949. "enum": ["auto", "manual"]
  17950. },
  17951. "summary": {
  17952. "type": "string"
  17953. },
  17954. "include": {
  17955. "type": "string"
  17956. },
  17957. "id": {
  17958. "type": "string"
  17959. },
  17960. "metadata": {
  17961. "type": "object"
  17962. },
  17963. "time": {
  17964. "type": "object",
  17965. "properties": {
  17966. "created": {
  17967. "type": "number"
  17968. }
  17969. },
  17970. "required": ["created"],
  17971. "additionalProperties": false
  17972. }
  17973. },
  17974. "required": ["type", "reason", "summary", "id", "time"],
  17975. "additionalProperties": false
  17976. },
  17977. "SessionMessage": {
  17978. "anyOf": [
  17979. {
  17980. "$ref": "#/components/schemas/SessionMessageAgentSwitched"
  17981. },
  17982. {
  17983. "$ref": "#/components/schemas/SessionMessageModelSwitched"
  17984. },
  17985. {
  17986. "$ref": "#/components/schemas/SessionMessageUser"
  17987. },
  17988. {
  17989. "$ref": "#/components/schemas/SessionMessageSynthetic"
  17990. },
  17991. {
  17992. "$ref": "#/components/schemas/SessionMessageShell"
  17993. },
  17994. {
  17995. "$ref": "#/components/schemas/SessionMessageAssistant"
  17996. },
  17997. {
  17998. "$ref": "#/components/schemas/SessionMessageCompaction"
  17999. }
  18000. ]
  18001. },
  18002. "EventTuiToastShow1": {
  18003. "type": "object",
  18004. "properties": {
  18005. "id": {
  18006. "type": "string"
  18007. },
  18008. "type": {
  18009. "type": "string",
  18010. "enum": ["tui.toast.show"]
  18011. },
  18012. "properties": {
  18013. "type": "object",
  18014. "properties": {
  18015. "title": {
  18016. "type": "string"
  18017. },
  18018. "message": {
  18019. "type": "string"
  18020. },
  18021. "variant": {
  18022. "type": "string",
  18023. "enum": ["info", "success", "warning", "error"]
  18024. },
  18025. "duration": {
  18026. "type": "integer",
  18027. "exclusiveMinimum": 0
  18028. }
  18029. },
  18030. "required": ["message", "variant"],
  18031. "additionalProperties": false
  18032. }
  18033. },
  18034. "required": ["id", "type", "properties"],
  18035. "additionalProperties": false
  18036. },
  18037. "BadRequestError": {
  18038. "type": "object",
  18039. "required": ["data", "errors", "success"],
  18040. "properties": {
  18041. "data": {},
  18042. "errors": {
  18043. "type": "array",
  18044. "items": {
  18045. "type": "object",
  18046. "additionalProperties": {}
  18047. }
  18048. },
  18049. "success": {
  18050. "type": "boolean",
  18051. "enum": [false]
  18052. }
  18053. }
  18054. },
  18055. "NotFoundError": {
  18056. "type": "object",
  18057. "required": ["name", "data"],
  18058. "properties": {
  18059. "name": {
  18060. "type": "string",
  18061. "enum": ["NotFoundError"]
  18062. },
  18063. "data": {
  18064. "type": "object",
  18065. "required": ["message"],
  18066. "properties": {
  18067. "message": {
  18068. "type": "string"
  18069. }
  18070. }
  18071. }
  18072. }
  18073. }
  18074. }
  18075. },
  18076. "security": [],
  18077. "tags": [
  18078. {
  18079. "name": "control",
  18080. "description": "Control plane routes."
  18081. },
  18082. {
  18083. "name": "global",
  18084. "description": "Global server routes."
  18085. },
  18086. {
  18087. "name": "event",
  18088. "description": "Instance event stream route."
  18089. },
  18090. {
  18091. "name": "config",
  18092. "description": "Experimental HttpApi config routes."
  18093. },
  18094. {
  18095. "name": "experimental",
  18096. "description": "Experimental HttpApi read-only routes."
  18097. },
  18098. {
  18099. "name": "file",
  18100. "description": "Experimental HttpApi file routes."
  18101. },
  18102. {
  18103. "name": "instance",
  18104. "description": "Experimental HttpApi instance read routes."
  18105. },
  18106. {
  18107. "name": "mcp",
  18108. "description": "Experimental HttpApi MCP routes."
  18109. },
  18110. {
  18111. "name": "project",
  18112. "description": "Experimental HttpApi project routes."
  18113. },
  18114. {
  18115. "name": "pty",
  18116. "description": "Experimental HttpApi PTY routes."
  18117. },
  18118. {
  18119. "name": "question",
  18120. "description": "Question routes."
  18121. },
  18122. {
  18123. "name": "permission",
  18124. "description": "Experimental HttpApi permission routes."
  18125. },
  18126. {
  18127. "name": "provider",
  18128. "description": "Experimental HttpApi provider routes."
  18129. },
  18130. {
  18131. "name": "session",
  18132. "description": "Experimental HttpApi session routes."
  18133. },
  18134. {
  18135. "name": "sync",
  18136. "description": "Experimental HttpApi sync routes."
  18137. },
  18138. {
  18139. "name": "v2",
  18140. "description": "Experimental v2 routes."
  18141. },
  18142. {
  18143. "name": "v2 messages",
  18144. "description": "Experimental v2 message routes."
  18145. },
  18146. {
  18147. "name": "tui",
  18148. "description": "Experimental HttpApi TUI routes."
  18149. },
  18150. {
  18151. "name": "workspace",
  18152. "description": "Experimental HttpApi workspace routes."
  18153. },
  18154. {
  18155. "name": "pty",
  18156. "description": "PTY websocket route."
  18157. }
  18158. ]
  18159. }