openapi.json 486 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928
  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. "/question": {
  3418. "get": {
  3419. "tags": ["question"],
  3420. "operationId": "question.list",
  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. "responses": {
  3440. "200": {
  3441. "description": "List of pending questions",
  3442. "content": {
  3443. "application/json": {
  3444. "schema": {
  3445. "type": "array",
  3446. "items": {
  3447. "$ref": "#/components/schemas/QuestionRequest"
  3448. },
  3449. "description": "List of pending questions"
  3450. }
  3451. }
  3452. }
  3453. }
  3454. },
  3455. "description": "Get all pending question requests across all sessions.",
  3456. "summary": "List pending questions",
  3457. "x-codeSamples": [
  3458. {
  3459. "lang": "js",
  3460. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.question.list({\n ...\n})"
  3461. }
  3462. ]
  3463. }
  3464. },
  3465. "/question/{requestID}/reply": {
  3466. "post": {
  3467. "tags": ["question"],
  3468. "operationId": "question.reply",
  3469. "parameters": [
  3470. {
  3471. "name": "directory",
  3472. "in": "query",
  3473. "required": false,
  3474. "schema": {
  3475. "type": "string"
  3476. }
  3477. },
  3478. {
  3479. "name": "workspace",
  3480. "in": "query",
  3481. "required": false,
  3482. "schema": {
  3483. "type": "string"
  3484. }
  3485. },
  3486. {
  3487. "name": "requestID",
  3488. "in": "path",
  3489. "schema": {
  3490. "type": "string",
  3491. "pattern": "^que.*"
  3492. },
  3493. "required": true
  3494. }
  3495. ],
  3496. "responses": {
  3497. "200": {
  3498. "description": "Question answered successfully",
  3499. "content": {
  3500. "application/json": {
  3501. "schema": {
  3502. "type": "boolean",
  3503. "description": "Question answered successfully"
  3504. }
  3505. }
  3506. }
  3507. },
  3508. "400": {
  3509. "description": "Bad request",
  3510. "content": {
  3511. "application/json": {
  3512. "schema": {
  3513. "$ref": "#/components/schemas/BadRequestError"
  3514. }
  3515. }
  3516. }
  3517. },
  3518. "404": {
  3519. "description": "Not found",
  3520. "content": {
  3521. "application/json": {
  3522. "schema": {
  3523. "$ref": "#/components/schemas/NotFoundError"
  3524. }
  3525. }
  3526. }
  3527. }
  3528. },
  3529. "description": "Provide answers to a question request from the AI assistant.",
  3530. "summary": "Reply to question request",
  3531. "requestBody": {
  3532. "content": {
  3533. "application/json": {
  3534. "schema": {
  3535. "type": "object",
  3536. "properties": {
  3537. "answers": {
  3538. "type": "array",
  3539. "items": {
  3540. "$ref": "#/components/schemas/QuestionAnswer"
  3541. },
  3542. "description": "User answers in order of questions (each answer is an array of selected labels)"
  3543. }
  3544. },
  3545. "required": ["answers"],
  3546. "additionalProperties": false
  3547. }
  3548. }
  3549. }
  3550. },
  3551. "x-codeSamples": [
  3552. {
  3553. "lang": "js",
  3554. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.question.reply({\n ...\n})"
  3555. }
  3556. ]
  3557. }
  3558. },
  3559. "/question/{requestID}/reject": {
  3560. "post": {
  3561. "tags": ["question"],
  3562. "operationId": "question.reject",
  3563. "parameters": [
  3564. {
  3565. "name": "directory",
  3566. "in": "query",
  3567. "required": false,
  3568. "schema": {
  3569. "type": "string"
  3570. }
  3571. },
  3572. {
  3573. "name": "workspace",
  3574. "in": "query",
  3575. "required": false,
  3576. "schema": {
  3577. "type": "string"
  3578. }
  3579. },
  3580. {
  3581. "name": "requestID",
  3582. "in": "path",
  3583. "schema": {
  3584. "type": "string",
  3585. "pattern": "^que.*"
  3586. },
  3587. "required": true
  3588. }
  3589. ],
  3590. "responses": {
  3591. "200": {
  3592. "description": "Question rejected successfully",
  3593. "content": {
  3594. "application/json": {
  3595. "schema": {
  3596. "type": "boolean",
  3597. "description": "Question rejected successfully"
  3598. }
  3599. }
  3600. }
  3601. },
  3602. "400": {
  3603. "description": "Bad request",
  3604. "content": {
  3605. "application/json": {
  3606. "schema": {
  3607. "$ref": "#/components/schemas/BadRequestError"
  3608. }
  3609. }
  3610. }
  3611. },
  3612. "404": {
  3613. "description": "Not found",
  3614. "content": {
  3615. "application/json": {
  3616. "schema": {
  3617. "$ref": "#/components/schemas/NotFoundError"
  3618. }
  3619. }
  3620. }
  3621. }
  3622. },
  3623. "description": "Reject a question request from the AI assistant.",
  3624. "summary": "Reject question request",
  3625. "x-codeSamples": [
  3626. {
  3627. "lang": "js",
  3628. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.question.reject({\n ...\n})"
  3629. }
  3630. ]
  3631. }
  3632. },
  3633. "/permission": {
  3634. "get": {
  3635. "tags": ["permission"],
  3636. "operationId": "permission.list",
  3637. "parameters": [
  3638. {
  3639. "name": "directory",
  3640. "in": "query",
  3641. "required": false,
  3642. "schema": {
  3643. "type": "string"
  3644. }
  3645. },
  3646. {
  3647. "name": "workspace",
  3648. "in": "query",
  3649. "required": false,
  3650. "schema": {
  3651. "type": "string"
  3652. }
  3653. }
  3654. ],
  3655. "responses": {
  3656. "200": {
  3657. "description": "List of pending permissions",
  3658. "content": {
  3659. "application/json": {
  3660. "schema": {
  3661. "type": "array",
  3662. "items": {
  3663. "$ref": "#/components/schemas/PermissionRequest"
  3664. },
  3665. "description": "List of pending permissions"
  3666. }
  3667. }
  3668. }
  3669. }
  3670. },
  3671. "description": "Get all pending permission requests across all sessions.",
  3672. "summary": "List pending permissions",
  3673. "x-codeSamples": [
  3674. {
  3675. "lang": "js",
  3676. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.permission.list({\n ...\n})"
  3677. }
  3678. ]
  3679. }
  3680. },
  3681. "/permission/{requestID}/reply": {
  3682. "post": {
  3683. "tags": ["permission"],
  3684. "operationId": "permission.reply",
  3685. "parameters": [
  3686. {
  3687. "name": "directory",
  3688. "in": "query",
  3689. "required": false,
  3690. "schema": {
  3691. "type": "string"
  3692. }
  3693. },
  3694. {
  3695. "name": "workspace",
  3696. "in": "query",
  3697. "required": false,
  3698. "schema": {
  3699. "type": "string"
  3700. }
  3701. },
  3702. {
  3703. "name": "requestID",
  3704. "in": "path",
  3705. "schema": {
  3706. "type": "string",
  3707. "pattern": "^per.*"
  3708. },
  3709. "required": true
  3710. }
  3711. ],
  3712. "responses": {
  3713. "200": {
  3714. "description": "Permission processed successfully",
  3715. "content": {
  3716. "application/json": {
  3717. "schema": {
  3718. "type": "boolean",
  3719. "description": "Permission processed successfully"
  3720. }
  3721. }
  3722. }
  3723. },
  3724. "400": {
  3725. "description": "Bad request",
  3726. "content": {
  3727. "application/json": {
  3728. "schema": {
  3729. "$ref": "#/components/schemas/BadRequestError"
  3730. }
  3731. }
  3732. }
  3733. },
  3734. "404": {
  3735. "description": "Not found",
  3736. "content": {
  3737. "application/json": {
  3738. "schema": {
  3739. "$ref": "#/components/schemas/NotFoundError"
  3740. }
  3741. }
  3742. }
  3743. }
  3744. },
  3745. "description": "Approve or deny a permission request from the AI assistant.",
  3746. "summary": "Respond to permission request",
  3747. "requestBody": {
  3748. "content": {
  3749. "application/json": {
  3750. "schema": {
  3751. "type": "object",
  3752. "properties": {
  3753. "reply": {
  3754. "type": "string",
  3755. "enum": ["once", "always", "reject"]
  3756. },
  3757. "message": {
  3758. "type": "string"
  3759. }
  3760. },
  3761. "required": ["reply"],
  3762. "additionalProperties": false
  3763. }
  3764. }
  3765. }
  3766. },
  3767. "x-codeSamples": [
  3768. {
  3769. "lang": "js",
  3770. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.permission.reply({\n ...\n})"
  3771. }
  3772. ]
  3773. }
  3774. },
  3775. "/provider": {
  3776. "get": {
  3777. "tags": ["provider"],
  3778. "operationId": "provider.list",
  3779. "parameters": [
  3780. {
  3781. "name": "directory",
  3782. "in": "query",
  3783. "required": false,
  3784. "schema": {
  3785. "type": "string"
  3786. }
  3787. },
  3788. {
  3789. "name": "workspace",
  3790. "in": "query",
  3791. "required": false,
  3792. "schema": {
  3793. "type": "string"
  3794. }
  3795. }
  3796. ],
  3797. "responses": {
  3798. "200": {
  3799. "description": "List of providers",
  3800. "content": {
  3801. "application/json": {
  3802. "schema": {
  3803. "type": "object",
  3804. "properties": {
  3805. "all": {
  3806. "type": "array",
  3807. "items": {
  3808. "$ref": "#/components/schemas/Provider"
  3809. }
  3810. },
  3811. "default": {
  3812. "type": "object",
  3813. "additionalProperties": {
  3814. "type": "string"
  3815. }
  3816. },
  3817. "connected": {
  3818. "type": "array",
  3819. "items": {
  3820. "type": "string"
  3821. }
  3822. }
  3823. },
  3824. "required": ["all", "default", "connected"],
  3825. "additionalProperties": false,
  3826. "description": "List of providers"
  3827. }
  3828. }
  3829. }
  3830. }
  3831. },
  3832. "description": "Get a list of all available AI providers, including both available and connected ones.",
  3833. "summary": "List providers",
  3834. "x-codeSamples": [
  3835. {
  3836. "lang": "js",
  3837. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.list({\n ...\n})"
  3838. }
  3839. ]
  3840. }
  3841. },
  3842. "/provider/auth": {
  3843. "get": {
  3844. "tags": ["provider"],
  3845. "operationId": "provider.auth",
  3846. "parameters": [
  3847. {
  3848. "name": "directory",
  3849. "in": "query",
  3850. "required": false,
  3851. "schema": {
  3852. "type": "string"
  3853. }
  3854. },
  3855. {
  3856. "name": "workspace",
  3857. "in": "query",
  3858. "required": false,
  3859. "schema": {
  3860. "type": "string"
  3861. }
  3862. }
  3863. ],
  3864. "responses": {
  3865. "200": {
  3866. "description": "Provider auth methods",
  3867. "content": {
  3868. "application/json": {
  3869. "schema": {
  3870. "type": "object",
  3871. "additionalProperties": {
  3872. "type": "array",
  3873. "items": {
  3874. "$ref": "#/components/schemas/ProviderAuthMethod"
  3875. }
  3876. },
  3877. "description": "Provider auth methods"
  3878. }
  3879. }
  3880. }
  3881. }
  3882. },
  3883. "description": "Retrieve available authentication methods for all AI providers.",
  3884. "summary": "Get provider auth methods",
  3885. "x-codeSamples": [
  3886. {
  3887. "lang": "js",
  3888. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.auth({\n ...\n})"
  3889. }
  3890. ]
  3891. }
  3892. },
  3893. "/provider/{providerID}/oauth/authorize": {
  3894. "post": {
  3895. "tags": ["provider"],
  3896. "operationId": "provider.oauth.authorize",
  3897. "parameters": [
  3898. {
  3899. "name": "directory",
  3900. "in": "query",
  3901. "required": false,
  3902. "schema": {
  3903. "type": "string"
  3904. }
  3905. },
  3906. {
  3907. "name": "workspace",
  3908. "in": "query",
  3909. "required": false,
  3910. "schema": {
  3911. "type": "string"
  3912. }
  3913. },
  3914. {
  3915. "name": "providerID",
  3916. "in": "path",
  3917. "schema": {
  3918. "type": "string"
  3919. },
  3920. "required": true
  3921. }
  3922. ],
  3923. "responses": {
  3924. "200": {
  3925. "description": "Authorization URL and method",
  3926. "content": {
  3927. "application/json": {
  3928. "schema": {
  3929. "$ref": "#/components/schemas/ProviderAuthAuthorization"
  3930. }
  3931. }
  3932. }
  3933. },
  3934. "400": {
  3935. "description": "Bad request",
  3936. "content": {
  3937. "application/json": {
  3938. "schema": {
  3939. "$ref": "#/components/schemas/BadRequestError"
  3940. }
  3941. }
  3942. }
  3943. }
  3944. },
  3945. "description": "Start the OAuth authorization flow for a provider.",
  3946. "summary": "Start OAuth authorization",
  3947. "requestBody": {
  3948. "content": {
  3949. "application/json": {
  3950. "schema": {
  3951. "type": "object",
  3952. "properties": {
  3953. "method": {
  3954. "type": "number",
  3955. "description": "Auth method index"
  3956. },
  3957. "inputs": {
  3958. "type": "object",
  3959. "additionalProperties": {
  3960. "type": "string"
  3961. }
  3962. }
  3963. },
  3964. "required": ["method"],
  3965. "additionalProperties": false
  3966. }
  3967. }
  3968. }
  3969. },
  3970. "x-codeSamples": [
  3971. {
  3972. "lang": "js",
  3973. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.oauth.authorize({\n ...\n})"
  3974. }
  3975. ]
  3976. }
  3977. },
  3978. "/provider/{providerID}/oauth/callback": {
  3979. "post": {
  3980. "tags": ["provider"],
  3981. "operationId": "provider.oauth.callback",
  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": "OAuth callback processed successfully",
  4011. "content": {
  4012. "application/json": {
  4013. "schema": {
  4014. "type": "boolean",
  4015. "description": "OAuth callback processed successfully"
  4016. }
  4017. }
  4018. }
  4019. },
  4020. "400": {
  4021. "description": "Bad request",
  4022. "content": {
  4023. "application/json": {
  4024. "schema": {
  4025. "$ref": "#/components/schemas/BadRequestError"
  4026. }
  4027. }
  4028. }
  4029. }
  4030. },
  4031. "description": "Handle the OAuth callback from a provider after user authorization.",
  4032. "summary": "Handle OAuth callback",
  4033. "requestBody": {
  4034. "content": {
  4035. "application/json": {
  4036. "schema": {
  4037. "type": "object",
  4038. "properties": {
  4039. "method": {
  4040. "type": "number",
  4041. "description": "Auth method index"
  4042. },
  4043. "code": {
  4044. "type": "string"
  4045. }
  4046. },
  4047. "required": ["method"],
  4048. "additionalProperties": false
  4049. }
  4050. }
  4051. }
  4052. },
  4053. "x-codeSamples": [
  4054. {
  4055. "lang": "js",
  4056. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.oauth.callback({\n ...\n})"
  4057. }
  4058. ]
  4059. }
  4060. },
  4061. "/session": {
  4062. "get": {
  4063. "tags": ["session"],
  4064. "operationId": "session.list",
  4065. "parameters": [
  4066. {
  4067. "name": "directory",
  4068. "in": "query",
  4069. "required": false,
  4070. "schema": {
  4071. "type": "string"
  4072. }
  4073. },
  4074. {
  4075. "name": "workspace",
  4076. "in": "query",
  4077. "required": false,
  4078. "schema": {
  4079. "type": "string"
  4080. }
  4081. },
  4082. {
  4083. "name": "scope",
  4084. "in": "query",
  4085. "schema": {
  4086. "type": "string",
  4087. "enum": ["project"]
  4088. },
  4089. "required": false
  4090. },
  4091. {
  4092. "name": "path",
  4093. "in": "query",
  4094. "schema": {
  4095. "type": "string"
  4096. },
  4097. "required": false
  4098. },
  4099. {
  4100. "name": "roots",
  4101. "in": "query",
  4102. "schema": {
  4103. "anyOf": [
  4104. {
  4105. "type": "boolean"
  4106. },
  4107. {
  4108. "type": "string",
  4109. "enum": ["true", "false"]
  4110. }
  4111. ]
  4112. },
  4113. "required": false
  4114. },
  4115. {
  4116. "name": "start",
  4117. "in": "query",
  4118. "schema": {
  4119. "type": "number"
  4120. },
  4121. "required": false
  4122. },
  4123. {
  4124. "name": "search",
  4125. "in": "query",
  4126. "schema": {
  4127. "type": "string"
  4128. },
  4129. "required": false
  4130. },
  4131. {
  4132. "name": "limit",
  4133. "in": "query",
  4134. "schema": {
  4135. "type": "number"
  4136. },
  4137. "required": false
  4138. }
  4139. ],
  4140. "responses": {
  4141. "200": {
  4142. "description": "List of sessions",
  4143. "content": {
  4144. "application/json": {
  4145. "schema": {
  4146. "type": "array",
  4147. "items": {
  4148. "$ref": "#/components/schemas/Session"
  4149. },
  4150. "description": "List of sessions"
  4151. }
  4152. }
  4153. }
  4154. }
  4155. },
  4156. "description": "Get a list of all OpenCode sessions, sorted by most recently updated.",
  4157. "summary": "List sessions",
  4158. "x-codeSamples": [
  4159. {
  4160. "lang": "js",
  4161. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.list({\n ...\n})"
  4162. }
  4163. ]
  4164. },
  4165. "post": {
  4166. "tags": ["session"],
  4167. "operationId": "session.create",
  4168. "parameters": [
  4169. {
  4170. "name": "directory",
  4171. "in": "query",
  4172. "required": false,
  4173. "schema": {
  4174. "type": "string"
  4175. }
  4176. },
  4177. {
  4178. "name": "workspace",
  4179. "in": "query",
  4180. "required": false,
  4181. "schema": {
  4182. "type": "string"
  4183. }
  4184. }
  4185. ],
  4186. "responses": {
  4187. "200": {
  4188. "description": "Successfully created session",
  4189. "content": {
  4190. "application/json": {
  4191. "schema": {
  4192. "$ref": "#/components/schemas/Session"
  4193. }
  4194. }
  4195. }
  4196. },
  4197. "400": {
  4198. "description": "Bad request",
  4199. "content": {
  4200. "application/json": {
  4201. "schema": {
  4202. "$ref": "#/components/schemas/BadRequestError"
  4203. }
  4204. }
  4205. }
  4206. }
  4207. },
  4208. "description": "Create a new OpenCode session for interacting with AI assistants and managing conversations.",
  4209. "summary": "Create session",
  4210. "requestBody": {
  4211. "content": {
  4212. "application/json": {
  4213. "schema": {
  4214. "type": "object",
  4215. "properties": {
  4216. "parentID": {
  4217. "type": "string"
  4218. },
  4219. "title": {
  4220. "type": "string"
  4221. },
  4222. "agent": {
  4223. "type": "string"
  4224. },
  4225. "model": {
  4226. "type": "object",
  4227. "properties": {
  4228. "id": {
  4229. "type": "string"
  4230. },
  4231. "providerID": {
  4232. "type": "string"
  4233. },
  4234. "variant": {
  4235. "type": "string"
  4236. }
  4237. },
  4238. "required": ["id", "providerID"],
  4239. "additionalProperties": false
  4240. },
  4241. "permission": {
  4242. "$ref": "#/components/schemas/PermissionRuleset"
  4243. },
  4244. "workspaceID": {
  4245. "type": "string"
  4246. }
  4247. },
  4248. "additionalProperties": false
  4249. }
  4250. }
  4251. }
  4252. },
  4253. "x-codeSamples": [
  4254. {
  4255. "lang": "js",
  4256. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.create({\n ...\n})"
  4257. }
  4258. ]
  4259. }
  4260. },
  4261. "/session/status": {
  4262. "get": {
  4263. "tags": ["session"],
  4264. "operationId": "session.status",
  4265. "parameters": [
  4266. {
  4267. "name": "directory",
  4268. "in": "query",
  4269. "required": false,
  4270. "schema": {
  4271. "type": "string"
  4272. }
  4273. },
  4274. {
  4275. "name": "workspace",
  4276. "in": "query",
  4277. "required": false,
  4278. "schema": {
  4279. "type": "string"
  4280. }
  4281. }
  4282. ],
  4283. "responses": {
  4284. "200": {
  4285. "description": "Get session status",
  4286. "content": {
  4287. "application/json": {
  4288. "schema": {
  4289. "type": "object",
  4290. "additionalProperties": {
  4291. "$ref": "#/components/schemas/SessionStatus"
  4292. },
  4293. "description": "Get session status"
  4294. }
  4295. }
  4296. }
  4297. },
  4298. "400": {
  4299. "description": "Bad request",
  4300. "content": {
  4301. "application/json": {
  4302. "schema": {
  4303. "$ref": "#/components/schemas/BadRequestError"
  4304. }
  4305. }
  4306. }
  4307. }
  4308. },
  4309. "description": "Retrieve the current status of all sessions, including active, idle, and completed states.",
  4310. "summary": "Get session status",
  4311. "x-codeSamples": [
  4312. {
  4313. "lang": "js",
  4314. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.status({\n ...\n})"
  4315. }
  4316. ]
  4317. }
  4318. },
  4319. "/session/{sessionID}": {
  4320. "get": {
  4321. "tags": ["session"],
  4322. "operationId": "session.get",
  4323. "parameters": [
  4324. {
  4325. "name": "directory",
  4326. "in": "query",
  4327. "required": false,
  4328. "schema": {
  4329. "type": "string"
  4330. }
  4331. },
  4332. {
  4333. "name": "workspace",
  4334. "in": "query",
  4335. "required": false,
  4336. "schema": {
  4337. "type": "string"
  4338. }
  4339. },
  4340. {
  4341. "name": "sessionID",
  4342. "in": "path",
  4343. "schema": {
  4344. "type": "string",
  4345. "pattern": "^ses.*"
  4346. },
  4347. "required": true
  4348. }
  4349. ],
  4350. "responses": {
  4351. "200": {
  4352. "description": "Get session",
  4353. "content": {
  4354. "application/json": {
  4355. "schema": {
  4356. "$ref": "#/components/schemas/Session"
  4357. }
  4358. }
  4359. }
  4360. },
  4361. "400": {
  4362. "description": "Bad request",
  4363. "content": {
  4364. "application/json": {
  4365. "schema": {
  4366. "$ref": "#/components/schemas/BadRequestError"
  4367. }
  4368. }
  4369. }
  4370. },
  4371. "404": {
  4372. "description": "Not found",
  4373. "content": {
  4374. "application/json": {
  4375. "schema": {
  4376. "$ref": "#/components/schemas/NotFoundError"
  4377. }
  4378. }
  4379. }
  4380. }
  4381. },
  4382. "description": "Retrieve detailed information about a specific OpenCode session.",
  4383. "summary": "Get session",
  4384. "x-codeSamples": [
  4385. {
  4386. "lang": "js",
  4387. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.get({\n ...\n})"
  4388. }
  4389. ]
  4390. },
  4391. "delete": {
  4392. "tags": ["session"],
  4393. "operationId": "session.delete",
  4394. "parameters": [
  4395. {
  4396. "name": "directory",
  4397. "in": "query",
  4398. "required": false,
  4399. "schema": {
  4400. "type": "string"
  4401. }
  4402. },
  4403. {
  4404. "name": "workspace",
  4405. "in": "query",
  4406. "required": false,
  4407. "schema": {
  4408. "type": "string"
  4409. }
  4410. },
  4411. {
  4412. "name": "sessionID",
  4413. "in": "path",
  4414. "schema": {
  4415. "type": "string",
  4416. "pattern": "^ses.*"
  4417. },
  4418. "required": true
  4419. }
  4420. ],
  4421. "responses": {
  4422. "200": {
  4423. "description": "Successfully deleted session",
  4424. "content": {
  4425. "application/json": {
  4426. "schema": {
  4427. "type": "boolean",
  4428. "description": "Successfully deleted session"
  4429. }
  4430. }
  4431. }
  4432. },
  4433. "400": {
  4434. "description": "Bad request",
  4435. "content": {
  4436. "application/json": {
  4437. "schema": {
  4438. "$ref": "#/components/schemas/BadRequestError"
  4439. }
  4440. }
  4441. }
  4442. },
  4443. "404": {
  4444. "description": "Not found",
  4445. "content": {
  4446. "application/json": {
  4447. "schema": {
  4448. "$ref": "#/components/schemas/NotFoundError"
  4449. }
  4450. }
  4451. }
  4452. }
  4453. },
  4454. "description": "Delete a session and permanently remove all associated data, including messages and history.",
  4455. "summary": "Delete session",
  4456. "x-codeSamples": [
  4457. {
  4458. "lang": "js",
  4459. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.delete({\n ...\n})"
  4460. }
  4461. ]
  4462. },
  4463. "patch": {
  4464. "tags": ["session"],
  4465. "operationId": "session.update",
  4466. "parameters": [
  4467. {
  4468. "name": "directory",
  4469. "in": "query",
  4470. "required": false,
  4471. "schema": {
  4472. "type": "string"
  4473. }
  4474. },
  4475. {
  4476. "name": "workspace",
  4477. "in": "query",
  4478. "required": false,
  4479. "schema": {
  4480. "type": "string"
  4481. }
  4482. },
  4483. {
  4484. "name": "sessionID",
  4485. "in": "path",
  4486. "schema": {
  4487. "type": "string",
  4488. "pattern": "^ses.*"
  4489. },
  4490. "required": true
  4491. }
  4492. ],
  4493. "responses": {
  4494. "200": {
  4495. "description": "Successfully updated session",
  4496. "content": {
  4497. "application/json": {
  4498. "schema": {
  4499. "$ref": "#/components/schemas/Session"
  4500. }
  4501. }
  4502. }
  4503. },
  4504. "400": {
  4505. "description": "Bad request",
  4506. "content": {
  4507. "application/json": {
  4508. "schema": {
  4509. "$ref": "#/components/schemas/BadRequestError"
  4510. }
  4511. }
  4512. }
  4513. },
  4514. "404": {
  4515. "description": "Not found",
  4516. "content": {
  4517. "application/json": {
  4518. "schema": {
  4519. "$ref": "#/components/schemas/NotFoundError"
  4520. }
  4521. }
  4522. }
  4523. }
  4524. },
  4525. "description": "Update properties of an existing session, such as title or other metadata.",
  4526. "summary": "Update session",
  4527. "requestBody": {
  4528. "content": {
  4529. "application/json": {
  4530. "schema": {
  4531. "type": "object",
  4532. "properties": {
  4533. "title": {
  4534. "type": "string"
  4535. },
  4536. "permission": {
  4537. "$ref": "#/components/schemas/PermissionRuleset"
  4538. },
  4539. "time": {
  4540. "type": "object",
  4541. "properties": {
  4542. "archived": {
  4543. "type": "number"
  4544. }
  4545. },
  4546. "additionalProperties": false
  4547. }
  4548. },
  4549. "additionalProperties": false
  4550. }
  4551. }
  4552. }
  4553. },
  4554. "x-codeSamples": [
  4555. {
  4556. "lang": "js",
  4557. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.update({\n ...\n})"
  4558. }
  4559. ]
  4560. }
  4561. },
  4562. "/session/{sessionID}/children": {
  4563. "get": {
  4564. "tags": ["session"],
  4565. "operationId": "session.children",
  4566. "parameters": [
  4567. {
  4568. "name": "directory",
  4569. "in": "query",
  4570. "required": false,
  4571. "schema": {
  4572. "type": "string"
  4573. }
  4574. },
  4575. {
  4576. "name": "workspace",
  4577. "in": "query",
  4578. "required": false,
  4579. "schema": {
  4580. "type": "string"
  4581. }
  4582. },
  4583. {
  4584. "name": "sessionID",
  4585. "in": "path",
  4586. "schema": {
  4587. "type": "string",
  4588. "pattern": "^ses.*"
  4589. },
  4590. "required": true
  4591. }
  4592. ],
  4593. "responses": {
  4594. "200": {
  4595. "description": "List of children",
  4596. "content": {
  4597. "application/json": {
  4598. "schema": {
  4599. "type": "array",
  4600. "items": {
  4601. "$ref": "#/components/schemas/Session"
  4602. },
  4603. "description": "List of children"
  4604. }
  4605. }
  4606. }
  4607. },
  4608. "400": {
  4609. "description": "Bad request",
  4610. "content": {
  4611. "application/json": {
  4612. "schema": {
  4613. "$ref": "#/components/schemas/BadRequestError"
  4614. }
  4615. }
  4616. }
  4617. },
  4618. "404": {
  4619. "description": "Not found",
  4620. "content": {
  4621. "application/json": {
  4622. "schema": {
  4623. "$ref": "#/components/schemas/NotFoundError"
  4624. }
  4625. }
  4626. }
  4627. }
  4628. },
  4629. "description": "Retrieve all child sessions that were forked from the specified parent session.",
  4630. "summary": "Get session children",
  4631. "x-codeSamples": [
  4632. {
  4633. "lang": "js",
  4634. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.children({\n ...\n})"
  4635. }
  4636. ]
  4637. }
  4638. },
  4639. "/session/{sessionID}/todo": {
  4640. "get": {
  4641. "tags": ["session"],
  4642. "operationId": "session.todo",
  4643. "parameters": [
  4644. {
  4645. "name": "directory",
  4646. "in": "query",
  4647. "required": false,
  4648. "schema": {
  4649. "type": "string"
  4650. }
  4651. },
  4652. {
  4653. "name": "workspace",
  4654. "in": "query",
  4655. "required": false,
  4656. "schema": {
  4657. "type": "string"
  4658. }
  4659. },
  4660. {
  4661. "name": "sessionID",
  4662. "in": "path",
  4663. "schema": {
  4664. "type": "string",
  4665. "pattern": "^ses.*"
  4666. },
  4667. "required": true
  4668. }
  4669. ],
  4670. "responses": {
  4671. "200": {
  4672. "description": "Todo list",
  4673. "content": {
  4674. "application/json": {
  4675. "schema": {
  4676. "type": "array",
  4677. "items": {
  4678. "$ref": "#/components/schemas/Todo"
  4679. },
  4680. "description": "Todo list"
  4681. }
  4682. }
  4683. }
  4684. },
  4685. "400": {
  4686. "description": "Bad request",
  4687. "content": {
  4688. "application/json": {
  4689. "schema": {
  4690. "$ref": "#/components/schemas/BadRequestError"
  4691. }
  4692. }
  4693. }
  4694. },
  4695. "404": {
  4696. "description": "Not found",
  4697. "content": {
  4698. "application/json": {
  4699. "schema": {
  4700. "$ref": "#/components/schemas/NotFoundError"
  4701. }
  4702. }
  4703. }
  4704. }
  4705. },
  4706. "description": "Retrieve the todo list associated with a specific session, showing tasks and action items.",
  4707. "summary": "Get session todos",
  4708. "x-codeSamples": [
  4709. {
  4710. "lang": "js",
  4711. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.todo({\n ...\n})"
  4712. }
  4713. ]
  4714. }
  4715. },
  4716. "/session/{sessionID}/diff": {
  4717. "get": {
  4718. "tags": ["session"],
  4719. "operationId": "session.diff",
  4720. "parameters": [
  4721. {
  4722. "name": "directory",
  4723. "in": "query",
  4724. "required": false,
  4725. "schema": {
  4726. "type": "string"
  4727. }
  4728. },
  4729. {
  4730. "name": "workspace",
  4731. "in": "query",
  4732. "required": false,
  4733. "schema": {
  4734. "type": "string"
  4735. }
  4736. },
  4737. {
  4738. "name": "sessionID",
  4739. "in": "path",
  4740. "schema": {
  4741. "type": "string",
  4742. "pattern": "^ses.*"
  4743. },
  4744. "required": true
  4745. },
  4746. {
  4747. "name": "messageID",
  4748. "in": "query",
  4749. "schema": {
  4750. "type": "string",
  4751. "pattern": "^msg.*"
  4752. },
  4753. "required": false
  4754. }
  4755. ],
  4756. "responses": {
  4757. "200": {
  4758. "description": "Successfully retrieved diff",
  4759. "content": {
  4760. "application/json": {
  4761. "schema": {
  4762. "type": "array",
  4763. "items": {
  4764. "$ref": "#/components/schemas/SnapshotFileDiff"
  4765. },
  4766. "description": "Successfully retrieved diff"
  4767. }
  4768. }
  4769. }
  4770. }
  4771. },
  4772. "description": "Get the file changes (diff) that resulted from a specific user message in the session.",
  4773. "summary": "Get message diff",
  4774. "x-codeSamples": [
  4775. {
  4776. "lang": "js",
  4777. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.diff({\n ...\n})"
  4778. }
  4779. ]
  4780. }
  4781. },
  4782. "/session/{sessionID}/message": {
  4783. "get": {
  4784. "tags": ["session"],
  4785. "operationId": "session.messages",
  4786. "parameters": [
  4787. {
  4788. "name": "directory",
  4789. "in": "query",
  4790. "required": false,
  4791. "schema": {
  4792. "type": "string"
  4793. }
  4794. },
  4795. {
  4796. "name": "workspace",
  4797. "in": "query",
  4798. "required": false,
  4799. "schema": {
  4800. "type": "string"
  4801. }
  4802. },
  4803. {
  4804. "name": "sessionID",
  4805. "in": "path",
  4806. "schema": {
  4807. "type": "string",
  4808. "pattern": "^ses.*"
  4809. },
  4810. "required": true
  4811. },
  4812. {
  4813. "name": "limit",
  4814. "in": "query",
  4815. "schema": {
  4816. "type": "integer",
  4817. "minimum": 0,
  4818. "maximum": 9007199254740991
  4819. },
  4820. "required": false
  4821. },
  4822. {
  4823. "name": "before",
  4824. "in": "query",
  4825. "schema": {
  4826. "type": "string"
  4827. },
  4828. "required": false
  4829. }
  4830. ],
  4831. "responses": {
  4832. "200": {
  4833. "description": "List of messages",
  4834. "content": {
  4835. "application/json": {
  4836. "schema": {
  4837. "type": "array",
  4838. "items": {
  4839. "type": "object",
  4840. "properties": {
  4841. "info": {
  4842. "$ref": "#/components/schemas/Message"
  4843. },
  4844. "parts": {
  4845. "type": "array",
  4846. "items": {
  4847. "$ref": "#/components/schemas/Part"
  4848. }
  4849. }
  4850. },
  4851. "required": ["info", "parts"],
  4852. "additionalProperties": false
  4853. },
  4854. "description": "List of messages"
  4855. }
  4856. }
  4857. }
  4858. },
  4859. "400": {
  4860. "description": "Bad request",
  4861. "content": {
  4862. "application/json": {
  4863. "schema": {
  4864. "$ref": "#/components/schemas/BadRequestError"
  4865. }
  4866. }
  4867. }
  4868. },
  4869. "404": {
  4870. "description": "Not found",
  4871. "content": {
  4872. "application/json": {
  4873. "schema": {
  4874. "$ref": "#/components/schemas/NotFoundError"
  4875. }
  4876. }
  4877. }
  4878. }
  4879. },
  4880. "description": "Retrieve all messages in a session, including user prompts and AI responses.",
  4881. "summary": "Get session messages",
  4882. "x-codeSamples": [
  4883. {
  4884. "lang": "js",
  4885. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.messages({\n ...\n})"
  4886. }
  4887. ]
  4888. },
  4889. "post": {
  4890. "tags": ["session"],
  4891. "operationId": "session.prompt",
  4892. "parameters": [
  4893. {
  4894. "name": "directory",
  4895. "in": "query",
  4896. "required": false,
  4897. "schema": {
  4898. "type": "string"
  4899. }
  4900. },
  4901. {
  4902. "name": "workspace",
  4903. "in": "query",
  4904. "required": false,
  4905. "schema": {
  4906. "type": "string"
  4907. }
  4908. },
  4909. {
  4910. "name": "sessionID",
  4911. "in": "path",
  4912. "schema": {
  4913. "type": "string",
  4914. "pattern": "^ses.*"
  4915. },
  4916. "required": true
  4917. }
  4918. ],
  4919. "responses": {
  4920. "200": {
  4921. "description": "Created message",
  4922. "content": {
  4923. "application/json": {
  4924. "schema": {
  4925. "type": "object",
  4926. "required": ["info", "parts"],
  4927. "properties": {
  4928. "info": {
  4929. "$ref": "#/components/schemas/AssistantMessage"
  4930. },
  4931. "parts": {
  4932. "type": "array",
  4933. "items": {
  4934. "$ref": "#/components/schemas/Part"
  4935. }
  4936. }
  4937. }
  4938. }
  4939. }
  4940. }
  4941. },
  4942. "400": {
  4943. "description": "Bad request",
  4944. "content": {
  4945. "application/json": {
  4946. "schema": {
  4947. "$ref": "#/components/schemas/BadRequestError"
  4948. }
  4949. }
  4950. }
  4951. },
  4952. "404": {
  4953. "description": "Not found",
  4954. "content": {
  4955. "application/json": {
  4956. "schema": {
  4957. "$ref": "#/components/schemas/NotFoundError"
  4958. }
  4959. }
  4960. }
  4961. }
  4962. },
  4963. "description": "Create and send a new message to a session, streaming the AI response.",
  4964. "summary": "Send message",
  4965. "requestBody": {
  4966. "content": {
  4967. "application/json": {
  4968. "schema": {
  4969. "type": "object",
  4970. "properties": {
  4971. "messageID": {
  4972. "type": "string"
  4973. },
  4974. "model": {
  4975. "type": "object",
  4976. "properties": {
  4977. "providerID": {
  4978. "type": "string"
  4979. },
  4980. "modelID": {
  4981. "type": "string"
  4982. }
  4983. },
  4984. "required": ["providerID", "modelID"],
  4985. "additionalProperties": false
  4986. },
  4987. "agent": {
  4988. "type": "string"
  4989. },
  4990. "noReply": {
  4991. "type": "boolean"
  4992. },
  4993. "tools": {
  4994. "type": "object",
  4995. "additionalProperties": {
  4996. "type": "boolean"
  4997. }
  4998. },
  4999. "format": {
  5000. "$ref": "#/components/schemas/OutputFormat"
  5001. },
  5002. "system": {
  5003. "type": "string"
  5004. },
  5005. "variant": {
  5006. "type": "string"
  5007. },
  5008. "parts": {
  5009. "type": "array",
  5010. "items": {
  5011. "anyOf": [
  5012. {
  5013. "$ref": "#/components/schemas/TextPartInput"
  5014. },
  5015. {
  5016. "$ref": "#/components/schemas/FilePartInput"
  5017. },
  5018. {
  5019. "$ref": "#/components/schemas/AgentPartInput"
  5020. },
  5021. {
  5022. "$ref": "#/components/schemas/SubtaskPartInput"
  5023. }
  5024. ]
  5025. }
  5026. }
  5027. },
  5028. "required": ["parts"],
  5029. "additionalProperties": false
  5030. }
  5031. }
  5032. }
  5033. },
  5034. "x-codeSamples": [
  5035. {
  5036. "lang": "js",
  5037. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.prompt({\n ...\n})"
  5038. }
  5039. ]
  5040. }
  5041. },
  5042. "/session/{sessionID}/message/{messageID}": {
  5043. "get": {
  5044. "tags": ["session"],
  5045. "operationId": "session.message",
  5046. "parameters": [
  5047. {
  5048. "name": "directory",
  5049. "in": "query",
  5050. "required": false,
  5051. "schema": {
  5052. "type": "string"
  5053. }
  5054. },
  5055. {
  5056. "name": "workspace",
  5057. "in": "query",
  5058. "required": false,
  5059. "schema": {
  5060. "type": "string"
  5061. }
  5062. },
  5063. {
  5064. "name": "sessionID",
  5065. "in": "path",
  5066. "schema": {
  5067. "type": "string",
  5068. "pattern": "^ses.*"
  5069. },
  5070. "required": true
  5071. },
  5072. {
  5073. "name": "messageID",
  5074. "in": "path",
  5075. "schema": {
  5076. "type": "string",
  5077. "pattern": "^msg.*"
  5078. },
  5079. "required": true
  5080. }
  5081. ],
  5082. "responses": {
  5083. "200": {
  5084. "description": "Message",
  5085. "content": {
  5086. "application/json": {
  5087. "schema": {
  5088. "type": "object",
  5089. "properties": {
  5090. "info": {
  5091. "$ref": "#/components/schemas/Message"
  5092. },
  5093. "parts": {
  5094. "type": "array",
  5095. "items": {
  5096. "$ref": "#/components/schemas/Part"
  5097. }
  5098. }
  5099. },
  5100. "required": ["info", "parts"],
  5101. "additionalProperties": false,
  5102. "description": "Message"
  5103. }
  5104. }
  5105. }
  5106. },
  5107. "400": {
  5108. "description": "Bad request",
  5109. "content": {
  5110. "application/json": {
  5111. "schema": {
  5112. "$ref": "#/components/schemas/BadRequestError"
  5113. }
  5114. }
  5115. }
  5116. },
  5117. "404": {
  5118. "description": "Not found",
  5119. "content": {
  5120. "application/json": {
  5121. "schema": {
  5122. "$ref": "#/components/schemas/NotFoundError"
  5123. }
  5124. }
  5125. }
  5126. }
  5127. },
  5128. "description": "Retrieve a specific message from a session by its message ID.",
  5129. "summary": "Get message",
  5130. "x-codeSamples": [
  5131. {
  5132. "lang": "js",
  5133. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.message({\n ...\n})"
  5134. }
  5135. ]
  5136. },
  5137. "delete": {
  5138. "tags": ["session"],
  5139. "operationId": "session.deleteMessage",
  5140. "parameters": [
  5141. {
  5142. "name": "directory",
  5143. "in": "query",
  5144. "required": false,
  5145. "schema": {
  5146. "type": "string"
  5147. }
  5148. },
  5149. {
  5150. "name": "workspace",
  5151. "in": "query",
  5152. "required": false,
  5153. "schema": {
  5154. "type": "string"
  5155. }
  5156. },
  5157. {
  5158. "name": "sessionID",
  5159. "in": "path",
  5160. "schema": {
  5161. "type": "string",
  5162. "pattern": "^ses.*"
  5163. },
  5164. "required": true
  5165. },
  5166. {
  5167. "name": "messageID",
  5168. "in": "path",
  5169. "schema": {
  5170. "type": "string",
  5171. "pattern": "^msg.*"
  5172. },
  5173. "required": true
  5174. }
  5175. ],
  5176. "responses": {
  5177. "200": {
  5178. "description": "Successfully deleted message",
  5179. "content": {
  5180. "application/json": {
  5181. "schema": {
  5182. "type": "boolean",
  5183. "description": "Successfully deleted message"
  5184. }
  5185. }
  5186. }
  5187. },
  5188. "400": {
  5189. "description": "Bad request",
  5190. "content": {
  5191. "application/json": {
  5192. "schema": {
  5193. "$ref": "#/components/schemas/BadRequestError"
  5194. }
  5195. }
  5196. }
  5197. },
  5198. "404": {
  5199. "description": "Not found",
  5200. "content": {
  5201. "application/json": {
  5202. "schema": {
  5203. "$ref": "#/components/schemas/NotFoundError"
  5204. }
  5205. }
  5206. }
  5207. }
  5208. },
  5209. "description": "Permanently delete a specific message and all of its parts from a session without reverting file changes.",
  5210. "summary": "Delete message",
  5211. "x-codeSamples": [
  5212. {
  5213. "lang": "js",
  5214. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.deleteMessage({\n ...\n})"
  5215. }
  5216. ]
  5217. }
  5218. },
  5219. "/session/{sessionID}/fork": {
  5220. "post": {
  5221. "tags": ["session"],
  5222. "operationId": "session.fork",
  5223. "parameters": [
  5224. {
  5225. "name": "directory",
  5226. "in": "query",
  5227. "required": false,
  5228. "schema": {
  5229. "type": "string"
  5230. }
  5231. },
  5232. {
  5233. "name": "workspace",
  5234. "in": "query",
  5235. "required": false,
  5236. "schema": {
  5237. "type": "string"
  5238. }
  5239. },
  5240. {
  5241. "name": "sessionID",
  5242. "in": "path",
  5243. "schema": {
  5244. "type": "string",
  5245. "pattern": "^ses.*"
  5246. },
  5247. "required": true
  5248. }
  5249. ],
  5250. "responses": {
  5251. "200": {
  5252. "description": "200",
  5253. "content": {
  5254. "application/json": {
  5255. "schema": {
  5256. "$ref": "#/components/schemas/Session"
  5257. }
  5258. }
  5259. }
  5260. }
  5261. },
  5262. "description": "Create a new session by forking an existing session at a specific message point.",
  5263. "summary": "Fork session",
  5264. "requestBody": {
  5265. "content": {
  5266. "application/json": {
  5267. "schema": {
  5268. "type": "object",
  5269. "properties": {
  5270. "messageID": {
  5271. "type": "string"
  5272. }
  5273. },
  5274. "additionalProperties": false
  5275. }
  5276. }
  5277. }
  5278. },
  5279. "x-codeSamples": [
  5280. {
  5281. "lang": "js",
  5282. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.fork({\n ...\n})"
  5283. }
  5284. ]
  5285. }
  5286. },
  5287. "/session/{sessionID}/abort": {
  5288. "post": {
  5289. "tags": ["session"],
  5290. "operationId": "session.abort",
  5291. "parameters": [
  5292. {
  5293. "name": "directory",
  5294. "in": "query",
  5295. "required": false,
  5296. "schema": {
  5297. "type": "string"
  5298. }
  5299. },
  5300. {
  5301. "name": "workspace",
  5302. "in": "query",
  5303. "required": false,
  5304. "schema": {
  5305. "type": "string"
  5306. }
  5307. },
  5308. {
  5309. "name": "sessionID",
  5310. "in": "path",
  5311. "schema": {
  5312. "type": "string",
  5313. "pattern": "^ses.*"
  5314. },
  5315. "required": true
  5316. }
  5317. ],
  5318. "responses": {
  5319. "200": {
  5320. "description": "Aborted session",
  5321. "content": {
  5322. "application/json": {
  5323. "schema": {
  5324. "type": "boolean",
  5325. "description": "Aborted session"
  5326. }
  5327. }
  5328. }
  5329. },
  5330. "400": {
  5331. "description": "Bad request",
  5332. "content": {
  5333. "application/json": {
  5334. "schema": {
  5335. "$ref": "#/components/schemas/BadRequestError"
  5336. }
  5337. }
  5338. }
  5339. },
  5340. "404": {
  5341. "description": "Not found",
  5342. "content": {
  5343. "application/json": {
  5344. "schema": {
  5345. "$ref": "#/components/schemas/NotFoundError"
  5346. }
  5347. }
  5348. }
  5349. }
  5350. },
  5351. "description": "Abort an active session and stop any ongoing AI processing or command execution.",
  5352. "summary": "Abort session",
  5353. "x-codeSamples": [
  5354. {
  5355. "lang": "js",
  5356. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.abort({\n ...\n})"
  5357. }
  5358. ]
  5359. }
  5360. },
  5361. "/session/{sessionID}/init": {
  5362. "post": {
  5363. "tags": ["session"],
  5364. "operationId": "session.init",
  5365. "parameters": [
  5366. {
  5367. "name": "directory",
  5368. "in": "query",
  5369. "required": false,
  5370. "schema": {
  5371. "type": "string"
  5372. }
  5373. },
  5374. {
  5375. "name": "workspace",
  5376. "in": "query",
  5377. "required": false,
  5378. "schema": {
  5379. "type": "string"
  5380. }
  5381. },
  5382. {
  5383. "name": "sessionID",
  5384. "in": "path",
  5385. "schema": {
  5386. "type": "string",
  5387. "pattern": "^ses.*"
  5388. },
  5389. "required": true
  5390. }
  5391. ],
  5392. "responses": {
  5393. "200": {
  5394. "description": "200",
  5395. "content": {
  5396. "application/json": {
  5397. "schema": {
  5398. "type": "boolean",
  5399. "description": "200"
  5400. }
  5401. }
  5402. }
  5403. },
  5404. "400": {
  5405. "description": "Bad request",
  5406. "content": {
  5407. "application/json": {
  5408. "schema": {
  5409. "$ref": "#/components/schemas/BadRequestError"
  5410. }
  5411. }
  5412. }
  5413. },
  5414. "404": {
  5415. "description": "Not found",
  5416. "content": {
  5417. "application/json": {
  5418. "schema": {
  5419. "$ref": "#/components/schemas/NotFoundError"
  5420. }
  5421. }
  5422. }
  5423. }
  5424. },
  5425. "description": "Analyze the current application and create an AGENTS.md file with project-specific agent configurations.",
  5426. "summary": "Initialize session",
  5427. "requestBody": {
  5428. "content": {
  5429. "application/json": {
  5430. "schema": {
  5431. "type": "object",
  5432. "properties": {
  5433. "modelID": {
  5434. "type": "string"
  5435. },
  5436. "providerID": {
  5437. "type": "string"
  5438. },
  5439. "messageID": {
  5440. "type": "string"
  5441. }
  5442. },
  5443. "required": ["modelID", "providerID", "messageID"],
  5444. "additionalProperties": false
  5445. }
  5446. }
  5447. }
  5448. },
  5449. "x-codeSamples": [
  5450. {
  5451. "lang": "js",
  5452. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.init({\n ...\n})"
  5453. }
  5454. ]
  5455. }
  5456. },
  5457. "/session/{sessionID}/share": {
  5458. "post": {
  5459. "tags": ["session"],
  5460. "operationId": "session.share",
  5461. "parameters": [
  5462. {
  5463. "name": "directory",
  5464. "in": "query",
  5465. "required": false,
  5466. "schema": {
  5467. "type": "string"
  5468. }
  5469. },
  5470. {
  5471. "name": "workspace",
  5472. "in": "query",
  5473. "required": false,
  5474. "schema": {
  5475. "type": "string"
  5476. }
  5477. },
  5478. {
  5479. "name": "sessionID",
  5480. "in": "path",
  5481. "schema": {
  5482. "type": "string",
  5483. "pattern": "^ses.*"
  5484. },
  5485. "required": true
  5486. }
  5487. ],
  5488. "responses": {
  5489. "200": {
  5490. "description": "Successfully shared session",
  5491. "content": {
  5492. "application/json": {
  5493. "schema": {
  5494. "$ref": "#/components/schemas/Session"
  5495. }
  5496. }
  5497. }
  5498. },
  5499. "400": {
  5500. "description": "Bad request",
  5501. "content": {
  5502. "application/json": {
  5503. "schema": {
  5504. "$ref": "#/components/schemas/BadRequestError"
  5505. }
  5506. }
  5507. }
  5508. },
  5509. "404": {
  5510. "description": "Not found",
  5511. "content": {
  5512. "application/json": {
  5513. "schema": {
  5514. "$ref": "#/components/schemas/NotFoundError"
  5515. }
  5516. }
  5517. }
  5518. }
  5519. },
  5520. "description": "Create a shareable link for a session, allowing others to view the conversation.",
  5521. "summary": "Share session",
  5522. "x-codeSamples": [
  5523. {
  5524. "lang": "js",
  5525. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.share({\n ...\n})"
  5526. }
  5527. ]
  5528. },
  5529. "delete": {
  5530. "tags": ["session"],
  5531. "operationId": "session.unshare",
  5532. "parameters": [
  5533. {
  5534. "name": "directory",
  5535. "in": "query",
  5536. "required": false,
  5537. "schema": {
  5538. "type": "string"
  5539. }
  5540. },
  5541. {
  5542. "name": "workspace",
  5543. "in": "query",
  5544. "required": false,
  5545. "schema": {
  5546. "type": "string"
  5547. }
  5548. },
  5549. {
  5550. "name": "sessionID",
  5551. "in": "path",
  5552. "schema": {
  5553. "type": "string",
  5554. "pattern": "^ses.*"
  5555. },
  5556. "required": true
  5557. }
  5558. ],
  5559. "responses": {
  5560. "200": {
  5561. "description": "Successfully unshared session",
  5562. "content": {
  5563. "application/json": {
  5564. "schema": {
  5565. "$ref": "#/components/schemas/Session"
  5566. }
  5567. }
  5568. }
  5569. },
  5570. "400": {
  5571. "description": "Bad request",
  5572. "content": {
  5573. "application/json": {
  5574. "schema": {
  5575. "$ref": "#/components/schemas/BadRequestError"
  5576. }
  5577. }
  5578. }
  5579. },
  5580. "404": {
  5581. "description": "Not found",
  5582. "content": {
  5583. "application/json": {
  5584. "schema": {
  5585. "$ref": "#/components/schemas/NotFoundError"
  5586. }
  5587. }
  5588. }
  5589. }
  5590. },
  5591. "description": "Remove the shareable link for a session, making it private again.",
  5592. "summary": "Unshare session",
  5593. "x-codeSamples": [
  5594. {
  5595. "lang": "js",
  5596. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.unshare({\n ...\n})"
  5597. }
  5598. ]
  5599. }
  5600. },
  5601. "/session/{sessionID}/summarize": {
  5602. "post": {
  5603. "tags": ["session"],
  5604. "operationId": "session.summarize",
  5605. "parameters": [
  5606. {
  5607. "name": "directory",
  5608. "in": "query",
  5609. "required": false,
  5610. "schema": {
  5611. "type": "string"
  5612. }
  5613. },
  5614. {
  5615. "name": "workspace",
  5616. "in": "query",
  5617. "required": false,
  5618. "schema": {
  5619. "type": "string"
  5620. }
  5621. },
  5622. {
  5623. "name": "sessionID",
  5624. "in": "path",
  5625. "schema": {
  5626. "type": "string",
  5627. "pattern": "^ses.*"
  5628. },
  5629. "required": true
  5630. }
  5631. ],
  5632. "responses": {
  5633. "200": {
  5634. "description": "Summarized session",
  5635. "content": {
  5636. "application/json": {
  5637. "schema": {
  5638. "type": "boolean",
  5639. "description": "Summarized session"
  5640. }
  5641. }
  5642. }
  5643. },
  5644. "400": {
  5645. "description": "Bad request",
  5646. "content": {
  5647. "application/json": {
  5648. "schema": {
  5649. "$ref": "#/components/schemas/BadRequestError"
  5650. }
  5651. }
  5652. }
  5653. },
  5654. "404": {
  5655. "description": "Not found",
  5656. "content": {
  5657. "application/json": {
  5658. "schema": {
  5659. "$ref": "#/components/schemas/NotFoundError"
  5660. }
  5661. }
  5662. }
  5663. }
  5664. },
  5665. "description": "Generate a concise summary of the session using AI compaction to preserve key information.",
  5666. "summary": "Summarize session",
  5667. "requestBody": {
  5668. "content": {
  5669. "application/json": {
  5670. "schema": {
  5671. "type": "object",
  5672. "properties": {
  5673. "providerID": {
  5674. "type": "string"
  5675. },
  5676. "modelID": {
  5677. "type": "string"
  5678. },
  5679. "auto": {
  5680. "type": "boolean"
  5681. }
  5682. },
  5683. "required": ["providerID", "modelID"],
  5684. "additionalProperties": false
  5685. }
  5686. }
  5687. }
  5688. },
  5689. "x-codeSamples": [
  5690. {
  5691. "lang": "js",
  5692. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.summarize({\n ...\n})"
  5693. }
  5694. ]
  5695. }
  5696. },
  5697. "/session/{sessionID}/prompt_async": {
  5698. "post": {
  5699. "tags": ["session"],
  5700. "operationId": "session.prompt_async",
  5701. "parameters": [
  5702. {
  5703. "name": "directory",
  5704. "in": "query",
  5705. "required": false,
  5706. "schema": {
  5707. "type": "string"
  5708. }
  5709. },
  5710. {
  5711. "name": "workspace",
  5712. "in": "query",
  5713. "required": false,
  5714. "schema": {
  5715. "type": "string"
  5716. }
  5717. },
  5718. {
  5719. "name": "sessionID",
  5720. "in": "path",
  5721. "schema": {
  5722. "type": "string",
  5723. "pattern": "^ses.*"
  5724. },
  5725. "required": true
  5726. }
  5727. ],
  5728. "responses": {
  5729. "204": {
  5730. "description": "Prompt accepted"
  5731. },
  5732. "400": {
  5733. "description": "Bad request",
  5734. "content": {
  5735. "application/json": {
  5736. "schema": {
  5737. "$ref": "#/components/schemas/BadRequestError"
  5738. }
  5739. }
  5740. }
  5741. },
  5742. "404": {
  5743. "description": "Not found",
  5744. "content": {
  5745. "application/json": {
  5746. "schema": {
  5747. "$ref": "#/components/schemas/NotFoundError"
  5748. }
  5749. }
  5750. }
  5751. }
  5752. },
  5753. "description": "Create and send a new message to a session asynchronously, starting the session if needed and returning immediately.",
  5754. "summary": "Send async message",
  5755. "requestBody": {
  5756. "content": {
  5757. "application/json": {
  5758. "schema": {
  5759. "type": "object",
  5760. "properties": {
  5761. "messageID": {
  5762. "type": "string"
  5763. },
  5764. "model": {
  5765. "type": "object",
  5766. "properties": {
  5767. "providerID": {
  5768. "type": "string"
  5769. },
  5770. "modelID": {
  5771. "type": "string"
  5772. }
  5773. },
  5774. "required": ["providerID", "modelID"],
  5775. "additionalProperties": false
  5776. },
  5777. "agent": {
  5778. "type": "string"
  5779. },
  5780. "noReply": {
  5781. "type": "boolean"
  5782. },
  5783. "tools": {
  5784. "type": "object",
  5785. "additionalProperties": {
  5786. "type": "boolean"
  5787. }
  5788. },
  5789. "format": {
  5790. "$ref": "#/components/schemas/OutputFormat"
  5791. },
  5792. "system": {
  5793. "type": "string"
  5794. },
  5795. "variant": {
  5796. "type": "string"
  5797. },
  5798. "parts": {
  5799. "type": "array",
  5800. "items": {
  5801. "anyOf": [
  5802. {
  5803. "$ref": "#/components/schemas/TextPartInput"
  5804. },
  5805. {
  5806. "$ref": "#/components/schemas/FilePartInput"
  5807. },
  5808. {
  5809. "$ref": "#/components/schemas/AgentPartInput"
  5810. },
  5811. {
  5812. "$ref": "#/components/schemas/SubtaskPartInput"
  5813. }
  5814. ]
  5815. }
  5816. }
  5817. },
  5818. "required": ["parts"],
  5819. "additionalProperties": false
  5820. }
  5821. }
  5822. }
  5823. },
  5824. "x-codeSamples": [
  5825. {
  5826. "lang": "js",
  5827. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.prompt_async({\n ...\n})"
  5828. }
  5829. ]
  5830. }
  5831. },
  5832. "/session/{sessionID}/command": {
  5833. "post": {
  5834. "tags": ["session"],
  5835. "operationId": "session.command",
  5836. "parameters": [
  5837. {
  5838. "name": "directory",
  5839. "in": "query",
  5840. "required": false,
  5841. "schema": {
  5842. "type": "string"
  5843. }
  5844. },
  5845. {
  5846. "name": "workspace",
  5847. "in": "query",
  5848. "required": false,
  5849. "schema": {
  5850. "type": "string"
  5851. }
  5852. },
  5853. {
  5854. "name": "sessionID",
  5855. "in": "path",
  5856. "schema": {
  5857. "type": "string",
  5858. "pattern": "^ses.*"
  5859. },
  5860. "required": true
  5861. }
  5862. ],
  5863. "responses": {
  5864. "200": {
  5865. "description": "Created message",
  5866. "content": {
  5867. "application/json": {
  5868. "schema": {
  5869. "type": "object",
  5870. "required": ["info", "parts"],
  5871. "properties": {
  5872. "info": {
  5873. "$ref": "#/components/schemas/AssistantMessage"
  5874. },
  5875. "parts": {
  5876. "type": "array",
  5877. "items": {
  5878. "$ref": "#/components/schemas/Part"
  5879. }
  5880. }
  5881. }
  5882. }
  5883. }
  5884. }
  5885. },
  5886. "400": {
  5887. "description": "Bad request",
  5888. "content": {
  5889. "application/json": {
  5890. "schema": {
  5891. "$ref": "#/components/schemas/BadRequestError"
  5892. }
  5893. }
  5894. }
  5895. },
  5896. "404": {
  5897. "description": "Not found",
  5898. "content": {
  5899. "application/json": {
  5900. "schema": {
  5901. "$ref": "#/components/schemas/NotFoundError"
  5902. }
  5903. }
  5904. }
  5905. }
  5906. },
  5907. "description": "Send a new command to a session for execution by the AI assistant.",
  5908. "summary": "Send command",
  5909. "requestBody": {
  5910. "content": {
  5911. "application/json": {
  5912. "schema": {
  5913. "type": "object",
  5914. "properties": {
  5915. "messageID": {
  5916. "type": "string"
  5917. },
  5918. "agent": {
  5919. "type": "string"
  5920. },
  5921. "model": {
  5922. "type": "string"
  5923. },
  5924. "arguments": {
  5925. "type": "string"
  5926. },
  5927. "command": {
  5928. "type": "string"
  5929. },
  5930. "variant": {
  5931. "type": "string"
  5932. },
  5933. "parts": {
  5934. "type": "array",
  5935. "items": {
  5936. "type": "object",
  5937. "properties": {
  5938. "id": {
  5939. "type": "string"
  5940. },
  5941. "type": {
  5942. "type": "string",
  5943. "enum": ["file"]
  5944. },
  5945. "mime": {
  5946. "type": "string"
  5947. },
  5948. "filename": {
  5949. "type": "string"
  5950. },
  5951. "url": {
  5952. "type": "string"
  5953. },
  5954. "source": {
  5955. "$ref": "#/components/schemas/FilePartSource"
  5956. }
  5957. },
  5958. "required": ["type", "mime", "url"],
  5959. "additionalProperties": false
  5960. }
  5961. }
  5962. },
  5963. "required": ["arguments", "command"],
  5964. "additionalProperties": false
  5965. }
  5966. }
  5967. }
  5968. },
  5969. "x-codeSamples": [
  5970. {
  5971. "lang": "js",
  5972. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.command({\n ...\n})"
  5973. }
  5974. ]
  5975. }
  5976. },
  5977. "/session/{sessionID}/shell": {
  5978. "post": {
  5979. "tags": ["session"],
  5980. "operationId": "session.shell",
  5981. "parameters": [
  5982. {
  5983. "name": "directory",
  5984. "in": "query",
  5985. "required": false,
  5986. "schema": {
  5987. "type": "string"
  5988. }
  5989. },
  5990. {
  5991. "name": "workspace",
  5992. "in": "query",
  5993. "required": false,
  5994. "schema": {
  5995. "type": "string"
  5996. }
  5997. },
  5998. {
  5999. "name": "sessionID",
  6000. "in": "path",
  6001. "schema": {
  6002. "type": "string",
  6003. "pattern": "^ses.*"
  6004. },
  6005. "required": true
  6006. }
  6007. ],
  6008. "responses": {
  6009. "200": {
  6010. "description": "Created message",
  6011. "content": {
  6012. "application/json": {
  6013. "schema": {
  6014. "type": "object",
  6015. "properties": {
  6016. "info": {
  6017. "$ref": "#/components/schemas/Message"
  6018. },
  6019. "parts": {
  6020. "type": "array",
  6021. "items": {
  6022. "$ref": "#/components/schemas/Part"
  6023. }
  6024. }
  6025. },
  6026. "required": ["info", "parts"],
  6027. "additionalProperties": false,
  6028. "description": "Created message"
  6029. }
  6030. }
  6031. }
  6032. },
  6033. "400": {
  6034. "description": "Bad request",
  6035. "content": {
  6036. "application/json": {
  6037. "schema": {
  6038. "$ref": "#/components/schemas/BadRequestError"
  6039. }
  6040. }
  6041. }
  6042. },
  6043. "404": {
  6044. "description": "Not found",
  6045. "content": {
  6046. "application/json": {
  6047. "schema": {
  6048. "$ref": "#/components/schemas/NotFoundError"
  6049. }
  6050. }
  6051. }
  6052. }
  6053. },
  6054. "description": "Execute a shell command within the session context and return the AI's response.",
  6055. "summary": "Run shell command",
  6056. "requestBody": {
  6057. "content": {
  6058. "application/json": {
  6059. "schema": {
  6060. "type": "object",
  6061. "properties": {
  6062. "messageID": {
  6063. "type": "string"
  6064. },
  6065. "agent": {
  6066. "type": "string"
  6067. },
  6068. "model": {
  6069. "type": "object",
  6070. "properties": {
  6071. "providerID": {
  6072. "type": "string"
  6073. },
  6074. "modelID": {
  6075. "type": "string"
  6076. }
  6077. },
  6078. "required": ["providerID", "modelID"],
  6079. "additionalProperties": false
  6080. },
  6081. "command": {
  6082. "type": "string"
  6083. }
  6084. },
  6085. "required": ["agent", "command"],
  6086. "additionalProperties": false
  6087. }
  6088. }
  6089. }
  6090. },
  6091. "x-codeSamples": [
  6092. {
  6093. "lang": "js",
  6094. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.shell({\n ...\n})"
  6095. }
  6096. ]
  6097. }
  6098. },
  6099. "/session/{sessionID}/revert": {
  6100. "post": {
  6101. "tags": ["session"],
  6102. "operationId": "session.revert",
  6103. "parameters": [
  6104. {
  6105. "name": "directory",
  6106. "in": "query",
  6107. "required": false,
  6108. "schema": {
  6109. "type": "string"
  6110. }
  6111. },
  6112. {
  6113. "name": "workspace",
  6114. "in": "query",
  6115. "required": false,
  6116. "schema": {
  6117. "type": "string"
  6118. }
  6119. },
  6120. {
  6121. "name": "sessionID",
  6122. "in": "path",
  6123. "schema": {
  6124. "type": "string",
  6125. "pattern": "^ses.*"
  6126. },
  6127. "required": true
  6128. }
  6129. ],
  6130. "responses": {
  6131. "200": {
  6132. "description": "Updated session",
  6133. "content": {
  6134. "application/json": {
  6135. "schema": {
  6136. "$ref": "#/components/schemas/Session"
  6137. }
  6138. }
  6139. }
  6140. },
  6141. "400": {
  6142. "description": "Bad request",
  6143. "content": {
  6144. "application/json": {
  6145. "schema": {
  6146. "$ref": "#/components/schemas/BadRequestError"
  6147. }
  6148. }
  6149. }
  6150. },
  6151. "404": {
  6152. "description": "Not found",
  6153. "content": {
  6154. "application/json": {
  6155. "schema": {
  6156. "$ref": "#/components/schemas/NotFoundError"
  6157. }
  6158. }
  6159. }
  6160. }
  6161. },
  6162. "description": "Revert a specific message in a session, undoing its effects and restoring the previous state.",
  6163. "summary": "Revert message",
  6164. "requestBody": {
  6165. "content": {
  6166. "application/json": {
  6167. "schema": {
  6168. "type": "object",
  6169. "properties": {
  6170. "messageID": {
  6171. "type": "string"
  6172. },
  6173. "partID": {
  6174. "type": "string"
  6175. }
  6176. },
  6177. "required": ["messageID"],
  6178. "additionalProperties": false
  6179. }
  6180. }
  6181. }
  6182. },
  6183. "x-codeSamples": [
  6184. {
  6185. "lang": "js",
  6186. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.revert({\n ...\n})"
  6187. }
  6188. ]
  6189. }
  6190. },
  6191. "/session/{sessionID}/unrevert": {
  6192. "post": {
  6193. "tags": ["session"],
  6194. "operationId": "session.unrevert",
  6195. "parameters": [
  6196. {
  6197. "name": "directory",
  6198. "in": "query",
  6199. "required": false,
  6200. "schema": {
  6201. "type": "string"
  6202. }
  6203. },
  6204. {
  6205. "name": "workspace",
  6206. "in": "query",
  6207. "required": false,
  6208. "schema": {
  6209. "type": "string"
  6210. }
  6211. },
  6212. {
  6213. "name": "sessionID",
  6214. "in": "path",
  6215. "schema": {
  6216. "type": "string",
  6217. "pattern": "^ses.*"
  6218. },
  6219. "required": true
  6220. }
  6221. ],
  6222. "responses": {
  6223. "200": {
  6224. "description": "Updated session",
  6225. "content": {
  6226. "application/json": {
  6227. "schema": {
  6228. "$ref": "#/components/schemas/Session"
  6229. }
  6230. }
  6231. }
  6232. },
  6233. "400": {
  6234. "description": "Bad request",
  6235. "content": {
  6236. "application/json": {
  6237. "schema": {
  6238. "$ref": "#/components/schemas/BadRequestError"
  6239. }
  6240. }
  6241. }
  6242. },
  6243. "404": {
  6244. "description": "Not found",
  6245. "content": {
  6246. "application/json": {
  6247. "schema": {
  6248. "$ref": "#/components/schemas/NotFoundError"
  6249. }
  6250. }
  6251. }
  6252. }
  6253. },
  6254. "description": "Restore all previously reverted messages in a session.",
  6255. "summary": "Restore reverted messages",
  6256. "x-codeSamples": [
  6257. {
  6258. "lang": "js",
  6259. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.unrevert({\n ...\n})"
  6260. }
  6261. ]
  6262. }
  6263. },
  6264. "/session/{sessionID}/permissions/{permissionID}": {
  6265. "post": {
  6266. "tags": ["session"],
  6267. "operationId": "permission.respond",
  6268. "parameters": [
  6269. {
  6270. "name": "directory",
  6271. "in": "query",
  6272. "required": false,
  6273. "schema": {
  6274. "type": "string"
  6275. }
  6276. },
  6277. {
  6278. "name": "workspace",
  6279. "in": "query",
  6280. "required": false,
  6281. "schema": {
  6282. "type": "string"
  6283. }
  6284. },
  6285. {
  6286. "name": "sessionID",
  6287. "in": "path",
  6288. "schema": {
  6289. "type": "string",
  6290. "pattern": "^ses.*"
  6291. },
  6292. "required": true
  6293. },
  6294. {
  6295. "name": "permissionID",
  6296. "in": "path",
  6297. "schema": {
  6298. "type": "string",
  6299. "pattern": "^per.*"
  6300. },
  6301. "required": true
  6302. }
  6303. ],
  6304. "responses": {
  6305. "200": {
  6306. "description": "Permission processed successfully",
  6307. "content": {
  6308. "application/json": {
  6309. "schema": {
  6310. "type": "boolean",
  6311. "description": "Permission processed successfully"
  6312. }
  6313. }
  6314. }
  6315. },
  6316. "400": {
  6317. "description": "Bad request",
  6318. "content": {
  6319. "application/json": {
  6320. "schema": {
  6321. "$ref": "#/components/schemas/BadRequestError"
  6322. }
  6323. }
  6324. }
  6325. },
  6326. "404": {
  6327. "description": "Not found",
  6328. "content": {
  6329. "application/json": {
  6330. "schema": {
  6331. "$ref": "#/components/schemas/NotFoundError"
  6332. }
  6333. }
  6334. }
  6335. }
  6336. },
  6337. "description": "Approve or deny a permission request from the AI assistant.",
  6338. "summary": "Respond to permission",
  6339. "deprecated": true,
  6340. "requestBody": {
  6341. "content": {
  6342. "application/json": {
  6343. "schema": {
  6344. "type": "object",
  6345. "properties": {
  6346. "response": {
  6347. "type": "string",
  6348. "enum": ["once", "always", "reject"]
  6349. }
  6350. },
  6351. "required": ["response"],
  6352. "additionalProperties": false
  6353. }
  6354. }
  6355. }
  6356. },
  6357. "x-codeSamples": [
  6358. {
  6359. "lang": "js",
  6360. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.permission.respond({\n ...\n})"
  6361. }
  6362. ]
  6363. }
  6364. },
  6365. "/session/{sessionID}/message/{messageID}/part/{partID}": {
  6366. "delete": {
  6367. "tags": ["session"],
  6368. "operationId": "part.delete",
  6369. "parameters": [
  6370. {
  6371. "name": "directory",
  6372. "in": "query",
  6373. "required": false,
  6374. "schema": {
  6375. "type": "string"
  6376. }
  6377. },
  6378. {
  6379. "name": "workspace",
  6380. "in": "query",
  6381. "required": false,
  6382. "schema": {
  6383. "type": "string"
  6384. }
  6385. },
  6386. {
  6387. "name": "sessionID",
  6388. "in": "path",
  6389. "schema": {
  6390. "type": "string",
  6391. "pattern": "^ses.*"
  6392. },
  6393. "required": true
  6394. },
  6395. {
  6396. "name": "messageID",
  6397. "in": "path",
  6398. "schema": {
  6399. "type": "string",
  6400. "pattern": "^msg.*"
  6401. },
  6402. "required": true
  6403. },
  6404. {
  6405. "name": "partID",
  6406. "in": "path",
  6407. "schema": {
  6408. "type": "string",
  6409. "pattern": "^prt.*"
  6410. },
  6411. "required": true
  6412. }
  6413. ],
  6414. "responses": {
  6415. "200": {
  6416. "description": "Successfully deleted part",
  6417. "content": {
  6418. "application/json": {
  6419. "schema": {
  6420. "type": "boolean",
  6421. "description": "Successfully deleted part"
  6422. }
  6423. }
  6424. }
  6425. },
  6426. "400": {
  6427. "description": "Bad request",
  6428. "content": {
  6429. "application/json": {
  6430. "schema": {
  6431. "$ref": "#/components/schemas/BadRequestError"
  6432. }
  6433. }
  6434. }
  6435. },
  6436. "404": {
  6437. "description": "Not found",
  6438. "content": {
  6439. "application/json": {
  6440. "schema": {
  6441. "$ref": "#/components/schemas/NotFoundError"
  6442. }
  6443. }
  6444. }
  6445. }
  6446. },
  6447. "description": "Delete a part from a message.",
  6448. "x-codeSamples": [
  6449. {
  6450. "lang": "js",
  6451. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.part.delete({\n ...\n})"
  6452. }
  6453. ]
  6454. },
  6455. "patch": {
  6456. "tags": ["session"],
  6457. "operationId": "part.update",
  6458. "parameters": [
  6459. {
  6460. "name": "directory",
  6461. "in": "query",
  6462. "required": false,
  6463. "schema": {
  6464. "type": "string"
  6465. }
  6466. },
  6467. {
  6468. "name": "workspace",
  6469. "in": "query",
  6470. "required": false,
  6471. "schema": {
  6472. "type": "string"
  6473. }
  6474. },
  6475. {
  6476. "name": "sessionID",
  6477. "in": "path",
  6478. "schema": {
  6479. "type": "string",
  6480. "pattern": "^ses.*"
  6481. },
  6482. "required": true
  6483. },
  6484. {
  6485. "name": "messageID",
  6486. "in": "path",
  6487. "schema": {
  6488. "type": "string",
  6489. "pattern": "^msg.*"
  6490. },
  6491. "required": true
  6492. },
  6493. {
  6494. "name": "partID",
  6495. "in": "path",
  6496. "schema": {
  6497. "type": "string",
  6498. "pattern": "^prt.*"
  6499. },
  6500. "required": true
  6501. }
  6502. ],
  6503. "responses": {
  6504. "200": {
  6505. "description": "Successfully updated part",
  6506. "content": {
  6507. "application/json": {
  6508. "schema": {
  6509. "$ref": "#/components/schemas/Part"
  6510. }
  6511. }
  6512. }
  6513. },
  6514. "400": {
  6515. "description": "Bad request",
  6516. "content": {
  6517. "application/json": {
  6518. "schema": {
  6519. "$ref": "#/components/schemas/BadRequestError"
  6520. }
  6521. }
  6522. }
  6523. },
  6524. "404": {
  6525. "description": "Not found",
  6526. "content": {
  6527. "application/json": {
  6528. "schema": {
  6529. "$ref": "#/components/schemas/NotFoundError"
  6530. }
  6531. }
  6532. }
  6533. }
  6534. },
  6535. "description": "Update a part in a message.",
  6536. "requestBody": {
  6537. "content": {
  6538. "application/json": {
  6539. "schema": {
  6540. "$ref": "#/components/schemas/Part"
  6541. }
  6542. }
  6543. }
  6544. },
  6545. "x-codeSamples": [
  6546. {
  6547. "lang": "js",
  6548. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.part.update({\n ...\n})"
  6549. }
  6550. ]
  6551. }
  6552. },
  6553. "/sync/start": {
  6554. "post": {
  6555. "tags": ["sync"],
  6556. "operationId": "sync.start",
  6557. "parameters": [
  6558. {
  6559. "name": "directory",
  6560. "in": "query",
  6561. "required": false,
  6562. "schema": {
  6563. "type": "string"
  6564. }
  6565. },
  6566. {
  6567. "name": "workspace",
  6568. "in": "query",
  6569. "required": false,
  6570. "schema": {
  6571. "type": "string"
  6572. }
  6573. }
  6574. ],
  6575. "responses": {
  6576. "200": {
  6577. "description": "Workspace sync started",
  6578. "content": {
  6579. "application/json": {
  6580. "schema": {
  6581. "type": "boolean",
  6582. "description": "Workspace sync started"
  6583. }
  6584. }
  6585. }
  6586. }
  6587. },
  6588. "description": "Start sync loops for workspaces in the current project that have active sessions.",
  6589. "summary": "Start workspace sync",
  6590. "x-codeSamples": [
  6591. {
  6592. "lang": "js",
  6593. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.sync.start({\n ...\n})"
  6594. }
  6595. ]
  6596. }
  6597. },
  6598. "/sync/replay": {
  6599. "post": {
  6600. "tags": ["sync"],
  6601. "operationId": "sync.replay",
  6602. "parameters": [
  6603. {
  6604. "name": "directory",
  6605. "in": "query",
  6606. "required": false,
  6607. "schema": {
  6608. "type": "string"
  6609. }
  6610. },
  6611. {
  6612. "name": "workspace",
  6613. "in": "query",
  6614. "required": false,
  6615. "schema": {
  6616. "type": "string"
  6617. }
  6618. }
  6619. ],
  6620. "responses": {
  6621. "200": {
  6622. "description": "Replayed sync events",
  6623. "content": {
  6624. "application/json": {
  6625. "schema": {
  6626. "type": "object",
  6627. "properties": {
  6628. "sessionID": {
  6629. "type": "string"
  6630. }
  6631. },
  6632. "required": ["sessionID"],
  6633. "additionalProperties": false,
  6634. "description": "Replayed sync events"
  6635. }
  6636. }
  6637. }
  6638. },
  6639. "400": {
  6640. "description": "Bad request",
  6641. "content": {
  6642. "application/json": {
  6643. "schema": {
  6644. "$ref": "#/components/schemas/BadRequestError"
  6645. }
  6646. }
  6647. }
  6648. }
  6649. },
  6650. "description": "Validate and replay a complete sync event history.",
  6651. "summary": "Replay sync events",
  6652. "requestBody": {
  6653. "content": {
  6654. "application/json": {
  6655. "schema": {
  6656. "type": "object",
  6657. "properties": {
  6658. "directory": {
  6659. "type": "string"
  6660. },
  6661. "events": {
  6662. "type": "array",
  6663. "minItems": 1,
  6664. "items": {
  6665. "type": "object",
  6666. "properties": {
  6667. "id": {
  6668. "type": "string"
  6669. },
  6670. "aggregateID": {
  6671. "type": "string"
  6672. },
  6673. "seq": {
  6674. "type": "integer",
  6675. "minimum": 0
  6676. },
  6677. "type": {
  6678. "type": "string"
  6679. },
  6680. "data": {
  6681. "type": "object"
  6682. }
  6683. },
  6684. "required": ["id", "aggregateID", "seq", "type", "data"],
  6685. "additionalProperties": false
  6686. }
  6687. }
  6688. },
  6689. "required": ["directory", "events"],
  6690. "additionalProperties": false
  6691. }
  6692. }
  6693. }
  6694. },
  6695. "x-codeSamples": [
  6696. {
  6697. "lang": "js",
  6698. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.sync.replay({\n ...\n})"
  6699. }
  6700. ]
  6701. }
  6702. },
  6703. "/sync/history": {
  6704. "post": {
  6705. "tags": ["sync"],
  6706. "operationId": "sync.history.list",
  6707. "parameters": [
  6708. {
  6709. "name": "directory",
  6710. "in": "query",
  6711. "required": false,
  6712. "schema": {
  6713. "type": "string"
  6714. }
  6715. },
  6716. {
  6717. "name": "workspace",
  6718. "in": "query",
  6719. "required": false,
  6720. "schema": {
  6721. "type": "string"
  6722. }
  6723. }
  6724. ],
  6725. "responses": {
  6726. "200": {
  6727. "description": "Sync events",
  6728. "content": {
  6729. "application/json": {
  6730. "schema": {
  6731. "type": "array",
  6732. "items": {
  6733. "type": "object",
  6734. "properties": {
  6735. "id": {
  6736. "type": "string"
  6737. },
  6738. "aggregate_id": {
  6739. "type": "string"
  6740. },
  6741. "seq": {
  6742. "type": "integer",
  6743. "minimum": 0
  6744. },
  6745. "type": {
  6746. "type": "string"
  6747. },
  6748. "data": {
  6749. "type": "object"
  6750. }
  6751. },
  6752. "required": ["id", "aggregate_id", "seq", "type", "data"],
  6753. "additionalProperties": false
  6754. },
  6755. "description": "Sync events"
  6756. }
  6757. }
  6758. }
  6759. },
  6760. "400": {
  6761. "description": "Bad request",
  6762. "content": {
  6763. "application/json": {
  6764. "schema": {
  6765. "$ref": "#/components/schemas/BadRequestError"
  6766. }
  6767. }
  6768. }
  6769. }
  6770. },
  6771. "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.",
  6772. "summary": "List sync events",
  6773. "requestBody": {
  6774. "content": {
  6775. "application/json": {
  6776. "schema": {
  6777. "type": "object",
  6778. "additionalProperties": {
  6779. "type": "integer",
  6780. "minimum": 0
  6781. }
  6782. }
  6783. }
  6784. }
  6785. },
  6786. "x-codeSamples": [
  6787. {
  6788. "lang": "js",
  6789. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.sync.history.list({\n ...\n})"
  6790. }
  6791. ]
  6792. }
  6793. },
  6794. "/api/session": {
  6795. "get": {
  6796. "tags": ["v2"],
  6797. "operationId": "v2.session.list",
  6798. "parameters": [
  6799. {
  6800. "name": "directory",
  6801. "in": "query",
  6802. "required": false,
  6803. "schema": {
  6804. "type": "string"
  6805. }
  6806. },
  6807. {
  6808. "name": "workspace",
  6809. "in": "query",
  6810. "required": false,
  6811. "schema": {
  6812. "type": "string"
  6813. }
  6814. }
  6815. ],
  6816. "responses": {
  6817. "200": {
  6818. "description": "V2SessionsResponse",
  6819. "content": {
  6820. "application/json": {
  6821. "schema": {
  6822. "$ref": "#/components/schemas/V2SessionsResponse"
  6823. }
  6824. }
  6825. }
  6826. },
  6827. "400": {
  6828. "description": "Bad request",
  6829. "content": {
  6830. "application/json": {
  6831. "schema": {
  6832. "$ref": "#/components/schemas/BadRequestError"
  6833. }
  6834. }
  6835. }
  6836. }
  6837. },
  6838. "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.",
  6839. "summary": "List v2 sessions",
  6840. "x-codeSamples": [
  6841. {
  6842. "lang": "js",
  6843. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.list({\n ...\n})"
  6844. }
  6845. ]
  6846. }
  6847. },
  6848. "/api/session/{sessionID}/prompt": {
  6849. "post": {
  6850. "tags": ["v2"],
  6851. "operationId": "v2.session.prompt",
  6852. "parameters": [
  6853. {
  6854. "name": "directory",
  6855. "in": "query",
  6856. "required": false,
  6857. "schema": {
  6858. "type": "string"
  6859. }
  6860. },
  6861. {
  6862. "name": "workspace",
  6863. "in": "query",
  6864. "required": false,
  6865. "schema": {
  6866. "type": "string"
  6867. }
  6868. },
  6869. {
  6870. "name": "sessionID",
  6871. "in": "path",
  6872. "schema": {
  6873. "type": "string",
  6874. "pattern": "^ses.*"
  6875. },
  6876. "required": true
  6877. }
  6878. ],
  6879. "responses": {
  6880. "200": {
  6881. "description": "Session.Message",
  6882. "content": {
  6883. "application/json": {
  6884. "schema": {
  6885. "$ref": "#/components/schemas/SessionMessage"
  6886. }
  6887. }
  6888. }
  6889. }
  6890. },
  6891. "description": "Create a v2 session message and queue it for the agent loop.",
  6892. "summary": "Send v2 message",
  6893. "requestBody": {
  6894. "content": {
  6895. "application/json": {
  6896. "schema": {
  6897. "type": "object",
  6898. "properties": {
  6899. "prompt": {
  6900. "$ref": "#/components/schemas/Prompt"
  6901. },
  6902. "delivery": {
  6903. "$ref": "#/components/schemas/SessionDelivery"
  6904. }
  6905. },
  6906. "required": ["prompt"],
  6907. "additionalProperties": false
  6908. }
  6909. }
  6910. }
  6911. },
  6912. "x-codeSamples": [
  6913. {
  6914. "lang": "js",
  6915. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.prompt({\n ...\n})"
  6916. }
  6917. ]
  6918. }
  6919. },
  6920. "/api/session/{sessionID}/compact": {
  6921. "post": {
  6922. "tags": ["v2"],
  6923. "operationId": "v2.session.compact",
  6924. "parameters": [
  6925. {
  6926. "name": "directory",
  6927. "in": "query",
  6928. "required": false,
  6929. "schema": {
  6930. "type": "string"
  6931. }
  6932. },
  6933. {
  6934. "name": "workspace",
  6935. "in": "query",
  6936. "required": false,
  6937. "schema": {
  6938. "type": "string"
  6939. }
  6940. },
  6941. {
  6942. "name": "sessionID",
  6943. "in": "path",
  6944. "schema": {
  6945. "type": "string",
  6946. "pattern": "^ses.*"
  6947. },
  6948. "required": true
  6949. }
  6950. ],
  6951. "responses": {
  6952. "204": {
  6953. "description": "<No Content>"
  6954. }
  6955. },
  6956. "description": "Compact a v2 session conversation.",
  6957. "summary": "Compact v2 session",
  6958. "x-codeSamples": [
  6959. {
  6960. "lang": "js",
  6961. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.compact({\n ...\n})"
  6962. }
  6963. ]
  6964. }
  6965. },
  6966. "/api/session/{sessionID}/wait": {
  6967. "post": {
  6968. "tags": ["v2"],
  6969. "operationId": "v2.session.wait",
  6970. "parameters": [
  6971. {
  6972. "name": "directory",
  6973. "in": "query",
  6974. "required": false,
  6975. "schema": {
  6976. "type": "string"
  6977. }
  6978. },
  6979. {
  6980. "name": "workspace",
  6981. "in": "query",
  6982. "required": false,
  6983. "schema": {
  6984. "type": "string"
  6985. }
  6986. },
  6987. {
  6988. "name": "sessionID",
  6989. "in": "path",
  6990. "schema": {
  6991. "type": "string",
  6992. "pattern": "^ses.*"
  6993. },
  6994. "required": true
  6995. }
  6996. ],
  6997. "responses": {
  6998. "204": {
  6999. "description": "<No Content>"
  7000. }
  7001. },
  7002. "description": "Wait for a v2 session agent loop to become idle.",
  7003. "summary": "Wait for v2 session",
  7004. "x-codeSamples": [
  7005. {
  7006. "lang": "js",
  7007. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.wait({\n ...\n})"
  7008. }
  7009. ]
  7010. }
  7011. },
  7012. "/api/session/{sessionID}/context": {
  7013. "get": {
  7014. "tags": ["v2"],
  7015. "operationId": "v2.session.context",
  7016. "parameters": [
  7017. {
  7018. "name": "directory",
  7019. "in": "query",
  7020. "required": false,
  7021. "schema": {
  7022. "type": "string"
  7023. }
  7024. },
  7025. {
  7026. "name": "workspace",
  7027. "in": "query",
  7028. "required": false,
  7029. "schema": {
  7030. "type": "string"
  7031. }
  7032. },
  7033. {
  7034. "name": "sessionID",
  7035. "in": "path",
  7036. "schema": {
  7037. "type": "string",
  7038. "pattern": "^ses.*"
  7039. },
  7040. "required": true
  7041. }
  7042. ],
  7043. "responses": {
  7044. "200": {
  7045. "description": "Success",
  7046. "content": {
  7047. "application/json": {
  7048. "schema": {
  7049. "type": "array",
  7050. "items": {
  7051. "$ref": "#/components/schemas/SessionMessage"
  7052. }
  7053. }
  7054. }
  7055. }
  7056. }
  7057. },
  7058. "description": "Retrieve the active context messages for a v2 session (all messages after the last compaction).",
  7059. "summary": "Get v2 session context",
  7060. "x-codeSamples": [
  7061. {
  7062. "lang": "js",
  7063. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.context({\n ...\n})"
  7064. }
  7065. ]
  7066. }
  7067. },
  7068. "/api/session/{sessionID}/message": {
  7069. "get": {
  7070. "tags": ["v2 messages"],
  7071. "operationId": "v2.session.messages",
  7072. "parameters": [
  7073. {
  7074. "name": "directory",
  7075. "in": "query",
  7076. "required": false,
  7077. "schema": {
  7078. "type": "string"
  7079. }
  7080. },
  7081. {
  7082. "name": "workspace",
  7083. "in": "query",
  7084. "required": false,
  7085. "schema": {
  7086. "type": "string"
  7087. }
  7088. },
  7089. {
  7090. "name": "sessionID",
  7091. "in": "path",
  7092. "schema": {
  7093. "type": "string",
  7094. "pattern": "^ses.*"
  7095. },
  7096. "required": true
  7097. }
  7098. ],
  7099. "responses": {
  7100. "200": {
  7101. "description": "V2SessionMessagesResponse",
  7102. "content": {
  7103. "application/json": {
  7104. "schema": {
  7105. "$ref": "#/components/schemas/V2SessionMessagesResponse"
  7106. }
  7107. }
  7108. }
  7109. },
  7110. "400": {
  7111. "description": "Bad request",
  7112. "content": {
  7113. "application/json": {
  7114. "schema": {
  7115. "$ref": "#/components/schemas/BadRequestError"
  7116. }
  7117. }
  7118. }
  7119. }
  7120. },
  7121. "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.",
  7122. "summary": "Get v2 session messages",
  7123. "x-codeSamples": [
  7124. {
  7125. "lang": "js",
  7126. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.messages({\n ...\n})"
  7127. }
  7128. ]
  7129. }
  7130. },
  7131. "/tui/append-prompt": {
  7132. "post": {
  7133. "tags": ["tui"],
  7134. "operationId": "tui.appendPrompt",
  7135. "parameters": [
  7136. {
  7137. "name": "directory",
  7138. "in": "query",
  7139. "required": false,
  7140. "schema": {
  7141. "type": "string"
  7142. }
  7143. },
  7144. {
  7145. "name": "workspace",
  7146. "in": "query",
  7147. "required": false,
  7148. "schema": {
  7149. "type": "string"
  7150. }
  7151. }
  7152. ],
  7153. "responses": {
  7154. "200": {
  7155. "description": "Prompt processed successfully",
  7156. "content": {
  7157. "application/json": {
  7158. "schema": {
  7159. "type": "boolean",
  7160. "description": "Prompt processed successfully"
  7161. }
  7162. }
  7163. }
  7164. },
  7165. "400": {
  7166. "description": "Bad request",
  7167. "content": {
  7168. "application/json": {
  7169. "schema": {
  7170. "$ref": "#/components/schemas/BadRequestError"
  7171. }
  7172. }
  7173. }
  7174. }
  7175. },
  7176. "description": "Append prompt to the TUI.",
  7177. "summary": "Append TUI prompt",
  7178. "requestBody": {
  7179. "content": {
  7180. "application/json": {
  7181. "schema": {
  7182. "type": "object",
  7183. "properties": {
  7184. "text": {
  7185. "type": "string"
  7186. }
  7187. },
  7188. "required": ["text"],
  7189. "additionalProperties": false
  7190. }
  7191. }
  7192. }
  7193. },
  7194. "x-codeSamples": [
  7195. {
  7196. "lang": "js",
  7197. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.appendPrompt({\n ...\n})"
  7198. }
  7199. ]
  7200. }
  7201. },
  7202. "/tui/open-help": {
  7203. "post": {
  7204. "tags": ["tui"],
  7205. "operationId": "tui.openHelp",
  7206. "parameters": [
  7207. {
  7208. "name": "directory",
  7209. "in": "query",
  7210. "required": false,
  7211. "schema": {
  7212. "type": "string"
  7213. }
  7214. },
  7215. {
  7216. "name": "workspace",
  7217. "in": "query",
  7218. "required": false,
  7219. "schema": {
  7220. "type": "string"
  7221. }
  7222. }
  7223. ],
  7224. "responses": {
  7225. "200": {
  7226. "description": "Help dialog opened successfully",
  7227. "content": {
  7228. "application/json": {
  7229. "schema": {
  7230. "type": "boolean",
  7231. "description": "Help dialog opened successfully"
  7232. }
  7233. }
  7234. }
  7235. }
  7236. },
  7237. "description": "Open the help dialog in the TUI to display user assistance information.",
  7238. "summary": "Open help dialog",
  7239. "x-codeSamples": [
  7240. {
  7241. "lang": "js",
  7242. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openHelp({\n ...\n})"
  7243. }
  7244. ]
  7245. }
  7246. },
  7247. "/tui/open-sessions": {
  7248. "post": {
  7249. "tags": ["tui"],
  7250. "operationId": "tui.openSessions",
  7251. "parameters": [
  7252. {
  7253. "name": "directory",
  7254. "in": "query",
  7255. "required": false,
  7256. "schema": {
  7257. "type": "string"
  7258. }
  7259. },
  7260. {
  7261. "name": "workspace",
  7262. "in": "query",
  7263. "required": false,
  7264. "schema": {
  7265. "type": "string"
  7266. }
  7267. }
  7268. ],
  7269. "responses": {
  7270. "200": {
  7271. "description": "Session dialog opened successfully",
  7272. "content": {
  7273. "application/json": {
  7274. "schema": {
  7275. "type": "boolean",
  7276. "description": "Session dialog opened successfully"
  7277. }
  7278. }
  7279. }
  7280. }
  7281. },
  7282. "description": "Open the session dialog.",
  7283. "summary": "Open sessions dialog",
  7284. "x-codeSamples": [
  7285. {
  7286. "lang": "js",
  7287. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openSessions({\n ...\n})"
  7288. }
  7289. ]
  7290. }
  7291. },
  7292. "/tui/open-themes": {
  7293. "post": {
  7294. "tags": ["tui"],
  7295. "operationId": "tui.openThemes",
  7296. "parameters": [
  7297. {
  7298. "name": "directory",
  7299. "in": "query",
  7300. "required": false,
  7301. "schema": {
  7302. "type": "string"
  7303. }
  7304. },
  7305. {
  7306. "name": "workspace",
  7307. "in": "query",
  7308. "required": false,
  7309. "schema": {
  7310. "type": "string"
  7311. }
  7312. }
  7313. ],
  7314. "responses": {
  7315. "200": {
  7316. "description": "Theme dialog opened successfully",
  7317. "content": {
  7318. "application/json": {
  7319. "schema": {
  7320. "type": "boolean",
  7321. "description": "Theme dialog opened successfully"
  7322. }
  7323. }
  7324. }
  7325. }
  7326. },
  7327. "description": "Open the theme dialog.",
  7328. "summary": "Open themes dialog",
  7329. "x-codeSamples": [
  7330. {
  7331. "lang": "js",
  7332. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openThemes({\n ...\n})"
  7333. }
  7334. ]
  7335. }
  7336. },
  7337. "/tui/open-models": {
  7338. "post": {
  7339. "tags": ["tui"],
  7340. "operationId": "tui.openModels",
  7341. "parameters": [
  7342. {
  7343. "name": "directory",
  7344. "in": "query",
  7345. "required": false,
  7346. "schema": {
  7347. "type": "string"
  7348. }
  7349. },
  7350. {
  7351. "name": "workspace",
  7352. "in": "query",
  7353. "required": false,
  7354. "schema": {
  7355. "type": "string"
  7356. }
  7357. }
  7358. ],
  7359. "responses": {
  7360. "200": {
  7361. "description": "Model dialog opened successfully",
  7362. "content": {
  7363. "application/json": {
  7364. "schema": {
  7365. "type": "boolean",
  7366. "description": "Model dialog opened successfully"
  7367. }
  7368. }
  7369. }
  7370. }
  7371. },
  7372. "description": "Open the model dialog.",
  7373. "summary": "Open models dialog",
  7374. "x-codeSamples": [
  7375. {
  7376. "lang": "js",
  7377. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openModels({\n ...\n})"
  7378. }
  7379. ]
  7380. }
  7381. },
  7382. "/tui/submit-prompt": {
  7383. "post": {
  7384. "tags": ["tui"],
  7385. "operationId": "tui.submitPrompt",
  7386. "parameters": [
  7387. {
  7388. "name": "directory",
  7389. "in": "query",
  7390. "required": false,
  7391. "schema": {
  7392. "type": "string"
  7393. }
  7394. },
  7395. {
  7396. "name": "workspace",
  7397. "in": "query",
  7398. "required": false,
  7399. "schema": {
  7400. "type": "string"
  7401. }
  7402. }
  7403. ],
  7404. "responses": {
  7405. "200": {
  7406. "description": "Prompt submitted successfully",
  7407. "content": {
  7408. "application/json": {
  7409. "schema": {
  7410. "type": "boolean",
  7411. "description": "Prompt submitted successfully"
  7412. }
  7413. }
  7414. }
  7415. }
  7416. },
  7417. "description": "Submit the prompt.",
  7418. "summary": "Submit TUI prompt",
  7419. "x-codeSamples": [
  7420. {
  7421. "lang": "js",
  7422. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.submitPrompt({\n ...\n})"
  7423. }
  7424. ]
  7425. }
  7426. },
  7427. "/tui/clear-prompt": {
  7428. "post": {
  7429. "tags": ["tui"],
  7430. "operationId": "tui.clearPrompt",
  7431. "parameters": [
  7432. {
  7433. "name": "directory",
  7434. "in": "query",
  7435. "required": false,
  7436. "schema": {
  7437. "type": "string"
  7438. }
  7439. },
  7440. {
  7441. "name": "workspace",
  7442. "in": "query",
  7443. "required": false,
  7444. "schema": {
  7445. "type": "string"
  7446. }
  7447. }
  7448. ],
  7449. "responses": {
  7450. "200": {
  7451. "description": "Prompt cleared successfully",
  7452. "content": {
  7453. "application/json": {
  7454. "schema": {
  7455. "type": "boolean",
  7456. "description": "Prompt cleared successfully"
  7457. }
  7458. }
  7459. }
  7460. }
  7461. },
  7462. "description": "Clear the prompt.",
  7463. "summary": "Clear TUI prompt",
  7464. "x-codeSamples": [
  7465. {
  7466. "lang": "js",
  7467. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.clearPrompt({\n ...\n})"
  7468. }
  7469. ]
  7470. }
  7471. },
  7472. "/tui/execute-command": {
  7473. "post": {
  7474. "tags": ["tui"],
  7475. "operationId": "tui.executeCommand",
  7476. "parameters": [
  7477. {
  7478. "name": "directory",
  7479. "in": "query",
  7480. "required": false,
  7481. "schema": {
  7482. "type": "string"
  7483. }
  7484. },
  7485. {
  7486. "name": "workspace",
  7487. "in": "query",
  7488. "required": false,
  7489. "schema": {
  7490. "type": "string"
  7491. }
  7492. }
  7493. ],
  7494. "responses": {
  7495. "200": {
  7496. "description": "Command executed successfully",
  7497. "content": {
  7498. "application/json": {
  7499. "schema": {
  7500. "type": "boolean",
  7501. "description": "Command executed successfully"
  7502. }
  7503. }
  7504. }
  7505. },
  7506. "400": {
  7507. "description": "Bad request",
  7508. "content": {
  7509. "application/json": {
  7510. "schema": {
  7511. "$ref": "#/components/schemas/BadRequestError"
  7512. }
  7513. }
  7514. }
  7515. }
  7516. },
  7517. "description": "Execute a TUI command.",
  7518. "summary": "Execute TUI command",
  7519. "requestBody": {
  7520. "content": {
  7521. "application/json": {
  7522. "schema": {
  7523. "type": "object",
  7524. "properties": {
  7525. "command": {
  7526. "type": "string"
  7527. }
  7528. },
  7529. "required": ["command"],
  7530. "additionalProperties": false
  7531. }
  7532. }
  7533. }
  7534. },
  7535. "x-codeSamples": [
  7536. {
  7537. "lang": "js",
  7538. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.executeCommand({\n ...\n})"
  7539. }
  7540. ]
  7541. }
  7542. },
  7543. "/tui/show-toast": {
  7544. "post": {
  7545. "tags": ["tui"],
  7546. "operationId": "tui.showToast",
  7547. "parameters": [
  7548. {
  7549. "name": "directory",
  7550. "in": "query",
  7551. "required": false,
  7552. "schema": {
  7553. "type": "string"
  7554. }
  7555. },
  7556. {
  7557. "name": "workspace",
  7558. "in": "query",
  7559. "required": false,
  7560. "schema": {
  7561. "type": "string"
  7562. }
  7563. }
  7564. ],
  7565. "responses": {
  7566. "200": {
  7567. "description": "Toast notification shown successfully",
  7568. "content": {
  7569. "application/json": {
  7570. "schema": {
  7571. "type": "boolean",
  7572. "description": "Toast notification shown successfully"
  7573. }
  7574. }
  7575. }
  7576. }
  7577. },
  7578. "description": "Show a toast notification in the TUI.",
  7579. "summary": "Show TUI toast",
  7580. "requestBody": {
  7581. "content": {
  7582. "application/json": {
  7583. "schema": {
  7584. "type": "object",
  7585. "properties": {
  7586. "title": {
  7587. "type": "string"
  7588. },
  7589. "message": {
  7590. "type": "string"
  7591. },
  7592. "variant": {
  7593. "type": "string",
  7594. "enum": ["info", "success", "warning", "error"]
  7595. },
  7596. "duration": {
  7597. "type": "integer",
  7598. "exclusiveMinimum": 0
  7599. }
  7600. },
  7601. "required": ["message", "variant"],
  7602. "additionalProperties": false
  7603. }
  7604. }
  7605. }
  7606. },
  7607. "x-codeSamples": [
  7608. {
  7609. "lang": "js",
  7610. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.showToast({\n ...\n})"
  7611. }
  7612. ]
  7613. }
  7614. },
  7615. "/tui/publish": {
  7616. "post": {
  7617. "tags": ["tui"],
  7618. "operationId": "tui.publish",
  7619. "parameters": [
  7620. {
  7621. "name": "directory",
  7622. "in": "query",
  7623. "required": false,
  7624. "schema": {
  7625. "type": "string"
  7626. }
  7627. },
  7628. {
  7629. "name": "workspace",
  7630. "in": "query",
  7631. "required": false,
  7632. "schema": {
  7633. "type": "string"
  7634. }
  7635. }
  7636. ],
  7637. "responses": {
  7638. "200": {
  7639. "description": "Event published successfully",
  7640. "content": {
  7641. "application/json": {
  7642. "schema": {
  7643. "type": "boolean",
  7644. "description": "Event published successfully"
  7645. }
  7646. }
  7647. }
  7648. },
  7649. "400": {
  7650. "description": "Bad request",
  7651. "content": {
  7652. "application/json": {
  7653. "schema": {
  7654. "$ref": "#/components/schemas/BadRequestError"
  7655. }
  7656. }
  7657. }
  7658. }
  7659. },
  7660. "description": "Publish a TUI event.",
  7661. "summary": "Publish TUI event",
  7662. "requestBody": {
  7663. "content": {
  7664. "application/json": {
  7665. "schema": {
  7666. "anyOf": [
  7667. {
  7668. "$ref": "#/components/schemas/EventTuiPromptAppend"
  7669. },
  7670. {
  7671. "$ref": "#/components/schemas/EventTuiCommandExecute"
  7672. },
  7673. {
  7674. "$ref": "#/components/schemas/EventTuiToastShow"
  7675. },
  7676. {
  7677. "$ref": "#/components/schemas/EventTuiSessionSelect"
  7678. }
  7679. ]
  7680. }
  7681. }
  7682. }
  7683. },
  7684. "x-codeSamples": [
  7685. {
  7686. "lang": "js",
  7687. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.publish({\n ...\n})"
  7688. }
  7689. ]
  7690. }
  7691. },
  7692. "/tui/select-session": {
  7693. "post": {
  7694. "tags": ["tui"],
  7695. "operationId": "tui.selectSession",
  7696. "parameters": [
  7697. {
  7698. "name": "directory",
  7699. "in": "query",
  7700. "required": false,
  7701. "schema": {
  7702. "type": "string"
  7703. }
  7704. },
  7705. {
  7706. "name": "workspace",
  7707. "in": "query",
  7708. "required": false,
  7709. "schema": {
  7710. "type": "string"
  7711. }
  7712. }
  7713. ],
  7714. "responses": {
  7715. "200": {
  7716. "description": "Session selected successfully",
  7717. "content": {
  7718. "application/json": {
  7719. "schema": {
  7720. "type": "boolean",
  7721. "description": "Session selected successfully"
  7722. }
  7723. }
  7724. }
  7725. },
  7726. "400": {
  7727. "description": "Bad request",
  7728. "content": {
  7729. "application/json": {
  7730. "schema": {
  7731. "$ref": "#/components/schemas/BadRequestError"
  7732. }
  7733. }
  7734. }
  7735. },
  7736. "404": {
  7737. "description": "Not found",
  7738. "content": {
  7739. "application/json": {
  7740. "schema": {
  7741. "$ref": "#/components/schemas/NotFoundError"
  7742. }
  7743. }
  7744. }
  7745. }
  7746. },
  7747. "description": "Navigate the TUI to display the specified session.",
  7748. "summary": "Select session",
  7749. "requestBody": {
  7750. "content": {
  7751. "application/json": {
  7752. "schema": {
  7753. "type": "object",
  7754. "properties": {
  7755. "sessionID": {
  7756. "type": "string",
  7757. "description": "Session ID to navigate to"
  7758. }
  7759. },
  7760. "required": ["sessionID"],
  7761. "additionalProperties": false
  7762. }
  7763. }
  7764. }
  7765. },
  7766. "x-codeSamples": [
  7767. {
  7768. "lang": "js",
  7769. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.selectSession({\n ...\n})"
  7770. }
  7771. ]
  7772. }
  7773. },
  7774. "/tui/control/next": {
  7775. "get": {
  7776. "tags": ["tui"],
  7777. "operationId": "tui.control.next",
  7778. "parameters": [
  7779. {
  7780. "name": "directory",
  7781. "in": "query",
  7782. "required": false,
  7783. "schema": {
  7784. "type": "string"
  7785. }
  7786. },
  7787. {
  7788. "name": "workspace",
  7789. "in": "query",
  7790. "required": false,
  7791. "schema": {
  7792. "type": "string"
  7793. }
  7794. }
  7795. ],
  7796. "responses": {
  7797. "200": {
  7798. "description": "Next TUI request",
  7799. "content": {
  7800. "application/json": {
  7801. "schema": {
  7802. "type": "object",
  7803. "properties": {
  7804. "path": {
  7805. "type": "string"
  7806. },
  7807. "body": {}
  7808. },
  7809. "required": ["path", "body"],
  7810. "additionalProperties": false,
  7811. "description": "Next TUI request"
  7812. }
  7813. }
  7814. }
  7815. }
  7816. },
  7817. "description": "Retrieve the next TUI request from the queue for processing.",
  7818. "summary": "Get next TUI request",
  7819. "x-codeSamples": [
  7820. {
  7821. "lang": "js",
  7822. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.control.next({\n ...\n})"
  7823. }
  7824. ]
  7825. }
  7826. },
  7827. "/tui/control/response": {
  7828. "post": {
  7829. "tags": ["tui"],
  7830. "operationId": "tui.control.response",
  7831. "parameters": [
  7832. {
  7833. "name": "directory",
  7834. "in": "query",
  7835. "required": false,
  7836. "schema": {
  7837. "type": "string"
  7838. }
  7839. },
  7840. {
  7841. "name": "workspace",
  7842. "in": "query",
  7843. "required": false,
  7844. "schema": {
  7845. "type": "string"
  7846. }
  7847. }
  7848. ],
  7849. "responses": {
  7850. "200": {
  7851. "description": "Response submitted successfully",
  7852. "content": {
  7853. "application/json": {
  7854. "schema": {
  7855. "type": "boolean",
  7856. "description": "Response submitted successfully"
  7857. }
  7858. }
  7859. }
  7860. }
  7861. },
  7862. "description": "Submit a response to the TUI request queue to complete a pending request.",
  7863. "summary": "Submit TUI response",
  7864. "requestBody": {
  7865. "content": {
  7866. "application/json": {
  7867. "schema": {}
  7868. }
  7869. }
  7870. },
  7871. "x-codeSamples": [
  7872. {
  7873. "lang": "js",
  7874. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.control.response({\n ...\n})"
  7875. }
  7876. ]
  7877. }
  7878. },
  7879. "/experimental/workspace/adapter": {
  7880. "get": {
  7881. "tags": ["workspace"],
  7882. "operationId": "experimental.workspace.adapter.list",
  7883. "parameters": [
  7884. {
  7885. "name": "directory",
  7886. "in": "query",
  7887. "required": false,
  7888. "schema": {
  7889. "type": "string"
  7890. }
  7891. },
  7892. {
  7893. "name": "workspace",
  7894. "in": "query",
  7895. "required": false,
  7896. "schema": {
  7897. "type": "string"
  7898. }
  7899. }
  7900. ],
  7901. "responses": {
  7902. "200": {
  7903. "description": "Workspace adapters",
  7904. "content": {
  7905. "application/json": {
  7906. "schema": {
  7907. "type": "array",
  7908. "items": {
  7909. "type": "object",
  7910. "properties": {
  7911. "type": {
  7912. "type": "string"
  7913. },
  7914. "name": {
  7915. "type": "string"
  7916. },
  7917. "description": {
  7918. "type": "string"
  7919. }
  7920. },
  7921. "required": ["type", "name", "description"],
  7922. "additionalProperties": false
  7923. },
  7924. "description": "Workspace adapters"
  7925. }
  7926. }
  7927. }
  7928. }
  7929. },
  7930. "description": "List all available workspace adapters for the current project.",
  7931. "summary": "List workspace adapters",
  7932. "x-codeSamples": [
  7933. {
  7934. "lang": "js",
  7935. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.adapter.list({\n ...\n})"
  7936. }
  7937. ]
  7938. }
  7939. },
  7940. "/experimental/workspace": {
  7941. "get": {
  7942. "tags": ["workspace"],
  7943. "operationId": "experimental.workspace.list",
  7944. "parameters": [
  7945. {
  7946. "name": "directory",
  7947. "in": "query",
  7948. "required": false,
  7949. "schema": {
  7950. "type": "string"
  7951. }
  7952. },
  7953. {
  7954. "name": "workspace",
  7955. "in": "query",
  7956. "required": false,
  7957. "schema": {
  7958. "type": "string"
  7959. }
  7960. }
  7961. ],
  7962. "responses": {
  7963. "200": {
  7964. "description": "Workspaces",
  7965. "content": {
  7966. "application/json": {
  7967. "schema": {
  7968. "type": "array",
  7969. "items": {
  7970. "$ref": "#/components/schemas/Workspace"
  7971. },
  7972. "description": "Workspaces"
  7973. }
  7974. }
  7975. }
  7976. }
  7977. },
  7978. "description": "List all workspaces.",
  7979. "summary": "List workspaces",
  7980. "x-codeSamples": [
  7981. {
  7982. "lang": "js",
  7983. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.list({\n ...\n})"
  7984. }
  7985. ]
  7986. },
  7987. "post": {
  7988. "tags": ["workspace"],
  7989. "operationId": "experimental.workspace.create",
  7990. "parameters": [
  7991. {
  7992. "name": "directory",
  7993. "in": "query",
  7994. "required": false,
  7995. "schema": {
  7996. "type": "string"
  7997. }
  7998. },
  7999. {
  8000. "name": "workspace",
  8001. "in": "query",
  8002. "required": false,
  8003. "schema": {
  8004. "type": "string"
  8005. }
  8006. }
  8007. ],
  8008. "responses": {
  8009. "200": {
  8010. "description": "Workspace created",
  8011. "content": {
  8012. "application/json": {
  8013. "schema": {
  8014. "$ref": "#/components/schemas/Workspace"
  8015. }
  8016. }
  8017. }
  8018. },
  8019. "400": {
  8020. "description": "Bad request",
  8021. "content": {
  8022. "application/json": {
  8023. "schema": {
  8024. "$ref": "#/components/schemas/BadRequestError"
  8025. }
  8026. }
  8027. }
  8028. }
  8029. },
  8030. "description": "Create a workspace for the current project.",
  8031. "summary": "Create workspace",
  8032. "requestBody": {
  8033. "content": {
  8034. "application/json": {
  8035. "schema": {
  8036. "type": "object",
  8037. "properties": {
  8038. "id": {
  8039. "type": "string"
  8040. },
  8041. "type": {
  8042. "type": "string"
  8043. },
  8044. "branch": {
  8045. "anyOf": [
  8046. {
  8047. "type": "string"
  8048. },
  8049. {
  8050. "type": "null"
  8051. }
  8052. ]
  8053. },
  8054. "extra": {
  8055. "anyOf": [
  8056. {},
  8057. {
  8058. "type": "null"
  8059. }
  8060. ]
  8061. }
  8062. },
  8063. "required": ["type", "branch"],
  8064. "additionalProperties": false
  8065. }
  8066. }
  8067. }
  8068. },
  8069. "x-codeSamples": [
  8070. {
  8071. "lang": "js",
  8072. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.create({\n ...\n})"
  8073. }
  8074. ]
  8075. }
  8076. },
  8077. "/experimental/workspace/status": {
  8078. "get": {
  8079. "tags": ["workspace"],
  8080. "operationId": "experimental.workspace.status",
  8081. "parameters": [
  8082. {
  8083. "name": "directory",
  8084. "in": "query",
  8085. "required": false,
  8086. "schema": {
  8087. "type": "string"
  8088. }
  8089. },
  8090. {
  8091. "name": "workspace",
  8092. "in": "query",
  8093. "required": false,
  8094. "schema": {
  8095. "type": "string"
  8096. }
  8097. }
  8098. ],
  8099. "responses": {
  8100. "200": {
  8101. "description": "Workspace status",
  8102. "content": {
  8103. "application/json": {
  8104. "schema": {
  8105. "type": "array",
  8106. "items": {
  8107. "type": "object",
  8108. "properties": {
  8109. "workspaceID": {
  8110. "type": "string"
  8111. },
  8112. "status": {
  8113. "type": "string",
  8114. "enum": ["connected", "connecting", "disconnected", "error"]
  8115. }
  8116. },
  8117. "required": ["workspaceID", "status"],
  8118. "additionalProperties": false
  8119. },
  8120. "description": "Workspace status"
  8121. }
  8122. }
  8123. }
  8124. }
  8125. },
  8126. "description": "Get connection status for workspaces in the current project.",
  8127. "summary": "Workspace status",
  8128. "x-codeSamples": [
  8129. {
  8130. "lang": "js",
  8131. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.status({\n ...\n})"
  8132. }
  8133. ]
  8134. }
  8135. },
  8136. "/experimental/workspace/{id}": {
  8137. "delete": {
  8138. "tags": ["workspace"],
  8139. "operationId": "experimental.workspace.remove",
  8140. "parameters": [
  8141. {
  8142. "name": "directory",
  8143. "in": "query",
  8144. "required": false,
  8145. "schema": {
  8146. "type": "string"
  8147. }
  8148. },
  8149. {
  8150. "name": "workspace",
  8151. "in": "query",
  8152. "required": false,
  8153. "schema": {
  8154. "type": "string"
  8155. }
  8156. },
  8157. {
  8158. "name": "id",
  8159. "in": "path",
  8160. "schema": {
  8161. "type": "string",
  8162. "pattern": "^wrk.*"
  8163. },
  8164. "required": true
  8165. }
  8166. ],
  8167. "responses": {
  8168. "200": {
  8169. "description": "Workspace removed",
  8170. "content": {
  8171. "application/json": {
  8172. "schema": {
  8173. "$ref": "#/components/schemas/Workspace"
  8174. }
  8175. }
  8176. }
  8177. },
  8178. "400": {
  8179. "description": "Bad request",
  8180. "content": {
  8181. "application/json": {
  8182. "schema": {
  8183. "$ref": "#/components/schemas/BadRequestError"
  8184. }
  8185. }
  8186. }
  8187. }
  8188. },
  8189. "description": "Remove an existing workspace.",
  8190. "summary": "Remove workspace",
  8191. "x-codeSamples": [
  8192. {
  8193. "lang": "js",
  8194. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.remove({\n ...\n})"
  8195. }
  8196. ]
  8197. }
  8198. },
  8199. "/experimental/workspace/{id}/session-restore": {
  8200. "post": {
  8201. "tags": ["workspace"],
  8202. "operationId": "experimental.workspace.sessionRestore",
  8203. "parameters": [
  8204. {
  8205. "name": "directory",
  8206. "in": "query",
  8207. "required": false,
  8208. "schema": {
  8209. "type": "string"
  8210. }
  8211. },
  8212. {
  8213. "name": "workspace",
  8214. "in": "query",
  8215. "required": false,
  8216. "schema": {
  8217. "type": "string"
  8218. }
  8219. },
  8220. {
  8221. "name": "id",
  8222. "in": "path",
  8223. "schema": {
  8224. "type": "string",
  8225. "pattern": "^wrk.*"
  8226. },
  8227. "required": true
  8228. }
  8229. ],
  8230. "responses": {
  8231. "200": {
  8232. "description": "Session replay started",
  8233. "content": {
  8234. "application/json": {
  8235. "schema": {
  8236. "type": "object",
  8237. "properties": {
  8238. "total": {
  8239. "type": "integer",
  8240. "minimum": 0
  8241. }
  8242. },
  8243. "required": ["total"],
  8244. "additionalProperties": false,
  8245. "description": "Session replay started"
  8246. }
  8247. }
  8248. }
  8249. },
  8250. "400": {
  8251. "description": "Bad request",
  8252. "content": {
  8253. "application/json": {
  8254. "schema": {
  8255. "$ref": "#/components/schemas/BadRequestError"
  8256. }
  8257. }
  8258. }
  8259. }
  8260. },
  8261. "description": "Replay a session's sync events into the target workspace in batches.",
  8262. "summary": "Restore session into workspace",
  8263. "requestBody": {
  8264. "content": {
  8265. "application/json": {
  8266. "schema": {
  8267. "type": "object",
  8268. "properties": {
  8269. "sessionID": {
  8270. "type": "string"
  8271. }
  8272. },
  8273. "required": ["sessionID"],
  8274. "additionalProperties": false
  8275. }
  8276. }
  8277. }
  8278. },
  8279. "x-codeSamples": [
  8280. {
  8281. "lang": "js",
  8282. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.sessionRestore({\n ...\n})"
  8283. }
  8284. ]
  8285. }
  8286. },
  8287. "/pty/{ptyID}/connect": {
  8288. "get": {
  8289. "tags": ["pty"],
  8290. "operationId": "pty.connect",
  8291. "parameters": [
  8292. {
  8293. "name": "directory",
  8294. "in": "query",
  8295. "required": false,
  8296. "schema": {
  8297. "type": "string"
  8298. }
  8299. },
  8300. {
  8301. "name": "workspace",
  8302. "in": "query",
  8303. "required": false,
  8304. "schema": {
  8305. "type": "string"
  8306. }
  8307. },
  8308. {
  8309. "name": "ptyID",
  8310. "in": "path",
  8311. "schema": {
  8312. "type": "string",
  8313. "pattern": "^pty.*"
  8314. },
  8315. "required": true
  8316. }
  8317. ],
  8318. "responses": {
  8319. "200": {
  8320. "description": "Connected session",
  8321. "content": {
  8322. "application/json": {
  8323. "schema": {
  8324. "type": "boolean",
  8325. "description": "Connected session"
  8326. }
  8327. }
  8328. }
  8329. },
  8330. "404": {
  8331. "description": "Not found",
  8332. "content": {
  8333. "application/json": {
  8334. "schema": {
  8335. "$ref": "#/components/schemas/NotFoundError"
  8336. }
  8337. }
  8338. }
  8339. }
  8340. },
  8341. "description": "Establish a WebSocket connection to interact with a pseudo-terminal (PTY) session in real-time.",
  8342. "summary": "Connect to PTY session",
  8343. "x-codeSamples": [
  8344. {
  8345. "lang": "js",
  8346. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.connect({\n ...\n})"
  8347. }
  8348. ]
  8349. }
  8350. }
  8351. },
  8352. "components": {
  8353. "schemas": {
  8354. "Event": {
  8355. "anyOf": [
  8356. {
  8357. "$ref": "#/components/schemas/EventServerInstanceDisposed"
  8358. },
  8359. {
  8360. "$ref": "#/components/schemas/EventFileEdited"
  8361. },
  8362. {
  8363. "$ref": "#/components/schemas/EventFileWatcherUpdated"
  8364. },
  8365. {
  8366. "$ref": "#/components/schemas/EventLspClientDiagnostics"
  8367. },
  8368. {
  8369. "$ref": "#/components/schemas/EventLspUpdated"
  8370. },
  8371. {
  8372. "$ref": "#/components/schemas/EventMessagePartDelta"
  8373. },
  8374. {
  8375. "$ref": "#/components/schemas/EventPermissionAsked"
  8376. },
  8377. {
  8378. "$ref": "#/components/schemas/EventPermissionReplied"
  8379. },
  8380. {
  8381. "$ref": "#/components/schemas/EventSessionDiff"
  8382. },
  8383. {
  8384. "$ref": "#/components/schemas/EventSessionError"
  8385. },
  8386. {
  8387. "$ref": "#/components/schemas/EventInstallationUpdated"
  8388. },
  8389. {
  8390. "$ref": "#/components/schemas/EventInstallationUpdate-available"
  8391. },
  8392. {
  8393. "$ref": "#/components/schemas/EventQuestionAsked"
  8394. },
  8395. {
  8396. "$ref": "#/components/schemas/EventQuestionReplied"
  8397. },
  8398. {
  8399. "$ref": "#/components/schemas/EventQuestionRejected"
  8400. },
  8401. {
  8402. "$ref": "#/components/schemas/EventTodoUpdated"
  8403. },
  8404. {
  8405. "$ref": "#/components/schemas/EventSessionStatus"
  8406. },
  8407. {
  8408. "$ref": "#/components/schemas/EventSessionIdle"
  8409. },
  8410. {
  8411. "$ref": "#/components/schemas/EventSessionCompacted"
  8412. },
  8413. {
  8414. "$ref": "#/components/schemas/Event.tui.prompt.append"
  8415. },
  8416. {
  8417. "$ref": "#/components/schemas/Event.tui.command.execute"
  8418. },
  8419. {
  8420. "$ref": "#/components/schemas/EventTuiToastShow1"
  8421. },
  8422. {
  8423. "$ref": "#/components/schemas/Event.tui.session.select"
  8424. },
  8425. {
  8426. "$ref": "#/components/schemas/EventMcpToolsChanged"
  8427. },
  8428. {
  8429. "$ref": "#/components/schemas/EventMcpBrowserOpenFailed"
  8430. },
  8431. {
  8432. "$ref": "#/components/schemas/EventCommandExecuted"
  8433. },
  8434. {
  8435. "$ref": "#/components/schemas/EventProjectUpdated"
  8436. },
  8437. {
  8438. "$ref": "#/components/schemas/EventVcsBranchUpdated"
  8439. },
  8440. {
  8441. "$ref": "#/components/schemas/EventWorkspaceReady"
  8442. },
  8443. {
  8444. "$ref": "#/components/schemas/EventWorkspaceFailed"
  8445. },
  8446. {
  8447. "$ref": "#/components/schemas/EventWorkspaceRestore"
  8448. },
  8449. {
  8450. "$ref": "#/components/schemas/EventWorkspaceStatus"
  8451. },
  8452. {
  8453. "$ref": "#/components/schemas/EventWorktreeReady"
  8454. },
  8455. {
  8456. "$ref": "#/components/schemas/EventWorktreeFailed"
  8457. },
  8458. {
  8459. "$ref": "#/components/schemas/EventPtyCreated"
  8460. },
  8461. {
  8462. "$ref": "#/components/schemas/EventPtyUpdated"
  8463. },
  8464. {
  8465. "$ref": "#/components/schemas/EventPtyExited"
  8466. },
  8467. {
  8468. "$ref": "#/components/schemas/EventPtyDeleted"
  8469. },
  8470. {
  8471. "$ref": "#/components/schemas/EventMessageUpdated"
  8472. },
  8473. {
  8474. "$ref": "#/components/schemas/EventMessageRemoved"
  8475. },
  8476. {
  8477. "$ref": "#/components/schemas/EventMessagePartUpdated"
  8478. },
  8479. {
  8480. "$ref": "#/components/schemas/EventMessagePartRemoved"
  8481. },
  8482. {
  8483. "$ref": "#/components/schemas/EventSessionCreated"
  8484. },
  8485. {
  8486. "$ref": "#/components/schemas/EventSessionUpdated"
  8487. },
  8488. {
  8489. "$ref": "#/components/schemas/EventSessionDeleted"
  8490. },
  8491. {
  8492. "$ref": "#/components/schemas/EventSessionNextAgentSwitched"
  8493. },
  8494. {
  8495. "$ref": "#/components/schemas/EventSessionNextModelSwitched"
  8496. },
  8497. {
  8498. "$ref": "#/components/schemas/EventSessionNextPrompted"
  8499. },
  8500. {
  8501. "$ref": "#/components/schemas/EventSessionNextSynthetic"
  8502. },
  8503. {
  8504. "$ref": "#/components/schemas/EventSessionNextShellStarted"
  8505. },
  8506. {
  8507. "$ref": "#/components/schemas/EventSessionNextShellEnded"
  8508. },
  8509. {
  8510. "$ref": "#/components/schemas/EventSessionNextStepStarted"
  8511. },
  8512. {
  8513. "$ref": "#/components/schemas/EventSessionNextStepEnded"
  8514. },
  8515. {
  8516. "$ref": "#/components/schemas/EventSessionNextTextStarted"
  8517. },
  8518. {
  8519. "$ref": "#/components/schemas/EventSessionNextTextDelta"
  8520. },
  8521. {
  8522. "$ref": "#/components/schemas/EventSessionNextTextEnded"
  8523. },
  8524. {
  8525. "$ref": "#/components/schemas/EventSessionNextReasoningStarted"
  8526. },
  8527. {
  8528. "$ref": "#/components/schemas/EventSessionNextReasoningDelta"
  8529. },
  8530. {
  8531. "$ref": "#/components/schemas/EventSessionNextReasoningEnded"
  8532. },
  8533. {
  8534. "$ref": "#/components/schemas/EventSessionNextToolInputStarted"
  8535. },
  8536. {
  8537. "$ref": "#/components/schemas/EventSessionNextToolInputDelta"
  8538. },
  8539. {
  8540. "$ref": "#/components/schemas/EventSessionNextToolInputEnded"
  8541. },
  8542. {
  8543. "$ref": "#/components/schemas/EventSessionNextToolCalled"
  8544. },
  8545. {
  8546. "$ref": "#/components/schemas/EventSessionNextToolProgress"
  8547. },
  8548. {
  8549. "$ref": "#/components/schemas/EventSessionNextToolSuccess"
  8550. },
  8551. {
  8552. "$ref": "#/components/schemas/EventSessionNextToolError"
  8553. },
  8554. {
  8555. "$ref": "#/components/schemas/EventSessionNextRetried"
  8556. },
  8557. {
  8558. "$ref": "#/components/schemas/EventSessionNextCompactionStarted"
  8559. },
  8560. {
  8561. "$ref": "#/components/schemas/EventSessionNextCompactionDelta"
  8562. },
  8563. {
  8564. "$ref": "#/components/schemas/EventSessionNextCompactionEnded"
  8565. },
  8566. {
  8567. "$ref": "#/components/schemas/EventServerConnected"
  8568. },
  8569. {
  8570. "$ref": "#/components/schemas/EventGlobalDisposed"
  8571. }
  8572. ]
  8573. },
  8574. "OAuth": {
  8575. "type": "object",
  8576. "properties": {
  8577. "type": {
  8578. "type": "string",
  8579. "enum": ["oauth"]
  8580. },
  8581. "refresh": {
  8582. "type": "string"
  8583. },
  8584. "access": {
  8585. "type": "string"
  8586. },
  8587. "expires": {
  8588. "type": "integer",
  8589. "minimum": 0
  8590. },
  8591. "accountId": {
  8592. "type": "string"
  8593. },
  8594. "enterpriseUrl": {
  8595. "type": "string"
  8596. }
  8597. },
  8598. "required": ["type", "refresh", "access", "expires"],
  8599. "additionalProperties": false
  8600. },
  8601. "ApiAuth": {
  8602. "type": "object",
  8603. "properties": {
  8604. "type": {
  8605. "type": "string",
  8606. "enum": ["api"]
  8607. },
  8608. "key": {
  8609. "type": "string"
  8610. },
  8611. "metadata": {
  8612. "type": "object",
  8613. "additionalProperties": {
  8614. "type": "string"
  8615. }
  8616. }
  8617. },
  8618. "required": ["type", "key"],
  8619. "additionalProperties": false
  8620. },
  8621. "WellKnownAuth": {
  8622. "type": "object",
  8623. "properties": {
  8624. "type": {
  8625. "type": "string",
  8626. "enum": ["wellknown"]
  8627. },
  8628. "key": {
  8629. "type": "string"
  8630. },
  8631. "token": {
  8632. "type": "string"
  8633. }
  8634. },
  8635. "required": ["type", "key", "token"],
  8636. "additionalProperties": false
  8637. },
  8638. "Auth": {
  8639. "anyOf": [
  8640. {
  8641. "$ref": "#/components/schemas/OAuth"
  8642. },
  8643. {
  8644. "$ref": "#/components/schemas/ApiAuth"
  8645. },
  8646. {
  8647. "$ref": "#/components/schemas/WellKnownAuth"
  8648. }
  8649. ]
  8650. },
  8651. "PermissionRequest": {
  8652. "type": "object",
  8653. "properties": {
  8654. "id": {
  8655. "type": "string"
  8656. },
  8657. "sessionID": {
  8658. "type": "string"
  8659. },
  8660. "permission": {
  8661. "type": "string"
  8662. },
  8663. "patterns": {
  8664. "type": "array",
  8665. "items": {
  8666. "type": "string"
  8667. }
  8668. },
  8669. "metadata": {
  8670. "type": "object"
  8671. },
  8672. "always": {
  8673. "type": "array",
  8674. "items": {
  8675. "type": "string"
  8676. }
  8677. },
  8678. "tool": {
  8679. "type": "object",
  8680. "properties": {
  8681. "messageID": {
  8682. "type": "string"
  8683. },
  8684. "callID": {
  8685. "type": "string"
  8686. }
  8687. },
  8688. "required": ["messageID", "callID"],
  8689. "additionalProperties": false
  8690. }
  8691. },
  8692. "required": ["id", "sessionID", "permission", "patterns", "metadata", "always"],
  8693. "additionalProperties": false
  8694. },
  8695. "SnapshotFileDiff": {
  8696. "type": "object",
  8697. "properties": {
  8698. "file": {
  8699. "type": "string"
  8700. },
  8701. "patch": {
  8702. "type": "string"
  8703. },
  8704. "additions": {
  8705. "type": "integer",
  8706. "minimum": 0
  8707. },
  8708. "deletions": {
  8709. "type": "integer",
  8710. "minimum": 0
  8711. },
  8712. "status": {
  8713. "type": "string",
  8714. "enum": ["added", "deleted", "modified"]
  8715. }
  8716. },
  8717. "required": ["file", "patch", "additions", "deletions"],
  8718. "additionalProperties": false
  8719. },
  8720. "ProviderAuthError": {
  8721. "type": "object",
  8722. "properties": {
  8723. "name": {
  8724. "type": "string",
  8725. "enum": ["ProviderAuthError"]
  8726. },
  8727. "data": {
  8728. "type": "object",
  8729. "properties": {
  8730. "providerID": {
  8731. "type": "string"
  8732. },
  8733. "message": {
  8734. "type": "string"
  8735. }
  8736. },
  8737. "required": ["providerID", "message"],
  8738. "additionalProperties": false
  8739. }
  8740. },
  8741. "required": ["name", "data"],
  8742. "additionalProperties": false
  8743. },
  8744. "UnknownError": {
  8745. "type": "object",
  8746. "properties": {
  8747. "name": {
  8748. "type": "string",
  8749. "enum": ["UnknownError"]
  8750. },
  8751. "data": {
  8752. "type": "object",
  8753. "properties": {
  8754. "message": {
  8755. "type": "string"
  8756. }
  8757. },
  8758. "required": ["message"],
  8759. "additionalProperties": false
  8760. }
  8761. },
  8762. "required": ["name", "data"],
  8763. "additionalProperties": false
  8764. },
  8765. "MessageOutputLengthError": {
  8766. "type": "object",
  8767. "properties": {
  8768. "name": {
  8769. "type": "string",
  8770. "enum": ["MessageOutputLengthError"]
  8771. },
  8772. "data": {
  8773. "type": "object",
  8774. "properties": {}
  8775. }
  8776. },
  8777. "required": ["name", "data"],
  8778. "additionalProperties": false
  8779. },
  8780. "MessageAbortedError": {
  8781. "type": "object",
  8782. "properties": {
  8783. "name": {
  8784. "type": "string",
  8785. "enum": ["MessageAbortedError"]
  8786. },
  8787. "data": {
  8788. "type": "object",
  8789. "properties": {
  8790. "message": {
  8791. "type": "string"
  8792. }
  8793. },
  8794. "required": ["message"],
  8795. "additionalProperties": false
  8796. }
  8797. },
  8798. "required": ["name", "data"],
  8799. "additionalProperties": false
  8800. },
  8801. "StructuredOutputError": {
  8802. "type": "object",
  8803. "properties": {
  8804. "name": {
  8805. "type": "string",
  8806. "enum": ["StructuredOutputError"]
  8807. },
  8808. "data": {
  8809. "type": "object",
  8810. "properties": {
  8811. "message": {
  8812. "type": "string"
  8813. },
  8814. "retries": {
  8815. "type": "integer",
  8816. "minimum": 0
  8817. }
  8818. },
  8819. "required": ["message", "retries"],
  8820. "additionalProperties": false
  8821. }
  8822. },
  8823. "required": ["name", "data"],
  8824. "additionalProperties": false
  8825. },
  8826. "ContextOverflowError": {
  8827. "type": "object",
  8828. "properties": {
  8829. "name": {
  8830. "type": "string",
  8831. "enum": ["ContextOverflowError"]
  8832. },
  8833. "data": {
  8834. "type": "object",
  8835. "properties": {
  8836. "message": {
  8837. "type": "string"
  8838. },
  8839. "responseBody": {
  8840. "type": "string"
  8841. }
  8842. },
  8843. "required": ["message"],
  8844. "additionalProperties": false
  8845. }
  8846. },
  8847. "required": ["name", "data"],
  8848. "additionalProperties": false
  8849. },
  8850. "APIError": {
  8851. "type": "object",
  8852. "properties": {
  8853. "name": {
  8854. "type": "string",
  8855. "enum": ["APIError"]
  8856. },
  8857. "data": {
  8858. "type": "object",
  8859. "properties": {
  8860. "message": {
  8861. "type": "string"
  8862. },
  8863. "statusCode": {
  8864. "type": "integer",
  8865. "minimum": 0
  8866. },
  8867. "isRetryable": {
  8868. "type": "boolean"
  8869. },
  8870. "responseHeaders": {
  8871. "type": "object",
  8872. "additionalProperties": {
  8873. "type": "string"
  8874. }
  8875. },
  8876. "responseBody": {
  8877. "type": "string"
  8878. },
  8879. "metadata": {
  8880. "type": "object",
  8881. "additionalProperties": {
  8882. "type": "string"
  8883. }
  8884. }
  8885. },
  8886. "required": ["message", "isRetryable"],
  8887. "additionalProperties": false
  8888. }
  8889. },
  8890. "required": ["name", "data"],
  8891. "additionalProperties": false
  8892. },
  8893. "QuestionOption": {
  8894. "type": "object",
  8895. "properties": {
  8896. "label": {
  8897. "type": "string",
  8898. "description": "Display text (1-5 words, concise)"
  8899. },
  8900. "description": {
  8901. "type": "string",
  8902. "description": "Explanation of choice"
  8903. }
  8904. },
  8905. "required": ["label", "description"],
  8906. "additionalProperties": false
  8907. },
  8908. "QuestionInfo": {
  8909. "type": "object",
  8910. "properties": {
  8911. "question": {
  8912. "type": "string",
  8913. "description": "Complete question"
  8914. },
  8915. "header": {
  8916. "type": "string",
  8917. "description": "Very short label (max 30 chars)"
  8918. },
  8919. "options": {
  8920. "type": "array",
  8921. "items": {
  8922. "$ref": "#/components/schemas/QuestionOption"
  8923. },
  8924. "description": "Available choices"
  8925. },
  8926. "multiple": {
  8927. "type": "boolean"
  8928. },
  8929. "custom": {
  8930. "type": "boolean"
  8931. }
  8932. },
  8933. "required": ["question", "header", "options"],
  8934. "additionalProperties": false
  8935. },
  8936. "QuestionTool": {
  8937. "type": "object",
  8938. "properties": {
  8939. "messageID": {
  8940. "type": "string"
  8941. },
  8942. "callID": {
  8943. "type": "string"
  8944. }
  8945. },
  8946. "required": ["messageID", "callID"],
  8947. "additionalProperties": false
  8948. },
  8949. "QuestionRequest": {
  8950. "type": "object",
  8951. "properties": {
  8952. "id": {
  8953. "type": "string"
  8954. },
  8955. "sessionID": {
  8956. "type": "string"
  8957. },
  8958. "questions": {
  8959. "type": "array",
  8960. "items": {
  8961. "$ref": "#/components/schemas/QuestionInfo"
  8962. },
  8963. "description": "Questions to ask"
  8964. },
  8965. "tool": {
  8966. "$ref": "#/components/schemas/QuestionTool"
  8967. }
  8968. },
  8969. "required": ["id", "sessionID", "questions"],
  8970. "additionalProperties": false
  8971. },
  8972. "QuestionAnswer": {
  8973. "type": "array",
  8974. "items": {
  8975. "type": "string"
  8976. }
  8977. },
  8978. "QuestionReplied": {
  8979. "type": "object",
  8980. "properties": {
  8981. "sessionID": {
  8982. "type": "string"
  8983. },
  8984. "requestID": {
  8985. "type": "string"
  8986. },
  8987. "answers": {
  8988. "type": "array",
  8989. "items": {
  8990. "$ref": "#/components/schemas/QuestionAnswer"
  8991. }
  8992. }
  8993. },
  8994. "required": ["sessionID", "requestID", "answers"],
  8995. "additionalProperties": false
  8996. },
  8997. "QuestionRejected": {
  8998. "type": "object",
  8999. "properties": {
  9000. "sessionID": {
  9001. "type": "string"
  9002. },
  9003. "requestID": {
  9004. "type": "string"
  9005. }
  9006. },
  9007. "required": ["sessionID", "requestID"],
  9008. "additionalProperties": false
  9009. },
  9010. "Todo": {
  9011. "type": "object",
  9012. "properties": {
  9013. "content": {
  9014. "type": "string",
  9015. "description": "Brief description of the task"
  9016. },
  9017. "status": {
  9018. "type": "string",
  9019. "description": "Current status of the task: pending, in_progress, completed, cancelled"
  9020. },
  9021. "priority": {
  9022. "type": "string",
  9023. "description": "Priority level of the task: high, medium, low"
  9024. }
  9025. },
  9026. "required": ["content", "status", "priority"],
  9027. "additionalProperties": false
  9028. },
  9029. "SessionStatus": {
  9030. "anyOf": [
  9031. {
  9032. "type": "object",
  9033. "properties": {
  9034. "type": {
  9035. "type": "string",
  9036. "enum": ["idle"]
  9037. }
  9038. },
  9039. "required": ["type"],
  9040. "additionalProperties": false
  9041. },
  9042. {
  9043. "type": "object",
  9044. "properties": {
  9045. "type": {
  9046. "type": "string",
  9047. "enum": ["retry"]
  9048. },
  9049. "attempt": {
  9050. "type": "integer",
  9051. "minimum": 0
  9052. },
  9053. "message": {
  9054. "type": "string"
  9055. },
  9056. "next": {
  9057. "type": "integer",
  9058. "minimum": 0
  9059. }
  9060. },
  9061. "required": ["type", "attempt", "message", "next"],
  9062. "additionalProperties": false
  9063. },
  9064. {
  9065. "type": "object",
  9066. "properties": {
  9067. "type": {
  9068. "type": "string",
  9069. "enum": ["busy"]
  9070. }
  9071. },
  9072. "required": ["type"],
  9073. "additionalProperties": false
  9074. }
  9075. ]
  9076. },
  9077. "Event.tui.prompt.append": {
  9078. "type": "object",
  9079. "properties": {
  9080. "id": {
  9081. "type": "string"
  9082. },
  9083. "type": {
  9084. "type": "string",
  9085. "enum": ["tui.prompt.append"]
  9086. },
  9087. "properties": {
  9088. "type": "object",
  9089. "properties": {
  9090. "text": {
  9091. "type": "string"
  9092. }
  9093. },
  9094. "required": ["text"],
  9095. "additionalProperties": false
  9096. }
  9097. },
  9098. "required": ["id", "type", "properties"],
  9099. "additionalProperties": false
  9100. },
  9101. "Event.tui.command.execute": {
  9102. "type": "object",
  9103. "properties": {
  9104. "id": {
  9105. "type": "string"
  9106. },
  9107. "type": {
  9108. "type": "string",
  9109. "enum": ["tui.command.execute"]
  9110. },
  9111. "properties": {
  9112. "type": "object",
  9113. "properties": {
  9114. "command": {
  9115. "anyOf": [
  9116. {
  9117. "type": "string",
  9118. "enum": [
  9119. "session.list",
  9120. "session.new",
  9121. "session.share",
  9122. "session.interrupt",
  9123. "session.compact",
  9124. "session.page.up",
  9125. "session.page.down",
  9126. "session.line.up",
  9127. "session.line.down",
  9128. "session.half.page.up",
  9129. "session.half.page.down",
  9130. "session.first",
  9131. "session.last",
  9132. "prompt.clear",
  9133. "prompt.submit",
  9134. "agent.cycle"
  9135. ]
  9136. },
  9137. {
  9138. "type": "string"
  9139. }
  9140. ]
  9141. }
  9142. },
  9143. "required": ["command"],
  9144. "additionalProperties": false
  9145. }
  9146. },
  9147. "required": ["id", "type", "properties"],
  9148. "additionalProperties": false
  9149. },
  9150. "Event.tui.toast.show": {
  9151. "type": "object",
  9152. "properties": {
  9153. "id": {
  9154. "type": "string"
  9155. },
  9156. "type": {
  9157. "type": "string",
  9158. "enum": ["tui.toast.show"]
  9159. },
  9160. "properties": {
  9161. "type": "object",
  9162. "properties": {
  9163. "title": {
  9164. "type": "string"
  9165. },
  9166. "message": {
  9167. "type": "string"
  9168. },
  9169. "variant": {
  9170. "type": "string",
  9171. "enum": ["info", "success", "warning", "error"]
  9172. },
  9173. "duration": {
  9174. "type": "integer",
  9175. "exclusiveMinimum": 0
  9176. }
  9177. },
  9178. "required": ["message", "variant"],
  9179. "additionalProperties": false
  9180. }
  9181. },
  9182. "required": ["id", "type", "properties"],
  9183. "additionalProperties": false
  9184. },
  9185. "Event.tui.session.select": {
  9186. "type": "object",
  9187. "properties": {
  9188. "id": {
  9189. "type": "string"
  9190. },
  9191. "type": {
  9192. "type": "string",
  9193. "enum": ["tui.session.select"]
  9194. },
  9195. "properties": {
  9196. "type": "object",
  9197. "properties": {
  9198. "sessionID": {
  9199. "type": "string",
  9200. "description": "Session ID to navigate to"
  9201. }
  9202. },
  9203. "required": ["sessionID"],
  9204. "additionalProperties": false
  9205. }
  9206. },
  9207. "required": ["id", "type", "properties"],
  9208. "additionalProperties": false
  9209. },
  9210. "Project": {
  9211. "type": "object",
  9212. "properties": {
  9213. "id": {
  9214. "type": "string"
  9215. },
  9216. "worktree": {
  9217. "type": "string"
  9218. },
  9219. "vcs": {
  9220. "type": "string",
  9221. "enum": ["git"]
  9222. },
  9223. "name": {
  9224. "type": "string"
  9225. },
  9226. "icon": {
  9227. "type": "object",
  9228. "properties": {
  9229. "url": {
  9230. "type": "string"
  9231. },
  9232. "override": {
  9233. "type": "string"
  9234. },
  9235. "color": {
  9236. "type": "string"
  9237. }
  9238. },
  9239. "additionalProperties": false
  9240. },
  9241. "commands": {
  9242. "type": "object",
  9243. "properties": {
  9244. "start": {
  9245. "type": "string",
  9246. "description": "Startup script to run when creating a new workspace (worktree)"
  9247. }
  9248. },
  9249. "additionalProperties": false
  9250. },
  9251. "time": {
  9252. "type": "object",
  9253. "properties": {
  9254. "created": {
  9255. "type": "integer",
  9256. "minimum": 0
  9257. },
  9258. "updated": {
  9259. "type": "integer",
  9260. "minimum": 0
  9261. },
  9262. "initialized": {
  9263. "type": "integer",
  9264. "minimum": 0
  9265. }
  9266. },
  9267. "required": ["created", "updated"],
  9268. "additionalProperties": false
  9269. },
  9270. "sandboxes": {
  9271. "type": "array",
  9272. "items": {
  9273. "type": "string"
  9274. }
  9275. }
  9276. },
  9277. "required": ["id", "worktree", "time", "sandboxes"],
  9278. "additionalProperties": false
  9279. },
  9280. "Pty": {
  9281. "type": "object",
  9282. "properties": {
  9283. "id": {
  9284. "type": "string"
  9285. },
  9286. "title": {
  9287. "type": "string"
  9288. },
  9289. "command": {
  9290. "type": "string"
  9291. },
  9292. "args": {
  9293. "type": "array",
  9294. "items": {
  9295. "type": "string"
  9296. }
  9297. },
  9298. "cwd": {
  9299. "type": "string"
  9300. },
  9301. "status": {
  9302. "type": "string",
  9303. "enum": ["running", "exited"]
  9304. },
  9305. "pid": {
  9306. "type": "integer",
  9307. "exclusiveMinimum": 0
  9308. }
  9309. },
  9310. "required": ["id", "title", "command", "args", "cwd", "status", "pid"],
  9311. "additionalProperties": false
  9312. },
  9313. "OutputFormatText": {
  9314. "type": "object",
  9315. "properties": {
  9316. "type": {
  9317. "type": "string",
  9318. "enum": ["text"]
  9319. }
  9320. },
  9321. "required": ["type"],
  9322. "additionalProperties": false
  9323. },
  9324. "JSONSchema": {
  9325. "type": "object"
  9326. },
  9327. "OutputFormatJsonSchema": {
  9328. "type": "object",
  9329. "properties": {
  9330. "type": {
  9331. "type": "string",
  9332. "enum": ["json_schema"]
  9333. },
  9334. "schema": {
  9335. "$ref": "#/components/schemas/JSONSchema"
  9336. },
  9337. "retryCount": {
  9338. "type": "integer",
  9339. "minimum": 0
  9340. }
  9341. },
  9342. "required": ["type", "schema"],
  9343. "additionalProperties": false
  9344. },
  9345. "OutputFormat": {
  9346. "anyOf": [
  9347. {
  9348. "$ref": "#/components/schemas/OutputFormatText"
  9349. },
  9350. {
  9351. "$ref": "#/components/schemas/OutputFormatJsonSchema"
  9352. }
  9353. ]
  9354. },
  9355. "UserMessage": {
  9356. "type": "object",
  9357. "properties": {
  9358. "id": {
  9359. "type": "string"
  9360. },
  9361. "sessionID": {
  9362. "type": "string"
  9363. },
  9364. "role": {
  9365. "type": "string",
  9366. "enum": ["user"]
  9367. },
  9368. "time": {
  9369. "type": "object",
  9370. "properties": {
  9371. "created": {
  9372. "type": "integer",
  9373. "minimum": 0
  9374. }
  9375. },
  9376. "required": ["created"],
  9377. "additionalProperties": false
  9378. },
  9379. "format": {
  9380. "$ref": "#/components/schemas/OutputFormat"
  9381. },
  9382. "summary": {
  9383. "type": "object",
  9384. "properties": {
  9385. "title": {
  9386. "type": "string"
  9387. },
  9388. "body": {
  9389. "type": "string"
  9390. },
  9391. "diffs": {
  9392. "type": "array",
  9393. "items": {
  9394. "$ref": "#/components/schemas/SnapshotFileDiff"
  9395. }
  9396. }
  9397. },
  9398. "required": ["diffs"],
  9399. "additionalProperties": false
  9400. },
  9401. "agent": {
  9402. "type": "string"
  9403. },
  9404. "model": {
  9405. "type": "object",
  9406. "properties": {
  9407. "providerID": {
  9408. "type": "string"
  9409. },
  9410. "modelID": {
  9411. "type": "string"
  9412. },
  9413. "variant": {
  9414. "type": "string"
  9415. }
  9416. },
  9417. "required": ["providerID", "modelID"],
  9418. "additionalProperties": false
  9419. },
  9420. "system": {
  9421. "type": "string"
  9422. },
  9423. "tools": {
  9424. "type": "object",
  9425. "additionalProperties": {
  9426. "type": "boolean"
  9427. }
  9428. }
  9429. },
  9430. "required": ["id", "sessionID", "role", "time", "agent", "model"],
  9431. "additionalProperties": false
  9432. },
  9433. "AssistantMessage": {
  9434. "type": "object",
  9435. "properties": {
  9436. "id": {
  9437. "type": "string"
  9438. },
  9439. "sessionID": {
  9440. "type": "string"
  9441. },
  9442. "role": {
  9443. "type": "string",
  9444. "enum": ["assistant"]
  9445. },
  9446. "time": {
  9447. "type": "object",
  9448. "properties": {
  9449. "created": {
  9450. "type": "integer",
  9451. "minimum": 0
  9452. },
  9453. "completed": {
  9454. "type": "integer",
  9455. "minimum": 0
  9456. }
  9457. },
  9458. "required": ["created"],
  9459. "additionalProperties": false
  9460. },
  9461. "error": {
  9462. "anyOf": [
  9463. {
  9464. "$ref": "#/components/schemas/ProviderAuthError"
  9465. },
  9466. {
  9467. "$ref": "#/components/schemas/UnknownError"
  9468. },
  9469. {
  9470. "$ref": "#/components/schemas/MessageOutputLengthError"
  9471. },
  9472. {
  9473. "$ref": "#/components/schemas/MessageAbortedError"
  9474. },
  9475. {
  9476. "$ref": "#/components/schemas/StructuredOutputError"
  9477. },
  9478. {
  9479. "$ref": "#/components/schemas/ContextOverflowError"
  9480. },
  9481. {
  9482. "$ref": "#/components/schemas/APIError"
  9483. }
  9484. ]
  9485. },
  9486. "parentID": {
  9487. "type": "string"
  9488. },
  9489. "modelID": {
  9490. "type": "string"
  9491. },
  9492. "providerID": {
  9493. "type": "string"
  9494. },
  9495. "mode": {
  9496. "type": "string"
  9497. },
  9498. "agent": {
  9499. "type": "string"
  9500. },
  9501. "path": {
  9502. "type": "object",
  9503. "properties": {
  9504. "cwd": {
  9505. "type": "string"
  9506. },
  9507. "root": {
  9508. "type": "string"
  9509. }
  9510. },
  9511. "required": ["cwd", "root"],
  9512. "additionalProperties": false
  9513. },
  9514. "summary": {
  9515. "type": "boolean"
  9516. },
  9517. "cost": {
  9518. "type": "number"
  9519. },
  9520. "tokens": {
  9521. "type": "object",
  9522. "properties": {
  9523. "total": {
  9524. "type": "integer",
  9525. "minimum": 0
  9526. },
  9527. "input": {
  9528. "type": "integer",
  9529. "minimum": 0
  9530. },
  9531. "output": {
  9532. "type": "integer",
  9533. "minimum": 0
  9534. },
  9535. "reasoning": {
  9536. "type": "integer",
  9537. "minimum": 0
  9538. },
  9539. "cache": {
  9540. "type": "object",
  9541. "properties": {
  9542. "read": {
  9543. "type": "integer",
  9544. "minimum": 0
  9545. },
  9546. "write": {
  9547. "type": "integer",
  9548. "minimum": 0
  9549. }
  9550. },
  9551. "required": ["read", "write"],
  9552. "additionalProperties": false
  9553. }
  9554. },
  9555. "required": ["input", "output", "reasoning", "cache"],
  9556. "additionalProperties": false
  9557. },
  9558. "structured": {},
  9559. "variant": {
  9560. "type": "string"
  9561. },
  9562. "finish": {
  9563. "type": "string"
  9564. }
  9565. },
  9566. "required": [
  9567. "id",
  9568. "sessionID",
  9569. "role",
  9570. "time",
  9571. "parentID",
  9572. "modelID",
  9573. "providerID",
  9574. "mode",
  9575. "agent",
  9576. "path",
  9577. "cost",
  9578. "tokens"
  9579. ],
  9580. "additionalProperties": false
  9581. },
  9582. "Message": {
  9583. "anyOf": [
  9584. {
  9585. "$ref": "#/components/schemas/UserMessage"
  9586. },
  9587. {
  9588. "$ref": "#/components/schemas/AssistantMessage"
  9589. }
  9590. ]
  9591. },
  9592. "TextPart": {
  9593. "type": "object",
  9594. "properties": {
  9595. "id": {
  9596. "type": "string"
  9597. },
  9598. "sessionID": {
  9599. "type": "string"
  9600. },
  9601. "messageID": {
  9602. "type": "string"
  9603. },
  9604. "type": {
  9605. "type": "string",
  9606. "enum": ["text"]
  9607. },
  9608. "text": {
  9609. "type": "string"
  9610. },
  9611. "synthetic": {
  9612. "type": "boolean"
  9613. },
  9614. "ignored": {
  9615. "type": "boolean"
  9616. },
  9617. "time": {
  9618. "type": "object",
  9619. "properties": {
  9620. "start": {
  9621. "type": "integer",
  9622. "minimum": 0
  9623. },
  9624. "end": {
  9625. "type": "integer",
  9626. "minimum": 0
  9627. }
  9628. },
  9629. "required": ["start"],
  9630. "additionalProperties": false
  9631. },
  9632. "metadata": {
  9633. "type": "object"
  9634. }
  9635. },
  9636. "required": ["id", "sessionID", "messageID", "type", "text"],
  9637. "additionalProperties": false
  9638. },
  9639. "SubtaskPart": {
  9640. "type": "object",
  9641. "properties": {
  9642. "id": {
  9643. "type": "string"
  9644. },
  9645. "sessionID": {
  9646. "type": "string"
  9647. },
  9648. "messageID": {
  9649. "type": "string"
  9650. },
  9651. "type": {
  9652. "type": "string",
  9653. "enum": ["subtask"]
  9654. },
  9655. "prompt": {
  9656. "type": "string"
  9657. },
  9658. "description": {
  9659. "type": "string"
  9660. },
  9661. "agent": {
  9662. "type": "string"
  9663. },
  9664. "model": {
  9665. "type": "object",
  9666. "properties": {
  9667. "providerID": {
  9668. "type": "string"
  9669. },
  9670. "modelID": {
  9671. "type": "string"
  9672. }
  9673. },
  9674. "required": ["providerID", "modelID"],
  9675. "additionalProperties": false
  9676. },
  9677. "command": {
  9678. "type": "string"
  9679. }
  9680. },
  9681. "required": ["id", "sessionID", "messageID", "type", "prompt", "description", "agent"],
  9682. "additionalProperties": false
  9683. },
  9684. "ReasoningPart": {
  9685. "type": "object",
  9686. "properties": {
  9687. "id": {
  9688. "type": "string"
  9689. },
  9690. "sessionID": {
  9691. "type": "string"
  9692. },
  9693. "messageID": {
  9694. "type": "string"
  9695. },
  9696. "type": {
  9697. "type": "string",
  9698. "enum": ["reasoning"]
  9699. },
  9700. "text": {
  9701. "type": "string"
  9702. },
  9703. "metadata": {
  9704. "type": "object"
  9705. },
  9706. "time": {
  9707. "type": "object",
  9708. "properties": {
  9709. "start": {
  9710. "type": "integer",
  9711. "minimum": 0
  9712. },
  9713. "end": {
  9714. "type": "integer",
  9715. "minimum": 0
  9716. }
  9717. },
  9718. "required": ["start"],
  9719. "additionalProperties": false
  9720. }
  9721. },
  9722. "required": ["id", "sessionID", "messageID", "type", "text", "time"],
  9723. "additionalProperties": false
  9724. },
  9725. "FilePartSourceText": {
  9726. "type": "object",
  9727. "properties": {
  9728. "value": {
  9729. "type": "string"
  9730. },
  9731. "start": {
  9732. "type": "integer",
  9733. "minimum": 0
  9734. },
  9735. "end": {
  9736. "type": "integer",
  9737. "minimum": 0
  9738. }
  9739. },
  9740. "required": ["value", "start", "end"],
  9741. "additionalProperties": false
  9742. },
  9743. "FileSource": {
  9744. "type": "object",
  9745. "properties": {
  9746. "text": {
  9747. "$ref": "#/components/schemas/FilePartSourceText"
  9748. },
  9749. "type": {
  9750. "type": "string",
  9751. "enum": ["file"]
  9752. },
  9753. "path": {
  9754. "type": "string"
  9755. }
  9756. },
  9757. "required": ["text", "type", "path"],
  9758. "additionalProperties": false
  9759. },
  9760. "Range": {
  9761. "type": "object",
  9762. "properties": {
  9763. "start": {
  9764. "type": "object",
  9765. "properties": {
  9766. "line": {
  9767. "type": "integer",
  9768. "minimum": 0
  9769. },
  9770. "character": {
  9771. "type": "integer",
  9772. "minimum": 0
  9773. }
  9774. },
  9775. "required": ["line", "character"],
  9776. "additionalProperties": false
  9777. },
  9778. "end": {
  9779. "type": "object",
  9780. "properties": {
  9781. "line": {
  9782. "type": "integer",
  9783. "minimum": 0
  9784. },
  9785. "character": {
  9786. "type": "integer",
  9787. "minimum": 0
  9788. }
  9789. },
  9790. "required": ["line", "character"],
  9791. "additionalProperties": false
  9792. }
  9793. },
  9794. "required": ["start", "end"],
  9795. "additionalProperties": false
  9796. },
  9797. "SymbolSource": {
  9798. "type": "object",
  9799. "properties": {
  9800. "text": {
  9801. "$ref": "#/components/schemas/FilePartSourceText"
  9802. },
  9803. "type": {
  9804. "type": "string",
  9805. "enum": ["symbol"]
  9806. },
  9807. "path": {
  9808. "type": "string"
  9809. },
  9810. "range": {
  9811. "$ref": "#/components/schemas/Range"
  9812. },
  9813. "name": {
  9814. "type": "string"
  9815. },
  9816. "kind": {
  9817. "type": "integer",
  9818. "minimum": 0
  9819. }
  9820. },
  9821. "required": ["text", "type", "path", "range", "name", "kind"],
  9822. "additionalProperties": false
  9823. },
  9824. "ResourceSource": {
  9825. "type": "object",
  9826. "properties": {
  9827. "text": {
  9828. "$ref": "#/components/schemas/FilePartSourceText"
  9829. },
  9830. "type": {
  9831. "type": "string",
  9832. "enum": ["resource"]
  9833. },
  9834. "clientName": {
  9835. "type": "string"
  9836. },
  9837. "uri": {
  9838. "type": "string"
  9839. }
  9840. },
  9841. "required": ["text", "type", "clientName", "uri"],
  9842. "additionalProperties": false
  9843. },
  9844. "FilePartSource": {
  9845. "anyOf": [
  9846. {
  9847. "$ref": "#/components/schemas/FileSource"
  9848. },
  9849. {
  9850. "$ref": "#/components/schemas/SymbolSource"
  9851. },
  9852. {
  9853. "$ref": "#/components/schemas/ResourceSource"
  9854. }
  9855. ]
  9856. },
  9857. "FilePart": {
  9858. "type": "object",
  9859. "properties": {
  9860. "id": {
  9861. "type": "string"
  9862. },
  9863. "sessionID": {
  9864. "type": "string"
  9865. },
  9866. "messageID": {
  9867. "type": "string"
  9868. },
  9869. "type": {
  9870. "type": "string",
  9871. "enum": ["file"]
  9872. },
  9873. "mime": {
  9874. "type": "string"
  9875. },
  9876. "filename": {
  9877. "type": "string"
  9878. },
  9879. "url": {
  9880. "type": "string"
  9881. },
  9882. "source": {
  9883. "$ref": "#/components/schemas/FilePartSource"
  9884. }
  9885. },
  9886. "required": ["id", "sessionID", "messageID", "type", "mime", "url"],
  9887. "additionalProperties": false
  9888. },
  9889. "ToolStatePending": {
  9890. "type": "object",
  9891. "properties": {
  9892. "status": {
  9893. "type": "string",
  9894. "enum": ["pending"]
  9895. },
  9896. "input": {
  9897. "type": "object"
  9898. },
  9899. "raw": {
  9900. "type": "string"
  9901. }
  9902. },
  9903. "required": ["status", "input", "raw"],
  9904. "additionalProperties": false
  9905. },
  9906. "ToolStateRunning": {
  9907. "type": "object",
  9908. "properties": {
  9909. "status": {
  9910. "type": "string",
  9911. "enum": ["running"]
  9912. },
  9913. "input": {
  9914. "type": "object"
  9915. },
  9916. "title": {
  9917. "type": "string"
  9918. },
  9919. "metadata": {
  9920. "type": "object"
  9921. },
  9922. "time": {
  9923. "type": "object",
  9924. "properties": {
  9925. "start": {
  9926. "type": "integer",
  9927. "minimum": 0
  9928. }
  9929. },
  9930. "required": ["start"],
  9931. "additionalProperties": false
  9932. }
  9933. },
  9934. "required": ["status", "input", "time"],
  9935. "additionalProperties": false
  9936. },
  9937. "ToolStateCompleted": {
  9938. "type": "object",
  9939. "properties": {
  9940. "status": {
  9941. "type": "string",
  9942. "enum": ["completed"]
  9943. },
  9944. "input": {
  9945. "type": "object"
  9946. },
  9947. "output": {
  9948. "type": "string"
  9949. },
  9950. "title": {
  9951. "type": "string"
  9952. },
  9953. "metadata": {
  9954. "type": "object"
  9955. },
  9956. "time": {
  9957. "type": "object",
  9958. "properties": {
  9959. "start": {
  9960. "type": "integer",
  9961. "minimum": 0
  9962. },
  9963. "end": {
  9964. "type": "integer",
  9965. "minimum": 0
  9966. },
  9967. "compacted": {
  9968. "type": "integer",
  9969. "minimum": 0
  9970. }
  9971. },
  9972. "required": ["start", "end"],
  9973. "additionalProperties": false
  9974. },
  9975. "attachments": {
  9976. "type": "array",
  9977. "items": {
  9978. "$ref": "#/components/schemas/FilePart"
  9979. }
  9980. }
  9981. },
  9982. "required": ["status", "input", "output", "title", "metadata", "time"],
  9983. "additionalProperties": false
  9984. },
  9985. "ToolStateError": {
  9986. "type": "object",
  9987. "properties": {
  9988. "status": {
  9989. "type": "string",
  9990. "enum": ["error"]
  9991. },
  9992. "input": {
  9993. "type": "object"
  9994. },
  9995. "error": {
  9996. "type": "string"
  9997. },
  9998. "metadata": {
  9999. "type": "object"
  10000. },
  10001. "time": {
  10002. "type": "object",
  10003. "properties": {
  10004. "start": {
  10005. "type": "integer",
  10006. "minimum": 0
  10007. },
  10008. "end": {
  10009. "type": "integer",
  10010. "minimum": 0
  10011. }
  10012. },
  10013. "required": ["start", "end"],
  10014. "additionalProperties": false
  10015. }
  10016. },
  10017. "required": ["status", "input", "error", "time"],
  10018. "additionalProperties": false
  10019. },
  10020. "ToolState": {
  10021. "anyOf": [
  10022. {
  10023. "$ref": "#/components/schemas/ToolStatePending"
  10024. },
  10025. {
  10026. "$ref": "#/components/schemas/ToolStateRunning"
  10027. },
  10028. {
  10029. "$ref": "#/components/schemas/ToolStateCompleted"
  10030. },
  10031. {
  10032. "$ref": "#/components/schemas/ToolStateError"
  10033. }
  10034. ]
  10035. },
  10036. "ToolPart": {
  10037. "type": "object",
  10038. "properties": {
  10039. "id": {
  10040. "type": "string"
  10041. },
  10042. "sessionID": {
  10043. "type": "string"
  10044. },
  10045. "messageID": {
  10046. "type": "string"
  10047. },
  10048. "type": {
  10049. "type": "string",
  10050. "enum": ["tool"]
  10051. },
  10052. "callID": {
  10053. "type": "string"
  10054. },
  10055. "tool": {
  10056. "type": "string"
  10057. },
  10058. "state": {
  10059. "$ref": "#/components/schemas/ToolState"
  10060. },
  10061. "metadata": {
  10062. "type": "object"
  10063. }
  10064. },
  10065. "required": ["id", "sessionID", "messageID", "type", "callID", "tool", "state"],
  10066. "additionalProperties": false
  10067. },
  10068. "StepStartPart": {
  10069. "type": "object",
  10070. "properties": {
  10071. "id": {
  10072. "type": "string"
  10073. },
  10074. "sessionID": {
  10075. "type": "string"
  10076. },
  10077. "messageID": {
  10078. "type": "string"
  10079. },
  10080. "type": {
  10081. "type": "string",
  10082. "enum": ["step-start"]
  10083. },
  10084. "snapshot": {
  10085. "type": "string"
  10086. }
  10087. },
  10088. "required": ["id", "sessionID", "messageID", "type"],
  10089. "additionalProperties": false
  10090. },
  10091. "StepFinishPart": {
  10092. "type": "object",
  10093. "properties": {
  10094. "id": {
  10095. "type": "string"
  10096. },
  10097. "sessionID": {
  10098. "type": "string"
  10099. },
  10100. "messageID": {
  10101. "type": "string"
  10102. },
  10103. "type": {
  10104. "type": "string",
  10105. "enum": ["step-finish"]
  10106. },
  10107. "reason": {
  10108. "type": "string"
  10109. },
  10110. "snapshot": {
  10111. "type": "string"
  10112. },
  10113. "cost": {
  10114. "type": "number"
  10115. },
  10116. "tokens": {
  10117. "type": "object",
  10118. "properties": {
  10119. "total": {
  10120. "type": "integer",
  10121. "minimum": 0
  10122. },
  10123. "input": {
  10124. "type": "integer",
  10125. "minimum": 0
  10126. },
  10127. "output": {
  10128. "type": "integer",
  10129. "minimum": 0
  10130. },
  10131. "reasoning": {
  10132. "type": "integer",
  10133. "minimum": 0
  10134. },
  10135. "cache": {
  10136. "type": "object",
  10137. "properties": {
  10138. "read": {
  10139. "type": "integer",
  10140. "minimum": 0
  10141. },
  10142. "write": {
  10143. "type": "integer",
  10144. "minimum": 0
  10145. }
  10146. },
  10147. "required": ["read", "write"],
  10148. "additionalProperties": false
  10149. }
  10150. },
  10151. "required": ["input", "output", "reasoning", "cache"],
  10152. "additionalProperties": false
  10153. }
  10154. },
  10155. "required": ["id", "sessionID", "messageID", "type", "reason", "cost", "tokens"],
  10156. "additionalProperties": false
  10157. },
  10158. "SnapshotPart": {
  10159. "type": "object",
  10160. "properties": {
  10161. "id": {
  10162. "type": "string"
  10163. },
  10164. "sessionID": {
  10165. "type": "string"
  10166. },
  10167. "messageID": {
  10168. "type": "string"
  10169. },
  10170. "type": {
  10171. "type": "string",
  10172. "enum": ["snapshot"]
  10173. },
  10174. "snapshot": {
  10175. "type": "string"
  10176. }
  10177. },
  10178. "required": ["id", "sessionID", "messageID", "type", "snapshot"],
  10179. "additionalProperties": false
  10180. },
  10181. "PatchPart": {
  10182. "type": "object",
  10183. "properties": {
  10184. "id": {
  10185. "type": "string"
  10186. },
  10187. "sessionID": {
  10188. "type": "string"
  10189. },
  10190. "messageID": {
  10191. "type": "string"
  10192. },
  10193. "type": {
  10194. "type": "string",
  10195. "enum": ["patch"]
  10196. },
  10197. "hash": {
  10198. "type": "string"
  10199. },
  10200. "files": {
  10201. "type": "array",
  10202. "items": {
  10203. "type": "string"
  10204. }
  10205. }
  10206. },
  10207. "required": ["id", "sessionID", "messageID", "type", "hash", "files"],
  10208. "additionalProperties": false
  10209. },
  10210. "AgentPart": {
  10211. "type": "object",
  10212. "properties": {
  10213. "id": {
  10214. "type": "string"
  10215. },
  10216. "sessionID": {
  10217. "type": "string"
  10218. },
  10219. "messageID": {
  10220. "type": "string"
  10221. },
  10222. "type": {
  10223. "type": "string",
  10224. "enum": ["agent"]
  10225. },
  10226. "name": {
  10227. "type": "string"
  10228. },
  10229. "source": {
  10230. "type": "object",
  10231. "properties": {
  10232. "value": {
  10233. "type": "string"
  10234. },
  10235. "start": {
  10236. "type": "integer",
  10237. "minimum": 0
  10238. },
  10239. "end": {
  10240. "type": "integer",
  10241. "minimum": 0
  10242. }
  10243. },
  10244. "required": ["value", "start", "end"],
  10245. "additionalProperties": false
  10246. }
  10247. },
  10248. "required": ["id", "sessionID", "messageID", "type", "name"],
  10249. "additionalProperties": false
  10250. },
  10251. "RetryPart": {
  10252. "type": "object",
  10253. "properties": {
  10254. "id": {
  10255. "type": "string"
  10256. },
  10257. "sessionID": {
  10258. "type": "string"
  10259. },
  10260. "messageID": {
  10261. "type": "string"
  10262. },
  10263. "type": {
  10264. "type": "string",
  10265. "enum": ["retry"]
  10266. },
  10267. "attempt": {
  10268. "type": "integer",
  10269. "minimum": 0
  10270. },
  10271. "error": {
  10272. "$ref": "#/components/schemas/APIError"
  10273. },
  10274. "time": {
  10275. "type": "object",
  10276. "properties": {
  10277. "created": {
  10278. "type": "integer",
  10279. "minimum": 0
  10280. }
  10281. },
  10282. "required": ["created"],
  10283. "additionalProperties": false
  10284. }
  10285. },
  10286. "required": ["id", "sessionID", "messageID", "type", "attempt", "error", "time"],
  10287. "additionalProperties": false
  10288. },
  10289. "CompactionPart": {
  10290. "type": "object",
  10291. "properties": {
  10292. "id": {
  10293. "type": "string"
  10294. },
  10295. "sessionID": {
  10296. "type": "string"
  10297. },
  10298. "messageID": {
  10299. "type": "string"
  10300. },
  10301. "type": {
  10302. "type": "string",
  10303. "enum": ["compaction"]
  10304. },
  10305. "auto": {
  10306. "type": "boolean"
  10307. },
  10308. "overflow": {
  10309. "type": "boolean"
  10310. },
  10311. "tail_start_id": {
  10312. "type": "string"
  10313. }
  10314. },
  10315. "required": ["id", "sessionID", "messageID", "type", "auto"],
  10316. "additionalProperties": false
  10317. },
  10318. "Part": {
  10319. "anyOf": [
  10320. {
  10321. "$ref": "#/components/schemas/TextPart"
  10322. },
  10323. {
  10324. "$ref": "#/components/schemas/SubtaskPart"
  10325. },
  10326. {
  10327. "$ref": "#/components/schemas/ReasoningPart"
  10328. },
  10329. {
  10330. "$ref": "#/components/schemas/FilePart"
  10331. },
  10332. {
  10333. "$ref": "#/components/schemas/ToolPart"
  10334. },
  10335. {
  10336. "$ref": "#/components/schemas/StepStartPart"
  10337. },
  10338. {
  10339. "$ref": "#/components/schemas/StepFinishPart"
  10340. },
  10341. {
  10342. "$ref": "#/components/schemas/SnapshotPart"
  10343. },
  10344. {
  10345. "$ref": "#/components/schemas/PatchPart"
  10346. },
  10347. {
  10348. "$ref": "#/components/schemas/AgentPart"
  10349. },
  10350. {
  10351. "$ref": "#/components/schemas/RetryPart"
  10352. },
  10353. {
  10354. "$ref": "#/components/schemas/CompactionPart"
  10355. }
  10356. ]
  10357. },
  10358. "PermissionAction": {
  10359. "type": "string",
  10360. "enum": ["allow", "deny", "ask"]
  10361. },
  10362. "PermissionRule": {
  10363. "type": "object",
  10364. "properties": {
  10365. "permission": {
  10366. "type": "string"
  10367. },
  10368. "pattern": {
  10369. "type": "string"
  10370. },
  10371. "action": {
  10372. "$ref": "#/components/schemas/PermissionAction"
  10373. }
  10374. },
  10375. "required": ["permission", "pattern", "action"],
  10376. "additionalProperties": false
  10377. },
  10378. "PermissionRuleset": {
  10379. "type": "array",
  10380. "items": {
  10381. "$ref": "#/components/schemas/PermissionRule"
  10382. }
  10383. },
  10384. "Session": {
  10385. "type": "object",
  10386. "properties": {
  10387. "id": {
  10388. "type": "string"
  10389. },
  10390. "slug": {
  10391. "type": "string"
  10392. },
  10393. "projectID": {
  10394. "type": "string"
  10395. },
  10396. "workspaceID": {
  10397. "type": "string"
  10398. },
  10399. "directory": {
  10400. "type": "string"
  10401. },
  10402. "path": {
  10403. "type": "string"
  10404. },
  10405. "parentID": {
  10406. "type": "string"
  10407. },
  10408. "summary": {
  10409. "type": "object",
  10410. "properties": {
  10411. "additions": {
  10412. "type": "integer",
  10413. "minimum": 0
  10414. },
  10415. "deletions": {
  10416. "type": "integer",
  10417. "minimum": 0
  10418. },
  10419. "files": {
  10420. "type": "integer",
  10421. "minimum": 0
  10422. },
  10423. "diffs": {
  10424. "type": "array",
  10425. "items": {
  10426. "$ref": "#/components/schemas/SnapshotFileDiff"
  10427. }
  10428. }
  10429. },
  10430. "required": ["additions", "deletions", "files"],
  10431. "additionalProperties": false
  10432. },
  10433. "share": {
  10434. "type": "object",
  10435. "properties": {
  10436. "url": {
  10437. "type": "string"
  10438. }
  10439. },
  10440. "required": ["url"],
  10441. "additionalProperties": false
  10442. },
  10443. "title": {
  10444. "type": "string"
  10445. },
  10446. "agent": {
  10447. "type": "string"
  10448. },
  10449. "model": {
  10450. "type": "object",
  10451. "properties": {
  10452. "id": {
  10453. "type": "string"
  10454. },
  10455. "providerID": {
  10456. "type": "string"
  10457. },
  10458. "variant": {
  10459. "type": "string"
  10460. }
  10461. },
  10462. "required": ["id", "providerID"],
  10463. "additionalProperties": false
  10464. },
  10465. "version": {
  10466. "type": "string"
  10467. },
  10468. "time": {
  10469. "type": "object",
  10470. "properties": {
  10471. "created": {
  10472. "type": "integer",
  10473. "minimum": 0
  10474. },
  10475. "updated": {
  10476. "type": "integer",
  10477. "minimum": 0
  10478. },
  10479. "compacting": {
  10480. "type": "integer",
  10481. "minimum": 0
  10482. },
  10483. "archived": {
  10484. "type": "number"
  10485. }
  10486. },
  10487. "required": ["created", "updated"],
  10488. "additionalProperties": false
  10489. },
  10490. "permission": {
  10491. "$ref": "#/components/schemas/PermissionRuleset"
  10492. },
  10493. "revert": {
  10494. "type": "object",
  10495. "properties": {
  10496. "messageID": {
  10497. "type": "string"
  10498. },
  10499. "partID": {
  10500. "type": "string"
  10501. },
  10502. "snapshot": {
  10503. "type": "string"
  10504. },
  10505. "diff": {
  10506. "type": "string"
  10507. }
  10508. },
  10509. "required": ["messageID"],
  10510. "additionalProperties": false
  10511. }
  10512. },
  10513. "required": ["id", "slug", "projectID", "directory", "title", "version", "time"],
  10514. "additionalProperties": false
  10515. },
  10516. "Prompt": {
  10517. "type": "object",
  10518. "properties": {
  10519. "text": {
  10520. "type": "string"
  10521. },
  10522. "files": {
  10523. "type": "array",
  10524. "items": {
  10525. "$ref": "#/components/schemas/PromptFileAttachment"
  10526. }
  10527. },
  10528. "agents": {
  10529. "type": "array",
  10530. "items": {
  10531. "$ref": "#/components/schemas/PromptAgentAttachment"
  10532. }
  10533. }
  10534. },
  10535. "required": ["text"],
  10536. "additionalProperties": false
  10537. },
  10538. "GlobalEvent": {
  10539. "type": "object",
  10540. "properties": {
  10541. "directory": {
  10542. "type": "string"
  10543. },
  10544. "project": {
  10545. "type": "string"
  10546. },
  10547. "workspace": {
  10548. "type": "string"
  10549. },
  10550. "payload": {
  10551. "anyOf": [
  10552. {
  10553. "$ref": "#/components/schemas/EventServerInstanceDisposed"
  10554. },
  10555. {
  10556. "$ref": "#/components/schemas/EventFileEdited"
  10557. },
  10558. {
  10559. "$ref": "#/components/schemas/EventFileWatcherUpdated"
  10560. },
  10561. {
  10562. "$ref": "#/components/schemas/EventLspClientDiagnostics"
  10563. },
  10564. {
  10565. "$ref": "#/components/schemas/EventLspUpdated"
  10566. },
  10567. {
  10568. "$ref": "#/components/schemas/EventMessagePartDelta"
  10569. },
  10570. {
  10571. "$ref": "#/components/schemas/EventPermissionAsked"
  10572. },
  10573. {
  10574. "$ref": "#/components/schemas/EventPermissionReplied"
  10575. },
  10576. {
  10577. "$ref": "#/components/schemas/EventSessionDiff"
  10578. },
  10579. {
  10580. "$ref": "#/components/schemas/EventSessionError"
  10581. },
  10582. {
  10583. "$ref": "#/components/schemas/EventInstallationUpdated"
  10584. },
  10585. {
  10586. "$ref": "#/components/schemas/EventInstallationUpdate-available"
  10587. },
  10588. {
  10589. "$ref": "#/components/schemas/EventQuestionAsked"
  10590. },
  10591. {
  10592. "$ref": "#/components/schemas/EventQuestionReplied"
  10593. },
  10594. {
  10595. "$ref": "#/components/schemas/EventQuestionRejected"
  10596. },
  10597. {
  10598. "$ref": "#/components/schemas/EventTodoUpdated"
  10599. },
  10600. {
  10601. "$ref": "#/components/schemas/EventSessionStatus"
  10602. },
  10603. {
  10604. "$ref": "#/components/schemas/EventSessionIdle"
  10605. },
  10606. {
  10607. "$ref": "#/components/schemas/EventSessionCompacted"
  10608. },
  10609. {
  10610. "$ref": "#/components/schemas/Event.tui.prompt.append"
  10611. },
  10612. {
  10613. "$ref": "#/components/schemas/Event.tui.command.execute"
  10614. },
  10615. {
  10616. "$ref": "#/components/schemas/Event.tui.toast.show"
  10617. },
  10618. {
  10619. "$ref": "#/components/schemas/Event.tui.session.select"
  10620. },
  10621. {
  10622. "$ref": "#/components/schemas/EventMcpToolsChanged"
  10623. },
  10624. {
  10625. "$ref": "#/components/schemas/EventMcpBrowserOpenFailed"
  10626. },
  10627. {
  10628. "$ref": "#/components/schemas/EventCommandExecuted"
  10629. },
  10630. {
  10631. "$ref": "#/components/schemas/EventProjectUpdated"
  10632. },
  10633. {
  10634. "$ref": "#/components/schemas/EventVcsBranchUpdated"
  10635. },
  10636. {
  10637. "$ref": "#/components/schemas/EventWorkspaceReady"
  10638. },
  10639. {
  10640. "$ref": "#/components/schemas/EventWorkspaceFailed"
  10641. },
  10642. {
  10643. "$ref": "#/components/schemas/EventWorkspaceRestore"
  10644. },
  10645. {
  10646. "$ref": "#/components/schemas/EventWorkspaceStatus"
  10647. },
  10648. {
  10649. "$ref": "#/components/schemas/EventWorktreeReady"
  10650. },
  10651. {
  10652. "$ref": "#/components/schemas/EventWorktreeFailed"
  10653. },
  10654. {
  10655. "$ref": "#/components/schemas/EventPtyCreated"
  10656. },
  10657. {
  10658. "$ref": "#/components/schemas/EventPtyUpdated"
  10659. },
  10660. {
  10661. "$ref": "#/components/schemas/EventPtyExited"
  10662. },
  10663. {
  10664. "$ref": "#/components/schemas/EventPtyDeleted"
  10665. },
  10666. {
  10667. "$ref": "#/components/schemas/EventMessageUpdated"
  10668. },
  10669. {
  10670. "$ref": "#/components/schemas/EventMessageRemoved"
  10671. },
  10672. {
  10673. "$ref": "#/components/schemas/EventMessagePartUpdated"
  10674. },
  10675. {
  10676. "$ref": "#/components/schemas/EventMessagePartRemoved"
  10677. },
  10678. {
  10679. "$ref": "#/components/schemas/EventSessionCreated"
  10680. },
  10681. {
  10682. "$ref": "#/components/schemas/EventSessionUpdated"
  10683. },
  10684. {
  10685. "$ref": "#/components/schemas/EventSessionDeleted"
  10686. },
  10687. {
  10688. "$ref": "#/components/schemas/EventSessionNextAgentSwitched"
  10689. },
  10690. {
  10691. "$ref": "#/components/schemas/EventSessionNextModelSwitched"
  10692. },
  10693. {
  10694. "$ref": "#/components/schemas/EventSessionNextPrompted"
  10695. },
  10696. {
  10697. "$ref": "#/components/schemas/EventSessionNextSynthetic"
  10698. },
  10699. {
  10700. "$ref": "#/components/schemas/EventSessionNextShellStarted"
  10701. },
  10702. {
  10703. "$ref": "#/components/schemas/EventSessionNextShellEnded"
  10704. },
  10705. {
  10706. "$ref": "#/components/schemas/EventSessionNextStepStarted"
  10707. },
  10708. {
  10709. "$ref": "#/components/schemas/EventSessionNextStepEnded"
  10710. },
  10711. {
  10712. "$ref": "#/components/schemas/EventSessionNextTextStarted"
  10713. },
  10714. {
  10715. "$ref": "#/components/schemas/EventSessionNextTextDelta"
  10716. },
  10717. {
  10718. "$ref": "#/components/schemas/EventSessionNextTextEnded"
  10719. },
  10720. {
  10721. "$ref": "#/components/schemas/EventSessionNextReasoningStarted"
  10722. },
  10723. {
  10724. "$ref": "#/components/schemas/EventSessionNextReasoningDelta"
  10725. },
  10726. {
  10727. "$ref": "#/components/schemas/EventSessionNextReasoningEnded"
  10728. },
  10729. {
  10730. "$ref": "#/components/schemas/EventSessionNextToolInputStarted"
  10731. },
  10732. {
  10733. "$ref": "#/components/schemas/EventSessionNextToolInputDelta"
  10734. },
  10735. {
  10736. "$ref": "#/components/schemas/EventSessionNextToolInputEnded"
  10737. },
  10738. {
  10739. "$ref": "#/components/schemas/EventSessionNextToolCalled"
  10740. },
  10741. {
  10742. "$ref": "#/components/schemas/EventSessionNextToolProgress"
  10743. },
  10744. {
  10745. "$ref": "#/components/schemas/EventSessionNextToolSuccess"
  10746. },
  10747. {
  10748. "$ref": "#/components/schemas/EventSessionNextToolError"
  10749. },
  10750. {
  10751. "$ref": "#/components/schemas/EventSessionNextRetried"
  10752. },
  10753. {
  10754. "$ref": "#/components/schemas/EventSessionNextCompactionStarted"
  10755. },
  10756. {
  10757. "$ref": "#/components/schemas/EventSessionNextCompactionDelta"
  10758. },
  10759. {
  10760. "$ref": "#/components/schemas/EventSessionNextCompactionEnded"
  10761. },
  10762. {
  10763. "$ref": "#/components/schemas/EventServerConnected"
  10764. },
  10765. {
  10766. "$ref": "#/components/schemas/EventGlobalDisposed"
  10767. },
  10768. {
  10769. "$ref": "#/components/schemas/SyncEventMessageUpdated"
  10770. },
  10771. {
  10772. "$ref": "#/components/schemas/SyncEventMessageRemoved"
  10773. },
  10774. {
  10775. "$ref": "#/components/schemas/SyncEventMessagePartUpdated"
  10776. },
  10777. {
  10778. "$ref": "#/components/schemas/SyncEventMessagePartRemoved"
  10779. },
  10780. {
  10781. "$ref": "#/components/schemas/SyncEventSessionCreated"
  10782. },
  10783. {
  10784. "$ref": "#/components/schemas/SyncEventSessionUpdated"
  10785. },
  10786. {
  10787. "$ref": "#/components/schemas/SyncEventSessionDeleted"
  10788. },
  10789. {
  10790. "$ref": "#/components/schemas/SyncEventSessionNextAgentSwitched"
  10791. },
  10792. {
  10793. "$ref": "#/components/schemas/SyncEventSessionNextModelSwitched"
  10794. },
  10795. {
  10796. "$ref": "#/components/schemas/SyncEventSessionNextPrompted"
  10797. },
  10798. {
  10799. "$ref": "#/components/schemas/SyncEventSessionNextSynthetic"
  10800. },
  10801. {
  10802. "$ref": "#/components/schemas/SyncEventSessionNextShellStarted"
  10803. },
  10804. {
  10805. "$ref": "#/components/schemas/SyncEventSessionNextShellEnded"
  10806. },
  10807. {
  10808. "$ref": "#/components/schemas/SyncEventSessionNextStepStarted"
  10809. },
  10810. {
  10811. "$ref": "#/components/schemas/SyncEventSessionNextStepEnded"
  10812. },
  10813. {
  10814. "$ref": "#/components/schemas/SyncEventSessionNextTextStarted"
  10815. },
  10816. {
  10817. "$ref": "#/components/schemas/SyncEventSessionNextTextDelta"
  10818. },
  10819. {
  10820. "$ref": "#/components/schemas/SyncEventSessionNextTextEnded"
  10821. },
  10822. {
  10823. "$ref": "#/components/schemas/SyncEventSessionNextReasoningStarted"
  10824. },
  10825. {
  10826. "$ref": "#/components/schemas/SyncEventSessionNextReasoningDelta"
  10827. },
  10828. {
  10829. "$ref": "#/components/schemas/SyncEventSessionNextReasoningEnded"
  10830. },
  10831. {
  10832. "$ref": "#/components/schemas/SyncEventSessionNextToolInputStarted"
  10833. },
  10834. {
  10835. "$ref": "#/components/schemas/SyncEventSessionNextToolInputDelta"
  10836. },
  10837. {
  10838. "$ref": "#/components/schemas/SyncEventSessionNextToolInputEnded"
  10839. },
  10840. {
  10841. "$ref": "#/components/schemas/SyncEventSessionNextToolCalled"
  10842. },
  10843. {
  10844. "$ref": "#/components/schemas/SyncEventSessionNextToolProgress"
  10845. },
  10846. {
  10847. "$ref": "#/components/schemas/SyncEventSessionNextToolSuccess"
  10848. },
  10849. {
  10850. "$ref": "#/components/schemas/SyncEventSessionNextToolError"
  10851. },
  10852. {
  10853. "$ref": "#/components/schemas/SyncEventSessionNextRetried"
  10854. },
  10855. {
  10856. "$ref": "#/components/schemas/SyncEventSessionNextCompactionStarted"
  10857. },
  10858. {
  10859. "$ref": "#/components/schemas/SyncEventSessionNextCompactionDelta"
  10860. },
  10861. {
  10862. "$ref": "#/components/schemas/SyncEventSessionNextCompactionEnded"
  10863. }
  10864. ]
  10865. }
  10866. },
  10867. "required": ["directory", "payload"],
  10868. "additionalProperties": false
  10869. },
  10870. "LogLevel": {
  10871. "type": "string",
  10872. "enum": ["DEBUG", "INFO", "WARN", "ERROR"],
  10873. "description": "Log level"
  10874. },
  10875. "ServerConfig": {
  10876. "type": "object",
  10877. "properties": {
  10878. "port": {
  10879. "type": "integer",
  10880. "exclusiveMinimum": 0
  10881. },
  10882. "hostname": {
  10883. "type": "string"
  10884. },
  10885. "mdns": {
  10886. "type": "boolean"
  10887. },
  10888. "mdnsDomain": {
  10889. "type": "string"
  10890. },
  10891. "cors": {
  10892. "type": "array",
  10893. "items": {
  10894. "type": "string"
  10895. }
  10896. }
  10897. },
  10898. "additionalProperties": false,
  10899. "description": "Server configuration for opencode serve and web commands"
  10900. },
  10901. "PermissionActionConfig": {
  10902. "type": "string",
  10903. "enum": ["ask", "allow", "deny"]
  10904. },
  10905. "PermissionObjectConfig": {
  10906. "type": "object",
  10907. "additionalProperties": {
  10908. "$ref": "#/components/schemas/PermissionActionConfig"
  10909. }
  10910. },
  10911. "PermissionRuleConfig": {
  10912. "anyOf": [
  10913. {
  10914. "$ref": "#/components/schemas/PermissionActionConfig"
  10915. },
  10916. {
  10917. "$ref": "#/components/schemas/PermissionObjectConfig"
  10918. }
  10919. ]
  10920. },
  10921. "PermissionConfig": {
  10922. "anyOf": [
  10923. {
  10924. "$ref": "#/components/schemas/PermissionActionConfig"
  10925. },
  10926. {
  10927. "type": "object",
  10928. "properties": {
  10929. "read": {
  10930. "$ref": "#/components/schemas/PermissionRuleConfig"
  10931. },
  10932. "edit": {
  10933. "$ref": "#/components/schemas/PermissionRuleConfig"
  10934. },
  10935. "glob": {
  10936. "$ref": "#/components/schemas/PermissionRuleConfig"
  10937. },
  10938. "grep": {
  10939. "$ref": "#/components/schemas/PermissionRuleConfig"
  10940. },
  10941. "list": {
  10942. "$ref": "#/components/schemas/PermissionRuleConfig"
  10943. },
  10944. "bash": {
  10945. "$ref": "#/components/schemas/PermissionRuleConfig"
  10946. },
  10947. "task": {
  10948. "$ref": "#/components/schemas/PermissionRuleConfig"
  10949. },
  10950. "external_directory": {
  10951. "$ref": "#/components/schemas/PermissionRuleConfig"
  10952. },
  10953. "todowrite": {
  10954. "$ref": "#/components/schemas/PermissionActionConfig"
  10955. },
  10956. "question": {
  10957. "$ref": "#/components/schemas/PermissionActionConfig"
  10958. },
  10959. "webfetch": {
  10960. "$ref": "#/components/schemas/PermissionActionConfig"
  10961. },
  10962. "websearch": {
  10963. "$ref": "#/components/schemas/PermissionActionConfig"
  10964. },
  10965. "lsp": {
  10966. "$ref": "#/components/schemas/PermissionRuleConfig"
  10967. },
  10968. "doom_loop": {
  10969. "$ref": "#/components/schemas/PermissionActionConfig"
  10970. },
  10971. "skill": {
  10972. "$ref": "#/components/schemas/PermissionRuleConfig"
  10973. }
  10974. },
  10975. "additionalProperties": {
  10976. "$ref": "#/components/schemas/PermissionRuleConfig"
  10977. }
  10978. }
  10979. ]
  10980. },
  10981. "AgentConfig": {
  10982. "type": "object",
  10983. "properties": {
  10984. "model": {
  10985. "type": "string"
  10986. },
  10987. "variant": {
  10988. "type": "string"
  10989. },
  10990. "temperature": {
  10991. "type": "number"
  10992. },
  10993. "top_p": {
  10994. "type": "number"
  10995. },
  10996. "prompt": {
  10997. "type": "string"
  10998. },
  10999. "tools": {
  11000. "type": "object",
  11001. "additionalProperties": {
  11002. "type": "boolean"
  11003. }
  11004. },
  11005. "disable": {
  11006. "type": "boolean"
  11007. },
  11008. "description": {
  11009. "type": "string"
  11010. },
  11011. "mode": {
  11012. "type": "string",
  11013. "enum": ["subagent", "primary", "all"]
  11014. },
  11015. "hidden": {
  11016. "type": "boolean"
  11017. },
  11018. "options": {
  11019. "type": "object"
  11020. },
  11021. "color": {
  11022. "anyOf": [
  11023. {
  11024. "type": "string",
  11025. "pattern": "^#[0-9a-fA-F]{6}$"
  11026. },
  11027. {
  11028. "type": "string",
  11029. "enum": ["primary", "secondary", "accent", "success", "warning", "error", "info"]
  11030. }
  11031. ],
  11032. "description": "Hex color code (e.g., #FF5733) or theme color (e.g., primary)"
  11033. },
  11034. "steps": {
  11035. "type": "integer",
  11036. "exclusiveMinimum": 0
  11037. },
  11038. "maxSteps": {
  11039. "type": "integer",
  11040. "exclusiveMinimum": 0
  11041. },
  11042. "permission": {
  11043. "$ref": "#/components/schemas/PermissionConfig"
  11044. }
  11045. },
  11046. "additionalProperties": {}
  11047. },
  11048. "ProviderConfig": {
  11049. "type": "object",
  11050. "properties": {
  11051. "api": {
  11052. "type": "string"
  11053. },
  11054. "name": {
  11055. "type": "string"
  11056. },
  11057. "env": {
  11058. "type": "array",
  11059. "items": {
  11060. "type": "string"
  11061. }
  11062. },
  11063. "id": {
  11064. "type": "string"
  11065. },
  11066. "npm": {
  11067. "type": "string"
  11068. },
  11069. "whitelist": {
  11070. "type": "array",
  11071. "items": {
  11072. "type": "string"
  11073. }
  11074. },
  11075. "blacklist": {
  11076. "type": "array",
  11077. "items": {
  11078. "type": "string"
  11079. }
  11080. },
  11081. "options": {
  11082. "type": "object",
  11083. "properties": {
  11084. "apiKey": {
  11085. "type": "string"
  11086. },
  11087. "baseURL": {
  11088. "type": "string"
  11089. },
  11090. "enterpriseUrl": {
  11091. "type": "string"
  11092. },
  11093. "setCacheKey": {
  11094. "type": "boolean"
  11095. },
  11096. "timeout": {
  11097. "anyOf": [
  11098. {
  11099. "type": "integer",
  11100. "exclusiveMinimum": 0
  11101. },
  11102. {
  11103. "type": "boolean",
  11104. "enum": [false]
  11105. }
  11106. ],
  11107. "description": "Timeout in milliseconds for requests to this provider. Default is 300000 (5 minutes). Set to false to disable timeout."
  11108. },
  11109. "chunkTimeout": {
  11110. "type": "integer",
  11111. "exclusiveMinimum": 0
  11112. }
  11113. },
  11114. "additionalProperties": {}
  11115. },
  11116. "models": {
  11117. "type": "object",
  11118. "additionalProperties": {
  11119. "type": "object",
  11120. "properties": {
  11121. "id": {
  11122. "type": "string"
  11123. },
  11124. "name": {
  11125. "type": "string"
  11126. },
  11127. "family": {
  11128. "type": "string"
  11129. },
  11130. "release_date": {
  11131. "type": "string"
  11132. },
  11133. "attachment": {
  11134. "type": "boolean"
  11135. },
  11136. "reasoning": {
  11137. "type": "boolean"
  11138. },
  11139. "temperature": {
  11140. "type": "boolean"
  11141. },
  11142. "tool_call": {
  11143. "type": "boolean"
  11144. },
  11145. "interleaved": {
  11146. "anyOf": [
  11147. {
  11148. "type": "boolean",
  11149. "enum": [true]
  11150. },
  11151. {
  11152. "type": "object",
  11153. "properties": {
  11154. "field": {
  11155. "type": "string",
  11156. "enum": ["reasoning_content", "reasoning_details"]
  11157. }
  11158. },
  11159. "required": ["field"],
  11160. "additionalProperties": false
  11161. }
  11162. ]
  11163. },
  11164. "cost": {
  11165. "type": "object",
  11166. "properties": {
  11167. "input": {
  11168. "type": "number"
  11169. },
  11170. "output": {
  11171. "type": "number"
  11172. },
  11173. "cache_read": {
  11174. "type": "number"
  11175. },
  11176. "cache_write": {
  11177. "type": "number"
  11178. },
  11179. "context_over_200k": {
  11180. "type": "object",
  11181. "properties": {
  11182. "input": {
  11183. "type": "number"
  11184. },
  11185. "output": {
  11186. "type": "number"
  11187. },
  11188. "cache_read": {
  11189. "type": "number"
  11190. },
  11191. "cache_write": {
  11192. "type": "number"
  11193. }
  11194. },
  11195. "required": ["input", "output"],
  11196. "additionalProperties": false
  11197. }
  11198. },
  11199. "required": ["input", "output"],
  11200. "additionalProperties": false
  11201. },
  11202. "limit": {
  11203. "type": "object",
  11204. "properties": {
  11205. "context": {
  11206. "type": "number"
  11207. },
  11208. "input": {
  11209. "type": "number"
  11210. },
  11211. "output": {
  11212. "type": "number"
  11213. }
  11214. },
  11215. "required": ["context", "output"],
  11216. "additionalProperties": false
  11217. },
  11218. "modalities": {
  11219. "type": "object",
  11220. "properties": {
  11221. "input": {
  11222. "type": "array",
  11223. "items": {
  11224. "type": "string",
  11225. "enum": ["text", "audio", "image", "video", "pdf"]
  11226. }
  11227. },
  11228. "output": {
  11229. "type": "array",
  11230. "items": {
  11231. "type": "string",
  11232. "enum": ["text", "audio", "image", "video", "pdf"]
  11233. }
  11234. }
  11235. },
  11236. "required": ["input", "output"],
  11237. "additionalProperties": false
  11238. },
  11239. "experimental": {
  11240. "type": "boolean"
  11241. },
  11242. "status": {
  11243. "type": "string",
  11244. "enum": ["alpha", "beta", "deprecated"]
  11245. },
  11246. "provider": {
  11247. "type": "object",
  11248. "properties": {
  11249. "npm": {
  11250. "type": "string"
  11251. },
  11252. "api": {
  11253. "type": "string"
  11254. }
  11255. },
  11256. "additionalProperties": false
  11257. },
  11258. "options": {
  11259. "type": "object"
  11260. },
  11261. "headers": {
  11262. "type": "object",
  11263. "additionalProperties": {
  11264. "type": "string"
  11265. }
  11266. },
  11267. "variants": {
  11268. "type": "object",
  11269. "additionalProperties": {
  11270. "type": "object",
  11271. "properties": {
  11272. "disabled": {
  11273. "type": "boolean"
  11274. }
  11275. },
  11276. "additionalProperties": {}
  11277. },
  11278. "description": "Variant-specific configuration"
  11279. }
  11280. },
  11281. "additionalProperties": false
  11282. }
  11283. }
  11284. },
  11285. "additionalProperties": false
  11286. },
  11287. "McpLocalConfig": {
  11288. "type": "object",
  11289. "properties": {
  11290. "type": {
  11291. "type": "string",
  11292. "enum": ["local"],
  11293. "description": "Type of MCP server connection"
  11294. },
  11295. "command": {
  11296. "type": "array",
  11297. "items": {
  11298. "type": "string"
  11299. },
  11300. "description": "Command and arguments to run the MCP server"
  11301. },
  11302. "environment": {
  11303. "type": "object",
  11304. "additionalProperties": {
  11305. "type": "string"
  11306. }
  11307. },
  11308. "enabled": {
  11309. "type": "boolean"
  11310. },
  11311. "timeout": {
  11312. "type": "integer",
  11313. "exclusiveMinimum": 0
  11314. }
  11315. },
  11316. "required": ["type", "command"],
  11317. "additionalProperties": false
  11318. },
  11319. "McpOAuthConfig": {
  11320. "type": "object",
  11321. "properties": {
  11322. "clientId": {
  11323. "type": "string"
  11324. },
  11325. "clientSecret": {
  11326. "type": "string"
  11327. },
  11328. "scope": {
  11329. "type": "string"
  11330. },
  11331. "redirectUri": {
  11332. "type": "string"
  11333. }
  11334. },
  11335. "additionalProperties": false
  11336. },
  11337. "McpRemoteConfig": {
  11338. "type": "object",
  11339. "properties": {
  11340. "type": {
  11341. "type": "string",
  11342. "enum": ["remote"],
  11343. "description": "Type of MCP server connection"
  11344. },
  11345. "url": {
  11346. "type": "string",
  11347. "description": "URL of the remote MCP server"
  11348. },
  11349. "enabled": {
  11350. "type": "boolean"
  11351. },
  11352. "headers": {
  11353. "type": "object",
  11354. "additionalProperties": {
  11355. "type": "string"
  11356. }
  11357. },
  11358. "oauth": {
  11359. "anyOf": [
  11360. {
  11361. "$ref": "#/components/schemas/McpOAuthConfig"
  11362. },
  11363. {
  11364. "type": "boolean",
  11365. "enum": [false]
  11366. }
  11367. ],
  11368. "description": "OAuth authentication configuration for the MCP server. Set to false to disable OAuth auto-detection."
  11369. },
  11370. "timeout": {
  11371. "type": "integer",
  11372. "exclusiveMinimum": 0
  11373. }
  11374. },
  11375. "required": ["type", "url"],
  11376. "additionalProperties": false
  11377. },
  11378. "LayoutConfig": {
  11379. "type": "string",
  11380. "enum": ["auto", "stretch"],
  11381. "description": "@deprecated Always uses stretch layout."
  11382. },
  11383. "Config": {
  11384. "type": "object",
  11385. "properties": {
  11386. "$schema": {
  11387. "type": "string"
  11388. },
  11389. "shell": {
  11390. "type": "string"
  11391. },
  11392. "logLevel": {
  11393. "$ref": "#/components/schemas/LogLevel"
  11394. },
  11395. "server": {
  11396. "$ref": "#/components/schemas/ServerConfig"
  11397. },
  11398. "command": {
  11399. "type": "object",
  11400. "additionalProperties": {
  11401. "type": "object",
  11402. "properties": {
  11403. "template": {
  11404. "type": "string"
  11405. },
  11406. "description": {
  11407. "type": "string"
  11408. },
  11409. "agent": {
  11410. "type": "string"
  11411. },
  11412. "model": {
  11413. "type": "string"
  11414. },
  11415. "subtask": {
  11416. "type": "boolean"
  11417. }
  11418. },
  11419. "required": ["template"],
  11420. "additionalProperties": false
  11421. }
  11422. },
  11423. "skills": {
  11424. "type": "object",
  11425. "properties": {
  11426. "paths": {
  11427. "type": "array",
  11428. "items": {
  11429. "type": "string"
  11430. }
  11431. },
  11432. "urls": {
  11433. "type": "array",
  11434. "items": {
  11435. "type": "string"
  11436. }
  11437. }
  11438. },
  11439. "additionalProperties": false
  11440. },
  11441. "watcher": {
  11442. "type": "object",
  11443. "properties": {
  11444. "ignore": {
  11445. "type": "array",
  11446. "items": {
  11447. "type": "string"
  11448. }
  11449. }
  11450. },
  11451. "additionalProperties": false
  11452. },
  11453. "snapshot": {
  11454. "type": "boolean"
  11455. },
  11456. "plugin": {
  11457. "type": "array",
  11458. "items": {
  11459. "anyOf": [
  11460. {
  11461. "type": "string"
  11462. },
  11463. {
  11464. "type": "array",
  11465. "prefixItems": [
  11466. {
  11467. "type": "string"
  11468. },
  11469. {
  11470. "type": "object"
  11471. }
  11472. ],
  11473. "maxItems": 2,
  11474. "minItems": 2
  11475. }
  11476. ]
  11477. }
  11478. },
  11479. "share": {
  11480. "type": "string",
  11481. "enum": ["manual", "auto", "disabled"]
  11482. },
  11483. "autoshare": {
  11484. "type": "boolean"
  11485. },
  11486. "autoupdate": {
  11487. "anyOf": [
  11488. {
  11489. "type": "boolean"
  11490. },
  11491. {
  11492. "type": "string",
  11493. "enum": ["notify"]
  11494. }
  11495. ],
  11496. "description": "Automatically update to the latest version. Set to true to auto-update, false to disable, or 'notify' to show update notifications"
  11497. },
  11498. "disabled_providers": {
  11499. "type": "array",
  11500. "items": {
  11501. "type": "string"
  11502. }
  11503. },
  11504. "enabled_providers": {
  11505. "type": "array",
  11506. "items": {
  11507. "type": "string"
  11508. }
  11509. },
  11510. "model": {
  11511. "type": "string"
  11512. },
  11513. "small_model": {
  11514. "type": "string"
  11515. },
  11516. "default_agent": {
  11517. "type": "string"
  11518. },
  11519. "username": {
  11520. "type": "string"
  11521. },
  11522. "mode": {
  11523. "type": "object",
  11524. "properties": {
  11525. "build": {
  11526. "$ref": "#/components/schemas/AgentConfig"
  11527. },
  11528. "plan": {
  11529. "$ref": "#/components/schemas/AgentConfig"
  11530. }
  11531. },
  11532. "additionalProperties": {
  11533. "$ref": "#/components/schemas/AgentConfig"
  11534. }
  11535. },
  11536. "agent": {
  11537. "type": "object",
  11538. "properties": {
  11539. "plan": {
  11540. "$ref": "#/components/schemas/AgentConfig"
  11541. },
  11542. "build": {
  11543. "$ref": "#/components/schemas/AgentConfig"
  11544. },
  11545. "general": {
  11546. "$ref": "#/components/schemas/AgentConfig"
  11547. },
  11548. "explore": {
  11549. "$ref": "#/components/schemas/AgentConfig"
  11550. },
  11551. "title": {
  11552. "$ref": "#/components/schemas/AgentConfig"
  11553. },
  11554. "summary": {
  11555. "$ref": "#/components/schemas/AgentConfig"
  11556. },
  11557. "compaction": {
  11558. "$ref": "#/components/schemas/AgentConfig"
  11559. }
  11560. },
  11561. "additionalProperties": {
  11562. "$ref": "#/components/schemas/AgentConfig"
  11563. }
  11564. },
  11565. "provider": {
  11566. "type": "object",
  11567. "additionalProperties": {
  11568. "$ref": "#/components/schemas/ProviderConfig"
  11569. }
  11570. },
  11571. "mcp": {
  11572. "type": "object",
  11573. "additionalProperties": {
  11574. "anyOf": [
  11575. {
  11576. "$ref": "#/components/schemas/McpLocalConfig"
  11577. },
  11578. {
  11579. "$ref": "#/components/schemas/McpRemoteConfig"
  11580. },
  11581. {
  11582. "type": "object",
  11583. "properties": {
  11584. "enabled": {
  11585. "type": "boolean"
  11586. }
  11587. },
  11588. "required": ["enabled"],
  11589. "additionalProperties": false
  11590. }
  11591. ]
  11592. }
  11593. },
  11594. "formatter": {
  11595. "anyOf": [
  11596. {
  11597. "type": "boolean"
  11598. },
  11599. {
  11600. "type": "object",
  11601. "additionalProperties": {
  11602. "type": "object",
  11603. "properties": {
  11604. "disabled": {
  11605. "type": "boolean"
  11606. },
  11607. "command": {
  11608. "type": "array",
  11609. "items": {
  11610. "type": "string"
  11611. }
  11612. },
  11613. "environment": {
  11614. "type": "object",
  11615. "additionalProperties": {
  11616. "type": "string"
  11617. }
  11618. },
  11619. "extensions": {
  11620. "type": "array",
  11621. "items": {
  11622. "type": "string"
  11623. }
  11624. }
  11625. },
  11626. "additionalProperties": false
  11627. }
  11628. }
  11629. ],
  11630. "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."
  11631. },
  11632. "lsp": {
  11633. "anyOf": [
  11634. {
  11635. "type": "boolean"
  11636. },
  11637. {
  11638. "type": "object",
  11639. "additionalProperties": {
  11640. "anyOf": [
  11641. {
  11642. "type": "object",
  11643. "properties": {
  11644. "disabled": {
  11645. "type": "boolean",
  11646. "enum": [true]
  11647. }
  11648. },
  11649. "required": ["disabled"],
  11650. "additionalProperties": false
  11651. },
  11652. {
  11653. "type": "object",
  11654. "properties": {
  11655. "command": {
  11656. "type": "array",
  11657. "items": {
  11658. "type": "string"
  11659. }
  11660. },
  11661. "extensions": {
  11662. "type": "array",
  11663. "items": {
  11664. "type": "string"
  11665. }
  11666. },
  11667. "disabled": {
  11668. "type": "boolean"
  11669. },
  11670. "env": {
  11671. "type": "object",
  11672. "additionalProperties": {
  11673. "type": "string"
  11674. }
  11675. },
  11676. "initialization": {
  11677. "type": "object"
  11678. }
  11679. },
  11680. "required": ["command"],
  11681. "additionalProperties": false
  11682. }
  11683. ]
  11684. }
  11685. }
  11686. ],
  11687. "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."
  11688. },
  11689. "instructions": {
  11690. "type": "array",
  11691. "items": {
  11692. "type": "string"
  11693. }
  11694. },
  11695. "layout": {
  11696. "$ref": "#/components/schemas/LayoutConfig"
  11697. },
  11698. "permission": {
  11699. "$ref": "#/components/schemas/PermissionConfig"
  11700. },
  11701. "tools": {
  11702. "type": "object",
  11703. "additionalProperties": {
  11704. "type": "boolean"
  11705. }
  11706. },
  11707. "enterprise": {
  11708. "type": "object",
  11709. "properties": {
  11710. "url": {
  11711. "type": "string"
  11712. }
  11713. },
  11714. "additionalProperties": false
  11715. },
  11716. "tool_output": {
  11717. "type": "object",
  11718. "properties": {
  11719. "max_lines": {
  11720. "type": "integer",
  11721. "exclusiveMinimum": 0
  11722. },
  11723. "max_bytes": {
  11724. "type": "integer",
  11725. "exclusiveMinimum": 0
  11726. }
  11727. },
  11728. "additionalProperties": false
  11729. },
  11730. "compaction": {
  11731. "type": "object",
  11732. "properties": {
  11733. "auto": {
  11734. "type": "boolean"
  11735. },
  11736. "prune": {
  11737. "type": "boolean"
  11738. },
  11739. "tail_turns": {
  11740. "type": "integer",
  11741. "minimum": 0
  11742. },
  11743. "preserve_recent_tokens": {
  11744. "type": "integer",
  11745. "minimum": 0
  11746. },
  11747. "reserved": {
  11748. "type": "integer",
  11749. "minimum": 0
  11750. }
  11751. },
  11752. "additionalProperties": false
  11753. },
  11754. "experimental": {
  11755. "type": "object",
  11756. "properties": {
  11757. "disable_paste_summary": {
  11758. "type": "boolean"
  11759. },
  11760. "batch_tool": {
  11761. "type": "boolean"
  11762. },
  11763. "openTelemetry": {
  11764. "type": "boolean"
  11765. },
  11766. "primary_tools": {
  11767. "type": "array",
  11768. "items": {
  11769. "type": "string"
  11770. }
  11771. },
  11772. "continue_loop_on_deny": {
  11773. "type": "boolean"
  11774. },
  11775. "mcp_timeout": {
  11776. "type": "integer",
  11777. "exclusiveMinimum": 0
  11778. }
  11779. },
  11780. "additionalProperties": false
  11781. }
  11782. },
  11783. "additionalProperties": false
  11784. },
  11785. "Model": {
  11786. "type": "object",
  11787. "properties": {
  11788. "id": {
  11789. "type": "string"
  11790. },
  11791. "providerID": {
  11792. "type": "string"
  11793. },
  11794. "api": {
  11795. "type": "object",
  11796. "properties": {
  11797. "id": {
  11798. "type": "string"
  11799. },
  11800. "url": {
  11801. "type": "string"
  11802. },
  11803. "npm": {
  11804. "type": "string"
  11805. }
  11806. },
  11807. "required": ["id", "url", "npm"],
  11808. "additionalProperties": false
  11809. },
  11810. "name": {
  11811. "type": "string"
  11812. },
  11813. "family": {
  11814. "type": "string"
  11815. },
  11816. "capabilities": {
  11817. "type": "object",
  11818. "properties": {
  11819. "temperature": {
  11820. "type": "boolean"
  11821. },
  11822. "reasoning": {
  11823. "type": "boolean"
  11824. },
  11825. "attachment": {
  11826. "type": "boolean"
  11827. },
  11828. "toolcall": {
  11829. "type": "boolean"
  11830. },
  11831. "input": {
  11832. "type": "object",
  11833. "properties": {
  11834. "text": {
  11835. "type": "boolean"
  11836. },
  11837. "audio": {
  11838. "type": "boolean"
  11839. },
  11840. "image": {
  11841. "type": "boolean"
  11842. },
  11843. "video": {
  11844. "type": "boolean"
  11845. },
  11846. "pdf": {
  11847. "type": "boolean"
  11848. }
  11849. },
  11850. "required": ["text", "audio", "image", "video", "pdf"],
  11851. "additionalProperties": false
  11852. },
  11853. "output": {
  11854. "type": "object",
  11855. "properties": {
  11856. "text": {
  11857. "type": "boolean"
  11858. },
  11859. "audio": {
  11860. "type": "boolean"
  11861. },
  11862. "image": {
  11863. "type": "boolean"
  11864. },
  11865. "video": {
  11866. "type": "boolean"
  11867. },
  11868. "pdf": {
  11869. "type": "boolean"
  11870. }
  11871. },
  11872. "required": ["text", "audio", "image", "video", "pdf"],
  11873. "additionalProperties": false
  11874. },
  11875. "interleaved": {
  11876. "anyOf": [
  11877. {
  11878. "type": "boolean"
  11879. },
  11880. {
  11881. "type": "object",
  11882. "properties": {
  11883. "field": {
  11884. "type": "string",
  11885. "enum": ["reasoning_content", "reasoning_details"]
  11886. }
  11887. },
  11888. "required": ["field"],
  11889. "additionalProperties": false
  11890. }
  11891. ]
  11892. }
  11893. },
  11894. "required": ["temperature", "reasoning", "attachment", "toolcall", "input", "output", "interleaved"],
  11895. "additionalProperties": false
  11896. },
  11897. "cost": {
  11898. "type": "object",
  11899. "properties": {
  11900. "input": {
  11901. "type": "number"
  11902. },
  11903. "output": {
  11904. "type": "number"
  11905. },
  11906. "cache": {
  11907. "type": "object",
  11908. "properties": {
  11909. "read": {
  11910. "type": "number"
  11911. },
  11912. "write": {
  11913. "type": "number"
  11914. }
  11915. },
  11916. "required": ["read", "write"],
  11917. "additionalProperties": false
  11918. },
  11919. "experimentalOver200K": {
  11920. "type": "object",
  11921. "properties": {
  11922. "input": {
  11923. "type": "number"
  11924. },
  11925. "output": {
  11926. "type": "number"
  11927. },
  11928. "cache": {
  11929. "type": "object",
  11930. "properties": {
  11931. "read": {
  11932. "type": "number"
  11933. },
  11934. "write": {
  11935. "type": "number"
  11936. }
  11937. },
  11938. "required": ["read", "write"],
  11939. "additionalProperties": false
  11940. }
  11941. },
  11942. "required": ["input", "output", "cache"],
  11943. "additionalProperties": false
  11944. }
  11945. },
  11946. "required": ["input", "output", "cache"],
  11947. "additionalProperties": false
  11948. },
  11949. "limit": {
  11950. "type": "object",
  11951. "properties": {
  11952. "context": {
  11953. "type": "number"
  11954. },
  11955. "input": {
  11956. "type": "number"
  11957. },
  11958. "output": {
  11959. "type": "number"
  11960. }
  11961. },
  11962. "required": ["context", "output"],
  11963. "additionalProperties": false
  11964. },
  11965. "status": {
  11966. "type": "string",
  11967. "enum": ["alpha", "beta", "deprecated", "active"]
  11968. },
  11969. "options": {
  11970. "type": "object"
  11971. },
  11972. "headers": {
  11973. "type": "object",
  11974. "additionalProperties": {
  11975. "type": "string"
  11976. }
  11977. },
  11978. "release_date": {
  11979. "type": "string"
  11980. },
  11981. "variants": {
  11982. "type": "object",
  11983. "additionalProperties": {
  11984. "type": "object"
  11985. }
  11986. }
  11987. },
  11988. "required": [
  11989. "id",
  11990. "providerID",
  11991. "api",
  11992. "name",
  11993. "capabilities",
  11994. "cost",
  11995. "limit",
  11996. "status",
  11997. "options",
  11998. "headers",
  11999. "release_date"
  12000. ],
  12001. "additionalProperties": false
  12002. },
  12003. "Provider": {
  12004. "type": "object",
  12005. "properties": {
  12006. "id": {
  12007. "type": "string"
  12008. },
  12009. "name": {
  12010. "type": "string"
  12011. },
  12012. "source": {
  12013. "type": "string",
  12014. "enum": ["env", "config", "custom", "api"]
  12015. },
  12016. "env": {
  12017. "type": "array",
  12018. "items": {
  12019. "type": "string"
  12020. }
  12021. },
  12022. "key": {
  12023. "type": "string"
  12024. },
  12025. "options": {
  12026. "type": "object"
  12027. },
  12028. "models": {
  12029. "type": "object",
  12030. "additionalProperties": {
  12031. "$ref": "#/components/schemas/Model"
  12032. }
  12033. }
  12034. },
  12035. "required": ["id", "name", "source", "env", "options", "models"],
  12036. "additionalProperties": false
  12037. },
  12038. "ConsoleState": {
  12039. "type": "object",
  12040. "properties": {
  12041. "consoleManagedProviders": {
  12042. "type": "array",
  12043. "items": {
  12044. "type": "string"
  12045. }
  12046. },
  12047. "activeOrgName": {
  12048. "type": "string"
  12049. },
  12050. "switchableOrgCount": {
  12051. "type": "integer",
  12052. "minimum": 0
  12053. }
  12054. },
  12055. "required": ["consoleManagedProviders", "switchableOrgCount"],
  12056. "additionalProperties": false
  12057. },
  12058. "ToolListItem": {
  12059. "type": "object",
  12060. "properties": {
  12061. "id": {
  12062. "type": "string"
  12063. },
  12064. "description": {
  12065. "type": "string"
  12066. },
  12067. "parameters": {}
  12068. },
  12069. "required": ["id", "description", "parameters"],
  12070. "additionalProperties": false
  12071. },
  12072. "ToolList": {
  12073. "type": "array",
  12074. "items": {
  12075. "$ref": "#/components/schemas/ToolListItem"
  12076. }
  12077. },
  12078. "ToolIDs": {
  12079. "type": "array",
  12080. "items": {
  12081. "type": "string"
  12082. }
  12083. },
  12084. "WorktreeCreateInput": {
  12085. "type": "object",
  12086. "properties": {
  12087. "name": {
  12088. "type": "string"
  12089. },
  12090. "startCommand": {
  12091. "type": "string",
  12092. "description": "Additional startup script to run after the project's start command"
  12093. }
  12094. },
  12095. "additionalProperties": false
  12096. },
  12097. "Worktree": {
  12098. "type": "object",
  12099. "properties": {
  12100. "name": {
  12101. "type": "string"
  12102. },
  12103. "branch": {
  12104. "type": "string"
  12105. },
  12106. "directory": {
  12107. "type": "string"
  12108. }
  12109. },
  12110. "required": ["name", "branch", "directory"],
  12111. "additionalProperties": false
  12112. },
  12113. "WorktreeRemoveInput": {
  12114. "type": "object",
  12115. "properties": {
  12116. "directory": {
  12117. "type": "string"
  12118. }
  12119. },
  12120. "required": ["directory"],
  12121. "additionalProperties": false
  12122. },
  12123. "WorktreeResetInput": {
  12124. "type": "object",
  12125. "properties": {
  12126. "directory": {
  12127. "type": "string"
  12128. }
  12129. },
  12130. "required": ["directory"],
  12131. "additionalProperties": false
  12132. },
  12133. "ProjectSummary": {
  12134. "type": "object",
  12135. "properties": {
  12136. "id": {
  12137. "type": "string"
  12138. },
  12139. "name": {
  12140. "type": "string"
  12141. },
  12142. "worktree": {
  12143. "type": "string"
  12144. }
  12145. },
  12146. "required": ["id", "worktree"],
  12147. "additionalProperties": false
  12148. },
  12149. "GlobalSession": {
  12150. "type": "object",
  12151. "properties": {
  12152. "id": {
  12153. "type": "string"
  12154. },
  12155. "slug": {
  12156. "type": "string"
  12157. },
  12158. "projectID": {
  12159. "type": "string"
  12160. },
  12161. "workspaceID": {
  12162. "type": "string"
  12163. },
  12164. "directory": {
  12165. "type": "string"
  12166. },
  12167. "path": {
  12168. "type": "string"
  12169. },
  12170. "parentID": {
  12171. "type": "string"
  12172. },
  12173. "summary": {
  12174. "type": "object",
  12175. "properties": {
  12176. "additions": {
  12177. "type": "integer",
  12178. "minimum": 0
  12179. },
  12180. "deletions": {
  12181. "type": "integer",
  12182. "minimum": 0
  12183. },
  12184. "files": {
  12185. "type": "integer",
  12186. "minimum": 0
  12187. },
  12188. "diffs": {
  12189. "type": "array",
  12190. "items": {
  12191. "$ref": "#/components/schemas/SnapshotFileDiff"
  12192. }
  12193. }
  12194. },
  12195. "required": ["additions", "deletions", "files"],
  12196. "additionalProperties": false
  12197. },
  12198. "share": {
  12199. "type": "object",
  12200. "properties": {
  12201. "url": {
  12202. "type": "string"
  12203. }
  12204. },
  12205. "required": ["url"],
  12206. "additionalProperties": false
  12207. },
  12208. "title": {
  12209. "type": "string"
  12210. },
  12211. "agent": {
  12212. "type": "string"
  12213. },
  12214. "model": {
  12215. "type": "object",
  12216. "properties": {
  12217. "id": {
  12218. "type": "string"
  12219. },
  12220. "providerID": {
  12221. "type": "string"
  12222. },
  12223. "variant": {
  12224. "type": "string"
  12225. }
  12226. },
  12227. "required": ["id", "providerID"],
  12228. "additionalProperties": false
  12229. },
  12230. "version": {
  12231. "type": "string"
  12232. },
  12233. "time": {
  12234. "type": "object",
  12235. "properties": {
  12236. "created": {
  12237. "type": "integer",
  12238. "minimum": 0
  12239. },
  12240. "updated": {
  12241. "type": "integer",
  12242. "minimum": 0
  12243. },
  12244. "compacting": {
  12245. "type": "integer",
  12246. "minimum": 0
  12247. },
  12248. "archived": {
  12249. "type": "number"
  12250. }
  12251. },
  12252. "required": ["created", "updated"],
  12253. "additionalProperties": false
  12254. },
  12255. "permission": {
  12256. "$ref": "#/components/schemas/PermissionRuleset"
  12257. },
  12258. "revert": {
  12259. "type": "object",
  12260. "properties": {
  12261. "messageID": {
  12262. "type": "string"
  12263. },
  12264. "partID": {
  12265. "type": "string"
  12266. },
  12267. "snapshot": {
  12268. "type": "string"
  12269. },
  12270. "diff": {
  12271. "type": "string"
  12272. }
  12273. },
  12274. "required": ["messageID"],
  12275. "additionalProperties": false
  12276. },
  12277. "project": {
  12278. "anyOf": [
  12279. {
  12280. "$ref": "#/components/schemas/ProjectSummary"
  12281. },
  12282. {
  12283. "type": "null"
  12284. }
  12285. ]
  12286. }
  12287. },
  12288. "required": ["id", "slug", "projectID", "directory", "title", "version", "time", "project"],
  12289. "additionalProperties": false
  12290. },
  12291. "McpResource": {
  12292. "type": "object",
  12293. "properties": {
  12294. "name": {
  12295. "type": "string"
  12296. },
  12297. "uri": {
  12298. "type": "string"
  12299. },
  12300. "description": {
  12301. "type": "string"
  12302. },
  12303. "mimeType": {
  12304. "type": "string"
  12305. },
  12306. "client": {
  12307. "type": "string"
  12308. }
  12309. },
  12310. "required": ["name", "uri", "client"],
  12311. "additionalProperties": false
  12312. },
  12313. "Symbol": {
  12314. "type": "object",
  12315. "properties": {
  12316. "name": {
  12317. "type": "string"
  12318. },
  12319. "kind": {
  12320. "type": "integer",
  12321. "minimum": 0
  12322. },
  12323. "location": {
  12324. "type": "object",
  12325. "properties": {
  12326. "uri": {
  12327. "type": "string"
  12328. },
  12329. "range": {
  12330. "$ref": "#/components/schemas/Range"
  12331. }
  12332. },
  12333. "required": ["uri", "range"],
  12334. "additionalProperties": false
  12335. }
  12336. },
  12337. "required": ["name", "kind", "location"],
  12338. "additionalProperties": false
  12339. },
  12340. "FileNode": {
  12341. "type": "object",
  12342. "properties": {
  12343. "name": {
  12344. "type": "string"
  12345. },
  12346. "path": {
  12347. "type": "string"
  12348. },
  12349. "absolute": {
  12350. "type": "string"
  12351. },
  12352. "type": {
  12353. "type": "string",
  12354. "enum": ["file", "directory"]
  12355. },
  12356. "ignored": {
  12357. "type": "boolean"
  12358. }
  12359. },
  12360. "required": ["name", "path", "absolute", "type", "ignored"],
  12361. "additionalProperties": false
  12362. },
  12363. "FileContent": {
  12364. "type": "object",
  12365. "properties": {
  12366. "type": {
  12367. "type": "string",
  12368. "enum": ["text", "binary"]
  12369. },
  12370. "content": {
  12371. "type": "string"
  12372. },
  12373. "diff": {
  12374. "type": "string"
  12375. },
  12376. "patch": {
  12377. "type": "object",
  12378. "properties": {
  12379. "oldFileName": {
  12380. "type": "string"
  12381. },
  12382. "newFileName": {
  12383. "type": "string"
  12384. },
  12385. "oldHeader": {
  12386. "type": "string"
  12387. },
  12388. "newHeader": {
  12389. "type": "string"
  12390. },
  12391. "hunks": {
  12392. "type": "array",
  12393. "items": {
  12394. "type": "object",
  12395. "properties": {
  12396. "oldStart": {
  12397. "type": "integer",
  12398. "minimum": 0
  12399. },
  12400. "oldLines": {
  12401. "type": "integer",
  12402. "minimum": 0
  12403. },
  12404. "newStart": {
  12405. "type": "integer",
  12406. "minimum": 0
  12407. },
  12408. "newLines": {
  12409. "type": "integer",
  12410. "minimum": 0
  12411. },
  12412. "lines": {
  12413. "type": "array",
  12414. "items": {
  12415. "type": "string"
  12416. }
  12417. }
  12418. },
  12419. "required": ["oldStart", "oldLines", "newStart", "newLines", "lines"],
  12420. "additionalProperties": false
  12421. }
  12422. },
  12423. "index": {
  12424. "type": "string"
  12425. }
  12426. },
  12427. "required": ["oldFileName", "newFileName", "hunks"],
  12428. "additionalProperties": false
  12429. },
  12430. "encoding": {
  12431. "type": "string",
  12432. "enum": ["base64"]
  12433. },
  12434. "mimeType": {
  12435. "type": "string"
  12436. }
  12437. },
  12438. "required": ["type", "content"],
  12439. "additionalProperties": false
  12440. },
  12441. "File": {
  12442. "type": "object",
  12443. "properties": {
  12444. "path": {
  12445. "type": "string"
  12446. },
  12447. "added": {
  12448. "type": "integer",
  12449. "minimum": 0
  12450. },
  12451. "removed": {
  12452. "type": "integer",
  12453. "minimum": 0
  12454. },
  12455. "status": {
  12456. "type": "string",
  12457. "enum": ["added", "deleted", "modified"]
  12458. }
  12459. },
  12460. "required": ["path", "added", "removed", "status"],
  12461. "additionalProperties": false
  12462. },
  12463. "Path": {
  12464. "type": "object",
  12465. "properties": {
  12466. "home": {
  12467. "type": "string"
  12468. },
  12469. "state": {
  12470. "type": "string"
  12471. },
  12472. "config": {
  12473. "type": "string"
  12474. },
  12475. "worktree": {
  12476. "type": "string"
  12477. },
  12478. "directory": {
  12479. "type": "string"
  12480. }
  12481. },
  12482. "required": ["home", "state", "config", "worktree", "directory"],
  12483. "additionalProperties": false
  12484. },
  12485. "VcsInfo": {
  12486. "type": "object",
  12487. "properties": {
  12488. "branch": {
  12489. "type": "string"
  12490. },
  12491. "default_branch": {
  12492. "type": "string"
  12493. }
  12494. },
  12495. "additionalProperties": false
  12496. },
  12497. "VcsFileDiff": {
  12498. "type": "object",
  12499. "properties": {
  12500. "file": {
  12501. "type": "string"
  12502. },
  12503. "patch": {
  12504. "type": "string"
  12505. },
  12506. "additions": {
  12507. "type": "integer",
  12508. "minimum": 0
  12509. },
  12510. "deletions": {
  12511. "type": "integer",
  12512. "minimum": 0
  12513. },
  12514. "status": {
  12515. "type": "string",
  12516. "enum": ["added", "deleted", "modified"]
  12517. }
  12518. },
  12519. "required": ["file", "patch", "additions", "deletions"],
  12520. "additionalProperties": false
  12521. },
  12522. "Command": {
  12523. "type": "object",
  12524. "properties": {
  12525. "name": {
  12526. "type": "string"
  12527. },
  12528. "description": {
  12529. "type": "string"
  12530. },
  12531. "agent": {
  12532. "type": "string"
  12533. },
  12534. "model": {
  12535. "type": "string"
  12536. },
  12537. "source": {
  12538. "type": "string",
  12539. "enum": ["command", "mcp", "skill"]
  12540. },
  12541. "template": {
  12542. "type": "string"
  12543. },
  12544. "subtask": {
  12545. "type": "boolean"
  12546. },
  12547. "hints": {
  12548. "type": "array",
  12549. "items": {
  12550. "type": "string"
  12551. }
  12552. }
  12553. },
  12554. "required": ["name", "template", "hints"],
  12555. "additionalProperties": false
  12556. },
  12557. "Agent": {
  12558. "type": "object",
  12559. "properties": {
  12560. "name": {
  12561. "type": "string"
  12562. },
  12563. "description": {
  12564. "type": "string"
  12565. },
  12566. "mode": {
  12567. "type": "string",
  12568. "enum": ["subagent", "primary", "all"]
  12569. },
  12570. "native": {
  12571. "type": "boolean"
  12572. },
  12573. "hidden": {
  12574. "type": "boolean"
  12575. },
  12576. "topP": {
  12577. "type": "number"
  12578. },
  12579. "temperature": {
  12580. "type": "number"
  12581. },
  12582. "color": {
  12583. "type": "string"
  12584. },
  12585. "permission": {
  12586. "$ref": "#/components/schemas/PermissionRuleset"
  12587. },
  12588. "model": {
  12589. "type": "object",
  12590. "properties": {
  12591. "modelID": {
  12592. "type": "string"
  12593. },
  12594. "providerID": {
  12595. "type": "string"
  12596. }
  12597. },
  12598. "required": ["modelID", "providerID"],
  12599. "additionalProperties": false
  12600. },
  12601. "variant": {
  12602. "type": "string"
  12603. },
  12604. "prompt": {
  12605. "type": "string"
  12606. },
  12607. "options": {
  12608. "type": "object"
  12609. },
  12610. "steps": {
  12611. "type": "number"
  12612. }
  12613. },
  12614. "required": ["name", "mode", "permission", "options"],
  12615. "additionalProperties": false
  12616. },
  12617. "LSPStatus": {
  12618. "type": "object",
  12619. "properties": {
  12620. "id": {
  12621. "type": "string"
  12622. },
  12623. "name": {
  12624. "type": "string"
  12625. },
  12626. "root": {
  12627. "type": "string"
  12628. },
  12629. "status": {
  12630. "type": "string",
  12631. "enum": ["connected", "error"]
  12632. }
  12633. },
  12634. "required": ["id", "name", "root", "status"],
  12635. "additionalProperties": false
  12636. },
  12637. "FormatterStatus": {
  12638. "type": "object",
  12639. "properties": {
  12640. "name": {
  12641. "type": "string"
  12642. },
  12643. "extensions": {
  12644. "type": "array",
  12645. "items": {
  12646. "type": "string"
  12647. }
  12648. },
  12649. "enabled": {
  12650. "type": "boolean"
  12651. }
  12652. },
  12653. "required": ["name", "extensions", "enabled"],
  12654. "additionalProperties": false
  12655. },
  12656. "MCPStatusConnected": {
  12657. "type": "object",
  12658. "properties": {
  12659. "status": {
  12660. "type": "string",
  12661. "enum": ["connected"]
  12662. }
  12663. },
  12664. "required": ["status"],
  12665. "additionalProperties": false
  12666. },
  12667. "MCPStatusDisabled": {
  12668. "type": "object",
  12669. "properties": {
  12670. "status": {
  12671. "type": "string",
  12672. "enum": ["disabled"]
  12673. }
  12674. },
  12675. "required": ["status"],
  12676. "additionalProperties": false
  12677. },
  12678. "MCPStatusFailed": {
  12679. "type": "object",
  12680. "properties": {
  12681. "status": {
  12682. "type": "string",
  12683. "enum": ["failed"]
  12684. },
  12685. "error": {
  12686. "type": "string"
  12687. }
  12688. },
  12689. "required": ["status", "error"],
  12690. "additionalProperties": false
  12691. },
  12692. "MCPStatusNeedsAuth": {
  12693. "type": "object",
  12694. "properties": {
  12695. "status": {
  12696. "type": "string",
  12697. "enum": ["needs_auth"]
  12698. }
  12699. },
  12700. "required": ["status"],
  12701. "additionalProperties": false
  12702. },
  12703. "MCPStatusNeedsClientRegistration": {
  12704. "type": "object",
  12705. "properties": {
  12706. "status": {
  12707. "type": "string",
  12708. "enum": ["needs_client_registration"]
  12709. },
  12710. "error": {
  12711. "type": "string"
  12712. }
  12713. },
  12714. "required": ["status", "error"],
  12715. "additionalProperties": false
  12716. },
  12717. "MCPStatus": {
  12718. "anyOf": [
  12719. {
  12720. "$ref": "#/components/schemas/MCPStatusConnected"
  12721. },
  12722. {
  12723. "$ref": "#/components/schemas/MCPStatusDisabled"
  12724. },
  12725. {
  12726. "$ref": "#/components/schemas/MCPStatusFailed"
  12727. },
  12728. {
  12729. "$ref": "#/components/schemas/MCPStatusNeedsAuth"
  12730. },
  12731. {
  12732. "$ref": "#/components/schemas/MCPStatusNeedsClientRegistration"
  12733. }
  12734. ]
  12735. },
  12736. "McpUnsupportedOAuthError": {
  12737. "type": "object",
  12738. "properties": {
  12739. "error": {
  12740. "type": "string"
  12741. }
  12742. },
  12743. "required": ["error"],
  12744. "additionalProperties": false
  12745. },
  12746. "ProviderAuthMethod": {
  12747. "type": "object",
  12748. "properties": {
  12749. "type": {
  12750. "type": "string",
  12751. "enum": ["oauth", "api"]
  12752. },
  12753. "label": {
  12754. "type": "string"
  12755. },
  12756. "prompts": {
  12757. "type": "array",
  12758. "items": {
  12759. "anyOf": [
  12760. {
  12761. "type": "object",
  12762. "properties": {
  12763. "type": {
  12764. "type": "string",
  12765. "enum": ["text"]
  12766. },
  12767. "key": {
  12768. "type": "string"
  12769. },
  12770. "message": {
  12771. "type": "string"
  12772. },
  12773. "placeholder": {
  12774. "type": "string"
  12775. },
  12776. "when": {
  12777. "type": "object",
  12778. "properties": {
  12779. "key": {
  12780. "type": "string"
  12781. },
  12782. "op": {
  12783. "type": "string",
  12784. "enum": ["eq", "neq"]
  12785. },
  12786. "value": {
  12787. "type": "string"
  12788. }
  12789. },
  12790. "required": ["key", "op", "value"],
  12791. "additionalProperties": false
  12792. }
  12793. },
  12794. "required": ["type", "key", "message"],
  12795. "additionalProperties": false
  12796. },
  12797. {
  12798. "type": "object",
  12799. "properties": {
  12800. "type": {
  12801. "type": "string",
  12802. "enum": ["select"]
  12803. },
  12804. "key": {
  12805. "type": "string"
  12806. },
  12807. "message": {
  12808. "type": "string"
  12809. },
  12810. "options": {
  12811. "type": "array",
  12812. "items": {
  12813. "type": "object",
  12814. "properties": {
  12815. "label": {
  12816. "type": "string"
  12817. },
  12818. "value": {
  12819. "type": "string"
  12820. },
  12821. "hint": {
  12822. "type": "string"
  12823. }
  12824. },
  12825. "required": ["label", "value"],
  12826. "additionalProperties": false
  12827. }
  12828. },
  12829. "when": {
  12830. "type": "object",
  12831. "properties": {
  12832. "key": {
  12833. "type": "string"
  12834. },
  12835. "op": {
  12836. "type": "string",
  12837. "enum": ["eq", "neq"]
  12838. },
  12839. "value": {
  12840. "type": "string"
  12841. }
  12842. },
  12843. "required": ["key", "op", "value"],
  12844. "additionalProperties": false
  12845. }
  12846. },
  12847. "required": ["type", "key", "message", "options"],
  12848. "additionalProperties": false
  12849. }
  12850. ]
  12851. }
  12852. }
  12853. },
  12854. "required": ["type", "label"],
  12855. "additionalProperties": false
  12856. },
  12857. "ProviderAuthAuthorization": {
  12858. "type": "object",
  12859. "properties": {
  12860. "url": {
  12861. "type": "string"
  12862. },
  12863. "method": {
  12864. "type": "string",
  12865. "enum": ["auto", "code"]
  12866. },
  12867. "instructions": {
  12868. "type": "string"
  12869. }
  12870. },
  12871. "required": ["url", "method", "instructions"],
  12872. "additionalProperties": false
  12873. },
  12874. "TextPartInput": {
  12875. "type": "object",
  12876. "properties": {
  12877. "id": {
  12878. "type": "string"
  12879. },
  12880. "type": {
  12881. "type": "string",
  12882. "enum": ["text"]
  12883. },
  12884. "text": {
  12885. "type": "string"
  12886. },
  12887. "synthetic": {
  12888. "type": "boolean"
  12889. },
  12890. "ignored": {
  12891. "type": "boolean"
  12892. },
  12893. "time": {
  12894. "type": "object",
  12895. "properties": {
  12896. "start": {
  12897. "type": "integer",
  12898. "minimum": 0
  12899. },
  12900. "end": {
  12901. "type": "integer",
  12902. "minimum": 0
  12903. }
  12904. },
  12905. "required": ["start"],
  12906. "additionalProperties": false
  12907. },
  12908. "metadata": {
  12909. "type": "object"
  12910. }
  12911. },
  12912. "required": ["type", "text"],
  12913. "additionalProperties": false
  12914. },
  12915. "FilePartInput": {
  12916. "type": "object",
  12917. "properties": {
  12918. "id": {
  12919. "type": "string"
  12920. },
  12921. "type": {
  12922. "type": "string",
  12923. "enum": ["file"]
  12924. },
  12925. "mime": {
  12926. "type": "string"
  12927. },
  12928. "filename": {
  12929. "type": "string"
  12930. },
  12931. "url": {
  12932. "type": "string"
  12933. },
  12934. "source": {
  12935. "$ref": "#/components/schemas/FilePartSource"
  12936. }
  12937. },
  12938. "required": ["type", "mime", "url"],
  12939. "additionalProperties": false
  12940. },
  12941. "AgentPartInput": {
  12942. "type": "object",
  12943. "properties": {
  12944. "id": {
  12945. "type": "string"
  12946. },
  12947. "type": {
  12948. "type": "string",
  12949. "enum": ["agent"]
  12950. },
  12951. "name": {
  12952. "type": "string"
  12953. },
  12954. "source": {
  12955. "type": "object",
  12956. "properties": {
  12957. "value": {
  12958. "type": "string"
  12959. },
  12960. "start": {
  12961. "type": "integer",
  12962. "minimum": 0
  12963. },
  12964. "end": {
  12965. "type": "integer",
  12966. "minimum": 0
  12967. }
  12968. },
  12969. "required": ["value", "start", "end"],
  12970. "additionalProperties": false
  12971. }
  12972. },
  12973. "required": ["type", "name"],
  12974. "additionalProperties": false
  12975. },
  12976. "SubtaskPartInput": {
  12977. "type": "object",
  12978. "properties": {
  12979. "id": {
  12980. "type": "string"
  12981. },
  12982. "type": {
  12983. "type": "string",
  12984. "enum": ["subtask"]
  12985. },
  12986. "prompt": {
  12987. "type": "string"
  12988. },
  12989. "description": {
  12990. "type": "string"
  12991. },
  12992. "agent": {
  12993. "type": "string"
  12994. },
  12995. "model": {
  12996. "type": "object",
  12997. "properties": {
  12998. "providerID": {
  12999. "type": "string"
  13000. },
  13001. "modelID": {
  13002. "type": "string"
  13003. }
  13004. },
  13005. "required": ["providerID", "modelID"],
  13006. "additionalProperties": false
  13007. },
  13008. "command": {
  13009. "type": "string"
  13010. }
  13011. },
  13012. "required": ["type", "prompt", "description", "agent"],
  13013. "additionalProperties": false
  13014. },
  13015. "V2SessionsResponse": {
  13016. "type": "object",
  13017. "properties": {
  13018. "items": {
  13019. "type": "array",
  13020. "items": {
  13021. "$ref": "#/components/schemas/SessionInfo"
  13022. }
  13023. },
  13024. "cursor": {
  13025. "type": "object",
  13026. "properties": {
  13027. "previous": {
  13028. "type": "string"
  13029. },
  13030. "next": {
  13031. "type": "string"
  13032. }
  13033. },
  13034. "additionalProperties": false
  13035. }
  13036. },
  13037. "required": ["items", "cursor"],
  13038. "additionalProperties": false
  13039. },
  13040. "V2SessionMessagesResponse": {
  13041. "type": "object",
  13042. "properties": {
  13043. "items": {
  13044. "type": "array",
  13045. "items": {
  13046. "$ref": "#/components/schemas/SessionMessage"
  13047. }
  13048. },
  13049. "cursor": {
  13050. "type": "object",
  13051. "properties": {
  13052. "previous": {
  13053. "type": "string"
  13054. },
  13055. "next": {
  13056. "type": "string"
  13057. }
  13058. },
  13059. "additionalProperties": false
  13060. }
  13061. },
  13062. "required": ["items", "cursor"],
  13063. "additionalProperties": false
  13064. },
  13065. "EventTuiPromptAppend": {
  13066. "type": "object",
  13067. "properties": {
  13068. "type": {
  13069. "type": "string",
  13070. "enum": ["tui.prompt.append"]
  13071. },
  13072. "properties": {
  13073. "type": "object",
  13074. "properties": {
  13075. "text": {
  13076. "type": "string"
  13077. }
  13078. },
  13079. "required": ["text"],
  13080. "additionalProperties": false
  13081. }
  13082. },
  13083. "required": ["type", "properties"],
  13084. "additionalProperties": false
  13085. },
  13086. "EventTuiCommandExecute": {
  13087. "type": "object",
  13088. "properties": {
  13089. "type": {
  13090. "type": "string",
  13091. "enum": ["tui.command.execute"]
  13092. },
  13093. "properties": {
  13094. "type": "object",
  13095. "properties": {
  13096. "command": {
  13097. "anyOf": [
  13098. {
  13099. "type": "string",
  13100. "enum": [
  13101. "session.list",
  13102. "session.new",
  13103. "session.share",
  13104. "session.interrupt",
  13105. "session.compact",
  13106. "session.page.up",
  13107. "session.page.down",
  13108. "session.line.up",
  13109. "session.line.down",
  13110. "session.half.page.up",
  13111. "session.half.page.down",
  13112. "session.first",
  13113. "session.last",
  13114. "prompt.clear",
  13115. "prompt.submit",
  13116. "agent.cycle"
  13117. ]
  13118. },
  13119. {
  13120. "type": "string"
  13121. }
  13122. ]
  13123. }
  13124. },
  13125. "required": ["command"],
  13126. "additionalProperties": false
  13127. }
  13128. },
  13129. "required": ["type", "properties"],
  13130. "additionalProperties": false
  13131. },
  13132. "EventTuiToastShow": {
  13133. "type": "object",
  13134. "properties": {
  13135. "type": {
  13136. "type": "string",
  13137. "enum": ["tui.toast.show"]
  13138. },
  13139. "properties": {
  13140. "type": "object",
  13141. "properties": {
  13142. "title": {
  13143. "type": "string"
  13144. },
  13145. "message": {
  13146. "type": "string"
  13147. },
  13148. "variant": {
  13149. "type": "string",
  13150. "enum": ["info", "success", "warning", "error"]
  13151. },
  13152. "duration": {
  13153. "type": "integer",
  13154. "exclusiveMinimum": 0
  13155. }
  13156. },
  13157. "required": ["message", "variant"],
  13158. "additionalProperties": false
  13159. }
  13160. },
  13161. "required": ["type", "properties"],
  13162. "additionalProperties": false
  13163. },
  13164. "EventTuiSessionSelect": {
  13165. "type": "object",
  13166. "properties": {
  13167. "type": {
  13168. "type": "string",
  13169. "enum": ["tui.session.select"]
  13170. },
  13171. "properties": {
  13172. "type": "object",
  13173. "properties": {
  13174. "sessionID": {
  13175. "type": "string",
  13176. "description": "Session ID to navigate to"
  13177. }
  13178. },
  13179. "required": ["sessionID"],
  13180. "additionalProperties": false
  13181. }
  13182. },
  13183. "required": ["type", "properties"],
  13184. "additionalProperties": false
  13185. },
  13186. "Workspace": {
  13187. "type": "object",
  13188. "properties": {
  13189. "id": {
  13190. "type": "string"
  13191. },
  13192. "type": {
  13193. "type": "string"
  13194. },
  13195. "name": {
  13196. "type": "string"
  13197. },
  13198. "branch": {
  13199. "anyOf": [
  13200. {
  13201. "type": "string"
  13202. },
  13203. {
  13204. "type": "null"
  13205. }
  13206. ]
  13207. },
  13208. "directory": {
  13209. "anyOf": [
  13210. {
  13211. "type": "string"
  13212. },
  13213. {
  13214. "type": "null"
  13215. }
  13216. ]
  13217. },
  13218. "extra": {
  13219. "anyOf": [
  13220. {},
  13221. {
  13222. "type": "null"
  13223. }
  13224. ]
  13225. },
  13226. "projectID": {
  13227. "type": "string"
  13228. }
  13229. },
  13230. "required": ["id", "type", "name", "branch", "directory", "extra", "projectID"],
  13231. "additionalProperties": false
  13232. },
  13233. "SyncEventMessageUpdated": {
  13234. "type": "object",
  13235. "properties": {
  13236. "type": {
  13237. "type": "string",
  13238. "enum": ["sync"]
  13239. },
  13240. "name": {
  13241. "type": "string",
  13242. "enum": ["message.updated.1"]
  13243. },
  13244. "id": {
  13245. "type": "string"
  13246. },
  13247. "seq": {
  13248. "type": "number"
  13249. },
  13250. "aggregateID": {
  13251. "type": "string",
  13252. "enum": ["sessionID"]
  13253. },
  13254. "data": {
  13255. "type": "object",
  13256. "properties": {
  13257. "sessionID": {
  13258. "type": "string"
  13259. },
  13260. "info": {
  13261. "$ref": "#/components/schemas/Message"
  13262. }
  13263. },
  13264. "required": ["sessionID", "info"],
  13265. "additionalProperties": false
  13266. }
  13267. },
  13268. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  13269. "additionalProperties": false
  13270. },
  13271. "SyncEventMessageRemoved": {
  13272. "type": "object",
  13273. "properties": {
  13274. "type": {
  13275. "type": "string",
  13276. "enum": ["sync"]
  13277. },
  13278. "name": {
  13279. "type": "string",
  13280. "enum": ["message.removed.1"]
  13281. },
  13282. "id": {
  13283. "type": "string"
  13284. },
  13285. "seq": {
  13286. "type": "number"
  13287. },
  13288. "aggregateID": {
  13289. "type": "string",
  13290. "enum": ["sessionID"]
  13291. },
  13292. "data": {
  13293. "type": "object",
  13294. "properties": {
  13295. "sessionID": {
  13296. "type": "string"
  13297. },
  13298. "messageID": {
  13299. "type": "string"
  13300. }
  13301. },
  13302. "required": ["sessionID", "messageID"],
  13303. "additionalProperties": false
  13304. }
  13305. },
  13306. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  13307. "additionalProperties": false
  13308. },
  13309. "SyncEventMessagePartUpdated": {
  13310. "type": "object",
  13311. "properties": {
  13312. "type": {
  13313. "type": "string",
  13314. "enum": ["sync"]
  13315. },
  13316. "name": {
  13317. "type": "string",
  13318. "enum": ["message.part.updated.1"]
  13319. },
  13320. "id": {
  13321. "type": "string"
  13322. },
  13323. "seq": {
  13324. "type": "number"
  13325. },
  13326. "aggregateID": {
  13327. "type": "string",
  13328. "enum": ["sessionID"]
  13329. },
  13330. "data": {
  13331. "type": "object",
  13332. "properties": {
  13333. "sessionID": {
  13334. "type": "string"
  13335. },
  13336. "part": {
  13337. "$ref": "#/components/schemas/Part"
  13338. },
  13339. "time": {
  13340. "type": "integer",
  13341. "minimum": 0
  13342. }
  13343. },
  13344. "required": ["sessionID", "part", "time"],
  13345. "additionalProperties": false
  13346. }
  13347. },
  13348. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  13349. "additionalProperties": false
  13350. },
  13351. "SyncEventMessagePartRemoved": {
  13352. "type": "object",
  13353. "properties": {
  13354. "type": {
  13355. "type": "string",
  13356. "enum": ["sync"]
  13357. },
  13358. "name": {
  13359. "type": "string",
  13360. "enum": ["message.part.removed.1"]
  13361. },
  13362. "id": {
  13363. "type": "string"
  13364. },
  13365. "seq": {
  13366. "type": "number"
  13367. },
  13368. "aggregateID": {
  13369. "type": "string",
  13370. "enum": ["sessionID"]
  13371. },
  13372. "data": {
  13373. "type": "object",
  13374. "properties": {
  13375. "sessionID": {
  13376. "type": "string"
  13377. },
  13378. "messageID": {
  13379. "type": "string"
  13380. },
  13381. "partID": {
  13382. "type": "string"
  13383. }
  13384. },
  13385. "required": ["sessionID", "messageID", "partID"],
  13386. "additionalProperties": false
  13387. }
  13388. },
  13389. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  13390. "additionalProperties": false
  13391. },
  13392. "SyncEventSessionCreated": {
  13393. "type": "object",
  13394. "properties": {
  13395. "type": {
  13396. "type": "string",
  13397. "enum": ["sync"]
  13398. },
  13399. "name": {
  13400. "type": "string",
  13401. "enum": ["session.created.1"]
  13402. },
  13403. "id": {
  13404. "type": "string"
  13405. },
  13406. "seq": {
  13407. "type": "number"
  13408. },
  13409. "aggregateID": {
  13410. "type": "string",
  13411. "enum": ["sessionID"]
  13412. },
  13413. "data": {
  13414. "type": "object",
  13415. "properties": {
  13416. "sessionID": {
  13417. "type": "string"
  13418. },
  13419. "info": {
  13420. "$ref": "#/components/schemas/Session"
  13421. }
  13422. },
  13423. "required": ["sessionID", "info"],
  13424. "additionalProperties": false
  13425. }
  13426. },
  13427. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  13428. "additionalProperties": false
  13429. },
  13430. "SyncEventSessionUpdated": {
  13431. "type": "object",
  13432. "properties": {
  13433. "type": {
  13434. "type": "string",
  13435. "enum": ["sync"]
  13436. },
  13437. "name": {
  13438. "type": "string",
  13439. "enum": ["session.updated.1"]
  13440. },
  13441. "id": {
  13442. "type": "string"
  13443. },
  13444. "seq": {
  13445. "type": "number"
  13446. },
  13447. "aggregateID": {
  13448. "type": "string",
  13449. "enum": ["sessionID"]
  13450. },
  13451. "data": {
  13452. "type": "object",
  13453. "properties": {
  13454. "sessionID": {
  13455. "type": "string"
  13456. },
  13457. "info": {
  13458. "type": "object",
  13459. "properties": {
  13460. "id": {
  13461. "anyOf": [
  13462. {
  13463. "type": "string"
  13464. },
  13465. {
  13466. "type": "null"
  13467. }
  13468. ]
  13469. },
  13470. "slug": {
  13471. "anyOf": [
  13472. {
  13473. "type": "string"
  13474. },
  13475. {
  13476. "type": "null"
  13477. }
  13478. ]
  13479. },
  13480. "projectID": {
  13481. "anyOf": [
  13482. {
  13483. "type": "string"
  13484. },
  13485. {
  13486. "type": "null"
  13487. }
  13488. ]
  13489. },
  13490. "workspaceID": {
  13491. "anyOf": [
  13492. {
  13493. "type": "string"
  13494. },
  13495. {
  13496. "type": "null"
  13497. }
  13498. ]
  13499. },
  13500. "directory": {
  13501. "anyOf": [
  13502. {
  13503. "type": "string"
  13504. },
  13505. {
  13506. "type": "null"
  13507. }
  13508. ]
  13509. },
  13510. "path": {
  13511. "anyOf": [
  13512. {
  13513. "type": "string"
  13514. },
  13515. {
  13516. "type": "null"
  13517. }
  13518. ]
  13519. },
  13520. "parentID": {
  13521. "anyOf": [
  13522. {
  13523. "type": "string"
  13524. },
  13525. {
  13526. "type": "null"
  13527. }
  13528. ]
  13529. },
  13530. "summary": {
  13531. "anyOf": [
  13532. {
  13533. "type": "object",
  13534. "properties": {
  13535. "additions": {
  13536. "type": "integer",
  13537. "minimum": 0
  13538. },
  13539. "deletions": {
  13540. "type": "integer",
  13541. "minimum": 0
  13542. },
  13543. "files": {
  13544. "type": "integer",
  13545. "minimum": 0
  13546. },
  13547. "diffs": {
  13548. "type": "array",
  13549. "items": {
  13550. "$ref": "#/components/schemas/SnapshotFileDiff"
  13551. }
  13552. }
  13553. },
  13554. "required": ["additions", "deletions", "files"],
  13555. "additionalProperties": false
  13556. },
  13557. {
  13558. "type": "null"
  13559. }
  13560. ]
  13561. },
  13562. "share": {
  13563. "type": "object",
  13564. "properties": {
  13565. "url": {
  13566. "anyOf": [
  13567. {
  13568. "type": "string"
  13569. },
  13570. {
  13571. "type": "null"
  13572. }
  13573. ]
  13574. }
  13575. },
  13576. "additionalProperties": false
  13577. },
  13578. "title": {
  13579. "anyOf": [
  13580. {
  13581. "type": "string"
  13582. },
  13583. {
  13584. "type": "null"
  13585. }
  13586. ]
  13587. },
  13588. "agent": {
  13589. "anyOf": [
  13590. {
  13591. "type": "string"
  13592. },
  13593. {
  13594. "type": "null"
  13595. }
  13596. ]
  13597. },
  13598. "model": {
  13599. "anyOf": [
  13600. {
  13601. "type": "object",
  13602. "properties": {
  13603. "id": {
  13604. "type": "string"
  13605. },
  13606. "providerID": {
  13607. "type": "string"
  13608. },
  13609. "variant": {
  13610. "type": "string"
  13611. }
  13612. },
  13613. "required": ["id", "providerID"],
  13614. "additionalProperties": false
  13615. },
  13616. {
  13617. "type": "null"
  13618. }
  13619. ]
  13620. },
  13621. "version": {
  13622. "anyOf": [
  13623. {
  13624. "type": "string"
  13625. },
  13626. {
  13627. "type": "null"
  13628. }
  13629. ]
  13630. },
  13631. "time": {
  13632. "type": "object",
  13633. "properties": {
  13634. "created": {
  13635. "anyOf": [
  13636. {
  13637. "type": "integer",
  13638. "minimum": 0
  13639. },
  13640. {
  13641. "type": "null"
  13642. }
  13643. ]
  13644. },
  13645. "updated": {
  13646. "anyOf": [
  13647. {
  13648. "type": "integer",
  13649. "minimum": 0
  13650. },
  13651. {
  13652. "type": "null"
  13653. }
  13654. ]
  13655. },
  13656. "compacting": {
  13657. "anyOf": [
  13658. {
  13659. "type": "integer",
  13660. "minimum": 0
  13661. },
  13662. {
  13663. "type": "null"
  13664. }
  13665. ]
  13666. },
  13667. "archived": {
  13668. "anyOf": [
  13669. {
  13670. "type": "number"
  13671. },
  13672. {
  13673. "type": "null"
  13674. }
  13675. ]
  13676. }
  13677. },
  13678. "additionalProperties": false
  13679. },
  13680. "permission": {
  13681. "anyOf": [
  13682. {
  13683. "$ref": "#/components/schemas/PermissionRuleset"
  13684. },
  13685. {
  13686. "type": "null"
  13687. }
  13688. ]
  13689. },
  13690. "revert": {
  13691. "anyOf": [
  13692. {
  13693. "type": "object",
  13694. "properties": {
  13695. "messageID": {
  13696. "type": "string"
  13697. },
  13698. "partID": {
  13699. "type": "string"
  13700. },
  13701. "snapshot": {
  13702. "type": "string"
  13703. },
  13704. "diff": {
  13705. "type": "string"
  13706. }
  13707. },
  13708. "required": ["messageID"],
  13709. "additionalProperties": false
  13710. },
  13711. {
  13712. "type": "null"
  13713. }
  13714. ]
  13715. }
  13716. },
  13717. "additionalProperties": false
  13718. }
  13719. },
  13720. "required": ["sessionID", "info"],
  13721. "additionalProperties": false
  13722. }
  13723. },
  13724. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  13725. "additionalProperties": false
  13726. },
  13727. "SyncEventSessionDeleted": {
  13728. "type": "object",
  13729. "properties": {
  13730. "type": {
  13731. "type": "string",
  13732. "enum": ["sync"]
  13733. },
  13734. "name": {
  13735. "type": "string",
  13736. "enum": ["session.deleted.1"]
  13737. },
  13738. "id": {
  13739. "type": "string"
  13740. },
  13741. "seq": {
  13742. "type": "number"
  13743. },
  13744. "aggregateID": {
  13745. "type": "string",
  13746. "enum": ["sessionID"]
  13747. },
  13748. "data": {
  13749. "type": "object",
  13750. "properties": {
  13751. "sessionID": {
  13752. "type": "string"
  13753. },
  13754. "info": {
  13755. "$ref": "#/components/schemas/Session"
  13756. }
  13757. },
  13758. "required": ["sessionID", "info"],
  13759. "additionalProperties": false
  13760. }
  13761. },
  13762. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  13763. "additionalProperties": false
  13764. },
  13765. "SyncEventSessionNextAgentSwitched": {
  13766. "type": "object",
  13767. "properties": {
  13768. "type": {
  13769. "type": "string",
  13770. "enum": ["sync"]
  13771. },
  13772. "name": {
  13773. "type": "string",
  13774. "enum": ["session.next.agent.switched.1"]
  13775. },
  13776. "id": {
  13777. "type": "string"
  13778. },
  13779. "seq": {
  13780. "type": "number"
  13781. },
  13782. "aggregateID": {
  13783. "type": "string",
  13784. "enum": ["sessionID"]
  13785. },
  13786. "data": {
  13787. "type": "object",
  13788. "properties": {
  13789. "timestamp": {
  13790. "type": "number"
  13791. },
  13792. "sessionID": {
  13793. "type": "string"
  13794. },
  13795. "agent": {
  13796. "type": "string"
  13797. }
  13798. },
  13799. "required": ["timestamp", "sessionID", "agent"],
  13800. "additionalProperties": false
  13801. }
  13802. },
  13803. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  13804. "additionalProperties": false
  13805. },
  13806. "SyncEventSessionNextModelSwitched": {
  13807. "type": "object",
  13808. "properties": {
  13809. "type": {
  13810. "type": "string",
  13811. "enum": ["sync"]
  13812. },
  13813. "name": {
  13814. "type": "string",
  13815. "enum": ["session.next.model.switched.1"]
  13816. },
  13817. "id": {
  13818. "type": "string"
  13819. },
  13820. "seq": {
  13821. "type": "number"
  13822. },
  13823. "aggregateID": {
  13824. "type": "string",
  13825. "enum": ["sessionID"]
  13826. },
  13827. "data": {
  13828. "type": "object",
  13829. "properties": {
  13830. "timestamp": {
  13831. "type": "number"
  13832. },
  13833. "sessionID": {
  13834. "type": "string"
  13835. },
  13836. "id": {
  13837. "type": "string"
  13838. },
  13839. "providerID": {
  13840. "type": "string"
  13841. },
  13842. "variant": {
  13843. "type": "string"
  13844. }
  13845. },
  13846. "required": ["timestamp", "sessionID", "id", "providerID"],
  13847. "additionalProperties": false
  13848. }
  13849. },
  13850. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  13851. "additionalProperties": false
  13852. },
  13853. "SyncEventSessionNextPrompted": {
  13854. "type": "object",
  13855. "properties": {
  13856. "type": {
  13857. "type": "string",
  13858. "enum": ["sync"]
  13859. },
  13860. "name": {
  13861. "type": "string",
  13862. "enum": ["session.next.prompted.1"]
  13863. },
  13864. "id": {
  13865. "type": "string"
  13866. },
  13867. "seq": {
  13868. "type": "number"
  13869. },
  13870. "aggregateID": {
  13871. "type": "string",
  13872. "enum": ["sessionID"]
  13873. },
  13874. "data": {
  13875. "type": "object",
  13876. "properties": {
  13877. "timestamp": {
  13878. "type": "number"
  13879. },
  13880. "sessionID": {
  13881. "type": "string"
  13882. },
  13883. "prompt": {
  13884. "$ref": "#/components/schemas/Prompt"
  13885. }
  13886. },
  13887. "required": ["timestamp", "sessionID", "prompt"],
  13888. "additionalProperties": false
  13889. }
  13890. },
  13891. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  13892. "additionalProperties": false
  13893. },
  13894. "SyncEventSessionNextSynthetic": {
  13895. "type": "object",
  13896. "properties": {
  13897. "type": {
  13898. "type": "string",
  13899. "enum": ["sync"]
  13900. },
  13901. "name": {
  13902. "type": "string",
  13903. "enum": ["session.next.synthetic.1"]
  13904. },
  13905. "id": {
  13906. "type": "string"
  13907. },
  13908. "seq": {
  13909. "type": "number"
  13910. },
  13911. "aggregateID": {
  13912. "type": "string",
  13913. "enum": ["sessionID"]
  13914. },
  13915. "data": {
  13916. "type": "object",
  13917. "properties": {
  13918. "timestamp": {
  13919. "type": "number"
  13920. },
  13921. "sessionID": {
  13922. "type": "string"
  13923. },
  13924. "text": {
  13925. "type": "string"
  13926. }
  13927. },
  13928. "required": ["timestamp", "sessionID", "text"],
  13929. "additionalProperties": false
  13930. }
  13931. },
  13932. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  13933. "additionalProperties": false
  13934. },
  13935. "SyncEventSessionNextShellStarted": {
  13936. "type": "object",
  13937. "properties": {
  13938. "type": {
  13939. "type": "string",
  13940. "enum": ["sync"]
  13941. },
  13942. "name": {
  13943. "type": "string",
  13944. "enum": ["session.next.shell.started.1"]
  13945. },
  13946. "id": {
  13947. "type": "string"
  13948. },
  13949. "seq": {
  13950. "type": "number"
  13951. },
  13952. "aggregateID": {
  13953. "type": "string",
  13954. "enum": ["sessionID"]
  13955. },
  13956. "data": {
  13957. "type": "object",
  13958. "properties": {
  13959. "timestamp": {
  13960. "type": "number"
  13961. },
  13962. "sessionID": {
  13963. "type": "string"
  13964. },
  13965. "callID": {
  13966. "type": "string"
  13967. },
  13968. "command": {
  13969. "type": "string"
  13970. }
  13971. },
  13972. "required": ["timestamp", "sessionID", "callID", "command"],
  13973. "additionalProperties": false
  13974. }
  13975. },
  13976. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  13977. "additionalProperties": false
  13978. },
  13979. "SyncEventSessionNextShellEnded": {
  13980. "type": "object",
  13981. "properties": {
  13982. "type": {
  13983. "type": "string",
  13984. "enum": ["sync"]
  13985. },
  13986. "name": {
  13987. "type": "string",
  13988. "enum": ["session.next.shell.ended.1"]
  13989. },
  13990. "id": {
  13991. "type": "string"
  13992. },
  13993. "seq": {
  13994. "type": "number"
  13995. },
  13996. "aggregateID": {
  13997. "type": "string",
  13998. "enum": ["sessionID"]
  13999. },
  14000. "data": {
  14001. "type": "object",
  14002. "properties": {
  14003. "timestamp": {
  14004. "type": "number"
  14005. },
  14006. "sessionID": {
  14007. "type": "string"
  14008. },
  14009. "callID": {
  14010. "type": "string"
  14011. },
  14012. "output": {
  14013. "type": "string"
  14014. }
  14015. },
  14016. "required": ["timestamp", "sessionID", "callID", "output"],
  14017. "additionalProperties": false
  14018. }
  14019. },
  14020. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14021. "additionalProperties": false
  14022. },
  14023. "SyncEventSessionNextStepStarted": {
  14024. "type": "object",
  14025. "properties": {
  14026. "type": {
  14027. "type": "string",
  14028. "enum": ["sync"]
  14029. },
  14030. "name": {
  14031. "type": "string",
  14032. "enum": ["session.next.step.started.1"]
  14033. },
  14034. "id": {
  14035. "type": "string"
  14036. },
  14037. "seq": {
  14038. "type": "number"
  14039. },
  14040. "aggregateID": {
  14041. "type": "string",
  14042. "enum": ["sessionID"]
  14043. },
  14044. "data": {
  14045. "type": "object",
  14046. "properties": {
  14047. "timestamp": {
  14048. "type": "number"
  14049. },
  14050. "sessionID": {
  14051. "type": "string"
  14052. },
  14053. "agent": {
  14054. "type": "string"
  14055. },
  14056. "model": {
  14057. "type": "object",
  14058. "properties": {
  14059. "id": {
  14060. "type": "string"
  14061. },
  14062. "providerID": {
  14063. "type": "string"
  14064. },
  14065. "variant": {
  14066. "type": "string"
  14067. }
  14068. },
  14069. "required": ["id", "providerID"],
  14070. "additionalProperties": false
  14071. },
  14072. "snapshot": {
  14073. "type": "string"
  14074. }
  14075. },
  14076. "required": ["timestamp", "sessionID", "agent", "model"],
  14077. "additionalProperties": false
  14078. }
  14079. },
  14080. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14081. "additionalProperties": false
  14082. },
  14083. "SyncEventSessionNextStepEnded": {
  14084. "type": "object",
  14085. "properties": {
  14086. "type": {
  14087. "type": "string",
  14088. "enum": ["sync"]
  14089. },
  14090. "name": {
  14091. "type": "string",
  14092. "enum": ["session.next.step.ended.1"]
  14093. },
  14094. "id": {
  14095. "type": "string"
  14096. },
  14097. "seq": {
  14098. "type": "number"
  14099. },
  14100. "aggregateID": {
  14101. "type": "string",
  14102. "enum": ["sessionID"]
  14103. },
  14104. "data": {
  14105. "type": "object",
  14106. "properties": {
  14107. "timestamp": {
  14108. "type": "number"
  14109. },
  14110. "sessionID": {
  14111. "type": "string"
  14112. },
  14113. "finish": {
  14114. "type": "string"
  14115. },
  14116. "cost": {
  14117. "type": "number"
  14118. },
  14119. "tokens": {
  14120. "type": "object",
  14121. "properties": {
  14122. "input": {
  14123. "type": "integer",
  14124. "minimum": 0
  14125. },
  14126. "output": {
  14127. "type": "integer",
  14128. "minimum": 0
  14129. },
  14130. "reasoning": {
  14131. "type": "integer",
  14132. "minimum": 0
  14133. },
  14134. "cache": {
  14135. "type": "object",
  14136. "properties": {
  14137. "read": {
  14138. "type": "integer",
  14139. "minimum": 0
  14140. },
  14141. "write": {
  14142. "type": "integer",
  14143. "minimum": 0
  14144. }
  14145. },
  14146. "required": ["read", "write"],
  14147. "additionalProperties": false
  14148. }
  14149. },
  14150. "required": ["input", "output", "reasoning", "cache"],
  14151. "additionalProperties": false
  14152. },
  14153. "snapshot": {
  14154. "type": "string"
  14155. }
  14156. },
  14157. "required": ["timestamp", "sessionID", "finish", "cost", "tokens"],
  14158. "additionalProperties": false
  14159. }
  14160. },
  14161. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14162. "additionalProperties": false
  14163. },
  14164. "SyncEventSessionNextTextStarted": {
  14165. "type": "object",
  14166. "properties": {
  14167. "type": {
  14168. "type": "string",
  14169. "enum": ["sync"]
  14170. },
  14171. "name": {
  14172. "type": "string",
  14173. "enum": ["session.next.text.started.1"]
  14174. },
  14175. "id": {
  14176. "type": "string"
  14177. },
  14178. "seq": {
  14179. "type": "number"
  14180. },
  14181. "aggregateID": {
  14182. "type": "string",
  14183. "enum": ["sessionID"]
  14184. },
  14185. "data": {
  14186. "type": "object",
  14187. "properties": {
  14188. "timestamp": {
  14189. "type": "number"
  14190. },
  14191. "sessionID": {
  14192. "type": "string"
  14193. }
  14194. },
  14195. "required": ["timestamp", "sessionID"],
  14196. "additionalProperties": false
  14197. }
  14198. },
  14199. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14200. "additionalProperties": false
  14201. },
  14202. "SyncEventSessionNextTextDelta": {
  14203. "type": "object",
  14204. "properties": {
  14205. "type": {
  14206. "type": "string",
  14207. "enum": ["sync"]
  14208. },
  14209. "name": {
  14210. "type": "string",
  14211. "enum": ["session.next.text.delta.1"]
  14212. },
  14213. "id": {
  14214. "type": "string"
  14215. },
  14216. "seq": {
  14217. "type": "number"
  14218. },
  14219. "aggregateID": {
  14220. "type": "string",
  14221. "enum": ["sessionID"]
  14222. },
  14223. "data": {
  14224. "type": "object",
  14225. "properties": {
  14226. "timestamp": {
  14227. "type": "number"
  14228. },
  14229. "sessionID": {
  14230. "type": "string"
  14231. },
  14232. "delta": {
  14233. "type": "string"
  14234. }
  14235. },
  14236. "required": ["timestamp", "sessionID", "delta"],
  14237. "additionalProperties": false
  14238. }
  14239. },
  14240. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14241. "additionalProperties": false
  14242. },
  14243. "SyncEventSessionNextTextEnded": {
  14244. "type": "object",
  14245. "properties": {
  14246. "type": {
  14247. "type": "string",
  14248. "enum": ["sync"]
  14249. },
  14250. "name": {
  14251. "type": "string",
  14252. "enum": ["session.next.text.ended.1"]
  14253. },
  14254. "id": {
  14255. "type": "string"
  14256. },
  14257. "seq": {
  14258. "type": "number"
  14259. },
  14260. "aggregateID": {
  14261. "type": "string",
  14262. "enum": ["sessionID"]
  14263. },
  14264. "data": {
  14265. "type": "object",
  14266. "properties": {
  14267. "timestamp": {
  14268. "type": "number"
  14269. },
  14270. "sessionID": {
  14271. "type": "string"
  14272. },
  14273. "text": {
  14274. "type": "string"
  14275. }
  14276. },
  14277. "required": ["timestamp", "sessionID", "text"],
  14278. "additionalProperties": false
  14279. }
  14280. },
  14281. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14282. "additionalProperties": false
  14283. },
  14284. "SyncEventSessionNextReasoningStarted": {
  14285. "type": "object",
  14286. "properties": {
  14287. "type": {
  14288. "type": "string",
  14289. "enum": ["sync"]
  14290. },
  14291. "name": {
  14292. "type": "string",
  14293. "enum": ["session.next.reasoning.started.1"]
  14294. },
  14295. "id": {
  14296. "type": "string"
  14297. },
  14298. "seq": {
  14299. "type": "number"
  14300. },
  14301. "aggregateID": {
  14302. "type": "string",
  14303. "enum": ["sessionID"]
  14304. },
  14305. "data": {
  14306. "type": "object",
  14307. "properties": {
  14308. "timestamp": {
  14309. "type": "number"
  14310. },
  14311. "sessionID": {
  14312. "type": "string"
  14313. },
  14314. "reasoningID": {
  14315. "type": "string"
  14316. }
  14317. },
  14318. "required": ["timestamp", "sessionID", "reasoningID"],
  14319. "additionalProperties": false
  14320. }
  14321. },
  14322. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14323. "additionalProperties": false
  14324. },
  14325. "SyncEventSessionNextReasoningDelta": {
  14326. "type": "object",
  14327. "properties": {
  14328. "type": {
  14329. "type": "string",
  14330. "enum": ["sync"]
  14331. },
  14332. "name": {
  14333. "type": "string",
  14334. "enum": ["session.next.reasoning.delta.1"]
  14335. },
  14336. "id": {
  14337. "type": "string"
  14338. },
  14339. "seq": {
  14340. "type": "number"
  14341. },
  14342. "aggregateID": {
  14343. "type": "string",
  14344. "enum": ["sessionID"]
  14345. },
  14346. "data": {
  14347. "type": "object",
  14348. "properties": {
  14349. "timestamp": {
  14350. "type": "number"
  14351. },
  14352. "sessionID": {
  14353. "type": "string"
  14354. },
  14355. "reasoningID": {
  14356. "type": "string"
  14357. },
  14358. "delta": {
  14359. "type": "string"
  14360. }
  14361. },
  14362. "required": ["timestamp", "sessionID", "reasoningID", "delta"],
  14363. "additionalProperties": false
  14364. }
  14365. },
  14366. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14367. "additionalProperties": false
  14368. },
  14369. "SyncEventSessionNextReasoningEnded": {
  14370. "type": "object",
  14371. "properties": {
  14372. "type": {
  14373. "type": "string",
  14374. "enum": ["sync"]
  14375. },
  14376. "name": {
  14377. "type": "string",
  14378. "enum": ["session.next.reasoning.ended.1"]
  14379. },
  14380. "id": {
  14381. "type": "string"
  14382. },
  14383. "seq": {
  14384. "type": "number"
  14385. },
  14386. "aggregateID": {
  14387. "type": "string",
  14388. "enum": ["sessionID"]
  14389. },
  14390. "data": {
  14391. "type": "object",
  14392. "properties": {
  14393. "timestamp": {
  14394. "type": "number"
  14395. },
  14396. "sessionID": {
  14397. "type": "string"
  14398. },
  14399. "reasoningID": {
  14400. "type": "string"
  14401. },
  14402. "text": {
  14403. "type": "string"
  14404. }
  14405. },
  14406. "required": ["timestamp", "sessionID", "reasoningID", "text"],
  14407. "additionalProperties": false
  14408. }
  14409. },
  14410. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14411. "additionalProperties": false
  14412. },
  14413. "SyncEventSessionNextToolInputStarted": {
  14414. "type": "object",
  14415. "properties": {
  14416. "type": {
  14417. "type": "string",
  14418. "enum": ["sync"]
  14419. },
  14420. "name": {
  14421. "type": "string",
  14422. "enum": ["session.next.tool.input.started.1"]
  14423. },
  14424. "id": {
  14425. "type": "string"
  14426. },
  14427. "seq": {
  14428. "type": "number"
  14429. },
  14430. "aggregateID": {
  14431. "type": "string",
  14432. "enum": ["sessionID"]
  14433. },
  14434. "data": {
  14435. "type": "object",
  14436. "properties": {
  14437. "timestamp": {
  14438. "type": "number"
  14439. },
  14440. "sessionID": {
  14441. "type": "string"
  14442. },
  14443. "callID": {
  14444. "type": "string"
  14445. },
  14446. "name": {
  14447. "type": "string"
  14448. }
  14449. },
  14450. "required": ["timestamp", "sessionID", "callID", "name"],
  14451. "additionalProperties": false
  14452. }
  14453. },
  14454. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14455. "additionalProperties": false
  14456. },
  14457. "SyncEventSessionNextToolInputDelta": {
  14458. "type": "object",
  14459. "properties": {
  14460. "type": {
  14461. "type": "string",
  14462. "enum": ["sync"]
  14463. },
  14464. "name": {
  14465. "type": "string",
  14466. "enum": ["session.next.tool.input.delta.1"]
  14467. },
  14468. "id": {
  14469. "type": "string"
  14470. },
  14471. "seq": {
  14472. "type": "number"
  14473. },
  14474. "aggregateID": {
  14475. "type": "string",
  14476. "enum": ["sessionID"]
  14477. },
  14478. "data": {
  14479. "type": "object",
  14480. "properties": {
  14481. "timestamp": {
  14482. "type": "number"
  14483. },
  14484. "sessionID": {
  14485. "type": "string"
  14486. },
  14487. "callID": {
  14488. "type": "string"
  14489. },
  14490. "delta": {
  14491. "type": "string"
  14492. }
  14493. },
  14494. "required": ["timestamp", "sessionID", "callID", "delta"],
  14495. "additionalProperties": false
  14496. }
  14497. },
  14498. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14499. "additionalProperties": false
  14500. },
  14501. "SyncEventSessionNextToolInputEnded": {
  14502. "type": "object",
  14503. "properties": {
  14504. "type": {
  14505. "type": "string",
  14506. "enum": ["sync"]
  14507. },
  14508. "name": {
  14509. "type": "string",
  14510. "enum": ["session.next.tool.input.ended.1"]
  14511. },
  14512. "id": {
  14513. "type": "string"
  14514. },
  14515. "seq": {
  14516. "type": "number"
  14517. },
  14518. "aggregateID": {
  14519. "type": "string",
  14520. "enum": ["sessionID"]
  14521. },
  14522. "data": {
  14523. "type": "object",
  14524. "properties": {
  14525. "timestamp": {
  14526. "type": "number"
  14527. },
  14528. "sessionID": {
  14529. "type": "string"
  14530. },
  14531. "callID": {
  14532. "type": "string"
  14533. },
  14534. "text": {
  14535. "type": "string"
  14536. }
  14537. },
  14538. "required": ["timestamp", "sessionID", "callID", "text"],
  14539. "additionalProperties": false
  14540. }
  14541. },
  14542. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14543. "additionalProperties": false
  14544. },
  14545. "SyncEventSessionNextToolCalled": {
  14546. "type": "object",
  14547. "properties": {
  14548. "type": {
  14549. "type": "string",
  14550. "enum": ["sync"]
  14551. },
  14552. "name": {
  14553. "type": "string",
  14554. "enum": ["session.next.tool.called.1"]
  14555. },
  14556. "id": {
  14557. "type": "string"
  14558. },
  14559. "seq": {
  14560. "type": "number"
  14561. },
  14562. "aggregateID": {
  14563. "type": "string",
  14564. "enum": ["sessionID"]
  14565. },
  14566. "data": {
  14567. "type": "object",
  14568. "properties": {
  14569. "timestamp": {
  14570. "type": "number"
  14571. },
  14572. "sessionID": {
  14573. "type": "string"
  14574. },
  14575. "callID": {
  14576. "type": "string"
  14577. },
  14578. "tool": {
  14579. "type": "string"
  14580. },
  14581. "input": {
  14582. "type": "object"
  14583. },
  14584. "provider": {
  14585. "type": "object",
  14586. "properties": {
  14587. "executed": {
  14588. "type": "boolean"
  14589. },
  14590. "metadata": {
  14591. "type": "object"
  14592. }
  14593. },
  14594. "required": ["executed"],
  14595. "additionalProperties": false
  14596. }
  14597. },
  14598. "required": ["timestamp", "sessionID", "callID", "tool", "input", "provider"],
  14599. "additionalProperties": false
  14600. }
  14601. },
  14602. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14603. "additionalProperties": false
  14604. },
  14605. "SyncEventSessionNextToolProgress": {
  14606. "type": "object",
  14607. "properties": {
  14608. "type": {
  14609. "type": "string",
  14610. "enum": ["sync"]
  14611. },
  14612. "name": {
  14613. "type": "string",
  14614. "enum": ["session.next.tool.progress.1"]
  14615. },
  14616. "id": {
  14617. "type": "string"
  14618. },
  14619. "seq": {
  14620. "type": "number"
  14621. },
  14622. "aggregateID": {
  14623. "type": "string",
  14624. "enum": ["sessionID"]
  14625. },
  14626. "data": {
  14627. "type": "object",
  14628. "properties": {
  14629. "timestamp": {
  14630. "type": "number"
  14631. },
  14632. "sessionID": {
  14633. "type": "string"
  14634. },
  14635. "callID": {
  14636. "type": "string"
  14637. },
  14638. "structured": {
  14639. "type": "object"
  14640. },
  14641. "content": {
  14642. "type": "array",
  14643. "items": {
  14644. "anyOf": [
  14645. {
  14646. "$ref": "#/components/schemas/ToolTextContent"
  14647. },
  14648. {
  14649. "$ref": "#/components/schemas/ToolFileContent"
  14650. }
  14651. ]
  14652. }
  14653. }
  14654. },
  14655. "required": ["timestamp", "sessionID", "callID", "structured", "content"],
  14656. "additionalProperties": false
  14657. }
  14658. },
  14659. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14660. "additionalProperties": false
  14661. },
  14662. "SyncEventSessionNextToolSuccess": {
  14663. "type": "object",
  14664. "properties": {
  14665. "type": {
  14666. "type": "string",
  14667. "enum": ["sync"]
  14668. },
  14669. "name": {
  14670. "type": "string",
  14671. "enum": ["session.next.tool.success.1"]
  14672. },
  14673. "id": {
  14674. "type": "string"
  14675. },
  14676. "seq": {
  14677. "type": "number"
  14678. },
  14679. "aggregateID": {
  14680. "type": "string",
  14681. "enum": ["sessionID"]
  14682. },
  14683. "data": {
  14684. "type": "object",
  14685. "properties": {
  14686. "timestamp": {
  14687. "type": "number"
  14688. },
  14689. "sessionID": {
  14690. "type": "string"
  14691. },
  14692. "callID": {
  14693. "type": "string"
  14694. },
  14695. "structured": {
  14696. "type": "object"
  14697. },
  14698. "content": {
  14699. "type": "array",
  14700. "items": {
  14701. "anyOf": [
  14702. {
  14703. "$ref": "#/components/schemas/ToolTextContent"
  14704. },
  14705. {
  14706. "$ref": "#/components/schemas/ToolFileContent"
  14707. }
  14708. ]
  14709. }
  14710. },
  14711. "provider": {
  14712. "type": "object",
  14713. "properties": {
  14714. "executed": {
  14715. "type": "boolean"
  14716. },
  14717. "metadata": {
  14718. "type": "object"
  14719. }
  14720. },
  14721. "required": ["executed"],
  14722. "additionalProperties": false
  14723. }
  14724. },
  14725. "required": ["timestamp", "sessionID", "callID", "structured", "content", "provider"],
  14726. "additionalProperties": false
  14727. }
  14728. },
  14729. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14730. "additionalProperties": false
  14731. },
  14732. "SyncEventSessionNextToolError": {
  14733. "type": "object",
  14734. "properties": {
  14735. "type": {
  14736. "type": "string",
  14737. "enum": ["sync"]
  14738. },
  14739. "name": {
  14740. "type": "string",
  14741. "enum": ["session.next.tool.error.1"]
  14742. },
  14743. "id": {
  14744. "type": "string"
  14745. },
  14746. "seq": {
  14747. "type": "number"
  14748. },
  14749. "aggregateID": {
  14750. "type": "string",
  14751. "enum": ["sessionID"]
  14752. },
  14753. "data": {
  14754. "type": "object",
  14755. "properties": {
  14756. "timestamp": {
  14757. "type": "number"
  14758. },
  14759. "sessionID": {
  14760. "type": "string"
  14761. },
  14762. "callID": {
  14763. "type": "string"
  14764. },
  14765. "error": {
  14766. "type": "object",
  14767. "properties": {
  14768. "type": {
  14769. "type": "string"
  14770. },
  14771. "message": {
  14772. "type": "string"
  14773. }
  14774. },
  14775. "required": ["type", "message"],
  14776. "additionalProperties": false
  14777. },
  14778. "provider": {
  14779. "type": "object",
  14780. "properties": {
  14781. "executed": {
  14782. "type": "boolean"
  14783. },
  14784. "metadata": {
  14785. "type": "object"
  14786. }
  14787. },
  14788. "required": ["executed"],
  14789. "additionalProperties": false
  14790. }
  14791. },
  14792. "required": ["timestamp", "sessionID", "callID", "error", "provider"],
  14793. "additionalProperties": false
  14794. }
  14795. },
  14796. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14797. "additionalProperties": false
  14798. },
  14799. "SyncEventSessionNextRetried": {
  14800. "type": "object",
  14801. "properties": {
  14802. "type": {
  14803. "type": "string",
  14804. "enum": ["sync"]
  14805. },
  14806. "name": {
  14807. "type": "string",
  14808. "enum": ["session.next.retried.1"]
  14809. },
  14810. "id": {
  14811. "type": "string"
  14812. },
  14813. "seq": {
  14814. "type": "number"
  14815. },
  14816. "aggregateID": {
  14817. "type": "string",
  14818. "enum": ["sessionID"]
  14819. },
  14820. "data": {
  14821. "type": "object",
  14822. "properties": {
  14823. "timestamp": {
  14824. "type": "number"
  14825. },
  14826. "sessionID": {
  14827. "type": "string"
  14828. },
  14829. "attempt": {
  14830. "type": "integer",
  14831. "minimum": 0
  14832. },
  14833. "error": {
  14834. "$ref": "#/components/schemas/SessionNextRetry_error"
  14835. }
  14836. },
  14837. "required": ["timestamp", "sessionID", "attempt", "error"],
  14838. "additionalProperties": false
  14839. }
  14840. },
  14841. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14842. "additionalProperties": false
  14843. },
  14844. "SyncEventSessionNextCompactionStarted": {
  14845. "type": "object",
  14846. "properties": {
  14847. "type": {
  14848. "type": "string",
  14849. "enum": ["sync"]
  14850. },
  14851. "name": {
  14852. "type": "string",
  14853. "enum": ["session.next.compaction.started.1"]
  14854. },
  14855. "id": {
  14856. "type": "string"
  14857. },
  14858. "seq": {
  14859. "type": "number"
  14860. },
  14861. "aggregateID": {
  14862. "type": "string",
  14863. "enum": ["sessionID"]
  14864. },
  14865. "data": {
  14866. "type": "object",
  14867. "properties": {
  14868. "timestamp": {
  14869. "type": "number"
  14870. },
  14871. "sessionID": {
  14872. "type": "string"
  14873. },
  14874. "reason": {
  14875. "type": "string",
  14876. "enum": ["auto", "manual"]
  14877. }
  14878. },
  14879. "required": ["timestamp", "sessionID", "reason"],
  14880. "additionalProperties": false
  14881. }
  14882. },
  14883. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14884. "additionalProperties": false
  14885. },
  14886. "SyncEventSessionNextCompactionDelta": {
  14887. "type": "object",
  14888. "properties": {
  14889. "type": {
  14890. "type": "string",
  14891. "enum": ["sync"]
  14892. },
  14893. "name": {
  14894. "type": "string",
  14895. "enum": ["session.next.compaction.delta.1"]
  14896. },
  14897. "id": {
  14898. "type": "string"
  14899. },
  14900. "seq": {
  14901. "type": "number"
  14902. },
  14903. "aggregateID": {
  14904. "type": "string",
  14905. "enum": ["sessionID"]
  14906. },
  14907. "data": {
  14908. "type": "object",
  14909. "properties": {
  14910. "timestamp": {
  14911. "type": "number"
  14912. },
  14913. "sessionID": {
  14914. "type": "string"
  14915. },
  14916. "text": {
  14917. "type": "string"
  14918. }
  14919. },
  14920. "required": ["timestamp", "sessionID", "text"],
  14921. "additionalProperties": false
  14922. }
  14923. },
  14924. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14925. "additionalProperties": false
  14926. },
  14927. "SyncEventSessionNextCompactionEnded": {
  14928. "type": "object",
  14929. "properties": {
  14930. "type": {
  14931. "type": "string",
  14932. "enum": ["sync"]
  14933. },
  14934. "name": {
  14935. "type": "string",
  14936. "enum": ["session.next.compaction.ended.1"]
  14937. },
  14938. "id": {
  14939. "type": "string"
  14940. },
  14941. "seq": {
  14942. "type": "number"
  14943. },
  14944. "aggregateID": {
  14945. "type": "string",
  14946. "enum": ["sessionID"]
  14947. },
  14948. "data": {
  14949. "type": "object",
  14950. "properties": {
  14951. "timestamp": {
  14952. "type": "number"
  14953. },
  14954. "sessionID": {
  14955. "type": "string"
  14956. },
  14957. "text": {
  14958. "type": "string"
  14959. },
  14960. "include": {
  14961. "type": "string"
  14962. }
  14963. },
  14964. "required": ["timestamp", "sessionID", "text"],
  14965. "additionalProperties": false
  14966. }
  14967. },
  14968. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14969. "additionalProperties": false
  14970. },
  14971. "EventServerInstanceDisposed": {
  14972. "type": "object",
  14973. "properties": {
  14974. "id": {
  14975. "type": "string"
  14976. },
  14977. "type": {
  14978. "type": "string",
  14979. "enum": ["server.instance.disposed"]
  14980. },
  14981. "properties": {
  14982. "type": "object",
  14983. "properties": {
  14984. "directory": {
  14985. "type": "string"
  14986. }
  14987. },
  14988. "required": ["directory"],
  14989. "additionalProperties": false
  14990. }
  14991. },
  14992. "required": ["id", "type", "properties"],
  14993. "additionalProperties": false
  14994. },
  14995. "EventFileEdited": {
  14996. "type": "object",
  14997. "properties": {
  14998. "id": {
  14999. "type": "string"
  15000. },
  15001. "type": {
  15002. "type": "string",
  15003. "enum": ["file.edited"]
  15004. },
  15005. "properties": {
  15006. "type": "object",
  15007. "properties": {
  15008. "file": {
  15009. "type": "string"
  15010. }
  15011. },
  15012. "required": ["file"],
  15013. "additionalProperties": false
  15014. }
  15015. },
  15016. "required": ["id", "type", "properties"],
  15017. "additionalProperties": false
  15018. },
  15019. "EventFileWatcherUpdated": {
  15020. "type": "object",
  15021. "properties": {
  15022. "id": {
  15023. "type": "string"
  15024. },
  15025. "type": {
  15026. "type": "string",
  15027. "enum": ["file.watcher.updated"]
  15028. },
  15029. "properties": {
  15030. "type": "object",
  15031. "properties": {
  15032. "file": {
  15033. "type": "string"
  15034. },
  15035. "event": {
  15036. "type": "string",
  15037. "enum": ["add", "change", "unlink"]
  15038. }
  15039. },
  15040. "required": ["file", "event"],
  15041. "additionalProperties": false
  15042. }
  15043. },
  15044. "required": ["id", "type", "properties"],
  15045. "additionalProperties": false
  15046. },
  15047. "EventLspClientDiagnostics": {
  15048. "type": "object",
  15049. "properties": {
  15050. "id": {
  15051. "type": "string"
  15052. },
  15053. "type": {
  15054. "type": "string",
  15055. "enum": ["lsp.client.diagnostics"]
  15056. },
  15057. "properties": {
  15058. "type": "object",
  15059. "properties": {
  15060. "serverID": {
  15061. "type": "string"
  15062. },
  15063. "path": {
  15064. "type": "string"
  15065. }
  15066. },
  15067. "required": ["serverID", "path"],
  15068. "additionalProperties": false
  15069. }
  15070. },
  15071. "required": ["id", "type", "properties"],
  15072. "additionalProperties": false
  15073. },
  15074. "EventLspUpdated": {
  15075. "type": "object",
  15076. "properties": {
  15077. "id": {
  15078. "type": "string"
  15079. },
  15080. "type": {
  15081. "type": "string",
  15082. "enum": ["lsp.updated"]
  15083. },
  15084. "properties": {
  15085. "type": "object",
  15086. "properties": {}
  15087. }
  15088. },
  15089. "required": ["id", "type", "properties"],
  15090. "additionalProperties": false
  15091. },
  15092. "EventMessagePartDelta": {
  15093. "type": "object",
  15094. "properties": {
  15095. "id": {
  15096. "type": "string"
  15097. },
  15098. "type": {
  15099. "type": "string",
  15100. "enum": ["message.part.delta"]
  15101. },
  15102. "properties": {
  15103. "type": "object",
  15104. "properties": {
  15105. "sessionID": {
  15106. "type": "string"
  15107. },
  15108. "messageID": {
  15109. "type": "string"
  15110. },
  15111. "partID": {
  15112. "type": "string"
  15113. },
  15114. "field": {
  15115. "type": "string"
  15116. },
  15117. "delta": {
  15118. "type": "string"
  15119. }
  15120. },
  15121. "required": ["sessionID", "messageID", "partID", "field", "delta"],
  15122. "additionalProperties": false
  15123. }
  15124. },
  15125. "required": ["id", "type", "properties"],
  15126. "additionalProperties": false
  15127. },
  15128. "EventPermissionAsked": {
  15129. "type": "object",
  15130. "properties": {
  15131. "id": {
  15132. "type": "string"
  15133. },
  15134. "type": {
  15135. "type": "string",
  15136. "enum": ["permission.asked"]
  15137. },
  15138. "properties": {
  15139. "$ref": "#/components/schemas/PermissionRequest"
  15140. }
  15141. },
  15142. "required": ["id", "type", "properties"],
  15143. "additionalProperties": false
  15144. },
  15145. "EventPermissionReplied": {
  15146. "type": "object",
  15147. "properties": {
  15148. "id": {
  15149. "type": "string"
  15150. },
  15151. "type": {
  15152. "type": "string",
  15153. "enum": ["permission.replied"]
  15154. },
  15155. "properties": {
  15156. "type": "object",
  15157. "properties": {
  15158. "sessionID": {
  15159. "type": "string"
  15160. },
  15161. "requestID": {
  15162. "type": "string"
  15163. },
  15164. "reply": {
  15165. "type": "string",
  15166. "enum": ["once", "always", "reject"]
  15167. }
  15168. },
  15169. "required": ["sessionID", "requestID", "reply"],
  15170. "additionalProperties": false
  15171. }
  15172. },
  15173. "required": ["id", "type", "properties"],
  15174. "additionalProperties": false
  15175. },
  15176. "EventSessionDiff": {
  15177. "type": "object",
  15178. "properties": {
  15179. "id": {
  15180. "type": "string"
  15181. },
  15182. "type": {
  15183. "type": "string",
  15184. "enum": ["session.diff"]
  15185. },
  15186. "properties": {
  15187. "type": "object",
  15188. "properties": {
  15189. "sessionID": {
  15190. "type": "string"
  15191. },
  15192. "diff": {
  15193. "type": "array",
  15194. "items": {
  15195. "$ref": "#/components/schemas/SnapshotFileDiff"
  15196. }
  15197. }
  15198. },
  15199. "required": ["sessionID", "diff"],
  15200. "additionalProperties": false
  15201. }
  15202. },
  15203. "required": ["id", "type", "properties"],
  15204. "additionalProperties": false
  15205. },
  15206. "EventSessionError": {
  15207. "type": "object",
  15208. "properties": {
  15209. "id": {
  15210. "type": "string"
  15211. },
  15212. "type": {
  15213. "type": "string",
  15214. "enum": ["session.error"]
  15215. },
  15216. "properties": {
  15217. "type": "object",
  15218. "properties": {
  15219. "sessionID": {
  15220. "type": "string"
  15221. },
  15222. "error": {
  15223. "anyOf": [
  15224. {
  15225. "$ref": "#/components/schemas/ProviderAuthError"
  15226. },
  15227. {
  15228. "$ref": "#/components/schemas/UnknownError"
  15229. },
  15230. {
  15231. "$ref": "#/components/schemas/MessageOutputLengthError"
  15232. },
  15233. {
  15234. "$ref": "#/components/schemas/MessageAbortedError"
  15235. },
  15236. {
  15237. "$ref": "#/components/schemas/StructuredOutputError"
  15238. },
  15239. {
  15240. "$ref": "#/components/schemas/ContextOverflowError"
  15241. },
  15242. {
  15243. "$ref": "#/components/schemas/APIError"
  15244. }
  15245. ]
  15246. }
  15247. },
  15248. "additionalProperties": false
  15249. }
  15250. },
  15251. "required": ["id", "type", "properties"],
  15252. "additionalProperties": false
  15253. },
  15254. "EventInstallationUpdated": {
  15255. "type": "object",
  15256. "properties": {
  15257. "id": {
  15258. "type": "string"
  15259. },
  15260. "type": {
  15261. "type": "string",
  15262. "enum": ["installation.updated"]
  15263. },
  15264. "properties": {
  15265. "type": "object",
  15266. "properties": {
  15267. "version": {
  15268. "type": "string"
  15269. }
  15270. },
  15271. "required": ["version"],
  15272. "additionalProperties": false
  15273. }
  15274. },
  15275. "required": ["id", "type", "properties"],
  15276. "additionalProperties": false
  15277. },
  15278. "EventInstallationUpdate-available": {
  15279. "type": "object",
  15280. "properties": {
  15281. "id": {
  15282. "type": "string"
  15283. },
  15284. "type": {
  15285. "type": "string",
  15286. "enum": ["installation.update-available"]
  15287. },
  15288. "properties": {
  15289. "type": "object",
  15290. "properties": {
  15291. "version": {
  15292. "type": "string"
  15293. }
  15294. },
  15295. "required": ["version"],
  15296. "additionalProperties": false
  15297. }
  15298. },
  15299. "required": ["id", "type", "properties"],
  15300. "additionalProperties": false
  15301. },
  15302. "EventQuestionAsked": {
  15303. "type": "object",
  15304. "properties": {
  15305. "id": {
  15306. "type": "string"
  15307. },
  15308. "type": {
  15309. "type": "string",
  15310. "enum": ["question.asked"]
  15311. },
  15312. "properties": {
  15313. "$ref": "#/components/schemas/QuestionRequest"
  15314. }
  15315. },
  15316. "required": ["id", "type", "properties"],
  15317. "additionalProperties": false
  15318. },
  15319. "EventQuestionReplied": {
  15320. "type": "object",
  15321. "properties": {
  15322. "id": {
  15323. "type": "string"
  15324. },
  15325. "type": {
  15326. "type": "string",
  15327. "enum": ["question.replied"]
  15328. },
  15329. "properties": {
  15330. "$ref": "#/components/schemas/QuestionReplied"
  15331. }
  15332. },
  15333. "required": ["id", "type", "properties"],
  15334. "additionalProperties": false
  15335. },
  15336. "EventQuestionRejected": {
  15337. "type": "object",
  15338. "properties": {
  15339. "id": {
  15340. "type": "string"
  15341. },
  15342. "type": {
  15343. "type": "string",
  15344. "enum": ["question.rejected"]
  15345. },
  15346. "properties": {
  15347. "$ref": "#/components/schemas/QuestionRejected"
  15348. }
  15349. },
  15350. "required": ["id", "type", "properties"],
  15351. "additionalProperties": false
  15352. },
  15353. "EventTodoUpdated": {
  15354. "type": "object",
  15355. "properties": {
  15356. "id": {
  15357. "type": "string"
  15358. },
  15359. "type": {
  15360. "type": "string",
  15361. "enum": ["todo.updated"]
  15362. },
  15363. "properties": {
  15364. "type": "object",
  15365. "properties": {
  15366. "sessionID": {
  15367. "type": "string"
  15368. },
  15369. "todos": {
  15370. "type": "array",
  15371. "items": {
  15372. "$ref": "#/components/schemas/Todo"
  15373. }
  15374. }
  15375. },
  15376. "required": ["sessionID", "todos"],
  15377. "additionalProperties": false
  15378. }
  15379. },
  15380. "required": ["id", "type", "properties"],
  15381. "additionalProperties": false
  15382. },
  15383. "EventSessionStatus": {
  15384. "type": "object",
  15385. "properties": {
  15386. "id": {
  15387. "type": "string"
  15388. },
  15389. "type": {
  15390. "type": "string",
  15391. "enum": ["session.status"]
  15392. },
  15393. "properties": {
  15394. "type": "object",
  15395. "properties": {
  15396. "sessionID": {
  15397. "type": "string"
  15398. },
  15399. "status": {
  15400. "$ref": "#/components/schemas/SessionStatus"
  15401. }
  15402. },
  15403. "required": ["sessionID", "status"],
  15404. "additionalProperties": false
  15405. }
  15406. },
  15407. "required": ["id", "type", "properties"],
  15408. "additionalProperties": false
  15409. },
  15410. "EventSessionIdle": {
  15411. "type": "object",
  15412. "properties": {
  15413. "id": {
  15414. "type": "string"
  15415. },
  15416. "type": {
  15417. "type": "string",
  15418. "enum": ["session.idle"]
  15419. },
  15420. "properties": {
  15421. "type": "object",
  15422. "properties": {
  15423. "sessionID": {
  15424. "type": "string"
  15425. }
  15426. },
  15427. "required": ["sessionID"],
  15428. "additionalProperties": false
  15429. }
  15430. },
  15431. "required": ["id", "type", "properties"],
  15432. "additionalProperties": false
  15433. },
  15434. "EventSessionCompacted": {
  15435. "type": "object",
  15436. "properties": {
  15437. "id": {
  15438. "type": "string"
  15439. },
  15440. "type": {
  15441. "type": "string",
  15442. "enum": ["session.compacted"]
  15443. },
  15444. "properties": {
  15445. "type": "object",
  15446. "properties": {
  15447. "sessionID": {
  15448. "type": "string"
  15449. }
  15450. },
  15451. "required": ["sessionID"],
  15452. "additionalProperties": false
  15453. }
  15454. },
  15455. "required": ["id", "type", "properties"],
  15456. "additionalProperties": false
  15457. },
  15458. "EventMcpToolsChanged": {
  15459. "type": "object",
  15460. "properties": {
  15461. "id": {
  15462. "type": "string"
  15463. },
  15464. "type": {
  15465. "type": "string",
  15466. "enum": ["mcp.tools.changed"]
  15467. },
  15468. "properties": {
  15469. "type": "object",
  15470. "properties": {
  15471. "server": {
  15472. "type": "string"
  15473. }
  15474. },
  15475. "required": ["server"],
  15476. "additionalProperties": false
  15477. }
  15478. },
  15479. "required": ["id", "type", "properties"],
  15480. "additionalProperties": false
  15481. },
  15482. "EventMcpBrowserOpenFailed": {
  15483. "type": "object",
  15484. "properties": {
  15485. "id": {
  15486. "type": "string"
  15487. },
  15488. "type": {
  15489. "type": "string",
  15490. "enum": ["mcp.browser.open.failed"]
  15491. },
  15492. "properties": {
  15493. "type": "object",
  15494. "properties": {
  15495. "mcpName": {
  15496. "type": "string"
  15497. },
  15498. "url": {
  15499. "type": "string"
  15500. }
  15501. },
  15502. "required": ["mcpName", "url"],
  15503. "additionalProperties": false
  15504. }
  15505. },
  15506. "required": ["id", "type", "properties"],
  15507. "additionalProperties": false
  15508. },
  15509. "EventCommandExecuted": {
  15510. "type": "object",
  15511. "properties": {
  15512. "id": {
  15513. "type": "string"
  15514. },
  15515. "type": {
  15516. "type": "string",
  15517. "enum": ["command.executed"]
  15518. },
  15519. "properties": {
  15520. "type": "object",
  15521. "properties": {
  15522. "name": {
  15523. "type": "string"
  15524. },
  15525. "sessionID": {
  15526. "type": "string"
  15527. },
  15528. "arguments": {
  15529. "type": "string"
  15530. },
  15531. "messageID": {
  15532. "type": "string"
  15533. }
  15534. },
  15535. "required": ["name", "sessionID", "arguments", "messageID"],
  15536. "additionalProperties": false
  15537. }
  15538. },
  15539. "required": ["id", "type", "properties"],
  15540. "additionalProperties": false
  15541. },
  15542. "EventProjectUpdated": {
  15543. "type": "object",
  15544. "properties": {
  15545. "id": {
  15546. "type": "string"
  15547. },
  15548. "type": {
  15549. "type": "string",
  15550. "enum": ["project.updated"]
  15551. },
  15552. "properties": {
  15553. "$ref": "#/components/schemas/Project"
  15554. }
  15555. },
  15556. "required": ["id", "type", "properties"],
  15557. "additionalProperties": false
  15558. },
  15559. "EventVcsBranchUpdated": {
  15560. "type": "object",
  15561. "properties": {
  15562. "id": {
  15563. "type": "string"
  15564. },
  15565. "type": {
  15566. "type": "string",
  15567. "enum": ["vcs.branch.updated"]
  15568. },
  15569. "properties": {
  15570. "type": "object",
  15571. "properties": {
  15572. "branch": {
  15573. "type": "string"
  15574. }
  15575. },
  15576. "additionalProperties": false
  15577. }
  15578. },
  15579. "required": ["id", "type", "properties"],
  15580. "additionalProperties": false
  15581. },
  15582. "EventWorkspaceReady": {
  15583. "type": "object",
  15584. "properties": {
  15585. "id": {
  15586. "type": "string"
  15587. },
  15588. "type": {
  15589. "type": "string",
  15590. "enum": ["workspace.ready"]
  15591. },
  15592. "properties": {
  15593. "type": "object",
  15594. "properties": {
  15595. "name": {
  15596. "type": "string"
  15597. }
  15598. },
  15599. "required": ["name"],
  15600. "additionalProperties": false
  15601. }
  15602. },
  15603. "required": ["id", "type", "properties"],
  15604. "additionalProperties": false
  15605. },
  15606. "EventWorkspaceFailed": {
  15607. "type": "object",
  15608. "properties": {
  15609. "id": {
  15610. "type": "string"
  15611. },
  15612. "type": {
  15613. "type": "string",
  15614. "enum": ["workspace.failed"]
  15615. },
  15616. "properties": {
  15617. "type": "object",
  15618. "properties": {
  15619. "message": {
  15620. "type": "string"
  15621. }
  15622. },
  15623. "required": ["message"],
  15624. "additionalProperties": false
  15625. }
  15626. },
  15627. "required": ["id", "type", "properties"],
  15628. "additionalProperties": false
  15629. },
  15630. "EventWorkspaceRestore": {
  15631. "type": "object",
  15632. "properties": {
  15633. "id": {
  15634. "type": "string"
  15635. },
  15636. "type": {
  15637. "type": "string",
  15638. "enum": ["workspace.restore"]
  15639. },
  15640. "properties": {
  15641. "type": "object",
  15642. "properties": {
  15643. "workspaceID": {
  15644. "type": "string"
  15645. },
  15646. "sessionID": {
  15647. "type": "string"
  15648. },
  15649. "total": {
  15650. "type": "integer",
  15651. "minimum": 0
  15652. },
  15653. "step": {
  15654. "type": "integer",
  15655. "minimum": 0
  15656. }
  15657. },
  15658. "required": ["workspaceID", "sessionID", "total", "step"],
  15659. "additionalProperties": false
  15660. }
  15661. },
  15662. "required": ["id", "type", "properties"],
  15663. "additionalProperties": false
  15664. },
  15665. "EventWorkspaceStatus": {
  15666. "type": "object",
  15667. "properties": {
  15668. "id": {
  15669. "type": "string"
  15670. },
  15671. "type": {
  15672. "type": "string",
  15673. "enum": ["workspace.status"]
  15674. },
  15675. "properties": {
  15676. "type": "object",
  15677. "properties": {
  15678. "workspaceID": {
  15679. "type": "string"
  15680. },
  15681. "status": {
  15682. "type": "string",
  15683. "enum": ["connected", "connecting", "disconnected", "error"]
  15684. }
  15685. },
  15686. "required": ["workspaceID", "status"],
  15687. "additionalProperties": false
  15688. }
  15689. },
  15690. "required": ["id", "type", "properties"],
  15691. "additionalProperties": false
  15692. },
  15693. "EventWorktreeReady": {
  15694. "type": "object",
  15695. "properties": {
  15696. "id": {
  15697. "type": "string"
  15698. },
  15699. "type": {
  15700. "type": "string",
  15701. "enum": ["worktree.ready"]
  15702. },
  15703. "properties": {
  15704. "type": "object",
  15705. "properties": {
  15706. "name": {
  15707. "type": "string"
  15708. },
  15709. "branch": {
  15710. "type": "string"
  15711. }
  15712. },
  15713. "required": ["name", "branch"],
  15714. "additionalProperties": false
  15715. }
  15716. },
  15717. "required": ["id", "type", "properties"],
  15718. "additionalProperties": false
  15719. },
  15720. "EventWorktreeFailed": {
  15721. "type": "object",
  15722. "properties": {
  15723. "id": {
  15724. "type": "string"
  15725. },
  15726. "type": {
  15727. "type": "string",
  15728. "enum": ["worktree.failed"]
  15729. },
  15730. "properties": {
  15731. "type": "object",
  15732. "properties": {
  15733. "message": {
  15734. "type": "string"
  15735. }
  15736. },
  15737. "required": ["message"],
  15738. "additionalProperties": false
  15739. }
  15740. },
  15741. "required": ["id", "type", "properties"],
  15742. "additionalProperties": false
  15743. },
  15744. "EventPtyCreated": {
  15745. "type": "object",
  15746. "properties": {
  15747. "id": {
  15748. "type": "string"
  15749. },
  15750. "type": {
  15751. "type": "string",
  15752. "enum": ["pty.created"]
  15753. },
  15754. "properties": {
  15755. "type": "object",
  15756. "properties": {
  15757. "info": {
  15758. "$ref": "#/components/schemas/Pty"
  15759. }
  15760. },
  15761. "required": ["info"],
  15762. "additionalProperties": false
  15763. }
  15764. },
  15765. "required": ["id", "type", "properties"],
  15766. "additionalProperties": false
  15767. },
  15768. "EventPtyUpdated": {
  15769. "type": "object",
  15770. "properties": {
  15771. "id": {
  15772. "type": "string"
  15773. },
  15774. "type": {
  15775. "type": "string",
  15776. "enum": ["pty.updated"]
  15777. },
  15778. "properties": {
  15779. "type": "object",
  15780. "properties": {
  15781. "info": {
  15782. "$ref": "#/components/schemas/Pty"
  15783. }
  15784. },
  15785. "required": ["info"],
  15786. "additionalProperties": false
  15787. }
  15788. },
  15789. "required": ["id", "type", "properties"],
  15790. "additionalProperties": false
  15791. },
  15792. "EventPtyExited": {
  15793. "type": "object",
  15794. "properties": {
  15795. "id": {
  15796. "type": "string"
  15797. },
  15798. "type": {
  15799. "type": "string",
  15800. "enum": ["pty.exited"]
  15801. },
  15802. "properties": {
  15803. "type": "object",
  15804. "properties": {
  15805. "id": {
  15806. "type": "string"
  15807. },
  15808. "exitCode": {
  15809. "type": "integer",
  15810. "minimum": 0
  15811. }
  15812. },
  15813. "required": ["id", "exitCode"],
  15814. "additionalProperties": false
  15815. }
  15816. },
  15817. "required": ["id", "type", "properties"],
  15818. "additionalProperties": false
  15819. },
  15820. "EventPtyDeleted": {
  15821. "type": "object",
  15822. "properties": {
  15823. "id": {
  15824. "type": "string"
  15825. },
  15826. "type": {
  15827. "type": "string",
  15828. "enum": ["pty.deleted"]
  15829. },
  15830. "properties": {
  15831. "type": "object",
  15832. "properties": {
  15833. "id": {
  15834. "type": "string"
  15835. }
  15836. },
  15837. "required": ["id"],
  15838. "additionalProperties": false
  15839. }
  15840. },
  15841. "required": ["id", "type", "properties"],
  15842. "additionalProperties": false
  15843. },
  15844. "EventMessageUpdated": {
  15845. "type": "object",
  15846. "properties": {
  15847. "id": {
  15848. "type": "string"
  15849. },
  15850. "type": {
  15851. "type": "string",
  15852. "enum": ["message.updated"]
  15853. },
  15854. "properties": {
  15855. "type": "object",
  15856. "properties": {
  15857. "sessionID": {
  15858. "type": "string"
  15859. },
  15860. "info": {
  15861. "$ref": "#/components/schemas/Message"
  15862. }
  15863. },
  15864. "required": ["sessionID", "info"],
  15865. "additionalProperties": false
  15866. }
  15867. },
  15868. "required": ["id", "type", "properties"],
  15869. "additionalProperties": false
  15870. },
  15871. "EventMessageRemoved": {
  15872. "type": "object",
  15873. "properties": {
  15874. "id": {
  15875. "type": "string"
  15876. },
  15877. "type": {
  15878. "type": "string",
  15879. "enum": ["message.removed"]
  15880. },
  15881. "properties": {
  15882. "type": "object",
  15883. "properties": {
  15884. "sessionID": {
  15885. "type": "string"
  15886. },
  15887. "messageID": {
  15888. "type": "string"
  15889. }
  15890. },
  15891. "required": ["sessionID", "messageID"],
  15892. "additionalProperties": false
  15893. }
  15894. },
  15895. "required": ["id", "type", "properties"],
  15896. "additionalProperties": false
  15897. },
  15898. "EventMessagePartUpdated": {
  15899. "type": "object",
  15900. "properties": {
  15901. "id": {
  15902. "type": "string"
  15903. },
  15904. "type": {
  15905. "type": "string",
  15906. "enum": ["message.part.updated"]
  15907. },
  15908. "properties": {
  15909. "type": "object",
  15910. "properties": {
  15911. "sessionID": {
  15912. "type": "string"
  15913. },
  15914. "part": {
  15915. "$ref": "#/components/schemas/Part"
  15916. },
  15917. "time": {
  15918. "type": "integer",
  15919. "minimum": 0
  15920. }
  15921. },
  15922. "required": ["sessionID", "part", "time"],
  15923. "additionalProperties": false
  15924. }
  15925. },
  15926. "required": ["id", "type", "properties"],
  15927. "additionalProperties": false
  15928. },
  15929. "EventMessagePartRemoved": {
  15930. "type": "object",
  15931. "properties": {
  15932. "id": {
  15933. "type": "string"
  15934. },
  15935. "type": {
  15936. "type": "string",
  15937. "enum": ["message.part.removed"]
  15938. },
  15939. "properties": {
  15940. "type": "object",
  15941. "properties": {
  15942. "sessionID": {
  15943. "type": "string"
  15944. },
  15945. "messageID": {
  15946. "type": "string"
  15947. },
  15948. "partID": {
  15949. "type": "string"
  15950. }
  15951. },
  15952. "required": ["sessionID", "messageID", "partID"],
  15953. "additionalProperties": false
  15954. }
  15955. },
  15956. "required": ["id", "type", "properties"],
  15957. "additionalProperties": false
  15958. },
  15959. "EventSessionCreated": {
  15960. "type": "object",
  15961. "properties": {
  15962. "id": {
  15963. "type": "string"
  15964. },
  15965. "type": {
  15966. "type": "string",
  15967. "enum": ["session.created"]
  15968. },
  15969. "properties": {
  15970. "type": "object",
  15971. "properties": {
  15972. "sessionID": {
  15973. "type": "string"
  15974. },
  15975. "info": {
  15976. "$ref": "#/components/schemas/Session"
  15977. }
  15978. },
  15979. "required": ["sessionID", "info"],
  15980. "additionalProperties": false
  15981. }
  15982. },
  15983. "required": ["id", "type", "properties"],
  15984. "additionalProperties": false
  15985. },
  15986. "EventSessionUpdated": {
  15987. "type": "object",
  15988. "properties": {
  15989. "id": {
  15990. "type": "string"
  15991. },
  15992. "type": {
  15993. "type": "string",
  15994. "enum": ["session.updated"]
  15995. },
  15996. "properties": {
  15997. "type": "object",
  15998. "properties": {
  15999. "sessionID": {
  16000. "type": "string"
  16001. },
  16002. "info": {
  16003. "$ref": "#/components/schemas/Session"
  16004. }
  16005. },
  16006. "required": ["sessionID", "info"],
  16007. "additionalProperties": false
  16008. }
  16009. },
  16010. "required": ["id", "type", "properties"],
  16011. "additionalProperties": false
  16012. },
  16013. "EventSessionDeleted": {
  16014. "type": "object",
  16015. "properties": {
  16016. "id": {
  16017. "type": "string"
  16018. },
  16019. "type": {
  16020. "type": "string",
  16021. "enum": ["session.deleted"]
  16022. },
  16023. "properties": {
  16024. "type": "object",
  16025. "properties": {
  16026. "sessionID": {
  16027. "type": "string"
  16028. },
  16029. "info": {
  16030. "$ref": "#/components/schemas/Session"
  16031. }
  16032. },
  16033. "required": ["sessionID", "info"],
  16034. "additionalProperties": false
  16035. }
  16036. },
  16037. "required": ["id", "type", "properties"],
  16038. "additionalProperties": false
  16039. },
  16040. "EventSessionNextAgentSwitched": {
  16041. "type": "object",
  16042. "properties": {
  16043. "id": {
  16044. "type": "string"
  16045. },
  16046. "type": {
  16047. "type": "string",
  16048. "enum": ["session.next.agent.switched"]
  16049. },
  16050. "properties": {
  16051. "type": "object",
  16052. "properties": {
  16053. "timestamp": {
  16054. "type": "number"
  16055. },
  16056. "sessionID": {
  16057. "type": "string"
  16058. },
  16059. "agent": {
  16060. "type": "string"
  16061. }
  16062. },
  16063. "required": ["timestamp", "sessionID", "agent"],
  16064. "additionalProperties": false
  16065. }
  16066. },
  16067. "required": ["id", "type", "properties"],
  16068. "additionalProperties": false
  16069. },
  16070. "EventSessionNextModelSwitched": {
  16071. "type": "object",
  16072. "properties": {
  16073. "id": {
  16074. "type": "string"
  16075. },
  16076. "type": {
  16077. "type": "string",
  16078. "enum": ["session.next.model.switched"]
  16079. },
  16080. "properties": {
  16081. "type": "object",
  16082. "properties": {
  16083. "timestamp": {
  16084. "type": "number"
  16085. },
  16086. "sessionID": {
  16087. "type": "string"
  16088. },
  16089. "id": {
  16090. "type": "string"
  16091. },
  16092. "providerID": {
  16093. "type": "string"
  16094. },
  16095. "variant": {
  16096. "type": "string"
  16097. }
  16098. },
  16099. "required": ["timestamp", "sessionID", "id", "providerID"],
  16100. "additionalProperties": false
  16101. }
  16102. },
  16103. "required": ["id", "type", "properties"],
  16104. "additionalProperties": false
  16105. },
  16106. "PromptSource": {
  16107. "type": "object",
  16108. "properties": {
  16109. "start": {
  16110. "type": "number"
  16111. },
  16112. "end": {
  16113. "type": "number"
  16114. },
  16115. "text": {
  16116. "type": "string"
  16117. }
  16118. },
  16119. "required": ["start", "end", "text"],
  16120. "additionalProperties": false
  16121. },
  16122. "PromptFileAttachment": {
  16123. "type": "object",
  16124. "properties": {
  16125. "uri": {
  16126. "type": "string"
  16127. },
  16128. "mime": {
  16129. "type": "string"
  16130. },
  16131. "name": {
  16132. "type": "string"
  16133. },
  16134. "description": {
  16135. "type": "string"
  16136. },
  16137. "source": {
  16138. "$ref": "#/components/schemas/PromptSource"
  16139. }
  16140. },
  16141. "required": ["uri", "mime"],
  16142. "additionalProperties": false
  16143. },
  16144. "PromptAgentAttachment": {
  16145. "type": "object",
  16146. "properties": {
  16147. "name": {
  16148. "type": "string"
  16149. },
  16150. "source": {
  16151. "$ref": "#/components/schemas/PromptSource"
  16152. }
  16153. },
  16154. "required": ["name"],
  16155. "additionalProperties": false
  16156. },
  16157. "EventSessionNextPrompted": {
  16158. "type": "object",
  16159. "properties": {
  16160. "id": {
  16161. "type": "string"
  16162. },
  16163. "type": {
  16164. "type": "string",
  16165. "enum": ["session.next.prompted"]
  16166. },
  16167. "properties": {
  16168. "type": "object",
  16169. "properties": {
  16170. "timestamp": {
  16171. "type": "number"
  16172. },
  16173. "sessionID": {
  16174. "type": "string"
  16175. },
  16176. "prompt": {
  16177. "$ref": "#/components/schemas/Prompt"
  16178. }
  16179. },
  16180. "required": ["timestamp", "sessionID", "prompt"],
  16181. "additionalProperties": false
  16182. }
  16183. },
  16184. "required": ["id", "type", "properties"],
  16185. "additionalProperties": false
  16186. },
  16187. "EventSessionNextSynthetic": {
  16188. "type": "object",
  16189. "properties": {
  16190. "id": {
  16191. "type": "string"
  16192. },
  16193. "type": {
  16194. "type": "string",
  16195. "enum": ["session.next.synthetic"]
  16196. },
  16197. "properties": {
  16198. "type": "object",
  16199. "properties": {
  16200. "timestamp": {
  16201. "type": "number"
  16202. },
  16203. "sessionID": {
  16204. "type": "string"
  16205. },
  16206. "text": {
  16207. "type": "string"
  16208. }
  16209. },
  16210. "required": ["timestamp", "sessionID", "text"],
  16211. "additionalProperties": false
  16212. }
  16213. },
  16214. "required": ["id", "type", "properties"],
  16215. "additionalProperties": false
  16216. },
  16217. "EventSessionNextShellStarted": {
  16218. "type": "object",
  16219. "properties": {
  16220. "id": {
  16221. "type": "string"
  16222. },
  16223. "type": {
  16224. "type": "string",
  16225. "enum": ["session.next.shell.started"]
  16226. },
  16227. "properties": {
  16228. "type": "object",
  16229. "properties": {
  16230. "timestamp": {
  16231. "type": "number"
  16232. },
  16233. "sessionID": {
  16234. "type": "string"
  16235. },
  16236. "callID": {
  16237. "type": "string"
  16238. },
  16239. "command": {
  16240. "type": "string"
  16241. }
  16242. },
  16243. "required": ["timestamp", "sessionID", "callID", "command"],
  16244. "additionalProperties": false
  16245. }
  16246. },
  16247. "required": ["id", "type", "properties"],
  16248. "additionalProperties": false
  16249. },
  16250. "EventSessionNextShellEnded": {
  16251. "type": "object",
  16252. "properties": {
  16253. "id": {
  16254. "type": "string"
  16255. },
  16256. "type": {
  16257. "type": "string",
  16258. "enum": ["session.next.shell.ended"]
  16259. },
  16260. "properties": {
  16261. "type": "object",
  16262. "properties": {
  16263. "timestamp": {
  16264. "type": "number"
  16265. },
  16266. "sessionID": {
  16267. "type": "string"
  16268. },
  16269. "callID": {
  16270. "type": "string"
  16271. },
  16272. "output": {
  16273. "type": "string"
  16274. }
  16275. },
  16276. "required": ["timestamp", "sessionID", "callID", "output"],
  16277. "additionalProperties": false
  16278. }
  16279. },
  16280. "required": ["id", "type", "properties"],
  16281. "additionalProperties": false
  16282. },
  16283. "EventSessionNextStepStarted": {
  16284. "type": "object",
  16285. "properties": {
  16286. "id": {
  16287. "type": "string"
  16288. },
  16289. "type": {
  16290. "type": "string",
  16291. "enum": ["session.next.step.started"]
  16292. },
  16293. "properties": {
  16294. "type": "object",
  16295. "properties": {
  16296. "timestamp": {
  16297. "type": "number"
  16298. },
  16299. "sessionID": {
  16300. "type": "string"
  16301. },
  16302. "agent": {
  16303. "type": "string"
  16304. },
  16305. "model": {
  16306. "type": "object",
  16307. "properties": {
  16308. "id": {
  16309. "type": "string"
  16310. },
  16311. "providerID": {
  16312. "type": "string"
  16313. },
  16314. "variant": {
  16315. "type": "string"
  16316. }
  16317. },
  16318. "required": ["id", "providerID"],
  16319. "additionalProperties": false
  16320. },
  16321. "snapshot": {
  16322. "type": "string"
  16323. }
  16324. },
  16325. "required": ["timestamp", "sessionID", "agent", "model"],
  16326. "additionalProperties": false
  16327. }
  16328. },
  16329. "required": ["id", "type", "properties"],
  16330. "additionalProperties": false
  16331. },
  16332. "EventSessionNextStepEnded": {
  16333. "type": "object",
  16334. "properties": {
  16335. "id": {
  16336. "type": "string"
  16337. },
  16338. "type": {
  16339. "type": "string",
  16340. "enum": ["session.next.step.ended"]
  16341. },
  16342. "properties": {
  16343. "type": "object",
  16344. "properties": {
  16345. "timestamp": {
  16346. "type": "number"
  16347. },
  16348. "sessionID": {
  16349. "type": "string"
  16350. },
  16351. "finish": {
  16352. "type": "string"
  16353. },
  16354. "cost": {
  16355. "type": "number"
  16356. },
  16357. "tokens": {
  16358. "type": "object",
  16359. "properties": {
  16360. "input": {
  16361. "type": "integer",
  16362. "minimum": 0
  16363. },
  16364. "output": {
  16365. "type": "integer",
  16366. "minimum": 0
  16367. },
  16368. "reasoning": {
  16369. "type": "integer",
  16370. "minimum": 0
  16371. },
  16372. "cache": {
  16373. "type": "object",
  16374. "properties": {
  16375. "read": {
  16376. "type": "integer",
  16377. "minimum": 0
  16378. },
  16379. "write": {
  16380. "type": "integer",
  16381. "minimum": 0
  16382. }
  16383. },
  16384. "required": ["read", "write"],
  16385. "additionalProperties": false
  16386. }
  16387. },
  16388. "required": ["input", "output", "reasoning", "cache"],
  16389. "additionalProperties": false
  16390. },
  16391. "snapshot": {
  16392. "type": "string"
  16393. }
  16394. },
  16395. "required": ["timestamp", "sessionID", "finish", "cost", "tokens"],
  16396. "additionalProperties": false
  16397. }
  16398. },
  16399. "required": ["id", "type", "properties"],
  16400. "additionalProperties": false
  16401. },
  16402. "EventSessionNextTextStarted": {
  16403. "type": "object",
  16404. "properties": {
  16405. "id": {
  16406. "type": "string"
  16407. },
  16408. "type": {
  16409. "type": "string",
  16410. "enum": ["session.next.text.started"]
  16411. },
  16412. "properties": {
  16413. "type": "object",
  16414. "properties": {
  16415. "timestamp": {
  16416. "type": "number"
  16417. },
  16418. "sessionID": {
  16419. "type": "string"
  16420. }
  16421. },
  16422. "required": ["timestamp", "sessionID"],
  16423. "additionalProperties": false
  16424. }
  16425. },
  16426. "required": ["id", "type", "properties"],
  16427. "additionalProperties": false
  16428. },
  16429. "EventSessionNextTextDelta": {
  16430. "type": "object",
  16431. "properties": {
  16432. "id": {
  16433. "type": "string"
  16434. },
  16435. "type": {
  16436. "type": "string",
  16437. "enum": ["session.next.text.delta"]
  16438. },
  16439. "properties": {
  16440. "type": "object",
  16441. "properties": {
  16442. "timestamp": {
  16443. "type": "number"
  16444. },
  16445. "sessionID": {
  16446. "type": "string"
  16447. },
  16448. "delta": {
  16449. "type": "string"
  16450. }
  16451. },
  16452. "required": ["timestamp", "sessionID", "delta"],
  16453. "additionalProperties": false
  16454. }
  16455. },
  16456. "required": ["id", "type", "properties"],
  16457. "additionalProperties": false
  16458. },
  16459. "EventSessionNextTextEnded": {
  16460. "type": "object",
  16461. "properties": {
  16462. "id": {
  16463. "type": "string"
  16464. },
  16465. "type": {
  16466. "type": "string",
  16467. "enum": ["session.next.text.ended"]
  16468. },
  16469. "properties": {
  16470. "type": "object",
  16471. "properties": {
  16472. "timestamp": {
  16473. "type": "number"
  16474. },
  16475. "sessionID": {
  16476. "type": "string"
  16477. },
  16478. "text": {
  16479. "type": "string"
  16480. }
  16481. },
  16482. "required": ["timestamp", "sessionID", "text"],
  16483. "additionalProperties": false
  16484. }
  16485. },
  16486. "required": ["id", "type", "properties"],
  16487. "additionalProperties": false
  16488. },
  16489. "EventSessionNextReasoningStarted": {
  16490. "type": "object",
  16491. "properties": {
  16492. "id": {
  16493. "type": "string"
  16494. },
  16495. "type": {
  16496. "type": "string",
  16497. "enum": ["session.next.reasoning.started"]
  16498. },
  16499. "properties": {
  16500. "type": "object",
  16501. "properties": {
  16502. "timestamp": {
  16503. "type": "number"
  16504. },
  16505. "sessionID": {
  16506. "type": "string"
  16507. },
  16508. "reasoningID": {
  16509. "type": "string"
  16510. }
  16511. },
  16512. "required": ["timestamp", "sessionID", "reasoningID"],
  16513. "additionalProperties": false
  16514. }
  16515. },
  16516. "required": ["id", "type", "properties"],
  16517. "additionalProperties": false
  16518. },
  16519. "EventSessionNextReasoningDelta": {
  16520. "type": "object",
  16521. "properties": {
  16522. "id": {
  16523. "type": "string"
  16524. },
  16525. "type": {
  16526. "type": "string",
  16527. "enum": ["session.next.reasoning.delta"]
  16528. },
  16529. "properties": {
  16530. "type": "object",
  16531. "properties": {
  16532. "timestamp": {
  16533. "type": "number"
  16534. },
  16535. "sessionID": {
  16536. "type": "string"
  16537. },
  16538. "reasoningID": {
  16539. "type": "string"
  16540. },
  16541. "delta": {
  16542. "type": "string"
  16543. }
  16544. },
  16545. "required": ["timestamp", "sessionID", "reasoningID", "delta"],
  16546. "additionalProperties": false
  16547. }
  16548. },
  16549. "required": ["id", "type", "properties"],
  16550. "additionalProperties": false
  16551. },
  16552. "EventSessionNextReasoningEnded": {
  16553. "type": "object",
  16554. "properties": {
  16555. "id": {
  16556. "type": "string"
  16557. },
  16558. "type": {
  16559. "type": "string",
  16560. "enum": ["session.next.reasoning.ended"]
  16561. },
  16562. "properties": {
  16563. "type": "object",
  16564. "properties": {
  16565. "timestamp": {
  16566. "type": "number"
  16567. },
  16568. "sessionID": {
  16569. "type": "string"
  16570. },
  16571. "reasoningID": {
  16572. "type": "string"
  16573. },
  16574. "text": {
  16575. "type": "string"
  16576. }
  16577. },
  16578. "required": ["timestamp", "sessionID", "reasoningID", "text"],
  16579. "additionalProperties": false
  16580. }
  16581. },
  16582. "required": ["id", "type", "properties"],
  16583. "additionalProperties": false
  16584. },
  16585. "EventSessionNextToolInputStarted": {
  16586. "type": "object",
  16587. "properties": {
  16588. "id": {
  16589. "type": "string"
  16590. },
  16591. "type": {
  16592. "type": "string",
  16593. "enum": ["session.next.tool.input.started"]
  16594. },
  16595. "properties": {
  16596. "type": "object",
  16597. "properties": {
  16598. "timestamp": {
  16599. "type": "number"
  16600. },
  16601. "sessionID": {
  16602. "type": "string"
  16603. },
  16604. "callID": {
  16605. "type": "string"
  16606. },
  16607. "name": {
  16608. "type": "string"
  16609. }
  16610. },
  16611. "required": ["timestamp", "sessionID", "callID", "name"],
  16612. "additionalProperties": false
  16613. }
  16614. },
  16615. "required": ["id", "type", "properties"],
  16616. "additionalProperties": false
  16617. },
  16618. "EventSessionNextToolInputDelta": {
  16619. "type": "object",
  16620. "properties": {
  16621. "id": {
  16622. "type": "string"
  16623. },
  16624. "type": {
  16625. "type": "string",
  16626. "enum": ["session.next.tool.input.delta"]
  16627. },
  16628. "properties": {
  16629. "type": "object",
  16630. "properties": {
  16631. "timestamp": {
  16632. "type": "number"
  16633. },
  16634. "sessionID": {
  16635. "type": "string"
  16636. },
  16637. "callID": {
  16638. "type": "string"
  16639. },
  16640. "delta": {
  16641. "type": "string"
  16642. }
  16643. },
  16644. "required": ["timestamp", "sessionID", "callID", "delta"],
  16645. "additionalProperties": false
  16646. }
  16647. },
  16648. "required": ["id", "type", "properties"],
  16649. "additionalProperties": false
  16650. },
  16651. "EventSessionNextToolInputEnded": {
  16652. "type": "object",
  16653. "properties": {
  16654. "id": {
  16655. "type": "string"
  16656. },
  16657. "type": {
  16658. "type": "string",
  16659. "enum": ["session.next.tool.input.ended"]
  16660. },
  16661. "properties": {
  16662. "type": "object",
  16663. "properties": {
  16664. "timestamp": {
  16665. "type": "number"
  16666. },
  16667. "sessionID": {
  16668. "type": "string"
  16669. },
  16670. "callID": {
  16671. "type": "string"
  16672. },
  16673. "text": {
  16674. "type": "string"
  16675. }
  16676. },
  16677. "required": ["timestamp", "sessionID", "callID", "text"],
  16678. "additionalProperties": false
  16679. }
  16680. },
  16681. "required": ["id", "type", "properties"],
  16682. "additionalProperties": false
  16683. },
  16684. "EventSessionNextToolCalled": {
  16685. "type": "object",
  16686. "properties": {
  16687. "id": {
  16688. "type": "string"
  16689. },
  16690. "type": {
  16691. "type": "string",
  16692. "enum": ["session.next.tool.called"]
  16693. },
  16694. "properties": {
  16695. "type": "object",
  16696. "properties": {
  16697. "timestamp": {
  16698. "type": "number"
  16699. },
  16700. "sessionID": {
  16701. "type": "string"
  16702. },
  16703. "callID": {
  16704. "type": "string"
  16705. },
  16706. "tool": {
  16707. "type": "string"
  16708. },
  16709. "input": {
  16710. "type": "object"
  16711. },
  16712. "provider": {
  16713. "type": "object",
  16714. "properties": {
  16715. "executed": {
  16716. "type": "boolean"
  16717. },
  16718. "metadata": {
  16719. "type": "object"
  16720. }
  16721. },
  16722. "required": ["executed"],
  16723. "additionalProperties": false
  16724. }
  16725. },
  16726. "required": ["timestamp", "sessionID", "callID", "tool", "input", "provider"],
  16727. "additionalProperties": false
  16728. }
  16729. },
  16730. "required": ["id", "type", "properties"],
  16731. "additionalProperties": false
  16732. },
  16733. "ToolTextContent": {
  16734. "type": "object",
  16735. "properties": {
  16736. "type": {
  16737. "type": "string",
  16738. "enum": ["text"]
  16739. },
  16740. "text": {
  16741. "type": "string"
  16742. }
  16743. },
  16744. "required": ["type", "text"],
  16745. "additionalProperties": false
  16746. },
  16747. "ToolFileContent": {
  16748. "type": "object",
  16749. "properties": {
  16750. "type": {
  16751. "type": "string",
  16752. "enum": ["file"]
  16753. },
  16754. "uri": {
  16755. "type": "string"
  16756. },
  16757. "mime": {
  16758. "type": "string"
  16759. },
  16760. "name": {
  16761. "type": "string"
  16762. }
  16763. },
  16764. "required": ["type", "uri", "mime"],
  16765. "additionalProperties": false
  16766. },
  16767. "EventSessionNextToolProgress": {
  16768. "type": "object",
  16769. "properties": {
  16770. "id": {
  16771. "type": "string"
  16772. },
  16773. "type": {
  16774. "type": "string",
  16775. "enum": ["session.next.tool.progress"]
  16776. },
  16777. "properties": {
  16778. "type": "object",
  16779. "properties": {
  16780. "timestamp": {
  16781. "type": "number"
  16782. },
  16783. "sessionID": {
  16784. "type": "string"
  16785. },
  16786. "callID": {
  16787. "type": "string"
  16788. },
  16789. "structured": {
  16790. "type": "object"
  16791. },
  16792. "content": {
  16793. "type": "array",
  16794. "items": {
  16795. "anyOf": [
  16796. {
  16797. "$ref": "#/components/schemas/ToolTextContent"
  16798. },
  16799. {
  16800. "$ref": "#/components/schemas/ToolFileContent"
  16801. }
  16802. ]
  16803. }
  16804. }
  16805. },
  16806. "required": ["timestamp", "sessionID", "callID", "structured", "content"],
  16807. "additionalProperties": false
  16808. }
  16809. },
  16810. "required": ["id", "type", "properties"],
  16811. "additionalProperties": false
  16812. },
  16813. "EventSessionNextToolSuccess": {
  16814. "type": "object",
  16815. "properties": {
  16816. "id": {
  16817. "type": "string"
  16818. },
  16819. "type": {
  16820. "type": "string",
  16821. "enum": ["session.next.tool.success"]
  16822. },
  16823. "properties": {
  16824. "type": "object",
  16825. "properties": {
  16826. "timestamp": {
  16827. "type": "number"
  16828. },
  16829. "sessionID": {
  16830. "type": "string"
  16831. },
  16832. "callID": {
  16833. "type": "string"
  16834. },
  16835. "structured": {
  16836. "type": "object"
  16837. },
  16838. "content": {
  16839. "type": "array",
  16840. "items": {
  16841. "anyOf": [
  16842. {
  16843. "$ref": "#/components/schemas/ToolTextContent"
  16844. },
  16845. {
  16846. "$ref": "#/components/schemas/ToolFileContent"
  16847. }
  16848. ]
  16849. }
  16850. },
  16851. "provider": {
  16852. "type": "object",
  16853. "properties": {
  16854. "executed": {
  16855. "type": "boolean"
  16856. },
  16857. "metadata": {
  16858. "type": "object"
  16859. }
  16860. },
  16861. "required": ["executed"],
  16862. "additionalProperties": false
  16863. }
  16864. },
  16865. "required": ["timestamp", "sessionID", "callID", "structured", "content", "provider"],
  16866. "additionalProperties": false
  16867. }
  16868. },
  16869. "required": ["id", "type", "properties"],
  16870. "additionalProperties": false
  16871. },
  16872. "EventSessionNextToolError": {
  16873. "type": "object",
  16874. "properties": {
  16875. "id": {
  16876. "type": "string"
  16877. },
  16878. "type": {
  16879. "type": "string",
  16880. "enum": ["session.next.tool.error"]
  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. "error": {
  16895. "type": "object",
  16896. "properties": {
  16897. "type": {
  16898. "type": "string"
  16899. },
  16900. "message": {
  16901. "type": "string"
  16902. }
  16903. },
  16904. "required": ["type", "message"],
  16905. "additionalProperties": false
  16906. },
  16907. "provider": {
  16908. "type": "object",
  16909. "properties": {
  16910. "executed": {
  16911. "type": "boolean"
  16912. },
  16913. "metadata": {
  16914. "type": "object"
  16915. }
  16916. },
  16917. "required": ["executed"],
  16918. "additionalProperties": false
  16919. }
  16920. },
  16921. "required": ["timestamp", "sessionID", "callID", "error", "provider"],
  16922. "additionalProperties": false
  16923. }
  16924. },
  16925. "required": ["id", "type", "properties"],
  16926. "additionalProperties": false
  16927. },
  16928. "SessionNextRetry_error": {
  16929. "type": "object",
  16930. "properties": {
  16931. "message": {
  16932. "type": "string"
  16933. },
  16934. "statusCode": {
  16935. "type": "integer",
  16936. "minimum": 0
  16937. },
  16938. "isRetryable": {
  16939. "type": "boolean"
  16940. },
  16941. "responseHeaders": {
  16942. "type": "object",
  16943. "additionalProperties": {
  16944. "type": "string"
  16945. }
  16946. },
  16947. "responseBody": {
  16948. "type": "string"
  16949. },
  16950. "metadata": {
  16951. "type": "object",
  16952. "additionalProperties": {
  16953. "type": "string"
  16954. }
  16955. }
  16956. },
  16957. "required": ["message", "isRetryable"],
  16958. "additionalProperties": false
  16959. },
  16960. "EventSessionNextRetried": {
  16961. "type": "object",
  16962. "properties": {
  16963. "id": {
  16964. "type": "string"
  16965. },
  16966. "type": {
  16967. "type": "string",
  16968. "enum": ["session.next.retried"]
  16969. },
  16970. "properties": {
  16971. "type": "object",
  16972. "properties": {
  16973. "timestamp": {
  16974. "type": "number"
  16975. },
  16976. "sessionID": {
  16977. "type": "string"
  16978. },
  16979. "attempt": {
  16980. "type": "integer",
  16981. "minimum": 0
  16982. },
  16983. "error": {
  16984. "$ref": "#/components/schemas/SessionNextRetry_error"
  16985. }
  16986. },
  16987. "required": ["timestamp", "sessionID", "attempt", "error"],
  16988. "additionalProperties": false
  16989. }
  16990. },
  16991. "required": ["id", "type", "properties"],
  16992. "additionalProperties": false
  16993. },
  16994. "EventSessionNextCompactionStarted": {
  16995. "type": "object",
  16996. "properties": {
  16997. "id": {
  16998. "type": "string"
  16999. },
  17000. "type": {
  17001. "type": "string",
  17002. "enum": ["session.next.compaction.started"]
  17003. },
  17004. "properties": {
  17005. "type": "object",
  17006. "properties": {
  17007. "timestamp": {
  17008. "type": "number"
  17009. },
  17010. "sessionID": {
  17011. "type": "string"
  17012. },
  17013. "reason": {
  17014. "type": "string",
  17015. "enum": ["auto", "manual"]
  17016. }
  17017. },
  17018. "required": ["timestamp", "sessionID", "reason"],
  17019. "additionalProperties": false
  17020. }
  17021. },
  17022. "required": ["id", "type", "properties"],
  17023. "additionalProperties": false
  17024. },
  17025. "EventSessionNextCompactionDelta": {
  17026. "type": "object",
  17027. "properties": {
  17028. "id": {
  17029. "type": "string"
  17030. },
  17031. "type": {
  17032. "type": "string",
  17033. "enum": ["session.next.compaction.delta"]
  17034. },
  17035. "properties": {
  17036. "type": "object",
  17037. "properties": {
  17038. "timestamp": {
  17039. "type": "number"
  17040. },
  17041. "sessionID": {
  17042. "type": "string"
  17043. },
  17044. "text": {
  17045. "type": "string"
  17046. }
  17047. },
  17048. "required": ["timestamp", "sessionID", "text"],
  17049. "additionalProperties": false
  17050. }
  17051. },
  17052. "required": ["id", "type", "properties"],
  17053. "additionalProperties": false
  17054. },
  17055. "EventSessionNextCompactionEnded": {
  17056. "type": "object",
  17057. "properties": {
  17058. "id": {
  17059. "type": "string"
  17060. },
  17061. "type": {
  17062. "type": "string",
  17063. "enum": ["session.next.compaction.ended"]
  17064. },
  17065. "properties": {
  17066. "type": "object",
  17067. "properties": {
  17068. "timestamp": {
  17069. "type": "number"
  17070. },
  17071. "sessionID": {
  17072. "type": "string"
  17073. },
  17074. "text": {
  17075. "type": "string"
  17076. },
  17077. "include": {
  17078. "type": "string"
  17079. }
  17080. },
  17081. "required": ["timestamp", "sessionID", "text"],
  17082. "additionalProperties": false
  17083. }
  17084. },
  17085. "required": ["id", "type", "properties"],
  17086. "additionalProperties": false
  17087. },
  17088. "EventServerConnected": {
  17089. "type": "object",
  17090. "properties": {
  17091. "id": {
  17092. "type": "string"
  17093. },
  17094. "type": {
  17095. "type": "string",
  17096. "enum": ["server.connected"]
  17097. },
  17098. "properties": {
  17099. "type": "object",
  17100. "properties": {}
  17101. }
  17102. },
  17103. "required": ["id", "type", "properties"],
  17104. "additionalProperties": false
  17105. },
  17106. "EventGlobalDisposed": {
  17107. "type": "object",
  17108. "properties": {
  17109. "id": {
  17110. "type": "string"
  17111. },
  17112. "type": {
  17113. "type": "string",
  17114. "enum": ["global.disposed"]
  17115. },
  17116. "properties": {
  17117. "type": "object",
  17118. "properties": {}
  17119. }
  17120. },
  17121. "required": ["id", "type", "properties"],
  17122. "additionalProperties": false
  17123. },
  17124. "SessionInfo": {
  17125. "type": "object",
  17126. "properties": {
  17127. "id": {
  17128. "type": "string"
  17129. },
  17130. "parentID": {
  17131. "type": "string"
  17132. },
  17133. "projectID": {
  17134. "type": "string"
  17135. },
  17136. "workspaceID": {
  17137. "type": "string"
  17138. },
  17139. "path": {
  17140. "type": "string"
  17141. },
  17142. "agent": {
  17143. "type": "string"
  17144. },
  17145. "model": {
  17146. "type": "object",
  17147. "properties": {
  17148. "id": {
  17149. "type": "string"
  17150. },
  17151. "providerID": {
  17152. "type": "string"
  17153. },
  17154. "variant": {
  17155. "type": "string"
  17156. }
  17157. },
  17158. "required": ["id", "providerID"],
  17159. "additionalProperties": false
  17160. },
  17161. "time": {
  17162. "type": "object",
  17163. "properties": {
  17164. "created": {
  17165. "type": "number"
  17166. },
  17167. "updated": {
  17168. "type": "number"
  17169. },
  17170. "archived": {
  17171. "type": "number"
  17172. }
  17173. },
  17174. "required": ["created", "updated"],
  17175. "additionalProperties": false
  17176. },
  17177. "title": {
  17178. "type": "string"
  17179. }
  17180. },
  17181. "required": ["id", "projectID", "time", "title"],
  17182. "additionalProperties": false
  17183. },
  17184. "SessionDelivery": {
  17185. "type": "string",
  17186. "enum": ["immediate", "deferred"]
  17187. },
  17188. "SessionMessageAgentSwitched": {
  17189. "type": "object",
  17190. "properties": {
  17191. "id": {
  17192. "type": "string"
  17193. },
  17194. "metadata": {
  17195. "type": "object"
  17196. },
  17197. "time": {
  17198. "type": "object",
  17199. "properties": {
  17200. "created": {
  17201. "type": "number"
  17202. }
  17203. },
  17204. "required": ["created"],
  17205. "additionalProperties": false
  17206. },
  17207. "type": {
  17208. "type": "string",
  17209. "enum": ["agent-switched"]
  17210. },
  17211. "agent": {
  17212. "type": "string"
  17213. }
  17214. },
  17215. "required": ["id", "time", "type", "agent"],
  17216. "additionalProperties": false
  17217. },
  17218. "SessionMessageModelSwitched": {
  17219. "type": "object",
  17220. "properties": {
  17221. "id": {
  17222. "type": "string"
  17223. },
  17224. "metadata": {
  17225. "type": "object"
  17226. },
  17227. "time": {
  17228. "type": "object",
  17229. "properties": {
  17230. "created": {
  17231. "type": "number"
  17232. }
  17233. },
  17234. "required": ["created"],
  17235. "additionalProperties": false
  17236. },
  17237. "type": {
  17238. "type": "string",
  17239. "enum": ["model-switched"]
  17240. },
  17241. "model": {
  17242. "type": "object",
  17243. "properties": {
  17244. "id": {
  17245. "type": "string"
  17246. },
  17247. "providerID": {
  17248. "type": "string"
  17249. },
  17250. "variant": {
  17251. "type": "string"
  17252. }
  17253. },
  17254. "required": ["id", "providerID"],
  17255. "additionalProperties": false
  17256. }
  17257. },
  17258. "required": ["id", "time", "type", "model"],
  17259. "additionalProperties": false
  17260. },
  17261. "SessionMessageUser": {
  17262. "type": "object",
  17263. "properties": {
  17264. "id": {
  17265. "type": "string"
  17266. },
  17267. "metadata": {
  17268. "type": "object"
  17269. },
  17270. "time": {
  17271. "type": "object",
  17272. "properties": {
  17273. "created": {
  17274. "type": "number"
  17275. }
  17276. },
  17277. "required": ["created"],
  17278. "additionalProperties": false
  17279. },
  17280. "text": {
  17281. "type": "string"
  17282. },
  17283. "files": {
  17284. "type": "array",
  17285. "items": {
  17286. "$ref": "#/components/schemas/PromptFileAttachment"
  17287. }
  17288. },
  17289. "agents": {
  17290. "type": "array",
  17291. "items": {
  17292. "$ref": "#/components/schemas/PromptAgentAttachment"
  17293. }
  17294. },
  17295. "type": {
  17296. "type": "string",
  17297. "enum": ["user"]
  17298. }
  17299. },
  17300. "required": ["id", "time", "text", "type"],
  17301. "additionalProperties": false
  17302. },
  17303. "SessionMessageSynthetic": {
  17304. "type": "object",
  17305. "properties": {
  17306. "id": {
  17307. "type": "string"
  17308. },
  17309. "metadata": {
  17310. "type": "object"
  17311. },
  17312. "time": {
  17313. "type": "object",
  17314. "properties": {
  17315. "created": {
  17316. "type": "number"
  17317. }
  17318. },
  17319. "required": ["created"],
  17320. "additionalProperties": false
  17321. },
  17322. "sessionID": {
  17323. "type": "string"
  17324. },
  17325. "text": {
  17326. "type": "string"
  17327. },
  17328. "type": {
  17329. "type": "string",
  17330. "enum": ["synthetic"]
  17331. }
  17332. },
  17333. "required": ["id", "time", "sessionID", "text", "type"],
  17334. "additionalProperties": false
  17335. },
  17336. "SessionMessageShell": {
  17337. "type": "object",
  17338. "properties": {
  17339. "id": {
  17340. "type": "string"
  17341. },
  17342. "metadata": {
  17343. "type": "object"
  17344. },
  17345. "time": {
  17346. "type": "object",
  17347. "properties": {
  17348. "created": {
  17349. "type": "number"
  17350. },
  17351. "completed": {
  17352. "type": "number"
  17353. }
  17354. },
  17355. "required": ["created"],
  17356. "additionalProperties": false
  17357. },
  17358. "type": {
  17359. "type": "string",
  17360. "enum": ["shell"]
  17361. },
  17362. "callID": {
  17363. "type": "string"
  17364. },
  17365. "command": {
  17366. "type": "string"
  17367. },
  17368. "output": {
  17369. "type": "string"
  17370. }
  17371. },
  17372. "required": ["id", "time", "type", "callID", "command", "output"],
  17373. "additionalProperties": false
  17374. },
  17375. "SessionMessageAssistantText": {
  17376. "type": "object",
  17377. "properties": {
  17378. "type": {
  17379. "type": "string",
  17380. "enum": ["text"]
  17381. },
  17382. "text": {
  17383. "type": "string"
  17384. }
  17385. },
  17386. "required": ["type", "text"],
  17387. "additionalProperties": false
  17388. },
  17389. "SessionMessageAssistantReasoning": {
  17390. "type": "object",
  17391. "properties": {
  17392. "type": {
  17393. "type": "string",
  17394. "enum": ["reasoning"]
  17395. },
  17396. "id": {
  17397. "type": "string"
  17398. },
  17399. "text": {
  17400. "type": "string"
  17401. }
  17402. },
  17403. "required": ["type", "id", "text"],
  17404. "additionalProperties": false
  17405. },
  17406. "SessionMessageToolStatePending": {
  17407. "type": "object",
  17408. "properties": {
  17409. "status": {
  17410. "type": "string",
  17411. "enum": ["pending"]
  17412. },
  17413. "input": {
  17414. "type": "string"
  17415. }
  17416. },
  17417. "required": ["status", "input"],
  17418. "additionalProperties": false
  17419. },
  17420. "SessionMessageToolStateRunning": {
  17421. "type": "object",
  17422. "properties": {
  17423. "status": {
  17424. "type": "string",
  17425. "enum": ["running"]
  17426. },
  17427. "input": {
  17428. "type": "object"
  17429. },
  17430. "structured": {
  17431. "type": "object"
  17432. },
  17433. "content": {
  17434. "type": "array",
  17435. "items": {
  17436. "anyOf": [
  17437. {
  17438. "$ref": "#/components/schemas/ToolTextContent"
  17439. },
  17440. {
  17441. "$ref": "#/components/schemas/ToolFileContent"
  17442. }
  17443. ]
  17444. }
  17445. }
  17446. },
  17447. "required": ["status", "input", "structured", "content"],
  17448. "additionalProperties": false
  17449. },
  17450. "SessionMessageToolStateCompleted": {
  17451. "type": "object",
  17452. "properties": {
  17453. "status": {
  17454. "type": "string",
  17455. "enum": ["completed"]
  17456. },
  17457. "input": {
  17458. "type": "object"
  17459. },
  17460. "attachments": {
  17461. "type": "array",
  17462. "items": {
  17463. "$ref": "#/components/schemas/PromptFileAttachment"
  17464. }
  17465. },
  17466. "content": {
  17467. "type": "array",
  17468. "items": {
  17469. "anyOf": [
  17470. {
  17471. "$ref": "#/components/schemas/ToolTextContent"
  17472. },
  17473. {
  17474. "$ref": "#/components/schemas/ToolFileContent"
  17475. }
  17476. ]
  17477. }
  17478. },
  17479. "structured": {
  17480. "type": "object"
  17481. }
  17482. },
  17483. "required": ["status", "input", "content", "structured"],
  17484. "additionalProperties": false
  17485. },
  17486. "SessionMessageToolStateError": {
  17487. "type": "object",
  17488. "properties": {
  17489. "status": {
  17490. "type": "string",
  17491. "enum": ["error"]
  17492. },
  17493. "input": {
  17494. "type": "object"
  17495. },
  17496. "content": {
  17497. "type": "array",
  17498. "items": {
  17499. "anyOf": [
  17500. {
  17501. "$ref": "#/components/schemas/ToolTextContent"
  17502. },
  17503. {
  17504. "$ref": "#/components/schemas/ToolFileContent"
  17505. }
  17506. ]
  17507. }
  17508. },
  17509. "structured": {
  17510. "type": "object"
  17511. },
  17512. "error": {
  17513. "type": "object",
  17514. "properties": {
  17515. "type": {
  17516. "type": "string"
  17517. },
  17518. "message": {
  17519. "type": "string"
  17520. }
  17521. },
  17522. "required": ["type", "message"],
  17523. "additionalProperties": false
  17524. }
  17525. },
  17526. "required": ["status", "input", "content", "structured", "error"],
  17527. "additionalProperties": false
  17528. },
  17529. "SessionMessageAssistantTool": {
  17530. "type": "object",
  17531. "properties": {
  17532. "type": {
  17533. "type": "string",
  17534. "enum": ["tool"]
  17535. },
  17536. "id": {
  17537. "type": "string"
  17538. },
  17539. "name": {
  17540. "type": "string"
  17541. },
  17542. "provider": {
  17543. "type": "object",
  17544. "properties": {
  17545. "executed": {
  17546. "type": "boolean"
  17547. },
  17548. "metadata": {
  17549. "type": "object"
  17550. }
  17551. },
  17552. "required": ["executed"],
  17553. "additionalProperties": false
  17554. },
  17555. "state": {
  17556. "anyOf": [
  17557. {
  17558. "$ref": "#/components/schemas/SessionMessageToolStatePending"
  17559. },
  17560. {
  17561. "$ref": "#/components/schemas/SessionMessageToolStateRunning"
  17562. },
  17563. {
  17564. "$ref": "#/components/schemas/SessionMessageToolStateCompleted"
  17565. },
  17566. {
  17567. "$ref": "#/components/schemas/SessionMessageToolStateError"
  17568. }
  17569. ]
  17570. },
  17571. "time": {
  17572. "type": "object",
  17573. "properties": {
  17574. "created": {
  17575. "type": "number"
  17576. },
  17577. "ran": {
  17578. "type": "number"
  17579. },
  17580. "completed": {
  17581. "type": "number"
  17582. },
  17583. "pruned": {
  17584. "type": "number"
  17585. }
  17586. },
  17587. "required": ["created"],
  17588. "additionalProperties": false
  17589. }
  17590. },
  17591. "required": ["type", "id", "name", "state", "time"],
  17592. "additionalProperties": false
  17593. },
  17594. "SessionMessageAssistant": {
  17595. "type": "object",
  17596. "properties": {
  17597. "id": {
  17598. "type": "string"
  17599. },
  17600. "metadata": {
  17601. "type": "object"
  17602. },
  17603. "time": {
  17604. "type": "object",
  17605. "properties": {
  17606. "created": {
  17607. "type": "number"
  17608. },
  17609. "completed": {
  17610. "type": "number"
  17611. }
  17612. },
  17613. "required": ["created"],
  17614. "additionalProperties": false
  17615. },
  17616. "type": {
  17617. "type": "string",
  17618. "enum": ["assistant"]
  17619. },
  17620. "agent": {
  17621. "type": "string"
  17622. },
  17623. "model": {
  17624. "type": "object",
  17625. "properties": {
  17626. "id": {
  17627. "type": "string"
  17628. },
  17629. "providerID": {
  17630. "type": "string"
  17631. },
  17632. "variant": {
  17633. "type": "string"
  17634. }
  17635. },
  17636. "required": ["id", "providerID"],
  17637. "additionalProperties": false
  17638. },
  17639. "content": {
  17640. "type": "array",
  17641. "items": {
  17642. "anyOf": [
  17643. {
  17644. "$ref": "#/components/schemas/SessionMessageAssistantText"
  17645. },
  17646. {
  17647. "$ref": "#/components/schemas/SessionMessageAssistantReasoning"
  17648. },
  17649. {
  17650. "$ref": "#/components/schemas/SessionMessageAssistantTool"
  17651. }
  17652. ]
  17653. }
  17654. },
  17655. "snapshot": {
  17656. "type": "object",
  17657. "properties": {
  17658. "start": {
  17659. "type": "string"
  17660. },
  17661. "end": {
  17662. "type": "string"
  17663. }
  17664. },
  17665. "additionalProperties": false
  17666. },
  17667. "finish": {
  17668. "type": "string"
  17669. },
  17670. "cost": {
  17671. "type": "number"
  17672. },
  17673. "tokens": {
  17674. "type": "object",
  17675. "properties": {
  17676. "input": {
  17677. "type": "number"
  17678. },
  17679. "output": {
  17680. "type": "number"
  17681. },
  17682. "reasoning": {
  17683. "type": "number"
  17684. },
  17685. "cache": {
  17686. "type": "object",
  17687. "properties": {
  17688. "read": {
  17689. "type": "number"
  17690. },
  17691. "write": {
  17692. "type": "number"
  17693. }
  17694. },
  17695. "required": ["read", "write"],
  17696. "additionalProperties": false
  17697. }
  17698. },
  17699. "required": ["input", "output", "reasoning", "cache"],
  17700. "additionalProperties": false
  17701. },
  17702. "error": {
  17703. "type": "string"
  17704. }
  17705. },
  17706. "required": ["id", "time", "type", "agent", "model", "content"],
  17707. "additionalProperties": false
  17708. },
  17709. "SessionMessageCompaction": {
  17710. "type": "object",
  17711. "properties": {
  17712. "type": {
  17713. "type": "string",
  17714. "enum": ["compaction"]
  17715. },
  17716. "reason": {
  17717. "type": "string",
  17718. "enum": ["auto", "manual"]
  17719. },
  17720. "summary": {
  17721. "type": "string"
  17722. },
  17723. "include": {
  17724. "type": "string"
  17725. },
  17726. "id": {
  17727. "type": "string"
  17728. },
  17729. "metadata": {
  17730. "type": "object"
  17731. },
  17732. "time": {
  17733. "type": "object",
  17734. "properties": {
  17735. "created": {
  17736. "type": "number"
  17737. }
  17738. },
  17739. "required": ["created"],
  17740. "additionalProperties": false
  17741. }
  17742. },
  17743. "required": ["type", "reason", "summary", "id", "time"],
  17744. "additionalProperties": false
  17745. },
  17746. "SessionMessage": {
  17747. "anyOf": [
  17748. {
  17749. "$ref": "#/components/schemas/SessionMessageAgentSwitched"
  17750. },
  17751. {
  17752. "$ref": "#/components/schemas/SessionMessageModelSwitched"
  17753. },
  17754. {
  17755. "$ref": "#/components/schemas/SessionMessageUser"
  17756. },
  17757. {
  17758. "$ref": "#/components/schemas/SessionMessageSynthetic"
  17759. },
  17760. {
  17761. "$ref": "#/components/schemas/SessionMessageShell"
  17762. },
  17763. {
  17764. "$ref": "#/components/schemas/SessionMessageAssistant"
  17765. },
  17766. {
  17767. "$ref": "#/components/schemas/SessionMessageCompaction"
  17768. }
  17769. ]
  17770. },
  17771. "EventTuiToastShow1": {
  17772. "type": "object",
  17773. "properties": {
  17774. "id": {
  17775. "type": "string"
  17776. },
  17777. "type": {
  17778. "type": "string",
  17779. "enum": ["tui.toast.show"]
  17780. },
  17781. "properties": {
  17782. "type": "object",
  17783. "properties": {
  17784. "title": {
  17785. "type": "string"
  17786. },
  17787. "message": {
  17788. "type": "string"
  17789. },
  17790. "variant": {
  17791. "type": "string",
  17792. "enum": ["info", "success", "warning", "error"]
  17793. },
  17794. "duration": {
  17795. "type": "integer",
  17796. "exclusiveMinimum": 0
  17797. }
  17798. },
  17799. "required": ["message", "variant"],
  17800. "additionalProperties": false
  17801. }
  17802. },
  17803. "required": ["id", "type", "properties"],
  17804. "additionalProperties": false
  17805. },
  17806. "BadRequestError": {
  17807. "type": "object",
  17808. "required": ["data", "errors", "success"],
  17809. "properties": {
  17810. "data": {},
  17811. "errors": {
  17812. "type": "array",
  17813. "items": {
  17814. "type": "object",
  17815. "additionalProperties": {}
  17816. }
  17817. },
  17818. "success": {
  17819. "type": "boolean",
  17820. "enum": [false]
  17821. }
  17822. }
  17823. },
  17824. "NotFoundError": {
  17825. "type": "object",
  17826. "required": ["name", "data"],
  17827. "properties": {
  17828. "name": {
  17829. "type": "string",
  17830. "enum": ["NotFoundError"]
  17831. },
  17832. "data": {
  17833. "type": "object",
  17834. "required": ["message"],
  17835. "properties": {
  17836. "message": {
  17837. "type": "string"
  17838. }
  17839. }
  17840. }
  17841. }
  17842. }
  17843. }
  17844. },
  17845. "security": [],
  17846. "tags": [
  17847. {
  17848. "name": "control",
  17849. "description": "Control plane routes."
  17850. },
  17851. {
  17852. "name": "global",
  17853. "description": "Global server routes."
  17854. },
  17855. {
  17856. "name": "event",
  17857. "description": "Instance event stream route."
  17858. },
  17859. {
  17860. "name": "config",
  17861. "description": "Experimental HttpApi config routes."
  17862. },
  17863. {
  17864. "name": "experimental",
  17865. "description": "Experimental HttpApi read-only routes."
  17866. },
  17867. {
  17868. "name": "file",
  17869. "description": "Experimental HttpApi file routes."
  17870. },
  17871. {
  17872. "name": "instance",
  17873. "description": "Experimental HttpApi instance read routes."
  17874. },
  17875. {
  17876. "name": "mcp",
  17877. "description": "Experimental HttpApi MCP routes."
  17878. },
  17879. {
  17880. "name": "project",
  17881. "description": "Experimental HttpApi project routes."
  17882. },
  17883. {
  17884. "name": "pty",
  17885. "description": "Experimental HttpApi PTY routes."
  17886. },
  17887. {
  17888. "name": "question",
  17889. "description": "Question routes."
  17890. },
  17891. {
  17892. "name": "permission",
  17893. "description": "Experimental HttpApi permission routes."
  17894. },
  17895. {
  17896. "name": "provider",
  17897. "description": "Experimental HttpApi provider routes."
  17898. },
  17899. {
  17900. "name": "session",
  17901. "description": "Experimental HttpApi session routes."
  17902. },
  17903. {
  17904. "name": "sync",
  17905. "description": "Experimental HttpApi sync routes."
  17906. },
  17907. {
  17908. "name": "v2",
  17909. "description": "Experimental v2 routes."
  17910. },
  17911. {
  17912. "name": "v2 messages",
  17913. "description": "Experimental v2 message routes."
  17914. },
  17915. {
  17916. "name": "tui",
  17917. "description": "Experimental HttpApi TUI routes."
  17918. },
  17919. {
  17920. "name": "workspace",
  17921. "description": "Experimental HttpApi workspace routes."
  17922. },
  17923. {
  17924. "name": "pty",
  17925. "description": "PTY websocket route."
  17926. }
  17927. ]
  17928. }