openapi.json 489 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038
  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/EventSessionNextStepFailed"
  8517. },
  8518. {
  8519. "$ref": "#/components/schemas/EventSessionNextTextStarted"
  8520. },
  8521. {
  8522. "$ref": "#/components/schemas/EventSessionNextTextDelta"
  8523. },
  8524. {
  8525. "$ref": "#/components/schemas/EventSessionNextTextEnded"
  8526. },
  8527. {
  8528. "$ref": "#/components/schemas/EventSessionNextReasoningStarted"
  8529. },
  8530. {
  8531. "$ref": "#/components/schemas/EventSessionNextReasoningDelta"
  8532. },
  8533. {
  8534. "$ref": "#/components/schemas/EventSessionNextReasoningEnded"
  8535. },
  8536. {
  8537. "$ref": "#/components/schemas/EventSessionNextToolInputStarted"
  8538. },
  8539. {
  8540. "$ref": "#/components/schemas/EventSessionNextToolInputDelta"
  8541. },
  8542. {
  8543. "$ref": "#/components/schemas/EventSessionNextToolInputEnded"
  8544. },
  8545. {
  8546. "$ref": "#/components/schemas/EventSessionNextToolCalled"
  8547. },
  8548. {
  8549. "$ref": "#/components/schemas/EventSessionNextToolProgress"
  8550. },
  8551. {
  8552. "$ref": "#/components/schemas/EventSessionNextToolSuccess"
  8553. },
  8554. {
  8555. "$ref": "#/components/schemas/EventSessionNextToolFailed"
  8556. },
  8557. {
  8558. "$ref": "#/components/schemas/EventSessionNextRetried"
  8559. },
  8560. {
  8561. "$ref": "#/components/schemas/EventSessionNextCompactionStarted"
  8562. },
  8563. {
  8564. "$ref": "#/components/schemas/EventSessionNextCompactionDelta"
  8565. },
  8566. {
  8567. "$ref": "#/components/schemas/EventSessionNextCompactionEnded"
  8568. },
  8569. {
  8570. "$ref": "#/components/schemas/EventServerConnected"
  8571. },
  8572. {
  8573. "$ref": "#/components/schemas/EventGlobalDisposed"
  8574. }
  8575. ]
  8576. },
  8577. "OAuth": {
  8578. "type": "object",
  8579. "properties": {
  8580. "type": {
  8581. "type": "string",
  8582. "enum": ["oauth"]
  8583. },
  8584. "refresh": {
  8585. "type": "string"
  8586. },
  8587. "access": {
  8588. "type": "string"
  8589. },
  8590. "expires": {
  8591. "type": "integer",
  8592. "minimum": 0
  8593. },
  8594. "accountId": {
  8595. "type": "string"
  8596. },
  8597. "enterpriseUrl": {
  8598. "type": "string"
  8599. }
  8600. },
  8601. "required": ["type", "refresh", "access", "expires"],
  8602. "additionalProperties": false
  8603. },
  8604. "ApiAuth": {
  8605. "type": "object",
  8606. "properties": {
  8607. "type": {
  8608. "type": "string",
  8609. "enum": ["api"]
  8610. },
  8611. "key": {
  8612. "type": "string"
  8613. },
  8614. "metadata": {
  8615. "type": "object",
  8616. "additionalProperties": {
  8617. "type": "string"
  8618. }
  8619. }
  8620. },
  8621. "required": ["type", "key"],
  8622. "additionalProperties": false
  8623. },
  8624. "WellKnownAuth": {
  8625. "type": "object",
  8626. "properties": {
  8627. "type": {
  8628. "type": "string",
  8629. "enum": ["wellknown"]
  8630. },
  8631. "key": {
  8632. "type": "string"
  8633. },
  8634. "token": {
  8635. "type": "string"
  8636. }
  8637. },
  8638. "required": ["type", "key", "token"],
  8639. "additionalProperties": false
  8640. },
  8641. "Auth": {
  8642. "anyOf": [
  8643. {
  8644. "$ref": "#/components/schemas/OAuth"
  8645. },
  8646. {
  8647. "$ref": "#/components/schemas/ApiAuth"
  8648. },
  8649. {
  8650. "$ref": "#/components/schemas/WellKnownAuth"
  8651. }
  8652. ]
  8653. },
  8654. "PermissionRequest": {
  8655. "type": "object",
  8656. "properties": {
  8657. "id": {
  8658. "type": "string"
  8659. },
  8660. "sessionID": {
  8661. "type": "string"
  8662. },
  8663. "permission": {
  8664. "type": "string"
  8665. },
  8666. "patterns": {
  8667. "type": "array",
  8668. "items": {
  8669. "type": "string"
  8670. }
  8671. },
  8672. "metadata": {
  8673. "type": "object"
  8674. },
  8675. "always": {
  8676. "type": "array",
  8677. "items": {
  8678. "type": "string"
  8679. }
  8680. },
  8681. "tool": {
  8682. "type": "object",
  8683. "properties": {
  8684. "messageID": {
  8685. "type": "string"
  8686. },
  8687. "callID": {
  8688. "type": "string"
  8689. }
  8690. },
  8691. "required": ["messageID", "callID"],
  8692. "additionalProperties": false
  8693. }
  8694. },
  8695. "required": ["id", "sessionID", "permission", "patterns", "metadata", "always"],
  8696. "additionalProperties": false
  8697. },
  8698. "SnapshotFileDiff": {
  8699. "type": "object",
  8700. "properties": {
  8701. "file": {
  8702. "type": "string"
  8703. },
  8704. "patch": {
  8705. "type": "string"
  8706. },
  8707. "additions": {
  8708. "type": "integer",
  8709. "minimum": 0
  8710. },
  8711. "deletions": {
  8712. "type": "integer",
  8713. "minimum": 0
  8714. },
  8715. "status": {
  8716. "type": "string",
  8717. "enum": ["added", "deleted", "modified"]
  8718. }
  8719. },
  8720. "required": ["file", "patch", "additions", "deletions"],
  8721. "additionalProperties": false
  8722. },
  8723. "ProviderAuthError": {
  8724. "type": "object",
  8725. "properties": {
  8726. "name": {
  8727. "type": "string",
  8728. "enum": ["ProviderAuthError"]
  8729. },
  8730. "data": {
  8731. "type": "object",
  8732. "properties": {
  8733. "providerID": {
  8734. "type": "string"
  8735. },
  8736. "message": {
  8737. "type": "string"
  8738. }
  8739. },
  8740. "required": ["providerID", "message"],
  8741. "additionalProperties": false
  8742. }
  8743. },
  8744. "required": ["name", "data"],
  8745. "additionalProperties": false
  8746. },
  8747. "UnknownError": {
  8748. "type": "object",
  8749. "properties": {
  8750. "name": {
  8751. "type": "string",
  8752. "enum": ["UnknownError"]
  8753. },
  8754. "data": {
  8755. "type": "object",
  8756. "properties": {
  8757. "message": {
  8758. "type": "string"
  8759. }
  8760. },
  8761. "required": ["message"],
  8762. "additionalProperties": false
  8763. }
  8764. },
  8765. "required": ["name", "data"],
  8766. "additionalProperties": false
  8767. },
  8768. "MessageOutputLengthError": {
  8769. "type": "object",
  8770. "properties": {
  8771. "name": {
  8772. "type": "string",
  8773. "enum": ["MessageOutputLengthError"]
  8774. },
  8775. "data": {
  8776. "type": "object",
  8777. "properties": {}
  8778. }
  8779. },
  8780. "required": ["name", "data"],
  8781. "additionalProperties": false
  8782. },
  8783. "MessageAbortedError": {
  8784. "type": "object",
  8785. "properties": {
  8786. "name": {
  8787. "type": "string",
  8788. "enum": ["MessageAbortedError"]
  8789. },
  8790. "data": {
  8791. "type": "object",
  8792. "properties": {
  8793. "message": {
  8794. "type": "string"
  8795. }
  8796. },
  8797. "required": ["message"],
  8798. "additionalProperties": false
  8799. }
  8800. },
  8801. "required": ["name", "data"],
  8802. "additionalProperties": false
  8803. },
  8804. "StructuredOutputError": {
  8805. "type": "object",
  8806. "properties": {
  8807. "name": {
  8808. "type": "string",
  8809. "enum": ["StructuredOutputError"]
  8810. },
  8811. "data": {
  8812. "type": "object",
  8813. "properties": {
  8814. "message": {
  8815. "type": "string"
  8816. },
  8817. "retries": {
  8818. "type": "integer",
  8819. "minimum": 0
  8820. }
  8821. },
  8822. "required": ["message", "retries"],
  8823. "additionalProperties": false
  8824. }
  8825. },
  8826. "required": ["name", "data"],
  8827. "additionalProperties": false
  8828. },
  8829. "ContextOverflowError": {
  8830. "type": "object",
  8831. "properties": {
  8832. "name": {
  8833. "type": "string",
  8834. "enum": ["ContextOverflowError"]
  8835. },
  8836. "data": {
  8837. "type": "object",
  8838. "properties": {
  8839. "message": {
  8840. "type": "string"
  8841. },
  8842. "responseBody": {
  8843. "type": "string"
  8844. }
  8845. },
  8846. "required": ["message"],
  8847. "additionalProperties": false
  8848. }
  8849. },
  8850. "required": ["name", "data"],
  8851. "additionalProperties": false
  8852. },
  8853. "APIError": {
  8854. "type": "object",
  8855. "properties": {
  8856. "name": {
  8857. "type": "string",
  8858. "enum": ["APIError"]
  8859. },
  8860. "data": {
  8861. "type": "object",
  8862. "properties": {
  8863. "message": {
  8864. "type": "string"
  8865. },
  8866. "statusCode": {
  8867. "type": "integer",
  8868. "minimum": 0
  8869. },
  8870. "isRetryable": {
  8871. "type": "boolean"
  8872. },
  8873. "responseHeaders": {
  8874. "type": "object",
  8875. "additionalProperties": {
  8876. "type": "string"
  8877. }
  8878. },
  8879. "responseBody": {
  8880. "type": "string"
  8881. },
  8882. "metadata": {
  8883. "type": "object",
  8884. "additionalProperties": {
  8885. "type": "string"
  8886. }
  8887. }
  8888. },
  8889. "required": ["message", "isRetryable"],
  8890. "additionalProperties": false
  8891. }
  8892. },
  8893. "required": ["name", "data"],
  8894. "additionalProperties": false
  8895. },
  8896. "QuestionOption": {
  8897. "type": "object",
  8898. "properties": {
  8899. "label": {
  8900. "type": "string",
  8901. "description": "Display text (1-5 words, concise)"
  8902. },
  8903. "description": {
  8904. "type": "string",
  8905. "description": "Explanation of choice"
  8906. }
  8907. },
  8908. "required": ["label", "description"],
  8909. "additionalProperties": false
  8910. },
  8911. "QuestionInfo": {
  8912. "type": "object",
  8913. "properties": {
  8914. "question": {
  8915. "type": "string",
  8916. "description": "Complete question"
  8917. },
  8918. "header": {
  8919. "type": "string",
  8920. "description": "Very short label (max 30 chars)"
  8921. },
  8922. "options": {
  8923. "type": "array",
  8924. "items": {
  8925. "$ref": "#/components/schemas/QuestionOption"
  8926. },
  8927. "description": "Available choices"
  8928. },
  8929. "multiple": {
  8930. "type": "boolean"
  8931. },
  8932. "custom": {
  8933. "type": "boolean"
  8934. }
  8935. },
  8936. "required": ["question", "header", "options"],
  8937. "additionalProperties": false
  8938. },
  8939. "QuestionTool": {
  8940. "type": "object",
  8941. "properties": {
  8942. "messageID": {
  8943. "type": "string"
  8944. },
  8945. "callID": {
  8946. "type": "string"
  8947. }
  8948. },
  8949. "required": ["messageID", "callID"],
  8950. "additionalProperties": false
  8951. },
  8952. "QuestionRequest": {
  8953. "type": "object",
  8954. "properties": {
  8955. "id": {
  8956. "type": "string"
  8957. },
  8958. "sessionID": {
  8959. "type": "string"
  8960. },
  8961. "questions": {
  8962. "type": "array",
  8963. "items": {
  8964. "$ref": "#/components/schemas/QuestionInfo"
  8965. },
  8966. "description": "Questions to ask"
  8967. },
  8968. "tool": {
  8969. "$ref": "#/components/schemas/QuestionTool"
  8970. }
  8971. },
  8972. "required": ["id", "sessionID", "questions"],
  8973. "additionalProperties": false
  8974. },
  8975. "QuestionAnswer": {
  8976. "type": "array",
  8977. "items": {
  8978. "type": "string"
  8979. }
  8980. },
  8981. "QuestionReplied": {
  8982. "type": "object",
  8983. "properties": {
  8984. "sessionID": {
  8985. "type": "string"
  8986. },
  8987. "requestID": {
  8988. "type": "string"
  8989. },
  8990. "answers": {
  8991. "type": "array",
  8992. "items": {
  8993. "$ref": "#/components/schemas/QuestionAnswer"
  8994. }
  8995. }
  8996. },
  8997. "required": ["sessionID", "requestID", "answers"],
  8998. "additionalProperties": false
  8999. },
  9000. "QuestionRejected": {
  9001. "type": "object",
  9002. "properties": {
  9003. "sessionID": {
  9004. "type": "string"
  9005. },
  9006. "requestID": {
  9007. "type": "string"
  9008. }
  9009. },
  9010. "required": ["sessionID", "requestID"],
  9011. "additionalProperties": false
  9012. },
  9013. "Todo": {
  9014. "type": "object",
  9015. "properties": {
  9016. "content": {
  9017. "type": "string",
  9018. "description": "Brief description of the task"
  9019. },
  9020. "status": {
  9021. "type": "string",
  9022. "description": "Current status of the task: pending, in_progress, completed, cancelled"
  9023. },
  9024. "priority": {
  9025. "type": "string",
  9026. "description": "Priority level of the task: high, medium, low"
  9027. }
  9028. },
  9029. "required": ["content", "status", "priority"],
  9030. "additionalProperties": false
  9031. },
  9032. "SessionStatus": {
  9033. "anyOf": [
  9034. {
  9035. "type": "object",
  9036. "properties": {
  9037. "type": {
  9038. "type": "string",
  9039. "enum": ["idle"]
  9040. }
  9041. },
  9042. "required": ["type"],
  9043. "additionalProperties": false
  9044. },
  9045. {
  9046. "type": "object",
  9047. "properties": {
  9048. "type": {
  9049. "type": "string",
  9050. "enum": ["retry"]
  9051. },
  9052. "attempt": {
  9053. "type": "integer",
  9054. "minimum": 0
  9055. },
  9056. "message": {
  9057. "type": "string"
  9058. },
  9059. "next": {
  9060. "type": "integer",
  9061. "minimum": 0
  9062. }
  9063. },
  9064. "required": ["type", "attempt", "message", "next"],
  9065. "additionalProperties": false
  9066. },
  9067. {
  9068. "type": "object",
  9069. "properties": {
  9070. "type": {
  9071. "type": "string",
  9072. "enum": ["busy"]
  9073. }
  9074. },
  9075. "required": ["type"],
  9076. "additionalProperties": false
  9077. }
  9078. ]
  9079. },
  9080. "Event.tui.prompt.append": {
  9081. "type": "object",
  9082. "properties": {
  9083. "id": {
  9084. "type": "string"
  9085. },
  9086. "type": {
  9087. "type": "string",
  9088. "enum": ["tui.prompt.append"]
  9089. },
  9090. "properties": {
  9091. "type": "object",
  9092. "properties": {
  9093. "text": {
  9094. "type": "string"
  9095. }
  9096. },
  9097. "required": ["text"],
  9098. "additionalProperties": false
  9099. }
  9100. },
  9101. "required": ["id", "type", "properties"],
  9102. "additionalProperties": false
  9103. },
  9104. "Event.tui.command.execute": {
  9105. "type": "object",
  9106. "properties": {
  9107. "id": {
  9108. "type": "string"
  9109. },
  9110. "type": {
  9111. "type": "string",
  9112. "enum": ["tui.command.execute"]
  9113. },
  9114. "properties": {
  9115. "type": "object",
  9116. "properties": {
  9117. "command": {
  9118. "anyOf": [
  9119. {
  9120. "type": "string",
  9121. "enum": [
  9122. "session.list",
  9123. "session.new",
  9124. "session.share",
  9125. "session.interrupt",
  9126. "session.compact",
  9127. "session.page.up",
  9128. "session.page.down",
  9129. "session.line.up",
  9130. "session.line.down",
  9131. "session.half.page.up",
  9132. "session.half.page.down",
  9133. "session.first",
  9134. "session.last",
  9135. "prompt.clear",
  9136. "prompt.submit",
  9137. "agent.cycle"
  9138. ]
  9139. },
  9140. {
  9141. "type": "string"
  9142. }
  9143. ]
  9144. }
  9145. },
  9146. "required": ["command"],
  9147. "additionalProperties": false
  9148. }
  9149. },
  9150. "required": ["id", "type", "properties"],
  9151. "additionalProperties": false
  9152. },
  9153. "Event.tui.toast.show": {
  9154. "type": "object",
  9155. "properties": {
  9156. "id": {
  9157. "type": "string"
  9158. },
  9159. "type": {
  9160. "type": "string",
  9161. "enum": ["tui.toast.show"]
  9162. },
  9163. "properties": {
  9164. "type": "object",
  9165. "properties": {
  9166. "title": {
  9167. "type": "string"
  9168. },
  9169. "message": {
  9170. "type": "string"
  9171. },
  9172. "variant": {
  9173. "type": "string",
  9174. "enum": ["info", "success", "warning", "error"]
  9175. },
  9176. "duration": {
  9177. "type": "integer",
  9178. "exclusiveMinimum": 0
  9179. }
  9180. },
  9181. "required": ["message", "variant"],
  9182. "additionalProperties": false
  9183. }
  9184. },
  9185. "required": ["id", "type", "properties"],
  9186. "additionalProperties": false
  9187. },
  9188. "Event.tui.session.select": {
  9189. "type": "object",
  9190. "properties": {
  9191. "id": {
  9192. "type": "string"
  9193. },
  9194. "type": {
  9195. "type": "string",
  9196. "enum": ["tui.session.select"]
  9197. },
  9198. "properties": {
  9199. "type": "object",
  9200. "properties": {
  9201. "sessionID": {
  9202. "type": "string",
  9203. "description": "Session ID to navigate to"
  9204. }
  9205. },
  9206. "required": ["sessionID"],
  9207. "additionalProperties": false
  9208. }
  9209. },
  9210. "required": ["id", "type", "properties"],
  9211. "additionalProperties": false
  9212. },
  9213. "Project": {
  9214. "type": "object",
  9215. "properties": {
  9216. "id": {
  9217. "type": "string"
  9218. },
  9219. "worktree": {
  9220. "type": "string"
  9221. },
  9222. "vcs": {
  9223. "type": "string",
  9224. "enum": ["git"]
  9225. },
  9226. "name": {
  9227. "type": "string"
  9228. },
  9229. "icon": {
  9230. "type": "object",
  9231. "properties": {
  9232. "url": {
  9233. "type": "string"
  9234. },
  9235. "override": {
  9236. "type": "string"
  9237. },
  9238. "color": {
  9239. "type": "string"
  9240. }
  9241. },
  9242. "additionalProperties": false
  9243. },
  9244. "commands": {
  9245. "type": "object",
  9246. "properties": {
  9247. "start": {
  9248. "type": "string",
  9249. "description": "Startup script to run when creating a new workspace (worktree)"
  9250. }
  9251. },
  9252. "additionalProperties": false
  9253. },
  9254. "time": {
  9255. "type": "object",
  9256. "properties": {
  9257. "created": {
  9258. "type": "integer",
  9259. "minimum": 0
  9260. },
  9261. "updated": {
  9262. "type": "integer",
  9263. "minimum": 0
  9264. },
  9265. "initialized": {
  9266. "type": "integer",
  9267. "minimum": 0
  9268. }
  9269. },
  9270. "required": ["created", "updated"],
  9271. "additionalProperties": false
  9272. },
  9273. "sandboxes": {
  9274. "type": "array",
  9275. "items": {
  9276. "type": "string"
  9277. }
  9278. }
  9279. },
  9280. "required": ["id", "worktree", "time", "sandboxes"],
  9281. "additionalProperties": false
  9282. },
  9283. "Pty": {
  9284. "type": "object",
  9285. "properties": {
  9286. "id": {
  9287. "type": "string"
  9288. },
  9289. "title": {
  9290. "type": "string"
  9291. },
  9292. "command": {
  9293. "type": "string"
  9294. },
  9295. "args": {
  9296. "type": "array",
  9297. "items": {
  9298. "type": "string"
  9299. }
  9300. },
  9301. "cwd": {
  9302. "type": "string"
  9303. },
  9304. "status": {
  9305. "type": "string",
  9306. "enum": ["running", "exited"]
  9307. },
  9308. "pid": {
  9309. "type": "integer",
  9310. "exclusiveMinimum": 0
  9311. }
  9312. },
  9313. "required": ["id", "title", "command", "args", "cwd", "status", "pid"],
  9314. "additionalProperties": false
  9315. },
  9316. "OutputFormatText": {
  9317. "type": "object",
  9318. "properties": {
  9319. "type": {
  9320. "type": "string",
  9321. "enum": ["text"]
  9322. }
  9323. },
  9324. "required": ["type"],
  9325. "additionalProperties": false
  9326. },
  9327. "JSONSchema": {
  9328. "type": "object"
  9329. },
  9330. "OutputFormatJsonSchema": {
  9331. "type": "object",
  9332. "properties": {
  9333. "type": {
  9334. "type": "string",
  9335. "enum": ["json_schema"]
  9336. },
  9337. "schema": {
  9338. "$ref": "#/components/schemas/JSONSchema"
  9339. },
  9340. "retryCount": {
  9341. "type": "integer",
  9342. "minimum": 0
  9343. }
  9344. },
  9345. "required": ["type", "schema"],
  9346. "additionalProperties": false
  9347. },
  9348. "OutputFormat": {
  9349. "anyOf": [
  9350. {
  9351. "$ref": "#/components/schemas/OutputFormatText"
  9352. },
  9353. {
  9354. "$ref": "#/components/schemas/OutputFormatJsonSchema"
  9355. }
  9356. ]
  9357. },
  9358. "UserMessage": {
  9359. "type": "object",
  9360. "properties": {
  9361. "id": {
  9362. "type": "string"
  9363. },
  9364. "sessionID": {
  9365. "type": "string"
  9366. },
  9367. "role": {
  9368. "type": "string",
  9369. "enum": ["user"]
  9370. },
  9371. "time": {
  9372. "type": "object",
  9373. "properties": {
  9374. "created": {
  9375. "type": "integer",
  9376. "minimum": 0
  9377. }
  9378. },
  9379. "required": ["created"],
  9380. "additionalProperties": false
  9381. },
  9382. "format": {
  9383. "$ref": "#/components/schemas/OutputFormat"
  9384. },
  9385. "summary": {
  9386. "type": "object",
  9387. "properties": {
  9388. "title": {
  9389. "type": "string"
  9390. },
  9391. "body": {
  9392. "type": "string"
  9393. },
  9394. "diffs": {
  9395. "type": "array",
  9396. "items": {
  9397. "$ref": "#/components/schemas/SnapshotFileDiff"
  9398. }
  9399. }
  9400. },
  9401. "required": ["diffs"],
  9402. "additionalProperties": false
  9403. },
  9404. "agent": {
  9405. "type": "string"
  9406. },
  9407. "model": {
  9408. "type": "object",
  9409. "properties": {
  9410. "providerID": {
  9411. "type": "string"
  9412. },
  9413. "modelID": {
  9414. "type": "string"
  9415. },
  9416. "variant": {
  9417. "type": "string"
  9418. }
  9419. },
  9420. "required": ["providerID", "modelID"],
  9421. "additionalProperties": false
  9422. },
  9423. "system": {
  9424. "type": "string"
  9425. },
  9426. "tools": {
  9427. "type": "object",
  9428. "additionalProperties": {
  9429. "type": "boolean"
  9430. }
  9431. }
  9432. },
  9433. "required": ["id", "sessionID", "role", "time", "agent", "model"],
  9434. "additionalProperties": false
  9435. },
  9436. "AssistantMessage": {
  9437. "type": "object",
  9438. "properties": {
  9439. "id": {
  9440. "type": "string"
  9441. },
  9442. "sessionID": {
  9443. "type": "string"
  9444. },
  9445. "role": {
  9446. "type": "string",
  9447. "enum": ["assistant"]
  9448. },
  9449. "time": {
  9450. "type": "object",
  9451. "properties": {
  9452. "created": {
  9453. "type": "integer",
  9454. "minimum": 0
  9455. },
  9456. "completed": {
  9457. "type": "integer",
  9458. "minimum": 0
  9459. }
  9460. },
  9461. "required": ["created"],
  9462. "additionalProperties": false
  9463. },
  9464. "error": {
  9465. "anyOf": [
  9466. {
  9467. "$ref": "#/components/schemas/ProviderAuthError"
  9468. },
  9469. {
  9470. "$ref": "#/components/schemas/UnknownError"
  9471. },
  9472. {
  9473. "$ref": "#/components/schemas/MessageOutputLengthError"
  9474. },
  9475. {
  9476. "$ref": "#/components/schemas/MessageAbortedError"
  9477. },
  9478. {
  9479. "$ref": "#/components/schemas/StructuredOutputError"
  9480. },
  9481. {
  9482. "$ref": "#/components/schemas/ContextOverflowError"
  9483. },
  9484. {
  9485. "$ref": "#/components/schemas/APIError"
  9486. }
  9487. ]
  9488. },
  9489. "parentID": {
  9490. "type": "string"
  9491. },
  9492. "modelID": {
  9493. "type": "string"
  9494. },
  9495. "providerID": {
  9496. "type": "string"
  9497. },
  9498. "mode": {
  9499. "type": "string"
  9500. },
  9501. "agent": {
  9502. "type": "string"
  9503. },
  9504. "path": {
  9505. "type": "object",
  9506. "properties": {
  9507. "cwd": {
  9508. "type": "string"
  9509. },
  9510. "root": {
  9511. "type": "string"
  9512. }
  9513. },
  9514. "required": ["cwd", "root"],
  9515. "additionalProperties": false
  9516. },
  9517. "summary": {
  9518. "type": "boolean"
  9519. },
  9520. "cost": {
  9521. "type": "number"
  9522. },
  9523. "tokens": {
  9524. "type": "object",
  9525. "properties": {
  9526. "total": {
  9527. "type": "integer",
  9528. "minimum": 0
  9529. },
  9530. "input": {
  9531. "type": "integer",
  9532. "minimum": 0
  9533. },
  9534. "output": {
  9535. "type": "integer",
  9536. "minimum": 0
  9537. },
  9538. "reasoning": {
  9539. "type": "integer",
  9540. "minimum": 0
  9541. },
  9542. "cache": {
  9543. "type": "object",
  9544. "properties": {
  9545. "read": {
  9546. "type": "integer",
  9547. "minimum": 0
  9548. },
  9549. "write": {
  9550. "type": "integer",
  9551. "minimum": 0
  9552. }
  9553. },
  9554. "required": ["read", "write"],
  9555. "additionalProperties": false
  9556. }
  9557. },
  9558. "required": ["input", "output", "reasoning", "cache"],
  9559. "additionalProperties": false
  9560. },
  9561. "structured": {},
  9562. "variant": {
  9563. "type": "string"
  9564. },
  9565. "finish": {
  9566. "type": "string"
  9567. }
  9568. },
  9569. "required": [
  9570. "id",
  9571. "sessionID",
  9572. "role",
  9573. "time",
  9574. "parentID",
  9575. "modelID",
  9576. "providerID",
  9577. "mode",
  9578. "agent",
  9579. "path",
  9580. "cost",
  9581. "tokens"
  9582. ],
  9583. "additionalProperties": false
  9584. },
  9585. "Message": {
  9586. "anyOf": [
  9587. {
  9588. "$ref": "#/components/schemas/UserMessage"
  9589. },
  9590. {
  9591. "$ref": "#/components/schemas/AssistantMessage"
  9592. }
  9593. ]
  9594. },
  9595. "TextPart": {
  9596. "type": "object",
  9597. "properties": {
  9598. "id": {
  9599. "type": "string"
  9600. },
  9601. "sessionID": {
  9602. "type": "string"
  9603. },
  9604. "messageID": {
  9605. "type": "string"
  9606. },
  9607. "type": {
  9608. "type": "string",
  9609. "enum": ["text"]
  9610. },
  9611. "text": {
  9612. "type": "string"
  9613. },
  9614. "synthetic": {
  9615. "type": "boolean"
  9616. },
  9617. "ignored": {
  9618. "type": "boolean"
  9619. },
  9620. "time": {
  9621. "type": "object",
  9622. "properties": {
  9623. "start": {
  9624. "type": "integer",
  9625. "minimum": 0
  9626. },
  9627. "end": {
  9628. "type": "integer",
  9629. "minimum": 0
  9630. }
  9631. },
  9632. "required": ["start"],
  9633. "additionalProperties": false
  9634. },
  9635. "metadata": {
  9636. "type": "object"
  9637. }
  9638. },
  9639. "required": ["id", "sessionID", "messageID", "type", "text"],
  9640. "additionalProperties": false
  9641. },
  9642. "SubtaskPart": {
  9643. "type": "object",
  9644. "properties": {
  9645. "id": {
  9646. "type": "string"
  9647. },
  9648. "sessionID": {
  9649. "type": "string"
  9650. },
  9651. "messageID": {
  9652. "type": "string"
  9653. },
  9654. "type": {
  9655. "type": "string",
  9656. "enum": ["subtask"]
  9657. },
  9658. "prompt": {
  9659. "type": "string"
  9660. },
  9661. "description": {
  9662. "type": "string"
  9663. },
  9664. "agent": {
  9665. "type": "string"
  9666. },
  9667. "model": {
  9668. "type": "object",
  9669. "properties": {
  9670. "providerID": {
  9671. "type": "string"
  9672. },
  9673. "modelID": {
  9674. "type": "string"
  9675. }
  9676. },
  9677. "required": ["providerID", "modelID"],
  9678. "additionalProperties": false
  9679. },
  9680. "command": {
  9681. "type": "string"
  9682. }
  9683. },
  9684. "required": ["id", "sessionID", "messageID", "type", "prompt", "description", "agent"],
  9685. "additionalProperties": false
  9686. },
  9687. "ReasoningPart": {
  9688. "type": "object",
  9689. "properties": {
  9690. "id": {
  9691. "type": "string"
  9692. },
  9693. "sessionID": {
  9694. "type": "string"
  9695. },
  9696. "messageID": {
  9697. "type": "string"
  9698. },
  9699. "type": {
  9700. "type": "string",
  9701. "enum": ["reasoning"]
  9702. },
  9703. "text": {
  9704. "type": "string"
  9705. },
  9706. "metadata": {
  9707. "type": "object"
  9708. },
  9709. "time": {
  9710. "type": "object",
  9711. "properties": {
  9712. "start": {
  9713. "type": "integer",
  9714. "minimum": 0
  9715. },
  9716. "end": {
  9717. "type": "integer",
  9718. "minimum": 0
  9719. }
  9720. },
  9721. "required": ["start"],
  9722. "additionalProperties": false
  9723. }
  9724. },
  9725. "required": ["id", "sessionID", "messageID", "type", "text", "time"],
  9726. "additionalProperties": false
  9727. },
  9728. "FilePartSourceText": {
  9729. "type": "object",
  9730. "properties": {
  9731. "value": {
  9732. "type": "string"
  9733. },
  9734. "start": {
  9735. "type": "integer",
  9736. "minimum": 0
  9737. },
  9738. "end": {
  9739. "type": "integer",
  9740. "minimum": 0
  9741. }
  9742. },
  9743. "required": ["value", "start", "end"],
  9744. "additionalProperties": false
  9745. },
  9746. "FileSource": {
  9747. "type": "object",
  9748. "properties": {
  9749. "text": {
  9750. "$ref": "#/components/schemas/FilePartSourceText"
  9751. },
  9752. "type": {
  9753. "type": "string",
  9754. "enum": ["file"]
  9755. },
  9756. "path": {
  9757. "type": "string"
  9758. }
  9759. },
  9760. "required": ["text", "type", "path"],
  9761. "additionalProperties": false
  9762. },
  9763. "Range": {
  9764. "type": "object",
  9765. "properties": {
  9766. "start": {
  9767. "type": "object",
  9768. "properties": {
  9769. "line": {
  9770. "type": "integer",
  9771. "minimum": 0
  9772. },
  9773. "character": {
  9774. "type": "integer",
  9775. "minimum": 0
  9776. }
  9777. },
  9778. "required": ["line", "character"],
  9779. "additionalProperties": false
  9780. },
  9781. "end": {
  9782. "type": "object",
  9783. "properties": {
  9784. "line": {
  9785. "type": "integer",
  9786. "minimum": 0
  9787. },
  9788. "character": {
  9789. "type": "integer",
  9790. "minimum": 0
  9791. }
  9792. },
  9793. "required": ["line", "character"],
  9794. "additionalProperties": false
  9795. }
  9796. },
  9797. "required": ["start", "end"],
  9798. "additionalProperties": false
  9799. },
  9800. "SymbolSource": {
  9801. "type": "object",
  9802. "properties": {
  9803. "text": {
  9804. "$ref": "#/components/schemas/FilePartSourceText"
  9805. },
  9806. "type": {
  9807. "type": "string",
  9808. "enum": ["symbol"]
  9809. },
  9810. "path": {
  9811. "type": "string"
  9812. },
  9813. "range": {
  9814. "$ref": "#/components/schemas/Range"
  9815. },
  9816. "name": {
  9817. "type": "string"
  9818. },
  9819. "kind": {
  9820. "type": "integer",
  9821. "minimum": 0
  9822. }
  9823. },
  9824. "required": ["text", "type", "path", "range", "name", "kind"],
  9825. "additionalProperties": false
  9826. },
  9827. "ResourceSource": {
  9828. "type": "object",
  9829. "properties": {
  9830. "text": {
  9831. "$ref": "#/components/schemas/FilePartSourceText"
  9832. },
  9833. "type": {
  9834. "type": "string",
  9835. "enum": ["resource"]
  9836. },
  9837. "clientName": {
  9838. "type": "string"
  9839. },
  9840. "uri": {
  9841. "type": "string"
  9842. }
  9843. },
  9844. "required": ["text", "type", "clientName", "uri"],
  9845. "additionalProperties": false
  9846. },
  9847. "FilePartSource": {
  9848. "anyOf": [
  9849. {
  9850. "$ref": "#/components/schemas/FileSource"
  9851. },
  9852. {
  9853. "$ref": "#/components/schemas/SymbolSource"
  9854. },
  9855. {
  9856. "$ref": "#/components/schemas/ResourceSource"
  9857. }
  9858. ]
  9859. },
  9860. "FilePart": {
  9861. "type": "object",
  9862. "properties": {
  9863. "id": {
  9864. "type": "string"
  9865. },
  9866. "sessionID": {
  9867. "type": "string"
  9868. },
  9869. "messageID": {
  9870. "type": "string"
  9871. },
  9872. "type": {
  9873. "type": "string",
  9874. "enum": ["file"]
  9875. },
  9876. "mime": {
  9877. "type": "string"
  9878. },
  9879. "filename": {
  9880. "type": "string"
  9881. },
  9882. "url": {
  9883. "type": "string"
  9884. },
  9885. "source": {
  9886. "$ref": "#/components/schemas/FilePartSource"
  9887. }
  9888. },
  9889. "required": ["id", "sessionID", "messageID", "type", "mime", "url"],
  9890. "additionalProperties": false
  9891. },
  9892. "ToolStatePending": {
  9893. "type": "object",
  9894. "properties": {
  9895. "status": {
  9896. "type": "string",
  9897. "enum": ["pending"]
  9898. },
  9899. "input": {
  9900. "type": "object"
  9901. },
  9902. "raw": {
  9903. "type": "string"
  9904. }
  9905. },
  9906. "required": ["status", "input", "raw"],
  9907. "additionalProperties": false
  9908. },
  9909. "ToolStateRunning": {
  9910. "type": "object",
  9911. "properties": {
  9912. "status": {
  9913. "type": "string",
  9914. "enum": ["running"]
  9915. },
  9916. "input": {
  9917. "type": "object"
  9918. },
  9919. "title": {
  9920. "type": "string"
  9921. },
  9922. "metadata": {
  9923. "type": "object"
  9924. },
  9925. "time": {
  9926. "type": "object",
  9927. "properties": {
  9928. "start": {
  9929. "type": "integer",
  9930. "minimum": 0
  9931. }
  9932. },
  9933. "required": ["start"],
  9934. "additionalProperties": false
  9935. }
  9936. },
  9937. "required": ["status", "input", "time"],
  9938. "additionalProperties": false
  9939. },
  9940. "ToolStateCompleted": {
  9941. "type": "object",
  9942. "properties": {
  9943. "status": {
  9944. "type": "string",
  9945. "enum": ["completed"]
  9946. },
  9947. "input": {
  9948. "type": "object"
  9949. },
  9950. "output": {
  9951. "type": "string"
  9952. },
  9953. "title": {
  9954. "type": "string"
  9955. },
  9956. "metadata": {
  9957. "type": "object"
  9958. },
  9959. "time": {
  9960. "type": "object",
  9961. "properties": {
  9962. "start": {
  9963. "type": "integer",
  9964. "minimum": 0
  9965. },
  9966. "end": {
  9967. "type": "integer",
  9968. "minimum": 0
  9969. },
  9970. "compacted": {
  9971. "type": "integer",
  9972. "minimum": 0
  9973. }
  9974. },
  9975. "required": ["start", "end"],
  9976. "additionalProperties": false
  9977. },
  9978. "attachments": {
  9979. "type": "array",
  9980. "items": {
  9981. "$ref": "#/components/schemas/FilePart"
  9982. }
  9983. }
  9984. },
  9985. "required": ["status", "input", "output", "title", "metadata", "time"],
  9986. "additionalProperties": false
  9987. },
  9988. "ToolStateError": {
  9989. "type": "object",
  9990. "properties": {
  9991. "status": {
  9992. "type": "string",
  9993. "enum": ["error"]
  9994. },
  9995. "input": {
  9996. "type": "object"
  9997. },
  9998. "error": {
  9999. "type": "string"
  10000. },
  10001. "metadata": {
  10002. "type": "object"
  10003. },
  10004. "time": {
  10005. "type": "object",
  10006. "properties": {
  10007. "start": {
  10008. "type": "integer",
  10009. "minimum": 0
  10010. },
  10011. "end": {
  10012. "type": "integer",
  10013. "minimum": 0
  10014. }
  10015. },
  10016. "required": ["start", "end"],
  10017. "additionalProperties": false
  10018. }
  10019. },
  10020. "required": ["status", "input", "error", "time"],
  10021. "additionalProperties": false
  10022. },
  10023. "ToolState": {
  10024. "anyOf": [
  10025. {
  10026. "$ref": "#/components/schemas/ToolStatePending"
  10027. },
  10028. {
  10029. "$ref": "#/components/schemas/ToolStateRunning"
  10030. },
  10031. {
  10032. "$ref": "#/components/schemas/ToolStateCompleted"
  10033. },
  10034. {
  10035. "$ref": "#/components/schemas/ToolStateError"
  10036. }
  10037. ]
  10038. },
  10039. "ToolPart": {
  10040. "type": "object",
  10041. "properties": {
  10042. "id": {
  10043. "type": "string"
  10044. },
  10045. "sessionID": {
  10046. "type": "string"
  10047. },
  10048. "messageID": {
  10049. "type": "string"
  10050. },
  10051. "type": {
  10052. "type": "string",
  10053. "enum": ["tool"]
  10054. },
  10055. "callID": {
  10056. "type": "string"
  10057. },
  10058. "tool": {
  10059. "type": "string"
  10060. },
  10061. "state": {
  10062. "$ref": "#/components/schemas/ToolState"
  10063. },
  10064. "metadata": {
  10065. "type": "object"
  10066. }
  10067. },
  10068. "required": ["id", "sessionID", "messageID", "type", "callID", "tool", "state"],
  10069. "additionalProperties": false
  10070. },
  10071. "StepStartPart": {
  10072. "type": "object",
  10073. "properties": {
  10074. "id": {
  10075. "type": "string"
  10076. },
  10077. "sessionID": {
  10078. "type": "string"
  10079. },
  10080. "messageID": {
  10081. "type": "string"
  10082. },
  10083. "type": {
  10084. "type": "string",
  10085. "enum": ["step-start"]
  10086. },
  10087. "snapshot": {
  10088. "type": "string"
  10089. }
  10090. },
  10091. "required": ["id", "sessionID", "messageID", "type"],
  10092. "additionalProperties": false
  10093. },
  10094. "StepFinishPart": {
  10095. "type": "object",
  10096. "properties": {
  10097. "id": {
  10098. "type": "string"
  10099. },
  10100. "sessionID": {
  10101. "type": "string"
  10102. },
  10103. "messageID": {
  10104. "type": "string"
  10105. },
  10106. "type": {
  10107. "type": "string",
  10108. "enum": ["step-finish"]
  10109. },
  10110. "reason": {
  10111. "type": "string"
  10112. },
  10113. "snapshot": {
  10114. "type": "string"
  10115. },
  10116. "cost": {
  10117. "type": "number"
  10118. },
  10119. "tokens": {
  10120. "type": "object",
  10121. "properties": {
  10122. "total": {
  10123. "type": "integer",
  10124. "minimum": 0
  10125. },
  10126. "input": {
  10127. "type": "integer",
  10128. "minimum": 0
  10129. },
  10130. "output": {
  10131. "type": "integer",
  10132. "minimum": 0
  10133. },
  10134. "reasoning": {
  10135. "type": "integer",
  10136. "minimum": 0
  10137. },
  10138. "cache": {
  10139. "type": "object",
  10140. "properties": {
  10141. "read": {
  10142. "type": "integer",
  10143. "minimum": 0
  10144. },
  10145. "write": {
  10146. "type": "integer",
  10147. "minimum": 0
  10148. }
  10149. },
  10150. "required": ["read", "write"],
  10151. "additionalProperties": false
  10152. }
  10153. },
  10154. "required": ["input", "output", "reasoning", "cache"],
  10155. "additionalProperties": false
  10156. }
  10157. },
  10158. "required": ["id", "sessionID", "messageID", "type", "reason", "cost", "tokens"],
  10159. "additionalProperties": false
  10160. },
  10161. "SnapshotPart": {
  10162. "type": "object",
  10163. "properties": {
  10164. "id": {
  10165. "type": "string"
  10166. },
  10167. "sessionID": {
  10168. "type": "string"
  10169. },
  10170. "messageID": {
  10171. "type": "string"
  10172. },
  10173. "type": {
  10174. "type": "string",
  10175. "enum": ["snapshot"]
  10176. },
  10177. "snapshot": {
  10178. "type": "string"
  10179. }
  10180. },
  10181. "required": ["id", "sessionID", "messageID", "type", "snapshot"],
  10182. "additionalProperties": false
  10183. },
  10184. "PatchPart": {
  10185. "type": "object",
  10186. "properties": {
  10187. "id": {
  10188. "type": "string"
  10189. },
  10190. "sessionID": {
  10191. "type": "string"
  10192. },
  10193. "messageID": {
  10194. "type": "string"
  10195. },
  10196. "type": {
  10197. "type": "string",
  10198. "enum": ["patch"]
  10199. },
  10200. "hash": {
  10201. "type": "string"
  10202. },
  10203. "files": {
  10204. "type": "array",
  10205. "items": {
  10206. "type": "string"
  10207. }
  10208. }
  10209. },
  10210. "required": ["id", "sessionID", "messageID", "type", "hash", "files"],
  10211. "additionalProperties": false
  10212. },
  10213. "AgentPart": {
  10214. "type": "object",
  10215. "properties": {
  10216. "id": {
  10217. "type": "string"
  10218. },
  10219. "sessionID": {
  10220. "type": "string"
  10221. },
  10222. "messageID": {
  10223. "type": "string"
  10224. },
  10225. "type": {
  10226. "type": "string",
  10227. "enum": ["agent"]
  10228. },
  10229. "name": {
  10230. "type": "string"
  10231. },
  10232. "source": {
  10233. "type": "object",
  10234. "properties": {
  10235. "value": {
  10236. "type": "string"
  10237. },
  10238. "start": {
  10239. "type": "integer",
  10240. "minimum": 0
  10241. },
  10242. "end": {
  10243. "type": "integer",
  10244. "minimum": 0
  10245. }
  10246. },
  10247. "required": ["value", "start", "end"],
  10248. "additionalProperties": false
  10249. }
  10250. },
  10251. "required": ["id", "sessionID", "messageID", "type", "name"],
  10252. "additionalProperties": false
  10253. },
  10254. "RetryPart": {
  10255. "type": "object",
  10256. "properties": {
  10257. "id": {
  10258. "type": "string"
  10259. },
  10260. "sessionID": {
  10261. "type": "string"
  10262. },
  10263. "messageID": {
  10264. "type": "string"
  10265. },
  10266. "type": {
  10267. "type": "string",
  10268. "enum": ["retry"]
  10269. },
  10270. "attempt": {
  10271. "type": "integer",
  10272. "minimum": 0
  10273. },
  10274. "error": {
  10275. "$ref": "#/components/schemas/APIError"
  10276. },
  10277. "time": {
  10278. "type": "object",
  10279. "properties": {
  10280. "created": {
  10281. "type": "integer",
  10282. "minimum": 0
  10283. }
  10284. },
  10285. "required": ["created"],
  10286. "additionalProperties": false
  10287. }
  10288. },
  10289. "required": ["id", "sessionID", "messageID", "type", "attempt", "error", "time"],
  10290. "additionalProperties": false
  10291. },
  10292. "CompactionPart": {
  10293. "type": "object",
  10294. "properties": {
  10295. "id": {
  10296. "type": "string"
  10297. },
  10298. "sessionID": {
  10299. "type": "string"
  10300. },
  10301. "messageID": {
  10302. "type": "string"
  10303. },
  10304. "type": {
  10305. "type": "string",
  10306. "enum": ["compaction"]
  10307. },
  10308. "auto": {
  10309. "type": "boolean"
  10310. },
  10311. "overflow": {
  10312. "type": "boolean"
  10313. },
  10314. "tail_start_id": {
  10315. "type": "string"
  10316. }
  10317. },
  10318. "required": ["id", "sessionID", "messageID", "type", "auto"],
  10319. "additionalProperties": false
  10320. },
  10321. "Part": {
  10322. "anyOf": [
  10323. {
  10324. "$ref": "#/components/schemas/TextPart"
  10325. },
  10326. {
  10327. "$ref": "#/components/schemas/SubtaskPart"
  10328. },
  10329. {
  10330. "$ref": "#/components/schemas/ReasoningPart"
  10331. },
  10332. {
  10333. "$ref": "#/components/schemas/FilePart"
  10334. },
  10335. {
  10336. "$ref": "#/components/schemas/ToolPart"
  10337. },
  10338. {
  10339. "$ref": "#/components/schemas/StepStartPart"
  10340. },
  10341. {
  10342. "$ref": "#/components/schemas/StepFinishPart"
  10343. },
  10344. {
  10345. "$ref": "#/components/schemas/SnapshotPart"
  10346. },
  10347. {
  10348. "$ref": "#/components/schemas/PatchPart"
  10349. },
  10350. {
  10351. "$ref": "#/components/schemas/AgentPart"
  10352. },
  10353. {
  10354. "$ref": "#/components/schemas/RetryPart"
  10355. },
  10356. {
  10357. "$ref": "#/components/schemas/CompactionPart"
  10358. }
  10359. ]
  10360. },
  10361. "PermissionAction": {
  10362. "type": "string",
  10363. "enum": ["allow", "deny", "ask"]
  10364. },
  10365. "PermissionRule": {
  10366. "type": "object",
  10367. "properties": {
  10368. "permission": {
  10369. "type": "string"
  10370. },
  10371. "pattern": {
  10372. "type": "string"
  10373. },
  10374. "action": {
  10375. "$ref": "#/components/schemas/PermissionAction"
  10376. }
  10377. },
  10378. "required": ["permission", "pattern", "action"],
  10379. "additionalProperties": false
  10380. },
  10381. "PermissionRuleset": {
  10382. "type": "array",
  10383. "items": {
  10384. "$ref": "#/components/schemas/PermissionRule"
  10385. }
  10386. },
  10387. "Session": {
  10388. "type": "object",
  10389. "properties": {
  10390. "id": {
  10391. "type": "string"
  10392. },
  10393. "slug": {
  10394. "type": "string"
  10395. },
  10396. "projectID": {
  10397. "type": "string"
  10398. },
  10399. "workspaceID": {
  10400. "type": "string"
  10401. },
  10402. "directory": {
  10403. "type": "string"
  10404. },
  10405. "path": {
  10406. "type": "string"
  10407. },
  10408. "parentID": {
  10409. "type": "string"
  10410. },
  10411. "summary": {
  10412. "type": "object",
  10413. "properties": {
  10414. "additions": {
  10415. "type": "integer",
  10416. "minimum": 0
  10417. },
  10418. "deletions": {
  10419. "type": "integer",
  10420. "minimum": 0
  10421. },
  10422. "files": {
  10423. "type": "integer",
  10424. "minimum": 0
  10425. },
  10426. "diffs": {
  10427. "type": "array",
  10428. "items": {
  10429. "$ref": "#/components/schemas/SnapshotFileDiff"
  10430. }
  10431. }
  10432. },
  10433. "required": ["additions", "deletions", "files"],
  10434. "additionalProperties": false
  10435. },
  10436. "share": {
  10437. "type": "object",
  10438. "properties": {
  10439. "url": {
  10440. "type": "string"
  10441. }
  10442. },
  10443. "required": ["url"],
  10444. "additionalProperties": false
  10445. },
  10446. "title": {
  10447. "type": "string"
  10448. },
  10449. "agent": {
  10450. "type": "string"
  10451. },
  10452. "model": {
  10453. "type": "object",
  10454. "properties": {
  10455. "id": {
  10456. "type": "string"
  10457. },
  10458. "providerID": {
  10459. "type": "string"
  10460. },
  10461. "variant": {
  10462. "type": "string"
  10463. }
  10464. },
  10465. "required": ["id", "providerID"],
  10466. "additionalProperties": false
  10467. },
  10468. "version": {
  10469. "type": "string"
  10470. },
  10471. "time": {
  10472. "type": "object",
  10473. "properties": {
  10474. "created": {
  10475. "type": "integer",
  10476. "minimum": 0
  10477. },
  10478. "updated": {
  10479. "type": "integer",
  10480. "minimum": 0
  10481. },
  10482. "compacting": {
  10483. "type": "integer",
  10484. "minimum": 0
  10485. },
  10486. "archived": {
  10487. "type": "number"
  10488. }
  10489. },
  10490. "required": ["created", "updated"],
  10491. "additionalProperties": false
  10492. },
  10493. "permission": {
  10494. "$ref": "#/components/schemas/PermissionRuleset"
  10495. },
  10496. "revert": {
  10497. "type": "object",
  10498. "properties": {
  10499. "messageID": {
  10500. "type": "string"
  10501. },
  10502. "partID": {
  10503. "type": "string"
  10504. },
  10505. "snapshot": {
  10506. "type": "string"
  10507. },
  10508. "diff": {
  10509. "type": "string"
  10510. }
  10511. },
  10512. "required": ["messageID"],
  10513. "additionalProperties": false
  10514. }
  10515. },
  10516. "required": ["id", "slug", "projectID", "directory", "title", "version", "time"],
  10517. "additionalProperties": false
  10518. },
  10519. "Prompt": {
  10520. "type": "object",
  10521. "properties": {
  10522. "text": {
  10523. "type": "string"
  10524. },
  10525. "files": {
  10526. "type": "array",
  10527. "items": {
  10528. "$ref": "#/components/schemas/PromptFileAttachment"
  10529. }
  10530. },
  10531. "agents": {
  10532. "type": "array",
  10533. "items": {
  10534. "$ref": "#/components/schemas/PromptAgentAttachment"
  10535. }
  10536. }
  10537. },
  10538. "required": ["text"],
  10539. "additionalProperties": false
  10540. },
  10541. "GlobalEvent": {
  10542. "type": "object",
  10543. "properties": {
  10544. "directory": {
  10545. "type": "string"
  10546. },
  10547. "project": {
  10548. "type": "string"
  10549. },
  10550. "workspace": {
  10551. "type": "string"
  10552. },
  10553. "payload": {
  10554. "anyOf": [
  10555. {
  10556. "$ref": "#/components/schemas/EventServerInstanceDisposed"
  10557. },
  10558. {
  10559. "$ref": "#/components/schemas/EventFileEdited"
  10560. },
  10561. {
  10562. "$ref": "#/components/schemas/EventFileWatcherUpdated"
  10563. },
  10564. {
  10565. "$ref": "#/components/schemas/EventLspClientDiagnostics"
  10566. },
  10567. {
  10568. "$ref": "#/components/schemas/EventLspUpdated"
  10569. },
  10570. {
  10571. "$ref": "#/components/schemas/EventMessagePartDelta"
  10572. },
  10573. {
  10574. "$ref": "#/components/schemas/EventPermissionAsked"
  10575. },
  10576. {
  10577. "$ref": "#/components/schemas/EventPermissionReplied"
  10578. },
  10579. {
  10580. "$ref": "#/components/schemas/EventSessionDiff"
  10581. },
  10582. {
  10583. "$ref": "#/components/schemas/EventSessionError"
  10584. },
  10585. {
  10586. "$ref": "#/components/schemas/EventInstallationUpdated"
  10587. },
  10588. {
  10589. "$ref": "#/components/schemas/EventInstallationUpdate-available"
  10590. },
  10591. {
  10592. "$ref": "#/components/schemas/EventQuestionAsked"
  10593. },
  10594. {
  10595. "$ref": "#/components/schemas/EventQuestionReplied"
  10596. },
  10597. {
  10598. "$ref": "#/components/schemas/EventQuestionRejected"
  10599. },
  10600. {
  10601. "$ref": "#/components/schemas/EventTodoUpdated"
  10602. },
  10603. {
  10604. "$ref": "#/components/schemas/EventSessionStatus"
  10605. },
  10606. {
  10607. "$ref": "#/components/schemas/EventSessionIdle"
  10608. },
  10609. {
  10610. "$ref": "#/components/schemas/EventSessionCompacted"
  10611. },
  10612. {
  10613. "$ref": "#/components/schemas/Event.tui.prompt.append"
  10614. },
  10615. {
  10616. "$ref": "#/components/schemas/Event.tui.command.execute"
  10617. },
  10618. {
  10619. "$ref": "#/components/schemas/Event.tui.toast.show"
  10620. },
  10621. {
  10622. "$ref": "#/components/schemas/Event.tui.session.select"
  10623. },
  10624. {
  10625. "$ref": "#/components/schemas/EventMcpToolsChanged"
  10626. },
  10627. {
  10628. "$ref": "#/components/schemas/EventMcpBrowserOpenFailed"
  10629. },
  10630. {
  10631. "$ref": "#/components/schemas/EventCommandExecuted"
  10632. },
  10633. {
  10634. "$ref": "#/components/schemas/EventProjectUpdated"
  10635. },
  10636. {
  10637. "$ref": "#/components/schemas/EventVcsBranchUpdated"
  10638. },
  10639. {
  10640. "$ref": "#/components/schemas/EventWorkspaceReady"
  10641. },
  10642. {
  10643. "$ref": "#/components/schemas/EventWorkspaceFailed"
  10644. },
  10645. {
  10646. "$ref": "#/components/schemas/EventWorkspaceRestore"
  10647. },
  10648. {
  10649. "$ref": "#/components/schemas/EventWorkspaceStatus"
  10650. },
  10651. {
  10652. "$ref": "#/components/schemas/EventWorktreeReady"
  10653. },
  10654. {
  10655. "$ref": "#/components/schemas/EventWorktreeFailed"
  10656. },
  10657. {
  10658. "$ref": "#/components/schemas/EventPtyCreated"
  10659. },
  10660. {
  10661. "$ref": "#/components/schemas/EventPtyUpdated"
  10662. },
  10663. {
  10664. "$ref": "#/components/schemas/EventPtyExited"
  10665. },
  10666. {
  10667. "$ref": "#/components/schemas/EventPtyDeleted"
  10668. },
  10669. {
  10670. "$ref": "#/components/schemas/EventMessageUpdated"
  10671. },
  10672. {
  10673. "$ref": "#/components/schemas/EventMessageRemoved"
  10674. },
  10675. {
  10676. "$ref": "#/components/schemas/EventMessagePartUpdated"
  10677. },
  10678. {
  10679. "$ref": "#/components/schemas/EventMessagePartRemoved"
  10680. },
  10681. {
  10682. "$ref": "#/components/schemas/EventSessionCreated"
  10683. },
  10684. {
  10685. "$ref": "#/components/schemas/EventSessionUpdated"
  10686. },
  10687. {
  10688. "$ref": "#/components/schemas/EventSessionDeleted"
  10689. },
  10690. {
  10691. "$ref": "#/components/schemas/EventSessionNextAgentSwitched"
  10692. },
  10693. {
  10694. "$ref": "#/components/schemas/EventSessionNextModelSwitched"
  10695. },
  10696. {
  10697. "$ref": "#/components/schemas/EventSessionNextPrompted"
  10698. },
  10699. {
  10700. "$ref": "#/components/schemas/EventSessionNextSynthetic"
  10701. },
  10702. {
  10703. "$ref": "#/components/schemas/EventSessionNextShellStarted"
  10704. },
  10705. {
  10706. "$ref": "#/components/schemas/EventSessionNextShellEnded"
  10707. },
  10708. {
  10709. "$ref": "#/components/schemas/EventSessionNextStepStarted"
  10710. },
  10711. {
  10712. "$ref": "#/components/schemas/EventSessionNextStepEnded"
  10713. },
  10714. {
  10715. "$ref": "#/components/schemas/EventSessionNextStepFailed"
  10716. },
  10717. {
  10718. "$ref": "#/components/schemas/EventSessionNextTextStarted"
  10719. },
  10720. {
  10721. "$ref": "#/components/schemas/EventSessionNextTextDelta"
  10722. },
  10723. {
  10724. "$ref": "#/components/schemas/EventSessionNextTextEnded"
  10725. },
  10726. {
  10727. "$ref": "#/components/schemas/EventSessionNextReasoningStarted"
  10728. },
  10729. {
  10730. "$ref": "#/components/schemas/EventSessionNextReasoningDelta"
  10731. },
  10732. {
  10733. "$ref": "#/components/schemas/EventSessionNextReasoningEnded"
  10734. },
  10735. {
  10736. "$ref": "#/components/schemas/EventSessionNextToolInputStarted"
  10737. },
  10738. {
  10739. "$ref": "#/components/schemas/EventSessionNextToolInputDelta"
  10740. },
  10741. {
  10742. "$ref": "#/components/schemas/EventSessionNextToolInputEnded"
  10743. },
  10744. {
  10745. "$ref": "#/components/schemas/EventSessionNextToolCalled"
  10746. },
  10747. {
  10748. "$ref": "#/components/schemas/EventSessionNextToolProgress"
  10749. },
  10750. {
  10751. "$ref": "#/components/schemas/EventSessionNextToolSuccess"
  10752. },
  10753. {
  10754. "$ref": "#/components/schemas/EventSessionNextToolFailed"
  10755. },
  10756. {
  10757. "$ref": "#/components/schemas/EventSessionNextRetried"
  10758. },
  10759. {
  10760. "$ref": "#/components/schemas/EventSessionNextCompactionStarted"
  10761. },
  10762. {
  10763. "$ref": "#/components/schemas/EventSessionNextCompactionDelta"
  10764. },
  10765. {
  10766. "$ref": "#/components/schemas/EventSessionNextCompactionEnded"
  10767. },
  10768. {
  10769. "$ref": "#/components/schemas/EventServerConnected"
  10770. },
  10771. {
  10772. "$ref": "#/components/schemas/EventGlobalDisposed"
  10773. },
  10774. {
  10775. "$ref": "#/components/schemas/SyncEventMessageUpdated"
  10776. },
  10777. {
  10778. "$ref": "#/components/schemas/SyncEventMessageRemoved"
  10779. },
  10780. {
  10781. "$ref": "#/components/schemas/SyncEventMessagePartUpdated"
  10782. },
  10783. {
  10784. "$ref": "#/components/schemas/SyncEventMessagePartRemoved"
  10785. },
  10786. {
  10787. "$ref": "#/components/schemas/SyncEventSessionCreated"
  10788. },
  10789. {
  10790. "$ref": "#/components/schemas/SyncEventSessionUpdated"
  10791. },
  10792. {
  10793. "$ref": "#/components/schemas/SyncEventSessionDeleted"
  10794. },
  10795. {
  10796. "$ref": "#/components/schemas/SyncEventSessionNextAgentSwitched"
  10797. },
  10798. {
  10799. "$ref": "#/components/schemas/SyncEventSessionNextModelSwitched"
  10800. },
  10801. {
  10802. "$ref": "#/components/schemas/SyncEventSessionNextPrompted"
  10803. },
  10804. {
  10805. "$ref": "#/components/schemas/SyncEventSessionNextSynthetic"
  10806. },
  10807. {
  10808. "$ref": "#/components/schemas/SyncEventSessionNextShellStarted"
  10809. },
  10810. {
  10811. "$ref": "#/components/schemas/SyncEventSessionNextShellEnded"
  10812. },
  10813. {
  10814. "$ref": "#/components/schemas/SyncEventSessionNextStepStarted"
  10815. },
  10816. {
  10817. "$ref": "#/components/schemas/SyncEventSessionNextStepEnded"
  10818. },
  10819. {
  10820. "$ref": "#/components/schemas/SyncEventSessionNextStepFailed"
  10821. },
  10822. {
  10823. "$ref": "#/components/schemas/SyncEventSessionNextTextStarted"
  10824. },
  10825. {
  10826. "$ref": "#/components/schemas/SyncEventSessionNextTextDelta"
  10827. },
  10828. {
  10829. "$ref": "#/components/schemas/SyncEventSessionNextTextEnded"
  10830. },
  10831. {
  10832. "$ref": "#/components/schemas/SyncEventSessionNextReasoningStarted"
  10833. },
  10834. {
  10835. "$ref": "#/components/schemas/SyncEventSessionNextReasoningDelta"
  10836. },
  10837. {
  10838. "$ref": "#/components/schemas/SyncEventSessionNextReasoningEnded"
  10839. },
  10840. {
  10841. "$ref": "#/components/schemas/SyncEventSessionNextToolInputStarted"
  10842. },
  10843. {
  10844. "$ref": "#/components/schemas/SyncEventSessionNextToolInputDelta"
  10845. },
  10846. {
  10847. "$ref": "#/components/schemas/SyncEventSessionNextToolInputEnded"
  10848. },
  10849. {
  10850. "$ref": "#/components/schemas/SyncEventSessionNextToolCalled"
  10851. },
  10852. {
  10853. "$ref": "#/components/schemas/SyncEventSessionNextToolProgress"
  10854. },
  10855. {
  10856. "$ref": "#/components/schemas/SyncEventSessionNextToolSuccess"
  10857. },
  10858. {
  10859. "$ref": "#/components/schemas/SyncEventSessionNextToolFailed"
  10860. },
  10861. {
  10862. "$ref": "#/components/schemas/SyncEventSessionNextRetried"
  10863. },
  10864. {
  10865. "$ref": "#/components/schemas/SyncEventSessionNextCompactionStarted"
  10866. },
  10867. {
  10868. "$ref": "#/components/schemas/SyncEventSessionNextCompactionDelta"
  10869. },
  10870. {
  10871. "$ref": "#/components/schemas/SyncEventSessionNextCompactionEnded"
  10872. }
  10873. ]
  10874. }
  10875. },
  10876. "required": ["directory", "payload"],
  10877. "additionalProperties": false
  10878. },
  10879. "LogLevel": {
  10880. "type": "string",
  10881. "enum": ["DEBUG", "INFO", "WARN", "ERROR"],
  10882. "description": "Log level"
  10883. },
  10884. "ServerConfig": {
  10885. "type": "object",
  10886. "properties": {
  10887. "port": {
  10888. "type": "integer",
  10889. "exclusiveMinimum": 0
  10890. },
  10891. "hostname": {
  10892. "type": "string"
  10893. },
  10894. "mdns": {
  10895. "type": "boolean"
  10896. },
  10897. "mdnsDomain": {
  10898. "type": "string"
  10899. },
  10900. "cors": {
  10901. "type": "array",
  10902. "items": {
  10903. "type": "string"
  10904. }
  10905. }
  10906. },
  10907. "additionalProperties": false,
  10908. "description": "Server configuration for opencode serve and web commands"
  10909. },
  10910. "PermissionActionConfig": {
  10911. "type": "string",
  10912. "enum": ["ask", "allow", "deny"]
  10913. },
  10914. "PermissionObjectConfig": {
  10915. "type": "object",
  10916. "additionalProperties": {
  10917. "$ref": "#/components/schemas/PermissionActionConfig"
  10918. }
  10919. },
  10920. "PermissionRuleConfig": {
  10921. "anyOf": [
  10922. {
  10923. "$ref": "#/components/schemas/PermissionActionConfig"
  10924. },
  10925. {
  10926. "$ref": "#/components/schemas/PermissionObjectConfig"
  10927. }
  10928. ]
  10929. },
  10930. "PermissionConfig": {
  10931. "anyOf": [
  10932. {
  10933. "$ref": "#/components/schemas/PermissionActionConfig"
  10934. },
  10935. {
  10936. "type": "object",
  10937. "properties": {
  10938. "read": {
  10939. "$ref": "#/components/schemas/PermissionRuleConfig"
  10940. },
  10941. "edit": {
  10942. "$ref": "#/components/schemas/PermissionRuleConfig"
  10943. },
  10944. "glob": {
  10945. "$ref": "#/components/schemas/PermissionRuleConfig"
  10946. },
  10947. "grep": {
  10948. "$ref": "#/components/schemas/PermissionRuleConfig"
  10949. },
  10950. "list": {
  10951. "$ref": "#/components/schemas/PermissionRuleConfig"
  10952. },
  10953. "bash": {
  10954. "$ref": "#/components/schemas/PermissionRuleConfig"
  10955. },
  10956. "task": {
  10957. "$ref": "#/components/schemas/PermissionRuleConfig"
  10958. },
  10959. "external_directory": {
  10960. "$ref": "#/components/schemas/PermissionRuleConfig"
  10961. },
  10962. "todowrite": {
  10963. "$ref": "#/components/schemas/PermissionActionConfig"
  10964. },
  10965. "question": {
  10966. "$ref": "#/components/schemas/PermissionActionConfig"
  10967. },
  10968. "webfetch": {
  10969. "$ref": "#/components/schemas/PermissionActionConfig"
  10970. },
  10971. "websearch": {
  10972. "$ref": "#/components/schemas/PermissionActionConfig"
  10973. },
  10974. "lsp": {
  10975. "$ref": "#/components/schemas/PermissionRuleConfig"
  10976. },
  10977. "doom_loop": {
  10978. "$ref": "#/components/schemas/PermissionActionConfig"
  10979. },
  10980. "skill": {
  10981. "$ref": "#/components/schemas/PermissionRuleConfig"
  10982. }
  10983. },
  10984. "additionalProperties": {
  10985. "$ref": "#/components/schemas/PermissionRuleConfig"
  10986. }
  10987. }
  10988. ]
  10989. },
  10990. "AgentConfig": {
  10991. "type": "object",
  10992. "properties": {
  10993. "model": {
  10994. "type": "string"
  10995. },
  10996. "variant": {
  10997. "type": "string"
  10998. },
  10999. "temperature": {
  11000. "type": "number"
  11001. },
  11002. "top_p": {
  11003. "type": "number"
  11004. },
  11005. "prompt": {
  11006. "type": "string"
  11007. },
  11008. "tools": {
  11009. "type": "object",
  11010. "additionalProperties": {
  11011. "type": "boolean"
  11012. }
  11013. },
  11014. "disable": {
  11015. "type": "boolean"
  11016. },
  11017. "description": {
  11018. "type": "string"
  11019. },
  11020. "mode": {
  11021. "type": "string",
  11022. "enum": ["subagent", "primary", "all"]
  11023. },
  11024. "hidden": {
  11025. "type": "boolean"
  11026. },
  11027. "options": {
  11028. "type": "object"
  11029. },
  11030. "color": {
  11031. "anyOf": [
  11032. {
  11033. "type": "string",
  11034. "pattern": "^#[0-9a-fA-F]{6}$"
  11035. },
  11036. {
  11037. "type": "string",
  11038. "enum": ["primary", "secondary", "accent", "success", "warning", "error", "info"]
  11039. }
  11040. ],
  11041. "description": "Hex color code (e.g., #FF5733) or theme color (e.g., primary)"
  11042. },
  11043. "steps": {
  11044. "type": "integer",
  11045. "exclusiveMinimum": 0
  11046. },
  11047. "maxSteps": {
  11048. "type": "integer",
  11049. "exclusiveMinimum": 0
  11050. },
  11051. "permission": {
  11052. "$ref": "#/components/schemas/PermissionConfig"
  11053. }
  11054. },
  11055. "additionalProperties": {}
  11056. },
  11057. "ProviderConfig": {
  11058. "type": "object",
  11059. "properties": {
  11060. "api": {
  11061. "type": "string"
  11062. },
  11063. "name": {
  11064. "type": "string"
  11065. },
  11066. "env": {
  11067. "type": "array",
  11068. "items": {
  11069. "type": "string"
  11070. }
  11071. },
  11072. "id": {
  11073. "type": "string"
  11074. },
  11075. "npm": {
  11076. "type": "string"
  11077. },
  11078. "whitelist": {
  11079. "type": "array",
  11080. "items": {
  11081. "type": "string"
  11082. }
  11083. },
  11084. "blacklist": {
  11085. "type": "array",
  11086. "items": {
  11087. "type": "string"
  11088. }
  11089. },
  11090. "options": {
  11091. "type": "object",
  11092. "properties": {
  11093. "apiKey": {
  11094. "type": "string"
  11095. },
  11096. "baseURL": {
  11097. "type": "string"
  11098. },
  11099. "enterpriseUrl": {
  11100. "type": "string"
  11101. },
  11102. "setCacheKey": {
  11103. "type": "boolean"
  11104. },
  11105. "timeout": {
  11106. "anyOf": [
  11107. {
  11108. "type": "integer",
  11109. "exclusiveMinimum": 0
  11110. },
  11111. {
  11112. "type": "boolean",
  11113. "enum": [false]
  11114. }
  11115. ],
  11116. "description": "Timeout in milliseconds for requests to this provider. Default is 300000 (5 minutes). Set to false to disable timeout."
  11117. },
  11118. "chunkTimeout": {
  11119. "type": "integer",
  11120. "exclusiveMinimum": 0
  11121. }
  11122. },
  11123. "additionalProperties": {}
  11124. },
  11125. "models": {
  11126. "type": "object",
  11127. "additionalProperties": {
  11128. "type": "object",
  11129. "properties": {
  11130. "id": {
  11131. "type": "string"
  11132. },
  11133. "name": {
  11134. "type": "string"
  11135. },
  11136. "family": {
  11137. "type": "string"
  11138. },
  11139. "release_date": {
  11140. "type": "string"
  11141. },
  11142. "attachment": {
  11143. "type": "boolean"
  11144. },
  11145. "reasoning": {
  11146. "type": "boolean"
  11147. },
  11148. "temperature": {
  11149. "type": "boolean"
  11150. },
  11151. "tool_call": {
  11152. "type": "boolean"
  11153. },
  11154. "interleaved": {
  11155. "anyOf": [
  11156. {
  11157. "type": "boolean",
  11158. "enum": [true]
  11159. },
  11160. {
  11161. "type": "object",
  11162. "properties": {
  11163. "field": {
  11164. "type": "string",
  11165. "enum": ["reasoning_content", "reasoning_details"]
  11166. }
  11167. },
  11168. "required": ["field"],
  11169. "additionalProperties": false
  11170. }
  11171. ]
  11172. },
  11173. "cost": {
  11174. "type": "object",
  11175. "properties": {
  11176. "input": {
  11177. "type": "number"
  11178. },
  11179. "output": {
  11180. "type": "number"
  11181. },
  11182. "cache_read": {
  11183. "type": "number"
  11184. },
  11185. "cache_write": {
  11186. "type": "number"
  11187. },
  11188. "context_over_200k": {
  11189. "type": "object",
  11190. "properties": {
  11191. "input": {
  11192. "type": "number"
  11193. },
  11194. "output": {
  11195. "type": "number"
  11196. },
  11197. "cache_read": {
  11198. "type": "number"
  11199. },
  11200. "cache_write": {
  11201. "type": "number"
  11202. }
  11203. },
  11204. "required": ["input", "output"],
  11205. "additionalProperties": false
  11206. }
  11207. },
  11208. "required": ["input", "output"],
  11209. "additionalProperties": false
  11210. },
  11211. "limit": {
  11212. "type": "object",
  11213. "properties": {
  11214. "context": {
  11215. "type": "number"
  11216. },
  11217. "input": {
  11218. "type": "number"
  11219. },
  11220. "output": {
  11221. "type": "number"
  11222. }
  11223. },
  11224. "required": ["context", "output"],
  11225. "additionalProperties": false
  11226. },
  11227. "modalities": {
  11228. "type": "object",
  11229. "properties": {
  11230. "input": {
  11231. "type": "array",
  11232. "items": {
  11233. "type": "string",
  11234. "enum": ["text", "audio", "image", "video", "pdf"]
  11235. }
  11236. },
  11237. "output": {
  11238. "type": "array",
  11239. "items": {
  11240. "type": "string",
  11241. "enum": ["text", "audio", "image", "video", "pdf"]
  11242. }
  11243. }
  11244. },
  11245. "required": ["input", "output"],
  11246. "additionalProperties": false
  11247. },
  11248. "experimental": {
  11249. "type": "boolean"
  11250. },
  11251. "status": {
  11252. "type": "string",
  11253. "enum": ["alpha", "beta", "deprecated"]
  11254. },
  11255. "provider": {
  11256. "type": "object",
  11257. "properties": {
  11258. "npm": {
  11259. "type": "string"
  11260. },
  11261. "api": {
  11262. "type": "string"
  11263. }
  11264. },
  11265. "additionalProperties": false
  11266. },
  11267. "options": {
  11268. "type": "object"
  11269. },
  11270. "headers": {
  11271. "type": "object",
  11272. "additionalProperties": {
  11273. "type": "string"
  11274. }
  11275. },
  11276. "variants": {
  11277. "type": "object",
  11278. "additionalProperties": {
  11279. "type": "object",
  11280. "properties": {
  11281. "disabled": {
  11282. "type": "boolean"
  11283. }
  11284. },
  11285. "additionalProperties": {}
  11286. },
  11287. "description": "Variant-specific configuration"
  11288. }
  11289. },
  11290. "additionalProperties": false
  11291. }
  11292. }
  11293. },
  11294. "additionalProperties": false
  11295. },
  11296. "McpLocalConfig": {
  11297. "type": "object",
  11298. "properties": {
  11299. "type": {
  11300. "type": "string",
  11301. "enum": ["local"],
  11302. "description": "Type of MCP server connection"
  11303. },
  11304. "command": {
  11305. "type": "array",
  11306. "items": {
  11307. "type": "string"
  11308. },
  11309. "description": "Command and arguments to run the MCP server"
  11310. },
  11311. "environment": {
  11312. "type": "object",
  11313. "additionalProperties": {
  11314. "type": "string"
  11315. }
  11316. },
  11317. "enabled": {
  11318. "type": "boolean"
  11319. },
  11320. "timeout": {
  11321. "type": "integer",
  11322. "exclusiveMinimum": 0
  11323. }
  11324. },
  11325. "required": ["type", "command"],
  11326. "additionalProperties": false
  11327. },
  11328. "McpOAuthConfig": {
  11329. "type": "object",
  11330. "properties": {
  11331. "clientId": {
  11332. "type": "string"
  11333. },
  11334. "clientSecret": {
  11335. "type": "string"
  11336. },
  11337. "scope": {
  11338. "type": "string"
  11339. },
  11340. "redirectUri": {
  11341. "type": "string"
  11342. }
  11343. },
  11344. "additionalProperties": false
  11345. },
  11346. "McpRemoteConfig": {
  11347. "type": "object",
  11348. "properties": {
  11349. "type": {
  11350. "type": "string",
  11351. "enum": ["remote"],
  11352. "description": "Type of MCP server connection"
  11353. },
  11354. "url": {
  11355. "type": "string",
  11356. "description": "URL of the remote MCP server"
  11357. },
  11358. "enabled": {
  11359. "type": "boolean"
  11360. },
  11361. "headers": {
  11362. "type": "object",
  11363. "additionalProperties": {
  11364. "type": "string"
  11365. }
  11366. },
  11367. "oauth": {
  11368. "anyOf": [
  11369. {
  11370. "$ref": "#/components/schemas/McpOAuthConfig"
  11371. },
  11372. {
  11373. "type": "boolean",
  11374. "enum": [false]
  11375. }
  11376. ],
  11377. "description": "OAuth authentication configuration for the MCP server. Set to false to disable OAuth auto-detection."
  11378. },
  11379. "timeout": {
  11380. "type": "integer",
  11381. "exclusiveMinimum": 0
  11382. }
  11383. },
  11384. "required": ["type", "url"],
  11385. "additionalProperties": false
  11386. },
  11387. "LayoutConfig": {
  11388. "type": "string",
  11389. "enum": ["auto", "stretch"],
  11390. "description": "@deprecated Always uses stretch layout."
  11391. },
  11392. "Config": {
  11393. "type": "object",
  11394. "properties": {
  11395. "$schema": {
  11396. "type": "string"
  11397. },
  11398. "shell": {
  11399. "type": "string"
  11400. },
  11401. "logLevel": {
  11402. "$ref": "#/components/schemas/LogLevel"
  11403. },
  11404. "server": {
  11405. "$ref": "#/components/schemas/ServerConfig"
  11406. },
  11407. "command": {
  11408. "type": "object",
  11409. "additionalProperties": {
  11410. "type": "object",
  11411. "properties": {
  11412. "template": {
  11413. "type": "string"
  11414. },
  11415. "description": {
  11416. "type": "string"
  11417. },
  11418. "agent": {
  11419. "type": "string"
  11420. },
  11421. "model": {
  11422. "type": "string"
  11423. },
  11424. "subtask": {
  11425. "type": "boolean"
  11426. }
  11427. },
  11428. "required": ["template"],
  11429. "additionalProperties": false
  11430. }
  11431. },
  11432. "skills": {
  11433. "type": "object",
  11434. "properties": {
  11435. "paths": {
  11436. "type": "array",
  11437. "items": {
  11438. "type": "string"
  11439. }
  11440. },
  11441. "urls": {
  11442. "type": "array",
  11443. "items": {
  11444. "type": "string"
  11445. }
  11446. }
  11447. },
  11448. "additionalProperties": false
  11449. },
  11450. "watcher": {
  11451. "type": "object",
  11452. "properties": {
  11453. "ignore": {
  11454. "type": "array",
  11455. "items": {
  11456. "type": "string"
  11457. }
  11458. }
  11459. },
  11460. "additionalProperties": false
  11461. },
  11462. "snapshot": {
  11463. "type": "boolean"
  11464. },
  11465. "plugin": {
  11466. "type": "array",
  11467. "items": {
  11468. "anyOf": [
  11469. {
  11470. "type": "string"
  11471. },
  11472. {
  11473. "type": "array",
  11474. "prefixItems": [
  11475. {
  11476. "type": "string"
  11477. },
  11478. {
  11479. "type": "object"
  11480. }
  11481. ],
  11482. "maxItems": 2,
  11483. "minItems": 2
  11484. }
  11485. ]
  11486. }
  11487. },
  11488. "share": {
  11489. "type": "string",
  11490. "enum": ["manual", "auto", "disabled"]
  11491. },
  11492. "autoshare": {
  11493. "type": "boolean"
  11494. },
  11495. "autoupdate": {
  11496. "anyOf": [
  11497. {
  11498. "type": "boolean"
  11499. },
  11500. {
  11501. "type": "string",
  11502. "enum": ["notify"]
  11503. }
  11504. ],
  11505. "description": "Automatically update to the latest version. Set to true to auto-update, false to disable, or 'notify' to show update notifications"
  11506. },
  11507. "disabled_providers": {
  11508. "type": "array",
  11509. "items": {
  11510. "type": "string"
  11511. }
  11512. },
  11513. "enabled_providers": {
  11514. "type": "array",
  11515. "items": {
  11516. "type": "string"
  11517. }
  11518. },
  11519. "model": {
  11520. "type": "string"
  11521. },
  11522. "small_model": {
  11523. "type": "string"
  11524. },
  11525. "default_agent": {
  11526. "type": "string"
  11527. },
  11528. "username": {
  11529. "type": "string"
  11530. },
  11531. "mode": {
  11532. "type": "object",
  11533. "properties": {
  11534. "build": {
  11535. "$ref": "#/components/schemas/AgentConfig"
  11536. },
  11537. "plan": {
  11538. "$ref": "#/components/schemas/AgentConfig"
  11539. }
  11540. },
  11541. "additionalProperties": {
  11542. "$ref": "#/components/schemas/AgentConfig"
  11543. }
  11544. },
  11545. "agent": {
  11546. "type": "object",
  11547. "properties": {
  11548. "plan": {
  11549. "$ref": "#/components/schemas/AgentConfig"
  11550. },
  11551. "build": {
  11552. "$ref": "#/components/schemas/AgentConfig"
  11553. },
  11554. "general": {
  11555. "$ref": "#/components/schemas/AgentConfig"
  11556. },
  11557. "explore": {
  11558. "$ref": "#/components/schemas/AgentConfig"
  11559. },
  11560. "title": {
  11561. "$ref": "#/components/schemas/AgentConfig"
  11562. },
  11563. "summary": {
  11564. "$ref": "#/components/schemas/AgentConfig"
  11565. },
  11566. "compaction": {
  11567. "$ref": "#/components/schemas/AgentConfig"
  11568. }
  11569. },
  11570. "additionalProperties": {
  11571. "$ref": "#/components/schemas/AgentConfig"
  11572. }
  11573. },
  11574. "provider": {
  11575. "type": "object",
  11576. "additionalProperties": {
  11577. "$ref": "#/components/schemas/ProviderConfig"
  11578. }
  11579. },
  11580. "mcp": {
  11581. "type": "object",
  11582. "additionalProperties": {
  11583. "anyOf": [
  11584. {
  11585. "$ref": "#/components/schemas/McpLocalConfig"
  11586. },
  11587. {
  11588. "$ref": "#/components/schemas/McpRemoteConfig"
  11589. },
  11590. {
  11591. "type": "object",
  11592. "properties": {
  11593. "enabled": {
  11594. "type": "boolean"
  11595. }
  11596. },
  11597. "required": ["enabled"],
  11598. "additionalProperties": false
  11599. }
  11600. ]
  11601. }
  11602. },
  11603. "formatter": {
  11604. "anyOf": [
  11605. {
  11606. "type": "boolean"
  11607. },
  11608. {
  11609. "type": "object",
  11610. "additionalProperties": {
  11611. "type": "object",
  11612. "properties": {
  11613. "disabled": {
  11614. "type": "boolean"
  11615. },
  11616. "command": {
  11617. "type": "array",
  11618. "items": {
  11619. "type": "string"
  11620. }
  11621. },
  11622. "environment": {
  11623. "type": "object",
  11624. "additionalProperties": {
  11625. "type": "string"
  11626. }
  11627. },
  11628. "extensions": {
  11629. "type": "array",
  11630. "items": {
  11631. "type": "string"
  11632. }
  11633. }
  11634. },
  11635. "additionalProperties": false
  11636. }
  11637. }
  11638. ],
  11639. "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."
  11640. },
  11641. "lsp": {
  11642. "anyOf": [
  11643. {
  11644. "type": "boolean"
  11645. },
  11646. {
  11647. "type": "object",
  11648. "additionalProperties": {
  11649. "anyOf": [
  11650. {
  11651. "type": "object",
  11652. "properties": {
  11653. "disabled": {
  11654. "type": "boolean",
  11655. "enum": [true]
  11656. }
  11657. },
  11658. "required": ["disabled"],
  11659. "additionalProperties": false
  11660. },
  11661. {
  11662. "type": "object",
  11663. "properties": {
  11664. "command": {
  11665. "type": "array",
  11666. "items": {
  11667. "type": "string"
  11668. }
  11669. },
  11670. "extensions": {
  11671. "type": "array",
  11672. "items": {
  11673. "type": "string"
  11674. }
  11675. },
  11676. "disabled": {
  11677. "type": "boolean"
  11678. },
  11679. "env": {
  11680. "type": "object",
  11681. "additionalProperties": {
  11682. "type": "string"
  11683. }
  11684. },
  11685. "initialization": {
  11686. "type": "object"
  11687. }
  11688. },
  11689. "required": ["command"],
  11690. "additionalProperties": false
  11691. }
  11692. ]
  11693. }
  11694. }
  11695. ],
  11696. "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."
  11697. },
  11698. "instructions": {
  11699. "type": "array",
  11700. "items": {
  11701. "type": "string"
  11702. }
  11703. },
  11704. "layout": {
  11705. "$ref": "#/components/schemas/LayoutConfig"
  11706. },
  11707. "permission": {
  11708. "$ref": "#/components/schemas/PermissionConfig"
  11709. },
  11710. "tools": {
  11711. "type": "object",
  11712. "additionalProperties": {
  11713. "type": "boolean"
  11714. }
  11715. },
  11716. "enterprise": {
  11717. "type": "object",
  11718. "properties": {
  11719. "url": {
  11720. "type": "string"
  11721. }
  11722. },
  11723. "additionalProperties": false
  11724. },
  11725. "tool_output": {
  11726. "type": "object",
  11727. "properties": {
  11728. "max_lines": {
  11729. "type": "integer",
  11730. "exclusiveMinimum": 0
  11731. },
  11732. "max_bytes": {
  11733. "type": "integer",
  11734. "exclusiveMinimum": 0
  11735. }
  11736. },
  11737. "additionalProperties": false
  11738. },
  11739. "compaction": {
  11740. "type": "object",
  11741. "properties": {
  11742. "auto": {
  11743. "type": "boolean"
  11744. },
  11745. "prune": {
  11746. "type": "boolean"
  11747. },
  11748. "tail_turns": {
  11749. "type": "integer",
  11750. "minimum": 0
  11751. },
  11752. "preserve_recent_tokens": {
  11753. "type": "integer",
  11754. "minimum": 0
  11755. },
  11756. "reserved": {
  11757. "type": "integer",
  11758. "minimum": 0
  11759. }
  11760. },
  11761. "additionalProperties": false
  11762. },
  11763. "experimental": {
  11764. "type": "object",
  11765. "properties": {
  11766. "disable_paste_summary": {
  11767. "type": "boolean"
  11768. },
  11769. "batch_tool": {
  11770. "type": "boolean"
  11771. },
  11772. "openTelemetry": {
  11773. "type": "boolean"
  11774. },
  11775. "primary_tools": {
  11776. "type": "array",
  11777. "items": {
  11778. "type": "string"
  11779. }
  11780. },
  11781. "continue_loop_on_deny": {
  11782. "type": "boolean"
  11783. },
  11784. "mcp_timeout": {
  11785. "type": "integer",
  11786. "exclusiveMinimum": 0
  11787. }
  11788. },
  11789. "additionalProperties": false
  11790. }
  11791. },
  11792. "additionalProperties": false
  11793. },
  11794. "Model": {
  11795. "type": "object",
  11796. "properties": {
  11797. "id": {
  11798. "type": "string"
  11799. },
  11800. "providerID": {
  11801. "type": "string"
  11802. },
  11803. "api": {
  11804. "type": "object",
  11805. "properties": {
  11806. "id": {
  11807. "type": "string"
  11808. },
  11809. "url": {
  11810. "type": "string"
  11811. },
  11812. "npm": {
  11813. "type": "string"
  11814. }
  11815. },
  11816. "required": ["id", "url", "npm"],
  11817. "additionalProperties": false
  11818. },
  11819. "name": {
  11820. "type": "string"
  11821. },
  11822. "family": {
  11823. "type": "string"
  11824. },
  11825. "capabilities": {
  11826. "type": "object",
  11827. "properties": {
  11828. "temperature": {
  11829. "type": "boolean"
  11830. },
  11831. "reasoning": {
  11832. "type": "boolean"
  11833. },
  11834. "attachment": {
  11835. "type": "boolean"
  11836. },
  11837. "toolcall": {
  11838. "type": "boolean"
  11839. },
  11840. "input": {
  11841. "type": "object",
  11842. "properties": {
  11843. "text": {
  11844. "type": "boolean"
  11845. },
  11846. "audio": {
  11847. "type": "boolean"
  11848. },
  11849. "image": {
  11850. "type": "boolean"
  11851. },
  11852. "video": {
  11853. "type": "boolean"
  11854. },
  11855. "pdf": {
  11856. "type": "boolean"
  11857. }
  11858. },
  11859. "required": ["text", "audio", "image", "video", "pdf"],
  11860. "additionalProperties": false
  11861. },
  11862. "output": {
  11863. "type": "object",
  11864. "properties": {
  11865. "text": {
  11866. "type": "boolean"
  11867. },
  11868. "audio": {
  11869. "type": "boolean"
  11870. },
  11871. "image": {
  11872. "type": "boolean"
  11873. },
  11874. "video": {
  11875. "type": "boolean"
  11876. },
  11877. "pdf": {
  11878. "type": "boolean"
  11879. }
  11880. },
  11881. "required": ["text", "audio", "image", "video", "pdf"],
  11882. "additionalProperties": false
  11883. },
  11884. "interleaved": {
  11885. "anyOf": [
  11886. {
  11887. "type": "boolean"
  11888. },
  11889. {
  11890. "type": "object",
  11891. "properties": {
  11892. "field": {
  11893. "type": "string",
  11894. "enum": ["reasoning_content", "reasoning_details"]
  11895. }
  11896. },
  11897. "required": ["field"],
  11898. "additionalProperties": false
  11899. }
  11900. ]
  11901. }
  11902. },
  11903. "required": ["temperature", "reasoning", "attachment", "toolcall", "input", "output", "interleaved"],
  11904. "additionalProperties": false
  11905. },
  11906. "cost": {
  11907. "type": "object",
  11908. "properties": {
  11909. "input": {
  11910. "type": "number"
  11911. },
  11912. "output": {
  11913. "type": "number"
  11914. },
  11915. "cache": {
  11916. "type": "object",
  11917. "properties": {
  11918. "read": {
  11919. "type": "number"
  11920. },
  11921. "write": {
  11922. "type": "number"
  11923. }
  11924. },
  11925. "required": ["read", "write"],
  11926. "additionalProperties": false
  11927. },
  11928. "experimentalOver200K": {
  11929. "type": "object",
  11930. "properties": {
  11931. "input": {
  11932. "type": "number"
  11933. },
  11934. "output": {
  11935. "type": "number"
  11936. },
  11937. "cache": {
  11938. "type": "object",
  11939. "properties": {
  11940. "read": {
  11941. "type": "number"
  11942. },
  11943. "write": {
  11944. "type": "number"
  11945. }
  11946. },
  11947. "required": ["read", "write"],
  11948. "additionalProperties": false
  11949. }
  11950. },
  11951. "required": ["input", "output", "cache"],
  11952. "additionalProperties": false
  11953. }
  11954. },
  11955. "required": ["input", "output", "cache"],
  11956. "additionalProperties": false
  11957. },
  11958. "limit": {
  11959. "type": "object",
  11960. "properties": {
  11961. "context": {
  11962. "type": "number"
  11963. },
  11964. "input": {
  11965. "type": "number"
  11966. },
  11967. "output": {
  11968. "type": "number"
  11969. }
  11970. },
  11971. "required": ["context", "output"],
  11972. "additionalProperties": false
  11973. },
  11974. "status": {
  11975. "type": "string",
  11976. "enum": ["alpha", "beta", "deprecated", "active"]
  11977. },
  11978. "options": {
  11979. "type": "object"
  11980. },
  11981. "headers": {
  11982. "type": "object",
  11983. "additionalProperties": {
  11984. "type": "string"
  11985. }
  11986. },
  11987. "release_date": {
  11988. "type": "string"
  11989. },
  11990. "variants": {
  11991. "type": "object",
  11992. "additionalProperties": {
  11993. "type": "object"
  11994. }
  11995. }
  11996. },
  11997. "required": [
  11998. "id",
  11999. "providerID",
  12000. "api",
  12001. "name",
  12002. "capabilities",
  12003. "cost",
  12004. "limit",
  12005. "status",
  12006. "options",
  12007. "headers",
  12008. "release_date"
  12009. ],
  12010. "additionalProperties": false
  12011. },
  12012. "Provider": {
  12013. "type": "object",
  12014. "properties": {
  12015. "id": {
  12016. "type": "string"
  12017. },
  12018. "name": {
  12019. "type": "string"
  12020. },
  12021. "source": {
  12022. "type": "string",
  12023. "enum": ["env", "config", "custom", "api"]
  12024. },
  12025. "env": {
  12026. "type": "array",
  12027. "items": {
  12028. "type": "string"
  12029. }
  12030. },
  12031. "key": {
  12032. "type": "string"
  12033. },
  12034. "options": {
  12035. "type": "object"
  12036. },
  12037. "models": {
  12038. "type": "object",
  12039. "additionalProperties": {
  12040. "$ref": "#/components/schemas/Model"
  12041. }
  12042. }
  12043. },
  12044. "required": ["id", "name", "source", "env", "options", "models"],
  12045. "additionalProperties": false
  12046. },
  12047. "ConsoleState": {
  12048. "type": "object",
  12049. "properties": {
  12050. "consoleManagedProviders": {
  12051. "type": "array",
  12052. "items": {
  12053. "type": "string"
  12054. }
  12055. },
  12056. "activeOrgName": {
  12057. "type": "string"
  12058. },
  12059. "switchableOrgCount": {
  12060. "type": "integer",
  12061. "minimum": 0
  12062. }
  12063. },
  12064. "required": ["consoleManagedProviders", "switchableOrgCount"],
  12065. "additionalProperties": false
  12066. },
  12067. "ToolListItem": {
  12068. "type": "object",
  12069. "properties": {
  12070. "id": {
  12071. "type": "string"
  12072. },
  12073. "description": {
  12074. "type": "string"
  12075. },
  12076. "parameters": {}
  12077. },
  12078. "required": ["id", "description", "parameters"],
  12079. "additionalProperties": false
  12080. },
  12081. "ToolList": {
  12082. "type": "array",
  12083. "items": {
  12084. "$ref": "#/components/schemas/ToolListItem"
  12085. }
  12086. },
  12087. "ToolIDs": {
  12088. "type": "array",
  12089. "items": {
  12090. "type": "string"
  12091. }
  12092. },
  12093. "WorktreeCreateInput": {
  12094. "type": "object",
  12095. "properties": {
  12096. "name": {
  12097. "type": "string"
  12098. },
  12099. "startCommand": {
  12100. "type": "string",
  12101. "description": "Additional startup script to run after the project's start command"
  12102. }
  12103. },
  12104. "additionalProperties": false
  12105. },
  12106. "Worktree": {
  12107. "type": "object",
  12108. "properties": {
  12109. "name": {
  12110. "type": "string"
  12111. },
  12112. "branch": {
  12113. "type": "string"
  12114. },
  12115. "directory": {
  12116. "type": "string"
  12117. }
  12118. },
  12119. "required": ["name", "branch", "directory"],
  12120. "additionalProperties": false
  12121. },
  12122. "WorktreeRemoveInput": {
  12123. "type": "object",
  12124. "properties": {
  12125. "directory": {
  12126. "type": "string"
  12127. }
  12128. },
  12129. "required": ["directory"],
  12130. "additionalProperties": false
  12131. },
  12132. "WorktreeResetInput": {
  12133. "type": "object",
  12134. "properties": {
  12135. "directory": {
  12136. "type": "string"
  12137. }
  12138. },
  12139. "required": ["directory"],
  12140. "additionalProperties": false
  12141. },
  12142. "ProjectSummary": {
  12143. "type": "object",
  12144. "properties": {
  12145. "id": {
  12146. "type": "string"
  12147. },
  12148. "name": {
  12149. "type": "string"
  12150. },
  12151. "worktree": {
  12152. "type": "string"
  12153. }
  12154. },
  12155. "required": ["id", "worktree"],
  12156. "additionalProperties": false
  12157. },
  12158. "GlobalSession": {
  12159. "type": "object",
  12160. "properties": {
  12161. "id": {
  12162. "type": "string"
  12163. },
  12164. "slug": {
  12165. "type": "string"
  12166. },
  12167. "projectID": {
  12168. "type": "string"
  12169. },
  12170. "workspaceID": {
  12171. "type": "string"
  12172. },
  12173. "directory": {
  12174. "type": "string"
  12175. },
  12176. "path": {
  12177. "type": "string"
  12178. },
  12179. "parentID": {
  12180. "type": "string"
  12181. },
  12182. "summary": {
  12183. "type": "object",
  12184. "properties": {
  12185. "additions": {
  12186. "type": "integer",
  12187. "minimum": 0
  12188. },
  12189. "deletions": {
  12190. "type": "integer",
  12191. "minimum": 0
  12192. },
  12193. "files": {
  12194. "type": "integer",
  12195. "minimum": 0
  12196. },
  12197. "diffs": {
  12198. "type": "array",
  12199. "items": {
  12200. "$ref": "#/components/schemas/SnapshotFileDiff"
  12201. }
  12202. }
  12203. },
  12204. "required": ["additions", "deletions", "files"],
  12205. "additionalProperties": false
  12206. },
  12207. "share": {
  12208. "type": "object",
  12209. "properties": {
  12210. "url": {
  12211. "type": "string"
  12212. }
  12213. },
  12214. "required": ["url"],
  12215. "additionalProperties": false
  12216. },
  12217. "title": {
  12218. "type": "string"
  12219. },
  12220. "agent": {
  12221. "type": "string"
  12222. },
  12223. "model": {
  12224. "type": "object",
  12225. "properties": {
  12226. "id": {
  12227. "type": "string"
  12228. },
  12229. "providerID": {
  12230. "type": "string"
  12231. },
  12232. "variant": {
  12233. "type": "string"
  12234. }
  12235. },
  12236. "required": ["id", "providerID"],
  12237. "additionalProperties": false
  12238. },
  12239. "version": {
  12240. "type": "string"
  12241. },
  12242. "time": {
  12243. "type": "object",
  12244. "properties": {
  12245. "created": {
  12246. "type": "integer",
  12247. "minimum": 0
  12248. },
  12249. "updated": {
  12250. "type": "integer",
  12251. "minimum": 0
  12252. },
  12253. "compacting": {
  12254. "type": "integer",
  12255. "minimum": 0
  12256. },
  12257. "archived": {
  12258. "type": "number"
  12259. }
  12260. },
  12261. "required": ["created", "updated"],
  12262. "additionalProperties": false
  12263. },
  12264. "permission": {
  12265. "$ref": "#/components/schemas/PermissionRuleset"
  12266. },
  12267. "revert": {
  12268. "type": "object",
  12269. "properties": {
  12270. "messageID": {
  12271. "type": "string"
  12272. },
  12273. "partID": {
  12274. "type": "string"
  12275. },
  12276. "snapshot": {
  12277. "type": "string"
  12278. },
  12279. "diff": {
  12280. "type": "string"
  12281. }
  12282. },
  12283. "required": ["messageID"],
  12284. "additionalProperties": false
  12285. },
  12286. "project": {
  12287. "anyOf": [
  12288. {
  12289. "$ref": "#/components/schemas/ProjectSummary"
  12290. },
  12291. {
  12292. "type": "null"
  12293. }
  12294. ]
  12295. }
  12296. },
  12297. "required": ["id", "slug", "projectID", "directory", "title", "version", "time", "project"],
  12298. "additionalProperties": false
  12299. },
  12300. "McpResource": {
  12301. "type": "object",
  12302. "properties": {
  12303. "name": {
  12304. "type": "string"
  12305. },
  12306. "uri": {
  12307. "type": "string"
  12308. },
  12309. "description": {
  12310. "type": "string"
  12311. },
  12312. "mimeType": {
  12313. "type": "string"
  12314. },
  12315. "client": {
  12316. "type": "string"
  12317. }
  12318. },
  12319. "required": ["name", "uri", "client"],
  12320. "additionalProperties": false
  12321. },
  12322. "Symbol": {
  12323. "type": "object",
  12324. "properties": {
  12325. "name": {
  12326. "type": "string"
  12327. },
  12328. "kind": {
  12329. "type": "integer",
  12330. "minimum": 0
  12331. },
  12332. "location": {
  12333. "type": "object",
  12334. "properties": {
  12335. "uri": {
  12336. "type": "string"
  12337. },
  12338. "range": {
  12339. "$ref": "#/components/schemas/Range"
  12340. }
  12341. },
  12342. "required": ["uri", "range"],
  12343. "additionalProperties": false
  12344. }
  12345. },
  12346. "required": ["name", "kind", "location"],
  12347. "additionalProperties": false
  12348. },
  12349. "FileNode": {
  12350. "type": "object",
  12351. "properties": {
  12352. "name": {
  12353. "type": "string"
  12354. },
  12355. "path": {
  12356. "type": "string"
  12357. },
  12358. "absolute": {
  12359. "type": "string"
  12360. },
  12361. "type": {
  12362. "type": "string",
  12363. "enum": ["file", "directory"]
  12364. },
  12365. "ignored": {
  12366. "type": "boolean"
  12367. }
  12368. },
  12369. "required": ["name", "path", "absolute", "type", "ignored"],
  12370. "additionalProperties": false
  12371. },
  12372. "FileContent": {
  12373. "type": "object",
  12374. "properties": {
  12375. "type": {
  12376. "type": "string",
  12377. "enum": ["text", "binary"]
  12378. },
  12379. "content": {
  12380. "type": "string"
  12381. },
  12382. "diff": {
  12383. "type": "string"
  12384. },
  12385. "patch": {
  12386. "type": "object",
  12387. "properties": {
  12388. "oldFileName": {
  12389. "type": "string"
  12390. },
  12391. "newFileName": {
  12392. "type": "string"
  12393. },
  12394. "oldHeader": {
  12395. "type": "string"
  12396. },
  12397. "newHeader": {
  12398. "type": "string"
  12399. },
  12400. "hunks": {
  12401. "type": "array",
  12402. "items": {
  12403. "type": "object",
  12404. "properties": {
  12405. "oldStart": {
  12406. "type": "integer",
  12407. "minimum": 0
  12408. },
  12409. "oldLines": {
  12410. "type": "integer",
  12411. "minimum": 0
  12412. },
  12413. "newStart": {
  12414. "type": "integer",
  12415. "minimum": 0
  12416. },
  12417. "newLines": {
  12418. "type": "integer",
  12419. "minimum": 0
  12420. },
  12421. "lines": {
  12422. "type": "array",
  12423. "items": {
  12424. "type": "string"
  12425. }
  12426. }
  12427. },
  12428. "required": ["oldStart", "oldLines", "newStart", "newLines", "lines"],
  12429. "additionalProperties": false
  12430. }
  12431. },
  12432. "index": {
  12433. "type": "string"
  12434. }
  12435. },
  12436. "required": ["oldFileName", "newFileName", "hunks"],
  12437. "additionalProperties": false
  12438. },
  12439. "encoding": {
  12440. "type": "string",
  12441. "enum": ["base64"]
  12442. },
  12443. "mimeType": {
  12444. "type": "string"
  12445. }
  12446. },
  12447. "required": ["type", "content"],
  12448. "additionalProperties": false
  12449. },
  12450. "File": {
  12451. "type": "object",
  12452. "properties": {
  12453. "path": {
  12454. "type": "string"
  12455. },
  12456. "added": {
  12457. "type": "integer",
  12458. "minimum": 0
  12459. },
  12460. "removed": {
  12461. "type": "integer",
  12462. "minimum": 0
  12463. },
  12464. "status": {
  12465. "type": "string",
  12466. "enum": ["added", "deleted", "modified"]
  12467. }
  12468. },
  12469. "required": ["path", "added", "removed", "status"],
  12470. "additionalProperties": false
  12471. },
  12472. "Path": {
  12473. "type": "object",
  12474. "properties": {
  12475. "home": {
  12476. "type": "string"
  12477. },
  12478. "state": {
  12479. "type": "string"
  12480. },
  12481. "config": {
  12482. "type": "string"
  12483. },
  12484. "worktree": {
  12485. "type": "string"
  12486. },
  12487. "directory": {
  12488. "type": "string"
  12489. }
  12490. },
  12491. "required": ["home", "state", "config", "worktree", "directory"],
  12492. "additionalProperties": false
  12493. },
  12494. "VcsInfo": {
  12495. "type": "object",
  12496. "properties": {
  12497. "branch": {
  12498. "type": "string"
  12499. },
  12500. "default_branch": {
  12501. "type": "string"
  12502. }
  12503. },
  12504. "additionalProperties": false
  12505. },
  12506. "VcsFileDiff": {
  12507. "type": "object",
  12508. "properties": {
  12509. "file": {
  12510. "type": "string"
  12511. },
  12512. "patch": {
  12513. "type": "string"
  12514. },
  12515. "additions": {
  12516. "type": "integer",
  12517. "minimum": 0
  12518. },
  12519. "deletions": {
  12520. "type": "integer",
  12521. "minimum": 0
  12522. },
  12523. "status": {
  12524. "type": "string",
  12525. "enum": ["added", "deleted", "modified"]
  12526. }
  12527. },
  12528. "required": ["file", "patch", "additions", "deletions"],
  12529. "additionalProperties": false
  12530. },
  12531. "Command": {
  12532. "type": "object",
  12533. "properties": {
  12534. "name": {
  12535. "type": "string"
  12536. },
  12537. "description": {
  12538. "type": "string"
  12539. },
  12540. "agent": {
  12541. "type": "string"
  12542. },
  12543. "model": {
  12544. "type": "string"
  12545. },
  12546. "source": {
  12547. "type": "string",
  12548. "enum": ["command", "mcp", "skill"]
  12549. },
  12550. "template": {
  12551. "type": "string"
  12552. },
  12553. "subtask": {
  12554. "type": "boolean"
  12555. },
  12556. "hints": {
  12557. "type": "array",
  12558. "items": {
  12559. "type": "string"
  12560. }
  12561. }
  12562. },
  12563. "required": ["name", "template", "hints"],
  12564. "additionalProperties": false
  12565. },
  12566. "Agent": {
  12567. "type": "object",
  12568. "properties": {
  12569. "name": {
  12570. "type": "string"
  12571. },
  12572. "description": {
  12573. "type": "string"
  12574. },
  12575. "mode": {
  12576. "type": "string",
  12577. "enum": ["subagent", "primary", "all"]
  12578. },
  12579. "native": {
  12580. "type": "boolean"
  12581. },
  12582. "hidden": {
  12583. "type": "boolean"
  12584. },
  12585. "topP": {
  12586. "type": "number"
  12587. },
  12588. "temperature": {
  12589. "type": "number"
  12590. },
  12591. "color": {
  12592. "type": "string"
  12593. },
  12594. "permission": {
  12595. "$ref": "#/components/schemas/PermissionRuleset"
  12596. },
  12597. "model": {
  12598. "type": "object",
  12599. "properties": {
  12600. "modelID": {
  12601. "type": "string"
  12602. },
  12603. "providerID": {
  12604. "type": "string"
  12605. }
  12606. },
  12607. "required": ["modelID", "providerID"],
  12608. "additionalProperties": false
  12609. },
  12610. "variant": {
  12611. "type": "string"
  12612. },
  12613. "prompt": {
  12614. "type": "string"
  12615. },
  12616. "options": {
  12617. "type": "object"
  12618. },
  12619. "steps": {
  12620. "type": "number"
  12621. }
  12622. },
  12623. "required": ["name", "mode", "permission", "options"],
  12624. "additionalProperties": false
  12625. },
  12626. "LSPStatus": {
  12627. "type": "object",
  12628. "properties": {
  12629. "id": {
  12630. "type": "string"
  12631. },
  12632. "name": {
  12633. "type": "string"
  12634. },
  12635. "root": {
  12636. "type": "string"
  12637. },
  12638. "status": {
  12639. "type": "string",
  12640. "enum": ["connected", "error"]
  12641. }
  12642. },
  12643. "required": ["id", "name", "root", "status"],
  12644. "additionalProperties": false
  12645. },
  12646. "FormatterStatus": {
  12647. "type": "object",
  12648. "properties": {
  12649. "name": {
  12650. "type": "string"
  12651. },
  12652. "extensions": {
  12653. "type": "array",
  12654. "items": {
  12655. "type": "string"
  12656. }
  12657. },
  12658. "enabled": {
  12659. "type": "boolean"
  12660. }
  12661. },
  12662. "required": ["name", "extensions", "enabled"],
  12663. "additionalProperties": false
  12664. },
  12665. "MCPStatusConnected": {
  12666. "type": "object",
  12667. "properties": {
  12668. "status": {
  12669. "type": "string",
  12670. "enum": ["connected"]
  12671. }
  12672. },
  12673. "required": ["status"],
  12674. "additionalProperties": false
  12675. },
  12676. "MCPStatusDisabled": {
  12677. "type": "object",
  12678. "properties": {
  12679. "status": {
  12680. "type": "string",
  12681. "enum": ["disabled"]
  12682. }
  12683. },
  12684. "required": ["status"],
  12685. "additionalProperties": false
  12686. },
  12687. "MCPStatusFailed": {
  12688. "type": "object",
  12689. "properties": {
  12690. "status": {
  12691. "type": "string",
  12692. "enum": ["failed"]
  12693. },
  12694. "error": {
  12695. "type": "string"
  12696. }
  12697. },
  12698. "required": ["status", "error"],
  12699. "additionalProperties": false
  12700. },
  12701. "MCPStatusNeedsAuth": {
  12702. "type": "object",
  12703. "properties": {
  12704. "status": {
  12705. "type": "string",
  12706. "enum": ["needs_auth"]
  12707. }
  12708. },
  12709. "required": ["status"],
  12710. "additionalProperties": false
  12711. },
  12712. "MCPStatusNeedsClientRegistration": {
  12713. "type": "object",
  12714. "properties": {
  12715. "status": {
  12716. "type": "string",
  12717. "enum": ["needs_client_registration"]
  12718. },
  12719. "error": {
  12720. "type": "string"
  12721. }
  12722. },
  12723. "required": ["status", "error"],
  12724. "additionalProperties": false
  12725. },
  12726. "MCPStatus": {
  12727. "anyOf": [
  12728. {
  12729. "$ref": "#/components/schemas/MCPStatusConnected"
  12730. },
  12731. {
  12732. "$ref": "#/components/schemas/MCPStatusDisabled"
  12733. },
  12734. {
  12735. "$ref": "#/components/schemas/MCPStatusFailed"
  12736. },
  12737. {
  12738. "$ref": "#/components/schemas/MCPStatusNeedsAuth"
  12739. },
  12740. {
  12741. "$ref": "#/components/schemas/MCPStatusNeedsClientRegistration"
  12742. }
  12743. ]
  12744. },
  12745. "McpUnsupportedOAuthError": {
  12746. "type": "object",
  12747. "properties": {
  12748. "error": {
  12749. "type": "string"
  12750. }
  12751. },
  12752. "required": ["error"],
  12753. "additionalProperties": false
  12754. },
  12755. "ProviderAuthMethod": {
  12756. "type": "object",
  12757. "properties": {
  12758. "type": {
  12759. "type": "string",
  12760. "enum": ["oauth", "api"]
  12761. },
  12762. "label": {
  12763. "type": "string"
  12764. },
  12765. "prompts": {
  12766. "type": "array",
  12767. "items": {
  12768. "anyOf": [
  12769. {
  12770. "type": "object",
  12771. "properties": {
  12772. "type": {
  12773. "type": "string",
  12774. "enum": ["text"]
  12775. },
  12776. "key": {
  12777. "type": "string"
  12778. },
  12779. "message": {
  12780. "type": "string"
  12781. },
  12782. "placeholder": {
  12783. "type": "string"
  12784. },
  12785. "when": {
  12786. "type": "object",
  12787. "properties": {
  12788. "key": {
  12789. "type": "string"
  12790. },
  12791. "op": {
  12792. "type": "string",
  12793. "enum": ["eq", "neq"]
  12794. },
  12795. "value": {
  12796. "type": "string"
  12797. }
  12798. },
  12799. "required": ["key", "op", "value"],
  12800. "additionalProperties": false
  12801. }
  12802. },
  12803. "required": ["type", "key", "message"],
  12804. "additionalProperties": false
  12805. },
  12806. {
  12807. "type": "object",
  12808. "properties": {
  12809. "type": {
  12810. "type": "string",
  12811. "enum": ["select"]
  12812. },
  12813. "key": {
  12814. "type": "string"
  12815. },
  12816. "message": {
  12817. "type": "string"
  12818. },
  12819. "options": {
  12820. "type": "array",
  12821. "items": {
  12822. "type": "object",
  12823. "properties": {
  12824. "label": {
  12825. "type": "string"
  12826. },
  12827. "value": {
  12828. "type": "string"
  12829. },
  12830. "hint": {
  12831. "type": "string"
  12832. }
  12833. },
  12834. "required": ["label", "value"],
  12835. "additionalProperties": false
  12836. }
  12837. },
  12838. "when": {
  12839. "type": "object",
  12840. "properties": {
  12841. "key": {
  12842. "type": "string"
  12843. },
  12844. "op": {
  12845. "type": "string",
  12846. "enum": ["eq", "neq"]
  12847. },
  12848. "value": {
  12849. "type": "string"
  12850. }
  12851. },
  12852. "required": ["key", "op", "value"],
  12853. "additionalProperties": false
  12854. }
  12855. },
  12856. "required": ["type", "key", "message", "options"],
  12857. "additionalProperties": false
  12858. }
  12859. ]
  12860. }
  12861. }
  12862. },
  12863. "required": ["type", "label"],
  12864. "additionalProperties": false
  12865. },
  12866. "ProviderAuthAuthorization": {
  12867. "type": "object",
  12868. "properties": {
  12869. "url": {
  12870. "type": "string"
  12871. },
  12872. "method": {
  12873. "type": "string",
  12874. "enum": ["auto", "code"]
  12875. },
  12876. "instructions": {
  12877. "type": "string"
  12878. }
  12879. },
  12880. "required": ["url", "method", "instructions"],
  12881. "additionalProperties": false
  12882. },
  12883. "TextPartInput": {
  12884. "type": "object",
  12885. "properties": {
  12886. "id": {
  12887. "type": "string"
  12888. },
  12889. "type": {
  12890. "type": "string",
  12891. "enum": ["text"]
  12892. },
  12893. "text": {
  12894. "type": "string"
  12895. },
  12896. "synthetic": {
  12897. "type": "boolean"
  12898. },
  12899. "ignored": {
  12900. "type": "boolean"
  12901. },
  12902. "time": {
  12903. "type": "object",
  12904. "properties": {
  12905. "start": {
  12906. "type": "integer",
  12907. "minimum": 0
  12908. },
  12909. "end": {
  12910. "type": "integer",
  12911. "minimum": 0
  12912. }
  12913. },
  12914. "required": ["start"],
  12915. "additionalProperties": false
  12916. },
  12917. "metadata": {
  12918. "type": "object"
  12919. }
  12920. },
  12921. "required": ["type", "text"],
  12922. "additionalProperties": false
  12923. },
  12924. "FilePartInput": {
  12925. "type": "object",
  12926. "properties": {
  12927. "id": {
  12928. "type": "string"
  12929. },
  12930. "type": {
  12931. "type": "string",
  12932. "enum": ["file"]
  12933. },
  12934. "mime": {
  12935. "type": "string"
  12936. },
  12937. "filename": {
  12938. "type": "string"
  12939. },
  12940. "url": {
  12941. "type": "string"
  12942. },
  12943. "source": {
  12944. "$ref": "#/components/schemas/FilePartSource"
  12945. }
  12946. },
  12947. "required": ["type", "mime", "url"],
  12948. "additionalProperties": false
  12949. },
  12950. "AgentPartInput": {
  12951. "type": "object",
  12952. "properties": {
  12953. "id": {
  12954. "type": "string"
  12955. },
  12956. "type": {
  12957. "type": "string",
  12958. "enum": ["agent"]
  12959. },
  12960. "name": {
  12961. "type": "string"
  12962. },
  12963. "source": {
  12964. "type": "object",
  12965. "properties": {
  12966. "value": {
  12967. "type": "string"
  12968. },
  12969. "start": {
  12970. "type": "integer",
  12971. "minimum": 0
  12972. },
  12973. "end": {
  12974. "type": "integer",
  12975. "minimum": 0
  12976. }
  12977. },
  12978. "required": ["value", "start", "end"],
  12979. "additionalProperties": false
  12980. }
  12981. },
  12982. "required": ["type", "name"],
  12983. "additionalProperties": false
  12984. },
  12985. "SubtaskPartInput": {
  12986. "type": "object",
  12987. "properties": {
  12988. "id": {
  12989. "type": "string"
  12990. },
  12991. "type": {
  12992. "type": "string",
  12993. "enum": ["subtask"]
  12994. },
  12995. "prompt": {
  12996. "type": "string"
  12997. },
  12998. "description": {
  12999. "type": "string"
  13000. },
  13001. "agent": {
  13002. "type": "string"
  13003. },
  13004. "model": {
  13005. "type": "object",
  13006. "properties": {
  13007. "providerID": {
  13008. "type": "string"
  13009. },
  13010. "modelID": {
  13011. "type": "string"
  13012. }
  13013. },
  13014. "required": ["providerID", "modelID"],
  13015. "additionalProperties": false
  13016. },
  13017. "command": {
  13018. "type": "string"
  13019. }
  13020. },
  13021. "required": ["type", "prompt", "description", "agent"],
  13022. "additionalProperties": false
  13023. },
  13024. "V2SessionsResponse": {
  13025. "type": "object",
  13026. "properties": {
  13027. "items": {
  13028. "type": "array",
  13029. "items": {
  13030. "$ref": "#/components/schemas/SessionInfo"
  13031. }
  13032. },
  13033. "cursor": {
  13034. "type": "object",
  13035. "properties": {
  13036. "previous": {
  13037. "type": "string"
  13038. },
  13039. "next": {
  13040. "type": "string"
  13041. }
  13042. },
  13043. "additionalProperties": false
  13044. }
  13045. },
  13046. "required": ["items", "cursor"],
  13047. "additionalProperties": false
  13048. },
  13049. "V2SessionMessagesResponse": {
  13050. "type": "object",
  13051. "properties": {
  13052. "items": {
  13053. "type": "array",
  13054. "items": {
  13055. "$ref": "#/components/schemas/SessionMessage"
  13056. }
  13057. },
  13058. "cursor": {
  13059. "type": "object",
  13060. "properties": {
  13061. "previous": {
  13062. "type": "string"
  13063. },
  13064. "next": {
  13065. "type": "string"
  13066. }
  13067. },
  13068. "additionalProperties": false
  13069. }
  13070. },
  13071. "required": ["items", "cursor"],
  13072. "additionalProperties": false
  13073. },
  13074. "EventTuiPromptAppend": {
  13075. "type": "object",
  13076. "properties": {
  13077. "type": {
  13078. "type": "string",
  13079. "enum": ["tui.prompt.append"]
  13080. },
  13081. "properties": {
  13082. "type": "object",
  13083. "properties": {
  13084. "text": {
  13085. "type": "string"
  13086. }
  13087. },
  13088. "required": ["text"],
  13089. "additionalProperties": false
  13090. }
  13091. },
  13092. "required": ["type", "properties"],
  13093. "additionalProperties": false
  13094. },
  13095. "EventTuiCommandExecute": {
  13096. "type": "object",
  13097. "properties": {
  13098. "type": {
  13099. "type": "string",
  13100. "enum": ["tui.command.execute"]
  13101. },
  13102. "properties": {
  13103. "type": "object",
  13104. "properties": {
  13105. "command": {
  13106. "anyOf": [
  13107. {
  13108. "type": "string",
  13109. "enum": [
  13110. "session.list",
  13111. "session.new",
  13112. "session.share",
  13113. "session.interrupt",
  13114. "session.compact",
  13115. "session.page.up",
  13116. "session.page.down",
  13117. "session.line.up",
  13118. "session.line.down",
  13119. "session.half.page.up",
  13120. "session.half.page.down",
  13121. "session.first",
  13122. "session.last",
  13123. "prompt.clear",
  13124. "prompt.submit",
  13125. "agent.cycle"
  13126. ]
  13127. },
  13128. {
  13129. "type": "string"
  13130. }
  13131. ]
  13132. }
  13133. },
  13134. "required": ["command"],
  13135. "additionalProperties": false
  13136. }
  13137. },
  13138. "required": ["type", "properties"],
  13139. "additionalProperties": false
  13140. },
  13141. "EventTuiToastShow": {
  13142. "type": "object",
  13143. "properties": {
  13144. "type": {
  13145. "type": "string",
  13146. "enum": ["tui.toast.show"]
  13147. },
  13148. "properties": {
  13149. "type": "object",
  13150. "properties": {
  13151. "title": {
  13152. "type": "string"
  13153. },
  13154. "message": {
  13155. "type": "string"
  13156. },
  13157. "variant": {
  13158. "type": "string",
  13159. "enum": ["info", "success", "warning", "error"]
  13160. },
  13161. "duration": {
  13162. "type": "integer",
  13163. "exclusiveMinimum": 0
  13164. }
  13165. },
  13166. "required": ["message", "variant"],
  13167. "additionalProperties": false
  13168. }
  13169. },
  13170. "required": ["type", "properties"],
  13171. "additionalProperties": false
  13172. },
  13173. "EventTuiSessionSelect": {
  13174. "type": "object",
  13175. "properties": {
  13176. "type": {
  13177. "type": "string",
  13178. "enum": ["tui.session.select"]
  13179. },
  13180. "properties": {
  13181. "type": "object",
  13182. "properties": {
  13183. "sessionID": {
  13184. "type": "string",
  13185. "description": "Session ID to navigate to"
  13186. }
  13187. },
  13188. "required": ["sessionID"],
  13189. "additionalProperties": false
  13190. }
  13191. },
  13192. "required": ["type", "properties"],
  13193. "additionalProperties": false
  13194. },
  13195. "Workspace": {
  13196. "type": "object",
  13197. "properties": {
  13198. "id": {
  13199. "type": "string"
  13200. },
  13201. "type": {
  13202. "type": "string"
  13203. },
  13204. "name": {
  13205. "type": "string"
  13206. },
  13207. "branch": {
  13208. "anyOf": [
  13209. {
  13210. "type": "string"
  13211. },
  13212. {
  13213. "type": "null"
  13214. }
  13215. ]
  13216. },
  13217. "directory": {
  13218. "anyOf": [
  13219. {
  13220. "type": "string"
  13221. },
  13222. {
  13223. "type": "null"
  13224. }
  13225. ]
  13226. },
  13227. "extra": {
  13228. "anyOf": [
  13229. {},
  13230. {
  13231. "type": "null"
  13232. }
  13233. ]
  13234. },
  13235. "projectID": {
  13236. "type": "string"
  13237. }
  13238. },
  13239. "required": ["id", "type", "name", "branch", "directory", "extra", "projectID"],
  13240. "additionalProperties": false
  13241. },
  13242. "SyncEventMessageUpdated": {
  13243. "type": "object",
  13244. "properties": {
  13245. "type": {
  13246. "type": "string",
  13247. "enum": ["sync"]
  13248. },
  13249. "name": {
  13250. "type": "string",
  13251. "enum": ["message.updated.1"]
  13252. },
  13253. "id": {
  13254. "type": "string"
  13255. },
  13256. "seq": {
  13257. "type": "number"
  13258. },
  13259. "aggregateID": {
  13260. "type": "string",
  13261. "enum": ["sessionID"]
  13262. },
  13263. "data": {
  13264. "type": "object",
  13265. "properties": {
  13266. "sessionID": {
  13267. "type": "string"
  13268. },
  13269. "info": {
  13270. "$ref": "#/components/schemas/Message"
  13271. }
  13272. },
  13273. "required": ["sessionID", "info"],
  13274. "additionalProperties": false
  13275. }
  13276. },
  13277. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  13278. "additionalProperties": false
  13279. },
  13280. "SyncEventMessageRemoved": {
  13281. "type": "object",
  13282. "properties": {
  13283. "type": {
  13284. "type": "string",
  13285. "enum": ["sync"]
  13286. },
  13287. "name": {
  13288. "type": "string",
  13289. "enum": ["message.removed.1"]
  13290. },
  13291. "id": {
  13292. "type": "string"
  13293. },
  13294. "seq": {
  13295. "type": "number"
  13296. },
  13297. "aggregateID": {
  13298. "type": "string",
  13299. "enum": ["sessionID"]
  13300. },
  13301. "data": {
  13302. "type": "object",
  13303. "properties": {
  13304. "sessionID": {
  13305. "type": "string"
  13306. },
  13307. "messageID": {
  13308. "type": "string"
  13309. }
  13310. },
  13311. "required": ["sessionID", "messageID"],
  13312. "additionalProperties": false
  13313. }
  13314. },
  13315. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  13316. "additionalProperties": false
  13317. },
  13318. "SyncEventMessagePartUpdated": {
  13319. "type": "object",
  13320. "properties": {
  13321. "type": {
  13322. "type": "string",
  13323. "enum": ["sync"]
  13324. },
  13325. "name": {
  13326. "type": "string",
  13327. "enum": ["message.part.updated.1"]
  13328. },
  13329. "id": {
  13330. "type": "string"
  13331. },
  13332. "seq": {
  13333. "type": "number"
  13334. },
  13335. "aggregateID": {
  13336. "type": "string",
  13337. "enum": ["sessionID"]
  13338. },
  13339. "data": {
  13340. "type": "object",
  13341. "properties": {
  13342. "sessionID": {
  13343. "type": "string"
  13344. },
  13345. "part": {
  13346. "$ref": "#/components/schemas/Part"
  13347. },
  13348. "time": {
  13349. "type": "integer",
  13350. "minimum": 0
  13351. }
  13352. },
  13353. "required": ["sessionID", "part", "time"],
  13354. "additionalProperties": false
  13355. }
  13356. },
  13357. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  13358. "additionalProperties": false
  13359. },
  13360. "SyncEventMessagePartRemoved": {
  13361. "type": "object",
  13362. "properties": {
  13363. "type": {
  13364. "type": "string",
  13365. "enum": ["sync"]
  13366. },
  13367. "name": {
  13368. "type": "string",
  13369. "enum": ["message.part.removed.1"]
  13370. },
  13371. "id": {
  13372. "type": "string"
  13373. },
  13374. "seq": {
  13375. "type": "number"
  13376. },
  13377. "aggregateID": {
  13378. "type": "string",
  13379. "enum": ["sessionID"]
  13380. },
  13381. "data": {
  13382. "type": "object",
  13383. "properties": {
  13384. "sessionID": {
  13385. "type": "string"
  13386. },
  13387. "messageID": {
  13388. "type": "string"
  13389. },
  13390. "partID": {
  13391. "type": "string"
  13392. }
  13393. },
  13394. "required": ["sessionID", "messageID", "partID"],
  13395. "additionalProperties": false
  13396. }
  13397. },
  13398. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  13399. "additionalProperties": false
  13400. },
  13401. "SyncEventSessionCreated": {
  13402. "type": "object",
  13403. "properties": {
  13404. "type": {
  13405. "type": "string",
  13406. "enum": ["sync"]
  13407. },
  13408. "name": {
  13409. "type": "string",
  13410. "enum": ["session.created.1"]
  13411. },
  13412. "id": {
  13413. "type": "string"
  13414. },
  13415. "seq": {
  13416. "type": "number"
  13417. },
  13418. "aggregateID": {
  13419. "type": "string",
  13420. "enum": ["sessionID"]
  13421. },
  13422. "data": {
  13423. "type": "object",
  13424. "properties": {
  13425. "sessionID": {
  13426. "type": "string"
  13427. },
  13428. "info": {
  13429. "$ref": "#/components/schemas/Session"
  13430. }
  13431. },
  13432. "required": ["sessionID", "info"],
  13433. "additionalProperties": false
  13434. }
  13435. },
  13436. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  13437. "additionalProperties": false
  13438. },
  13439. "SyncEventSessionUpdated": {
  13440. "type": "object",
  13441. "properties": {
  13442. "type": {
  13443. "type": "string",
  13444. "enum": ["sync"]
  13445. },
  13446. "name": {
  13447. "type": "string",
  13448. "enum": ["session.updated.1"]
  13449. },
  13450. "id": {
  13451. "type": "string"
  13452. },
  13453. "seq": {
  13454. "type": "number"
  13455. },
  13456. "aggregateID": {
  13457. "type": "string",
  13458. "enum": ["sessionID"]
  13459. },
  13460. "data": {
  13461. "type": "object",
  13462. "properties": {
  13463. "sessionID": {
  13464. "type": "string"
  13465. },
  13466. "info": {
  13467. "type": "object",
  13468. "properties": {
  13469. "id": {
  13470. "anyOf": [
  13471. {
  13472. "type": "string"
  13473. },
  13474. {
  13475. "type": "null"
  13476. }
  13477. ]
  13478. },
  13479. "slug": {
  13480. "anyOf": [
  13481. {
  13482. "type": "string"
  13483. },
  13484. {
  13485. "type": "null"
  13486. }
  13487. ]
  13488. },
  13489. "projectID": {
  13490. "anyOf": [
  13491. {
  13492. "type": "string"
  13493. },
  13494. {
  13495. "type": "null"
  13496. }
  13497. ]
  13498. },
  13499. "workspaceID": {
  13500. "anyOf": [
  13501. {
  13502. "type": "string"
  13503. },
  13504. {
  13505. "type": "null"
  13506. }
  13507. ]
  13508. },
  13509. "directory": {
  13510. "anyOf": [
  13511. {
  13512. "type": "string"
  13513. },
  13514. {
  13515. "type": "null"
  13516. }
  13517. ]
  13518. },
  13519. "path": {
  13520. "anyOf": [
  13521. {
  13522. "type": "string"
  13523. },
  13524. {
  13525. "type": "null"
  13526. }
  13527. ]
  13528. },
  13529. "parentID": {
  13530. "anyOf": [
  13531. {
  13532. "type": "string"
  13533. },
  13534. {
  13535. "type": "null"
  13536. }
  13537. ]
  13538. },
  13539. "summary": {
  13540. "anyOf": [
  13541. {
  13542. "type": "object",
  13543. "properties": {
  13544. "additions": {
  13545. "type": "integer",
  13546. "minimum": 0
  13547. },
  13548. "deletions": {
  13549. "type": "integer",
  13550. "minimum": 0
  13551. },
  13552. "files": {
  13553. "type": "integer",
  13554. "minimum": 0
  13555. },
  13556. "diffs": {
  13557. "type": "array",
  13558. "items": {
  13559. "$ref": "#/components/schemas/SnapshotFileDiff"
  13560. }
  13561. }
  13562. },
  13563. "required": ["additions", "deletions", "files"],
  13564. "additionalProperties": false
  13565. },
  13566. {
  13567. "type": "null"
  13568. }
  13569. ]
  13570. },
  13571. "share": {
  13572. "type": "object",
  13573. "properties": {
  13574. "url": {
  13575. "anyOf": [
  13576. {
  13577. "type": "string"
  13578. },
  13579. {
  13580. "type": "null"
  13581. }
  13582. ]
  13583. }
  13584. },
  13585. "additionalProperties": false
  13586. },
  13587. "title": {
  13588. "anyOf": [
  13589. {
  13590. "type": "string"
  13591. },
  13592. {
  13593. "type": "null"
  13594. }
  13595. ]
  13596. },
  13597. "agent": {
  13598. "anyOf": [
  13599. {
  13600. "type": "string"
  13601. },
  13602. {
  13603. "type": "null"
  13604. }
  13605. ]
  13606. },
  13607. "model": {
  13608. "anyOf": [
  13609. {
  13610. "type": "object",
  13611. "properties": {
  13612. "id": {
  13613. "type": "string"
  13614. },
  13615. "providerID": {
  13616. "type": "string"
  13617. },
  13618. "variant": {
  13619. "type": "string"
  13620. }
  13621. },
  13622. "required": ["id", "providerID"],
  13623. "additionalProperties": false
  13624. },
  13625. {
  13626. "type": "null"
  13627. }
  13628. ]
  13629. },
  13630. "version": {
  13631. "anyOf": [
  13632. {
  13633. "type": "string"
  13634. },
  13635. {
  13636. "type": "null"
  13637. }
  13638. ]
  13639. },
  13640. "time": {
  13641. "type": "object",
  13642. "properties": {
  13643. "created": {
  13644. "anyOf": [
  13645. {
  13646. "type": "integer",
  13647. "minimum": 0
  13648. },
  13649. {
  13650. "type": "null"
  13651. }
  13652. ]
  13653. },
  13654. "updated": {
  13655. "anyOf": [
  13656. {
  13657. "type": "integer",
  13658. "minimum": 0
  13659. },
  13660. {
  13661. "type": "null"
  13662. }
  13663. ]
  13664. },
  13665. "compacting": {
  13666. "anyOf": [
  13667. {
  13668. "type": "integer",
  13669. "minimum": 0
  13670. },
  13671. {
  13672. "type": "null"
  13673. }
  13674. ]
  13675. },
  13676. "archived": {
  13677. "anyOf": [
  13678. {
  13679. "type": "number"
  13680. },
  13681. {
  13682. "type": "null"
  13683. }
  13684. ]
  13685. }
  13686. },
  13687. "additionalProperties": false
  13688. },
  13689. "permission": {
  13690. "anyOf": [
  13691. {
  13692. "$ref": "#/components/schemas/PermissionRuleset"
  13693. },
  13694. {
  13695. "type": "null"
  13696. }
  13697. ]
  13698. },
  13699. "revert": {
  13700. "anyOf": [
  13701. {
  13702. "type": "object",
  13703. "properties": {
  13704. "messageID": {
  13705. "type": "string"
  13706. },
  13707. "partID": {
  13708. "type": "string"
  13709. },
  13710. "snapshot": {
  13711. "type": "string"
  13712. },
  13713. "diff": {
  13714. "type": "string"
  13715. }
  13716. },
  13717. "required": ["messageID"],
  13718. "additionalProperties": false
  13719. },
  13720. {
  13721. "type": "null"
  13722. }
  13723. ]
  13724. }
  13725. },
  13726. "additionalProperties": false
  13727. }
  13728. },
  13729. "required": ["sessionID", "info"],
  13730. "additionalProperties": false
  13731. }
  13732. },
  13733. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  13734. "additionalProperties": false
  13735. },
  13736. "SyncEventSessionDeleted": {
  13737. "type": "object",
  13738. "properties": {
  13739. "type": {
  13740. "type": "string",
  13741. "enum": ["sync"]
  13742. },
  13743. "name": {
  13744. "type": "string",
  13745. "enum": ["session.deleted.1"]
  13746. },
  13747. "id": {
  13748. "type": "string"
  13749. },
  13750. "seq": {
  13751. "type": "number"
  13752. },
  13753. "aggregateID": {
  13754. "type": "string",
  13755. "enum": ["sessionID"]
  13756. },
  13757. "data": {
  13758. "type": "object",
  13759. "properties": {
  13760. "sessionID": {
  13761. "type": "string"
  13762. },
  13763. "info": {
  13764. "$ref": "#/components/schemas/Session"
  13765. }
  13766. },
  13767. "required": ["sessionID", "info"],
  13768. "additionalProperties": false
  13769. }
  13770. },
  13771. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  13772. "additionalProperties": false
  13773. },
  13774. "SyncEventSessionNextAgentSwitched": {
  13775. "type": "object",
  13776. "properties": {
  13777. "type": {
  13778. "type": "string",
  13779. "enum": ["sync"]
  13780. },
  13781. "name": {
  13782. "type": "string",
  13783. "enum": ["session.next.agent.switched.1"]
  13784. },
  13785. "id": {
  13786. "type": "string"
  13787. },
  13788. "seq": {
  13789. "type": "number"
  13790. },
  13791. "aggregateID": {
  13792. "type": "string",
  13793. "enum": ["sessionID"]
  13794. },
  13795. "data": {
  13796. "type": "object",
  13797. "properties": {
  13798. "timestamp": {
  13799. "type": "number"
  13800. },
  13801. "sessionID": {
  13802. "type": "string"
  13803. },
  13804. "agent": {
  13805. "type": "string"
  13806. }
  13807. },
  13808. "required": ["timestamp", "sessionID", "agent"],
  13809. "additionalProperties": false
  13810. }
  13811. },
  13812. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  13813. "additionalProperties": false
  13814. },
  13815. "SyncEventSessionNextModelSwitched": {
  13816. "type": "object",
  13817. "properties": {
  13818. "type": {
  13819. "type": "string",
  13820. "enum": ["sync"]
  13821. },
  13822. "name": {
  13823. "type": "string",
  13824. "enum": ["session.next.model.switched.1"]
  13825. },
  13826. "id": {
  13827. "type": "string"
  13828. },
  13829. "seq": {
  13830. "type": "number"
  13831. },
  13832. "aggregateID": {
  13833. "type": "string",
  13834. "enum": ["sessionID"]
  13835. },
  13836. "data": {
  13837. "type": "object",
  13838. "properties": {
  13839. "timestamp": {
  13840. "type": "number"
  13841. },
  13842. "sessionID": {
  13843. "type": "string"
  13844. },
  13845. "id": {
  13846. "type": "string"
  13847. },
  13848. "providerID": {
  13849. "type": "string"
  13850. },
  13851. "variant": {
  13852. "type": "string"
  13853. }
  13854. },
  13855. "required": ["timestamp", "sessionID", "id", "providerID"],
  13856. "additionalProperties": false
  13857. }
  13858. },
  13859. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  13860. "additionalProperties": false
  13861. },
  13862. "SyncEventSessionNextPrompted": {
  13863. "type": "object",
  13864. "properties": {
  13865. "type": {
  13866. "type": "string",
  13867. "enum": ["sync"]
  13868. },
  13869. "name": {
  13870. "type": "string",
  13871. "enum": ["session.next.prompted.1"]
  13872. },
  13873. "id": {
  13874. "type": "string"
  13875. },
  13876. "seq": {
  13877. "type": "number"
  13878. },
  13879. "aggregateID": {
  13880. "type": "string",
  13881. "enum": ["sessionID"]
  13882. },
  13883. "data": {
  13884. "type": "object",
  13885. "properties": {
  13886. "timestamp": {
  13887. "type": "number"
  13888. },
  13889. "sessionID": {
  13890. "type": "string"
  13891. },
  13892. "prompt": {
  13893. "$ref": "#/components/schemas/Prompt"
  13894. }
  13895. },
  13896. "required": ["timestamp", "sessionID", "prompt"],
  13897. "additionalProperties": false
  13898. }
  13899. },
  13900. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  13901. "additionalProperties": false
  13902. },
  13903. "SyncEventSessionNextSynthetic": {
  13904. "type": "object",
  13905. "properties": {
  13906. "type": {
  13907. "type": "string",
  13908. "enum": ["sync"]
  13909. },
  13910. "name": {
  13911. "type": "string",
  13912. "enum": ["session.next.synthetic.1"]
  13913. },
  13914. "id": {
  13915. "type": "string"
  13916. },
  13917. "seq": {
  13918. "type": "number"
  13919. },
  13920. "aggregateID": {
  13921. "type": "string",
  13922. "enum": ["sessionID"]
  13923. },
  13924. "data": {
  13925. "type": "object",
  13926. "properties": {
  13927. "timestamp": {
  13928. "type": "number"
  13929. },
  13930. "sessionID": {
  13931. "type": "string"
  13932. },
  13933. "text": {
  13934. "type": "string"
  13935. }
  13936. },
  13937. "required": ["timestamp", "sessionID", "text"],
  13938. "additionalProperties": false
  13939. }
  13940. },
  13941. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  13942. "additionalProperties": false
  13943. },
  13944. "SyncEventSessionNextShellStarted": {
  13945. "type": "object",
  13946. "properties": {
  13947. "type": {
  13948. "type": "string",
  13949. "enum": ["sync"]
  13950. },
  13951. "name": {
  13952. "type": "string",
  13953. "enum": ["session.next.shell.started.1"]
  13954. },
  13955. "id": {
  13956. "type": "string"
  13957. },
  13958. "seq": {
  13959. "type": "number"
  13960. },
  13961. "aggregateID": {
  13962. "type": "string",
  13963. "enum": ["sessionID"]
  13964. },
  13965. "data": {
  13966. "type": "object",
  13967. "properties": {
  13968. "timestamp": {
  13969. "type": "number"
  13970. },
  13971. "sessionID": {
  13972. "type": "string"
  13973. },
  13974. "callID": {
  13975. "type": "string"
  13976. },
  13977. "command": {
  13978. "type": "string"
  13979. }
  13980. },
  13981. "required": ["timestamp", "sessionID", "callID", "command"],
  13982. "additionalProperties": false
  13983. }
  13984. },
  13985. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  13986. "additionalProperties": false
  13987. },
  13988. "SyncEventSessionNextShellEnded": {
  13989. "type": "object",
  13990. "properties": {
  13991. "type": {
  13992. "type": "string",
  13993. "enum": ["sync"]
  13994. },
  13995. "name": {
  13996. "type": "string",
  13997. "enum": ["session.next.shell.ended.1"]
  13998. },
  13999. "id": {
  14000. "type": "string"
  14001. },
  14002. "seq": {
  14003. "type": "number"
  14004. },
  14005. "aggregateID": {
  14006. "type": "string",
  14007. "enum": ["sessionID"]
  14008. },
  14009. "data": {
  14010. "type": "object",
  14011. "properties": {
  14012. "timestamp": {
  14013. "type": "number"
  14014. },
  14015. "sessionID": {
  14016. "type": "string"
  14017. },
  14018. "callID": {
  14019. "type": "string"
  14020. },
  14021. "output": {
  14022. "type": "string"
  14023. }
  14024. },
  14025. "required": ["timestamp", "sessionID", "callID", "output"],
  14026. "additionalProperties": false
  14027. }
  14028. },
  14029. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14030. "additionalProperties": false
  14031. },
  14032. "SyncEventSessionNextStepStarted": {
  14033. "type": "object",
  14034. "properties": {
  14035. "type": {
  14036. "type": "string",
  14037. "enum": ["sync"]
  14038. },
  14039. "name": {
  14040. "type": "string",
  14041. "enum": ["session.next.step.started.1"]
  14042. },
  14043. "id": {
  14044. "type": "string"
  14045. },
  14046. "seq": {
  14047. "type": "number"
  14048. },
  14049. "aggregateID": {
  14050. "type": "string",
  14051. "enum": ["sessionID"]
  14052. },
  14053. "data": {
  14054. "type": "object",
  14055. "properties": {
  14056. "timestamp": {
  14057. "type": "number"
  14058. },
  14059. "sessionID": {
  14060. "type": "string"
  14061. },
  14062. "agent": {
  14063. "type": "string"
  14064. },
  14065. "model": {
  14066. "type": "object",
  14067. "properties": {
  14068. "id": {
  14069. "type": "string"
  14070. },
  14071. "providerID": {
  14072. "type": "string"
  14073. },
  14074. "variant": {
  14075. "type": "string"
  14076. }
  14077. },
  14078. "required": ["id", "providerID"],
  14079. "additionalProperties": false
  14080. },
  14081. "snapshot": {
  14082. "type": "string"
  14083. }
  14084. },
  14085. "required": ["timestamp", "sessionID", "agent", "model"],
  14086. "additionalProperties": false
  14087. }
  14088. },
  14089. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14090. "additionalProperties": false
  14091. },
  14092. "SyncEventSessionNextStepEnded": {
  14093. "type": "object",
  14094. "properties": {
  14095. "type": {
  14096. "type": "string",
  14097. "enum": ["sync"]
  14098. },
  14099. "name": {
  14100. "type": "string",
  14101. "enum": ["session.next.step.ended.1"]
  14102. },
  14103. "id": {
  14104. "type": "string"
  14105. },
  14106. "seq": {
  14107. "type": "number"
  14108. },
  14109. "aggregateID": {
  14110. "type": "string",
  14111. "enum": ["sessionID"]
  14112. },
  14113. "data": {
  14114. "type": "object",
  14115. "properties": {
  14116. "timestamp": {
  14117. "type": "number"
  14118. },
  14119. "sessionID": {
  14120. "type": "string"
  14121. },
  14122. "finish": {
  14123. "type": "string"
  14124. },
  14125. "cost": {
  14126. "type": "number"
  14127. },
  14128. "tokens": {
  14129. "type": "object",
  14130. "properties": {
  14131. "input": {
  14132. "type": "integer",
  14133. "minimum": 0
  14134. },
  14135. "output": {
  14136. "type": "integer",
  14137. "minimum": 0
  14138. },
  14139. "reasoning": {
  14140. "type": "integer",
  14141. "minimum": 0
  14142. },
  14143. "cache": {
  14144. "type": "object",
  14145. "properties": {
  14146. "read": {
  14147. "type": "integer",
  14148. "minimum": 0
  14149. },
  14150. "write": {
  14151. "type": "integer",
  14152. "minimum": 0
  14153. }
  14154. },
  14155. "required": ["read", "write"],
  14156. "additionalProperties": false
  14157. }
  14158. },
  14159. "required": ["input", "output", "reasoning", "cache"],
  14160. "additionalProperties": false
  14161. },
  14162. "snapshot": {
  14163. "type": "string"
  14164. }
  14165. },
  14166. "required": ["timestamp", "sessionID", "finish", "cost", "tokens"],
  14167. "additionalProperties": false
  14168. }
  14169. },
  14170. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14171. "additionalProperties": false
  14172. },
  14173. "SyncEventSessionNextStepFailed": {
  14174. "type": "object",
  14175. "properties": {
  14176. "type": {
  14177. "type": "string",
  14178. "enum": ["sync"]
  14179. },
  14180. "name": {
  14181. "type": "string",
  14182. "enum": ["session.next.step.failed.1"]
  14183. },
  14184. "id": {
  14185. "type": "string"
  14186. },
  14187. "seq": {
  14188. "type": "number"
  14189. },
  14190. "aggregateID": {
  14191. "type": "string",
  14192. "enum": ["sessionID"]
  14193. },
  14194. "data": {
  14195. "type": "object",
  14196. "properties": {
  14197. "timestamp": {
  14198. "type": "number"
  14199. },
  14200. "sessionID": {
  14201. "type": "string"
  14202. },
  14203. "error": {
  14204. "type": "object",
  14205. "properties": {
  14206. "type": {
  14207. "type": "string"
  14208. },
  14209. "message": {
  14210. "type": "string"
  14211. }
  14212. },
  14213. "required": ["type", "message"],
  14214. "additionalProperties": false
  14215. }
  14216. },
  14217. "required": ["timestamp", "sessionID", "error"],
  14218. "additionalProperties": false
  14219. }
  14220. },
  14221. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14222. "additionalProperties": false
  14223. },
  14224. "SyncEventSessionNextTextStarted": {
  14225. "type": "object",
  14226. "properties": {
  14227. "type": {
  14228. "type": "string",
  14229. "enum": ["sync"]
  14230. },
  14231. "name": {
  14232. "type": "string",
  14233. "enum": ["session.next.text.started.1"]
  14234. },
  14235. "id": {
  14236. "type": "string"
  14237. },
  14238. "seq": {
  14239. "type": "number"
  14240. },
  14241. "aggregateID": {
  14242. "type": "string",
  14243. "enum": ["sessionID"]
  14244. },
  14245. "data": {
  14246. "type": "object",
  14247. "properties": {
  14248. "timestamp": {
  14249. "type": "number"
  14250. },
  14251. "sessionID": {
  14252. "type": "string"
  14253. }
  14254. },
  14255. "required": ["timestamp", "sessionID"],
  14256. "additionalProperties": false
  14257. }
  14258. },
  14259. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14260. "additionalProperties": false
  14261. },
  14262. "SyncEventSessionNextTextDelta": {
  14263. "type": "object",
  14264. "properties": {
  14265. "type": {
  14266. "type": "string",
  14267. "enum": ["sync"]
  14268. },
  14269. "name": {
  14270. "type": "string",
  14271. "enum": ["session.next.text.delta.1"]
  14272. },
  14273. "id": {
  14274. "type": "string"
  14275. },
  14276. "seq": {
  14277. "type": "number"
  14278. },
  14279. "aggregateID": {
  14280. "type": "string",
  14281. "enum": ["sessionID"]
  14282. },
  14283. "data": {
  14284. "type": "object",
  14285. "properties": {
  14286. "timestamp": {
  14287. "type": "number"
  14288. },
  14289. "sessionID": {
  14290. "type": "string"
  14291. },
  14292. "delta": {
  14293. "type": "string"
  14294. }
  14295. },
  14296. "required": ["timestamp", "sessionID", "delta"],
  14297. "additionalProperties": false
  14298. }
  14299. },
  14300. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14301. "additionalProperties": false
  14302. },
  14303. "SyncEventSessionNextTextEnded": {
  14304. "type": "object",
  14305. "properties": {
  14306. "type": {
  14307. "type": "string",
  14308. "enum": ["sync"]
  14309. },
  14310. "name": {
  14311. "type": "string",
  14312. "enum": ["session.next.text.ended.1"]
  14313. },
  14314. "id": {
  14315. "type": "string"
  14316. },
  14317. "seq": {
  14318. "type": "number"
  14319. },
  14320. "aggregateID": {
  14321. "type": "string",
  14322. "enum": ["sessionID"]
  14323. },
  14324. "data": {
  14325. "type": "object",
  14326. "properties": {
  14327. "timestamp": {
  14328. "type": "number"
  14329. },
  14330. "sessionID": {
  14331. "type": "string"
  14332. },
  14333. "text": {
  14334. "type": "string"
  14335. }
  14336. },
  14337. "required": ["timestamp", "sessionID", "text"],
  14338. "additionalProperties": false
  14339. }
  14340. },
  14341. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14342. "additionalProperties": false
  14343. },
  14344. "SyncEventSessionNextReasoningStarted": {
  14345. "type": "object",
  14346. "properties": {
  14347. "type": {
  14348. "type": "string",
  14349. "enum": ["sync"]
  14350. },
  14351. "name": {
  14352. "type": "string",
  14353. "enum": ["session.next.reasoning.started.1"]
  14354. },
  14355. "id": {
  14356. "type": "string"
  14357. },
  14358. "seq": {
  14359. "type": "number"
  14360. },
  14361. "aggregateID": {
  14362. "type": "string",
  14363. "enum": ["sessionID"]
  14364. },
  14365. "data": {
  14366. "type": "object",
  14367. "properties": {
  14368. "timestamp": {
  14369. "type": "number"
  14370. },
  14371. "sessionID": {
  14372. "type": "string"
  14373. },
  14374. "reasoningID": {
  14375. "type": "string"
  14376. }
  14377. },
  14378. "required": ["timestamp", "sessionID", "reasoningID"],
  14379. "additionalProperties": false
  14380. }
  14381. },
  14382. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14383. "additionalProperties": false
  14384. },
  14385. "SyncEventSessionNextReasoningDelta": {
  14386. "type": "object",
  14387. "properties": {
  14388. "type": {
  14389. "type": "string",
  14390. "enum": ["sync"]
  14391. },
  14392. "name": {
  14393. "type": "string",
  14394. "enum": ["session.next.reasoning.delta.1"]
  14395. },
  14396. "id": {
  14397. "type": "string"
  14398. },
  14399. "seq": {
  14400. "type": "number"
  14401. },
  14402. "aggregateID": {
  14403. "type": "string",
  14404. "enum": ["sessionID"]
  14405. },
  14406. "data": {
  14407. "type": "object",
  14408. "properties": {
  14409. "timestamp": {
  14410. "type": "number"
  14411. },
  14412. "sessionID": {
  14413. "type": "string"
  14414. },
  14415. "reasoningID": {
  14416. "type": "string"
  14417. },
  14418. "delta": {
  14419. "type": "string"
  14420. }
  14421. },
  14422. "required": ["timestamp", "sessionID", "reasoningID", "delta"],
  14423. "additionalProperties": false
  14424. }
  14425. },
  14426. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14427. "additionalProperties": false
  14428. },
  14429. "SyncEventSessionNextReasoningEnded": {
  14430. "type": "object",
  14431. "properties": {
  14432. "type": {
  14433. "type": "string",
  14434. "enum": ["sync"]
  14435. },
  14436. "name": {
  14437. "type": "string",
  14438. "enum": ["session.next.reasoning.ended.1"]
  14439. },
  14440. "id": {
  14441. "type": "string"
  14442. },
  14443. "seq": {
  14444. "type": "number"
  14445. },
  14446. "aggregateID": {
  14447. "type": "string",
  14448. "enum": ["sessionID"]
  14449. },
  14450. "data": {
  14451. "type": "object",
  14452. "properties": {
  14453. "timestamp": {
  14454. "type": "number"
  14455. },
  14456. "sessionID": {
  14457. "type": "string"
  14458. },
  14459. "reasoningID": {
  14460. "type": "string"
  14461. },
  14462. "text": {
  14463. "type": "string"
  14464. }
  14465. },
  14466. "required": ["timestamp", "sessionID", "reasoningID", "text"],
  14467. "additionalProperties": false
  14468. }
  14469. },
  14470. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14471. "additionalProperties": false
  14472. },
  14473. "SyncEventSessionNextToolInputStarted": {
  14474. "type": "object",
  14475. "properties": {
  14476. "type": {
  14477. "type": "string",
  14478. "enum": ["sync"]
  14479. },
  14480. "name": {
  14481. "type": "string",
  14482. "enum": ["session.next.tool.input.started.1"]
  14483. },
  14484. "id": {
  14485. "type": "string"
  14486. },
  14487. "seq": {
  14488. "type": "number"
  14489. },
  14490. "aggregateID": {
  14491. "type": "string",
  14492. "enum": ["sessionID"]
  14493. },
  14494. "data": {
  14495. "type": "object",
  14496. "properties": {
  14497. "timestamp": {
  14498. "type": "number"
  14499. },
  14500. "sessionID": {
  14501. "type": "string"
  14502. },
  14503. "callID": {
  14504. "type": "string"
  14505. },
  14506. "name": {
  14507. "type": "string"
  14508. }
  14509. },
  14510. "required": ["timestamp", "sessionID", "callID", "name"],
  14511. "additionalProperties": false
  14512. }
  14513. },
  14514. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14515. "additionalProperties": false
  14516. },
  14517. "SyncEventSessionNextToolInputDelta": {
  14518. "type": "object",
  14519. "properties": {
  14520. "type": {
  14521. "type": "string",
  14522. "enum": ["sync"]
  14523. },
  14524. "name": {
  14525. "type": "string",
  14526. "enum": ["session.next.tool.input.delta.1"]
  14527. },
  14528. "id": {
  14529. "type": "string"
  14530. },
  14531. "seq": {
  14532. "type": "number"
  14533. },
  14534. "aggregateID": {
  14535. "type": "string",
  14536. "enum": ["sessionID"]
  14537. },
  14538. "data": {
  14539. "type": "object",
  14540. "properties": {
  14541. "timestamp": {
  14542. "type": "number"
  14543. },
  14544. "sessionID": {
  14545. "type": "string"
  14546. },
  14547. "callID": {
  14548. "type": "string"
  14549. },
  14550. "delta": {
  14551. "type": "string"
  14552. }
  14553. },
  14554. "required": ["timestamp", "sessionID", "callID", "delta"],
  14555. "additionalProperties": false
  14556. }
  14557. },
  14558. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14559. "additionalProperties": false
  14560. },
  14561. "SyncEventSessionNextToolInputEnded": {
  14562. "type": "object",
  14563. "properties": {
  14564. "type": {
  14565. "type": "string",
  14566. "enum": ["sync"]
  14567. },
  14568. "name": {
  14569. "type": "string",
  14570. "enum": ["session.next.tool.input.ended.1"]
  14571. },
  14572. "id": {
  14573. "type": "string"
  14574. },
  14575. "seq": {
  14576. "type": "number"
  14577. },
  14578. "aggregateID": {
  14579. "type": "string",
  14580. "enum": ["sessionID"]
  14581. },
  14582. "data": {
  14583. "type": "object",
  14584. "properties": {
  14585. "timestamp": {
  14586. "type": "number"
  14587. },
  14588. "sessionID": {
  14589. "type": "string"
  14590. },
  14591. "callID": {
  14592. "type": "string"
  14593. },
  14594. "text": {
  14595. "type": "string"
  14596. }
  14597. },
  14598. "required": ["timestamp", "sessionID", "callID", "text"],
  14599. "additionalProperties": false
  14600. }
  14601. },
  14602. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14603. "additionalProperties": false
  14604. },
  14605. "SyncEventSessionNextToolCalled": {
  14606. "type": "object",
  14607. "properties": {
  14608. "type": {
  14609. "type": "string",
  14610. "enum": ["sync"]
  14611. },
  14612. "name": {
  14613. "type": "string",
  14614. "enum": ["session.next.tool.called.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. "tool": {
  14639. "type": "string"
  14640. },
  14641. "input": {
  14642. "type": "object"
  14643. },
  14644. "provider": {
  14645. "type": "object",
  14646. "properties": {
  14647. "executed": {
  14648. "type": "boolean"
  14649. },
  14650. "metadata": {
  14651. "type": "object"
  14652. }
  14653. },
  14654. "required": ["executed"],
  14655. "additionalProperties": false
  14656. }
  14657. },
  14658. "required": ["timestamp", "sessionID", "callID", "tool", "input", "provider"],
  14659. "additionalProperties": false
  14660. }
  14661. },
  14662. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14663. "additionalProperties": false
  14664. },
  14665. "SyncEventSessionNextToolProgress": {
  14666. "type": "object",
  14667. "properties": {
  14668. "type": {
  14669. "type": "string",
  14670. "enum": ["sync"]
  14671. },
  14672. "name": {
  14673. "type": "string",
  14674. "enum": ["session.next.tool.progress.1"]
  14675. },
  14676. "id": {
  14677. "type": "string"
  14678. },
  14679. "seq": {
  14680. "type": "number"
  14681. },
  14682. "aggregateID": {
  14683. "type": "string",
  14684. "enum": ["sessionID"]
  14685. },
  14686. "data": {
  14687. "type": "object",
  14688. "properties": {
  14689. "timestamp": {
  14690. "type": "number"
  14691. },
  14692. "sessionID": {
  14693. "type": "string"
  14694. },
  14695. "callID": {
  14696. "type": "string"
  14697. },
  14698. "structured": {
  14699. "type": "object"
  14700. },
  14701. "content": {
  14702. "type": "array",
  14703. "items": {
  14704. "anyOf": [
  14705. {
  14706. "$ref": "#/components/schemas/ToolTextContent"
  14707. },
  14708. {
  14709. "$ref": "#/components/schemas/ToolFileContent"
  14710. }
  14711. ]
  14712. }
  14713. }
  14714. },
  14715. "required": ["timestamp", "sessionID", "callID", "structured", "content"],
  14716. "additionalProperties": false
  14717. }
  14718. },
  14719. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14720. "additionalProperties": false
  14721. },
  14722. "SyncEventSessionNextToolSuccess": {
  14723. "type": "object",
  14724. "properties": {
  14725. "type": {
  14726. "type": "string",
  14727. "enum": ["sync"]
  14728. },
  14729. "name": {
  14730. "type": "string",
  14731. "enum": ["session.next.tool.success.1"]
  14732. },
  14733. "id": {
  14734. "type": "string"
  14735. },
  14736. "seq": {
  14737. "type": "number"
  14738. },
  14739. "aggregateID": {
  14740. "type": "string",
  14741. "enum": ["sessionID"]
  14742. },
  14743. "data": {
  14744. "type": "object",
  14745. "properties": {
  14746. "timestamp": {
  14747. "type": "number"
  14748. },
  14749. "sessionID": {
  14750. "type": "string"
  14751. },
  14752. "callID": {
  14753. "type": "string"
  14754. },
  14755. "structured": {
  14756. "type": "object"
  14757. },
  14758. "content": {
  14759. "type": "array",
  14760. "items": {
  14761. "anyOf": [
  14762. {
  14763. "$ref": "#/components/schemas/ToolTextContent"
  14764. },
  14765. {
  14766. "$ref": "#/components/schemas/ToolFileContent"
  14767. }
  14768. ]
  14769. }
  14770. },
  14771. "provider": {
  14772. "type": "object",
  14773. "properties": {
  14774. "executed": {
  14775. "type": "boolean"
  14776. },
  14777. "metadata": {
  14778. "type": "object"
  14779. }
  14780. },
  14781. "required": ["executed"],
  14782. "additionalProperties": false
  14783. }
  14784. },
  14785. "required": ["timestamp", "sessionID", "callID", "structured", "content", "provider"],
  14786. "additionalProperties": false
  14787. }
  14788. },
  14789. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14790. "additionalProperties": false
  14791. },
  14792. "SyncEventSessionNextToolFailed": {
  14793. "type": "object",
  14794. "properties": {
  14795. "type": {
  14796. "type": "string",
  14797. "enum": ["sync"]
  14798. },
  14799. "name": {
  14800. "type": "string",
  14801. "enum": ["session.next.tool.failed.1"]
  14802. },
  14803. "id": {
  14804. "type": "string"
  14805. },
  14806. "seq": {
  14807. "type": "number"
  14808. },
  14809. "aggregateID": {
  14810. "type": "string",
  14811. "enum": ["sessionID"]
  14812. },
  14813. "data": {
  14814. "type": "object",
  14815. "properties": {
  14816. "timestamp": {
  14817. "type": "number"
  14818. },
  14819. "sessionID": {
  14820. "type": "string"
  14821. },
  14822. "callID": {
  14823. "type": "string"
  14824. },
  14825. "error": {
  14826. "type": "object",
  14827. "properties": {
  14828. "type": {
  14829. "type": "string"
  14830. },
  14831. "message": {
  14832. "type": "string"
  14833. }
  14834. },
  14835. "required": ["type", "message"],
  14836. "additionalProperties": false
  14837. },
  14838. "provider": {
  14839. "type": "object",
  14840. "properties": {
  14841. "executed": {
  14842. "type": "boolean"
  14843. },
  14844. "metadata": {
  14845. "type": "object"
  14846. }
  14847. },
  14848. "required": ["executed"],
  14849. "additionalProperties": false
  14850. }
  14851. },
  14852. "required": ["timestamp", "sessionID", "callID", "error", "provider"],
  14853. "additionalProperties": false
  14854. }
  14855. },
  14856. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14857. "additionalProperties": false
  14858. },
  14859. "SyncEventSessionNextRetried": {
  14860. "type": "object",
  14861. "properties": {
  14862. "type": {
  14863. "type": "string",
  14864. "enum": ["sync"]
  14865. },
  14866. "name": {
  14867. "type": "string",
  14868. "enum": ["session.next.retried.1"]
  14869. },
  14870. "id": {
  14871. "type": "string"
  14872. },
  14873. "seq": {
  14874. "type": "number"
  14875. },
  14876. "aggregateID": {
  14877. "type": "string",
  14878. "enum": ["sessionID"]
  14879. },
  14880. "data": {
  14881. "type": "object",
  14882. "properties": {
  14883. "timestamp": {
  14884. "type": "number"
  14885. },
  14886. "sessionID": {
  14887. "type": "string"
  14888. },
  14889. "attempt": {
  14890. "type": "integer",
  14891. "minimum": 0
  14892. },
  14893. "error": {
  14894. "$ref": "#/components/schemas/SessionNextRetry_error"
  14895. }
  14896. },
  14897. "required": ["timestamp", "sessionID", "attempt", "error"],
  14898. "additionalProperties": false
  14899. }
  14900. },
  14901. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14902. "additionalProperties": false
  14903. },
  14904. "SyncEventSessionNextCompactionStarted": {
  14905. "type": "object",
  14906. "properties": {
  14907. "type": {
  14908. "type": "string",
  14909. "enum": ["sync"]
  14910. },
  14911. "name": {
  14912. "type": "string",
  14913. "enum": ["session.next.compaction.started.1"]
  14914. },
  14915. "id": {
  14916. "type": "string"
  14917. },
  14918. "seq": {
  14919. "type": "number"
  14920. },
  14921. "aggregateID": {
  14922. "type": "string",
  14923. "enum": ["sessionID"]
  14924. },
  14925. "data": {
  14926. "type": "object",
  14927. "properties": {
  14928. "timestamp": {
  14929. "type": "number"
  14930. },
  14931. "sessionID": {
  14932. "type": "string"
  14933. },
  14934. "reason": {
  14935. "type": "string",
  14936. "enum": ["auto", "manual"]
  14937. }
  14938. },
  14939. "required": ["timestamp", "sessionID", "reason"],
  14940. "additionalProperties": false
  14941. }
  14942. },
  14943. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14944. "additionalProperties": false
  14945. },
  14946. "SyncEventSessionNextCompactionDelta": {
  14947. "type": "object",
  14948. "properties": {
  14949. "type": {
  14950. "type": "string",
  14951. "enum": ["sync"]
  14952. },
  14953. "name": {
  14954. "type": "string",
  14955. "enum": ["session.next.compaction.delta.1"]
  14956. },
  14957. "id": {
  14958. "type": "string"
  14959. },
  14960. "seq": {
  14961. "type": "number"
  14962. },
  14963. "aggregateID": {
  14964. "type": "string",
  14965. "enum": ["sessionID"]
  14966. },
  14967. "data": {
  14968. "type": "object",
  14969. "properties": {
  14970. "timestamp": {
  14971. "type": "number"
  14972. },
  14973. "sessionID": {
  14974. "type": "string"
  14975. },
  14976. "text": {
  14977. "type": "string"
  14978. }
  14979. },
  14980. "required": ["timestamp", "sessionID", "text"],
  14981. "additionalProperties": false
  14982. }
  14983. },
  14984. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14985. "additionalProperties": false
  14986. },
  14987. "SyncEventSessionNextCompactionEnded": {
  14988. "type": "object",
  14989. "properties": {
  14990. "type": {
  14991. "type": "string",
  14992. "enum": ["sync"]
  14993. },
  14994. "name": {
  14995. "type": "string",
  14996. "enum": ["session.next.compaction.ended.1"]
  14997. },
  14998. "id": {
  14999. "type": "string"
  15000. },
  15001. "seq": {
  15002. "type": "number"
  15003. },
  15004. "aggregateID": {
  15005. "type": "string",
  15006. "enum": ["sessionID"]
  15007. },
  15008. "data": {
  15009. "type": "object",
  15010. "properties": {
  15011. "timestamp": {
  15012. "type": "number"
  15013. },
  15014. "sessionID": {
  15015. "type": "string"
  15016. },
  15017. "text": {
  15018. "type": "string"
  15019. },
  15020. "include": {
  15021. "type": "string"
  15022. }
  15023. },
  15024. "required": ["timestamp", "sessionID", "text"],
  15025. "additionalProperties": false
  15026. }
  15027. },
  15028. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15029. "additionalProperties": false
  15030. },
  15031. "EventServerInstanceDisposed": {
  15032. "type": "object",
  15033. "properties": {
  15034. "id": {
  15035. "type": "string"
  15036. },
  15037. "type": {
  15038. "type": "string",
  15039. "enum": ["server.instance.disposed"]
  15040. },
  15041. "properties": {
  15042. "type": "object",
  15043. "properties": {
  15044. "directory": {
  15045. "type": "string"
  15046. }
  15047. },
  15048. "required": ["directory"],
  15049. "additionalProperties": false
  15050. }
  15051. },
  15052. "required": ["id", "type", "properties"],
  15053. "additionalProperties": false
  15054. },
  15055. "EventFileEdited": {
  15056. "type": "object",
  15057. "properties": {
  15058. "id": {
  15059. "type": "string"
  15060. },
  15061. "type": {
  15062. "type": "string",
  15063. "enum": ["file.edited"]
  15064. },
  15065. "properties": {
  15066. "type": "object",
  15067. "properties": {
  15068. "file": {
  15069. "type": "string"
  15070. }
  15071. },
  15072. "required": ["file"],
  15073. "additionalProperties": false
  15074. }
  15075. },
  15076. "required": ["id", "type", "properties"],
  15077. "additionalProperties": false
  15078. },
  15079. "EventFileWatcherUpdated": {
  15080. "type": "object",
  15081. "properties": {
  15082. "id": {
  15083. "type": "string"
  15084. },
  15085. "type": {
  15086. "type": "string",
  15087. "enum": ["file.watcher.updated"]
  15088. },
  15089. "properties": {
  15090. "type": "object",
  15091. "properties": {
  15092. "file": {
  15093. "type": "string"
  15094. },
  15095. "event": {
  15096. "type": "string",
  15097. "enum": ["add", "change", "unlink"]
  15098. }
  15099. },
  15100. "required": ["file", "event"],
  15101. "additionalProperties": false
  15102. }
  15103. },
  15104. "required": ["id", "type", "properties"],
  15105. "additionalProperties": false
  15106. },
  15107. "EventLspClientDiagnostics": {
  15108. "type": "object",
  15109. "properties": {
  15110. "id": {
  15111. "type": "string"
  15112. },
  15113. "type": {
  15114. "type": "string",
  15115. "enum": ["lsp.client.diagnostics"]
  15116. },
  15117. "properties": {
  15118. "type": "object",
  15119. "properties": {
  15120. "serverID": {
  15121. "type": "string"
  15122. },
  15123. "path": {
  15124. "type": "string"
  15125. }
  15126. },
  15127. "required": ["serverID", "path"],
  15128. "additionalProperties": false
  15129. }
  15130. },
  15131. "required": ["id", "type", "properties"],
  15132. "additionalProperties": false
  15133. },
  15134. "EventLspUpdated": {
  15135. "type": "object",
  15136. "properties": {
  15137. "id": {
  15138. "type": "string"
  15139. },
  15140. "type": {
  15141. "type": "string",
  15142. "enum": ["lsp.updated"]
  15143. },
  15144. "properties": {
  15145. "type": "object",
  15146. "properties": {}
  15147. }
  15148. },
  15149. "required": ["id", "type", "properties"],
  15150. "additionalProperties": false
  15151. },
  15152. "EventMessagePartDelta": {
  15153. "type": "object",
  15154. "properties": {
  15155. "id": {
  15156. "type": "string"
  15157. },
  15158. "type": {
  15159. "type": "string",
  15160. "enum": ["message.part.delta"]
  15161. },
  15162. "properties": {
  15163. "type": "object",
  15164. "properties": {
  15165. "sessionID": {
  15166. "type": "string"
  15167. },
  15168. "messageID": {
  15169. "type": "string"
  15170. },
  15171. "partID": {
  15172. "type": "string"
  15173. },
  15174. "field": {
  15175. "type": "string"
  15176. },
  15177. "delta": {
  15178. "type": "string"
  15179. }
  15180. },
  15181. "required": ["sessionID", "messageID", "partID", "field", "delta"],
  15182. "additionalProperties": false
  15183. }
  15184. },
  15185. "required": ["id", "type", "properties"],
  15186. "additionalProperties": false
  15187. },
  15188. "EventPermissionAsked": {
  15189. "type": "object",
  15190. "properties": {
  15191. "id": {
  15192. "type": "string"
  15193. },
  15194. "type": {
  15195. "type": "string",
  15196. "enum": ["permission.asked"]
  15197. },
  15198. "properties": {
  15199. "$ref": "#/components/schemas/PermissionRequest"
  15200. }
  15201. },
  15202. "required": ["id", "type", "properties"],
  15203. "additionalProperties": false
  15204. },
  15205. "EventPermissionReplied": {
  15206. "type": "object",
  15207. "properties": {
  15208. "id": {
  15209. "type": "string"
  15210. },
  15211. "type": {
  15212. "type": "string",
  15213. "enum": ["permission.replied"]
  15214. },
  15215. "properties": {
  15216. "type": "object",
  15217. "properties": {
  15218. "sessionID": {
  15219. "type": "string"
  15220. },
  15221. "requestID": {
  15222. "type": "string"
  15223. },
  15224. "reply": {
  15225. "type": "string",
  15226. "enum": ["once", "always", "reject"]
  15227. }
  15228. },
  15229. "required": ["sessionID", "requestID", "reply"],
  15230. "additionalProperties": false
  15231. }
  15232. },
  15233. "required": ["id", "type", "properties"],
  15234. "additionalProperties": false
  15235. },
  15236. "EventSessionDiff": {
  15237. "type": "object",
  15238. "properties": {
  15239. "id": {
  15240. "type": "string"
  15241. },
  15242. "type": {
  15243. "type": "string",
  15244. "enum": ["session.diff"]
  15245. },
  15246. "properties": {
  15247. "type": "object",
  15248. "properties": {
  15249. "sessionID": {
  15250. "type": "string"
  15251. },
  15252. "diff": {
  15253. "type": "array",
  15254. "items": {
  15255. "$ref": "#/components/schemas/SnapshotFileDiff"
  15256. }
  15257. }
  15258. },
  15259. "required": ["sessionID", "diff"],
  15260. "additionalProperties": false
  15261. }
  15262. },
  15263. "required": ["id", "type", "properties"],
  15264. "additionalProperties": false
  15265. },
  15266. "EventSessionError": {
  15267. "type": "object",
  15268. "properties": {
  15269. "id": {
  15270. "type": "string"
  15271. },
  15272. "type": {
  15273. "type": "string",
  15274. "enum": ["session.error"]
  15275. },
  15276. "properties": {
  15277. "type": "object",
  15278. "properties": {
  15279. "sessionID": {
  15280. "type": "string"
  15281. },
  15282. "error": {
  15283. "anyOf": [
  15284. {
  15285. "$ref": "#/components/schemas/ProviderAuthError"
  15286. },
  15287. {
  15288. "$ref": "#/components/schemas/UnknownError"
  15289. },
  15290. {
  15291. "$ref": "#/components/schemas/MessageOutputLengthError"
  15292. },
  15293. {
  15294. "$ref": "#/components/schemas/MessageAbortedError"
  15295. },
  15296. {
  15297. "$ref": "#/components/schemas/StructuredOutputError"
  15298. },
  15299. {
  15300. "$ref": "#/components/schemas/ContextOverflowError"
  15301. },
  15302. {
  15303. "$ref": "#/components/schemas/APIError"
  15304. }
  15305. ]
  15306. }
  15307. },
  15308. "additionalProperties": false
  15309. }
  15310. },
  15311. "required": ["id", "type", "properties"],
  15312. "additionalProperties": false
  15313. },
  15314. "EventInstallationUpdated": {
  15315. "type": "object",
  15316. "properties": {
  15317. "id": {
  15318. "type": "string"
  15319. },
  15320. "type": {
  15321. "type": "string",
  15322. "enum": ["installation.updated"]
  15323. },
  15324. "properties": {
  15325. "type": "object",
  15326. "properties": {
  15327. "version": {
  15328. "type": "string"
  15329. }
  15330. },
  15331. "required": ["version"],
  15332. "additionalProperties": false
  15333. }
  15334. },
  15335. "required": ["id", "type", "properties"],
  15336. "additionalProperties": false
  15337. },
  15338. "EventInstallationUpdate-available": {
  15339. "type": "object",
  15340. "properties": {
  15341. "id": {
  15342. "type": "string"
  15343. },
  15344. "type": {
  15345. "type": "string",
  15346. "enum": ["installation.update-available"]
  15347. },
  15348. "properties": {
  15349. "type": "object",
  15350. "properties": {
  15351. "version": {
  15352. "type": "string"
  15353. }
  15354. },
  15355. "required": ["version"],
  15356. "additionalProperties": false
  15357. }
  15358. },
  15359. "required": ["id", "type", "properties"],
  15360. "additionalProperties": false
  15361. },
  15362. "EventQuestionAsked": {
  15363. "type": "object",
  15364. "properties": {
  15365. "id": {
  15366. "type": "string"
  15367. },
  15368. "type": {
  15369. "type": "string",
  15370. "enum": ["question.asked"]
  15371. },
  15372. "properties": {
  15373. "$ref": "#/components/schemas/QuestionRequest"
  15374. }
  15375. },
  15376. "required": ["id", "type", "properties"],
  15377. "additionalProperties": false
  15378. },
  15379. "EventQuestionReplied": {
  15380. "type": "object",
  15381. "properties": {
  15382. "id": {
  15383. "type": "string"
  15384. },
  15385. "type": {
  15386. "type": "string",
  15387. "enum": ["question.replied"]
  15388. },
  15389. "properties": {
  15390. "$ref": "#/components/schemas/QuestionReplied"
  15391. }
  15392. },
  15393. "required": ["id", "type", "properties"],
  15394. "additionalProperties": false
  15395. },
  15396. "EventQuestionRejected": {
  15397. "type": "object",
  15398. "properties": {
  15399. "id": {
  15400. "type": "string"
  15401. },
  15402. "type": {
  15403. "type": "string",
  15404. "enum": ["question.rejected"]
  15405. },
  15406. "properties": {
  15407. "$ref": "#/components/schemas/QuestionRejected"
  15408. }
  15409. },
  15410. "required": ["id", "type", "properties"],
  15411. "additionalProperties": false
  15412. },
  15413. "EventTodoUpdated": {
  15414. "type": "object",
  15415. "properties": {
  15416. "id": {
  15417. "type": "string"
  15418. },
  15419. "type": {
  15420. "type": "string",
  15421. "enum": ["todo.updated"]
  15422. },
  15423. "properties": {
  15424. "type": "object",
  15425. "properties": {
  15426. "sessionID": {
  15427. "type": "string"
  15428. },
  15429. "todos": {
  15430. "type": "array",
  15431. "items": {
  15432. "$ref": "#/components/schemas/Todo"
  15433. }
  15434. }
  15435. },
  15436. "required": ["sessionID", "todos"],
  15437. "additionalProperties": false
  15438. }
  15439. },
  15440. "required": ["id", "type", "properties"],
  15441. "additionalProperties": false
  15442. },
  15443. "EventSessionStatus": {
  15444. "type": "object",
  15445. "properties": {
  15446. "id": {
  15447. "type": "string"
  15448. },
  15449. "type": {
  15450. "type": "string",
  15451. "enum": ["session.status"]
  15452. },
  15453. "properties": {
  15454. "type": "object",
  15455. "properties": {
  15456. "sessionID": {
  15457. "type": "string"
  15458. },
  15459. "status": {
  15460. "$ref": "#/components/schemas/SessionStatus"
  15461. }
  15462. },
  15463. "required": ["sessionID", "status"],
  15464. "additionalProperties": false
  15465. }
  15466. },
  15467. "required": ["id", "type", "properties"],
  15468. "additionalProperties": false
  15469. },
  15470. "EventSessionIdle": {
  15471. "type": "object",
  15472. "properties": {
  15473. "id": {
  15474. "type": "string"
  15475. },
  15476. "type": {
  15477. "type": "string",
  15478. "enum": ["session.idle"]
  15479. },
  15480. "properties": {
  15481. "type": "object",
  15482. "properties": {
  15483. "sessionID": {
  15484. "type": "string"
  15485. }
  15486. },
  15487. "required": ["sessionID"],
  15488. "additionalProperties": false
  15489. }
  15490. },
  15491. "required": ["id", "type", "properties"],
  15492. "additionalProperties": false
  15493. },
  15494. "EventSessionCompacted": {
  15495. "type": "object",
  15496. "properties": {
  15497. "id": {
  15498. "type": "string"
  15499. },
  15500. "type": {
  15501. "type": "string",
  15502. "enum": ["session.compacted"]
  15503. },
  15504. "properties": {
  15505. "type": "object",
  15506. "properties": {
  15507. "sessionID": {
  15508. "type": "string"
  15509. }
  15510. },
  15511. "required": ["sessionID"],
  15512. "additionalProperties": false
  15513. }
  15514. },
  15515. "required": ["id", "type", "properties"],
  15516. "additionalProperties": false
  15517. },
  15518. "EventMcpToolsChanged": {
  15519. "type": "object",
  15520. "properties": {
  15521. "id": {
  15522. "type": "string"
  15523. },
  15524. "type": {
  15525. "type": "string",
  15526. "enum": ["mcp.tools.changed"]
  15527. },
  15528. "properties": {
  15529. "type": "object",
  15530. "properties": {
  15531. "server": {
  15532. "type": "string"
  15533. }
  15534. },
  15535. "required": ["server"],
  15536. "additionalProperties": false
  15537. }
  15538. },
  15539. "required": ["id", "type", "properties"],
  15540. "additionalProperties": false
  15541. },
  15542. "EventMcpBrowserOpenFailed": {
  15543. "type": "object",
  15544. "properties": {
  15545. "id": {
  15546. "type": "string"
  15547. },
  15548. "type": {
  15549. "type": "string",
  15550. "enum": ["mcp.browser.open.failed"]
  15551. },
  15552. "properties": {
  15553. "type": "object",
  15554. "properties": {
  15555. "mcpName": {
  15556. "type": "string"
  15557. },
  15558. "url": {
  15559. "type": "string"
  15560. }
  15561. },
  15562. "required": ["mcpName", "url"],
  15563. "additionalProperties": false
  15564. }
  15565. },
  15566. "required": ["id", "type", "properties"],
  15567. "additionalProperties": false
  15568. },
  15569. "EventCommandExecuted": {
  15570. "type": "object",
  15571. "properties": {
  15572. "id": {
  15573. "type": "string"
  15574. },
  15575. "type": {
  15576. "type": "string",
  15577. "enum": ["command.executed"]
  15578. },
  15579. "properties": {
  15580. "type": "object",
  15581. "properties": {
  15582. "name": {
  15583. "type": "string"
  15584. },
  15585. "sessionID": {
  15586. "type": "string"
  15587. },
  15588. "arguments": {
  15589. "type": "string"
  15590. },
  15591. "messageID": {
  15592. "type": "string"
  15593. }
  15594. },
  15595. "required": ["name", "sessionID", "arguments", "messageID"],
  15596. "additionalProperties": false
  15597. }
  15598. },
  15599. "required": ["id", "type", "properties"],
  15600. "additionalProperties": false
  15601. },
  15602. "EventProjectUpdated": {
  15603. "type": "object",
  15604. "properties": {
  15605. "id": {
  15606. "type": "string"
  15607. },
  15608. "type": {
  15609. "type": "string",
  15610. "enum": ["project.updated"]
  15611. },
  15612. "properties": {
  15613. "$ref": "#/components/schemas/Project"
  15614. }
  15615. },
  15616. "required": ["id", "type", "properties"],
  15617. "additionalProperties": false
  15618. },
  15619. "EventVcsBranchUpdated": {
  15620. "type": "object",
  15621. "properties": {
  15622. "id": {
  15623. "type": "string"
  15624. },
  15625. "type": {
  15626. "type": "string",
  15627. "enum": ["vcs.branch.updated"]
  15628. },
  15629. "properties": {
  15630. "type": "object",
  15631. "properties": {
  15632. "branch": {
  15633. "type": "string"
  15634. }
  15635. },
  15636. "additionalProperties": false
  15637. }
  15638. },
  15639. "required": ["id", "type", "properties"],
  15640. "additionalProperties": false
  15641. },
  15642. "EventWorkspaceReady": {
  15643. "type": "object",
  15644. "properties": {
  15645. "id": {
  15646. "type": "string"
  15647. },
  15648. "type": {
  15649. "type": "string",
  15650. "enum": ["workspace.ready"]
  15651. },
  15652. "properties": {
  15653. "type": "object",
  15654. "properties": {
  15655. "name": {
  15656. "type": "string"
  15657. }
  15658. },
  15659. "required": ["name"],
  15660. "additionalProperties": false
  15661. }
  15662. },
  15663. "required": ["id", "type", "properties"],
  15664. "additionalProperties": false
  15665. },
  15666. "EventWorkspaceFailed": {
  15667. "type": "object",
  15668. "properties": {
  15669. "id": {
  15670. "type": "string"
  15671. },
  15672. "type": {
  15673. "type": "string",
  15674. "enum": ["workspace.failed"]
  15675. },
  15676. "properties": {
  15677. "type": "object",
  15678. "properties": {
  15679. "message": {
  15680. "type": "string"
  15681. }
  15682. },
  15683. "required": ["message"],
  15684. "additionalProperties": false
  15685. }
  15686. },
  15687. "required": ["id", "type", "properties"],
  15688. "additionalProperties": false
  15689. },
  15690. "EventWorkspaceRestore": {
  15691. "type": "object",
  15692. "properties": {
  15693. "id": {
  15694. "type": "string"
  15695. },
  15696. "type": {
  15697. "type": "string",
  15698. "enum": ["workspace.restore"]
  15699. },
  15700. "properties": {
  15701. "type": "object",
  15702. "properties": {
  15703. "workspaceID": {
  15704. "type": "string"
  15705. },
  15706. "sessionID": {
  15707. "type": "string"
  15708. },
  15709. "total": {
  15710. "type": "integer",
  15711. "minimum": 0
  15712. },
  15713. "step": {
  15714. "type": "integer",
  15715. "minimum": 0
  15716. }
  15717. },
  15718. "required": ["workspaceID", "sessionID", "total", "step"],
  15719. "additionalProperties": false
  15720. }
  15721. },
  15722. "required": ["id", "type", "properties"],
  15723. "additionalProperties": false
  15724. },
  15725. "EventWorkspaceStatus": {
  15726. "type": "object",
  15727. "properties": {
  15728. "id": {
  15729. "type": "string"
  15730. },
  15731. "type": {
  15732. "type": "string",
  15733. "enum": ["workspace.status"]
  15734. },
  15735. "properties": {
  15736. "type": "object",
  15737. "properties": {
  15738. "workspaceID": {
  15739. "type": "string"
  15740. },
  15741. "status": {
  15742. "type": "string",
  15743. "enum": ["connected", "connecting", "disconnected", "error"]
  15744. }
  15745. },
  15746. "required": ["workspaceID", "status"],
  15747. "additionalProperties": false
  15748. }
  15749. },
  15750. "required": ["id", "type", "properties"],
  15751. "additionalProperties": false
  15752. },
  15753. "EventWorktreeReady": {
  15754. "type": "object",
  15755. "properties": {
  15756. "id": {
  15757. "type": "string"
  15758. },
  15759. "type": {
  15760. "type": "string",
  15761. "enum": ["worktree.ready"]
  15762. },
  15763. "properties": {
  15764. "type": "object",
  15765. "properties": {
  15766. "name": {
  15767. "type": "string"
  15768. },
  15769. "branch": {
  15770. "type": "string"
  15771. }
  15772. },
  15773. "required": ["name", "branch"],
  15774. "additionalProperties": false
  15775. }
  15776. },
  15777. "required": ["id", "type", "properties"],
  15778. "additionalProperties": false
  15779. },
  15780. "EventWorktreeFailed": {
  15781. "type": "object",
  15782. "properties": {
  15783. "id": {
  15784. "type": "string"
  15785. },
  15786. "type": {
  15787. "type": "string",
  15788. "enum": ["worktree.failed"]
  15789. },
  15790. "properties": {
  15791. "type": "object",
  15792. "properties": {
  15793. "message": {
  15794. "type": "string"
  15795. }
  15796. },
  15797. "required": ["message"],
  15798. "additionalProperties": false
  15799. }
  15800. },
  15801. "required": ["id", "type", "properties"],
  15802. "additionalProperties": false
  15803. },
  15804. "EventPtyCreated": {
  15805. "type": "object",
  15806. "properties": {
  15807. "id": {
  15808. "type": "string"
  15809. },
  15810. "type": {
  15811. "type": "string",
  15812. "enum": ["pty.created"]
  15813. },
  15814. "properties": {
  15815. "type": "object",
  15816. "properties": {
  15817. "info": {
  15818. "$ref": "#/components/schemas/Pty"
  15819. }
  15820. },
  15821. "required": ["info"],
  15822. "additionalProperties": false
  15823. }
  15824. },
  15825. "required": ["id", "type", "properties"],
  15826. "additionalProperties": false
  15827. },
  15828. "EventPtyUpdated": {
  15829. "type": "object",
  15830. "properties": {
  15831. "id": {
  15832. "type": "string"
  15833. },
  15834. "type": {
  15835. "type": "string",
  15836. "enum": ["pty.updated"]
  15837. },
  15838. "properties": {
  15839. "type": "object",
  15840. "properties": {
  15841. "info": {
  15842. "$ref": "#/components/schemas/Pty"
  15843. }
  15844. },
  15845. "required": ["info"],
  15846. "additionalProperties": false
  15847. }
  15848. },
  15849. "required": ["id", "type", "properties"],
  15850. "additionalProperties": false
  15851. },
  15852. "EventPtyExited": {
  15853. "type": "object",
  15854. "properties": {
  15855. "id": {
  15856. "type": "string"
  15857. },
  15858. "type": {
  15859. "type": "string",
  15860. "enum": ["pty.exited"]
  15861. },
  15862. "properties": {
  15863. "type": "object",
  15864. "properties": {
  15865. "id": {
  15866. "type": "string"
  15867. },
  15868. "exitCode": {
  15869. "type": "integer",
  15870. "minimum": 0
  15871. }
  15872. },
  15873. "required": ["id", "exitCode"],
  15874. "additionalProperties": false
  15875. }
  15876. },
  15877. "required": ["id", "type", "properties"],
  15878. "additionalProperties": false
  15879. },
  15880. "EventPtyDeleted": {
  15881. "type": "object",
  15882. "properties": {
  15883. "id": {
  15884. "type": "string"
  15885. },
  15886. "type": {
  15887. "type": "string",
  15888. "enum": ["pty.deleted"]
  15889. },
  15890. "properties": {
  15891. "type": "object",
  15892. "properties": {
  15893. "id": {
  15894. "type": "string"
  15895. }
  15896. },
  15897. "required": ["id"],
  15898. "additionalProperties": false
  15899. }
  15900. },
  15901. "required": ["id", "type", "properties"],
  15902. "additionalProperties": false
  15903. },
  15904. "EventMessageUpdated": {
  15905. "type": "object",
  15906. "properties": {
  15907. "id": {
  15908. "type": "string"
  15909. },
  15910. "type": {
  15911. "type": "string",
  15912. "enum": ["message.updated"]
  15913. },
  15914. "properties": {
  15915. "type": "object",
  15916. "properties": {
  15917. "sessionID": {
  15918. "type": "string"
  15919. },
  15920. "info": {
  15921. "$ref": "#/components/schemas/Message"
  15922. }
  15923. },
  15924. "required": ["sessionID", "info"],
  15925. "additionalProperties": false
  15926. }
  15927. },
  15928. "required": ["id", "type", "properties"],
  15929. "additionalProperties": false
  15930. },
  15931. "EventMessageRemoved": {
  15932. "type": "object",
  15933. "properties": {
  15934. "id": {
  15935. "type": "string"
  15936. },
  15937. "type": {
  15938. "type": "string",
  15939. "enum": ["message.removed"]
  15940. },
  15941. "properties": {
  15942. "type": "object",
  15943. "properties": {
  15944. "sessionID": {
  15945. "type": "string"
  15946. },
  15947. "messageID": {
  15948. "type": "string"
  15949. }
  15950. },
  15951. "required": ["sessionID", "messageID"],
  15952. "additionalProperties": false
  15953. }
  15954. },
  15955. "required": ["id", "type", "properties"],
  15956. "additionalProperties": false
  15957. },
  15958. "EventMessagePartUpdated": {
  15959. "type": "object",
  15960. "properties": {
  15961. "id": {
  15962. "type": "string"
  15963. },
  15964. "type": {
  15965. "type": "string",
  15966. "enum": ["message.part.updated"]
  15967. },
  15968. "properties": {
  15969. "type": "object",
  15970. "properties": {
  15971. "sessionID": {
  15972. "type": "string"
  15973. },
  15974. "part": {
  15975. "$ref": "#/components/schemas/Part"
  15976. },
  15977. "time": {
  15978. "type": "integer",
  15979. "minimum": 0
  15980. }
  15981. },
  15982. "required": ["sessionID", "part", "time"],
  15983. "additionalProperties": false
  15984. }
  15985. },
  15986. "required": ["id", "type", "properties"],
  15987. "additionalProperties": false
  15988. },
  15989. "EventMessagePartRemoved": {
  15990. "type": "object",
  15991. "properties": {
  15992. "id": {
  15993. "type": "string"
  15994. },
  15995. "type": {
  15996. "type": "string",
  15997. "enum": ["message.part.removed"]
  15998. },
  15999. "properties": {
  16000. "type": "object",
  16001. "properties": {
  16002. "sessionID": {
  16003. "type": "string"
  16004. },
  16005. "messageID": {
  16006. "type": "string"
  16007. },
  16008. "partID": {
  16009. "type": "string"
  16010. }
  16011. },
  16012. "required": ["sessionID", "messageID", "partID"],
  16013. "additionalProperties": false
  16014. }
  16015. },
  16016. "required": ["id", "type", "properties"],
  16017. "additionalProperties": false
  16018. },
  16019. "EventSessionCreated": {
  16020. "type": "object",
  16021. "properties": {
  16022. "id": {
  16023. "type": "string"
  16024. },
  16025. "type": {
  16026. "type": "string",
  16027. "enum": ["session.created"]
  16028. },
  16029. "properties": {
  16030. "type": "object",
  16031. "properties": {
  16032. "sessionID": {
  16033. "type": "string"
  16034. },
  16035. "info": {
  16036. "$ref": "#/components/schemas/Session"
  16037. }
  16038. },
  16039. "required": ["sessionID", "info"],
  16040. "additionalProperties": false
  16041. }
  16042. },
  16043. "required": ["id", "type", "properties"],
  16044. "additionalProperties": false
  16045. },
  16046. "EventSessionUpdated": {
  16047. "type": "object",
  16048. "properties": {
  16049. "id": {
  16050. "type": "string"
  16051. },
  16052. "type": {
  16053. "type": "string",
  16054. "enum": ["session.updated"]
  16055. },
  16056. "properties": {
  16057. "type": "object",
  16058. "properties": {
  16059. "sessionID": {
  16060. "type": "string"
  16061. },
  16062. "info": {
  16063. "$ref": "#/components/schemas/Session"
  16064. }
  16065. },
  16066. "required": ["sessionID", "info"],
  16067. "additionalProperties": false
  16068. }
  16069. },
  16070. "required": ["id", "type", "properties"],
  16071. "additionalProperties": false
  16072. },
  16073. "EventSessionDeleted": {
  16074. "type": "object",
  16075. "properties": {
  16076. "id": {
  16077. "type": "string"
  16078. },
  16079. "type": {
  16080. "type": "string",
  16081. "enum": ["session.deleted"]
  16082. },
  16083. "properties": {
  16084. "type": "object",
  16085. "properties": {
  16086. "sessionID": {
  16087. "type": "string"
  16088. },
  16089. "info": {
  16090. "$ref": "#/components/schemas/Session"
  16091. }
  16092. },
  16093. "required": ["sessionID", "info"],
  16094. "additionalProperties": false
  16095. }
  16096. },
  16097. "required": ["id", "type", "properties"],
  16098. "additionalProperties": false
  16099. },
  16100. "EventSessionNextAgentSwitched": {
  16101. "type": "object",
  16102. "properties": {
  16103. "id": {
  16104. "type": "string"
  16105. },
  16106. "type": {
  16107. "type": "string",
  16108. "enum": ["session.next.agent.switched"]
  16109. },
  16110. "properties": {
  16111. "type": "object",
  16112. "properties": {
  16113. "timestamp": {
  16114. "type": "number"
  16115. },
  16116. "sessionID": {
  16117. "type": "string"
  16118. },
  16119. "agent": {
  16120. "type": "string"
  16121. }
  16122. },
  16123. "required": ["timestamp", "sessionID", "agent"],
  16124. "additionalProperties": false
  16125. }
  16126. },
  16127. "required": ["id", "type", "properties"],
  16128. "additionalProperties": false
  16129. },
  16130. "EventSessionNextModelSwitched": {
  16131. "type": "object",
  16132. "properties": {
  16133. "id": {
  16134. "type": "string"
  16135. },
  16136. "type": {
  16137. "type": "string",
  16138. "enum": ["session.next.model.switched"]
  16139. },
  16140. "properties": {
  16141. "type": "object",
  16142. "properties": {
  16143. "timestamp": {
  16144. "type": "number"
  16145. },
  16146. "sessionID": {
  16147. "type": "string"
  16148. },
  16149. "id": {
  16150. "type": "string"
  16151. },
  16152. "providerID": {
  16153. "type": "string"
  16154. },
  16155. "variant": {
  16156. "type": "string"
  16157. }
  16158. },
  16159. "required": ["timestamp", "sessionID", "id", "providerID"],
  16160. "additionalProperties": false
  16161. }
  16162. },
  16163. "required": ["id", "type", "properties"],
  16164. "additionalProperties": false
  16165. },
  16166. "PromptSource": {
  16167. "type": "object",
  16168. "properties": {
  16169. "start": {
  16170. "type": "number"
  16171. },
  16172. "end": {
  16173. "type": "number"
  16174. },
  16175. "text": {
  16176. "type": "string"
  16177. }
  16178. },
  16179. "required": ["start", "end", "text"],
  16180. "additionalProperties": false
  16181. },
  16182. "PromptFileAttachment": {
  16183. "type": "object",
  16184. "properties": {
  16185. "uri": {
  16186. "type": "string"
  16187. },
  16188. "mime": {
  16189. "type": "string"
  16190. },
  16191. "name": {
  16192. "type": "string"
  16193. },
  16194. "description": {
  16195. "type": "string"
  16196. },
  16197. "source": {
  16198. "$ref": "#/components/schemas/PromptSource"
  16199. }
  16200. },
  16201. "required": ["uri", "mime"],
  16202. "additionalProperties": false
  16203. },
  16204. "PromptAgentAttachment": {
  16205. "type": "object",
  16206. "properties": {
  16207. "name": {
  16208. "type": "string"
  16209. },
  16210. "source": {
  16211. "$ref": "#/components/schemas/PromptSource"
  16212. }
  16213. },
  16214. "required": ["name"],
  16215. "additionalProperties": false
  16216. },
  16217. "EventSessionNextPrompted": {
  16218. "type": "object",
  16219. "properties": {
  16220. "id": {
  16221. "type": "string"
  16222. },
  16223. "type": {
  16224. "type": "string",
  16225. "enum": ["session.next.prompted"]
  16226. },
  16227. "properties": {
  16228. "type": "object",
  16229. "properties": {
  16230. "timestamp": {
  16231. "type": "number"
  16232. },
  16233. "sessionID": {
  16234. "type": "string"
  16235. },
  16236. "prompt": {
  16237. "$ref": "#/components/schemas/Prompt"
  16238. }
  16239. },
  16240. "required": ["timestamp", "sessionID", "prompt"],
  16241. "additionalProperties": false
  16242. }
  16243. },
  16244. "required": ["id", "type", "properties"],
  16245. "additionalProperties": false
  16246. },
  16247. "EventSessionNextSynthetic": {
  16248. "type": "object",
  16249. "properties": {
  16250. "id": {
  16251. "type": "string"
  16252. },
  16253. "type": {
  16254. "type": "string",
  16255. "enum": ["session.next.synthetic"]
  16256. },
  16257. "properties": {
  16258. "type": "object",
  16259. "properties": {
  16260. "timestamp": {
  16261. "type": "number"
  16262. },
  16263. "sessionID": {
  16264. "type": "string"
  16265. },
  16266. "text": {
  16267. "type": "string"
  16268. }
  16269. },
  16270. "required": ["timestamp", "sessionID", "text"],
  16271. "additionalProperties": false
  16272. }
  16273. },
  16274. "required": ["id", "type", "properties"],
  16275. "additionalProperties": false
  16276. },
  16277. "EventSessionNextShellStarted": {
  16278. "type": "object",
  16279. "properties": {
  16280. "id": {
  16281. "type": "string"
  16282. },
  16283. "type": {
  16284. "type": "string",
  16285. "enum": ["session.next.shell.started"]
  16286. },
  16287. "properties": {
  16288. "type": "object",
  16289. "properties": {
  16290. "timestamp": {
  16291. "type": "number"
  16292. },
  16293. "sessionID": {
  16294. "type": "string"
  16295. },
  16296. "callID": {
  16297. "type": "string"
  16298. },
  16299. "command": {
  16300. "type": "string"
  16301. }
  16302. },
  16303. "required": ["timestamp", "sessionID", "callID", "command"],
  16304. "additionalProperties": false
  16305. }
  16306. },
  16307. "required": ["id", "type", "properties"],
  16308. "additionalProperties": false
  16309. },
  16310. "EventSessionNextShellEnded": {
  16311. "type": "object",
  16312. "properties": {
  16313. "id": {
  16314. "type": "string"
  16315. },
  16316. "type": {
  16317. "type": "string",
  16318. "enum": ["session.next.shell.ended"]
  16319. },
  16320. "properties": {
  16321. "type": "object",
  16322. "properties": {
  16323. "timestamp": {
  16324. "type": "number"
  16325. },
  16326. "sessionID": {
  16327. "type": "string"
  16328. },
  16329. "callID": {
  16330. "type": "string"
  16331. },
  16332. "output": {
  16333. "type": "string"
  16334. }
  16335. },
  16336. "required": ["timestamp", "sessionID", "callID", "output"],
  16337. "additionalProperties": false
  16338. }
  16339. },
  16340. "required": ["id", "type", "properties"],
  16341. "additionalProperties": false
  16342. },
  16343. "EventSessionNextStepStarted": {
  16344. "type": "object",
  16345. "properties": {
  16346. "id": {
  16347. "type": "string"
  16348. },
  16349. "type": {
  16350. "type": "string",
  16351. "enum": ["session.next.step.started"]
  16352. },
  16353. "properties": {
  16354. "type": "object",
  16355. "properties": {
  16356. "timestamp": {
  16357. "type": "number"
  16358. },
  16359. "sessionID": {
  16360. "type": "string"
  16361. },
  16362. "agent": {
  16363. "type": "string"
  16364. },
  16365. "model": {
  16366. "type": "object",
  16367. "properties": {
  16368. "id": {
  16369. "type": "string"
  16370. },
  16371. "providerID": {
  16372. "type": "string"
  16373. },
  16374. "variant": {
  16375. "type": "string"
  16376. }
  16377. },
  16378. "required": ["id", "providerID"],
  16379. "additionalProperties": false
  16380. },
  16381. "snapshot": {
  16382. "type": "string"
  16383. }
  16384. },
  16385. "required": ["timestamp", "sessionID", "agent", "model"],
  16386. "additionalProperties": false
  16387. }
  16388. },
  16389. "required": ["id", "type", "properties"],
  16390. "additionalProperties": false
  16391. },
  16392. "EventSessionNextStepEnded": {
  16393. "type": "object",
  16394. "properties": {
  16395. "id": {
  16396. "type": "string"
  16397. },
  16398. "type": {
  16399. "type": "string",
  16400. "enum": ["session.next.step.ended"]
  16401. },
  16402. "properties": {
  16403. "type": "object",
  16404. "properties": {
  16405. "timestamp": {
  16406. "type": "number"
  16407. },
  16408. "sessionID": {
  16409. "type": "string"
  16410. },
  16411. "finish": {
  16412. "type": "string"
  16413. },
  16414. "cost": {
  16415. "type": "number"
  16416. },
  16417. "tokens": {
  16418. "type": "object",
  16419. "properties": {
  16420. "input": {
  16421. "type": "integer",
  16422. "minimum": 0
  16423. },
  16424. "output": {
  16425. "type": "integer",
  16426. "minimum": 0
  16427. },
  16428. "reasoning": {
  16429. "type": "integer",
  16430. "minimum": 0
  16431. },
  16432. "cache": {
  16433. "type": "object",
  16434. "properties": {
  16435. "read": {
  16436. "type": "integer",
  16437. "minimum": 0
  16438. },
  16439. "write": {
  16440. "type": "integer",
  16441. "minimum": 0
  16442. }
  16443. },
  16444. "required": ["read", "write"],
  16445. "additionalProperties": false
  16446. }
  16447. },
  16448. "required": ["input", "output", "reasoning", "cache"],
  16449. "additionalProperties": false
  16450. },
  16451. "snapshot": {
  16452. "type": "string"
  16453. }
  16454. },
  16455. "required": ["timestamp", "sessionID", "finish", "cost", "tokens"],
  16456. "additionalProperties": false
  16457. }
  16458. },
  16459. "required": ["id", "type", "properties"],
  16460. "additionalProperties": false
  16461. },
  16462. "EventSessionNextStepFailed": {
  16463. "type": "object",
  16464. "properties": {
  16465. "id": {
  16466. "type": "string"
  16467. },
  16468. "type": {
  16469. "type": "string",
  16470. "enum": ["session.next.step.failed"]
  16471. },
  16472. "properties": {
  16473. "type": "object",
  16474. "properties": {
  16475. "timestamp": {
  16476. "type": "number"
  16477. },
  16478. "sessionID": {
  16479. "type": "string"
  16480. },
  16481. "error": {
  16482. "type": "object",
  16483. "properties": {
  16484. "type": {
  16485. "type": "string"
  16486. },
  16487. "message": {
  16488. "type": "string"
  16489. }
  16490. },
  16491. "required": ["type", "message"],
  16492. "additionalProperties": false
  16493. }
  16494. },
  16495. "required": ["timestamp", "sessionID", "error"],
  16496. "additionalProperties": false
  16497. }
  16498. },
  16499. "required": ["id", "type", "properties"],
  16500. "additionalProperties": false
  16501. },
  16502. "EventSessionNextTextStarted": {
  16503. "type": "object",
  16504. "properties": {
  16505. "id": {
  16506. "type": "string"
  16507. },
  16508. "type": {
  16509. "type": "string",
  16510. "enum": ["session.next.text.started"]
  16511. },
  16512. "properties": {
  16513. "type": "object",
  16514. "properties": {
  16515. "timestamp": {
  16516. "type": "number"
  16517. },
  16518. "sessionID": {
  16519. "type": "string"
  16520. }
  16521. },
  16522. "required": ["timestamp", "sessionID"],
  16523. "additionalProperties": false
  16524. }
  16525. },
  16526. "required": ["id", "type", "properties"],
  16527. "additionalProperties": false
  16528. },
  16529. "EventSessionNextTextDelta": {
  16530. "type": "object",
  16531. "properties": {
  16532. "id": {
  16533. "type": "string"
  16534. },
  16535. "type": {
  16536. "type": "string",
  16537. "enum": ["session.next.text.delta"]
  16538. },
  16539. "properties": {
  16540. "type": "object",
  16541. "properties": {
  16542. "timestamp": {
  16543. "type": "number"
  16544. },
  16545. "sessionID": {
  16546. "type": "string"
  16547. },
  16548. "delta": {
  16549. "type": "string"
  16550. }
  16551. },
  16552. "required": ["timestamp", "sessionID", "delta"],
  16553. "additionalProperties": false
  16554. }
  16555. },
  16556. "required": ["id", "type", "properties"],
  16557. "additionalProperties": false
  16558. },
  16559. "EventSessionNextTextEnded": {
  16560. "type": "object",
  16561. "properties": {
  16562. "id": {
  16563. "type": "string"
  16564. },
  16565. "type": {
  16566. "type": "string",
  16567. "enum": ["session.next.text.ended"]
  16568. },
  16569. "properties": {
  16570. "type": "object",
  16571. "properties": {
  16572. "timestamp": {
  16573. "type": "number"
  16574. },
  16575. "sessionID": {
  16576. "type": "string"
  16577. },
  16578. "text": {
  16579. "type": "string"
  16580. }
  16581. },
  16582. "required": ["timestamp", "sessionID", "text"],
  16583. "additionalProperties": false
  16584. }
  16585. },
  16586. "required": ["id", "type", "properties"],
  16587. "additionalProperties": false
  16588. },
  16589. "EventSessionNextReasoningStarted": {
  16590. "type": "object",
  16591. "properties": {
  16592. "id": {
  16593. "type": "string"
  16594. },
  16595. "type": {
  16596. "type": "string",
  16597. "enum": ["session.next.reasoning.started"]
  16598. },
  16599. "properties": {
  16600. "type": "object",
  16601. "properties": {
  16602. "timestamp": {
  16603. "type": "number"
  16604. },
  16605. "sessionID": {
  16606. "type": "string"
  16607. },
  16608. "reasoningID": {
  16609. "type": "string"
  16610. }
  16611. },
  16612. "required": ["timestamp", "sessionID", "reasoningID"],
  16613. "additionalProperties": false
  16614. }
  16615. },
  16616. "required": ["id", "type", "properties"],
  16617. "additionalProperties": false
  16618. },
  16619. "EventSessionNextReasoningDelta": {
  16620. "type": "object",
  16621. "properties": {
  16622. "id": {
  16623. "type": "string"
  16624. },
  16625. "type": {
  16626. "type": "string",
  16627. "enum": ["session.next.reasoning.delta"]
  16628. },
  16629. "properties": {
  16630. "type": "object",
  16631. "properties": {
  16632. "timestamp": {
  16633. "type": "number"
  16634. },
  16635. "sessionID": {
  16636. "type": "string"
  16637. },
  16638. "reasoningID": {
  16639. "type": "string"
  16640. },
  16641. "delta": {
  16642. "type": "string"
  16643. }
  16644. },
  16645. "required": ["timestamp", "sessionID", "reasoningID", "delta"],
  16646. "additionalProperties": false
  16647. }
  16648. },
  16649. "required": ["id", "type", "properties"],
  16650. "additionalProperties": false
  16651. },
  16652. "EventSessionNextReasoningEnded": {
  16653. "type": "object",
  16654. "properties": {
  16655. "id": {
  16656. "type": "string"
  16657. },
  16658. "type": {
  16659. "type": "string",
  16660. "enum": ["session.next.reasoning.ended"]
  16661. },
  16662. "properties": {
  16663. "type": "object",
  16664. "properties": {
  16665. "timestamp": {
  16666. "type": "number"
  16667. },
  16668. "sessionID": {
  16669. "type": "string"
  16670. },
  16671. "reasoningID": {
  16672. "type": "string"
  16673. },
  16674. "text": {
  16675. "type": "string"
  16676. }
  16677. },
  16678. "required": ["timestamp", "sessionID", "reasoningID", "text"],
  16679. "additionalProperties": false
  16680. }
  16681. },
  16682. "required": ["id", "type", "properties"],
  16683. "additionalProperties": false
  16684. },
  16685. "EventSessionNextToolInputStarted": {
  16686. "type": "object",
  16687. "properties": {
  16688. "id": {
  16689. "type": "string"
  16690. },
  16691. "type": {
  16692. "type": "string",
  16693. "enum": ["session.next.tool.input.started"]
  16694. },
  16695. "properties": {
  16696. "type": "object",
  16697. "properties": {
  16698. "timestamp": {
  16699. "type": "number"
  16700. },
  16701. "sessionID": {
  16702. "type": "string"
  16703. },
  16704. "callID": {
  16705. "type": "string"
  16706. },
  16707. "name": {
  16708. "type": "string"
  16709. }
  16710. },
  16711. "required": ["timestamp", "sessionID", "callID", "name"],
  16712. "additionalProperties": false
  16713. }
  16714. },
  16715. "required": ["id", "type", "properties"],
  16716. "additionalProperties": false
  16717. },
  16718. "EventSessionNextToolInputDelta": {
  16719. "type": "object",
  16720. "properties": {
  16721. "id": {
  16722. "type": "string"
  16723. },
  16724. "type": {
  16725. "type": "string",
  16726. "enum": ["session.next.tool.input.delta"]
  16727. },
  16728. "properties": {
  16729. "type": "object",
  16730. "properties": {
  16731. "timestamp": {
  16732. "type": "number"
  16733. },
  16734. "sessionID": {
  16735. "type": "string"
  16736. },
  16737. "callID": {
  16738. "type": "string"
  16739. },
  16740. "delta": {
  16741. "type": "string"
  16742. }
  16743. },
  16744. "required": ["timestamp", "sessionID", "callID", "delta"],
  16745. "additionalProperties": false
  16746. }
  16747. },
  16748. "required": ["id", "type", "properties"],
  16749. "additionalProperties": false
  16750. },
  16751. "EventSessionNextToolInputEnded": {
  16752. "type": "object",
  16753. "properties": {
  16754. "id": {
  16755. "type": "string"
  16756. },
  16757. "type": {
  16758. "type": "string",
  16759. "enum": ["session.next.tool.input.ended"]
  16760. },
  16761. "properties": {
  16762. "type": "object",
  16763. "properties": {
  16764. "timestamp": {
  16765. "type": "number"
  16766. },
  16767. "sessionID": {
  16768. "type": "string"
  16769. },
  16770. "callID": {
  16771. "type": "string"
  16772. },
  16773. "text": {
  16774. "type": "string"
  16775. }
  16776. },
  16777. "required": ["timestamp", "sessionID", "callID", "text"],
  16778. "additionalProperties": false
  16779. }
  16780. },
  16781. "required": ["id", "type", "properties"],
  16782. "additionalProperties": false
  16783. },
  16784. "EventSessionNextToolCalled": {
  16785. "type": "object",
  16786. "properties": {
  16787. "id": {
  16788. "type": "string"
  16789. },
  16790. "type": {
  16791. "type": "string",
  16792. "enum": ["session.next.tool.called"]
  16793. },
  16794. "properties": {
  16795. "type": "object",
  16796. "properties": {
  16797. "timestamp": {
  16798. "type": "number"
  16799. },
  16800. "sessionID": {
  16801. "type": "string"
  16802. },
  16803. "callID": {
  16804. "type": "string"
  16805. },
  16806. "tool": {
  16807. "type": "string"
  16808. },
  16809. "input": {
  16810. "type": "object"
  16811. },
  16812. "provider": {
  16813. "type": "object",
  16814. "properties": {
  16815. "executed": {
  16816. "type": "boolean"
  16817. },
  16818. "metadata": {
  16819. "type": "object"
  16820. }
  16821. },
  16822. "required": ["executed"],
  16823. "additionalProperties": false
  16824. }
  16825. },
  16826. "required": ["timestamp", "sessionID", "callID", "tool", "input", "provider"],
  16827. "additionalProperties": false
  16828. }
  16829. },
  16830. "required": ["id", "type", "properties"],
  16831. "additionalProperties": false
  16832. },
  16833. "ToolTextContent": {
  16834. "type": "object",
  16835. "properties": {
  16836. "type": {
  16837. "type": "string",
  16838. "enum": ["text"]
  16839. },
  16840. "text": {
  16841. "type": "string"
  16842. }
  16843. },
  16844. "required": ["type", "text"],
  16845. "additionalProperties": false
  16846. },
  16847. "ToolFileContent": {
  16848. "type": "object",
  16849. "properties": {
  16850. "type": {
  16851. "type": "string",
  16852. "enum": ["file"]
  16853. },
  16854. "uri": {
  16855. "type": "string"
  16856. },
  16857. "mime": {
  16858. "type": "string"
  16859. },
  16860. "name": {
  16861. "type": "string"
  16862. }
  16863. },
  16864. "required": ["type", "uri", "mime"],
  16865. "additionalProperties": false
  16866. },
  16867. "EventSessionNextToolProgress": {
  16868. "type": "object",
  16869. "properties": {
  16870. "id": {
  16871. "type": "string"
  16872. },
  16873. "type": {
  16874. "type": "string",
  16875. "enum": ["session.next.tool.progress"]
  16876. },
  16877. "properties": {
  16878. "type": "object",
  16879. "properties": {
  16880. "timestamp": {
  16881. "type": "number"
  16882. },
  16883. "sessionID": {
  16884. "type": "string"
  16885. },
  16886. "callID": {
  16887. "type": "string"
  16888. },
  16889. "structured": {
  16890. "type": "object"
  16891. },
  16892. "content": {
  16893. "type": "array",
  16894. "items": {
  16895. "anyOf": [
  16896. {
  16897. "$ref": "#/components/schemas/ToolTextContent"
  16898. },
  16899. {
  16900. "$ref": "#/components/schemas/ToolFileContent"
  16901. }
  16902. ]
  16903. }
  16904. }
  16905. },
  16906. "required": ["timestamp", "sessionID", "callID", "structured", "content"],
  16907. "additionalProperties": false
  16908. }
  16909. },
  16910. "required": ["id", "type", "properties"],
  16911. "additionalProperties": false
  16912. },
  16913. "EventSessionNextToolSuccess": {
  16914. "type": "object",
  16915. "properties": {
  16916. "id": {
  16917. "type": "string"
  16918. },
  16919. "type": {
  16920. "type": "string",
  16921. "enum": ["session.next.tool.success"]
  16922. },
  16923. "properties": {
  16924. "type": "object",
  16925. "properties": {
  16926. "timestamp": {
  16927. "type": "number"
  16928. },
  16929. "sessionID": {
  16930. "type": "string"
  16931. },
  16932. "callID": {
  16933. "type": "string"
  16934. },
  16935. "structured": {
  16936. "type": "object"
  16937. },
  16938. "content": {
  16939. "type": "array",
  16940. "items": {
  16941. "anyOf": [
  16942. {
  16943. "$ref": "#/components/schemas/ToolTextContent"
  16944. },
  16945. {
  16946. "$ref": "#/components/schemas/ToolFileContent"
  16947. }
  16948. ]
  16949. }
  16950. },
  16951. "provider": {
  16952. "type": "object",
  16953. "properties": {
  16954. "executed": {
  16955. "type": "boolean"
  16956. },
  16957. "metadata": {
  16958. "type": "object"
  16959. }
  16960. },
  16961. "required": ["executed"],
  16962. "additionalProperties": false
  16963. }
  16964. },
  16965. "required": ["timestamp", "sessionID", "callID", "structured", "content", "provider"],
  16966. "additionalProperties": false
  16967. }
  16968. },
  16969. "required": ["id", "type", "properties"],
  16970. "additionalProperties": false
  16971. },
  16972. "EventSessionNextToolFailed": {
  16973. "type": "object",
  16974. "properties": {
  16975. "id": {
  16976. "type": "string"
  16977. },
  16978. "type": {
  16979. "type": "string",
  16980. "enum": ["session.next.tool.failed"]
  16981. },
  16982. "properties": {
  16983. "type": "object",
  16984. "properties": {
  16985. "timestamp": {
  16986. "type": "number"
  16987. },
  16988. "sessionID": {
  16989. "type": "string"
  16990. },
  16991. "callID": {
  16992. "type": "string"
  16993. },
  16994. "error": {
  16995. "type": "object",
  16996. "properties": {
  16997. "type": {
  16998. "type": "string"
  16999. },
  17000. "message": {
  17001. "type": "string"
  17002. }
  17003. },
  17004. "required": ["type", "message"],
  17005. "additionalProperties": false
  17006. },
  17007. "provider": {
  17008. "type": "object",
  17009. "properties": {
  17010. "executed": {
  17011. "type": "boolean"
  17012. },
  17013. "metadata": {
  17014. "type": "object"
  17015. }
  17016. },
  17017. "required": ["executed"],
  17018. "additionalProperties": false
  17019. }
  17020. },
  17021. "required": ["timestamp", "sessionID", "callID", "error", "provider"],
  17022. "additionalProperties": false
  17023. }
  17024. },
  17025. "required": ["id", "type", "properties"],
  17026. "additionalProperties": false
  17027. },
  17028. "SessionNextRetry_error": {
  17029. "type": "object",
  17030. "properties": {
  17031. "message": {
  17032. "type": "string"
  17033. },
  17034. "statusCode": {
  17035. "type": "integer",
  17036. "minimum": 0
  17037. },
  17038. "isRetryable": {
  17039. "type": "boolean"
  17040. },
  17041. "responseHeaders": {
  17042. "type": "object",
  17043. "additionalProperties": {
  17044. "type": "string"
  17045. }
  17046. },
  17047. "responseBody": {
  17048. "type": "string"
  17049. },
  17050. "metadata": {
  17051. "type": "object",
  17052. "additionalProperties": {
  17053. "type": "string"
  17054. }
  17055. }
  17056. },
  17057. "required": ["message", "isRetryable"],
  17058. "additionalProperties": false
  17059. },
  17060. "EventSessionNextRetried": {
  17061. "type": "object",
  17062. "properties": {
  17063. "id": {
  17064. "type": "string"
  17065. },
  17066. "type": {
  17067. "type": "string",
  17068. "enum": ["session.next.retried"]
  17069. },
  17070. "properties": {
  17071. "type": "object",
  17072. "properties": {
  17073. "timestamp": {
  17074. "type": "number"
  17075. },
  17076. "sessionID": {
  17077. "type": "string"
  17078. },
  17079. "attempt": {
  17080. "type": "integer",
  17081. "minimum": 0
  17082. },
  17083. "error": {
  17084. "$ref": "#/components/schemas/SessionNextRetry_error"
  17085. }
  17086. },
  17087. "required": ["timestamp", "sessionID", "attempt", "error"],
  17088. "additionalProperties": false
  17089. }
  17090. },
  17091. "required": ["id", "type", "properties"],
  17092. "additionalProperties": false
  17093. },
  17094. "EventSessionNextCompactionStarted": {
  17095. "type": "object",
  17096. "properties": {
  17097. "id": {
  17098. "type": "string"
  17099. },
  17100. "type": {
  17101. "type": "string",
  17102. "enum": ["session.next.compaction.started"]
  17103. },
  17104. "properties": {
  17105. "type": "object",
  17106. "properties": {
  17107. "timestamp": {
  17108. "type": "number"
  17109. },
  17110. "sessionID": {
  17111. "type": "string"
  17112. },
  17113. "reason": {
  17114. "type": "string",
  17115. "enum": ["auto", "manual"]
  17116. }
  17117. },
  17118. "required": ["timestamp", "sessionID", "reason"],
  17119. "additionalProperties": false
  17120. }
  17121. },
  17122. "required": ["id", "type", "properties"],
  17123. "additionalProperties": false
  17124. },
  17125. "EventSessionNextCompactionDelta": {
  17126. "type": "object",
  17127. "properties": {
  17128. "id": {
  17129. "type": "string"
  17130. },
  17131. "type": {
  17132. "type": "string",
  17133. "enum": ["session.next.compaction.delta"]
  17134. },
  17135. "properties": {
  17136. "type": "object",
  17137. "properties": {
  17138. "timestamp": {
  17139. "type": "number"
  17140. },
  17141. "sessionID": {
  17142. "type": "string"
  17143. },
  17144. "text": {
  17145. "type": "string"
  17146. }
  17147. },
  17148. "required": ["timestamp", "sessionID", "text"],
  17149. "additionalProperties": false
  17150. }
  17151. },
  17152. "required": ["id", "type", "properties"],
  17153. "additionalProperties": false
  17154. },
  17155. "EventSessionNextCompactionEnded": {
  17156. "type": "object",
  17157. "properties": {
  17158. "id": {
  17159. "type": "string"
  17160. },
  17161. "type": {
  17162. "type": "string",
  17163. "enum": ["session.next.compaction.ended"]
  17164. },
  17165. "properties": {
  17166. "type": "object",
  17167. "properties": {
  17168. "timestamp": {
  17169. "type": "number"
  17170. },
  17171. "sessionID": {
  17172. "type": "string"
  17173. },
  17174. "text": {
  17175. "type": "string"
  17176. },
  17177. "include": {
  17178. "type": "string"
  17179. }
  17180. },
  17181. "required": ["timestamp", "sessionID", "text"],
  17182. "additionalProperties": false
  17183. }
  17184. },
  17185. "required": ["id", "type", "properties"],
  17186. "additionalProperties": false
  17187. },
  17188. "EventServerConnected": {
  17189. "type": "object",
  17190. "properties": {
  17191. "id": {
  17192. "type": "string"
  17193. },
  17194. "type": {
  17195. "type": "string",
  17196. "enum": ["server.connected"]
  17197. },
  17198. "properties": {
  17199. "type": "object",
  17200. "properties": {}
  17201. }
  17202. },
  17203. "required": ["id", "type", "properties"],
  17204. "additionalProperties": false
  17205. },
  17206. "EventGlobalDisposed": {
  17207. "type": "object",
  17208. "properties": {
  17209. "id": {
  17210. "type": "string"
  17211. },
  17212. "type": {
  17213. "type": "string",
  17214. "enum": ["global.disposed"]
  17215. },
  17216. "properties": {
  17217. "type": "object",
  17218. "properties": {}
  17219. }
  17220. },
  17221. "required": ["id", "type", "properties"],
  17222. "additionalProperties": false
  17223. },
  17224. "SessionInfo": {
  17225. "type": "object",
  17226. "properties": {
  17227. "id": {
  17228. "type": "string"
  17229. },
  17230. "parentID": {
  17231. "type": "string"
  17232. },
  17233. "projectID": {
  17234. "type": "string"
  17235. },
  17236. "workspaceID": {
  17237. "type": "string"
  17238. },
  17239. "path": {
  17240. "type": "string"
  17241. },
  17242. "agent": {
  17243. "type": "string"
  17244. },
  17245. "model": {
  17246. "type": "object",
  17247. "properties": {
  17248. "id": {
  17249. "type": "string"
  17250. },
  17251. "providerID": {
  17252. "type": "string"
  17253. },
  17254. "variant": {
  17255. "type": "string"
  17256. }
  17257. },
  17258. "required": ["id", "providerID"],
  17259. "additionalProperties": false
  17260. },
  17261. "time": {
  17262. "type": "object",
  17263. "properties": {
  17264. "created": {
  17265. "type": "number"
  17266. },
  17267. "updated": {
  17268. "type": "number"
  17269. },
  17270. "archived": {
  17271. "type": "number"
  17272. }
  17273. },
  17274. "required": ["created", "updated"],
  17275. "additionalProperties": false
  17276. },
  17277. "title": {
  17278. "type": "string"
  17279. }
  17280. },
  17281. "required": ["id", "projectID", "time", "title"],
  17282. "additionalProperties": false
  17283. },
  17284. "SessionDelivery": {
  17285. "type": "string",
  17286. "enum": ["immediate", "deferred"]
  17287. },
  17288. "SessionMessageAgentSwitched": {
  17289. "type": "object",
  17290. "properties": {
  17291. "id": {
  17292. "type": "string"
  17293. },
  17294. "metadata": {
  17295. "type": "object"
  17296. },
  17297. "time": {
  17298. "type": "object",
  17299. "properties": {
  17300. "created": {
  17301. "type": "number"
  17302. }
  17303. },
  17304. "required": ["created"],
  17305. "additionalProperties": false
  17306. },
  17307. "type": {
  17308. "type": "string",
  17309. "enum": ["agent-switched"]
  17310. },
  17311. "agent": {
  17312. "type": "string"
  17313. }
  17314. },
  17315. "required": ["id", "time", "type", "agent"],
  17316. "additionalProperties": false
  17317. },
  17318. "SessionMessageModelSwitched": {
  17319. "type": "object",
  17320. "properties": {
  17321. "id": {
  17322. "type": "string"
  17323. },
  17324. "metadata": {
  17325. "type": "object"
  17326. },
  17327. "time": {
  17328. "type": "object",
  17329. "properties": {
  17330. "created": {
  17331. "type": "number"
  17332. }
  17333. },
  17334. "required": ["created"],
  17335. "additionalProperties": false
  17336. },
  17337. "type": {
  17338. "type": "string",
  17339. "enum": ["model-switched"]
  17340. },
  17341. "model": {
  17342. "type": "object",
  17343. "properties": {
  17344. "id": {
  17345. "type": "string"
  17346. },
  17347. "providerID": {
  17348. "type": "string"
  17349. },
  17350. "variant": {
  17351. "type": "string"
  17352. }
  17353. },
  17354. "required": ["id", "providerID"],
  17355. "additionalProperties": false
  17356. }
  17357. },
  17358. "required": ["id", "time", "type", "model"],
  17359. "additionalProperties": false
  17360. },
  17361. "SessionMessageUser": {
  17362. "type": "object",
  17363. "properties": {
  17364. "id": {
  17365. "type": "string"
  17366. },
  17367. "metadata": {
  17368. "type": "object"
  17369. },
  17370. "time": {
  17371. "type": "object",
  17372. "properties": {
  17373. "created": {
  17374. "type": "number"
  17375. }
  17376. },
  17377. "required": ["created"],
  17378. "additionalProperties": false
  17379. },
  17380. "text": {
  17381. "type": "string"
  17382. },
  17383. "files": {
  17384. "type": "array",
  17385. "items": {
  17386. "$ref": "#/components/schemas/PromptFileAttachment"
  17387. }
  17388. },
  17389. "agents": {
  17390. "type": "array",
  17391. "items": {
  17392. "$ref": "#/components/schemas/PromptAgentAttachment"
  17393. }
  17394. },
  17395. "type": {
  17396. "type": "string",
  17397. "enum": ["user"]
  17398. }
  17399. },
  17400. "required": ["id", "time", "text", "type"],
  17401. "additionalProperties": false
  17402. },
  17403. "SessionMessageSynthetic": {
  17404. "type": "object",
  17405. "properties": {
  17406. "id": {
  17407. "type": "string"
  17408. },
  17409. "metadata": {
  17410. "type": "object"
  17411. },
  17412. "time": {
  17413. "type": "object",
  17414. "properties": {
  17415. "created": {
  17416. "type": "number"
  17417. }
  17418. },
  17419. "required": ["created"],
  17420. "additionalProperties": false
  17421. },
  17422. "sessionID": {
  17423. "type": "string"
  17424. },
  17425. "text": {
  17426. "type": "string"
  17427. },
  17428. "type": {
  17429. "type": "string",
  17430. "enum": ["synthetic"]
  17431. }
  17432. },
  17433. "required": ["id", "time", "sessionID", "text", "type"],
  17434. "additionalProperties": false
  17435. },
  17436. "SessionMessageShell": {
  17437. "type": "object",
  17438. "properties": {
  17439. "id": {
  17440. "type": "string"
  17441. },
  17442. "metadata": {
  17443. "type": "object"
  17444. },
  17445. "time": {
  17446. "type": "object",
  17447. "properties": {
  17448. "created": {
  17449. "type": "number"
  17450. },
  17451. "completed": {
  17452. "type": "number"
  17453. }
  17454. },
  17455. "required": ["created"],
  17456. "additionalProperties": false
  17457. },
  17458. "type": {
  17459. "type": "string",
  17460. "enum": ["shell"]
  17461. },
  17462. "callID": {
  17463. "type": "string"
  17464. },
  17465. "command": {
  17466. "type": "string"
  17467. },
  17468. "output": {
  17469. "type": "string"
  17470. }
  17471. },
  17472. "required": ["id", "time", "type", "callID", "command", "output"],
  17473. "additionalProperties": false
  17474. },
  17475. "SessionMessageAssistantText": {
  17476. "type": "object",
  17477. "properties": {
  17478. "type": {
  17479. "type": "string",
  17480. "enum": ["text"]
  17481. },
  17482. "text": {
  17483. "type": "string"
  17484. }
  17485. },
  17486. "required": ["type", "text"],
  17487. "additionalProperties": false
  17488. },
  17489. "SessionMessageAssistantReasoning": {
  17490. "type": "object",
  17491. "properties": {
  17492. "type": {
  17493. "type": "string",
  17494. "enum": ["reasoning"]
  17495. },
  17496. "id": {
  17497. "type": "string"
  17498. },
  17499. "text": {
  17500. "type": "string"
  17501. }
  17502. },
  17503. "required": ["type", "id", "text"],
  17504. "additionalProperties": false
  17505. },
  17506. "SessionMessageToolStatePending": {
  17507. "type": "object",
  17508. "properties": {
  17509. "status": {
  17510. "type": "string",
  17511. "enum": ["pending"]
  17512. },
  17513. "input": {
  17514. "type": "string"
  17515. }
  17516. },
  17517. "required": ["status", "input"],
  17518. "additionalProperties": false
  17519. },
  17520. "SessionMessageToolStateRunning": {
  17521. "type": "object",
  17522. "properties": {
  17523. "status": {
  17524. "type": "string",
  17525. "enum": ["running"]
  17526. },
  17527. "input": {
  17528. "type": "object"
  17529. },
  17530. "structured": {
  17531. "type": "object"
  17532. },
  17533. "content": {
  17534. "type": "array",
  17535. "items": {
  17536. "anyOf": [
  17537. {
  17538. "$ref": "#/components/schemas/ToolTextContent"
  17539. },
  17540. {
  17541. "$ref": "#/components/schemas/ToolFileContent"
  17542. }
  17543. ]
  17544. }
  17545. }
  17546. },
  17547. "required": ["status", "input", "structured", "content"],
  17548. "additionalProperties": false
  17549. },
  17550. "SessionMessageToolStateCompleted": {
  17551. "type": "object",
  17552. "properties": {
  17553. "status": {
  17554. "type": "string",
  17555. "enum": ["completed"]
  17556. },
  17557. "input": {
  17558. "type": "object"
  17559. },
  17560. "attachments": {
  17561. "type": "array",
  17562. "items": {
  17563. "$ref": "#/components/schemas/PromptFileAttachment"
  17564. }
  17565. },
  17566. "content": {
  17567. "type": "array",
  17568. "items": {
  17569. "anyOf": [
  17570. {
  17571. "$ref": "#/components/schemas/ToolTextContent"
  17572. },
  17573. {
  17574. "$ref": "#/components/schemas/ToolFileContent"
  17575. }
  17576. ]
  17577. }
  17578. },
  17579. "structured": {
  17580. "type": "object"
  17581. }
  17582. },
  17583. "required": ["status", "input", "content", "structured"],
  17584. "additionalProperties": false
  17585. },
  17586. "SessionMessageToolStateError": {
  17587. "type": "object",
  17588. "properties": {
  17589. "status": {
  17590. "type": "string",
  17591. "enum": ["error"]
  17592. },
  17593. "input": {
  17594. "type": "object"
  17595. },
  17596. "content": {
  17597. "type": "array",
  17598. "items": {
  17599. "anyOf": [
  17600. {
  17601. "$ref": "#/components/schemas/ToolTextContent"
  17602. },
  17603. {
  17604. "$ref": "#/components/schemas/ToolFileContent"
  17605. }
  17606. ]
  17607. }
  17608. },
  17609. "structured": {
  17610. "type": "object"
  17611. },
  17612. "error": {
  17613. "type": "object",
  17614. "properties": {
  17615. "type": {
  17616. "type": "string"
  17617. },
  17618. "message": {
  17619. "type": "string"
  17620. }
  17621. },
  17622. "required": ["type", "message"],
  17623. "additionalProperties": false
  17624. }
  17625. },
  17626. "required": ["status", "input", "content", "structured", "error"],
  17627. "additionalProperties": false
  17628. },
  17629. "SessionMessageAssistantTool": {
  17630. "type": "object",
  17631. "properties": {
  17632. "type": {
  17633. "type": "string",
  17634. "enum": ["tool"]
  17635. },
  17636. "id": {
  17637. "type": "string"
  17638. },
  17639. "name": {
  17640. "type": "string"
  17641. },
  17642. "provider": {
  17643. "type": "object",
  17644. "properties": {
  17645. "executed": {
  17646. "type": "boolean"
  17647. },
  17648. "metadata": {
  17649. "type": "object"
  17650. }
  17651. },
  17652. "required": ["executed"],
  17653. "additionalProperties": false
  17654. },
  17655. "state": {
  17656. "anyOf": [
  17657. {
  17658. "$ref": "#/components/schemas/SessionMessageToolStatePending"
  17659. },
  17660. {
  17661. "$ref": "#/components/schemas/SessionMessageToolStateRunning"
  17662. },
  17663. {
  17664. "$ref": "#/components/schemas/SessionMessageToolStateCompleted"
  17665. },
  17666. {
  17667. "$ref": "#/components/schemas/SessionMessageToolStateError"
  17668. }
  17669. ]
  17670. },
  17671. "time": {
  17672. "type": "object",
  17673. "properties": {
  17674. "created": {
  17675. "type": "number"
  17676. },
  17677. "ran": {
  17678. "type": "number"
  17679. },
  17680. "completed": {
  17681. "type": "number"
  17682. },
  17683. "pruned": {
  17684. "type": "number"
  17685. }
  17686. },
  17687. "required": ["created"],
  17688. "additionalProperties": false
  17689. }
  17690. },
  17691. "required": ["type", "id", "name", "state", "time"],
  17692. "additionalProperties": false
  17693. },
  17694. "SessionMessageAssistant": {
  17695. "type": "object",
  17696. "properties": {
  17697. "id": {
  17698. "type": "string"
  17699. },
  17700. "metadata": {
  17701. "type": "object"
  17702. },
  17703. "time": {
  17704. "type": "object",
  17705. "properties": {
  17706. "created": {
  17707. "type": "number"
  17708. },
  17709. "completed": {
  17710. "type": "number"
  17711. }
  17712. },
  17713. "required": ["created"],
  17714. "additionalProperties": false
  17715. },
  17716. "type": {
  17717. "type": "string",
  17718. "enum": ["assistant"]
  17719. },
  17720. "agent": {
  17721. "type": "string"
  17722. },
  17723. "model": {
  17724. "type": "object",
  17725. "properties": {
  17726. "id": {
  17727. "type": "string"
  17728. },
  17729. "providerID": {
  17730. "type": "string"
  17731. },
  17732. "variant": {
  17733. "type": "string"
  17734. }
  17735. },
  17736. "required": ["id", "providerID"],
  17737. "additionalProperties": false
  17738. },
  17739. "content": {
  17740. "type": "array",
  17741. "items": {
  17742. "anyOf": [
  17743. {
  17744. "$ref": "#/components/schemas/SessionMessageAssistantText"
  17745. },
  17746. {
  17747. "$ref": "#/components/schemas/SessionMessageAssistantReasoning"
  17748. },
  17749. {
  17750. "$ref": "#/components/schemas/SessionMessageAssistantTool"
  17751. }
  17752. ]
  17753. }
  17754. },
  17755. "snapshot": {
  17756. "type": "object",
  17757. "properties": {
  17758. "start": {
  17759. "type": "string"
  17760. },
  17761. "end": {
  17762. "type": "string"
  17763. }
  17764. },
  17765. "additionalProperties": false
  17766. },
  17767. "finish": {
  17768. "type": "string"
  17769. },
  17770. "cost": {
  17771. "type": "number"
  17772. },
  17773. "tokens": {
  17774. "type": "object",
  17775. "properties": {
  17776. "input": {
  17777. "type": "number"
  17778. },
  17779. "output": {
  17780. "type": "number"
  17781. },
  17782. "reasoning": {
  17783. "type": "number"
  17784. },
  17785. "cache": {
  17786. "type": "object",
  17787. "properties": {
  17788. "read": {
  17789. "type": "number"
  17790. },
  17791. "write": {
  17792. "type": "number"
  17793. }
  17794. },
  17795. "required": ["read", "write"],
  17796. "additionalProperties": false
  17797. }
  17798. },
  17799. "required": ["input", "output", "reasoning", "cache"],
  17800. "additionalProperties": false
  17801. },
  17802. "error": {
  17803. "type": "object",
  17804. "properties": {
  17805. "type": {
  17806. "type": "string"
  17807. },
  17808. "message": {
  17809. "type": "string"
  17810. }
  17811. },
  17812. "required": ["type", "message"],
  17813. "additionalProperties": false
  17814. }
  17815. },
  17816. "required": ["id", "time", "type", "agent", "model", "content"],
  17817. "additionalProperties": false
  17818. },
  17819. "SessionMessageCompaction": {
  17820. "type": "object",
  17821. "properties": {
  17822. "type": {
  17823. "type": "string",
  17824. "enum": ["compaction"]
  17825. },
  17826. "reason": {
  17827. "type": "string",
  17828. "enum": ["auto", "manual"]
  17829. },
  17830. "summary": {
  17831. "type": "string"
  17832. },
  17833. "include": {
  17834. "type": "string"
  17835. },
  17836. "id": {
  17837. "type": "string"
  17838. },
  17839. "metadata": {
  17840. "type": "object"
  17841. },
  17842. "time": {
  17843. "type": "object",
  17844. "properties": {
  17845. "created": {
  17846. "type": "number"
  17847. }
  17848. },
  17849. "required": ["created"],
  17850. "additionalProperties": false
  17851. }
  17852. },
  17853. "required": ["type", "reason", "summary", "id", "time"],
  17854. "additionalProperties": false
  17855. },
  17856. "SessionMessage": {
  17857. "anyOf": [
  17858. {
  17859. "$ref": "#/components/schemas/SessionMessageAgentSwitched"
  17860. },
  17861. {
  17862. "$ref": "#/components/schemas/SessionMessageModelSwitched"
  17863. },
  17864. {
  17865. "$ref": "#/components/schemas/SessionMessageUser"
  17866. },
  17867. {
  17868. "$ref": "#/components/schemas/SessionMessageSynthetic"
  17869. },
  17870. {
  17871. "$ref": "#/components/schemas/SessionMessageShell"
  17872. },
  17873. {
  17874. "$ref": "#/components/schemas/SessionMessageAssistant"
  17875. },
  17876. {
  17877. "$ref": "#/components/schemas/SessionMessageCompaction"
  17878. }
  17879. ]
  17880. },
  17881. "EventTuiToastShow1": {
  17882. "type": "object",
  17883. "properties": {
  17884. "id": {
  17885. "type": "string"
  17886. },
  17887. "type": {
  17888. "type": "string",
  17889. "enum": ["tui.toast.show"]
  17890. },
  17891. "properties": {
  17892. "type": "object",
  17893. "properties": {
  17894. "title": {
  17895. "type": "string"
  17896. },
  17897. "message": {
  17898. "type": "string"
  17899. },
  17900. "variant": {
  17901. "type": "string",
  17902. "enum": ["info", "success", "warning", "error"]
  17903. },
  17904. "duration": {
  17905. "type": "integer",
  17906. "exclusiveMinimum": 0
  17907. }
  17908. },
  17909. "required": ["message", "variant"],
  17910. "additionalProperties": false
  17911. }
  17912. },
  17913. "required": ["id", "type", "properties"],
  17914. "additionalProperties": false
  17915. },
  17916. "BadRequestError": {
  17917. "type": "object",
  17918. "required": ["data", "errors", "success"],
  17919. "properties": {
  17920. "data": {},
  17921. "errors": {
  17922. "type": "array",
  17923. "items": {
  17924. "type": "object",
  17925. "additionalProperties": {}
  17926. }
  17927. },
  17928. "success": {
  17929. "type": "boolean",
  17930. "enum": [false]
  17931. }
  17932. }
  17933. },
  17934. "NotFoundError": {
  17935. "type": "object",
  17936. "required": ["name", "data"],
  17937. "properties": {
  17938. "name": {
  17939. "type": "string",
  17940. "enum": ["NotFoundError"]
  17941. },
  17942. "data": {
  17943. "type": "object",
  17944. "required": ["message"],
  17945. "properties": {
  17946. "message": {
  17947. "type": "string"
  17948. }
  17949. }
  17950. }
  17951. }
  17952. }
  17953. }
  17954. },
  17955. "security": [],
  17956. "tags": [
  17957. {
  17958. "name": "control",
  17959. "description": "Control plane routes."
  17960. },
  17961. {
  17962. "name": "global",
  17963. "description": "Global server routes."
  17964. },
  17965. {
  17966. "name": "event",
  17967. "description": "Instance event stream route."
  17968. },
  17969. {
  17970. "name": "config",
  17971. "description": "Experimental HttpApi config routes."
  17972. },
  17973. {
  17974. "name": "experimental",
  17975. "description": "Experimental HttpApi read-only routes."
  17976. },
  17977. {
  17978. "name": "file",
  17979. "description": "Experimental HttpApi file routes."
  17980. },
  17981. {
  17982. "name": "instance",
  17983. "description": "Experimental HttpApi instance read routes."
  17984. },
  17985. {
  17986. "name": "mcp",
  17987. "description": "Experimental HttpApi MCP routes."
  17988. },
  17989. {
  17990. "name": "project",
  17991. "description": "Experimental HttpApi project routes."
  17992. },
  17993. {
  17994. "name": "pty",
  17995. "description": "Experimental HttpApi PTY routes."
  17996. },
  17997. {
  17998. "name": "question",
  17999. "description": "Question routes."
  18000. },
  18001. {
  18002. "name": "permission",
  18003. "description": "Experimental HttpApi permission routes."
  18004. },
  18005. {
  18006. "name": "provider",
  18007. "description": "Experimental HttpApi provider routes."
  18008. },
  18009. {
  18010. "name": "session",
  18011. "description": "Experimental HttpApi session routes."
  18012. },
  18013. {
  18014. "name": "sync",
  18015. "description": "Experimental HttpApi sync routes."
  18016. },
  18017. {
  18018. "name": "v2",
  18019. "description": "Experimental v2 routes."
  18020. },
  18021. {
  18022. "name": "v2 messages",
  18023. "description": "Experimental v2 message routes."
  18024. },
  18025. {
  18026. "name": "tui",
  18027. "description": "Experimental HttpApi TUI routes."
  18028. },
  18029. {
  18030. "name": "workspace",
  18031. "description": "Experimental HttpApi workspace routes."
  18032. },
  18033. {
  18034. "name": "pty",
  18035. "description": "PTY websocket route."
  18036. }
  18037. ]
  18038. }