openapi.json 510 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799
  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. "400": {
  223. "description": "Bad request",
  224. "content": {
  225. "application/json": {
  226. "schema": {
  227. "$ref": "#/components/schemas/BadRequestError"
  228. }
  229. }
  230. }
  231. }
  232. },
  233. "description": "Get health information about the OpenCode server.",
  234. "summary": "Get health",
  235. "x-codeSamples": [
  236. {
  237. "lang": "js",
  238. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.health({\n ...\n})"
  239. }
  240. ]
  241. }
  242. },
  243. "/global/event": {
  244. "get": {
  245. "tags": ["global"],
  246. "operationId": "global.event",
  247. "parameters": [],
  248. "responses": {
  249. "200": {
  250. "description": "Event stream",
  251. "content": {
  252. "text/event-stream": {
  253. "schema": {
  254. "$ref": "#/components/schemas/GlobalEvent"
  255. }
  256. }
  257. }
  258. },
  259. "400": {
  260. "description": "Bad request",
  261. "content": {
  262. "application/json": {
  263. "schema": {
  264. "$ref": "#/components/schemas/BadRequestError"
  265. }
  266. }
  267. }
  268. }
  269. },
  270. "description": "Subscribe to global events from the OpenCode system using server-sent events.",
  271. "summary": "Get global events",
  272. "x-codeSamples": [
  273. {
  274. "lang": "js",
  275. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.event({\n ...\n})"
  276. }
  277. ]
  278. }
  279. },
  280. "/global/config": {
  281. "get": {
  282. "tags": ["global"],
  283. "operationId": "global.config.get",
  284. "parameters": [],
  285. "responses": {
  286. "200": {
  287. "description": "Get global config info",
  288. "content": {
  289. "application/json": {
  290. "schema": {
  291. "$ref": "#/components/schemas/Config"
  292. }
  293. }
  294. }
  295. },
  296. "400": {
  297. "description": "Bad request",
  298. "content": {
  299. "application/json": {
  300. "schema": {
  301. "$ref": "#/components/schemas/BadRequestError"
  302. }
  303. }
  304. }
  305. }
  306. },
  307. "description": "Retrieve the current global OpenCode configuration settings and preferences.",
  308. "summary": "Get global configuration",
  309. "x-codeSamples": [
  310. {
  311. "lang": "js",
  312. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.config.get({\n ...\n})"
  313. }
  314. ]
  315. },
  316. "patch": {
  317. "tags": ["global"],
  318. "operationId": "global.config.update",
  319. "parameters": [],
  320. "responses": {
  321. "200": {
  322. "description": "Successfully updated global config",
  323. "content": {
  324. "application/json": {
  325. "schema": {
  326. "$ref": "#/components/schemas/Config"
  327. }
  328. }
  329. }
  330. },
  331. "400": {
  332. "description": "Bad request",
  333. "content": {
  334. "application/json": {
  335. "schema": {
  336. "$ref": "#/components/schemas/BadRequestError"
  337. }
  338. }
  339. }
  340. }
  341. },
  342. "description": "Update global OpenCode configuration settings and preferences.",
  343. "summary": "Update global configuration",
  344. "requestBody": {
  345. "content": {
  346. "application/json": {
  347. "schema": {
  348. "$ref": "#/components/schemas/Config"
  349. }
  350. }
  351. }
  352. },
  353. "x-codeSamples": [
  354. {
  355. "lang": "js",
  356. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.config.update({\n ...\n})"
  357. }
  358. ]
  359. }
  360. },
  361. "/global/dispose": {
  362. "post": {
  363. "tags": ["global"],
  364. "operationId": "global.dispose",
  365. "parameters": [],
  366. "responses": {
  367. "200": {
  368. "description": "Global disposed",
  369. "content": {
  370. "application/json": {
  371. "schema": {
  372. "type": "boolean",
  373. "description": "Global disposed"
  374. }
  375. }
  376. }
  377. },
  378. "400": {
  379. "description": "Bad request",
  380. "content": {
  381. "application/json": {
  382. "schema": {
  383. "$ref": "#/components/schemas/BadRequestError"
  384. }
  385. }
  386. }
  387. }
  388. },
  389. "description": "Clean up and dispose all OpenCode instances, releasing all resources.",
  390. "summary": "Dispose instance",
  391. "x-codeSamples": [
  392. {
  393. "lang": "js",
  394. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.dispose({\n ...\n})"
  395. }
  396. ]
  397. }
  398. },
  399. "/global/upgrade": {
  400. "post": {
  401. "tags": ["global"],
  402. "operationId": "global.upgrade",
  403. "parameters": [],
  404. "responses": {
  405. "200": {
  406. "description": "Upgrade result",
  407. "content": {
  408. "application/json": {
  409. "schema": {
  410. "anyOf": [
  411. {
  412. "type": "object",
  413. "properties": {
  414. "success": {
  415. "type": "boolean",
  416. "enum": [true]
  417. },
  418. "version": {
  419. "type": "string"
  420. }
  421. },
  422. "required": ["success", "version"],
  423. "additionalProperties": false
  424. },
  425. {
  426. "type": "object",
  427. "properties": {
  428. "success": {
  429. "type": "boolean",
  430. "enum": [false]
  431. },
  432. "error": {
  433. "type": "string"
  434. }
  435. },
  436. "required": ["success", "error"],
  437. "additionalProperties": false
  438. }
  439. ],
  440. "description": "Upgrade result"
  441. }
  442. }
  443. }
  444. },
  445. "400": {
  446. "description": "Bad request",
  447. "content": {
  448. "application/json": {
  449. "schema": {
  450. "$ref": "#/components/schemas/BadRequestError"
  451. }
  452. }
  453. }
  454. }
  455. },
  456. "description": "Upgrade opencode to the specified version or latest if not specified.",
  457. "summary": "Upgrade opencode",
  458. "requestBody": {
  459. "content": {
  460. "application/json": {
  461. "schema": {
  462. "type": "object",
  463. "properties": {
  464. "target": {
  465. "type": "string"
  466. }
  467. },
  468. "additionalProperties": false
  469. }
  470. }
  471. }
  472. },
  473. "x-codeSamples": [
  474. {
  475. "lang": "js",
  476. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.upgrade({\n ...\n})"
  477. }
  478. ]
  479. }
  480. },
  481. "/event": {
  482. "get": {
  483. "tags": ["event"],
  484. "operationId": "event.subscribe",
  485. "parameters": [
  486. {
  487. "name": "directory",
  488. "in": "query",
  489. "required": false,
  490. "schema": {
  491. "type": "string"
  492. }
  493. },
  494. {
  495. "name": "workspace",
  496. "in": "query",
  497. "required": false,
  498. "schema": {
  499. "type": "string"
  500. }
  501. }
  502. ],
  503. "responses": {
  504. "200": {
  505. "description": "Event stream",
  506. "content": {
  507. "text/event-stream": {
  508. "schema": {
  509. "$ref": "#/components/schemas/Event"
  510. }
  511. }
  512. }
  513. },
  514. "400": {
  515. "description": "Bad request",
  516. "content": {
  517. "application/json": {
  518. "schema": {
  519. "$ref": "#/components/schemas/BadRequestError"
  520. }
  521. }
  522. }
  523. }
  524. },
  525. "description": "Get events",
  526. "summary": "Subscribe to events",
  527. "x-codeSamples": [
  528. {
  529. "lang": "js",
  530. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.event.subscribe({\n ...\n})"
  531. }
  532. ]
  533. }
  534. },
  535. "/config": {
  536. "get": {
  537. "tags": ["config"],
  538. "operationId": "config.get",
  539. "parameters": [
  540. {
  541. "name": "directory",
  542. "in": "query",
  543. "required": false,
  544. "schema": {
  545. "type": "string"
  546. }
  547. },
  548. {
  549. "name": "workspace",
  550. "in": "query",
  551. "required": false,
  552. "schema": {
  553. "type": "string"
  554. }
  555. }
  556. ],
  557. "responses": {
  558. "200": {
  559. "description": "Get config info",
  560. "content": {
  561. "application/json": {
  562. "schema": {
  563. "$ref": "#/components/schemas/Config"
  564. }
  565. }
  566. }
  567. },
  568. "400": {
  569. "description": "Bad request",
  570. "content": {
  571. "application/json": {
  572. "schema": {
  573. "$ref": "#/components/schemas/BadRequestError"
  574. }
  575. }
  576. }
  577. }
  578. },
  579. "description": "Retrieve the current OpenCode configuration settings and preferences.",
  580. "summary": "Get configuration",
  581. "x-codeSamples": [
  582. {
  583. "lang": "js",
  584. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.config.get({\n ...\n})"
  585. }
  586. ]
  587. },
  588. "patch": {
  589. "tags": ["config"],
  590. "operationId": "config.update",
  591. "parameters": [
  592. {
  593. "name": "directory",
  594. "in": "query",
  595. "required": false,
  596. "schema": {
  597. "type": "string"
  598. }
  599. },
  600. {
  601. "name": "workspace",
  602. "in": "query",
  603. "required": false,
  604. "schema": {
  605. "type": "string"
  606. }
  607. }
  608. ],
  609. "responses": {
  610. "200": {
  611. "description": "Successfully updated config",
  612. "content": {
  613. "application/json": {
  614. "schema": {
  615. "$ref": "#/components/schemas/Config"
  616. }
  617. }
  618. }
  619. },
  620. "400": {
  621. "description": "Bad request",
  622. "content": {
  623. "application/json": {
  624. "schema": {
  625. "$ref": "#/components/schemas/BadRequestError"
  626. }
  627. }
  628. }
  629. }
  630. },
  631. "description": "Update OpenCode configuration settings and preferences.",
  632. "summary": "Update configuration",
  633. "requestBody": {
  634. "content": {
  635. "application/json": {
  636. "schema": {
  637. "$ref": "#/components/schemas/Config"
  638. }
  639. }
  640. }
  641. },
  642. "x-codeSamples": [
  643. {
  644. "lang": "js",
  645. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.config.update({\n ...\n})"
  646. }
  647. ]
  648. }
  649. },
  650. "/config/providers": {
  651. "get": {
  652. "tags": ["config"],
  653. "operationId": "config.providers",
  654. "parameters": [
  655. {
  656. "name": "directory",
  657. "in": "query",
  658. "required": false,
  659. "schema": {
  660. "type": "string"
  661. }
  662. },
  663. {
  664. "name": "workspace",
  665. "in": "query",
  666. "required": false,
  667. "schema": {
  668. "type": "string"
  669. }
  670. }
  671. ],
  672. "responses": {
  673. "200": {
  674. "description": "List of providers",
  675. "content": {
  676. "application/json": {
  677. "schema": {
  678. "type": "object",
  679. "properties": {
  680. "providers": {
  681. "type": "array",
  682. "items": {
  683. "$ref": "#/components/schemas/Provider"
  684. }
  685. },
  686. "default": {
  687. "type": "object",
  688. "additionalProperties": {
  689. "type": "string"
  690. }
  691. }
  692. },
  693. "required": ["providers", "default"],
  694. "additionalProperties": false,
  695. "description": "List of providers"
  696. }
  697. }
  698. }
  699. },
  700. "400": {
  701. "description": "Bad request",
  702. "content": {
  703. "application/json": {
  704. "schema": {
  705. "$ref": "#/components/schemas/BadRequestError"
  706. }
  707. }
  708. }
  709. }
  710. },
  711. "description": "Get a list of all configured AI providers and their default models.",
  712. "summary": "List config providers",
  713. "x-codeSamples": [
  714. {
  715. "lang": "js",
  716. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.config.providers({\n ...\n})"
  717. }
  718. ]
  719. }
  720. },
  721. "/experimental/console": {
  722. "get": {
  723. "tags": ["experimental"],
  724. "operationId": "experimental.console.get",
  725. "parameters": [
  726. {
  727. "name": "directory",
  728. "in": "query",
  729. "required": false,
  730. "schema": {
  731. "type": "string"
  732. }
  733. },
  734. {
  735. "name": "workspace",
  736. "in": "query",
  737. "required": false,
  738. "schema": {
  739. "type": "string"
  740. }
  741. }
  742. ],
  743. "responses": {
  744. "200": {
  745. "description": "Active Console provider metadata",
  746. "content": {
  747. "application/json": {
  748. "schema": {
  749. "$ref": "#/components/schemas/ConsoleState"
  750. }
  751. }
  752. }
  753. },
  754. "400": {
  755. "description": "Bad request",
  756. "content": {
  757. "application/json": {
  758. "schema": {
  759. "$ref": "#/components/schemas/BadRequestError"
  760. }
  761. }
  762. }
  763. }
  764. },
  765. "description": "Get the active Console org name and the set of provider IDs managed by that Console org.",
  766. "summary": "Get active Console provider metadata",
  767. "x-codeSamples": [
  768. {
  769. "lang": "js",
  770. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.console.get({\n ...\n})"
  771. }
  772. ]
  773. }
  774. },
  775. "/experimental/console/orgs": {
  776. "get": {
  777. "tags": ["experimental"],
  778. "operationId": "experimental.console.listOrgs",
  779. "parameters": [
  780. {
  781. "name": "directory",
  782. "in": "query",
  783. "required": false,
  784. "schema": {
  785. "type": "string"
  786. }
  787. },
  788. {
  789. "name": "workspace",
  790. "in": "query",
  791. "required": false,
  792. "schema": {
  793. "type": "string"
  794. }
  795. }
  796. ],
  797. "responses": {
  798. "200": {
  799. "description": "Switchable Console orgs",
  800. "content": {
  801. "application/json": {
  802. "schema": {
  803. "type": "object",
  804. "properties": {
  805. "orgs": {
  806. "type": "array",
  807. "items": {
  808. "type": "object",
  809. "properties": {
  810. "accountID": {
  811. "type": "string"
  812. },
  813. "accountEmail": {
  814. "type": "string"
  815. },
  816. "accountUrl": {
  817. "type": "string"
  818. },
  819. "orgID": {
  820. "type": "string"
  821. },
  822. "orgName": {
  823. "type": "string"
  824. },
  825. "active": {
  826. "type": "boolean"
  827. }
  828. },
  829. "required": ["accountID", "accountEmail", "accountUrl", "orgID", "orgName", "active"],
  830. "additionalProperties": false
  831. }
  832. }
  833. },
  834. "required": ["orgs"],
  835. "additionalProperties": false,
  836. "description": "Switchable Console orgs"
  837. }
  838. }
  839. }
  840. },
  841. "400": {
  842. "description": "Bad request",
  843. "content": {
  844. "application/json": {
  845. "schema": {
  846. "$ref": "#/components/schemas/BadRequestError"
  847. }
  848. }
  849. }
  850. }
  851. },
  852. "description": "Get the available Console orgs across logged-in accounts, including the current active org.",
  853. "summary": "List switchable Console orgs",
  854. "x-codeSamples": [
  855. {
  856. "lang": "js",
  857. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.console.listOrgs({\n ...\n})"
  858. }
  859. ]
  860. }
  861. },
  862. "/experimental/console/switch": {
  863. "post": {
  864. "tags": ["experimental"],
  865. "operationId": "experimental.console.switchOrg",
  866. "parameters": [
  867. {
  868. "name": "directory",
  869. "in": "query",
  870. "required": false,
  871. "schema": {
  872. "type": "string"
  873. }
  874. },
  875. {
  876. "name": "workspace",
  877. "in": "query",
  878. "required": false,
  879. "schema": {
  880. "type": "string"
  881. }
  882. }
  883. ],
  884. "responses": {
  885. "200": {
  886. "description": "Switch success",
  887. "content": {
  888. "application/json": {
  889. "schema": {
  890. "type": "boolean",
  891. "description": "Switch success"
  892. }
  893. }
  894. }
  895. }
  896. },
  897. "description": "Persist a new active Console account/org selection for the current local OpenCode state.",
  898. "summary": "Switch active Console org",
  899. "requestBody": {
  900. "content": {
  901. "application/json": {
  902. "schema": {
  903. "type": "object",
  904. "properties": {
  905. "accountID": {
  906. "type": "string"
  907. },
  908. "orgID": {
  909. "type": "string"
  910. }
  911. },
  912. "required": ["accountID", "orgID"],
  913. "additionalProperties": false
  914. }
  915. }
  916. }
  917. },
  918. "x-codeSamples": [
  919. {
  920. "lang": "js",
  921. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.console.switchOrg({\n ...\n})"
  922. }
  923. ]
  924. }
  925. },
  926. "/experimental/tool": {
  927. "get": {
  928. "tags": ["experimental"],
  929. "operationId": "tool.list",
  930. "parameters": [
  931. {
  932. "name": "directory",
  933. "in": "query",
  934. "required": false,
  935. "schema": {
  936. "type": "string"
  937. }
  938. },
  939. {
  940. "name": "workspace",
  941. "in": "query",
  942. "required": false,
  943. "schema": {
  944. "type": "string"
  945. }
  946. },
  947. {
  948. "name": "provider",
  949. "in": "query",
  950. "schema": {
  951. "type": "string"
  952. },
  953. "required": true
  954. },
  955. {
  956. "name": "model",
  957. "in": "query",
  958. "schema": {
  959. "type": "string"
  960. },
  961. "required": true
  962. }
  963. ],
  964. "responses": {
  965. "200": {
  966. "description": "Tools",
  967. "content": {
  968. "application/json": {
  969. "schema": {
  970. "$ref": "#/components/schemas/ToolList"
  971. }
  972. }
  973. }
  974. },
  975. "400": {
  976. "description": "Bad request",
  977. "content": {
  978. "application/json": {
  979. "schema": {
  980. "$ref": "#/components/schemas/BadRequestError"
  981. }
  982. }
  983. }
  984. }
  985. },
  986. "description": "Get a list of available tools with their JSON schema parameters for a specific provider and model combination.",
  987. "summary": "List tools",
  988. "x-codeSamples": [
  989. {
  990. "lang": "js",
  991. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tool.list({\n ...\n})"
  992. }
  993. ]
  994. }
  995. },
  996. "/experimental/tool/ids": {
  997. "get": {
  998. "tags": ["experimental"],
  999. "operationId": "tool.ids",
  1000. "parameters": [
  1001. {
  1002. "name": "directory",
  1003. "in": "query",
  1004. "required": false,
  1005. "schema": {
  1006. "type": "string"
  1007. }
  1008. },
  1009. {
  1010. "name": "workspace",
  1011. "in": "query",
  1012. "required": false,
  1013. "schema": {
  1014. "type": "string"
  1015. }
  1016. }
  1017. ],
  1018. "responses": {
  1019. "200": {
  1020. "description": "Tool IDs",
  1021. "content": {
  1022. "application/json": {
  1023. "schema": {
  1024. "$ref": "#/components/schemas/ToolIDs"
  1025. }
  1026. }
  1027. }
  1028. },
  1029. "400": {
  1030. "description": "Bad request",
  1031. "content": {
  1032. "application/json": {
  1033. "schema": {
  1034. "$ref": "#/components/schemas/BadRequestError"
  1035. }
  1036. }
  1037. }
  1038. }
  1039. },
  1040. "description": "Get a list of all available tool IDs, including both built-in tools and dynamically registered tools.",
  1041. "summary": "List tool IDs",
  1042. "x-codeSamples": [
  1043. {
  1044. "lang": "js",
  1045. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tool.ids({\n ...\n})"
  1046. }
  1047. ]
  1048. }
  1049. },
  1050. "/experimental/worktree": {
  1051. "get": {
  1052. "tags": ["experimental"],
  1053. "operationId": "worktree.list",
  1054. "parameters": [
  1055. {
  1056. "name": "directory",
  1057. "in": "query",
  1058. "required": false,
  1059. "schema": {
  1060. "type": "string"
  1061. }
  1062. },
  1063. {
  1064. "name": "workspace",
  1065. "in": "query",
  1066. "required": false,
  1067. "schema": {
  1068. "type": "string"
  1069. }
  1070. }
  1071. ],
  1072. "responses": {
  1073. "200": {
  1074. "description": "List of worktree directories",
  1075. "content": {
  1076. "application/json": {
  1077. "schema": {
  1078. "type": "array",
  1079. "items": {
  1080. "type": "string"
  1081. },
  1082. "description": "List of worktree directories"
  1083. }
  1084. }
  1085. }
  1086. },
  1087. "400": {
  1088. "description": "Bad request",
  1089. "content": {
  1090. "application/json": {
  1091. "schema": {
  1092. "$ref": "#/components/schemas/BadRequestError"
  1093. }
  1094. }
  1095. }
  1096. }
  1097. },
  1098. "description": "List all sandbox worktrees for the current project.",
  1099. "summary": "List worktrees",
  1100. "x-codeSamples": [
  1101. {
  1102. "lang": "js",
  1103. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.list({\n ...\n})"
  1104. }
  1105. ]
  1106. },
  1107. "post": {
  1108. "tags": ["experimental"],
  1109. "operationId": "worktree.create",
  1110. "parameters": [
  1111. {
  1112. "name": "directory",
  1113. "in": "query",
  1114. "required": false,
  1115. "schema": {
  1116. "type": "string"
  1117. }
  1118. },
  1119. {
  1120. "name": "workspace",
  1121. "in": "query",
  1122. "required": false,
  1123. "schema": {
  1124. "type": "string"
  1125. }
  1126. }
  1127. ],
  1128. "responses": {
  1129. "200": {
  1130. "description": "Worktree created",
  1131. "content": {
  1132. "application/json": {
  1133. "schema": {
  1134. "$ref": "#/components/schemas/Worktree"
  1135. }
  1136. }
  1137. }
  1138. },
  1139. "400": {
  1140. "description": "Bad request",
  1141. "content": {
  1142. "application/json": {
  1143. "schema": {
  1144. "$ref": "#/components/schemas/BadRequestError"
  1145. }
  1146. }
  1147. }
  1148. }
  1149. },
  1150. "description": "Create a new git worktree for the current project and run any configured startup scripts.",
  1151. "summary": "Create worktree",
  1152. "requestBody": {
  1153. "content": {
  1154. "application/json": {
  1155. "schema": {
  1156. "$ref": "#/components/schemas/WorktreeCreateInput"
  1157. }
  1158. }
  1159. }
  1160. },
  1161. "x-codeSamples": [
  1162. {
  1163. "lang": "js",
  1164. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.create({\n ...\n})"
  1165. }
  1166. ]
  1167. },
  1168. "delete": {
  1169. "tags": ["experimental"],
  1170. "operationId": "worktree.remove",
  1171. "parameters": [
  1172. {
  1173. "name": "directory",
  1174. "in": "query",
  1175. "required": false,
  1176. "schema": {
  1177. "type": "string"
  1178. }
  1179. },
  1180. {
  1181. "name": "workspace",
  1182. "in": "query",
  1183. "required": false,
  1184. "schema": {
  1185. "type": "string"
  1186. }
  1187. }
  1188. ],
  1189. "responses": {
  1190. "200": {
  1191. "description": "Worktree removed",
  1192. "content": {
  1193. "application/json": {
  1194. "schema": {
  1195. "type": "boolean",
  1196. "description": "Worktree removed"
  1197. }
  1198. }
  1199. }
  1200. },
  1201. "400": {
  1202. "description": "Bad request",
  1203. "content": {
  1204. "application/json": {
  1205. "schema": {
  1206. "$ref": "#/components/schemas/BadRequestError"
  1207. }
  1208. }
  1209. }
  1210. }
  1211. },
  1212. "description": "Remove a git worktree and delete its branch.",
  1213. "summary": "Remove worktree",
  1214. "requestBody": {
  1215. "content": {
  1216. "application/json": {
  1217. "schema": {
  1218. "$ref": "#/components/schemas/WorktreeRemoveInput"
  1219. }
  1220. }
  1221. }
  1222. },
  1223. "x-codeSamples": [
  1224. {
  1225. "lang": "js",
  1226. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.remove({\n ...\n})"
  1227. }
  1228. ]
  1229. }
  1230. },
  1231. "/experimental/worktree/reset": {
  1232. "post": {
  1233. "tags": ["experimental"],
  1234. "operationId": "worktree.reset",
  1235. "parameters": [
  1236. {
  1237. "name": "directory",
  1238. "in": "query",
  1239. "required": false,
  1240. "schema": {
  1241. "type": "string"
  1242. }
  1243. },
  1244. {
  1245. "name": "workspace",
  1246. "in": "query",
  1247. "required": false,
  1248. "schema": {
  1249. "type": "string"
  1250. }
  1251. }
  1252. ],
  1253. "responses": {
  1254. "200": {
  1255. "description": "Worktree reset",
  1256. "content": {
  1257. "application/json": {
  1258. "schema": {
  1259. "type": "boolean",
  1260. "description": "Worktree reset"
  1261. }
  1262. }
  1263. }
  1264. },
  1265. "400": {
  1266. "description": "Bad request",
  1267. "content": {
  1268. "application/json": {
  1269. "schema": {
  1270. "$ref": "#/components/schemas/BadRequestError"
  1271. }
  1272. }
  1273. }
  1274. }
  1275. },
  1276. "description": "Reset a worktree branch to the primary default branch.",
  1277. "summary": "Reset worktree",
  1278. "requestBody": {
  1279. "content": {
  1280. "application/json": {
  1281. "schema": {
  1282. "$ref": "#/components/schemas/WorktreeResetInput"
  1283. }
  1284. }
  1285. }
  1286. },
  1287. "x-codeSamples": [
  1288. {
  1289. "lang": "js",
  1290. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.reset({\n ...\n})"
  1291. }
  1292. ]
  1293. }
  1294. },
  1295. "/experimental/session": {
  1296. "get": {
  1297. "tags": ["experimental"],
  1298. "operationId": "experimental.session.list",
  1299. "parameters": [
  1300. {
  1301. "name": "directory",
  1302. "in": "query",
  1303. "required": false,
  1304. "schema": {
  1305. "type": "string"
  1306. }
  1307. },
  1308. {
  1309. "name": "workspace",
  1310. "in": "query",
  1311. "required": false,
  1312. "schema": {
  1313. "type": "string"
  1314. }
  1315. },
  1316. {
  1317. "name": "roots",
  1318. "in": "query",
  1319. "schema": {
  1320. "anyOf": [
  1321. {
  1322. "type": "boolean"
  1323. },
  1324. {
  1325. "type": "string",
  1326. "enum": ["true", "false"]
  1327. }
  1328. ]
  1329. },
  1330. "required": false
  1331. },
  1332. {
  1333. "name": "start",
  1334. "in": "query",
  1335. "schema": {
  1336. "type": "number"
  1337. },
  1338. "required": false
  1339. },
  1340. {
  1341. "name": "cursor",
  1342. "in": "query",
  1343. "schema": {
  1344. "type": "number"
  1345. },
  1346. "required": false
  1347. },
  1348. {
  1349. "name": "search",
  1350. "in": "query",
  1351. "schema": {
  1352. "type": "string"
  1353. },
  1354. "required": false
  1355. },
  1356. {
  1357. "name": "limit",
  1358. "in": "query",
  1359. "schema": {
  1360. "type": "number"
  1361. },
  1362. "required": false
  1363. },
  1364. {
  1365. "name": "archived",
  1366. "in": "query",
  1367. "schema": {
  1368. "anyOf": [
  1369. {
  1370. "type": "boolean"
  1371. },
  1372. {
  1373. "type": "string",
  1374. "enum": ["true", "false"]
  1375. }
  1376. ]
  1377. },
  1378. "required": false
  1379. }
  1380. ],
  1381. "responses": {
  1382. "200": {
  1383. "description": "List of sessions",
  1384. "content": {
  1385. "application/json": {
  1386. "schema": {
  1387. "type": "array",
  1388. "items": {
  1389. "$ref": "#/components/schemas/GlobalSession"
  1390. },
  1391. "description": "List of sessions"
  1392. }
  1393. }
  1394. }
  1395. },
  1396. "400": {
  1397. "description": "Bad request",
  1398. "content": {
  1399. "application/json": {
  1400. "schema": {
  1401. "$ref": "#/components/schemas/BadRequestError"
  1402. }
  1403. }
  1404. }
  1405. }
  1406. },
  1407. "description": "Get a list of all OpenCode sessions across projects, sorted by most recently updated. Archived sessions are excluded by default.",
  1408. "summary": "List sessions",
  1409. "x-codeSamples": [
  1410. {
  1411. "lang": "js",
  1412. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.session.list({\n ...\n})"
  1413. }
  1414. ]
  1415. }
  1416. },
  1417. "/experimental/resource": {
  1418. "get": {
  1419. "tags": ["experimental"],
  1420. "operationId": "experimental.resource.list",
  1421. "parameters": [
  1422. {
  1423. "name": "directory",
  1424. "in": "query",
  1425. "required": false,
  1426. "schema": {
  1427. "type": "string"
  1428. }
  1429. },
  1430. {
  1431. "name": "workspace",
  1432. "in": "query",
  1433. "required": false,
  1434. "schema": {
  1435. "type": "string"
  1436. }
  1437. }
  1438. ],
  1439. "responses": {
  1440. "200": {
  1441. "description": "MCP resources",
  1442. "content": {
  1443. "application/json": {
  1444. "schema": {
  1445. "type": "object",
  1446. "additionalProperties": {
  1447. "$ref": "#/components/schemas/McpResource"
  1448. },
  1449. "description": "MCP resources"
  1450. }
  1451. }
  1452. }
  1453. },
  1454. "400": {
  1455. "description": "Bad request",
  1456. "content": {
  1457. "application/json": {
  1458. "schema": {
  1459. "$ref": "#/components/schemas/BadRequestError"
  1460. }
  1461. }
  1462. }
  1463. }
  1464. },
  1465. "description": "Get all available MCP resources from connected servers. Optionally filter by name.",
  1466. "summary": "Get MCP resources",
  1467. "x-codeSamples": [
  1468. {
  1469. "lang": "js",
  1470. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.resource.list({\n ...\n})"
  1471. }
  1472. ]
  1473. }
  1474. },
  1475. "/find": {
  1476. "get": {
  1477. "tags": ["file"],
  1478. "operationId": "find.text",
  1479. "parameters": [
  1480. {
  1481. "name": "directory",
  1482. "in": "query",
  1483. "required": false,
  1484. "schema": {
  1485. "type": "string"
  1486. }
  1487. },
  1488. {
  1489. "name": "workspace",
  1490. "in": "query",
  1491. "required": false,
  1492. "schema": {
  1493. "type": "string"
  1494. }
  1495. },
  1496. {
  1497. "name": "pattern",
  1498. "in": "query",
  1499. "schema": {
  1500. "type": "string"
  1501. },
  1502. "required": true
  1503. }
  1504. ],
  1505. "responses": {
  1506. "200": {
  1507. "description": "Matches",
  1508. "content": {
  1509. "application/json": {
  1510. "schema": {
  1511. "type": "array",
  1512. "items": {
  1513. "type": "object",
  1514. "properties": {
  1515. "path": {
  1516. "type": "object",
  1517. "properties": {
  1518. "text": {
  1519. "type": "string"
  1520. }
  1521. },
  1522. "required": ["text"],
  1523. "additionalProperties": false
  1524. },
  1525. "lines": {
  1526. "type": "object",
  1527. "properties": {
  1528. "text": {
  1529. "type": "string"
  1530. }
  1531. },
  1532. "required": ["text"],
  1533. "additionalProperties": false
  1534. },
  1535. "line_number": {
  1536. "type": "integer",
  1537. "minimum": 0
  1538. },
  1539. "absolute_offset": {
  1540. "type": "integer",
  1541. "minimum": 0
  1542. },
  1543. "submatches": {
  1544. "type": "array",
  1545. "items": {
  1546. "type": "object",
  1547. "properties": {
  1548. "match": {
  1549. "type": "object",
  1550. "properties": {
  1551. "text": {
  1552. "type": "string"
  1553. }
  1554. },
  1555. "required": ["text"],
  1556. "additionalProperties": false
  1557. },
  1558. "start": {
  1559. "type": "integer",
  1560. "minimum": 0
  1561. },
  1562. "end": {
  1563. "type": "integer",
  1564. "minimum": 0
  1565. }
  1566. },
  1567. "required": ["match", "start", "end"],
  1568. "additionalProperties": false
  1569. }
  1570. }
  1571. },
  1572. "required": ["path", "lines", "line_number", "absolute_offset", "submatches"],
  1573. "additionalProperties": false
  1574. },
  1575. "description": "Matches"
  1576. }
  1577. }
  1578. }
  1579. },
  1580. "400": {
  1581. "description": "Bad request",
  1582. "content": {
  1583. "application/json": {
  1584. "schema": {
  1585. "$ref": "#/components/schemas/BadRequestError"
  1586. }
  1587. }
  1588. }
  1589. }
  1590. },
  1591. "description": "Search for text patterns across files in the project using ripgrep.",
  1592. "summary": "Find text",
  1593. "x-codeSamples": [
  1594. {
  1595. "lang": "js",
  1596. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.find.text({\n ...\n})"
  1597. }
  1598. ]
  1599. }
  1600. },
  1601. "/find/file": {
  1602. "get": {
  1603. "tags": ["file"],
  1604. "operationId": "find.files",
  1605. "parameters": [
  1606. {
  1607. "name": "directory",
  1608. "in": "query",
  1609. "required": false,
  1610. "schema": {
  1611. "type": "string"
  1612. }
  1613. },
  1614. {
  1615. "name": "workspace",
  1616. "in": "query",
  1617. "required": false,
  1618. "schema": {
  1619. "type": "string"
  1620. }
  1621. },
  1622. {
  1623. "name": "query",
  1624. "in": "query",
  1625. "schema": {
  1626. "type": "string"
  1627. },
  1628. "required": true
  1629. },
  1630. {
  1631. "name": "dirs",
  1632. "in": "query",
  1633. "schema": {
  1634. "type": "string",
  1635. "enum": ["true", "false"]
  1636. },
  1637. "required": false
  1638. },
  1639. {
  1640. "name": "type",
  1641. "in": "query",
  1642. "schema": {
  1643. "type": "string",
  1644. "enum": ["file", "directory"]
  1645. },
  1646. "required": false
  1647. },
  1648. {
  1649. "name": "limit",
  1650. "in": "query",
  1651. "schema": {
  1652. "type": "integer",
  1653. "minimum": 1,
  1654. "maximum": 200
  1655. },
  1656. "required": false
  1657. }
  1658. ],
  1659. "responses": {
  1660. "200": {
  1661. "description": "File paths",
  1662. "content": {
  1663. "application/json": {
  1664. "schema": {
  1665. "type": "array",
  1666. "items": {
  1667. "type": "string"
  1668. },
  1669. "description": "File paths"
  1670. }
  1671. }
  1672. }
  1673. },
  1674. "400": {
  1675. "description": "Bad request",
  1676. "content": {
  1677. "application/json": {
  1678. "schema": {
  1679. "$ref": "#/components/schemas/BadRequestError"
  1680. }
  1681. }
  1682. }
  1683. }
  1684. },
  1685. "description": "Search for files or directories by name or pattern in the project directory.",
  1686. "summary": "Find files",
  1687. "x-codeSamples": [
  1688. {
  1689. "lang": "js",
  1690. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.find.files({\n ...\n})"
  1691. }
  1692. ]
  1693. }
  1694. },
  1695. "/find/symbol": {
  1696. "get": {
  1697. "tags": ["file"],
  1698. "operationId": "find.symbols",
  1699. "parameters": [
  1700. {
  1701. "name": "directory",
  1702. "in": "query",
  1703. "required": false,
  1704. "schema": {
  1705. "type": "string"
  1706. }
  1707. },
  1708. {
  1709. "name": "workspace",
  1710. "in": "query",
  1711. "required": false,
  1712. "schema": {
  1713. "type": "string"
  1714. }
  1715. },
  1716. {
  1717. "name": "query",
  1718. "in": "query",
  1719. "schema": {
  1720. "type": "string"
  1721. },
  1722. "required": true
  1723. }
  1724. ],
  1725. "responses": {
  1726. "200": {
  1727. "description": "Symbols",
  1728. "content": {
  1729. "application/json": {
  1730. "schema": {
  1731. "type": "array",
  1732. "items": {
  1733. "$ref": "#/components/schemas/Symbol"
  1734. },
  1735. "description": "Symbols"
  1736. }
  1737. }
  1738. }
  1739. },
  1740. "400": {
  1741. "description": "Bad request",
  1742. "content": {
  1743. "application/json": {
  1744. "schema": {
  1745. "$ref": "#/components/schemas/BadRequestError"
  1746. }
  1747. }
  1748. }
  1749. }
  1750. },
  1751. "description": "Search for workspace symbols like functions, classes, and variables using LSP.",
  1752. "summary": "Find symbols",
  1753. "x-codeSamples": [
  1754. {
  1755. "lang": "js",
  1756. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.find.symbols({\n ...\n})"
  1757. }
  1758. ]
  1759. }
  1760. },
  1761. "/file": {
  1762. "get": {
  1763. "tags": ["file"],
  1764. "operationId": "file.list",
  1765. "parameters": [
  1766. {
  1767. "name": "directory",
  1768. "in": "query",
  1769. "required": false,
  1770. "schema": {
  1771. "type": "string"
  1772. }
  1773. },
  1774. {
  1775. "name": "workspace",
  1776. "in": "query",
  1777. "required": false,
  1778. "schema": {
  1779. "type": "string"
  1780. }
  1781. },
  1782. {
  1783. "name": "path",
  1784. "in": "query",
  1785. "schema": {
  1786. "type": "string"
  1787. },
  1788. "required": true
  1789. }
  1790. ],
  1791. "responses": {
  1792. "200": {
  1793. "description": "Files and directories",
  1794. "content": {
  1795. "application/json": {
  1796. "schema": {
  1797. "type": "array",
  1798. "items": {
  1799. "$ref": "#/components/schemas/FileNode"
  1800. },
  1801. "description": "Files and directories"
  1802. }
  1803. }
  1804. }
  1805. },
  1806. "400": {
  1807. "description": "Bad request",
  1808. "content": {
  1809. "application/json": {
  1810. "schema": {
  1811. "$ref": "#/components/schemas/BadRequestError"
  1812. }
  1813. }
  1814. }
  1815. }
  1816. },
  1817. "description": "List files and directories in a specified path.",
  1818. "summary": "List files",
  1819. "x-codeSamples": [
  1820. {
  1821. "lang": "js",
  1822. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.file.list({\n ...\n})"
  1823. }
  1824. ]
  1825. }
  1826. },
  1827. "/file/content": {
  1828. "get": {
  1829. "tags": ["file"],
  1830. "operationId": "file.read",
  1831. "parameters": [
  1832. {
  1833. "name": "directory",
  1834. "in": "query",
  1835. "required": false,
  1836. "schema": {
  1837. "type": "string"
  1838. }
  1839. },
  1840. {
  1841. "name": "workspace",
  1842. "in": "query",
  1843. "required": false,
  1844. "schema": {
  1845. "type": "string"
  1846. }
  1847. },
  1848. {
  1849. "name": "path",
  1850. "in": "query",
  1851. "schema": {
  1852. "type": "string"
  1853. },
  1854. "required": true
  1855. }
  1856. ],
  1857. "responses": {
  1858. "200": {
  1859. "description": "File content",
  1860. "content": {
  1861. "application/json": {
  1862. "schema": {
  1863. "$ref": "#/components/schemas/FileContent"
  1864. }
  1865. }
  1866. }
  1867. },
  1868. "400": {
  1869. "description": "Bad request",
  1870. "content": {
  1871. "application/json": {
  1872. "schema": {
  1873. "$ref": "#/components/schemas/BadRequestError"
  1874. }
  1875. }
  1876. }
  1877. }
  1878. },
  1879. "description": "Read the content of a specified file.",
  1880. "summary": "Read file",
  1881. "x-codeSamples": [
  1882. {
  1883. "lang": "js",
  1884. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.file.read({\n ...\n})"
  1885. }
  1886. ]
  1887. }
  1888. },
  1889. "/file/status": {
  1890. "get": {
  1891. "tags": ["file"],
  1892. "operationId": "file.status",
  1893. "parameters": [
  1894. {
  1895. "name": "directory",
  1896. "in": "query",
  1897. "required": false,
  1898. "schema": {
  1899. "type": "string"
  1900. }
  1901. },
  1902. {
  1903. "name": "workspace",
  1904. "in": "query",
  1905. "required": false,
  1906. "schema": {
  1907. "type": "string"
  1908. }
  1909. }
  1910. ],
  1911. "responses": {
  1912. "200": {
  1913. "description": "File status",
  1914. "content": {
  1915. "application/json": {
  1916. "schema": {
  1917. "type": "array",
  1918. "items": {
  1919. "$ref": "#/components/schemas/File"
  1920. },
  1921. "description": "File status"
  1922. }
  1923. }
  1924. }
  1925. },
  1926. "400": {
  1927. "description": "Bad request",
  1928. "content": {
  1929. "application/json": {
  1930. "schema": {
  1931. "$ref": "#/components/schemas/BadRequestError"
  1932. }
  1933. }
  1934. }
  1935. }
  1936. },
  1937. "description": "Get the git status of all files in the project.",
  1938. "summary": "Get file status",
  1939. "x-codeSamples": [
  1940. {
  1941. "lang": "js",
  1942. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.file.status({\n ...\n})"
  1943. }
  1944. ]
  1945. }
  1946. },
  1947. "/instance/dispose": {
  1948. "post": {
  1949. "tags": ["instance"],
  1950. "operationId": "instance.dispose",
  1951. "parameters": [
  1952. {
  1953. "name": "directory",
  1954. "in": "query",
  1955. "required": false,
  1956. "schema": {
  1957. "type": "string"
  1958. }
  1959. },
  1960. {
  1961. "name": "workspace",
  1962. "in": "query",
  1963. "required": false,
  1964. "schema": {
  1965. "type": "string"
  1966. }
  1967. }
  1968. ],
  1969. "responses": {
  1970. "200": {
  1971. "description": "Instance disposed",
  1972. "content": {
  1973. "application/json": {
  1974. "schema": {
  1975. "type": "boolean",
  1976. "description": "Instance disposed"
  1977. }
  1978. }
  1979. }
  1980. },
  1981. "400": {
  1982. "description": "Bad request",
  1983. "content": {
  1984. "application/json": {
  1985. "schema": {
  1986. "$ref": "#/components/schemas/BadRequestError"
  1987. }
  1988. }
  1989. }
  1990. }
  1991. },
  1992. "description": "Clean up and dispose the current OpenCode instance, releasing all resources.",
  1993. "summary": "Dispose instance",
  1994. "x-codeSamples": [
  1995. {
  1996. "lang": "js",
  1997. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.instance.dispose({\n ...\n})"
  1998. }
  1999. ]
  2000. }
  2001. },
  2002. "/path": {
  2003. "get": {
  2004. "tags": ["instance"],
  2005. "operationId": "path.get",
  2006. "parameters": [
  2007. {
  2008. "name": "directory",
  2009. "in": "query",
  2010. "required": false,
  2011. "schema": {
  2012. "type": "string"
  2013. }
  2014. },
  2015. {
  2016. "name": "workspace",
  2017. "in": "query",
  2018. "required": false,
  2019. "schema": {
  2020. "type": "string"
  2021. }
  2022. }
  2023. ],
  2024. "responses": {
  2025. "200": {
  2026. "description": "Path",
  2027. "content": {
  2028. "application/json": {
  2029. "schema": {
  2030. "$ref": "#/components/schemas/Path"
  2031. }
  2032. }
  2033. }
  2034. },
  2035. "400": {
  2036. "description": "Bad request",
  2037. "content": {
  2038. "application/json": {
  2039. "schema": {
  2040. "$ref": "#/components/schemas/BadRequestError"
  2041. }
  2042. }
  2043. }
  2044. }
  2045. },
  2046. "description": "Retrieve the current working directory and related path information for the OpenCode instance.",
  2047. "summary": "Get paths",
  2048. "x-codeSamples": [
  2049. {
  2050. "lang": "js",
  2051. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.path.get({\n ...\n})"
  2052. }
  2053. ]
  2054. }
  2055. },
  2056. "/vcs": {
  2057. "get": {
  2058. "tags": ["instance"],
  2059. "operationId": "vcs.get",
  2060. "parameters": [
  2061. {
  2062. "name": "directory",
  2063. "in": "query",
  2064. "required": false,
  2065. "schema": {
  2066. "type": "string"
  2067. }
  2068. },
  2069. {
  2070. "name": "workspace",
  2071. "in": "query",
  2072. "required": false,
  2073. "schema": {
  2074. "type": "string"
  2075. }
  2076. }
  2077. ],
  2078. "responses": {
  2079. "200": {
  2080. "description": "VCS info",
  2081. "content": {
  2082. "application/json": {
  2083. "schema": {
  2084. "$ref": "#/components/schemas/VcsInfo"
  2085. }
  2086. }
  2087. }
  2088. },
  2089. "400": {
  2090. "description": "Bad request",
  2091. "content": {
  2092. "application/json": {
  2093. "schema": {
  2094. "$ref": "#/components/schemas/BadRequestError"
  2095. }
  2096. }
  2097. }
  2098. }
  2099. },
  2100. "description": "Retrieve version control system (VCS) information for the current project, such as git branch.",
  2101. "summary": "Get VCS info",
  2102. "x-codeSamples": [
  2103. {
  2104. "lang": "js",
  2105. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.vcs.get({\n ...\n})"
  2106. }
  2107. ]
  2108. }
  2109. },
  2110. "/vcs/diff": {
  2111. "get": {
  2112. "tags": ["instance"],
  2113. "operationId": "vcs.diff",
  2114. "parameters": [
  2115. {
  2116. "name": "directory",
  2117. "in": "query",
  2118. "required": false,
  2119. "schema": {
  2120. "type": "string"
  2121. }
  2122. },
  2123. {
  2124. "name": "workspace",
  2125. "in": "query",
  2126. "required": false,
  2127. "schema": {
  2128. "type": "string"
  2129. }
  2130. },
  2131. {
  2132. "name": "mode",
  2133. "in": "query",
  2134. "schema": {
  2135. "type": "string",
  2136. "enum": ["git", "branch"]
  2137. },
  2138. "required": true
  2139. }
  2140. ],
  2141. "responses": {
  2142. "200": {
  2143. "description": "VCS diff",
  2144. "content": {
  2145. "application/json": {
  2146. "schema": {
  2147. "type": "array",
  2148. "items": {
  2149. "$ref": "#/components/schemas/VcsFileDiff"
  2150. },
  2151. "description": "VCS diff"
  2152. }
  2153. }
  2154. }
  2155. },
  2156. "400": {
  2157. "description": "Bad request",
  2158. "content": {
  2159. "application/json": {
  2160. "schema": {
  2161. "$ref": "#/components/schemas/BadRequestError"
  2162. }
  2163. }
  2164. }
  2165. }
  2166. },
  2167. "description": "Retrieve the current git diff for the working tree or against the default branch.",
  2168. "summary": "Get VCS diff",
  2169. "x-codeSamples": [
  2170. {
  2171. "lang": "js",
  2172. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.vcs.diff({\n ...\n})"
  2173. }
  2174. ]
  2175. }
  2176. },
  2177. "/command": {
  2178. "get": {
  2179. "tags": ["instance"],
  2180. "operationId": "command.list",
  2181. "parameters": [
  2182. {
  2183. "name": "directory",
  2184. "in": "query",
  2185. "required": false,
  2186. "schema": {
  2187. "type": "string"
  2188. }
  2189. },
  2190. {
  2191. "name": "workspace",
  2192. "in": "query",
  2193. "required": false,
  2194. "schema": {
  2195. "type": "string"
  2196. }
  2197. }
  2198. ],
  2199. "responses": {
  2200. "200": {
  2201. "description": "List of commands",
  2202. "content": {
  2203. "application/json": {
  2204. "schema": {
  2205. "type": "array",
  2206. "items": {
  2207. "$ref": "#/components/schemas/Command"
  2208. },
  2209. "description": "List of commands"
  2210. }
  2211. }
  2212. }
  2213. },
  2214. "400": {
  2215. "description": "Bad request",
  2216. "content": {
  2217. "application/json": {
  2218. "schema": {
  2219. "$ref": "#/components/schemas/BadRequestError"
  2220. }
  2221. }
  2222. }
  2223. }
  2224. },
  2225. "description": "Get a list of all available commands in the OpenCode system.",
  2226. "summary": "List commands",
  2227. "x-codeSamples": [
  2228. {
  2229. "lang": "js",
  2230. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.command.list({\n ...\n})"
  2231. }
  2232. ]
  2233. }
  2234. },
  2235. "/agent": {
  2236. "get": {
  2237. "tags": ["instance"],
  2238. "operationId": "app.agents",
  2239. "parameters": [
  2240. {
  2241. "name": "directory",
  2242. "in": "query",
  2243. "required": false,
  2244. "schema": {
  2245. "type": "string"
  2246. }
  2247. },
  2248. {
  2249. "name": "workspace",
  2250. "in": "query",
  2251. "required": false,
  2252. "schema": {
  2253. "type": "string"
  2254. }
  2255. }
  2256. ],
  2257. "responses": {
  2258. "200": {
  2259. "description": "List of agents",
  2260. "content": {
  2261. "application/json": {
  2262. "schema": {
  2263. "type": "array",
  2264. "items": {
  2265. "$ref": "#/components/schemas/Agent"
  2266. },
  2267. "description": "List of agents"
  2268. }
  2269. }
  2270. }
  2271. },
  2272. "400": {
  2273. "description": "Bad request",
  2274. "content": {
  2275. "application/json": {
  2276. "schema": {
  2277. "$ref": "#/components/schemas/BadRequestError"
  2278. }
  2279. }
  2280. }
  2281. }
  2282. },
  2283. "description": "Get a list of all available AI agents in the OpenCode system.",
  2284. "summary": "List agents",
  2285. "x-codeSamples": [
  2286. {
  2287. "lang": "js",
  2288. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.app.agents({\n ...\n})"
  2289. }
  2290. ]
  2291. }
  2292. },
  2293. "/skill": {
  2294. "get": {
  2295. "tags": ["instance"],
  2296. "operationId": "app.skills",
  2297. "parameters": [
  2298. {
  2299. "name": "directory",
  2300. "in": "query",
  2301. "required": false,
  2302. "schema": {
  2303. "type": "string"
  2304. }
  2305. },
  2306. {
  2307. "name": "workspace",
  2308. "in": "query",
  2309. "required": false,
  2310. "schema": {
  2311. "type": "string"
  2312. }
  2313. }
  2314. ],
  2315. "responses": {
  2316. "200": {
  2317. "description": "List of skills",
  2318. "content": {
  2319. "application/json": {
  2320. "schema": {
  2321. "type": "array",
  2322. "items": {
  2323. "type": "object",
  2324. "properties": {
  2325. "name": {
  2326. "type": "string"
  2327. },
  2328. "description": {
  2329. "type": "string"
  2330. },
  2331. "location": {
  2332. "type": "string"
  2333. },
  2334. "content": {
  2335. "type": "string"
  2336. }
  2337. },
  2338. "required": ["name", "description", "location", "content"],
  2339. "additionalProperties": false
  2340. },
  2341. "description": "List of skills"
  2342. }
  2343. }
  2344. }
  2345. },
  2346. "400": {
  2347. "description": "Bad request",
  2348. "content": {
  2349. "application/json": {
  2350. "schema": {
  2351. "$ref": "#/components/schemas/BadRequestError"
  2352. }
  2353. }
  2354. }
  2355. }
  2356. },
  2357. "description": "Get a list of all available skills in the OpenCode system.",
  2358. "summary": "List skills",
  2359. "x-codeSamples": [
  2360. {
  2361. "lang": "js",
  2362. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.app.skills({\n ...\n})"
  2363. }
  2364. ]
  2365. }
  2366. },
  2367. "/lsp": {
  2368. "get": {
  2369. "tags": ["instance"],
  2370. "operationId": "lsp.status",
  2371. "parameters": [
  2372. {
  2373. "name": "directory",
  2374. "in": "query",
  2375. "required": false,
  2376. "schema": {
  2377. "type": "string"
  2378. }
  2379. },
  2380. {
  2381. "name": "workspace",
  2382. "in": "query",
  2383. "required": false,
  2384. "schema": {
  2385. "type": "string"
  2386. }
  2387. }
  2388. ],
  2389. "responses": {
  2390. "200": {
  2391. "description": "LSP server status",
  2392. "content": {
  2393. "application/json": {
  2394. "schema": {
  2395. "type": "array",
  2396. "items": {
  2397. "$ref": "#/components/schemas/LSPStatus"
  2398. },
  2399. "description": "LSP server status"
  2400. }
  2401. }
  2402. }
  2403. },
  2404. "400": {
  2405. "description": "Bad request",
  2406. "content": {
  2407. "application/json": {
  2408. "schema": {
  2409. "$ref": "#/components/schemas/BadRequestError"
  2410. }
  2411. }
  2412. }
  2413. }
  2414. },
  2415. "description": "Get LSP server status",
  2416. "summary": "Get LSP status",
  2417. "x-codeSamples": [
  2418. {
  2419. "lang": "js",
  2420. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.lsp.status({\n ...\n})"
  2421. }
  2422. ]
  2423. }
  2424. },
  2425. "/formatter": {
  2426. "get": {
  2427. "tags": ["instance"],
  2428. "operationId": "formatter.status",
  2429. "parameters": [
  2430. {
  2431. "name": "directory",
  2432. "in": "query",
  2433. "required": false,
  2434. "schema": {
  2435. "type": "string"
  2436. }
  2437. },
  2438. {
  2439. "name": "workspace",
  2440. "in": "query",
  2441. "required": false,
  2442. "schema": {
  2443. "type": "string"
  2444. }
  2445. }
  2446. ],
  2447. "responses": {
  2448. "200": {
  2449. "description": "Formatter status",
  2450. "content": {
  2451. "application/json": {
  2452. "schema": {
  2453. "type": "array",
  2454. "items": {
  2455. "$ref": "#/components/schemas/FormatterStatus"
  2456. },
  2457. "description": "Formatter status"
  2458. }
  2459. }
  2460. }
  2461. },
  2462. "400": {
  2463. "description": "Bad request",
  2464. "content": {
  2465. "application/json": {
  2466. "schema": {
  2467. "$ref": "#/components/schemas/BadRequestError"
  2468. }
  2469. }
  2470. }
  2471. }
  2472. },
  2473. "description": "Get formatter status",
  2474. "summary": "Get formatter status",
  2475. "x-codeSamples": [
  2476. {
  2477. "lang": "js",
  2478. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.formatter.status({\n ...\n})"
  2479. }
  2480. ]
  2481. }
  2482. },
  2483. "/mcp": {
  2484. "get": {
  2485. "tags": ["mcp"],
  2486. "operationId": "mcp.status",
  2487. "parameters": [
  2488. {
  2489. "name": "directory",
  2490. "in": "query",
  2491. "required": false,
  2492. "schema": {
  2493. "type": "string"
  2494. }
  2495. },
  2496. {
  2497. "name": "workspace",
  2498. "in": "query",
  2499. "required": false,
  2500. "schema": {
  2501. "type": "string"
  2502. }
  2503. }
  2504. ],
  2505. "responses": {
  2506. "200": {
  2507. "description": "MCP server status",
  2508. "content": {
  2509. "application/json": {
  2510. "schema": {
  2511. "type": "object",
  2512. "additionalProperties": {
  2513. "$ref": "#/components/schemas/MCPStatus"
  2514. },
  2515. "description": "MCP server status"
  2516. }
  2517. }
  2518. }
  2519. },
  2520. "400": {
  2521. "description": "Bad request",
  2522. "content": {
  2523. "application/json": {
  2524. "schema": {
  2525. "$ref": "#/components/schemas/BadRequestError"
  2526. }
  2527. }
  2528. }
  2529. }
  2530. },
  2531. "description": "Get the status of all Model Context Protocol (MCP) servers.",
  2532. "summary": "Get MCP status",
  2533. "x-codeSamples": [
  2534. {
  2535. "lang": "js",
  2536. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.status({\n ...\n})"
  2537. }
  2538. ]
  2539. },
  2540. "post": {
  2541. "tags": ["mcp"],
  2542. "operationId": "mcp.add",
  2543. "parameters": [
  2544. {
  2545. "name": "directory",
  2546. "in": "query",
  2547. "required": false,
  2548. "schema": {
  2549. "type": "string"
  2550. }
  2551. },
  2552. {
  2553. "name": "workspace",
  2554. "in": "query",
  2555. "required": false,
  2556. "schema": {
  2557. "type": "string"
  2558. }
  2559. }
  2560. ],
  2561. "responses": {
  2562. "200": {
  2563. "description": "MCP server added successfully",
  2564. "content": {
  2565. "application/json": {
  2566. "schema": {
  2567. "type": "object",
  2568. "additionalProperties": {
  2569. "$ref": "#/components/schemas/MCPStatus"
  2570. },
  2571. "description": "MCP server added successfully"
  2572. }
  2573. }
  2574. }
  2575. },
  2576. "400": {
  2577. "description": "Bad request",
  2578. "content": {
  2579. "application/json": {
  2580. "schema": {
  2581. "$ref": "#/components/schemas/BadRequestError"
  2582. }
  2583. }
  2584. }
  2585. }
  2586. },
  2587. "description": "Dynamically add a new Model Context Protocol (MCP) server to the system.",
  2588. "summary": "Add MCP server",
  2589. "requestBody": {
  2590. "content": {
  2591. "application/json": {
  2592. "schema": {
  2593. "type": "object",
  2594. "properties": {
  2595. "name": {
  2596. "type": "string"
  2597. },
  2598. "config": {
  2599. "anyOf": [
  2600. {
  2601. "$ref": "#/components/schemas/McpLocalConfig"
  2602. },
  2603. {
  2604. "$ref": "#/components/schemas/McpRemoteConfig"
  2605. }
  2606. ]
  2607. }
  2608. },
  2609. "required": ["name", "config"],
  2610. "additionalProperties": false
  2611. }
  2612. }
  2613. }
  2614. },
  2615. "x-codeSamples": [
  2616. {
  2617. "lang": "js",
  2618. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.add({\n ...\n})"
  2619. }
  2620. ]
  2621. }
  2622. },
  2623. "/mcp/{name}/auth": {
  2624. "post": {
  2625. "tags": ["mcp"],
  2626. "operationId": "mcp.auth.start",
  2627. "parameters": [
  2628. {
  2629. "name": "directory",
  2630. "in": "query",
  2631. "required": false,
  2632. "schema": {
  2633. "type": "string"
  2634. }
  2635. },
  2636. {
  2637. "name": "workspace",
  2638. "in": "query",
  2639. "required": false,
  2640. "schema": {
  2641. "type": "string"
  2642. }
  2643. },
  2644. {
  2645. "name": "name",
  2646. "in": "path",
  2647. "schema": {
  2648. "type": "string"
  2649. },
  2650. "required": true
  2651. }
  2652. ],
  2653. "responses": {
  2654. "200": {
  2655. "description": "OAuth flow started",
  2656. "content": {
  2657. "application/json": {
  2658. "schema": {
  2659. "type": "object",
  2660. "properties": {
  2661. "authorizationUrl": {
  2662. "type": "string"
  2663. },
  2664. "oauthState": {
  2665. "type": "string"
  2666. }
  2667. },
  2668. "required": ["authorizationUrl", "oauthState"],
  2669. "additionalProperties": false,
  2670. "description": "OAuth flow started"
  2671. }
  2672. }
  2673. }
  2674. },
  2675. "400": {
  2676. "description": "McpUnsupportedOAuthError | BadRequest",
  2677. "content": {
  2678. "application/json": {
  2679. "schema": {
  2680. "$ref": "#/components/schemas/McpUnsupportedOAuthError"
  2681. }
  2682. }
  2683. }
  2684. },
  2685. "404": {
  2686. "description": "Not found",
  2687. "content": {
  2688. "application/json": {
  2689. "schema": {
  2690. "$ref": "#/components/schemas/NotFoundError"
  2691. }
  2692. }
  2693. }
  2694. }
  2695. },
  2696. "description": "Start OAuth authentication flow for a Model Context Protocol (MCP) server.",
  2697. "summary": "Start MCP OAuth",
  2698. "x-codeSamples": [
  2699. {
  2700. "lang": "js",
  2701. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.start({\n ...\n})"
  2702. }
  2703. ]
  2704. },
  2705. "delete": {
  2706. "tags": ["mcp"],
  2707. "operationId": "mcp.auth.remove",
  2708. "parameters": [
  2709. {
  2710. "name": "directory",
  2711. "in": "query",
  2712. "required": false,
  2713. "schema": {
  2714. "type": "string"
  2715. }
  2716. },
  2717. {
  2718. "name": "workspace",
  2719. "in": "query",
  2720. "required": false,
  2721. "schema": {
  2722. "type": "string"
  2723. }
  2724. },
  2725. {
  2726. "name": "name",
  2727. "in": "path",
  2728. "schema": {
  2729. "type": "string"
  2730. },
  2731. "required": true
  2732. }
  2733. ],
  2734. "responses": {
  2735. "200": {
  2736. "description": "OAuth credentials removed",
  2737. "content": {
  2738. "application/json": {
  2739. "schema": {
  2740. "type": "object",
  2741. "properties": {
  2742. "success": {
  2743. "type": "boolean",
  2744. "enum": [true]
  2745. }
  2746. },
  2747. "required": ["success"],
  2748. "additionalProperties": false,
  2749. "description": "OAuth credentials removed"
  2750. }
  2751. }
  2752. }
  2753. },
  2754. "400": {
  2755. "description": "Bad request",
  2756. "content": {
  2757. "application/json": {
  2758. "schema": {
  2759. "$ref": "#/components/schemas/BadRequestError"
  2760. }
  2761. }
  2762. }
  2763. },
  2764. "404": {
  2765. "description": "Not found",
  2766. "content": {
  2767. "application/json": {
  2768. "schema": {
  2769. "$ref": "#/components/schemas/NotFoundError"
  2770. }
  2771. }
  2772. }
  2773. }
  2774. },
  2775. "description": "Remove OAuth credentials for an MCP server.",
  2776. "summary": "Remove MCP OAuth",
  2777. "x-codeSamples": [
  2778. {
  2779. "lang": "js",
  2780. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.remove({\n ...\n})"
  2781. }
  2782. ]
  2783. }
  2784. },
  2785. "/mcp/{name}/auth/callback": {
  2786. "post": {
  2787. "tags": ["mcp"],
  2788. "operationId": "mcp.auth.callback",
  2789. "parameters": [
  2790. {
  2791. "name": "directory",
  2792. "in": "query",
  2793. "required": false,
  2794. "schema": {
  2795. "type": "string"
  2796. }
  2797. },
  2798. {
  2799. "name": "workspace",
  2800. "in": "query",
  2801. "required": false,
  2802. "schema": {
  2803. "type": "string"
  2804. }
  2805. },
  2806. {
  2807. "name": "name",
  2808. "in": "path",
  2809. "schema": {
  2810. "type": "string"
  2811. },
  2812. "required": true
  2813. }
  2814. ],
  2815. "responses": {
  2816. "200": {
  2817. "description": "OAuth authentication completed",
  2818. "content": {
  2819. "application/json": {
  2820. "schema": {
  2821. "$ref": "#/components/schemas/MCPStatus"
  2822. }
  2823. }
  2824. }
  2825. },
  2826. "400": {
  2827. "description": "Bad request",
  2828. "content": {
  2829. "application/json": {
  2830. "schema": {
  2831. "$ref": "#/components/schemas/BadRequestError"
  2832. }
  2833. }
  2834. }
  2835. },
  2836. "404": {
  2837. "description": "Not found",
  2838. "content": {
  2839. "application/json": {
  2840. "schema": {
  2841. "$ref": "#/components/schemas/NotFoundError"
  2842. }
  2843. }
  2844. }
  2845. }
  2846. },
  2847. "description": "Complete OAuth authentication for a Model Context Protocol (MCP) server using the authorization code.",
  2848. "summary": "Complete MCP OAuth",
  2849. "requestBody": {
  2850. "content": {
  2851. "application/json": {
  2852. "schema": {
  2853. "type": "object",
  2854. "properties": {
  2855. "code": {
  2856. "type": "string"
  2857. }
  2858. },
  2859. "required": ["code"],
  2860. "additionalProperties": false
  2861. }
  2862. }
  2863. }
  2864. },
  2865. "x-codeSamples": [
  2866. {
  2867. "lang": "js",
  2868. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.callback({\n ...\n})"
  2869. }
  2870. ]
  2871. }
  2872. },
  2873. "/mcp/{name}/auth/authenticate": {
  2874. "post": {
  2875. "tags": ["mcp"],
  2876. "operationId": "mcp.auth.authenticate",
  2877. "parameters": [
  2878. {
  2879. "name": "directory",
  2880. "in": "query",
  2881. "required": false,
  2882. "schema": {
  2883. "type": "string"
  2884. }
  2885. },
  2886. {
  2887. "name": "workspace",
  2888. "in": "query",
  2889. "required": false,
  2890. "schema": {
  2891. "type": "string"
  2892. }
  2893. },
  2894. {
  2895. "name": "name",
  2896. "in": "path",
  2897. "schema": {
  2898. "type": "string"
  2899. },
  2900. "required": true
  2901. }
  2902. ],
  2903. "responses": {
  2904. "200": {
  2905. "description": "OAuth authentication completed",
  2906. "content": {
  2907. "application/json": {
  2908. "schema": {
  2909. "$ref": "#/components/schemas/MCPStatus"
  2910. }
  2911. }
  2912. }
  2913. },
  2914. "400": {
  2915. "description": "McpUnsupportedOAuthError | BadRequest",
  2916. "content": {
  2917. "application/json": {
  2918. "schema": {
  2919. "$ref": "#/components/schemas/McpUnsupportedOAuthError"
  2920. }
  2921. }
  2922. }
  2923. },
  2924. "404": {
  2925. "description": "Not found",
  2926. "content": {
  2927. "application/json": {
  2928. "schema": {
  2929. "$ref": "#/components/schemas/NotFoundError"
  2930. }
  2931. }
  2932. }
  2933. }
  2934. },
  2935. "description": "Start OAuth flow and wait for callback (opens browser).",
  2936. "summary": "Authenticate MCP OAuth",
  2937. "x-codeSamples": [
  2938. {
  2939. "lang": "js",
  2940. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.authenticate({\n ...\n})"
  2941. }
  2942. ]
  2943. }
  2944. },
  2945. "/mcp/{name}/connect": {
  2946. "post": {
  2947. "tags": ["mcp"],
  2948. "operationId": "mcp.connect",
  2949. "parameters": [
  2950. {
  2951. "name": "directory",
  2952. "in": "query",
  2953. "required": false,
  2954. "schema": {
  2955. "type": "string"
  2956. }
  2957. },
  2958. {
  2959. "name": "workspace",
  2960. "in": "query",
  2961. "required": false,
  2962. "schema": {
  2963. "type": "string"
  2964. }
  2965. },
  2966. {
  2967. "name": "name",
  2968. "in": "path",
  2969. "schema": {
  2970. "type": "string"
  2971. },
  2972. "required": true
  2973. }
  2974. ],
  2975. "responses": {
  2976. "200": {
  2977. "description": "MCP server connected successfully",
  2978. "content": {
  2979. "application/json": {
  2980. "schema": {
  2981. "type": "boolean",
  2982. "description": "MCP server connected successfully"
  2983. }
  2984. }
  2985. }
  2986. },
  2987. "400": {
  2988. "description": "Bad request",
  2989. "content": {
  2990. "application/json": {
  2991. "schema": {
  2992. "$ref": "#/components/schemas/BadRequestError"
  2993. }
  2994. }
  2995. }
  2996. }
  2997. },
  2998. "description": "Connect an MCP server.",
  2999. "x-codeSamples": [
  3000. {
  3001. "lang": "js",
  3002. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.connect({\n ...\n})"
  3003. }
  3004. ]
  3005. }
  3006. },
  3007. "/mcp/{name}/disconnect": {
  3008. "post": {
  3009. "tags": ["mcp"],
  3010. "operationId": "mcp.disconnect",
  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. "name": "name",
  3030. "in": "path",
  3031. "schema": {
  3032. "type": "string"
  3033. },
  3034. "required": true
  3035. }
  3036. ],
  3037. "responses": {
  3038. "200": {
  3039. "description": "MCP server disconnected successfully",
  3040. "content": {
  3041. "application/json": {
  3042. "schema": {
  3043. "type": "boolean",
  3044. "description": "MCP server disconnected successfully"
  3045. }
  3046. }
  3047. }
  3048. },
  3049. "400": {
  3050. "description": "Bad request",
  3051. "content": {
  3052. "application/json": {
  3053. "schema": {
  3054. "$ref": "#/components/schemas/BadRequestError"
  3055. }
  3056. }
  3057. }
  3058. }
  3059. },
  3060. "description": "Disconnect an MCP server.",
  3061. "x-codeSamples": [
  3062. {
  3063. "lang": "js",
  3064. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.disconnect({\n ...\n})"
  3065. }
  3066. ]
  3067. }
  3068. },
  3069. "/project": {
  3070. "get": {
  3071. "tags": ["project"],
  3072. "operationId": "project.list",
  3073. "parameters": [
  3074. {
  3075. "name": "directory",
  3076. "in": "query",
  3077. "required": false,
  3078. "schema": {
  3079. "type": "string"
  3080. }
  3081. },
  3082. {
  3083. "name": "workspace",
  3084. "in": "query",
  3085. "required": false,
  3086. "schema": {
  3087. "type": "string"
  3088. }
  3089. }
  3090. ],
  3091. "responses": {
  3092. "200": {
  3093. "description": "List of projects",
  3094. "content": {
  3095. "application/json": {
  3096. "schema": {
  3097. "type": "array",
  3098. "items": {
  3099. "$ref": "#/components/schemas/Project"
  3100. },
  3101. "description": "List of projects"
  3102. }
  3103. }
  3104. }
  3105. },
  3106. "400": {
  3107. "description": "Bad request",
  3108. "content": {
  3109. "application/json": {
  3110. "schema": {
  3111. "$ref": "#/components/schemas/BadRequestError"
  3112. }
  3113. }
  3114. }
  3115. }
  3116. },
  3117. "description": "Get a list of projects that have been opened with OpenCode.",
  3118. "summary": "List all projects",
  3119. "x-codeSamples": [
  3120. {
  3121. "lang": "js",
  3122. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.list({\n ...\n})"
  3123. }
  3124. ]
  3125. }
  3126. },
  3127. "/project/current": {
  3128. "get": {
  3129. "tags": ["project"],
  3130. "operationId": "project.current",
  3131. "parameters": [
  3132. {
  3133. "name": "directory",
  3134. "in": "query",
  3135. "required": false,
  3136. "schema": {
  3137. "type": "string"
  3138. }
  3139. },
  3140. {
  3141. "name": "workspace",
  3142. "in": "query",
  3143. "required": false,
  3144. "schema": {
  3145. "type": "string"
  3146. }
  3147. }
  3148. ],
  3149. "responses": {
  3150. "200": {
  3151. "description": "Current project information",
  3152. "content": {
  3153. "application/json": {
  3154. "schema": {
  3155. "$ref": "#/components/schemas/Project"
  3156. }
  3157. }
  3158. }
  3159. },
  3160. "400": {
  3161. "description": "Bad request",
  3162. "content": {
  3163. "application/json": {
  3164. "schema": {
  3165. "$ref": "#/components/schemas/BadRequestError"
  3166. }
  3167. }
  3168. }
  3169. }
  3170. },
  3171. "description": "Retrieve the currently active project that OpenCode is working with.",
  3172. "summary": "Get current project",
  3173. "x-codeSamples": [
  3174. {
  3175. "lang": "js",
  3176. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.current({\n ...\n})"
  3177. }
  3178. ]
  3179. }
  3180. },
  3181. "/project/git/init": {
  3182. "post": {
  3183. "tags": ["project"],
  3184. "operationId": "project.initGit",
  3185. "parameters": [
  3186. {
  3187. "name": "directory",
  3188. "in": "query",
  3189. "required": false,
  3190. "schema": {
  3191. "type": "string"
  3192. }
  3193. },
  3194. {
  3195. "name": "workspace",
  3196. "in": "query",
  3197. "required": false,
  3198. "schema": {
  3199. "type": "string"
  3200. }
  3201. }
  3202. ],
  3203. "responses": {
  3204. "200": {
  3205. "description": "Project information after git initialization",
  3206. "content": {
  3207. "application/json": {
  3208. "schema": {
  3209. "$ref": "#/components/schemas/Project"
  3210. }
  3211. }
  3212. }
  3213. },
  3214. "400": {
  3215. "description": "Bad request",
  3216. "content": {
  3217. "application/json": {
  3218. "schema": {
  3219. "$ref": "#/components/schemas/BadRequestError"
  3220. }
  3221. }
  3222. }
  3223. }
  3224. },
  3225. "description": "Create a git repository for the current project and return the refreshed project info.",
  3226. "summary": "Initialize git repository",
  3227. "x-codeSamples": [
  3228. {
  3229. "lang": "js",
  3230. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.initGit({\n ...\n})"
  3231. }
  3232. ]
  3233. }
  3234. },
  3235. "/project/{projectID}": {
  3236. "patch": {
  3237. "tags": ["project"],
  3238. "operationId": "project.update",
  3239. "parameters": [
  3240. {
  3241. "name": "directory",
  3242. "in": "query",
  3243. "required": false,
  3244. "schema": {
  3245. "type": "string"
  3246. }
  3247. },
  3248. {
  3249. "name": "workspace",
  3250. "in": "query",
  3251. "required": false,
  3252. "schema": {
  3253. "type": "string"
  3254. }
  3255. },
  3256. {
  3257. "name": "projectID",
  3258. "in": "path",
  3259. "schema": {
  3260. "type": "string"
  3261. },
  3262. "required": true
  3263. }
  3264. ],
  3265. "responses": {
  3266. "200": {
  3267. "description": "Updated project information",
  3268. "content": {
  3269. "application/json": {
  3270. "schema": {
  3271. "$ref": "#/components/schemas/Project"
  3272. }
  3273. }
  3274. }
  3275. },
  3276. "400": {
  3277. "description": "Bad request",
  3278. "content": {
  3279. "application/json": {
  3280. "schema": {
  3281. "$ref": "#/components/schemas/BadRequestError"
  3282. }
  3283. }
  3284. }
  3285. },
  3286. "404": {
  3287. "description": "Not found",
  3288. "content": {
  3289. "application/json": {
  3290. "schema": {
  3291. "$ref": "#/components/schemas/NotFoundError"
  3292. }
  3293. }
  3294. }
  3295. }
  3296. },
  3297. "description": "Update project properties such as name, icon, and commands.",
  3298. "summary": "Update project",
  3299. "requestBody": {
  3300. "content": {
  3301. "application/json": {
  3302. "schema": {
  3303. "type": "object",
  3304. "properties": {
  3305. "name": {
  3306. "type": "string"
  3307. },
  3308. "icon": {
  3309. "type": "object",
  3310. "properties": {
  3311. "url": {
  3312. "type": "string"
  3313. },
  3314. "override": {
  3315. "type": "string"
  3316. },
  3317. "color": {
  3318. "type": "string"
  3319. }
  3320. },
  3321. "additionalProperties": false
  3322. },
  3323. "commands": {
  3324. "type": "object",
  3325. "properties": {
  3326. "start": {
  3327. "type": "string",
  3328. "description": "Startup script to run when creating a new workspace (worktree)"
  3329. }
  3330. },
  3331. "additionalProperties": false
  3332. }
  3333. },
  3334. "additionalProperties": false
  3335. }
  3336. }
  3337. }
  3338. },
  3339. "x-codeSamples": [
  3340. {
  3341. "lang": "js",
  3342. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.update({\n ...\n})"
  3343. }
  3344. ]
  3345. }
  3346. },
  3347. "/pty/shells": {
  3348. "get": {
  3349. "tags": ["pty"],
  3350. "operationId": "pty.shells",
  3351. "parameters": [
  3352. {
  3353. "name": "directory",
  3354. "in": "query",
  3355. "required": false,
  3356. "schema": {
  3357. "type": "string"
  3358. }
  3359. },
  3360. {
  3361. "name": "workspace",
  3362. "in": "query",
  3363. "required": false,
  3364. "schema": {
  3365. "type": "string"
  3366. }
  3367. }
  3368. ],
  3369. "responses": {
  3370. "200": {
  3371. "description": "List of shells",
  3372. "content": {
  3373. "application/json": {
  3374. "schema": {
  3375. "type": "array",
  3376. "items": {
  3377. "type": "object",
  3378. "properties": {
  3379. "path": {
  3380. "type": "string"
  3381. },
  3382. "name": {
  3383. "type": "string"
  3384. },
  3385. "acceptable": {
  3386. "type": "boolean"
  3387. }
  3388. },
  3389. "required": ["path", "name", "acceptable"],
  3390. "additionalProperties": false
  3391. },
  3392. "description": "List of shells"
  3393. }
  3394. }
  3395. }
  3396. },
  3397. "400": {
  3398. "description": "Bad request",
  3399. "content": {
  3400. "application/json": {
  3401. "schema": {
  3402. "$ref": "#/components/schemas/BadRequestError"
  3403. }
  3404. }
  3405. }
  3406. }
  3407. },
  3408. "description": "Get a list of available shells on the system.",
  3409. "summary": "List available shells",
  3410. "x-codeSamples": [
  3411. {
  3412. "lang": "js",
  3413. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.shells({\n ...\n})"
  3414. }
  3415. ]
  3416. }
  3417. },
  3418. "/pty": {
  3419. "get": {
  3420. "tags": ["pty"],
  3421. "operationId": "pty.list",
  3422. "parameters": [
  3423. {
  3424. "name": "directory",
  3425. "in": "query",
  3426. "required": false,
  3427. "schema": {
  3428. "type": "string"
  3429. }
  3430. },
  3431. {
  3432. "name": "workspace",
  3433. "in": "query",
  3434. "required": false,
  3435. "schema": {
  3436. "type": "string"
  3437. }
  3438. }
  3439. ],
  3440. "responses": {
  3441. "200": {
  3442. "description": "List of sessions",
  3443. "content": {
  3444. "application/json": {
  3445. "schema": {
  3446. "type": "array",
  3447. "items": {
  3448. "$ref": "#/components/schemas/Pty"
  3449. },
  3450. "description": "List of sessions"
  3451. }
  3452. }
  3453. }
  3454. },
  3455. "400": {
  3456. "description": "Bad request",
  3457. "content": {
  3458. "application/json": {
  3459. "schema": {
  3460. "$ref": "#/components/schemas/BadRequestError"
  3461. }
  3462. }
  3463. }
  3464. }
  3465. },
  3466. "description": "Get a list of all active pseudo-terminal (PTY) sessions managed by OpenCode.",
  3467. "summary": "List PTY sessions",
  3468. "x-codeSamples": [
  3469. {
  3470. "lang": "js",
  3471. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.list({\n ...\n})"
  3472. }
  3473. ]
  3474. },
  3475. "post": {
  3476. "tags": ["pty"],
  3477. "operationId": "pty.create",
  3478. "parameters": [
  3479. {
  3480. "name": "directory",
  3481. "in": "query",
  3482. "required": false,
  3483. "schema": {
  3484. "type": "string"
  3485. }
  3486. },
  3487. {
  3488. "name": "workspace",
  3489. "in": "query",
  3490. "required": false,
  3491. "schema": {
  3492. "type": "string"
  3493. }
  3494. }
  3495. ],
  3496. "responses": {
  3497. "200": {
  3498. "description": "Created session",
  3499. "content": {
  3500. "application/json": {
  3501. "schema": {
  3502. "$ref": "#/components/schemas/Pty"
  3503. }
  3504. }
  3505. }
  3506. },
  3507. "400": {
  3508. "description": "Bad request",
  3509. "content": {
  3510. "application/json": {
  3511. "schema": {
  3512. "$ref": "#/components/schemas/BadRequestError"
  3513. }
  3514. }
  3515. }
  3516. }
  3517. },
  3518. "description": "Create a new pseudo-terminal (PTY) session for running shell commands and processes.",
  3519. "summary": "Create PTY session",
  3520. "requestBody": {
  3521. "content": {
  3522. "application/json": {
  3523. "schema": {
  3524. "type": "object",
  3525. "properties": {
  3526. "command": {
  3527. "type": "string"
  3528. },
  3529. "args": {
  3530. "type": "array",
  3531. "items": {
  3532. "type": "string"
  3533. }
  3534. },
  3535. "cwd": {
  3536. "type": "string"
  3537. },
  3538. "title": {
  3539. "type": "string"
  3540. },
  3541. "env": {
  3542. "type": "object",
  3543. "additionalProperties": {
  3544. "type": "string"
  3545. }
  3546. }
  3547. },
  3548. "additionalProperties": false
  3549. }
  3550. }
  3551. }
  3552. },
  3553. "x-codeSamples": [
  3554. {
  3555. "lang": "js",
  3556. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.create({\n ...\n})"
  3557. }
  3558. ]
  3559. }
  3560. },
  3561. "/pty/{ptyID}": {
  3562. "get": {
  3563. "tags": ["pty"],
  3564. "operationId": "pty.get",
  3565. "parameters": [
  3566. {
  3567. "name": "directory",
  3568. "in": "query",
  3569. "required": false,
  3570. "schema": {
  3571. "type": "string"
  3572. }
  3573. },
  3574. {
  3575. "name": "workspace",
  3576. "in": "query",
  3577. "required": false,
  3578. "schema": {
  3579. "type": "string"
  3580. }
  3581. },
  3582. {
  3583. "name": "ptyID",
  3584. "in": "path",
  3585. "schema": {
  3586. "type": "string",
  3587. "pattern": "^pty.*"
  3588. },
  3589. "required": true
  3590. }
  3591. ],
  3592. "responses": {
  3593. "200": {
  3594. "description": "Session info",
  3595. "content": {
  3596. "application/json": {
  3597. "schema": {
  3598. "$ref": "#/components/schemas/Pty"
  3599. }
  3600. }
  3601. }
  3602. },
  3603. "400": {
  3604. "description": "Bad request",
  3605. "content": {
  3606. "application/json": {
  3607. "schema": {
  3608. "$ref": "#/components/schemas/BadRequestError"
  3609. }
  3610. }
  3611. }
  3612. },
  3613. "404": {
  3614. "description": "Not found",
  3615. "content": {
  3616. "application/json": {
  3617. "schema": {
  3618. "$ref": "#/components/schemas/NotFoundError"
  3619. }
  3620. }
  3621. }
  3622. }
  3623. },
  3624. "description": "Retrieve detailed information about a specific pseudo-terminal (PTY) session.",
  3625. "summary": "Get PTY session",
  3626. "x-codeSamples": [
  3627. {
  3628. "lang": "js",
  3629. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.get({\n ...\n})"
  3630. }
  3631. ]
  3632. },
  3633. "put": {
  3634. "tags": ["pty"],
  3635. "operationId": "pty.update",
  3636. "parameters": [
  3637. {
  3638. "name": "directory",
  3639. "in": "query",
  3640. "required": false,
  3641. "schema": {
  3642. "type": "string"
  3643. }
  3644. },
  3645. {
  3646. "name": "workspace",
  3647. "in": "query",
  3648. "required": false,
  3649. "schema": {
  3650. "type": "string"
  3651. }
  3652. },
  3653. {
  3654. "name": "ptyID",
  3655. "in": "path",
  3656. "schema": {
  3657. "type": "string",
  3658. "pattern": "^pty.*"
  3659. },
  3660. "required": true
  3661. }
  3662. ],
  3663. "responses": {
  3664. "200": {
  3665. "description": "Updated session",
  3666. "content": {
  3667. "application/json": {
  3668. "schema": {
  3669. "$ref": "#/components/schemas/Pty"
  3670. }
  3671. }
  3672. }
  3673. },
  3674. "400": {
  3675. "description": "Bad request",
  3676. "content": {
  3677. "application/json": {
  3678. "schema": {
  3679. "$ref": "#/components/schemas/BadRequestError"
  3680. }
  3681. }
  3682. }
  3683. }
  3684. },
  3685. "description": "Update properties of an existing pseudo-terminal (PTY) session.",
  3686. "summary": "Update PTY session",
  3687. "requestBody": {
  3688. "content": {
  3689. "application/json": {
  3690. "schema": {
  3691. "type": "object",
  3692. "properties": {
  3693. "title": {
  3694. "type": "string"
  3695. },
  3696. "size": {
  3697. "type": "object",
  3698. "properties": {
  3699. "rows": {
  3700. "type": "integer",
  3701. "exclusiveMinimum": 0
  3702. },
  3703. "cols": {
  3704. "type": "integer",
  3705. "exclusiveMinimum": 0
  3706. }
  3707. },
  3708. "required": ["rows", "cols"],
  3709. "additionalProperties": false
  3710. }
  3711. },
  3712. "additionalProperties": false
  3713. }
  3714. }
  3715. }
  3716. },
  3717. "x-codeSamples": [
  3718. {
  3719. "lang": "js",
  3720. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.update({\n ...\n})"
  3721. }
  3722. ]
  3723. },
  3724. "delete": {
  3725. "tags": ["pty"],
  3726. "operationId": "pty.remove",
  3727. "parameters": [
  3728. {
  3729. "name": "directory",
  3730. "in": "query",
  3731. "required": false,
  3732. "schema": {
  3733. "type": "string"
  3734. }
  3735. },
  3736. {
  3737. "name": "workspace",
  3738. "in": "query",
  3739. "required": false,
  3740. "schema": {
  3741. "type": "string"
  3742. }
  3743. },
  3744. {
  3745. "name": "ptyID",
  3746. "in": "path",
  3747. "schema": {
  3748. "type": "string",
  3749. "pattern": "^pty.*"
  3750. },
  3751. "required": true
  3752. }
  3753. ],
  3754. "responses": {
  3755. "200": {
  3756. "description": "Session removed",
  3757. "content": {
  3758. "application/json": {
  3759. "schema": {
  3760. "type": "boolean",
  3761. "description": "Session removed"
  3762. }
  3763. }
  3764. }
  3765. },
  3766. "400": {
  3767. "description": "Bad request",
  3768. "content": {
  3769. "application/json": {
  3770. "schema": {
  3771. "$ref": "#/components/schemas/BadRequestError"
  3772. }
  3773. }
  3774. }
  3775. },
  3776. "404": {
  3777. "description": "Not found",
  3778. "content": {
  3779. "application/json": {
  3780. "schema": {
  3781. "$ref": "#/components/schemas/NotFoundError"
  3782. }
  3783. }
  3784. }
  3785. }
  3786. },
  3787. "description": "Remove and terminate a specific pseudo-terminal (PTY) session.",
  3788. "summary": "Remove PTY session",
  3789. "x-codeSamples": [
  3790. {
  3791. "lang": "js",
  3792. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.remove({\n ...\n})"
  3793. }
  3794. ]
  3795. }
  3796. },
  3797. "/pty/{ptyID}/connect-token": {
  3798. "post": {
  3799. "tags": ["pty"],
  3800. "operationId": "pty.connectToken",
  3801. "parameters": [
  3802. {
  3803. "name": "directory",
  3804. "in": "query",
  3805. "required": false,
  3806. "schema": {
  3807. "type": "string"
  3808. }
  3809. },
  3810. {
  3811. "name": "workspace",
  3812. "in": "query",
  3813. "required": false,
  3814. "schema": {
  3815. "type": "string"
  3816. }
  3817. },
  3818. {
  3819. "name": "ptyID",
  3820. "in": "path",
  3821. "schema": {
  3822. "type": "string",
  3823. "pattern": "^pty.*"
  3824. },
  3825. "required": true
  3826. }
  3827. ],
  3828. "responses": {
  3829. "200": {
  3830. "description": "WebSocket connect token",
  3831. "content": {
  3832. "application/json": {
  3833. "schema": {
  3834. "type": "object",
  3835. "properties": {
  3836. "ticket": {
  3837. "type": "string"
  3838. },
  3839. "expires_in": {
  3840. "type": "integer",
  3841. "exclusiveMinimum": 0
  3842. }
  3843. },
  3844. "required": ["ticket", "expires_in"],
  3845. "additionalProperties": false,
  3846. "description": "WebSocket connect token"
  3847. }
  3848. }
  3849. }
  3850. },
  3851. "400": {
  3852. "description": "Bad request",
  3853. "content": {
  3854. "application/json": {
  3855. "schema": {
  3856. "$ref": "#/components/schemas/BadRequestError"
  3857. }
  3858. }
  3859. }
  3860. },
  3861. "403": {
  3862. "description": "Forbidden",
  3863. "content": {
  3864. "application/json": {
  3865. "schema": {
  3866. "$ref": "#/components/schemas/effect_HttpApiError_Forbidden"
  3867. }
  3868. }
  3869. }
  3870. },
  3871. "404": {
  3872. "description": "Not found",
  3873. "content": {
  3874. "application/json": {
  3875. "schema": {
  3876. "$ref": "#/components/schemas/NotFoundError"
  3877. }
  3878. }
  3879. }
  3880. }
  3881. },
  3882. "description": "Create a short-lived ticket for opening a PTY WebSocket connection.",
  3883. "summary": "Create PTY WebSocket token",
  3884. "x-codeSamples": [
  3885. {
  3886. "lang": "js",
  3887. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.connectToken({\n ...\n})"
  3888. }
  3889. ]
  3890. }
  3891. },
  3892. "/question": {
  3893. "get": {
  3894. "tags": ["question"],
  3895. "operationId": "question.list",
  3896. "parameters": [
  3897. {
  3898. "name": "directory",
  3899. "in": "query",
  3900. "required": false,
  3901. "schema": {
  3902. "type": "string"
  3903. }
  3904. },
  3905. {
  3906. "name": "workspace",
  3907. "in": "query",
  3908. "required": false,
  3909. "schema": {
  3910. "type": "string"
  3911. }
  3912. }
  3913. ],
  3914. "responses": {
  3915. "200": {
  3916. "description": "List of pending questions",
  3917. "content": {
  3918. "application/json": {
  3919. "schema": {
  3920. "type": "array",
  3921. "items": {
  3922. "$ref": "#/components/schemas/QuestionRequest"
  3923. },
  3924. "description": "List of pending questions"
  3925. }
  3926. }
  3927. }
  3928. },
  3929. "400": {
  3930. "description": "Bad request",
  3931. "content": {
  3932. "application/json": {
  3933. "schema": {
  3934. "$ref": "#/components/schemas/BadRequestError"
  3935. }
  3936. }
  3937. }
  3938. }
  3939. },
  3940. "description": "Get all pending question requests across all sessions.",
  3941. "summary": "List pending questions",
  3942. "x-codeSamples": [
  3943. {
  3944. "lang": "js",
  3945. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.question.list({\n ...\n})"
  3946. }
  3947. ]
  3948. }
  3949. },
  3950. "/question/{requestID}/reply": {
  3951. "post": {
  3952. "tags": ["question"],
  3953. "operationId": "question.reply",
  3954. "parameters": [
  3955. {
  3956. "name": "directory",
  3957. "in": "query",
  3958. "required": false,
  3959. "schema": {
  3960. "type": "string"
  3961. }
  3962. },
  3963. {
  3964. "name": "workspace",
  3965. "in": "query",
  3966. "required": false,
  3967. "schema": {
  3968. "type": "string"
  3969. }
  3970. },
  3971. {
  3972. "name": "requestID",
  3973. "in": "path",
  3974. "schema": {
  3975. "type": "string",
  3976. "pattern": "^que.*"
  3977. },
  3978. "required": true
  3979. }
  3980. ],
  3981. "responses": {
  3982. "200": {
  3983. "description": "Question answered successfully",
  3984. "content": {
  3985. "application/json": {
  3986. "schema": {
  3987. "type": "boolean",
  3988. "description": "Question answered successfully"
  3989. }
  3990. }
  3991. }
  3992. },
  3993. "400": {
  3994. "description": "Bad request",
  3995. "content": {
  3996. "application/json": {
  3997. "schema": {
  3998. "$ref": "#/components/schemas/BadRequestError"
  3999. }
  4000. }
  4001. }
  4002. },
  4003. "404": {
  4004. "description": "Not found",
  4005. "content": {
  4006. "application/json": {
  4007. "schema": {
  4008. "$ref": "#/components/schemas/NotFoundError"
  4009. }
  4010. }
  4011. }
  4012. }
  4013. },
  4014. "description": "Provide answers to a question request from the AI assistant.",
  4015. "summary": "Reply to question request",
  4016. "requestBody": {
  4017. "content": {
  4018. "application/json": {
  4019. "schema": {
  4020. "type": "object",
  4021. "properties": {
  4022. "answers": {
  4023. "type": "array",
  4024. "items": {
  4025. "$ref": "#/components/schemas/QuestionAnswer"
  4026. },
  4027. "description": "User answers in order of questions (each answer is an array of selected labels)"
  4028. }
  4029. },
  4030. "required": ["answers"],
  4031. "additionalProperties": false
  4032. }
  4033. }
  4034. }
  4035. },
  4036. "x-codeSamples": [
  4037. {
  4038. "lang": "js",
  4039. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.question.reply({\n ...\n})"
  4040. }
  4041. ]
  4042. }
  4043. },
  4044. "/question/{requestID}/reject": {
  4045. "post": {
  4046. "tags": ["question"],
  4047. "operationId": "question.reject",
  4048. "parameters": [
  4049. {
  4050. "name": "directory",
  4051. "in": "query",
  4052. "required": false,
  4053. "schema": {
  4054. "type": "string"
  4055. }
  4056. },
  4057. {
  4058. "name": "workspace",
  4059. "in": "query",
  4060. "required": false,
  4061. "schema": {
  4062. "type": "string"
  4063. }
  4064. },
  4065. {
  4066. "name": "requestID",
  4067. "in": "path",
  4068. "schema": {
  4069. "type": "string",
  4070. "pattern": "^que.*"
  4071. },
  4072. "required": true
  4073. }
  4074. ],
  4075. "responses": {
  4076. "200": {
  4077. "description": "Question rejected successfully",
  4078. "content": {
  4079. "application/json": {
  4080. "schema": {
  4081. "type": "boolean",
  4082. "description": "Question rejected successfully"
  4083. }
  4084. }
  4085. }
  4086. },
  4087. "400": {
  4088. "description": "Bad request",
  4089. "content": {
  4090. "application/json": {
  4091. "schema": {
  4092. "$ref": "#/components/schemas/BadRequestError"
  4093. }
  4094. }
  4095. }
  4096. },
  4097. "404": {
  4098. "description": "Not found",
  4099. "content": {
  4100. "application/json": {
  4101. "schema": {
  4102. "$ref": "#/components/schemas/NotFoundError"
  4103. }
  4104. }
  4105. }
  4106. }
  4107. },
  4108. "description": "Reject a question request from the AI assistant.",
  4109. "summary": "Reject question request",
  4110. "x-codeSamples": [
  4111. {
  4112. "lang": "js",
  4113. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.question.reject({\n ...\n})"
  4114. }
  4115. ]
  4116. }
  4117. },
  4118. "/permission": {
  4119. "get": {
  4120. "tags": ["permission"],
  4121. "operationId": "permission.list",
  4122. "parameters": [
  4123. {
  4124. "name": "directory",
  4125. "in": "query",
  4126. "required": false,
  4127. "schema": {
  4128. "type": "string"
  4129. }
  4130. },
  4131. {
  4132. "name": "workspace",
  4133. "in": "query",
  4134. "required": false,
  4135. "schema": {
  4136. "type": "string"
  4137. }
  4138. }
  4139. ],
  4140. "responses": {
  4141. "200": {
  4142. "description": "List of pending permissions",
  4143. "content": {
  4144. "application/json": {
  4145. "schema": {
  4146. "type": "array",
  4147. "items": {
  4148. "$ref": "#/components/schemas/PermissionRequest"
  4149. },
  4150. "description": "List of pending permissions"
  4151. }
  4152. }
  4153. }
  4154. },
  4155. "400": {
  4156. "description": "Bad request",
  4157. "content": {
  4158. "application/json": {
  4159. "schema": {
  4160. "$ref": "#/components/schemas/BadRequestError"
  4161. }
  4162. }
  4163. }
  4164. }
  4165. },
  4166. "description": "Get all pending permission requests across all sessions.",
  4167. "summary": "List pending permissions",
  4168. "x-codeSamples": [
  4169. {
  4170. "lang": "js",
  4171. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.permission.list({\n ...\n})"
  4172. }
  4173. ]
  4174. }
  4175. },
  4176. "/permission/{requestID}/reply": {
  4177. "post": {
  4178. "tags": ["permission"],
  4179. "operationId": "permission.reply",
  4180. "parameters": [
  4181. {
  4182. "name": "directory",
  4183. "in": "query",
  4184. "required": false,
  4185. "schema": {
  4186. "type": "string"
  4187. }
  4188. },
  4189. {
  4190. "name": "workspace",
  4191. "in": "query",
  4192. "required": false,
  4193. "schema": {
  4194. "type": "string"
  4195. }
  4196. },
  4197. {
  4198. "name": "requestID",
  4199. "in": "path",
  4200. "schema": {
  4201. "type": "string",
  4202. "pattern": "^per.*"
  4203. },
  4204. "required": true
  4205. }
  4206. ],
  4207. "responses": {
  4208. "200": {
  4209. "description": "Permission processed successfully",
  4210. "content": {
  4211. "application/json": {
  4212. "schema": {
  4213. "type": "boolean",
  4214. "description": "Permission processed successfully"
  4215. }
  4216. }
  4217. }
  4218. },
  4219. "400": {
  4220. "description": "Bad request",
  4221. "content": {
  4222. "application/json": {
  4223. "schema": {
  4224. "$ref": "#/components/schemas/BadRequestError"
  4225. }
  4226. }
  4227. }
  4228. },
  4229. "404": {
  4230. "description": "Not found",
  4231. "content": {
  4232. "application/json": {
  4233. "schema": {
  4234. "$ref": "#/components/schemas/NotFoundError"
  4235. }
  4236. }
  4237. }
  4238. }
  4239. },
  4240. "description": "Approve or deny a permission request from the AI assistant.",
  4241. "summary": "Respond to permission request",
  4242. "requestBody": {
  4243. "content": {
  4244. "application/json": {
  4245. "schema": {
  4246. "type": "object",
  4247. "properties": {
  4248. "reply": {
  4249. "type": "string",
  4250. "enum": ["once", "always", "reject"]
  4251. },
  4252. "message": {
  4253. "type": "string"
  4254. }
  4255. },
  4256. "required": ["reply"],
  4257. "additionalProperties": false
  4258. }
  4259. }
  4260. }
  4261. },
  4262. "x-codeSamples": [
  4263. {
  4264. "lang": "js",
  4265. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.permission.reply({\n ...\n})"
  4266. }
  4267. ]
  4268. }
  4269. },
  4270. "/provider": {
  4271. "get": {
  4272. "tags": ["provider"],
  4273. "operationId": "provider.list",
  4274. "parameters": [
  4275. {
  4276. "name": "directory",
  4277. "in": "query",
  4278. "required": false,
  4279. "schema": {
  4280. "type": "string"
  4281. }
  4282. },
  4283. {
  4284. "name": "workspace",
  4285. "in": "query",
  4286. "required": false,
  4287. "schema": {
  4288. "type": "string"
  4289. }
  4290. }
  4291. ],
  4292. "responses": {
  4293. "200": {
  4294. "description": "List of providers",
  4295. "content": {
  4296. "application/json": {
  4297. "schema": {
  4298. "type": "object",
  4299. "properties": {
  4300. "all": {
  4301. "type": "array",
  4302. "items": {
  4303. "$ref": "#/components/schemas/Provider"
  4304. }
  4305. },
  4306. "default": {
  4307. "type": "object",
  4308. "additionalProperties": {
  4309. "type": "string"
  4310. }
  4311. },
  4312. "connected": {
  4313. "type": "array",
  4314. "items": {
  4315. "type": "string"
  4316. }
  4317. }
  4318. },
  4319. "required": ["all", "default", "connected"],
  4320. "additionalProperties": false,
  4321. "description": "List of providers"
  4322. }
  4323. }
  4324. }
  4325. },
  4326. "400": {
  4327. "description": "Bad request",
  4328. "content": {
  4329. "application/json": {
  4330. "schema": {
  4331. "$ref": "#/components/schemas/BadRequestError"
  4332. }
  4333. }
  4334. }
  4335. }
  4336. },
  4337. "description": "Get a list of all available AI providers, including both available and connected ones.",
  4338. "summary": "List providers",
  4339. "x-codeSamples": [
  4340. {
  4341. "lang": "js",
  4342. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.list({\n ...\n})"
  4343. }
  4344. ]
  4345. }
  4346. },
  4347. "/provider/auth": {
  4348. "get": {
  4349. "tags": ["provider"],
  4350. "operationId": "provider.auth",
  4351. "parameters": [
  4352. {
  4353. "name": "directory",
  4354. "in": "query",
  4355. "required": false,
  4356. "schema": {
  4357. "type": "string"
  4358. }
  4359. },
  4360. {
  4361. "name": "workspace",
  4362. "in": "query",
  4363. "required": false,
  4364. "schema": {
  4365. "type": "string"
  4366. }
  4367. }
  4368. ],
  4369. "responses": {
  4370. "200": {
  4371. "description": "Provider auth methods",
  4372. "content": {
  4373. "application/json": {
  4374. "schema": {
  4375. "type": "object",
  4376. "additionalProperties": {
  4377. "type": "array",
  4378. "items": {
  4379. "$ref": "#/components/schemas/ProviderAuthMethod"
  4380. }
  4381. },
  4382. "description": "Provider auth methods"
  4383. }
  4384. }
  4385. }
  4386. },
  4387. "400": {
  4388. "description": "Bad request",
  4389. "content": {
  4390. "application/json": {
  4391. "schema": {
  4392. "$ref": "#/components/schemas/BadRequestError"
  4393. }
  4394. }
  4395. }
  4396. }
  4397. },
  4398. "description": "Retrieve available authentication methods for all AI providers.",
  4399. "summary": "Get provider auth methods",
  4400. "x-codeSamples": [
  4401. {
  4402. "lang": "js",
  4403. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.auth({\n ...\n})"
  4404. }
  4405. ]
  4406. }
  4407. },
  4408. "/provider/{providerID}/oauth/authorize": {
  4409. "post": {
  4410. "tags": ["provider"],
  4411. "operationId": "provider.oauth.authorize",
  4412. "parameters": [
  4413. {
  4414. "name": "directory",
  4415. "in": "query",
  4416. "required": false,
  4417. "schema": {
  4418. "type": "string"
  4419. }
  4420. },
  4421. {
  4422. "name": "workspace",
  4423. "in": "query",
  4424. "required": false,
  4425. "schema": {
  4426. "type": "string"
  4427. }
  4428. },
  4429. {
  4430. "name": "providerID",
  4431. "in": "path",
  4432. "schema": {
  4433. "type": "string"
  4434. },
  4435. "required": true
  4436. }
  4437. ],
  4438. "responses": {
  4439. "200": {
  4440. "description": "Authorization URL and method",
  4441. "content": {
  4442. "application/json": {
  4443. "schema": {
  4444. "$ref": "#/components/schemas/ProviderAuthAuthorization"
  4445. }
  4446. }
  4447. }
  4448. },
  4449. "400": {
  4450. "description": "Bad request",
  4451. "content": {
  4452. "application/json": {
  4453. "schema": {
  4454. "$ref": "#/components/schemas/BadRequestError"
  4455. }
  4456. }
  4457. }
  4458. }
  4459. },
  4460. "description": "Start the OAuth authorization flow for a provider.",
  4461. "summary": "Start OAuth authorization",
  4462. "requestBody": {
  4463. "content": {
  4464. "application/json": {
  4465. "schema": {
  4466. "type": "object",
  4467. "properties": {
  4468. "method": {
  4469. "type": "number",
  4470. "description": "Auth method index"
  4471. },
  4472. "inputs": {
  4473. "type": "object",
  4474. "additionalProperties": {
  4475. "type": "string"
  4476. }
  4477. }
  4478. },
  4479. "required": ["method"],
  4480. "additionalProperties": false
  4481. }
  4482. }
  4483. }
  4484. },
  4485. "x-codeSamples": [
  4486. {
  4487. "lang": "js",
  4488. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.oauth.authorize({\n ...\n})"
  4489. }
  4490. ]
  4491. }
  4492. },
  4493. "/provider/{providerID}/oauth/callback": {
  4494. "post": {
  4495. "tags": ["provider"],
  4496. "operationId": "provider.oauth.callback",
  4497. "parameters": [
  4498. {
  4499. "name": "directory",
  4500. "in": "query",
  4501. "required": false,
  4502. "schema": {
  4503. "type": "string"
  4504. }
  4505. },
  4506. {
  4507. "name": "workspace",
  4508. "in": "query",
  4509. "required": false,
  4510. "schema": {
  4511. "type": "string"
  4512. }
  4513. },
  4514. {
  4515. "name": "providerID",
  4516. "in": "path",
  4517. "schema": {
  4518. "type": "string"
  4519. },
  4520. "required": true
  4521. }
  4522. ],
  4523. "responses": {
  4524. "200": {
  4525. "description": "OAuth callback processed successfully",
  4526. "content": {
  4527. "application/json": {
  4528. "schema": {
  4529. "type": "boolean",
  4530. "description": "OAuth callback processed successfully"
  4531. }
  4532. }
  4533. }
  4534. },
  4535. "400": {
  4536. "description": "Bad request",
  4537. "content": {
  4538. "application/json": {
  4539. "schema": {
  4540. "$ref": "#/components/schemas/BadRequestError"
  4541. }
  4542. }
  4543. }
  4544. }
  4545. },
  4546. "description": "Handle the OAuth callback from a provider after user authorization.",
  4547. "summary": "Handle OAuth callback",
  4548. "requestBody": {
  4549. "content": {
  4550. "application/json": {
  4551. "schema": {
  4552. "type": "object",
  4553. "properties": {
  4554. "method": {
  4555. "type": "number",
  4556. "description": "Auth method index"
  4557. },
  4558. "code": {
  4559. "type": "string"
  4560. }
  4561. },
  4562. "required": ["method"],
  4563. "additionalProperties": false
  4564. }
  4565. }
  4566. }
  4567. },
  4568. "x-codeSamples": [
  4569. {
  4570. "lang": "js",
  4571. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.oauth.callback({\n ...\n})"
  4572. }
  4573. ]
  4574. }
  4575. },
  4576. "/session": {
  4577. "get": {
  4578. "tags": ["session"],
  4579. "operationId": "session.list",
  4580. "parameters": [
  4581. {
  4582. "name": "directory",
  4583. "in": "query",
  4584. "required": false,
  4585. "schema": {
  4586. "type": "string"
  4587. }
  4588. },
  4589. {
  4590. "name": "workspace",
  4591. "in": "query",
  4592. "required": false,
  4593. "schema": {
  4594. "type": "string"
  4595. }
  4596. },
  4597. {
  4598. "name": "scope",
  4599. "in": "query",
  4600. "schema": {
  4601. "type": "string",
  4602. "enum": ["project"]
  4603. },
  4604. "required": false
  4605. },
  4606. {
  4607. "name": "path",
  4608. "in": "query",
  4609. "schema": {
  4610. "type": "string"
  4611. },
  4612. "required": false
  4613. },
  4614. {
  4615. "name": "roots",
  4616. "in": "query",
  4617. "schema": {
  4618. "anyOf": [
  4619. {
  4620. "type": "boolean"
  4621. },
  4622. {
  4623. "type": "string",
  4624. "enum": ["true", "false"]
  4625. }
  4626. ]
  4627. },
  4628. "required": false
  4629. },
  4630. {
  4631. "name": "start",
  4632. "in": "query",
  4633. "schema": {
  4634. "type": "number"
  4635. },
  4636. "required": false
  4637. },
  4638. {
  4639. "name": "search",
  4640. "in": "query",
  4641. "schema": {
  4642. "type": "string"
  4643. },
  4644. "required": false
  4645. },
  4646. {
  4647. "name": "limit",
  4648. "in": "query",
  4649. "schema": {
  4650. "type": "number"
  4651. },
  4652. "required": false
  4653. }
  4654. ],
  4655. "responses": {
  4656. "200": {
  4657. "description": "List of sessions",
  4658. "content": {
  4659. "application/json": {
  4660. "schema": {
  4661. "type": "array",
  4662. "items": {
  4663. "$ref": "#/components/schemas/Session"
  4664. },
  4665. "description": "List of sessions"
  4666. }
  4667. }
  4668. }
  4669. },
  4670. "400": {
  4671. "description": "Bad request",
  4672. "content": {
  4673. "application/json": {
  4674. "schema": {
  4675. "$ref": "#/components/schemas/BadRequestError"
  4676. }
  4677. }
  4678. }
  4679. }
  4680. },
  4681. "description": "Get a list of all OpenCode sessions, sorted by most recently updated.",
  4682. "summary": "List sessions",
  4683. "x-codeSamples": [
  4684. {
  4685. "lang": "js",
  4686. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.list({\n ...\n})"
  4687. }
  4688. ]
  4689. },
  4690. "post": {
  4691. "tags": ["session"],
  4692. "operationId": "session.create",
  4693. "parameters": [
  4694. {
  4695. "name": "directory",
  4696. "in": "query",
  4697. "required": false,
  4698. "schema": {
  4699. "type": "string"
  4700. }
  4701. },
  4702. {
  4703. "name": "workspace",
  4704. "in": "query",
  4705. "required": false,
  4706. "schema": {
  4707. "type": "string"
  4708. }
  4709. }
  4710. ],
  4711. "responses": {
  4712. "200": {
  4713. "description": "Successfully created session",
  4714. "content": {
  4715. "application/json": {
  4716. "schema": {
  4717. "$ref": "#/components/schemas/Session"
  4718. }
  4719. }
  4720. }
  4721. },
  4722. "400": {
  4723. "description": "Bad request",
  4724. "content": {
  4725. "application/json": {
  4726. "schema": {
  4727. "$ref": "#/components/schemas/BadRequestError"
  4728. }
  4729. }
  4730. }
  4731. }
  4732. },
  4733. "description": "Create a new OpenCode session for interacting with AI assistants and managing conversations.",
  4734. "summary": "Create session",
  4735. "requestBody": {
  4736. "content": {
  4737. "application/json": {
  4738. "schema": {
  4739. "type": "object",
  4740. "properties": {
  4741. "parentID": {
  4742. "type": "string"
  4743. },
  4744. "title": {
  4745. "type": "string"
  4746. },
  4747. "agent": {
  4748. "type": "string"
  4749. },
  4750. "model": {
  4751. "type": "object",
  4752. "properties": {
  4753. "id": {
  4754. "type": "string"
  4755. },
  4756. "providerID": {
  4757. "type": "string"
  4758. },
  4759. "variant": {
  4760. "type": "string"
  4761. }
  4762. },
  4763. "required": ["id", "providerID"],
  4764. "additionalProperties": false
  4765. },
  4766. "permission": {
  4767. "$ref": "#/components/schemas/PermissionRuleset"
  4768. },
  4769. "workspaceID": {
  4770. "type": "string"
  4771. }
  4772. },
  4773. "additionalProperties": false
  4774. }
  4775. }
  4776. }
  4777. },
  4778. "x-codeSamples": [
  4779. {
  4780. "lang": "js",
  4781. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.create({\n ...\n})"
  4782. }
  4783. ]
  4784. }
  4785. },
  4786. "/session/status": {
  4787. "get": {
  4788. "tags": ["session"],
  4789. "operationId": "session.status",
  4790. "parameters": [
  4791. {
  4792. "name": "directory",
  4793. "in": "query",
  4794. "required": false,
  4795. "schema": {
  4796. "type": "string"
  4797. }
  4798. },
  4799. {
  4800. "name": "workspace",
  4801. "in": "query",
  4802. "required": false,
  4803. "schema": {
  4804. "type": "string"
  4805. }
  4806. }
  4807. ],
  4808. "responses": {
  4809. "200": {
  4810. "description": "Get session status",
  4811. "content": {
  4812. "application/json": {
  4813. "schema": {
  4814. "type": "object",
  4815. "additionalProperties": {
  4816. "$ref": "#/components/schemas/SessionStatus"
  4817. },
  4818. "description": "Get session status"
  4819. }
  4820. }
  4821. }
  4822. },
  4823. "400": {
  4824. "description": "Bad request",
  4825. "content": {
  4826. "application/json": {
  4827. "schema": {
  4828. "$ref": "#/components/schemas/BadRequestError"
  4829. }
  4830. }
  4831. }
  4832. }
  4833. },
  4834. "description": "Retrieve the current status of all sessions, including active, idle, and completed states.",
  4835. "summary": "Get session status",
  4836. "x-codeSamples": [
  4837. {
  4838. "lang": "js",
  4839. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.status({\n ...\n})"
  4840. }
  4841. ]
  4842. }
  4843. },
  4844. "/session/{sessionID}": {
  4845. "get": {
  4846. "tags": ["session"],
  4847. "operationId": "session.get",
  4848. "parameters": [
  4849. {
  4850. "name": "directory",
  4851. "in": "query",
  4852. "required": false,
  4853. "schema": {
  4854. "type": "string"
  4855. }
  4856. },
  4857. {
  4858. "name": "workspace",
  4859. "in": "query",
  4860. "required": false,
  4861. "schema": {
  4862. "type": "string"
  4863. }
  4864. },
  4865. {
  4866. "name": "sessionID",
  4867. "in": "path",
  4868. "schema": {
  4869. "type": "string",
  4870. "pattern": "^ses.*"
  4871. },
  4872. "required": true
  4873. }
  4874. ],
  4875. "responses": {
  4876. "200": {
  4877. "description": "Get session",
  4878. "content": {
  4879. "application/json": {
  4880. "schema": {
  4881. "$ref": "#/components/schemas/Session"
  4882. }
  4883. }
  4884. }
  4885. },
  4886. "400": {
  4887. "description": "Bad request",
  4888. "content": {
  4889. "application/json": {
  4890. "schema": {
  4891. "$ref": "#/components/schemas/BadRequestError"
  4892. }
  4893. }
  4894. }
  4895. },
  4896. "404": {
  4897. "description": "Not found",
  4898. "content": {
  4899. "application/json": {
  4900. "schema": {
  4901. "$ref": "#/components/schemas/NotFoundError"
  4902. }
  4903. }
  4904. }
  4905. }
  4906. },
  4907. "description": "Retrieve detailed information about a specific OpenCode session.",
  4908. "summary": "Get session",
  4909. "x-codeSamples": [
  4910. {
  4911. "lang": "js",
  4912. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.get({\n ...\n})"
  4913. }
  4914. ]
  4915. },
  4916. "delete": {
  4917. "tags": ["session"],
  4918. "operationId": "session.delete",
  4919. "parameters": [
  4920. {
  4921. "name": "directory",
  4922. "in": "query",
  4923. "required": false,
  4924. "schema": {
  4925. "type": "string"
  4926. }
  4927. },
  4928. {
  4929. "name": "workspace",
  4930. "in": "query",
  4931. "required": false,
  4932. "schema": {
  4933. "type": "string"
  4934. }
  4935. },
  4936. {
  4937. "name": "sessionID",
  4938. "in": "path",
  4939. "schema": {
  4940. "type": "string",
  4941. "pattern": "^ses.*"
  4942. },
  4943. "required": true
  4944. }
  4945. ],
  4946. "responses": {
  4947. "200": {
  4948. "description": "Successfully deleted session",
  4949. "content": {
  4950. "application/json": {
  4951. "schema": {
  4952. "type": "boolean",
  4953. "description": "Successfully deleted session"
  4954. }
  4955. }
  4956. }
  4957. },
  4958. "400": {
  4959. "description": "Bad request",
  4960. "content": {
  4961. "application/json": {
  4962. "schema": {
  4963. "$ref": "#/components/schemas/BadRequestError"
  4964. }
  4965. }
  4966. }
  4967. },
  4968. "404": {
  4969. "description": "Not found",
  4970. "content": {
  4971. "application/json": {
  4972. "schema": {
  4973. "$ref": "#/components/schemas/NotFoundError"
  4974. }
  4975. }
  4976. }
  4977. }
  4978. },
  4979. "description": "Delete a session and permanently remove all associated data, including messages and history.",
  4980. "summary": "Delete session",
  4981. "x-codeSamples": [
  4982. {
  4983. "lang": "js",
  4984. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.delete({\n ...\n})"
  4985. }
  4986. ]
  4987. },
  4988. "patch": {
  4989. "tags": ["session"],
  4990. "operationId": "session.update",
  4991. "parameters": [
  4992. {
  4993. "name": "directory",
  4994. "in": "query",
  4995. "required": false,
  4996. "schema": {
  4997. "type": "string"
  4998. }
  4999. },
  5000. {
  5001. "name": "workspace",
  5002. "in": "query",
  5003. "required": false,
  5004. "schema": {
  5005. "type": "string"
  5006. }
  5007. },
  5008. {
  5009. "name": "sessionID",
  5010. "in": "path",
  5011. "schema": {
  5012. "type": "string",
  5013. "pattern": "^ses.*"
  5014. },
  5015. "required": true
  5016. }
  5017. ],
  5018. "responses": {
  5019. "200": {
  5020. "description": "Successfully updated session",
  5021. "content": {
  5022. "application/json": {
  5023. "schema": {
  5024. "$ref": "#/components/schemas/Session"
  5025. }
  5026. }
  5027. }
  5028. },
  5029. "400": {
  5030. "description": "Bad request",
  5031. "content": {
  5032. "application/json": {
  5033. "schema": {
  5034. "$ref": "#/components/schemas/BadRequestError"
  5035. }
  5036. }
  5037. }
  5038. },
  5039. "404": {
  5040. "description": "Not found",
  5041. "content": {
  5042. "application/json": {
  5043. "schema": {
  5044. "$ref": "#/components/schemas/NotFoundError"
  5045. }
  5046. }
  5047. }
  5048. }
  5049. },
  5050. "description": "Update properties of an existing session, such as title or other metadata.",
  5051. "summary": "Update session",
  5052. "requestBody": {
  5053. "content": {
  5054. "application/json": {
  5055. "schema": {
  5056. "type": "object",
  5057. "properties": {
  5058. "title": {
  5059. "type": "string"
  5060. },
  5061. "permission": {
  5062. "$ref": "#/components/schemas/PermissionRuleset"
  5063. },
  5064. "time": {
  5065. "type": "object",
  5066. "properties": {
  5067. "archived": {
  5068. "type": "number"
  5069. }
  5070. },
  5071. "additionalProperties": false
  5072. }
  5073. },
  5074. "additionalProperties": false
  5075. }
  5076. }
  5077. }
  5078. },
  5079. "x-codeSamples": [
  5080. {
  5081. "lang": "js",
  5082. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.update({\n ...\n})"
  5083. }
  5084. ]
  5085. }
  5086. },
  5087. "/session/{sessionID}/children": {
  5088. "get": {
  5089. "tags": ["session"],
  5090. "operationId": "session.children",
  5091. "parameters": [
  5092. {
  5093. "name": "directory",
  5094. "in": "query",
  5095. "required": false,
  5096. "schema": {
  5097. "type": "string"
  5098. }
  5099. },
  5100. {
  5101. "name": "workspace",
  5102. "in": "query",
  5103. "required": false,
  5104. "schema": {
  5105. "type": "string"
  5106. }
  5107. },
  5108. {
  5109. "name": "sessionID",
  5110. "in": "path",
  5111. "schema": {
  5112. "type": "string",
  5113. "pattern": "^ses.*"
  5114. },
  5115. "required": true
  5116. }
  5117. ],
  5118. "responses": {
  5119. "200": {
  5120. "description": "List of children",
  5121. "content": {
  5122. "application/json": {
  5123. "schema": {
  5124. "type": "array",
  5125. "items": {
  5126. "$ref": "#/components/schemas/Session"
  5127. },
  5128. "description": "List of children"
  5129. }
  5130. }
  5131. }
  5132. },
  5133. "400": {
  5134. "description": "Bad request",
  5135. "content": {
  5136. "application/json": {
  5137. "schema": {
  5138. "$ref": "#/components/schemas/BadRequestError"
  5139. }
  5140. }
  5141. }
  5142. },
  5143. "404": {
  5144. "description": "Not found",
  5145. "content": {
  5146. "application/json": {
  5147. "schema": {
  5148. "$ref": "#/components/schemas/NotFoundError"
  5149. }
  5150. }
  5151. }
  5152. }
  5153. },
  5154. "description": "Retrieve all child sessions that were forked from the specified parent session.",
  5155. "summary": "Get session children",
  5156. "x-codeSamples": [
  5157. {
  5158. "lang": "js",
  5159. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.children({\n ...\n})"
  5160. }
  5161. ]
  5162. }
  5163. },
  5164. "/session/{sessionID}/todo": {
  5165. "get": {
  5166. "tags": ["session"],
  5167. "operationId": "session.todo",
  5168. "parameters": [
  5169. {
  5170. "name": "directory",
  5171. "in": "query",
  5172. "required": false,
  5173. "schema": {
  5174. "type": "string"
  5175. }
  5176. },
  5177. {
  5178. "name": "workspace",
  5179. "in": "query",
  5180. "required": false,
  5181. "schema": {
  5182. "type": "string"
  5183. }
  5184. },
  5185. {
  5186. "name": "sessionID",
  5187. "in": "path",
  5188. "schema": {
  5189. "type": "string",
  5190. "pattern": "^ses.*"
  5191. },
  5192. "required": true
  5193. }
  5194. ],
  5195. "responses": {
  5196. "200": {
  5197. "description": "Todo list",
  5198. "content": {
  5199. "application/json": {
  5200. "schema": {
  5201. "type": "array",
  5202. "items": {
  5203. "$ref": "#/components/schemas/Todo"
  5204. },
  5205. "description": "Todo list"
  5206. }
  5207. }
  5208. }
  5209. },
  5210. "400": {
  5211. "description": "Bad request",
  5212. "content": {
  5213. "application/json": {
  5214. "schema": {
  5215. "$ref": "#/components/schemas/BadRequestError"
  5216. }
  5217. }
  5218. }
  5219. },
  5220. "404": {
  5221. "description": "Not found",
  5222. "content": {
  5223. "application/json": {
  5224. "schema": {
  5225. "$ref": "#/components/schemas/NotFoundError"
  5226. }
  5227. }
  5228. }
  5229. }
  5230. },
  5231. "description": "Retrieve the todo list associated with a specific session, showing tasks and action items.",
  5232. "summary": "Get session todos",
  5233. "x-codeSamples": [
  5234. {
  5235. "lang": "js",
  5236. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.todo({\n ...\n})"
  5237. }
  5238. ]
  5239. }
  5240. },
  5241. "/session/{sessionID}/diff": {
  5242. "get": {
  5243. "tags": ["session"],
  5244. "operationId": "session.diff",
  5245. "parameters": [
  5246. {
  5247. "name": "directory",
  5248. "in": "query",
  5249. "required": false,
  5250. "schema": {
  5251. "type": "string"
  5252. }
  5253. },
  5254. {
  5255. "name": "workspace",
  5256. "in": "query",
  5257. "required": false,
  5258. "schema": {
  5259. "type": "string"
  5260. }
  5261. },
  5262. {
  5263. "name": "sessionID",
  5264. "in": "path",
  5265. "schema": {
  5266. "type": "string",
  5267. "pattern": "^ses.*"
  5268. },
  5269. "required": true
  5270. },
  5271. {
  5272. "name": "messageID",
  5273. "in": "query",
  5274. "schema": {
  5275. "type": "string",
  5276. "pattern": "^msg.*"
  5277. },
  5278. "required": false
  5279. }
  5280. ],
  5281. "responses": {
  5282. "200": {
  5283. "description": "Successfully retrieved diff",
  5284. "content": {
  5285. "application/json": {
  5286. "schema": {
  5287. "type": "array",
  5288. "items": {
  5289. "$ref": "#/components/schemas/SnapshotFileDiff"
  5290. },
  5291. "description": "Successfully retrieved diff"
  5292. }
  5293. }
  5294. }
  5295. },
  5296. "400": {
  5297. "description": "Bad request",
  5298. "content": {
  5299. "application/json": {
  5300. "schema": {
  5301. "$ref": "#/components/schemas/BadRequestError"
  5302. }
  5303. }
  5304. }
  5305. }
  5306. },
  5307. "description": "Get the file changes (diff) that resulted from a specific user message in the session.",
  5308. "summary": "Get message diff",
  5309. "x-codeSamples": [
  5310. {
  5311. "lang": "js",
  5312. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.diff({\n ...\n})"
  5313. }
  5314. ]
  5315. }
  5316. },
  5317. "/session/{sessionID}/message": {
  5318. "get": {
  5319. "tags": ["session"],
  5320. "operationId": "session.messages",
  5321. "parameters": [
  5322. {
  5323. "name": "directory",
  5324. "in": "query",
  5325. "required": false,
  5326. "schema": {
  5327. "type": "string"
  5328. }
  5329. },
  5330. {
  5331. "name": "workspace",
  5332. "in": "query",
  5333. "required": false,
  5334. "schema": {
  5335. "type": "string"
  5336. }
  5337. },
  5338. {
  5339. "name": "sessionID",
  5340. "in": "path",
  5341. "schema": {
  5342. "type": "string",
  5343. "pattern": "^ses.*"
  5344. },
  5345. "required": true
  5346. },
  5347. {
  5348. "name": "limit",
  5349. "in": "query",
  5350. "schema": {
  5351. "type": "integer",
  5352. "minimum": 0,
  5353. "maximum": 9007199254740991
  5354. },
  5355. "required": false
  5356. },
  5357. {
  5358. "name": "before",
  5359. "in": "query",
  5360. "schema": {
  5361. "type": "string"
  5362. },
  5363. "required": false
  5364. }
  5365. ],
  5366. "responses": {
  5367. "200": {
  5368. "description": "List of messages",
  5369. "content": {
  5370. "application/json": {
  5371. "schema": {
  5372. "type": "array",
  5373. "items": {
  5374. "type": "object",
  5375. "properties": {
  5376. "info": {
  5377. "$ref": "#/components/schemas/Message"
  5378. },
  5379. "parts": {
  5380. "type": "array",
  5381. "items": {
  5382. "$ref": "#/components/schemas/Part"
  5383. }
  5384. }
  5385. },
  5386. "required": ["info", "parts"],
  5387. "additionalProperties": false
  5388. },
  5389. "description": "List of messages"
  5390. }
  5391. }
  5392. }
  5393. },
  5394. "400": {
  5395. "description": "Bad request",
  5396. "content": {
  5397. "application/json": {
  5398. "schema": {
  5399. "$ref": "#/components/schemas/BadRequestError"
  5400. }
  5401. }
  5402. }
  5403. },
  5404. "404": {
  5405. "description": "Not found",
  5406. "content": {
  5407. "application/json": {
  5408. "schema": {
  5409. "$ref": "#/components/schemas/NotFoundError"
  5410. }
  5411. }
  5412. }
  5413. }
  5414. },
  5415. "description": "Retrieve all messages in a session, including user prompts and AI responses.",
  5416. "summary": "Get session messages",
  5417. "x-codeSamples": [
  5418. {
  5419. "lang": "js",
  5420. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.messages({\n ...\n})"
  5421. }
  5422. ]
  5423. },
  5424. "post": {
  5425. "tags": ["session"],
  5426. "operationId": "session.prompt",
  5427. "parameters": [
  5428. {
  5429. "name": "directory",
  5430. "in": "query",
  5431. "required": false,
  5432. "schema": {
  5433. "type": "string"
  5434. }
  5435. },
  5436. {
  5437. "name": "workspace",
  5438. "in": "query",
  5439. "required": false,
  5440. "schema": {
  5441. "type": "string"
  5442. }
  5443. },
  5444. {
  5445. "name": "sessionID",
  5446. "in": "path",
  5447. "schema": {
  5448. "type": "string",
  5449. "pattern": "^ses.*"
  5450. },
  5451. "required": true
  5452. }
  5453. ],
  5454. "responses": {
  5455. "200": {
  5456. "description": "Created message",
  5457. "content": {
  5458. "application/json": {
  5459. "schema": {
  5460. "type": "object",
  5461. "required": ["info", "parts"],
  5462. "properties": {
  5463. "info": {
  5464. "$ref": "#/components/schemas/AssistantMessage"
  5465. },
  5466. "parts": {
  5467. "type": "array",
  5468. "items": {
  5469. "$ref": "#/components/schemas/Part"
  5470. }
  5471. }
  5472. }
  5473. }
  5474. }
  5475. }
  5476. },
  5477. "400": {
  5478. "description": "Bad request",
  5479. "content": {
  5480. "application/json": {
  5481. "schema": {
  5482. "$ref": "#/components/schemas/BadRequestError"
  5483. }
  5484. }
  5485. }
  5486. },
  5487. "404": {
  5488. "description": "Not found",
  5489. "content": {
  5490. "application/json": {
  5491. "schema": {
  5492. "$ref": "#/components/schemas/NotFoundError"
  5493. }
  5494. }
  5495. }
  5496. }
  5497. },
  5498. "description": "Create and send a new message to a session, streaming the AI response.",
  5499. "summary": "Send message",
  5500. "requestBody": {
  5501. "content": {
  5502. "application/json": {
  5503. "schema": {
  5504. "type": "object",
  5505. "properties": {
  5506. "messageID": {
  5507. "type": "string"
  5508. },
  5509. "model": {
  5510. "type": "object",
  5511. "properties": {
  5512. "providerID": {
  5513. "type": "string"
  5514. },
  5515. "modelID": {
  5516. "type": "string"
  5517. }
  5518. },
  5519. "required": ["providerID", "modelID"],
  5520. "additionalProperties": false
  5521. },
  5522. "agent": {
  5523. "type": "string"
  5524. },
  5525. "noReply": {
  5526. "type": "boolean"
  5527. },
  5528. "tools": {
  5529. "type": "object",
  5530. "additionalProperties": {
  5531. "type": "boolean"
  5532. }
  5533. },
  5534. "format": {
  5535. "$ref": "#/components/schemas/OutputFormat"
  5536. },
  5537. "system": {
  5538. "type": "string"
  5539. },
  5540. "variant": {
  5541. "type": "string"
  5542. },
  5543. "parts": {
  5544. "type": "array",
  5545. "items": {
  5546. "anyOf": [
  5547. {
  5548. "$ref": "#/components/schemas/TextPartInput"
  5549. },
  5550. {
  5551. "$ref": "#/components/schemas/FilePartInput"
  5552. },
  5553. {
  5554. "$ref": "#/components/schemas/AgentPartInput"
  5555. },
  5556. {
  5557. "$ref": "#/components/schemas/SubtaskPartInput"
  5558. }
  5559. ]
  5560. }
  5561. }
  5562. },
  5563. "required": ["parts"],
  5564. "additionalProperties": false
  5565. }
  5566. }
  5567. }
  5568. },
  5569. "x-codeSamples": [
  5570. {
  5571. "lang": "js",
  5572. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.prompt({\n ...\n})"
  5573. }
  5574. ]
  5575. }
  5576. },
  5577. "/session/{sessionID}/message/{messageID}": {
  5578. "get": {
  5579. "tags": ["session"],
  5580. "operationId": "session.message",
  5581. "parameters": [
  5582. {
  5583. "name": "directory",
  5584. "in": "query",
  5585. "required": false,
  5586. "schema": {
  5587. "type": "string"
  5588. }
  5589. },
  5590. {
  5591. "name": "workspace",
  5592. "in": "query",
  5593. "required": false,
  5594. "schema": {
  5595. "type": "string"
  5596. }
  5597. },
  5598. {
  5599. "name": "sessionID",
  5600. "in": "path",
  5601. "schema": {
  5602. "type": "string",
  5603. "pattern": "^ses.*"
  5604. },
  5605. "required": true
  5606. },
  5607. {
  5608. "name": "messageID",
  5609. "in": "path",
  5610. "schema": {
  5611. "type": "string",
  5612. "pattern": "^msg.*"
  5613. },
  5614. "required": true
  5615. }
  5616. ],
  5617. "responses": {
  5618. "200": {
  5619. "description": "Message",
  5620. "content": {
  5621. "application/json": {
  5622. "schema": {
  5623. "type": "object",
  5624. "properties": {
  5625. "info": {
  5626. "$ref": "#/components/schemas/Message"
  5627. },
  5628. "parts": {
  5629. "type": "array",
  5630. "items": {
  5631. "$ref": "#/components/schemas/Part"
  5632. }
  5633. }
  5634. },
  5635. "required": ["info", "parts"],
  5636. "additionalProperties": false,
  5637. "description": "Message"
  5638. }
  5639. }
  5640. }
  5641. },
  5642. "400": {
  5643. "description": "Bad request",
  5644. "content": {
  5645. "application/json": {
  5646. "schema": {
  5647. "$ref": "#/components/schemas/BadRequestError"
  5648. }
  5649. }
  5650. }
  5651. },
  5652. "404": {
  5653. "description": "Not found",
  5654. "content": {
  5655. "application/json": {
  5656. "schema": {
  5657. "$ref": "#/components/schemas/NotFoundError"
  5658. }
  5659. }
  5660. }
  5661. }
  5662. },
  5663. "description": "Retrieve a specific message from a session by its message ID.",
  5664. "summary": "Get message",
  5665. "x-codeSamples": [
  5666. {
  5667. "lang": "js",
  5668. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.message({\n ...\n})"
  5669. }
  5670. ]
  5671. },
  5672. "delete": {
  5673. "tags": ["session"],
  5674. "operationId": "session.deleteMessage",
  5675. "parameters": [
  5676. {
  5677. "name": "directory",
  5678. "in": "query",
  5679. "required": false,
  5680. "schema": {
  5681. "type": "string"
  5682. }
  5683. },
  5684. {
  5685. "name": "workspace",
  5686. "in": "query",
  5687. "required": false,
  5688. "schema": {
  5689. "type": "string"
  5690. }
  5691. },
  5692. {
  5693. "name": "sessionID",
  5694. "in": "path",
  5695. "schema": {
  5696. "type": "string",
  5697. "pattern": "^ses.*"
  5698. },
  5699. "required": true
  5700. },
  5701. {
  5702. "name": "messageID",
  5703. "in": "path",
  5704. "schema": {
  5705. "type": "string",
  5706. "pattern": "^msg.*"
  5707. },
  5708. "required": true
  5709. }
  5710. ],
  5711. "responses": {
  5712. "200": {
  5713. "description": "Successfully deleted message",
  5714. "content": {
  5715. "application/json": {
  5716. "schema": {
  5717. "type": "boolean",
  5718. "description": "Successfully deleted message"
  5719. }
  5720. }
  5721. }
  5722. },
  5723. "400": {
  5724. "description": "Bad request",
  5725. "content": {
  5726. "application/json": {
  5727. "schema": {
  5728. "$ref": "#/components/schemas/BadRequestError"
  5729. }
  5730. }
  5731. }
  5732. },
  5733. "404": {
  5734. "description": "Not found",
  5735. "content": {
  5736. "application/json": {
  5737. "schema": {
  5738. "$ref": "#/components/schemas/NotFoundError"
  5739. }
  5740. }
  5741. }
  5742. }
  5743. },
  5744. "description": "Permanently delete a specific message and all of its parts from a session without reverting file changes.",
  5745. "summary": "Delete message",
  5746. "x-codeSamples": [
  5747. {
  5748. "lang": "js",
  5749. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.deleteMessage({\n ...\n})"
  5750. }
  5751. ]
  5752. }
  5753. },
  5754. "/session/{sessionID}/fork": {
  5755. "post": {
  5756. "tags": ["session"],
  5757. "operationId": "session.fork",
  5758. "parameters": [
  5759. {
  5760. "name": "directory",
  5761. "in": "query",
  5762. "required": false,
  5763. "schema": {
  5764. "type": "string"
  5765. }
  5766. },
  5767. {
  5768. "name": "workspace",
  5769. "in": "query",
  5770. "required": false,
  5771. "schema": {
  5772. "type": "string"
  5773. }
  5774. },
  5775. {
  5776. "name": "sessionID",
  5777. "in": "path",
  5778. "schema": {
  5779. "type": "string",
  5780. "pattern": "^ses.*"
  5781. },
  5782. "required": true
  5783. }
  5784. ],
  5785. "responses": {
  5786. "200": {
  5787. "description": "200",
  5788. "content": {
  5789. "application/json": {
  5790. "schema": {
  5791. "$ref": "#/components/schemas/Session"
  5792. }
  5793. }
  5794. }
  5795. },
  5796. "400": {
  5797. "description": "Bad request",
  5798. "content": {
  5799. "application/json": {
  5800. "schema": {
  5801. "$ref": "#/components/schemas/BadRequestError"
  5802. }
  5803. }
  5804. }
  5805. }
  5806. },
  5807. "description": "Create a new session by forking an existing session at a specific message point.",
  5808. "summary": "Fork session",
  5809. "requestBody": {
  5810. "content": {
  5811. "application/json": {
  5812. "schema": {
  5813. "type": "object",
  5814. "properties": {
  5815. "messageID": {
  5816. "type": "string"
  5817. }
  5818. },
  5819. "additionalProperties": false
  5820. }
  5821. }
  5822. }
  5823. },
  5824. "x-codeSamples": [
  5825. {
  5826. "lang": "js",
  5827. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.fork({\n ...\n})"
  5828. }
  5829. ]
  5830. }
  5831. },
  5832. "/session/{sessionID}/abort": {
  5833. "post": {
  5834. "tags": ["session"],
  5835. "operationId": "session.abort",
  5836. "parameters": [
  5837. {
  5838. "name": "directory",
  5839. "in": "query",
  5840. "required": false,
  5841. "schema": {
  5842. "type": "string"
  5843. }
  5844. },
  5845. {
  5846. "name": "workspace",
  5847. "in": "query",
  5848. "required": false,
  5849. "schema": {
  5850. "type": "string"
  5851. }
  5852. },
  5853. {
  5854. "name": "sessionID",
  5855. "in": "path",
  5856. "schema": {
  5857. "type": "string",
  5858. "pattern": "^ses.*"
  5859. },
  5860. "required": true
  5861. }
  5862. ],
  5863. "responses": {
  5864. "200": {
  5865. "description": "Aborted session",
  5866. "content": {
  5867. "application/json": {
  5868. "schema": {
  5869. "type": "boolean",
  5870. "description": "Aborted session"
  5871. }
  5872. }
  5873. }
  5874. },
  5875. "400": {
  5876. "description": "Bad request",
  5877. "content": {
  5878. "application/json": {
  5879. "schema": {
  5880. "$ref": "#/components/schemas/BadRequestError"
  5881. }
  5882. }
  5883. }
  5884. },
  5885. "404": {
  5886. "description": "Not found",
  5887. "content": {
  5888. "application/json": {
  5889. "schema": {
  5890. "$ref": "#/components/schemas/NotFoundError"
  5891. }
  5892. }
  5893. }
  5894. }
  5895. },
  5896. "description": "Abort an active session and stop any ongoing AI processing or command execution.",
  5897. "summary": "Abort session",
  5898. "x-codeSamples": [
  5899. {
  5900. "lang": "js",
  5901. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.abort({\n ...\n})"
  5902. }
  5903. ]
  5904. }
  5905. },
  5906. "/session/{sessionID}/init": {
  5907. "post": {
  5908. "tags": ["session"],
  5909. "operationId": "session.init",
  5910. "parameters": [
  5911. {
  5912. "name": "directory",
  5913. "in": "query",
  5914. "required": false,
  5915. "schema": {
  5916. "type": "string"
  5917. }
  5918. },
  5919. {
  5920. "name": "workspace",
  5921. "in": "query",
  5922. "required": false,
  5923. "schema": {
  5924. "type": "string"
  5925. }
  5926. },
  5927. {
  5928. "name": "sessionID",
  5929. "in": "path",
  5930. "schema": {
  5931. "type": "string",
  5932. "pattern": "^ses.*"
  5933. },
  5934. "required": true
  5935. }
  5936. ],
  5937. "responses": {
  5938. "200": {
  5939. "description": "200",
  5940. "content": {
  5941. "application/json": {
  5942. "schema": {
  5943. "type": "boolean",
  5944. "description": "200"
  5945. }
  5946. }
  5947. }
  5948. },
  5949. "400": {
  5950. "description": "Bad request",
  5951. "content": {
  5952. "application/json": {
  5953. "schema": {
  5954. "$ref": "#/components/schemas/BadRequestError"
  5955. }
  5956. }
  5957. }
  5958. },
  5959. "404": {
  5960. "description": "Not found",
  5961. "content": {
  5962. "application/json": {
  5963. "schema": {
  5964. "$ref": "#/components/schemas/NotFoundError"
  5965. }
  5966. }
  5967. }
  5968. }
  5969. },
  5970. "description": "Analyze the current application and create an AGENTS.md file with project-specific agent configurations.",
  5971. "summary": "Initialize session",
  5972. "requestBody": {
  5973. "content": {
  5974. "application/json": {
  5975. "schema": {
  5976. "type": "object",
  5977. "properties": {
  5978. "modelID": {
  5979. "type": "string"
  5980. },
  5981. "providerID": {
  5982. "type": "string"
  5983. },
  5984. "messageID": {
  5985. "type": "string"
  5986. }
  5987. },
  5988. "required": ["modelID", "providerID", "messageID"],
  5989. "additionalProperties": false
  5990. }
  5991. }
  5992. }
  5993. },
  5994. "x-codeSamples": [
  5995. {
  5996. "lang": "js",
  5997. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.init({\n ...\n})"
  5998. }
  5999. ]
  6000. }
  6001. },
  6002. "/session/{sessionID}/share": {
  6003. "post": {
  6004. "tags": ["session"],
  6005. "operationId": "session.share",
  6006. "parameters": [
  6007. {
  6008. "name": "directory",
  6009. "in": "query",
  6010. "required": false,
  6011. "schema": {
  6012. "type": "string"
  6013. }
  6014. },
  6015. {
  6016. "name": "workspace",
  6017. "in": "query",
  6018. "required": false,
  6019. "schema": {
  6020. "type": "string"
  6021. }
  6022. },
  6023. {
  6024. "name": "sessionID",
  6025. "in": "path",
  6026. "schema": {
  6027. "type": "string",
  6028. "pattern": "^ses.*"
  6029. },
  6030. "required": true
  6031. }
  6032. ],
  6033. "responses": {
  6034. "200": {
  6035. "description": "Successfully shared session",
  6036. "content": {
  6037. "application/json": {
  6038. "schema": {
  6039. "$ref": "#/components/schemas/Session"
  6040. }
  6041. }
  6042. }
  6043. },
  6044. "400": {
  6045. "description": "Bad request",
  6046. "content": {
  6047. "application/json": {
  6048. "schema": {
  6049. "$ref": "#/components/schemas/BadRequestError"
  6050. }
  6051. }
  6052. }
  6053. },
  6054. "404": {
  6055. "description": "Not found",
  6056. "content": {
  6057. "application/json": {
  6058. "schema": {
  6059. "$ref": "#/components/schemas/NotFoundError"
  6060. }
  6061. }
  6062. }
  6063. }
  6064. },
  6065. "description": "Create a shareable link for a session, allowing others to view the conversation.",
  6066. "summary": "Share session",
  6067. "x-codeSamples": [
  6068. {
  6069. "lang": "js",
  6070. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.share({\n ...\n})"
  6071. }
  6072. ]
  6073. },
  6074. "delete": {
  6075. "tags": ["session"],
  6076. "operationId": "session.unshare",
  6077. "parameters": [
  6078. {
  6079. "name": "directory",
  6080. "in": "query",
  6081. "required": false,
  6082. "schema": {
  6083. "type": "string"
  6084. }
  6085. },
  6086. {
  6087. "name": "workspace",
  6088. "in": "query",
  6089. "required": false,
  6090. "schema": {
  6091. "type": "string"
  6092. }
  6093. },
  6094. {
  6095. "name": "sessionID",
  6096. "in": "path",
  6097. "schema": {
  6098. "type": "string",
  6099. "pattern": "^ses.*"
  6100. },
  6101. "required": true
  6102. }
  6103. ],
  6104. "responses": {
  6105. "200": {
  6106. "description": "Successfully unshared session",
  6107. "content": {
  6108. "application/json": {
  6109. "schema": {
  6110. "$ref": "#/components/schemas/Session"
  6111. }
  6112. }
  6113. }
  6114. },
  6115. "400": {
  6116. "description": "Bad request",
  6117. "content": {
  6118. "application/json": {
  6119. "schema": {
  6120. "$ref": "#/components/schemas/BadRequestError"
  6121. }
  6122. }
  6123. }
  6124. },
  6125. "404": {
  6126. "description": "Not found",
  6127. "content": {
  6128. "application/json": {
  6129. "schema": {
  6130. "$ref": "#/components/schemas/NotFoundError"
  6131. }
  6132. }
  6133. }
  6134. }
  6135. },
  6136. "description": "Remove the shareable link for a session, making it private again.",
  6137. "summary": "Unshare session",
  6138. "x-codeSamples": [
  6139. {
  6140. "lang": "js",
  6141. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.unshare({\n ...\n})"
  6142. }
  6143. ]
  6144. }
  6145. },
  6146. "/session/{sessionID}/summarize": {
  6147. "post": {
  6148. "tags": ["session"],
  6149. "operationId": "session.summarize",
  6150. "parameters": [
  6151. {
  6152. "name": "directory",
  6153. "in": "query",
  6154. "required": false,
  6155. "schema": {
  6156. "type": "string"
  6157. }
  6158. },
  6159. {
  6160. "name": "workspace",
  6161. "in": "query",
  6162. "required": false,
  6163. "schema": {
  6164. "type": "string"
  6165. }
  6166. },
  6167. {
  6168. "name": "sessionID",
  6169. "in": "path",
  6170. "schema": {
  6171. "type": "string",
  6172. "pattern": "^ses.*"
  6173. },
  6174. "required": true
  6175. }
  6176. ],
  6177. "responses": {
  6178. "200": {
  6179. "description": "Summarized session",
  6180. "content": {
  6181. "application/json": {
  6182. "schema": {
  6183. "type": "boolean",
  6184. "description": "Summarized session"
  6185. }
  6186. }
  6187. }
  6188. },
  6189. "400": {
  6190. "description": "Bad request",
  6191. "content": {
  6192. "application/json": {
  6193. "schema": {
  6194. "$ref": "#/components/schemas/BadRequestError"
  6195. }
  6196. }
  6197. }
  6198. },
  6199. "404": {
  6200. "description": "Not found",
  6201. "content": {
  6202. "application/json": {
  6203. "schema": {
  6204. "$ref": "#/components/schemas/NotFoundError"
  6205. }
  6206. }
  6207. }
  6208. }
  6209. },
  6210. "description": "Generate a concise summary of the session using AI compaction to preserve key information.",
  6211. "summary": "Summarize session",
  6212. "requestBody": {
  6213. "content": {
  6214. "application/json": {
  6215. "schema": {
  6216. "type": "object",
  6217. "properties": {
  6218. "providerID": {
  6219. "type": "string"
  6220. },
  6221. "modelID": {
  6222. "type": "string"
  6223. },
  6224. "auto": {
  6225. "type": "boolean"
  6226. }
  6227. },
  6228. "required": ["providerID", "modelID"],
  6229. "additionalProperties": false
  6230. }
  6231. }
  6232. }
  6233. },
  6234. "x-codeSamples": [
  6235. {
  6236. "lang": "js",
  6237. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.summarize({\n ...\n})"
  6238. }
  6239. ]
  6240. }
  6241. },
  6242. "/session/{sessionID}/prompt_async": {
  6243. "post": {
  6244. "tags": ["session"],
  6245. "operationId": "session.prompt_async",
  6246. "parameters": [
  6247. {
  6248. "name": "directory",
  6249. "in": "query",
  6250. "required": false,
  6251. "schema": {
  6252. "type": "string"
  6253. }
  6254. },
  6255. {
  6256. "name": "workspace",
  6257. "in": "query",
  6258. "required": false,
  6259. "schema": {
  6260. "type": "string"
  6261. }
  6262. },
  6263. {
  6264. "name": "sessionID",
  6265. "in": "path",
  6266. "schema": {
  6267. "type": "string",
  6268. "pattern": "^ses.*"
  6269. },
  6270. "required": true
  6271. }
  6272. ],
  6273. "responses": {
  6274. "204": {
  6275. "description": "Prompt accepted"
  6276. },
  6277. "400": {
  6278. "description": "Bad request",
  6279. "content": {
  6280. "application/json": {
  6281. "schema": {
  6282. "$ref": "#/components/schemas/BadRequestError"
  6283. }
  6284. }
  6285. }
  6286. },
  6287. "404": {
  6288. "description": "Not found",
  6289. "content": {
  6290. "application/json": {
  6291. "schema": {
  6292. "$ref": "#/components/schemas/NotFoundError"
  6293. }
  6294. }
  6295. }
  6296. }
  6297. },
  6298. "description": "Create and send a new message to a session asynchronously, starting the session if needed and returning immediately.",
  6299. "summary": "Send async message",
  6300. "requestBody": {
  6301. "content": {
  6302. "application/json": {
  6303. "schema": {
  6304. "type": "object",
  6305. "properties": {
  6306. "messageID": {
  6307. "type": "string"
  6308. },
  6309. "model": {
  6310. "type": "object",
  6311. "properties": {
  6312. "providerID": {
  6313. "type": "string"
  6314. },
  6315. "modelID": {
  6316. "type": "string"
  6317. }
  6318. },
  6319. "required": ["providerID", "modelID"],
  6320. "additionalProperties": false
  6321. },
  6322. "agent": {
  6323. "type": "string"
  6324. },
  6325. "noReply": {
  6326. "type": "boolean"
  6327. },
  6328. "tools": {
  6329. "type": "object",
  6330. "additionalProperties": {
  6331. "type": "boolean"
  6332. }
  6333. },
  6334. "format": {
  6335. "$ref": "#/components/schemas/OutputFormat"
  6336. },
  6337. "system": {
  6338. "type": "string"
  6339. },
  6340. "variant": {
  6341. "type": "string"
  6342. },
  6343. "parts": {
  6344. "type": "array",
  6345. "items": {
  6346. "anyOf": [
  6347. {
  6348. "$ref": "#/components/schemas/TextPartInput"
  6349. },
  6350. {
  6351. "$ref": "#/components/schemas/FilePartInput"
  6352. },
  6353. {
  6354. "$ref": "#/components/schemas/AgentPartInput"
  6355. },
  6356. {
  6357. "$ref": "#/components/schemas/SubtaskPartInput"
  6358. }
  6359. ]
  6360. }
  6361. }
  6362. },
  6363. "required": ["parts"],
  6364. "additionalProperties": false
  6365. }
  6366. }
  6367. }
  6368. },
  6369. "x-codeSamples": [
  6370. {
  6371. "lang": "js",
  6372. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.prompt_async({\n ...\n})"
  6373. }
  6374. ]
  6375. }
  6376. },
  6377. "/session/{sessionID}/command": {
  6378. "post": {
  6379. "tags": ["session"],
  6380. "operationId": "session.command",
  6381. "parameters": [
  6382. {
  6383. "name": "directory",
  6384. "in": "query",
  6385. "required": false,
  6386. "schema": {
  6387. "type": "string"
  6388. }
  6389. },
  6390. {
  6391. "name": "workspace",
  6392. "in": "query",
  6393. "required": false,
  6394. "schema": {
  6395. "type": "string"
  6396. }
  6397. },
  6398. {
  6399. "name": "sessionID",
  6400. "in": "path",
  6401. "schema": {
  6402. "type": "string",
  6403. "pattern": "^ses.*"
  6404. },
  6405. "required": true
  6406. }
  6407. ],
  6408. "responses": {
  6409. "200": {
  6410. "description": "Created message",
  6411. "content": {
  6412. "application/json": {
  6413. "schema": {
  6414. "type": "object",
  6415. "required": ["info", "parts"],
  6416. "properties": {
  6417. "info": {
  6418. "$ref": "#/components/schemas/AssistantMessage"
  6419. },
  6420. "parts": {
  6421. "type": "array",
  6422. "items": {
  6423. "$ref": "#/components/schemas/Part"
  6424. }
  6425. }
  6426. }
  6427. }
  6428. }
  6429. }
  6430. },
  6431. "400": {
  6432. "description": "Bad request",
  6433. "content": {
  6434. "application/json": {
  6435. "schema": {
  6436. "$ref": "#/components/schemas/BadRequestError"
  6437. }
  6438. }
  6439. }
  6440. },
  6441. "404": {
  6442. "description": "Not found",
  6443. "content": {
  6444. "application/json": {
  6445. "schema": {
  6446. "$ref": "#/components/schemas/NotFoundError"
  6447. }
  6448. }
  6449. }
  6450. }
  6451. },
  6452. "description": "Send a new command to a session for execution by the AI assistant.",
  6453. "summary": "Send command",
  6454. "requestBody": {
  6455. "content": {
  6456. "application/json": {
  6457. "schema": {
  6458. "type": "object",
  6459. "properties": {
  6460. "messageID": {
  6461. "type": "string"
  6462. },
  6463. "agent": {
  6464. "type": "string"
  6465. },
  6466. "model": {
  6467. "type": "string"
  6468. },
  6469. "arguments": {
  6470. "type": "string"
  6471. },
  6472. "command": {
  6473. "type": "string"
  6474. },
  6475. "variant": {
  6476. "type": "string"
  6477. },
  6478. "parts": {
  6479. "type": "array",
  6480. "items": {
  6481. "type": "object",
  6482. "properties": {
  6483. "id": {
  6484. "type": "string"
  6485. },
  6486. "type": {
  6487. "type": "string",
  6488. "enum": ["file"]
  6489. },
  6490. "mime": {
  6491. "type": "string"
  6492. },
  6493. "filename": {
  6494. "type": "string"
  6495. },
  6496. "url": {
  6497. "type": "string"
  6498. },
  6499. "source": {
  6500. "$ref": "#/components/schemas/FilePartSource"
  6501. }
  6502. },
  6503. "required": ["type", "mime", "url"],
  6504. "additionalProperties": false
  6505. }
  6506. }
  6507. },
  6508. "required": ["arguments", "command"],
  6509. "additionalProperties": false
  6510. }
  6511. }
  6512. }
  6513. },
  6514. "x-codeSamples": [
  6515. {
  6516. "lang": "js",
  6517. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.command({\n ...\n})"
  6518. }
  6519. ]
  6520. }
  6521. },
  6522. "/session/{sessionID}/shell": {
  6523. "post": {
  6524. "tags": ["session"],
  6525. "operationId": "session.shell",
  6526. "parameters": [
  6527. {
  6528. "name": "directory",
  6529. "in": "query",
  6530. "required": false,
  6531. "schema": {
  6532. "type": "string"
  6533. }
  6534. },
  6535. {
  6536. "name": "workspace",
  6537. "in": "query",
  6538. "required": false,
  6539. "schema": {
  6540. "type": "string"
  6541. }
  6542. },
  6543. {
  6544. "name": "sessionID",
  6545. "in": "path",
  6546. "schema": {
  6547. "type": "string",
  6548. "pattern": "^ses.*"
  6549. },
  6550. "required": true
  6551. }
  6552. ],
  6553. "responses": {
  6554. "200": {
  6555. "description": "Created message",
  6556. "content": {
  6557. "application/json": {
  6558. "schema": {
  6559. "type": "object",
  6560. "properties": {
  6561. "info": {
  6562. "$ref": "#/components/schemas/Message"
  6563. },
  6564. "parts": {
  6565. "type": "array",
  6566. "items": {
  6567. "$ref": "#/components/schemas/Part"
  6568. }
  6569. }
  6570. },
  6571. "required": ["info", "parts"],
  6572. "additionalProperties": false,
  6573. "description": "Created message"
  6574. }
  6575. }
  6576. }
  6577. },
  6578. "400": {
  6579. "description": "Bad request",
  6580. "content": {
  6581. "application/json": {
  6582. "schema": {
  6583. "$ref": "#/components/schemas/BadRequestError"
  6584. }
  6585. }
  6586. }
  6587. },
  6588. "404": {
  6589. "description": "Not found",
  6590. "content": {
  6591. "application/json": {
  6592. "schema": {
  6593. "$ref": "#/components/schemas/NotFoundError"
  6594. }
  6595. }
  6596. }
  6597. }
  6598. },
  6599. "description": "Execute a shell command within the session context and return the AI's response.",
  6600. "summary": "Run shell command",
  6601. "requestBody": {
  6602. "content": {
  6603. "application/json": {
  6604. "schema": {
  6605. "type": "object",
  6606. "properties": {
  6607. "messageID": {
  6608. "type": "string"
  6609. },
  6610. "agent": {
  6611. "type": "string"
  6612. },
  6613. "model": {
  6614. "type": "object",
  6615. "properties": {
  6616. "providerID": {
  6617. "type": "string"
  6618. },
  6619. "modelID": {
  6620. "type": "string"
  6621. }
  6622. },
  6623. "required": ["providerID", "modelID"],
  6624. "additionalProperties": false
  6625. },
  6626. "command": {
  6627. "type": "string"
  6628. }
  6629. },
  6630. "required": ["agent", "command"],
  6631. "additionalProperties": false
  6632. }
  6633. }
  6634. }
  6635. },
  6636. "x-codeSamples": [
  6637. {
  6638. "lang": "js",
  6639. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.shell({\n ...\n})"
  6640. }
  6641. ]
  6642. }
  6643. },
  6644. "/session/{sessionID}/revert": {
  6645. "post": {
  6646. "tags": ["session"],
  6647. "operationId": "session.revert",
  6648. "parameters": [
  6649. {
  6650. "name": "directory",
  6651. "in": "query",
  6652. "required": false,
  6653. "schema": {
  6654. "type": "string"
  6655. }
  6656. },
  6657. {
  6658. "name": "workspace",
  6659. "in": "query",
  6660. "required": false,
  6661. "schema": {
  6662. "type": "string"
  6663. }
  6664. },
  6665. {
  6666. "name": "sessionID",
  6667. "in": "path",
  6668. "schema": {
  6669. "type": "string",
  6670. "pattern": "^ses.*"
  6671. },
  6672. "required": true
  6673. }
  6674. ],
  6675. "responses": {
  6676. "200": {
  6677. "description": "Updated session",
  6678. "content": {
  6679. "application/json": {
  6680. "schema": {
  6681. "$ref": "#/components/schemas/Session"
  6682. }
  6683. }
  6684. }
  6685. },
  6686. "400": {
  6687. "description": "Bad request",
  6688. "content": {
  6689. "application/json": {
  6690. "schema": {
  6691. "$ref": "#/components/schemas/BadRequestError"
  6692. }
  6693. }
  6694. }
  6695. },
  6696. "404": {
  6697. "description": "Not found",
  6698. "content": {
  6699. "application/json": {
  6700. "schema": {
  6701. "$ref": "#/components/schemas/NotFoundError"
  6702. }
  6703. }
  6704. }
  6705. }
  6706. },
  6707. "description": "Revert a specific message in a session, undoing its effects and restoring the previous state.",
  6708. "summary": "Revert message",
  6709. "requestBody": {
  6710. "content": {
  6711. "application/json": {
  6712. "schema": {
  6713. "type": "object",
  6714. "properties": {
  6715. "messageID": {
  6716. "type": "string"
  6717. },
  6718. "partID": {
  6719. "type": "string"
  6720. }
  6721. },
  6722. "required": ["messageID"],
  6723. "additionalProperties": false
  6724. }
  6725. }
  6726. }
  6727. },
  6728. "x-codeSamples": [
  6729. {
  6730. "lang": "js",
  6731. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.revert({\n ...\n})"
  6732. }
  6733. ]
  6734. }
  6735. },
  6736. "/session/{sessionID}/unrevert": {
  6737. "post": {
  6738. "tags": ["session"],
  6739. "operationId": "session.unrevert",
  6740. "parameters": [
  6741. {
  6742. "name": "directory",
  6743. "in": "query",
  6744. "required": false,
  6745. "schema": {
  6746. "type": "string"
  6747. }
  6748. },
  6749. {
  6750. "name": "workspace",
  6751. "in": "query",
  6752. "required": false,
  6753. "schema": {
  6754. "type": "string"
  6755. }
  6756. },
  6757. {
  6758. "name": "sessionID",
  6759. "in": "path",
  6760. "schema": {
  6761. "type": "string",
  6762. "pattern": "^ses.*"
  6763. },
  6764. "required": true
  6765. }
  6766. ],
  6767. "responses": {
  6768. "200": {
  6769. "description": "Updated session",
  6770. "content": {
  6771. "application/json": {
  6772. "schema": {
  6773. "$ref": "#/components/schemas/Session"
  6774. }
  6775. }
  6776. }
  6777. },
  6778. "400": {
  6779. "description": "Bad request",
  6780. "content": {
  6781. "application/json": {
  6782. "schema": {
  6783. "$ref": "#/components/schemas/BadRequestError"
  6784. }
  6785. }
  6786. }
  6787. },
  6788. "404": {
  6789. "description": "Not found",
  6790. "content": {
  6791. "application/json": {
  6792. "schema": {
  6793. "$ref": "#/components/schemas/NotFoundError"
  6794. }
  6795. }
  6796. }
  6797. }
  6798. },
  6799. "description": "Restore all previously reverted messages in a session.",
  6800. "summary": "Restore reverted messages",
  6801. "x-codeSamples": [
  6802. {
  6803. "lang": "js",
  6804. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.unrevert({\n ...\n})"
  6805. }
  6806. ]
  6807. }
  6808. },
  6809. "/session/{sessionID}/permissions/{permissionID}": {
  6810. "post": {
  6811. "tags": ["session"],
  6812. "operationId": "permission.respond",
  6813. "parameters": [
  6814. {
  6815. "name": "directory",
  6816. "in": "query",
  6817. "required": false,
  6818. "schema": {
  6819. "type": "string"
  6820. }
  6821. },
  6822. {
  6823. "name": "workspace",
  6824. "in": "query",
  6825. "required": false,
  6826. "schema": {
  6827. "type": "string"
  6828. }
  6829. },
  6830. {
  6831. "name": "sessionID",
  6832. "in": "path",
  6833. "schema": {
  6834. "type": "string",
  6835. "pattern": "^ses.*"
  6836. },
  6837. "required": true
  6838. },
  6839. {
  6840. "name": "permissionID",
  6841. "in": "path",
  6842. "schema": {
  6843. "type": "string",
  6844. "pattern": "^per.*"
  6845. },
  6846. "required": true
  6847. }
  6848. ],
  6849. "responses": {
  6850. "200": {
  6851. "description": "Permission processed successfully",
  6852. "content": {
  6853. "application/json": {
  6854. "schema": {
  6855. "type": "boolean",
  6856. "description": "Permission processed successfully"
  6857. }
  6858. }
  6859. }
  6860. },
  6861. "400": {
  6862. "description": "Bad request",
  6863. "content": {
  6864. "application/json": {
  6865. "schema": {
  6866. "$ref": "#/components/schemas/BadRequestError"
  6867. }
  6868. }
  6869. }
  6870. },
  6871. "404": {
  6872. "description": "Not found",
  6873. "content": {
  6874. "application/json": {
  6875. "schema": {
  6876. "$ref": "#/components/schemas/NotFoundError"
  6877. }
  6878. }
  6879. }
  6880. }
  6881. },
  6882. "description": "Approve or deny a permission request from the AI assistant.",
  6883. "summary": "Respond to permission",
  6884. "deprecated": true,
  6885. "requestBody": {
  6886. "content": {
  6887. "application/json": {
  6888. "schema": {
  6889. "type": "object",
  6890. "properties": {
  6891. "response": {
  6892. "type": "string",
  6893. "enum": ["once", "always", "reject"]
  6894. }
  6895. },
  6896. "required": ["response"],
  6897. "additionalProperties": false
  6898. }
  6899. }
  6900. }
  6901. },
  6902. "x-codeSamples": [
  6903. {
  6904. "lang": "js",
  6905. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.permission.respond({\n ...\n})"
  6906. }
  6907. ]
  6908. }
  6909. },
  6910. "/session/{sessionID}/message/{messageID}/part/{partID}": {
  6911. "delete": {
  6912. "tags": ["session"],
  6913. "operationId": "part.delete",
  6914. "parameters": [
  6915. {
  6916. "name": "directory",
  6917. "in": "query",
  6918. "required": false,
  6919. "schema": {
  6920. "type": "string"
  6921. }
  6922. },
  6923. {
  6924. "name": "workspace",
  6925. "in": "query",
  6926. "required": false,
  6927. "schema": {
  6928. "type": "string"
  6929. }
  6930. },
  6931. {
  6932. "name": "sessionID",
  6933. "in": "path",
  6934. "schema": {
  6935. "type": "string",
  6936. "pattern": "^ses.*"
  6937. },
  6938. "required": true
  6939. },
  6940. {
  6941. "name": "messageID",
  6942. "in": "path",
  6943. "schema": {
  6944. "type": "string",
  6945. "pattern": "^msg.*"
  6946. },
  6947. "required": true
  6948. },
  6949. {
  6950. "name": "partID",
  6951. "in": "path",
  6952. "schema": {
  6953. "type": "string",
  6954. "pattern": "^prt.*"
  6955. },
  6956. "required": true
  6957. }
  6958. ],
  6959. "responses": {
  6960. "200": {
  6961. "description": "Successfully deleted part",
  6962. "content": {
  6963. "application/json": {
  6964. "schema": {
  6965. "type": "boolean",
  6966. "description": "Successfully deleted part"
  6967. }
  6968. }
  6969. }
  6970. },
  6971. "400": {
  6972. "description": "Bad request",
  6973. "content": {
  6974. "application/json": {
  6975. "schema": {
  6976. "$ref": "#/components/schemas/BadRequestError"
  6977. }
  6978. }
  6979. }
  6980. },
  6981. "404": {
  6982. "description": "Not found",
  6983. "content": {
  6984. "application/json": {
  6985. "schema": {
  6986. "$ref": "#/components/schemas/NotFoundError"
  6987. }
  6988. }
  6989. }
  6990. }
  6991. },
  6992. "description": "Delete a part from a message.",
  6993. "x-codeSamples": [
  6994. {
  6995. "lang": "js",
  6996. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.part.delete({\n ...\n})"
  6997. }
  6998. ]
  6999. },
  7000. "patch": {
  7001. "tags": ["session"],
  7002. "operationId": "part.update",
  7003. "parameters": [
  7004. {
  7005. "name": "directory",
  7006. "in": "query",
  7007. "required": false,
  7008. "schema": {
  7009. "type": "string"
  7010. }
  7011. },
  7012. {
  7013. "name": "workspace",
  7014. "in": "query",
  7015. "required": false,
  7016. "schema": {
  7017. "type": "string"
  7018. }
  7019. },
  7020. {
  7021. "name": "sessionID",
  7022. "in": "path",
  7023. "schema": {
  7024. "type": "string",
  7025. "pattern": "^ses.*"
  7026. },
  7027. "required": true
  7028. },
  7029. {
  7030. "name": "messageID",
  7031. "in": "path",
  7032. "schema": {
  7033. "type": "string",
  7034. "pattern": "^msg.*"
  7035. },
  7036. "required": true
  7037. },
  7038. {
  7039. "name": "partID",
  7040. "in": "path",
  7041. "schema": {
  7042. "type": "string",
  7043. "pattern": "^prt.*"
  7044. },
  7045. "required": true
  7046. }
  7047. ],
  7048. "responses": {
  7049. "200": {
  7050. "description": "Successfully updated part",
  7051. "content": {
  7052. "application/json": {
  7053. "schema": {
  7054. "$ref": "#/components/schemas/Part"
  7055. }
  7056. }
  7057. }
  7058. },
  7059. "400": {
  7060. "description": "Bad request",
  7061. "content": {
  7062. "application/json": {
  7063. "schema": {
  7064. "$ref": "#/components/schemas/BadRequestError"
  7065. }
  7066. }
  7067. }
  7068. },
  7069. "404": {
  7070. "description": "Not found",
  7071. "content": {
  7072. "application/json": {
  7073. "schema": {
  7074. "$ref": "#/components/schemas/NotFoundError"
  7075. }
  7076. }
  7077. }
  7078. }
  7079. },
  7080. "description": "Update a part in a message.",
  7081. "requestBody": {
  7082. "content": {
  7083. "application/json": {
  7084. "schema": {
  7085. "$ref": "#/components/schemas/Part"
  7086. }
  7087. }
  7088. }
  7089. },
  7090. "x-codeSamples": [
  7091. {
  7092. "lang": "js",
  7093. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.part.update({\n ...\n})"
  7094. }
  7095. ]
  7096. }
  7097. },
  7098. "/sync/start": {
  7099. "post": {
  7100. "tags": ["sync"],
  7101. "operationId": "sync.start",
  7102. "parameters": [
  7103. {
  7104. "name": "directory",
  7105. "in": "query",
  7106. "required": false,
  7107. "schema": {
  7108. "type": "string"
  7109. }
  7110. },
  7111. {
  7112. "name": "workspace",
  7113. "in": "query",
  7114. "required": false,
  7115. "schema": {
  7116. "type": "string"
  7117. }
  7118. }
  7119. ],
  7120. "responses": {
  7121. "200": {
  7122. "description": "Workspace sync started",
  7123. "content": {
  7124. "application/json": {
  7125. "schema": {
  7126. "type": "boolean",
  7127. "description": "Workspace sync started"
  7128. }
  7129. }
  7130. }
  7131. },
  7132. "400": {
  7133. "description": "Bad request",
  7134. "content": {
  7135. "application/json": {
  7136. "schema": {
  7137. "$ref": "#/components/schemas/BadRequestError"
  7138. }
  7139. }
  7140. }
  7141. }
  7142. },
  7143. "description": "Start sync loops for workspaces in the current project that have active sessions.",
  7144. "summary": "Start workspace sync",
  7145. "x-codeSamples": [
  7146. {
  7147. "lang": "js",
  7148. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.sync.start({\n ...\n})"
  7149. }
  7150. ]
  7151. }
  7152. },
  7153. "/sync/replay": {
  7154. "post": {
  7155. "tags": ["sync"],
  7156. "operationId": "sync.replay",
  7157. "parameters": [
  7158. {
  7159. "name": "directory",
  7160. "in": "query",
  7161. "required": false,
  7162. "schema": {
  7163. "type": "string"
  7164. }
  7165. },
  7166. {
  7167. "name": "workspace",
  7168. "in": "query",
  7169. "required": false,
  7170. "schema": {
  7171. "type": "string"
  7172. }
  7173. }
  7174. ],
  7175. "responses": {
  7176. "200": {
  7177. "description": "Replayed sync events",
  7178. "content": {
  7179. "application/json": {
  7180. "schema": {
  7181. "type": "object",
  7182. "properties": {
  7183. "sessionID": {
  7184. "type": "string"
  7185. }
  7186. },
  7187. "required": ["sessionID"],
  7188. "additionalProperties": false,
  7189. "description": "Replayed sync events"
  7190. }
  7191. }
  7192. }
  7193. },
  7194. "400": {
  7195. "description": "Bad request",
  7196. "content": {
  7197. "application/json": {
  7198. "schema": {
  7199. "$ref": "#/components/schemas/BadRequestError"
  7200. }
  7201. }
  7202. }
  7203. }
  7204. },
  7205. "description": "Validate and replay a complete sync event history.",
  7206. "summary": "Replay sync events",
  7207. "requestBody": {
  7208. "content": {
  7209. "application/json": {
  7210. "schema": {
  7211. "type": "object",
  7212. "properties": {
  7213. "directory": {
  7214. "type": "string"
  7215. },
  7216. "events": {
  7217. "type": "array",
  7218. "minItems": 1,
  7219. "items": {
  7220. "type": "object",
  7221. "properties": {
  7222. "id": {
  7223. "type": "string"
  7224. },
  7225. "aggregateID": {
  7226. "type": "string"
  7227. },
  7228. "seq": {
  7229. "type": "integer",
  7230. "minimum": 0
  7231. },
  7232. "type": {
  7233. "type": "string"
  7234. },
  7235. "data": {
  7236. "type": "object"
  7237. }
  7238. },
  7239. "required": ["id", "aggregateID", "seq", "type", "data"],
  7240. "additionalProperties": false
  7241. }
  7242. }
  7243. },
  7244. "required": ["directory", "events"],
  7245. "additionalProperties": false
  7246. }
  7247. }
  7248. }
  7249. },
  7250. "x-codeSamples": [
  7251. {
  7252. "lang": "js",
  7253. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.sync.replay({\n ...\n})"
  7254. }
  7255. ]
  7256. }
  7257. },
  7258. "/sync/steal": {
  7259. "post": {
  7260. "tags": ["sync"],
  7261. "operationId": "sync.steal",
  7262. "parameters": [
  7263. {
  7264. "name": "directory",
  7265. "in": "query",
  7266. "required": false,
  7267. "schema": {
  7268. "type": "string"
  7269. }
  7270. },
  7271. {
  7272. "name": "workspace",
  7273. "in": "query",
  7274. "required": false,
  7275. "schema": {
  7276. "type": "string"
  7277. }
  7278. }
  7279. ],
  7280. "responses": {
  7281. "200": {
  7282. "description": "Session stolen into workspace",
  7283. "content": {
  7284. "application/json": {
  7285. "schema": {
  7286. "type": "object",
  7287. "properties": {
  7288. "sessionID": {
  7289. "type": "string"
  7290. }
  7291. },
  7292. "required": ["sessionID"],
  7293. "additionalProperties": false,
  7294. "description": "Session stolen into workspace"
  7295. }
  7296. }
  7297. }
  7298. },
  7299. "400": {
  7300. "description": "Bad request",
  7301. "content": {
  7302. "application/json": {
  7303. "schema": {
  7304. "$ref": "#/components/schemas/BadRequestError"
  7305. }
  7306. }
  7307. }
  7308. }
  7309. },
  7310. "description": "Update a session to belong to the current workspace through the sync event system.",
  7311. "summary": "Steal session into workspace",
  7312. "requestBody": {
  7313. "content": {
  7314. "application/json": {
  7315. "schema": {
  7316. "type": "object",
  7317. "properties": {
  7318. "sessionID": {
  7319. "type": "string"
  7320. }
  7321. },
  7322. "required": ["sessionID"],
  7323. "additionalProperties": false
  7324. }
  7325. }
  7326. }
  7327. },
  7328. "x-codeSamples": [
  7329. {
  7330. "lang": "js",
  7331. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.sync.steal({\n ...\n})"
  7332. }
  7333. ]
  7334. }
  7335. },
  7336. "/sync/history": {
  7337. "post": {
  7338. "tags": ["sync"],
  7339. "operationId": "sync.history.list",
  7340. "parameters": [
  7341. {
  7342. "name": "directory",
  7343. "in": "query",
  7344. "required": false,
  7345. "schema": {
  7346. "type": "string"
  7347. }
  7348. },
  7349. {
  7350. "name": "workspace",
  7351. "in": "query",
  7352. "required": false,
  7353. "schema": {
  7354. "type": "string"
  7355. }
  7356. }
  7357. ],
  7358. "responses": {
  7359. "200": {
  7360. "description": "Sync events",
  7361. "content": {
  7362. "application/json": {
  7363. "schema": {
  7364. "type": "array",
  7365. "items": {
  7366. "type": "object",
  7367. "properties": {
  7368. "id": {
  7369. "type": "string"
  7370. },
  7371. "aggregate_id": {
  7372. "type": "string"
  7373. },
  7374. "seq": {
  7375. "type": "integer",
  7376. "minimum": 0
  7377. },
  7378. "type": {
  7379. "type": "string"
  7380. },
  7381. "data": {
  7382. "type": "object"
  7383. }
  7384. },
  7385. "required": ["id", "aggregate_id", "seq", "type", "data"],
  7386. "additionalProperties": false
  7387. },
  7388. "description": "Sync events"
  7389. }
  7390. }
  7391. }
  7392. },
  7393. "400": {
  7394. "description": "Bad request",
  7395. "content": {
  7396. "application/json": {
  7397. "schema": {
  7398. "$ref": "#/components/schemas/BadRequestError"
  7399. }
  7400. }
  7401. }
  7402. }
  7403. },
  7404. "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.",
  7405. "summary": "List sync events",
  7406. "requestBody": {
  7407. "content": {
  7408. "application/json": {
  7409. "schema": {
  7410. "type": "object",
  7411. "additionalProperties": {
  7412. "type": "integer",
  7413. "minimum": 0
  7414. }
  7415. }
  7416. }
  7417. }
  7418. },
  7419. "x-codeSamples": [
  7420. {
  7421. "lang": "js",
  7422. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.sync.history.list({\n ...\n})"
  7423. }
  7424. ]
  7425. }
  7426. },
  7427. "/api/session": {
  7428. "get": {
  7429. "tags": ["v2"],
  7430. "operationId": "v2.session.list",
  7431. "parameters": [
  7432. {
  7433. "name": "directory",
  7434. "in": "query",
  7435. "required": false,
  7436. "schema": {
  7437. "type": "string"
  7438. }
  7439. },
  7440. {
  7441. "name": "workspace",
  7442. "in": "query",
  7443. "required": false,
  7444. "schema": {
  7445. "type": "string"
  7446. }
  7447. }
  7448. ],
  7449. "responses": {
  7450. "200": {
  7451. "description": "V2SessionsResponse",
  7452. "content": {
  7453. "application/json": {
  7454. "schema": {
  7455. "$ref": "#/components/schemas/V2SessionsResponse"
  7456. }
  7457. }
  7458. }
  7459. },
  7460. "400": {
  7461. "description": "Bad request",
  7462. "content": {
  7463. "application/json": {
  7464. "schema": {
  7465. "$ref": "#/components/schemas/BadRequestError"
  7466. }
  7467. }
  7468. }
  7469. }
  7470. },
  7471. "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.",
  7472. "summary": "List v2 sessions",
  7473. "x-codeSamples": [
  7474. {
  7475. "lang": "js",
  7476. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.list({\n ...\n})"
  7477. }
  7478. ]
  7479. }
  7480. },
  7481. "/api/session/{sessionID}/prompt": {
  7482. "post": {
  7483. "tags": ["v2"],
  7484. "operationId": "v2.session.prompt",
  7485. "parameters": [
  7486. {
  7487. "name": "directory",
  7488. "in": "query",
  7489. "required": false,
  7490. "schema": {
  7491. "type": "string"
  7492. }
  7493. },
  7494. {
  7495. "name": "workspace",
  7496. "in": "query",
  7497. "required": false,
  7498. "schema": {
  7499. "type": "string"
  7500. }
  7501. },
  7502. {
  7503. "name": "sessionID",
  7504. "in": "path",
  7505. "schema": {
  7506. "type": "string",
  7507. "pattern": "^ses.*"
  7508. },
  7509. "required": true
  7510. }
  7511. ],
  7512. "responses": {
  7513. "200": {
  7514. "description": "Session.Message",
  7515. "content": {
  7516. "application/json": {
  7517. "schema": {
  7518. "$ref": "#/components/schemas/SessionMessage"
  7519. }
  7520. }
  7521. }
  7522. },
  7523. "400": {
  7524. "description": "Bad request",
  7525. "content": {
  7526. "application/json": {
  7527. "schema": {
  7528. "$ref": "#/components/schemas/BadRequestError"
  7529. }
  7530. }
  7531. }
  7532. }
  7533. },
  7534. "description": "Create a v2 session message and queue it for the agent loop.",
  7535. "summary": "Send v2 message",
  7536. "requestBody": {
  7537. "content": {
  7538. "application/json": {
  7539. "schema": {
  7540. "type": "object",
  7541. "properties": {
  7542. "prompt": {
  7543. "$ref": "#/components/schemas/Prompt"
  7544. },
  7545. "delivery": {
  7546. "$ref": "#/components/schemas/SessionDelivery"
  7547. }
  7548. },
  7549. "required": ["prompt"],
  7550. "additionalProperties": false
  7551. }
  7552. }
  7553. }
  7554. },
  7555. "x-codeSamples": [
  7556. {
  7557. "lang": "js",
  7558. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.prompt({\n ...\n})"
  7559. }
  7560. ]
  7561. }
  7562. },
  7563. "/api/session/{sessionID}/compact": {
  7564. "post": {
  7565. "tags": ["v2"],
  7566. "operationId": "v2.session.compact",
  7567. "parameters": [
  7568. {
  7569. "name": "directory",
  7570. "in": "query",
  7571. "required": false,
  7572. "schema": {
  7573. "type": "string"
  7574. }
  7575. },
  7576. {
  7577. "name": "workspace",
  7578. "in": "query",
  7579. "required": false,
  7580. "schema": {
  7581. "type": "string"
  7582. }
  7583. },
  7584. {
  7585. "name": "sessionID",
  7586. "in": "path",
  7587. "schema": {
  7588. "type": "string",
  7589. "pattern": "^ses.*"
  7590. },
  7591. "required": true
  7592. }
  7593. ],
  7594. "responses": {
  7595. "204": {
  7596. "description": "<No Content>"
  7597. },
  7598. "400": {
  7599. "description": "Bad request",
  7600. "content": {
  7601. "application/json": {
  7602. "schema": {
  7603. "$ref": "#/components/schemas/BadRequestError"
  7604. }
  7605. }
  7606. }
  7607. }
  7608. },
  7609. "description": "Compact a v2 session conversation.",
  7610. "summary": "Compact v2 session",
  7611. "x-codeSamples": [
  7612. {
  7613. "lang": "js",
  7614. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.compact({\n ...\n})"
  7615. }
  7616. ]
  7617. }
  7618. },
  7619. "/api/session/{sessionID}/wait": {
  7620. "post": {
  7621. "tags": ["v2"],
  7622. "operationId": "v2.session.wait",
  7623. "parameters": [
  7624. {
  7625. "name": "directory",
  7626. "in": "query",
  7627. "required": false,
  7628. "schema": {
  7629. "type": "string"
  7630. }
  7631. },
  7632. {
  7633. "name": "workspace",
  7634. "in": "query",
  7635. "required": false,
  7636. "schema": {
  7637. "type": "string"
  7638. }
  7639. },
  7640. {
  7641. "name": "sessionID",
  7642. "in": "path",
  7643. "schema": {
  7644. "type": "string",
  7645. "pattern": "^ses.*"
  7646. },
  7647. "required": true
  7648. }
  7649. ],
  7650. "responses": {
  7651. "204": {
  7652. "description": "<No Content>"
  7653. },
  7654. "400": {
  7655. "description": "Bad request",
  7656. "content": {
  7657. "application/json": {
  7658. "schema": {
  7659. "$ref": "#/components/schemas/BadRequestError"
  7660. }
  7661. }
  7662. }
  7663. }
  7664. },
  7665. "description": "Wait for a v2 session agent loop to become idle.",
  7666. "summary": "Wait for v2 session",
  7667. "x-codeSamples": [
  7668. {
  7669. "lang": "js",
  7670. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.wait({\n ...\n})"
  7671. }
  7672. ]
  7673. }
  7674. },
  7675. "/api/session/{sessionID}/context": {
  7676. "get": {
  7677. "tags": ["v2"],
  7678. "operationId": "v2.session.context",
  7679. "parameters": [
  7680. {
  7681. "name": "directory",
  7682. "in": "query",
  7683. "required": false,
  7684. "schema": {
  7685. "type": "string"
  7686. }
  7687. },
  7688. {
  7689. "name": "workspace",
  7690. "in": "query",
  7691. "required": false,
  7692. "schema": {
  7693. "type": "string"
  7694. }
  7695. },
  7696. {
  7697. "name": "sessionID",
  7698. "in": "path",
  7699. "schema": {
  7700. "type": "string",
  7701. "pattern": "^ses.*"
  7702. },
  7703. "required": true
  7704. }
  7705. ],
  7706. "responses": {
  7707. "200": {
  7708. "description": "Success",
  7709. "content": {
  7710. "application/json": {
  7711. "schema": {
  7712. "type": "array",
  7713. "items": {
  7714. "$ref": "#/components/schemas/SessionMessage"
  7715. }
  7716. }
  7717. }
  7718. }
  7719. },
  7720. "400": {
  7721. "description": "Bad request",
  7722. "content": {
  7723. "application/json": {
  7724. "schema": {
  7725. "$ref": "#/components/schemas/BadRequestError"
  7726. }
  7727. }
  7728. }
  7729. }
  7730. },
  7731. "description": "Retrieve the active context messages for a v2 session (all messages after the last compaction).",
  7732. "summary": "Get v2 session context",
  7733. "x-codeSamples": [
  7734. {
  7735. "lang": "js",
  7736. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.context({\n ...\n})"
  7737. }
  7738. ]
  7739. }
  7740. },
  7741. "/api/session/{sessionID}/message": {
  7742. "get": {
  7743. "tags": ["v2 messages"],
  7744. "operationId": "v2.session.messages",
  7745. "parameters": [
  7746. {
  7747. "name": "directory",
  7748. "in": "query",
  7749. "required": false,
  7750. "schema": {
  7751. "type": "string"
  7752. }
  7753. },
  7754. {
  7755. "name": "workspace",
  7756. "in": "query",
  7757. "required": false,
  7758. "schema": {
  7759. "type": "string"
  7760. }
  7761. },
  7762. {
  7763. "name": "sessionID",
  7764. "in": "path",
  7765. "schema": {
  7766. "type": "string",
  7767. "pattern": "^ses.*"
  7768. },
  7769. "required": true
  7770. }
  7771. ],
  7772. "responses": {
  7773. "200": {
  7774. "description": "V2SessionMessagesResponse",
  7775. "content": {
  7776. "application/json": {
  7777. "schema": {
  7778. "$ref": "#/components/schemas/V2SessionMessagesResponse"
  7779. }
  7780. }
  7781. }
  7782. },
  7783. "400": {
  7784. "description": "Bad request",
  7785. "content": {
  7786. "application/json": {
  7787. "schema": {
  7788. "$ref": "#/components/schemas/BadRequestError"
  7789. }
  7790. }
  7791. }
  7792. }
  7793. },
  7794. "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.",
  7795. "summary": "Get v2 session messages",
  7796. "x-codeSamples": [
  7797. {
  7798. "lang": "js",
  7799. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.messages({\n ...\n})"
  7800. }
  7801. ]
  7802. }
  7803. },
  7804. "/tui/append-prompt": {
  7805. "post": {
  7806. "tags": ["tui"],
  7807. "operationId": "tui.appendPrompt",
  7808. "parameters": [
  7809. {
  7810. "name": "directory",
  7811. "in": "query",
  7812. "required": false,
  7813. "schema": {
  7814. "type": "string"
  7815. }
  7816. },
  7817. {
  7818. "name": "workspace",
  7819. "in": "query",
  7820. "required": false,
  7821. "schema": {
  7822. "type": "string"
  7823. }
  7824. }
  7825. ],
  7826. "responses": {
  7827. "200": {
  7828. "description": "Prompt processed successfully",
  7829. "content": {
  7830. "application/json": {
  7831. "schema": {
  7832. "type": "boolean",
  7833. "description": "Prompt processed successfully"
  7834. }
  7835. }
  7836. }
  7837. },
  7838. "400": {
  7839. "description": "Bad request",
  7840. "content": {
  7841. "application/json": {
  7842. "schema": {
  7843. "$ref": "#/components/schemas/BadRequestError"
  7844. }
  7845. }
  7846. }
  7847. }
  7848. },
  7849. "description": "Append prompt to the TUI.",
  7850. "summary": "Append TUI prompt",
  7851. "requestBody": {
  7852. "content": {
  7853. "application/json": {
  7854. "schema": {
  7855. "type": "object",
  7856. "properties": {
  7857. "text": {
  7858. "type": "string"
  7859. }
  7860. },
  7861. "required": ["text"],
  7862. "additionalProperties": false
  7863. }
  7864. }
  7865. }
  7866. },
  7867. "x-codeSamples": [
  7868. {
  7869. "lang": "js",
  7870. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.appendPrompt({\n ...\n})"
  7871. }
  7872. ]
  7873. }
  7874. },
  7875. "/tui/open-help": {
  7876. "post": {
  7877. "tags": ["tui"],
  7878. "operationId": "tui.openHelp",
  7879. "parameters": [
  7880. {
  7881. "name": "directory",
  7882. "in": "query",
  7883. "required": false,
  7884. "schema": {
  7885. "type": "string"
  7886. }
  7887. },
  7888. {
  7889. "name": "workspace",
  7890. "in": "query",
  7891. "required": false,
  7892. "schema": {
  7893. "type": "string"
  7894. }
  7895. }
  7896. ],
  7897. "responses": {
  7898. "200": {
  7899. "description": "Help dialog opened successfully",
  7900. "content": {
  7901. "application/json": {
  7902. "schema": {
  7903. "type": "boolean",
  7904. "description": "Help dialog opened successfully"
  7905. }
  7906. }
  7907. }
  7908. },
  7909. "400": {
  7910. "description": "Bad request",
  7911. "content": {
  7912. "application/json": {
  7913. "schema": {
  7914. "$ref": "#/components/schemas/BadRequestError"
  7915. }
  7916. }
  7917. }
  7918. }
  7919. },
  7920. "description": "Open the help dialog in the TUI to display user assistance information.",
  7921. "summary": "Open help dialog",
  7922. "x-codeSamples": [
  7923. {
  7924. "lang": "js",
  7925. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openHelp({\n ...\n})"
  7926. }
  7927. ]
  7928. }
  7929. },
  7930. "/tui/open-sessions": {
  7931. "post": {
  7932. "tags": ["tui"],
  7933. "operationId": "tui.openSessions",
  7934. "parameters": [
  7935. {
  7936. "name": "directory",
  7937. "in": "query",
  7938. "required": false,
  7939. "schema": {
  7940. "type": "string"
  7941. }
  7942. },
  7943. {
  7944. "name": "workspace",
  7945. "in": "query",
  7946. "required": false,
  7947. "schema": {
  7948. "type": "string"
  7949. }
  7950. }
  7951. ],
  7952. "responses": {
  7953. "200": {
  7954. "description": "Session dialog opened successfully",
  7955. "content": {
  7956. "application/json": {
  7957. "schema": {
  7958. "type": "boolean",
  7959. "description": "Session dialog opened successfully"
  7960. }
  7961. }
  7962. }
  7963. },
  7964. "400": {
  7965. "description": "Bad request",
  7966. "content": {
  7967. "application/json": {
  7968. "schema": {
  7969. "$ref": "#/components/schemas/BadRequestError"
  7970. }
  7971. }
  7972. }
  7973. }
  7974. },
  7975. "description": "Open the session dialog.",
  7976. "summary": "Open sessions dialog",
  7977. "x-codeSamples": [
  7978. {
  7979. "lang": "js",
  7980. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openSessions({\n ...\n})"
  7981. }
  7982. ]
  7983. }
  7984. },
  7985. "/tui/open-themes": {
  7986. "post": {
  7987. "tags": ["tui"],
  7988. "operationId": "tui.openThemes",
  7989. "parameters": [
  7990. {
  7991. "name": "directory",
  7992. "in": "query",
  7993. "required": false,
  7994. "schema": {
  7995. "type": "string"
  7996. }
  7997. },
  7998. {
  7999. "name": "workspace",
  8000. "in": "query",
  8001. "required": false,
  8002. "schema": {
  8003. "type": "string"
  8004. }
  8005. }
  8006. ],
  8007. "responses": {
  8008. "200": {
  8009. "description": "Theme dialog opened successfully",
  8010. "content": {
  8011. "application/json": {
  8012. "schema": {
  8013. "type": "boolean",
  8014. "description": "Theme dialog opened successfully"
  8015. }
  8016. }
  8017. }
  8018. },
  8019. "400": {
  8020. "description": "Bad request",
  8021. "content": {
  8022. "application/json": {
  8023. "schema": {
  8024. "$ref": "#/components/schemas/BadRequestError"
  8025. }
  8026. }
  8027. }
  8028. }
  8029. },
  8030. "description": "Open the theme dialog.",
  8031. "summary": "Open themes dialog",
  8032. "x-codeSamples": [
  8033. {
  8034. "lang": "js",
  8035. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openThemes({\n ...\n})"
  8036. }
  8037. ]
  8038. }
  8039. },
  8040. "/tui/open-models": {
  8041. "post": {
  8042. "tags": ["tui"],
  8043. "operationId": "tui.openModels",
  8044. "parameters": [
  8045. {
  8046. "name": "directory",
  8047. "in": "query",
  8048. "required": false,
  8049. "schema": {
  8050. "type": "string"
  8051. }
  8052. },
  8053. {
  8054. "name": "workspace",
  8055. "in": "query",
  8056. "required": false,
  8057. "schema": {
  8058. "type": "string"
  8059. }
  8060. }
  8061. ],
  8062. "responses": {
  8063. "200": {
  8064. "description": "Model dialog opened successfully",
  8065. "content": {
  8066. "application/json": {
  8067. "schema": {
  8068. "type": "boolean",
  8069. "description": "Model dialog opened successfully"
  8070. }
  8071. }
  8072. }
  8073. },
  8074. "400": {
  8075. "description": "Bad request",
  8076. "content": {
  8077. "application/json": {
  8078. "schema": {
  8079. "$ref": "#/components/schemas/BadRequestError"
  8080. }
  8081. }
  8082. }
  8083. }
  8084. },
  8085. "description": "Open the model dialog.",
  8086. "summary": "Open models dialog",
  8087. "x-codeSamples": [
  8088. {
  8089. "lang": "js",
  8090. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openModels({\n ...\n})"
  8091. }
  8092. ]
  8093. }
  8094. },
  8095. "/tui/submit-prompt": {
  8096. "post": {
  8097. "tags": ["tui"],
  8098. "operationId": "tui.submitPrompt",
  8099. "parameters": [
  8100. {
  8101. "name": "directory",
  8102. "in": "query",
  8103. "required": false,
  8104. "schema": {
  8105. "type": "string"
  8106. }
  8107. },
  8108. {
  8109. "name": "workspace",
  8110. "in": "query",
  8111. "required": false,
  8112. "schema": {
  8113. "type": "string"
  8114. }
  8115. }
  8116. ],
  8117. "responses": {
  8118. "200": {
  8119. "description": "Prompt submitted successfully",
  8120. "content": {
  8121. "application/json": {
  8122. "schema": {
  8123. "type": "boolean",
  8124. "description": "Prompt submitted successfully"
  8125. }
  8126. }
  8127. }
  8128. },
  8129. "400": {
  8130. "description": "Bad request",
  8131. "content": {
  8132. "application/json": {
  8133. "schema": {
  8134. "$ref": "#/components/schemas/BadRequestError"
  8135. }
  8136. }
  8137. }
  8138. }
  8139. },
  8140. "description": "Submit the prompt.",
  8141. "summary": "Submit TUI prompt",
  8142. "x-codeSamples": [
  8143. {
  8144. "lang": "js",
  8145. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.submitPrompt({\n ...\n})"
  8146. }
  8147. ]
  8148. }
  8149. },
  8150. "/tui/clear-prompt": {
  8151. "post": {
  8152. "tags": ["tui"],
  8153. "operationId": "tui.clearPrompt",
  8154. "parameters": [
  8155. {
  8156. "name": "directory",
  8157. "in": "query",
  8158. "required": false,
  8159. "schema": {
  8160. "type": "string"
  8161. }
  8162. },
  8163. {
  8164. "name": "workspace",
  8165. "in": "query",
  8166. "required": false,
  8167. "schema": {
  8168. "type": "string"
  8169. }
  8170. }
  8171. ],
  8172. "responses": {
  8173. "200": {
  8174. "description": "Prompt cleared successfully",
  8175. "content": {
  8176. "application/json": {
  8177. "schema": {
  8178. "type": "boolean",
  8179. "description": "Prompt cleared successfully"
  8180. }
  8181. }
  8182. }
  8183. },
  8184. "400": {
  8185. "description": "Bad request",
  8186. "content": {
  8187. "application/json": {
  8188. "schema": {
  8189. "$ref": "#/components/schemas/BadRequestError"
  8190. }
  8191. }
  8192. }
  8193. }
  8194. },
  8195. "description": "Clear the prompt.",
  8196. "summary": "Clear TUI prompt",
  8197. "x-codeSamples": [
  8198. {
  8199. "lang": "js",
  8200. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.clearPrompt({\n ...\n})"
  8201. }
  8202. ]
  8203. }
  8204. },
  8205. "/tui/execute-command": {
  8206. "post": {
  8207. "tags": ["tui"],
  8208. "operationId": "tui.executeCommand",
  8209. "parameters": [
  8210. {
  8211. "name": "directory",
  8212. "in": "query",
  8213. "required": false,
  8214. "schema": {
  8215. "type": "string"
  8216. }
  8217. },
  8218. {
  8219. "name": "workspace",
  8220. "in": "query",
  8221. "required": false,
  8222. "schema": {
  8223. "type": "string"
  8224. }
  8225. }
  8226. ],
  8227. "responses": {
  8228. "200": {
  8229. "description": "Command executed successfully",
  8230. "content": {
  8231. "application/json": {
  8232. "schema": {
  8233. "type": "boolean",
  8234. "description": "Command executed successfully"
  8235. }
  8236. }
  8237. }
  8238. },
  8239. "400": {
  8240. "description": "Bad request",
  8241. "content": {
  8242. "application/json": {
  8243. "schema": {
  8244. "$ref": "#/components/schemas/BadRequestError"
  8245. }
  8246. }
  8247. }
  8248. }
  8249. },
  8250. "description": "Execute a TUI command.",
  8251. "summary": "Execute TUI command",
  8252. "requestBody": {
  8253. "content": {
  8254. "application/json": {
  8255. "schema": {
  8256. "type": "object",
  8257. "properties": {
  8258. "command": {
  8259. "type": "string"
  8260. }
  8261. },
  8262. "required": ["command"],
  8263. "additionalProperties": false
  8264. }
  8265. }
  8266. }
  8267. },
  8268. "x-codeSamples": [
  8269. {
  8270. "lang": "js",
  8271. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.executeCommand({\n ...\n})"
  8272. }
  8273. ]
  8274. }
  8275. },
  8276. "/tui/show-toast": {
  8277. "post": {
  8278. "tags": ["tui"],
  8279. "operationId": "tui.showToast",
  8280. "parameters": [
  8281. {
  8282. "name": "directory",
  8283. "in": "query",
  8284. "required": false,
  8285. "schema": {
  8286. "type": "string"
  8287. }
  8288. },
  8289. {
  8290. "name": "workspace",
  8291. "in": "query",
  8292. "required": false,
  8293. "schema": {
  8294. "type": "string"
  8295. }
  8296. }
  8297. ],
  8298. "responses": {
  8299. "200": {
  8300. "description": "Toast notification shown successfully",
  8301. "content": {
  8302. "application/json": {
  8303. "schema": {
  8304. "type": "boolean",
  8305. "description": "Toast notification shown successfully"
  8306. }
  8307. }
  8308. }
  8309. },
  8310. "400": {
  8311. "description": "Bad request",
  8312. "content": {
  8313. "application/json": {
  8314. "schema": {
  8315. "$ref": "#/components/schemas/BadRequestError"
  8316. }
  8317. }
  8318. }
  8319. }
  8320. },
  8321. "description": "Show a toast notification in the TUI.",
  8322. "summary": "Show TUI toast",
  8323. "requestBody": {
  8324. "content": {
  8325. "application/json": {
  8326. "schema": {
  8327. "type": "object",
  8328. "properties": {
  8329. "title": {
  8330. "type": "string"
  8331. },
  8332. "message": {
  8333. "type": "string"
  8334. },
  8335. "variant": {
  8336. "type": "string",
  8337. "enum": ["info", "success", "warning", "error"]
  8338. },
  8339. "duration": {
  8340. "type": "integer",
  8341. "exclusiveMinimum": 0
  8342. }
  8343. },
  8344. "required": ["message", "variant"],
  8345. "additionalProperties": false
  8346. }
  8347. }
  8348. }
  8349. },
  8350. "x-codeSamples": [
  8351. {
  8352. "lang": "js",
  8353. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.showToast({\n ...\n})"
  8354. }
  8355. ]
  8356. }
  8357. },
  8358. "/tui/publish": {
  8359. "post": {
  8360. "tags": ["tui"],
  8361. "operationId": "tui.publish",
  8362. "parameters": [
  8363. {
  8364. "name": "directory",
  8365. "in": "query",
  8366. "required": false,
  8367. "schema": {
  8368. "type": "string"
  8369. }
  8370. },
  8371. {
  8372. "name": "workspace",
  8373. "in": "query",
  8374. "required": false,
  8375. "schema": {
  8376. "type": "string"
  8377. }
  8378. }
  8379. ],
  8380. "responses": {
  8381. "200": {
  8382. "description": "Event published successfully",
  8383. "content": {
  8384. "application/json": {
  8385. "schema": {
  8386. "type": "boolean",
  8387. "description": "Event published successfully"
  8388. }
  8389. }
  8390. }
  8391. },
  8392. "400": {
  8393. "description": "Bad request",
  8394. "content": {
  8395. "application/json": {
  8396. "schema": {
  8397. "$ref": "#/components/schemas/BadRequestError"
  8398. }
  8399. }
  8400. }
  8401. }
  8402. },
  8403. "description": "Publish a TUI event.",
  8404. "summary": "Publish TUI event",
  8405. "requestBody": {
  8406. "content": {
  8407. "application/json": {
  8408. "schema": {
  8409. "anyOf": [
  8410. {
  8411. "$ref": "#/components/schemas/EventTuiPromptAppend"
  8412. },
  8413. {
  8414. "$ref": "#/components/schemas/EventTuiCommandExecute"
  8415. },
  8416. {
  8417. "$ref": "#/components/schemas/EventTuiToastShow"
  8418. },
  8419. {
  8420. "$ref": "#/components/schemas/EventTuiSessionSelect"
  8421. }
  8422. ]
  8423. }
  8424. }
  8425. }
  8426. },
  8427. "x-codeSamples": [
  8428. {
  8429. "lang": "js",
  8430. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.publish({\n ...\n})"
  8431. }
  8432. ]
  8433. }
  8434. },
  8435. "/tui/select-session": {
  8436. "post": {
  8437. "tags": ["tui"],
  8438. "operationId": "tui.selectSession",
  8439. "parameters": [
  8440. {
  8441. "name": "directory",
  8442. "in": "query",
  8443. "required": false,
  8444. "schema": {
  8445. "type": "string"
  8446. }
  8447. },
  8448. {
  8449. "name": "workspace",
  8450. "in": "query",
  8451. "required": false,
  8452. "schema": {
  8453. "type": "string"
  8454. }
  8455. }
  8456. ],
  8457. "responses": {
  8458. "200": {
  8459. "description": "Session selected successfully",
  8460. "content": {
  8461. "application/json": {
  8462. "schema": {
  8463. "type": "boolean",
  8464. "description": "Session selected successfully"
  8465. }
  8466. }
  8467. }
  8468. },
  8469. "400": {
  8470. "description": "Bad request",
  8471. "content": {
  8472. "application/json": {
  8473. "schema": {
  8474. "$ref": "#/components/schemas/BadRequestError"
  8475. }
  8476. }
  8477. }
  8478. },
  8479. "404": {
  8480. "description": "Not found",
  8481. "content": {
  8482. "application/json": {
  8483. "schema": {
  8484. "$ref": "#/components/schemas/NotFoundError"
  8485. }
  8486. }
  8487. }
  8488. }
  8489. },
  8490. "description": "Navigate the TUI to display the specified session.",
  8491. "summary": "Select session",
  8492. "requestBody": {
  8493. "content": {
  8494. "application/json": {
  8495. "schema": {
  8496. "type": "object",
  8497. "properties": {
  8498. "sessionID": {
  8499. "type": "string",
  8500. "description": "Session ID to navigate to"
  8501. }
  8502. },
  8503. "required": ["sessionID"],
  8504. "additionalProperties": false
  8505. }
  8506. }
  8507. }
  8508. },
  8509. "x-codeSamples": [
  8510. {
  8511. "lang": "js",
  8512. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.selectSession({\n ...\n})"
  8513. }
  8514. ]
  8515. }
  8516. },
  8517. "/tui/control/next": {
  8518. "get": {
  8519. "tags": ["tui"],
  8520. "operationId": "tui.control.next",
  8521. "parameters": [
  8522. {
  8523. "name": "directory",
  8524. "in": "query",
  8525. "required": false,
  8526. "schema": {
  8527. "type": "string"
  8528. }
  8529. },
  8530. {
  8531. "name": "workspace",
  8532. "in": "query",
  8533. "required": false,
  8534. "schema": {
  8535. "type": "string"
  8536. }
  8537. }
  8538. ],
  8539. "responses": {
  8540. "200": {
  8541. "description": "Next TUI request",
  8542. "content": {
  8543. "application/json": {
  8544. "schema": {
  8545. "type": "object",
  8546. "properties": {
  8547. "path": {
  8548. "type": "string"
  8549. },
  8550. "body": {}
  8551. },
  8552. "required": ["path", "body"],
  8553. "additionalProperties": false,
  8554. "description": "Next TUI request"
  8555. }
  8556. }
  8557. }
  8558. },
  8559. "400": {
  8560. "description": "Bad request",
  8561. "content": {
  8562. "application/json": {
  8563. "schema": {
  8564. "$ref": "#/components/schemas/BadRequestError"
  8565. }
  8566. }
  8567. }
  8568. }
  8569. },
  8570. "description": "Retrieve the next TUI request from the queue for processing.",
  8571. "summary": "Get next TUI request",
  8572. "x-codeSamples": [
  8573. {
  8574. "lang": "js",
  8575. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.control.next({\n ...\n})"
  8576. }
  8577. ]
  8578. }
  8579. },
  8580. "/tui/control/response": {
  8581. "post": {
  8582. "tags": ["tui"],
  8583. "operationId": "tui.control.response",
  8584. "parameters": [
  8585. {
  8586. "name": "directory",
  8587. "in": "query",
  8588. "required": false,
  8589. "schema": {
  8590. "type": "string"
  8591. }
  8592. },
  8593. {
  8594. "name": "workspace",
  8595. "in": "query",
  8596. "required": false,
  8597. "schema": {
  8598. "type": "string"
  8599. }
  8600. }
  8601. ],
  8602. "responses": {
  8603. "200": {
  8604. "description": "Response submitted successfully",
  8605. "content": {
  8606. "application/json": {
  8607. "schema": {
  8608. "type": "boolean",
  8609. "description": "Response submitted successfully"
  8610. }
  8611. }
  8612. }
  8613. },
  8614. "400": {
  8615. "description": "Bad request",
  8616. "content": {
  8617. "application/json": {
  8618. "schema": {
  8619. "$ref": "#/components/schemas/BadRequestError"
  8620. }
  8621. }
  8622. }
  8623. }
  8624. },
  8625. "description": "Submit a response to the TUI request queue to complete a pending request.",
  8626. "summary": "Submit TUI response",
  8627. "requestBody": {
  8628. "content": {
  8629. "application/json": {
  8630. "schema": {}
  8631. }
  8632. }
  8633. },
  8634. "x-codeSamples": [
  8635. {
  8636. "lang": "js",
  8637. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.control.response({\n ...\n})"
  8638. }
  8639. ]
  8640. }
  8641. },
  8642. "/experimental/workspace/adapter": {
  8643. "get": {
  8644. "tags": ["workspace"],
  8645. "operationId": "experimental.workspace.adapter.list",
  8646. "parameters": [
  8647. {
  8648. "name": "directory",
  8649. "in": "query",
  8650. "required": false,
  8651. "schema": {
  8652. "type": "string"
  8653. }
  8654. },
  8655. {
  8656. "name": "workspace",
  8657. "in": "query",
  8658. "required": false,
  8659. "schema": {
  8660. "type": "string"
  8661. }
  8662. }
  8663. ],
  8664. "responses": {
  8665. "200": {
  8666. "description": "Workspace adapters",
  8667. "content": {
  8668. "application/json": {
  8669. "schema": {
  8670. "type": "array",
  8671. "items": {
  8672. "type": "object",
  8673. "properties": {
  8674. "type": {
  8675. "type": "string"
  8676. },
  8677. "name": {
  8678. "type": "string"
  8679. },
  8680. "description": {
  8681. "type": "string"
  8682. }
  8683. },
  8684. "required": ["type", "name", "description"],
  8685. "additionalProperties": false
  8686. },
  8687. "description": "Workspace adapters"
  8688. }
  8689. }
  8690. }
  8691. },
  8692. "400": {
  8693. "description": "Bad request",
  8694. "content": {
  8695. "application/json": {
  8696. "schema": {
  8697. "$ref": "#/components/schemas/BadRequestError"
  8698. }
  8699. }
  8700. }
  8701. }
  8702. },
  8703. "description": "List all available workspace adapters for the current project.",
  8704. "summary": "List workspace adapters",
  8705. "x-codeSamples": [
  8706. {
  8707. "lang": "js",
  8708. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.adapter.list({\n ...\n})"
  8709. }
  8710. ]
  8711. }
  8712. },
  8713. "/experimental/workspace": {
  8714. "get": {
  8715. "tags": ["workspace"],
  8716. "operationId": "experimental.workspace.list",
  8717. "parameters": [
  8718. {
  8719. "name": "directory",
  8720. "in": "query",
  8721. "required": false,
  8722. "schema": {
  8723. "type": "string"
  8724. }
  8725. },
  8726. {
  8727. "name": "workspace",
  8728. "in": "query",
  8729. "required": false,
  8730. "schema": {
  8731. "type": "string"
  8732. }
  8733. }
  8734. ],
  8735. "responses": {
  8736. "200": {
  8737. "description": "Workspaces",
  8738. "content": {
  8739. "application/json": {
  8740. "schema": {
  8741. "type": "array",
  8742. "items": {
  8743. "$ref": "#/components/schemas/Workspace"
  8744. },
  8745. "description": "Workspaces"
  8746. }
  8747. }
  8748. }
  8749. },
  8750. "400": {
  8751. "description": "Bad request",
  8752. "content": {
  8753. "application/json": {
  8754. "schema": {
  8755. "$ref": "#/components/schemas/BadRequestError"
  8756. }
  8757. }
  8758. }
  8759. }
  8760. },
  8761. "description": "List all workspaces.",
  8762. "summary": "List workspaces",
  8763. "x-codeSamples": [
  8764. {
  8765. "lang": "js",
  8766. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.list({\n ...\n})"
  8767. }
  8768. ]
  8769. },
  8770. "post": {
  8771. "tags": ["workspace"],
  8772. "operationId": "experimental.workspace.create",
  8773. "parameters": [
  8774. {
  8775. "name": "directory",
  8776. "in": "query",
  8777. "required": false,
  8778. "schema": {
  8779. "type": "string"
  8780. }
  8781. },
  8782. {
  8783. "name": "workspace",
  8784. "in": "query",
  8785. "required": false,
  8786. "schema": {
  8787. "type": "string"
  8788. }
  8789. }
  8790. ],
  8791. "responses": {
  8792. "200": {
  8793. "description": "Workspace created",
  8794. "content": {
  8795. "application/json": {
  8796. "schema": {
  8797. "$ref": "#/components/schemas/Workspace"
  8798. }
  8799. }
  8800. }
  8801. },
  8802. "400": {
  8803. "description": "Bad request",
  8804. "content": {
  8805. "application/json": {
  8806. "schema": {
  8807. "$ref": "#/components/schemas/BadRequestError"
  8808. }
  8809. }
  8810. }
  8811. }
  8812. },
  8813. "description": "Create a workspace for the current project.",
  8814. "summary": "Create workspace",
  8815. "requestBody": {
  8816. "content": {
  8817. "application/json": {
  8818. "schema": {
  8819. "type": "object",
  8820. "properties": {
  8821. "id": {
  8822. "type": "string"
  8823. },
  8824. "type": {
  8825. "type": "string"
  8826. },
  8827. "branch": {
  8828. "anyOf": [
  8829. {
  8830. "type": "string"
  8831. },
  8832. {
  8833. "type": "null"
  8834. }
  8835. ]
  8836. },
  8837. "extra": {
  8838. "anyOf": [
  8839. {},
  8840. {
  8841. "type": "null"
  8842. }
  8843. ]
  8844. }
  8845. },
  8846. "required": ["type", "branch", "extra"],
  8847. "additionalProperties": false
  8848. }
  8849. }
  8850. }
  8851. },
  8852. "x-codeSamples": [
  8853. {
  8854. "lang": "js",
  8855. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.create({\n ...\n})"
  8856. }
  8857. ]
  8858. }
  8859. },
  8860. "/experimental/workspace/status": {
  8861. "get": {
  8862. "tags": ["workspace"],
  8863. "operationId": "experimental.workspace.status",
  8864. "parameters": [
  8865. {
  8866. "name": "directory",
  8867. "in": "query",
  8868. "required": false,
  8869. "schema": {
  8870. "type": "string"
  8871. }
  8872. },
  8873. {
  8874. "name": "workspace",
  8875. "in": "query",
  8876. "required": false,
  8877. "schema": {
  8878. "type": "string"
  8879. }
  8880. }
  8881. ],
  8882. "responses": {
  8883. "200": {
  8884. "description": "Workspace status",
  8885. "content": {
  8886. "application/json": {
  8887. "schema": {
  8888. "type": "array",
  8889. "items": {
  8890. "type": "object",
  8891. "properties": {
  8892. "workspaceID": {
  8893. "type": "string"
  8894. },
  8895. "status": {
  8896. "type": "string",
  8897. "enum": ["connected", "connecting", "disconnected", "error"]
  8898. }
  8899. },
  8900. "required": ["workspaceID", "status"],
  8901. "additionalProperties": false
  8902. },
  8903. "description": "Workspace status"
  8904. }
  8905. }
  8906. }
  8907. },
  8908. "400": {
  8909. "description": "Bad request",
  8910. "content": {
  8911. "application/json": {
  8912. "schema": {
  8913. "$ref": "#/components/schemas/BadRequestError"
  8914. }
  8915. }
  8916. }
  8917. }
  8918. },
  8919. "description": "Get connection status for workspaces in the current project.",
  8920. "summary": "Workspace status",
  8921. "x-codeSamples": [
  8922. {
  8923. "lang": "js",
  8924. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.status({\n ...\n})"
  8925. }
  8926. ]
  8927. }
  8928. },
  8929. "/experimental/workspace/{id}": {
  8930. "delete": {
  8931. "tags": ["workspace"],
  8932. "operationId": "experimental.workspace.remove",
  8933. "parameters": [
  8934. {
  8935. "name": "directory",
  8936. "in": "query",
  8937. "required": false,
  8938. "schema": {
  8939. "type": "string"
  8940. }
  8941. },
  8942. {
  8943. "name": "workspace",
  8944. "in": "query",
  8945. "required": false,
  8946. "schema": {
  8947. "type": "string"
  8948. }
  8949. },
  8950. {
  8951. "name": "id",
  8952. "in": "path",
  8953. "schema": {
  8954. "type": "string",
  8955. "pattern": "^wrk.*"
  8956. },
  8957. "required": true
  8958. }
  8959. ],
  8960. "responses": {
  8961. "200": {
  8962. "description": "Workspace removed",
  8963. "content": {
  8964. "application/json": {
  8965. "schema": {
  8966. "$ref": "#/components/schemas/Workspace"
  8967. }
  8968. }
  8969. }
  8970. },
  8971. "400": {
  8972. "description": "Bad request",
  8973. "content": {
  8974. "application/json": {
  8975. "schema": {
  8976. "$ref": "#/components/schemas/BadRequestError"
  8977. }
  8978. }
  8979. }
  8980. }
  8981. },
  8982. "description": "Remove an existing workspace.",
  8983. "summary": "Remove workspace",
  8984. "x-codeSamples": [
  8985. {
  8986. "lang": "js",
  8987. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.remove({\n ...\n})"
  8988. }
  8989. ]
  8990. }
  8991. },
  8992. "/experimental/workspace/warp": {
  8993. "post": {
  8994. "tags": ["workspace"],
  8995. "operationId": "experimental.workspace.warp",
  8996. "parameters": [
  8997. {
  8998. "name": "directory",
  8999. "in": "query",
  9000. "required": false,
  9001. "schema": {
  9002. "type": "string"
  9003. }
  9004. },
  9005. {
  9006. "name": "workspace",
  9007. "in": "query",
  9008. "required": false,
  9009. "schema": {
  9010. "type": "string"
  9011. }
  9012. }
  9013. ],
  9014. "responses": {
  9015. "204": {
  9016. "description": "Session warped"
  9017. },
  9018. "400": {
  9019. "description": "Bad request",
  9020. "content": {
  9021. "application/json": {
  9022. "schema": {
  9023. "$ref": "#/components/schemas/BadRequestError"
  9024. }
  9025. }
  9026. }
  9027. }
  9028. },
  9029. "description": "Move a session's sync history into the target workspace, or detach it to the local project.",
  9030. "summary": "Warp session into workspace",
  9031. "requestBody": {
  9032. "content": {
  9033. "application/json": {
  9034. "schema": {
  9035. "type": "object",
  9036. "properties": {
  9037. "id": {
  9038. "type": "string"
  9039. },
  9040. "sessionID": {
  9041. "type": "string"
  9042. }
  9043. },
  9044. "required": ["id", "sessionID"],
  9045. "additionalProperties": false
  9046. }
  9047. }
  9048. }
  9049. },
  9050. "x-codeSamples": [
  9051. {
  9052. "lang": "js",
  9053. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.warp({\n ...\n})"
  9054. }
  9055. ]
  9056. }
  9057. },
  9058. "/pty/{ptyID}/connect": {
  9059. "get": {
  9060. "tags": ["pty"],
  9061. "operationId": "pty.connect",
  9062. "parameters": [
  9063. {
  9064. "name": "directory",
  9065. "in": "query",
  9066. "required": false,
  9067. "schema": {
  9068. "type": "string"
  9069. }
  9070. },
  9071. {
  9072. "name": "workspace",
  9073. "in": "query",
  9074. "required": false,
  9075. "schema": {
  9076. "type": "string"
  9077. }
  9078. },
  9079. {
  9080. "name": "ptyID",
  9081. "in": "path",
  9082. "schema": {
  9083. "type": "string",
  9084. "pattern": "^pty.*"
  9085. },
  9086. "required": true
  9087. }
  9088. ],
  9089. "responses": {
  9090. "200": {
  9091. "description": "Connected session",
  9092. "content": {
  9093. "application/json": {
  9094. "schema": {
  9095. "type": "boolean",
  9096. "description": "Connected session"
  9097. }
  9098. }
  9099. }
  9100. },
  9101. "400": {
  9102. "description": "Bad request",
  9103. "content": {
  9104. "application/json": {
  9105. "schema": {
  9106. "$ref": "#/components/schemas/BadRequestError"
  9107. }
  9108. }
  9109. }
  9110. },
  9111. "403": {
  9112. "description": "Forbidden",
  9113. "content": {
  9114. "application/json": {
  9115. "schema": {
  9116. "$ref": "#/components/schemas/effect_HttpApiError_Forbidden"
  9117. }
  9118. }
  9119. }
  9120. },
  9121. "404": {
  9122. "description": "Not found",
  9123. "content": {
  9124. "application/json": {
  9125. "schema": {
  9126. "$ref": "#/components/schemas/NotFoundError"
  9127. }
  9128. }
  9129. }
  9130. }
  9131. },
  9132. "description": "Establish a WebSocket connection to interact with a pseudo-terminal (PTY) session in real-time.",
  9133. "summary": "Connect to PTY session",
  9134. "x-codeSamples": [
  9135. {
  9136. "lang": "js",
  9137. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.connect({\n ...\n})"
  9138. }
  9139. ]
  9140. }
  9141. }
  9142. },
  9143. "components": {
  9144. "schemas": {
  9145. "Event": {
  9146. "anyOf": [
  9147. {
  9148. "$ref": "#/components/schemas/EventServerInstanceDisposed"
  9149. },
  9150. {
  9151. "$ref": "#/components/schemas/EventFileEdited"
  9152. },
  9153. {
  9154. "$ref": "#/components/schemas/EventFileWatcherUpdated"
  9155. },
  9156. {
  9157. "$ref": "#/components/schemas/EventLspClientDiagnostics"
  9158. },
  9159. {
  9160. "$ref": "#/components/schemas/EventLspUpdated"
  9161. },
  9162. {
  9163. "$ref": "#/components/schemas/EventMessagePartDelta"
  9164. },
  9165. {
  9166. "$ref": "#/components/schemas/EventPermissionAsked"
  9167. },
  9168. {
  9169. "$ref": "#/components/schemas/EventPermissionReplied"
  9170. },
  9171. {
  9172. "$ref": "#/components/schemas/EventSessionDiff"
  9173. },
  9174. {
  9175. "$ref": "#/components/schemas/EventSessionError"
  9176. },
  9177. {
  9178. "$ref": "#/components/schemas/EventInstallationUpdated"
  9179. },
  9180. {
  9181. "$ref": "#/components/schemas/EventInstallationUpdate-available"
  9182. },
  9183. {
  9184. "$ref": "#/components/schemas/EventQuestionAsked"
  9185. },
  9186. {
  9187. "$ref": "#/components/schemas/EventQuestionReplied"
  9188. },
  9189. {
  9190. "$ref": "#/components/schemas/EventQuestionRejected"
  9191. },
  9192. {
  9193. "$ref": "#/components/schemas/EventTodoUpdated"
  9194. },
  9195. {
  9196. "$ref": "#/components/schemas/EventSessionStatus"
  9197. },
  9198. {
  9199. "$ref": "#/components/schemas/EventSessionIdle"
  9200. },
  9201. {
  9202. "$ref": "#/components/schemas/EventSessionCompacted"
  9203. },
  9204. {
  9205. "$ref": "#/components/schemas/Event.tui.prompt.append"
  9206. },
  9207. {
  9208. "$ref": "#/components/schemas/Event.tui.command.execute"
  9209. },
  9210. {
  9211. "$ref": "#/components/schemas/EventTuiToastShow1"
  9212. },
  9213. {
  9214. "$ref": "#/components/schemas/Event.tui.session.select"
  9215. },
  9216. {
  9217. "$ref": "#/components/schemas/EventMcpToolsChanged"
  9218. },
  9219. {
  9220. "$ref": "#/components/schemas/EventMcpBrowserOpenFailed"
  9221. },
  9222. {
  9223. "$ref": "#/components/schemas/EventCommandExecuted"
  9224. },
  9225. {
  9226. "$ref": "#/components/schemas/EventProjectUpdated"
  9227. },
  9228. {
  9229. "$ref": "#/components/schemas/EventVcsBranchUpdated"
  9230. },
  9231. {
  9232. "$ref": "#/components/schemas/EventWorkspaceReady"
  9233. },
  9234. {
  9235. "$ref": "#/components/schemas/EventWorkspaceFailed"
  9236. },
  9237. {
  9238. "$ref": "#/components/schemas/EventWorkspaceStatus"
  9239. },
  9240. {
  9241. "$ref": "#/components/schemas/EventWorktreeReady"
  9242. },
  9243. {
  9244. "$ref": "#/components/schemas/EventWorktreeFailed"
  9245. },
  9246. {
  9247. "$ref": "#/components/schemas/EventPtyCreated"
  9248. },
  9249. {
  9250. "$ref": "#/components/schemas/EventPtyUpdated"
  9251. },
  9252. {
  9253. "$ref": "#/components/schemas/EventPtyExited"
  9254. },
  9255. {
  9256. "$ref": "#/components/schemas/EventPtyDeleted"
  9257. },
  9258. {
  9259. "$ref": "#/components/schemas/EventMessageUpdated"
  9260. },
  9261. {
  9262. "$ref": "#/components/schemas/EventMessageRemoved"
  9263. },
  9264. {
  9265. "$ref": "#/components/schemas/EventMessagePartUpdated"
  9266. },
  9267. {
  9268. "$ref": "#/components/schemas/EventMessagePartRemoved"
  9269. },
  9270. {
  9271. "$ref": "#/components/schemas/EventSessionCreated"
  9272. },
  9273. {
  9274. "$ref": "#/components/schemas/EventSessionUpdated"
  9275. },
  9276. {
  9277. "$ref": "#/components/schemas/EventSessionDeleted"
  9278. },
  9279. {
  9280. "$ref": "#/components/schemas/EventSessionNextAgentSwitched"
  9281. },
  9282. {
  9283. "$ref": "#/components/schemas/EventSessionNextModelSwitched"
  9284. },
  9285. {
  9286. "$ref": "#/components/schemas/EventSessionNextPrompted"
  9287. },
  9288. {
  9289. "$ref": "#/components/schemas/EventSessionNextSynthetic"
  9290. },
  9291. {
  9292. "$ref": "#/components/schemas/EventSessionNextShellStarted"
  9293. },
  9294. {
  9295. "$ref": "#/components/schemas/EventSessionNextShellEnded"
  9296. },
  9297. {
  9298. "$ref": "#/components/schemas/EventSessionNextStepStarted"
  9299. },
  9300. {
  9301. "$ref": "#/components/schemas/EventSessionNextStepEnded"
  9302. },
  9303. {
  9304. "$ref": "#/components/schemas/EventSessionNextStepFailed"
  9305. },
  9306. {
  9307. "$ref": "#/components/schemas/EventSessionNextTextStarted"
  9308. },
  9309. {
  9310. "$ref": "#/components/schemas/EventSessionNextTextDelta"
  9311. },
  9312. {
  9313. "$ref": "#/components/schemas/EventSessionNextTextEnded"
  9314. },
  9315. {
  9316. "$ref": "#/components/schemas/EventSessionNextReasoningStarted"
  9317. },
  9318. {
  9319. "$ref": "#/components/schemas/EventSessionNextReasoningDelta"
  9320. },
  9321. {
  9322. "$ref": "#/components/schemas/EventSessionNextReasoningEnded"
  9323. },
  9324. {
  9325. "$ref": "#/components/schemas/EventSessionNextToolInputStarted"
  9326. },
  9327. {
  9328. "$ref": "#/components/schemas/EventSessionNextToolInputDelta"
  9329. },
  9330. {
  9331. "$ref": "#/components/schemas/EventSessionNextToolInputEnded"
  9332. },
  9333. {
  9334. "$ref": "#/components/schemas/EventSessionNextToolCalled"
  9335. },
  9336. {
  9337. "$ref": "#/components/schemas/EventSessionNextToolProgress"
  9338. },
  9339. {
  9340. "$ref": "#/components/schemas/EventSessionNextToolSuccess"
  9341. },
  9342. {
  9343. "$ref": "#/components/schemas/EventSessionNextToolFailed"
  9344. },
  9345. {
  9346. "$ref": "#/components/schemas/EventSessionNextRetried"
  9347. },
  9348. {
  9349. "$ref": "#/components/schemas/EventSessionNextCompactionStarted"
  9350. },
  9351. {
  9352. "$ref": "#/components/schemas/EventSessionNextCompactionDelta"
  9353. },
  9354. {
  9355. "$ref": "#/components/schemas/EventSessionNextCompactionEnded"
  9356. },
  9357. {
  9358. "$ref": "#/components/schemas/EventServerConnected"
  9359. },
  9360. {
  9361. "$ref": "#/components/schemas/EventGlobalDisposed"
  9362. }
  9363. ]
  9364. },
  9365. "OAuth": {
  9366. "type": "object",
  9367. "properties": {
  9368. "type": {
  9369. "type": "string",
  9370. "enum": ["oauth"]
  9371. },
  9372. "refresh": {
  9373. "type": "string"
  9374. },
  9375. "access": {
  9376. "type": "string"
  9377. },
  9378. "expires": {
  9379. "type": "integer",
  9380. "minimum": 0
  9381. },
  9382. "accountId": {
  9383. "type": "string"
  9384. },
  9385. "enterpriseUrl": {
  9386. "type": "string"
  9387. }
  9388. },
  9389. "required": ["type", "refresh", "access", "expires"],
  9390. "additionalProperties": false
  9391. },
  9392. "ApiAuth": {
  9393. "type": "object",
  9394. "properties": {
  9395. "type": {
  9396. "type": "string",
  9397. "enum": ["api"]
  9398. },
  9399. "key": {
  9400. "type": "string"
  9401. },
  9402. "metadata": {
  9403. "type": "object",
  9404. "additionalProperties": {
  9405. "type": "string"
  9406. }
  9407. }
  9408. },
  9409. "required": ["type", "key"],
  9410. "additionalProperties": false
  9411. },
  9412. "WellKnownAuth": {
  9413. "type": "object",
  9414. "properties": {
  9415. "type": {
  9416. "type": "string",
  9417. "enum": ["wellknown"]
  9418. },
  9419. "key": {
  9420. "type": "string"
  9421. },
  9422. "token": {
  9423. "type": "string"
  9424. }
  9425. },
  9426. "required": ["type", "key", "token"],
  9427. "additionalProperties": false
  9428. },
  9429. "Auth": {
  9430. "anyOf": [
  9431. {
  9432. "$ref": "#/components/schemas/OAuth"
  9433. },
  9434. {
  9435. "$ref": "#/components/schemas/ApiAuth"
  9436. },
  9437. {
  9438. "$ref": "#/components/schemas/WellKnownAuth"
  9439. }
  9440. ]
  9441. },
  9442. "PermissionRequest": {
  9443. "type": "object",
  9444. "properties": {
  9445. "id": {
  9446. "type": "string"
  9447. },
  9448. "sessionID": {
  9449. "type": "string"
  9450. },
  9451. "permission": {
  9452. "type": "string"
  9453. },
  9454. "patterns": {
  9455. "type": "array",
  9456. "items": {
  9457. "type": "string"
  9458. }
  9459. },
  9460. "metadata": {
  9461. "type": "object"
  9462. },
  9463. "always": {
  9464. "type": "array",
  9465. "items": {
  9466. "type": "string"
  9467. }
  9468. },
  9469. "tool": {
  9470. "type": "object",
  9471. "properties": {
  9472. "messageID": {
  9473. "type": "string"
  9474. },
  9475. "callID": {
  9476. "type": "string"
  9477. }
  9478. },
  9479. "required": ["messageID", "callID"],
  9480. "additionalProperties": false
  9481. }
  9482. },
  9483. "required": ["id", "sessionID", "permission", "patterns", "metadata", "always"],
  9484. "additionalProperties": false
  9485. },
  9486. "SnapshotFileDiff": {
  9487. "type": "object",
  9488. "properties": {
  9489. "file": {
  9490. "type": "string"
  9491. },
  9492. "patch": {
  9493. "type": "string"
  9494. },
  9495. "additions": {
  9496. "type": "integer",
  9497. "minimum": 0
  9498. },
  9499. "deletions": {
  9500. "type": "integer",
  9501. "minimum": 0
  9502. },
  9503. "status": {
  9504. "type": "string",
  9505. "enum": ["added", "deleted", "modified"]
  9506. }
  9507. },
  9508. "required": ["file", "patch", "additions", "deletions"],
  9509. "additionalProperties": false
  9510. },
  9511. "ProviderAuthError": {
  9512. "type": "object",
  9513. "properties": {
  9514. "name": {
  9515. "type": "string",
  9516. "enum": ["ProviderAuthError"]
  9517. },
  9518. "data": {
  9519. "type": "object",
  9520. "properties": {
  9521. "providerID": {
  9522. "type": "string"
  9523. },
  9524. "message": {
  9525. "type": "string"
  9526. }
  9527. },
  9528. "required": ["providerID", "message"],
  9529. "additionalProperties": false
  9530. }
  9531. },
  9532. "required": ["name", "data"],
  9533. "additionalProperties": false
  9534. },
  9535. "UnknownError": {
  9536. "type": "object",
  9537. "properties": {
  9538. "name": {
  9539. "type": "string",
  9540. "enum": ["UnknownError"]
  9541. },
  9542. "data": {
  9543. "type": "object",
  9544. "properties": {
  9545. "message": {
  9546. "type": "string"
  9547. }
  9548. },
  9549. "required": ["message"],
  9550. "additionalProperties": false
  9551. }
  9552. },
  9553. "required": ["name", "data"],
  9554. "additionalProperties": false
  9555. },
  9556. "MessageOutputLengthError": {
  9557. "type": "object",
  9558. "properties": {
  9559. "name": {
  9560. "type": "string",
  9561. "enum": ["MessageOutputLengthError"]
  9562. },
  9563. "data": {
  9564. "type": "object",
  9565. "properties": {}
  9566. }
  9567. },
  9568. "required": ["name", "data"],
  9569. "additionalProperties": false
  9570. },
  9571. "MessageAbortedError": {
  9572. "type": "object",
  9573. "properties": {
  9574. "name": {
  9575. "type": "string",
  9576. "enum": ["MessageAbortedError"]
  9577. },
  9578. "data": {
  9579. "type": "object",
  9580. "properties": {
  9581. "message": {
  9582. "type": "string"
  9583. }
  9584. },
  9585. "required": ["message"],
  9586. "additionalProperties": false
  9587. }
  9588. },
  9589. "required": ["name", "data"],
  9590. "additionalProperties": false
  9591. },
  9592. "StructuredOutputError": {
  9593. "type": "object",
  9594. "properties": {
  9595. "name": {
  9596. "type": "string",
  9597. "enum": ["StructuredOutputError"]
  9598. },
  9599. "data": {
  9600. "type": "object",
  9601. "properties": {
  9602. "message": {
  9603. "type": "string"
  9604. },
  9605. "retries": {
  9606. "type": "integer",
  9607. "minimum": 0
  9608. }
  9609. },
  9610. "required": ["message", "retries"],
  9611. "additionalProperties": false
  9612. }
  9613. },
  9614. "required": ["name", "data"],
  9615. "additionalProperties": false
  9616. },
  9617. "ContextOverflowError": {
  9618. "type": "object",
  9619. "properties": {
  9620. "name": {
  9621. "type": "string",
  9622. "enum": ["ContextOverflowError"]
  9623. },
  9624. "data": {
  9625. "type": "object",
  9626. "properties": {
  9627. "message": {
  9628. "type": "string"
  9629. },
  9630. "responseBody": {
  9631. "type": "string"
  9632. }
  9633. },
  9634. "required": ["message"],
  9635. "additionalProperties": false
  9636. }
  9637. },
  9638. "required": ["name", "data"],
  9639. "additionalProperties": false
  9640. },
  9641. "APIError": {
  9642. "type": "object",
  9643. "properties": {
  9644. "name": {
  9645. "type": "string",
  9646. "enum": ["APIError"]
  9647. },
  9648. "data": {
  9649. "type": "object",
  9650. "properties": {
  9651. "message": {
  9652. "type": "string"
  9653. },
  9654. "statusCode": {
  9655. "type": "integer",
  9656. "minimum": 0
  9657. },
  9658. "isRetryable": {
  9659. "type": "boolean"
  9660. },
  9661. "responseHeaders": {
  9662. "type": "object",
  9663. "additionalProperties": {
  9664. "type": "string"
  9665. }
  9666. },
  9667. "responseBody": {
  9668. "type": "string"
  9669. },
  9670. "metadata": {
  9671. "type": "object",
  9672. "additionalProperties": {
  9673. "type": "string"
  9674. }
  9675. }
  9676. },
  9677. "required": ["message", "isRetryable"],
  9678. "additionalProperties": false
  9679. }
  9680. },
  9681. "required": ["name", "data"],
  9682. "additionalProperties": false
  9683. },
  9684. "QuestionOption": {
  9685. "type": "object",
  9686. "properties": {
  9687. "label": {
  9688. "type": "string",
  9689. "description": "Display text (1-5 words, concise)"
  9690. },
  9691. "description": {
  9692. "type": "string",
  9693. "description": "Explanation of choice"
  9694. }
  9695. },
  9696. "required": ["label", "description"],
  9697. "additionalProperties": false
  9698. },
  9699. "QuestionInfo": {
  9700. "type": "object",
  9701. "properties": {
  9702. "question": {
  9703. "type": "string",
  9704. "description": "Complete question"
  9705. },
  9706. "header": {
  9707. "type": "string",
  9708. "description": "Very short label (max 30 chars)"
  9709. },
  9710. "options": {
  9711. "type": "array",
  9712. "items": {
  9713. "$ref": "#/components/schemas/QuestionOption"
  9714. },
  9715. "description": "Available choices"
  9716. },
  9717. "multiple": {
  9718. "type": "boolean"
  9719. },
  9720. "custom": {
  9721. "type": "boolean"
  9722. }
  9723. },
  9724. "required": ["question", "header", "options"],
  9725. "additionalProperties": false
  9726. },
  9727. "QuestionTool": {
  9728. "type": "object",
  9729. "properties": {
  9730. "messageID": {
  9731. "type": "string"
  9732. },
  9733. "callID": {
  9734. "type": "string"
  9735. }
  9736. },
  9737. "required": ["messageID", "callID"],
  9738. "additionalProperties": false
  9739. },
  9740. "QuestionRequest": {
  9741. "type": "object",
  9742. "properties": {
  9743. "id": {
  9744. "type": "string"
  9745. },
  9746. "sessionID": {
  9747. "type": "string"
  9748. },
  9749. "questions": {
  9750. "type": "array",
  9751. "items": {
  9752. "$ref": "#/components/schemas/QuestionInfo"
  9753. },
  9754. "description": "Questions to ask"
  9755. },
  9756. "tool": {
  9757. "$ref": "#/components/schemas/QuestionTool"
  9758. }
  9759. },
  9760. "required": ["id", "sessionID", "questions"],
  9761. "additionalProperties": false
  9762. },
  9763. "QuestionAnswer": {
  9764. "type": "array",
  9765. "items": {
  9766. "type": "string"
  9767. }
  9768. },
  9769. "QuestionReplied": {
  9770. "type": "object",
  9771. "properties": {
  9772. "sessionID": {
  9773. "type": "string"
  9774. },
  9775. "requestID": {
  9776. "type": "string"
  9777. },
  9778. "answers": {
  9779. "type": "array",
  9780. "items": {
  9781. "$ref": "#/components/schemas/QuestionAnswer"
  9782. }
  9783. }
  9784. },
  9785. "required": ["sessionID", "requestID", "answers"],
  9786. "additionalProperties": false
  9787. },
  9788. "QuestionRejected": {
  9789. "type": "object",
  9790. "properties": {
  9791. "sessionID": {
  9792. "type": "string"
  9793. },
  9794. "requestID": {
  9795. "type": "string"
  9796. }
  9797. },
  9798. "required": ["sessionID", "requestID"],
  9799. "additionalProperties": false
  9800. },
  9801. "Todo": {
  9802. "type": "object",
  9803. "properties": {
  9804. "content": {
  9805. "type": "string",
  9806. "description": "Brief description of the task"
  9807. },
  9808. "status": {
  9809. "type": "string",
  9810. "description": "Current status of the task: pending, in_progress, completed, cancelled"
  9811. },
  9812. "priority": {
  9813. "type": "string",
  9814. "description": "Priority level of the task: high, medium, low"
  9815. }
  9816. },
  9817. "required": ["content", "status", "priority"],
  9818. "additionalProperties": false
  9819. },
  9820. "SessionStatus": {
  9821. "anyOf": [
  9822. {
  9823. "type": "object",
  9824. "properties": {
  9825. "type": {
  9826. "type": "string",
  9827. "enum": ["idle"]
  9828. }
  9829. },
  9830. "required": ["type"],
  9831. "additionalProperties": false
  9832. },
  9833. {
  9834. "type": "object",
  9835. "properties": {
  9836. "type": {
  9837. "type": "string",
  9838. "enum": ["retry"]
  9839. },
  9840. "attempt": {
  9841. "type": "integer",
  9842. "minimum": 0
  9843. },
  9844. "message": {
  9845. "type": "string"
  9846. },
  9847. "next": {
  9848. "type": "integer",
  9849. "minimum": 0
  9850. }
  9851. },
  9852. "required": ["type", "attempt", "message", "next"],
  9853. "additionalProperties": false
  9854. },
  9855. {
  9856. "type": "object",
  9857. "properties": {
  9858. "type": {
  9859. "type": "string",
  9860. "enum": ["busy"]
  9861. }
  9862. },
  9863. "required": ["type"],
  9864. "additionalProperties": false
  9865. }
  9866. ]
  9867. },
  9868. "Event.tui.prompt.append": {
  9869. "type": "object",
  9870. "properties": {
  9871. "id": {
  9872. "type": "string"
  9873. },
  9874. "type": {
  9875. "type": "string",
  9876. "enum": ["tui.prompt.append"]
  9877. },
  9878. "properties": {
  9879. "type": "object",
  9880. "properties": {
  9881. "text": {
  9882. "type": "string"
  9883. }
  9884. },
  9885. "required": ["text"],
  9886. "additionalProperties": false
  9887. }
  9888. },
  9889. "required": ["id", "type", "properties"],
  9890. "additionalProperties": false
  9891. },
  9892. "Event.tui.command.execute": {
  9893. "type": "object",
  9894. "properties": {
  9895. "id": {
  9896. "type": "string"
  9897. },
  9898. "type": {
  9899. "type": "string",
  9900. "enum": ["tui.command.execute"]
  9901. },
  9902. "properties": {
  9903. "type": "object",
  9904. "properties": {
  9905. "command": {
  9906. "anyOf": [
  9907. {
  9908. "type": "string",
  9909. "enum": [
  9910. "session.list",
  9911. "session.new",
  9912. "session.share",
  9913. "session.interrupt",
  9914. "session.compact",
  9915. "session.page.up",
  9916. "session.page.down",
  9917. "session.line.up",
  9918. "session.line.down",
  9919. "session.half.page.up",
  9920. "session.half.page.down",
  9921. "session.first",
  9922. "session.last",
  9923. "prompt.clear",
  9924. "prompt.submit",
  9925. "agent.cycle"
  9926. ]
  9927. },
  9928. {
  9929. "type": "string"
  9930. }
  9931. ]
  9932. }
  9933. },
  9934. "required": ["command"],
  9935. "additionalProperties": false
  9936. }
  9937. },
  9938. "required": ["id", "type", "properties"],
  9939. "additionalProperties": false
  9940. },
  9941. "Event.tui.toast.show": {
  9942. "type": "object",
  9943. "properties": {
  9944. "id": {
  9945. "type": "string"
  9946. },
  9947. "type": {
  9948. "type": "string",
  9949. "enum": ["tui.toast.show"]
  9950. },
  9951. "properties": {
  9952. "type": "object",
  9953. "properties": {
  9954. "title": {
  9955. "type": "string"
  9956. },
  9957. "message": {
  9958. "type": "string"
  9959. },
  9960. "variant": {
  9961. "type": "string",
  9962. "enum": ["info", "success", "warning", "error"]
  9963. },
  9964. "duration": {
  9965. "type": "integer",
  9966. "exclusiveMinimum": 0
  9967. }
  9968. },
  9969. "required": ["message", "variant"],
  9970. "additionalProperties": false
  9971. }
  9972. },
  9973. "required": ["id", "type", "properties"],
  9974. "additionalProperties": false
  9975. },
  9976. "Event.tui.session.select": {
  9977. "type": "object",
  9978. "properties": {
  9979. "id": {
  9980. "type": "string"
  9981. },
  9982. "type": {
  9983. "type": "string",
  9984. "enum": ["tui.session.select"]
  9985. },
  9986. "properties": {
  9987. "type": "object",
  9988. "properties": {
  9989. "sessionID": {
  9990. "type": "string",
  9991. "description": "Session ID to navigate to"
  9992. }
  9993. },
  9994. "required": ["sessionID"],
  9995. "additionalProperties": false
  9996. }
  9997. },
  9998. "required": ["id", "type", "properties"],
  9999. "additionalProperties": false
  10000. },
  10001. "Project": {
  10002. "type": "object",
  10003. "properties": {
  10004. "id": {
  10005. "type": "string"
  10006. },
  10007. "worktree": {
  10008. "type": "string"
  10009. },
  10010. "vcs": {
  10011. "type": "string",
  10012. "enum": ["git"]
  10013. },
  10014. "name": {
  10015. "type": "string"
  10016. },
  10017. "icon": {
  10018. "type": "object",
  10019. "properties": {
  10020. "url": {
  10021. "type": "string"
  10022. },
  10023. "override": {
  10024. "type": "string"
  10025. },
  10026. "color": {
  10027. "type": "string"
  10028. }
  10029. },
  10030. "additionalProperties": false
  10031. },
  10032. "commands": {
  10033. "type": "object",
  10034. "properties": {
  10035. "start": {
  10036. "type": "string",
  10037. "description": "Startup script to run when creating a new workspace (worktree)"
  10038. }
  10039. },
  10040. "additionalProperties": false
  10041. },
  10042. "time": {
  10043. "type": "object",
  10044. "properties": {
  10045. "created": {
  10046. "type": "integer",
  10047. "minimum": 0
  10048. },
  10049. "updated": {
  10050. "type": "integer",
  10051. "minimum": 0
  10052. },
  10053. "initialized": {
  10054. "type": "integer",
  10055. "minimum": 0
  10056. }
  10057. },
  10058. "required": ["created", "updated"],
  10059. "additionalProperties": false
  10060. },
  10061. "sandboxes": {
  10062. "type": "array",
  10063. "items": {
  10064. "type": "string"
  10065. }
  10066. }
  10067. },
  10068. "required": ["id", "worktree", "time", "sandboxes"],
  10069. "additionalProperties": false
  10070. },
  10071. "Pty": {
  10072. "type": "object",
  10073. "properties": {
  10074. "id": {
  10075. "type": "string"
  10076. },
  10077. "title": {
  10078. "type": "string"
  10079. },
  10080. "command": {
  10081. "type": "string"
  10082. },
  10083. "args": {
  10084. "type": "array",
  10085. "items": {
  10086. "type": "string"
  10087. }
  10088. },
  10089. "cwd": {
  10090. "type": "string"
  10091. },
  10092. "status": {
  10093. "type": "string",
  10094. "enum": ["running", "exited"]
  10095. },
  10096. "pid": {
  10097. "type": "integer",
  10098. "exclusiveMinimum": 0
  10099. }
  10100. },
  10101. "required": ["id", "title", "command", "args", "cwd", "status", "pid"],
  10102. "additionalProperties": false
  10103. },
  10104. "OutputFormatText": {
  10105. "type": "object",
  10106. "properties": {
  10107. "type": {
  10108. "type": "string",
  10109. "enum": ["text"]
  10110. }
  10111. },
  10112. "required": ["type"],
  10113. "additionalProperties": false
  10114. },
  10115. "JSONSchema": {
  10116. "type": "object"
  10117. },
  10118. "OutputFormatJsonSchema": {
  10119. "type": "object",
  10120. "properties": {
  10121. "type": {
  10122. "type": "string",
  10123. "enum": ["json_schema"]
  10124. },
  10125. "schema": {
  10126. "$ref": "#/components/schemas/JSONSchema"
  10127. },
  10128. "retryCount": {
  10129. "type": "integer",
  10130. "minimum": 0
  10131. }
  10132. },
  10133. "required": ["type", "schema"],
  10134. "additionalProperties": false
  10135. },
  10136. "OutputFormat": {
  10137. "anyOf": [
  10138. {
  10139. "$ref": "#/components/schemas/OutputFormatText"
  10140. },
  10141. {
  10142. "$ref": "#/components/schemas/OutputFormatJsonSchema"
  10143. }
  10144. ]
  10145. },
  10146. "UserMessage": {
  10147. "type": "object",
  10148. "properties": {
  10149. "id": {
  10150. "type": "string"
  10151. },
  10152. "sessionID": {
  10153. "type": "string"
  10154. },
  10155. "role": {
  10156. "type": "string",
  10157. "enum": ["user"]
  10158. },
  10159. "time": {
  10160. "type": "object",
  10161. "properties": {
  10162. "created": {
  10163. "type": "integer",
  10164. "minimum": 0
  10165. }
  10166. },
  10167. "required": ["created"],
  10168. "additionalProperties": false
  10169. },
  10170. "format": {
  10171. "$ref": "#/components/schemas/OutputFormat"
  10172. },
  10173. "summary": {
  10174. "type": "object",
  10175. "properties": {
  10176. "title": {
  10177. "type": "string"
  10178. },
  10179. "body": {
  10180. "type": "string"
  10181. },
  10182. "diffs": {
  10183. "type": "array",
  10184. "items": {
  10185. "$ref": "#/components/schemas/SnapshotFileDiff"
  10186. }
  10187. }
  10188. },
  10189. "required": ["diffs"],
  10190. "additionalProperties": false
  10191. },
  10192. "agent": {
  10193. "type": "string"
  10194. },
  10195. "model": {
  10196. "type": "object",
  10197. "properties": {
  10198. "providerID": {
  10199. "type": "string"
  10200. },
  10201. "modelID": {
  10202. "type": "string"
  10203. },
  10204. "variant": {
  10205. "type": "string"
  10206. }
  10207. },
  10208. "required": ["providerID", "modelID"],
  10209. "additionalProperties": false
  10210. },
  10211. "system": {
  10212. "type": "string"
  10213. },
  10214. "tools": {
  10215. "type": "object",
  10216. "additionalProperties": {
  10217. "type": "boolean"
  10218. }
  10219. }
  10220. },
  10221. "required": ["id", "sessionID", "role", "time", "agent", "model"],
  10222. "additionalProperties": false
  10223. },
  10224. "AssistantMessage": {
  10225. "type": "object",
  10226. "properties": {
  10227. "id": {
  10228. "type": "string"
  10229. },
  10230. "sessionID": {
  10231. "type": "string"
  10232. },
  10233. "role": {
  10234. "type": "string",
  10235. "enum": ["assistant"]
  10236. },
  10237. "time": {
  10238. "type": "object",
  10239. "properties": {
  10240. "created": {
  10241. "type": "integer",
  10242. "minimum": 0
  10243. },
  10244. "completed": {
  10245. "type": "integer",
  10246. "minimum": 0
  10247. }
  10248. },
  10249. "required": ["created"],
  10250. "additionalProperties": false
  10251. },
  10252. "error": {
  10253. "anyOf": [
  10254. {
  10255. "$ref": "#/components/schemas/ProviderAuthError"
  10256. },
  10257. {
  10258. "$ref": "#/components/schemas/UnknownError"
  10259. },
  10260. {
  10261. "$ref": "#/components/schemas/MessageOutputLengthError"
  10262. },
  10263. {
  10264. "$ref": "#/components/schemas/MessageAbortedError"
  10265. },
  10266. {
  10267. "$ref": "#/components/schemas/StructuredOutputError"
  10268. },
  10269. {
  10270. "$ref": "#/components/schemas/ContextOverflowError"
  10271. },
  10272. {
  10273. "$ref": "#/components/schemas/APIError"
  10274. }
  10275. ]
  10276. },
  10277. "parentID": {
  10278. "type": "string"
  10279. },
  10280. "modelID": {
  10281. "type": "string"
  10282. },
  10283. "providerID": {
  10284. "type": "string"
  10285. },
  10286. "mode": {
  10287. "type": "string"
  10288. },
  10289. "agent": {
  10290. "type": "string"
  10291. },
  10292. "path": {
  10293. "type": "object",
  10294. "properties": {
  10295. "cwd": {
  10296. "type": "string"
  10297. },
  10298. "root": {
  10299. "type": "string"
  10300. }
  10301. },
  10302. "required": ["cwd", "root"],
  10303. "additionalProperties": false
  10304. },
  10305. "summary": {
  10306. "type": "boolean"
  10307. },
  10308. "cost": {
  10309. "type": "number"
  10310. },
  10311. "tokens": {
  10312. "type": "object",
  10313. "properties": {
  10314. "total": {
  10315. "type": "integer",
  10316. "minimum": 0
  10317. },
  10318. "input": {
  10319. "type": "integer",
  10320. "minimum": 0
  10321. },
  10322. "output": {
  10323. "type": "integer",
  10324. "minimum": 0
  10325. },
  10326. "reasoning": {
  10327. "type": "integer",
  10328. "minimum": 0
  10329. },
  10330. "cache": {
  10331. "type": "object",
  10332. "properties": {
  10333. "read": {
  10334. "type": "integer",
  10335. "minimum": 0
  10336. },
  10337. "write": {
  10338. "type": "integer",
  10339. "minimum": 0
  10340. }
  10341. },
  10342. "required": ["read", "write"],
  10343. "additionalProperties": false
  10344. }
  10345. },
  10346. "required": ["input", "output", "reasoning", "cache"],
  10347. "additionalProperties": false
  10348. },
  10349. "structured": {},
  10350. "variant": {
  10351. "type": "string"
  10352. },
  10353. "finish": {
  10354. "type": "string"
  10355. }
  10356. },
  10357. "required": [
  10358. "id",
  10359. "sessionID",
  10360. "role",
  10361. "time",
  10362. "parentID",
  10363. "modelID",
  10364. "providerID",
  10365. "mode",
  10366. "agent",
  10367. "path",
  10368. "cost",
  10369. "tokens"
  10370. ],
  10371. "additionalProperties": false
  10372. },
  10373. "Message": {
  10374. "anyOf": [
  10375. {
  10376. "$ref": "#/components/schemas/UserMessage"
  10377. },
  10378. {
  10379. "$ref": "#/components/schemas/AssistantMessage"
  10380. }
  10381. ]
  10382. },
  10383. "TextPart": {
  10384. "type": "object",
  10385. "properties": {
  10386. "id": {
  10387. "type": "string"
  10388. },
  10389. "sessionID": {
  10390. "type": "string"
  10391. },
  10392. "messageID": {
  10393. "type": "string"
  10394. },
  10395. "type": {
  10396. "type": "string",
  10397. "enum": ["text"]
  10398. },
  10399. "text": {
  10400. "type": "string"
  10401. },
  10402. "synthetic": {
  10403. "type": "boolean"
  10404. },
  10405. "ignored": {
  10406. "type": "boolean"
  10407. },
  10408. "time": {
  10409. "type": "object",
  10410. "properties": {
  10411. "start": {
  10412. "type": "integer",
  10413. "minimum": 0
  10414. },
  10415. "end": {
  10416. "type": "integer",
  10417. "minimum": 0
  10418. }
  10419. },
  10420. "required": ["start"],
  10421. "additionalProperties": false
  10422. },
  10423. "metadata": {
  10424. "type": "object"
  10425. }
  10426. },
  10427. "required": ["id", "sessionID", "messageID", "type", "text"],
  10428. "additionalProperties": false
  10429. },
  10430. "SubtaskPart": {
  10431. "type": "object",
  10432. "properties": {
  10433. "id": {
  10434. "type": "string"
  10435. },
  10436. "sessionID": {
  10437. "type": "string"
  10438. },
  10439. "messageID": {
  10440. "type": "string"
  10441. },
  10442. "type": {
  10443. "type": "string",
  10444. "enum": ["subtask"]
  10445. },
  10446. "prompt": {
  10447. "type": "string"
  10448. },
  10449. "description": {
  10450. "type": "string"
  10451. },
  10452. "agent": {
  10453. "type": "string"
  10454. },
  10455. "model": {
  10456. "type": "object",
  10457. "properties": {
  10458. "providerID": {
  10459. "type": "string"
  10460. },
  10461. "modelID": {
  10462. "type": "string"
  10463. }
  10464. },
  10465. "required": ["providerID", "modelID"],
  10466. "additionalProperties": false
  10467. },
  10468. "command": {
  10469. "type": "string"
  10470. }
  10471. },
  10472. "required": ["id", "sessionID", "messageID", "type", "prompt", "description", "agent"],
  10473. "additionalProperties": false
  10474. },
  10475. "ReasoningPart": {
  10476. "type": "object",
  10477. "properties": {
  10478. "id": {
  10479. "type": "string"
  10480. },
  10481. "sessionID": {
  10482. "type": "string"
  10483. },
  10484. "messageID": {
  10485. "type": "string"
  10486. },
  10487. "type": {
  10488. "type": "string",
  10489. "enum": ["reasoning"]
  10490. },
  10491. "text": {
  10492. "type": "string"
  10493. },
  10494. "metadata": {
  10495. "type": "object"
  10496. },
  10497. "time": {
  10498. "type": "object",
  10499. "properties": {
  10500. "start": {
  10501. "type": "integer",
  10502. "minimum": 0
  10503. },
  10504. "end": {
  10505. "type": "integer",
  10506. "minimum": 0
  10507. }
  10508. },
  10509. "required": ["start"],
  10510. "additionalProperties": false
  10511. }
  10512. },
  10513. "required": ["id", "sessionID", "messageID", "type", "text", "time"],
  10514. "additionalProperties": false
  10515. },
  10516. "FilePartSourceText": {
  10517. "type": "object",
  10518. "properties": {
  10519. "value": {
  10520. "type": "string"
  10521. },
  10522. "start": {
  10523. "type": "integer",
  10524. "minimum": 0
  10525. },
  10526. "end": {
  10527. "type": "integer",
  10528. "minimum": 0
  10529. }
  10530. },
  10531. "required": ["value", "start", "end"],
  10532. "additionalProperties": false
  10533. },
  10534. "FileSource": {
  10535. "type": "object",
  10536. "properties": {
  10537. "text": {
  10538. "$ref": "#/components/schemas/FilePartSourceText"
  10539. },
  10540. "type": {
  10541. "type": "string",
  10542. "enum": ["file"]
  10543. },
  10544. "path": {
  10545. "type": "string"
  10546. }
  10547. },
  10548. "required": ["text", "type", "path"],
  10549. "additionalProperties": false
  10550. },
  10551. "Range": {
  10552. "type": "object",
  10553. "properties": {
  10554. "start": {
  10555. "type": "object",
  10556. "properties": {
  10557. "line": {
  10558. "type": "integer",
  10559. "minimum": 0
  10560. },
  10561. "character": {
  10562. "type": "integer",
  10563. "minimum": 0
  10564. }
  10565. },
  10566. "required": ["line", "character"],
  10567. "additionalProperties": false
  10568. },
  10569. "end": {
  10570. "type": "object",
  10571. "properties": {
  10572. "line": {
  10573. "type": "integer",
  10574. "minimum": 0
  10575. },
  10576. "character": {
  10577. "type": "integer",
  10578. "minimum": 0
  10579. }
  10580. },
  10581. "required": ["line", "character"],
  10582. "additionalProperties": false
  10583. }
  10584. },
  10585. "required": ["start", "end"],
  10586. "additionalProperties": false
  10587. },
  10588. "SymbolSource": {
  10589. "type": "object",
  10590. "properties": {
  10591. "text": {
  10592. "$ref": "#/components/schemas/FilePartSourceText"
  10593. },
  10594. "type": {
  10595. "type": "string",
  10596. "enum": ["symbol"]
  10597. },
  10598. "path": {
  10599. "type": "string"
  10600. },
  10601. "range": {
  10602. "$ref": "#/components/schemas/Range"
  10603. },
  10604. "name": {
  10605. "type": "string"
  10606. },
  10607. "kind": {
  10608. "type": "integer",
  10609. "minimum": 0
  10610. }
  10611. },
  10612. "required": ["text", "type", "path", "range", "name", "kind"],
  10613. "additionalProperties": false
  10614. },
  10615. "ResourceSource": {
  10616. "type": "object",
  10617. "properties": {
  10618. "text": {
  10619. "$ref": "#/components/schemas/FilePartSourceText"
  10620. },
  10621. "type": {
  10622. "type": "string",
  10623. "enum": ["resource"]
  10624. },
  10625. "clientName": {
  10626. "type": "string"
  10627. },
  10628. "uri": {
  10629. "type": "string"
  10630. }
  10631. },
  10632. "required": ["text", "type", "clientName", "uri"],
  10633. "additionalProperties": false
  10634. },
  10635. "FilePartSource": {
  10636. "anyOf": [
  10637. {
  10638. "$ref": "#/components/schemas/FileSource"
  10639. },
  10640. {
  10641. "$ref": "#/components/schemas/SymbolSource"
  10642. },
  10643. {
  10644. "$ref": "#/components/schemas/ResourceSource"
  10645. }
  10646. ]
  10647. },
  10648. "FilePart": {
  10649. "type": "object",
  10650. "properties": {
  10651. "id": {
  10652. "type": "string"
  10653. },
  10654. "sessionID": {
  10655. "type": "string"
  10656. },
  10657. "messageID": {
  10658. "type": "string"
  10659. },
  10660. "type": {
  10661. "type": "string",
  10662. "enum": ["file"]
  10663. },
  10664. "mime": {
  10665. "type": "string"
  10666. },
  10667. "filename": {
  10668. "type": "string"
  10669. },
  10670. "url": {
  10671. "type": "string"
  10672. },
  10673. "source": {
  10674. "$ref": "#/components/schemas/FilePartSource"
  10675. }
  10676. },
  10677. "required": ["id", "sessionID", "messageID", "type", "mime", "url"],
  10678. "additionalProperties": false
  10679. },
  10680. "ToolStatePending": {
  10681. "type": "object",
  10682. "properties": {
  10683. "status": {
  10684. "type": "string",
  10685. "enum": ["pending"]
  10686. },
  10687. "input": {
  10688. "type": "object"
  10689. },
  10690. "raw": {
  10691. "type": "string"
  10692. }
  10693. },
  10694. "required": ["status", "input", "raw"],
  10695. "additionalProperties": false
  10696. },
  10697. "ToolStateRunning": {
  10698. "type": "object",
  10699. "properties": {
  10700. "status": {
  10701. "type": "string",
  10702. "enum": ["running"]
  10703. },
  10704. "input": {
  10705. "type": "object"
  10706. },
  10707. "title": {
  10708. "type": "string"
  10709. },
  10710. "metadata": {
  10711. "type": "object"
  10712. },
  10713. "time": {
  10714. "type": "object",
  10715. "properties": {
  10716. "start": {
  10717. "type": "integer",
  10718. "minimum": 0
  10719. }
  10720. },
  10721. "required": ["start"],
  10722. "additionalProperties": false
  10723. }
  10724. },
  10725. "required": ["status", "input", "time"],
  10726. "additionalProperties": false
  10727. },
  10728. "ToolStateCompleted": {
  10729. "type": "object",
  10730. "properties": {
  10731. "status": {
  10732. "type": "string",
  10733. "enum": ["completed"]
  10734. },
  10735. "input": {
  10736. "type": "object"
  10737. },
  10738. "output": {
  10739. "type": "string"
  10740. },
  10741. "title": {
  10742. "type": "string"
  10743. },
  10744. "metadata": {
  10745. "type": "object"
  10746. },
  10747. "time": {
  10748. "type": "object",
  10749. "properties": {
  10750. "start": {
  10751. "type": "integer",
  10752. "minimum": 0
  10753. },
  10754. "end": {
  10755. "type": "integer",
  10756. "minimum": 0
  10757. },
  10758. "compacted": {
  10759. "type": "integer",
  10760. "minimum": 0
  10761. }
  10762. },
  10763. "required": ["start", "end"],
  10764. "additionalProperties": false
  10765. },
  10766. "attachments": {
  10767. "type": "array",
  10768. "items": {
  10769. "$ref": "#/components/schemas/FilePart"
  10770. }
  10771. }
  10772. },
  10773. "required": ["status", "input", "output", "title", "metadata", "time"],
  10774. "additionalProperties": false
  10775. },
  10776. "ToolStateError": {
  10777. "type": "object",
  10778. "properties": {
  10779. "status": {
  10780. "type": "string",
  10781. "enum": ["error"]
  10782. },
  10783. "input": {
  10784. "type": "object"
  10785. },
  10786. "error": {
  10787. "type": "string"
  10788. },
  10789. "metadata": {
  10790. "type": "object"
  10791. },
  10792. "time": {
  10793. "type": "object",
  10794. "properties": {
  10795. "start": {
  10796. "type": "integer",
  10797. "minimum": 0
  10798. },
  10799. "end": {
  10800. "type": "integer",
  10801. "minimum": 0
  10802. }
  10803. },
  10804. "required": ["start", "end"],
  10805. "additionalProperties": false
  10806. }
  10807. },
  10808. "required": ["status", "input", "error", "time"],
  10809. "additionalProperties": false
  10810. },
  10811. "ToolState": {
  10812. "anyOf": [
  10813. {
  10814. "$ref": "#/components/schemas/ToolStatePending"
  10815. },
  10816. {
  10817. "$ref": "#/components/schemas/ToolStateRunning"
  10818. },
  10819. {
  10820. "$ref": "#/components/schemas/ToolStateCompleted"
  10821. },
  10822. {
  10823. "$ref": "#/components/schemas/ToolStateError"
  10824. }
  10825. ]
  10826. },
  10827. "ToolPart": {
  10828. "type": "object",
  10829. "properties": {
  10830. "id": {
  10831. "type": "string"
  10832. },
  10833. "sessionID": {
  10834. "type": "string"
  10835. },
  10836. "messageID": {
  10837. "type": "string"
  10838. },
  10839. "type": {
  10840. "type": "string",
  10841. "enum": ["tool"]
  10842. },
  10843. "callID": {
  10844. "type": "string"
  10845. },
  10846. "tool": {
  10847. "type": "string"
  10848. },
  10849. "state": {
  10850. "$ref": "#/components/schemas/ToolState"
  10851. },
  10852. "metadata": {
  10853. "type": "object"
  10854. }
  10855. },
  10856. "required": ["id", "sessionID", "messageID", "type", "callID", "tool", "state"],
  10857. "additionalProperties": false
  10858. },
  10859. "StepStartPart": {
  10860. "type": "object",
  10861. "properties": {
  10862. "id": {
  10863. "type": "string"
  10864. },
  10865. "sessionID": {
  10866. "type": "string"
  10867. },
  10868. "messageID": {
  10869. "type": "string"
  10870. },
  10871. "type": {
  10872. "type": "string",
  10873. "enum": ["step-start"]
  10874. },
  10875. "snapshot": {
  10876. "type": "string"
  10877. }
  10878. },
  10879. "required": ["id", "sessionID", "messageID", "type"],
  10880. "additionalProperties": false
  10881. },
  10882. "StepFinishPart": {
  10883. "type": "object",
  10884. "properties": {
  10885. "id": {
  10886. "type": "string"
  10887. },
  10888. "sessionID": {
  10889. "type": "string"
  10890. },
  10891. "messageID": {
  10892. "type": "string"
  10893. },
  10894. "type": {
  10895. "type": "string",
  10896. "enum": ["step-finish"]
  10897. },
  10898. "reason": {
  10899. "type": "string"
  10900. },
  10901. "snapshot": {
  10902. "type": "string"
  10903. },
  10904. "cost": {
  10905. "type": "number"
  10906. },
  10907. "tokens": {
  10908. "type": "object",
  10909. "properties": {
  10910. "total": {
  10911. "type": "integer",
  10912. "minimum": 0
  10913. },
  10914. "input": {
  10915. "type": "integer",
  10916. "minimum": 0
  10917. },
  10918. "output": {
  10919. "type": "integer",
  10920. "minimum": 0
  10921. },
  10922. "reasoning": {
  10923. "type": "integer",
  10924. "minimum": 0
  10925. },
  10926. "cache": {
  10927. "type": "object",
  10928. "properties": {
  10929. "read": {
  10930. "type": "integer",
  10931. "minimum": 0
  10932. },
  10933. "write": {
  10934. "type": "integer",
  10935. "minimum": 0
  10936. }
  10937. },
  10938. "required": ["read", "write"],
  10939. "additionalProperties": false
  10940. }
  10941. },
  10942. "required": ["input", "output", "reasoning", "cache"],
  10943. "additionalProperties": false
  10944. }
  10945. },
  10946. "required": ["id", "sessionID", "messageID", "type", "reason", "cost", "tokens"],
  10947. "additionalProperties": false
  10948. },
  10949. "SnapshotPart": {
  10950. "type": "object",
  10951. "properties": {
  10952. "id": {
  10953. "type": "string"
  10954. },
  10955. "sessionID": {
  10956. "type": "string"
  10957. },
  10958. "messageID": {
  10959. "type": "string"
  10960. },
  10961. "type": {
  10962. "type": "string",
  10963. "enum": ["snapshot"]
  10964. },
  10965. "snapshot": {
  10966. "type": "string"
  10967. }
  10968. },
  10969. "required": ["id", "sessionID", "messageID", "type", "snapshot"],
  10970. "additionalProperties": false
  10971. },
  10972. "PatchPart": {
  10973. "type": "object",
  10974. "properties": {
  10975. "id": {
  10976. "type": "string"
  10977. },
  10978. "sessionID": {
  10979. "type": "string"
  10980. },
  10981. "messageID": {
  10982. "type": "string"
  10983. },
  10984. "type": {
  10985. "type": "string",
  10986. "enum": ["patch"]
  10987. },
  10988. "hash": {
  10989. "type": "string"
  10990. },
  10991. "files": {
  10992. "type": "array",
  10993. "items": {
  10994. "type": "string"
  10995. }
  10996. }
  10997. },
  10998. "required": ["id", "sessionID", "messageID", "type", "hash", "files"],
  10999. "additionalProperties": false
  11000. },
  11001. "AgentPart": {
  11002. "type": "object",
  11003. "properties": {
  11004. "id": {
  11005. "type": "string"
  11006. },
  11007. "sessionID": {
  11008. "type": "string"
  11009. },
  11010. "messageID": {
  11011. "type": "string"
  11012. },
  11013. "type": {
  11014. "type": "string",
  11015. "enum": ["agent"]
  11016. },
  11017. "name": {
  11018. "type": "string"
  11019. },
  11020. "source": {
  11021. "type": "object",
  11022. "properties": {
  11023. "value": {
  11024. "type": "string"
  11025. },
  11026. "start": {
  11027. "type": "integer",
  11028. "minimum": 0
  11029. },
  11030. "end": {
  11031. "type": "integer",
  11032. "minimum": 0
  11033. }
  11034. },
  11035. "required": ["value", "start", "end"],
  11036. "additionalProperties": false
  11037. }
  11038. },
  11039. "required": ["id", "sessionID", "messageID", "type", "name"],
  11040. "additionalProperties": false
  11041. },
  11042. "RetryPart": {
  11043. "type": "object",
  11044. "properties": {
  11045. "id": {
  11046. "type": "string"
  11047. },
  11048. "sessionID": {
  11049. "type": "string"
  11050. },
  11051. "messageID": {
  11052. "type": "string"
  11053. },
  11054. "type": {
  11055. "type": "string",
  11056. "enum": ["retry"]
  11057. },
  11058. "attempt": {
  11059. "type": "integer",
  11060. "minimum": 0
  11061. },
  11062. "error": {
  11063. "$ref": "#/components/schemas/APIError"
  11064. },
  11065. "time": {
  11066. "type": "object",
  11067. "properties": {
  11068. "created": {
  11069. "type": "integer",
  11070. "minimum": 0
  11071. }
  11072. },
  11073. "required": ["created"],
  11074. "additionalProperties": false
  11075. }
  11076. },
  11077. "required": ["id", "sessionID", "messageID", "type", "attempt", "error", "time"],
  11078. "additionalProperties": false
  11079. },
  11080. "CompactionPart": {
  11081. "type": "object",
  11082. "properties": {
  11083. "id": {
  11084. "type": "string"
  11085. },
  11086. "sessionID": {
  11087. "type": "string"
  11088. },
  11089. "messageID": {
  11090. "type": "string"
  11091. },
  11092. "type": {
  11093. "type": "string",
  11094. "enum": ["compaction"]
  11095. },
  11096. "auto": {
  11097. "type": "boolean"
  11098. },
  11099. "overflow": {
  11100. "type": "boolean"
  11101. },
  11102. "tail_start_id": {
  11103. "type": "string"
  11104. }
  11105. },
  11106. "required": ["id", "sessionID", "messageID", "type", "auto"],
  11107. "additionalProperties": false
  11108. },
  11109. "Part": {
  11110. "anyOf": [
  11111. {
  11112. "$ref": "#/components/schemas/TextPart"
  11113. },
  11114. {
  11115. "$ref": "#/components/schemas/SubtaskPart"
  11116. },
  11117. {
  11118. "$ref": "#/components/schemas/ReasoningPart"
  11119. },
  11120. {
  11121. "$ref": "#/components/schemas/FilePart"
  11122. },
  11123. {
  11124. "$ref": "#/components/schemas/ToolPart"
  11125. },
  11126. {
  11127. "$ref": "#/components/schemas/StepStartPart"
  11128. },
  11129. {
  11130. "$ref": "#/components/schemas/StepFinishPart"
  11131. },
  11132. {
  11133. "$ref": "#/components/schemas/SnapshotPart"
  11134. },
  11135. {
  11136. "$ref": "#/components/schemas/PatchPart"
  11137. },
  11138. {
  11139. "$ref": "#/components/schemas/AgentPart"
  11140. },
  11141. {
  11142. "$ref": "#/components/schemas/RetryPart"
  11143. },
  11144. {
  11145. "$ref": "#/components/schemas/CompactionPart"
  11146. }
  11147. ]
  11148. },
  11149. "PermissionAction": {
  11150. "type": "string",
  11151. "enum": ["allow", "deny", "ask"]
  11152. },
  11153. "PermissionRule": {
  11154. "type": "object",
  11155. "properties": {
  11156. "permission": {
  11157. "type": "string"
  11158. },
  11159. "pattern": {
  11160. "type": "string"
  11161. },
  11162. "action": {
  11163. "$ref": "#/components/schemas/PermissionAction"
  11164. }
  11165. },
  11166. "required": ["permission", "pattern", "action"],
  11167. "additionalProperties": false
  11168. },
  11169. "PermissionRuleset": {
  11170. "type": "array",
  11171. "items": {
  11172. "$ref": "#/components/schemas/PermissionRule"
  11173. }
  11174. },
  11175. "Session": {
  11176. "type": "object",
  11177. "properties": {
  11178. "id": {
  11179. "type": "string"
  11180. },
  11181. "slug": {
  11182. "type": "string"
  11183. },
  11184. "projectID": {
  11185. "type": "string"
  11186. },
  11187. "workspaceID": {
  11188. "type": "string"
  11189. },
  11190. "directory": {
  11191. "type": "string"
  11192. },
  11193. "path": {
  11194. "type": "string"
  11195. },
  11196. "parentID": {
  11197. "type": "string"
  11198. },
  11199. "summary": {
  11200. "type": "object",
  11201. "properties": {
  11202. "additions": {
  11203. "type": "integer",
  11204. "minimum": 0
  11205. },
  11206. "deletions": {
  11207. "type": "integer",
  11208. "minimum": 0
  11209. },
  11210. "files": {
  11211. "type": "integer",
  11212. "minimum": 0
  11213. },
  11214. "diffs": {
  11215. "type": "array",
  11216. "items": {
  11217. "$ref": "#/components/schemas/SnapshotFileDiff"
  11218. }
  11219. }
  11220. },
  11221. "required": ["additions", "deletions", "files"],
  11222. "additionalProperties": false
  11223. },
  11224. "share": {
  11225. "type": "object",
  11226. "properties": {
  11227. "url": {
  11228. "type": "string"
  11229. }
  11230. },
  11231. "required": ["url"],
  11232. "additionalProperties": false
  11233. },
  11234. "title": {
  11235. "type": "string"
  11236. },
  11237. "agent": {
  11238. "type": "string"
  11239. },
  11240. "model": {
  11241. "type": "object",
  11242. "properties": {
  11243. "id": {
  11244. "type": "string"
  11245. },
  11246. "providerID": {
  11247. "type": "string"
  11248. },
  11249. "variant": {
  11250. "type": "string"
  11251. }
  11252. },
  11253. "required": ["id", "providerID"],
  11254. "additionalProperties": false
  11255. },
  11256. "version": {
  11257. "type": "string"
  11258. },
  11259. "time": {
  11260. "type": "object",
  11261. "properties": {
  11262. "created": {
  11263. "type": "integer",
  11264. "minimum": 0
  11265. },
  11266. "updated": {
  11267. "type": "integer",
  11268. "minimum": 0
  11269. },
  11270. "compacting": {
  11271. "type": "integer",
  11272. "minimum": 0
  11273. },
  11274. "archived": {
  11275. "type": "number"
  11276. }
  11277. },
  11278. "required": ["created", "updated"],
  11279. "additionalProperties": false
  11280. },
  11281. "permission": {
  11282. "$ref": "#/components/schemas/PermissionRuleset"
  11283. },
  11284. "revert": {
  11285. "type": "object",
  11286. "properties": {
  11287. "messageID": {
  11288. "type": "string"
  11289. },
  11290. "partID": {
  11291. "type": "string"
  11292. },
  11293. "snapshot": {
  11294. "type": "string"
  11295. },
  11296. "diff": {
  11297. "type": "string"
  11298. }
  11299. },
  11300. "required": ["messageID"],
  11301. "additionalProperties": false
  11302. }
  11303. },
  11304. "required": ["id", "slug", "projectID", "directory", "title", "version", "time"],
  11305. "additionalProperties": false
  11306. },
  11307. "Prompt": {
  11308. "type": "object",
  11309. "properties": {
  11310. "text": {
  11311. "type": "string"
  11312. },
  11313. "files": {
  11314. "type": "array",
  11315. "items": {
  11316. "$ref": "#/components/schemas/PromptFileAttachment"
  11317. }
  11318. },
  11319. "agents": {
  11320. "type": "array",
  11321. "items": {
  11322. "$ref": "#/components/schemas/PromptAgentAttachment"
  11323. }
  11324. }
  11325. },
  11326. "required": ["text"],
  11327. "additionalProperties": false
  11328. },
  11329. "GlobalEvent": {
  11330. "type": "object",
  11331. "properties": {
  11332. "directory": {
  11333. "type": "string"
  11334. },
  11335. "project": {
  11336. "type": "string"
  11337. },
  11338. "workspace": {
  11339. "type": "string"
  11340. },
  11341. "payload": {
  11342. "anyOf": [
  11343. {
  11344. "$ref": "#/components/schemas/EventServerInstanceDisposed"
  11345. },
  11346. {
  11347. "$ref": "#/components/schemas/EventFileEdited"
  11348. },
  11349. {
  11350. "$ref": "#/components/schemas/EventFileWatcherUpdated"
  11351. },
  11352. {
  11353. "$ref": "#/components/schemas/EventLspClientDiagnostics"
  11354. },
  11355. {
  11356. "$ref": "#/components/schemas/EventLspUpdated"
  11357. },
  11358. {
  11359. "$ref": "#/components/schemas/EventMessagePartDelta"
  11360. },
  11361. {
  11362. "$ref": "#/components/schemas/EventPermissionAsked"
  11363. },
  11364. {
  11365. "$ref": "#/components/schemas/EventPermissionReplied"
  11366. },
  11367. {
  11368. "$ref": "#/components/schemas/EventSessionDiff"
  11369. },
  11370. {
  11371. "$ref": "#/components/schemas/EventSessionError"
  11372. },
  11373. {
  11374. "$ref": "#/components/schemas/EventInstallationUpdated"
  11375. },
  11376. {
  11377. "$ref": "#/components/schemas/EventInstallationUpdate-available"
  11378. },
  11379. {
  11380. "$ref": "#/components/schemas/EventQuestionAsked"
  11381. },
  11382. {
  11383. "$ref": "#/components/schemas/EventQuestionReplied"
  11384. },
  11385. {
  11386. "$ref": "#/components/schemas/EventQuestionRejected"
  11387. },
  11388. {
  11389. "$ref": "#/components/schemas/EventTodoUpdated"
  11390. },
  11391. {
  11392. "$ref": "#/components/schemas/EventSessionStatus"
  11393. },
  11394. {
  11395. "$ref": "#/components/schemas/EventSessionIdle"
  11396. },
  11397. {
  11398. "$ref": "#/components/schemas/EventSessionCompacted"
  11399. },
  11400. {
  11401. "$ref": "#/components/schemas/Event.tui.prompt.append"
  11402. },
  11403. {
  11404. "$ref": "#/components/schemas/Event.tui.command.execute"
  11405. },
  11406. {
  11407. "$ref": "#/components/schemas/Event.tui.toast.show"
  11408. },
  11409. {
  11410. "$ref": "#/components/schemas/Event.tui.session.select"
  11411. },
  11412. {
  11413. "$ref": "#/components/schemas/EventMcpToolsChanged"
  11414. },
  11415. {
  11416. "$ref": "#/components/schemas/EventMcpBrowserOpenFailed"
  11417. },
  11418. {
  11419. "$ref": "#/components/schemas/EventCommandExecuted"
  11420. },
  11421. {
  11422. "$ref": "#/components/schemas/EventProjectUpdated"
  11423. },
  11424. {
  11425. "$ref": "#/components/schemas/EventVcsBranchUpdated"
  11426. },
  11427. {
  11428. "$ref": "#/components/schemas/EventWorkspaceReady"
  11429. },
  11430. {
  11431. "$ref": "#/components/schemas/EventWorkspaceFailed"
  11432. },
  11433. {
  11434. "$ref": "#/components/schemas/EventWorkspaceStatus"
  11435. },
  11436. {
  11437. "$ref": "#/components/schemas/EventWorktreeReady"
  11438. },
  11439. {
  11440. "$ref": "#/components/schemas/EventWorktreeFailed"
  11441. },
  11442. {
  11443. "$ref": "#/components/schemas/EventPtyCreated"
  11444. },
  11445. {
  11446. "$ref": "#/components/schemas/EventPtyUpdated"
  11447. },
  11448. {
  11449. "$ref": "#/components/schemas/EventPtyExited"
  11450. },
  11451. {
  11452. "$ref": "#/components/schemas/EventPtyDeleted"
  11453. },
  11454. {
  11455. "$ref": "#/components/schemas/EventMessageUpdated"
  11456. },
  11457. {
  11458. "$ref": "#/components/schemas/EventMessageRemoved"
  11459. },
  11460. {
  11461. "$ref": "#/components/schemas/EventMessagePartUpdated"
  11462. },
  11463. {
  11464. "$ref": "#/components/schemas/EventMessagePartRemoved"
  11465. },
  11466. {
  11467. "$ref": "#/components/schemas/EventSessionCreated"
  11468. },
  11469. {
  11470. "$ref": "#/components/schemas/EventSessionUpdated"
  11471. },
  11472. {
  11473. "$ref": "#/components/schemas/EventSessionDeleted"
  11474. },
  11475. {
  11476. "$ref": "#/components/schemas/EventSessionNextAgentSwitched"
  11477. },
  11478. {
  11479. "$ref": "#/components/schemas/EventSessionNextModelSwitched"
  11480. },
  11481. {
  11482. "$ref": "#/components/schemas/EventSessionNextPrompted"
  11483. },
  11484. {
  11485. "$ref": "#/components/schemas/EventSessionNextSynthetic"
  11486. },
  11487. {
  11488. "$ref": "#/components/schemas/EventSessionNextShellStarted"
  11489. },
  11490. {
  11491. "$ref": "#/components/schemas/EventSessionNextShellEnded"
  11492. },
  11493. {
  11494. "$ref": "#/components/schemas/EventSessionNextStepStarted"
  11495. },
  11496. {
  11497. "$ref": "#/components/schemas/EventSessionNextStepEnded"
  11498. },
  11499. {
  11500. "$ref": "#/components/schemas/EventSessionNextStepFailed"
  11501. },
  11502. {
  11503. "$ref": "#/components/schemas/EventSessionNextTextStarted"
  11504. },
  11505. {
  11506. "$ref": "#/components/schemas/EventSessionNextTextDelta"
  11507. },
  11508. {
  11509. "$ref": "#/components/schemas/EventSessionNextTextEnded"
  11510. },
  11511. {
  11512. "$ref": "#/components/schemas/EventSessionNextReasoningStarted"
  11513. },
  11514. {
  11515. "$ref": "#/components/schemas/EventSessionNextReasoningDelta"
  11516. },
  11517. {
  11518. "$ref": "#/components/schemas/EventSessionNextReasoningEnded"
  11519. },
  11520. {
  11521. "$ref": "#/components/schemas/EventSessionNextToolInputStarted"
  11522. },
  11523. {
  11524. "$ref": "#/components/schemas/EventSessionNextToolInputDelta"
  11525. },
  11526. {
  11527. "$ref": "#/components/schemas/EventSessionNextToolInputEnded"
  11528. },
  11529. {
  11530. "$ref": "#/components/schemas/EventSessionNextToolCalled"
  11531. },
  11532. {
  11533. "$ref": "#/components/schemas/EventSessionNextToolProgress"
  11534. },
  11535. {
  11536. "$ref": "#/components/schemas/EventSessionNextToolSuccess"
  11537. },
  11538. {
  11539. "$ref": "#/components/schemas/EventSessionNextToolFailed"
  11540. },
  11541. {
  11542. "$ref": "#/components/schemas/EventSessionNextRetried"
  11543. },
  11544. {
  11545. "$ref": "#/components/schemas/EventSessionNextCompactionStarted"
  11546. },
  11547. {
  11548. "$ref": "#/components/schemas/EventSessionNextCompactionDelta"
  11549. },
  11550. {
  11551. "$ref": "#/components/schemas/EventSessionNextCompactionEnded"
  11552. },
  11553. {
  11554. "$ref": "#/components/schemas/EventServerConnected"
  11555. },
  11556. {
  11557. "$ref": "#/components/schemas/EventGlobalDisposed"
  11558. },
  11559. {
  11560. "$ref": "#/components/schemas/SyncEventMessageUpdated"
  11561. },
  11562. {
  11563. "$ref": "#/components/schemas/SyncEventMessageRemoved"
  11564. },
  11565. {
  11566. "$ref": "#/components/schemas/SyncEventMessagePartUpdated"
  11567. },
  11568. {
  11569. "$ref": "#/components/schemas/SyncEventMessagePartRemoved"
  11570. },
  11571. {
  11572. "$ref": "#/components/schemas/SyncEventSessionCreated"
  11573. },
  11574. {
  11575. "$ref": "#/components/schemas/SyncEventSessionUpdated"
  11576. },
  11577. {
  11578. "$ref": "#/components/schemas/SyncEventSessionDeleted"
  11579. },
  11580. {
  11581. "$ref": "#/components/schemas/SyncEventSessionNextAgentSwitched"
  11582. },
  11583. {
  11584. "$ref": "#/components/schemas/SyncEventSessionNextModelSwitched"
  11585. },
  11586. {
  11587. "$ref": "#/components/schemas/SyncEventSessionNextPrompted"
  11588. },
  11589. {
  11590. "$ref": "#/components/schemas/SyncEventSessionNextSynthetic"
  11591. },
  11592. {
  11593. "$ref": "#/components/schemas/SyncEventSessionNextShellStarted"
  11594. },
  11595. {
  11596. "$ref": "#/components/schemas/SyncEventSessionNextShellEnded"
  11597. },
  11598. {
  11599. "$ref": "#/components/schemas/SyncEventSessionNextStepStarted"
  11600. },
  11601. {
  11602. "$ref": "#/components/schemas/SyncEventSessionNextStepEnded"
  11603. },
  11604. {
  11605. "$ref": "#/components/schemas/SyncEventSessionNextStepFailed"
  11606. },
  11607. {
  11608. "$ref": "#/components/schemas/SyncEventSessionNextTextStarted"
  11609. },
  11610. {
  11611. "$ref": "#/components/schemas/SyncEventSessionNextTextDelta"
  11612. },
  11613. {
  11614. "$ref": "#/components/schemas/SyncEventSessionNextTextEnded"
  11615. },
  11616. {
  11617. "$ref": "#/components/schemas/SyncEventSessionNextReasoningStarted"
  11618. },
  11619. {
  11620. "$ref": "#/components/schemas/SyncEventSessionNextReasoningDelta"
  11621. },
  11622. {
  11623. "$ref": "#/components/schemas/SyncEventSessionNextReasoningEnded"
  11624. },
  11625. {
  11626. "$ref": "#/components/schemas/SyncEventSessionNextToolInputStarted"
  11627. },
  11628. {
  11629. "$ref": "#/components/schemas/SyncEventSessionNextToolInputDelta"
  11630. },
  11631. {
  11632. "$ref": "#/components/schemas/SyncEventSessionNextToolInputEnded"
  11633. },
  11634. {
  11635. "$ref": "#/components/schemas/SyncEventSessionNextToolCalled"
  11636. },
  11637. {
  11638. "$ref": "#/components/schemas/SyncEventSessionNextToolProgress"
  11639. },
  11640. {
  11641. "$ref": "#/components/schemas/SyncEventSessionNextToolSuccess"
  11642. },
  11643. {
  11644. "$ref": "#/components/schemas/SyncEventSessionNextToolFailed"
  11645. },
  11646. {
  11647. "$ref": "#/components/schemas/SyncEventSessionNextRetried"
  11648. },
  11649. {
  11650. "$ref": "#/components/schemas/SyncEventSessionNextCompactionStarted"
  11651. },
  11652. {
  11653. "$ref": "#/components/schemas/SyncEventSessionNextCompactionDelta"
  11654. },
  11655. {
  11656. "$ref": "#/components/schemas/SyncEventSessionNextCompactionEnded"
  11657. }
  11658. ]
  11659. }
  11660. },
  11661. "required": ["directory", "payload"],
  11662. "additionalProperties": false
  11663. },
  11664. "LogLevel": {
  11665. "type": "string",
  11666. "enum": ["DEBUG", "INFO", "WARN", "ERROR"],
  11667. "description": "Log level"
  11668. },
  11669. "ServerConfig": {
  11670. "type": "object",
  11671. "properties": {
  11672. "port": {
  11673. "type": "integer",
  11674. "exclusiveMinimum": 0
  11675. },
  11676. "hostname": {
  11677. "type": "string"
  11678. },
  11679. "mdns": {
  11680. "type": "boolean"
  11681. },
  11682. "mdnsDomain": {
  11683. "type": "string"
  11684. },
  11685. "cors": {
  11686. "type": "array",
  11687. "items": {
  11688. "type": "string"
  11689. }
  11690. }
  11691. },
  11692. "additionalProperties": false,
  11693. "description": "Server configuration for opencode serve and web commands"
  11694. },
  11695. "PermissionActionConfig": {
  11696. "type": "string",
  11697. "enum": ["ask", "allow", "deny"]
  11698. },
  11699. "PermissionObjectConfig": {
  11700. "type": "object",
  11701. "additionalProperties": {
  11702. "$ref": "#/components/schemas/PermissionActionConfig"
  11703. }
  11704. },
  11705. "PermissionRuleConfig": {
  11706. "anyOf": [
  11707. {
  11708. "$ref": "#/components/schemas/PermissionActionConfig"
  11709. },
  11710. {
  11711. "$ref": "#/components/schemas/PermissionObjectConfig"
  11712. }
  11713. ]
  11714. },
  11715. "PermissionConfig": {
  11716. "anyOf": [
  11717. {
  11718. "$ref": "#/components/schemas/PermissionActionConfig"
  11719. },
  11720. {
  11721. "type": "object",
  11722. "properties": {
  11723. "read": {
  11724. "$ref": "#/components/schemas/PermissionRuleConfig"
  11725. },
  11726. "edit": {
  11727. "$ref": "#/components/schemas/PermissionRuleConfig"
  11728. },
  11729. "glob": {
  11730. "$ref": "#/components/schemas/PermissionRuleConfig"
  11731. },
  11732. "grep": {
  11733. "$ref": "#/components/schemas/PermissionRuleConfig"
  11734. },
  11735. "list": {
  11736. "$ref": "#/components/schemas/PermissionRuleConfig"
  11737. },
  11738. "bash": {
  11739. "$ref": "#/components/schemas/PermissionRuleConfig"
  11740. },
  11741. "task": {
  11742. "$ref": "#/components/schemas/PermissionRuleConfig"
  11743. },
  11744. "external_directory": {
  11745. "$ref": "#/components/schemas/PermissionRuleConfig"
  11746. },
  11747. "todowrite": {
  11748. "$ref": "#/components/schemas/PermissionActionConfig"
  11749. },
  11750. "question": {
  11751. "$ref": "#/components/schemas/PermissionActionConfig"
  11752. },
  11753. "webfetch": {
  11754. "$ref": "#/components/schemas/PermissionActionConfig"
  11755. },
  11756. "websearch": {
  11757. "$ref": "#/components/schemas/PermissionActionConfig"
  11758. },
  11759. "lsp": {
  11760. "$ref": "#/components/schemas/PermissionRuleConfig"
  11761. },
  11762. "doom_loop": {
  11763. "$ref": "#/components/schemas/PermissionActionConfig"
  11764. },
  11765. "skill": {
  11766. "$ref": "#/components/schemas/PermissionRuleConfig"
  11767. }
  11768. },
  11769. "additionalProperties": {
  11770. "$ref": "#/components/schemas/PermissionRuleConfig"
  11771. }
  11772. }
  11773. ]
  11774. },
  11775. "AgentConfig": {
  11776. "type": "object",
  11777. "properties": {
  11778. "model": {
  11779. "type": "string"
  11780. },
  11781. "variant": {
  11782. "type": "string"
  11783. },
  11784. "temperature": {
  11785. "type": "number"
  11786. },
  11787. "top_p": {
  11788. "type": "number"
  11789. },
  11790. "prompt": {
  11791. "type": "string"
  11792. },
  11793. "tools": {
  11794. "type": "object",
  11795. "additionalProperties": {
  11796. "type": "boolean"
  11797. }
  11798. },
  11799. "disable": {
  11800. "type": "boolean"
  11801. },
  11802. "description": {
  11803. "type": "string"
  11804. },
  11805. "mode": {
  11806. "type": "string",
  11807. "enum": ["subagent", "primary", "all"]
  11808. },
  11809. "hidden": {
  11810. "type": "boolean"
  11811. },
  11812. "options": {
  11813. "type": "object"
  11814. },
  11815. "color": {
  11816. "anyOf": [
  11817. {
  11818. "type": "string",
  11819. "pattern": "^#[0-9a-fA-F]{6}$"
  11820. },
  11821. {
  11822. "type": "string",
  11823. "enum": ["primary", "secondary", "accent", "success", "warning", "error", "info"]
  11824. }
  11825. ],
  11826. "description": "Hex color code (e.g., #FF5733) or theme color (e.g., primary)"
  11827. },
  11828. "steps": {
  11829. "type": "integer",
  11830. "exclusiveMinimum": 0
  11831. },
  11832. "maxSteps": {
  11833. "type": "integer",
  11834. "exclusiveMinimum": 0
  11835. },
  11836. "permission": {
  11837. "$ref": "#/components/schemas/PermissionConfig"
  11838. }
  11839. },
  11840. "additionalProperties": {}
  11841. },
  11842. "ProviderConfig": {
  11843. "type": "object",
  11844. "properties": {
  11845. "api": {
  11846. "type": "string"
  11847. },
  11848. "name": {
  11849. "type": "string"
  11850. },
  11851. "env": {
  11852. "type": "array",
  11853. "items": {
  11854. "type": "string"
  11855. }
  11856. },
  11857. "id": {
  11858. "type": "string"
  11859. },
  11860. "npm": {
  11861. "type": "string"
  11862. },
  11863. "whitelist": {
  11864. "type": "array",
  11865. "items": {
  11866. "type": "string"
  11867. }
  11868. },
  11869. "blacklist": {
  11870. "type": "array",
  11871. "items": {
  11872. "type": "string"
  11873. }
  11874. },
  11875. "options": {
  11876. "type": "object",
  11877. "properties": {
  11878. "apiKey": {
  11879. "type": "string"
  11880. },
  11881. "baseURL": {
  11882. "type": "string"
  11883. },
  11884. "enterpriseUrl": {
  11885. "type": "string"
  11886. },
  11887. "setCacheKey": {
  11888. "type": "boolean"
  11889. },
  11890. "timeout": {
  11891. "anyOf": [
  11892. {
  11893. "type": "integer",
  11894. "exclusiveMinimum": 0
  11895. },
  11896. {
  11897. "type": "boolean",
  11898. "enum": [false]
  11899. }
  11900. ],
  11901. "description": "Timeout in milliseconds for requests to this provider. Default is 300000 (5 minutes). Set to false to disable timeout."
  11902. },
  11903. "chunkTimeout": {
  11904. "type": "integer",
  11905. "exclusiveMinimum": 0
  11906. }
  11907. },
  11908. "additionalProperties": {}
  11909. },
  11910. "models": {
  11911. "type": "object",
  11912. "additionalProperties": {
  11913. "type": "object",
  11914. "properties": {
  11915. "id": {
  11916. "type": "string"
  11917. },
  11918. "name": {
  11919. "type": "string"
  11920. },
  11921. "family": {
  11922. "type": "string"
  11923. },
  11924. "release_date": {
  11925. "type": "string"
  11926. },
  11927. "attachment": {
  11928. "type": "boolean"
  11929. },
  11930. "reasoning": {
  11931. "type": "boolean"
  11932. },
  11933. "temperature": {
  11934. "type": "boolean"
  11935. },
  11936. "tool_call": {
  11937. "type": "boolean"
  11938. },
  11939. "interleaved": {
  11940. "anyOf": [
  11941. {
  11942. "type": "boolean",
  11943. "enum": [true]
  11944. },
  11945. {
  11946. "type": "object",
  11947. "properties": {
  11948. "field": {
  11949. "type": "string",
  11950. "enum": ["reasoning_content", "reasoning_details"]
  11951. }
  11952. },
  11953. "required": ["field"],
  11954. "additionalProperties": false
  11955. }
  11956. ]
  11957. },
  11958. "cost": {
  11959. "type": "object",
  11960. "properties": {
  11961. "input": {
  11962. "type": "number"
  11963. },
  11964. "output": {
  11965. "type": "number"
  11966. },
  11967. "cache_read": {
  11968. "type": "number"
  11969. },
  11970. "cache_write": {
  11971. "type": "number"
  11972. },
  11973. "context_over_200k": {
  11974. "type": "object",
  11975. "properties": {
  11976. "input": {
  11977. "type": "number"
  11978. },
  11979. "output": {
  11980. "type": "number"
  11981. },
  11982. "cache_read": {
  11983. "type": "number"
  11984. },
  11985. "cache_write": {
  11986. "type": "number"
  11987. }
  11988. },
  11989. "required": ["input", "output"],
  11990. "additionalProperties": false
  11991. }
  11992. },
  11993. "required": ["input", "output"],
  11994. "additionalProperties": false
  11995. },
  11996. "limit": {
  11997. "type": "object",
  11998. "properties": {
  11999. "context": {
  12000. "type": "number"
  12001. },
  12002. "input": {
  12003. "type": "number"
  12004. },
  12005. "output": {
  12006. "type": "number"
  12007. }
  12008. },
  12009. "required": ["context", "output"],
  12010. "additionalProperties": false
  12011. },
  12012. "modalities": {
  12013. "type": "object",
  12014. "properties": {
  12015. "input": {
  12016. "type": "array",
  12017. "items": {
  12018. "type": "string",
  12019. "enum": ["text", "audio", "image", "video", "pdf"]
  12020. }
  12021. },
  12022. "output": {
  12023. "type": "array",
  12024. "items": {
  12025. "type": "string",
  12026. "enum": ["text", "audio", "image", "video", "pdf"]
  12027. }
  12028. }
  12029. },
  12030. "required": ["input", "output"],
  12031. "additionalProperties": false
  12032. },
  12033. "experimental": {
  12034. "type": "boolean"
  12035. },
  12036. "status": {
  12037. "type": "string",
  12038. "enum": ["alpha", "beta", "deprecated"]
  12039. },
  12040. "provider": {
  12041. "type": "object",
  12042. "properties": {
  12043. "npm": {
  12044. "type": "string"
  12045. },
  12046. "api": {
  12047. "type": "string"
  12048. }
  12049. },
  12050. "additionalProperties": false
  12051. },
  12052. "options": {
  12053. "type": "object"
  12054. },
  12055. "headers": {
  12056. "type": "object",
  12057. "additionalProperties": {
  12058. "type": "string"
  12059. }
  12060. },
  12061. "variants": {
  12062. "type": "object",
  12063. "additionalProperties": {
  12064. "type": "object",
  12065. "properties": {
  12066. "disabled": {
  12067. "type": "boolean"
  12068. }
  12069. },
  12070. "additionalProperties": {}
  12071. },
  12072. "description": "Variant-specific configuration"
  12073. }
  12074. },
  12075. "additionalProperties": false
  12076. }
  12077. }
  12078. },
  12079. "additionalProperties": false
  12080. },
  12081. "McpLocalConfig": {
  12082. "type": "object",
  12083. "properties": {
  12084. "type": {
  12085. "type": "string",
  12086. "enum": ["local"],
  12087. "description": "Type of MCP server connection"
  12088. },
  12089. "command": {
  12090. "type": "array",
  12091. "items": {
  12092. "type": "string"
  12093. },
  12094. "description": "Command and arguments to run the MCP server"
  12095. },
  12096. "environment": {
  12097. "type": "object",
  12098. "additionalProperties": {
  12099. "type": "string"
  12100. }
  12101. },
  12102. "enabled": {
  12103. "type": "boolean"
  12104. },
  12105. "timeout": {
  12106. "type": "integer",
  12107. "exclusiveMinimum": 0
  12108. }
  12109. },
  12110. "required": ["type", "command"],
  12111. "additionalProperties": false
  12112. },
  12113. "McpOAuthConfig": {
  12114. "type": "object",
  12115. "properties": {
  12116. "clientId": {
  12117. "type": "string"
  12118. },
  12119. "clientSecret": {
  12120. "type": "string"
  12121. },
  12122. "scope": {
  12123. "type": "string"
  12124. },
  12125. "redirectUri": {
  12126. "type": "string"
  12127. }
  12128. },
  12129. "additionalProperties": false
  12130. },
  12131. "McpRemoteConfig": {
  12132. "type": "object",
  12133. "properties": {
  12134. "type": {
  12135. "type": "string",
  12136. "enum": ["remote"],
  12137. "description": "Type of MCP server connection"
  12138. },
  12139. "url": {
  12140. "type": "string",
  12141. "description": "URL of the remote MCP server"
  12142. },
  12143. "enabled": {
  12144. "type": "boolean"
  12145. },
  12146. "headers": {
  12147. "type": "object",
  12148. "additionalProperties": {
  12149. "type": "string"
  12150. }
  12151. },
  12152. "oauth": {
  12153. "anyOf": [
  12154. {
  12155. "$ref": "#/components/schemas/McpOAuthConfig"
  12156. },
  12157. {
  12158. "type": "boolean",
  12159. "enum": [false]
  12160. }
  12161. ],
  12162. "description": "OAuth authentication configuration for the MCP server. Set to false to disable OAuth auto-detection."
  12163. },
  12164. "timeout": {
  12165. "type": "integer",
  12166. "exclusiveMinimum": 0
  12167. }
  12168. },
  12169. "required": ["type", "url"],
  12170. "additionalProperties": false
  12171. },
  12172. "LayoutConfig": {
  12173. "type": "string",
  12174. "enum": ["auto", "stretch"],
  12175. "description": "@deprecated Always uses stretch layout."
  12176. },
  12177. "Config": {
  12178. "type": "object",
  12179. "properties": {
  12180. "$schema": {
  12181. "type": "string"
  12182. },
  12183. "shell": {
  12184. "type": "string"
  12185. },
  12186. "logLevel": {
  12187. "$ref": "#/components/schemas/LogLevel"
  12188. },
  12189. "server": {
  12190. "$ref": "#/components/schemas/ServerConfig"
  12191. },
  12192. "command": {
  12193. "type": "object",
  12194. "additionalProperties": {
  12195. "type": "object",
  12196. "properties": {
  12197. "template": {
  12198. "type": "string"
  12199. },
  12200. "description": {
  12201. "type": "string"
  12202. },
  12203. "agent": {
  12204. "type": "string"
  12205. },
  12206. "model": {
  12207. "type": "string"
  12208. },
  12209. "subtask": {
  12210. "type": "boolean"
  12211. }
  12212. },
  12213. "required": ["template"],
  12214. "additionalProperties": false
  12215. }
  12216. },
  12217. "skills": {
  12218. "type": "object",
  12219. "properties": {
  12220. "paths": {
  12221. "type": "array",
  12222. "items": {
  12223. "type": "string"
  12224. }
  12225. },
  12226. "urls": {
  12227. "type": "array",
  12228. "items": {
  12229. "type": "string"
  12230. }
  12231. }
  12232. },
  12233. "additionalProperties": false
  12234. },
  12235. "watcher": {
  12236. "type": "object",
  12237. "properties": {
  12238. "ignore": {
  12239. "type": "array",
  12240. "items": {
  12241. "type": "string"
  12242. }
  12243. }
  12244. },
  12245. "additionalProperties": false
  12246. },
  12247. "snapshot": {
  12248. "type": "boolean"
  12249. },
  12250. "plugin": {
  12251. "type": "array",
  12252. "items": {
  12253. "anyOf": [
  12254. {
  12255. "type": "string"
  12256. },
  12257. {
  12258. "type": "array",
  12259. "prefixItems": [
  12260. {
  12261. "type": "string"
  12262. },
  12263. {
  12264. "type": "object"
  12265. }
  12266. ],
  12267. "maxItems": 2,
  12268. "minItems": 2
  12269. }
  12270. ]
  12271. }
  12272. },
  12273. "share": {
  12274. "type": "string",
  12275. "enum": ["manual", "auto", "disabled"]
  12276. },
  12277. "autoshare": {
  12278. "type": "boolean"
  12279. },
  12280. "autoupdate": {
  12281. "anyOf": [
  12282. {
  12283. "type": "boolean"
  12284. },
  12285. {
  12286. "type": "string",
  12287. "enum": ["notify"]
  12288. }
  12289. ],
  12290. "description": "Automatically update to the latest version. Set to true to auto-update, false to disable, or 'notify' to show update notifications"
  12291. },
  12292. "disabled_providers": {
  12293. "type": "array",
  12294. "items": {
  12295. "type": "string"
  12296. }
  12297. },
  12298. "enabled_providers": {
  12299. "type": "array",
  12300. "items": {
  12301. "type": "string"
  12302. }
  12303. },
  12304. "model": {
  12305. "type": "string"
  12306. },
  12307. "small_model": {
  12308. "type": "string"
  12309. },
  12310. "default_agent": {
  12311. "type": "string"
  12312. },
  12313. "username": {
  12314. "type": "string"
  12315. },
  12316. "mode": {
  12317. "type": "object",
  12318. "properties": {
  12319. "build": {
  12320. "$ref": "#/components/schemas/AgentConfig"
  12321. },
  12322. "plan": {
  12323. "$ref": "#/components/schemas/AgentConfig"
  12324. }
  12325. },
  12326. "additionalProperties": {
  12327. "$ref": "#/components/schemas/AgentConfig"
  12328. }
  12329. },
  12330. "agent": {
  12331. "type": "object",
  12332. "properties": {
  12333. "plan": {
  12334. "$ref": "#/components/schemas/AgentConfig"
  12335. },
  12336. "build": {
  12337. "$ref": "#/components/schemas/AgentConfig"
  12338. },
  12339. "general": {
  12340. "$ref": "#/components/schemas/AgentConfig"
  12341. },
  12342. "explore": {
  12343. "$ref": "#/components/schemas/AgentConfig"
  12344. },
  12345. "title": {
  12346. "$ref": "#/components/schemas/AgentConfig"
  12347. },
  12348. "summary": {
  12349. "$ref": "#/components/schemas/AgentConfig"
  12350. },
  12351. "compaction": {
  12352. "$ref": "#/components/schemas/AgentConfig"
  12353. }
  12354. },
  12355. "additionalProperties": {
  12356. "$ref": "#/components/schemas/AgentConfig"
  12357. }
  12358. },
  12359. "provider": {
  12360. "type": "object",
  12361. "additionalProperties": {
  12362. "$ref": "#/components/schemas/ProviderConfig"
  12363. }
  12364. },
  12365. "mcp": {
  12366. "type": "object",
  12367. "additionalProperties": {
  12368. "anyOf": [
  12369. {
  12370. "$ref": "#/components/schemas/McpLocalConfig"
  12371. },
  12372. {
  12373. "$ref": "#/components/schemas/McpRemoteConfig"
  12374. },
  12375. {
  12376. "type": "object",
  12377. "properties": {
  12378. "enabled": {
  12379. "type": "boolean"
  12380. }
  12381. },
  12382. "required": ["enabled"],
  12383. "additionalProperties": false
  12384. }
  12385. ]
  12386. }
  12387. },
  12388. "formatter": {
  12389. "anyOf": [
  12390. {
  12391. "type": "boolean"
  12392. },
  12393. {
  12394. "type": "object",
  12395. "additionalProperties": {
  12396. "type": "object",
  12397. "properties": {
  12398. "disabled": {
  12399. "type": "boolean"
  12400. },
  12401. "command": {
  12402. "type": "array",
  12403. "items": {
  12404. "type": "string"
  12405. }
  12406. },
  12407. "environment": {
  12408. "type": "object",
  12409. "additionalProperties": {
  12410. "type": "string"
  12411. }
  12412. },
  12413. "extensions": {
  12414. "type": "array",
  12415. "items": {
  12416. "type": "string"
  12417. }
  12418. }
  12419. },
  12420. "additionalProperties": false
  12421. }
  12422. }
  12423. ],
  12424. "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."
  12425. },
  12426. "lsp": {
  12427. "anyOf": [
  12428. {
  12429. "type": "boolean"
  12430. },
  12431. {
  12432. "type": "object",
  12433. "additionalProperties": {
  12434. "anyOf": [
  12435. {
  12436. "type": "object",
  12437. "properties": {
  12438. "disabled": {
  12439. "type": "boolean",
  12440. "enum": [true]
  12441. }
  12442. },
  12443. "required": ["disabled"],
  12444. "additionalProperties": false
  12445. },
  12446. {
  12447. "type": "object",
  12448. "properties": {
  12449. "command": {
  12450. "type": "array",
  12451. "items": {
  12452. "type": "string"
  12453. }
  12454. },
  12455. "extensions": {
  12456. "type": "array",
  12457. "items": {
  12458. "type": "string"
  12459. }
  12460. },
  12461. "disabled": {
  12462. "type": "boolean"
  12463. },
  12464. "env": {
  12465. "type": "object",
  12466. "additionalProperties": {
  12467. "type": "string"
  12468. }
  12469. },
  12470. "initialization": {
  12471. "type": "object"
  12472. }
  12473. },
  12474. "required": ["command"],
  12475. "additionalProperties": false
  12476. }
  12477. ]
  12478. }
  12479. }
  12480. ],
  12481. "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."
  12482. },
  12483. "instructions": {
  12484. "type": "array",
  12485. "items": {
  12486. "type": "string"
  12487. }
  12488. },
  12489. "layout": {
  12490. "$ref": "#/components/schemas/LayoutConfig"
  12491. },
  12492. "permission": {
  12493. "$ref": "#/components/schemas/PermissionConfig"
  12494. },
  12495. "tools": {
  12496. "type": "object",
  12497. "additionalProperties": {
  12498. "type": "boolean"
  12499. }
  12500. },
  12501. "enterprise": {
  12502. "type": "object",
  12503. "properties": {
  12504. "url": {
  12505. "type": "string"
  12506. }
  12507. },
  12508. "additionalProperties": false
  12509. },
  12510. "tool_output": {
  12511. "type": "object",
  12512. "properties": {
  12513. "max_lines": {
  12514. "type": "integer",
  12515. "exclusiveMinimum": 0
  12516. },
  12517. "max_bytes": {
  12518. "type": "integer",
  12519. "exclusiveMinimum": 0
  12520. }
  12521. },
  12522. "additionalProperties": false
  12523. },
  12524. "compaction": {
  12525. "type": "object",
  12526. "properties": {
  12527. "auto": {
  12528. "type": "boolean"
  12529. },
  12530. "prune": {
  12531. "type": "boolean"
  12532. },
  12533. "tail_turns": {
  12534. "type": "integer",
  12535. "minimum": 0
  12536. },
  12537. "preserve_recent_tokens": {
  12538. "type": "integer",
  12539. "minimum": 0
  12540. },
  12541. "reserved": {
  12542. "type": "integer",
  12543. "minimum": 0
  12544. }
  12545. },
  12546. "additionalProperties": false
  12547. },
  12548. "experimental": {
  12549. "type": "object",
  12550. "properties": {
  12551. "disable_paste_summary": {
  12552. "type": "boolean"
  12553. },
  12554. "batch_tool": {
  12555. "type": "boolean"
  12556. },
  12557. "openTelemetry": {
  12558. "type": "boolean"
  12559. },
  12560. "primary_tools": {
  12561. "type": "array",
  12562. "items": {
  12563. "type": "string"
  12564. }
  12565. },
  12566. "continue_loop_on_deny": {
  12567. "type": "boolean"
  12568. },
  12569. "mcp_timeout": {
  12570. "type": "integer",
  12571. "exclusiveMinimum": 0
  12572. }
  12573. },
  12574. "additionalProperties": false
  12575. }
  12576. },
  12577. "additionalProperties": false
  12578. },
  12579. "Model": {
  12580. "type": "object",
  12581. "properties": {
  12582. "id": {
  12583. "type": "string"
  12584. },
  12585. "providerID": {
  12586. "type": "string"
  12587. },
  12588. "api": {
  12589. "type": "object",
  12590. "properties": {
  12591. "id": {
  12592. "type": "string"
  12593. },
  12594. "url": {
  12595. "type": "string"
  12596. },
  12597. "npm": {
  12598. "type": "string"
  12599. }
  12600. },
  12601. "required": ["id", "url", "npm"],
  12602. "additionalProperties": false
  12603. },
  12604. "name": {
  12605. "type": "string"
  12606. },
  12607. "family": {
  12608. "type": "string"
  12609. },
  12610. "capabilities": {
  12611. "type": "object",
  12612. "properties": {
  12613. "temperature": {
  12614. "type": "boolean"
  12615. },
  12616. "reasoning": {
  12617. "type": "boolean"
  12618. },
  12619. "attachment": {
  12620. "type": "boolean"
  12621. },
  12622. "toolcall": {
  12623. "type": "boolean"
  12624. },
  12625. "input": {
  12626. "type": "object",
  12627. "properties": {
  12628. "text": {
  12629. "type": "boolean"
  12630. },
  12631. "audio": {
  12632. "type": "boolean"
  12633. },
  12634. "image": {
  12635. "type": "boolean"
  12636. },
  12637. "video": {
  12638. "type": "boolean"
  12639. },
  12640. "pdf": {
  12641. "type": "boolean"
  12642. }
  12643. },
  12644. "required": ["text", "audio", "image", "video", "pdf"],
  12645. "additionalProperties": false
  12646. },
  12647. "output": {
  12648. "type": "object",
  12649. "properties": {
  12650. "text": {
  12651. "type": "boolean"
  12652. },
  12653. "audio": {
  12654. "type": "boolean"
  12655. },
  12656. "image": {
  12657. "type": "boolean"
  12658. },
  12659. "video": {
  12660. "type": "boolean"
  12661. },
  12662. "pdf": {
  12663. "type": "boolean"
  12664. }
  12665. },
  12666. "required": ["text", "audio", "image", "video", "pdf"],
  12667. "additionalProperties": false
  12668. },
  12669. "interleaved": {
  12670. "anyOf": [
  12671. {
  12672. "type": "boolean"
  12673. },
  12674. {
  12675. "type": "object",
  12676. "properties": {
  12677. "field": {
  12678. "type": "string",
  12679. "enum": ["reasoning_content", "reasoning_details"]
  12680. }
  12681. },
  12682. "required": ["field"],
  12683. "additionalProperties": false
  12684. }
  12685. ]
  12686. }
  12687. },
  12688. "required": ["temperature", "reasoning", "attachment", "toolcall", "input", "output", "interleaved"],
  12689. "additionalProperties": false
  12690. },
  12691. "cost": {
  12692. "type": "object",
  12693. "properties": {
  12694. "input": {
  12695. "type": "number"
  12696. },
  12697. "output": {
  12698. "type": "number"
  12699. },
  12700. "cache": {
  12701. "type": "object",
  12702. "properties": {
  12703. "read": {
  12704. "type": "number"
  12705. },
  12706. "write": {
  12707. "type": "number"
  12708. }
  12709. },
  12710. "required": ["read", "write"],
  12711. "additionalProperties": false
  12712. },
  12713. "experimentalOver200K": {
  12714. "type": "object",
  12715. "properties": {
  12716. "input": {
  12717. "type": "number"
  12718. },
  12719. "output": {
  12720. "type": "number"
  12721. },
  12722. "cache": {
  12723. "type": "object",
  12724. "properties": {
  12725. "read": {
  12726. "type": "number"
  12727. },
  12728. "write": {
  12729. "type": "number"
  12730. }
  12731. },
  12732. "required": ["read", "write"],
  12733. "additionalProperties": false
  12734. }
  12735. },
  12736. "required": ["input", "output", "cache"],
  12737. "additionalProperties": false
  12738. }
  12739. },
  12740. "required": ["input", "output", "cache"],
  12741. "additionalProperties": false
  12742. },
  12743. "limit": {
  12744. "type": "object",
  12745. "properties": {
  12746. "context": {
  12747. "type": "number"
  12748. },
  12749. "input": {
  12750. "type": "number"
  12751. },
  12752. "output": {
  12753. "type": "number"
  12754. }
  12755. },
  12756. "required": ["context", "output"],
  12757. "additionalProperties": false
  12758. },
  12759. "status": {
  12760. "type": "string",
  12761. "enum": ["alpha", "beta", "deprecated", "active"]
  12762. },
  12763. "options": {
  12764. "type": "object"
  12765. },
  12766. "headers": {
  12767. "type": "object",
  12768. "additionalProperties": {
  12769. "type": "string"
  12770. }
  12771. },
  12772. "release_date": {
  12773. "type": "string"
  12774. },
  12775. "variants": {
  12776. "type": "object",
  12777. "additionalProperties": {
  12778. "type": "object"
  12779. }
  12780. }
  12781. },
  12782. "required": [
  12783. "id",
  12784. "providerID",
  12785. "api",
  12786. "name",
  12787. "capabilities",
  12788. "cost",
  12789. "limit",
  12790. "status",
  12791. "options",
  12792. "headers",
  12793. "release_date"
  12794. ],
  12795. "additionalProperties": false
  12796. },
  12797. "Provider": {
  12798. "type": "object",
  12799. "properties": {
  12800. "id": {
  12801. "type": "string"
  12802. },
  12803. "name": {
  12804. "type": "string"
  12805. },
  12806. "source": {
  12807. "type": "string",
  12808. "enum": ["env", "config", "custom", "api"]
  12809. },
  12810. "env": {
  12811. "type": "array",
  12812. "items": {
  12813. "type": "string"
  12814. }
  12815. },
  12816. "key": {
  12817. "type": "string"
  12818. },
  12819. "options": {
  12820. "type": "object"
  12821. },
  12822. "models": {
  12823. "type": "object",
  12824. "additionalProperties": {
  12825. "$ref": "#/components/schemas/Model"
  12826. }
  12827. }
  12828. },
  12829. "required": ["id", "name", "source", "env", "options", "models"],
  12830. "additionalProperties": false
  12831. },
  12832. "ConsoleState": {
  12833. "type": "object",
  12834. "properties": {
  12835. "consoleManagedProviders": {
  12836. "type": "array",
  12837. "items": {
  12838. "type": "string"
  12839. }
  12840. },
  12841. "activeOrgName": {
  12842. "type": "string"
  12843. },
  12844. "switchableOrgCount": {
  12845. "type": "integer",
  12846. "minimum": 0
  12847. }
  12848. },
  12849. "required": ["consoleManagedProviders", "switchableOrgCount"],
  12850. "additionalProperties": false
  12851. },
  12852. "ToolListItem": {
  12853. "type": "object",
  12854. "properties": {
  12855. "id": {
  12856. "type": "string"
  12857. },
  12858. "description": {
  12859. "type": "string"
  12860. },
  12861. "parameters": {}
  12862. },
  12863. "required": ["id", "description", "parameters"],
  12864. "additionalProperties": false
  12865. },
  12866. "ToolList": {
  12867. "type": "array",
  12868. "items": {
  12869. "$ref": "#/components/schemas/ToolListItem"
  12870. }
  12871. },
  12872. "ToolIDs": {
  12873. "type": "array",
  12874. "items": {
  12875. "type": "string"
  12876. }
  12877. },
  12878. "WorktreeCreateInput": {
  12879. "type": "object",
  12880. "properties": {
  12881. "name": {
  12882. "type": "string"
  12883. },
  12884. "startCommand": {
  12885. "type": "string",
  12886. "description": "Additional startup script to run after the project's start command"
  12887. }
  12888. },
  12889. "additionalProperties": false
  12890. },
  12891. "Worktree": {
  12892. "type": "object",
  12893. "properties": {
  12894. "name": {
  12895. "type": "string"
  12896. },
  12897. "branch": {
  12898. "type": "string"
  12899. },
  12900. "directory": {
  12901. "type": "string"
  12902. }
  12903. },
  12904. "required": ["name", "branch", "directory"],
  12905. "additionalProperties": false
  12906. },
  12907. "WorktreeRemoveInput": {
  12908. "type": "object",
  12909. "properties": {
  12910. "directory": {
  12911. "type": "string"
  12912. }
  12913. },
  12914. "required": ["directory"],
  12915. "additionalProperties": false
  12916. },
  12917. "WorktreeResetInput": {
  12918. "type": "object",
  12919. "properties": {
  12920. "directory": {
  12921. "type": "string"
  12922. }
  12923. },
  12924. "required": ["directory"],
  12925. "additionalProperties": false
  12926. },
  12927. "ProjectSummary": {
  12928. "type": "object",
  12929. "properties": {
  12930. "id": {
  12931. "type": "string"
  12932. },
  12933. "name": {
  12934. "type": "string"
  12935. },
  12936. "worktree": {
  12937. "type": "string"
  12938. }
  12939. },
  12940. "required": ["id", "worktree"],
  12941. "additionalProperties": false
  12942. },
  12943. "GlobalSession": {
  12944. "type": "object",
  12945. "properties": {
  12946. "id": {
  12947. "type": "string"
  12948. },
  12949. "slug": {
  12950. "type": "string"
  12951. },
  12952. "projectID": {
  12953. "type": "string"
  12954. },
  12955. "workspaceID": {
  12956. "type": "string"
  12957. },
  12958. "directory": {
  12959. "type": "string"
  12960. },
  12961. "path": {
  12962. "type": "string"
  12963. },
  12964. "parentID": {
  12965. "type": "string"
  12966. },
  12967. "summary": {
  12968. "type": "object",
  12969. "properties": {
  12970. "additions": {
  12971. "type": "integer",
  12972. "minimum": 0
  12973. },
  12974. "deletions": {
  12975. "type": "integer",
  12976. "minimum": 0
  12977. },
  12978. "files": {
  12979. "type": "integer",
  12980. "minimum": 0
  12981. },
  12982. "diffs": {
  12983. "type": "array",
  12984. "items": {
  12985. "$ref": "#/components/schemas/SnapshotFileDiff"
  12986. }
  12987. }
  12988. },
  12989. "required": ["additions", "deletions", "files"],
  12990. "additionalProperties": false
  12991. },
  12992. "share": {
  12993. "type": "object",
  12994. "properties": {
  12995. "url": {
  12996. "type": "string"
  12997. }
  12998. },
  12999. "required": ["url"],
  13000. "additionalProperties": false
  13001. },
  13002. "title": {
  13003. "type": "string"
  13004. },
  13005. "agent": {
  13006. "type": "string"
  13007. },
  13008. "model": {
  13009. "type": "object",
  13010. "properties": {
  13011. "id": {
  13012. "type": "string"
  13013. },
  13014. "providerID": {
  13015. "type": "string"
  13016. },
  13017. "variant": {
  13018. "type": "string"
  13019. }
  13020. },
  13021. "required": ["id", "providerID"],
  13022. "additionalProperties": false
  13023. },
  13024. "version": {
  13025. "type": "string"
  13026. },
  13027. "time": {
  13028. "type": "object",
  13029. "properties": {
  13030. "created": {
  13031. "type": "integer",
  13032. "minimum": 0
  13033. },
  13034. "updated": {
  13035. "type": "integer",
  13036. "minimum": 0
  13037. },
  13038. "compacting": {
  13039. "type": "integer",
  13040. "minimum": 0
  13041. },
  13042. "archived": {
  13043. "type": "number"
  13044. }
  13045. },
  13046. "required": ["created", "updated"],
  13047. "additionalProperties": false
  13048. },
  13049. "permission": {
  13050. "$ref": "#/components/schemas/PermissionRuleset"
  13051. },
  13052. "revert": {
  13053. "type": "object",
  13054. "properties": {
  13055. "messageID": {
  13056. "type": "string"
  13057. },
  13058. "partID": {
  13059. "type": "string"
  13060. },
  13061. "snapshot": {
  13062. "type": "string"
  13063. },
  13064. "diff": {
  13065. "type": "string"
  13066. }
  13067. },
  13068. "required": ["messageID"],
  13069. "additionalProperties": false
  13070. },
  13071. "project": {
  13072. "anyOf": [
  13073. {
  13074. "$ref": "#/components/schemas/ProjectSummary"
  13075. },
  13076. {
  13077. "type": "null"
  13078. }
  13079. ]
  13080. }
  13081. },
  13082. "required": ["id", "slug", "projectID", "directory", "title", "version", "time", "project"],
  13083. "additionalProperties": false
  13084. },
  13085. "McpResource": {
  13086. "type": "object",
  13087. "properties": {
  13088. "name": {
  13089. "type": "string"
  13090. },
  13091. "uri": {
  13092. "type": "string"
  13093. },
  13094. "description": {
  13095. "type": "string"
  13096. },
  13097. "mimeType": {
  13098. "type": "string"
  13099. },
  13100. "client": {
  13101. "type": "string"
  13102. }
  13103. },
  13104. "required": ["name", "uri", "client"],
  13105. "additionalProperties": false
  13106. },
  13107. "Symbol": {
  13108. "type": "object",
  13109. "properties": {
  13110. "name": {
  13111. "type": "string"
  13112. },
  13113. "kind": {
  13114. "type": "integer",
  13115. "minimum": 0
  13116. },
  13117. "location": {
  13118. "type": "object",
  13119. "properties": {
  13120. "uri": {
  13121. "type": "string"
  13122. },
  13123. "range": {
  13124. "$ref": "#/components/schemas/Range"
  13125. }
  13126. },
  13127. "required": ["uri", "range"],
  13128. "additionalProperties": false
  13129. }
  13130. },
  13131. "required": ["name", "kind", "location"],
  13132. "additionalProperties": false
  13133. },
  13134. "FileNode": {
  13135. "type": "object",
  13136. "properties": {
  13137. "name": {
  13138. "type": "string"
  13139. },
  13140. "path": {
  13141. "type": "string"
  13142. },
  13143. "absolute": {
  13144. "type": "string"
  13145. },
  13146. "type": {
  13147. "type": "string",
  13148. "enum": ["file", "directory"]
  13149. },
  13150. "ignored": {
  13151. "type": "boolean"
  13152. }
  13153. },
  13154. "required": ["name", "path", "absolute", "type", "ignored"],
  13155. "additionalProperties": false
  13156. },
  13157. "FileContent": {
  13158. "type": "object",
  13159. "properties": {
  13160. "type": {
  13161. "type": "string",
  13162. "enum": ["text", "binary"]
  13163. },
  13164. "content": {
  13165. "type": "string"
  13166. },
  13167. "diff": {
  13168. "type": "string"
  13169. },
  13170. "patch": {
  13171. "type": "object",
  13172. "properties": {
  13173. "oldFileName": {
  13174. "type": "string"
  13175. },
  13176. "newFileName": {
  13177. "type": "string"
  13178. },
  13179. "oldHeader": {
  13180. "type": "string"
  13181. },
  13182. "newHeader": {
  13183. "type": "string"
  13184. },
  13185. "hunks": {
  13186. "type": "array",
  13187. "items": {
  13188. "type": "object",
  13189. "properties": {
  13190. "oldStart": {
  13191. "type": "integer",
  13192. "minimum": 0
  13193. },
  13194. "oldLines": {
  13195. "type": "integer",
  13196. "minimum": 0
  13197. },
  13198. "newStart": {
  13199. "type": "integer",
  13200. "minimum": 0
  13201. },
  13202. "newLines": {
  13203. "type": "integer",
  13204. "minimum": 0
  13205. },
  13206. "lines": {
  13207. "type": "array",
  13208. "items": {
  13209. "type": "string"
  13210. }
  13211. }
  13212. },
  13213. "required": ["oldStart", "oldLines", "newStart", "newLines", "lines"],
  13214. "additionalProperties": false
  13215. }
  13216. },
  13217. "index": {
  13218. "type": "string"
  13219. }
  13220. },
  13221. "required": ["oldFileName", "newFileName", "hunks"],
  13222. "additionalProperties": false
  13223. },
  13224. "encoding": {
  13225. "type": "string",
  13226. "enum": ["base64"]
  13227. },
  13228. "mimeType": {
  13229. "type": "string"
  13230. }
  13231. },
  13232. "required": ["type", "content"],
  13233. "additionalProperties": false
  13234. },
  13235. "File": {
  13236. "type": "object",
  13237. "properties": {
  13238. "path": {
  13239. "type": "string"
  13240. },
  13241. "added": {
  13242. "type": "integer",
  13243. "minimum": 0
  13244. },
  13245. "removed": {
  13246. "type": "integer",
  13247. "minimum": 0
  13248. },
  13249. "status": {
  13250. "type": "string",
  13251. "enum": ["added", "deleted", "modified"]
  13252. }
  13253. },
  13254. "required": ["path", "added", "removed", "status"],
  13255. "additionalProperties": false
  13256. },
  13257. "Path": {
  13258. "type": "object",
  13259. "properties": {
  13260. "home": {
  13261. "type": "string"
  13262. },
  13263. "state": {
  13264. "type": "string"
  13265. },
  13266. "config": {
  13267. "type": "string"
  13268. },
  13269. "worktree": {
  13270. "type": "string"
  13271. },
  13272. "directory": {
  13273. "type": "string"
  13274. }
  13275. },
  13276. "required": ["home", "state", "config", "worktree", "directory"],
  13277. "additionalProperties": false
  13278. },
  13279. "VcsInfo": {
  13280. "type": "object",
  13281. "properties": {
  13282. "branch": {
  13283. "type": "string"
  13284. },
  13285. "default_branch": {
  13286. "type": "string"
  13287. }
  13288. },
  13289. "additionalProperties": false
  13290. },
  13291. "VcsFileDiff": {
  13292. "type": "object",
  13293. "properties": {
  13294. "file": {
  13295. "type": "string"
  13296. },
  13297. "patch": {
  13298. "type": "string"
  13299. },
  13300. "additions": {
  13301. "type": "integer",
  13302. "minimum": 0
  13303. },
  13304. "deletions": {
  13305. "type": "integer",
  13306. "minimum": 0
  13307. },
  13308. "status": {
  13309. "type": "string",
  13310. "enum": ["added", "deleted", "modified"]
  13311. }
  13312. },
  13313. "required": ["file", "patch", "additions", "deletions"],
  13314. "additionalProperties": false
  13315. },
  13316. "Command": {
  13317. "type": "object",
  13318. "properties": {
  13319. "name": {
  13320. "type": "string"
  13321. },
  13322. "description": {
  13323. "type": "string"
  13324. },
  13325. "agent": {
  13326. "type": "string"
  13327. },
  13328. "model": {
  13329. "type": "string"
  13330. },
  13331. "source": {
  13332. "type": "string",
  13333. "enum": ["command", "mcp", "skill"]
  13334. },
  13335. "template": {
  13336. "type": "string"
  13337. },
  13338. "subtask": {
  13339. "type": "boolean"
  13340. },
  13341. "hints": {
  13342. "type": "array",
  13343. "items": {
  13344. "type": "string"
  13345. }
  13346. }
  13347. },
  13348. "required": ["name", "template", "hints"],
  13349. "additionalProperties": false
  13350. },
  13351. "Agent": {
  13352. "type": "object",
  13353. "properties": {
  13354. "name": {
  13355. "type": "string"
  13356. },
  13357. "description": {
  13358. "type": "string"
  13359. },
  13360. "mode": {
  13361. "type": "string",
  13362. "enum": ["subagent", "primary", "all"]
  13363. },
  13364. "native": {
  13365. "type": "boolean"
  13366. },
  13367. "hidden": {
  13368. "type": "boolean"
  13369. },
  13370. "topP": {
  13371. "type": "number"
  13372. },
  13373. "temperature": {
  13374. "type": "number"
  13375. },
  13376. "color": {
  13377. "type": "string"
  13378. },
  13379. "permission": {
  13380. "$ref": "#/components/schemas/PermissionRuleset"
  13381. },
  13382. "model": {
  13383. "type": "object",
  13384. "properties": {
  13385. "modelID": {
  13386. "type": "string"
  13387. },
  13388. "providerID": {
  13389. "type": "string"
  13390. }
  13391. },
  13392. "required": ["modelID", "providerID"],
  13393. "additionalProperties": false
  13394. },
  13395. "variant": {
  13396. "type": "string"
  13397. },
  13398. "prompt": {
  13399. "type": "string"
  13400. },
  13401. "options": {
  13402. "type": "object"
  13403. },
  13404. "steps": {
  13405. "type": "number"
  13406. }
  13407. },
  13408. "required": ["name", "mode", "permission", "options"],
  13409. "additionalProperties": false
  13410. },
  13411. "LSPStatus": {
  13412. "type": "object",
  13413. "properties": {
  13414. "id": {
  13415. "type": "string"
  13416. },
  13417. "name": {
  13418. "type": "string"
  13419. },
  13420. "root": {
  13421. "type": "string"
  13422. },
  13423. "status": {
  13424. "type": "string",
  13425. "enum": ["connected", "error"]
  13426. }
  13427. },
  13428. "required": ["id", "name", "root", "status"],
  13429. "additionalProperties": false
  13430. },
  13431. "FormatterStatus": {
  13432. "type": "object",
  13433. "properties": {
  13434. "name": {
  13435. "type": "string"
  13436. },
  13437. "extensions": {
  13438. "type": "array",
  13439. "items": {
  13440. "type": "string"
  13441. }
  13442. },
  13443. "enabled": {
  13444. "type": "boolean"
  13445. }
  13446. },
  13447. "required": ["name", "extensions", "enabled"],
  13448. "additionalProperties": false
  13449. },
  13450. "MCPStatusConnected": {
  13451. "type": "object",
  13452. "properties": {
  13453. "status": {
  13454. "type": "string",
  13455. "enum": ["connected"]
  13456. }
  13457. },
  13458. "required": ["status"],
  13459. "additionalProperties": false
  13460. },
  13461. "MCPStatusDisabled": {
  13462. "type": "object",
  13463. "properties": {
  13464. "status": {
  13465. "type": "string",
  13466. "enum": ["disabled"]
  13467. }
  13468. },
  13469. "required": ["status"],
  13470. "additionalProperties": false
  13471. },
  13472. "MCPStatusFailed": {
  13473. "type": "object",
  13474. "properties": {
  13475. "status": {
  13476. "type": "string",
  13477. "enum": ["failed"]
  13478. },
  13479. "error": {
  13480. "type": "string"
  13481. }
  13482. },
  13483. "required": ["status", "error"],
  13484. "additionalProperties": false
  13485. },
  13486. "MCPStatusNeedsAuth": {
  13487. "type": "object",
  13488. "properties": {
  13489. "status": {
  13490. "type": "string",
  13491. "enum": ["needs_auth"]
  13492. }
  13493. },
  13494. "required": ["status"],
  13495. "additionalProperties": false
  13496. },
  13497. "MCPStatusNeedsClientRegistration": {
  13498. "type": "object",
  13499. "properties": {
  13500. "status": {
  13501. "type": "string",
  13502. "enum": ["needs_client_registration"]
  13503. },
  13504. "error": {
  13505. "type": "string"
  13506. }
  13507. },
  13508. "required": ["status", "error"],
  13509. "additionalProperties": false
  13510. },
  13511. "MCPStatus": {
  13512. "anyOf": [
  13513. {
  13514. "$ref": "#/components/schemas/MCPStatusConnected"
  13515. },
  13516. {
  13517. "$ref": "#/components/schemas/MCPStatusDisabled"
  13518. },
  13519. {
  13520. "$ref": "#/components/schemas/MCPStatusFailed"
  13521. },
  13522. {
  13523. "$ref": "#/components/schemas/MCPStatusNeedsAuth"
  13524. },
  13525. {
  13526. "$ref": "#/components/schemas/MCPStatusNeedsClientRegistration"
  13527. }
  13528. ]
  13529. },
  13530. "McpUnsupportedOAuthError": {
  13531. "type": "object",
  13532. "properties": {
  13533. "error": {
  13534. "type": "string"
  13535. }
  13536. },
  13537. "required": ["error"],
  13538. "additionalProperties": false
  13539. },
  13540. "effect_HttpApiError_Forbidden": {
  13541. "type": "object",
  13542. "properties": {
  13543. "_tag": {
  13544. "type": "string",
  13545. "enum": ["Forbidden"]
  13546. }
  13547. },
  13548. "required": ["_tag"],
  13549. "additionalProperties": false
  13550. },
  13551. "ProviderAuthMethod": {
  13552. "type": "object",
  13553. "properties": {
  13554. "type": {
  13555. "type": "string",
  13556. "enum": ["oauth", "api"]
  13557. },
  13558. "label": {
  13559. "type": "string"
  13560. },
  13561. "prompts": {
  13562. "type": "array",
  13563. "items": {
  13564. "anyOf": [
  13565. {
  13566. "type": "object",
  13567. "properties": {
  13568. "type": {
  13569. "type": "string",
  13570. "enum": ["text"]
  13571. },
  13572. "key": {
  13573. "type": "string"
  13574. },
  13575. "message": {
  13576. "type": "string"
  13577. },
  13578. "placeholder": {
  13579. "type": "string"
  13580. },
  13581. "when": {
  13582. "type": "object",
  13583. "properties": {
  13584. "key": {
  13585. "type": "string"
  13586. },
  13587. "op": {
  13588. "type": "string",
  13589. "enum": ["eq", "neq"]
  13590. },
  13591. "value": {
  13592. "type": "string"
  13593. }
  13594. },
  13595. "required": ["key", "op", "value"],
  13596. "additionalProperties": false
  13597. }
  13598. },
  13599. "required": ["type", "key", "message"],
  13600. "additionalProperties": false
  13601. },
  13602. {
  13603. "type": "object",
  13604. "properties": {
  13605. "type": {
  13606. "type": "string",
  13607. "enum": ["select"]
  13608. },
  13609. "key": {
  13610. "type": "string"
  13611. },
  13612. "message": {
  13613. "type": "string"
  13614. },
  13615. "options": {
  13616. "type": "array",
  13617. "items": {
  13618. "type": "object",
  13619. "properties": {
  13620. "label": {
  13621. "type": "string"
  13622. },
  13623. "value": {
  13624. "type": "string"
  13625. },
  13626. "hint": {
  13627. "type": "string"
  13628. }
  13629. },
  13630. "required": ["label", "value"],
  13631. "additionalProperties": false
  13632. }
  13633. },
  13634. "when": {
  13635. "type": "object",
  13636. "properties": {
  13637. "key": {
  13638. "type": "string"
  13639. },
  13640. "op": {
  13641. "type": "string",
  13642. "enum": ["eq", "neq"]
  13643. },
  13644. "value": {
  13645. "type": "string"
  13646. }
  13647. },
  13648. "required": ["key", "op", "value"],
  13649. "additionalProperties": false
  13650. }
  13651. },
  13652. "required": ["type", "key", "message", "options"],
  13653. "additionalProperties": false
  13654. }
  13655. ]
  13656. }
  13657. }
  13658. },
  13659. "required": ["type", "label"],
  13660. "additionalProperties": false
  13661. },
  13662. "ProviderAuthAuthorization": {
  13663. "type": "object",
  13664. "properties": {
  13665. "url": {
  13666. "type": "string"
  13667. },
  13668. "method": {
  13669. "type": "string",
  13670. "enum": ["auto", "code"]
  13671. },
  13672. "instructions": {
  13673. "type": "string"
  13674. }
  13675. },
  13676. "required": ["url", "method", "instructions"],
  13677. "additionalProperties": false
  13678. },
  13679. "TextPartInput": {
  13680. "type": "object",
  13681. "properties": {
  13682. "id": {
  13683. "type": "string"
  13684. },
  13685. "type": {
  13686. "type": "string",
  13687. "enum": ["text"]
  13688. },
  13689. "text": {
  13690. "type": "string"
  13691. },
  13692. "synthetic": {
  13693. "type": "boolean"
  13694. },
  13695. "ignored": {
  13696. "type": "boolean"
  13697. },
  13698. "time": {
  13699. "type": "object",
  13700. "properties": {
  13701. "start": {
  13702. "type": "integer",
  13703. "minimum": 0
  13704. },
  13705. "end": {
  13706. "type": "integer",
  13707. "minimum": 0
  13708. }
  13709. },
  13710. "required": ["start"],
  13711. "additionalProperties": false
  13712. },
  13713. "metadata": {
  13714. "type": "object"
  13715. }
  13716. },
  13717. "required": ["type", "text"],
  13718. "additionalProperties": false
  13719. },
  13720. "FilePartInput": {
  13721. "type": "object",
  13722. "properties": {
  13723. "id": {
  13724. "type": "string"
  13725. },
  13726. "type": {
  13727. "type": "string",
  13728. "enum": ["file"]
  13729. },
  13730. "mime": {
  13731. "type": "string"
  13732. },
  13733. "filename": {
  13734. "type": "string"
  13735. },
  13736. "url": {
  13737. "type": "string"
  13738. },
  13739. "source": {
  13740. "$ref": "#/components/schemas/FilePartSource"
  13741. }
  13742. },
  13743. "required": ["type", "mime", "url"],
  13744. "additionalProperties": false
  13745. },
  13746. "AgentPartInput": {
  13747. "type": "object",
  13748. "properties": {
  13749. "id": {
  13750. "type": "string"
  13751. },
  13752. "type": {
  13753. "type": "string",
  13754. "enum": ["agent"]
  13755. },
  13756. "name": {
  13757. "type": "string"
  13758. },
  13759. "source": {
  13760. "type": "object",
  13761. "properties": {
  13762. "value": {
  13763. "type": "string"
  13764. },
  13765. "start": {
  13766. "type": "integer",
  13767. "minimum": 0
  13768. },
  13769. "end": {
  13770. "type": "integer",
  13771. "minimum": 0
  13772. }
  13773. },
  13774. "required": ["value", "start", "end"],
  13775. "additionalProperties": false
  13776. }
  13777. },
  13778. "required": ["type", "name"],
  13779. "additionalProperties": false
  13780. },
  13781. "SubtaskPartInput": {
  13782. "type": "object",
  13783. "properties": {
  13784. "id": {
  13785. "type": "string"
  13786. },
  13787. "type": {
  13788. "type": "string",
  13789. "enum": ["subtask"]
  13790. },
  13791. "prompt": {
  13792. "type": "string"
  13793. },
  13794. "description": {
  13795. "type": "string"
  13796. },
  13797. "agent": {
  13798. "type": "string"
  13799. },
  13800. "model": {
  13801. "type": "object",
  13802. "properties": {
  13803. "providerID": {
  13804. "type": "string"
  13805. },
  13806. "modelID": {
  13807. "type": "string"
  13808. }
  13809. },
  13810. "required": ["providerID", "modelID"],
  13811. "additionalProperties": false
  13812. },
  13813. "command": {
  13814. "type": "string"
  13815. }
  13816. },
  13817. "required": ["type", "prompt", "description", "agent"],
  13818. "additionalProperties": false
  13819. },
  13820. "V2SessionsResponse": {
  13821. "type": "object",
  13822. "properties": {
  13823. "items": {
  13824. "type": "array",
  13825. "items": {
  13826. "$ref": "#/components/schemas/SessionInfo"
  13827. }
  13828. },
  13829. "cursor": {
  13830. "type": "object",
  13831. "properties": {
  13832. "previous": {
  13833. "type": "string"
  13834. },
  13835. "next": {
  13836. "type": "string"
  13837. }
  13838. },
  13839. "additionalProperties": false
  13840. }
  13841. },
  13842. "required": ["items", "cursor"],
  13843. "additionalProperties": false
  13844. },
  13845. "V2SessionMessagesResponse": {
  13846. "type": "object",
  13847. "properties": {
  13848. "items": {
  13849. "type": "array",
  13850. "items": {
  13851. "$ref": "#/components/schemas/SessionMessage"
  13852. }
  13853. },
  13854. "cursor": {
  13855. "type": "object",
  13856. "properties": {
  13857. "previous": {
  13858. "type": "string"
  13859. },
  13860. "next": {
  13861. "type": "string"
  13862. }
  13863. },
  13864. "additionalProperties": false
  13865. }
  13866. },
  13867. "required": ["items", "cursor"],
  13868. "additionalProperties": false
  13869. },
  13870. "EventTuiPromptAppend": {
  13871. "type": "object",
  13872. "properties": {
  13873. "type": {
  13874. "type": "string",
  13875. "enum": ["tui.prompt.append"]
  13876. },
  13877. "properties": {
  13878. "type": "object",
  13879. "properties": {
  13880. "text": {
  13881. "type": "string"
  13882. }
  13883. },
  13884. "required": ["text"],
  13885. "additionalProperties": false
  13886. }
  13887. },
  13888. "required": ["type", "properties"],
  13889. "additionalProperties": false
  13890. },
  13891. "EventTuiCommandExecute": {
  13892. "type": "object",
  13893. "properties": {
  13894. "type": {
  13895. "type": "string",
  13896. "enum": ["tui.command.execute"]
  13897. },
  13898. "properties": {
  13899. "type": "object",
  13900. "properties": {
  13901. "command": {
  13902. "anyOf": [
  13903. {
  13904. "type": "string",
  13905. "enum": [
  13906. "session.list",
  13907. "session.new",
  13908. "session.share",
  13909. "session.interrupt",
  13910. "session.compact",
  13911. "session.page.up",
  13912. "session.page.down",
  13913. "session.line.up",
  13914. "session.line.down",
  13915. "session.half.page.up",
  13916. "session.half.page.down",
  13917. "session.first",
  13918. "session.last",
  13919. "prompt.clear",
  13920. "prompt.submit",
  13921. "agent.cycle"
  13922. ]
  13923. },
  13924. {
  13925. "type": "string"
  13926. }
  13927. ]
  13928. }
  13929. },
  13930. "required": ["command"],
  13931. "additionalProperties": false
  13932. }
  13933. },
  13934. "required": ["type", "properties"],
  13935. "additionalProperties": false
  13936. },
  13937. "EventTuiToastShow": {
  13938. "type": "object",
  13939. "properties": {
  13940. "type": {
  13941. "type": "string",
  13942. "enum": ["tui.toast.show"]
  13943. },
  13944. "properties": {
  13945. "type": "object",
  13946. "properties": {
  13947. "title": {
  13948. "type": "string"
  13949. },
  13950. "message": {
  13951. "type": "string"
  13952. },
  13953. "variant": {
  13954. "type": "string",
  13955. "enum": ["info", "success", "warning", "error"]
  13956. },
  13957. "duration": {
  13958. "type": "integer",
  13959. "exclusiveMinimum": 0
  13960. }
  13961. },
  13962. "required": ["message", "variant"],
  13963. "additionalProperties": false
  13964. }
  13965. },
  13966. "required": ["type", "properties"],
  13967. "additionalProperties": false
  13968. },
  13969. "EventTuiSessionSelect": {
  13970. "type": "object",
  13971. "properties": {
  13972. "type": {
  13973. "type": "string",
  13974. "enum": ["tui.session.select"]
  13975. },
  13976. "properties": {
  13977. "type": "object",
  13978. "properties": {
  13979. "sessionID": {
  13980. "type": "string",
  13981. "description": "Session ID to navigate to"
  13982. }
  13983. },
  13984. "required": ["sessionID"],
  13985. "additionalProperties": false
  13986. }
  13987. },
  13988. "required": ["type", "properties"],
  13989. "additionalProperties": false
  13990. },
  13991. "Workspace": {
  13992. "type": "object",
  13993. "properties": {
  13994. "id": {
  13995. "type": "string"
  13996. },
  13997. "type": {
  13998. "type": "string"
  13999. },
  14000. "name": {
  14001. "type": "string"
  14002. },
  14003. "branch": {
  14004. "anyOf": [
  14005. {
  14006. "type": "string"
  14007. },
  14008. {
  14009. "type": "null"
  14010. }
  14011. ]
  14012. },
  14013. "directory": {
  14014. "anyOf": [
  14015. {
  14016. "type": "string"
  14017. },
  14018. {
  14019. "type": "null"
  14020. }
  14021. ]
  14022. },
  14023. "extra": {
  14024. "anyOf": [
  14025. {},
  14026. {
  14027. "type": "null"
  14028. }
  14029. ]
  14030. },
  14031. "projectID": {
  14032. "type": "string"
  14033. }
  14034. },
  14035. "required": ["id", "type", "name", "branch", "directory", "extra", "projectID"],
  14036. "additionalProperties": false
  14037. },
  14038. "SyncEventMessageUpdated": {
  14039. "type": "object",
  14040. "properties": {
  14041. "type": {
  14042. "type": "string",
  14043. "enum": ["sync"]
  14044. },
  14045. "name": {
  14046. "type": "string",
  14047. "enum": ["message.updated.1"]
  14048. },
  14049. "id": {
  14050. "type": "string"
  14051. },
  14052. "seq": {
  14053. "type": "number"
  14054. },
  14055. "aggregateID": {
  14056. "type": "string",
  14057. "enum": ["sessionID"]
  14058. },
  14059. "data": {
  14060. "type": "object",
  14061. "properties": {
  14062. "sessionID": {
  14063. "type": "string"
  14064. },
  14065. "info": {
  14066. "$ref": "#/components/schemas/Message"
  14067. }
  14068. },
  14069. "required": ["sessionID", "info"],
  14070. "additionalProperties": false
  14071. }
  14072. },
  14073. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14074. "additionalProperties": false
  14075. },
  14076. "SyncEventMessageRemoved": {
  14077. "type": "object",
  14078. "properties": {
  14079. "type": {
  14080. "type": "string",
  14081. "enum": ["sync"]
  14082. },
  14083. "name": {
  14084. "type": "string",
  14085. "enum": ["message.removed.1"]
  14086. },
  14087. "id": {
  14088. "type": "string"
  14089. },
  14090. "seq": {
  14091. "type": "number"
  14092. },
  14093. "aggregateID": {
  14094. "type": "string",
  14095. "enum": ["sessionID"]
  14096. },
  14097. "data": {
  14098. "type": "object",
  14099. "properties": {
  14100. "sessionID": {
  14101. "type": "string"
  14102. },
  14103. "messageID": {
  14104. "type": "string"
  14105. }
  14106. },
  14107. "required": ["sessionID", "messageID"],
  14108. "additionalProperties": false
  14109. }
  14110. },
  14111. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14112. "additionalProperties": false
  14113. },
  14114. "SyncEventMessagePartUpdated": {
  14115. "type": "object",
  14116. "properties": {
  14117. "type": {
  14118. "type": "string",
  14119. "enum": ["sync"]
  14120. },
  14121. "name": {
  14122. "type": "string",
  14123. "enum": ["message.part.updated.1"]
  14124. },
  14125. "id": {
  14126. "type": "string"
  14127. },
  14128. "seq": {
  14129. "type": "number"
  14130. },
  14131. "aggregateID": {
  14132. "type": "string",
  14133. "enum": ["sessionID"]
  14134. },
  14135. "data": {
  14136. "type": "object",
  14137. "properties": {
  14138. "sessionID": {
  14139. "type": "string"
  14140. },
  14141. "part": {
  14142. "$ref": "#/components/schemas/Part"
  14143. },
  14144. "time": {
  14145. "type": "integer",
  14146. "minimum": 0
  14147. }
  14148. },
  14149. "required": ["sessionID", "part", "time"],
  14150. "additionalProperties": false
  14151. }
  14152. },
  14153. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14154. "additionalProperties": false
  14155. },
  14156. "SyncEventMessagePartRemoved": {
  14157. "type": "object",
  14158. "properties": {
  14159. "type": {
  14160. "type": "string",
  14161. "enum": ["sync"]
  14162. },
  14163. "name": {
  14164. "type": "string",
  14165. "enum": ["message.part.removed.1"]
  14166. },
  14167. "id": {
  14168. "type": "string"
  14169. },
  14170. "seq": {
  14171. "type": "number"
  14172. },
  14173. "aggregateID": {
  14174. "type": "string",
  14175. "enum": ["sessionID"]
  14176. },
  14177. "data": {
  14178. "type": "object",
  14179. "properties": {
  14180. "sessionID": {
  14181. "type": "string"
  14182. },
  14183. "messageID": {
  14184. "type": "string"
  14185. },
  14186. "partID": {
  14187. "type": "string"
  14188. }
  14189. },
  14190. "required": ["sessionID", "messageID", "partID"],
  14191. "additionalProperties": false
  14192. }
  14193. },
  14194. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14195. "additionalProperties": false
  14196. },
  14197. "SyncEventSessionCreated": {
  14198. "type": "object",
  14199. "properties": {
  14200. "type": {
  14201. "type": "string",
  14202. "enum": ["sync"]
  14203. },
  14204. "name": {
  14205. "type": "string",
  14206. "enum": ["session.created.1"]
  14207. },
  14208. "id": {
  14209. "type": "string"
  14210. },
  14211. "seq": {
  14212. "type": "number"
  14213. },
  14214. "aggregateID": {
  14215. "type": "string",
  14216. "enum": ["sessionID"]
  14217. },
  14218. "data": {
  14219. "type": "object",
  14220. "properties": {
  14221. "sessionID": {
  14222. "type": "string"
  14223. },
  14224. "info": {
  14225. "$ref": "#/components/schemas/Session"
  14226. }
  14227. },
  14228. "required": ["sessionID", "info"],
  14229. "additionalProperties": false
  14230. }
  14231. },
  14232. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14233. "additionalProperties": false
  14234. },
  14235. "SyncEventSessionUpdated": {
  14236. "type": "object",
  14237. "properties": {
  14238. "type": {
  14239. "type": "string",
  14240. "enum": ["sync"]
  14241. },
  14242. "name": {
  14243. "type": "string",
  14244. "enum": ["session.updated.1"]
  14245. },
  14246. "id": {
  14247. "type": "string"
  14248. },
  14249. "seq": {
  14250. "type": "number"
  14251. },
  14252. "aggregateID": {
  14253. "type": "string",
  14254. "enum": ["sessionID"]
  14255. },
  14256. "data": {
  14257. "type": "object",
  14258. "properties": {
  14259. "sessionID": {
  14260. "type": "string"
  14261. },
  14262. "info": {
  14263. "type": "object",
  14264. "properties": {
  14265. "id": {
  14266. "anyOf": [
  14267. {
  14268. "type": "string"
  14269. },
  14270. {
  14271. "type": "null"
  14272. }
  14273. ]
  14274. },
  14275. "slug": {
  14276. "anyOf": [
  14277. {
  14278. "type": "string"
  14279. },
  14280. {
  14281. "type": "null"
  14282. }
  14283. ]
  14284. },
  14285. "projectID": {
  14286. "anyOf": [
  14287. {
  14288. "type": "string"
  14289. },
  14290. {
  14291. "type": "null"
  14292. }
  14293. ]
  14294. },
  14295. "workspaceID": {
  14296. "anyOf": [
  14297. {
  14298. "type": "string"
  14299. },
  14300. {
  14301. "type": "null"
  14302. }
  14303. ]
  14304. },
  14305. "directory": {
  14306. "anyOf": [
  14307. {
  14308. "type": "string"
  14309. },
  14310. {
  14311. "type": "null"
  14312. }
  14313. ]
  14314. },
  14315. "path": {
  14316. "anyOf": [
  14317. {
  14318. "type": "string"
  14319. },
  14320. {
  14321. "type": "null"
  14322. }
  14323. ]
  14324. },
  14325. "parentID": {
  14326. "anyOf": [
  14327. {
  14328. "type": "string"
  14329. },
  14330. {
  14331. "type": "null"
  14332. }
  14333. ]
  14334. },
  14335. "summary": {
  14336. "anyOf": [
  14337. {
  14338. "type": "object",
  14339. "properties": {
  14340. "additions": {
  14341. "type": "integer",
  14342. "minimum": 0
  14343. },
  14344. "deletions": {
  14345. "type": "integer",
  14346. "minimum": 0
  14347. },
  14348. "files": {
  14349. "type": "integer",
  14350. "minimum": 0
  14351. },
  14352. "diffs": {
  14353. "type": "array",
  14354. "items": {
  14355. "$ref": "#/components/schemas/SnapshotFileDiff"
  14356. }
  14357. }
  14358. },
  14359. "required": ["additions", "deletions", "files"],
  14360. "additionalProperties": false
  14361. },
  14362. {
  14363. "type": "null"
  14364. }
  14365. ]
  14366. },
  14367. "share": {
  14368. "type": "object",
  14369. "properties": {
  14370. "url": {
  14371. "anyOf": [
  14372. {
  14373. "type": "string"
  14374. },
  14375. {
  14376. "type": "null"
  14377. }
  14378. ]
  14379. }
  14380. },
  14381. "additionalProperties": false
  14382. },
  14383. "title": {
  14384. "anyOf": [
  14385. {
  14386. "type": "string"
  14387. },
  14388. {
  14389. "type": "null"
  14390. }
  14391. ]
  14392. },
  14393. "agent": {
  14394. "anyOf": [
  14395. {
  14396. "type": "string"
  14397. },
  14398. {
  14399. "type": "null"
  14400. }
  14401. ]
  14402. },
  14403. "model": {
  14404. "anyOf": [
  14405. {
  14406. "type": "object",
  14407. "properties": {
  14408. "id": {
  14409. "type": "string"
  14410. },
  14411. "providerID": {
  14412. "type": "string"
  14413. },
  14414. "variant": {
  14415. "type": "string"
  14416. }
  14417. },
  14418. "required": ["id", "providerID"],
  14419. "additionalProperties": false
  14420. },
  14421. {
  14422. "type": "null"
  14423. }
  14424. ]
  14425. },
  14426. "version": {
  14427. "anyOf": [
  14428. {
  14429. "type": "string"
  14430. },
  14431. {
  14432. "type": "null"
  14433. }
  14434. ]
  14435. },
  14436. "time": {
  14437. "type": "object",
  14438. "properties": {
  14439. "created": {
  14440. "anyOf": [
  14441. {
  14442. "type": "integer",
  14443. "minimum": 0
  14444. },
  14445. {
  14446. "type": "null"
  14447. }
  14448. ]
  14449. },
  14450. "updated": {
  14451. "anyOf": [
  14452. {
  14453. "type": "integer",
  14454. "minimum": 0
  14455. },
  14456. {
  14457. "type": "null"
  14458. }
  14459. ]
  14460. },
  14461. "compacting": {
  14462. "anyOf": [
  14463. {
  14464. "type": "integer",
  14465. "minimum": 0
  14466. },
  14467. {
  14468. "type": "null"
  14469. }
  14470. ]
  14471. },
  14472. "archived": {
  14473. "anyOf": [
  14474. {
  14475. "type": "number"
  14476. },
  14477. {
  14478. "type": "null"
  14479. }
  14480. ]
  14481. }
  14482. },
  14483. "additionalProperties": false
  14484. },
  14485. "permission": {
  14486. "anyOf": [
  14487. {
  14488. "$ref": "#/components/schemas/PermissionRuleset"
  14489. },
  14490. {
  14491. "type": "null"
  14492. }
  14493. ]
  14494. },
  14495. "revert": {
  14496. "anyOf": [
  14497. {
  14498. "type": "object",
  14499. "properties": {
  14500. "messageID": {
  14501. "type": "string"
  14502. },
  14503. "partID": {
  14504. "type": "string"
  14505. },
  14506. "snapshot": {
  14507. "type": "string"
  14508. },
  14509. "diff": {
  14510. "type": "string"
  14511. }
  14512. },
  14513. "required": ["messageID"],
  14514. "additionalProperties": false
  14515. },
  14516. {
  14517. "type": "null"
  14518. }
  14519. ]
  14520. }
  14521. },
  14522. "additionalProperties": false
  14523. }
  14524. },
  14525. "required": ["sessionID", "info"],
  14526. "additionalProperties": false
  14527. }
  14528. },
  14529. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14530. "additionalProperties": false
  14531. },
  14532. "SyncEventSessionDeleted": {
  14533. "type": "object",
  14534. "properties": {
  14535. "type": {
  14536. "type": "string",
  14537. "enum": ["sync"]
  14538. },
  14539. "name": {
  14540. "type": "string",
  14541. "enum": ["session.deleted.1"]
  14542. },
  14543. "id": {
  14544. "type": "string"
  14545. },
  14546. "seq": {
  14547. "type": "number"
  14548. },
  14549. "aggregateID": {
  14550. "type": "string",
  14551. "enum": ["sessionID"]
  14552. },
  14553. "data": {
  14554. "type": "object",
  14555. "properties": {
  14556. "sessionID": {
  14557. "type": "string"
  14558. },
  14559. "info": {
  14560. "$ref": "#/components/schemas/Session"
  14561. }
  14562. },
  14563. "required": ["sessionID", "info"],
  14564. "additionalProperties": false
  14565. }
  14566. },
  14567. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14568. "additionalProperties": false
  14569. },
  14570. "SyncEventSessionNextAgentSwitched": {
  14571. "type": "object",
  14572. "properties": {
  14573. "type": {
  14574. "type": "string",
  14575. "enum": ["sync"]
  14576. },
  14577. "name": {
  14578. "type": "string",
  14579. "enum": ["session.next.agent.switched.1"]
  14580. },
  14581. "id": {
  14582. "type": "string"
  14583. },
  14584. "seq": {
  14585. "type": "number"
  14586. },
  14587. "aggregateID": {
  14588. "type": "string",
  14589. "enum": ["sessionID"]
  14590. },
  14591. "data": {
  14592. "type": "object",
  14593. "properties": {
  14594. "timestamp": {
  14595. "type": "number"
  14596. },
  14597. "sessionID": {
  14598. "type": "string"
  14599. },
  14600. "agent": {
  14601. "type": "string"
  14602. }
  14603. },
  14604. "required": ["timestamp", "sessionID", "agent"],
  14605. "additionalProperties": false
  14606. }
  14607. },
  14608. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14609. "additionalProperties": false
  14610. },
  14611. "SyncEventSessionNextModelSwitched": {
  14612. "type": "object",
  14613. "properties": {
  14614. "type": {
  14615. "type": "string",
  14616. "enum": ["sync"]
  14617. },
  14618. "name": {
  14619. "type": "string",
  14620. "enum": ["session.next.model.switched.1"]
  14621. },
  14622. "id": {
  14623. "type": "string"
  14624. },
  14625. "seq": {
  14626. "type": "number"
  14627. },
  14628. "aggregateID": {
  14629. "type": "string",
  14630. "enum": ["sessionID"]
  14631. },
  14632. "data": {
  14633. "type": "object",
  14634. "properties": {
  14635. "timestamp": {
  14636. "type": "number"
  14637. },
  14638. "sessionID": {
  14639. "type": "string"
  14640. },
  14641. "id": {
  14642. "type": "string"
  14643. },
  14644. "providerID": {
  14645. "type": "string"
  14646. },
  14647. "variant": {
  14648. "type": "string"
  14649. }
  14650. },
  14651. "required": ["timestamp", "sessionID", "id", "providerID"],
  14652. "additionalProperties": false
  14653. }
  14654. },
  14655. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14656. "additionalProperties": false
  14657. },
  14658. "SyncEventSessionNextPrompted": {
  14659. "type": "object",
  14660. "properties": {
  14661. "type": {
  14662. "type": "string",
  14663. "enum": ["sync"]
  14664. },
  14665. "name": {
  14666. "type": "string",
  14667. "enum": ["session.next.prompted.1"]
  14668. },
  14669. "id": {
  14670. "type": "string"
  14671. },
  14672. "seq": {
  14673. "type": "number"
  14674. },
  14675. "aggregateID": {
  14676. "type": "string",
  14677. "enum": ["sessionID"]
  14678. },
  14679. "data": {
  14680. "type": "object",
  14681. "properties": {
  14682. "timestamp": {
  14683. "type": "number"
  14684. },
  14685. "sessionID": {
  14686. "type": "string"
  14687. },
  14688. "prompt": {
  14689. "$ref": "#/components/schemas/Prompt"
  14690. }
  14691. },
  14692. "required": ["timestamp", "sessionID", "prompt"],
  14693. "additionalProperties": false
  14694. }
  14695. },
  14696. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14697. "additionalProperties": false
  14698. },
  14699. "SyncEventSessionNextSynthetic": {
  14700. "type": "object",
  14701. "properties": {
  14702. "type": {
  14703. "type": "string",
  14704. "enum": ["sync"]
  14705. },
  14706. "name": {
  14707. "type": "string",
  14708. "enum": ["session.next.synthetic.1"]
  14709. },
  14710. "id": {
  14711. "type": "string"
  14712. },
  14713. "seq": {
  14714. "type": "number"
  14715. },
  14716. "aggregateID": {
  14717. "type": "string",
  14718. "enum": ["sessionID"]
  14719. },
  14720. "data": {
  14721. "type": "object",
  14722. "properties": {
  14723. "timestamp": {
  14724. "type": "number"
  14725. },
  14726. "sessionID": {
  14727. "type": "string"
  14728. },
  14729. "text": {
  14730. "type": "string"
  14731. }
  14732. },
  14733. "required": ["timestamp", "sessionID", "text"],
  14734. "additionalProperties": false
  14735. }
  14736. },
  14737. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14738. "additionalProperties": false
  14739. },
  14740. "SyncEventSessionNextShellStarted": {
  14741. "type": "object",
  14742. "properties": {
  14743. "type": {
  14744. "type": "string",
  14745. "enum": ["sync"]
  14746. },
  14747. "name": {
  14748. "type": "string",
  14749. "enum": ["session.next.shell.started.1"]
  14750. },
  14751. "id": {
  14752. "type": "string"
  14753. },
  14754. "seq": {
  14755. "type": "number"
  14756. },
  14757. "aggregateID": {
  14758. "type": "string",
  14759. "enum": ["sessionID"]
  14760. },
  14761. "data": {
  14762. "type": "object",
  14763. "properties": {
  14764. "timestamp": {
  14765. "type": "number"
  14766. },
  14767. "sessionID": {
  14768. "type": "string"
  14769. },
  14770. "callID": {
  14771. "type": "string"
  14772. },
  14773. "command": {
  14774. "type": "string"
  14775. }
  14776. },
  14777. "required": ["timestamp", "sessionID", "callID", "command"],
  14778. "additionalProperties": false
  14779. }
  14780. },
  14781. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14782. "additionalProperties": false
  14783. },
  14784. "SyncEventSessionNextShellEnded": {
  14785. "type": "object",
  14786. "properties": {
  14787. "type": {
  14788. "type": "string",
  14789. "enum": ["sync"]
  14790. },
  14791. "name": {
  14792. "type": "string",
  14793. "enum": ["session.next.shell.ended.1"]
  14794. },
  14795. "id": {
  14796. "type": "string"
  14797. },
  14798. "seq": {
  14799. "type": "number"
  14800. },
  14801. "aggregateID": {
  14802. "type": "string",
  14803. "enum": ["sessionID"]
  14804. },
  14805. "data": {
  14806. "type": "object",
  14807. "properties": {
  14808. "timestamp": {
  14809. "type": "number"
  14810. },
  14811. "sessionID": {
  14812. "type": "string"
  14813. },
  14814. "callID": {
  14815. "type": "string"
  14816. },
  14817. "output": {
  14818. "type": "string"
  14819. }
  14820. },
  14821. "required": ["timestamp", "sessionID", "callID", "output"],
  14822. "additionalProperties": false
  14823. }
  14824. },
  14825. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14826. "additionalProperties": false
  14827. },
  14828. "SyncEventSessionNextStepStarted": {
  14829. "type": "object",
  14830. "properties": {
  14831. "type": {
  14832. "type": "string",
  14833. "enum": ["sync"]
  14834. },
  14835. "name": {
  14836. "type": "string",
  14837. "enum": ["session.next.step.started.1"]
  14838. },
  14839. "id": {
  14840. "type": "string"
  14841. },
  14842. "seq": {
  14843. "type": "number"
  14844. },
  14845. "aggregateID": {
  14846. "type": "string",
  14847. "enum": ["sessionID"]
  14848. },
  14849. "data": {
  14850. "type": "object",
  14851. "properties": {
  14852. "timestamp": {
  14853. "type": "number"
  14854. },
  14855. "sessionID": {
  14856. "type": "string"
  14857. },
  14858. "agent": {
  14859. "type": "string"
  14860. },
  14861. "model": {
  14862. "type": "object",
  14863. "properties": {
  14864. "id": {
  14865. "type": "string"
  14866. },
  14867. "providerID": {
  14868. "type": "string"
  14869. },
  14870. "variant": {
  14871. "type": "string"
  14872. }
  14873. },
  14874. "required": ["id", "providerID"],
  14875. "additionalProperties": false
  14876. },
  14877. "snapshot": {
  14878. "type": "string"
  14879. }
  14880. },
  14881. "required": ["timestamp", "sessionID", "agent", "model"],
  14882. "additionalProperties": false
  14883. }
  14884. },
  14885. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14886. "additionalProperties": false
  14887. },
  14888. "SyncEventSessionNextStepEnded": {
  14889. "type": "object",
  14890. "properties": {
  14891. "type": {
  14892. "type": "string",
  14893. "enum": ["sync"]
  14894. },
  14895. "name": {
  14896. "type": "string",
  14897. "enum": ["session.next.step.ended.1"]
  14898. },
  14899. "id": {
  14900. "type": "string"
  14901. },
  14902. "seq": {
  14903. "type": "number"
  14904. },
  14905. "aggregateID": {
  14906. "type": "string",
  14907. "enum": ["sessionID"]
  14908. },
  14909. "data": {
  14910. "type": "object",
  14911. "properties": {
  14912. "timestamp": {
  14913. "type": "number"
  14914. },
  14915. "sessionID": {
  14916. "type": "string"
  14917. },
  14918. "finish": {
  14919. "type": "string"
  14920. },
  14921. "cost": {
  14922. "type": "number"
  14923. },
  14924. "tokens": {
  14925. "type": "object",
  14926. "properties": {
  14927. "input": {
  14928. "type": "integer",
  14929. "minimum": 0
  14930. },
  14931. "output": {
  14932. "type": "integer",
  14933. "minimum": 0
  14934. },
  14935. "reasoning": {
  14936. "type": "integer",
  14937. "minimum": 0
  14938. },
  14939. "cache": {
  14940. "type": "object",
  14941. "properties": {
  14942. "read": {
  14943. "type": "integer",
  14944. "minimum": 0
  14945. },
  14946. "write": {
  14947. "type": "integer",
  14948. "minimum": 0
  14949. }
  14950. },
  14951. "required": ["read", "write"],
  14952. "additionalProperties": false
  14953. }
  14954. },
  14955. "required": ["input", "output", "reasoning", "cache"],
  14956. "additionalProperties": false
  14957. },
  14958. "snapshot": {
  14959. "type": "string"
  14960. }
  14961. },
  14962. "required": ["timestamp", "sessionID", "finish", "cost", "tokens"],
  14963. "additionalProperties": false
  14964. }
  14965. },
  14966. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14967. "additionalProperties": false
  14968. },
  14969. "SyncEventSessionNextStepFailed": {
  14970. "type": "object",
  14971. "properties": {
  14972. "type": {
  14973. "type": "string",
  14974. "enum": ["sync"]
  14975. },
  14976. "name": {
  14977. "type": "string",
  14978. "enum": ["session.next.step.failed.1"]
  14979. },
  14980. "id": {
  14981. "type": "string"
  14982. },
  14983. "seq": {
  14984. "type": "number"
  14985. },
  14986. "aggregateID": {
  14987. "type": "string",
  14988. "enum": ["sessionID"]
  14989. },
  14990. "data": {
  14991. "type": "object",
  14992. "properties": {
  14993. "timestamp": {
  14994. "type": "number"
  14995. },
  14996. "sessionID": {
  14997. "type": "string"
  14998. },
  14999. "error": {
  15000. "type": "object",
  15001. "properties": {
  15002. "type": {
  15003. "type": "string"
  15004. },
  15005. "message": {
  15006. "type": "string"
  15007. }
  15008. },
  15009. "required": ["type", "message"],
  15010. "additionalProperties": false
  15011. }
  15012. },
  15013. "required": ["timestamp", "sessionID", "error"],
  15014. "additionalProperties": false
  15015. }
  15016. },
  15017. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15018. "additionalProperties": false
  15019. },
  15020. "SyncEventSessionNextTextStarted": {
  15021. "type": "object",
  15022. "properties": {
  15023. "type": {
  15024. "type": "string",
  15025. "enum": ["sync"]
  15026. },
  15027. "name": {
  15028. "type": "string",
  15029. "enum": ["session.next.text.started.1"]
  15030. },
  15031. "id": {
  15032. "type": "string"
  15033. },
  15034. "seq": {
  15035. "type": "number"
  15036. },
  15037. "aggregateID": {
  15038. "type": "string",
  15039. "enum": ["sessionID"]
  15040. },
  15041. "data": {
  15042. "type": "object",
  15043. "properties": {
  15044. "timestamp": {
  15045. "type": "number"
  15046. },
  15047. "sessionID": {
  15048. "type": "string"
  15049. }
  15050. },
  15051. "required": ["timestamp", "sessionID"],
  15052. "additionalProperties": false
  15053. }
  15054. },
  15055. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15056. "additionalProperties": false
  15057. },
  15058. "SyncEventSessionNextTextDelta": {
  15059. "type": "object",
  15060. "properties": {
  15061. "type": {
  15062. "type": "string",
  15063. "enum": ["sync"]
  15064. },
  15065. "name": {
  15066. "type": "string",
  15067. "enum": ["session.next.text.delta.1"]
  15068. },
  15069. "id": {
  15070. "type": "string"
  15071. },
  15072. "seq": {
  15073. "type": "number"
  15074. },
  15075. "aggregateID": {
  15076. "type": "string",
  15077. "enum": ["sessionID"]
  15078. },
  15079. "data": {
  15080. "type": "object",
  15081. "properties": {
  15082. "timestamp": {
  15083. "type": "number"
  15084. },
  15085. "sessionID": {
  15086. "type": "string"
  15087. },
  15088. "delta": {
  15089. "type": "string"
  15090. }
  15091. },
  15092. "required": ["timestamp", "sessionID", "delta"],
  15093. "additionalProperties": false
  15094. }
  15095. },
  15096. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15097. "additionalProperties": false
  15098. },
  15099. "SyncEventSessionNextTextEnded": {
  15100. "type": "object",
  15101. "properties": {
  15102. "type": {
  15103. "type": "string",
  15104. "enum": ["sync"]
  15105. },
  15106. "name": {
  15107. "type": "string",
  15108. "enum": ["session.next.text.ended.1"]
  15109. },
  15110. "id": {
  15111. "type": "string"
  15112. },
  15113. "seq": {
  15114. "type": "number"
  15115. },
  15116. "aggregateID": {
  15117. "type": "string",
  15118. "enum": ["sessionID"]
  15119. },
  15120. "data": {
  15121. "type": "object",
  15122. "properties": {
  15123. "timestamp": {
  15124. "type": "number"
  15125. },
  15126. "sessionID": {
  15127. "type": "string"
  15128. },
  15129. "text": {
  15130. "type": "string"
  15131. }
  15132. },
  15133. "required": ["timestamp", "sessionID", "text"],
  15134. "additionalProperties": false
  15135. }
  15136. },
  15137. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15138. "additionalProperties": false
  15139. },
  15140. "SyncEventSessionNextReasoningStarted": {
  15141. "type": "object",
  15142. "properties": {
  15143. "type": {
  15144. "type": "string",
  15145. "enum": ["sync"]
  15146. },
  15147. "name": {
  15148. "type": "string",
  15149. "enum": ["session.next.reasoning.started.1"]
  15150. },
  15151. "id": {
  15152. "type": "string"
  15153. },
  15154. "seq": {
  15155. "type": "number"
  15156. },
  15157. "aggregateID": {
  15158. "type": "string",
  15159. "enum": ["sessionID"]
  15160. },
  15161. "data": {
  15162. "type": "object",
  15163. "properties": {
  15164. "timestamp": {
  15165. "type": "number"
  15166. },
  15167. "sessionID": {
  15168. "type": "string"
  15169. },
  15170. "reasoningID": {
  15171. "type": "string"
  15172. }
  15173. },
  15174. "required": ["timestamp", "sessionID", "reasoningID"],
  15175. "additionalProperties": false
  15176. }
  15177. },
  15178. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15179. "additionalProperties": false
  15180. },
  15181. "SyncEventSessionNextReasoningDelta": {
  15182. "type": "object",
  15183. "properties": {
  15184. "type": {
  15185. "type": "string",
  15186. "enum": ["sync"]
  15187. },
  15188. "name": {
  15189. "type": "string",
  15190. "enum": ["session.next.reasoning.delta.1"]
  15191. },
  15192. "id": {
  15193. "type": "string"
  15194. },
  15195. "seq": {
  15196. "type": "number"
  15197. },
  15198. "aggregateID": {
  15199. "type": "string",
  15200. "enum": ["sessionID"]
  15201. },
  15202. "data": {
  15203. "type": "object",
  15204. "properties": {
  15205. "timestamp": {
  15206. "type": "number"
  15207. },
  15208. "sessionID": {
  15209. "type": "string"
  15210. },
  15211. "reasoningID": {
  15212. "type": "string"
  15213. },
  15214. "delta": {
  15215. "type": "string"
  15216. }
  15217. },
  15218. "required": ["timestamp", "sessionID", "reasoningID", "delta"],
  15219. "additionalProperties": false
  15220. }
  15221. },
  15222. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15223. "additionalProperties": false
  15224. },
  15225. "SyncEventSessionNextReasoningEnded": {
  15226. "type": "object",
  15227. "properties": {
  15228. "type": {
  15229. "type": "string",
  15230. "enum": ["sync"]
  15231. },
  15232. "name": {
  15233. "type": "string",
  15234. "enum": ["session.next.reasoning.ended.1"]
  15235. },
  15236. "id": {
  15237. "type": "string"
  15238. },
  15239. "seq": {
  15240. "type": "number"
  15241. },
  15242. "aggregateID": {
  15243. "type": "string",
  15244. "enum": ["sessionID"]
  15245. },
  15246. "data": {
  15247. "type": "object",
  15248. "properties": {
  15249. "timestamp": {
  15250. "type": "number"
  15251. },
  15252. "sessionID": {
  15253. "type": "string"
  15254. },
  15255. "reasoningID": {
  15256. "type": "string"
  15257. },
  15258. "text": {
  15259. "type": "string"
  15260. }
  15261. },
  15262. "required": ["timestamp", "sessionID", "reasoningID", "text"],
  15263. "additionalProperties": false
  15264. }
  15265. },
  15266. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15267. "additionalProperties": false
  15268. },
  15269. "SyncEventSessionNextToolInputStarted": {
  15270. "type": "object",
  15271. "properties": {
  15272. "type": {
  15273. "type": "string",
  15274. "enum": ["sync"]
  15275. },
  15276. "name": {
  15277. "type": "string",
  15278. "enum": ["session.next.tool.input.started.1"]
  15279. },
  15280. "id": {
  15281. "type": "string"
  15282. },
  15283. "seq": {
  15284. "type": "number"
  15285. },
  15286. "aggregateID": {
  15287. "type": "string",
  15288. "enum": ["sessionID"]
  15289. },
  15290. "data": {
  15291. "type": "object",
  15292. "properties": {
  15293. "timestamp": {
  15294. "type": "number"
  15295. },
  15296. "sessionID": {
  15297. "type": "string"
  15298. },
  15299. "callID": {
  15300. "type": "string"
  15301. },
  15302. "name": {
  15303. "type": "string"
  15304. }
  15305. },
  15306. "required": ["timestamp", "sessionID", "callID", "name"],
  15307. "additionalProperties": false
  15308. }
  15309. },
  15310. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15311. "additionalProperties": false
  15312. },
  15313. "SyncEventSessionNextToolInputDelta": {
  15314. "type": "object",
  15315. "properties": {
  15316. "type": {
  15317. "type": "string",
  15318. "enum": ["sync"]
  15319. },
  15320. "name": {
  15321. "type": "string",
  15322. "enum": ["session.next.tool.input.delta.1"]
  15323. },
  15324. "id": {
  15325. "type": "string"
  15326. },
  15327. "seq": {
  15328. "type": "number"
  15329. },
  15330. "aggregateID": {
  15331. "type": "string",
  15332. "enum": ["sessionID"]
  15333. },
  15334. "data": {
  15335. "type": "object",
  15336. "properties": {
  15337. "timestamp": {
  15338. "type": "number"
  15339. },
  15340. "sessionID": {
  15341. "type": "string"
  15342. },
  15343. "callID": {
  15344. "type": "string"
  15345. },
  15346. "delta": {
  15347. "type": "string"
  15348. }
  15349. },
  15350. "required": ["timestamp", "sessionID", "callID", "delta"],
  15351. "additionalProperties": false
  15352. }
  15353. },
  15354. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15355. "additionalProperties": false
  15356. },
  15357. "SyncEventSessionNextToolInputEnded": {
  15358. "type": "object",
  15359. "properties": {
  15360. "type": {
  15361. "type": "string",
  15362. "enum": ["sync"]
  15363. },
  15364. "name": {
  15365. "type": "string",
  15366. "enum": ["session.next.tool.input.ended.1"]
  15367. },
  15368. "id": {
  15369. "type": "string"
  15370. },
  15371. "seq": {
  15372. "type": "number"
  15373. },
  15374. "aggregateID": {
  15375. "type": "string",
  15376. "enum": ["sessionID"]
  15377. },
  15378. "data": {
  15379. "type": "object",
  15380. "properties": {
  15381. "timestamp": {
  15382. "type": "number"
  15383. },
  15384. "sessionID": {
  15385. "type": "string"
  15386. },
  15387. "callID": {
  15388. "type": "string"
  15389. },
  15390. "text": {
  15391. "type": "string"
  15392. }
  15393. },
  15394. "required": ["timestamp", "sessionID", "callID", "text"],
  15395. "additionalProperties": false
  15396. }
  15397. },
  15398. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15399. "additionalProperties": false
  15400. },
  15401. "SyncEventSessionNextToolCalled": {
  15402. "type": "object",
  15403. "properties": {
  15404. "type": {
  15405. "type": "string",
  15406. "enum": ["sync"]
  15407. },
  15408. "name": {
  15409. "type": "string",
  15410. "enum": ["session.next.tool.called.1"]
  15411. },
  15412. "id": {
  15413. "type": "string"
  15414. },
  15415. "seq": {
  15416. "type": "number"
  15417. },
  15418. "aggregateID": {
  15419. "type": "string",
  15420. "enum": ["sessionID"]
  15421. },
  15422. "data": {
  15423. "type": "object",
  15424. "properties": {
  15425. "timestamp": {
  15426. "type": "number"
  15427. },
  15428. "sessionID": {
  15429. "type": "string"
  15430. },
  15431. "callID": {
  15432. "type": "string"
  15433. },
  15434. "tool": {
  15435. "type": "string"
  15436. },
  15437. "input": {
  15438. "type": "object"
  15439. },
  15440. "provider": {
  15441. "type": "object",
  15442. "properties": {
  15443. "executed": {
  15444. "type": "boolean"
  15445. },
  15446. "metadata": {
  15447. "type": "object"
  15448. }
  15449. },
  15450. "required": ["executed"],
  15451. "additionalProperties": false
  15452. }
  15453. },
  15454. "required": ["timestamp", "sessionID", "callID", "tool", "input", "provider"],
  15455. "additionalProperties": false
  15456. }
  15457. },
  15458. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15459. "additionalProperties": false
  15460. },
  15461. "SyncEventSessionNextToolProgress": {
  15462. "type": "object",
  15463. "properties": {
  15464. "type": {
  15465. "type": "string",
  15466. "enum": ["sync"]
  15467. },
  15468. "name": {
  15469. "type": "string",
  15470. "enum": ["session.next.tool.progress.1"]
  15471. },
  15472. "id": {
  15473. "type": "string"
  15474. },
  15475. "seq": {
  15476. "type": "number"
  15477. },
  15478. "aggregateID": {
  15479. "type": "string",
  15480. "enum": ["sessionID"]
  15481. },
  15482. "data": {
  15483. "type": "object",
  15484. "properties": {
  15485. "timestamp": {
  15486. "type": "number"
  15487. },
  15488. "sessionID": {
  15489. "type": "string"
  15490. },
  15491. "callID": {
  15492. "type": "string"
  15493. },
  15494. "structured": {
  15495. "type": "object"
  15496. },
  15497. "content": {
  15498. "type": "array",
  15499. "items": {
  15500. "anyOf": [
  15501. {
  15502. "$ref": "#/components/schemas/ToolTextContent"
  15503. },
  15504. {
  15505. "$ref": "#/components/schemas/ToolFileContent"
  15506. }
  15507. ]
  15508. }
  15509. }
  15510. },
  15511. "required": ["timestamp", "sessionID", "callID", "structured", "content"],
  15512. "additionalProperties": false
  15513. }
  15514. },
  15515. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15516. "additionalProperties": false
  15517. },
  15518. "SyncEventSessionNextToolSuccess": {
  15519. "type": "object",
  15520. "properties": {
  15521. "type": {
  15522. "type": "string",
  15523. "enum": ["sync"]
  15524. },
  15525. "name": {
  15526. "type": "string",
  15527. "enum": ["session.next.tool.success.1"]
  15528. },
  15529. "id": {
  15530. "type": "string"
  15531. },
  15532. "seq": {
  15533. "type": "number"
  15534. },
  15535. "aggregateID": {
  15536. "type": "string",
  15537. "enum": ["sessionID"]
  15538. },
  15539. "data": {
  15540. "type": "object",
  15541. "properties": {
  15542. "timestamp": {
  15543. "type": "number"
  15544. },
  15545. "sessionID": {
  15546. "type": "string"
  15547. },
  15548. "callID": {
  15549. "type": "string"
  15550. },
  15551. "structured": {
  15552. "type": "object"
  15553. },
  15554. "content": {
  15555. "type": "array",
  15556. "items": {
  15557. "anyOf": [
  15558. {
  15559. "$ref": "#/components/schemas/ToolTextContent"
  15560. },
  15561. {
  15562. "$ref": "#/components/schemas/ToolFileContent"
  15563. }
  15564. ]
  15565. }
  15566. },
  15567. "provider": {
  15568. "type": "object",
  15569. "properties": {
  15570. "executed": {
  15571. "type": "boolean"
  15572. },
  15573. "metadata": {
  15574. "type": "object"
  15575. }
  15576. },
  15577. "required": ["executed"],
  15578. "additionalProperties": false
  15579. }
  15580. },
  15581. "required": ["timestamp", "sessionID", "callID", "structured", "content", "provider"],
  15582. "additionalProperties": false
  15583. }
  15584. },
  15585. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15586. "additionalProperties": false
  15587. },
  15588. "SyncEventSessionNextToolFailed": {
  15589. "type": "object",
  15590. "properties": {
  15591. "type": {
  15592. "type": "string",
  15593. "enum": ["sync"]
  15594. },
  15595. "name": {
  15596. "type": "string",
  15597. "enum": ["session.next.tool.failed.1"]
  15598. },
  15599. "id": {
  15600. "type": "string"
  15601. },
  15602. "seq": {
  15603. "type": "number"
  15604. },
  15605. "aggregateID": {
  15606. "type": "string",
  15607. "enum": ["sessionID"]
  15608. },
  15609. "data": {
  15610. "type": "object",
  15611. "properties": {
  15612. "timestamp": {
  15613. "type": "number"
  15614. },
  15615. "sessionID": {
  15616. "type": "string"
  15617. },
  15618. "callID": {
  15619. "type": "string"
  15620. },
  15621. "error": {
  15622. "type": "object",
  15623. "properties": {
  15624. "type": {
  15625. "type": "string"
  15626. },
  15627. "message": {
  15628. "type": "string"
  15629. }
  15630. },
  15631. "required": ["type", "message"],
  15632. "additionalProperties": false
  15633. },
  15634. "provider": {
  15635. "type": "object",
  15636. "properties": {
  15637. "executed": {
  15638. "type": "boolean"
  15639. },
  15640. "metadata": {
  15641. "type": "object"
  15642. }
  15643. },
  15644. "required": ["executed"],
  15645. "additionalProperties": false
  15646. }
  15647. },
  15648. "required": ["timestamp", "sessionID", "callID", "error", "provider"],
  15649. "additionalProperties": false
  15650. }
  15651. },
  15652. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15653. "additionalProperties": false
  15654. },
  15655. "SyncEventSessionNextRetried": {
  15656. "type": "object",
  15657. "properties": {
  15658. "type": {
  15659. "type": "string",
  15660. "enum": ["sync"]
  15661. },
  15662. "name": {
  15663. "type": "string",
  15664. "enum": ["session.next.retried.1"]
  15665. },
  15666. "id": {
  15667. "type": "string"
  15668. },
  15669. "seq": {
  15670. "type": "number"
  15671. },
  15672. "aggregateID": {
  15673. "type": "string",
  15674. "enum": ["sessionID"]
  15675. },
  15676. "data": {
  15677. "type": "object",
  15678. "properties": {
  15679. "timestamp": {
  15680. "type": "number"
  15681. },
  15682. "sessionID": {
  15683. "type": "string"
  15684. },
  15685. "attempt": {
  15686. "type": "integer",
  15687. "minimum": 0
  15688. },
  15689. "error": {
  15690. "$ref": "#/components/schemas/SessionNextRetry_error"
  15691. }
  15692. },
  15693. "required": ["timestamp", "sessionID", "attempt", "error"],
  15694. "additionalProperties": false
  15695. }
  15696. },
  15697. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15698. "additionalProperties": false
  15699. },
  15700. "SyncEventSessionNextCompactionStarted": {
  15701. "type": "object",
  15702. "properties": {
  15703. "type": {
  15704. "type": "string",
  15705. "enum": ["sync"]
  15706. },
  15707. "name": {
  15708. "type": "string",
  15709. "enum": ["session.next.compaction.started.1"]
  15710. },
  15711. "id": {
  15712. "type": "string"
  15713. },
  15714. "seq": {
  15715. "type": "number"
  15716. },
  15717. "aggregateID": {
  15718. "type": "string",
  15719. "enum": ["sessionID"]
  15720. },
  15721. "data": {
  15722. "type": "object",
  15723. "properties": {
  15724. "timestamp": {
  15725. "type": "number"
  15726. },
  15727. "sessionID": {
  15728. "type": "string"
  15729. },
  15730. "reason": {
  15731. "type": "string",
  15732. "enum": ["auto", "manual"]
  15733. }
  15734. },
  15735. "required": ["timestamp", "sessionID", "reason"],
  15736. "additionalProperties": false
  15737. }
  15738. },
  15739. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15740. "additionalProperties": false
  15741. },
  15742. "SyncEventSessionNextCompactionDelta": {
  15743. "type": "object",
  15744. "properties": {
  15745. "type": {
  15746. "type": "string",
  15747. "enum": ["sync"]
  15748. },
  15749. "name": {
  15750. "type": "string",
  15751. "enum": ["session.next.compaction.delta.1"]
  15752. },
  15753. "id": {
  15754. "type": "string"
  15755. },
  15756. "seq": {
  15757. "type": "number"
  15758. },
  15759. "aggregateID": {
  15760. "type": "string",
  15761. "enum": ["sessionID"]
  15762. },
  15763. "data": {
  15764. "type": "object",
  15765. "properties": {
  15766. "timestamp": {
  15767. "type": "number"
  15768. },
  15769. "sessionID": {
  15770. "type": "string"
  15771. },
  15772. "text": {
  15773. "type": "string"
  15774. }
  15775. },
  15776. "required": ["timestamp", "sessionID", "text"],
  15777. "additionalProperties": false
  15778. }
  15779. },
  15780. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15781. "additionalProperties": false
  15782. },
  15783. "SyncEventSessionNextCompactionEnded": {
  15784. "type": "object",
  15785. "properties": {
  15786. "type": {
  15787. "type": "string",
  15788. "enum": ["sync"]
  15789. },
  15790. "name": {
  15791. "type": "string",
  15792. "enum": ["session.next.compaction.ended.1"]
  15793. },
  15794. "id": {
  15795. "type": "string"
  15796. },
  15797. "seq": {
  15798. "type": "number"
  15799. },
  15800. "aggregateID": {
  15801. "type": "string",
  15802. "enum": ["sessionID"]
  15803. },
  15804. "data": {
  15805. "type": "object",
  15806. "properties": {
  15807. "timestamp": {
  15808. "type": "number"
  15809. },
  15810. "sessionID": {
  15811. "type": "string"
  15812. },
  15813. "text": {
  15814. "type": "string"
  15815. },
  15816. "include": {
  15817. "type": "string"
  15818. }
  15819. },
  15820. "required": ["timestamp", "sessionID", "text"],
  15821. "additionalProperties": false
  15822. }
  15823. },
  15824. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15825. "additionalProperties": false
  15826. },
  15827. "EventServerInstanceDisposed": {
  15828. "type": "object",
  15829. "properties": {
  15830. "id": {
  15831. "type": "string"
  15832. },
  15833. "type": {
  15834. "type": "string",
  15835. "enum": ["server.instance.disposed"]
  15836. },
  15837. "properties": {
  15838. "type": "object",
  15839. "properties": {
  15840. "directory": {
  15841. "type": "string"
  15842. }
  15843. },
  15844. "required": ["directory"],
  15845. "additionalProperties": false
  15846. }
  15847. },
  15848. "required": ["id", "type", "properties"],
  15849. "additionalProperties": false
  15850. },
  15851. "EventFileEdited": {
  15852. "type": "object",
  15853. "properties": {
  15854. "id": {
  15855. "type": "string"
  15856. },
  15857. "type": {
  15858. "type": "string",
  15859. "enum": ["file.edited"]
  15860. },
  15861. "properties": {
  15862. "type": "object",
  15863. "properties": {
  15864. "file": {
  15865. "type": "string"
  15866. }
  15867. },
  15868. "required": ["file"],
  15869. "additionalProperties": false
  15870. }
  15871. },
  15872. "required": ["id", "type", "properties"],
  15873. "additionalProperties": false
  15874. },
  15875. "EventFileWatcherUpdated": {
  15876. "type": "object",
  15877. "properties": {
  15878. "id": {
  15879. "type": "string"
  15880. },
  15881. "type": {
  15882. "type": "string",
  15883. "enum": ["file.watcher.updated"]
  15884. },
  15885. "properties": {
  15886. "type": "object",
  15887. "properties": {
  15888. "file": {
  15889. "type": "string"
  15890. },
  15891. "event": {
  15892. "type": "string",
  15893. "enum": ["add", "change", "unlink"]
  15894. }
  15895. },
  15896. "required": ["file", "event"],
  15897. "additionalProperties": false
  15898. }
  15899. },
  15900. "required": ["id", "type", "properties"],
  15901. "additionalProperties": false
  15902. },
  15903. "EventLspClientDiagnostics": {
  15904. "type": "object",
  15905. "properties": {
  15906. "id": {
  15907. "type": "string"
  15908. },
  15909. "type": {
  15910. "type": "string",
  15911. "enum": ["lsp.client.diagnostics"]
  15912. },
  15913. "properties": {
  15914. "type": "object",
  15915. "properties": {
  15916. "serverID": {
  15917. "type": "string"
  15918. },
  15919. "path": {
  15920. "type": "string"
  15921. }
  15922. },
  15923. "required": ["serverID", "path"],
  15924. "additionalProperties": false
  15925. }
  15926. },
  15927. "required": ["id", "type", "properties"],
  15928. "additionalProperties": false
  15929. },
  15930. "EventLspUpdated": {
  15931. "type": "object",
  15932. "properties": {
  15933. "id": {
  15934. "type": "string"
  15935. },
  15936. "type": {
  15937. "type": "string",
  15938. "enum": ["lsp.updated"]
  15939. },
  15940. "properties": {
  15941. "type": "object",
  15942. "properties": {}
  15943. }
  15944. },
  15945. "required": ["id", "type", "properties"],
  15946. "additionalProperties": false
  15947. },
  15948. "EventMessagePartDelta": {
  15949. "type": "object",
  15950. "properties": {
  15951. "id": {
  15952. "type": "string"
  15953. },
  15954. "type": {
  15955. "type": "string",
  15956. "enum": ["message.part.delta"]
  15957. },
  15958. "properties": {
  15959. "type": "object",
  15960. "properties": {
  15961. "sessionID": {
  15962. "type": "string"
  15963. },
  15964. "messageID": {
  15965. "type": "string"
  15966. },
  15967. "partID": {
  15968. "type": "string"
  15969. },
  15970. "field": {
  15971. "type": "string"
  15972. },
  15973. "delta": {
  15974. "type": "string"
  15975. }
  15976. },
  15977. "required": ["sessionID", "messageID", "partID", "field", "delta"],
  15978. "additionalProperties": false
  15979. }
  15980. },
  15981. "required": ["id", "type", "properties"],
  15982. "additionalProperties": false
  15983. },
  15984. "EventPermissionAsked": {
  15985. "type": "object",
  15986. "properties": {
  15987. "id": {
  15988. "type": "string"
  15989. },
  15990. "type": {
  15991. "type": "string",
  15992. "enum": ["permission.asked"]
  15993. },
  15994. "properties": {
  15995. "$ref": "#/components/schemas/PermissionRequest"
  15996. }
  15997. },
  15998. "required": ["id", "type", "properties"],
  15999. "additionalProperties": false
  16000. },
  16001. "EventPermissionReplied": {
  16002. "type": "object",
  16003. "properties": {
  16004. "id": {
  16005. "type": "string"
  16006. },
  16007. "type": {
  16008. "type": "string",
  16009. "enum": ["permission.replied"]
  16010. },
  16011. "properties": {
  16012. "type": "object",
  16013. "properties": {
  16014. "sessionID": {
  16015. "type": "string"
  16016. },
  16017. "requestID": {
  16018. "type": "string"
  16019. },
  16020. "reply": {
  16021. "type": "string",
  16022. "enum": ["once", "always", "reject"]
  16023. }
  16024. },
  16025. "required": ["sessionID", "requestID", "reply"],
  16026. "additionalProperties": false
  16027. }
  16028. },
  16029. "required": ["id", "type", "properties"],
  16030. "additionalProperties": false
  16031. },
  16032. "EventSessionDiff": {
  16033. "type": "object",
  16034. "properties": {
  16035. "id": {
  16036. "type": "string"
  16037. },
  16038. "type": {
  16039. "type": "string",
  16040. "enum": ["session.diff"]
  16041. },
  16042. "properties": {
  16043. "type": "object",
  16044. "properties": {
  16045. "sessionID": {
  16046. "type": "string"
  16047. },
  16048. "diff": {
  16049. "type": "array",
  16050. "items": {
  16051. "$ref": "#/components/schemas/SnapshotFileDiff"
  16052. }
  16053. }
  16054. },
  16055. "required": ["sessionID", "diff"],
  16056. "additionalProperties": false
  16057. }
  16058. },
  16059. "required": ["id", "type", "properties"],
  16060. "additionalProperties": false
  16061. },
  16062. "EventSessionError": {
  16063. "type": "object",
  16064. "properties": {
  16065. "id": {
  16066. "type": "string"
  16067. },
  16068. "type": {
  16069. "type": "string",
  16070. "enum": ["session.error"]
  16071. },
  16072. "properties": {
  16073. "type": "object",
  16074. "properties": {
  16075. "sessionID": {
  16076. "type": "string"
  16077. },
  16078. "error": {
  16079. "anyOf": [
  16080. {
  16081. "$ref": "#/components/schemas/ProviderAuthError"
  16082. },
  16083. {
  16084. "$ref": "#/components/schemas/UnknownError"
  16085. },
  16086. {
  16087. "$ref": "#/components/schemas/MessageOutputLengthError"
  16088. },
  16089. {
  16090. "$ref": "#/components/schemas/MessageAbortedError"
  16091. },
  16092. {
  16093. "$ref": "#/components/schemas/StructuredOutputError"
  16094. },
  16095. {
  16096. "$ref": "#/components/schemas/ContextOverflowError"
  16097. },
  16098. {
  16099. "$ref": "#/components/schemas/APIError"
  16100. }
  16101. ]
  16102. }
  16103. },
  16104. "additionalProperties": false
  16105. }
  16106. },
  16107. "required": ["id", "type", "properties"],
  16108. "additionalProperties": false
  16109. },
  16110. "EventInstallationUpdated": {
  16111. "type": "object",
  16112. "properties": {
  16113. "id": {
  16114. "type": "string"
  16115. },
  16116. "type": {
  16117. "type": "string",
  16118. "enum": ["installation.updated"]
  16119. },
  16120. "properties": {
  16121. "type": "object",
  16122. "properties": {
  16123. "version": {
  16124. "type": "string"
  16125. }
  16126. },
  16127. "required": ["version"],
  16128. "additionalProperties": false
  16129. }
  16130. },
  16131. "required": ["id", "type", "properties"],
  16132. "additionalProperties": false
  16133. },
  16134. "EventInstallationUpdate-available": {
  16135. "type": "object",
  16136. "properties": {
  16137. "id": {
  16138. "type": "string"
  16139. },
  16140. "type": {
  16141. "type": "string",
  16142. "enum": ["installation.update-available"]
  16143. },
  16144. "properties": {
  16145. "type": "object",
  16146. "properties": {
  16147. "version": {
  16148. "type": "string"
  16149. }
  16150. },
  16151. "required": ["version"],
  16152. "additionalProperties": false
  16153. }
  16154. },
  16155. "required": ["id", "type", "properties"],
  16156. "additionalProperties": false
  16157. },
  16158. "EventQuestionAsked": {
  16159. "type": "object",
  16160. "properties": {
  16161. "id": {
  16162. "type": "string"
  16163. },
  16164. "type": {
  16165. "type": "string",
  16166. "enum": ["question.asked"]
  16167. },
  16168. "properties": {
  16169. "$ref": "#/components/schemas/QuestionRequest"
  16170. }
  16171. },
  16172. "required": ["id", "type", "properties"],
  16173. "additionalProperties": false
  16174. },
  16175. "EventQuestionReplied": {
  16176. "type": "object",
  16177. "properties": {
  16178. "id": {
  16179. "type": "string"
  16180. },
  16181. "type": {
  16182. "type": "string",
  16183. "enum": ["question.replied"]
  16184. },
  16185. "properties": {
  16186. "$ref": "#/components/schemas/QuestionReplied"
  16187. }
  16188. },
  16189. "required": ["id", "type", "properties"],
  16190. "additionalProperties": false
  16191. },
  16192. "EventQuestionRejected": {
  16193. "type": "object",
  16194. "properties": {
  16195. "id": {
  16196. "type": "string"
  16197. },
  16198. "type": {
  16199. "type": "string",
  16200. "enum": ["question.rejected"]
  16201. },
  16202. "properties": {
  16203. "$ref": "#/components/schemas/QuestionRejected"
  16204. }
  16205. },
  16206. "required": ["id", "type", "properties"],
  16207. "additionalProperties": false
  16208. },
  16209. "EventTodoUpdated": {
  16210. "type": "object",
  16211. "properties": {
  16212. "id": {
  16213. "type": "string"
  16214. },
  16215. "type": {
  16216. "type": "string",
  16217. "enum": ["todo.updated"]
  16218. },
  16219. "properties": {
  16220. "type": "object",
  16221. "properties": {
  16222. "sessionID": {
  16223. "type": "string"
  16224. },
  16225. "todos": {
  16226. "type": "array",
  16227. "items": {
  16228. "$ref": "#/components/schemas/Todo"
  16229. }
  16230. }
  16231. },
  16232. "required": ["sessionID", "todos"],
  16233. "additionalProperties": false
  16234. }
  16235. },
  16236. "required": ["id", "type", "properties"],
  16237. "additionalProperties": false
  16238. },
  16239. "EventSessionStatus": {
  16240. "type": "object",
  16241. "properties": {
  16242. "id": {
  16243. "type": "string"
  16244. },
  16245. "type": {
  16246. "type": "string",
  16247. "enum": ["session.status"]
  16248. },
  16249. "properties": {
  16250. "type": "object",
  16251. "properties": {
  16252. "sessionID": {
  16253. "type": "string"
  16254. },
  16255. "status": {
  16256. "$ref": "#/components/schemas/SessionStatus"
  16257. }
  16258. },
  16259. "required": ["sessionID", "status"],
  16260. "additionalProperties": false
  16261. }
  16262. },
  16263. "required": ["id", "type", "properties"],
  16264. "additionalProperties": false
  16265. },
  16266. "EventSessionIdle": {
  16267. "type": "object",
  16268. "properties": {
  16269. "id": {
  16270. "type": "string"
  16271. },
  16272. "type": {
  16273. "type": "string",
  16274. "enum": ["session.idle"]
  16275. },
  16276. "properties": {
  16277. "type": "object",
  16278. "properties": {
  16279. "sessionID": {
  16280. "type": "string"
  16281. }
  16282. },
  16283. "required": ["sessionID"],
  16284. "additionalProperties": false
  16285. }
  16286. },
  16287. "required": ["id", "type", "properties"],
  16288. "additionalProperties": false
  16289. },
  16290. "EventSessionCompacted": {
  16291. "type": "object",
  16292. "properties": {
  16293. "id": {
  16294. "type": "string"
  16295. },
  16296. "type": {
  16297. "type": "string",
  16298. "enum": ["session.compacted"]
  16299. },
  16300. "properties": {
  16301. "type": "object",
  16302. "properties": {
  16303. "sessionID": {
  16304. "type": "string"
  16305. }
  16306. },
  16307. "required": ["sessionID"],
  16308. "additionalProperties": false
  16309. }
  16310. },
  16311. "required": ["id", "type", "properties"],
  16312. "additionalProperties": false
  16313. },
  16314. "EventMcpToolsChanged": {
  16315. "type": "object",
  16316. "properties": {
  16317. "id": {
  16318. "type": "string"
  16319. },
  16320. "type": {
  16321. "type": "string",
  16322. "enum": ["mcp.tools.changed"]
  16323. },
  16324. "properties": {
  16325. "type": "object",
  16326. "properties": {
  16327. "server": {
  16328. "type": "string"
  16329. }
  16330. },
  16331. "required": ["server"],
  16332. "additionalProperties": false
  16333. }
  16334. },
  16335. "required": ["id", "type", "properties"],
  16336. "additionalProperties": false
  16337. },
  16338. "EventMcpBrowserOpenFailed": {
  16339. "type": "object",
  16340. "properties": {
  16341. "id": {
  16342. "type": "string"
  16343. },
  16344. "type": {
  16345. "type": "string",
  16346. "enum": ["mcp.browser.open.failed"]
  16347. },
  16348. "properties": {
  16349. "type": "object",
  16350. "properties": {
  16351. "mcpName": {
  16352. "type": "string"
  16353. },
  16354. "url": {
  16355. "type": "string"
  16356. }
  16357. },
  16358. "required": ["mcpName", "url"],
  16359. "additionalProperties": false
  16360. }
  16361. },
  16362. "required": ["id", "type", "properties"],
  16363. "additionalProperties": false
  16364. },
  16365. "EventCommandExecuted": {
  16366. "type": "object",
  16367. "properties": {
  16368. "id": {
  16369. "type": "string"
  16370. },
  16371. "type": {
  16372. "type": "string",
  16373. "enum": ["command.executed"]
  16374. },
  16375. "properties": {
  16376. "type": "object",
  16377. "properties": {
  16378. "name": {
  16379. "type": "string"
  16380. },
  16381. "sessionID": {
  16382. "type": "string"
  16383. },
  16384. "arguments": {
  16385. "type": "string"
  16386. },
  16387. "messageID": {
  16388. "type": "string"
  16389. }
  16390. },
  16391. "required": ["name", "sessionID", "arguments", "messageID"],
  16392. "additionalProperties": false
  16393. }
  16394. },
  16395. "required": ["id", "type", "properties"],
  16396. "additionalProperties": false
  16397. },
  16398. "EventProjectUpdated": {
  16399. "type": "object",
  16400. "properties": {
  16401. "id": {
  16402. "type": "string"
  16403. },
  16404. "type": {
  16405. "type": "string",
  16406. "enum": ["project.updated"]
  16407. },
  16408. "properties": {
  16409. "$ref": "#/components/schemas/Project"
  16410. }
  16411. },
  16412. "required": ["id", "type", "properties"],
  16413. "additionalProperties": false
  16414. },
  16415. "EventVcsBranchUpdated": {
  16416. "type": "object",
  16417. "properties": {
  16418. "id": {
  16419. "type": "string"
  16420. },
  16421. "type": {
  16422. "type": "string",
  16423. "enum": ["vcs.branch.updated"]
  16424. },
  16425. "properties": {
  16426. "type": "object",
  16427. "properties": {
  16428. "branch": {
  16429. "type": "string"
  16430. }
  16431. },
  16432. "additionalProperties": false
  16433. }
  16434. },
  16435. "required": ["id", "type", "properties"],
  16436. "additionalProperties": false
  16437. },
  16438. "EventWorkspaceReady": {
  16439. "type": "object",
  16440. "properties": {
  16441. "id": {
  16442. "type": "string"
  16443. },
  16444. "type": {
  16445. "type": "string",
  16446. "enum": ["workspace.ready"]
  16447. },
  16448. "properties": {
  16449. "type": "object",
  16450. "properties": {
  16451. "name": {
  16452. "type": "string"
  16453. }
  16454. },
  16455. "required": ["name"],
  16456. "additionalProperties": false
  16457. }
  16458. },
  16459. "required": ["id", "type", "properties"],
  16460. "additionalProperties": false
  16461. },
  16462. "EventWorkspaceFailed": {
  16463. "type": "object",
  16464. "properties": {
  16465. "id": {
  16466. "type": "string"
  16467. },
  16468. "type": {
  16469. "type": "string",
  16470. "enum": ["workspace.failed"]
  16471. },
  16472. "properties": {
  16473. "type": "object",
  16474. "properties": {
  16475. "message": {
  16476. "type": "string"
  16477. }
  16478. },
  16479. "required": ["message"],
  16480. "additionalProperties": false
  16481. }
  16482. },
  16483. "required": ["id", "type", "properties"],
  16484. "additionalProperties": false
  16485. },
  16486. "EventWorkspaceStatus": {
  16487. "type": "object",
  16488. "properties": {
  16489. "id": {
  16490. "type": "string"
  16491. },
  16492. "type": {
  16493. "type": "string",
  16494. "enum": ["workspace.status"]
  16495. },
  16496. "properties": {
  16497. "type": "object",
  16498. "properties": {
  16499. "workspaceID": {
  16500. "type": "string"
  16501. },
  16502. "status": {
  16503. "type": "string",
  16504. "enum": ["connected", "connecting", "disconnected", "error"]
  16505. }
  16506. },
  16507. "required": ["workspaceID", "status"],
  16508. "additionalProperties": false
  16509. }
  16510. },
  16511. "required": ["id", "type", "properties"],
  16512. "additionalProperties": false
  16513. },
  16514. "EventWorktreeReady": {
  16515. "type": "object",
  16516. "properties": {
  16517. "id": {
  16518. "type": "string"
  16519. },
  16520. "type": {
  16521. "type": "string",
  16522. "enum": ["worktree.ready"]
  16523. },
  16524. "properties": {
  16525. "type": "object",
  16526. "properties": {
  16527. "name": {
  16528. "type": "string"
  16529. },
  16530. "branch": {
  16531. "type": "string"
  16532. }
  16533. },
  16534. "required": ["name", "branch"],
  16535. "additionalProperties": false
  16536. }
  16537. },
  16538. "required": ["id", "type", "properties"],
  16539. "additionalProperties": false
  16540. },
  16541. "EventWorktreeFailed": {
  16542. "type": "object",
  16543. "properties": {
  16544. "id": {
  16545. "type": "string"
  16546. },
  16547. "type": {
  16548. "type": "string",
  16549. "enum": ["worktree.failed"]
  16550. },
  16551. "properties": {
  16552. "type": "object",
  16553. "properties": {
  16554. "message": {
  16555. "type": "string"
  16556. }
  16557. },
  16558. "required": ["message"],
  16559. "additionalProperties": false
  16560. }
  16561. },
  16562. "required": ["id", "type", "properties"],
  16563. "additionalProperties": false
  16564. },
  16565. "EventPtyCreated": {
  16566. "type": "object",
  16567. "properties": {
  16568. "id": {
  16569. "type": "string"
  16570. },
  16571. "type": {
  16572. "type": "string",
  16573. "enum": ["pty.created"]
  16574. },
  16575. "properties": {
  16576. "type": "object",
  16577. "properties": {
  16578. "info": {
  16579. "$ref": "#/components/schemas/Pty"
  16580. }
  16581. },
  16582. "required": ["info"],
  16583. "additionalProperties": false
  16584. }
  16585. },
  16586. "required": ["id", "type", "properties"],
  16587. "additionalProperties": false
  16588. },
  16589. "EventPtyUpdated": {
  16590. "type": "object",
  16591. "properties": {
  16592. "id": {
  16593. "type": "string"
  16594. },
  16595. "type": {
  16596. "type": "string",
  16597. "enum": ["pty.updated"]
  16598. },
  16599. "properties": {
  16600. "type": "object",
  16601. "properties": {
  16602. "info": {
  16603. "$ref": "#/components/schemas/Pty"
  16604. }
  16605. },
  16606. "required": ["info"],
  16607. "additionalProperties": false
  16608. }
  16609. },
  16610. "required": ["id", "type", "properties"],
  16611. "additionalProperties": false
  16612. },
  16613. "EventPtyExited": {
  16614. "type": "object",
  16615. "properties": {
  16616. "id": {
  16617. "type": "string"
  16618. },
  16619. "type": {
  16620. "type": "string",
  16621. "enum": ["pty.exited"]
  16622. },
  16623. "properties": {
  16624. "type": "object",
  16625. "properties": {
  16626. "id": {
  16627. "type": "string"
  16628. },
  16629. "exitCode": {
  16630. "type": "integer",
  16631. "minimum": 0
  16632. }
  16633. },
  16634. "required": ["id", "exitCode"],
  16635. "additionalProperties": false
  16636. }
  16637. },
  16638. "required": ["id", "type", "properties"],
  16639. "additionalProperties": false
  16640. },
  16641. "EventPtyDeleted": {
  16642. "type": "object",
  16643. "properties": {
  16644. "id": {
  16645. "type": "string"
  16646. },
  16647. "type": {
  16648. "type": "string",
  16649. "enum": ["pty.deleted"]
  16650. },
  16651. "properties": {
  16652. "type": "object",
  16653. "properties": {
  16654. "id": {
  16655. "type": "string"
  16656. }
  16657. },
  16658. "required": ["id"],
  16659. "additionalProperties": false
  16660. }
  16661. },
  16662. "required": ["id", "type", "properties"],
  16663. "additionalProperties": false
  16664. },
  16665. "EventMessageUpdated": {
  16666. "type": "object",
  16667. "properties": {
  16668. "id": {
  16669. "type": "string"
  16670. },
  16671. "type": {
  16672. "type": "string",
  16673. "enum": ["message.updated"]
  16674. },
  16675. "properties": {
  16676. "type": "object",
  16677. "properties": {
  16678. "sessionID": {
  16679. "type": "string"
  16680. },
  16681. "info": {
  16682. "$ref": "#/components/schemas/Message"
  16683. }
  16684. },
  16685. "required": ["sessionID", "info"],
  16686. "additionalProperties": false
  16687. }
  16688. },
  16689. "required": ["id", "type", "properties"],
  16690. "additionalProperties": false
  16691. },
  16692. "EventMessageRemoved": {
  16693. "type": "object",
  16694. "properties": {
  16695. "id": {
  16696. "type": "string"
  16697. },
  16698. "type": {
  16699. "type": "string",
  16700. "enum": ["message.removed"]
  16701. },
  16702. "properties": {
  16703. "type": "object",
  16704. "properties": {
  16705. "sessionID": {
  16706. "type": "string"
  16707. },
  16708. "messageID": {
  16709. "type": "string"
  16710. }
  16711. },
  16712. "required": ["sessionID", "messageID"],
  16713. "additionalProperties": false
  16714. }
  16715. },
  16716. "required": ["id", "type", "properties"],
  16717. "additionalProperties": false
  16718. },
  16719. "EventMessagePartUpdated": {
  16720. "type": "object",
  16721. "properties": {
  16722. "id": {
  16723. "type": "string"
  16724. },
  16725. "type": {
  16726. "type": "string",
  16727. "enum": ["message.part.updated"]
  16728. },
  16729. "properties": {
  16730. "type": "object",
  16731. "properties": {
  16732. "sessionID": {
  16733. "type": "string"
  16734. },
  16735. "part": {
  16736. "$ref": "#/components/schemas/Part"
  16737. },
  16738. "time": {
  16739. "type": "integer",
  16740. "minimum": 0
  16741. }
  16742. },
  16743. "required": ["sessionID", "part", "time"],
  16744. "additionalProperties": false
  16745. }
  16746. },
  16747. "required": ["id", "type", "properties"],
  16748. "additionalProperties": false
  16749. },
  16750. "EventMessagePartRemoved": {
  16751. "type": "object",
  16752. "properties": {
  16753. "id": {
  16754. "type": "string"
  16755. },
  16756. "type": {
  16757. "type": "string",
  16758. "enum": ["message.part.removed"]
  16759. },
  16760. "properties": {
  16761. "type": "object",
  16762. "properties": {
  16763. "sessionID": {
  16764. "type": "string"
  16765. },
  16766. "messageID": {
  16767. "type": "string"
  16768. },
  16769. "partID": {
  16770. "type": "string"
  16771. }
  16772. },
  16773. "required": ["sessionID", "messageID", "partID"],
  16774. "additionalProperties": false
  16775. }
  16776. },
  16777. "required": ["id", "type", "properties"],
  16778. "additionalProperties": false
  16779. },
  16780. "EventSessionCreated": {
  16781. "type": "object",
  16782. "properties": {
  16783. "id": {
  16784. "type": "string"
  16785. },
  16786. "type": {
  16787. "type": "string",
  16788. "enum": ["session.created"]
  16789. },
  16790. "properties": {
  16791. "type": "object",
  16792. "properties": {
  16793. "sessionID": {
  16794. "type": "string"
  16795. },
  16796. "info": {
  16797. "$ref": "#/components/schemas/Session"
  16798. }
  16799. },
  16800. "required": ["sessionID", "info"],
  16801. "additionalProperties": false
  16802. }
  16803. },
  16804. "required": ["id", "type", "properties"],
  16805. "additionalProperties": false
  16806. },
  16807. "EventSessionUpdated": {
  16808. "type": "object",
  16809. "properties": {
  16810. "id": {
  16811. "type": "string"
  16812. },
  16813. "type": {
  16814. "type": "string",
  16815. "enum": ["session.updated"]
  16816. },
  16817. "properties": {
  16818. "type": "object",
  16819. "properties": {
  16820. "sessionID": {
  16821. "type": "string"
  16822. },
  16823. "info": {
  16824. "$ref": "#/components/schemas/Session"
  16825. }
  16826. },
  16827. "required": ["sessionID", "info"],
  16828. "additionalProperties": false
  16829. }
  16830. },
  16831. "required": ["id", "type", "properties"],
  16832. "additionalProperties": false
  16833. },
  16834. "EventSessionDeleted": {
  16835. "type": "object",
  16836. "properties": {
  16837. "id": {
  16838. "type": "string"
  16839. },
  16840. "type": {
  16841. "type": "string",
  16842. "enum": ["session.deleted"]
  16843. },
  16844. "properties": {
  16845. "type": "object",
  16846. "properties": {
  16847. "sessionID": {
  16848. "type": "string"
  16849. },
  16850. "info": {
  16851. "$ref": "#/components/schemas/Session"
  16852. }
  16853. },
  16854. "required": ["sessionID", "info"],
  16855. "additionalProperties": false
  16856. }
  16857. },
  16858. "required": ["id", "type", "properties"],
  16859. "additionalProperties": false
  16860. },
  16861. "EventSessionNextAgentSwitched": {
  16862. "type": "object",
  16863. "properties": {
  16864. "id": {
  16865. "type": "string"
  16866. },
  16867. "type": {
  16868. "type": "string",
  16869. "enum": ["session.next.agent.switched"]
  16870. },
  16871. "properties": {
  16872. "type": "object",
  16873. "properties": {
  16874. "timestamp": {
  16875. "type": "number"
  16876. },
  16877. "sessionID": {
  16878. "type": "string"
  16879. },
  16880. "agent": {
  16881. "type": "string"
  16882. }
  16883. },
  16884. "required": ["timestamp", "sessionID", "agent"],
  16885. "additionalProperties": false
  16886. }
  16887. },
  16888. "required": ["id", "type", "properties"],
  16889. "additionalProperties": false
  16890. },
  16891. "EventSessionNextModelSwitched": {
  16892. "type": "object",
  16893. "properties": {
  16894. "id": {
  16895. "type": "string"
  16896. },
  16897. "type": {
  16898. "type": "string",
  16899. "enum": ["session.next.model.switched"]
  16900. },
  16901. "properties": {
  16902. "type": "object",
  16903. "properties": {
  16904. "timestamp": {
  16905. "type": "number"
  16906. },
  16907. "sessionID": {
  16908. "type": "string"
  16909. },
  16910. "id": {
  16911. "type": "string"
  16912. },
  16913. "providerID": {
  16914. "type": "string"
  16915. },
  16916. "variant": {
  16917. "type": "string"
  16918. }
  16919. },
  16920. "required": ["timestamp", "sessionID", "id", "providerID"],
  16921. "additionalProperties": false
  16922. }
  16923. },
  16924. "required": ["id", "type", "properties"],
  16925. "additionalProperties": false
  16926. },
  16927. "PromptSource": {
  16928. "type": "object",
  16929. "properties": {
  16930. "start": {
  16931. "type": "number"
  16932. },
  16933. "end": {
  16934. "type": "number"
  16935. },
  16936. "text": {
  16937. "type": "string"
  16938. }
  16939. },
  16940. "required": ["start", "end", "text"],
  16941. "additionalProperties": false
  16942. },
  16943. "PromptFileAttachment": {
  16944. "type": "object",
  16945. "properties": {
  16946. "uri": {
  16947. "type": "string"
  16948. },
  16949. "mime": {
  16950. "type": "string"
  16951. },
  16952. "name": {
  16953. "type": "string"
  16954. },
  16955. "description": {
  16956. "type": "string"
  16957. },
  16958. "source": {
  16959. "$ref": "#/components/schemas/PromptSource"
  16960. }
  16961. },
  16962. "required": ["uri", "mime"],
  16963. "additionalProperties": false
  16964. },
  16965. "PromptAgentAttachment": {
  16966. "type": "object",
  16967. "properties": {
  16968. "name": {
  16969. "type": "string"
  16970. },
  16971. "source": {
  16972. "$ref": "#/components/schemas/PromptSource"
  16973. }
  16974. },
  16975. "required": ["name"],
  16976. "additionalProperties": false
  16977. },
  16978. "EventSessionNextPrompted": {
  16979. "type": "object",
  16980. "properties": {
  16981. "id": {
  16982. "type": "string"
  16983. },
  16984. "type": {
  16985. "type": "string",
  16986. "enum": ["session.next.prompted"]
  16987. },
  16988. "properties": {
  16989. "type": "object",
  16990. "properties": {
  16991. "timestamp": {
  16992. "type": "number"
  16993. },
  16994. "sessionID": {
  16995. "type": "string"
  16996. },
  16997. "prompt": {
  16998. "$ref": "#/components/schemas/Prompt"
  16999. }
  17000. },
  17001. "required": ["timestamp", "sessionID", "prompt"],
  17002. "additionalProperties": false
  17003. }
  17004. },
  17005. "required": ["id", "type", "properties"],
  17006. "additionalProperties": false
  17007. },
  17008. "EventSessionNextSynthetic": {
  17009. "type": "object",
  17010. "properties": {
  17011. "id": {
  17012. "type": "string"
  17013. },
  17014. "type": {
  17015. "type": "string",
  17016. "enum": ["session.next.synthetic"]
  17017. },
  17018. "properties": {
  17019. "type": "object",
  17020. "properties": {
  17021. "timestamp": {
  17022. "type": "number"
  17023. },
  17024. "sessionID": {
  17025. "type": "string"
  17026. },
  17027. "text": {
  17028. "type": "string"
  17029. }
  17030. },
  17031. "required": ["timestamp", "sessionID", "text"],
  17032. "additionalProperties": false
  17033. }
  17034. },
  17035. "required": ["id", "type", "properties"],
  17036. "additionalProperties": false
  17037. },
  17038. "EventSessionNextShellStarted": {
  17039. "type": "object",
  17040. "properties": {
  17041. "id": {
  17042. "type": "string"
  17043. },
  17044. "type": {
  17045. "type": "string",
  17046. "enum": ["session.next.shell.started"]
  17047. },
  17048. "properties": {
  17049. "type": "object",
  17050. "properties": {
  17051. "timestamp": {
  17052. "type": "number"
  17053. },
  17054. "sessionID": {
  17055. "type": "string"
  17056. },
  17057. "callID": {
  17058. "type": "string"
  17059. },
  17060. "command": {
  17061. "type": "string"
  17062. }
  17063. },
  17064. "required": ["timestamp", "sessionID", "callID", "command"],
  17065. "additionalProperties": false
  17066. }
  17067. },
  17068. "required": ["id", "type", "properties"],
  17069. "additionalProperties": false
  17070. },
  17071. "EventSessionNextShellEnded": {
  17072. "type": "object",
  17073. "properties": {
  17074. "id": {
  17075. "type": "string"
  17076. },
  17077. "type": {
  17078. "type": "string",
  17079. "enum": ["session.next.shell.ended"]
  17080. },
  17081. "properties": {
  17082. "type": "object",
  17083. "properties": {
  17084. "timestamp": {
  17085. "type": "number"
  17086. },
  17087. "sessionID": {
  17088. "type": "string"
  17089. },
  17090. "callID": {
  17091. "type": "string"
  17092. },
  17093. "output": {
  17094. "type": "string"
  17095. }
  17096. },
  17097. "required": ["timestamp", "sessionID", "callID", "output"],
  17098. "additionalProperties": false
  17099. }
  17100. },
  17101. "required": ["id", "type", "properties"],
  17102. "additionalProperties": false
  17103. },
  17104. "EventSessionNextStepStarted": {
  17105. "type": "object",
  17106. "properties": {
  17107. "id": {
  17108. "type": "string"
  17109. },
  17110. "type": {
  17111. "type": "string",
  17112. "enum": ["session.next.step.started"]
  17113. },
  17114. "properties": {
  17115. "type": "object",
  17116. "properties": {
  17117. "timestamp": {
  17118. "type": "number"
  17119. },
  17120. "sessionID": {
  17121. "type": "string"
  17122. },
  17123. "agent": {
  17124. "type": "string"
  17125. },
  17126. "model": {
  17127. "type": "object",
  17128. "properties": {
  17129. "id": {
  17130. "type": "string"
  17131. },
  17132. "providerID": {
  17133. "type": "string"
  17134. },
  17135. "variant": {
  17136. "type": "string"
  17137. }
  17138. },
  17139. "required": ["id", "providerID"],
  17140. "additionalProperties": false
  17141. },
  17142. "snapshot": {
  17143. "type": "string"
  17144. }
  17145. },
  17146. "required": ["timestamp", "sessionID", "agent", "model"],
  17147. "additionalProperties": false
  17148. }
  17149. },
  17150. "required": ["id", "type", "properties"],
  17151. "additionalProperties": false
  17152. },
  17153. "EventSessionNextStepEnded": {
  17154. "type": "object",
  17155. "properties": {
  17156. "id": {
  17157. "type": "string"
  17158. },
  17159. "type": {
  17160. "type": "string",
  17161. "enum": ["session.next.step.ended"]
  17162. },
  17163. "properties": {
  17164. "type": "object",
  17165. "properties": {
  17166. "timestamp": {
  17167. "type": "number"
  17168. },
  17169. "sessionID": {
  17170. "type": "string"
  17171. },
  17172. "finish": {
  17173. "type": "string"
  17174. },
  17175. "cost": {
  17176. "type": "number"
  17177. },
  17178. "tokens": {
  17179. "type": "object",
  17180. "properties": {
  17181. "input": {
  17182. "type": "integer",
  17183. "minimum": 0
  17184. },
  17185. "output": {
  17186. "type": "integer",
  17187. "minimum": 0
  17188. },
  17189. "reasoning": {
  17190. "type": "integer",
  17191. "minimum": 0
  17192. },
  17193. "cache": {
  17194. "type": "object",
  17195. "properties": {
  17196. "read": {
  17197. "type": "integer",
  17198. "minimum": 0
  17199. },
  17200. "write": {
  17201. "type": "integer",
  17202. "minimum": 0
  17203. }
  17204. },
  17205. "required": ["read", "write"],
  17206. "additionalProperties": false
  17207. }
  17208. },
  17209. "required": ["input", "output", "reasoning", "cache"],
  17210. "additionalProperties": false
  17211. },
  17212. "snapshot": {
  17213. "type": "string"
  17214. }
  17215. },
  17216. "required": ["timestamp", "sessionID", "finish", "cost", "tokens"],
  17217. "additionalProperties": false
  17218. }
  17219. },
  17220. "required": ["id", "type", "properties"],
  17221. "additionalProperties": false
  17222. },
  17223. "EventSessionNextStepFailed": {
  17224. "type": "object",
  17225. "properties": {
  17226. "id": {
  17227. "type": "string"
  17228. },
  17229. "type": {
  17230. "type": "string",
  17231. "enum": ["session.next.step.failed"]
  17232. },
  17233. "properties": {
  17234. "type": "object",
  17235. "properties": {
  17236. "timestamp": {
  17237. "type": "number"
  17238. },
  17239. "sessionID": {
  17240. "type": "string"
  17241. },
  17242. "error": {
  17243. "type": "object",
  17244. "properties": {
  17245. "type": {
  17246. "type": "string"
  17247. },
  17248. "message": {
  17249. "type": "string"
  17250. }
  17251. },
  17252. "required": ["type", "message"],
  17253. "additionalProperties": false
  17254. }
  17255. },
  17256. "required": ["timestamp", "sessionID", "error"],
  17257. "additionalProperties": false
  17258. }
  17259. },
  17260. "required": ["id", "type", "properties"],
  17261. "additionalProperties": false
  17262. },
  17263. "EventSessionNextTextStarted": {
  17264. "type": "object",
  17265. "properties": {
  17266. "id": {
  17267. "type": "string"
  17268. },
  17269. "type": {
  17270. "type": "string",
  17271. "enum": ["session.next.text.started"]
  17272. },
  17273. "properties": {
  17274. "type": "object",
  17275. "properties": {
  17276. "timestamp": {
  17277. "type": "number"
  17278. },
  17279. "sessionID": {
  17280. "type": "string"
  17281. }
  17282. },
  17283. "required": ["timestamp", "sessionID"],
  17284. "additionalProperties": false
  17285. }
  17286. },
  17287. "required": ["id", "type", "properties"],
  17288. "additionalProperties": false
  17289. },
  17290. "EventSessionNextTextDelta": {
  17291. "type": "object",
  17292. "properties": {
  17293. "id": {
  17294. "type": "string"
  17295. },
  17296. "type": {
  17297. "type": "string",
  17298. "enum": ["session.next.text.delta"]
  17299. },
  17300. "properties": {
  17301. "type": "object",
  17302. "properties": {
  17303. "timestamp": {
  17304. "type": "number"
  17305. },
  17306. "sessionID": {
  17307. "type": "string"
  17308. },
  17309. "delta": {
  17310. "type": "string"
  17311. }
  17312. },
  17313. "required": ["timestamp", "sessionID", "delta"],
  17314. "additionalProperties": false
  17315. }
  17316. },
  17317. "required": ["id", "type", "properties"],
  17318. "additionalProperties": false
  17319. },
  17320. "EventSessionNextTextEnded": {
  17321. "type": "object",
  17322. "properties": {
  17323. "id": {
  17324. "type": "string"
  17325. },
  17326. "type": {
  17327. "type": "string",
  17328. "enum": ["session.next.text.ended"]
  17329. },
  17330. "properties": {
  17331. "type": "object",
  17332. "properties": {
  17333. "timestamp": {
  17334. "type": "number"
  17335. },
  17336. "sessionID": {
  17337. "type": "string"
  17338. },
  17339. "text": {
  17340. "type": "string"
  17341. }
  17342. },
  17343. "required": ["timestamp", "sessionID", "text"],
  17344. "additionalProperties": false
  17345. }
  17346. },
  17347. "required": ["id", "type", "properties"],
  17348. "additionalProperties": false
  17349. },
  17350. "EventSessionNextReasoningStarted": {
  17351. "type": "object",
  17352. "properties": {
  17353. "id": {
  17354. "type": "string"
  17355. },
  17356. "type": {
  17357. "type": "string",
  17358. "enum": ["session.next.reasoning.started"]
  17359. },
  17360. "properties": {
  17361. "type": "object",
  17362. "properties": {
  17363. "timestamp": {
  17364. "type": "number"
  17365. },
  17366. "sessionID": {
  17367. "type": "string"
  17368. },
  17369. "reasoningID": {
  17370. "type": "string"
  17371. }
  17372. },
  17373. "required": ["timestamp", "sessionID", "reasoningID"],
  17374. "additionalProperties": false
  17375. }
  17376. },
  17377. "required": ["id", "type", "properties"],
  17378. "additionalProperties": false
  17379. },
  17380. "EventSessionNextReasoningDelta": {
  17381. "type": "object",
  17382. "properties": {
  17383. "id": {
  17384. "type": "string"
  17385. },
  17386. "type": {
  17387. "type": "string",
  17388. "enum": ["session.next.reasoning.delta"]
  17389. },
  17390. "properties": {
  17391. "type": "object",
  17392. "properties": {
  17393. "timestamp": {
  17394. "type": "number"
  17395. },
  17396. "sessionID": {
  17397. "type": "string"
  17398. },
  17399. "reasoningID": {
  17400. "type": "string"
  17401. },
  17402. "delta": {
  17403. "type": "string"
  17404. }
  17405. },
  17406. "required": ["timestamp", "sessionID", "reasoningID", "delta"],
  17407. "additionalProperties": false
  17408. }
  17409. },
  17410. "required": ["id", "type", "properties"],
  17411. "additionalProperties": false
  17412. },
  17413. "EventSessionNextReasoningEnded": {
  17414. "type": "object",
  17415. "properties": {
  17416. "id": {
  17417. "type": "string"
  17418. },
  17419. "type": {
  17420. "type": "string",
  17421. "enum": ["session.next.reasoning.ended"]
  17422. },
  17423. "properties": {
  17424. "type": "object",
  17425. "properties": {
  17426. "timestamp": {
  17427. "type": "number"
  17428. },
  17429. "sessionID": {
  17430. "type": "string"
  17431. },
  17432. "reasoningID": {
  17433. "type": "string"
  17434. },
  17435. "text": {
  17436. "type": "string"
  17437. }
  17438. },
  17439. "required": ["timestamp", "sessionID", "reasoningID", "text"],
  17440. "additionalProperties": false
  17441. }
  17442. },
  17443. "required": ["id", "type", "properties"],
  17444. "additionalProperties": false
  17445. },
  17446. "EventSessionNextToolInputStarted": {
  17447. "type": "object",
  17448. "properties": {
  17449. "id": {
  17450. "type": "string"
  17451. },
  17452. "type": {
  17453. "type": "string",
  17454. "enum": ["session.next.tool.input.started"]
  17455. },
  17456. "properties": {
  17457. "type": "object",
  17458. "properties": {
  17459. "timestamp": {
  17460. "type": "number"
  17461. },
  17462. "sessionID": {
  17463. "type": "string"
  17464. },
  17465. "callID": {
  17466. "type": "string"
  17467. },
  17468. "name": {
  17469. "type": "string"
  17470. }
  17471. },
  17472. "required": ["timestamp", "sessionID", "callID", "name"],
  17473. "additionalProperties": false
  17474. }
  17475. },
  17476. "required": ["id", "type", "properties"],
  17477. "additionalProperties": false
  17478. },
  17479. "EventSessionNextToolInputDelta": {
  17480. "type": "object",
  17481. "properties": {
  17482. "id": {
  17483. "type": "string"
  17484. },
  17485. "type": {
  17486. "type": "string",
  17487. "enum": ["session.next.tool.input.delta"]
  17488. },
  17489. "properties": {
  17490. "type": "object",
  17491. "properties": {
  17492. "timestamp": {
  17493. "type": "number"
  17494. },
  17495. "sessionID": {
  17496. "type": "string"
  17497. },
  17498. "callID": {
  17499. "type": "string"
  17500. },
  17501. "delta": {
  17502. "type": "string"
  17503. }
  17504. },
  17505. "required": ["timestamp", "sessionID", "callID", "delta"],
  17506. "additionalProperties": false
  17507. }
  17508. },
  17509. "required": ["id", "type", "properties"],
  17510. "additionalProperties": false
  17511. },
  17512. "EventSessionNextToolInputEnded": {
  17513. "type": "object",
  17514. "properties": {
  17515. "id": {
  17516. "type": "string"
  17517. },
  17518. "type": {
  17519. "type": "string",
  17520. "enum": ["session.next.tool.input.ended"]
  17521. },
  17522. "properties": {
  17523. "type": "object",
  17524. "properties": {
  17525. "timestamp": {
  17526. "type": "number"
  17527. },
  17528. "sessionID": {
  17529. "type": "string"
  17530. },
  17531. "callID": {
  17532. "type": "string"
  17533. },
  17534. "text": {
  17535. "type": "string"
  17536. }
  17537. },
  17538. "required": ["timestamp", "sessionID", "callID", "text"],
  17539. "additionalProperties": false
  17540. }
  17541. },
  17542. "required": ["id", "type", "properties"],
  17543. "additionalProperties": false
  17544. },
  17545. "EventSessionNextToolCalled": {
  17546. "type": "object",
  17547. "properties": {
  17548. "id": {
  17549. "type": "string"
  17550. },
  17551. "type": {
  17552. "type": "string",
  17553. "enum": ["session.next.tool.called"]
  17554. },
  17555. "properties": {
  17556. "type": "object",
  17557. "properties": {
  17558. "timestamp": {
  17559. "type": "number"
  17560. },
  17561. "sessionID": {
  17562. "type": "string"
  17563. },
  17564. "callID": {
  17565. "type": "string"
  17566. },
  17567. "tool": {
  17568. "type": "string"
  17569. },
  17570. "input": {
  17571. "type": "object"
  17572. },
  17573. "provider": {
  17574. "type": "object",
  17575. "properties": {
  17576. "executed": {
  17577. "type": "boolean"
  17578. },
  17579. "metadata": {
  17580. "type": "object"
  17581. }
  17582. },
  17583. "required": ["executed"],
  17584. "additionalProperties": false
  17585. }
  17586. },
  17587. "required": ["timestamp", "sessionID", "callID", "tool", "input", "provider"],
  17588. "additionalProperties": false
  17589. }
  17590. },
  17591. "required": ["id", "type", "properties"],
  17592. "additionalProperties": false
  17593. },
  17594. "ToolTextContent": {
  17595. "type": "object",
  17596. "properties": {
  17597. "type": {
  17598. "type": "string",
  17599. "enum": ["text"]
  17600. },
  17601. "text": {
  17602. "type": "string"
  17603. }
  17604. },
  17605. "required": ["type", "text"],
  17606. "additionalProperties": false
  17607. },
  17608. "ToolFileContent": {
  17609. "type": "object",
  17610. "properties": {
  17611. "type": {
  17612. "type": "string",
  17613. "enum": ["file"]
  17614. },
  17615. "uri": {
  17616. "type": "string"
  17617. },
  17618. "mime": {
  17619. "type": "string"
  17620. },
  17621. "name": {
  17622. "type": "string"
  17623. }
  17624. },
  17625. "required": ["type", "uri", "mime"],
  17626. "additionalProperties": false
  17627. },
  17628. "EventSessionNextToolProgress": {
  17629. "type": "object",
  17630. "properties": {
  17631. "id": {
  17632. "type": "string"
  17633. },
  17634. "type": {
  17635. "type": "string",
  17636. "enum": ["session.next.tool.progress"]
  17637. },
  17638. "properties": {
  17639. "type": "object",
  17640. "properties": {
  17641. "timestamp": {
  17642. "type": "number"
  17643. },
  17644. "sessionID": {
  17645. "type": "string"
  17646. },
  17647. "callID": {
  17648. "type": "string"
  17649. },
  17650. "structured": {
  17651. "type": "object"
  17652. },
  17653. "content": {
  17654. "type": "array",
  17655. "items": {
  17656. "anyOf": [
  17657. {
  17658. "$ref": "#/components/schemas/ToolTextContent"
  17659. },
  17660. {
  17661. "$ref": "#/components/schemas/ToolFileContent"
  17662. }
  17663. ]
  17664. }
  17665. }
  17666. },
  17667. "required": ["timestamp", "sessionID", "callID", "structured", "content"],
  17668. "additionalProperties": false
  17669. }
  17670. },
  17671. "required": ["id", "type", "properties"],
  17672. "additionalProperties": false
  17673. },
  17674. "EventSessionNextToolSuccess": {
  17675. "type": "object",
  17676. "properties": {
  17677. "id": {
  17678. "type": "string"
  17679. },
  17680. "type": {
  17681. "type": "string",
  17682. "enum": ["session.next.tool.success"]
  17683. },
  17684. "properties": {
  17685. "type": "object",
  17686. "properties": {
  17687. "timestamp": {
  17688. "type": "number"
  17689. },
  17690. "sessionID": {
  17691. "type": "string"
  17692. },
  17693. "callID": {
  17694. "type": "string"
  17695. },
  17696. "structured": {
  17697. "type": "object"
  17698. },
  17699. "content": {
  17700. "type": "array",
  17701. "items": {
  17702. "anyOf": [
  17703. {
  17704. "$ref": "#/components/schemas/ToolTextContent"
  17705. },
  17706. {
  17707. "$ref": "#/components/schemas/ToolFileContent"
  17708. }
  17709. ]
  17710. }
  17711. },
  17712. "provider": {
  17713. "type": "object",
  17714. "properties": {
  17715. "executed": {
  17716. "type": "boolean"
  17717. },
  17718. "metadata": {
  17719. "type": "object"
  17720. }
  17721. },
  17722. "required": ["executed"],
  17723. "additionalProperties": false
  17724. }
  17725. },
  17726. "required": ["timestamp", "sessionID", "callID", "structured", "content", "provider"],
  17727. "additionalProperties": false
  17728. }
  17729. },
  17730. "required": ["id", "type", "properties"],
  17731. "additionalProperties": false
  17732. },
  17733. "EventSessionNextToolFailed": {
  17734. "type": "object",
  17735. "properties": {
  17736. "id": {
  17737. "type": "string"
  17738. },
  17739. "type": {
  17740. "type": "string",
  17741. "enum": ["session.next.tool.failed"]
  17742. },
  17743. "properties": {
  17744. "type": "object",
  17745. "properties": {
  17746. "timestamp": {
  17747. "type": "number"
  17748. },
  17749. "sessionID": {
  17750. "type": "string"
  17751. },
  17752. "callID": {
  17753. "type": "string"
  17754. },
  17755. "error": {
  17756. "type": "object",
  17757. "properties": {
  17758. "type": {
  17759. "type": "string"
  17760. },
  17761. "message": {
  17762. "type": "string"
  17763. }
  17764. },
  17765. "required": ["type", "message"],
  17766. "additionalProperties": false
  17767. },
  17768. "provider": {
  17769. "type": "object",
  17770. "properties": {
  17771. "executed": {
  17772. "type": "boolean"
  17773. },
  17774. "metadata": {
  17775. "type": "object"
  17776. }
  17777. },
  17778. "required": ["executed"],
  17779. "additionalProperties": false
  17780. }
  17781. },
  17782. "required": ["timestamp", "sessionID", "callID", "error", "provider"],
  17783. "additionalProperties": false
  17784. }
  17785. },
  17786. "required": ["id", "type", "properties"],
  17787. "additionalProperties": false
  17788. },
  17789. "SessionNextRetry_error": {
  17790. "type": "object",
  17791. "properties": {
  17792. "message": {
  17793. "type": "string"
  17794. },
  17795. "statusCode": {
  17796. "type": "integer",
  17797. "minimum": 0
  17798. },
  17799. "isRetryable": {
  17800. "type": "boolean"
  17801. },
  17802. "responseHeaders": {
  17803. "type": "object",
  17804. "additionalProperties": {
  17805. "type": "string"
  17806. }
  17807. },
  17808. "responseBody": {
  17809. "type": "string"
  17810. },
  17811. "metadata": {
  17812. "type": "object",
  17813. "additionalProperties": {
  17814. "type": "string"
  17815. }
  17816. }
  17817. },
  17818. "required": ["message", "isRetryable"],
  17819. "additionalProperties": false
  17820. },
  17821. "EventSessionNextRetried": {
  17822. "type": "object",
  17823. "properties": {
  17824. "id": {
  17825. "type": "string"
  17826. },
  17827. "type": {
  17828. "type": "string",
  17829. "enum": ["session.next.retried"]
  17830. },
  17831. "properties": {
  17832. "type": "object",
  17833. "properties": {
  17834. "timestamp": {
  17835. "type": "number"
  17836. },
  17837. "sessionID": {
  17838. "type": "string"
  17839. },
  17840. "attempt": {
  17841. "type": "integer",
  17842. "minimum": 0
  17843. },
  17844. "error": {
  17845. "$ref": "#/components/schemas/SessionNextRetry_error"
  17846. }
  17847. },
  17848. "required": ["timestamp", "sessionID", "attempt", "error"],
  17849. "additionalProperties": false
  17850. }
  17851. },
  17852. "required": ["id", "type", "properties"],
  17853. "additionalProperties": false
  17854. },
  17855. "EventSessionNextCompactionStarted": {
  17856. "type": "object",
  17857. "properties": {
  17858. "id": {
  17859. "type": "string"
  17860. },
  17861. "type": {
  17862. "type": "string",
  17863. "enum": ["session.next.compaction.started"]
  17864. },
  17865. "properties": {
  17866. "type": "object",
  17867. "properties": {
  17868. "timestamp": {
  17869. "type": "number"
  17870. },
  17871. "sessionID": {
  17872. "type": "string"
  17873. },
  17874. "reason": {
  17875. "type": "string",
  17876. "enum": ["auto", "manual"]
  17877. }
  17878. },
  17879. "required": ["timestamp", "sessionID", "reason"],
  17880. "additionalProperties": false
  17881. }
  17882. },
  17883. "required": ["id", "type", "properties"],
  17884. "additionalProperties": false
  17885. },
  17886. "EventSessionNextCompactionDelta": {
  17887. "type": "object",
  17888. "properties": {
  17889. "id": {
  17890. "type": "string"
  17891. },
  17892. "type": {
  17893. "type": "string",
  17894. "enum": ["session.next.compaction.delta"]
  17895. },
  17896. "properties": {
  17897. "type": "object",
  17898. "properties": {
  17899. "timestamp": {
  17900. "type": "number"
  17901. },
  17902. "sessionID": {
  17903. "type": "string"
  17904. },
  17905. "text": {
  17906. "type": "string"
  17907. }
  17908. },
  17909. "required": ["timestamp", "sessionID", "text"],
  17910. "additionalProperties": false
  17911. }
  17912. },
  17913. "required": ["id", "type", "properties"],
  17914. "additionalProperties": false
  17915. },
  17916. "EventSessionNextCompactionEnded": {
  17917. "type": "object",
  17918. "properties": {
  17919. "id": {
  17920. "type": "string"
  17921. },
  17922. "type": {
  17923. "type": "string",
  17924. "enum": ["session.next.compaction.ended"]
  17925. },
  17926. "properties": {
  17927. "type": "object",
  17928. "properties": {
  17929. "timestamp": {
  17930. "type": "number"
  17931. },
  17932. "sessionID": {
  17933. "type": "string"
  17934. },
  17935. "text": {
  17936. "type": "string"
  17937. },
  17938. "include": {
  17939. "type": "string"
  17940. }
  17941. },
  17942. "required": ["timestamp", "sessionID", "text"],
  17943. "additionalProperties": false
  17944. }
  17945. },
  17946. "required": ["id", "type", "properties"],
  17947. "additionalProperties": false
  17948. },
  17949. "EventServerConnected": {
  17950. "type": "object",
  17951. "properties": {
  17952. "id": {
  17953. "type": "string"
  17954. },
  17955. "type": {
  17956. "type": "string",
  17957. "enum": ["server.connected"]
  17958. },
  17959. "properties": {
  17960. "type": "object",
  17961. "properties": {}
  17962. }
  17963. },
  17964. "required": ["id", "type", "properties"],
  17965. "additionalProperties": false
  17966. },
  17967. "EventGlobalDisposed": {
  17968. "type": "object",
  17969. "properties": {
  17970. "id": {
  17971. "type": "string"
  17972. },
  17973. "type": {
  17974. "type": "string",
  17975. "enum": ["global.disposed"]
  17976. },
  17977. "properties": {
  17978. "type": "object",
  17979. "properties": {}
  17980. }
  17981. },
  17982. "required": ["id", "type", "properties"],
  17983. "additionalProperties": false
  17984. },
  17985. "SessionInfo": {
  17986. "type": "object",
  17987. "properties": {
  17988. "id": {
  17989. "type": "string"
  17990. },
  17991. "parentID": {
  17992. "type": "string"
  17993. },
  17994. "projectID": {
  17995. "type": "string"
  17996. },
  17997. "workspaceID": {
  17998. "type": "string"
  17999. },
  18000. "path": {
  18001. "type": "string"
  18002. },
  18003. "agent": {
  18004. "type": "string"
  18005. },
  18006. "model": {
  18007. "type": "object",
  18008. "properties": {
  18009. "id": {
  18010. "type": "string"
  18011. },
  18012. "providerID": {
  18013. "type": "string"
  18014. },
  18015. "variant": {
  18016. "type": "string"
  18017. }
  18018. },
  18019. "required": ["id", "providerID"],
  18020. "additionalProperties": false
  18021. },
  18022. "time": {
  18023. "type": "object",
  18024. "properties": {
  18025. "created": {
  18026. "type": "number"
  18027. },
  18028. "updated": {
  18029. "type": "number"
  18030. },
  18031. "archived": {
  18032. "type": "number"
  18033. }
  18034. },
  18035. "required": ["created", "updated"],
  18036. "additionalProperties": false
  18037. },
  18038. "title": {
  18039. "type": "string"
  18040. }
  18041. },
  18042. "required": ["id", "projectID", "time", "title"],
  18043. "additionalProperties": false
  18044. },
  18045. "SessionDelivery": {
  18046. "type": "string",
  18047. "enum": ["immediate", "deferred"]
  18048. },
  18049. "SessionMessageAgentSwitched": {
  18050. "type": "object",
  18051. "properties": {
  18052. "id": {
  18053. "type": "string"
  18054. },
  18055. "metadata": {
  18056. "type": "object"
  18057. },
  18058. "time": {
  18059. "type": "object",
  18060. "properties": {
  18061. "created": {
  18062. "type": "number"
  18063. }
  18064. },
  18065. "required": ["created"],
  18066. "additionalProperties": false
  18067. },
  18068. "type": {
  18069. "type": "string",
  18070. "enum": ["agent-switched"]
  18071. },
  18072. "agent": {
  18073. "type": "string"
  18074. }
  18075. },
  18076. "required": ["id", "time", "type", "agent"],
  18077. "additionalProperties": false
  18078. },
  18079. "SessionMessageModelSwitched": {
  18080. "type": "object",
  18081. "properties": {
  18082. "id": {
  18083. "type": "string"
  18084. },
  18085. "metadata": {
  18086. "type": "object"
  18087. },
  18088. "time": {
  18089. "type": "object",
  18090. "properties": {
  18091. "created": {
  18092. "type": "number"
  18093. }
  18094. },
  18095. "required": ["created"],
  18096. "additionalProperties": false
  18097. },
  18098. "type": {
  18099. "type": "string",
  18100. "enum": ["model-switched"]
  18101. },
  18102. "model": {
  18103. "type": "object",
  18104. "properties": {
  18105. "id": {
  18106. "type": "string"
  18107. },
  18108. "providerID": {
  18109. "type": "string"
  18110. },
  18111. "variant": {
  18112. "type": "string"
  18113. }
  18114. },
  18115. "required": ["id", "providerID"],
  18116. "additionalProperties": false
  18117. }
  18118. },
  18119. "required": ["id", "time", "type", "model"],
  18120. "additionalProperties": false
  18121. },
  18122. "SessionMessageUser": {
  18123. "type": "object",
  18124. "properties": {
  18125. "id": {
  18126. "type": "string"
  18127. },
  18128. "metadata": {
  18129. "type": "object"
  18130. },
  18131. "time": {
  18132. "type": "object",
  18133. "properties": {
  18134. "created": {
  18135. "type": "number"
  18136. }
  18137. },
  18138. "required": ["created"],
  18139. "additionalProperties": false
  18140. },
  18141. "text": {
  18142. "type": "string"
  18143. },
  18144. "files": {
  18145. "type": "array",
  18146. "items": {
  18147. "$ref": "#/components/schemas/PromptFileAttachment"
  18148. }
  18149. },
  18150. "agents": {
  18151. "type": "array",
  18152. "items": {
  18153. "$ref": "#/components/schemas/PromptAgentAttachment"
  18154. }
  18155. },
  18156. "type": {
  18157. "type": "string",
  18158. "enum": ["user"]
  18159. }
  18160. },
  18161. "required": ["id", "time", "text", "type"],
  18162. "additionalProperties": false
  18163. },
  18164. "SessionMessageSynthetic": {
  18165. "type": "object",
  18166. "properties": {
  18167. "id": {
  18168. "type": "string"
  18169. },
  18170. "metadata": {
  18171. "type": "object"
  18172. },
  18173. "time": {
  18174. "type": "object",
  18175. "properties": {
  18176. "created": {
  18177. "type": "number"
  18178. }
  18179. },
  18180. "required": ["created"],
  18181. "additionalProperties": false
  18182. },
  18183. "sessionID": {
  18184. "type": "string"
  18185. },
  18186. "text": {
  18187. "type": "string"
  18188. },
  18189. "type": {
  18190. "type": "string",
  18191. "enum": ["synthetic"]
  18192. }
  18193. },
  18194. "required": ["id", "time", "sessionID", "text", "type"],
  18195. "additionalProperties": false
  18196. },
  18197. "SessionMessageShell": {
  18198. "type": "object",
  18199. "properties": {
  18200. "id": {
  18201. "type": "string"
  18202. },
  18203. "metadata": {
  18204. "type": "object"
  18205. },
  18206. "time": {
  18207. "type": "object",
  18208. "properties": {
  18209. "created": {
  18210. "type": "number"
  18211. },
  18212. "completed": {
  18213. "type": "number"
  18214. }
  18215. },
  18216. "required": ["created"],
  18217. "additionalProperties": false
  18218. },
  18219. "type": {
  18220. "type": "string",
  18221. "enum": ["shell"]
  18222. },
  18223. "callID": {
  18224. "type": "string"
  18225. },
  18226. "command": {
  18227. "type": "string"
  18228. },
  18229. "output": {
  18230. "type": "string"
  18231. }
  18232. },
  18233. "required": ["id", "time", "type", "callID", "command", "output"],
  18234. "additionalProperties": false
  18235. },
  18236. "SessionMessageAssistantText": {
  18237. "type": "object",
  18238. "properties": {
  18239. "type": {
  18240. "type": "string",
  18241. "enum": ["text"]
  18242. },
  18243. "text": {
  18244. "type": "string"
  18245. }
  18246. },
  18247. "required": ["type", "text"],
  18248. "additionalProperties": false
  18249. },
  18250. "SessionMessageAssistantReasoning": {
  18251. "type": "object",
  18252. "properties": {
  18253. "type": {
  18254. "type": "string",
  18255. "enum": ["reasoning"]
  18256. },
  18257. "id": {
  18258. "type": "string"
  18259. },
  18260. "text": {
  18261. "type": "string"
  18262. }
  18263. },
  18264. "required": ["type", "id", "text"],
  18265. "additionalProperties": false
  18266. },
  18267. "SessionMessageToolStatePending": {
  18268. "type": "object",
  18269. "properties": {
  18270. "status": {
  18271. "type": "string",
  18272. "enum": ["pending"]
  18273. },
  18274. "input": {
  18275. "type": "string"
  18276. }
  18277. },
  18278. "required": ["status", "input"],
  18279. "additionalProperties": false
  18280. },
  18281. "SessionMessageToolStateRunning": {
  18282. "type": "object",
  18283. "properties": {
  18284. "status": {
  18285. "type": "string",
  18286. "enum": ["running"]
  18287. },
  18288. "input": {
  18289. "type": "object"
  18290. },
  18291. "structured": {
  18292. "type": "object"
  18293. },
  18294. "content": {
  18295. "type": "array",
  18296. "items": {
  18297. "anyOf": [
  18298. {
  18299. "$ref": "#/components/schemas/ToolTextContent"
  18300. },
  18301. {
  18302. "$ref": "#/components/schemas/ToolFileContent"
  18303. }
  18304. ]
  18305. }
  18306. }
  18307. },
  18308. "required": ["status", "input", "structured", "content"],
  18309. "additionalProperties": false
  18310. },
  18311. "SessionMessageToolStateCompleted": {
  18312. "type": "object",
  18313. "properties": {
  18314. "status": {
  18315. "type": "string",
  18316. "enum": ["completed"]
  18317. },
  18318. "input": {
  18319. "type": "object"
  18320. },
  18321. "attachments": {
  18322. "type": "array",
  18323. "items": {
  18324. "$ref": "#/components/schemas/PromptFileAttachment"
  18325. }
  18326. },
  18327. "content": {
  18328. "type": "array",
  18329. "items": {
  18330. "anyOf": [
  18331. {
  18332. "$ref": "#/components/schemas/ToolTextContent"
  18333. },
  18334. {
  18335. "$ref": "#/components/schemas/ToolFileContent"
  18336. }
  18337. ]
  18338. }
  18339. },
  18340. "structured": {
  18341. "type": "object"
  18342. }
  18343. },
  18344. "required": ["status", "input", "content", "structured"],
  18345. "additionalProperties": false
  18346. },
  18347. "SessionMessageToolStateError": {
  18348. "type": "object",
  18349. "properties": {
  18350. "status": {
  18351. "type": "string",
  18352. "enum": ["error"]
  18353. },
  18354. "input": {
  18355. "type": "object"
  18356. },
  18357. "content": {
  18358. "type": "array",
  18359. "items": {
  18360. "anyOf": [
  18361. {
  18362. "$ref": "#/components/schemas/ToolTextContent"
  18363. },
  18364. {
  18365. "$ref": "#/components/schemas/ToolFileContent"
  18366. }
  18367. ]
  18368. }
  18369. },
  18370. "structured": {
  18371. "type": "object"
  18372. },
  18373. "error": {
  18374. "type": "object",
  18375. "properties": {
  18376. "type": {
  18377. "type": "string"
  18378. },
  18379. "message": {
  18380. "type": "string"
  18381. }
  18382. },
  18383. "required": ["type", "message"],
  18384. "additionalProperties": false
  18385. }
  18386. },
  18387. "required": ["status", "input", "content", "structured", "error"],
  18388. "additionalProperties": false
  18389. },
  18390. "SessionMessageAssistantTool": {
  18391. "type": "object",
  18392. "properties": {
  18393. "type": {
  18394. "type": "string",
  18395. "enum": ["tool"]
  18396. },
  18397. "id": {
  18398. "type": "string"
  18399. },
  18400. "name": {
  18401. "type": "string"
  18402. },
  18403. "provider": {
  18404. "type": "object",
  18405. "properties": {
  18406. "executed": {
  18407. "type": "boolean"
  18408. },
  18409. "metadata": {
  18410. "type": "object"
  18411. }
  18412. },
  18413. "required": ["executed"],
  18414. "additionalProperties": false
  18415. },
  18416. "state": {
  18417. "anyOf": [
  18418. {
  18419. "$ref": "#/components/schemas/SessionMessageToolStatePending"
  18420. },
  18421. {
  18422. "$ref": "#/components/schemas/SessionMessageToolStateRunning"
  18423. },
  18424. {
  18425. "$ref": "#/components/schemas/SessionMessageToolStateCompleted"
  18426. },
  18427. {
  18428. "$ref": "#/components/schemas/SessionMessageToolStateError"
  18429. }
  18430. ]
  18431. },
  18432. "time": {
  18433. "type": "object",
  18434. "properties": {
  18435. "created": {
  18436. "type": "number"
  18437. },
  18438. "ran": {
  18439. "type": "number"
  18440. },
  18441. "completed": {
  18442. "type": "number"
  18443. },
  18444. "pruned": {
  18445. "type": "number"
  18446. }
  18447. },
  18448. "required": ["created"],
  18449. "additionalProperties": false
  18450. }
  18451. },
  18452. "required": ["type", "id", "name", "state", "time"],
  18453. "additionalProperties": false
  18454. },
  18455. "SessionMessageAssistant": {
  18456. "type": "object",
  18457. "properties": {
  18458. "id": {
  18459. "type": "string"
  18460. },
  18461. "metadata": {
  18462. "type": "object"
  18463. },
  18464. "time": {
  18465. "type": "object",
  18466. "properties": {
  18467. "created": {
  18468. "type": "number"
  18469. },
  18470. "completed": {
  18471. "type": "number"
  18472. }
  18473. },
  18474. "required": ["created"],
  18475. "additionalProperties": false
  18476. },
  18477. "type": {
  18478. "type": "string",
  18479. "enum": ["assistant"]
  18480. },
  18481. "agent": {
  18482. "type": "string"
  18483. },
  18484. "model": {
  18485. "type": "object",
  18486. "properties": {
  18487. "id": {
  18488. "type": "string"
  18489. },
  18490. "providerID": {
  18491. "type": "string"
  18492. },
  18493. "variant": {
  18494. "type": "string"
  18495. }
  18496. },
  18497. "required": ["id", "providerID"],
  18498. "additionalProperties": false
  18499. },
  18500. "content": {
  18501. "type": "array",
  18502. "items": {
  18503. "anyOf": [
  18504. {
  18505. "$ref": "#/components/schemas/SessionMessageAssistantText"
  18506. },
  18507. {
  18508. "$ref": "#/components/schemas/SessionMessageAssistantReasoning"
  18509. },
  18510. {
  18511. "$ref": "#/components/schemas/SessionMessageAssistantTool"
  18512. }
  18513. ]
  18514. }
  18515. },
  18516. "snapshot": {
  18517. "type": "object",
  18518. "properties": {
  18519. "start": {
  18520. "type": "string"
  18521. },
  18522. "end": {
  18523. "type": "string"
  18524. }
  18525. },
  18526. "additionalProperties": false
  18527. },
  18528. "finish": {
  18529. "type": "string"
  18530. },
  18531. "cost": {
  18532. "type": "number"
  18533. },
  18534. "tokens": {
  18535. "type": "object",
  18536. "properties": {
  18537. "input": {
  18538. "type": "number"
  18539. },
  18540. "output": {
  18541. "type": "number"
  18542. },
  18543. "reasoning": {
  18544. "type": "number"
  18545. },
  18546. "cache": {
  18547. "type": "object",
  18548. "properties": {
  18549. "read": {
  18550. "type": "number"
  18551. },
  18552. "write": {
  18553. "type": "number"
  18554. }
  18555. },
  18556. "required": ["read", "write"],
  18557. "additionalProperties": false
  18558. }
  18559. },
  18560. "required": ["input", "output", "reasoning", "cache"],
  18561. "additionalProperties": false
  18562. },
  18563. "error": {
  18564. "type": "object",
  18565. "properties": {
  18566. "type": {
  18567. "type": "string"
  18568. },
  18569. "message": {
  18570. "type": "string"
  18571. }
  18572. },
  18573. "required": ["type", "message"],
  18574. "additionalProperties": false
  18575. }
  18576. },
  18577. "required": ["id", "time", "type", "agent", "model", "content"],
  18578. "additionalProperties": false
  18579. },
  18580. "SessionMessageCompaction": {
  18581. "type": "object",
  18582. "properties": {
  18583. "type": {
  18584. "type": "string",
  18585. "enum": ["compaction"]
  18586. },
  18587. "reason": {
  18588. "type": "string",
  18589. "enum": ["auto", "manual"]
  18590. },
  18591. "summary": {
  18592. "type": "string"
  18593. },
  18594. "include": {
  18595. "type": "string"
  18596. },
  18597. "id": {
  18598. "type": "string"
  18599. },
  18600. "metadata": {
  18601. "type": "object"
  18602. },
  18603. "time": {
  18604. "type": "object",
  18605. "properties": {
  18606. "created": {
  18607. "type": "number"
  18608. }
  18609. },
  18610. "required": ["created"],
  18611. "additionalProperties": false
  18612. }
  18613. },
  18614. "required": ["type", "reason", "summary", "id", "time"],
  18615. "additionalProperties": false
  18616. },
  18617. "SessionMessage": {
  18618. "anyOf": [
  18619. {
  18620. "$ref": "#/components/schemas/SessionMessageAgentSwitched"
  18621. },
  18622. {
  18623. "$ref": "#/components/schemas/SessionMessageModelSwitched"
  18624. },
  18625. {
  18626. "$ref": "#/components/schemas/SessionMessageUser"
  18627. },
  18628. {
  18629. "$ref": "#/components/schemas/SessionMessageSynthetic"
  18630. },
  18631. {
  18632. "$ref": "#/components/schemas/SessionMessageShell"
  18633. },
  18634. {
  18635. "$ref": "#/components/schemas/SessionMessageAssistant"
  18636. },
  18637. {
  18638. "$ref": "#/components/schemas/SessionMessageCompaction"
  18639. }
  18640. ]
  18641. },
  18642. "EventTuiToastShow1": {
  18643. "type": "object",
  18644. "properties": {
  18645. "id": {
  18646. "type": "string"
  18647. },
  18648. "type": {
  18649. "type": "string",
  18650. "enum": ["tui.toast.show"]
  18651. },
  18652. "properties": {
  18653. "type": "object",
  18654. "properties": {
  18655. "title": {
  18656. "type": "string"
  18657. },
  18658. "message": {
  18659. "type": "string"
  18660. },
  18661. "variant": {
  18662. "type": "string",
  18663. "enum": ["info", "success", "warning", "error"]
  18664. },
  18665. "duration": {
  18666. "type": "integer",
  18667. "exclusiveMinimum": 0
  18668. }
  18669. },
  18670. "required": ["message", "variant"],
  18671. "additionalProperties": false
  18672. }
  18673. },
  18674. "required": ["id", "type", "properties"],
  18675. "additionalProperties": false
  18676. },
  18677. "BadRequestError": {
  18678. "type": "object",
  18679. "required": ["data", "errors", "success"],
  18680. "properties": {
  18681. "data": {},
  18682. "errors": {
  18683. "type": "array",
  18684. "items": {
  18685. "type": "object",
  18686. "additionalProperties": {}
  18687. }
  18688. },
  18689. "success": {
  18690. "type": "boolean",
  18691. "enum": [false]
  18692. }
  18693. }
  18694. },
  18695. "NotFoundError": {
  18696. "type": "object",
  18697. "required": ["name", "data"],
  18698. "properties": {
  18699. "name": {
  18700. "type": "string",
  18701. "enum": ["NotFoundError"]
  18702. },
  18703. "data": {
  18704. "type": "object",
  18705. "required": ["message"],
  18706. "properties": {
  18707. "message": {
  18708. "type": "string"
  18709. }
  18710. }
  18711. }
  18712. }
  18713. }
  18714. }
  18715. },
  18716. "security": [],
  18717. "tags": [
  18718. {
  18719. "name": "control",
  18720. "description": "Control plane routes."
  18721. },
  18722. {
  18723. "name": "global",
  18724. "description": "Global server routes."
  18725. },
  18726. {
  18727. "name": "event",
  18728. "description": "Instance event stream route."
  18729. },
  18730. {
  18731. "name": "config",
  18732. "description": "Experimental HttpApi config routes."
  18733. },
  18734. {
  18735. "name": "experimental",
  18736. "description": "Experimental HttpApi read-only routes."
  18737. },
  18738. {
  18739. "name": "file",
  18740. "description": "Experimental HttpApi file routes."
  18741. },
  18742. {
  18743. "name": "instance",
  18744. "description": "Experimental HttpApi instance read routes."
  18745. },
  18746. {
  18747. "name": "mcp",
  18748. "description": "Experimental HttpApi MCP routes."
  18749. },
  18750. {
  18751. "name": "project",
  18752. "description": "Experimental HttpApi project routes."
  18753. },
  18754. {
  18755. "name": "pty",
  18756. "description": "Experimental HttpApi PTY routes."
  18757. },
  18758. {
  18759. "name": "question",
  18760. "description": "Question routes."
  18761. },
  18762. {
  18763. "name": "permission",
  18764. "description": "Experimental HttpApi permission routes."
  18765. },
  18766. {
  18767. "name": "provider",
  18768. "description": "Experimental HttpApi provider routes."
  18769. },
  18770. {
  18771. "name": "session",
  18772. "description": "Experimental HttpApi session routes."
  18773. },
  18774. {
  18775. "name": "sync",
  18776. "description": "Experimental HttpApi sync routes."
  18777. },
  18778. {
  18779. "name": "v2",
  18780. "description": "Experimental v2 routes."
  18781. },
  18782. {
  18783. "name": "v2 messages",
  18784. "description": "Experimental v2 message routes."
  18785. },
  18786. {
  18787. "name": "tui",
  18788. "description": "Experimental HttpApi TUI routes."
  18789. },
  18790. {
  18791. "name": "workspace",
  18792. "description": "Experimental HttpApi workspace routes."
  18793. },
  18794. {
  18795. "name": "pty",
  18796. "description": "PTY websocket route."
  18797. }
  18798. ]
  18799. }