openapi.json 492 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144
  1. {
  2. "openapi": "3.1.0",
  3. "info": {
  4. "title": "opencode",
  5. "version": "1.0.0",
  6. "description": "opencode api"
  7. },
  8. "paths": {
  9. "/auth/{providerID}": {
  10. "put": {
  11. "tags": ["control"],
  12. "operationId": "auth.set",
  13. "parameters": [
  14. {
  15. "name": "providerID",
  16. "in": "path",
  17. "schema": {
  18. "type": "string"
  19. },
  20. "required": true
  21. }
  22. ],
  23. "responses": {
  24. "200": {
  25. "description": "Successfully set authentication credentials",
  26. "content": {
  27. "application/json": {
  28. "schema": {
  29. "type": "boolean",
  30. "description": "Successfully set authentication credentials"
  31. }
  32. }
  33. }
  34. },
  35. "400": {
  36. "description": "Bad request",
  37. "content": {
  38. "application/json": {
  39. "schema": {
  40. "$ref": "#/components/schemas/BadRequestError"
  41. }
  42. }
  43. }
  44. }
  45. },
  46. "description": "Set authentication credentials",
  47. "summary": "Set auth credentials",
  48. "requestBody": {
  49. "content": {
  50. "application/json": {
  51. "schema": {
  52. "$ref": "#/components/schemas/Auth"
  53. }
  54. }
  55. }
  56. },
  57. "x-codeSamples": [
  58. {
  59. "lang": "js",
  60. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.auth.set({\n ...\n})"
  61. }
  62. ]
  63. },
  64. "delete": {
  65. "tags": ["control"],
  66. "operationId": "auth.remove",
  67. "parameters": [
  68. {
  69. "name": "providerID",
  70. "in": "path",
  71. "schema": {
  72. "type": "string"
  73. },
  74. "required": true
  75. }
  76. ],
  77. "responses": {
  78. "200": {
  79. "description": "Successfully removed authentication credentials",
  80. "content": {
  81. "application/json": {
  82. "schema": {
  83. "type": "boolean",
  84. "description": "Successfully removed authentication credentials"
  85. }
  86. }
  87. }
  88. },
  89. "400": {
  90. "description": "Bad request",
  91. "content": {
  92. "application/json": {
  93. "schema": {
  94. "$ref": "#/components/schemas/BadRequestError"
  95. }
  96. }
  97. }
  98. }
  99. },
  100. "description": "Remove authentication credentials",
  101. "summary": "Remove auth credentials",
  102. "x-codeSamples": [
  103. {
  104. "lang": "js",
  105. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.auth.remove({\n ...\n})"
  106. }
  107. ]
  108. }
  109. },
  110. "/log": {
  111. "post": {
  112. "tags": ["control"],
  113. "operationId": "app.log",
  114. "parameters": [
  115. {
  116. "name": "directory",
  117. "in": "query",
  118. "required": false,
  119. "schema": {
  120. "type": "string"
  121. }
  122. },
  123. {
  124. "name": "workspace",
  125. "in": "query",
  126. "required": false,
  127. "schema": {
  128. "type": "string"
  129. }
  130. }
  131. ],
  132. "responses": {
  133. "200": {
  134. "description": "Log entry written successfully",
  135. "content": {
  136. "application/json": {
  137. "schema": {
  138. "type": "boolean",
  139. "description": "Log entry written successfully"
  140. }
  141. }
  142. }
  143. },
  144. "400": {
  145. "description": "Bad request",
  146. "content": {
  147. "application/json": {
  148. "schema": {
  149. "$ref": "#/components/schemas/BadRequestError"
  150. }
  151. }
  152. }
  153. }
  154. },
  155. "description": "Write a log entry to the server logs with specified level and metadata.",
  156. "summary": "Write log",
  157. "requestBody": {
  158. "content": {
  159. "application/json": {
  160. "schema": {
  161. "type": "object",
  162. "properties": {
  163. "service": {
  164. "type": "string",
  165. "description": "Service name for the log entry"
  166. },
  167. "level": {
  168. "type": "string",
  169. "enum": ["debug", "info", "error", "warn"],
  170. "description": "Log level"
  171. },
  172. "message": {
  173. "type": "string",
  174. "description": "Log message"
  175. },
  176. "extra": {
  177. "type": "object"
  178. }
  179. },
  180. "required": ["service", "level", "message"],
  181. "additionalProperties": false
  182. }
  183. }
  184. }
  185. },
  186. "x-codeSamples": [
  187. {
  188. "lang": "js",
  189. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.app.log({\n ...\n})"
  190. }
  191. ]
  192. }
  193. },
  194. "/global/health": {
  195. "get": {
  196. "tags": ["global"],
  197. "operationId": "global.health",
  198. "parameters": [],
  199. "responses": {
  200. "200": {
  201. "description": "Health information",
  202. "content": {
  203. "application/json": {
  204. "schema": {
  205. "type": "object",
  206. "properties": {
  207. "healthy": {
  208. "type": "boolean",
  209. "enum": [true]
  210. },
  211. "version": {
  212. "type": "string"
  213. }
  214. },
  215. "required": ["healthy", "version"],
  216. "additionalProperties": false,
  217. "description": "Health information"
  218. }
  219. }
  220. }
  221. }
  222. },
  223. "description": "Get health information about the OpenCode server.",
  224. "summary": "Get health",
  225. "x-codeSamples": [
  226. {
  227. "lang": "js",
  228. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.health({\n ...\n})"
  229. }
  230. ]
  231. }
  232. },
  233. "/global/event": {
  234. "get": {
  235. "tags": ["global"],
  236. "operationId": "global.event",
  237. "parameters": [],
  238. "responses": {
  239. "200": {
  240. "description": "Event stream",
  241. "content": {
  242. "text/event-stream": {
  243. "schema": {
  244. "$ref": "#/components/schemas/GlobalEvent"
  245. }
  246. }
  247. }
  248. }
  249. },
  250. "description": "Subscribe to global events from the OpenCode system using server-sent events.",
  251. "summary": "Get global events",
  252. "x-codeSamples": [
  253. {
  254. "lang": "js",
  255. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.event({\n ...\n})"
  256. }
  257. ]
  258. }
  259. },
  260. "/global/config": {
  261. "get": {
  262. "tags": ["global"],
  263. "operationId": "global.config.get",
  264. "parameters": [],
  265. "responses": {
  266. "200": {
  267. "description": "Get global config info",
  268. "content": {
  269. "application/json": {
  270. "schema": {
  271. "$ref": "#/components/schemas/Config"
  272. }
  273. }
  274. }
  275. }
  276. },
  277. "description": "Retrieve the current global OpenCode configuration settings and preferences.",
  278. "summary": "Get global configuration",
  279. "x-codeSamples": [
  280. {
  281. "lang": "js",
  282. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.config.get({\n ...\n})"
  283. }
  284. ]
  285. },
  286. "patch": {
  287. "tags": ["global"],
  288. "operationId": "global.config.update",
  289. "parameters": [],
  290. "responses": {
  291. "200": {
  292. "description": "Successfully updated global config",
  293. "content": {
  294. "application/json": {
  295. "schema": {
  296. "$ref": "#/components/schemas/Config"
  297. }
  298. }
  299. }
  300. },
  301. "400": {
  302. "description": "Bad request",
  303. "content": {
  304. "application/json": {
  305. "schema": {
  306. "$ref": "#/components/schemas/BadRequestError"
  307. }
  308. }
  309. }
  310. }
  311. },
  312. "description": "Update global OpenCode configuration settings and preferences.",
  313. "summary": "Update global configuration",
  314. "requestBody": {
  315. "content": {
  316. "application/json": {
  317. "schema": {
  318. "$ref": "#/components/schemas/Config"
  319. }
  320. }
  321. }
  322. },
  323. "x-codeSamples": [
  324. {
  325. "lang": "js",
  326. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.config.update({\n ...\n})"
  327. }
  328. ]
  329. }
  330. },
  331. "/global/dispose": {
  332. "post": {
  333. "tags": ["global"],
  334. "operationId": "global.dispose",
  335. "parameters": [],
  336. "responses": {
  337. "200": {
  338. "description": "Global disposed",
  339. "content": {
  340. "application/json": {
  341. "schema": {
  342. "type": "boolean",
  343. "description": "Global disposed"
  344. }
  345. }
  346. }
  347. }
  348. },
  349. "description": "Clean up and dispose all OpenCode instances, releasing all resources.",
  350. "summary": "Dispose instance",
  351. "x-codeSamples": [
  352. {
  353. "lang": "js",
  354. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.dispose({\n ...\n})"
  355. }
  356. ]
  357. }
  358. },
  359. "/global/upgrade": {
  360. "post": {
  361. "tags": ["global"],
  362. "operationId": "global.upgrade",
  363. "parameters": [],
  364. "responses": {
  365. "200": {
  366. "description": "Upgrade result",
  367. "content": {
  368. "application/json": {
  369. "schema": {
  370. "anyOf": [
  371. {
  372. "type": "object",
  373. "properties": {
  374. "success": {
  375. "type": "boolean",
  376. "enum": [true]
  377. },
  378. "version": {
  379. "type": "string"
  380. }
  381. },
  382. "required": ["success", "version"],
  383. "additionalProperties": false
  384. },
  385. {
  386. "type": "object",
  387. "properties": {
  388. "success": {
  389. "type": "boolean",
  390. "enum": [false]
  391. },
  392. "error": {
  393. "type": "string"
  394. }
  395. },
  396. "required": ["success", "error"],
  397. "additionalProperties": false
  398. }
  399. ],
  400. "description": "Upgrade result"
  401. }
  402. }
  403. }
  404. },
  405. "400": {
  406. "description": "Bad request",
  407. "content": {
  408. "application/json": {
  409. "schema": {
  410. "$ref": "#/components/schemas/BadRequestError"
  411. }
  412. }
  413. }
  414. }
  415. },
  416. "description": "Upgrade opencode to the specified version or latest if not specified.",
  417. "summary": "Upgrade opencode",
  418. "requestBody": {
  419. "content": {
  420. "application/json": {
  421. "schema": {
  422. "type": "object",
  423. "properties": {
  424. "target": {
  425. "type": "string"
  426. }
  427. },
  428. "additionalProperties": false
  429. }
  430. }
  431. }
  432. },
  433. "x-codeSamples": [
  434. {
  435. "lang": "js",
  436. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.upgrade({\n ...\n})"
  437. }
  438. ]
  439. }
  440. },
  441. "/event": {
  442. "get": {
  443. "tags": ["event"],
  444. "operationId": "event.subscribe",
  445. "parameters": [
  446. {
  447. "name": "directory",
  448. "in": "query",
  449. "required": false,
  450. "schema": {
  451. "type": "string"
  452. }
  453. },
  454. {
  455. "name": "workspace",
  456. "in": "query",
  457. "required": false,
  458. "schema": {
  459. "type": "string"
  460. }
  461. }
  462. ],
  463. "responses": {
  464. "200": {
  465. "description": "Event stream",
  466. "content": {
  467. "text/event-stream": {
  468. "schema": {
  469. "$ref": "#/components/schemas/Event"
  470. }
  471. }
  472. }
  473. }
  474. },
  475. "description": "Get events",
  476. "summary": "Subscribe to events",
  477. "x-codeSamples": [
  478. {
  479. "lang": "js",
  480. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.event.subscribe({\n ...\n})"
  481. }
  482. ]
  483. }
  484. },
  485. "/config": {
  486. "get": {
  487. "tags": ["config"],
  488. "operationId": "config.get",
  489. "parameters": [
  490. {
  491. "name": "directory",
  492. "in": "query",
  493. "required": false,
  494. "schema": {
  495. "type": "string"
  496. }
  497. },
  498. {
  499. "name": "workspace",
  500. "in": "query",
  501. "required": false,
  502. "schema": {
  503. "type": "string"
  504. }
  505. }
  506. ],
  507. "responses": {
  508. "200": {
  509. "description": "Get config info",
  510. "content": {
  511. "application/json": {
  512. "schema": {
  513. "$ref": "#/components/schemas/Config"
  514. }
  515. }
  516. }
  517. }
  518. },
  519. "description": "Retrieve the current OpenCode configuration settings and preferences.",
  520. "summary": "Get configuration",
  521. "x-codeSamples": [
  522. {
  523. "lang": "js",
  524. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.config.get({\n ...\n})"
  525. }
  526. ]
  527. },
  528. "patch": {
  529. "tags": ["config"],
  530. "operationId": "config.update",
  531. "parameters": [
  532. {
  533. "name": "directory",
  534. "in": "query",
  535. "required": false,
  536. "schema": {
  537. "type": "string"
  538. }
  539. },
  540. {
  541. "name": "workspace",
  542. "in": "query",
  543. "required": false,
  544. "schema": {
  545. "type": "string"
  546. }
  547. }
  548. ],
  549. "responses": {
  550. "200": {
  551. "description": "Successfully updated config",
  552. "content": {
  553. "application/json": {
  554. "schema": {
  555. "$ref": "#/components/schemas/Config"
  556. }
  557. }
  558. }
  559. },
  560. "400": {
  561. "description": "Bad request",
  562. "content": {
  563. "application/json": {
  564. "schema": {
  565. "$ref": "#/components/schemas/BadRequestError"
  566. }
  567. }
  568. }
  569. }
  570. },
  571. "description": "Update OpenCode configuration settings and preferences.",
  572. "summary": "Update configuration",
  573. "requestBody": {
  574. "content": {
  575. "application/json": {
  576. "schema": {
  577. "$ref": "#/components/schemas/Config"
  578. }
  579. }
  580. }
  581. },
  582. "x-codeSamples": [
  583. {
  584. "lang": "js",
  585. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.config.update({\n ...\n})"
  586. }
  587. ]
  588. }
  589. },
  590. "/config/providers": {
  591. "get": {
  592. "tags": ["config"],
  593. "operationId": "config.providers",
  594. "parameters": [
  595. {
  596. "name": "directory",
  597. "in": "query",
  598. "required": false,
  599. "schema": {
  600. "type": "string"
  601. }
  602. },
  603. {
  604. "name": "workspace",
  605. "in": "query",
  606. "required": false,
  607. "schema": {
  608. "type": "string"
  609. }
  610. }
  611. ],
  612. "responses": {
  613. "200": {
  614. "description": "List of providers",
  615. "content": {
  616. "application/json": {
  617. "schema": {
  618. "type": "object",
  619. "properties": {
  620. "providers": {
  621. "type": "array",
  622. "items": {
  623. "$ref": "#/components/schemas/Provider"
  624. }
  625. },
  626. "default": {
  627. "type": "object",
  628. "additionalProperties": {
  629. "type": "string"
  630. }
  631. }
  632. },
  633. "required": ["providers", "default"],
  634. "additionalProperties": false,
  635. "description": "List of providers"
  636. }
  637. }
  638. }
  639. }
  640. },
  641. "description": "Get a list of all configured AI providers and their default models.",
  642. "summary": "List config providers",
  643. "x-codeSamples": [
  644. {
  645. "lang": "js",
  646. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.config.providers({\n ...\n})"
  647. }
  648. ]
  649. }
  650. },
  651. "/experimental/console": {
  652. "get": {
  653. "tags": ["experimental"],
  654. "operationId": "experimental.console.get",
  655. "parameters": [
  656. {
  657. "name": "directory",
  658. "in": "query",
  659. "required": false,
  660. "schema": {
  661. "type": "string"
  662. }
  663. },
  664. {
  665. "name": "workspace",
  666. "in": "query",
  667. "required": false,
  668. "schema": {
  669. "type": "string"
  670. }
  671. }
  672. ],
  673. "responses": {
  674. "200": {
  675. "description": "Active Console provider metadata",
  676. "content": {
  677. "application/json": {
  678. "schema": {
  679. "$ref": "#/components/schemas/ConsoleState"
  680. }
  681. }
  682. }
  683. }
  684. },
  685. "description": "Get the active Console org name and the set of provider IDs managed by that Console org.",
  686. "summary": "Get active Console provider metadata",
  687. "x-codeSamples": [
  688. {
  689. "lang": "js",
  690. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.console.get({\n ...\n})"
  691. }
  692. ]
  693. }
  694. },
  695. "/experimental/console/orgs": {
  696. "get": {
  697. "tags": ["experimental"],
  698. "operationId": "experimental.console.listOrgs",
  699. "parameters": [
  700. {
  701. "name": "directory",
  702. "in": "query",
  703. "required": false,
  704. "schema": {
  705. "type": "string"
  706. }
  707. },
  708. {
  709. "name": "workspace",
  710. "in": "query",
  711. "required": false,
  712. "schema": {
  713. "type": "string"
  714. }
  715. }
  716. ],
  717. "responses": {
  718. "200": {
  719. "description": "Switchable Console orgs",
  720. "content": {
  721. "application/json": {
  722. "schema": {
  723. "type": "object",
  724. "properties": {
  725. "orgs": {
  726. "type": "array",
  727. "items": {
  728. "type": "object",
  729. "properties": {
  730. "accountID": {
  731. "type": "string"
  732. },
  733. "accountEmail": {
  734. "type": "string"
  735. },
  736. "accountUrl": {
  737. "type": "string"
  738. },
  739. "orgID": {
  740. "type": "string"
  741. },
  742. "orgName": {
  743. "type": "string"
  744. },
  745. "active": {
  746. "type": "boolean"
  747. }
  748. },
  749. "required": ["accountID", "accountEmail", "accountUrl", "orgID", "orgName", "active"],
  750. "additionalProperties": false
  751. }
  752. }
  753. },
  754. "required": ["orgs"],
  755. "additionalProperties": false,
  756. "description": "Switchable Console orgs"
  757. }
  758. }
  759. }
  760. }
  761. },
  762. "description": "Get the available Console orgs across logged-in accounts, including the current active org.",
  763. "summary": "List switchable Console orgs",
  764. "x-codeSamples": [
  765. {
  766. "lang": "js",
  767. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.console.listOrgs({\n ...\n})"
  768. }
  769. ]
  770. }
  771. },
  772. "/experimental/console/switch": {
  773. "post": {
  774. "tags": ["experimental"],
  775. "operationId": "experimental.console.switchOrg",
  776. "parameters": [
  777. {
  778. "name": "directory",
  779. "in": "query",
  780. "required": false,
  781. "schema": {
  782. "type": "string"
  783. }
  784. },
  785. {
  786. "name": "workspace",
  787. "in": "query",
  788. "required": false,
  789. "schema": {
  790. "type": "string"
  791. }
  792. }
  793. ],
  794. "responses": {
  795. "200": {
  796. "description": "Switch success",
  797. "content": {
  798. "application/json": {
  799. "schema": {
  800. "type": "boolean",
  801. "description": "Switch success"
  802. }
  803. }
  804. }
  805. }
  806. },
  807. "description": "Persist a new active Console account/org selection for the current local OpenCode state.",
  808. "summary": "Switch active Console org",
  809. "requestBody": {
  810. "content": {
  811. "application/json": {
  812. "schema": {
  813. "type": "object",
  814. "properties": {
  815. "accountID": {
  816. "type": "string"
  817. },
  818. "orgID": {
  819. "type": "string"
  820. }
  821. },
  822. "required": ["accountID", "orgID"],
  823. "additionalProperties": false
  824. }
  825. }
  826. }
  827. },
  828. "x-codeSamples": [
  829. {
  830. "lang": "js",
  831. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.console.switchOrg({\n ...\n})"
  832. }
  833. ]
  834. }
  835. },
  836. "/experimental/tool": {
  837. "get": {
  838. "tags": ["experimental"],
  839. "operationId": "tool.list",
  840. "parameters": [
  841. {
  842. "name": "directory",
  843. "in": "query",
  844. "required": false,
  845. "schema": {
  846. "type": "string"
  847. }
  848. },
  849. {
  850. "name": "workspace",
  851. "in": "query",
  852. "required": false,
  853. "schema": {
  854. "type": "string"
  855. }
  856. },
  857. {
  858. "name": "provider",
  859. "in": "query",
  860. "schema": {
  861. "type": "string"
  862. },
  863. "required": true
  864. },
  865. {
  866. "name": "model",
  867. "in": "query",
  868. "schema": {
  869. "type": "string"
  870. },
  871. "required": true
  872. }
  873. ],
  874. "responses": {
  875. "200": {
  876. "description": "Tools",
  877. "content": {
  878. "application/json": {
  879. "schema": {
  880. "$ref": "#/components/schemas/ToolList"
  881. }
  882. }
  883. }
  884. },
  885. "400": {
  886. "description": "Bad request",
  887. "content": {
  888. "application/json": {
  889. "schema": {
  890. "$ref": "#/components/schemas/BadRequestError"
  891. }
  892. }
  893. }
  894. }
  895. },
  896. "description": "Get a list of available tools with their JSON schema parameters for a specific provider and model combination.",
  897. "summary": "List tools",
  898. "x-codeSamples": [
  899. {
  900. "lang": "js",
  901. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tool.list({\n ...\n})"
  902. }
  903. ]
  904. }
  905. },
  906. "/experimental/tool/ids": {
  907. "get": {
  908. "tags": ["experimental"],
  909. "operationId": "tool.ids",
  910. "parameters": [
  911. {
  912. "name": "directory",
  913. "in": "query",
  914. "required": false,
  915. "schema": {
  916. "type": "string"
  917. }
  918. },
  919. {
  920. "name": "workspace",
  921. "in": "query",
  922. "required": false,
  923. "schema": {
  924. "type": "string"
  925. }
  926. }
  927. ],
  928. "responses": {
  929. "200": {
  930. "description": "Tool IDs",
  931. "content": {
  932. "application/json": {
  933. "schema": {
  934. "$ref": "#/components/schemas/ToolIDs"
  935. }
  936. }
  937. }
  938. },
  939. "400": {
  940. "description": "Bad request",
  941. "content": {
  942. "application/json": {
  943. "schema": {
  944. "$ref": "#/components/schemas/BadRequestError"
  945. }
  946. }
  947. }
  948. }
  949. },
  950. "description": "Get a list of all available tool IDs, including both built-in tools and dynamically registered tools.",
  951. "summary": "List tool IDs",
  952. "x-codeSamples": [
  953. {
  954. "lang": "js",
  955. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tool.ids({\n ...\n})"
  956. }
  957. ]
  958. }
  959. },
  960. "/experimental/worktree": {
  961. "get": {
  962. "tags": ["experimental"],
  963. "operationId": "worktree.list",
  964. "parameters": [
  965. {
  966. "name": "directory",
  967. "in": "query",
  968. "required": false,
  969. "schema": {
  970. "type": "string"
  971. }
  972. },
  973. {
  974. "name": "workspace",
  975. "in": "query",
  976. "required": false,
  977. "schema": {
  978. "type": "string"
  979. }
  980. }
  981. ],
  982. "responses": {
  983. "200": {
  984. "description": "List of worktree directories",
  985. "content": {
  986. "application/json": {
  987. "schema": {
  988. "type": "array",
  989. "items": {
  990. "type": "string"
  991. },
  992. "description": "List of worktree directories"
  993. }
  994. }
  995. }
  996. }
  997. },
  998. "description": "List all sandbox worktrees for the current project.",
  999. "summary": "List worktrees",
  1000. "x-codeSamples": [
  1001. {
  1002. "lang": "js",
  1003. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.list({\n ...\n})"
  1004. }
  1005. ]
  1006. },
  1007. "post": {
  1008. "tags": ["experimental"],
  1009. "operationId": "worktree.create",
  1010. "parameters": [
  1011. {
  1012. "name": "directory",
  1013. "in": "query",
  1014. "required": false,
  1015. "schema": {
  1016. "type": "string"
  1017. }
  1018. },
  1019. {
  1020. "name": "workspace",
  1021. "in": "query",
  1022. "required": false,
  1023. "schema": {
  1024. "type": "string"
  1025. }
  1026. }
  1027. ],
  1028. "responses": {
  1029. "200": {
  1030. "description": "Worktree created",
  1031. "content": {
  1032. "application/json": {
  1033. "schema": {
  1034. "$ref": "#/components/schemas/Worktree"
  1035. }
  1036. }
  1037. }
  1038. },
  1039. "400": {
  1040. "description": "Bad request",
  1041. "content": {
  1042. "application/json": {
  1043. "schema": {
  1044. "$ref": "#/components/schemas/BadRequestError"
  1045. }
  1046. }
  1047. }
  1048. }
  1049. },
  1050. "description": "Create a new git worktree for the current project and run any configured startup scripts.",
  1051. "summary": "Create worktree",
  1052. "requestBody": {
  1053. "content": {
  1054. "application/json": {
  1055. "schema": {
  1056. "$ref": "#/components/schemas/WorktreeCreateInput"
  1057. }
  1058. }
  1059. }
  1060. },
  1061. "x-codeSamples": [
  1062. {
  1063. "lang": "js",
  1064. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.create({\n ...\n})"
  1065. }
  1066. ]
  1067. },
  1068. "delete": {
  1069. "tags": ["experimental"],
  1070. "operationId": "worktree.remove",
  1071. "parameters": [
  1072. {
  1073. "name": "directory",
  1074. "in": "query",
  1075. "required": false,
  1076. "schema": {
  1077. "type": "string"
  1078. }
  1079. },
  1080. {
  1081. "name": "workspace",
  1082. "in": "query",
  1083. "required": false,
  1084. "schema": {
  1085. "type": "string"
  1086. }
  1087. }
  1088. ],
  1089. "responses": {
  1090. "200": {
  1091. "description": "Worktree removed",
  1092. "content": {
  1093. "application/json": {
  1094. "schema": {
  1095. "type": "boolean",
  1096. "description": "Worktree removed"
  1097. }
  1098. }
  1099. }
  1100. },
  1101. "400": {
  1102. "description": "Bad request",
  1103. "content": {
  1104. "application/json": {
  1105. "schema": {
  1106. "$ref": "#/components/schemas/BadRequestError"
  1107. }
  1108. }
  1109. }
  1110. }
  1111. },
  1112. "description": "Remove a git worktree and delete its branch.",
  1113. "summary": "Remove worktree",
  1114. "requestBody": {
  1115. "content": {
  1116. "application/json": {
  1117. "schema": {
  1118. "$ref": "#/components/schemas/WorktreeRemoveInput"
  1119. }
  1120. }
  1121. }
  1122. },
  1123. "x-codeSamples": [
  1124. {
  1125. "lang": "js",
  1126. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.remove({\n ...\n})"
  1127. }
  1128. ]
  1129. }
  1130. },
  1131. "/experimental/worktree/reset": {
  1132. "post": {
  1133. "tags": ["experimental"],
  1134. "operationId": "worktree.reset",
  1135. "parameters": [
  1136. {
  1137. "name": "directory",
  1138. "in": "query",
  1139. "required": false,
  1140. "schema": {
  1141. "type": "string"
  1142. }
  1143. },
  1144. {
  1145. "name": "workspace",
  1146. "in": "query",
  1147. "required": false,
  1148. "schema": {
  1149. "type": "string"
  1150. }
  1151. }
  1152. ],
  1153. "responses": {
  1154. "200": {
  1155. "description": "Worktree reset",
  1156. "content": {
  1157. "application/json": {
  1158. "schema": {
  1159. "type": "boolean",
  1160. "description": "Worktree reset"
  1161. }
  1162. }
  1163. }
  1164. },
  1165. "400": {
  1166. "description": "Bad request",
  1167. "content": {
  1168. "application/json": {
  1169. "schema": {
  1170. "$ref": "#/components/schemas/BadRequestError"
  1171. }
  1172. }
  1173. }
  1174. }
  1175. },
  1176. "description": "Reset a worktree branch to the primary default branch.",
  1177. "summary": "Reset worktree",
  1178. "requestBody": {
  1179. "content": {
  1180. "application/json": {
  1181. "schema": {
  1182. "$ref": "#/components/schemas/WorktreeResetInput"
  1183. }
  1184. }
  1185. }
  1186. },
  1187. "x-codeSamples": [
  1188. {
  1189. "lang": "js",
  1190. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.reset({\n ...\n})"
  1191. }
  1192. ]
  1193. }
  1194. },
  1195. "/experimental/session": {
  1196. "get": {
  1197. "tags": ["experimental"],
  1198. "operationId": "experimental.session.list",
  1199. "parameters": [
  1200. {
  1201. "name": "directory",
  1202. "in": "query",
  1203. "required": false,
  1204. "schema": {
  1205. "type": "string"
  1206. }
  1207. },
  1208. {
  1209. "name": "workspace",
  1210. "in": "query",
  1211. "required": false,
  1212. "schema": {
  1213. "type": "string"
  1214. }
  1215. },
  1216. {
  1217. "name": "roots",
  1218. "in": "query",
  1219. "schema": {
  1220. "anyOf": [
  1221. {
  1222. "type": "boolean"
  1223. },
  1224. {
  1225. "type": "string",
  1226. "enum": ["true", "false"]
  1227. }
  1228. ]
  1229. },
  1230. "required": false
  1231. },
  1232. {
  1233. "name": "start",
  1234. "in": "query",
  1235. "schema": {
  1236. "type": "number"
  1237. },
  1238. "required": false
  1239. },
  1240. {
  1241. "name": "cursor",
  1242. "in": "query",
  1243. "schema": {
  1244. "type": "number"
  1245. },
  1246. "required": false
  1247. },
  1248. {
  1249. "name": "search",
  1250. "in": "query",
  1251. "schema": {
  1252. "type": "string"
  1253. },
  1254. "required": false
  1255. },
  1256. {
  1257. "name": "limit",
  1258. "in": "query",
  1259. "schema": {
  1260. "type": "number"
  1261. },
  1262. "required": false
  1263. },
  1264. {
  1265. "name": "archived",
  1266. "in": "query",
  1267. "schema": {
  1268. "anyOf": [
  1269. {
  1270. "type": "boolean"
  1271. },
  1272. {
  1273. "type": "string",
  1274. "enum": ["true", "false"]
  1275. }
  1276. ]
  1277. },
  1278. "required": false
  1279. }
  1280. ],
  1281. "responses": {
  1282. "200": {
  1283. "description": "List of sessions",
  1284. "content": {
  1285. "application/json": {
  1286. "schema": {
  1287. "type": "array",
  1288. "items": {
  1289. "$ref": "#/components/schemas/GlobalSession"
  1290. },
  1291. "description": "List of sessions"
  1292. }
  1293. }
  1294. }
  1295. }
  1296. },
  1297. "description": "Get a list of all OpenCode sessions across projects, sorted by most recently updated. Archived sessions are excluded by default.",
  1298. "summary": "List sessions",
  1299. "x-codeSamples": [
  1300. {
  1301. "lang": "js",
  1302. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.session.list({\n ...\n})"
  1303. }
  1304. ]
  1305. }
  1306. },
  1307. "/experimental/resource": {
  1308. "get": {
  1309. "tags": ["experimental"],
  1310. "operationId": "experimental.resource.list",
  1311. "parameters": [
  1312. {
  1313. "name": "directory",
  1314. "in": "query",
  1315. "required": false,
  1316. "schema": {
  1317. "type": "string"
  1318. }
  1319. },
  1320. {
  1321. "name": "workspace",
  1322. "in": "query",
  1323. "required": false,
  1324. "schema": {
  1325. "type": "string"
  1326. }
  1327. }
  1328. ],
  1329. "responses": {
  1330. "200": {
  1331. "description": "MCP resources",
  1332. "content": {
  1333. "application/json": {
  1334. "schema": {
  1335. "type": "object",
  1336. "additionalProperties": {
  1337. "$ref": "#/components/schemas/McpResource"
  1338. },
  1339. "description": "MCP resources"
  1340. }
  1341. }
  1342. }
  1343. }
  1344. },
  1345. "description": "Get all available MCP resources from connected servers. Optionally filter by name.",
  1346. "summary": "Get MCP resources",
  1347. "x-codeSamples": [
  1348. {
  1349. "lang": "js",
  1350. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.resource.list({\n ...\n})"
  1351. }
  1352. ]
  1353. }
  1354. },
  1355. "/find": {
  1356. "get": {
  1357. "tags": ["file"],
  1358. "operationId": "find.text",
  1359. "parameters": [
  1360. {
  1361. "name": "directory",
  1362. "in": "query",
  1363. "required": false,
  1364. "schema": {
  1365. "type": "string"
  1366. }
  1367. },
  1368. {
  1369. "name": "workspace",
  1370. "in": "query",
  1371. "required": false,
  1372. "schema": {
  1373. "type": "string"
  1374. }
  1375. },
  1376. {
  1377. "name": "pattern",
  1378. "in": "query",
  1379. "schema": {
  1380. "type": "string"
  1381. },
  1382. "required": true
  1383. }
  1384. ],
  1385. "responses": {
  1386. "200": {
  1387. "description": "Matches",
  1388. "content": {
  1389. "application/json": {
  1390. "schema": {
  1391. "type": "array",
  1392. "items": {
  1393. "type": "object",
  1394. "properties": {
  1395. "path": {
  1396. "type": "object",
  1397. "properties": {
  1398. "text": {
  1399. "type": "string"
  1400. }
  1401. },
  1402. "required": ["text"],
  1403. "additionalProperties": false
  1404. },
  1405. "lines": {
  1406. "type": "object",
  1407. "properties": {
  1408. "text": {
  1409. "type": "string"
  1410. }
  1411. },
  1412. "required": ["text"],
  1413. "additionalProperties": false
  1414. },
  1415. "line_number": {
  1416. "type": "integer",
  1417. "minimum": 0
  1418. },
  1419. "absolute_offset": {
  1420. "type": "integer",
  1421. "minimum": 0
  1422. },
  1423. "submatches": {
  1424. "type": "array",
  1425. "items": {
  1426. "type": "object",
  1427. "properties": {
  1428. "match": {
  1429. "type": "object",
  1430. "properties": {
  1431. "text": {
  1432. "type": "string"
  1433. }
  1434. },
  1435. "required": ["text"],
  1436. "additionalProperties": false
  1437. },
  1438. "start": {
  1439. "type": "integer",
  1440. "minimum": 0
  1441. },
  1442. "end": {
  1443. "type": "integer",
  1444. "minimum": 0
  1445. }
  1446. },
  1447. "required": ["match", "start", "end"],
  1448. "additionalProperties": false
  1449. }
  1450. }
  1451. },
  1452. "required": ["path", "lines", "line_number", "absolute_offset", "submatches"],
  1453. "additionalProperties": false
  1454. },
  1455. "description": "Matches"
  1456. }
  1457. }
  1458. }
  1459. }
  1460. },
  1461. "description": "Search for text patterns across files in the project using ripgrep.",
  1462. "summary": "Find text",
  1463. "x-codeSamples": [
  1464. {
  1465. "lang": "js",
  1466. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.find.text({\n ...\n})"
  1467. }
  1468. ]
  1469. }
  1470. },
  1471. "/find/file": {
  1472. "get": {
  1473. "tags": ["file"],
  1474. "operationId": "find.files",
  1475. "parameters": [
  1476. {
  1477. "name": "directory",
  1478. "in": "query",
  1479. "required": false,
  1480. "schema": {
  1481. "type": "string"
  1482. }
  1483. },
  1484. {
  1485. "name": "workspace",
  1486. "in": "query",
  1487. "required": false,
  1488. "schema": {
  1489. "type": "string"
  1490. }
  1491. },
  1492. {
  1493. "name": "query",
  1494. "in": "query",
  1495. "schema": {
  1496. "type": "string"
  1497. },
  1498. "required": true
  1499. },
  1500. {
  1501. "name": "dirs",
  1502. "in": "query",
  1503. "schema": {
  1504. "type": "string",
  1505. "enum": ["true", "false"]
  1506. },
  1507. "required": false
  1508. },
  1509. {
  1510. "name": "type",
  1511. "in": "query",
  1512. "schema": {
  1513. "type": "string",
  1514. "enum": ["file", "directory"]
  1515. },
  1516. "required": false
  1517. },
  1518. {
  1519. "name": "limit",
  1520. "in": "query",
  1521. "schema": {
  1522. "type": "integer",
  1523. "minimum": 1,
  1524. "maximum": 200
  1525. },
  1526. "required": false
  1527. }
  1528. ],
  1529. "responses": {
  1530. "200": {
  1531. "description": "File paths",
  1532. "content": {
  1533. "application/json": {
  1534. "schema": {
  1535. "type": "array",
  1536. "items": {
  1537. "type": "string"
  1538. },
  1539. "description": "File paths"
  1540. }
  1541. }
  1542. }
  1543. }
  1544. },
  1545. "description": "Search for files or directories by name or pattern in the project directory.",
  1546. "summary": "Find files",
  1547. "x-codeSamples": [
  1548. {
  1549. "lang": "js",
  1550. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.find.files({\n ...\n})"
  1551. }
  1552. ]
  1553. }
  1554. },
  1555. "/find/symbol": {
  1556. "get": {
  1557. "tags": ["file"],
  1558. "operationId": "find.symbols",
  1559. "parameters": [
  1560. {
  1561. "name": "directory",
  1562. "in": "query",
  1563. "required": false,
  1564. "schema": {
  1565. "type": "string"
  1566. }
  1567. },
  1568. {
  1569. "name": "workspace",
  1570. "in": "query",
  1571. "required": false,
  1572. "schema": {
  1573. "type": "string"
  1574. }
  1575. },
  1576. {
  1577. "name": "query",
  1578. "in": "query",
  1579. "schema": {
  1580. "type": "string"
  1581. },
  1582. "required": true
  1583. }
  1584. ],
  1585. "responses": {
  1586. "200": {
  1587. "description": "Symbols",
  1588. "content": {
  1589. "application/json": {
  1590. "schema": {
  1591. "type": "array",
  1592. "items": {
  1593. "$ref": "#/components/schemas/Symbol"
  1594. },
  1595. "description": "Symbols"
  1596. }
  1597. }
  1598. }
  1599. }
  1600. },
  1601. "description": "Search for workspace symbols like functions, classes, and variables using LSP.",
  1602. "summary": "Find symbols",
  1603. "x-codeSamples": [
  1604. {
  1605. "lang": "js",
  1606. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.find.symbols({\n ...\n})"
  1607. }
  1608. ]
  1609. }
  1610. },
  1611. "/file": {
  1612. "get": {
  1613. "tags": ["file"],
  1614. "operationId": "file.list",
  1615. "parameters": [
  1616. {
  1617. "name": "directory",
  1618. "in": "query",
  1619. "required": false,
  1620. "schema": {
  1621. "type": "string"
  1622. }
  1623. },
  1624. {
  1625. "name": "workspace",
  1626. "in": "query",
  1627. "required": false,
  1628. "schema": {
  1629. "type": "string"
  1630. }
  1631. },
  1632. {
  1633. "name": "path",
  1634. "in": "query",
  1635. "schema": {
  1636. "type": "string"
  1637. },
  1638. "required": true
  1639. }
  1640. ],
  1641. "responses": {
  1642. "200": {
  1643. "description": "Files and directories",
  1644. "content": {
  1645. "application/json": {
  1646. "schema": {
  1647. "type": "array",
  1648. "items": {
  1649. "$ref": "#/components/schemas/FileNode"
  1650. },
  1651. "description": "Files and directories"
  1652. }
  1653. }
  1654. }
  1655. }
  1656. },
  1657. "description": "List files and directories in a specified path.",
  1658. "summary": "List files",
  1659. "x-codeSamples": [
  1660. {
  1661. "lang": "js",
  1662. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.file.list({\n ...\n})"
  1663. }
  1664. ]
  1665. }
  1666. },
  1667. "/file/content": {
  1668. "get": {
  1669. "tags": ["file"],
  1670. "operationId": "file.read",
  1671. "parameters": [
  1672. {
  1673. "name": "directory",
  1674. "in": "query",
  1675. "required": false,
  1676. "schema": {
  1677. "type": "string"
  1678. }
  1679. },
  1680. {
  1681. "name": "workspace",
  1682. "in": "query",
  1683. "required": false,
  1684. "schema": {
  1685. "type": "string"
  1686. }
  1687. },
  1688. {
  1689. "name": "path",
  1690. "in": "query",
  1691. "schema": {
  1692. "type": "string"
  1693. },
  1694. "required": true
  1695. }
  1696. ],
  1697. "responses": {
  1698. "200": {
  1699. "description": "File content",
  1700. "content": {
  1701. "application/json": {
  1702. "schema": {
  1703. "$ref": "#/components/schemas/FileContent"
  1704. }
  1705. }
  1706. }
  1707. }
  1708. },
  1709. "description": "Read the content of a specified file.",
  1710. "summary": "Read file",
  1711. "x-codeSamples": [
  1712. {
  1713. "lang": "js",
  1714. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.file.read({\n ...\n})"
  1715. }
  1716. ]
  1717. }
  1718. },
  1719. "/file/status": {
  1720. "get": {
  1721. "tags": ["file"],
  1722. "operationId": "file.status",
  1723. "parameters": [
  1724. {
  1725. "name": "directory",
  1726. "in": "query",
  1727. "required": false,
  1728. "schema": {
  1729. "type": "string"
  1730. }
  1731. },
  1732. {
  1733. "name": "workspace",
  1734. "in": "query",
  1735. "required": false,
  1736. "schema": {
  1737. "type": "string"
  1738. }
  1739. }
  1740. ],
  1741. "responses": {
  1742. "200": {
  1743. "description": "File status",
  1744. "content": {
  1745. "application/json": {
  1746. "schema": {
  1747. "type": "array",
  1748. "items": {
  1749. "$ref": "#/components/schemas/File"
  1750. },
  1751. "description": "File status"
  1752. }
  1753. }
  1754. }
  1755. }
  1756. },
  1757. "description": "Get the git status of all files in the project.",
  1758. "summary": "Get file status",
  1759. "x-codeSamples": [
  1760. {
  1761. "lang": "js",
  1762. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.file.status({\n ...\n})"
  1763. }
  1764. ]
  1765. }
  1766. },
  1767. "/instance/dispose": {
  1768. "post": {
  1769. "tags": ["instance"],
  1770. "operationId": "instance.dispose",
  1771. "parameters": [
  1772. {
  1773. "name": "directory",
  1774. "in": "query",
  1775. "required": false,
  1776. "schema": {
  1777. "type": "string"
  1778. }
  1779. },
  1780. {
  1781. "name": "workspace",
  1782. "in": "query",
  1783. "required": false,
  1784. "schema": {
  1785. "type": "string"
  1786. }
  1787. }
  1788. ],
  1789. "responses": {
  1790. "200": {
  1791. "description": "Instance disposed",
  1792. "content": {
  1793. "application/json": {
  1794. "schema": {
  1795. "type": "boolean",
  1796. "description": "Instance disposed"
  1797. }
  1798. }
  1799. }
  1800. }
  1801. },
  1802. "description": "Clean up and dispose the current OpenCode instance, releasing all resources.",
  1803. "summary": "Dispose instance",
  1804. "x-codeSamples": [
  1805. {
  1806. "lang": "js",
  1807. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.instance.dispose({\n ...\n})"
  1808. }
  1809. ]
  1810. }
  1811. },
  1812. "/path": {
  1813. "get": {
  1814. "tags": ["instance"],
  1815. "operationId": "path.get",
  1816. "parameters": [
  1817. {
  1818. "name": "directory",
  1819. "in": "query",
  1820. "required": false,
  1821. "schema": {
  1822. "type": "string"
  1823. }
  1824. },
  1825. {
  1826. "name": "workspace",
  1827. "in": "query",
  1828. "required": false,
  1829. "schema": {
  1830. "type": "string"
  1831. }
  1832. }
  1833. ],
  1834. "responses": {
  1835. "200": {
  1836. "description": "Path",
  1837. "content": {
  1838. "application/json": {
  1839. "schema": {
  1840. "$ref": "#/components/schemas/Path"
  1841. }
  1842. }
  1843. }
  1844. }
  1845. },
  1846. "description": "Retrieve the current working directory and related path information for the OpenCode instance.",
  1847. "summary": "Get paths",
  1848. "x-codeSamples": [
  1849. {
  1850. "lang": "js",
  1851. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.path.get({\n ...\n})"
  1852. }
  1853. ]
  1854. }
  1855. },
  1856. "/vcs": {
  1857. "get": {
  1858. "tags": ["instance"],
  1859. "operationId": "vcs.get",
  1860. "parameters": [
  1861. {
  1862. "name": "directory",
  1863. "in": "query",
  1864. "required": false,
  1865. "schema": {
  1866. "type": "string"
  1867. }
  1868. },
  1869. {
  1870. "name": "workspace",
  1871. "in": "query",
  1872. "required": false,
  1873. "schema": {
  1874. "type": "string"
  1875. }
  1876. }
  1877. ],
  1878. "responses": {
  1879. "200": {
  1880. "description": "VCS info",
  1881. "content": {
  1882. "application/json": {
  1883. "schema": {
  1884. "$ref": "#/components/schemas/VcsInfo"
  1885. }
  1886. }
  1887. }
  1888. }
  1889. },
  1890. "description": "Retrieve version control system (VCS) information for the current project, such as git branch.",
  1891. "summary": "Get VCS info",
  1892. "x-codeSamples": [
  1893. {
  1894. "lang": "js",
  1895. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.vcs.get({\n ...\n})"
  1896. }
  1897. ]
  1898. }
  1899. },
  1900. "/vcs/diff": {
  1901. "get": {
  1902. "tags": ["instance"],
  1903. "operationId": "vcs.diff",
  1904. "parameters": [
  1905. {
  1906. "name": "directory",
  1907. "in": "query",
  1908. "required": false,
  1909. "schema": {
  1910. "type": "string"
  1911. }
  1912. },
  1913. {
  1914. "name": "workspace",
  1915. "in": "query",
  1916. "required": false,
  1917. "schema": {
  1918. "type": "string"
  1919. }
  1920. },
  1921. {
  1922. "name": "mode",
  1923. "in": "query",
  1924. "schema": {
  1925. "type": "string",
  1926. "enum": ["git", "branch"]
  1927. },
  1928. "required": true
  1929. }
  1930. ],
  1931. "responses": {
  1932. "200": {
  1933. "description": "VCS diff",
  1934. "content": {
  1935. "application/json": {
  1936. "schema": {
  1937. "type": "array",
  1938. "items": {
  1939. "$ref": "#/components/schemas/VcsFileDiff"
  1940. },
  1941. "description": "VCS diff"
  1942. }
  1943. }
  1944. }
  1945. }
  1946. },
  1947. "description": "Retrieve the current git diff for the working tree or against the default branch.",
  1948. "summary": "Get VCS diff",
  1949. "x-codeSamples": [
  1950. {
  1951. "lang": "js",
  1952. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.vcs.diff({\n ...\n})"
  1953. }
  1954. ]
  1955. }
  1956. },
  1957. "/command": {
  1958. "get": {
  1959. "tags": ["instance"],
  1960. "operationId": "command.list",
  1961. "parameters": [
  1962. {
  1963. "name": "directory",
  1964. "in": "query",
  1965. "required": false,
  1966. "schema": {
  1967. "type": "string"
  1968. }
  1969. },
  1970. {
  1971. "name": "workspace",
  1972. "in": "query",
  1973. "required": false,
  1974. "schema": {
  1975. "type": "string"
  1976. }
  1977. }
  1978. ],
  1979. "responses": {
  1980. "200": {
  1981. "description": "List of commands",
  1982. "content": {
  1983. "application/json": {
  1984. "schema": {
  1985. "type": "array",
  1986. "items": {
  1987. "$ref": "#/components/schemas/Command"
  1988. },
  1989. "description": "List of commands"
  1990. }
  1991. }
  1992. }
  1993. }
  1994. },
  1995. "description": "Get a list of all available commands in the OpenCode system.",
  1996. "summary": "List commands",
  1997. "x-codeSamples": [
  1998. {
  1999. "lang": "js",
  2000. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.command.list({\n ...\n})"
  2001. }
  2002. ]
  2003. }
  2004. },
  2005. "/agent": {
  2006. "get": {
  2007. "tags": ["instance"],
  2008. "operationId": "app.agents",
  2009. "parameters": [
  2010. {
  2011. "name": "directory",
  2012. "in": "query",
  2013. "required": false,
  2014. "schema": {
  2015. "type": "string"
  2016. }
  2017. },
  2018. {
  2019. "name": "workspace",
  2020. "in": "query",
  2021. "required": false,
  2022. "schema": {
  2023. "type": "string"
  2024. }
  2025. }
  2026. ],
  2027. "responses": {
  2028. "200": {
  2029. "description": "List of agents",
  2030. "content": {
  2031. "application/json": {
  2032. "schema": {
  2033. "type": "array",
  2034. "items": {
  2035. "$ref": "#/components/schemas/Agent"
  2036. },
  2037. "description": "List of agents"
  2038. }
  2039. }
  2040. }
  2041. }
  2042. },
  2043. "description": "Get a list of all available AI agents in the OpenCode system.",
  2044. "summary": "List agents",
  2045. "x-codeSamples": [
  2046. {
  2047. "lang": "js",
  2048. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.app.agents({\n ...\n})"
  2049. }
  2050. ]
  2051. }
  2052. },
  2053. "/skill": {
  2054. "get": {
  2055. "tags": ["instance"],
  2056. "operationId": "app.skills",
  2057. "parameters": [
  2058. {
  2059. "name": "directory",
  2060. "in": "query",
  2061. "required": false,
  2062. "schema": {
  2063. "type": "string"
  2064. }
  2065. },
  2066. {
  2067. "name": "workspace",
  2068. "in": "query",
  2069. "required": false,
  2070. "schema": {
  2071. "type": "string"
  2072. }
  2073. }
  2074. ],
  2075. "responses": {
  2076. "200": {
  2077. "description": "List of skills",
  2078. "content": {
  2079. "application/json": {
  2080. "schema": {
  2081. "type": "array",
  2082. "items": {
  2083. "type": "object",
  2084. "properties": {
  2085. "name": {
  2086. "type": "string"
  2087. },
  2088. "description": {
  2089. "type": "string"
  2090. },
  2091. "location": {
  2092. "type": "string"
  2093. },
  2094. "content": {
  2095. "type": "string"
  2096. }
  2097. },
  2098. "required": ["name", "description", "location", "content"],
  2099. "additionalProperties": false
  2100. },
  2101. "description": "List of skills"
  2102. }
  2103. }
  2104. }
  2105. }
  2106. },
  2107. "description": "Get a list of all available skills in the OpenCode system.",
  2108. "summary": "List skills",
  2109. "x-codeSamples": [
  2110. {
  2111. "lang": "js",
  2112. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.app.skills({\n ...\n})"
  2113. }
  2114. ]
  2115. }
  2116. },
  2117. "/lsp": {
  2118. "get": {
  2119. "tags": ["instance"],
  2120. "operationId": "lsp.status",
  2121. "parameters": [
  2122. {
  2123. "name": "directory",
  2124. "in": "query",
  2125. "required": false,
  2126. "schema": {
  2127. "type": "string"
  2128. }
  2129. },
  2130. {
  2131. "name": "workspace",
  2132. "in": "query",
  2133. "required": false,
  2134. "schema": {
  2135. "type": "string"
  2136. }
  2137. }
  2138. ],
  2139. "responses": {
  2140. "200": {
  2141. "description": "LSP server status",
  2142. "content": {
  2143. "application/json": {
  2144. "schema": {
  2145. "type": "array",
  2146. "items": {
  2147. "$ref": "#/components/schemas/LSPStatus"
  2148. },
  2149. "description": "LSP server status"
  2150. }
  2151. }
  2152. }
  2153. }
  2154. },
  2155. "description": "Get LSP server status",
  2156. "summary": "Get LSP status",
  2157. "x-codeSamples": [
  2158. {
  2159. "lang": "js",
  2160. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.lsp.status({\n ...\n})"
  2161. }
  2162. ]
  2163. }
  2164. },
  2165. "/formatter": {
  2166. "get": {
  2167. "tags": ["instance"],
  2168. "operationId": "formatter.status",
  2169. "parameters": [
  2170. {
  2171. "name": "directory",
  2172. "in": "query",
  2173. "required": false,
  2174. "schema": {
  2175. "type": "string"
  2176. }
  2177. },
  2178. {
  2179. "name": "workspace",
  2180. "in": "query",
  2181. "required": false,
  2182. "schema": {
  2183. "type": "string"
  2184. }
  2185. }
  2186. ],
  2187. "responses": {
  2188. "200": {
  2189. "description": "Formatter status",
  2190. "content": {
  2191. "application/json": {
  2192. "schema": {
  2193. "type": "array",
  2194. "items": {
  2195. "$ref": "#/components/schemas/FormatterStatus"
  2196. },
  2197. "description": "Formatter status"
  2198. }
  2199. }
  2200. }
  2201. }
  2202. },
  2203. "description": "Get formatter status",
  2204. "summary": "Get formatter status",
  2205. "x-codeSamples": [
  2206. {
  2207. "lang": "js",
  2208. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.formatter.status({\n ...\n})"
  2209. }
  2210. ]
  2211. }
  2212. },
  2213. "/mcp": {
  2214. "get": {
  2215. "tags": ["mcp"],
  2216. "operationId": "mcp.status",
  2217. "parameters": [
  2218. {
  2219. "name": "directory",
  2220. "in": "query",
  2221. "required": false,
  2222. "schema": {
  2223. "type": "string"
  2224. }
  2225. },
  2226. {
  2227. "name": "workspace",
  2228. "in": "query",
  2229. "required": false,
  2230. "schema": {
  2231. "type": "string"
  2232. }
  2233. }
  2234. ],
  2235. "responses": {
  2236. "200": {
  2237. "description": "MCP server status",
  2238. "content": {
  2239. "application/json": {
  2240. "schema": {
  2241. "type": "object",
  2242. "additionalProperties": {
  2243. "$ref": "#/components/schemas/MCPStatus"
  2244. },
  2245. "description": "MCP server status"
  2246. }
  2247. }
  2248. }
  2249. }
  2250. },
  2251. "description": "Get the status of all Model Context Protocol (MCP) servers.",
  2252. "summary": "Get MCP status",
  2253. "x-codeSamples": [
  2254. {
  2255. "lang": "js",
  2256. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.status({\n ...\n})"
  2257. }
  2258. ]
  2259. },
  2260. "post": {
  2261. "tags": ["mcp"],
  2262. "operationId": "mcp.add",
  2263. "parameters": [
  2264. {
  2265. "name": "directory",
  2266. "in": "query",
  2267. "required": false,
  2268. "schema": {
  2269. "type": "string"
  2270. }
  2271. },
  2272. {
  2273. "name": "workspace",
  2274. "in": "query",
  2275. "required": false,
  2276. "schema": {
  2277. "type": "string"
  2278. }
  2279. }
  2280. ],
  2281. "responses": {
  2282. "200": {
  2283. "description": "MCP server added successfully",
  2284. "content": {
  2285. "application/json": {
  2286. "schema": {
  2287. "type": "object",
  2288. "additionalProperties": {
  2289. "$ref": "#/components/schemas/MCPStatus"
  2290. },
  2291. "description": "MCP server added successfully"
  2292. }
  2293. }
  2294. }
  2295. },
  2296. "400": {
  2297. "description": "Bad request",
  2298. "content": {
  2299. "application/json": {
  2300. "schema": {
  2301. "$ref": "#/components/schemas/BadRequestError"
  2302. }
  2303. }
  2304. }
  2305. }
  2306. },
  2307. "description": "Dynamically add a new Model Context Protocol (MCP) server to the system.",
  2308. "summary": "Add MCP server",
  2309. "requestBody": {
  2310. "content": {
  2311. "application/json": {
  2312. "schema": {
  2313. "type": "object",
  2314. "properties": {
  2315. "name": {
  2316. "type": "string"
  2317. },
  2318. "config": {
  2319. "anyOf": [
  2320. {
  2321. "$ref": "#/components/schemas/McpLocalConfig"
  2322. },
  2323. {
  2324. "$ref": "#/components/schemas/McpRemoteConfig"
  2325. }
  2326. ]
  2327. }
  2328. },
  2329. "required": ["name", "config"],
  2330. "additionalProperties": false
  2331. }
  2332. }
  2333. }
  2334. },
  2335. "x-codeSamples": [
  2336. {
  2337. "lang": "js",
  2338. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.add({\n ...\n})"
  2339. }
  2340. ]
  2341. }
  2342. },
  2343. "/mcp/{name}/auth": {
  2344. "post": {
  2345. "tags": ["mcp"],
  2346. "operationId": "mcp.auth.start",
  2347. "parameters": [
  2348. {
  2349. "name": "directory",
  2350. "in": "query",
  2351. "required": false,
  2352. "schema": {
  2353. "type": "string"
  2354. }
  2355. },
  2356. {
  2357. "name": "workspace",
  2358. "in": "query",
  2359. "required": false,
  2360. "schema": {
  2361. "type": "string"
  2362. }
  2363. },
  2364. {
  2365. "name": "name",
  2366. "in": "path",
  2367. "schema": {
  2368. "type": "string"
  2369. },
  2370. "required": true
  2371. }
  2372. ],
  2373. "responses": {
  2374. "200": {
  2375. "description": "OAuth flow started",
  2376. "content": {
  2377. "application/json": {
  2378. "schema": {
  2379. "type": "object",
  2380. "properties": {
  2381. "authorizationUrl": {
  2382. "type": "string"
  2383. },
  2384. "oauthState": {
  2385. "type": "string"
  2386. }
  2387. },
  2388. "required": ["authorizationUrl", "oauthState"],
  2389. "additionalProperties": false,
  2390. "description": "OAuth flow started"
  2391. }
  2392. }
  2393. }
  2394. },
  2395. "400": {
  2396. "description": "McpUnsupportedOAuthError",
  2397. "content": {
  2398. "application/json": {
  2399. "schema": {
  2400. "$ref": "#/components/schemas/McpUnsupportedOAuthError"
  2401. }
  2402. }
  2403. }
  2404. },
  2405. "404": {
  2406. "description": "Not found",
  2407. "content": {
  2408. "application/json": {
  2409. "schema": {
  2410. "$ref": "#/components/schemas/NotFoundError"
  2411. }
  2412. }
  2413. }
  2414. }
  2415. },
  2416. "description": "Start OAuth authentication flow for a Model Context Protocol (MCP) server.",
  2417. "summary": "Start MCP OAuth",
  2418. "x-codeSamples": [
  2419. {
  2420. "lang": "js",
  2421. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.start({\n ...\n})"
  2422. }
  2423. ]
  2424. },
  2425. "delete": {
  2426. "tags": ["mcp"],
  2427. "operationId": "mcp.auth.remove",
  2428. "parameters": [
  2429. {
  2430. "name": "directory",
  2431. "in": "query",
  2432. "required": false,
  2433. "schema": {
  2434. "type": "string"
  2435. }
  2436. },
  2437. {
  2438. "name": "workspace",
  2439. "in": "query",
  2440. "required": false,
  2441. "schema": {
  2442. "type": "string"
  2443. }
  2444. },
  2445. {
  2446. "name": "name",
  2447. "in": "path",
  2448. "schema": {
  2449. "type": "string"
  2450. },
  2451. "required": true
  2452. }
  2453. ],
  2454. "responses": {
  2455. "200": {
  2456. "description": "OAuth credentials removed",
  2457. "content": {
  2458. "application/json": {
  2459. "schema": {
  2460. "type": "object",
  2461. "properties": {
  2462. "success": {
  2463. "type": "boolean",
  2464. "enum": [true]
  2465. }
  2466. },
  2467. "required": ["success"],
  2468. "additionalProperties": false,
  2469. "description": "OAuth credentials removed"
  2470. }
  2471. }
  2472. }
  2473. },
  2474. "404": {
  2475. "description": "Not found",
  2476. "content": {
  2477. "application/json": {
  2478. "schema": {
  2479. "$ref": "#/components/schemas/NotFoundError"
  2480. }
  2481. }
  2482. }
  2483. }
  2484. },
  2485. "description": "Remove OAuth credentials for an MCP server.",
  2486. "summary": "Remove MCP OAuth",
  2487. "x-codeSamples": [
  2488. {
  2489. "lang": "js",
  2490. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.remove({\n ...\n})"
  2491. }
  2492. ]
  2493. }
  2494. },
  2495. "/mcp/{name}/auth/callback": {
  2496. "post": {
  2497. "tags": ["mcp"],
  2498. "operationId": "mcp.auth.callback",
  2499. "parameters": [
  2500. {
  2501. "name": "directory",
  2502. "in": "query",
  2503. "required": false,
  2504. "schema": {
  2505. "type": "string"
  2506. }
  2507. },
  2508. {
  2509. "name": "workspace",
  2510. "in": "query",
  2511. "required": false,
  2512. "schema": {
  2513. "type": "string"
  2514. }
  2515. },
  2516. {
  2517. "name": "name",
  2518. "in": "path",
  2519. "schema": {
  2520. "type": "string"
  2521. },
  2522. "required": true
  2523. }
  2524. ],
  2525. "responses": {
  2526. "200": {
  2527. "description": "OAuth authentication completed",
  2528. "content": {
  2529. "application/json": {
  2530. "schema": {
  2531. "$ref": "#/components/schemas/MCPStatus"
  2532. }
  2533. }
  2534. }
  2535. },
  2536. "400": {
  2537. "description": "Bad request",
  2538. "content": {
  2539. "application/json": {
  2540. "schema": {
  2541. "$ref": "#/components/schemas/BadRequestError"
  2542. }
  2543. }
  2544. }
  2545. },
  2546. "404": {
  2547. "description": "Not found",
  2548. "content": {
  2549. "application/json": {
  2550. "schema": {
  2551. "$ref": "#/components/schemas/NotFoundError"
  2552. }
  2553. }
  2554. }
  2555. }
  2556. },
  2557. "description": "Complete OAuth authentication for a Model Context Protocol (MCP) server using the authorization code.",
  2558. "summary": "Complete MCP OAuth",
  2559. "requestBody": {
  2560. "content": {
  2561. "application/json": {
  2562. "schema": {
  2563. "type": "object",
  2564. "properties": {
  2565. "code": {
  2566. "type": "string"
  2567. }
  2568. },
  2569. "required": ["code"],
  2570. "additionalProperties": false
  2571. }
  2572. }
  2573. }
  2574. },
  2575. "x-codeSamples": [
  2576. {
  2577. "lang": "js",
  2578. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.callback({\n ...\n})"
  2579. }
  2580. ]
  2581. }
  2582. },
  2583. "/mcp/{name}/auth/authenticate": {
  2584. "post": {
  2585. "tags": ["mcp"],
  2586. "operationId": "mcp.auth.authenticate",
  2587. "parameters": [
  2588. {
  2589. "name": "directory",
  2590. "in": "query",
  2591. "required": false,
  2592. "schema": {
  2593. "type": "string"
  2594. }
  2595. },
  2596. {
  2597. "name": "workspace",
  2598. "in": "query",
  2599. "required": false,
  2600. "schema": {
  2601. "type": "string"
  2602. }
  2603. },
  2604. {
  2605. "name": "name",
  2606. "in": "path",
  2607. "schema": {
  2608. "type": "string"
  2609. },
  2610. "required": true
  2611. }
  2612. ],
  2613. "responses": {
  2614. "200": {
  2615. "description": "OAuth authentication completed",
  2616. "content": {
  2617. "application/json": {
  2618. "schema": {
  2619. "$ref": "#/components/schemas/MCPStatus"
  2620. }
  2621. }
  2622. }
  2623. },
  2624. "400": {
  2625. "description": "McpUnsupportedOAuthError",
  2626. "content": {
  2627. "application/json": {
  2628. "schema": {
  2629. "$ref": "#/components/schemas/McpUnsupportedOAuthError"
  2630. }
  2631. }
  2632. }
  2633. },
  2634. "404": {
  2635. "description": "Not found",
  2636. "content": {
  2637. "application/json": {
  2638. "schema": {
  2639. "$ref": "#/components/schemas/NotFoundError"
  2640. }
  2641. }
  2642. }
  2643. }
  2644. },
  2645. "description": "Start OAuth flow and wait for callback (opens browser).",
  2646. "summary": "Authenticate MCP OAuth",
  2647. "x-codeSamples": [
  2648. {
  2649. "lang": "js",
  2650. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.authenticate({\n ...\n})"
  2651. }
  2652. ]
  2653. }
  2654. },
  2655. "/mcp/{name}/connect": {
  2656. "post": {
  2657. "tags": ["mcp"],
  2658. "operationId": "mcp.connect",
  2659. "parameters": [
  2660. {
  2661. "name": "directory",
  2662. "in": "query",
  2663. "required": false,
  2664. "schema": {
  2665. "type": "string"
  2666. }
  2667. },
  2668. {
  2669. "name": "workspace",
  2670. "in": "query",
  2671. "required": false,
  2672. "schema": {
  2673. "type": "string"
  2674. }
  2675. },
  2676. {
  2677. "name": "name",
  2678. "in": "path",
  2679. "schema": {
  2680. "type": "string"
  2681. },
  2682. "required": true
  2683. }
  2684. ],
  2685. "responses": {
  2686. "200": {
  2687. "description": "MCP server connected successfully",
  2688. "content": {
  2689. "application/json": {
  2690. "schema": {
  2691. "type": "boolean",
  2692. "description": "MCP server connected successfully"
  2693. }
  2694. }
  2695. }
  2696. }
  2697. },
  2698. "description": "Connect an MCP server.",
  2699. "x-codeSamples": [
  2700. {
  2701. "lang": "js",
  2702. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.connect({\n ...\n})"
  2703. }
  2704. ]
  2705. }
  2706. },
  2707. "/mcp/{name}/disconnect": {
  2708. "post": {
  2709. "tags": ["mcp"],
  2710. "operationId": "mcp.disconnect",
  2711. "parameters": [
  2712. {
  2713. "name": "directory",
  2714. "in": "query",
  2715. "required": false,
  2716. "schema": {
  2717. "type": "string"
  2718. }
  2719. },
  2720. {
  2721. "name": "workspace",
  2722. "in": "query",
  2723. "required": false,
  2724. "schema": {
  2725. "type": "string"
  2726. }
  2727. },
  2728. {
  2729. "name": "name",
  2730. "in": "path",
  2731. "schema": {
  2732. "type": "string"
  2733. },
  2734. "required": true
  2735. }
  2736. ],
  2737. "responses": {
  2738. "200": {
  2739. "description": "MCP server disconnected successfully",
  2740. "content": {
  2741. "application/json": {
  2742. "schema": {
  2743. "type": "boolean",
  2744. "description": "MCP server disconnected successfully"
  2745. }
  2746. }
  2747. }
  2748. }
  2749. },
  2750. "description": "Disconnect an MCP server.",
  2751. "x-codeSamples": [
  2752. {
  2753. "lang": "js",
  2754. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.disconnect({\n ...\n})"
  2755. }
  2756. ]
  2757. }
  2758. },
  2759. "/project": {
  2760. "get": {
  2761. "tags": ["project"],
  2762. "operationId": "project.list",
  2763. "parameters": [
  2764. {
  2765. "name": "directory",
  2766. "in": "query",
  2767. "required": false,
  2768. "schema": {
  2769. "type": "string"
  2770. }
  2771. },
  2772. {
  2773. "name": "workspace",
  2774. "in": "query",
  2775. "required": false,
  2776. "schema": {
  2777. "type": "string"
  2778. }
  2779. }
  2780. ],
  2781. "responses": {
  2782. "200": {
  2783. "description": "List of projects",
  2784. "content": {
  2785. "application/json": {
  2786. "schema": {
  2787. "type": "array",
  2788. "items": {
  2789. "$ref": "#/components/schemas/Project"
  2790. },
  2791. "description": "List of projects"
  2792. }
  2793. }
  2794. }
  2795. }
  2796. },
  2797. "description": "Get a list of projects that have been opened with OpenCode.",
  2798. "summary": "List all projects",
  2799. "x-codeSamples": [
  2800. {
  2801. "lang": "js",
  2802. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.list({\n ...\n})"
  2803. }
  2804. ]
  2805. }
  2806. },
  2807. "/project/current": {
  2808. "get": {
  2809. "tags": ["project"],
  2810. "operationId": "project.current",
  2811. "parameters": [
  2812. {
  2813. "name": "directory",
  2814. "in": "query",
  2815. "required": false,
  2816. "schema": {
  2817. "type": "string"
  2818. }
  2819. },
  2820. {
  2821. "name": "workspace",
  2822. "in": "query",
  2823. "required": false,
  2824. "schema": {
  2825. "type": "string"
  2826. }
  2827. }
  2828. ],
  2829. "responses": {
  2830. "200": {
  2831. "description": "Current project information",
  2832. "content": {
  2833. "application/json": {
  2834. "schema": {
  2835. "$ref": "#/components/schemas/Project"
  2836. }
  2837. }
  2838. }
  2839. }
  2840. },
  2841. "description": "Retrieve the currently active project that OpenCode is working with.",
  2842. "summary": "Get current project",
  2843. "x-codeSamples": [
  2844. {
  2845. "lang": "js",
  2846. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.current({\n ...\n})"
  2847. }
  2848. ]
  2849. }
  2850. },
  2851. "/project/git/init": {
  2852. "post": {
  2853. "tags": ["project"],
  2854. "operationId": "project.initGit",
  2855. "parameters": [
  2856. {
  2857. "name": "directory",
  2858. "in": "query",
  2859. "required": false,
  2860. "schema": {
  2861. "type": "string"
  2862. }
  2863. },
  2864. {
  2865. "name": "workspace",
  2866. "in": "query",
  2867. "required": false,
  2868. "schema": {
  2869. "type": "string"
  2870. }
  2871. }
  2872. ],
  2873. "responses": {
  2874. "200": {
  2875. "description": "Project information after git initialization",
  2876. "content": {
  2877. "application/json": {
  2878. "schema": {
  2879. "$ref": "#/components/schemas/Project"
  2880. }
  2881. }
  2882. }
  2883. }
  2884. },
  2885. "description": "Create a git repository for the current project and return the refreshed project info.",
  2886. "summary": "Initialize git repository",
  2887. "x-codeSamples": [
  2888. {
  2889. "lang": "js",
  2890. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.initGit({\n ...\n})"
  2891. }
  2892. ]
  2893. }
  2894. },
  2895. "/project/{projectID}": {
  2896. "patch": {
  2897. "tags": ["project"],
  2898. "operationId": "project.update",
  2899. "parameters": [
  2900. {
  2901. "name": "directory",
  2902. "in": "query",
  2903. "required": false,
  2904. "schema": {
  2905. "type": "string"
  2906. }
  2907. },
  2908. {
  2909. "name": "workspace",
  2910. "in": "query",
  2911. "required": false,
  2912. "schema": {
  2913. "type": "string"
  2914. }
  2915. },
  2916. {
  2917. "name": "projectID",
  2918. "in": "path",
  2919. "schema": {
  2920. "type": "string"
  2921. },
  2922. "required": true
  2923. }
  2924. ],
  2925. "responses": {
  2926. "200": {
  2927. "description": "Updated project information",
  2928. "content": {
  2929. "application/json": {
  2930. "schema": {
  2931. "$ref": "#/components/schemas/Project"
  2932. }
  2933. }
  2934. }
  2935. },
  2936. "400": {
  2937. "description": "Bad request",
  2938. "content": {
  2939. "application/json": {
  2940. "schema": {
  2941. "$ref": "#/components/schemas/BadRequestError"
  2942. }
  2943. }
  2944. }
  2945. },
  2946. "404": {
  2947. "description": "Not found",
  2948. "content": {
  2949. "application/json": {
  2950. "schema": {
  2951. "$ref": "#/components/schemas/NotFoundError"
  2952. }
  2953. }
  2954. }
  2955. }
  2956. },
  2957. "description": "Update project properties such as name, icon, and commands.",
  2958. "summary": "Update project",
  2959. "requestBody": {
  2960. "content": {
  2961. "application/json": {
  2962. "schema": {
  2963. "type": "object",
  2964. "properties": {
  2965. "name": {
  2966. "type": "string"
  2967. },
  2968. "icon": {
  2969. "type": "object",
  2970. "properties": {
  2971. "url": {
  2972. "type": "string"
  2973. },
  2974. "override": {
  2975. "type": "string"
  2976. },
  2977. "color": {
  2978. "type": "string"
  2979. }
  2980. },
  2981. "additionalProperties": false
  2982. },
  2983. "commands": {
  2984. "type": "object",
  2985. "properties": {
  2986. "start": {
  2987. "type": "string",
  2988. "description": "Startup script to run when creating a new workspace (worktree)"
  2989. }
  2990. },
  2991. "additionalProperties": false
  2992. }
  2993. },
  2994. "additionalProperties": false
  2995. }
  2996. }
  2997. }
  2998. },
  2999. "x-codeSamples": [
  3000. {
  3001. "lang": "js",
  3002. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.update({\n ...\n})"
  3003. }
  3004. ]
  3005. }
  3006. },
  3007. "/pty/shells": {
  3008. "get": {
  3009. "tags": ["pty"],
  3010. "operationId": "pty.shells",
  3011. "parameters": [
  3012. {
  3013. "name": "directory",
  3014. "in": "query",
  3015. "required": false,
  3016. "schema": {
  3017. "type": "string"
  3018. }
  3019. },
  3020. {
  3021. "name": "workspace",
  3022. "in": "query",
  3023. "required": false,
  3024. "schema": {
  3025. "type": "string"
  3026. }
  3027. }
  3028. ],
  3029. "responses": {
  3030. "200": {
  3031. "description": "List of shells",
  3032. "content": {
  3033. "application/json": {
  3034. "schema": {
  3035. "type": "array",
  3036. "items": {
  3037. "type": "object",
  3038. "properties": {
  3039. "path": {
  3040. "type": "string"
  3041. },
  3042. "name": {
  3043. "type": "string"
  3044. },
  3045. "acceptable": {
  3046. "type": "boolean"
  3047. }
  3048. },
  3049. "required": ["path", "name", "acceptable"],
  3050. "additionalProperties": false
  3051. },
  3052. "description": "List of shells"
  3053. }
  3054. }
  3055. }
  3056. }
  3057. },
  3058. "description": "Get a list of available shells on the system.",
  3059. "summary": "List available shells",
  3060. "x-codeSamples": [
  3061. {
  3062. "lang": "js",
  3063. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.shells({\n ...\n})"
  3064. }
  3065. ]
  3066. }
  3067. },
  3068. "/pty": {
  3069. "get": {
  3070. "tags": ["pty"],
  3071. "operationId": "pty.list",
  3072. "parameters": [
  3073. {
  3074. "name": "directory",
  3075. "in": "query",
  3076. "required": false,
  3077. "schema": {
  3078. "type": "string"
  3079. }
  3080. },
  3081. {
  3082. "name": "workspace",
  3083. "in": "query",
  3084. "required": false,
  3085. "schema": {
  3086. "type": "string"
  3087. }
  3088. }
  3089. ],
  3090. "responses": {
  3091. "200": {
  3092. "description": "List of sessions",
  3093. "content": {
  3094. "application/json": {
  3095. "schema": {
  3096. "type": "array",
  3097. "items": {
  3098. "$ref": "#/components/schemas/Pty"
  3099. },
  3100. "description": "List of sessions"
  3101. }
  3102. }
  3103. }
  3104. }
  3105. },
  3106. "description": "Get a list of all active pseudo-terminal (PTY) sessions managed by OpenCode.",
  3107. "summary": "List PTY sessions",
  3108. "x-codeSamples": [
  3109. {
  3110. "lang": "js",
  3111. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.list({\n ...\n})"
  3112. }
  3113. ]
  3114. },
  3115. "post": {
  3116. "tags": ["pty"],
  3117. "operationId": "pty.create",
  3118. "parameters": [
  3119. {
  3120. "name": "directory",
  3121. "in": "query",
  3122. "required": false,
  3123. "schema": {
  3124. "type": "string"
  3125. }
  3126. },
  3127. {
  3128. "name": "workspace",
  3129. "in": "query",
  3130. "required": false,
  3131. "schema": {
  3132. "type": "string"
  3133. }
  3134. }
  3135. ],
  3136. "responses": {
  3137. "200": {
  3138. "description": "Created session",
  3139. "content": {
  3140. "application/json": {
  3141. "schema": {
  3142. "$ref": "#/components/schemas/Pty"
  3143. }
  3144. }
  3145. }
  3146. },
  3147. "400": {
  3148. "description": "Bad request",
  3149. "content": {
  3150. "application/json": {
  3151. "schema": {
  3152. "$ref": "#/components/schemas/BadRequestError"
  3153. }
  3154. }
  3155. }
  3156. }
  3157. },
  3158. "description": "Create a new pseudo-terminal (PTY) session for running shell commands and processes.",
  3159. "summary": "Create PTY session",
  3160. "requestBody": {
  3161. "content": {
  3162. "application/json": {
  3163. "schema": {
  3164. "type": "object",
  3165. "properties": {
  3166. "command": {
  3167. "type": "string"
  3168. },
  3169. "args": {
  3170. "type": "array",
  3171. "items": {
  3172. "type": "string"
  3173. }
  3174. },
  3175. "cwd": {
  3176. "type": "string"
  3177. },
  3178. "title": {
  3179. "type": "string"
  3180. },
  3181. "env": {
  3182. "type": "object",
  3183. "additionalProperties": {
  3184. "type": "string"
  3185. }
  3186. }
  3187. },
  3188. "additionalProperties": false
  3189. }
  3190. }
  3191. }
  3192. },
  3193. "x-codeSamples": [
  3194. {
  3195. "lang": "js",
  3196. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.create({\n ...\n})"
  3197. }
  3198. ]
  3199. }
  3200. },
  3201. "/pty/{ptyID}": {
  3202. "get": {
  3203. "tags": ["pty"],
  3204. "operationId": "pty.get",
  3205. "parameters": [
  3206. {
  3207. "name": "directory",
  3208. "in": "query",
  3209. "required": false,
  3210. "schema": {
  3211. "type": "string"
  3212. }
  3213. },
  3214. {
  3215. "name": "workspace",
  3216. "in": "query",
  3217. "required": false,
  3218. "schema": {
  3219. "type": "string"
  3220. }
  3221. },
  3222. {
  3223. "name": "ptyID",
  3224. "in": "path",
  3225. "schema": {
  3226. "type": "string",
  3227. "pattern": "^pty.*"
  3228. },
  3229. "required": true
  3230. }
  3231. ],
  3232. "responses": {
  3233. "200": {
  3234. "description": "Session info",
  3235. "content": {
  3236. "application/json": {
  3237. "schema": {
  3238. "$ref": "#/components/schemas/Pty"
  3239. }
  3240. }
  3241. }
  3242. },
  3243. "404": {
  3244. "description": "Not found",
  3245. "content": {
  3246. "application/json": {
  3247. "schema": {
  3248. "$ref": "#/components/schemas/NotFoundError"
  3249. }
  3250. }
  3251. }
  3252. }
  3253. },
  3254. "description": "Retrieve detailed information about a specific pseudo-terminal (PTY) session.",
  3255. "summary": "Get PTY session",
  3256. "x-codeSamples": [
  3257. {
  3258. "lang": "js",
  3259. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.get({\n ...\n})"
  3260. }
  3261. ]
  3262. },
  3263. "put": {
  3264. "tags": ["pty"],
  3265. "operationId": "pty.update",
  3266. "parameters": [
  3267. {
  3268. "name": "directory",
  3269. "in": "query",
  3270. "required": false,
  3271. "schema": {
  3272. "type": "string"
  3273. }
  3274. },
  3275. {
  3276. "name": "workspace",
  3277. "in": "query",
  3278. "required": false,
  3279. "schema": {
  3280. "type": "string"
  3281. }
  3282. },
  3283. {
  3284. "name": "ptyID",
  3285. "in": "path",
  3286. "schema": {
  3287. "type": "string",
  3288. "pattern": "^pty.*"
  3289. },
  3290. "required": true
  3291. }
  3292. ],
  3293. "responses": {
  3294. "200": {
  3295. "description": "Updated session",
  3296. "content": {
  3297. "application/json": {
  3298. "schema": {
  3299. "$ref": "#/components/schemas/Pty"
  3300. }
  3301. }
  3302. }
  3303. },
  3304. "400": {
  3305. "description": "Bad request",
  3306. "content": {
  3307. "application/json": {
  3308. "schema": {
  3309. "$ref": "#/components/schemas/BadRequestError"
  3310. }
  3311. }
  3312. }
  3313. }
  3314. },
  3315. "description": "Update properties of an existing pseudo-terminal (PTY) session.",
  3316. "summary": "Update PTY session",
  3317. "requestBody": {
  3318. "content": {
  3319. "application/json": {
  3320. "schema": {
  3321. "type": "object",
  3322. "properties": {
  3323. "title": {
  3324. "type": "string"
  3325. },
  3326. "size": {
  3327. "type": "object",
  3328. "properties": {
  3329. "rows": {
  3330. "type": "integer",
  3331. "exclusiveMinimum": 0
  3332. },
  3333. "cols": {
  3334. "type": "integer",
  3335. "exclusiveMinimum": 0
  3336. }
  3337. },
  3338. "required": ["rows", "cols"],
  3339. "additionalProperties": false
  3340. }
  3341. },
  3342. "additionalProperties": false
  3343. }
  3344. }
  3345. }
  3346. },
  3347. "x-codeSamples": [
  3348. {
  3349. "lang": "js",
  3350. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.update({\n ...\n})"
  3351. }
  3352. ]
  3353. },
  3354. "delete": {
  3355. "tags": ["pty"],
  3356. "operationId": "pty.remove",
  3357. "parameters": [
  3358. {
  3359. "name": "directory",
  3360. "in": "query",
  3361. "required": false,
  3362. "schema": {
  3363. "type": "string"
  3364. }
  3365. },
  3366. {
  3367. "name": "workspace",
  3368. "in": "query",
  3369. "required": false,
  3370. "schema": {
  3371. "type": "string"
  3372. }
  3373. },
  3374. {
  3375. "name": "ptyID",
  3376. "in": "path",
  3377. "schema": {
  3378. "type": "string",
  3379. "pattern": "^pty.*"
  3380. },
  3381. "required": true
  3382. }
  3383. ],
  3384. "responses": {
  3385. "200": {
  3386. "description": "Session removed",
  3387. "content": {
  3388. "application/json": {
  3389. "schema": {
  3390. "type": "boolean",
  3391. "description": "Session removed"
  3392. }
  3393. }
  3394. }
  3395. },
  3396. "404": {
  3397. "description": "Not found",
  3398. "content": {
  3399. "application/json": {
  3400. "schema": {
  3401. "$ref": "#/components/schemas/NotFoundError"
  3402. }
  3403. }
  3404. }
  3405. }
  3406. },
  3407. "description": "Remove and terminate a specific pseudo-terminal (PTY) session.",
  3408. "summary": "Remove PTY session",
  3409. "x-codeSamples": [
  3410. {
  3411. "lang": "js",
  3412. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.remove({\n ...\n})"
  3413. }
  3414. ]
  3415. }
  3416. },
  3417. "/pty/{ptyID}/connect-token": {
  3418. "post": {
  3419. "tags": ["pty"],
  3420. "operationId": "pty.connectToken",
  3421. "parameters": [
  3422. {
  3423. "name": "directory",
  3424. "in": "query",
  3425. "required": false,
  3426. "schema": {
  3427. "type": "string"
  3428. }
  3429. },
  3430. {
  3431. "name": "workspace",
  3432. "in": "query",
  3433. "required": false,
  3434. "schema": {
  3435. "type": "string"
  3436. }
  3437. },
  3438. {
  3439. "name": "ptyID",
  3440. "in": "path",
  3441. "schema": {
  3442. "type": "string",
  3443. "pattern": "^pty.*"
  3444. },
  3445. "required": true
  3446. }
  3447. ],
  3448. "responses": {
  3449. "200": {
  3450. "description": "WebSocket connect token",
  3451. "content": {
  3452. "application/json": {
  3453. "schema": {
  3454. "type": "object",
  3455. "properties": {
  3456. "ticket": {
  3457. "type": "string"
  3458. },
  3459. "expires_in": {
  3460. "type": "integer",
  3461. "exclusiveMinimum": 0
  3462. }
  3463. },
  3464. "required": ["ticket", "expires_in"],
  3465. "additionalProperties": false,
  3466. "description": "WebSocket connect token"
  3467. }
  3468. }
  3469. }
  3470. },
  3471. "403": {
  3472. "description": "Forbidden",
  3473. "content": {
  3474. "application/json": {
  3475. "schema": {
  3476. "$ref": "#/components/schemas/effect_HttpApiError_Forbidden"
  3477. }
  3478. }
  3479. }
  3480. },
  3481. "404": {
  3482. "description": "Not found",
  3483. "content": {
  3484. "application/json": {
  3485. "schema": {
  3486. "$ref": "#/components/schemas/NotFoundError"
  3487. }
  3488. }
  3489. }
  3490. }
  3491. },
  3492. "description": "Create a short-lived ticket for opening a PTY WebSocket connection.",
  3493. "summary": "Create PTY WebSocket token",
  3494. "x-codeSamples": [
  3495. {
  3496. "lang": "js",
  3497. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.connectToken({\n ...\n})"
  3498. }
  3499. ]
  3500. }
  3501. },
  3502. "/question": {
  3503. "get": {
  3504. "tags": ["question"],
  3505. "operationId": "question.list",
  3506. "parameters": [
  3507. {
  3508. "name": "directory",
  3509. "in": "query",
  3510. "required": false,
  3511. "schema": {
  3512. "type": "string"
  3513. }
  3514. },
  3515. {
  3516. "name": "workspace",
  3517. "in": "query",
  3518. "required": false,
  3519. "schema": {
  3520. "type": "string"
  3521. }
  3522. }
  3523. ],
  3524. "responses": {
  3525. "200": {
  3526. "description": "List of pending questions",
  3527. "content": {
  3528. "application/json": {
  3529. "schema": {
  3530. "type": "array",
  3531. "items": {
  3532. "$ref": "#/components/schemas/QuestionRequest"
  3533. },
  3534. "description": "List of pending questions"
  3535. }
  3536. }
  3537. }
  3538. }
  3539. },
  3540. "description": "Get all pending question requests across all sessions.",
  3541. "summary": "List pending questions",
  3542. "x-codeSamples": [
  3543. {
  3544. "lang": "js",
  3545. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.question.list({\n ...\n})"
  3546. }
  3547. ]
  3548. }
  3549. },
  3550. "/question/{requestID}/reply": {
  3551. "post": {
  3552. "tags": ["question"],
  3553. "operationId": "question.reply",
  3554. "parameters": [
  3555. {
  3556. "name": "directory",
  3557. "in": "query",
  3558. "required": false,
  3559. "schema": {
  3560. "type": "string"
  3561. }
  3562. },
  3563. {
  3564. "name": "workspace",
  3565. "in": "query",
  3566. "required": false,
  3567. "schema": {
  3568. "type": "string"
  3569. }
  3570. },
  3571. {
  3572. "name": "requestID",
  3573. "in": "path",
  3574. "schema": {
  3575. "type": "string",
  3576. "pattern": "^que.*"
  3577. },
  3578. "required": true
  3579. }
  3580. ],
  3581. "responses": {
  3582. "200": {
  3583. "description": "Question answered successfully",
  3584. "content": {
  3585. "application/json": {
  3586. "schema": {
  3587. "type": "boolean",
  3588. "description": "Question answered successfully"
  3589. }
  3590. }
  3591. }
  3592. },
  3593. "400": {
  3594. "description": "Bad request",
  3595. "content": {
  3596. "application/json": {
  3597. "schema": {
  3598. "$ref": "#/components/schemas/BadRequestError"
  3599. }
  3600. }
  3601. }
  3602. },
  3603. "404": {
  3604. "description": "Not found",
  3605. "content": {
  3606. "application/json": {
  3607. "schema": {
  3608. "$ref": "#/components/schemas/NotFoundError"
  3609. }
  3610. }
  3611. }
  3612. }
  3613. },
  3614. "description": "Provide answers to a question request from the AI assistant.",
  3615. "summary": "Reply to question request",
  3616. "requestBody": {
  3617. "content": {
  3618. "application/json": {
  3619. "schema": {
  3620. "type": "object",
  3621. "properties": {
  3622. "answers": {
  3623. "type": "array",
  3624. "items": {
  3625. "$ref": "#/components/schemas/QuestionAnswer"
  3626. },
  3627. "description": "User answers in order of questions (each answer is an array of selected labels)"
  3628. }
  3629. },
  3630. "required": ["answers"],
  3631. "additionalProperties": false
  3632. }
  3633. }
  3634. }
  3635. },
  3636. "x-codeSamples": [
  3637. {
  3638. "lang": "js",
  3639. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.question.reply({\n ...\n})"
  3640. }
  3641. ]
  3642. }
  3643. },
  3644. "/question/{requestID}/reject": {
  3645. "post": {
  3646. "tags": ["question"],
  3647. "operationId": "question.reject",
  3648. "parameters": [
  3649. {
  3650. "name": "directory",
  3651. "in": "query",
  3652. "required": false,
  3653. "schema": {
  3654. "type": "string"
  3655. }
  3656. },
  3657. {
  3658. "name": "workspace",
  3659. "in": "query",
  3660. "required": false,
  3661. "schema": {
  3662. "type": "string"
  3663. }
  3664. },
  3665. {
  3666. "name": "requestID",
  3667. "in": "path",
  3668. "schema": {
  3669. "type": "string",
  3670. "pattern": "^que.*"
  3671. },
  3672. "required": true
  3673. }
  3674. ],
  3675. "responses": {
  3676. "200": {
  3677. "description": "Question rejected successfully",
  3678. "content": {
  3679. "application/json": {
  3680. "schema": {
  3681. "type": "boolean",
  3682. "description": "Question rejected successfully"
  3683. }
  3684. }
  3685. }
  3686. },
  3687. "400": {
  3688. "description": "Bad request",
  3689. "content": {
  3690. "application/json": {
  3691. "schema": {
  3692. "$ref": "#/components/schemas/BadRequestError"
  3693. }
  3694. }
  3695. }
  3696. },
  3697. "404": {
  3698. "description": "Not found",
  3699. "content": {
  3700. "application/json": {
  3701. "schema": {
  3702. "$ref": "#/components/schemas/NotFoundError"
  3703. }
  3704. }
  3705. }
  3706. }
  3707. },
  3708. "description": "Reject a question request from the AI assistant.",
  3709. "summary": "Reject question request",
  3710. "x-codeSamples": [
  3711. {
  3712. "lang": "js",
  3713. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.question.reject({\n ...\n})"
  3714. }
  3715. ]
  3716. }
  3717. },
  3718. "/permission": {
  3719. "get": {
  3720. "tags": ["permission"],
  3721. "operationId": "permission.list",
  3722. "parameters": [
  3723. {
  3724. "name": "directory",
  3725. "in": "query",
  3726. "required": false,
  3727. "schema": {
  3728. "type": "string"
  3729. }
  3730. },
  3731. {
  3732. "name": "workspace",
  3733. "in": "query",
  3734. "required": false,
  3735. "schema": {
  3736. "type": "string"
  3737. }
  3738. }
  3739. ],
  3740. "responses": {
  3741. "200": {
  3742. "description": "List of pending permissions",
  3743. "content": {
  3744. "application/json": {
  3745. "schema": {
  3746. "type": "array",
  3747. "items": {
  3748. "$ref": "#/components/schemas/PermissionRequest"
  3749. },
  3750. "description": "List of pending permissions"
  3751. }
  3752. }
  3753. }
  3754. }
  3755. },
  3756. "description": "Get all pending permission requests across all sessions.",
  3757. "summary": "List pending permissions",
  3758. "x-codeSamples": [
  3759. {
  3760. "lang": "js",
  3761. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.permission.list({\n ...\n})"
  3762. }
  3763. ]
  3764. }
  3765. },
  3766. "/permission/{requestID}/reply": {
  3767. "post": {
  3768. "tags": ["permission"],
  3769. "operationId": "permission.reply",
  3770. "parameters": [
  3771. {
  3772. "name": "directory",
  3773. "in": "query",
  3774. "required": false,
  3775. "schema": {
  3776. "type": "string"
  3777. }
  3778. },
  3779. {
  3780. "name": "workspace",
  3781. "in": "query",
  3782. "required": false,
  3783. "schema": {
  3784. "type": "string"
  3785. }
  3786. },
  3787. {
  3788. "name": "requestID",
  3789. "in": "path",
  3790. "schema": {
  3791. "type": "string",
  3792. "pattern": "^per.*"
  3793. },
  3794. "required": true
  3795. }
  3796. ],
  3797. "responses": {
  3798. "200": {
  3799. "description": "Permission processed successfully",
  3800. "content": {
  3801. "application/json": {
  3802. "schema": {
  3803. "type": "boolean",
  3804. "description": "Permission processed successfully"
  3805. }
  3806. }
  3807. }
  3808. },
  3809. "400": {
  3810. "description": "Bad request",
  3811. "content": {
  3812. "application/json": {
  3813. "schema": {
  3814. "$ref": "#/components/schemas/BadRequestError"
  3815. }
  3816. }
  3817. }
  3818. },
  3819. "404": {
  3820. "description": "Not found",
  3821. "content": {
  3822. "application/json": {
  3823. "schema": {
  3824. "$ref": "#/components/schemas/NotFoundError"
  3825. }
  3826. }
  3827. }
  3828. }
  3829. },
  3830. "description": "Approve or deny a permission request from the AI assistant.",
  3831. "summary": "Respond to permission request",
  3832. "requestBody": {
  3833. "content": {
  3834. "application/json": {
  3835. "schema": {
  3836. "type": "object",
  3837. "properties": {
  3838. "reply": {
  3839. "type": "string",
  3840. "enum": ["once", "always", "reject"]
  3841. },
  3842. "message": {
  3843. "type": "string"
  3844. }
  3845. },
  3846. "required": ["reply"],
  3847. "additionalProperties": false
  3848. }
  3849. }
  3850. }
  3851. },
  3852. "x-codeSamples": [
  3853. {
  3854. "lang": "js",
  3855. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.permission.reply({\n ...\n})"
  3856. }
  3857. ]
  3858. }
  3859. },
  3860. "/provider": {
  3861. "get": {
  3862. "tags": ["provider"],
  3863. "operationId": "provider.list",
  3864. "parameters": [
  3865. {
  3866. "name": "directory",
  3867. "in": "query",
  3868. "required": false,
  3869. "schema": {
  3870. "type": "string"
  3871. }
  3872. },
  3873. {
  3874. "name": "workspace",
  3875. "in": "query",
  3876. "required": false,
  3877. "schema": {
  3878. "type": "string"
  3879. }
  3880. }
  3881. ],
  3882. "responses": {
  3883. "200": {
  3884. "description": "List of providers",
  3885. "content": {
  3886. "application/json": {
  3887. "schema": {
  3888. "type": "object",
  3889. "properties": {
  3890. "all": {
  3891. "type": "array",
  3892. "items": {
  3893. "$ref": "#/components/schemas/Provider"
  3894. }
  3895. },
  3896. "default": {
  3897. "type": "object",
  3898. "additionalProperties": {
  3899. "type": "string"
  3900. }
  3901. },
  3902. "connected": {
  3903. "type": "array",
  3904. "items": {
  3905. "type": "string"
  3906. }
  3907. }
  3908. },
  3909. "required": ["all", "default", "connected"],
  3910. "additionalProperties": false,
  3911. "description": "List of providers"
  3912. }
  3913. }
  3914. }
  3915. }
  3916. },
  3917. "description": "Get a list of all available AI providers, including both available and connected ones.",
  3918. "summary": "List providers",
  3919. "x-codeSamples": [
  3920. {
  3921. "lang": "js",
  3922. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.list({\n ...\n})"
  3923. }
  3924. ]
  3925. }
  3926. },
  3927. "/provider/auth": {
  3928. "get": {
  3929. "tags": ["provider"],
  3930. "operationId": "provider.auth",
  3931. "parameters": [
  3932. {
  3933. "name": "directory",
  3934. "in": "query",
  3935. "required": false,
  3936. "schema": {
  3937. "type": "string"
  3938. }
  3939. },
  3940. {
  3941. "name": "workspace",
  3942. "in": "query",
  3943. "required": false,
  3944. "schema": {
  3945. "type": "string"
  3946. }
  3947. }
  3948. ],
  3949. "responses": {
  3950. "200": {
  3951. "description": "Provider auth methods",
  3952. "content": {
  3953. "application/json": {
  3954. "schema": {
  3955. "type": "object",
  3956. "additionalProperties": {
  3957. "type": "array",
  3958. "items": {
  3959. "$ref": "#/components/schemas/ProviderAuthMethod"
  3960. }
  3961. },
  3962. "description": "Provider auth methods"
  3963. }
  3964. }
  3965. }
  3966. }
  3967. },
  3968. "description": "Retrieve available authentication methods for all AI providers.",
  3969. "summary": "Get provider auth methods",
  3970. "x-codeSamples": [
  3971. {
  3972. "lang": "js",
  3973. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.auth({\n ...\n})"
  3974. }
  3975. ]
  3976. }
  3977. },
  3978. "/provider/{providerID}/oauth/authorize": {
  3979. "post": {
  3980. "tags": ["provider"],
  3981. "operationId": "provider.oauth.authorize",
  3982. "parameters": [
  3983. {
  3984. "name": "directory",
  3985. "in": "query",
  3986. "required": false,
  3987. "schema": {
  3988. "type": "string"
  3989. }
  3990. },
  3991. {
  3992. "name": "workspace",
  3993. "in": "query",
  3994. "required": false,
  3995. "schema": {
  3996. "type": "string"
  3997. }
  3998. },
  3999. {
  4000. "name": "providerID",
  4001. "in": "path",
  4002. "schema": {
  4003. "type": "string"
  4004. },
  4005. "required": true
  4006. }
  4007. ],
  4008. "responses": {
  4009. "200": {
  4010. "description": "Authorization URL and method",
  4011. "content": {
  4012. "application/json": {
  4013. "schema": {
  4014. "$ref": "#/components/schemas/ProviderAuthAuthorization"
  4015. }
  4016. }
  4017. }
  4018. },
  4019. "400": {
  4020. "description": "Bad request",
  4021. "content": {
  4022. "application/json": {
  4023. "schema": {
  4024. "$ref": "#/components/schemas/BadRequestError"
  4025. }
  4026. }
  4027. }
  4028. }
  4029. },
  4030. "description": "Start the OAuth authorization flow for a provider.",
  4031. "summary": "Start OAuth authorization",
  4032. "requestBody": {
  4033. "content": {
  4034. "application/json": {
  4035. "schema": {
  4036. "type": "object",
  4037. "properties": {
  4038. "method": {
  4039. "type": "number",
  4040. "description": "Auth method index"
  4041. },
  4042. "inputs": {
  4043. "type": "object",
  4044. "additionalProperties": {
  4045. "type": "string"
  4046. }
  4047. }
  4048. },
  4049. "required": ["method"],
  4050. "additionalProperties": false
  4051. }
  4052. }
  4053. }
  4054. },
  4055. "x-codeSamples": [
  4056. {
  4057. "lang": "js",
  4058. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.oauth.authorize({\n ...\n})"
  4059. }
  4060. ]
  4061. }
  4062. },
  4063. "/provider/{providerID}/oauth/callback": {
  4064. "post": {
  4065. "tags": ["provider"],
  4066. "operationId": "provider.oauth.callback",
  4067. "parameters": [
  4068. {
  4069. "name": "directory",
  4070. "in": "query",
  4071. "required": false,
  4072. "schema": {
  4073. "type": "string"
  4074. }
  4075. },
  4076. {
  4077. "name": "workspace",
  4078. "in": "query",
  4079. "required": false,
  4080. "schema": {
  4081. "type": "string"
  4082. }
  4083. },
  4084. {
  4085. "name": "providerID",
  4086. "in": "path",
  4087. "schema": {
  4088. "type": "string"
  4089. },
  4090. "required": true
  4091. }
  4092. ],
  4093. "responses": {
  4094. "200": {
  4095. "description": "OAuth callback processed successfully",
  4096. "content": {
  4097. "application/json": {
  4098. "schema": {
  4099. "type": "boolean",
  4100. "description": "OAuth callback processed successfully"
  4101. }
  4102. }
  4103. }
  4104. },
  4105. "400": {
  4106. "description": "Bad request",
  4107. "content": {
  4108. "application/json": {
  4109. "schema": {
  4110. "$ref": "#/components/schemas/BadRequestError"
  4111. }
  4112. }
  4113. }
  4114. }
  4115. },
  4116. "description": "Handle the OAuth callback from a provider after user authorization.",
  4117. "summary": "Handle OAuth callback",
  4118. "requestBody": {
  4119. "content": {
  4120. "application/json": {
  4121. "schema": {
  4122. "type": "object",
  4123. "properties": {
  4124. "method": {
  4125. "type": "number",
  4126. "description": "Auth method index"
  4127. },
  4128. "code": {
  4129. "type": "string"
  4130. }
  4131. },
  4132. "required": ["method"],
  4133. "additionalProperties": false
  4134. }
  4135. }
  4136. }
  4137. },
  4138. "x-codeSamples": [
  4139. {
  4140. "lang": "js",
  4141. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.oauth.callback({\n ...\n})"
  4142. }
  4143. ]
  4144. }
  4145. },
  4146. "/session": {
  4147. "get": {
  4148. "tags": ["session"],
  4149. "operationId": "session.list",
  4150. "parameters": [
  4151. {
  4152. "name": "directory",
  4153. "in": "query",
  4154. "required": false,
  4155. "schema": {
  4156. "type": "string"
  4157. }
  4158. },
  4159. {
  4160. "name": "workspace",
  4161. "in": "query",
  4162. "required": false,
  4163. "schema": {
  4164. "type": "string"
  4165. }
  4166. },
  4167. {
  4168. "name": "scope",
  4169. "in": "query",
  4170. "schema": {
  4171. "type": "string",
  4172. "enum": ["project"]
  4173. },
  4174. "required": false
  4175. },
  4176. {
  4177. "name": "path",
  4178. "in": "query",
  4179. "schema": {
  4180. "type": "string"
  4181. },
  4182. "required": false
  4183. },
  4184. {
  4185. "name": "roots",
  4186. "in": "query",
  4187. "schema": {
  4188. "anyOf": [
  4189. {
  4190. "type": "boolean"
  4191. },
  4192. {
  4193. "type": "string",
  4194. "enum": ["true", "false"]
  4195. }
  4196. ]
  4197. },
  4198. "required": false
  4199. },
  4200. {
  4201. "name": "start",
  4202. "in": "query",
  4203. "schema": {
  4204. "type": "number"
  4205. },
  4206. "required": false
  4207. },
  4208. {
  4209. "name": "search",
  4210. "in": "query",
  4211. "schema": {
  4212. "type": "string"
  4213. },
  4214. "required": false
  4215. },
  4216. {
  4217. "name": "limit",
  4218. "in": "query",
  4219. "schema": {
  4220. "type": "number"
  4221. },
  4222. "required": false
  4223. }
  4224. ],
  4225. "responses": {
  4226. "200": {
  4227. "description": "List of sessions",
  4228. "content": {
  4229. "application/json": {
  4230. "schema": {
  4231. "type": "array",
  4232. "items": {
  4233. "$ref": "#/components/schemas/Session"
  4234. },
  4235. "description": "List of sessions"
  4236. }
  4237. }
  4238. }
  4239. }
  4240. },
  4241. "description": "Get a list of all OpenCode sessions, sorted by most recently updated.",
  4242. "summary": "List sessions",
  4243. "x-codeSamples": [
  4244. {
  4245. "lang": "js",
  4246. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.list({\n ...\n})"
  4247. }
  4248. ]
  4249. },
  4250. "post": {
  4251. "tags": ["session"],
  4252. "operationId": "session.create",
  4253. "parameters": [
  4254. {
  4255. "name": "directory",
  4256. "in": "query",
  4257. "required": false,
  4258. "schema": {
  4259. "type": "string"
  4260. }
  4261. },
  4262. {
  4263. "name": "workspace",
  4264. "in": "query",
  4265. "required": false,
  4266. "schema": {
  4267. "type": "string"
  4268. }
  4269. }
  4270. ],
  4271. "responses": {
  4272. "200": {
  4273. "description": "Successfully created session",
  4274. "content": {
  4275. "application/json": {
  4276. "schema": {
  4277. "$ref": "#/components/schemas/Session"
  4278. }
  4279. }
  4280. }
  4281. },
  4282. "400": {
  4283. "description": "Bad request",
  4284. "content": {
  4285. "application/json": {
  4286. "schema": {
  4287. "$ref": "#/components/schemas/BadRequestError"
  4288. }
  4289. }
  4290. }
  4291. }
  4292. },
  4293. "description": "Create a new OpenCode session for interacting with AI assistants and managing conversations.",
  4294. "summary": "Create session",
  4295. "requestBody": {
  4296. "content": {
  4297. "application/json": {
  4298. "schema": {
  4299. "type": "object",
  4300. "properties": {
  4301. "parentID": {
  4302. "type": "string"
  4303. },
  4304. "title": {
  4305. "type": "string"
  4306. },
  4307. "agent": {
  4308. "type": "string"
  4309. },
  4310. "model": {
  4311. "type": "object",
  4312. "properties": {
  4313. "id": {
  4314. "type": "string"
  4315. },
  4316. "providerID": {
  4317. "type": "string"
  4318. },
  4319. "variant": {
  4320. "type": "string"
  4321. }
  4322. },
  4323. "required": ["id", "providerID"],
  4324. "additionalProperties": false
  4325. },
  4326. "permission": {
  4327. "$ref": "#/components/schemas/PermissionRuleset"
  4328. },
  4329. "workspaceID": {
  4330. "type": "string"
  4331. }
  4332. },
  4333. "additionalProperties": false
  4334. }
  4335. }
  4336. }
  4337. },
  4338. "x-codeSamples": [
  4339. {
  4340. "lang": "js",
  4341. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.create({\n ...\n})"
  4342. }
  4343. ]
  4344. }
  4345. },
  4346. "/session/status": {
  4347. "get": {
  4348. "tags": ["session"],
  4349. "operationId": "session.status",
  4350. "parameters": [
  4351. {
  4352. "name": "directory",
  4353. "in": "query",
  4354. "required": false,
  4355. "schema": {
  4356. "type": "string"
  4357. }
  4358. },
  4359. {
  4360. "name": "workspace",
  4361. "in": "query",
  4362. "required": false,
  4363. "schema": {
  4364. "type": "string"
  4365. }
  4366. }
  4367. ],
  4368. "responses": {
  4369. "200": {
  4370. "description": "Get session status",
  4371. "content": {
  4372. "application/json": {
  4373. "schema": {
  4374. "type": "object",
  4375. "additionalProperties": {
  4376. "$ref": "#/components/schemas/SessionStatus"
  4377. },
  4378. "description": "Get session status"
  4379. }
  4380. }
  4381. }
  4382. },
  4383. "400": {
  4384. "description": "Bad request",
  4385. "content": {
  4386. "application/json": {
  4387. "schema": {
  4388. "$ref": "#/components/schemas/BadRequestError"
  4389. }
  4390. }
  4391. }
  4392. }
  4393. },
  4394. "description": "Retrieve the current status of all sessions, including active, idle, and completed states.",
  4395. "summary": "Get session status",
  4396. "x-codeSamples": [
  4397. {
  4398. "lang": "js",
  4399. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.status({\n ...\n})"
  4400. }
  4401. ]
  4402. }
  4403. },
  4404. "/session/{sessionID}": {
  4405. "get": {
  4406. "tags": ["session"],
  4407. "operationId": "session.get",
  4408. "parameters": [
  4409. {
  4410. "name": "directory",
  4411. "in": "query",
  4412. "required": false,
  4413. "schema": {
  4414. "type": "string"
  4415. }
  4416. },
  4417. {
  4418. "name": "workspace",
  4419. "in": "query",
  4420. "required": false,
  4421. "schema": {
  4422. "type": "string"
  4423. }
  4424. },
  4425. {
  4426. "name": "sessionID",
  4427. "in": "path",
  4428. "schema": {
  4429. "type": "string",
  4430. "pattern": "^ses.*"
  4431. },
  4432. "required": true
  4433. }
  4434. ],
  4435. "responses": {
  4436. "200": {
  4437. "description": "Get session",
  4438. "content": {
  4439. "application/json": {
  4440. "schema": {
  4441. "$ref": "#/components/schemas/Session"
  4442. }
  4443. }
  4444. }
  4445. },
  4446. "400": {
  4447. "description": "Bad request",
  4448. "content": {
  4449. "application/json": {
  4450. "schema": {
  4451. "$ref": "#/components/schemas/BadRequestError"
  4452. }
  4453. }
  4454. }
  4455. },
  4456. "404": {
  4457. "description": "Not found",
  4458. "content": {
  4459. "application/json": {
  4460. "schema": {
  4461. "$ref": "#/components/schemas/NotFoundError"
  4462. }
  4463. }
  4464. }
  4465. }
  4466. },
  4467. "description": "Retrieve detailed information about a specific OpenCode session.",
  4468. "summary": "Get session",
  4469. "x-codeSamples": [
  4470. {
  4471. "lang": "js",
  4472. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.get({\n ...\n})"
  4473. }
  4474. ]
  4475. },
  4476. "delete": {
  4477. "tags": ["session"],
  4478. "operationId": "session.delete",
  4479. "parameters": [
  4480. {
  4481. "name": "directory",
  4482. "in": "query",
  4483. "required": false,
  4484. "schema": {
  4485. "type": "string"
  4486. }
  4487. },
  4488. {
  4489. "name": "workspace",
  4490. "in": "query",
  4491. "required": false,
  4492. "schema": {
  4493. "type": "string"
  4494. }
  4495. },
  4496. {
  4497. "name": "sessionID",
  4498. "in": "path",
  4499. "schema": {
  4500. "type": "string",
  4501. "pattern": "^ses.*"
  4502. },
  4503. "required": true
  4504. }
  4505. ],
  4506. "responses": {
  4507. "200": {
  4508. "description": "Successfully deleted session",
  4509. "content": {
  4510. "application/json": {
  4511. "schema": {
  4512. "type": "boolean",
  4513. "description": "Successfully deleted session"
  4514. }
  4515. }
  4516. }
  4517. },
  4518. "400": {
  4519. "description": "Bad request",
  4520. "content": {
  4521. "application/json": {
  4522. "schema": {
  4523. "$ref": "#/components/schemas/BadRequestError"
  4524. }
  4525. }
  4526. }
  4527. },
  4528. "404": {
  4529. "description": "Not found",
  4530. "content": {
  4531. "application/json": {
  4532. "schema": {
  4533. "$ref": "#/components/schemas/NotFoundError"
  4534. }
  4535. }
  4536. }
  4537. }
  4538. },
  4539. "description": "Delete a session and permanently remove all associated data, including messages and history.",
  4540. "summary": "Delete session",
  4541. "x-codeSamples": [
  4542. {
  4543. "lang": "js",
  4544. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.delete({\n ...\n})"
  4545. }
  4546. ]
  4547. },
  4548. "patch": {
  4549. "tags": ["session"],
  4550. "operationId": "session.update",
  4551. "parameters": [
  4552. {
  4553. "name": "directory",
  4554. "in": "query",
  4555. "required": false,
  4556. "schema": {
  4557. "type": "string"
  4558. }
  4559. },
  4560. {
  4561. "name": "workspace",
  4562. "in": "query",
  4563. "required": false,
  4564. "schema": {
  4565. "type": "string"
  4566. }
  4567. },
  4568. {
  4569. "name": "sessionID",
  4570. "in": "path",
  4571. "schema": {
  4572. "type": "string",
  4573. "pattern": "^ses.*"
  4574. },
  4575. "required": true
  4576. }
  4577. ],
  4578. "responses": {
  4579. "200": {
  4580. "description": "Successfully updated session",
  4581. "content": {
  4582. "application/json": {
  4583. "schema": {
  4584. "$ref": "#/components/schemas/Session"
  4585. }
  4586. }
  4587. }
  4588. },
  4589. "400": {
  4590. "description": "Bad request",
  4591. "content": {
  4592. "application/json": {
  4593. "schema": {
  4594. "$ref": "#/components/schemas/BadRequestError"
  4595. }
  4596. }
  4597. }
  4598. },
  4599. "404": {
  4600. "description": "Not found",
  4601. "content": {
  4602. "application/json": {
  4603. "schema": {
  4604. "$ref": "#/components/schemas/NotFoundError"
  4605. }
  4606. }
  4607. }
  4608. }
  4609. },
  4610. "description": "Update properties of an existing session, such as title or other metadata.",
  4611. "summary": "Update session",
  4612. "requestBody": {
  4613. "content": {
  4614. "application/json": {
  4615. "schema": {
  4616. "type": "object",
  4617. "properties": {
  4618. "title": {
  4619. "type": "string"
  4620. },
  4621. "permission": {
  4622. "$ref": "#/components/schemas/PermissionRuleset"
  4623. },
  4624. "time": {
  4625. "type": "object",
  4626. "properties": {
  4627. "archived": {
  4628. "type": "number"
  4629. }
  4630. },
  4631. "additionalProperties": false
  4632. }
  4633. },
  4634. "additionalProperties": false
  4635. }
  4636. }
  4637. }
  4638. },
  4639. "x-codeSamples": [
  4640. {
  4641. "lang": "js",
  4642. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.update({\n ...\n})"
  4643. }
  4644. ]
  4645. }
  4646. },
  4647. "/session/{sessionID}/children": {
  4648. "get": {
  4649. "tags": ["session"],
  4650. "operationId": "session.children",
  4651. "parameters": [
  4652. {
  4653. "name": "directory",
  4654. "in": "query",
  4655. "required": false,
  4656. "schema": {
  4657. "type": "string"
  4658. }
  4659. },
  4660. {
  4661. "name": "workspace",
  4662. "in": "query",
  4663. "required": false,
  4664. "schema": {
  4665. "type": "string"
  4666. }
  4667. },
  4668. {
  4669. "name": "sessionID",
  4670. "in": "path",
  4671. "schema": {
  4672. "type": "string",
  4673. "pattern": "^ses.*"
  4674. },
  4675. "required": true
  4676. }
  4677. ],
  4678. "responses": {
  4679. "200": {
  4680. "description": "List of children",
  4681. "content": {
  4682. "application/json": {
  4683. "schema": {
  4684. "type": "array",
  4685. "items": {
  4686. "$ref": "#/components/schemas/Session"
  4687. },
  4688. "description": "List of children"
  4689. }
  4690. }
  4691. }
  4692. },
  4693. "400": {
  4694. "description": "Bad request",
  4695. "content": {
  4696. "application/json": {
  4697. "schema": {
  4698. "$ref": "#/components/schemas/BadRequestError"
  4699. }
  4700. }
  4701. }
  4702. },
  4703. "404": {
  4704. "description": "Not found",
  4705. "content": {
  4706. "application/json": {
  4707. "schema": {
  4708. "$ref": "#/components/schemas/NotFoundError"
  4709. }
  4710. }
  4711. }
  4712. }
  4713. },
  4714. "description": "Retrieve all child sessions that were forked from the specified parent session.",
  4715. "summary": "Get session children",
  4716. "x-codeSamples": [
  4717. {
  4718. "lang": "js",
  4719. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.children({\n ...\n})"
  4720. }
  4721. ]
  4722. }
  4723. },
  4724. "/session/{sessionID}/todo": {
  4725. "get": {
  4726. "tags": ["session"],
  4727. "operationId": "session.todo",
  4728. "parameters": [
  4729. {
  4730. "name": "directory",
  4731. "in": "query",
  4732. "required": false,
  4733. "schema": {
  4734. "type": "string"
  4735. }
  4736. },
  4737. {
  4738. "name": "workspace",
  4739. "in": "query",
  4740. "required": false,
  4741. "schema": {
  4742. "type": "string"
  4743. }
  4744. },
  4745. {
  4746. "name": "sessionID",
  4747. "in": "path",
  4748. "schema": {
  4749. "type": "string",
  4750. "pattern": "^ses.*"
  4751. },
  4752. "required": true
  4753. }
  4754. ],
  4755. "responses": {
  4756. "200": {
  4757. "description": "Todo list",
  4758. "content": {
  4759. "application/json": {
  4760. "schema": {
  4761. "type": "array",
  4762. "items": {
  4763. "$ref": "#/components/schemas/Todo"
  4764. },
  4765. "description": "Todo list"
  4766. }
  4767. }
  4768. }
  4769. },
  4770. "400": {
  4771. "description": "Bad request",
  4772. "content": {
  4773. "application/json": {
  4774. "schema": {
  4775. "$ref": "#/components/schemas/BadRequestError"
  4776. }
  4777. }
  4778. }
  4779. },
  4780. "404": {
  4781. "description": "Not found",
  4782. "content": {
  4783. "application/json": {
  4784. "schema": {
  4785. "$ref": "#/components/schemas/NotFoundError"
  4786. }
  4787. }
  4788. }
  4789. }
  4790. },
  4791. "description": "Retrieve the todo list associated with a specific session, showing tasks and action items.",
  4792. "summary": "Get session todos",
  4793. "x-codeSamples": [
  4794. {
  4795. "lang": "js",
  4796. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.todo({\n ...\n})"
  4797. }
  4798. ]
  4799. }
  4800. },
  4801. "/session/{sessionID}/diff": {
  4802. "get": {
  4803. "tags": ["session"],
  4804. "operationId": "session.diff",
  4805. "parameters": [
  4806. {
  4807. "name": "directory",
  4808. "in": "query",
  4809. "required": false,
  4810. "schema": {
  4811. "type": "string"
  4812. }
  4813. },
  4814. {
  4815. "name": "workspace",
  4816. "in": "query",
  4817. "required": false,
  4818. "schema": {
  4819. "type": "string"
  4820. }
  4821. },
  4822. {
  4823. "name": "sessionID",
  4824. "in": "path",
  4825. "schema": {
  4826. "type": "string",
  4827. "pattern": "^ses.*"
  4828. },
  4829. "required": true
  4830. },
  4831. {
  4832. "name": "messageID",
  4833. "in": "query",
  4834. "schema": {
  4835. "type": "string",
  4836. "pattern": "^msg.*"
  4837. },
  4838. "required": false
  4839. }
  4840. ],
  4841. "responses": {
  4842. "200": {
  4843. "description": "Successfully retrieved diff",
  4844. "content": {
  4845. "application/json": {
  4846. "schema": {
  4847. "type": "array",
  4848. "items": {
  4849. "$ref": "#/components/schemas/SnapshotFileDiff"
  4850. },
  4851. "description": "Successfully retrieved diff"
  4852. }
  4853. }
  4854. }
  4855. }
  4856. },
  4857. "description": "Get the file changes (diff) that resulted from a specific user message in the session.",
  4858. "summary": "Get message diff",
  4859. "x-codeSamples": [
  4860. {
  4861. "lang": "js",
  4862. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.diff({\n ...\n})"
  4863. }
  4864. ]
  4865. }
  4866. },
  4867. "/session/{sessionID}/message": {
  4868. "get": {
  4869. "tags": ["session"],
  4870. "operationId": "session.messages",
  4871. "parameters": [
  4872. {
  4873. "name": "directory",
  4874. "in": "query",
  4875. "required": false,
  4876. "schema": {
  4877. "type": "string"
  4878. }
  4879. },
  4880. {
  4881. "name": "workspace",
  4882. "in": "query",
  4883. "required": false,
  4884. "schema": {
  4885. "type": "string"
  4886. }
  4887. },
  4888. {
  4889. "name": "sessionID",
  4890. "in": "path",
  4891. "schema": {
  4892. "type": "string",
  4893. "pattern": "^ses.*"
  4894. },
  4895. "required": true
  4896. },
  4897. {
  4898. "name": "limit",
  4899. "in": "query",
  4900. "schema": {
  4901. "type": "integer",
  4902. "minimum": 0,
  4903. "maximum": 9007199254740991
  4904. },
  4905. "required": false
  4906. },
  4907. {
  4908. "name": "before",
  4909. "in": "query",
  4910. "schema": {
  4911. "type": "string"
  4912. },
  4913. "required": false
  4914. }
  4915. ],
  4916. "responses": {
  4917. "200": {
  4918. "description": "List of messages",
  4919. "content": {
  4920. "application/json": {
  4921. "schema": {
  4922. "type": "array",
  4923. "items": {
  4924. "type": "object",
  4925. "properties": {
  4926. "info": {
  4927. "$ref": "#/components/schemas/Message"
  4928. },
  4929. "parts": {
  4930. "type": "array",
  4931. "items": {
  4932. "$ref": "#/components/schemas/Part"
  4933. }
  4934. }
  4935. },
  4936. "required": ["info", "parts"],
  4937. "additionalProperties": false
  4938. },
  4939. "description": "List of messages"
  4940. }
  4941. }
  4942. }
  4943. },
  4944. "400": {
  4945. "description": "Bad request",
  4946. "content": {
  4947. "application/json": {
  4948. "schema": {
  4949. "$ref": "#/components/schemas/BadRequestError"
  4950. }
  4951. }
  4952. }
  4953. },
  4954. "404": {
  4955. "description": "Not found",
  4956. "content": {
  4957. "application/json": {
  4958. "schema": {
  4959. "$ref": "#/components/schemas/NotFoundError"
  4960. }
  4961. }
  4962. }
  4963. }
  4964. },
  4965. "description": "Retrieve all messages in a session, including user prompts and AI responses.",
  4966. "summary": "Get session messages",
  4967. "x-codeSamples": [
  4968. {
  4969. "lang": "js",
  4970. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.messages({\n ...\n})"
  4971. }
  4972. ]
  4973. },
  4974. "post": {
  4975. "tags": ["session"],
  4976. "operationId": "session.prompt",
  4977. "parameters": [
  4978. {
  4979. "name": "directory",
  4980. "in": "query",
  4981. "required": false,
  4982. "schema": {
  4983. "type": "string"
  4984. }
  4985. },
  4986. {
  4987. "name": "workspace",
  4988. "in": "query",
  4989. "required": false,
  4990. "schema": {
  4991. "type": "string"
  4992. }
  4993. },
  4994. {
  4995. "name": "sessionID",
  4996. "in": "path",
  4997. "schema": {
  4998. "type": "string",
  4999. "pattern": "^ses.*"
  5000. },
  5001. "required": true
  5002. }
  5003. ],
  5004. "responses": {
  5005. "200": {
  5006. "description": "Created message",
  5007. "content": {
  5008. "application/json": {
  5009. "schema": {
  5010. "type": "object",
  5011. "required": ["info", "parts"],
  5012. "properties": {
  5013. "info": {
  5014. "$ref": "#/components/schemas/AssistantMessage"
  5015. },
  5016. "parts": {
  5017. "type": "array",
  5018. "items": {
  5019. "$ref": "#/components/schemas/Part"
  5020. }
  5021. }
  5022. }
  5023. }
  5024. }
  5025. }
  5026. },
  5027. "400": {
  5028. "description": "Bad request",
  5029. "content": {
  5030. "application/json": {
  5031. "schema": {
  5032. "$ref": "#/components/schemas/BadRequestError"
  5033. }
  5034. }
  5035. }
  5036. },
  5037. "404": {
  5038. "description": "Not found",
  5039. "content": {
  5040. "application/json": {
  5041. "schema": {
  5042. "$ref": "#/components/schemas/NotFoundError"
  5043. }
  5044. }
  5045. }
  5046. }
  5047. },
  5048. "description": "Create and send a new message to a session, streaming the AI response.",
  5049. "summary": "Send message",
  5050. "requestBody": {
  5051. "content": {
  5052. "application/json": {
  5053. "schema": {
  5054. "type": "object",
  5055. "properties": {
  5056. "messageID": {
  5057. "type": "string"
  5058. },
  5059. "model": {
  5060. "type": "object",
  5061. "properties": {
  5062. "providerID": {
  5063. "type": "string"
  5064. },
  5065. "modelID": {
  5066. "type": "string"
  5067. }
  5068. },
  5069. "required": ["providerID", "modelID"],
  5070. "additionalProperties": false
  5071. },
  5072. "agent": {
  5073. "type": "string"
  5074. },
  5075. "noReply": {
  5076. "type": "boolean"
  5077. },
  5078. "tools": {
  5079. "type": "object",
  5080. "additionalProperties": {
  5081. "type": "boolean"
  5082. }
  5083. },
  5084. "format": {
  5085. "$ref": "#/components/schemas/OutputFormat"
  5086. },
  5087. "system": {
  5088. "type": "string"
  5089. },
  5090. "variant": {
  5091. "type": "string"
  5092. },
  5093. "parts": {
  5094. "type": "array",
  5095. "items": {
  5096. "anyOf": [
  5097. {
  5098. "$ref": "#/components/schemas/TextPartInput"
  5099. },
  5100. {
  5101. "$ref": "#/components/schemas/FilePartInput"
  5102. },
  5103. {
  5104. "$ref": "#/components/schemas/AgentPartInput"
  5105. },
  5106. {
  5107. "$ref": "#/components/schemas/SubtaskPartInput"
  5108. }
  5109. ]
  5110. }
  5111. }
  5112. },
  5113. "required": ["parts"],
  5114. "additionalProperties": false
  5115. }
  5116. }
  5117. }
  5118. },
  5119. "x-codeSamples": [
  5120. {
  5121. "lang": "js",
  5122. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.prompt({\n ...\n})"
  5123. }
  5124. ]
  5125. }
  5126. },
  5127. "/session/{sessionID}/message/{messageID}": {
  5128. "get": {
  5129. "tags": ["session"],
  5130. "operationId": "session.message",
  5131. "parameters": [
  5132. {
  5133. "name": "directory",
  5134. "in": "query",
  5135. "required": false,
  5136. "schema": {
  5137. "type": "string"
  5138. }
  5139. },
  5140. {
  5141. "name": "workspace",
  5142. "in": "query",
  5143. "required": false,
  5144. "schema": {
  5145. "type": "string"
  5146. }
  5147. },
  5148. {
  5149. "name": "sessionID",
  5150. "in": "path",
  5151. "schema": {
  5152. "type": "string",
  5153. "pattern": "^ses.*"
  5154. },
  5155. "required": true
  5156. },
  5157. {
  5158. "name": "messageID",
  5159. "in": "path",
  5160. "schema": {
  5161. "type": "string",
  5162. "pattern": "^msg.*"
  5163. },
  5164. "required": true
  5165. }
  5166. ],
  5167. "responses": {
  5168. "200": {
  5169. "description": "Message",
  5170. "content": {
  5171. "application/json": {
  5172. "schema": {
  5173. "type": "object",
  5174. "properties": {
  5175. "info": {
  5176. "$ref": "#/components/schemas/Message"
  5177. },
  5178. "parts": {
  5179. "type": "array",
  5180. "items": {
  5181. "$ref": "#/components/schemas/Part"
  5182. }
  5183. }
  5184. },
  5185. "required": ["info", "parts"],
  5186. "additionalProperties": false,
  5187. "description": "Message"
  5188. }
  5189. }
  5190. }
  5191. },
  5192. "400": {
  5193. "description": "Bad request",
  5194. "content": {
  5195. "application/json": {
  5196. "schema": {
  5197. "$ref": "#/components/schemas/BadRequestError"
  5198. }
  5199. }
  5200. }
  5201. },
  5202. "404": {
  5203. "description": "Not found",
  5204. "content": {
  5205. "application/json": {
  5206. "schema": {
  5207. "$ref": "#/components/schemas/NotFoundError"
  5208. }
  5209. }
  5210. }
  5211. }
  5212. },
  5213. "description": "Retrieve a specific message from a session by its message ID.",
  5214. "summary": "Get message",
  5215. "x-codeSamples": [
  5216. {
  5217. "lang": "js",
  5218. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.message({\n ...\n})"
  5219. }
  5220. ]
  5221. },
  5222. "delete": {
  5223. "tags": ["session"],
  5224. "operationId": "session.deleteMessage",
  5225. "parameters": [
  5226. {
  5227. "name": "directory",
  5228. "in": "query",
  5229. "required": false,
  5230. "schema": {
  5231. "type": "string"
  5232. }
  5233. },
  5234. {
  5235. "name": "workspace",
  5236. "in": "query",
  5237. "required": false,
  5238. "schema": {
  5239. "type": "string"
  5240. }
  5241. },
  5242. {
  5243. "name": "sessionID",
  5244. "in": "path",
  5245. "schema": {
  5246. "type": "string",
  5247. "pattern": "^ses.*"
  5248. },
  5249. "required": true
  5250. },
  5251. {
  5252. "name": "messageID",
  5253. "in": "path",
  5254. "schema": {
  5255. "type": "string",
  5256. "pattern": "^msg.*"
  5257. },
  5258. "required": true
  5259. }
  5260. ],
  5261. "responses": {
  5262. "200": {
  5263. "description": "Successfully deleted message",
  5264. "content": {
  5265. "application/json": {
  5266. "schema": {
  5267. "type": "boolean",
  5268. "description": "Successfully deleted message"
  5269. }
  5270. }
  5271. }
  5272. },
  5273. "400": {
  5274. "description": "Bad request",
  5275. "content": {
  5276. "application/json": {
  5277. "schema": {
  5278. "$ref": "#/components/schemas/BadRequestError"
  5279. }
  5280. }
  5281. }
  5282. },
  5283. "404": {
  5284. "description": "Not found",
  5285. "content": {
  5286. "application/json": {
  5287. "schema": {
  5288. "$ref": "#/components/schemas/NotFoundError"
  5289. }
  5290. }
  5291. }
  5292. }
  5293. },
  5294. "description": "Permanently delete a specific message and all of its parts from a session without reverting file changes.",
  5295. "summary": "Delete message",
  5296. "x-codeSamples": [
  5297. {
  5298. "lang": "js",
  5299. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.deleteMessage({\n ...\n})"
  5300. }
  5301. ]
  5302. }
  5303. },
  5304. "/session/{sessionID}/fork": {
  5305. "post": {
  5306. "tags": ["session"],
  5307. "operationId": "session.fork",
  5308. "parameters": [
  5309. {
  5310. "name": "directory",
  5311. "in": "query",
  5312. "required": false,
  5313. "schema": {
  5314. "type": "string"
  5315. }
  5316. },
  5317. {
  5318. "name": "workspace",
  5319. "in": "query",
  5320. "required": false,
  5321. "schema": {
  5322. "type": "string"
  5323. }
  5324. },
  5325. {
  5326. "name": "sessionID",
  5327. "in": "path",
  5328. "schema": {
  5329. "type": "string",
  5330. "pattern": "^ses.*"
  5331. },
  5332. "required": true
  5333. }
  5334. ],
  5335. "responses": {
  5336. "200": {
  5337. "description": "200",
  5338. "content": {
  5339. "application/json": {
  5340. "schema": {
  5341. "$ref": "#/components/schemas/Session"
  5342. }
  5343. }
  5344. }
  5345. }
  5346. },
  5347. "description": "Create a new session by forking an existing session at a specific message point.",
  5348. "summary": "Fork session",
  5349. "requestBody": {
  5350. "content": {
  5351. "application/json": {
  5352. "schema": {
  5353. "type": "object",
  5354. "properties": {
  5355. "messageID": {
  5356. "type": "string"
  5357. }
  5358. },
  5359. "additionalProperties": false
  5360. }
  5361. }
  5362. }
  5363. },
  5364. "x-codeSamples": [
  5365. {
  5366. "lang": "js",
  5367. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.fork({\n ...\n})"
  5368. }
  5369. ]
  5370. }
  5371. },
  5372. "/session/{sessionID}/abort": {
  5373. "post": {
  5374. "tags": ["session"],
  5375. "operationId": "session.abort",
  5376. "parameters": [
  5377. {
  5378. "name": "directory",
  5379. "in": "query",
  5380. "required": false,
  5381. "schema": {
  5382. "type": "string"
  5383. }
  5384. },
  5385. {
  5386. "name": "workspace",
  5387. "in": "query",
  5388. "required": false,
  5389. "schema": {
  5390. "type": "string"
  5391. }
  5392. },
  5393. {
  5394. "name": "sessionID",
  5395. "in": "path",
  5396. "schema": {
  5397. "type": "string",
  5398. "pattern": "^ses.*"
  5399. },
  5400. "required": true
  5401. }
  5402. ],
  5403. "responses": {
  5404. "200": {
  5405. "description": "Aborted session",
  5406. "content": {
  5407. "application/json": {
  5408. "schema": {
  5409. "type": "boolean",
  5410. "description": "Aborted session"
  5411. }
  5412. }
  5413. }
  5414. },
  5415. "400": {
  5416. "description": "Bad request",
  5417. "content": {
  5418. "application/json": {
  5419. "schema": {
  5420. "$ref": "#/components/schemas/BadRequestError"
  5421. }
  5422. }
  5423. }
  5424. },
  5425. "404": {
  5426. "description": "Not found",
  5427. "content": {
  5428. "application/json": {
  5429. "schema": {
  5430. "$ref": "#/components/schemas/NotFoundError"
  5431. }
  5432. }
  5433. }
  5434. }
  5435. },
  5436. "description": "Abort an active session and stop any ongoing AI processing or command execution.",
  5437. "summary": "Abort session",
  5438. "x-codeSamples": [
  5439. {
  5440. "lang": "js",
  5441. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.abort({\n ...\n})"
  5442. }
  5443. ]
  5444. }
  5445. },
  5446. "/session/{sessionID}/init": {
  5447. "post": {
  5448. "tags": ["session"],
  5449. "operationId": "session.init",
  5450. "parameters": [
  5451. {
  5452. "name": "directory",
  5453. "in": "query",
  5454. "required": false,
  5455. "schema": {
  5456. "type": "string"
  5457. }
  5458. },
  5459. {
  5460. "name": "workspace",
  5461. "in": "query",
  5462. "required": false,
  5463. "schema": {
  5464. "type": "string"
  5465. }
  5466. },
  5467. {
  5468. "name": "sessionID",
  5469. "in": "path",
  5470. "schema": {
  5471. "type": "string",
  5472. "pattern": "^ses.*"
  5473. },
  5474. "required": true
  5475. }
  5476. ],
  5477. "responses": {
  5478. "200": {
  5479. "description": "200",
  5480. "content": {
  5481. "application/json": {
  5482. "schema": {
  5483. "type": "boolean",
  5484. "description": "200"
  5485. }
  5486. }
  5487. }
  5488. },
  5489. "400": {
  5490. "description": "Bad request",
  5491. "content": {
  5492. "application/json": {
  5493. "schema": {
  5494. "$ref": "#/components/schemas/BadRequestError"
  5495. }
  5496. }
  5497. }
  5498. },
  5499. "404": {
  5500. "description": "Not found",
  5501. "content": {
  5502. "application/json": {
  5503. "schema": {
  5504. "$ref": "#/components/schemas/NotFoundError"
  5505. }
  5506. }
  5507. }
  5508. }
  5509. },
  5510. "description": "Analyze the current application and create an AGENTS.md file with project-specific agent configurations.",
  5511. "summary": "Initialize session",
  5512. "requestBody": {
  5513. "content": {
  5514. "application/json": {
  5515. "schema": {
  5516. "type": "object",
  5517. "properties": {
  5518. "modelID": {
  5519. "type": "string"
  5520. },
  5521. "providerID": {
  5522. "type": "string"
  5523. },
  5524. "messageID": {
  5525. "type": "string"
  5526. }
  5527. },
  5528. "required": ["modelID", "providerID", "messageID"],
  5529. "additionalProperties": false
  5530. }
  5531. }
  5532. }
  5533. },
  5534. "x-codeSamples": [
  5535. {
  5536. "lang": "js",
  5537. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.init({\n ...\n})"
  5538. }
  5539. ]
  5540. }
  5541. },
  5542. "/session/{sessionID}/share": {
  5543. "post": {
  5544. "tags": ["session"],
  5545. "operationId": "session.share",
  5546. "parameters": [
  5547. {
  5548. "name": "directory",
  5549. "in": "query",
  5550. "required": false,
  5551. "schema": {
  5552. "type": "string"
  5553. }
  5554. },
  5555. {
  5556. "name": "workspace",
  5557. "in": "query",
  5558. "required": false,
  5559. "schema": {
  5560. "type": "string"
  5561. }
  5562. },
  5563. {
  5564. "name": "sessionID",
  5565. "in": "path",
  5566. "schema": {
  5567. "type": "string",
  5568. "pattern": "^ses.*"
  5569. },
  5570. "required": true
  5571. }
  5572. ],
  5573. "responses": {
  5574. "200": {
  5575. "description": "Successfully shared session",
  5576. "content": {
  5577. "application/json": {
  5578. "schema": {
  5579. "$ref": "#/components/schemas/Session"
  5580. }
  5581. }
  5582. }
  5583. },
  5584. "400": {
  5585. "description": "Bad request",
  5586. "content": {
  5587. "application/json": {
  5588. "schema": {
  5589. "$ref": "#/components/schemas/BadRequestError"
  5590. }
  5591. }
  5592. }
  5593. },
  5594. "404": {
  5595. "description": "Not found",
  5596. "content": {
  5597. "application/json": {
  5598. "schema": {
  5599. "$ref": "#/components/schemas/NotFoundError"
  5600. }
  5601. }
  5602. }
  5603. }
  5604. },
  5605. "description": "Create a shareable link for a session, allowing others to view the conversation.",
  5606. "summary": "Share session",
  5607. "x-codeSamples": [
  5608. {
  5609. "lang": "js",
  5610. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.share({\n ...\n})"
  5611. }
  5612. ]
  5613. },
  5614. "delete": {
  5615. "tags": ["session"],
  5616. "operationId": "session.unshare",
  5617. "parameters": [
  5618. {
  5619. "name": "directory",
  5620. "in": "query",
  5621. "required": false,
  5622. "schema": {
  5623. "type": "string"
  5624. }
  5625. },
  5626. {
  5627. "name": "workspace",
  5628. "in": "query",
  5629. "required": false,
  5630. "schema": {
  5631. "type": "string"
  5632. }
  5633. },
  5634. {
  5635. "name": "sessionID",
  5636. "in": "path",
  5637. "schema": {
  5638. "type": "string",
  5639. "pattern": "^ses.*"
  5640. },
  5641. "required": true
  5642. }
  5643. ],
  5644. "responses": {
  5645. "200": {
  5646. "description": "Successfully unshared session",
  5647. "content": {
  5648. "application/json": {
  5649. "schema": {
  5650. "$ref": "#/components/schemas/Session"
  5651. }
  5652. }
  5653. }
  5654. },
  5655. "400": {
  5656. "description": "Bad request",
  5657. "content": {
  5658. "application/json": {
  5659. "schema": {
  5660. "$ref": "#/components/schemas/BadRequestError"
  5661. }
  5662. }
  5663. }
  5664. },
  5665. "404": {
  5666. "description": "Not found",
  5667. "content": {
  5668. "application/json": {
  5669. "schema": {
  5670. "$ref": "#/components/schemas/NotFoundError"
  5671. }
  5672. }
  5673. }
  5674. }
  5675. },
  5676. "description": "Remove the shareable link for a session, making it private again.",
  5677. "summary": "Unshare session",
  5678. "x-codeSamples": [
  5679. {
  5680. "lang": "js",
  5681. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.unshare({\n ...\n})"
  5682. }
  5683. ]
  5684. }
  5685. },
  5686. "/session/{sessionID}/summarize": {
  5687. "post": {
  5688. "tags": ["session"],
  5689. "operationId": "session.summarize",
  5690. "parameters": [
  5691. {
  5692. "name": "directory",
  5693. "in": "query",
  5694. "required": false,
  5695. "schema": {
  5696. "type": "string"
  5697. }
  5698. },
  5699. {
  5700. "name": "workspace",
  5701. "in": "query",
  5702. "required": false,
  5703. "schema": {
  5704. "type": "string"
  5705. }
  5706. },
  5707. {
  5708. "name": "sessionID",
  5709. "in": "path",
  5710. "schema": {
  5711. "type": "string",
  5712. "pattern": "^ses.*"
  5713. },
  5714. "required": true
  5715. }
  5716. ],
  5717. "responses": {
  5718. "200": {
  5719. "description": "Summarized session",
  5720. "content": {
  5721. "application/json": {
  5722. "schema": {
  5723. "type": "boolean",
  5724. "description": "Summarized session"
  5725. }
  5726. }
  5727. }
  5728. },
  5729. "400": {
  5730. "description": "Bad request",
  5731. "content": {
  5732. "application/json": {
  5733. "schema": {
  5734. "$ref": "#/components/schemas/BadRequestError"
  5735. }
  5736. }
  5737. }
  5738. },
  5739. "404": {
  5740. "description": "Not found",
  5741. "content": {
  5742. "application/json": {
  5743. "schema": {
  5744. "$ref": "#/components/schemas/NotFoundError"
  5745. }
  5746. }
  5747. }
  5748. }
  5749. },
  5750. "description": "Generate a concise summary of the session using AI compaction to preserve key information.",
  5751. "summary": "Summarize session",
  5752. "requestBody": {
  5753. "content": {
  5754. "application/json": {
  5755. "schema": {
  5756. "type": "object",
  5757. "properties": {
  5758. "providerID": {
  5759. "type": "string"
  5760. },
  5761. "modelID": {
  5762. "type": "string"
  5763. },
  5764. "auto": {
  5765. "type": "boolean"
  5766. }
  5767. },
  5768. "required": ["providerID", "modelID"],
  5769. "additionalProperties": false
  5770. }
  5771. }
  5772. }
  5773. },
  5774. "x-codeSamples": [
  5775. {
  5776. "lang": "js",
  5777. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.summarize({\n ...\n})"
  5778. }
  5779. ]
  5780. }
  5781. },
  5782. "/session/{sessionID}/prompt_async": {
  5783. "post": {
  5784. "tags": ["session"],
  5785. "operationId": "session.prompt_async",
  5786. "parameters": [
  5787. {
  5788. "name": "directory",
  5789. "in": "query",
  5790. "required": false,
  5791. "schema": {
  5792. "type": "string"
  5793. }
  5794. },
  5795. {
  5796. "name": "workspace",
  5797. "in": "query",
  5798. "required": false,
  5799. "schema": {
  5800. "type": "string"
  5801. }
  5802. },
  5803. {
  5804. "name": "sessionID",
  5805. "in": "path",
  5806. "schema": {
  5807. "type": "string",
  5808. "pattern": "^ses.*"
  5809. },
  5810. "required": true
  5811. }
  5812. ],
  5813. "responses": {
  5814. "204": {
  5815. "description": "Prompt accepted"
  5816. },
  5817. "400": {
  5818. "description": "Bad request",
  5819. "content": {
  5820. "application/json": {
  5821. "schema": {
  5822. "$ref": "#/components/schemas/BadRequestError"
  5823. }
  5824. }
  5825. }
  5826. },
  5827. "404": {
  5828. "description": "Not found",
  5829. "content": {
  5830. "application/json": {
  5831. "schema": {
  5832. "$ref": "#/components/schemas/NotFoundError"
  5833. }
  5834. }
  5835. }
  5836. }
  5837. },
  5838. "description": "Create and send a new message to a session asynchronously, starting the session if needed and returning immediately.",
  5839. "summary": "Send async message",
  5840. "requestBody": {
  5841. "content": {
  5842. "application/json": {
  5843. "schema": {
  5844. "type": "object",
  5845. "properties": {
  5846. "messageID": {
  5847. "type": "string"
  5848. },
  5849. "model": {
  5850. "type": "object",
  5851. "properties": {
  5852. "providerID": {
  5853. "type": "string"
  5854. },
  5855. "modelID": {
  5856. "type": "string"
  5857. }
  5858. },
  5859. "required": ["providerID", "modelID"],
  5860. "additionalProperties": false
  5861. },
  5862. "agent": {
  5863. "type": "string"
  5864. },
  5865. "noReply": {
  5866. "type": "boolean"
  5867. },
  5868. "tools": {
  5869. "type": "object",
  5870. "additionalProperties": {
  5871. "type": "boolean"
  5872. }
  5873. },
  5874. "format": {
  5875. "$ref": "#/components/schemas/OutputFormat"
  5876. },
  5877. "system": {
  5878. "type": "string"
  5879. },
  5880. "variant": {
  5881. "type": "string"
  5882. },
  5883. "parts": {
  5884. "type": "array",
  5885. "items": {
  5886. "anyOf": [
  5887. {
  5888. "$ref": "#/components/schemas/TextPartInput"
  5889. },
  5890. {
  5891. "$ref": "#/components/schemas/FilePartInput"
  5892. },
  5893. {
  5894. "$ref": "#/components/schemas/AgentPartInput"
  5895. },
  5896. {
  5897. "$ref": "#/components/schemas/SubtaskPartInput"
  5898. }
  5899. ]
  5900. }
  5901. }
  5902. },
  5903. "required": ["parts"],
  5904. "additionalProperties": false
  5905. }
  5906. }
  5907. }
  5908. },
  5909. "x-codeSamples": [
  5910. {
  5911. "lang": "js",
  5912. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.prompt_async({\n ...\n})"
  5913. }
  5914. ]
  5915. }
  5916. },
  5917. "/session/{sessionID}/command": {
  5918. "post": {
  5919. "tags": ["session"],
  5920. "operationId": "session.command",
  5921. "parameters": [
  5922. {
  5923. "name": "directory",
  5924. "in": "query",
  5925. "required": false,
  5926. "schema": {
  5927. "type": "string"
  5928. }
  5929. },
  5930. {
  5931. "name": "workspace",
  5932. "in": "query",
  5933. "required": false,
  5934. "schema": {
  5935. "type": "string"
  5936. }
  5937. },
  5938. {
  5939. "name": "sessionID",
  5940. "in": "path",
  5941. "schema": {
  5942. "type": "string",
  5943. "pattern": "^ses.*"
  5944. },
  5945. "required": true
  5946. }
  5947. ],
  5948. "responses": {
  5949. "200": {
  5950. "description": "Created message",
  5951. "content": {
  5952. "application/json": {
  5953. "schema": {
  5954. "type": "object",
  5955. "required": ["info", "parts"],
  5956. "properties": {
  5957. "info": {
  5958. "$ref": "#/components/schemas/AssistantMessage"
  5959. },
  5960. "parts": {
  5961. "type": "array",
  5962. "items": {
  5963. "$ref": "#/components/schemas/Part"
  5964. }
  5965. }
  5966. }
  5967. }
  5968. }
  5969. }
  5970. },
  5971. "400": {
  5972. "description": "Bad request",
  5973. "content": {
  5974. "application/json": {
  5975. "schema": {
  5976. "$ref": "#/components/schemas/BadRequestError"
  5977. }
  5978. }
  5979. }
  5980. },
  5981. "404": {
  5982. "description": "Not found",
  5983. "content": {
  5984. "application/json": {
  5985. "schema": {
  5986. "$ref": "#/components/schemas/NotFoundError"
  5987. }
  5988. }
  5989. }
  5990. }
  5991. },
  5992. "description": "Send a new command to a session for execution by the AI assistant.",
  5993. "summary": "Send command",
  5994. "requestBody": {
  5995. "content": {
  5996. "application/json": {
  5997. "schema": {
  5998. "type": "object",
  5999. "properties": {
  6000. "messageID": {
  6001. "type": "string"
  6002. },
  6003. "agent": {
  6004. "type": "string"
  6005. },
  6006. "model": {
  6007. "type": "string"
  6008. },
  6009. "arguments": {
  6010. "type": "string"
  6011. },
  6012. "command": {
  6013. "type": "string"
  6014. },
  6015. "variant": {
  6016. "type": "string"
  6017. },
  6018. "parts": {
  6019. "type": "array",
  6020. "items": {
  6021. "type": "object",
  6022. "properties": {
  6023. "id": {
  6024. "type": "string"
  6025. },
  6026. "type": {
  6027. "type": "string",
  6028. "enum": ["file"]
  6029. },
  6030. "mime": {
  6031. "type": "string"
  6032. },
  6033. "filename": {
  6034. "type": "string"
  6035. },
  6036. "url": {
  6037. "type": "string"
  6038. },
  6039. "source": {
  6040. "$ref": "#/components/schemas/FilePartSource"
  6041. }
  6042. },
  6043. "required": ["type", "mime", "url"],
  6044. "additionalProperties": false
  6045. }
  6046. }
  6047. },
  6048. "required": ["arguments", "command"],
  6049. "additionalProperties": false
  6050. }
  6051. }
  6052. }
  6053. },
  6054. "x-codeSamples": [
  6055. {
  6056. "lang": "js",
  6057. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.command({\n ...\n})"
  6058. }
  6059. ]
  6060. }
  6061. },
  6062. "/session/{sessionID}/shell": {
  6063. "post": {
  6064. "tags": ["session"],
  6065. "operationId": "session.shell",
  6066. "parameters": [
  6067. {
  6068. "name": "directory",
  6069. "in": "query",
  6070. "required": false,
  6071. "schema": {
  6072. "type": "string"
  6073. }
  6074. },
  6075. {
  6076. "name": "workspace",
  6077. "in": "query",
  6078. "required": false,
  6079. "schema": {
  6080. "type": "string"
  6081. }
  6082. },
  6083. {
  6084. "name": "sessionID",
  6085. "in": "path",
  6086. "schema": {
  6087. "type": "string",
  6088. "pattern": "^ses.*"
  6089. },
  6090. "required": true
  6091. }
  6092. ],
  6093. "responses": {
  6094. "200": {
  6095. "description": "Created message",
  6096. "content": {
  6097. "application/json": {
  6098. "schema": {
  6099. "type": "object",
  6100. "properties": {
  6101. "info": {
  6102. "$ref": "#/components/schemas/Message"
  6103. },
  6104. "parts": {
  6105. "type": "array",
  6106. "items": {
  6107. "$ref": "#/components/schemas/Part"
  6108. }
  6109. }
  6110. },
  6111. "required": ["info", "parts"],
  6112. "additionalProperties": false,
  6113. "description": "Created message"
  6114. }
  6115. }
  6116. }
  6117. },
  6118. "400": {
  6119. "description": "Bad request",
  6120. "content": {
  6121. "application/json": {
  6122. "schema": {
  6123. "$ref": "#/components/schemas/BadRequestError"
  6124. }
  6125. }
  6126. }
  6127. },
  6128. "404": {
  6129. "description": "Not found",
  6130. "content": {
  6131. "application/json": {
  6132. "schema": {
  6133. "$ref": "#/components/schemas/NotFoundError"
  6134. }
  6135. }
  6136. }
  6137. }
  6138. },
  6139. "description": "Execute a shell command within the session context and return the AI's response.",
  6140. "summary": "Run shell command",
  6141. "requestBody": {
  6142. "content": {
  6143. "application/json": {
  6144. "schema": {
  6145. "type": "object",
  6146. "properties": {
  6147. "messageID": {
  6148. "type": "string"
  6149. },
  6150. "agent": {
  6151. "type": "string"
  6152. },
  6153. "model": {
  6154. "type": "object",
  6155. "properties": {
  6156. "providerID": {
  6157. "type": "string"
  6158. },
  6159. "modelID": {
  6160. "type": "string"
  6161. }
  6162. },
  6163. "required": ["providerID", "modelID"],
  6164. "additionalProperties": false
  6165. },
  6166. "command": {
  6167. "type": "string"
  6168. }
  6169. },
  6170. "required": ["agent", "command"],
  6171. "additionalProperties": false
  6172. }
  6173. }
  6174. }
  6175. },
  6176. "x-codeSamples": [
  6177. {
  6178. "lang": "js",
  6179. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.shell({\n ...\n})"
  6180. }
  6181. ]
  6182. }
  6183. },
  6184. "/session/{sessionID}/revert": {
  6185. "post": {
  6186. "tags": ["session"],
  6187. "operationId": "session.revert",
  6188. "parameters": [
  6189. {
  6190. "name": "directory",
  6191. "in": "query",
  6192. "required": false,
  6193. "schema": {
  6194. "type": "string"
  6195. }
  6196. },
  6197. {
  6198. "name": "workspace",
  6199. "in": "query",
  6200. "required": false,
  6201. "schema": {
  6202. "type": "string"
  6203. }
  6204. },
  6205. {
  6206. "name": "sessionID",
  6207. "in": "path",
  6208. "schema": {
  6209. "type": "string",
  6210. "pattern": "^ses.*"
  6211. },
  6212. "required": true
  6213. }
  6214. ],
  6215. "responses": {
  6216. "200": {
  6217. "description": "Updated session",
  6218. "content": {
  6219. "application/json": {
  6220. "schema": {
  6221. "$ref": "#/components/schemas/Session"
  6222. }
  6223. }
  6224. }
  6225. },
  6226. "400": {
  6227. "description": "Bad request",
  6228. "content": {
  6229. "application/json": {
  6230. "schema": {
  6231. "$ref": "#/components/schemas/BadRequestError"
  6232. }
  6233. }
  6234. }
  6235. },
  6236. "404": {
  6237. "description": "Not found",
  6238. "content": {
  6239. "application/json": {
  6240. "schema": {
  6241. "$ref": "#/components/schemas/NotFoundError"
  6242. }
  6243. }
  6244. }
  6245. }
  6246. },
  6247. "description": "Revert a specific message in a session, undoing its effects and restoring the previous state.",
  6248. "summary": "Revert message",
  6249. "requestBody": {
  6250. "content": {
  6251. "application/json": {
  6252. "schema": {
  6253. "type": "object",
  6254. "properties": {
  6255. "messageID": {
  6256. "type": "string"
  6257. },
  6258. "partID": {
  6259. "type": "string"
  6260. }
  6261. },
  6262. "required": ["messageID"],
  6263. "additionalProperties": false
  6264. }
  6265. }
  6266. }
  6267. },
  6268. "x-codeSamples": [
  6269. {
  6270. "lang": "js",
  6271. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.revert({\n ...\n})"
  6272. }
  6273. ]
  6274. }
  6275. },
  6276. "/session/{sessionID}/unrevert": {
  6277. "post": {
  6278. "tags": ["session"],
  6279. "operationId": "session.unrevert",
  6280. "parameters": [
  6281. {
  6282. "name": "directory",
  6283. "in": "query",
  6284. "required": false,
  6285. "schema": {
  6286. "type": "string"
  6287. }
  6288. },
  6289. {
  6290. "name": "workspace",
  6291. "in": "query",
  6292. "required": false,
  6293. "schema": {
  6294. "type": "string"
  6295. }
  6296. },
  6297. {
  6298. "name": "sessionID",
  6299. "in": "path",
  6300. "schema": {
  6301. "type": "string",
  6302. "pattern": "^ses.*"
  6303. },
  6304. "required": true
  6305. }
  6306. ],
  6307. "responses": {
  6308. "200": {
  6309. "description": "Updated session",
  6310. "content": {
  6311. "application/json": {
  6312. "schema": {
  6313. "$ref": "#/components/schemas/Session"
  6314. }
  6315. }
  6316. }
  6317. },
  6318. "400": {
  6319. "description": "Bad request",
  6320. "content": {
  6321. "application/json": {
  6322. "schema": {
  6323. "$ref": "#/components/schemas/BadRequestError"
  6324. }
  6325. }
  6326. }
  6327. },
  6328. "404": {
  6329. "description": "Not found",
  6330. "content": {
  6331. "application/json": {
  6332. "schema": {
  6333. "$ref": "#/components/schemas/NotFoundError"
  6334. }
  6335. }
  6336. }
  6337. }
  6338. },
  6339. "description": "Restore all previously reverted messages in a session.",
  6340. "summary": "Restore reverted messages",
  6341. "x-codeSamples": [
  6342. {
  6343. "lang": "js",
  6344. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.unrevert({\n ...\n})"
  6345. }
  6346. ]
  6347. }
  6348. },
  6349. "/session/{sessionID}/permissions/{permissionID}": {
  6350. "post": {
  6351. "tags": ["session"],
  6352. "operationId": "permission.respond",
  6353. "parameters": [
  6354. {
  6355. "name": "directory",
  6356. "in": "query",
  6357. "required": false,
  6358. "schema": {
  6359. "type": "string"
  6360. }
  6361. },
  6362. {
  6363. "name": "workspace",
  6364. "in": "query",
  6365. "required": false,
  6366. "schema": {
  6367. "type": "string"
  6368. }
  6369. },
  6370. {
  6371. "name": "sessionID",
  6372. "in": "path",
  6373. "schema": {
  6374. "type": "string",
  6375. "pattern": "^ses.*"
  6376. },
  6377. "required": true
  6378. },
  6379. {
  6380. "name": "permissionID",
  6381. "in": "path",
  6382. "schema": {
  6383. "type": "string",
  6384. "pattern": "^per.*"
  6385. },
  6386. "required": true
  6387. }
  6388. ],
  6389. "responses": {
  6390. "200": {
  6391. "description": "Permission processed successfully",
  6392. "content": {
  6393. "application/json": {
  6394. "schema": {
  6395. "type": "boolean",
  6396. "description": "Permission processed successfully"
  6397. }
  6398. }
  6399. }
  6400. },
  6401. "400": {
  6402. "description": "Bad request",
  6403. "content": {
  6404. "application/json": {
  6405. "schema": {
  6406. "$ref": "#/components/schemas/BadRequestError"
  6407. }
  6408. }
  6409. }
  6410. },
  6411. "404": {
  6412. "description": "Not found",
  6413. "content": {
  6414. "application/json": {
  6415. "schema": {
  6416. "$ref": "#/components/schemas/NotFoundError"
  6417. }
  6418. }
  6419. }
  6420. }
  6421. },
  6422. "description": "Approve or deny a permission request from the AI assistant.",
  6423. "summary": "Respond to permission",
  6424. "deprecated": true,
  6425. "requestBody": {
  6426. "content": {
  6427. "application/json": {
  6428. "schema": {
  6429. "type": "object",
  6430. "properties": {
  6431. "response": {
  6432. "type": "string",
  6433. "enum": ["once", "always", "reject"]
  6434. }
  6435. },
  6436. "required": ["response"],
  6437. "additionalProperties": false
  6438. }
  6439. }
  6440. }
  6441. },
  6442. "x-codeSamples": [
  6443. {
  6444. "lang": "js",
  6445. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.permission.respond({\n ...\n})"
  6446. }
  6447. ]
  6448. }
  6449. },
  6450. "/session/{sessionID}/message/{messageID}/part/{partID}": {
  6451. "delete": {
  6452. "tags": ["session"],
  6453. "operationId": "part.delete",
  6454. "parameters": [
  6455. {
  6456. "name": "directory",
  6457. "in": "query",
  6458. "required": false,
  6459. "schema": {
  6460. "type": "string"
  6461. }
  6462. },
  6463. {
  6464. "name": "workspace",
  6465. "in": "query",
  6466. "required": false,
  6467. "schema": {
  6468. "type": "string"
  6469. }
  6470. },
  6471. {
  6472. "name": "sessionID",
  6473. "in": "path",
  6474. "schema": {
  6475. "type": "string",
  6476. "pattern": "^ses.*"
  6477. },
  6478. "required": true
  6479. },
  6480. {
  6481. "name": "messageID",
  6482. "in": "path",
  6483. "schema": {
  6484. "type": "string",
  6485. "pattern": "^msg.*"
  6486. },
  6487. "required": true
  6488. },
  6489. {
  6490. "name": "partID",
  6491. "in": "path",
  6492. "schema": {
  6493. "type": "string",
  6494. "pattern": "^prt.*"
  6495. },
  6496. "required": true
  6497. }
  6498. ],
  6499. "responses": {
  6500. "200": {
  6501. "description": "Successfully deleted part",
  6502. "content": {
  6503. "application/json": {
  6504. "schema": {
  6505. "type": "boolean",
  6506. "description": "Successfully deleted part"
  6507. }
  6508. }
  6509. }
  6510. },
  6511. "400": {
  6512. "description": "Bad request",
  6513. "content": {
  6514. "application/json": {
  6515. "schema": {
  6516. "$ref": "#/components/schemas/BadRequestError"
  6517. }
  6518. }
  6519. }
  6520. },
  6521. "404": {
  6522. "description": "Not found",
  6523. "content": {
  6524. "application/json": {
  6525. "schema": {
  6526. "$ref": "#/components/schemas/NotFoundError"
  6527. }
  6528. }
  6529. }
  6530. }
  6531. },
  6532. "description": "Delete a part from a message.",
  6533. "x-codeSamples": [
  6534. {
  6535. "lang": "js",
  6536. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.part.delete({\n ...\n})"
  6537. }
  6538. ]
  6539. },
  6540. "patch": {
  6541. "tags": ["session"],
  6542. "operationId": "part.update",
  6543. "parameters": [
  6544. {
  6545. "name": "directory",
  6546. "in": "query",
  6547. "required": false,
  6548. "schema": {
  6549. "type": "string"
  6550. }
  6551. },
  6552. {
  6553. "name": "workspace",
  6554. "in": "query",
  6555. "required": false,
  6556. "schema": {
  6557. "type": "string"
  6558. }
  6559. },
  6560. {
  6561. "name": "sessionID",
  6562. "in": "path",
  6563. "schema": {
  6564. "type": "string",
  6565. "pattern": "^ses.*"
  6566. },
  6567. "required": true
  6568. },
  6569. {
  6570. "name": "messageID",
  6571. "in": "path",
  6572. "schema": {
  6573. "type": "string",
  6574. "pattern": "^msg.*"
  6575. },
  6576. "required": true
  6577. },
  6578. {
  6579. "name": "partID",
  6580. "in": "path",
  6581. "schema": {
  6582. "type": "string",
  6583. "pattern": "^prt.*"
  6584. },
  6585. "required": true
  6586. }
  6587. ],
  6588. "responses": {
  6589. "200": {
  6590. "description": "Successfully updated part",
  6591. "content": {
  6592. "application/json": {
  6593. "schema": {
  6594. "$ref": "#/components/schemas/Part"
  6595. }
  6596. }
  6597. }
  6598. },
  6599. "400": {
  6600. "description": "Bad request",
  6601. "content": {
  6602. "application/json": {
  6603. "schema": {
  6604. "$ref": "#/components/schemas/BadRequestError"
  6605. }
  6606. }
  6607. }
  6608. },
  6609. "404": {
  6610. "description": "Not found",
  6611. "content": {
  6612. "application/json": {
  6613. "schema": {
  6614. "$ref": "#/components/schemas/NotFoundError"
  6615. }
  6616. }
  6617. }
  6618. }
  6619. },
  6620. "description": "Update a part in a message.",
  6621. "requestBody": {
  6622. "content": {
  6623. "application/json": {
  6624. "schema": {
  6625. "$ref": "#/components/schemas/Part"
  6626. }
  6627. }
  6628. }
  6629. },
  6630. "x-codeSamples": [
  6631. {
  6632. "lang": "js",
  6633. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.part.update({\n ...\n})"
  6634. }
  6635. ]
  6636. }
  6637. },
  6638. "/sync/start": {
  6639. "post": {
  6640. "tags": ["sync"],
  6641. "operationId": "sync.start",
  6642. "parameters": [
  6643. {
  6644. "name": "directory",
  6645. "in": "query",
  6646. "required": false,
  6647. "schema": {
  6648. "type": "string"
  6649. }
  6650. },
  6651. {
  6652. "name": "workspace",
  6653. "in": "query",
  6654. "required": false,
  6655. "schema": {
  6656. "type": "string"
  6657. }
  6658. }
  6659. ],
  6660. "responses": {
  6661. "200": {
  6662. "description": "Workspace sync started",
  6663. "content": {
  6664. "application/json": {
  6665. "schema": {
  6666. "type": "boolean",
  6667. "description": "Workspace sync started"
  6668. }
  6669. }
  6670. }
  6671. }
  6672. },
  6673. "description": "Start sync loops for workspaces in the current project that have active sessions.",
  6674. "summary": "Start workspace sync",
  6675. "x-codeSamples": [
  6676. {
  6677. "lang": "js",
  6678. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.sync.start({\n ...\n})"
  6679. }
  6680. ]
  6681. }
  6682. },
  6683. "/sync/replay": {
  6684. "post": {
  6685. "tags": ["sync"],
  6686. "operationId": "sync.replay",
  6687. "parameters": [
  6688. {
  6689. "name": "directory",
  6690. "in": "query",
  6691. "required": false,
  6692. "schema": {
  6693. "type": "string"
  6694. }
  6695. },
  6696. {
  6697. "name": "workspace",
  6698. "in": "query",
  6699. "required": false,
  6700. "schema": {
  6701. "type": "string"
  6702. }
  6703. }
  6704. ],
  6705. "responses": {
  6706. "200": {
  6707. "description": "Replayed sync events",
  6708. "content": {
  6709. "application/json": {
  6710. "schema": {
  6711. "type": "object",
  6712. "properties": {
  6713. "sessionID": {
  6714. "type": "string"
  6715. }
  6716. },
  6717. "required": ["sessionID"],
  6718. "additionalProperties": false,
  6719. "description": "Replayed sync events"
  6720. }
  6721. }
  6722. }
  6723. },
  6724. "400": {
  6725. "description": "Bad request",
  6726. "content": {
  6727. "application/json": {
  6728. "schema": {
  6729. "$ref": "#/components/schemas/BadRequestError"
  6730. }
  6731. }
  6732. }
  6733. }
  6734. },
  6735. "description": "Validate and replay a complete sync event history.",
  6736. "summary": "Replay sync events",
  6737. "requestBody": {
  6738. "content": {
  6739. "application/json": {
  6740. "schema": {
  6741. "type": "object",
  6742. "properties": {
  6743. "directory": {
  6744. "type": "string"
  6745. },
  6746. "events": {
  6747. "type": "array",
  6748. "minItems": 1,
  6749. "items": {
  6750. "type": "object",
  6751. "properties": {
  6752. "id": {
  6753. "type": "string"
  6754. },
  6755. "aggregateID": {
  6756. "type": "string"
  6757. },
  6758. "seq": {
  6759. "type": "integer",
  6760. "minimum": 0
  6761. },
  6762. "type": {
  6763. "type": "string"
  6764. },
  6765. "data": {
  6766. "type": "object"
  6767. }
  6768. },
  6769. "required": ["id", "aggregateID", "seq", "type", "data"],
  6770. "additionalProperties": false
  6771. }
  6772. }
  6773. },
  6774. "required": ["directory", "events"],
  6775. "additionalProperties": false
  6776. }
  6777. }
  6778. }
  6779. },
  6780. "x-codeSamples": [
  6781. {
  6782. "lang": "js",
  6783. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.sync.replay({\n ...\n})"
  6784. }
  6785. ]
  6786. }
  6787. },
  6788. "/sync/history": {
  6789. "post": {
  6790. "tags": ["sync"],
  6791. "operationId": "sync.history.list",
  6792. "parameters": [
  6793. {
  6794. "name": "directory",
  6795. "in": "query",
  6796. "required": false,
  6797. "schema": {
  6798. "type": "string"
  6799. }
  6800. },
  6801. {
  6802. "name": "workspace",
  6803. "in": "query",
  6804. "required": false,
  6805. "schema": {
  6806. "type": "string"
  6807. }
  6808. }
  6809. ],
  6810. "responses": {
  6811. "200": {
  6812. "description": "Sync events",
  6813. "content": {
  6814. "application/json": {
  6815. "schema": {
  6816. "type": "array",
  6817. "items": {
  6818. "type": "object",
  6819. "properties": {
  6820. "id": {
  6821. "type": "string"
  6822. },
  6823. "aggregate_id": {
  6824. "type": "string"
  6825. },
  6826. "seq": {
  6827. "type": "integer",
  6828. "minimum": 0
  6829. },
  6830. "type": {
  6831. "type": "string"
  6832. },
  6833. "data": {
  6834. "type": "object"
  6835. }
  6836. },
  6837. "required": ["id", "aggregate_id", "seq", "type", "data"],
  6838. "additionalProperties": false
  6839. },
  6840. "description": "Sync events"
  6841. }
  6842. }
  6843. }
  6844. },
  6845. "400": {
  6846. "description": "Bad request",
  6847. "content": {
  6848. "application/json": {
  6849. "schema": {
  6850. "$ref": "#/components/schemas/BadRequestError"
  6851. }
  6852. }
  6853. }
  6854. }
  6855. },
  6856. "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.",
  6857. "summary": "List sync events",
  6858. "requestBody": {
  6859. "content": {
  6860. "application/json": {
  6861. "schema": {
  6862. "type": "object",
  6863. "additionalProperties": {
  6864. "type": "integer",
  6865. "minimum": 0
  6866. }
  6867. }
  6868. }
  6869. }
  6870. },
  6871. "x-codeSamples": [
  6872. {
  6873. "lang": "js",
  6874. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.sync.history.list({\n ...\n})"
  6875. }
  6876. ]
  6877. }
  6878. },
  6879. "/api/session": {
  6880. "get": {
  6881. "tags": ["v2"],
  6882. "operationId": "v2.session.list",
  6883. "parameters": [
  6884. {
  6885. "name": "directory",
  6886. "in": "query",
  6887. "required": false,
  6888. "schema": {
  6889. "type": "string"
  6890. }
  6891. },
  6892. {
  6893. "name": "workspace",
  6894. "in": "query",
  6895. "required": false,
  6896. "schema": {
  6897. "type": "string"
  6898. }
  6899. }
  6900. ],
  6901. "responses": {
  6902. "200": {
  6903. "description": "V2SessionsResponse",
  6904. "content": {
  6905. "application/json": {
  6906. "schema": {
  6907. "$ref": "#/components/schemas/V2SessionsResponse"
  6908. }
  6909. }
  6910. }
  6911. },
  6912. "400": {
  6913. "description": "Bad request",
  6914. "content": {
  6915. "application/json": {
  6916. "schema": {
  6917. "$ref": "#/components/schemas/BadRequestError"
  6918. }
  6919. }
  6920. }
  6921. }
  6922. },
  6923. "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.",
  6924. "summary": "List v2 sessions",
  6925. "x-codeSamples": [
  6926. {
  6927. "lang": "js",
  6928. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.list({\n ...\n})"
  6929. }
  6930. ]
  6931. }
  6932. },
  6933. "/api/session/{sessionID}/prompt": {
  6934. "post": {
  6935. "tags": ["v2"],
  6936. "operationId": "v2.session.prompt",
  6937. "parameters": [
  6938. {
  6939. "name": "directory",
  6940. "in": "query",
  6941. "required": false,
  6942. "schema": {
  6943. "type": "string"
  6944. }
  6945. },
  6946. {
  6947. "name": "workspace",
  6948. "in": "query",
  6949. "required": false,
  6950. "schema": {
  6951. "type": "string"
  6952. }
  6953. },
  6954. {
  6955. "name": "sessionID",
  6956. "in": "path",
  6957. "schema": {
  6958. "type": "string",
  6959. "pattern": "^ses.*"
  6960. },
  6961. "required": true
  6962. }
  6963. ],
  6964. "responses": {
  6965. "200": {
  6966. "description": "Session.Message",
  6967. "content": {
  6968. "application/json": {
  6969. "schema": {
  6970. "$ref": "#/components/schemas/SessionMessage"
  6971. }
  6972. }
  6973. }
  6974. }
  6975. },
  6976. "description": "Create a v2 session message and queue it for the agent loop.",
  6977. "summary": "Send v2 message",
  6978. "requestBody": {
  6979. "content": {
  6980. "application/json": {
  6981. "schema": {
  6982. "type": "object",
  6983. "properties": {
  6984. "prompt": {
  6985. "$ref": "#/components/schemas/Prompt"
  6986. },
  6987. "delivery": {
  6988. "$ref": "#/components/schemas/SessionDelivery"
  6989. }
  6990. },
  6991. "required": ["prompt"],
  6992. "additionalProperties": false
  6993. }
  6994. }
  6995. }
  6996. },
  6997. "x-codeSamples": [
  6998. {
  6999. "lang": "js",
  7000. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.prompt({\n ...\n})"
  7001. }
  7002. ]
  7003. }
  7004. },
  7005. "/api/session/{sessionID}/compact": {
  7006. "post": {
  7007. "tags": ["v2"],
  7008. "operationId": "v2.session.compact",
  7009. "parameters": [
  7010. {
  7011. "name": "directory",
  7012. "in": "query",
  7013. "required": false,
  7014. "schema": {
  7015. "type": "string"
  7016. }
  7017. },
  7018. {
  7019. "name": "workspace",
  7020. "in": "query",
  7021. "required": false,
  7022. "schema": {
  7023. "type": "string"
  7024. }
  7025. },
  7026. {
  7027. "name": "sessionID",
  7028. "in": "path",
  7029. "schema": {
  7030. "type": "string",
  7031. "pattern": "^ses.*"
  7032. },
  7033. "required": true
  7034. }
  7035. ],
  7036. "responses": {
  7037. "204": {
  7038. "description": "<No Content>"
  7039. }
  7040. },
  7041. "description": "Compact a v2 session conversation.",
  7042. "summary": "Compact v2 session",
  7043. "x-codeSamples": [
  7044. {
  7045. "lang": "js",
  7046. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.compact({\n ...\n})"
  7047. }
  7048. ]
  7049. }
  7050. },
  7051. "/api/session/{sessionID}/wait": {
  7052. "post": {
  7053. "tags": ["v2"],
  7054. "operationId": "v2.session.wait",
  7055. "parameters": [
  7056. {
  7057. "name": "directory",
  7058. "in": "query",
  7059. "required": false,
  7060. "schema": {
  7061. "type": "string"
  7062. }
  7063. },
  7064. {
  7065. "name": "workspace",
  7066. "in": "query",
  7067. "required": false,
  7068. "schema": {
  7069. "type": "string"
  7070. }
  7071. },
  7072. {
  7073. "name": "sessionID",
  7074. "in": "path",
  7075. "schema": {
  7076. "type": "string",
  7077. "pattern": "^ses.*"
  7078. },
  7079. "required": true
  7080. }
  7081. ],
  7082. "responses": {
  7083. "204": {
  7084. "description": "<No Content>"
  7085. }
  7086. },
  7087. "description": "Wait for a v2 session agent loop to become idle.",
  7088. "summary": "Wait for v2 session",
  7089. "x-codeSamples": [
  7090. {
  7091. "lang": "js",
  7092. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.wait({\n ...\n})"
  7093. }
  7094. ]
  7095. }
  7096. },
  7097. "/api/session/{sessionID}/context": {
  7098. "get": {
  7099. "tags": ["v2"],
  7100. "operationId": "v2.session.context",
  7101. "parameters": [
  7102. {
  7103. "name": "directory",
  7104. "in": "query",
  7105. "required": false,
  7106. "schema": {
  7107. "type": "string"
  7108. }
  7109. },
  7110. {
  7111. "name": "workspace",
  7112. "in": "query",
  7113. "required": false,
  7114. "schema": {
  7115. "type": "string"
  7116. }
  7117. },
  7118. {
  7119. "name": "sessionID",
  7120. "in": "path",
  7121. "schema": {
  7122. "type": "string",
  7123. "pattern": "^ses.*"
  7124. },
  7125. "required": true
  7126. }
  7127. ],
  7128. "responses": {
  7129. "200": {
  7130. "description": "Success",
  7131. "content": {
  7132. "application/json": {
  7133. "schema": {
  7134. "type": "array",
  7135. "items": {
  7136. "$ref": "#/components/schemas/SessionMessage"
  7137. }
  7138. }
  7139. }
  7140. }
  7141. }
  7142. },
  7143. "description": "Retrieve the active context messages for a v2 session (all messages after the last compaction).",
  7144. "summary": "Get v2 session context",
  7145. "x-codeSamples": [
  7146. {
  7147. "lang": "js",
  7148. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.context({\n ...\n})"
  7149. }
  7150. ]
  7151. }
  7152. },
  7153. "/api/session/{sessionID}/message": {
  7154. "get": {
  7155. "tags": ["v2 messages"],
  7156. "operationId": "v2.session.messages",
  7157. "parameters": [
  7158. {
  7159. "name": "directory",
  7160. "in": "query",
  7161. "required": false,
  7162. "schema": {
  7163. "type": "string"
  7164. }
  7165. },
  7166. {
  7167. "name": "workspace",
  7168. "in": "query",
  7169. "required": false,
  7170. "schema": {
  7171. "type": "string"
  7172. }
  7173. },
  7174. {
  7175. "name": "sessionID",
  7176. "in": "path",
  7177. "schema": {
  7178. "type": "string",
  7179. "pattern": "^ses.*"
  7180. },
  7181. "required": true
  7182. }
  7183. ],
  7184. "responses": {
  7185. "200": {
  7186. "description": "V2SessionMessagesResponse",
  7187. "content": {
  7188. "application/json": {
  7189. "schema": {
  7190. "$ref": "#/components/schemas/V2SessionMessagesResponse"
  7191. }
  7192. }
  7193. }
  7194. },
  7195. "400": {
  7196. "description": "Bad request",
  7197. "content": {
  7198. "application/json": {
  7199. "schema": {
  7200. "$ref": "#/components/schemas/BadRequestError"
  7201. }
  7202. }
  7203. }
  7204. }
  7205. },
  7206. "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.",
  7207. "summary": "Get v2 session messages",
  7208. "x-codeSamples": [
  7209. {
  7210. "lang": "js",
  7211. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.messages({\n ...\n})"
  7212. }
  7213. ]
  7214. }
  7215. },
  7216. "/tui/append-prompt": {
  7217. "post": {
  7218. "tags": ["tui"],
  7219. "operationId": "tui.appendPrompt",
  7220. "parameters": [
  7221. {
  7222. "name": "directory",
  7223. "in": "query",
  7224. "required": false,
  7225. "schema": {
  7226. "type": "string"
  7227. }
  7228. },
  7229. {
  7230. "name": "workspace",
  7231. "in": "query",
  7232. "required": false,
  7233. "schema": {
  7234. "type": "string"
  7235. }
  7236. }
  7237. ],
  7238. "responses": {
  7239. "200": {
  7240. "description": "Prompt processed successfully",
  7241. "content": {
  7242. "application/json": {
  7243. "schema": {
  7244. "type": "boolean",
  7245. "description": "Prompt processed successfully"
  7246. }
  7247. }
  7248. }
  7249. },
  7250. "400": {
  7251. "description": "Bad request",
  7252. "content": {
  7253. "application/json": {
  7254. "schema": {
  7255. "$ref": "#/components/schemas/BadRequestError"
  7256. }
  7257. }
  7258. }
  7259. }
  7260. },
  7261. "description": "Append prompt to the TUI.",
  7262. "summary": "Append TUI prompt",
  7263. "requestBody": {
  7264. "content": {
  7265. "application/json": {
  7266. "schema": {
  7267. "type": "object",
  7268. "properties": {
  7269. "text": {
  7270. "type": "string"
  7271. }
  7272. },
  7273. "required": ["text"],
  7274. "additionalProperties": false
  7275. }
  7276. }
  7277. }
  7278. },
  7279. "x-codeSamples": [
  7280. {
  7281. "lang": "js",
  7282. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.appendPrompt({\n ...\n})"
  7283. }
  7284. ]
  7285. }
  7286. },
  7287. "/tui/open-help": {
  7288. "post": {
  7289. "tags": ["tui"],
  7290. "operationId": "tui.openHelp",
  7291. "parameters": [
  7292. {
  7293. "name": "directory",
  7294. "in": "query",
  7295. "required": false,
  7296. "schema": {
  7297. "type": "string"
  7298. }
  7299. },
  7300. {
  7301. "name": "workspace",
  7302. "in": "query",
  7303. "required": false,
  7304. "schema": {
  7305. "type": "string"
  7306. }
  7307. }
  7308. ],
  7309. "responses": {
  7310. "200": {
  7311. "description": "Help dialog opened successfully",
  7312. "content": {
  7313. "application/json": {
  7314. "schema": {
  7315. "type": "boolean",
  7316. "description": "Help dialog opened successfully"
  7317. }
  7318. }
  7319. }
  7320. }
  7321. },
  7322. "description": "Open the help dialog in the TUI to display user assistance information.",
  7323. "summary": "Open help dialog",
  7324. "x-codeSamples": [
  7325. {
  7326. "lang": "js",
  7327. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openHelp({\n ...\n})"
  7328. }
  7329. ]
  7330. }
  7331. },
  7332. "/tui/open-sessions": {
  7333. "post": {
  7334. "tags": ["tui"],
  7335. "operationId": "tui.openSessions",
  7336. "parameters": [
  7337. {
  7338. "name": "directory",
  7339. "in": "query",
  7340. "required": false,
  7341. "schema": {
  7342. "type": "string"
  7343. }
  7344. },
  7345. {
  7346. "name": "workspace",
  7347. "in": "query",
  7348. "required": false,
  7349. "schema": {
  7350. "type": "string"
  7351. }
  7352. }
  7353. ],
  7354. "responses": {
  7355. "200": {
  7356. "description": "Session dialog opened successfully",
  7357. "content": {
  7358. "application/json": {
  7359. "schema": {
  7360. "type": "boolean",
  7361. "description": "Session dialog opened successfully"
  7362. }
  7363. }
  7364. }
  7365. }
  7366. },
  7367. "description": "Open the session dialog.",
  7368. "summary": "Open sessions dialog",
  7369. "x-codeSamples": [
  7370. {
  7371. "lang": "js",
  7372. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openSessions({\n ...\n})"
  7373. }
  7374. ]
  7375. }
  7376. },
  7377. "/tui/open-themes": {
  7378. "post": {
  7379. "tags": ["tui"],
  7380. "operationId": "tui.openThemes",
  7381. "parameters": [
  7382. {
  7383. "name": "directory",
  7384. "in": "query",
  7385. "required": false,
  7386. "schema": {
  7387. "type": "string"
  7388. }
  7389. },
  7390. {
  7391. "name": "workspace",
  7392. "in": "query",
  7393. "required": false,
  7394. "schema": {
  7395. "type": "string"
  7396. }
  7397. }
  7398. ],
  7399. "responses": {
  7400. "200": {
  7401. "description": "Theme dialog opened successfully",
  7402. "content": {
  7403. "application/json": {
  7404. "schema": {
  7405. "type": "boolean",
  7406. "description": "Theme dialog opened successfully"
  7407. }
  7408. }
  7409. }
  7410. }
  7411. },
  7412. "description": "Open the theme dialog.",
  7413. "summary": "Open themes dialog",
  7414. "x-codeSamples": [
  7415. {
  7416. "lang": "js",
  7417. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openThemes({\n ...\n})"
  7418. }
  7419. ]
  7420. }
  7421. },
  7422. "/tui/open-models": {
  7423. "post": {
  7424. "tags": ["tui"],
  7425. "operationId": "tui.openModels",
  7426. "parameters": [
  7427. {
  7428. "name": "directory",
  7429. "in": "query",
  7430. "required": false,
  7431. "schema": {
  7432. "type": "string"
  7433. }
  7434. },
  7435. {
  7436. "name": "workspace",
  7437. "in": "query",
  7438. "required": false,
  7439. "schema": {
  7440. "type": "string"
  7441. }
  7442. }
  7443. ],
  7444. "responses": {
  7445. "200": {
  7446. "description": "Model dialog opened successfully",
  7447. "content": {
  7448. "application/json": {
  7449. "schema": {
  7450. "type": "boolean",
  7451. "description": "Model dialog opened successfully"
  7452. }
  7453. }
  7454. }
  7455. }
  7456. },
  7457. "description": "Open the model dialog.",
  7458. "summary": "Open models dialog",
  7459. "x-codeSamples": [
  7460. {
  7461. "lang": "js",
  7462. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openModels({\n ...\n})"
  7463. }
  7464. ]
  7465. }
  7466. },
  7467. "/tui/submit-prompt": {
  7468. "post": {
  7469. "tags": ["tui"],
  7470. "operationId": "tui.submitPrompt",
  7471. "parameters": [
  7472. {
  7473. "name": "directory",
  7474. "in": "query",
  7475. "required": false,
  7476. "schema": {
  7477. "type": "string"
  7478. }
  7479. },
  7480. {
  7481. "name": "workspace",
  7482. "in": "query",
  7483. "required": false,
  7484. "schema": {
  7485. "type": "string"
  7486. }
  7487. }
  7488. ],
  7489. "responses": {
  7490. "200": {
  7491. "description": "Prompt submitted successfully",
  7492. "content": {
  7493. "application/json": {
  7494. "schema": {
  7495. "type": "boolean",
  7496. "description": "Prompt submitted successfully"
  7497. }
  7498. }
  7499. }
  7500. }
  7501. },
  7502. "description": "Submit the prompt.",
  7503. "summary": "Submit TUI prompt",
  7504. "x-codeSamples": [
  7505. {
  7506. "lang": "js",
  7507. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.submitPrompt({\n ...\n})"
  7508. }
  7509. ]
  7510. }
  7511. },
  7512. "/tui/clear-prompt": {
  7513. "post": {
  7514. "tags": ["tui"],
  7515. "operationId": "tui.clearPrompt",
  7516. "parameters": [
  7517. {
  7518. "name": "directory",
  7519. "in": "query",
  7520. "required": false,
  7521. "schema": {
  7522. "type": "string"
  7523. }
  7524. },
  7525. {
  7526. "name": "workspace",
  7527. "in": "query",
  7528. "required": false,
  7529. "schema": {
  7530. "type": "string"
  7531. }
  7532. }
  7533. ],
  7534. "responses": {
  7535. "200": {
  7536. "description": "Prompt cleared successfully",
  7537. "content": {
  7538. "application/json": {
  7539. "schema": {
  7540. "type": "boolean",
  7541. "description": "Prompt cleared successfully"
  7542. }
  7543. }
  7544. }
  7545. }
  7546. },
  7547. "description": "Clear the prompt.",
  7548. "summary": "Clear TUI prompt",
  7549. "x-codeSamples": [
  7550. {
  7551. "lang": "js",
  7552. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.clearPrompt({\n ...\n})"
  7553. }
  7554. ]
  7555. }
  7556. },
  7557. "/tui/execute-command": {
  7558. "post": {
  7559. "tags": ["tui"],
  7560. "operationId": "tui.executeCommand",
  7561. "parameters": [
  7562. {
  7563. "name": "directory",
  7564. "in": "query",
  7565. "required": false,
  7566. "schema": {
  7567. "type": "string"
  7568. }
  7569. },
  7570. {
  7571. "name": "workspace",
  7572. "in": "query",
  7573. "required": false,
  7574. "schema": {
  7575. "type": "string"
  7576. }
  7577. }
  7578. ],
  7579. "responses": {
  7580. "200": {
  7581. "description": "Command executed successfully",
  7582. "content": {
  7583. "application/json": {
  7584. "schema": {
  7585. "type": "boolean",
  7586. "description": "Command executed successfully"
  7587. }
  7588. }
  7589. }
  7590. },
  7591. "400": {
  7592. "description": "Bad request",
  7593. "content": {
  7594. "application/json": {
  7595. "schema": {
  7596. "$ref": "#/components/schemas/BadRequestError"
  7597. }
  7598. }
  7599. }
  7600. }
  7601. },
  7602. "description": "Execute a TUI command.",
  7603. "summary": "Execute TUI command",
  7604. "requestBody": {
  7605. "content": {
  7606. "application/json": {
  7607. "schema": {
  7608. "type": "object",
  7609. "properties": {
  7610. "command": {
  7611. "type": "string"
  7612. }
  7613. },
  7614. "required": ["command"],
  7615. "additionalProperties": false
  7616. }
  7617. }
  7618. }
  7619. },
  7620. "x-codeSamples": [
  7621. {
  7622. "lang": "js",
  7623. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.executeCommand({\n ...\n})"
  7624. }
  7625. ]
  7626. }
  7627. },
  7628. "/tui/show-toast": {
  7629. "post": {
  7630. "tags": ["tui"],
  7631. "operationId": "tui.showToast",
  7632. "parameters": [
  7633. {
  7634. "name": "directory",
  7635. "in": "query",
  7636. "required": false,
  7637. "schema": {
  7638. "type": "string"
  7639. }
  7640. },
  7641. {
  7642. "name": "workspace",
  7643. "in": "query",
  7644. "required": false,
  7645. "schema": {
  7646. "type": "string"
  7647. }
  7648. }
  7649. ],
  7650. "responses": {
  7651. "200": {
  7652. "description": "Toast notification shown successfully",
  7653. "content": {
  7654. "application/json": {
  7655. "schema": {
  7656. "type": "boolean",
  7657. "description": "Toast notification shown successfully"
  7658. }
  7659. }
  7660. }
  7661. }
  7662. },
  7663. "description": "Show a toast notification in the TUI.",
  7664. "summary": "Show TUI toast",
  7665. "requestBody": {
  7666. "content": {
  7667. "application/json": {
  7668. "schema": {
  7669. "type": "object",
  7670. "properties": {
  7671. "title": {
  7672. "type": "string"
  7673. },
  7674. "message": {
  7675. "type": "string"
  7676. },
  7677. "variant": {
  7678. "type": "string",
  7679. "enum": ["info", "success", "warning", "error"]
  7680. },
  7681. "duration": {
  7682. "type": "integer",
  7683. "exclusiveMinimum": 0
  7684. }
  7685. },
  7686. "required": ["message", "variant"],
  7687. "additionalProperties": false
  7688. }
  7689. }
  7690. }
  7691. },
  7692. "x-codeSamples": [
  7693. {
  7694. "lang": "js",
  7695. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.showToast({\n ...\n})"
  7696. }
  7697. ]
  7698. }
  7699. },
  7700. "/tui/publish": {
  7701. "post": {
  7702. "tags": ["tui"],
  7703. "operationId": "tui.publish",
  7704. "parameters": [
  7705. {
  7706. "name": "directory",
  7707. "in": "query",
  7708. "required": false,
  7709. "schema": {
  7710. "type": "string"
  7711. }
  7712. },
  7713. {
  7714. "name": "workspace",
  7715. "in": "query",
  7716. "required": false,
  7717. "schema": {
  7718. "type": "string"
  7719. }
  7720. }
  7721. ],
  7722. "responses": {
  7723. "200": {
  7724. "description": "Event published successfully",
  7725. "content": {
  7726. "application/json": {
  7727. "schema": {
  7728. "type": "boolean",
  7729. "description": "Event published successfully"
  7730. }
  7731. }
  7732. }
  7733. },
  7734. "400": {
  7735. "description": "Bad request",
  7736. "content": {
  7737. "application/json": {
  7738. "schema": {
  7739. "$ref": "#/components/schemas/BadRequestError"
  7740. }
  7741. }
  7742. }
  7743. }
  7744. },
  7745. "description": "Publish a TUI event.",
  7746. "summary": "Publish TUI event",
  7747. "requestBody": {
  7748. "content": {
  7749. "application/json": {
  7750. "schema": {
  7751. "anyOf": [
  7752. {
  7753. "$ref": "#/components/schemas/EventTuiPromptAppend"
  7754. },
  7755. {
  7756. "$ref": "#/components/schemas/EventTuiCommandExecute"
  7757. },
  7758. {
  7759. "$ref": "#/components/schemas/EventTuiToastShow"
  7760. },
  7761. {
  7762. "$ref": "#/components/schemas/EventTuiSessionSelect"
  7763. }
  7764. ]
  7765. }
  7766. }
  7767. }
  7768. },
  7769. "x-codeSamples": [
  7770. {
  7771. "lang": "js",
  7772. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.publish({\n ...\n})"
  7773. }
  7774. ]
  7775. }
  7776. },
  7777. "/tui/select-session": {
  7778. "post": {
  7779. "tags": ["tui"],
  7780. "operationId": "tui.selectSession",
  7781. "parameters": [
  7782. {
  7783. "name": "directory",
  7784. "in": "query",
  7785. "required": false,
  7786. "schema": {
  7787. "type": "string"
  7788. }
  7789. },
  7790. {
  7791. "name": "workspace",
  7792. "in": "query",
  7793. "required": false,
  7794. "schema": {
  7795. "type": "string"
  7796. }
  7797. }
  7798. ],
  7799. "responses": {
  7800. "200": {
  7801. "description": "Session selected successfully",
  7802. "content": {
  7803. "application/json": {
  7804. "schema": {
  7805. "type": "boolean",
  7806. "description": "Session selected successfully"
  7807. }
  7808. }
  7809. }
  7810. },
  7811. "400": {
  7812. "description": "Bad request",
  7813. "content": {
  7814. "application/json": {
  7815. "schema": {
  7816. "$ref": "#/components/schemas/BadRequestError"
  7817. }
  7818. }
  7819. }
  7820. },
  7821. "404": {
  7822. "description": "Not found",
  7823. "content": {
  7824. "application/json": {
  7825. "schema": {
  7826. "$ref": "#/components/schemas/NotFoundError"
  7827. }
  7828. }
  7829. }
  7830. }
  7831. },
  7832. "description": "Navigate the TUI to display the specified session.",
  7833. "summary": "Select session",
  7834. "requestBody": {
  7835. "content": {
  7836. "application/json": {
  7837. "schema": {
  7838. "type": "object",
  7839. "properties": {
  7840. "sessionID": {
  7841. "type": "string",
  7842. "description": "Session ID to navigate to"
  7843. }
  7844. },
  7845. "required": ["sessionID"],
  7846. "additionalProperties": false
  7847. }
  7848. }
  7849. }
  7850. },
  7851. "x-codeSamples": [
  7852. {
  7853. "lang": "js",
  7854. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.selectSession({\n ...\n})"
  7855. }
  7856. ]
  7857. }
  7858. },
  7859. "/tui/control/next": {
  7860. "get": {
  7861. "tags": ["tui"],
  7862. "operationId": "tui.control.next",
  7863. "parameters": [
  7864. {
  7865. "name": "directory",
  7866. "in": "query",
  7867. "required": false,
  7868. "schema": {
  7869. "type": "string"
  7870. }
  7871. },
  7872. {
  7873. "name": "workspace",
  7874. "in": "query",
  7875. "required": false,
  7876. "schema": {
  7877. "type": "string"
  7878. }
  7879. }
  7880. ],
  7881. "responses": {
  7882. "200": {
  7883. "description": "Next TUI request",
  7884. "content": {
  7885. "application/json": {
  7886. "schema": {
  7887. "type": "object",
  7888. "properties": {
  7889. "path": {
  7890. "type": "string"
  7891. },
  7892. "body": {}
  7893. },
  7894. "required": ["path", "body"],
  7895. "additionalProperties": false,
  7896. "description": "Next TUI request"
  7897. }
  7898. }
  7899. }
  7900. }
  7901. },
  7902. "description": "Retrieve the next TUI request from the queue for processing.",
  7903. "summary": "Get next TUI request",
  7904. "x-codeSamples": [
  7905. {
  7906. "lang": "js",
  7907. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.control.next({\n ...\n})"
  7908. }
  7909. ]
  7910. }
  7911. },
  7912. "/tui/control/response": {
  7913. "post": {
  7914. "tags": ["tui"],
  7915. "operationId": "tui.control.response",
  7916. "parameters": [
  7917. {
  7918. "name": "directory",
  7919. "in": "query",
  7920. "required": false,
  7921. "schema": {
  7922. "type": "string"
  7923. }
  7924. },
  7925. {
  7926. "name": "workspace",
  7927. "in": "query",
  7928. "required": false,
  7929. "schema": {
  7930. "type": "string"
  7931. }
  7932. }
  7933. ],
  7934. "responses": {
  7935. "200": {
  7936. "description": "Response submitted successfully",
  7937. "content": {
  7938. "application/json": {
  7939. "schema": {
  7940. "type": "boolean",
  7941. "description": "Response submitted successfully"
  7942. }
  7943. }
  7944. }
  7945. }
  7946. },
  7947. "description": "Submit a response to the TUI request queue to complete a pending request.",
  7948. "summary": "Submit TUI response",
  7949. "requestBody": {
  7950. "content": {
  7951. "application/json": {
  7952. "schema": {}
  7953. }
  7954. }
  7955. },
  7956. "x-codeSamples": [
  7957. {
  7958. "lang": "js",
  7959. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.control.response({\n ...\n})"
  7960. }
  7961. ]
  7962. }
  7963. },
  7964. "/experimental/workspace/adapter": {
  7965. "get": {
  7966. "tags": ["workspace"],
  7967. "operationId": "experimental.workspace.adapter.list",
  7968. "parameters": [
  7969. {
  7970. "name": "directory",
  7971. "in": "query",
  7972. "required": false,
  7973. "schema": {
  7974. "type": "string"
  7975. }
  7976. },
  7977. {
  7978. "name": "workspace",
  7979. "in": "query",
  7980. "required": false,
  7981. "schema": {
  7982. "type": "string"
  7983. }
  7984. }
  7985. ],
  7986. "responses": {
  7987. "200": {
  7988. "description": "Workspace adapters",
  7989. "content": {
  7990. "application/json": {
  7991. "schema": {
  7992. "type": "array",
  7993. "items": {
  7994. "type": "object",
  7995. "properties": {
  7996. "type": {
  7997. "type": "string"
  7998. },
  7999. "name": {
  8000. "type": "string"
  8001. },
  8002. "description": {
  8003. "type": "string"
  8004. }
  8005. },
  8006. "required": ["type", "name", "description"],
  8007. "additionalProperties": false
  8008. },
  8009. "description": "Workspace adapters"
  8010. }
  8011. }
  8012. }
  8013. }
  8014. },
  8015. "description": "List all available workspace adapters for the current project.",
  8016. "summary": "List workspace adapters",
  8017. "x-codeSamples": [
  8018. {
  8019. "lang": "js",
  8020. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.adapter.list({\n ...\n})"
  8021. }
  8022. ]
  8023. }
  8024. },
  8025. "/experimental/workspace": {
  8026. "get": {
  8027. "tags": ["workspace"],
  8028. "operationId": "experimental.workspace.list",
  8029. "parameters": [
  8030. {
  8031. "name": "directory",
  8032. "in": "query",
  8033. "required": false,
  8034. "schema": {
  8035. "type": "string"
  8036. }
  8037. },
  8038. {
  8039. "name": "workspace",
  8040. "in": "query",
  8041. "required": false,
  8042. "schema": {
  8043. "type": "string"
  8044. }
  8045. }
  8046. ],
  8047. "responses": {
  8048. "200": {
  8049. "description": "Workspaces",
  8050. "content": {
  8051. "application/json": {
  8052. "schema": {
  8053. "type": "array",
  8054. "items": {
  8055. "$ref": "#/components/schemas/Workspace"
  8056. },
  8057. "description": "Workspaces"
  8058. }
  8059. }
  8060. }
  8061. }
  8062. },
  8063. "description": "List all workspaces.",
  8064. "summary": "List workspaces",
  8065. "x-codeSamples": [
  8066. {
  8067. "lang": "js",
  8068. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.list({\n ...\n})"
  8069. }
  8070. ]
  8071. },
  8072. "post": {
  8073. "tags": ["workspace"],
  8074. "operationId": "experimental.workspace.create",
  8075. "parameters": [
  8076. {
  8077. "name": "directory",
  8078. "in": "query",
  8079. "required": false,
  8080. "schema": {
  8081. "type": "string"
  8082. }
  8083. },
  8084. {
  8085. "name": "workspace",
  8086. "in": "query",
  8087. "required": false,
  8088. "schema": {
  8089. "type": "string"
  8090. }
  8091. }
  8092. ],
  8093. "responses": {
  8094. "200": {
  8095. "description": "Workspace created",
  8096. "content": {
  8097. "application/json": {
  8098. "schema": {
  8099. "$ref": "#/components/schemas/Workspace"
  8100. }
  8101. }
  8102. }
  8103. },
  8104. "400": {
  8105. "description": "Bad request",
  8106. "content": {
  8107. "application/json": {
  8108. "schema": {
  8109. "$ref": "#/components/schemas/BadRequestError"
  8110. }
  8111. }
  8112. }
  8113. }
  8114. },
  8115. "description": "Create a workspace for the current project.",
  8116. "summary": "Create workspace",
  8117. "requestBody": {
  8118. "content": {
  8119. "application/json": {
  8120. "schema": {
  8121. "type": "object",
  8122. "properties": {
  8123. "id": {
  8124. "type": "string"
  8125. },
  8126. "type": {
  8127. "type": "string"
  8128. },
  8129. "branch": {
  8130. "anyOf": [
  8131. {
  8132. "type": "string"
  8133. },
  8134. {
  8135. "type": "null"
  8136. }
  8137. ]
  8138. },
  8139. "extra": {
  8140. "anyOf": [
  8141. {},
  8142. {
  8143. "type": "null"
  8144. }
  8145. ]
  8146. }
  8147. },
  8148. "required": ["type", "branch"],
  8149. "additionalProperties": false
  8150. }
  8151. }
  8152. }
  8153. },
  8154. "x-codeSamples": [
  8155. {
  8156. "lang": "js",
  8157. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.create({\n ...\n})"
  8158. }
  8159. ]
  8160. }
  8161. },
  8162. "/experimental/workspace/status": {
  8163. "get": {
  8164. "tags": ["workspace"],
  8165. "operationId": "experimental.workspace.status",
  8166. "parameters": [
  8167. {
  8168. "name": "directory",
  8169. "in": "query",
  8170. "required": false,
  8171. "schema": {
  8172. "type": "string"
  8173. }
  8174. },
  8175. {
  8176. "name": "workspace",
  8177. "in": "query",
  8178. "required": false,
  8179. "schema": {
  8180. "type": "string"
  8181. }
  8182. }
  8183. ],
  8184. "responses": {
  8185. "200": {
  8186. "description": "Workspace status",
  8187. "content": {
  8188. "application/json": {
  8189. "schema": {
  8190. "type": "array",
  8191. "items": {
  8192. "type": "object",
  8193. "properties": {
  8194. "workspaceID": {
  8195. "type": "string"
  8196. },
  8197. "status": {
  8198. "type": "string",
  8199. "enum": ["connected", "connecting", "disconnected", "error"]
  8200. }
  8201. },
  8202. "required": ["workspaceID", "status"],
  8203. "additionalProperties": false
  8204. },
  8205. "description": "Workspace status"
  8206. }
  8207. }
  8208. }
  8209. }
  8210. },
  8211. "description": "Get connection status for workspaces in the current project.",
  8212. "summary": "Workspace status",
  8213. "x-codeSamples": [
  8214. {
  8215. "lang": "js",
  8216. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.status({\n ...\n})"
  8217. }
  8218. ]
  8219. }
  8220. },
  8221. "/experimental/workspace/{id}": {
  8222. "delete": {
  8223. "tags": ["workspace"],
  8224. "operationId": "experimental.workspace.remove",
  8225. "parameters": [
  8226. {
  8227. "name": "directory",
  8228. "in": "query",
  8229. "required": false,
  8230. "schema": {
  8231. "type": "string"
  8232. }
  8233. },
  8234. {
  8235. "name": "workspace",
  8236. "in": "query",
  8237. "required": false,
  8238. "schema": {
  8239. "type": "string"
  8240. }
  8241. },
  8242. {
  8243. "name": "id",
  8244. "in": "path",
  8245. "schema": {
  8246. "type": "string",
  8247. "pattern": "^wrk.*"
  8248. },
  8249. "required": true
  8250. }
  8251. ],
  8252. "responses": {
  8253. "200": {
  8254. "description": "Workspace removed",
  8255. "content": {
  8256. "application/json": {
  8257. "schema": {
  8258. "$ref": "#/components/schemas/Workspace"
  8259. }
  8260. }
  8261. }
  8262. },
  8263. "400": {
  8264. "description": "Bad request",
  8265. "content": {
  8266. "application/json": {
  8267. "schema": {
  8268. "$ref": "#/components/schemas/BadRequestError"
  8269. }
  8270. }
  8271. }
  8272. }
  8273. },
  8274. "description": "Remove an existing workspace.",
  8275. "summary": "Remove workspace",
  8276. "x-codeSamples": [
  8277. {
  8278. "lang": "js",
  8279. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.remove({\n ...\n})"
  8280. }
  8281. ]
  8282. }
  8283. },
  8284. "/experimental/workspace/{id}/session-restore": {
  8285. "post": {
  8286. "tags": ["workspace"],
  8287. "operationId": "experimental.workspace.sessionRestore",
  8288. "parameters": [
  8289. {
  8290. "name": "directory",
  8291. "in": "query",
  8292. "required": false,
  8293. "schema": {
  8294. "type": "string"
  8295. }
  8296. },
  8297. {
  8298. "name": "workspace",
  8299. "in": "query",
  8300. "required": false,
  8301. "schema": {
  8302. "type": "string"
  8303. }
  8304. },
  8305. {
  8306. "name": "id",
  8307. "in": "path",
  8308. "schema": {
  8309. "type": "string",
  8310. "pattern": "^wrk.*"
  8311. },
  8312. "required": true
  8313. }
  8314. ],
  8315. "responses": {
  8316. "200": {
  8317. "description": "Session replay started",
  8318. "content": {
  8319. "application/json": {
  8320. "schema": {
  8321. "type": "object",
  8322. "properties": {
  8323. "total": {
  8324. "type": "integer",
  8325. "minimum": 0
  8326. }
  8327. },
  8328. "required": ["total"],
  8329. "additionalProperties": false,
  8330. "description": "Session replay started"
  8331. }
  8332. }
  8333. }
  8334. },
  8335. "400": {
  8336. "description": "Bad request",
  8337. "content": {
  8338. "application/json": {
  8339. "schema": {
  8340. "$ref": "#/components/schemas/BadRequestError"
  8341. }
  8342. }
  8343. }
  8344. }
  8345. },
  8346. "description": "Replay a session's sync events into the target workspace in batches.",
  8347. "summary": "Restore session into workspace",
  8348. "requestBody": {
  8349. "content": {
  8350. "application/json": {
  8351. "schema": {
  8352. "type": "object",
  8353. "properties": {
  8354. "sessionID": {
  8355. "type": "string"
  8356. }
  8357. },
  8358. "required": ["sessionID"],
  8359. "additionalProperties": false
  8360. }
  8361. }
  8362. }
  8363. },
  8364. "x-codeSamples": [
  8365. {
  8366. "lang": "js",
  8367. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.sessionRestore({\n ...\n})"
  8368. }
  8369. ]
  8370. }
  8371. },
  8372. "/pty/{ptyID}/connect": {
  8373. "get": {
  8374. "tags": ["pty"],
  8375. "operationId": "pty.connect",
  8376. "parameters": [
  8377. {
  8378. "name": "directory",
  8379. "in": "query",
  8380. "required": false,
  8381. "schema": {
  8382. "type": "string"
  8383. }
  8384. },
  8385. {
  8386. "name": "workspace",
  8387. "in": "query",
  8388. "required": false,
  8389. "schema": {
  8390. "type": "string"
  8391. }
  8392. },
  8393. {
  8394. "name": "ptyID",
  8395. "in": "path",
  8396. "schema": {
  8397. "type": "string",
  8398. "pattern": "^pty.*"
  8399. },
  8400. "required": true
  8401. }
  8402. ],
  8403. "responses": {
  8404. "200": {
  8405. "description": "Connected session",
  8406. "content": {
  8407. "application/json": {
  8408. "schema": {
  8409. "type": "boolean",
  8410. "description": "Connected session"
  8411. }
  8412. }
  8413. }
  8414. },
  8415. "403": {
  8416. "description": "Forbidden",
  8417. "content": {
  8418. "application/json": {
  8419. "schema": {
  8420. "$ref": "#/components/schemas/effect_HttpApiError_Forbidden"
  8421. }
  8422. }
  8423. }
  8424. },
  8425. "404": {
  8426. "description": "Not found",
  8427. "content": {
  8428. "application/json": {
  8429. "schema": {
  8430. "$ref": "#/components/schemas/NotFoundError"
  8431. }
  8432. }
  8433. }
  8434. }
  8435. },
  8436. "description": "Establish a WebSocket connection to interact with a pseudo-terminal (PTY) session in real-time.",
  8437. "summary": "Connect to PTY session",
  8438. "x-codeSamples": [
  8439. {
  8440. "lang": "js",
  8441. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.connect({\n ...\n})"
  8442. }
  8443. ]
  8444. }
  8445. }
  8446. },
  8447. "components": {
  8448. "schemas": {
  8449. "Event": {
  8450. "anyOf": [
  8451. {
  8452. "$ref": "#/components/schemas/EventServerInstanceDisposed"
  8453. },
  8454. {
  8455. "$ref": "#/components/schemas/EventFileEdited"
  8456. },
  8457. {
  8458. "$ref": "#/components/schemas/EventFileWatcherUpdated"
  8459. },
  8460. {
  8461. "$ref": "#/components/schemas/EventLspClientDiagnostics"
  8462. },
  8463. {
  8464. "$ref": "#/components/schemas/EventLspUpdated"
  8465. },
  8466. {
  8467. "$ref": "#/components/schemas/EventMessagePartDelta"
  8468. },
  8469. {
  8470. "$ref": "#/components/schemas/EventPermissionAsked"
  8471. },
  8472. {
  8473. "$ref": "#/components/schemas/EventPermissionReplied"
  8474. },
  8475. {
  8476. "$ref": "#/components/schemas/EventSessionDiff"
  8477. },
  8478. {
  8479. "$ref": "#/components/schemas/EventSessionError"
  8480. },
  8481. {
  8482. "$ref": "#/components/schemas/EventInstallationUpdated"
  8483. },
  8484. {
  8485. "$ref": "#/components/schemas/EventInstallationUpdate-available"
  8486. },
  8487. {
  8488. "$ref": "#/components/schemas/EventQuestionAsked"
  8489. },
  8490. {
  8491. "$ref": "#/components/schemas/EventQuestionReplied"
  8492. },
  8493. {
  8494. "$ref": "#/components/schemas/EventQuestionRejected"
  8495. },
  8496. {
  8497. "$ref": "#/components/schemas/EventTodoUpdated"
  8498. },
  8499. {
  8500. "$ref": "#/components/schemas/EventSessionStatus"
  8501. },
  8502. {
  8503. "$ref": "#/components/schemas/EventSessionIdle"
  8504. },
  8505. {
  8506. "$ref": "#/components/schemas/EventSessionCompacted"
  8507. },
  8508. {
  8509. "$ref": "#/components/schemas/Event.tui.prompt.append"
  8510. },
  8511. {
  8512. "$ref": "#/components/schemas/Event.tui.command.execute"
  8513. },
  8514. {
  8515. "$ref": "#/components/schemas/EventTuiToastShow1"
  8516. },
  8517. {
  8518. "$ref": "#/components/schemas/Event.tui.session.select"
  8519. },
  8520. {
  8521. "$ref": "#/components/schemas/EventMcpToolsChanged"
  8522. },
  8523. {
  8524. "$ref": "#/components/schemas/EventMcpBrowserOpenFailed"
  8525. },
  8526. {
  8527. "$ref": "#/components/schemas/EventCommandExecuted"
  8528. },
  8529. {
  8530. "$ref": "#/components/schemas/EventProjectUpdated"
  8531. },
  8532. {
  8533. "$ref": "#/components/schemas/EventVcsBranchUpdated"
  8534. },
  8535. {
  8536. "$ref": "#/components/schemas/EventWorkspaceReady"
  8537. },
  8538. {
  8539. "$ref": "#/components/schemas/EventWorkspaceFailed"
  8540. },
  8541. {
  8542. "$ref": "#/components/schemas/EventWorkspaceRestore"
  8543. },
  8544. {
  8545. "$ref": "#/components/schemas/EventWorkspaceStatus"
  8546. },
  8547. {
  8548. "$ref": "#/components/schemas/EventWorktreeReady"
  8549. },
  8550. {
  8551. "$ref": "#/components/schemas/EventWorktreeFailed"
  8552. },
  8553. {
  8554. "$ref": "#/components/schemas/EventPtyCreated"
  8555. },
  8556. {
  8557. "$ref": "#/components/schemas/EventPtyUpdated"
  8558. },
  8559. {
  8560. "$ref": "#/components/schemas/EventPtyExited"
  8561. },
  8562. {
  8563. "$ref": "#/components/schemas/EventPtyDeleted"
  8564. },
  8565. {
  8566. "$ref": "#/components/schemas/EventMessageUpdated"
  8567. },
  8568. {
  8569. "$ref": "#/components/schemas/EventMessageRemoved"
  8570. },
  8571. {
  8572. "$ref": "#/components/schemas/EventMessagePartUpdated"
  8573. },
  8574. {
  8575. "$ref": "#/components/schemas/EventMessagePartRemoved"
  8576. },
  8577. {
  8578. "$ref": "#/components/schemas/EventSessionCreated"
  8579. },
  8580. {
  8581. "$ref": "#/components/schemas/EventSessionUpdated"
  8582. },
  8583. {
  8584. "$ref": "#/components/schemas/EventSessionDeleted"
  8585. },
  8586. {
  8587. "$ref": "#/components/schemas/EventSessionNextAgentSwitched"
  8588. },
  8589. {
  8590. "$ref": "#/components/schemas/EventSessionNextModelSwitched"
  8591. },
  8592. {
  8593. "$ref": "#/components/schemas/EventSessionNextPrompted"
  8594. },
  8595. {
  8596. "$ref": "#/components/schemas/EventSessionNextSynthetic"
  8597. },
  8598. {
  8599. "$ref": "#/components/schemas/EventSessionNextShellStarted"
  8600. },
  8601. {
  8602. "$ref": "#/components/schemas/EventSessionNextShellEnded"
  8603. },
  8604. {
  8605. "$ref": "#/components/schemas/EventSessionNextStepStarted"
  8606. },
  8607. {
  8608. "$ref": "#/components/schemas/EventSessionNextStepEnded"
  8609. },
  8610. {
  8611. "$ref": "#/components/schemas/EventSessionNextStepFailed"
  8612. },
  8613. {
  8614. "$ref": "#/components/schemas/EventSessionNextTextStarted"
  8615. },
  8616. {
  8617. "$ref": "#/components/schemas/EventSessionNextTextDelta"
  8618. },
  8619. {
  8620. "$ref": "#/components/schemas/EventSessionNextTextEnded"
  8621. },
  8622. {
  8623. "$ref": "#/components/schemas/EventSessionNextReasoningStarted"
  8624. },
  8625. {
  8626. "$ref": "#/components/schemas/EventSessionNextReasoningDelta"
  8627. },
  8628. {
  8629. "$ref": "#/components/schemas/EventSessionNextReasoningEnded"
  8630. },
  8631. {
  8632. "$ref": "#/components/schemas/EventSessionNextToolInputStarted"
  8633. },
  8634. {
  8635. "$ref": "#/components/schemas/EventSessionNextToolInputDelta"
  8636. },
  8637. {
  8638. "$ref": "#/components/schemas/EventSessionNextToolInputEnded"
  8639. },
  8640. {
  8641. "$ref": "#/components/schemas/EventSessionNextToolCalled"
  8642. },
  8643. {
  8644. "$ref": "#/components/schemas/EventSessionNextToolProgress"
  8645. },
  8646. {
  8647. "$ref": "#/components/schemas/EventSessionNextToolSuccess"
  8648. },
  8649. {
  8650. "$ref": "#/components/schemas/EventSessionNextToolFailed"
  8651. },
  8652. {
  8653. "$ref": "#/components/schemas/EventSessionNextRetried"
  8654. },
  8655. {
  8656. "$ref": "#/components/schemas/EventSessionNextCompactionStarted"
  8657. },
  8658. {
  8659. "$ref": "#/components/schemas/EventSessionNextCompactionDelta"
  8660. },
  8661. {
  8662. "$ref": "#/components/schemas/EventSessionNextCompactionEnded"
  8663. },
  8664. {
  8665. "$ref": "#/components/schemas/EventServerConnected"
  8666. },
  8667. {
  8668. "$ref": "#/components/schemas/EventGlobalDisposed"
  8669. }
  8670. ]
  8671. },
  8672. "OAuth": {
  8673. "type": "object",
  8674. "properties": {
  8675. "type": {
  8676. "type": "string",
  8677. "enum": ["oauth"]
  8678. },
  8679. "refresh": {
  8680. "type": "string"
  8681. },
  8682. "access": {
  8683. "type": "string"
  8684. },
  8685. "expires": {
  8686. "type": "integer",
  8687. "minimum": 0
  8688. },
  8689. "accountId": {
  8690. "type": "string"
  8691. },
  8692. "enterpriseUrl": {
  8693. "type": "string"
  8694. }
  8695. },
  8696. "required": ["type", "refresh", "access", "expires"],
  8697. "additionalProperties": false
  8698. },
  8699. "ApiAuth": {
  8700. "type": "object",
  8701. "properties": {
  8702. "type": {
  8703. "type": "string",
  8704. "enum": ["api"]
  8705. },
  8706. "key": {
  8707. "type": "string"
  8708. },
  8709. "metadata": {
  8710. "type": "object",
  8711. "additionalProperties": {
  8712. "type": "string"
  8713. }
  8714. }
  8715. },
  8716. "required": ["type", "key"],
  8717. "additionalProperties": false
  8718. },
  8719. "WellKnownAuth": {
  8720. "type": "object",
  8721. "properties": {
  8722. "type": {
  8723. "type": "string",
  8724. "enum": ["wellknown"]
  8725. },
  8726. "key": {
  8727. "type": "string"
  8728. },
  8729. "token": {
  8730. "type": "string"
  8731. }
  8732. },
  8733. "required": ["type", "key", "token"],
  8734. "additionalProperties": false
  8735. },
  8736. "Auth": {
  8737. "anyOf": [
  8738. {
  8739. "$ref": "#/components/schemas/OAuth"
  8740. },
  8741. {
  8742. "$ref": "#/components/schemas/ApiAuth"
  8743. },
  8744. {
  8745. "$ref": "#/components/schemas/WellKnownAuth"
  8746. }
  8747. ]
  8748. },
  8749. "PermissionRequest": {
  8750. "type": "object",
  8751. "properties": {
  8752. "id": {
  8753. "type": "string"
  8754. },
  8755. "sessionID": {
  8756. "type": "string"
  8757. },
  8758. "permission": {
  8759. "type": "string"
  8760. },
  8761. "patterns": {
  8762. "type": "array",
  8763. "items": {
  8764. "type": "string"
  8765. }
  8766. },
  8767. "metadata": {
  8768. "type": "object"
  8769. },
  8770. "always": {
  8771. "type": "array",
  8772. "items": {
  8773. "type": "string"
  8774. }
  8775. },
  8776. "tool": {
  8777. "type": "object",
  8778. "properties": {
  8779. "messageID": {
  8780. "type": "string"
  8781. },
  8782. "callID": {
  8783. "type": "string"
  8784. }
  8785. },
  8786. "required": ["messageID", "callID"],
  8787. "additionalProperties": false
  8788. }
  8789. },
  8790. "required": ["id", "sessionID", "permission", "patterns", "metadata", "always"],
  8791. "additionalProperties": false
  8792. },
  8793. "SnapshotFileDiff": {
  8794. "type": "object",
  8795. "properties": {
  8796. "file": {
  8797. "type": "string"
  8798. },
  8799. "patch": {
  8800. "type": "string"
  8801. },
  8802. "additions": {
  8803. "type": "integer",
  8804. "minimum": 0
  8805. },
  8806. "deletions": {
  8807. "type": "integer",
  8808. "minimum": 0
  8809. },
  8810. "status": {
  8811. "type": "string",
  8812. "enum": ["added", "deleted", "modified"]
  8813. }
  8814. },
  8815. "required": ["file", "patch", "additions", "deletions"],
  8816. "additionalProperties": false
  8817. },
  8818. "ProviderAuthError": {
  8819. "type": "object",
  8820. "properties": {
  8821. "name": {
  8822. "type": "string",
  8823. "enum": ["ProviderAuthError"]
  8824. },
  8825. "data": {
  8826. "type": "object",
  8827. "properties": {
  8828. "providerID": {
  8829. "type": "string"
  8830. },
  8831. "message": {
  8832. "type": "string"
  8833. }
  8834. },
  8835. "required": ["providerID", "message"],
  8836. "additionalProperties": false
  8837. }
  8838. },
  8839. "required": ["name", "data"],
  8840. "additionalProperties": false
  8841. },
  8842. "UnknownError": {
  8843. "type": "object",
  8844. "properties": {
  8845. "name": {
  8846. "type": "string",
  8847. "enum": ["UnknownError"]
  8848. },
  8849. "data": {
  8850. "type": "object",
  8851. "properties": {
  8852. "message": {
  8853. "type": "string"
  8854. }
  8855. },
  8856. "required": ["message"],
  8857. "additionalProperties": false
  8858. }
  8859. },
  8860. "required": ["name", "data"],
  8861. "additionalProperties": false
  8862. },
  8863. "MessageOutputLengthError": {
  8864. "type": "object",
  8865. "properties": {
  8866. "name": {
  8867. "type": "string",
  8868. "enum": ["MessageOutputLengthError"]
  8869. },
  8870. "data": {
  8871. "type": "object",
  8872. "properties": {}
  8873. }
  8874. },
  8875. "required": ["name", "data"],
  8876. "additionalProperties": false
  8877. },
  8878. "MessageAbortedError": {
  8879. "type": "object",
  8880. "properties": {
  8881. "name": {
  8882. "type": "string",
  8883. "enum": ["MessageAbortedError"]
  8884. },
  8885. "data": {
  8886. "type": "object",
  8887. "properties": {
  8888. "message": {
  8889. "type": "string"
  8890. }
  8891. },
  8892. "required": ["message"],
  8893. "additionalProperties": false
  8894. }
  8895. },
  8896. "required": ["name", "data"],
  8897. "additionalProperties": false
  8898. },
  8899. "StructuredOutputError": {
  8900. "type": "object",
  8901. "properties": {
  8902. "name": {
  8903. "type": "string",
  8904. "enum": ["StructuredOutputError"]
  8905. },
  8906. "data": {
  8907. "type": "object",
  8908. "properties": {
  8909. "message": {
  8910. "type": "string"
  8911. },
  8912. "retries": {
  8913. "type": "integer",
  8914. "minimum": 0
  8915. }
  8916. },
  8917. "required": ["message", "retries"],
  8918. "additionalProperties": false
  8919. }
  8920. },
  8921. "required": ["name", "data"],
  8922. "additionalProperties": false
  8923. },
  8924. "ContextOverflowError": {
  8925. "type": "object",
  8926. "properties": {
  8927. "name": {
  8928. "type": "string",
  8929. "enum": ["ContextOverflowError"]
  8930. },
  8931. "data": {
  8932. "type": "object",
  8933. "properties": {
  8934. "message": {
  8935. "type": "string"
  8936. },
  8937. "responseBody": {
  8938. "type": "string"
  8939. }
  8940. },
  8941. "required": ["message"],
  8942. "additionalProperties": false
  8943. }
  8944. },
  8945. "required": ["name", "data"],
  8946. "additionalProperties": false
  8947. },
  8948. "APIError": {
  8949. "type": "object",
  8950. "properties": {
  8951. "name": {
  8952. "type": "string",
  8953. "enum": ["APIError"]
  8954. },
  8955. "data": {
  8956. "type": "object",
  8957. "properties": {
  8958. "message": {
  8959. "type": "string"
  8960. },
  8961. "statusCode": {
  8962. "type": "integer",
  8963. "minimum": 0
  8964. },
  8965. "isRetryable": {
  8966. "type": "boolean"
  8967. },
  8968. "responseHeaders": {
  8969. "type": "object",
  8970. "additionalProperties": {
  8971. "type": "string"
  8972. }
  8973. },
  8974. "responseBody": {
  8975. "type": "string"
  8976. },
  8977. "metadata": {
  8978. "type": "object",
  8979. "additionalProperties": {
  8980. "type": "string"
  8981. }
  8982. }
  8983. },
  8984. "required": ["message", "isRetryable"],
  8985. "additionalProperties": false
  8986. }
  8987. },
  8988. "required": ["name", "data"],
  8989. "additionalProperties": false
  8990. },
  8991. "QuestionOption": {
  8992. "type": "object",
  8993. "properties": {
  8994. "label": {
  8995. "type": "string",
  8996. "description": "Display text (1-5 words, concise)"
  8997. },
  8998. "description": {
  8999. "type": "string",
  9000. "description": "Explanation of choice"
  9001. }
  9002. },
  9003. "required": ["label", "description"],
  9004. "additionalProperties": false
  9005. },
  9006. "QuestionInfo": {
  9007. "type": "object",
  9008. "properties": {
  9009. "question": {
  9010. "type": "string",
  9011. "description": "Complete question"
  9012. },
  9013. "header": {
  9014. "type": "string",
  9015. "description": "Very short label (max 30 chars)"
  9016. },
  9017. "options": {
  9018. "type": "array",
  9019. "items": {
  9020. "$ref": "#/components/schemas/QuestionOption"
  9021. },
  9022. "description": "Available choices"
  9023. },
  9024. "multiple": {
  9025. "type": "boolean"
  9026. },
  9027. "custom": {
  9028. "type": "boolean"
  9029. }
  9030. },
  9031. "required": ["question", "header", "options"],
  9032. "additionalProperties": false
  9033. },
  9034. "QuestionTool": {
  9035. "type": "object",
  9036. "properties": {
  9037. "messageID": {
  9038. "type": "string"
  9039. },
  9040. "callID": {
  9041. "type": "string"
  9042. }
  9043. },
  9044. "required": ["messageID", "callID"],
  9045. "additionalProperties": false
  9046. },
  9047. "QuestionRequest": {
  9048. "type": "object",
  9049. "properties": {
  9050. "id": {
  9051. "type": "string"
  9052. },
  9053. "sessionID": {
  9054. "type": "string"
  9055. },
  9056. "questions": {
  9057. "type": "array",
  9058. "items": {
  9059. "$ref": "#/components/schemas/QuestionInfo"
  9060. },
  9061. "description": "Questions to ask"
  9062. },
  9063. "tool": {
  9064. "$ref": "#/components/schemas/QuestionTool"
  9065. }
  9066. },
  9067. "required": ["id", "sessionID", "questions"],
  9068. "additionalProperties": false
  9069. },
  9070. "QuestionAnswer": {
  9071. "type": "array",
  9072. "items": {
  9073. "type": "string"
  9074. }
  9075. },
  9076. "QuestionReplied": {
  9077. "type": "object",
  9078. "properties": {
  9079. "sessionID": {
  9080. "type": "string"
  9081. },
  9082. "requestID": {
  9083. "type": "string"
  9084. },
  9085. "answers": {
  9086. "type": "array",
  9087. "items": {
  9088. "$ref": "#/components/schemas/QuestionAnswer"
  9089. }
  9090. }
  9091. },
  9092. "required": ["sessionID", "requestID", "answers"],
  9093. "additionalProperties": false
  9094. },
  9095. "QuestionRejected": {
  9096. "type": "object",
  9097. "properties": {
  9098. "sessionID": {
  9099. "type": "string"
  9100. },
  9101. "requestID": {
  9102. "type": "string"
  9103. }
  9104. },
  9105. "required": ["sessionID", "requestID"],
  9106. "additionalProperties": false
  9107. },
  9108. "Todo": {
  9109. "type": "object",
  9110. "properties": {
  9111. "content": {
  9112. "type": "string",
  9113. "description": "Brief description of the task"
  9114. },
  9115. "status": {
  9116. "type": "string",
  9117. "description": "Current status of the task: pending, in_progress, completed, cancelled"
  9118. },
  9119. "priority": {
  9120. "type": "string",
  9121. "description": "Priority level of the task: high, medium, low"
  9122. }
  9123. },
  9124. "required": ["content", "status", "priority"],
  9125. "additionalProperties": false
  9126. },
  9127. "SessionStatus": {
  9128. "anyOf": [
  9129. {
  9130. "type": "object",
  9131. "properties": {
  9132. "type": {
  9133. "type": "string",
  9134. "enum": ["idle"]
  9135. }
  9136. },
  9137. "required": ["type"],
  9138. "additionalProperties": false
  9139. },
  9140. {
  9141. "type": "object",
  9142. "properties": {
  9143. "type": {
  9144. "type": "string",
  9145. "enum": ["retry"]
  9146. },
  9147. "attempt": {
  9148. "type": "integer",
  9149. "minimum": 0
  9150. },
  9151. "message": {
  9152. "type": "string"
  9153. },
  9154. "next": {
  9155. "type": "integer",
  9156. "minimum": 0
  9157. }
  9158. },
  9159. "required": ["type", "attempt", "message", "next"],
  9160. "additionalProperties": false
  9161. },
  9162. {
  9163. "type": "object",
  9164. "properties": {
  9165. "type": {
  9166. "type": "string",
  9167. "enum": ["busy"]
  9168. }
  9169. },
  9170. "required": ["type"],
  9171. "additionalProperties": false
  9172. }
  9173. ]
  9174. },
  9175. "Event.tui.prompt.append": {
  9176. "type": "object",
  9177. "properties": {
  9178. "id": {
  9179. "type": "string"
  9180. },
  9181. "type": {
  9182. "type": "string",
  9183. "enum": ["tui.prompt.append"]
  9184. },
  9185. "properties": {
  9186. "type": "object",
  9187. "properties": {
  9188. "text": {
  9189. "type": "string"
  9190. }
  9191. },
  9192. "required": ["text"],
  9193. "additionalProperties": false
  9194. }
  9195. },
  9196. "required": ["id", "type", "properties"],
  9197. "additionalProperties": false
  9198. },
  9199. "Event.tui.command.execute": {
  9200. "type": "object",
  9201. "properties": {
  9202. "id": {
  9203. "type": "string"
  9204. },
  9205. "type": {
  9206. "type": "string",
  9207. "enum": ["tui.command.execute"]
  9208. },
  9209. "properties": {
  9210. "type": "object",
  9211. "properties": {
  9212. "command": {
  9213. "anyOf": [
  9214. {
  9215. "type": "string",
  9216. "enum": [
  9217. "session.list",
  9218. "session.new",
  9219. "session.share",
  9220. "session.interrupt",
  9221. "session.compact",
  9222. "session.page.up",
  9223. "session.page.down",
  9224. "session.line.up",
  9225. "session.line.down",
  9226. "session.half.page.up",
  9227. "session.half.page.down",
  9228. "session.first",
  9229. "session.last",
  9230. "prompt.clear",
  9231. "prompt.submit",
  9232. "agent.cycle"
  9233. ]
  9234. },
  9235. {
  9236. "type": "string"
  9237. }
  9238. ]
  9239. }
  9240. },
  9241. "required": ["command"],
  9242. "additionalProperties": false
  9243. }
  9244. },
  9245. "required": ["id", "type", "properties"],
  9246. "additionalProperties": false
  9247. },
  9248. "Event.tui.toast.show": {
  9249. "type": "object",
  9250. "properties": {
  9251. "id": {
  9252. "type": "string"
  9253. },
  9254. "type": {
  9255. "type": "string",
  9256. "enum": ["tui.toast.show"]
  9257. },
  9258. "properties": {
  9259. "type": "object",
  9260. "properties": {
  9261. "title": {
  9262. "type": "string"
  9263. },
  9264. "message": {
  9265. "type": "string"
  9266. },
  9267. "variant": {
  9268. "type": "string",
  9269. "enum": ["info", "success", "warning", "error"]
  9270. },
  9271. "duration": {
  9272. "type": "integer",
  9273. "exclusiveMinimum": 0
  9274. }
  9275. },
  9276. "required": ["message", "variant"],
  9277. "additionalProperties": false
  9278. }
  9279. },
  9280. "required": ["id", "type", "properties"],
  9281. "additionalProperties": false
  9282. },
  9283. "Event.tui.session.select": {
  9284. "type": "object",
  9285. "properties": {
  9286. "id": {
  9287. "type": "string"
  9288. },
  9289. "type": {
  9290. "type": "string",
  9291. "enum": ["tui.session.select"]
  9292. },
  9293. "properties": {
  9294. "type": "object",
  9295. "properties": {
  9296. "sessionID": {
  9297. "type": "string",
  9298. "description": "Session ID to navigate to"
  9299. }
  9300. },
  9301. "required": ["sessionID"],
  9302. "additionalProperties": false
  9303. }
  9304. },
  9305. "required": ["id", "type", "properties"],
  9306. "additionalProperties": false
  9307. },
  9308. "Project": {
  9309. "type": "object",
  9310. "properties": {
  9311. "id": {
  9312. "type": "string"
  9313. },
  9314. "worktree": {
  9315. "type": "string"
  9316. },
  9317. "vcs": {
  9318. "type": "string",
  9319. "enum": ["git"]
  9320. },
  9321. "name": {
  9322. "type": "string"
  9323. },
  9324. "icon": {
  9325. "type": "object",
  9326. "properties": {
  9327. "url": {
  9328. "type": "string"
  9329. },
  9330. "override": {
  9331. "type": "string"
  9332. },
  9333. "color": {
  9334. "type": "string"
  9335. }
  9336. },
  9337. "additionalProperties": false
  9338. },
  9339. "commands": {
  9340. "type": "object",
  9341. "properties": {
  9342. "start": {
  9343. "type": "string",
  9344. "description": "Startup script to run when creating a new workspace (worktree)"
  9345. }
  9346. },
  9347. "additionalProperties": false
  9348. },
  9349. "time": {
  9350. "type": "object",
  9351. "properties": {
  9352. "created": {
  9353. "type": "integer",
  9354. "minimum": 0
  9355. },
  9356. "updated": {
  9357. "type": "integer",
  9358. "minimum": 0
  9359. },
  9360. "initialized": {
  9361. "type": "integer",
  9362. "minimum": 0
  9363. }
  9364. },
  9365. "required": ["created", "updated"],
  9366. "additionalProperties": false
  9367. },
  9368. "sandboxes": {
  9369. "type": "array",
  9370. "items": {
  9371. "type": "string"
  9372. }
  9373. }
  9374. },
  9375. "required": ["id", "worktree", "time", "sandboxes"],
  9376. "additionalProperties": false
  9377. },
  9378. "Pty": {
  9379. "type": "object",
  9380. "properties": {
  9381. "id": {
  9382. "type": "string"
  9383. },
  9384. "title": {
  9385. "type": "string"
  9386. },
  9387. "command": {
  9388. "type": "string"
  9389. },
  9390. "args": {
  9391. "type": "array",
  9392. "items": {
  9393. "type": "string"
  9394. }
  9395. },
  9396. "cwd": {
  9397. "type": "string"
  9398. },
  9399. "status": {
  9400. "type": "string",
  9401. "enum": ["running", "exited"]
  9402. },
  9403. "pid": {
  9404. "type": "integer",
  9405. "exclusiveMinimum": 0
  9406. }
  9407. },
  9408. "required": ["id", "title", "command", "args", "cwd", "status", "pid"],
  9409. "additionalProperties": false
  9410. },
  9411. "OutputFormatText": {
  9412. "type": "object",
  9413. "properties": {
  9414. "type": {
  9415. "type": "string",
  9416. "enum": ["text"]
  9417. }
  9418. },
  9419. "required": ["type"],
  9420. "additionalProperties": false
  9421. },
  9422. "JSONSchema": {
  9423. "type": "object"
  9424. },
  9425. "OutputFormatJsonSchema": {
  9426. "type": "object",
  9427. "properties": {
  9428. "type": {
  9429. "type": "string",
  9430. "enum": ["json_schema"]
  9431. },
  9432. "schema": {
  9433. "$ref": "#/components/schemas/JSONSchema"
  9434. },
  9435. "retryCount": {
  9436. "type": "integer",
  9437. "minimum": 0
  9438. }
  9439. },
  9440. "required": ["type", "schema"],
  9441. "additionalProperties": false
  9442. },
  9443. "OutputFormat": {
  9444. "anyOf": [
  9445. {
  9446. "$ref": "#/components/schemas/OutputFormatText"
  9447. },
  9448. {
  9449. "$ref": "#/components/schemas/OutputFormatJsonSchema"
  9450. }
  9451. ]
  9452. },
  9453. "UserMessage": {
  9454. "type": "object",
  9455. "properties": {
  9456. "id": {
  9457. "type": "string"
  9458. },
  9459. "sessionID": {
  9460. "type": "string"
  9461. },
  9462. "role": {
  9463. "type": "string",
  9464. "enum": ["user"]
  9465. },
  9466. "time": {
  9467. "type": "object",
  9468. "properties": {
  9469. "created": {
  9470. "type": "integer",
  9471. "minimum": 0
  9472. }
  9473. },
  9474. "required": ["created"],
  9475. "additionalProperties": false
  9476. },
  9477. "format": {
  9478. "$ref": "#/components/schemas/OutputFormat"
  9479. },
  9480. "summary": {
  9481. "type": "object",
  9482. "properties": {
  9483. "title": {
  9484. "type": "string"
  9485. },
  9486. "body": {
  9487. "type": "string"
  9488. },
  9489. "diffs": {
  9490. "type": "array",
  9491. "items": {
  9492. "$ref": "#/components/schemas/SnapshotFileDiff"
  9493. }
  9494. }
  9495. },
  9496. "required": ["diffs"],
  9497. "additionalProperties": false
  9498. },
  9499. "agent": {
  9500. "type": "string"
  9501. },
  9502. "model": {
  9503. "type": "object",
  9504. "properties": {
  9505. "providerID": {
  9506. "type": "string"
  9507. },
  9508. "modelID": {
  9509. "type": "string"
  9510. },
  9511. "variant": {
  9512. "type": "string"
  9513. }
  9514. },
  9515. "required": ["providerID", "modelID"],
  9516. "additionalProperties": false
  9517. },
  9518. "system": {
  9519. "type": "string"
  9520. },
  9521. "tools": {
  9522. "type": "object",
  9523. "additionalProperties": {
  9524. "type": "boolean"
  9525. }
  9526. }
  9527. },
  9528. "required": ["id", "sessionID", "role", "time", "agent", "model"],
  9529. "additionalProperties": false
  9530. },
  9531. "AssistantMessage": {
  9532. "type": "object",
  9533. "properties": {
  9534. "id": {
  9535. "type": "string"
  9536. },
  9537. "sessionID": {
  9538. "type": "string"
  9539. },
  9540. "role": {
  9541. "type": "string",
  9542. "enum": ["assistant"]
  9543. },
  9544. "time": {
  9545. "type": "object",
  9546. "properties": {
  9547. "created": {
  9548. "type": "integer",
  9549. "minimum": 0
  9550. },
  9551. "completed": {
  9552. "type": "integer",
  9553. "minimum": 0
  9554. }
  9555. },
  9556. "required": ["created"],
  9557. "additionalProperties": false
  9558. },
  9559. "error": {
  9560. "anyOf": [
  9561. {
  9562. "$ref": "#/components/schemas/ProviderAuthError"
  9563. },
  9564. {
  9565. "$ref": "#/components/schemas/UnknownError"
  9566. },
  9567. {
  9568. "$ref": "#/components/schemas/MessageOutputLengthError"
  9569. },
  9570. {
  9571. "$ref": "#/components/schemas/MessageAbortedError"
  9572. },
  9573. {
  9574. "$ref": "#/components/schemas/StructuredOutputError"
  9575. },
  9576. {
  9577. "$ref": "#/components/schemas/ContextOverflowError"
  9578. },
  9579. {
  9580. "$ref": "#/components/schemas/APIError"
  9581. }
  9582. ]
  9583. },
  9584. "parentID": {
  9585. "type": "string"
  9586. },
  9587. "modelID": {
  9588. "type": "string"
  9589. },
  9590. "providerID": {
  9591. "type": "string"
  9592. },
  9593. "mode": {
  9594. "type": "string"
  9595. },
  9596. "agent": {
  9597. "type": "string"
  9598. },
  9599. "path": {
  9600. "type": "object",
  9601. "properties": {
  9602. "cwd": {
  9603. "type": "string"
  9604. },
  9605. "root": {
  9606. "type": "string"
  9607. }
  9608. },
  9609. "required": ["cwd", "root"],
  9610. "additionalProperties": false
  9611. },
  9612. "summary": {
  9613. "type": "boolean"
  9614. },
  9615. "cost": {
  9616. "type": "number"
  9617. },
  9618. "tokens": {
  9619. "type": "object",
  9620. "properties": {
  9621. "total": {
  9622. "type": "integer",
  9623. "minimum": 0
  9624. },
  9625. "input": {
  9626. "type": "integer",
  9627. "minimum": 0
  9628. },
  9629. "output": {
  9630. "type": "integer",
  9631. "minimum": 0
  9632. },
  9633. "reasoning": {
  9634. "type": "integer",
  9635. "minimum": 0
  9636. },
  9637. "cache": {
  9638. "type": "object",
  9639. "properties": {
  9640. "read": {
  9641. "type": "integer",
  9642. "minimum": 0
  9643. },
  9644. "write": {
  9645. "type": "integer",
  9646. "minimum": 0
  9647. }
  9648. },
  9649. "required": ["read", "write"],
  9650. "additionalProperties": false
  9651. }
  9652. },
  9653. "required": ["input", "output", "reasoning", "cache"],
  9654. "additionalProperties": false
  9655. },
  9656. "structured": {},
  9657. "variant": {
  9658. "type": "string"
  9659. },
  9660. "finish": {
  9661. "type": "string"
  9662. }
  9663. },
  9664. "required": [
  9665. "id",
  9666. "sessionID",
  9667. "role",
  9668. "time",
  9669. "parentID",
  9670. "modelID",
  9671. "providerID",
  9672. "mode",
  9673. "agent",
  9674. "path",
  9675. "cost",
  9676. "tokens"
  9677. ],
  9678. "additionalProperties": false
  9679. },
  9680. "Message": {
  9681. "anyOf": [
  9682. {
  9683. "$ref": "#/components/schemas/UserMessage"
  9684. },
  9685. {
  9686. "$ref": "#/components/schemas/AssistantMessage"
  9687. }
  9688. ]
  9689. },
  9690. "TextPart": {
  9691. "type": "object",
  9692. "properties": {
  9693. "id": {
  9694. "type": "string"
  9695. },
  9696. "sessionID": {
  9697. "type": "string"
  9698. },
  9699. "messageID": {
  9700. "type": "string"
  9701. },
  9702. "type": {
  9703. "type": "string",
  9704. "enum": ["text"]
  9705. },
  9706. "text": {
  9707. "type": "string"
  9708. },
  9709. "synthetic": {
  9710. "type": "boolean"
  9711. },
  9712. "ignored": {
  9713. "type": "boolean"
  9714. },
  9715. "time": {
  9716. "type": "object",
  9717. "properties": {
  9718. "start": {
  9719. "type": "integer",
  9720. "minimum": 0
  9721. },
  9722. "end": {
  9723. "type": "integer",
  9724. "minimum": 0
  9725. }
  9726. },
  9727. "required": ["start"],
  9728. "additionalProperties": false
  9729. },
  9730. "metadata": {
  9731. "type": "object"
  9732. }
  9733. },
  9734. "required": ["id", "sessionID", "messageID", "type", "text"],
  9735. "additionalProperties": false
  9736. },
  9737. "SubtaskPart": {
  9738. "type": "object",
  9739. "properties": {
  9740. "id": {
  9741. "type": "string"
  9742. },
  9743. "sessionID": {
  9744. "type": "string"
  9745. },
  9746. "messageID": {
  9747. "type": "string"
  9748. },
  9749. "type": {
  9750. "type": "string",
  9751. "enum": ["subtask"]
  9752. },
  9753. "prompt": {
  9754. "type": "string"
  9755. },
  9756. "description": {
  9757. "type": "string"
  9758. },
  9759. "agent": {
  9760. "type": "string"
  9761. },
  9762. "model": {
  9763. "type": "object",
  9764. "properties": {
  9765. "providerID": {
  9766. "type": "string"
  9767. },
  9768. "modelID": {
  9769. "type": "string"
  9770. }
  9771. },
  9772. "required": ["providerID", "modelID"],
  9773. "additionalProperties": false
  9774. },
  9775. "command": {
  9776. "type": "string"
  9777. }
  9778. },
  9779. "required": ["id", "sessionID", "messageID", "type", "prompt", "description", "agent"],
  9780. "additionalProperties": false
  9781. },
  9782. "ReasoningPart": {
  9783. "type": "object",
  9784. "properties": {
  9785. "id": {
  9786. "type": "string"
  9787. },
  9788. "sessionID": {
  9789. "type": "string"
  9790. },
  9791. "messageID": {
  9792. "type": "string"
  9793. },
  9794. "type": {
  9795. "type": "string",
  9796. "enum": ["reasoning"]
  9797. },
  9798. "text": {
  9799. "type": "string"
  9800. },
  9801. "metadata": {
  9802. "type": "object"
  9803. },
  9804. "time": {
  9805. "type": "object",
  9806. "properties": {
  9807. "start": {
  9808. "type": "integer",
  9809. "minimum": 0
  9810. },
  9811. "end": {
  9812. "type": "integer",
  9813. "minimum": 0
  9814. }
  9815. },
  9816. "required": ["start"],
  9817. "additionalProperties": false
  9818. }
  9819. },
  9820. "required": ["id", "sessionID", "messageID", "type", "text", "time"],
  9821. "additionalProperties": false
  9822. },
  9823. "FilePartSourceText": {
  9824. "type": "object",
  9825. "properties": {
  9826. "value": {
  9827. "type": "string"
  9828. },
  9829. "start": {
  9830. "type": "integer",
  9831. "minimum": 0
  9832. },
  9833. "end": {
  9834. "type": "integer",
  9835. "minimum": 0
  9836. }
  9837. },
  9838. "required": ["value", "start", "end"],
  9839. "additionalProperties": false
  9840. },
  9841. "FileSource": {
  9842. "type": "object",
  9843. "properties": {
  9844. "text": {
  9845. "$ref": "#/components/schemas/FilePartSourceText"
  9846. },
  9847. "type": {
  9848. "type": "string",
  9849. "enum": ["file"]
  9850. },
  9851. "path": {
  9852. "type": "string"
  9853. }
  9854. },
  9855. "required": ["text", "type", "path"],
  9856. "additionalProperties": false
  9857. },
  9858. "Range": {
  9859. "type": "object",
  9860. "properties": {
  9861. "start": {
  9862. "type": "object",
  9863. "properties": {
  9864. "line": {
  9865. "type": "integer",
  9866. "minimum": 0
  9867. },
  9868. "character": {
  9869. "type": "integer",
  9870. "minimum": 0
  9871. }
  9872. },
  9873. "required": ["line", "character"],
  9874. "additionalProperties": false
  9875. },
  9876. "end": {
  9877. "type": "object",
  9878. "properties": {
  9879. "line": {
  9880. "type": "integer",
  9881. "minimum": 0
  9882. },
  9883. "character": {
  9884. "type": "integer",
  9885. "minimum": 0
  9886. }
  9887. },
  9888. "required": ["line", "character"],
  9889. "additionalProperties": false
  9890. }
  9891. },
  9892. "required": ["start", "end"],
  9893. "additionalProperties": false
  9894. },
  9895. "SymbolSource": {
  9896. "type": "object",
  9897. "properties": {
  9898. "text": {
  9899. "$ref": "#/components/schemas/FilePartSourceText"
  9900. },
  9901. "type": {
  9902. "type": "string",
  9903. "enum": ["symbol"]
  9904. },
  9905. "path": {
  9906. "type": "string"
  9907. },
  9908. "range": {
  9909. "$ref": "#/components/schemas/Range"
  9910. },
  9911. "name": {
  9912. "type": "string"
  9913. },
  9914. "kind": {
  9915. "type": "integer",
  9916. "minimum": 0
  9917. }
  9918. },
  9919. "required": ["text", "type", "path", "range", "name", "kind"],
  9920. "additionalProperties": false
  9921. },
  9922. "ResourceSource": {
  9923. "type": "object",
  9924. "properties": {
  9925. "text": {
  9926. "$ref": "#/components/schemas/FilePartSourceText"
  9927. },
  9928. "type": {
  9929. "type": "string",
  9930. "enum": ["resource"]
  9931. },
  9932. "clientName": {
  9933. "type": "string"
  9934. },
  9935. "uri": {
  9936. "type": "string"
  9937. }
  9938. },
  9939. "required": ["text", "type", "clientName", "uri"],
  9940. "additionalProperties": false
  9941. },
  9942. "FilePartSource": {
  9943. "anyOf": [
  9944. {
  9945. "$ref": "#/components/schemas/FileSource"
  9946. },
  9947. {
  9948. "$ref": "#/components/schemas/SymbolSource"
  9949. },
  9950. {
  9951. "$ref": "#/components/schemas/ResourceSource"
  9952. }
  9953. ]
  9954. },
  9955. "FilePart": {
  9956. "type": "object",
  9957. "properties": {
  9958. "id": {
  9959. "type": "string"
  9960. },
  9961. "sessionID": {
  9962. "type": "string"
  9963. },
  9964. "messageID": {
  9965. "type": "string"
  9966. },
  9967. "type": {
  9968. "type": "string",
  9969. "enum": ["file"]
  9970. },
  9971. "mime": {
  9972. "type": "string"
  9973. },
  9974. "filename": {
  9975. "type": "string"
  9976. },
  9977. "url": {
  9978. "type": "string"
  9979. },
  9980. "source": {
  9981. "$ref": "#/components/schemas/FilePartSource"
  9982. }
  9983. },
  9984. "required": ["id", "sessionID", "messageID", "type", "mime", "url"],
  9985. "additionalProperties": false
  9986. },
  9987. "ToolStatePending": {
  9988. "type": "object",
  9989. "properties": {
  9990. "status": {
  9991. "type": "string",
  9992. "enum": ["pending"]
  9993. },
  9994. "input": {
  9995. "type": "object"
  9996. },
  9997. "raw": {
  9998. "type": "string"
  9999. }
  10000. },
  10001. "required": ["status", "input", "raw"],
  10002. "additionalProperties": false
  10003. },
  10004. "ToolStateRunning": {
  10005. "type": "object",
  10006. "properties": {
  10007. "status": {
  10008. "type": "string",
  10009. "enum": ["running"]
  10010. },
  10011. "input": {
  10012. "type": "object"
  10013. },
  10014. "title": {
  10015. "type": "string"
  10016. },
  10017. "metadata": {
  10018. "type": "object"
  10019. },
  10020. "time": {
  10021. "type": "object",
  10022. "properties": {
  10023. "start": {
  10024. "type": "integer",
  10025. "minimum": 0
  10026. }
  10027. },
  10028. "required": ["start"],
  10029. "additionalProperties": false
  10030. }
  10031. },
  10032. "required": ["status", "input", "time"],
  10033. "additionalProperties": false
  10034. },
  10035. "ToolStateCompleted": {
  10036. "type": "object",
  10037. "properties": {
  10038. "status": {
  10039. "type": "string",
  10040. "enum": ["completed"]
  10041. },
  10042. "input": {
  10043. "type": "object"
  10044. },
  10045. "output": {
  10046. "type": "string"
  10047. },
  10048. "title": {
  10049. "type": "string"
  10050. },
  10051. "metadata": {
  10052. "type": "object"
  10053. },
  10054. "time": {
  10055. "type": "object",
  10056. "properties": {
  10057. "start": {
  10058. "type": "integer",
  10059. "minimum": 0
  10060. },
  10061. "end": {
  10062. "type": "integer",
  10063. "minimum": 0
  10064. },
  10065. "compacted": {
  10066. "type": "integer",
  10067. "minimum": 0
  10068. }
  10069. },
  10070. "required": ["start", "end"],
  10071. "additionalProperties": false
  10072. },
  10073. "attachments": {
  10074. "type": "array",
  10075. "items": {
  10076. "$ref": "#/components/schemas/FilePart"
  10077. }
  10078. }
  10079. },
  10080. "required": ["status", "input", "output", "title", "metadata", "time"],
  10081. "additionalProperties": false
  10082. },
  10083. "ToolStateError": {
  10084. "type": "object",
  10085. "properties": {
  10086. "status": {
  10087. "type": "string",
  10088. "enum": ["error"]
  10089. },
  10090. "input": {
  10091. "type": "object"
  10092. },
  10093. "error": {
  10094. "type": "string"
  10095. },
  10096. "metadata": {
  10097. "type": "object"
  10098. },
  10099. "time": {
  10100. "type": "object",
  10101. "properties": {
  10102. "start": {
  10103. "type": "integer",
  10104. "minimum": 0
  10105. },
  10106. "end": {
  10107. "type": "integer",
  10108. "minimum": 0
  10109. }
  10110. },
  10111. "required": ["start", "end"],
  10112. "additionalProperties": false
  10113. }
  10114. },
  10115. "required": ["status", "input", "error", "time"],
  10116. "additionalProperties": false
  10117. },
  10118. "ToolState": {
  10119. "anyOf": [
  10120. {
  10121. "$ref": "#/components/schemas/ToolStatePending"
  10122. },
  10123. {
  10124. "$ref": "#/components/schemas/ToolStateRunning"
  10125. },
  10126. {
  10127. "$ref": "#/components/schemas/ToolStateCompleted"
  10128. },
  10129. {
  10130. "$ref": "#/components/schemas/ToolStateError"
  10131. }
  10132. ]
  10133. },
  10134. "ToolPart": {
  10135. "type": "object",
  10136. "properties": {
  10137. "id": {
  10138. "type": "string"
  10139. },
  10140. "sessionID": {
  10141. "type": "string"
  10142. },
  10143. "messageID": {
  10144. "type": "string"
  10145. },
  10146. "type": {
  10147. "type": "string",
  10148. "enum": ["tool"]
  10149. },
  10150. "callID": {
  10151. "type": "string"
  10152. },
  10153. "tool": {
  10154. "type": "string"
  10155. },
  10156. "state": {
  10157. "$ref": "#/components/schemas/ToolState"
  10158. },
  10159. "metadata": {
  10160. "type": "object"
  10161. }
  10162. },
  10163. "required": ["id", "sessionID", "messageID", "type", "callID", "tool", "state"],
  10164. "additionalProperties": false
  10165. },
  10166. "StepStartPart": {
  10167. "type": "object",
  10168. "properties": {
  10169. "id": {
  10170. "type": "string"
  10171. },
  10172. "sessionID": {
  10173. "type": "string"
  10174. },
  10175. "messageID": {
  10176. "type": "string"
  10177. },
  10178. "type": {
  10179. "type": "string",
  10180. "enum": ["step-start"]
  10181. },
  10182. "snapshot": {
  10183. "type": "string"
  10184. }
  10185. },
  10186. "required": ["id", "sessionID", "messageID", "type"],
  10187. "additionalProperties": false
  10188. },
  10189. "StepFinishPart": {
  10190. "type": "object",
  10191. "properties": {
  10192. "id": {
  10193. "type": "string"
  10194. },
  10195. "sessionID": {
  10196. "type": "string"
  10197. },
  10198. "messageID": {
  10199. "type": "string"
  10200. },
  10201. "type": {
  10202. "type": "string",
  10203. "enum": ["step-finish"]
  10204. },
  10205. "reason": {
  10206. "type": "string"
  10207. },
  10208. "snapshot": {
  10209. "type": "string"
  10210. },
  10211. "cost": {
  10212. "type": "number"
  10213. },
  10214. "tokens": {
  10215. "type": "object",
  10216. "properties": {
  10217. "total": {
  10218. "type": "integer",
  10219. "minimum": 0
  10220. },
  10221. "input": {
  10222. "type": "integer",
  10223. "minimum": 0
  10224. },
  10225. "output": {
  10226. "type": "integer",
  10227. "minimum": 0
  10228. },
  10229. "reasoning": {
  10230. "type": "integer",
  10231. "minimum": 0
  10232. },
  10233. "cache": {
  10234. "type": "object",
  10235. "properties": {
  10236. "read": {
  10237. "type": "integer",
  10238. "minimum": 0
  10239. },
  10240. "write": {
  10241. "type": "integer",
  10242. "minimum": 0
  10243. }
  10244. },
  10245. "required": ["read", "write"],
  10246. "additionalProperties": false
  10247. }
  10248. },
  10249. "required": ["input", "output", "reasoning", "cache"],
  10250. "additionalProperties": false
  10251. }
  10252. },
  10253. "required": ["id", "sessionID", "messageID", "type", "reason", "cost", "tokens"],
  10254. "additionalProperties": false
  10255. },
  10256. "SnapshotPart": {
  10257. "type": "object",
  10258. "properties": {
  10259. "id": {
  10260. "type": "string"
  10261. },
  10262. "sessionID": {
  10263. "type": "string"
  10264. },
  10265. "messageID": {
  10266. "type": "string"
  10267. },
  10268. "type": {
  10269. "type": "string",
  10270. "enum": ["snapshot"]
  10271. },
  10272. "snapshot": {
  10273. "type": "string"
  10274. }
  10275. },
  10276. "required": ["id", "sessionID", "messageID", "type", "snapshot"],
  10277. "additionalProperties": false
  10278. },
  10279. "PatchPart": {
  10280. "type": "object",
  10281. "properties": {
  10282. "id": {
  10283. "type": "string"
  10284. },
  10285. "sessionID": {
  10286. "type": "string"
  10287. },
  10288. "messageID": {
  10289. "type": "string"
  10290. },
  10291. "type": {
  10292. "type": "string",
  10293. "enum": ["patch"]
  10294. },
  10295. "hash": {
  10296. "type": "string"
  10297. },
  10298. "files": {
  10299. "type": "array",
  10300. "items": {
  10301. "type": "string"
  10302. }
  10303. }
  10304. },
  10305. "required": ["id", "sessionID", "messageID", "type", "hash", "files"],
  10306. "additionalProperties": false
  10307. },
  10308. "AgentPart": {
  10309. "type": "object",
  10310. "properties": {
  10311. "id": {
  10312. "type": "string"
  10313. },
  10314. "sessionID": {
  10315. "type": "string"
  10316. },
  10317. "messageID": {
  10318. "type": "string"
  10319. },
  10320. "type": {
  10321. "type": "string",
  10322. "enum": ["agent"]
  10323. },
  10324. "name": {
  10325. "type": "string"
  10326. },
  10327. "source": {
  10328. "type": "object",
  10329. "properties": {
  10330. "value": {
  10331. "type": "string"
  10332. },
  10333. "start": {
  10334. "type": "integer",
  10335. "minimum": 0
  10336. },
  10337. "end": {
  10338. "type": "integer",
  10339. "minimum": 0
  10340. }
  10341. },
  10342. "required": ["value", "start", "end"],
  10343. "additionalProperties": false
  10344. }
  10345. },
  10346. "required": ["id", "sessionID", "messageID", "type", "name"],
  10347. "additionalProperties": false
  10348. },
  10349. "RetryPart": {
  10350. "type": "object",
  10351. "properties": {
  10352. "id": {
  10353. "type": "string"
  10354. },
  10355. "sessionID": {
  10356. "type": "string"
  10357. },
  10358. "messageID": {
  10359. "type": "string"
  10360. },
  10361. "type": {
  10362. "type": "string",
  10363. "enum": ["retry"]
  10364. },
  10365. "attempt": {
  10366. "type": "integer",
  10367. "minimum": 0
  10368. },
  10369. "error": {
  10370. "$ref": "#/components/schemas/APIError"
  10371. },
  10372. "time": {
  10373. "type": "object",
  10374. "properties": {
  10375. "created": {
  10376. "type": "integer",
  10377. "minimum": 0
  10378. }
  10379. },
  10380. "required": ["created"],
  10381. "additionalProperties": false
  10382. }
  10383. },
  10384. "required": ["id", "sessionID", "messageID", "type", "attempt", "error", "time"],
  10385. "additionalProperties": false
  10386. },
  10387. "CompactionPart": {
  10388. "type": "object",
  10389. "properties": {
  10390. "id": {
  10391. "type": "string"
  10392. },
  10393. "sessionID": {
  10394. "type": "string"
  10395. },
  10396. "messageID": {
  10397. "type": "string"
  10398. },
  10399. "type": {
  10400. "type": "string",
  10401. "enum": ["compaction"]
  10402. },
  10403. "auto": {
  10404. "type": "boolean"
  10405. },
  10406. "overflow": {
  10407. "type": "boolean"
  10408. },
  10409. "tail_start_id": {
  10410. "type": "string"
  10411. }
  10412. },
  10413. "required": ["id", "sessionID", "messageID", "type", "auto"],
  10414. "additionalProperties": false
  10415. },
  10416. "Part": {
  10417. "anyOf": [
  10418. {
  10419. "$ref": "#/components/schemas/TextPart"
  10420. },
  10421. {
  10422. "$ref": "#/components/schemas/SubtaskPart"
  10423. },
  10424. {
  10425. "$ref": "#/components/schemas/ReasoningPart"
  10426. },
  10427. {
  10428. "$ref": "#/components/schemas/FilePart"
  10429. },
  10430. {
  10431. "$ref": "#/components/schemas/ToolPart"
  10432. },
  10433. {
  10434. "$ref": "#/components/schemas/StepStartPart"
  10435. },
  10436. {
  10437. "$ref": "#/components/schemas/StepFinishPart"
  10438. },
  10439. {
  10440. "$ref": "#/components/schemas/SnapshotPart"
  10441. },
  10442. {
  10443. "$ref": "#/components/schemas/PatchPart"
  10444. },
  10445. {
  10446. "$ref": "#/components/schemas/AgentPart"
  10447. },
  10448. {
  10449. "$ref": "#/components/schemas/RetryPart"
  10450. },
  10451. {
  10452. "$ref": "#/components/schemas/CompactionPart"
  10453. }
  10454. ]
  10455. },
  10456. "PermissionAction": {
  10457. "type": "string",
  10458. "enum": ["allow", "deny", "ask"]
  10459. },
  10460. "PermissionRule": {
  10461. "type": "object",
  10462. "properties": {
  10463. "permission": {
  10464. "type": "string"
  10465. },
  10466. "pattern": {
  10467. "type": "string"
  10468. },
  10469. "action": {
  10470. "$ref": "#/components/schemas/PermissionAction"
  10471. }
  10472. },
  10473. "required": ["permission", "pattern", "action"],
  10474. "additionalProperties": false
  10475. },
  10476. "PermissionRuleset": {
  10477. "type": "array",
  10478. "items": {
  10479. "$ref": "#/components/schemas/PermissionRule"
  10480. }
  10481. },
  10482. "Session": {
  10483. "type": "object",
  10484. "properties": {
  10485. "id": {
  10486. "type": "string"
  10487. },
  10488. "slug": {
  10489. "type": "string"
  10490. },
  10491. "projectID": {
  10492. "type": "string"
  10493. },
  10494. "workspaceID": {
  10495. "type": "string"
  10496. },
  10497. "directory": {
  10498. "type": "string"
  10499. },
  10500. "path": {
  10501. "type": "string"
  10502. },
  10503. "parentID": {
  10504. "type": "string"
  10505. },
  10506. "summary": {
  10507. "type": "object",
  10508. "properties": {
  10509. "additions": {
  10510. "type": "integer",
  10511. "minimum": 0
  10512. },
  10513. "deletions": {
  10514. "type": "integer",
  10515. "minimum": 0
  10516. },
  10517. "files": {
  10518. "type": "integer",
  10519. "minimum": 0
  10520. },
  10521. "diffs": {
  10522. "type": "array",
  10523. "items": {
  10524. "$ref": "#/components/schemas/SnapshotFileDiff"
  10525. }
  10526. }
  10527. },
  10528. "required": ["additions", "deletions", "files"],
  10529. "additionalProperties": false
  10530. },
  10531. "share": {
  10532. "type": "object",
  10533. "properties": {
  10534. "url": {
  10535. "type": "string"
  10536. }
  10537. },
  10538. "required": ["url"],
  10539. "additionalProperties": false
  10540. },
  10541. "title": {
  10542. "type": "string"
  10543. },
  10544. "agent": {
  10545. "type": "string"
  10546. },
  10547. "model": {
  10548. "type": "object",
  10549. "properties": {
  10550. "id": {
  10551. "type": "string"
  10552. },
  10553. "providerID": {
  10554. "type": "string"
  10555. },
  10556. "variant": {
  10557. "type": "string"
  10558. }
  10559. },
  10560. "required": ["id", "providerID"],
  10561. "additionalProperties": false
  10562. },
  10563. "version": {
  10564. "type": "string"
  10565. },
  10566. "time": {
  10567. "type": "object",
  10568. "properties": {
  10569. "created": {
  10570. "type": "integer",
  10571. "minimum": 0
  10572. },
  10573. "updated": {
  10574. "type": "integer",
  10575. "minimum": 0
  10576. },
  10577. "compacting": {
  10578. "type": "integer",
  10579. "minimum": 0
  10580. },
  10581. "archived": {
  10582. "type": "number"
  10583. }
  10584. },
  10585. "required": ["created", "updated"],
  10586. "additionalProperties": false
  10587. },
  10588. "permission": {
  10589. "$ref": "#/components/schemas/PermissionRuleset"
  10590. },
  10591. "revert": {
  10592. "type": "object",
  10593. "properties": {
  10594. "messageID": {
  10595. "type": "string"
  10596. },
  10597. "partID": {
  10598. "type": "string"
  10599. },
  10600. "snapshot": {
  10601. "type": "string"
  10602. },
  10603. "diff": {
  10604. "type": "string"
  10605. }
  10606. },
  10607. "required": ["messageID"],
  10608. "additionalProperties": false
  10609. }
  10610. },
  10611. "required": ["id", "slug", "projectID", "directory", "title", "version", "time"],
  10612. "additionalProperties": false
  10613. },
  10614. "Prompt": {
  10615. "type": "object",
  10616. "properties": {
  10617. "text": {
  10618. "type": "string"
  10619. },
  10620. "files": {
  10621. "type": "array",
  10622. "items": {
  10623. "$ref": "#/components/schemas/PromptFileAttachment"
  10624. }
  10625. },
  10626. "agents": {
  10627. "type": "array",
  10628. "items": {
  10629. "$ref": "#/components/schemas/PromptAgentAttachment"
  10630. }
  10631. }
  10632. },
  10633. "required": ["text"],
  10634. "additionalProperties": false
  10635. },
  10636. "GlobalEvent": {
  10637. "type": "object",
  10638. "properties": {
  10639. "directory": {
  10640. "type": "string"
  10641. },
  10642. "project": {
  10643. "type": "string"
  10644. },
  10645. "workspace": {
  10646. "type": "string"
  10647. },
  10648. "payload": {
  10649. "anyOf": [
  10650. {
  10651. "$ref": "#/components/schemas/EventServerInstanceDisposed"
  10652. },
  10653. {
  10654. "$ref": "#/components/schemas/EventFileEdited"
  10655. },
  10656. {
  10657. "$ref": "#/components/schemas/EventFileWatcherUpdated"
  10658. },
  10659. {
  10660. "$ref": "#/components/schemas/EventLspClientDiagnostics"
  10661. },
  10662. {
  10663. "$ref": "#/components/schemas/EventLspUpdated"
  10664. },
  10665. {
  10666. "$ref": "#/components/schemas/EventMessagePartDelta"
  10667. },
  10668. {
  10669. "$ref": "#/components/schemas/EventPermissionAsked"
  10670. },
  10671. {
  10672. "$ref": "#/components/schemas/EventPermissionReplied"
  10673. },
  10674. {
  10675. "$ref": "#/components/schemas/EventSessionDiff"
  10676. },
  10677. {
  10678. "$ref": "#/components/schemas/EventSessionError"
  10679. },
  10680. {
  10681. "$ref": "#/components/schemas/EventInstallationUpdated"
  10682. },
  10683. {
  10684. "$ref": "#/components/schemas/EventInstallationUpdate-available"
  10685. },
  10686. {
  10687. "$ref": "#/components/schemas/EventQuestionAsked"
  10688. },
  10689. {
  10690. "$ref": "#/components/schemas/EventQuestionReplied"
  10691. },
  10692. {
  10693. "$ref": "#/components/schemas/EventQuestionRejected"
  10694. },
  10695. {
  10696. "$ref": "#/components/schemas/EventTodoUpdated"
  10697. },
  10698. {
  10699. "$ref": "#/components/schemas/EventSessionStatus"
  10700. },
  10701. {
  10702. "$ref": "#/components/schemas/EventSessionIdle"
  10703. },
  10704. {
  10705. "$ref": "#/components/schemas/EventSessionCompacted"
  10706. },
  10707. {
  10708. "$ref": "#/components/schemas/Event.tui.prompt.append"
  10709. },
  10710. {
  10711. "$ref": "#/components/schemas/Event.tui.command.execute"
  10712. },
  10713. {
  10714. "$ref": "#/components/schemas/Event.tui.toast.show"
  10715. },
  10716. {
  10717. "$ref": "#/components/schemas/Event.tui.session.select"
  10718. },
  10719. {
  10720. "$ref": "#/components/schemas/EventMcpToolsChanged"
  10721. },
  10722. {
  10723. "$ref": "#/components/schemas/EventMcpBrowserOpenFailed"
  10724. },
  10725. {
  10726. "$ref": "#/components/schemas/EventCommandExecuted"
  10727. },
  10728. {
  10729. "$ref": "#/components/schemas/EventProjectUpdated"
  10730. },
  10731. {
  10732. "$ref": "#/components/schemas/EventVcsBranchUpdated"
  10733. },
  10734. {
  10735. "$ref": "#/components/schemas/EventWorkspaceReady"
  10736. },
  10737. {
  10738. "$ref": "#/components/schemas/EventWorkspaceFailed"
  10739. },
  10740. {
  10741. "$ref": "#/components/schemas/EventWorkspaceRestore"
  10742. },
  10743. {
  10744. "$ref": "#/components/schemas/EventWorkspaceStatus"
  10745. },
  10746. {
  10747. "$ref": "#/components/schemas/EventWorktreeReady"
  10748. },
  10749. {
  10750. "$ref": "#/components/schemas/EventWorktreeFailed"
  10751. },
  10752. {
  10753. "$ref": "#/components/schemas/EventPtyCreated"
  10754. },
  10755. {
  10756. "$ref": "#/components/schemas/EventPtyUpdated"
  10757. },
  10758. {
  10759. "$ref": "#/components/schemas/EventPtyExited"
  10760. },
  10761. {
  10762. "$ref": "#/components/schemas/EventPtyDeleted"
  10763. },
  10764. {
  10765. "$ref": "#/components/schemas/EventMessageUpdated"
  10766. },
  10767. {
  10768. "$ref": "#/components/schemas/EventMessageRemoved"
  10769. },
  10770. {
  10771. "$ref": "#/components/schemas/EventMessagePartUpdated"
  10772. },
  10773. {
  10774. "$ref": "#/components/schemas/EventMessagePartRemoved"
  10775. },
  10776. {
  10777. "$ref": "#/components/schemas/EventSessionCreated"
  10778. },
  10779. {
  10780. "$ref": "#/components/schemas/EventSessionUpdated"
  10781. },
  10782. {
  10783. "$ref": "#/components/schemas/EventSessionDeleted"
  10784. },
  10785. {
  10786. "$ref": "#/components/schemas/EventSessionNextAgentSwitched"
  10787. },
  10788. {
  10789. "$ref": "#/components/schemas/EventSessionNextModelSwitched"
  10790. },
  10791. {
  10792. "$ref": "#/components/schemas/EventSessionNextPrompted"
  10793. },
  10794. {
  10795. "$ref": "#/components/schemas/EventSessionNextSynthetic"
  10796. },
  10797. {
  10798. "$ref": "#/components/schemas/EventSessionNextShellStarted"
  10799. },
  10800. {
  10801. "$ref": "#/components/schemas/EventSessionNextShellEnded"
  10802. },
  10803. {
  10804. "$ref": "#/components/schemas/EventSessionNextStepStarted"
  10805. },
  10806. {
  10807. "$ref": "#/components/schemas/EventSessionNextStepEnded"
  10808. },
  10809. {
  10810. "$ref": "#/components/schemas/EventSessionNextStepFailed"
  10811. },
  10812. {
  10813. "$ref": "#/components/schemas/EventSessionNextTextStarted"
  10814. },
  10815. {
  10816. "$ref": "#/components/schemas/EventSessionNextTextDelta"
  10817. },
  10818. {
  10819. "$ref": "#/components/schemas/EventSessionNextTextEnded"
  10820. },
  10821. {
  10822. "$ref": "#/components/schemas/EventSessionNextReasoningStarted"
  10823. },
  10824. {
  10825. "$ref": "#/components/schemas/EventSessionNextReasoningDelta"
  10826. },
  10827. {
  10828. "$ref": "#/components/schemas/EventSessionNextReasoningEnded"
  10829. },
  10830. {
  10831. "$ref": "#/components/schemas/EventSessionNextToolInputStarted"
  10832. },
  10833. {
  10834. "$ref": "#/components/schemas/EventSessionNextToolInputDelta"
  10835. },
  10836. {
  10837. "$ref": "#/components/schemas/EventSessionNextToolInputEnded"
  10838. },
  10839. {
  10840. "$ref": "#/components/schemas/EventSessionNextToolCalled"
  10841. },
  10842. {
  10843. "$ref": "#/components/schemas/EventSessionNextToolProgress"
  10844. },
  10845. {
  10846. "$ref": "#/components/schemas/EventSessionNextToolSuccess"
  10847. },
  10848. {
  10849. "$ref": "#/components/schemas/EventSessionNextToolFailed"
  10850. },
  10851. {
  10852. "$ref": "#/components/schemas/EventSessionNextRetried"
  10853. },
  10854. {
  10855. "$ref": "#/components/schemas/EventSessionNextCompactionStarted"
  10856. },
  10857. {
  10858. "$ref": "#/components/schemas/EventSessionNextCompactionDelta"
  10859. },
  10860. {
  10861. "$ref": "#/components/schemas/EventSessionNextCompactionEnded"
  10862. },
  10863. {
  10864. "$ref": "#/components/schemas/EventServerConnected"
  10865. },
  10866. {
  10867. "$ref": "#/components/schemas/EventGlobalDisposed"
  10868. },
  10869. {
  10870. "$ref": "#/components/schemas/SyncEventMessageUpdated"
  10871. },
  10872. {
  10873. "$ref": "#/components/schemas/SyncEventMessageRemoved"
  10874. },
  10875. {
  10876. "$ref": "#/components/schemas/SyncEventMessagePartUpdated"
  10877. },
  10878. {
  10879. "$ref": "#/components/schemas/SyncEventMessagePartRemoved"
  10880. },
  10881. {
  10882. "$ref": "#/components/schemas/SyncEventSessionCreated"
  10883. },
  10884. {
  10885. "$ref": "#/components/schemas/SyncEventSessionUpdated"
  10886. },
  10887. {
  10888. "$ref": "#/components/schemas/SyncEventSessionDeleted"
  10889. },
  10890. {
  10891. "$ref": "#/components/schemas/SyncEventSessionNextAgentSwitched"
  10892. },
  10893. {
  10894. "$ref": "#/components/schemas/SyncEventSessionNextModelSwitched"
  10895. },
  10896. {
  10897. "$ref": "#/components/schemas/SyncEventSessionNextPrompted"
  10898. },
  10899. {
  10900. "$ref": "#/components/schemas/SyncEventSessionNextSynthetic"
  10901. },
  10902. {
  10903. "$ref": "#/components/schemas/SyncEventSessionNextShellStarted"
  10904. },
  10905. {
  10906. "$ref": "#/components/schemas/SyncEventSessionNextShellEnded"
  10907. },
  10908. {
  10909. "$ref": "#/components/schemas/SyncEventSessionNextStepStarted"
  10910. },
  10911. {
  10912. "$ref": "#/components/schemas/SyncEventSessionNextStepEnded"
  10913. },
  10914. {
  10915. "$ref": "#/components/schemas/SyncEventSessionNextStepFailed"
  10916. },
  10917. {
  10918. "$ref": "#/components/schemas/SyncEventSessionNextTextStarted"
  10919. },
  10920. {
  10921. "$ref": "#/components/schemas/SyncEventSessionNextTextDelta"
  10922. },
  10923. {
  10924. "$ref": "#/components/schemas/SyncEventSessionNextTextEnded"
  10925. },
  10926. {
  10927. "$ref": "#/components/schemas/SyncEventSessionNextReasoningStarted"
  10928. },
  10929. {
  10930. "$ref": "#/components/schemas/SyncEventSessionNextReasoningDelta"
  10931. },
  10932. {
  10933. "$ref": "#/components/schemas/SyncEventSessionNextReasoningEnded"
  10934. },
  10935. {
  10936. "$ref": "#/components/schemas/SyncEventSessionNextToolInputStarted"
  10937. },
  10938. {
  10939. "$ref": "#/components/schemas/SyncEventSessionNextToolInputDelta"
  10940. },
  10941. {
  10942. "$ref": "#/components/schemas/SyncEventSessionNextToolInputEnded"
  10943. },
  10944. {
  10945. "$ref": "#/components/schemas/SyncEventSessionNextToolCalled"
  10946. },
  10947. {
  10948. "$ref": "#/components/schemas/SyncEventSessionNextToolProgress"
  10949. },
  10950. {
  10951. "$ref": "#/components/schemas/SyncEventSessionNextToolSuccess"
  10952. },
  10953. {
  10954. "$ref": "#/components/schemas/SyncEventSessionNextToolFailed"
  10955. },
  10956. {
  10957. "$ref": "#/components/schemas/SyncEventSessionNextRetried"
  10958. },
  10959. {
  10960. "$ref": "#/components/schemas/SyncEventSessionNextCompactionStarted"
  10961. },
  10962. {
  10963. "$ref": "#/components/schemas/SyncEventSessionNextCompactionDelta"
  10964. },
  10965. {
  10966. "$ref": "#/components/schemas/SyncEventSessionNextCompactionEnded"
  10967. }
  10968. ]
  10969. }
  10970. },
  10971. "required": ["directory", "payload"],
  10972. "additionalProperties": false
  10973. },
  10974. "LogLevel": {
  10975. "type": "string",
  10976. "enum": ["DEBUG", "INFO", "WARN", "ERROR"],
  10977. "description": "Log level"
  10978. },
  10979. "ServerConfig": {
  10980. "type": "object",
  10981. "properties": {
  10982. "port": {
  10983. "type": "integer",
  10984. "exclusiveMinimum": 0
  10985. },
  10986. "hostname": {
  10987. "type": "string"
  10988. },
  10989. "mdns": {
  10990. "type": "boolean"
  10991. },
  10992. "mdnsDomain": {
  10993. "type": "string"
  10994. },
  10995. "cors": {
  10996. "type": "array",
  10997. "items": {
  10998. "type": "string"
  10999. }
  11000. }
  11001. },
  11002. "additionalProperties": false,
  11003. "description": "Server configuration for opencode serve and web commands"
  11004. },
  11005. "PermissionActionConfig": {
  11006. "type": "string",
  11007. "enum": ["ask", "allow", "deny"]
  11008. },
  11009. "PermissionObjectConfig": {
  11010. "type": "object",
  11011. "additionalProperties": {
  11012. "$ref": "#/components/schemas/PermissionActionConfig"
  11013. }
  11014. },
  11015. "PermissionRuleConfig": {
  11016. "anyOf": [
  11017. {
  11018. "$ref": "#/components/schemas/PermissionActionConfig"
  11019. },
  11020. {
  11021. "$ref": "#/components/schemas/PermissionObjectConfig"
  11022. }
  11023. ]
  11024. },
  11025. "PermissionConfig": {
  11026. "anyOf": [
  11027. {
  11028. "$ref": "#/components/schemas/PermissionActionConfig"
  11029. },
  11030. {
  11031. "type": "object",
  11032. "properties": {
  11033. "read": {
  11034. "$ref": "#/components/schemas/PermissionRuleConfig"
  11035. },
  11036. "edit": {
  11037. "$ref": "#/components/schemas/PermissionRuleConfig"
  11038. },
  11039. "glob": {
  11040. "$ref": "#/components/schemas/PermissionRuleConfig"
  11041. },
  11042. "grep": {
  11043. "$ref": "#/components/schemas/PermissionRuleConfig"
  11044. },
  11045. "list": {
  11046. "$ref": "#/components/schemas/PermissionRuleConfig"
  11047. },
  11048. "bash": {
  11049. "$ref": "#/components/schemas/PermissionRuleConfig"
  11050. },
  11051. "task": {
  11052. "$ref": "#/components/schemas/PermissionRuleConfig"
  11053. },
  11054. "external_directory": {
  11055. "$ref": "#/components/schemas/PermissionRuleConfig"
  11056. },
  11057. "todowrite": {
  11058. "$ref": "#/components/schemas/PermissionActionConfig"
  11059. },
  11060. "question": {
  11061. "$ref": "#/components/schemas/PermissionActionConfig"
  11062. },
  11063. "webfetch": {
  11064. "$ref": "#/components/schemas/PermissionActionConfig"
  11065. },
  11066. "websearch": {
  11067. "$ref": "#/components/schemas/PermissionActionConfig"
  11068. },
  11069. "lsp": {
  11070. "$ref": "#/components/schemas/PermissionRuleConfig"
  11071. },
  11072. "doom_loop": {
  11073. "$ref": "#/components/schemas/PermissionActionConfig"
  11074. },
  11075. "skill": {
  11076. "$ref": "#/components/schemas/PermissionRuleConfig"
  11077. }
  11078. },
  11079. "additionalProperties": {
  11080. "$ref": "#/components/schemas/PermissionRuleConfig"
  11081. }
  11082. }
  11083. ]
  11084. },
  11085. "AgentConfig": {
  11086. "type": "object",
  11087. "properties": {
  11088. "model": {
  11089. "type": "string"
  11090. },
  11091. "variant": {
  11092. "type": "string"
  11093. },
  11094. "temperature": {
  11095. "type": "number"
  11096. },
  11097. "top_p": {
  11098. "type": "number"
  11099. },
  11100. "prompt": {
  11101. "type": "string"
  11102. },
  11103. "tools": {
  11104. "type": "object",
  11105. "additionalProperties": {
  11106. "type": "boolean"
  11107. }
  11108. },
  11109. "disable": {
  11110. "type": "boolean"
  11111. },
  11112. "description": {
  11113. "type": "string"
  11114. },
  11115. "mode": {
  11116. "type": "string",
  11117. "enum": ["subagent", "primary", "all"]
  11118. },
  11119. "hidden": {
  11120. "type": "boolean"
  11121. },
  11122. "options": {
  11123. "type": "object"
  11124. },
  11125. "color": {
  11126. "anyOf": [
  11127. {
  11128. "type": "string",
  11129. "pattern": "^#[0-9a-fA-F]{6}$"
  11130. },
  11131. {
  11132. "type": "string",
  11133. "enum": ["primary", "secondary", "accent", "success", "warning", "error", "info"]
  11134. }
  11135. ],
  11136. "description": "Hex color code (e.g., #FF5733) or theme color (e.g., primary)"
  11137. },
  11138. "steps": {
  11139. "type": "integer",
  11140. "exclusiveMinimum": 0
  11141. },
  11142. "maxSteps": {
  11143. "type": "integer",
  11144. "exclusiveMinimum": 0
  11145. },
  11146. "permission": {
  11147. "$ref": "#/components/schemas/PermissionConfig"
  11148. }
  11149. },
  11150. "additionalProperties": {}
  11151. },
  11152. "ProviderConfig": {
  11153. "type": "object",
  11154. "properties": {
  11155. "api": {
  11156. "type": "string"
  11157. },
  11158. "name": {
  11159. "type": "string"
  11160. },
  11161. "env": {
  11162. "type": "array",
  11163. "items": {
  11164. "type": "string"
  11165. }
  11166. },
  11167. "id": {
  11168. "type": "string"
  11169. },
  11170. "npm": {
  11171. "type": "string"
  11172. },
  11173. "whitelist": {
  11174. "type": "array",
  11175. "items": {
  11176. "type": "string"
  11177. }
  11178. },
  11179. "blacklist": {
  11180. "type": "array",
  11181. "items": {
  11182. "type": "string"
  11183. }
  11184. },
  11185. "options": {
  11186. "type": "object",
  11187. "properties": {
  11188. "apiKey": {
  11189. "type": "string"
  11190. },
  11191. "baseURL": {
  11192. "type": "string"
  11193. },
  11194. "enterpriseUrl": {
  11195. "type": "string"
  11196. },
  11197. "setCacheKey": {
  11198. "type": "boolean"
  11199. },
  11200. "timeout": {
  11201. "anyOf": [
  11202. {
  11203. "type": "integer",
  11204. "exclusiveMinimum": 0
  11205. },
  11206. {
  11207. "type": "boolean",
  11208. "enum": [false]
  11209. }
  11210. ],
  11211. "description": "Timeout in milliseconds for requests to this provider. Default is 300000 (5 minutes). Set to false to disable timeout."
  11212. },
  11213. "chunkTimeout": {
  11214. "type": "integer",
  11215. "exclusiveMinimum": 0
  11216. }
  11217. },
  11218. "additionalProperties": {}
  11219. },
  11220. "models": {
  11221. "type": "object",
  11222. "additionalProperties": {
  11223. "type": "object",
  11224. "properties": {
  11225. "id": {
  11226. "type": "string"
  11227. },
  11228. "name": {
  11229. "type": "string"
  11230. },
  11231. "family": {
  11232. "type": "string"
  11233. },
  11234. "release_date": {
  11235. "type": "string"
  11236. },
  11237. "attachment": {
  11238. "type": "boolean"
  11239. },
  11240. "reasoning": {
  11241. "type": "boolean"
  11242. },
  11243. "temperature": {
  11244. "type": "boolean"
  11245. },
  11246. "tool_call": {
  11247. "type": "boolean"
  11248. },
  11249. "interleaved": {
  11250. "anyOf": [
  11251. {
  11252. "type": "boolean",
  11253. "enum": [true]
  11254. },
  11255. {
  11256. "type": "object",
  11257. "properties": {
  11258. "field": {
  11259. "type": "string",
  11260. "enum": ["reasoning_content", "reasoning_details"]
  11261. }
  11262. },
  11263. "required": ["field"],
  11264. "additionalProperties": false
  11265. }
  11266. ]
  11267. },
  11268. "cost": {
  11269. "type": "object",
  11270. "properties": {
  11271. "input": {
  11272. "type": "number"
  11273. },
  11274. "output": {
  11275. "type": "number"
  11276. },
  11277. "cache_read": {
  11278. "type": "number"
  11279. },
  11280. "cache_write": {
  11281. "type": "number"
  11282. },
  11283. "context_over_200k": {
  11284. "type": "object",
  11285. "properties": {
  11286. "input": {
  11287. "type": "number"
  11288. },
  11289. "output": {
  11290. "type": "number"
  11291. },
  11292. "cache_read": {
  11293. "type": "number"
  11294. },
  11295. "cache_write": {
  11296. "type": "number"
  11297. }
  11298. },
  11299. "required": ["input", "output"],
  11300. "additionalProperties": false
  11301. }
  11302. },
  11303. "required": ["input", "output"],
  11304. "additionalProperties": false
  11305. },
  11306. "limit": {
  11307. "type": "object",
  11308. "properties": {
  11309. "context": {
  11310. "type": "number"
  11311. },
  11312. "input": {
  11313. "type": "number"
  11314. },
  11315. "output": {
  11316. "type": "number"
  11317. }
  11318. },
  11319. "required": ["context", "output"],
  11320. "additionalProperties": false
  11321. },
  11322. "modalities": {
  11323. "type": "object",
  11324. "properties": {
  11325. "input": {
  11326. "type": "array",
  11327. "items": {
  11328. "type": "string",
  11329. "enum": ["text", "audio", "image", "video", "pdf"]
  11330. }
  11331. },
  11332. "output": {
  11333. "type": "array",
  11334. "items": {
  11335. "type": "string",
  11336. "enum": ["text", "audio", "image", "video", "pdf"]
  11337. }
  11338. }
  11339. },
  11340. "required": ["input", "output"],
  11341. "additionalProperties": false
  11342. },
  11343. "experimental": {
  11344. "type": "boolean"
  11345. },
  11346. "status": {
  11347. "type": "string",
  11348. "enum": ["alpha", "beta", "deprecated"]
  11349. },
  11350. "provider": {
  11351. "type": "object",
  11352. "properties": {
  11353. "npm": {
  11354. "type": "string"
  11355. },
  11356. "api": {
  11357. "type": "string"
  11358. }
  11359. },
  11360. "additionalProperties": false
  11361. },
  11362. "options": {
  11363. "type": "object"
  11364. },
  11365. "headers": {
  11366. "type": "object",
  11367. "additionalProperties": {
  11368. "type": "string"
  11369. }
  11370. },
  11371. "variants": {
  11372. "type": "object",
  11373. "additionalProperties": {
  11374. "type": "object",
  11375. "properties": {
  11376. "disabled": {
  11377. "type": "boolean"
  11378. }
  11379. },
  11380. "additionalProperties": {}
  11381. },
  11382. "description": "Variant-specific configuration"
  11383. }
  11384. },
  11385. "additionalProperties": false
  11386. }
  11387. }
  11388. },
  11389. "additionalProperties": false
  11390. },
  11391. "McpLocalConfig": {
  11392. "type": "object",
  11393. "properties": {
  11394. "type": {
  11395. "type": "string",
  11396. "enum": ["local"],
  11397. "description": "Type of MCP server connection"
  11398. },
  11399. "command": {
  11400. "type": "array",
  11401. "items": {
  11402. "type": "string"
  11403. },
  11404. "description": "Command and arguments to run the MCP server"
  11405. },
  11406. "environment": {
  11407. "type": "object",
  11408. "additionalProperties": {
  11409. "type": "string"
  11410. }
  11411. },
  11412. "enabled": {
  11413. "type": "boolean"
  11414. },
  11415. "timeout": {
  11416. "type": "integer",
  11417. "exclusiveMinimum": 0
  11418. }
  11419. },
  11420. "required": ["type", "command"],
  11421. "additionalProperties": false
  11422. },
  11423. "McpOAuthConfig": {
  11424. "type": "object",
  11425. "properties": {
  11426. "clientId": {
  11427. "type": "string"
  11428. },
  11429. "clientSecret": {
  11430. "type": "string"
  11431. },
  11432. "scope": {
  11433. "type": "string"
  11434. },
  11435. "redirectUri": {
  11436. "type": "string"
  11437. }
  11438. },
  11439. "additionalProperties": false
  11440. },
  11441. "McpRemoteConfig": {
  11442. "type": "object",
  11443. "properties": {
  11444. "type": {
  11445. "type": "string",
  11446. "enum": ["remote"],
  11447. "description": "Type of MCP server connection"
  11448. },
  11449. "url": {
  11450. "type": "string",
  11451. "description": "URL of the remote MCP server"
  11452. },
  11453. "enabled": {
  11454. "type": "boolean"
  11455. },
  11456. "headers": {
  11457. "type": "object",
  11458. "additionalProperties": {
  11459. "type": "string"
  11460. }
  11461. },
  11462. "oauth": {
  11463. "anyOf": [
  11464. {
  11465. "$ref": "#/components/schemas/McpOAuthConfig"
  11466. },
  11467. {
  11468. "type": "boolean",
  11469. "enum": [false]
  11470. }
  11471. ],
  11472. "description": "OAuth authentication configuration for the MCP server. Set to false to disable OAuth auto-detection."
  11473. },
  11474. "timeout": {
  11475. "type": "integer",
  11476. "exclusiveMinimum": 0
  11477. }
  11478. },
  11479. "required": ["type", "url"],
  11480. "additionalProperties": false
  11481. },
  11482. "LayoutConfig": {
  11483. "type": "string",
  11484. "enum": ["auto", "stretch"],
  11485. "description": "@deprecated Always uses stretch layout."
  11486. },
  11487. "Config": {
  11488. "type": "object",
  11489. "properties": {
  11490. "$schema": {
  11491. "type": "string"
  11492. },
  11493. "shell": {
  11494. "type": "string"
  11495. },
  11496. "logLevel": {
  11497. "$ref": "#/components/schemas/LogLevel"
  11498. },
  11499. "server": {
  11500. "$ref": "#/components/schemas/ServerConfig"
  11501. },
  11502. "command": {
  11503. "type": "object",
  11504. "additionalProperties": {
  11505. "type": "object",
  11506. "properties": {
  11507. "template": {
  11508. "type": "string"
  11509. },
  11510. "description": {
  11511. "type": "string"
  11512. },
  11513. "agent": {
  11514. "type": "string"
  11515. },
  11516. "model": {
  11517. "type": "string"
  11518. },
  11519. "subtask": {
  11520. "type": "boolean"
  11521. }
  11522. },
  11523. "required": ["template"],
  11524. "additionalProperties": false
  11525. }
  11526. },
  11527. "skills": {
  11528. "type": "object",
  11529. "properties": {
  11530. "paths": {
  11531. "type": "array",
  11532. "items": {
  11533. "type": "string"
  11534. }
  11535. },
  11536. "urls": {
  11537. "type": "array",
  11538. "items": {
  11539. "type": "string"
  11540. }
  11541. }
  11542. },
  11543. "additionalProperties": false
  11544. },
  11545. "watcher": {
  11546. "type": "object",
  11547. "properties": {
  11548. "ignore": {
  11549. "type": "array",
  11550. "items": {
  11551. "type": "string"
  11552. }
  11553. }
  11554. },
  11555. "additionalProperties": false
  11556. },
  11557. "snapshot": {
  11558. "type": "boolean"
  11559. },
  11560. "plugin": {
  11561. "type": "array",
  11562. "items": {
  11563. "anyOf": [
  11564. {
  11565. "type": "string"
  11566. },
  11567. {
  11568. "type": "array",
  11569. "prefixItems": [
  11570. {
  11571. "type": "string"
  11572. },
  11573. {
  11574. "type": "object"
  11575. }
  11576. ],
  11577. "maxItems": 2,
  11578. "minItems": 2
  11579. }
  11580. ]
  11581. }
  11582. },
  11583. "share": {
  11584. "type": "string",
  11585. "enum": ["manual", "auto", "disabled"]
  11586. },
  11587. "autoshare": {
  11588. "type": "boolean"
  11589. },
  11590. "autoupdate": {
  11591. "anyOf": [
  11592. {
  11593. "type": "boolean"
  11594. },
  11595. {
  11596. "type": "string",
  11597. "enum": ["notify"]
  11598. }
  11599. ],
  11600. "description": "Automatically update to the latest version. Set to true to auto-update, false to disable, or 'notify' to show update notifications"
  11601. },
  11602. "disabled_providers": {
  11603. "type": "array",
  11604. "items": {
  11605. "type": "string"
  11606. }
  11607. },
  11608. "enabled_providers": {
  11609. "type": "array",
  11610. "items": {
  11611. "type": "string"
  11612. }
  11613. },
  11614. "model": {
  11615. "type": "string"
  11616. },
  11617. "small_model": {
  11618. "type": "string"
  11619. },
  11620. "default_agent": {
  11621. "type": "string"
  11622. },
  11623. "username": {
  11624. "type": "string"
  11625. },
  11626. "mode": {
  11627. "type": "object",
  11628. "properties": {
  11629. "build": {
  11630. "$ref": "#/components/schemas/AgentConfig"
  11631. },
  11632. "plan": {
  11633. "$ref": "#/components/schemas/AgentConfig"
  11634. }
  11635. },
  11636. "additionalProperties": {
  11637. "$ref": "#/components/schemas/AgentConfig"
  11638. }
  11639. },
  11640. "agent": {
  11641. "type": "object",
  11642. "properties": {
  11643. "plan": {
  11644. "$ref": "#/components/schemas/AgentConfig"
  11645. },
  11646. "build": {
  11647. "$ref": "#/components/schemas/AgentConfig"
  11648. },
  11649. "general": {
  11650. "$ref": "#/components/schemas/AgentConfig"
  11651. },
  11652. "explore": {
  11653. "$ref": "#/components/schemas/AgentConfig"
  11654. },
  11655. "title": {
  11656. "$ref": "#/components/schemas/AgentConfig"
  11657. },
  11658. "summary": {
  11659. "$ref": "#/components/schemas/AgentConfig"
  11660. },
  11661. "compaction": {
  11662. "$ref": "#/components/schemas/AgentConfig"
  11663. }
  11664. },
  11665. "additionalProperties": {
  11666. "$ref": "#/components/schemas/AgentConfig"
  11667. }
  11668. },
  11669. "provider": {
  11670. "type": "object",
  11671. "additionalProperties": {
  11672. "$ref": "#/components/schemas/ProviderConfig"
  11673. }
  11674. },
  11675. "mcp": {
  11676. "type": "object",
  11677. "additionalProperties": {
  11678. "anyOf": [
  11679. {
  11680. "$ref": "#/components/schemas/McpLocalConfig"
  11681. },
  11682. {
  11683. "$ref": "#/components/schemas/McpRemoteConfig"
  11684. },
  11685. {
  11686. "type": "object",
  11687. "properties": {
  11688. "enabled": {
  11689. "type": "boolean"
  11690. }
  11691. },
  11692. "required": ["enabled"],
  11693. "additionalProperties": false
  11694. }
  11695. ]
  11696. }
  11697. },
  11698. "formatter": {
  11699. "anyOf": [
  11700. {
  11701. "type": "boolean"
  11702. },
  11703. {
  11704. "type": "object",
  11705. "additionalProperties": {
  11706. "type": "object",
  11707. "properties": {
  11708. "disabled": {
  11709. "type": "boolean"
  11710. },
  11711. "command": {
  11712. "type": "array",
  11713. "items": {
  11714. "type": "string"
  11715. }
  11716. },
  11717. "environment": {
  11718. "type": "object",
  11719. "additionalProperties": {
  11720. "type": "string"
  11721. }
  11722. },
  11723. "extensions": {
  11724. "type": "array",
  11725. "items": {
  11726. "type": "string"
  11727. }
  11728. }
  11729. },
  11730. "additionalProperties": false
  11731. }
  11732. }
  11733. ],
  11734. "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."
  11735. },
  11736. "lsp": {
  11737. "anyOf": [
  11738. {
  11739. "type": "boolean"
  11740. },
  11741. {
  11742. "type": "object",
  11743. "additionalProperties": {
  11744. "anyOf": [
  11745. {
  11746. "type": "object",
  11747. "properties": {
  11748. "disabled": {
  11749. "type": "boolean",
  11750. "enum": [true]
  11751. }
  11752. },
  11753. "required": ["disabled"],
  11754. "additionalProperties": false
  11755. },
  11756. {
  11757. "type": "object",
  11758. "properties": {
  11759. "command": {
  11760. "type": "array",
  11761. "items": {
  11762. "type": "string"
  11763. }
  11764. },
  11765. "extensions": {
  11766. "type": "array",
  11767. "items": {
  11768. "type": "string"
  11769. }
  11770. },
  11771. "disabled": {
  11772. "type": "boolean"
  11773. },
  11774. "env": {
  11775. "type": "object",
  11776. "additionalProperties": {
  11777. "type": "string"
  11778. }
  11779. },
  11780. "initialization": {
  11781. "type": "object"
  11782. }
  11783. },
  11784. "required": ["command"],
  11785. "additionalProperties": false
  11786. }
  11787. ]
  11788. }
  11789. }
  11790. ],
  11791. "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."
  11792. },
  11793. "instructions": {
  11794. "type": "array",
  11795. "items": {
  11796. "type": "string"
  11797. }
  11798. },
  11799. "layout": {
  11800. "$ref": "#/components/schemas/LayoutConfig"
  11801. },
  11802. "permission": {
  11803. "$ref": "#/components/schemas/PermissionConfig"
  11804. },
  11805. "tools": {
  11806. "type": "object",
  11807. "additionalProperties": {
  11808. "type": "boolean"
  11809. }
  11810. },
  11811. "enterprise": {
  11812. "type": "object",
  11813. "properties": {
  11814. "url": {
  11815. "type": "string"
  11816. }
  11817. },
  11818. "additionalProperties": false
  11819. },
  11820. "tool_output": {
  11821. "type": "object",
  11822. "properties": {
  11823. "max_lines": {
  11824. "type": "integer",
  11825. "exclusiveMinimum": 0
  11826. },
  11827. "max_bytes": {
  11828. "type": "integer",
  11829. "exclusiveMinimum": 0
  11830. }
  11831. },
  11832. "additionalProperties": false
  11833. },
  11834. "compaction": {
  11835. "type": "object",
  11836. "properties": {
  11837. "auto": {
  11838. "type": "boolean"
  11839. },
  11840. "prune": {
  11841. "type": "boolean"
  11842. },
  11843. "tail_turns": {
  11844. "type": "integer",
  11845. "minimum": 0
  11846. },
  11847. "preserve_recent_tokens": {
  11848. "type": "integer",
  11849. "minimum": 0
  11850. },
  11851. "reserved": {
  11852. "type": "integer",
  11853. "minimum": 0
  11854. }
  11855. },
  11856. "additionalProperties": false
  11857. },
  11858. "experimental": {
  11859. "type": "object",
  11860. "properties": {
  11861. "disable_paste_summary": {
  11862. "type": "boolean"
  11863. },
  11864. "batch_tool": {
  11865. "type": "boolean"
  11866. },
  11867. "openTelemetry": {
  11868. "type": "boolean"
  11869. },
  11870. "primary_tools": {
  11871. "type": "array",
  11872. "items": {
  11873. "type": "string"
  11874. }
  11875. },
  11876. "continue_loop_on_deny": {
  11877. "type": "boolean"
  11878. },
  11879. "mcp_timeout": {
  11880. "type": "integer",
  11881. "exclusiveMinimum": 0
  11882. }
  11883. },
  11884. "additionalProperties": false
  11885. }
  11886. },
  11887. "additionalProperties": false
  11888. },
  11889. "Model": {
  11890. "type": "object",
  11891. "properties": {
  11892. "id": {
  11893. "type": "string"
  11894. },
  11895. "providerID": {
  11896. "type": "string"
  11897. },
  11898. "api": {
  11899. "type": "object",
  11900. "properties": {
  11901. "id": {
  11902. "type": "string"
  11903. },
  11904. "url": {
  11905. "type": "string"
  11906. },
  11907. "npm": {
  11908. "type": "string"
  11909. }
  11910. },
  11911. "required": ["id", "url", "npm"],
  11912. "additionalProperties": false
  11913. },
  11914. "name": {
  11915. "type": "string"
  11916. },
  11917. "family": {
  11918. "type": "string"
  11919. },
  11920. "capabilities": {
  11921. "type": "object",
  11922. "properties": {
  11923. "temperature": {
  11924. "type": "boolean"
  11925. },
  11926. "reasoning": {
  11927. "type": "boolean"
  11928. },
  11929. "attachment": {
  11930. "type": "boolean"
  11931. },
  11932. "toolcall": {
  11933. "type": "boolean"
  11934. },
  11935. "input": {
  11936. "type": "object",
  11937. "properties": {
  11938. "text": {
  11939. "type": "boolean"
  11940. },
  11941. "audio": {
  11942. "type": "boolean"
  11943. },
  11944. "image": {
  11945. "type": "boolean"
  11946. },
  11947. "video": {
  11948. "type": "boolean"
  11949. },
  11950. "pdf": {
  11951. "type": "boolean"
  11952. }
  11953. },
  11954. "required": ["text", "audio", "image", "video", "pdf"],
  11955. "additionalProperties": false
  11956. },
  11957. "output": {
  11958. "type": "object",
  11959. "properties": {
  11960. "text": {
  11961. "type": "boolean"
  11962. },
  11963. "audio": {
  11964. "type": "boolean"
  11965. },
  11966. "image": {
  11967. "type": "boolean"
  11968. },
  11969. "video": {
  11970. "type": "boolean"
  11971. },
  11972. "pdf": {
  11973. "type": "boolean"
  11974. }
  11975. },
  11976. "required": ["text", "audio", "image", "video", "pdf"],
  11977. "additionalProperties": false
  11978. },
  11979. "interleaved": {
  11980. "anyOf": [
  11981. {
  11982. "type": "boolean"
  11983. },
  11984. {
  11985. "type": "object",
  11986. "properties": {
  11987. "field": {
  11988. "type": "string",
  11989. "enum": ["reasoning_content", "reasoning_details"]
  11990. }
  11991. },
  11992. "required": ["field"],
  11993. "additionalProperties": false
  11994. }
  11995. ]
  11996. }
  11997. },
  11998. "required": ["temperature", "reasoning", "attachment", "toolcall", "input", "output", "interleaved"],
  11999. "additionalProperties": false
  12000. },
  12001. "cost": {
  12002. "type": "object",
  12003. "properties": {
  12004. "input": {
  12005. "type": "number"
  12006. },
  12007. "output": {
  12008. "type": "number"
  12009. },
  12010. "cache": {
  12011. "type": "object",
  12012. "properties": {
  12013. "read": {
  12014. "type": "number"
  12015. },
  12016. "write": {
  12017. "type": "number"
  12018. }
  12019. },
  12020. "required": ["read", "write"],
  12021. "additionalProperties": false
  12022. },
  12023. "experimentalOver200K": {
  12024. "type": "object",
  12025. "properties": {
  12026. "input": {
  12027. "type": "number"
  12028. },
  12029. "output": {
  12030. "type": "number"
  12031. },
  12032. "cache": {
  12033. "type": "object",
  12034. "properties": {
  12035. "read": {
  12036. "type": "number"
  12037. },
  12038. "write": {
  12039. "type": "number"
  12040. }
  12041. },
  12042. "required": ["read", "write"],
  12043. "additionalProperties": false
  12044. }
  12045. },
  12046. "required": ["input", "output", "cache"],
  12047. "additionalProperties": false
  12048. }
  12049. },
  12050. "required": ["input", "output", "cache"],
  12051. "additionalProperties": false
  12052. },
  12053. "limit": {
  12054. "type": "object",
  12055. "properties": {
  12056. "context": {
  12057. "type": "number"
  12058. },
  12059. "input": {
  12060. "type": "number"
  12061. },
  12062. "output": {
  12063. "type": "number"
  12064. }
  12065. },
  12066. "required": ["context", "output"],
  12067. "additionalProperties": false
  12068. },
  12069. "status": {
  12070. "type": "string",
  12071. "enum": ["alpha", "beta", "deprecated", "active"]
  12072. },
  12073. "options": {
  12074. "type": "object"
  12075. },
  12076. "headers": {
  12077. "type": "object",
  12078. "additionalProperties": {
  12079. "type": "string"
  12080. }
  12081. },
  12082. "release_date": {
  12083. "type": "string"
  12084. },
  12085. "variants": {
  12086. "type": "object",
  12087. "additionalProperties": {
  12088. "type": "object"
  12089. }
  12090. }
  12091. },
  12092. "required": [
  12093. "id",
  12094. "providerID",
  12095. "api",
  12096. "name",
  12097. "capabilities",
  12098. "cost",
  12099. "limit",
  12100. "status",
  12101. "options",
  12102. "headers",
  12103. "release_date"
  12104. ],
  12105. "additionalProperties": false
  12106. },
  12107. "Provider": {
  12108. "type": "object",
  12109. "properties": {
  12110. "id": {
  12111. "type": "string"
  12112. },
  12113. "name": {
  12114. "type": "string"
  12115. },
  12116. "source": {
  12117. "type": "string",
  12118. "enum": ["env", "config", "custom", "api"]
  12119. },
  12120. "env": {
  12121. "type": "array",
  12122. "items": {
  12123. "type": "string"
  12124. }
  12125. },
  12126. "key": {
  12127. "type": "string"
  12128. },
  12129. "options": {
  12130. "type": "object"
  12131. },
  12132. "models": {
  12133. "type": "object",
  12134. "additionalProperties": {
  12135. "$ref": "#/components/schemas/Model"
  12136. }
  12137. }
  12138. },
  12139. "required": ["id", "name", "source", "env", "options", "models"],
  12140. "additionalProperties": false
  12141. },
  12142. "ConsoleState": {
  12143. "type": "object",
  12144. "properties": {
  12145. "consoleManagedProviders": {
  12146. "type": "array",
  12147. "items": {
  12148. "type": "string"
  12149. }
  12150. },
  12151. "activeOrgName": {
  12152. "type": "string"
  12153. },
  12154. "switchableOrgCount": {
  12155. "type": "integer",
  12156. "minimum": 0
  12157. }
  12158. },
  12159. "required": ["consoleManagedProviders", "switchableOrgCount"],
  12160. "additionalProperties": false
  12161. },
  12162. "ToolListItem": {
  12163. "type": "object",
  12164. "properties": {
  12165. "id": {
  12166. "type": "string"
  12167. },
  12168. "description": {
  12169. "type": "string"
  12170. },
  12171. "parameters": {}
  12172. },
  12173. "required": ["id", "description", "parameters"],
  12174. "additionalProperties": false
  12175. },
  12176. "ToolList": {
  12177. "type": "array",
  12178. "items": {
  12179. "$ref": "#/components/schemas/ToolListItem"
  12180. }
  12181. },
  12182. "ToolIDs": {
  12183. "type": "array",
  12184. "items": {
  12185. "type": "string"
  12186. }
  12187. },
  12188. "WorktreeCreateInput": {
  12189. "type": "object",
  12190. "properties": {
  12191. "name": {
  12192. "type": "string"
  12193. },
  12194. "startCommand": {
  12195. "type": "string",
  12196. "description": "Additional startup script to run after the project's start command"
  12197. }
  12198. },
  12199. "additionalProperties": false
  12200. },
  12201. "Worktree": {
  12202. "type": "object",
  12203. "properties": {
  12204. "name": {
  12205. "type": "string"
  12206. },
  12207. "branch": {
  12208. "type": "string"
  12209. },
  12210. "directory": {
  12211. "type": "string"
  12212. }
  12213. },
  12214. "required": ["name", "branch", "directory"],
  12215. "additionalProperties": false
  12216. },
  12217. "WorktreeRemoveInput": {
  12218. "type": "object",
  12219. "properties": {
  12220. "directory": {
  12221. "type": "string"
  12222. }
  12223. },
  12224. "required": ["directory"],
  12225. "additionalProperties": false
  12226. },
  12227. "WorktreeResetInput": {
  12228. "type": "object",
  12229. "properties": {
  12230. "directory": {
  12231. "type": "string"
  12232. }
  12233. },
  12234. "required": ["directory"],
  12235. "additionalProperties": false
  12236. },
  12237. "ProjectSummary": {
  12238. "type": "object",
  12239. "properties": {
  12240. "id": {
  12241. "type": "string"
  12242. },
  12243. "name": {
  12244. "type": "string"
  12245. },
  12246. "worktree": {
  12247. "type": "string"
  12248. }
  12249. },
  12250. "required": ["id", "worktree"],
  12251. "additionalProperties": false
  12252. },
  12253. "GlobalSession": {
  12254. "type": "object",
  12255. "properties": {
  12256. "id": {
  12257. "type": "string"
  12258. },
  12259. "slug": {
  12260. "type": "string"
  12261. },
  12262. "projectID": {
  12263. "type": "string"
  12264. },
  12265. "workspaceID": {
  12266. "type": "string"
  12267. },
  12268. "directory": {
  12269. "type": "string"
  12270. },
  12271. "path": {
  12272. "type": "string"
  12273. },
  12274. "parentID": {
  12275. "type": "string"
  12276. },
  12277. "summary": {
  12278. "type": "object",
  12279. "properties": {
  12280. "additions": {
  12281. "type": "integer",
  12282. "minimum": 0
  12283. },
  12284. "deletions": {
  12285. "type": "integer",
  12286. "minimum": 0
  12287. },
  12288. "files": {
  12289. "type": "integer",
  12290. "minimum": 0
  12291. },
  12292. "diffs": {
  12293. "type": "array",
  12294. "items": {
  12295. "$ref": "#/components/schemas/SnapshotFileDiff"
  12296. }
  12297. }
  12298. },
  12299. "required": ["additions", "deletions", "files"],
  12300. "additionalProperties": false
  12301. },
  12302. "share": {
  12303. "type": "object",
  12304. "properties": {
  12305. "url": {
  12306. "type": "string"
  12307. }
  12308. },
  12309. "required": ["url"],
  12310. "additionalProperties": false
  12311. },
  12312. "title": {
  12313. "type": "string"
  12314. },
  12315. "agent": {
  12316. "type": "string"
  12317. },
  12318. "model": {
  12319. "type": "object",
  12320. "properties": {
  12321. "id": {
  12322. "type": "string"
  12323. },
  12324. "providerID": {
  12325. "type": "string"
  12326. },
  12327. "variant": {
  12328. "type": "string"
  12329. }
  12330. },
  12331. "required": ["id", "providerID"],
  12332. "additionalProperties": false
  12333. },
  12334. "version": {
  12335. "type": "string"
  12336. },
  12337. "time": {
  12338. "type": "object",
  12339. "properties": {
  12340. "created": {
  12341. "type": "integer",
  12342. "minimum": 0
  12343. },
  12344. "updated": {
  12345. "type": "integer",
  12346. "minimum": 0
  12347. },
  12348. "compacting": {
  12349. "type": "integer",
  12350. "minimum": 0
  12351. },
  12352. "archived": {
  12353. "type": "number"
  12354. }
  12355. },
  12356. "required": ["created", "updated"],
  12357. "additionalProperties": false
  12358. },
  12359. "permission": {
  12360. "$ref": "#/components/schemas/PermissionRuleset"
  12361. },
  12362. "revert": {
  12363. "type": "object",
  12364. "properties": {
  12365. "messageID": {
  12366. "type": "string"
  12367. },
  12368. "partID": {
  12369. "type": "string"
  12370. },
  12371. "snapshot": {
  12372. "type": "string"
  12373. },
  12374. "diff": {
  12375. "type": "string"
  12376. }
  12377. },
  12378. "required": ["messageID"],
  12379. "additionalProperties": false
  12380. },
  12381. "project": {
  12382. "anyOf": [
  12383. {
  12384. "$ref": "#/components/schemas/ProjectSummary"
  12385. },
  12386. {
  12387. "type": "null"
  12388. }
  12389. ]
  12390. }
  12391. },
  12392. "required": ["id", "slug", "projectID", "directory", "title", "version", "time", "project"],
  12393. "additionalProperties": false
  12394. },
  12395. "McpResource": {
  12396. "type": "object",
  12397. "properties": {
  12398. "name": {
  12399. "type": "string"
  12400. },
  12401. "uri": {
  12402. "type": "string"
  12403. },
  12404. "description": {
  12405. "type": "string"
  12406. },
  12407. "mimeType": {
  12408. "type": "string"
  12409. },
  12410. "client": {
  12411. "type": "string"
  12412. }
  12413. },
  12414. "required": ["name", "uri", "client"],
  12415. "additionalProperties": false
  12416. },
  12417. "Symbol": {
  12418. "type": "object",
  12419. "properties": {
  12420. "name": {
  12421. "type": "string"
  12422. },
  12423. "kind": {
  12424. "type": "integer",
  12425. "minimum": 0
  12426. },
  12427. "location": {
  12428. "type": "object",
  12429. "properties": {
  12430. "uri": {
  12431. "type": "string"
  12432. },
  12433. "range": {
  12434. "$ref": "#/components/schemas/Range"
  12435. }
  12436. },
  12437. "required": ["uri", "range"],
  12438. "additionalProperties": false
  12439. }
  12440. },
  12441. "required": ["name", "kind", "location"],
  12442. "additionalProperties": false
  12443. },
  12444. "FileNode": {
  12445. "type": "object",
  12446. "properties": {
  12447. "name": {
  12448. "type": "string"
  12449. },
  12450. "path": {
  12451. "type": "string"
  12452. },
  12453. "absolute": {
  12454. "type": "string"
  12455. },
  12456. "type": {
  12457. "type": "string",
  12458. "enum": ["file", "directory"]
  12459. },
  12460. "ignored": {
  12461. "type": "boolean"
  12462. }
  12463. },
  12464. "required": ["name", "path", "absolute", "type", "ignored"],
  12465. "additionalProperties": false
  12466. },
  12467. "FileContent": {
  12468. "type": "object",
  12469. "properties": {
  12470. "type": {
  12471. "type": "string",
  12472. "enum": ["text", "binary"]
  12473. },
  12474. "content": {
  12475. "type": "string"
  12476. },
  12477. "diff": {
  12478. "type": "string"
  12479. },
  12480. "patch": {
  12481. "type": "object",
  12482. "properties": {
  12483. "oldFileName": {
  12484. "type": "string"
  12485. },
  12486. "newFileName": {
  12487. "type": "string"
  12488. },
  12489. "oldHeader": {
  12490. "type": "string"
  12491. },
  12492. "newHeader": {
  12493. "type": "string"
  12494. },
  12495. "hunks": {
  12496. "type": "array",
  12497. "items": {
  12498. "type": "object",
  12499. "properties": {
  12500. "oldStart": {
  12501. "type": "integer",
  12502. "minimum": 0
  12503. },
  12504. "oldLines": {
  12505. "type": "integer",
  12506. "minimum": 0
  12507. },
  12508. "newStart": {
  12509. "type": "integer",
  12510. "minimum": 0
  12511. },
  12512. "newLines": {
  12513. "type": "integer",
  12514. "minimum": 0
  12515. },
  12516. "lines": {
  12517. "type": "array",
  12518. "items": {
  12519. "type": "string"
  12520. }
  12521. }
  12522. },
  12523. "required": ["oldStart", "oldLines", "newStart", "newLines", "lines"],
  12524. "additionalProperties": false
  12525. }
  12526. },
  12527. "index": {
  12528. "type": "string"
  12529. }
  12530. },
  12531. "required": ["oldFileName", "newFileName", "hunks"],
  12532. "additionalProperties": false
  12533. },
  12534. "encoding": {
  12535. "type": "string",
  12536. "enum": ["base64"]
  12537. },
  12538. "mimeType": {
  12539. "type": "string"
  12540. }
  12541. },
  12542. "required": ["type", "content"],
  12543. "additionalProperties": false
  12544. },
  12545. "File": {
  12546. "type": "object",
  12547. "properties": {
  12548. "path": {
  12549. "type": "string"
  12550. },
  12551. "added": {
  12552. "type": "integer",
  12553. "minimum": 0
  12554. },
  12555. "removed": {
  12556. "type": "integer",
  12557. "minimum": 0
  12558. },
  12559. "status": {
  12560. "type": "string",
  12561. "enum": ["added", "deleted", "modified"]
  12562. }
  12563. },
  12564. "required": ["path", "added", "removed", "status"],
  12565. "additionalProperties": false
  12566. },
  12567. "Path": {
  12568. "type": "object",
  12569. "properties": {
  12570. "home": {
  12571. "type": "string"
  12572. },
  12573. "state": {
  12574. "type": "string"
  12575. },
  12576. "config": {
  12577. "type": "string"
  12578. },
  12579. "worktree": {
  12580. "type": "string"
  12581. },
  12582. "directory": {
  12583. "type": "string"
  12584. }
  12585. },
  12586. "required": ["home", "state", "config", "worktree", "directory"],
  12587. "additionalProperties": false
  12588. },
  12589. "VcsInfo": {
  12590. "type": "object",
  12591. "properties": {
  12592. "branch": {
  12593. "type": "string"
  12594. },
  12595. "default_branch": {
  12596. "type": "string"
  12597. }
  12598. },
  12599. "additionalProperties": false
  12600. },
  12601. "VcsFileDiff": {
  12602. "type": "object",
  12603. "properties": {
  12604. "file": {
  12605. "type": "string"
  12606. },
  12607. "patch": {
  12608. "type": "string"
  12609. },
  12610. "additions": {
  12611. "type": "integer",
  12612. "minimum": 0
  12613. },
  12614. "deletions": {
  12615. "type": "integer",
  12616. "minimum": 0
  12617. },
  12618. "status": {
  12619. "type": "string",
  12620. "enum": ["added", "deleted", "modified"]
  12621. }
  12622. },
  12623. "required": ["file", "patch", "additions", "deletions"],
  12624. "additionalProperties": false
  12625. },
  12626. "Command": {
  12627. "type": "object",
  12628. "properties": {
  12629. "name": {
  12630. "type": "string"
  12631. },
  12632. "description": {
  12633. "type": "string"
  12634. },
  12635. "agent": {
  12636. "type": "string"
  12637. },
  12638. "model": {
  12639. "type": "string"
  12640. },
  12641. "source": {
  12642. "type": "string",
  12643. "enum": ["command", "mcp", "skill"]
  12644. },
  12645. "template": {
  12646. "type": "string"
  12647. },
  12648. "subtask": {
  12649. "type": "boolean"
  12650. },
  12651. "hints": {
  12652. "type": "array",
  12653. "items": {
  12654. "type": "string"
  12655. }
  12656. }
  12657. },
  12658. "required": ["name", "template", "hints"],
  12659. "additionalProperties": false
  12660. },
  12661. "Agent": {
  12662. "type": "object",
  12663. "properties": {
  12664. "name": {
  12665. "type": "string"
  12666. },
  12667. "description": {
  12668. "type": "string"
  12669. },
  12670. "mode": {
  12671. "type": "string",
  12672. "enum": ["subagent", "primary", "all"]
  12673. },
  12674. "native": {
  12675. "type": "boolean"
  12676. },
  12677. "hidden": {
  12678. "type": "boolean"
  12679. },
  12680. "topP": {
  12681. "type": "number"
  12682. },
  12683. "temperature": {
  12684. "type": "number"
  12685. },
  12686. "color": {
  12687. "type": "string"
  12688. },
  12689. "permission": {
  12690. "$ref": "#/components/schemas/PermissionRuleset"
  12691. },
  12692. "model": {
  12693. "type": "object",
  12694. "properties": {
  12695. "modelID": {
  12696. "type": "string"
  12697. },
  12698. "providerID": {
  12699. "type": "string"
  12700. }
  12701. },
  12702. "required": ["modelID", "providerID"],
  12703. "additionalProperties": false
  12704. },
  12705. "variant": {
  12706. "type": "string"
  12707. },
  12708. "prompt": {
  12709. "type": "string"
  12710. },
  12711. "options": {
  12712. "type": "object"
  12713. },
  12714. "steps": {
  12715. "type": "number"
  12716. }
  12717. },
  12718. "required": ["name", "mode", "permission", "options"],
  12719. "additionalProperties": false
  12720. },
  12721. "LSPStatus": {
  12722. "type": "object",
  12723. "properties": {
  12724. "id": {
  12725. "type": "string"
  12726. },
  12727. "name": {
  12728. "type": "string"
  12729. },
  12730. "root": {
  12731. "type": "string"
  12732. },
  12733. "status": {
  12734. "type": "string",
  12735. "enum": ["connected", "error"]
  12736. }
  12737. },
  12738. "required": ["id", "name", "root", "status"],
  12739. "additionalProperties": false
  12740. },
  12741. "FormatterStatus": {
  12742. "type": "object",
  12743. "properties": {
  12744. "name": {
  12745. "type": "string"
  12746. },
  12747. "extensions": {
  12748. "type": "array",
  12749. "items": {
  12750. "type": "string"
  12751. }
  12752. },
  12753. "enabled": {
  12754. "type": "boolean"
  12755. }
  12756. },
  12757. "required": ["name", "extensions", "enabled"],
  12758. "additionalProperties": false
  12759. },
  12760. "MCPStatusConnected": {
  12761. "type": "object",
  12762. "properties": {
  12763. "status": {
  12764. "type": "string",
  12765. "enum": ["connected"]
  12766. }
  12767. },
  12768. "required": ["status"],
  12769. "additionalProperties": false
  12770. },
  12771. "MCPStatusDisabled": {
  12772. "type": "object",
  12773. "properties": {
  12774. "status": {
  12775. "type": "string",
  12776. "enum": ["disabled"]
  12777. }
  12778. },
  12779. "required": ["status"],
  12780. "additionalProperties": false
  12781. },
  12782. "MCPStatusFailed": {
  12783. "type": "object",
  12784. "properties": {
  12785. "status": {
  12786. "type": "string",
  12787. "enum": ["failed"]
  12788. },
  12789. "error": {
  12790. "type": "string"
  12791. }
  12792. },
  12793. "required": ["status", "error"],
  12794. "additionalProperties": false
  12795. },
  12796. "MCPStatusNeedsAuth": {
  12797. "type": "object",
  12798. "properties": {
  12799. "status": {
  12800. "type": "string",
  12801. "enum": ["needs_auth"]
  12802. }
  12803. },
  12804. "required": ["status"],
  12805. "additionalProperties": false
  12806. },
  12807. "MCPStatusNeedsClientRegistration": {
  12808. "type": "object",
  12809. "properties": {
  12810. "status": {
  12811. "type": "string",
  12812. "enum": ["needs_client_registration"]
  12813. },
  12814. "error": {
  12815. "type": "string"
  12816. }
  12817. },
  12818. "required": ["status", "error"],
  12819. "additionalProperties": false
  12820. },
  12821. "MCPStatus": {
  12822. "anyOf": [
  12823. {
  12824. "$ref": "#/components/schemas/MCPStatusConnected"
  12825. },
  12826. {
  12827. "$ref": "#/components/schemas/MCPStatusDisabled"
  12828. },
  12829. {
  12830. "$ref": "#/components/schemas/MCPStatusFailed"
  12831. },
  12832. {
  12833. "$ref": "#/components/schemas/MCPStatusNeedsAuth"
  12834. },
  12835. {
  12836. "$ref": "#/components/schemas/MCPStatusNeedsClientRegistration"
  12837. }
  12838. ]
  12839. },
  12840. "McpUnsupportedOAuthError": {
  12841. "type": "object",
  12842. "properties": {
  12843. "error": {
  12844. "type": "string"
  12845. }
  12846. },
  12847. "required": ["error"],
  12848. "additionalProperties": false
  12849. },
  12850. "effect_HttpApiError_Forbidden": {
  12851. "type": "object",
  12852. "properties": {
  12853. "_tag": {
  12854. "type": "string",
  12855. "enum": ["Forbidden"]
  12856. }
  12857. },
  12858. "required": ["_tag"],
  12859. "additionalProperties": false
  12860. },
  12861. "ProviderAuthMethod": {
  12862. "type": "object",
  12863. "properties": {
  12864. "type": {
  12865. "type": "string",
  12866. "enum": ["oauth", "api"]
  12867. },
  12868. "label": {
  12869. "type": "string"
  12870. },
  12871. "prompts": {
  12872. "type": "array",
  12873. "items": {
  12874. "anyOf": [
  12875. {
  12876. "type": "object",
  12877. "properties": {
  12878. "type": {
  12879. "type": "string",
  12880. "enum": ["text"]
  12881. },
  12882. "key": {
  12883. "type": "string"
  12884. },
  12885. "message": {
  12886. "type": "string"
  12887. },
  12888. "placeholder": {
  12889. "type": "string"
  12890. },
  12891. "when": {
  12892. "type": "object",
  12893. "properties": {
  12894. "key": {
  12895. "type": "string"
  12896. },
  12897. "op": {
  12898. "type": "string",
  12899. "enum": ["eq", "neq"]
  12900. },
  12901. "value": {
  12902. "type": "string"
  12903. }
  12904. },
  12905. "required": ["key", "op", "value"],
  12906. "additionalProperties": false
  12907. }
  12908. },
  12909. "required": ["type", "key", "message"],
  12910. "additionalProperties": false
  12911. },
  12912. {
  12913. "type": "object",
  12914. "properties": {
  12915. "type": {
  12916. "type": "string",
  12917. "enum": ["select"]
  12918. },
  12919. "key": {
  12920. "type": "string"
  12921. },
  12922. "message": {
  12923. "type": "string"
  12924. },
  12925. "options": {
  12926. "type": "array",
  12927. "items": {
  12928. "type": "object",
  12929. "properties": {
  12930. "label": {
  12931. "type": "string"
  12932. },
  12933. "value": {
  12934. "type": "string"
  12935. },
  12936. "hint": {
  12937. "type": "string"
  12938. }
  12939. },
  12940. "required": ["label", "value"],
  12941. "additionalProperties": false
  12942. }
  12943. },
  12944. "when": {
  12945. "type": "object",
  12946. "properties": {
  12947. "key": {
  12948. "type": "string"
  12949. },
  12950. "op": {
  12951. "type": "string",
  12952. "enum": ["eq", "neq"]
  12953. },
  12954. "value": {
  12955. "type": "string"
  12956. }
  12957. },
  12958. "required": ["key", "op", "value"],
  12959. "additionalProperties": false
  12960. }
  12961. },
  12962. "required": ["type", "key", "message", "options"],
  12963. "additionalProperties": false
  12964. }
  12965. ]
  12966. }
  12967. }
  12968. },
  12969. "required": ["type", "label"],
  12970. "additionalProperties": false
  12971. },
  12972. "ProviderAuthAuthorization": {
  12973. "type": "object",
  12974. "properties": {
  12975. "url": {
  12976. "type": "string"
  12977. },
  12978. "method": {
  12979. "type": "string",
  12980. "enum": ["auto", "code"]
  12981. },
  12982. "instructions": {
  12983. "type": "string"
  12984. }
  12985. },
  12986. "required": ["url", "method", "instructions"],
  12987. "additionalProperties": false
  12988. },
  12989. "TextPartInput": {
  12990. "type": "object",
  12991. "properties": {
  12992. "id": {
  12993. "type": "string"
  12994. },
  12995. "type": {
  12996. "type": "string",
  12997. "enum": ["text"]
  12998. },
  12999. "text": {
  13000. "type": "string"
  13001. },
  13002. "synthetic": {
  13003. "type": "boolean"
  13004. },
  13005. "ignored": {
  13006. "type": "boolean"
  13007. },
  13008. "time": {
  13009. "type": "object",
  13010. "properties": {
  13011. "start": {
  13012. "type": "integer",
  13013. "minimum": 0
  13014. },
  13015. "end": {
  13016. "type": "integer",
  13017. "minimum": 0
  13018. }
  13019. },
  13020. "required": ["start"],
  13021. "additionalProperties": false
  13022. },
  13023. "metadata": {
  13024. "type": "object"
  13025. }
  13026. },
  13027. "required": ["type", "text"],
  13028. "additionalProperties": false
  13029. },
  13030. "FilePartInput": {
  13031. "type": "object",
  13032. "properties": {
  13033. "id": {
  13034. "type": "string"
  13035. },
  13036. "type": {
  13037. "type": "string",
  13038. "enum": ["file"]
  13039. },
  13040. "mime": {
  13041. "type": "string"
  13042. },
  13043. "filename": {
  13044. "type": "string"
  13045. },
  13046. "url": {
  13047. "type": "string"
  13048. },
  13049. "source": {
  13050. "$ref": "#/components/schemas/FilePartSource"
  13051. }
  13052. },
  13053. "required": ["type", "mime", "url"],
  13054. "additionalProperties": false
  13055. },
  13056. "AgentPartInput": {
  13057. "type": "object",
  13058. "properties": {
  13059. "id": {
  13060. "type": "string"
  13061. },
  13062. "type": {
  13063. "type": "string",
  13064. "enum": ["agent"]
  13065. },
  13066. "name": {
  13067. "type": "string"
  13068. },
  13069. "source": {
  13070. "type": "object",
  13071. "properties": {
  13072. "value": {
  13073. "type": "string"
  13074. },
  13075. "start": {
  13076. "type": "integer",
  13077. "minimum": 0
  13078. },
  13079. "end": {
  13080. "type": "integer",
  13081. "minimum": 0
  13082. }
  13083. },
  13084. "required": ["value", "start", "end"],
  13085. "additionalProperties": false
  13086. }
  13087. },
  13088. "required": ["type", "name"],
  13089. "additionalProperties": false
  13090. },
  13091. "SubtaskPartInput": {
  13092. "type": "object",
  13093. "properties": {
  13094. "id": {
  13095. "type": "string"
  13096. },
  13097. "type": {
  13098. "type": "string",
  13099. "enum": ["subtask"]
  13100. },
  13101. "prompt": {
  13102. "type": "string"
  13103. },
  13104. "description": {
  13105. "type": "string"
  13106. },
  13107. "agent": {
  13108. "type": "string"
  13109. },
  13110. "model": {
  13111. "type": "object",
  13112. "properties": {
  13113. "providerID": {
  13114. "type": "string"
  13115. },
  13116. "modelID": {
  13117. "type": "string"
  13118. }
  13119. },
  13120. "required": ["providerID", "modelID"],
  13121. "additionalProperties": false
  13122. },
  13123. "command": {
  13124. "type": "string"
  13125. }
  13126. },
  13127. "required": ["type", "prompt", "description", "agent"],
  13128. "additionalProperties": false
  13129. },
  13130. "V2SessionsResponse": {
  13131. "type": "object",
  13132. "properties": {
  13133. "items": {
  13134. "type": "array",
  13135. "items": {
  13136. "$ref": "#/components/schemas/SessionInfo"
  13137. }
  13138. },
  13139. "cursor": {
  13140. "type": "object",
  13141. "properties": {
  13142. "previous": {
  13143. "type": "string"
  13144. },
  13145. "next": {
  13146. "type": "string"
  13147. }
  13148. },
  13149. "additionalProperties": false
  13150. }
  13151. },
  13152. "required": ["items", "cursor"],
  13153. "additionalProperties": false
  13154. },
  13155. "V2SessionMessagesResponse": {
  13156. "type": "object",
  13157. "properties": {
  13158. "items": {
  13159. "type": "array",
  13160. "items": {
  13161. "$ref": "#/components/schemas/SessionMessage"
  13162. }
  13163. },
  13164. "cursor": {
  13165. "type": "object",
  13166. "properties": {
  13167. "previous": {
  13168. "type": "string"
  13169. },
  13170. "next": {
  13171. "type": "string"
  13172. }
  13173. },
  13174. "additionalProperties": false
  13175. }
  13176. },
  13177. "required": ["items", "cursor"],
  13178. "additionalProperties": false
  13179. },
  13180. "EventTuiPromptAppend": {
  13181. "type": "object",
  13182. "properties": {
  13183. "type": {
  13184. "type": "string",
  13185. "enum": ["tui.prompt.append"]
  13186. },
  13187. "properties": {
  13188. "type": "object",
  13189. "properties": {
  13190. "text": {
  13191. "type": "string"
  13192. }
  13193. },
  13194. "required": ["text"],
  13195. "additionalProperties": false
  13196. }
  13197. },
  13198. "required": ["type", "properties"],
  13199. "additionalProperties": false
  13200. },
  13201. "EventTuiCommandExecute": {
  13202. "type": "object",
  13203. "properties": {
  13204. "type": {
  13205. "type": "string",
  13206. "enum": ["tui.command.execute"]
  13207. },
  13208. "properties": {
  13209. "type": "object",
  13210. "properties": {
  13211. "command": {
  13212. "anyOf": [
  13213. {
  13214. "type": "string",
  13215. "enum": [
  13216. "session.list",
  13217. "session.new",
  13218. "session.share",
  13219. "session.interrupt",
  13220. "session.compact",
  13221. "session.page.up",
  13222. "session.page.down",
  13223. "session.line.up",
  13224. "session.line.down",
  13225. "session.half.page.up",
  13226. "session.half.page.down",
  13227. "session.first",
  13228. "session.last",
  13229. "prompt.clear",
  13230. "prompt.submit",
  13231. "agent.cycle"
  13232. ]
  13233. },
  13234. {
  13235. "type": "string"
  13236. }
  13237. ]
  13238. }
  13239. },
  13240. "required": ["command"],
  13241. "additionalProperties": false
  13242. }
  13243. },
  13244. "required": ["type", "properties"],
  13245. "additionalProperties": false
  13246. },
  13247. "EventTuiToastShow": {
  13248. "type": "object",
  13249. "properties": {
  13250. "type": {
  13251. "type": "string",
  13252. "enum": ["tui.toast.show"]
  13253. },
  13254. "properties": {
  13255. "type": "object",
  13256. "properties": {
  13257. "title": {
  13258. "type": "string"
  13259. },
  13260. "message": {
  13261. "type": "string"
  13262. },
  13263. "variant": {
  13264. "type": "string",
  13265. "enum": ["info", "success", "warning", "error"]
  13266. },
  13267. "duration": {
  13268. "type": "integer",
  13269. "exclusiveMinimum": 0
  13270. }
  13271. },
  13272. "required": ["message", "variant"],
  13273. "additionalProperties": false
  13274. }
  13275. },
  13276. "required": ["type", "properties"],
  13277. "additionalProperties": false
  13278. },
  13279. "EventTuiSessionSelect": {
  13280. "type": "object",
  13281. "properties": {
  13282. "type": {
  13283. "type": "string",
  13284. "enum": ["tui.session.select"]
  13285. },
  13286. "properties": {
  13287. "type": "object",
  13288. "properties": {
  13289. "sessionID": {
  13290. "type": "string",
  13291. "description": "Session ID to navigate to"
  13292. }
  13293. },
  13294. "required": ["sessionID"],
  13295. "additionalProperties": false
  13296. }
  13297. },
  13298. "required": ["type", "properties"],
  13299. "additionalProperties": false
  13300. },
  13301. "Workspace": {
  13302. "type": "object",
  13303. "properties": {
  13304. "id": {
  13305. "type": "string"
  13306. },
  13307. "type": {
  13308. "type": "string"
  13309. },
  13310. "name": {
  13311. "type": "string"
  13312. },
  13313. "branch": {
  13314. "anyOf": [
  13315. {
  13316. "type": "string"
  13317. },
  13318. {
  13319. "type": "null"
  13320. }
  13321. ]
  13322. },
  13323. "directory": {
  13324. "anyOf": [
  13325. {
  13326. "type": "string"
  13327. },
  13328. {
  13329. "type": "null"
  13330. }
  13331. ]
  13332. },
  13333. "extra": {
  13334. "anyOf": [
  13335. {},
  13336. {
  13337. "type": "null"
  13338. }
  13339. ]
  13340. },
  13341. "projectID": {
  13342. "type": "string"
  13343. }
  13344. },
  13345. "required": ["id", "type", "name", "branch", "directory", "extra", "projectID"],
  13346. "additionalProperties": false
  13347. },
  13348. "SyncEventMessageUpdated": {
  13349. "type": "object",
  13350. "properties": {
  13351. "type": {
  13352. "type": "string",
  13353. "enum": ["sync"]
  13354. },
  13355. "name": {
  13356. "type": "string",
  13357. "enum": ["message.updated.1"]
  13358. },
  13359. "id": {
  13360. "type": "string"
  13361. },
  13362. "seq": {
  13363. "type": "number"
  13364. },
  13365. "aggregateID": {
  13366. "type": "string",
  13367. "enum": ["sessionID"]
  13368. },
  13369. "data": {
  13370. "type": "object",
  13371. "properties": {
  13372. "sessionID": {
  13373. "type": "string"
  13374. },
  13375. "info": {
  13376. "$ref": "#/components/schemas/Message"
  13377. }
  13378. },
  13379. "required": ["sessionID", "info"],
  13380. "additionalProperties": false
  13381. }
  13382. },
  13383. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  13384. "additionalProperties": false
  13385. },
  13386. "SyncEventMessageRemoved": {
  13387. "type": "object",
  13388. "properties": {
  13389. "type": {
  13390. "type": "string",
  13391. "enum": ["sync"]
  13392. },
  13393. "name": {
  13394. "type": "string",
  13395. "enum": ["message.removed.1"]
  13396. },
  13397. "id": {
  13398. "type": "string"
  13399. },
  13400. "seq": {
  13401. "type": "number"
  13402. },
  13403. "aggregateID": {
  13404. "type": "string",
  13405. "enum": ["sessionID"]
  13406. },
  13407. "data": {
  13408. "type": "object",
  13409. "properties": {
  13410. "sessionID": {
  13411. "type": "string"
  13412. },
  13413. "messageID": {
  13414. "type": "string"
  13415. }
  13416. },
  13417. "required": ["sessionID", "messageID"],
  13418. "additionalProperties": false
  13419. }
  13420. },
  13421. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  13422. "additionalProperties": false
  13423. },
  13424. "SyncEventMessagePartUpdated": {
  13425. "type": "object",
  13426. "properties": {
  13427. "type": {
  13428. "type": "string",
  13429. "enum": ["sync"]
  13430. },
  13431. "name": {
  13432. "type": "string",
  13433. "enum": ["message.part.updated.1"]
  13434. },
  13435. "id": {
  13436. "type": "string"
  13437. },
  13438. "seq": {
  13439. "type": "number"
  13440. },
  13441. "aggregateID": {
  13442. "type": "string",
  13443. "enum": ["sessionID"]
  13444. },
  13445. "data": {
  13446. "type": "object",
  13447. "properties": {
  13448. "sessionID": {
  13449. "type": "string"
  13450. },
  13451. "part": {
  13452. "$ref": "#/components/schemas/Part"
  13453. },
  13454. "time": {
  13455. "type": "integer",
  13456. "minimum": 0
  13457. }
  13458. },
  13459. "required": ["sessionID", "part", "time"],
  13460. "additionalProperties": false
  13461. }
  13462. },
  13463. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  13464. "additionalProperties": false
  13465. },
  13466. "SyncEventMessagePartRemoved": {
  13467. "type": "object",
  13468. "properties": {
  13469. "type": {
  13470. "type": "string",
  13471. "enum": ["sync"]
  13472. },
  13473. "name": {
  13474. "type": "string",
  13475. "enum": ["message.part.removed.1"]
  13476. },
  13477. "id": {
  13478. "type": "string"
  13479. },
  13480. "seq": {
  13481. "type": "number"
  13482. },
  13483. "aggregateID": {
  13484. "type": "string",
  13485. "enum": ["sessionID"]
  13486. },
  13487. "data": {
  13488. "type": "object",
  13489. "properties": {
  13490. "sessionID": {
  13491. "type": "string"
  13492. },
  13493. "messageID": {
  13494. "type": "string"
  13495. },
  13496. "partID": {
  13497. "type": "string"
  13498. }
  13499. },
  13500. "required": ["sessionID", "messageID", "partID"],
  13501. "additionalProperties": false
  13502. }
  13503. },
  13504. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  13505. "additionalProperties": false
  13506. },
  13507. "SyncEventSessionCreated": {
  13508. "type": "object",
  13509. "properties": {
  13510. "type": {
  13511. "type": "string",
  13512. "enum": ["sync"]
  13513. },
  13514. "name": {
  13515. "type": "string",
  13516. "enum": ["session.created.1"]
  13517. },
  13518. "id": {
  13519. "type": "string"
  13520. },
  13521. "seq": {
  13522. "type": "number"
  13523. },
  13524. "aggregateID": {
  13525. "type": "string",
  13526. "enum": ["sessionID"]
  13527. },
  13528. "data": {
  13529. "type": "object",
  13530. "properties": {
  13531. "sessionID": {
  13532. "type": "string"
  13533. },
  13534. "info": {
  13535. "$ref": "#/components/schemas/Session"
  13536. }
  13537. },
  13538. "required": ["sessionID", "info"],
  13539. "additionalProperties": false
  13540. }
  13541. },
  13542. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  13543. "additionalProperties": false
  13544. },
  13545. "SyncEventSessionUpdated": {
  13546. "type": "object",
  13547. "properties": {
  13548. "type": {
  13549. "type": "string",
  13550. "enum": ["sync"]
  13551. },
  13552. "name": {
  13553. "type": "string",
  13554. "enum": ["session.updated.1"]
  13555. },
  13556. "id": {
  13557. "type": "string"
  13558. },
  13559. "seq": {
  13560. "type": "number"
  13561. },
  13562. "aggregateID": {
  13563. "type": "string",
  13564. "enum": ["sessionID"]
  13565. },
  13566. "data": {
  13567. "type": "object",
  13568. "properties": {
  13569. "sessionID": {
  13570. "type": "string"
  13571. },
  13572. "info": {
  13573. "type": "object",
  13574. "properties": {
  13575. "id": {
  13576. "anyOf": [
  13577. {
  13578. "type": "string"
  13579. },
  13580. {
  13581. "type": "null"
  13582. }
  13583. ]
  13584. },
  13585. "slug": {
  13586. "anyOf": [
  13587. {
  13588. "type": "string"
  13589. },
  13590. {
  13591. "type": "null"
  13592. }
  13593. ]
  13594. },
  13595. "projectID": {
  13596. "anyOf": [
  13597. {
  13598. "type": "string"
  13599. },
  13600. {
  13601. "type": "null"
  13602. }
  13603. ]
  13604. },
  13605. "workspaceID": {
  13606. "anyOf": [
  13607. {
  13608. "type": "string"
  13609. },
  13610. {
  13611. "type": "null"
  13612. }
  13613. ]
  13614. },
  13615. "directory": {
  13616. "anyOf": [
  13617. {
  13618. "type": "string"
  13619. },
  13620. {
  13621. "type": "null"
  13622. }
  13623. ]
  13624. },
  13625. "path": {
  13626. "anyOf": [
  13627. {
  13628. "type": "string"
  13629. },
  13630. {
  13631. "type": "null"
  13632. }
  13633. ]
  13634. },
  13635. "parentID": {
  13636. "anyOf": [
  13637. {
  13638. "type": "string"
  13639. },
  13640. {
  13641. "type": "null"
  13642. }
  13643. ]
  13644. },
  13645. "summary": {
  13646. "anyOf": [
  13647. {
  13648. "type": "object",
  13649. "properties": {
  13650. "additions": {
  13651. "type": "integer",
  13652. "minimum": 0
  13653. },
  13654. "deletions": {
  13655. "type": "integer",
  13656. "minimum": 0
  13657. },
  13658. "files": {
  13659. "type": "integer",
  13660. "minimum": 0
  13661. },
  13662. "diffs": {
  13663. "type": "array",
  13664. "items": {
  13665. "$ref": "#/components/schemas/SnapshotFileDiff"
  13666. }
  13667. }
  13668. },
  13669. "required": ["additions", "deletions", "files"],
  13670. "additionalProperties": false
  13671. },
  13672. {
  13673. "type": "null"
  13674. }
  13675. ]
  13676. },
  13677. "share": {
  13678. "type": "object",
  13679. "properties": {
  13680. "url": {
  13681. "anyOf": [
  13682. {
  13683. "type": "string"
  13684. },
  13685. {
  13686. "type": "null"
  13687. }
  13688. ]
  13689. }
  13690. },
  13691. "additionalProperties": false
  13692. },
  13693. "title": {
  13694. "anyOf": [
  13695. {
  13696. "type": "string"
  13697. },
  13698. {
  13699. "type": "null"
  13700. }
  13701. ]
  13702. },
  13703. "agent": {
  13704. "anyOf": [
  13705. {
  13706. "type": "string"
  13707. },
  13708. {
  13709. "type": "null"
  13710. }
  13711. ]
  13712. },
  13713. "model": {
  13714. "anyOf": [
  13715. {
  13716. "type": "object",
  13717. "properties": {
  13718. "id": {
  13719. "type": "string"
  13720. },
  13721. "providerID": {
  13722. "type": "string"
  13723. },
  13724. "variant": {
  13725. "type": "string"
  13726. }
  13727. },
  13728. "required": ["id", "providerID"],
  13729. "additionalProperties": false
  13730. },
  13731. {
  13732. "type": "null"
  13733. }
  13734. ]
  13735. },
  13736. "version": {
  13737. "anyOf": [
  13738. {
  13739. "type": "string"
  13740. },
  13741. {
  13742. "type": "null"
  13743. }
  13744. ]
  13745. },
  13746. "time": {
  13747. "type": "object",
  13748. "properties": {
  13749. "created": {
  13750. "anyOf": [
  13751. {
  13752. "type": "integer",
  13753. "minimum": 0
  13754. },
  13755. {
  13756. "type": "null"
  13757. }
  13758. ]
  13759. },
  13760. "updated": {
  13761. "anyOf": [
  13762. {
  13763. "type": "integer",
  13764. "minimum": 0
  13765. },
  13766. {
  13767. "type": "null"
  13768. }
  13769. ]
  13770. },
  13771. "compacting": {
  13772. "anyOf": [
  13773. {
  13774. "type": "integer",
  13775. "minimum": 0
  13776. },
  13777. {
  13778. "type": "null"
  13779. }
  13780. ]
  13781. },
  13782. "archived": {
  13783. "anyOf": [
  13784. {
  13785. "type": "number"
  13786. },
  13787. {
  13788. "type": "null"
  13789. }
  13790. ]
  13791. }
  13792. },
  13793. "additionalProperties": false
  13794. },
  13795. "permission": {
  13796. "anyOf": [
  13797. {
  13798. "$ref": "#/components/schemas/PermissionRuleset"
  13799. },
  13800. {
  13801. "type": "null"
  13802. }
  13803. ]
  13804. },
  13805. "revert": {
  13806. "anyOf": [
  13807. {
  13808. "type": "object",
  13809. "properties": {
  13810. "messageID": {
  13811. "type": "string"
  13812. },
  13813. "partID": {
  13814. "type": "string"
  13815. },
  13816. "snapshot": {
  13817. "type": "string"
  13818. },
  13819. "diff": {
  13820. "type": "string"
  13821. }
  13822. },
  13823. "required": ["messageID"],
  13824. "additionalProperties": false
  13825. },
  13826. {
  13827. "type": "null"
  13828. }
  13829. ]
  13830. }
  13831. },
  13832. "additionalProperties": false
  13833. }
  13834. },
  13835. "required": ["sessionID", "info"],
  13836. "additionalProperties": false
  13837. }
  13838. },
  13839. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  13840. "additionalProperties": false
  13841. },
  13842. "SyncEventSessionDeleted": {
  13843. "type": "object",
  13844. "properties": {
  13845. "type": {
  13846. "type": "string",
  13847. "enum": ["sync"]
  13848. },
  13849. "name": {
  13850. "type": "string",
  13851. "enum": ["session.deleted.1"]
  13852. },
  13853. "id": {
  13854. "type": "string"
  13855. },
  13856. "seq": {
  13857. "type": "number"
  13858. },
  13859. "aggregateID": {
  13860. "type": "string",
  13861. "enum": ["sessionID"]
  13862. },
  13863. "data": {
  13864. "type": "object",
  13865. "properties": {
  13866. "sessionID": {
  13867. "type": "string"
  13868. },
  13869. "info": {
  13870. "$ref": "#/components/schemas/Session"
  13871. }
  13872. },
  13873. "required": ["sessionID", "info"],
  13874. "additionalProperties": false
  13875. }
  13876. },
  13877. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  13878. "additionalProperties": false
  13879. },
  13880. "SyncEventSessionNextAgentSwitched": {
  13881. "type": "object",
  13882. "properties": {
  13883. "type": {
  13884. "type": "string",
  13885. "enum": ["sync"]
  13886. },
  13887. "name": {
  13888. "type": "string",
  13889. "enum": ["session.next.agent.switched.1"]
  13890. },
  13891. "id": {
  13892. "type": "string"
  13893. },
  13894. "seq": {
  13895. "type": "number"
  13896. },
  13897. "aggregateID": {
  13898. "type": "string",
  13899. "enum": ["sessionID"]
  13900. },
  13901. "data": {
  13902. "type": "object",
  13903. "properties": {
  13904. "timestamp": {
  13905. "type": "number"
  13906. },
  13907. "sessionID": {
  13908. "type": "string"
  13909. },
  13910. "agent": {
  13911. "type": "string"
  13912. }
  13913. },
  13914. "required": ["timestamp", "sessionID", "agent"],
  13915. "additionalProperties": false
  13916. }
  13917. },
  13918. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  13919. "additionalProperties": false
  13920. },
  13921. "SyncEventSessionNextModelSwitched": {
  13922. "type": "object",
  13923. "properties": {
  13924. "type": {
  13925. "type": "string",
  13926. "enum": ["sync"]
  13927. },
  13928. "name": {
  13929. "type": "string",
  13930. "enum": ["session.next.model.switched.1"]
  13931. },
  13932. "id": {
  13933. "type": "string"
  13934. },
  13935. "seq": {
  13936. "type": "number"
  13937. },
  13938. "aggregateID": {
  13939. "type": "string",
  13940. "enum": ["sessionID"]
  13941. },
  13942. "data": {
  13943. "type": "object",
  13944. "properties": {
  13945. "timestamp": {
  13946. "type": "number"
  13947. },
  13948. "sessionID": {
  13949. "type": "string"
  13950. },
  13951. "id": {
  13952. "type": "string"
  13953. },
  13954. "providerID": {
  13955. "type": "string"
  13956. },
  13957. "variant": {
  13958. "type": "string"
  13959. }
  13960. },
  13961. "required": ["timestamp", "sessionID", "id", "providerID"],
  13962. "additionalProperties": false
  13963. }
  13964. },
  13965. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  13966. "additionalProperties": false
  13967. },
  13968. "SyncEventSessionNextPrompted": {
  13969. "type": "object",
  13970. "properties": {
  13971. "type": {
  13972. "type": "string",
  13973. "enum": ["sync"]
  13974. },
  13975. "name": {
  13976. "type": "string",
  13977. "enum": ["session.next.prompted.1"]
  13978. },
  13979. "id": {
  13980. "type": "string"
  13981. },
  13982. "seq": {
  13983. "type": "number"
  13984. },
  13985. "aggregateID": {
  13986. "type": "string",
  13987. "enum": ["sessionID"]
  13988. },
  13989. "data": {
  13990. "type": "object",
  13991. "properties": {
  13992. "timestamp": {
  13993. "type": "number"
  13994. },
  13995. "sessionID": {
  13996. "type": "string"
  13997. },
  13998. "prompt": {
  13999. "$ref": "#/components/schemas/Prompt"
  14000. }
  14001. },
  14002. "required": ["timestamp", "sessionID", "prompt"],
  14003. "additionalProperties": false
  14004. }
  14005. },
  14006. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14007. "additionalProperties": false
  14008. },
  14009. "SyncEventSessionNextSynthetic": {
  14010. "type": "object",
  14011. "properties": {
  14012. "type": {
  14013. "type": "string",
  14014. "enum": ["sync"]
  14015. },
  14016. "name": {
  14017. "type": "string",
  14018. "enum": ["session.next.synthetic.1"]
  14019. },
  14020. "id": {
  14021. "type": "string"
  14022. },
  14023. "seq": {
  14024. "type": "number"
  14025. },
  14026. "aggregateID": {
  14027. "type": "string",
  14028. "enum": ["sessionID"]
  14029. },
  14030. "data": {
  14031. "type": "object",
  14032. "properties": {
  14033. "timestamp": {
  14034. "type": "number"
  14035. },
  14036. "sessionID": {
  14037. "type": "string"
  14038. },
  14039. "text": {
  14040. "type": "string"
  14041. }
  14042. },
  14043. "required": ["timestamp", "sessionID", "text"],
  14044. "additionalProperties": false
  14045. }
  14046. },
  14047. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14048. "additionalProperties": false
  14049. },
  14050. "SyncEventSessionNextShellStarted": {
  14051. "type": "object",
  14052. "properties": {
  14053. "type": {
  14054. "type": "string",
  14055. "enum": ["sync"]
  14056. },
  14057. "name": {
  14058. "type": "string",
  14059. "enum": ["session.next.shell.started.1"]
  14060. },
  14061. "id": {
  14062. "type": "string"
  14063. },
  14064. "seq": {
  14065. "type": "number"
  14066. },
  14067. "aggregateID": {
  14068. "type": "string",
  14069. "enum": ["sessionID"]
  14070. },
  14071. "data": {
  14072. "type": "object",
  14073. "properties": {
  14074. "timestamp": {
  14075. "type": "number"
  14076. },
  14077. "sessionID": {
  14078. "type": "string"
  14079. },
  14080. "callID": {
  14081. "type": "string"
  14082. },
  14083. "command": {
  14084. "type": "string"
  14085. }
  14086. },
  14087. "required": ["timestamp", "sessionID", "callID", "command"],
  14088. "additionalProperties": false
  14089. }
  14090. },
  14091. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14092. "additionalProperties": false
  14093. },
  14094. "SyncEventSessionNextShellEnded": {
  14095. "type": "object",
  14096. "properties": {
  14097. "type": {
  14098. "type": "string",
  14099. "enum": ["sync"]
  14100. },
  14101. "name": {
  14102. "type": "string",
  14103. "enum": ["session.next.shell.ended.1"]
  14104. },
  14105. "id": {
  14106. "type": "string"
  14107. },
  14108. "seq": {
  14109. "type": "number"
  14110. },
  14111. "aggregateID": {
  14112. "type": "string",
  14113. "enum": ["sessionID"]
  14114. },
  14115. "data": {
  14116. "type": "object",
  14117. "properties": {
  14118. "timestamp": {
  14119. "type": "number"
  14120. },
  14121. "sessionID": {
  14122. "type": "string"
  14123. },
  14124. "callID": {
  14125. "type": "string"
  14126. },
  14127. "output": {
  14128. "type": "string"
  14129. }
  14130. },
  14131. "required": ["timestamp", "sessionID", "callID", "output"],
  14132. "additionalProperties": false
  14133. }
  14134. },
  14135. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14136. "additionalProperties": false
  14137. },
  14138. "SyncEventSessionNextStepStarted": {
  14139. "type": "object",
  14140. "properties": {
  14141. "type": {
  14142. "type": "string",
  14143. "enum": ["sync"]
  14144. },
  14145. "name": {
  14146. "type": "string",
  14147. "enum": ["session.next.step.started.1"]
  14148. },
  14149. "id": {
  14150. "type": "string"
  14151. },
  14152. "seq": {
  14153. "type": "number"
  14154. },
  14155. "aggregateID": {
  14156. "type": "string",
  14157. "enum": ["sessionID"]
  14158. },
  14159. "data": {
  14160. "type": "object",
  14161. "properties": {
  14162. "timestamp": {
  14163. "type": "number"
  14164. },
  14165. "sessionID": {
  14166. "type": "string"
  14167. },
  14168. "agent": {
  14169. "type": "string"
  14170. },
  14171. "model": {
  14172. "type": "object",
  14173. "properties": {
  14174. "id": {
  14175. "type": "string"
  14176. },
  14177. "providerID": {
  14178. "type": "string"
  14179. },
  14180. "variant": {
  14181. "type": "string"
  14182. }
  14183. },
  14184. "required": ["id", "providerID"],
  14185. "additionalProperties": false
  14186. },
  14187. "snapshot": {
  14188. "type": "string"
  14189. }
  14190. },
  14191. "required": ["timestamp", "sessionID", "agent", "model"],
  14192. "additionalProperties": false
  14193. }
  14194. },
  14195. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14196. "additionalProperties": false
  14197. },
  14198. "SyncEventSessionNextStepEnded": {
  14199. "type": "object",
  14200. "properties": {
  14201. "type": {
  14202. "type": "string",
  14203. "enum": ["sync"]
  14204. },
  14205. "name": {
  14206. "type": "string",
  14207. "enum": ["session.next.step.ended.1"]
  14208. },
  14209. "id": {
  14210. "type": "string"
  14211. },
  14212. "seq": {
  14213. "type": "number"
  14214. },
  14215. "aggregateID": {
  14216. "type": "string",
  14217. "enum": ["sessionID"]
  14218. },
  14219. "data": {
  14220. "type": "object",
  14221. "properties": {
  14222. "timestamp": {
  14223. "type": "number"
  14224. },
  14225. "sessionID": {
  14226. "type": "string"
  14227. },
  14228. "finish": {
  14229. "type": "string"
  14230. },
  14231. "cost": {
  14232. "type": "number"
  14233. },
  14234. "tokens": {
  14235. "type": "object",
  14236. "properties": {
  14237. "input": {
  14238. "type": "integer",
  14239. "minimum": 0
  14240. },
  14241. "output": {
  14242. "type": "integer",
  14243. "minimum": 0
  14244. },
  14245. "reasoning": {
  14246. "type": "integer",
  14247. "minimum": 0
  14248. },
  14249. "cache": {
  14250. "type": "object",
  14251. "properties": {
  14252. "read": {
  14253. "type": "integer",
  14254. "minimum": 0
  14255. },
  14256. "write": {
  14257. "type": "integer",
  14258. "minimum": 0
  14259. }
  14260. },
  14261. "required": ["read", "write"],
  14262. "additionalProperties": false
  14263. }
  14264. },
  14265. "required": ["input", "output", "reasoning", "cache"],
  14266. "additionalProperties": false
  14267. },
  14268. "snapshot": {
  14269. "type": "string"
  14270. }
  14271. },
  14272. "required": ["timestamp", "sessionID", "finish", "cost", "tokens"],
  14273. "additionalProperties": false
  14274. }
  14275. },
  14276. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14277. "additionalProperties": false
  14278. },
  14279. "SyncEventSessionNextStepFailed": {
  14280. "type": "object",
  14281. "properties": {
  14282. "type": {
  14283. "type": "string",
  14284. "enum": ["sync"]
  14285. },
  14286. "name": {
  14287. "type": "string",
  14288. "enum": ["session.next.step.failed.1"]
  14289. },
  14290. "id": {
  14291. "type": "string"
  14292. },
  14293. "seq": {
  14294. "type": "number"
  14295. },
  14296. "aggregateID": {
  14297. "type": "string",
  14298. "enum": ["sessionID"]
  14299. },
  14300. "data": {
  14301. "type": "object",
  14302. "properties": {
  14303. "timestamp": {
  14304. "type": "number"
  14305. },
  14306. "sessionID": {
  14307. "type": "string"
  14308. },
  14309. "error": {
  14310. "type": "object",
  14311. "properties": {
  14312. "type": {
  14313. "type": "string"
  14314. },
  14315. "message": {
  14316. "type": "string"
  14317. }
  14318. },
  14319. "required": ["type", "message"],
  14320. "additionalProperties": false
  14321. }
  14322. },
  14323. "required": ["timestamp", "sessionID", "error"],
  14324. "additionalProperties": false
  14325. }
  14326. },
  14327. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14328. "additionalProperties": false
  14329. },
  14330. "SyncEventSessionNextTextStarted": {
  14331. "type": "object",
  14332. "properties": {
  14333. "type": {
  14334. "type": "string",
  14335. "enum": ["sync"]
  14336. },
  14337. "name": {
  14338. "type": "string",
  14339. "enum": ["session.next.text.started.1"]
  14340. },
  14341. "id": {
  14342. "type": "string"
  14343. },
  14344. "seq": {
  14345. "type": "number"
  14346. },
  14347. "aggregateID": {
  14348. "type": "string",
  14349. "enum": ["sessionID"]
  14350. },
  14351. "data": {
  14352. "type": "object",
  14353. "properties": {
  14354. "timestamp": {
  14355. "type": "number"
  14356. },
  14357. "sessionID": {
  14358. "type": "string"
  14359. }
  14360. },
  14361. "required": ["timestamp", "sessionID"],
  14362. "additionalProperties": false
  14363. }
  14364. },
  14365. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14366. "additionalProperties": false
  14367. },
  14368. "SyncEventSessionNextTextDelta": {
  14369. "type": "object",
  14370. "properties": {
  14371. "type": {
  14372. "type": "string",
  14373. "enum": ["sync"]
  14374. },
  14375. "name": {
  14376. "type": "string",
  14377. "enum": ["session.next.text.delta.1"]
  14378. },
  14379. "id": {
  14380. "type": "string"
  14381. },
  14382. "seq": {
  14383. "type": "number"
  14384. },
  14385. "aggregateID": {
  14386. "type": "string",
  14387. "enum": ["sessionID"]
  14388. },
  14389. "data": {
  14390. "type": "object",
  14391. "properties": {
  14392. "timestamp": {
  14393. "type": "number"
  14394. },
  14395. "sessionID": {
  14396. "type": "string"
  14397. },
  14398. "delta": {
  14399. "type": "string"
  14400. }
  14401. },
  14402. "required": ["timestamp", "sessionID", "delta"],
  14403. "additionalProperties": false
  14404. }
  14405. },
  14406. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14407. "additionalProperties": false
  14408. },
  14409. "SyncEventSessionNextTextEnded": {
  14410. "type": "object",
  14411. "properties": {
  14412. "type": {
  14413. "type": "string",
  14414. "enum": ["sync"]
  14415. },
  14416. "name": {
  14417. "type": "string",
  14418. "enum": ["session.next.text.ended.1"]
  14419. },
  14420. "id": {
  14421. "type": "string"
  14422. },
  14423. "seq": {
  14424. "type": "number"
  14425. },
  14426. "aggregateID": {
  14427. "type": "string",
  14428. "enum": ["sessionID"]
  14429. },
  14430. "data": {
  14431. "type": "object",
  14432. "properties": {
  14433. "timestamp": {
  14434. "type": "number"
  14435. },
  14436. "sessionID": {
  14437. "type": "string"
  14438. },
  14439. "text": {
  14440. "type": "string"
  14441. }
  14442. },
  14443. "required": ["timestamp", "sessionID", "text"],
  14444. "additionalProperties": false
  14445. }
  14446. },
  14447. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14448. "additionalProperties": false
  14449. },
  14450. "SyncEventSessionNextReasoningStarted": {
  14451. "type": "object",
  14452. "properties": {
  14453. "type": {
  14454. "type": "string",
  14455. "enum": ["sync"]
  14456. },
  14457. "name": {
  14458. "type": "string",
  14459. "enum": ["session.next.reasoning.started.1"]
  14460. },
  14461. "id": {
  14462. "type": "string"
  14463. },
  14464. "seq": {
  14465. "type": "number"
  14466. },
  14467. "aggregateID": {
  14468. "type": "string",
  14469. "enum": ["sessionID"]
  14470. },
  14471. "data": {
  14472. "type": "object",
  14473. "properties": {
  14474. "timestamp": {
  14475. "type": "number"
  14476. },
  14477. "sessionID": {
  14478. "type": "string"
  14479. },
  14480. "reasoningID": {
  14481. "type": "string"
  14482. }
  14483. },
  14484. "required": ["timestamp", "sessionID", "reasoningID"],
  14485. "additionalProperties": false
  14486. }
  14487. },
  14488. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14489. "additionalProperties": false
  14490. },
  14491. "SyncEventSessionNextReasoningDelta": {
  14492. "type": "object",
  14493. "properties": {
  14494. "type": {
  14495. "type": "string",
  14496. "enum": ["sync"]
  14497. },
  14498. "name": {
  14499. "type": "string",
  14500. "enum": ["session.next.reasoning.delta.1"]
  14501. },
  14502. "id": {
  14503. "type": "string"
  14504. },
  14505. "seq": {
  14506. "type": "number"
  14507. },
  14508. "aggregateID": {
  14509. "type": "string",
  14510. "enum": ["sessionID"]
  14511. },
  14512. "data": {
  14513. "type": "object",
  14514. "properties": {
  14515. "timestamp": {
  14516. "type": "number"
  14517. },
  14518. "sessionID": {
  14519. "type": "string"
  14520. },
  14521. "reasoningID": {
  14522. "type": "string"
  14523. },
  14524. "delta": {
  14525. "type": "string"
  14526. }
  14527. },
  14528. "required": ["timestamp", "sessionID", "reasoningID", "delta"],
  14529. "additionalProperties": false
  14530. }
  14531. },
  14532. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14533. "additionalProperties": false
  14534. },
  14535. "SyncEventSessionNextReasoningEnded": {
  14536. "type": "object",
  14537. "properties": {
  14538. "type": {
  14539. "type": "string",
  14540. "enum": ["sync"]
  14541. },
  14542. "name": {
  14543. "type": "string",
  14544. "enum": ["session.next.reasoning.ended.1"]
  14545. },
  14546. "id": {
  14547. "type": "string"
  14548. },
  14549. "seq": {
  14550. "type": "number"
  14551. },
  14552. "aggregateID": {
  14553. "type": "string",
  14554. "enum": ["sessionID"]
  14555. },
  14556. "data": {
  14557. "type": "object",
  14558. "properties": {
  14559. "timestamp": {
  14560. "type": "number"
  14561. },
  14562. "sessionID": {
  14563. "type": "string"
  14564. },
  14565. "reasoningID": {
  14566. "type": "string"
  14567. },
  14568. "text": {
  14569. "type": "string"
  14570. }
  14571. },
  14572. "required": ["timestamp", "sessionID", "reasoningID", "text"],
  14573. "additionalProperties": false
  14574. }
  14575. },
  14576. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14577. "additionalProperties": false
  14578. },
  14579. "SyncEventSessionNextToolInputStarted": {
  14580. "type": "object",
  14581. "properties": {
  14582. "type": {
  14583. "type": "string",
  14584. "enum": ["sync"]
  14585. },
  14586. "name": {
  14587. "type": "string",
  14588. "enum": ["session.next.tool.input.started.1"]
  14589. },
  14590. "id": {
  14591. "type": "string"
  14592. },
  14593. "seq": {
  14594. "type": "number"
  14595. },
  14596. "aggregateID": {
  14597. "type": "string",
  14598. "enum": ["sessionID"]
  14599. },
  14600. "data": {
  14601. "type": "object",
  14602. "properties": {
  14603. "timestamp": {
  14604. "type": "number"
  14605. },
  14606. "sessionID": {
  14607. "type": "string"
  14608. },
  14609. "callID": {
  14610. "type": "string"
  14611. },
  14612. "name": {
  14613. "type": "string"
  14614. }
  14615. },
  14616. "required": ["timestamp", "sessionID", "callID", "name"],
  14617. "additionalProperties": false
  14618. }
  14619. },
  14620. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14621. "additionalProperties": false
  14622. },
  14623. "SyncEventSessionNextToolInputDelta": {
  14624. "type": "object",
  14625. "properties": {
  14626. "type": {
  14627. "type": "string",
  14628. "enum": ["sync"]
  14629. },
  14630. "name": {
  14631. "type": "string",
  14632. "enum": ["session.next.tool.input.delta.1"]
  14633. },
  14634. "id": {
  14635. "type": "string"
  14636. },
  14637. "seq": {
  14638. "type": "number"
  14639. },
  14640. "aggregateID": {
  14641. "type": "string",
  14642. "enum": ["sessionID"]
  14643. },
  14644. "data": {
  14645. "type": "object",
  14646. "properties": {
  14647. "timestamp": {
  14648. "type": "number"
  14649. },
  14650. "sessionID": {
  14651. "type": "string"
  14652. },
  14653. "callID": {
  14654. "type": "string"
  14655. },
  14656. "delta": {
  14657. "type": "string"
  14658. }
  14659. },
  14660. "required": ["timestamp", "sessionID", "callID", "delta"],
  14661. "additionalProperties": false
  14662. }
  14663. },
  14664. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14665. "additionalProperties": false
  14666. },
  14667. "SyncEventSessionNextToolInputEnded": {
  14668. "type": "object",
  14669. "properties": {
  14670. "type": {
  14671. "type": "string",
  14672. "enum": ["sync"]
  14673. },
  14674. "name": {
  14675. "type": "string",
  14676. "enum": ["session.next.tool.input.ended.1"]
  14677. },
  14678. "id": {
  14679. "type": "string"
  14680. },
  14681. "seq": {
  14682. "type": "number"
  14683. },
  14684. "aggregateID": {
  14685. "type": "string",
  14686. "enum": ["sessionID"]
  14687. },
  14688. "data": {
  14689. "type": "object",
  14690. "properties": {
  14691. "timestamp": {
  14692. "type": "number"
  14693. },
  14694. "sessionID": {
  14695. "type": "string"
  14696. },
  14697. "callID": {
  14698. "type": "string"
  14699. },
  14700. "text": {
  14701. "type": "string"
  14702. }
  14703. },
  14704. "required": ["timestamp", "sessionID", "callID", "text"],
  14705. "additionalProperties": false
  14706. }
  14707. },
  14708. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14709. "additionalProperties": false
  14710. },
  14711. "SyncEventSessionNextToolCalled": {
  14712. "type": "object",
  14713. "properties": {
  14714. "type": {
  14715. "type": "string",
  14716. "enum": ["sync"]
  14717. },
  14718. "name": {
  14719. "type": "string",
  14720. "enum": ["session.next.tool.called.1"]
  14721. },
  14722. "id": {
  14723. "type": "string"
  14724. },
  14725. "seq": {
  14726. "type": "number"
  14727. },
  14728. "aggregateID": {
  14729. "type": "string",
  14730. "enum": ["sessionID"]
  14731. },
  14732. "data": {
  14733. "type": "object",
  14734. "properties": {
  14735. "timestamp": {
  14736. "type": "number"
  14737. },
  14738. "sessionID": {
  14739. "type": "string"
  14740. },
  14741. "callID": {
  14742. "type": "string"
  14743. },
  14744. "tool": {
  14745. "type": "string"
  14746. },
  14747. "input": {
  14748. "type": "object"
  14749. },
  14750. "provider": {
  14751. "type": "object",
  14752. "properties": {
  14753. "executed": {
  14754. "type": "boolean"
  14755. },
  14756. "metadata": {
  14757. "type": "object"
  14758. }
  14759. },
  14760. "required": ["executed"],
  14761. "additionalProperties": false
  14762. }
  14763. },
  14764. "required": ["timestamp", "sessionID", "callID", "tool", "input", "provider"],
  14765. "additionalProperties": false
  14766. }
  14767. },
  14768. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14769. "additionalProperties": false
  14770. },
  14771. "SyncEventSessionNextToolProgress": {
  14772. "type": "object",
  14773. "properties": {
  14774. "type": {
  14775. "type": "string",
  14776. "enum": ["sync"]
  14777. },
  14778. "name": {
  14779. "type": "string",
  14780. "enum": ["session.next.tool.progress.1"]
  14781. },
  14782. "id": {
  14783. "type": "string"
  14784. },
  14785. "seq": {
  14786. "type": "number"
  14787. },
  14788. "aggregateID": {
  14789. "type": "string",
  14790. "enum": ["sessionID"]
  14791. },
  14792. "data": {
  14793. "type": "object",
  14794. "properties": {
  14795. "timestamp": {
  14796. "type": "number"
  14797. },
  14798. "sessionID": {
  14799. "type": "string"
  14800. },
  14801. "callID": {
  14802. "type": "string"
  14803. },
  14804. "structured": {
  14805. "type": "object"
  14806. },
  14807. "content": {
  14808. "type": "array",
  14809. "items": {
  14810. "anyOf": [
  14811. {
  14812. "$ref": "#/components/schemas/ToolTextContent"
  14813. },
  14814. {
  14815. "$ref": "#/components/schemas/ToolFileContent"
  14816. }
  14817. ]
  14818. }
  14819. }
  14820. },
  14821. "required": ["timestamp", "sessionID", "callID", "structured", "content"],
  14822. "additionalProperties": false
  14823. }
  14824. },
  14825. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14826. "additionalProperties": false
  14827. },
  14828. "SyncEventSessionNextToolSuccess": {
  14829. "type": "object",
  14830. "properties": {
  14831. "type": {
  14832. "type": "string",
  14833. "enum": ["sync"]
  14834. },
  14835. "name": {
  14836. "type": "string",
  14837. "enum": ["session.next.tool.success.1"]
  14838. },
  14839. "id": {
  14840. "type": "string"
  14841. },
  14842. "seq": {
  14843. "type": "number"
  14844. },
  14845. "aggregateID": {
  14846. "type": "string",
  14847. "enum": ["sessionID"]
  14848. },
  14849. "data": {
  14850. "type": "object",
  14851. "properties": {
  14852. "timestamp": {
  14853. "type": "number"
  14854. },
  14855. "sessionID": {
  14856. "type": "string"
  14857. },
  14858. "callID": {
  14859. "type": "string"
  14860. },
  14861. "structured": {
  14862. "type": "object"
  14863. },
  14864. "content": {
  14865. "type": "array",
  14866. "items": {
  14867. "anyOf": [
  14868. {
  14869. "$ref": "#/components/schemas/ToolTextContent"
  14870. },
  14871. {
  14872. "$ref": "#/components/schemas/ToolFileContent"
  14873. }
  14874. ]
  14875. }
  14876. },
  14877. "provider": {
  14878. "type": "object",
  14879. "properties": {
  14880. "executed": {
  14881. "type": "boolean"
  14882. },
  14883. "metadata": {
  14884. "type": "object"
  14885. }
  14886. },
  14887. "required": ["executed"],
  14888. "additionalProperties": false
  14889. }
  14890. },
  14891. "required": ["timestamp", "sessionID", "callID", "structured", "content", "provider"],
  14892. "additionalProperties": false
  14893. }
  14894. },
  14895. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14896. "additionalProperties": false
  14897. },
  14898. "SyncEventSessionNextToolFailed": {
  14899. "type": "object",
  14900. "properties": {
  14901. "type": {
  14902. "type": "string",
  14903. "enum": ["sync"]
  14904. },
  14905. "name": {
  14906. "type": "string",
  14907. "enum": ["session.next.tool.failed.1"]
  14908. },
  14909. "id": {
  14910. "type": "string"
  14911. },
  14912. "seq": {
  14913. "type": "number"
  14914. },
  14915. "aggregateID": {
  14916. "type": "string",
  14917. "enum": ["sessionID"]
  14918. },
  14919. "data": {
  14920. "type": "object",
  14921. "properties": {
  14922. "timestamp": {
  14923. "type": "number"
  14924. },
  14925. "sessionID": {
  14926. "type": "string"
  14927. },
  14928. "callID": {
  14929. "type": "string"
  14930. },
  14931. "error": {
  14932. "type": "object",
  14933. "properties": {
  14934. "type": {
  14935. "type": "string"
  14936. },
  14937. "message": {
  14938. "type": "string"
  14939. }
  14940. },
  14941. "required": ["type", "message"],
  14942. "additionalProperties": false
  14943. },
  14944. "provider": {
  14945. "type": "object",
  14946. "properties": {
  14947. "executed": {
  14948. "type": "boolean"
  14949. },
  14950. "metadata": {
  14951. "type": "object"
  14952. }
  14953. },
  14954. "required": ["executed"],
  14955. "additionalProperties": false
  14956. }
  14957. },
  14958. "required": ["timestamp", "sessionID", "callID", "error", "provider"],
  14959. "additionalProperties": false
  14960. }
  14961. },
  14962. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14963. "additionalProperties": false
  14964. },
  14965. "SyncEventSessionNextRetried": {
  14966. "type": "object",
  14967. "properties": {
  14968. "type": {
  14969. "type": "string",
  14970. "enum": ["sync"]
  14971. },
  14972. "name": {
  14973. "type": "string",
  14974. "enum": ["session.next.retried.1"]
  14975. },
  14976. "id": {
  14977. "type": "string"
  14978. },
  14979. "seq": {
  14980. "type": "number"
  14981. },
  14982. "aggregateID": {
  14983. "type": "string",
  14984. "enum": ["sessionID"]
  14985. },
  14986. "data": {
  14987. "type": "object",
  14988. "properties": {
  14989. "timestamp": {
  14990. "type": "number"
  14991. },
  14992. "sessionID": {
  14993. "type": "string"
  14994. },
  14995. "attempt": {
  14996. "type": "integer",
  14997. "minimum": 0
  14998. },
  14999. "error": {
  15000. "$ref": "#/components/schemas/SessionNextRetry_error"
  15001. }
  15002. },
  15003. "required": ["timestamp", "sessionID", "attempt", "error"],
  15004. "additionalProperties": false
  15005. }
  15006. },
  15007. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15008. "additionalProperties": false
  15009. },
  15010. "SyncEventSessionNextCompactionStarted": {
  15011. "type": "object",
  15012. "properties": {
  15013. "type": {
  15014. "type": "string",
  15015. "enum": ["sync"]
  15016. },
  15017. "name": {
  15018. "type": "string",
  15019. "enum": ["session.next.compaction.started.1"]
  15020. },
  15021. "id": {
  15022. "type": "string"
  15023. },
  15024. "seq": {
  15025. "type": "number"
  15026. },
  15027. "aggregateID": {
  15028. "type": "string",
  15029. "enum": ["sessionID"]
  15030. },
  15031. "data": {
  15032. "type": "object",
  15033. "properties": {
  15034. "timestamp": {
  15035. "type": "number"
  15036. },
  15037. "sessionID": {
  15038. "type": "string"
  15039. },
  15040. "reason": {
  15041. "type": "string",
  15042. "enum": ["auto", "manual"]
  15043. }
  15044. },
  15045. "required": ["timestamp", "sessionID", "reason"],
  15046. "additionalProperties": false
  15047. }
  15048. },
  15049. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15050. "additionalProperties": false
  15051. },
  15052. "SyncEventSessionNextCompactionDelta": {
  15053. "type": "object",
  15054. "properties": {
  15055. "type": {
  15056. "type": "string",
  15057. "enum": ["sync"]
  15058. },
  15059. "name": {
  15060. "type": "string",
  15061. "enum": ["session.next.compaction.delta.1"]
  15062. },
  15063. "id": {
  15064. "type": "string"
  15065. },
  15066. "seq": {
  15067. "type": "number"
  15068. },
  15069. "aggregateID": {
  15070. "type": "string",
  15071. "enum": ["sessionID"]
  15072. },
  15073. "data": {
  15074. "type": "object",
  15075. "properties": {
  15076. "timestamp": {
  15077. "type": "number"
  15078. },
  15079. "sessionID": {
  15080. "type": "string"
  15081. },
  15082. "text": {
  15083. "type": "string"
  15084. }
  15085. },
  15086. "required": ["timestamp", "sessionID", "text"],
  15087. "additionalProperties": false
  15088. }
  15089. },
  15090. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15091. "additionalProperties": false
  15092. },
  15093. "SyncEventSessionNextCompactionEnded": {
  15094. "type": "object",
  15095. "properties": {
  15096. "type": {
  15097. "type": "string",
  15098. "enum": ["sync"]
  15099. },
  15100. "name": {
  15101. "type": "string",
  15102. "enum": ["session.next.compaction.ended.1"]
  15103. },
  15104. "id": {
  15105. "type": "string"
  15106. },
  15107. "seq": {
  15108. "type": "number"
  15109. },
  15110. "aggregateID": {
  15111. "type": "string",
  15112. "enum": ["sessionID"]
  15113. },
  15114. "data": {
  15115. "type": "object",
  15116. "properties": {
  15117. "timestamp": {
  15118. "type": "number"
  15119. },
  15120. "sessionID": {
  15121. "type": "string"
  15122. },
  15123. "text": {
  15124. "type": "string"
  15125. },
  15126. "include": {
  15127. "type": "string"
  15128. }
  15129. },
  15130. "required": ["timestamp", "sessionID", "text"],
  15131. "additionalProperties": false
  15132. }
  15133. },
  15134. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15135. "additionalProperties": false
  15136. },
  15137. "EventServerInstanceDisposed": {
  15138. "type": "object",
  15139. "properties": {
  15140. "id": {
  15141. "type": "string"
  15142. },
  15143. "type": {
  15144. "type": "string",
  15145. "enum": ["server.instance.disposed"]
  15146. },
  15147. "properties": {
  15148. "type": "object",
  15149. "properties": {
  15150. "directory": {
  15151. "type": "string"
  15152. }
  15153. },
  15154. "required": ["directory"],
  15155. "additionalProperties": false
  15156. }
  15157. },
  15158. "required": ["id", "type", "properties"],
  15159. "additionalProperties": false
  15160. },
  15161. "EventFileEdited": {
  15162. "type": "object",
  15163. "properties": {
  15164. "id": {
  15165. "type": "string"
  15166. },
  15167. "type": {
  15168. "type": "string",
  15169. "enum": ["file.edited"]
  15170. },
  15171. "properties": {
  15172. "type": "object",
  15173. "properties": {
  15174. "file": {
  15175. "type": "string"
  15176. }
  15177. },
  15178. "required": ["file"],
  15179. "additionalProperties": false
  15180. }
  15181. },
  15182. "required": ["id", "type", "properties"],
  15183. "additionalProperties": false
  15184. },
  15185. "EventFileWatcherUpdated": {
  15186. "type": "object",
  15187. "properties": {
  15188. "id": {
  15189. "type": "string"
  15190. },
  15191. "type": {
  15192. "type": "string",
  15193. "enum": ["file.watcher.updated"]
  15194. },
  15195. "properties": {
  15196. "type": "object",
  15197. "properties": {
  15198. "file": {
  15199. "type": "string"
  15200. },
  15201. "event": {
  15202. "type": "string",
  15203. "enum": ["add", "change", "unlink"]
  15204. }
  15205. },
  15206. "required": ["file", "event"],
  15207. "additionalProperties": false
  15208. }
  15209. },
  15210. "required": ["id", "type", "properties"],
  15211. "additionalProperties": false
  15212. },
  15213. "EventLspClientDiagnostics": {
  15214. "type": "object",
  15215. "properties": {
  15216. "id": {
  15217. "type": "string"
  15218. },
  15219. "type": {
  15220. "type": "string",
  15221. "enum": ["lsp.client.diagnostics"]
  15222. },
  15223. "properties": {
  15224. "type": "object",
  15225. "properties": {
  15226. "serverID": {
  15227. "type": "string"
  15228. },
  15229. "path": {
  15230. "type": "string"
  15231. }
  15232. },
  15233. "required": ["serverID", "path"],
  15234. "additionalProperties": false
  15235. }
  15236. },
  15237. "required": ["id", "type", "properties"],
  15238. "additionalProperties": false
  15239. },
  15240. "EventLspUpdated": {
  15241. "type": "object",
  15242. "properties": {
  15243. "id": {
  15244. "type": "string"
  15245. },
  15246. "type": {
  15247. "type": "string",
  15248. "enum": ["lsp.updated"]
  15249. },
  15250. "properties": {
  15251. "type": "object",
  15252. "properties": {}
  15253. }
  15254. },
  15255. "required": ["id", "type", "properties"],
  15256. "additionalProperties": false
  15257. },
  15258. "EventMessagePartDelta": {
  15259. "type": "object",
  15260. "properties": {
  15261. "id": {
  15262. "type": "string"
  15263. },
  15264. "type": {
  15265. "type": "string",
  15266. "enum": ["message.part.delta"]
  15267. },
  15268. "properties": {
  15269. "type": "object",
  15270. "properties": {
  15271. "sessionID": {
  15272. "type": "string"
  15273. },
  15274. "messageID": {
  15275. "type": "string"
  15276. },
  15277. "partID": {
  15278. "type": "string"
  15279. },
  15280. "field": {
  15281. "type": "string"
  15282. },
  15283. "delta": {
  15284. "type": "string"
  15285. }
  15286. },
  15287. "required": ["sessionID", "messageID", "partID", "field", "delta"],
  15288. "additionalProperties": false
  15289. }
  15290. },
  15291. "required": ["id", "type", "properties"],
  15292. "additionalProperties": false
  15293. },
  15294. "EventPermissionAsked": {
  15295. "type": "object",
  15296. "properties": {
  15297. "id": {
  15298. "type": "string"
  15299. },
  15300. "type": {
  15301. "type": "string",
  15302. "enum": ["permission.asked"]
  15303. },
  15304. "properties": {
  15305. "$ref": "#/components/schemas/PermissionRequest"
  15306. }
  15307. },
  15308. "required": ["id", "type", "properties"],
  15309. "additionalProperties": false
  15310. },
  15311. "EventPermissionReplied": {
  15312. "type": "object",
  15313. "properties": {
  15314. "id": {
  15315. "type": "string"
  15316. },
  15317. "type": {
  15318. "type": "string",
  15319. "enum": ["permission.replied"]
  15320. },
  15321. "properties": {
  15322. "type": "object",
  15323. "properties": {
  15324. "sessionID": {
  15325. "type": "string"
  15326. },
  15327. "requestID": {
  15328. "type": "string"
  15329. },
  15330. "reply": {
  15331. "type": "string",
  15332. "enum": ["once", "always", "reject"]
  15333. }
  15334. },
  15335. "required": ["sessionID", "requestID", "reply"],
  15336. "additionalProperties": false
  15337. }
  15338. },
  15339. "required": ["id", "type", "properties"],
  15340. "additionalProperties": false
  15341. },
  15342. "EventSessionDiff": {
  15343. "type": "object",
  15344. "properties": {
  15345. "id": {
  15346. "type": "string"
  15347. },
  15348. "type": {
  15349. "type": "string",
  15350. "enum": ["session.diff"]
  15351. },
  15352. "properties": {
  15353. "type": "object",
  15354. "properties": {
  15355. "sessionID": {
  15356. "type": "string"
  15357. },
  15358. "diff": {
  15359. "type": "array",
  15360. "items": {
  15361. "$ref": "#/components/schemas/SnapshotFileDiff"
  15362. }
  15363. }
  15364. },
  15365. "required": ["sessionID", "diff"],
  15366. "additionalProperties": false
  15367. }
  15368. },
  15369. "required": ["id", "type", "properties"],
  15370. "additionalProperties": false
  15371. },
  15372. "EventSessionError": {
  15373. "type": "object",
  15374. "properties": {
  15375. "id": {
  15376. "type": "string"
  15377. },
  15378. "type": {
  15379. "type": "string",
  15380. "enum": ["session.error"]
  15381. },
  15382. "properties": {
  15383. "type": "object",
  15384. "properties": {
  15385. "sessionID": {
  15386. "type": "string"
  15387. },
  15388. "error": {
  15389. "anyOf": [
  15390. {
  15391. "$ref": "#/components/schemas/ProviderAuthError"
  15392. },
  15393. {
  15394. "$ref": "#/components/schemas/UnknownError"
  15395. },
  15396. {
  15397. "$ref": "#/components/schemas/MessageOutputLengthError"
  15398. },
  15399. {
  15400. "$ref": "#/components/schemas/MessageAbortedError"
  15401. },
  15402. {
  15403. "$ref": "#/components/schemas/StructuredOutputError"
  15404. },
  15405. {
  15406. "$ref": "#/components/schemas/ContextOverflowError"
  15407. },
  15408. {
  15409. "$ref": "#/components/schemas/APIError"
  15410. }
  15411. ]
  15412. }
  15413. },
  15414. "additionalProperties": false
  15415. }
  15416. },
  15417. "required": ["id", "type", "properties"],
  15418. "additionalProperties": false
  15419. },
  15420. "EventInstallationUpdated": {
  15421. "type": "object",
  15422. "properties": {
  15423. "id": {
  15424. "type": "string"
  15425. },
  15426. "type": {
  15427. "type": "string",
  15428. "enum": ["installation.updated"]
  15429. },
  15430. "properties": {
  15431. "type": "object",
  15432. "properties": {
  15433. "version": {
  15434. "type": "string"
  15435. }
  15436. },
  15437. "required": ["version"],
  15438. "additionalProperties": false
  15439. }
  15440. },
  15441. "required": ["id", "type", "properties"],
  15442. "additionalProperties": false
  15443. },
  15444. "EventInstallationUpdate-available": {
  15445. "type": "object",
  15446. "properties": {
  15447. "id": {
  15448. "type": "string"
  15449. },
  15450. "type": {
  15451. "type": "string",
  15452. "enum": ["installation.update-available"]
  15453. },
  15454. "properties": {
  15455. "type": "object",
  15456. "properties": {
  15457. "version": {
  15458. "type": "string"
  15459. }
  15460. },
  15461. "required": ["version"],
  15462. "additionalProperties": false
  15463. }
  15464. },
  15465. "required": ["id", "type", "properties"],
  15466. "additionalProperties": false
  15467. },
  15468. "EventQuestionAsked": {
  15469. "type": "object",
  15470. "properties": {
  15471. "id": {
  15472. "type": "string"
  15473. },
  15474. "type": {
  15475. "type": "string",
  15476. "enum": ["question.asked"]
  15477. },
  15478. "properties": {
  15479. "$ref": "#/components/schemas/QuestionRequest"
  15480. }
  15481. },
  15482. "required": ["id", "type", "properties"],
  15483. "additionalProperties": false
  15484. },
  15485. "EventQuestionReplied": {
  15486. "type": "object",
  15487. "properties": {
  15488. "id": {
  15489. "type": "string"
  15490. },
  15491. "type": {
  15492. "type": "string",
  15493. "enum": ["question.replied"]
  15494. },
  15495. "properties": {
  15496. "$ref": "#/components/schemas/QuestionReplied"
  15497. }
  15498. },
  15499. "required": ["id", "type", "properties"],
  15500. "additionalProperties": false
  15501. },
  15502. "EventQuestionRejected": {
  15503. "type": "object",
  15504. "properties": {
  15505. "id": {
  15506. "type": "string"
  15507. },
  15508. "type": {
  15509. "type": "string",
  15510. "enum": ["question.rejected"]
  15511. },
  15512. "properties": {
  15513. "$ref": "#/components/schemas/QuestionRejected"
  15514. }
  15515. },
  15516. "required": ["id", "type", "properties"],
  15517. "additionalProperties": false
  15518. },
  15519. "EventTodoUpdated": {
  15520. "type": "object",
  15521. "properties": {
  15522. "id": {
  15523. "type": "string"
  15524. },
  15525. "type": {
  15526. "type": "string",
  15527. "enum": ["todo.updated"]
  15528. },
  15529. "properties": {
  15530. "type": "object",
  15531. "properties": {
  15532. "sessionID": {
  15533. "type": "string"
  15534. },
  15535. "todos": {
  15536. "type": "array",
  15537. "items": {
  15538. "$ref": "#/components/schemas/Todo"
  15539. }
  15540. }
  15541. },
  15542. "required": ["sessionID", "todos"],
  15543. "additionalProperties": false
  15544. }
  15545. },
  15546. "required": ["id", "type", "properties"],
  15547. "additionalProperties": false
  15548. },
  15549. "EventSessionStatus": {
  15550. "type": "object",
  15551. "properties": {
  15552. "id": {
  15553. "type": "string"
  15554. },
  15555. "type": {
  15556. "type": "string",
  15557. "enum": ["session.status"]
  15558. },
  15559. "properties": {
  15560. "type": "object",
  15561. "properties": {
  15562. "sessionID": {
  15563. "type": "string"
  15564. },
  15565. "status": {
  15566. "$ref": "#/components/schemas/SessionStatus"
  15567. }
  15568. },
  15569. "required": ["sessionID", "status"],
  15570. "additionalProperties": false
  15571. }
  15572. },
  15573. "required": ["id", "type", "properties"],
  15574. "additionalProperties": false
  15575. },
  15576. "EventSessionIdle": {
  15577. "type": "object",
  15578. "properties": {
  15579. "id": {
  15580. "type": "string"
  15581. },
  15582. "type": {
  15583. "type": "string",
  15584. "enum": ["session.idle"]
  15585. },
  15586. "properties": {
  15587. "type": "object",
  15588. "properties": {
  15589. "sessionID": {
  15590. "type": "string"
  15591. }
  15592. },
  15593. "required": ["sessionID"],
  15594. "additionalProperties": false
  15595. }
  15596. },
  15597. "required": ["id", "type", "properties"],
  15598. "additionalProperties": false
  15599. },
  15600. "EventSessionCompacted": {
  15601. "type": "object",
  15602. "properties": {
  15603. "id": {
  15604. "type": "string"
  15605. },
  15606. "type": {
  15607. "type": "string",
  15608. "enum": ["session.compacted"]
  15609. },
  15610. "properties": {
  15611. "type": "object",
  15612. "properties": {
  15613. "sessionID": {
  15614. "type": "string"
  15615. }
  15616. },
  15617. "required": ["sessionID"],
  15618. "additionalProperties": false
  15619. }
  15620. },
  15621. "required": ["id", "type", "properties"],
  15622. "additionalProperties": false
  15623. },
  15624. "EventMcpToolsChanged": {
  15625. "type": "object",
  15626. "properties": {
  15627. "id": {
  15628. "type": "string"
  15629. },
  15630. "type": {
  15631. "type": "string",
  15632. "enum": ["mcp.tools.changed"]
  15633. },
  15634. "properties": {
  15635. "type": "object",
  15636. "properties": {
  15637. "server": {
  15638. "type": "string"
  15639. }
  15640. },
  15641. "required": ["server"],
  15642. "additionalProperties": false
  15643. }
  15644. },
  15645. "required": ["id", "type", "properties"],
  15646. "additionalProperties": false
  15647. },
  15648. "EventMcpBrowserOpenFailed": {
  15649. "type": "object",
  15650. "properties": {
  15651. "id": {
  15652. "type": "string"
  15653. },
  15654. "type": {
  15655. "type": "string",
  15656. "enum": ["mcp.browser.open.failed"]
  15657. },
  15658. "properties": {
  15659. "type": "object",
  15660. "properties": {
  15661. "mcpName": {
  15662. "type": "string"
  15663. },
  15664. "url": {
  15665. "type": "string"
  15666. }
  15667. },
  15668. "required": ["mcpName", "url"],
  15669. "additionalProperties": false
  15670. }
  15671. },
  15672. "required": ["id", "type", "properties"],
  15673. "additionalProperties": false
  15674. },
  15675. "EventCommandExecuted": {
  15676. "type": "object",
  15677. "properties": {
  15678. "id": {
  15679. "type": "string"
  15680. },
  15681. "type": {
  15682. "type": "string",
  15683. "enum": ["command.executed"]
  15684. },
  15685. "properties": {
  15686. "type": "object",
  15687. "properties": {
  15688. "name": {
  15689. "type": "string"
  15690. },
  15691. "sessionID": {
  15692. "type": "string"
  15693. },
  15694. "arguments": {
  15695. "type": "string"
  15696. },
  15697. "messageID": {
  15698. "type": "string"
  15699. }
  15700. },
  15701. "required": ["name", "sessionID", "arguments", "messageID"],
  15702. "additionalProperties": false
  15703. }
  15704. },
  15705. "required": ["id", "type", "properties"],
  15706. "additionalProperties": false
  15707. },
  15708. "EventProjectUpdated": {
  15709. "type": "object",
  15710. "properties": {
  15711. "id": {
  15712. "type": "string"
  15713. },
  15714. "type": {
  15715. "type": "string",
  15716. "enum": ["project.updated"]
  15717. },
  15718. "properties": {
  15719. "$ref": "#/components/schemas/Project"
  15720. }
  15721. },
  15722. "required": ["id", "type", "properties"],
  15723. "additionalProperties": false
  15724. },
  15725. "EventVcsBranchUpdated": {
  15726. "type": "object",
  15727. "properties": {
  15728. "id": {
  15729. "type": "string"
  15730. },
  15731. "type": {
  15732. "type": "string",
  15733. "enum": ["vcs.branch.updated"]
  15734. },
  15735. "properties": {
  15736. "type": "object",
  15737. "properties": {
  15738. "branch": {
  15739. "type": "string"
  15740. }
  15741. },
  15742. "additionalProperties": false
  15743. }
  15744. },
  15745. "required": ["id", "type", "properties"],
  15746. "additionalProperties": false
  15747. },
  15748. "EventWorkspaceReady": {
  15749. "type": "object",
  15750. "properties": {
  15751. "id": {
  15752. "type": "string"
  15753. },
  15754. "type": {
  15755. "type": "string",
  15756. "enum": ["workspace.ready"]
  15757. },
  15758. "properties": {
  15759. "type": "object",
  15760. "properties": {
  15761. "name": {
  15762. "type": "string"
  15763. }
  15764. },
  15765. "required": ["name"],
  15766. "additionalProperties": false
  15767. }
  15768. },
  15769. "required": ["id", "type", "properties"],
  15770. "additionalProperties": false
  15771. },
  15772. "EventWorkspaceFailed": {
  15773. "type": "object",
  15774. "properties": {
  15775. "id": {
  15776. "type": "string"
  15777. },
  15778. "type": {
  15779. "type": "string",
  15780. "enum": ["workspace.failed"]
  15781. },
  15782. "properties": {
  15783. "type": "object",
  15784. "properties": {
  15785. "message": {
  15786. "type": "string"
  15787. }
  15788. },
  15789. "required": ["message"],
  15790. "additionalProperties": false
  15791. }
  15792. },
  15793. "required": ["id", "type", "properties"],
  15794. "additionalProperties": false
  15795. },
  15796. "EventWorkspaceRestore": {
  15797. "type": "object",
  15798. "properties": {
  15799. "id": {
  15800. "type": "string"
  15801. },
  15802. "type": {
  15803. "type": "string",
  15804. "enum": ["workspace.restore"]
  15805. },
  15806. "properties": {
  15807. "type": "object",
  15808. "properties": {
  15809. "workspaceID": {
  15810. "type": "string"
  15811. },
  15812. "sessionID": {
  15813. "type": "string"
  15814. },
  15815. "total": {
  15816. "type": "integer",
  15817. "minimum": 0
  15818. },
  15819. "step": {
  15820. "type": "integer",
  15821. "minimum": 0
  15822. }
  15823. },
  15824. "required": ["workspaceID", "sessionID", "total", "step"],
  15825. "additionalProperties": false
  15826. }
  15827. },
  15828. "required": ["id", "type", "properties"],
  15829. "additionalProperties": false
  15830. },
  15831. "EventWorkspaceStatus": {
  15832. "type": "object",
  15833. "properties": {
  15834. "id": {
  15835. "type": "string"
  15836. },
  15837. "type": {
  15838. "type": "string",
  15839. "enum": ["workspace.status"]
  15840. },
  15841. "properties": {
  15842. "type": "object",
  15843. "properties": {
  15844. "workspaceID": {
  15845. "type": "string"
  15846. },
  15847. "status": {
  15848. "type": "string",
  15849. "enum": ["connected", "connecting", "disconnected", "error"]
  15850. }
  15851. },
  15852. "required": ["workspaceID", "status"],
  15853. "additionalProperties": false
  15854. }
  15855. },
  15856. "required": ["id", "type", "properties"],
  15857. "additionalProperties": false
  15858. },
  15859. "EventWorktreeReady": {
  15860. "type": "object",
  15861. "properties": {
  15862. "id": {
  15863. "type": "string"
  15864. },
  15865. "type": {
  15866. "type": "string",
  15867. "enum": ["worktree.ready"]
  15868. },
  15869. "properties": {
  15870. "type": "object",
  15871. "properties": {
  15872. "name": {
  15873. "type": "string"
  15874. },
  15875. "branch": {
  15876. "type": "string"
  15877. }
  15878. },
  15879. "required": ["name", "branch"],
  15880. "additionalProperties": false
  15881. }
  15882. },
  15883. "required": ["id", "type", "properties"],
  15884. "additionalProperties": false
  15885. },
  15886. "EventWorktreeFailed": {
  15887. "type": "object",
  15888. "properties": {
  15889. "id": {
  15890. "type": "string"
  15891. },
  15892. "type": {
  15893. "type": "string",
  15894. "enum": ["worktree.failed"]
  15895. },
  15896. "properties": {
  15897. "type": "object",
  15898. "properties": {
  15899. "message": {
  15900. "type": "string"
  15901. }
  15902. },
  15903. "required": ["message"],
  15904. "additionalProperties": false
  15905. }
  15906. },
  15907. "required": ["id", "type", "properties"],
  15908. "additionalProperties": false
  15909. },
  15910. "EventPtyCreated": {
  15911. "type": "object",
  15912. "properties": {
  15913. "id": {
  15914. "type": "string"
  15915. },
  15916. "type": {
  15917. "type": "string",
  15918. "enum": ["pty.created"]
  15919. },
  15920. "properties": {
  15921. "type": "object",
  15922. "properties": {
  15923. "info": {
  15924. "$ref": "#/components/schemas/Pty"
  15925. }
  15926. },
  15927. "required": ["info"],
  15928. "additionalProperties": false
  15929. }
  15930. },
  15931. "required": ["id", "type", "properties"],
  15932. "additionalProperties": false
  15933. },
  15934. "EventPtyUpdated": {
  15935. "type": "object",
  15936. "properties": {
  15937. "id": {
  15938. "type": "string"
  15939. },
  15940. "type": {
  15941. "type": "string",
  15942. "enum": ["pty.updated"]
  15943. },
  15944. "properties": {
  15945. "type": "object",
  15946. "properties": {
  15947. "info": {
  15948. "$ref": "#/components/schemas/Pty"
  15949. }
  15950. },
  15951. "required": ["info"],
  15952. "additionalProperties": false
  15953. }
  15954. },
  15955. "required": ["id", "type", "properties"],
  15956. "additionalProperties": false
  15957. },
  15958. "EventPtyExited": {
  15959. "type": "object",
  15960. "properties": {
  15961. "id": {
  15962. "type": "string"
  15963. },
  15964. "type": {
  15965. "type": "string",
  15966. "enum": ["pty.exited"]
  15967. },
  15968. "properties": {
  15969. "type": "object",
  15970. "properties": {
  15971. "id": {
  15972. "type": "string"
  15973. },
  15974. "exitCode": {
  15975. "type": "integer",
  15976. "minimum": 0
  15977. }
  15978. },
  15979. "required": ["id", "exitCode"],
  15980. "additionalProperties": false
  15981. }
  15982. },
  15983. "required": ["id", "type", "properties"],
  15984. "additionalProperties": false
  15985. },
  15986. "EventPtyDeleted": {
  15987. "type": "object",
  15988. "properties": {
  15989. "id": {
  15990. "type": "string"
  15991. },
  15992. "type": {
  15993. "type": "string",
  15994. "enum": ["pty.deleted"]
  15995. },
  15996. "properties": {
  15997. "type": "object",
  15998. "properties": {
  15999. "id": {
  16000. "type": "string"
  16001. }
  16002. },
  16003. "required": ["id"],
  16004. "additionalProperties": false
  16005. }
  16006. },
  16007. "required": ["id", "type", "properties"],
  16008. "additionalProperties": false
  16009. },
  16010. "EventMessageUpdated": {
  16011. "type": "object",
  16012. "properties": {
  16013. "id": {
  16014. "type": "string"
  16015. },
  16016. "type": {
  16017. "type": "string",
  16018. "enum": ["message.updated"]
  16019. },
  16020. "properties": {
  16021. "type": "object",
  16022. "properties": {
  16023. "sessionID": {
  16024. "type": "string"
  16025. },
  16026. "info": {
  16027. "$ref": "#/components/schemas/Message"
  16028. }
  16029. },
  16030. "required": ["sessionID", "info"],
  16031. "additionalProperties": false
  16032. }
  16033. },
  16034. "required": ["id", "type", "properties"],
  16035. "additionalProperties": false
  16036. },
  16037. "EventMessageRemoved": {
  16038. "type": "object",
  16039. "properties": {
  16040. "id": {
  16041. "type": "string"
  16042. },
  16043. "type": {
  16044. "type": "string",
  16045. "enum": ["message.removed"]
  16046. },
  16047. "properties": {
  16048. "type": "object",
  16049. "properties": {
  16050. "sessionID": {
  16051. "type": "string"
  16052. },
  16053. "messageID": {
  16054. "type": "string"
  16055. }
  16056. },
  16057. "required": ["sessionID", "messageID"],
  16058. "additionalProperties": false
  16059. }
  16060. },
  16061. "required": ["id", "type", "properties"],
  16062. "additionalProperties": false
  16063. },
  16064. "EventMessagePartUpdated": {
  16065. "type": "object",
  16066. "properties": {
  16067. "id": {
  16068. "type": "string"
  16069. },
  16070. "type": {
  16071. "type": "string",
  16072. "enum": ["message.part.updated"]
  16073. },
  16074. "properties": {
  16075. "type": "object",
  16076. "properties": {
  16077. "sessionID": {
  16078. "type": "string"
  16079. },
  16080. "part": {
  16081. "$ref": "#/components/schemas/Part"
  16082. },
  16083. "time": {
  16084. "type": "integer",
  16085. "minimum": 0
  16086. }
  16087. },
  16088. "required": ["sessionID", "part", "time"],
  16089. "additionalProperties": false
  16090. }
  16091. },
  16092. "required": ["id", "type", "properties"],
  16093. "additionalProperties": false
  16094. },
  16095. "EventMessagePartRemoved": {
  16096. "type": "object",
  16097. "properties": {
  16098. "id": {
  16099. "type": "string"
  16100. },
  16101. "type": {
  16102. "type": "string",
  16103. "enum": ["message.part.removed"]
  16104. },
  16105. "properties": {
  16106. "type": "object",
  16107. "properties": {
  16108. "sessionID": {
  16109. "type": "string"
  16110. },
  16111. "messageID": {
  16112. "type": "string"
  16113. },
  16114. "partID": {
  16115. "type": "string"
  16116. }
  16117. },
  16118. "required": ["sessionID", "messageID", "partID"],
  16119. "additionalProperties": false
  16120. }
  16121. },
  16122. "required": ["id", "type", "properties"],
  16123. "additionalProperties": false
  16124. },
  16125. "EventSessionCreated": {
  16126. "type": "object",
  16127. "properties": {
  16128. "id": {
  16129. "type": "string"
  16130. },
  16131. "type": {
  16132. "type": "string",
  16133. "enum": ["session.created"]
  16134. },
  16135. "properties": {
  16136. "type": "object",
  16137. "properties": {
  16138. "sessionID": {
  16139. "type": "string"
  16140. },
  16141. "info": {
  16142. "$ref": "#/components/schemas/Session"
  16143. }
  16144. },
  16145. "required": ["sessionID", "info"],
  16146. "additionalProperties": false
  16147. }
  16148. },
  16149. "required": ["id", "type", "properties"],
  16150. "additionalProperties": false
  16151. },
  16152. "EventSessionUpdated": {
  16153. "type": "object",
  16154. "properties": {
  16155. "id": {
  16156. "type": "string"
  16157. },
  16158. "type": {
  16159. "type": "string",
  16160. "enum": ["session.updated"]
  16161. },
  16162. "properties": {
  16163. "type": "object",
  16164. "properties": {
  16165. "sessionID": {
  16166. "type": "string"
  16167. },
  16168. "info": {
  16169. "$ref": "#/components/schemas/Session"
  16170. }
  16171. },
  16172. "required": ["sessionID", "info"],
  16173. "additionalProperties": false
  16174. }
  16175. },
  16176. "required": ["id", "type", "properties"],
  16177. "additionalProperties": false
  16178. },
  16179. "EventSessionDeleted": {
  16180. "type": "object",
  16181. "properties": {
  16182. "id": {
  16183. "type": "string"
  16184. },
  16185. "type": {
  16186. "type": "string",
  16187. "enum": ["session.deleted"]
  16188. },
  16189. "properties": {
  16190. "type": "object",
  16191. "properties": {
  16192. "sessionID": {
  16193. "type": "string"
  16194. },
  16195. "info": {
  16196. "$ref": "#/components/schemas/Session"
  16197. }
  16198. },
  16199. "required": ["sessionID", "info"],
  16200. "additionalProperties": false
  16201. }
  16202. },
  16203. "required": ["id", "type", "properties"],
  16204. "additionalProperties": false
  16205. },
  16206. "EventSessionNextAgentSwitched": {
  16207. "type": "object",
  16208. "properties": {
  16209. "id": {
  16210. "type": "string"
  16211. },
  16212. "type": {
  16213. "type": "string",
  16214. "enum": ["session.next.agent.switched"]
  16215. },
  16216. "properties": {
  16217. "type": "object",
  16218. "properties": {
  16219. "timestamp": {
  16220. "type": "number"
  16221. },
  16222. "sessionID": {
  16223. "type": "string"
  16224. },
  16225. "agent": {
  16226. "type": "string"
  16227. }
  16228. },
  16229. "required": ["timestamp", "sessionID", "agent"],
  16230. "additionalProperties": false
  16231. }
  16232. },
  16233. "required": ["id", "type", "properties"],
  16234. "additionalProperties": false
  16235. },
  16236. "EventSessionNextModelSwitched": {
  16237. "type": "object",
  16238. "properties": {
  16239. "id": {
  16240. "type": "string"
  16241. },
  16242. "type": {
  16243. "type": "string",
  16244. "enum": ["session.next.model.switched"]
  16245. },
  16246. "properties": {
  16247. "type": "object",
  16248. "properties": {
  16249. "timestamp": {
  16250. "type": "number"
  16251. },
  16252. "sessionID": {
  16253. "type": "string"
  16254. },
  16255. "id": {
  16256. "type": "string"
  16257. },
  16258. "providerID": {
  16259. "type": "string"
  16260. },
  16261. "variant": {
  16262. "type": "string"
  16263. }
  16264. },
  16265. "required": ["timestamp", "sessionID", "id", "providerID"],
  16266. "additionalProperties": false
  16267. }
  16268. },
  16269. "required": ["id", "type", "properties"],
  16270. "additionalProperties": false
  16271. },
  16272. "PromptSource": {
  16273. "type": "object",
  16274. "properties": {
  16275. "start": {
  16276. "type": "number"
  16277. },
  16278. "end": {
  16279. "type": "number"
  16280. },
  16281. "text": {
  16282. "type": "string"
  16283. }
  16284. },
  16285. "required": ["start", "end", "text"],
  16286. "additionalProperties": false
  16287. },
  16288. "PromptFileAttachment": {
  16289. "type": "object",
  16290. "properties": {
  16291. "uri": {
  16292. "type": "string"
  16293. },
  16294. "mime": {
  16295. "type": "string"
  16296. },
  16297. "name": {
  16298. "type": "string"
  16299. },
  16300. "description": {
  16301. "type": "string"
  16302. },
  16303. "source": {
  16304. "$ref": "#/components/schemas/PromptSource"
  16305. }
  16306. },
  16307. "required": ["uri", "mime"],
  16308. "additionalProperties": false
  16309. },
  16310. "PromptAgentAttachment": {
  16311. "type": "object",
  16312. "properties": {
  16313. "name": {
  16314. "type": "string"
  16315. },
  16316. "source": {
  16317. "$ref": "#/components/schemas/PromptSource"
  16318. }
  16319. },
  16320. "required": ["name"],
  16321. "additionalProperties": false
  16322. },
  16323. "EventSessionNextPrompted": {
  16324. "type": "object",
  16325. "properties": {
  16326. "id": {
  16327. "type": "string"
  16328. },
  16329. "type": {
  16330. "type": "string",
  16331. "enum": ["session.next.prompted"]
  16332. },
  16333. "properties": {
  16334. "type": "object",
  16335. "properties": {
  16336. "timestamp": {
  16337. "type": "number"
  16338. },
  16339. "sessionID": {
  16340. "type": "string"
  16341. },
  16342. "prompt": {
  16343. "$ref": "#/components/schemas/Prompt"
  16344. }
  16345. },
  16346. "required": ["timestamp", "sessionID", "prompt"],
  16347. "additionalProperties": false
  16348. }
  16349. },
  16350. "required": ["id", "type", "properties"],
  16351. "additionalProperties": false
  16352. },
  16353. "EventSessionNextSynthetic": {
  16354. "type": "object",
  16355. "properties": {
  16356. "id": {
  16357. "type": "string"
  16358. },
  16359. "type": {
  16360. "type": "string",
  16361. "enum": ["session.next.synthetic"]
  16362. },
  16363. "properties": {
  16364. "type": "object",
  16365. "properties": {
  16366. "timestamp": {
  16367. "type": "number"
  16368. },
  16369. "sessionID": {
  16370. "type": "string"
  16371. },
  16372. "text": {
  16373. "type": "string"
  16374. }
  16375. },
  16376. "required": ["timestamp", "sessionID", "text"],
  16377. "additionalProperties": false
  16378. }
  16379. },
  16380. "required": ["id", "type", "properties"],
  16381. "additionalProperties": false
  16382. },
  16383. "EventSessionNextShellStarted": {
  16384. "type": "object",
  16385. "properties": {
  16386. "id": {
  16387. "type": "string"
  16388. },
  16389. "type": {
  16390. "type": "string",
  16391. "enum": ["session.next.shell.started"]
  16392. },
  16393. "properties": {
  16394. "type": "object",
  16395. "properties": {
  16396. "timestamp": {
  16397. "type": "number"
  16398. },
  16399. "sessionID": {
  16400. "type": "string"
  16401. },
  16402. "callID": {
  16403. "type": "string"
  16404. },
  16405. "command": {
  16406. "type": "string"
  16407. }
  16408. },
  16409. "required": ["timestamp", "sessionID", "callID", "command"],
  16410. "additionalProperties": false
  16411. }
  16412. },
  16413. "required": ["id", "type", "properties"],
  16414. "additionalProperties": false
  16415. },
  16416. "EventSessionNextShellEnded": {
  16417. "type": "object",
  16418. "properties": {
  16419. "id": {
  16420. "type": "string"
  16421. },
  16422. "type": {
  16423. "type": "string",
  16424. "enum": ["session.next.shell.ended"]
  16425. },
  16426. "properties": {
  16427. "type": "object",
  16428. "properties": {
  16429. "timestamp": {
  16430. "type": "number"
  16431. },
  16432. "sessionID": {
  16433. "type": "string"
  16434. },
  16435. "callID": {
  16436. "type": "string"
  16437. },
  16438. "output": {
  16439. "type": "string"
  16440. }
  16441. },
  16442. "required": ["timestamp", "sessionID", "callID", "output"],
  16443. "additionalProperties": false
  16444. }
  16445. },
  16446. "required": ["id", "type", "properties"],
  16447. "additionalProperties": false
  16448. },
  16449. "EventSessionNextStepStarted": {
  16450. "type": "object",
  16451. "properties": {
  16452. "id": {
  16453. "type": "string"
  16454. },
  16455. "type": {
  16456. "type": "string",
  16457. "enum": ["session.next.step.started"]
  16458. },
  16459. "properties": {
  16460. "type": "object",
  16461. "properties": {
  16462. "timestamp": {
  16463. "type": "number"
  16464. },
  16465. "sessionID": {
  16466. "type": "string"
  16467. },
  16468. "agent": {
  16469. "type": "string"
  16470. },
  16471. "model": {
  16472. "type": "object",
  16473. "properties": {
  16474. "id": {
  16475. "type": "string"
  16476. },
  16477. "providerID": {
  16478. "type": "string"
  16479. },
  16480. "variant": {
  16481. "type": "string"
  16482. }
  16483. },
  16484. "required": ["id", "providerID"],
  16485. "additionalProperties": false
  16486. },
  16487. "snapshot": {
  16488. "type": "string"
  16489. }
  16490. },
  16491. "required": ["timestamp", "sessionID", "agent", "model"],
  16492. "additionalProperties": false
  16493. }
  16494. },
  16495. "required": ["id", "type", "properties"],
  16496. "additionalProperties": false
  16497. },
  16498. "EventSessionNextStepEnded": {
  16499. "type": "object",
  16500. "properties": {
  16501. "id": {
  16502. "type": "string"
  16503. },
  16504. "type": {
  16505. "type": "string",
  16506. "enum": ["session.next.step.ended"]
  16507. },
  16508. "properties": {
  16509. "type": "object",
  16510. "properties": {
  16511. "timestamp": {
  16512. "type": "number"
  16513. },
  16514. "sessionID": {
  16515. "type": "string"
  16516. },
  16517. "finish": {
  16518. "type": "string"
  16519. },
  16520. "cost": {
  16521. "type": "number"
  16522. },
  16523. "tokens": {
  16524. "type": "object",
  16525. "properties": {
  16526. "input": {
  16527. "type": "integer",
  16528. "minimum": 0
  16529. },
  16530. "output": {
  16531. "type": "integer",
  16532. "minimum": 0
  16533. },
  16534. "reasoning": {
  16535. "type": "integer",
  16536. "minimum": 0
  16537. },
  16538. "cache": {
  16539. "type": "object",
  16540. "properties": {
  16541. "read": {
  16542. "type": "integer",
  16543. "minimum": 0
  16544. },
  16545. "write": {
  16546. "type": "integer",
  16547. "minimum": 0
  16548. }
  16549. },
  16550. "required": ["read", "write"],
  16551. "additionalProperties": false
  16552. }
  16553. },
  16554. "required": ["input", "output", "reasoning", "cache"],
  16555. "additionalProperties": false
  16556. },
  16557. "snapshot": {
  16558. "type": "string"
  16559. }
  16560. },
  16561. "required": ["timestamp", "sessionID", "finish", "cost", "tokens"],
  16562. "additionalProperties": false
  16563. }
  16564. },
  16565. "required": ["id", "type", "properties"],
  16566. "additionalProperties": false
  16567. },
  16568. "EventSessionNextStepFailed": {
  16569. "type": "object",
  16570. "properties": {
  16571. "id": {
  16572. "type": "string"
  16573. },
  16574. "type": {
  16575. "type": "string",
  16576. "enum": ["session.next.step.failed"]
  16577. },
  16578. "properties": {
  16579. "type": "object",
  16580. "properties": {
  16581. "timestamp": {
  16582. "type": "number"
  16583. },
  16584. "sessionID": {
  16585. "type": "string"
  16586. },
  16587. "error": {
  16588. "type": "object",
  16589. "properties": {
  16590. "type": {
  16591. "type": "string"
  16592. },
  16593. "message": {
  16594. "type": "string"
  16595. }
  16596. },
  16597. "required": ["type", "message"],
  16598. "additionalProperties": false
  16599. }
  16600. },
  16601. "required": ["timestamp", "sessionID", "error"],
  16602. "additionalProperties": false
  16603. }
  16604. },
  16605. "required": ["id", "type", "properties"],
  16606. "additionalProperties": false
  16607. },
  16608. "EventSessionNextTextStarted": {
  16609. "type": "object",
  16610. "properties": {
  16611. "id": {
  16612. "type": "string"
  16613. },
  16614. "type": {
  16615. "type": "string",
  16616. "enum": ["session.next.text.started"]
  16617. },
  16618. "properties": {
  16619. "type": "object",
  16620. "properties": {
  16621. "timestamp": {
  16622. "type": "number"
  16623. },
  16624. "sessionID": {
  16625. "type": "string"
  16626. }
  16627. },
  16628. "required": ["timestamp", "sessionID"],
  16629. "additionalProperties": false
  16630. }
  16631. },
  16632. "required": ["id", "type", "properties"],
  16633. "additionalProperties": false
  16634. },
  16635. "EventSessionNextTextDelta": {
  16636. "type": "object",
  16637. "properties": {
  16638. "id": {
  16639. "type": "string"
  16640. },
  16641. "type": {
  16642. "type": "string",
  16643. "enum": ["session.next.text.delta"]
  16644. },
  16645. "properties": {
  16646. "type": "object",
  16647. "properties": {
  16648. "timestamp": {
  16649. "type": "number"
  16650. },
  16651. "sessionID": {
  16652. "type": "string"
  16653. },
  16654. "delta": {
  16655. "type": "string"
  16656. }
  16657. },
  16658. "required": ["timestamp", "sessionID", "delta"],
  16659. "additionalProperties": false
  16660. }
  16661. },
  16662. "required": ["id", "type", "properties"],
  16663. "additionalProperties": false
  16664. },
  16665. "EventSessionNextTextEnded": {
  16666. "type": "object",
  16667. "properties": {
  16668. "id": {
  16669. "type": "string"
  16670. },
  16671. "type": {
  16672. "type": "string",
  16673. "enum": ["session.next.text.ended"]
  16674. },
  16675. "properties": {
  16676. "type": "object",
  16677. "properties": {
  16678. "timestamp": {
  16679. "type": "number"
  16680. },
  16681. "sessionID": {
  16682. "type": "string"
  16683. },
  16684. "text": {
  16685. "type": "string"
  16686. }
  16687. },
  16688. "required": ["timestamp", "sessionID", "text"],
  16689. "additionalProperties": false
  16690. }
  16691. },
  16692. "required": ["id", "type", "properties"],
  16693. "additionalProperties": false
  16694. },
  16695. "EventSessionNextReasoningStarted": {
  16696. "type": "object",
  16697. "properties": {
  16698. "id": {
  16699. "type": "string"
  16700. },
  16701. "type": {
  16702. "type": "string",
  16703. "enum": ["session.next.reasoning.started"]
  16704. },
  16705. "properties": {
  16706. "type": "object",
  16707. "properties": {
  16708. "timestamp": {
  16709. "type": "number"
  16710. },
  16711. "sessionID": {
  16712. "type": "string"
  16713. },
  16714. "reasoningID": {
  16715. "type": "string"
  16716. }
  16717. },
  16718. "required": ["timestamp", "sessionID", "reasoningID"],
  16719. "additionalProperties": false
  16720. }
  16721. },
  16722. "required": ["id", "type", "properties"],
  16723. "additionalProperties": false
  16724. },
  16725. "EventSessionNextReasoningDelta": {
  16726. "type": "object",
  16727. "properties": {
  16728. "id": {
  16729. "type": "string"
  16730. },
  16731. "type": {
  16732. "type": "string",
  16733. "enum": ["session.next.reasoning.delta"]
  16734. },
  16735. "properties": {
  16736. "type": "object",
  16737. "properties": {
  16738. "timestamp": {
  16739. "type": "number"
  16740. },
  16741. "sessionID": {
  16742. "type": "string"
  16743. },
  16744. "reasoningID": {
  16745. "type": "string"
  16746. },
  16747. "delta": {
  16748. "type": "string"
  16749. }
  16750. },
  16751. "required": ["timestamp", "sessionID", "reasoningID", "delta"],
  16752. "additionalProperties": false
  16753. }
  16754. },
  16755. "required": ["id", "type", "properties"],
  16756. "additionalProperties": false
  16757. },
  16758. "EventSessionNextReasoningEnded": {
  16759. "type": "object",
  16760. "properties": {
  16761. "id": {
  16762. "type": "string"
  16763. },
  16764. "type": {
  16765. "type": "string",
  16766. "enum": ["session.next.reasoning.ended"]
  16767. },
  16768. "properties": {
  16769. "type": "object",
  16770. "properties": {
  16771. "timestamp": {
  16772. "type": "number"
  16773. },
  16774. "sessionID": {
  16775. "type": "string"
  16776. },
  16777. "reasoningID": {
  16778. "type": "string"
  16779. },
  16780. "text": {
  16781. "type": "string"
  16782. }
  16783. },
  16784. "required": ["timestamp", "sessionID", "reasoningID", "text"],
  16785. "additionalProperties": false
  16786. }
  16787. },
  16788. "required": ["id", "type", "properties"],
  16789. "additionalProperties": false
  16790. },
  16791. "EventSessionNextToolInputStarted": {
  16792. "type": "object",
  16793. "properties": {
  16794. "id": {
  16795. "type": "string"
  16796. },
  16797. "type": {
  16798. "type": "string",
  16799. "enum": ["session.next.tool.input.started"]
  16800. },
  16801. "properties": {
  16802. "type": "object",
  16803. "properties": {
  16804. "timestamp": {
  16805. "type": "number"
  16806. },
  16807. "sessionID": {
  16808. "type": "string"
  16809. },
  16810. "callID": {
  16811. "type": "string"
  16812. },
  16813. "name": {
  16814. "type": "string"
  16815. }
  16816. },
  16817. "required": ["timestamp", "sessionID", "callID", "name"],
  16818. "additionalProperties": false
  16819. }
  16820. },
  16821. "required": ["id", "type", "properties"],
  16822. "additionalProperties": false
  16823. },
  16824. "EventSessionNextToolInputDelta": {
  16825. "type": "object",
  16826. "properties": {
  16827. "id": {
  16828. "type": "string"
  16829. },
  16830. "type": {
  16831. "type": "string",
  16832. "enum": ["session.next.tool.input.delta"]
  16833. },
  16834. "properties": {
  16835. "type": "object",
  16836. "properties": {
  16837. "timestamp": {
  16838. "type": "number"
  16839. },
  16840. "sessionID": {
  16841. "type": "string"
  16842. },
  16843. "callID": {
  16844. "type": "string"
  16845. },
  16846. "delta": {
  16847. "type": "string"
  16848. }
  16849. },
  16850. "required": ["timestamp", "sessionID", "callID", "delta"],
  16851. "additionalProperties": false
  16852. }
  16853. },
  16854. "required": ["id", "type", "properties"],
  16855. "additionalProperties": false
  16856. },
  16857. "EventSessionNextToolInputEnded": {
  16858. "type": "object",
  16859. "properties": {
  16860. "id": {
  16861. "type": "string"
  16862. },
  16863. "type": {
  16864. "type": "string",
  16865. "enum": ["session.next.tool.input.ended"]
  16866. },
  16867. "properties": {
  16868. "type": "object",
  16869. "properties": {
  16870. "timestamp": {
  16871. "type": "number"
  16872. },
  16873. "sessionID": {
  16874. "type": "string"
  16875. },
  16876. "callID": {
  16877. "type": "string"
  16878. },
  16879. "text": {
  16880. "type": "string"
  16881. }
  16882. },
  16883. "required": ["timestamp", "sessionID", "callID", "text"],
  16884. "additionalProperties": false
  16885. }
  16886. },
  16887. "required": ["id", "type", "properties"],
  16888. "additionalProperties": false
  16889. },
  16890. "EventSessionNextToolCalled": {
  16891. "type": "object",
  16892. "properties": {
  16893. "id": {
  16894. "type": "string"
  16895. },
  16896. "type": {
  16897. "type": "string",
  16898. "enum": ["session.next.tool.called"]
  16899. },
  16900. "properties": {
  16901. "type": "object",
  16902. "properties": {
  16903. "timestamp": {
  16904. "type": "number"
  16905. },
  16906. "sessionID": {
  16907. "type": "string"
  16908. },
  16909. "callID": {
  16910. "type": "string"
  16911. },
  16912. "tool": {
  16913. "type": "string"
  16914. },
  16915. "input": {
  16916. "type": "object"
  16917. },
  16918. "provider": {
  16919. "type": "object",
  16920. "properties": {
  16921. "executed": {
  16922. "type": "boolean"
  16923. },
  16924. "metadata": {
  16925. "type": "object"
  16926. }
  16927. },
  16928. "required": ["executed"],
  16929. "additionalProperties": false
  16930. }
  16931. },
  16932. "required": ["timestamp", "sessionID", "callID", "tool", "input", "provider"],
  16933. "additionalProperties": false
  16934. }
  16935. },
  16936. "required": ["id", "type", "properties"],
  16937. "additionalProperties": false
  16938. },
  16939. "ToolTextContent": {
  16940. "type": "object",
  16941. "properties": {
  16942. "type": {
  16943. "type": "string",
  16944. "enum": ["text"]
  16945. },
  16946. "text": {
  16947. "type": "string"
  16948. }
  16949. },
  16950. "required": ["type", "text"],
  16951. "additionalProperties": false
  16952. },
  16953. "ToolFileContent": {
  16954. "type": "object",
  16955. "properties": {
  16956. "type": {
  16957. "type": "string",
  16958. "enum": ["file"]
  16959. },
  16960. "uri": {
  16961. "type": "string"
  16962. },
  16963. "mime": {
  16964. "type": "string"
  16965. },
  16966. "name": {
  16967. "type": "string"
  16968. }
  16969. },
  16970. "required": ["type", "uri", "mime"],
  16971. "additionalProperties": false
  16972. },
  16973. "EventSessionNextToolProgress": {
  16974. "type": "object",
  16975. "properties": {
  16976. "id": {
  16977. "type": "string"
  16978. },
  16979. "type": {
  16980. "type": "string",
  16981. "enum": ["session.next.tool.progress"]
  16982. },
  16983. "properties": {
  16984. "type": "object",
  16985. "properties": {
  16986. "timestamp": {
  16987. "type": "number"
  16988. },
  16989. "sessionID": {
  16990. "type": "string"
  16991. },
  16992. "callID": {
  16993. "type": "string"
  16994. },
  16995. "structured": {
  16996. "type": "object"
  16997. },
  16998. "content": {
  16999. "type": "array",
  17000. "items": {
  17001. "anyOf": [
  17002. {
  17003. "$ref": "#/components/schemas/ToolTextContent"
  17004. },
  17005. {
  17006. "$ref": "#/components/schemas/ToolFileContent"
  17007. }
  17008. ]
  17009. }
  17010. }
  17011. },
  17012. "required": ["timestamp", "sessionID", "callID", "structured", "content"],
  17013. "additionalProperties": false
  17014. }
  17015. },
  17016. "required": ["id", "type", "properties"],
  17017. "additionalProperties": false
  17018. },
  17019. "EventSessionNextToolSuccess": {
  17020. "type": "object",
  17021. "properties": {
  17022. "id": {
  17023. "type": "string"
  17024. },
  17025. "type": {
  17026. "type": "string",
  17027. "enum": ["session.next.tool.success"]
  17028. },
  17029. "properties": {
  17030. "type": "object",
  17031. "properties": {
  17032. "timestamp": {
  17033. "type": "number"
  17034. },
  17035. "sessionID": {
  17036. "type": "string"
  17037. },
  17038. "callID": {
  17039. "type": "string"
  17040. },
  17041. "structured": {
  17042. "type": "object"
  17043. },
  17044. "content": {
  17045. "type": "array",
  17046. "items": {
  17047. "anyOf": [
  17048. {
  17049. "$ref": "#/components/schemas/ToolTextContent"
  17050. },
  17051. {
  17052. "$ref": "#/components/schemas/ToolFileContent"
  17053. }
  17054. ]
  17055. }
  17056. },
  17057. "provider": {
  17058. "type": "object",
  17059. "properties": {
  17060. "executed": {
  17061. "type": "boolean"
  17062. },
  17063. "metadata": {
  17064. "type": "object"
  17065. }
  17066. },
  17067. "required": ["executed"],
  17068. "additionalProperties": false
  17069. }
  17070. },
  17071. "required": ["timestamp", "sessionID", "callID", "structured", "content", "provider"],
  17072. "additionalProperties": false
  17073. }
  17074. },
  17075. "required": ["id", "type", "properties"],
  17076. "additionalProperties": false
  17077. },
  17078. "EventSessionNextToolFailed": {
  17079. "type": "object",
  17080. "properties": {
  17081. "id": {
  17082. "type": "string"
  17083. },
  17084. "type": {
  17085. "type": "string",
  17086. "enum": ["session.next.tool.failed"]
  17087. },
  17088. "properties": {
  17089. "type": "object",
  17090. "properties": {
  17091. "timestamp": {
  17092. "type": "number"
  17093. },
  17094. "sessionID": {
  17095. "type": "string"
  17096. },
  17097. "callID": {
  17098. "type": "string"
  17099. },
  17100. "error": {
  17101. "type": "object",
  17102. "properties": {
  17103. "type": {
  17104. "type": "string"
  17105. },
  17106. "message": {
  17107. "type": "string"
  17108. }
  17109. },
  17110. "required": ["type", "message"],
  17111. "additionalProperties": false
  17112. },
  17113. "provider": {
  17114. "type": "object",
  17115. "properties": {
  17116. "executed": {
  17117. "type": "boolean"
  17118. },
  17119. "metadata": {
  17120. "type": "object"
  17121. }
  17122. },
  17123. "required": ["executed"],
  17124. "additionalProperties": false
  17125. }
  17126. },
  17127. "required": ["timestamp", "sessionID", "callID", "error", "provider"],
  17128. "additionalProperties": false
  17129. }
  17130. },
  17131. "required": ["id", "type", "properties"],
  17132. "additionalProperties": false
  17133. },
  17134. "SessionNextRetry_error": {
  17135. "type": "object",
  17136. "properties": {
  17137. "message": {
  17138. "type": "string"
  17139. },
  17140. "statusCode": {
  17141. "type": "integer",
  17142. "minimum": 0
  17143. },
  17144. "isRetryable": {
  17145. "type": "boolean"
  17146. },
  17147. "responseHeaders": {
  17148. "type": "object",
  17149. "additionalProperties": {
  17150. "type": "string"
  17151. }
  17152. },
  17153. "responseBody": {
  17154. "type": "string"
  17155. },
  17156. "metadata": {
  17157. "type": "object",
  17158. "additionalProperties": {
  17159. "type": "string"
  17160. }
  17161. }
  17162. },
  17163. "required": ["message", "isRetryable"],
  17164. "additionalProperties": false
  17165. },
  17166. "EventSessionNextRetried": {
  17167. "type": "object",
  17168. "properties": {
  17169. "id": {
  17170. "type": "string"
  17171. },
  17172. "type": {
  17173. "type": "string",
  17174. "enum": ["session.next.retried"]
  17175. },
  17176. "properties": {
  17177. "type": "object",
  17178. "properties": {
  17179. "timestamp": {
  17180. "type": "number"
  17181. },
  17182. "sessionID": {
  17183. "type": "string"
  17184. },
  17185. "attempt": {
  17186. "type": "integer",
  17187. "minimum": 0
  17188. },
  17189. "error": {
  17190. "$ref": "#/components/schemas/SessionNextRetry_error"
  17191. }
  17192. },
  17193. "required": ["timestamp", "sessionID", "attempt", "error"],
  17194. "additionalProperties": false
  17195. }
  17196. },
  17197. "required": ["id", "type", "properties"],
  17198. "additionalProperties": false
  17199. },
  17200. "EventSessionNextCompactionStarted": {
  17201. "type": "object",
  17202. "properties": {
  17203. "id": {
  17204. "type": "string"
  17205. },
  17206. "type": {
  17207. "type": "string",
  17208. "enum": ["session.next.compaction.started"]
  17209. },
  17210. "properties": {
  17211. "type": "object",
  17212. "properties": {
  17213. "timestamp": {
  17214. "type": "number"
  17215. },
  17216. "sessionID": {
  17217. "type": "string"
  17218. },
  17219. "reason": {
  17220. "type": "string",
  17221. "enum": ["auto", "manual"]
  17222. }
  17223. },
  17224. "required": ["timestamp", "sessionID", "reason"],
  17225. "additionalProperties": false
  17226. }
  17227. },
  17228. "required": ["id", "type", "properties"],
  17229. "additionalProperties": false
  17230. },
  17231. "EventSessionNextCompactionDelta": {
  17232. "type": "object",
  17233. "properties": {
  17234. "id": {
  17235. "type": "string"
  17236. },
  17237. "type": {
  17238. "type": "string",
  17239. "enum": ["session.next.compaction.delta"]
  17240. },
  17241. "properties": {
  17242. "type": "object",
  17243. "properties": {
  17244. "timestamp": {
  17245. "type": "number"
  17246. },
  17247. "sessionID": {
  17248. "type": "string"
  17249. },
  17250. "text": {
  17251. "type": "string"
  17252. }
  17253. },
  17254. "required": ["timestamp", "sessionID", "text"],
  17255. "additionalProperties": false
  17256. }
  17257. },
  17258. "required": ["id", "type", "properties"],
  17259. "additionalProperties": false
  17260. },
  17261. "EventSessionNextCompactionEnded": {
  17262. "type": "object",
  17263. "properties": {
  17264. "id": {
  17265. "type": "string"
  17266. },
  17267. "type": {
  17268. "type": "string",
  17269. "enum": ["session.next.compaction.ended"]
  17270. },
  17271. "properties": {
  17272. "type": "object",
  17273. "properties": {
  17274. "timestamp": {
  17275. "type": "number"
  17276. },
  17277. "sessionID": {
  17278. "type": "string"
  17279. },
  17280. "text": {
  17281. "type": "string"
  17282. },
  17283. "include": {
  17284. "type": "string"
  17285. }
  17286. },
  17287. "required": ["timestamp", "sessionID", "text"],
  17288. "additionalProperties": false
  17289. }
  17290. },
  17291. "required": ["id", "type", "properties"],
  17292. "additionalProperties": false
  17293. },
  17294. "EventServerConnected": {
  17295. "type": "object",
  17296. "properties": {
  17297. "id": {
  17298. "type": "string"
  17299. },
  17300. "type": {
  17301. "type": "string",
  17302. "enum": ["server.connected"]
  17303. },
  17304. "properties": {
  17305. "type": "object",
  17306. "properties": {}
  17307. }
  17308. },
  17309. "required": ["id", "type", "properties"],
  17310. "additionalProperties": false
  17311. },
  17312. "EventGlobalDisposed": {
  17313. "type": "object",
  17314. "properties": {
  17315. "id": {
  17316. "type": "string"
  17317. },
  17318. "type": {
  17319. "type": "string",
  17320. "enum": ["global.disposed"]
  17321. },
  17322. "properties": {
  17323. "type": "object",
  17324. "properties": {}
  17325. }
  17326. },
  17327. "required": ["id", "type", "properties"],
  17328. "additionalProperties": false
  17329. },
  17330. "SessionInfo": {
  17331. "type": "object",
  17332. "properties": {
  17333. "id": {
  17334. "type": "string"
  17335. },
  17336. "parentID": {
  17337. "type": "string"
  17338. },
  17339. "projectID": {
  17340. "type": "string"
  17341. },
  17342. "workspaceID": {
  17343. "type": "string"
  17344. },
  17345. "path": {
  17346. "type": "string"
  17347. },
  17348. "agent": {
  17349. "type": "string"
  17350. },
  17351. "model": {
  17352. "type": "object",
  17353. "properties": {
  17354. "id": {
  17355. "type": "string"
  17356. },
  17357. "providerID": {
  17358. "type": "string"
  17359. },
  17360. "variant": {
  17361. "type": "string"
  17362. }
  17363. },
  17364. "required": ["id", "providerID"],
  17365. "additionalProperties": false
  17366. },
  17367. "time": {
  17368. "type": "object",
  17369. "properties": {
  17370. "created": {
  17371. "type": "number"
  17372. },
  17373. "updated": {
  17374. "type": "number"
  17375. },
  17376. "archived": {
  17377. "type": "number"
  17378. }
  17379. },
  17380. "required": ["created", "updated"],
  17381. "additionalProperties": false
  17382. },
  17383. "title": {
  17384. "type": "string"
  17385. }
  17386. },
  17387. "required": ["id", "projectID", "time", "title"],
  17388. "additionalProperties": false
  17389. },
  17390. "SessionDelivery": {
  17391. "type": "string",
  17392. "enum": ["immediate", "deferred"]
  17393. },
  17394. "SessionMessageAgentSwitched": {
  17395. "type": "object",
  17396. "properties": {
  17397. "id": {
  17398. "type": "string"
  17399. },
  17400. "metadata": {
  17401. "type": "object"
  17402. },
  17403. "time": {
  17404. "type": "object",
  17405. "properties": {
  17406. "created": {
  17407. "type": "number"
  17408. }
  17409. },
  17410. "required": ["created"],
  17411. "additionalProperties": false
  17412. },
  17413. "type": {
  17414. "type": "string",
  17415. "enum": ["agent-switched"]
  17416. },
  17417. "agent": {
  17418. "type": "string"
  17419. }
  17420. },
  17421. "required": ["id", "time", "type", "agent"],
  17422. "additionalProperties": false
  17423. },
  17424. "SessionMessageModelSwitched": {
  17425. "type": "object",
  17426. "properties": {
  17427. "id": {
  17428. "type": "string"
  17429. },
  17430. "metadata": {
  17431. "type": "object"
  17432. },
  17433. "time": {
  17434. "type": "object",
  17435. "properties": {
  17436. "created": {
  17437. "type": "number"
  17438. }
  17439. },
  17440. "required": ["created"],
  17441. "additionalProperties": false
  17442. },
  17443. "type": {
  17444. "type": "string",
  17445. "enum": ["model-switched"]
  17446. },
  17447. "model": {
  17448. "type": "object",
  17449. "properties": {
  17450. "id": {
  17451. "type": "string"
  17452. },
  17453. "providerID": {
  17454. "type": "string"
  17455. },
  17456. "variant": {
  17457. "type": "string"
  17458. }
  17459. },
  17460. "required": ["id", "providerID"],
  17461. "additionalProperties": false
  17462. }
  17463. },
  17464. "required": ["id", "time", "type", "model"],
  17465. "additionalProperties": false
  17466. },
  17467. "SessionMessageUser": {
  17468. "type": "object",
  17469. "properties": {
  17470. "id": {
  17471. "type": "string"
  17472. },
  17473. "metadata": {
  17474. "type": "object"
  17475. },
  17476. "time": {
  17477. "type": "object",
  17478. "properties": {
  17479. "created": {
  17480. "type": "number"
  17481. }
  17482. },
  17483. "required": ["created"],
  17484. "additionalProperties": false
  17485. },
  17486. "text": {
  17487. "type": "string"
  17488. },
  17489. "files": {
  17490. "type": "array",
  17491. "items": {
  17492. "$ref": "#/components/schemas/PromptFileAttachment"
  17493. }
  17494. },
  17495. "agents": {
  17496. "type": "array",
  17497. "items": {
  17498. "$ref": "#/components/schemas/PromptAgentAttachment"
  17499. }
  17500. },
  17501. "type": {
  17502. "type": "string",
  17503. "enum": ["user"]
  17504. }
  17505. },
  17506. "required": ["id", "time", "text", "type"],
  17507. "additionalProperties": false
  17508. },
  17509. "SessionMessageSynthetic": {
  17510. "type": "object",
  17511. "properties": {
  17512. "id": {
  17513. "type": "string"
  17514. },
  17515. "metadata": {
  17516. "type": "object"
  17517. },
  17518. "time": {
  17519. "type": "object",
  17520. "properties": {
  17521. "created": {
  17522. "type": "number"
  17523. }
  17524. },
  17525. "required": ["created"],
  17526. "additionalProperties": false
  17527. },
  17528. "sessionID": {
  17529. "type": "string"
  17530. },
  17531. "text": {
  17532. "type": "string"
  17533. },
  17534. "type": {
  17535. "type": "string",
  17536. "enum": ["synthetic"]
  17537. }
  17538. },
  17539. "required": ["id", "time", "sessionID", "text", "type"],
  17540. "additionalProperties": false
  17541. },
  17542. "SessionMessageShell": {
  17543. "type": "object",
  17544. "properties": {
  17545. "id": {
  17546. "type": "string"
  17547. },
  17548. "metadata": {
  17549. "type": "object"
  17550. },
  17551. "time": {
  17552. "type": "object",
  17553. "properties": {
  17554. "created": {
  17555. "type": "number"
  17556. },
  17557. "completed": {
  17558. "type": "number"
  17559. }
  17560. },
  17561. "required": ["created"],
  17562. "additionalProperties": false
  17563. },
  17564. "type": {
  17565. "type": "string",
  17566. "enum": ["shell"]
  17567. },
  17568. "callID": {
  17569. "type": "string"
  17570. },
  17571. "command": {
  17572. "type": "string"
  17573. },
  17574. "output": {
  17575. "type": "string"
  17576. }
  17577. },
  17578. "required": ["id", "time", "type", "callID", "command", "output"],
  17579. "additionalProperties": false
  17580. },
  17581. "SessionMessageAssistantText": {
  17582. "type": "object",
  17583. "properties": {
  17584. "type": {
  17585. "type": "string",
  17586. "enum": ["text"]
  17587. },
  17588. "text": {
  17589. "type": "string"
  17590. }
  17591. },
  17592. "required": ["type", "text"],
  17593. "additionalProperties": false
  17594. },
  17595. "SessionMessageAssistantReasoning": {
  17596. "type": "object",
  17597. "properties": {
  17598. "type": {
  17599. "type": "string",
  17600. "enum": ["reasoning"]
  17601. },
  17602. "id": {
  17603. "type": "string"
  17604. },
  17605. "text": {
  17606. "type": "string"
  17607. }
  17608. },
  17609. "required": ["type", "id", "text"],
  17610. "additionalProperties": false
  17611. },
  17612. "SessionMessageToolStatePending": {
  17613. "type": "object",
  17614. "properties": {
  17615. "status": {
  17616. "type": "string",
  17617. "enum": ["pending"]
  17618. },
  17619. "input": {
  17620. "type": "string"
  17621. }
  17622. },
  17623. "required": ["status", "input"],
  17624. "additionalProperties": false
  17625. },
  17626. "SessionMessageToolStateRunning": {
  17627. "type": "object",
  17628. "properties": {
  17629. "status": {
  17630. "type": "string",
  17631. "enum": ["running"]
  17632. },
  17633. "input": {
  17634. "type": "object"
  17635. },
  17636. "structured": {
  17637. "type": "object"
  17638. },
  17639. "content": {
  17640. "type": "array",
  17641. "items": {
  17642. "anyOf": [
  17643. {
  17644. "$ref": "#/components/schemas/ToolTextContent"
  17645. },
  17646. {
  17647. "$ref": "#/components/schemas/ToolFileContent"
  17648. }
  17649. ]
  17650. }
  17651. }
  17652. },
  17653. "required": ["status", "input", "structured", "content"],
  17654. "additionalProperties": false
  17655. },
  17656. "SessionMessageToolStateCompleted": {
  17657. "type": "object",
  17658. "properties": {
  17659. "status": {
  17660. "type": "string",
  17661. "enum": ["completed"]
  17662. },
  17663. "input": {
  17664. "type": "object"
  17665. },
  17666. "attachments": {
  17667. "type": "array",
  17668. "items": {
  17669. "$ref": "#/components/schemas/PromptFileAttachment"
  17670. }
  17671. },
  17672. "content": {
  17673. "type": "array",
  17674. "items": {
  17675. "anyOf": [
  17676. {
  17677. "$ref": "#/components/schemas/ToolTextContent"
  17678. },
  17679. {
  17680. "$ref": "#/components/schemas/ToolFileContent"
  17681. }
  17682. ]
  17683. }
  17684. },
  17685. "structured": {
  17686. "type": "object"
  17687. }
  17688. },
  17689. "required": ["status", "input", "content", "structured"],
  17690. "additionalProperties": false
  17691. },
  17692. "SessionMessageToolStateError": {
  17693. "type": "object",
  17694. "properties": {
  17695. "status": {
  17696. "type": "string",
  17697. "enum": ["error"]
  17698. },
  17699. "input": {
  17700. "type": "object"
  17701. },
  17702. "content": {
  17703. "type": "array",
  17704. "items": {
  17705. "anyOf": [
  17706. {
  17707. "$ref": "#/components/schemas/ToolTextContent"
  17708. },
  17709. {
  17710. "$ref": "#/components/schemas/ToolFileContent"
  17711. }
  17712. ]
  17713. }
  17714. },
  17715. "structured": {
  17716. "type": "object"
  17717. },
  17718. "error": {
  17719. "type": "object",
  17720. "properties": {
  17721. "type": {
  17722. "type": "string"
  17723. },
  17724. "message": {
  17725. "type": "string"
  17726. }
  17727. },
  17728. "required": ["type", "message"],
  17729. "additionalProperties": false
  17730. }
  17731. },
  17732. "required": ["status", "input", "content", "structured", "error"],
  17733. "additionalProperties": false
  17734. },
  17735. "SessionMessageAssistantTool": {
  17736. "type": "object",
  17737. "properties": {
  17738. "type": {
  17739. "type": "string",
  17740. "enum": ["tool"]
  17741. },
  17742. "id": {
  17743. "type": "string"
  17744. },
  17745. "name": {
  17746. "type": "string"
  17747. },
  17748. "provider": {
  17749. "type": "object",
  17750. "properties": {
  17751. "executed": {
  17752. "type": "boolean"
  17753. },
  17754. "metadata": {
  17755. "type": "object"
  17756. }
  17757. },
  17758. "required": ["executed"],
  17759. "additionalProperties": false
  17760. },
  17761. "state": {
  17762. "anyOf": [
  17763. {
  17764. "$ref": "#/components/schemas/SessionMessageToolStatePending"
  17765. },
  17766. {
  17767. "$ref": "#/components/schemas/SessionMessageToolStateRunning"
  17768. },
  17769. {
  17770. "$ref": "#/components/schemas/SessionMessageToolStateCompleted"
  17771. },
  17772. {
  17773. "$ref": "#/components/schemas/SessionMessageToolStateError"
  17774. }
  17775. ]
  17776. },
  17777. "time": {
  17778. "type": "object",
  17779. "properties": {
  17780. "created": {
  17781. "type": "number"
  17782. },
  17783. "ran": {
  17784. "type": "number"
  17785. },
  17786. "completed": {
  17787. "type": "number"
  17788. },
  17789. "pruned": {
  17790. "type": "number"
  17791. }
  17792. },
  17793. "required": ["created"],
  17794. "additionalProperties": false
  17795. }
  17796. },
  17797. "required": ["type", "id", "name", "state", "time"],
  17798. "additionalProperties": false
  17799. },
  17800. "SessionMessageAssistant": {
  17801. "type": "object",
  17802. "properties": {
  17803. "id": {
  17804. "type": "string"
  17805. },
  17806. "metadata": {
  17807. "type": "object"
  17808. },
  17809. "time": {
  17810. "type": "object",
  17811. "properties": {
  17812. "created": {
  17813. "type": "number"
  17814. },
  17815. "completed": {
  17816. "type": "number"
  17817. }
  17818. },
  17819. "required": ["created"],
  17820. "additionalProperties": false
  17821. },
  17822. "type": {
  17823. "type": "string",
  17824. "enum": ["assistant"]
  17825. },
  17826. "agent": {
  17827. "type": "string"
  17828. },
  17829. "model": {
  17830. "type": "object",
  17831. "properties": {
  17832. "id": {
  17833. "type": "string"
  17834. },
  17835. "providerID": {
  17836. "type": "string"
  17837. },
  17838. "variant": {
  17839. "type": "string"
  17840. }
  17841. },
  17842. "required": ["id", "providerID"],
  17843. "additionalProperties": false
  17844. },
  17845. "content": {
  17846. "type": "array",
  17847. "items": {
  17848. "anyOf": [
  17849. {
  17850. "$ref": "#/components/schemas/SessionMessageAssistantText"
  17851. },
  17852. {
  17853. "$ref": "#/components/schemas/SessionMessageAssistantReasoning"
  17854. },
  17855. {
  17856. "$ref": "#/components/schemas/SessionMessageAssistantTool"
  17857. }
  17858. ]
  17859. }
  17860. },
  17861. "snapshot": {
  17862. "type": "object",
  17863. "properties": {
  17864. "start": {
  17865. "type": "string"
  17866. },
  17867. "end": {
  17868. "type": "string"
  17869. }
  17870. },
  17871. "additionalProperties": false
  17872. },
  17873. "finish": {
  17874. "type": "string"
  17875. },
  17876. "cost": {
  17877. "type": "number"
  17878. },
  17879. "tokens": {
  17880. "type": "object",
  17881. "properties": {
  17882. "input": {
  17883. "type": "number"
  17884. },
  17885. "output": {
  17886. "type": "number"
  17887. },
  17888. "reasoning": {
  17889. "type": "number"
  17890. },
  17891. "cache": {
  17892. "type": "object",
  17893. "properties": {
  17894. "read": {
  17895. "type": "number"
  17896. },
  17897. "write": {
  17898. "type": "number"
  17899. }
  17900. },
  17901. "required": ["read", "write"],
  17902. "additionalProperties": false
  17903. }
  17904. },
  17905. "required": ["input", "output", "reasoning", "cache"],
  17906. "additionalProperties": false
  17907. },
  17908. "error": {
  17909. "type": "object",
  17910. "properties": {
  17911. "type": {
  17912. "type": "string"
  17913. },
  17914. "message": {
  17915. "type": "string"
  17916. }
  17917. },
  17918. "required": ["type", "message"],
  17919. "additionalProperties": false
  17920. }
  17921. },
  17922. "required": ["id", "time", "type", "agent", "model", "content"],
  17923. "additionalProperties": false
  17924. },
  17925. "SessionMessageCompaction": {
  17926. "type": "object",
  17927. "properties": {
  17928. "type": {
  17929. "type": "string",
  17930. "enum": ["compaction"]
  17931. },
  17932. "reason": {
  17933. "type": "string",
  17934. "enum": ["auto", "manual"]
  17935. },
  17936. "summary": {
  17937. "type": "string"
  17938. },
  17939. "include": {
  17940. "type": "string"
  17941. },
  17942. "id": {
  17943. "type": "string"
  17944. },
  17945. "metadata": {
  17946. "type": "object"
  17947. },
  17948. "time": {
  17949. "type": "object",
  17950. "properties": {
  17951. "created": {
  17952. "type": "number"
  17953. }
  17954. },
  17955. "required": ["created"],
  17956. "additionalProperties": false
  17957. }
  17958. },
  17959. "required": ["type", "reason", "summary", "id", "time"],
  17960. "additionalProperties": false
  17961. },
  17962. "SessionMessage": {
  17963. "anyOf": [
  17964. {
  17965. "$ref": "#/components/schemas/SessionMessageAgentSwitched"
  17966. },
  17967. {
  17968. "$ref": "#/components/schemas/SessionMessageModelSwitched"
  17969. },
  17970. {
  17971. "$ref": "#/components/schemas/SessionMessageUser"
  17972. },
  17973. {
  17974. "$ref": "#/components/schemas/SessionMessageSynthetic"
  17975. },
  17976. {
  17977. "$ref": "#/components/schemas/SessionMessageShell"
  17978. },
  17979. {
  17980. "$ref": "#/components/schemas/SessionMessageAssistant"
  17981. },
  17982. {
  17983. "$ref": "#/components/schemas/SessionMessageCompaction"
  17984. }
  17985. ]
  17986. },
  17987. "EventTuiToastShow1": {
  17988. "type": "object",
  17989. "properties": {
  17990. "id": {
  17991. "type": "string"
  17992. },
  17993. "type": {
  17994. "type": "string",
  17995. "enum": ["tui.toast.show"]
  17996. },
  17997. "properties": {
  17998. "type": "object",
  17999. "properties": {
  18000. "title": {
  18001. "type": "string"
  18002. },
  18003. "message": {
  18004. "type": "string"
  18005. },
  18006. "variant": {
  18007. "type": "string",
  18008. "enum": ["info", "success", "warning", "error"]
  18009. },
  18010. "duration": {
  18011. "type": "integer",
  18012. "exclusiveMinimum": 0
  18013. }
  18014. },
  18015. "required": ["message", "variant"],
  18016. "additionalProperties": false
  18017. }
  18018. },
  18019. "required": ["id", "type", "properties"],
  18020. "additionalProperties": false
  18021. },
  18022. "BadRequestError": {
  18023. "type": "object",
  18024. "required": ["data", "errors", "success"],
  18025. "properties": {
  18026. "data": {},
  18027. "errors": {
  18028. "type": "array",
  18029. "items": {
  18030. "type": "object",
  18031. "additionalProperties": {}
  18032. }
  18033. },
  18034. "success": {
  18035. "type": "boolean",
  18036. "enum": [false]
  18037. }
  18038. }
  18039. },
  18040. "NotFoundError": {
  18041. "type": "object",
  18042. "required": ["name", "data"],
  18043. "properties": {
  18044. "name": {
  18045. "type": "string",
  18046. "enum": ["NotFoundError"]
  18047. },
  18048. "data": {
  18049. "type": "object",
  18050. "required": ["message"],
  18051. "properties": {
  18052. "message": {
  18053. "type": "string"
  18054. }
  18055. }
  18056. }
  18057. }
  18058. }
  18059. }
  18060. },
  18061. "security": [],
  18062. "tags": [
  18063. {
  18064. "name": "control",
  18065. "description": "Control plane routes."
  18066. },
  18067. {
  18068. "name": "global",
  18069. "description": "Global server routes."
  18070. },
  18071. {
  18072. "name": "event",
  18073. "description": "Instance event stream route."
  18074. },
  18075. {
  18076. "name": "config",
  18077. "description": "Experimental HttpApi config routes."
  18078. },
  18079. {
  18080. "name": "experimental",
  18081. "description": "Experimental HttpApi read-only routes."
  18082. },
  18083. {
  18084. "name": "file",
  18085. "description": "Experimental HttpApi file routes."
  18086. },
  18087. {
  18088. "name": "instance",
  18089. "description": "Experimental HttpApi instance read routes."
  18090. },
  18091. {
  18092. "name": "mcp",
  18093. "description": "Experimental HttpApi MCP routes."
  18094. },
  18095. {
  18096. "name": "project",
  18097. "description": "Experimental HttpApi project routes."
  18098. },
  18099. {
  18100. "name": "pty",
  18101. "description": "Experimental HttpApi PTY routes."
  18102. },
  18103. {
  18104. "name": "question",
  18105. "description": "Question routes."
  18106. },
  18107. {
  18108. "name": "permission",
  18109. "description": "Experimental HttpApi permission routes."
  18110. },
  18111. {
  18112. "name": "provider",
  18113. "description": "Experimental HttpApi provider routes."
  18114. },
  18115. {
  18116. "name": "session",
  18117. "description": "Experimental HttpApi session routes."
  18118. },
  18119. {
  18120. "name": "sync",
  18121. "description": "Experimental HttpApi sync routes."
  18122. },
  18123. {
  18124. "name": "v2",
  18125. "description": "Experimental v2 routes."
  18126. },
  18127. {
  18128. "name": "v2 messages",
  18129. "description": "Experimental v2 message routes."
  18130. },
  18131. {
  18132. "name": "tui",
  18133. "description": "Experimental HttpApi TUI routes."
  18134. },
  18135. {
  18136. "name": "workspace",
  18137. "description": "Experimental HttpApi workspace routes."
  18138. },
  18139. {
  18140. "name": "pty",
  18141. "description": "PTY websocket route."
  18142. }
  18143. ]
  18144. }