openapi.json 492 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134
  1. {
  2. "openapi": "3.1.0",
  3. "info": {
  4. "title": "opencode",
  5. "version": "1.0.0",
  6. "description": "opencode api"
  7. },
  8. "paths": {
  9. "/auth/{providerID}": {
  10. "put": {
  11. "tags": ["control"],
  12. "operationId": "auth.set",
  13. "parameters": [
  14. {
  15. "name": "providerID",
  16. "in": "path",
  17. "schema": {
  18. "type": "string"
  19. },
  20. "required": true
  21. }
  22. ],
  23. "responses": {
  24. "200": {
  25. "description": "Successfully set authentication credentials",
  26. "content": {
  27. "application/json": {
  28. "schema": {
  29. "type": "boolean",
  30. "description": "Successfully set authentication credentials"
  31. }
  32. }
  33. }
  34. },
  35. "400": {
  36. "description": "Bad request",
  37. "content": {
  38. "application/json": {
  39. "schema": {
  40. "$ref": "#/components/schemas/BadRequestError"
  41. }
  42. }
  43. }
  44. }
  45. },
  46. "description": "Set authentication credentials",
  47. "summary": "Set auth credentials",
  48. "requestBody": {
  49. "content": {
  50. "application/json": {
  51. "schema": {
  52. "$ref": "#/components/schemas/Auth"
  53. }
  54. }
  55. }
  56. },
  57. "x-codeSamples": [
  58. {
  59. "lang": "js",
  60. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.auth.set({\n ...\n})"
  61. }
  62. ]
  63. },
  64. "delete": {
  65. "tags": ["control"],
  66. "operationId": "auth.remove",
  67. "parameters": [
  68. {
  69. "name": "providerID",
  70. "in": "path",
  71. "schema": {
  72. "type": "string"
  73. },
  74. "required": true
  75. }
  76. ],
  77. "responses": {
  78. "200": {
  79. "description": "Successfully removed authentication credentials",
  80. "content": {
  81. "application/json": {
  82. "schema": {
  83. "type": "boolean",
  84. "description": "Successfully removed authentication credentials"
  85. }
  86. }
  87. }
  88. },
  89. "400": {
  90. "description": "Bad request",
  91. "content": {
  92. "application/json": {
  93. "schema": {
  94. "$ref": "#/components/schemas/BadRequestError"
  95. }
  96. }
  97. }
  98. }
  99. },
  100. "description": "Remove authentication credentials",
  101. "summary": "Remove auth credentials",
  102. "x-codeSamples": [
  103. {
  104. "lang": "js",
  105. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.auth.remove({\n ...\n})"
  106. }
  107. ]
  108. }
  109. },
  110. "/log": {
  111. "post": {
  112. "tags": ["control"],
  113. "operationId": "app.log",
  114. "parameters": [
  115. {
  116. "name": "directory",
  117. "in": "query",
  118. "required": false,
  119. "schema": {
  120. "type": "string"
  121. }
  122. },
  123. {
  124. "name": "workspace",
  125. "in": "query",
  126. "required": false,
  127. "schema": {
  128. "type": "string"
  129. }
  130. }
  131. ],
  132. "responses": {
  133. "200": {
  134. "description": "Log entry written successfully",
  135. "content": {
  136. "application/json": {
  137. "schema": {
  138. "type": "boolean",
  139. "description": "Log entry written successfully"
  140. }
  141. }
  142. }
  143. },
  144. "400": {
  145. "description": "Bad request",
  146. "content": {
  147. "application/json": {
  148. "schema": {
  149. "$ref": "#/components/schemas/BadRequestError"
  150. }
  151. }
  152. }
  153. }
  154. },
  155. "description": "Write a log entry to the server logs with specified level and metadata.",
  156. "summary": "Write log",
  157. "requestBody": {
  158. "content": {
  159. "application/json": {
  160. "schema": {
  161. "type": "object",
  162. "properties": {
  163. "service": {
  164. "type": "string",
  165. "description": "Service name for the log entry"
  166. },
  167. "level": {
  168. "type": "string",
  169. "enum": ["debug", "info", "error", "warn"],
  170. "description": "Log level"
  171. },
  172. "message": {
  173. "type": "string",
  174. "description": "Log message"
  175. },
  176. "extra": {
  177. "type": "object"
  178. }
  179. },
  180. "required": ["service", "level", "message"],
  181. "additionalProperties": false
  182. }
  183. }
  184. }
  185. },
  186. "x-codeSamples": [
  187. {
  188. "lang": "js",
  189. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.app.log({\n ...\n})"
  190. }
  191. ]
  192. }
  193. },
  194. "/global/health": {
  195. "get": {
  196. "tags": ["global"],
  197. "operationId": "global.health",
  198. "parameters": [],
  199. "responses": {
  200. "200": {
  201. "description": "Health information",
  202. "content": {
  203. "application/json": {
  204. "schema": {
  205. "type": "object",
  206. "properties": {
  207. "healthy": {
  208. "type": "boolean",
  209. "enum": [true]
  210. },
  211. "version": {
  212. "type": "string"
  213. }
  214. },
  215. "required": ["healthy", "version"],
  216. "additionalProperties": false,
  217. "description": "Health information"
  218. }
  219. }
  220. }
  221. }
  222. },
  223. "description": "Get health information about the OpenCode server.",
  224. "summary": "Get health",
  225. "x-codeSamples": [
  226. {
  227. "lang": "js",
  228. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.health({\n ...\n})"
  229. }
  230. ]
  231. }
  232. },
  233. "/global/event": {
  234. "get": {
  235. "tags": ["global"],
  236. "operationId": "global.event",
  237. "parameters": [],
  238. "responses": {
  239. "200": {
  240. "description": "Event stream",
  241. "content": {
  242. "text/event-stream": {
  243. "schema": {
  244. "$ref": "#/components/schemas/GlobalEvent"
  245. }
  246. }
  247. }
  248. }
  249. },
  250. "description": "Subscribe to global events from the OpenCode system using server-sent events.",
  251. "summary": "Get global events",
  252. "x-codeSamples": [
  253. {
  254. "lang": "js",
  255. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.event({\n ...\n})"
  256. }
  257. ]
  258. }
  259. },
  260. "/global/config": {
  261. "get": {
  262. "tags": ["global"],
  263. "operationId": "global.config.get",
  264. "parameters": [],
  265. "responses": {
  266. "200": {
  267. "description": "Get global config info",
  268. "content": {
  269. "application/json": {
  270. "schema": {
  271. "$ref": "#/components/schemas/Config"
  272. }
  273. }
  274. }
  275. }
  276. },
  277. "description": "Retrieve the current global OpenCode configuration settings and preferences.",
  278. "summary": "Get global configuration",
  279. "x-codeSamples": [
  280. {
  281. "lang": "js",
  282. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.config.get({\n ...\n})"
  283. }
  284. ]
  285. },
  286. "patch": {
  287. "tags": ["global"],
  288. "operationId": "global.config.update",
  289. "parameters": [],
  290. "responses": {
  291. "200": {
  292. "description": "Successfully updated global config",
  293. "content": {
  294. "application/json": {
  295. "schema": {
  296. "$ref": "#/components/schemas/Config"
  297. }
  298. }
  299. }
  300. },
  301. "400": {
  302. "description": "Bad request",
  303. "content": {
  304. "application/json": {
  305. "schema": {
  306. "$ref": "#/components/schemas/BadRequestError"
  307. }
  308. }
  309. }
  310. }
  311. },
  312. "description": "Update global OpenCode configuration settings and preferences.",
  313. "summary": "Update global configuration",
  314. "requestBody": {
  315. "content": {
  316. "application/json": {
  317. "schema": {
  318. "$ref": "#/components/schemas/Config"
  319. }
  320. }
  321. }
  322. },
  323. "x-codeSamples": [
  324. {
  325. "lang": "js",
  326. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.config.update({\n ...\n})"
  327. }
  328. ]
  329. }
  330. },
  331. "/global/dispose": {
  332. "post": {
  333. "tags": ["global"],
  334. "operationId": "global.dispose",
  335. "parameters": [],
  336. "responses": {
  337. "200": {
  338. "description": "Global disposed",
  339. "content": {
  340. "application/json": {
  341. "schema": {
  342. "type": "boolean",
  343. "description": "Global disposed"
  344. }
  345. }
  346. }
  347. }
  348. },
  349. "description": "Clean up and dispose all OpenCode instances, releasing all resources.",
  350. "summary": "Dispose instance",
  351. "x-codeSamples": [
  352. {
  353. "lang": "js",
  354. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.dispose({\n ...\n})"
  355. }
  356. ]
  357. }
  358. },
  359. "/global/upgrade": {
  360. "post": {
  361. "tags": ["global"],
  362. "operationId": "global.upgrade",
  363. "parameters": [],
  364. "responses": {
  365. "200": {
  366. "description": "Upgrade result",
  367. "content": {
  368. "application/json": {
  369. "schema": {
  370. "anyOf": [
  371. {
  372. "type": "object",
  373. "properties": {
  374. "success": {
  375. "type": "boolean",
  376. "enum": [true]
  377. },
  378. "version": {
  379. "type": "string"
  380. }
  381. },
  382. "required": ["success", "version"],
  383. "additionalProperties": false
  384. },
  385. {
  386. "type": "object",
  387. "properties": {
  388. "success": {
  389. "type": "boolean",
  390. "enum": [false]
  391. },
  392. "error": {
  393. "type": "string"
  394. }
  395. },
  396. "required": ["success", "error"],
  397. "additionalProperties": false
  398. }
  399. ],
  400. "description": "Upgrade result"
  401. }
  402. }
  403. }
  404. },
  405. "400": {
  406. "description": "Bad request",
  407. "content": {
  408. "application/json": {
  409. "schema": {
  410. "$ref": "#/components/schemas/BadRequestError"
  411. }
  412. }
  413. }
  414. }
  415. },
  416. "description": "Upgrade opencode to the specified version or latest if not specified.",
  417. "summary": "Upgrade opencode",
  418. "requestBody": {
  419. "content": {
  420. "application/json": {
  421. "schema": {
  422. "type": "object",
  423. "properties": {
  424. "target": {
  425. "type": "string"
  426. }
  427. },
  428. "additionalProperties": false
  429. }
  430. }
  431. }
  432. },
  433. "x-codeSamples": [
  434. {
  435. "lang": "js",
  436. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.upgrade({\n ...\n})"
  437. }
  438. ]
  439. }
  440. },
  441. "/event": {
  442. "get": {
  443. "tags": ["event"],
  444. "operationId": "event.subscribe",
  445. "parameters": [
  446. {
  447. "name": "directory",
  448. "in": "query",
  449. "required": false,
  450. "schema": {
  451. "type": "string"
  452. }
  453. },
  454. {
  455. "name": "workspace",
  456. "in": "query",
  457. "required": false,
  458. "schema": {
  459. "type": "string"
  460. }
  461. }
  462. ],
  463. "responses": {
  464. "200": {
  465. "description": "Event stream",
  466. "content": {
  467. "text/event-stream": {
  468. "schema": {
  469. "$ref": "#/components/schemas/Event"
  470. }
  471. }
  472. }
  473. }
  474. },
  475. "description": "Get events",
  476. "summary": "Subscribe to events",
  477. "x-codeSamples": [
  478. {
  479. "lang": "js",
  480. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.event.subscribe({\n ...\n})"
  481. }
  482. ]
  483. }
  484. },
  485. "/config": {
  486. "get": {
  487. "tags": ["config"],
  488. "operationId": "config.get",
  489. "parameters": [
  490. {
  491. "name": "directory",
  492. "in": "query",
  493. "required": false,
  494. "schema": {
  495. "type": "string"
  496. }
  497. },
  498. {
  499. "name": "workspace",
  500. "in": "query",
  501. "required": false,
  502. "schema": {
  503. "type": "string"
  504. }
  505. }
  506. ],
  507. "responses": {
  508. "200": {
  509. "description": "Get config info",
  510. "content": {
  511. "application/json": {
  512. "schema": {
  513. "$ref": "#/components/schemas/Config"
  514. }
  515. }
  516. }
  517. }
  518. },
  519. "description": "Retrieve the current OpenCode configuration settings and preferences.",
  520. "summary": "Get configuration",
  521. "x-codeSamples": [
  522. {
  523. "lang": "js",
  524. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.config.get({\n ...\n})"
  525. }
  526. ]
  527. },
  528. "patch": {
  529. "tags": ["config"],
  530. "operationId": "config.update",
  531. "parameters": [
  532. {
  533. "name": "directory",
  534. "in": "query",
  535. "required": false,
  536. "schema": {
  537. "type": "string"
  538. }
  539. },
  540. {
  541. "name": "workspace",
  542. "in": "query",
  543. "required": false,
  544. "schema": {
  545. "type": "string"
  546. }
  547. }
  548. ],
  549. "responses": {
  550. "200": {
  551. "description": "Successfully updated config",
  552. "content": {
  553. "application/json": {
  554. "schema": {
  555. "$ref": "#/components/schemas/Config"
  556. }
  557. }
  558. }
  559. },
  560. "400": {
  561. "description": "Bad request",
  562. "content": {
  563. "application/json": {
  564. "schema": {
  565. "$ref": "#/components/schemas/BadRequestError"
  566. }
  567. }
  568. }
  569. }
  570. },
  571. "description": "Update OpenCode configuration settings and preferences.",
  572. "summary": "Update configuration",
  573. "requestBody": {
  574. "content": {
  575. "application/json": {
  576. "schema": {
  577. "$ref": "#/components/schemas/Config"
  578. }
  579. }
  580. }
  581. },
  582. "x-codeSamples": [
  583. {
  584. "lang": "js",
  585. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.config.update({\n ...\n})"
  586. }
  587. ]
  588. }
  589. },
  590. "/config/providers": {
  591. "get": {
  592. "tags": ["config"],
  593. "operationId": "config.providers",
  594. "parameters": [
  595. {
  596. "name": "directory",
  597. "in": "query",
  598. "required": false,
  599. "schema": {
  600. "type": "string"
  601. }
  602. },
  603. {
  604. "name": "workspace",
  605. "in": "query",
  606. "required": false,
  607. "schema": {
  608. "type": "string"
  609. }
  610. }
  611. ],
  612. "responses": {
  613. "200": {
  614. "description": "List of providers",
  615. "content": {
  616. "application/json": {
  617. "schema": {
  618. "type": "object",
  619. "properties": {
  620. "providers": {
  621. "type": "array",
  622. "items": {
  623. "$ref": "#/components/schemas/Provider"
  624. }
  625. },
  626. "default": {
  627. "type": "object",
  628. "additionalProperties": {
  629. "type": "string"
  630. }
  631. }
  632. },
  633. "required": ["providers", "default"],
  634. "additionalProperties": false,
  635. "description": "List of providers"
  636. }
  637. }
  638. }
  639. }
  640. },
  641. "description": "Get a list of all configured AI providers and their default models.",
  642. "summary": "List config providers",
  643. "x-codeSamples": [
  644. {
  645. "lang": "js",
  646. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.config.providers({\n ...\n})"
  647. }
  648. ]
  649. }
  650. },
  651. "/experimental/console": {
  652. "get": {
  653. "tags": ["experimental"],
  654. "operationId": "experimental.console.get",
  655. "parameters": [
  656. {
  657. "name": "directory",
  658. "in": "query",
  659. "required": false,
  660. "schema": {
  661. "type": "string"
  662. }
  663. },
  664. {
  665. "name": "workspace",
  666. "in": "query",
  667. "required": false,
  668. "schema": {
  669. "type": "string"
  670. }
  671. }
  672. ],
  673. "responses": {
  674. "200": {
  675. "description": "Active Console provider metadata",
  676. "content": {
  677. "application/json": {
  678. "schema": {
  679. "$ref": "#/components/schemas/ConsoleState"
  680. }
  681. }
  682. }
  683. }
  684. },
  685. "description": "Get the active Console org name and the set of provider IDs managed by that Console org.",
  686. "summary": "Get active Console provider metadata",
  687. "x-codeSamples": [
  688. {
  689. "lang": "js",
  690. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.console.get({\n ...\n})"
  691. }
  692. ]
  693. }
  694. },
  695. "/experimental/console/orgs": {
  696. "get": {
  697. "tags": ["experimental"],
  698. "operationId": "experimental.console.listOrgs",
  699. "parameters": [
  700. {
  701. "name": "directory",
  702. "in": "query",
  703. "required": false,
  704. "schema": {
  705. "type": "string"
  706. }
  707. },
  708. {
  709. "name": "workspace",
  710. "in": "query",
  711. "required": false,
  712. "schema": {
  713. "type": "string"
  714. }
  715. }
  716. ],
  717. "responses": {
  718. "200": {
  719. "description": "Switchable Console orgs",
  720. "content": {
  721. "application/json": {
  722. "schema": {
  723. "type": "object",
  724. "properties": {
  725. "orgs": {
  726. "type": "array",
  727. "items": {
  728. "type": "object",
  729. "properties": {
  730. "accountID": {
  731. "type": "string"
  732. },
  733. "accountEmail": {
  734. "type": "string"
  735. },
  736. "accountUrl": {
  737. "type": "string"
  738. },
  739. "orgID": {
  740. "type": "string"
  741. },
  742. "orgName": {
  743. "type": "string"
  744. },
  745. "active": {
  746. "type": "boolean"
  747. }
  748. },
  749. "required": ["accountID", "accountEmail", "accountUrl", "orgID", "orgName", "active"],
  750. "additionalProperties": false
  751. }
  752. }
  753. },
  754. "required": ["orgs"],
  755. "additionalProperties": false,
  756. "description": "Switchable Console orgs"
  757. }
  758. }
  759. }
  760. }
  761. },
  762. "description": "Get the available Console orgs across logged-in accounts, including the current active org.",
  763. "summary": "List switchable Console orgs",
  764. "x-codeSamples": [
  765. {
  766. "lang": "js",
  767. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.console.listOrgs({\n ...\n})"
  768. }
  769. ]
  770. }
  771. },
  772. "/experimental/console/switch": {
  773. "post": {
  774. "tags": ["experimental"],
  775. "operationId": "experimental.console.switchOrg",
  776. "parameters": [
  777. {
  778. "name": "directory",
  779. "in": "query",
  780. "required": false,
  781. "schema": {
  782. "type": "string"
  783. }
  784. },
  785. {
  786. "name": "workspace",
  787. "in": "query",
  788. "required": false,
  789. "schema": {
  790. "type": "string"
  791. }
  792. }
  793. ],
  794. "responses": {
  795. "200": {
  796. "description": "Switch success",
  797. "content": {
  798. "application/json": {
  799. "schema": {
  800. "type": "boolean",
  801. "description": "Switch success"
  802. }
  803. }
  804. }
  805. }
  806. },
  807. "description": "Persist a new active Console account/org selection for the current local OpenCode state.",
  808. "summary": "Switch active Console org",
  809. "requestBody": {
  810. "content": {
  811. "application/json": {
  812. "schema": {
  813. "type": "object",
  814. "properties": {
  815. "accountID": {
  816. "type": "string"
  817. },
  818. "orgID": {
  819. "type": "string"
  820. }
  821. },
  822. "required": ["accountID", "orgID"],
  823. "additionalProperties": false
  824. }
  825. }
  826. }
  827. },
  828. "x-codeSamples": [
  829. {
  830. "lang": "js",
  831. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.console.switchOrg({\n ...\n})"
  832. }
  833. ]
  834. }
  835. },
  836. "/experimental/tool": {
  837. "get": {
  838. "tags": ["experimental"],
  839. "operationId": "tool.list",
  840. "parameters": [
  841. {
  842. "name": "directory",
  843. "in": "query",
  844. "required": false,
  845. "schema": {
  846. "type": "string"
  847. }
  848. },
  849. {
  850. "name": "workspace",
  851. "in": "query",
  852. "required": false,
  853. "schema": {
  854. "type": "string"
  855. }
  856. },
  857. {
  858. "name": "provider",
  859. "in": "query",
  860. "schema": {
  861. "type": "string"
  862. },
  863. "required": true
  864. },
  865. {
  866. "name": "model",
  867. "in": "query",
  868. "schema": {
  869. "type": "string"
  870. },
  871. "required": true
  872. }
  873. ],
  874. "responses": {
  875. "200": {
  876. "description": "Tools",
  877. "content": {
  878. "application/json": {
  879. "schema": {
  880. "$ref": "#/components/schemas/ToolList"
  881. }
  882. }
  883. }
  884. },
  885. "400": {
  886. "description": "Bad request",
  887. "content": {
  888. "application/json": {
  889. "schema": {
  890. "$ref": "#/components/schemas/BadRequestError"
  891. }
  892. }
  893. }
  894. }
  895. },
  896. "description": "Get a list of available tools with their JSON schema parameters for a specific provider and model combination.",
  897. "summary": "List tools",
  898. "x-codeSamples": [
  899. {
  900. "lang": "js",
  901. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tool.list({\n ...\n})"
  902. }
  903. ]
  904. }
  905. },
  906. "/experimental/tool/ids": {
  907. "get": {
  908. "tags": ["experimental"],
  909. "operationId": "tool.ids",
  910. "parameters": [
  911. {
  912. "name": "directory",
  913. "in": "query",
  914. "required": false,
  915. "schema": {
  916. "type": "string"
  917. }
  918. },
  919. {
  920. "name": "workspace",
  921. "in": "query",
  922. "required": false,
  923. "schema": {
  924. "type": "string"
  925. }
  926. }
  927. ],
  928. "responses": {
  929. "200": {
  930. "description": "Tool IDs",
  931. "content": {
  932. "application/json": {
  933. "schema": {
  934. "$ref": "#/components/schemas/ToolIDs"
  935. }
  936. }
  937. }
  938. },
  939. "400": {
  940. "description": "Bad request",
  941. "content": {
  942. "application/json": {
  943. "schema": {
  944. "$ref": "#/components/schemas/BadRequestError"
  945. }
  946. }
  947. }
  948. }
  949. },
  950. "description": "Get a list of all available tool IDs, including both built-in tools and dynamically registered tools.",
  951. "summary": "List tool IDs",
  952. "x-codeSamples": [
  953. {
  954. "lang": "js",
  955. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tool.ids({\n ...\n})"
  956. }
  957. ]
  958. }
  959. },
  960. "/experimental/worktree": {
  961. "get": {
  962. "tags": ["experimental"],
  963. "operationId": "worktree.list",
  964. "parameters": [
  965. {
  966. "name": "directory",
  967. "in": "query",
  968. "required": false,
  969. "schema": {
  970. "type": "string"
  971. }
  972. },
  973. {
  974. "name": "workspace",
  975. "in": "query",
  976. "required": false,
  977. "schema": {
  978. "type": "string"
  979. }
  980. }
  981. ],
  982. "responses": {
  983. "200": {
  984. "description": "List of worktree directories",
  985. "content": {
  986. "application/json": {
  987. "schema": {
  988. "type": "array",
  989. "items": {
  990. "type": "string"
  991. },
  992. "description": "List of worktree directories"
  993. }
  994. }
  995. }
  996. }
  997. },
  998. "description": "List all sandbox worktrees for the current project.",
  999. "summary": "List worktrees",
  1000. "x-codeSamples": [
  1001. {
  1002. "lang": "js",
  1003. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.list({\n ...\n})"
  1004. }
  1005. ]
  1006. },
  1007. "post": {
  1008. "tags": ["experimental"],
  1009. "operationId": "worktree.create",
  1010. "parameters": [
  1011. {
  1012. "name": "directory",
  1013. "in": "query",
  1014. "required": false,
  1015. "schema": {
  1016. "type": "string"
  1017. }
  1018. },
  1019. {
  1020. "name": "workspace",
  1021. "in": "query",
  1022. "required": false,
  1023. "schema": {
  1024. "type": "string"
  1025. }
  1026. }
  1027. ],
  1028. "responses": {
  1029. "200": {
  1030. "description": "Worktree created",
  1031. "content": {
  1032. "application/json": {
  1033. "schema": {
  1034. "$ref": "#/components/schemas/Worktree"
  1035. }
  1036. }
  1037. }
  1038. },
  1039. "400": {
  1040. "description": "Bad request",
  1041. "content": {
  1042. "application/json": {
  1043. "schema": {
  1044. "$ref": "#/components/schemas/BadRequestError"
  1045. }
  1046. }
  1047. }
  1048. }
  1049. },
  1050. "description": "Create a new git worktree for the current project and run any configured startup scripts.",
  1051. "summary": "Create worktree",
  1052. "requestBody": {
  1053. "content": {
  1054. "application/json": {
  1055. "schema": {
  1056. "$ref": "#/components/schemas/WorktreeCreateInput"
  1057. }
  1058. }
  1059. }
  1060. },
  1061. "x-codeSamples": [
  1062. {
  1063. "lang": "js",
  1064. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.create({\n ...\n})"
  1065. }
  1066. ]
  1067. },
  1068. "delete": {
  1069. "tags": ["experimental"],
  1070. "operationId": "worktree.remove",
  1071. "parameters": [
  1072. {
  1073. "name": "directory",
  1074. "in": "query",
  1075. "required": false,
  1076. "schema": {
  1077. "type": "string"
  1078. }
  1079. },
  1080. {
  1081. "name": "workspace",
  1082. "in": "query",
  1083. "required": false,
  1084. "schema": {
  1085. "type": "string"
  1086. }
  1087. }
  1088. ],
  1089. "responses": {
  1090. "200": {
  1091. "description": "Worktree removed",
  1092. "content": {
  1093. "application/json": {
  1094. "schema": {
  1095. "type": "boolean",
  1096. "description": "Worktree removed"
  1097. }
  1098. }
  1099. }
  1100. },
  1101. "400": {
  1102. "description": "Bad request",
  1103. "content": {
  1104. "application/json": {
  1105. "schema": {
  1106. "$ref": "#/components/schemas/BadRequestError"
  1107. }
  1108. }
  1109. }
  1110. }
  1111. },
  1112. "description": "Remove a git worktree and delete its branch.",
  1113. "summary": "Remove worktree",
  1114. "requestBody": {
  1115. "content": {
  1116. "application/json": {
  1117. "schema": {
  1118. "$ref": "#/components/schemas/WorktreeRemoveInput"
  1119. }
  1120. }
  1121. }
  1122. },
  1123. "x-codeSamples": [
  1124. {
  1125. "lang": "js",
  1126. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.remove({\n ...\n})"
  1127. }
  1128. ]
  1129. }
  1130. },
  1131. "/experimental/worktree/reset": {
  1132. "post": {
  1133. "tags": ["experimental"],
  1134. "operationId": "worktree.reset",
  1135. "parameters": [
  1136. {
  1137. "name": "directory",
  1138. "in": "query",
  1139. "required": false,
  1140. "schema": {
  1141. "type": "string"
  1142. }
  1143. },
  1144. {
  1145. "name": "workspace",
  1146. "in": "query",
  1147. "required": false,
  1148. "schema": {
  1149. "type": "string"
  1150. }
  1151. }
  1152. ],
  1153. "responses": {
  1154. "200": {
  1155. "description": "Worktree reset",
  1156. "content": {
  1157. "application/json": {
  1158. "schema": {
  1159. "type": "boolean",
  1160. "description": "Worktree reset"
  1161. }
  1162. }
  1163. }
  1164. },
  1165. "400": {
  1166. "description": "Bad request",
  1167. "content": {
  1168. "application/json": {
  1169. "schema": {
  1170. "$ref": "#/components/schemas/BadRequestError"
  1171. }
  1172. }
  1173. }
  1174. }
  1175. },
  1176. "description": "Reset a worktree branch to the primary default branch.",
  1177. "summary": "Reset worktree",
  1178. "requestBody": {
  1179. "content": {
  1180. "application/json": {
  1181. "schema": {
  1182. "$ref": "#/components/schemas/WorktreeResetInput"
  1183. }
  1184. }
  1185. }
  1186. },
  1187. "x-codeSamples": [
  1188. {
  1189. "lang": "js",
  1190. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.reset({\n ...\n})"
  1191. }
  1192. ]
  1193. }
  1194. },
  1195. "/experimental/session": {
  1196. "get": {
  1197. "tags": ["experimental"],
  1198. "operationId": "experimental.session.list",
  1199. "parameters": [
  1200. {
  1201. "name": "directory",
  1202. "in": "query",
  1203. "required": false,
  1204. "schema": {
  1205. "type": "string"
  1206. }
  1207. },
  1208. {
  1209. "name": "workspace",
  1210. "in": "query",
  1211. "required": false,
  1212. "schema": {
  1213. "type": "string"
  1214. }
  1215. },
  1216. {
  1217. "name": "roots",
  1218. "in": "query",
  1219. "schema": {
  1220. "anyOf": [
  1221. {
  1222. "type": "boolean"
  1223. },
  1224. {
  1225. "type": "string",
  1226. "enum": ["true", "false"]
  1227. }
  1228. ]
  1229. },
  1230. "required": false
  1231. },
  1232. {
  1233. "name": "start",
  1234. "in": "query",
  1235. "schema": {
  1236. "type": "number"
  1237. },
  1238. "required": false
  1239. },
  1240. {
  1241. "name": "cursor",
  1242. "in": "query",
  1243. "schema": {
  1244. "type": "number"
  1245. },
  1246. "required": false
  1247. },
  1248. {
  1249. "name": "search",
  1250. "in": "query",
  1251. "schema": {
  1252. "type": "string"
  1253. },
  1254. "required": false
  1255. },
  1256. {
  1257. "name": "limit",
  1258. "in": "query",
  1259. "schema": {
  1260. "type": "number"
  1261. },
  1262. "required": false
  1263. },
  1264. {
  1265. "name": "archived",
  1266. "in": "query",
  1267. "schema": {
  1268. "anyOf": [
  1269. {
  1270. "type": "boolean"
  1271. },
  1272. {
  1273. "type": "string",
  1274. "enum": ["true", "false"]
  1275. }
  1276. ]
  1277. },
  1278. "required": false
  1279. }
  1280. ],
  1281. "responses": {
  1282. "200": {
  1283. "description": "List of sessions",
  1284. "content": {
  1285. "application/json": {
  1286. "schema": {
  1287. "type": "array",
  1288. "items": {
  1289. "$ref": "#/components/schemas/GlobalSession"
  1290. },
  1291. "description": "List of sessions"
  1292. }
  1293. }
  1294. }
  1295. }
  1296. },
  1297. "description": "Get a list of all OpenCode sessions across projects, sorted by most recently updated. Archived sessions are excluded by default.",
  1298. "summary": "List sessions",
  1299. "x-codeSamples": [
  1300. {
  1301. "lang": "js",
  1302. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.session.list({\n ...\n})"
  1303. }
  1304. ]
  1305. }
  1306. },
  1307. "/experimental/resource": {
  1308. "get": {
  1309. "tags": ["experimental"],
  1310. "operationId": "experimental.resource.list",
  1311. "parameters": [
  1312. {
  1313. "name": "directory",
  1314. "in": "query",
  1315. "required": false,
  1316. "schema": {
  1317. "type": "string"
  1318. }
  1319. },
  1320. {
  1321. "name": "workspace",
  1322. "in": "query",
  1323. "required": false,
  1324. "schema": {
  1325. "type": "string"
  1326. }
  1327. }
  1328. ],
  1329. "responses": {
  1330. "200": {
  1331. "description": "MCP resources",
  1332. "content": {
  1333. "application/json": {
  1334. "schema": {
  1335. "type": "object",
  1336. "additionalProperties": {
  1337. "$ref": "#/components/schemas/McpResource"
  1338. },
  1339. "description": "MCP resources"
  1340. }
  1341. }
  1342. }
  1343. }
  1344. },
  1345. "description": "Get all available MCP resources from connected servers. Optionally filter by name.",
  1346. "summary": "Get MCP resources",
  1347. "x-codeSamples": [
  1348. {
  1349. "lang": "js",
  1350. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.resource.list({\n ...\n})"
  1351. }
  1352. ]
  1353. }
  1354. },
  1355. "/find": {
  1356. "get": {
  1357. "tags": ["file"],
  1358. "operationId": "find.text",
  1359. "parameters": [
  1360. {
  1361. "name": "directory",
  1362. "in": "query",
  1363. "required": false,
  1364. "schema": {
  1365. "type": "string"
  1366. }
  1367. },
  1368. {
  1369. "name": "workspace",
  1370. "in": "query",
  1371. "required": false,
  1372. "schema": {
  1373. "type": "string"
  1374. }
  1375. },
  1376. {
  1377. "name": "pattern",
  1378. "in": "query",
  1379. "schema": {
  1380. "type": "string"
  1381. },
  1382. "required": true
  1383. }
  1384. ],
  1385. "responses": {
  1386. "200": {
  1387. "description": "Matches",
  1388. "content": {
  1389. "application/json": {
  1390. "schema": {
  1391. "type": "array",
  1392. "items": {
  1393. "type": "object",
  1394. "properties": {
  1395. "path": {
  1396. "type": "object",
  1397. "properties": {
  1398. "text": {
  1399. "type": "string"
  1400. }
  1401. },
  1402. "required": ["text"],
  1403. "additionalProperties": false
  1404. },
  1405. "lines": {
  1406. "type": "object",
  1407. "properties": {
  1408. "text": {
  1409. "type": "string"
  1410. }
  1411. },
  1412. "required": ["text"],
  1413. "additionalProperties": false
  1414. },
  1415. "line_number": {
  1416. "type": "integer",
  1417. "minimum": 0
  1418. },
  1419. "absolute_offset": {
  1420. "type": "integer",
  1421. "minimum": 0
  1422. },
  1423. "submatches": {
  1424. "type": "array",
  1425. "items": {
  1426. "type": "object",
  1427. "properties": {
  1428. "match": {
  1429. "type": "object",
  1430. "properties": {
  1431. "text": {
  1432. "type": "string"
  1433. }
  1434. },
  1435. "required": ["text"],
  1436. "additionalProperties": false
  1437. },
  1438. "start": {
  1439. "type": "integer",
  1440. "minimum": 0
  1441. },
  1442. "end": {
  1443. "type": "integer",
  1444. "minimum": 0
  1445. }
  1446. },
  1447. "required": ["match", "start", "end"],
  1448. "additionalProperties": false
  1449. }
  1450. }
  1451. },
  1452. "required": ["path", "lines", "line_number", "absolute_offset", "submatches"],
  1453. "additionalProperties": false
  1454. },
  1455. "description": "Matches"
  1456. }
  1457. }
  1458. }
  1459. }
  1460. },
  1461. "description": "Search for text patterns across files in the project using ripgrep.",
  1462. "summary": "Find text",
  1463. "x-codeSamples": [
  1464. {
  1465. "lang": "js",
  1466. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.find.text({\n ...\n})"
  1467. }
  1468. ]
  1469. }
  1470. },
  1471. "/find/file": {
  1472. "get": {
  1473. "tags": ["file"],
  1474. "operationId": "find.files",
  1475. "parameters": [
  1476. {
  1477. "name": "directory",
  1478. "in": "query",
  1479. "required": false,
  1480. "schema": {
  1481. "type": "string"
  1482. }
  1483. },
  1484. {
  1485. "name": "workspace",
  1486. "in": "query",
  1487. "required": false,
  1488. "schema": {
  1489. "type": "string"
  1490. }
  1491. },
  1492. {
  1493. "name": "query",
  1494. "in": "query",
  1495. "schema": {
  1496. "type": "string"
  1497. },
  1498. "required": true
  1499. },
  1500. {
  1501. "name": "dirs",
  1502. "in": "query",
  1503. "schema": {
  1504. "type": "string",
  1505. "enum": ["true", "false"]
  1506. },
  1507. "required": false
  1508. },
  1509. {
  1510. "name": "type",
  1511. "in": "query",
  1512. "schema": {
  1513. "type": "string",
  1514. "enum": ["file", "directory"]
  1515. },
  1516. "required": false
  1517. },
  1518. {
  1519. "name": "limit",
  1520. "in": "query",
  1521. "schema": {
  1522. "type": "integer",
  1523. "minimum": 1,
  1524. "maximum": 200
  1525. },
  1526. "required": false
  1527. }
  1528. ],
  1529. "responses": {
  1530. "200": {
  1531. "description": "File paths",
  1532. "content": {
  1533. "application/json": {
  1534. "schema": {
  1535. "type": "array",
  1536. "items": {
  1537. "type": "string"
  1538. },
  1539. "description": "File paths"
  1540. }
  1541. }
  1542. }
  1543. }
  1544. },
  1545. "description": "Search for files or directories by name or pattern in the project directory.",
  1546. "summary": "Find files",
  1547. "x-codeSamples": [
  1548. {
  1549. "lang": "js",
  1550. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.find.files({\n ...\n})"
  1551. }
  1552. ]
  1553. }
  1554. },
  1555. "/find/symbol": {
  1556. "get": {
  1557. "tags": ["file"],
  1558. "operationId": "find.symbols",
  1559. "parameters": [
  1560. {
  1561. "name": "directory",
  1562. "in": "query",
  1563. "required": false,
  1564. "schema": {
  1565. "type": "string"
  1566. }
  1567. },
  1568. {
  1569. "name": "workspace",
  1570. "in": "query",
  1571. "required": false,
  1572. "schema": {
  1573. "type": "string"
  1574. }
  1575. },
  1576. {
  1577. "name": "query",
  1578. "in": "query",
  1579. "schema": {
  1580. "type": "string"
  1581. },
  1582. "required": true
  1583. }
  1584. ],
  1585. "responses": {
  1586. "200": {
  1587. "description": "Symbols",
  1588. "content": {
  1589. "application/json": {
  1590. "schema": {
  1591. "type": "array",
  1592. "items": {
  1593. "$ref": "#/components/schemas/Symbol"
  1594. },
  1595. "description": "Symbols"
  1596. }
  1597. }
  1598. }
  1599. }
  1600. },
  1601. "description": "Search for workspace symbols like functions, classes, and variables using LSP.",
  1602. "summary": "Find symbols",
  1603. "x-codeSamples": [
  1604. {
  1605. "lang": "js",
  1606. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.find.symbols({\n ...\n})"
  1607. }
  1608. ]
  1609. }
  1610. },
  1611. "/file": {
  1612. "get": {
  1613. "tags": ["file"],
  1614. "operationId": "file.list",
  1615. "parameters": [
  1616. {
  1617. "name": "directory",
  1618. "in": "query",
  1619. "required": false,
  1620. "schema": {
  1621. "type": "string"
  1622. }
  1623. },
  1624. {
  1625. "name": "workspace",
  1626. "in": "query",
  1627. "required": false,
  1628. "schema": {
  1629. "type": "string"
  1630. }
  1631. },
  1632. {
  1633. "name": "path",
  1634. "in": "query",
  1635. "schema": {
  1636. "type": "string"
  1637. },
  1638. "required": true
  1639. }
  1640. ],
  1641. "responses": {
  1642. "200": {
  1643. "description": "Files and directories",
  1644. "content": {
  1645. "application/json": {
  1646. "schema": {
  1647. "type": "array",
  1648. "items": {
  1649. "$ref": "#/components/schemas/FileNode"
  1650. },
  1651. "description": "Files and directories"
  1652. }
  1653. }
  1654. }
  1655. }
  1656. },
  1657. "description": "List files and directories in a specified path.",
  1658. "summary": "List files",
  1659. "x-codeSamples": [
  1660. {
  1661. "lang": "js",
  1662. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.file.list({\n ...\n})"
  1663. }
  1664. ]
  1665. }
  1666. },
  1667. "/file/content": {
  1668. "get": {
  1669. "tags": ["file"],
  1670. "operationId": "file.read",
  1671. "parameters": [
  1672. {
  1673. "name": "directory",
  1674. "in": "query",
  1675. "required": false,
  1676. "schema": {
  1677. "type": "string"
  1678. }
  1679. },
  1680. {
  1681. "name": "workspace",
  1682. "in": "query",
  1683. "required": false,
  1684. "schema": {
  1685. "type": "string"
  1686. }
  1687. },
  1688. {
  1689. "name": "path",
  1690. "in": "query",
  1691. "schema": {
  1692. "type": "string"
  1693. },
  1694. "required": true
  1695. }
  1696. ],
  1697. "responses": {
  1698. "200": {
  1699. "description": "File content",
  1700. "content": {
  1701. "application/json": {
  1702. "schema": {
  1703. "$ref": "#/components/schemas/FileContent"
  1704. }
  1705. }
  1706. }
  1707. }
  1708. },
  1709. "description": "Read the content of a specified file.",
  1710. "summary": "Read file",
  1711. "x-codeSamples": [
  1712. {
  1713. "lang": "js",
  1714. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.file.read({\n ...\n})"
  1715. }
  1716. ]
  1717. }
  1718. },
  1719. "/file/status": {
  1720. "get": {
  1721. "tags": ["file"],
  1722. "operationId": "file.status",
  1723. "parameters": [
  1724. {
  1725. "name": "directory",
  1726. "in": "query",
  1727. "required": false,
  1728. "schema": {
  1729. "type": "string"
  1730. }
  1731. },
  1732. {
  1733. "name": "workspace",
  1734. "in": "query",
  1735. "required": false,
  1736. "schema": {
  1737. "type": "string"
  1738. }
  1739. }
  1740. ],
  1741. "responses": {
  1742. "200": {
  1743. "description": "File status",
  1744. "content": {
  1745. "application/json": {
  1746. "schema": {
  1747. "type": "array",
  1748. "items": {
  1749. "$ref": "#/components/schemas/File"
  1750. },
  1751. "description": "File status"
  1752. }
  1753. }
  1754. }
  1755. }
  1756. },
  1757. "description": "Get the git status of all files in the project.",
  1758. "summary": "Get file status",
  1759. "x-codeSamples": [
  1760. {
  1761. "lang": "js",
  1762. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.file.status({\n ...\n})"
  1763. }
  1764. ]
  1765. }
  1766. },
  1767. "/instance/dispose": {
  1768. "post": {
  1769. "tags": ["instance"],
  1770. "operationId": "instance.dispose",
  1771. "parameters": [
  1772. {
  1773. "name": "directory",
  1774. "in": "query",
  1775. "required": false,
  1776. "schema": {
  1777. "type": "string"
  1778. }
  1779. },
  1780. {
  1781. "name": "workspace",
  1782. "in": "query",
  1783. "required": false,
  1784. "schema": {
  1785. "type": "string"
  1786. }
  1787. }
  1788. ],
  1789. "responses": {
  1790. "200": {
  1791. "description": "Instance disposed",
  1792. "content": {
  1793. "application/json": {
  1794. "schema": {
  1795. "type": "boolean",
  1796. "description": "Instance disposed"
  1797. }
  1798. }
  1799. }
  1800. }
  1801. },
  1802. "description": "Clean up and dispose the current OpenCode instance, releasing all resources.",
  1803. "summary": "Dispose instance",
  1804. "x-codeSamples": [
  1805. {
  1806. "lang": "js",
  1807. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.instance.dispose({\n ...\n})"
  1808. }
  1809. ]
  1810. }
  1811. },
  1812. "/path": {
  1813. "get": {
  1814. "tags": ["instance"],
  1815. "operationId": "path.get",
  1816. "parameters": [
  1817. {
  1818. "name": "directory",
  1819. "in": "query",
  1820. "required": false,
  1821. "schema": {
  1822. "type": "string"
  1823. }
  1824. },
  1825. {
  1826. "name": "workspace",
  1827. "in": "query",
  1828. "required": false,
  1829. "schema": {
  1830. "type": "string"
  1831. }
  1832. }
  1833. ],
  1834. "responses": {
  1835. "200": {
  1836. "description": "Path",
  1837. "content": {
  1838. "application/json": {
  1839. "schema": {
  1840. "$ref": "#/components/schemas/Path"
  1841. }
  1842. }
  1843. }
  1844. }
  1845. },
  1846. "description": "Retrieve the current working directory and related path information for the OpenCode instance.",
  1847. "summary": "Get paths",
  1848. "x-codeSamples": [
  1849. {
  1850. "lang": "js",
  1851. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.path.get({\n ...\n})"
  1852. }
  1853. ]
  1854. }
  1855. },
  1856. "/vcs": {
  1857. "get": {
  1858. "tags": ["instance"],
  1859. "operationId": "vcs.get",
  1860. "parameters": [
  1861. {
  1862. "name": "directory",
  1863. "in": "query",
  1864. "required": false,
  1865. "schema": {
  1866. "type": "string"
  1867. }
  1868. },
  1869. {
  1870. "name": "workspace",
  1871. "in": "query",
  1872. "required": false,
  1873. "schema": {
  1874. "type": "string"
  1875. }
  1876. }
  1877. ],
  1878. "responses": {
  1879. "200": {
  1880. "description": "VCS info",
  1881. "content": {
  1882. "application/json": {
  1883. "schema": {
  1884. "$ref": "#/components/schemas/VcsInfo"
  1885. }
  1886. }
  1887. }
  1888. }
  1889. },
  1890. "description": "Retrieve version control system (VCS) information for the current project, such as git branch.",
  1891. "summary": "Get VCS info",
  1892. "x-codeSamples": [
  1893. {
  1894. "lang": "js",
  1895. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.vcs.get({\n ...\n})"
  1896. }
  1897. ]
  1898. }
  1899. },
  1900. "/vcs/diff": {
  1901. "get": {
  1902. "tags": ["instance"],
  1903. "operationId": "vcs.diff",
  1904. "parameters": [
  1905. {
  1906. "name": "directory",
  1907. "in": "query",
  1908. "required": false,
  1909. "schema": {
  1910. "type": "string"
  1911. }
  1912. },
  1913. {
  1914. "name": "workspace",
  1915. "in": "query",
  1916. "required": false,
  1917. "schema": {
  1918. "type": "string"
  1919. }
  1920. },
  1921. {
  1922. "name": "mode",
  1923. "in": "query",
  1924. "schema": {
  1925. "type": "string",
  1926. "enum": ["git", "branch"]
  1927. },
  1928. "required": true
  1929. }
  1930. ],
  1931. "responses": {
  1932. "200": {
  1933. "description": "VCS diff",
  1934. "content": {
  1935. "application/json": {
  1936. "schema": {
  1937. "type": "array",
  1938. "items": {
  1939. "$ref": "#/components/schemas/VcsFileDiff"
  1940. },
  1941. "description": "VCS diff"
  1942. }
  1943. }
  1944. }
  1945. }
  1946. },
  1947. "description": "Retrieve the current git diff for the working tree or against the default branch.",
  1948. "summary": "Get VCS diff",
  1949. "x-codeSamples": [
  1950. {
  1951. "lang": "js",
  1952. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.vcs.diff({\n ...\n})"
  1953. }
  1954. ]
  1955. }
  1956. },
  1957. "/command": {
  1958. "get": {
  1959. "tags": ["instance"],
  1960. "operationId": "command.list",
  1961. "parameters": [
  1962. {
  1963. "name": "directory",
  1964. "in": "query",
  1965. "required": false,
  1966. "schema": {
  1967. "type": "string"
  1968. }
  1969. },
  1970. {
  1971. "name": "workspace",
  1972. "in": "query",
  1973. "required": false,
  1974. "schema": {
  1975. "type": "string"
  1976. }
  1977. }
  1978. ],
  1979. "responses": {
  1980. "200": {
  1981. "description": "List of commands",
  1982. "content": {
  1983. "application/json": {
  1984. "schema": {
  1985. "type": "array",
  1986. "items": {
  1987. "$ref": "#/components/schemas/Command"
  1988. },
  1989. "description": "List of commands"
  1990. }
  1991. }
  1992. }
  1993. }
  1994. },
  1995. "description": "Get a list of all available commands in the OpenCode system.",
  1996. "summary": "List commands",
  1997. "x-codeSamples": [
  1998. {
  1999. "lang": "js",
  2000. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.command.list({\n ...\n})"
  2001. }
  2002. ]
  2003. }
  2004. },
  2005. "/agent": {
  2006. "get": {
  2007. "tags": ["instance"],
  2008. "operationId": "app.agents",
  2009. "parameters": [
  2010. {
  2011. "name": "directory",
  2012. "in": "query",
  2013. "required": false,
  2014. "schema": {
  2015. "type": "string"
  2016. }
  2017. },
  2018. {
  2019. "name": "workspace",
  2020. "in": "query",
  2021. "required": false,
  2022. "schema": {
  2023. "type": "string"
  2024. }
  2025. }
  2026. ],
  2027. "responses": {
  2028. "200": {
  2029. "description": "List of agents",
  2030. "content": {
  2031. "application/json": {
  2032. "schema": {
  2033. "type": "array",
  2034. "items": {
  2035. "$ref": "#/components/schemas/Agent"
  2036. },
  2037. "description": "List of agents"
  2038. }
  2039. }
  2040. }
  2041. }
  2042. },
  2043. "description": "Get a list of all available AI agents in the OpenCode system.",
  2044. "summary": "List agents",
  2045. "x-codeSamples": [
  2046. {
  2047. "lang": "js",
  2048. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.app.agents({\n ...\n})"
  2049. }
  2050. ]
  2051. }
  2052. },
  2053. "/skill": {
  2054. "get": {
  2055. "tags": ["instance"],
  2056. "operationId": "app.skills",
  2057. "parameters": [
  2058. {
  2059. "name": "directory",
  2060. "in": "query",
  2061. "required": false,
  2062. "schema": {
  2063. "type": "string"
  2064. }
  2065. },
  2066. {
  2067. "name": "workspace",
  2068. "in": "query",
  2069. "required": false,
  2070. "schema": {
  2071. "type": "string"
  2072. }
  2073. }
  2074. ],
  2075. "responses": {
  2076. "200": {
  2077. "description": "List of skills",
  2078. "content": {
  2079. "application/json": {
  2080. "schema": {
  2081. "type": "array",
  2082. "items": {
  2083. "type": "object",
  2084. "properties": {
  2085. "name": {
  2086. "type": "string"
  2087. },
  2088. "description": {
  2089. "type": "string"
  2090. },
  2091. "location": {
  2092. "type": "string"
  2093. },
  2094. "content": {
  2095. "type": "string"
  2096. }
  2097. },
  2098. "required": ["name", "description", "location", "content"],
  2099. "additionalProperties": false
  2100. },
  2101. "description": "List of skills"
  2102. }
  2103. }
  2104. }
  2105. }
  2106. },
  2107. "description": "Get a list of all available skills in the OpenCode system.",
  2108. "summary": "List skills",
  2109. "x-codeSamples": [
  2110. {
  2111. "lang": "js",
  2112. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.app.skills({\n ...\n})"
  2113. }
  2114. ]
  2115. }
  2116. },
  2117. "/lsp": {
  2118. "get": {
  2119. "tags": ["instance"],
  2120. "operationId": "lsp.status",
  2121. "parameters": [
  2122. {
  2123. "name": "directory",
  2124. "in": "query",
  2125. "required": false,
  2126. "schema": {
  2127. "type": "string"
  2128. }
  2129. },
  2130. {
  2131. "name": "workspace",
  2132. "in": "query",
  2133. "required": false,
  2134. "schema": {
  2135. "type": "string"
  2136. }
  2137. }
  2138. ],
  2139. "responses": {
  2140. "200": {
  2141. "description": "LSP server status",
  2142. "content": {
  2143. "application/json": {
  2144. "schema": {
  2145. "type": "array",
  2146. "items": {
  2147. "$ref": "#/components/schemas/LSPStatus"
  2148. },
  2149. "description": "LSP server status"
  2150. }
  2151. }
  2152. }
  2153. }
  2154. },
  2155. "description": "Get LSP server status",
  2156. "summary": "Get LSP status",
  2157. "x-codeSamples": [
  2158. {
  2159. "lang": "js",
  2160. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.lsp.status({\n ...\n})"
  2161. }
  2162. ]
  2163. }
  2164. },
  2165. "/formatter": {
  2166. "get": {
  2167. "tags": ["instance"],
  2168. "operationId": "formatter.status",
  2169. "parameters": [
  2170. {
  2171. "name": "directory",
  2172. "in": "query",
  2173. "required": false,
  2174. "schema": {
  2175. "type": "string"
  2176. }
  2177. },
  2178. {
  2179. "name": "workspace",
  2180. "in": "query",
  2181. "required": false,
  2182. "schema": {
  2183. "type": "string"
  2184. }
  2185. }
  2186. ],
  2187. "responses": {
  2188. "200": {
  2189. "description": "Formatter status",
  2190. "content": {
  2191. "application/json": {
  2192. "schema": {
  2193. "type": "array",
  2194. "items": {
  2195. "$ref": "#/components/schemas/FormatterStatus"
  2196. },
  2197. "description": "Formatter status"
  2198. }
  2199. }
  2200. }
  2201. }
  2202. },
  2203. "description": "Get formatter status",
  2204. "summary": "Get formatter status",
  2205. "x-codeSamples": [
  2206. {
  2207. "lang": "js",
  2208. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.formatter.status({\n ...\n})"
  2209. }
  2210. ]
  2211. }
  2212. },
  2213. "/mcp": {
  2214. "get": {
  2215. "tags": ["mcp"],
  2216. "operationId": "mcp.status",
  2217. "parameters": [
  2218. {
  2219. "name": "directory",
  2220. "in": "query",
  2221. "required": false,
  2222. "schema": {
  2223. "type": "string"
  2224. }
  2225. },
  2226. {
  2227. "name": "workspace",
  2228. "in": "query",
  2229. "required": false,
  2230. "schema": {
  2231. "type": "string"
  2232. }
  2233. }
  2234. ],
  2235. "responses": {
  2236. "200": {
  2237. "description": "MCP server status",
  2238. "content": {
  2239. "application/json": {
  2240. "schema": {
  2241. "type": "object",
  2242. "additionalProperties": {
  2243. "$ref": "#/components/schemas/MCPStatus"
  2244. },
  2245. "description": "MCP server status"
  2246. }
  2247. }
  2248. }
  2249. }
  2250. },
  2251. "description": "Get the status of all Model Context Protocol (MCP) servers.",
  2252. "summary": "Get MCP status",
  2253. "x-codeSamples": [
  2254. {
  2255. "lang": "js",
  2256. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.status({\n ...\n})"
  2257. }
  2258. ]
  2259. },
  2260. "post": {
  2261. "tags": ["mcp"],
  2262. "operationId": "mcp.add",
  2263. "parameters": [
  2264. {
  2265. "name": "directory",
  2266. "in": "query",
  2267. "required": false,
  2268. "schema": {
  2269. "type": "string"
  2270. }
  2271. },
  2272. {
  2273. "name": "workspace",
  2274. "in": "query",
  2275. "required": false,
  2276. "schema": {
  2277. "type": "string"
  2278. }
  2279. }
  2280. ],
  2281. "responses": {
  2282. "200": {
  2283. "description": "MCP server added successfully",
  2284. "content": {
  2285. "application/json": {
  2286. "schema": {
  2287. "type": "object",
  2288. "additionalProperties": {
  2289. "$ref": "#/components/schemas/MCPStatus"
  2290. },
  2291. "description": "MCP server added successfully"
  2292. }
  2293. }
  2294. }
  2295. },
  2296. "400": {
  2297. "description": "Bad request",
  2298. "content": {
  2299. "application/json": {
  2300. "schema": {
  2301. "$ref": "#/components/schemas/BadRequestError"
  2302. }
  2303. }
  2304. }
  2305. }
  2306. },
  2307. "description": "Dynamically add a new Model Context Protocol (MCP) server to the system.",
  2308. "summary": "Add MCP server",
  2309. "requestBody": {
  2310. "content": {
  2311. "application/json": {
  2312. "schema": {
  2313. "type": "object",
  2314. "properties": {
  2315. "name": {
  2316. "type": "string"
  2317. },
  2318. "config": {
  2319. "anyOf": [
  2320. {
  2321. "$ref": "#/components/schemas/McpLocalConfig"
  2322. },
  2323. {
  2324. "$ref": "#/components/schemas/McpRemoteConfig"
  2325. }
  2326. ]
  2327. }
  2328. },
  2329. "required": ["name", "config"],
  2330. "additionalProperties": false
  2331. }
  2332. }
  2333. }
  2334. },
  2335. "x-codeSamples": [
  2336. {
  2337. "lang": "js",
  2338. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.add({\n ...\n})"
  2339. }
  2340. ]
  2341. }
  2342. },
  2343. "/mcp/{name}/auth": {
  2344. "post": {
  2345. "tags": ["mcp"],
  2346. "operationId": "mcp.auth.start",
  2347. "parameters": [
  2348. {
  2349. "name": "directory",
  2350. "in": "query",
  2351. "required": false,
  2352. "schema": {
  2353. "type": "string"
  2354. }
  2355. },
  2356. {
  2357. "name": "workspace",
  2358. "in": "query",
  2359. "required": false,
  2360. "schema": {
  2361. "type": "string"
  2362. }
  2363. },
  2364. {
  2365. "name": "name",
  2366. "in": "path",
  2367. "schema": {
  2368. "type": "string"
  2369. },
  2370. "required": true
  2371. }
  2372. ],
  2373. "responses": {
  2374. "200": {
  2375. "description": "OAuth flow started",
  2376. "content": {
  2377. "application/json": {
  2378. "schema": {
  2379. "type": "object",
  2380. "properties": {
  2381. "authorizationUrl": {
  2382. "type": "string"
  2383. },
  2384. "oauthState": {
  2385. "type": "string"
  2386. }
  2387. },
  2388. "required": ["authorizationUrl", "oauthState"],
  2389. "additionalProperties": false,
  2390. "description": "OAuth flow started"
  2391. }
  2392. }
  2393. }
  2394. },
  2395. "400": {
  2396. "description": "McpUnsupportedOAuthError",
  2397. "content": {
  2398. "application/json": {
  2399. "schema": {
  2400. "$ref": "#/components/schemas/McpUnsupportedOAuthError"
  2401. }
  2402. }
  2403. }
  2404. },
  2405. "404": {
  2406. "description": "Not found",
  2407. "content": {
  2408. "application/json": {
  2409. "schema": {
  2410. "$ref": "#/components/schemas/NotFoundError"
  2411. }
  2412. }
  2413. }
  2414. }
  2415. },
  2416. "description": "Start OAuth authentication flow for a Model Context Protocol (MCP) server.",
  2417. "summary": "Start MCP OAuth",
  2418. "x-codeSamples": [
  2419. {
  2420. "lang": "js",
  2421. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.start({\n ...\n})"
  2422. }
  2423. ]
  2424. },
  2425. "delete": {
  2426. "tags": ["mcp"],
  2427. "operationId": "mcp.auth.remove",
  2428. "parameters": [
  2429. {
  2430. "name": "directory",
  2431. "in": "query",
  2432. "required": false,
  2433. "schema": {
  2434. "type": "string"
  2435. }
  2436. },
  2437. {
  2438. "name": "workspace",
  2439. "in": "query",
  2440. "required": false,
  2441. "schema": {
  2442. "type": "string"
  2443. }
  2444. },
  2445. {
  2446. "name": "name",
  2447. "in": "path",
  2448. "schema": {
  2449. "type": "string"
  2450. },
  2451. "required": true
  2452. }
  2453. ],
  2454. "responses": {
  2455. "200": {
  2456. "description": "OAuth credentials removed",
  2457. "content": {
  2458. "application/json": {
  2459. "schema": {
  2460. "type": "object",
  2461. "properties": {
  2462. "success": {
  2463. "type": "boolean",
  2464. "enum": [true]
  2465. }
  2466. },
  2467. "required": ["success"],
  2468. "additionalProperties": false,
  2469. "description": "OAuth credentials removed"
  2470. }
  2471. }
  2472. }
  2473. },
  2474. "404": {
  2475. "description": "Not found",
  2476. "content": {
  2477. "application/json": {
  2478. "schema": {
  2479. "$ref": "#/components/schemas/NotFoundError"
  2480. }
  2481. }
  2482. }
  2483. }
  2484. },
  2485. "description": "Remove OAuth credentials for an MCP server.",
  2486. "summary": "Remove MCP OAuth",
  2487. "x-codeSamples": [
  2488. {
  2489. "lang": "js",
  2490. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.remove({\n ...\n})"
  2491. }
  2492. ]
  2493. }
  2494. },
  2495. "/mcp/{name}/auth/callback": {
  2496. "post": {
  2497. "tags": ["mcp"],
  2498. "operationId": "mcp.auth.callback",
  2499. "parameters": [
  2500. {
  2501. "name": "directory",
  2502. "in": "query",
  2503. "required": false,
  2504. "schema": {
  2505. "type": "string"
  2506. }
  2507. },
  2508. {
  2509. "name": "workspace",
  2510. "in": "query",
  2511. "required": false,
  2512. "schema": {
  2513. "type": "string"
  2514. }
  2515. },
  2516. {
  2517. "name": "name",
  2518. "in": "path",
  2519. "schema": {
  2520. "type": "string"
  2521. },
  2522. "required": true
  2523. }
  2524. ],
  2525. "responses": {
  2526. "200": {
  2527. "description": "OAuth authentication completed",
  2528. "content": {
  2529. "application/json": {
  2530. "schema": {
  2531. "$ref": "#/components/schemas/MCPStatus"
  2532. }
  2533. }
  2534. }
  2535. },
  2536. "400": {
  2537. "description": "Bad request",
  2538. "content": {
  2539. "application/json": {
  2540. "schema": {
  2541. "$ref": "#/components/schemas/BadRequestError"
  2542. }
  2543. }
  2544. }
  2545. },
  2546. "404": {
  2547. "description": "Not found",
  2548. "content": {
  2549. "application/json": {
  2550. "schema": {
  2551. "$ref": "#/components/schemas/NotFoundError"
  2552. }
  2553. }
  2554. }
  2555. }
  2556. },
  2557. "description": "Complete OAuth authentication for a Model Context Protocol (MCP) server using the authorization code.",
  2558. "summary": "Complete MCP OAuth",
  2559. "requestBody": {
  2560. "content": {
  2561. "application/json": {
  2562. "schema": {
  2563. "type": "object",
  2564. "properties": {
  2565. "code": {
  2566. "type": "string"
  2567. }
  2568. },
  2569. "required": ["code"],
  2570. "additionalProperties": false
  2571. }
  2572. }
  2573. }
  2574. },
  2575. "x-codeSamples": [
  2576. {
  2577. "lang": "js",
  2578. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.callback({\n ...\n})"
  2579. }
  2580. ]
  2581. }
  2582. },
  2583. "/mcp/{name}/auth/authenticate": {
  2584. "post": {
  2585. "tags": ["mcp"],
  2586. "operationId": "mcp.auth.authenticate",
  2587. "parameters": [
  2588. {
  2589. "name": "directory",
  2590. "in": "query",
  2591. "required": false,
  2592. "schema": {
  2593. "type": "string"
  2594. }
  2595. },
  2596. {
  2597. "name": "workspace",
  2598. "in": "query",
  2599. "required": false,
  2600. "schema": {
  2601. "type": "string"
  2602. }
  2603. },
  2604. {
  2605. "name": "name",
  2606. "in": "path",
  2607. "schema": {
  2608. "type": "string"
  2609. },
  2610. "required": true
  2611. }
  2612. ],
  2613. "responses": {
  2614. "200": {
  2615. "description": "OAuth authentication completed",
  2616. "content": {
  2617. "application/json": {
  2618. "schema": {
  2619. "$ref": "#/components/schemas/MCPStatus"
  2620. }
  2621. }
  2622. }
  2623. },
  2624. "400": {
  2625. "description": "McpUnsupportedOAuthError",
  2626. "content": {
  2627. "application/json": {
  2628. "schema": {
  2629. "$ref": "#/components/schemas/McpUnsupportedOAuthError"
  2630. }
  2631. }
  2632. }
  2633. },
  2634. "404": {
  2635. "description": "Not found",
  2636. "content": {
  2637. "application/json": {
  2638. "schema": {
  2639. "$ref": "#/components/schemas/NotFoundError"
  2640. }
  2641. }
  2642. }
  2643. }
  2644. },
  2645. "description": "Start OAuth flow and wait for callback (opens browser).",
  2646. "summary": "Authenticate MCP OAuth",
  2647. "x-codeSamples": [
  2648. {
  2649. "lang": "js",
  2650. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.authenticate({\n ...\n})"
  2651. }
  2652. ]
  2653. }
  2654. },
  2655. "/mcp/{name}/connect": {
  2656. "post": {
  2657. "tags": ["mcp"],
  2658. "operationId": "mcp.connect",
  2659. "parameters": [
  2660. {
  2661. "name": "directory",
  2662. "in": "query",
  2663. "required": false,
  2664. "schema": {
  2665. "type": "string"
  2666. }
  2667. },
  2668. {
  2669. "name": "workspace",
  2670. "in": "query",
  2671. "required": false,
  2672. "schema": {
  2673. "type": "string"
  2674. }
  2675. },
  2676. {
  2677. "name": "name",
  2678. "in": "path",
  2679. "schema": {
  2680. "type": "string"
  2681. },
  2682. "required": true
  2683. }
  2684. ],
  2685. "responses": {
  2686. "200": {
  2687. "description": "MCP server connected successfully",
  2688. "content": {
  2689. "application/json": {
  2690. "schema": {
  2691. "type": "boolean",
  2692. "description": "MCP server connected successfully"
  2693. }
  2694. }
  2695. }
  2696. }
  2697. },
  2698. "description": "Connect an MCP server.",
  2699. "x-codeSamples": [
  2700. {
  2701. "lang": "js",
  2702. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.connect({\n ...\n})"
  2703. }
  2704. ]
  2705. }
  2706. },
  2707. "/mcp/{name}/disconnect": {
  2708. "post": {
  2709. "tags": ["mcp"],
  2710. "operationId": "mcp.disconnect",
  2711. "parameters": [
  2712. {
  2713. "name": "directory",
  2714. "in": "query",
  2715. "required": false,
  2716. "schema": {
  2717. "type": "string"
  2718. }
  2719. },
  2720. {
  2721. "name": "workspace",
  2722. "in": "query",
  2723. "required": false,
  2724. "schema": {
  2725. "type": "string"
  2726. }
  2727. },
  2728. {
  2729. "name": "name",
  2730. "in": "path",
  2731. "schema": {
  2732. "type": "string"
  2733. },
  2734. "required": true
  2735. }
  2736. ],
  2737. "responses": {
  2738. "200": {
  2739. "description": "MCP server disconnected successfully",
  2740. "content": {
  2741. "application/json": {
  2742. "schema": {
  2743. "type": "boolean",
  2744. "description": "MCP server disconnected successfully"
  2745. }
  2746. }
  2747. }
  2748. }
  2749. },
  2750. "description": "Disconnect an MCP server.",
  2751. "x-codeSamples": [
  2752. {
  2753. "lang": "js",
  2754. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.disconnect({\n ...\n})"
  2755. }
  2756. ]
  2757. }
  2758. },
  2759. "/project": {
  2760. "get": {
  2761. "tags": ["project"],
  2762. "operationId": "project.list",
  2763. "parameters": [
  2764. {
  2765. "name": "directory",
  2766. "in": "query",
  2767. "required": false,
  2768. "schema": {
  2769. "type": "string"
  2770. }
  2771. },
  2772. {
  2773. "name": "workspace",
  2774. "in": "query",
  2775. "required": false,
  2776. "schema": {
  2777. "type": "string"
  2778. }
  2779. }
  2780. ],
  2781. "responses": {
  2782. "200": {
  2783. "description": "List of projects",
  2784. "content": {
  2785. "application/json": {
  2786. "schema": {
  2787. "type": "array",
  2788. "items": {
  2789. "$ref": "#/components/schemas/Project"
  2790. },
  2791. "description": "List of projects"
  2792. }
  2793. }
  2794. }
  2795. }
  2796. },
  2797. "description": "Get a list of projects that have been opened with OpenCode.",
  2798. "summary": "List all projects",
  2799. "x-codeSamples": [
  2800. {
  2801. "lang": "js",
  2802. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.list({\n ...\n})"
  2803. }
  2804. ]
  2805. }
  2806. },
  2807. "/project/current": {
  2808. "get": {
  2809. "tags": ["project"],
  2810. "operationId": "project.current",
  2811. "parameters": [
  2812. {
  2813. "name": "directory",
  2814. "in": "query",
  2815. "required": false,
  2816. "schema": {
  2817. "type": "string"
  2818. }
  2819. },
  2820. {
  2821. "name": "workspace",
  2822. "in": "query",
  2823. "required": false,
  2824. "schema": {
  2825. "type": "string"
  2826. }
  2827. }
  2828. ],
  2829. "responses": {
  2830. "200": {
  2831. "description": "Current project information",
  2832. "content": {
  2833. "application/json": {
  2834. "schema": {
  2835. "$ref": "#/components/schemas/Project"
  2836. }
  2837. }
  2838. }
  2839. }
  2840. },
  2841. "description": "Retrieve the currently active project that OpenCode is working with.",
  2842. "summary": "Get current project",
  2843. "x-codeSamples": [
  2844. {
  2845. "lang": "js",
  2846. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.current({\n ...\n})"
  2847. }
  2848. ]
  2849. }
  2850. },
  2851. "/project/git/init": {
  2852. "post": {
  2853. "tags": ["project"],
  2854. "operationId": "project.initGit",
  2855. "parameters": [
  2856. {
  2857. "name": "directory",
  2858. "in": "query",
  2859. "required": false,
  2860. "schema": {
  2861. "type": "string"
  2862. }
  2863. },
  2864. {
  2865. "name": "workspace",
  2866. "in": "query",
  2867. "required": false,
  2868. "schema": {
  2869. "type": "string"
  2870. }
  2871. }
  2872. ],
  2873. "responses": {
  2874. "200": {
  2875. "description": "Project information after git initialization",
  2876. "content": {
  2877. "application/json": {
  2878. "schema": {
  2879. "$ref": "#/components/schemas/Project"
  2880. }
  2881. }
  2882. }
  2883. }
  2884. },
  2885. "description": "Create a git repository for the current project and return the refreshed project info.",
  2886. "summary": "Initialize git repository",
  2887. "x-codeSamples": [
  2888. {
  2889. "lang": "js",
  2890. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.initGit({\n ...\n})"
  2891. }
  2892. ]
  2893. }
  2894. },
  2895. "/project/{projectID}": {
  2896. "patch": {
  2897. "tags": ["project"],
  2898. "operationId": "project.update",
  2899. "parameters": [
  2900. {
  2901. "name": "directory",
  2902. "in": "query",
  2903. "required": false,
  2904. "schema": {
  2905. "type": "string"
  2906. }
  2907. },
  2908. {
  2909. "name": "workspace",
  2910. "in": "query",
  2911. "required": false,
  2912. "schema": {
  2913. "type": "string"
  2914. }
  2915. },
  2916. {
  2917. "name": "projectID",
  2918. "in": "path",
  2919. "schema": {
  2920. "type": "string"
  2921. },
  2922. "required": true
  2923. }
  2924. ],
  2925. "responses": {
  2926. "200": {
  2927. "description": "Updated project information",
  2928. "content": {
  2929. "application/json": {
  2930. "schema": {
  2931. "$ref": "#/components/schemas/Project"
  2932. }
  2933. }
  2934. }
  2935. },
  2936. "400": {
  2937. "description": "Bad request",
  2938. "content": {
  2939. "application/json": {
  2940. "schema": {
  2941. "$ref": "#/components/schemas/BadRequestError"
  2942. }
  2943. }
  2944. }
  2945. },
  2946. "404": {
  2947. "description": "Not found",
  2948. "content": {
  2949. "application/json": {
  2950. "schema": {
  2951. "$ref": "#/components/schemas/NotFoundError"
  2952. }
  2953. }
  2954. }
  2955. }
  2956. },
  2957. "description": "Update project properties such as name, icon, and commands.",
  2958. "summary": "Update project",
  2959. "requestBody": {
  2960. "content": {
  2961. "application/json": {
  2962. "schema": {
  2963. "type": "object",
  2964. "properties": {
  2965. "name": {
  2966. "type": "string"
  2967. },
  2968. "icon": {
  2969. "type": "object",
  2970. "properties": {
  2971. "url": {
  2972. "type": "string"
  2973. },
  2974. "override": {
  2975. "type": "string"
  2976. },
  2977. "color": {
  2978. "type": "string"
  2979. }
  2980. },
  2981. "additionalProperties": false
  2982. },
  2983. "commands": {
  2984. "type": "object",
  2985. "properties": {
  2986. "start": {
  2987. "type": "string",
  2988. "description": "Startup script to run when creating a new workspace (worktree)"
  2989. }
  2990. },
  2991. "additionalProperties": false
  2992. }
  2993. },
  2994. "additionalProperties": false
  2995. }
  2996. }
  2997. }
  2998. },
  2999. "x-codeSamples": [
  3000. {
  3001. "lang": "js",
  3002. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.update({\n ...\n})"
  3003. }
  3004. ]
  3005. }
  3006. },
  3007. "/pty/shells": {
  3008. "get": {
  3009. "tags": ["pty"],
  3010. "operationId": "pty.shells",
  3011. "parameters": [
  3012. {
  3013. "name": "directory",
  3014. "in": "query",
  3015. "required": false,
  3016. "schema": {
  3017. "type": "string"
  3018. }
  3019. },
  3020. {
  3021. "name": "workspace",
  3022. "in": "query",
  3023. "required": false,
  3024. "schema": {
  3025. "type": "string"
  3026. }
  3027. }
  3028. ],
  3029. "responses": {
  3030. "200": {
  3031. "description": "List of shells",
  3032. "content": {
  3033. "application/json": {
  3034. "schema": {
  3035. "type": "array",
  3036. "items": {
  3037. "type": "object",
  3038. "properties": {
  3039. "path": {
  3040. "type": "string"
  3041. },
  3042. "name": {
  3043. "type": "string"
  3044. },
  3045. "acceptable": {
  3046. "type": "boolean"
  3047. }
  3048. },
  3049. "required": ["path", "name", "acceptable"],
  3050. "additionalProperties": false
  3051. },
  3052. "description": "List of shells"
  3053. }
  3054. }
  3055. }
  3056. }
  3057. },
  3058. "description": "Get a list of available shells on the system.",
  3059. "summary": "List available shells",
  3060. "x-codeSamples": [
  3061. {
  3062. "lang": "js",
  3063. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.shells({\n ...\n})"
  3064. }
  3065. ]
  3066. }
  3067. },
  3068. "/pty": {
  3069. "get": {
  3070. "tags": ["pty"],
  3071. "operationId": "pty.list",
  3072. "parameters": [
  3073. {
  3074. "name": "directory",
  3075. "in": "query",
  3076. "required": false,
  3077. "schema": {
  3078. "type": "string"
  3079. }
  3080. },
  3081. {
  3082. "name": "workspace",
  3083. "in": "query",
  3084. "required": false,
  3085. "schema": {
  3086. "type": "string"
  3087. }
  3088. }
  3089. ],
  3090. "responses": {
  3091. "200": {
  3092. "description": "List of sessions",
  3093. "content": {
  3094. "application/json": {
  3095. "schema": {
  3096. "type": "array",
  3097. "items": {
  3098. "$ref": "#/components/schemas/Pty"
  3099. },
  3100. "description": "List of sessions"
  3101. }
  3102. }
  3103. }
  3104. }
  3105. },
  3106. "description": "Get a list of all active pseudo-terminal (PTY) sessions managed by OpenCode.",
  3107. "summary": "List PTY sessions",
  3108. "x-codeSamples": [
  3109. {
  3110. "lang": "js",
  3111. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.list({\n ...\n})"
  3112. }
  3113. ]
  3114. },
  3115. "post": {
  3116. "tags": ["pty"],
  3117. "operationId": "pty.create",
  3118. "parameters": [
  3119. {
  3120. "name": "directory",
  3121. "in": "query",
  3122. "required": false,
  3123. "schema": {
  3124. "type": "string"
  3125. }
  3126. },
  3127. {
  3128. "name": "workspace",
  3129. "in": "query",
  3130. "required": false,
  3131. "schema": {
  3132. "type": "string"
  3133. }
  3134. }
  3135. ],
  3136. "responses": {
  3137. "200": {
  3138. "description": "Created session",
  3139. "content": {
  3140. "application/json": {
  3141. "schema": {
  3142. "$ref": "#/components/schemas/Pty"
  3143. }
  3144. }
  3145. }
  3146. },
  3147. "400": {
  3148. "description": "Bad request",
  3149. "content": {
  3150. "application/json": {
  3151. "schema": {
  3152. "$ref": "#/components/schemas/BadRequestError"
  3153. }
  3154. }
  3155. }
  3156. }
  3157. },
  3158. "description": "Create a new pseudo-terminal (PTY) session for running shell commands and processes.",
  3159. "summary": "Create PTY session",
  3160. "requestBody": {
  3161. "content": {
  3162. "application/json": {
  3163. "schema": {
  3164. "type": "object",
  3165. "properties": {
  3166. "command": {
  3167. "type": "string"
  3168. },
  3169. "args": {
  3170. "type": "array",
  3171. "items": {
  3172. "type": "string"
  3173. }
  3174. },
  3175. "cwd": {
  3176. "type": "string"
  3177. },
  3178. "title": {
  3179. "type": "string"
  3180. },
  3181. "env": {
  3182. "type": "object",
  3183. "additionalProperties": {
  3184. "type": "string"
  3185. }
  3186. }
  3187. },
  3188. "additionalProperties": false
  3189. }
  3190. }
  3191. }
  3192. },
  3193. "x-codeSamples": [
  3194. {
  3195. "lang": "js",
  3196. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.create({\n ...\n})"
  3197. }
  3198. ]
  3199. }
  3200. },
  3201. "/pty/{ptyID}": {
  3202. "get": {
  3203. "tags": ["pty"],
  3204. "operationId": "pty.get",
  3205. "parameters": [
  3206. {
  3207. "name": "directory",
  3208. "in": "query",
  3209. "required": false,
  3210. "schema": {
  3211. "type": "string"
  3212. }
  3213. },
  3214. {
  3215. "name": "workspace",
  3216. "in": "query",
  3217. "required": false,
  3218. "schema": {
  3219. "type": "string"
  3220. }
  3221. },
  3222. {
  3223. "name": "ptyID",
  3224. "in": "path",
  3225. "schema": {
  3226. "type": "string",
  3227. "pattern": "^pty.*"
  3228. },
  3229. "required": true
  3230. }
  3231. ],
  3232. "responses": {
  3233. "200": {
  3234. "description": "Session info",
  3235. "content": {
  3236. "application/json": {
  3237. "schema": {
  3238. "$ref": "#/components/schemas/Pty"
  3239. }
  3240. }
  3241. }
  3242. },
  3243. "404": {
  3244. "description": "Not found",
  3245. "content": {
  3246. "application/json": {
  3247. "schema": {
  3248. "$ref": "#/components/schemas/NotFoundError"
  3249. }
  3250. }
  3251. }
  3252. }
  3253. },
  3254. "description": "Retrieve detailed information about a specific pseudo-terminal (PTY) session.",
  3255. "summary": "Get PTY session",
  3256. "x-codeSamples": [
  3257. {
  3258. "lang": "js",
  3259. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.get({\n ...\n})"
  3260. }
  3261. ]
  3262. },
  3263. "put": {
  3264. "tags": ["pty"],
  3265. "operationId": "pty.update",
  3266. "parameters": [
  3267. {
  3268. "name": "directory",
  3269. "in": "query",
  3270. "required": false,
  3271. "schema": {
  3272. "type": "string"
  3273. }
  3274. },
  3275. {
  3276. "name": "workspace",
  3277. "in": "query",
  3278. "required": false,
  3279. "schema": {
  3280. "type": "string"
  3281. }
  3282. },
  3283. {
  3284. "name": "ptyID",
  3285. "in": "path",
  3286. "schema": {
  3287. "type": "string",
  3288. "pattern": "^pty.*"
  3289. },
  3290. "required": true
  3291. }
  3292. ],
  3293. "responses": {
  3294. "200": {
  3295. "description": "Updated session",
  3296. "content": {
  3297. "application/json": {
  3298. "schema": {
  3299. "$ref": "#/components/schemas/Pty"
  3300. }
  3301. }
  3302. }
  3303. },
  3304. "400": {
  3305. "description": "Bad request",
  3306. "content": {
  3307. "application/json": {
  3308. "schema": {
  3309. "$ref": "#/components/schemas/BadRequestError"
  3310. }
  3311. }
  3312. }
  3313. }
  3314. },
  3315. "description": "Update properties of an existing pseudo-terminal (PTY) session.",
  3316. "summary": "Update PTY session",
  3317. "requestBody": {
  3318. "content": {
  3319. "application/json": {
  3320. "schema": {
  3321. "type": "object",
  3322. "properties": {
  3323. "title": {
  3324. "type": "string"
  3325. },
  3326. "size": {
  3327. "type": "object",
  3328. "properties": {
  3329. "rows": {
  3330. "type": "integer",
  3331. "exclusiveMinimum": 0
  3332. },
  3333. "cols": {
  3334. "type": "integer",
  3335. "exclusiveMinimum": 0
  3336. }
  3337. },
  3338. "required": ["rows", "cols"],
  3339. "additionalProperties": false
  3340. }
  3341. },
  3342. "additionalProperties": false
  3343. }
  3344. }
  3345. }
  3346. },
  3347. "x-codeSamples": [
  3348. {
  3349. "lang": "js",
  3350. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.update({\n ...\n})"
  3351. }
  3352. ]
  3353. },
  3354. "delete": {
  3355. "tags": ["pty"],
  3356. "operationId": "pty.remove",
  3357. "parameters": [
  3358. {
  3359. "name": "directory",
  3360. "in": "query",
  3361. "required": false,
  3362. "schema": {
  3363. "type": "string"
  3364. }
  3365. },
  3366. {
  3367. "name": "workspace",
  3368. "in": "query",
  3369. "required": false,
  3370. "schema": {
  3371. "type": "string"
  3372. }
  3373. },
  3374. {
  3375. "name": "ptyID",
  3376. "in": "path",
  3377. "schema": {
  3378. "type": "string",
  3379. "pattern": "^pty.*"
  3380. },
  3381. "required": true
  3382. }
  3383. ],
  3384. "responses": {
  3385. "200": {
  3386. "description": "Session removed",
  3387. "content": {
  3388. "application/json": {
  3389. "schema": {
  3390. "type": "boolean",
  3391. "description": "Session removed"
  3392. }
  3393. }
  3394. }
  3395. },
  3396. "404": {
  3397. "description": "Not found",
  3398. "content": {
  3399. "application/json": {
  3400. "schema": {
  3401. "$ref": "#/components/schemas/NotFoundError"
  3402. }
  3403. }
  3404. }
  3405. }
  3406. },
  3407. "description": "Remove and terminate a specific pseudo-terminal (PTY) session.",
  3408. "summary": "Remove PTY session",
  3409. "x-codeSamples": [
  3410. {
  3411. "lang": "js",
  3412. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.remove({\n ...\n})"
  3413. }
  3414. ]
  3415. }
  3416. },
  3417. "/pty/{ptyID}/connect-token": {
  3418. "post": {
  3419. "tags": ["pty"],
  3420. "operationId": "pty.connectToken",
  3421. "parameters": [
  3422. {
  3423. "name": "directory",
  3424. "in": "query",
  3425. "required": false,
  3426. "schema": {
  3427. "type": "string"
  3428. }
  3429. },
  3430. {
  3431. "name": "workspace",
  3432. "in": "query",
  3433. "required": false,
  3434. "schema": {
  3435. "type": "string"
  3436. }
  3437. },
  3438. {
  3439. "name": "ptyID",
  3440. "in": "path",
  3441. "schema": {
  3442. "type": "string",
  3443. "pattern": "^pty.*"
  3444. },
  3445. "required": true
  3446. }
  3447. ],
  3448. "responses": {
  3449. "200": {
  3450. "description": "WebSocket connect token",
  3451. "content": {
  3452. "application/json": {
  3453. "schema": {
  3454. "type": "object",
  3455. "properties": {
  3456. "ticket": {
  3457. "type": "string"
  3458. },
  3459. "expires_in": {
  3460. "type": "integer",
  3461. "exclusiveMinimum": 0
  3462. }
  3463. },
  3464. "required": ["ticket", "expires_in"],
  3465. "additionalProperties": false,
  3466. "description": "WebSocket connect token"
  3467. }
  3468. }
  3469. }
  3470. },
  3471. "403": {
  3472. "description": "Forbidden",
  3473. "content": {
  3474. "application/json": {
  3475. "schema": {
  3476. "$ref": "#/components/schemas/effect_HttpApiError_Forbidden"
  3477. }
  3478. }
  3479. }
  3480. },
  3481. "404": {
  3482. "description": "Not found",
  3483. "content": {
  3484. "application/json": {
  3485. "schema": {
  3486. "$ref": "#/components/schemas/NotFoundError"
  3487. }
  3488. }
  3489. }
  3490. }
  3491. },
  3492. "description": "Create a short-lived ticket for opening a PTY WebSocket connection.",
  3493. "summary": "Create PTY WebSocket token",
  3494. "x-codeSamples": [
  3495. {
  3496. "lang": "js",
  3497. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.connectToken({\n ...\n})"
  3498. }
  3499. ]
  3500. }
  3501. },
  3502. "/question": {
  3503. "get": {
  3504. "tags": ["question"],
  3505. "operationId": "question.list",
  3506. "parameters": [
  3507. {
  3508. "name": "directory",
  3509. "in": "query",
  3510. "required": false,
  3511. "schema": {
  3512. "type": "string"
  3513. }
  3514. },
  3515. {
  3516. "name": "workspace",
  3517. "in": "query",
  3518. "required": false,
  3519. "schema": {
  3520. "type": "string"
  3521. }
  3522. }
  3523. ],
  3524. "responses": {
  3525. "200": {
  3526. "description": "List of pending questions",
  3527. "content": {
  3528. "application/json": {
  3529. "schema": {
  3530. "type": "array",
  3531. "items": {
  3532. "$ref": "#/components/schemas/QuestionRequest"
  3533. },
  3534. "description": "List of pending questions"
  3535. }
  3536. }
  3537. }
  3538. }
  3539. },
  3540. "description": "Get all pending question requests across all sessions.",
  3541. "summary": "List pending questions",
  3542. "x-codeSamples": [
  3543. {
  3544. "lang": "js",
  3545. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.question.list({\n ...\n})"
  3546. }
  3547. ]
  3548. }
  3549. },
  3550. "/question/{requestID}/reply": {
  3551. "post": {
  3552. "tags": ["question"],
  3553. "operationId": "question.reply",
  3554. "parameters": [
  3555. {
  3556. "name": "directory",
  3557. "in": "query",
  3558. "required": false,
  3559. "schema": {
  3560. "type": "string"
  3561. }
  3562. },
  3563. {
  3564. "name": "workspace",
  3565. "in": "query",
  3566. "required": false,
  3567. "schema": {
  3568. "type": "string"
  3569. }
  3570. },
  3571. {
  3572. "name": "requestID",
  3573. "in": "path",
  3574. "schema": {
  3575. "type": "string",
  3576. "pattern": "^que.*"
  3577. },
  3578. "required": true
  3579. }
  3580. ],
  3581. "responses": {
  3582. "200": {
  3583. "description": "Question answered successfully",
  3584. "content": {
  3585. "application/json": {
  3586. "schema": {
  3587. "type": "boolean",
  3588. "description": "Question answered successfully"
  3589. }
  3590. }
  3591. }
  3592. },
  3593. "400": {
  3594. "description": "Bad request",
  3595. "content": {
  3596. "application/json": {
  3597. "schema": {
  3598. "$ref": "#/components/schemas/BadRequestError"
  3599. }
  3600. }
  3601. }
  3602. },
  3603. "404": {
  3604. "description": "Not found",
  3605. "content": {
  3606. "application/json": {
  3607. "schema": {
  3608. "$ref": "#/components/schemas/NotFoundError"
  3609. }
  3610. }
  3611. }
  3612. }
  3613. },
  3614. "description": "Provide answers to a question request from the AI assistant.",
  3615. "summary": "Reply to question request",
  3616. "requestBody": {
  3617. "content": {
  3618. "application/json": {
  3619. "schema": {
  3620. "type": "object",
  3621. "properties": {
  3622. "answers": {
  3623. "type": "array",
  3624. "items": {
  3625. "$ref": "#/components/schemas/QuestionAnswer"
  3626. },
  3627. "description": "User answers in order of questions (each answer is an array of selected labels)"
  3628. }
  3629. },
  3630. "required": ["answers"],
  3631. "additionalProperties": false
  3632. }
  3633. }
  3634. }
  3635. },
  3636. "x-codeSamples": [
  3637. {
  3638. "lang": "js",
  3639. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.question.reply({\n ...\n})"
  3640. }
  3641. ]
  3642. }
  3643. },
  3644. "/question/{requestID}/reject": {
  3645. "post": {
  3646. "tags": ["question"],
  3647. "operationId": "question.reject",
  3648. "parameters": [
  3649. {
  3650. "name": "directory",
  3651. "in": "query",
  3652. "required": false,
  3653. "schema": {
  3654. "type": "string"
  3655. }
  3656. },
  3657. {
  3658. "name": "workspace",
  3659. "in": "query",
  3660. "required": false,
  3661. "schema": {
  3662. "type": "string"
  3663. }
  3664. },
  3665. {
  3666. "name": "requestID",
  3667. "in": "path",
  3668. "schema": {
  3669. "type": "string",
  3670. "pattern": "^que.*"
  3671. },
  3672. "required": true
  3673. }
  3674. ],
  3675. "responses": {
  3676. "200": {
  3677. "description": "Question rejected successfully",
  3678. "content": {
  3679. "application/json": {
  3680. "schema": {
  3681. "type": "boolean",
  3682. "description": "Question rejected successfully"
  3683. }
  3684. }
  3685. }
  3686. },
  3687. "400": {
  3688. "description": "Bad request",
  3689. "content": {
  3690. "application/json": {
  3691. "schema": {
  3692. "$ref": "#/components/schemas/BadRequestError"
  3693. }
  3694. }
  3695. }
  3696. },
  3697. "404": {
  3698. "description": "Not found",
  3699. "content": {
  3700. "application/json": {
  3701. "schema": {
  3702. "$ref": "#/components/schemas/NotFoundError"
  3703. }
  3704. }
  3705. }
  3706. }
  3707. },
  3708. "description": "Reject a question request from the AI assistant.",
  3709. "summary": "Reject question request",
  3710. "x-codeSamples": [
  3711. {
  3712. "lang": "js",
  3713. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.question.reject({\n ...\n})"
  3714. }
  3715. ]
  3716. }
  3717. },
  3718. "/permission": {
  3719. "get": {
  3720. "tags": ["permission"],
  3721. "operationId": "permission.list",
  3722. "parameters": [
  3723. {
  3724. "name": "directory",
  3725. "in": "query",
  3726. "required": false,
  3727. "schema": {
  3728. "type": "string"
  3729. }
  3730. },
  3731. {
  3732. "name": "workspace",
  3733. "in": "query",
  3734. "required": false,
  3735. "schema": {
  3736. "type": "string"
  3737. }
  3738. }
  3739. ],
  3740. "responses": {
  3741. "200": {
  3742. "description": "List of pending permissions",
  3743. "content": {
  3744. "application/json": {
  3745. "schema": {
  3746. "type": "array",
  3747. "items": {
  3748. "$ref": "#/components/schemas/PermissionRequest"
  3749. },
  3750. "description": "List of pending permissions"
  3751. }
  3752. }
  3753. }
  3754. }
  3755. },
  3756. "description": "Get all pending permission requests across all sessions.",
  3757. "summary": "List pending permissions",
  3758. "x-codeSamples": [
  3759. {
  3760. "lang": "js",
  3761. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.permission.list({\n ...\n})"
  3762. }
  3763. ]
  3764. }
  3765. },
  3766. "/permission/{requestID}/reply": {
  3767. "post": {
  3768. "tags": ["permission"],
  3769. "operationId": "permission.reply",
  3770. "parameters": [
  3771. {
  3772. "name": "directory",
  3773. "in": "query",
  3774. "required": false,
  3775. "schema": {
  3776. "type": "string"
  3777. }
  3778. },
  3779. {
  3780. "name": "workspace",
  3781. "in": "query",
  3782. "required": false,
  3783. "schema": {
  3784. "type": "string"
  3785. }
  3786. },
  3787. {
  3788. "name": "requestID",
  3789. "in": "path",
  3790. "schema": {
  3791. "type": "string",
  3792. "pattern": "^per.*"
  3793. },
  3794. "required": true
  3795. }
  3796. ],
  3797. "responses": {
  3798. "200": {
  3799. "description": "Permission processed successfully",
  3800. "content": {
  3801. "application/json": {
  3802. "schema": {
  3803. "type": "boolean",
  3804. "description": "Permission processed successfully"
  3805. }
  3806. }
  3807. }
  3808. },
  3809. "400": {
  3810. "description": "Bad request",
  3811. "content": {
  3812. "application/json": {
  3813. "schema": {
  3814. "$ref": "#/components/schemas/BadRequestError"
  3815. }
  3816. }
  3817. }
  3818. },
  3819. "404": {
  3820. "description": "Not found",
  3821. "content": {
  3822. "application/json": {
  3823. "schema": {
  3824. "$ref": "#/components/schemas/NotFoundError"
  3825. }
  3826. }
  3827. }
  3828. }
  3829. },
  3830. "description": "Approve or deny a permission request from the AI assistant.",
  3831. "summary": "Respond to permission request",
  3832. "requestBody": {
  3833. "content": {
  3834. "application/json": {
  3835. "schema": {
  3836. "type": "object",
  3837. "properties": {
  3838. "reply": {
  3839. "type": "string",
  3840. "enum": ["once", "always", "reject"]
  3841. },
  3842. "message": {
  3843. "type": "string"
  3844. }
  3845. },
  3846. "required": ["reply"],
  3847. "additionalProperties": false
  3848. }
  3849. }
  3850. }
  3851. },
  3852. "x-codeSamples": [
  3853. {
  3854. "lang": "js",
  3855. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.permission.reply({\n ...\n})"
  3856. }
  3857. ]
  3858. }
  3859. },
  3860. "/provider": {
  3861. "get": {
  3862. "tags": ["provider"],
  3863. "operationId": "provider.list",
  3864. "parameters": [
  3865. {
  3866. "name": "directory",
  3867. "in": "query",
  3868. "required": false,
  3869. "schema": {
  3870. "type": "string"
  3871. }
  3872. },
  3873. {
  3874. "name": "workspace",
  3875. "in": "query",
  3876. "required": false,
  3877. "schema": {
  3878. "type": "string"
  3879. }
  3880. }
  3881. ],
  3882. "responses": {
  3883. "200": {
  3884. "description": "List of providers",
  3885. "content": {
  3886. "application/json": {
  3887. "schema": {
  3888. "type": "object",
  3889. "properties": {
  3890. "all": {
  3891. "type": "array",
  3892. "items": {
  3893. "$ref": "#/components/schemas/Provider"
  3894. }
  3895. },
  3896. "default": {
  3897. "type": "object",
  3898. "additionalProperties": {
  3899. "type": "string"
  3900. }
  3901. },
  3902. "connected": {
  3903. "type": "array",
  3904. "items": {
  3905. "type": "string"
  3906. }
  3907. }
  3908. },
  3909. "required": ["all", "default", "connected"],
  3910. "additionalProperties": false,
  3911. "description": "List of providers"
  3912. }
  3913. }
  3914. }
  3915. }
  3916. },
  3917. "description": "Get a list of all available AI providers, including both available and connected ones.",
  3918. "summary": "List providers",
  3919. "x-codeSamples": [
  3920. {
  3921. "lang": "js",
  3922. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.list({\n ...\n})"
  3923. }
  3924. ]
  3925. }
  3926. },
  3927. "/provider/auth": {
  3928. "get": {
  3929. "tags": ["provider"],
  3930. "operationId": "provider.auth",
  3931. "parameters": [
  3932. {
  3933. "name": "directory",
  3934. "in": "query",
  3935. "required": false,
  3936. "schema": {
  3937. "type": "string"
  3938. }
  3939. },
  3940. {
  3941. "name": "workspace",
  3942. "in": "query",
  3943. "required": false,
  3944. "schema": {
  3945. "type": "string"
  3946. }
  3947. }
  3948. ],
  3949. "responses": {
  3950. "200": {
  3951. "description": "Provider auth methods",
  3952. "content": {
  3953. "application/json": {
  3954. "schema": {
  3955. "type": "object",
  3956. "additionalProperties": {
  3957. "type": "array",
  3958. "items": {
  3959. "$ref": "#/components/schemas/ProviderAuthMethod"
  3960. }
  3961. },
  3962. "description": "Provider auth methods"
  3963. }
  3964. }
  3965. }
  3966. }
  3967. },
  3968. "description": "Retrieve available authentication methods for all AI providers.",
  3969. "summary": "Get provider auth methods",
  3970. "x-codeSamples": [
  3971. {
  3972. "lang": "js",
  3973. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.auth({\n ...\n})"
  3974. }
  3975. ]
  3976. }
  3977. },
  3978. "/provider/{providerID}/oauth/authorize": {
  3979. "post": {
  3980. "tags": ["provider"],
  3981. "operationId": "provider.oauth.authorize",
  3982. "parameters": [
  3983. {
  3984. "name": "directory",
  3985. "in": "query",
  3986. "required": false,
  3987. "schema": {
  3988. "type": "string"
  3989. }
  3990. },
  3991. {
  3992. "name": "workspace",
  3993. "in": "query",
  3994. "required": false,
  3995. "schema": {
  3996. "type": "string"
  3997. }
  3998. },
  3999. {
  4000. "name": "providerID",
  4001. "in": "path",
  4002. "schema": {
  4003. "type": "string"
  4004. },
  4005. "required": true
  4006. }
  4007. ],
  4008. "responses": {
  4009. "200": {
  4010. "description": "Authorization URL and method",
  4011. "content": {
  4012. "application/json": {
  4013. "schema": {
  4014. "$ref": "#/components/schemas/ProviderAuthAuthorization"
  4015. }
  4016. }
  4017. }
  4018. },
  4019. "400": {
  4020. "description": "Bad request",
  4021. "content": {
  4022. "application/json": {
  4023. "schema": {
  4024. "$ref": "#/components/schemas/BadRequestError"
  4025. }
  4026. }
  4027. }
  4028. }
  4029. },
  4030. "description": "Start the OAuth authorization flow for a provider.",
  4031. "summary": "Start OAuth authorization",
  4032. "requestBody": {
  4033. "content": {
  4034. "application/json": {
  4035. "schema": {
  4036. "type": "object",
  4037. "properties": {
  4038. "method": {
  4039. "type": "number",
  4040. "description": "Auth method index"
  4041. },
  4042. "inputs": {
  4043. "type": "object",
  4044. "additionalProperties": {
  4045. "type": "string"
  4046. }
  4047. }
  4048. },
  4049. "required": ["method"],
  4050. "additionalProperties": false
  4051. }
  4052. }
  4053. }
  4054. },
  4055. "x-codeSamples": [
  4056. {
  4057. "lang": "js",
  4058. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.oauth.authorize({\n ...\n})"
  4059. }
  4060. ]
  4061. }
  4062. },
  4063. "/provider/{providerID}/oauth/callback": {
  4064. "post": {
  4065. "tags": ["provider"],
  4066. "operationId": "provider.oauth.callback",
  4067. "parameters": [
  4068. {
  4069. "name": "directory",
  4070. "in": "query",
  4071. "required": false,
  4072. "schema": {
  4073. "type": "string"
  4074. }
  4075. },
  4076. {
  4077. "name": "workspace",
  4078. "in": "query",
  4079. "required": false,
  4080. "schema": {
  4081. "type": "string"
  4082. }
  4083. },
  4084. {
  4085. "name": "providerID",
  4086. "in": "path",
  4087. "schema": {
  4088. "type": "string"
  4089. },
  4090. "required": true
  4091. }
  4092. ],
  4093. "responses": {
  4094. "200": {
  4095. "description": "OAuth callback processed successfully",
  4096. "content": {
  4097. "application/json": {
  4098. "schema": {
  4099. "type": "boolean",
  4100. "description": "OAuth callback processed successfully"
  4101. }
  4102. }
  4103. }
  4104. },
  4105. "400": {
  4106. "description": "Bad request",
  4107. "content": {
  4108. "application/json": {
  4109. "schema": {
  4110. "$ref": "#/components/schemas/BadRequestError"
  4111. }
  4112. }
  4113. }
  4114. }
  4115. },
  4116. "description": "Handle the OAuth callback from a provider after user authorization.",
  4117. "summary": "Handle OAuth callback",
  4118. "requestBody": {
  4119. "content": {
  4120. "application/json": {
  4121. "schema": {
  4122. "type": "object",
  4123. "properties": {
  4124. "method": {
  4125. "type": "number",
  4126. "description": "Auth method index"
  4127. },
  4128. "code": {
  4129. "type": "string"
  4130. }
  4131. },
  4132. "required": ["method"],
  4133. "additionalProperties": false
  4134. }
  4135. }
  4136. }
  4137. },
  4138. "x-codeSamples": [
  4139. {
  4140. "lang": "js",
  4141. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.oauth.callback({\n ...\n})"
  4142. }
  4143. ]
  4144. }
  4145. },
  4146. "/session": {
  4147. "get": {
  4148. "tags": ["session"],
  4149. "operationId": "session.list",
  4150. "parameters": [
  4151. {
  4152. "name": "directory",
  4153. "in": "query",
  4154. "required": false,
  4155. "schema": {
  4156. "type": "string"
  4157. }
  4158. },
  4159. {
  4160. "name": "workspace",
  4161. "in": "query",
  4162. "required": false,
  4163. "schema": {
  4164. "type": "string"
  4165. }
  4166. },
  4167. {
  4168. "name": "scope",
  4169. "in": "query",
  4170. "schema": {
  4171. "type": "string",
  4172. "enum": ["project"]
  4173. },
  4174. "required": false
  4175. },
  4176. {
  4177. "name": "path",
  4178. "in": "query",
  4179. "schema": {
  4180. "type": "string"
  4181. },
  4182. "required": false
  4183. },
  4184. {
  4185. "name": "roots",
  4186. "in": "query",
  4187. "schema": {
  4188. "anyOf": [
  4189. {
  4190. "type": "boolean"
  4191. },
  4192. {
  4193. "type": "string",
  4194. "enum": ["true", "false"]
  4195. }
  4196. ]
  4197. },
  4198. "required": false
  4199. },
  4200. {
  4201. "name": "start",
  4202. "in": "query",
  4203. "schema": {
  4204. "type": "number"
  4205. },
  4206. "required": false
  4207. },
  4208. {
  4209. "name": "search",
  4210. "in": "query",
  4211. "schema": {
  4212. "type": "string"
  4213. },
  4214. "required": false
  4215. },
  4216. {
  4217. "name": "limit",
  4218. "in": "query",
  4219. "schema": {
  4220. "type": "number"
  4221. },
  4222. "required": false
  4223. }
  4224. ],
  4225. "responses": {
  4226. "200": {
  4227. "description": "List of sessions",
  4228. "content": {
  4229. "application/json": {
  4230. "schema": {
  4231. "type": "array",
  4232. "items": {
  4233. "$ref": "#/components/schemas/Session"
  4234. },
  4235. "description": "List of sessions"
  4236. }
  4237. }
  4238. }
  4239. }
  4240. },
  4241. "description": "Get a list of all OpenCode sessions, sorted by most recently updated.",
  4242. "summary": "List sessions",
  4243. "x-codeSamples": [
  4244. {
  4245. "lang": "js",
  4246. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.list({\n ...\n})"
  4247. }
  4248. ]
  4249. },
  4250. "post": {
  4251. "tags": ["session"],
  4252. "operationId": "session.create",
  4253. "parameters": [
  4254. {
  4255. "name": "directory",
  4256. "in": "query",
  4257. "required": false,
  4258. "schema": {
  4259. "type": "string"
  4260. }
  4261. },
  4262. {
  4263. "name": "workspace",
  4264. "in": "query",
  4265. "required": false,
  4266. "schema": {
  4267. "type": "string"
  4268. }
  4269. }
  4270. ],
  4271. "responses": {
  4272. "200": {
  4273. "description": "Successfully created session",
  4274. "content": {
  4275. "application/json": {
  4276. "schema": {
  4277. "$ref": "#/components/schemas/Session"
  4278. }
  4279. }
  4280. }
  4281. },
  4282. "400": {
  4283. "description": "Bad request",
  4284. "content": {
  4285. "application/json": {
  4286. "schema": {
  4287. "$ref": "#/components/schemas/BadRequestError"
  4288. }
  4289. }
  4290. }
  4291. }
  4292. },
  4293. "description": "Create a new OpenCode session for interacting with AI assistants and managing conversations.",
  4294. "summary": "Create session",
  4295. "requestBody": {
  4296. "content": {
  4297. "application/json": {
  4298. "schema": {
  4299. "type": "object",
  4300. "properties": {
  4301. "parentID": {
  4302. "type": "string"
  4303. },
  4304. "title": {
  4305. "type": "string"
  4306. },
  4307. "agent": {
  4308. "type": "string"
  4309. },
  4310. "model": {
  4311. "type": "object",
  4312. "properties": {
  4313. "id": {
  4314. "type": "string"
  4315. },
  4316. "providerID": {
  4317. "type": "string"
  4318. },
  4319. "variant": {
  4320. "type": "string"
  4321. }
  4322. },
  4323. "required": ["id", "providerID"],
  4324. "additionalProperties": false
  4325. },
  4326. "permission": {
  4327. "$ref": "#/components/schemas/PermissionRuleset"
  4328. },
  4329. "workspaceID": {
  4330. "type": "string"
  4331. }
  4332. },
  4333. "additionalProperties": false
  4334. }
  4335. }
  4336. }
  4337. },
  4338. "x-codeSamples": [
  4339. {
  4340. "lang": "js",
  4341. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.create({\n ...\n})"
  4342. }
  4343. ]
  4344. }
  4345. },
  4346. "/session/status": {
  4347. "get": {
  4348. "tags": ["session"],
  4349. "operationId": "session.status",
  4350. "parameters": [
  4351. {
  4352. "name": "directory",
  4353. "in": "query",
  4354. "required": false,
  4355. "schema": {
  4356. "type": "string"
  4357. }
  4358. },
  4359. {
  4360. "name": "workspace",
  4361. "in": "query",
  4362. "required": false,
  4363. "schema": {
  4364. "type": "string"
  4365. }
  4366. }
  4367. ],
  4368. "responses": {
  4369. "200": {
  4370. "description": "Get session status",
  4371. "content": {
  4372. "application/json": {
  4373. "schema": {
  4374. "type": "object",
  4375. "additionalProperties": {
  4376. "$ref": "#/components/schemas/SessionStatus"
  4377. },
  4378. "description": "Get session status"
  4379. }
  4380. }
  4381. }
  4382. },
  4383. "400": {
  4384. "description": "Bad request",
  4385. "content": {
  4386. "application/json": {
  4387. "schema": {
  4388. "$ref": "#/components/schemas/BadRequestError"
  4389. }
  4390. }
  4391. }
  4392. }
  4393. },
  4394. "description": "Retrieve the current status of all sessions, including active, idle, and completed states.",
  4395. "summary": "Get session status",
  4396. "x-codeSamples": [
  4397. {
  4398. "lang": "js",
  4399. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.status({\n ...\n})"
  4400. }
  4401. ]
  4402. }
  4403. },
  4404. "/session/{sessionID}": {
  4405. "get": {
  4406. "tags": ["session"],
  4407. "operationId": "session.get",
  4408. "parameters": [
  4409. {
  4410. "name": "directory",
  4411. "in": "query",
  4412. "required": false,
  4413. "schema": {
  4414. "type": "string"
  4415. }
  4416. },
  4417. {
  4418. "name": "workspace",
  4419. "in": "query",
  4420. "required": false,
  4421. "schema": {
  4422. "type": "string"
  4423. }
  4424. },
  4425. {
  4426. "name": "sessionID",
  4427. "in": "path",
  4428. "schema": {
  4429. "type": "string",
  4430. "pattern": "^ses.*"
  4431. },
  4432. "required": true
  4433. }
  4434. ],
  4435. "responses": {
  4436. "200": {
  4437. "description": "Get session",
  4438. "content": {
  4439. "application/json": {
  4440. "schema": {
  4441. "$ref": "#/components/schemas/Session"
  4442. }
  4443. }
  4444. }
  4445. },
  4446. "400": {
  4447. "description": "Bad request",
  4448. "content": {
  4449. "application/json": {
  4450. "schema": {
  4451. "$ref": "#/components/schemas/BadRequestError"
  4452. }
  4453. }
  4454. }
  4455. },
  4456. "404": {
  4457. "description": "Not found",
  4458. "content": {
  4459. "application/json": {
  4460. "schema": {
  4461. "$ref": "#/components/schemas/NotFoundError"
  4462. }
  4463. }
  4464. }
  4465. }
  4466. },
  4467. "description": "Retrieve detailed information about a specific OpenCode session.",
  4468. "summary": "Get session",
  4469. "x-codeSamples": [
  4470. {
  4471. "lang": "js",
  4472. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.get({\n ...\n})"
  4473. }
  4474. ]
  4475. },
  4476. "delete": {
  4477. "tags": ["session"],
  4478. "operationId": "session.delete",
  4479. "parameters": [
  4480. {
  4481. "name": "directory",
  4482. "in": "query",
  4483. "required": false,
  4484. "schema": {
  4485. "type": "string"
  4486. }
  4487. },
  4488. {
  4489. "name": "workspace",
  4490. "in": "query",
  4491. "required": false,
  4492. "schema": {
  4493. "type": "string"
  4494. }
  4495. },
  4496. {
  4497. "name": "sessionID",
  4498. "in": "path",
  4499. "schema": {
  4500. "type": "string",
  4501. "pattern": "^ses.*"
  4502. },
  4503. "required": true
  4504. }
  4505. ],
  4506. "responses": {
  4507. "200": {
  4508. "description": "Successfully deleted session",
  4509. "content": {
  4510. "application/json": {
  4511. "schema": {
  4512. "type": "boolean",
  4513. "description": "Successfully deleted session"
  4514. }
  4515. }
  4516. }
  4517. },
  4518. "400": {
  4519. "description": "Bad request",
  4520. "content": {
  4521. "application/json": {
  4522. "schema": {
  4523. "$ref": "#/components/schemas/BadRequestError"
  4524. }
  4525. }
  4526. }
  4527. },
  4528. "404": {
  4529. "description": "Not found",
  4530. "content": {
  4531. "application/json": {
  4532. "schema": {
  4533. "$ref": "#/components/schemas/NotFoundError"
  4534. }
  4535. }
  4536. }
  4537. }
  4538. },
  4539. "description": "Delete a session and permanently remove all associated data, including messages and history.",
  4540. "summary": "Delete session",
  4541. "x-codeSamples": [
  4542. {
  4543. "lang": "js",
  4544. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.delete({\n ...\n})"
  4545. }
  4546. ]
  4547. },
  4548. "patch": {
  4549. "tags": ["session"],
  4550. "operationId": "session.update",
  4551. "parameters": [
  4552. {
  4553. "name": "directory",
  4554. "in": "query",
  4555. "required": false,
  4556. "schema": {
  4557. "type": "string"
  4558. }
  4559. },
  4560. {
  4561. "name": "workspace",
  4562. "in": "query",
  4563. "required": false,
  4564. "schema": {
  4565. "type": "string"
  4566. }
  4567. },
  4568. {
  4569. "name": "sessionID",
  4570. "in": "path",
  4571. "schema": {
  4572. "type": "string",
  4573. "pattern": "^ses.*"
  4574. },
  4575. "required": true
  4576. }
  4577. ],
  4578. "responses": {
  4579. "200": {
  4580. "description": "Successfully updated session",
  4581. "content": {
  4582. "application/json": {
  4583. "schema": {
  4584. "$ref": "#/components/schemas/Session"
  4585. }
  4586. }
  4587. }
  4588. },
  4589. "400": {
  4590. "description": "Bad request",
  4591. "content": {
  4592. "application/json": {
  4593. "schema": {
  4594. "$ref": "#/components/schemas/BadRequestError"
  4595. }
  4596. }
  4597. }
  4598. },
  4599. "404": {
  4600. "description": "Not found",
  4601. "content": {
  4602. "application/json": {
  4603. "schema": {
  4604. "$ref": "#/components/schemas/NotFoundError"
  4605. }
  4606. }
  4607. }
  4608. }
  4609. },
  4610. "description": "Update properties of an existing session, such as title or other metadata.",
  4611. "summary": "Update session",
  4612. "requestBody": {
  4613. "content": {
  4614. "application/json": {
  4615. "schema": {
  4616. "type": "object",
  4617. "properties": {
  4618. "title": {
  4619. "type": "string"
  4620. },
  4621. "permission": {
  4622. "$ref": "#/components/schemas/PermissionRuleset"
  4623. },
  4624. "time": {
  4625. "type": "object",
  4626. "properties": {
  4627. "archived": {
  4628. "type": "number"
  4629. }
  4630. },
  4631. "additionalProperties": false
  4632. }
  4633. },
  4634. "additionalProperties": false
  4635. }
  4636. }
  4637. }
  4638. },
  4639. "x-codeSamples": [
  4640. {
  4641. "lang": "js",
  4642. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.update({\n ...\n})"
  4643. }
  4644. ]
  4645. }
  4646. },
  4647. "/session/{sessionID}/children": {
  4648. "get": {
  4649. "tags": ["session"],
  4650. "operationId": "session.children",
  4651. "parameters": [
  4652. {
  4653. "name": "directory",
  4654. "in": "query",
  4655. "required": false,
  4656. "schema": {
  4657. "type": "string"
  4658. }
  4659. },
  4660. {
  4661. "name": "workspace",
  4662. "in": "query",
  4663. "required": false,
  4664. "schema": {
  4665. "type": "string"
  4666. }
  4667. },
  4668. {
  4669. "name": "sessionID",
  4670. "in": "path",
  4671. "schema": {
  4672. "type": "string",
  4673. "pattern": "^ses.*"
  4674. },
  4675. "required": true
  4676. }
  4677. ],
  4678. "responses": {
  4679. "200": {
  4680. "description": "List of children",
  4681. "content": {
  4682. "application/json": {
  4683. "schema": {
  4684. "type": "array",
  4685. "items": {
  4686. "$ref": "#/components/schemas/Session"
  4687. },
  4688. "description": "List of children"
  4689. }
  4690. }
  4691. }
  4692. },
  4693. "400": {
  4694. "description": "Bad request",
  4695. "content": {
  4696. "application/json": {
  4697. "schema": {
  4698. "$ref": "#/components/schemas/BadRequestError"
  4699. }
  4700. }
  4701. }
  4702. },
  4703. "404": {
  4704. "description": "Not found",
  4705. "content": {
  4706. "application/json": {
  4707. "schema": {
  4708. "$ref": "#/components/schemas/NotFoundError"
  4709. }
  4710. }
  4711. }
  4712. }
  4713. },
  4714. "description": "Retrieve all child sessions that were forked from the specified parent session.",
  4715. "summary": "Get session children",
  4716. "x-codeSamples": [
  4717. {
  4718. "lang": "js",
  4719. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.children({\n ...\n})"
  4720. }
  4721. ]
  4722. }
  4723. },
  4724. "/session/{sessionID}/todo": {
  4725. "get": {
  4726. "tags": ["session"],
  4727. "operationId": "session.todo",
  4728. "parameters": [
  4729. {
  4730. "name": "directory",
  4731. "in": "query",
  4732. "required": false,
  4733. "schema": {
  4734. "type": "string"
  4735. }
  4736. },
  4737. {
  4738. "name": "workspace",
  4739. "in": "query",
  4740. "required": false,
  4741. "schema": {
  4742. "type": "string"
  4743. }
  4744. },
  4745. {
  4746. "name": "sessionID",
  4747. "in": "path",
  4748. "schema": {
  4749. "type": "string",
  4750. "pattern": "^ses.*"
  4751. },
  4752. "required": true
  4753. }
  4754. ],
  4755. "responses": {
  4756. "200": {
  4757. "description": "Todo list",
  4758. "content": {
  4759. "application/json": {
  4760. "schema": {
  4761. "type": "array",
  4762. "items": {
  4763. "$ref": "#/components/schemas/Todo"
  4764. },
  4765. "description": "Todo list"
  4766. }
  4767. }
  4768. }
  4769. },
  4770. "400": {
  4771. "description": "Bad request",
  4772. "content": {
  4773. "application/json": {
  4774. "schema": {
  4775. "$ref": "#/components/schemas/BadRequestError"
  4776. }
  4777. }
  4778. }
  4779. },
  4780. "404": {
  4781. "description": "Not found",
  4782. "content": {
  4783. "application/json": {
  4784. "schema": {
  4785. "$ref": "#/components/schemas/NotFoundError"
  4786. }
  4787. }
  4788. }
  4789. }
  4790. },
  4791. "description": "Retrieve the todo list associated with a specific session, showing tasks and action items.",
  4792. "summary": "Get session todos",
  4793. "x-codeSamples": [
  4794. {
  4795. "lang": "js",
  4796. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.todo({\n ...\n})"
  4797. }
  4798. ]
  4799. }
  4800. },
  4801. "/session/{sessionID}/diff": {
  4802. "get": {
  4803. "tags": ["session"],
  4804. "operationId": "session.diff",
  4805. "parameters": [
  4806. {
  4807. "name": "directory",
  4808. "in": "query",
  4809. "required": false,
  4810. "schema": {
  4811. "type": "string"
  4812. }
  4813. },
  4814. {
  4815. "name": "workspace",
  4816. "in": "query",
  4817. "required": false,
  4818. "schema": {
  4819. "type": "string"
  4820. }
  4821. },
  4822. {
  4823. "name": "sessionID",
  4824. "in": "path",
  4825. "schema": {
  4826. "type": "string",
  4827. "pattern": "^ses.*"
  4828. },
  4829. "required": true
  4830. },
  4831. {
  4832. "name": "messageID",
  4833. "in": "query",
  4834. "schema": {
  4835. "type": "string",
  4836. "pattern": "^msg.*"
  4837. },
  4838. "required": false
  4839. }
  4840. ],
  4841. "responses": {
  4842. "200": {
  4843. "description": "Successfully retrieved diff",
  4844. "content": {
  4845. "application/json": {
  4846. "schema": {
  4847. "type": "array",
  4848. "items": {
  4849. "$ref": "#/components/schemas/SnapshotFileDiff"
  4850. },
  4851. "description": "Successfully retrieved diff"
  4852. }
  4853. }
  4854. }
  4855. }
  4856. },
  4857. "description": "Get the file changes (diff) that resulted from a specific user message in the session.",
  4858. "summary": "Get message diff",
  4859. "x-codeSamples": [
  4860. {
  4861. "lang": "js",
  4862. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.diff({\n ...\n})"
  4863. }
  4864. ]
  4865. }
  4866. },
  4867. "/session/{sessionID}/message": {
  4868. "get": {
  4869. "tags": ["session"],
  4870. "operationId": "session.messages",
  4871. "parameters": [
  4872. {
  4873. "name": "directory",
  4874. "in": "query",
  4875. "required": false,
  4876. "schema": {
  4877. "type": "string"
  4878. }
  4879. },
  4880. {
  4881. "name": "workspace",
  4882. "in": "query",
  4883. "required": false,
  4884. "schema": {
  4885. "type": "string"
  4886. }
  4887. },
  4888. {
  4889. "name": "sessionID",
  4890. "in": "path",
  4891. "schema": {
  4892. "type": "string",
  4893. "pattern": "^ses.*"
  4894. },
  4895. "required": true
  4896. },
  4897. {
  4898. "name": "limit",
  4899. "in": "query",
  4900. "schema": {
  4901. "type": "integer",
  4902. "minimum": 0,
  4903. "maximum": 9007199254740991
  4904. },
  4905. "required": false
  4906. },
  4907. {
  4908. "name": "before",
  4909. "in": "query",
  4910. "schema": {
  4911. "type": "string"
  4912. },
  4913. "required": false
  4914. }
  4915. ],
  4916. "responses": {
  4917. "200": {
  4918. "description": "List of messages",
  4919. "content": {
  4920. "application/json": {
  4921. "schema": {
  4922. "type": "array",
  4923. "items": {
  4924. "type": "object",
  4925. "properties": {
  4926. "info": {
  4927. "$ref": "#/components/schemas/Message"
  4928. },
  4929. "parts": {
  4930. "type": "array",
  4931. "items": {
  4932. "$ref": "#/components/schemas/Part"
  4933. }
  4934. }
  4935. },
  4936. "required": ["info", "parts"],
  4937. "additionalProperties": false
  4938. },
  4939. "description": "List of messages"
  4940. }
  4941. }
  4942. }
  4943. },
  4944. "400": {
  4945. "description": "Bad request",
  4946. "content": {
  4947. "application/json": {
  4948. "schema": {
  4949. "$ref": "#/components/schemas/BadRequestError"
  4950. }
  4951. }
  4952. }
  4953. },
  4954. "404": {
  4955. "description": "Not found",
  4956. "content": {
  4957. "application/json": {
  4958. "schema": {
  4959. "$ref": "#/components/schemas/NotFoundError"
  4960. }
  4961. }
  4962. }
  4963. }
  4964. },
  4965. "description": "Retrieve all messages in a session, including user prompts and AI responses.",
  4966. "summary": "Get session messages",
  4967. "x-codeSamples": [
  4968. {
  4969. "lang": "js",
  4970. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.messages({\n ...\n})"
  4971. }
  4972. ]
  4973. },
  4974. "post": {
  4975. "tags": ["session"],
  4976. "operationId": "session.prompt",
  4977. "parameters": [
  4978. {
  4979. "name": "directory",
  4980. "in": "query",
  4981. "required": false,
  4982. "schema": {
  4983. "type": "string"
  4984. }
  4985. },
  4986. {
  4987. "name": "workspace",
  4988. "in": "query",
  4989. "required": false,
  4990. "schema": {
  4991. "type": "string"
  4992. }
  4993. },
  4994. {
  4995. "name": "sessionID",
  4996. "in": "path",
  4997. "schema": {
  4998. "type": "string",
  4999. "pattern": "^ses.*"
  5000. },
  5001. "required": true
  5002. }
  5003. ],
  5004. "responses": {
  5005. "200": {
  5006. "description": "Created message",
  5007. "content": {
  5008. "application/json": {
  5009. "schema": {
  5010. "type": "object",
  5011. "required": ["info", "parts"],
  5012. "properties": {
  5013. "info": {
  5014. "$ref": "#/components/schemas/AssistantMessage"
  5015. },
  5016. "parts": {
  5017. "type": "array",
  5018. "items": {
  5019. "$ref": "#/components/schemas/Part"
  5020. }
  5021. }
  5022. }
  5023. }
  5024. }
  5025. }
  5026. },
  5027. "400": {
  5028. "description": "Bad request",
  5029. "content": {
  5030. "application/json": {
  5031. "schema": {
  5032. "$ref": "#/components/schemas/BadRequestError"
  5033. }
  5034. }
  5035. }
  5036. },
  5037. "404": {
  5038. "description": "Not found",
  5039. "content": {
  5040. "application/json": {
  5041. "schema": {
  5042. "$ref": "#/components/schemas/NotFoundError"
  5043. }
  5044. }
  5045. }
  5046. }
  5047. },
  5048. "description": "Create and send a new message to a session, streaming the AI response.",
  5049. "summary": "Send message",
  5050. "requestBody": {
  5051. "content": {
  5052. "application/json": {
  5053. "schema": {
  5054. "type": "object",
  5055. "properties": {
  5056. "messageID": {
  5057. "type": "string"
  5058. },
  5059. "model": {
  5060. "type": "object",
  5061. "properties": {
  5062. "providerID": {
  5063. "type": "string"
  5064. },
  5065. "modelID": {
  5066. "type": "string"
  5067. }
  5068. },
  5069. "required": ["providerID", "modelID"],
  5070. "additionalProperties": false
  5071. },
  5072. "agent": {
  5073. "type": "string"
  5074. },
  5075. "noReply": {
  5076. "type": "boolean"
  5077. },
  5078. "tools": {
  5079. "type": "object",
  5080. "additionalProperties": {
  5081. "type": "boolean"
  5082. }
  5083. },
  5084. "format": {
  5085. "$ref": "#/components/schemas/OutputFormat"
  5086. },
  5087. "system": {
  5088. "type": "string"
  5089. },
  5090. "variant": {
  5091. "type": "string"
  5092. },
  5093. "parts": {
  5094. "type": "array",
  5095. "items": {
  5096. "anyOf": [
  5097. {
  5098. "$ref": "#/components/schemas/TextPartInput"
  5099. },
  5100. {
  5101. "$ref": "#/components/schemas/FilePartInput"
  5102. },
  5103. {
  5104. "$ref": "#/components/schemas/AgentPartInput"
  5105. },
  5106. {
  5107. "$ref": "#/components/schemas/SubtaskPartInput"
  5108. }
  5109. ]
  5110. }
  5111. }
  5112. },
  5113. "required": ["parts"],
  5114. "additionalProperties": false
  5115. }
  5116. }
  5117. }
  5118. },
  5119. "x-codeSamples": [
  5120. {
  5121. "lang": "js",
  5122. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.prompt({\n ...\n})"
  5123. }
  5124. ]
  5125. }
  5126. },
  5127. "/session/{sessionID}/message/{messageID}": {
  5128. "get": {
  5129. "tags": ["session"],
  5130. "operationId": "session.message",
  5131. "parameters": [
  5132. {
  5133. "name": "directory",
  5134. "in": "query",
  5135. "required": false,
  5136. "schema": {
  5137. "type": "string"
  5138. }
  5139. },
  5140. {
  5141. "name": "workspace",
  5142. "in": "query",
  5143. "required": false,
  5144. "schema": {
  5145. "type": "string"
  5146. }
  5147. },
  5148. {
  5149. "name": "sessionID",
  5150. "in": "path",
  5151. "schema": {
  5152. "type": "string",
  5153. "pattern": "^ses.*"
  5154. },
  5155. "required": true
  5156. },
  5157. {
  5158. "name": "messageID",
  5159. "in": "path",
  5160. "schema": {
  5161. "type": "string",
  5162. "pattern": "^msg.*"
  5163. },
  5164. "required": true
  5165. }
  5166. ],
  5167. "responses": {
  5168. "200": {
  5169. "description": "Message",
  5170. "content": {
  5171. "application/json": {
  5172. "schema": {
  5173. "type": "object",
  5174. "properties": {
  5175. "info": {
  5176. "$ref": "#/components/schemas/Message"
  5177. },
  5178. "parts": {
  5179. "type": "array",
  5180. "items": {
  5181. "$ref": "#/components/schemas/Part"
  5182. }
  5183. }
  5184. },
  5185. "required": ["info", "parts"],
  5186. "additionalProperties": false,
  5187. "description": "Message"
  5188. }
  5189. }
  5190. }
  5191. },
  5192. "400": {
  5193. "description": "Bad request",
  5194. "content": {
  5195. "application/json": {
  5196. "schema": {
  5197. "$ref": "#/components/schemas/BadRequestError"
  5198. }
  5199. }
  5200. }
  5201. },
  5202. "404": {
  5203. "description": "Not found",
  5204. "content": {
  5205. "application/json": {
  5206. "schema": {
  5207. "$ref": "#/components/schemas/NotFoundError"
  5208. }
  5209. }
  5210. }
  5211. }
  5212. },
  5213. "description": "Retrieve a specific message from a session by its message ID.",
  5214. "summary": "Get message",
  5215. "x-codeSamples": [
  5216. {
  5217. "lang": "js",
  5218. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.message({\n ...\n})"
  5219. }
  5220. ]
  5221. },
  5222. "delete": {
  5223. "tags": ["session"],
  5224. "operationId": "session.deleteMessage",
  5225. "parameters": [
  5226. {
  5227. "name": "directory",
  5228. "in": "query",
  5229. "required": false,
  5230. "schema": {
  5231. "type": "string"
  5232. }
  5233. },
  5234. {
  5235. "name": "workspace",
  5236. "in": "query",
  5237. "required": false,
  5238. "schema": {
  5239. "type": "string"
  5240. }
  5241. },
  5242. {
  5243. "name": "sessionID",
  5244. "in": "path",
  5245. "schema": {
  5246. "type": "string",
  5247. "pattern": "^ses.*"
  5248. },
  5249. "required": true
  5250. },
  5251. {
  5252. "name": "messageID",
  5253. "in": "path",
  5254. "schema": {
  5255. "type": "string",
  5256. "pattern": "^msg.*"
  5257. },
  5258. "required": true
  5259. }
  5260. ],
  5261. "responses": {
  5262. "200": {
  5263. "description": "Successfully deleted message",
  5264. "content": {
  5265. "application/json": {
  5266. "schema": {
  5267. "type": "boolean",
  5268. "description": "Successfully deleted message"
  5269. }
  5270. }
  5271. }
  5272. },
  5273. "400": {
  5274. "description": "Bad request",
  5275. "content": {
  5276. "application/json": {
  5277. "schema": {
  5278. "$ref": "#/components/schemas/BadRequestError"
  5279. }
  5280. }
  5281. }
  5282. },
  5283. "404": {
  5284. "description": "Not found",
  5285. "content": {
  5286. "application/json": {
  5287. "schema": {
  5288. "$ref": "#/components/schemas/NotFoundError"
  5289. }
  5290. }
  5291. }
  5292. }
  5293. },
  5294. "description": "Permanently delete a specific message and all of its parts from a session without reverting file changes.",
  5295. "summary": "Delete message",
  5296. "x-codeSamples": [
  5297. {
  5298. "lang": "js",
  5299. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.deleteMessage({\n ...\n})"
  5300. }
  5301. ]
  5302. }
  5303. },
  5304. "/session/{sessionID}/fork": {
  5305. "post": {
  5306. "tags": ["session"],
  5307. "operationId": "session.fork",
  5308. "parameters": [
  5309. {
  5310. "name": "directory",
  5311. "in": "query",
  5312. "required": false,
  5313. "schema": {
  5314. "type": "string"
  5315. }
  5316. },
  5317. {
  5318. "name": "workspace",
  5319. "in": "query",
  5320. "required": false,
  5321. "schema": {
  5322. "type": "string"
  5323. }
  5324. },
  5325. {
  5326. "name": "sessionID",
  5327. "in": "path",
  5328. "schema": {
  5329. "type": "string",
  5330. "pattern": "^ses.*"
  5331. },
  5332. "required": true
  5333. }
  5334. ],
  5335. "responses": {
  5336. "200": {
  5337. "description": "200",
  5338. "content": {
  5339. "application/json": {
  5340. "schema": {
  5341. "$ref": "#/components/schemas/Session"
  5342. }
  5343. }
  5344. }
  5345. }
  5346. },
  5347. "description": "Create a new session by forking an existing session at a specific message point.",
  5348. "summary": "Fork session",
  5349. "requestBody": {
  5350. "content": {
  5351. "application/json": {
  5352. "schema": {
  5353. "type": "object",
  5354. "properties": {
  5355. "messageID": {
  5356. "type": "string"
  5357. }
  5358. },
  5359. "additionalProperties": false
  5360. }
  5361. }
  5362. }
  5363. },
  5364. "x-codeSamples": [
  5365. {
  5366. "lang": "js",
  5367. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.fork({\n ...\n})"
  5368. }
  5369. ]
  5370. }
  5371. },
  5372. "/session/{sessionID}/abort": {
  5373. "post": {
  5374. "tags": ["session"],
  5375. "operationId": "session.abort",
  5376. "parameters": [
  5377. {
  5378. "name": "directory",
  5379. "in": "query",
  5380. "required": false,
  5381. "schema": {
  5382. "type": "string"
  5383. }
  5384. },
  5385. {
  5386. "name": "workspace",
  5387. "in": "query",
  5388. "required": false,
  5389. "schema": {
  5390. "type": "string"
  5391. }
  5392. },
  5393. {
  5394. "name": "sessionID",
  5395. "in": "path",
  5396. "schema": {
  5397. "type": "string",
  5398. "pattern": "^ses.*"
  5399. },
  5400. "required": true
  5401. }
  5402. ],
  5403. "responses": {
  5404. "200": {
  5405. "description": "Aborted session",
  5406. "content": {
  5407. "application/json": {
  5408. "schema": {
  5409. "type": "boolean",
  5410. "description": "Aborted session"
  5411. }
  5412. }
  5413. }
  5414. },
  5415. "400": {
  5416. "description": "Bad request",
  5417. "content": {
  5418. "application/json": {
  5419. "schema": {
  5420. "$ref": "#/components/schemas/BadRequestError"
  5421. }
  5422. }
  5423. }
  5424. },
  5425. "404": {
  5426. "description": "Not found",
  5427. "content": {
  5428. "application/json": {
  5429. "schema": {
  5430. "$ref": "#/components/schemas/NotFoundError"
  5431. }
  5432. }
  5433. }
  5434. }
  5435. },
  5436. "description": "Abort an active session and stop any ongoing AI processing or command execution.",
  5437. "summary": "Abort session",
  5438. "x-codeSamples": [
  5439. {
  5440. "lang": "js",
  5441. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.abort({\n ...\n})"
  5442. }
  5443. ]
  5444. }
  5445. },
  5446. "/session/{sessionID}/init": {
  5447. "post": {
  5448. "tags": ["session"],
  5449. "operationId": "session.init",
  5450. "parameters": [
  5451. {
  5452. "name": "directory",
  5453. "in": "query",
  5454. "required": false,
  5455. "schema": {
  5456. "type": "string"
  5457. }
  5458. },
  5459. {
  5460. "name": "workspace",
  5461. "in": "query",
  5462. "required": false,
  5463. "schema": {
  5464. "type": "string"
  5465. }
  5466. },
  5467. {
  5468. "name": "sessionID",
  5469. "in": "path",
  5470. "schema": {
  5471. "type": "string",
  5472. "pattern": "^ses.*"
  5473. },
  5474. "required": true
  5475. }
  5476. ],
  5477. "responses": {
  5478. "200": {
  5479. "description": "200",
  5480. "content": {
  5481. "application/json": {
  5482. "schema": {
  5483. "type": "boolean",
  5484. "description": "200"
  5485. }
  5486. }
  5487. }
  5488. },
  5489. "400": {
  5490. "description": "Bad request",
  5491. "content": {
  5492. "application/json": {
  5493. "schema": {
  5494. "$ref": "#/components/schemas/BadRequestError"
  5495. }
  5496. }
  5497. }
  5498. },
  5499. "404": {
  5500. "description": "Not found",
  5501. "content": {
  5502. "application/json": {
  5503. "schema": {
  5504. "$ref": "#/components/schemas/NotFoundError"
  5505. }
  5506. }
  5507. }
  5508. }
  5509. },
  5510. "description": "Analyze the current application and create an AGENTS.md file with project-specific agent configurations.",
  5511. "summary": "Initialize session",
  5512. "requestBody": {
  5513. "content": {
  5514. "application/json": {
  5515. "schema": {
  5516. "type": "object",
  5517. "properties": {
  5518. "modelID": {
  5519. "type": "string"
  5520. },
  5521. "providerID": {
  5522. "type": "string"
  5523. },
  5524. "messageID": {
  5525. "type": "string"
  5526. }
  5527. },
  5528. "required": ["modelID", "providerID", "messageID"],
  5529. "additionalProperties": false
  5530. }
  5531. }
  5532. }
  5533. },
  5534. "x-codeSamples": [
  5535. {
  5536. "lang": "js",
  5537. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.init({\n ...\n})"
  5538. }
  5539. ]
  5540. }
  5541. },
  5542. "/session/{sessionID}/share": {
  5543. "post": {
  5544. "tags": ["session"],
  5545. "operationId": "session.share",
  5546. "parameters": [
  5547. {
  5548. "name": "directory",
  5549. "in": "query",
  5550. "required": false,
  5551. "schema": {
  5552. "type": "string"
  5553. }
  5554. },
  5555. {
  5556. "name": "workspace",
  5557. "in": "query",
  5558. "required": false,
  5559. "schema": {
  5560. "type": "string"
  5561. }
  5562. },
  5563. {
  5564. "name": "sessionID",
  5565. "in": "path",
  5566. "schema": {
  5567. "type": "string",
  5568. "pattern": "^ses.*"
  5569. },
  5570. "required": true
  5571. }
  5572. ],
  5573. "responses": {
  5574. "200": {
  5575. "description": "Successfully shared session",
  5576. "content": {
  5577. "application/json": {
  5578. "schema": {
  5579. "$ref": "#/components/schemas/Session"
  5580. }
  5581. }
  5582. }
  5583. },
  5584. "400": {
  5585. "description": "Bad request",
  5586. "content": {
  5587. "application/json": {
  5588. "schema": {
  5589. "$ref": "#/components/schemas/BadRequestError"
  5590. }
  5591. }
  5592. }
  5593. },
  5594. "404": {
  5595. "description": "Not found",
  5596. "content": {
  5597. "application/json": {
  5598. "schema": {
  5599. "$ref": "#/components/schemas/NotFoundError"
  5600. }
  5601. }
  5602. }
  5603. }
  5604. },
  5605. "description": "Create a shareable link for a session, allowing others to view the conversation.",
  5606. "summary": "Share session",
  5607. "x-codeSamples": [
  5608. {
  5609. "lang": "js",
  5610. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.share({\n ...\n})"
  5611. }
  5612. ]
  5613. },
  5614. "delete": {
  5615. "tags": ["session"],
  5616. "operationId": "session.unshare",
  5617. "parameters": [
  5618. {
  5619. "name": "directory",
  5620. "in": "query",
  5621. "required": false,
  5622. "schema": {
  5623. "type": "string"
  5624. }
  5625. },
  5626. {
  5627. "name": "workspace",
  5628. "in": "query",
  5629. "required": false,
  5630. "schema": {
  5631. "type": "string"
  5632. }
  5633. },
  5634. {
  5635. "name": "sessionID",
  5636. "in": "path",
  5637. "schema": {
  5638. "type": "string",
  5639. "pattern": "^ses.*"
  5640. },
  5641. "required": true
  5642. }
  5643. ],
  5644. "responses": {
  5645. "200": {
  5646. "description": "Successfully unshared session",
  5647. "content": {
  5648. "application/json": {
  5649. "schema": {
  5650. "$ref": "#/components/schemas/Session"
  5651. }
  5652. }
  5653. }
  5654. },
  5655. "400": {
  5656. "description": "Bad request",
  5657. "content": {
  5658. "application/json": {
  5659. "schema": {
  5660. "$ref": "#/components/schemas/BadRequestError"
  5661. }
  5662. }
  5663. }
  5664. },
  5665. "404": {
  5666. "description": "Not found",
  5667. "content": {
  5668. "application/json": {
  5669. "schema": {
  5670. "$ref": "#/components/schemas/NotFoundError"
  5671. }
  5672. }
  5673. }
  5674. }
  5675. },
  5676. "description": "Remove the shareable link for a session, making it private again.",
  5677. "summary": "Unshare session",
  5678. "x-codeSamples": [
  5679. {
  5680. "lang": "js",
  5681. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.unshare({\n ...\n})"
  5682. }
  5683. ]
  5684. }
  5685. },
  5686. "/session/{sessionID}/summarize": {
  5687. "post": {
  5688. "tags": ["session"],
  5689. "operationId": "session.summarize",
  5690. "parameters": [
  5691. {
  5692. "name": "directory",
  5693. "in": "query",
  5694. "required": false,
  5695. "schema": {
  5696. "type": "string"
  5697. }
  5698. },
  5699. {
  5700. "name": "workspace",
  5701. "in": "query",
  5702. "required": false,
  5703. "schema": {
  5704. "type": "string"
  5705. }
  5706. },
  5707. {
  5708. "name": "sessionID",
  5709. "in": "path",
  5710. "schema": {
  5711. "type": "string",
  5712. "pattern": "^ses.*"
  5713. },
  5714. "required": true
  5715. }
  5716. ],
  5717. "responses": {
  5718. "200": {
  5719. "description": "Summarized session",
  5720. "content": {
  5721. "application/json": {
  5722. "schema": {
  5723. "type": "boolean",
  5724. "description": "Summarized session"
  5725. }
  5726. }
  5727. }
  5728. },
  5729. "400": {
  5730. "description": "Bad request",
  5731. "content": {
  5732. "application/json": {
  5733. "schema": {
  5734. "$ref": "#/components/schemas/BadRequestError"
  5735. }
  5736. }
  5737. }
  5738. },
  5739. "404": {
  5740. "description": "Not found",
  5741. "content": {
  5742. "application/json": {
  5743. "schema": {
  5744. "$ref": "#/components/schemas/NotFoundError"
  5745. }
  5746. }
  5747. }
  5748. }
  5749. },
  5750. "description": "Generate a concise summary of the session using AI compaction to preserve key information.",
  5751. "summary": "Summarize session",
  5752. "requestBody": {
  5753. "content": {
  5754. "application/json": {
  5755. "schema": {
  5756. "type": "object",
  5757. "properties": {
  5758. "providerID": {
  5759. "type": "string"
  5760. },
  5761. "modelID": {
  5762. "type": "string"
  5763. },
  5764. "auto": {
  5765. "type": "boolean"
  5766. }
  5767. },
  5768. "required": ["providerID", "modelID"],
  5769. "additionalProperties": false
  5770. }
  5771. }
  5772. }
  5773. },
  5774. "x-codeSamples": [
  5775. {
  5776. "lang": "js",
  5777. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.summarize({\n ...\n})"
  5778. }
  5779. ]
  5780. }
  5781. },
  5782. "/session/{sessionID}/prompt_async": {
  5783. "post": {
  5784. "tags": ["session"],
  5785. "operationId": "session.prompt_async",
  5786. "parameters": [
  5787. {
  5788. "name": "directory",
  5789. "in": "query",
  5790. "required": false,
  5791. "schema": {
  5792. "type": "string"
  5793. }
  5794. },
  5795. {
  5796. "name": "workspace",
  5797. "in": "query",
  5798. "required": false,
  5799. "schema": {
  5800. "type": "string"
  5801. }
  5802. },
  5803. {
  5804. "name": "sessionID",
  5805. "in": "path",
  5806. "schema": {
  5807. "type": "string",
  5808. "pattern": "^ses.*"
  5809. },
  5810. "required": true
  5811. }
  5812. ],
  5813. "responses": {
  5814. "204": {
  5815. "description": "Prompt accepted"
  5816. },
  5817. "400": {
  5818. "description": "Bad request",
  5819. "content": {
  5820. "application/json": {
  5821. "schema": {
  5822. "$ref": "#/components/schemas/BadRequestError"
  5823. }
  5824. }
  5825. }
  5826. },
  5827. "404": {
  5828. "description": "Not found",
  5829. "content": {
  5830. "application/json": {
  5831. "schema": {
  5832. "$ref": "#/components/schemas/NotFoundError"
  5833. }
  5834. }
  5835. }
  5836. }
  5837. },
  5838. "description": "Create and send a new message to a session asynchronously, starting the session if needed and returning immediately.",
  5839. "summary": "Send async message",
  5840. "requestBody": {
  5841. "content": {
  5842. "application/json": {
  5843. "schema": {
  5844. "type": "object",
  5845. "properties": {
  5846. "messageID": {
  5847. "type": "string"
  5848. },
  5849. "model": {
  5850. "type": "object",
  5851. "properties": {
  5852. "providerID": {
  5853. "type": "string"
  5854. },
  5855. "modelID": {
  5856. "type": "string"
  5857. }
  5858. },
  5859. "required": ["providerID", "modelID"],
  5860. "additionalProperties": false
  5861. },
  5862. "agent": {
  5863. "type": "string"
  5864. },
  5865. "noReply": {
  5866. "type": "boolean"
  5867. },
  5868. "tools": {
  5869. "type": "object",
  5870. "additionalProperties": {
  5871. "type": "boolean"
  5872. }
  5873. },
  5874. "format": {
  5875. "$ref": "#/components/schemas/OutputFormat"
  5876. },
  5877. "system": {
  5878. "type": "string"
  5879. },
  5880. "variant": {
  5881. "type": "string"
  5882. },
  5883. "parts": {
  5884. "type": "array",
  5885. "items": {
  5886. "anyOf": [
  5887. {
  5888. "$ref": "#/components/schemas/TextPartInput"
  5889. },
  5890. {
  5891. "$ref": "#/components/schemas/FilePartInput"
  5892. },
  5893. {
  5894. "$ref": "#/components/schemas/AgentPartInput"
  5895. },
  5896. {
  5897. "$ref": "#/components/schemas/SubtaskPartInput"
  5898. }
  5899. ]
  5900. }
  5901. }
  5902. },
  5903. "required": ["parts"],
  5904. "additionalProperties": false
  5905. }
  5906. }
  5907. }
  5908. },
  5909. "x-codeSamples": [
  5910. {
  5911. "lang": "js",
  5912. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.prompt_async({\n ...\n})"
  5913. }
  5914. ]
  5915. }
  5916. },
  5917. "/session/{sessionID}/command": {
  5918. "post": {
  5919. "tags": ["session"],
  5920. "operationId": "session.command",
  5921. "parameters": [
  5922. {
  5923. "name": "directory",
  5924. "in": "query",
  5925. "required": false,
  5926. "schema": {
  5927. "type": "string"
  5928. }
  5929. },
  5930. {
  5931. "name": "workspace",
  5932. "in": "query",
  5933. "required": false,
  5934. "schema": {
  5935. "type": "string"
  5936. }
  5937. },
  5938. {
  5939. "name": "sessionID",
  5940. "in": "path",
  5941. "schema": {
  5942. "type": "string",
  5943. "pattern": "^ses.*"
  5944. },
  5945. "required": true
  5946. }
  5947. ],
  5948. "responses": {
  5949. "200": {
  5950. "description": "Created message",
  5951. "content": {
  5952. "application/json": {
  5953. "schema": {
  5954. "type": "object",
  5955. "required": ["info", "parts"],
  5956. "properties": {
  5957. "info": {
  5958. "$ref": "#/components/schemas/AssistantMessage"
  5959. },
  5960. "parts": {
  5961. "type": "array",
  5962. "items": {
  5963. "$ref": "#/components/schemas/Part"
  5964. }
  5965. }
  5966. }
  5967. }
  5968. }
  5969. }
  5970. },
  5971. "400": {
  5972. "description": "Bad request",
  5973. "content": {
  5974. "application/json": {
  5975. "schema": {
  5976. "$ref": "#/components/schemas/BadRequestError"
  5977. }
  5978. }
  5979. }
  5980. },
  5981. "404": {
  5982. "description": "Not found",
  5983. "content": {
  5984. "application/json": {
  5985. "schema": {
  5986. "$ref": "#/components/schemas/NotFoundError"
  5987. }
  5988. }
  5989. }
  5990. }
  5991. },
  5992. "description": "Send a new command to a session for execution by the AI assistant.",
  5993. "summary": "Send command",
  5994. "requestBody": {
  5995. "content": {
  5996. "application/json": {
  5997. "schema": {
  5998. "type": "object",
  5999. "properties": {
  6000. "messageID": {
  6001. "type": "string"
  6002. },
  6003. "agent": {
  6004. "type": "string"
  6005. },
  6006. "model": {
  6007. "type": "string"
  6008. },
  6009. "arguments": {
  6010. "type": "string"
  6011. },
  6012. "command": {
  6013. "type": "string"
  6014. },
  6015. "variant": {
  6016. "type": "string"
  6017. },
  6018. "parts": {
  6019. "type": "array",
  6020. "items": {
  6021. "type": "object",
  6022. "properties": {
  6023. "id": {
  6024. "type": "string"
  6025. },
  6026. "type": {
  6027. "type": "string",
  6028. "enum": ["file"]
  6029. },
  6030. "mime": {
  6031. "type": "string"
  6032. },
  6033. "filename": {
  6034. "type": "string"
  6035. },
  6036. "url": {
  6037. "type": "string"
  6038. },
  6039. "source": {
  6040. "$ref": "#/components/schemas/FilePartSource"
  6041. }
  6042. },
  6043. "required": ["type", "mime", "url"],
  6044. "additionalProperties": false
  6045. }
  6046. }
  6047. },
  6048. "required": ["arguments", "command"],
  6049. "additionalProperties": false
  6050. }
  6051. }
  6052. }
  6053. },
  6054. "x-codeSamples": [
  6055. {
  6056. "lang": "js",
  6057. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.command({\n ...\n})"
  6058. }
  6059. ]
  6060. }
  6061. },
  6062. "/session/{sessionID}/shell": {
  6063. "post": {
  6064. "tags": ["session"],
  6065. "operationId": "session.shell",
  6066. "parameters": [
  6067. {
  6068. "name": "directory",
  6069. "in": "query",
  6070. "required": false,
  6071. "schema": {
  6072. "type": "string"
  6073. }
  6074. },
  6075. {
  6076. "name": "workspace",
  6077. "in": "query",
  6078. "required": false,
  6079. "schema": {
  6080. "type": "string"
  6081. }
  6082. },
  6083. {
  6084. "name": "sessionID",
  6085. "in": "path",
  6086. "schema": {
  6087. "type": "string",
  6088. "pattern": "^ses.*"
  6089. },
  6090. "required": true
  6091. }
  6092. ],
  6093. "responses": {
  6094. "200": {
  6095. "description": "Created message",
  6096. "content": {
  6097. "application/json": {
  6098. "schema": {
  6099. "type": "object",
  6100. "properties": {
  6101. "info": {
  6102. "$ref": "#/components/schemas/Message"
  6103. },
  6104. "parts": {
  6105. "type": "array",
  6106. "items": {
  6107. "$ref": "#/components/schemas/Part"
  6108. }
  6109. }
  6110. },
  6111. "required": ["info", "parts"],
  6112. "additionalProperties": false,
  6113. "description": "Created message"
  6114. }
  6115. }
  6116. }
  6117. },
  6118. "400": {
  6119. "description": "Bad request",
  6120. "content": {
  6121. "application/json": {
  6122. "schema": {
  6123. "$ref": "#/components/schemas/BadRequestError"
  6124. }
  6125. }
  6126. }
  6127. },
  6128. "404": {
  6129. "description": "Not found",
  6130. "content": {
  6131. "application/json": {
  6132. "schema": {
  6133. "$ref": "#/components/schemas/NotFoundError"
  6134. }
  6135. }
  6136. }
  6137. }
  6138. },
  6139. "description": "Execute a shell command within the session context and return the AI's response.",
  6140. "summary": "Run shell command",
  6141. "requestBody": {
  6142. "content": {
  6143. "application/json": {
  6144. "schema": {
  6145. "type": "object",
  6146. "properties": {
  6147. "messageID": {
  6148. "type": "string"
  6149. },
  6150. "agent": {
  6151. "type": "string"
  6152. },
  6153. "model": {
  6154. "type": "object",
  6155. "properties": {
  6156. "providerID": {
  6157. "type": "string"
  6158. },
  6159. "modelID": {
  6160. "type": "string"
  6161. }
  6162. },
  6163. "required": ["providerID", "modelID"],
  6164. "additionalProperties": false
  6165. },
  6166. "command": {
  6167. "type": "string"
  6168. }
  6169. },
  6170. "required": ["agent", "command"],
  6171. "additionalProperties": false
  6172. }
  6173. }
  6174. }
  6175. },
  6176. "x-codeSamples": [
  6177. {
  6178. "lang": "js",
  6179. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.shell({\n ...\n})"
  6180. }
  6181. ]
  6182. }
  6183. },
  6184. "/session/{sessionID}/revert": {
  6185. "post": {
  6186. "tags": ["session"],
  6187. "operationId": "session.revert",
  6188. "parameters": [
  6189. {
  6190. "name": "directory",
  6191. "in": "query",
  6192. "required": false,
  6193. "schema": {
  6194. "type": "string"
  6195. }
  6196. },
  6197. {
  6198. "name": "workspace",
  6199. "in": "query",
  6200. "required": false,
  6201. "schema": {
  6202. "type": "string"
  6203. }
  6204. },
  6205. {
  6206. "name": "sessionID",
  6207. "in": "path",
  6208. "schema": {
  6209. "type": "string",
  6210. "pattern": "^ses.*"
  6211. },
  6212. "required": true
  6213. }
  6214. ],
  6215. "responses": {
  6216. "200": {
  6217. "description": "Updated session",
  6218. "content": {
  6219. "application/json": {
  6220. "schema": {
  6221. "$ref": "#/components/schemas/Session"
  6222. }
  6223. }
  6224. }
  6225. },
  6226. "400": {
  6227. "description": "Bad request",
  6228. "content": {
  6229. "application/json": {
  6230. "schema": {
  6231. "$ref": "#/components/schemas/BadRequestError"
  6232. }
  6233. }
  6234. }
  6235. },
  6236. "404": {
  6237. "description": "Not found",
  6238. "content": {
  6239. "application/json": {
  6240. "schema": {
  6241. "$ref": "#/components/schemas/NotFoundError"
  6242. }
  6243. }
  6244. }
  6245. }
  6246. },
  6247. "description": "Revert a specific message in a session, undoing its effects and restoring the previous state.",
  6248. "summary": "Revert message",
  6249. "requestBody": {
  6250. "content": {
  6251. "application/json": {
  6252. "schema": {
  6253. "type": "object",
  6254. "properties": {
  6255. "messageID": {
  6256. "type": "string"
  6257. },
  6258. "partID": {
  6259. "type": "string"
  6260. }
  6261. },
  6262. "required": ["messageID"],
  6263. "additionalProperties": false
  6264. }
  6265. }
  6266. }
  6267. },
  6268. "x-codeSamples": [
  6269. {
  6270. "lang": "js",
  6271. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.revert({\n ...\n})"
  6272. }
  6273. ]
  6274. }
  6275. },
  6276. "/session/{sessionID}/unrevert": {
  6277. "post": {
  6278. "tags": ["session"],
  6279. "operationId": "session.unrevert",
  6280. "parameters": [
  6281. {
  6282. "name": "directory",
  6283. "in": "query",
  6284. "required": false,
  6285. "schema": {
  6286. "type": "string"
  6287. }
  6288. },
  6289. {
  6290. "name": "workspace",
  6291. "in": "query",
  6292. "required": false,
  6293. "schema": {
  6294. "type": "string"
  6295. }
  6296. },
  6297. {
  6298. "name": "sessionID",
  6299. "in": "path",
  6300. "schema": {
  6301. "type": "string",
  6302. "pattern": "^ses.*"
  6303. },
  6304. "required": true
  6305. }
  6306. ],
  6307. "responses": {
  6308. "200": {
  6309. "description": "Updated session",
  6310. "content": {
  6311. "application/json": {
  6312. "schema": {
  6313. "$ref": "#/components/schemas/Session"
  6314. }
  6315. }
  6316. }
  6317. },
  6318. "400": {
  6319. "description": "Bad request",
  6320. "content": {
  6321. "application/json": {
  6322. "schema": {
  6323. "$ref": "#/components/schemas/BadRequestError"
  6324. }
  6325. }
  6326. }
  6327. },
  6328. "404": {
  6329. "description": "Not found",
  6330. "content": {
  6331. "application/json": {
  6332. "schema": {
  6333. "$ref": "#/components/schemas/NotFoundError"
  6334. }
  6335. }
  6336. }
  6337. }
  6338. },
  6339. "description": "Restore all previously reverted messages in a session.",
  6340. "summary": "Restore reverted messages",
  6341. "x-codeSamples": [
  6342. {
  6343. "lang": "js",
  6344. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.unrevert({\n ...\n})"
  6345. }
  6346. ]
  6347. }
  6348. },
  6349. "/session/{sessionID}/permissions/{permissionID}": {
  6350. "post": {
  6351. "tags": ["session"],
  6352. "operationId": "permission.respond",
  6353. "parameters": [
  6354. {
  6355. "name": "directory",
  6356. "in": "query",
  6357. "required": false,
  6358. "schema": {
  6359. "type": "string"
  6360. }
  6361. },
  6362. {
  6363. "name": "workspace",
  6364. "in": "query",
  6365. "required": false,
  6366. "schema": {
  6367. "type": "string"
  6368. }
  6369. },
  6370. {
  6371. "name": "sessionID",
  6372. "in": "path",
  6373. "schema": {
  6374. "type": "string",
  6375. "pattern": "^ses.*"
  6376. },
  6377. "required": true
  6378. },
  6379. {
  6380. "name": "permissionID",
  6381. "in": "path",
  6382. "schema": {
  6383. "type": "string",
  6384. "pattern": "^per.*"
  6385. },
  6386. "required": true
  6387. }
  6388. ],
  6389. "responses": {
  6390. "200": {
  6391. "description": "Permission processed successfully",
  6392. "content": {
  6393. "application/json": {
  6394. "schema": {
  6395. "type": "boolean",
  6396. "description": "Permission processed successfully"
  6397. }
  6398. }
  6399. }
  6400. },
  6401. "400": {
  6402. "description": "Bad request",
  6403. "content": {
  6404. "application/json": {
  6405. "schema": {
  6406. "$ref": "#/components/schemas/BadRequestError"
  6407. }
  6408. }
  6409. }
  6410. },
  6411. "404": {
  6412. "description": "Not found",
  6413. "content": {
  6414. "application/json": {
  6415. "schema": {
  6416. "$ref": "#/components/schemas/NotFoundError"
  6417. }
  6418. }
  6419. }
  6420. }
  6421. },
  6422. "description": "Approve or deny a permission request from the AI assistant.",
  6423. "summary": "Respond to permission",
  6424. "deprecated": true,
  6425. "requestBody": {
  6426. "content": {
  6427. "application/json": {
  6428. "schema": {
  6429. "type": "object",
  6430. "properties": {
  6431. "response": {
  6432. "type": "string",
  6433. "enum": ["once", "always", "reject"]
  6434. }
  6435. },
  6436. "required": ["response"],
  6437. "additionalProperties": false
  6438. }
  6439. }
  6440. }
  6441. },
  6442. "x-codeSamples": [
  6443. {
  6444. "lang": "js",
  6445. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.permission.respond({\n ...\n})"
  6446. }
  6447. ]
  6448. }
  6449. },
  6450. "/session/{sessionID}/message/{messageID}/part/{partID}": {
  6451. "delete": {
  6452. "tags": ["session"],
  6453. "operationId": "part.delete",
  6454. "parameters": [
  6455. {
  6456. "name": "directory",
  6457. "in": "query",
  6458. "required": false,
  6459. "schema": {
  6460. "type": "string"
  6461. }
  6462. },
  6463. {
  6464. "name": "workspace",
  6465. "in": "query",
  6466. "required": false,
  6467. "schema": {
  6468. "type": "string"
  6469. }
  6470. },
  6471. {
  6472. "name": "sessionID",
  6473. "in": "path",
  6474. "schema": {
  6475. "type": "string",
  6476. "pattern": "^ses.*"
  6477. },
  6478. "required": true
  6479. },
  6480. {
  6481. "name": "messageID",
  6482. "in": "path",
  6483. "schema": {
  6484. "type": "string",
  6485. "pattern": "^msg.*"
  6486. },
  6487. "required": true
  6488. },
  6489. {
  6490. "name": "partID",
  6491. "in": "path",
  6492. "schema": {
  6493. "type": "string",
  6494. "pattern": "^prt.*"
  6495. },
  6496. "required": true
  6497. }
  6498. ],
  6499. "responses": {
  6500. "200": {
  6501. "description": "Successfully deleted part",
  6502. "content": {
  6503. "application/json": {
  6504. "schema": {
  6505. "type": "boolean",
  6506. "description": "Successfully deleted part"
  6507. }
  6508. }
  6509. }
  6510. },
  6511. "400": {
  6512. "description": "Bad request",
  6513. "content": {
  6514. "application/json": {
  6515. "schema": {
  6516. "$ref": "#/components/schemas/BadRequestError"
  6517. }
  6518. }
  6519. }
  6520. },
  6521. "404": {
  6522. "description": "Not found",
  6523. "content": {
  6524. "application/json": {
  6525. "schema": {
  6526. "$ref": "#/components/schemas/NotFoundError"
  6527. }
  6528. }
  6529. }
  6530. }
  6531. },
  6532. "description": "Delete a part from a message.",
  6533. "x-codeSamples": [
  6534. {
  6535. "lang": "js",
  6536. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.part.delete({\n ...\n})"
  6537. }
  6538. ]
  6539. },
  6540. "patch": {
  6541. "tags": ["session"],
  6542. "operationId": "part.update",
  6543. "parameters": [
  6544. {
  6545. "name": "directory",
  6546. "in": "query",
  6547. "required": false,
  6548. "schema": {
  6549. "type": "string"
  6550. }
  6551. },
  6552. {
  6553. "name": "workspace",
  6554. "in": "query",
  6555. "required": false,
  6556. "schema": {
  6557. "type": "string"
  6558. }
  6559. },
  6560. {
  6561. "name": "sessionID",
  6562. "in": "path",
  6563. "schema": {
  6564. "type": "string",
  6565. "pattern": "^ses.*"
  6566. },
  6567. "required": true
  6568. },
  6569. {
  6570. "name": "messageID",
  6571. "in": "path",
  6572. "schema": {
  6573. "type": "string",
  6574. "pattern": "^msg.*"
  6575. },
  6576. "required": true
  6577. },
  6578. {
  6579. "name": "partID",
  6580. "in": "path",
  6581. "schema": {
  6582. "type": "string",
  6583. "pattern": "^prt.*"
  6584. },
  6585. "required": true
  6586. }
  6587. ],
  6588. "responses": {
  6589. "200": {
  6590. "description": "Successfully updated part",
  6591. "content": {
  6592. "application/json": {
  6593. "schema": {
  6594. "$ref": "#/components/schemas/Part"
  6595. }
  6596. }
  6597. }
  6598. },
  6599. "400": {
  6600. "description": "Bad request",
  6601. "content": {
  6602. "application/json": {
  6603. "schema": {
  6604. "$ref": "#/components/schemas/BadRequestError"
  6605. }
  6606. }
  6607. }
  6608. },
  6609. "404": {
  6610. "description": "Not found",
  6611. "content": {
  6612. "application/json": {
  6613. "schema": {
  6614. "$ref": "#/components/schemas/NotFoundError"
  6615. }
  6616. }
  6617. }
  6618. }
  6619. },
  6620. "description": "Update a part in a message.",
  6621. "requestBody": {
  6622. "content": {
  6623. "application/json": {
  6624. "schema": {
  6625. "$ref": "#/components/schemas/Part"
  6626. }
  6627. }
  6628. }
  6629. },
  6630. "x-codeSamples": [
  6631. {
  6632. "lang": "js",
  6633. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.part.update({\n ...\n})"
  6634. }
  6635. ]
  6636. }
  6637. },
  6638. "/sync/start": {
  6639. "post": {
  6640. "tags": ["sync"],
  6641. "operationId": "sync.start",
  6642. "parameters": [
  6643. {
  6644. "name": "directory",
  6645. "in": "query",
  6646. "required": false,
  6647. "schema": {
  6648. "type": "string"
  6649. }
  6650. },
  6651. {
  6652. "name": "workspace",
  6653. "in": "query",
  6654. "required": false,
  6655. "schema": {
  6656. "type": "string"
  6657. }
  6658. }
  6659. ],
  6660. "responses": {
  6661. "200": {
  6662. "description": "Workspace sync started",
  6663. "content": {
  6664. "application/json": {
  6665. "schema": {
  6666. "type": "boolean",
  6667. "description": "Workspace sync started"
  6668. }
  6669. }
  6670. }
  6671. }
  6672. },
  6673. "description": "Start sync loops for workspaces in the current project that have active sessions.",
  6674. "summary": "Start workspace sync",
  6675. "x-codeSamples": [
  6676. {
  6677. "lang": "js",
  6678. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.sync.start({\n ...\n})"
  6679. }
  6680. ]
  6681. }
  6682. },
  6683. "/sync/replay": {
  6684. "post": {
  6685. "tags": ["sync"],
  6686. "operationId": "sync.replay",
  6687. "parameters": [
  6688. {
  6689. "name": "directory",
  6690. "in": "query",
  6691. "required": false,
  6692. "schema": {
  6693. "type": "string"
  6694. }
  6695. },
  6696. {
  6697. "name": "workspace",
  6698. "in": "query",
  6699. "required": false,
  6700. "schema": {
  6701. "type": "string"
  6702. }
  6703. }
  6704. ],
  6705. "responses": {
  6706. "200": {
  6707. "description": "Replayed sync events",
  6708. "content": {
  6709. "application/json": {
  6710. "schema": {
  6711. "type": "object",
  6712. "properties": {
  6713. "sessionID": {
  6714. "type": "string"
  6715. }
  6716. },
  6717. "required": ["sessionID"],
  6718. "additionalProperties": false,
  6719. "description": "Replayed sync events"
  6720. }
  6721. }
  6722. }
  6723. },
  6724. "400": {
  6725. "description": "Bad request",
  6726. "content": {
  6727. "application/json": {
  6728. "schema": {
  6729. "$ref": "#/components/schemas/BadRequestError"
  6730. }
  6731. }
  6732. }
  6733. }
  6734. },
  6735. "description": "Validate and replay a complete sync event history.",
  6736. "summary": "Replay sync events",
  6737. "requestBody": {
  6738. "content": {
  6739. "application/json": {
  6740. "schema": {
  6741. "type": "object",
  6742. "properties": {
  6743. "directory": {
  6744. "type": "string"
  6745. },
  6746. "events": {
  6747. "type": "array",
  6748. "minItems": 1,
  6749. "items": {
  6750. "type": "object",
  6751. "properties": {
  6752. "id": {
  6753. "type": "string"
  6754. },
  6755. "aggregateID": {
  6756. "type": "string"
  6757. },
  6758. "seq": {
  6759. "type": "integer",
  6760. "minimum": 0
  6761. },
  6762. "type": {
  6763. "type": "string"
  6764. },
  6765. "data": {
  6766. "type": "object"
  6767. }
  6768. },
  6769. "required": ["id", "aggregateID", "seq", "type", "data"],
  6770. "additionalProperties": false
  6771. }
  6772. }
  6773. },
  6774. "required": ["directory", "events"],
  6775. "additionalProperties": false
  6776. }
  6777. }
  6778. }
  6779. },
  6780. "x-codeSamples": [
  6781. {
  6782. "lang": "js",
  6783. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.sync.replay({\n ...\n})"
  6784. }
  6785. ]
  6786. }
  6787. },
  6788. "/sync/steal": {
  6789. "post": {
  6790. "tags": ["sync"],
  6791. "operationId": "sync.steal",
  6792. "parameters": [
  6793. {
  6794. "name": "directory",
  6795. "in": "query",
  6796. "required": false,
  6797. "schema": {
  6798. "type": "string"
  6799. }
  6800. },
  6801. {
  6802. "name": "workspace",
  6803. "in": "query",
  6804. "required": false,
  6805. "schema": {
  6806. "type": "string"
  6807. }
  6808. }
  6809. ],
  6810. "responses": {
  6811. "200": {
  6812. "description": "Session stolen into workspace",
  6813. "content": {
  6814. "application/json": {
  6815. "schema": {
  6816. "type": "object",
  6817. "properties": {
  6818. "sessionID": {
  6819. "type": "string"
  6820. }
  6821. },
  6822. "required": ["sessionID"],
  6823. "additionalProperties": false,
  6824. "description": "Session stolen into workspace"
  6825. }
  6826. }
  6827. }
  6828. },
  6829. "400": {
  6830. "description": "Bad request",
  6831. "content": {
  6832. "application/json": {
  6833. "schema": {
  6834. "$ref": "#/components/schemas/BadRequestError"
  6835. }
  6836. }
  6837. }
  6838. }
  6839. },
  6840. "description": "Update a session to belong to the current workspace through the sync event system.",
  6841. "summary": "Steal session into workspace",
  6842. "requestBody": {
  6843. "content": {
  6844. "application/json": {
  6845. "schema": {
  6846. "type": "object",
  6847. "properties": {
  6848. "sessionID": {
  6849. "type": "string"
  6850. }
  6851. },
  6852. "required": ["sessionID"],
  6853. "additionalProperties": false
  6854. }
  6855. }
  6856. }
  6857. },
  6858. "x-codeSamples": [
  6859. {
  6860. "lang": "js",
  6861. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.sync.steal({\n ...\n})"
  6862. }
  6863. ]
  6864. }
  6865. },
  6866. "/sync/history": {
  6867. "post": {
  6868. "tags": ["sync"],
  6869. "operationId": "sync.history.list",
  6870. "parameters": [
  6871. {
  6872. "name": "directory",
  6873. "in": "query",
  6874. "required": false,
  6875. "schema": {
  6876. "type": "string"
  6877. }
  6878. },
  6879. {
  6880. "name": "workspace",
  6881. "in": "query",
  6882. "required": false,
  6883. "schema": {
  6884. "type": "string"
  6885. }
  6886. }
  6887. ],
  6888. "responses": {
  6889. "200": {
  6890. "description": "Sync events",
  6891. "content": {
  6892. "application/json": {
  6893. "schema": {
  6894. "type": "array",
  6895. "items": {
  6896. "type": "object",
  6897. "properties": {
  6898. "id": {
  6899. "type": "string"
  6900. },
  6901. "aggregate_id": {
  6902. "type": "string"
  6903. },
  6904. "seq": {
  6905. "type": "integer",
  6906. "minimum": 0
  6907. },
  6908. "type": {
  6909. "type": "string"
  6910. },
  6911. "data": {
  6912. "type": "object"
  6913. }
  6914. },
  6915. "required": ["id", "aggregate_id", "seq", "type", "data"],
  6916. "additionalProperties": false
  6917. },
  6918. "description": "Sync events"
  6919. }
  6920. }
  6921. }
  6922. },
  6923. "400": {
  6924. "description": "Bad request",
  6925. "content": {
  6926. "application/json": {
  6927. "schema": {
  6928. "$ref": "#/components/schemas/BadRequestError"
  6929. }
  6930. }
  6931. }
  6932. }
  6933. },
  6934. "description": "List sync events for all aggregates. Keys are aggregate IDs the client already knows about, values are the last known sequence ID. Events with seq > value are returned for those aggregates. Aggregates not listed in the input get their full history.",
  6935. "summary": "List sync events",
  6936. "requestBody": {
  6937. "content": {
  6938. "application/json": {
  6939. "schema": {
  6940. "type": "object",
  6941. "additionalProperties": {
  6942. "type": "integer",
  6943. "minimum": 0
  6944. }
  6945. }
  6946. }
  6947. }
  6948. },
  6949. "x-codeSamples": [
  6950. {
  6951. "lang": "js",
  6952. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.sync.history.list({\n ...\n})"
  6953. }
  6954. ]
  6955. }
  6956. },
  6957. "/api/session": {
  6958. "get": {
  6959. "tags": ["v2"],
  6960. "operationId": "v2.session.list",
  6961. "parameters": [
  6962. {
  6963. "name": "directory",
  6964. "in": "query",
  6965. "required": false,
  6966. "schema": {
  6967. "type": "string"
  6968. }
  6969. },
  6970. {
  6971. "name": "workspace",
  6972. "in": "query",
  6973. "required": false,
  6974. "schema": {
  6975. "type": "string"
  6976. }
  6977. }
  6978. ],
  6979. "responses": {
  6980. "200": {
  6981. "description": "V2SessionsResponse",
  6982. "content": {
  6983. "application/json": {
  6984. "schema": {
  6985. "$ref": "#/components/schemas/V2SessionsResponse"
  6986. }
  6987. }
  6988. }
  6989. },
  6990. "400": {
  6991. "description": "Bad request",
  6992. "content": {
  6993. "application/json": {
  6994. "schema": {
  6995. "$ref": "#/components/schemas/BadRequestError"
  6996. }
  6997. }
  6998. }
  6999. }
  7000. },
  7001. "description": "Retrieve sessions in the requested order. Items keep that order across pages; use cursor.next or cursor.previous to move through the ordered list.",
  7002. "summary": "List v2 sessions",
  7003. "x-codeSamples": [
  7004. {
  7005. "lang": "js",
  7006. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.list({\n ...\n})"
  7007. }
  7008. ]
  7009. }
  7010. },
  7011. "/api/session/{sessionID}/prompt": {
  7012. "post": {
  7013. "tags": ["v2"],
  7014. "operationId": "v2.session.prompt",
  7015. "parameters": [
  7016. {
  7017. "name": "directory",
  7018. "in": "query",
  7019. "required": false,
  7020. "schema": {
  7021. "type": "string"
  7022. }
  7023. },
  7024. {
  7025. "name": "workspace",
  7026. "in": "query",
  7027. "required": false,
  7028. "schema": {
  7029. "type": "string"
  7030. }
  7031. },
  7032. {
  7033. "name": "sessionID",
  7034. "in": "path",
  7035. "schema": {
  7036. "type": "string",
  7037. "pattern": "^ses.*"
  7038. },
  7039. "required": true
  7040. }
  7041. ],
  7042. "responses": {
  7043. "200": {
  7044. "description": "Session.Message",
  7045. "content": {
  7046. "application/json": {
  7047. "schema": {
  7048. "$ref": "#/components/schemas/SessionMessage"
  7049. }
  7050. }
  7051. }
  7052. }
  7053. },
  7054. "description": "Create a v2 session message and queue it for the agent loop.",
  7055. "summary": "Send v2 message",
  7056. "requestBody": {
  7057. "content": {
  7058. "application/json": {
  7059. "schema": {
  7060. "type": "object",
  7061. "properties": {
  7062. "prompt": {
  7063. "$ref": "#/components/schemas/Prompt"
  7064. },
  7065. "delivery": {
  7066. "$ref": "#/components/schemas/SessionDelivery"
  7067. }
  7068. },
  7069. "required": ["prompt"],
  7070. "additionalProperties": false
  7071. }
  7072. }
  7073. }
  7074. },
  7075. "x-codeSamples": [
  7076. {
  7077. "lang": "js",
  7078. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.prompt({\n ...\n})"
  7079. }
  7080. ]
  7081. }
  7082. },
  7083. "/api/session/{sessionID}/compact": {
  7084. "post": {
  7085. "tags": ["v2"],
  7086. "operationId": "v2.session.compact",
  7087. "parameters": [
  7088. {
  7089. "name": "directory",
  7090. "in": "query",
  7091. "required": false,
  7092. "schema": {
  7093. "type": "string"
  7094. }
  7095. },
  7096. {
  7097. "name": "workspace",
  7098. "in": "query",
  7099. "required": false,
  7100. "schema": {
  7101. "type": "string"
  7102. }
  7103. },
  7104. {
  7105. "name": "sessionID",
  7106. "in": "path",
  7107. "schema": {
  7108. "type": "string",
  7109. "pattern": "^ses.*"
  7110. },
  7111. "required": true
  7112. }
  7113. ],
  7114. "responses": {
  7115. "204": {
  7116. "description": "<No Content>"
  7117. }
  7118. },
  7119. "description": "Compact a v2 session conversation.",
  7120. "summary": "Compact v2 session",
  7121. "x-codeSamples": [
  7122. {
  7123. "lang": "js",
  7124. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.compact({\n ...\n})"
  7125. }
  7126. ]
  7127. }
  7128. },
  7129. "/api/session/{sessionID}/wait": {
  7130. "post": {
  7131. "tags": ["v2"],
  7132. "operationId": "v2.session.wait",
  7133. "parameters": [
  7134. {
  7135. "name": "directory",
  7136. "in": "query",
  7137. "required": false,
  7138. "schema": {
  7139. "type": "string"
  7140. }
  7141. },
  7142. {
  7143. "name": "workspace",
  7144. "in": "query",
  7145. "required": false,
  7146. "schema": {
  7147. "type": "string"
  7148. }
  7149. },
  7150. {
  7151. "name": "sessionID",
  7152. "in": "path",
  7153. "schema": {
  7154. "type": "string",
  7155. "pattern": "^ses.*"
  7156. },
  7157. "required": true
  7158. }
  7159. ],
  7160. "responses": {
  7161. "204": {
  7162. "description": "<No Content>"
  7163. }
  7164. },
  7165. "description": "Wait for a v2 session agent loop to become idle.",
  7166. "summary": "Wait for v2 session",
  7167. "x-codeSamples": [
  7168. {
  7169. "lang": "js",
  7170. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.wait({\n ...\n})"
  7171. }
  7172. ]
  7173. }
  7174. },
  7175. "/api/session/{sessionID}/context": {
  7176. "get": {
  7177. "tags": ["v2"],
  7178. "operationId": "v2.session.context",
  7179. "parameters": [
  7180. {
  7181. "name": "directory",
  7182. "in": "query",
  7183. "required": false,
  7184. "schema": {
  7185. "type": "string"
  7186. }
  7187. },
  7188. {
  7189. "name": "workspace",
  7190. "in": "query",
  7191. "required": false,
  7192. "schema": {
  7193. "type": "string"
  7194. }
  7195. },
  7196. {
  7197. "name": "sessionID",
  7198. "in": "path",
  7199. "schema": {
  7200. "type": "string",
  7201. "pattern": "^ses.*"
  7202. },
  7203. "required": true
  7204. }
  7205. ],
  7206. "responses": {
  7207. "200": {
  7208. "description": "Success",
  7209. "content": {
  7210. "application/json": {
  7211. "schema": {
  7212. "type": "array",
  7213. "items": {
  7214. "$ref": "#/components/schemas/SessionMessage"
  7215. }
  7216. }
  7217. }
  7218. }
  7219. }
  7220. },
  7221. "description": "Retrieve the active context messages for a v2 session (all messages after the last compaction).",
  7222. "summary": "Get v2 session context",
  7223. "x-codeSamples": [
  7224. {
  7225. "lang": "js",
  7226. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.context({\n ...\n})"
  7227. }
  7228. ]
  7229. }
  7230. },
  7231. "/api/session/{sessionID}/message": {
  7232. "get": {
  7233. "tags": ["v2 messages"],
  7234. "operationId": "v2.session.messages",
  7235. "parameters": [
  7236. {
  7237. "name": "directory",
  7238. "in": "query",
  7239. "required": false,
  7240. "schema": {
  7241. "type": "string"
  7242. }
  7243. },
  7244. {
  7245. "name": "workspace",
  7246. "in": "query",
  7247. "required": false,
  7248. "schema": {
  7249. "type": "string"
  7250. }
  7251. },
  7252. {
  7253. "name": "sessionID",
  7254. "in": "path",
  7255. "schema": {
  7256. "type": "string",
  7257. "pattern": "^ses.*"
  7258. },
  7259. "required": true
  7260. }
  7261. ],
  7262. "responses": {
  7263. "200": {
  7264. "description": "V2SessionMessagesResponse",
  7265. "content": {
  7266. "application/json": {
  7267. "schema": {
  7268. "$ref": "#/components/schemas/V2SessionMessagesResponse"
  7269. }
  7270. }
  7271. }
  7272. },
  7273. "400": {
  7274. "description": "Bad request",
  7275. "content": {
  7276. "application/json": {
  7277. "schema": {
  7278. "$ref": "#/components/schemas/BadRequestError"
  7279. }
  7280. }
  7281. }
  7282. }
  7283. },
  7284. "description": "Retrieve projected v2 messages for a session. Items keep the requested order across pages; use cursor.next or cursor.previous to move through the ordered timeline.",
  7285. "summary": "Get v2 session messages",
  7286. "x-codeSamples": [
  7287. {
  7288. "lang": "js",
  7289. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.messages({\n ...\n})"
  7290. }
  7291. ]
  7292. }
  7293. },
  7294. "/tui/append-prompt": {
  7295. "post": {
  7296. "tags": ["tui"],
  7297. "operationId": "tui.appendPrompt",
  7298. "parameters": [
  7299. {
  7300. "name": "directory",
  7301. "in": "query",
  7302. "required": false,
  7303. "schema": {
  7304. "type": "string"
  7305. }
  7306. },
  7307. {
  7308. "name": "workspace",
  7309. "in": "query",
  7310. "required": false,
  7311. "schema": {
  7312. "type": "string"
  7313. }
  7314. }
  7315. ],
  7316. "responses": {
  7317. "200": {
  7318. "description": "Prompt processed successfully",
  7319. "content": {
  7320. "application/json": {
  7321. "schema": {
  7322. "type": "boolean",
  7323. "description": "Prompt processed successfully"
  7324. }
  7325. }
  7326. }
  7327. },
  7328. "400": {
  7329. "description": "Bad request",
  7330. "content": {
  7331. "application/json": {
  7332. "schema": {
  7333. "$ref": "#/components/schemas/BadRequestError"
  7334. }
  7335. }
  7336. }
  7337. }
  7338. },
  7339. "description": "Append prompt to the TUI.",
  7340. "summary": "Append TUI prompt",
  7341. "requestBody": {
  7342. "content": {
  7343. "application/json": {
  7344. "schema": {
  7345. "type": "object",
  7346. "properties": {
  7347. "text": {
  7348. "type": "string"
  7349. }
  7350. },
  7351. "required": ["text"],
  7352. "additionalProperties": false
  7353. }
  7354. }
  7355. }
  7356. },
  7357. "x-codeSamples": [
  7358. {
  7359. "lang": "js",
  7360. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.appendPrompt({\n ...\n})"
  7361. }
  7362. ]
  7363. }
  7364. },
  7365. "/tui/open-help": {
  7366. "post": {
  7367. "tags": ["tui"],
  7368. "operationId": "tui.openHelp",
  7369. "parameters": [
  7370. {
  7371. "name": "directory",
  7372. "in": "query",
  7373. "required": false,
  7374. "schema": {
  7375. "type": "string"
  7376. }
  7377. },
  7378. {
  7379. "name": "workspace",
  7380. "in": "query",
  7381. "required": false,
  7382. "schema": {
  7383. "type": "string"
  7384. }
  7385. }
  7386. ],
  7387. "responses": {
  7388. "200": {
  7389. "description": "Help dialog opened successfully",
  7390. "content": {
  7391. "application/json": {
  7392. "schema": {
  7393. "type": "boolean",
  7394. "description": "Help dialog opened successfully"
  7395. }
  7396. }
  7397. }
  7398. }
  7399. },
  7400. "description": "Open the help dialog in the TUI to display user assistance information.",
  7401. "summary": "Open help dialog",
  7402. "x-codeSamples": [
  7403. {
  7404. "lang": "js",
  7405. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openHelp({\n ...\n})"
  7406. }
  7407. ]
  7408. }
  7409. },
  7410. "/tui/open-sessions": {
  7411. "post": {
  7412. "tags": ["tui"],
  7413. "operationId": "tui.openSessions",
  7414. "parameters": [
  7415. {
  7416. "name": "directory",
  7417. "in": "query",
  7418. "required": false,
  7419. "schema": {
  7420. "type": "string"
  7421. }
  7422. },
  7423. {
  7424. "name": "workspace",
  7425. "in": "query",
  7426. "required": false,
  7427. "schema": {
  7428. "type": "string"
  7429. }
  7430. }
  7431. ],
  7432. "responses": {
  7433. "200": {
  7434. "description": "Session dialog opened successfully",
  7435. "content": {
  7436. "application/json": {
  7437. "schema": {
  7438. "type": "boolean",
  7439. "description": "Session dialog opened successfully"
  7440. }
  7441. }
  7442. }
  7443. }
  7444. },
  7445. "description": "Open the session dialog.",
  7446. "summary": "Open sessions dialog",
  7447. "x-codeSamples": [
  7448. {
  7449. "lang": "js",
  7450. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openSessions({\n ...\n})"
  7451. }
  7452. ]
  7453. }
  7454. },
  7455. "/tui/open-themes": {
  7456. "post": {
  7457. "tags": ["tui"],
  7458. "operationId": "tui.openThemes",
  7459. "parameters": [
  7460. {
  7461. "name": "directory",
  7462. "in": "query",
  7463. "required": false,
  7464. "schema": {
  7465. "type": "string"
  7466. }
  7467. },
  7468. {
  7469. "name": "workspace",
  7470. "in": "query",
  7471. "required": false,
  7472. "schema": {
  7473. "type": "string"
  7474. }
  7475. }
  7476. ],
  7477. "responses": {
  7478. "200": {
  7479. "description": "Theme dialog opened successfully",
  7480. "content": {
  7481. "application/json": {
  7482. "schema": {
  7483. "type": "boolean",
  7484. "description": "Theme dialog opened successfully"
  7485. }
  7486. }
  7487. }
  7488. }
  7489. },
  7490. "description": "Open the theme dialog.",
  7491. "summary": "Open themes dialog",
  7492. "x-codeSamples": [
  7493. {
  7494. "lang": "js",
  7495. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openThemes({\n ...\n})"
  7496. }
  7497. ]
  7498. }
  7499. },
  7500. "/tui/open-models": {
  7501. "post": {
  7502. "tags": ["tui"],
  7503. "operationId": "tui.openModels",
  7504. "parameters": [
  7505. {
  7506. "name": "directory",
  7507. "in": "query",
  7508. "required": false,
  7509. "schema": {
  7510. "type": "string"
  7511. }
  7512. },
  7513. {
  7514. "name": "workspace",
  7515. "in": "query",
  7516. "required": false,
  7517. "schema": {
  7518. "type": "string"
  7519. }
  7520. }
  7521. ],
  7522. "responses": {
  7523. "200": {
  7524. "description": "Model dialog opened successfully",
  7525. "content": {
  7526. "application/json": {
  7527. "schema": {
  7528. "type": "boolean",
  7529. "description": "Model dialog opened successfully"
  7530. }
  7531. }
  7532. }
  7533. }
  7534. },
  7535. "description": "Open the model dialog.",
  7536. "summary": "Open models dialog",
  7537. "x-codeSamples": [
  7538. {
  7539. "lang": "js",
  7540. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openModels({\n ...\n})"
  7541. }
  7542. ]
  7543. }
  7544. },
  7545. "/tui/submit-prompt": {
  7546. "post": {
  7547. "tags": ["tui"],
  7548. "operationId": "tui.submitPrompt",
  7549. "parameters": [
  7550. {
  7551. "name": "directory",
  7552. "in": "query",
  7553. "required": false,
  7554. "schema": {
  7555. "type": "string"
  7556. }
  7557. },
  7558. {
  7559. "name": "workspace",
  7560. "in": "query",
  7561. "required": false,
  7562. "schema": {
  7563. "type": "string"
  7564. }
  7565. }
  7566. ],
  7567. "responses": {
  7568. "200": {
  7569. "description": "Prompt submitted successfully",
  7570. "content": {
  7571. "application/json": {
  7572. "schema": {
  7573. "type": "boolean",
  7574. "description": "Prompt submitted successfully"
  7575. }
  7576. }
  7577. }
  7578. }
  7579. },
  7580. "description": "Submit the prompt.",
  7581. "summary": "Submit TUI prompt",
  7582. "x-codeSamples": [
  7583. {
  7584. "lang": "js",
  7585. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.submitPrompt({\n ...\n})"
  7586. }
  7587. ]
  7588. }
  7589. },
  7590. "/tui/clear-prompt": {
  7591. "post": {
  7592. "tags": ["tui"],
  7593. "operationId": "tui.clearPrompt",
  7594. "parameters": [
  7595. {
  7596. "name": "directory",
  7597. "in": "query",
  7598. "required": false,
  7599. "schema": {
  7600. "type": "string"
  7601. }
  7602. },
  7603. {
  7604. "name": "workspace",
  7605. "in": "query",
  7606. "required": false,
  7607. "schema": {
  7608. "type": "string"
  7609. }
  7610. }
  7611. ],
  7612. "responses": {
  7613. "200": {
  7614. "description": "Prompt cleared successfully",
  7615. "content": {
  7616. "application/json": {
  7617. "schema": {
  7618. "type": "boolean",
  7619. "description": "Prompt cleared successfully"
  7620. }
  7621. }
  7622. }
  7623. }
  7624. },
  7625. "description": "Clear the prompt.",
  7626. "summary": "Clear TUI prompt",
  7627. "x-codeSamples": [
  7628. {
  7629. "lang": "js",
  7630. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.clearPrompt({\n ...\n})"
  7631. }
  7632. ]
  7633. }
  7634. },
  7635. "/tui/execute-command": {
  7636. "post": {
  7637. "tags": ["tui"],
  7638. "operationId": "tui.executeCommand",
  7639. "parameters": [
  7640. {
  7641. "name": "directory",
  7642. "in": "query",
  7643. "required": false,
  7644. "schema": {
  7645. "type": "string"
  7646. }
  7647. },
  7648. {
  7649. "name": "workspace",
  7650. "in": "query",
  7651. "required": false,
  7652. "schema": {
  7653. "type": "string"
  7654. }
  7655. }
  7656. ],
  7657. "responses": {
  7658. "200": {
  7659. "description": "Command executed successfully",
  7660. "content": {
  7661. "application/json": {
  7662. "schema": {
  7663. "type": "boolean",
  7664. "description": "Command executed successfully"
  7665. }
  7666. }
  7667. }
  7668. },
  7669. "400": {
  7670. "description": "Bad request",
  7671. "content": {
  7672. "application/json": {
  7673. "schema": {
  7674. "$ref": "#/components/schemas/BadRequestError"
  7675. }
  7676. }
  7677. }
  7678. }
  7679. },
  7680. "description": "Execute a TUI command.",
  7681. "summary": "Execute TUI command",
  7682. "requestBody": {
  7683. "content": {
  7684. "application/json": {
  7685. "schema": {
  7686. "type": "object",
  7687. "properties": {
  7688. "command": {
  7689. "type": "string"
  7690. }
  7691. },
  7692. "required": ["command"],
  7693. "additionalProperties": false
  7694. }
  7695. }
  7696. }
  7697. },
  7698. "x-codeSamples": [
  7699. {
  7700. "lang": "js",
  7701. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.executeCommand({\n ...\n})"
  7702. }
  7703. ]
  7704. }
  7705. },
  7706. "/tui/show-toast": {
  7707. "post": {
  7708. "tags": ["tui"],
  7709. "operationId": "tui.showToast",
  7710. "parameters": [
  7711. {
  7712. "name": "directory",
  7713. "in": "query",
  7714. "required": false,
  7715. "schema": {
  7716. "type": "string"
  7717. }
  7718. },
  7719. {
  7720. "name": "workspace",
  7721. "in": "query",
  7722. "required": false,
  7723. "schema": {
  7724. "type": "string"
  7725. }
  7726. }
  7727. ],
  7728. "responses": {
  7729. "200": {
  7730. "description": "Toast notification shown successfully",
  7731. "content": {
  7732. "application/json": {
  7733. "schema": {
  7734. "type": "boolean",
  7735. "description": "Toast notification shown successfully"
  7736. }
  7737. }
  7738. }
  7739. }
  7740. },
  7741. "description": "Show a toast notification in the TUI.",
  7742. "summary": "Show TUI toast",
  7743. "requestBody": {
  7744. "content": {
  7745. "application/json": {
  7746. "schema": {
  7747. "type": "object",
  7748. "properties": {
  7749. "title": {
  7750. "type": "string"
  7751. },
  7752. "message": {
  7753. "type": "string"
  7754. },
  7755. "variant": {
  7756. "type": "string",
  7757. "enum": ["info", "success", "warning", "error"]
  7758. },
  7759. "duration": {
  7760. "type": "integer",
  7761. "exclusiveMinimum": 0
  7762. }
  7763. },
  7764. "required": ["message", "variant"],
  7765. "additionalProperties": false
  7766. }
  7767. }
  7768. }
  7769. },
  7770. "x-codeSamples": [
  7771. {
  7772. "lang": "js",
  7773. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.showToast({\n ...\n})"
  7774. }
  7775. ]
  7776. }
  7777. },
  7778. "/tui/publish": {
  7779. "post": {
  7780. "tags": ["tui"],
  7781. "operationId": "tui.publish",
  7782. "parameters": [
  7783. {
  7784. "name": "directory",
  7785. "in": "query",
  7786. "required": false,
  7787. "schema": {
  7788. "type": "string"
  7789. }
  7790. },
  7791. {
  7792. "name": "workspace",
  7793. "in": "query",
  7794. "required": false,
  7795. "schema": {
  7796. "type": "string"
  7797. }
  7798. }
  7799. ],
  7800. "responses": {
  7801. "200": {
  7802. "description": "Event published successfully",
  7803. "content": {
  7804. "application/json": {
  7805. "schema": {
  7806. "type": "boolean",
  7807. "description": "Event published successfully"
  7808. }
  7809. }
  7810. }
  7811. },
  7812. "400": {
  7813. "description": "Bad request",
  7814. "content": {
  7815. "application/json": {
  7816. "schema": {
  7817. "$ref": "#/components/schemas/BadRequestError"
  7818. }
  7819. }
  7820. }
  7821. }
  7822. },
  7823. "description": "Publish a TUI event.",
  7824. "summary": "Publish TUI event",
  7825. "requestBody": {
  7826. "content": {
  7827. "application/json": {
  7828. "schema": {
  7829. "anyOf": [
  7830. {
  7831. "$ref": "#/components/schemas/EventTuiPromptAppend"
  7832. },
  7833. {
  7834. "$ref": "#/components/schemas/EventTuiCommandExecute"
  7835. },
  7836. {
  7837. "$ref": "#/components/schemas/EventTuiToastShow"
  7838. },
  7839. {
  7840. "$ref": "#/components/schemas/EventTuiSessionSelect"
  7841. }
  7842. ]
  7843. }
  7844. }
  7845. }
  7846. },
  7847. "x-codeSamples": [
  7848. {
  7849. "lang": "js",
  7850. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.publish({\n ...\n})"
  7851. }
  7852. ]
  7853. }
  7854. },
  7855. "/tui/select-session": {
  7856. "post": {
  7857. "tags": ["tui"],
  7858. "operationId": "tui.selectSession",
  7859. "parameters": [
  7860. {
  7861. "name": "directory",
  7862. "in": "query",
  7863. "required": false,
  7864. "schema": {
  7865. "type": "string"
  7866. }
  7867. },
  7868. {
  7869. "name": "workspace",
  7870. "in": "query",
  7871. "required": false,
  7872. "schema": {
  7873. "type": "string"
  7874. }
  7875. }
  7876. ],
  7877. "responses": {
  7878. "200": {
  7879. "description": "Session selected successfully",
  7880. "content": {
  7881. "application/json": {
  7882. "schema": {
  7883. "type": "boolean",
  7884. "description": "Session selected successfully"
  7885. }
  7886. }
  7887. }
  7888. },
  7889. "400": {
  7890. "description": "Bad request",
  7891. "content": {
  7892. "application/json": {
  7893. "schema": {
  7894. "$ref": "#/components/schemas/BadRequestError"
  7895. }
  7896. }
  7897. }
  7898. },
  7899. "404": {
  7900. "description": "Not found",
  7901. "content": {
  7902. "application/json": {
  7903. "schema": {
  7904. "$ref": "#/components/schemas/NotFoundError"
  7905. }
  7906. }
  7907. }
  7908. }
  7909. },
  7910. "description": "Navigate the TUI to display the specified session.",
  7911. "summary": "Select session",
  7912. "requestBody": {
  7913. "content": {
  7914. "application/json": {
  7915. "schema": {
  7916. "type": "object",
  7917. "properties": {
  7918. "sessionID": {
  7919. "type": "string",
  7920. "description": "Session ID to navigate to"
  7921. }
  7922. },
  7923. "required": ["sessionID"],
  7924. "additionalProperties": false
  7925. }
  7926. }
  7927. }
  7928. },
  7929. "x-codeSamples": [
  7930. {
  7931. "lang": "js",
  7932. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.selectSession({\n ...\n})"
  7933. }
  7934. ]
  7935. }
  7936. },
  7937. "/tui/control/next": {
  7938. "get": {
  7939. "tags": ["tui"],
  7940. "operationId": "tui.control.next",
  7941. "parameters": [
  7942. {
  7943. "name": "directory",
  7944. "in": "query",
  7945. "required": false,
  7946. "schema": {
  7947. "type": "string"
  7948. }
  7949. },
  7950. {
  7951. "name": "workspace",
  7952. "in": "query",
  7953. "required": false,
  7954. "schema": {
  7955. "type": "string"
  7956. }
  7957. }
  7958. ],
  7959. "responses": {
  7960. "200": {
  7961. "description": "Next TUI request",
  7962. "content": {
  7963. "application/json": {
  7964. "schema": {
  7965. "type": "object",
  7966. "properties": {
  7967. "path": {
  7968. "type": "string"
  7969. },
  7970. "body": {}
  7971. },
  7972. "required": ["path", "body"],
  7973. "additionalProperties": false,
  7974. "description": "Next TUI request"
  7975. }
  7976. }
  7977. }
  7978. }
  7979. },
  7980. "description": "Retrieve the next TUI request from the queue for processing.",
  7981. "summary": "Get next TUI request",
  7982. "x-codeSamples": [
  7983. {
  7984. "lang": "js",
  7985. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.control.next({\n ...\n})"
  7986. }
  7987. ]
  7988. }
  7989. },
  7990. "/tui/control/response": {
  7991. "post": {
  7992. "tags": ["tui"],
  7993. "operationId": "tui.control.response",
  7994. "parameters": [
  7995. {
  7996. "name": "directory",
  7997. "in": "query",
  7998. "required": false,
  7999. "schema": {
  8000. "type": "string"
  8001. }
  8002. },
  8003. {
  8004. "name": "workspace",
  8005. "in": "query",
  8006. "required": false,
  8007. "schema": {
  8008. "type": "string"
  8009. }
  8010. }
  8011. ],
  8012. "responses": {
  8013. "200": {
  8014. "description": "Response submitted successfully",
  8015. "content": {
  8016. "application/json": {
  8017. "schema": {
  8018. "type": "boolean",
  8019. "description": "Response submitted successfully"
  8020. }
  8021. }
  8022. }
  8023. }
  8024. },
  8025. "description": "Submit a response to the TUI request queue to complete a pending request.",
  8026. "summary": "Submit TUI response",
  8027. "requestBody": {
  8028. "content": {
  8029. "application/json": {
  8030. "schema": {}
  8031. }
  8032. }
  8033. },
  8034. "x-codeSamples": [
  8035. {
  8036. "lang": "js",
  8037. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.control.response({\n ...\n})"
  8038. }
  8039. ]
  8040. }
  8041. },
  8042. "/experimental/workspace/adapter": {
  8043. "get": {
  8044. "tags": ["workspace"],
  8045. "operationId": "experimental.workspace.adapter.list",
  8046. "parameters": [
  8047. {
  8048. "name": "directory",
  8049. "in": "query",
  8050. "required": false,
  8051. "schema": {
  8052. "type": "string"
  8053. }
  8054. },
  8055. {
  8056. "name": "workspace",
  8057. "in": "query",
  8058. "required": false,
  8059. "schema": {
  8060. "type": "string"
  8061. }
  8062. }
  8063. ],
  8064. "responses": {
  8065. "200": {
  8066. "description": "Workspace adapters",
  8067. "content": {
  8068. "application/json": {
  8069. "schema": {
  8070. "type": "array",
  8071. "items": {
  8072. "type": "object",
  8073. "properties": {
  8074. "type": {
  8075. "type": "string"
  8076. },
  8077. "name": {
  8078. "type": "string"
  8079. },
  8080. "description": {
  8081. "type": "string"
  8082. }
  8083. },
  8084. "required": ["type", "name", "description"],
  8085. "additionalProperties": false
  8086. },
  8087. "description": "Workspace adapters"
  8088. }
  8089. }
  8090. }
  8091. }
  8092. },
  8093. "description": "List all available workspace adapters for the current project.",
  8094. "summary": "List workspace adapters",
  8095. "x-codeSamples": [
  8096. {
  8097. "lang": "js",
  8098. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.adapter.list({\n ...\n})"
  8099. }
  8100. ]
  8101. }
  8102. },
  8103. "/experimental/workspace": {
  8104. "get": {
  8105. "tags": ["workspace"],
  8106. "operationId": "experimental.workspace.list",
  8107. "parameters": [
  8108. {
  8109. "name": "directory",
  8110. "in": "query",
  8111. "required": false,
  8112. "schema": {
  8113. "type": "string"
  8114. }
  8115. },
  8116. {
  8117. "name": "workspace",
  8118. "in": "query",
  8119. "required": false,
  8120. "schema": {
  8121. "type": "string"
  8122. }
  8123. }
  8124. ],
  8125. "responses": {
  8126. "200": {
  8127. "description": "Workspaces",
  8128. "content": {
  8129. "application/json": {
  8130. "schema": {
  8131. "type": "array",
  8132. "items": {
  8133. "$ref": "#/components/schemas/Workspace"
  8134. },
  8135. "description": "Workspaces"
  8136. }
  8137. }
  8138. }
  8139. }
  8140. },
  8141. "description": "List all workspaces.",
  8142. "summary": "List workspaces",
  8143. "x-codeSamples": [
  8144. {
  8145. "lang": "js",
  8146. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.list({\n ...\n})"
  8147. }
  8148. ]
  8149. },
  8150. "post": {
  8151. "tags": ["workspace"],
  8152. "operationId": "experimental.workspace.create",
  8153. "parameters": [
  8154. {
  8155. "name": "directory",
  8156. "in": "query",
  8157. "required": false,
  8158. "schema": {
  8159. "type": "string"
  8160. }
  8161. },
  8162. {
  8163. "name": "workspace",
  8164. "in": "query",
  8165. "required": false,
  8166. "schema": {
  8167. "type": "string"
  8168. }
  8169. }
  8170. ],
  8171. "responses": {
  8172. "200": {
  8173. "description": "Workspace created",
  8174. "content": {
  8175. "application/json": {
  8176. "schema": {
  8177. "$ref": "#/components/schemas/Workspace"
  8178. }
  8179. }
  8180. }
  8181. },
  8182. "400": {
  8183. "description": "Bad request",
  8184. "content": {
  8185. "application/json": {
  8186. "schema": {
  8187. "$ref": "#/components/schemas/BadRequestError"
  8188. }
  8189. }
  8190. }
  8191. }
  8192. },
  8193. "description": "Create a workspace for the current project.",
  8194. "summary": "Create workspace",
  8195. "requestBody": {
  8196. "content": {
  8197. "application/json": {
  8198. "schema": {
  8199. "type": "object",
  8200. "properties": {
  8201. "id": {
  8202. "type": "string"
  8203. },
  8204. "type": {
  8205. "type": "string"
  8206. },
  8207. "branch": {
  8208. "anyOf": [
  8209. {
  8210. "type": "string"
  8211. },
  8212. {
  8213. "type": "null"
  8214. }
  8215. ]
  8216. },
  8217. "extra": {
  8218. "anyOf": [
  8219. {},
  8220. {
  8221. "type": "null"
  8222. }
  8223. ]
  8224. }
  8225. },
  8226. "required": ["type", "branch"],
  8227. "additionalProperties": false
  8228. }
  8229. }
  8230. }
  8231. },
  8232. "x-codeSamples": [
  8233. {
  8234. "lang": "js",
  8235. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.create({\n ...\n})"
  8236. }
  8237. ]
  8238. }
  8239. },
  8240. "/experimental/workspace/status": {
  8241. "get": {
  8242. "tags": ["workspace"],
  8243. "operationId": "experimental.workspace.status",
  8244. "parameters": [
  8245. {
  8246. "name": "directory",
  8247. "in": "query",
  8248. "required": false,
  8249. "schema": {
  8250. "type": "string"
  8251. }
  8252. },
  8253. {
  8254. "name": "workspace",
  8255. "in": "query",
  8256. "required": false,
  8257. "schema": {
  8258. "type": "string"
  8259. }
  8260. }
  8261. ],
  8262. "responses": {
  8263. "200": {
  8264. "description": "Workspace status",
  8265. "content": {
  8266. "application/json": {
  8267. "schema": {
  8268. "type": "array",
  8269. "items": {
  8270. "type": "object",
  8271. "properties": {
  8272. "workspaceID": {
  8273. "type": "string"
  8274. },
  8275. "status": {
  8276. "type": "string",
  8277. "enum": ["connected", "connecting", "disconnected", "error"]
  8278. }
  8279. },
  8280. "required": ["workspaceID", "status"],
  8281. "additionalProperties": false
  8282. },
  8283. "description": "Workspace status"
  8284. }
  8285. }
  8286. }
  8287. }
  8288. },
  8289. "description": "Get connection status for workspaces in the current project.",
  8290. "summary": "Workspace status",
  8291. "x-codeSamples": [
  8292. {
  8293. "lang": "js",
  8294. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.status({\n ...\n})"
  8295. }
  8296. ]
  8297. }
  8298. },
  8299. "/experimental/workspace/{id}": {
  8300. "delete": {
  8301. "tags": ["workspace"],
  8302. "operationId": "experimental.workspace.remove",
  8303. "parameters": [
  8304. {
  8305. "name": "directory",
  8306. "in": "query",
  8307. "required": false,
  8308. "schema": {
  8309. "type": "string"
  8310. }
  8311. },
  8312. {
  8313. "name": "workspace",
  8314. "in": "query",
  8315. "required": false,
  8316. "schema": {
  8317. "type": "string"
  8318. }
  8319. },
  8320. {
  8321. "name": "id",
  8322. "in": "path",
  8323. "schema": {
  8324. "type": "string",
  8325. "pattern": "^wrk.*"
  8326. },
  8327. "required": true
  8328. }
  8329. ],
  8330. "responses": {
  8331. "200": {
  8332. "description": "Workspace removed",
  8333. "content": {
  8334. "application/json": {
  8335. "schema": {
  8336. "$ref": "#/components/schemas/Workspace"
  8337. }
  8338. }
  8339. }
  8340. },
  8341. "400": {
  8342. "description": "Bad request",
  8343. "content": {
  8344. "application/json": {
  8345. "schema": {
  8346. "$ref": "#/components/schemas/BadRequestError"
  8347. }
  8348. }
  8349. }
  8350. }
  8351. },
  8352. "description": "Remove an existing workspace.",
  8353. "summary": "Remove workspace",
  8354. "x-codeSamples": [
  8355. {
  8356. "lang": "js",
  8357. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.remove({\n ...\n})"
  8358. }
  8359. ]
  8360. }
  8361. },
  8362. "/experimental/workspace/warp": {
  8363. "post": {
  8364. "tags": ["workspace"],
  8365. "operationId": "experimental.workspace.warp",
  8366. "parameters": [
  8367. {
  8368. "name": "directory",
  8369. "in": "query",
  8370. "required": false,
  8371. "schema": {
  8372. "type": "string"
  8373. }
  8374. },
  8375. {
  8376. "name": "workspace",
  8377. "in": "query",
  8378. "required": false,
  8379. "schema": {
  8380. "type": "string"
  8381. }
  8382. }
  8383. ],
  8384. "responses": {
  8385. "204": {
  8386. "description": "Session warped"
  8387. },
  8388. "400": {
  8389. "description": "Bad request",
  8390. "content": {
  8391. "application/json": {
  8392. "schema": {
  8393. "$ref": "#/components/schemas/BadRequestError"
  8394. }
  8395. }
  8396. }
  8397. }
  8398. },
  8399. "description": "Move a session's sync history into the target workspace, or detach it to the local project.",
  8400. "summary": "Warp session into workspace",
  8401. "requestBody": {
  8402. "content": {
  8403. "application/json": {
  8404. "schema": {
  8405. "type": "object",
  8406. "properties": {
  8407. "id": {
  8408. "anyOf": [
  8409. {
  8410. "type": "string"
  8411. },
  8412. {
  8413. "type": "null"
  8414. }
  8415. ]
  8416. },
  8417. "sessionID": {
  8418. "type": "string"
  8419. }
  8420. },
  8421. "required": ["id", "sessionID"],
  8422. "additionalProperties": false
  8423. }
  8424. }
  8425. }
  8426. },
  8427. "x-codeSamples": [
  8428. {
  8429. "lang": "js",
  8430. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.warp({\n ...\n})"
  8431. }
  8432. ]
  8433. }
  8434. },
  8435. "/pty/{ptyID}/connect": {
  8436. "get": {
  8437. "tags": ["pty"],
  8438. "operationId": "pty.connect",
  8439. "parameters": [
  8440. {
  8441. "name": "directory",
  8442. "in": "query",
  8443. "required": false,
  8444. "schema": {
  8445. "type": "string"
  8446. }
  8447. },
  8448. {
  8449. "name": "workspace",
  8450. "in": "query",
  8451. "required": false,
  8452. "schema": {
  8453. "type": "string"
  8454. }
  8455. },
  8456. {
  8457. "name": "ptyID",
  8458. "in": "path",
  8459. "schema": {
  8460. "type": "string",
  8461. "pattern": "^pty.*"
  8462. },
  8463. "required": true
  8464. }
  8465. ],
  8466. "responses": {
  8467. "200": {
  8468. "description": "Connected session",
  8469. "content": {
  8470. "application/json": {
  8471. "schema": {
  8472. "type": "boolean",
  8473. "description": "Connected session"
  8474. }
  8475. }
  8476. }
  8477. },
  8478. "403": {
  8479. "description": "Forbidden",
  8480. "content": {
  8481. "application/json": {
  8482. "schema": {
  8483. "$ref": "#/components/schemas/effect_HttpApiError_Forbidden"
  8484. }
  8485. }
  8486. }
  8487. },
  8488. "404": {
  8489. "description": "Not found",
  8490. "content": {
  8491. "application/json": {
  8492. "schema": {
  8493. "$ref": "#/components/schemas/NotFoundError"
  8494. }
  8495. }
  8496. }
  8497. }
  8498. },
  8499. "description": "Establish a WebSocket connection to interact with a pseudo-terminal (PTY) session in real-time.",
  8500. "summary": "Connect to PTY session",
  8501. "x-codeSamples": [
  8502. {
  8503. "lang": "js",
  8504. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.connect({\n ...\n})"
  8505. }
  8506. ]
  8507. }
  8508. }
  8509. },
  8510. "components": {
  8511. "schemas": {
  8512. "Event": {
  8513. "anyOf": [
  8514. {
  8515. "$ref": "#/components/schemas/EventServerInstanceDisposed"
  8516. },
  8517. {
  8518. "$ref": "#/components/schemas/EventFileEdited"
  8519. },
  8520. {
  8521. "$ref": "#/components/schemas/EventFileWatcherUpdated"
  8522. },
  8523. {
  8524. "$ref": "#/components/schemas/EventLspClientDiagnostics"
  8525. },
  8526. {
  8527. "$ref": "#/components/schemas/EventLspUpdated"
  8528. },
  8529. {
  8530. "$ref": "#/components/schemas/EventMessagePartDelta"
  8531. },
  8532. {
  8533. "$ref": "#/components/schemas/EventPermissionAsked"
  8534. },
  8535. {
  8536. "$ref": "#/components/schemas/EventPermissionReplied"
  8537. },
  8538. {
  8539. "$ref": "#/components/schemas/EventSessionDiff"
  8540. },
  8541. {
  8542. "$ref": "#/components/schemas/EventSessionError"
  8543. },
  8544. {
  8545. "$ref": "#/components/schemas/EventInstallationUpdated"
  8546. },
  8547. {
  8548. "$ref": "#/components/schemas/EventInstallationUpdate-available"
  8549. },
  8550. {
  8551. "$ref": "#/components/schemas/EventQuestionAsked"
  8552. },
  8553. {
  8554. "$ref": "#/components/schemas/EventQuestionReplied"
  8555. },
  8556. {
  8557. "$ref": "#/components/schemas/EventQuestionRejected"
  8558. },
  8559. {
  8560. "$ref": "#/components/schemas/EventTodoUpdated"
  8561. },
  8562. {
  8563. "$ref": "#/components/schemas/EventSessionStatus"
  8564. },
  8565. {
  8566. "$ref": "#/components/schemas/EventSessionIdle"
  8567. },
  8568. {
  8569. "$ref": "#/components/schemas/EventSessionCompacted"
  8570. },
  8571. {
  8572. "$ref": "#/components/schemas/Event.tui.prompt.append"
  8573. },
  8574. {
  8575. "$ref": "#/components/schemas/Event.tui.command.execute"
  8576. },
  8577. {
  8578. "$ref": "#/components/schemas/EventTuiToastShow1"
  8579. },
  8580. {
  8581. "$ref": "#/components/schemas/Event.tui.session.select"
  8582. },
  8583. {
  8584. "$ref": "#/components/schemas/EventMcpToolsChanged"
  8585. },
  8586. {
  8587. "$ref": "#/components/schemas/EventMcpBrowserOpenFailed"
  8588. },
  8589. {
  8590. "$ref": "#/components/schemas/EventCommandExecuted"
  8591. },
  8592. {
  8593. "$ref": "#/components/schemas/EventProjectUpdated"
  8594. },
  8595. {
  8596. "$ref": "#/components/schemas/EventVcsBranchUpdated"
  8597. },
  8598. {
  8599. "$ref": "#/components/schemas/EventWorkspaceReady"
  8600. },
  8601. {
  8602. "$ref": "#/components/schemas/EventWorkspaceFailed"
  8603. },
  8604. {
  8605. "$ref": "#/components/schemas/EventWorkspaceStatus"
  8606. },
  8607. {
  8608. "$ref": "#/components/schemas/EventWorktreeReady"
  8609. },
  8610. {
  8611. "$ref": "#/components/schemas/EventWorktreeFailed"
  8612. },
  8613. {
  8614. "$ref": "#/components/schemas/EventPtyCreated"
  8615. },
  8616. {
  8617. "$ref": "#/components/schemas/EventPtyUpdated"
  8618. },
  8619. {
  8620. "$ref": "#/components/schemas/EventPtyExited"
  8621. },
  8622. {
  8623. "$ref": "#/components/schemas/EventPtyDeleted"
  8624. },
  8625. {
  8626. "$ref": "#/components/schemas/EventMessageUpdated"
  8627. },
  8628. {
  8629. "$ref": "#/components/schemas/EventMessageRemoved"
  8630. },
  8631. {
  8632. "$ref": "#/components/schemas/EventMessagePartUpdated"
  8633. },
  8634. {
  8635. "$ref": "#/components/schemas/EventMessagePartRemoved"
  8636. },
  8637. {
  8638. "$ref": "#/components/schemas/EventSessionCreated"
  8639. },
  8640. {
  8641. "$ref": "#/components/schemas/EventSessionUpdated"
  8642. },
  8643. {
  8644. "$ref": "#/components/schemas/EventSessionDeleted"
  8645. },
  8646. {
  8647. "$ref": "#/components/schemas/EventSessionNextAgentSwitched"
  8648. },
  8649. {
  8650. "$ref": "#/components/schemas/EventSessionNextModelSwitched"
  8651. },
  8652. {
  8653. "$ref": "#/components/schemas/EventSessionNextPrompted"
  8654. },
  8655. {
  8656. "$ref": "#/components/schemas/EventSessionNextSynthetic"
  8657. },
  8658. {
  8659. "$ref": "#/components/schemas/EventSessionNextShellStarted"
  8660. },
  8661. {
  8662. "$ref": "#/components/schemas/EventSessionNextShellEnded"
  8663. },
  8664. {
  8665. "$ref": "#/components/schemas/EventSessionNextStepStarted"
  8666. },
  8667. {
  8668. "$ref": "#/components/schemas/EventSessionNextStepEnded"
  8669. },
  8670. {
  8671. "$ref": "#/components/schemas/EventSessionNextStepFailed"
  8672. },
  8673. {
  8674. "$ref": "#/components/schemas/EventSessionNextTextStarted"
  8675. },
  8676. {
  8677. "$ref": "#/components/schemas/EventSessionNextTextDelta"
  8678. },
  8679. {
  8680. "$ref": "#/components/schemas/EventSessionNextTextEnded"
  8681. },
  8682. {
  8683. "$ref": "#/components/schemas/EventSessionNextReasoningStarted"
  8684. },
  8685. {
  8686. "$ref": "#/components/schemas/EventSessionNextReasoningDelta"
  8687. },
  8688. {
  8689. "$ref": "#/components/schemas/EventSessionNextReasoningEnded"
  8690. },
  8691. {
  8692. "$ref": "#/components/schemas/EventSessionNextToolInputStarted"
  8693. },
  8694. {
  8695. "$ref": "#/components/schemas/EventSessionNextToolInputDelta"
  8696. },
  8697. {
  8698. "$ref": "#/components/schemas/EventSessionNextToolInputEnded"
  8699. },
  8700. {
  8701. "$ref": "#/components/schemas/EventSessionNextToolCalled"
  8702. },
  8703. {
  8704. "$ref": "#/components/schemas/EventSessionNextToolProgress"
  8705. },
  8706. {
  8707. "$ref": "#/components/schemas/EventSessionNextToolSuccess"
  8708. },
  8709. {
  8710. "$ref": "#/components/schemas/EventSessionNextToolFailed"
  8711. },
  8712. {
  8713. "$ref": "#/components/schemas/EventSessionNextRetried"
  8714. },
  8715. {
  8716. "$ref": "#/components/schemas/EventSessionNextCompactionStarted"
  8717. },
  8718. {
  8719. "$ref": "#/components/schemas/EventSessionNextCompactionDelta"
  8720. },
  8721. {
  8722. "$ref": "#/components/schemas/EventSessionNextCompactionEnded"
  8723. },
  8724. {
  8725. "$ref": "#/components/schemas/EventServerConnected"
  8726. },
  8727. {
  8728. "$ref": "#/components/schemas/EventGlobalDisposed"
  8729. }
  8730. ]
  8731. },
  8732. "OAuth": {
  8733. "type": "object",
  8734. "properties": {
  8735. "type": {
  8736. "type": "string",
  8737. "enum": ["oauth"]
  8738. },
  8739. "refresh": {
  8740. "type": "string"
  8741. },
  8742. "access": {
  8743. "type": "string"
  8744. },
  8745. "expires": {
  8746. "type": "integer",
  8747. "minimum": 0
  8748. },
  8749. "accountId": {
  8750. "type": "string"
  8751. },
  8752. "enterpriseUrl": {
  8753. "type": "string"
  8754. }
  8755. },
  8756. "required": ["type", "refresh", "access", "expires"],
  8757. "additionalProperties": false
  8758. },
  8759. "ApiAuth": {
  8760. "type": "object",
  8761. "properties": {
  8762. "type": {
  8763. "type": "string",
  8764. "enum": ["api"]
  8765. },
  8766. "key": {
  8767. "type": "string"
  8768. },
  8769. "metadata": {
  8770. "type": "object",
  8771. "additionalProperties": {
  8772. "type": "string"
  8773. }
  8774. }
  8775. },
  8776. "required": ["type", "key"],
  8777. "additionalProperties": false
  8778. },
  8779. "WellKnownAuth": {
  8780. "type": "object",
  8781. "properties": {
  8782. "type": {
  8783. "type": "string",
  8784. "enum": ["wellknown"]
  8785. },
  8786. "key": {
  8787. "type": "string"
  8788. },
  8789. "token": {
  8790. "type": "string"
  8791. }
  8792. },
  8793. "required": ["type", "key", "token"],
  8794. "additionalProperties": false
  8795. },
  8796. "Auth": {
  8797. "anyOf": [
  8798. {
  8799. "$ref": "#/components/schemas/OAuth"
  8800. },
  8801. {
  8802. "$ref": "#/components/schemas/ApiAuth"
  8803. },
  8804. {
  8805. "$ref": "#/components/schemas/WellKnownAuth"
  8806. }
  8807. ]
  8808. },
  8809. "PermissionRequest": {
  8810. "type": "object",
  8811. "properties": {
  8812. "id": {
  8813. "type": "string"
  8814. },
  8815. "sessionID": {
  8816. "type": "string"
  8817. },
  8818. "permission": {
  8819. "type": "string"
  8820. },
  8821. "patterns": {
  8822. "type": "array",
  8823. "items": {
  8824. "type": "string"
  8825. }
  8826. },
  8827. "metadata": {
  8828. "type": "object"
  8829. },
  8830. "always": {
  8831. "type": "array",
  8832. "items": {
  8833. "type": "string"
  8834. }
  8835. },
  8836. "tool": {
  8837. "type": "object",
  8838. "properties": {
  8839. "messageID": {
  8840. "type": "string"
  8841. },
  8842. "callID": {
  8843. "type": "string"
  8844. }
  8845. },
  8846. "required": ["messageID", "callID"],
  8847. "additionalProperties": false
  8848. }
  8849. },
  8850. "required": ["id", "sessionID", "permission", "patterns", "metadata", "always"],
  8851. "additionalProperties": false
  8852. },
  8853. "SnapshotFileDiff": {
  8854. "type": "object",
  8855. "properties": {
  8856. "file": {
  8857. "type": "string"
  8858. },
  8859. "patch": {
  8860. "type": "string"
  8861. },
  8862. "additions": {
  8863. "type": "integer",
  8864. "minimum": 0
  8865. },
  8866. "deletions": {
  8867. "type": "integer",
  8868. "minimum": 0
  8869. },
  8870. "status": {
  8871. "type": "string",
  8872. "enum": ["added", "deleted", "modified"]
  8873. }
  8874. },
  8875. "required": ["file", "patch", "additions", "deletions"],
  8876. "additionalProperties": false
  8877. },
  8878. "ProviderAuthError": {
  8879. "type": "object",
  8880. "properties": {
  8881. "name": {
  8882. "type": "string",
  8883. "enum": ["ProviderAuthError"]
  8884. },
  8885. "data": {
  8886. "type": "object",
  8887. "properties": {
  8888. "providerID": {
  8889. "type": "string"
  8890. },
  8891. "message": {
  8892. "type": "string"
  8893. }
  8894. },
  8895. "required": ["providerID", "message"],
  8896. "additionalProperties": false
  8897. }
  8898. },
  8899. "required": ["name", "data"],
  8900. "additionalProperties": false
  8901. },
  8902. "UnknownError": {
  8903. "type": "object",
  8904. "properties": {
  8905. "name": {
  8906. "type": "string",
  8907. "enum": ["UnknownError"]
  8908. },
  8909. "data": {
  8910. "type": "object",
  8911. "properties": {
  8912. "message": {
  8913. "type": "string"
  8914. }
  8915. },
  8916. "required": ["message"],
  8917. "additionalProperties": false
  8918. }
  8919. },
  8920. "required": ["name", "data"],
  8921. "additionalProperties": false
  8922. },
  8923. "MessageOutputLengthError": {
  8924. "type": "object",
  8925. "properties": {
  8926. "name": {
  8927. "type": "string",
  8928. "enum": ["MessageOutputLengthError"]
  8929. },
  8930. "data": {
  8931. "type": "object",
  8932. "properties": {}
  8933. }
  8934. },
  8935. "required": ["name", "data"],
  8936. "additionalProperties": false
  8937. },
  8938. "MessageAbortedError": {
  8939. "type": "object",
  8940. "properties": {
  8941. "name": {
  8942. "type": "string",
  8943. "enum": ["MessageAbortedError"]
  8944. },
  8945. "data": {
  8946. "type": "object",
  8947. "properties": {
  8948. "message": {
  8949. "type": "string"
  8950. }
  8951. },
  8952. "required": ["message"],
  8953. "additionalProperties": false
  8954. }
  8955. },
  8956. "required": ["name", "data"],
  8957. "additionalProperties": false
  8958. },
  8959. "StructuredOutputError": {
  8960. "type": "object",
  8961. "properties": {
  8962. "name": {
  8963. "type": "string",
  8964. "enum": ["StructuredOutputError"]
  8965. },
  8966. "data": {
  8967. "type": "object",
  8968. "properties": {
  8969. "message": {
  8970. "type": "string"
  8971. },
  8972. "retries": {
  8973. "type": "integer",
  8974. "minimum": 0
  8975. }
  8976. },
  8977. "required": ["message", "retries"],
  8978. "additionalProperties": false
  8979. }
  8980. },
  8981. "required": ["name", "data"],
  8982. "additionalProperties": false
  8983. },
  8984. "ContextOverflowError": {
  8985. "type": "object",
  8986. "properties": {
  8987. "name": {
  8988. "type": "string",
  8989. "enum": ["ContextOverflowError"]
  8990. },
  8991. "data": {
  8992. "type": "object",
  8993. "properties": {
  8994. "message": {
  8995. "type": "string"
  8996. },
  8997. "responseBody": {
  8998. "type": "string"
  8999. }
  9000. },
  9001. "required": ["message"],
  9002. "additionalProperties": false
  9003. }
  9004. },
  9005. "required": ["name", "data"],
  9006. "additionalProperties": false
  9007. },
  9008. "APIError": {
  9009. "type": "object",
  9010. "properties": {
  9011. "name": {
  9012. "type": "string",
  9013. "enum": ["APIError"]
  9014. },
  9015. "data": {
  9016. "type": "object",
  9017. "properties": {
  9018. "message": {
  9019. "type": "string"
  9020. },
  9021. "statusCode": {
  9022. "type": "integer",
  9023. "minimum": 0
  9024. },
  9025. "isRetryable": {
  9026. "type": "boolean"
  9027. },
  9028. "responseHeaders": {
  9029. "type": "object",
  9030. "additionalProperties": {
  9031. "type": "string"
  9032. }
  9033. },
  9034. "responseBody": {
  9035. "type": "string"
  9036. },
  9037. "metadata": {
  9038. "type": "object",
  9039. "additionalProperties": {
  9040. "type": "string"
  9041. }
  9042. }
  9043. },
  9044. "required": ["message", "isRetryable"],
  9045. "additionalProperties": false
  9046. }
  9047. },
  9048. "required": ["name", "data"],
  9049. "additionalProperties": false
  9050. },
  9051. "QuestionOption": {
  9052. "type": "object",
  9053. "properties": {
  9054. "label": {
  9055. "type": "string",
  9056. "description": "Display text (1-5 words, concise)"
  9057. },
  9058. "description": {
  9059. "type": "string",
  9060. "description": "Explanation of choice"
  9061. }
  9062. },
  9063. "required": ["label", "description"],
  9064. "additionalProperties": false
  9065. },
  9066. "QuestionInfo": {
  9067. "type": "object",
  9068. "properties": {
  9069. "question": {
  9070. "type": "string",
  9071. "description": "Complete question"
  9072. },
  9073. "header": {
  9074. "type": "string",
  9075. "description": "Very short label (max 30 chars)"
  9076. },
  9077. "options": {
  9078. "type": "array",
  9079. "items": {
  9080. "$ref": "#/components/schemas/QuestionOption"
  9081. },
  9082. "description": "Available choices"
  9083. },
  9084. "multiple": {
  9085. "type": "boolean"
  9086. },
  9087. "custom": {
  9088. "type": "boolean"
  9089. }
  9090. },
  9091. "required": ["question", "header", "options"],
  9092. "additionalProperties": false
  9093. },
  9094. "QuestionTool": {
  9095. "type": "object",
  9096. "properties": {
  9097. "messageID": {
  9098. "type": "string"
  9099. },
  9100. "callID": {
  9101. "type": "string"
  9102. }
  9103. },
  9104. "required": ["messageID", "callID"],
  9105. "additionalProperties": false
  9106. },
  9107. "QuestionRequest": {
  9108. "type": "object",
  9109. "properties": {
  9110. "id": {
  9111. "type": "string"
  9112. },
  9113. "sessionID": {
  9114. "type": "string"
  9115. },
  9116. "questions": {
  9117. "type": "array",
  9118. "items": {
  9119. "$ref": "#/components/schemas/QuestionInfo"
  9120. },
  9121. "description": "Questions to ask"
  9122. },
  9123. "tool": {
  9124. "$ref": "#/components/schemas/QuestionTool"
  9125. }
  9126. },
  9127. "required": ["id", "sessionID", "questions"],
  9128. "additionalProperties": false
  9129. },
  9130. "QuestionAnswer": {
  9131. "type": "array",
  9132. "items": {
  9133. "type": "string"
  9134. }
  9135. },
  9136. "QuestionReplied": {
  9137. "type": "object",
  9138. "properties": {
  9139. "sessionID": {
  9140. "type": "string"
  9141. },
  9142. "requestID": {
  9143. "type": "string"
  9144. },
  9145. "answers": {
  9146. "type": "array",
  9147. "items": {
  9148. "$ref": "#/components/schemas/QuestionAnswer"
  9149. }
  9150. }
  9151. },
  9152. "required": ["sessionID", "requestID", "answers"],
  9153. "additionalProperties": false
  9154. },
  9155. "QuestionRejected": {
  9156. "type": "object",
  9157. "properties": {
  9158. "sessionID": {
  9159. "type": "string"
  9160. },
  9161. "requestID": {
  9162. "type": "string"
  9163. }
  9164. },
  9165. "required": ["sessionID", "requestID"],
  9166. "additionalProperties": false
  9167. },
  9168. "Todo": {
  9169. "type": "object",
  9170. "properties": {
  9171. "content": {
  9172. "type": "string",
  9173. "description": "Brief description of the task"
  9174. },
  9175. "status": {
  9176. "type": "string",
  9177. "description": "Current status of the task: pending, in_progress, completed, cancelled"
  9178. },
  9179. "priority": {
  9180. "type": "string",
  9181. "description": "Priority level of the task: high, medium, low"
  9182. }
  9183. },
  9184. "required": ["content", "status", "priority"],
  9185. "additionalProperties": false
  9186. },
  9187. "SessionStatus": {
  9188. "anyOf": [
  9189. {
  9190. "type": "object",
  9191. "properties": {
  9192. "type": {
  9193. "type": "string",
  9194. "enum": ["idle"]
  9195. }
  9196. },
  9197. "required": ["type"],
  9198. "additionalProperties": false
  9199. },
  9200. {
  9201. "type": "object",
  9202. "properties": {
  9203. "type": {
  9204. "type": "string",
  9205. "enum": ["retry"]
  9206. },
  9207. "attempt": {
  9208. "type": "integer",
  9209. "minimum": 0
  9210. },
  9211. "message": {
  9212. "type": "string"
  9213. },
  9214. "next": {
  9215. "type": "integer",
  9216. "minimum": 0
  9217. }
  9218. },
  9219. "required": ["type", "attempt", "message", "next"],
  9220. "additionalProperties": false
  9221. },
  9222. {
  9223. "type": "object",
  9224. "properties": {
  9225. "type": {
  9226. "type": "string",
  9227. "enum": ["busy"]
  9228. }
  9229. },
  9230. "required": ["type"],
  9231. "additionalProperties": false
  9232. }
  9233. ]
  9234. },
  9235. "Event.tui.prompt.append": {
  9236. "type": "object",
  9237. "properties": {
  9238. "id": {
  9239. "type": "string"
  9240. },
  9241. "type": {
  9242. "type": "string",
  9243. "enum": ["tui.prompt.append"]
  9244. },
  9245. "properties": {
  9246. "type": "object",
  9247. "properties": {
  9248. "text": {
  9249. "type": "string"
  9250. }
  9251. },
  9252. "required": ["text"],
  9253. "additionalProperties": false
  9254. }
  9255. },
  9256. "required": ["id", "type", "properties"],
  9257. "additionalProperties": false
  9258. },
  9259. "Event.tui.command.execute": {
  9260. "type": "object",
  9261. "properties": {
  9262. "id": {
  9263. "type": "string"
  9264. },
  9265. "type": {
  9266. "type": "string",
  9267. "enum": ["tui.command.execute"]
  9268. },
  9269. "properties": {
  9270. "type": "object",
  9271. "properties": {
  9272. "command": {
  9273. "anyOf": [
  9274. {
  9275. "type": "string",
  9276. "enum": [
  9277. "session.list",
  9278. "session.new",
  9279. "session.share",
  9280. "session.interrupt",
  9281. "session.compact",
  9282. "session.page.up",
  9283. "session.page.down",
  9284. "session.line.up",
  9285. "session.line.down",
  9286. "session.half.page.up",
  9287. "session.half.page.down",
  9288. "session.first",
  9289. "session.last",
  9290. "prompt.clear",
  9291. "prompt.submit",
  9292. "agent.cycle"
  9293. ]
  9294. },
  9295. {
  9296. "type": "string"
  9297. }
  9298. ]
  9299. }
  9300. },
  9301. "required": ["command"],
  9302. "additionalProperties": false
  9303. }
  9304. },
  9305. "required": ["id", "type", "properties"],
  9306. "additionalProperties": false
  9307. },
  9308. "Event.tui.toast.show": {
  9309. "type": "object",
  9310. "properties": {
  9311. "id": {
  9312. "type": "string"
  9313. },
  9314. "type": {
  9315. "type": "string",
  9316. "enum": ["tui.toast.show"]
  9317. },
  9318. "properties": {
  9319. "type": "object",
  9320. "properties": {
  9321. "title": {
  9322. "type": "string"
  9323. },
  9324. "message": {
  9325. "type": "string"
  9326. },
  9327. "variant": {
  9328. "type": "string",
  9329. "enum": ["info", "success", "warning", "error"]
  9330. },
  9331. "duration": {
  9332. "type": "integer",
  9333. "exclusiveMinimum": 0
  9334. }
  9335. },
  9336. "required": ["message", "variant"],
  9337. "additionalProperties": false
  9338. }
  9339. },
  9340. "required": ["id", "type", "properties"],
  9341. "additionalProperties": false
  9342. },
  9343. "Event.tui.session.select": {
  9344. "type": "object",
  9345. "properties": {
  9346. "id": {
  9347. "type": "string"
  9348. },
  9349. "type": {
  9350. "type": "string",
  9351. "enum": ["tui.session.select"]
  9352. },
  9353. "properties": {
  9354. "type": "object",
  9355. "properties": {
  9356. "sessionID": {
  9357. "type": "string",
  9358. "description": "Session ID to navigate to"
  9359. }
  9360. },
  9361. "required": ["sessionID"],
  9362. "additionalProperties": false
  9363. }
  9364. },
  9365. "required": ["id", "type", "properties"],
  9366. "additionalProperties": false
  9367. },
  9368. "Project": {
  9369. "type": "object",
  9370. "properties": {
  9371. "id": {
  9372. "type": "string"
  9373. },
  9374. "worktree": {
  9375. "type": "string"
  9376. },
  9377. "vcs": {
  9378. "type": "string",
  9379. "enum": ["git"]
  9380. },
  9381. "name": {
  9382. "type": "string"
  9383. },
  9384. "icon": {
  9385. "type": "object",
  9386. "properties": {
  9387. "url": {
  9388. "type": "string"
  9389. },
  9390. "override": {
  9391. "type": "string"
  9392. },
  9393. "color": {
  9394. "type": "string"
  9395. }
  9396. },
  9397. "additionalProperties": false
  9398. },
  9399. "commands": {
  9400. "type": "object",
  9401. "properties": {
  9402. "start": {
  9403. "type": "string",
  9404. "description": "Startup script to run when creating a new workspace (worktree)"
  9405. }
  9406. },
  9407. "additionalProperties": false
  9408. },
  9409. "time": {
  9410. "type": "object",
  9411. "properties": {
  9412. "created": {
  9413. "type": "integer",
  9414. "minimum": 0
  9415. },
  9416. "updated": {
  9417. "type": "integer",
  9418. "minimum": 0
  9419. },
  9420. "initialized": {
  9421. "type": "integer",
  9422. "minimum": 0
  9423. }
  9424. },
  9425. "required": ["created", "updated"],
  9426. "additionalProperties": false
  9427. },
  9428. "sandboxes": {
  9429. "type": "array",
  9430. "items": {
  9431. "type": "string"
  9432. }
  9433. }
  9434. },
  9435. "required": ["id", "worktree", "time", "sandboxes"],
  9436. "additionalProperties": false
  9437. },
  9438. "Pty": {
  9439. "type": "object",
  9440. "properties": {
  9441. "id": {
  9442. "type": "string"
  9443. },
  9444. "title": {
  9445. "type": "string"
  9446. },
  9447. "command": {
  9448. "type": "string"
  9449. },
  9450. "args": {
  9451. "type": "array",
  9452. "items": {
  9453. "type": "string"
  9454. }
  9455. },
  9456. "cwd": {
  9457. "type": "string"
  9458. },
  9459. "status": {
  9460. "type": "string",
  9461. "enum": ["running", "exited"]
  9462. },
  9463. "pid": {
  9464. "type": "integer",
  9465. "exclusiveMinimum": 0
  9466. }
  9467. },
  9468. "required": ["id", "title", "command", "args", "cwd", "status", "pid"],
  9469. "additionalProperties": false
  9470. },
  9471. "OutputFormatText": {
  9472. "type": "object",
  9473. "properties": {
  9474. "type": {
  9475. "type": "string",
  9476. "enum": ["text"]
  9477. }
  9478. },
  9479. "required": ["type"],
  9480. "additionalProperties": false
  9481. },
  9482. "JSONSchema": {
  9483. "type": "object"
  9484. },
  9485. "OutputFormatJsonSchema": {
  9486. "type": "object",
  9487. "properties": {
  9488. "type": {
  9489. "type": "string",
  9490. "enum": ["json_schema"]
  9491. },
  9492. "schema": {
  9493. "$ref": "#/components/schemas/JSONSchema"
  9494. },
  9495. "retryCount": {
  9496. "type": "integer",
  9497. "minimum": 0
  9498. }
  9499. },
  9500. "required": ["type", "schema"],
  9501. "additionalProperties": false
  9502. },
  9503. "OutputFormat": {
  9504. "anyOf": [
  9505. {
  9506. "$ref": "#/components/schemas/OutputFormatText"
  9507. },
  9508. {
  9509. "$ref": "#/components/schemas/OutputFormatJsonSchema"
  9510. }
  9511. ]
  9512. },
  9513. "UserMessage": {
  9514. "type": "object",
  9515. "properties": {
  9516. "id": {
  9517. "type": "string"
  9518. },
  9519. "sessionID": {
  9520. "type": "string"
  9521. },
  9522. "role": {
  9523. "type": "string",
  9524. "enum": ["user"]
  9525. },
  9526. "time": {
  9527. "type": "object",
  9528. "properties": {
  9529. "created": {
  9530. "type": "integer",
  9531. "minimum": 0
  9532. }
  9533. },
  9534. "required": ["created"],
  9535. "additionalProperties": false
  9536. },
  9537. "format": {
  9538. "$ref": "#/components/schemas/OutputFormat"
  9539. },
  9540. "summary": {
  9541. "type": "object",
  9542. "properties": {
  9543. "title": {
  9544. "type": "string"
  9545. },
  9546. "body": {
  9547. "type": "string"
  9548. },
  9549. "diffs": {
  9550. "type": "array",
  9551. "items": {
  9552. "$ref": "#/components/schemas/SnapshotFileDiff"
  9553. }
  9554. }
  9555. },
  9556. "required": ["diffs"],
  9557. "additionalProperties": false
  9558. },
  9559. "agent": {
  9560. "type": "string"
  9561. },
  9562. "model": {
  9563. "type": "object",
  9564. "properties": {
  9565. "providerID": {
  9566. "type": "string"
  9567. },
  9568. "modelID": {
  9569. "type": "string"
  9570. },
  9571. "variant": {
  9572. "type": "string"
  9573. }
  9574. },
  9575. "required": ["providerID", "modelID"],
  9576. "additionalProperties": false
  9577. },
  9578. "system": {
  9579. "type": "string"
  9580. },
  9581. "tools": {
  9582. "type": "object",
  9583. "additionalProperties": {
  9584. "type": "boolean"
  9585. }
  9586. }
  9587. },
  9588. "required": ["id", "sessionID", "role", "time", "agent", "model"],
  9589. "additionalProperties": false
  9590. },
  9591. "AssistantMessage": {
  9592. "type": "object",
  9593. "properties": {
  9594. "id": {
  9595. "type": "string"
  9596. },
  9597. "sessionID": {
  9598. "type": "string"
  9599. },
  9600. "role": {
  9601. "type": "string",
  9602. "enum": ["assistant"]
  9603. },
  9604. "time": {
  9605. "type": "object",
  9606. "properties": {
  9607. "created": {
  9608. "type": "integer",
  9609. "minimum": 0
  9610. },
  9611. "completed": {
  9612. "type": "integer",
  9613. "minimum": 0
  9614. }
  9615. },
  9616. "required": ["created"],
  9617. "additionalProperties": false
  9618. },
  9619. "error": {
  9620. "anyOf": [
  9621. {
  9622. "$ref": "#/components/schemas/ProviderAuthError"
  9623. },
  9624. {
  9625. "$ref": "#/components/schemas/UnknownError"
  9626. },
  9627. {
  9628. "$ref": "#/components/schemas/MessageOutputLengthError"
  9629. },
  9630. {
  9631. "$ref": "#/components/schemas/MessageAbortedError"
  9632. },
  9633. {
  9634. "$ref": "#/components/schemas/StructuredOutputError"
  9635. },
  9636. {
  9637. "$ref": "#/components/schemas/ContextOverflowError"
  9638. },
  9639. {
  9640. "$ref": "#/components/schemas/APIError"
  9641. }
  9642. ]
  9643. },
  9644. "parentID": {
  9645. "type": "string"
  9646. },
  9647. "modelID": {
  9648. "type": "string"
  9649. },
  9650. "providerID": {
  9651. "type": "string"
  9652. },
  9653. "mode": {
  9654. "type": "string"
  9655. },
  9656. "agent": {
  9657. "type": "string"
  9658. },
  9659. "path": {
  9660. "type": "object",
  9661. "properties": {
  9662. "cwd": {
  9663. "type": "string"
  9664. },
  9665. "root": {
  9666. "type": "string"
  9667. }
  9668. },
  9669. "required": ["cwd", "root"],
  9670. "additionalProperties": false
  9671. },
  9672. "summary": {
  9673. "type": "boolean"
  9674. },
  9675. "cost": {
  9676. "type": "number"
  9677. },
  9678. "tokens": {
  9679. "type": "object",
  9680. "properties": {
  9681. "total": {
  9682. "type": "integer",
  9683. "minimum": 0
  9684. },
  9685. "input": {
  9686. "type": "integer",
  9687. "minimum": 0
  9688. },
  9689. "output": {
  9690. "type": "integer",
  9691. "minimum": 0
  9692. },
  9693. "reasoning": {
  9694. "type": "integer",
  9695. "minimum": 0
  9696. },
  9697. "cache": {
  9698. "type": "object",
  9699. "properties": {
  9700. "read": {
  9701. "type": "integer",
  9702. "minimum": 0
  9703. },
  9704. "write": {
  9705. "type": "integer",
  9706. "minimum": 0
  9707. }
  9708. },
  9709. "required": ["read", "write"],
  9710. "additionalProperties": false
  9711. }
  9712. },
  9713. "required": ["input", "output", "reasoning", "cache"],
  9714. "additionalProperties": false
  9715. },
  9716. "structured": {},
  9717. "variant": {
  9718. "type": "string"
  9719. },
  9720. "finish": {
  9721. "type": "string"
  9722. }
  9723. },
  9724. "required": [
  9725. "id",
  9726. "sessionID",
  9727. "role",
  9728. "time",
  9729. "parentID",
  9730. "modelID",
  9731. "providerID",
  9732. "mode",
  9733. "agent",
  9734. "path",
  9735. "cost",
  9736. "tokens"
  9737. ],
  9738. "additionalProperties": false
  9739. },
  9740. "Message": {
  9741. "anyOf": [
  9742. {
  9743. "$ref": "#/components/schemas/UserMessage"
  9744. },
  9745. {
  9746. "$ref": "#/components/schemas/AssistantMessage"
  9747. }
  9748. ]
  9749. },
  9750. "TextPart": {
  9751. "type": "object",
  9752. "properties": {
  9753. "id": {
  9754. "type": "string"
  9755. },
  9756. "sessionID": {
  9757. "type": "string"
  9758. },
  9759. "messageID": {
  9760. "type": "string"
  9761. },
  9762. "type": {
  9763. "type": "string",
  9764. "enum": ["text"]
  9765. },
  9766. "text": {
  9767. "type": "string"
  9768. },
  9769. "synthetic": {
  9770. "type": "boolean"
  9771. },
  9772. "ignored": {
  9773. "type": "boolean"
  9774. },
  9775. "time": {
  9776. "type": "object",
  9777. "properties": {
  9778. "start": {
  9779. "type": "integer",
  9780. "minimum": 0
  9781. },
  9782. "end": {
  9783. "type": "integer",
  9784. "minimum": 0
  9785. }
  9786. },
  9787. "required": ["start"],
  9788. "additionalProperties": false
  9789. },
  9790. "metadata": {
  9791. "type": "object"
  9792. }
  9793. },
  9794. "required": ["id", "sessionID", "messageID", "type", "text"],
  9795. "additionalProperties": false
  9796. },
  9797. "SubtaskPart": {
  9798. "type": "object",
  9799. "properties": {
  9800. "id": {
  9801. "type": "string"
  9802. },
  9803. "sessionID": {
  9804. "type": "string"
  9805. },
  9806. "messageID": {
  9807. "type": "string"
  9808. },
  9809. "type": {
  9810. "type": "string",
  9811. "enum": ["subtask"]
  9812. },
  9813. "prompt": {
  9814. "type": "string"
  9815. },
  9816. "description": {
  9817. "type": "string"
  9818. },
  9819. "agent": {
  9820. "type": "string"
  9821. },
  9822. "model": {
  9823. "type": "object",
  9824. "properties": {
  9825. "providerID": {
  9826. "type": "string"
  9827. },
  9828. "modelID": {
  9829. "type": "string"
  9830. }
  9831. },
  9832. "required": ["providerID", "modelID"],
  9833. "additionalProperties": false
  9834. },
  9835. "command": {
  9836. "type": "string"
  9837. }
  9838. },
  9839. "required": ["id", "sessionID", "messageID", "type", "prompt", "description", "agent"],
  9840. "additionalProperties": false
  9841. },
  9842. "ReasoningPart": {
  9843. "type": "object",
  9844. "properties": {
  9845. "id": {
  9846. "type": "string"
  9847. },
  9848. "sessionID": {
  9849. "type": "string"
  9850. },
  9851. "messageID": {
  9852. "type": "string"
  9853. },
  9854. "type": {
  9855. "type": "string",
  9856. "enum": ["reasoning"]
  9857. },
  9858. "text": {
  9859. "type": "string"
  9860. },
  9861. "metadata": {
  9862. "type": "object"
  9863. },
  9864. "time": {
  9865. "type": "object",
  9866. "properties": {
  9867. "start": {
  9868. "type": "integer",
  9869. "minimum": 0
  9870. },
  9871. "end": {
  9872. "type": "integer",
  9873. "minimum": 0
  9874. }
  9875. },
  9876. "required": ["start"],
  9877. "additionalProperties": false
  9878. }
  9879. },
  9880. "required": ["id", "sessionID", "messageID", "type", "text", "time"],
  9881. "additionalProperties": false
  9882. },
  9883. "FilePartSourceText": {
  9884. "type": "object",
  9885. "properties": {
  9886. "value": {
  9887. "type": "string"
  9888. },
  9889. "start": {
  9890. "type": "integer",
  9891. "minimum": 0
  9892. },
  9893. "end": {
  9894. "type": "integer",
  9895. "minimum": 0
  9896. }
  9897. },
  9898. "required": ["value", "start", "end"],
  9899. "additionalProperties": false
  9900. },
  9901. "FileSource": {
  9902. "type": "object",
  9903. "properties": {
  9904. "text": {
  9905. "$ref": "#/components/schemas/FilePartSourceText"
  9906. },
  9907. "type": {
  9908. "type": "string",
  9909. "enum": ["file"]
  9910. },
  9911. "path": {
  9912. "type": "string"
  9913. }
  9914. },
  9915. "required": ["text", "type", "path"],
  9916. "additionalProperties": false
  9917. },
  9918. "Range": {
  9919. "type": "object",
  9920. "properties": {
  9921. "start": {
  9922. "type": "object",
  9923. "properties": {
  9924. "line": {
  9925. "type": "integer",
  9926. "minimum": 0
  9927. },
  9928. "character": {
  9929. "type": "integer",
  9930. "minimum": 0
  9931. }
  9932. },
  9933. "required": ["line", "character"],
  9934. "additionalProperties": false
  9935. },
  9936. "end": {
  9937. "type": "object",
  9938. "properties": {
  9939. "line": {
  9940. "type": "integer",
  9941. "minimum": 0
  9942. },
  9943. "character": {
  9944. "type": "integer",
  9945. "minimum": 0
  9946. }
  9947. },
  9948. "required": ["line", "character"],
  9949. "additionalProperties": false
  9950. }
  9951. },
  9952. "required": ["start", "end"],
  9953. "additionalProperties": false
  9954. },
  9955. "SymbolSource": {
  9956. "type": "object",
  9957. "properties": {
  9958. "text": {
  9959. "$ref": "#/components/schemas/FilePartSourceText"
  9960. },
  9961. "type": {
  9962. "type": "string",
  9963. "enum": ["symbol"]
  9964. },
  9965. "path": {
  9966. "type": "string"
  9967. },
  9968. "range": {
  9969. "$ref": "#/components/schemas/Range"
  9970. },
  9971. "name": {
  9972. "type": "string"
  9973. },
  9974. "kind": {
  9975. "type": "integer",
  9976. "minimum": 0
  9977. }
  9978. },
  9979. "required": ["text", "type", "path", "range", "name", "kind"],
  9980. "additionalProperties": false
  9981. },
  9982. "ResourceSource": {
  9983. "type": "object",
  9984. "properties": {
  9985. "text": {
  9986. "$ref": "#/components/schemas/FilePartSourceText"
  9987. },
  9988. "type": {
  9989. "type": "string",
  9990. "enum": ["resource"]
  9991. },
  9992. "clientName": {
  9993. "type": "string"
  9994. },
  9995. "uri": {
  9996. "type": "string"
  9997. }
  9998. },
  9999. "required": ["text", "type", "clientName", "uri"],
  10000. "additionalProperties": false
  10001. },
  10002. "FilePartSource": {
  10003. "anyOf": [
  10004. {
  10005. "$ref": "#/components/schemas/FileSource"
  10006. },
  10007. {
  10008. "$ref": "#/components/schemas/SymbolSource"
  10009. },
  10010. {
  10011. "$ref": "#/components/schemas/ResourceSource"
  10012. }
  10013. ]
  10014. },
  10015. "FilePart": {
  10016. "type": "object",
  10017. "properties": {
  10018. "id": {
  10019. "type": "string"
  10020. },
  10021. "sessionID": {
  10022. "type": "string"
  10023. },
  10024. "messageID": {
  10025. "type": "string"
  10026. },
  10027. "type": {
  10028. "type": "string",
  10029. "enum": ["file"]
  10030. },
  10031. "mime": {
  10032. "type": "string"
  10033. },
  10034. "filename": {
  10035. "type": "string"
  10036. },
  10037. "url": {
  10038. "type": "string"
  10039. },
  10040. "source": {
  10041. "$ref": "#/components/schemas/FilePartSource"
  10042. }
  10043. },
  10044. "required": ["id", "sessionID", "messageID", "type", "mime", "url"],
  10045. "additionalProperties": false
  10046. },
  10047. "ToolStatePending": {
  10048. "type": "object",
  10049. "properties": {
  10050. "status": {
  10051. "type": "string",
  10052. "enum": ["pending"]
  10053. },
  10054. "input": {
  10055. "type": "object"
  10056. },
  10057. "raw": {
  10058. "type": "string"
  10059. }
  10060. },
  10061. "required": ["status", "input", "raw"],
  10062. "additionalProperties": false
  10063. },
  10064. "ToolStateRunning": {
  10065. "type": "object",
  10066. "properties": {
  10067. "status": {
  10068. "type": "string",
  10069. "enum": ["running"]
  10070. },
  10071. "input": {
  10072. "type": "object"
  10073. },
  10074. "title": {
  10075. "type": "string"
  10076. },
  10077. "metadata": {
  10078. "type": "object"
  10079. },
  10080. "time": {
  10081. "type": "object",
  10082. "properties": {
  10083. "start": {
  10084. "type": "integer",
  10085. "minimum": 0
  10086. }
  10087. },
  10088. "required": ["start"],
  10089. "additionalProperties": false
  10090. }
  10091. },
  10092. "required": ["status", "input", "time"],
  10093. "additionalProperties": false
  10094. },
  10095. "ToolStateCompleted": {
  10096. "type": "object",
  10097. "properties": {
  10098. "status": {
  10099. "type": "string",
  10100. "enum": ["completed"]
  10101. },
  10102. "input": {
  10103. "type": "object"
  10104. },
  10105. "output": {
  10106. "type": "string"
  10107. },
  10108. "title": {
  10109. "type": "string"
  10110. },
  10111. "metadata": {
  10112. "type": "object"
  10113. },
  10114. "time": {
  10115. "type": "object",
  10116. "properties": {
  10117. "start": {
  10118. "type": "integer",
  10119. "minimum": 0
  10120. },
  10121. "end": {
  10122. "type": "integer",
  10123. "minimum": 0
  10124. },
  10125. "compacted": {
  10126. "type": "integer",
  10127. "minimum": 0
  10128. }
  10129. },
  10130. "required": ["start", "end"],
  10131. "additionalProperties": false
  10132. },
  10133. "attachments": {
  10134. "type": "array",
  10135. "items": {
  10136. "$ref": "#/components/schemas/FilePart"
  10137. }
  10138. }
  10139. },
  10140. "required": ["status", "input", "output", "title", "metadata", "time"],
  10141. "additionalProperties": false
  10142. },
  10143. "ToolStateError": {
  10144. "type": "object",
  10145. "properties": {
  10146. "status": {
  10147. "type": "string",
  10148. "enum": ["error"]
  10149. },
  10150. "input": {
  10151. "type": "object"
  10152. },
  10153. "error": {
  10154. "type": "string"
  10155. },
  10156. "metadata": {
  10157. "type": "object"
  10158. },
  10159. "time": {
  10160. "type": "object",
  10161. "properties": {
  10162. "start": {
  10163. "type": "integer",
  10164. "minimum": 0
  10165. },
  10166. "end": {
  10167. "type": "integer",
  10168. "minimum": 0
  10169. }
  10170. },
  10171. "required": ["start", "end"],
  10172. "additionalProperties": false
  10173. }
  10174. },
  10175. "required": ["status", "input", "error", "time"],
  10176. "additionalProperties": false
  10177. },
  10178. "ToolState": {
  10179. "anyOf": [
  10180. {
  10181. "$ref": "#/components/schemas/ToolStatePending"
  10182. },
  10183. {
  10184. "$ref": "#/components/schemas/ToolStateRunning"
  10185. },
  10186. {
  10187. "$ref": "#/components/schemas/ToolStateCompleted"
  10188. },
  10189. {
  10190. "$ref": "#/components/schemas/ToolStateError"
  10191. }
  10192. ]
  10193. },
  10194. "ToolPart": {
  10195. "type": "object",
  10196. "properties": {
  10197. "id": {
  10198. "type": "string"
  10199. },
  10200. "sessionID": {
  10201. "type": "string"
  10202. },
  10203. "messageID": {
  10204. "type": "string"
  10205. },
  10206. "type": {
  10207. "type": "string",
  10208. "enum": ["tool"]
  10209. },
  10210. "callID": {
  10211. "type": "string"
  10212. },
  10213. "tool": {
  10214. "type": "string"
  10215. },
  10216. "state": {
  10217. "$ref": "#/components/schemas/ToolState"
  10218. },
  10219. "metadata": {
  10220. "type": "object"
  10221. }
  10222. },
  10223. "required": ["id", "sessionID", "messageID", "type", "callID", "tool", "state"],
  10224. "additionalProperties": false
  10225. },
  10226. "StepStartPart": {
  10227. "type": "object",
  10228. "properties": {
  10229. "id": {
  10230. "type": "string"
  10231. },
  10232. "sessionID": {
  10233. "type": "string"
  10234. },
  10235. "messageID": {
  10236. "type": "string"
  10237. },
  10238. "type": {
  10239. "type": "string",
  10240. "enum": ["step-start"]
  10241. },
  10242. "snapshot": {
  10243. "type": "string"
  10244. }
  10245. },
  10246. "required": ["id", "sessionID", "messageID", "type"],
  10247. "additionalProperties": false
  10248. },
  10249. "StepFinishPart": {
  10250. "type": "object",
  10251. "properties": {
  10252. "id": {
  10253. "type": "string"
  10254. },
  10255. "sessionID": {
  10256. "type": "string"
  10257. },
  10258. "messageID": {
  10259. "type": "string"
  10260. },
  10261. "type": {
  10262. "type": "string",
  10263. "enum": ["step-finish"]
  10264. },
  10265. "reason": {
  10266. "type": "string"
  10267. },
  10268. "snapshot": {
  10269. "type": "string"
  10270. },
  10271. "cost": {
  10272. "type": "number"
  10273. },
  10274. "tokens": {
  10275. "type": "object",
  10276. "properties": {
  10277. "total": {
  10278. "type": "integer",
  10279. "minimum": 0
  10280. },
  10281. "input": {
  10282. "type": "integer",
  10283. "minimum": 0
  10284. },
  10285. "output": {
  10286. "type": "integer",
  10287. "minimum": 0
  10288. },
  10289. "reasoning": {
  10290. "type": "integer",
  10291. "minimum": 0
  10292. },
  10293. "cache": {
  10294. "type": "object",
  10295. "properties": {
  10296. "read": {
  10297. "type": "integer",
  10298. "minimum": 0
  10299. },
  10300. "write": {
  10301. "type": "integer",
  10302. "minimum": 0
  10303. }
  10304. },
  10305. "required": ["read", "write"],
  10306. "additionalProperties": false
  10307. }
  10308. },
  10309. "required": ["input", "output", "reasoning", "cache"],
  10310. "additionalProperties": false
  10311. }
  10312. },
  10313. "required": ["id", "sessionID", "messageID", "type", "reason", "cost", "tokens"],
  10314. "additionalProperties": false
  10315. },
  10316. "SnapshotPart": {
  10317. "type": "object",
  10318. "properties": {
  10319. "id": {
  10320. "type": "string"
  10321. },
  10322. "sessionID": {
  10323. "type": "string"
  10324. },
  10325. "messageID": {
  10326. "type": "string"
  10327. },
  10328. "type": {
  10329. "type": "string",
  10330. "enum": ["snapshot"]
  10331. },
  10332. "snapshot": {
  10333. "type": "string"
  10334. }
  10335. },
  10336. "required": ["id", "sessionID", "messageID", "type", "snapshot"],
  10337. "additionalProperties": false
  10338. },
  10339. "PatchPart": {
  10340. "type": "object",
  10341. "properties": {
  10342. "id": {
  10343. "type": "string"
  10344. },
  10345. "sessionID": {
  10346. "type": "string"
  10347. },
  10348. "messageID": {
  10349. "type": "string"
  10350. },
  10351. "type": {
  10352. "type": "string",
  10353. "enum": ["patch"]
  10354. },
  10355. "hash": {
  10356. "type": "string"
  10357. },
  10358. "files": {
  10359. "type": "array",
  10360. "items": {
  10361. "type": "string"
  10362. }
  10363. }
  10364. },
  10365. "required": ["id", "sessionID", "messageID", "type", "hash", "files"],
  10366. "additionalProperties": false
  10367. },
  10368. "AgentPart": {
  10369. "type": "object",
  10370. "properties": {
  10371. "id": {
  10372. "type": "string"
  10373. },
  10374. "sessionID": {
  10375. "type": "string"
  10376. },
  10377. "messageID": {
  10378. "type": "string"
  10379. },
  10380. "type": {
  10381. "type": "string",
  10382. "enum": ["agent"]
  10383. },
  10384. "name": {
  10385. "type": "string"
  10386. },
  10387. "source": {
  10388. "type": "object",
  10389. "properties": {
  10390. "value": {
  10391. "type": "string"
  10392. },
  10393. "start": {
  10394. "type": "integer",
  10395. "minimum": 0
  10396. },
  10397. "end": {
  10398. "type": "integer",
  10399. "minimum": 0
  10400. }
  10401. },
  10402. "required": ["value", "start", "end"],
  10403. "additionalProperties": false
  10404. }
  10405. },
  10406. "required": ["id", "sessionID", "messageID", "type", "name"],
  10407. "additionalProperties": false
  10408. },
  10409. "RetryPart": {
  10410. "type": "object",
  10411. "properties": {
  10412. "id": {
  10413. "type": "string"
  10414. },
  10415. "sessionID": {
  10416. "type": "string"
  10417. },
  10418. "messageID": {
  10419. "type": "string"
  10420. },
  10421. "type": {
  10422. "type": "string",
  10423. "enum": ["retry"]
  10424. },
  10425. "attempt": {
  10426. "type": "integer",
  10427. "minimum": 0
  10428. },
  10429. "error": {
  10430. "$ref": "#/components/schemas/APIError"
  10431. },
  10432. "time": {
  10433. "type": "object",
  10434. "properties": {
  10435. "created": {
  10436. "type": "integer",
  10437. "minimum": 0
  10438. }
  10439. },
  10440. "required": ["created"],
  10441. "additionalProperties": false
  10442. }
  10443. },
  10444. "required": ["id", "sessionID", "messageID", "type", "attempt", "error", "time"],
  10445. "additionalProperties": false
  10446. },
  10447. "CompactionPart": {
  10448. "type": "object",
  10449. "properties": {
  10450. "id": {
  10451. "type": "string"
  10452. },
  10453. "sessionID": {
  10454. "type": "string"
  10455. },
  10456. "messageID": {
  10457. "type": "string"
  10458. },
  10459. "type": {
  10460. "type": "string",
  10461. "enum": ["compaction"]
  10462. },
  10463. "auto": {
  10464. "type": "boolean"
  10465. },
  10466. "overflow": {
  10467. "type": "boolean"
  10468. },
  10469. "tail_start_id": {
  10470. "type": "string"
  10471. }
  10472. },
  10473. "required": ["id", "sessionID", "messageID", "type", "auto"],
  10474. "additionalProperties": false
  10475. },
  10476. "Part": {
  10477. "anyOf": [
  10478. {
  10479. "$ref": "#/components/schemas/TextPart"
  10480. },
  10481. {
  10482. "$ref": "#/components/schemas/SubtaskPart"
  10483. },
  10484. {
  10485. "$ref": "#/components/schemas/ReasoningPart"
  10486. },
  10487. {
  10488. "$ref": "#/components/schemas/FilePart"
  10489. },
  10490. {
  10491. "$ref": "#/components/schemas/ToolPart"
  10492. },
  10493. {
  10494. "$ref": "#/components/schemas/StepStartPart"
  10495. },
  10496. {
  10497. "$ref": "#/components/schemas/StepFinishPart"
  10498. },
  10499. {
  10500. "$ref": "#/components/schemas/SnapshotPart"
  10501. },
  10502. {
  10503. "$ref": "#/components/schemas/PatchPart"
  10504. },
  10505. {
  10506. "$ref": "#/components/schemas/AgentPart"
  10507. },
  10508. {
  10509. "$ref": "#/components/schemas/RetryPart"
  10510. },
  10511. {
  10512. "$ref": "#/components/schemas/CompactionPart"
  10513. }
  10514. ]
  10515. },
  10516. "PermissionAction": {
  10517. "type": "string",
  10518. "enum": ["allow", "deny", "ask"]
  10519. },
  10520. "PermissionRule": {
  10521. "type": "object",
  10522. "properties": {
  10523. "permission": {
  10524. "type": "string"
  10525. },
  10526. "pattern": {
  10527. "type": "string"
  10528. },
  10529. "action": {
  10530. "$ref": "#/components/schemas/PermissionAction"
  10531. }
  10532. },
  10533. "required": ["permission", "pattern", "action"],
  10534. "additionalProperties": false
  10535. },
  10536. "PermissionRuleset": {
  10537. "type": "array",
  10538. "items": {
  10539. "$ref": "#/components/schemas/PermissionRule"
  10540. }
  10541. },
  10542. "Session": {
  10543. "type": "object",
  10544. "properties": {
  10545. "id": {
  10546. "type": "string"
  10547. },
  10548. "slug": {
  10549. "type": "string"
  10550. },
  10551. "projectID": {
  10552. "type": "string"
  10553. },
  10554. "workspaceID": {
  10555. "type": "string"
  10556. },
  10557. "directory": {
  10558. "type": "string"
  10559. },
  10560. "path": {
  10561. "type": "string"
  10562. },
  10563. "parentID": {
  10564. "type": "string"
  10565. },
  10566. "summary": {
  10567. "type": "object",
  10568. "properties": {
  10569. "additions": {
  10570. "type": "integer",
  10571. "minimum": 0
  10572. },
  10573. "deletions": {
  10574. "type": "integer",
  10575. "minimum": 0
  10576. },
  10577. "files": {
  10578. "type": "integer",
  10579. "minimum": 0
  10580. },
  10581. "diffs": {
  10582. "type": "array",
  10583. "items": {
  10584. "$ref": "#/components/schemas/SnapshotFileDiff"
  10585. }
  10586. }
  10587. },
  10588. "required": ["additions", "deletions", "files"],
  10589. "additionalProperties": false
  10590. },
  10591. "share": {
  10592. "type": "object",
  10593. "properties": {
  10594. "url": {
  10595. "type": "string"
  10596. }
  10597. },
  10598. "required": ["url"],
  10599. "additionalProperties": false
  10600. },
  10601. "title": {
  10602. "type": "string"
  10603. },
  10604. "agent": {
  10605. "type": "string"
  10606. },
  10607. "model": {
  10608. "type": "object",
  10609. "properties": {
  10610. "id": {
  10611. "type": "string"
  10612. },
  10613. "providerID": {
  10614. "type": "string"
  10615. },
  10616. "variant": {
  10617. "type": "string"
  10618. }
  10619. },
  10620. "required": ["id", "providerID"],
  10621. "additionalProperties": false
  10622. },
  10623. "version": {
  10624. "type": "string"
  10625. },
  10626. "time": {
  10627. "type": "object",
  10628. "properties": {
  10629. "created": {
  10630. "type": "integer",
  10631. "minimum": 0
  10632. },
  10633. "updated": {
  10634. "type": "integer",
  10635. "minimum": 0
  10636. },
  10637. "compacting": {
  10638. "type": "integer",
  10639. "minimum": 0
  10640. },
  10641. "archived": {
  10642. "type": "number"
  10643. }
  10644. },
  10645. "required": ["created", "updated"],
  10646. "additionalProperties": false
  10647. },
  10648. "permission": {
  10649. "$ref": "#/components/schemas/PermissionRuleset"
  10650. },
  10651. "revert": {
  10652. "type": "object",
  10653. "properties": {
  10654. "messageID": {
  10655. "type": "string"
  10656. },
  10657. "partID": {
  10658. "type": "string"
  10659. },
  10660. "snapshot": {
  10661. "type": "string"
  10662. },
  10663. "diff": {
  10664. "type": "string"
  10665. }
  10666. },
  10667. "required": ["messageID"],
  10668. "additionalProperties": false
  10669. }
  10670. },
  10671. "required": ["id", "slug", "projectID", "directory", "title", "version", "time"],
  10672. "additionalProperties": false
  10673. },
  10674. "Prompt": {
  10675. "type": "object",
  10676. "properties": {
  10677. "text": {
  10678. "type": "string"
  10679. },
  10680. "files": {
  10681. "type": "array",
  10682. "items": {
  10683. "$ref": "#/components/schemas/PromptFileAttachment"
  10684. }
  10685. },
  10686. "agents": {
  10687. "type": "array",
  10688. "items": {
  10689. "$ref": "#/components/schemas/PromptAgentAttachment"
  10690. }
  10691. }
  10692. },
  10693. "required": ["text"],
  10694. "additionalProperties": false
  10695. },
  10696. "GlobalEvent": {
  10697. "type": "object",
  10698. "properties": {
  10699. "directory": {
  10700. "type": "string"
  10701. },
  10702. "project": {
  10703. "type": "string"
  10704. },
  10705. "workspace": {
  10706. "type": "string"
  10707. },
  10708. "payload": {
  10709. "anyOf": [
  10710. {
  10711. "$ref": "#/components/schemas/EventServerInstanceDisposed"
  10712. },
  10713. {
  10714. "$ref": "#/components/schemas/EventFileEdited"
  10715. },
  10716. {
  10717. "$ref": "#/components/schemas/EventFileWatcherUpdated"
  10718. },
  10719. {
  10720. "$ref": "#/components/schemas/EventLspClientDiagnostics"
  10721. },
  10722. {
  10723. "$ref": "#/components/schemas/EventLspUpdated"
  10724. },
  10725. {
  10726. "$ref": "#/components/schemas/EventMessagePartDelta"
  10727. },
  10728. {
  10729. "$ref": "#/components/schemas/EventPermissionAsked"
  10730. },
  10731. {
  10732. "$ref": "#/components/schemas/EventPermissionReplied"
  10733. },
  10734. {
  10735. "$ref": "#/components/schemas/EventSessionDiff"
  10736. },
  10737. {
  10738. "$ref": "#/components/schemas/EventSessionError"
  10739. },
  10740. {
  10741. "$ref": "#/components/schemas/EventInstallationUpdated"
  10742. },
  10743. {
  10744. "$ref": "#/components/schemas/EventInstallationUpdate-available"
  10745. },
  10746. {
  10747. "$ref": "#/components/schemas/EventQuestionAsked"
  10748. },
  10749. {
  10750. "$ref": "#/components/schemas/EventQuestionReplied"
  10751. },
  10752. {
  10753. "$ref": "#/components/schemas/EventQuestionRejected"
  10754. },
  10755. {
  10756. "$ref": "#/components/schemas/EventTodoUpdated"
  10757. },
  10758. {
  10759. "$ref": "#/components/schemas/EventSessionStatus"
  10760. },
  10761. {
  10762. "$ref": "#/components/schemas/EventSessionIdle"
  10763. },
  10764. {
  10765. "$ref": "#/components/schemas/EventSessionCompacted"
  10766. },
  10767. {
  10768. "$ref": "#/components/schemas/Event.tui.prompt.append"
  10769. },
  10770. {
  10771. "$ref": "#/components/schemas/Event.tui.command.execute"
  10772. },
  10773. {
  10774. "$ref": "#/components/schemas/Event.tui.toast.show"
  10775. },
  10776. {
  10777. "$ref": "#/components/schemas/Event.tui.session.select"
  10778. },
  10779. {
  10780. "$ref": "#/components/schemas/EventMcpToolsChanged"
  10781. },
  10782. {
  10783. "$ref": "#/components/schemas/EventMcpBrowserOpenFailed"
  10784. },
  10785. {
  10786. "$ref": "#/components/schemas/EventCommandExecuted"
  10787. },
  10788. {
  10789. "$ref": "#/components/schemas/EventProjectUpdated"
  10790. },
  10791. {
  10792. "$ref": "#/components/schemas/EventVcsBranchUpdated"
  10793. },
  10794. {
  10795. "$ref": "#/components/schemas/EventWorkspaceReady"
  10796. },
  10797. {
  10798. "$ref": "#/components/schemas/EventWorkspaceFailed"
  10799. },
  10800. {
  10801. "$ref": "#/components/schemas/EventWorkspaceStatus"
  10802. },
  10803. {
  10804. "$ref": "#/components/schemas/EventWorktreeReady"
  10805. },
  10806. {
  10807. "$ref": "#/components/schemas/EventWorktreeFailed"
  10808. },
  10809. {
  10810. "$ref": "#/components/schemas/EventPtyCreated"
  10811. },
  10812. {
  10813. "$ref": "#/components/schemas/EventPtyUpdated"
  10814. },
  10815. {
  10816. "$ref": "#/components/schemas/EventPtyExited"
  10817. },
  10818. {
  10819. "$ref": "#/components/schemas/EventPtyDeleted"
  10820. },
  10821. {
  10822. "$ref": "#/components/schemas/EventMessageUpdated"
  10823. },
  10824. {
  10825. "$ref": "#/components/schemas/EventMessageRemoved"
  10826. },
  10827. {
  10828. "$ref": "#/components/schemas/EventMessagePartUpdated"
  10829. },
  10830. {
  10831. "$ref": "#/components/schemas/EventMessagePartRemoved"
  10832. },
  10833. {
  10834. "$ref": "#/components/schemas/EventSessionCreated"
  10835. },
  10836. {
  10837. "$ref": "#/components/schemas/EventSessionUpdated"
  10838. },
  10839. {
  10840. "$ref": "#/components/schemas/EventSessionDeleted"
  10841. },
  10842. {
  10843. "$ref": "#/components/schemas/EventSessionNextAgentSwitched"
  10844. },
  10845. {
  10846. "$ref": "#/components/schemas/EventSessionNextModelSwitched"
  10847. },
  10848. {
  10849. "$ref": "#/components/schemas/EventSessionNextPrompted"
  10850. },
  10851. {
  10852. "$ref": "#/components/schemas/EventSessionNextSynthetic"
  10853. },
  10854. {
  10855. "$ref": "#/components/schemas/EventSessionNextShellStarted"
  10856. },
  10857. {
  10858. "$ref": "#/components/schemas/EventSessionNextShellEnded"
  10859. },
  10860. {
  10861. "$ref": "#/components/schemas/EventSessionNextStepStarted"
  10862. },
  10863. {
  10864. "$ref": "#/components/schemas/EventSessionNextStepEnded"
  10865. },
  10866. {
  10867. "$ref": "#/components/schemas/EventSessionNextStepFailed"
  10868. },
  10869. {
  10870. "$ref": "#/components/schemas/EventSessionNextTextStarted"
  10871. },
  10872. {
  10873. "$ref": "#/components/schemas/EventSessionNextTextDelta"
  10874. },
  10875. {
  10876. "$ref": "#/components/schemas/EventSessionNextTextEnded"
  10877. },
  10878. {
  10879. "$ref": "#/components/schemas/EventSessionNextReasoningStarted"
  10880. },
  10881. {
  10882. "$ref": "#/components/schemas/EventSessionNextReasoningDelta"
  10883. },
  10884. {
  10885. "$ref": "#/components/schemas/EventSessionNextReasoningEnded"
  10886. },
  10887. {
  10888. "$ref": "#/components/schemas/EventSessionNextToolInputStarted"
  10889. },
  10890. {
  10891. "$ref": "#/components/schemas/EventSessionNextToolInputDelta"
  10892. },
  10893. {
  10894. "$ref": "#/components/schemas/EventSessionNextToolInputEnded"
  10895. },
  10896. {
  10897. "$ref": "#/components/schemas/EventSessionNextToolCalled"
  10898. },
  10899. {
  10900. "$ref": "#/components/schemas/EventSessionNextToolProgress"
  10901. },
  10902. {
  10903. "$ref": "#/components/schemas/EventSessionNextToolSuccess"
  10904. },
  10905. {
  10906. "$ref": "#/components/schemas/EventSessionNextToolFailed"
  10907. },
  10908. {
  10909. "$ref": "#/components/schemas/EventSessionNextRetried"
  10910. },
  10911. {
  10912. "$ref": "#/components/schemas/EventSessionNextCompactionStarted"
  10913. },
  10914. {
  10915. "$ref": "#/components/schemas/EventSessionNextCompactionDelta"
  10916. },
  10917. {
  10918. "$ref": "#/components/schemas/EventSessionNextCompactionEnded"
  10919. },
  10920. {
  10921. "$ref": "#/components/schemas/EventServerConnected"
  10922. },
  10923. {
  10924. "$ref": "#/components/schemas/EventGlobalDisposed"
  10925. },
  10926. {
  10927. "$ref": "#/components/schemas/SyncEventMessageUpdated"
  10928. },
  10929. {
  10930. "$ref": "#/components/schemas/SyncEventMessageRemoved"
  10931. },
  10932. {
  10933. "$ref": "#/components/schemas/SyncEventMessagePartUpdated"
  10934. },
  10935. {
  10936. "$ref": "#/components/schemas/SyncEventMessagePartRemoved"
  10937. },
  10938. {
  10939. "$ref": "#/components/schemas/SyncEventSessionCreated"
  10940. },
  10941. {
  10942. "$ref": "#/components/schemas/SyncEventSessionUpdated"
  10943. },
  10944. {
  10945. "$ref": "#/components/schemas/SyncEventSessionDeleted"
  10946. },
  10947. {
  10948. "$ref": "#/components/schemas/SyncEventSessionNextAgentSwitched"
  10949. },
  10950. {
  10951. "$ref": "#/components/schemas/SyncEventSessionNextModelSwitched"
  10952. },
  10953. {
  10954. "$ref": "#/components/schemas/SyncEventSessionNextPrompted"
  10955. },
  10956. {
  10957. "$ref": "#/components/schemas/SyncEventSessionNextSynthetic"
  10958. },
  10959. {
  10960. "$ref": "#/components/schemas/SyncEventSessionNextShellStarted"
  10961. },
  10962. {
  10963. "$ref": "#/components/schemas/SyncEventSessionNextShellEnded"
  10964. },
  10965. {
  10966. "$ref": "#/components/schemas/SyncEventSessionNextStepStarted"
  10967. },
  10968. {
  10969. "$ref": "#/components/schemas/SyncEventSessionNextStepEnded"
  10970. },
  10971. {
  10972. "$ref": "#/components/schemas/SyncEventSessionNextStepFailed"
  10973. },
  10974. {
  10975. "$ref": "#/components/schemas/SyncEventSessionNextTextStarted"
  10976. },
  10977. {
  10978. "$ref": "#/components/schemas/SyncEventSessionNextTextDelta"
  10979. },
  10980. {
  10981. "$ref": "#/components/schemas/SyncEventSessionNextTextEnded"
  10982. },
  10983. {
  10984. "$ref": "#/components/schemas/SyncEventSessionNextReasoningStarted"
  10985. },
  10986. {
  10987. "$ref": "#/components/schemas/SyncEventSessionNextReasoningDelta"
  10988. },
  10989. {
  10990. "$ref": "#/components/schemas/SyncEventSessionNextReasoningEnded"
  10991. },
  10992. {
  10993. "$ref": "#/components/schemas/SyncEventSessionNextToolInputStarted"
  10994. },
  10995. {
  10996. "$ref": "#/components/schemas/SyncEventSessionNextToolInputDelta"
  10997. },
  10998. {
  10999. "$ref": "#/components/schemas/SyncEventSessionNextToolInputEnded"
  11000. },
  11001. {
  11002. "$ref": "#/components/schemas/SyncEventSessionNextToolCalled"
  11003. },
  11004. {
  11005. "$ref": "#/components/schemas/SyncEventSessionNextToolProgress"
  11006. },
  11007. {
  11008. "$ref": "#/components/schemas/SyncEventSessionNextToolSuccess"
  11009. },
  11010. {
  11011. "$ref": "#/components/schemas/SyncEventSessionNextToolFailed"
  11012. },
  11013. {
  11014. "$ref": "#/components/schemas/SyncEventSessionNextRetried"
  11015. },
  11016. {
  11017. "$ref": "#/components/schemas/SyncEventSessionNextCompactionStarted"
  11018. },
  11019. {
  11020. "$ref": "#/components/schemas/SyncEventSessionNextCompactionDelta"
  11021. },
  11022. {
  11023. "$ref": "#/components/schemas/SyncEventSessionNextCompactionEnded"
  11024. }
  11025. ]
  11026. }
  11027. },
  11028. "required": ["directory", "payload"],
  11029. "additionalProperties": false
  11030. },
  11031. "LogLevel": {
  11032. "type": "string",
  11033. "enum": ["DEBUG", "INFO", "WARN", "ERROR"],
  11034. "description": "Log level"
  11035. },
  11036. "ServerConfig": {
  11037. "type": "object",
  11038. "properties": {
  11039. "port": {
  11040. "type": "integer",
  11041. "exclusiveMinimum": 0
  11042. },
  11043. "hostname": {
  11044. "type": "string"
  11045. },
  11046. "mdns": {
  11047. "type": "boolean"
  11048. },
  11049. "mdnsDomain": {
  11050. "type": "string"
  11051. },
  11052. "cors": {
  11053. "type": "array",
  11054. "items": {
  11055. "type": "string"
  11056. }
  11057. }
  11058. },
  11059. "additionalProperties": false,
  11060. "description": "Server configuration for opencode serve and web commands"
  11061. },
  11062. "PermissionActionConfig": {
  11063. "type": "string",
  11064. "enum": ["ask", "allow", "deny"]
  11065. },
  11066. "PermissionObjectConfig": {
  11067. "type": "object",
  11068. "additionalProperties": {
  11069. "$ref": "#/components/schemas/PermissionActionConfig"
  11070. }
  11071. },
  11072. "PermissionRuleConfig": {
  11073. "anyOf": [
  11074. {
  11075. "$ref": "#/components/schemas/PermissionActionConfig"
  11076. },
  11077. {
  11078. "$ref": "#/components/schemas/PermissionObjectConfig"
  11079. }
  11080. ]
  11081. },
  11082. "PermissionConfig": {
  11083. "anyOf": [
  11084. {
  11085. "$ref": "#/components/schemas/PermissionActionConfig"
  11086. },
  11087. {
  11088. "type": "object",
  11089. "properties": {
  11090. "read": {
  11091. "$ref": "#/components/schemas/PermissionRuleConfig"
  11092. },
  11093. "edit": {
  11094. "$ref": "#/components/schemas/PermissionRuleConfig"
  11095. },
  11096. "glob": {
  11097. "$ref": "#/components/schemas/PermissionRuleConfig"
  11098. },
  11099. "grep": {
  11100. "$ref": "#/components/schemas/PermissionRuleConfig"
  11101. },
  11102. "list": {
  11103. "$ref": "#/components/schemas/PermissionRuleConfig"
  11104. },
  11105. "bash": {
  11106. "$ref": "#/components/schemas/PermissionRuleConfig"
  11107. },
  11108. "task": {
  11109. "$ref": "#/components/schemas/PermissionRuleConfig"
  11110. },
  11111. "external_directory": {
  11112. "$ref": "#/components/schemas/PermissionRuleConfig"
  11113. },
  11114. "todowrite": {
  11115. "$ref": "#/components/schemas/PermissionActionConfig"
  11116. },
  11117. "question": {
  11118. "$ref": "#/components/schemas/PermissionActionConfig"
  11119. },
  11120. "webfetch": {
  11121. "$ref": "#/components/schemas/PermissionActionConfig"
  11122. },
  11123. "websearch": {
  11124. "$ref": "#/components/schemas/PermissionActionConfig"
  11125. },
  11126. "lsp": {
  11127. "$ref": "#/components/schemas/PermissionRuleConfig"
  11128. },
  11129. "doom_loop": {
  11130. "$ref": "#/components/schemas/PermissionActionConfig"
  11131. },
  11132. "skill": {
  11133. "$ref": "#/components/schemas/PermissionRuleConfig"
  11134. }
  11135. },
  11136. "additionalProperties": {
  11137. "$ref": "#/components/schemas/PermissionRuleConfig"
  11138. }
  11139. }
  11140. ]
  11141. },
  11142. "AgentConfig": {
  11143. "type": "object",
  11144. "properties": {
  11145. "model": {
  11146. "type": "string"
  11147. },
  11148. "variant": {
  11149. "type": "string"
  11150. },
  11151. "temperature": {
  11152. "type": "number"
  11153. },
  11154. "top_p": {
  11155. "type": "number"
  11156. },
  11157. "prompt": {
  11158. "type": "string"
  11159. },
  11160. "tools": {
  11161. "type": "object",
  11162. "additionalProperties": {
  11163. "type": "boolean"
  11164. }
  11165. },
  11166. "disable": {
  11167. "type": "boolean"
  11168. },
  11169. "description": {
  11170. "type": "string"
  11171. },
  11172. "mode": {
  11173. "type": "string",
  11174. "enum": ["subagent", "primary", "all"]
  11175. },
  11176. "hidden": {
  11177. "type": "boolean"
  11178. },
  11179. "options": {
  11180. "type": "object"
  11181. },
  11182. "color": {
  11183. "anyOf": [
  11184. {
  11185. "type": "string",
  11186. "pattern": "^#[0-9a-fA-F]{6}$"
  11187. },
  11188. {
  11189. "type": "string",
  11190. "enum": ["primary", "secondary", "accent", "success", "warning", "error", "info"]
  11191. }
  11192. ],
  11193. "description": "Hex color code (e.g., #FF5733) or theme color (e.g., primary)"
  11194. },
  11195. "steps": {
  11196. "type": "integer",
  11197. "exclusiveMinimum": 0
  11198. },
  11199. "maxSteps": {
  11200. "type": "integer",
  11201. "exclusiveMinimum": 0
  11202. },
  11203. "permission": {
  11204. "$ref": "#/components/schemas/PermissionConfig"
  11205. }
  11206. },
  11207. "additionalProperties": {}
  11208. },
  11209. "ProviderConfig": {
  11210. "type": "object",
  11211. "properties": {
  11212. "api": {
  11213. "type": "string"
  11214. },
  11215. "name": {
  11216. "type": "string"
  11217. },
  11218. "env": {
  11219. "type": "array",
  11220. "items": {
  11221. "type": "string"
  11222. }
  11223. },
  11224. "id": {
  11225. "type": "string"
  11226. },
  11227. "npm": {
  11228. "type": "string"
  11229. },
  11230. "whitelist": {
  11231. "type": "array",
  11232. "items": {
  11233. "type": "string"
  11234. }
  11235. },
  11236. "blacklist": {
  11237. "type": "array",
  11238. "items": {
  11239. "type": "string"
  11240. }
  11241. },
  11242. "options": {
  11243. "type": "object",
  11244. "properties": {
  11245. "apiKey": {
  11246. "type": "string"
  11247. },
  11248. "baseURL": {
  11249. "type": "string"
  11250. },
  11251. "enterpriseUrl": {
  11252. "type": "string"
  11253. },
  11254. "setCacheKey": {
  11255. "type": "boolean"
  11256. },
  11257. "timeout": {
  11258. "anyOf": [
  11259. {
  11260. "type": "integer",
  11261. "exclusiveMinimum": 0
  11262. },
  11263. {
  11264. "type": "boolean",
  11265. "enum": [false]
  11266. }
  11267. ],
  11268. "description": "Timeout in milliseconds for requests to this provider. Default is 300000 (5 minutes). Set to false to disable timeout."
  11269. },
  11270. "chunkTimeout": {
  11271. "type": "integer",
  11272. "exclusiveMinimum": 0
  11273. }
  11274. },
  11275. "additionalProperties": {}
  11276. },
  11277. "models": {
  11278. "type": "object",
  11279. "additionalProperties": {
  11280. "type": "object",
  11281. "properties": {
  11282. "id": {
  11283. "type": "string"
  11284. },
  11285. "name": {
  11286. "type": "string"
  11287. },
  11288. "family": {
  11289. "type": "string"
  11290. },
  11291. "release_date": {
  11292. "type": "string"
  11293. },
  11294. "attachment": {
  11295. "type": "boolean"
  11296. },
  11297. "reasoning": {
  11298. "type": "boolean"
  11299. },
  11300. "temperature": {
  11301. "type": "boolean"
  11302. },
  11303. "tool_call": {
  11304. "type": "boolean"
  11305. },
  11306. "interleaved": {
  11307. "anyOf": [
  11308. {
  11309. "type": "boolean",
  11310. "enum": [true]
  11311. },
  11312. {
  11313. "type": "object",
  11314. "properties": {
  11315. "field": {
  11316. "type": "string",
  11317. "enum": ["reasoning_content", "reasoning_details"]
  11318. }
  11319. },
  11320. "required": ["field"],
  11321. "additionalProperties": false
  11322. }
  11323. ]
  11324. },
  11325. "cost": {
  11326. "type": "object",
  11327. "properties": {
  11328. "input": {
  11329. "type": "number"
  11330. },
  11331. "output": {
  11332. "type": "number"
  11333. },
  11334. "cache_read": {
  11335. "type": "number"
  11336. },
  11337. "cache_write": {
  11338. "type": "number"
  11339. },
  11340. "context_over_200k": {
  11341. "type": "object",
  11342. "properties": {
  11343. "input": {
  11344. "type": "number"
  11345. },
  11346. "output": {
  11347. "type": "number"
  11348. },
  11349. "cache_read": {
  11350. "type": "number"
  11351. },
  11352. "cache_write": {
  11353. "type": "number"
  11354. }
  11355. },
  11356. "required": ["input", "output"],
  11357. "additionalProperties": false
  11358. }
  11359. },
  11360. "required": ["input", "output"],
  11361. "additionalProperties": false
  11362. },
  11363. "limit": {
  11364. "type": "object",
  11365. "properties": {
  11366. "context": {
  11367. "type": "number"
  11368. },
  11369. "input": {
  11370. "type": "number"
  11371. },
  11372. "output": {
  11373. "type": "number"
  11374. }
  11375. },
  11376. "required": ["context", "output"],
  11377. "additionalProperties": false
  11378. },
  11379. "modalities": {
  11380. "type": "object",
  11381. "properties": {
  11382. "input": {
  11383. "type": "array",
  11384. "items": {
  11385. "type": "string",
  11386. "enum": ["text", "audio", "image", "video", "pdf"]
  11387. }
  11388. },
  11389. "output": {
  11390. "type": "array",
  11391. "items": {
  11392. "type": "string",
  11393. "enum": ["text", "audio", "image", "video", "pdf"]
  11394. }
  11395. }
  11396. },
  11397. "required": ["input", "output"],
  11398. "additionalProperties": false
  11399. },
  11400. "experimental": {
  11401. "type": "boolean"
  11402. },
  11403. "status": {
  11404. "type": "string",
  11405. "enum": ["alpha", "beta", "deprecated"]
  11406. },
  11407. "provider": {
  11408. "type": "object",
  11409. "properties": {
  11410. "npm": {
  11411. "type": "string"
  11412. },
  11413. "api": {
  11414. "type": "string"
  11415. }
  11416. },
  11417. "additionalProperties": false
  11418. },
  11419. "options": {
  11420. "type": "object"
  11421. },
  11422. "headers": {
  11423. "type": "object",
  11424. "additionalProperties": {
  11425. "type": "string"
  11426. }
  11427. },
  11428. "variants": {
  11429. "type": "object",
  11430. "additionalProperties": {
  11431. "type": "object",
  11432. "properties": {
  11433. "disabled": {
  11434. "type": "boolean"
  11435. }
  11436. },
  11437. "additionalProperties": {}
  11438. },
  11439. "description": "Variant-specific configuration"
  11440. }
  11441. },
  11442. "additionalProperties": false
  11443. }
  11444. }
  11445. },
  11446. "additionalProperties": false
  11447. },
  11448. "McpLocalConfig": {
  11449. "type": "object",
  11450. "properties": {
  11451. "type": {
  11452. "type": "string",
  11453. "enum": ["local"],
  11454. "description": "Type of MCP server connection"
  11455. },
  11456. "command": {
  11457. "type": "array",
  11458. "items": {
  11459. "type": "string"
  11460. },
  11461. "description": "Command and arguments to run the MCP server"
  11462. },
  11463. "environment": {
  11464. "type": "object",
  11465. "additionalProperties": {
  11466. "type": "string"
  11467. }
  11468. },
  11469. "enabled": {
  11470. "type": "boolean"
  11471. },
  11472. "timeout": {
  11473. "type": "integer",
  11474. "exclusiveMinimum": 0
  11475. }
  11476. },
  11477. "required": ["type", "command"],
  11478. "additionalProperties": false
  11479. },
  11480. "McpOAuthConfig": {
  11481. "type": "object",
  11482. "properties": {
  11483. "clientId": {
  11484. "type": "string"
  11485. },
  11486. "clientSecret": {
  11487. "type": "string"
  11488. },
  11489. "scope": {
  11490. "type": "string"
  11491. },
  11492. "redirectUri": {
  11493. "type": "string"
  11494. }
  11495. },
  11496. "additionalProperties": false
  11497. },
  11498. "McpRemoteConfig": {
  11499. "type": "object",
  11500. "properties": {
  11501. "type": {
  11502. "type": "string",
  11503. "enum": ["remote"],
  11504. "description": "Type of MCP server connection"
  11505. },
  11506. "url": {
  11507. "type": "string",
  11508. "description": "URL of the remote MCP server"
  11509. },
  11510. "enabled": {
  11511. "type": "boolean"
  11512. },
  11513. "headers": {
  11514. "type": "object",
  11515. "additionalProperties": {
  11516. "type": "string"
  11517. }
  11518. },
  11519. "oauth": {
  11520. "anyOf": [
  11521. {
  11522. "$ref": "#/components/schemas/McpOAuthConfig"
  11523. },
  11524. {
  11525. "type": "boolean",
  11526. "enum": [false]
  11527. }
  11528. ],
  11529. "description": "OAuth authentication configuration for the MCP server. Set to false to disable OAuth auto-detection."
  11530. },
  11531. "timeout": {
  11532. "type": "integer",
  11533. "exclusiveMinimum": 0
  11534. }
  11535. },
  11536. "required": ["type", "url"],
  11537. "additionalProperties": false
  11538. },
  11539. "LayoutConfig": {
  11540. "type": "string",
  11541. "enum": ["auto", "stretch"],
  11542. "description": "@deprecated Always uses stretch layout."
  11543. },
  11544. "Config": {
  11545. "type": "object",
  11546. "properties": {
  11547. "$schema": {
  11548. "type": "string"
  11549. },
  11550. "shell": {
  11551. "type": "string"
  11552. },
  11553. "logLevel": {
  11554. "$ref": "#/components/schemas/LogLevel"
  11555. },
  11556. "server": {
  11557. "$ref": "#/components/schemas/ServerConfig"
  11558. },
  11559. "command": {
  11560. "type": "object",
  11561. "additionalProperties": {
  11562. "type": "object",
  11563. "properties": {
  11564. "template": {
  11565. "type": "string"
  11566. },
  11567. "description": {
  11568. "type": "string"
  11569. },
  11570. "agent": {
  11571. "type": "string"
  11572. },
  11573. "model": {
  11574. "type": "string"
  11575. },
  11576. "subtask": {
  11577. "type": "boolean"
  11578. }
  11579. },
  11580. "required": ["template"],
  11581. "additionalProperties": false
  11582. }
  11583. },
  11584. "skills": {
  11585. "type": "object",
  11586. "properties": {
  11587. "paths": {
  11588. "type": "array",
  11589. "items": {
  11590. "type": "string"
  11591. }
  11592. },
  11593. "urls": {
  11594. "type": "array",
  11595. "items": {
  11596. "type": "string"
  11597. }
  11598. }
  11599. },
  11600. "additionalProperties": false
  11601. },
  11602. "watcher": {
  11603. "type": "object",
  11604. "properties": {
  11605. "ignore": {
  11606. "type": "array",
  11607. "items": {
  11608. "type": "string"
  11609. }
  11610. }
  11611. },
  11612. "additionalProperties": false
  11613. },
  11614. "snapshot": {
  11615. "type": "boolean"
  11616. },
  11617. "plugin": {
  11618. "type": "array",
  11619. "items": {
  11620. "anyOf": [
  11621. {
  11622. "type": "string"
  11623. },
  11624. {
  11625. "type": "array",
  11626. "prefixItems": [
  11627. {
  11628. "type": "string"
  11629. },
  11630. {
  11631. "type": "object"
  11632. }
  11633. ],
  11634. "maxItems": 2,
  11635. "minItems": 2
  11636. }
  11637. ]
  11638. }
  11639. },
  11640. "share": {
  11641. "type": "string",
  11642. "enum": ["manual", "auto", "disabled"]
  11643. },
  11644. "autoshare": {
  11645. "type": "boolean"
  11646. },
  11647. "autoupdate": {
  11648. "anyOf": [
  11649. {
  11650. "type": "boolean"
  11651. },
  11652. {
  11653. "type": "string",
  11654. "enum": ["notify"]
  11655. }
  11656. ],
  11657. "description": "Automatically update to the latest version. Set to true to auto-update, false to disable, or 'notify' to show update notifications"
  11658. },
  11659. "disabled_providers": {
  11660. "type": "array",
  11661. "items": {
  11662. "type": "string"
  11663. }
  11664. },
  11665. "enabled_providers": {
  11666. "type": "array",
  11667. "items": {
  11668. "type": "string"
  11669. }
  11670. },
  11671. "model": {
  11672. "type": "string"
  11673. },
  11674. "small_model": {
  11675. "type": "string"
  11676. },
  11677. "default_agent": {
  11678. "type": "string"
  11679. },
  11680. "username": {
  11681. "type": "string"
  11682. },
  11683. "mode": {
  11684. "type": "object",
  11685. "properties": {
  11686. "build": {
  11687. "$ref": "#/components/schemas/AgentConfig"
  11688. },
  11689. "plan": {
  11690. "$ref": "#/components/schemas/AgentConfig"
  11691. }
  11692. },
  11693. "additionalProperties": {
  11694. "$ref": "#/components/schemas/AgentConfig"
  11695. }
  11696. },
  11697. "agent": {
  11698. "type": "object",
  11699. "properties": {
  11700. "plan": {
  11701. "$ref": "#/components/schemas/AgentConfig"
  11702. },
  11703. "build": {
  11704. "$ref": "#/components/schemas/AgentConfig"
  11705. },
  11706. "general": {
  11707. "$ref": "#/components/schemas/AgentConfig"
  11708. },
  11709. "explore": {
  11710. "$ref": "#/components/schemas/AgentConfig"
  11711. },
  11712. "title": {
  11713. "$ref": "#/components/schemas/AgentConfig"
  11714. },
  11715. "summary": {
  11716. "$ref": "#/components/schemas/AgentConfig"
  11717. },
  11718. "compaction": {
  11719. "$ref": "#/components/schemas/AgentConfig"
  11720. }
  11721. },
  11722. "additionalProperties": {
  11723. "$ref": "#/components/schemas/AgentConfig"
  11724. }
  11725. },
  11726. "provider": {
  11727. "type": "object",
  11728. "additionalProperties": {
  11729. "$ref": "#/components/schemas/ProviderConfig"
  11730. }
  11731. },
  11732. "mcp": {
  11733. "type": "object",
  11734. "additionalProperties": {
  11735. "anyOf": [
  11736. {
  11737. "$ref": "#/components/schemas/McpLocalConfig"
  11738. },
  11739. {
  11740. "$ref": "#/components/schemas/McpRemoteConfig"
  11741. },
  11742. {
  11743. "type": "object",
  11744. "properties": {
  11745. "enabled": {
  11746. "type": "boolean"
  11747. }
  11748. },
  11749. "required": ["enabled"],
  11750. "additionalProperties": false
  11751. }
  11752. ]
  11753. }
  11754. },
  11755. "formatter": {
  11756. "anyOf": [
  11757. {
  11758. "type": "boolean"
  11759. },
  11760. {
  11761. "type": "object",
  11762. "additionalProperties": {
  11763. "type": "object",
  11764. "properties": {
  11765. "disabled": {
  11766. "type": "boolean"
  11767. },
  11768. "command": {
  11769. "type": "array",
  11770. "items": {
  11771. "type": "string"
  11772. }
  11773. },
  11774. "environment": {
  11775. "type": "object",
  11776. "additionalProperties": {
  11777. "type": "string"
  11778. }
  11779. },
  11780. "extensions": {
  11781. "type": "array",
  11782. "items": {
  11783. "type": "string"
  11784. }
  11785. }
  11786. },
  11787. "additionalProperties": false
  11788. }
  11789. }
  11790. ],
  11791. "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."
  11792. },
  11793. "lsp": {
  11794. "anyOf": [
  11795. {
  11796. "type": "boolean"
  11797. },
  11798. {
  11799. "type": "object",
  11800. "additionalProperties": {
  11801. "anyOf": [
  11802. {
  11803. "type": "object",
  11804. "properties": {
  11805. "disabled": {
  11806. "type": "boolean",
  11807. "enum": [true]
  11808. }
  11809. },
  11810. "required": ["disabled"],
  11811. "additionalProperties": false
  11812. },
  11813. {
  11814. "type": "object",
  11815. "properties": {
  11816. "command": {
  11817. "type": "array",
  11818. "items": {
  11819. "type": "string"
  11820. }
  11821. },
  11822. "extensions": {
  11823. "type": "array",
  11824. "items": {
  11825. "type": "string"
  11826. }
  11827. },
  11828. "disabled": {
  11829. "type": "boolean"
  11830. },
  11831. "env": {
  11832. "type": "object",
  11833. "additionalProperties": {
  11834. "type": "string"
  11835. }
  11836. },
  11837. "initialization": {
  11838. "type": "object"
  11839. }
  11840. },
  11841. "required": ["command"],
  11842. "additionalProperties": false
  11843. }
  11844. ]
  11845. }
  11846. }
  11847. ],
  11848. "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."
  11849. },
  11850. "instructions": {
  11851. "type": "array",
  11852. "items": {
  11853. "type": "string"
  11854. }
  11855. },
  11856. "layout": {
  11857. "$ref": "#/components/schemas/LayoutConfig"
  11858. },
  11859. "permission": {
  11860. "$ref": "#/components/schemas/PermissionConfig"
  11861. },
  11862. "tools": {
  11863. "type": "object",
  11864. "additionalProperties": {
  11865. "type": "boolean"
  11866. }
  11867. },
  11868. "enterprise": {
  11869. "type": "object",
  11870. "properties": {
  11871. "url": {
  11872. "type": "string"
  11873. }
  11874. },
  11875. "additionalProperties": false
  11876. },
  11877. "tool_output": {
  11878. "type": "object",
  11879. "properties": {
  11880. "max_lines": {
  11881. "type": "integer",
  11882. "exclusiveMinimum": 0
  11883. },
  11884. "max_bytes": {
  11885. "type": "integer",
  11886. "exclusiveMinimum": 0
  11887. }
  11888. },
  11889. "additionalProperties": false
  11890. },
  11891. "compaction": {
  11892. "type": "object",
  11893. "properties": {
  11894. "auto": {
  11895. "type": "boolean"
  11896. },
  11897. "prune": {
  11898. "type": "boolean"
  11899. },
  11900. "tail_turns": {
  11901. "type": "integer",
  11902. "minimum": 0
  11903. },
  11904. "preserve_recent_tokens": {
  11905. "type": "integer",
  11906. "minimum": 0
  11907. },
  11908. "reserved": {
  11909. "type": "integer",
  11910. "minimum": 0
  11911. }
  11912. },
  11913. "additionalProperties": false
  11914. },
  11915. "experimental": {
  11916. "type": "object",
  11917. "properties": {
  11918. "disable_paste_summary": {
  11919. "type": "boolean"
  11920. },
  11921. "batch_tool": {
  11922. "type": "boolean"
  11923. },
  11924. "openTelemetry": {
  11925. "type": "boolean"
  11926. },
  11927. "primary_tools": {
  11928. "type": "array",
  11929. "items": {
  11930. "type": "string"
  11931. }
  11932. },
  11933. "continue_loop_on_deny": {
  11934. "type": "boolean"
  11935. },
  11936. "mcp_timeout": {
  11937. "type": "integer",
  11938. "exclusiveMinimum": 0
  11939. }
  11940. },
  11941. "additionalProperties": false
  11942. }
  11943. },
  11944. "additionalProperties": false
  11945. },
  11946. "Model": {
  11947. "type": "object",
  11948. "properties": {
  11949. "id": {
  11950. "type": "string"
  11951. },
  11952. "providerID": {
  11953. "type": "string"
  11954. },
  11955. "api": {
  11956. "type": "object",
  11957. "properties": {
  11958. "id": {
  11959. "type": "string"
  11960. },
  11961. "url": {
  11962. "type": "string"
  11963. },
  11964. "npm": {
  11965. "type": "string"
  11966. }
  11967. },
  11968. "required": ["id", "url", "npm"],
  11969. "additionalProperties": false
  11970. },
  11971. "name": {
  11972. "type": "string"
  11973. },
  11974. "family": {
  11975. "type": "string"
  11976. },
  11977. "capabilities": {
  11978. "type": "object",
  11979. "properties": {
  11980. "temperature": {
  11981. "type": "boolean"
  11982. },
  11983. "reasoning": {
  11984. "type": "boolean"
  11985. },
  11986. "attachment": {
  11987. "type": "boolean"
  11988. },
  11989. "toolcall": {
  11990. "type": "boolean"
  11991. },
  11992. "input": {
  11993. "type": "object",
  11994. "properties": {
  11995. "text": {
  11996. "type": "boolean"
  11997. },
  11998. "audio": {
  11999. "type": "boolean"
  12000. },
  12001. "image": {
  12002. "type": "boolean"
  12003. },
  12004. "video": {
  12005. "type": "boolean"
  12006. },
  12007. "pdf": {
  12008. "type": "boolean"
  12009. }
  12010. },
  12011. "required": ["text", "audio", "image", "video", "pdf"],
  12012. "additionalProperties": false
  12013. },
  12014. "output": {
  12015. "type": "object",
  12016. "properties": {
  12017. "text": {
  12018. "type": "boolean"
  12019. },
  12020. "audio": {
  12021. "type": "boolean"
  12022. },
  12023. "image": {
  12024. "type": "boolean"
  12025. },
  12026. "video": {
  12027. "type": "boolean"
  12028. },
  12029. "pdf": {
  12030. "type": "boolean"
  12031. }
  12032. },
  12033. "required": ["text", "audio", "image", "video", "pdf"],
  12034. "additionalProperties": false
  12035. },
  12036. "interleaved": {
  12037. "anyOf": [
  12038. {
  12039. "type": "boolean"
  12040. },
  12041. {
  12042. "type": "object",
  12043. "properties": {
  12044. "field": {
  12045. "type": "string",
  12046. "enum": ["reasoning_content", "reasoning_details"]
  12047. }
  12048. },
  12049. "required": ["field"],
  12050. "additionalProperties": false
  12051. }
  12052. ]
  12053. }
  12054. },
  12055. "required": ["temperature", "reasoning", "attachment", "toolcall", "input", "output", "interleaved"],
  12056. "additionalProperties": false
  12057. },
  12058. "cost": {
  12059. "type": "object",
  12060. "properties": {
  12061. "input": {
  12062. "type": "number"
  12063. },
  12064. "output": {
  12065. "type": "number"
  12066. },
  12067. "cache": {
  12068. "type": "object",
  12069. "properties": {
  12070. "read": {
  12071. "type": "number"
  12072. },
  12073. "write": {
  12074. "type": "number"
  12075. }
  12076. },
  12077. "required": ["read", "write"],
  12078. "additionalProperties": false
  12079. },
  12080. "experimentalOver200K": {
  12081. "type": "object",
  12082. "properties": {
  12083. "input": {
  12084. "type": "number"
  12085. },
  12086. "output": {
  12087. "type": "number"
  12088. },
  12089. "cache": {
  12090. "type": "object",
  12091. "properties": {
  12092. "read": {
  12093. "type": "number"
  12094. },
  12095. "write": {
  12096. "type": "number"
  12097. }
  12098. },
  12099. "required": ["read", "write"],
  12100. "additionalProperties": false
  12101. }
  12102. },
  12103. "required": ["input", "output", "cache"],
  12104. "additionalProperties": false
  12105. }
  12106. },
  12107. "required": ["input", "output", "cache"],
  12108. "additionalProperties": false
  12109. },
  12110. "limit": {
  12111. "type": "object",
  12112. "properties": {
  12113. "context": {
  12114. "type": "number"
  12115. },
  12116. "input": {
  12117. "type": "number"
  12118. },
  12119. "output": {
  12120. "type": "number"
  12121. }
  12122. },
  12123. "required": ["context", "output"],
  12124. "additionalProperties": false
  12125. },
  12126. "status": {
  12127. "type": "string",
  12128. "enum": ["alpha", "beta", "deprecated", "active"]
  12129. },
  12130. "options": {
  12131. "type": "object"
  12132. },
  12133. "headers": {
  12134. "type": "object",
  12135. "additionalProperties": {
  12136. "type": "string"
  12137. }
  12138. },
  12139. "release_date": {
  12140. "type": "string"
  12141. },
  12142. "variants": {
  12143. "type": "object",
  12144. "additionalProperties": {
  12145. "type": "object"
  12146. }
  12147. }
  12148. },
  12149. "required": [
  12150. "id",
  12151. "providerID",
  12152. "api",
  12153. "name",
  12154. "capabilities",
  12155. "cost",
  12156. "limit",
  12157. "status",
  12158. "options",
  12159. "headers",
  12160. "release_date"
  12161. ],
  12162. "additionalProperties": false
  12163. },
  12164. "Provider": {
  12165. "type": "object",
  12166. "properties": {
  12167. "id": {
  12168. "type": "string"
  12169. },
  12170. "name": {
  12171. "type": "string"
  12172. },
  12173. "source": {
  12174. "type": "string",
  12175. "enum": ["env", "config", "custom", "api"]
  12176. },
  12177. "env": {
  12178. "type": "array",
  12179. "items": {
  12180. "type": "string"
  12181. }
  12182. },
  12183. "key": {
  12184. "type": "string"
  12185. },
  12186. "options": {
  12187. "type": "object"
  12188. },
  12189. "models": {
  12190. "type": "object",
  12191. "additionalProperties": {
  12192. "$ref": "#/components/schemas/Model"
  12193. }
  12194. }
  12195. },
  12196. "required": ["id", "name", "source", "env", "options", "models"],
  12197. "additionalProperties": false
  12198. },
  12199. "ConsoleState": {
  12200. "type": "object",
  12201. "properties": {
  12202. "consoleManagedProviders": {
  12203. "type": "array",
  12204. "items": {
  12205. "type": "string"
  12206. }
  12207. },
  12208. "activeOrgName": {
  12209. "type": "string"
  12210. },
  12211. "switchableOrgCount": {
  12212. "type": "integer",
  12213. "minimum": 0
  12214. }
  12215. },
  12216. "required": ["consoleManagedProviders", "switchableOrgCount"],
  12217. "additionalProperties": false
  12218. },
  12219. "ToolListItem": {
  12220. "type": "object",
  12221. "properties": {
  12222. "id": {
  12223. "type": "string"
  12224. },
  12225. "description": {
  12226. "type": "string"
  12227. },
  12228. "parameters": {}
  12229. },
  12230. "required": ["id", "description", "parameters"],
  12231. "additionalProperties": false
  12232. },
  12233. "ToolList": {
  12234. "type": "array",
  12235. "items": {
  12236. "$ref": "#/components/schemas/ToolListItem"
  12237. }
  12238. },
  12239. "ToolIDs": {
  12240. "type": "array",
  12241. "items": {
  12242. "type": "string"
  12243. }
  12244. },
  12245. "WorktreeCreateInput": {
  12246. "type": "object",
  12247. "properties": {
  12248. "name": {
  12249. "type": "string"
  12250. },
  12251. "startCommand": {
  12252. "type": "string",
  12253. "description": "Additional startup script to run after the project's start command"
  12254. }
  12255. },
  12256. "additionalProperties": false
  12257. },
  12258. "Worktree": {
  12259. "type": "object",
  12260. "properties": {
  12261. "name": {
  12262. "type": "string"
  12263. },
  12264. "branch": {
  12265. "type": "string"
  12266. },
  12267. "directory": {
  12268. "type": "string"
  12269. }
  12270. },
  12271. "required": ["name", "branch", "directory"],
  12272. "additionalProperties": false
  12273. },
  12274. "WorktreeRemoveInput": {
  12275. "type": "object",
  12276. "properties": {
  12277. "directory": {
  12278. "type": "string"
  12279. }
  12280. },
  12281. "required": ["directory"],
  12282. "additionalProperties": false
  12283. },
  12284. "WorktreeResetInput": {
  12285. "type": "object",
  12286. "properties": {
  12287. "directory": {
  12288. "type": "string"
  12289. }
  12290. },
  12291. "required": ["directory"],
  12292. "additionalProperties": false
  12293. },
  12294. "ProjectSummary": {
  12295. "type": "object",
  12296. "properties": {
  12297. "id": {
  12298. "type": "string"
  12299. },
  12300. "name": {
  12301. "type": "string"
  12302. },
  12303. "worktree": {
  12304. "type": "string"
  12305. }
  12306. },
  12307. "required": ["id", "worktree"],
  12308. "additionalProperties": false
  12309. },
  12310. "GlobalSession": {
  12311. "type": "object",
  12312. "properties": {
  12313. "id": {
  12314. "type": "string"
  12315. },
  12316. "slug": {
  12317. "type": "string"
  12318. },
  12319. "projectID": {
  12320. "type": "string"
  12321. },
  12322. "workspaceID": {
  12323. "type": "string"
  12324. },
  12325. "directory": {
  12326. "type": "string"
  12327. },
  12328. "path": {
  12329. "type": "string"
  12330. },
  12331. "parentID": {
  12332. "type": "string"
  12333. },
  12334. "summary": {
  12335. "type": "object",
  12336. "properties": {
  12337. "additions": {
  12338. "type": "integer",
  12339. "minimum": 0
  12340. },
  12341. "deletions": {
  12342. "type": "integer",
  12343. "minimum": 0
  12344. },
  12345. "files": {
  12346. "type": "integer",
  12347. "minimum": 0
  12348. },
  12349. "diffs": {
  12350. "type": "array",
  12351. "items": {
  12352. "$ref": "#/components/schemas/SnapshotFileDiff"
  12353. }
  12354. }
  12355. },
  12356. "required": ["additions", "deletions", "files"],
  12357. "additionalProperties": false
  12358. },
  12359. "share": {
  12360. "type": "object",
  12361. "properties": {
  12362. "url": {
  12363. "type": "string"
  12364. }
  12365. },
  12366. "required": ["url"],
  12367. "additionalProperties": false
  12368. },
  12369. "title": {
  12370. "type": "string"
  12371. },
  12372. "agent": {
  12373. "type": "string"
  12374. },
  12375. "model": {
  12376. "type": "object",
  12377. "properties": {
  12378. "id": {
  12379. "type": "string"
  12380. },
  12381. "providerID": {
  12382. "type": "string"
  12383. },
  12384. "variant": {
  12385. "type": "string"
  12386. }
  12387. },
  12388. "required": ["id", "providerID"],
  12389. "additionalProperties": false
  12390. },
  12391. "version": {
  12392. "type": "string"
  12393. },
  12394. "time": {
  12395. "type": "object",
  12396. "properties": {
  12397. "created": {
  12398. "type": "integer",
  12399. "minimum": 0
  12400. },
  12401. "updated": {
  12402. "type": "integer",
  12403. "minimum": 0
  12404. },
  12405. "compacting": {
  12406. "type": "integer",
  12407. "minimum": 0
  12408. },
  12409. "archived": {
  12410. "type": "number"
  12411. }
  12412. },
  12413. "required": ["created", "updated"],
  12414. "additionalProperties": false
  12415. },
  12416. "permission": {
  12417. "$ref": "#/components/schemas/PermissionRuleset"
  12418. },
  12419. "revert": {
  12420. "type": "object",
  12421. "properties": {
  12422. "messageID": {
  12423. "type": "string"
  12424. },
  12425. "partID": {
  12426. "type": "string"
  12427. },
  12428. "snapshot": {
  12429. "type": "string"
  12430. },
  12431. "diff": {
  12432. "type": "string"
  12433. }
  12434. },
  12435. "required": ["messageID"],
  12436. "additionalProperties": false
  12437. },
  12438. "project": {
  12439. "anyOf": [
  12440. {
  12441. "$ref": "#/components/schemas/ProjectSummary"
  12442. },
  12443. {
  12444. "type": "null"
  12445. }
  12446. ]
  12447. }
  12448. },
  12449. "required": ["id", "slug", "projectID", "directory", "title", "version", "time", "project"],
  12450. "additionalProperties": false
  12451. },
  12452. "McpResource": {
  12453. "type": "object",
  12454. "properties": {
  12455. "name": {
  12456. "type": "string"
  12457. },
  12458. "uri": {
  12459. "type": "string"
  12460. },
  12461. "description": {
  12462. "type": "string"
  12463. },
  12464. "mimeType": {
  12465. "type": "string"
  12466. },
  12467. "client": {
  12468. "type": "string"
  12469. }
  12470. },
  12471. "required": ["name", "uri", "client"],
  12472. "additionalProperties": false
  12473. },
  12474. "Symbol": {
  12475. "type": "object",
  12476. "properties": {
  12477. "name": {
  12478. "type": "string"
  12479. },
  12480. "kind": {
  12481. "type": "integer",
  12482. "minimum": 0
  12483. },
  12484. "location": {
  12485. "type": "object",
  12486. "properties": {
  12487. "uri": {
  12488. "type": "string"
  12489. },
  12490. "range": {
  12491. "$ref": "#/components/schemas/Range"
  12492. }
  12493. },
  12494. "required": ["uri", "range"],
  12495. "additionalProperties": false
  12496. }
  12497. },
  12498. "required": ["name", "kind", "location"],
  12499. "additionalProperties": false
  12500. },
  12501. "FileNode": {
  12502. "type": "object",
  12503. "properties": {
  12504. "name": {
  12505. "type": "string"
  12506. },
  12507. "path": {
  12508. "type": "string"
  12509. },
  12510. "absolute": {
  12511. "type": "string"
  12512. },
  12513. "type": {
  12514. "type": "string",
  12515. "enum": ["file", "directory"]
  12516. },
  12517. "ignored": {
  12518. "type": "boolean"
  12519. }
  12520. },
  12521. "required": ["name", "path", "absolute", "type", "ignored"],
  12522. "additionalProperties": false
  12523. },
  12524. "FileContent": {
  12525. "type": "object",
  12526. "properties": {
  12527. "type": {
  12528. "type": "string",
  12529. "enum": ["text", "binary"]
  12530. },
  12531. "content": {
  12532. "type": "string"
  12533. },
  12534. "diff": {
  12535. "type": "string"
  12536. },
  12537. "patch": {
  12538. "type": "object",
  12539. "properties": {
  12540. "oldFileName": {
  12541. "type": "string"
  12542. },
  12543. "newFileName": {
  12544. "type": "string"
  12545. },
  12546. "oldHeader": {
  12547. "type": "string"
  12548. },
  12549. "newHeader": {
  12550. "type": "string"
  12551. },
  12552. "hunks": {
  12553. "type": "array",
  12554. "items": {
  12555. "type": "object",
  12556. "properties": {
  12557. "oldStart": {
  12558. "type": "integer",
  12559. "minimum": 0
  12560. },
  12561. "oldLines": {
  12562. "type": "integer",
  12563. "minimum": 0
  12564. },
  12565. "newStart": {
  12566. "type": "integer",
  12567. "minimum": 0
  12568. },
  12569. "newLines": {
  12570. "type": "integer",
  12571. "minimum": 0
  12572. },
  12573. "lines": {
  12574. "type": "array",
  12575. "items": {
  12576. "type": "string"
  12577. }
  12578. }
  12579. },
  12580. "required": ["oldStart", "oldLines", "newStart", "newLines", "lines"],
  12581. "additionalProperties": false
  12582. }
  12583. },
  12584. "index": {
  12585. "type": "string"
  12586. }
  12587. },
  12588. "required": ["oldFileName", "newFileName", "hunks"],
  12589. "additionalProperties": false
  12590. },
  12591. "encoding": {
  12592. "type": "string",
  12593. "enum": ["base64"]
  12594. },
  12595. "mimeType": {
  12596. "type": "string"
  12597. }
  12598. },
  12599. "required": ["type", "content"],
  12600. "additionalProperties": false
  12601. },
  12602. "File": {
  12603. "type": "object",
  12604. "properties": {
  12605. "path": {
  12606. "type": "string"
  12607. },
  12608. "added": {
  12609. "type": "integer",
  12610. "minimum": 0
  12611. },
  12612. "removed": {
  12613. "type": "integer",
  12614. "minimum": 0
  12615. },
  12616. "status": {
  12617. "type": "string",
  12618. "enum": ["added", "deleted", "modified"]
  12619. }
  12620. },
  12621. "required": ["path", "added", "removed", "status"],
  12622. "additionalProperties": false
  12623. },
  12624. "Path": {
  12625. "type": "object",
  12626. "properties": {
  12627. "home": {
  12628. "type": "string"
  12629. },
  12630. "state": {
  12631. "type": "string"
  12632. },
  12633. "config": {
  12634. "type": "string"
  12635. },
  12636. "worktree": {
  12637. "type": "string"
  12638. },
  12639. "directory": {
  12640. "type": "string"
  12641. }
  12642. },
  12643. "required": ["home", "state", "config", "worktree", "directory"],
  12644. "additionalProperties": false
  12645. },
  12646. "VcsInfo": {
  12647. "type": "object",
  12648. "properties": {
  12649. "branch": {
  12650. "type": "string"
  12651. },
  12652. "default_branch": {
  12653. "type": "string"
  12654. }
  12655. },
  12656. "additionalProperties": false
  12657. },
  12658. "VcsFileDiff": {
  12659. "type": "object",
  12660. "properties": {
  12661. "file": {
  12662. "type": "string"
  12663. },
  12664. "patch": {
  12665. "type": "string"
  12666. },
  12667. "additions": {
  12668. "type": "integer",
  12669. "minimum": 0
  12670. },
  12671. "deletions": {
  12672. "type": "integer",
  12673. "minimum": 0
  12674. },
  12675. "status": {
  12676. "type": "string",
  12677. "enum": ["added", "deleted", "modified"]
  12678. }
  12679. },
  12680. "required": ["file", "patch", "additions", "deletions"],
  12681. "additionalProperties": false
  12682. },
  12683. "Command": {
  12684. "type": "object",
  12685. "properties": {
  12686. "name": {
  12687. "type": "string"
  12688. },
  12689. "description": {
  12690. "type": "string"
  12691. },
  12692. "agent": {
  12693. "type": "string"
  12694. },
  12695. "model": {
  12696. "type": "string"
  12697. },
  12698. "source": {
  12699. "type": "string",
  12700. "enum": ["command", "mcp", "skill"]
  12701. },
  12702. "template": {
  12703. "type": "string"
  12704. },
  12705. "subtask": {
  12706. "type": "boolean"
  12707. },
  12708. "hints": {
  12709. "type": "array",
  12710. "items": {
  12711. "type": "string"
  12712. }
  12713. }
  12714. },
  12715. "required": ["name", "template", "hints"],
  12716. "additionalProperties": false
  12717. },
  12718. "Agent": {
  12719. "type": "object",
  12720. "properties": {
  12721. "name": {
  12722. "type": "string"
  12723. },
  12724. "description": {
  12725. "type": "string"
  12726. },
  12727. "mode": {
  12728. "type": "string",
  12729. "enum": ["subagent", "primary", "all"]
  12730. },
  12731. "native": {
  12732. "type": "boolean"
  12733. },
  12734. "hidden": {
  12735. "type": "boolean"
  12736. },
  12737. "topP": {
  12738. "type": "number"
  12739. },
  12740. "temperature": {
  12741. "type": "number"
  12742. },
  12743. "color": {
  12744. "type": "string"
  12745. },
  12746. "permission": {
  12747. "$ref": "#/components/schemas/PermissionRuleset"
  12748. },
  12749. "model": {
  12750. "type": "object",
  12751. "properties": {
  12752. "modelID": {
  12753. "type": "string"
  12754. },
  12755. "providerID": {
  12756. "type": "string"
  12757. }
  12758. },
  12759. "required": ["modelID", "providerID"],
  12760. "additionalProperties": false
  12761. },
  12762. "variant": {
  12763. "type": "string"
  12764. },
  12765. "prompt": {
  12766. "type": "string"
  12767. },
  12768. "options": {
  12769. "type": "object"
  12770. },
  12771. "steps": {
  12772. "type": "number"
  12773. }
  12774. },
  12775. "required": ["name", "mode", "permission", "options"],
  12776. "additionalProperties": false
  12777. },
  12778. "LSPStatus": {
  12779. "type": "object",
  12780. "properties": {
  12781. "id": {
  12782. "type": "string"
  12783. },
  12784. "name": {
  12785. "type": "string"
  12786. },
  12787. "root": {
  12788. "type": "string"
  12789. },
  12790. "status": {
  12791. "type": "string",
  12792. "enum": ["connected", "error"]
  12793. }
  12794. },
  12795. "required": ["id", "name", "root", "status"],
  12796. "additionalProperties": false
  12797. },
  12798. "FormatterStatus": {
  12799. "type": "object",
  12800. "properties": {
  12801. "name": {
  12802. "type": "string"
  12803. },
  12804. "extensions": {
  12805. "type": "array",
  12806. "items": {
  12807. "type": "string"
  12808. }
  12809. },
  12810. "enabled": {
  12811. "type": "boolean"
  12812. }
  12813. },
  12814. "required": ["name", "extensions", "enabled"],
  12815. "additionalProperties": false
  12816. },
  12817. "MCPStatusConnected": {
  12818. "type": "object",
  12819. "properties": {
  12820. "status": {
  12821. "type": "string",
  12822. "enum": ["connected"]
  12823. }
  12824. },
  12825. "required": ["status"],
  12826. "additionalProperties": false
  12827. },
  12828. "MCPStatusDisabled": {
  12829. "type": "object",
  12830. "properties": {
  12831. "status": {
  12832. "type": "string",
  12833. "enum": ["disabled"]
  12834. }
  12835. },
  12836. "required": ["status"],
  12837. "additionalProperties": false
  12838. },
  12839. "MCPStatusFailed": {
  12840. "type": "object",
  12841. "properties": {
  12842. "status": {
  12843. "type": "string",
  12844. "enum": ["failed"]
  12845. },
  12846. "error": {
  12847. "type": "string"
  12848. }
  12849. },
  12850. "required": ["status", "error"],
  12851. "additionalProperties": false
  12852. },
  12853. "MCPStatusNeedsAuth": {
  12854. "type": "object",
  12855. "properties": {
  12856. "status": {
  12857. "type": "string",
  12858. "enum": ["needs_auth"]
  12859. }
  12860. },
  12861. "required": ["status"],
  12862. "additionalProperties": false
  12863. },
  12864. "MCPStatusNeedsClientRegistration": {
  12865. "type": "object",
  12866. "properties": {
  12867. "status": {
  12868. "type": "string",
  12869. "enum": ["needs_client_registration"]
  12870. },
  12871. "error": {
  12872. "type": "string"
  12873. }
  12874. },
  12875. "required": ["status", "error"],
  12876. "additionalProperties": false
  12877. },
  12878. "MCPStatus": {
  12879. "anyOf": [
  12880. {
  12881. "$ref": "#/components/schemas/MCPStatusConnected"
  12882. },
  12883. {
  12884. "$ref": "#/components/schemas/MCPStatusDisabled"
  12885. },
  12886. {
  12887. "$ref": "#/components/schemas/MCPStatusFailed"
  12888. },
  12889. {
  12890. "$ref": "#/components/schemas/MCPStatusNeedsAuth"
  12891. },
  12892. {
  12893. "$ref": "#/components/schemas/MCPStatusNeedsClientRegistration"
  12894. }
  12895. ]
  12896. },
  12897. "McpUnsupportedOAuthError": {
  12898. "type": "object",
  12899. "properties": {
  12900. "error": {
  12901. "type": "string"
  12902. }
  12903. },
  12904. "required": ["error"],
  12905. "additionalProperties": false
  12906. },
  12907. "effect_HttpApiError_Forbidden": {
  12908. "type": "object",
  12909. "properties": {
  12910. "_tag": {
  12911. "type": "string",
  12912. "enum": ["Forbidden"]
  12913. }
  12914. },
  12915. "required": ["_tag"],
  12916. "additionalProperties": false
  12917. },
  12918. "ProviderAuthMethod": {
  12919. "type": "object",
  12920. "properties": {
  12921. "type": {
  12922. "type": "string",
  12923. "enum": ["oauth", "api"]
  12924. },
  12925. "label": {
  12926. "type": "string"
  12927. },
  12928. "prompts": {
  12929. "type": "array",
  12930. "items": {
  12931. "anyOf": [
  12932. {
  12933. "type": "object",
  12934. "properties": {
  12935. "type": {
  12936. "type": "string",
  12937. "enum": ["text"]
  12938. },
  12939. "key": {
  12940. "type": "string"
  12941. },
  12942. "message": {
  12943. "type": "string"
  12944. },
  12945. "placeholder": {
  12946. "type": "string"
  12947. },
  12948. "when": {
  12949. "type": "object",
  12950. "properties": {
  12951. "key": {
  12952. "type": "string"
  12953. },
  12954. "op": {
  12955. "type": "string",
  12956. "enum": ["eq", "neq"]
  12957. },
  12958. "value": {
  12959. "type": "string"
  12960. }
  12961. },
  12962. "required": ["key", "op", "value"],
  12963. "additionalProperties": false
  12964. }
  12965. },
  12966. "required": ["type", "key", "message"],
  12967. "additionalProperties": false
  12968. },
  12969. {
  12970. "type": "object",
  12971. "properties": {
  12972. "type": {
  12973. "type": "string",
  12974. "enum": ["select"]
  12975. },
  12976. "key": {
  12977. "type": "string"
  12978. },
  12979. "message": {
  12980. "type": "string"
  12981. },
  12982. "options": {
  12983. "type": "array",
  12984. "items": {
  12985. "type": "object",
  12986. "properties": {
  12987. "label": {
  12988. "type": "string"
  12989. },
  12990. "value": {
  12991. "type": "string"
  12992. },
  12993. "hint": {
  12994. "type": "string"
  12995. }
  12996. },
  12997. "required": ["label", "value"],
  12998. "additionalProperties": false
  12999. }
  13000. },
  13001. "when": {
  13002. "type": "object",
  13003. "properties": {
  13004. "key": {
  13005. "type": "string"
  13006. },
  13007. "op": {
  13008. "type": "string",
  13009. "enum": ["eq", "neq"]
  13010. },
  13011. "value": {
  13012. "type": "string"
  13013. }
  13014. },
  13015. "required": ["key", "op", "value"],
  13016. "additionalProperties": false
  13017. }
  13018. },
  13019. "required": ["type", "key", "message", "options"],
  13020. "additionalProperties": false
  13021. }
  13022. ]
  13023. }
  13024. }
  13025. },
  13026. "required": ["type", "label"],
  13027. "additionalProperties": false
  13028. },
  13029. "ProviderAuthAuthorization": {
  13030. "type": "object",
  13031. "properties": {
  13032. "url": {
  13033. "type": "string"
  13034. },
  13035. "method": {
  13036. "type": "string",
  13037. "enum": ["auto", "code"]
  13038. },
  13039. "instructions": {
  13040. "type": "string"
  13041. }
  13042. },
  13043. "required": ["url", "method", "instructions"],
  13044. "additionalProperties": false
  13045. },
  13046. "TextPartInput": {
  13047. "type": "object",
  13048. "properties": {
  13049. "id": {
  13050. "type": "string"
  13051. },
  13052. "type": {
  13053. "type": "string",
  13054. "enum": ["text"]
  13055. },
  13056. "text": {
  13057. "type": "string"
  13058. },
  13059. "synthetic": {
  13060. "type": "boolean"
  13061. },
  13062. "ignored": {
  13063. "type": "boolean"
  13064. },
  13065. "time": {
  13066. "type": "object",
  13067. "properties": {
  13068. "start": {
  13069. "type": "integer",
  13070. "minimum": 0
  13071. },
  13072. "end": {
  13073. "type": "integer",
  13074. "minimum": 0
  13075. }
  13076. },
  13077. "required": ["start"],
  13078. "additionalProperties": false
  13079. },
  13080. "metadata": {
  13081. "type": "object"
  13082. }
  13083. },
  13084. "required": ["type", "text"],
  13085. "additionalProperties": false
  13086. },
  13087. "FilePartInput": {
  13088. "type": "object",
  13089. "properties": {
  13090. "id": {
  13091. "type": "string"
  13092. },
  13093. "type": {
  13094. "type": "string",
  13095. "enum": ["file"]
  13096. },
  13097. "mime": {
  13098. "type": "string"
  13099. },
  13100. "filename": {
  13101. "type": "string"
  13102. },
  13103. "url": {
  13104. "type": "string"
  13105. },
  13106. "source": {
  13107. "$ref": "#/components/schemas/FilePartSource"
  13108. }
  13109. },
  13110. "required": ["type", "mime", "url"],
  13111. "additionalProperties": false
  13112. },
  13113. "AgentPartInput": {
  13114. "type": "object",
  13115. "properties": {
  13116. "id": {
  13117. "type": "string"
  13118. },
  13119. "type": {
  13120. "type": "string",
  13121. "enum": ["agent"]
  13122. },
  13123. "name": {
  13124. "type": "string"
  13125. },
  13126. "source": {
  13127. "type": "object",
  13128. "properties": {
  13129. "value": {
  13130. "type": "string"
  13131. },
  13132. "start": {
  13133. "type": "integer",
  13134. "minimum": 0
  13135. },
  13136. "end": {
  13137. "type": "integer",
  13138. "minimum": 0
  13139. }
  13140. },
  13141. "required": ["value", "start", "end"],
  13142. "additionalProperties": false
  13143. }
  13144. },
  13145. "required": ["type", "name"],
  13146. "additionalProperties": false
  13147. },
  13148. "SubtaskPartInput": {
  13149. "type": "object",
  13150. "properties": {
  13151. "id": {
  13152. "type": "string"
  13153. },
  13154. "type": {
  13155. "type": "string",
  13156. "enum": ["subtask"]
  13157. },
  13158. "prompt": {
  13159. "type": "string"
  13160. },
  13161. "description": {
  13162. "type": "string"
  13163. },
  13164. "agent": {
  13165. "type": "string"
  13166. },
  13167. "model": {
  13168. "type": "object",
  13169. "properties": {
  13170. "providerID": {
  13171. "type": "string"
  13172. },
  13173. "modelID": {
  13174. "type": "string"
  13175. }
  13176. },
  13177. "required": ["providerID", "modelID"],
  13178. "additionalProperties": false
  13179. },
  13180. "command": {
  13181. "type": "string"
  13182. }
  13183. },
  13184. "required": ["type", "prompt", "description", "agent"],
  13185. "additionalProperties": false
  13186. },
  13187. "V2SessionsResponse": {
  13188. "type": "object",
  13189. "properties": {
  13190. "items": {
  13191. "type": "array",
  13192. "items": {
  13193. "$ref": "#/components/schemas/SessionInfo"
  13194. }
  13195. },
  13196. "cursor": {
  13197. "type": "object",
  13198. "properties": {
  13199. "previous": {
  13200. "type": "string"
  13201. },
  13202. "next": {
  13203. "type": "string"
  13204. }
  13205. },
  13206. "additionalProperties": false
  13207. }
  13208. },
  13209. "required": ["items", "cursor"],
  13210. "additionalProperties": false
  13211. },
  13212. "V2SessionMessagesResponse": {
  13213. "type": "object",
  13214. "properties": {
  13215. "items": {
  13216. "type": "array",
  13217. "items": {
  13218. "$ref": "#/components/schemas/SessionMessage"
  13219. }
  13220. },
  13221. "cursor": {
  13222. "type": "object",
  13223. "properties": {
  13224. "previous": {
  13225. "type": "string"
  13226. },
  13227. "next": {
  13228. "type": "string"
  13229. }
  13230. },
  13231. "additionalProperties": false
  13232. }
  13233. },
  13234. "required": ["items", "cursor"],
  13235. "additionalProperties": false
  13236. },
  13237. "EventTuiPromptAppend": {
  13238. "type": "object",
  13239. "properties": {
  13240. "type": {
  13241. "type": "string",
  13242. "enum": ["tui.prompt.append"]
  13243. },
  13244. "properties": {
  13245. "type": "object",
  13246. "properties": {
  13247. "text": {
  13248. "type": "string"
  13249. }
  13250. },
  13251. "required": ["text"],
  13252. "additionalProperties": false
  13253. }
  13254. },
  13255. "required": ["type", "properties"],
  13256. "additionalProperties": false
  13257. },
  13258. "EventTuiCommandExecute": {
  13259. "type": "object",
  13260. "properties": {
  13261. "type": {
  13262. "type": "string",
  13263. "enum": ["tui.command.execute"]
  13264. },
  13265. "properties": {
  13266. "type": "object",
  13267. "properties": {
  13268. "command": {
  13269. "anyOf": [
  13270. {
  13271. "type": "string",
  13272. "enum": [
  13273. "session.list",
  13274. "session.new",
  13275. "session.share",
  13276. "session.interrupt",
  13277. "session.compact",
  13278. "session.page.up",
  13279. "session.page.down",
  13280. "session.line.up",
  13281. "session.line.down",
  13282. "session.half.page.up",
  13283. "session.half.page.down",
  13284. "session.first",
  13285. "session.last",
  13286. "prompt.clear",
  13287. "prompt.submit",
  13288. "agent.cycle"
  13289. ]
  13290. },
  13291. {
  13292. "type": "string"
  13293. }
  13294. ]
  13295. }
  13296. },
  13297. "required": ["command"],
  13298. "additionalProperties": false
  13299. }
  13300. },
  13301. "required": ["type", "properties"],
  13302. "additionalProperties": false
  13303. },
  13304. "EventTuiToastShow": {
  13305. "type": "object",
  13306. "properties": {
  13307. "type": {
  13308. "type": "string",
  13309. "enum": ["tui.toast.show"]
  13310. },
  13311. "properties": {
  13312. "type": "object",
  13313. "properties": {
  13314. "title": {
  13315. "type": "string"
  13316. },
  13317. "message": {
  13318. "type": "string"
  13319. },
  13320. "variant": {
  13321. "type": "string",
  13322. "enum": ["info", "success", "warning", "error"]
  13323. },
  13324. "duration": {
  13325. "type": "integer",
  13326. "exclusiveMinimum": 0
  13327. }
  13328. },
  13329. "required": ["message", "variant"],
  13330. "additionalProperties": false
  13331. }
  13332. },
  13333. "required": ["type", "properties"],
  13334. "additionalProperties": false
  13335. },
  13336. "EventTuiSessionSelect": {
  13337. "type": "object",
  13338. "properties": {
  13339. "type": {
  13340. "type": "string",
  13341. "enum": ["tui.session.select"]
  13342. },
  13343. "properties": {
  13344. "type": "object",
  13345. "properties": {
  13346. "sessionID": {
  13347. "type": "string",
  13348. "description": "Session ID to navigate to"
  13349. }
  13350. },
  13351. "required": ["sessionID"],
  13352. "additionalProperties": false
  13353. }
  13354. },
  13355. "required": ["type", "properties"],
  13356. "additionalProperties": false
  13357. },
  13358. "Workspace": {
  13359. "type": "object",
  13360. "properties": {
  13361. "id": {
  13362. "type": "string"
  13363. },
  13364. "type": {
  13365. "type": "string"
  13366. },
  13367. "name": {
  13368. "type": "string"
  13369. },
  13370. "branch": {
  13371. "anyOf": [
  13372. {
  13373. "type": "string"
  13374. },
  13375. {
  13376. "type": "null"
  13377. }
  13378. ]
  13379. },
  13380. "directory": {
  13381. "anyOf": [
  13382. {
  13383. "type": "string"
  13384. },
  13385. {
  13386. "type": "null"
  13387. }
  13388. ]
  13389. },
  13390. "extra": {
  13391. "anyOf": [
  13392. {},
  13393. {
  13394. "type": "null"
  13395. }
  13396. ]
  13397. },
  13398. "projectID": {
  13399. "type": "string"
  13400. }
  13401. },
  13402. "required": ["id", "type", "name", "branch", "directory", "extra", "projectID"],
  13403. "additionalProperties": false
  13404. },
  13405. "SyncEventMessageUpdated": {
  13406. "type": "object",
  13407. "properties": {
  13408. "type": {
  13409. "type": "string",
  13410. "enum": ["sync"]
  13411. },
  13412. "name": {
  13413. "type": "string",
  13414. "enum": ["message.updated.1"]
  13415. },
  13416. "id": {
  13417. "type": "string"
  13418. },
  13419. "seq": {
  13420. "type": "number"
  13421. },
  13422. "aggregateID": {
  13423. "type": "string",
  13424. "enum": ["sessionID"]
  13425. },
  13426. "data": {
  13427. "type": "object",
  13428. "properties": {
  13429. "sessionID": {
  13430. "type": "string"
  13431. },
  13432. "info": {
  13433. "$ref": "#/components/schemas/Message"
  13434. }
  13435. },
  13436. "required": ["sessionID", "info"],
  13437. "additionalProperties": false
  13438. }
  13439. },
  13440. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  13441. "additionalProperties": false
  13442. },
  13443. "SyncEventMessageRemoved": {
  13444. "type": "object",
  13445. "properties": {
  13446. "type": {
  13447. "type": "string",
  13448. "enum": ["sync"]
  13449. },
  13450. "name": {
  13451. "type": "string",
  13452. "enum": ["message.removed.1"]
  13453. },
  13454. "id": {
  13455. "type": "string"
  13456. },
  13457. "seq": {
  13458. "type": "number"
  13459. },
  13460. "aggregateID": {
  13461. "type": "string",
  13462. "enum": ["sessionID"]
  13463. },
  13464. "data": {
  13465. "type": "object",
  13466. "properties": {
  13467. "sessionID": {
  13468. "type": "string"
  13469. },
  13470. "messageID": {
  13471. "type": "string"
  13472. }
  13473. },
  13474. "required": ["sessionID", "messageID"],
  13475. "additionalProperties": false
  13476. }
  13477. },
  13478. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  13479. "additionalProperties": false
  13480. },
  13481. "SyncEventMessagePartUpdated": {
  13482. "type": "object",
  13483. "properties": {
  13484. "type": {
  13485. "type": "string",
  13486. "enum": ["sync"]
  13487. },
  13488. "name": {
  13489. "type": "string",
  13490. "enum": ["message.part.updated.1"]
  13491. },
  13492. "id": {
  13493. "type": "string"
  13494. },
  13495. "seq": {
  13496. "type": "number"
  13497. },
  13498. "aggregateID": {
  13499. "type": "string",
  13500. "enum": ["sessionID"]
  13501. },
  13502. "data": {
  13503. "type": "object",
  13504. "properties": {
  13505. "sessionID": {
  13506. "type": "string"
  13507. },
  13508. "part": {
  13509. "$ref": "#/components/schemas/Part"
  13510. },
  13511. "time": {
  13512. "type": "integer",
  13513. "minimum": 0
  13514. }
  13515. },
  13516. "required": ["sessionID", "part", "time"],
  13517. "additionalProperties": false
  13518. }
  13519. },
  13520. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  13521. "additionalProperties": false
  13522. },
  13523. "SyncEventMessagePartRemoved": {
  13524. "type": "object",
  13525. "properties": {
  13526. "type": {
  13527. "type": "string",
  13528. "enum": ["sync"]
  13529. },
  13530. "name": {
  13531. "type": "string",
  13532. "enum": ["message.part.removed.1"]
  13533. },
  13534. "id": {
  13535. "type": "string"
  13536. },
  13537. "seq": {
  13538. "type": "number"
  13539. },
  13540. "aggregateID": {
  13541. "type": "string",
  13542. "enum": ["sessionID"]
  13543. },
  13544. "data": {
  13545. "type": "object",
  13546. "properties": {
  13547. "sessionID": {
  13548. "type": "string"
  13549. },
  13550. "messageID": {
  13551. "type": "string"
  13552. },
  13553. "partID": {
  13554. "type": "string"
  13555. }
  13556. },
  13557. "required": ["sessionID", "messageID", "partID"],
  13558. "additionalProperties": false
  13559. }
  13560. },
  13561. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  13562. "additionalProperties": false
  13563. },
  13564. "SyncEventSessionCreated": {
  13565. "type": "object",
  13566. "properties": {
  13567. "type": {
  13568. "type": "string",
  13569. "enum": ["sync"]
  13570. },
  13571. "name": {
  13572. "type": "string",
  13573. "enum": ["session.created.1"]
  13574. },
  13575. "id": {
  13576. "type": "string"
  13577. },
  13578. "seq": {
  13579. "type": "number"
  13580. },
  13581. "aggregateID": {
  13582. "type": "string",
  13583. "enum": ["sessionID"]
  13584. },
  13585. "data": {
  13586. "type": "object",
  13587. "properties": {
  13588. "sessionID": {
  13589. "type": "string"
  13590. },
  13591. "info": {
  13592. "$ref": "#/components/schemas/Session"
  13593. }
  13594. },
  13595. "required": ["sessionID", "info"],
  13596. "additionalProperties": false
  13597. }
  13598. },
  13599. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  13600. "additionalProperties": false
  13601. },
  13602. "SyncEventSessionUpdated": {
  13603. "type": "object",
  13604. "properties": {
  13605. "type": {
  13606. "type": "string",
  13607. "enum": ["sync"]
  13608. },
  13609. "name": {
  13610. "type": "string",
  13611. "enum": ["session.updated.1"]
  13612. },
  13613. "id": {
  13614. "type": "string"
  13615. },
  13616. "seq": {
  13617. "type": "number"
  13618. },
  13619. "aggregateID": {
  13620. "type": "string",
  13621. "enum": ["sessionID"]
  13622. },
  13623. "data": {
  13624. "type": "object",
  13625. "properties": {
  13626. "sessionID": {
  13627. "type": "string"
  13628. },
  13629. "info": {
  13630. "type": "object",
  13631. "properties": {
  13632. "id": {
  13633. "anyOf": [
  13634. {
  13635. "type": "string"
  13636. },
  13637. {
  13638. "type": "null"
  13639. }
  13640. ]
  13641. },
  13642. "slug": {
  13643. "anyOf": [
  13644. {
  13645. "type": "string"
  13646. },
  13647. {
  13648. "type": "null"
  13649. }
  13650. ]
  13651. },
  13652. "projectID": {
  13653. "anyOf": [
  13654. {
  13655. "type": "string"
  13656. },
  13657. {
  13658. "type": "null"
  13659. }
  13660. ]
  13661. },
  13662. "workspaceID": {
  13663. "anyOf": [
  13664. {
  13665. "type": "string"
  13666. },
  13667. {
  13668. "type": "null"
  13669. }
  13670. ]
  13671. },
  13672. "directory": {
  13673. "anyOf": [
  13674. {
  13675. "type": "string"
  13676. },
  13677. {
  13678. "type": "null"
  13679. }
  13680. ]
  13681. },
  13682. "path": {
  13683. "anyOf": [
  13684. {
  13685. "type": "string"
  13686. },
  13687. {
  13688. "type": "null"
  13689. }
  13690. ]
  13691. },
  13692. "parentID": {
  13693. "anyOf": [
  13694. {
  13695. "type": "string"
  13696. },
  13697. {
  13698. "type": "null"
  13699. }
  13700. ]
  13701. },
  13702. "summary": {
  13703. "anyOf": [
  13704. {
  13705. "type": "object",
  13706. "properties": {
  13707. "additions": {
  13708. "type": "integer",
  13709. "minimum": 0
  13710. },
  13711. "deletions": {
  13712. "type": "integer",
  13713. "minimum": 0
  13714. },
  13715. "files": {
  13716. "type": "integer",
  13717. "minimum": 0
  13718. },
  13719. "diffs": {
  13720. "type": "array",
  13721. "items": {
  13722. "$ref": "#/components/schemas/SnapshotFileDiff"
  13723. }
  13724. }
  13725. },
  13726. "required": ["additions", "deletions", "files"],
  13727. "additionalProperties": false
  13728. },
  13729. {
  13730. "type": "null"
  13731. }
  13732. ]
  13733. },
  13734. "share": {
  13735. "type": "object",
  13736. "properties": {
  13737. "url": {
  13738. "anyOf": [
  13739. {
  13740. "type": "string"
  13741. },
  13742. {
  13743. "type": "null"
  13744. }
  13745. ]
  13746. }
  13747. },
  13748. "additionalProperties": false
  13749. },
  13750. "title": {
  13751. "anyOf": [
  13752. {
  13753. "type": "string"
  13754. },
  13755. {
  13756. "type": "null"
  13757. }
  13758. ]
  13759. },
  13760. "agent": {
  13761. "anyOf": [
  13762. {
  13763. "type": "string"
  13764. },
  13765. {
  13766. "type": "null"
  13767. }
  13768. ]
  13769. },
  13770. "model": {
  13771. "anyOf": [
  13772. {
  13773. "type": "object",
  13774. "properties": {
  13775. "id": {
  13776. "type": "string"
  13777. },
  13778. "providerID": {
  13779. "type": "string"
  13780. },
  13781. "variant": {
  13782. "type": "string"
  13783. }
  13784. },
  13785. "required": ["id", "providerID"],
  13786. "additionalProperties": false
  13787. },
  13788. {
  13789. "type": "null"
  13790. }
  13791. ]
  13792. },
  13793. "version": {
  13794. "anyOf": [
  13795. {
  13796. "type": "string"
  13797. },
  13798. {
  13799. "type": "null"
  13800. }
  13801. ]
  13802. },
  13803. "time": {
  13804. "type": "object",
  13805. "properties": {
  13806. "created": {
  13807. "anyOf": [
  13808. {
  13809. "type": "integer",
  13810. "minimum": 0
  13811. },
  13812. {
  13813. "type": "null"
  13814. }
  13815. ]
  13816. },
  13817. "updated": {
  13818. "anyOf": [
  13819. {
  13820. "type": "integer",
  13821. "minimum": 0
  13822. },
  13823. {
  13824. "type": "null"
  13825. }
  13826. ]
  13827. },
  13828. "compacting": {
  13829. "anyOf": [
  13830. {
  13831. "type": "integer",
  13832. "minimum": 0
  13833. },
  13834. {
  13835. "type": "null"
  13836. }
  13837. ]
  13838. },
  13839. "archived": {
  13840. "anyOf": [
  13841. {
  13842. "type": "number"
  13843. },
  13844. {
  13845. "type": "null"
  13846. }
  13847. ]
  13848. }
  13849. },
  13850. "additionalProperties": false
  13851. },
  13852. "permission": {
  13853. "anyOf": [
  13854. {
  13855. "$ref": "#/components/schemas/PermissionRuleset"
  13856. },
  13857. {
  13858. "type": "null"
  13859. }
  13860. ]
  13861. },
  13862. "revert": {
  13863. "anyOf": [
  13864. {
  13865. "type": "object",
  13866. "properties": {
  13867. "messageID": {
  13868. "type": "string"
  13869. },
  13870. "partID": {
  13871. "type": "string"
  13872. },
  13873. "snapshot": {
  13874. "type": "string"
  13875. },
  13876. "diff": {
  13877. "type": "string"
  13878. }
  13879. },
  13880. "required": ["messageID"],
  13881. "additionalProperties": false
  13882. },
  13883. {
  13884. "type": "null"
  13885. }
  13886. ]
  13887. }
  13888. },
  13889. "additionalProperties": false
  13890. }
  13891. },
  13892. "required": ["sessionID", "info"],
  13893. "additionalProperties": false
  13894. }
  13895. },
  13896. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  13897. "additionalProperties": false
  13898. },
  13899. "SyncEventSessionDeleted": {
  13900. "type": "object",
  13901. "properties": {
  13902. "type": {
  13903. "type": "string",
  13904. "enum": ["sync"]
  13905. },
  13906. "name": {
  13907. "type": "string",
  13908. "enum": ["session.deleted.1"]
  13909. },
  13910. "id": {
  13911. "type": "string"
  13912. },
  13913. "seq": {
  13914. "type": "number"
  13915. },
  13916. "aggregateID": {
  13917. "type": "string",
  13918. "enum": ["sessionID"]
  13919. },
  13920. "data": {
  13921. "type": "object",
  13922. "properties": {
  13923. "sessionID": {
  13924. "type": "string"
  13925. },
  13926. "info": {
  13927. "$ref": "#/components/schemas/Session"
  13928. }
  13929. },
  13930. "required": ["sessionID", "info"],
  13931. "additionalProperties": false
  13932. }
  13933. },
  13934. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  13935. "additionalProperties": false
  13936. },
  13937. "SyncEventSessionNextAgentSwitched": {
  13938. "type": "object",
  13939. "properties": {
  13940. "type": {
  13941. "type": "string",
  13942. "enum": ["sync"]
  13943. },
  13944. "name": {
  13945. "type": "string",
  13946. "enum": ["session.next.agent.switched.1"]
  13947. },
  13948. "id": {
  13949. "type": "string"
  13950. },
  13951. "seq": {
  13952. "type": "number"
  13953. },
  13954. "aggregateID": {
  13955. "type": "string",
  13956. "enum": ["sessionID"]
  13957. },
  13958. "data": {
  13959. "type": "object",
  13960. "properties": {
  13961. "timestamp": {
  13962. "type": "number"
  13963. },
  13964. "sessionID": {
  13965. "type": "string"
  13966. },
  13967. "agent": {
  13968. "type": "string"
  13969. }
  13970. },
  13971. "required": ["timestamp", "sessionID", "agent"],
  13972. "additionalProperties": false
  13973. }
  13974. },
  13975. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  13976. "additionalProperties": false
  13977. },
  13978. "SyncEventSessionNextModelSwitched": {
  13979. "type": "object",
  13980. "properties": {
  13981. "type": {
  13982. "type": "string",
  13983. "enum": ["sync"]
  13984. },
  13985. "name": {
  13986. "type": "string",
  13987. "enum": ["session.next.model.switched.1"]
  13988. },
  13989. "id": {
  13990. "type": "string"
  13991. },
  13992. "seq": {
  13993. "type": "number"
  13994. },
  13995. "aggregateID": {
  13996. "type": "string",
  13997. "enum": ["sessionID"]
  13998. },
  13999. "data": {
  14000. "type": "object",
  14001. "properties": {
  14002. "timestamp": {
  14003. "type": "number"
  14004. },
  14005. "sessionID": {
  14006. "type": "string"
  14007. },
  14008. "model": {
  14009. "type": "object",
  14010. "properties": {
  14011. "id": {
  14012. "type": "string"
  14013. },
  14014. "providerID": {
  14015. "type": "string"
  14016. },
  14017. "variant": {
  14018. "type": "string"
  14019. }
  14020. },
  14021. "required": ["id", "providerID", "variant"],
  14022. "additionalProperties": false
  14023. }
  14024. },
  14025. "required": ["timestamp", "sessionID", "model"],
  14026. "additionalProperties": false
  14027. }
  14028. },
  14029. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14030. "additionalProperties": false
  14031. },
  14032. "SyncEventSessionNextPrompted": {
  14033. "type": "object",
  14034. "properties": {
  14035. "type": {
  14036. "type": "string",
  14037. "enum": ["sync"]
  14038. },
  14039. "name": {
  14040. "type": "string",
  14041. "enum": ["session.next.prompted.1"]
  14042. },
  14043. "id": {
  14044. "type": "string"
  14045. },
  14046. "seq": {
  14047. "type": "number"
  14048. },
  14049. "aggregateID": {
  14050. "type": "string",
  14051. "enum": ["sessionID"]
  14052. },
  14053. "data": {
  14054. "type": "object",
  14055. "properties": {
  14056. "timestamp": {
  14057. "type": "number"
  14058. },
  14059. "sessionID": {
  14060. "type": "string"
  14061. },
  14062. "prompt": {
  14063. "$ref": "#/components/schemas/Prompt"
  14064. }
  14065. },
  14066. "required": ["timestamp", "sessionID", "prompt"],
  14067. "additionalProperties": false
  14068. }
  14069. },
  14070. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14071. "additionalProperties": false
  14072. },
  14073. "SyncEventSessionNextSynthetic": {
  14074. "type": "object",
  14075. "properties": {
  14076. "type": {
  14077. "type": "string",
  14078. "enum": ["sync"]
  14079. },
  14080. "name": {
  14081. "type": "string",
  14082. "enum": ["session.next.synthetic.1"]
  14083. },
  14084. "id": {
  14085. "type": "string"
  14086. },
  14087. "seq": {
  14088. "type": "number"
  14089. },
  14090. "aggregateID": {
  14091. "type": "string",
  14092. "enum": ["sessionID"]
  14093. },
  14094. "data": {
  14095. "type": "object",
  14096. "properties": {
  14097. "timestamp": {
  14098. "type": "number"
  14099. },
  14100. "sessionID": {
  14101. "type": "string"
  14102. },
  14103. "text": {
  14104. "type": "string"
  14105. }
  14106. },
  14107. "required": ["timestamp", "sessionID", "text"],
  14108. "additionalProperties": false
  14109. }
  14110. },
  14111. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14112. "additionalProperties": false
  14113. },
  14114. "SyncEventSessionNextShellStarted": {
  14115. "type": "object",
  14116. "properties": {
  14117. "type": {
  14118. "type": "string",
  14119. "enum": ["sync"]
  14120. },
  14121. "name": {
  14122. "type": "string",
  14123. "enum": ["session.next.shell.started.1"]
  14124. },
  14125. "id": {
  14126. "type": "string"
  14127. },
  14128. "seq": {
  14129. "type": "number"
  14130. },
  14131. "aggregateID": {
  14132. "type": "string",
  14133. "enum": ["sessionID"]
  14134. },
  14135. "data": {
  14136. "type": "object",
  14137. "properties": {
  14138. "timestamp": {
  14139. "type": "number"
  14140. },
  14141. "sessionID": {
  14142. "type": "string"
  14143. },
  14144. "callID": {
  14145. "type": "string"
  14146. },
  14147. "command": {
  14148. "type": "string"
  14149. }
  14150. },
  14151. "required": ["timestamp", "sessionID", "callID", "command"],
  14152. "additionalProperties": false
  14153. }
  14154. },
  14155. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14156. "additionalProperties": false
  14157. },
  14158. "SyncEventSessionNextShellEnded": {
  14159. "type": "object",
  14160. "properties": {
  14161. "type": {
  14162. "type": "string",
  14163. "enum": ["sync"]
  14164. },
  14165. "name": {
  14166. "type": "string",
  14167. "enum": ["session.next.shell.ended.1"]
  14168. },
  14169. "id": {
  14170. "type": "string"
  14171. },
  14172. "seq": {
  14173. "type": "number"
  14174. },
  14175. "aggregateID": {
  14176. "type": "string",
  14177. "enum": ["sessionID"]
  14178. },
  14179. "data": {
  14180. "type": "object",
  14181. "properties": {
  14182. "timestamp": {
  14183. "type": "number"
  14184. },
  14185. "sessionID": {
  14186. "type": "string"
  14187. },
  14188. "callID": {
  14189. "type": "string"
  14190. },
  14191. "output": {
  14192. "type": "string"
  14193. }
  14194. },
  14195. "required": ["timestamp", "sessionID", "callID", "output"],
  14196. "additionalProperties": false
  14197. }
  14198. },
  14199. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14200. "additionalProperties": false
  14201. },
  14202. "SyncEventSessionNextStepStarted": {
  14203. "type": "object",
  14204. "properties": {
  14205. "type": {
  14206. "type": "string",
  14207. "enum": ["sync"]
  14208. },
  14209. "name": {
  14210. "type": "string",
  14211. "enum": ["session.next.step.started.1"]
  14212. },
  14213. "id": {
  14214. "type": "string"
  14215. },
  14216. "seq": {
  14217. "type": "number"
  14218. },
  14219. "aggregateID": {
  14220. "type": "string",
  14221. "enum": ["sessionID"]
  14222. },
  14223. "data": {
  14224. "type": "object",
  14225. "properties": {
  14226. "timestamp": {
  14227. "type": "number"
  14228. },
  14229. "sessionID": {
  14230. "type": "string"
  14231. },
  14232. "agent": {
  14233. "type": "string"
  14234. },
  14235. "model": {
  14236. "type": "object",
  14237. "properties": {
  14238. "id": {
  14239. "type": "string"
  14240. },
  14241. "providerID": {
  14242. "type": "string"
  14243. },
  14244. "variant": {
  14245. "type": "string"
  14246. }
  14247. },
  14248. "required": ["id", "providerID", "variant"],
  14249. "additionalProperties": false
  14250. },
  14251. "snapshot": {
  14252. "type": "string"
  14253. }
  14254. },
  14255. "required": ["timestamp", "sessionID", "agent", "model"],
  14256. "additionalProperties": false
  14257. }
  14258. },
  14259. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14260. "additionalProperties": false
  14261. },
  14262. "SyncEventSessionNextStepEnded": {
  14263. "type": "object",
  14264. "properties": {
  14265. "type": {
  14266. "type": "string",
  14267. "enum": ["sync"]
  14268. },
  14269. "name": {
  14270. "type": "string",
  14271. "enum": ["session.next.step.ended.1"]
  14272. },
  14273. "id": {
  14274. "type": "string"
  14275. },
  14276. "seq": {
  14277. "type": "number"
  14278. },
  14279. "aggregateID": {
  14280. "type": "string",
  14281. "enum": ["sessionID"]
  14282. },
  14283. "data": {
  14284. "type": "object",
  14285. "properties": {
  14286. "timestamp": {
  14287. "type": "number"
  14288. },
  14289. "sessionID": {
  14290. "type": "string"
  14291. },
  14292. "finish": {
  14293. "type": "string"
  14294. },
  14295. "cost": {
  14296. "type": "number"
  14297. },
  14298. "tokens": {
  14299. "type": "object",
  14300. "properties": {
  14301. "input": {
  14302. "type": "integer",
  14303. "minimum": 0
  14304. },
  14305. "output": {
  14306. "type": "integer",
  14307. "minimum": 0
  14308. },
  14309. "reasoning": {
  14310. "type": "integer",
  14311. "minimum": 0
  14312. },
  14313. "cache": {
  14314. "type": "object",
  14315. "properties": {
  14316. "read": {
  14317. "type": "integer",
  14318. "minimum": 0
  14319. },
  14320. "write": {
  14321. "type": "integer",
  14322. "minimum": 0
  14323. }
  14324. },
  14325. "required": ["read", "write"],
  14326. "additionalProperties": false
  14327. }
  14328. },
  14329. "required": ["input", "output", "reasoning", "cache"],
  14330. "additionalProperties": false
  14331. },
  14332. "snapshot": {
  14333. "type": "string"
  14334. }
  14335. },
  14336. "required": ["timestamp", "sessionID", "finish", "cost", "tokens"],
  14337. "additionalProperties": false
  14338. }
  14339. },
  14340. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14341. "additionalProperties": false
  14342. },
  14343. "SyncEventSessionNextStepFailed": {
  14344. "type": "object",
  14345. "properties": {
  14346. "type": {
  14347. "type": "string",
  14348. "enum": ["sync"]
  14349. },
  14350. "name": {
  14351. "type": "string",
  14352. "enum": ["session.next.step.failed.1"]
  14353. },
  14354. "id": {
  14355. "type": "string"
  14356. },
  14357. "seq": {
  14358. "type": "number"
  14359. },
  14360. "aggregateID": {
  14361. "type": "string",
  14362. "enum": ["sessionID"]
  14363. },
  14364. "data": {
  14365. "type": "object",
  14366. "properties": {
  14367. "timestamp": {
  14368. "type": "number"
  14369. },
  14370. "sessionID": {
  14371. "type": "string"
  14372. },
  14373. "error": {
  14374. "$ref": "#/components/schemas/SessionErrorUnknown"
  14375. }
  14376. },
  14377. "required": ["timestamp", "sessionID", "error"],
  14378. "additionalProperties": false
  14379. }
  14380. },
  14381. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14382. "additionalProperties": false
  14383. },
  14384. "SyncEventSessionNextTextStarted": {
  14385. "type": "object",
  14386. "properties": {
  14387. "type": {
  14388. "type": "string",
  14389. "enum": ["sync"]
  14390. },
  14391. "name": {
  14392. "type": "string",
  14393. "enum": ["session.next.text.started.1"]
  14394. },
  14395. "id": {
  14396. "type": "string"
  14397. },
  14398. "seq": {
  14399. "type": "number"
  14400. },
  14401. "aggregateID": {
  14402. "type": "string",
  14403. "enum": ["sessionID"]
  14404. },
  14405. "data": {
  14406. "type": "object",
  14407. "properties": {
  14408. "timestamp": {
  14409. "type": "number"
  14410. },
  14411. "sessionID": {
  14412. "type": "string"
  14413. }
  14414. },
  14415. "required": ["timestamp", "sessionID"],
  14416. "additionalProperties": false
  14417. }
  14418. },
  14419. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14420. "additionalProperties": false
  14421. },
  14422. "SyncEventSessionNextTextDelta": {
  14423. "type": "object",
  14424. "properties": {
  14425. "type": {
  14426. "type": "string",
  14427. "enum": ["sync"]
  14428. },
  14429. "name": {
  14430. "type": "string",
  14431. "enum": ["session.next.text.delta.1"]
  14432. },
  14433. "id": {
  14434. "type": "string"
  14435. },
  14436. "seq": {
  14437. "type": "number"
  14438. },
  14439. "aggregateID": {
  14440. "type": "string",
  14441. "enum": ["sessionID"]
  14442. },
  14443. "data": {
  14444. "type": "object",
  14445. "properties": {
  14446. "timestamp": {
  14447. "type": "number"
  14448. },
  14449. "sessionID": {
  14450. "type": "string"
  14451. },
  14452. "delta": {
  14453. "type": "string"
  14454. }
  14455. },
  14456. "required": ["timestamp", "sessionID", "delta"],
  14457. "additionalProperties": false
  14458. }
  14459. },
  14460. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14461. "additionalProperties": false
  14462. },
  14463. "SyncEventSessionNextTextEnded": {
  14464. "type": "object",
  14465. "properties": {
  14466. "type": {
  14467. "type": "string",
  14468. "enum": ["sync"]
  14469. },
  14470. "name": {
  14471. "type": "string",
  14472. "enum": ["session.next.text.ended.1"]
  14473. },
  14474. "id": {
  14475. "type": "string"
  14476. },
  14477. "seq": {
  14478. "type": "number"
  14479. },
  14480. "aggregateID": {
  14481. "type": "string",
  14482. "enum": ["sessionID"]
  14483. },
  14484. "data": {
  14485. "type": "object",
  14486. "properties": {
  14487. "timestamp": {
  14488. "type": "number"
  14489. },
  14490. "sessionID": {
  14491. "type": "string"
  14492. },
  14493. "text": {
  14494. "type": "string"
  14495. }
  14496. },
  14497. "required": ["timestamp", "sessionID", "text"],
  14498. "additionalProperties": false
  14499. }
  14500. },
  14501. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14502. "additionalProperties": false
  14503. },
  14504. "SyncEventSessionNextReasoningStarted": {
  14505. "type": "object",
  14506. "properties": {
  14507. "type": {
  14508. "type": "string",
  14509. "enum": ["sync"]
  14510. },
  14511. "name": {
  14512. "type": "string",
  14513. "enum": ["session.next.reasoning.started.1"]
  14514. },
  14515. "id": {
  14516. "type": "string"
  14517. },
  14518. "seq": {
  14519. "type": "number"
  14520. },
  14521. "aggregateID": {
  14522. "type": "string",
  14523. "enum": ["sessionID"]
  14524. },
  14525. "data": {
  14526. "type": "object",
  14527. "properties": {
  14528. "timestamp": {
  14529. "type": "number"
  14530. },
  14531. "sessionID": {
  14532. "type": "string"
  14533. },
  14534. "reasoningID": {
  14535. "type": "string"
  14536. }
  14537. },
  14538. "required": ["timestamp", "sessionID", "reasoningID"],
  14539. "additionalProperties": false
  14540. }
  14541. },
  14542. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14543. "additionalProperties": false
  14544. },
  14545. "SyncEventSessionNextReasoningDelta": {
  14546. "type": "object",
  14547. "properties": {
  14548. "type": {
  14549. "type": "string",
  14550. "enum": ["sync"]
  14551. },
  14552. "name": {
  14553. "type": "string",
  14554. "enum": ["session.next.reasoning.delta.1"]
  14555. },
  14556. "id": {
  14557. "type": "string"
  14558. },
  14559. "seq": {
  14560. "type": "number"
  14561. },
  14562. "aggregateID": {
  14563. "type": "string",
  14564. "enum": ["sessionID"]
  14565. },
  14566. "data": {
  14567. "type": "object",
  14568. "properties": {
  14569. "timestamp": {
  14570. "type": "number"
  14571. },
  14572. "sessionID": {
  14573. "type": "string"
  14574. },
  14575. "reasoningID": {
  14576. "type": "string"
  14577. },
  14578. "delta": {
  14579. "type": "string"
  14580. }
  14581. },
  14582. "required": ["timestamp", "sessionID", "reasoningID", "delta"],
  14583. "additionalProperties": false
  14584. }
  14585. },
  14586. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14587. "additionalProperties": false
  14588. },
  14589. "SyncEventSessionNextReasoningEnded": {
  14590. "type": "object",
  14591. "properties": {
  14592. "type": {
  14593. "type": "string",
  14594. "enum": ["sync"]
  14595. },
  14596. "name": {
  14597. "type": "string",
  14598. "enum": ["session.next.reasoning.ended.1"]
  14599. },
  14600. "id": {
  14601. "type": "string"
  14602. },
  14603. "seq": {
  14604. "type": "number"
  14605. },
  14606. "aggregateID": {
  14607. "type": "string",
  14608. "enum": ["sessionID"]
  14609. },
  14610. "data": {
  14611. "type": "object",
  14612. "properties": {
  14613. "timestamp": {
  14614. "type": "number"
  14615. },
  14616. "sessionID": {
  14617. "type": "string"
  14618. },
  14619. "reasoningID": {
  14620. "type": "string"
  14621. },
  14622. "text": {
  14623. "type": "string"
  14624. }
  14625. },
  14626. "required": ["timestamp", "sessionID", "reasoningID", "text"],
  14627. "additionalProperties": false
  14628. }
  14629. },
  14630. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14631. "additionalProperties": false
  14632. },
  14633. "SyncEventSessionNextToolInputStarted": {
  14634. "type": "object",
  14635. "properties": {
  14636. "type": {
  14637. "type": "string",
  14638. "enum": ["sync"]
  14639. },
  14640. "name": {
  14641. "type": "string",
  14642. "enum": ["session.next.tool.input.started.1"]
  14643. },
  14644. "id": {
  14645. "type": "string"
  14646. },
  14647. "seq": {
  14648. "type": "number"
  14649. },
  14650. "aggregateID": {
  14651. "type": "string",
  14652. "enum": ["sessionID"]
  14653. },
  14654. "data": {
  14655. "type": "object",
  14656. "properties": {
  14657. "timestamp": {
  14658. "type": "number"
  14659. },
  14660. "sessionID": {
  14661. "type": "string"
  14662. },
  14663. "callID": {
  14664. "type": "string"
  14665. },
  14666. "name": {
  14667. "type": "string"
  14668. }
  14669. },
  14670. "required": ["timestamp", "sessionID", "callID", "name"],
  14671. "additionalProperties": false
  14672. }
  14673. },
  14674. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14675. "additionalProperties": false
  14676. },
  14677. "SyncEventSessionNextToolInputDelta": {
  14678. "type": "object",
  14679. "properties": {
  14680. "type": {
  14681. "type": "string",
  14682. "enum": ["sync"]
  14683. },
  14684. "name": {
  14685. "type": "string",
  14686. "enum": ["session.next.tool.input.delta.1"]
  14687. },
  14688. "id": {
  14689. "type": "string"
  14690. },
  14691. "seq": {
  14692. "type": "number"
  14693. },
  14694. "aggregateID": {
  14695. "type": "string",
  14696. "enum": ["sessionID"]
  14697. },
  14698. "data": {
  14699. "type": "object",
  14700. "properties": {
  14701. "timestamp": {
  14702. "type": "number"
  14703. },
  14704. "sessionID": {
  14705. "type": "string"
  14706. },
  14707. "callID": {
  14708. "type": "string"
  14709. },
  14710. "delta": {
  14711. "type": "string"
  14712. }
  14713. },
  14714. "required": ["timestamp", "sessionID", "callID", "delta"],
  14715. "additionalProperties": false
  14716. }
  14717. },
  14718. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14719. "additionalProperties": false
  14720. },
  14721. "SyncEventSessionNextToolInputEnded": {
  14722. "type": "object",
  14723. "properties": {
  14724. "type": {
  14725. "type": "string",
  14726. "enum": ["sync"]
  14727. },
  14728. "name": {
  14729. "type": "string",
  14730. "enum": ["session.next.tool.input.ended.1"]
  14731. },
  14732. "id": {
  14733. "type": "string"
  14734. },
  14735. "seq": {
  14736. "type": "number"
  14737. },
  14738. "aggregateID": {
  14739. "type": "string",
  14740. "enum": ["sessionID"]
  14741. },
  14742. "data": {
  14743. "type": "object",
  14744. "properties": {
  14745. "timestamp": {
  14746. "type": "number"
  14747. },
  14748. "sessionID": {
  14749. "type": "string"
  14750. },
  14751. "callID": {
  14752. "type": "string"
  14753. },
  14754. "text": {
  14755. "type": "string"
  14756. }
  14757. },
  14758. "required": ["timestamp", "sessionID", "callID", "text"],
  14759. "additionalProperties": false
  14760. }
  14761. },
  14762. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14763. "additionalProperties": false
  14764. },
  14765. "SyncEventSessionNextToolCalled": {
  14766. "type": "object",
  14767. "properties": {
  14768. "type": {
  14769. "type": "string",
  14770. "enum": ["sync"]
  14771. },
  14772. "name": {
  14773. "type": "string",
  14774. "enum": ["session.next.tool.called.1"]
  14775. },
  14776. "id": {
  14777. "type": "string"
  14778. },
  14779. "seq": {
  14780. "type": "number"
  14781. },
  14782. "aggregateID": {
  14783. "type": "string",
  14784. "enum": ["sessionID"]
  14785. },
  14786. "data": {
  14787. "type": "object",
  14788. "properties": {
  14789. "timestamp": {
  14790. "type": "number"
  14791. },
  14792. "sessionID": {
  14793. "type": "string"
  14794. },
  14795. "callID": {
  14796. "type": "string"
  14797. },
  14798. "tool": {
  14799. "type": "string"
  14800. },
  14801. "input": {
  14802. "type": "object"
  14803. },
  14804. "provider": {
  14805. "type": "object",
  14806. "properties": {
  14807. "executed": {
  14808. "type": "boolean"
  14809. },
  14810. "metadata": {
  14811. "type": "object"
  14812. }
  14813. },
  14814. "required": ["executed"],
  14815. "additionalProperties": false
  14816. }
  14817. },
  14818. "required": ["timestamp", "sessionID", "callID", "tool", "input", "provider"],
  14819. "additionalProperties": false
  14820. }
  14821. },
  14822. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14823. "additionalProperties": false
  14824. },
  14825. "SyncEventSessionNextToolProgress": {
  14826. "type": "object",
  14827. "properties": {
  14828. "type": {
  14829. "type": "string",
  14830. "enum": ["sync"]
  14831. },
  14832. "name": {
  14833. "type": "string",
  14834. "enum": ["session.next.tool.progress.1"]
  14835. },
  14836. "id": {
  14837. "type": "string"
  14838. },
  14839. "seq": {
  14840. "type": "number"
  14841. },
  14842. "aggregateID": {
  14843. "type": "string",
  14844. "enum": ["sessionID"]
  14845. },
  14846. "data": {
  14847. "type": "object",
  14848. "properties": {
  14849. "timestamp": {
  14850. "type": "number"
  14851. },
  14852. "sessionID": {
  14853. "type": "string"
  14854. },
  14855. "callID": {
  14856. "type": "string"
  14857. },
  14858. "structured": {
  14859. "type": "object"
  14860. },
  14861. "content": {
  14862. "type": "array",
  14863. "items": {
  14864. "anyOf": [
  14865. {
  14866. "$ref": "#/components/schemas/ToolTextContent"
  14867. },
  14868. {
  14869. "$ref": "#/components/schemas/ToolFileContent"
  14870. }
  14871. ]
  14872. }
  14873. }
  14874. },
  14875. "required": ["timestamp", "sessionID", "callID", "structured", "content"],
  14876. "additionalProperties": false
  14877. }
  14878. },
  14879. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14880. "additionalProperties": false
  14881. },
  14882. "SyncEventSessionNextToolSuccess": {
  14883. "type": "object",
  14884. "properties": {
  14885. "type": {
  14886. "type": "string",
  14887. "enum": ["sync"]
  14888. },
  14889. "name": {
  14890. "type": "string",
  14891. "enum": ["session.next.tool.success.1"]
  14892. },
  14893. "id": {
  14894. "type": "string"
  14895. },
  14896. "seq": {
  14897. "type": "number"
  14898. },
  14899. "aggregateID": {
  14900. "type": "string",
  14901. "enum": ["sessionID"]
  14902. },
  14903. "data": {
  14904. "type": "object",
  14905. "properties": {
  14906. "timestamp": {
  14907. "type": "number"
  14908. },
  14909. "sessionID": {
  14910. "type": "string"
  14911. },
  14912. "callID": {
  14913. "type": "string"
  14914. },
  14915. "structured": {
  14916. "type": "object"
  14917. },
  14918. "content": {
  14919. "type": "array",
  14920. "items": {
  14921. "anyOf": [
  14922. {
  14923. "$ref": "#/components/schemas/ToolTextContent"
  14924. },
  14925. {
  14926. "$ref": "#/components/schemas/ToolFileContent"
  14927. }
  14928. ]
  14929. }
  14930. },
  14931. "provider": {
  14932. "type": "object",
  14933. "properties": {
  14934. "executed": {
  14935. "type": "boolean"
  14936. },
  14937. "metadata": {
  14938. "type": "object"
  14939. }
  14940. },
  14941. "required": ["executed"],
  14942. "additionalProperties": false
  14943. }
  14944. },
  14945. "required": ["timestamp", "sessionID", "callID", "structured", "content", "provider"],
  14946. "additionalProperties": false
  14947. }
  14948. },
  14949. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14950. "additionalProperties": false
  14951. },
  14952. "SyncEventSessionNextToolFailed": {
  14953. "type": "object",
  14954. "properties": {
  14955. "type": {
  14956. "type": "string",
  14957. "enum": ["sync"]
  14958. },
  14959. "name": {
  14960. "type": "string",
  14961. "enum": ["session.next.tool.failed.1"]
  14962. },
  14963. "id": {
  14964. "type": "string"
  14965. },
  14966. "seq": {
  14967. "type": "number"
  14968. },
  14969. "aggregateID": {
  14970. "type": "string",
  14971. "enum": ["sessionID"]
  14972. },
  14973. "data": {
  14974. "type": "object",
  14975. "properties": {
  14976. "timestamp": {
  14977. "type": "number"
  14978. },
  14979. "sessionID": {
  14980. "type": "string"
  14981. },
  14982. "callID": {
  14983. "type": "string"
  14984. },
  14985. "error": {
  14986. "$ref": "#/components/schemas/SessionErrorUnknown"
  14987. },
  14988. "provider": {
  14989. "type": "object",
  14990. "properties": {
  14991. "executed": {
  14992. "type": "boolean"
  14993. },
  14994. "metadata": {
  14995. "type": "object"
  14996. }
  14997. },
  14998. "required": ["executed"],
  14999. "additionalProperties": false
  15000. }
  15001. },
  15002. "required": ["timestamp", "sessionID", "callID", "error", "provider"],
  15003. "additionalProperties": false
  15004. }
  15005. },
  15006. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15007. "additionalProperties": false
  15008. },
  15009. "SyncEventSessionNextRetried": {
  15010. "type": "object",
  15011. "properties": {
  15012. "type": {
  15013. "type": "string",
  15014. "enum": ["sync"]
  15015. },
  15016. "name": {
  15017. "type": "string",
  15018. "enum": ["session.next.retried.1"]
  15019. },
  15020. "id": {
  15021. "type": "string"
  15022. },
  15023. "seq": {
  15024. "type": "number"
  15025. },
  15026. "aggregateID": {
  15027. "type": "string",
  15028. "enum": ["sessionID"]
  15029. },
  15030. "data": {
  15031. "type": "object",
  15032. "properties": {
  15033. "timestamp": {
  15034. "type": "number"
  15035. },
  15036. "sessionID": {
  15037. "type": "string"
  15038. },
  15039. "attempt": {
  15040. "type": "integer",
  15041. "minimum": 0
  15042. },
  15043. "error": {
  15044. "$ref": "#/components/schemas/SessionNextRetry_error"
  15045. }
  15046. },
  15047. "required": ["timestamp", "sessionID", "attempt", "error"],
  15048. "additionalProperties": false
  15049. }
  15050. },
  15051. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15052. "additionalProperties": false
  15053. },
  15054. "SyncEventSessionNextCompactionStarted": {
  15055. "type": "object",
  15056. "properties": {
  15057. "type": {
  15058. "type": "string",
  15059. "enum": ["sync"]
  15060. },
  15061. "name": {
  15062. "type": "string",
  15063. "enum": ["session.next.compaction.started.1"]
  15064. },
  15065. "id": {
  15066. "type": "string"
  15067. },
  15068. "seq": {
  15069. "type": "number"
  15070. },
  15071. "aggregateID": {
  15072. "type": "string",
  15073. "enum": ["sessionID"]
  15074. },
  15075. "data": {
  15076. "type": "object",
  15077. "properties": {
  15078. "timestamp": {
  15079. "type": "number"
  15080. },
  15081. "sessionID": {
  15082. "type": "string"
  15083. },
  15084. "reason": {
  15085. "type": "string",
  15086. "enum": ["auto", "manual"]
  15087. }
  15088. },
  15089. "required": ["timestamp", "sessionID", "reason"],
  15090. "additionalProperties": false
  15091. }
  15092. },
  15093. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15094. "additionalProperties": false
  15095. },
  15096. "SyncEventSessionNextCompactionDelta": {
  15097. "type": "object",
  15098. "properties": {
  15099. "type": {
  15100. "type": "string",
  15101. "enum": ["sync"]
  15102. },
  15103. "name": {
  15104. "type": "string",
  15105. "enum": ["session.next.compaction.delta.1"]
  15106. },
  15107. "id": {
  15108. "type": "string"
  15109. },
  15110. "seq": {
  15111. "type": "number"
  15112. },
  15113. "aggregateID": {
  15114. "type": "string",
  15115. "enum": ["sessionID"]
  15116. },
  15117. "data": {
  15118. "type": "object",
  15119. "properties": {
  15120. "timestamp": {
  15121. "type": "number"
  15122. },
  15123. "sessionID": {
  15124. "type": "string"
  15125. },
  15126. "text": {
  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. "SyncEventSessionNextCompactionEnded": {
  15138. "type": "object",
  15139. "properties": {
  15140. "type": {
  15141. "type": "string",
  15142. "enum": ["sync"]
  15143. },
  15144. "name": {
  15145. "type": "string",
  15146. "enum": ["session.next.compaction.ended.1"]
  15147. },
  15148. "id": {
  15149. "type": "string"
  15150. },
  15151. "seq": {
  15152. "type": "number"
  15153. },
  15154. "aggregateID": {
  15155. "type": "string",
  15156. "enum": ["sessionID"]
  15157. },
  15158. "data": {
  15159. "type": "object",
  15160. "properties": {
  15161. "timestamp": {
  15162. "type": "number"
  15163. },
  15164. "sessionID": {
  15165. "type": "string"
  15166. },
  15167. "text": {
  15168. "type": "string"
  15169. },
  15170. "include": {
  15171. "type": "string"
  15172. }
  15173. },
  15174. "required": ["timestamp", "sessionID", "text"],
  15175. "additionalProperties": false
  15176. }
  15177. },
  15178. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15179. "additionalProperties": false
  15180. },
  15181. "EventServerInstanceDisposed": {
  15182. "type": "object",
  15183. "properties": {
  15184. "id": {
  15185. "type": "string"
  15186. },
  15187. "type": {
  15188. "type": "string",
  15189. "enum": ["server.instance.disposed"]
  15190. },
  15191. "properties": {
  15192. "type": "object",
  15193. "properties": {
  15194. "directory": {
  15195. "type": "string"
  15196. }
  15197. },
  15198. "required": ["directory"],
  15199. "additionalProperties": false
  15200. }
  15201. },
  15202. "required": ["id", "type", "properties"],
  15203. "additionalProperties": false
  15204. },
  15205. "EventFileEdited": {
  15206. "type": "object",
  15207. "properties": {
  15208. "id": {
  15209. "type": "string"
  15210. },
  15211. "type": {
  15212. "type": "string",
  15213. "enum": ["file.edited"]
  15214. },
  15215. "properties": {
  15216. "type": "object",
  15217. "properties": {
  15218. "file": {
  15219. "type": "string"
  15220. }
  15221. },
  15222. "required": ["file"],
  15223. "additionalProperties": false
  15224. }
  15225. },
  15226. "required": ["id", "type", "properties"],
  15227. "additionalProperties": false
  15228. },
  15229. "EventFileWatcherUpdated": {
  15230. "type": "object",
  15231. "properties": {
  15232. "id": {
  15233. "type": "string"
  15234. },
  15235. "type": {
  15236. "type": "string",
  15237. "enum": ["file.watcher.updated"]
  15238. },
  15239. "properties": {
  15240. "type": "object",
  15241. "properties": {
  15242. "file": {
  15243. "type": "string"
  15244. },
  15245. "event": {
  15246. "type": "string",
  15247. "enum": ["add", "change", "unlink"]
  15248. }
  15249. },
  15250. "required": ["file", "event"],
  15251. "additionalProperties": false
  15252. }
  15253. },
  15254. "required": ["id", "type", "properties"],
  15255. "additionalProperties": false
  15256. },
  15257. "EventLspClientDiagnostics": {
  15258. "type": "object",
  15259. "properties": {
  15260. "id": {
  15261. "type": "string"
  15262. },
  15263. "type": {
  15264. "type": "string",
  15265. "enum": ["lsp.client.diagnostics"]
  15266. },
  15267. "properties": {
  15268. "type": "object",
  15269. "properties": {
  15270. "serverID": {
  15271. "type": "string"
  15272. },
  15273. "path": {
  15274. "type": "string"
  15275. }
  15276. },
  15277. "required": ["serverID", "path"],
  15278. "additionalProperties": false
  15279. }
  15280. },
  15281. "required": ["id", "type", "properties"],
  15282. "additionalProperties": false
  15283. },
  15284. "EventLspUpdated": {
  15285. "type": "object",
  15286. "properties": {
  15287. "id": {
  15288. "type": "string"
  15289. },
  15290. "type": {
  15291. "type": "string",
  15292. "enum": ["lsp.updated"]
  15293. },
  15294. "properties": {
  15295. "type": "object",
  15296. "properties": {}
  15297. }
  15298. },
  15299. "required": ["id", "type", "properties"],
  15300. "additionalProperties": false
  15301. },
  15302. "EventMessagePartDelta": {
  15303. "type": "object",
  15304. "properties": {
  15305. "id": {
  15306. "type": "string"
  15307. },
  15308. "type": {
  15309. "type": "string",
  15310. "enum": ["message.part.delta"]
  15311. },
  15312. "properties": {
  15313. "type": "object",
  15314. "properties": {
  15315. "sessionID": {
  15316. "type": "string"
  15317. },
  15318. "messageID": {
  15319. "type": "string"
  15320. },
  15321. "partID": {
  15322. "type": "string"
  15323. },
  15324. "field": {
  15325. "type": "string"
  15326. },
  15327. "delta": {
  15328. "type": "string"
  15329. }
  15330. },
  15331. "required": ["sessionID", "messageID", "partID", "field", "delta"],
  15332. "additionalProperties": false
  15333. }
  15334. },
  15335. "required": ["id", "type", "properties"],
  15336. "additionalProperties": false
  15337. },
  15338. "EventPermissionAsked": {
  15339. "type": "object",
  15340. "properties": {
  15341. "id": {
  15342. "type": "string"
  15343. },
  15344. "type": {
  15345. "type": "string",
  15346. "enum": ["permission.asked"]
  15347. },
  15348. "properties": {
  15349. "$ref": "#/components/schemas/PermissionRequest"
  15350. }
  15351. },
  15352. "required": ["id", "type", "properties"],
  15353. "additionalProperties": false
  15354. },
  15355. "EventPermissionReplied": {
  15356. "type": "object",
  15357. "properties": {
  15358. "id": {
  15359. "type": "string"
  15360. },
  15361. "type": {
  15362. "type": "string",
  15363. "enum": ["permission.replied"]
  15364. },
  15365. "properties": {
  15366. "type": "object",
  15367. "properties": {
  15368. "sessionID": {
  15369. "type": "string"
  15370. },
  15371. "requestID": {
  15372. "type": "string"
  15373. },
  15374. "reply": {
  15375. "type": "string",
  15376. "enum": ["once", "always", "reject"]
  15377. }
  15378. },
  15379. "required": ["sessionID", "requestID", "reply"],
  15380. "additionalProperties": false
  15381. }
  15382. },
  15383. "required": ["id", "type", "properties"],
  15384. "additionalProperties": false
  15385. },
  15386. "EventSessionDiff": {
  15387. "type": "object",
  15388. "properties": {
  15389. "id": {
  15390. "type": "string"
  15391. },
  15392. "type": {
  15393. "type": "string",
  15394. "enum": ["session.diff"]
  15395. },
  15396. "properties": {
  15397. "type": "object",
  15398. "properties": {
  15399. "sessionID": {
  15400. "type": "string"
  15401. },
  15402. "diff": {
  15403. "type": "array",
  15404. "items": {
  15405. "$ref": "#/components/schemas/SnapshotFileDiff"
  15406. }
  15407. }
  15408. },
  15409. "required": ["sessionID", "diff"],
  15410. "additionalProperties": false
  15411. }
  15412. },
  15413. "required": ["id", "type", "properties"],
  15414. "additionalProperties": false
  15415. },
  15416. "EventSessionError": {
  15417. "type": "object",
  15418. "properties": {
  15419. "id": {
  15420. "type": "string"
  15421. },
  15422. "type": {
  15423. "type": "string",
  15424. "enum": ["session.error"]
  15425. },
  15426. "properties": {
  15427. "type": "object",
  15428. "properties": {
  15429. "sessionID": {
  15430. "type": "string"
  15431. },
  15432. "error": {
  15433. "anyOf": [
  15434. {
  15435. "$ref": "#/components/schemas/ProviderAuthError"
  15436. },
  15437. {
  15438. "$ref": "#/components/schemas/UnknownError"
  15439. },
  15440. {
  15441. "$ref": "#/components/schemas/MessageOutputLengthError"
  15442. },
  15443. {
  15444. "$ref": "#/components/schemas/MessageAbortedError"
  15445. },
  15446. {
  15447. "$ref": "#/components/schemas/StructuredOutputError"
  15448. },
  15449. {
  15450. "$ref": "#/components/schemas/ContextOverflowError"
  15451. },
  15452. {
  15453. "$ref": "#/components/schemas/APIError"
  15454. }
  15455. ]
  15456. }
  15457. },
  15458. "additionalProperties": false
  15459. }
  15460. },
  15461. "required": ["id", "type", "properties"],
  15462. "additionalProperties": false
  15463. },
  15464. "EventInstallationUpdated": {
  15465. "type": "object",
  15466. "properties": {
  15467. "id": {
  15468. "type": "string"
  15469. },
  15470. "type": {
  15471. "type": "string",
  15472. "enum": ["installation.updated"]
  15473. },
  15474. "properties": {
  15475. "type": "object",
  15476. "properties": {
  15477. "version": {
  15478. "type": "string"
  15479. }
  15480. },
  15481. "required": ["version"],
  15482. "additionalProperties": false
  15483. }
  15484. },
  15485. "required": ["id", "type", "properties"],
  15486. "additionalProperties": false
  15487. },
  15488. "EventInstallationUpdate-available": {
  15489. "type": "object",
  15490. "properties": {
  15491. "id": {
  15492. "type": "string"
  15493. },
  15494. "type": {
  15495. "type": "string",
  15496. "enum": ["installation.update-available"]
  15497. },
  15498. "properties": {
  15499. "type": "object",
  15500. "properties": {
  15501. "version": {
  15502. "type": "string"
  15503. }
  15504. },
  15505. "required": ["version"],
  15506. "additionalProperties": false
  15507. }
  15508. },
  15509. "required": ["id", "type", "properties"],
  15510. "additionalProperties": false
  15511. },
  15512. "EventQuestionAsked": {
  15513. "type": "object",
  15514. "properties": {
  15515. "id": {
  15516. "type": "string"
  15517. },
  15518. "type": {
  15519. "type": "string",
  15520. "enum": ["question.asked"]
  15521. },
  15522. "properties": {
  15523. "$ref": "#/components/schemas/QuestionRequest"
  15524. }
  15525. },
  15526. "required": ["id", "type", "properties"],
  15527. "additionalProperties": false
  15528. },
  15529. "EventQuestionReplied": {
  15530. "type": "object",
  15531. "properties": {
  15532. "id": {
  15533. "type": "string"
  15534. },
  15535. "type": {
  15536. "type": "string",
  15537. "enum": ["question.replied"]
  15538. },
  15539. "properties": {
  15540. "$ref": "#/components/schemas/QuestionReplied"
  15541. }
  15542. },
  15543. "required": ["id", "type", "properties"],
  15544. "additionalProperties": false
  15545. },
  15546. "EventQuestionRejected": {
  15547. "type": "object",
  15548. "properties": {
  15549. "id": {
  15550. "type": "string"
  15551. },
  15552. "type": {
  15553. "type": "string",
  15554. "enum": ["question.rejected"]
  15555. },
  15556. "properties": {
  15557. "$ref": "#/components/schemas/QuestionRejected"
  15558. }
  15559. },
  15560. "required": ["id", "type", "properties"],
  15561. "additionalProperties": false
  15562. },
  15563. "EventTodoUpdated": {
  15564. "type": "object",
  15565. "properties": {
  15566. "id": {
  15567. "type": "string"
  15568. },
  15569. "type": {
  15570. "type": "string",
  15571. "enum": ["todo.updated"]
  15572. },
  15573. "properties": {
  15574. "type": "object",
  15575. "properties": {
  15576. "sessionID": {
  15577. "type": "string"
  15578. },
  15579. "todos": {
  15580. "type": "array",
  15581. "items": {
  15582. "$ref": "#/components/schemas/Todo"
  15583. }
  15584. }
  15585. },
  15586. "required": ["sessionID", "todos"],
  15587. "additionalProperties": false
  15588. }
  15589. },
  15590. "required": ["id", "type", "properties"],
  15591. "additionalProperties": false
  15592. },
  15593. "EventSessionStatus": {
  15594. "type": "object",
  15595. "properties": {
  15596. "id": {
  15597. "type": "string"
  15598. },
  15599. "type": {
  15600. "type": "string",
  15601. "enum": ["session.status"]
  15602. },
  15603. "properties": {
  15604. "type": "object",
  15605. "properties": {
  15606. "sessionID": {
  15607. "type": "string"
  15608. },
  15609. "status": {
  15610. "$ref": "#/components/schemas/SessionStatus"
  15611. }
  15612. },
  15613. "required": ["sessionID", "status"],
  15614. "additionalProperties": false
  15615. }
  15616. },
  15617. "required": ["id", "type", "properties"],
  15618. "additionalProperties": false
  15619. },
  15620. "EventSessionIdle": {
  15621. "type": "object",
  15622. "properties": {
  15623. "id": {
  15624. "type": "string"
  15625. },
  15626. "type": {
  15627. "type": "string",
  15628. "enum": ["session.idle"]
  15629. },
  15630. "properties": {
  15631. "type": "object",
  15632. "properties": {
  15633. "sessionID": {
  15634. "type": "string"
  15635. }
  15636. },
  15637. "required": ["sessionID"],
  15638. "additionalProperties": false
  15639. }
  15640. },
  15641. "required": ["id", "type", "properties"],
  15642. "additionalProperties": false
  15643. },
  15644. "EventSessionCompacted": {
  15645. "type": "object",
  15646. "properties": {
  15647. "id": {
  15648. "type": "string"
  15649. },
  15650. "type": {
  15651. "type": "string",
  15652. "enum": ["session.compacted"]
  15653. },
  15654. "properties": {
  15655. "type": "object",
  15656. "properties": {
  15657. "sessionID": {
  15658. "type": "string"
  15659. }
  15660. },
  15661. "required": ["sessionID"],
  15662. "additionalProperties": false
  15663. }
  15664. },
  15665. "required": ["id", "type", "properties"],
  15666. "additionalProperties": false
  15667. },
  15668. "EventMcpToolsChanged": {
  15669. "type": "object",
  15670. "properties": {
  15671. "id": {
  15672. "type": "string"
  15673. },
  15674. "type": {
  15675. "type": "string",
  15676. "enum": ["mcp.tools.changed"]
  15677. },
  15678. "properties": {
  15679. "type": "object",
  15680. "properties": {
  15681. "server": {
  15682. "type": "string"
  15683. }
  15684. },
  15685. "required": ["server"],
  15686. "additionalProperties": false
  15687. }
  15688. },
  15689. "required": ["id", "type", "properties"],
  15690. "additionalProperties": false
  15691. },
  15692. "EventMcpBrowserOpenFailed": {
  15693. "type": "object",
  15694. "properties": {
  15695. "id": {
  15696. "type": "string"
  15697. },
  15698. "type": {
  15699. "type": "string",
  15700. "enum": ["mcp.browser.open.failed"]
  15701. },
  15702. "properties": {
  15703. "type": "object",
  15704. "properties": {
  15705. "mcpName": {
  15706. "type": "string"
  15707. },
  15708. "url": {
  15709. "type": "string"
  15710. }
  15711. },
  15712. "required": ["mcpName", "url"],
  15713. "additionalProperties": false
  15714. }
  15715. },
  15716. "required": ["id", "type", "properties"],
  15717. "additionalProperties": false
  15718. },
  15719. "EventCommandExecuted": {
  15720. "type": "object",
  15721. "properties": {
  15722. "id": {
  15723. "type": "string"
  15724. },
  15725. "type": {
  15726. "type": "string",
  15727. "enum": ["command.executed"]
  15728. },
  15729. "properties": {
  15730. "type": "object",
  15731. "properties": {
  15732. "name": {
  15733. "type": "string"
  15734. },
  15735. "sessionID": {
  15736. "type": "string"
  15737. },
  15738. "arguments": {
  15739. "type": "string"
  15740. },
  15741. "messageID": {
  15742. "type": "string"
  15743. }
  15744. },
  15745. "required": ["name", "sessionID", "arguments", "messageID"],
  15746. "additionalProperties": false
  15747. }
  15748. },
  15749. "required": ["id", "type", "properties"],
  15750. "additionalProperties": false
  15751. },
  15752. "EventProjectUpdated": {
  15753. "type": "object",
  15754. "properties": {
  15755. "id": {
  15756. "type": "string"
  15757. },
  15758. "type": {
  15759. "type": "string",
  15760. "enum": ["project.updated"]
  15761. },
  15762. "properties": {
  15763. "$ref": "#/components/schemas/Project"
  15764. }
  15765. },
  15766. "required": ["id", "type", "properties"],
  15767. "additionalProperties": false
  15768. },
  15769. "EventVcsBranchUpdated": {
  15770. "type": "object",
  15771. "properties": {
  15772. "id": {
  15773. "type": "string"
  15774. },
  15775. "type": {
  15776. "type": "string",
  15777. "enum": ["vcs.branch.updated"]
  15778. },
  15779. "properties": {
  15780. "type": "object",
  15781. "properties": {
  15782. "branch": {
  15783. "type": "string"
  15784. }
  15785. },
  15786. "additionalProperties": false
  15787. }
  15788. },
  15789. "required": ["id", "type", "properties"],
  15790. "additionalProperties": false
  15791. },
  15792. "EventWorkspaceReady": {
  15793. "type": "object",
  15794. "properties": {
  15795. "id": {
  15796. "type": "string"
  15797. },
  15798. "type": {
  15799. "type": "string",
  15800. "enum": ["workspace.ready"]
  15801. },
  15802. "properties": {
  15803. "type": "object",
  15804. "properties": {
  15805. "name": {
  15806. "type": "string"
  15807. }
  15808. },
  15809. "required": ["name"],
  15810. "additionalProperties": false
  15811. }
  15812. },
  15813. "required": ["id", "type", "properties"],
  15814. "additionalProperties": false
  15815. },
  15816. "EventWorkspaceFailed": {
  15817. "type": "object",
  15818. "properties": {
  15819. "id": {
  15820. "type": "string"
  15821. },
  15822. "type": {
  15823. "type": "string",
  15824. "enum": ["workspace.failed"]
  15825. },
  15826. "properties": {
  15827. "type": "object",
  15828. "properties": {
  15829. "message": {
  15830. "type": "string"
  15831. }
  15832. },
  15833. "required": ["message"],
  15834. "additionalProperties": false
  15835. }
  15836. },
  15837. "required": ["id", "type", "properties"],
  15838. "additionalProperties": false
  15839. },
  15840. "EventWorkspaceStatus": {
  15841. "type": "object",
  15842. "properties": {
  15843. "id": {
  15844. "type": "string"
  15845. },
  15846. "type": {
  15847. "type": "string",
  15848. "enum": ["workspace.status"]
  15849. },
  15850. "properties": {
  15851. "type": "object",
  15852. "properties": {
  15853. "workspaceID": {
  15854. "type": "string"
  15855. },
  15856. "status": {
  15857. "type": "string",
  15858. "enum": ["connected", "connecting", "disconnected", "error"]
  15859. }
  15860. },
  15861. "required": ["workspaceID", "status"],
  15862. "additionalProperties": false
  15863. }
  15864. },
  15865. "required": ["id", "type", "properties"],
  15866. "additionalProperties": false
  15867. },
  15868. "EventWorktreeReady": {
  15869. "type": "object",
  15870. "properties": {
  15871. "id": {
  15872. "type": "string"
  15873. },
  15874. "type": {
  15875. "type": "string",
  15876. "enum": ["worktree.ready"]
  15877. },
  15878. "properties": {
  15879. "type": "object",
  15880. "properties": {
  15881. "name": {
  15882. "type": "string"
  15883. },
  15884. "branch": {
  15885. "type": "string"
  15886. }
  15887. },
  15888. "required": ["name", "branch"],
  15889. "additionalProperties": false
  15890. }
  15891. },
  15892. "required": ["id", "type", "properties"],
  15893. "additionalProperties": false
  15894. },
  15895. "EventWorktreeFailed": {
  15896. "type": "object",
  15897. "properties": {
  15898. "id": {
  15899. "type": "string"
  15900. },
  15901. "type": {
  15902. "type": "string",
  15903. "enum": ["worktree.failed"]
  15904. },
  15905. "properties": {
  15906. "type": "object",
  15907. "properties": {
  15908. "message": {
  15909. "type": "string"
  15910. }
  15911. },
  15912. "required": ["message"],
  15913. "additionalProperties": false
  15914. }
  15915. },
  15916. "required": ["id", "type", "properties"],
  15917. "additionalProperties": false
  15918. },
  15919. "EventPtyCreated": {
  15920. "type": "object",
  15921. "properties": {
  15922. "id": {
  15923. "type": "string"
  15924. },
  15925. "type": {
  15926. "type": "string",
  15927. "enum": ["pty.created"]
  15928. },
  15929. "properties": {
  15930. "type": "object",
  15931. "properties": {
  15932. "info": {
  15933. "$ref": "#/components/schemas/Pty"
  15934. }
  15935. },
  15936. "required": ["info"],
  15937. "additionalProperties": false
  15938. }
  15939. },
  15940. "required": ["id", "type", "properties"],
  15941. "additionalProperties": false
  15942. },
  15943. "EventPtyUpdated": {
  15944. "type": "object",
  15945. "properties": {
  15946. "id": {
  15947. "type": "string"
  15948. },
  15949. "type": {
  15950. "type": "string",
  15951. "enum": ["pty.updated"]
  15952. },
  15953. "properties": {
  15954. "type": "object",
  15955. "properties": {
  15956. "info": {
  15957. "$ref": "#/components/schemas/Pty"
  15958. }
  15959. },
  15960. "required": ["info"],
  15961. "additionalProperties": false
  15962. }
  15963. },
  15964. "required": ["id", "type", "properties"],
  15965. "additionalProperties": false
  15966. },
  15967. "EventPtyExited": {
  15968. "type": "object",
  15969. "properties": {
  15970. "id": {
  15971. "type": "string"
  15972. },
  15973. "type": {
  15974. "type": "string",
  15975. "enum": ["pty.exited"]
  15976. },
  15977. "properties": {
  15978. "type": "object",
  15979. "properties": {
  15980. "id": {
  15981. "type": "string"
  15982. },
  15983. "exitCode": {
  15984. "type": "integer",
  15985. "minimum": 0
  15986. }
  15987. },
  15988. "required": ["id", "exitCode"],
  15989. "additionalProperties": false
  15990. }
  15991. },
  15992. "required": ["id", "type", "properties"],
  15993. "additionalProperties": false
  15994. },
  15995. "EventPtyDeleted": {
  15996. "type": "object",
  15997. "properties": {
  15998. "id": {
  15999. "type": "string"
  16000. },
  16001. "type": {
  16002. "type": "string",
  16003. "enum": ["pty.deleted"]
  16004. },
  16005. "properties": {
  16006. "type": "object",
  16007. "properties": {
  16008. "id": {
  16009. "type": "string"
  16010. }
  16011. },
  16012. "required": ["id"],
  16013. "additionalProperties": false
  16014. }
  16015. },
  16016. "required": ["id", "type", "properties"],
  16017. "additionalProperties": false
  16018. },
  16019. "EventMessageUpdated": {
  16020. "type": "object",
  16021. "properties": {
  16022. "id": {
  16023. "type": "string"
  16024. },
  16025. "type": {
  16026. "type": "string",
  16027. "enum": ["message.updated"]
  16028. },
  16029. "properties": {
  16030. "type": "object",
  16031. "properties": {
  16032. "sessionID": {
  16033. "type": "string"
  16034. },
  16035. "info": {
  16036. "$ref": "#/components/schemas/Message"
  16037. }
  16038. },
  16039. "required": ["sessionID", "info"],
  16040. "additionalProperties": false
  16041. }
  16042. },
  16043. "required": ["id", "type", "properties"],
  16044. "additionalProperties": false
  16045. },
  16046. "EventMessageRemoved": {
  16047. "type": "object",
  16048. "properties": {
  16049. "id": {
  16050. "type": "string"
  16051. },
  16052. "type": {
  16053. "type": "string",
  16054. "enum": ["message.removed"]
  16055. },
  16056. "properties": {
  16057. "type": "object",
  16058. "properties": {
  16059. "sessionID": {
  16060. "type": "string"
  16061. },
  16062. "messageID": {
  16063. "type": "string"
  16064. }
  16065. },
  16066. "required": ["sessionID", "messageID"],
  16067. "additionalProperties": false
  16068. }
  16069. },
  16070. "required": ["id", "type", "properties"],
  16071. "additionalProperties": false
  16072. },
  16073. "EventMessagePartUpdated": {
  16074. "type": "object",
  16075. "properties": {
  16076. "id": {
  16077. "type": "string"
  16078. },
  16079. "type": {
  16080. "type": "string",
  16081. "enum": ["message.part.updated"]
  16082. },
  16083. "properties": {
  16084. "type": "object",
  16085. "properties": {
  16086. "sessionID": {
  16087. "type": "string"
  16088. },
  16089. "part": {
  16090. "$ref": "#/components/schemas/Part"
  16091. },
  16092. "time": {
  16093. "type": "integer",
  16094. "minimum": 0
  16095. }
  16096. },
  16097. "required": ["sessionID", "part", "time"],
  16098. "additionalProperties": false
  16099. }
  16100. },
  16101. "required": ["id", "type", "properties"],
  16102. "additionalProperties": false
  16103. },
  16104. "EventMessagePartRemoved": {
  16105. "type": "object",
  16106. "properties": {
  16107. "id": {
  16108. "type": "string"
  16109. },
  16110. "type": {
  16111. "type": "string",
  16112. "enum": ["message.part.removed"]
  16113. },
  16114. "properties": {
  16115. "type": "object",
  16116. "properties": {
  16117. "sessionID": {
  16118. "type": "string"
  16119. },
  16120. "messageID": {
  16121. "type": "string"
  16122. },
  16123. "partID": {
  16124. "type": "string"
  16125. }
  16126. },
  16127. "required": ["sessionID", "messageID", "partID"],
  16128. "additionalProperties": false
  16129. }
  16130. },
  16131. "required": ["id", "type", "properties"],
  16132. "additionalProperties": false
  16133. },
  16134. "EventSessionCreated": {
  16135. "type": "object",
  16136. "properties": {
  16137. "id": {
  16138. "type": "string"
  16139. },
  16140. "type": {
  16141. "type": "string",
  16142. "enum": ["session.created"]
  16143. },
  16144. "properties": {
  16145. "type": "object",
  16146. "properties": {
  16147. "sessionID": {
  16148. "type": "string"
  16149. },
  16150. "info": {
  16151. "$ref": "#/components/schemas/Session"
  16152. }
  16153. },
  16154. "required": ["sessionID", "info"],
  16155. "additionalProperties": false
  16156. }
  16157. },
  16158. "required": ["id", "type", "properties"],
  16159. "additionalProperties": false
  16160. },
  16161. "EventSessionUpdated": {
  16162. "type": "object",
  16163. "properties": {
  16164. "id": {
  16165. "type": "string"
  16166. },
  16167. "type": {
  16168. "type": "string",
  16169. "enum": ["session.updated"]
  16170. },
  16171. "properties": {
  16172. "type": "object",
  16173. "properties": {
  16174. "sessionID": {
  16175. "type": "string"
  16176. },
  16177. "info": {
  16178. "$ref": "#/components/schemas/Session"
  16179. }
  16180. },
  16181. "required": ["sessionID", "info"],
  16182. "additionalProperties": false
  16183. }
  16184. },
  16185. "required": ["id", "type", "properties"],
  16186. "additionalProperties": false
  16187. },
  16188. "EventSessionDeleted": {
  16189. "type": "object",
  16190. "properties": {
  16191. "id": {
  16192. "type": "string"
  16193. },
  16194. "type": {
  16195. "type": "string",
  16196. "enum": ["session.deleted"]
  16197. },
  16198. "properties": {
  16199. "type": "object",
  16200. "properties": {
  16201. "sessionID": {
  16202. "type": "string"
  16203. },
  16204. "info": {
  16205. "$ref": "#/components/schemas/Session"
  16206. }
  16207. },
  16208. "required": ["sessionID", "info"],
  16209. "additionalProperties": false
  16210. }
  16211. },
  16212. "required": ["id", "type", "properties"],
  16213. "additionalProperties": false
  16214. },
  16215. "EventSessionNextAgentSwitched": {
  16216. "type": "object",
  16217. "properties": {
  16218. "id": {
  16219. "type": "string"
  16220. },
  16221. "type": {
  16222. "type": "string",
  16223. "enum": ["session.next.agent.switched"]
  16224. },
  16225. "properties": {
  16226. "type": "object",
  16227. "properties": {
  16228. "timestamp": {
  16229. "type": "number"
  16230. },
  16231. "sessionID": {
  16232. "type": "string"
  16233. },
  16234. "agent": {
  16235. "type": "string"
  16236. }
  16237. },
  16238. "required": ["timestamp", "sessionID", "agent"],
  16239. "additionalProperties": false
  16240. }
  16241. },
  16242. "required": ["id", "type", "properties"],
  16243. "additionalProperties": false
  16244. },
  16245. "EventSessionNextModelSwitched": {
  16246. "type": "object",
  16247. "properties": {
  16248. "id": {
  16249. "type": "string"
  16250. },
  16251. "type": {
  16252. "type": "string",
  16253. "enum": ["session.next.model.switched"]
  16254. },
  16255. "properties": {
  16256. "type": "object",
  16257. "properties": {
  16258. "timestamp": {
  16259. "type": "number"
  16260. },
  16261. "sessionID": {
  16262. "type": "string"
  16263. },
  16264. "model": {
  16265. "type": "object",
  16266. "properties": {
  16267. "id": {
  16268. "type": "string"
  16269. },
  16270. "providerID": {
  16271. "type": "string"
  16272. },
  16273. "variant": {
  16274. "type": "string"
  16275. }
  16276. },
  16277. "required": ["id", "providerID", "variant"],
  16278. "additionalProperties": false
  16279. }
  16280. },
  16281. "required": ["timestamp", "sessionID", "model"],
  16282. "additionalProperties": false
  16283. }
  16284. },
  16285. "required": ["id", "type", "properties"],
  16286. "additionalProperties": false
  16287. },
  16288. "PromptSource": {
  16289. "type": "object",
  16290. "properties": {
  16291. "start": {
  16292. "type": "number"
  16293. },
  16294. "end": {
  16295. "type": "number"
  16296. },
  16297. "text": {
  16298. "type": "string"
  16299. }
  16300. },
  16301. "required": ["start", "end", "text"],
  16302. "additionalProperties": false
  16303. },
  16304. "PromptFileAttachment": {
  16305. "type": "object",
  16306. "properties": {
  16307. "uri": {
  16308. "type": "string"
  16309. },
  16310. "mime": {
  16311. "type": "string"
  16312. },
  16313. "name": {
  16314. "type": "string"
  16315. },
  16316. "description": {
  16317. "type": "string"
  16318. },
  16319. "source": {
  16320. "$ref": "#/components/schemas/PromptSource"
  16321. }
  16322. },
  16323. "required": ["uri", "mime"],
  16324. "additionalProperties": false
  16325. },
  16326. "PromptAgentAttachment": {
  16327. "type": "object",
  16328. "properties": {
  16329. "name": {
  16330. "type": "string"
  16331. },
  16332. "source": {
  16333. "$ref": "#/components/schemas/PromptSource"
  16334. }
  16335. },
  16336. "required": ["name"],
  16337. "additionalProperties": false
  16338. },
  16339. "EventSessionNextPrompted": {
  16340. "type": "object",
  16341. "properties": {
  16342. "id": {
  16343. "type": "string"
  16344. },
  16345. "type": {
  16346. "type": "string",
  16347. "enum": ["session.next.prompted"]
  16348. },
  16349. "properties": {
  16350. "type": "object",
  16351. "properties": {
  16352. "timestamp": {
  16353. "type": "number"
  16354. },
  16355. "sessionID": {
  16356. "type": "string"
  16357. },
  16358. "prompt": {
  16359. "$ref": "#/components/schemas/Prompt"
  16360. }
  16361. },
  16362. "required": ["timestamp", "sessionID", "prompt"],
  16363. "additionalProperties": false
  16364. }
  16365. },
  16366. "required": ["id", "type", "properties"],
  16367. "additionalProperties": false
  16368. },
  16369. "EventSessionNextSynthetic": {
  16370. "type": "object",
  16371. "properties": {
  16372. "id": {
  16373. "type": "string"
  16374. },
  16375. "type": {
  16376. "type": "string",
  16377. "enum": ["session.next.synthetic"]
  16378. },
  16379. "properties": {
  16380. "type": "object",
  16381. "properties": {
  16382. "timestamp": {
  16383. "type": "number"
  16384. },
  16385. "sessionID": {
  16386. "type": "string"
  16387. },
  16388. "text": {
  16389. "type": "string"
  16390. }
  16391. },
  16392. "required": ["timestamp", "sessionID", "text"],
  16393. "additionalProperties": false
  16394. }
  16395. },
  16396. "required": ["id", "type", "properties"],
  16397. "additionalProperties": false
  16398. },
  16399. "EventSessionNextShellStarted": {
  16400. "type": "object",
  16401. "properties": {
  16402. "id": {
  16403. "type": "string"
  16404. },
  16405. "type": {
  16406. "type": "string",
  16407. "enum": ["session.next.shell.started"]
  16408. },
  16409. "properties": {
  16410. "type": "object",
  16411. "properties": {
  16412. "timestamp": {
  16413. "type": "number"
  16414. },
  16415. "sessionID": {
  16416. "type": "string"
  16417. },
  16418. "callID": {
  16419. "type": "string"
  16420. },
  16421. "command": {
  16422. "type": "string"
  16423. }
  16424. },
  16425. "required": ["timestamp", "sessionID", "callID", "command"],
  16426. "additionalProperties": false
  16427. }
  16428. },
  16429. "required": ["id", "type", "properties"],
  16430. "additionalProperties": false
  16431. },
  16432. "EventSessionNextShellEnded": {
  16433. "type": "object",
  16434. "properties": {
  16435. "id": {
  16436. "type": "string"
  16437. },
  16438. "type": {
  16439. "type": "string",
  16440. "enum": ["session.next.shell.ended"]
  16441. },
  16442. "properties": {
  16443. "type": "object",
  16444. "properties": {
  16445. "timestamp": {
  16446. "type": "number"
  16447. },
  16448. "sessionID": {
  16449. "type": "string"
  16450. },
  16451. "callID": {
  16452. "type": "string"
  16453. },
  16454. "output": {
  16455. "type": "string"
  16456. }
  16457. },
  16458. "required": ["timestamp", "sessionID", "callID", "output"],
  16459. "additionalProperties": false
  16460. }
  16461. },
  16462. "required": ["id", "type", "properties"],
  16463. "additionalProperties": false
  16464. },
  16465. "EventSessionNextStepStarted": {
  16466. "type": "object",
  16467. "properties": {
  16468. "id": {
  16469. "type": "string"
  16470. },
  16471. "type": {
  16472. "type": "string",
  16473. "enum": ["session.next.step.started"]
  16474. },
  16475. "properties": {
  16476. "type": "object",
  16477. "properties": {
  16478. "timestamp": {
  16479. "type": "number"
  16480. },
  16481. "sessionID": {
  16482. "type": "string"
  16483. },
  16484. "agent": {
  16485. "type": "string"
  16486. },
  16487. "model": {
  16488. "type": "object",
  16489. "properties": {
  16490. "id": {
  16491. "type": "string"
  16492. },
  16493. "providerID": {
  16494. "type": "string"
  16495. },
  16496. "variant": {
  16497. "type": "string"
  16498. }
  16499. },
  16500. "required": ["id", "providerID", "variant"],
  16501. "additionalProperties": false
  16502. },
  16503. "snapshot": {
  16504. "type": "string"
  16505. }
  16506. },
  16507. "required": ["timestamp", "sessionID", "agent", "model"],
  16508. "additionalProperties": false
  16509. }
  16510. },
  16511. "required": ["id", "type", "properties"],
  16512. "additionalProperties": false
  16513. },
  16514. "EventSessionNextStepEnded": {
  16515. "type": "object",
  16516. "properties": {
  16517. "id": {
  16518. "type": "string"
  16519. },
  16520. "type": {
  16521. "type": "string",
  16522. "enum": ["session.next.step.ended"]
  16523. },
  16524. "properties": {
  16525. "type": "object",
  16526. "properties": {
  16527. "timestamp": {
  16528. "type": "number"
  16529. },
  16530. "sessionID": {
  16531. "type": "string"
  16532. },
  16533. "finish": {
  16534. "type": "string"
  16535. },
  16536. "cost": {
  16537. "type": "number"
  16538. },
  16539. "tokens": {
  16540. "type": "object",
  16541. "properties": {
  16542. "input": {
  16543. "type": "integer",
  16544. "minimum": 0
  16545. },
  16546. "output": {
  16547. "type": "integer",
  16548. "minimum": 0
  16549. },
  16550. "reasoning": {
  16551. "type": "integer",
  16552. "minimum": 0
  16553. },
  16554. "cache": {
  16555. "type": "object",
  16556. "properties": {
  16557. "read": {
  16558. "type": "integer",
  16559. "minimum": 0
  16560. },
  16561. "write": {
  16562. "type": "integer",
  16563. "minimum": 0
  16564. }
  16565. },
  16566. "required": ["read", "write"],
  16567. "additionalProperties": false
  16568. }
  16569. },
  16570. "required": ["input", "output", "reasoning", "cache"],
  16571. "additionalProperties": false
  16572. },
  16573. "snapshot": {
  16574. "type": "string"
  16575. }
  16576. },
  16577. "required": ["timestamp", "sessionID", "finish", "cost", "tokens"],
  16578. "additionalProperties": false
  16579. }
  16580. },
  16581. "required": ["id", "type", "properties"],
  16582. "additionalProperties": false
  16583. },
  16584. "SessionErrorUnknown": {
  16585. "type": "object",
  16586. "properties": {
  16587. "type": {
  16588. "type": "string",
  16589. "enum": ["unknown"]
  16590. },
  16591. "message": {
  16592. "type": "string"
  16593. }
  16594. },
  16595. "required": ["type", "message"],
  16596. "additionalProperties": false
  16597. },
  16598. "EventSessionNextStepFailed": {
  16599. "type": "object",
  16600. "properties": {
  16601. "id": {
  16602. "type": "string"
  16603. },
  16604. "type": {
  16605. "type": "string",
  16606. "enum": ["session.next.step.failed"]
  16607. },
  16608. "properties": {
  16609. "type": "object",
  16610. "properties": {
  16611. "timestamp": {
  16612. "type": "number"
  16613. },
  16614. "sessionID": {
  16615. "type": "string"
  16616. },
  16617. "error": {
  16618. "$ref": "#/components/schemas/SessionErrorUnknown"
  16619. }
  16620. },
  16621. "required": ["timestamp", "sessionID", "error"],
  16622. "additionalProperties": false
  16623. }
  16624. },
  16625. "required": ["id", "type", "properties"],
  16626. "additionalProperties": false
  16627. },
  16628. "EventSessionNextTextStarted": {
  16629. "type": "object",
  16630. "properties": {
  16631. "id": {
  16632. "type": "string"
  16633. },
  16634. "type": {
  16635. "type": "string",
  16636. "enum": ["session.next.text.started"]
  16637. },
  16638. "properties": {
  16639. "type": "object",
  16640. "properties": {
  16641. "timestamp": {
  16642. "type": "number"
  16643. },
  16644. "sessionID": {
  16645. "type": "string"
  16646. }
  16647. },
  16648. "required": ["timestamp", "sessionID"],
  16649. "additionalProperties": false
  16650. }
  16651. },
  16652. "required": ["id", "type", "properties"],
  16653. "additionalProperties": false
  16654. },
  16655. "EventSessionNextTextDelta": {
  16656. "type": "object",
  16657. "properties": {
  16658. "id": {
  16659. "type": "string"
  16660. },
  16661. "type": {
  16662. "type": "string",
  16663. "enum": ["session.next.text.delta"]
  16664. },
  16665. "properties": {
  16666. "type": "object",
  16667. "properties": {
  16668. "timestamp": {
  16669. "type": "number"
  16670. },
  16671. "sessionID": {
  16672. "type": "string"
  16673. },
  16674. "delta": {
  16675. "type": "string"
  16676. }
  16677. },
  16678. "required": ["timestamp", "sessionID", "delta"],
  16679. "additionalProperties": false
  16680. }
  16681. },
  16682. "required": ["id", "type", "properties"],
  16683. "additionalProperties": false
  16684. },
  16685. "EventSessionNextTextEnded": {
  16686. "type": "object",
  16687. "properties": {
  16688. "id": {
  16689. "type": "string"
  16690. },
  16691. "type": {
  16692. "type": "string",
  16693. "enum": ["session.next.text.ended"]
  16694. },
  16695. "properties": {
  16696. "type": "object",
  16697. "properties": {
  16698. "timestamp": {
  16699. "type": "number"
  16700. },
  16701. "sessionID": {
  16702. "type": "string"
  16703. },
  16704. "text": {
  16705. "type": "string"
  16706. }
  16707. },
  16708. "required": ["timestamp", "sessionID", "text"],
  16709. "additionalProperties": false
  16710. }
  16711. },
  16712. "required": ["id", "type", "properties"],
  16713. "additionalProperties": false
  16714. },
  16715. "EventSessionNextReasoningStarted": {
  16716. "type": "object",
  16717. "properties": {
  16718. "id": {
  16719. "type": "string"
  16720. },
  16721. "type": {
  16722. "type": "string",
  16723. "enum": ["session.next.reasoning.started"]
  16724. },
  16725. "properties": {
  16726. "type": "object",
  16727. "properties": {
  16728. "timestamp": {
  16729. "type": "number"
  16730. },
  16731. "sessionID": {
  16732. "type": "string"
  16733. },
  16734. "reasoningID": {
  16735. "type": "string"
  16736. }
  16737. },
  16738. "required": ["timestamp", "sessionID", "reasoningID"],
  16739. "additionalProperties": false
  16740. }
  16741. },
  16742. "required": ["id", "type", "properties"],
  16743. "additionalProperties": false
  16744. },
  16745. "EventSessionNextReasoningDelta": {
  16746. "type": "object",
  16747. "properties": {
  16748. "id": {
  16749. "type": "string"
  16750. },
  16751. "type": {
  16752. "type": "string",
  16753. "enum": ["session.next.reasoning.delta"]
  16754. },
  16755. "properties": {
  16756. "type": "object",
  16757. "properties": {
  16758. "timestamp": {
  16759. "type": "number"
  16760. },
  16761. "sessionID": {
  16762. "type": "string"
  16763. },
  16764. "reasoningID": {
  16765. "type": "string"
  16766. },
  16767. "delta": {
  16768. "type": "string"
  16769. }
  16770. },
  16771. "required": ["timestamp", "sessionID", "reasoningID", "delta"],
  16772. "additionalProperties": false
  16773. }
  16774. },
  16775. "required": ["id", "type", "properties"],
  16776. "additionalProperties": false
  16777. },
  16778. "EventSessionNextReasoningEnded": {
  16779. "type": "object",
  16780. "properties": {
  16781. "id": {
  16782. "type": "string"
  16783. },
  16784. "type": {
  16785. "type": "string",
  16786. "enum": ["session.next.reasoning.ended"]
  16787. },
  16788. "properties": {
  16789. "type": "object",
  16790. "properties": {
  16791. "timestamp": {
  16792. "type": "number"
  16793. },
  16794. "sessionID": {
  16795. "type": "string"
  16796. },
  16797. "reasoningID": {
  16798. "type": "string"
  16799. },
  16800. "text": {
  16801. "type": "string"
  16802. }
  16803. },
  16804. "required": ["timestamp", "sessionID", "reasoningID", "text"],
  16805. "additionalProperties": false
  16806. }
  16807. },
  16808. "required": ["id", "type", "properties"],
  16809. "additionalProperties": false
  16810. },
  16811. "EventSessionNextToolInputStarted": {
  16812. "type": "object",
  16813. "properties": {
  16814. "id": {
  16815. "type": "string"
  16816. },
  16817. "type": {
  16818. "type": "string",
  16819. "enum": ["session.next.tool.input.started"]
  16820. },
  16821. "properties": {
  16822. "type": "object",
  16823. "properties": {
  16824. "timestamp": {
  16825. "type": "number"
  16826. },
  16827. "sessionID": {
  16828. "type": "string"
  16829. },
  16830. "callID": {
  16831. "type": "string"
  16832. },
  16833. "name": {
  16834. "type": "string"
  16835. }
  16836. },
  16837. "required": ["timestamp", "sessionID", "callID", "name"],
  16838. "additionalProperties": false
  16839. }
  16840. },
  16841. "required": ["id", "type", "properties"],
  16842. "additionalProperties": false
  16843. },
  16844. "EventSessionNextToolInputDelta": {
  16845. "type": "object",
  16846. "properties": {
  16847. "id": {
  16848. "type": "string"
  16849. },
  16850. "type": {
  16851. "type": "string",
  16852. "enum": ["session.next.tool.input.delta"]
  16853. },
  16854. "properties": {
  16855. "type": "object",
  16856. "properties": {
  16857. "timestamp": {
  16858. "type": "number"
  16859. },
  16860. "sessionID": {
  16861. "type": "string"
  16862. },
  16863. "callID": {
  16864. "type": "string"
  16865. },
  16866. "delta": {
  16867. "type": "string"
  16868. }
  16869. },
  16870. "required": ["timestamp", "sessionID", "callID", "delta"],
  16871. "additionalProperties": false
  16872. }
  16873. },
  16874. "required": ["id", "type", "properties"],
  16875. "additionalProperties": false
  16876. },
  16877. "EventSessionNextToolInputEnded": {
  16878. "type": "object",
  16879. "properties": {
  16880. "id": {
  16881. "type": "string"
  16882. },
  16883. "type": {
  16884. "type": "string",
  16885. "enum": ["session.next.tool.input.ended"]
  16886. },
  16887. "properties": {
  16888. "type": "object",
  16889. "properties": {
  16890. "timestamp": {
  16891. "type": "number"
  16892. },
  16893. "sessionID": {
  16894. "type": "string"
  16895. },
  16896. "callID": {
  16897. "type": "string"
  16898. },
  16899. "text": {
  16900. "type": "string"
  16901. }
  16902. },
  16903. "required": ["timestamp", "sessionID", "callID", "text"],
  16904. "additionalProperties": false
  16905. }
  16906. },
  16907. "required": ["id", "type", "properties"],
  16908. "additionalProperties": false
  16909. },
  16910. "EventSessionNextToolCalled": {
  16911. "type": "object",
  16912. "properties": {
  16913. "id": {
  16914. "type": "string"
  16915. },
  16916. "type": {
  16917. "type": "string",
  16918. "enum": ["session.next.tool.called"]
  16919. },
  16920. "properties": {
  16921. "type": "object",
  16922. "properties": {
  16923. "timestamp": {
  16924. "type": "number"
  16925. },
  16926. "sessionID": {
  16927. "type": "string"
  16928. },
  16929. "callID": {
  16930. "type": "string"
  16931. },
  16932. "tool": {
  16933. "type": "string"
  16934. },
  16935. "input": {
  16936. "type": "object"
  16937. },
  16938. "provider": {
  16939. "type": "object",
  16940. "properties": {
  16941. "executed": {
  16942. "type": "boolean"
  16943. },
  16944. "metadata": {
  16945. "type": "object"
  16946. }
  16947. },
  16948. "required": ["executed"],
  16949. "additionalProperties": false
  16950. }
  16951. },
  16952. "required": ["timestamp", "sessionID", "callID", "tool", "input", "provider"],
  16953. "additionalProperties": false
  16954. }
  16955. },
  16956. "required": ["id", "type", "properties"],
  16957. "additionalProperties": false
  16958. },
  16959. "ToolTextContent": {
  16960. "type": "object",
  16961. "properties": {
  16962. "type": {
  16963. "type": "string",
  16964. "enum": ["text"]
  16965. },
  16966. "text": {
  16967. "type": "string"
  16968. }
  16969. },
  16970. "required": ["type", "text"],
  16971. "additionalProperties": false
  16972. },
  16973. "ToolFileContent": {
  16974. "type": "object",
  16975. "properties": {
  16976. "type": {
  16977. "type": "string",
  16978. "enum": ["file"]
  16979. },
  16980. "uri": {
  16981. "type": "string"
  16982. },
  16983. "mime": {
  16984. "type": "string"
  16985. },
  16986. "name": {
  16987. "type": "string"
  16988. }
  16989. },
  16990. "required": ["type", "uri", "mime"],
  16991. "additionalProperties": false
  16992. },
  16993. "EventSessionNextToolProgress": {
  16994. "type": "object",
  16995. "properties": {
  16996. "id": {
  16997. "type": "string"
  16998. },
  16999. "type": {
  17000. "type": "string",
  17001. "enum": ["session.next.tool.progress"]
  17002. },
  17003. "properties": {
  17004. "type": "object",
  17005. "properties": {
  17006. "timestamp": {
  17007. "type": "number"
  17008. },
  17009. "sessionID": {
  17010. "type": "string"
  17011. },
  17012. "callID": {
  17013. "type": "string"
  17014. },
  17015. "structured": {
  17016. "type": "object"
  17017. },
  17018. "content": {
  17019. "type": "array",
  17020. "items": {
  17021. "anyOf": [
  17022. {
  17023. "$ref": "#/components/schemas/ToolTextContent"
  17024. },
  17025. {
  17026. "$ref": "#/components/schemas/ToolFileContent"
  17027. }
  17028. ]
  17029. }
  17030. }
  17031. },
  17032. "required": ["timestamp", "sessionID", "callID", "structured", "content"],
  17033. "additionalProperties": false
  17034. }
  17035. },
  17036. "required": ["id", "type", "properties"],
  17037. "additionalProperties": false
  17038. },
  17039. "EventSessionNextToolSuccess": {
  17040. "type": "object",
  17041. "properties": {
  17042. "id": {
  17043. "type": "string"
  17044. },
  17045. "type": {
  17046. "type": "string",
  17047. "enum": ["session.next.tool.success"]
  17048. },
  17049. "properties": {
  17050. "type": "object",
  17051. "properties": {
  17052. "timestamp": {
  17053. "type": "number"
  17054. },
  17055. "sessionID": {
  17056. "type": "string"
  17057. },
  17058. "callID": {
  17059. "type": "string"
  17060. },
  17061. "structured": {
  17062. "type": "object"
  17063. },
  17064. "content": {
  17065. "type": "array",
  17066. "items": {
  17067. "anyOf": [
  17068. {
  17069. "$ref": "#/components/schemas/ToolTextContent"
  17070. },
  17071. {
  17072. "$ref": "#/components/schemas/ToolFileContent"
  17073. }
  17074. ]
  17075. }
  17076. },
  17077. "provider": {
  17078. "type": "object",
  17079. "properties": {
  17080. "executed": {
  17081. "type": "boolean"
  17082. },
  17083. "metadata": {
  17084. "type": "object"
  17085. }
  17086. },
  17087. "required": ["executed"],
  17088. "additionalProperties": false
  17089. }
  17090. },
  17091. "required": ["timestamp", "sessionID", "callID", "structured", "content", "provider"],
  17092. "additionalProperties": false
  17093. }
  17094. },
  17095. "required": ["id", "type", "properties"],
  17096. "additionalProperties": false
  17097. },
  17098. "EventSessionNextToolFailed": {
  17099. "type": "object",
  17100. "properties": {
  17101. "id": {
  17102. "type": "string"
  17103. },
  17104. "type": {
  17105. "type": "string",
  17106. "enum": ["session.next.tool.failed"]
  17107. },
  17108. "properties": {
  17109. "type": "object",
  17110. "properties": {
  17111. "timestamp": {
  17112. "type": "number"
  17113. },
  17114. "sessionID": {
  17115. "type": "string"
  17116. },
  17117. "callID": {
  17118. "type": "string"
  17119. },
  17120. "error": {
  17121. "$ref": "#/components/schemas/SessionErrorUnknown"
  17122. },
  17123. "provider": {
  17124. "type": "object",
  17125. "properties": {
  17126. "executed": {
  17127. "type": "boolean"
  17128. },
  17129. "metadata": {
  17130. "type": "object"
  17131. }
  17132. },
  17133. "required": ["executed"],
  17134. "additionalProperties": false
  17135. }
  17136. },
  17137. "required": ["timestamp", "sessionID", "callID", "error", "provider"],
  17138. "additionalProperties": false
  17139. }
  17140. },
  17141. "required": ["id", "type", "properties"],
  17142. "additionalProperties": false
  17143. },
  17144. "SessionNextRetry_error": {
  17145. "type": "object",
  17146. "properties": {
  17147. "message": {
  17148. "type": "string"
  17149. },
  17150. "statusCode": {
  17151. "type": "integer",
  17152. "minimum": 0
  17153. },
  17154. "isRetryable": {
  17155. "type": "boolean"
  17156. },
  17157. "responseHeaders": {
  17158. "type": "object",
  17159. "additionalProperties": {
  17160. "type": "string"
  17161. }
  17162. },
  17163. "responseBody": {
  17164. "type": "string"
  17165. },
  17166. "metadata": {
  17167. "type": "object",
  17168. "additionalProperties": {
  17169. "type": "string"
  17170. }
  17171. }
  17172. },
  17173. "required": ["message", "isRetryable"],
  17174. "additionalProperties": false
  17175. },
  17176. "EventSessionNextRetried": {
  17177. "type": "object",
  17178. "properties": {
  17179. "id": {
  17180. "type": "string"
  17181. },
  17182. "type": {
  17183. "type": "string",
  17184. "enum": ["session.next.retried"]
  17185. },
  17186. "properties": {
  17187. "type": "object",
  17188. "properties": {
  17189. "timestamp": {
  17190. "type": "number"
  17191. },
  17192. "sessionID": {
  17193. "type": "string"
  17194. },
  17195. "attempt": {
  17196. "type": "integer",
  17197. "minimum": 0
  17198. },
  17199. "error": {
  17200. "$ref": "#/components/schemas/SessionNextRetry_error"
  17201. }
  17202. },
  17203. "required": ["timestamp", "sessionID", "attempt", "error"],
  17204. "additionalProperties": false
  17205. }
  17206. },
  17207. "required": ["id", "type", "properties"],
  17208. "additionalProperties": false
  17209. },
  17210. "EventSessionNextCompactionStarted": {
  17211. "type": "object",
  17212. "properties": {
  17213. "id": {
  17214. "type": "string"
  17215. },
  17216. "type": {
  17217. "type": "string",
  17218. "enum": ["session.next.compaction.started"]
  17219. },
  17220. "properties": {
  17221. "type": "object",
  17222. "properties": {
  17223. "timestamp": {
  17224. "type": "number"
  17225. },
  17226. "sessionID": {
  17227. "type": "string"
  17228. },
  17229. "reason": {
  17230. "type": "string",
  17231. "enum": ["auto", "manual"]
  17232. }
  17233. },
  17234. "required": ["timestamp", "sessionID", "reason"],
  17235. "additionalProperties": false
  17236. }
  17237. },
  17238. "required": ["id", "type", "properties"],
  17239. "additionalProperties": false
  17240. },
  17241. "EventSessionNextCompactionDelta": {
  17242. "type": "object",
  17243. "properties": {
  17244. "id": {
  17245. "type": "string"
  17246. },
  17247. "type": {
  17248. "type": "string",
  17249. "enum": ["session.next.compaction.delta"]
  17250. },
  17251. "properties": {
  17252. "type": "object",
  17253. "properties": {
  17254. "timestamp": {
  17255. "type": "number"
  17256. },
  17257. "sessionID": {
  17258. "type": "string"
  17259. },
  17260. "text": {
  17261. "type": "string"
  17262. }
  17263. },
  17264. "required": ["timestamp", "sessionID", "text"],
  17265. "additionalProperties": false
  17266. }
  17267. },
  17268. "required": ["id", "type", "properties"],
  17269. "additionalProperties": false
  17270. },
  17271. "EventSessionNextCompactionEnded": {
  17272. "type": "object",
  17273. "properties": {
  17274. "id": {
  17275. "type": "string"
  17276. },
  17277. "type": {
  17278. "type": "string",
  17279. "enum": ["session.next.compaction.ended"]
  17280. },
  17281. "properties": {
  17282. "type": "object",
  17283. "properties": {
  17284. "timestamp": {
  17285. "type": "number"
  17286. },
  17287. "sessionID": {
  17288. "type": "string"
  17289. },
  17290. "text": {
  17291. "type": "string"
  17292. },
  17293. "include": {
  17294. "type": "string"
  17295. }
  17296. },
  17297. "required": ["timestamp", "sessionID", "text"],
  17298. "additionalProperties": false
  17299. }
  17300. },
  17301. "required": ["id", "type", "properties"],
  17302. "additionalProperties": false
  17303. },
  17304. "EventServerConnected": {
  17305. "type": "object",
  17306. "properties": {
  17307. "id": {
  17308. "type": "string"
  17309. },
  17310. "type": {
  17311. "type": "string",
  17312. "enum": ["server.connected"]
  17313. },
  17314. "properties": {
  17315. "type": "object",
  17316. "properties": {}
  17317. }
  17318. },
  17319. "required": ["id", "type", "properties"],
  17320. "additionalProperties": false
  17321. },
  17322. "EventGlobalDisposed": {
  17323. "type": "object",
  17324. "properties": {
  17325. "id": {
  17326. "type": "string"
  17327. },
  17328. "type": {
  17329. "type": "string",
  17330. "enum": ["global.disposed"]
  17331. },
  17332. "properties": {
  17333. "type": "object",
  17334. "properties": {}
  17335. }
  17336. },
  17337. "required": ["id", "type", "properties"],
  17338. "additionalProperties": false
  17339. },
  17340. "SessionInfo": {
  17341. "type": "object",
  17342. "properties": {
  17343. "id": {
  17344. "type": "string"
  17345. },
  17346. "parentID": {
  17347. "type": "string"
  17348. },
  17349. "projectID": {
  17350. "type": "string"
  17351. },
  17352. "workspaceID": {
  17353. "type": "string"
  17354. },
  17355. "path": {
  17356. "type": "string"
  17357. },
  17358. "agent": {
  17359. "type": "string"
  17360. },
  17361. "model": {
  17362. "type": "object",
  17363. "properties": {
  17364. "id": {
  17365. "type": "string"
  17366. },
  17367. "providerID": {
  17368. "type": "string"
  17369. },
  17370. "variant": {
  17371. "type": "string"
  17372. }
  17373. },
  17374. "required": ["id", "providerID", "variant"],
  17375. "additionalProperties": false
  17376. },
  17377. "time": {
  17378. "type": "object",
  17379. "properties": {
  17380. "created": {
  17381. "type": "number"
  17382. },
  17383. "updated": {
  17384. "type": "number"
  17385. },
  17386. "archived": {
  17387. "type": "number"
  17388. }
  17389. },
  17390. "required": ["created", "updated"],
  17391. "additionalProperties": false
  17392. },
  17393. "title": {
  17394. "type": "string"
  17395. }
  17396. },
  17397. "required": ["id", "projectID", "time", "title"],
  17398. "additionalProperties": false
  17399. },
  17400. "SessionDelivery": {
  17401. "type": "string",
  17402. "enum": ["immediate", "deferred"]
  17403. },
  17404. "SessionMessageAgentSwitched": {
  17405. "type": "object",
  17406. "properties": {
  17407. "id": {
  17408. "type": "string"
  17409. },
  17410. "metadata": {
  17411. "type": "object"
  17412. },
  17413. "time": {
  17414. "type": "object",
  17415. "properties": {
  17416. "created": {
  17417. "type": "number"
  17418. }
  17419. },
  17420. "required": ["created"],
  17421. "additionalProperties": false
  17422. },
  17423. "type": {
  17424. "type": "string",
  17425. "enum": ["agent-switched"]
  17426. },
  17427. "agent": {
  17428. "type": "string"
  17429. }
  17430. },
  17431. "required": ["id", "time", "type", "agent"],
  17432. "additionalProperties": false
  17433. },
  17434. "SessionMessageModelSwitched": {
  17435. "type": "object",
  17436. "properties": {
  17437. "id": {
  17438. "type": "string"
  17439. },
  17440. "metadata": {
  17441. "type": "object"
  17442. },
  17443. "time": {
  17444. "type": "object",
  17445. "properties": {
  17446. "created": {
  17447. "type": "number"
  17448. }
  17449. },
  17450. "required": ["created"],
  17451. "additionalProperties": false
  17452. },
  17453. "type": {
  17454. "type": "string",
  17455. "enum": ["model-switched"]
  17456. },
  17457. "model": {
  17458. "type": "object",
  17459. "properties": {
  17460. "id": {
  17461. "type": "string"
  17462. },
  17463. "providerID": {
  17464. "type": "string"
  17465. },
  17466. "variant": {
  17467. "type": "string"
  17468. }
  17469. },
  17470. "required": ["id", "providerID", "variant"],
  17471. "additionalProperties": false
  17472. }
  17473. },
  17474. "required": ["id", "time", "type", "model"],
  17475. "additionalProperties": false
  17476. },
  17477. "SessionMessageUser": {
  17478. "type": "object",
  17479. "properties": {
  17480. "id": {
  17481. "type": "string"
  17482. },
  17483. "metadata": {
  17484. "type": "object"
  17485. },
  17486. "time": {
  17487. "type": "object",
  17488. "properties": {
  17489. "created": {
  17490. "type": "number"
  17491. }
  17492. },
  17493. "required": ["created"],
  17494. "additionalProperties": false
  17495. },
  17496. "text": {
  17497. "type": "string"
  17498. },
  17499. "files": {
  17500. "type": "array",
  17501. "items": {
  17502. "$ref": "#/components/schemas/PromptFileAttachment"
  17503. }
  17504. },
  17505. "agents": {
  17506. "type": "array",
  17507. "items": {
  17508. "$ref": "#/components/schemas/PromptAgentAttachment"
  17509. }
  17510. },
  17511. "type": {
  17512. "type": "string",
  17513. "enum": ["user"]
  17514. }
  17515. },
  17516. "required": ["id", "time", "text", "type"],
  17517. "additionalProperties": false
  17518. },
  17519. "SessionMessageSynthetic": {
  17520. "type": "object",
  17521. "properties": {
  17522. "id": {
  17523. "type": "string"
  17524. },
  17525. "metadata": {
  17526. "type": "object"
  17527. },
  17528. "time": {
  17529. "type": "object",
  17530. "properties": {
  17531. "created": {
  17532. "type": "number"
  17533. }
  17534. },
  17535. "required": ["created"],
  17536. "additionalProperties": false
  17537. },
  17538. "sessionID": {
  17539. "type": "string"
  17540. },
  17541. "text": {
  17542. "type": "string"
  17543. },
  17544. "type": {
  17545. "type": "string",
  17546. "enum": ["synthetic"]
  17547. }
  17548. },
  17549. "required": ["id", "time", "sessionID", "text", "type"],
  17550. "additionalProperties": false
  17551. },
  17552. "SessionMessageShell": {
  17553. "type": "object",
  17554. "properties": {
  17555. "id": {
  17556. "type": "string"
  17557. },
  17558. "metadata": {
  17559. "type": "object"
  17560. },
  17561. "time": {
  17562. "type": "object",
  17563. "properties": {
  17564. "created": {
  17565. "type": "number"
  17566. },
  17567. "completed": {
  17568. "type": "number"
  17569. }
  17570. },
  17571. "required": ["created"],
  17572. "additionalProperties": false
  17573. },
  17574. "type": {
  17575. "type": "string",
  17576. "enum": ["shell"]
  17577. },
  17578. "callID": {
  17579. "type": "string"
  17580. },
  17581. "command": {
  17582. "type": "string"
  17583. },
  17584. "output": {
  17585. "type": "string"
  17586. }
  17587. },
  17588. "required": ["id", "time", "type", "callID", "command", "output"],
  17589. "additionalProperties": false
  17590. },
  17591. "SessionMessageAssistantText": {
  17592. "type": "object",
  17593. "properties": {
  17594. "type": {
  17595. "type": "string",
  17596. "enum": ["text"]
  17597. },
  17598. "text": {
  17599. "type": "string"
  17600. }
  17601. },
  17602. "required": ["type", "text"],
  17603. "additionalProperties": false
  17604. },
  17605. "SessionMessageAssistantReasoning": {
  17606. "type": "object",
  17607. "properties": {
  17608. "type": {
  17609. "type": "string",
  17610. "enum": ["reasoning"]
  17611. },
  17612. "id": {
  17613. "type": "string"
  17614. },
  17615. "text": {
  17616. "type": "string"
  17617. }
  17618. },
  17619. "required": ["type", "id", "text"],
  17620. "additionalProperties": false
  17621. },
  17622. "SessionMessageToolStatePending": {
  17623. "type": "object",
  17624. "properties": {
  17625. "status": {
  17626. "type": "string",
  17627. "enum": ["pending"]
  17628. },
  17629. "input": {
  17630. "type": "string"
  17631. }
  17632. },
  17633. "required": ["status", "input"],
  17634. "additionalProperties": false
  17635. },
  17636. "SessionMessageToolStateRunning": {
  17637. "type": "object",
  17638. "properties": {
  17639. "status": {
  17640. "type": "string",
  17641. "enum": ["running"]
  17642. },
  17643. "input": {
  17644. "type": "object"
  17645. },
  17646. "structured": {
  17647. "type": "object"
  17648. },
  17649. "content": {
  17650. "type": "array",
  17651. "items": {
  17652. "anyOf": [
  17653. {
  17654. "$ref": "#/components/schemas/ToolTextContent"
  17655. },
  17656. {
  17657. "$ref": "#/components/schemas/ToolFileContent"
  17658. }
  17659. ]
  17660. }
  17661. }
  17662. },
  17663. "required": ["status", "input", "structured", "content"],
  17664. "additionalProperties": false
  17665. },
  17666. "SessionMessageToolStateCompleted": {
  17667. "type": "object",
  17668. "properties": {
  17669. "status": {
  17670. "type": "string",
  17671. "enum": ["completed"]
  17672. },
  17673. "input": {
  17674. "type": "object"
  17675. },
  17676. "attachments": {
  17677. "type": "array",
  17678. "items": {
  17679. "$ref": "#/components/schemas/PromptFileAttachment"
  17680. }
  17681. },
  17682. "content": {
  17683. "type": "array",
  17684. "items": {
  17685. "anyOf": [
  17686. {
  17687. "$ref": "#/components/schemas/ToolTextContent"
  17688. },
  17689. {
  17690. "$ref": "#/components/schemas/ToolFileContent"
  17691. }
  17692. ]
  17693. }
  17694. },
  17695. "structured": {
  17696. "type": "object"
  17697. }
  17698. },
  17699. "required": ["status", "input", "content", "structured"],
  17700. "additionalProperties": false
  17701. },
  17702. "SessionMessageToolStateError": {
  17703. "type": "object",
  17704. "properties": {
  17705. "status": {
  17706. "type": "string",
  17707. "enum": ["error"]
  17708. },
  17709. "input": {
  17710. "type": "object"
  17711. },
  17712. "content": {
  17713. "type": "array",
  17714. "items": {
  17715. "anyOf": [
  17716. {
  17717. "$ref": "#/components/schemas/ToolTextContent"
  17718. },
  17719. {
  17720. "$ref": "#/components/schemas/ToolFileContent"
  17721. }
  17722. ]
  17723. }
  17724. },
  17725. "structured": {
  17726. "type": "object"
  17727. },
  17728. "error": {
  17729. "$ref": "#/components/schemas/SessionErrorUnknown"
  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", "variant"],
  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. "$ref": "#/components/schemas/SessionErrorUnknown"
  17910. }
  17911. },
  17912. "required": ["id", "time", "type", "agent", "model", "content"],
  17913. "additionalProperties": false
  17914. },
  17915. "SessionMessageCompaction": {
  17916. "type": "object",
  17917. "properties": {
  17918. "type": {
  17919. "type": "string",
  17920. "enum": ["compaction"]
  17921. },
  17922. "reason": {
  17923. "type": "string",
  17924. "enum": ["auto", "manual"]
  17925. },
  17926. "summary": {
  17927. "type": "string"
  17928. },
  17929. "include": {
  17930. "type": "string"
  17931. },
  17932. "id": {
  17933. "type": "string"
  17934. },
  17935. "metadata": {
  17936. "type": "object"
  17937. },
  17938. "time": {
  17939. "type": "object",
  17940. "properties": {
  17941. "created": {
  17942. "type": "number"
  17943. }
  17944. },
  17945. "required": ["created"],
  17946. "additionalProperties": false
  17947. }
  17948. },
  17949. "required": ["type", "reason", "summary", "id", "time"],
  17950. "additionalProperties": false
  17951. },
  17952. "SessionMessage": {
  17953. "anyOf": [
  17954. {
  17955. "$ref": "#/components/schemas/SessionMessageAgentSwitched"
  17956. },
  17957. {
  17958. "$ref": "#/components/schemas/SessionMessageModelSwitched"
  17959. },
  17960. {
  17961. "$ref": "#/components/schemas/SessionMessageUser"
  17962. },
  17963. {
  17964. "$ref": "#/components/schemas/SessionMessageSynthetic"
  17965. },
  17966. {
  17967. "$ref": "#/components/schemas/SessionMessageShell"
  17968. },
  17969. {
  17970. "$ref": "#/components/schemas/SessionMessageAssistant"
  17971. },
  17972. {
  17973. "$ref": "#/components/schemas/SessionMessageCompaction"
  17974. }
  17975. ]
  17976. },
  17977. "EventTuiToastShow1": {
  17978. "type": "object",
  17979. "properties": {
  17980. "id": {
  17981. "type": "string"
  17982. },
  17983. "type": {
  17984. "type": "string",
  17985. "enum": ["tui.toast.show"]
  17986. },
  17987. "properties": {
  17988. "type": "object",
  17989. "properties": {
  17990. "title": {
  17991. "type": "string"
  17992. },
  17993. "message": {
  17994. "type": "string"
  17995. },
  17996. "variant": {
  17997. "type": "string",
  17998. "enum": ["info", "success", "warning", "error"]
  17999. },
  18000. "duration": {
  18001. "type": "integer",
  18002. "exclusiveMinimum": 0
  18003. }
  18004. },
  18005. "required": ["message", "variant"],
  18006. "additionalProperties": false
  18007. }
  18008. },
  18009. "required": ["id", "type", "properties"],
  18010. "additionalProperties": false
  18011. },
  18012. "BadRequestError": {
  18013. "type": "object",
  18014. "required": ["data", "errors", "success"],
  18015. "properties": {
  18016. "data": {},
  18017. "errors": {
  18018. "type": "array",
  18019. "items": {
  18020. "type": "object",
  18021. "additionalProperties": {}
  18022. }
  18023. },
  18024. "success": {
  18025. "type": "boolean",
  18026. "enum": [false]
  18027. }
  18028. }
  18029. },
  18030. "NotFoundError": {
  18031. "type": "object",
  18032. "required": ["name", "data"],
  18033. "properties": {
  18034. "name": {
  18035. "type": "string",
  18036. "enum": ["NotFoundError"]
  18037. },
  18038. "data": {
  18039. "type": "object",
  18040. "required": ["message"],
  18041. "properties": {
  18042. "message": {
  18043. "type": "string"
  18044. }
  18045. }
  18046. }
  18047. }
  18048. }
  18049. }
  18050. },
  18051. "security": [],
  18052. "tags": [
  18053. {
  18054. "name": "control",
  18055. "description": "Control plane routes."
  18056. },
  18057. {
  18058. "name": "global",
  18059. "description": "Global server routes."
  18060. },
  18061. {
  18062. "name": "event",
  18063. "description": "Instance event stream route."
  18064. },
  18065. {
  18066. "name": "config",
  18067. "description": "Experimental HttpApi config routes."
  18068. },
  18069. {
  18070. "name": "experimental",
  18071. "description": "Experimental HttpApi read-only routes."
  18072. },
  18073. {
  18074. "name": "file",
  18075. "description": "Experimental HttpApi file routes."
  18076. },
  18077. {
  18078. "name": "instance",
  18079. "description": "Experimental HttpApi instance read routes."
  18080. },
  18081. {
  18082. "name": "mcp",
  18083. "description": "Experimental HttpApi MCP routes."
  18084. },
  18085. {
  18086. "name": "project",
  18087. "description": "Experimental HttpApi project routes."
  18088. },
  18089. {
  18090. "name": "pty",
  18091. "description": "Experimental HttpApi PTY routes."
  18092. },
  18093. {
  18094. "name": "question",
  18095. "description": "Question routes."
  18096. },
  18097. {
  18098. "name": "permission",
  18099. "description": "Experimental HttpApi permission routes."
  18100. },
  18101. {
  18102. "name": "provider",
  18103. "description": "Experimental HttpApi provider routes."
  18104. },
  18105. {
  18106. "name": "session",
  18107. "description": "Experimental HttpApi session routes."
  18108. },
  18109. {
  18110. "name": "sync",
  18111. "description": "Experimental HttpApi sync routes."
  18112. },
  18113. {
  18114. "name": "v2",
  18115. "description": "Experimental v2 routes."
  18116. },
  18117. {
  18118. "name": "v2 messages",
  18119. "description": "Experimental v2 message routes."
  18120. },
  18121. {
  18122. "name": "tui",
  18123. "description": "Experimental HttpApi TUI routes."
  18124. },
  18125. {
  18126. "name": "workspace",
  18127. "description": "Experimental HttpApi workspace routes."
  18128. },
  18129. {
  18130. "name": "pty",
  18131. "description": "PTY websocket route."
  18132. }
  18133. ]
  18134. }