openapi.json 492 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127
  1. {
  2. "openapi": "3.1.0",
  3. "info": {
  4. "title": "opencode",
  5. "version": "1.0.0",
  6. "description": "opencode api"
  7. },
  8. "paths": {
  9. "/auth/{providerID}": {
  10. "put": {
  11. "tags": ["control"],
  12. "operationId": "auth.set",
  13. "parameters": [
  14. {
  15. "name": "providerID",
  16. "in": "path",
  17. "schema": {
  18. "type": "string"
  19. },
  20. "required": true
  21. }
  22. ],
  23. "responses": {
  24. "200": {
  25. "description": "Successfully set authentication credentials",
  26. "content": {
  27. "application/json": {
  28. "schema": {
  29. "type": "boolean",
  30. "description": "Successfully set authentication credentials"
  31. }
  32. }
  33. }
  34. },
  35. "400": {
  36. "description": "Bad request",
  37. "content": {
  38. "application/json": {
  39. "schema": {
  40. "$ref": "#/components/schemas/BadRequestError"
  41. }
  42. }
  43. }
  44. }
  45. },
  46. "description": "Set authentication credentials",
  47. "summary": "Set auth credentials",
  48. "requestBody": {
  49. "content": {
  50. "application/json": {
  51. "schema": {
  52. "$ref": "#/components/schemas/Auth"
  53. }
  54. }
  55. }
  56. },
  57. "x-codeSamples": [
  58. {
  59. "lang": "js",
  60. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.auth.set({\n ...\n})"
  61. }
  62. ]
  63. },
  64. "delete": {
  65. "tags": ["control"],
  66. "operationId": "auth.remove",
  67. "parameters": [
  68. {
  69. "name": "providerID",
  70. "in": "path",
  71. "schema": {
  72. "type": "string"
  73. },
  74. "required": true
  75. }
  76. ],
  77. "responses": {
  78. "200": {
  79. "description": "Successfully removed authentication credentials",
  80. "content": {
  81. "application/json": {
  82. "schema": {
  83. "type": "boolean",
  84. "description": "Successfully removed authentication credentials"
  85. }
  86. }
  87. }
  88. },
  89. "400": {
  90. "description": "Bad request",
  91. "content": {
  92. "application/json": {
  93. "schema": {
  94. "$ref": "#/components/schemas/BadRequestError"
  95. }
  96. }
  97. }
  98. }
  99. },
  100. "description": "Remove authentication credentials",
  101. "summary": "Remove auth credentials",
  102. "x-codeSamples": [
  103. {
  104. "lang": "js",
  105. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.auth.remove({\n ...\n})"
  106. }
  107. ]
  108. }
  109. },
  110. "/log": {
  111. "post": {
  112. "tags": ["control"],
  113. "operationId": "app.log",
  114. "parameters": [
  115. {
  116. "name": "directory",
  117. "in": "query",
  118. "required": false,
  119. "schema": {
  120. "type": "string"
  121. }
  122. },
  123. {
  124. "name": "workspace",
  125. "in": "query",
  126. "required": false,
  127. "schema": {
  128. "type": "string"
  129. }
  130. }
  131. ],
  132. "responses": {
  133. "200": {
  134. "description": "Log entry written successfully",
  135. "content": {
  136. "application/json": {
  137. "schema": {
  138. "type": "boolean",
  139. "description": "Log entry written successfully"
  140. }
  141. }
  142. }
  143. },
  144. "400": {
  145. "description": "Bad request",
  146. "content": {
  147. "application/json": {
  148. "schema": {
  149. "$ref": "#/components/schemas/BadRequestError"
  150. }
  151. }
  152. }
  153. }
  154. },
  155. "description": "Write a log entry to the server logs with specified level and metadata.",
  156. "summary": "Write log",
  157. "requestBody": {
  158. "content": {
  159. "application/json": {
  160. "schema": {
  161. "type": "object",
  162. "properties": {
  163. "service": {
  164. "type": "string",
  165. "description": "Service name for the log entry"
  166. },
  167. "level": {
  168. "type": "string",
  169. "enum": ["debug", "info", "error", "warn"],
  170. "description": "Log level"
  171. },
  172. "message": {
  173. "type": "string",
  174. "description": "Log message"
  175. },
  176. "extra": {
  177. "type": "object"
  178. }
  179. },
  180. "required": ["service", "level", "message"],
  181. "additionalProperties": false
  182. }
  183. }
  184. }
  185. },
  186. "x-codeSamples": [
  187. {
  188. "lang": "js",
  189. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.app.log({\n ...\n})"
  190. }
  191. ]
  192. }
  193. },
  194. "/global/health": {
  195. "get": {
  196. "tags": ["global"],
  197. "operationId": "global.health",
  198. "parameters": [],
  199. "responses": {
  200. "200": {
  201. "description": "Health information",
  202. "content": {
  203. "application/json": {
  204. "schema": {
  205. "type": "object",
  206. "properties": {
  207. "healthy": {
  208. "type": "boolean",
  209. "enum": [true]
  210. },
  211. "version": {
  212. "type": "string"
  213. }
  214. },
  215. "required": ["healthy", "version"],
  216. "additionalProperties": false,
  217. "description": "Health information"
  218. }
  219. }
  220. }
  221. }
  222. },
  223. "description": "Get health information about the OpenCode server.",
  224. "summary": "Get health",
  225. "x-codeSamples": [
  226. {
  227. "lang": "js",
  228. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.health({\n ...\n})"
  229. }
  230. ]
  231. }
  232. },
  233. "/global/event": {
  234. "get": {
  235. "tags": ["global"],
  236. "operationId": "global.event",
  237. "parameters": [],
  238. "responses": {
  239. "200": {
  240. "description": "Event stream",
  241. "content": {
  242. "text/event-stream": {
  243. "schema": {
  244. "$ref": "#/components/schemas/GlobalEvent"
  245. }
  246. }
  247. }
  248. }
  249. },
  250. "description": "Subscribe to global events from the OpenCode system using server-sent events.",
  251. "summary": "Get global events",
  252. "x-codeSamples": [
  253. {
  254. "lang": "js",
  255. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.event({\n ...\n})"
  256. }
  257. ]
  258. }
  259. },
  260. "/global/config": {
  261. "get": {
  262. "tags": ["global"],
  263. "operationId": "global.config.get",
  264. "parameters": [],
  265. "responses": {
  266. "200": {
  267. "description": "Get global config info",
  268. "content": {
  269. "application/json": {
  270. "schema": {
  271. "$ref": "#/components/schemas/Config"
  272. }
  273. }
  274. }
  275. }
  276. },
  277. "description": "Retrieve the current global OpenCode configuration settings and preferences.",
  278. "summary": "Get global configuration",
  279. "x-codeSamples": [
  280. {
  281. "lang": "js",
  282. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.config.get({\n ...\n})"
  283. }
  284. ]
  285. },
  286. "patch": {
  287. "tags": ["global"],
  288. "operationId": "global.config.update",
  289. "parameters": [],
  290. "responses": {
  291. "200": {
  292. "description": "Successfully updated global config",
  293. "content": {
  294. "application/json": {
  295. "schema": {
  296. "$ref": "#/components/schemas/Config"
  297. }
  298. }
  299. }
  300. },
  301. "400": {
  302. "description": "Bad request",
  303. "content": {
  304. "application/json": {
  305. "schema": {
  306. "$ref": "#/components/schemas/BadRequestError"
  307. }
  308. }
  309. }
  310. }
  311. },
  312. "description": "Update global OpenCode configuration settings and preferences.",
  313. "summary": "Update global configuration",
  314. "requestBody": {
  315. "content": {
  316. "application/json": {
  317. "schema": {
  318. "$ref": "#/components/schemas/Config"
  319. }
  320. }
  321. }
  322. },
  323. "x-codeSamples": [
  324. {
  325. "lang": "js",
  326. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.config.update({\n ...\n})"
  327. }
  328. ]
  329. }
  330. },
  331. "/global/dispose": {
  332. "post": {
  333. "tags": ["global"],
  334. "operationId": "global.dispose",
  335. "parameters": [],
  336. "responses": {
  337. "200": {
  338. "description": "Global disposed",
  339. "content": {
  340. "application/json": {
  341. "schema": {
  342. "type": "boolean",
  343. "description": "Global disposed"
  344. }
  345. }
  346. }
  347. }
  348. },
  349. "description": "Clean up and dispose all OpenCode instances, releasing all resources.",
  350. "summary": "Dispose instance",
  351. "x-codeSamples": [
  352. {
  353. "lang": "js",
  354. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.dispose({\n ...\n})"
  355. }
  356. ]
  357. }
  358. },
  359. "/global/upgrade": {
  360. "post": {
  361. "tags": ["global"],
  362. "operationId": "global.upgrade",
  363. "parameters": [],
  364. "responses": {
  365. "200": {
  366. "description": "Upgrade result",
  367. "content": {
  368. "application/json": {
  369. "schema": {
  370. "anyOf": [
  371. {
  372. "type": "object",
  373. "properties": {
  374. "success": {
  375. "type": "boolean",
  376. "enum": [true]
  377. },
  378. "version": {
  379. "type": "string"
  380. }
  381. },
  382. "required": ["success", "version"],
  383. "additionalProperties": false
  384. },
  385. {
  386. "type": "object",
  387. "properties": {
  388. "success": {
  389. "type": "boolean",
  390. "enum": [false]
  391. },
  392. "error": {
  393. "type": "string"
  394. }
  395. },
  396. "required": ["success", "error"],
  397. "additionalProperties": false
  398. }
  399. ],
  400. "description": "Upgrade result"
  401. }
  402. }
  403. }
  404. },
  405. "400": {
  406. "description": "Bad request",
  407. "content": {
  408. "application/json": {
  409. "schema": {
  410. "$ref": "#/components/schemas/BadRequestError"
  411. }
  412. }
  413. }
  414. }
  415. },
  416. "description": "Upgrade opencode to the specified version or latest if not specified.",
  417. "summary": "Upgrade opencode",
  418. "requestBody": {
  419. "content": {
  420. "application/json": {
  421. "schema": {
  422. "type": "object",
  423. "properties": {
  424. "target": {
  425. "type": "string"
  426. }
  427. },
  428. "additionalProperties": false
  429. }
  430. }
  431. }
  432. },
  433. "x-codeSamples": [
  434. {
  435. "lang": "js",
  436. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.upgrade({\n ...\n})"
  437. }
  438. ]
  439. }
  440. },
  441. "/event": {
  442. "get": {
  443. "tags": ["event"],
  444. "operationId": "event.subscribe",
  445. "parameters": [
  446. {
  447. "name": "directory",
  448. "in": "query",
  449. "required": false,
  450. "schema": {
  451. "type": "string"
  452. }
  453. },
  454. {
  455. "name": "workspace",
  456. "in": "query",
  457. "required": false,
  458. "schema": {
  459. "type": "string"
  460. }
  461. }
  462. ],
  463. "responses": {
  464. "200": {
  465. "description": "Event stream",
  466. "content": {
  467. "text/event-stream": {
  468. "schema": {
  469. "$ref": "#/components/schemas/Event"
  470. }
  471. }
  472. }
  473. }
  474. },
  475. "description": "Get events",
  476. "summary": "Subscribe to events",
  477. "x-codeSamples": [
  478. {
  479. "lang": "js",
  480. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.event.subscribe({\n ...\n})"
  481. }
  482. ]
  483. }
  484. },
  485. "/config": {
  486. "get": {
  487. "tags": ["config"],
  488. "operationId": "config.get",
  489. "parameters": [
  490. {
  491. "name": "directory",
  492. "in": "query",
  493. "required": false,
  494. "schema": {
  495. "type": "string"
  496. }
  497. },
  498. {
  499. "name": "workspace",
  500. "in": "query",
  501. "required": false,
  502. "schema": {
  503. "type": "string"
  504. }
  505. }
  506. ],
  507. "responses": {
  508. "200": {
  509. "description": "Get config info",
  510. "content": {
  511. "application/json": {
  512. "schema": {
  513. "$ref": "#/components/schemas/Config"
  514. }
  515. }
  516. }
  517. }
  518. },
  519. "description": "Retrieve the current OpenCode configuration settings and preferences.",
  520. "summary": "Get configuration",
  521. "x-codeSamples": [
  522. {
  523. "lang": "js",
  524. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.config.get({\n ...\n})"
  525. }
  526. ]
  527. },
  528. "patch": {
  529. "tags": ["config"],
  530. "operationId": "config.update",
  531. "parameters": [
  532. {
  533. "name": "directory",
  534. "in": "query",
  535. "required": false,
  536. "schema": {
  537. "type": "string"
  538. }
  539. },
  540. {
  541. "name": "workspace",
  542. "in": "query",
  543. "required": false,
  544. "schema": {
  545. "type": "string"
  546. }
  547. }
  548. ],
  549. "responses": {
  550. "200": {
  551. "description": "Successfully updated config",
  552. "content": {
  553. "application/json": {
  554. "schema": {
  555. "$ref": "#/components/schemas/Config"
  556. }
  557. }
  558. }
  559. },
  560. "400": {
  561. "description": "Bad request",
  562. "content": {
  563. "application/json": {
  564. "schema": {
  565. "$ref": "#/components/schemas/BadRequestError"
  566. }
  567. }
  568. }
  569. }
  570. },
  571. "description": "Update OpenCode configuration settings and preferences.",
  572. "summary": "Update configuration",
  573. "requestBody": {
  574. "content": {
  575. "application/json": {
  576. "schema": {
  577. "$ref": "#/components/schemas/Config"
  578. }
  579. }
  580. }
  581. },
  582. "x-codeSamples": [
  583. {
  584. "lang": "js",
  585. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.config.update({\n ...\n})"
  586. }
  587. ]
  588. }
  589. },
  590. "/config/providers": {
  591. "get": {
  592. "tags": ["config"],
  593. "operationId": "config.providers",
  594. "parameters": [
  595. {
  596. "name": "directory",
  597. "in": "query",
  598. "required": false,
  599. "schema": {
  600. "type": "string"
  601. }
  602. },
  603. {
  604. "name": "workspace",
  605. "in": "query",
  606. "required": false,
  607. "schema": {
  608. "type": "string"
  609. }
  610. }
  611. ],
  612. "responses": {
  613. "200": {
  614. "description": "List of providers",
  615. "content": {
  616. "application/json": {
  617. "schema": {
  618. "type": "object",
  619. "properties": {
  620. "providers": {
  621. "type": "array",
  622. "items": {
  623. "$ref": "#/components/schemas/Provider"
  624. }
  625. },
  626. "default": {
  627. "type": "object",
  628. "additionalProperties": {
  629. "type": "string"
  630. }
  631. }
  632. },
  633. "required": ["providers", "default"],
  634. "additionalProperties": false,
  635. "description": "List of providers"
  636. }
  637. }
  638. }
  639. }
  640. },
  641. "description": "Get a list of all configured AI providers and their default models.",
  642. "summary": "List config providers",
  643. "x-codeSamples": [
  644. {
  645. "lang": "js",
  646. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.config.providers({\n ...\n})"
  647. }
  648. ]
  649. }
  650. },
  651. "/experimental/console": {
  652. "get": {
  653. "tags": ["experimental"],
  654. "operationId": "experimental.console.get",
  655. "parameters": [
  656. {
  657. "name": "directory",
  658. "in": "query",
  659. "required": false,
  660. "schema": {
  661. "type": "string"
  662. }
  663. },
  664. {
  665. "name": "workspace",
  666. "in": "query",
  667. "required": false,
  668. "schema": {
  669. "type": "string"
  670. }
  671. }
  672. ],
  673. "responses": {
  674. "200": {
  675. "description": "Active Console provider metadata",
  676. "content": {
  677. "application/json": {
  678. "schema": {
  679. "$ref": "#/components/schemas/ConsoleState"
  680. }
  681. }
  682. }
  683. }
  684. },
  685. "description": "Get the active Console org name and the set of provider IDs managed by that Console org.",
  686. "summary": "Get active Console provider metadata",
  687. "x-codeSamples": [
  688. {
  689. "lang": "js",
  690. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.console.get({\n ...\n})"
  691. }
  692. ]
  693. }
  694. },
  695. "/experimental/console/orgs": {
  696. "get": {
  697. "tags": ["experimental"],
  698. "operationId": "experimental.console.listOrgs",
  699. "parameters": [
  700. {
  701. "name": "directory",
  702. "in": "query",
  703. "required": false,
  704. "schema": {
  705. "type": "string"
  706. }
  707. },
  708. {
  709. "name": "workspace",
  710. "in": "query",
  711. "required": false,
  712. "schema": {
  713. "type": "string"
  714. }
  715. }
  716. ],
  717. "responses": {
  718. "200": {
  719. "description": "Switchable Console orgs",
  720. "content": {
  721. "application/json": {
  722. "schema": {
  723. "type": "object",
  724. "properties": {
  725. "orgs": {
  726. "type": "array",
  727. "items": {
  728. "type": "object",
  729. "properties": {
  730. "accountID": {
  731. "type": "string"
  732. },
  733. "accountEmail": {
  734. "type": "string"
  735. },
  736. "accountUrl": {
  737. "type": "string"
  738. },
  739. "orgID": {
  740. "type": "string"
  741. },
  742. "orgName": {
  743. "type": "string"
  744. },
  745. "active": {
  746. "type": "boolean"
  747. }
  748. },
  749. "required": ["accountID", "accountEmail", "accountUrl", "orgID", "orgName", "active"],
  750. "additionalProperties": false
  751. }
  752. }
  753. },
  754. "required": ["orgs"],
  755. "additionalProperties": false,
  756. "description": "Switchable Console orgs"
  757. }
  758. }
  759. }
  760. }
  761. },
  762. "description": "Get the available Console orgs across logged-in accounts, including the current active org.",
  763. "summary": "List switchable Console orgs",
  764. "x-codeSamples": [
  765. {
  766. "lang": "js",
  767. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.console.listOrgs({\n ...\n})"
  768. }
  769. ]
  770. }
  771. },
  772. "/experimental/console/switch": {
  773. "post": {
  774. "tags": ["experimental"],
  775. "operationId": "experimental.console.switchOrg",
  776. "parameters": [
  777. {
  778. "name": "directory",
  779. "in": "query",
  780. "required": false,
  781. "schema": {
  782. "type": "string"
  783. }
  784. },
  785. {
  786. "name": "workspace",
  787. "in": "query",
  788. "required": false,
  789. "schema": {
  790. "type": "string"
  791. }
  792. }
  793. ],
  794. "responses": {
  795. "200": {
  796. "description": "Switch success",
  797. "content": {
  798. "application/json": {
  799. "schema": {
  800. "type": "boolean",
  801. "description": "Switch success"
  802. }
  803. }
  804. }
  805. }
  806. },
  807. "description": "Persist a new active Console account/org selection for the current local OpenCode state.",
  808. "summary": "Switch active Console org",
  809. "requestBody": {
  810. "content": {
  811. "application/json": {
  812. "schema": {
  813. "type": "object",
  814. "properties": {
  815. "accountID": {
  816. "type": "string"
  817. },
  818. "orgID": {
  819. "type": "string"
  820. }
  821. },
  822. "required": ["accountID", "orgID"],
  823. "additionalProperties": false
  824. }
  825. }
  826. }
  827. },
  828. "x-codeSamples": [
  829. {
  830. "lang": "js",
  831. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.console.switchOrg({\n ...\n})"
  832. }
  833. ]
  834. }
  835. },
  836. "/experimental/tool": {
  837. "get": {
  838. "tags": ["experimental"],
  839. "operationId": "tool.list",
  840. "parameters": [
  841. {
  842. "name": "directory",
  843. "in": "query",
  844. "required": false,
  845. "schema": {
  846. "type": "string"
  847. }
  848. },
  849. {
  850. "name": "workspace",
  851. "in": "query",
  852. "required": false,
  853. "schema": {
  854. "type": "string"
  855. }
  856. },
  857. {
  858. "name": "provider",
  859. "in": "query",
  860. "schema": {
  861. "type": "string"
  862. },
  863. "required": true
  864. },
  865. {
  866. "name": "model",
  867. "in": "query",
  868. "schema": {
  869. "type": "string"
  870. },
  871. "required": true
  872. }
  873. ],
  874. "responses": {
  875. "200": {
  876. "description": "Tools",
  877. "content": {
  878. "application/json": {
  879. "schema": {
  880. "$ref": "#/components/schemas/ToolList"
  881. }
  882. }
  883. }
  884. },
  885. "400": {
  886. "description": "Bad request",
  887. "content": {
  888. "application/json": {
  889. "schema": {
  890. "$ref": "#/components/schemas/BadRequestError"
  891. }
  892. }
  893. }
  894. }
  895. },
  896. "description": "Get a list of available tools with their JSON schema parameters for a specific provider and model combination.",
  897. "summary": "List tools",
  898. "x-codeSamples": [
  899. {
  900. "lang": "js",
  901. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tool.list({\n ...\n})"
  902. }
  903. ]
  904. }
  905. },
  906. "/experimental/tool/ids": {
  907. "get": {
  908. "tags": ["experimental"],
  909. "operationId": "tool.ids",
  910. "parameters": [
  911. {
  912. "name": "directory",
  913. "in": "query",
  914. "required": false,
  915. "schema": {
  916. "type": "string"
  917. }
  918. },
  919. {
  920. "name": "workspace",
  921. "in": "query",
  922. "required": false,
  923. "schema": {
  924. "type": "string"
  925. }
  926. }
  927. ],
  928. "responses": {
  929. "200": {
  930. "description": "Tool IDs",
  931. "content": {
  932. "application/json": {
  933. "schema": {
  934. "$ref": "#/components/schemas/ToolIDs"
  935. }
  936. }
  937. }
  938. },
  939. "400": {
  940. "description": "Bad request",
  941. "content": {
  942. "application/json": {
  943. "schema": {
  944. "$ref": "#/components/schemas/BadRequestError"
  945. }
  946. }
  947. }
  948. }
  949. },
  950. "description": "Get a list of all available tool IDs, including both built-in tools and dynamically registered tools.",
  951. "summary": "List tool IDs",
  952. "x-codeSamples": [
  953. {
  954. "lang": "js",
  955. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tool.ids({\n ...\n})"
  956. }
  957. ]
  958. }
  959. },
  960. "/experimental/worktree": {
  961. "get": {
  962. "tags": ["experimental"],
  963. "operationId": "worktree.list",
  964. "parameters": [
  965. {
  966. "name": "directory",
  967. "in": "query",
  968. "required": false,
  969. "schema": {
  970. "type": "string"
  971. }
  972. },
  973. {
  974. "name": "workspace",
  975. "in": "query",
  976. "required": false,
  977. "schema": {
  978. "type": "string"
  979. }
  980. }
  981. ],
  982. "responses": {
  983. "200": {
  984. "description": "List of worktree directories",
  985. "content": {
  986. "application/json": {
  987. "schema": {
  988. "type": "array",
  989. "items": {
  990. "type": "string"
  991. },
  992. "description": "List of worktree directories"
  993. }
  994. }
  995. }
  996. }
  997. },
  998. "description": "List all sandbox worktrees for the current project.",
  999. "summary": "List worktrees",
  1000. "x-codeSamples": [
  1001. {
  1002. "lang": "js",
  1003. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.list({\n ...\n})"
  1004. }
  1005. ]
  1006. },
  1007. "post": {
  1008. "tags": ["experimental"],
  1009. "operationId": "worktree.create",
  1010. "parameters": [
  1011. {
  1012. "name": "directory",
  1013. "in": "query",
  1014. "required": false,
  1015. "schema": {
  1016. "type": "string"
  1017. }
  1018. },
  1019. {
  1020. "name": "workspace",
  1021. "in": "query",
  1022. "required": false,
  1023. "schema": {
  1024. "type": "string"
  1025. }
  1026. }
  1027. ],
  1028. "responses": {
  1029. "200": {
  1030. "description": "Worktree created",
  1031. "content": {
  1032. "application/json": {
  1033. "schema": {
  1034. "$ref": "#/components/schemas/Worktree"
  1035. }
  1036. }
  1037. }
  1038. },
  1039. "400": {
  1040. "description": "Bad request",
  1041. "content": {
  1042. "application/json": {
  1043. "schema": {
  1044. "$ref": "#/components/schemas/BadRequestError"
  1045. }
  1046. }
  1047. }
  1048. }
  1049. },
  1050. "description": "Create a new git worktree for the current project and run any configured startup scripts.",
  1051. "summary": "Create worktree",
  1052. "requestBody": {
  1053. "content": {
  1054. "application/json": {
  1055. "schema": {
  1056. "$ref": "#/components/schemas/WorktreeCreateInput"
  1057. }
  1058. }
  1059. }
  1060. },
  1061. "x-codeSamples": [
  1062. {
  1063. "lang": "js",
  1064. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.create({\n ...\n})"
  1065. }
  1066. ]
  1067. },
  1068. "delete": {
  1069. "tags": ["experimental"],
  1070. "operationId": "worktree.remove",
  1071. "parameters": [
  1072. {
  1073. "name": "directory",
  1074. "in": "query",
  1075. "required": false,
  1076. "schema": {
  1077. "type": "string"
  1078. }
  1079. },
  1080. {
  1081. "name": "workspace",
  1082. "in": "query",
  1083. "required": false,
  1084. "schema": {
  1085. "type": "string"
  1086. }
  1087. }
  1088. ],
  1089. "responses": {
  1090. "200": {
  1091. "description": "Worktree removed",
  1092. "content": {
  1093. "application/json": {
  1094. "schema": {
  1095. "type": "boolean",
  1096. "description": "Worktree removed"
  1097. }
  1098. }
  1099. }
  1100. },
  1101. "400": {
  1102. "description": "Bad request",
  1103. "content": {
  1104. "application/json": {
  1105. "schema": {
  1106. "$ref": "#/components/schemas/BadRequestError"
  1107. }
  1108. }
  1109. }
  1110. }
  1111. },
  1112. "description": "Remove a git worktree and delete its branch.",
  1113. "summary": "Remove worktree",
  1114. "requestBody": {
  1115. "content": {
  1116. "application/json": {
  1117. "schema": {
  1118. "$ref": "#/components/schemas/WorktreeRemoveInput"
  1119. }
  1120. }
  1121. }
  1122. },
  1123. "x-codeSamples": [
  1124. {
  1125. "lang": "js",
  1126. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.remove({\n ...\n})"
  1127. }
  1128. ]
  1129. }
  1130. },
  1131. "/experimental/worktree/reset": {
  1132. "post": {
  1133. "tags": ["experimental"],
  1134. "operationId": "worktree.reset",
  1135. "parameters": [
  1136. {
  1137. "name": "directory",
  1138. "in": "query",
  1139. "required": false,
  1140. "schema": {
  1141. "type": "string"
  1142. }
  1143. },
  1144. {
  1145. "name": "workspace",
  1146. "in": "query",
  1147. "required": false,
  1148. "schema": {
  1149. "type": "string"
  1150. }
  1151. }
  1152. ],
  1153. "responses": {
  1154. "200": {
  1155. "description": "Worktree reset",
  1156. "content": {
  1157. "application/json": {
  1158. "schema": {
  1159. "type": "boolean",
  1160. "description": "Worktree reset"
  1161. }
  1162. }
  1163. }
  1164. },
  1165. "400": {
  1166. "description": "Bad request",
  1167. "content": {
  1168. "application/json": {
  1169. "schema": {
  1170. "$ref": "#/components/schemas/BadRequestError"
  1171. }
  1172. }
  1173. }
  1174. }
  1175. },
  1176. "description": "Reset a worktree branch to the primary default branch.",
  1177. "summary": "Reset worktree",
  1178. "requestBody": {
  1179. "content": {
  1180. "application/json": {
  1181. "schema": {
  1182. "$ref": "#/components/schemas/WorktreeResetInput"
  1183. }
  1184. }
  1185. }
  1186. },
  1187. "x-codeSamples": [
  1188. {
  1189. "lang": "js",
  1190. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.reset({\n ...\n})"
  1191. }
  1192. ]
  1193. }
  1194. },
  1195. "/experimental/session": {
  1196. "get": {
  1197. "tags": ["experimental"],
  1198. "operationId": "experimental.session.list",
  1199. "parameters": [
  1200. {
  1201. "name": "directory",
  1202. "in": "query",
  1203. "required": false,
  1204. "schema": {
  1205. "type": "string"
  1206. }
  1207. },
  1208. {
  1209. "name": "workspace",
  1210. "in": "query",
  1211. "required": false,
  1212. "schema": {
  1213. "type": "string"
  1214. }
  1215. },
  1216. {
  1217. "name": "roots",
  1218. "in": "query",
  1219. "schema": {
  1220. "anyOf": [
  1221. {
  1222. "type": "boolean"
  1223. },
  1224. {
  1225. "type": "string",
  1226. "enum": ["true", "false"]
  1227. }
  1228. ]
  1229. },
  1230. "required": false
  1231. },
  1232. {
  1233. "name": "start",
  1234. "in": "query",
  1235. "schema": {
  1236. "type": "number"
  1237. },
  1238. "required": false
  1239. },
  1240. {
  1241. "name": "cursor",
  1242. "in": "query",
  1243. "schema": {
  1244. "type": "number"
  1245. },
  1246. "required": false
  1247. },
  1248. {
  1249. "name": "search",
  1250. "in": "query",
  1251. "schema": {
  1252. "type": "string"
  1253. },
  1254. "required": false
  1255. },
  1256. {
  1257. "name": "limit",
  1258. "in": "query",
  1259. "schema": {
  1260. "type": "number"
  1261. },
  1262. "required": false
  1263. },
  1264. {
  1265. "name": "archived",
  1266. "in": "query",
  1267. "schema": {
  1268. "anyOf": [
  1269. {
  1270. "type": "boolean"
  1271. },
  1272. {
  1273. "type": "string",
  1274. "enum": ["true", "false"]
  1275. }
  1276. ]
  1277. },
  1278. "required": false
  1279. }
  1280. ],
  1281. "responses": {
  1282. "200": {
  1283. "description": "List of sessions",
  1284. "content": {
  1285. "application/json": {
  1286. "schema": {
  1287. "type": "array",
  1288. "items": {
  1289. "$ref": "#/components/schemas/GlobalSession"
  1290. },
  1291. "description": "List of sessions"
  1292. }
  1293. }
  1294. }
  1295. }
  1296. },
  1297. "description": "Get a list of all OpenCode sessions across projects, sorted by most recently updated. Archived sessions are excluded by default.",
  1298. "summary": "List sessions",
  1299. "x-codeSamples": [
  1300. {
  1301. "lang": "js",
  1302. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.session.list({\n ...\n})"
  1303. }
  1304. ]
  1305. }
  1306. },
  1307. "/experimental/resource": {
  1308. "get": {
  1309. "tags": ["experimental"],
  1310. "operationId": "experimental.resource.list",
  1311. "parameters": [
  1312. {
  1313. "name": "directory",
  1314. "in": "query",
  1315. "required": false,
  1316. "schema": {
  1317. "type": "string"
  1318. }
  1319. },
  1320. {
  1321. "name": "workspace",
  1322. "in": "query",
  1323. "required": false,
  1324. "schema": {
  1325. "type": "string"
  1326. }
  1327. }
  1328. ],
  1329. "responses": {
  1330. "200": {
  1331. "description": "MCP resources",
  1332. "content": {
  1333. "application/json": {
  1334. "schema": {
  1335. "type": "object",
  1336. "additionalProperties": {
  1337. "$ref": "#/components/schemas/McpResource"
  1338. },
  1339. "description": "MCP resources"
  1340. }
  1341. }
  1342. }
  1343. }
  1344. },
  1345. "description": "Get all available MCP resources from connected servers. Optionally filter by name.",
  1346. "summary": "Get MCP resources",
  1347. "x-codeSamples": [
  1348. {
  1349. "lang": "js",
  1350. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.resource.list({\n ...\n})"
  1351. }
  1352. ]
  1353. }
  1354. },
  1355. "/find": {
  1356. "get": {
  1357. "tags": ["file"],
  1358. "operationId": "find.text",
  1359. "parameters": [
  1360. {
  1361. "name": "directory",
  1362. "in": "query",
  1363. "required": false,
  1364. "schema": {
  1365. "type": "string"
  1366. }
  1367. },
  1368. {
  1369. "name": "workspace",
  1370. "in": "query",
  1371. "required": false,
  1372. "schema": {
  1373. "type": "string"
  1374. }
  1375. },
  1376. {
  1377. "name": "pattern",
  1378. "in": "query",
  1379. "schema": {
  1380. "type": "string"
  1381. },
  1382. "required": true
  1383. }
  1384. ],
  1385. "responses": {
  1386. "200": {
  1387. "description": "Matches",
  1388. "content": {
  1389. "application/json": {
  1390. "schema": {
  1391. "type": "array",
  1392. "items": {
  1393. "type": "object",
  1394. "properties": {
  1395. "path": {
  1396. "type": "object",
  1397. "properties": {
  1398. "text": {
  1399. "type": "string"
  1400. }
  1401. },
  1402. "required": ["text"],
  1403. "additionalProperties": false
  1404. },
  1405. "lines": {
  1406. "type": "object",
  1407. "properties": {
  1408. "text": {
  1409. "type": "string"
  1410. }
  1411. },
  1412. "required": ["text"],
  1413. "additionalProperties": false
  1414. },
  1415. "line_number": {
  1416. "type": "integer",
  1417. "minimum": 0
  1418. },
  1419. "absolute_offset": {
  1420. "type": "integer",
  1421. "minimum": 0
  1422. },
  1423. "submatches": {
  1424. "type": "array",
  1425. "items": {
  1426. "type": "object",
  1427. "properties": {
  1428. "match": {
  1429. "type": "object",
  1430. "properties": {
  1431. "text": {
  1432. "type": "string"
  1433. }
  1434. },
  1435. "required": ["text"],
  1436. "additionalProperties": false
  1437. },
  1438. "start": {
  1439. "type": "integer",
  1440. "minimum": 0
  1441. },
  1442. "end": {
  1443. "type": "integer",
  1444. "minimum": 0
  1445. }
  1446. },
  1447. "required": ["match", "start", "end"],
  1448. "additionalProperties": false
  1449. }
  1450. }
  1451. },
  1452. "required": ["path", "lines", "line_number", "absolute_offset", "submatches"],
  1453. "additionalProperties": false
  1454. },
  1455. "description": "Matches"
  1456. }
  1457. }
  1458. }
  1459. }
  1460. },
  1461. "description": "Search for text patterns across files in the project using ripgrep.",
  1462. "summary": "Find text",
  1463. "x-codeSamples": [
  1464. {
  1465. "lang": "js",
  1466. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.find.text({\n ...\n})"
  1467. }
  1468. ]
  1469. }
  1470. },
  1471. "/find/file": {
  1472. "get": {
  1473. "tags": ["file"],
  1474. "operationId": "find.files",
  1475. "parameters": [
  1476. {
  1477. "name": "directory",
  1478. "in": "query",
  1479. "required": false,
  1480. "schema": {
  1481. "type": "string"
  1482. }
  1483. },
  1484. {
  1485. "name": "workspace",
  1486. "in": "query",
  1487. "required": false,
  1488. "schema": {
  1489. "type": "string"
  1490. }
  1491. },
  1492. {
  1493. "name": "query",
  1494. "in": "query",
  1495. "schema": {
  1496. "type": "string"
  1497. },
  1498. "required": true
  1499. },
  1500. {
  1501. "name": "dirs",
  1502. "in": "query",
  1503. "schema": {
  1504. "type": "string",
  1505. "enum": ["true", "false"]
  1506. },
  1507. "required": false
  1508. },
  1509. {
  1510. "name": "type",
  1511. "in": "query",
  1512. "schema": {
  1513. "type": "string",
  1514. "enum": ["file", "directory"]
  1515. },
  1516. "required": false
  1517. },
  1518. {
  1519. "name": "limit",
  1520. "in": "query",
  1521. "schema": {
  1522. "type": "integer",
  1523. "minimum": 1,
  1524. "maximum": 200
  1525. },
  1526. "required": false
  1527. }
  1528. ],
  1529. "responses": {
  1530. "200": {
  1531. "description": "File paths",
  1532. "content": {
  1533. "application/json": {
  1534. "schema": {
  1535. "type": "array",
  1536. "items": {
  1537. "type": "string"
  1538. },
  1539. "description": "File paths"
  1540. }
  1541. }
  1542. }
  1543. }
  1544. },
  1545. "description": "Search for files or directories by name or pattern in the project directory.",
  1546. "summary": "Find files",
  1547. "x-codeSamples": [
  1548. {
  1549. "lang": "js",
  1550. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.find.files({\n ...\n})"
  1551. }
  1552. ]
  1553. }
  1554. },
  1555. "/find/symbol": {
  1556. "get": {
  1557. "tags": ["file"],
  1558. "operationId": "find.symbols",
  1559. "parameters": [
  1560. {
  1561. "name": "directory",
  1562. "in": "query",
  1563. "required": false,
  1564. "schema": {
  1565. "type": "string"
  1566. }
  1567. },
  1568. {
  1569. "name": "workspace",
  1570. "in": "query",
  1571. "required": false,
  1572. "schema": {
  1573. "type": "string"
  1574. }
  1575. },
  1576. {
  1577. "name": "query",
  1578. "in": "query",
  1579. "schema": {
  1580. "type": "string"
  1581. },
  1582. "required": true
  1583. }
  1584. ],
  1585. "responses": {
  1586. "200": {
  1587. "description": "Symbols",
  1588. "content": {
  1589. "application/json": {
  1590. "schema": {
  1591. "type": "array",
  1592. "items": {
  1593. "$ref": "#/components/schemas/Symbol"
  1594. },
  1595. "description": "Symbols"
  1596. }
  1597. }
  1598. }
  1599. }
  1600. },
  1601. "description": "Search for workspace symbols like functions, classes, and variables using LSP.",
  1602. "summary": "Find symbols",
  1603. "x-codeSamples": [
  1604. {
  1605. "lang": "js",
  1606. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.find.symbols({\n ...\n})"
  1607. }
  1608. ]
  1609. }
  1610. },
  1611. "/file": {
  1612. "get": {
  1613. "tags": ["file"],
  1614. "operationId": "file.list",
  1615. "parameters": [
  1616. {
  1617. "name": "directory",
  1618. "in": "query",
  1619. "required": false,
  1620. "schema": {
  1621. "type": "string"
  1622. }
  1623. },
  1624. {
  1625. "name": "workspace",
  1626. "in": "query",
  1627. "required": false,
  1628. "schema": {
  1629. "type": "string"
  1630. }
  1631. },
  1632. {
  1633. "name": "path",
  1634. "in": "query",
  1635. "schema": {
  1636. "type": "string"
  1637. },
  1638. "required": true
  1639. }
  1640. ],
  1641. "responses": {
  1642. "200": {
  1643. "description": "Files and directories",
  1644. "content": {
  1645. "application/json": {
  1646. "schema": {
  1647. "type": "array",
  1648. "items": {
  1649. "$ref": "#/components/schemas/FileNode"
  1650. },
  1651. "description": "Files and directories"
  1652. }
  1653. }
  1654. }
  1655. }
  1656. },
  1657. "description": "List files and directories in a specified path.",
  1658. "summary": "List files",
  1659. "x-codeSamples": [
  1660. {
  1661. "lang": "js",
  1662. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.file.list({\n ...\n})"
  1663. }
  1664. ]
  1665. }
  1666. },
  1667. "/file/content": {
  1668. "get": {
  1669. "tags": ["file"],
  1670. "operationId": "file.read",
  1671. "parameters": [
  1672. {
  1673. "name": "directory",
  1674. "in": "query",
  1675. "required": false,
  1676. "schema": {
  1677. "type": "string"
  1678. }
  1679. },
  1680. {
  1681. "name": "workspace",
  1682. "in": "query",
  1683. "required": false,
  1684. "schema": {
  1685. "type": "string"
  1686. }
  1687. },
  1688. {
  1689. "name": "path",
  1690. "in": "query",
  1691. "schema": {
  1692. "type": "string"
  1693. },
  1694. "required": true
  1695. }
  1696. ],
  1697. "responses": {
  1698. "200": {
  1699. "description": "File content",
  1700. "content": {
  1701. "application/json": {
  1702. "schema": {
  1703. "$ref": "#/components/schemas/FileContent"
  1704. }
  1705. }
  1706. }
  1707. }
  1708. },
  1709. "description": "Read the content of a specified file.",
  1710. "summary": "Read file",
  1711. "x-codeSamples": [
  1712. {
  1713. "lang": "js",
  1714. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.file.read({\n ...\n})"
  1715. }
  1716. ]
  1717. }
  1718. },
  1719. "/file/status": {
  1720. "get": {
  1721. "tags": ["file"],
  1722. "operationId": "file.status",
  1723. "parameters": [
  1724. {
  1725. "name": "directory",
  1726. "in": "query",
  1727. "required": false,
  1728. "schema": {
  1729. "type": "string"
  1730. }
  1731. },
  1732. {
  1733. "name": "workspace",
  1734. "in": "query",
  1735. "required": false,
  1736. "schema": {
  1737. "type": "string"
  1738. }
  1739. }
  1740. ],
  1741. "responses": {
  1742. "200": {
  1743. "description": "File status",
  1744. "content": {
  1745. "application/json": {
  1746. "schema": {
  1747. "type": "array",
  1748. "items": {
  1749. "$ref": "#/components/schemas/File"
  1750. },
  1751. "description": "File status"
  1752. }
  1753. }
  1754. }
  1755. }
  1756. },
  1757. "description": "Get the git status of all files in the project.",
  1758. "summary": "Get file status",
  1759. "x-codeSamples": [
  1760. {
  1761. "lang": "js",
  1762. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.file.status({\n ...\n})"
  1763. }
  1764. ]
  1765. }
  1766. },
  1767. "/instance/dispose": {
  1768. "post": {
  1769. "tags": ["instance"],
  1770. "operationId": "instance.dispose",
  1771. "parameters": [
  1772. {
  1773. "name": "directory",
  1774. "in": "query",
  1775. "required": false,
  1776. "schema": {
  1777. "type": "string"
  1778. }
  1779. },
  1780. {
  1781. "name": "workspace",
  1782. "in": "query",
  1783. "required": false,
  1784. "schema": {
  1785. "type": "string"
  1786. }
  1787. }
  1788. ],
  1789. "responses": {
  1790. "200": {
  1791. "description": "Instance disposed",
  1792. "content": {
  1793. "application/json": {
  1794. "schema": {
  1795. "type": "boolean",
  1796. "description": "Instance disposed"
  1797. }
  1798. }
  1799. }
  1800. }
  1801. },
  1802. "description": "Clean up and dispose the current OpenCode instance, releasing all resources.",
  1803. "summary": "Dispose instance",
  1804. "x-codeSamples": [
  1805. {
  1806. "lang": "js",
  1807. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.instance.dispose({\n ...\n})"
  1808. }
  1809. ]
  1810. }
  1811. },
  1812. "/path": {
  1813. "get": {
  1814. "tags": ["instance"],
  1815. "operationId": "path.get",
  1816. "parameters": [
  1817. {
  1818. "name": "directory",
  1819. "in": "query",
  1820. "required": false,
  1821. "schema": {
  1822. "type": "string"
  1823. }
  1824. },
  1825. {
  1826. "name": "workspace",
  1827. "in": "query",
  1828. "required": false,
  1829. "schema": {
  1830. "type": "string"
  1831. }
  1832. }
  1833. ],
  1834. "responses": {
  1835. "200": {
  1836. "description": "Path",
  1837. "content": {
  1838. "application/json": {
  1839. "schema": {
  1840. "$ref": "#/components/schemas/Path"
  1841. }
  1842. }
  1843. }
  1844. }
  1845. },
  1846. "description": "Retrieve the current working directory and related path information for the OpenCode instance.",
  1847. "summary": "Get paths",
  1848. "x-codeSamples": [
  1849. {
  1850. "lang": "js",
  1851. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.path.get({\n ...\n})"
  1852. }
  1853. ]
  1854. }
  1855. },
  1856. "/vcs": {
  1857. "get": {
  1858. "tags": ["instance"],
  1859. "operationId": "vcs.get",
  1860. "parameters": [
  1861. {
  1862. "name": "directory",
  1863. "in": "query",
  1864. "required": false,
  1865. "schema": {
  1866. "type": "string"
  1867. }
  1868. },
  1869. {
  1870. "name": "workspace",
  1871. "in": "query",
  1872. "required": false,
  1873. "schema": {
  1874. "type": "string"
  1875. }
  1876. }
  1877. ],
  1878. "responses": {
  1879. "200": {
  1880. "description": "VCS info",
  1881. "content": {
  1882. "application/json": {
  1883. "schema": {
  1884. "$ref": "#/components/schemas/VcsInfo"
  1885. }
  1886. }
  1887. }
  1888. }
  1889. },
  1890. "description": "Retrieve version control system (VCS) information for the current project, such as git branch.",
  1891. "summary": "Get VCS info",
  1892. "x-codeSamples": [
  1893. {
  1894. "lang": "js",
  1895. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.vcs.get({\n ...\n})"
  1896. }
  1897. ]
  1898. }
  1899. },
  1900. "/vcs/diff": {
  1901. "get": {
  1902. "tags": ["instance"],
  1903. "operationId": "vcs.diff",
  1904. "parameters": [
  1905. {
  1906. "name": "directory",
  1907. "in": "query",
  1908. "required": false,
  1909. "schema": {
  1910. "type": "string"
  1911. }
  1912. },
  1913. {
  1914. "name": "workspace",
  1915. "in": "query",
  1916. "required": false,
  1917. "schema": {
  1918. "type": "string"
  1919. }
  1920. },
  1921. {
  1922. "name": "mode",
  1923. "in": "query",
  1924. "schema": {
  1925. "type": "string",
  1926. "enum": ["git", "branch"]
  1927. },
  1928. "required": true
  1929. }
  1930. ],
  1931. "responses": {
  1932. "200": {
  1933. "description": "VCS diff",
  1934. "content": {
  1935. "application/json": {
  1936. "schema": {
  1937. "type": "array",
  1938. "items": {
  1939. "$ref": "#/components/schemas/VcsFileDiff"
  1940. },
  1941. "description": "VCS diff"
  1942. }
  1943. }
  1944. }
  1945. }
  1946. },
  1947. "description": "Retrieve the current git diff for the working tree or against the default branch.",
  1948. "summary": "Get VCS diff",
  1949. "x-codeSamples": [
  1950. {
  1951. "lang": "js",
  1952. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.vcs.diff({\n ...\n})"
  1953. }
  1954. ]
  1955. }
  1956. },
  1957. "/command": {
  1958. "get": {
  1959. "tags": ["instance"],
  1960. "operationId": "command.list",
  1961. "parameters": [
  1962. {
  1963. "name": "directory",
  1964. "in": "query",
  1965. "required": false,
  1966. "schema": {
  1967. "type": "string"
  1968. }
  1969. },
  1970. {
  1971. "name": "workspace",
  1972. "in": "query",
  1973. "required": false,
  1974. "schema": {
  1975. "type": "string"
  1976. }
  1977. }
  1978. ],
  1979. "responses": {
  1980. "200": {
  1981. "description": "List of commands",
  1982. "content": {
  1983. "application/json": {
  1984. "schema": {
  1985. "type": "array",
  1986. "items": {
  1987. "$ref": "#/components/schemas/Command"
  1988. },
  1989. "description": "List of commands"
  1990. }
  1991. }
  1992. }
  1993. }
  1994. },
  1995. "description": "Get a list of all available commands in the OpenCode system.",
  1996. "summary": "List commands",
  1997. "x-codeSamples": [
  1998. {
  1999. "lang": "js",
  2000. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.command.list({\n ...\n})"
  2001. }
  2002. ]
  2003. }
  2004. },
  2005. "/agent": {
  2006. "get": {
  2007. "tags": ["instance"],
  2008. "operationId": "app.agents",
  2009. "parameters": [
  2010. {
  2011. "name": "directory",
  2012. "in": "query",
  2013. "required": false,
  2014. "schema": {
  2015. "type": "string"
  2016. }
  2017. },
  2018. {
  2019. "name": "workspace",
  2020. "in": "query",
  2021. "required": false,
  2022. "schema": {
  2023. "type": "string"
  2024. }
  2025. }
  2026. ],
  2027. "responses": {
  2028. "200": {
  2029. "description": "List of agents",
  2030. "content": {
  2031. "application/json": {
  2032. "schema": {
  2033. "type": "array",
  2034. "items": {
  2035. "$ref": "#/components/schemas/Agent"
  2036. },
  2037. "description": "List of agents"
  2038. }
  2039. }
  2040. }
  2041. }
  2042. },
  2043. "description": "Get a list of all available AI agents in the OpenCode system.",
  2044. "summary": "List agents",
  2045. "x-codeSamples": [
  2046. {
  2047. "lang": "js",
  2048. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.app.agents({\n ...\n})"
  2049. }
  2050. ]
  2051. }
  2052. },
  2053. "/skill": {
  2054. "get": {
  2055. "tags": ["instance"],
  2056. "operationId": "app.skills",
  2057. "parameters": [
  2058. {
  2059. "name": "directory",
  2060. "in": "query",
  2061. "required": false,
  2062. "schema": {
  2063. "type": "string"
  2064. }
  2065. },
  2066. {
  2067. "name": "workspace",
  2068. "in": "query",
  2069. "required": false,
  2070. "schema": {
  2071. "type": "string"
  2072. }
  2073. }
  2074. ],
  2075. "responses": {
  2076. "200": {
  2077. "description": "List of skills",
  2078. "content": {
  2079. "application/json": {
  2080. "schema": {
  2081. "type": "array",
  2082. "items": {
  2083. "type": "object",
  2084. "properties": {
  2085. "name": {
  2086. "type": "string"
  2087. },
  2088. "description": {
  2089. "type": "string"
  2090. },
  2091. "location": {
  2092. "type": "string"
  2093. },
  2094. "content": {
  2095. "type": "string"
  2096. }
  2097. },
  2098. "required": ["name", "description", "location", "content"],
  2099. "additionalProperties": false
  2100. },
  2101. "description": "List of skills"
  2102. }
  2103. }
  2104. }
  2105. }
  2106. },
  2107. "description": "Get a list of all available skills in the OpenCode system.",
  2108. "summary": "List skills",
  2109. "x-codeSamples": [
  2110. {
  2111. "lang": "js",
  2112. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.app.skills({\n ...\n})"
  2113. }
  2114. ]
  2115. }
  2116. },
  2117. "/lsp": {
  2118. "get": {
  2119. "tags": ["instance"],
  2120. "operationId": "lsp.status",
  2121. "parameters": [
  2122. {
  2123. "name": "directory",
  2124. "in": "query",
  2125. "required": false,
  2126. "schema": {
  2127. "type": "string"
  2128. }
  2129. },
  2130. {
  2131. "name": "workspace",
  2132. "in": "query",
  2133. "required": false,
  2134. "schema": {
  2135. "type": "string"
  2136. }
  2137. }
  2138. ],
  2139. "responses": {
  2140. "200": {
  2141. "description": "LSP server status",
  2142. "content": {
  2143. "application/json": {
  2144. "schema": {
  2145. "type": "array",
  2146. "items": {
  2147. "$ref": "#/components/schemas/LSPStatus"
  2148. },
  2149. "description": "LSP server status"
  2150. }
  2151. }
  2152. }
  2153. }
  2154. },
  2155. "description": "Get LSP server status",
  2156. "summary": "Get LSP status",
  2157. "x-codeSamples": [
  2158. {
  2159. "lang": "js",
  2160. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.lsp.status({\n ...\n})"
  2161. }
  2162. ]
  2163. }
  2164. },
  2165. "/formatter": {
  2166. "get": {
  2167. "tags": ["instance"],
  2168. "operationId": "formatter.status",
  2169. "parameters": [
  2170. {
  2171. "name": "directory",
  2172. "in": "query",
  2173. "required": false,
  2174. "schema": {
  2175. "type": "string"
  2176. }
  2177. },
  2178. {
  2179. "name": "workspace",
  2180. "in": "query",
  2181. "required": false,
  2182. "schema": {
  2183. "type": "string"
  2184. }
  2185. }
  2186. ],
  2187. "responses": {
  2188. "200": {
  2189. "description": "Formatter status",
  2190. "content": {
  2191. "application/json": {
  2192. "schema": {
  2193. "type": "array",
  2194. "items": {
  2195. "$ref": "#/components/schemas/FormatterStatus"
  2196. },
  2197. "description": "Formatter status"
  2198. }
  2199. }
  2200. }
  2201. }
  2202. },
  2203. "description": "Get formatter status",
  2204. "summary": "Get formatter status",
  2205. "x-codeSamples": [
  2206. {
  2207. "lang": "js",
  2208. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.formatter.status({\n ...\n})"
  2209. }
  2210. ]
  2211. }
  2212. },
  2213. "/mcp": {
  2214. "get": {
  2215. "tags": ["mcp"],
  2216. "operationId": "mcp.status",
  2217. "parameters": [
  2218. {
  2219. "name": "directory",
  2220. "in": "query",
  2221. "required": false,
  2222. "schema": {
  2223. "type": "string"
  2224. }
  2225. },
  2226. {
  2227. "name": "workspace",
  2228. "in": "query",
  2229. "required": false,
  2230. "schema": {
  2231. "type": "string"
  2232. }
  2233. }
  2234. ],
  2235. "responses": {
  2236. "200": {
  2237. "description": "MCP server status",
  2238. "content": {
  2239. "application/json": {
  2240. "schema": {
  2241. "type": "object",
  2242. "additionalProperties": {
  2243. "$ref": "#/components/schemas/MCPStatus"
  2244. },
  2245. "description": "MCP server status"
  2246. }
  2247. }
  2248. }
  2249. }
  2250. },
  2251. "description": "Get the status of all Model Context Protocol (MCP) servers.",
  2252. "summary": "Get MCP status",
  2253. "x-codeSamples": [
  2254. {
  2255. "lang": "js",
  2256. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.status({\n ...\n})"
  2257. }
  2258. ]
  2259. },
  2260. "post": {
  2261. "tags": ["mcp"],
  2262. "operationId": "mcp.add",
  2263. "parameters": [
  2264. {
  2265. "name": "directory",
  2266. "in": "query",
  2267. "required": false,
  2268. "schema": {
  2269. "type": "string"
  2270. }
  2271. },
  2272. {
  2273. "name": "workspace",
  2274. "in": "query",
  2275. "required": false,
  2276. "schema": {
  2277. "type": "string"
  2278. }
  2279. }
  2280. ],
  2281. "responses": {
  2282. "200": {
  2283. "description": "MCP server added successfully",
  2284. "content": {
  2285. "application/json": {
  2286. "schema": {
  2287. "type": "object",
  2288. "additionalProperties": {
  2289. "$ref": "#/components/schemas/MCPStatus"
  2290. },
  2291. "description": "MCP server added successfully"
  2292. }
  2293. }
  2294. }
  2295. },
  2296. "400": {
  2297. "description": "Bad request",
  2298. "content": {
  2299. "application/json": {
  2300. "schema": {
  2301. "$ref": "#/components/schemas/BadRequestError"
  2302. }
  2303. }
  2304. }
  2305. }
  2306. },
  2307. "description": "Dynamically add a new Model Context Protocol (MCP) server to the system.",
  2308. "summary": "Add MCP server",
  2309. "requestBody": {
  2310. "content": {
  2311. "application/json": {
  2312. "schema": {
  2313. "type": "object",
  2314. "properties": {
  2315. "name": {
  2316. "type": "string"
  2317. },
  2318. "config": {
  2319. "anyOf": [
  2320. {
  2321. "$ref": "#/components/schemas/McpLocalConfig"
  2322. },
  2323. {
  2324. "$ref": "#/components/schemas/McpRemoteConfig"
  2325. }
  2326. ]
  2327. }
  2328. },
  2329. "required": ["name", "config"],
  2330. "additionalProperties": false
  2331. }
  2332. }
  2333. }
  2334. },
  2335. "x-codeSamples": [
  2336. {
  2337. "lang": "js",
  2338. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.add({\n ...\n})"
  2339. }
  2340. ]
  2341. }
  2342. },
  2343. "/mcp/{name}/auth": {
  2344. "post": {
  2345. "tags": ["mcp"],
  2346. "operationId": "mcp.auth.start",
  2347. "parameters": [
  2348. {
  2349. "name": "directory",
  2350. "in": "query",
  2351. "required": false,
  2352. "schema": {
  2353. "type": "string"
  2354. }
  2355. },
  2356. {
  2357. "name": "workspace",
  2358. "in": "query",
  2359. "required": false,
  2360. "schema": {
  2361. "type": "string"
  2362. }
  2363. },
  2364. {
  2365. "name": "name",
  2366. "in": "path",
  2367. "schema": {
  2368. "type": "string"
  2369. },
  2370. "required": true
  2371. }
  2372. ],
  2373. "responses": {
  2374. "200": {
  2375. "description": "OAuth flow started",
  2376. "content": {
  2377. "application/json": {
  2378. "schema": {
  2379. "type": "object",
  2380. "properties": {
  2381. "authorizationUrl": {
  2382. "type": "string"
  2383. },
  2384. "oauthState": {
  2385. "type": "string"
  2386. }
  2387. },
  2388. "required": ["authorizationUrl", "oauthState"],
  2389. "additionalProperties": false,
  2390. "description": "OAuth flow started"
  2391. }
  2392. }
  2393. }
  2394. },
  2395. "400": {
  2396. "description": "McpUnsupportedOAuthError",
  2397. "content": {
  2398. "application/json": {
  2399. "schema": {
  2400. "$ref": "#/components/schemas/McpUnsupportedOAuthError"
  2401. }
  2402. }
  2403. }
  2404. },
  2405. "404": {
  2406. "description": "Not found",
  2407. "content": {
  2408. "application/json": {
  2409. "schema": {
  2410. "$ref": "#/components/schemas/NotFoundError"
  2411. }
  2412. }
  2413. }
  2414. }
  2415. },
  2416. "description": "Start OAuth authentication flow for a Model Context Protocol (MCP) server.",
  2417. "summary": "Start MCP OAuth",
  2418. "x-codeSamples": [
  2419. {
  2420. "lang": "js",
  2421. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.start({\n ...\n})"
  2422. }
  2423. ]
  2424. },
  2425. "delete": {
  2426. "tags": ["mcp"],
  2427. "operationId": "mcp.auth.remove",
  2428. "parameters": [
  2429. {
  2430. "name": "directory",
  2431. "in": "query",
  2432. "required": false,
  2433. "schema": {
  2434. "type": "string"
  2435. }
  2436. },
  2437. {
  2438. "name": "workspace",
  2439. "in": "query",
  2440. "required": false,
  2441. "schema": {
  2442. "type": "string"
  2443. }
  2444. },
  2445. {
  2446. "name": "name",
  2447. "in": "path",
  2448. "schema": {
  2449. "type": "string"
  2450. },
  2451. "required": true
  2452. }
  2453. ],
  2454. "responses": {
  2455. "200": {
  2456. "description": "OAuth credentials removed",
  2457. "content": {
  2458. "application/json": {
  2459. "schema": {
  2460. "type": "object",
  2461. "properties": {
  2462. "success": {
  2463. "type": "boolean",
  2464. "enum": [true]
  2465. }
  2466. },
  2467. "required": ["success"],
  2468. "additionalProperties": false,
  2469. "description": "OAuth credentials removed"
  2470. }
  2471. }
  2472. }
  2473. },
  2474. "404": {
  2475. "description": "Not found",
  2476. "content": {
  2477. "application/json": {
  2478. "schema": {
  2479. "$ref": "#/components/schemas/NotFoundError"
  2480. }
  2481. }
  2482. }
  2483. }
  2484. },
  2485. "description": "Remove OAuth credentials for an MCP server.",
  2486. "summary": "Remove MCP OAuth",
  2487. "x-codeSamples": [
  2488. {
  2489. "lang": "js",
  2490. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.remove({\n ...\n})"
  2491. }
  2492. ]
  2493. }
  2494. },
  2495. "/mcp/{name}/auth/callback": {
  2496. "post": {
  2497. "tags": ["mcp"],
  2498. "operationId": "mcp.auth.callback",
  2499. "parameters": [
  2500. {
  2501. "name": "directory",
  2502. "in": "query",
  2503. "required": false,
  2504. "schema": {
  2505. "type": "string"
  2506. }
  2507. },
  2508. {
  2509. "name": "workspace",
  2510. "in": "query",
  2511. "required": false,
  2512. "schema": {
  2513. "type": "string"
  2514. }
  2515. },
  2516. {
  2517. "name": "name",
  2518. "in": "path",
  2519. "schema": {
  2520. "type": "string"
  2521. },
  2522. "required": true
  2523. }
  2524. ],
  2525. "responses": {
  2526. "200": {
  2527. "description": "OAuth authentication completed",
  2528. "content": {
  2529. "application/json": {
  2530. "schema": {
  2531. "$ref": "#/components/schemas/MCPStatus"
  2532. }
  2533. }
  2534. }
  2535. },
  2536. "400": {
  2537. "description": "Bad request",
  2538. "content": {
  2539. "application/json": {
  2540. "schema": {
  2541. "$ref": "#/components/schemas/BadRequestError"
  2542. }
  2543. }
  2544. }
  2545. },
  2546. "404": {
  2547. "description": "Not found",
  2548. "content": {
  2549. "application/json": {
  2550. "schema": {
  2551. "$ref": "#/components/schemas/NotFoundError"
  2552. }
  2553. }
  2554. }
  2555. }
  2556. },
  2557. "description": "Complete OAuth authentication for a Model Context Protocol (MCP) server using the authorization code.",
  2558. "summary": "Complete MCP OAuth",
  2559. "requestBody": {
  2560. "content": {
  2561. "application/json": {
  2562. "schema": {
  2563. "type": "object",
  2564. "properties": {
  2565. "code": {
  2566. "type": "string"
  2567. }
  2568. },
  2569. "required": ["code"],
  2570. "additionalProperties": false
  2571. }
  2572. }
  2573. }
  2574. },
  2575. "x-codeSamples": [
  2576. {
  2577. "lang": "js",
  2578. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.callback({\n ...\n})"
  2579. }
  2580. ]
  2581. }
  2582. },
  2583. "/mcp/{name}/auth/authenticate": {
  2584. "post": {
  2585. "tags": ["mcp"],
  2586. "operationId": "mcp.auth.authenticate",
  2587. "parameters": [
  2588. {
  2589. "name": "directory",
  2590. "in": "query",
  2591. "required": false,
  2592. "schema": {
  2593. "type": "string"
  2594. }
  2595. },
  2596. {
  2597. "name": "workspace",
  2598. "in": "query",
  2599. "required": false,
  2600. "schema": {
  2601. "type": "string"
  2602. }
  2603. },
  2604. {
  2605. "name": "name",
  2606. "in": "path",
  2607. "schema": {
  2608. "type": "string"
  2609. },
  2610. "required": true
  2611. }
  2612. ],
  2613. "responses": {
  2614. "200": {
  2615. "description": "OAuth authentication completed",
  2616. "content": {
  2617. "application/json": {
  2618. "schema": {
  2619. "$ref": "#/components/schemas/MCPStatus"
  2620. }
  2621. }
  2622. }
  2623. },
  2624. "400": {
  2625. "description": "McpUnsupportedOAuthError",
  2626. "content": {
  2627. "application/json": {
  2628. "schema": {
  2629. "$ref": "#/components/schemas/McpUnsupportedOAuthError"
  2630. }
  2631. }
  2632. }
  2633. },
  2634. "404": {
  2635. "description": "Not found",
  2636. "content": {
  2637. "application/json": {
  2638. "schema": {
  2639. "$ref": "#/components/schemas/NotFoundError"
  2640. }
  2641. }
  2642. }
  2643. }
  2644. },
  2645. "description": "Start OAuth flow and wait for callback (opens browser).",
  2646. "summary": "Authenticate MCP OAuth",
  2647. "x-codeSamples": [
  2648. {
  2649. "lang": "js",
  2650. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.authenticate({\n ...\n})"
  2651. }
  2652. ]
  2653. }
  2654. },
  2655. "/mcp/{name}/connect": {
  2656. "post": {
  2657. "tags": ["mcp"],
  2658. "operationId": "mcp.connect",
  2659. "parameters": [
  2660. {
  2661. "name": "directory",
  2662. "in": "query",
  2663. "required": false,
  2664. "schema": {
  2665. "type": "string"
  2666. }
  2667. },
  2668. {
  2669. "name": "workspace",
  2670. "in": "query",
  2671. "required": false,
  2672. "schema": {
  2673. "type": "string"
  2674. }
  2675. },
  2676. {
  2677. "name": "name",
  2678. "in": "path",
  2679. "schema": {
  2680. "type": "string"
  2681. },
  2682. "required": true
  2683. }
  2684. ],
  2685. "responses": {
  2686. "200": {
  2687. "description": "MCP server connected successfully",
  2688. "content": {
  2689. "application/json": {
  2690. "schema": {
  2691. "type": "boolean",
  2692. "description": "MCP server connected successfully"
  2693. }
  2694. }
  2695. }
  2696. }
  2697. },
  2698. "description": "Connect an MCP server.",
  2699. "x-codeSamples": [
  2700. {
  2701. "lang": "js",
  2702. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.connect({\n ...\n})"
  2703. }
  2704. ]
  2705. }
  2706. },
  2707. "/mcp/{name}/disconnect": {
  2708. "post": {
  2709. "tags": ["mcp"],
  2710. "operationId": "mcp.disconnect",
  2711. "parameters": [
  2712. {
  2713. "name": "directory",
  2714. "in": "query",
  2715. "required": false,
  2716. "schema": {
  2717. "type": "string"
  2718. }
  2719. },
  2720. {
  2721. "name": "workspace",
  2722. "in": "query",
  2723. "required": false,
  2724. "schema": {
  2725. "type": "string"
  2726. }
  2727. },
  2728. {
  2729. "name": "name",
  2730. "in": "path",
  2731. "schema": {
  2732. "type": "string"
  2733. },
  2734. "required": true
  2735. }
  2736. ],
  2737. "responses": {
  2738. "200": {
  2739. "description": "MCP server disconnected successfully",
  2740. "content": {
  2741. "application/json": {
  2742. "schema": {
  2743. "type": "boolean",
  2744. "description": "MCP server disconnected successfully"
  2745. }
  2746. }
  2747. }
  2748. }
  2749. },
  2750. "description": "Disconnect an MCP server.",
  2751. "x-codeSamples": [
  2752. {
  2753. "lang": "js",
  2754. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.disconnect({\n ...\n})"
  2755. }
  2756. ]
  2757. }
  2758. },
  2759. "/project": {
  2760. "get": {
  2761. "tags": ["project"],
  2762. "operationId": "project.list",
  2763. "parameters": [
  2764. {
  2765. "name": "directory",
  2766. "in": "query",
  2767. "required": false,
  2768. "schema": {
  2769. "type": "string"
  2770. }
  2771. },
  2772. {
  2773. "name": "workspace",
  2774. "in": "query",
  2775. "required": false,
  2776. "schema": {
  2777. "type": "string"
  2778. }
  2779. }
  2780. ],
  2781. "responses": {
  2782. "200": {
  2783. "description": "List of projects",
  2784. "content": {
  2785. "application/json": {
  2786. "schema": {
  2787. "type": "array",
  2788. "items": {
  2789. "$ref": "#/components/schemas/Project"
  2790. },
  2791. "description": "List of projects"
  2792. }
  2793. }
  2794. }
  2795. }
  2796. },
  2797. "description": "Get a list of projects that have been opened with OpenCode.",
  2798. "summary": "List all projects",
  2799. "x-codeSamples": [
  2800. {
  2801. "lang": "js",
  2802. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.list({\n ...\n})"
  2803. }
  2804. ]
  2805. }
  2806. },
  2807. "/project/current": {
  2808. "get": {
  2809. "tags": ["project"],
  2810. "operationId": "project.current",
  2811. "parameters": [
  2812. {
  2813. "name": "directory",
  2814. "in": "query",
  2815. "required": false,
  2816. "schema": {
  2817. "type": "string"
  2818. }
  2819. },
  2820. {
  2821. "name": "workspace",
  2822. "in": "query",
  2823. "required": false,
  2824. "schema": {
  2825. "type": "string"
  2826. }
  2827. }
  2828. ],
  2829. "responses": {
  2830. "200": {
  2831. "description": "Current project information",
  2832. "content": {
  2833. "application/json": {
  2834. "schema": {
  2835. "$ref": "#/components/schemas/Project"
  2836. }
  2837. }
  2838. }
  2839. }
  2840. },
  2841. "description": "Retrieve the currently active project that OpenCode is working with.",
  2842. "summary": "Get current project",
  2843. "x-codeSamples": [
  2844. {
  2845. "lang": "js",
  2846. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.current({\n ...\n})"
  2847. }
  2848. ]
  2849. }
  2850. },
  2851. "/project/git/init": {
  2852. "post": {
  2853. "tags": ["project"],
  2854. "operationId": "project.initGit",
  2855. "parameters": [
  2856. {
  2857. "name": "directory",
  2858. "in": "query",
  2859. "required": false,
  2860. "schema": {
  2861. "type": "string"
  2862. }
  2863. },
  2864. {
  2865. "name": "workspace",
  2866. "in": "query",
  2867. "required": false,
  2868. "schema": {
  2869. "type": "string"
  2870. }
  2871. }
  2872. ],
  2873. "responses": {
  2874. "200": {
  2875. "description": "Project information after git initialization",
  2876. "content": {
  2877. "application/json": {
  2878. "schema": {
  2879. "$ref": "#/components/schemas/Project"
  2880. }
  2881. }
  2882. }
  2883. }
  2884. },
  2885. "description": "Create a git repository for the current project and return the refreshed project info.",
  2886. "summary": "Initialize git repository",
  2887. "x-codeSamples": [
  2888. {
  2889. "lang": "js",
  2890. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.initGit({\n ...\n})"
  2891. }
  2892. ]
  2893. }
  2894. },
  2895. "/project/{projectID}": {
  2896. "patch": {
  2897. "tags": ["project"],
  2898. "operationId": "project.update",
  2899. "parameters": [
  2900. {
  2901. "name": "directory",
  2902. "in": "query",
  2903. "required": false,
  2904. "schema": {
  2905. "type": "string"
  2906. }
  2907. },
  2908. {
  2909. "name": "workspace",
  2910. "in": "query",
  2911. "required": false,
  2912. "schema": {
  2913. "type": "string"
  2914. }
  2915. },
  2916. {
  2917. "name": "projectID",
  2918. "in": "path",
  2919. "schema": {
  2920. "type": "string"
  2921. },
  2922. "required": true
  2923. }
  2924. ],
  2925. "responses": {
  2926. "200": {
  2927. "description": "Updated project information",
  2928. "content": {
  2929. "application/json": {
  2930. "schema": {
  2931. "$ref": "#/components/schemas/Project"
  2932. }
  2933. }
  2934. }
  2935. },
  2936. "400": {
  2937. "description": "Bad request",
  2938. "content": {
  2939. "application/json": {
  2940. "schema": {
  2941. "$ref": "#/components/schemas/BadRequestError"
  2942. }
  2943. }
  2944. }
  2945. },
  2946. "404": {
  2947. "description": "Not found",
  2948. "content": {
  2949. "application/json": {
  2950. "schema": {
  2951. "$ref": "#/components/schemas/NotFoundError"
  2952. }
  2953. }
  2954. }
  2955. }
  2956. },
  2957. "description": "Update project properties such as name, icon, and commands.",
  2958. "summary": "Update project",
  2959. "requestBody": {
  2960. "content": {
  2961. "application/json": {
  2962. "schema": {
  2963. "type": "object",
  2964. "properties": {
  2965. "name": {
  2966. "type": "string"
  2967. },
  2968. "icon": {
  2969. "type": "object",
  2970. "properties": {
  2971. "url": {
  2972. "type": "string"
  2973. },
  2974. "override": {
  2975. "type": "string"
  2976. },
  2977. "color": {
  2978. "type": "string"
  2979. }
  2980. },
  2981. "additionalProperties": false
  2982. },
  2983. "commands": {
  2984. "type": "object",
  2985. "properties": {
  2986. "start": {
  2987. "type": "string",
  2988. "description": "Startup script to run when creating a new workspace (worktree)"
  2989. }
  2990. },
  2991. "additionalProperties": false
  2992. }
  2993. },
  2994. "additionalProperties": false
  2995. }
  2996. }
  2997. }
  2998. },
  2999. "x-codeSamples": [
  3000. {
  3001. "lang": "js",
  3002. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.update({\n ...\n})"
  3003. }
  3004. ]
  3005. }
  3006. },
  3007. "/pty/shells": {
  3008. "get": {
  3009. "tags": ["pty"],
  3010. "operationId": "pty.shells",
  3011. "parameters": [
  3012. {
  3013. "name": "directory",
  3014. "in": "query",
  3015. "required": false,
  3016. "schema": {
  3017. "type": "string"
  3018. }
  3019. },
  3020. {
  3021. "name": "workspace",
  3022. "in": "query",
  3023. "required": false,
  3024. "schema": {
  3025. "type": "string"
  3026. }
  3027. }
  3028. ],
  3029. "responses": {
  3030. "200": {
  3031. "description": "List of shells",
  3032. "content": {
  3033. "application/json": {
  3034. "schema": {
  3035. "type": "array",
  3036. "items": {
  3037. "type": "object",
  3038. "properties": {
  3039. "path": {
  3040. "type": "string"
  3041. },
  3042. "name": {
  3043. "type": "string"
  3044. },
  3045. "acceptable": {
  3046. "type": "boolean"
  3047. }
  3048. },
  3049. "required": ["path", "name", "acceptable"],
  3050. "additionalProperties": false
  3051. },
  3052. "description": "List of shells"
  3053. }
  3054. }
  3055. }
  3056. }
  3057. },
  3058. "description": "Get a list of available shells on the system.",
  3059. "summary": "List available shells",
  3060. "x-codeSamples": [
  3061. {
  3062. "lang": "js",
  3063. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.shells({\n ...\n})"
  3064. }
  3065. ]
  3066. }
  3067. },
  3068. "/pty": {
  3069. "get": {
  3070. "tags": ["pty"],
  3071. "operationId": "pty.list",
  3072. "parameters": [
  3073. {
  3074. "name": "directory",
  3075. "in": "query",
  3076. "required": false,
  3077. "schema": {
  3078. "type": "string"
  3079. }
  3080. },
  3081. {
  3082. "name": "workspace",
  3083. "in": "query",
  3084. "required": false,
  3085. "schema": {
  3086. "type": "string"
  3087. }
  3088. }
  3089. ],
  3090. "responses": {
  3091. "200": {
  3092. "description": "List of sessions",
  3093. "content": {
  3094. "application/json": {
  3095. "schema": {
  3096. "type": "array",
  3097. "items": {
  3098. "$ref": "#/components/schemas/Pty"
  3099. },
  3100. "description": "List of sessions"
  3101. }
  3102. }
  3103. }
  3104. }
  3105. },
  3106. "description": "Get a list of all active pseudo-terminal (PTY) sessions managed by OpenCode.",
  3107. "summary": "List PTY sessions",
  3108. "x-codeSamples": [
  3109. {
  3110. "lang": "js",
  3111. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.list({\n ...\n})"
  3112. }
  3113. ]
  3114. },
  3115. "post": {
  3116. "tags": ["pty"],
  3117. "operationId": "pty.create",
  3118. "parameters": [
  3119. {
  3120. "name": "directory",
  3121. "in": "query",
  3122. "required": false,
  3123. "schema": {
  3124. "type": "string"
  3125. }
  3126. },
  3127. {
  3128. "name": "workspace",
  3129. "in": "query",
  3130. "required": false,
  3131. "schema": {
  3132. "type": "string"
  3133. }
  3134. }
  3135. ],
  3136. "responses": {
  3137. "200": {
  3138. "description": "Created session",
  3139. "content": {
  3140. "application/json": {
  3141. "schema": {
  3142. "$ref": "#/components/schemas/Pty"
  3143. }
  3144. }
  3145. }
  3146. },
  3147. "400": {
  3148. "description": "Bad request",
  3149. "content": {
  3150. "application/json": {
  3151. "schema": {
  3152. "$ref": "#/components/schemas/BadRequestError"
  3153. }
  3154. }
  3155. }
  3156. }
  3157. },
  3158. "description": "Create a new pseudo-terminal (PTY) session for running shell commands and processes.",
  3159. "summary": "Create PTY session",
  3160. "requestBody": {
  3161. "content": {
  3162. "application/json": {
  3163. "schema": {
  3164. "type": "object",
  3165. "properties": {
  3166. "command": {
  3167. "type": "string"
  3168. },
  3169. "args": {
  3170. "type": "array",
  3171. "items": {
  3172. "type": "string"
  3173. }
  3174. },
  3175. "cwd": {
  3176. "type": "string"
  3177. },
  3178. "title": {
  3179. "type": "string"
  3180. },
  3181. "env": {
  3182. "type": "object",
  3183. "additionalProperties": {
  3184. "type": "string"
  3185. }
  3186. }
  3187. },
  3188. "additionalProperties": false
  3189. }
  3190. }
  3191. }
  3192. },
  3193. "x-codeSamples": [
  3194. {
  3195. "lang": "js",
  3196. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.create({\n ...\n})"
  3197. }
  3198. ]
  3199. }
  3200. },
  3201. "/pty/{ptyID}": {
  3202. "get": {
  3203. "tags": ["pty"],
  3204. "operationId": "pty.get",
  3205. "parameters": [
  3206. {
  3207. "name": "directory",
  3208. "in": "query",
  3209. "required": false,
  3210. "schema": {
  3211. "type": "string"
  3212. }
  3213. },
  3214. {
  3215. "name": "workspace",
  3216. "in": "query",
  3217. "required": false,
  3218. "schema": {
  3219. "type": "string"
  3220. }
  3221. },
  3222. {
  3223. "name": "ptyID",
  3224. "in": "path",
  3225. "schema": {
  3226. "type": "string",
  3227. "pattern": "^pty.*"
  3228. },
  3229. "required": true
  3230. }
  3231. ],
  3232. "responses": {
  3233. "200": {
  3234. "description": "Session info",
  3235. "content": {
  3236. "application/json": {
  3237. "schema": {
  3238. "$ref": "#/components/schemas/Pty"
  3239. }
  3240. }
  3241. }
  3242. },
  3243. "404": {
  3244. "description": "Not found",
  3245. "content": {
  3246. "application/json": {
  3247. "schema": {
  3248. "$ref": "#/components/schemas/NotFoundError"
  3249. }
  3250. }
  3251. }
  3252. }
  3253. },
  3254. "description": "Retrieve detailed information about a specific pseudo-terminal (PTY) session.",
  3255. "summary": "Get PTY session",
  3256. "x-codeSamples": [
  3257. {
  3258. "lang": "js",
  3259. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.get({\n ...\n})"
  3260. }
  3261. ]
  3262. },
  3263. "put": {
  3264. "tags": ["pty"],
  3265. "operationId": "pty.update",
  3266. "parameters": [
  3267. {
  3268. "name": "directory",
  3269. "in": "query",
  3270. "required": false,
  3271. "schema": {
  3272. "type": "string"
  3273. }
  3274. },
  3275. {
  3276. "name": "workspace",
  3277. "in": "query",
  3278. "required": false,
  3279. "schema": {
  3280. "type": "string"
  3281. }
  3282. },
  3283. {
  3284. "name": "ptyID",
  3285. "in": "path",
  3286. "schema": {
  3287. "type": "string",
  3288. "pattern": "^pty.*"
  3289. },
  3290. "required": true
  3291. }
  3292. ],
  3293. "responses": {
  3294. "200": {
  3295. "description": "Updated session",
  3296. "content": {
  3297. "application/json": {
  3298. "schema": {
  3299. "$ref": "#/components/schemas/Pty"
  3300. }
  3301. }
  3302. }
  3303. },
  3304. "400": {
  3305. "description": "Bad request",
  3306. "content": {
  3307. "application/json": {
  3308. "schema": {
  3309. "$ref": "#/components/schemas/BadRequestError"
  3310. }
  3311. }
  3312. }
  3313. }
  3314. },
  3315. "description": "Update properties of an existing pseudo-terminal (PTY) session.",
  3316. "summary": "Update PTY session",
  3317. "requestBody": {
  3318. "content": {
  3319. "application/json": {
  3320. "schema": {
  3321. "type": "object",
  3322. "properties": {
  3323. "title": {
  3324. "type": "string"
  3325. },
  3326. "size": {
  3327. "type": "object",
  3328. "properties": {
  3329. "rows": {
  3330. "type": "integer",
  3331. "exclusiveMinimum": 0
  3332. },
  3333. "cols": {
  3334. "type": "integer",
  3335. "exclusiveMinimum": 0
  3336. }
  3337. },
  3338. "required": ["rows", "cols"],
  3339. "additionalProperties": false
  3340. }
  3341. },
  3342. "additionalProperties": false
  3343. }
  3344. }
  3345. }
  3346. },
  3347. "x-codeSamples": [
  3348. {
  3349. "lang": "js",
  3350. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.update({\n ...\n})"
  3351. }
  3352. ]
  3353. },
  3354. "delete": {
  3355. "tags": ["pty"],
  3356. "operationId": "pty.remove",
  3357. "parameters": [
  3358. {
  3359. "name": "directory",
  3360. "in": "query",
  3361. "required": false,
  3362. "schema": {
  3363. "type": "string"
  3364. }
  3365. },
  3366. {
  3367. "name": "workspace",
  3368. "in": "query",
  3369. "required": false,
  3370. "schema": {
  3371. "type": "string"
  3372. }
  3373. },
  3374. {
  3375. "name": "ptyID",
  3376. "in": "path",
  3377. "schema": {
  3378. "type": "string",
  3379. "pattern": "^pty.*"
  3380. },
  3381. "required": true
  3382. }
  3383. ],
  3384. "responses": {
  3385. "200": {
  3386. "description": "Session removed",
  3387. "content": {
  3388. "application/json": {
  3389. "schema": {
  3390. "type": "boolean",
  3391. "description": "Session removed"
  3392. }
  3393. }
  3394. }
  3395. },
  3396. "404": {
  3397. "description": "Not found",
  3398. "content": {
  3399. "application/json": {
  3400. "schema": {
  3401. "$ref": "#/components/schemas/NotFoundError"
  3402. }
  3403. }
  3404. }
  3405. }
  3406. },
  3407. "description": "Remove and terminate a specific pseudo-terminal (PTY) session.",
  3408. "summary": "Remove PTY session",
  3409. "x-codeSamples": [
  3410. {
  3411. "lang": "js",
  3412. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.remove({\n ...\n})"
  3413. }
  3414. ]
  3415. }
  3416. },
  3417. "/pty/{ptyID}/connect-token": {
  3418. "post": {
  3419. "tags": ["pty"],
  3420. "operationId": "pty.connectToken",
  3421. "parameters": [
  3422. {
  3423. "name": "directory",
  3424. "in": "query",
  3425. "required": false,
  3426. "schema": {
  3427. "type": "string"
  3428. }
  3429. },
  3430. {
  3431. "name": "workspace",
  3432. "in": "query",
  3433. "required": false,
  3434. "schema": {
  3435. "type": "string"
  3436. }
  3437. },
  3438. {
  3439. "name": "ptyID",
  3440. "in": "path",
  3441. "schema": {
  3442. "type": "string",
  3443. "pattern": "^pty.*"
  3444. },
  3445. "required": true
  3446. }
  3447. ],
  3448. "responses": {
  3449. "200": {
  3450. "description": "WebSocket connect token",
  3451. "content": {
  3452. "application/json": {
  3453. "schema": {
  3454. "type": "object",
  3455. "properties": {
  3456. "ticket": {
  3457. "type": "string"
  3458. },
  3459. "expires_in": {
  3460. "type": "integer",
  3461. "exclusiveMinimum": 0
  3462. }
  3463. },
  3464. "required": ["ticket", "expires_in"],
  3465. "additionalProperties": false,
  3466. "description": "WebSocket connect token"
  3467. }
  3468. }
  3469. }
  3470. },
  3471. "403": {
  3472. "description": "Forbidden",
  3473. "content": {
  3474. "application/json": {
  3475. "schema": {
  3476. "$ref": "#/components/schemas/effect_HttpApiError_Forbidden"
  3477. }
  3478. }
  3479. }
  3480. },
  3481. "404": {
  3482. "description": "Not found",
  3483. "content": {
  3484. "application/json": {
  3485. "schema": {
  3486. "$ref": "#/components/schemas/NotFoundError"
  3487. }
  3488. }
  3489. }
  3490. }
  3491. },
  3492. "description": "Create a short-lived ticket for opening a PTY WebSocket connection.",
  3493. "summary": "Create PTY WebSocket token",
  3494. "x-codeSamples": [
  3495. {
  3496. "lang": "js",
  3497. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.connectToken({\n ...\n})"
  3498. }
  3499. ]
  3500. }
  3501. },
  3502. "/question": {
  3503. "get": {
  3504. "tags": ["question"],
  3505. "operationId": "question.list",
  3506. "parameters": [
  3507. {
  3508. "name": "directory",
  3509. "in": "query",
  3510. "required": false,
  3511. "schema": {
  3512. "type": "string"
  3513. }
  3514. },
  3515. {
  3516. "name": "workspace",
  3517. "in": "query",
  3518. "required": false,
  3519. "schema": {
  3520. "type": "string"
  3521. }
  3522. }
  3523. ],
  3524. "responses": {
  3525. "200": {
  3526. "description": "List of pending questions",
  3527. "content": {
  3528. "application/json": {
  3529. "schema": {
  3530. "type": "array",
  3531. "items": {
  3532. "$ref": "#/components/schemas/QuestionRequest"
  3533. },
  3534. "description": "List of pending questions"
  3535. }
  3536. }
  3537. }
  3538. }
  3539. },
  3540. "description": "Get all pending question requests across all sessions.",
  3541. "summary": "List pending questions",
  3542. "x-codeSamples": [
  3543. {
  3544. "lang": "js",
  3545. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.question.list({\n ...\n})"
  3546. }
  3547. ]
  3548. }
  3549. },
  3550. "/question/{requestID}/reply": {
  3551. "post": {
  3552. "tags": ["question"],
  3553. "operationId": "question.reply",
  3554. "parameters": [
  3555. {
  3556. "name": "directory",
  3557. "in": "query",
  3558. "required": false,
  3559. "schema": {
  3560. "type": "string"
  3561. }
  3562. },
  3563. {
  3564. "name": "workspace",
  3565. "in": "query",
  3566. "required": false,
  3567. "schema": {
  3568. "type": "string"
  3569. }
  3570. },
  3571. {
  3572. "name": "requestID",
  3573. "in": "path",
  3574. "schema": {
  3575. "type": "string",
  3576. "pattern": "^que.*"
  3577. },
  3578. "required": true
  3579. }
  3580. ],
  3581. "responses": {
  3582. "200": {
  3583. "description": "Question answered successfully",
  3584. "content": {
  3585. "application/json": {
  3586. "schema": {
  3587. "type": "boolean",
  3588. "description": "Question answered successfully"
  3589. }
  3590. }
  3591. }
  3592. },
  3593. "400": {
  3594. "description": "Bad request",
  3595. "content": {
  3596. "application/json": {
  3597. "schema": {
  3598. "$ref": "#/components/schemas/BadRequestError"
  3599. }
  3600. }
  3601. }
  3602. },
  3603. "404": {
  3604. "description": "Not found",
  3605. "content": {
  3606. "application/json": {
  3607. "schema": {
  3608. "$ref": "#/components/schemas/NotFoundError"
  3609. }
  3610. }
  3611. }
  3612. }
  3613. },
  3614. "description": "Provide answers to a question request from the AI assistant.",
  3615. "summary": "Reply to question request",
  3616. "requestBody": {
  3617. "content": {
  3618. "application/json": {
  3619. "schema": {
  3620. "type": "object",
  3621. "properties": {
  3622. "answers": {
  3623. "type": "array",
  3624. "items": {
  3625. "$ref": "#/components/schemas/QuestionAnswer"
  3626. },
  3627. "description": "User answers in order of questions (each answer is an array of selected labels)"
  3628. }
  3629. },
  3630. "required": ["answers"],
  3631. "additionalProperties": false
  3632. }
  3633. }
  3634. }
  3635. },
  3636. "x-codeSamples": [
  3637. {
  3638. "lang": "js",
  3639. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.question.reply({\n ...\n})"
  3640. }
  3641. ]
  3642. }
  3643. },
  3644. "/question/{requestID}/reject": {
  3645. "post": {
  3646. "tags": ["question"],
  3647. "operationId": "question.reject",
  3648. "parameters": [
  3649. {
  3650. "name": "directory",
  3651. "in": "query",
  3652. "required": false,
  3653. "schema": {
  3654. "type": "string"
  3655. }
  3656. },
  3657. {
  3658. "name": "workspace",
  3659. "in": "query",
  3660. "required": false,
  3661. "schema": {
  3662. "type": "string"
  3663. }
  3664. },
  3665. {
  3666. "name": "requestID",
  3667. "in": "path",
  3668. "schema": {
  3669. "type": "string",
  3670. "pattern": "^que.*"
  3671. },
  3672. "required": true
  3673. }
  3674. ],
  3675. "responses": {
  3676. "200": {
  3677. "description": "Question rejected successfully",
  3678. "content": {
  3679. "application/json": {
  3680. "schema": {
  3681. "type": "boolean",
  3682. "description": "Question rejected successfully"
  3683. }
  3684. }
  3685. }
  3686. },
  3687. "400": {
  3688. "description": "Bad request",
  3689. "content": {
  3690. "application/json": {
  3691. "schema": {
  3692. "$ref": "#/components/schemas/BadRequestError"
  3693. }
  3694. }
  3695. }
  3696. },
  3697. "404": {
  3698. "description": "Not found",
  3699. "content": {
  3700. "application/json": {
  3701. "schema": {
  3702. "$ref": "#/components/schemas/NotFoundError"
  3703. }
  3704. }
  3705. }
  3706. }
  3707. },
  3708. "description": "Reject a question request from the AI assistant.",
  3709. "summary": "Reject question request",
  3710. "x-codeSamples": [
  3711. {
  3712. "lang": "js",
  3713. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.question.reject({\n ...\n})"
  3714. }
  3715. ]
  3716. }
  3717. },
  3718. "/permission": {
  3719. "get": {
  3720. "tags": ["permission"],
  3721. "operationId": "permission.list",
  3722. "parameters": [
  3723. {
  3724. "name": "directory",
  3725. "in": "query",
  3726. "required": false,
  3727. "schema": {
  3728. "type": "string"
  3729. }
  3730. },
  3731. {
  3732. "name": "workspace",
  3733. "in": "query",
  3734. "required": false,
  3735. "schema": {
  3736. "type": "string"
  3737. }
  3738. }
  3739. ],
  3740. "responses": {
  3741. "200": {
  3742. "description": "List of pending permissions",
  3743. "content": {
  3744. "application/json": {
  3745. "schema": {
  3746. "type": "array",
  3747. "items": {
  3748. "$ref": "#/components/schemas/PermissionRequest"
  3749. },
  3750. "description": "List of pending permissions"
  3751. }
  3752. }
  3753. }
  3754. }
  3755. },
  3756. "description": "Get all pending permission requests across all sessions.",
  3757. "summary": "List pending permissions",
  3758. "x-codeSamples": [
  3759. {
  3760. "lang": "js",
  3761. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.permission.list({\n ...\n})"
  3762. }
  3763. ]
  3764. }
  3765. },
  3766. "/permission/{requestID}/reply": {
  3767. "post": {
  3768. "tags": ["permission"],
  3769. "operationId": "permission.reply",
  3770. "parameters": [
  3771. {
  3772. "name": "directory",
  3773. "in": "query",
  3774. "required": false,
  3775. "schema": {
  3776. "type": "string"
  3777. }
  3778. },
  3779. {
  3780. "name": "workspace",
  3781. "in": "query",
  3782. "required": false,
  3783. "schema": {
  3784. "type": "string"
  3785. }
  3786. },
  3787. {
  3788. "name": "requestID",
  3789. "in": "path",
  3790. "schema": {
  3791. "type": "string",
  3792. "pattern": "^per.*"
  3793. },
  3794. "required": true
  3795. }
  3796. ],
  3797. "responses": {
  3798. "200": {
  3799. "description": "Permission processed successfully",
  3800. "content": {
  3801. "application/json": {
  3802. "schema": {
  3803. "type": "boolean",
  3804. "description": "Permission processed successfully"
  3805. }
  3806. }
  3807. }
  3808. },
  3809. "400": {
  3810. "description": "Bad request",
  3811. "content": {
  3812. "application/json": {
  3813. "schema": {
  3814. "$ref": "#/components/schemas/BadRequestError"
  3815. }
  3816. }
  3817. }
  3818. },
  3819. "404": {
  3820. "description": "Not found",
  3821. "content": {
  3822. "application/json": {
  3823. "schema": {
  3824. "$ref": "#/components/schemas/NotFoundError"
  3825. }
  3826. }
  3827. }
  3828. }
  3829. },
  3830. "description": "Approve or deny a permission request from the AI assistant.",
  3831. "summary": "Respond to permission request",
  3832. "requestBody": {
  3833. "content": {
  3834. "application/json": {
  3835. "schema": {
  3836. "type": "object",
  3837. "properties": {
  3838. "reply": {
  3839. "type": "string",
  3840. "enum": ["once", "always", "reject"]
  3841. },
  3842. "message": {
  3843. "type": "string"
  3844. }
  3845. },
  3846. "required": ["reply"],
  3847. "additionalProperties": false
  3848. }
  3849. }
  3850. }
  3851. },
  3852. "x-codeSamples": [
  3853. {
  3854. "lang": "js",
  3855. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.permission.reply({\n ...\n})"
  3856. }
  3857. ]
  3858. }
  3859. },
  3860. "/provider": {
  3861. "get": {
  3862. "tags": ["provider"],
  3863. "operationId": "provider.list",
  3864. "parameters": [
  3865. {
  3866. "name": "directory",
  3867. "in": "query",
  3868. "required": false,
  3869. "schema": {
  3870. "type": "string"
  3871. }
  3872. },
  3873. {
  3874. "name": "workspace",
  3875. "in": "query",
  3876. "required": false,
  3877. "schema": {
  3878. "type": "string"
  3879. }
  3880. }
  3881. ],
  3882. "responses": {
  3883. "200": {
  3884. "description": "List of providers",
  3885. "content": {
  3886. "application/json": {
  3887. "schema": {
  3888. "type": "object",
  3889. "properties": {
  3890. "all": {
  3891. "type": "array",
  3892. "items": {
  3893. "$ref": "#/components/schemas/Provider"
  3894. }
  3895. },
  3896. "default": {
  3897. "type": "object",
  3898. "additionalProperties": {
  3899. "type": "string"
  3900. }
  3901. },
  3902. "connected": {
  3903. "type": "array",
  3904. "items": {
  3905. "type": "string"
  3906. }
  3907. }
  3908. },
  3909. "required": ["all", "default", "connected"],
  3910. "additionalProperties": false,
  3911. "description": "List of providers"
  3912. }
  3913. }
  3914. }
  3915. }
  3916. },
  3917. "description": "Get a list of all available AI providers, including both available and connected ones.",
  3918. "summary": "List providers",
  3919. "x-codeSamples": [
  3920. {
  3921. "lang": "js",
  3922. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.list({\n ...\n})"
  3923. }
  3924. ]
  3925. }
  3926. },
  3927. "/provider/auth": {
  3928. "get": {
  3929. "tags": ["provider"],
  3930. "operationId": "provider.auth",
  3931. "parameters": [
  3932. {
  3933. "name": "directory",
  3934. "in": "query",
  3935. "required": false,
  3936. "schema": {
  3937. "type": "string"
  3938. }
  3939. },
  3940. {
  3941. "name": "workspace",
  3942. "in": "query",
  3943. "required": false,
  3944. "schema": {
  3945. "type": "string"
  3946. }
  3947. }
  3948. ],
  3949. "responses": {
  3950. "200": {
  3951. "description": "Provider auth methods",
  3952. "content": {
  3953. "application/json": {
  3954. "schema": {
  3955. "type": "object",
  3956. "additionalProperties": {
  3957. "type": "array",
  3958. "items": {
  3959. "$ref": "#/components/schemas/ProviderAuthMethod"
  3960. }
  3961. },
  3962. "description": "Provider auth methods"
  3963. }
  3964. }
  3965. }
  3966. }
  3967. },
  3968. "description": "Retrieve available authentication methods for all AI providers.",
  3969. "summary": "Get provider auth methods",
  3970. "x-codeSamples": [
  3971. {
  3972. "lang": "js",
  3973. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.auth({\n ...\n})"
  3974. }
  3975. ]
  3976. }
  3977. },
  3978. "/provider/{providerID}/oauth/authorize": {
  3979. "post": {
  3980. "tags": ["provider"],
  3981. "operationId": "provider.oauth.authorize",
  3982. "parameters": [
  3983. {
  3984. "name": "directory",
  3985. "in": "query",
  3986. "required": false,
  3987. "schema": {
  3988. "type": "string"
  3989. }
  3990. },
  3991. {
  3992. "name": "workspace",
  3993. "in": "query",
  3994. "required": false,
  3995. "schema": {
  3996. "type": "string"
  3997. }
  3998. },
  3999. {
  4000. "name": "providerID",
  4001. "in": "path",
  4002. "schema": {
  4003. "type": "string"
  4004. },
  4005. "required": true
  4006. }
  4007. ],
  4008. "responses": {
  4009. "200": {
  4010. "description": "Authorization URL and method",
  4011. "content": {
  4012. "application/json": {
  4013. "schema": {
  4014. "$ref": "#/components/schemas/ProviderAuthAuthorization"
  4015. }
  4016. }
  4017. }
  4018. },
  4019. "400": {
  4020. "description": "Bad request",
  4021. "content": {
  4022. "application/json": {
  4023. "schema": {
  4024. "$ref": "#/components/schemas/BadRequestError"
  4025. }
  4026. }
  4027. }
  4028. }
  4029. },
  4030. "description": "Start the OAuth authorization flow for a provider.",
  4031. "summary": "Start OAuth authorization",
  4032. "requestBody": {
  4033. "content": {
  4034. "application/json": {
  4035. "schema": {
  4036. "type": "object",
  4037. "properties": {
  4038. "method": {
  4039. "type": "number",
  4040. "description": "Auth method index"
  4041. },
  4042. "inputs": {
  4043. "type": "object",
  4044. "additionalProperties": {
  4045. "type": "string"
  4046. }
  4047. }
  4048. },
  4049. "required": ["method"],
  4050. "additionalProperties": false
  4051. }
  4052. }
  4053. }
  4054. },
  4055. "x-codeSamples": [
  4056. {
  4057. "lang": "js",
  4058. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.oauth.authorize({\n ...\n})"
  4059. }
  4060. ]
  4061. }
  4062. },
  4063. "/provider/{providerID}/oauth/callback": {
  4064. "post": {
  4065. "tags": ["provider"],
  4066. "operationId": "provider.oauth.callback",
  4067. "parameters": [
  4068. {
  4069. "name": "directory",
  4070. "in": "query",
  4071. "required": false,
  4072. "schema": {
  4073. "type": "string"
  4074. }
  4075. },
  4076. {
  4077. "name": "workspace",
  4078. "in": "query",
  4079. "required": false,
  4080. "schema": {
  4081. "type": "string"
  4082. }
  4083. },
  4084. {
  4085. "name": "providerID",
  4086. "in": "path",
  4087. "schema": {
  4088. "type": "string"
  4089. },
  4090. "required": true
  4091. }
  4092. ],
  4093. "responses": {
  4094. "200": {
  4095. "description": "OAuth callback processed successfully",
  4096. "content": {
  4097. "application/json": {
  4098. "schema": {
  4099. "type": "boolean",
  4100. "description": "OAuth callback processed successfully"
  4101. }
  4102. }
  4103. }
  4104. },
  4105. "400": {
  4106. "description": "Bad request",
  4107. "content": {
  4108. "application/json": {
  4109. "schema": {
  4110. "$ref": "#/components/schemas/BadRequestError"
  4111. }
  4112. }
  4113. }
  4114. }
  4115. },
  4116. "description": "Handle the OAuth callback from a provider after user authorization.",
  4117. "summary": "Handle OAuth callback",
  4118. "requestBody": {
  4119. "content": {
  4120. "application/json": {
  4121. "schema": {
  4122. "type": "object",
  4123. "properties": {
  4124. "method": {
  4125. "type": "number",
  4126. "description": "Auth method index"
  4127. },
  4128. "code": {
  4129. "type": "string"
  4130. }
  4131. },
  4132. "required": ["method"],
  4133. "additionalProperties": false
  4134. }
  4135. }
  4136. }
  4137. },
  4138. "x-codeSamples": [
  4139. {
  4140. "lang": "js",
  4141. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.oauth.callback({\n ...\n})"
  4142. }
  4143. ]
  4144. }
  4145. },
  4146. "/session": {
  4147. "get": {
  4148. "tags": ["session"],
  4149. "operationId": "session.list",
  4150. "parameters": [
  4151. {
  4152. "name": "directory",
  4153. "in": "query",
  4154. "required": false,
  4155. "schema": {
  4156. "type": "string"
  4157. }
  4158. },
  4159. {
  4160. "name": "workspace",
  4161. "in": "query",
  4162. "required": false,
  4163. "schema": {
  4164. "type": "string"
  4165. }
  4166. },
  4167. {
  4168. "name": "scope",
  4169. "in": "query",
  4170. "schema": {
  4171. "type": "string",
  4172. "enum": ["project"]
  4173. },
  4174. "required": false
  4175. },
  4176. {
  4177. "name": "path",
  4178. "in": "query",
  4179. "schema": {
  4180. "type": "string"
  4181. },
  4182. "required": false
  4183. },
  4184. {
  4185. "name": "roots",
  4186. "in": "query",
  4187. "schema": {
  4188. "anyOf": [
  4189. {
  4190. "type": "boolean"
  4191. },
  4192. {
  4193. "type": "string",
  4194. "enum": ["true", "false"]
  4195. }
  4196. ]
  4197. },
  4198. "required": false
  4199. },
  4200. {
  4201. "name": "start",
  4202. "in": "query",
  4203. "schema": {
  4204. "type": "number"
  4205. },
  4206. "required": false
  4207. },
  4208. {
  4209. "name": "search",
  4210. "in": "query",
  4211. "schema": {
  4212. "type": "string"
  4213. },
  4214. "required": false
  4215. },
  4216. {
  4217. "name": "limit",
  4218. "in": "query",
  4219. "schema": {
  4220. "type": "number"
  4221. },
  4222. "required": false
  4223. }
  4224. ],
  4225. "responses": {
  4226. "200": {
  4227. "description": "List of sessions",
  4228. "content": {
  4229. "application/json": {
  4230. "schema": {
  4231. "type": "array",
  4232. "items": {
  4233. "$ref": "#/components/schemas/Session"
  4234. },
  4235. "description": "List of sessions"
  4236. }
  4237. }
  4238. }
  4239. }
  4240. },
  4241. "description": "Get a list of all OpenCode sessions, sorted by most recently updated.",
  4242. "summary": "List sessions",
  4243. "x-codeSamples": [
  4244. {
  4245. "lang": "js",
  4246. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.list({\n ...\n})"
  4247. }
  4248. ]
  4249. },
  4250. "post": {
  4251. "tags": ["session"],
  4252. "operationId": "session.create",
  4253. "parameters": [
  4254. {
  4255. "name": "directory",
  4256. "in": "query",
  4257. "required": false,
  4258. "schema": {
  4259. "type": "string"
  4260. }
  4261. },
  4262. {
  4263. "name": "workspace",
  4264. "in": "query",
  4265. "required": false,
  4266. "schema": {
  4267. "type": "string"
  4268. }
  4269. }
  4270. ],
  4271. "responses": {
  4272. "200": {
  4273. "description": "Successfully created session",
  4274. "content": {
  4275. "application/json": {
  4276. "schema": {
  4277. "$ref": "#/components/schemas/Session"
  4278. }
  4279. }
  4280. }
  4281. },
  4282. "400": {
  4283. "description": "Bad request",
  4284. "content": {
  4285. "application/json": {
  4286. "schema": {
  4287. "$ref": "#/components/schemas/BadRequestError"
  4288. }
  4289. }
  4290. }
  4291. }
  4292. },
  4293. "description": "Create a new OpenCode session for interacting with AI assistants and managing conversations.",
  4294. "summary": "Create session",
  4295. "requestBody": {
  4296. "content": {
  4297. "application/json": {
  4298. "schema": {
  4299. "type": "object",
  4300. "properties": {
  4301. "parentID": {
  4302. "type": "string"
  4303. },
  4304. "title": {
  4305. "type": "string"
  4306. },
  4307. "agent": {
  4308. "type": "string"
  4309. },
  4310. "model": {
  4311. "type": "object",
  4312. "properties": {
  4313. "id": {
  4314. "type": "string"
  4315. },
  4316. "providerID": {
  4317. "type": "string"
  4318. },
  4319. "variant": {
  4320. "type": "string"
  4321. }
  4322. },
  4323. "required": ["id", "providerID"],
  4324. "additionalProperties": false
  4325. },
  4326. "permission": {
  4327. "$ref": "#/components/schemas/PermissionRuleset"
  4328. },
  4329. "workspaceID": {
  4330. "type": "string"
  4331. }
  4332. },
  4333. "additionalProperties": false
  4334. }
  4335. }
  4336. }
  4337. },
  4338. "x-codeSamples": [
  4339. {
  4340. "lang": "js",
  4341. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.create({\n ...\n})"
  4342. }
  4343. ]
  4344. }
  4345. },
  4346. "/session/status": {
  4347. "get": {
  4348. "tags": ["session"],
  4349. "operationId": "session.status",
  4350. "parameters": [
  4351. {
  4352. "name": "directory",
  4353. "in": "query",
  4354. "required": false,
  4355. "schema": {
  4356. "type": "string"
  4357. }
  4358. },
  4359. {
  4360. "name": "workspace",
  4361. "in": "query",
  4362. "required": false,
  4363. "schema": {
  4364. "type": "string"
  4365. }
  4366. }
  4367. ],
  4368. "responses": {
  4369. "200": {
  4370. "description": "Get session status",
  4371. "content": {
  4372. "application/json": {
  4373. "schema": {
  4374. "type": "object",
  4375. "additionalProperties": {
  4376. "$ref": "#/components/schemas/SessionStatus"
  4377. },
  4378. "description": "Get session status"
  4379. }
  4380. }
  4381. }
  4382. },
  4383. "400": {
  4384. "description": "Bad request",
  4385. "content": {
  4386. "application/json": {
  4387. "schema": {
  4388. "$ref": "#/components/schemas/BadRequestError"
  4389. }
  4390. }
  4391. }
  4392. }
  4393. },
  4394. "description": "Retrieve the current status of all sessions, including active, idle, and completed states.",
  4395. "summary": "Get session status",
  4396. "x-codeSamples": [
  4397. {
  4398. "lang": "js",
  4399. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.status({\n ...\n})"
  4400. }
  4401. ]
  4402. }
  4403. },
  4404. "/session/{sessionID}": {
  4405. "get": {
  4406. "tags": ["session"],
  4407. "operationId": "session.get",
  4408. "parameters": [
  4409. {
  4410. "name": "directory",
  4411. "in": "query",
  4412. "required": false,
  4413. "schema": {
  4414. "type": "string"
  4415. }
  4416. },
  4417. {
  4418. "name": "workspace",
  4419. "in": "query",
  4420. "required": false,
  4421. "schema": {
  4422. "type": "string"
  4423. }
  4424. },
  4425. {
  4426. "name": "sessionID",
  4427. "in": "path",
  4428. "schema": {
  4429. "type": "string",
  4430. "pattern": "^ses.*"
  4431. },
  4432. "required": true
  4433. }
  4434. ],
  4435. "responses": {
  4436. "200": {
  4437. "description": "Get session",
  4438. "content": {
  4439. "application/json": {
  4440. "schema": {
  4441. "$ref": "#/components/schemas/Session"
  4442. }
  4443. }
  4444. }
  4445. },
  4446. "400": {
  4447. "description": "Bad request",
  4448. "content": {
  4449. "application/json": {
  4450. "schema": {
  4451. "$ref": "#/components/schemas/BadRequestError"
  4452. }
  4453. }
  4454. }
  4455. },
  4456. "404": {
  4457. "description": "Not found",
  4458. "content": {
  4459. "application/json": {
  4460. "schema": {
  4461. "$ref": "#/components/schemas/NotFoundError"
  4462. }
  4463. }
  4464. }
  4465. }
  4466. },
  4467. "description": "Retrieve detailed information about a specific OpenCode session.",
  4468. "summary": "Get session",
  4469. "x-codeSamples": [
  4470. {
  4471. "lang": "js",
  4472. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.get({\n ...\n})"
  4473. }
  4474. ]
  4475. },
  4476. "delete": {
  4477. "tags": ["session"],
  4478. "operationId": "session.delete",
  4479. "parameters": [
  4480. {
  4481. "name": "directory",
  4482. "in": "query",
  4483. "required": false,
  4484. "schema": {
  4485. "type": "string"
  4486. }
  4487. },
  4488. {
  4489. "name": "workspace",
  4490. "in": "query",
  4491. "required": false,
  4492. "schema": {
  4493. "type": "string"
  4494. }
  4495. },
  4496. {
  4497. "name": "sessionID",
  4498. "in": "path",
  4499. "schema": {
  4500. "type": "string",
  4501. "pattern": "^ses.*"
  4502. },
  4503. "required": true
  4504. }
  4505. ],
  4506. "responses": {
  4507. "200": {
  4508. "description": "Successfully deleted session",
  4509. "content": {
  4510. "application/json": {
  4511. "schema": {
  4512. "type": "boolean",
  4513. "description": "Successfully deleted session"
  4514. }
  4515. }
  4516. }
  4517. },
  4518. "400": {
  4519. "description": "Bad request",
  4520. "content": {
  4521. "application/json": {
  4522. "schema": {
  4523. "$ref": "#/components/schemas/BadRequestError"
  4524. }
  4525. }
  4526. }
  4527. },
  4528. "404": {
  4529. "description": "Not found",
  4530. "content": {
  4531. "application/json": {
  4532. "schema": {
  4533. "$ref": "#/components/schemas/NotFoundError"
  4534. }
  4535. }
  4536. }
  4537. }
  4538. },
  4539. "description": "Delete a session and permanently remove all associated data, including messages and history.",
  4540. "summary": "Delete session",
  4541. "x-codeSamples": [
  4542. {
  4543. "lang": "js",
  4544. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.delete({\n ...\n})"
  4545. }
  4546. ]
  4547. },
  4548. "patch": {
  4549. "tags": ["session"],
  4550. "operationId": "session.update",
  4551. "parameters": [
  4552. {
  4553. "name": "directory",
  4554. "in": "query",
  4555. "required": false,
  4556. "schema": {
  4557. "type": "string"
  4558. }
  4559. },
  4560. {
  4561. "name": "workspace",
  4562. "in": "query",
  4563. "required": false,
  4564. "schema": {
  4565. "type": "string"
  4566. }
  4567. },
  4568. {
  4569. "name": "sessionID",
  4570. "in": "path",
  4571. "schema": {
  4572. "type": "string",
  4573. "pattern": "^ses.*"
  4574. },
  4575. "required": true
  4576. }
  4577. ],
  4578. "responses": {
  4579. "200": {
  4580. "description": "Successfully updated session",
  4581. "content": {
  4582. "application/json": {
  4583. "schema": {
  4584. "$ref": "#/components/schemas/Session"
  4585. }
  4586. }
  4587. }
  4588. },
  4589. "400": {
  4590. "description": "Bad request",
  4591. "content": {
  4592. "application/json": {
  4593. "schema": {
  4594. "$ref": "#/components/schemas/BadRequestError"
  4595. }
  4596. }
  4597. }
  4598. },
  4599. "404": {
  4600. "description": "Not found",
  4601. "content": {
  4602. "application/json": {
  4603. "schema": {
  4604. "$ref": "#/components/schemas/NotFoundError"
  4605. }
  4606. }
  4607. }
  4608. }
  4609. },
  4610. "description": "Update properties of an existing session, such as title or other metadata.",
  4611. "summary": "Update session",
  4612. "requestBody": {
  4613. "content": {
  4614. "application/json": {
  4615. "schema": {
  4616. "type": "object",
  4617. "properties": {
  4618. "title": {
  4619. "type": "string"
  4620. },
  4621. "permission": {
  4622. "$ref": "#/components/schemas/PermissionRuleset"
  4623. },
  4624. "time": {
  4625. "type": "object",
  4626. "properties": {
  4627. "archived": {
  4628. "type": "number"
  4629. }
  4630. },
  4631. "additionalProperties": false
  4632. }
  4633. },
  4634. "additionalProperties": false
  4635. }
  4636. }
  4637. }
  4638. },
  4639. "x-codeSamples": [
  4640. {
  4641. "lang": "js",
  4642. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.update({\n ...\n})"
  4643. }
  4644. ]
  4645. }
  4646. },
  4647. "/session/{sessionID}/children": {
  4648. "get": {
  4649. "tags": ["session"],
  4650. "operationId": "session.children",
  4651. "parameters": [
  4652. {
  4653. "name": "directory",
  4654. "in": "query",
  4655. "required": false,
  4656. "schema": {
  4657. "type": "string"
  4658. }
  4659. },
  4660. {
  4661. "name": "workspace",
  4662. "in": "query",
  4663. "required": false,
  4664. "schema": {
  4665. "type": "string"
  4666. }
  4667. },
  4668. {
  4669. "name": "sessionID",
  4670. "in": "path",
  4671. "schema": {
  4672. "type": "string",
  4673. "pattern": "^ses.*"
  4674. },
  4675. "required": true
  4676. }
  4677. ],
  4678. "responses": {
  4679. "200": {
  4680. "description": "List of children",
  4681. "content": {
  4682. "application/json": {
  4683. "schema": {
  4684. "type": "array",
  4685. "items": {
  4686. "$ref": "#/components/schemas/Session"
  4687. },
  4688. "description": "List of children"
  4689. }
  4690. }
  4691. }
  4692. },
  4693. "400": {
  4694. "description": "Bad request",
  4695. "content": {
  4696. "application/json": {
  4697. "schema": {
  4698. "$ref": "#/components/schemas/BadRequestError"
  4699. }
  4700. }
  4701. }
  4702. },
  4703. "404": {
  4704. "description": "Not found",
  4705. "content": {
  4706. "application/json": {
  4707. "schema": {
  4708. "$ref": "#/components/schemas/NotFoundError"
  4709. }
  4710. }
  4711. }
  4712. }
  4713. },
  4714. "description": "Retrieve all child sessions that were forked from the specified parent session.",
  4715. "summary": "Get session children",
  4716. "x-codeSamples": [
  4717. {
  4718. "lang": "js",
  4719. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.children({\n ...\n})"
  4720. }
  4721. ]
  4722. }
  4723. },
  4724. "/session/{sessionID}/todo": {
  4725. "get": {
  4726. "tags": ["session"],
  4727. "operationId": "session.todo",
  4728. "parameters": [
  4729. {
  4730. "name": "directory",
  4731. "in": "query",
  4732. "required": false,
  4733. "schema": {
  4734. "type": "string"
  4735. }
  4736. },
  4737. {
  4738. "name": "workspace",
  4739. "in": "query",
  4740. "required": false,
  4741. "schema": {
  4742. "type": "string"
  4743. }
  4744. },
  4745. {
  4746. "name": "sessionID",
  4747. "in": "path",
  4748. "schema": {
  4749. "type": "string",
  4750. "pattern": "^ses.*"
  4751. },
  4752. "required": true
  4753. }
  4754. ],
  4755. "responses": {
  4756. "200": {
  4757. "description": "Todo list",
  4758. "content": {
  4759. "application/json": {
  4760. "schema": {
  4761. "type": "array",
  4762. "items": {
  4763. "$ref": "#/components/schemas/Todo"
  4764. },
  4765. "description": "Todo list"
  4766. }
  4767. }
  4768. }
  4769. },
  4770. "400": {
  4771. "description": "Bad request",
  4772. "content": {
  4773. "application/json": {
  4774. "schema": {
  4775. "$ref": "#/components/schemas/BadRequestError"
  4776. }
  4777. }
  4778. }
  4779. },
  4780. "404": {
  4781. "description": "Not found",
  4782. "content": {
  4783. "application/json": {
  4784. "schema": {
  4785. "$ref": "#/components/schemas/NotFoundError"
  4786. }
  4787. }
  4788. }
  4789. }
  4790. },
  4791. "description": "Retrieve the todo list associated with a specific session, showing tasks and action items.",
  4792. "summary": "Get session todos",
  4793. "x-codeSamples": [
  4794. {
  4795. "lang": "js",
  4796. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.todo({\n ...\n})"
  4797. }
  4798. ]
  4799. }
  4800. },
  4801. "/session/{sessionID}/diff": {
  4802. "get": {
  4803. "tags": ["session"],
  4804. "operationId": "session.diff",
  4805. "parameters": [
  4806. {
  4807. "name": "directory",
  4808. "in": "query",
  4809. "required": false,
  4810. "schema": {
  4811. "type": "string"
  4812. }
  4813. },
  4814. {
  4815. "name": "workspace",
  4816. "in": "query",
  4817. "required": false,
  4818. "schema": {
  4819. "type": "string"
  4820. }
  4821. },
  4822. {
  4823. "name": "sessionID",
  4824. "in": "path",
  4825. "schema": {
  4826. "type": "string",
  4827. "pattern": "^ses.*"
  4828. },
  4829. "required": true
  4830. },
  4831. {
  4832. "name": "messageID",
  4833. "in": "query",
  4834. "schema": {
  4835. "type": "string",
  4836. "pattern": "^msg.*"
  4837. },
  4838. "required": false
  4839. }
  4840. ],
  4841. "responses": {
  4842. "200": {
  4843. "description": "Successfully retrieved diff",
  4844. "content": {
  4845. "application/json": {
  4846. "schema": {
  4847. "type": "array",
  4848. "items": {
  4849. "$ref": "#/components/schemas/SnapshotFileDiff"
  4850. },
  4851. "description": "Successfully retrieved diff"
  4852. }
  4853. }
  4854. }
  4855. }
  4856. },
  4857. "description": "Get the file changes (diff) that resulted from a specific user message in the session.",
  4858. "summary": "Get message diff",
  4859. "x-codeSamples": [
  4860. {
  4861. "lang": "js",
  4862. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.diff({\n ...\n})"
  4863. }
  4864. ]
  4865. }
  4866. },
  4867. "/session/{sessionID}/message": {
  4868. "get": {
  4869. "tags": ["session"],
  4870. "operationId": "session.messages",
  4871. "parameters": [
  4872. {
  4873. "name": "directory",
  4874. "in": "query",
  4875. "required": false,
  4876. "schema": {
  4877. "type": "string"
  4878. }
  4879. },
  4880. {
  4881. "name": "workspace",
  4882. "in": "query",
  4883. "required": false,
  4884. "schema": {
  4885. "type": "string"
  4886. }
  4887. },
  4888. {
  4889. "name": "sessionID",
  4890. "in": "path",
  4891. "schema": {
  4892. "type": "string",
  4893. "pattern": "^ses.*"
  4894. },
  4895. "required": true
  4896. },
  4897. {
  4898. "name": "limit",
  4899. "in": "query",
  4900. "schema": {
  4901. "type": "integer",
  4902. "minimum": 0,
  4903. "maximum": 9007199254740991
  4904. },
  4905. "required": false
  4906. },
  4907. {
  4908. "name": "before",
  4909. "in": "query",
  4910. "schema": {
  4911. "type": "string"
  4912. },
  4913. "required": false
  4914. }
  4915. ],
  4916. "responses": {
  4917. "200": {
  4918. "description": "List of messages",
  4919. "content": {
  4920. "application/json": {
  4921. "schema": {
  4922. "type": "array",
  4923. "items": {
  4924. "type": "object",
  4925. "properties": {
  4926. "info": {
  4927. "$ref": "#/components/schemas/Message"
  4928. },
  4929. "parts": {
  4930. "type": "array",
  4931. "items": {
  4932. "$ref": "#/components/schemas/Part"
  4933. }
  4934. }
  4935. },
  4936. "required": ["info", "parts"],
  4937. "additionalProperties": false
  4938. },
  4939. "description": "List of messages"
  4940. }
  4941. }
  4942. }
  4943. },
  4944. "400": {
  4945. "description": "Bad request",
  4946. "content": {
  4947. "application/json": {
  4948. "schema": {
  4949. "$ref": "#/components/schemas/BadRequestError"
  4950. }
  4951. }
  4952. }
  4953. },
  4954. "404": {
  4955. "description": "Not found",
  4956. "content": {
  4957. "application/json": {
  4958. "schema": {
  4959. "$ref": "#/components/schemas/NotFoundError"
  4960. }
  4961. }
  4962. }
  4963. }
  4964. },
  4965. "description": "Retrieve all messages in a session, including user prompts and AI responses.",
  4966. "summary": "Get session messages",
  4967. "x-codeSamples": [
  4968. {
  4969. "lang": "js",
  4970. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.messages({\n ...\n})"
  4971. }
  4972. ]
  4973. },
  4974. "post": {
  4975. "tags": ["session"],
  4976. "operationId": "session.prompt",
  4977. "parameters": [
  4978. {
  4979. "name": "directory",
  4980. "in": "query",
  4981. "required": false,
  4982. "schema": {
  4983. "type": "string"
  4984. }
  4985. },
  4986. {
  4987. "name": "workspace",
  4988. "in": "query",
  4989. "required": false,
  4990. "schema": {
  4991. "type": "string"
  4992. }
  4993. },
  4994. {
  4995. "name": "sessionID",
  4996. "in": "path",
  4997. "schema": {
  4998. "type": "string",
  4999. "pattern": "^ses.*"
  5000. },
  5001. "required": true
  5002. }
  5003. ],
  5004. "responses": {
  5005. "200": {
  5006. "description": "Created message",
  5007. "content": {
  5008. "application/json": {
  5009. "schema": {
  5010. "type": "object",
  5011. "required": ["info", "parts"],
  5012. "properties": {
  5013. "info": {
  5014. "$ref": "#/components/schemas/AssistantMessage"
  5015. },
  5016. "parts": {
  5017. "type": "array",
  5018. "items": {
  5019. "$ref": "#/components/schemas/Part"
  5020. }
  5021. }
  5022. }
  5023. }
  5024. }
  5025. }
  5026. },
  5027. "400": {
  5028. "description": "Bad request",
  5029. "content": {
  5030. "application/json": {
  5031. "schema": {
  5032. "$ref": "#/components/schemas/BadRequestError"
  5033. }
  5034. }
  5035. }
  5036. },
  5037. "404": {
  5038. "description": "Not found",
  5039. "content": {
  5040. "application/json": {
  5041. "schema": {
  5042. "$ref": "#/components/schemas/NotFoundError"
  5043. }
  5044. }
  5045. }
  5046. }
  5047. },
  5048. "description": "Create and send a new message to a session, streaming the AI response.",
  5049. "summary": "Send message",
  5050. "requestBody": {
  5051. "content": {
  5052. "application/json": {
  5053. "schema": {
  5054. "type": "object",
  5055. "properties": {
  5056. "messageID": {
  5057. "type": "string"
  5058. },
  5059. "model": {
  5060. "type": "object",
  5061. "properties": {
  5062. "providerID": {
  5063. "type": "string"
  5064. },
  5065. "modelID": {
  5066. "type": "string"
  5067. }
  5068. },
  5069. "required": ["providerID", "modelID"],
  5070. "additionalProperties": false
  5071. },
  5072. "agent": {
  5073. "type": "string"
  5074. },
  5075. "noReply": {
  5076. "type": "boolean"
  5077. },
  5078. "tools": {
  5079. "type": "object",
  5080. "additionalProperties": {
  5081. "type": "boolean"
  5082. }
  5083. },
  5084. "format": {
  5085. "$ref": "#/components/schemas/OutputFormat"
  5086. },
  5087. "system": {
  5088. "type": "string"
  5089. },
  5090. "variant": {
  5091. "type": "string"
  5092. },
  5093. "parts": {
  5094. "type": "array",
  5095. "items": {
  5096. "anyOf": [
  5097. {
  5098. "$ref": "#/components/schemas/TextPartInput"
  5099. },
  5100. {
  5101. "$ref": "#/components/schemas/FilePartInput"
  5102. },
  5103. {
  5104. "$ref": "#/components/schemas/AgentPartInput"
  5105. },
  5106. {
  5107. "$ref": "#/components/schemas/SubtaskPartInput"
  5108. }
  5109. ]
  5110. }
  5111. }
  5112. },
  5113. "required": ["parts"],
  5114. "additionalProperties": false
  5115. }
  5116. }
  5117. }
  5118. },
  5119. "x-codeSamples": [
  5120. {
  5121. "lang": "js",
  5122. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.prompt({\n ...\n})"
  5123. }
  5124. ]
  5125. }
  5126. },
  5127. "/session/{sessionID}/message/{messageID}": {
  5128. "get": {
  5129. "tags": ["session"],
  5130. "operationId": "session.message",
  5131. "parameters": [
  5132. {
  5133. "name": "directory",
  5134. "in": "query",
  5135. "required": false,
  5136. "schema": {
  5137. "type": "string"
  5138. }
  5139. },
  5140. {
  5141. "name": "workspace",
  5142. "in": "query",
  5143. "required": false,
  5144. "schema": {
  5145. "type": "string"
  5146. }
  5147. },
  5148. {
  5149. "name": "sessionID",
  5150. "in": "path",
  5151. "schema": {
  5152. "type": "string",
  5153. "pattern": "^ses.*"
  5154. },
  5155. "required": true
  5156. },
  5157. {
  5158. "name": "messageID",
  5159. "in": "path",
  5160. "schema": {
  5161. "type": "string",
  5162. "pattern": "^msg.*"
  5163. },
  5164. "required": true
  5165. }
  5166. ],
  5167. "responses": {
  5168. "200": {
  5169. "description": "Message",
  5170. "content": {
  5171. "application/json": {
  5172. "schema": {
  5173. "type": "object",
  5174. "properties": {
  5175. "info": {
  5176. "$ref": "#/components/schemas/Message"
  5177. },
  5178. "parts": {
  5179. "type": "array",
  5180. "items": {
  5181. "$ref": "#/components/schemas/Part"
  5182. }
  5183. }
  5184. },
  5185. "required": ["info", "parts"],
  5186. "additionalProperties": false,
  5187. "description": "Message"
  5188. }
  5189. }
  5190. }
  5191. },
  5192. "400": {
  5193. "description": "Bad request",
  5194. "content": {
  5195. "application/json": {
  5196. "schema": {
  5197. "$ref": "#/components/schemas/BadRequestError"
  5198. }
  5199. }
  5200. }
  5201. },
  5202. "404": {
  5203. "description": "Not found",
  5204. "content": {
  5205. "application/json": {
  5206. "schema": {
  5207. "$ref": "#/components/schemas/NotFoundError"
  5208. }
  5209. }
  5210. }
  5211. }
  5212. },
  5213. "description": "Retrieve a specific message from a session by its message ID.",
  5214. "summary": "Get message",
  5215. "x-codeSamples": [
  5216. {
  5217. "lang": "js",
  5218. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.message({\n ...\n})"
  5219. }
  5220. ]
  5221. },
  5222. "delete": {
  5223. "tags": ["session"],
  5224. "operationId": "session.deleteMessage",
  5225. "parameters": [
  5226. {
  5227. "name": "directory",
  5228. "in": "query",
  5229. "required": false,
  5230. "schema": {
  5231. "type": "string"
  5232. }
  5233. },
  5234. {
  5235. "name": "workspace",
  5236. "in": "query",
  5237. "required": false,
  5238. "schema": {
  5239. "type": "string"
  5240. }
  5241. },
  5242. {
  5243. "name": "sessionID",
  5244. "in": "path",
  5245. "schema": {
  5246. "type": "string",
  5247. "pattern": "^ses.*"
  5248. },
  5249. "required": true
  5250. },
  5251. {
  5252. "name": "messageID",
  5253. "in": "path",
  5254. "schema": {
  5255. "type": "string",
  5256. "pattern": "^msg.*"
  5257. },
  5258. "required": true
  5259. }
  5260. ],
  5261. "responses": {
  5262. "200": {
  5263. "description": "Successfully deleted message",
  5264. "content": {
  5265. "application/json": {
  5266. "schema": {
  5267. "type": "boolean",
  5268. "description": "Successfully deleted message"
  5269. }
  5270. }
  5271. }
  5272. },
  5273. "400": {
  5274. "description": "Bad request",
  5275. "content": {
  5276. "application/json": {
  5277. "schema": {
  5278. "$ref": "#/components/schemas/BadRequestError"
  5279. }
  5280. }
  5281. }
  5282. },
  5283. "404": {
  5284. "description": "Not found",
  5285. "content": {
  5286. "application/json": {
  5287. "schema": {
  5288. "$ref": "#/components/schemas/NotFoundError"
  5289. }
  5290. }
  5291. }
  5292. }
  5293. },
  5294. "description": "Permanently delete a specific message and all of its parts from a session without reverting file changes.",
  5295. "summary": "Delete message",
  5296. "x-codeSamples": [
  5297. {
  5298. "lang": "js",
  5299. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.deleteMessage({\n ...\n})"
  5300. }
  5301. ]
  5302. }
  5303. },
  5304. "/session/{sessionID}/fork": {
  5305. "post": {
  5306. "tags": ["session"],
  5307. "operationId": "session.fork",
  5308. "parameters": [
  5309. {
  5310. "name": "directory",
  5311. "in": "query",
  5312. "required": false,
  5313. "schema": {
  5314. "type": "string"
  5315. }
  5316. },
  5317. {
  5318. "name": "workspace",
  5319. "in": "query",
  5320. "required": false,
  5321. "schema": {
  5322. "type": "string"
  5323. }
  5324. },
  5325. {
  5326. "name": "sessionID",
  5327. "in": "path",
  5328. "schema": {
  5329. "type": "string",
  5330. "pattern": "^ses.*"
  5331. },
  5332. "required": true
  5333. }
  5334. ],
  5335. "responses": {
  5336. "200": {
  5337. "description": "200",
  5338. "content": {
  5339. "application/json": {
  5340. "schema": {
  5341. "$ref": "#/components/schemas/Session"
  5342. }
  5343. }
  5344. }
  5345. }
  5346. },
  5347. "description": "Create a new session by forking an existing session at a specific message point.",
  5348. "summary": "Fork session",
  5349. "requestBody": {
  5350. "content": {
  5351. "application/json": {
  5352. "schema": {
  5353. "type": "object",
  5354. "properties": {
  5355. "messageID": {
  5356. "type": "string"
  5357. }
  5358. },
  5359. "additionalProperties": false
  5360. }
  5361. }
  5362. }
  5363. },
  5364. "x-codeSamples": [
  5365. {
  5366. "lang": "js",
  5367. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.fork({\n ...\n})"
  5368. }
  5369. ]
  5370. }
  5371. },
  5372. "/session/{sessionID}/abort": {
  5373. "post": {
  5374. "tags": ["session"],
  5375. "operationId": "session.abort",
  5376. "parameters": [
  5377. {
  5378. "name": "directory",
  5379. "in": "query",
  5380. "required": false,
  5381. "schema": {
  5382. "type": "string"
  5383. }
  5384. },
  5385. {
  5386. "name": "workspace",
  5387. "in": "query",
  5388. "required": false,
  5389. "schema": {
  5390. "type": "string"
  5391. }
  5392. },
  5393. {
  5394. "name": "sessionID",
  5395. "in": "path",
  5396. "schema": {
  5397. "type": "string",
  5398. "pattern": "^ses.*"
  5399. },
  5400. "required": true
  5401. }
  5402. ],
  5403. "responses": {
  5404. "200": {
  5405. "description": "Aborted session",
  5406. "content": {
  5407. "application/json": {
  5408. "schema": {
  5409. "type": "boolean",
  5410. "description": "Aborted session"
  5411. }
  5412. }
  5413. }
  5414. },
  5415. "400": {
  5416. "description": "Bad request",
  5417. "content": {
  5418. "application/json": {
  5419. "schema": {
  5420. "$ref": "#/components/schemas/BadRequestError"
  5421. }
  5422. }
  5423. }
  5424. },
  5425. "404": {
  5426. "description": "Not found",
  5427. "content": {
  5428. "application/json": {
  5429. "schema": {
  5430. "$ref": "#/components/schemas/NotFoundError"
  5431. }
  5432. }
  5433. }
  5434. }
  5435. },
  5436. "description": "Abort an active session and stop any ongoing AI processing or command execution.",
  5437. "summary": "Abort session",
  5438. "x-codeSamples": [
  5439. {
  5440. "lang": "js",
  5441. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.abort({\n ...\n})"
  5442. }
  5443. ]
  5444. }
  5445. },
  5446. "/session/{sessionID}/init": {
  5447. "post": {
  5448. "tags": ["session"],
  5449. "operationId": "session.init",
  5450. "parameters": [
  5451. {
  5452. "name": "directory",
  5453. "in": "query",
  5454. "required": false,
  5455. "schema": {
  5456. "type": "string"
  5457. }
  5458. },
  5459. {
  5460. "name": "workspace",
  5461. "in": "query",
  5462. "required": false,
  5463. "schema": {
  5464. "type": "string"
  5465. }
  5466. },
  5467. {
  5468. "name": "sessionID",
  5469. "in": "path",
  5470. "schema": {
  5471. "type": "string",
  5472. "pattern": "^ses.*"
  5473. },
  5474. "required": true
  5475. }
  5476. ],
  5477. "responses": {
  5478. "200": {
  5479. "description": "200",
  5480. "content": {
  5481. "application/json": {
  5482. "schema": {
  5483. "type": "boolean",
  5484. "description": "200"
  5485. }
  5486. }
  5487. }
  5488. },
  5489. "400": {
  5490. "description": "Bad request",
  5491. "content": {
  5492. "application/json": {
  5493. "schema": {
  5494. "$ref": "#/components/schemas/BadRequestError"
  5495. }
  5496. }
  5497. }
  5498. },
  5499. "404": {
  5500. "description": "Not found",
  5501. "content": {
  5502. "application/json": {
  5503. "schema": {
  5504. "$ref": "#/components/schemas/NotFoundError"
  5505. }
  5506. }
  5507. }
  5508. }
  5509. },
  5510. "description": "Analyze the current application and create an AGENTS.md file with project-specific agent configurations.",
  5511. "summary": "Initialize session",
  5512. "requestBody": {
  5513. "content": {
  5514. "application/json": {
  5515. "schema": {
  5516. "type": "object",
  5517. "properties": {
  5518. "modelID": {
  5519. "type": "string"
  5520. },
  5521. "providerID": {
  5522. "type": "string"
  5523. },
  5524. "messageID": {
  5525. "type": "string"
  5526. }
  5527. },
  5528. "required": ["modelID", "providerID", "messageID"],
  5529. "additionalProperties": false
  5530. }
  5531. }
  5532. }
  5533. },
  5534. "x-codeSamples": [
  5535. {
  5536. "lang": "js",
  5537. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.init({\n ...\n})"
  5538. }
  5539. ]
  5540. }
  5541. },
  5542. "/session/{sessionID}/share": {
  5543. "post": {
  5544. "tags": ["session"],
  5545. "operationId": "session.share",
  5546. "parameters": [
  5547. {
  5548. "name": "directory",
  5549. "in": "query",
  5550. "required": false,
  5551. "schema": {
  5552. "type": "string"
  5553. }
  5554. },
  5555. {
  5556. "name": "workspace",
  5557. "in": "query",
  5558. "required": false,
  5559. "schema": {
  5560. "type": "string"
  5561. }
  5562. },
  5563. {
  5564. "name": "sessionID",
  5565. "in": "path",
  5566. "schema": {
  5567. "type": "string",
  5568. "pattern": "^ses.*"
  5569. },
  5570. "required": true
  5571. }
  5572. ],
  5573. "responses": {
  5574. "200": {
  5575. "description": "Successfully shared session",
  5576. "content": {
  5577. "application/json": {
  5578. "schema": {
  5579. "$ref": "#/components/schemas/Session"
  5580. }
  5581. }
  5582. }
  5583. },
  5584. "400": {
  5585. "description": "Bad request",
  5586. "content": {
  5587. "application/json": {
  5588. "schema": {
  5589. "$ref": "#/components/schemas/BadRequestError"
  5590. }
  5591. }
  5592. }
  5593. },
  5594. "404": {
  5595. "description": "Not found",
  5596. "content": {
  5597. "application/json": {
  5598. "schema": {
  5599. "$ref": "#/components/schemas/NotFoundError"
  5600. }
  5601. }
  5602. }
  5603. }
  5604. },
  5605. "description": "Create a shareable link for a session, allowing others to view the conversation.",
  5606. "summary": "Share session",
  5607. "x-codeSamples": [
  5608. {
  5609. "lang": "js",
  5610. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.share({\n ...\n})"
  5611. }
  5612. ]
  5613. },
  5614. "delete": {
  5615. "tags": ["session"],
  5616. "operationId": "session.unshare",
  5617. "parameters": [
  5618. {
  5619. "name": "directory",
  5620. "in": "query",
  5621. "required": false,
  5622. "schema": {
  5623. "type": "string"
  5624. }
  5625. },
  5626. {
  5627. "name": "workspace",
  5628. "in": "query",
  5629. "required": false,
  5630. "schema": {
  5631. "type": "string"
  5632. }
  5633. },
  5634. {
  5635. "name": "sessionID",
  5636. "in": "path",
  5637. "schema": {
  5638. "type": "string",
  5639. "pattern": "^ses.*"
  5640. },
  5641. "required": true
  5642. }
  5643. ],
  5644. "responses": {
  5645. "200": {
  5646. "description": "Successfully unshared session",
  5647. "content": {
  5648. "application/json": {
  5649. "schema": {
  5650. "$ref": "#/components/schemas/Session"
  5651. }
  5652. }
  5653. }
  5654. },
  5655. "400": {
  5656. "description": "Bad request",
  5657. "content": {
  5658. "application/json": {
  5659. "schema": {
  5660. "$ref": "#/components/schemas/BadRequestError"
  5661. }
  5662. }
  5663. }
  5664. },
  5665. "404": {
  5666. "description": "Not found",
  5667. "content": {
  5668. "application/json": {
  5669. "schema": {
  5670. "$ref": "#/components/schemas/NotFoundError"
  5671. }
  5672. }
  5673. }
  5674. }
  5675. },
  5676. "description": "Remove the shareable link for a session, making it private again.",
  5677. "summary": "Unshare session",
  5678. "x-codeSamples": [
  5679. {
  5680. "lang": "js",
  5681. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.unshare({\n ...\n})"
  5682. }
  5683. ]
  5684. }
  5685. },
  5686. "/session/{sessionID}/summarize": {
  5687. "post": {
  5688. "tags": ["session"],
  5689. "operationId": "session.summarize",
  5690. "parameters": [
  5691. {
  5692. "name": "directory",
  5693. "in": "query",
  5694. "required": false,
  5695. "schema": {
  5696. "type": "string"
  5697. }
  5698. },
  5699. {
  5700. "name": "workspace",
  5701. "in": "query",
  5702. "required": false,
  5703. "schema": {
  5704. "type": "string"
  5705. }
  5706. },
  5707. {
  5708. "name": "sessionID",
  5709. "in": "path",
  5710. "schema": {
  5711. "type": "string",
  5712. "pattern": "^ses.*"
  5713. },
  5714. "required": true
  5715. }
  5716. ],
  5717. "responses": {
  5718. "200": {
  5719. "description": "Summarized session",
  5720. "content": {
  5721. "application/json": {
  5722. "schema": {
  5723. "type": "boolean",
  5724. "description": "Summarized session"
  5725. }
  5726. }
  5727. }
  5728. },
  5729. "400": {
  5730. "description": "Bad request",
  5731. "content": {
  5732. "application/json": {
  5733. "schema": {
  5734. "$ref": "#/components/schemas/BadRequestError"
  5735. }
  5736. }
  5737. }
  5738. },
  5739. "404": {
  5740. "description": "Not found",
  5741. "content": {
  5742. "application/json": {
  5743. "schema": {
  5744. "$ref": "#/components/schemas/NotFoundError"
  5745. }
  5746. }
  5747. }
  5748. }
  5749. },
  5750. "description": "Generate a concise summary of the session using AI compaction to preserve key information.",
  5751. "summary": "Summarize session",
  5752. "requestBody": {
  5753. "content": {
  5754. "application/json": {
  5755. "schema": {
  5756. "type": "object",
  5757. "properties": {
  5758. "providerID": {
  5759. "type": "string"
  5760. },
  5761. "modelID": {
  5762. "type": "string"
  5763. },
  5764. "auto": {
  5765. "type": "boolean"
  5766. }
  5767. },
  5768. "required": ["providerID", "modelID"],
  5769. "additionalProperties": false
  5770. }
  5771. }
  5772. }
  5773. },
  5774. "x-codeSamples": [
  5775. {
  5776. "lang": "js",
  5777. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.summarize({\n ...\n})"
  5778. }
  5779. ]
  5780. }
  5781. },
  5782. "/session/{sessionID}/prompt_async": {
  5783. "post": {
  5784. "tags": ["session"],
  5785. "operationId": "session.prompt_async",
  5786. "parameters": [
  5787. {
  5788. "name": "directory",
  5789. "in": "query",
  5790. "required": false,
  5791. "schema": {
  5792. "type": "string"
  5793. }
  5794. },
  5795. {
  5796. "name": "workspace",
  5797. "in": "query",
  5798. "required": false,
  5799. "schema": {
  5800. "type": "string"
  5801. }
  5802. },
  5803. {
  5804. "name": "sessionID",
  5805. "in": "path",
  5806. "schema": {
  5807. "type": "string",
  5808. "pattern": "^ses.*"
  5809. },
  5810. "required": true
  5811. }
  5812. ],
  5813. "responses": {
  5814. "204": {
  5815. "description": "Prompt accepted"
  5816. },
  5817. "400": {
  5818. "description": "Bad request",
  5819. "content": {
  5820. "application/json": {
  5821. "schema": {
  5822. "$ref": "#/components/schemas/BadRequestError"
  5823. }
  5824. }
  5825. }
  5826. },
  5827. "404": {
  5828. "description": "Not found",
  5829. "content": {
  5830. "application/json": {
  5831. "schema": {
  5832. "$ref": "#/components/schemas/NotFoundError"
  5833. }
  5834. }
  5835. }
  5836. }
  5837. },
  5838. "description": "Create and send a new message to a session asynchronously, starting the session if needed and returning immediately.",
  5839. "summary": "Send async message",
  5840. "requestBody": {
  5841. "content": {
  5842. "application/json": {
  5843. "schema": {
  5844. "type": "object",
  5845. "properties": {
  5846. "messageID": {
  5847. "type": "string"
  5848. },
  5849. "model": {
  5850. "type": "object",
  5851. "properties": {
  5852. "providerID": {
  5853. "type": "string"
  5854. },
  5855. "modelID": {
  5856. "type": "string"
  5857. }
  5858. },
  5859. "required": ["providerID", "modelID"],
  5860. "additionalProperties": false
  5861. },
  5862. "agent": {
  5863. "type": "string"
  5864. },
  5865. "noReply": {
  5866. "type": "boolean"
  5867. },
  5868. "tools": {
  5869. "type": "object",
  5870. "additionalProperties": {
  5871. "type": "boolean"
  5872. }
  5873. },
  5874. "format": {
  5875. "$ref": "#/components/schemas/OutputFormat"
  5876. },
  5877. "system": {
  5878. "type": "string"
  5879. },
  5880. "variant": {
  5881. "type": "string"
  5882. },
  5883. "parts": {
  5884. "type": "array",
  5885. "items": {
  5886. "anyOf": [
  5887. {
  5888. "$ref": "#/components/schemas/TextPartInput"
  5889. },
  5890. {
  5891. "$ref": "#/components/schemas/FilePartInput"
  5892. },
  5893. {
  5894. "$ref": "#/components/schemas/AgentPartInput"
  5895. },
  5896. {
  5897. "$ref": "#/components/schemas/SubtaskPartInput"
  5898. }
  5899. ]
  5900. }
  5901. }
  5902. },
  5903. "required": ["parts"],
  5904. "additionalProperties": false
  5905. }
  5906. }
  5907. }
  5908. },
  5909. "x-codeSamples": [
  5910. {
  5911. "lang": "js",
  5912. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.prompt_async({\n ...\n})"
  5913. }
  5914. ]
  5915. }
  5916. },
  5917. "/session/{sessionID}/command": {
  5918. "post": {
  5919. "tags": ["session"],
  5920. "operationId": "session.command",
  5921. "parameters": [
  5922. {
  5923. "name": "directory",
  5924. "in": "query",
  5925. "required": false,
  5926. "schema": {
  5927. "type": "string"
  5928. }
  5929. },
  5930. {
  5931. "name": "workspace",
  5932. "in": "query",
  5933. "required": false,
  5934. "schema": {
  5935. "type": "string"
  5936. }
  5937. },
  5938. {
  5939. "name": "sessionID",
  5940. "in": "path",
  5941. "schema": {
  5942. "type": "string",
  5943. "pattern": "^ses.*"
  5944. },
  5945. "required": true
  5946. }
  5947. ],
  5948. "responses": {
  5949. "200": {
  5950. "description": "Created message",
  5951. "content": {
  5952. "application/json": {
  5953. "schema": {
  5954. "type": "object",
  5955. "required": ["info", "parts"],
  5956. "properties": {
  5957. "info": {
  5958. "$ref": "#/components/schemas/AssistantMessage"
  5959. },
  5960. "parts": {
  5961. "type": "array",
  5962. "items": {
  5963. "$ref": "#/components/schemas/Part"
  5964. }
  5965. }
  5966. }
  5967. }
  5968. }
  5969. }
  5970. },
  5971. "400": {
  5972. "description": "Bad request",
  5973. "content": {
  5974. "application/json": {
  5975. "schema": {
  5976. "$ref": "#/components/schemas/BadRequestError"
  5977. }
  5978. }
  5979. }
  5980. },
  5981. "404": {
  5982. "description": "Not found",
  5983. "content": {
  5984. "application/json": {
  5985. "schema": {
  5986. "$ref": "#/components/schemas/NotFoundError"
  5987. }
  5988. }
  5989. }
  5990. }
  5991. },
  5992. "description": "Send a new command to a session for execution by the AI assistant.",
  5993. "summary": "Send command",
  5994. "requestBody": {
  5995. "content": {
  5996. "application/json": {
  5997. "schema": {
  5998. "type": "object",
  5999. "properties": {
  6000. "messageID": {
  6001. "type": "string"
  6002. },
  6003. "agent": {
  6004. "type": "string"
  6005. },
  6006. "model": {
  6007. "type": "string"
  6008. },
  6009. "arguments": {
  6010. "type": "string"
  6011. },
  6012. "command": {
  6013. "type": "string"
  6014. },
  6015. "variant": {
  6016. "type": "string"
  6017. },
  6018. "parts": {
  6019. "type": "array",
  6020. "items": {
  6021. "type": "object",
  6022. "properties": {
  6023. "id": {
  6024. "type": "string"
  6025. },
  6026. "type": {
  6027. "type": "string",
  6028. "enum": ["file"]
  6029. },
  6030. "mime": {
  6031. "type": "string"
  6032. },
  6033. "filename": {
  6034. "type": "string"
  6035. },
  6036. "url": {
  6037. "type": "string"
  6038. },
  6039. "source": {
  6040. "$ref": "#/components/schemas/FilePartSource"
  6041. }
  6042. },
  6043. "required": ["type", "mime", "url"],
  6044. "additionalProperties": false
  6045. }
  6046. }
  6047. },
  6048. "required": ["arguments", "command"],
  6049. "additionalProperties": false
  6050. }
  6051. }
  6052. }
  6053. },
  6054. "x-codeSamples": [
  6055. {
  6056. "lang": "js",
  6057. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.command({\n ...\n})"
  6058. }
  6059. ]
  6060. }
  6061. },
  6062. "/session/{sessionID}/shell": {
  6063. "post": {
  6064. "tags": ["session"],
  6065. "operationId": "session.shell",
  6066. "parameters": [
  6067. {
  6068. "name": "directory",
  6069. "in": "query",
  6070. "required": false,
  6071. "schema": {
  6072. "type": "string"
  6073. }
  6074. },
  6075. {
  6076. "name": "workspace",
  6077. "in": "query",
  6078. "required": false,
  6079. "schema": {
  6080. "type": "string"
  6081. }
  6082. },
  6083. {
  6084. "name": "sessionID",
  6085. "in": "path",
  6086. "schema": {
  6087. "type": "string",
  6088. "pattern": "^ses.*"
  6089. },
  6090. "required": true
  6091. }
  6092. ],
  6093. "responses": {
  6094. "200": {
  6095. "description": "Created message",
  6096. "content": {
  6097. "application/json": {
  6098. "schema": {
  6099. "type": "object",
  6100. "properties": {
  6101. "info": {
  6102. "$ref": "#/components/schemas/Message"
  6103. },
  6104. "parts": {
  6105. "type": "array",
  6106. "items": {
  6107. "$ref": "#/components/schemas/Part"
  6108. }
  6109. }
  6110. },
  6111. "required": ["info", "parts"],
  6112. "additionalProperties": false,
  6113. "description": "Created message"
  6114. }
  6115. }
  6116. }
  6117. },
  6118. "400": {
  6119. "description": "Bad request",
  6120. "content": {
  6121. "application/json": {
  6122. "schema": {
  6123. "$ref": "#/components/schemas/BadRequestError"
  6124. }
  6125. }
  6126. }
  6127. },
  6128. "404": {
  6129. "description": "Not found",
  6130. "content": {
  6131. "application/json": {
  6132. "schema": {
  6133. "$ref": "#/components/schemas/NotFoundError"
  6134. }
  6135. }
  6136. }
  6137. }
  6138. },
  6139. "description": "Execute a shell command within the session context and return the AI's response.",
  6140. "summary": "Run shell command",
  6141. "requestBody": {
  6142. "content": {
  6143. "application/json": {
  6144. "schema": {
  6145. "type": "object",
  6146. "properties": {
  6147. "messageID": {
  6148. "type": "string"
  6149. },
  6150. "agent": {
  6151. "type": "string"
  6152. },
  6153. "model": {
  6154. "type": "object",
  6155. "properties": {
  6156. "providerID": {
  6157. "type": "string"
  6158. },
  6159. "modelID": {
  6160. "type": "string"
  6161. }
  6162. },
  6163. "required": ["providerID", "modelID"],
  6164. "additionalProperties": false
  6165. },
  6166. "command": {
  6167. "type": "string"
  6168. }
  6169. },
  6170. "required": ["agent", "command"],
  6171. "additionalProperties": false
  6172. }
  6173. }
  6174. }
  6175. },
  6176. "x-codeSamples": [
  6177. {
  6178. "lang": "js",
  6179. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.shell({\n ...\n})"
  6180. }
  6181. ]
  6182. }
  6183. },
  6184. "/session/{sessionID}/revert": {
  6185. "post": {
  6186. "tags": ["session"],
  6187. "operationId": "session.revert",
  6188. "parameters": [
  6189. {
  6190. "name": "directory",
  6191. "in": "query",
  6192. "required": false,
  6193. "schema": {
  6194. "type": "string"
  6195. }
  6196. },
  6197. {
  6198. "name": "workspace",
  6199. "in": "query",
  6200. "required": false,
  6201. "schema": {
  6202. "type": "string"
  6203. }
  6204. },
  6205. {
  6206. "name": "sessionID",
  6207. "in": "path",
  6208. "schema": {
  6209. "type": "string",
  6210. "pattern": "^ses.*"
  6211. },
  6212. "required": true
  6213. }
  6214. ],
  6215. "responses": {
  6216. "200": {
  6217. "description": "Updated session",
  6218. "content": {
  6219. "application/json": {
  6220. "schema": {
  6221. "$ref": "#/components/schemas/Session"
  6222. }
  6223. }
  6224. }
  6225. },
  6226. "400": {
  6227. "description": "Bad request",
  6228. "content": {
  6229. "application/json": {
  6230. "schema": {
  6231. "$ref": "#/components/schemas/BadRequestError"
  6232. }
  6233. }
  6234. }
  6235. },
  6236. "404": {
  6237. "description": "Not found",
  6238. "content": {
  6239. "application/json": {
  6240. "schema": {
  6241. "$ref": "#/components/schemas/NotFoundError"
  6242. }
  6243. }
  6244. }
  6245. }
  6246. },
  6247. "description": "Revert a specific message in a session, undoing its effects and restoring the previous state.",
  6248. "summary": "Revert message",
  6249. "requestBody": {
  6250. "content": {
  6251. "application/json": {
  6252. "schema": {
  6253. "type": "object",
  6254. "properties": {
  6255. "messageID": {
  6256. "type": "string"
  6257. },
  6258. "partID": {
  6259. "type": "string"
  6260. }
  6261. },
  6262. "required": ["messageID"],
  6263. "additionalProperties": false
  6264. }
  6265. }
  6266. }
  6267. },
  6268. "x-codeSamples": [
  6269. {
  6270. "lang": "js",
  6271. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.revert({\n ...\n})"
  6272. }
  6273. ]
  6274. }
  6275. },
  6276. "/session/{sessionID}/unrevert": {
  6277. "post": {
  6278. "tags": ["session"],
  6279. "operationId": "session.unrevert",
  6280. "parameters": [
  6281. {
  6282. "name": "directory",
  6283. "in": "query",
  6284. "required": false,
  6285. "schema": {
  6286. "type": "string"
  6287. }
  6288. },
  6289. {
  6290. "name": "workspace",
  6291. "in": "query",
  6292. "required": false,
  6293. "schema": {
  6294. "type": "string"
  6295. }
  6296. },
  6297. {
  6298. "name": "sessionID",
  6299. "in": "path",
  6300. "schema": {
  6301. "type": "string",
  6302. "pattern": "^ses.*"
  6303. },
  6304. "required": true
  6305. }
  6306. ],
  6307. "responses": {
  6308. "200": {
  6309. "description": "Updated session",
  6310. "content": {
  6311. "application/json": {
  6312. "schema": {
  6313. "$ref": "#/components/schemas/Session"
  6314. }
  6315. }
  6316. }
  6317. },
  6318. "400": {
  6319. "description": "Bad request",
  6320. "content": {
  6321. "application/json": {
  6322. "schema": {
  6323. "$ref": "#/components/schemas/BadRequestError"
  6324. }
  6325. }
  6326. }
  6327. },
  6328. "404": {
  6329. "description": "Not found",
  6330. "content": {
  6331. "application/json": {
  6332. "schema": {
  6333. "$ref": "#/components/schemas/NotFoundError"
  6334. }
  6335. }
  6336. }
  6337. }
  6338. },
  6339. "description": "Restore all previously reverted messages in a session.",
  6340. "summary": "Restore reverted messages",
  6341. "x-codeSamples": [
  6342. {
  6343. "lang": "js",
  6344. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.unrevert({\n ...\n})"
  6345. }
  6346. ]
  6347. }
  6348. },
  6349. "/session/{sessionID}/permissions/{permissionID}": {
  6350. "post": {
  6351. "tags": ["session"],
  6352. "operationId": "permission.respond",
  6353. "parameters": [
  6354. {
  6355. "name": "directory",
  6356. "in": "query",
  6357. "required": false,
  6358. "schema": {
  6359. "type": "string"
  6360. }
  6361. },
  6362. {
  6363. "name": "workspace",
  6364. "in": "query",
  6365. "required": false,
  6366. "schema": {
  6367. "type": "string"
  6368. }
  6369. },
  6370. {
  6371. "name": "sessionID",
  6372. "in": "path",
  6373. "schema": {
  6374. "type": "string",
  6375. "pattern": "^ses.*"
  6376. },
  6377. "required": true
  6378. },
  6379. {
  6380. "name": "permissionID",
  6381. "in": "path",
  6382. "schema": {
  6383. "type": "string",
  6384. "pattern": "^per.*"
  6385. },
  6386. "required": true
  6387. }
  6388. ],
  6389. "responses": {
  6390. "200": {
  6391. "description": "Permission processed successfully",
  6392. "content": {
  6393. "application/json": {
  6394. "schema": {
  6395. "type": "boolean",
  6396. "description": "Permission processed successfully"
  6397. }
  6398. }
  6399. }
  6400. },
  6401. "400": {
  6402. "description": "Bad request",
  6403. "content": {
  6404. "application/json": {
  6405. "schema": {
  6406. "$ref": "#/components/schemas/BadRequestError"
  6407. }
  6408. }
  6409. }
  6410. },
  6411. "404": {
  6412. "description": "Not found",
  6413. "content": {
  6414. "application/json": {
  6415. "schema": {
  6416. "$ref": "#/components/schemas/NotFoundError"
  6417. }
  6418. }
  6419. }
  6420. }
  6421. },
  6422. "description": "Approve or deny a permission request from the AI assistant.",
  6423. "summary": "Respond to permission",
  6424. "deprecated": true,
  6425. "requestBody": {
  6426. "content": {
  6427. "application/json": {
  6428. "schema": {
  6429. "type": "object",
  6430. "properties": {
  6431. "response": {
  6432. "type": "string",
  6433. "enum": ["once", "always", "reject"]
  6434. }
  6435. },
  6436. "required": ["response"],
  6437. "additionalProperties": false
  6438. }
  6439. }
  6440. }
  6441. },
  6442. "x-codeSamples": [
  6443. {
  6444. "lang": "js",
  6445. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.permission.respond({\n ...\n})"
  6446. }
  6447. ]
  6448. }
  6449. },
  6450. "/session/{sessionID}/message/{messageID}/part/{partID}": {
  6451. "delete": {
  6452. "tags": ["session"],
  6453. "operationId": "part.delete",
  6454. "parameters": [
  6455. {
  6456. "name": "directory",
  6457. "in": "query",
  6458. "required": false,
  6459. "schema": {
  6460. "type": "string"
  6461. }
  6462. },
  6463. {
  6464. "name": "workspace",
  6465. "in": "query",
  6466. "required": false,
  6467. "schema": {
  6468. "type": "string"
  6469. }
  6470. },
  6471. {
  6472. "name": "sessionID",
  6473. "in": "path",
  6474. "schema": {
  6475. "type": "string",
  6476. "pattern": "^ses.*"
  6477. },
  6478. "required": true
  6479. },
  6480. {
  6481. "name": "messageID",
  6482. "in": "path",
  6483. "schema": {
  6484. "type": "string",
  6485. "pattern": "^msg.*"
  6486. },
  6487. "required": true
  6488. },
  6489. {
  6490. "name": "partID",
  6491. "in": "path",
  6492. "schema": {
  6493. "type": "string",
  6494. "pattern": "^prt.*"
  6495. },
  6496. "required": true
  6497. }
  6498. ],
  6499. "responses": {
  6500. "200": {
  6501. "description": "Successfully deleted part",
  6502. "content": {
  6503. "application/json": {
  6504. "schema": {
  6505. "type": "boolean",
  6506. "description": "Successfully deleted part"
  6507. }
  6508. }
  6509. }
  6510. },
  6511. "400": {
  6512. "description": "Bad request",
  6513. "content": {
  6514. "application/json": {
  6515. "schema": {
  6516. "$ref": "#/components/schemas/BadRequestError"
  6517. }
  6518. }
  6519. }
  6520. },
  6521. "404": {
  6522. "description": "Not found",
  6523. "content": {
  6524. "application/json": {
  6525. "schema": {
  6526. "$ref": "#/components/schemas/NotFoundError"
  6527. }
  6528. }
  6529. }
  6530. }
  6531. },
  6532. "description": "Delete a part from a message.",
  6533. "x-codeSamples": [
  6534. {
  6535. "lang": "js",
  6536. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.part.delete({\n ...\n})"
  6537. }
  6538. ]
  6539. },
  6540. "patch": {
  6541. "tags": ["session"],
  6542. "operationId": "part.update",
  6543. "parameters": [
  6544. {
  6545. "name": "directory",
  6546. "in": "query",
  6547. "required": false,
  6548. "schema": {
  6549. "type": "string"
  6550. }
  6551. },
  6552. {
  6553. "name": "workspace",
  6554. "in": "query",
  6555. "required": false,
  6556. "schema": {
  6557. "type": "string"
  6558. }
  6559. },
  6560. {
  6561. "name": "sessionID",
  6562. "in": "path",
  6563. "schema": {
  6564. "type": "string",
  6565. "pattern": "^ses.*"
  6566. },
  6567. "required": true
  6568. },
  6569. {
  6570. "name": "messageID",
  6571. "in": "path",
  6572. "schema": {
  6573. "type": "string",
  6574. "pattern": "^msg.*"
  6575. },
  6576. "required": true
  6577. },
  6578. {
  6579. "name": "partID",
  6580. "in": "path",
  6581. "schema": {
  6582. "type": "string",
  6583. "pattern": "^prt.*"
  6584. },
  6585. "required": true
  6586. }
  6587. ],
  6588. "responses": {
  6589. "200": {
  6590. "description": "Successfully updated part",
  6591. "content": {
  6592. "application/json": {
  6593. "schema": {
  6594. "$ref": "#/components/schemas/Part"
  6595. }
  6596. }
  6597. }
  6598. },
  6599. "400": {
  6600. "description": "Bad request",
  6601. "content": {
  6602. "application/json": {
  6603. "schema": {
  6604. "$ref": "#/components/schemas/BadRequestError"
  6605. }
  6606. }
  6607. }
  6608. },
  6609. "404": {
  6610. "description": "Not found",
  6611. "content": {
  6612. "application/json": {
  6613. "schema": {
  6614. "$ref": "#/components/schemas/NotFoundError"
  6615. }
  6616. }
  6617. }
  6618. }
  6619. },
  6620. "description": "Update a part in a message.",
  6621. "requestBody": {
  6622. "content": {
  6623. "application/json": {
  6624. "schema": {
  6625. "$ref": "#/components/schemas/Part"
  6626. }
  6627. }
  6628. }
  6629. },
  6630. "x-codeSamples": [
  6631. {
  6632. "lang": "js",
  6633. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.part.update({\n ...\n})"
  6634. }
  6635. ]
  6636. }
  6637. },
  6638. "/sync/start": {
  6639. "post": {
  6640. "tags": ["sync"],
  6641. "operationId": "sync.start",
  6642. "parameters": [
  6643. {
  6644. "name": "directory",
  6645. "in": "query",
  6646. "required": false,
  6647. "schema": {
  6648. "type": "string"
  6649. }
  6650. },
  6651. {
  6652. "name": "workspace",
  6653. "in": "query",
  6654. "required": false,
  6655. "schema": {
  6656. "type": "string"
  6657. }
  6658. }
  6659. ],
  6660. "responses": {
  6661. "200": {
  6662. "description": "Workspace sync started",
  6663. "content": {
  6664. "application/json": {
  6665. "schema": {
  6666. "type": "boolean",
  6667. "description": "Workspace sync started"
  6668. }
  6669. }
  6670. }
  6671. }
  6672. },
  6673. "description": "Start sync loops for workspaces in the current project that have active sessions.",
  6674. "summary": "Start workspace sync",
  6675. "x-codeSamples": [
  6676. {
  6677. "lang": "js",
  6678. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.sync.start({\n ...\n})"
  6679. }
  6680. ]
  6681. }
  6682. },
  6683. "/sync/replay": {
  6684. "post": {
  6685. "tags": ["sync"],
  6686. "operationId": "sync.replay",
  6687. "parameters": [
  6688. {
  6689. "name": "directory",
  6690. "in": "query",
  6691. "required": false,
  6692. "schema": {
  6693. "type": "string"
  6694. }
  6695. },
  6696. {
  6697. "name": "workspace",
  6698. "in": "query",
  6699. "required": false,
  6700. "schema": {
  6701. "type": "string"
  6702. }
  6703. }
  6704. ],
  6705. "responses": {
  6706. "200": {
  6707. "description": "Replayed sync events",
  6708. "content": {
  6709. "application/json": {
  6710. "schema": {
  6711. "type": "object",
  6712. "properties": {
  6713. "sessionID": {
  6714. "type": "string"
  6715. }
  6716. },
  6717. "required": ["sessionID"],
  6718. "additionalProperties": false,
  6719. "description": "Replayed sync events"
  6720. }
  6721. }
  6722. }
  6723. },
  6724. "400": {
  6725. "description": "Bad request",
  6726. "content": {
  6727. "application/json": {
  6728. "schema": {
  6729. "$ref": "#/components/schemas/BadRequestError"
  6730. }
  6731. }
  6732. }
  6733. }
  6734. },
  6735. "description": "Validate and replay a complete sync event history.",
  6736. "summary": "Replay sync events",
  6737. "requestBody": {
  6738. "content": {
  6739. "application/json": {
  6740. "schema": {
  6741. "type": "object",
  6742. "properties": {
  6743. "directory": {
  6744. "type": "string"
  6745. },
  6746. "events": {
  6747. "type": "array",
  6748. "minItems": 1,
  6749. "items": {
  6750. "type": "object",
  6751. "properties": {
  6752. "id": {
  6753. "type": "string"
  6754. },
  6755. "aggregateID": {
  6756. "type": "string"
  6757. },
  6758. "seq": {
  6759. "type": "integer",
  6760. "minimum": 0
  6761. },
  6762. "type": {
  6763. "type": "string"
  6764. },
  6765. "data": {
  6766. "type": "object"
  6767. }
  6768. },
  6769. "required": ["id", "aggregateID", "seq", "type", "data"],
  6770. "additionalProperties": false
  6771. }
  6772. }
  6773. },
  6774. "required": ["directory", "events"],
  6775. "additionalProperties": false
  6776. }
  6777. }
  6778. }
  6779. },
  6780. "x-codeSamples": [
  6781. {
  6782. "lang": "js",
  6783. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.sync.replay({\n ...\n})"
  6784. }
  6785. ]
  6786. }
  6787. },
  6788. "/sync/steal": {
  6789. "post": {
  6790. "tags": ["sync"],
  6791. "operationId": "sync.steal",
  6792. "parameters": [
  6793. {
  6794. "name": "directory",
  6795. "in": "query",
  6796. "required": false,
  6797. "schema": {
  6798. "type": "string"
  6799. }
  6800. },
  6801. {
  6802. "name": "workspace",
  6803. "in": "query",
  6804. "required": false,
  6805. "schema": {
  6806. "type": "string"
  6807. }
  6808. }
  6809. ],
  6810. "responses": {
  6811. "200": {
  6812. "description": "Session stolen into workspace",
  6813. "content": {
  6814. "application/json": {
  6815. "schema": {
  6816. "type": "object",
  6817. "properties": {
  6818. "sessionID": {
  6819. "type": "string"
  6820. }
  6821. },
  6822. "required": ["sessionID"],
  6823. "additionalProperties": false,
  6824. "description": "Session stolen into workspace"
  6825. }
  6826. }
  6827. }
  6828. },
  6829. "400": {
  6830. "description": "Bad request",
  6831. "content": {
  6832. "application/json": {
  6833. "schema": {
  6834. "$ref": "#/components/schemas/BadRequestError"
  6835. }
  6836. }
  6837. }
  6838. }
  6839. },
  6840. "description": "Update a session to belong to the current workspace through the sync event system.",
  6841. "summary": "Steal session into workspace",
  6842. "requestBody": {
  6843. "content": {
  6844. "application/json": {
  6845. "schema": {
  6846. "type": "object",
  6847. "properties": {
  6848. "sessionID": {
  6849. "type": "string"
  6850. }
  6851. },
  6852. "required": ["sessionID"],
  6853. "additionalProperties": false
  6854. }
  6855. }
  6856. }
  6857. },
  6858. "x-codeSamples": [
  6859. {
  6860. "lang": "js",
  6861. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.sync.steal({\n ...\n})"
  6862. }
  6863. ]
  6864. }
  6865. },
  6866. "/sync/history": {
  6867. "post": {
  6868. "tags": ["sync"],
  6869. "operationId": "sync.history.list",
  6870. "parameters": [
  6871. {
  6872. "name": "directory",
  6873. "in": "query",
  6874. "required": false,
  6875. "schema": {
  6876. "type": "string"
  6877. }
  6878. },
  6879. {
  6880. "name": "workspace",
  6881. "in": "query",
  6882. "required": false,
  6883. "schema": {
  6884. "type": "string"
  6885. }
  6886. }
  6887. ],
  6888. "responses": {
  6889. "200": {
  6890. "description": "Sync events",
  6891. "content": {
  6892. "application/json": {
  6893. "schema": {
  6894. "type": "array",
  6895. "items": {
  6896. "type": "object",
  6897. "properties": {
  6898. "id": {
  6899. "type": "string"
  6900. },
  6901. "aggregate_id": {
  6902. "type": "string"
  6903. },
  6904. "seq": {
  6905. "type": "integer",
  6906. "minimum": 0
  6907. },
  6908. "type": {
  6909. "type": "string"
  6910. },
  6911. "data": {
  6912. "type": "object"
  6913. }
  6914. },
  6915. "required": ["id", "aggregate_id", "seq", "type", "data"],
  6916. "additionalProperties": false
  6917. },
  6918. "description": "Sync events"
  6919. }
  6920. }
  6921. }
  6922. },
  6923. "400": {
  6924. "description": "Bad request",
  6925. "content": {
  6926. "application/json": {
  6927. "schema": {
  6928. "$ref": "#/components/schemas/BadRequestError"
  6929. }
  6930. }
  6931. }
  6932. }
  6933. },
  6934. "description": "List sync events for all aggregates. Keys are aggregate IDs the client already knows about, values are the last known sequence ID. Events with seq > value are returned for those aggregates. Aggregates not listed in the input get their full history.",
  6935. "summary": "List sync events",
  6936. "requestBody": {
  6937. "content": {
  6938. "application/json": {
  6939. "schema": {
  6940. "type": "object",
  6941. "additionalProperties": {
  6942. "type": "integer",
  6943. "minimum": 0
  6944. }
  6945. }
  6946. }
  6947. }
  6948. },
  6949. "x-codeSamples": [
  6950. {
  6951. "lang": "js",
  6952. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.sync.history.list({\n ...\n})"
  6953. }
  6954. ]
  6955. }
  6956. },
  6957. "/api/session": {
  6958. "get": {
  6959. "tags": ["v2"],
  6960. "operationId": "v2.session.list",
  6961. "parameters": [
  6962. {
  6963. "name": "directory",
  6964. "in": "query",
  6965. "required": false,
  6966. "schema": {
  6967. "type": "string"
  6968. }
  6969. },
  6970. {
  6971. "name": "workspace",
  6972. "in": "query",
  6973. "required": false,
  6974. "schema": {
  6975. "type": "string"
  6976. }
  6977. }
  6978. ],
  6979. "responses": {
  6980. "200": {
  6981. "description": "V2SessionsResponse",
  6982. "content": {
  6983. "application/json": {
  6984. "schema": {
  6985. "$ref": "#/components/schemas/V2SessionsResponse"
  6986. }
  6987. }
  6988. }
  6989. },
  6990. "400": {
  6991. "description": "Bad request",
  6992. "content": {
  6993. "application/json": {
  6994. "schema": {
  6995. "$ref": "#/components/schemas/BadRequestError"
  6996. }
  6997. }
  6998. }
  6999. }
  7000. },
  7001. "description": "Retrieve sessions in the requested order. Items keep that order across pages; use cursor.next or cursor.previous to move through the ordered list.",
  7002. "summary": "List v2 sessions",
  7003. "x-codeSamples": [
  7004. {
  7005. "lang": "js",
  7006. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.list({\n ...\n})"
  7007. }
  7008. ]
  7009. }
  7010. },
  7011. "/api/session/{sessionID}/prompt": {
  7012. "post": {
  7013. "tags": ["v2"],
  7014. "operationId": "v2.session.prompt",
  7015. "parameters": [
  7016. {
  7017. "name": "directory",
  7018. "in": "query",
  7019. "required": false,
  7020. "schema": {
  7021. "type": "string"
  7022. }
  7023. },
  7024. {
  7025. "name": "workspace",
  7026. "in": "query",
  7027. "required": false,
  7028. "schema": {
  7029. "type": "string"
  7030. }
  7031. },
  7032. {
  7033. "name": "sessionID",
  7034. "in": "path",
  7035. "schema": {
  7036. "type": "string",
  7037. "pattern": "^ses.*"
  7038. },
  7039. "required": true
  7040. }
  7041. ],
  7042. "responses": {
  7043. "200": {
  7044. "description": "Session.Message",
  7045. "content": {
  7046. "application/json": {
  7047. "schema": {
  7048. "$ref": "#/components/schemas/SessionMessage"
  7049. }
  7050. }
  7051. }
  7052. }
  7053. },
  7054. "description": "Create a v2 session message and queue it for the agent loop.",
  7055. "summary": "Send v2 message",
  7056. "requestBody": {
  7057. "content": {
  7058. "application/json": {
  7059. "schema": {
  7060. "type": "object",
  7061. "properties": {
  7062. "prompt": {
  7063. "$ref": "#/components/schemas/Prompt"
  7064. },
  7065. "delivery": {
  7066. "$ref": "#/components/schemas/SessionDelivery"
  7067. }
  7068. },
  7069. "required": ["prompt"],
  7070. "additionalProperties": false
  7071. }
  7072. }
  7073. }
  7074. },
  7075. "x-codeSamples": [
  7076. {
  7077. "lang": "js",
  7078. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.prompt({\n ...\n})"
  7079. }
  7080. ]
  7081. }
  7082. },
  7083. "/api/session/{sessionID}/compact": {
  7084. "post": {
  7085. "tags": ["v2"],
  7086. "operationId": "v2.session.compact",
  7087. "parameters": [
  7088. {
  7089. "name": "directory",
  7090. "in": "query",
  7091. "required": false,
  7092. "schema": {
  7093. "type": "string"
  7094. }
  7095. },
  7096. {
  7097. "name": "workspace",
  7098. "in": "query",
  7099. "required": false,
  7100. "schema": {
  7101. "type": "string"
  7102. }
  7103. },
  7104. {
  7105. "name": "sessionID",
  7106. "in": "path",
  7107. "schema": {
  7108. "type": "string",
  7109. "pattern": "^ses.*"
  7110. },
  7111. "required": true
  7112. }
  7113. ],
  7114. "responses": {
  7115. "204": {
  7116. "description": "<No Content>"
  7117. }
  7118. },
  7119. "description": "Compact a v2 session conversation.",
  7120. "summary": "Compact v2 session",
  7121. "x-codeSamples": [
  7122. {
  7123. "lang": "js",
  7124. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.compact({\n ...\n})"
  7125. }
  7126. ]
  7127. }
  7128. },
  7129. "/api/session/{sessionID}/wait": {
  7130. "post": {
  7131. "tags": ["v2"],
  7132. "operationId": "v2.session.wait",
  7133. "parameters": [
  7134. {
  7135. "name": "directory",
  7136. "in": "query",
  7137. "required": false,
  7138. "schema": {
  7139. "type": "string"
  7140. }
  7141. },
  7142. {
  7143. "name": "workspace",
  7144. "in": "query",
  7145. "required": false,
  7146. "schema": {
  7147. "type": "string"
  7148. }
  7149. },
  7150. {
  7151. "name": "sessionID",
  7152. "in": "path",
  7153. "schema": {
  7154. "type": "string",
  7155. "pattern": "^ses.*"
  7156. },
  7157. "required": true
  7158. }
  7159. ],
  7160. "responses": {
  7161. "204": {
  7162. "description": "<No Content>"
  7163. }
  7164. },
  7165. "description": "Wait for a v2 session agent loop to become idle.",
  7166. "summary": "Wait for v2 session",
  7167. "x-codeSamples": [
  7168. {
  7169. "lang": "js",
  7170. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.wait({\n ...\n})"
  7171. }
  7172. ]
  7173. }
  7174. },
  7175. "/api/session/{sessionID}/context": {
  7176. "get": {
  7177. "tags": ["v2"],
  7178. "operationId": "v2.session.context",
  7179. "parameters": [
  7180. {
  7181. "name": "directory",
  7182. "in": "query",
  7183. "required": false,
  7184. "schema": {
  7185. "type": "string"
  7186. }
  7187. },
  7188. {
  7189. "name": "workspace",
  7190. "in": "query",
  7191. "required": false,
  7192. "schema": {
  7193. "type": "string"
  7194. }
  7195. },
  7196. {
  7197. "name": "sessionID",
  7198. "in": "path",
  7199. "schema": {
  7200. "type": "string",
  7201. "pattern": "^ses.*"
  7202. },
  7203. "required": true
  7204. }
  7205. ],
  7206. "responses": {
  7207. "200": {
  7208. "description": "Success",
  7209. "content": {
  7210. "application/json": {
  7211. "schema": {
  7212. "type": "array",
  7213. "items": {
  7214. "$ref": "#/components/schemas/SessionMessage"
  7215. }
  7216. }
  7217. }
  7218. }
  7219. }
  7220. },
  7221. "description": "Retrieve the active context messages for a v2 session (all messages after the last compaction).",
  7222. "summary": "Get v2 session context",
  7223. "x-codeSamples": [
  7224. {
  7225. "lang": "js",
  7226. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.context({\n ...\n})"
  7227. }
  7228. ]
  7229. }
  7230. },
  7231. "/api/session/{sessionID}/message": {
  7232. "get": {
  7233. "tags": ["v2 messages"],
  7234. "operationId": "v2.session.messages",
  7235. "parameters": [
  7236. {
  7237. "name": "directory",
  7238. "in": "query",
  7239. "required": false,
  7240. "schema": {
  7241. "type": "string"
  7242. }
  7243. },
  7244. {
  7245. "name": "workspace",
  7246. "in": "query",
  7247. "required": false,
  7248. "schema": {
  7249. "type": "string"
  7250. }
  7251. },
  7252. {
  7253. "name": "sessionID",
  7254. "in": "path",
  7255. "schema": {
  7256. "type": "string",
  7257. "pattern": "^ses.*"
  7258. },
  7259. "required": true
  7260. }
  7261. ],
  7262. "responses": {
  7263. "200": {
  7264. "description": "V2SessionMessagesResponse",
  7265. "content": {
  7266. "application/json": {
  7267. "schema": {
  7268. "$ref": "#/components/schemas/V2SessionMessagesResponse"
  7269. }
  7270. }
  7271. }
  7272. },
  7273. "400": {
  7274. "description": "Bad request",
  7275. "content": {
  7276. "application/json": {
  7277. "schema": {
  7278. "$ref": "#/components/schemas/BadRequestError"
  7279. }
  7280. }
  7281. }
  7282. }
  7283. },
  7284. "description": "Retrieve projected v2 messages for a session. Items keep the requested order across pages; use cursor.next or cursor.previous to move through the ordered timeline.",
  7285. "summary": "Get v2 session messages",
  7286. "x-codeSamples": [
  7287. {
  7288. "lang": "js",
  7289. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.messages({\n ...\n})"
  7290. }
  7291. ]
  7292. }
  7293. },
  7294. "/tui/append-prompt": {
  7295. "post": {
  7296. "tags": ["tui"],
  7297. "operationId": "tui.appendPrompt",
  7298. "parameters": [
  7299. {
  7300. "name": "directory",
  7301. "in": "query",
  7302. "required": false,
  7303. "schema": {
  7304. "type": "string"
  7305. }
  7306. },
  7307. {
  7308. "name": "workspace",
  7309. "in": "query",
  7310. "required": false,
  7311. "schema": {
  7312. "type": "string"
  7313. }
  7314. }
  7315. ],
  7316. "responses": {
  7317. "200": {
  7318. "description": "Prompt processed successfully",
  7319. "content": {
  7320. "application/json": {
  7321. "schema": {
  7322. "type": "boolean",
  7323. "description": "Prompt processed successfully"
  7324. }
  7325. }
  7326. }
  7327. },
  7328. "400": {
  7329. "description": "Bad request",
  7330. "content": {
  7331. "application/json": {
  7332. "schema": {
  7333. "$ref": "#/components/schemas/BadRequestError"
  7334. }
  7335. }
  7336. }
  7337. }
  7338. },
  7339. "description": "Append prompt to the TUI.",
  7340. "summary": "Append TUI prompt",
  7341. "requestBody": {
  7342. "content": {
  7343. "application/json": {
  7344. "schema": {
  7345. "type": "object",
  7346. "properties": {
  7347. "text": {
  7348. "type": "string"
  7349. }
  7350. },
  7351. "required": ["text"],
  7352. "additionalProperties": false
  7353. }
  7354. }
  7355. }
  7356. },
  7357. "x-codeSamples": [
  7358. {
  7359. "lang": "js",
  7360. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.appendPrompt({\n ...\n})"
  7361. }
  7362. ]
  7363. }
  7364. },
  7365. "/tui/open-help": {
  7366. "post": {
  7367. "tags": ["tui"],
  7368. "operationId": "tui.openHelp",
  7369. "parameters": [
  7370. {
  7371. "name": "directory",
  7372. "in": "query",
  7373. "required": false,
  7374. "schema": {
  7375. "type": "string"
  7376. }
  7377. },
  7378. {
  7379. "name": "workspace",
  7380. "in": "query",
  7381. "required": false,
  7382. "schema": {
  7383. "type": "string"
  7384. }
  7385. }
  7386. ],
  7387. "responses": {
  7388. "200": {
  7389. "description": "Help dialog opened successfully",
  7390. "content": {
  7391. "application/json": {
  7392. "schema": {
  7393. "type": "boolean",
  7394. "description": "Help dialog opened successfully"
  7395. }
  7396. }
  7397. }
  7398. }
  7399. },
  7400. "description": "Open the help dialog in the TUI to display user assistance information.",
  7401. "summary": "Open help dialog",
  7402. "x-codeSamples": [
  7403. {
  7404. "lang": "js",
  7405. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openHelp({\n ...\n})"
  7406. }
  7407. ]
  7408. }
  7409. },
  7410. "/tui/open-sessions": {
  7411. "post": {
  7412. "tags": ["tui"],
  7413. "operationId": "tui.openSessions",
  7414. "parameters": [
  7415. {
  7416. "name": "directory",
  7417. "in": "query",
  7418. "required": false,
  7419. "schema": {
  7420. "type": "string"
  7421. }
  7422. },
  7423. {
  7424. "name": "workspace",
  7425. "in": "query",
  7426. "required": false,
  7427. "schema": {
  7428. "type": "string"
  7429. }
  7430. }
  7431. ],
  7432. "responses": {
  7433. "200": {
  7434. "description": "Session dialog opened successfully",
  7435. "content": {
  7436. "application/json": {
  7437. "schema": {
  7438. "type": "boolean",
  7439. "description": "Session dialog opened successfully"
  7440. }
  7441. }
  7442. }
  7443. }
  7444. },
  7445. "description": "Open the session dialog.",
  7446. "summary": "Open sessions dialog",
  7447. "x-codeSamples": [
  7448. {
  7449. "lang": "js",
  7450. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openSessions({\n ...\n})"
  7451. }
  7452. ]
  7453. }
  7454. },
  7455. "/tui/open-themes": {
  7456. "post": {
  7457. "tags": ["tui"],
  7458. "operationId": "tui.openThemes",
  7459. "parameters": [
  7460. {
  7461. "name": "directory",
  7462. "in": "query",
  7463. "required": false,
  7464. "schema": {
  7465. "type": "string"
  7466. }
  7467. },
  7468. {
  7469. "name": "workspace",
  7470. "in": "query",
  7471. "required": false,
  7472. "schema": {
  7473. "type": "string"
  7474. }
  7475. }
  7476. ],
  7477. "responses": {
  7478. "200": {
  7479. "description": "Theme dialog opened successfully",
  7480. "content": {
  7481. "application/json": {
  7482. "schema": {
  7483. "type": "boolean",
  7484. "description": "Theme dialog opened successfully"
  7485. }
  7486. }
  7487. }
  7488. }
  7489. },
  7490. "description": "Open the theme dialog.",
  7491. "summary": "Open themes dialog",
  7492. "x-codeSamples": [
  7493. {
  7494. "lang": "js",
  7495. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openThemes({\n ...\n})"
  7496. }
  7497. ]
  7498. }
  7499. },
  7500. "/tui/open-models": {
  7501. "post": {
  7502. "tags": ["tui"],
  7503. "operationId": "tui.openModels",
  7504. "parameters": [
  7505. {
  7506. "name": "directory",
  7507. "in": "query",
  7508. "required": false,
  7509. "schema": {
  7510. "type": "string"
  7511. }
  7512. },
  7513. {
  7514. "name": "workspace",
  7515. "in": "query",
  7516. "required": false,
  7517. "schema": {
  7518. "type": "string"
  7519. }
  7520. }
  7521. ],
  7522. "responses": {
  7523. "200": {
  7524. "description": "Model dialog opened successfully",
  7525. "content": {
  7526. "application/json": {
  7527. "schema": {
  7528. "type": "boolean",
  7529. "description": "Model dialog opened successfully"
  7530. }
  7531. }
  7532. }
  7533. }
  7534. },
  7535. "description": "Open the model dialog.",
  7536. "summary": "Open models dialog",
  7537. "x-codeSamples": [
  7538. {
  7539. "lang": "js",
  7540. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openModels({\n ...\n})"
  7541. }
  7542. ]
  7543. }
  7544. },
  7545. "/tui/submit-prompt": {
  7546. "post": {
  7547. "tags": ["tui"],
  7548. "operationId": "tui.submitPrompt",
  7549. "parameters": [
  7550. {
  7551. "name": "directory",
  7552. "in": "query",
  7553. "required": false,
  7554. "schema": {
  7555. "type": "string"
  7556. }
  7557. },
  7558. {
  7559. "name": "workspace",
  7560. "in": "query",
  7561. "required": false,
  7562. "schema": {
  7563. "type": "string"
  7564. }
  7565. }
  7566. ],
  7567. "responses": {
  7568. "200": {
  7569. "description": "Prompt submitted successfully",
  7570. "content": {
  7571. "application/json": {
  7572. "schema": {
  7573. "type": "boolean",
  7574. "description": "Prompt submitted successfully"
  7575. }
  7576. }
  7577. }
  7578. }
  7579. },
  7580. "description": "Submit the prompt.",
  7581. "summary": "Submit TUI prompt",
  7582. "x-codeSamples": [
  7583. {
  7584. "lang": "js",
  7585. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.submitPrompt({\n ...\n})"
  7586. }
  7587. ]
  7588. }
  7589. },
  7590. "/tui/clear-prompt": {
  7591. "post": {
  7592. "tags": ["tui"],
  7593. "operationId": "tui.clearPrompt",
  7594. "parameters": [
  7595. {
  7596. "name": "directory",
  7597. "in": "query",
  7598. "required": false,
  7599. "schema": {
  7600. "type": "string"
  7601. }
  7602. },
  7603. {
  7604. "name": "workspace",
  7605. "in": "query",
  7606. "required": false,
  7607. "schema": {
  7608. "type": "string"
  7609. }
  7610. }
  7611. ],
  7612. "responses": {
  7613. "200": {
  7614. "description": "Prompt cleared successfully",
  7615. "content": {
  7616. "application/json": {
  7617. "schema": {
  7618. "type": "boolean",
  7619. "description": "Prompt cleared successfully"
  7620. }
  7621. }
  7622. }
  7623. }
  7624. },
  7625. "description": "Clear the prompt.",
  7626. "summary": "Clear TUI prompt",
  7627. "x-codeSamples": [
  7628. {
  7629. "lang": "js",
  7630. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.clearPrompt({\n ...\n})"
  7631. }
  7632. ]
  7633. }
  7634. },
  7635. "/tui/execute-command": {
  7636. "post": {
  7637. "tags": ["tui"],
  7638. "operationId": "tui.executeCommand",
  7639. "parameters": [
  7640. {
  7641. "name": "directory",
  7642. "in": "query",
  7643. "required": false,
  7644. "schema": {
  7645. "type": "string"
  7646. }
  7647. },
  7648. {
  7649. "name": "workspace",
  7650. "in": "query",
  7651. "required": false,
  7652. "schema": {
  7653. "type": "string"
  7654. }
  7655. }
  7656. ],
  7657. "responses": {
  7658. "200": {
  7659. "description": "Command executed successfully",
  7660. "content": {
  7661. "application/json": {
  7662. "schema": {
  7663. "type": "boolean",
  7664. "description": "Command executed successfully"
  7665. }
  7666. }
  7667. }
  7668. },
  7669. "400": {
  7670. "description": "Bad request",
  7671. "content": {
  7672. "application/json": {
  7673. "schema": {
  7674. "$ref": "#/components/schemas/BadRequestError"
  7675. }
  7676. }
  7677. }
  7678. }
  7679. },
  7680. "description": "Execute a TUI command.",
  7681. "summary": "Execute TUI command",
  7682. "requestBody": {
  7683. "content": {
  7684. "application/json": {
  7685. "schema": {
  7686. "type": "object",
  7687. "properties": {
  7688. "command": {
  7689. "type": "string"
  7690. }
  7691. },
  7692. "required": ["command"],
  7693. "additionalProperties": false
  7694. }
  7695. }
  7696. }
  7697. },
  7698. "x-codeSamples": [
  7699. {
  7700. "lang": "js",
  7701. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.executeCommand({\n ...\n})"
  7702. }
  7703. ]
  7704. }
  7705. },
  7706. "/tui/show-toast": {
  7707. "post": {
  7708. "tags": ["tui"],
  7709. "operationId": "tui.showToast",
  7710. "parameters": [
  7711. {
  7712. "name": "directory",
  7713. "in": "query",
  7714. "required": false,
  7715. "schema": {
  7716. "type": "string"
  7717. }
  7718. },
  7719. {
  7720. "name": "workspace",
  7721. "in": "query",
  7722. "required": false,
  7723. "schema": {
  7724. "type": "string"
  7725. }
  7726. }
  7727. ],
  7728. "responses": {
  7729. "200": {
  7730. "description": "Toast notification shown successfully",
  7731. "content": {
  7732. "application/json": {
  7733. "schema": {
  7734. "type": "boolean",
  7735. "description": "Toast notification shown successfully"
  7736. }
  7737. }
  7738. }
  7739. }
  7740. },
  7741. "description": "Show a toast notification in the TUI.",
  7742. "summary": "Show TUI toast",
  7743. "requestBody": {
  7744. "content": {
  7745. "application/json": {
  7746. "schema": {
  7747. "type": "object",
  7748. "properties": {
  7749. "title": {
  7750. "type": "string"
  7751. },
  7752. "message": {
  7753. "type": "string"
  7754. },
  7755. "variant": {
  7756. "type": "string",
  7757. "enum": ["info", "success", "warning", "error"]
  7758. },
  7759. "duration": {
  7760. "type": "integer",
  7761. "exclusiveMinimum": 0
  7762. }
  7763. },
  7764. "required": ["message", "variant"],
  7765. "additionalProperties": false
  7766. }
  7767. }
  7768. }
  7769. },
  7770. "x-codeSamples": [
  7771. {
  7772. "lang": "js",
  7773. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.showToast({\n ...\n})"
  7774. }
  7775. ]
  7776. }
  7777. },
  7778. "/tui/publish": {
  7779. "post": {
  7780. "tags": ["tui"],
  7781. "operationId": "tui.publish",
  7782. "parameters": [
  7783. {
  7784. "name": "directory",
  7785. "in": "query",
  7786. "required": false,
  7787. "schema": {
  7788. "type": "string"
  7789. }
  7790. },
  7791. {
  7792. "name": "workspace",
  7793. "in": "query",
  7794. "required": false,
  7795. "schema": {
  7796. "type": "string"
  7797. }
  7798. }
  7799. ],
  7800. "responses": {
  7801. "200": {
  7802. "description": "Event published successfully",
  7803. "content": {
  7804. "application/json": {
  7805. "schema": {
  7806. "type": "boolean",
  7807. "description": "Event published successfully"
  7808. }
  7809. }
  7810. }
  7811. },
  7812. "400": {
  7813. "description": "Bad request",
  7814. "content": {
  7815. "application/json": {
  7816. "schema": {
  7817. "$ref": "#/components/schemas/BadRequestError"
  7818. }
  7819. }
  7820. }
  7821. }
  7822. },
  7823. "description": "Publish a TUI event.",
  7824. "summary": "Publish TUI event",
  7825. "requestBody": {
  7826. "content": {
  7827. "application/json": {
  7828. "schema": {
  7829. "anyOf": [
  7830. {
  7831. "$ref": "#/components/schemas/EventTuiPromptAppend"
  7832. },
  7833. {
  7834. "$ref": "#/components/schemas/EventTuiCommandExecute"
  7835. },
  7836. {
  7837. "$ref": "#/components/schemas/EventTuiToastShow"
  7838. },
  7839. {
  7840. "$ref": "#/components/schemas/EventTuiSessionSelect"
  7841. }
  7842. ]
  7843. }
  7844. }
  7845. }
  7846. },
  7847. "x-codeSamples": [
  7848. {
  7849. "lang": "js",
  7850. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.publish({\n ...\n})"
  7851. }
  7852. ]
  7853. }
  7854. },
  7855. "/tui/select-session": {
  7856. "post": {
  7857. "tags": ["tui"],
  7858. "operationId": "tui.selectSession",
  7859. "parameters": [
  7860. {
  7861. "name": "directory",
  7862. "in": "query",
  7863. "required": false,
  7864. "schema": {
  7865. "type": "string"
  7866. }
  7867. },
  7868. {
  7869. "name": "workspace",
  7870. "in": "query",
  7871. "required": false,
  7872. "schema": {
  7873. "type": "string"
  7874. }
  7875. }
  7876. ],
  7877. "responses": {
  7878. "200": {
  7879. "description": "Session selected successfully",
  7880. "content": {
  7881. "application/json": {
  7882. "schema": {
  7883. "type": "boolean",
  7884. "description": "Session selected successfully"
  7885. }
  7886. }
  7887. }
  7888. },
  7889. "400": {
  7890. "description": "Bad request",
  7891. "content": {
  7892. "application/json": {
  7893. "schema": {
  7894. "$ref": "#/components/schemas/BadRequestError"
  7895. }
  7896. }
  7897. }
  7898. },
  7899. "404": {
  7900. "description": "Not found",
  7901. "content": {
  7902. "application/json": {
  7903. "schema": {
  7904. "$ref": "#/components/schemas/NotFoundError"
  7905. }
  7906. }
  7907. }
  7908. }
  7909. },
  7910. "description": "Navigate the TUI to display the specified session.",
  7911. "summary": "Select session",
  7912. "requestBody": {
  7913. "content": {
  7914. "application/json": {
  7915. "schema": {
  7916. "type": "object",
  7917. "properties": {
  7918. "sessionID": {
  7919. "type": "string",
  7920. "description": "Session ID to navigate to"
  7921. }
  7922. },
  7923. "required": ["sessionID"],
  7924. "additionalProperties": false
  7925. }
  7926. }
  7927. }
  7928. },
  7929. "x-codeSamples": [
  7930. {
  7931. "lang": "js",
  7932. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.selectSession({\n ...\n})"
  7933. }
  7934. ]
  7935. }
  7936. },
  7937. "/tui/control/next": {
  7938. "get": {
  7939. "tags": ["tui"],
  7940. "operationId": "tui.control.next",
  7941. "parameters": [
  7942. {
  7943. "name": "directory",
  7944. "in": "query",
  7945. "required": false,
  7946. "schema": {
  7947. "type": "string"
  7948. }
  7949. },
  7950. {
  7951. "name": "workspace",
  7952. "in": "query",
  7953. "required": false,
  7954. "schema": {
  7955. "type": "string"
  7956. }
  7957. }
  7958. ],
  7959. "responses": {
  7960. "200": {
  7961. "description": "Next TUI request",
  7962. "content": {
  7963. "application/json": {
  7964. "schema": {
  7965. "type": "object",
  7966. "properties": {
  7967. "path": {
  7968. "type": "string"
  7969. },
  7970. "body": {}
  7971. },
  7972. "required": ["path", "body"],
  7973. "additionalProperties": false,
  7974. "description": "Next TUI request"
  7975. }
  7976. }
  7977. }
  7978. }
  7979. },
  7980. "description": "Retrieve the next TUI request from the queue for processing.",
  7981. "summary": "Get next TUI request",
  7982. "x-codeSamples": [
  7983. {
  7984. "lang": "js",
  7985. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.control.next({\n ...\n})"
  7986. }
  7987. ]
  7988. }
  7989. },
  7990. "/tui/control/response": {
  7991. "post": {
  7992. "tags": ["tui"],
  7993. "operationId": "tui.control.response",
  7994. "parameters": [
  7995. {
  7996. "name": "directory",
  7997. "in": "query",
  7998. "required": false,
  7999. "schema": {
  8000. "type": "string"
  8001. }
  8002. },
  8003. {
  8004. "name": "workspace",
  8005. "in": "query",
  8006. "required": false,
  8007. "schema": {
  8008. "type": "string"
  8009. }
  8010. }
  8011. ],
  8012. "responses": {
  8013. "200": {
  8014. "description": "Response submitted successfully",
  8015. "content": {
  8016. "application/json": {
  8017. "schema": {
  8018. "type": "boolean",
  8019. "description": "Response submitted successfully"
  8020. }
  8021. }
  8022. }
  8023. }
  8024. },
  8025. "description": "Submit a response to the TUI request queue to complete a pending request.",
  8026. "summary": "Submit TUI response",
  8027. "requestBody": {
  8028. "content": {
  8029. "application/json": {
  8030. "schema": {}
  8031. }
  8032. }
  8033. },
  8034. "x-codeSamples": [
  8035. {
  8036. "lang": "js",
  8037. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.control.response({\n ...\n})"
  8038. }
  8039. ]
  8040. }
  8041. },
  8042. "/experimental/workspace/adapter": {
  8043. "get": {
  8044. "tags": ["workspace"],
  8045. "operationId": "experimental.workspace.adapter.list",
  8046. "parameters": [
  8047. {
  8048. "name": "directory",
  8049. "in": "query",
  8050. "required": false,
  8051. "schema": {
  8052. "type": "string"
  8053. }
  8054. },
  8055. {
  8056. "name": "workspace",
  8057. "in": "query",
  8058. "required": false,
  8059. "schema": {
  8060. "type": "string"
  8061. }
  8062. }
  8063. ],
  8064. "responses": {
  8065. "200": {
  8066. "description": "Workspace adapters",
  8067. "content": {
  8068. "application/json": {
  8069. "schema": {
  8070. "type": "array",
  8071. "items": {
  8072. "type": "object",
  8073. "properties": {
  8074. "type": {
  8075. "type": "string"
  8076. },
  8077. "name": {
  8078. "type": "string"
  8079. },
  8080. "description": {
  8081. "type": "string"
  8082. }
  8083. },
  8084. "required": ["type", "name", "description"],
  8085. "additionalProperties": false
  8086. },
  8087. "description": "Workspace adapters"
  8088. }
  8089. }
  8090. }
  8091. }
  8092. },
  8093. "description": "List all available workspace adapters for the current project.",
  8094. "summary": "List workspace adapters",
  8095. "x-codeSamples": [
  8096. {
  8097. "lang": "js",
  8098. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.adapter.list({\n ...\n})"
  8099. }
  8100. ]
  8101. }
  8102. },
  8103. "/experimental/workspace": {
  8104. "get": {
  8105. "tags": ["workspace"],
  8106. "operationId": "experimental.workspace.list",
  8107. "parameters": [
  8108. {
  8109. "name": "directory",
  8110. "in": "query",
  8111. "required": false,
  8112. "schema": {
  8113. "type": "string"
  8114. }
  8115. },
  8116. {
  8117. "name": "workspace",
  8118. "in": "query",
  8119. "required": false,
  8120. "schema": {
  8121. "type": "string"
  8122. }
  8123. }
  8124. ],
  8125. "responses": {
  8126. "200": {
  8127. "description": "Workspaces",
  8128. "content": {
  8129. "application/json": {
  8130. "schema": {
  8131. "type": "array",
  8132. "items": {
  8133. "$ref": "#/components/schemas/Workspace"
  8134. },
  8135. "description": "Workspaces"
  8136. }
  8137. }
  8138. }
  8139. }
  8140. },
  8141. "description": "List all workspaces.",
  8142. "summary": "List workspaces",
  8143. "x-codeSamples": [
  8144. {
  8145. "lang": "js",
  8146. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.list({\n ...\n})"
  8147. }
  8148. ]
  8149. },
  8150. "post": {
  8151. "tags": ["workspace"],
  8152. "operationId": "experimental.workspace.create",
  8153. "parameters": [
  8154. {
  8155. "name": "directory",
  8156. "in": "query",
  8157. "required": false,
  8158. "schema": {
  8159. "type": "string"
  8160. }
  8161. },
  8162. {
  8163. "name": "workspace",
  8164. "in": "query",
  8165. "required": false,
  8166. "schema": {
  8167. "type": "string"
  8168. }
  8169. }
  8170. ],
  8171. "responses": {
  8172. "200": {
  8173. "description": "Workspace created",
  8174. "content": {
  8175. "application/json": {
  8176. "schema": {
  8177. "$ref": "#/components/schemas/Workspace"
  8178. }
  8179. }
  8180. }
  8181. },
  8182. "400": {
  8183. "description": "Bad request",
  8184. "content": {
  8185. "application/json": {
  8186. "schema": {
  8187. "$ref": "#/components/schemas/BadRequestError"
  8188. }
  8189. }
  8190. }
  8191. }
  8192. },
  8193. "description": "Create a workspace for the current project.",
  8194. "summary": "Create workspace",
  8195. "requestBody": {
  8196. "content": {
  8197. "application/json": {
  8198. "schema": {
  8199. "type": "object",
  8200. "properties": {
  8201. "id": {
  8202. "type": "string"
  8203. },
  8204. "type": {
  8205. "type": "string"
  8206. },
  8207. "branch": {
  8208. "anyOf": [
  8209. {
  8210. "type": "string"
  8211. },
  8212. {
  8213. "type": "null"
  8214. }
  8215. ]
  8216. },
  8217. "extra": {
  8218. "anyOf": [
  8219. {},
  8220. {
  8221. "type": "null"
  8222. }
  8223. ]
  8224. }
  8225. },
  8226. "required": ["type", "branch"],
  8227. "additionalProperties": false
  8228. }
  8229. }
  8230. }
  8231. },
  8232. "x-codeSamples": [
  8233. {
  8234. "lang": "js",
  8235. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.create({\n ...\n})"
  8236. }
  8237. ]
  8238. }
  8239. },
  8240. "/experimental/workspace/status": {
  8241. "get": {
  8242. "tags": ["workspace"],
  8243. "operationId": "experimental.workspace.status",
  8244. "parameters": [
  8245. {
  8246. "name": "directory",
  8247. "in": "query",
  8248. "required": false,
  8249. "schema": {
  8250. "type": "string"
  8251. }
  8252. },
  8253. {
  8254. "name": "workspace",
  8255. "in": "query",
  8256. "required": false,
  8257. "schema": {
  8258. "type": "string"
  8259. }
  8260. }
  8261. ],
  8262. "responses": {
  8263. "200": {
  8264. "description": "Workspace status",
  8265. "content": {
  8266. "application/json": {
  8267. "schema": {
  8268. "type": "array",
  8269. "items": {
  8270. "type": "object",
  8271. "properties": {
  8272. "workspaceID": {
  8273. "type": "string"
  8274. },
  8275. "status": {
  8276. "type": "string",
  8277. "enum": ["connected", "connecting", "disconnected", "error"]
  8278. }
  8279. },
  8280. "required": ["workspaceID", "status"],
  8281. "additionalProperties": false
  8282. },
  8283. "description": "Workspace status"
  8284. }
  8285. }
  8286. }
  8287. }
  8288. },
  8289. "description": "Get connection status for workspaces in the current project.",
  8290. "summary": "Workspace status",
  8291. "x-codeSamples": [
  8292. {
  8293. "lang": "js",
  8294. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.status({\n ...\n})"
  8295. }
  8296. ]
  8297. }
  8298. },
  8299. "/experimental/workspace/{id}": {
  8300. "delete": {
  8301. "tags": ["workspace"],
  8302. "operationId": "experimental.workspace.remove",
  8303. "parameters": [
  8304. {
  8305. "name": "directory",
  8306. "in": "query",
  8307. "required": false,
  8308. "schema": {
  8309. "type": "string"
  8310. }
  8311. },
  8312. {
  8313. "name": "workspace",
  8314. "in": "query",
  8315. "required": false,
  8316. "schema": {
  8317. "type": "string"
  8318. }
  8319. },
  8320. {
  8321. "name": "id",
  8322. "in": "path",
  8323. "schema": {
  8324. "type": "string",
  8325. "pattern": "^wrk.*"
  8326. },
  8327. "required": true
  8328. }
  8329. ],
  8330. "responses": {
  8331. "200": {
  8332. "description": "Workspace removed",
  8333. "content": {
  8334. "application/json": {
  8335. "schema": {
  8336. "$ref": "#/components/schemas/Workspace"
  8337. }
  8338. }
  8339. }
  8340. },
  8341. "400": {
  8342. "description": "Bad request",
  8343. "content": {
  8344. "application/json": {
  8345. "schema": {
  8346. "$ref": "#/components/schemas/BadRequestError"
  8347. }
  8348. }
  8349. }
  8350. }
  8351. },
  8352. "description": "Remove an existing workspace.",
  8353. "summary": "Remove workspace",
  8354. "x-codeSamples": [
  8355. {
  8356. "lang": "js",
  8357. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.remove({\n ...\n})"
  8358. }
  8359. ]
  8360. }
  8361. },
  8362. "/experimental/workspace/warp": {
  8363. "post": {
  8364. "tags": ["workspace"],
  8365. "operationId": "experimental.workspace.warp",
  8366. "parameters": [
  8367. {
  8368. "name": "directory",
  8369. "in": "query",
  8370. "required": false,
  8371. "schema": {
  8372. "type": "string"
  8373. }
  8374. },
  8375. {
  8376. "name": "workspace",
  8377. "in": "query",
  8378. "required": false,
  8379. "schema": {
  8380. "type": "string"
  8381. }
  8382. }
  8383. ],
  8384. "responses": {
  8385. "204": {
  8386. "description": "Session warped"
  8387. },
  8388. "400": {
  8389. "description": "Bad request",
  8390. "content": {
  8391. "application/json": {
  8392. "schema": {
  8393. "$ref": "#/components/schemas/BadRequestError"
  8394. }
  8395. }
  8396. }
  8397. }
  8398. },
  8399. "description": "Move a session's sync history into the target workspace, or detach it to the local project.",
  8400. "summary": "Warp session into workspace",
  8401. "requestBody": {
  8402. "content": {
  8403. "application/json": {
  8404. "schema": {
  8405. "type": "object",
  8406. "properties": {
  8407. "id": {
  8408. "type": "string"
  8409. },
  8410. "sessionID": {
  8411. "type": "string"
  8412. }
  8413. },
  8414. "required": ["id", "sessionID"],
  8415. "additionalProperties": false
  8416. }
  8417. }
  8418. }
  8419. },
  8420. "x-codeSamples": [
  8421. {
  8422. "lang": "js",
  8423. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.warp({\n ...\n})"
  8424. }
  8425. ]
  8426. }
  8427. },
  8428. "/pty/{ptyID}/connect": {
  8429. "get": {
  8430. "tags": ["pty"],
  8431. "operationId": "pty.connect",
  8432. "parameters": [
  8433. {
  8434. "name": "directory",
  8435. "in": "query",
  8436. "required": false,
  8437. "schema": {
  8438. "type": "string"
  8439. }
  8440. },
  8441. {
  8442. "name": "workspace",
  8443. "in": "query",
  8444. "required": false,
  8445. "schema": {
  8446. "type": "string"
  8447. }
  8448. },
  8449. {
  8450. "name": "ptyID",
  8451. "in": "path",
  8452. "schema": {
  8453. "type": "string",
  8454. "pattern": "^pty.*"
  8455. },
  8456. "required": true
  8457. }
  8458. ],
  8459. "responses": {
  8460. "200": {
  8461. "description": "Connected session",
  8462. "content": {
  8463. "application/json": {
  8464. "schema": {
  8465. "type": "boolean",
  8466. "description": "Connected session"
  8467. }
  8468. }
  8469. }
  8470. },
  8471. "403": {
  8472. "description": "Forbidden",
  8473. "content": {
  8474. "application/json": {
  8475. "schema": {
  8476. "$ref": "#/components/schemas/effect_HttpApiError_Forbidden"
  8477. }
  8478. }
  8479. }
  8480. },
  8481. "404": {
  8482. "description": "Not found",
  8483. "content": {
  8484. "application/json": {
  8485. "schema": {
  8486. "$ref": "#/components/schemas/NotFoundError"
  8487. }
  8488. }
  8489. }
  8490. }
  8491. },
  8492. "description": "Establish a WebSocket connection to interact with a pseudo-terminal (PTY) session in real-time.",
  8493. "summary": "Connect to PTY session",
  8494. "x-codeSamples": [
  8495. {
  8496. "lang": "js",
  8497. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.connect({\n ...\n})"
  8498. }
  8499. ]
  8500. }
  8501. }
  8502. },
  8503. "components": {
  8504. "schemas": {
  8505. "Event": {
  8506. "anyOf": [
  8507. {
  8508. "$ref": "#/components/schemas/EventServerInstanceDisposed"
  8509. },
  8510. {
  8511. "$ref": "#/components/schemas/EventFileEdited"
  8512. },
  8513. {
  8514. "$ref": "#/components/schemas/EventFileWatcherUpdated"
  8515. },
  8516. {
  8517. "$ref": "#/components/schemas/EventLspClientDiagnostics"
  8518. },
  8519. {
  8520. "$ref": "#/components/schemas/EventLspUpdated"
  8521. },
  8522. {
  8523. "$ref": "#/components/schemas/EventMessagePartDelta"
  8524. },
  8525. {
  8526. "$ref": "#/components/schemas/EventPermissionAsked"
  8527. },
  8528. {
  8529. "$ref": "#/components/schemas/EventPermissionReplied"
  8530. },
  8531. {
  8532. "$ref": "#/components/schemas/EventSessionDiff"
  8533. },
  8534. {
  8535. "$ref": "#/components/schemas/EventSessionError"
  8536. },
  8537. {
  8538. "$ref": "#/components/schemas/EventInstallationUpdated"
  8539. },
  8540. {
  8541. "$ref": "#/components/schemas/EventInstallationUpdate-available"
  8542. },
  8543. {
  8544. "$ref": "#/components/schemas/EventQuestionAsked"
  8545. },
  8546. {
  8547. "$ref": "#/components/schemas/EventQuestionReplied"
  8548. },
  8549. {
  8550. "$ref": "#/components/schemas/EventQuestionRejected"
  8551. },
  8552. {
  8553. "$ref": "#/components/schemas/EventTodoUpdated"
  8554. },
  8555. {
  8556. "$ref": "#/components/schemas/EventSessionStatus"
  8557. },
  8558. {
  8559. "$ref": "#/components/schemas/EventSessionIdle"
  8560. },
  8561. {
  8562. "$ref": "#/components/schemas/EventSessionCompacted"
  8563. },
  8564. {
  8565. "$ref": "#/components/schemas/Event.tui.prompt.append"
  8566. },
  8567. {
  8568. "$ref": "#/components/schemas/Event.tui.command.execute"
  8569. },
  8570. {
  8571. "$ref": "#/components/schemas/EventTuiToastShow1"
  8572. },
  8573. {
  8574. "$ref": "#/components/schemas/Event.tui.session.select"
  8575. },
  8576. {
  8577. "$ref": "#/components/schemas/EventMcpToolsChanged"
  8578. },
  8579. {
  8580. "$ref": "#/components/schemas/EventMcpBrowserOpenFailed"
  8581. },
  8582. {
  8583. "$ref": "#/components/schemas/EventCommandExecuted"
  8584. },
  8585. {
  8586. "$ref": "#/components/schemas/EventProjectUpdated"
  8587. },
  8588. {
  8589. "$ref": "#/components/schemas/EventVcsBranchUpdated"
  8590. },
  8591. {
  8592. "$ref": "#/components/schemas/EventWorkspaceReady"
  8593. },
  8594. {
  8595. "$ref": "#/components/schemas/EventWorkspaceFailed"
  8596. },
  8597. {
  8598. "$ref": "#/components/schemas/EventWorkspaceStatus"
  8599. },
  8600. {
  8601. "$ref": "#/components/schemas/EventWorktreeReady"
  8602. },
  8603. {
  8604. "$ref": "#/components/schemas/EventWorktreeFailed"
  8605. },
  8606. {
  8607. "$ref": "#/components/schemas/EventPtyCreated"
  8608. },
  8609. {
  8610. "$ref": "#/components/schemas/EventPtyUpdated"
  8611. },
  8612. {
  8613. "$ref": "#/components/schemas/EventPtyExited"
  8614. },
  8615. {
  8616. "$ref": "#/components/schemas/EventPtyDeleted"
  8617. },
  8618. {
  8619. "$ref": "#/components/schemas/EventMessageUpdated"
  8620. },
  8621. {
  8622. "$ref": "#/components/schemas/EventMessageRemoved"
  8623. },
  8624. {
  8625. "$ref": "#/components/schemas/EventMessagePartUpdated"
  8626. },
  8627. {
  8628. "$ref": "#/components/schemas/EventMessagePartRemoved"
  8629. },
  8630. {
  8631. "$ref": "#/components/schemas/EventSessionCreated"
  8632. },
  8633. {
  8634. "$ref": "#/components/schemas/EventSessionUpdated"
  8635. },
  8636. {
  8637. "$ref": "#/components/schemas/EventSessionDeleted"
  8638. },
  8639. {
  8640. "$ref": "#/components/schemas/EventSessionNextAgentSwitched"
  8641. },
  8642. {
  8643. "$ref": "#/components/schemas/EventSessionNextModelSwitched"
  8644. },
  8645. {
  8646. "$ref": "#/components/schemas/EventSessionNextPrompted"
  8647. },
  8648. {
  8649. "$ref": "#/components/schemas/EventSessionNextSynthetic"
  8650. },
  8651. {
  8652. "$ref": "#/components/schemas/EventSessionNextShellStarted"
  8653. },
  8654. {
  8655. "$ref": "#/components/schemas/EventSessionNextShellEnded"
  8656. },
  8657. {
  8658. "$ref": "#/components/schemas/EventSessionNextStepStarted"
  8659. },
  8660. {
  8661. "$ref": "#/components/schemas/EventSessionNextStepEnded"
  8662. },
  8663. {
  8664. "$ref": "#/components/schemas/EventSessionNextStepFailed"
  8665. },
  8666. {
  8667. "$ref": "#/components/schemas/EventSessionNextTextStarted"
  8668. },
  8669. {
  8670. "$ref": "#/components/schemas/EventSessionNextTextDelta"
  8671. },
  8672. {
  8673. "$ref": "#/components/schemas/EventSessionNextTextEnded"
  8674. },
  8675. {
  8676. "$ref": "#/components/schemas/EventSessionNextReasoningStarted"
  8677. },
  8678. {
  8679. "$ref": "#/components/schemas/EventSessionNextReasoningDelta"
  8680. },
  8681. {
  8682. "$ref": "#/components/schemas/EventSessionNextReasoningEnded"
  8683. },
  8684. {
  8685. "$ref": "#/components/schemas/EventSessionNextToolInputStarted"
  8686. },
  8687. {
  8688. "$ref": "#/components/schemas/EventSessionNextToolInputDelta"
  8689. },
  8690. {
  8691. "$ref": "#/components/schemas/EventSessionNextToolInputEnded"
  8692. },
  8693. {
  8694. "$ref": "#/components/schemas/EventSessionNextToolCalled"
  8695. },
  8696. {
  8697. "$ref": "#/components/schemas/EventSessionNextToolProgress"
  8698. },
  8699. {
  8700. "$ref": "#/components/schemas/EventSessionNextToolSuccess"
  8701. },
  8702. {
  8703. "$ref": "#/components/schemas/EventSessionNextToolFailed"
  8704. },
  8705. {
  8706. "$ref": "#/components/schemas/EventSessionNextRetried"
  8707. },
  8708. {
  8709. "$ref": "#/components/schemas/EventSessionNextCompactionStarted"
  8710. },
  8711. {
  8712. "$ref": "#/components/schemas/EventSessionNextCompactionDelta"
  8713. },
  8714. {
  8715. "$ref": "#/components/schemas/EventSessionNextCompactionEnded"
  8716. },
  8717. {
  8718. "$ref": "#/components/schemas/EventServerConnected"
  8719. },
  8720. {
  8721. "$ref": "#/components/schemas/EventGlobalDisposed"
  8722. }
  8723. ]
  8724. },
  8725. "OAuth": {
  8726. "type": "object",
  8727. "properties": {
  8728. "type": {
  8729. "type": "string",
  8730. "enum": ["oauth"]
  8731. },
  8732. "refresh": {
  8733. "type": "string"
  8734. },
  8735. "access": {
  8736. "type": "string"
  8737. },
  8738. "expires": {
  8739. "type": "integer",
  8740. "minimum": 0
  8741. },
  8742. "accountId": {
  8743. "type": "string"
  8744. },
  8745. "enterpriseUrl": {
  8746. "type": "string"
  8747. }
  8748. },
  8749. "required": ["type", "refresh", "access", "expires"],
  8750. "additionalProperties": false
  8751. },
  8752. "ApiAuth": {
  8753. "type": "object",
  8754. "properties": {
  8755. "type": {
  8756. "type": "string",
  8757. "enum": ["api"]
  8758. },
  8759. "key": {
  8760. "type": "string"
  8761. },
  8762. "metadata": {
  8763. "type": "object",
  8764. "additionalProperties": {
  8765. "type": "string"
  8766. }
  8767. }
  8768. },
  8769. "required": ["type", "key"],
  8770. "additionalProperties": false
  8771. },
  8772. "WellKnownAuth": {
  8773. "type": "object",
  8774. "properties": {
  8775. "type": {
  8776. "type": "string",
  8777. "enum": ["wellknown"]
  8778. },
  8779. "key": {
  8780. "type": "string"
  8781. },
  8782. "token": {
  8783. "type": "string"
  8784. }
  8785. },
  8786. "required": ["type", "key", "token"],
  8787. "additionalProperties": false
  8788. },
  8789. "Auth": {
  8790. "anyOf": [
  8791. {
  8792. "$ref": "#/components/schemas/OAuth"
  8793. },
  8794. {
  8795. "$ref": "#/components/schemas/ApiAuth"
  8796. },
  8797. {
  8798. "$ref": "#/components/schemas/WellKnownAuth"
  8799. }
  8800. ]
  8801. },
  8802. "PermissionRequest": {
  8803. "type": "object",
  8804. "properties": {
  8805. "id": {
  8806. "type": "string"
  8807. },
  8808. "sessionID": {
  8809. "type": "string"
  8810. },
  8811. "permission": {
  8812. "type": "string"
  8813. },
  8814. "patterns": {
  8815. "type": "array",
  8816. "items": {
  8817. "type": "string"
  8818. }
  8819. },
  8820. "metadata": {
  8821. "type": "object"
  8822. },
  8823. "always": {
  8824. "type": "array",
  8825. "items": {
  8826. "type": "string"
  8827. }
  8828. },
  8829. "tool": {
  8830. "type": "object",
  8831. "properties": {
  8832. "messageID": {
  8833. "type": "string"
  8834. },
  8835. "callID": {
  8836. "type": "string"
  8837. }
  8838. },
  8839. "required": ["messageID", "callID"],
  8840. "additionalProperties": false
  8841. }
  8842. },
  8843. "required": ["id", "sessionID", "permission", "patterns", "metadata", "always"],
  8844. "additionalProperties": false
  8845. },
  8846. "SnapshotFileDiff": {
  8847. "type": "object",
  8848. "properties": {
  8849. "file": {
  8850. "type": "string"
  8851. },
  8852. "patch": {
  8853. "type": "string"
  8854. },
  8855. "additions": {
  8856. "type": "integer",
  8857. "minimum": 0
  8858. },
  8859. "deletions": {
  8860. "type": "integer",
  8861. "minimum": 0
  8862. },
  8863. "status": {
  8864. "type": "string",
  8865. "enum": ["added", "deleted", "modified"]
  8866. }
  8867. },
  8868. "required": ["file", "patch", "additions", "deletions"],
  8869. "additionalProperties": false
  8870. },
  8871. "ProviderAuthError": {
  8872. "type": "object",
  8873. "properties": {
  8874. "name": {
  8875. "type": "string",
  8876. "enum": ["ProviderAuthError"]
  8877. },
  8878. "data": {
  8879. "type": "object",
  8880. "properties": {
  8881. "providerID": {
  8882. "type": "string"
  8883. },
  8884. "message": {
  8885. "type": "string"
  8886. }
  8887. },
  8888. "required": ["providerID", "message"],
  8889. "additionalProperties": false
  8890. }
  8891. },
  8892. "required": ["name", "data"],
  8893. "additionalProperties": false
  8894. },
  8895. "UnknownError": {
  8896. "type": "object",
  8897. "properties": {
  8898. "name": {
  8899. "type": "string",
  8900. "enum": ["UnknownError"]
  8901. },
  8902. "data": {
  8903. "type": "object",
  8904. "properties": {
  8905. "message": {
  8906. "type": "string"
  8907. }
  8908. },
  8909. "required": ["message"],
  8910. "additionalProperties": false
  8911. }
  8912. },
  8913. "required": ["name", "data"],
  8914. "additionalProperties": false
  8915. },
  8916. "MessageOutputLengthError": {
  8917. "type": "object",
  8918. "properties": {
  8919. "name": {
  8920. "type": "string",
  8921. "enum": ["MessageOutputLengthError"]
  8922. },
  8923. "data": {
  8924. "type": "object",
  8925. "properties": {}
  8926. }
  8927. },
  8928. "required": ["name", "data"],
  8929. "additionalProperties": false
  8930. },
  8931. "MessageAbortedError": {
  8932. "type": "object",
  8933. "properties": {
  8934. "name": {
  8935. "type": "string",
  8936. "enum": ["MessageAbortedError"]
  8937. },
  8938. "data": {
  8939. "type": "object",
  8940. "properties": {
  8941. "message": {
  8942. "type": "string"
  8943. }
  8944. },
  8945. "required": ["message"],
  8946. "additionalProperties": false
  8947. }
  8948. },
  8949. "required": ["name", "data"],
  8950. "additionalProperties": false
  8951. },
  8952. "StructuredOutputError": {
  8953. "type": "object",
  8954. "properties": {
  8955. "name": {
  8956. "type": "string",
  8957. "enum": ["StructuredOutputError"]
  8958. },
  8959. "data": {
  8960. "type": "object",
  8961. "properties": {
  8962. "message": {
  8963. "type": "string"
  8964. },
  8965. "retries": {
  8966. "type": "integer",
  8967. "minimum": 0
  8968. }
  8969. },
  8970. "required": ["message", "retries"],
  8971. "additionalProperties": false
  8972. }
  8973. },
  8974. "required": ["name", "data"],
  8975. "additionalProperties": false
  8976. },
  8977. "ContextOverflowError": {
  8978. "type": "object",
  8979. "properties": {
  8980. "name": {
  8981. "type": "string",
  8982. "enum": ["ContextOverflowError"]
  8983. },
  8984. "data": {
  8985. "type": "object",
  8986. "properties": {
  8987. "message": {
  8988. "type": "string"
  8989. },
  8990. "responseBody": {
  8991. "type": "string"
  8992. }
  8993. },
  8994. "required": ["message"],
  8995. "additionalProperties": false
  8996. }
  8997. },
  8998. "required": ["name", "data"],
  8999. "additionalProperties": false
  9000. },
  9001. "APIError": {
  9002. "type": "object",
  9003. "properties": {
  9004. "name": {
  9005. "type": "string",
  9006. "enum": ["APIError"]
  9007. },
  9008. "data": {
  9009. "type": "object",
  9010. "properties": {
  9011. "message": {
  9012. "type": "string"
  9013. },
  9014. "statusCode": {
  9015. "type": "integer",
  9016. "minimum": 0
  9017. },
  9018. "isRetryable": {
  9019. "type": "boolean"
  9020. },
  9021. "responseHeaders": {
  9022. "type": "object",
  9023. "additionalProperties": {
  9024. "type": "string"
  9025. }
  9026. },
  9027. "responseBody": {
  9028. "type": "string"
  9029. },
  9030. "metadata": {
  9031. "type": "object",
  9032. "additionalProperties": {
  9033. "type": "string"
  9034. }
  9035. }
  9036. },
  9037. "required": ["message", "isRetryable"],
  9038. "additionalProperties": false
  9039. }
  9040. },
  9041. "required": ["name", "data"],
  9042. "additionalProperties": false
  9043. },
  9044. "QuestionOption": {
  9045. "type": "object",
  9046. "properties": {
  9047. "label": {
  9048. "type": "string",
  9049. "description": "Display text (1-5 words, concise)"
  9050. },
  9051. "description": {
  9052. "type": "string",
  9053. "description": "Explanation of choice"
  9054. }
  9055. },
  9056. "required": ["label", "description"],
  9057. "additionalProperties": false
  9058. },
  9059. "QuestionInfo": {
  9060. "type": "object",
  9061. "properties": {
  9062. "question": {
  9063. "type": "string",
  9064. "description": "Complete question"
  9065. },
  9066. "header": {
  9067. "type": "string",
  9068. "description": "Very short label (max 30 chars)"
  9069. },
  9070. "options": {
  9071. "type": "array",
  9072. "items": {
  9073. "$ref": "#/components/schemas/QuestionOption"
  9074. },
  9075. "description": "Available choices"
  9076. },
  9077. "multiple": {
  9078. "type": "boolean"
  9079. },
  9080. "custom": {
  9081. "type": "boolean"
  9082. }
  9083. },
  9084. "required": ["question", "header", "options"],
  9085. "additionalProperties": false
  9086. },
  9087. "QuestionTool": {
  9088. "type": "object",
  9089. "properties": {
  9090. "messageID": {
  9091. "type": "string"
  9092. },
  9093. "callID": {
  9094. "type": "string"
  9095. }
  9096. },
  9097. "required": ["messageID", "callID"],
  9098. "additionalProperties": false
  9099. },
  9100. "QuestionRequest": {
  9101. "type": "object",
  9102. "properties": {
  9103. "id": {
  9104. "type": "string"
  9105. },
  9106. "sessionID": {
  9107. "type": "string"
  9108. },
  9109. "questions": {
  9110. "type": "array",
  9111. "items": {
  9112. "$ref": "#/components/schemas/QuestionInfo"
  9113. },
  9114. "description": "Questions to ask"
  9115. },
  9116. "tool": {
  9117. "$ref": "#/components/schemas/QuestionTool"
  9118. }
  9119. },
  9120. "required": ["id", "sessionID", "questions"],
  9121. "additionalProperties": false
  9122. },
  9123. "QuestionAnswer": {
  9124. "type": "array",
  9125. "items": {
  9126. "type": "string"
  9127. }
  9128. },
  9129. "QuestionReplied": {
  9130. "type": "object",
  9131. "properties": {
  9132. "sessionID": {
  9133. "type": "string"
  9134. },
  9135. "requestID": {
  9136. "type": "string"
  9137. },
  9138. "answers": {
  9139. "type": "array",
  9140. "items": {
  9141. "$ref": "#/components/schemas/QuestionAnswer"
  9142. }
  9143. }
  9144. },
  9145. "required": ["sessionID", "requestID", "answers"],
  9146. "additionalProperties": false
  9147. },
  9148. "QuestionRejected": {
  9149. "type": "object",
  9150. "properties": {
  9151. "sessionID": {
  9152. "type": "string"
  9153. },
  9154. "requestID": {
  9155. "type": "string"
  9156. }
  9157. },
  9158. "required": ["sessionID", "requestID"],
  9159. "additionalProperties": false
  9160. },
  9161. "Todo": {
  9162. "type": "object",
  9163. "properties": {
  9164. "content": {
  9165. "type": "string",
  9166. "description": "Brief description of the task"
  9167. },
  9168. "status": {
  9169. "type": "string",
  9170. "description": "Current status of the task: pending, in_progress, completed, cancelled"
  9171. },
  9172. "priority": {
  9173. "type": "string",
  9174. "description": "Priority level of the task: high, medium, low"
  9175. }
  9176. },
  9177. "required": ["content", "status", "priority"],
  9178. "additionalProperties": false
  9179. },
  9180. "SessionStatus": {
  9181. "anyOf": [
  9182. {
  9183. "type": "object",
  9184. "properties": {
  9185. "type": {
  9186. "type": "string",
  9187. "enum": ["idle"]
  9188. }
  9189. },
  9190. "required": ["type"],
  9191. "additionalProperties": false
  9192. },
  9193. {
  9194. "type": "object",
  9195. "properties": {
  9196. "type": {
  9197. "type": "string",
  9198. "enum": ["retry"]
  9199. },
  9200. "attempt": {
  9201. "type": "integer",
  9202. "minimum": 0
  9203. },
  9204. "message": {
  9205. "type": "string"
  9206. },
  9207. "next": {
  9208. "type": "integer",
  9209. "minimum": 0
  9210. }
  9211. },
  9212. "required": ["type", "attempt", "message", "next"],
  9213. "additionalProperties": false
  9214. },
  9215. {
  9216. "type": "object",
  9217. "properties": {
  9218. "type": {
  9219. "type": "string",
  9220. "enum": ["busy"]
  9221. }
  9222. },
  9223. "required": ["type"],
  9224. "additionalProperties": false
  9225. }
  9226. ]
  9227. },
  9228. "Event.tui.prompt.append": {
  9229. "type": "object",
  9230. "properties": {
  9231. "id": {
  9232. "type": "string"
  9233. },
  9234. "type": {
  9235. "type": "string",
  9236. "enum": ["tui.prompt.append"]
  9237. },
  9238. "properties": {
  9239. "type": "object",
  9240. "properties": {
  9241. "text": {
  9242. "type": "string"
  9243. }
  9244. },
  9245. "required": ["text"],
  9246. "additionalProperties": false
  9247. }
  9248. },
  9249. "required": ["id", "type", "properties"],
  9250. "additionalProperties": false
  9251. },
  9252. "Event.tui.command.execute": {
  9253. "type": "object",
  9254. "properties": {
  9255. "id": {
  9256. "type": "string"
  9257. },
  9258. "type": {
  9259. "type": "string",
  9260. "enum": ["tui.command.execute"]
  9261. },
  9262. "properties": {
  9263. "type": "object",
  9264. "properties": {
  9265. "command": {
  9266. "anyOf": [
  9267. {
  9268. "type": "string",
  9269. "enum": [
  9270. "session.list",
  9271. "session.new",
  9272. "session.share",
  9273. "session.interrupt",
  9274. "session.compact",
  9275. "session.page.up",
  9276. "session.page.down",
  9277. "session.line.up",
  9278. "session.line.down",
  9279. "session.half.page.up",
  9280. "session.half.page.down",
  9281. "session.first",
  9282. "session.last",
  9283. "prompt.clear",
  9284. "prompt.submit",
  9285. "agent.cycle"
  9286. ]
  9287. },
  9288. {
  9289. "type": "string"
  9290. }
  9291. ]
  9292. }
  9293. },
  9294. "required": ["command"],
  9295. "additionalProperties": false
  9296. }
  9297. },
  9298. "required": ["id", "type", "properties"],
  9299. "additionalProperties": false
  9300. },
  9301. "Event.tui.toast.show": {
  9302. "type": "object",
  9303. "properties": {
  9304. "id": {
  9305. "type": "string"
  9306. },
  9307. "type": {
  9308. "type": "string",
  9309. "enum": ["tui.toast.show"]
  9310. },
  9311. "properties": {
  9312. "type": "object",
  9313. "properties": {
  9314. "title": {
  9315. "type": "string"
  9316. },
  9317. "message": {
  9318. "type": "string"
  9319. },
  9320. "variant": {
  9321. "type": "string",
  9322. "enum": ["info", "success", "warning", "error"]
  9323. },
  9324. "duration": {
  9325. "type": "integer",
  9326. "exclusiveMinimum": 0
  9327. }
  9328. },
  9329. "required": ["message", "variant"],
  9330. "additionalProperties": false
  9331. }
  9332. },
  9333. "required": ["id", "type", "properties"],
  9334. "additionalProperties": false
  9335. },
  9336. "Event.tui.session.select": {
  9337. "type": "object",
  9338. "properties": {
  9339. "id": {
  9340. "type": "string"
  9341. },
  9342. "type": {
  9343. "type": "string",
  9344. "enum": ["tui.session.select"]
  9345. },
  9346. "properties": {
  9347. "type": "object",
  9348. "properties": {
  9349. "sessionID": {
  9350. "type": "string",
  9351. "description": "Session ID to navigate to"
  9352. }
  9353. },
  9354. "required": ["sessionID"],
  9355. "additionalProperties": false
  9356. }
  9357. },
  9358. "required": ["id", "type", "properties"],
  9359. "additionalProperties": false
  9360. },
  9361. "Project": {
  9362. "type": "object",
  9363. "properties": {
  9364. "id": {
  9365. "type": "string"
  9366. },
  9367. "worktree": {
  9368. "type": "string"
  9369. },
  9370. "vcs": {
  9371. "type": "string",
  9372. "enum": ["git"]
  9373. },
  9374. "name": {
  9375. "type": "string"
  9376. },
  9377. "icon": {
  9378. "type": "object",
  9379. "properties": {
  9380. "url": {
  9381. "type": "string"
  9382. },
  9383. "override": {
  9384. "type": "string"
  9385. },
  9386. "color": {
  9387. "type": "string"
  9388. }
  9389. },
  9390. "additionalProperties": false
  9391. },
  9392. "commands": {
  9393. "type": "object",
  9394. "properties": {
  9395. "start": {
  9396. "type": "string",
  9397. "description": "Startup script to run when creating a new workspace (worktree)"
  9398. }
  9399. },
  9400. "additionalProperties": false
  9401. },
  9402. "time": {
  9403. "type": "object",
  9404. "properties": {
  9405. "created": {
  9406. "type": "integer",
  9407. "minimum": 0
  9408. },
  9409. "updated": {
  9410. "type": "integer",
  9411. "minimum": 0
  9412. },
  9413. "initialized": {
  9414. "type": "integer",
  9415. "minimum": 0
  9416. }
  9417. },
  9418. "required": ["created", "updated"],
  9419. "additionalProperties": false
  9420. },
  9421. "sandboxes": {
  9422. "type": "array",
  9423. "items": {
  9424. "type": "string"
  9425. }
  9426. }
  9427. },
  9428. "required": ["id", "worktree", "time", "sandboxes"],
  9429. "additionalProperties": false
  9430. },
  9431. "Pty": {
  9432. "type": "object",
  9433. "properties": {
  9434. "id": {
  9435. "type": "string"
  9436. },
  9437. "title": {
  9438. "type": "string"
  9439. },
  9440. "command": {
  9441. "type": "string"
  9442. },
  9443. "args": {
  9444. "type": "array",
  9445. "items": {
  9446. "type": "string"
  9447. }
  9448. },
  9449. "cwd": {
  9450. "type": "string"
  9451. },
  9452. "status": {
  9453. "type": "string",
  9454. "enum": ["running", "exited"]
  9455. },
  9456. "pid": {
  9457. "type": "integer",
  9458. "exclusiveMinimum": 0
  9459. }
  9460. },
  9461. "required": ["id", "title", "command", "args", "cwd", "status", "pid"],
  9462. "additionalProperties": false
  9463. },
  9464. "OutputFormatText": {
  9465. "type": "object",
  9466. "properties": {
  9467. "type": {
  9468. "type": "string",
  9469. "enum": ["text"]
  9470. }
  9471. },
  9472. "required": ["type"],
  9473. "additionalProperties": false
  9474. },
  9475. "JSONSchema": {
  9476. "type": "object"
  9477. },
  9478. "OutputFormatJsonSchema": {
  9479. "type": "object",
  9480. "properties": {
  9481. "type": {
  9482. "type": "string",
  9483. "enum": ["json_schema"]
  9484. },
  9485. "schema": {
  9486. "$ref": "#/components/schemas/JSONSchema"
  9487. },
  9488. "retryCount": {
  9489. "type": "integer",
  9490. "minimum": 0
  9491. }
  9492. },
  9493. "required": ["type", "schema"],
  9494. "additionalProperties": false
  9495. },
  9496. "OutputFormat": {
  9497. "anyOf": [
  9498. {
  9499. "$ref": "#/components/schemas/OutputFormatText"
  9500. },
  9501. {
  9502. "$ref": "#/components/schemas/OutputFormatJsonSchema"
  9503. }
  9504. ]
  9505. },
  9506. "UserMessage": {
  9507. "type": "object",
  9508. "properties": {
  9509. "id": {
  9510. "type": "string"
  9511. },
  9512. "sessionID": {
  9513. "type": "string"
  9514. },
  9515. "role": {
  9516. "type": "string",
  9517. "enum": ["user"]
  9518. },
  9519. "time": {
  9520. "type": "object",
  9521. "properties": {
  9522. "created": {
  9523. "type": "integer",
  9524. "minimum": 0
  9525. }
  9526. },
  9527. "required": ["created"],
  9528. "additionalProperties": false
  9529. },
  9530. "format": {
  9531. "$ref": "#/components/schemas/OutputFormat"
  9532. },
  9533. "summary": {
  9534. "type": "object",
  9535. "properties": {
  9536. "title": {
  9537. "type": "string"
  9538. },
  9539. "body": {
  9540. "type": "string"
  9541. },
  9542. "diffs": {
  9543. "type": "array",
  9544. "items": {
  9545. "$ref": "#/components/schemas/SnapshotFileDiff"
  9546. }
  9547. }
  9548. },
  9549. "required": ["diffs"],
  9550. "additionalProperties": false
  9551. },
  9552. "agent": {
  9553. "type": "string"
  9554. },
  9555. "model": {
  9556. "type": "object",
  9557. "properties": {
  9558. "providerID": {
  9559. "type": "string"
  9560. },
  9561. "modelID": {
  9562. "type": "string"
  9563. },
  9564. "variant": {
  9565. "type": "string"
  9566. }
  9567. },
  9568. "required": ["providerID", "modelID"],
  9569. "additionalProperties": false
  9570. },
  9571. "system": {
  9572. "type": "string"
  9573. },
  9574. "tools": {
  9575. "type": "object",
  9576. "additionalProperties": {
  9577. "type": "boolean"
  9578. }
  9579. }
  9580. },
  9581. "required": ["id", "sessionID", "role", "time", "agent", "model"],
  9582. "additionalProperties": false
  9583. },
  9584. "AssistantMessage": {
  9585. "type": "object",
  9586. "properties": {
  9587. "id": {
  9588. "type": "string"
  9589. },
  9590. "sessionID": {
  9591. "type": "string"
  9592. },
  9593. "role": {
  9594. "type": "string",
  9595. "enum": ["assistant"]
  9596. },
  9597. "time": {
  9598. "type": "object",
  9599. "properties": {
  9600. "created": {
  9601. "type": "integer",
  9602. "minimum": 0
  9603. },
  9604. "completed": {
  9605. "type": "integer",
  9606. "minimum": 0
  9607. }
  9608. },
  9609. "required": ["created"],
  9610. "additionalProperties": false
  9611. },
  9612. "error": {
  9613. "anyOf": [
  9614. {
  9615. "$ref": "#/components/schemas/ProviderAuthError"
  9616. },
  9617. {
  9618. "$ref": "#/components/schemas/UnknownError"
  9619. },
  9620. {
  9621. "$ref": "#/components/schemas/MessageOutputLengthError"
  9622. },
  9623. {
  9624. "$ref": "#/components/schemas/MessageAbortedError"
  9625. },
  9626. {
  9627. "$ref": "#/components/schemas/StructuredOutputError"
  9628. },
  9629. {
  9630. "$ref": "#/components/schemas/ContextOverflowError"
  9631. },
  9632. {
  9633. "$ref": "#/components/schemas/APIError"
  9634. }
  9635. ]
  9636. },
  9637. "parentID": {
  9638. "type": "string"
  9639. },
  9640. "modelID": {
  9641. "type": "string"
  9642. },
  9643. "providerID": {
  9644. "type": "string"
  9645. },
  9646. "mode": {
  9647. "type": "string"
  9648. },
  9649. "agent": {
  9650. "type": "string"
  9651. },
  9652. "path": {
  9653. "type": "object",
  9654. "properties": {
  9655. "cwd": {
  9656. "type": "string"
  9657. },
  9658. "root": {
  9659. "type": "string"
  9660. }
  9661. },
  9662. "required": ["cwd", "root"],
  9663. "additionalProperties": false
  9664. },
  9665. "summary": {
  9666. "type": "boolean"
  9667. },
  9668. "cost": {
  9669. "type": "number"
  9670. },
  9671. "tokens": {
  9672. "type": "object",
  9673. "properties": {
  9674. "total": {
  9675. "type": "integer",
  9676. "minimum": 0
  9677. },
  9678. "input": {
  9679. "type": "integer",
  9680. "minimum": 0
  9681. },
  9682. "output": {
  9683. "type": "integer",
  9684. "minimum": 0
  9685. },
  9686. "reasoning": {
  9687. "type": "integer",
  9688. "minimum": 0
  9689. },
  9690. "cache": {
  9691. "type": "object",
  9692. "properties": {
  9693. "read": {
  9694. "type": "integer",
  9695. "minimum": 0
  9696. },
  9697. "write": {
  9698. "type": "integer",
  9699. "minimum": 0
  9700. }
  9701. },
  9702. "required": ["read", "write"],
  9703. "additionalProperties": false
  9704. }
  9705. },
  9706. "required": ["input", "output", "reasoning", "cache"],
  9707. "additionalProperties": false
  9708. },
  9709. "structured": {},
  9710. "variant": {
  9711. "type": "string"
  9712. },
  9713. "finish": {
  9714. "type": "string"
  9715. }
  9716. },
  9717. "required": [
  9718. "id",
  9719. "sessionID",
  9720. "role",
  9721. "time",
  9722. "parentID",
  9723. "modelID",
  9724. "providerID",
  9725. "mode",
  9726. "agent",
  9727. "path",
  9728. "cost",
  9729. "tokens"
  9730. ],
  9731. "additionalProperties": false
  9732. },
  9733. "Message": {
  9734. "anyOf": [
  9735. {
  9736. "$ref": "#/components/schemas/UserMessage"
  9737. },
  9738. {
  9739. "$ref": "#/components/schemas/AssistantMessage"
  9740. }
  9741. ]
  9742. },
  9743. "TextPart": {
  9744. "type": "object",
  9745. "properties": {
  9746. "id": {
  9747. "type": "string"
  9748. },
  9749. "sessionID": {
  9750. "type": "string"
  9751. },
  9752. "messageID": {
  9753. "type": "string"
  9754. },
  9755. "type": {
  9756. "type": "string",
  9757. "enum": ["text"]
  9758. },
  9759. "text": {
  9760. "type": "string"
  9761. },
  9762. "synthetic": {
  9763. "type": "boolean"
  9764. },
  9765. "ignored": {
  9766. "type": "boolean"
  9767. },
  9768. "time": {
  9769. "type": "object",
  9770. "properties": {
  9771. "start": {
  9772. "type": "integer",
  9773. "minimum": 0
  9774. },
  9775. "end": {
  9776. "type": "integer",
  9777. "minimum": 0
  9778. }
  9779. },
  9780. "required": ["start"],
  9781. "additionalProperties": false
  9782. },
  9783. "metadata": {
  9784. "type": "object"
  9785. }
  9786. },
  9787. "required": ["id", "sessionID", "messageID", "type", "text"],
  9788. "additionalProperties": false
  9789. },
  9790. "SubtaskPart": {
  9791. "type": "object",
  9792. "properties": {
  9793. "id": {
  9794. "type": "string"
  9795. },
  9796. "sessionID": {
  9797. "type": "string"
  9798. },
  9799. "messageID": {
  9800. "type": "string"
  9801. },
  9802. "type": {
  9803. "type": "string",
  9804. "enum": ["subtask"]
  9805. },
  9806. "prompt": {
  9807. "type": "string"
  9808. },
  9809. "description": {
  9810. "type": "string"
  9811. },
  9812. "agent": {
  9813. "type": "string"
  9814. },
  9815. "model": {
  9816. "type": "object",
  9817. "properties": {
  9818. "providerID": {
  9819. "type": "string"
  9820. },
  9821. "modelID": {
  9822. "type": "string"
  9823. }
  9824. },
  9825. "required": ["providerID", "modelID"],
  9826. "additionalProperties": false
  9827. },
  9828. "command": {
  9829. "type": "string"
  9830. }
  9831. },
  9832. "required": ["id", "sessionID", "messageID", "type", "prompt", "description", "agent"],
  9833. "additionalProperties": false
  9834. },
  9835. "ReasoningPart": {
  9836. "type": "object",
  9837. "properties": {
  9838. "id": {
  9839. "type": "string"
  9840. },
  9841. "sessionID": {
  9842. "type": "string"
  9843. },
  9844. "messageID": {
  9845. "type": "string"
  9846. },
  9847. "type": {
  9848. "type": "string",
  9849. "enum": ["reasoning"]
  9850. },
  9851. "text": {
  9852. "type": "string"
  9853. },
  9854. "metadata": {
  9855. "type": "object"
  9856. },
  9857. "time": {
  9858. "type": "object",
  9859. "properties": {
  9860. "start": {
  9861. "type": "integer",
  9862. "minimum": 0
  9863. },
  9864. "end": {
  9865. "type": "integer",
  9866. "minimum": 0
  9867. }
  9868. },
  9869. "required": ["start"],
  9870. "additionalProperties": false
  9871. }
  9872. },
  9873. "required": ["id", "sessionID", "messageID", "type", "text", "time"],
  9874. "additionalProperties": false
  9875. },
  9876. "FilePartSourceText": {
  9877. "type": "object",
  9878. "properties": {
  9879. "value": {
  9880. "type": "string"
  9881. },
  9882. "start": {
  9883. "type": "integer",
  9884. "minimum": 0
  9885. },
  9886. "end": {
  9887. "type": "integer",
  9888. "minimum": 0
  9889. }
  9890. },
  9891. "required": ["value", "start", "end"],
  9892. "additionalProperties": false
  9893. },
  9894. "FileSource": {
  9895. "type": "object",
  9896. "properties": {
  9897. "text": {
  9898. "$ref": "#/components/schemas/FilePartSourceText"
  9899. },
  9900. "type": {
  9901. "type": "string",
  9902. "enum": ["file"]
  9903. },
  9904. "path": {
  9905. "type": "string"
  9906. }
  9907. },
  9908. "required": ["text", "type", "path"],
  9909. "additionalProperties": false
  9910. },
  9911. "Range": {
  9912. "type": "object",
  9913. "properties": {
  9914. "start": {
  9915. "type": "object",
  9916. "properties": {
  9917. "line": {
  9918. "type": "integer",
  9919. "minimum": 0
  9920. },
  9921. "character": {
  9922. "type": "integer",
  9923. "minimum": 0
  9924. }
  9925. },
  9926. "required": ["line", "character"],
  9927. "additionalProperties": false
  9928. },
  9929. "end": {
  9930. "type": "object",
  9931. "properties": {
  9932. "line": {
  9933. "type": "integer",
  9934. "minimum": 0
  9935. },
  9936. "character": {
  9937. "type": "integer",
  9938. "minimum": 0
  9939. }
  9940. },
  9941. "required": ["line", "character"],
  9942. "additionalProperties": false
  9943. }
  9944. },
  9945. "required": ["start", "end"],
  9946. "additionalProperties": false
  9947. },
  9948. "SymbolSource": {
  9949. "type": "object",
  9950. "properties": {
  9951. "text": {
  9952. "$ref": "#/components/schemas/FilePartSourceText"
  9953. },
  9954. "type": {
  9955. "type": "string",
  9956. "enum": ["symbol"]
  9957. },
  9958. "path": {
  9959. "type": "string"
  9960. },
  9961. "range": {
  9962. "$ref": "#/components/schemas/Range"
  9963. },
  9964. "name": {
  9965. "type": "string"
  9966. },
  9967. "kind": {
  9968. "type": "integer",
  9969. "minimum": 0
  9970. }
  9971. },
  9972. "required": ["text", "type", "path", "range", "name", "kind"],
  9973. "additionalProperties": false
  9974. },
  9975. "ResourceSource": {
  9976. "type": "object",
  9977. "properties": {
  9978. "text": {
  9979. "$ref": "#/components/schemas/FilePartSourceText"
  9980. },
  9981. "type": {
  9982. "type": "string",
  9983. "enum": ["resource"]
  9984. },
  9985. "clientName": {
  9986. "type": "string"
  9987. },
  9988. "uri": {
  9989. "type": "string"
  9990. }
  9991. },
  9992. "required": ["text", "type", "clientName", "uri"],
  9993. "additionalProperties": false
  9994. },
  9995. "FilePartSource": {
  9996. "anyOf": [
  9997. {
  9998. "$ref": "#/components/schemas/FileSource"
  9999. },
  10000. {
  10001. "$ref": "#/components/schemas/SymbolSource"
  10002. },
  10003. {
  10004. "$ref": "#/components/schemas/ResourceSource"
  10005. }
  10006. ]
  10007. },
  10008. "FilePart": {
  10009. "type": "object",
  10010. "properties": {
  10011. "id": {
  10012. "type": "string"
  10013. },
  10014. "sessionID": {
  10015. "type": "string"
  10016. },
  10017. "messageID": {
  10018. "type": "string"
  10019. },
  10020. "type": {
  10021. "type": "string",
  10022. "enum": ["file"]
  10023. },
  10024. "mime": {
  10025. "type": "string"
  10026. },
  10027. "filename": {
  10028. "type": "string"
  10029. },
  10030. "url": {
  10031. "type": "string"
  10032. },
  10033. "source": {
  10034. "$ref": "#/components/schemas/FilePartSource"
  10035. }
  10036. },
  10037. "required": ["id", "sessionID", "messageID", "type", "mime", "url"],
  10038. "additionalProperties": false
  10039. },
  10040. "ToolStatePending": {
  10041. "type": "object",
  10042. "properties": {
  10043. "status": {
  10044. "type": "string",
  10045. "enum": ["pending"]
  10046. },
  10047. "input": {
  10048. "type": "object"
  10049. },
  10050. "raw": {
  10051. "type": "string"
  10052. }
  10053. },
  10054. "required": ["status", "input", "raw"],
  10055. "additionalProperties": false
  10056. },
  10057. "ToolStateRunning": {
  10058. "type": "object",
  10059. "properties": {
  10060. "status": {
  10061. "type": "string",
  10062. "enum": ["running"]
  10063. },
  10064. "input": {
  10065. "type": "object"
  10066. },
  10067. "title": {
  10068. "type": "string"
  10069. },
  10070. "metadata": {
  10071. "type": "object"
  10072. },
  10073. "time": {
  10074. "type": "object",
  10075. "properties": {
  10076. "start": {
  10077. "type": "integer",
  10078. "minimum": 0
  10079. }
  10080. },
  10081. "required": ["start"],
  10082. "additionalProperties": false
  10083. }
  10084. },
  10085. "required": ["status", "input", "time"],
  10086. "additionalProperties": false
  10087. },
  10088. "ToolStateCompleted": {
  10089. "type": "object",
  10090. "properties": {
  10091. "status": {
  10092. "type": "string",
  10093. "enum": ["completed"]
  10094. },
  10095. "input": {
  10096. "type": "object"
  10097. },
  10098. "output": {
  10099. "type": "string"
  10100. },
  10101. "title": {
  10102. "type": "string"
  10103. },
  10104. "metadata": {
  10105. "type": "object"
  10106. },
  10107. "time": {
  10108. "type": "object",
  10109. "properties": {
  10110. "start": {
  10111. "type": "integer",
  10112. "minimum": 0
  10113. },
  10114. "end": {
  10115. "type": "integer",
  10116. "minimum": 0
  10117. },
  10118. "compacted": {
  10119. "type": "integer",
  10120. "minimum": 0
  10121. }
  10122. },
  10123. "required": ["start", "end"],
  10124. "additionalProperties": false
  10125. },
  10126. "attachments": {
  10127. "type": "array",
  10128. "items": {
  10129. "$ref": "#/components/schemas/FilePart"
  10130. }
  10131. }
  10132. },
  10133. "required": ["status", "input", "output", "title", "metadata", "time"],
  10134. "additionalProperties": false
  10135. },
  10136. "ToolStateError": {
  10137. "type": "object",
  10138. "properties": {
  10139. "status": {
  10140. "type": "string",
  10141. "enum": ["error"]
  10142. },
  10143. "input": {
  10144. "type": "object"
  10145. },
  10146. "error": {
  10147. "type": "string"
  10148. },
  10149. "metadata": {
  10150. "type": "object"
  10151. },
  10152. "time": {
  10153. "type": "object",
  10154. "properties": {
  10155. "start": {
  10156. "type": "integer",
  10157. "minimum": 0
  10158. },
  10159. "end": {
  10160. "type": "integer",
  10161. "minimum": 0
  10162. }
  10163. },
  10164. "required": ["start", "end"],
  10165. "additionalProperties": false
  10166. }
  10167. },
  10168. "required": ["status", "input", "error", "time"],
  10169. "additionalProperties": false
  10170. },
  10171. "ToolState": {
  10172. "anyOf": [
  10173. {
  10174. "$ref": "#/components/schemas/ToolStatePending"
  10175. },
  10176. {
  10177. "$ref": "#/components/schemas/ToolStateRunning"
  10178. },
  10179. {
  10180. "$ref": "#/components/schemas/ToolStateCompleted"
  10181. },
  10182. {
  10183. "$ref": "#/components/schemas/ToolStateError"
  10184. }
  10185. ]
  10186. },
  10187. "ToolPart": {
  10188. "type": "object",
  10189. "properties": {
  10190. "id": {
  10191. "type": "string"
  10192. },
  10193. "sessionID": {
  10194. "type": "string"
  10195. },
  10196. "messageID": {
  10197. "type": "string"
  10198. },
  10199. "type": {
  10200. "type": "string",
  10201. "enum": ["tool"]
  10202. },
  10203. "callID": {
  10204. "type": "string"
  10205. },
  10206. "tool": {
  10207. "type": "string"
  10208. },
  10209. "state": {
  10210. "$ref": "#/components/schemas/ToolState"
  10211. },
  10212. "metadata": {
  10213. "type": "object"
  10214. }
  10215. },
  10216. "required": ["id", "sessionID", "messageID", "type", "callID", "tool", "state"],
  10217. "additionalProperties": false
  10218. },
  10219. "StepStartPart": {
  10220. "type": "object",
  10221. "properties": {
  10222. "id": {
  10223. "type": "string"
  10224. },
  10225. "sessionID": {
  10226. "type": "string"
  10227. },
  10228. "messageID": {
  10229. "type": "string"
  10230. },
  10231. "type": {
  10232. "type": "string",
  10233. "enum": ["step-start"]
  10234. },
  10235. "snapshot": {
  10236. "type": "string"
  10237. }
  10238. },
  10239. "required": ["id", "sessionID", "messageID", "type"],
  10240. "additionalProperties": false
  10241. },
  10242. "StepFinishPart": {
  10243. "type": "object",
  10244. "properties": {
  10245. "id": {
  10246. "type": "string"
  10247. },
  10248. "sessionID": {
  10249. "type": "string"
  10250. },
  10251. "messageID": {
  10252. "type": "string"
  10253. },
  10254. "type": {
  10255. "type": "string",
  10256. "enum": ["step-finish"]
  10257. },
  10258. "reason": {
  10259. "type": "string"
  10260. },
  10261. "snapshot": {
  10262. "type": "string"
  10263. },
  10264. "cost": {
  10265. "type": "number"
  10266. },
  10267. "tokens": {
  10268. "type": "object",
  10269. "properties": {
  10270. "total": {
  10271. "type": "integer",
  10272. "minimum": 0
  10273. },
  10274. "input": {
  10275. "type": "integer",
  10276. "minimum": 0
  10277. },
  10278. "output": {
  10279. "type": "integer",
  10280. "minimum": 0
  10281. },
  10282. "reasoning": {
  10283. "type": "integer",
  10284. "minimum": 0
  10285. },
  10286. "cache": {
  10287. "type": "object",
  10288. "properties": {
  10289. "read": {
  10290. "type": "integer",
  10291. "minimum": 0
  10292. },
  10293. "write": {
  10294. "type": "integer",
  10295. "minimum": 0
  10296. }
  10297. },
  10298. "required": ["read", "write"],
  10299. "additionalProperties": false
  10300. }
  10301. },
  10302. "required": ["input", "output", "reasoning", "cache"],
  10303. "additionalProperties": false
  10304. }
  10305. },
  10306. "required": ["id", "sessionID", "messageID", "type", "reason", "cost", "tokens"],
  10307. "additionalProperties": false
  10308. },
  10309. "SnapshotPart": {
  10310. "type": "object",
  10311. "properties": {
  10312. "id": {
  10313. "type": "string"
  10314. },
  10315. "sessionID": {
  10316. "type": "string"
  10317. },
  10318. "messageID": {
  10319. "type": "string"
  10320. },
  10321. "type": {
  10322. "type": "string",
  10323. "enum": ["snapshot"]
  10324. },
  10325. "snapshot": {
  10326. "type": "string"
  10327. }
  10328. },
  10329. "required": ["id", "sessionID", "messageID", "type", "snapshot"],
  10330. "additionalProperties": false
  10331. },
  10332. "PatchPart": {
  10333. "type": "object",
  10334. "properties": {
  10335. "id": {
  10336. "type": "string"
  10337. },
  10338. "sessionID": {
  10339. "type": "string"
  10340. },
  10341. "messageID": {
  10342. "type": "string"
  10343. },
  10344. "type": {
  10345. "type": "string",
  10346. "enum": ["patch"]
  10347. },
  10348. "hash": {
  10349. "type": "string"
  10350. },
  10351. "files": {
  10352. "type": "array",
  10353. "items": {
  10354. "type": "string"
  10355. }
  10356. }
  10357. },
  10358. "required": ["id", "sessionID", "messageID", "type", "hash", "files"],
  10359. "additionalProperties": false
  10360. },
  10361. "AgentPart": {
  10362. "type": "object",
  10363. "properties": {
  10364. "id": {
  10365. "type": "string"
  10366. },
  10367. "sessionID": {
  10368. "type": "string"
  10369. },
  10370. "messageID": {
  10371. "type": "string"
  10372. },
  10373. "type": {
  10374. "type": "string",
  10375. "enum": ["agent"]
  10376. },
  10377. "name": {
  10378. "type": "string"
  10379. },
  10380. "source": {
  10381. "type": "object",
  10382. "properties": {
  10383. "value": {
  10384. "type": "string"
  10385. },
  10386. "start": {
  10387. "type": "integer",
  10388. "minimum": 0
  10389. },
  10390. "end": {
  10391. "type": "integer",
  10392. "minimum": 0
  10393. }
  10394. },
  10395. "required": ["value", "start", "end"],
  10396. "additionalProperties": false
  10397. }
  10398. },
  10399. "required": ["id", "sessionID", "messageID", "type", "name"],
  10400. "additionalProperties": false
  10401. },
  10402. "RetryPart": {
  10403. "type": "object",
  10404. "properties": {
  10405. "id": {
  10406. "type": "string"
  10407. },
  10408. "sessionID": {
  10409. "type": "string"
  10410. },
  10411. "messageID": {
  10412. "type": "string"
  10413. },
  10414. "type": {
  10415. "type": "string",
  10416. "enum": ["retry"]
  10417. },
  10418. "attempt": {
  10419. "type": "integer",
  10420. "minimum": 0
  10421. },
  10422. "error": {
  10423. "$ref": "#/components/schemas/APIError"
  10424. },
  10425. "time": {
  10426. "type": "object",
  10427. "properties": {
  10428. "created": {
  10429. "type": "integer",
  10430. "minimum": 0
  10431. }
  10432. },
  10433. "required": ["created"],
  10434. "additionalProperties": false
  10435. }
  10436. },
  10437. "required": ["id", "sessionID", "messageID", "type", "attempt", "error", "time"],
  10438. "additionalProperties": false
  10439. },
  10440. "CompactionPart": {
  10441. "type": "object",
  10442. "properties": {
  10443. "id": {
  10444. "type": "string"
  10445. },
  10446. "sessionID": {
  10447. "type": "string"
  10448. },
  10449. "messageID": {
  10450. "type": "string"
  10451. },
  10452. "type": {
  10453. "type": "string",
  10454. "enum": ["compaction"]
  10455. },
  10456. "auto": {
  10457. "type": "boolean"
  10458. },
  10459. "overflow": {
  10460. "type": "boolean"
  10461. },
  10462. "tail_start_id": {
  10463. "type": "string"
  10464. }
  10465. },
  10466. "required": ["id", "sessionID", "messageID", "type", "auto"],
  10467. "additionalProperties": false
  10468. },
  10469. "Part": {
  10470. "anyOf": [
  10471. {
  10472. "$ref": "#/components/schemas/TextPart"
  10473. },
  10474. {
  10475. "$ref": "#/components/schemas/SubtaskPart"
  10476. },
  10477. {
  10478. "$ref": "#/components/schemas/ReasoningPart"
  10479. },
  10480. {
  10481. "$ref": "#/components/schemas/FilePart"
  10482. },
  10483. {
  10484. "$ref": "#/components/schemas/ToolPart"
  10485. },
  10486. {
  10487. "$ref": "#/components/schemas/StepStartPart"
  10488. },
  10489. {
  10490. "$ref": "#/components/schemas/StepFinishPart"
  10491. },
  10492. {
  10493. "$ref": "#/components/schemas/SnapshotPart"
  10494. },
  10495. {
  10496. "$ref": "#/components/schemas/PatchPart"
  10497. },
  10498. {
  10499. "$ref": "#/components/schemas/AgentPart"
  10500. },
  10501. {
  10502. "$ref": "#/components/schemas/RetryPart"
  10503. },
  10504. {
  10505. "$ref": "#/components/schemas/CompactionPart"
  10506. }
  10507. ]
  10508. },
  10509. "PermissionAction": {
  10510. "type": "string",
  10511. "enum": ["allow", "deny", "ask"]
  10512. },
  10513. "PermissionRule": {
  10514. "type": "object",
  10515. "properties": {
  10516. "permission": {
  10517. "type": "string"
  10518. },
  10519. "pattern": {
  10520. "type": "string"
  10521. },
  10522. "action": {
  10523. "$ref": "#/components/schemas/PermissionAction"
  10524. }
  10525. },
  10526. "required": ["permission", "pattern", "action"],
  10527. "additionalProperties": false
  10528. },
  10529. "PermissionRuleset": {
  10530. "type": "array",
  10531. "items": {
  10532. "$ref": "#/components/schemas/PermissionRule"
  10533. }
  10534. },
  10535. "Session": {
  10536. "type": "object",
  10537. "properties": {
  10538. "id": {
  10539. "type": "string"
  10540. },
  10541. "slug": {
  10542. "type": "string"
  10543. },
  10544. "projectID": {
  10545. "type": "string"
  10546. },
  10547. "workspaceID": {
  10548. "type": "string"
  10549. },
  10550. "directory": {
  10551. "type": "string"
  10552. },
  10553. "path": {
  10554. "type": "string"
  10555. },
  10556. "parentID": {
  10557. "type": "string"
  10558. },
  10559. "summary": {
  10560. "type": "object",
  10561. "properties": {
  10562. "additions": {
  10563. "type": "integer",
  10564. "minimum": 0
  10565. },
  10566. "deletions": {
  10567. "type": "integer",
  10568. "minimum": 0
  10569. },
  10570. "files": {
  10571. "type": "integer",
  10572. "minimum": 0
  10573. },
  10574. "diffs": {
  10575. "type": "array",
  10576. "items": {
  10577. "$ref": "#/components/schemas/SnapshotFileDiff"
  10578. }
  10579. }
  10580. },
  10581. "required": ["additions", "deletions", "files"],
  10582. "additionalProperties": false
  10583. },
  10584. "share": {
  10585. "type": "object",
  10586. "properties": {
  10587. "url": {
  10588. "type": "string"
  10589. }
  10590. },
  10591. "required": ["url"],
  10592. "additionalProperties": false
  10593. },
  10594. "title": {
  10595. "type": "string"
  10596. },
  10597. "agent": {
  10598. "type": "string"
  10599. },
  10600. "model": {
  10601. "type": "object",
  10602. "properties": {
  10603. "id": {
  10604. "type": "string"
  10605. },
  10606. "providerID": {
  10607. "type": "string"
  10608. },
  10609. "variant": {
  10610. "type": "string"
  10611. }
  10612. },
  10613. "required": ["id", "providerID"],
  10614. "additionalProperties": false
  10615. },
  10616. "version": {
  10617. "type": "string"
  10618. },
  10619. "time": {
  10620. "type": "object",
  10621. "properties": {
  10622. "created": {
  10623. "type": "integer",
  10624. "minimum": 0
  10625. },
  10626. "updated": {
  10627. "type": "integer",
  10628. "minimum": 0
  10629. },
  10630. "compacting": {
  10631. "type": "integer",
  10632. "minimum": 0
  10633. },
  10634. "archived": {
  10635. "type": "number"
  10636. }
  10637. },
  10638. "required": ["created", "updated"],
  10639. "additionalProperties": false
  10640. },
  10641. "permission": {
  10642. "$ref": "#/components/schemas/PermissionRuleset"
  10643. },
  10644. "revert": {
  10645. "type": "object",
  10646. "properties": {
  10647. "messageID": {
  10648. "type": "string"
  10649. },
  10650. "partID": {
  10651. "type": "string"
  10652. },
  10653. "snapshot": {
  10654. "type": "string"
  10655. },
  10656. "diff": {
  10657. "type": "string"
  10658. }
  10659. },
  10660. "required": ["messageID"],
  10661. "additionalProperties": false
  10662. }
  10663. },
  10664. "required": ["id", "slug", "projectID", "directory", "title", "version", "time"],
  10665. "additionalProperties": false
  10666. },
  10667. "Prompt": {
  10668. "type": "object",
  10669. "properties": {
  10670. "text": {
  10671. "type": "string"
  10672. },
  10673. "files": {
  10674. "type": "array",
  10675. "items": {
  10676. "$ref": "#/components/schemas/PromptFileAttachment"
  10677. }
  10678. },
  10679. "agents": {
  10680. "type": "array",
  10681. "items": {
  10682. "$ref": "#/components/schemas/PromptAgentAttachment"
  10683. }
  10684. }
  10685. },
  10686. "required": ["text"],
  10687. "additionalProperties": false
  10688. },
  10689. "GlobalEvent": {
  10690. "type": "object",
  10691. "properties": {
  10692. "directory": {
  10693. "type": "string"
  10694. },
  10695. "project": {
  10696. "type": "string"
  10697. },
  10698. "workspace": {
  10699. "type": "string"
  10700. },
  10701. "payload": {
  10702. "anyOf": [
  10703. {
  10704. "$ref": "#/components/schemas/EventServerInstanceDisposed"
  10705. },
  10706. {
  10707. "$ref": "#/components/schemas/EventFileEdited"
  10708. },
  10709. {
  10710. "$ref": "#/components/schemas/EventFileWatcherUpdated"
  10711. },
  10712. {
  10713. "$ref": "#/components/schemas/EventLspClientDiagnostics"
  10714. },
  10715. {
  10716. "$ref": "#/components/schemas/EventLspUpdated"
  10717. },
  10718. {
  10719. "$ref": "#/components/schemas/EventMessagePartDelta"
  10720. },
  10721. {
  10722. "$ref": "#/components/schemas/EventPermissionAsked"
  10723. },
  10724. {
  10725. "$ref": "#/components/schemas/EventPermissionReplied"
  10726. },
  10727. {
  10728. "$ref": "#/components/schemas/EventSessionDiff"
  10729. },
  10730. {
  10731. "$ref": "#/components/schemas/EventSessionError"
  10732. },
  10733. {
  10734. "$ref": "#/components/schemas/EventInstallationUpdated"
  10735. },
  10736. {
  10737. "$ref": "#/components/schemas/EventInstallationUpdate-available"
  10738. },
  10739. {
  10740. "$ref": "#/components/schemas/EventQuestionAsked"
  10741. },
  10742. {
  10743. "$ref": "#/components/schemas/EventQuestionReplied"
  10744. },
  10745. {
  10746. "$ref": "#/components/schemas/EventQuestionRejected"
  10747. },
  10748. {
  10749. "$ref": "#/components/schemas/EventTodoUpdated"
  10750. },
  10751. {
  10752. "$ref": "#/components/schemas/EventSessionStatus"
  10753. },
  10754. {
  10755. "$ref": "#/components/schemas/EventSessionIdle"
  10756. },
  10757. {
  10758. "$ref": "#/components/schemas/EventSessionCompacted"
  10759. },
  10760. {
  10761. "$ref": "#/components/schemas/Event.tui.prompt.append"
  10762. },
  10763. {
  10764. "$ref": "#/components/schemas/Event.tui.command.execute"
  10765. },
  10766. {
  10767. "$ref": "#/components/schemas/Event.tui.toast.show"
  10768. },
  10769. {
  10770. "$ref": "#/components/schemas/Event.tui.session.select"
  10771. },
  10772. {
  10773. "$ref": "#/components/schemas/EventMcpToolsChanged"
  10774. },
  10775. {
  10776. "$ref": "#/components/schemas/EventMcpBrowserOpenFailed"
  10777. },
  10778. {
  10779. "$ref": "#/components/schemas/EventCommandExecuted"
  10780. },
  10781. {
  10782. "$ref": "#/components/schemas/EventProjectUpdated"
  10783. },
  10784. {
  10785. "$ref": "#/components/schemas/EventVcsBranchUpdated"
  10786. },
  10787. {
  10788. "$ref": "#/components/schemas/EventWorkspaceReady"
  10789. },
  10790. {
  10791. "$ref": "#/components/schemas/EventWorkspaceFailed"
  10792. },
  10793. {
  10794. "$ref": "#/components/schemas/EventWorkspaceStatus"
  10795. },
  10796. {
  10797. "$ref": "#/components/schemas/EventWorktreeReady"
  10798. },
  10799. {
  10800. "$ref": "#/components/schemas/EventWorktreeFailed"
  10801. },
  10802. {
  10803. "$ref": "#/components/schemas/EventPtyCreated"
  10804. },
  10805. {
  10806. "$ref": "#/components/schemas/EventPtyUpdated"
  10807. },
  10808. {
  10809. "$ref": "#/components/schemas/EventPtyExited"
  10810. },
  10811. {
  10812. "$ref": "#/components/schemas/EventPtyDeleted"
  10813. },
  10814. {
  10815. "$ref": "#/components/schemas/EventMessageUpdated"
  10816. },
  10817. {
  10818. "$ref": "#/components/schemas/EventMessageRemoved"
  10819. },
  10820. {
  10821. "$ref": "#/components/schemas/EventMessagePartUpdated"
  10822. },
  10823. {
  10824. "$ref": "#/components/schemas/EventMessagePartRemoved"
  10825. },
  10826. {
  10827. "$ref": "#/components/schemas/EventSessionCreated"
  10828. },
  10829. {
  10830. "$ref": "#/components/schemas/EventSessionUpdated"
  10831. },
  10832. {
  10833. "$ref": "#/components/schemas/EventSessionDeleted"
  10834. },
  10835. {
  10836. "$ref": "#/components/schemas/EventSessionNextAgentSwitched"
  10837. },
  10838. {
  10839. "$ref": "#/components/schemas/EventSessionNextModelSwitched"
  10840. },
  10841. {
  10842. "$ref": "#/components/schemas/EventSessionNextPrompted"
  10843. },
  10844. {
  10845. "$ref": "#/components/schemas/EventSessionNextSynthetic"
  10846. },
  10847. {
  10848. "$ref": "#/components/schemas/EventSessionNextShellStarted"
  10849. },
  10850. {
  10851. "$ref": "#/components/schemas/EventSessionNextShellEnded"
  10852. },
  10853. {
  10854. "$ref": "#/components/schemas/EventSessionNextStepStarted"
  10855. },
  10856. {
  10857. "$ref": "#/components/schemas/EventSessionNextStepEnded"
  10858. },
  10859. {
  10860. "$ref": "#/components/schemas/EventSessionNextStepFailed"
  10861. },
  10862. {
  10863. "$ref": "#/components/schemas/EventSessionNextTextStarted"
  10864. },
  10865. {
  10866. "$ref": "#/components/schemas/EventSessionNextTextDelta"
  10867. },
  10868. {
  10869. "$ref": "#/components/schemas/EventSessionNextTextEnded"
  10870. },
  10871. {
  10872. "$ref": "#/components/schemas/EventSessionNextReasoningStarted"
  10873. },
  10874. {
  10875. "$ref": "#/components/schemas/EventSessionNextReasoningDelta"
  10876. },
  10877. {
  10878. "$ref": "#/components/schemas/EventSessionNextReasoningEnded"
  10879. },
  10880. {
  10881. "$ref": "#/components/schemas/EventSessionNextToolInputStarted"
  10882. },
  10883. {
  10884. "$ref": "#/components/schemas/EventSessionNextToolInputDelta"
  10885. },
  10886. {
  10887. "$ref": "#/components/schemas/EventSessionNextToolInputEnded"
  10888. },
  10889. {
  10890. "$ref": "#/components/schemas/EventSessionNextToolCalled"
  10891. },
  10892. {
  10893. "$ref": "#/components/schemas/EventSessionNextToolProgress"
  10894. },
  10895. {
  10896. "$ref": "#/components/schemas/EventSessionNextToolSuccess"
  10897. },
  10898. {
  10899. "$ref": "#/components/schemas/EventSessionNextToolFailed"
  10900. },
  10901. {
  10902. "$ref": "#/components/schemas/EventSessionNextRetried"
  10903. },
  10904. {
  10905. "$ref": "#/components/schemas/EventSessionNextCompactionStarted"
  10906. },
  10907. {
  10908. "$ref": "#/components/schemas/EventSessionNextCompactionDelta"
  10909. },
  10910. {
  10911. "$ref": "#/components/schemas/EventSessionNextCompactionEnded"
  10912. },
  10913. {
  10914. "$ref": "#/components/schemas/EventServerConnected"
  10915. },
  10916. {
  10917. "$ref": "#/components/schemas/EventGlobalDisposed"
  10918. },
  10919. {
  10920. "$ref": "#/components/schemas/SyncEventMessageUpdated"
  10921. },
  10922. {
  10923. "$ref": "#/components/schemas/SyncEventMessageRemoved"
  10924. },
  10925. {
  10926. "$ref": "#/components/schemas/SyncEventMessagePartUpdated"
  10927. },
  10928. {
  10929. "$ref": "#/components/schemas/SyncEventMessagePartRemoved"
  10930. },
  10931. {
  10932. "$ref": "#/components/schemas/SyncEventSessionCreated"
  10933. },
  10934. {
  10935. "$ref": "#/components/schemas/SyncEventSessionUpdated"
  10936. },
  10937. {
  10938. "$ref": "#/components/schemas/SyncEventSessionDeleted"
  10939. },
  10940. {
  10941. "$ref": "#/components/schemas/SyncEventSessionNextAgentSwitched"
  10942. },
  10943. {
  10944. "$ref": "#/components/schemas/SyncEventSessionNextModelSwitched"
  10945. },
  10946. {
  10947. "$ref": "#/components/schemas/SyncEventSessionNextPrompted"
  10948. },
  10949. {
  10950. "$ref": "#/components/schemas/SyncEventSessionNextSynthetic"
  10951. },
  10952. {
  10953. "$ref": "#/components/schemas/SyncEventSessionNextShellStarted"
  10954. },
  10955. {
  10956. "$ref": "#/components/schemas/SyncEventSessionNextShellEnded"
  10957. },
  10958. {
  10959. "$ref": "#/components/schemas/SyncEventSessionNextStepStarted"
  10960. },
  10961. {
  10962. "$ref": "#/components/schemas/SyncEventSessionNextStepEnded"
  10963. },
  10964. {
  10965. "$ref": "#/components/schemas/SyncEventSessionNextStepFailed"
  10966. },
  10967. {
  10968. "$ref": "#/components/schemas/SyncEventSessionNextTextStarted"
  10969. },
  10970. {
  10971. "$ref": "#/components/schemas/SyncEventSessionNextTextDelta"
  10972. },
  10973. {
  10974. "$ref": "#/components/schemas/SyncEventSessionNextTextEnded"
  10975. },
  10976. {
  10977. "$ref": "#/components/schemas/SyncEventSessionNextReasoningStarted"
  10978. },
  10979. {
  10980. "$ref": "#/components/schemas/SyncEventSessionNextReasoningDelta"
  10981. },
  10982. {
  10983. "$ref": "#/components/schemas/SyncEventSessionNextReasoningEnded"
  10984. },
  10985. {
  10986. "$ref": "#/components/schemas/SyncEventSessionNextToolInputStarted"
  10987. },
  10988. {
  10989. "$ref": "#/components/schemas/SyncEventSessionNextToolInputDelta"
  10990. },
  10991. {
  10992. "$ref": "#/components/schemas/SyncEventSessionNextToolInputEnded"
  10993. },
  10994. {
  10995. "$ref": "#/components/schemas/SyncEventSessionNextToolCalled"
  10996. },
  10997. {
  10998. "$ref": "#/components/schemas/SyncEventSessionNextToolProgress"
  10999. },
  11000. {
  11001. "$ref": "#/components/schemas/SyncEventSessionNextToolSuccess"
  11002. },
  11003. {
  11004. "$ref": "#/components/schemas/SyncEventSessionNextToolFailed"
  11005. },
  11006. {
  11007. "$ref": "#/components/schemas/SyncEventSessionNextRetried"
  11008. },
  11009. {
  11010. "$ref": "#/components/schemas/SyncEventSessionNextCompactionStarted"
  11011. },
  11012. {
  11013. "$ref": "#/components/schemas/SyncEventSessionNextCompactionDelta"
  11014. },
  11015. {
  11016. "$ref": "#/components/schemas/SyncEventSessionNextCompactionEnded"
  11017. }
  11018. ]
  11019. }
  11020. },
  11021. "required": ["directory", "payload"],
  11022. "additionalProperties": false
  11023. },
  11024. "LogLevel": {
  11025. "type": "string",
  11026. "enum": ["DEBUG", "INFO", "WARN", "ERROR"],
  11027. "description": "Log level"
  11028. },
  11029. "ServerConfig": {
  11030. "type": "object",
  11031. "properties": {
  11032. "port": {
  11033. "type": "integer",
  11034. "exclusiveMinimum": 0
  11035. },
  11036. "hostname": {
  11037. "type": "string"
  11038. },
  11039. "mdns": {
  11040. "type": "boolean"
  11041. },
  11042. "mdnsDomain": {
  11043. "type": "string"
  11044. },
  11045. "cors": {
  11046. "type": "array",
  11047. "items": {
  11048. "type": "string"
  11049. }
  11050. }
  11051. },
  11052. "additionalProperties": false,
  11053. "description": "Server configuration for opencode serve and web commands"
  11054. },
  11055. "PermissionActionConfig": {
  11056. "type": "string",
  11057. "enum": ["ask", "allow", "deny"]
  11058. },
  11059. "PermissionObjectConfig": {
  11060. "type": "object",
  11061. "additionalProperties": {
  11062. "$ref": "#/components/schemas/PermissionActionConfig"
  11063. }
  11064. },
  11065. "PermissionRuleConfig": {
  11066. "anyOf": [
  11067. {
  11068. "$ref": "#/components/schemas/PermissionActionConfig"
  11069. },
  11070. {
  11071. "$ref": "#/components/schemas/PermissionObjectConfig"
  11072. }
  11073. ]
  11074. },
  11075. "PermissionConfig": {
  11076. "anyOf": [
  11077. {
  11078. "$ref": "#/components/schemas/PermissionActionConfig"
  11079. },
  11080. {
  11081. "type": "object",
  11082. "properties": {
  11083. "read": {
  11084. "$ref": "#/components/schemas/PermissionRuleConfig"
  11085. },
  11086. "edit": {
  11087. "$ref": "#/components/schemas/PermissionRuleConfig"
  11088. },
  11089. "glob": {
  11090. "$ref": "#/components/schemas/PermissionRuleConfig"
  11091. },
  11092. "grep": {
  11093. "$ref": "#/components/schemas/PermissionRuleConfig"
  11094. },
  11095. "list": {
  11096. "$ref": "#/components/schemas/PermissionRuleConfig"
  11097. },
  11098. "bash": {
  11099. "$ref": "#/components/schemas/PermissionRuleConfig"
  11100. },
  11101. "task": {
  11102. "$ref": "#/components/schemas/PermissionRuleConfig"
  11103. },
  11104. "external_directory": {
  11105. "$ref": "#/components/schemas/PermissionRuleConfig"
  11106. },
  11107. "todowrite": {
  11108. "$ref": "#/components/schemas/PermissionActionConfig"
  11109. },
  11110. "question": {
  11111. "$ref": "#/components/schemas/PermissionActionConfig"
  11112. },
  11113. "webfetch": {
  11114. "$ref": "#/components/schemas/PermissionActionConfig"
  11115. },
  11116. "websearch": {
  11117. "$ref": "#/components/schemas/PermissionActionConfig"
  11118. },
  11119. "lsp": {
  11120. "$ref": "#/components/schemas/PermissionRuleConfig"
  11121. },
  11122. "doom_loop": {
  11123. "$ref": "#/components/schemas/PermissionActionConfig"
  11124. },
  11125. "skill": {
  11126. "$ref": "#/components/schemas/PermissionRuleConfig"
  11127. }
  11128. },
  11129. "additionalProperties": {
  11130. "$ref": "#/components/schemas/PermissionRuleConfig"
  11131. }
  11132. }
  11133. ]
  11134. },
  11135. "AgentConfig": {
  11136. "type": "object",
  11137. "properties": {
  11138. "model": {
  11139. "type": "string"
  11140. },
  11141. "variant": {
  11142. "type": "string"
  11143. },
  11144. "temperature": {
  11145. "type": "number"
  11146. },
  11147. "top_p": {
  11148. "type": "number"
  11149. },
  11150. "prompt": {
  11151. "type": "string"
  11152. },
  11153. "tools": {
  11154. "type": "object",
  11155. "additionalProperties": {
  11156. "type": "boolean"
  11157. }
  11158. },
  11159. "disable": {
  11160. "type": "boolean"
  11161. },
  11162. "description": {
  11163. "type": "string"
  11164. },
  11165. "mode": {
  11166. "type": "string",
  11167. "enum": ["subagent", "primary", "all"]
  11168. },
  11169. "hidden": {
  11170. "type": "boolean"
  11171. },
  11172. "options": {
  11173. "type": "object"
  11174. },
  11175. "color": {
  11176. "anyOf": [
  11177. {
  11178. "type": "string",
  11179. "pattern": "^#[0-9a-fA-F]{6}$"
  11180. },
  11181. {
  11182. "type": "string",
  11183. "enum": ["primary", "secondary", "accent", "success", "warning", "error", "info"]
  11184. }
  11185. ],
  11186. "description": "Hex color code (e.g., #FF5733) or theme color (e.g., primary)"
  11187. },
  11188. "steps": {
  11189. "type": "integer",
  11190. "exclusiveMinimum": 0
  11191. },
  11192. "maxSteps": {
  11193. "type": "integer",
  11194. "exclusiveMinimum": 0
  11195. },
  11196. "permission": {
  11197. "$ref": "#/components/schemas/PermissionConfig"
  11198. }
  11199. },
  11200. "additionalProperties": {}
  11201. },
  11202. "ProviderConfig": {
  11203. "type": "object",
  11204. "properties": {
  11205. "api": {
  11206. "type": "string"
  11207. },
  11208. "name": {
  11209. "type": "string"
  11210. },
  11211. "env": {
  11212. "type": "array",
  11213. "items": {
  11214. "type": "string"
  11215. }
  11216. },
  11217. "id": {
  11218. "type": "string"
  11219. },
  11220. "npm": {
  11221. "type": "string"
  11222. },
  11223. "whitelist": {
  11224. "type": "array",
  11225. "items": {
  11226. "type": "string"
  11227. }
  11228. },
  11229. "blacklist": {
  11230. "type": "array",
  11231. "items": {
  11232. "type": "string"
  11233. }
  11234. },
  11235. "options": {
  11236. "type": "object",
  11237. "properties": {
  11238. "apiKey": {
  11239. "type": "string"
  11240. },
  11241. "baseURL": {
  11242. "type": "string"
  11243. },
  11244. "enterpriseUrl": {
  11245. "type": "string"
  11246. },
  11247. "setCacheKey": {
  11248. "type": "boolean"
  11249. },
  11250. "timeout": {
  11251. "anyOf": [
  11252. {
  11253. "type": "integer",
  11254. "exclusiveMinimum": 0
  11255. },
  11256. {
  11257. "type": "boolean",
  11258. "enum": [false]
  11259. }
  11260. ],
  11261. "description": "Timeout in milliseconds for requests to this provider. Default is 300000 (5 minutes). Set to false to disable timeout."
  11262. },
  11263. "chunkTimeout": {
  11264. "type": "integer",
  11265. "exclusiveMinimum": 0
  11266. }
  11267. },
  11268. "additionalProperties": {}
  11269. },
  11270. "models": {
  11271. "type": "object",
  11272. "additionalProperties": {
  11273. "type": "object",
  11274. "properties": {
  11275. "id": {
  11276. "type": "string"
  11277. },
  11278. "name": {
  11279. "type": "string"
  11280. },
  11281. "family": {
  11282. "type": "string"
  11283. },
  11284. "release_date": {
  11285. "type": "string"
  11286. },
  11287. "attachment": {
  11288. "type": "boolean"
  11289. },
  11290. "reasoning": {
  11291. "type": "boolean"
  11292. },
  11293. "temperature": {
  11294. "type": "boolean"
  11295. },
  11296. "tool_call": {
  11297. "type": "boolean"
  11298. },
  11299. "interleaved": {
  11300. "anyOf": [
  11301. {
  11302. "type": "boolean",
  11303. "enum": [true]
  11304. },
  11305. {
  11306. "type": "object",
  11307. "properties": {
  11308. "field": {
  11309. "type": "string",
  11310. "enum": ["reasoning_content", "reasoning_details"]
  11311. }
  11312. },
  11313. "required": ["field"],
  11314. "additionalProperties": false
  11315. }
  11316. ]
  11317. },
  11318. "cost": {
  11319. "type": "object",
  11320. "properties": {
  11321. "input": {
  11322. "type": "number"
  11323. },
  11324. "output": {
  11325. "type": "number"
  11326. },
  11327. "cache_read": {
  11328. "type": "number"
  11329. },
  11330. "cache_write": {
  11331. "type": "number"
  11332. },
  11333. "context_over_200k": {
  11334. "type": "object",
  11335. "properties": {
  11336. "input": {
  11337. "type": "number"
  11338. },
  11339. "output": {
  11340. "type": "number"
  11341. },
  11342. "cache_read": {
  11343. "type": "number"
  11344. },
  11345. "cache_write": {
  11346. "type": "number"
  11347. }
  11348. },
  11349. "required": ["input", "output"],
  11350. "additionalProperties": false
  11351. }
  11352. },
  11353. "required": ["input", "output"],
  11354. "additionalProperties": false
  11355. },
  11356. "limit": {
  11357. "type": "object",
  11358. "properties": {
  11359. "context": {
  11360. "type": "number"
  11361. },
  11362. "input": {
  11363. "type": "number"
  11364. },
  11365. "output": {
  11366. "type": "number"
  11367. }
  11368. },
  11369. "required": ["context", "output"],
  11370. "additionalProperties": false
  11371. },
  11372. "modalities": {
  11373. "type": "object",
  11374. "properties": {
  11375. "input": {
  11376. "type": "array",
  11377. "items": {
  11378. "type": "string",
  11379. "enum": ["text", "audio", "image", "video", "pdf"]
  11380. }
  11381. },
  11382. "output": {
  11383. "type": "array",
  11384. "items": {
  11385. "type": "string",
  11386. "enum": ["text", "audio", "image", "video", "pdf"]
  11387. }
  11388. }
  11389. },
  11390. "required": ["input", "output"],
  11391. "additionalProperties": false
  11392. },
  11393. "experimental": {
  11394. "type": "boolean"
  11395. },
  11396. "status": {
  11397. "type": "string",
  11398. "enum": ["alpha", "beta", "deprecated"]
  11399. },
  11400. "provider": {
  11401. "type": "object",
  11402. "properties": {
  11403. "npm": {
  11404. "type": "string"
  11405. },
  11406. "api": {
  11407. "type": "string"
  11408. }
  11409. },
  11410. "additionalProperties": false
  11411. },
  11412. "options": {
  11413. "type": "object"
  11414. },
  11415. "headers": {
  11416. "type": "object",
  11417. "additionalProperties": {
  11418. "type": "string"
  11419. }
  11420. },
  11421. "variants": {
  11422. "type": "object",
  11423. "additionalProperties": {
  11424. "type": "object",
  11425. "properties": {
  11426. "disabled": {
  11427. "type": "boolean"
  11428. }
  11429. },
  11430. "additionalProperties": {}
  11431. },
  11432. "description": "Variant-specific configuration"
  11433. }
  11434. },
  11435. "additionalProperties": false
  11436. }
  11437. }
  11438. },
  11439. "additionalProperties": false
  11440. },
  11441. "McpLocalConfig": {
  11442. "type": "object",
  11443. "properties": {
  11444. "type": {
  11445. "type": "string",
  11446. "enum": ["local"],
  11447. "description": "Type of MCP server connection"
  11448. },
  11449. "command": {
  11450. "type": "array",
  11451. "items": {
  11452. "type": "string"
  11453. },
  11454. "description": "Command and arguments to run the MCP server"
  11455. },
  11456. "environment": {
  11457. "type": "object",
  11458. "additionalProperties": {
  11459. "type": "string"
  11460. }
  11461. },
  11462. "enabled": {
  11463. "type": "boolean"
  11464. },
  11465. "timeout": {
  11466. "type": "integer",
  11467. "exclusiveMinimum": 0
  11468. }
  11469. },
  11470. "required": ["type", "command"],
  11471. "additionalProperties": false
  11472. },
  11473. "McpOAuthConfig": {
  11474. "type": "object",
  11475. "properties": {
  11476. "clientId": {
  11477. "type": "string"
  11478. },
  11479. "clientSecret": {
  11480. "type": "string"
  11481. },
  11482. "scope": {
  11483. "type": "string"
  11484. },
  11485. "redirectUri": {
  11486. "type": "string"
  11487. }
  11488. },
  11489. "additionalProperties": false
  11490. },
  11491. "McpRemoteConfig": {
  11492. "type": "object",
  11493. "properties": {
  11494. "type": {
  11495. "type": "string",
  11496. "enum": ["remote"],
  11497. "description": "Type of MCP server connection"
  11498. },
  11499. "url": {
  11500. "type": "string",
  11501. "description": "URL of the remote MCP server"
  11502. },
  11503. "enabled": {
  11504. "type": "boolean"
  11505. },
  11506. "headers": {
  11507. "type": "object",
  11508. "additionalProperties": {
  11509. "type": "string"
  11510. }
  11511. },
  11512. "oauth": {
  11513. "anyOf": [
  11514. {
  11515. "$ref": "#/components/schemas/McpOAuthConfig"
  11516. },
  11517. {
  11518. "type": "boolean",
  11519. "enum": [false]
  11520. }
  11521. ],
  11522. "description": "OAuth authentication configuration for the MCP server. Set to false to disable OAuth auto-detection."
  11523. },
  11524. "timeout": {
  11525. "type": "integer",
  11526. "exclusiveMinimum": 0
  11527. }
  11528. },
  11529. "required": ["type", "url"],
  11530. "additionalProperties": false
  11531. },
  11532. "LayoutConfig": {
  11533. "type": "string",
  11534. "enum": ["auto", "stretch"],
  11535. "description": "@deprecated Always uses stretch layout."
  11536. },
  11537. "Config": {
  11538. "type": "object",
  11539. "properties": {
  11540. "$schema": {
  11541. "type": "string"
  11542. },
  11543. "shell": {
  11544. "type": "string"
  11545. },
  11546. "logLevel": {
  11547. "$ref": "#/components/schemas/LogLevel"
  11548. },
  11549. "server": {
  11550. "$ref": "#/components/schemas/ServerConfig"
  11551. },
  11552. "command": {
  11553. "type": "object",
  11554. "additionalProperties": {
  11555. "type": "object",
  11556. "properties": {
  11557. "template": {
  11558. "type": "string"
  11559. },
  11560. "description": {
  11561. "type": "string"
  11562. },
  11563. "agent": {
  11564. "type": "string"
  11565. },
  11566. "model": {
  11567. "type": "string"
  11568. },
  11569. "subtask": {
  11570. "type": "boolean"
  11571. }
  11572. },
  11573. "required": ["template"],
  11574. "additionalProperties": false
  11575. }
  11576. },
  11577. "skills": {
  11578. "type": "object",
  11579. "properties": {
  11580. "paths": {
  11581. "type": "array",
  11582. "items": {
  11583. "type": "string"
  11584. }
  11585. },
  11586. "urls": {
  11587. "type": "array",
  11588. "items": {
  11589. "type": "string"
  11590. }
  11591. }
  11592. },
  11593. "additionalProperties": false
  11594. },
  11595. "watcher": {
  11596. "type": "object",
  11597. "properties": {
  11598. "ignore": {
  11599. "type": "array",
  11600. "items": {
  11601. "type": "string"
  11602. }
  11603. }
  11604. },
  11605. "additionalProperties": false
  11606. },
  11607. "snapshot": {
  11608. "type": "boolean"
  11609. },
  11610. "plugin": {
  11611. "type": "array",
  11612. "items": {
  11613. "anyOf": [
  11614. {
  11615. "type": "string"
  11616. },
  11617. {
  11618. "type": "array",
  11619. "prefixItems": [
  11620. {
  11621. "type": "string"
  11622. },
  11623. {
  11624. "type": "object"
  11625. }
  11626. ],
  11627. "maxItems": 2,
  11628. "minItems": 2
  11629. }
  11630. ]
  11631. }
  11632. },
  11633. "share": {
  11634. "type": "string",
  11635. "enum": ["manual", "auto", "disabled"]
  11636. },
  11637. "autoshare": {
  11638. "type": "boolean"
  11639. },
  11640. "autoupdate": {
  11641. "anyOf": [
  11642. {
  11643. "type": "boolean"
  11644. },
  11645. {
  11646. "type": "string",
  11647. "enum": ["notify"]
  11648. }
  11649. ],
  11650. "description": "Automatically update to the latest version. Set to true to auto-update, false to disable, or 'notify' to show update notifications"
  11651. },
  11652. "disabled_providers": {
  11653. "type": "array",
  11654. "items": {
  11655. "type": "string"
  11656. }
  11657. },
  11658. "enabled_providers": {
  11659. "type": "array",
  11660. "items": {
  11661. "type": "string"
  11662. }
  11663. },
  11664. "model": {
  11665. "type": "string"
  11666. },
  11667. "small_model": {
  11668. "type": "string"
  11669. },
  11670. "default_agent": {
  11671. "type": "string"
  11672. },
  11673. "username": {
  11674. "type": "string"
  11675. },
  11676. "mode": {
  11677. "type": "object",
  11678. "properties": {
  11679. "build": {
  11680. "$ref": "#/components/schemas/AgentConfig"
  11681. },
  11682. "plan": {
  11683. "$ref": "#/components/schemas/AgentConfig"
  11684. }
  11685. },
  11686. "additionalProperties": {
  11687. "$ref": "#/components/schemas/AgentConfig"
  11688. }
  11689. },
  11690. "agent": {
  11691. "type": "object",
  11692. "properties": {
  11693. "plan": {
  11694. "$ref": "#/components/schemas/AgentConfig"
  11695. },
  11696. "build": {
  11697. "$ref": "#/components/schemas/AgentConfig"
  11698. },
  11699. "general": {
  11700. "$ref": "#/components/schemas/AgentConfig"
  11701. },
  11702. "explore": {
  11703. "$ref": "#/components/schemas/AgentConfig"
  11704. },
  11705. "title": {
  11706. "$ref": "#/components/schemas/AgentConfig"
  11707. },
  11708. "summary": {
  11709. "$ref": "#/components/schemas/AgentConfig"
  11710. },
  11711. "compaction": {
  11712. "$ref": "#/components/schemas/AgentConfig"
  11713. }
  11714. },
  11715. "additionalProperties": {
  11716. "$ref": "#/components/schemas/AgentConfig"
  11717. }
  11718. },
  11719. "provider": {
  11720. "type": "object",
  11721. "additionalProperties": {
  11722. "$ref": "#/components/schemas/ProviderConfig"
  11723. }
  11724. },
  11725. "mcp": {
  11726. "type": "object",
  11727. "additionalProperties": {
  11728. "anyOf": [
  11729. {
  11730. "$ref": "#/components/schemas/McpLocalConfig"
  11731. },
  11732. {
  11733. "$ref": "#/components/schemas/McpRemoteConfig"
  11734. },
  11735. {
  11736. "type": "object",
  11737. "properties": {
  11738. "enabled": {
  11739. "type": "boolean"
  11740. }
  11741. },
  11742. "required": ["enabled"],
  11743. "additionalProperties": false
  11744. }
  11745. ]
  11746. }
  11747. },
  11748. "formatter": {
  11749. "anyOf": [
  11750. {
  11751. "type": "boolean"
  11752. },
  11753. {
  11754. "type": "object",
  11755. "additionalProperties": {
  11756. "type": "object",
  11757. "properties": {
  11758. "disabled": {
  11759. "type": "boolean"
  11760. },
  11761. "command": {
  11762. "type": "array",
  11763. "items": {
  11764. "type": "string"
  11765. }
  11766. },
  11767. "environment": {
  11768. "type": "object",
  11769. "additionalProperties": {
  11770. "type": "string"
  11771. }
  11772. },
  11773. "extensions": {
  11774. "type": "array",
  11775. "items": {
  11776. "type": "string"
  11777. }
  11778. }
  11779. },
  11780. "additionalProperties": false
  11781. }
  11782. }
  11783. ],
  11784. "description": "Enable or configure formatters. Omit or set to false to disable, true to enable built-ins, or an object to enable built-ins with overrides."
  11785. },
  11786. "lsp": {
  11787. "anyOf": [
  11788. {
  11789. "type": "boolean"
  11790. },
  11791. {
  11792. "type": "object",
  11793. "additionalProperties": {
  11794. "anyOf": [
  11795. {
  11796. "type": "object",
  11797. "properties": {
  11798. "disabled": {
  11799. "type": "boolean",
  11800. "enum": [true]
  11801. }
  11802. },
  11803. "required": ["disabled"],
  11804. "additionalProperties": false
  11805. },
  11806. {
  11807. "type": "object",
  11808. "properties": {
  11809. "command": {
  11810. "type": "array",
  11811. "items": {
  11812. "type": "string"
  11813. }
  11814. },
  11815. "extensions": {
  11816. "type": "array",
  11817. "items": {
  11818. "type": "string"
  11819. }
  11820. },
  11821. "disabled": {
  11822. "type": "boolean"
  11823. },
  11824. "env": {
  11825. "type": "object",
  11826. "additionalProperties": {
  11827. "type": "string"
  11828. }
  11829. },
  11830. "initialization": {
  11831. "type": "object"
  11832. }
  11833. },
  11834. "required": ["command"],
  11835. "additionalProperties": false
  11836. }
  11837. ]
  11838. }
  11839. }
  11840. ],
  11841. "description": "Enable or configure LSP servers. Omit or set to false to disable, true to enable built-ins, or an object to enable built-ins with overrides."
  11842. },
  11843. "instructions": {
  11844. "type": "array",
  11845. "items": {
  11846. "type": "string"
  11847. }
  11848. },
  11849. "layout": {
  11850. "$ref": "#/components/schemas/LayoutConfig"
  11851. },
  11852. "permission": {
  11853. "$ref": "#/components/schemas/PermissionConfig"
  11854. },
  11855. "tools": {
  11856. "type": "object",
  11857. "additionalProperties": {
  11858. "type": "boolean"
  11859. }
  11860. },
  11861. "enterprise": {
  11862. "type": "object",
  11863. "properties": {
  11864. "url": {
  11865. "type": "string"
  11866. }
  11867. },
  11868. "additionalProperties": false
  11869. },
  11870. "tool_output": {
  11871. "type": "object",
  11872. "properties": {
  11873. "max_lines": {
  11874. "type": "integer",
  11875. "exclusiveMinimum": 0
  11876. },
  11877. "max_bytes": {
  11878. "type": "integer",
  11879. "exclusiveMinimum": 0
  11880. }
  11881. },
  11882. "additionalProperties": false
  11883. },
  11884. "compaction": {
  11885. "type": "object",
  11886. "properties": {
  11887. "auto": {
  11888. "type": "boolean"
  11889. },
  11890. "prune": {
  11891. "type": "boolean"
  11892. },
  11893. "tail_turns": {
  11894. "type": "integer",
  11895. "minimum": 0
  11896. },
  11897. "preserve_recent_tokens": {
  11898. "type": "integer",
  11899. "minimum": 0
  11900. },
  11901. "reserved": {
  11902. "type": "integer",
  11903. "minimum": 0
  11904. }
  11905. },
  11906. "additionalProperties": false
  11907. },
  11908. "experimental": {
  11909. "type": "object",
  11910. "properties": {
  11911. "disable_paste_summary": {
  11912. "type": "boolean"
  11913. },
  11914. "batch_tool": {
  11915. "type": "boolean"
  11916. },
  11917. "openTelemetry": {
  11918. "type": "boolean"
  11919. },
  11920. "primary_tools": {
  11921. "type": "array",
  11922. "items": {
  11923. "type": "string"
  11924. }
  11925. },
  11926. "continue_loop_on_deny": {
  11927. "type": "boolean"
  11928. },
  11929. "mcp_timeout": {
  11930. "type": "integer",
  11931. "exclusiveMinimum": 0
  11932. }
  11933. },
  11934. "additionalProperties": false
  11935. }
  11936. },
  11937. "additionalProperties": false
  11938. },
  11939. "Model": {
  11940. "type": "object",
  11941. "properties": {
  11942. "id": {
  11943. "type": "string"
  11944. },
  11945. "providerID": {
  11946. "type": "string"
  11947. },
  11948. "api": {
  11949. "type": "object",
  11950. "properties": {
  11951. "id": {
  11952. "type": "string"
  11953. },
  11954. "url": {
  11955. "type": "string"
  11956. },
  11957. "npm": {
  11958. "type": "string"
  11959. }
  11960. },
  11961. "required": ["id", "url", "npm"],
  11962. "additionalProperties": false
  11963. },
  11964. "name": {
  11965. "type": "string"
  11966. },
  11967. "family": {
  11968. "type": "string"
  11969. },
  11970. "capabilities": {
  11971. "type": "object",
  11972. "properties": {
  11973. "temperature": {
  11974. "type": "boolean"
  11975. },
  11976. "reasoning": {
  11977. "type": "boolean"
  11978. },
  11979. "attachment": {
  11980. "type": "boolean"
  11981. },
  11982. "toolcall": {
  11983. "type": "boolean"
  11984. },
  11985. "input": {
  11986. "type": "object",
  11987. "properties": {
  11988. "text": {
  11989. "type": "boolean"
  11990. },
  11991. "audio": {
  11992. "type": "boolean"
  11993. },
  11994. "image": {
  11995. "type": "boolean"
  11996. },
  11997. "video": {
  11998. "type": "boolean"
  11999. },
  12000. "pdf": {
  12001. "type": "boolean"
  12002. }
  12003. },
  12004. "required": ["text", "audio", "image", "video", "pdf"],
  12005. "additionalProperties": false
  12006. },
  12007. "output": {
  12008. "type": "object",
  12009. "properties": {
  12010. "text": {
  12011. "type": "boolean"
  12012. },
  12013. "audio": {
  12014. "type": "boolean"
  12015. },
  12016. "image": {
  12017. "type": "boolean"
  12018. },
  12019. "video": {
  12020. "type": "boolean"
  12021. },
  12022. "pdf": {
  12023. "type": "boolean"
  12024. }
  12025. },
  12026. "required": ["text", "audio", "image", "video", "pdf"],
  12027. "additionalProperties": false
  12028. },
  12029. "interleaved": {
  12030. "anyOf": [
  12031. {
  12032. "type": "boolean"
  12033. },
  12034. {
  12035. "type": "object",
  12036. "properties": {
  12037. "field": {
  12038. "type": "string",
  12039. "enum": ["reasoning_content", "reasoning_details"]
  12040. }
  12041. },
  12042. "required": ["field"],
  12043. "additionalProperties": false
  12044. }
  12045. ]
  12046. }
  12047. },
  12048. "required": ["temperature", "reasoning", "attachment", "toolcall", "input", "output", "interleaved"],
  12049. "additionalProperties": false
  12050. },
  12051. "cost": {
  12052. "type": "object",
  12053. "properties": {
  12054. "input": {
  12055. "type": "number"
  12056. },
  12057. "output": {
  12058. "type": "number"
  12059. },
  12060. "cache": {
  12061. "type": "object",
  12062. "properties": {
  12063. "read": {
  12064. "type": "number"
  12065. },
  12066. "write": {
  12067. "type": "number"
  12068. }
  12069. },
  12070. "required": ["read", "write"],
  12071. "additionalProperties": false
  12072. },
  12073. "experimentalOver200K": {
  12074. "type": "object",
  12075. "properties": {
  12076. "input": {
  12077. "type": "number"
  12078. },
  12079. "output": {
  12080. "type": "number"
  12081. },
  12082. "cache": {
  12083. "type": "object",
  12084. "properties": {
  12085. "read": {
  12086. "type": "number"
  12087. },
  12088. "write": {
  12089. "type": "number"
  12090. }
  12091. },
  12092. "required": ["read", "write"],
  12093. "additionalProperties": false
  12094. }
  12095. },
  12096. "required": ["input", "output", "cache"],
  12097. "additionalProperties": false
  12098. }
  12099. },
  12100. "required": ["input", "output", "cache"],
  12101. "additionalProperties": false
  12102. },
  12103. "limit": {
  12104. "type": "object",
  12105. "properties": {
  12106. "context": {
  12107. "type": "number"
  12108. },
  12109. "input": {
  12110. "type": "number"
  12111. },
  12112. "output": {
  12113. "type": "number"
  12114. }
  12115. },
  12116. "required": ["context", "output"],
  12117. "additionalProperties": false
  12118. },
  12119. "status": {
  12120. "type": "string",
  12121. "enum": ["alpha", "beta", "deprecated", "active"]
  12122. },
  12123. "options": {
  12124. "type": "object"
  12125. },
  12126. "headers": {
  12127. "type": "object",
  12128. "additionalProperties": {
  12129. "type": "string"
  12130. }
  12131. },
  12132. "release_date": {
  12133. "type": "string"
  12134. },
  12135. "variants": {
  12136. "type": "object",
  12137. "additionalProperties": {
  12138. "type": "object"
  12139. }
  12140. }
  12141. },
  12142. "required": [
  12143. "id",
  12144. "providerID",
  12145. "api",
  12146. "name",
  12147. "capabilities",
  12148. "cost",
  12149. "limit",
  12150. "status",
  12151. "options",
  12152. "headers",
  12153. "release_date"
  12154. ],
  12155. "additionalProperties": false
  12156. },
  12157. "Provider": {
  12158. "type": "object",
  12159. "properties": {
  12160. "id": {
  12161. "type": "string"
  12162. },
  12163. "name": {
  12164. "type": "string"
  12165. },
  12166. "source": {
  12167. "type": "string",
  12168. "enum": ["env", "config", "custom", "api"]
  12169. },
  12170. "env": {
  12171. "type": "array",
  12172. "items": {
  12173. "type": "string"
  12174. }
  12175. },
  12176. "key": {
  12177. "type": "string"
  12178. },
  12179. "options": {
  12180. "type": "object"
  12181. },
  12182. "models": {
  12183. "type": "object",
  12184. "additionalProperties": {
  12185. "$ref": "#/components/schemas/Model"
  12186. }
  12187. }
  12188. },
  12189. "required": ["id", "name", "source", "env", "options", "models"],
  12190. "additionalProperties": false
  12191. },
  12192. "ConsoleState": {
  12193. "type": "object",
  12194. "properties": {
  12195. "consoleManagedProviders": {
  12196. "type": "array",
  12197. "items": {
  12198. "type": "string"
  12199. }
  12200. },
  12201. "activeOrgName": {
  12202. "type": "string"
  12203. },
  12204. "switchableOrgCount": {
  12205. "type": "integer",
  12206. "minimum": 0
  12207. }
  12208. },
  12209. "required": ["consoleManagedProviders", "switchableOrgCount"],
  12210. "additionalProperties": false
  12211. },
  12212. "ToolListItem": {
  12213. "type": "object",
  12214. "properties": {
  12215. "id": {
  12216. "type": "string"
  12217. },
  12218. "description": {
  12219. "type": "string"
  12220. },
  12221. "parameters": {}
  12222. },
  12223. "required": ["id", "description", "parameters"],
  12224. "additionalProperties": false
  12225. },
  12226. "ToolList": {
  12227. "type": "array",
  12228. "items": {
  12229. "$ref": "#/components/schemas/ToolListItem"
  12230. }
  12231. },
  12232. "ToolIDs": {
  12233. "type": "array",
  12234. "items": {
  12235. "type": "string"
  12236. }
  12237. },
  12238. "WorktreeCreateInput": {
  12239. "type": "object",
  12240. "properties": {
  12241. "name": {
  12242. "type": "string"
  12243. },
  12244. "startCommand": {
  12245. "type": "string",
  12246. "description": "Additional startup script to run after the project's start command"
  12247. }
  12248. },
  12249. "additionalProperties": false
  12250. },
  12251. "Worktree": {
  12252. "type": "object",
  12253. "properties": {
  12254. "name": {
  12255. "type": "string"
  12256. },
  12257. "branch": {
  12258. "type": "string"
  12259. },
  12260. "directory": {
  12261. "type": "string"
  12262. }
  12263. },
  12264. "required": ["name", "branch", "directory"],
  12265. "additionalProperties": false
  12266. },
  12267. "WorktreeRemoveInput": {
  12268. "type": "object",
  12269. "properties": {
  12270. "directory": {
  12271. "type": "string"
  12272. }
  12273. },
  12274. "required": ["directory"],
  12275. "additionalProperties": false
  12276. },
  12277. "WorktreeResetInput": {
  12278. "type": "object",
  12279. "properties": {
  12280. "directory": {
  12281. "type": "string"
  12282. }
  12283. },
  12284. "required": ["directory"],
  12285. "additionalProperties": false
  12286. },
  12287. "ProjectSummary": {
  12288. "type": "object",
  12289. "properties": {
  12290. "id": {
  12291. "type": "string"
  12292. },
  12293. "name": {
  12294. "type": "string"
  12295. },
  12296. "worktree": {
  12297. "type": "string"
  12298. }
  12299. },
  12300. "required": ["id", "worktree"],
  12301. "additionalProperties": false
  12302. },
  12303. "GlobalSession": {
  12304. "type": "object",
  12305. "properties": {
  12306. "id": {
  12307. "type": "string"
  12308. },
  12309. "slug": {
  12310. "type": "string"
  12311. },
  12312. "projectID": {
  12313. "type": "string"
  12314. },
  12315. "workspaceID": {
  12316. "type": "string"
  12317. },
  12318. "directory": {
  12319. "type": "string"
  12320. },
  12321. "path": {
  12322. "type": "string"
  12323. },
  12324. "parentID": {
  12325. "type": "string"
  12326. },
  12327. "summary": {
  12328. "type": "object",
  12329. "properties": {
  12330. "additions": {
  12331. "type": "integer",
  12332. "minimum": 0
  12333. },
  12334. "deletions": {
  12335. "type": "integer",
  12336. "minimum": 0
  12337. },
  12338. "files": {
  12339. "type": "integer",
  12340. "minimum": 0
  12341. },
  12342. "diffs": {
  12343. "type": "array",
  12344. "items": {
  12345. "$ref": "#/components/schemas/SnapshotFileDiff"
  12346. }
  12347. }
  12348. },
  12349. "required": ["additions", "deletions", "files"],
  12350. "additionalProperties": false
  12351. },
  12352. "share": {
  12353. "type": "object",
  12354. "properties": {
  12355. "url": {
  12356. "type": "string"
  12357. }
  12358. },
  12359. "required": ["url"],
  12360. "additionalProperties": false
  12361. },
  12362. "title": {
  12363. "type": "string"
  12364. },
  12365. "agent": {
  12366. "type": "string"
  12367. },
  12368. "model": {
  12369. "type": "object",
  12370. "properties": {
  12371. "id": {
  12372. "type": "string"
  12373. },
  12374. "providerID": {
  12375. "type": "string"
  12376. },
  12377. "variant": {
  12378. "type": "string"
  12379. }
  12380. },
  12381. "required": ["id", "providerID"],
  12382. "additionalProperties": false
  12383. },
  12384. "version": {
  12385. "type": "string"
  12386. },
  12387. "time": {
  12388. "type": "object",
  12389. "properties": {
  12390. "created": {
  12391. "type": "integer",
  12392. "minimum": 0
  12393. },
  12394. "updated": {
  12395. "type": "integer",
  12396. "minimum": 0
  12397. },
  12398. "compacting": {
  12399. "type": "integer",
  12400. "minimum": 0
  12401. },
  12402. "archived": {
  12403. "type": "number"
  12404. }
  12405. },
  12406. "required": ["created", "updated"],
  12407. "additionalProperties": false
  12408. },
  12409. "permission": {
  12410. "$ref": "#/components/schemas/PermissionRuleset"
  12411. },
  12412. "revert": {
  12413. "type": "object",
  12414. "properties": {
  12415. "messageID": {
  12416. "type": "string"
  12417. },
  12418. "partID": {
  12419. "type": "string"
  12420. },
  12421. "snapshot": {
  12422. "type": "string"
  12423. },
  12424. "diff": {
  12425. "type": "string"
  12426. }
  12427. },
  12428. "required": ["messageID"],
  12429. "additionalProperties": false
  12430. },
  12431. "project": {
  12432. "anyOf": [
  12433. {
  12434. "$ref": "#/components/schemas/ProjectSummary"
  12435. },
  12436. {
  12437. "type": "null"
  12438. }
  12439. ]
  12440. }
  12441. },
  12442. "required": ["id", "slug", "projectID", "directory", "title", "version", "time", "project"],
  12443. "additionalProperties": false
  12444. },
  12445. "McpResource": {
  12446. "type": "object",
  12447. "properties": {
  12448. "name": {
  12449. "type": "string"
  12450. },
  12451. "uri": {
  12452. "type": "string"
  12453. },
  12454. "description": {
  12455. "type": "string"
  12456. },
  12457. "mimeType": {
  12458. "type": "string"
  12459. },
  12460. "client": {
  12461. "type": "string"
  12462. }
  12463. },
  12464. "required": ["name", "uri", "client"],
  12465. "additionalProperties": false
  12466. },
  12467. "Symbol": {
  12468. "type": "object",
  12469. "properties": {
  12470. "name": {
  12471. "type": "string"
  12472. },
  12473. "kind": {
  12474. "type": "integer",
  12475. "minimum": 0
  12476. },
  12477. "location": {
  12478. "type": "object",
  12479. "properties": {
  12480. "uri": {
  12481. "type": "string"
  12482. },
  12483. "range": {
  12484. "$ref": "#/components/schemas/Range"
  12485. }
  12486. },
  12487. "required": ["uri", "range"],
  12488. "additionalProperties": false
  12489. }
  12490. },
  12491. "required": ["name", "kind", "location"],
  12492. "additionalProperties": false
  12493. },
  12494. "FileNode": {
  12495. "type": "object",
  12496. "properties": {
  12497. "name": {
  12498. "type": "string"
  12499. },
  12500. "path": {
  12501. "type": "string"
  12502. },
  12503. "absolute": {
  12504. "type": "string"
  12505. },
  12506. "type": {
  12507. "type": "string",
  12508. "enum": ["file", "directory"]
  12509. },
  12510. "ignored": {
  12511. "type": "boolean"
  12512. }
  12513. },
  12514. "required": ["name", "path", "absolute", "type", "ignored"],
  12515. "additionalProperties": false
  12516. },
  12517. "FileContent": {
  12518. "type": "object",
  12519. "properties": {
  12520. "type": {
  12521. "type": "string",
  12522. "enum": ["text", "binary"]
  12523. },
  12524. "content": {
  12525. "type": "string"
  12526. },
  12527. "diff": {
  12528. "type": "string"
  12529. },
  12530. "patch": {
  12531. "type": "object",
  12532. "properties": {
  12533. "oldFileName": {
  12534. "type": "string"
  12535. },
  12536. "newFileName": {
  12537. "type": "string"
  12538. },
  12539. "oldHeader": {
  12540. "type": "string"
  12541. },
  12542. "newHeader": {
  12543. "type": "string"
  12544. },
  12545. "hunks": {
  12546. "type": "array",
  12547. "items": {
  12548. "type": "object",
  12549. "properties": {
  12550. "oldStart": {
  12551. "type": "integer",
  12552. "minimum": 0
  12553. },
  12554. "oldLines": {
  12555. "type": "integer",
  12556. "minimum": 0
  12557. },
  12558. "newStart": {
  12559. "type": "integer",
  12560. "minimum": 0
  12561. },
  12562. "newLines": {
  12563. "type": "integer",
  12564. "minimum": 0
  12565. },
  12566. "lines": {
  12567. "type": "array",
  12568. "items": {
  12569. "type": "string"
  12570. }
  12571. }
  12572. },
  12573. "required": ["oldStart", "oldLines", "newStart", "newLines", "lines"],
  12574. "additionalProperties": false
  12575. }
  12576. },
  12577. "index": {
  12578. "type": "string"
  12579. }
  12580. },
  12581. "required": ["oldFileName", "newFileName", "hunks"],
  12582. "additionalProperties": false
  12583. },
  12584. "encoding": {
  12585. "type": "string",
  12586. "enum": ["base64"]
  12587. },
  12588. "mimeType": {
  12589. "type": "string"
  12590. }
  12591. },
  12592. "required": ["type", "content"],
  12593. "additionalProperties": false
  12594. },
  12595. "File": {
  12596. "type": "object",
  12597. "properties": {
  12598. "path": {
  12599. "type": "string"
  12600. },
  12601. "added": {
  12602. "type": "integer",
  12603. "minimum": 0
  12604. },
  12605. "removed": {
  12606. "type": "integer",
  12607. "minimum": 0
  12608. },
  12609. "status": {
  12610. "type": "string",
  12611. "enum": ["added", "deleted", "modified"]
  12612. }
  12613. },
  12614. "required": ["path", "added", "removed", "status"],
  12615. "additionalProperties": false
  12616. },
  12617. "Path": {
  12618. "type": "object",
  12619. "properties": {
  12620. "home": {
  12621. "type": "string"
  12622. },
  12623. "state": {
  12624. "type": "string"
  12625. },
  12626. "config": {
  12627. "type": "string"
  12628. },
  12629. "worktree": {
  12630. "type": "string"
  12631. },
  12632. "directory": {
  12633. "type": "string"
  12634. }
  12635. },
  12636. "required": ["home", "state", "config", "worktree", "directory"],
  12637. "additionalProperties": false
  12638. },
  12639. "VcsInfo": {
  12640. "type": "object",
  12641. "properties": {
  12642. "branch": {
  12643. "type": "string"
  12644. },
  12645. "default_branch": {
  12646. "type": "string"
  12647. }
  12648. },
  12649. "additionalProperties": false
  12650. },
  12651. "VcsFileDiff": {
  12652. "type": "object",
  12653. "properties": {
  12654. "file": {
  12655. "type": "string"
  12656. },
  12657. "patch": {
  12658. "type": "string"
  12659. },
  12660. "additions": {
  12661. "type": "integer",
  12662. "minimum": 0
  12663. },
  12664. "deletions": {
  12665. "type": "integer",
  12666. "minimum": 0
  12667. },
  12668. "status": {
  12669. "type": "string",
  12670. "enum": ["added", "deleted", "modified"]
  12671. }
  12672. },
  12673. "required": ["file", "patch", "additions", "deletions"],
  12674. "additionalProperties": false
  12675. },
  12676. "Command": {
  12677. "type": "object",
  12678. "properties": {
  12679. "name": {
  12680. "type": "string"
  12681. },
  12682. "description": {
  12683. "type": "string"
  12684. },
  12685. "agent": {
  12686. "type": "string"
  12687. },
  12688. "model": {
  12689. "type": "string"
  12690. },
  12691. "source": {
  12692. "type": "string",
  12693. "enum": ["command", "mcp", "skill"]
  12694. },
  12695. "template": {
  12696. "type": "string"
  12697. },
  12698. "subtask": {
  12699. "type": "boolean"
  12700. },
  12701. "hints": {
  12702. "type": "array",
  12703. "items": {
  12704. "type": "string"
  12705. }
  12706. }
  12707. },
  12708. "required": ["name", "template", "hints"],
  12709. "additionalProperties": false
  12710. },
  12711. "Agent": {
  12712. "type": "object",
  12713. "properties": {
  12714. "name": {
  12715. "type": "string"
  12716. },
  12717. "description": {
  12718. "type": "string"
  12719. },
  12720. "mode": {
  12721. "type": "string",
  12722. "enum": ["subagent", "primary", "all"]
  12723. },
  12724. "native": {
  12725. "type": "boolean"
  12726. },
  12727. "hidden": {
  12728. "type": "boolean"
  12729. },
  12730. "topP": {
  12731. "type": "number"
  12732. },
  12733. "temperature": {
  12734. "type": "number"
  12735. },
  12736. "color": {
  12737. "type": "string"
  12738. },
  12739. "permission": {
  12740. "$ref": "#/components/schemas/PermissionRuleset"
  12741. },
  12742. "model": {
  12743. "type": "object",
  12744. "properties": {
  12745. "modelID": {
  12746. "type": "string"
  12747. },
  12748. "providerID": {
  12749. "type": "string"
  12750. }
  12751. },
  12752. "required": ["modelID", "providerID"],
  12753. "additionalProperties": false
  12754. },
  12755. "variant": {
  12756. "type": "string"
  12757. },
  12758. "prompt": {
  12759. "type": "string"
  12760. },
  12761. "options": {
  12762. "type": "object"
  12763. },
  12764. "steps": {
  12765. "type": "number"
  12766. }
  12767. },
  12768. "required": ["name", "mode", "permission", "options"],
  12769. "additionalProperties": false
  12770. },
  12771. "LSPStatus": {
  12772. "type": "object",
  12773. "properties": {
  12774. "id": {
  12775. "type": "string"
  12776. },
  12777. "name": {
  12778. "type": "string"
  12779. },
  12780. "root": {
  12781. "type": "string"
  12782. },
  12783. "status": {
  12784. "type": "string",
  12785. "enum": ["connected", "error"]
  12786. }
  12787. },
  12788. "required": ["id", "name", "root", "status"],
  12789. "additionalProperties": false
  12790. },
  12791. "FormatterStatus": {
  12792. "type": "object",
  12793. "properties": {
  12794. "name": {
  12795. "type": "string"
  12796. },
  12797. "extensions": {
  12798. "type": "array",
  12799. "items": {
  12800. "type": "string"
  12801. }
  12802. },
  12803. "enabled": {
  12804. "type": "boolean"
  12805. }
  12806. },
  12807. "required": ["name", "extensions", "enabled"],
  12808. "additionalProperties": false
  12809. },
  12810. "MCPStatusConnected": {
  12811. "type": "object",
  12812. "properties": {
  12813. "status": {
  12814. "type": "string",
  12815. "enum": ["connected"]
  12816. }
  12817. },
  12818. "required": ["status"],
  12819. "additionalProperties": false
  12820. },
  12821. "MCPStatusDisabled": {
  12822. "type": "object",
  12823. "properties": {
  12824. "status": {
  12825. "type": "string",
  12826. "enum": ["disabled"]
  12827. }
  12828. },
  12829. "required": ["status"],
  12830. "additionalProperties": false
  12831. },
  12832. "MCPStatusFailed": {
  12833. "type": "object",
  12834. "properties": {
  12835. "status": {
  12836. "type": "string",
  12837. "enum": ["failed"]
  12838. },
  12839. "error": {
  12840. "type": "string"
  12841. }
  12842. },
  12843. "required": ["status", "error"],
  12844. "additionalProperties": false
  12845. },
  12846. "MCPStatusNeedsAuth": {
  12847. "type": "object",
  12848. "properties": {
  12849. "status": {
  12850. "type": "string",
  12851. "enum": ["needs_auth"]
  12852. }
  12853. },
  12854. "required": ["status"],
  12855. "additionalProperties": false
  12856. },
  12857. "MCPStatusNeedsClientRegistration": {
  12858. "type": "object",
  12859. "properties": {
  12860. "status": {
  12861. "type": "string",
  12862. "enum": ["needs_client_registration"]
  12863. },
  12864. "error": {
  12865. "type": "string"
  12866. }
  12867. },
  12868. "required": ["status", "error"],
  12869. "additionalProperties": false
  12870. },
  12871. "MCPStatus": {
  12872. "anyOf": [
  12873. {
  12874. "$ref": "#/components/schemas/MCPStatusConnected"
  12875. },
  12876. {
  12877. "$ref": "#/components/schemas/MCPStatusDisabled"
  12878. },
  12879. {
  12880. "$ref": "#/components/schemas/MCPStatusFailed"
  12881. },
  12882. {
  12883. "$ref": "#/components/schemas/MCPStatusNeedsAuth"
  12884. },
  12885. {
  12886. "$ref": "#/components/schemas/MCPStatusNeedsClientRegistration"
  12887. }
  12888. ]
  12889. },
  12890. "McpUnsupportedOAuthError": {
  12891. "type": "object",
  12892. "properties": {
  12893. "error": {
  12894. "type": "string"
  12895. }
  12896. },
  12897. "required": ["error"],
  12898. "additionalProperties": false
  12899. },
  12900. "effect_HttpApiError_Forbidden": {
  12901. "type": "object",
  12902. "properties": {
  12903. "_tag": {
  12904. "type": "string",
  12905. "enum": ["Forbidden"]
  12906. }
  12907. },
  12908. "required": ["_tag"],
  12909. "additionalProperties": false
  12910. },
  12911. "ProviderAuthMethod": {
  12912. "type": "object",
  12913. "properties": {
  12914. "type": {
  12915. "type": "string",
  12916. "enum": ["oauth", "api"]
  12917. },
  12918. "label": {
  12919. "type": "string"
  12920. },
  12921. "prompts": {
  12922. "type": "array",
  12923. "items": {
  12924. "anyOf": [
  12925. {
  12926. "type": "object",
  12927. "properties": {
  12928. "type": {
  12929. "type": "string",
  12930. "enum": ["text"]
  12931. },
  12932. "key": {
  12933. "type": "string"
  12934. },
  12935. "message": {
  12936. "type": "string"
  12937. },
  12938. "placeholder": {
  12939. "type": "string"
  12940. },
  12941. "when": {
  12942. "type": "object",
  12943. "properties": {
  12944. "key": {
  12945. "type": "string"
  12946. },
  12947. "op": {
  12948. "type": "string",
  12949. "enum": ["eq", "neq"]
  12950. },
  12951. "value": {
  12952. "type": "string"
  12953. }
  12954. },
  12955. "required": ["key", "op", "value"],
  12956. "additionalProperties": false
  12957. }
  12958. },
  12959. "required": ["type", "key", "message"],
  12960. "additionalProperties": false
  12961. },
  12962. {
  12963. "type": "object",
  12964. "properties": {
  12965. "type": {
  12966. "type": "string",
  12967. "enum": ["select"]
  12968. },
  12969. "key": {
  12970. "type": "string"
  12971. },
  12972. "message": {
  12973. "type": "string"
  12974. },
  12975. "options": {
  12976. "type": "array",
  12977. "items": {
  12978. "type": "object",
  12979. "properties": {
  12980. "label": {
  12981. "type": "string"
  12982. },
  12983. "value": {
  12984. "type": "string"
  12985. },
  12986. "hint": {
  12987. "type": "string"
  12988. }
  12989. },
  12990. "required": ["label", "value"],
  12991. "additionalProperties": false
  12992. }
  12993. },
  12994. "when": {
  12995. "type": "object",
  12996. "properties": {
  12997. "key": {
  12998. "type": "string"
  12999. },
  13000. "op": {
  13001. "type": "string",
  13002. "enum": ["eq", "neq"]
  13003. },
  13004. "value": {
  13005. "type": "string"
  13006. }
  13007. },
  13008. "required": ["key", "op", "value"],
  13009. "additionalProperties": false
  13010. }
  13011. },
  13012. "required": ["type", "key", "message", "options"],
  13013. "additionalProperties": false
  13014. }
  13015. ]
  13016. }
  13017. }
  13018. },
  13019. "required": ["type", "label"],
  13020. "additionalProperties": false
  13021. },
  13022. "ProviderAuthAuthorization": {
  13023. "type": "object",
  13024. "properties": {
  13025. "url": {
  13026. "type": "string"
  13027. },
  13028. "method": {
  13029. "type": "string",
  13030. "enum": ["auto", "code"]
  13031. },
  13032. "instructions": {
  13033. "type": "string"
  13034. }
  13035. },
  13036. "required": ["url", "method", "instructions"],
  13037. "additionalProperties": false
  13038. },
  13039. "TextPartInput": {
  13040. "type": "object",
  13041. "properties": {
  13042. "id": {
  13043. "type": "string"
  13044. },
  13045. "type": {
  13046. "type": "string",
  13047. "enum": ["text"]
  13048. },
  13049. "text": {
  13050. "type": "string"
  13051. },
  13052. "synthetic": {
  13053. "type": "boolean"
  13054. },
  13055. "ignored": {
  13056. "type": "boolean"
  13057. },
  13058. "time": {
  13059. "type": "object",
  13060. "properties": {
  13061. "start": {
  13062. "type": "integer",
  13063. "minimum": 0
  13064. },
  13065. "end": {
  13066. "type": "integer",
  13067. "minimum": 0
  13068. }
  13069. },
  13070. "required": ["start"],
  13071. "additionalProperties": false
  13072. },
  13073. "metadata": {
  13074. "type": "object"
  13075. }
  13076. },
  13077. "required": ["type", "text"],
  13078. "additionalProperties": false
  13079. },
  13080. "FilePartInput": {
  13081. "type": "object",
  13082. "properties": {
  13083. "id": {
  13084. "type": "string"
  13085. },
  13086. "type": {
  13087. "type": "string",
  13088. "enum": ["file"]
  13089. },
  13090. "mime": {
  13091. "type": "string"
  13092. },
  13093. "filename": {
  13094. "type": "string"
  13095. },
  13096. "url": {
  13097. "type": "string"
  13098. },
  13099. "source": {
  13100. "$ref": "#/components/schemas/FilePartSource"
  13101. }
  13102. },
  13103. "required": ["type", "mime", "url"],
  13104. "additionalProperties": false
  13105. },
  13106. "AgentPartInput": {
  13107. "type": "object",
  13108. "properties": {
  13109. "id": {
  13110. "type": "string"
  13111. },
  13112. "type": {
  13113. "type": "string",
  13114. "enum": ["agent"]
  13115. },
  13116. "name": {
  13117. "type": "string"
  13118. },
  13119. "source": {
  13120. "type": "object",
  13121. "properties": {
  13122. "value": {
  13123. "type": "string"
  13124. },
  13125. "start": {
  13126. "type": "integer",
  13127. "minimum": 0
  13128. },
  13129. "end": {
  13130. "type": "integer",
  13131. "minimum": 0
  13132. }
  13133. },
  13134. "required": ["value", "start", "end"],
  13135. "additionalProperties": false
  13136. }
  13137. },
  13138. "required": ["type", "name"],
  13139. "additionalProperties": false
  13140. },
  13141. "SubtaskPartInput": {
  13142. "type": "object",
  13143. "properties": {
  13144. "id": {
  13145. "type": "string"
  13146. },
  13147. "type": {
  13148. "type": "string",
  13149. "enum": ["subtask"]
  13150. },
  13151. "prompt": {
  13152. "type": "string"
  13153. },
  13154. "description": {
  13155. "type": "string"
  13156. },
  13157. "agent": {
  13158. "type": "string"
  13159. },
  13160. "model": {
  13161. "type": "object",
  13162. "properties": {
  13163. "providerID": {
  13164. "type": "string"
  13165. },
  13166. "modelID": {
  13167. "type": "string"
  13168. }
  13169. },
  13170. "required": ["providerID", "modelID"],
  13171. "additionalProperties": false
  13172. },
  13173. "command": {
  13174. "type": "string"
  13175. }
  13176. },
  13177. "required": ["type", "prompt", "description", "agent"],
  13178. "additionalProperties": false
  13179. },
  13180. "V2SessionsResponse": {
  13181. "type": "object",
  13182. "properties": {
  13183. "items": {
  13184. "type": "array",
  13185. "items": {
  13186. "$ref": "#/components/schemas/SessionInfo"
  13187. }
  13188. },
  13189. "cursor": {
  13190. "type": "object",
  13191. "properties": {
  13192. "previous": {
  13193. "type": "string"
  13194. },
  13195. "next": {
  13196. "type": "string"
  13197. }
  13198. },
  13199. "additionalProperties": false
  13200. }
  13201. },
  13202. "required": ["items", "cursor"],
  13203. "additionalProperties": false
  13204. },
  13205. "V2SessionMessagesResponse": {
  13206. "type": "object",
  13207. "properties": {
  13208. "items": {
  13209. "type": "array",
  13210. "items": {
  13211. "$ref": "#/components/schemas/SessionMessage"
  13212. }
  13213. },
  13214. "cursor": {
  13215. "type": "object",
  13216. "properties": {
  13217. "previous": {
  13218. "type": "string"
  13219. },
  13220. "next": {
  13221. "type": "string"
  13222. }
  13223. },
  13224. "additionalProperties": false
  13225. }
  13226. },
  13227. "required": ["items", "cursor"],
  13228. "additionalProperties": false
  13229. },
  13230. "EventTuiPromptAppend": {
  13231. "type": "object",
  13232. "properties": {
  13233. "type": {
  13234. "type": "string",
  13235. "enum": ["tui.prompt.append"]
  13236. },
  13237. "properties": {
  13238. "type": "object",
  13239. "properties": {
  13240. "text": {
  13241. "type": "string"
  13242. }
  13243. },
  13244. "required": ["text"],
  13245. "additionalProperties": false
  13246. }
  13247. },
  13248. "required": ["type", "properties"],
  13249. "additionalProperties": false
  13250. },
  13251. "EventTuiCommandExecute": {
  13252. "type": "object",
  13253. "properties": {
  13254. "type": {
  13255. "type": "string",
  13256. "enum": ["tui.command.execute"]
  13257. },
  13258. "properties": {
  13259. "type": "object",
  13260. "properties": {
  13261. "command": {
  13262. "anyOf": [
  13263. {
  13264. "type": "string",
  13265. "enum": [
  13266. "session.list",
  13267. "session.new",
  13268. "session.share",
  13269. "session.interrupt",
  13270. "session.compact",
  13271. "session.page.up",
  13272. "session.page.down",
  13273. "session.line.up",
  13274. "session.line.down",
  13275. "session.half.page.up",
  13276. "session.half.page.down",
  13277. "session.first",
  13278. "session.last",
  13279. "prompt.clear",
  13280. "prompt.submit",
  13281. "agent.cycle"
  13282. ]
  13283. },
  13284. {
  13285. "type": "string"
  13286. }
  13287. ]
  13288. }
  13289. },
  13290. "required": ["command"],
  13291. "additionalProperties": false
  13292. }
  13293. },
  13294. "required": ["type", "properties"],
  13295. "additionalProperties": false
  13296. },
  13297. "EventTuiToastShow": {
  13298. "type": "object",
  13299. "properties": {
  13300. "type": {
  13301. "type": "string",
  13302. "enum": ["tui.toast.show"]
  13303. },
  13304. "properties": {
  13305. "type": "object",
  13306. "properties": {
  13307. "title": {
  13308. "type": "string"
  13309. },
  13310. "message": {
  13311. "type": "string"
  13312. },
  13313. "variant": {
  13314. "type": "string",
  13315. "enum": ["info", "success", "warning", "error"]
  13316. },
  13317. "duration": {
  13318. "type": "integer",
  13319. "exclusiveMinimum": 0
  13320. }
  13321. },
  13322. "required": ["message", "variant"],
  13323. "additionalProperties": false
  13324. }
  13325. },
  13326. "required": ["type", "properties"],
  13327. "additionalProperties": false
  13328. },
  13329. "EventTuiSessionSelect": {
  13330. "type": "object",
  13331. "properties": {
  13332. "type": {
  13333. "type": "string",
  13334. "enum": ["tui.session.select"]
  13335. },
  13336. "properties": {
  13337. "type": "object",
  13338. "properties": {
  13339. "sessionID": {
  13340. "type": "string",
  13341. "description": "Session ID to navigate to"
  13342. }
  13343. },
  13344. "required": ["sessionID"],
  13345. "additionalProperties": false
  13346. }
  13347. },
  13348. "required": ["type", "properties"],
  13349. "additionalProperties": false
  13350. },
  13351. "Workspace": {
  13352. "type": "object",
  13353. "properties": {
  13354. "id": {
  13355. "type": "string"
  13356. },
  13357. "type": {
  13358. "type": "string"
  13359. },
  13360. "name": {
  13361. "type": "string"
  13362. },
  13363. "branch": {
  13364. "anyOf": [
  13365. {
  13366. "type": "string"
  13367. },
  13368. {
  13369. "type": "null"
  13370. }
  13371. ]
  13372. },
  13373. "directory": {
  13374. "anyOf": [
  13375. {
  13376. "type": "string"
  13377. },
  13378. {
  13379. "type": "null"
  13380. }
  13381. ]
  13382. },
  13383. "extra": {
  13384. "anyOf": [
  13385. {},
  13386. {
  13387. "type": "null"
  13388. }
  13389. ]
  13390. },
  13391. "projectID": {
  13392. "type": "string"
  13393. }
  13394. },
  13395. "required": ["id", "type", "name", "branch", "directory", "extra", "projectID"],
  13396. "additionalProperties": false
  13397. },
  13398. "SyncEventMessageUpdated": {
  13399. "type": "object",
  13400. "properties": {
  13401. "type": {
  13402. "type": "string",
  13403. "enum": ["sync"]
  13404. },
  13405. "name": {
  13406. "type": "string",
  13407. "enum": ["message.updated.1"]
  13408. },
  13409. "id": {
  13410. "type": "string"
  13411. },
  13412. "seq": {
  13413. "type": "number"
  13414. },
  13415. "aggregateID": {
  13416. "type": "string",
  13417. "enum": ["sessionID"]
  13418. },
  13419. "data": {
  13420. "type": "object",
  13421. "properties": {
  13422. "sessionID": {
  13423. "type": "string"
  13424. },
  13425. "info": {
  13426. "$ref": "#/components/schemas/Message"
  13427. }
  13428. },
  13429. "required": ["sessionID", "info"],
  13430. "additionalProperties": false
  13431. }
  13432. },
  13433. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  13434. "additionalProperties": false
  13435. },
  13436. "SyncEventMessageRemoved": {
  13437. "type": "object",
  13438. "properties": {
  13439. "type": {
  13440. "type": "string",
  13441. "enum": ["sync"]
  13442. },
  13443. "name": {
  13444. "type": "string",
  13445. "enum": ["message.removed.1"]
  13446. },
  13447. "id": {
  13448. "type": "string"
  13449. },
  13450. "seq": {
  13451. "type": "number"
  13452. },
  13453. "aggregateID": {
  13454. "type": "string",
  13455. "enum": ["sessionID"]
  13456. },
  13457. "data": {
  13458. "type": "object",
  13459. "properties": {
  13460. "sessionID": {
  13461. "type": "string"
  13462. },
  13463. "messageID": {
  13464. "type": "string"
  13465. }
  13466. },
  13467. "required": ["sessionID", "messageID"],
  13468. "additionalProperties": false
  13469. }
  13470. },
  13471. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  13472. "additionalProperties": false
  13473. },
  13474. "SyncEventMessagePartUpdated": {
  13475. "type": "object",
  13476. "properties": {
  13477. "type": {
  13478. "type": "string",
  13479. "enum": ["sync"]
  13480. },
  13481. "name": {
  13482. "type": "string",
  13483. "enum": ["message.part.updated.1"]
  13484. },
  13485. "id": {
  13486. "type": "string"
  13487. },
  13488. "seq": {
  13489. "type": "number"
  13490. },
  13491. "aggregateID": {
  13492. "type": "string",
  13493. "enum": ["sessionID"]
  13494. },
  13495. "data": {
  13496. "type": "object",
  13497. "properties": {
  13498. "sessionID": {
  13499. "type": "string"
  13500. },
  13501. "part": {
  13502. "$ref": "#/components/schemas/Part"
  13503. },
  13504. "time": {
  13505. "type": "integer",
  13506. "minimum": 0
  13507. }
  13508. },
  13509. "required": ["sessionID", "part", "time"],
  13510. "additionalProperties": false
  13511. }
  13512. },
  13513. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  13514. "additionalProperties": false
  13515. },
  13516. "SyncEventMessagePartRemoved": {
  13517. "type": "object",
  13518. "properties": {
  13519. "type": {
  13520. "type": "string",
  13521. "enum": ["sync"]
  13522. },
  13523. "name": {
  13524. "type": "string",
  13525. "enum": ["message.part.removed.1"]
  13526. },
  13527. "id": {
  13528. "type": "string"
  13529. },
  13530. "seq": {
  13531. "type": "number"
  13532. },
  13533. "aggregateID": {
  13534. "type": "string",
  13535. "enum": ["sessionID"]
  13536. },
  13537. "data": {
  13538. "type": "object",
  13539. "properties": {
  13540. "sessionID": {
  13541. "type": "string"
  13542. },
  13543. "messageID": {
  13544. "type": "string"
  13545. },
  13546. "partID": {
  13547. "type": "string"
  13548. }
  13549. },
  13550. "required": ["sessionID", "messageID", "partID"],
  13551. "additionalProperties": false
  13552. }
  13553. },
  13554. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  13555. "additionalProperties": false
  13556. },
  13557. "SyncEventSessionCreated": {
  13558. "type": "object",
  13559. "properties": {
  13560. "type": {
  13561. "type": "string",
  13562. "enum": ["sync"]
  13563. },
  13564. "name": {
  13565. "type": "string",
  13566. "enum": ["session.created.1"]
  13567. },
  13568. "id": {
  13569. "type": "string"
  13570. },
  13571. "seq": {
  13572. "type": "number"
  13573. },
  13574. "aggregateID": {
  13575. "type": "string",
  13576. "enum": ["sessionID"]
  13577. },
  13578. "data": {
  13579. "type": "object",
  13580. "properties": {
  13581. "sessionID": {
  13582. "type": "string"
  13583. },
  13584. "info": {
  13585. "$ref": "#/components/schemas/Session"
  13586. }
  13587. },
  13588. "required": ["sessionID", "info"],
  13589. "additionalProperties": false
  13590. }
  13591. },
  13592. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  13593. "additionalProperties": false
  13594. },
  13595. "SyncEventSessionUpdated": {
  13596. "type": "object",
  13597. "properties": {
  13598. "type": {
  13599. "type": "string",
  13600. "enum": ["sync"]
  13601. },
  13602. "name": {
  13603. "type": "string",
  13604. "enum": ["session.updated.1"]
  13605. },
  13606. "id": {
  13607. "type": "string"
  13608. },
  13609. "seq": {
  13610. "type": "number"
  13611. },
  13612. "aggregateID": {
  13613. "type": "string",
  13614. "enum": ["sessionID"]
  13615. },
  13616. "data": {
  13617. "type": "object",
  13618. "properties": {
  13619. "sessionID": {
  13620. "type": "string"
  13621. },
  13622. "info": {
  13623. "type": "object",
  13624. "properties": {
  13625. "id": {
  13626. "anyOf": [
  13627. {
  13628. "type": "string"
  13629. },
  13630. {
  13631. "type": "null"
  13632. }
  13633. ]
  13634. },
  13635. "slug": {
  13636. "anyOf": [
  13637. {
  13638. "type": "string"
  13639. },
  13640. {
  13641. "type": "null"
  13642. }
  13643. ]
  13644. },
  13645. "projectID": {
  13646. "anyOf": [
  13647. {
  13648. "type": "string"
  13649. },
  13650. {
  13651. "type": "null"
  13652. }
  13653. ]
  13654. },
  13655. "workspaceID": {
  13656. "anyOf": [
  13657. {
  13658. "type": "string"
  13659. },
  13660. {
  13661. "type": "null"
  13662. }
  13663. ]
  13664. },
  13665. "directory": {
  13666. "anyOf": [
  13667. {
  13668. "type": "string"
  13669. },
  13670. {
  13671. "type": "null"
  13672. }
  13673. ]
  13674. },
  13675. "path": {
  13676. "anyOf": [
  13677. {
  13678. "type": "string"
  13679. },
  13680. {
  13681. "type": "null"
  13682. }
  13683. ]
  13684. },
  13685. "parentID": {
  13686. "anyOf": [
  13687. {
  13688. "type": "string"
  13689. },
  13690. {
  13691. "type": "null"
  13692. }
  13693. ]
  13694. },
  13695. "summary": {
  13696. "anyOf": [
  13697. {
  13698. "type": "object",
  13699. "properties": {
  13700. "additions": {
  13701. "type": "integer",
  13702. "minimum": 0
  13703. },
  13704. "deletions": {
  13705. "type": "integer",
  13706. "minimum": 0
  13707. },
  13708. "files": {
  13709. "type": "integer",
  13710. "minimum": 0
  13711. },
  13712. "diffs": {
  13713. "type": "array",
  13714. "items": {
  13715. "$ref": "#/components/schemas/SnapshotFileDiff"
  13716. }
  13717. }
  13718. },
  13719. "required": ["additions", "deletions", "files"],
  13720. "additionalProperties": false
  13721. },
  13722. {
  13723. "type": "null"
  13724. }
  13725. ]
  13726. },
  13727. "share": {
  13728. "type": "object",
  13729. "properties": {
  13730. "url": {
  13731. "anyOf": [
  13732. {
  13733. "type": "string"
  13734. },
  13735. {
  13736. "type": "null"
  13737. }
  13738. ]
  13739. }
  13740. },
  13741. "additionalProperties": false
  13742. },
  13743. "title": {
  13744. "anyOf": [
  13745. {
  13746. "type": "string"
  13747. },
  13748. {
  13749. "type": "null"
  13750. }
  13751. ]
  13752. },
  13753. "agent": {
  13754. "anyOf": [
  13755. {
  13756. "type": "string"
  13757. },
  13758. {
  13759. "type": "null"
  13760. }
  13761. ]
  13762. },
  13763. "model": {
  13764. "anyOf": [
  13765. {
  13766. "type": "object",
  13767. "properties": {
  13768. "id": {
  13769. "type": "string"
  13770. },
  13771. "providerID": {
  13772. "type": "string"
  13773. },
  13774. "variant": {
  13775. "type": "string"
  13776. }
  13777. },
  13778. "required": ["id", "providerID"],
  13779. "additionalProperties": false
  13780. },
  13781. {
  13782. "type": "null"
  13783. }
  13784. ]
  13785. },
  13786. "version": {
  13787. "anyOf": [
  13788. {
  13789. "type": "string"
  13790. },
  13791. {
  13792. "type": "null"
  13793. }
  13794. ]
  13795. },
  13796. "time": {
  13797. "type": "object",
  13798. "properties": {
  13799. "created": {
  13800. "anyOf": [
  13801. {
  13802. "type": "integer",
  13803. "minimum": 0
  13804. },
  13805. {
  13806. "type": "null"
  13807. }
  13808. ]
  13809. },
  13810. "updated": {
  13811. "anyOf": [
  13812. {
  13813. "type": "integer",
  13814. "minimum": 0
  13815. },
  13816. {
  13817. "type": "null"
  13818. }
  13819. ]
  13820. },
  13821. "compacting": {
  13822. "anyOf": [
  13823. {
  13824. "type": "integer",
  13825. "minimum": 0
  13826. },
  13827. {
  13828. "type": "null"
  13829. }
  13830. ]
  13831. },
  13832. "archived": {
  13833. "anyOf": [
  13834. {
  13835. "type": "number"
  13836. },
  13837. {
  13838. "type": "null"
  13839. }
  13840. ]
  13841. }
  13842. },
  13843. "additionalProperties": false
  13844. },
  13845. "permission": {
  13846. "anyOf": [
  13847. {
  13848. "$ref": "#/components/schemas/PermissionRuleset"
  13849. },
  13850. {
  13851. "type": "null"
  13852. }
  13853. ]
  13854. },
  13855. "revert": {
  13856. "anyOf": [
  13857. {
  13858. "type": "object",
  13859. "properties": {
  13860. "messageID": {
  13861. "type": "string"
  13862. },
  13863. "partID": {
  13864. "type": "string"
  13865. },
  13866. "snapshot": {
  13867. "type": "string"
  13868. },
  13869. "diff": {
  13870. "type": "string"
  13871. }
  13872. },
  13873. "required": ["messageID"],
  13874. "additionalProperties": false
  13875. },
  13876. {
  13877. "type": "null"
  13878. }
  13879. ]
  13880. }
  13881. },
  13882. "additionalProperties": false
  13883. }
  13884. },
  13885. "required": ["sessionID", "info"],
  13886. "additionalProperties": false
  13887. }
  13888. },
  13889. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  13890. "additionalProperties": false
  13891. },
  13892. "SyncEventSessionDeleted": {
  13893. "type": "object",
  13894. "properties": {
  13895. "type": {
  13896. "type": "string",
  13897. "enum": ["sync"]
  13898. },
  13899. "name": {
  13900. "type": "string",
  13901. "enum": ["session.deleted.1"]
  13902. },
  13903. "id": {
  13904. "type": "string"
  13905. },
  13906. "seq": {
  13907. "type": "number"
  13908. },
  13909. "aggregateID": {
  13910. "type": "string",
  13911. "enum": ["sessionID"]
  13912. },
  13913. "data": {
  13914. "type": "object",
  13915. "properties": {
  13916. "sessionID": {
  13917. "type": "string"
  13918. },
  13919. "info": {
  13920. "$ref": "#/components/schemas/Session"
  13921. }
  13922. },
  13923. "required": ["sessionID", "info"],
  13924. "additionalProperties": false
  13925. }
  13926. },
  13927. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  13928. "additionalProperties": false
  13929. },
  13930. "SyncEventSessionNextAgentSwitched": {
  13931. "type": "object",
  13932. "properties": {
  13933. "type": {
  13934. "type": "string",
  13935. "enum": ["sync"]
  13936. },
  13937. "name": {
  13938. "type": "string",
  13939. "enum": ["session.next.agent.switched.1"]
  13940. },
  13941. "id": {
  13942. "type": "string"
  13943. },
  13944. "seq": {
  13945. "type": "number"
  13946. },
  13947. "aggregateID": {
  13948. "type": "string",
  13949. "enum": ["sessionID"]
  13950. },
  13951. "data": {
  13952. "type": "object",
  13953. "properties": {
  13954. "timestamp": {
  13955. "type": "number"
  13956. },
  13957. "sessionID": {
  13958. "type": "string"
  13959. },
  13960. "agent": {
  13961. "type": "string"
  13962. }
  13963. },
  13964. "required": ["timestamp", "sessionID", "agent"],
  13965. "additionalProperties": false
  13966. }
  13967. },
  13968. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  13969. "additionalProperties": false
  13970. },
  13971. "SyncEventSessionNextModelSwitched": {
  13972. "type": "object",
  13973. "properties": {
  13974. "type": {
  13975. "type": "string",
  13976. "enum": ["sync"]
  13977. },
  13978. "name": {
  13979. "type": "string",
  13980. "enum": ["session.next.model.switched.1"]
  13981. },
  13982. "id": {
  13983. "type": "string"
  13984. },
  13985. "seq": {
  13986. "type": "number"
  13987. },
  13988. "aggregateID": {
  13989. "type": "string",
  13990. "enum": ["sessionID"]
  13991. },
  13992. "data": {
  13993. "type": "object",
  13994. "properties": {
  13995. "timestamp": {
  13996. "type": "number"
  13997. },
  13998. "sessionID": {
  13999. "type": "string"
  14000. },
  14001. "model": {
  14002. "type": "object",
  14003. "properties": {
  14004. "id": {
  14005. "type": "string"
  14006. },
  14007. "providerID": {
  14008. "type": "string"
  14009. },
  14010. "variant": {
  14011. "type": "string"
  14012. }
  14013. },
  14014. "required": ["id", "providerID", "variant"],
  14015. "additionalProperties": false
  14016. }
  14017. },
  14018. "required": ["timestamp", "sessionID", "model"],
  14019. "additionalProperties": false
  14020. }
  14021. },
  14022. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14023. "additionalProperties": false
  14024. },
  14025. "SyncEventSessionNextPrompted": {
  14026. "type": "object",
  14027. "properties": {
  14028. "type": {
  14029. "type": "string",
  14030. "enum": ["sync"]
  14031. },
  14032. "name": {
  14033. "type": "string",
  14034. "enum": ["session.next.prompted.1"]
  14035. },
  14036. "id": {
  14037. "type": "string"
  14038. },
  14039. "seq": {
  14040. "type": "number"
  14041. },
  14042. "aggregateID": {
  14043. "type": "string",
  14044. "enum": ["sessionID"]
  14045. },
  14046. "data": {
  14047. "type": "object",
  14048. "properties": {
  14049. "timestamp": {
  14050. "type": "number"
  14051. },
  14052. "sessionID": {
  14053. "type": "string"
  14054. },
  14055. "prompt": {
  14056. "$ref": "#/components/schemas/Prompt"
  14057. }
  14058. },
  14059. "required": ["timestamp", "sessionID", "prompt"],
  14060. "additionalProperties": false
  14061. }
  14062. },
  14063. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14064. "additionalProperties": false
  14065. },
  14066. "SyncEventSessionNextSynthetic": {
  14067. "type": "object",
  14068. "properties": {
  14069. "type": {
  14070. "type": "string",
  14071. "enum": ["sync"]
  14072. },
  14073. "name": {
  14074. "type": "string",
  14075. "enum": ["session.next.synthetic.1"]
  14076. },
  14077. "id": {
  14078. "type": "string"
  14079. },
  14080. "seq": {
  14081. "type": "number"
  14082. },
  14083. "aggregateID": {
  14084. "type": "string",
  14085. "enum": ["sessionID"]
  14086. },
  14087. "data": {
  14088. "type": "object",
  14089. "properties": {
  14090. "timestamp": {
  14091. "type": "number"
  14092. },
  14093. "sessionID": {
  14094. "type": "string"
  14095. },
  14096. "text": {
  14097. "type": "string"
  14098. }
  14099. },
  14100. "required": ["timestamp", "sessionID", "text"],
  14101. "additionalProperties": false
  14102. }
  14103. },
  14104. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14105. "additionalProperties": false
  14106. },
  14107. "SyncEventSessionNextShellStarted": {
  14108. "type": "object",
  14109. "properties": {
  14110. "type": {
  14111. "type": "string",
  14112. "enum": ["sync"]
  14113. },
  14114. "name": {
  14115. "type": "string",
  14116. "enum": ["session.next.shell.started.1"]
  14117. },
  14118. "id": {
  14119. "type": "string"
  14120. },
  14121. "seq": {
  14122. "type": "number"
  14123. },
  14124. "aggregateID": {
  14125. "type": "string",
  14126. "enum": ["sessionID"]
  14127. },
  14128. "data": {
  14129. "type": "object",
  14130. "properties": {
  14131. "timestamp": {
  14132. "type": "number"
  14133. },
  14134. "sessionID": {
  14135. "type": "string"
  14136. },
  14137. "callID": {
  14138. "type": "string"
  14139. },
  14140. "command": {
  14141. "type": "string"
  14142. }
  14143. },
  14144. "required": ["timestamp", "sessionID", "callID", "command"],
  14145. "additionalProperties": false
  14146. }
  14147. },
  14148. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14149. "additionalProperties": false
  14150. },
  14151. "SyncEventSessionNextShellEnded": {
  14152. "type": "object",
  14153. "properties": {
  14154. "type": {
  14155. "type": "string",
  14156. "enum": ["sync"]
  14157. },
  14158. "name": {
  14159. "type": "string",
  14160. "enum": ["session.next.shell.ended.1"]
  14161. },
  14162. "id": {
  14163. "type": "string"
  14164. },
  14165. "seq": {
  14166. "type": "number"
  14167. },
  14168. "aggregateID": {
  14169. "type": "string",
  14170. "enum": ["sessionID"]
  14171. },
  14172. "data": {
  14173. "type": "object",
  14174. "properties": {
  14175. "timestamp": {
  14176. "type": "number"
  14177. },
  14178. "sessionID": {
  14179. "type": "string"
  14180. },
  14181. "callID": {
  14182. "type": "string"
  14183. },
  14184. "output": {
  14185. "type": "string"
  14186. }
  14187. },
  14188. "required": ["timestamp", "sessionID", "callID", "output"],
  14189. "additionalProperties": false
  14190. }
  14191. },
  14192. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14193. "additionalProperties": false
  14194. },
  14195. "SyncEventSessionNextStepStarted": {
  14196. "type": "object",
  14197. "properties": {
  14198. "type": {
  14199. "type": "string",
  14200. "enum": ["sync"]
  14201. },
  14202. "name": {
  14203. "type": "string",
  14204. "enum": ["session.next.step.started.1"]
  14205. },
  14206. "id": {
  14207. "type": "string"
  14208. },
  14209. "seq": {
  14210. "type": "number"
  14211. },
  14212. "aggregateID": {
  14213. "type": "string",
  14214. "enum": ["sessionID"]
  14215. },
  14216. "data": {
  14217. "type": "object",
  14218. "properties": {
  14219. "timestamp": {
  14220. "type": "number"
  14221. },
  14222. "sessionID": {
  14223. "type": "string"
  14224. },
  14225. "agent": {
  14226. "type": "string"
  14227. },
  14228. "model": {
  14229. "type": "object",
  14230. "properties": {
  14231. "id": {
  14232. "type": "string"
  14233. },
  14234. "providerID": {
  14235. "type": "string"
  14236. },
  14237. "variant": {
  14238. "type": "string"
  14239. }
  14240. },
  14241. "required": ["id", "providerID", "variant"],
  14242. "additionalProperties": false
  14243. },
  14244. "snapshot": {
  14245. "type": "string"
  14246. }
  14247. },
  14248. "required": ["timestamp", "sessionID", "agent", "model"],
  14249. "additionalProperties": false
  14250. }
  14251. },
  14252. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14253. "additionalProperties": false
  14254. },
  14255. "SyncEventSessionNextStepEnded": {
  14256. "type": "object",
  14257. "properties": {
  14258. "type": {
  14259. "type": "string",
  14260. "enum": ["sync"]
  14261. },
  14262. "name": {
  14263. "type": "string",
  14264. "enum": ["session.next.step.ended.1"]
  14265. },
  14266. "id": {
  14267. "type": "string"
  14268. },
  14269. "seq": {
  14270. "type": "number"
  14271. },
  14272. "aggregateID": {
  14273. "type": "string",
  14274. "enum": ["sessionID"]
  14275. },
  14276. "data": {
  14277. "type": "object",
  14278. "properties": {
  14279. "timestamp": {
  14280. "type": "number"
  14281. },
  14282. "sessionID": {
  14283. "type": "string"
  14284. },
  14285. "finish": {
  14286. "type": "string"
  14287. },
  14288. "cost": {
  14289. "type": "number"
  14290. },
  14291. "tokens": {
  14292. "type": "object",
  14293. "properties": {
  14294. "input": {
  14295. "type": "integer",
  14296. "minimum": 0
  14297. },
  14298. "output": {
  14299. "type": "integer",
  14300. "minimum": 0
  14301. },
  14302. "reasoning": {
  14303. "type": "integer",
  14304. "minimum": 0
  14305. },
  14306. "cache": {
  14307. "type": "object",
  14308. "properties": {
  14309. "read": {
  14310. "type": "integer",
  14311. "minimum": 0
  14312. },
  14313. "write": {
  14314. "type": "integer",
  14315. "minimum": 0
  14316. }
  14317. },
  14318. "required": ["read", "write"],
  14319. "additionalProperties": false
  14320. }
  14321. },
  14322. "required": ["input", "output", "reasoning", "cache"],
  14323. "additionalProperties": false
  14324. },
  14325. "snapshot": {
  14326. "type": "string"
  14327. }
  14328. },
  14329. "required": ["timestamp", "sessionID", "finish", "cost", "tokens"],
  14330. "additionalProperties": false
  14331. }
  14332. },
  14333. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14334. "additionalProperties": false
  14335. },
  14336. "SyncEventSessionNextStepFailed": {
  14337. "type": "object",
  14338. "properties": {
  14339. "type": {
  14340. "type": "string",
  14341. "enum": ["sync"]
  14342. },
  14343. "name": {
  14344. "type": "string",
  14345. "enum": ["session.next.step.failed.1"]
  14346. },
  14347. "id": {
  14348. "type": "string"
  14349. },
  14350. "seq": {
  14351. "type": "number"
  14352. },
  14353. "aggregateID": {
  14354. "type": "string",
  14355. "enum": ["sessionID"]
  14356. },
  14357. "data": {
  14358. "type": "object",
  14359. "properties": {
  14360. "timestamp": {
  14361. "type": "number"
  14362. },
  14363. "sessionID": {
  14364. "type": "string"
  14365. },
  14366. "error": {
  14367. "$ref": "#/components/schemas/SessionErrorUnknown"
  14368. }
  14369. },
  14370. "required": ["timestamp", "sessionID", "error"],
  14371. "additionalProperties": false
  14372. }
  14373. },
  14374. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14375. "additionalProperties": false
  14376. },
  14377. "SyncEventSessionNextTextStarted": {
  14378. "type": "object",
  14379. "properties": {
  14380. "type": {
  14381. "type": "string",
  14382. "enum": ["sync"]
  14383. },
  14384. "name": {
  14385. "type": "string",
  14386. "enum": ["session.next.text.started.1"]
  14387. },
  14388. "id": {
  14389. "type": "string"
  14390. },
  14391. "seq": {
  14392. "type": "number"
  14393. },
  14394. "aggregateID": {
  14395. "type": "string",
  14396. "enum": ["sessionID"]
  14397. },
  14398. "data": {
  14399. "type": "object",
  14400. "properties": {
  14401. "timestamp": {
  14402. "type": "number"
  14403. },
  14404. "sessionID": {
  14405. "type": "string"
  14406. }
  14407. },
  14408. "required": ["timestamp", "sessionID"],
  14409. "additionalProperties": false
  14410. }
  14411. },
  14412. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14413. "additionalProperties": false
  14414. },
  14415. "SyncEventSessionNextTextDelta": {
  14416. "type": "object",
  14417. "properties": {
  14418. "type": {
  14419. "type": "string",
  14420. "enum": ["sync"]
  14421. },
  14422. "name": {
  14423. "type": "string",
  14424. "enum": ["session.next.text.delta.1"]
  14425. },
  14426. "id": {
  14427. "type": "string"
  14428. },
  14429. "seq": {
  14430. "type": "number"
  14431. },
  14432. "aggregateID": {
  14433. "type": "string",
  14434. "enum": ["sessionID"]
  14435. },
  14436. "data": {
  14437. "type": "object",
  14438. "properties": {
  14439. "timestamp": {
  14440. "type": "number"
  14441. },
  14442. "sessionID": {
  14443. "type": "string"
  14444. },
  14445. "delta": {
  14446. "type": "string"
  14447. }
  14448. },
  14449. "required": ["timestamp", "sessionID", "delta"],
  14450. "additionalProperties": false
  14451. }
  14452. },
  14453. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14454. "additionalProperties": false
  14455. },
  14456. "SyncEventSessionNextTextEnded": {
  14457. "type": "object",
  14458. "properties": {
  14459. "type": {
  14460. "type": "string",
  14461. "enum": ["sync"]
  14462. },
  14463. "name": {
  14464. "type": "string",
  14465. "enum": ["session.next.text.ended.1"]
  14466. },
  14467. "id": {
  14468. "type": "string"
  14469. },
  14470. "seq": {
  14471. "type": "number"
  14472. },
  14473. "aggregateID": {
  14474. "type": "string",
  14475. "enum": ["sessionID"]
  14476. },
  14477. "data": {
  14478. "type": "object",
  14479. "properties": {
  14480. "timestamp": {
  14481. "type": "number"
  14482. },
  14483. "sessionID": {
  14484. "type": "string"
  14485. },
  14486. "text": {
  14487. "type": "string"
  14488. }
  14489. },
  14490. "required": ["timestamp", "sessionID", "text"],
  14491. "additionalProperties": false
  14492. }
  14493. },
  14494. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14495. "additionalProperties": false
  14496. },
  14497. "SyncEventSessionNextReasoningStarted": {
  14498. "type": "object",
  14499. "properties": {
  14500. "type": {
  14501. "type": "string",
  14502. "enum": ["sync"]
  14503. },
  14504. "name": {
  14505. "type": "string",
  14506. "enum": ["session.next.reasoning.started.1"]
  14507. },
  14508. "id": {
  14509. "type": "string"
  14510. },
  14511. "seq": {
  14512. "type": "number"
  14513. },
  14514. "aggregateID": {
  14515. "type": "string",
  14516. "enum": ["sessionID"]
  14517. },
  14518. "data": {
  14519. "type": "object",
  14520. "properties": {
  14521. "timestamp": {
  14522. "type": "number"
  14523. },
  14524. "sessionID": {
  14525. "type": "string"
  14526. },
  14527. "reasoningID": {
  14528. "type": "string"
  14529. }
  14530. },
  14531. "required": ["timestamp", "sessionID", "reasoningID"],
  14532. "additionalProperties": false
  14533. }
  14534. },
  14535. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14536. "additionalProperties": false
  14537. },
  14538. "SyncEventSessionNextReasoningDelta": {
  14539. "type": "object",
  14540. "properties": {
  14541. "type": {
  14542. "type": "string",
  14543. "enum": ["sync"]
  14544. },
  14545. "name": {
  14546. "type": "string",
  14547. "enum": ["session.next.reasoning.delta.1"]
  14548. },
  14549. "id": {
  14550. "type": "string"
  14551. },
  14552. "seq": {
  14553. "type": "number"
  14554. },
  14555. "aggregateID": {
  14556. "type": "string",
  14557. "enum": ["sessionID"]
  14558. },
  14559. "data": {
  14560. "type": "object",
  14561. "properties": {
  14562. "timestamp": {
  14563. "type": "number"
  14564. },
  14565. "sessionID": {
  14566. "type": "string"
  14567. },
  14568. "reasoningID": {
  14569. "type": "string"
  14570. },
  14571. "delta": {
  14572. "type": "string"
  14573. }
  14574. },
  14575. "required": ["timestamp", "sessionID", "reasoningID", "delta"],
  14576. "additionalProperties": false
  14577. }
  14578. },
  14579. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14580. "additionalProperties": false
  14581. },
  14582. "SyncEventSessionNextReasoningEnded": {
  14583. "type": "object",
  14584. "properties": {
  14585. "type": {
  14586. "type": "string",
  14587. "enum": ["sync"]
  14588. },
  14589. "name": {
  14590. "type": "string",
  14591. "enum": ["session.next.reasoning.ended.1"]
  14592. },
  14593. "id": {
  14594. "type": "string"
  14595. },
  14596. "seq": {
  14597. "type": "number"
  14598. },
  14599. "aggregateID": {
  14600. "type": "string",
  14601. "enum": ["sessionID"]
  14602. },
  14603. "data": {
  14604. "type": "object",
  14605. "properties": {
  14606. "timestamp": {
  14607. "type": "number"
  14608. },
  14609. "sessionID": {
  14610. "type": "string"
  14611. },
  14612. "reasoningID": {
  14613. "type": "string"
  14614. },
  14615. "text": {
  14616. "type": "string"
  14617. }
  14618. },
  14619. "required": ["timestamp", "sessionID", "reasoningID", "text"],
  14620. "additionalProperties": false
  14621. }
  14622. },
  14623. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14624. "additionalProperties": false
  14625. },
  14626. "SyncEventSessionNextToolInputStarted": {
  14627. "type": "object",
  14628. "properties": {
  14629. "type": {
  14630. "type": "string",
  14631. "enum": ["sync"]
  14632. },
  14633. "name": {
  14634. "type": "string",
  14635. "enum": ["session.next.tool.input.started.1"]
  14636. },
  14637. "id": {
  14638. "type": "string"
  14639. },
  14640. "seq": {
  14641. "type": "number"
  14642. },
  14643. "aggregateID": {
  14644. "type": "string",
  14645. "enum": ["sessionID"]
  14646. },
  14647. "data": {
  14648. "type": "object",
  14649. "properties": {
  14650. "timestamp": {
  14651. "type": "number"
  14652. },
  14653. "sessionID": {
  14654. "type": "string"
  14655. },
  14656. "callID": {
  14657. "type": "string"
  14658. },
  14659. "name": {
  14660. "type": "string"
  14661. }
  14662. },
  14663. "required": ["timestamp", "sessionID", "callID", "name"],
  14664. "additionalProperties": false
  14665. }
  14666. },
  14667. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14668. "additionalProperties": false
  14669. },
  14670. "SyncEventSessionNextToolInputDelta": {
  14671. "type": "object",
  14672. "properties": {
  14673. "type": {
  14674. "type": "string",
  14675. "enum": ["sync"]
  14676. },
  14677. "name": {
  14678. "type": "string",
  14679. "enum": ["session.next.tool.input.delta.1"]
  14680. },
  14681. "id": {
  14682. "type": "string"
  14683. },
  14684. "seq": {
  14685. "type": "number"
  14686. },
  14687. "aggregateID": {
  14688. "type": "string",
  14689. "enum": ["sessionID"]
  14690. },
  14691. "data": {
  14692. "type": "object",
  14693. "properties": {
  14694. "timestamp": {
  14695. "type": "number"
  14696. },
  14697. "sessionID": {
  14698. "type": "string"
  14699. },
  14700. "callID": {
  14701. "type": "string"
  14702. },
  14703. "delta": {
  14704. "type": "string"
  14705. }
  14706. },
  14707. "required": ["timestamp", "sessionID", "callID", "delta"],
  14708. "additionalProperties": false
  14709. }
  14710. },
  14711. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14712. "additionalProperties": false
  14713. },
  14714. "SyncEventSessionNextToolInputEnded": {
  14715. "type": "object",
  14716. "properties": {
  14717. "type": {
  14718. "type": "string",
  14719. "enum": ["sync"]
  14720. },
  14721. "name": {
  14722. "type": "string",
  14723. "enum": ["session.next.tool.input.ended.1"]
  14724. },
  14725. "id": {
  14726. "type": "string"
  14727. },
  14728. "seq": {
  14729. "type": "number"
  14730. },
  14731. "aggregateID": {
  14732. "type": "string",
  14733. "enum": ["sessionID"]
  14734. },
  14735. "data": {
  14736. "type": "object",
  14737. "properties": {
  14738. "timestamp": {
  14739. "type": "number"
  14740. },
  14741. "sessionID": {
  14742. "type": "string"
  14743. },
  14744. "callID": {
  14745. "type": "string"
  14746. },
  14747. "text": {
  14748. "type": "string"
  14749. }
  14750. },
  14751. "required": ["timestamp", "sessionID", "callID", "text"],
  14752. "additionalProperties": false
  14753. }
  14754. },
  14755. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14756. "additionalProperties": false
  14757. },
  14758. "SyncEventSessionNextToolCalled": {
  14759. "type": "object",
  14760. "properties": {
  14761. "type": {
  14762. "type": "string",
  14763. "enum": ["sync"]
  14764. },
  14765. "name": {
  14766. "type": "string",
  14767. "enum": ["session.next.tool.called.1"]
  14768. },
  14769. "id": {
  14770. "type": "string"
  14771. },
  14772. "seq": {
  14773. "type": "number"
  14774. },
  14775. "aggregateID": {
  14776. "type": "string",
  14777. "enum": ["sessionID"]
  14778. },
  14779. "data": {
  14780. "type": "object",
  14781. "properties": {
  14782. "timestamp": {
  14783. "type": "number"
  14784. },
  14785. "sessionID": {
  14786. "type": "string"
  14787. },
  14788. "callID": {
  14789. "type": "string"
  14790. },
  14791. "tool": {
  14792. "type": "string"
  14793. },
  14794. "input": {
  14795. "type": "object"
  14796. },
  14797. "provider": {
  14798. "type": "object",
  14799. "properties": {
  14800. "executed": {
  14801. "type": "boolean"
  14802. },
  14803. "metadata": {
  14804. "type": "object"
  14805. }
  14806. },
  14807. "required": ["executed"],
  14808. "additionalProperties": false
  14809. }
  14810. },
  14811. "required": ["timestamp", "sessionID", "callID", "tool", "input", "provider"],
  14812. "additionalProperties": false
  14813. }
  14814. },
  14815. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14816. "additionalProperties": false
  14817. },
  14818. "SyncEventSessionNextToolProgress": {
  14819. "type": "object",
  14820. "properties": {
  14821. "type": {
  14822. "type": "string",
  14823. "enum": ["sync"]
  14824. },
  14825. "name": {
  14826. "type": "string",
  14827. "enum": ["session.next.tool.progress.1"]
  14828. },
  14829. "id": {
  14830. "type": "string"
  14831. },
  14832. "seq": {
  14833. "type": "number"
  14834. },
  14835. "aggregateID": {
  14836. "type": "string",
  14837. "enum": ["sessionID"]
  14838. },
  14839. "data": {
  14840. "type": "object",
  14841. "properties": {
  14842. "timestamp": {
  14843. "type": "number"
  14844. },
  14845. "sessionID": {
  14846. "type": "string"
  14847. },
  14848. "callID": {
  14849. "type": "string"
  14850. },
  14851. "structured": {
  14852. "type": "object"
  14853. },
  14854. "content": {
  14855. "type": "array",
  14856. "items": {
  14857. "anyOf": [
  14858. {
  14859. "$ref": "#/components/schemas/ToolTextContent"
  14860. },
  14861. {
  14862. "$ref": "#/components/schemas/ToolFileContent"
  14863. }
  14864. ]
  14865. }
  14866. }
  14867. },
  14868. "required": ["timestamp", "sessionID", "callID", "structured", "content"],
  14869. "additionalProperties": false
  14870. }
  14871. },
  14872. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14873. "additionalProperties": false
  14874. },
  14875. "SyncEventSessionNextToolSuccess": {
  14876. "type": "object",
  14877. "properties": {
  14878. "type": {
  14879. "type": "string",
  14880. "enum": ["sync"]
  14881. },
  14882. "name": {
  14883. "type": "string",
  14884. "enum": ["session.next.tool.success.1"]
  14885. },
  14886. "id": {
  14887. "type": "string"
  14888. },
  14889. "seq": {
  14890. "type": "number"
  14891. },
  14892. "aggregateID": {
  14893. "type": "string",
  14894. "enum": ["sessionID"]
  14895. },
  14896. "data": {
  14897. "type": "object",
  14898. "properties": {
  14899. "timestamp": {
  14900. "type": "number"
  14901. },
  14902. "sessionID": {
  14903. "type": "string"
  14904. },
  14905. "callID": {
  14906. "type": "string"
  14907. },
  14908. "structured": {
  14909. "type": "object"
  14910. },
  14911. "content": {
  14912. "type": "array",
  14913. "items": {
  14914. "anyOf": [
  14915. {
  14916. "$ref": "#/components/schemas/ToolTextContent"
  14917. },
  14918. {
  14919. "$ref": "#/components/schemas/ToolFileContent"
  14920. }
  14921. ]
  14922. }
  14923. },
  14924. "provider": {
  14925. "type": "object",
  14926. "properties": {
  14927. "executed": {
  14928. "type": "boolean"
  14929. },
  14930. "metadata": {
  14931. "type": "object"
  14932. }
  14933. },
  14934. "required": ["executed"],
  14935. "additionalProperties": false
  14936. }
  14937. },
  14938. "required": ["timestamp", "sessionID", "callID", "structured", "content", "provider"],
  14939. "additionalProperties": false
  14940. }
  14941. },
  14942. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14943. "additionalProperties": false
  14944. },
  14945. "SyncEventSessionNextToolFailed": {
  14946. "type": "object",
  14947. "properties": {
  14948. "type": {
  14949. "type": "string",
  14950. "enum": ["sync"]
  14951. },
  14952. "name": {
  14953. "type": "string",
  14954. "enum": ["session.next.tool.failed.1"]
  14955. },
  14956. "id": {
  14957. "type": "string"
  14958. },
  14959. "seq": {
  14960. "type": "number"
  14961. },
  14962. "aggregateID": {
  14963. "type": "string",
  14964. "enum": ["sessionID"]
  14965. },
  14966. "data": {
  14967. "type": "object",
  14968. "properties": {
  14969. "timestamp": {
  14970. "type": "number"
  14971. },
  14972. "sessionID": {
  14973. "type": "string"
  14974. },
  14975. "callID": {
  14976. "type": "string"
  14977. },
  14978. "error": {
  14979. "$ref": "#/components/schemas/SessionErrorUnknown"
  14980. },
  14981. "provider": {
  14982. "type": "object",
  14983. "properties": {
  14984. "executed": {
  14985. "type": "boolean"
  14986. },
  14987. "metadata": {
  14988. "type": "object"
  14989. }
  14990. },
  14991. "required": ["executed"],
  14992. "additionalProperties": false
  14993. }
  14994. },
  14995. "required": ["timestamp", "sessionID", "callID", "error", "provider"],
  14996. "additionalProperties": false
  14997. }
  14998. },
  14999. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15000. "additionalProperties": false
  15001. },
  15002. "SyncEventSessionNextRetried": {
  15003. "type": "object",
  15004. "properties": {
  15005. "type": {
  15006. "type": "string",
  15007. "enum": ["sync"]
  15008. },
  15009. "name": {
  15010. "type": "string",
  15011. "enum": ["session.next.retried.1"]
  15012. },
  15013. "id": {
  15014. "type": "string"
  15015. },
  15016. "seq": {
  15017. "type": "number"
  15018. },
  15019. "aggregateID": {
  15020. "type": "string",
  15021. "enum": ["sessionID"]
  15022. },
  15023. "data": {
  15024. "type": "object",
  15025. "properties": {
  15026. "timestamp": {
  15027. "type": "number"
  15028. },
  15029. "sessionID": {
  15030. "type": "string"
  15031. },
  15032. "attempt": {
  15033. "type": "integer",
  15034. "minimum": 0
  15035. },
  15036. "error": {
  15037. "$ref": "#/components/schemas/SessionNextRetry_error"
  15038. }
  15039. },
  15040. "required": ["timestamp", "sessionID", "attempt", "error"],
  15041. "additionalProperties": false
  15042. }
  15043. },
  15044. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15045. "additionalProperties": false
  15046. },
  15047. "SyncEventSessionNextCompactionStarted": {
  15048. "type": "object",
  15049. "properties": {
  15050. "type": {
  15051. "type": "string",
  15052. "enum": ["sync"]
  15053. },
  15054. "name": {
  15055. "type": "string",
  15056. "enum": ["session.next.compaction.started.1"]
  15057. },
  15058. "id": {
  15059. "type": "string"
  15060. },
  15061. "seq": {
  15062. "type": "number"
  15063. },
  15064. "aggregateID": {
  15065. "type": "string",
  15066. "enum": ["sessionID"]
  15067. },
  15068. "data": {
  15069. "type": "object",
  15070. "properties": {
  15071. "timestamp": {
  15072. "type": "number"
  15073. },
  15074. "sessionID": {
  15075. "type": "string"
  15076. },
  15077. "reason": {
  15078. "type": "string",
  15079. "enum": ["auto", "manual"]
  15080. }
  15081. },
  15082. "required": ["timestamp", "sessionID", "reason"],
  15083. "additionalProperties": false
  15084. }
  15085. },
  15086. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15087. "additionalProperties": false
  15088. },
  15089. "SyncEventSessionNextCompactionDelta": {
  15090. "type": "object",
  15091. "properties": {
  15092. "type": {
  15093. "type": "string",
  15094. "enum": ["sync"]
  15095. },
  15096. "name": {
  15097. "type": "string",
  15098. "enum": ["session.next.compaction.delta.1"]
  15099. },
  15100. "id": {
  15101. "type": "string"
  15102. },
  15103. "seq": {
  15104. "type": "number"
  15105. },
  15106. "aggregateID": {
  15107. "type": "string",
  15108. "enum": ["sessionID"]
  15109. },
  15110. "data": {
  15111. "type": "object",
  15112. "properties": {
  15113. "timestamp": {
  15114. "type": "number"
  15115. },
  15116. "sessionID": {
  15117. "type": "string"
  15118. },
  15119. "text": {
  15120. "type": "string"
  15121. }
  15122. },
  15123. "required": ["timestamp", "sessionID", "text"],
  15124. "additionalProperties": false
  15125. }
  15126. },
  15127. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15128. "additionalProperties": false
  15129. },
  15130. "SyncEventSessionNextCompactionEnded": {
  15131. "type": "object",
  15132. "properties": {
  15133. "type": {
  15134. "type": "string",
  15135. "enum": ["sync"]
  15136. },
  15137. "name": {
  15138. "type": "string",
  15139. "enum": ["session.next.compaction.ended.1"]
  15140. },
  15141. "id": {
  15142. "type": "string"
  15143. },
  15144. "seq": {
  15145. "type": "number"
  15146. },
  15147. "aggregateID": {
  15148. "type": "string",
  15149. "enum": ["sessionID"]
  15150. },
  15151. "data": {
  15152. "type": "object",
  15153. "properties": {
  15154. "timestamp": {
  15155. "type": "number"
  15156. },
  15157. "sessionID": {
  15158. "type": "string"
  15159. },
  15160. "text": {
  15161. "type": "string"
  15162. },
  15163. "include": {
  15164. "type": "string"
  15165. }
  15166. },
  15167. "required": ["timestamp", "sessionID", "text"],
  15168. "additionalProperties": false
  15169. }
  15170. },
  15171. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15172. "additionalProperties": false
  15173. },
  15174. "EventServerInstanceDisposed": {
  15175. "type": "object",
  15176. "properties": {
  15177. "id": {
  15178. "type": "string"
  15179. },
  15180. "type": {
  15181. "type": "string",
  15182. "enum": ["server.instance.disposed"]
  15183. },
  15184. "properties": {
  15185. "type": "object",
  15186. "properties": {
  15187. "directory": {
  15188. "type": "string"
  15189. }
  15190. },
  15191. "required": ["directory"],
  15192. "additionalProperties": false
  15193. }
  15194. },
  15195. "required": ["id", "type", "properties"],
  15196. "additionalProperties": false
  15197. },
  15198. "EventFileEdited": {
  15199. "type": "object",
  15200. "properties": {
  15201. "id": {
  15202. "type": "string"
  15203. },
  15204. "type": {
  15205. "type": "string",
  15206. "enum": ["file.edited"]
  15207. },
  15208. "properties": {
  15209. "type": "object",
  15210. "properties": {
  15211. "file": {
  15212. "type": "string"
  15213. }
  15214. },
  15215. "required": ["file"],
  15216. "additionalProperties": false
  15217. }
  15218. },
  15219. "required": ["id", "type", "properties"],
  15220. "additionalProperties": false
  15221. },
  15222. "EventFileWatcherUpdated": {
  15223. "type": "object",
  15224. "properties": {
  15225. "id": {
  15226. "type": "string"
  15227. },
  15228. "type": {
  15229. "type": "string",
  15230. "enum": ["file.watcher.updated"]
  15231. },
  15232. "properties": {
  15233. "type": "object",
  15234. "properties": {
  15235. "file": {
  15236. "type": "string"
  15237. },
  15238. "event": {
  15239. "type": "string",
  15240. "enum": ["add", "change", "unlink"]
  15241. }
  15242. },
  15243. "required": ["file", "event"],
  15244. "additionalProperties": false
  15245. }
  15246. },
  15247. "required": ["id", "type", "properties"],
  15248. "additionalProperties": false
  15249. },
  15250. "EventLspClientDiagnostics": {
  15251. "type": "object",
  15252. "properties": {
  15253. "id": {
  15254. "type": "string"
  15255. },
  15256. "type": {
  15257. "type": "string",
  15258. "enum": ["lsp.client.diagnostics"]
  15259. },
  15260. "properties": {
  15261. "type": "object",
  15262. "properties": {
  15263. "serverID": {
  15264. "type": "string"
  15265. },
  15266. "path": {
  15267. "type": "string"
  15268. }
  15269. },
  15270. "required": ["serverID", "path"],
  15271. "additionalProperties": false
  15272. }
  15273. },
  15274. "required": ["id", "type", "properties"],
  15275. "additionalProperties": false
  15276. },
  15277. "EventLspUpdated": {
  15278. "type": "object",
  15279. "properties": {
  15280. "id": {
  15281. "type": "string"
  15282. },
  15283. "type": {
  15284. "type": "string",
  15285. "enum": ["lsp.updated"]
  15286. },
  15287. "properties": {
  15288. "type": "object",
  15289. "properties": {}
  15290. }
  15291. },
  15292. "required": ["id", "type", "properties"],
  15293. "additionalProperties": false
  15294. },
  15295. "EventMessagePartDelta": {
  15296. "type": "object",
  15297. "properties": {
  15298. "id": {
  15299. "type": "string"
  15300. },
  15301. "type": {
  15302. "type": "string",
  15303. "enum": ["message.part.delta"]
  15304. },
  15305. "properties": {
  15306. "type": "object",
  15307. "properties": {
  15308. "sessionID": {
  15309. "type": "string"
  15310. },
  15311. "messageID": {
  15312. "type": "string"
  15313. },
  15314. "partID": {
  15315. "type": "string"
  15316. },
  15317. "field": {
  15318. "type": "string"
  15319. },
  15320. "delta": {
  15321. "type": "string"
  15322. }
  15323. },
  15324. "required": ["sessionID", "messageID", "partID", "field", "delta"],
  15325. "additionalProperties": false
  15326. }
  15327. },
  15328. "required": ["id", "type", "properties"],
  15329. "additionalProperties": false
  15330. },
  15331. "EventPermissionAsked": {
  15332. "type": "object",
  15333. "properties": {
  15334. "id": {
  15335. "type": "string"
  15336. },
  15337. "type": {
  15338. "type": "string",
  15339. "enum": ["permission.asked"]
  15340. },
  15341. "properties": {
  15342. "$ref": "#/components/schemas/PermissionRequest"
  15343. }
  15344. },
  15345. "required": ["id", "type", "properties"],
  15346. "additionalProperties": false
  15347. },
  15348. "EventPermissionReplied": {
  15349. "type": "object",
  15350. "properties": {
  15351. "id": {
  15352. "type": "string"
  15353. },
  15354. "type": {
  15355. "type": "string",
  15356. "enum": ["permission.replied"]
  15357. },
  15358. "properties": {
  15359. "type": "object",
  15360. "properties": {
  15361. "sessionID": {
  15362. "type": "string"
  15363. },
  15364. "requestID": {
  15365. "type": "string"
  15366. },
  15367. "reply": {
  15368. "type": "string",
  15369. "enum": ["once", "always", "reject"]
  15370. }
  15371. },
  15372. "required": ["sessionID", "requestID", "reply"],
  15373. "additionalProperties": false
  15374. }
  15375. },
  15376. "required": ["id", "type", "properties"],
  15377. "additionalProperties": false
  15378. },
  15379. "EventSessionDiff": {
  15380. "type": "object",
  15381. "properties": {
  15382. "id": {
  15383. "type": "string"
  15384. },
  15385. "type": {
  15386. "type": "string",
  15387. "enum": ["session.diff"]
  15388. },
  15389. "properties": {
  15390. "type": "object",
  15391. "properties": {
  15392. "sessionID": {
  15393. "type": "string"
  15394. },
  15395. "diff": {
  15396. "type": "array",
  15397. "items": {
  15398. "$ref": "#/components/schemas/SnapshotFileDiff"
  15399. }
  15400. }
  15401. },
  15402. "required": ["sessionID", "diff"],
  15403. "additionalProperties": false
  15404. }
  15405. },
  15406. "required": ["id", "type", "properties"],
  15407. "additionalProperties": false
  15408. },
  15409. "EventSessionError": {
  15410. "type": "object",
  15411. "properties": {
  15412. "id": {
  15413. "type": "string"
  15414. },
  15415. "type": {
  15416. "type": "string",
  15417. "enum": ["session.error"]
  15418. },
  15419. "properties": {
  15420. "type": "object",
  15421. "properties": {
  15422. "sessionID": {
  15423. "type": "string"
  15424. },
  15425. "error": {
  15426. "anyOf": [
  15427. {
  15428. "$ref": "#/components/schemas/ProviderAuthError"
  15429. },
  15430. {
  15431. "$ref": "#/components/schemas/UnknownError"
  15432. },
  15433. {
  15434. "$ref": "#/components/schemas/MessageOutputLengthError"
  15435. },
  15436. {
  15437. "$ref": "#/components/schemas/MessageAbortedError"
  15438. },
  15439. {
  15440. "$ref": "#/components/schemas/StructuredOutputError"
  15441. },
  15442. {
  15443. "$ref": "#/components/schemas/ContextOverflowError"
  15444. },
  15445. {
  15446. "$ref": "#/components/schemas/APIError"
  15447. }
  15448. ]
  15449. }
  15450. },
  15451. "additionalProperties": false
  15452. }
  15453. },
  15454. "required": ["id", "type", "properties"],
  15455. "additionalProperties": false
  15456. },
  15457. "EventInstallationUpdated": {
  15458. "type": "object",
  15459. "properties": {
  15460. "id": {
  15461. "type": "string"
  15462. },
  15463. "type": {
  15464. "type": "string",
  15465. "enum": ["installation.updated"]
  15466. },
  15467. "properties": {
  15468. "type": "object",
  15469. "properties": {
  15470. "version": {
  15471. "type": "string"
  15472. }
  15473. },
  15474. "required": ["version"],
  15475. "additionalProperties": false
  15476. }
  15477. },
  15478. "required": ["id", "type", "properties"],
  15479. "additionalProperties": false
  15480. },
  15481. "EventInstallationUpdate-available": {
  15482. "type": "object",
  15483. "properties": {
  15484. "id": {
  15485. "type": "string"
  15486. },
  15487. "type": {
  15488. "type": "string",
  15489. "enum": ["installation.update-available"]
  15490. },
  15491. "properties": {
  15492. "type": "object",
  15493. "properties": {
  15494. "version": {
  15495. "type": "string"
  15496. }
  15497. },
  15498. "required": ["version"],
  15499. "additionalProperties": false
  15500. }
  15501. },
  15502. "required": ["id", "type", "properties"],
  15503. "additionalProperties": false
  15504. },
  15505. "EventQuestionAsked": {
  15506. "type": "object",
  15507. "properties": {
  15508. "id": {
  15509. "type": "string"
  15510. },
  15511. "type": {
  15512. "type": "string",
  15513. "enum": ["question.asked"]
  15514. },
  15515. "properties": {
  15516. "$ref": "#/components/schemas/QuestionRequest"
  15517. }
  15518. },
  15519. "required": ["id", "type", "properties"],
  15520. "additionalProperties": false
  15521. },
  15522. "EventQuestionReplied": {
  15523. "type": "object",
  15524. "properties": {
  15525. "id": {
  15526. "type": "string"
  15527. },
  15528. "type": {
  15529. "type": "string",
  15530. "enum": ["question.replied"]
  15531. },
  15532. "properties": {
  15533. "$ref": "#/components/schemas/QuestionReplied"
  15534. }
  15535. },
  15536. "required": ["id", "type", "properties"],
  15537. "additionalProperties": false
  15538. },
  15539. "EventQuestionRejected": {
  15540. "type": "object",
  15541. "properties": {
  15542. "id": {
  15543. "type": "string"
  15544. },
  15545. "type": {
  15546. "type": "string",
  15547. "enum": ["question.rejected"]
  15548. },
  15549. "properties": {
  15550. "$ref": "#/components/schemas/QuestionRejected"
  15551. }
  15552. },
  15553. "required": ["id", "type", "properties"],
  15554. "additionalProperties": false
  15555. },
  15556. "EventTodoUpdated": {
  15557. "type": "object",
  15558. "properties": {
  15559. "id": {
  15560. "type": "string"
  15561. },
  15562. "type": {
  15563. "type": "string",
  15564. "enum": ["todo.updated"]
  15565. },
  15566. "properties": {
  15567. "type": "object",
  15568. "properties": {
  15569. "sessionID": {
  15570. "type": "string"
  15571. },
  15572. "todos": {
  15573. "type": "array",
  15574. "items": {
  15575. "$ref": "#/components/schemas/Todo"
  15576. }
  15577. }
  15578. },
  15579. "required": ["sessionID", "todos"],
  15580. "additionalProperties": false
  15581. }
  15582. },
  15583. "required": ["id", "type", "properties"],
  15584. "additionalProperties": false
  15585. },
  15586. "EventSessionStatus": {
  15587. "type": "object",
  15588. "properties": {
  15589. "id": {
  15590. "type": "string"
  15591. },
  15592. "type": {
  15593. "type": "string",
  15594. "enum": ["session.status"]
  15595. },
  15596. "properties": {
  15597. "type": "object",
  15598. "properties": {
  15599. "sessionID": {
  15600. "type": "string"
  15601. },
  15602. "status": {
  15603. "$ref": "#/components/schemas/SessionStatus"
  15604. }
  15605. },
  15606. "required": ["sessionID", "status"],
  15607. "additionalProperties": false
  15608. }
  15609. },
  15610. "required": ["id", "type", "properties"],
  15611. "additionalProperties": false
  15612. },
  15613. "EventSessionIdle": {
  15614. "type": "object",
  15615. "properties": {
  15616. "id": {
  15617. "type": "string"
  15618. },
  15619. "type": {
  15620. "type": "string",
  15621. "enum": ["session.idle"]
  15622. },
  15623. "properties": {
  15624. "type": "object",
  15625. "properties": {
  15626. "sessionID": {
  15627. "type": "string"
  15628. }
  15629. },
  15630. "required": ["sessionID"],
  15631. "additionalProperties": false
  15632. }
  15633. },
  15634. "required": ["id", "type", "properties"],
  15635. "additionalProperties": false
  15636. },
  15637. "EventSessionCompacted": {
  15638. "type": "object",
  15639. "properties": {
  15640. "id": {
  15641. "type": "string"
  15642. },
  15643. "type": {
  15644. "type": "string",
  15645. "enum": ["session.compacted"]
  15646. },
  15647. "properties": {
  15648. "type": "object",
  15649. "properties": {
  15650. "sessionID": {
  15651. "type": "string"
  15652. }
  15653. },
  15654. "required": ["sessionID"],
  15655. "additionalProperties": false
  15656. }
  15657. },
  15658. "required": ["id", "type", "properties"],
  15659. "additionalProperties": false
  15660. },
  15661. "EventMcpToolsChanged": {
  15662. "type": "object",
  15663. "properties": {
  15664. "id": {
  15665. "type": "string"
  15666. },
  15667. "type": {
  15668. "type": "string",
  15669. "enum": ["mcp.tools.changed"]
  15670. },
  15671. "properties": {
  15672. "type": "object",
  15673. "properties": {
  15674. "server": {
  15675. "type": "string"
  15676. }
  15677. },
  15678. "required": ["server"],
  15679. "additionalProperties": false
  15680. }
  15681. },
  15682. "required": ["id", "type", "properties"],
  15683. "additionalProperties": false
  15684. },
  15685. "EventMcpBrowserOpenFailed": {
  15686. "type": "object",
  15687. "properties": {
  15688. "id": {
  15689. "type": "string"
  15690. },
  15691. "type": {
  15692. "type": "string",
  15693. "enum": ["mcp.browser.open.failed"]
  15694. },
  15695. "properties": {
  15696. "type": "object",
  15697. "properties": {
  15698. "mcpName": {
  15699. "type": "string"
  15700. },
  15701. "url": {
  15702. "type": "string"
  15703. }
  15704. },
  15705. "required": ["mcpName", "url"],
  15706. "additionalProperties": false
  15707. }
  15708. },
  15709. "required": ["id", "type", "properties"],
  15710. "additionalProperties": false
  15711. },
  15712. "EventCommandExecuted": {
  15713. "type": "object",
  15714. "properties": {
  15715. "id": {
  15716. "type": "string"
  15717. },
  15718. "type": {
  15719. "type": "string",
  15720. "enum": ["command.executed"]
  15721. },
  15722. "properties": {
  15723. "type": "object",
  15724. "properties": {
  15725. "name": {
  15726. "type": "string"
  15727. },
  15728. "sessionID": {
  15729. "type": "string"
  15730. },
  15731. "arguments": {
  15732. "type": "string"
  15733. },
  15734. "messageID": {
  15735. "type": "string"
  15736. }
  15737. },
  15738. "required": ["name", "sessionID", "arguments", "messageID"],
  15739. "additionalProperties": false
  15740. }
  15741. },
  15742. "required": ["id", "type", "properties"],
  15743. "additionalProperties": false
  15744. },
  15745. "EventProjectUpdated": {
  15746. "type": "object",
  15747. "properties": {
  15748. "id": {
  15749. "type": "string"
  15750. },
  15751. "type": {
  15752. "type": "string",
  15753. "enum": ["project.updated"]
  15754. },
  15755. "properties": {
  15756. "$ref": "#/components/schemas/Project"
  15757. }
  15758. },
  15759. "required": ["id", "type", "properties"],
  15760. "additionalProperties": false
  15761. },
  15762. "EventVcsBranchUpdated": {
  15763. "type": "object",
  15764. "properties": {
  15765. "id": {
  15766. "type": "string"
  15767. },
  15768. "type": {
  15769. "type": "string",
  15770. "enum": ["vcs.branch.updated"]
  15771. },
  15772. "properties": {
  15773. "type": "object",
  15774. "properties": {
  15775. "branch": {
  15776. "type": "string"
  15777. }
  15778. },
  15779. "additionalProperties": false
  15780. }
  15781. },
  15782. "required": ["id", "type", "properties"],
  15783. "additionalProperties": false
  15784. },
  15785. "EventWorkspaceReady": {
  15786. "type": "object",
  15787. "properties": {
  15788. "id": {
  15789. "type": "string"
  15790. },
  15791. "type": {
  15792. "type": "string",
  15793. "enum": ["workspace.ready"]
  15794. },
  15795. "properties": {
  15796. "type": "object",
  15797. "properties": {
  15798. "name": {
  15799. "type": "string"
  15800. }
  15801. },
  15802. "required": ["name"],
  15803. "additionalProperties": false
  15804. }
  15805. },
  15806. "required": ["id", "type", "properties"],
  15807. "additionalProperties": false
  15808. },
  15809. "EventWorkspaceFailed": {
  15810. "type": "object",
  15811. "properties": {
  15812. "id": {
  15813. "type": "string"
  15814. },
  15815. "type": {
  15816. "type": "string",
  15817. "enum": ["workspace.failed"]
  15818. },
  15819. "properties": {
  15820. "type": "object",
  15821. "properties": {
  15822. "message": {
  15823. "type": "string"
  15824. }
  15825. },
  15826. "required": ["message"],
  15827. "additionalProperties": false
  15828. }
  15829. },
  15830. "required": ["id", "type", "properties"],
  15831. "additionalProperties": false
  15832. },
  15833. "EventWorkspaceStatus": {
  15834. "type": "object",
  15835. "properties": {
  15836. "id": {
  15837. "type": "string"
  15838. },
  15839. "type": {
  15840. "type": "string",
  15841. "enum": ["workspace.status"]
  15842. },
  15843. "properties": {
  15844. "type": "object",
  15845. "properties": {
  15846. "workspaceID": {
  15847. "type": "string"
  15848. },
  15849. "status": {
  15850. "type": "string",
  15851. "enum": ["connected", "connecting", "disconnected", "error"]
  15852. }
  15853. },
  15854. "required": ["workspaceID", "status"],
  15855. "additionalProperties": false
  15856. }
  15857. },
  15858. "required": ["id", "type", "properties"],
  15859. "additionalProperties": false
  15860. },
  15861. "EventWorktreeReady": {
  15862. "type": "object",
  15863. "properties": {
  15864. "id": {
  15865. "type": "string"
  15866. },
  15867. "type": {
  15868. "type": "string",
  15869. "enum": ["worktree.ready"]
  15870. },
  15871. "properties": {
  15872. "type": "object",
  15873. "properties": {
  15874. "name": {
  15875. "type": "string"
  15876. },
  15877. "branch": {
  15878. "type": "string"
  15879. }
  15880. },
  15881. "required": ["name", "branch"],
  15882. "additionalProperties": false
  15883. }
  15884. },
  15885. "required": ["id", "type", "properties"],
  15886. "additionalProperties": false
  15887. },
  15888. "EventWorktreeFailed": {
  15889. "type": "object",
  15890. "properties": {
  15891. "id": {
  15892. "type": "string"
  15893. },
  15894. "type": {
  15895. "type": "string",
  15896. "enum": ["worktree.failed"]
  15897. },
  15898. "properties": {
  15899. "type": "object",
  15900. "properties": {
  15901. "message": {
  15902. "type": "string"
  15903. }
  15904. },
  15905. "required": ["message"],
  15906. "additionalProperties": false
  15907. }
  15908. },
  15909. "required": ["id", "type", "properties"],
  15910. "additionalProperties": false
  15911. },
  15912. "EventPtyCreated": {
  15913. "type": "object",
  15914. "properties": {
  15915. "id": {
  15916. "type": "string"
  15917. },
  15918. "type": {
  15919. "type": "string",
  15920. "enum": ["pty.created"]
  15921. },
  15922. "properties": {
  15923. "type": "object",
  15924. "properties": {
  15925. "info": {
  15926. "$ref": "#/components/schemas/Pty"
  15927. }
  15928. },
  15929. "required": ["info"],
  15930. "additionalProperties": false
  15931. }
  15932. },
  15933. "required": ["id", "type", "properties"],
  15934. "additionalProperties": false
  15935. },
  15936. "EventPtyUpdated": {
  15937. "type": "object",
  15938. "properties": {
  15939. "id": {
  15940. "type": "string"
  15941. },
  15942. "type": {
  15943. "type": "string",
  15944. "enum": ["pty.updated"]
  15945. },
  15946. "properties": {
  15947. "type": "object",
  15948. "properties": {
  15949. "info": {
  15950. "$ref": "#/components/schemas/Pty"
  15951. }
  15952. },
  15953. "required": ["info"],
  15954. "additionalProperties": false
  15955. }
  15956. },
  15957. "required": ["id", "type", "properties"],
  15958. "additionalProperties": false
  15959. },
  15960. "EventPtyExited": {
  15961. "type": "object",
  15962. "properties": {
  15963. "id": {
  15964. "type": "string"
  15965. },
  15966. "type": {
  15967. "type": "string",
  15968. "enum": ["pty.exited"]
  15969. },
  15970. "properties": {
  15971. "type": "object",
  15972. "properties": {
  15973. "id": {
  15974. "type": "string"
  15975. },
  15976. "exitCode": {
  15977. "type": "integer",
  15978. "minimum": 0
  15979. }
  15980. },
  15981. "required": ["id", "exitCode"],
  15982. "additionalProperties": false
  15983. }
  15984. },
  15985. "required": ["id", "type", "properties"],
  15986. "additionalProperties": false
  15987. },
  15988. "EventPtyDeleted": {
  15989. "type": "object",
  15990. "properties": {
  15991. "id": {
  15992. "type": "string"
  15993. },
  15994. "type": {
  15995. "type": "string",
  15996. "enum": ["pty.deleted"]
  15997. },
  15998. "properties": {
  15999. "type": "object",
  16000. "properties": {
  16001. "id": {
  16002. "type": "string"
  16003. }
  16004. },
  16005. "required": ["id"],
  16006. "additionalProperties": false
  16007. }
  16008. },
  16009. "required": ["id", "type", "properties"],
  16010. "additionalProperties": false
  16011. },
  16012. "EventMessageUpdated": {
  16013. "type": "object",
  16014. "properties": {
  16015. "id": {
  16016. "type": "string"
  16017. },
  16018. "type": {
  16019. "type": "string",
  16020. "enum": ["message.updated"]
  16021. },
  16022. "properties": {
  16023. "type": "object",
  16024. "properties": {
  16025. "sessionID": {
  16026. "type": "string"
  16027. },
  16028. "info": {
  16029. "$ref": "#/components/schemas/Message"
  16030. }
  16031. },
  16032. "required": ["sessionID", "info"],
  16033. "additionalProperties": false
  16034. }
  16035. },
  16036. "required": ["id", "type", "properties"],
  16037. "additionalProperties": false
  16038. },
  16039. "EventMessageRemoved": {
  16040. "type": "object",
  16041. "properties": {
  16042. "id": {
  16043. "type": "string"
  16044. },
  16045. "type": {
  16046. "type": "string",
  16047. "enum": ["message.removed"]
  16048. },
  16049. "properties": {
  16050. "type": "object",
  16051. "properties": {
  16052. "sessionID": {
  16053. "type": "string"
  16054. },
  16055. "messageID": {
  16056. "type": "string"
  16057. }
  16058. },
  16059. "required": ["sessionID", "messageID"],
  16060. "additionalProperties": false
  16061. }
  16062. },
  16063. "required": ["id", "type", "properties"],
  16064. "additionalProperties": false
  16065. },
  16066. "EventMessagePartUpdated": {
  16067. "type": "object",
  16068. "properties": {
  16069. "id": {
  16070. "type": "string"
  16071. },
  16072. "type": {
  16073. "type": "string",
  16074. "enum": ["message.part.updated"]
  16075. },
  16076. "properties": {
  16077. "type": "object",
  16078. "properties": {
  16079. "sessionID": {
  16080. "type": "string"
  16081. },
  16082. "part": {
  16083. "$ref": "#/components/schemas/Part"
  16084. },
  16085. "time": {
  16086. "type": "integer",
  16087. "minimum": 0
  16088. }
  16089. },
  16090. "required": ["sessionID", "part", "time"],
  16091. "additionalProperties": false
  16092. }
  16093. },
  16094. "required": ["id", "type", "properties"],
  16095. "additionalProperties": false
  16096. },
  16097. "EventMessagePartRemoved": {
  16098. "type": "object",
  16099. "properties": {
  16100. "id": {
  16101. "type": "string"
  16102. },
  16103. "type": {
  16104. "type": "string",
  16105. "enum": ["message.part.removed"]
  16106. },
  16107. "properties": {
  16108. "type": "object",
  16109. "properties": {
  16110. "sessionID": {
  16111. "type": "string"
  16112. },
  16113. "messageID": {
  16114. "type": "string"
  16115. },
  16116. "partID": {
  16117. "type": "string"
  16118. }
  16119. },
  16120. "required": ["sessionID", "messageID", "partID"],
  16121. "additionalProperties": false
  16122. }
  16123. },
  16124. "required": ["id", "type", "properties"],
  16125. "additionalProperties": false
  16126. },
  16127. "EventSessionCreated": {
  16128. "type": "object",
  16129. "properties": {
  16130. "id": {
  16131. "type": "string"
  16132. },
  16133. "type": {
  16134. "type": "string",
  16135. "enum": ["session.created"]
  16136. },
  16137. "properties": {
  16138. "type": "object",
  16139. "properties": {
  16140. "sessionID": {
  16141. "type": "string"
  16142. },
  16143. "info": {
  16144. "$ref": "#/components/schemas/Session"
  16145. }
  16146. },
  16147. "required": ["sessionID", "info"],
  16148. "additionalProperties": false
  16149. }
  16150. },
  16151. "required": ["id", "type", "properties"],
  16152. "additionalProperties": false
  16153. },
  16154. "EventSessionUpdated": {
  16155. "type": "object",
  16156. "properties": {
  16157. "id": {
  16158. "type": "string"
  16159. },
  16160. "type": {
  16161. "type": "string",
  16162. "enum": ["session.updated"]
  16163. },
  16164. "properties": {
  16165. "type": "object",
  16166. "properties": {
  16167. "sessionID": {
  16168. "type": "string"
  16169. },
  16170. "info": {
  16171. "$ref": "#/components/schemas/Session"
  16172. }
  16173. },
  16174. "required": ["sessionID", "info"],
  16175. "additionalProperties": false
  16176. }
  16177. },
  16178. "required": ["id", "type", "properties"],
  16179. "additionalProperties": false
  16180. },
  16181. "EventSessionDeleted": {
  16182. "type": "object",
  16183. "properties": {
  16184. "id": {
  16185. "type": "string"
  16186. },
  16187. "type": {
  16188. "type": "string",
  16189. "enum": ["session.deleted"]
  16190. },
  16191. "properties": {
  16192. "type": "object",
  16193. "properties": {
  16194. "sessionID": {
  16195. "type": "string"
  16196. },
  16197. "info": {
  16198. "$ref": "#/components/schemas/Session"
  16199. }
  16200. },
  16201. "required": ["sessionID", "info"],
  16202. "additionalProperties": false
  16203. }
  16204. },
  16205. "required": ["id", "type", "properties"],
  16206. "additionalProperties": false
  16207. },
  16208. "EventSessionNextAgentSwitched": {
  16209. "type": "object",
  16210. "properties": {
  16211. "id": {
  16212. "type": "string"
  16213. },
  16214. "type": {
  16215. "type": "string",
  16216. "enum": ["session.next.agent.switched"]
  16217. },
  16218. "properties": {
  16219. "type": "object",
  16220. "properties": {
  16221. "timestamp": {
  16222. "type": "number"
  16223. },
  16224. "sessionID": {
  16225. "type": "string"
  16226. },
  16227. "agent": {
  16228. "type": "string"
  16229. }
  16230. },
  16231. "required": ["timestamp", "sessionID", "agent"],
  16232. "additionalProperties": false
  16233. }
  16234. },
  16235. "required": ["id", "type", "properties"],
  16236. "additionalProperties": false
  16237. },
  16238. "EventSessionNextModelSwitched": {
  16239. "type": "object",
  16240. "properties": {
  16241. "id": {
  16242. "type": "string"
  16243. },
  16244. "type": {
  16245. "type": "string",
  16246. "enum": ["session.next.model.switched"]
  16247. },
  16248. "properties": {
  16249. "type": "object",
  16250. "properties": {
  16251. "timestamp": {
  16252. "type": "number"
  16253. },
  16254. "sessionID": {
  16255. "type": "string"
  16256. },
  16257. "model": {
  16258. "type": "object",
  16259. "properties": {
  16260. "id": {
  16261. "type": "string"
  16262. },
  16263. "providerID": {
  16264. "type": "string"
  16265. },
  16266. "variant": {
  16267. "type": "string"
  16268. }
  16269. },
  16270. "required": ["id", "providerID", "variant"],
  16271. "additionalProperties": false
  16272. }
  16273. },
  16274. "required": ["timestamp", "sessionID", "model"],
  16275. "additionalProperties": false
  16276. }
  16277. },
  16278. "required": ["id", "type", "properties"],
  16279. "additionalProperties": false
  16280. },
  16281. "PromptSource": {
  16282. "type": "object",
  16283. "properties": {
  16284. "start": {
  16285. "type": "number"
  16286. },
  16287. "end": {
  16288. "type": "number"
  16289. },
  16290. "text": {
  16291. "type": "string"
  16292. }
  16293. },
  16294. "required": ["start", "end", "text"],
  16295. "additionalProperties": false
  16296. },
  16297. "PromptFileAttachment": {
  16298. "type": "object",
  16299. "properties": {
  16300. "uri": {
  16301. "type": "string"
  16302. },
  16303. "mime": {
  16304. "type": "string"
  16305. },
  16306. "name": {
  16307. "type": "string"
  16308. },
  16309. "description": {
  16310. "type": "string"
  16311. },
  16312. "source": {
  16313. "$ref": "#/components/schemas/PromptSource"
  16314. }
  16315. },
  16316. "required": ["uri", "mime"],
  16317. "additionalProperties": false
  16318. },
  16319. "PromptAgentAttachment": {
  16320. "type": "object",
  16321. "properties": {
  16322. "name": {
  16323. "type": "string"
  16324. },
  16325. "source": {
  16326. "$ref": "#/components/schemas/PromptSource"
  16327. }
  16328. },
  16329. "required": ["name"],
  16330. "additionalProperties": false
  16331. },
  16332. "EventSessionNextPrompted": {
  16333. "type": "object",
  16334. "properties": {
  16335. "id": {
  16336. "type": "string"
  16337. },
  16338. "type": {
  16339. "type": "string",
  16340. "enum": ["session.next.prompted"]
  16341. },
  16342. "properties": {
  16343. "type": "object",
  16344. "properties": {
  16345. "timestamp": {
  16346. "type": "number"
  16347. },
  16348. "sessionID": {
  16349. "type": "string"
  16350. },
  16351. "prompt": {
  16352. "$ref": "#/components/schemas/Prompt"
  16353. }
  16354. },
  16355. "required": ["timestamp", "sessionID", "prompt"],
  16356. "additionalProperties": false
  16357. }
  16358. },
  16359. "required": ["id", "type", "properties"],
  16360. "additionalProperties": false
  16361. },
  16362. "EventSessionNextSynthetic": {
  16363. "type": "object",
  16364. "properties": {
  16365. "id": {
  16366. "type": "string"
  16367. },
  16368. "type": {
  16369. "type": "string",
  16370. "enum": ["session.next.synthetic"]
  16371. },
  16372. "properties": {
  16373. "type": "object",
  16374. "properties": {
  16375. "timestamp": {
  16376. "type": "number"
  16377. },
  16378. "sessionID": {
  16379. "type": "string"
  16380. },
  16381. "text": {
  16382. "type": "string"
  16383. }
  16384. },
  16385. "required": ["timestamp", "sessionID", "text"],
  16386. "additionalProperties": false
  16387. }
  16388. },
  16389. "required": ["id", "type", "properties"],
  16390. "additionalProperties": false
  16391. },
  16392. "EventSessionNextShellStarted": {
  16393. "type": "object",
  16394. "properties": {
  16395. "id": {
  16396. "type": "string"
  16397. },
  16398. "type": {
  16399. "type": "string",
  16400. "enum": ["session.next.shell.started"]
  16401. },
  16402. "properties": {
  16403. "type": "object",
  16404. "properties": {
  16405. "timestamp": {
  16406. "type": "number"
  16407. },
  16408. "sessionID": {
  16409. "type": "string"
  16410. },
  16411. "callID": {
  16412. "type": "string"
  16413. },
  16414. "command": {
  16415. "type": "string"
  16416. }
  16417. },
  16418. "required": ["timestamp", "sessionID", "callID", "command"],
  16419. "additionalProperties": false
  16420. }
  16421. },
  16422. "required": ["id", "type", "properties"],
  16423. "additionalProperties": false
  16424. },
  16425. "EventSessionNextShellEnded": {
  16426. "type": "object",
  16427. "properties": {
  16428. "id": {
  16429. "type": "string"
  16430. },
  16431. "type": {
  16432. "type": "string",
  16433. "enum": ["session.next.shell.ended"]
  16434. },
  16435. "properties": {
  16436. "type": "object",
  16437. "properties": {
  16438. "timestamp": {
  16439. "type": "number"
  16440. },
  16441. "sessionID": {
  16442. "type": "string"
  16443. },
  16444. "callID": {
  16445. "type": "string"
  16446. },
  16447. "output": {
  16448. "type": "string"
  16449. }
  16450. },
  16451. "required": ["timestamp", "sessionID", "callID", "output"],
  16452. "additionalProperties": false
  16453. }
  16454. },
  16455. "required": ["id", "type", "properties"],
  16456. "additionalProperties": false
  16457. },
  16458. "EventSessionNextStepStarted": {
  16459. "type": "object",
  16460. "properties": {
  16461. "id": {
  16462. "type": "string"
  16463. },
  16464. "type": {
  16465. "type": "string",
  16466. "enum": ["session.next.step.started"]
  16467. },
  16468. "properties": {
  16469. "type": "object",
  16470. "properties": {
  16471. "timestamp": {
  16472. "type": "number"
  16473. },
  16474. "sessionID": {
  16475. "type": "string"
  16476. },
  16477. "agent": {
  16478. "type": "string"
  16479. },
  16480. "model": {
  16481. "type": "object",
  16482. "properties": {
  16483. "id": {
  16484. "type": "string"
  16485. },
  16486. "providerID": {
  16487. "type": "string"
  16488. },
  16489. "variant": {
  16490. "type": "string"
  16491. }
  16492. },
  16493. "required": ["id", "providerID", "variant"],
  16494. "additionalProperties": false
  16495. },
  16496. "snapshot": {
  16497. "type": "string"
  16498. }
  16499. },
  16500. "required": ["timestamp", "sessionID", "agent", "model"],
  16501. "additionalProperties": false
  16502. }
  16503. },
  16504. "required": ["id", "type", "properties"],
  16505. "additionalProperties": false
  16506. },
  16507. "EventSessionNextStepEnded": {
  16508. "type": "object",
  16509. "properties": {
  16510. "id": {
  16511. "type": "string"
  16512. },
  16513. "type": {
  16514. "type": "string",
  16515. "enum": ["session.next.step.ended"]
  16516. },
  16517. "properties": {
  16518. "type": "object",
  16519. "properties": {
  16520. "timestamp": {
  16521. "type": "number"
  16522. },
  16523. "sessionID": {
  16524. "type": "string"
  16525. },
  16526. "finish": {
  16527. "type": "string"
  16528. },
  16529. "cost": {
  16530. "type": "number"
  16531. },
  16532. "tokens": {
  16533. "type": "object",
  16534. "properties": {
  16535. "input": {
  16536. "type": "integer",
  16537. "minimum": 0
  16538. },
  16539. "output": {
  16540. "type": "integer",
  16541. "minimum": 0
  16542. },
  16543. "reasoning": {
  16544. "type": "integer",
  16545. "minimum": 0
  16546. },
  16547. "cache": {
  16548. "type": "object",
  16549. "properties": {
  16550. "read": {
  16551. "type": "integer",
  16552. "minimum": 0
  16553. },
  16554. "write": {
  16555. "type": "integer",
  16556. "minimum": 0
  16557. }
  16558. },
  16559. "required": ["read", "write"],
  16560. "additionalProperties": false
  16561. }
  16562. },
  16563. "required": ["input", "output", "reasoning", "cache"],
  16564. "additionalProperties": false
  16565. },
  16566. "snapshot": {
  16567. "type": "string"
  16568. }
  16569. },
  16570. "required": ["timestamp", "sessionID", "finish", "cost", "tokens"],
  16571. "additionalProperties": false
  16572. }
  16573. },
  16574. "required": ["id", "type", "properties"],
  16575. "additionalProperties": false
  16576. },
  16577. "SessionErrorUnknown": {
  16578. "type": "object",
  16579. "properties": {
  16580. "type": {
  16581. "type": "string",
  16582. "enum": ["unknown"]
  16583. },
  16584. "message": {
  16585. "type": "string"
  16586. }
  16587. },
  16588. "required": ["type", "message"],
  16589. "additionalProperties": false
  16590. },
  16591. "EventSessionNextStepFailed": {
  16592. "type": "object",
  16593. "properties": {
  16594. "id": {
  16595. "type": "string"
  16596. },
  16597. "type": {
  16598. "type": "string",
  16599. "enum": ["session.next.step.failed"]
  16600. },
  16601. "properties": {
  16602. "type": "object",
  16603. "properties": {
  16604. "timestamp": {
  16605. "type": "number"
  16606. },
  16607. "sessionID": {
  16608. "type": "string"
  16609. },
  16610. "error": {
  16611. "$ref": "#/components/schemas/SessionErrorUnknown"
  16612. }
  16613. },
  16614. "required": ["timestamp", "sessionID", "error"],
  16615. "additionalProperties": false
  16616. }
  16617. },
  16618. "required": ["id", "type", "properties"],
  16619. "additionalProperties": false
  16620. },
  16621. "EventSessionNextTextStarted": {
  16622. "type": "object",
  16623. "properties": {
  16624. "id": {
  16625. "type": "string"
  16626. },
  16627. "type": {
  16628. "type": "string",
  16629. "enum": ["session.next.text.started"]
  16630. },
  16631. "properties": {
  16632. "type": "object",
  16633. "properties": {
  16634. "timestamp": {
  16635. "type": "number"
  16636. },
  16637. "sessionID": {
  16638. "type": "string"
  16639. }
  16640. },
  16641. "required": ["timestamp", "sessionID"],
  16642. "additionalProperties": false
  16643. }
  16644. },
  16645. "required": ["id", "type", "properties"],
  16646. "additionalProperties": false
  16647. },
  16648. "EventSessionNextTextDelta": {
  16649. "type": "object",
  16650. "properties": {
  16651. "id": {
  16652. "type": "string"
  16653. },
  16654. "type": {
  16655. "type": "string",
  16656. "enum": ["session.next.text.delta"]
  16657. },
  16658. "properties": {
  16659. "type": "object",
  16660. "properties": {
  16661. "timestamp": {
  16662. "type": "number"
  16663. },
  16664. "sessionID": {
  16665. "type": "string"
  16666. },
  16667. "delta": {
  16668. "type": "string"
  16669. }
  16670. },
  16671. "required": ["timestamp", "sessionID", "delta"],
  16672. "additionalProperties": false
  16673. }
  16674. },
  16675. "required": ["id", "type", "properties"],
  16676. "additionalProperties": false
  16677. },
  16678. "EventSessionNextTextEnded": {
  16679. "type": "object",
  16680. "properties": {
  16681. "id": {
  16682. "type": "string"
  16683. },
  16684. "type": {
  16685. "type": "string",
  16686. "enum": ["session.next.text.ended"]
  16687. },
  16688. "properties": {
  16689. "type": "object",
  16690. "properties": {
  16691. "timestamp": {
  16692. "type": "number"
  16693. },
  16694. "sessionID": {
  16695. "type": "string"
  16696. },
  16697. "text": {
  16698. "type": "string"
  16699. }
  16700. },
  16701. "required": ["timestamp", "sessionID", "text"],
  16702. "additionalProperties": false
  16703. }
  16704. },
  16705. "required": ["id", "type", "properties"],
  16706. "additionalProperties": false
  16707. },
  16708. "EventSessionNextReasoningStarted": {
  16709. "type": "object",
  16710. "properties": {
  16711. "id": {
  16712. "type": "string"
  16713. },
  16714. "type": {
  16715. "type": "string",
  16716. "enum": ["session.next.reasoning.started"]
  16717. },
  16718. "properties": {
  16719. "type": "object",
  16720. "properties": {
  16721. "timestamp": {
  16722. "type": "number"
  16723. },
  16724. "sessionID": {
  16725. "type": "string"
  16726. },
  16727. "reasoningID": {
  16728. "type": "string"
  16729. }
  16730. },
  16731. "required": ["timestamp", "sessionID", "reasoningID"],
  16732. "additionalProperties": false
  16733. }
  16734. },
  16735. "required": ["id", "type", "properties"],
  16736. "additionalProperties": false
  16737. },
  16738. "EventSessionNextReasoningDelta": {
  16739. "type": "object",
  16740. "properties": {
  16741. "id": {
  16742. "type": "string"
  16743. },
  16744. "type": {
  16745. "type": "string",
  16746. "enum": ["session.next.reasoning.delta"]
  16747. },
  16748. "properties": {
  16749. "type": "object",
  16750. "properties": {
  16751. "timestamp": {
  16752. "type": "number"
  16753. },
  16754. "sessionID": {
  16755. "type": "string"
  16756. },
  16757. "reasoningID": {
  16758. "type": "string"
  16759. },
  16760. "delta": {
  16761. "type": "string"
  16762. }
  16763. },
  16764. "required": ["timestamp", "sessionID", "reasoningID", "delta"],
  16765. "additionalProperties": false
  16766. }
  16767. },
  16768. "required": ["id", "type", "properties"],
  16769. "additionalProperties": false
  16770. },
  16771. "EventSessionNextReasoningEnded": {
  16772. "type": "object",
  16773. "properties": {
  16774. "id": {
  16775. "type": "string"
  16776. },
  16777. "type": {
  16778. "type": "string",
  16779. "enum": ["session.next.reasoning.ended"]
  16780. },
  16781. "properties": {
  16782. "type": "object",
  16783. "properties": {
  16784. "timestamp": {
  16785. "type": "number"
  16786. },
  16787. "sessionID": {
  16788. "type": "string"
  16789. },
  16790. "reasoningID": {
  16791. "type": "string"
  16792. },
  16793. "text": {
  16794. "type": "string"
  16795. }
  16796. },
  16797. "required": ["timestamp", "sessionID", "reasoningID", "text"],
  16798. "additionalProperties": false
  16799. }
  16800. },
  16801. "required": ["id", "type", "properties"],
  16802. "additionalProperties": false
  16803. },
  16804. "EventSessionNextToolInputStarted": {
  16805. "type": "object",
  16806. "properties": {
  16807. "id": {
  16808. "type": "string"
  16809. },
  16810. "type": {
  16811. "type": "string",
  16812. "enum": ["session.next.tool.input.started"]
  16813. },
  16814. "properties": {
  16815. "type": "object",
  16816. "properties": {
  16817. "timestamp": {
  16818. "type": "number"
  16819. },
  16820. "sessionID": {
  16821. "type": "string"
  16822. },
  16823. "callID": {
  16824. "type": "string"
  16825. },
  16826. "name": {
  16827. "type": "string"
  16828. }
  16829. },
  16830. "required": ["timestamp", "sessionID", "callID", "name"],
  16831. "additionalProperties": false
  16832. }
  16833. },
  16834. "required": ["id", "type", "properties"],
  16835. "additionalProperties": false
  16836. },
  16837. "EventSessionNextToolInputDelta": {
  16838. "type": "object",
  16839. "properties": {
  16840. "id": {
  16841. "type": "string"
  16842. },
  16843. "type": {
  16844. "type": "string",
  16845. "enum": ["session.next.tool.input.delta"]
  16846. },
  16847. "properties": {
  16848. "type": "object",
  16849. "properties": {
  16850. "timestamp": {
  16851. "type": "number"
  16852. },
  16853. "sessionID": {
  16854. "type": "string"
  16855. },
  16856. "callID": {
  16857. "type": "string"
  16858. },
  16859. "delta": {
  16860. "type": "string"
  16861. }
  16862. },
  16863. "required": ["timestamp", "sessionID", "callID", "delta"],
  16864. "additionalProperties": false
  16865. }
  16866. },
  16867. "required": ["id", "type", "properties"],
  16868. "additionalProperties": false
  16869. },
  16870. "EventSessionNextToolInputEnded": {
  16871. "type": "object",
  16872. "properties": {
  16873. "id": {
  16874. "type": "string"
  16875. },
  16876. "type": {
  16877. "type": "string",
  16878. "enum": ["session.next.tool.input.ended"]
  16879. },
  16880. "properties": {
  16881. "type": "object",
  16882. "properties": {
  16883. "timestamp": {
  16884. "type": "number"
  16885. },
  16886. "sessionID": {
  16887. "type": "string"
  16888. },
  16889. "callID": {
  16890. "type": "string"
  16891. },
  16892. "text": {
  16893. "type": "string"
  16894. }
  16895. },
  16896. "required": ["timestamp", "sessionID", "callID", "text"],
  16897. "additionalProperties": false
  16898. }
  16899. },
  16900. "required": ["id", "type", "properties"],
  16901. "additionalProperties": false
  16902. },
  16903. "EventSessionNextToolCalled": {
  16904. "type": "object",
  16905. "properties": {
  16906. "id": {
  16907. "type": "string"
  16908. },
  16909. "type": {
  16910. "type": "string",
  16911. "enum": ["session.next.tool.called"]
  16912. },
  16913. "properties": {
  16914. "type": "object",
  16915. "properties": {
  16916. "timestamp": {
  16917. "type": "number"
  16918. },
  16919. "sessionID": {
  16920. "type": "string"
  16921. },
  16922. "callID": {
  16923. "type": "string"
  16924. },
  16925. "tool": {
  16926. "type": "string"
  16927. },
  16928. "input": {
  16929. "type": "object"
  16930. },
  16931. "provider": {
  16932. "type": "object",
  16933. "properties": {
  16934. "executed": {
  16935. "type": "boolean"
  16936. },
  16937. "metadata": {
  16938. "type": "object"
  16939. }
  16940. },
  16941. "required": ["executed"],
  16942. "additionalProperties": false
  16943. }
  16944. },
  16945. "required": ["timestamp", "sessionID", "callID", "tool", "input", "provider"],
  16946. "additionalProperties": false
  16947. }
  16948. },
  16949. "required": ["id", "type", "properties"],
  16950. "additionalProperties": false
  16951. },
  16952. "ToolTextContent": {
  16953. "type": "object",
  16954. "properties": {
  16955. "type": {
  16956. "type": "string",
  16957. "enum": ["text"]
  16958. },
  16959. "text": {
  16960. "type": "string"
  16961. }
  16962. },
  16963. "required": ["type", "text"],
  16964. "additionalProperties": false
  16965. },
  16966. "ToolFileContent": {
  16967. "type": "object",
  16968. "properties": {
  16969. "type": {
  16970. "type": "string",
  16971. "enum": ["file"]
  16972. },
  16973. "uri": {
  16974. "type": "string"
  16975. },
  16976. "mime": {
  16977. "type": "string"
  16978. },
  16979. "name": {
  16980. "type": "string"
  16981. }
  16982. },
  16983. "required": ["type", "uri", "mime"],
  16984. "additionalProperties": false
  16985. },
  16986. "EventSessionNextToolProgress": {
  16987. "type": "object",
  16988. "properties": {
  16989. "id": {
  16990. "type": "string"
  16991. },
  16992. "type": {
  16993. "type": "string",
  16994. "enum": ["session.next.tool.progress"]
  16995. },
  16996. "properties": {
  16997. "type": "object",
  16998. "properties": {
  16999. "timestamp": {
  17000. "type": "number"
  17001. },
  17002. "sessionID": {
  17003. "type": "string"
  17004. },
  17005. "callID": {
  17006. "type": "string"
  17007. },
  17008. "structured": {
  17009. "type": "object"
  17010. },
  17011. "content": {
  17012. "type": "array",
  17013. "items": {
  17014. "anyOf": [
  17015. {
  17016. "$ref": "#/components/schemas/ToolTextContent"
  17017. },
  17018. {
  17019. "$ref": "#/components/schemas/ToolFileContent"
  17020. }
  17021. ]
  17022. }
  17023. }
  17024. },
  17025. "required": ["timestamp", "sessionID", "callID", "structured", "content"],
  17026. "additionalProperties": false
  17027. }
  17028. },
  17029. "required": ["id", "type", "properties"],
  17030. "additionalProperties": false
  17031. },
  17032. "EventSessionNextToolSuccess": {
  17033. "type": "object",
  17034. "properties": {
  17035. "id": {
  17036. "type": "string"
  17037. },
  17038. "type": {
  17039. "type": "string",
  17040. "enum": ["session.next.tool.success"]
  17041. },
  17042. "properties": {
  17043. "type": "object",
  17044. "properties": {
  17045. "timestamp": {
  17046. "type": "number"
  17047. },
  17048. "sessionID": {
  17049. "type": "string"
  17050. },
  17051. "callID": {
  17052. "type": "string"
  17053. },
  17054. "structured": {
  17055. "type": "object"
  17056. },
  17057. "content": {
  17058. "type": "array",
  17059. "items": {
  17060. "anyOf": [
  17061. {
  17062. "$ref": "#/components/schemas/ToolTextContent"
  17063. },
  17064. {
  17065. "$ref": "#/components/schemas/ToolFileContent"
  17066. }
  17067. ]
  17068. }
  17069. },
  17070. "provider": {
  17071. "type": "object",
  17072. "properties": {
  17073. "executed": {
  17074. "type": "boolean"
  17075. },
  17076. "metadata": {
  17077. "type": "object"
  17078. }
  17079. },
  17080. "required": ["executed"],
  17081. "additionalProperties": false
  17082. }
  17083. },
  17084. "required": ["timestamp", "sessionID", "callID", "structured", "content", "provider"],
  17085. "additionalProperties": false
  17086. }
  17087. },
  17088. "required": ["id", "type", "properties"],
  17089. "additionalProperties": false
  17090. },
  17091. "EventSessionNextToolFailed": {
  17092. "type": "object",
  17093. "properties": {
  17094. "id": {
  17095. "type": "string"
  17096. },
  17097. "type": {
  17098. "type": "string",
  17099. "enum": ["session.next.tool.failed"]
  17100. },
  17101. "properties": {
  17102. "type": "object",
  17103. "properties": {
  17104. "timestamp": {
  17105. "type": "number"
  17106. },
  17107. "sessionID": {
  17108. "type": "string"
  17109. },
  17110. "callID": {
  17111. "type": "string"
  17112. },
  17113. "error": {
  17114. "$ref": "#/components/schemas/SessionErrorUnknown"
  17115. },
  17116. "provider": {
  17117. "type": "object",
  17118. "properties": {
  17119. "executed": {
  17120. "type": "boolean"
  17121. },
  17122. "metadata": {
  17123. "type": "object"
  17124. }
  17125. },
  17126. "required": ["executed"],
  17127. "additionalProperties": false
  17128. }
  17129. },
  17130. "required": ["timestamp", "sessionID", "callID", "error", "provider"],
  17131. "additionalProperties": false
  17132. }
  17133. },
  17134. "required": ["id", "type", "properties"],
  17135. "additionalProperties": false
  17136. },
  17137. "SessionNextRetry_error": {
  17138. "type": "object",
  17139. "properties": {
  17140. "message": {
  17141. "type": "string"
  17142. },
  17143. "statusCode": {
  17144. "type": "integer",
  17145. "minimum": 0
  17146. },
  17147. "isRetryable": {
  17148. "type": "boolean"
  17149. },
  17150. "responseHeaders": {
  17151. "type": "object",
  17152. "additionalProperties": {
  17153. "type": "string"
  17154. }
  17155. },
  17156. "responseBody": {
  17157. "type": "string"
  17158. },
  17159. "metadata": {
  17160. "type": "object",
  17161. "additionalProperties": {
  17162. "type": "string"
  17163. }
  17164. }
  17165. },
  17166. "required": ["message", "isRetryable"],
  17167. "additionalProperties": false
  17168. },
  17169. "EventSessionNextRetried": {
  17170. "type": "object",
  17171. "properties": {
  17172. "id": {
  17173. "type": "string"
  17174. },
  17175. "type": {
  17176. "type": "string",
  17177. "enum": ["session.next.retried"]
  17178. },
  17179. "properties": {
  17180. "type": "object",
  17181. "properties": {
  17182. "timestamp": {
  17183. "type": "number"
  17184. },
  17185. "sessionID": {
  17186. "type": "string"
  17187. },
  17188. "attempt": {
  17189. "type": "integer",
  17190. "minimum": 0
  17191. },
  17192. "error": {
  17193. "$ref": "#/components/schemas/SessionNextRetry_error"
  17194. }
  17195. },
  17196. "required": ["timestamp", "sessionID", "attempt", "error"],
  17197. "additionalProperties": false
  17198. }
  17199. },
  17200. "required": ["id", "type", "properties"],
  17201. "additionalProperties": false
  17202. },
  17203. "EventSessionNextCompactionStarted": {
  17204. "type": "object",
  17205. "properties": {
  17206. "id": {
  17207. "type": "string"
  17208. },
  17209. "type": {
  17210. "type": "string",
  17211. "enum": ["session.next.compaction.started"]
  17212. },
  17213. "properties": {
  17214. "type": "object",
  17215. "properties": {
  17216. "timestamp": {
  17217. "type": "number"
  17218. },
  17219. "sessionID": {
  17220. "type": "string"
  17221. },
  17222. "reason": {
  17223. "type": "string",
  17224. "enum": ["auto", "manual"]
  17225. }
  17226. },
  17227. "required": ["timestamp", "sessionID", "reason"],
  17228. "additionalProperties": false
  17229. }
  17230. },
  17231. "required": ["id", "type", "properties"],
  17232. "additionalProperties": false
  17233. },
  17234. "EventSessionNextCompactionDelta": {
  17235. "type": "object",
  17236. "properties": {
  17237. "id": {
  17238. "type": "string"
  17239. },
  17240. "type": {
  17241. "type": "string",
  17242. "enum": ["session.next.compaction.delta"]
  17243. },
  17244. "properties": {
  17245. "type": "object",
  17246. "properties": {
  17247. "timestamp": {
  17248. "type": "number"
  17249. },
  17250. "sessionID": {
  17251. "type": "string"
  17252. },
  17253. "text": {
  17254. "type": "string"
  17255. }
  17256. },
  17257. "required": ["timestamp", "sessionID", "text"],
  17258. "additionalProperties": false
  17259. }
  17260. },
  17261. "required": ["id", "type", "properties"],
  17262. "additionalProperties": false
  17263. },
  17264. "EventSessionNextCompactionEnded": {
  17265. "type": "object",
  17266. "properties": {
  17267. "id": {
  17268. "type": "string"
  17269. },
  17270. "type": {
  17271. "type": "string",
  17272. "enum": ["session.next.compaction.ended"]
  17273. },
  17274. "properties": {
  17275. "type": "object",
  17276. "properties": {
  17277. "timestamp": {
  17278. "type": "number"
  17279. },
  17280. "sessionID": {
  17281. "type": "string"
  17282. },
  17283. "text": {
  17284. "type": "string"
  17285. },
  17286. "include": {
  17287. "type": "string"
  17288. }
  17289. },
  17290. "required": ["timestamp", "sessionID", "text"],
  17291. "additionalProperties": false
  17292. }
  17293. },
  17294. "required": ["id", "type", "properties"],
  17295. "additionalProperties": false
  17296. },
  17297. "EventServerConnected": {
  17298. "type": "object",
  17299. "properties": {
  17300. "id": {
  17301. "type": "string"
  17302. },
  17303. "type": {
  17304. "type": "string",
  17305. "enum": ["server.connected"]
  17306. },
  17307. "properties": {
  17308. "type": "object",
  17309. "properties": {}
  17310. }
  17311. },
  17312. "required": ["id", "type", "properties"],
  17313. "additionalProperties": false
  17314. },
  17315. "EventGlobalDisposed": {
  17316. "type": "object",
  17317. "properties": {
  17318. "id": {
  17319. "type": "string"
  17320. },
  17321. "type": {
  17322. "type": "string",
  17323. "enum": ["global.disposed"]
  17324. },
  17325. "properties": {
  17326. "type": "object",
  17327. "properties": {}
  17328. }
  17329. },
  17330. "required": ["id", "type", "properties"],
  17331. "additionalProperties": false
  17332. },
  17333. "SessionInfo": {
  17334. "type": "object",
  17335. "properties": {
  17336. "id": {
  17337. "type": "string"
  17338. },
  17339. "parentID": {
  17340. "type": "string"
  17341. },
  17342. "projectID": {
  17343. "type": "string"
  17344. },
  17345. "workspaceID": {
  17346. "type": "string"
  17347. },
  17348. "path": {
  17349. "type": "string"
  17350. },
  17351. "agent": {
  17352. "type": "string"
  17353. },
  17354. "model": {
  17355. "type": "object",
  17356. "properties": {
  17357. "id": {
  17358. "type": "string"
  17359. },
  17360. "providerID": {
  17361. "type": "string"
  17362. },
  17363. "variant": {
  17364. "type": "string"
  17365. }
  17366. },
  17367. "required": ["id", "providerID", "variant"],
  17368. "additionalProperties": false
  17369. },
  17370. "time": {
  17371. "type": "object",
  17372. "properties": {
  17373. "created": {
  17374. "type": "number"
  17375. },
  17376. "updated": {
  17377. "type": "number"
  17378. },
  17379. "archived": {
  17380. "type": "number"
  17381. }
  17382. },
  17383. "required": ["created", "updated"],
  17384. "additionalProperties": false
  17385. },
  17386. "title": {
  17387. "type": "string"
  17388. }
  17389. },
  17390. "required": ["id", "projectID", "time", "title"],
  17391. "additionalProperties": false
  17392. },
  17393. "SessionDelivery": {
  17394. "type": "string",
  17395. "enum": ["immediate", "deferred"]
  17396. },
  17397. "SessionMessageAgentSwitched": {
  17398. "type": "object",
  17399. "properties": {
  17400. "id": {
  17401. "type": "string"
  17402. },
  17403. "metadata": {
  17404. "type": "object"
  17405. },
  17406. "time": {
  17407. "type": "object",
  17408. "properties": {
  17409. "created": {
  17410. "type": "number"
  17411. }
  17412. },
  17413. "required": ["created"],
  17414. "additionalProperties": false
  17415. },
  17416. "type": {
  17417. "type": "string",
  17418. "enum": ["agent-switched"]
  17419. },
  17420. "agent": {
  17421. "type": "string"
  17422. }
  17423. },
  17424. "required": ["id", "time", "type", "agent"],
  17425. "additionalProperties": false
  17426. },
  17427. "SessionMessageModelSwitched": {
  17428. "type": "object",
  17429. "properties": {
  17430. "id": {
  17431. "type": "string"
  17432. },
  17433. "metadata": {
  17434. "type": "object"
  17435. },
  17436. "time": {
  17437. "type": "object",
  17438. "properties": {
  17439. "created": {
  17440. "type": "number"
  17441. }
  17442. },
  17443. "required": ["created"],
  17444. "additionalProperties": false
  17445. },
  17446. "type": {
  17447. "type": "string",
  17448. "enum": ["model-switched"]
  17449. },
  17450. "model": {
  17451. "type": "object",
  17452. "properties": {
  17453. "id": {
  17454. "type": "string"
  17455. },
  17456. "providerID": {
  17457. "type": "string"
  17458. },
  17459. "variant": {
  17460. "type": "string"
  17461. }
  17462. },
  17463. "required": ["id", "providerID", "variant"],
  17464. "additionalProperties": false
  17465. }
  17466. },
  17467. "required": ["id", "time", "type", "model"],
  17468. "additionalProperties": false
  17469. },
  17470. "SessionMessageUser": {
  17471. "type": "object",
  17472. "properties": {
  17473. "id": {
  17474. "type": "string"
  17475. },
  17476. "metadata": {
  17477. "type": "object"
  17478. },
  17479. "time": {
  17480. "type": "object",
  17481. "properties": {
  17482. "created": {
  17483. "type": "number"
  17484. }
  17485. },
  17486. "required": ["created"],
  17487. "additionalProperties": false
  17488. },
  17489. "text": {
  17490. "type": "string"
  17491. },
  17492. "files": {
  17493. "type": "array",
  17494. "items": {
  17495. "$ref": "#/components/schemas/PromptFileAttachment"
  17496. }
  17497. },
  17498. "agents": {
  17499. "type": "array",
  17500. "items": {
  17501. "$ref": "#/components/schemas/PromptAgentAttachment"
  17502. }
  17503. },
  17504. "type": {
  17505. "type": "string",
  17506. "enum": ["user"]
  17507. }
  17508. },
  17509. "required": ["id", "time", "text", "type"],
  17510. "additionalProperties": false
  17511. },
  17512. "SessionMessageSynthetic": {
  17513. "type": "object",
  17514. "properties": {
  17515. "id": {
  17516. "type": "string"
  17517. },
  17518. "metadata": {
  17519. "type": "object"
  17520. },
  17521. "time": {
  17522. "type": "object",
  17523. "properties": {
  17524. "created": {
  17525. "type": "number"
  17526. }
  17527. },
  17528. "required": ["created"],
  17529. "additionalProperties": false
  17530. },
  17531. "sessionID": {
  17532. "type": "string"
  17533. },
  17534. "text": {
  17535. "type": "string"
  17536. },
  17537. "type": {
  17538. "type": "string",
  17539. "enum": ["synthetic"]
  17540. }
  17541. },
  17542. "required": ["id", "time", "sessionID", "text", "type"],
  17543. "additionalProperties": false
  17544. },
  17545. "SessionMessageShell": {
  17546. "type": "object",
  17547. "properties": {
  17548. "id": {
  17549. "type": "string"
  17550. },
  17551. "metadata": {
  17552. "type": "object"
  17553. },
  17554. "time": {
  17555. "type": "object",
  17556. "properties": {
  17557. "created": {
  17558. "type": "number"
  17559. },
  17560. "completed": {
  17561. "type": "number"
  17562. }
  17563. },
  17564. "required": ["created"],
  17565. "additionalProperties": false
  17566. },
  17567. "type": {
  17568. "type": "string",
  17569. "enum": ["shell"]
  17570. },
  17571. "callID": {
  17572. "type": "string"
  17573. },
  17574. "command": {
  17575. "type": "string"
  17576. },
  17577. "output": {
  17578. "type": "string"
  17579. }
  17580. },
  17581. "required": ["id", "time", "type", "callID", "command", "output"],
  17582. "additionalProperties": false
  17583. },
  17584. "SessionMessageAssistantText": {
  17585. "type": "object",
  17586. "properties": {
  17587. "type": {
  17588. "type": "string",
  17589. "enum": ["text"]
  17590. },
  17591. "text": {
  17592. "type": "string"
  17593. }
  17594. },
  17595. "required": ["type", "text"],
  17596. "additionalProperties": false
  17597. },
  17598. "SessionMessageAssistantReasoning": {
  17599. "type": "object",
  17600. "properties": {
  17601. "type": {
  17602. "type": "string",
  17603. "enum": ["reasoning"]
  17604. },
  17605. "id": {
  17606. "type": "string"
  17607. },
  17608. "text": {
  17609. "type": "string"
  17610. }
  17611. },
  17612. "required": ["type", "id", "text"],
  17613. "additionalProperties": false
  17614. },
  17615. "SessionMessageToolStatePending": {
  17616. "type": "object",
  17617. "properties": {
  17618. "status": {
  17619. "type": "string",
  17620. "enum": ["pending"]
  17621. },
  17622. "input": {
  17623. "type": "string"
  17624. }
  17625. },
  17626. "required": ["status", "input"],
  17627. "additionalProperties": false
  17628. },
  17629. "SessionMessageToolStateRunning": {
  17630. "type": "object",
  17631. "properties": {
  17632. "status": {
  17633. "type": "string",
  17634. "enum": ["running"]
  17635. },
  17636. "input": {
  17637. "type": "object"
  17638. },
  17639. "structured": {
  17640. "type": "object"
  17641. },
  17642. "content": {
  17643. "type": "array",
  17644. "items": {
  17645. "anyOf": [
  17646. {
  17647. "$ref": "#/components/schemas/ToolTextContent"
  17648. },
  17649. {
  17650. "$ref": "#/components/schemas/ToolFileContent"
  17651. }
  17652. ]
  17653. }
  17654. }
  17655. },
  17656. "required": ["status", "input", "structured", "content"],
  17657. "additionalProperties": false
  17658. },
  17659. "SessionMessageToolStateCompleted": {
  17660. "type": "object",
  17661. "properties": {
  17662. "status": {
  17663. "type": "string",
  17664. "enum": ["completed"]
  17665. },
  17666. "input": {
  17667. "type": "object"
  17668. },
  17669. "attachments": {
  17670. "type": "array",
  17671. "items": {
  17672. "$ref": "#/components/schemas/PromptFileAttachment"
  17673. }
  17674. },
  17675. "content": {
  17676. "type": "array",
  17677. "items": {
  17678. "anyOf": [
  17679. {
  17680. "$ref": "#/components/schemas/ToolTextContent"
  17681. },
  17682. {
  17683. "$ref": "#/components/schemas/ToolFileContent"
  17684. }
  17685. ]
  17686. }
  17687. },
  17688. "structured": {
  17689. "type": "object"
  17690. }
  17691. },
  17692. "required": ["status", "input", "content", "structured"],
  17693. "additionalProperties": false
  17694. },
  17695. "SessionMessageToolStateError": {
  17696. "type": "object",
  17697. "properties": {
  17698. "status": {
  17699. "type": "string",
  17700. "enum": ["error"]
  17701. },
  17702. "input": {
  17703. "type": "object"
  17704. },
  17705. "content": {
  17706. "type": "array",
  17707. "items": {
  17708. "anyOf": [
  17709. {
  17710. "$ref": "#/components/schemas/ToolTextContent"
  17711. },
  17712. {
  17713. "$ref": "#/components/schemas/ToolFileContent"
  17714. }
  17715. ]
  17716. }
  17717. },
  17718. "structured": {
  17719. "type": "object"
  17720. },
  17721. "error": {
  17722. "$ref": "#/components/schemas/SessionErrorUnknown"
  17723. }
  17724. },
  17725. "required": ["status", "input", "content", "structured", "error"],
  17726. "additionalProperties": false
  17727. },
  17728. "SessionMessageAssistantTool": {
  17729. "type": "object",
  17730. "properties": {
  17731. "type": {
  17732. "type": "string",
  17733. "enum": ["tool"]
  17734. },
  17735. "id": {
  17736. "type": "string"
  17737. },
  17738. "name": {
  17739. "type": "string"
  17740. },
  17741. "provider": {
  17742. "type": "object",
  17743. "properties": {
  17744. "executed": {
  17745. "type": "boolean"
  17746. },
  17747. "metadata": {
  17748. "type": "object"
  17749. }
  17750. },
  17751. "required": ["executed"],
  17752. "additionalProperties": false
  17753. },
  17754. "state": {
  17755. "anyOf": [
  17756. {
  17757. "$ref": "#/components/schemas/SessionMessageToolStatePending"
  17758. },
  17759. {
  17760. "$ref": "#/components/schemas/SessionMessageToolStateRunning"
  17761. },
  17762. {
  17763. "$ref": "#/components/schemas/SessionMessageToolStateCompleted"
  17764. },
  17765. {
  17766. "$ref": "#/components/schemas/SessionMessageToolStateError"
  17767. }
  17768. ]
  17769. },
  17770. "time": {
  17771. "type": "object",
  17772. "properties": {
  17773. "created": {
  17774. "type": "number"
  17775. },
  17776. "ran": {
  17777. "type": "number"
  17778. },
  17779. "completed": {
  17780. "type": "number"
  17781. },
  17782. "pruned": {
  17783. "type": "number"
  17784. }
  17785. },
  17786. "required": ["created"],
  17787. "additionalProperties": false
  17788. }
  17789. },
  17790. "required": ["type", "id", "name", "state", "time"],
  17791. "additionalProperties": false
  17792. },
  17793. "SessionMessageAssistant": {
  17794. "type": "object",
  17795. "properties": {
  17796. "id": {
  17797. "type": "string"
  17798. },
  17799. "metadata": {
  17800. "type": "object"
  17801. },
  17802. "time": {
  17803. "type": "object",
  17804. "properties": {
  17805. "created": {
  17806. "type": "number"
  17807. },
  17808. "completed": {
  17809. "type": "number"
  17810. }
  17811. },
  17812. "required": ["created"],
  17813. "additionalProperties": false
  17814. },
  17815. "type": {
  17816. "type": "string",
  17817. "enum": ["assistant"]
  17818. },
  17819. "agent": {
  17820. "type": "string"
  17821. },
  17822. "model": {
  17823. "type": "object",
  17824. "properties": {
  17825. "id": {
  17826. "type": "string"
  17827. },
  17828. "providerID": {
  17829. "type": "string"
  17830. },
  17831. "variant": {
  17832. "type": "string"
  17833. }
  17834. },
  17835. "required": ["id", "providerID", "variant"],
  17836. "additionalProperties": false
  17837. },
  17838. "content": {
  17839. "type": "array",
  17840. "items": {
  17841. "anyOf": [
  17842. {
  17843. "$ref": "#/components/schemas/SessionMessageAssistantText"
  17844. },
  17845. {
  17846. "$ref": "#/components/schemas/SessionMessageAssistantReasoning"
  17847. },
  17848. {
  17849. "$ref": "#/components/schemas/SessionMessageAssistantTool"
  17850. }
  17851. ]
  17852. }
  17853. },
  17854. "snapshot": {
  17855. "type": "object",
  17856. "properties": {
  17857. "start": {
  17858. "type": "string"
  17859. },
  17860. "end": {
  17861. "type": "string"
  17862. }
  17863. },
  17864. "additionalProperties": false
  17865. },
  17866. "finish": {
  17867. "type": "string"
  17868. },
  17869. "cost": {
  17870. "type": "number"
  17871. },
  17872. "tokens": {
  17873. "type": "object",
  17874. "properties": {
  17875. "input": {
  17876. "type": "number"
  17877. },
  17878. "output": {
  17879. "type": "number"
  17880. },
  17881. "reasoning": {
  17882. "type": "number"
  17883. },
  17884. "cache": {
  17885. "type": "object",
  17886. "properties": {
  17887. "read": {
  17888. "type": "number"
  17889. },
  17890. "write": {
  17891. "type": "number"
  17892. }
  17893. },
  17894. "required": ["read", "write"],
  17895. "additionalProperties": false
  17896. }
  17897. },
  17898. "required": ["input", "output", "reasoning", "cache"],
  17899. "additionalProperties": false
  17900. },
  17901. "error": {
  17902. "$ref": "#/components/schemas/SessionErrorUnknown"
  17903. }
  17904. },
  17905. "required": ["id", "time", "type", "agent", "model", "content"],
  17906. "additionalProperties": false
  17907. },
  17908. "SessionMessageCompaction": {
  17909. "type": "object",
  17910. "properties": {
  17911. "type": {
  17912. "type": "string",
  17913. "enum": ["compaction"]
  17914. },
  17915. "reason": {
  17916. "type": "string",
  17917. "enum": ["auto", "manual"]
  17918. },
  17919. "summary": {
  17920. "type": "string"
  17921. },
  17922. "include": {
  17923. "type": "string"
  17924. },
  17925. "id": {
  17926. "type": "string"
  17927. },
  17928. "metadata": {
  17929. "type": "object"
  17930. },
  17931. "time": {
  17932. "type": "object",
  17933. "properties": {
  17934. "created": {
  17935. "type": "number"
  17936. }
  17937. },
  17938. "required": ["created"],
  17939. "additionalProperties": false
  17940. }
  17941. },
  17942. "required": ["type", "reason", "summary", "id", "time"],
  17943. "additionalProperties": false
  17944. },
  17945. "SessionMessage": {
  17946. "anyOf": [
  17947. {
  17948. "$ref": "#/components/schemas/SessionMessageAgentSwitched"
  17949. },
  17950. {
  17951. "$ref": "#/components/schemas/SessionMessageModelSwitched"
  17952. },
  17953. {
  17954. "$ref": "#/components/schemas/SessionMessageUser"
  17955. },
  17956. {
  17957. "$ref": "#/components/schemas/SessionMessageSynthetic"
  17958. },
  17959. {
  17960. "$ref": "#/components/schemas/SessionMessageShell"
  17961. },
  17962. {
  17963. "$ref": "#/components/schemas/SessionMessageAssistant"
  17964. },
  17965. {
  17966. "$ref": "#/components/schemas/SessionMessageCompaction"
  17967. }
  17968. ]
  17969. },
  17970. "EventTuiToastShow1": {
  17971. "type": "object",
  17972. "properties": {
  17973. "id": {
  17974. "type": "string"
  17975. },
  17976. "type": {
  17977. "type": "string",
  17978. "enum": ["tui.toast.show"]
  17979. },
  17980. "properties": {
  17981. "type": "object",
  17982. "properties": {
  17983. "title": {
  17984. "type": "string"
  17985. },
  17986. "message": {
  17987. "type": "string"
  17988. },
  17989. "variant": {
  17990. "type": "string",
  17991. "enum": ["info", "success", "warning", "error"]
  17992. },
  17993. "duration": {
  17994. "type": "integer",
  17995. "exclusiveMinimum": 0
  17996. }
  17997. },
  17998. "required": ["message", "variant"],
  17999. "additionalProperties": false
  18000. }
  18001. },
  18002. "required": ["id", "type", "properties"],
  18003. "additionalProperties": false
  18004. },
  18005. "BadRequestError": {
  18006. "type": "object",
  18007. "required": ["data", "errors", "success"],
  18008. "properties": {
  18009. "data": {},
  18010. "errors": {
  18011. "type": "array",
  18012. "items": {
  18013. "type": "object",
  18014. "additionalProperties": {}
  18015. }
  18016. },
  18017. "success": {
  18018. "type": "boolean",
  18019. "enum": [false]
  18020. }
  18021. }
  18022. },
  18023. "NotFoundError": {
  18024. "type": "object",
  18025. "required": ["name", "data"],
  18026. "properties": {
  18027. "name": {
  18028. "type": "string",
  18029. "enum": ["NotFoundError"]
  18030. },
  18031. "data": {
  18032. "type": "object",
  18033. "required": ["message"],
  18034. "properties": {
  18035. "message": {
  18036. "type": "string"
  18037. }
  18038. }
  18039. }
  18040. }
  18041. }
  18042. }
  18043. },
  18044. "security": [],
  18045. "tags": [
  18046. {
  18047. "name": "control",
  18048. "description": "Control plane routes."
  18049. },
  18050. {
  18051. "name": "global",
  18052. "description": "Global server routes."
  18053. },
  18054. {
  18055. "name": "event",
  18056. "description": "Instance event stream route."
  18057. },
  18058. {
  18059. "name": "config",
  18060. "description": "Experimental HttpApi config routes."
  18061. },
  18062. {
  18063. "name": "experimental",
  18064. "description": "Experimental HttpApi read-only routes."
  18065. },
  18066. {
  18067. "name": "file",
  18068. "description": "Experimental HttpApi file routes."
  18069. },
  18070. {
  18071. "name": "instance",
  18072. "description": "Experimental HttpApi instance read routes."
  18073. },
  18074. {
  18075. "name": "mcp",
  18076. "description": "Experimental HttpApi MCP routes."
  18077. },
  18078. {
  18079. "name": "project",
  18080. "description": "Experimental HttpApi project routes."
  18081. },
  18082. {
  18083. "name": "pty",
  18084. "description": "Experimental HttpApi PTY routes."
  18085. },
  18086. {
  18087. "name": "question",
  18088. "description": "Question routes."
  18089. },
  18090. {
  18091. "name": "permission",
  18092. "description": "Experimental HttpApi permission routes."
  18093. },
  18094. {
  18095. "name": "provider",
  18096. "description": "Experimental HttpApi provider routes."
  18097. },
  18098. {
  18099. "name": "session",
  18100. "description": "Experimental HttpApi session routes."
  18101. },
  18102. {
  18103. "name": "sync",
  18104. "description": "Experimental HttpApi sync routes."
  18105. },
  18106. {
  18107. "name": "v2",
  18108. "description": "Experimental v2 routes."
  18109. },
  18110. {
  18111. "name": "v2 messages",
  18112. "description": "Experimental v2 message routes."
  18113. },
  18114. {
  18115. "name": "tui",
  18116. "description": "Experimental HttpApi TUI routes."
  18117. },
  18118. {
  18119. "name": "workspace",
  18120. "description": "Experimental HttpApi workspace routes."
  18121. },
  18122. {
  18123. "name": "pty",
  18124. "description": "PTY websocket route."
  18125. }
  18126. ]
  18127. }