openapi.json 504 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561
  1. {
  2. "openapi": "3.1.0",
  3. "info": {
  4. "title": "opencode",
  5. "version": "1.0.0",
  6. "description": "opencode api"
  7. },
  8. "paths": {
  9. "/auth/{providerID}": {
  10. "put": {
  11. "tags": ["control"],
  12. "operationId": "auth.set",
  13. "parameters": [
  14. {
  15. "name": "providerID",
  16. "in": "path",
  17. "schema": {
  18. "type": "string"
  19. },
  20. "required": true
  21. }
  22. ],
  23. "responses": {
  24. "200": {
  25. "description": "Successfully set authentication credentials",
  26. "content": {
  27. "application/json": {
  28. "schema": {
  29. "type": "boolean",
  30. "description": "Successfully set authentication credentials"
  31. }
  32. }
  33. }
  34. },
  35. "400": {
  36. "description": "Bad request",
  37. "content": {
  38. "application/json": {
  39. "schema": {
  40. "$ref": "#/components/schemas/BadRequestError"
  41. }
  42. }
  43. }
  44. }
  45. },
  46. "description": "Set authentication credentials",
  47. "summary": "Set auth credentials",
  48. "requestBody": {
  49. "content": {
  50. "application/json": {
  51. "schema": {
  52. "$ref": "#/components/schemas/Auth"
  53. }
  54. }
  55. }
  56. },
  57. "x-codeSamples": [
  58. {
  59. "lang": "js",
  60. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.auth.set({\n ...\n})"
  61. }
  62. ]
  63. },
  64. "delete": {
  65. "tags": ["control"],
  66. "operationId": "auth.remove",
  67. "parameters": [
  68. {
  69. "name": "providerID",
  70. "in": "path",
  71. "schema": {
  72. "type": "string"
  73. },
  74. "required": true
  75. }
  76. ],
  77. "responses": {
  78. "200": {
  79. "description": "Successfully removed authentication credentials",
  80. "content": {
  81. "application/json": {
  82. "schema": {
  83. "type": "boolean",
  84. "description": "Successfully removed authentication credentials"
  85. }
  86. }
  87. }
  88. },
  89. "400": {
  90. "description": "Bad request",
  91. "content": {
  92. "application/json": {
  93. "schema": {
  94. "$ref": "#/components/schemas/BadRequestError"
  95. }
  96. }
  97. }
  98. }
  99. },
  100. "description": "Remove authentication credentials",
  101. "summary": "Remove auth credentials",
  102. "x-codeSamples": [
  103. {
  104. "lang": "js",
  105. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.auth.remove({\n ...\n})"
  106. }
  107. ]
  108. }
  109. },
  110. "/log": {
  111. "post": {
  112. "tags": ["control"],
  113. "operationId": "app.log",
  114. "parameters": [
  115. {
  116. "name": "directory",
  117. "in": "query",
  118. "required": false,
  119. "schema": {
  120. "type": "string"
  121. }
  122. },
  123. {
  124. "name": "workspace",
  125. "in": "query",
  126. "required": false,
  127. "schema": {
  128. "type": "string"
  129. }
  130. }
  131. ],
  132. "responses": {
  133. "200": {
  134. "description": "Log entry written successfully",
  135. "content": {
  136. "application/json": {
  137. "schema": {
  138. "type": "boolean",
  139. "description": "Log entry written successfully"
  140. }
  141. }
  142. }
  143. },
  144. "400": {
  145. "description": "Bad request",
  146. "content": {
  147. "application/json": {
  148. "schema": {
  149. "$ref": "#/components/schemas/BadRequestError"
  150. }
  151. }
  152. }
  153. }
  154. },
  155. "description": "Write a log entry to the server logs with specified level and metadata.",
  156. "summary": "Write log",
  157. "requestBody": {
  158. "content": {
  159. "application/json": {
  160. "schema": {
  161. "type": "object",
  162. "properties": {
  163. "service": {
  164. "type": "string",
  165. "description": "Service name for the log entry"
  166. },
  167. "level": {
  168. "type": "string",
  169. "enum": ["debug", "info", "error", "warn"],
  170. "description": "Log level"
  171. },
  172. "message": {
  173. "type": "string",
  174. "description": "Log message"
  175. },
  176. "extra": {
  177. "type": "object"
  178. }
  179. },
  180. "required": ["service", "level", "message"],
  181. "additionalProperties": false
  182. }
  183. }
  184. }
  185. },
  186. "x-codeSamples": [
  187. {
  188. "lang": "js",
  189. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.app.log({\n ...\n})"
  190. }
  191. ]
  192. }
  193. },
  194. "/global/health": {
  195. "get": {
  196. "tags": ["global"],
  197. "operationId": "global.health",
  198. "parameters": [],
  199. "responses": {
  200. "200": {
  201. "description": "Health information",
  202. "content": {
  203. "application/json": {
  204. "schema": {
  205. "type": "object",
  206. "properties": {
  207. "healthy": {
  208. "type": "boolean",
  209. "enum": [true]
  210. },
  211. "version": {
  212. "type": "string"
  213. }
  214. },
  215. "required": ["healthy", "version"],
  216. "additionalProperties": false,
  217. "description": "Health information"
  218. }
  219. }
  220. }
  221. }
  222. },
  223. "description": "Get health information about the OpenCode server.",
  224. "summary": "Get health",
  225. "x-codeSamples": [
  226. {
  227. "lang": "js",
  228. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.health({\n ...\n})"
  229. }
  230. ]
  231. }
  232. },
  233. "/global/event": {
  234. "get": {
  235. "tags": ["global"],
  236. "operationId": "global.event",
  237. "parameters": [],
  238. "responses": {
  239. "200": {
  240. "description": "Event stream",
  241. "content": {
  242. "text/event-stream": {
  243. "schema": {
  244. "$ref": "#/components/schemas/GlobalEvent"
  245. }
  246. }
  247. }
  248. }
  249. },
  250. "description": "Subscribe to global events from the OpenCode system using server-sent events.",
  251. "summary": "Get global events",
  252. "x-codeSamples": [
  253. {
  254. "lang": "js",
  255. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.event({\n ...\n})"
  256. }
  257. ]
  258. }
  259. },
  260. "/global/config": {
  261. "get": {
  262. "tags": ["global"],
  263. "operationId": "global.config.get",
  264. "parameters": [],
  265. "responses": {
  266. "200": {
  267. "description": "Get global config info",
  268. "content": {
  269. "application/json": {
  270. "schema": {
  271. "$ref": "#/components/schemas/Config"
  272. }
  273. }
  274. }
  275. }
  276. },
  277. "description": "Retrieve the current global OpenCode configuration settings and preferences.",
  278. "summary": "Get global configuration",
  279. "x-codeSamples": [
  280. {
  281. "lang": "js",
  282. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.config.get({\n ...\n})"
  283. }
  284. ]
  285. },
  286. "patch": {
  287. "tags": ["global"],
  288. "operationId": "global.config.update",
  289. "parameters": [],
  290. "responses": {
  291. "200": {
  292. "description": "Successfully updated global config",
  293. "content": {
  294. "application/json": {
  295. "schema": {
  296. "$ref": "#/components/schemas/Config"
  297. }
  298. }
  299. }
  300. },
  301. "400": {
  302. "description": "Bad request",
  303. "content": {
  304. "application/json": {
  305. "schema": {
  306. "$ref": "#/components/schemas/BadRequestError"
  307. }
  308. }
  309. }
  310. }
  311. },
  312. "description": "Update global OpenCode configuration settings and preferences.",
  313. "summary": "Update global configuration",
  314. "requestBody": {
  315. "content": {
  316. "application/json": {
  317. "schema": {
  318. "$ref": "#/components/schemas/Config"
  319. }
  320. }
  321. }
  322. },
  323. "x-codeSamples": [
  324. {
  325. "lang": "js",
  326. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.config.update({\n ...\n})"
  327. }
  328. ]
  329. }
  330. },
  331. "/global/dispose": {
  332. "post": {
  333. "tags": ["global"],
  334. "operationId": "global.dispose",
  335. "parameters": [],
  336. "responses": {
  337. "200": {
  338. "description": "Global disposed",
  339. "content": {
  340. "application/json": {
  341. "schema": {
  342. "type": "boolean",
  343. "description": "Global disposed"
  344. }
  345. }
  346. }
  347. }
  348. },
  349. "description": "Clean up and dispose all OpenCode instances, releasing all resources.",
  350. "summary": "Dispose instance",
  351. "x-codeSamples": [
  352. {
  353. "lang": "js",
  354. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.dispose({\n ...\n})"
  355. }
  356. ]
  357. }
  358. },
  359. "/global/upgrade": {
  360. "post": {
  361. "tags": ["global"],
  362. "operationId": "global.upgrade",
  363. "parameters": [],
  364. "responses": {
  365. "200": {
  366. "description": "Upgrade result",
  367. "content": {
  368. "application/json": {
  369. "schema": {
  370. "anyOf": [
  371. {
  372. "type": "object",
  373. "properties": {
  374. "success": {
  375. "type": "boolean",
  376. "enum": [true]
  377. },
  378. "version": {
  379. "type": "string"
  380. }
  381. },
  382. "required": ["success", "version"],
  383. "additionalProperties": false
  384. },
  385. {
  386. "type": "object",
  387. "properties": {
  388. "success": {
  389. "type": "boolean",
  390. "enum": [false]
  391. },
  392. "error": {
  393. "type": "string"
  394. }
  395. },
  396. "required": ["success", "error"],
  397. "additionalProperties": false
  398. }
  399. ],
  400. "description": "Upgrade result"
  401. }
  402. }
  403. }
  404. },
  405. "400": {
  406. "description": "Bad request",
  407. "content": {
  408. "application/json": {
  409. "schema": {
  410. "$ref": "#/components/schemas/BadRequestError"
  411. }
  412. }
  413. }
  414. }
  415. },
  416. "description": "Upgrade opencode to the specified version or latest if not specified.",
  417. "summary": "Upgrade opencode",
  418. "requestBody": {
  419. "content": {
  420. "application/json": {
  421. "schema": {
  422. "type": "object",
  423. "properties": {
  424. "target": {
  425. "type": "string"
  426. }
  427. },
  428. "additionalProperties": false
  429. }
  430. }
  431. }
  432. },
  433. "x-codeSamples": [
  434. {
  435. "lang": "js",
  436. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.upgrade({\n ...\n})"
  437. }
  438. ]
  439. }
  440. },
  441. "/event": {
  442. "get": {
  443. "tags": ["event"],
  444. "operationId": "event.subscribe",
  445. "parameters": [
  446. {
  447. "name": "directory",
  448. "in": "query",
  449. "required": false,
  450. "schema": {
  451. "type": "string"
  452. }
  453. },
  454. {
  455. "name": "workspace",
  456. "in": "query",
  457. "required": false,
  458. "schema": {
  459. "type": "string"
  460. }
  461. }
  462. ],
  463. "responses": {
  464. "200": {
  465. "description": "Event stream",
  466. "content": {
  467. "text/event-stream": {
  468. "schema": {
  469. "$ref": "#/components/schemas/Event"
  470. }
  471. }
  472. }
  473. }
  474. },
  475. "description": "Get events",
  476. "summary": "Subscribe to events",
  477. "x-codeSamples": [
  478. {
  479. "lang": "js",
  480. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.event.subscribe({\n ...\n})"
  481. }
  482. ]
  483. }
  484. },
  485. "/config": {
  486. "get": {
  487. "tags": ["config"],
  488. "operationId": "config.get",
  489. "parameters": [
  490. {
  491. "name": "directory",
  492. "in": "query",
  493. "required": false,
  494. "schema": {
  495. "type": "string"
  496. }
  497. },
  498. {
  499. "name": "workspace",
  500. "in": "query",
  501. "required": false,
  502. "schema": {
  503. "type": "string"
  504. }
  505. }
  506. ],
  507. "responses": {
  508. "200": {
  509. "description": "Get config info",
  510. "content": {
  511. "application/json": {
  512. "schema": {
  513. "$ref": "#/components/schemas/Config"
  514. }
  515. }
  516. }
  517. }
  518. },
  519. "description": "Retrieve the current OpenCode configuration settings and preferences.",
  520. "summary": "Get configuration",
  521. "x-codeSamples": [
  522. {
  523. "lang": "js",
  524. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.config.get({\n ...\n})"
  525. }
  526. ]
  527. },
  528. "patch": {
  529. "tags": ["config"],
  530. "operationId": "config.update",
  531. "parameters": [
  532. {
  533. "name": "directory",
  534. "in": "query",
  535. "required": false,
  536. "schema": {
  537. "type": "string"
  538. }
  539. },
  540. {
  541. "name": "workspace",
  542. "in": "query",
  543. "required": false,
  544. "schema": {
  545. "type": "string"
  546. }
  547. }
  548. ],
  549. "responses": {
  550. "200": {
  551. "description": "Successfully updated config",
  552. "content": {
  553. "application/json": {
  554. "schema": {
  555. "$ref": "#/components/schemas/Config"
  556. }
  557. }
  558. }
  559. },
  560. "400": {
  561. "description": "Bad request",
  562. "content": {
  563. "application/json": {
  564. "schema": {
  565. "$ref": "#/components/schemas/BadRequestError"
  566. }
  567. }
  568. }
  569. }
  570. },
  571. "description": "Update OpenCode configuration settings and preferences.",
  572. "summary": "Update configuration",
  573. "requestBody": {
  574. "content": {
  575. "application/json": {
  576. "schema": {
  577. "$ref": "#/components/schemas/Config"
  578. }
  579. }
  580. }
  581. },
  582. "x-codeSamples": [
  583. {
  584. "lang": "js",
  585. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.config.update({\n ...\n})"
  586. }
  587. ]
  588. }
  589. },
  590. "/config/providers": {
  591. "get": {
  592. "tags": ["config"],
  593. "operationId": "config.providers",
  594. "parameters": [
  595. {
  596. "name": "directory",
  597. "in": "query",
  598. "required": false,
  599. "schema": {
  600. "type": "string"
  601. }
  602. },
  603. {
  604. "name": "workspace",
  605. "in": "query",
  606. "required": false,
  607. "schema": {
  608. "type": "string"
  609. }
  610. }
  611. ],
  612. "responses": {
  613. "200": {
  614. "description": "List of providers",
  615. "content": {
  616. "application/json": {
  617. "schema": {
  618. "type": "object",
  619. "properties": {
  620. "providers": {
  621. "type": "array",
  622. "items": {
  623. "$ref": "#/components/schemas/Provider"
  624. }
  625. },
  626. "default": {
  627. "type": "object",
  628. "additionalProperties": {
  629. "type": "string"
  630. }
  631. }
  632. },
  633. "required": ["providers", "default"],
  634. "additionalProperties": false,
  635. "description": "List of providers"
  636. }
  637. }
  638. }
  639. }
  640. },
  641. "description": "Get a list of all configured AI providers and their default models.",
  642. "summary": "List config providers",
  643. "x-codeSamples": [
  644. {
  645. "lang": "js",
  646. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.config.providers({\n ...\n})"
  647. }
  648. ]
  649. }
  650. },
  651. "/experimental/console": {
  652. "get": {
  653. "tags": ["experimental"],
  654. "operationId": "experimental.console.get",
  655. "parameters": [
  656. {
  657. "name": "directory",
  658. "in": "query",
  659. "required": false,
  660. "schema": {
  661. "type": "string"
  662. }
  663. },
  664. {
  665. "name": "workspace",
  666. "in": "query",
  667. "required": false,
  668. "schema": {
  669. "type": "string"
  670. }
  671. }
  672. ],
  673. "responses": {
  674. "200": {
  675. "description": "Active Console provider metadata",
  676. "content": {
  677. "application/json": {
  678. "schema": {
  679. "$ref": "#/components/schemas/ConsoleState"
  680. }
  681. }
  682. }
  683. },
  684. "500": {
  685. "description": "InternalServerError",
  686. "content": {
  687. "application/json": {
  688. "schema": {
  689. "$ref": "#/components/schemas/effect_HttpApiError_InternalServerError"
  690. }
  691. }
  692. }
  693. }
  694. },
  695. "description": "Get the active Console org name and the set of provider IDs managed by that Console org.",
  696. "summary": "Get active Console provider metadata",
  697. "x-codeSamples": [
  698. {
  699. "lang": "js",
  700. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.console.get({\n ...\n})"
  701. }
  702. ]
  703. }
  704. },
  705. "/experimental/console/orgs": {
  706. "get": {
  707. "tags": ["experimental"],
  708. "operationId": "experimental.console.listOrgs",
  709. "parameters": [
  710. {
  711. "name": "directory",
  712. "in": "query",
  713. "required": false,
  714. "schema": {
  715. "type": "string"
  716. }
  717. },
  718. {
  719. "name": "workspace",
  720. "in": "query",
  721. "required": false,
  722. "schema": {
  723. "type": "string"
  724. }
  725. }
  726. ],
  727. "responses": {
  728. "200": {
  729. "description": "Switchable Console orgs",
  730. "content": {
  731. "application/json": {
  732. "schema": {
  733. "type": "object",
  734. "properties": {
  735. "orgs": {
  736. "type": "array",
  737. "items": {
  738. "type": "object",
  739. "properties": {
  740. "accountID": {
  741. "type": "string"
  742. },
  743. "accountEmail": {
  744. "type": "string"
  745. },
  746. "accountUrl": {
  747. "type": "string"
  748. },
  749. "orgID": {
  750. "type": "string"
  751. },
  752. "orgName": {
  753. "type": "string"
  754. },
  755. "active": {
  756. "type": "boolean"
  757. }
  758. },
  759. "required": ["accountID", "accountEmail", "accountUrl", "orgID", "orgName", "active"],
  760. "additionalProperties": false
  761. }
  762. }
  763. },
  764. "required": ["orgs"],
  765. "additionalProperties": false,
  766. "description": "Switchable Console orgs"
  767. }
  768. }
  769. }
  770. },
  771. "500": {
  772. "description": "InternalServerError",
  773. "content": {
  774. "application/json": {
  775. "schema": {
  776. "$ref": "#/components/schemas/effect_HttpApiError_InternalServerError"
  777. }
  778. }
  779. }
  780. }
  781. },
  782. "description": "Get the available Console orgs across logged-in accounts, including the current active org.",
  783. "summary": "List switchable Console orgs",
  784. "x-codeSamples": [
  785. {
  786. "lang": "js",
  787. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.console.listOrgs({\n ...\n})"
  788. }
  789. ]
  790. }
  791. },
  792. "/experimental/console/switch": {
  793. "post": {
  794. "tags": ["experimental"],
  795. "operationId": "experimental.console.switchOrg",
  796. "parameters": [
  797. {
  798. "name": "directory",
  799. "in": "query",
  800. "required": false,
  801. "schema": {
  802. "type": "string"
  803. }
  804. },
  805. {
  806. "name": "workspace",
  807. "in": "query",
  808. "required": false,
  809. "schema": {
  810. "type": "string"
  811. }
  812. }
  813. ],
  814. "responses": {
  815. "200": {
  816. "description": "Switch success",
  817. "content": {
  818. "application/json": {
  819. "schema": {
  820. "type": "boolean",
  821. "description": "Switch success"
  822. }
  823. }
  824. }
  825. }
  826. },
  827. "description": "Persist a new active Console account/org selection for the current local OpenCode state.",
  828. "summary": "Switch active Console org",
  829. "requestBody": {
  830. "content": {
  831. "application/json": {
  832. "schema": {
  833. "type": "object",
  834. "properties": {
  835. "accountID": {
  836. "type": "string"
  837. },
  838. "orgID": {
  839. "type": "string"
  840. }
  841. },
  842. "required": ["accountID", "orgID"],
  843. "additionalProperties": false
  844. }
  845. }
  846. }
  847. },
  848. "x-codeSamples": [
  849. {
  850. "lang": "js",
  851. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.console.switchOrg({\n ...\n})"
  852. }
  853. ]
  854. }
  855. },
  856. "/experimental/tool": {
  857. "get": {
  858. "tags": ["experimental"],
  859. "operationId": "tool.list",
  860. "parameters": [
  861. {
  862. "name": "directory",
  863. "in": "query",
  864. "required": false,
  865. "schema": {
  866. "type": "string"
  867. }
  868. },
  869. {
  870. "name": "workspace",
  871. "in": "query",
  872. "required": false,
  873. "schema": {
  874. "type": "string"
  875. }
  876. },
  877. {
  878. "name": "provider",
  879. "in": "query",
  880. "schema": {
  881. "type": "string"
  882. },
  883. "required": true
  884. },
  885. {
  886. "name": "model",
  887. "in": "query",
  888. "schema": {
  889. "type": "string"
  890. },
  891. "required": true
  892. }
  893. ],
  894. "responses": {
  895. "200": {
  896. "description": "Tools",
  897. "content": {
  898. "application/json": {
  899. "schema": {
  900. "$ref": "#/components/schemas/ToolList"
  901. }
  902. }
  903. }
  904. },
  905. "400": {
  906. "description": "Bad request",
  907. "content": {
  908. "application/json": {
  909. "schema": {
  910. "$ref": "#/components/schemas/BadRequestError"
  911. }
  912. }
  913. }
  914. }
  915. },
  916. "description": "Get a list of available tools with their JSON schema parameters for a specific provider and model combination.",
  917. "summary": "List tools",
  918. "x-codeSamples": [
  919. {
  920. "lang": "js",
  921. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tool.list({\n ...\n})"
  922. }
  923. ]
  924. }
  925. },
  926. "/experimental/tool/ids": {
  927. "get": {
  928. "tags": ["experimental"],
  929. "operationId": "tool.ids",
  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. "responses": {
  949. "200": {
  950. "description": "Tool IDs",
  951. "content": {
  952. "application/json": {
  953. "schema": {
  954. "$ref": "#/components/schemas/ToolIDs"
  955. }
  956. }
  957. }
  958. },
  959. "400": {
  960. "description": "Bad request",
  961. "content": {
  962. "application/json": {
  963. "schema": {
  964. "$ref": "#/components/schemas/BadRequestError"
  965. }
  966. }
  967. }
  968. }
  969. },
  970. "description": "Get a list of all available tool IDs, including both built-in tools and dynamically registered tools.",
  971. "summary": "List tool IDs",
  972. "x-codeSamples": [
  973. {
  974. "lang": "js",
  975. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tool.ids({\n ...\n})"
  976. }
  977. ]
  978. }
  979. },
  980. "/experimental/worktree": {
  981. "get": {
  982. "tags": ["experimental"],
  983. "operationId": "worktree.list",
  984. "parameters": [
  985. {
  986. "name": "directory",
  987. "in": "query",
  988. "required": false,
  989. "schema": {
  990. "type": "string"
  991. }
  992. },
  993. {
  994. "name": "workspace",
  995. "in": "query",
  996. "required": false,
  997. "schema": {
  998. "type": "string"
  999. }
  1000. }
  1001. ],
  1002. "responses": {
  1003. "200": {
  1004. "description": "List of worktree directories",
  1005. "content": {
  1006. "application/json": {
  1007. "schema": {
  1008. "type": "array",
  1009. "items": {
  1010. "type": "string"
  1011. },
  1012. "description": "List of worktree directories"
  1013. }
  1014. }
  1015. }
  1016. }
  1017. },
  1018. "description": "List all sandbox worktrees for the current project.",
  1019. "summary": "List worktrees",
  1020. "x-codeSamples": [
  1021. {
  1022. "lang": "js",
  1023. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.list({\n ...\n})"
  1024. }
  1025. ]
  1026. },
  1027. "post": {
  1028. "tags": ["experimental"],
  1029. "operationId": "worktree.create",
  1030. "parameters": [
  1031. {
  1032. "name": "directory",
  1033. "in": "query",
  1034. "required": false,
  1035. "schema": {
  1036. "type": "string"
  1037. }
  1038. },
  1039. {
  1040. "name": "workspace",
  1041. "in": "query",
  1042. "required": false,
  1043. "schema": {
  1044. "type": "string"
  1045. }
  1046. }
  1047. ],
  1048. "responses": {
  1049. "200": {
  1050. "description": "Worktree created",
  1051. "content": {
  1052. "application/json": {
  1053. "schema": {
  1054. "$ref": "#/components/schemas/Worktree"
  1055. }
  1056. }
  1057. }
  1058. },
  1059. "400": {
  1060. "description": "Bad request",
  1061. "content": {
  1062. "application/json": {
  1063. "schema": {
  1064. "$ref": "#/components/schemas/BadRequestError"
  1065. }
  1066. }
  1067. }
  1068. }
  1069. },
  1070. "description": "Create a new git worktree for the current project and run any configured startup scripts.",
  1071. "summary": "Create worktree",
  1072. "requestBody": {
  1073. "content": {
  1074. "application/json": {
  1075. "schema": {
  1076. "$ref": "#/components/schemas/WorktreeCreateInput"
  1077. }
  1078. }
  1079. }
  1080. },
  1081. "x-codeSamples": [
  1082. {
  1083. "lang": "js",
  1084. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.create({\n ...\n})"
  1085. }
  1086. ]
  1087. },
  1088. "delete": {
  1089. "tags": ["experimental"],
  1090. "operationId": "worktree.remove",
  1091. "parameters": [
  1092. {
  1093. "name": "directory",
  1094. "in": "query",
  1095. "required": false,
  1096. "schema": {
  1097. "type": "string"
  1098. }
  1099. },
  1100. {
  1101. "name": "workspace",
  1102. "in": "query",
  1103. "required": false,
  1104. "schema": {
  1105. "type": "string"
  1106. }
  1107. }
  1108. ],
  1109. "responses": {
  1110. "200": {
  1111. "description": "Worktree removed",
  1112. "content": {
  1113. "application/json": {
  1114. "schema": {
  1115. "type": "boolean",
  1116. "description": "Worktree removed"
  1117. }
  1118. }
  1119. }
  1120. },
  1121. "400": {
  1122. "description": "Bad request",
  1123. "content": {
  1124. "application/json": {
  1125. "schema": {
  1126. "$ref": "#/components/schemas/BadRequestError"
  1127. }
  1128. }
  1129. }
  1130. }
  1131. },
  1132. "description": "Remove a git worktree and delete its branch.",
  1133. "summary": "Remove worktree",
  1134. "requestBody": {
  1135. "content": {
  1136. "application/json": {
  1137. "schema": {
  1138. "$ref": "#/components/schemas/WorktreeRemoveInput"
  1139. }
  1140. }
  1141. }
  1142. },
  1143. "x-codeSamples": [
  1144. {
  1145. "lang": "js",
  1146. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.remove({\n ...\n})"
  1147. }
  1148. ]
  1149. }
  1150. },
  1151. "/experimental/worktree/reset": {
  1152. "post": {
  1153. "tags": ["experimental"],
  1154. "operationId": "worktree.reset",
  1155. "parameters": [
  1156. {
  1157. "name": "directory",
  1158. "in": "query",
  1159. "required": false,
  1160. "schema": {
  1161. "type": "string"
  1162. }
  1163. },
  1164. {
  1165. "name": "workspace",
  1166. "in": "query",
  1167. "required": false,
  1168. "schema": {
  1169. "type": "string"
  1170. }
  1171. }
  1172. ],
  1173. "responses": {
  1174. "200": {
  1175. "description": "Worktree reset",
  1176. "content": {
  1177. "application/json": {
  1178. "schema": {
  1179. "type": "boolean",
  1180. "description": "Worktree reset"
  1181. }
  1182. }
  1183. }
  1184. },
  1185. "400": {
  1186. "description": "Bad request",
  1187. "content": {
  1188. "application/json": {
  1189. "schema": {
  1190. "$ref": "#/components/schemas/BadRequestError"
  1191. }
  1192. }
  1193. }
  1194. }
  1195. },
  1196. "description": "Reset a worktree branch to the primary default branch.",
  1197. "summary": "Reset worktree",
  1198. "requestBody": {
  1199. "content": {
  1200. "application/json": {
  1201. "schema": {
  1202. "$ref": "#/components/schemas/WorktreeResetInput"
  1203. }
  1204. }
  1205. }
  1206. },
  1207. "x-codeSamples": [
  1208. {
  1209. "lang": "js",
  1210. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.reset({\n ...\n})"
  1211. }
  1212. ]
  1213. }
  1214. },
  1215. "/experimental/session": {
  1216. "get": {
  1217. "tags": ["experimental"],
  1218. "operationId": "experimental.session.list",
  1219. "parameters": [
  1220. {
  1221. "name": "directory",
  1222. "in": "query",
  1223. "required": false,
  1224. "schema": {
  1225. "type": "string"
  1226. }
  1227. },
  1228. {
  1229. "name": "workspace",
  1230. "in": "query",
  1231. "required": false,
  1232. "schema": {
  1233. "type": "string"
  1234. }
  1235. },
  1236. {
  1237. "name": "roots",
  1238. "in": "query",
  1239. "schema": {
  1240. "anyOf": [
  1241. {
  1242. "type": "boolean"
  1243. },
  1244. {
  1245. "type": "string",
  1246. "enum": ["true", "false"]
  1247. }
  1248. ]
  1249. },
  1250. "required": false
  1251. },
  1252. {
  1253. "name": "start",
  1254. "in": "query",
  1255. "schema": {
  1256. "type": "number"
  1257. },
  1258. "required": false
  1259. },
  1260. {
  1261. "name": "cursor",
  1262. "in": "query",
  1263. "schema": {
  1264. "type": "number"
  1265. },
  1266. "required": false
  1267. },
  1268. {
  1269. "name": "search",
  1270. "in": "query",
  1271. "schema": {
  1272. "type": "string"
  1273. },
  1274. "required": false
  1275. },
  1276. {
  1277. "name": "limit",
  1278. "in": "query",
  1279. "schema": {
  1280. "type": "number"
  1281. },
  1282. "required": false
  1283. },
  1284. {
  1285. "name": "archived",
  1286. "in": "query",
  1287. "schema": {
  1288. "anyOf": [
  1289. {
  1290. "type": "boolean"
  1291. },
  1292. {
  1293. "type": "string",
  1294. "enum": ["true", "false"]
  1295. }
  1296. ]
  1297. },
  1298. "required": false
  1299. }
  1300. ],
  1301. "responses": {
  1302. "200": {
  1303. "description": "List of sessions",
  1304. "content": {
  1305. "application/json": {
  1306. "schema": {
  1307. "type": "array",
  1308. "items": {
  1309. "$ref": "#/components/schemas/GlobalSession"
  1310. },
  1311. "description": "List of sessions"
  1312. }
  1313. }
  1314. }
  1315. }
  1316. },
  1317. "description": "Get a list of all OpenCode sessions across projects, sorted by most recently updated. Archived sessions are excluded by default.",
  1318. "summary": "List sessions",
  1319. "x-codeSamples": [
  1320. {
  1321. "lang": "js",
  1322. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.session.list({\n ...\n})"
  1323. }
  1324. ]
  1325. }
  1326. },
  1327. "/experimental/resource": {
  1328. "get": {
  1329. "tags": ["experimental"],
  1330. "operationId": "experimental.resource.list",
  1331. "parameters": [
  1332. {
  1333. "name": "directory",
  1334. "in": "query",
  1335. "required": false,
  1336. "schema": {
  1337. "type": "string"
  1338. }
  1339. },
  1340. {
  1341. "name": "workspace",
  1342. "in": "query",
  1343. "required": false,
  1344. "schema": {
  1345. "type": "string"
  1346. }
  1347. }
  1348. ],
  1349. "responses": {
  1350. "200": {
  1351. "description": "MCP resources",
  1352. "content": {
  1353. "application/json": {
  1354. "schema": {
  1355. "type": "object",
  1356. "additionalProperties": {
  1357. "$ref": "#/components/schemas/McpResource"
  1358. },
  1359. "description": "MCP resources"
  1360. }
  1361. }
  1362. }
  1363. }
  1364. },
  1365. "description": "Get all available MCP resources from connected servers. Optionally filter by name.",
  1366. "summary": "Get MCP resources",
  1367. "x-codeSamples": [
  1368. {
  1369. "lang": "js",
  1370. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.resource.list({\n ...\n})"
  1371. }
  1372. ]
  1373. }
  1374. },
  1375. "/find": {
  1376. "get": {
  1377. "tags": ["file"],
  1378. "operationId": "find.text",
  1379. "parameters": [
  1380. {
  1381. "name": "directory",
  1382. "in": "query",
  1383. "required": false,
  1384. "schema": {
  1385. "type": "string"
  1386. }
  1387. },
  1388. {
  1389. "name": "workspace",
  1390. "in": "query",
  1391. "required": false,
  1392. "schema": {
  1393. "type": "string"
  1394. }
  1395. },
  1396. {
  1397. "name": "pattern",
  1398. "in": "query",
  1399. "schema": {
  1400. "type": "string"
  1401. },
  1402. "required": true
  1403. }
  1404. ],
  1405. "responses": {
  1406. "200": {
  1407. "description": "Matches",
  1408. "content": {
  1409. "application/json": {
  1410. "schema": {
  1411. "type": "array",
  1412. "items": {
  1413. "type": "object",
  1414. "properties": {
  1415. "path": {
  1416. "type": "object",
  1417. "properties": {
  1418. "text": {
  1419. "type": "string"
  1420. }
  1421. },
  1422. "required": ["text"],
  1423. "additionalProperties": false
  1424. },
  1425. "lines": {
  1426. "type": "object",
  1427. "properties": {
  1428. "text": {
  1429. "type": "string"
  1430. }
  1431. },
  1432. "required": ["text"],
  1433. "additionalProperties": false
  1434. },
  1435. "line_number": {
  1436. "type": "integer",
  1437. "minimum": 0
  1438. },
  1439. "absolute_offset": {
  1440. "type": "integer",
  1441. "minimum": 0
  1442. },
  1443. "submatches": {
  1444. "type": "array",
  1445. "items": {
  1446. "type": "object",
  1447. "properties": {
  1448. "match": {
  1449. "type": "object",
  1450. "properties": {
  1451. "text": {
  1452. "type": "string"
  1453. }
  1454. },
  1455. "required": ["text"],
  1456. "additionalProperties": false
  1457. },
  1458. "start": {
  1459. "type": "integer",
  1460. "minimum": 0
  1461. },
  1462. "end": {
  1463. "type": "integer",
  1464. "minimum": 0
  1465. }
  1466. },
  1467. "required": ["match", "start", "end"],
  1468. "additionalProperties": false
  1469. }
  1470. }
  1471. },
  1472. "required": ["path", "lines", "line_number", "absolute_offset", "submatches"],
  1473. "additionalProperties": false
  1474. },
  1475. "description": "Matches"
  1476. }
  1477. }
  1478. }
  1479. }
  1480. },
  1481. "description": "Search for text patterns across files in the project using ripgrep.",
  1482. "summary": "Find text",
  1483. "x-codeSamples": [
  1484. {
  1485. "lang": "js",
  1486. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.find.text({\n ...\n})"
  1487. }
  1488. ]
  1489. }
  1490. },
  1491. "/find/file": {
  1492. "get": {
  1493. "tags": ["file"],
  1494. "operationId": "find.files",
  1495. "parameters": [
  1496. {
  1497. "name": "directory",
  1498. "in": "query",
  1499. "required": false,
  1500. "schema": {
  1501. "type": "string"
  1502. }
  1503. },
  1504. {
  1505. "name": "workspace",
  1506. "in": "query",
  1507. "required": false,
  1508. "schema": {
  1509. "type": "string"
  1510. }
  1511. },
  1512. {
  1513. "name": "query",
  1514. "in": "query",
  1515. "schema": {
  1516. "type": "string"
  1517. },
  1518. "required": true
  1519. },
  1520. {
  1521. "name": "dirs",
  1522. "in": "query",
  1523. "schema": {
  1524. "type": "string",
  1525. "enum": ["true", "false"]
  1526. },
  1527. "required": false
  1528. },
  1529. {
  1530. "name": "type",
  1531. "in": "query",
  1532. "schema": {
  1533. "type": "string",
  1534. "enum": ["file", "directory"]
  1535. },
  1536. "required": false
  1537. },
  1538. {
  1539. "name": "limit",
  1540. "in": "query",
  1541. "schema": {
  1542. "type": "integer",
  1543. "minimum": 1,
  1544. "maximum": 200
  1545. },
  1546. "required": false
  1547. }
  1548. ],
  1549. "responses": {
  1550. "200": {
  1551. "description": "File paths",
  1552. "content": {
  1553. "application/json": {
  1554. "schema": {
  1555. "type": "array",
  1556. "items": {
  1557. "type": "string"
  1558. },
  1559. "description": "File paths"
  1560. }
  1561. }
  1562. }
  1563. }
  1564. },
  1565. "description": "Search for files or directories by name or pattern in the project directory.",
  1566. "summary": "Find files",
  1567. "x-codeSamples": [
  1568. {
  1569. "lang": "js",
  1570. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.find.files({\n ...\n})"
  1571. }
  1572. ]
  1573. }
  1574. },
  1575. "/find/symbol": {
  1576. "get": {
  1577. "tags": ["file"],
  1578. "operationId": "find.symbols",
  1579. "parameters": [
  1580. {
  1581. "name": "directory",
  1582. "in": "query",
  1583. "required": false,
  1584. "schema": {
  1585. "type": "string"
  1586. }
  1587. },
  1588. {
  1589. "name": "workspace",
  1590. "in": "query",
  1591. "required": false,
  1592. "schema": {
  1593. "type": "string"
  1594. }
  1595. },
  1596. {
  1597. "name": "query",
  1598. "in": "query",
  1599. "schema": {
  1600. "type": "string"
  1601. },
  1602. "required": true
  1603. }
  1604. ],
  1605. "responses": {
  1606. "200": {
  1607. "description": "Symbols",
  1608. "content": {
  1609. "application/json": {
  1610. "schema": {
  1611. "type": "array",
  1612. "items": {
  1613. "$ref": "#/components/schemas/Symbol"
  1614. },
  1615. "description": "Symbols"
  1616. }
  1617. }
  1618. }
  1619. }
  1620. },
  1621. "description": "Search for workspace symbols like functions, classes, and variables using LSP.",
  1622. "summary": "Find symbols",
  1623. "x-codeSamples": [
  1624. {
  1625. "lang": "js",
  1626. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.find.symbols({\n ...\n})"
  1627. }
  1628. ]
  1629. }
  1630. },
  1631. "/file": {
  1632. "get": {
  1633. "tags": ["file"],
  1634. "operationId": "file.list",
  1635. "parameters": [
  1636. {
  1637. "name": "directory",
  1638. "in": "query",
  1639. "required": false,
  1640. "schema": {
  1641. "type": "string"
  1642. }
  1643. },
  1644. {
  1645. "name": "workspace",
  1646. "in": "query",
  1647. "required": false,
  1648. "schema": {
  1649. "type": "string"
  1650. }
  1651. },
  1652. {
  1653. "name": "path",
  1654. "in": "query",
  1655. "schema": {
  1656. "type": "string"
  1657. },
  1658. "required": true
  1659. }
  1660. ],
  1661. "responses": {
  1662. "200": {
  1663. "description": "Files and directories",
  1664. "content": {
  1665. "application/json": {
  1666. "schema": {
  1667. "type": "array",
  1668. "items": {
  1669. "$ref": "#/components/schemas/FileNode"
  1670. },
  1671. "description": "Files and directories"
  1672. }
  1673. }
  1674. }
  1675. }
  1676. },
  1677. "description": "List files and directories in a specified path.",
  1678. "summary": "List files",
  1679. "x-codeSamples": [
  1680. {
  1681. "lang": "js",
  1682. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.file.list({\n ...\n})"
  1683. }
  1684. ]
  1685. }
  1686. },
  1687. "/file/content": {
  1688. "get": {
  1689. "tags": ["file"],
  1690. "operationId": "file.read",
  1691. "parameters": [
  1692. {
  1693. "name": "directory",
  1694. "in": "query",
  1695. "required": false,
  1696. "schema": {
  1697. "type": "string"
  1698. }
  1699. },
  1700. {
  1701. "name": "workspace",
  1702. "in": "query",
  1703. "required": false,
  1704. "schema": {
  1705. "type": "string"
  1706. }
  1707. },
  1708. {
  1709. "name": "path",
  1710. "in": "query",
  1711. "schema": {
  1712. "type": "string"
  1713. },
  1714. "required": true
  1715. }
  1716. ],
  1717. "responses": {
  1718. "200": {
  1719. "description": "File content",
  1720. "content": {
  1721. "application/json": {
  1722. "schema": {
  1723. "$ref": "#/components/schemas/FileContent"
  1724. }
  1725. }
  1726. }
  1727. }
  1728. },
  1729. "description": "Read the content of a specified file.",
  1730. "summary": "Read file",
  1731. "x-codeSamples": [
  1732. {
  1733. "lang": "js",
  1734. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.file.read({\n ...\n})"
  1735. }
  1736. ]
  1737. }
  1738. },
  1739. "/file/status": {
  1740. "get": {
  1741. "tags": ["file"],
  1742. "operationId": "file.status",
  1743. "parameters": [
  1744. {
  1745. "name": "directory",
  1746. "in": "query",
  1747. "required": false,
  1748. "schema": {
  1749. "type": "string"
  1750. }
  1751. },
  1752. {
  1753. "name": "workspace",
  1754. "in": "query",
  1755. "required": false,
  1756. "schema": {
  1757. "type": "string"
  1758. }
  1759. }
  1760. ],
  1761. "responses": {
  1762. "200": {
  1763. "description": "File status",
  1764. "content": {
  1765. "application/json": {
  1766. "schema": {
  1767. "type": "array",
  1768. "items": {
  1769. "$ref": "#/components/schemas/File"
  1770. },
  1771. "description": "File status"
  1772. }
  1773. }
  1774. }
  1775. }
  1776. },
  1777. "description": "Get the git status of all files in the project.",
  1778. "summary": "Get file status",
  1779. "x-codeSamples": [
  1780. {
  1781. "lang": "js",
  1782. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.file.status({\n ...\n})"
  1783. }
  1784. ]
  1785. }
  1786. },
  1787. "/instance/dispose": {
  1788. "post": {
  1789. "tags": ["instance"],
  1790. "operationId": "instance.dispose",
  1791. "parameters": [
  1792. {
  1793. "name": "directory",
  1794. "in": "query",
  1795. "required": false,
  1796. "schema": {
  1797. "type": "string"
  1798. }
  1799. },
  1800. {
  1801. "name": "workspace",
  1802. "in": "query",
  1803. "required": false,
  1804. "schema": {
  1805. "type": "string"
  1806. }
  1807. }
  1808. ],
  1809. "responses": {
  1810. "200": {
  1811. "description": "Instance disposed",
  1812. "content": {
  1813. "application/json": {
  1814. "schema": {
  1815. "type": "boolean",
  1816. "description": "Instance disposed"
  1817. }
  1818. }
  1819. }
  1820. }
  1821. },
  1822. "description": "Clean up and dispose the current OpenCode instance, releasing all resources.",
  1823. "summary": "Dispose instance",
  1824. "x-codeSamples": [
  1825. {
  1826. "lang": "js",
  1827. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.instance.dispose({\n ...\n})"
  1828. }
  1829. ]
  1830. }
  1831. },
  1832. "/path": {
  1833. "get": {
  1834. "tags": ["instance"],
  1835. "operationId": "path.get",
  1836. "parameters": [
  1837. {
  1838. "name": "directory",
  1839. "in": "query",
  1840. "required": false,
  1841. "schema": {
  1842. "type": "string"
  1843. }
  1844. },
  1845. {
  1846. "name": "workspace",
  1847. "in": "query",
  1848. "required": false,
  1849. "schema": {
  1850. "type": "string"
  1851. }
  1852. }
  1853. ],
  1854. "responses": {
  1855. "200": {
  1856. "description": "Path",
  1857. "content": {
  1858. "application/json": {
  1859. "schema": {
  1860. "$ref": "#/components/schemas/Path"
  1861. }
  1862. }
  1863. }
  1864. }
  1865. },
  1866. "description": "Retrieve the current working directory and related path information for the OpenCode instance.",
  1867. "summary": "Get paths",
  1868. "x-codeSamples": [
  1869. {
  1870. "lang": "js",
  1871. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.path.get({\n ...\n})"
  1872. }
  1873. ]
  1874. }
  1875. },
  1876. "/vcs": {
  1877. "get": {
  1878. "tags": ["instance"],
  1879. "operationId": "vcs.get",
  1880. "parameters": [
  1881. {
  1882. "name": "directory",
  1883. "in": "query",
  1884. "required": false,
  1885. "schema": {
  1886. "type": "string"
  1887. }
  1888. },
  1889. {
  1890. "name": "workspace",
  1891. "in": "query",
  1892. "required": false,
  1893. "schema": {
  1894. "type": "string"
  1895. }
  1896. }
  1897. ],
  1898. "responses": {
  1899. "200": {
  1900. "description": "VCS info",
  1901. "content": {
  1902. "application/json": {
  1903. "schema": {
  1904. "$ref": "#/components/schemas/VcsInfo"
  1905. }
  1906. }
  1907. }
  1908. }
  1909. },
  1910. "description": "Retrieve version control system (VCS) information for the current project, such as git branch.",
  1911. "summary": "Get VCS info",
  1912. "x-codeSamples": [
  1913. {
  1914. "lang": "js",
  1915. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.vcs.get({\n ...\n})"
  1916. }
  1917. ]
  1918. }
  1919. },
  1920. "/vcs/status": {
  1921. "get": {
  1922. "tags": ["instance"],
  1923. "operationId": "vcs.status",
  1924. "parameters": [
  1925. {
  1926. "name": "directory",
  1927. "in": "query",
  1928. "required": false,
  1929. "schema": {
  1930. "type": "string"
  1931. }
  1932. },
  1933. {
  1934. "name": "workspace",
  1935. "in": "query",
  1936. "required": false,
  1937. "schema": {
  1938. "type": "string"
  1939. }
  1940. }
  1941. ],
  1942. "responses": {
  1943. "200": {
  1944. "description": "VCS status",
  1945. "content": {
  1946. "application/json": {
  1947. "schema": {
  1948. "type": "array",
  1949. "items": {
  1950. "$ref": "#/components/schemas/VcsFileStatus"
  1951. },
  1952. "description": "VCS status"
  1953. }
  1954. }
  1955. }
  1956. }
  1957. },
  1958. "description": "Retrieve changed files in the current working tree without patches.",
  1959. "summary": "Get VCS status",
  1960. "x-codeSamples": [
  1961. {
  1962. "lang": "js",
  1963. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.vcs.status({\n ...\n})"
  1964. }
  1965. ]
  1966. }
  1967. },
  1968. "/vcs/diff": {
  1969. "get": {
  1970. "tags": ["instance"],
  1971. "operationId": "vcs.diff",
  1972. "parameters": [
  1973. {
  1974. "name": "directory",
  1975. "in": "query",
  1976. "required": false,
  1977. "schema": {
  1978. "type": "string"
  1979. }
  1980. },
  1981. {
  1982. "name": "workspace",
  1983. "in": "query",
  1984. "required": false,
  1985. "schema": {
  1986. "type": "string"
  1987. }
  1988. },
  1989. {
  1990. "name": "mode",
  1991. "in": "query",
  1992. "schema": {
  1993. "type": "string",
  1994. "enum": ["git", "branch"]
  1995. },
  1996. "required": true
  1997. }
  1998. ],
  1999. "responses": {
  2000. "200": {
  2001. "description": "VCS diff",
  2002. "content": {
  2003. "application/json": {
  2004. "schema": {
  2005. "type": "array",
  2006. "items": {
  2007. "$ref": "#/components/schemas/VcsFileDiff"
  2008. },
  2009. "description": "VCS diff"
  2010. }
  2011. }
  2012. }
  2013. }
  2014. },
  2015. "description": "Retrieve the current git diff for the working tree or against the default branch.",
  2016. "summary": "Get VCS diff",
  2017. "x-codeSamples": [
  2018. {
  2019. "lang": "js",
  2020. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.vcs.diff({\n ...\n})"
  2021. }
  2022. ]
  2023. }
  2024. },
  2025. "/vcs/diff/raw": {
  2026. "get": {
  2027. "tags": ["instance"],
  2028. "operationId": "vcs.diff.raw",
  2029. "parameters": [
  2030. {
  2031. "name": "directory",
  2032. "in": "query",
  2033. "required": false,
  2034. "schema": {
  2035. "type": "string"
  2036. }
  2037. },
  2038. {
  2039. "name": "workspace",
  2040. "in": "query",
  2041. "required": false,
  2042. "schema": {
  2043. "type": "string"
  2044. }
  2045. }
  2046. ],
  2047. "responses": {
  2048. "200": {
  2049. "description": "Raw VCS diff",
  2050. "content": {
  2051. "text/x-diff; charset=utf-8": {
  2052. "schema": {
  2053. "type": "string"
  2054. }
  2055. }
  2056. }
  2057. }
  2058. },
  2059. "description": "Retrieve a raw patch for current uncommitted changes.",
  2060. "summary": "Get raw VCS diff",
  2061. "x-codeSamples": [
  2062. {
  2063. "lang": "js",
  2064. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.vcs.diff.raw({\n ...\n})"
  2065. }
  2066. ]
  2067. }
  2068. },
  2069. "/vcs/apply": {
  2070. "post": {
  2071. "tags": ["instance"],
  2072. "operationId": "vcs.apply",
  2073. "parameters": [
  2074. {
  2075. "name": "directory",
  2076. "in": "query",
  2077. "required": false,
  2078. "schema": {
  2079. "type": "string"
  2080. }
  2081. },
  2082. {
  2083. "name": "workspace",
  2084. "in": "query",
  2085. "required": false,
  2086. "schema": {
  2087. "type": "string"
  2088. }
  2089. }
  2090. ],
  2091. "responses": {
  2092. "200": {
  2093. "description": "VCS patch applied",
  2094. "content": {
  2095. "application/json": {
  2096. "schema": {
  2097. "type": "object",
  2098. "properties": {
  2099. "applied": {
  2100. "type": "boolean"
  2101. }
  2102. },
  2103. "required": ["applied"],
  2104. "additionalProperties": false,
  2105. "description": "VCS patch applied"
  2106. }
  2107. }
  2108. }
  2109. },
  2110. "400": {
  2111. "description": "VcsApplyError",
  2112. "content": {
  2113. "application/json": {
  2114. "schema": {
  2115. "$ref": "#/components/schemas/VcsApplyError"
  2116. }
  2117. }
  2118. }
  2119. }
  2120. },
  2121. "description": "Apply a raw patch to the current working tree.",
  2122. "summary": "Apply VCS patch",
  2123. "requestBody": {
  2124. "content": {
  2125. "application/json": {
  2126. "schema": {
  2127. "type": "object",
  2128. "properties": {
  2129. "patch": {
  2130. "type": "string"
  2131. }
  2132. },
  2133. "required": ["patch"],
  2134. "additionalProperties": false
  2135. }
  2136. }
  2137. }
  2138. },
  2139. "x-codeSamples": [
  2140. {
  2141. "lang": "js",
  2142. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.vcs.apply({\n ...\n})"
  2143. }
  2144. ]
  2145. }
  2146. },
  2147. "/command": {
  2148. "get": {
  2149. "tags": ["instance"],
  2150. "operationId": "command.list",
  2151. "parameters": [
  2152. {
  2153. "name": "directory",
  2154. "in": "query",
  2155. "required": false,
  2156. "schema": {
  2157. "type": "string"
  2158. }
  2159. },
  2160. {
  2161. "name": "workspace",
  2162. "in": "query",
  2163. "required": false,
  2164. "schema": {
  2165. "type": "string"
  2166. }
  2167. }
  2168. ],
  2169. "responses": {
  2170. "200": {
  2171. "description": "List of commands",
  2172. "content": {
  2173. "application/json": {
  2174. "schema": {
  2175. "type": "array",
  2176. "items": {
  2177. "$ref": "#/components/schemas/Command"
  2178. },
  2179. "description": "List of commands"
  2180. }
  2181. }
  2182. }
  2183. }
  2184. },
  2185. "description": "Get a list of all available commands in the OpenCode system.",
  2186. "summary": "List commands",
  2187. "x-codeSamples": [
  2188. {
  2189. "lang": "js",
  2190. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.command.list({\n ...\n})"
  2191. }
  2192. ]
  2193. }
  2194. },
  2195. "/agent": {
  2196. "get": {
  2197. "tags": ["instance"],
  2198. "operationId": "app.agents",
  2199. "parameters": [
  2200. {
  2201. "name": "directory",
  2202. "in": "query",
  2203. "required": false,
  2204. "schema": {
  2205. "type": "string"
  2206. }
  2207. },
  2208. {
  2209. "name": "workspace",
  2210. "in": "query",
  2211. "required": false,
  2212. "schema": {
  2213. "type": "string"
  2214. }
  2215. }
  2216. ],
  2217. "responses": {
  2218. "200": {
  2219. "description": "List of agents",
  2220. "content": {
  2221. "application/json": {
  2222. "schema": {
  2223. "type": "array",
  2224. "items": {
  2225. "$ref": "#/components/schemas/Agent"
  2226. },
  2227. "description": "List of agents"
  2228. }
  2229. }
  2230. }
  2231. }
  2232. },
  2233. "description": "Get a list of all available AI agents in the OpenCode system.",
  2234. "summary": "List agents",
  2235. "x-codeSamples": [
  2236. {
  2237. "lang": "js",
  2238. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.app.agents({\n ...\n})"
  2239. }
  2240. ]
  2241. }
  2242. },
  2243. "/skill": {
  2244. "get": {
  2245. "tags": ["instance"],
  2246. "operationId": "app.skills",
  2247. "parameters": [
  2248. {
  2249. "name": "directory",
  2250. "in": "query",
  2251. "required": false,
  2252. "schema": {
  2253. "type": "string"
  2254. }
  2255. },
  2256. {
  2257. "name": "workspace",
  2258. "in": "query",
  2259. "required": false,
  2260. "schema": {
  2261. "type": "string"
  2262. }
  2263. }
  2264. ],
  2265. "responses": {
  2266. "200": {
  2267. "description": "List of skills",
  2268. "content": {
  2269. "application/json": {
  2270. "schema": {
  2271. "type": "array",
  2272. "items": {
  2273. "type": "object",
  2274. "properties": {
  2275. "name": {
  2276. "type": "string"
  2277. },
  2278. "description": {
  2279. "type": "string"
  2280. },
  2281. "location": {
  2282. "type": "string"
  2283. },
  2284. "content": {
  2285. "type": "string"
  2286. }
  2287. },
  2288. "required": ["name", "location", "content"],
  2289. "additionalProperties": false
  2290. },
  2291. "description": "List of skills"
  2292. }
  2293. }
  2294. }
  2295. }
  2296. },
  2297. "description": "Get a list of all available skills in the OpenCode system.",
  2298. "summary": "List skills",
  2299. "x-codeSamples": [
  2300. {
  2301. "lang": "js",
  2302. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.app.skills({\n ...\n})"
  2303. }
  2304. ]
  2305. }
  2306. },
  2307. "/lsp": {
  2308. "get": {
  2309. "tags": ["instance"],
  2310. "operationId": "lsp.status",
  2311. "parameters": [
  2312. {
  2313. "name": "directory",
  2314. "in": "query",
  2315. "required": false,
  2316. "schema": {
  2317. "type": "string"
  2318. }
  2319. },
  2320. {
  2321. "name": "workspace",
  2322. "in": "query",
  2323. "required": false,
  2324. "schema": {
  2325. "type": "string"
  2326. }
  2327. }
  2328. ],
  2329. "responses": {
  2330. "200": {
  2331. "description": "LSP server status",
  2332. "content": {
  2333. "application/json": {
  2334. "schema": {
  2335. "type": "array",
  2336. "items": {
  2337. "$ref": "#/components/schemas/LSPStatus"
  2338. },
  2339. "description": "LSP server status"
  2340. }
  2341. }
  2342. }
  2343. }
  2344. },
  2345. "description": "Get LSP server status",
  2346. "summary": "Get LSP status",
  2347. "x-codeSamples": [
  2348. {
  2349. "lang": "js",
  2350. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.lsp.status({\n ...\n})"
  2351. }
  2352. ]
  2353. }
  2354. },
  2355. "/formatter": {
  2356. "get": {
  2357. "tags": ["instance"],
  2358. "operationId": "formatter.status",
  2359. "parameters": [
  2360. {
  2361. "name": "directory",
  2362. "in": "query",
  2363. "required": false,
  2364. "schema": {
  2365. "type": "string"
  2366. }
  2367. },
  2368. {
  2369. "name": "workspace",
  2370. "in": "query",
  2371. "required": false,
  2372. "schema": {
  2373. "type": "string"
  2374. }
  2375. }
  2376. ],
  2377. "responses": {
  2378. "200": {
  2379. "description": "Formatter status",
  2380. "content": {
  2381. "application/json": {
  2382. "schema": {
  2383. "type": "array",
  2384. "items": {
  2385. "$ref": "#/components/schemas/FormatterStatus"
  2386. },
  2387. "description": "Formatter status"
  2388. }
  2389. }
  2390. }
  2391. }
  2392. },
  2393. "description": "Get formatter status",
  2394. "summary": "Get formatter status",
  2395. "x-codeSamples": [
  2396. {
  2397. "lang": "js",
  2398. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.formatter.status({\n ...\n})"
  2399. }
  2400. ]
  2401. }
  2402. },
  2403. "/mcp": {
  2404. "get": {
  2405. "tags": ["mcp"],
  2406. "operationId": "mcp.status",
  2407. "parameters": [
  2408. {
  2409. "name": "directory",
  2410. "in": "query",
  2411. "required": false,
  2412. "schema": {
  2413. "type": "string"
  2414. }
  2415. },
  2416. {
  2417. "name": "workspace",
  2418. "in": "query",
  2419. "required": false,
  2420. "schema": {
  2421. "type": "string"
  2422. }
  2423. }
  2424. ],
  2425. "responses": {
  2426. "200": {
  2427. "description": "MCP server status",
  2428. "content": {
  2429. "application/json": {
  2430. "schema": {
  2431. "type": "object",
  2432. "additionalProperties": {
  2433. "$ref": "#/components/schemas/MCPStatus"
  2434. },
  2435. "description": "MCP server status"
  2436. }
  2437. }
  2438. }
  2439. }
  2440. },
  2441. "description": "Get the status of all Model Context Protocol (MCP) servers.",
  2442. "summary": "Get MCP status",
  2443. "x-codeSamples": [
  2444. {
  2445. "lang": "js",
  2446. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.status({\n ...\n})"
  2447. }
  2448. ]
  2449. },
  2450. "post": {
  2451. "tags": ["mcp"],
  2452. "operationId": "mcp.add",
  2453. "parameters": [
  2454. {
  2455. "name": "directory",
  2456. "in": "query",
  2457. "required": false,
  2458. "schema": {
  2459. "type": "string"
  2460. }
  2461. },
  2462. {
  2463. "name": "workspace",
  2464. "in": "query",
  2465. "required": false,
  2466. "schema": {
  2467. "type": "string"
  2468. }
  2469. }
  2470. ],
  2471. "responses": {
  2472. "200": {
  2473. "description": "MCP server added successfully",
  2474. "content": {
  2475. "application/json": {
  2476. "schema": {
  2477. "type": "object",
  2478. "additionalProperties": {
  2479. "$ref": "#/components/schemas/MCPStatus"
  2480. },
  2481. "description": "MCP server added successfully"
  2482. }
  2483. }
  2484. }
  2485. },
  2486. "400": {
  2487. "description": "Bad request",
  2488. "content": {
  2489. "application/json": {
  2490. "schema": {
  2491. "$ref": "#/components/schemas/BadRequestError"
  2492. }
  2493. }
  2494. }
  2495. }
  2496. },
  2497. "description": "Dynamically add a new Model Context Protocol (MCP) server to the system.",
  2498. "summary": "Add MCP server",
  2499. "requestBody": {
  2500. "content": {
  2501. "application/json": {
  2502. "schema": {
  2503. "type": "object",
  2504. "properties": {
  2505. "name": {
  2506. "type": "string"
  2507. },
  2508. "config": {
  2509. "anyOf": [
  2510. {
  2511. "$ref": "#/components/schemas/McpLocalConfig"
  2512. },
  2513. {
  2514. "$ref": "#/components/schemas/McpRemoteConfig"
  2515. }
  2516. ]
  2517. }
  2518. },
  2519. "required": ["name", "config"],
  2520. "additionalProperties": false
  2521. }
  2522. }
  2523. }
  2524. },
  2525. "x-codeSamples": [
  2526. {
  2527. "lang": "js",
  2528. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.add({\n ...\n})"
  2529. }
  2530. ]
  2531. }
  2532. },
  2533. "/mcp/{name}/auth": {
  2534. "post": {
  2535. "tags": ["mcp"],
  2536. "operationId": "mcp.auth.start",
  2537. "parameters": [
  2538. {
  2539. "name": "directory",
  2540. "in": "query",
  2541. "required": false,
  2542. "schema": {
  2543. "type": "string"
  2544. }
  2545. },
  2546. {
  2547. "name": "workspace",
  2548. "in": "query",
  2549. "required": false,
  2550. "schema": {
  2551. "type": "string"
  2552. }
  2553. },
  2554. {
  2555. "name": "name",
  2556. "in": "path",
  2557. "schema": {
  2558. "type": "string"
  2559. },
  2560. "required": true
  2561. }
  2562. ],
  2563. "responses": {
  2564. "200": {
  2565. "description": "OAuth flow started",
  2566. "content": {
  2567. "application/json": {
  2568. "schema": {
  2569. "type": "object",
  2570. "properties": {
  2571. "authorizationUrl": {
  2572. "type": "string"
  2573. },
  2574. "oauthState": {
  2575. "type": "string"
  2576. }
  2577. },
  2578. "required": ["authorizationUrl", "oauthState"],
  2579. "additionalProperties": false,
  2580. "description": "OAuth flow started"
  2581. }
  2582. }
  2583. }
  2584. },
  2585. "400": {
  2586. "description": "McpUnsupportedOAuthError",
  2587. "content": {
  2588. "application/json": {
  2589. "schema": {
  2590. "$ref": "#/components/schemas/McpUnsupportedOAuthError"
  2591. }
  2592. }
  2593. }
  2594. },
  2595. "404": {
  2596. "description": "Not found",
  2597. "content": {
  2598. "application/json": {
  2599. "schema": {
  2600. "$ref": "#/components/schemas/NotFoundError"
  2601. }
  2602. }
  2603. }
  2604. }
  2605. },
  2606. "description": "Start OAuth authentication flow for a Model Context Protocol (MCP) server.",
  2607. "summary": "Start MCP OAuth",
  2608. "x-codeSamples": [
  2609. {
  2610. "lang": "js",
  2611. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.start({\n ...\n})"
  2612. }
  2613. ]
  2614. },
  2615. "delete": {
  2616. "tags": ["mcp"],
  2617. "operationId": "mcp.auth.remove",
  2618. "parameters": [
  2619. {
  2620. "name": "directory",
  2621. "in": "query",
  2622. "required": false,
  2623. "schema": {
  2624. "type": "string"
  2625. }
  2626. },
  2627. {
  2628. "name": "workspace",
  2629. "in": "query",
  2630. "required": false,
  2631. "schema": {
  2632. "type": "string"
  2633. }
  2634. },
  2635. {
  2636. "name": "name",
  2637. "in": "path",
  2638. "schema": {
  2639. "type": "string"
  2640. },
  2641. "required": true
  2642. }
  2643. ],
  2644. "responses": {
  2645. "200": {
  2646. "description": "OAuth credentials removed",
  2647. "content": {
  2648. "application/json": {
  2649. "schema": {
  2650. "type": "object",
  2651. "properties": {
  2652. "success": {
  2653. "type": "boolean",
  2654. "enum": [true]
  2655. }
  2656. },
  2657. "required": ["success"],
  2658. "additionalProperties": false,
  2659. "description": "OAuth credentials removed"
  2660. }
  2661. }
  2662. }
  2663. },
  2664. "404": {
  2665. "description": "Not found",
  2666. "content": {
  2667. "application/json": {
  2668. "schema": {
  2669. "$ref": "#/components/schemas/NotFoundError"
  2670. }
  2671. }
  2672. }
  2673. }
  2674. },
  2675. "description": "Remove OAuth credentials for an MCP server.",
  2676. "summary": "Remove MCP OAuth",
  2677. "x-codeSamples": [
  2678. {
  2679. "lang": "js",
  2680. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.remove({\n ...\n})"
  2681. }
  2682. ]
  2683. }
  2684. },
  2685. "/mcp/{name}/auth/callback": {
  2686. "post": {
  2687. "tags": ["mcp"],
  2688. "operationId": "mcp.auth.callback",
  2689. "parameters": [
  2690. {
  2691. "name": "directory",
  2692. "in": "query",
  2693. "required": false,
  2694. "schema": {
  2695. "type": "string"
  2696. }
  2697. },
  2698. {
  2699. "name": "workspace",
  2700. "in": "query",
  2701. "required": false,
  2702. "schema": {
  2703. "type": "string"
  2704. }
  2705. },
  2706. {
  2707. "name": "name",
  2708. "in": "path",
  2709. "schema": {
  2710. "type": "string"
  2711. },
  2712. "required": true
  2713. }
  2714. ],
  2715. "responses": {
  2716. "200": {
  2717. "description": "OAuth authentication completed",
  2718. "content": {
  2719. "application/json": {
  2720. "schema": {
  2721. "$ref": "#/components/schemas/MCPStatus"
  2722. }
  2723. }
  2724. }
  2725. },
  2726. "400": {
  2727. "description": "Bad request",
  2728. "content": {
  2729. "application/json": {
  2730. "schema": {
  2731. "$ref": "#/components/schemas/BadRequestError"
  2732. }
  2733. }
  2734. }
  2735. },
  2736. "404": {
  2737. "description": "Not found",
  2738. "content": {
  2739. "application/json": {
  2740. "schema": {
  2741. "$ref": "#/components/schemas/NotFoundError"
  2742. }
  2743. }
  2744. }
  2745. }
  2746. },
  2747. "description": "Complete OAuth authentication for a Model Context Protocol (MCP) server using the authorization code.",
  2748. "summary": "Complete MCP OAuth",
  2749. "requestBody": {
  2750. "content": {
  2751. "application/json": {
  2752. "schema": {
  2753. "type": "object",
  2754. "properties": {
  2755. "code": {
  2756. "type": "string"
  2757. }
  2758. },
  2759. "required": ["code"],
  2760. "additionalProperties": false
  2761. }
  2762. }
  2763. }
  2764. },
  2765. "x-codeSamples": [
  2766. {
  2767. "lang": "js",
  2768. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.callback({\n ...\n})"
  2769. }
  2770. ]
  2771. }
  2772. },
  2773. "/mcp/{name}/auth/authenticate": {
  2774. "post": {
  2775. "tags": ["mcp"],
  2776. "operationId": "mcp.auth.authenticate",
  2777. "parameters": [
  2778. {
  2779. "name": "directory",
  2780. "in": "query",
  2781. "required": false,
  2782. "schema": {
  2783. "type": "string"
  2784. }
  2785. },
  2786. {
  2787. "name": "workspace",
  2788. "in": "query",
  2789. "required": false,
  2790. "schema": {
  2791. "type": "string"
  2792. }
  2793. },
  2794. {
  2795. "name": "name",
  2796. "in": "path",
  2797. "schema": {
  2798. "type": "string"
  2799. },
  2800. "required": true
  2801. }
  2802. ],
  2803. "responses": {
  2804. "200": {
  2805. "description": "OAuth authentication completed",
  2806. "content": {
  2807. "application/json": {
  2808. "schema": {
  2809. "$ref": "#/components/schemas/MCPStatus"
  2810. }
  2811. }
  2812. }
  2813. },
  2814. "400": {
  2815. "description": "McpUnsupportedOAuthError",
  2816. "content": {
  2817. "application/json": {
  2818. "schema": {
  2819. "$ref": "#/components/schemas/McpUnsupportedOAuthError"
  2820. }
  2821. }
  2822. }
  2823. },
  2824. "404": {
  2825. "description": "Not found",
  2826. "content": {
  2827. "application/json": {
  2828. "schema": {
  2829. "$ref": "#/components/schemas/NotFoundError"
  2830. }
  2831. }
  2832. }
  2833. }
  2834. },
  2835. "description": "Start OAuth flow and wait for callback (opens browser).",
  2836. "summary": "Authenticate MCP OAuth",
  2837. "x-codeSamples": [
  2838. {
  2839. "lang": "js",
  2840. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.authenticate({\n ...\n})"
  2841. }
  2842. ]
  2843. }
  2844. },
  2845. "/mcp/{name}/connect": {
  2846. "post": {
  2847. "tags": ["mcp"],
  2848. "operationId": "mcp.connect",
  2849. "parameters": [
  2850. {
  2851. "name": "directory",
  2852. "in": "query",
  2853. "required": false,
  2854. "schema": {
  2855. "type": "string"
  2856. }
  2857. },
  2858. {
  2859. "name": "workspace",
  2860. "in": "query",
  2861. "required": false,
  2862. "schema": {
  2863. "type": "string"
  2864. }
  2865. },
  2866. {
  2867. "name": "name",
  2868. "in": "path",
  2869. "schema": {
  2870. "type": "string"
  2871. },
  2872. "required": true
  2873. }
  2874. ],
  2875. "responses": {
  2876. "200": {
  2877. "description": "MCP server connected successfully",
  2878. "content": {
  2879. "application/json": {
  2880. "schema": {
  2881. "type": "boolean",
  2882. "description": "MCP server connected successfully"
  2883. }
  2884. }
  2885. }
  2886. }
  2887. },
  2888. "description": "Connect an MCP server.",
  2889. "x-codeSamples": [
  2890. {
  2891. "lang": "js",
  2892. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.connect({\n ...\n})"
  2893. }
  2894. ]
  2895. }
  2896. },
  2897. "/mcp/{name}/disconnect": {
  2898. "post": {
  2899. "tags": ["mcp"],
  2900. "operationId": "mcp.disconnect",
  2901. "parameters": [
  2902. {
  2903. "name": "directory",
  2904. "in": "query",
  2905. "required": false,
  2906. "schema": {
  2907. "type": "string"
  2908. }
  2909. },
  2910. {
  2911. "name": "workspace",
  2912. "in": "query",
  2913. "required": false,
  2914. "schema": {
  2915. "type": "string"
  2916. }
  2917. },
  2918. {
  2919. "name": "name",
  2920. "in": "path",
  2921. "schema": {
  2922. "type": "string"
  2923. },
  2924. "required": true
  2925. }
  2926. ],
  2927. "responses": {
  2928. "200": {
  2929. "description": "MCP server disconnected successfully",
  2930. "content": {
  2931. "application/json": {
  2932. "schema": {
  2933. "type": "boolean",
  2934. "description": "MCP server disconnected successfully"
  2935. }
  2936. }
  2937. }
  2938. }
  2939. },
  2940. "description": "Disconnect an MCP server.",
  2941. "x-codeSamples": [
  2942. {
  2943. "lang": "js",
  2944. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.disconnect({\n ...\n})"
  2945. }
  2946. ]
  2947. }
  2948. },
  2949. "/project": {
  2950. "get": {
  2951. "tags": ["project"],
  2952. "operationId": "project.list",
  2953. "parameters": [
  2954. {
  2955. "name": "directory",
  2956. "in": "query",
  2957. "required": false,
  2958. "schema": {
  2959. "type": "string"
  2960. }
  2961. },
  2962. {
  2963. "name": "workspace",
  2964. "in": "query",
  2965. "required": false,
  2966. "schema": {
  2967. "type": "string"
  2968. }
  2969. }
  2970. ],
  2971. "responses": {
  2972. "200": {
  2973. "description": "List of projects",
  2974. "content": {
  2975. "application/json": {
  2976. "schema": {
  2977. "type": "array",
  2978. "items": {
  2979. "$ref": "#/components/schemas/Project"
  2980. },
  2981. "description": "List of projects"
  2982. }
  2983. }
  2984. }
  2985. }
  2986. },
  2987. "description": "Get a list of projects that have been opened with OpenCode.",
  2988. "summary": "List all projects",
  2989. "x-codeSamples": [
  2990. {
  2991. "lang": "js",
  2992. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.list({\n ...\n})"
  2993. }
  2994. ]
  2995. }
  2996. },
  2997. "/project/current": {
  2998. "get": {
  2999. "tags": ["project"],
  3000. "operationId": "project.current",
  3001. "parameters": [
  3002. {
  3003. "name": "directory",
  3004. "in": "query",
  3005. "required": false,
  3006. "schema": {
  3007. "type": "string"
  3008. }
  3009. },
  3010. {
  3011. "name": "workspace",
  3012. "in": "query",
  3013. "required": false,
  3014. "schema": {
  3015. "type": "string"
  3016. }
  3017. }
  3018. ],
  3019. "responses": {
  3020. "200": {
  3021. "description": "Current project information",
  3022. "content": {
  3023. "application/json": {
  3024. "schema": {
  3025. "$ref": "#/components/schemas/Project"
  3026. }
  3027. }
  3028. }
  3029. }
  3030. },
  3031. "description": "Retrieve the currently active project that OpenCode is working with.",
  3032. "summary": "Get current project",
  3033. "x-codeSamples": [
  3034. {
  3035. "lang": "js",
  3036. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.current({\n ...\n})"
  3037. }
  3038. ]
  3039. }
  3040. },
  3041. "/project/git/init": {
  3042. "post": {
  3043. "tags": ["project"],
  3044. "operationId": "project.initGit",
  3045. "parameters": [
  3046. {
  3047. "name": "directory",
  3048. "in": "query",
  3049. "required": false,
  3050. "schema": {
  3051. "type": "string"
  3052. }
  3053. },
  3054. {
  3055. "name": "workspace",
  3056. "in": "query",
  3057. "required": false,
  3058. "schema": {
  3059. "type": "string"
  3060. }
  3061. }
  3062. ],
  3063. "responses": {
  3064. "200": {
  3065. "description": "Project information after git initialization",
  3066. "content": {
  3067. "application/json": {
  3068. "schema": {
  3069. "$ref": "#/components/schemas/Project"
  3070. }
  3071. }
  3072. }
  3073. }
  3074. },
  3075. "description": "Create a git repository for the current project and return the refreshed project info.",
  3076. "summary": "Initialize git repository",
  3077. "x-codeSamples": [
  3078. {
  3079. "lang": "js",
  3080. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.initGit({\n ...\n})"
  3081. }
  3082. ]
  3083. }
  3084. },
  3085. "/project/{projectID}": {
  3086. "patch": {
  3087. "tags": ["project"],
  3088. "operationId": "project.update",
  3089. "parameters": [
  3090. {
  3091. "name": "directory",
  3092. "in": "query",
  3093. "required": false,
  3094. "schema": {
  3095. "type": "string"
  3096. }
  3097. },
  3098. {
  3099. "name": "workspace",
  3100. "in": "query",
  3101. "required": false,
  3102. "schema": {
  3103. "type": "string"
  3104. }
  3105. },
  3106. {
  3107. "name": "projectID",
  3108. "in": "path",
  3109. "schema": {
  3110. "type": "string"
  3111. },
  3112. "required": true
  3113. }
  3114. ],
  3115. "responses": {
  3116. "200": {
  3117. "description": "Updated project information",
  3118. "content": {
  3119. "application/json": {
  3120. "schema": {
  3121. "$ref": "#/components/schemas/Project"
  3122. }
  3123. }
  3124. }
  3125. },
  3126. "400": {
  3127. "description": "Bad request",
  3128. "content": {
  3129. "application/json": {
  3130. "schema": {
  3131. "$ref": "#/components/schemas/BadRequestError"
  3132. }
  3133. }
  3134. }
  3135. },
  3136. "404": {
  3137. "description": "Not found",
  3138. "content": {
  3139. "application/json": {
  3140. "schema": {
  3141. "$ref": "#/components/schemas/NotFoundError"
  3142. }
  3143. }
  3144. }
  3145. }
  3146. },
  3147. "description": "Update project properties such as name, icon, and commands.",
  3148. "summary": "Update project",
  3149. "requestBody": {
  3150. "content": {
  3151. "application/json": {
  3152. "schema": {
  3153. "type": "object",
  3154. "properties": {
  3155. "name": {
  3156. "type": "string"
  3157. },
  3158. "icon": {
  3159. "type": "object",
  3160. "properties": {
  3161. "url": {
  3162. "type": "string"
  3163. },
  3164. "override": {
  3165. "type": "string"
  3166. },
  3167. "color": {
  3168. "type": "string"
  3169. }
  3170. },
  3171. "additionalProperties": false
  3172. },
  3173. "commands": {
  3174. "type": "object",
  3175. "properties": {
  3176. "start": {
  3177. "type": "string",
  3178. "description": "Startup script to run when creating a new workspace (worktree)"
  3179. }
  3180. },
  3181. "additionalProperties": false
  3182. }
  3183. },
  3184. "additionalProperties": false
  3185. }
  3186. }
  3187. }
  3188. },
  3189. "x-codeSamples": [
  3190. {
  3191. "lang": "js",
  3192. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.update({\n ...\n})"
  3193. }
  3194. ]
  3195. }
  3196. },
  3197. "/pty/shells": {
  3198. "get": {
  3199. "tags": ["pty"],
  3200. "operationId": "pty.shells",
  3201. "parameters": [
  3202. {
  3203. "name": "directory",
  3204. "in": "query",
  3205. "required": false,
  3206. "schema": {
  3207. "type": "string"
  3208. }
  3209. },
  3210. {
  3211. "name": "workspace",
  3212. "in": "query",
  3213. "required": false,
  3214. "schema": {
  3215. "type": "string"
  3216. }
  3217. }
  3218. ],
  3219. "responses": {
  3220. "200": {
  3221. "description": "List of shells",
  3222. "content": {
  3223. "application/json": {
  3224. "schema": {
  3225. "type": "array",
  3226. "items": {
  3227. "type": "object",
  3228. "properties": {
  3229. "path": {
  3230. "type": "string"
  3231. },
  3232. "name": {
  3233. "type": "string"
  3234. },
  3235. "acceptable": {
  3236. "type": "boolean"
  3237. }
  3238. },
  3239. "required": ["path", "name", "acceptable"],
  3240. "additionalProperties": false
  3241. },
  3242. "description": "List of shells"
  3243. }
  3244. }
  3245. }
  3246. }
  3247. },
  3248. "description": "Get a list of available shells on the system.",
  3249. "summary": "List available shells",
  3250. "x-codeSamples": [
  3251. {
  3252. "lang": "js",
  3253. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.shells({\n ...\n})"
  3254. }
  3255. ]
  3256. }
  3257. },
  3258. "/pty": {
  3259. "get": {
  3260. "tags": ["pty"],
  3261. "operationId": "pty.list",
  3262. "parameters": [
  3263. {
  3264. "name": "directory",
  3265. "in": "query",
  3266. "required": false,
  3267. "schema": {
  3268. "type": "string"
  3269. }
  3270. },
  3271. {
  3272. "name": "workspace",
  3273. "in": "query",
  3274. "required": false,
  3275. "schema": {
  3276. "type": "string"
  3277. }
  3278. }
  3279. ],
  3280. "responses": {
  3281. "200": {
  3282. "description": "List of sessions",
  3283. "content": {
  3284. "application/json": {
  3285. "schema": {
  3286. "type": "array",
  3287. "items": {
  3288. "$ref": "#/components/schemas/Pty"
  3289. },
  3290. "description": "List of sessions"
  3291. }
  3292. }
  3293. }
  3294. }
  3295. },
  3296. "description": "Get a list of all active pseudo-terminal (PTY) sessions managed by OpenCode.",
  3297. "summary": "List PTY sessions",
  3298. "x-codeSamples": [
  3299. {
  3300. "lang": "js",
  3301. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.list({\n ...\n})"
  3302. }
  3303. ]
  3304. },
  3305. "post": {
  3306. "tags": ["pty"],
  3307. "operationId": "pty.create",
  3308. "parameters": [
  3309. {
  3310. "name": "directory",
  3311. "in": "query",
  3312. "required": false,
  3313. "schema": {
  3314. "type": "string"
  3315. }
  3316. },
  3317. {
  3318. "name": "workspace",
  3319. "in": "query",
  3320. "required": false,
  3321. "schema": {
  3322. "type": "string"
  3323. }
  3324. }
  3325. ],
  3326. "responses": {
  3327. "200": {
  3328. "description": "Created session",
  3329. "content": {
  3330. "application/json": {
  3331. "schema": {
  3332. "$ref": "#/components/schemas/Pty"
  3333. }
  3334. }
  3335. }
  3336. },
  3337. "400": {
  3338. "description": "Bad request",
  3339. "content": {
  3340. "application/json": {
  3341. "schema": {
  3342. "$ref": "#/components/schemas/BadRequestError"
  3343. }
  3344. }
  3345. }
  3346. }
  3347. },
  3348. "description": "Create a new pseudo-terminal (PTY) session for running shell commands and processes.",
  3349. "summary": "Create PTY session",
  3350. "requestBody": {
  3351. "content": {
  3352. "application/json": {
  3353. "schema": {
  3354. "type": "object",
  3355. "properties": {
  3356. "command": {
  3357. "type": "string"
  3358. },
  3359. "args": {
  3360. "type": "array",
  3361. "items": {
  3362. "type": "string"
  3363. }
  3364. },
  3365. "cwd": {
  3366. "type": "string"
  3367. },
  3368. "title": {
  3369. "type": "string"
  3370. },
  3371. "env": {
  3372. "type": "object",
  3373. "additionalProperties": {
  3374. "type": "string"
  3375. }
  3376. }
  3377. },
  3378. "additionalProperties": false
  3379. }
  3380. }
  3381. }
  3382. },
  3383. "x-codeSamples": [
  3384. {
  3385. "lang": "js",
  3386. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.create({\n ...\n})"
  3387. }
  3388. ]
  3389. }
  3390. },
  3391. "/pty/{ptyID}": {
  3392. "get": {
  3393. "tags": ["pty"],
  3394. "operationId": "pty.get",
  3395. "parameters": [
  3396. {
  3397. "name": "directory",
  3398. "in": "query",
  3399. "required": false,
  3400. "schema": {
  3401. "type": "string"
  3402. }
  3403. },
  3404. {
  3405. "name": "workspace",
  3406. "in": "query",
  3407. "required": false,
  3408. "schema": {
  3409. "type": "string"
  3410. }
  3411. },
  3412. {
  3413. "name": "ptyID",
  3414. "in": "path",
  3415. "schema": {
  3416. "type": "string",
  3417. "pattern": "^pty.*"
  3418. },
  3419. "required": true
  3420. }
  3421. ],
  3422. "responses": {
  3423. "200": {
  3424. "description": "Session info",
  3425. "content": {
  3426. "application/json": {
  3427. "schema": {
  3428. "$ref": "#/components/schemas/Pty"
  3429. }
  3430. }
  3431. }
  3432. },
  3433. "404": {
  3434. "description": "NotFoundError",
  3435. "content": {
  3436. "application/json": {
  3437. "schema": {
  3438. "$ref": "#/components/schemas/NotFoundError"
  3439. }
  3440. }
  3441. }
  3442. }
  3443. },
  3444. "description": "Retrieve detailed information about a specific pseudo-terminal (PTY) session.",
  3445. "summary": "Get PTY session",
  3446. "x-codeSamples": [
  3447. {
  3448. "lang": "js",
  3449. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.get({\n ...\n})"
  3450. }
  3451. ]
  3452. },
  3453. "put": {
  3454. "tags": ["pty"],
  3455. "operationId": "pty.update",
  3456. "parameters": [
  3457. {
  3458. "name": "directory",
  3459. "in": "query",
  3460. "required": false,
  3461. "schema": {
  3462. "type": "string"
  3463. }
  3464. },
  3465. {
  3466. "name": "workspace",
  3467. "in": "query",
  3468. "required": false,
  3469. "schema": {
  3470. "type": "string"
  3471. }
  3472. },
  3473. {
  3474. "name": "ptyID",
  3475. "in": "path",
  3476. "schema": {
  3477. "type": "string",
  3478. "pattern": "^pty.*"
  3479. },
  3480. "required": true
  3481. }
  3482. ],
  3483. "responses": {
  3484. "200": {
  3485. "description": "Updated session",
  3486. "content": {
  3487. "application/json": {
  3488. "schema": {
  3489. "$ref": "#/components/schemas/Pty"
  3490. }
  3491. }
  3492. }
  3493. },
  3494. "400": {
  3495. "description": "Bad request",
  3496. "content": {
  3497. "application/json": {
  3498. "schema": {
  3499. "$ref": "#/components/schemas/BadRequestError"
  3500. }
  3501. }
  3502. }
  3503. }
  3504. },
  3505. "description": "Update properties of an existing pseudo-terminal (PTY) session.",
  3506. "summary": "Update PTY session",
  3507. "requestBody": {
  3508. "content": {
  3509. "application/json": {
  3510. "schema": {
  3511. "type": "object",
  3512. "properties": {
  3513. "title": {
  3514. "type": "string"
  3515. },
  3516. "size": {
  3517. "type": "object",
  3518. "properties": {
  3519. "rows": {
  3520. "type": "integer",
  3521. "exclusiveMinimum": 0
  3522. },
  3523. "cols": {
  3524. "type": "integer",
  3525. "exclusiveMinimum": 0
  3526. }
  3527. },
  3528. "required": ["rows", "cols"],
  3529. "additionalProperties": false
  3530. }
  3531. },
  3532. "additionalProperties": false
  3533. }
  3534. }
  3535. }
  3536. },
  3537. "x-codeSamples": [
  3538. {
  3539. "lang": "js",
  3540. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.update({\n ...\n})"
  3541. }
  3542. ]
  3543. },
  3544. "delete": {
  3545. "tags": ["pty"],
  3546. "operationId": "pty.remove",
  3547. "parameters": [
  3548. {
  3549. "name": "directory",
  3550. "in": "query",
  3551. "required": false,
  3552. "schema": {
  3553. "type": "string"
  3554. }
  3555. },
  3556. {
  3557. "name": "workspace",
  3558. "in": "query",
  3559. "required": false,
  3560. "schema": {
  3561. "type": "string"
  3562. }
  3563. },
  3564. {
  3565. "name": "ptyID",
  3566. "in": "path",
  3567. "schema": {
  3568. "type": "string",
  3569. "pattern": "^pty.*"
  3570. },
  3571. "required": true
  3572. }
  3573. ],
  3574. "responses": {
  3575. "200": {
  3576. "description": "Session removed",
  3577. "content": {
  3578. "application/json": {
  3579. "schema": {
  3580. "type": "boolean",
  3581. "description": "Session removed"
  3582. }
  3583. }
  3584. }
  3585. },
  3586. "404": {
  3587. "description": "NotFoundError",
  3588. "content": {
  3589. "application/json": {
  3590. "schema": {
  3591. "$ref": "#/components/schemas/NotFoundError"
  3592. }
  3593. }
  3594. }
  3595. }
  3596. },
  3597. "description": "Remove and terminate a specific pseudo-terminal (PTY) session.",
  3598. "summary": "Remove PTY session",
  3599. "x-codeSamples": [
  3600. {
  3601. "lang": "js",
  3602. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.remove({\n ...\n})"
  3603. }
  3604. ]
  3605. }
  3606. },
  3607. "/pty/{ptyID}/connect-token": {
  3608. "post": {
  3609. "tags": ["pty"],
  3610. "operationId": "pty.connectToken",
  3611. "parameters": [
  3612. {
  3613. "name": "directory",
  3614. "in": "query",
  3615. "required": false,
  3616. "schema": {
  3617. "type": "string"
  3618. }
  3619. },
  3620. {
  3621. "name": "workspace",
  3622. "in": "query",
  3623. "required": false,
  3624. "schema": {
  3625. "type": "string"
  3626. }
  3627. },
  3628. {
  3629. "name": "ptyID",
  3630. "in": "path",
  3631. "schema": {
  3632. "type": "string",
  3633. "pattern": "^pty.*"
  3634. },
  3635. "required": true
  3636. }
  3637. ],
  3638. "responses": {
  3639. "200": {
  3640. "description": "WebSocket connect token",
  3641. "content": {
  3642. "application/json": {
  3643. "schema": {
  3644. "type": "object",
  3645. "properties": {
  3646. "ticket": {
  3647. "type": "string"
  3648. },
  3649. "expires_in": {
  3650. "type": "integer",
  3651. "exclusiveMinimum": 0
  3652. }
  3653. },
  3654. "required": ["ticket", "expires_in"],
  3655. "additionalProperties": false,
  3656. "description": "WebSocket connect token"
  3657. }
  3658. }
  3659. }
  3660. },
  3661. "403": {
  3662. "description": "Forbidden",
  3663. "content": {
  3664. "application/json": {
  3665. "schema": {
  3666. "$ref": "#/components/schemas/effect_HttpApiError_Forbidden"
  3667. }
  3668. }
  3669. }
  3670. },
  3671. "404": {
  3672. "description": "NotFoundError",
  3673. "content": {
  3674. "application/json": {
  3675. "schema": {
  3676. "$ref": "#/components/schemas/NotFoundError"
  3677. }
  3678. }
  3679. }
  3680. }
  3681. },
  3682. "description": "Create a short-lived ticket for opening a PTY WebSocket connection.",
  3683. "summary": "Create PTY WebSocket token",
  3684. "x-codeSamples": [
  3685. {
  3686. "lang": "js",
  3687. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.connectToken({\n ...\n})"
  3688. }
  3689. ]
  3690. }
  3691. },
  3692. "/question": {
  3693. "get": {
  3694. "tags": ["question"],
  3695. "operationId": "question.list",
  3696. "parameters": [
  3697. {
  3698. "name": "directory",
  3699. "in": "query",
  3700. "required": false,
  3701. "schema": {
  3702. "type": "string"
  3703. }
  3704. },
  3705. {
  3706. "name": "workspace",
  3707. "in": "query",
  3708. "required": false,
  3709. "schema": {
  3710. "type": "string"
  3711. }
  3712. }
  3713. ],
  3714. "responses": {
  3715. "200": {
  3716. "description": "List of pending questions",
  3717. "content": {
  3718. "application/json": {
  3719. "schema": {
  3720. "type": "array",
  3721. "items": {
  3722. "$ref": "#/components/schemas/QuestionRequest"
  3723. },
  3724. "description": "List of pending questions"
  3725. }
  3726. }
  3727. }
  3728. }
  3729. },
  3730. "description": "Get all pending question requests across all sessions.",
  3731. "summary": "List pending questions",
  3732. "x-codeSamples": [
  3733. {
  3734. "lang": "js",
  3735. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.question.list({\n ...\n})"
  3736. }
  3737. ]
  3738. }
  3739. },
  3740. "/question/{requestID}/reply": {
  3741. "post": {
  3742. "tags": ["question"],
  3743. "operationId": "question.reply",
  3744. "parameters": [
  3745. {
  3746. "name": "directory",
  3747. "in": "query",
  3748. "required": false,
  3749. "schema": {
  3750. "type": "string"
  3751. }
  3752. },
  3753. {
  3754. "name": "workspace",
  3755. "in": "query",
  3756. "required": false,
  3757. "schema": {
  3758. "type": "string"
  3759. }
  3760. },
  3761. {
  3762. "name": "requestID",
  3763. "in": "path",
  3764. "schema": {
  3765. "type": "string",
  3766. "pattern": "^que.*"
  3767. },
  3768. "required": true
  3769. }
  3770. ],
  3771. "responses": {
  3772. "200": {
  3773. "description": "Question answered successfully",
  3774. "content": {
  3775. "application/json": {
  3776. "schema": {
  3777. "type": "boolean",
  3778. "description": "Question answered successfully"
  3779. }
  3780. }
  3781. }
  3782. },
  3783. "400": {
  3784. "description": "Bad request",
  3785. "content": {
  3786. "application/json": {
  3787. "schema": {
  3788. "$ref": "#/components/schemas/BadRequestError"
  3789. }
  3790. }
  3791. }
  3792. },
  3793. "404": {
  3794. "description": "Not found",
  3795. "content": {
  3796. "application/json": {
  3797. "schema": {
  3798. "$ref": "#/components/schemas/NotFoundError"
  3799. }
  3800. }
  3801. }
  3802. }
  3803. },
  3804. "description": "Provide answers to a question request from the AI assistant.",
  3805. "summary": "Reply to question request",
  3806. "requestBody": {
  3807. "content": {
  3808. "application/json": {
  3809. "schema": {
  3810. "type": "object",
  3811. "properties": {
  3812. "answers": {
  3813. "type": "array",
  3814. "items": {
  3815. "$ref": "#/components/schemas/QuestionAnswer"
  3816. },
  3817. "description": "User answers in order of questions (each answer is an array of selected labels)"
  3818. }
  3819. },
  3820. "required": ["answers"],
  3821. "additionalProperties": false
  3822. }
  3823. }
  3824. }
  3825. },
  3826. "x-codeSamples": [
  3827. {
  3828. "lang": "js",
  3829. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.question.reply({\n ...\n})"
  3830. }
  3831. ]
  3832. }
  3833. },
  3834. "/question/{requestID}/reject": {
  3835. "post": {
  3836. "tags": ["question"],
  3837. "operationId": "question.reject",
  3838. "parameters": [
  3839. {
  3840. "name": "directory",
  3841. "in": "query",
  3842. "required": false,
  3843. "schema": {
  3844. "type": "string"
  3845. }
  3846. },
  3847. {
  3848. "name": "workspace",
  3849. "in": "query",
  3850. "required": false,
  3851. "schema": {
  3852. "type": "string"
  3853. }
  3854. },
  3855. {
  3856. "name": "requestID",
  3857. "in": "path",
  3858. "schema": {
  3859. "type": "string",
  3860. "pattern": "^que.*"
  3861. },
  3862. "required": true
  3863. }
  3864. ],
  3865. "responses": {
  3866. "200": {
  3867. "description": "Question rejected successfully",
  3868. "content": {
  3869. "application/json": {
  3870. "schema": {
  3871. "type": "boolean",
  3872. "description": "Question rejected successfully"
  3873. }
  3874. }
  3875. }
  3876. },
  3877. "400": {
  3878. "description": "Bad request",
  3879. "content": {
  3880. "application/json": {
  3881. "schema": {
  3882. "$ref": "#/components/schemas/BadRequestError"
  3883. }
  3884. }
  3885. }
  3886. },
  3887. "404": {
  3888. "description": "Not found",
  3889. "content": {
  3890. "application/json": {
  3891. "schema": {
  3892. "$ref": "#/components/schemas/NotFoundError"
  3893. }
  3894. }
  3895. }
  3896. }
  3897. },
  3898. "description": "Reject a question request from the AI assistant.",
  3899. "summary": "Reject question request",
  3900. "x-codeSamples": [
  3901. {
  3902. "lang": "js",
  3903. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.question.reject({\n ...\n})"
  3904. }
  3905. ]
  3906. }
  3907. },
  3908. "/permission": {
  3909. "get": {
  3910. "tags": ["permission"],
  3911. "operationId": "permission.list",
  3912. "parameters": [
  3913. {
  3914. "name": "directory",
  3915. "in": "query",
  3916. "required": false,
  3917. "schema": {
  3918. "type": "string"
  3919. }
  3920. },
  3921. {
  3922. "name": "workspace",
  3923. "in": "query",
  3924. "required": false,
  3925. "schema": {
  3926. "type": "string"
  3927. }
  3928. }
  3929. ],
  3930. "responses": {
  3931. "200": {
  3932. "description": "List of pending permissions",
  3933. "content": {
  3934. "application/json": {
  3935. "schema": {
  3936. "type": "array",
  3937. "items": {
  3938. "$ref": "#/components/schemas/PermissionRequest"
  3939. },
  3940. "description": "List of pending permissions"
  3941. }
  3942. }
  3943. }
  3944. }
  3945. },
  3946. "description": "Get all pending permission requests across all sessions.",
  3947. "summary": "List pending permissions",
  3948. "x-codeSamples": [
  3949. {
  3950. "lang": "js",
  3951. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.permission.list({\n ...\n})"
  3952. }
  3953. ]
  3954. }
  3955. },
  3956. "/permission/{requestID}/reply": {
  3957. "post": {
  3958. "tags": ["permission"],
  3959. "operationId": "permission.reply",
  3960. "parameters": [
  3961. {
  3962. "name": "directory",
  3963. "in": "query",
  3964. "required": false,
  3965. "schema": {
  3966. "type": "string"
  3967. }
  3968. },
  3969. {
  3970. "name": "workspace",
  3971. "in": "query",
  3972. "required": false,
  3973. "schema": {
  3974. "type": "string"
  3975. }
  3976. },
  3977. {
  3978. "name": "requestID",
  3979. "in": "path",
  3980. "schema": {
  3981. "type": "string",
  3982. "pattern": "^per.*"
  3983. },
  3984. "required": true
  3985. }
  3986. ],
  3987. "responses": {
  3988. "200": {
  3989. "description": "Permission processed successfully",
  3990. "content": {
  3991. "application/json": {
  3992. "schema": {
  3993. "type": "boolean",
  3994. "description": "Permission processed successfully"
  3995. }
  3996. }
  3997. }
  3998. },
  3999. "400": {
  4000. "description": "Bad request",
  4001. "content": {
  4002. "application/json": {
  4003. "schema": {
  4004. "$ref": "#/components/schemas/BadRequestError"
  4005. }
  4006. }
  4007. }
  4008. },
  4009. "404": {
  4010. "description": "Not found",
  4011. "content": {
  4012. "application/json": {
  4013. "schema": {
  4014. "$ref": "#/components/schemas/NotFoundError"
  4015. }
  4016. }
  4017. }
  4018. }
  4019. },
  4020. "description": "Approve or deny a permission request from the AI assistant.",
  4021. "summary": "Respond to permission request",
  4022. "requestBody": {
  4023. "content": {
  4024. "application/json": {
  4025. "schema": {
  4026. "type": "object",
  4027. "properties": {
  4028. "reply": {
  4029. "type": "string",
  4030. "enum": ["once", "always", "reject"]
  4031. },
  4032. "message": {
  4033. "type": "string"
  4034. }
  4035. },
  4036. "required": ["reply"],
  4037. "additionalProperties": false
  4038. }
  4039. }
  4040. }
  4041. },
  4042. "x-codeSamples": [
  4043. {
  4044. "lang": "js",
  4045. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.permission.reply({\n ...\n})"
  4046. }
  4047. ]
  4048. }
  4049. },
  4050. "/provider": {
  4051. "get": {
  4052. "tags": ["provider"],
  4053. "operationId": "provider.list",
  4054. "parameters": [
  4055. {
  4056. "name": "directory",
  4057. "in": "query",
  4058. "required": false,
  4059. "schema": {
  4060. "type": "string"
  4061. }
  4062. },
  4063. {
  4064. "name": "workspace",
  4065. "in": "query",
  4066. "required": false,
  4067. "schema": {
  4068. "type": "string"
  4069. }
  4070. }
  4071. ],
  4072. "responses": {
  4073. "200": {
  4074. "description": "List of providers",
  4075. "content": {
  4076. "application/json": {
  4077. "schema": {
  4078. "type": "object",
  4079. "properties": {
  4080. "all": {
  4081. "type": "array",
  4082. "items": {
  4083. "$ref": "#/components/schemas/Provider"
  4084. }
  4085. },
  4086. "default": {
  4087. "type": "object",
  4088. "additionalProperties": {
  4089. "type": "string"
  4090. }
  4091. },
  4092. "connected": {
  4093. "type": "array",
  4094. "items": {
  4095. "type": "string"
  4096. }
  4097. }
  4098. },
  4099. "required": ["all", "default", "connected"],
  4100. "additionalProperties": false,
  4101. "description": "List of providers"
  4102. }
  4103. }
  4104. }
  4105. }
  4106. },
  4107. "description": "Get a list of all available AI providers, including both available and connected ones.",
  4108. "summary": "List providers",
  4109. "x-codeSamples": [
  4110. {
  4111. "lang": "js",
  4112. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.list({\n ...\n})"
  4113. }
  4114. ]
  4115. }
  4116. },
  4117. "/provider/auth": {
  4118. "get": {
  4119. "tags": ["provider"],
  4120. "operationId": "provider.auth",
  4121. "parameters": [
  4122. {
  4123. "name": "directory",
  4124. "in": "query",
  4125. "required": false,
  4126. "schema": {
  4127. "type": "string"
  4128. }
  4129. },
  4130. {
  4131. "name": "workspace",
  4132. "in": "query",
  4133. "required": false,
  4134. "schema": {
  4135. "type": "string"
  4136. }
  4137. }
  4138. ],
  4139. "responses": {
  4140. "200": {
  4141. "description": "Provider auth methods",
  4142. "content": {
  4143. "application/json": {
  4144. "schema": {
  4145. "type": "object",
  4146. "additionalProperties": {
  4147. "type": "array",
  4148. "items": {
  4149. "$ref": "#/components/schemas/ProviderAuthMethod"
  4150. }
  4151. },
  4152. "description": "Provider auth methods"
  4153. }
  4154. }
  4155. }
  4156. }
  4157. },
  4158. "description": "Retrieve available authentication methods for all AI providers.",
  4159. "summary": "Get provider auth methods",
  4160. "x-codeSamples": [
  4161. {
  4162. "lang": "js",
  4163. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.auth({\n ...\n})"
  4164. }
  4165. ]
  4166. }
  4167. },
  4168. "/provider/{providerID}/oauth/authorize": {
  4169. "post": {
  4170. "tags": ["provider"],
  4171. "operationId": "provider.oauth.authorize",
  4172. "parameters": [
  4173. {
  4174. "name": "directory",
  4175. "in": "query",
  4176. "required": false,
  4177. "schema": {
  4178. "type": "string"
  4179. }
  4180. },
  4181. {
  4182. "name": "workspace",
  4183. "in": "query",
  4184. "required": false,
  4185. "schema": {
  4186. "type": "string"
  4187. }
  4188. },
  4189. {
  4190. "name": "providerID",
  4191. "in": "path",
  4192. "schema": {
  4193. "type": "string"
  4194. },
  4195. "required": true
  4196. }
  4197. ],
  4198. "responses": {
  4199. "200": {
  4200. "description": "Authorization URL and method",
  4201. "content": {
  4202. "application/json": {
  4203. "schema": {
  4204. "$ref": "#/components/schemas/ProviderAuthAuthorization"
  4205. }
  4206. }
  4207. }
  4208. },
  4209. "400": {
  4210. "description": "Bad request",
  4211. "content": {
  4212. "application/json": {
  4213. "schema": {
  4214. "$ref": "#/components/schemas/BadRequestError"
  4215. }
  4216. }
  4217. }
  4218. }
  4219. },
  4220. "description": "Start the OAuth authorization flow for a provider.",
  4221. "summary": "Start OAuth authorization",
  4222. "requestBody": {
  4223. "content": {
  4224. "application/json": {
  4225. "schema": {
  4226. "type": "object",
  4227. "properties": {
  4228. "method": {
  4229. "type": "number",
  4230. "description": "Auth method index"
  4231. },
  4232. "inputs": {
  4233. "type": "object",
  4234. "additionalProperties": {
  4235. "type": "string"
  4236. }
  4237. }
  4238. },
  4239. "required": ["method"],
  4240. "additionalProperties": false
  4241. }
  4242. }
  4243. }
  4244. },
  4245. "x-codeSamples": [
  4246. {
  4247. "lang": "js",
  4248. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.oauth.authorize({\n ...\n})"
  4249. }
  4250. ]
  4251. }
  4252. },
  4253. "/provider/{providerID}/oauth/callback": {
  4254. "post": {
  4255. "tags": ["provider"],
  4256. "operationId": "provider.oauth.callback",
  4257. "parameters": [
  4258. {
  4259. "name": "directory",
  4260. "in": "query",
  4261. "required": false,
  4262. "schema": {
  4263. "type": "string"
  4264. }
  4265. },
  4266. {
  4267. "name": "workspace",
  4268. "in": "query",
  4269. "required": false,
  4270. "schema": {
  4271. "type": "string"
  4272. }
  4273. },
  4274. {
  4275. "name": "providerID",
  4276. "in": "path",
  4277. "schema": {
  4278. "type": "string"
  4279. },
  4280. "required": true
  4281. }
  4282. ],
  4283. "responses": {
  4284. "200": {
  4285. "description": "OAuth callback processed successfully",
  4286. "content": {
  4287. "application/json": {
  4288. "schema": {
  4289. "type": "boolean",
  4290. "description": "OAuth callback processed successfully"
  4291. }
  4292. }
  4293. }
  4294. },
  4295. "400": {
  4296. "description": "Bad request",
  4297. "content": {
  4298. "application/json": {
  4299. "schema": {
  4300. "$ref": "#/components/schemas/BadRequestError"
  4301. }
  4302. }
  4303. }
  4304. }
  4305. },
  4306. "description": "Handle the OAuth callback from a provider after user authorization.",
  4307. "summary": "Handle OAuth callback",
  4308. "requestBody": {
  4309. "content": {
  4310. "application/json": {
  4311. "schema": {
  4312. "type": "object",
  4313. "properties": {
  4314. "method": {
  4315. "type": "number",
  4316. "description": "Auth method index"
  4317. },
  4318. "code": {
  4319. "type": "string"
  4320. }
  4321. },
  4322. "required": ["method"],
  4323. "additionalProperties": false
  4324. }
  4325. }
  4326. }
  4327. },
  4328. "x-codeSamples": [
  4329. {
  4330. "lang": "js",
  4331. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.oauth.callback({\n ...\n})"
  4332. }
  4333. ]
  4334. }
  4335. },
  4336. "/session": {
  4337. "get": {
  4338. "tags": ["session"],
  4339. "operationId": "session.list",
  4340. "parameters": [
  4341. {
  4342. "name": "directory",
  4343. "in": "query",
  4344. "required": false,
  4345. "schema": {
  4346. "type": "string"
  4347. }
  4348. },
  4349. {
  4350. "name": "workspace",
  4351. "in": "query",
  4352. "required": false,
  4353. "schema": {
  4354. "type": "string"
  4355. }
  4356. },
  4357. {
  4358. "name": "scope",
  4359. "in": "query",
  4360. "schema": {
  4361. "type": "string",
  4362. "enum": ["project"]
  4363. },
  4364. "required": false
  4365. },
  4366. {
  4367. "name": "path",
  4368. "in": "query",
  4369. "schema": {
  4370. "type": "string"
  4371. },
  4372. "required": false
  4373. },
  4374. {
  4375. "name": "roots",
  4376. "in": "query",
  4377. "schema": {
  4378. "anyOf": [
  4379. {
  4380. "type": "boolean"
  4381. },
  4382. {
  4383. "type": "string",
  4384. "enum": ["true", "false"]
  4385. }
  4386. ]
  4387. },
  4388. "required": false
  4389. },
  4390. {
  4391. "name": "start",
  4392. "in": "query",
  4393. "schema": {
  4394. "type": "number"
  4395. },
  4396. "required": false
  4397. },
  4398. {
  4399. "name": "search",
  4400. "in": "query",
  4401. "schema": {
  4402. "type": "string"
  4403. },
  4404. "required": false
  4405. },
  4406. {
  4407. "name": "limit",
  4408. "in": "query",
  4409. "schema": {
  4410. "type": "number"
  4411. },
  4412. "required": false
  4413. }
  4414. ],
  4415. "responses": {
  4416. "200": {
  4417. "description": "List of sessions",
  4418. "content": {
  4419. "application/json": {
  4420. "schema": {
  4421. "type": "array",
  4422. "items": {
  4423. "$ref": "#/components/schemas/Session"
  4424. },
  4425. "description": "List of sessions"
  4426. }
  4427. }
  4428. }
  4429. }
  4430. },
  4431. "description": "Get a list of all OpenCode sessions, sorted by most recently updated.",
  4432. "summary": "List sessions",
  4433. "x-codeSamples": [
  4434. {
  4435. "lang": "js",
  4436. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.list({\n ...\n})"
  4437. }
  4438. ]
  4439. },
  4440. "post": {
  4441. "tags": ["session"],
  4442. "operationId": "session.create",
  4443. "parameters": [
  4444. {
  4445. "name": "directory",
  4446. "in": "query",
  4447. "required": false,
  4448. "schema": {
  4449. "type": "string"
  4450. }
  4451. },
  4452. {
  4453. "name": "workspace",
  4454. "in": "query",
  4455. "required": false,
  4456. "schema": {
  4457. "type": "string"
  4458. }
  4459. }
  4460. ],
  4461. "responses": {
  4462. "200": {
  4463. "description": "Successfully created session",
  4464. "content": {
  4465. "application/json": {
  4466. "schema": {
  4467. "$ref": "#/components/schemas/Session"
  4468. }
  4469. }
  4470. }
  4471. },
  4472. "400": {
  4473. "description": "Bad request",
  4474. "content": {
  4475. "application/json": {
  4476. "schema": {
  4477. "$ref": "#/components/schemas/BadRequestError"
  4478. }
  4479. }
  4480. }
  4481. }
  4482. },
  4483. "description": "Create a new OpenCode session for interacting with AI assistants and managing conversations.",
  4484. "summary": "Create session",
  4485. "requestBody": {
  4486. "content": {
  4487. "application/json": {
  4488. "schema": {
  4489. "type": "object",
  4490. "properties": {
  4491. "parentID": {
  4492. "type": "string"
  4493. },
  4494. "title": {
  4495. "type": "string"
  4496. },
  4497. "agent": {
  4498. "type": "string"
  4499. },
  4500. "model": {
  4501. "type": "object",
  4502. "properties": {
  4503. "id": {
  4504. "type": "string"
  4505. },
  4506. "providerID": {
  4507. "type": "string"
  4508. },
  4509. "variant": {
  4510. "type": "string"
  4511. }
  4512. },
  4513. "required": ["id", "providerID"],
  4514. "additionalProperties": false
  4515. },
  4516. "permission": {
  4517. "$ref": "#/components/schemas/PermissionRuleset"
  4518. },
  4519. "workspaceID": {
  4520. "type": "string"
  4521. }
  4522. },
  4523. "additionalProperties": false
  4524. }
  4525. }
  4526. }
  4527. },
  4528. "x-codeSamples": [
  4529. {
  4530. "lang": "js",
  4531. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.create({\n ...\n})"
  4532. }
  4533. ]
  4534. }
  4535. },
  4536. "/session/status": {
  4537. "get": {
  4538. "tags": ["session"],
  4539. "operationId": "session.status",
  4540. "parameters": [
  4541. {
  4542. "name": "directory",
  4543. "in": "query",
  4544. "required": false,
  4545. "schema": {
  4546. "type": "string"
  4547. }
  4548. },
  4549. {
  4550. "name": "workspace",
  4551. "in": "query",
  4552. "required": false,
  4553. "schema": {
  4554. "type": "string"
  4555. }
  4556. }
  4557. ],
  4558. "responses": {
  4559. "200": {
  4560. "description": "Get session status",
  4561. "content": {
  4562. "application/json": {
  4563. "schema": {
  4564. "type": "object",
  4565. "additionalProperties": {
  4566. "$ref": "#/components/schemas/SessionStatus"
  4567. },
  4568. "description": "Get session status"
  4569. }
  4570. }
  4571. }
  4572. },
  4573. "400": {
  4574. "description": "Bad request",
  4575. "content": {
  4576. "application/json": {
  4577. "schema": {
  4578. "$ref": "#/components/schemas/BadRequestError"
  4579. }
  4580. }
  4581. }
  4582. }
  4583. },
  4584. "description": "Retrieve the current status of all sessions, including active, idle, and completed states.",
  4585. "summary": "Get session status",
  4586. "x-codeSamples": [
  4587. {
  4588. "lang": "js",
  4589. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.status({\n ...\n})"
  4590. }
  4591. ]
  4592. }
  4593. },
  4594. "/session/{sessionID}": {
  4595. "get": {
  4596. "tags": ["session"],
  4597. "operationId": "session.get",
  4598. "parameters": [
  4599. {
  4600. "name": "directory",
  4601. "in": "query",
  4602. "required": false,
  4603. "schema": {
  4604. "type": "string"
  4605. }
  4606. },
  4607. {
  4608. "name": "workspace",
  4609. "in": "query",
  4610. "required": false,
  4611. "schema": {
  4612. "type": "string"
  4613. }
  4614. },
  4615. {
  4616. "name": "sessionID",
  4617. "in": "path",
  4618. "schema": {
  4619. "type": "string",
  4620. "pattern": "^ses.*"
  4621. },
  4622. "required": true
  4623. }
  4624. ],
  4625. "responses": {
  4626. "200": {
  4627. "description": "Get session",
  4628. "content": {
  4629. "application/json": {
  4630. "schema": {
  4631. "$ref": "#/components/schemas/Session"
  4632. }
  4633. }
  4634. }
  4635. },
  4636. "400": {
  4637. "description": "Bad request",
  4638. "content": {
  4639. "application/json": {
  4640. "schema": {
  4641. "$ref": "#/components/schemas/BadRequestError"
  4642. }
  4643. }
  4644. }
  4645. },
  4646. "404": {
  4647. "description": "NotFoundError",
  4648. "content": {
  4649. "application/json": {
  4650. "schema": {
  4651. "$ref": "#/components/schemas/NotFoundError"
  4652. }
  4653. }
  4654. }
  4655. }
  4656. },
  4657. "description": "Retrieve detailed information about a specific OpenCode session.",
  4658. "summary": "Get session",
  4659. "x-codeSamples": [
  4660. {
  4661. "lang": "js",
  4662. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.get({\n ...\n})"
  4663. }
  4664. ]
  4665. },
  4666. "delete": {
  4667. "tags": ["session"],
  4668. "operationId": "session.delete",
  4669. "parameters": [
  4670. {
  4671. "name": "directory",
  4672. "in": "query",
  4673. "required": false,
  4674. "schema": {
  4675. "type": "string"
  4676. }
  4677. },
  4678. {
  4679. "name": "workspace",
  4680. "in": "query",
  4681. "required": false,
  4682. "schema": {
  4683. "type": "string"
  4684. }
  4685. },
  4686. {
  4687. "name": "sessionID",
  4688. "in": "path",
  4689. "schema": {
  4690. "type": "string",
  4691. "pattern": "^ses.*"
  4692. },
  4693. "required": true
  4694. }
  4695. ],
  4696. "responses": {
  4697. "200": {
  4698. "description": "Successfully deleted session",
  4699. "content": {
  4700. "application/json": {
  4701. "schema": {
  4702. "type": "boolean",
  4703. "description": "Successfully deleted session"
  4704. }
  4705. }
  4706. }
  4707. },
  4708. "400": {
  4709. "description": "Bad request",
  4710. "content": {
  4711. "application/json": {
  4712. "schema": {
  4713. "$ref": "#/components/schemas/BadRequestError"
  4714. }
  4715. }
  4716. }
  4717. },
  4718. "404": {
  4719. "description": "NotFoundError",
  4720. "content": {
  4721. "application/json": {
  4722. "schema": {
  4723. "$ref": "#/components/schemas/NotFoundError"
  4724. }
  4725. }
  4726. }
  4727. }
  4728. },
  4729. "description": "Delete a session and permanently remove all associated data, including messages and history.",
  4730. "summary": "Delete session",
  4731. "x-codeSamples": [
  4732. {
  4733. "lang": "js",
  4734. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.delete({\n ...\n})"
  4735. }
  4736. ]
  4737. },
  4738. "patch": {
  4739. "tags": ["session"],
  4740. "operationId": "session.update",
  4741. "parameters": [
  4742. {
  4743. "name": "directory",
  4744. "in": "query",
  4745. "required": false,
  4746. "schema": {
  4747. "type": "string"
  4748. }
  4749. },
  4750. {
  4751. "name": "workspace",
  4752. "in": "query",
  4753. "required": false,
  4754. "schema": {
  4755. "type": "string"
  4756. }
  4757. },
  4758. {
  4759. "name": "sessionID",
  4760. "in": "path",
  4761. "schema": {
  4762. "type": "string",
  4763. "pattern": "^ses.*"
  4764. },
  4765. "required": true
  4766. }
  4767. ],
  4768. "responses": {
  4769. "200": {
  4770. "description": "Successfully updated session",
  4771. "content": {
  4772. "application/json": {
  4773. "schema": {
  4774. "$ref": "#/components/schemas/Session"
  4775. }
  4776. }
  4777. }
  4778. },
  4779. "400": {
  4780. "description": "Bad request",
  4781. "content": {
  4782. "application/json": {
  4783. "schema": {
  4784. "$ref": "#/components/schemas/BadRequestError"
  4785. }
  4786. }
  4787. }
  4788. },
  4789. "404": {
  4790. "description": "NotFoundError",
  4791. "content": {
  4792. "application/json": {
  4793. "schema": {
  4794. "$ref": "#/components/schemas/NotFoundError"
  4795. }
  4796. }
  4797. }
  4798. }
  4799. },
  4800. "description": "Update properties of an existing session, such as title or other metadata.",
  4801. "summary": "Update session",
  4802. "requestBody": {
  4803. "content": {
  4804. "application/json": {
  4805. "schema": {
  4806. "type": "object",
  4807. "properties": {
  4808. "title": {
  4809. "type": "string"
  4810. },
  4811. "permission": {
  4812. "$ref": "#/components/schemas/PermissionRuleset"
  4813. },
  4814. "time": {
  4815. "type": "object",
  4816. "properties": {
  4817. "archived": {
  4818. "type": "number"
  4819. }
  4820. },
  4821. "additionalProperties": false
  4822. }
  4823. },
  4824. "additionalProperties": false
  4825. }
  4826. }
  4827. }
  4828. },
  4829. "x-codeSamples": [
  4830. {
  4831. "lang": "js",
  4832. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.update({\n ...\n})"
  4833. }
  4834. ]
  4835. }
  4836. },
  4837. "/session/{sessionID}/children": {
  4838. "get": {
  4839. "tags": ["session"],
  4840. "operationId": "session.children",
  4841. "parameters": [
  4842. {
  4843. "name": "directory",
  4844. "in": "query",
  4845. "required": false,
  4846. "schema": {
  4847. "type": "string"
  4848. }
  4849. },
  4850. {
  4851. "name": "workspace",
  4852. "in": "query",
  4853. "required": false,
  4854. "schema": {
  4855. "type": "string"
  4856. }
  4857. },
  4858. {
  4859. "name": "sessionID",
  4860. "in": "path",
  4861. "schema": {
  4862. "type": "string",
  4863. "pattern": "^ses.*"
  4864. },
  4865. "required": true
  4866. }
  4867. ],
  4868. "responses": {
  4869. "200": {
  4870. "description": "List of children",
  4871. "content": {
  4872. "application/json": {
  4873. "schema": {
  4874. "type": "array",
  4875. "items": {
  4876. "$ref": "#/components/schemas/Session"
  4877. },
  4878. "description": "List of children"
  4879. }
  4880. }
  4881. }
  4882. },
  4883. "400": {
  4884. "description": "Bad request",
  4885. "content": {
  4886. "application/json": {
  4887. "schema": {
  4888. "$ref": "#/components/schemas/BadRequestError"
  4889. }
  4890. }
  4891. }
  4892. },
  4893. "404": {
  4894. "description": "Not found",
  4895. "content": {
  4896. "application/json": {
  4897. "schema": {
  4898. "$ref": "#/components/schemas/NotFoundError"
  4899. }
  4900. }
  4901. }
  4902. }
  4903. },
  4904. "description": "Retrieve all child sessions that were forked from the specified parent session.",
  4905. "summary": "Get session children",
  4906. "x-codeSamples": [
  4907. {
  4908. "lang": "js",
  4909. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.children({\n ...\n})"
  4910. }
  4911. ]
  4912. }
  4913. },
  4914. "/session/{sessionID}/todo": {
  4915. "get": {
  4916. "tags": ["session"],
  4917. "operationId": "session.todo",
  4918. "parameters": [
  4919. {
  4920. "name": "directory",
  4921. "in": "query",
  4922. "required": false,
  4923. "schema": {
  4924. "type": "string"
  4925. }
  4926. },
  4927. {
  4928. "name": "workspace",
  4929. "in": "query",
  4930. "required": false,
  4931. "schema": {
  4932. "type": "string"
  4933. }
  4934. },
  4935. {
  4936. "name": "sessionID",
  4937. "in": "path",
  4938. "schema": {
  4939. "type": "string",
  4940. "pattern": "^ses.*"
  4941. },
  4942. "required": true
  4943. }
  4944. ],
  4945. "responses": {
  4946. "200": {
  4947. "description": "Todo list",
  4948. "content": {
  4949. "application/json": {
  4950. "schema": {
  4951. "type": "array",
  4952. "items": {
  4953. "$ref": "#/components/schemas/Todo"
  4954. },
  4955. "description": "Todo list"
  4956. }
  4957. }
  4958. }
  4959. },
  4960. "400": {
  4961. "description": "Bad request",
  4962. "content": {
  4963. "application/json": {
  4964. "schema": {
  4965. "$ref": "#/components/schemas/BadRequestError"
  4966. }
  4967. }
  4968. }
  4969. },
  4970. "404": {
  4971. "description": "Not found",
  4972. "content": {
  4973. "application/json": {
  4974. "schema": {
  4975. "$ref": "#/components/schemas/NotFoundError"
  4976. }
  4977. }
  4978. }
  4979. }
  4980. },
  4981. "description": "Retrieve the todo list associated with a specific session, showing tasks and action items.",
  4982. "summary": "Get session todos",
  4983. "x-codeSamples": [
  4984. {
  4985. "lang": "js",
  4986. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.todo({\n ...\n})"
  4987. }
  4988. ]
  4989. }
  4990. },
  4991. "/session/{sessionID}/diff": {
  4992. "get": {
  4993. "tags": ["session"],
  4994. "operationId": "session.diff",
  4995. "parameters": [
  4996. {
  4997. "name": "directory",
  4998. "in": "query",
  4999. "required": false,
  5000. "schema": {
  5001. "type": "string"
  5002. }
  5003. },
  5004. {
  5005. "name": "workspace",
  5006. "in": "query",
  5007. "required": false,
  5008. "schema": {
  5009. "type": "string"
  5010. }
  5011. },
  5012. {
  5013. "name": "sessionID",
  5014. "in": "path",
  5015. "schema": {
  5016. "type": "string",
  5017. "pattern": "^ses.*"
  5018. },
  5019. "required": true
  5020. },
  5021. {
  5022. "name": "messageID",
  5023. "in": "query",
  5024. "schema": {
  5025. "type": "string",
  5026. "pattern": "^msg.*"
  5027. },
  5028. "required": false
  5029. }
  5030. ],
  5031. "responses": {
  5032. "200": {
  5033. "description": "Successfully retrieved diff",
  5034. "content": {
  5035. "application/json": {
  5036. "schema": {
  5037. "type": "array",
  5038. "items": {
  5039. "$ref": "#/components/schemas/SnapshotFileDiff"
  5040. },
  5041. "description": "Successfully retrieved diff"
  5042. }
  5043. }
  5044. }
  5045. }
  5046. },
  5047. "description": "Get the file changes (diff) that resulted from a specific user message in the session.",
  5048. "summary": "Get message diff",
  5049. "x-codeSamples": [
  5050. {
  5051. "lang": "js",
  5052. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.diff({\n ...\n})"
  5053. }
  5054. ]
  5055. }
  5056. },
  5057. "/session/{sessionID}/message": {
  5058. "get": {
  5059. "tags": ["session"],
  5060. "operationId": "session.messages",
  5061. "parameters": [
  5062. {
  5063. "name": "directory",
  5064. "in": "query",
  5065. "required": false,
  5066. "schema": {
  5067. "type": "string"
  5068. }
  5069. },
  5070. {
  5071. "name": "workspace",
  5072. "in": "query",
  5073. "required": false,
  5074. "schema": {
  5075. "type": "string"
  5076. }
  5077. },
  5078. {
  5079. "name": "sessionID",
  5080. "in": "path",
  5081. "schema": {
  5082. "type": "string",
  5083. "pattern": "^ses.*"
  5084. },
  5085. "required": true
  5086. },
  5087. {
  5088. "name": "limit",
  5089. "in": "query",
  5090. "schema": {
  5091. "type": "integer",
  5092. "minimum": 0,
  5093. "maximum": 9007199254740991
  5094. },
  5095. "required": false
  5096. },
  5097. {
  5098. "name": "before",
  5099. "in": "query",
  5100. "schema": {
  5101. "type": "string"
  5102. },
  5103. "required": false
  5104. }
  5105. ],
  5106. "responses": {
  5107. "200": {
  5108. "description": "List of messages",
  5109. "content": {
  5110. "application/json": {
  5111. "schema": {
  5112. "type": "array",
  5113. "items": {
  5114. "type": "object",
  5115. "properties": {
  5116. "info": {
  5117. "$ref": "#/components/schemas/Message"
  5118. },
  5119. "parts": {
  5120. "type": "array",
  5121. "items": {
  5122. "$ref": "#/components/schemas/Part"
  5123. }
  5124. }
  5125. },
  5126. "required": ["info", "parts"],
  5127. "additionalProperties": false
  5128. },
  5129. "description": "List of messages"
  5130. }
  5131. }
  5132. }
  5133. },
  5134. "400": {
  5135. "description": "Bad request",
  5136. "content": {
  5137. "application/json": {
  5138. "schema": {
  5139. "$ref": "#/components/schemas/BadRequestError"
  5140. }
  5141. }
  5142. }
  5143. },
  5144. "404": {
  5145. "description": "NotFoundError",
  5146. "content": {
  5147. "application/json": {
  5148. "schema": {
  5149. "$ref": "#/components/schemas/NotFoundError"
  5150. }
  5151. }
  5152. }
  5153. }
  5154. },
  5155. "description": "Retrieve all messages in a session, including user prompts and AI responses.",
  5156. "summary": "Get session messages",
  5157. "x-codeSamples": [
  5158. {
  5159. "lang": "js",
  5160. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.messages({\n ...\n})"
  5161. }
  5162. ]
  5163. },
  5164. "post": {
  5165. "tags": ["session"],
  5166. "operationId": "session.prompt",
  5167. "parameters": [
  5168. {
  5169. "name": "directory",
  5170. "in": "query",
  5171. "required": false,
  5172. "schema": {
  5173. "type": "string"
  5174. }
  5175. },
  5176. {
  5177. "name": "workspace",
  5178. "in": "query",
  5179. "required": false,
  5180. "schema": {
  5181. "type": "string"
  5182. }
  5183. },
  5184. {
  5185. "name": "sessionID",
  5186. "in": "path",
  5187. "schema": {
  5188. "type": "string",
  5189. "pattern": "^ses.*"
  5190. },
  5191. "required": true
  5192. }
  5193. ],
  5194. "responses": {
  5195. "200": {
  5196. "description": "Created message",
  5197. "content": {
  5198. "application/json": {
  5199. "schema": {
  5200. "type": "object",
  5201. "required": ["info", "parts"],
  5202. "properties": {
  5203. "info": {
  5204. "$ref": "#/components/schemas/AssistantMessage"
  5205. },
  5206. "parts": {
  5207. "type": "array",
  5208. "items": {
  5209. "$ref": "#/components/schemas/Part"
  5210. }
  5211. }
  5212. }
  5213. }
  5214. }
  5215. }
  5216. },
  5217. "400": {
  5218. "description": "Bad request",
  5219. "content": {
  5220. "application/json": {
  5221. "schema": {
  5222. "$ref": "#/components/schemas/BadRequestError"
  5223. }
  5224. }
  5225. }
  5226. },
  5227. "404": {
  5228. "description": "Not found",
  5229. "content": {
  5230. "application/json": {
  5231. "schema": {
  5232. "$ref": "#/components/schemas/NotFoundError"
  5233. }
  5234. }
  5235. }
  5236. }
  5237. },
  5238. "description": "Create and send a new message to a session, streaming the AI response.",
  5239. "summary": "Send message",
  5240. "requestBody": {
  5241. "content": {
  5242. "application/json": {
  5243. "schema": {
  5244. "type": "object",
  5245. "properties": {
  5246. "messageID": {
  5247. "type": "string"
  5248. },
  5249. "model": {
  5250. "type": "object",
  5251. "properties": {
  5252. "providerID": {
  5253. "type": "string"
  5254. },
  5255. "modelID": {
  5256. "type": "string"
  5257. }
  5258. },
  5259. "required": ["providerID", "modelID"],
  5260. "additionalProperties": false
  5261. },
  5262. "agent": {
  5263. "type": "string"
  5264. },
  5265. "noReply": {
  5266. "type": "boolean"
  5267. },
  5268. "tools": {
  5269. "type": "object",
  5270. "additionalProperties": {
  5271. "type": "boolean"
  5272. }
  5273. },
  5274. "format": {
  5275. "$ref": "#/components/schemas/OutputFormat"
  5276. },
  5277. "system": {
  5278. "type": "string"
  5279. },
  5280. "variant": {
  5281. "type": "string"
  5282. },
  5283. "parts": {
  5284. "type": "array",
  5285. "items": {
  5286. "anyOf": [
  5287. {
  5288. "$ref": "#/components/schemas/TextPartInput"
  5289. },
  5290. {
  5291. "$ref": "#/components/schemas/FilePartInput"
  5292. },
  5293. {
  5294. "$ref": "#/components/schemas/AgentPartInput"
  5295. },
  5296. {
  5297. "$ref": "#/components/schemas/SubtaskPartInput"
  5298. }
  5299. ]
  5300. }
  5301. }
  5302. },
  5303. "required": ["parts"],
  5304. "additionalProperties": false
  5305. }
  5306. }
  5307. }
  5308. },
  5309. "x-codeSamples": [
  5310. {
  5311. "lang": "js",
  5312. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.prompt({\n ...\n})"
  5313. }
  5314. ]
  5315. }
  5316. },
  5317. "/session/{sessionID}/message/{messageID}": {
  5318. "get": {
  5319. "tags": ["session"],
  5320. "operationId": "session.message",
  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": "messageID",
  5349. "in": "path",
  5350. "schema": {
  5351. "type": "string",
  5352. "pattern": "^msg.*"
  5353. },
  5354. "required": true
  5355. }
  5356. ],
  5357. "responses": {
  5358. "200": {
  5359. "description": "Message",
  5360. "content": {
  5361. "application/json": {
  5362. "schema": {
  5363. "type": "object",
  5364. "properties": {
  5365. "info": {
  5366. "$ref": "#/components/schemas/Message"
  5367. },
  5368. "parts": {
  5369. "type": "array",
  5370. "items": {
  5371. "$ref": "#/components/schemas/Part"
  5372. }
  5373. }
  5374. },
  5375. "required": ["info", "parts"],
  5376. "additionalProperties": false,
  5377. "description": "Message"
  5378. }
  5379. }
  5380. }
  5381. },
  5382. "400": {
  5383. "description": "Bad request",
  5384. "content": {
  5385. "application/json": {
  5386. "schema": {
  5387. "$ref": "#/components/schemas/BadRequestError"
  5388. }
  5389. }
  5390. }
  5391. },
  5392. "404": {
  5393. "description": "NotFoundError",
  5394. "content": {
  5395. "application/json": {
  5396. "schema": {
  5397. "$ref": "#/components/schemas/NotFoundError"
  5398. }
  5399. }
  5400. }
  5401. }
  5402. },
  5403. "description": "Retrieve a specific message from a session by its message ID.",
  5404. "summary": "Get message",
  5405. "x-codeSamples": [
  5406. {
  5407. "lang": "js",
  5408. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.message({\n ...\n})"
  5409. }
  5410. ]
  5411. },
  5412. "delete": {
  5413. "tags": ["session"],
  5414. "operationId": "session.deleteMessage",
  5415. "parameters": [
  5416. {
  5417. "name": "directory",
  5418. "in": "query",
  5419. "required": false,
  5420. "schema": {
  5421. "type": "string"
  5422. }
  5423. },
  5424. {
  5425. "name": "workspace",
  5426. "in": "query",
  5427. "required": false,
  5428. "schema": {
  5429. "type": "string"
  5430. }
  5431. },
  5432. {
  5433. "name": "sessionID",
  5434. "in": "path",
  5435. "schema": {
  5436. "type": "string",
  5437. "pattern": "^ses.*"
  5438. },
  5439. "required": true
  5440. },
  5441. {
  5442. "name": "messageID",
  5443. "in": "path",
  5444. "schema": {
  5445. "type": "string",
  5446. "pattern": "^msg.*"
  5447. },
  5448. "required": true
  5449. }
  5450. ],
  5451. "responses": {
  5452. "200": {
  5453. "description": "Successfully deleted message",
  5454. "content": {
  5455. "application/json": {
  5456. "schema": {
  5457. "type": "boolean",
  5458. "description": "Successfully deleted message"
  5459. }
  5460. }
  5461. }
  5462. },
  5463. "400": {
  5464. "description": "Bad request",
  5465. "content": {
  5466. "application/json": {
  5467. "schema": {
  5468. "$ref": "#/components/schemas/BadRequestError"
  5469. }
  5470. }
  5471. }
  5472. },
  5473. "404": {
  5474. "description": "Not found",
  5475. "content": {
  5476. "application/json": {
  5477. "schema": {
  5478. "$ref": "#/components/schemas/NotFoundError"
  5479. }
  5480. }
  5481. }
  5482. }
  5483. },
  5484. "description": "Permanently delete a specific message and all of its parts from a session without reverting file changes.",
  5485. "summary": "Delete message",
  5486. "x-codeSamples": [
  5487. {
  5488. "lang": "js",
  5489. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.deleteMessage({\n ...\n})"
  5490. }
  5491. ]
  5492. }
  5493. },
  5494. "/session/{sessionID}/fork": {
  5495. "post": {
  5496. "tags": ["session"],
  5497. "operationId": "session.fork",
  5498. "parameters": [
  5499. {
  5500. "name": "directory",
  5501. "in": "query",
  5502. "required": false,
  5503. "schema": {
  5504. "type": "string"
  5505. }
  5506. },
  5507. {
  5508. "name": "workspace",
  5509. "in": "query",
  5510. "required": false,
  5511. "schema": {
  5512. "type": "string"
  5513. }
  5514. },
  5515. {
  5516. "name": "sessionID",
  5517. "in": "path",
  5518. "schema": {
  5519. "type": "string",
  5520. "pattern": "^ses.*"
  5521. },
  5522. "required": true
  5523. }
  5524. ],
  5525. "responses": {
  5526. "200": {
  5527. "description": "200",
  5528. "content": {
  5529. "application/json": {
  5530. "schema": {
  5531. "$ref": "#/components/schemas/Session"
  5532. }
  5533. }
  5534. }
  5535. },
  5536. "404": {
  5537. "description": "NotFoundError",
  5538. "content": {
  5539. "application/json": {
  5540. "schema": {
  5541. "$ref": "#/components/schemas/NotFoundError"
  5542. }
  5543. }
  5544. }
  5545. }
  5546. },
  5547. "description": "Create a new session by forking an existing session at a specific message point.",
  5548. "summary": "Fork session",
  5549. "requestBody": {
  5550. "content": {
  5551. "application/json": {
  5552. "schema": {
  5553. "type": "object",
  5554. "properties": {
  5555. "messageID": {
  5556. "type": "string"
  5557. }
  5558. },
  5559. "additionalProperties": false
  5560. }
  5561. }
  5562. }
  5563. },
  5564. "x-codeSamples": [
  5565. {
  5566. "lang": "js",
  5567. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.fork({\n ...\n})"
  5568. }
  5569. ]
  5570. }
  5571. },
  5572. "/session/{sessionID}/abort": {
  5573. "post": {
  5574. "tags": ["session"],
  5575. "operationId": "session.abort",
  5576. "parameters": [
  5577. {
  5578. "name": "directory",
  5579. "in": "query",
  5580. "required": false,
  5581. "schema": {
  5582. "type": "string"
  5583. }
  5584. },
  5585. {
  5586. "name": "workspace",
  5587. "in": "query",
  5588. "required": false,
  5589. "schema": {
  5590. "type": "string"
  5591. }
  5592. },
  5593. {
  5594. "name": "sessionID",
  5595. "in": "path",
  5596. "schema": {
  5597. "type": "string",
  5598. "pattern": "^ses.*"
  5599. },
  5600. "required": true
  5601. }
  5602. ],
  5603. "responses": {
  5604. "200": {
  5605. "description": "Aborted session",
  5606. "content": {
  5607. "application/json": {
  5608. "schema": {
  5609. "type": "boolean",
  5610. "description": "Aborted session"
  5611. }
  5612. }
  5613. }
  5614. },
  5615. "400": {
  5616. "description": "Bad request",
  5617. "content": {
  5618. "application/json": {
  5619. "schema": {
  5620. "$ref": "#/components/schemas/BadRequestError"
  5621. }
  5622. }
  5623. }
  5624. },
  5625. "404": {
  5626. "description": "Not found",
  5627. "content": {
  5628. "application/json": {
  5629. "schema": {
  5630. "$ref": "#/components/schemas/NotFoundError"
  5631. }
  5632. }
  5633. }
  5634. }
  5635. },
  5636. "description": "Abort an active session and stop any ongoing AI processing or command execution.",
  5637. "summary": "Abort session",
  5638. "x-codeSamples": [
  5639. {
  5640. "lang": "js",
  5641. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.abort({\n ...\n})"
  5642. }
  5643. ]
  5644. }
  5645. },
  5646. "/session/{sessionID}/init": {
  5647. "post": {
  5648. "tags": ["session"],
  5649. "operationId": "session.init",
  5650. "parameters": [
  5651. {
  5652. "name": "directory",
  5653. "in": "query",
  5654. "required": false,
  5655. "schema": {
  5656. "type": "string"
  5657. }
  5658. },
  5659. {
  5660. "name": "workspace",
  5661. "in": "query",
  5662. "required": false,
  5663. "schema": {
  5664. "type": "string"
  5665. }
  5666. },
  5667. {
  5668. "name": "sessionID",
  5669. "in": "path",
  5670. "schema": {
  5671. "type": "string",
  5672. "pattern": "^ses.*"
  5673. },
  5674. "required": true
  5675. }
  5676. ],
  5677. "responses": {
  5678. "200": {
  5679. "description": "200",
  5680. "content": {
  5681. "application/json": {
  5682. "schema": {
  5683. "type": "boolean",
  5684. "description": "200"
  5685. }
  5686. }
  5687. }
  5688. },
  5689. "400": {
  5690. "description": "Bad request",
  5691. "content": {
  5692. "application/json": {
  5693. "schema": {
  5694. "$ref": "#/components/schemas/BadRequestError"
  5695. }
  5696. }
  5697. }
  5698. },
  5699. "404": {
  5700. "description": "Not found",
  5701. "content": {
  5702. "application/json": {
  5703. "schema": {
  5704. "$ref": "#/components/schemas/NotFoundError"
  5705. }
  5706. }
  5707. }
  5708. }
  5709. },
  5710. "description": "Analyze the current application and create an AGENTS.md file with project-specific agent configurations.",
  5711. "summary": "Initialize session",
  5712. "requestBody": {
  5713. "content": {
  5714. "application/json": {
  5715. "schema": {
  5716. "type": "object",
  5717. "properties": {
  5718. "modelID": {
  5719. "type": "string"
  5720. },
  5721. "providerID": {
  5722. "type": "string"
  5723. },
  5724. "messageID": {
  5725. "type": "string"
  5726. }
  5727. },
  5728. "required": ["modelID", "providerID", "messageID"],
  5729. "additionalProperties": false
  5730. }
  5731. }
  5732. }
  5733. },
  5734. "x-codeSamples": [
  5735. {
  5736. "lang": "js",
  5737. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.init({\n ...\n})"
  5738. }
  5739. ]
  5740. }
  5741. },
  5742. "/session/{sessionID}/share": {
  5743. "post": {
  5744. "tags": ["session"],
  5745. "operationId": "session.share",
  5746. "parameters": [
  5747. {
  5748. "name": "directory",
  5749. "in": "query",
  5750. "required": false,
  5751. "schema": {
  5752. "type": "string"
  5753. }
  5754. },
  5755. {
  5756. "name": "workspace",
  5757. "in": "query",
  5758. "required": false,
  5759. "schema": {
  5760. "type": "string"
  5761. }
  5762. },
  5763. {
  5764. "name": "sessionID",
  5765. "in": "path",
  5766. "schema": {
  5767. "type": "string",
  5768. "pattern": "^ses.*"
  5769. },
  5770. "required": true
  5771. }
  5772. ],
  5773. "responses": {
  5774. "200": {
  5775. "description": "Successfully shared session",
  5776. "content": {
  5777. "application/json": {
  5778. "schema": {
  5779. "$ref": "#/components/schemas/Session"
  5780. }
  5781. }
  5782. }
  5783. },
  5784. "400": {
  5785. "description": "Bad request",
  5786. "content": {
  5787. "application/json": {
  5788. "schema": {
  5789. "$ref": "#/components/schemas/BadRequestError"
  5790. }
  5791. }
  5792. }
  5793. },
  5794. "404": {
  5795. "description": "NotFoundError",
  5796. "content": {
  5797. "application/json": {
  5798. "schema": {
  5799. "$ref": "#/components/schemas/NotFoundError"
  5800. }
  5801. }
  5802. }
  5803. }
  5804. },
  5805. "description": "Create a shareable link for a session, allowing others to view the conversation.",
  5806. "summary": "Share session",
  5807. "x-codeSamples": [
  5808. {
  5809. "lang": "js",
  5810. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.share({\n ...\n})"
  5811. }
  5812. ]
  5813. },
  5814. "delete": {
  5815. "tags": ["session"],
  5816. "operationId": "session.unshare",
  5817. "parameters": [
  5818. {
  5819. "name": "directory",
  5820. "in": "query",
  5821. "required": false,
  5822. "schema": {
  5823. "type": "string"
  5824. }
  5825. },
  5826. {
  5827. "name": "workspace",
  5828. "in": "query",
  5829. "required": false,
  5830. "schema": {
  5831. "type": "string"
  5832. }
  5833. },
  5834. {
  5835. "name": "sessionID",
  5836. "in": "path",
  5837. "schema": {
  5838. "type": "string",
  5839. "pattern": "^ses.*"
  5840. },
  5841. "required": true
  5842. }
  5843. ],
  5844. "responses": {
  5845. "200": {
  5846. "description": "Successfully unshared session",
  5847. "content": {
  5848. "application/json": {
  5849. "schema": {
  5850. "$ref": "#/components/schemas/Session"
  5851. }
  5852. }
  5853. }
  5854. },
  5855. "400": {
  5856. "description": "Bad request",
  5857. "content": {
  5858. "application/json": {
  5859. "schema": {
  5860. "$ref": "#/components/schemas/BadRequestError"
  5861. }
  5862. }
  5863. }
  5864. },
  5865. "404": {
  5866. "description": "NotFoundError",
  5867. "content": {
  5868. "application/json": {
  5869. "schema": {
  5870. "$ref": "#/components/schemas/NotFoundError"
  5871. }
  5872. }
  5873. }
  5874. }
  5875. },
  5876. "description": "Remove the shareable link for a session, making it private again.",
  5877. "summary": "Unshare session",
  5878. "x-codeSamples": [
  5879. {
  5880. "lang": "js",
  5881. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.unshare({\n ...\n})"
  5882. }
  5883. ]
  5884. }
  5885. },
  5886. "/session/{sessionID}/summarize": {
  5887. "post": {
  5888. "tags": ["session"],
  5889. "operationId": "session.summarize",
  5890. "parameters": [
  5891. {
  5892. "name": "directory",
  5893. "in": "query",
  5894. "required": false,
  5895. "schema": {
  5896. "type": "string"
  5897. }
  5898. },
  5899. {
  5900. "name": "workspace",
  5901. "in": "query",
  5902. "required": false,
  5903. "schema": {
  5904. "type": "string"
  5905. }
  5906. },
  5907. {
  5908. "name": "sessionID",
  5909. "in": "path",
  5910. "schema": {
  5911. "type": "string",
  5912. "pattern": "^ses.*"
  5913. },
  5914. "required": true
  5915. }
  5916. ],
  5917. "responses": {
  5918. "200": {
  5919. "description": "Summarized session",
  5920. "content": {
  5921. "application/json": {
  5922. "schema": {
  5923. "type": "boolean",
  5924. "description": "Summarized session"
  5925. }
  5926. }
  5927. }
  5928. },
  5929. "400": {
  5930. "description": "Bad request",
  5931. "content": {
  5932. "application/json": {
  5933. "schema": {
  5934. "$ref": "#/components/schemas/BadRequestError"
  5935. }
  5936. }
  5937. }
  5938. },
  5939. "404": {
  5940. "description": "NotFoundError",
  5941. "content": {
  5942. "application/json": {
  5943. "schema": {
  5944. "$ref": "#/components/schemas/NotFoundError"
  5945. }
  5946. }
  5947. }
  5948. }
  5949. },
  5950. "description": "Generate a concise summary of the session using AI compaction to preserve key information.",
  5951. "summary": "Summarize session",
  5952. "requestBody": {
  5953. "content": {
  5954. "application/json": {
  5955. "schema": {
  5956. "type": "object",
  5957. "properties": {
  5958. "providerID": {
  5959. "type": "string"
  5960. },
  5961. "modelID": {
  5962. "type": "string"
  5963. },
  5964. "auto": {
  5965. "type": "boolean"
  5966. }
  5967. },
  5968. "required": ["providerID", "modelID"],
  5969. "additionalProperties": false
  5970. }
  5971. }
  5972. }
  5973. },
  5974. "x-codeSamples": [
  5975. {
  5976. "lang": "js",
  5977. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.summarize({\n ...\n})"
  5978. }
  5979. ]
  5980. }
  5981. },
  5982. "/session/{sessionID}/prompt_async": {
  5983. "post": {
  5984. "tags": ["session"],
  5985. "operationId": "session.prompt_async",
  5986. "parameters": [
  5987. {
  5988. "name": "directory",
  5989. "in": "query",
  5990. "required": false,
  5991. "schema": {
  5992. "type": "string"
  5993. }
  5994. },
  5995. {
  5996. "name": "workspace",
  5997. "in": "query",
  5998. "required": false,
  5999. "schema": {
  6000. "type": "string"
  6001. }
  6002. },
  6003. {
  6004. "name": "sessionID",
  6005. "in": "path",
  6006. "schema": {
  6007. "type": "string",
  6008. "pattern": "^ses.*"
  6009. },
  6010. "required": true
  6011. }
  6012. ],
  6013. "responses": {
  6014. "204": {
  6015. "description": "Prompt accepted"
  6016. },
  6017. "400": {
  6018. "description": "Bad request",
  6019. "content": {
  6020. "application/json": {
  6021. "schema": {
  6022. "$ref": "#/components/schemas/BadRequestError"
  6023. }
  6024. }
  6025. }
  6026. },
  6027. "404": {
  6028. "description": "Not found",
  6029. "content": {
  6030. "application/json": {
  6031. "schema": {
  6032. "$ref": "#/components/schemas/NotFoundError"
  6033. }
  6034. }
  6035. }
  6036. }
  6037. },
  6038. "description": "Create and send a new message to a session asynchronously, starting the session if needed and returning immediately.",
  6039. "summary": "Send async message",
  6040. "requestBody": {
  6041. "content": {
  6042. "application/json": {
  6043. "schema": {
  6044. "type": "object",
  6045. "properties": {
  6046. "messageID": {
  6047. "type": "string"
  6048. },
  6049. "model": {
  6050. "type": "object",
  6051. "properties": {
  6052. "providerID": {
  6053. "type": "string"
  6054. },
  6055. "modelID": {
  6056. "type": "string"
  6057. }
  6058. },
  6059. "required": ["providerID", "modelID"],
  6060. "additionalProperties": false
  6061. },
  6062. "agent": {
  6063. "type": "string"
  6064. },
  6065. "noReply": {
  6066. "type": "boolean"
  6067. },
  6068. "tools": {
  6069. "type": "object",
  6070. "additionalProperties": {
  6071. "type": "boolean"
  6072. }
  6073. },
  6074. "format": {
  6075. "$ref": "#/components/schemas/OutputFormat"
  6076. },
  6077. "system": {
  6078. "type": "string"
  6079. },
  6080. "variant": {
  6081. "type": "string"
  6082. },
  6083. "parts": {
  6084. "type": "array",
  6085. "items": {
  6086. "anyOf": [
  6087. {
  6088. "$ref": "#/components/schemas/TextPartInput"
  6089. },
  6090. {
  6091. "$ref": "#/components/schemas/FilePartInput"
  6092. },
  6093. {
  6094. "$ref": "#/components/schemas/AgentPartInput"
  6095. },
  6096. {
  6097. "$ref": "#/components/schemas/SubtaskPartInput"
  6098. }
  6099. ]
  6100. }
  6101. }
  6102. },
  6103. "required": ["parts"],
  6104. "additionalProperties": false
  6105. }
  6106. }
  6107. }
  6108. },
  6109. "x-codeSamples": [
  6110. {
  6111. "lang": "js",
  6112. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.prompt_async({\n ...\n})"
  6113. }
  6114. ]
  6115. }
  6116. },
  6117. "/session/{sessionID}/command": {
  6118. "post": {
  6119. "tags": ["session"],
  6120. "operationId": "session.command",
  6121. "parameters": [
  6122. {
  6123. "name": "directory",
  6124. "in": "query",
  6125. "required": false,
  6126. "schema": {
  6127. "type": "string"
  6128. }
  6129. },
  6130. {
  6131. "name": "workspace",
  6132. "in": "query",
  6133. "required": false,
  6134. "schema": {
  6135. "type": "string"
  6136. }
  6137. },
  6138. {
  6139. "name": "sessionID",
  6140. "in": "path",
  6141. "schema": {
  6142. "type": "string",
  6143. "pattern": "^ses.*"
  6144. },
  6145. "required": true
  6146. }
  6147. ],
  6148. "responses": {
  6149. "200": {
  6150. "description": "Created message",
  6151. "content": {
  6152. "application/json": {
  6153. "schema": {
  6154. "type": "object",
  6155. "required": ["info", "parts"],
  6156. "properties": {
  6157. "info": {
  6158. "$ref": "#/components/schemas/AssistantMessage"
  6159. },
  6160. "parts": {
  6161. "type": "array",
  6162. "items": {
  6163. "$ref": "#/components/schemas/Part"
  6164. }
  6165. }
  6166. }
  6167. }
  6168. }
  6169. }
  6170. },
  6171. "400": {
  6172. "description": "Bad request",
  6173. "content": {
  6174. "application/json": {
  6175. "schema": {
  6176. "$ref": "#/components/schemas/BadRequestError"
  6177. }
  6178. }
  6179. }
  6180. },
  6181. "404": {
  6182. "description": "Not found",
  6183. "content": {
  6184. "application/json": {
  6185. "schema": {
  6186. "$ref": "#/components/schemas/NotFoundError"
  6187. }
  6188. }
  6189. }
  6190. }
  6191. },
  6192. "description": "Send a new command to a session for execution by the AI assistant.",
  6193. "summary": "Send command",
  6194. "requestBody": {
  6195. "content": {
  6196. "application/json": {
  6197. "schema": {
  6198. "type": "object",
  6199. "properties": {
  6200. "messageID": {
  6201. "type": "string"
  6202. },
  6203. "agent": {
  6204. "type": "string"
  6205. },
  6206. "model": {
  6207. "type": "string"
  6208. },
  6209. "arguments": {
  6210. "type": "string"
  6211. },
  6212. "command": {
  6213. "type": "string"
  6214. },
  6215. "variant": {
  6216. "type": "string"
  6217. },
  6218. "parts": {
  6219. "type": "array",
  6220. "items": {
  6221. "type": "object",
  6222. "properties": {
  6223. "id": {
  6224. "type": "string"
  6225. },
  6226. "type": {
  6227. "type": "string",
  6228. "enum": ["file"]
  6229. },
  6230. "mime": {
  6231. "type": "string"
  6232. },
  6233. "filename": {
  6234. "type": "string"
  6235. },
  6236. "url": {
  6237. "type": "string"
  6238. },
  6239. "source": {
  6240. "$ref": "#/components/schemas/FilePartSource"
  6241. }
  6242. },
  6243. "required": ["type", "mime", "url"],
  6244. "additionalProperties": false
  6245. }
  6246. }
  6247. },
  6248. "required": ["arguments", "command"],
  6249. "additionalProperties": false
  6250. }
  6251. }
  6252. }
  6253. },
  6254. "x-codeSamples": [
  6255. {
  6256. "lang": "js",
  6257. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.command({\n ...\n})"
  6258. }
  6259. ]
  6260. }
  6261. },
  6262. "/session/{sessionID}/shell": {
  6263. "post": {
  6264. "tags": ["session"],
  6265. "operationId": "session.shell",
  6266. "parameters": [
  6267. {
  6268. "name": "directory",
  6269. "in": "query",
  6270. "required": false,
  6271. "schema": {
  6272. "type": "string"
  6273. }
  6274. },
  6275. {
  6276. "name": "workspace",
  6277. "in": "query",
  6278. "required": false,
  6279. "schema": {
  6280. "type": "string"
  6281. }
  6282. },
  6283. {
  6284. "name": "sessionID",
  6285. "in": "path",
  6286. "schema": {
  6287. "type": "string",
  6288. "pattern": "^ses.*"
  6289. },
  6290. "required": true
  6291. }
  6292. ],
  6293. "responses": {
  6294. "200": {
  6295. "description": "Created message",
  6296. "content": {
  6297. "application/json": {
  6298. "schema": {
  6299. "type": "object",
  6300. "properties": {
  6301. "info": {
  6302. "$ref": "#/components/schemas/Message"
  6303. },
  6304. "parts": {
  6305. "type": "array",
  6306. "items": {
  6307. "$ref": "#/components/schemas/Part"
  6308. }
  6309. }
  6310. },
  6311. "required": ["info", "parts"],
  6312. "additionalProperties": false,
  6313. "description": "Created message"
  6314. }
  6315. }
  6316. }
  6317. },
  6318. "400": {
  6319. "description": "Bad request",
  6320. "content": {
  6321. "application/json": {
  6322. "schema": {
  6323. "$ref": "#/components/schemas/BadRequestError"
  6324. }
  6325. }
  6326. }
  6327. },
  6328. "404": {
  6329. "description": "Not found",
  6330. "content": {
  6331. "application/json": {
  6332. "schema": {
  6333. "$ref": "#/components/schemas/NotFoundError"
  6334. }
  6335. }
  6336. }
  6337. }
  6338. },
  6339. "description": "Execute a shell command within the session context and return the AI's response.",
  6340. "summary": "Run shell command",
  6341. "requestBody": {
  6342. "content": {
  6343. "application/json": {
  6344. "schema": {
  6345. "type": "object",
  6346. "properties": {
  6347. "messageID": {
  6348. "type": "string"
  6349. },
  6350. "agent": {
  6351. "type": "string"
  6352. },
  6353. "model": {
  6354. "type": "object",
  6355. "properties": {
  6356. "providerID": {
  6357. "type": "string"
  6358. },
  6359. "modelID": {
  6360. "type": "string"
  6361. }
  6362. },
  6363. "required": ["providerID", "modelID"],
  6364. "additionalProperties": false
  6365. },
  6366. "command": {
  6367. "type": "string"
  6368. }
  6369. },
  6370. "required": ["agent", "command"],
  6371. "additionalProperties": false
  6372. }
  6373. }
  6374. }
  6375. },
  6376. "x-codeSamples": [
  6377. {
  6378. "lang": "js",
  6379. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.shell({\n ...\n})"
  6380. }
  6381. ]
  6382. }
  6383. },
  6384. "/session/{sessionID}/revert": {
  6385. "post": {
  6386. "tags": ["session"],
  6387. "operationId": "session.revert",
  6388. "parameters": [
  6389. {
  6390. "name": "directory",
  6391. "in": "query",
  6392. "required": false,
  6393. "schema": {
  6394. "type": "string"
  6395. }
  6396. },
  6397. {
  6398. "name": "workspace",
  6399. "in": "query",
  6400. "required": false,
  6401. "schema": {
  6402. "type": "string"
  6403. }
  6404. },
  6405. {
  6406. "name": "sessionID",
  6407. "in": "path",
  6408. "schema": {
  6409. "type": "string",
  6410. "pattern": "^ses.*"
  6411. },
  6412. "required": true
  6413. }
  6414. ],
  6415. "responses": {
  6416. "200": {
  6417. "description": "Updated session",
  6418. "content": {
  6419. "application/json": {
  6420. "schema": {
  6421. "$ref": "#/components/schemas/Session"
  6422. }
  6423. }
  6424. }
  6425. },
  6426. "400": {
  6427. "description": "Bad request",
  6428. "content": {
  6429. "application/json": {
  6430. "schema": {
  6431. "$ref": "#/components/schemas/BadRequestError"
  6432. }
  6433. }
  6434. }
  6435. },
  6436. "404": {
  6437. "description": "Not found",
  6438. "content": {
  6439. "application/json": {
  6440. "schema": {
  6441. "$ref": "#/components/schemas/NotFoundError"
  6442. }
  6443. }
  6444. }
  6445. }
  6446. },
  6447. "description": "Revert a specific message in a session, undoing its effects and restoring the previous state.",
  6448. "summary": "Revert message",
  6449. "requestBody": {
  6450. "content": {
  6451. "application/json": {
  6452. "schema": {
  6453. "type": "object",
  6454. "properties": {
  6455. "messageID": {
  6456. "type": "string"
  6457. },
  6458. "partID": {
  6459. "type": "string"
  6460. }
  6461. },
  6462. "required": ["messageID"],
  6463. "additionalProperties": false
  6464. }
  6465. }
  6466. }
  6467. },
  6468. "x-codeSamples": [
  6469. {
  6470. "lang": "js",
  6471. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.revert({\n ...\n})"
  6472. }
  6473. ]
  6474. }
  6475. },
  6476. "/session/{sessionID}/unrevert": {
  6477. "post": {
  6478. "tags": ["session"],
  6479. "operationId": "session.unrevert",
  6480. "parameters": [
  6481. {
  6482. "name": "directory",
  6483. "in": "query",
  6484. "required": false,
  6485. "schema": {
  6486. "type": "string"
  6487. }
  6488. },
  6489. {
  6490. "name": "workspace",
  6491. "in": "query",
  6492. "required": false,
  6493. "schema": {
  6494. "type": "string"
  6495. }
  6496. },
  6497. {
  6498. "name": "sessionID",
  6499. "in": "path",
  6500. "schema": {
  6501. "type": "string",
  6502. "pattern": "^ses.*"
  6503. },
  6504. "required": true
  6505. }
  6506. ],
  6507. "responses": {
  6508. "200": {
  6509. "description": "Updated session",
  6510. "content": {
  6511. "application/json": {
  6512. "schema": {
  6513. "$ref": "#/components/schemas/Session"
  6514. }
  6515. }
  6516. }
  6517. },
  6518. "400": {
  6519. "description": "Bad request",
  6520. "content": {
  6521. "application/json": {
  6522. "schema": {
  6523. "$ref": "#/components/schemas/BadRequestError"
  6524. }
  6525. }
  6526. }
  6527. },
  6528. "404": {
  6529. "description": "Not found",
  6530. "content": {
  6531. "application/json": {
  6532. "schema": {
  6533. "$ref": "#/components/schemas/NotFoundError"
  6534. }
  6535. }
  6536. }
  6537. }
  6538. },
  6539. "description": "Restore all previously reverted messages in a session.",
  6540. "summary": "Restore reverted messages",
  6541. "x-codeSamples": [
  6542. {
  6543. "lang": "js",
  6544. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.unrevert({\n ...\n})"
  6545. }
  6546. ]
  6547. }
  6548. },
  6549. "/session/{sessionID}/permissions/{permissionID}": {
  6550. "post": {
  6551. "tags": ["session"],
  6552. "operationId": "permission.respond",
  6553. "parameters": [
  6554. {
  6555. "name": "directory",
  6556. "in": "query",
  6557. "required": false,
  6558. "schema": {
  6559. "type": "string"
  6560. }
  6561. },
  6562. {
  6563. "name": "workspace",
  6564. "in": "query",
  6565. "required": false,
  6566. "schema": {
  6567. "type": "string"
  6568. }
  6569. },
  6570. {
  6571. "name": "sessionID",
  6572. "in": "path",
  6573. "schema": {
  6574. "type": "string",
  6575. "pattern": "^ses.*"
  6576. },
  6577. "required": true
  6578. },
  6579. {
  6580. "name": "permissionID",
  6581. "in": "path",
  6582. "schema": {
  6583. "type": "string",
  6584. "pattern": "^per.*"
  6585. },
  6586. "required": true
  6587. }
  6588. ],
  6589. "responses": {
  6590. "200": {
  6591. "description": "Permission processed successfully",
  6592. "content": {
  6593. "application/json": {
  6594. "schema": {
  6595. "type": "boolean",
  6596. "description": "Permission processed successfully"
  6597. }
  6598. }
  6599. }
  6600. },
  6601. "400": {
  6602. "description": "Bad request",
  6603. "content": {
  6604. "application/json": {
  6605. "schema": {
  6606. "$ref": "#/components/schemas/BadRequestError"
  6607. }
  6608. }
  6609. }
  6610. },
  6611. "404": {
  6612. "description": "Not found",
  6613. "content": {
  6614. "application/json": {
  6615. "schema": {
  6616. "$ref": "#/components/schemas/NotFoundError"
  6617. }
  6618. }
  6619. }
  6620. }
  6621. },
  6622. "description": "Approve or deny a permission request from the AI assistant.",
  6623. "summary": "Respond to permission",
  6624. "deprecated": true,
  6625. "requestBody": {
  6626. "content": {
  6627. "application/json": {
  6628. "schema": {
  6629. "type": "object",
  6630. "properties": {
  6631. "response": {
  6632. "type": "string",
  6633. "enum": ["once", "always", "reject"]
  6634. }
  6635. },
  6636. "required": ["response"],
  6637. "additionalProperties": false
  6638. }
  6639. }
  6640. }
  6641. },
  6642. "x-codeSamples": [
  6643. {
  6644. "lang": "js",
  6645. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.permission.respond({\n ...\n})"
  6646. }
  6647. ]
  6648. }
  6649. },
  6650. "/session/{sessionID}/message/{messageID}/part/{partID}": {
  6651. "delete": {
  6652. "tags": ["session"],
  6653. "operationId": "part.delete",
  6654. "parameters": [
  6655. {
  6656. "name": "directory",
  6657. "in": "query",
  6658. "required": false,
  6659. "schema": {
  6660. "type": "string"
  6661. }
  6662. },
  6663. {
  6664. "name": "workspace",
  6665. "in": "query",
  6666. "required": false,
  6667. "schema": {
  6668. "type": "string"
  6669. }
  6670. },
  6671. {
  6672. "name": "sessionID",
  6673. "in": "path",
  6674. "schema": {
  6675. "type": "string",
  6676. "pattern": "^ses.*"
  6677. },
  6678. "required": true
  6679. },
  6680. {
  6681. "name": "messageID",
  6682. "in": "path",
  6683. "schema": {
  6684. "type": "string",
  6685. "pattern": "^msg.*"
  6686. },
  6687. "required": true
  6688. },
  6689. {
  6690. "name": "partID",
  6691. "in": "path",
  6692. "schema": {
  6693. "type": "string",
  6694. "pattern": "^prt.*"
  6695. },
  6696. "required": true
  6697. }
  6698. ],
  6699. "responses": {
  6700. "200": {
  6701. "description": "Successfully deleted part",
  6702. "content": {
  6703. "application/json": {
  6704. "schema": {
  6705. "type": "boolean",
  6706. "description": "Successfully deleted part"
  6707. }
  6708. }
  6709. }
  6710. },
  6711. "400": {
  6712. "description": "Bad request",
  6713. "content": {
  6714. "application/json": {
  6715. "schema": {
  6716. "$ref": "#/components/schemas/BadRequestError"
  6717. }
  6718. }
  6719. }
  6720. },
  6721. "404": {
  6722. "description": "Not found",
  6723. "content": {
  6724. "application/json": {
  6725. "schema": {
  6726. "$ref": "#/components/schemas/NotFoundError"
  6727. }
  6728. }
  6729. }
  6730. }
  6731. },
  6732. "description": "Delete a part from a message.",
  6733. "x-codeSamples": [
  6734. {
  6735. "lang": "js",
  6736. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.part.delete({\n ...\n})"
  6737. }
  6738. ]
  6739. },
  6740. "patch": {
  6741. "tags": ["session"],
  6742. "operationId": "part.update",
  6743. "parameters": [
  6744. {
  6745. "name": "directory",
  6746. "in": "query",
  6747. "required": false,
  6748. "schema": {
  6749. "type": "string"
  6750. }
  6751. },
  6752. {
  6753. "name": "workspace",
  6754. "in": "query",
  6755. "required": false,
  6756. "schema": {
  6757. "type": "string"
  6758. }
  6759. },
  6760. {
  6761. "name": "sessionID",
  6762. "in": "path",
  6763. "schema": {
  6764. "type": "string",
  6765. "pattern": "^ses.*"
  6766. },
  6767. "required": true
  6768. },
  6769. {
  6770. "name": "messageID",
  6771. "in": "path",
  6772. "schema": {
  6773. "type": "string",
  6774. "pattern": "^msg.*"
  6775. },
  6776. "required": true
  6777. },
  6778. {
  6779. "name": "partID",
  6780. "in": "path",
  6781. "schema": {
  6782. "type": "string",
  6783. "pattern": "^prt.*"
  6784. },
  6785. "required": true
  6786. }
  6787. ],
  6788. "responses": {
  6789. "200": {
  6790. "description": "Successfully updated part",
  6791. "content": {
  6792. "application/json": {
  6793. "schema": {
  6794. "$ref": "#/components/schemas/Part"
  6795. }
  6796. }
  6797. }
  6798. },
  6799. "400": {
  6800. "description": "Bad request",
  6801. "content": {
  6802. "application/json": {
  6803. "schema": {
  6804. "$ref": "#/components/schemas/BadRequestError"
  6805. }
  6806. }
  6807. }
  6808. },
  6809. "404": {
  6810. "description": "Not found",
  6811. "content": {
  6812. "application/json": {
  6813. "schema": {
  6814. "$ref": "#/components/schemas/NotFoundError"
  6815. }
  6816. }
  6817. }
  6818. }
  6819. },
  6820. "description": "Update a part in a message.",
  6821. "requestBody": {
  6822. "content": {
  6823. "application/json": {
  6824. "schema": {
  6825. "$ref": "#/components/schemas/Part"
  6826. }
  6827. }
  6828. }
  6829. },
  6830. "x-codeSamples": [
  6831. {
  6832. "lang": "js",
  6833. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.part.update({\n ...\n})"
  6834. }
  6835. ]
  6836. }
  6837. },
  6838. "/sync/start": {
  6839. "post": {
  6840. "tags": ["sync"],
  6841. "operationId": "sync.start",
  6842. "parameters": [
  6843. {
  6844. "name": "directory",
  6845. "in": "query",
  6846. "required": false,
  6847. "schema": {
  6848. "type": "string"
  6849. }
  6850. },
  6851. {
  6852. "name": "workspace",
  6853. "in": "query",
  6854. "required": false,
  6855. "schema": {
  6856. "type": "string"
  6857. }
  6858. }
  6859. ],
  6860. "responses": {
  6861. "200": {
  6862. "description": "Workspace sync started",
  6863. "content": {
  6864. "application/json": {
  6865. "schema": {
  6866. "type": "boolean",
  6867. "description": "Workspace sync started"
  6868. }
  6869. }
  6870. }
  6871. }
  6872. },
  6873. "description": "Start sync loops for workspaces in the current project that have active sessions.",
  6874. "summary": "Start workspace sync",
  6875. "x-codeSamples": [
  6876. {
  6877. "lang": "js",
  6878. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.sync.start({\n ...\n})"
  6879. }
  6880. ]
  6881. }
  6882. },
  6883. "/sync/replay": {
  6884. "post": {
  6885. "tags": ["sync"],
  6886. "operationId": "sync.replay",
  6887. "parameters": [
  6888. {
  6889. "name": "directory",
  6890. "in": "query",
  6891. "required": false,
  6892. "schema": {
  6893. "type": "string"
  6894. }
  6895. },
  6896. {
  6897. "name": "workspace",
  6898. "in": "query",
  6899. "required": false,
  6900. "schema": {
  6901. "type": "string"
  6902. }
  6903. }
  6904. ],
  6905. "responses": {
  6906. "200": {
  6907. "description": "Replayed sync events",
  6908. "content": {
  6909. "application/json": {
  6910. "schema": {
  6911. "type": "object",
  6912. "properties": {
  6913. "sessionID": {
  6914. "type": "string"
  6915. }
  6916. },
  6917. "required": ["sessionID"],
  6918. "additionalProperties": false,
  6919. "description": "Replayed sync events"
  6920. }
  6921. }
  6922. }
  6923. },
  6924. "400": {
  6925. "description": "Bad request",
  6926. "content": {
  6927. "application/json": {
  6928. "schema": {
  6929. "$ref": "#/components/schemas/BadRequestError"
  6930. }
  6931. }
  6932. }
  6933. }
  6934. },
  6935. "description": "Validate and replay a complete sync event history.",
  6936. "summary": "Replay sync events",
  6937. "requestBody": {
  6938. "content": {
  6939. "application/json": {
  6940. "schema": {
  6941. "type": "object",
  6942. "properties": {
  6943. "directory": {
  6944. "type": "string"
  6945. },
  6946. "events": {
  6947. "type": "array",
  6948. "minItems": 1,
  6949. "items": {
  6950. "type": "object",
  6951. "properties": {
  6952. "id": {
  6953. "type": "string"
  6954. },
  6955. "aggregateID": {
  6956. "type": "string"
  6957. },
  6958. "seq": {
  6959. "type": "integer",
  6960. "minimum": 0
  6961. },
  6962. "type": {
  6963. "type": "string"
  6964. },
  6965. "data": {
  6966. "type": "object"
  6967. }
  6968. },
  6969. "required": ["id", "aggregateID", "seq", "type", "data"],
  6970. "additionalProperties": false
  6971. }
  6972. }
  6973. },
  6974. "required": ["directory", "events"],
  6975. "additionalProperties": false
  6976. }
  6977. }
  6978. }
  6979. },
  6980. "x-codeSamples": [
  6981. {
  6982. "lang": "js",
  6983. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.sync.replay({\n ...\n})"
  6984. }
  6985. ]
  6986. }
  6987. },
  6988. "/sync/steal": {
  6989. "post": {
  6990. "tags": ["sync"],
  6991. "operationId": "sync.steal",
  6992. "parameters": [
  6993. {
  6994. "name": "directory",
  6995. "in": "query",
  6996. "required": false,
  6997. "schema": {
  6998. "type": "string"
  6999. }
  7000. },
  7001. {
  7002. "name": "workspace",
  7003. "in": "query",
  7004. "required": false,
  7005. "schema": {
  7006. "type": "string"
  7007. }
  7008. }
  7009. ],
  7010. "responses": {
  7011. "200": {
  7012. "description": "Session stolen into workspace",
  7013. "content": {
  7014. "application/json": {
  7015. "schema": {
  7016. "type": "object",
  7017. "properties": {
  7018. "sessionID": {
  7019. "type": "string"
  7020. }
  7021. },
  7022. "required": ["sessionID"],
  7023. "additionalProperties": false,
  7024. "description": "Session stolen into workspace"
  7025. }
  7026. }
  7027. }
  7028. },
  7029. "400": {
  7030. "description": "Bad request",
  7031. "content": {
  7032. "application/json": {
  7033. "schema": {
  7034. "$ref": "#/components/schemas/BadRequestError"
  7035. }
  7036. }
  7037. }
  7038. }
  7039. },
  7040. "description": "Update a session to belong to the current workspace through the sync event system.",
  7041. "summary": "Steal session into workspace",
  7042. "requestBody": {
  7043. "content": {
  7044. "application/json": {
  7045. "schema": {
  7046. "type": "object",
  7047. "properties": {
  7048. "sessionID": {
  7049. "type": "string"
  7050. }
  7051. },
  7052. "required": ["sessionID"],
  7053. "additionalProperties": false
  7054. }
  7055. }
  7056. }
  7057. },
  7058. "x-codeSamples": [
  7059. {
  7060. "lang": "js",
  7061. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.sync.steal({\n ...\n})"
  7062. }
  7063. ]
  7064. }
  7065. },
  7066. "/sync/history": {
  7067. "post": {
  7068. "tags": ["sync"],
  7069. "operationId": "sync.history.list",
  7070. "parameters": [
  7071. {
  7072. "name": "directory",
  7073. "in": "query",
  7074. "required": false,
  7075. "schema": {
  7076. "type": "string"
  7077. }
  7078. },
  7079. {
  7080. "name": "workspace",
  7081. "in": "query",
  7082. "required": false,
  7083. "schema": {
  7084. "type": "string"
  7085. }
  7086. }
  7087. ],
  7088. "responses": {
  7089. "200": {
  7090. "description": "Sync events",
  7091. "content": {
  7092. "application/json": {
  7093. "schema": {
  7094. "type": "array",
  7095. "items": {
  7096. "type": "object",
  7097. "properties": {
  7098. "id": {
  7099. "type": "string"
  7100. },
  7101. "aggregate_id": {
  7102. "type": "string"
  7103. },
  7104. "seq": {
  7105. "type": "integer",
  7106. "minimum": 0
  7107. },
  7108. "type": {
  7109. "type": "string"
  7110. },
  7111. "data": {
  7112. "type": "object"
  7113. }
  7114. },
  7115. "required": ["id", "aggregate_id", "seq", "type", "data"],
  7116. "additionalProperties": false
  7117. },
  7118. "description": "Sync events"
  7119. }
  7120. }
  7121. }
  7122. },
  7123. "400": {
  7124. "description": "Bad request",
  7125. "content": {
  7126. "application/json": {
  7127. "schema": {
  7128. "$ref": "#/components/schemas/BadRequestError"
  7129. }
  7130. }
  7131. }
  7132. }
  7133. },
  7134. "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.",
  7135. "summary": "List sync events",
  7136. "requestBody": {
  7137. "content": {
  7138. "application/json": {
  7139. "schema": {
  7140. "type": "object",
  7141. "additionalProperties": {
  7142. "type": "integer",
  7143. "minimum": 0
  7144. }
  7145. }
  7146. }
  7147. }
  7148. },
  7149. "x-codeSamples": [
  7150. {
  7151. "lang": "js",
  7152. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.sync.history.list({\n ...\n})"
  7153. }
  7154. ]
  7155. }
  7156. },
  7157. "/api/session": {
  7158. "get": {
  7159. "tags": ["v2"],
  7160. "operationId": "v2.session.list",
  7161. "parameters": [
  7162. {
  7163. "name": "directory",
  7164. "in": "query",
  7165. "required": false,
  7166. "schema": {
  7167. "type": "string"
  7168. }
  7169. },
  7170. {
  7171. "name": "workspace",
  7172. "in": "query",
  7173. "required": false,
  7174. "schema": {
  7175. "type": "string"
  7176. }
  7177. }
  7178. ],
  7179. "responses": {
  7180. "200": {
  7181. "description": "V2SessionsResponse",
  7182. "content": {
  7183. "application/json": {
  7184. "schema": {
  7185. "$ref": "#/components/schemas/V2SessionsResponse"
  7186. }
  7187. }
  7188. }
  7189. },
  7190. "400": {
  7191. "description": "Bad request",
  7192. "content": {
  7193. "application/json": {
  7194. "schema": {
  7195. "$ref": "#/components/schemas/BadRequestError"
  7196. }
  7197. }
  7198. }
  7199. }
  7200. },
  7201. "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.",
  7202. "summary": "List v2 sessions",
  7203. "x-codeSamples": [
  7204. {
  7205. "lang": "js",
  7206. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.list({\n ...\n})"
  7207. }
  7208. ]
  7209. }
  7210. },
  7211. "/api/session/{sessionID}/prompt": {
  7212. "post": {
  7213. "tags": ["v2"],
  7214. "operationId": "v2.session.prompt",
  7215. "parameters": [
  7216. {
  7217. "name": "directory",
  7218. "in": "query",
  7219. "required": false,
  7220. "schema": {
  7221. "type": "string"
  7222. }
  7223. },
  7224. {
  7225. "name": "workspace",
  7226. "in": "query",
  7227. "required": false,
  7228. "schema": {
  7229. "type": "string"
  7230. }
  7231. },
  7232. {
  7233. "name": "sessionID",
  7234. "in": "path",
  7235. "schema": {
  7236. "type": "string",
  7237. "pattern": "^ses.*"
  7238. },
  7239. "required": true
  7240. }
  7241. ],
  7242. "responses": {
  7243. "200": {
  7244. "description": "Session.Message",
  7245. "content": {
  7246. "application/json": {
  7247. "schema": {
  7248. "$ref": "#/components/schemas/SessionMessage"
  7249. }
  7250. }
  7251. }
  7252. }
  7253. },
  7254. "description": "Create a v2 session message and queue it for the agent loop.",
  7255. "summary": "Send v2 message",
  7256. "requestBody": {
  7257. "content": {
  7258. "application/json": {
  7259. "schema": {
  7260. "type": "object",
  7261. "properties": {
  7262. "prompt": {
  7263. "$ref": "#/components/schemas/Prompt"
  7264. },
  7265. "delivery": {
  7266. "$ref": "#/components/schemas/SessionDelivery"
  7267. }
  7268. },
  7269. "required": ["prompt"],
  7270. "additionalProperties": false
  7271. }
  7272. }
  7273. }
  7274. },
  7275. "x-codeSamples": [
  7276. {
  7277. "lang": "js",
  7278. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.prompt({\n ...\n})"
  7279. }
  7280. ]
  7281. }
  7282. },
  7283. "/api/session/{sessionID}/compact": {
  7284. "post": {
  7285. "tags": ["v2"],
  7286. "operationId": "v2.session.compact",
  7287. "parameters": [
  7288. {
  7289. "name": "directory",
  7290. "in": "query",
  7291. "required": false,
  7292. "schema": {
  7293. "type": "string"
  7294. }
  7295. },
  7296. {
  7297. "name": "workspace",
  7298. "in": "query",
  7299. "required": false,
  7300. "schema": {
  7301. "type": "string"
  7302. }
  7303. },
  7304. {
  7305. "name": "sessionID",
  7306. "in": "path",
  7307. "schema": {
  7308. "type": "string",
  7309. "pattern": "^ses.*"
  7310. },
  7311. "required": true
  7312. }
  7313. ],
  7314. "responses": {
  7315. "204": {
  7316. "description": "<No Content>"
  7317. }
  7318. },
  7319. "description": "Compact a v2 session conversation.",
  7320. "summary": "Compact v2 session",
  7321. "x-codeSamples": [
  7322. {
  7323. "lang": "js",
  7324. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.compact({\n ...\n})"
  7325. }
  7326. ]
  7327. }
  7328. },
  7329. "/api/session/{sessionID}/wait": {
  7330. "post": {
  7331. "tags": ["v2"],
  7332. "operationId": "v2.session.wait",
  7333. "parameters": [
  7334. {
  7335. "name": "directory",
  7336. "in": "query",
  7337. "required": false,
  7338. "schema": {
  7339. "type": "string"
  7340. }
  7341. },
  7342. {
  7343. "name": "workspace",
  7344. "in": "query",
  7345. "required": false,
  7346. "schema": {
  7347. "type": "string"
  7348. }
  7349. },
  7350. {
  7351. "name": "sessionID",
  7352. "in": "path",
  7353. "schema": {
  7354. "type": "string",
  7355. "pattern": "^ses.*"
  7356. },
  7357. "required": true
  7358. }
  7359. ],
  7360. "responses": {
  7361. "204": {
  7362. "description": "<No Content>"
  7363. }
  7364. },
  7365. "description": "Wait for a v2 session agent loop to become idle.",
  7366. "summary": "Wait for v2 session",
  7367. "x-codeSamples": [
  7368. {
  7369. "lang": "js",
  7370. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.wait({\n ...\n})"
  7371. }
  7372. ]
  7373. }
  7374. },
  7375. "/api/session/{sessionID}/context": {
  7376. "get": {
  7377. "tags": ["v2"],
  7378. "operationId": "v2.session.context",
  7379. "parameters": [
  7380. {
  7381. "name": "directory",
  7382. "in": "query",
  7383. "required": false,
  7384. "schema": {
  7385. "type": "string"
  7386. }
  7387. },
  7388. {
  7389. "name": "workspace",
  7390. "in": "query",
  7391. "required": false,
  7392. "schema": {
  7393. "type": "string"
  7394. }
  7395. },
  7396. {
  7397. "name": "sessionID",
  7398. "in": "path",
  7399. "schema": {
  7400. "type": "string",
  7401. "pattern": "^ses.*"
  7402. },
  7403. "required": true
  7404. }
  7405. ],
  7406. "responses": {
  7407. "200": {
  7408. "description": "Success",
  7409. "content": {
  7410. "application/json": {
  7411. "schema": {
  7412. "type": "array",
  7413. "items": {
  7414. "$ref": "#/components/schemas/SessionMessage"
  7415. }
  7416. }
  7417. }
  7418. }
  7419. }
  7420. },
  7421. "description": "Retrieve the active context messages for a v2 session (all messages after the last compaction).",
  7422. "summary": "Get v2 session context",
  7423. "x-codeSamples": [
  7424. {
  7425. "lang": "js",
  7426. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.context({\n ...\n})"
  7427. }
  7428. ]
  7429. }
  7430. },
  7431. "/api/session/{sessionID}/message": {
  7432. "get": {
  7433. "tags": ["v2 messages"],
  7434. "operationId": "v2.session.messages",
  7435. "parameters": [
  7436. {
  7437. "name": "directory",
  7438. "in": "query",
  7439. "required": false,
  7440. "schema": {
  7441. "type": "string"
  7442. }
  7443. },
  7444. {
  7445. "name": "workspace",
  7446. "in": "query",
  7447. "required": false,
  7448. "schema": {
  7449. "type": "string"
  7450. }
  7451. },
  7452. {
  7453. "name": "sessionID",
  7454. "in": "path",
  7455. "schema": {
  7456. "type": "string",
  7457. "pattern": "^ses.*"
  7458. },
  7459. "required": true
  7460. }
  7461. ],
  7462. "responses": {
  7463. "200": {
  7464. "description": "V2SessionMessagesResponse",
  7465. "content": {
  7466. "application/json": {
  7467. "schema": {
  7468. "$ref": "#/components/schemas/V2SessionMessagesResponse"
  7469. }
  7470. }
  7471. }
  7472. },
  7473. "400": {
  7474. "description": "Bad request",
  7475. "content": {
  7476. "application/json": {
  7477. "schema": {
  7478. "$ref": "#/components/schemas/BadRequestError"
  7479. }
  7480. }
  7481. }
  7482. }
  7483. },
  7484. "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.",
  7485. "summary": "Get v2 session messages",
  7486. "x-codeSamples": [
  7487. {
  7488. "lang": "js",
  7489. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.messages({\n ...\n})"
  7490. }
  7491. ]
  7492. }
  7493. },
  7494. "/tui/append-prompt": {
  7495. "post": {
  7496. "tags": ["tui"],
  7497. "operationId": "tui.appendPrompt",
  7498. "parameters": [
  7499. {
  7500. "name": "directory",
  7501. "in": "query",
  7502. "required": false,
  7503. "schema": {
  7504. "type": "string"
  7505. }
  7506. },
  7507. {
  7508. "name": "workspace",
  7509. "in": "query",
  7510. "required": false,
  7511. "schema": {
  7512. "type": "string"
  7513. }
  7514. }
  7515. ],
  7516. "responses": {
  7517. "200": {
  7518. "description": "Prompt processed successfully",
  7519. "content": {
  7520. "application/json": {
  7521. "schema": {
  7522. "type": "boolean",
  7523. "description": "Prompt processed successfully"
  7524. }
  7525. }
  7526. }
  7527. },
  7528. "400": {
  7529. "description": "Bad request",
  7530. "content": {
  7531. "application/json": {
  7532. "schema": {
  7533. "$ref": "#/components/schemas/BadRequestError"
  7534. }
  7535. }
  7536. }
  7537. }
  7538. },
  7539. "description": "Append prompt to the TUI.",
  7540. "summary": "Append TUI prompt",
  7541. "requestBody": {
  7542. "content": {
  7543. "application/json": {
  7544. "schema": {
  7545. "type": "object",
  7546. "properties": {
  7547. "text": {
  7548. "type": "string"
  7549. }
  7550. },
  7551. "required": ["text"],
  7552. "additionalProperties": false
  7553. }
  7554. }
  7555. }
  7556. },
  7557. "x-codeSamples": [
  7558. {
  7559. "lang": "js",
  7560. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.appendPrompt({\n ...\n})"
  7561. }
  7562. ]
  7563. }
  7564. },
  7565. "/tui/open-help": {
  7566. "post": {
  7567. "tags": ["tui"],
  7568. "operationId": "tui.openHelp",
  7569. "parameters": [
  7570. {
  7571. "name": "directory",
  7572. "in": "query",
  7573. "required": false,
  7574. "schema": {
  7575. "type": "string"
  7576. }
  7577. },
  7578. {
  7579. "name": "workspace",
  7580. "in": "query",
  7581. "required": false,
  7582. "schema": {
  7583. "type": "string"
  7584. }
  7585. }
  7586. ],
  7587. "responses": {
  7588. "200": {
  7589. "description": "Help dialog opened successfully",
  7590. "content": {
  7591. "application/json": {
  7592. "schema": {
  7593. "type": "boolean",
  7594. "description": "Help dialog opened successfully"
  7595. }
  7596. }
  7597. }
  7598. }
  7599. },
  7600. "description": "Open the help dialog in the TUI to display user assistance information.",
  7601. "summary": "Open help dialog",
  7602. "x-codeSamples": [
  7603. {
  7604. "lang": "js",
  7605. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openHelp({\n ...\n})"
  7606. }
  7607. ]
  7608. }
  7609. },
  7610. "/tui/open-sessions": {
  7611. "post": {
  7612. "tags": ["tui"],
  7613. "operationId": "tui.openSessions",
  7614. "parameters": [
  7615. {
  7616. "name": "directory",
  7617. "in": "query",
  7618. "required": false,
  7619. "schema": {
  7620. "type": "string"
  7621. }
  7622. },
  7623. {
  7624. "name": "workspace",
  7625. "in": "query",
  7626. "required": false,
  7627. "schema": {
  7628. "type": "string"
  7629. }
  7630. }
  7631. ],
  7632. "responses": {
  7633. "200": {
  7634. "description": "Session dialog opened successfully",
  7635. "content": {
  7636. "application/json": {
  7637. "schema": {
  7638. "type": "boolean",
  7639. "description": "Session dialog opened successfully"
  7640. }
  7641. }
  7642. }
  7643. }
  7644. },
  7645. "description": "Open the session dialog.",
  7646. "summary": "Open sessions dialog",
  7647. "x-codeSamples": [
  7648. {
  7649. "lang": "js",
  7650. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openSessions({\n ...\n})"
  7651. }
  7652. ]
  7653. }
  7654. },
  7655. "/tui/open-themes": {
  7656. "post": {
  7657. "tags": ["tui"],
  7658. "operationId": "tui.openThemes",
  7659. "parameters": [
  7660. {
  7661. "name": "directory",
  7662. "in": "query",
  7663. "required": false,
  7664. "schema": {
  7665. "type": "string"
  7666. }
  7667. },
  7668. {
  7669. "name": "workspace",
  7670. "in": "query",
  7671. "required": false,
  7672. "schema": {
  7673. "type": "string"
  7674. }
  7675. }
  7676. ],
  7677. "responses": {
  7678. "200": {
  7679. "description": "Theme dialog opened successfully",
  7680. "content": {
  7681. "application/json": {
  7682. "schema": {
  7683. "type": "boolean",
  7684. "description": "Theme dialog opened successfully"
  7685. }
  7686. }
  7687. }
  7688. }
  7689. },
  7690. "description": "Open the theme dialog.",
  7691. "summary": "Open themes dialog",
  7692. "x-codeSamples": [
  7693. {
  7694. "lang": "js",
  7695. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openThemes({\n ...\n})"
  7696. }
  7697. ]
  7698. }
  7699. },
  7700. "/tui/open-models": {
  7701. "post": {
  7702. "tags": ["tui"],
  7703. "operationId": "tui.openModels",
  7704. "parameters": [
  7705. {
  7706. "name": "directory",
  7707. "in": "query",
  7708. "required": false,
  7709. "schema": {
  7710. "type": "string"
  7711. }
  7712. },
  7713. {
  7714. "name": "workspace",
  7715. "in": "query",
  7716. "required": false,
  7717. "schema": {
  7718. "type": "string"
  7719. }
  7720. }
  7721. ],
  7722. "responses": {
  7723. "200": {
  7724. "description": "Model dialog opened successfully",
  7725. "content": {
  7726. "application/json": {
  7727. "schema": {
  7728. "type": "boolean",
  7729. "description": "Model dialog opened successfully"
  7730. }
  7731. }
  7732. }
  7733. }
  7734. },
  7735. "description": "Open the model dialog.",
  7736. "summary": "Open models dialog",
  7737. "x-codeSamples": [
  7738. {
  7739. "lang": "js",
  7740. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openModels({\n ...\n})"
  7741. }
  7742. ]
  7743. }
  7744. },
  7745. "/tui/submit-prompt": {
  7746. "post": {
  7747. "tags": ["tui"],
  7748. "operationId": "tui.submitPrompt",
  7749. "parameters": [
  7750. {
  7751. "name": "directory",
  7752. "in": "query",
  7753. "required": false,
  7754. "schema": {
  7755. "type": "string"
  7756. }
  7757. },
  7758. {
  7759. "name": "workspace",
  7760. "in": "query",
  7761. "required": false,
  7762. "schema": {
  7763. "type": "string"
  7764. }
  7765. }
  7766. ],
  7767. "responses": {
  7768. "200": {
  7769. "description": "Prompt submitted successfully",
  7770. "content": {
  7771. "application/json": {
  7772. "schema": {
  7773. "type": "boolean",
  7774. "description": "Prompt submitted successfully"
  7775. }
  7776. }
  7777. }
  7778. }
  7779. },
  7780. "description": "Submit the prompt.",
  7781. "summary": "Submit TUI prompt",
  7782. "x-codeSamples": [
  7783. {
  7784. "lang": "js",
  7785. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.submitPrompt({\n ...\n})"
  7786. }
  7787. ]
  7788. }
  7789. },
  7790. "/tui/clear-prompt": {
  7791. "post": {
  7792. "tags": ["tui"],
  7793. "operationId": "tui.clearPrompt",
  7794. "parameters": [
  7795. {
  7796. "name": "directory",
  7797. "in": "query",
  7798. "required": false,
  7799. "schema": {
  7800. "type": "string"
  7801. }
  7802. },
  7803. {
  7804. "name": "workspace",
  7805. "in": "query",
  7806. "required": false,
  7807. "schema": {
  7808. "type": "string"
  7809. }
  7810. }
  7811. ],
  7812. "responses": {
  7813. "200": {
  7814. "description": "Prompt cleared successfully",
  7815. "content": {
  7816. "application/json": {
  7817. "schema": {
  7818. "type": "boolean",
  7819. "description": "Prompt cleared successfully"
  7820. }
  7821. }
  7822. }
  7823. }
  7824. },
  7825. "description": "Clear the prompt.",
  7826. "summary": "Clear TUI prompt",
  7827. "x-codeSamples": [
  7828. {
  7829. "lang": "js",
  7830. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.clearPrompt({\n ...\n})"
  7831. }
  7832. ]
  7833. }
  7834. },
  7835. "/tui/execute-command": {
  7836. "post": {
  7837. "tags": ["tui"],
  7838. "operationId": "tui.executeCommand",
  7839. "parameters": [
  7840. {
  7841. "name": "directory",
  7842. "in": "query",
  7843. "required": false,
  7844. "schema": {
  7845. "type": "string"
  7846. }
  7847. },
  7848. {
  7849. "name": "workspace",
  7850. "in": "query",
  7851. "required": false,
  7852. "schema": {
  7853. "type": "string"
  7854. }
  7855. }
  7856. ],
  7857. "responses": {
  7858. "200": {
  7859. "description": "Command executed successfully",
  7860. "content": {
  7861. "application/json": {
  7862. "schema": {
  7863. "type": "boolean",
  7864. "description": "Command executed successfully"
  7865. }
  7866. }
  7867. }
  7868. },
  7869. "400": {
  7870. "description": "Bad request",
  7871. "content": {
  7872. "application/json": {
  7873. "schema": {
  7874. "$ref": "#/components/schemas/BadRequestError"
  7875. }
  7876. }
  7877. }
  7878. }
  7879. },
  7880. "description": "Execute a TUI command.",
  7881. "summary": "Execute TUI command",
  7882. "requestBody": {
  7883. "content": {
  7884. "application/json": {
  7885. "schema": {
  7886. "type": "object",
  7887. "properties": {
  7888. "command": {
  7889. "type": "string"
  7890. }
  7891. },
  7892. "required": ["command"],
  7893. "additionalProperties": false
  7894. }
  7895. }
  7896. }
  7897. },
  7898. "x-codeSamples": [
  7899. {
  7900. "lang": "js",
  7901. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.executeCommand({\n ...\n})"
  7902. }
  7903. ]
  7904. }
  7905. },
  7906. "/tui/show-toast": {
  7907. "post": {
  7908. "tags": ["tui"],
  7909. "operationId": "tui.showToast",
  7910. "parameters": [
  7911. {
  7912. "name": "directory",
  7913. "in": "query",
  7914. "required": false,
  7915. "schema": {
  7916. "type": "string"
  7917. }
  7918. },
  7919. {
  7920. "name": "workspace",
  7921. "in": "query",
  7922. "required": false,
  7923. "schema": {
  7924. "type": "string"
  7925. }
  7926. }
  7927. ],
  7928. "responses": {
  7929. "200": {
  7930. "description": "Toast notification shown successfully",
  7931. "content": {
  7932. "application/json": {
  7933. "schema": {
  7934. "type": "boolean",
  7935. "description": "Toast notification shown successfully"
  7936. }
  7937. }
  7938. }
  7939. }
  7940. },
  7941. "description": "Show a toast notification in the TUI.",
  7942. "summary": "Show TUI toast",
  7943. "requestBody": {
  7944. "content": {
  7945. "application/json": {
  7946. "schema": {
  7947. "type": "object",
  7948. "properties": {
  7949. "title": {
  7950. "type": "string"
  7951. },
  7952. "message": {
  7953. "type": "string"
  7954. },
  7955. "variant": {
  7956. "type": "string",
  7957. "enum": ["info", "success", "warning", "error"]
  7958. },
  7959. "duration": {
  7960. "type": "integer",
  7961. "exclusiveMinimum": 0
  7962. }
  7963. },
  7964. "required": ["message", "variant"],
  7965. "additionalProperties": false
  7966. }
  7967. }
  7968. }
  7969. },
  7970. "x-codeSamples": [
  7971. {
  7972. "lang": "js",
  7973. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.showToast({\n ...\n})"
  7974. }
  7975. ]
  7976. }
  7977. },
  7978. "/tui/publish": {
  7979. "post": {
  7980. "tags": ["tui"],
  7981. "operationId": "tui.publish",
  7982. "parameters": [
  7983. {
  7984. "name": "directory",
  7985. "in": "query",
  7986. "required": false,
  7987. "schema": {
  7988. "type": "string"
  7989. }
  7990. },
  7991. {
  7992. "name": "workspace",
  7993. "in": "query",
  7994. "required": false,
  7995. "schema": {
  7996. "type": "string"
  7997. }
  7998. }
  7999. ],
  8000. "responses": {
  8001. "200": {
  8002. "description": "Event published successfully",
  8003. "content": {
  8004. "application/json": {
  8005. "schema": {
  8006. "type": "boolean",
  8007. "description": "Event published successfully"
  8008. }
  8009. }
  8010. }
  8011. },
  8012. "400": {
  8013. "description": "Bad request",
  8014. "content": {
  8015. "application/json": {
  8016. "schema": {
  8017. "$ref": "#/components/schemas/BadRequestError"
  8018. }
  8019. }
  8020. }
  8021. }
  8022. },
  8023. "description": "Publish a TUI event.",
  8024. "summary": "Publish TUI event",
  8025. "requestBody": {
  8026. "content": {
  8027. "application/json": {
  8028. "schema": {
  8029. "anyOf": [
  8030. {
  8031. "$ref": "#/components/schemas/EventTuiPromptAppend"
  8032. },
  8033. {
  8034. "$ref": "#/components/schemas/EventTuiCommandExecute"
  8035. },
  8036. {
  8037. "$ref": "#/components/schemas/EventTuiToastShow"
  8038. },
  8039. {
  8040. "$ref": "#/components/schemas/EventTuiSessionSelect"
  8041. }
  8042. ]
  8043. }
  8044. }
  8045. }
  8046. },
  8047. "x-codeSamples": [
  8048. {
  8049. "lang": "js",
  8050. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.publish({\n ...\n})"
  8051. }
  8052. ]
  8053. }
  8054. },
  8055. "/tui/select-session": {
  8056. "post": {
  8057. "tags": ["tui"],
  8058. "operationId": "tui.selectSession",
  8059. "parameters": [
  8060. {
  8061. "name": "directory",
  8062. "in": "query",
  8063. "required": false,
  8064. "schema": {
  8065. "type": "string"
  8066. }
  8067. },
  8068. {
  8069. "name": "workspace",
  8070. "in": "query",
  8071. "required": false,
  8072. "schema": {
  8073. "type": "string"
  8074. }
  8075. }
  8076. ],
  8077. "responses": {
  8078. "200": {
  8079. "description": "Session selected successfully",
  8080. "content": {
  8081. "application/json": {
  8082. "schema": {
  8083. "type": "boolean",
  8084. "description": "Session selected successfully"
  8085. }
  8086. }
  8087. }
  8088. },
  8089. "400": {
  8090. "description": "Bad request",
  8091. "content": {
  8092. "application/json": {
  8093. "schema": {
  8094. "$ref": "#/components/schemas/BadRequestError"
  8095. }
  8096. }
  8097. }
  8098. },
  8099. "404": {
  8100. "description": "NotFoundError",
  8101. "content": {
  8102. "application/json": {
  8103. "schema": {
  8104. "$ref": "#/components/schemas/NotFoundError"
  8105. }
  8106. }
  8107. }
  8108. }
  8109. },
  8110. "description": "Navigate the TUI to display the specified session.",
  8111. "summary": "Select session",
  8112. "requestBody": {
  8113. "content": {
  8114. "application/json": {
  8115. "schema": {
  8116. "type": "object",
  8117. "properties": {
  8118. "sessionID": {
  8119. "type": "string",
  8120. "description": "Session ID to navigate to"
  8121. }
  8122. },
  8123. "required": ["sessionID"],
  8124. "additionalProperties": false
  8125. }
  8126. }
  8127. }
  8128. },
  8129. "x-codeSamples": [
  8130. {
  8131. "lang": "js",
  8132. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.selectSession({\n ...\n})"
  8133. }
  8134. ]
  8135. }
  8136. },
  8137. "/tui/control/next": {
  8138. "get": {
  8139. "tags": ["tui"],
  8140. "operationId": "tui.control.next",
  8141. "parameters": [
  8142. {
  8143. "name": "directory",
  8144. "in": "query",
  8145. "required": false,
  8146. "schema": {
  8147. "type": "string"
  8148. }
  8149. },
  8150. {
  8151. "name": "workspace",
  8152. "in": "query",
  8153. "required": false,
  8154. "schema": {
  8155. "type": "string"
  8156. }
  8157. }
  8158. ],
  8159. "responses": {
  8160. "200": {
  8161. "description": "Next TUI request",
  8162. "content": {
  8163. "application/json": {
  8164. "schema": {
  8165. "type": "object",
  8166. "properties": {
  8167. "path": {
  8168. "type": "string"
  8169. },
  8170. "body": {}
  8171. },
  8172. "required": ["path", "body"],
  8173. "additionalProperties": false,
  8174. "description": "Next TUI request"
  8175. }
  8176. }
  8177. }
  8178. }
  8179. },
  8180. "description": "Retrieve the next TUI request from the queue for processing.",
  8181. "summary": "Get next TUI request",
  8182. "x-codeSamples": [
  8183. {
  8184. "lang": "js",
  8185. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.control.next({\n ...\n})"
  8186. }
  8187. ]
  8188. }
  8189. },
  8190. "/tui/control/response": {
  8191. "post": {
  8192. "tags": ["tui"],
  8193. "operationId": "tui.control.response",
  8194. "parameters": [
  8195. {
  8196. "name": "directory",
  8197. "in": "query",
  8198. "required": false,
  8199. "schema": {
  8200. "type": "string"
  8201. }
  8202. },
  8203. {
  8204. "name": "workspace",
  8205. "in": "query",
  8206. "required": false,
  8207. "schema": {
  8208. "type": "string"
  8209. }
  8210. }
  8211. ],
  8212. "responses": {
  8213. "200": {
  8214. "description": "Response submitted successfully",
  8215. "content": {
  8216. "application/json": {
  8217. "schema": {
  8218. "type": "boolean",
  8219. "description": "Response submitted successfully"
  8220. }
  8221. }
  8222. }
  8223. }
  8224. },
  8225. "description": "Submit a response to the TUI request queue to complete a pending request.",
  8226. "summary": "Submit TUI response",
  8227. "requestBody": {
  8228. "content": {
  8229. "application/json": {
  8230. "schema": {}
  8231. }
  8232. }
  8233. },
  8234. "x-codeSamples": [
  8235. {
  8236. "lang": "js",
  8237. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.control.response({\n ...\n})"
  8238. }
  8239. ]
  8240. }
  8241. },
  8242. "/experimental/workspace/adapter": {
  8243. "get": {
  8244. "tags": ["workspace"],
  8245. "operationId": "experimental.workspace.adapter.list",
  8246. "parameters": [
  8247. {
  8248. "name": "directory",
  8249. "in": "query",
  8250. "required": false,
  8251. "schema": {
  8252. "type": "string"
  8253. }
  8254. },
  8255. {
  8256. "name": "workspace",
  8257. "in": "query",
  8258. "required": false,
  8259. "schema": {
  8260. "type": "string"
  8261. }
  8262. }
  8263. ],
  8264. "responses": {
  8265. "200": {
  8266. "description": "Workspace adapters",
  8267. "content": {
  8268. "application/json": {
  8269. "schema": {
  8270. "type": "array",
  8271. "items": {
  8272. "type": "object",
  8273. "properties": {
  8274. "type": {
  8275. "type": "string"
  8276. },
  8277. "name": {
  8278. "type": "string"
  8279. },
  8280. "description": {
  8281. "type": "string"
  8282. }
  8283. },
  8284. "required": ["type", "name", "description"],
  8285. "additionalProperties": false
  8286. },
  8287. "description": "Workspace adapters"
  8288. }
  8289. }
  8290. }
  8291. }
  8292. },
  8293. "description": "List all available workspace adapters for the current project.",
  8294. "summary": "List workspace adapters",
  8295. "x-codeSamples": [
  8296. {
  8297. "lang": "js",
  8298. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.adapter.list({\n ...\n})"
  8299. }
  8300. ]
  8301. }
  8302. },
  8303. "/experimental/workspace": {
  8304. "get": {
  8305. "tags": ["workspace"],
  8306. "operationId": "experimental.workspace.list",
  8307. "parameters": [
  8308. {
  8309. "name": "directory",
  8310. "in": "query",
  8311. "required": false,
  8312. "schema": {
  8313. "type": "string"
  8314. }
  8315. },
  8316. {
  8317. "name": "workspace",
  8318. "in": "query",
  8319. "required": false,
  8320. "schema": {
  8321. "type": "string"
  8322. }
  8323. }
  8324. ],
  8325. "responses": {
  8326. "200": {
  8327. "description": "Workspaces",
  8328. "content": {
  8329. "application/json": {
  8330. "schema": {
  8331. "type": "array",
  8332. "items": {
  8333. "$ref": "#/components/schemas/Workspace"
  8334. },
  8335. "description": "Workspaces"
  8336. }
  8337. }
  8338. }
  8339. }
  8340. },
  8341. "description": "List all workspaces.",
  8342. "summary": "List workspaces",
  8343. "x-codeSamples": [
  8344. {
  8345. "lang": "js",
  8346. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.list({\n ...\n})"
  8347. }
  8348. ]
  8349. },
  8350. "post": {
  8351. "tags": ["workspace"],
  8352. "operationId": "experimental.workspace.create",
  8353. "parameters": [
  8354. {
  8355. "name": "directory",
  8356. "in": "query",
  8357. "required": false,
  8358. "schema": {
  8359. "type": "string"
  8360. }
  8361. },
  8362. {
  8363. "name": "workspace",
  8364. "in": "query",
  8365. "required": false,
  8366. "schema": {
  8367. "type": "string"
  8368. }
  8369. }
  8370. ],
  8371. "responses": {
  8372. "200": {
  8373. "description": "Workspace created",
  8374. "content": {
  8375. "application/json": {
  8376. "schema": {
  8377. "$ref": "#/components/schemas/Workspace"
  8378. }
  8379. }
  8380. }
  8381. },
  8382. "400": {
  8383. "description": "Bad request",
  8384. "content": {
  8385. "application/json": {
  8386. "schema": {
  8387. "$ref": "#/components/schemas/BadRequestError"
  8388. }
  8389. }
  8390. }
  8391. }
  8392. },
  8393. "description": "Create a workspace for the current project.",
  8394. "summary": "Create workspace",
  8395. "requestBody": {
  8396. "content": {
  8397. "application/json": {
  8398. "schema": {
  8399. "type": "object",
  8400. "properties": {
  8401. "id": {
  8402. "type": "string"
  8403. },
  8404. "type": {
  8405. "type": "string"
  8406. },
  8407. "branch": {
  8408. "anyOf": [
  8409. {
  8410. "type": "string"
  8411. },
  8412. {
  8413. "type": "null"
  8414. }
  8415. ]
  8416. },
  8417. "extra": {
  8418. "anyOf": [
  8419. {},
  8420. {
  8421. "type": "null"
  8422. }
  8423. ]
  8424. }
  8425. },
  8426. "required": ["type", "branch"],
  8427. "additionalProperties": false
  8428. }
  8429. }
  8430. }
  8431. },
  8432. "x-codeSamples": [
  8433. {
  8434. "lang": "js",
  8435. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.create({\n ...\n})"
  8436. }
  8437. ]
  8438. }
  8439. },
  8440. "/experimental/workspace/sync-list": {
  8441. "post": {
  8442. "tags": ["workspace"],
  8443. "operationId": "experimental.workspace.syncList",
  8444. "parameters": [
  8445. {
  8446. "name": "directory",
  8447. "in": "query",
  8448. "required": false,
  8449. "schema": {
  8450. "type": "string"
  8451. }
  8452. },
  8453. {
  8454. "name": "workspace",
  8455. "in": "query",
  8456. "required": false,
  8457. "schema": {
  8458. "type": "string"
  8459. }
  8460. }
  8461. ],
  8462. "responses": {
  8463. "204": {
  8464. "description": "Workspace list synced"
  8465. }
  8466. },
  8467. "description": "Register missing workspaces returned by workspace adapters.",
  8468. "summary": "Sync workspace list",
  8469. "x-codeSamples": [
  8470. {
  8471. "lang": "js",
  8472. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.syncList({\n ...\n})"
  8473. }
  8474. ]
  8475. }
  8476. },
  8477. "/experimental/workspace/status": {
  8478. "get": {
  8479. "tags": ["workspace"],
  8480. "operationId": "experimental.workspace.status",
  8481. "parameters": [
  8482. {
  8483. "name": "directory",
  8484. "in": "query",
  8485. "required": false,
  8486. "schema": {
  8487. "type": "string"
  8488. }
  8489. },
  8490. {
  8491. "name": "workspace",
  8492. "in": "query",
  8493. "required": false,
  8494. "schema": {
  8495. "type": "string"
  8496. }
  8497. }
  8498. ],
  8499. "responses": {
  8500. "200": {
  8501. "description": "Workspace status",
  8502. "content": {
  8503. "application/json": {
  8504. "schema": {
  8505. "type": "array",
  8506. "items": {
  8507. "type": "object",
  8508. "properties": {
  8509. "workspaceID": {
  8510. "type": "string"
  8511. },
  8512. "status": {
  8513. "type": "string",
  8514. "enum": ["connected", "connecting", "disconnected", "error"]
  8515. }
  8516. },
  8517. "required": ["workspaceID", "status"],
  8518. "additionalProperties": false
  8519. },
  8520. "description": "Workspace status"
  8521. }
  8522. }
  8523. }
  8524. }
  8525. },
  8526. "description": "Get connection status for workspaces in the current project.",
  8527. "summary": "Workspace status",
  8528. "x-codeSamples": [
  8529. {
  8530. "lang": "js",
  8531. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.status({\n ...\n})"
  8532. }
  8533. ]
  8534. }
  8535. },
  8536. "/experimental/workspace/{id}": {
  8537. "delete": {
  8538. "tags": ["workspace"],
  8539. "operationId": "experimental.workspace.remove",
  8540. "parameters": [
  8541. {
  8542. "name": "directory",
  8543. "in": "query",
  8544. "required": false,
  8545. "schema": {
  8546. "type": "string"
  8547. }
  8548. },
  8549. {
  8550. "name": "workspace",
  8551. "in": "query",
  8552. "required": false,
  8553. "schema": {
  8554. "type": "string"
  8555. }
  8556. },
  8557. {
  8558. "name": "id",
  8559. "in": "path",
  8560. "schema": {
  8561. "type": "string",
  8562. "pattern": "^wrk.*"
  8563. },
  8564. "required": true
  8565. }
  8566. ],
  8567. "responses": {
  8568. "200": {
  8569. "description": "Workspace removed",
  8570. "content": {
  8571. "application/json": {
  8572. "schema": {
  8573. "$ref": "#/components/schemas/Workspace"
  8574. }
  8575. }
  8576. }
  8577. },
  8578. "400": {
  8579. "description": "Bad request",
  8580. "content": {
  8581. "application/json": {
  8582. "schema": {
  8583. "$ref": "#/components/schemas/BadRequestError"
  8584. }
  8585. }
  8586. }
  8587. }
  8588. },
  8589. "description": "Remove an existing workspace.",
  8590. "summary": "Remove workspace",
  8591. "x-codeSamples": [
  8592. {
  8593. "lang": "js",
  8594. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.remove({\n ...\n})"
  8595. }
  8596. ]
  8597. }
  8598. },
  8599. "/experimental/workspace/warp": {
  8600. "post": {
  8601. "tags": ["workspace"],
  8602. "operationId": "experimental.workspace.warp",
  8603. "parameters": [
  8604. {
  8605. "name": "directory",
  8606. "in": "query",
  8607. "required": false,
  8608. "schema": {
  8609. "type": "string"
  8610. }
  8611. },
  8612. {
  8613. "name": "workspace",
  8614. "in": "query",
  8615. "required": false,
  8616. "schema": {
  8617. "type": "string"
  8618. }
  8619. }
  8620. ],
  8621. "responses": {
  8622. "204": {
  8623. "description": "Session warped"
  8624. },
  8625. "400": {
  8626. "description": "WorkspaceWarpError | VcsApplyError",
  8627. "content": {
  8628. "application/json": {
  8629. "schema": {
  8630. "anyOf": [
  8631. {
  8632. "$ref": "#/components/schemas/WorkspaceWarpError"
  8633. },
  8634. {
  8635. "$ref": "#/components/schemas/VcsApplyError"
  8636. }
  8637. ]
  8638. }
  8639. }
  8640. }
  8641. }
  8642. },
  8643. "description": "Move a session's sync history into the target workspace, or detach it to the local project.",
  8644. "summary": "Warp session into workspace",
  8645. "requestBody": {
  8646. "content": {
  8647. "application/json": {
  8648. "schema": {
  8649. "type": "object",
  8650. "properties": {
  8651. "id": {
  8652. "anyOf": [
  8653. {
  8654. "type": "string"
  8655. },
  8656. {
  8657. "type": "null"
  8658. }
  8659. ]
  8660. },
  8661. "sessionID": {
  8662. "type": "string"
  8663. },
  8664. "copyChanges": {
  8665. "type": "boolean"
  8666. }
  8667. },
  8668. "required": ["id", "sessionID"],
  8669. "additionalProperties": false
  8670. }
  8671. }
  8672. }
  8673. },
  8674. "x-codeSamples": [
  8675. {
  8676. "lang": "js",
  8677. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.warp({\n ...\n})"
  8678. }
  8679. ]
  8680. }
  8681. },
  8682. "/pty/{ptyID}/connect": {
  8683. "get": {
  8684. "tags": ["pty"],
  8685. "operationId": "pty.connect",
  8686. "parameters": [
  8687. {
  8688. "name": "directory",
  8689. "in": "query",
  8690. "required": false,
  8691. "schema": {
  8692. "type": "string"
  8693. }
  8694. },
  8695. {
  8696. "name": "workspace",
  8697. "in": "query",
  8698. "required": false,
  8699. "schema": {
  8700. "type": "string"
  8701. }
  8702. },
  8703. {
  8704. "name": "ptyID",
  8705. "in": "path",
  8706. "schema": {
  8707. "type": "string",
  8708. "pattern": "^pty.*"
  8709. },
  8710. "required": true
  8711. }
  8712. ],
  8713. "responses": {
  8714. "200": {
  8715. "description": "Connected session",
  8716. "content": {
  8717. "application/json": {
  8718. "schema": {
  8719. "type": "boolean",
  8720. "description": "Connected session"
  8721. }
  8722. }
  8723. }
  8724. },
  8725. "403": {
  8726. "description": "Forbidden",
  8727. "content": {
  8728. "application/json": {
  8729. "schema": {
  8730. "$ref": "#/components/schemas/effect_HttpApiError_Forbidden"
  8731. }
  8732. }
  8733. }
  8734. },
  8735. "404": {
  8736. "description": "Not found",
  8737. "content": {
  8738. "application/json": {
  8739. "schema": {
  8740. "$ref": "#/components/schemas/NotFoundError"
  8741. }
  8742. }
  8743. }
  8744. }
  8745. },
  8746. "description": "Establish a WebSocket connection to interact with a pseudo-terminal (PTY) session in real-time.",
  8747. "summary": "Connect to PTY session",
  8748. "x-codeSamples": [
  8749. {
  8750. "lang": "js",
  8751. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.connect({\n ...\n})"
  8752. }
  8753. ]
  8754. }
  8755. }
  8756. },
  8757. "components": {
  8758. "schemas": {
  8759. "Event": {
  8760. "anyOf": [
  8761. {
  8762. "$ref": "#/components/schemas/EventServerInstanceDisposed"
  8763. },
  8764. {
  8765. "$ref": "#/components/schemas/EventFileEdited"
  8766. },
  8767. {
  8768. "$ref": "#/components/schemas/EventFileWatcherUpdated"
  8769. },
  8770. {
  8771. "$ref": "#/components/schemas/EventLspClientDiagnostics"
  8772. },
  8773. {
  8774. "$ref": "#/components/schemas/EventLspUpdated"
  8775. },
  8776. {
  8777. "$ref": "#/components/schemas/EventMessagePartDelta"
  8778. },
  8779. {
  8780. "$ref": "#/components/schemas/EventPermissionAsked"
  8781. },
  8782. {
  8783. "$ref": "#/components/schemas/EventPermissionReplied"
  8784. },
  8785. {
  8786. "$ref": "#/components/schemas/EventSessionDiff"
  8787. },
  8788. {
  8789. "$ref": "#/components/schemas/EventSessionError"
  8790. },
  8791. {
  8792. "$ref": "#/components/schemas/EventInstallationUpdated"
  8793. },
  8794. {
  8795. "$ref": "#/components/schemas/EventInstallationUpdate-available"
  8796. },
  8797. {
  8798. "$ref": "#/components/schemas/EventQuestionAsked"
  8799. },
  8800. {
  8801. "$ref": "#/components/schemas/EventQuestionReplied"
  8802. },
  8803. {
  8804. "$ref": "#/components/schemas/EventQuestionRejected"
  8805. },
  8806. {
  8807. "$ref": "#/components/schemas/EventTodoUpdated"
  8808. },
  8809. {
  8810. "$ref": "#/components/schemas/EventSessionStatus"
  8811. },
  8812. {
  8813. "$ref": "#/components/schemas/EventSessionIdle"
  8814. },
  8815. {
  8816. "$ref": "#/components/schemas/EventSessionCompacted"
  8817. },
  8818. {
  8819. "$ref": "#/components/schemas/Event.tui.prompt.append"
  8820. },
  8821. {
  8822. "$ref": "#/components/schemas/Event.tui.command.execute"
  8823. },
  8824. {
  8825. "$ref": "#/components/schemas/EventTuiToastShow1"
  8826. },
  8827. {
  8828. "$ref": "#/components/schemas/Event.tui.session.select"
  8829. },
  8830. {
  8831. "$ref": "#/components/schemas/EventMcpToolsChanged"
  8832. },
  8833. {
  8834. "$ref": "#/components/schemas/EventMcpBrowserOpenFailed"
  8835. },
  8836. {
  8837. "$ref": "#/components/schemas/EventCommandExecuted"
  8838. },
  8839. {
  8840. "$ref": "#/components/schemas/EventProjectUpdated"
  8841. },
  8842. {
  8843. "$ref": "#/components/schemas/EventVcsBranchUpdated"
  8844. },
  8845. {
  8846. "$ref": "#/components/schemas/EventWorkspaceReady"
  8847. },
  8848. {
  8849. "$ref": "#/components/schemas/EventWorkspaceFailed"
  8850. },
  8851. {
  8852. "$ref": "#/components/schemas/EventWorkspaceStatus"
  8853. },
  8854. {
  8855. "$ref": "#/components/schemas/EventWorktreeReady"
  8856. },
  8857. {
  8858. "$ref": "#/components/schemas/EventWorktreeFailed"
  8859. },
  8860. {
  8861. "$ref": "#/components/schemas/EventPtyCreated"
  8862. },
  8863. {
  8864. "$ref": "#/components/schemas/EventPtyUpdated"
  8865. },
  8866. {
  8867. "$ref": "#/components/schemas/EventPtyExited"
  8868. },
  8869. {
  8870. "$ref": "#/components/schemas/EventPtyDeleted"
  8871. },
  8872. {
  8873. "$ref": "#/components/schemas/EventMessageUpdated"
  8874. },
  8875. {
  8876. "$ref": "#/components/schemas/EventMessageRemoved"
  8877. },
  8878. {
  8879. "$ref": "#/components/schemas/EventMessagePartUpdated"
  8880. },
  8881. {
  8882. "$ref": "#/components/schemas/EventMessagePartRemoved"
  8883. },
  8884. {
  8885. "$ref": "#/components/schemas/EventSessionCreated"
  8886. },
  8887. {
  8888. "$ref": "#/components/schemas/EventSessionUpdated"
  8889. },
  8890. {
  8891. "$ref": "#/components/schemas/EventSessionDeleted"
  8892. },
  8893. {
  8894. "$ref": "#/components/schemas/EventSessionNextAgentSwitched"
  8895. },
  8896. {
  8897. "$ref": "#/components/schemas/EventSessionNextModelSwitched"
  8898. },
  8899. {
  8900. "$ref": "#/components/schemas/EventSessionNextPrompted"
  8901. },
  8902. {
  8903. "$ref": "#/components/schemas/EventSessionNextSynthetic"
  8904. },
  8905. {
  8906. "$ref": "#/components/schemas/EventSessionNextShellStarted"
  8907. },
  8908. {
  8909. "$ref": "#/components/schemas/EventSessionNextShellEnded"
  8910. },
  8911. {
  8912. "$ref": "#/components/schemas/EventSessionNextStepStarted"
  8913. },
  8914. {
  8915. "$ref": "#/components/schemas/EventSessionNextStepEnded"
  8916. },
  8917. {
  8918. "$ref": "#/components/schemas/EventSessionNextStepFailed"
  8919. },
  8920. {
  8921. "$ref": "#/components/schemas/EventSessionNextTextStarted"
  8922. },
  8923. {
  8924. "$ref": "#/components/schemas/EventSessionNextTextDelta"
  8925. },
  8926. {
  8927. "$ref": "#/components/schemas/EventSessionNextTextEnded"
  8928. },
  8929. {
  8930. "$ref": "#/components/schemas/EventSessionNextReasoningStarted"
  8931. },
  8932. {
  8933. "$ref": "#/components/schemas/EventSessionNextReasoningDelta"
  8934. },
  8935. {
  8936. "$ref": "#/components/schemas/EventSessionNextReasoningEnded"
  8937. },
  8938. {
  8939. "$ref": "#/components/schemas/EventSessionNextToolInputStarted"
  8940. },
  8941. {
  8942. "$ref": "#/components/schemas/EventSessionNextToolInputDelta"
  8943. },
  8944. {
  8945. "$ref": "#/components/schemas/EventSessionNextToolInputEnded"
  8946. },
  8947. {
  8948. "$ref": "#/components/schemas/EventSessionNextToolCalled"
  8949. },
  8950. {
  8951. "$ref": "#/components/schemas/EventSessionNextToolProgress"
  8952. },
  8953. {
  8954. "$ref": "#/components/schemas/EventSessionNextToolSuccess"
  8955. },
  8956. {
  8957. "$ref": "#/components/schemas/EventSessionNextToolFailed"
  8958. },
  8959. {
  8960. "$ref": "#/components/schemas/EventSessionNextRetried"
  8961. },
  8962. {
  8963. "$ref": "#/components/schemas/EventSessionNextCompactionStarted"
  8964. },
  8965. {
  8966. "$ref": "#/components/schemas/EventSessionNextCompactionDelta"
  8967. },
  8968. {
  8969. "$ref": "#/components/schemas/EventSessionNextCompactionEnded"
  8970. },
  8971. {
  8972. "$ref": "#/components/schemas/EventServerConnected"
  8973. },
  8974. {
  8975. "$ref": "#/components/schemas/EventGlobalDisposed"
  8976. }
  8977. ]
  8978. },
  8979. "OAuth": {
  8980. "type": "object",
  8981. "properties": {
  8982. "type": {
  8983. "type": "string",
  8984. "enum": ["oauth"]
  8985. },
  8986. "refresh": {
  8987. "type": "string"
  8988. },
  8989. "access": {
  8990. "type": "string"
  8991. },
  8992. "expires": {
  8993. "type": "integer",
  8994. "minimum": 0
  8995. },
  8996. "accountId": {
  8997. "type": "string"
  8998. },
  8999. "enterpriseUrl": {
  9000. "type": "string"
  9001. }
  9002. },
  9003. "required": ["type", "refresh", "access", "expires"],
  9004. "additionalProperties": false
  9005. },
  9006. "ApiAuth": {
  9007. "type": "object",
  9008. "properties": {
  9009. "type": {
  9010. "type": "string",
  9011. "enum": ["api"]
  9012. },
  9013. "key": {
  9014. "type": "string"
  9015. },
  9016. "metadata": {
  9017. "type": "object",
  9018. "additionalProperties": {
  9019. "type": "string"
  9020. }
  9021. }
  9022. },
  9023. "required": ["type", "key"],
  9024. "additionalProperties": false
  9025. },
  9026. "WellKnownAuth": {
  9027. "type": "object",
  9028. "properties": {
  9029. "type": {
  9030. "type": "string",
  9031. "enum": ["wellknown"]
  9032. },
  9033. "key": {
  9034. "type": "string"
  9035. },
  9036. "token": {
  9037. "type": "string"
  9038. }
  9039. },
  9040. "required": ["type", "key", "token"],
  9041. "additionalProperties": false
  9042. },
  9043. "Auth": {
  9044. "anyOf": [
  9045. {
  9046. "$ref": "#/components/schemas/OAuth"
  9047. },
  9048. {
  9049. "$ref": "#/components/schemas/ApiAuth"
  9050. },
  9051. {
  9052. "$ref": "#/components/schemas/WellKnownAuth"
  9053. }
  9054. ]
  9055. },
  9056. "PermissionRequest": {
  9057. "type": "object",
  9058. "properties": {
  9059. "id": {
  9060. "type": "string"
  9061. },
  9062. "sessionID": {
  9063. "type": "string"
  9064. },
  9065. "permission": {
  9066. "type": "string"
  9067. },
  9068. "patterns": {
  9069. "type": "array",
  9070. "items": {
  9071. "type": "string"
  9072. }
  9073. },
  9074. "metadata": {
  9075. "type": "object"
  9076. },
  9077. "always": {
  9078. "type": "array",
  9079. "items": {
  9080. "type": "string"
  9081. }
  9082. },
  9083. "tool": {
  9084. "type": "object",
  9085. "properties": {
  9086. "messageID": {
  9087. "type": "string"
  9088. },
  9089. "callID": {
  9090. "type": "string"
  9091. }
  9092. },
  9093. "required": ["messageID", "callID"],
  9094. "additionalProperties": false
  9095. }
  9096. },
  9097. "required": ["id", "sessionID", "permission", "patterns", "metadata", "always"],
  9098. "additionalProperties": false
  9099. },
  9100. "SnapshotFileDiff": {
  9101. "type": "object",
  9102. "properties": {
  9103. "file": {
  9104. "type": "string"
  9105. },
  9106. "patch": {
  9107. "type": "string"
  9108. },
  9109. "additions": {
  9110. "type": "integer",
  9111. "minimum": 0
  9112. },
  9113. "deletions": {
  9114. "type": "integer",
  9115. "minimum": 0
  9116. },
  9117. "status": {
  9118. "type": "string",
  9119. "enum": ["added", "deleted", "modified"]
  9120. }
  9121. },
  9122. "required": ["file", "patch", "additions", "deletions"],
  9123. "additionalProperties": false
  9124. },
  9125. "ProviderAuthError": {
  9126. "type": "object",
  9127. "properties": {
  9128. "name": {
  9129. "type": "string",
  9130. "enum": ["ProviderAuthError"]
  9131. },
  9132. "data": {
  9133. "type": "object",
  9134. "properties": {
  9135. "providerID": {
  9136. "type": "string"
  9137. },
  9138. "message": {
  9139. "type": "string"
  9140. }
  9141. },
  9142. "required": ["providerID", "message"],
  9143. "additionalProperties": false
  9144. }
  9145. },
  9146. "required": ["name", "data"],
  9147. "additionalProperties": false
  9148. },
  9149. "UnknownError": {
  9150. "type": "object",
  9151. "properties": {
  9152. "name": {
  9153. "type": "string",
  9154. "enum": ["UnknownError"]
  9155. },
  9156. "data": {
  9157. "type": "object",
  9158. "properties": {
  9159. "message": {
  9160. "type": "string"
  9161. }
  9162. },
  9163. "required": ["message"],
  9164. "additionalProperties": false
  9165. }
  9166. },
  9167. "required": ["name", "data"],
  9168. "additionalProperties": false
  9169. },
  9170. "MessageOutputLengthError": {
  9171. "type": "object",
  9172. "properties": {
  9173. "name": {
  9174. "type": "string",
  9175. "enum": ["MessageOutputLengthError"]
  9176. },
  9177. "data": {
  9178. "type": "object",
  9179. "properties": {}
  9180. }
  9181. },
  9182. "required": ["name", "data"],
  9183. "additionalProperties": false
  9184. },
  9185. "MessageAbortedError": {
  9186. "type": "object",
  9187. "properties": {
  9188. "name": {
  9189. "type": "string",
  9190. "enum": ["MessageAbortedError"]
  9191. },
  9192. "data": {
  9193. "type": "object",
  9194. "properties": {
  9195. "message": {
  9196. "type": "string"
  9197. }
  9198. },
  9199. "required": ["message"],
  9200. "additionalProperties": false
  9201. }
  9202. },
  9203. "required": ["name", "data"],
  9204. "additionalProperties": false
  9205. },
  9206. "StructuredOutputError": {
  9207. "type": "object",
  9208. "properties": {
  9209. "name": {
  9210. "type": "string",
  9211. "enum": ["StructuredOutputError"]
  9212. },
  9213. "data": {
  9214. "type": "object",
  9215. "properties": {
  9216. "message": {
  9217. "type": "string"
  9218. },
  9219. "retries": {
  9220. "type": "integer",
  9221. "minimum": 0
  9222. }
  9223. },
  9224. "required": ["message", "retries"],
  9225. "additionalProperties": false
  9226. }
  9227. },
  9228. "required": ["name", "data"],
  9229. "additionalProperties": false
  9230. },
  9231. "ContextOverflowError": {
  9232. "type": "object",
  9233. "properties": {
  9234. "name": {
  9235. "type": "string",
  9236. "enum": ["ContextOverflowError"]
  9237. },
  9238. "data": {
  9239. "type": "object",
  9240. "properties": {
  9241. "message": {
  9242. "type": "string"
  9243. },
  9244. "responseBody": {
  9245. "type": "string"
  9246. }
  9247. },
  9248. "required": ["message"],
  9249. "additionalProperties": false
  9250. }
  9251. },
  9252. "required": ["name", "data"],
  9253. "additionalProperties": false
  9254. },
  9255. "APIError": {
  9256. "type": "object",
  9257. "properties": {
  9258. "name": {
  9259. "type": "string",
  9260. "enum": ["APIError"]
  9261. },
  9262. "data": {
  9263. "type": "object",
  9264. "properties": {
  9265. "message": {
  9266. "type": "string"
  9267. },
  9268. "statusCode": {
  9269. "type": "integer",
  9270. "minimum": 0
  9271. },
  9272. "isRetryable": {
  9273. "type": "boolean"
  9274. },
  9275. "responseHeaders": {
  9276. "type": "object",
  9277. "additionalProperties": {
  9278. "type": "string"
  9279. }
  9280. },
  9281. "responseBody": {
  9282. "type": "string"
  9283. },
  9284. "metadata": {
  9285. "type": "object",
  9286. "additionalProperties": {
  9287. "type": "string"
  9288. }
  9289. }
  9290. },
  9291. "required": ["message", "isRetryable"],
  9292. "additionalProperties": false
  9293. }
  9294. },
  9295. "required": ["name", "data"],
  9296. "additionalProperties": false
  9297. },
  9298. "QuestionOption": {
  9299. "type": "object",
  9300. "properties": {
  9301. "label": {
  9302. "type": "string",
  9303. "description": "Display text (1-5 words, concise)"
  9304. },
  9305. "description": {
  9306. "type": "string",
  9307. "description": "Explanation of choice"
  9308. }
  9309. },
  9310. "required": ["label", "description"],
  9311. "additionalProperties": false
  9312. },
  9313. "QuestionInfo": {
  9314. "type": "object",
  9315. "properties": {
  9316. "question": {
  9317. "type": "string",
  9318. "description": "Complete question"
  9319. },
  9320. "header": {
  9321. "type": "string",
  9322. "description": "Very short label (max 30 chars)"
  9323. },
  9324. "options": {
  9325. "type": "array",
  9326. "items": {
  9327. "$ref": "#/components/schemas/QuestionOption"
  9328. },
  9329. "description": "Available choices"
  9330. },
  9331. "multiple": {
  9332. "type": "boolean"
  9333. },
  9334. "custom": {
  9335. "type": "boolean"
  9336. }
  9337. },
  9338. "required": ["question", "header", "options"],
  9339. "additionalProperties": false
  9340. },
  9341. "QuestionTool": {
  9342. "type": "object",
  9343. "properties": {
  9344. "messageID": {
  9345. "type": "string"
  9346. },
  9347. "callID": {
  9348. "type": "string"
  9349. }
  9350. },
  9351. "required": ["messageID", "callID"],
  9352. "additionalProperties": false
  9353. },
  9354. "QuestionRequest": {
  9355. "type": "object",
  9356. "properties": {
  9357. "id": {
  9358. "type": "string"
  9359. },
  9360. "sessionID": {
  9361. "type": "string"
  9362. },
  9363. "questions": {
  9364. "type": "array",
  9365. "items": {
  9366. "$ref": "#/components/schemas/QuestionInfo"
  9367. },
  9368. "description": "Questions to ask"
  9369. },
  9370. "tool": {
  9371. "$ref": "#/components/schemas/QuestionTool"
  9372. }
  9373. },
  9374. "required": ["id", "sessionID", "questions"],
  9375. "additionalProperties": false
  9376. },
  9377. "QuestionAnswer": {
  9378. "type": "array",
  9379. "items": {
  9380. "type": "string"
  9381. }
  9382. },
  9383. "QuestionReplied": {
  9384. "type": "object",
  9385. "properties": {
  9386. "sessionID": {
  9387. "type": "string"
  9388. },
  9389. "requestID": {
  9390. "type": "string"
  9391. },
  9392. "answers": {
  9393. "type": "array",
  9394. "items": {
  9395. "$ref": "#/components/schemas/QuestionAnswer"
  9396. }
  9397. }
  9398. },
  9399. "required": ["sessionID", "requestID", "answers"],
  9400. "additionalProperties": false
  9401. },
  9402. "QuestionRejected": {
  9403. "type": "object",
  9404. "properties": {
  9405. "sessionID": {
  9406. "type": "string"
  9407. },
  9408. "requestID": {
  9409. "type": "string"
  9410. }
  9411. },
  9412. "required": ["sessionID", "requestID"],
  9413. "additionalProperties": false
  9414. },
  9415. "Todo": {
  9416. "type": "object",
  9417. "properties": {
  9418. "content": {
  9419. "type": "string",
  9420. "description": "Brief description of the task"
  9421. },
  9422. "status": {
  9423. "type": "string",
  9424. "description": "Current status of the task: pending, in_progress, completed, cancelled"
  9425. },
  9426. "priority": {
  9427. "type": "string",
  9428. "description": "Priority level of the task: high, medium, low"
  9429. }
  9430. },
  9431. "required": ["content", "status", "priority"],
  9432. "additionalProperties": false
  9433. },
  9434. "SessionStatus": {
  9435. "anyOf": [
  9436. {
  9437. "type": "object",
  9438. "properties": {
  9439. "type": {
  9440. "type": "string",
  9441. "enum": ["idle"]
  9442. }
  9443. },
  9444. "required": ["type"],
  9445. "additionalProperties": false
  9446. },
  9447. {
  9448. "type": "object",
  9449. "properties": {
  9450. "type": {
  9451. "type": "string",
  9452. "enum": ["retry"]
  9453. },
  9454. "attempt": {
  9455. "type": "integer",
  9456. "minimum": 0
  9457. },
  9458. "message": {
  9459. "type": "string"
  9460. },
  9461. "action": {
  9462. "type": "object",
  9463. "properties": {
  9464. "reason": {
  9465. "type": "string"
  9466. },
  9467. "provider": {
  9468. "type": "string"
  9469. },
  9470. "title": {
  9471. "type": "string"
  9472. },
  9473. "message": {
  9474. "type": "string"
  9475. },
  9476. "label": {
  9477. "type": "string"
  9478. },
  9479. "link": {
  9480. "type": "string"
  9481. }
  9482. },
  9483. "required": ["reason", "provider", "title", "message", "label"],
  9484. "additionalProperties": false
  9485. },
  9486. "next": {
  9487. "type": "integer",
  9488. "minimum": 0
  9489. }
  9490. },
  9491. "required": ["type", "attempt", "message", "next"],
  9492. "additionalProperties": false
  9493. },
  9494. {
  9495. "type": "object",
  9496. "properties": {
  9497. "type": {
  9498. "type": "string",
  9499. "enum": ["busy"]
  9500. }
  9501. },
  9502. "required": ["type"],
  9503. "additionalProperties": false
  9504. }
  9505. ]
  9506. },
  9507. "Event.tui.prompt.append": {
  9508. "type": "object",
  9509. "properties": {
  9510. "id": {
  9511. "type": "string"
  9512. },
  9513. "type": {
  9514. "type": "string",
  9515. "enum": ["tui.prompt.append"]
  9516. },
  9517. "properties": {
  9518. "type": "object",
  9519. "properties": {
  9520. "text": {
  9521. "type": "string"
  9522. }
  9523. },
  9524. "required": ["text"],
  9525. "additionalProperties": false
  9526. }
  9527. },
  9528. "required": ["id", "type", "properties"],
  9529. "additionalProperties": false
  9530. },
  9531. "Event.tui.command.execute": {
  9532. "type": "object",
  9533. "properties": {
  9534. "id": {
  9535. "type": "string"
  9536. },
  9537. "type": {
  9538. "type": "string",
  9539. "enum": ["tui.command.execute"]
  9540. },
  9541. "properties": {
  9542. "type": "object",
  9543. "properties": {
  9544. "command": {
  9545. "anyOf": [
  9546. {
  9547. "type": "string",
  9548. "enum": [
  9549. "session.list",
  9550. "session.new",
  9551. "session.share",
  9552. "session.interrupt",
  9553. "session.compact",
  9554. "session.page.up",
  9555. "session.page.down",
  9556. "session.line.up",
  9557. "session.line.down",
  9558. "session.half.page.up",
  9559. "session.half.page.down",
  9560. "session.first",
  9561. "session.last",
  9562. "prompt.clear",
  9563. "prompt.submit",
  9564. "agent.cycle"
  9565. ]
  9566. },
  9567. {
  9568. "type": "string"
  9569. }
  9570. ]
  9571. }
  9572. },
  9573. "required": ["command"],
  9574. "additionalProperties": false
  9575. }
  9576. },
  9577. "required": ["id", "type", "properties"],
  9578. "additionalProperties": false
  9579. },
  9580. "Event.tui.toast.show": {
  9581. "type": "object",
  9582. "properties": {
  9583. "id": {
  9584. "type": "string"
  9585. },
  9586. "type": {
  9587. "type": "string",
  9588. "enum": ["tui.toast.show"]
  9589. },
  9590. "properties": {
  9591. "type": "object",
  9592. "properties": {
  9593. "title": {
  9594. "type": "string"
  9595. },
  9596. "message": {
  9597. "type": "string"
  9598. },
  9599. "variant": {
  9600. "type": "string",
  9601. "enum": ["info", "success", "warning", "error"]
  9602. },
  9603. "duration": {
  9604. "type": "integer",
  9605. "exclusiveMinimum": 0
  9606. }
  9607. },
  9608. "required": ["message", "variant"],
  9609. "additionalProperties": false
  9610. }
  9611. },
  9612. "required": ["id", "type", "properties"],
  9613. "additionalProperties": false
  9614. },
  9615. "Event.tui.session.select": {
  9616. "type": "object",
  9617. "properties": {
  9618. "id": {
  9619. "type": "string"
  9620. },
  9621. "type": {
  9622. "type": "string",
  9623. "enum": ["tui.session.select"]
  9624. },
  9625. "properties": {
  9626. "type": "object",
  9627. "properties": {
  9628. "sessionID": {
  9629. "type": "string",
  9630. "description": "Session ID to navigate to"
  9631. }
  9632. },
  9633. "required": ["sessionID"],
  9634. "additionalProperties": false
  9635. }
  9636. },
  9637. "required": ["id", "type", "properties"],
  9638. "additionalProperties": false
  9639. },
  9640. "Project": {
  9641. "type": "object",
  9642. "properties": {
  9643. "id": {
  9644. "type": "string"
  9645. },
  9646. "worktree": {
  9647. "type": "string"
  9648. },
  9649. "vcs": {
  9650. "type": "string",
  9651. "enum": ["git"]
  9652. },
  9653. "name": {
  9654. "type": "string"
  9655. },
  9656. "icon": {
  9657. "type": "object",
  9658. "properties": {
  9659. "url": {
  9660. "type": "string"
  9661. },
  9662. "override": {
  9663. "type": "string"
  9664. },
  9665. "color": {
  9666. "type": "string"
  9667. }
  9668. },
  9669. "additionalProperties": false
  9670. },
  9671. "commands": {
  9672. "type": "object",
  9673. "properties": {
  9674. "start": {
  9675. "type": "string",
  9676. "description": "Startup script to run when creating a new workspace (worktree)"
  9677. }
  9678. },
  9679. "additionalProperties": false
  9680. },
  9681. "time": {
  9682. "type": "object",
  9683. "properties": {
  9684. "created": {
  9685. "type": "integer",
  9686. "minimum": 0
  9687. },
  9688. "updated": {
  9689. "type": "integer",
  9690. "minimum": 0
  9691. },
  9692. "initialized": {
  9693. "type": "integer",
  9694. "minimum": 0
  9695. }
  9696. },
  9697. "required": ["created", "updated"],
  9698. "additionalProperties": false
  9699. },
  9700. "sandboxes": {
  9701. "type": "array",
  9702. "items": {
  9703. "type": "string"
  9704. }
  9705. }
  9706. },
  9707. "required": ["id", "worktree", "time", "sandboxes"],
  9708. "additionalProperties": false
  9709. },
  9710. "Pty": {
  9711. "type": "object",
  9712. "properties": {
  9713. "id": {
  9714. "type": "string"
  9715. },
  9716. "title": {
  9717. "type": "string"
  9718. },
  9719. "command": {
  9720. "type": "string"
  9721. },
  9722. "args": {
  9723. "type": "array",
  9724. "items": {
  9725. "type": "string"
  9726. }
  9727. },
  9728. "cwd": {
  9729. "type": "string"
  9730. },
  9731. "status": {
  9732. "type": "string",
  9733. "enum": ["running", "exited"]
  9734. },
  9735. "pid": {
  9736. "type": "integer",
  9737. "exclusiveMinimum": 0
  9738. }
  9739. },
  9740. "required": ["id", "title", "command", "args", "cwd", "status", "pid"],
  9741. "additionalProperties": false
  9742. },
  9743. "OutputFormatText": {
  9744. "type": "object",
  9745. "properties": {
  9746. "type": {
  9747. "type": "string",
  9748. "enum": ["text"]
  9749. }
  9750. },
  9751. "required": ["type"],
  9752. "additionalProperties": false
  9753. },
  9754. "JSONSchema": {
  9755. "type": "object"
  9756. },
  9757. "OutputFormatJsonSchema": {
  9758. "type": "object",
  9759. "properties": {
  9760. "type": {
  9761. "type": "string",
  9762. "enum": ["json_schema"]
  9763. },
  9764. "schema": {
  9765. "$ref": "#/components/schemas/JSONSchema"
  9766. },
  9767. "retryCount": {
  9768. "type": "integer",
  9769. "minimum": 0
  9770. }
  9771. },
  9772. "required": ["type", "schema"],
  9773. "additionalProperties": false
  9774. },
  9775. "OutputFormat": {
  9776. "anyOf": [
  9777. {
  9778. "$ref": "#/components/schemas/OutputFormatText"
  9779. },
  9780. {
  9781. "$ref": "#/components/schemas/OutputFormatJsonSchema"
  9782. }
  9783. ]
  9784. },
  9785. "UserMessage": {
  9786. "type": "object",
  9787. "properties": {
  9788. "id": {
  9789. "type": "string"
  9790. },
  9791. "sessionID": {
  9792. "type": "string"
  9793. },
  9794. "role": {
  9795. "type": "string",
  9796. "enum": ["user"]
  9797. },
  9798. "time": {
  9799. "type": "object",
  9800. "properties": {
  9801. "created": {
  9802. "type": "integer",
  9803. "minimum": 0
  9804. }
  9805. },
  9806. "required": ["created"],
  9807. "additionalProperties": false
  9808. },
  9809. "format": {
  9810. "$ref": "#/components/schemas/OutputFormat"
  9811. },
  9812. "summary": {
  9813. "type": "object",
  9814. "properties": {
  9815. "title": {
  9816. "type": "string"
  9817. },
  9818. "body": {
  9819. "type": "string"
  9820. },
  9821. "diffs": {
  9822. "type": "array",
  9823. "items": {
  9824. "$ref": "#/components/schemas/SnapshotFileDiff"
  9825. }
  9826. }
  9827. },
  9828. "required": ["diffs"],
  9829. "additionalProperties": false
  9830. },
  9831. "agent": {
  9832. "type": "string"
  9833. },
  9834. "model": {
  9835. "type": "object",
  9836. "properties": {
  9837. "providerID": {
  9838. "type": "string"
  9839. },
  9840. "modelID": {
  9841. "type": "string"
  9842. },
  9843. "variant": {
  9844. "type": "string"
  9845. }
  9846. },
  9847. "required": ["providerID", "modelID"],
  9848. "additionalProperties": false
  9849. },
  9850. "system": {
  9851. "type": "string"
  9852. },
  9853. "tools": {
  9854. "type": "object",
  9855. "additionalProperties": {
  9856. "type": "boolean"
  9857. }
  9858. }
  9859. },
  9860. "required": ["id", "sessionID", "role", "time", "agent", "model"],
  9861. "additionalProperties": false
  9862. },
  9863. "AssistantMessage": {
  9864. "type": "object",
  9865. "properties": {
  9866. "id": {
  9867. "type": "string"
  9868. },
  9869. "sessionID": {
  9870. "type": "string"
  9871. },
  9872. "role": {
  9873. "type": "string",
  9874. "enum": ["assistant"]
  9875. },
  9876. "time": {
  9877. "type": "object",
  9878. "properties": {
  9879. "created": {
  9880. "type": "integer",
  9881. "minimum": 0
  9882. },
  9883. "completed": {
  9884. "type": "integer",
  9885. "minimum": 0
  9886. }
  9887. },
  9888. "required": ["created"],
  9889. "additionalProperties": false
  9890. },
  9891. "error": {
  9892. "anyOf": [
  9893. {
  9894. "$ref": "#/components/schemas/ProviderAuthError"
  9895. },
  9896. {
  9897. "$ref": "#/components/schemas/UnknownError"
  9898. },
  9899. {
  9900. "$ref": "#/components/schemas/MessageOutputLengthError"
  9901. },
  9902. {
  9903. "$ref": "#/components/schemas/MessageAbortedError"
  9904. },
  9905. {
  9906. "$ref": "#/components/schemas/StructuredOutputError"
  9907. },
  9908. {
  9909. "$ref": "#/components/schemas/ContextOverflowError"
  9910. },
  9911. {
  9912. "$ref": "#/components/schemas/APIError"
  9913. }
  9914. ]
  9915. },
  9916. "parentID": {
  9917. "type": "string"
  9918. },
  9919. "modelID": {
  9920. "type": "string"
  9921. },
  9922. "providerID": {
  9923. "type": "string"
  9924. },
  9925. "mode": {
  9926. "type": "string"
  9927. },
  9928. "agent": {
  9929. "type": "string"
  9930. },
  9931. "path": {
  9932. "type": "object",
  9933. "properties": {
  9934. "cwd": {
  9935. "type": "string"
  9936. },
  9937. "root": {
  9938. "type": "string"
  9939. }
  9940. },
  9941. "required": ["cwd", "root"],
  9942. "additionalProperties": false
  9943. },
  9944. "summary": {
  9945. "type": "boolean"
  9946. },
  9947. "cost": {
  9948. "type": "number"
  9949. },
  9950. "tokens": {
  9951. "type": "object",
  9952. "properties": {
  9953. "total": {
  9954. "type": "integer",
  9955. "minimum": 0
  9956. },
  9957. "input": {
  9958. "type": "integer",
  9959. "minimum": 0
  9960. },
  9961. "output": {
  9962. "type": "integer",
  9963. "minimum": 0
  9964. },
  9965. "reasoning": {
  9966. "type": "integer",
  9967. "minimum": 0
  9968. },
  9969. "cache": {
  9970. "type": "object",
  9971. "properties": {
  9972. "read": {
  9973. "type": "integer",
  9974. "minimum": 0
  9975. },
  9976. "write": {
  9977. "type": "integer",
  9978. "minimum": 0
  9979. }
  9980. },
  9981. "required": ["read", "write"],
  9982. "additionalProperties": false
  9983. }
  9984. },
  9985. "required": ["input", "output", "reasoning", "cache"],
  9986. "additionalProperties": false
  9987. },
  9988. "structured": {},
  9989. "variant": {
  9990. "type": "string"
  9991. },
  9992. "finish": {
  9993. "type": "string"
  9994. }
  9995. },
  9996. "required": [
  9997. "id",
  9998. "sessionID",
  9999. "role",
  10000. "time",
  10001. "parentID",
  10002. "modelID",
  10003. "providerID",
  10004. "mode",
  10005. "agent",
  10006. "path",
  10007. "cost",
  10008. "tokens"
  10009. ],
  10010. "additionalProperties": false
  10011. },
  10012. "Message": {
  10013. "anyOf": [
  10014. {
  10015. "$ref": "#/components/schemas/UserMessage"
  10016. },
  10017. {
  10018. "$ref": "#/components/schemas/AssistantMessage"
  10019. }
  10020. ]
  10021. },
  10022. "TextPart": {
  10023. "type": "object",
  10024. "properties": {
  10025. "id": {
  10026. "type": "string"
  10027. },
  10028. "sessionID": {
  10029. "type": "string"
  10030. },
  10031. "messageID": {
  10032. "type": "string"
  10033. },
  10034. "type": {
  10035. "type": "string",
  10036. "enum": ["text"]
  10037. },
  10038. "text": {
  10039. "type": "string"
  10040. },
  10041. "synthetic": {
  10042. "type": "boolean"
  10043. },
  10044. "ignored": {
  10045. "type": "boolean"
  10046. },
  10047. "time": {
  10048. "type": "object",
  10049. "properties": {
  10050. "start": {
  10051. "type": "integer",
  10052. "minimum": 0
  10053. },
  10054. "end": {
  10055. "type": "integer",
  10056. "minimum": 0
  10057. }
  10058. },
  10059. "required": ["start"],
  10060. "additionalProperties": false
  10061. },
  10062. "metadata": {
  10063. "type": "object"
  10064. }
  10065. },
  10066. "required": ["id", "sessionID", "messageID", "type", "text"],
  10067. "additionalProperties": false
  10068. },
  10069. "SubtaskPart": {
  10070. "type": "object",
  10071. "properties": {
  10072. "id": {
  10073. "type": "string"
  10074. },
  10075. "sessionID": {
  10076. "type": "string"
  10077. },
  10078. "messageID": {
  10079. "type": "string"
  10080. },
  10081. "type": {
  10082. "type": "string",
  10083. "enum": ["subtask"]
  10084. },
  10085. "prompt": {
  10086. "type": "string"
  10087. },
  10088. "description": {
  10089. "type": "string"
  10090. },
  10091. "agent": {
  10092. "type": "string"
  10093. },
  10094. "model": {
  10095. "type": "object",
  10096. "properties": {
  10097. "providerID": {
  10098. "type": "string"
  10099. },
  10100. "modelID": {
  10101. "type": "string"
  10102. }
  10103. },
  10104. "required": ["providerID", "modelID"],
  10105. "additionalProperties": false
  10106. },
  10107. "command": {
  10108. "type": "string"
  10109. }
  10110. },
  10111. "required": ["id", "sessionID", "messageID", "type", "prompt", "description", "agent"],
  10112. "additionalProperties": false
  10113. },
  10114. "ReasoningPart": {
  10115. "type": "object",
  10116. "properties": {
  10117. "id": {
  10118. "type": "string"
  10119. },
  10120. "sessionID": {
  10121. "type": "string"
  10122. },
  10123. "messageID": {
  10124. "type": "string"
  10125. },
  10126. "type": {
  10127. "type": "string",
  10128. "enum": ["reasoning"]
  10129. },
  10130. "text": {
  10131. "type": "string"
  10132. },
  10133. "metadata": {
  10134. "type": "object"
  10135. },
  10136. "time": {
  10137. "type": "object",
  10138. "properties": {
  10139. "start": {
  10140. "type": "integer",
  10141. "minimum": 0
  10142. },
  10143. "end": {
  10144. "type": "integer",
  10145. "minimum": 0
  10146. }
  10147. },
  10148. "required": ["start"],
  10149. "additionalProperties": false
  10150. }
  10151. },
  10152. "required": ["id", "sessionID", "messageID", "type", "text", "time"],
  10153. "additionalProperties": false
  10154. },
  10155. "FilePartSourceText": {
  10156. "type": "object",
  10157. "properties": {
  10158. "value": {
  10159. "type": "string"
  10160. },
  10161. "start": {
  10162. "type": "integer",
  10163. "minimum": 0
  10164. },
  10165. "end": {
  10166. "type": "integer",
  10167. "minimum": 0
  10168. }
  10169. },
  10170. "required": ["value", "start", "end"],
  10171. "additionalProperties": false
  10172. },
  10173. "FileSource": {
  10174. "type": "object",
  10175. "properties": {
  10176. "text": {
  10177. "$ref": "#/components/schemas/FilePartSourceText"
  10178. },
  10179. "type": {
  10180. "type": "string",
  10181. "enum": ["file"]
  10182. },
  10183. "path": {
  10184. "type": "string"
  10185. }
  10186. },
  10187. "required": ["text", "type", "path"],
  10188. "additionalProperties": false
  10189. },
  10190. "Range": {
  10191. "type": "object",
  10192. "properties": {
  10193. "start": {
  10194. "type": "object",
  10195. "properties": {
  10196. "line": {
  10197. "type": "integer",
  10198. "minimum": 0
  10199. },
  10200. "character": {
  10201. "type": "integer",
  10202. "minimum": 0
  10203. }
  10204. },
  10205. "required": ["line", "character"],
  10206. "additionalProperties": false
  10207. },
  10208. "end": {
  10209. "type": "object",
  10210. "properties": {
  10211. "line": {
  10212. "type": "integer",
  10213. "minimum": 0
  10214. },
  10215. "character": {
  10216. "type": "integer",
  10217. "minimum": 0
  10218. }
  10219. },
  10220. "required": ["line", "character"],
  10221. "additionalProperties": false
  10222. }
  10223. },
  10224. "required": ["start", "end"],
  10225. "additionalProperties": false
  10226. },
  10227. "SymbolSource": {
  10228. "type": "object",
  10229. "properties": {
  10230. "text": {
  10231. "$ref": "#/components/schemas/FilePartSourceText"
  10232. },
  10233. "type": {
  10234. "type": "string",
  10235. "enum": ["symbol"]
  10236. },
  10237. "path": {
  10238. "type": "string"
  10239. },
  10240. "range": {
  10241. "$ref": "#/components/schemas/Range"
  10242. },
  10243. "name": {
  10244. "type": "string"
  10245. },
  10246. "kind": {
  10247. "type": "integer",
  10248. "minimum": 0
  10249. }
  10250. },
  10251. "required": ["text", "type", "path", "range", "name", "kind"],
  10252. "additionalProperties": false
  10253. },
  10254. "ResourceSource": {
  10255. "type": "object",
  10256. "properties": {
  10257. "text": {
  10258. "$ref": "#/components/schemas/FilePartSourceText"
  10259. },
  10260. "type": {
  10261. "type": "string",
  10262. "enum": ["resource"]
  10263. },
  10264. "clientName": {
  10265. "type": "string"
  10266. },
  10267. "uri": {
  10268. "type": "string"
  10269. }
  10270. },
  10271. "required": ["text", "type", "clientName", "uri"],
  10272. "additionalProperties": false
  10273. },
  10274. "FilePartSource": {
  10275. "anyOf": [
  10276. {
  10277. "$ref": "#/components/schemas/FileSource"
  10278. },
  10279. {
  10280. "$ref": "#/components/schemas/SymbolSource"
  10281. },
  10282. {
  10283. "$ref": "#/components/schemas/ResourceSource"
  10284. }
  10285. ]
  10286. },
  10287. "FilePart": {
  10288. "type": "object",
  10289. "properties": {
  10290. "id": {
  10291. "type": "string"
  10292. },
  10293. "sessionID": {
  10294. "type": "string"
  10295. },
  10296. "messageID": {
  10297. "type": "string"
  10298. },
  10299. "type": {
  10300. "type": "string",
  10301. "enum": ["file"]
  10302. },
  10303. "mime": {
  10304. "type": "string"
  10305. },
  10306. "filename": {
  10307. "type": "string"
  10308. },
  10309. "url": {
  10310. "type": "string"
  10311. },
  10312. "source": {
  10313. "$ref": "#/components/schemas/FilePartSource"
  10314. }
  10315. },
  10316. "required": ["id", "sessionID", "messageID", "type", "mime", "url"],
  10317. "additionalProperties": false
  10318. },
  10319. "ToolStatePending": {
  10320. "type": "object",
  10321. "properties": {
  10322. "status": {
  10323. "type": "string",
  10324. "enum": ["pending"]
  10325. },
  10326. "input": {
  10327. "type": "object"
  10328. },
  10329. "raw": {
  10330. "type": "string"
  10331. }
  10332. },
  10333. "required": ["status", "input", "raw"],
  10334. "additionalProperties": false
  10335. },
  10336. "ToolStateRunning": {
  10337. "type": "object",
  10338. "properties": {
  10339. "status": {
  10340. "type": "string",
  10341. "enum": ["running"]
  10342. },
  10343. "input": {
  10344. "type": "object"
  10345. },
  10346. "title": {
  10347. "type": "string"
  10348. },
  10349. "metadata": {
  10350. "type": "object"
  10351. },
  10352. "time": {
  10353. "type": "object",
  10354. "properties": {
  10355. "start": {
  10356. "type": "integer",
  10357. "minimum": 0
  10358. }
  10359. },
  10360. "required": ["start"],
  10361. "additionalProperties": false
  10362. }
  10363. },
  10364. "required": ["status", "input", "time"],
  10365. "additionalProperties": false
  10366. },
  10367. "ToolStateCompleted": {
  10368. "type": "object",
  10369. "properties": {
  10370. "status": {
  10371. "type": "string",
  10372. "enum": ["completed"]
  10373. },
  10374. "input": {
  10375. "type": "object"
  10376. },
  10377. "output": {
  10378. "type": "string"
  10379. },
  10380. "title": {
  10381. "type": "string"
  10382. },
  10383. "metadata": {
  10384. "type": "object"
  10385. },
  10386. "time": {
  10387. "type": "object",
  10388. "properties": {
  10389. "start": {
  10390. "type": "integer",
  10391. "minimum": 0
  10392. },
  10393. "end": {
  10394. "type": "integer",
  10395. "minimum": 0
  10396. },
  10397. "compacted": {
  10398. "type": "integer",
  10399. "minimum": 0
  10400. }
  10401. },
  10402. "required": ["start", "end"],
  10403. "additionalProperties": false
  10404. },
  10405. "attachments": {
  10406. "type": "array",
  10407. "items": {
  10408. "$ref": "#/components/schemas/FilePart"
  10409. }
  10410. }
  10411. },
  10412. "required": ["status", "input", "output", "title", "metadata", "time"],
  10413. "additionalProperties": false
  10414. },
  10415. "ToolStateError": {
  10416. "type": "object",
  10417. "properties": {
  10418. "status": {
  10419. "type": "string",
  10420. "enum": ["error"]
  10421. },
  10422. "input": {
  10423. "type": "object"
  10424. },
  10425. "error": {
  10426. "type": "string"
  10427. },
  10428. "metadata": {
  10429. "type": "object"
  10430. },
  10431. "time": {
  10432. "type": "object",
  10433. "properties": {
  10434. "start": {
  10435. "type": "integer",
  10436. "minimum": 0
  10437. },
  10438. "end": {
  10439. "type": "integer",
  10440. "minimum": 0
  10441. }
  10442. },
  10443. "required": ["start", "end"],
  10444. "additionalProperties": false
  10445. }
  10446. },
  10447. "required": ["status", "input", "error", "time"],
  10448. "additionalProperties": false
  10449. },
  10450. "ToolState": {
  10451. "anyOf": [
  10452. {
  10453. "$ref": "#/components/schemas/ToolStatePending"
  10454. },
  10455. {
  10456. "$ref": "#/components/schemas/ToolStateRunning"
  10457. },
  10458. {
  10459. "$ref": "#/components/schemas/ToolStateCompleted"
  10460. },
  10461. {
  10462. "$ref": "#/components/schemas/ToolStateError"
  10463. }
  10464. ]
  10465. },
  10466. "ToolPart": {
  10467. "type": "object",
  10468. "properties": {
  10469. "id": {
  10470. "type": "string"
  10471. },
  10472. "sessionID": {
  10473. "type": "string"
  10474. },
  10475. "messageID": {
  10476. "type": "string"
  10477. },
  10478. "type": {
  10479. "type": "string",
  10480. "enum": ["tool"]
  10481. },
  10482. "callID": {
  10483. "type": "string"
  10484. },
  10485. "tool": {
  10486. "type": "string"
  10487. },
  10488. "state": {
  10489. "$ref": "#/components/schemas/ToolState"
  10490. },
  10491. "metadata": {
  10492. "type": "object"
  10493. }
  10494. },
  10495. "required": ["id", "sessionID", "messageID", "type", "callID", "tool", "state"],
  10496. "additionalProperties": false
  10497. },
  10498. "StepStartPart": {
  10499. "type": "object",
  10500. "properties": {
  10501. "id": {
  10502. "type": "string"
  10503. },
  10504. "sessionID": {
  10505. "type": "string"
  10506. },
  10507. "messageID": {
  10508. "type": "string"
  10509. },
  10510. "type": {
  10511. "type": "string",
  10512. "enum": ["step-start"]
  10513. },
  10514. "snapshot": {
  10515. "type": "string"
  10516. }
  10517. },
  10518. "required": ["id", "sessionID", "messageID", "type"],
  10519. "additionalProperties": false
  10520. },
  10521. "StepFinishPart": {
  10522. "type": "object",
  10523. "properties": {
  10524. "id": {
  10525. "type": "string"
  10526. },
  10527. "sessionID": {
  10528. "type": "string"
  10529. },
  10530. "messageID": {
  10531. "type": "string"
  10532. },
  10533. "type": {
  10534. "type": "string",
  10535. "enum": ["step-finish"]
  10536. },
  10537. "reason": {
  10538. "type": "string"
  10539. },
  10540. "snapshot": {
  10541. "type": "string"
  10542. },
  10543. "cost": {
  10544. "type": "number"
  10545. },
  10546. "tokens": {
  10547. "type": "object",
  10548. "properties": {
  10549. "total": {
  10550. "type": "integer",
  10551. "minimum": 0
  10552. },
  10553. "input": {
  10554. "type": "integer",
  10555. "minimum": 0
  10556. },
  10557. "output": {
  10558. "type": "integer",
  10559. "minimum": 0
  10560. },
  10561. "reasoning": {
  10562. "type": "integer",
  10563. "minimum": 0
  10564. },
  10565. "cache": {
  10566. "type": "object",
  10567. "properties": {
  10568. "read": {
  10569. "type": "integer",
  10570. "minimum": 0
  10571. },
  10572. "write": {
  10573. "type": "integer",
  10574. "minimum": 0
  10575. }
  10576. },
  10577. "required": ["read", "write"],
  10578. "additionalProperties": false
  10579. }
  10580. },
  10581. "required": ["input", "output", "reasoning", "cache"],
  10582. "additionalProperties": false
  10583. }
  10584. },
  10585. "required": ["id", "sessionID", "messageID", "type", "reason", "cost", "tokens"],
  10586. "additionalProperties": false
  10587. },
  10588. "SnapshotPart": {
  10589. "type": "object",
  10590. "properties": {
  10591. "id": {
  10592. "type": "string"
  10593. },
  10594. "sessionID": {
  10595. "type": "string"
  10596. },
  10597. "messageID": {
  10598. "type": "string"
  10599. },
  10600. "type": {
  10601. "type": "string",
  10602. "enum": ["snapshot"]
  10603. },
  10604. "snapshot": {
  10605. "type": "string"
  10606. }
  10607. },
  10608. "required": ["id", "sessionID", "messageID", "type", "snapshot"],
  10609. "additionalProperties": false
  10610. },
  10611. "PatchPart": {
  10612. "type": "object",
  10613. "properties": {
  10614. "id": {
  10615. "type": "string"
  10616. },
  10617. "sessionID": {
  10618. "type": "string"
  10619. },
  10620. "messageID": {
  10621. "type": "string"
  10622. },
  10623. "type": {
  10624. "type": "string",
  10625. "enum": ["patch"]
  10626. },
  10627. "hash": {
  10628. "type": "string"
  10629. },
  10630. "files": {
  10631. "type": "array",
  10632. "items": {
  10633. "type": "string"
  10634. }
  10635. }
  10636. },
  10637. "required": ["id", "sessionID", "messageID", "type", "hash", "files"],
  10638. "additionalProperties": false
  10639. },
  10640. "AgentPart": {
  10641. "type": "object",
  10642. "properties": {
  10643. "id": {
  10644. "type": "string"
  10645. },
  10646. "sessionID": {
  10647. "type": "string"
  10648. },
  10649. "messageID": {
  10650. "type": "string"
  10651. },
  10652. "type": {
  10653. "type": "string",
  10654. "enum": ["agent"]
  10655. },
  10656. "name": {
  10657. "type": "string"
  10658. },
  10659. "source": {
  10660. "type": "object",
  10661. "properties": {
  10662. "value": {
  10663. "type": "string"
  10664. },
  10665. "start": {
  10666. "type": "integer",
  10667. "minimum": 0
  10668. },
  10669. "end": {
  10670. "type": "integer",
  10671. "minimum": 0
  10672. }
  10673. },
  10674. "required": ["value", "start", "end"],
  10675. "additionalProperties": false
  10676. }
  10677. },
  10678. "required": ["id", "sessionID", "messageID", "type", "name"],
  10679. "additionalProperties": false
  10680. },
  10681. "RetryPart": {
  10682. "type": "object",
  10683. "properties": {
  10684. "id": {
  10685. "type": "string"
  10686. },
  10687. "sessionID": {
  10688. "type": "string"
  10689. },
  10690. "messageID": {
  10691. "type": "string"
  10692. },
  10693. "type": {
  10694. "type": "string",
  10695. "enum": ["retry"]
  10696. },
  10697. "attempt": {
  10698. "type": "integer",
  10699. "minimum": 0
  10700. },
  10701. "error": {
  10702. "$ref": "#/components/schemas/APIError"
  10703. },
  10704. "time": {
  10705. "type": "object",
  10706. "properties": {
  10707. "created": {
  10708. "type": "integer",
  10709. "minimum": 0
  10710. }
  10711. },
  10712. "required": ["created"],
  10713. "additionalProperties": false
  10714. }
  10715. },
  10716. "required": ["id", "sessionID", "messageID", "type", "attempt", "error", "time"],
  10717. "additionalProperties": false
  10718. },
  10719. "CompactionPart": {
  10720. "type": "object",
  10721. "properties": {
  10722. "id": {
  10723. "type": "string"
  10724. },
  10725. "sessionID": {
  10726. "type": "string"
  10727. },
  10728. "messageID": {
  10729. "type": "string"
  10730. },
  10731. "type": {
  10732. "type": "string",
  10733. "enum": ["compaction"]
  10734. },
  10735. "auto": {
  10736. "type": "boolean"
  10737. },
  10738. "overflow": {
  10739. "type": "boolean"
  10740. },
  10741. "tail_start_id": {
  10742. "type": "string"
  10743. }
  10744. },
  10745. "required": ["id", "sessionID", "messageID", "type", "auto"],
  10746. "additionalProperties": false
  10747. },
  10748. "Part": {
  10749. "anyOf": [
  10750. {
  10751. "$ref": "#/components/schemas/TextPart"
  10752. },
  10753. {
  10754. "$ref": "#/components/schemas/SubtaskPart"
  10755. },
  10756. {
  10757. "$ref": "#/components/schemas/ReasoningPart"
  10758. },
  10759. {
  10760. "$ref": "#/components/schemas/FilePart"
  10761. },
  10762. {
  10763. "$ref": "#/components/schemas/ToolPart"
  10764. },
  10765. {
  10766. "$ref": "#/components/schemas/StepStartPart"
  10767. },
  10768. {
  10769. "$ref": "#/components/schemas/StepFinishPart"
  10770. },
  10771. {
  10772. "$ref": "#/components/schemas/SnapshotPart"
  10773. },
  10774. {
  10775. "$ref": "#/components/schemas/PatchPart"
  10776. },
  10777. {
  10778. "$ref": "#/components/schemas/AgentPart"
  10779. },
  10780. {
  10781. "$ref": "#/components/schemas/RetryPart"
  10782. },
  10783. {
  10784. "$ref": "#/components/schemas/CompactionPart"
  10785. }
  10786. ]
  10787. },
  10788. "PermissionAction": {
  10789. "type": "string",
  10790. "enum": ["allow", "deny", "ask"]
  10791. },
  10792. "PermissionRule": {
  10793. "type": "object",
  10794. "properties": {
  10795. "permission": {
  10796. "type": "string"
  10797. },
  10798. "pattern": {
  10799. "type": "string"
  10800. },
  10801. "action": {
  10802. "$ref": "#/components/schemas/PermissionAction"
  10803. }
  10804. },
  10805. "required": ["permission", "pattern", "action"],
  10806. "additionalProperties": false
  10807. },
  10808. "PermissionRuleset": {
  10809. "type": "array",
  10810. "items": {
  10811. "$ref": "#/components/schemas/PermissionRule"
  10812. }
  10813. },
  10814. "Session": {
  10815. "type": "object",
  10816. "properties": {
  10817. "id": {
  10818. "type": "string"
  10819. },
  10820. "slug": {
  10821. "type": "string"
  10822. },
  10823. "projectID": {
  10824. "type": "string"
  10825. },
  10826. "workspaceID": {
  10827. "type": "string"
  10828. },
  10829. "directory": {
  10830. "type": "string"
  10831. },
  10832. "path": {
  10833. "type": "string"
  10834. },
  10835. "parentID": {
  10836. "type": "string"
  10837. },
  10838. "summary": {
  10839. "type": "object",
  10840. "properties": {
  10841. "additions": {
  10842. "type": "integer",
  10843. "minimum": 0
  10844. },
  10845. "deletions": {
  10846. "type": "integer",
  10847. "minimum": 0
  10848. },
  10849. "files": {
  10850. "type": "integer",
  10851. "minimum": 0
  10852. },
  10853. "diffs": {
  10854. "type": "array",
  10855. "items": {
  10856. "$ref": "#/components/schemas/SnapshotFileDiff"
  10857. }
  10858. }
  10859. },
  10860. "required": ["additions", "deletions", "files"],
  10861. "additionalProperties": false
  10862. },
  10863. "share": {
  10864. "type": "object",
  10865. "properties": {
  10866. "url": {
  10867. "type": "string"
  10868. }
  10869. },
  10870. "required": ["url"],
  10871. "additionalProperties": false
  10872. },
  10873. "title": {
  10874. "type": "string"
  10875. },
  10876. "agent": {
  10877. "type": "string"
  10878. },
  10879. "model": {
  10880. "type": "object",
  10881. "properties": {
  10882. "id": {
  10883. "type": "string"
  10884. },
  10885. "providerID": {
  10886. "type": "string"
  10887. },
  10888. "variant": {
  10889. "type": "string"
  10890. }
  10891. },
  10892. "required": ["id", "providerID"],
  10893. "additionalProperties": false
  10894. },
  10895. "version": {
  10896. "type": "string"
  10897. },
  10898. "time": {
  10899. "type": "object",
  10900. "properties": {
  10901. "created": {
  10902. "type": "integer",
  10903. "minimum": 0
  10904. },
  10905. "updated": {
  10906. "type": "integer",
  10907. "minimum": 0
  10908. },
  10909. "compacting": {
  10910. "type": "integer",
  10911. "minimum": 0
  10912. },
  10913. "archived": {
  10914. "type": "number"
  10915. }
  10916. },
  10917. "required": ["created", "updated"],
  10918. "additionalProperties": false
  10919. },
  10920. "permission": {
  10921. "$ref": "#/components/schemas/PermissionRuleset"
  10922. },
  10923. "revert": {
  10924. "type": "object",
  10925. "properties": {
  10926. "messageID": {
  10927. "type": "string"
  10928. },
  10929. "partID": {
  10930. "type": "string"
  10931. },
  10932. "snapshot": {
  10933. "type": "string"
  10934. },
  10935. "diff": {
  10936. "type": "string"
  10937. }
  10938. },
  10939. "required": ["messageID"],
  10940. "additionalProperties": false
  10941. }
  10942. },
  10943. "required": ["id", "slug", "projectID", "directory", "title", "version", "time"],
  10944. "additionalProperties": false
  10945. },
  10946. "Prompt": {
  10947. "type": "object",
  10948. "properties": {
  10949. "text": {
  10950. "type": "string"
  10951. },
  10952. "files": {
  10953. "type": "array",
  10954. "items": {
  10955. "$ref": "#/components/schemas/PromptFileAttachment"
  10956. }
  10957. },
  10958. "agents": {
  10959. "type": "array",
  10960. "items": {
  10961. "$ref": "#/components/schemas/PromptAgentAttachment"
  10962. }
  10963. }
  10964. },
  10965. "required": ["text"],
  10966. "additionalProperties": false
  10967. },
  10968. "GlobalEvent": {
  10969. "type": "object",
  10970. "properties": {
  10971. "directory": {
  10972. "type": "string"
  10973. },
  10974. "project": {
  10975. "type": "string"
  10976. },
  10977. "workspace": {
  10978. "type": "string"
  10979. },
  10980. "payload": {
  10981. "anyOf": [
  10982. {
  10983. "$ref": "#/components/schemas/EventServerInstanceDisposed"
  10984. },
  10985. {
  10986. "$ref": "#/components/schemas/EventFileEdited"
  10987. },
  10988. {
  10989. "$ref": "#/components/schemas/EventFileWatcherUpdated"
  10990. },
  10991. {
  10992. "$ref": "#/components/schemas/EventLspClientDiagnostics"
  10993. },
  10994. {
  10995. "$ref": "#/components/schemas/EventLspUpdated"
  10996. },
  10997. {
  10998. "$ref": "#/components/schemas/EventMessagePartDelta"
  10999. },
  11000. {
  11001. "$ref": "#/components/schemas/EventPermissionAsked"
  11002. },
  11003. {
  11004. "$ref": "#/components/schemas/EventPermissionReplied"
  11005. },
  11006. {
  11007. "$ref": "#/components/schemas/EventSessionDiff"
  11008. },
  11009. {
  11010. "$ref": "#/components/schemas/EventSessionError"
  11011. },
  11012. {
  11013. "$ref": "#/components/schemas/EventInstallationUpdated"
  11014. },
  11015. {
  11016. "$ref": "#/components/schemas/EventInstallationUpdate-available"
  11017. },
  11018. {
  11019. "$ref": "#/components/schemas/EventQuestionAsked"
  11020. },
  11021. {
  11022. "$ref": "#/components/schemas/EventQuestionReplied"
  11023. },
  11024. {
  11025. "$ref": "#/components/schemas/EventQuestionRejected"
  11026. },
  11027. {
  11028. "$ref": "#/components/schemas/EventTodoUpdated"
  11029. },
  11030. {
  11031. "$ref": "#/components/schemas/EventSessionStatus"
  11032. },
  11033. {
  11034. "$ref": "#/components/schemas/EventSessionIdle"
  11035. },
  11036. {
  11037. "$ref": "#/components/schemas/EventSessionCompacted"
  11038. },
  11039. {
  11040. "$ref": "#/components/schemas/Event.tui.prompt.append"
  11041. },
  11042. {
  11043. "$ref": "#/components/schemas/Event.tui.command.execute"
  11044. },
  11045. {
  11046. "$ref": "#/components/schemas/Event.tui.toast.show"
  11047. },
  11048. {
  11049. "$ref": "#/components/schemas/Event.tui.session.select"
  11050. },
  11051. {
  11052. "$ref": "#/components/schemas/EventMcpToolsChanged"
  11053. },
  11054. {
  11055. "$ref": "#/components/schemas/EventMcpBrowserOpenFailed"
  11056. },
  11057. {
  11058. "$ref": "#/components/schemas/EventCommandExecuted"
  11059. },
  11060. {
  11061. "$ref": "#/components/schemas/EventProjectUpdated"
  11062. },
  11063. {
  11064. "$ref": "#/components/schemas/EventVcsBranchUpdated"
  11065. },
  11066. {
  11067. "$ref": "#/components/schemas/EventWorkspaceReady"
  11068. },
  11069. {
  11070. "$ref": "#/components/schemas/EventWorkspaceFailed"
  11071. },
  11072. {
  11073. "$ref": "#/components/schemas/EventWorkspaceStatus"
  11074. },
  11075. {
  11076. "$ref": "#/components/schemas/EventWorktreeReady"
  11077. },
  11078. {
  11079. "$ref": "#/components/schemas/EventWorktreeFailed"
  11080. },
  11081. {
  11082. "$ref": "#/components/schemas/EventPtyCreated"
  11083. },
  11084. {
  11085. "$ref": "#/components/schemas/EventPtyUpdated"
  11086. },
  11087. {
  11088. "$ref": "#/components/schemas/EventPtyExited"
  11089. },
  11090. {
  11091. "$ref": "#/components/schemas/EventPtyDeleted"
  11092. },
  11093. {
  11094. "$ref": "#/components/schemas/EventMessageUpdated"
  11095. },
  11096. {
  11097. "$ref": "#/components/schemas/EventMessageRemoved"
  11098. },
  11099. {
  11100. "$ref": "#/components/schemas/EventMessagePartUpdated"
  11101. },
  11102. {
  11103. "$ref": "#/components/schemas/EventMessagePartRemoved"
  11104. },
  11105. {
  11106. "$ref": "#/components/schemas/EventSessionCreated"
  11107. },
  11108. {
  11109. "$ref": "#/components/schemas/EventSessionUpdated"
  11110. },
  11111. {
  11112. "$ref": "#/components/schemas/EventSessionDeleted"
  11113. },
  11114. {
  11115. "$ref": "#/components/schemas/EventSessionNextAgentSwitched"
  11116. },
  11117. {
  11118. "$ref": "#/components/schemas/EventSessionNextModelSwitched"
  11119. },
  11120. {
  11121. "$ref": "#/components/schemas/EventSessionNextPrompted"
  11122. },
  11123. {
  11124. "$ref": "#/components/schemas/EventSessionNextSynthetic"
  11125. },
  11126. {
  11127. "$ref": "#/components/schemas/EventSessionNextShellStarted"
  11128. },
  11129. {
  11130. "$ref": "#/components/schemas/EventSessionNextShellEnded"
  11131. },
  11132. {
  11133. "$ref": "#/components/schemas/EventSessionNextStepStarted"
  11134. },
  11135. {
  11136. "$ref": "#/components/schemas/EventSessionNextStepEnded"
  11137. },
  11138. {
  11139. "$ref": "#/components/schemas/EventSessionNextStepFailed"
  11140. },
  11141. {
  11142. "$ref": "#/components/schemas/EventSessionNextTextStarted"
  11143. },
  11144. {
  11145. "$ref": "#/components/schemas/EventSessionNextTextDelta"
  11146. },
  11147. {
  11148. "$ref": "#/components/schemas/EventSessionNextTextEnded"
  11149. },
  11150. {
  11151. "$ref": "#/components/schemas/EventSessionNextReasoningStarted"
  11152. },
  11153. {
  11154. "$ref": "#/components/schemas/EventSessionNextReasoningDelta"
  11155. },
  11156. {
  11157. "$ref": "#/components/schemas/EventSessionNextReasoningEnded"
  11158. },
  11159. {
  11160. "$ref": "#/components/schemas/EventSessionNextToolInputStarted"
  11161. },
  11162. {
  11163. "$ref": "#/components/schemas/EventSessionNextToolInputDelta"
  11164. },
  11165. {
  11166. "$ref": "#/components/schemas/EventSessionNextToolInputEnded"
  11167. },
  11168. {
  11169. "$ref": "#/components/schemas/EventSessionNextToolCalled"
  11170. },
  11171. {
  11172. "$ref": "#/components/schemas/EventSessionNextToolProgress"
  11173. },
  11174. {
  11175. "$ref": "#/components/schemas/EventSessionNextToolSuccess"
  11176. },
  11177. {
  11178. "$ref": "#/components/schemas/EventSessionNextToolFailed"
  11179. },
  11180. {
  11181. "$ref": "#/components/schemas/EventSessionNextRetried"
  11182. },
  11183. {
  11184. "$ref": "#/components/schemas/EventSessionNextCompactionStarted"
  11185. },
  11186. {
  11187. "$ref": "#/components/schemas/EventSessionNextCompactionDelta"
  11188. },
  11189. {
  11190. "$ref": "#/components/schemas/EventSessionNextCompactionEnded"
  11191. },
  11192. {
  11193. "$ref": "#/components/schemas/EventServerConnected"
  11194. },
  11195. {
  11196. "$ref": "#/components/schemas/EventGlobalDisposed"
  11197. },
  11198. {
  11199. "$ref": "#/components/schemas/SyncEventMessageUpdated"
  11200. },
  11201. {
  11202. "$ref": "#/components/schemas/SyncEventMessageRemoved"
  11203. },
  11204. {
  11205. "$ref": "#/components/schemas/SyncEventMessagePartUpdated"
  11206. },
  11207. {
  11208. "$ref": "#/components/schemas/SyncEventMessagePartRemoved"
  11209. },
  11210. {
  11211. "$ref": "#/components/schemas/SyncEventSessionCreated"
  11212. },
  11213. {
  11214. "$ref": "#/components/schemas/SyncEventSessionUpdated"
  11215. },
  11216. {
  11217. "$ref": "#/components/schemas/SyncEventSessionDeleted"
  11218. },
  11219. {
  11220. "$ref": "#/components/schemas/SyncEventSessionNextAgentSwitched"
  11221. },
  11222. {
  11223. "$ref": "#/components/schemas/SyncEventSessionNextModelSwitched"
  11224. },
  11225. {
  11226. "$ref": "#/components/schemas/SyncEventSessionNextPrompted"
  11227. },
  11228. {
  11229. "$ref": "#/components/schemas/SyncEventSessionNextSynthetic"
  11230. },
  11231. {
  11232. "$ref": "#/components/schemas/SyncEventSessionNextShellStarted"
  11233. },
  11234. {
  11235. "$ref": "#/components/schemas/SyncEventSessionNextShellEnded"
  11236. },
  11237. {
  11238. "$ref": "#/components/schemas/SyncEventSessionNextStepStarted"
  11239. },
  11240. {
  11241. "$ref": "#/components/schemas/SyncEventSessionNextStepEnded"
  11242. },
  11243. {
  11244. "$ref": "#/components/schemas/SyncEventSessionNextStepFailed"
  11245. },
  11246. {
  11247. "$ref": "#/components/schemas/SyncEventSessionNextTextStarted"
  11248. },
  11249. {
  11250. "$ref": "#/components/schemas/SyncEventSessionNextTextDelta"
  11251. },
  11252. {
  11253. "$ref": "#/components/schemas/SyncEventSessionNextTextEnded"
  11254. },
  11255. {
  11256. "$ref": "#/components/schemas/SyncEventSessionNextReasoningStarted"
  11257. },
  11258. {
  11259. "$ref": "#/components/schemas/SyncEventSessionNextReasoningDelta"
  11260. },
  11261. {
  11262. "$ref": "#/components/schemas/SyncEventSessionNextReasoningEnded"
  11263. },
  11264. {
  11265. "$ref": "#/components/schemas/SyncEventSessionNextToolInputStarted"
  11266. },
  11267. {
  11268. "$ref": "#/components/schemas/SyncEventSessionNextToolInputDelta"
  11269. },
  11270. {
  11271. "$ref": "#/components/schemas/SyncEventSessionNextToolInputEnded"
  11272. },
  11273. {
  11274. "$ref": "#/components/schemas/SyncEventSessionNextToolCalled"
  11275. },
  11276. {
  11277. "$ref": "#/components/schemas/SyncEventSessionNextToolProgress"
  11278. },
  11279. {
  11280. "$ref": "#/components/schemas/SyncEventSessionNextToolSuccess"
  11281. },
  11282. {
  11283. "$ref": "#/components/schemas/SyncEventSessionNextToolFailed"
  11284. },
  11285. {
  11286. "$ref": "#/components/schemas/SyncEventSessionNextRetried"
  11287. },
  11288. {
  11289. "$ref": "#/components/schemas/SyncEventSessionNextCompactionStarted"
  11290. },
  11291. {
  11292. "$ref": "#/components/schemas/SyncEventSessionNextCompactionDelta"
  11293. },
  11294. {
  11295. "$ref": "#/components/schemas/SyncEventSessionNextCompactionEnded"
  11296. }
  11297. ]
  11298. }
  11299. },
  11300. "required": ["directory", "payload"],
  11301. "additionalProperties": false
  11302. },
  11303. "LogLevel": {
  11304. "type": "string",
  11305. "enum": ["DEBUG", "INFO", "WARN", "ERROR"],
  11306. "description": "Log level"
  11307. },
  11308. "ServerConfig": {
  11309. "type": "object",
  11310. "properties": {
  11311. "port": {
  11312. "type": "integer",
  11313. "exclusiveMinimum": 0
  11314. },
  11315. "hostname": {
  11316. "type": "string"
  11317. },
  11318. "mdns": {
  11319. "type": "boolean"
  11320. },
  11321. "mdnsDomain": {
  11322. "type": "string"
  11323. },
  11324. "cors": {
  11325. "type": "array",
  11326. "items": {
  11327. "type": "string"
  11328. }
  11329. }
  11330. },
  11331. "additionalProperties": false,
  11332. "description": "Server configuration for opencode serve and web commands"
  11333. },
  11334. "ReferenceConfigEntry": {
  11335. "anyOf": [
  11336. {
  11337. "type": "string"
  11338. },
  11339. {
  11340. "type": "object",
  11341. "properties": {
  11342. "repository": {
  11343. "type": "string",
  11344. "description": "Git repository URL, host/path reference, or GitHub owner/repo shorthand"
  11345. },
  11346. "branch": {
  11347. "type": "string"
  11348. }
  11349. },
  11350. "required": ["repository"],
  11351. "additionalProperties": false
  11352. },
  11353. {
  11354. "type": "object",
  11355. "properties": {
  11356. "path": {
  11357. "type": "string",
  11358. "description": "Absolute path, ~/ path, or workspace-relative path to a local reference directory"
  11359. }
  11360. },
  11361. "required": ["path"],
  11362. "additionalProperties": false
  11363. }
  11364. ]
  11365. },
  11366. "ReferenceConfig": {
  11367. "type": "object",
  11368. "additionalProperties": {
  11369. "$ref": "#/components/schemas/ReferenceConfigEntry"
  11370. }
  11371. },
  11372. "PermissionActionConfig": {
  11373. "type": "string",
  11374. "enum": ["ask", "allow", "deny"]
  11375. },
  11376. "PermissionObjectConfig": {
  11377. "type": "object",
  11378. "additionalProperties": {
  11379. "$ref": "#/components/schemas/PermissionActionConfig"
  11380. }
  11381. },
  11382. "PermissionRuleConfig": {
  11383. "anyOf": [
  11384. {
  11385. "$ref": "#/components/schemas/PermissionActionConfig"
  11386. },
  11387. {
  11388. "$ref": "#/components/schemas/PermissionObjectConfig"
  11389. }
  11390. ]
  11391. },
  11392. "PermissionConfig": {
  11393. "anyOf": [
  11394. {
  11395. "$ref": "#/components/schemas/PermissionActionConfig"
  11396. },
  11397. {
  11398. "type": "object",
  11399. "properties": {
  11400. "read": {
  11401. "$ref": "#/components/schemas/PermissionRuleConfig"
  11402. },
  11403. "edit": {
  11404. "$ref": "#/components/schemas/PermissionRuleConfig"
  11405. },
  11406. "glob": {
  11407. "$ref": "#/components/schemas/PermissionRuleConfig"
  11408. },
  11409. "grep": {
  11410. "$ref": "#/components/schemas/PermissionRuleConfig"
  11411. },
  11412. "list": {
  11413. "$ref": "#/components/schemas/PermissionRuleConfig"
  11414. },
  11415. "bash": {
  11416. "$ref": "#/components/schemas/PermissionRuleConfig"
  11417. },
  11418. "task": {
  11419. "$ref": "#/components/schemas/PermissionRuleConfig"
  11420. },
  11421. "external_directory": {
  11422. "$ref": "#/components/schemas/PermissionRuleConfig"
  11423. },
  11424. "todowrite": {
  11425. "$ref": "#/components/schemas/PermissionActionConfig"
  11426. },
  11427. "question": {
  11428. "$ref": "#/components/schemas/PermissionActionConfig"
  11429. },
  11430. "webfetch": {
  11431. "$ref": "#/components/schemas/PermissionActionConfig"
  11432. },
  11433. "websearch": {
  11434. "$ref": "#/components/schemas/PermissionActionConfig"
  11435. },
  11436. "codesearch": {
  11437. "$ref": "#/components/schemas/PermissionActionConfig"
  11438. },
  11439. "repo_clone": {
  11440. "$ref": "#/components/schemas/PermissionRuleConfig"
  11441. },
  11442. "repo_overview": {
  11443. "$ref": "#/components/schemas/PermissionRuleConfig"
  11444. },
  11445. "lsp": {
  11446. "$ref": "#/components/schemas/PermissionRuleConfig"
  11447. },
  11448. "doom_loop": {
  11449. "$ref": "#/components/schemas/PermissionActionConfig"
  11450. },
  11451. "skill": {
  11452. "$ref": "#/components/schemas/PermissionRuleConfig"
  11453. }
  11454. },
  11455. "additionalProperties": {
  11456. "$ref": "#/components/schemas/PermissionRuleConfig"
  11457. }
  11458. }
  11459. ]
  11460. },
  11461. "AgentConfig": {
  11462. "type": "object",
  11463. "properties": {
  11464. "model": {
  11465. "type": "string"
  11466. },
  11467. "variant": {
  11468. "type": "string"
  11469. },
  11470. "temperature": {
  11471. "type": "number"
  11472. },
  11473. "top_p": {
  11474. "type": "number"
  11475. },
  11476. "prompt": {
  11477. "type": "string"
  11478. },
  11479. "tools": {
  11480. "type": "object",
  11481. "additionalProperties": {
  11482. "type": "boolean"
  11483. }
  11484. },
  11485. "disable": {
  11486. "type": "boolean"
  11487. },
  11488. "description": {
  11489. "type": "string"
  11490. },
  11491. "mode": {
  11492. "type": "string",
  11493. "enum": ["subagent", "primary", "all"]
  11494. },
  11495. "hidden": {
  11496. "type": "boolean"
  11497. },
  11498. "options": {
  11499. "type": "object"
  11500. },
  11501. "color": {
  11502. "anyOf": [
  11503. {
  11504. "type": "string",
  11505. "pattern": "^#[0-9a-fA-F]{6}$"
  11506. },
  11507. {
  11508. "type": "string",
  11509. "enum": ["primary", "secondary", "accent", "success", "warning", "error", "info"]
  11510. }
  11511. ],
  11512. "description": "Hex color code (e.g., #FF5733) or theme color (e.g., primary)"
  11513. },
  11514. "steps": {
  11515. "type": "integer",
  11516. "exclusiveMinimum": 0
  11517. },
  11518. "maxSteps": {
  11519. "type": "integer",
  11520. "exclusiveMinimum": 0
  11521. },
  11522. "permission": {
  11523. "$ref": "#/components/schemas/PermissionConfig"
  11524. }
  11525. },
  11526. "additionalProperties": {}
  11527. },
  11528. "ProviderConfig": {
  11529. "type": "object",
  11530. "properties": {
  11531. "api": {
  11532. "type": "string"
  11533. },
  11534. "name": {
  11535. "type": "string"
  11536. },
  11537. "env": {
  11538. "type": "array",
  11539. "items": {
  11540. "type": "string"
  11541. }
  11542. },
  11543. "id": {
  11544. "type": "string"
  11545. },
  11546. "npm": {
  11547. "type": "string"
  11548. },
  11549. "whitelist": {
  11550. "type": "array",
  11551. "items": {
  11552. "type": "string"
  11553. }
  11554. },
  11555. "blacklist": {
  11556. "type": "array",
  11557. "items": {
  11558. "type": "string"
  11559. }
  11560. },
  11561. "options": {
  11562. "type": "object",
  11563. "properties": {
  11564. "apiKey": {
  11565. "type": "string"
  11566. },
  11567. "baseURL": {
  11568. "type": "string"
  11569. },
  11570. "enterpriseUrl": {
  11571. "type": "string"
  11572. },
  11573. "setCacheKey": {
  11574. "type": "boolean"
  11575. },
  11576. "timeout": {
  11577. "anyOf": [
  11578. {
  11579. "type": "integer",
  11580. "exclusiveMinimum": 0
  11581. },
  11582. {
  11583. "type": "boolean",
  11584. "enum": [false]
  11585. }
  11586. ],
  11587. "description": "Timeout in milliseconds for requests to this provider. Default is 300000 (5 minutes). Set to false to disable timeout."
  11588. },
  11589. "chunkTimeout": {
  11590. "type": "integer",
  11591. "exclusiveMinimum": 0
  11592. }
  11593. },
  11594. "additionalProperties": {}
  11595. },
  11596. "models": {
  11597. "type": "object",
  11598. "additionalProperties": {
  11599. "type": "object",
  11600. "properties": {
  11601. "id": {
  11602. "type": "string"
  11603. },
  11604. "name": {
  11605. "type": "string"
  11606. },
  11607. "family": {
  11608. "type": "string"
  11609. },
  11610. "release_date": {
  11611. "type": "string"
  11612. },
  11613. "attachment": {
  11614. "type": "boolean"
  11615. },
  11616. "reasoning": {
  11617. "type": "boolean"
  11618. },
  11619. "temperature": {
  11620. "type": "boolean"
  11621. },
  11622. "tool_call": {
  11623. "type": "boolean"
  11624. },
  11625. "interleaved": {
  11626. "anyOf": [
  11627. {
  11628. "type": "boolean",
  11629. "enum": [true]
  11630. },
  11631. {
  11632. "type": "object",
  11633. "properties": {
  11634. "field": {
  11635. "type": "string",
  11636. "enum": ["reasoning_content", "reasoning_details"]
  11637. }
  11638. },
  11639. "required": ["field"],
  11640. "additionalProperties": false
  11641. }
  11642. ]
  11643. },
  11644. "cost": {
  11645. "type": "object",
  11646. "properties": {
  11647. "input": {
  11648. "type": "number"
  11649. },
  11650. "output": {
  11651. "type": "number"
  11652. },
  11653. "cache_read": {
  11654. "type": "number"
  11655. },
  11656. "cache_write": {
  11657. "type": "number"
  11658. },
  11659. "context_over_200k": {
  11660. "type": "object",
  11661. "properties": {
  11662. "input": {
  11663. "type": "number"
  11664. },
  11665. "output": {
  11666. "type": "number"
  11667. },
  11668. "cache_read": {
  11669. "type": "number"
  11670. },
  11671. "cache_write": {
  11672. "type": "number"
  11673. }
  11674. },
  11675. "required": ["input", "output"],
  11676. "additionalProperties": false
  11677. }
  11678. },
  11679. "required": ["input", "output"],
  11680. "additionalProperties": false
  11681. },
  11682. "limit": {
  11683. "type": "object",
  11684. "properties": {
  11685. "context": {
  11686. "type": "number"
  11687. },
  11688. "input": {
  11689. "type": "number"
  11690. },
  11691. "output": {
  11692. "type": "number"
  11693. }
  11694. },
  11695. "required": ["context", "output"],
  11696. "additionalProperties": false
  11697. },
  11698. "modalities": {
  11699. "type": "object",
  11700. "properties": {
  11701. "input": {
  11702. "type": "array",
  11703. "items": {
  11704. "type": "string",
  11705. "enum": ["text", "audio", "image", "video", "pdf"]
  11706. }
  11707. },
  11708. "output": {
  11709. "type": "array",
  11710. "items": {
  11711. "type": "string",
  11712. "enum": ["text", "audio", "image", "video", "pdf"]
  11713. }
  11714. }
  11715. },
  11716. "required": ["input", "output"],
  11717. "additionalProperties": false
  11718. },
  11719. "experimental": {
  11720. "type": "boolean"
  11721. },
  11722. "status": {
  11723. "type": "string",
  11724. "enum": ["alpha", "beta", "deprecated"]
  11725. },
  11726. "provider": {
  11727. "type": "object",
  11728. "properties": {
  11729. "npm": {
  11730. "type": "string"
  11731. },
  11732. "api": {
  11733. "type": "string"
  11734. }
  11735. },
  11736. "additionalProperties": false
  11737. },
  11738. "options": {
  11739. "type": "object"
  11740. },
  11741. "headers": {
  11742. "type": "object",
  11743. "additionalProperties": {
  11744. "type": "string"
  11745. }
  11746. },
  11747. "variants": {
  11748. "type": "object",
  11749. "additionalProperties": {
  11750. "type": "object",
  11751. "properties": {
  11752. "disabled": {
  11753. "type": "boolean"
  11754. }
  11755. },
  11756. "additionalProperties": {}
  11757. },
  11758. "description": "Variant-specific configuration"
  11759. }
  11760. },
  11761. "additionalProperties": false
  11762. }
  11763. }
  11764. },
  11765. "additionalProperties": false
  11766. },
  11767. "McpLocalConfig": {
  11768. "type": "object",
  11769. "properties": {
  11770. "type": {
  11771. "type": "string",
  11772. "enum": ["local"],
  11773. "description": "Type of MCP server connection"
  11774. },
  11775. "command": {
  11776. "type": "array",
  11777. "items": {
  11778. "type": "string"
  11779. },
  11780. "description": "Command and arguments to run the MCP server"
  11781. },
  11782. "environment": {
  11783. "type": "object",
  11784. "additionalProperties": {
  11785. "type": "string"
  11786. }
  11787. },
  11788. "enabled": {
  11789. "type": "boolean"
  11790. },
  11791. "timeout": {
  11792. "type": "integer",
  11793. "exclusiveMinimum": 0
  11794. }
  11795. },
  11796. "required": ["type", "command"],
  11797. "additionalProperties": false
  11798. },
  11799. "McpOAuthConfig": {
  11800. "type": "object",
  11801. "properties": {
  11802. "clientId": {
  11803. "type": "string"
  11804. },
  11805. "clientSecret": {
  11806. "type": "string"
  11807. },
  11808. "scope": {
  11809. "type": "string"
  11810. },
  11811. "redirectUri": {
  11812. "type": "string"
  11813. }
  11814. },
  11815. "additionalProperties": false
  11816. },
  11817. "McpRemoteConfig": {
  11818. "type": "object",
  11819. "properties": {
  11820. "type": {
  11821. "type": "string",
  11822. "enum": ["remote"],
  11823. "description": "Type of MCP server connection"
  11824. },
  11825. "url": {
  11826. "type": "string",
  11827. "description": "URL of the remote MCP server"
  11828. },
  11829. "enabled": {
  11830. "type": "boolean"
  11831. },
  11832. "headers": {
  11833. "type": "object",
  11834. "additionalProperties": {
  11835. "type": "string"
  11836. }
  11837. },
  11838. "oauth": {
  11839. "anyOf": [
  11840. {
  11841. "$ref": "#/components/schemas/McpOAuthConfig"
  11842. },
  11843. {
  11844. "type": "boolean",
  11845. "enum": [false]
  11846. }
  11847. ],
  11848. "description": "OAuth authentication configuration for the MCP server. Set to false to disable OAuth auto-detection."
  11849. },
  11850. "timeout": {
  11851. "type": "integer",
  11852. "exclusiveMinimum": 0
  11853. }
  11854. },
  11855. "required": ["type", "url"],
  11856. "additionalProperties": false
  11857. },
  11858. "LayoutConfig": {
  11859. "type": "string",
  11860. "enum": ["auto", "stretch"],
  11861. "description": "@deprecated Always uses stretch layout."
  11862. },
  11863. "Config": {
  11864. "type": "object",
  11865. "properties": {
  11866. "$schema": {
  11867. "type": "string"
  11868. },
  11869. "shell": {
  11870. "type": "string"
  11871. },
  11872. "logLevel": {
  11873. "$ref": "#/components/schemas/LogLevel"
  11874. },
  11875. "server": {
  11876. "$ref": "#/components/schemas/ServerConfig"
  11877. },
  11878. "command": {
  11879. "type": "object",
  11880. "additionalProperties": {
  11881. "type": "object",
  11882. "properties": {
  11883. "template": {
  11884. "type": "string"
  11885. },
  11886. "description": {
  11887. "type": "string"
  11888. },
  11889. "agent": {
  11890. "type": "string"
  11891. },
  11892. "model": {
  11893. "type": "string"
  11894. },
  11895. "subtask": {
  11896. "type": "boolean"
  11897. }
  11898. },
  11899. "required": ["template"],
  11900. "additionalProperties": false
  11901. }
  11902. },
  11903. "skills": {
  11904. "type": "object",
  11905. "properties": {
  11906. "paths": {
  11907. "type": "array",
  11908. "items": {
  11909. "type": "string"
  11910. }
  11911. },
  11912. "urls": {
  11913. "type": "array",
  11914. "items": {
  11915. "type": "string"
  11916. }
  11917. }
  11918. },
  11919. "additionalProperties": false
  11920. },
  11921. "reference": {
  11922. "$ref": "#/components/schemas/ReferenceConfig"
  11923. },
  11924. "watcher": {
  11925. "type": "object",
  11926. "properties": {
  11927. "ignore": {
  11928. "type": "array",
  11929. "items": {
  11930. "type": "string"
  11931. }
  11932. }
  11933. },
  11934. "additionalProperties": false
  11935. },
  11936. "snapshot": {
  11937. "type": "boolean"
  11938. },
  11939. "plugin": {
  11940. "type": "array",
  11941. "items": {
  11942. "anyOf": [
  11943. {
  11944. "type": "string"
  11945. },
  11946. {
  11947. "type": "array",
  11948. "prefixItems": [
  11949. {
  11950. "type": "string"
  11951. },
  11952. {
  11953. "type": "object"
  11954. }
  11955. ],
  11956. "maxItems": 2,
  11957. "minItems": 2
  11958. }
  11959. ]
  11960. }
  11961. },
  11962. "share": {
  11963. "type": "string",
  11964. "enum": ["manual", "auto", "disabled"]
  11965. },
  11966. "autoshare": {
  11967. "type": "boolean"
  11968. },
  11969. "autoupdate": {
  11970. "anyOf": [
  11971. {
  11972. "type": "boolean"
  11973. },
  11974. {
  11975. "type": "string",
  11976. "enum": ["notify"]
  11977. }
  11978. ],
  11979. "description": "Automatically update to the latest version. Set to true to auto-update, false to disable, or 'notify' to show update notifications"
  11980. },
  11981. "disabled_providers": {
  11982. "type": "array",
  11983. "items": {
  11984. "type": "string"
  11985. }
  11986. },
  11987. "enabled_providers": {
  11988. "type": "array",
  11989. "items": {
  11990. "type": "string"
  11991. }
  11992. },
  11993. "model": {
  11994. "type": "string"
  11995. },
  11996. "small_model": {
  11997. "type": "string"
  11998. },
  11999. "default_agent": {
  12000. "type": "string"
  12001. },
  12002. "username": {
  12003. "type": "string"
  12004. },
  12005. "mode": {
  12006. "type": "object",
  12007. "properties": {
  12008. "build": {
  12009. "$ref": "#/components/schemas/AgentConfig"
  12010. },
  12011. "plan": {
  12012. "$ref": "#/components/schemas/AgentConfig"
  12013. }
  12014. },
  12015. "additionalProperties": {
  12016. "$ref": "#/components/schemas/AgentConfig"
  12017. }
  12018. },
  12019. "agent": {
  12020. "type": "object",
  12021. "properties": {
  12022. "plan": {
  12023. "$ref": "#/components/schemas/AgentConfig"
  12024. },
  12025. "build": {
  12026. "$ref": "#/components/schemas/AgentConfig"
  12027. },
  12028. "general": {
  12029. "$ref": "#/components/schemas/AgentConfig"
  12030. },
  12031. "explore": {
  12032. "$ref": "#/components/schemas/AgentConfig"
  12033. },
  12034. "scout": {
  12035. "$ref": "#/components/schemas/AgentConfig"
  12036. },
  12037. "title": {
  12038. "$ref": "#/components/schemas/AgentConfig"
  12039. },
  12040. "summary": {
  12041. "$ref": "#/components/schemas/AgentConfig"
  12042. },
  12043. "compaction": {
  12044. "$ref": "#/components/schemas/AgentConfig"
  12045. }
  12046. },
  12047. "additionalProperties": {
  12048. "$ref": "#/components/schemas/AgentConfig"
  12049. }
  12050. },
  12051. "provider": {
  12052. "type": "object",
  12053. "additionalProperties": {
  12054. "$ref": "#/components/schemas/ProviderConfig"
  12055. }
  12056. },
  12057. "mcp": {
  12058. "type": "object",
  12059. "additionalProperties": {
  12060. "anyOf": [
  12061. {
  12062. "$ref": "#/components/schemas/McpLocalConfig"
  12063. },
  12064. {
  12065. "$ref": "#/components/schemas/McpRemoteConfig"
  12066. },
  12067. {
  12068. "type": "object",
  12069. "properties": {
  12070. "enabled": {
  12071. "type": "boolean"
  12072. }
  12073. },
  12074. "required": ["enabled"],
  12075. "additionalProperties": false
  12076. }
  12077. ]
  12078. }
  12079. },
  12080. "formatter": {
  12081. "anyOf": [
  12082. {
  12083. "type": "boolean"
  12084. },
  12085. {
  12086. "type": "object",
  12087. "additionalProperties": {
  12088. "type": "object",
  12089. "properties": {
  12090. "disabled": {
  12091. "type": "boolean"
  12092. },
  12093. "command": {
  12094. "type": "array",
  12095. "items": {
  12096. "type": "string"
  12097. }
  12098. },
  12099. "environment": {
  12100. "type": "object",
  12101. "additionalProperties": {
  12102. "type": "string"
  12103. }
  12104. },
  12105. "extensions": {
  12106. "type": "array",
  12107. "items": {
  12108. "type": "string"
  12109. }
  12110. }
  12111. },
  12112. "additionalProperties": false
  12113. }
  12114. }
  12115. ],
  12116. "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."
  12117. },
  12118. "lsp": {
  12119. "anyOf": [
  12120. {
  12121. "type": "boolean"
  12122. },
  12123. {
  12124. "type": "object",
  12125. "additionalProperties": {
  12126. "anyOf": [
  12127. {
  12128. "type": "object",
  12129. "properties": {
  12130. "disabled": {
  12131. "type": "boolean",
  12132. "enum": [true]
  12133. }
  12134. },
  12135. "required": ["disabled"],
  12136. "additionalProperties": false
  12137. },
  12138. {
  12139. "type": "object",
  12140. "properties": {
  12141. "command": {
  12142. "type": "array",
  12143. "items": {
  12144. "type": "string"
  12145. }
  12146. },
  12147. "extensions": {
  12148. "type": "array",
  12149. "items": {
  12150. "type": "string"
  12151. }
  12152. },
  12153. "disabled": {
  12154. "type": "boolean"
  12155. },
  12156. "env": {
  12157. "type": "object",
  12158. "additionalProperties": {
  12159. "type": "string"
  12160. }
  12161. },
  12162. "initialization": {
  12163. "type": "object"
  12164. }
  12165. },
  12166. "required": ["command"],
  12167. "additionalProperties": false
  12168. }
  12169. ]
  12170. }
  12171. }
  12172. ],
  12173. "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."
  12174. },
  12175. "instructions": {
  12176. "type": "array",
  12177. "items": {
  12178. "type": "string"
  12179. }
  12180. },
  12181. "layout": {
  12182. "$ref": "#/components/schemas/LayoutConfig"
  12183. },
  12184. "permission": {
  12185. "$ref": "#/components/schemas/PermissionConfig"
  12186. },
  12187. "tools": {
  12188. "type": "object",
  12189. "additionalProperties": {
  12190. "type": "boolean"
  12191. }
  12192. },
  12193. "enterprise": {
  12194. "type": "object",
  12195. "properties": {
  12196. "url": {
  12197. "type": "string"
  12198. }
  12199. },
  12200. "additionalProperties": false
  12201. },
  12202. "tool_output": {
  12203. "type": "object",
  12204. "properties": {
  12205. "max_lines": {
  12206. "type": "integer",
  12207. "exclusiveMinimum": 0
  12208. },
  12209. "max_bytes": {
  12210. "type": "integer",
  12211. "exclusiveMinimum": 0
  12212. }
  12213. },
  12214. "additionalProperties": false
  12215. },
  12216. "compaction": {
  12217. "type": "object",
  12218. "properties": {
  12219. "auto": {
  12220. "type": "boolean"
  12221. },
  12222. "prune": {
  12223. "type": "boolean"
  12224. },
  12225. "tail_turns": {
  12226. "type": "integer",
  12227. "minimum": 0
  12228. },
  12229. "preserve_recent_tokens": {
  12230. "type": "integer",
  12231. "minimum": 0
  12232. },
  12233. "reserved": {
  12234. "type": "integer",
  12235. "minimum": 0
  12236. }
  12237. },
  12238. "additionalProperties": false
  12239. },
  12240. "experimental": {
  12241. "type": "object",
  12242. "properties": {
  12243. "disable_paste_summary": {
  12244. "type": "boolean"
  12245. },
  12246. "batch_tool": {
  12247. "type": "boolean"
  12248. },
  12249. "openTelemetry": {
  12250. "type": "boolean"
  12251. },
  12252. "primary_tools": {
  12253. "type": "array",
  12254. "items": {
  12255. "type": "string"
  12256. }
  12257. },
  12258. "continue_loop_on_deny": {
  12259. "type": "boolean"
  12260. },
  12261. "mcp_timeout": {
  12262. "type": "integer",
  12263. "exclusiveMinimum": 0
  12264. }
  12265. },
  12266. "additionalProperties": false
  12267. }
  12268. },
  12269. "additionalProperties": false
  12270. },
  12271. "Model": {
  12272. "type": "object",
  12273. "properties": {
  12274. "id": {
  12275. "type": "string"
  12276. },
  12277. "providerID": {
  12278. "type": "string"
  12279. },
  12280. "api": {
  12281. "type": "object",
  12282. "properties": {
  12283. "id": {
  12284. "type": "string"
  12285. },
  12286. "url": {
  12287. "type": "string"
  12288. },
  12289. "npm": {
  12290. "type": "string"
  12291. }
  12292. },
  12293. "required": ["id", "url", "npm"],
  12294. "additionalProperties": false
  12295. },
  12296. "name": {
  12297. "type": "string"
  12298. },
  12299. "family": {
  12300. "type": "string"
  12301. },
  12302. "capabilities": {
  12303. "type": "object",
  12304. "properties": {
  12305. "temperature": {
  12306. "type": "boolean"
  12307. },
  12308. "reasoning": {
  12309. "type": "boolean"
  12310. },
  12311. "attachment": {
  12312. "type": "boolean"
  12313. },
  12314. "toolcall": {
  12315. "type": "boolean"
  12316. },
  12317. "input": {
  12318. "type": "object",
  12319. "properties": {
  12320. "text": {
  12321. "type": "boolean"
  12322. },
  12323. "audio": {
  12324. "type": "boolean"
  12325. },
  12326. "image": {
  12327. "type": "boolean"
  12328. },
  12329. "video": {
  12330. "type": "boolean"
  12331. },
  12332. "pdf": {
  12333. "type": "boolean"
  12334. }
  12335. },
  12336. "required": ["text", "audio", "image", "video", "pdf"],
  12337. "additionalProperties": false
  12338. },
  12339. "output": {
  12340. "type": "object",
  12341. "properties": {
  12342. "text": {
  12343. "type": "boolean"
  12344. },
  12345. "audio": {
  12346. "type": "boolean"
  12347. },
  12348. "image": {
  12349. "type": "boolean"
  12350. },
  12351. "video": {
  12352. "type": "boolean"
  12353. },
  12354. "pdf": {
  12355. "type": "boolean"
  12356. }
  12357. },
  12358. "required": ["text", "audio", "image", "video", "pdf"],
  12359. "additionalProperties": false
  12360. },
  12361. "interleaved": {
  12362. "anyOf": [
  12363. {
  12364. "type": "boolean"
  12365. },
  12366. {
  12367. "type": "object",
  12368. "properties": {
  12369. "field": {
  12370. "type": "string",
  12371. "enum": ["reasoning_content", "reasoning_details"]
  12372. }
  12373. },
  12374. "required": ["field"],
  12375. "additionalProperties": false
  12376. }
  12377. ]
  12378. }
  12379. },
  12380. "required": ["temperature", "reasoning", "attachment", "toolcall", "input", "output", "interleaved"],
  12381. "additionalProperties": false
  12382. },
  12383. "cost": {
  12384. "type": "object",
  12385. "properties": {
  12386. "input": {
  12387. "type": "number"
  12388. },
  12389. "output": {
  12390. "type": "number"
  12391. },
  12392. "cache": {
  12393. "type": "object",
  12394. "properties": {
  12395. "read": {
  12396. "type": "number"
  12397. },
  12398. "write": {
  12399. "type": "number"
  12400. }
  12401. },
  12402. "required": ["read", "write"],
  12403. "additionalProperties": false
  12404. },
  12405. "experimentalOver200K": {
  12406. "type": "object",
  12407. "properties": {
  12408. "input": {
  12409. "type": "number"
  12410. },
  12411. "output": {
  12412. "type": "number"
  12413. },
  12414. "cache": {
  12415. "type": "object",
  12416. "properties": {
  12417. "read": {
  12418. "type": "number"
  12419. },
  12420. "write": {
  12421. "type": "number"
  12422. }
  12423. },
  12424. "required": ["read", "write"],
  12425. "additionalProperties": false
  12426. }
  12427. },
  12428. "required": ["input", "output", "cache"],
  12429. "additionalProperties": false
  12430. }
  12431. },
  12432. "required": ["input", "output", "cache"],
  12433. "additionalProperties": false
  12434. },
  12435. "limit": {
  12436. "type": "object",
  12437. "properties": {
  12438. "context": {
  12439. "type": "number"
  12440. },
  12441. "input": {
  12442. "type": "number"
  12443. },
  12444. "output": {
  12445. "type": "number"
  12446. }
  12447. },
  12448. "required": ["context", "output"],
  12449. "additionalProperties": false
  12450. },
  12451. "status": {
  12452. "type": "string",
  12453. "enum": ["alpha", "beta", "deprecated", "active"]
  12454. },
  12455. "options": {
  12456. "type": "object"
  12457. },
  12458. "headers": {
  12459. "type": "object",
  12460. "additionalProperties": {
  12461. "type": "string"
  12462. }
  12463. },
  12464. "release_date": {
  12465. "type": "string"
  12466. },
  12467. "variants": {
  12468. "type": "object",
  12469. "additionalProperties": {
  12470. "type": "object"
  12471. }
  12472. }
  12473. },
  12474. "required": [
  12475. "id",
  12476. "providerID",
  12477. "api",
  12478. "name",
  12479. "capabilities",
  12480. "cost",
  12481. "limit",
  12482. "status",
  12483. "options",
  12484. "headers",
  12485. "release_date"
  12486. ],
  12487. "additionalProperties": false
  12488. },
  12489. "Provider": {
  12490. "type": "object",
  12491. "properties": {
  12492. "id": {
  12493. "type": "string"
  12494. },
  12495. "name": {
  12496. "type": "string"
  12497. },
  12498. "source": {
  12499. "type": "string",
  12500. "enum": ["env", "config", "custom", "api"]
  12501. },
  12502. "env": {
  12503. "type": "array",
  12504. "items": {
  12505. "type": "string"
  12506. }
  12507. },
  12508. "key": {
  12509. "type": "string"
  12510. },
  12511. "options": {
  12512. "type": "object"
  12513. },
  12514. "models": {
  12515. "type": "object",
  12516. "additionalProperties": {
  12517. "$ref": "#/components/schemas/Model"
  12518. }
  12519. }
  12520. },
  12521. "required": ["id", "name", "source", "env", "options", "models"],
  12522. "additionalProperties": false
  12523. },
  12524. "ConsoleState": {
  12525. "type": "object",
  12526. "properties": {
  12527. "consoleManagedProviders": {
  12528. "type": "array",
  12529. "items": {
  12530. "type": "string"
  12531. }
  12532. },
  12533. "activeOrgName": {
  12534. "type": "string"
  12535. },
  12536. "switchableOrgCount": {
  12537. "type": "integer",
  12538. "minimum": 0
  12539. }
  12540. },
  12541. "required": ["consoleManagedProviders", "switchableOrgCount"],
  12542. "additionalProperties": false
  12543. },
  12544. "effect_HttpApiError_InternalServerError": {
  12545. "type": "object",
  12546. "properties": {
  12547. "_tag": {
  12548. "type": "string",
  12549. "enum": ["InternalServerError"]
  12550. }
  12551. },
  12552. "required": ["_tag"],
  12553. "additionalProperties": false
  12554. },
  12555. "ToolListItem": {
  12556. "type": "object",
  12557. "properties": {
  12558. "id": {
  12559. "type": "string"
  12560. },
  12561. "description": {
  12562. "type": "string"
  12563. },
  12564. "parameters": {}
  12565. },
  12566. "required": ["id", "description", "parameters"],
  12567. "additionalProperties": false
  12568. },
  12569. "ToolList": {
  12570. "type": "array",
  12571. "items": {
  12572. "$ref": "#/components/schemas/ToolListItem"
  12573. }
  12574. },
  12575. "ToolIDs": {
  12576. "type": "array",
  12577. "items": {
  12578. "type": "string"
  12579. }
  12580. },
  12581. "WorktreeCreateInput": {
  12582. "type": "object",
  12583. "properties": {
  12584. "name": {
  12585. "type": "string"
  12586. },
  12587. "startCommand": {
  12588. "type": "string",
  12589. "description": "Additional startup script to run after the project's start command"
  12590. }
  12591. },
  12592. "additionalProperties": false
  12593. },
  12594. "Worktree": {
  12595. "type": "object",
  12596. "properties": {
  12597. "name": {
  12598. "type": "string"
  12599. },
  12600. "branch": {
  12601. "type": "string"
  12602. },
  12603. "directory": {
  12604. "type": "string"
  12605. }
  12606. },
  12607. "required": ["name", "branch", "directory"],
  12608. "additionalProperties": false
  12609. },
  12610. "WorktreeRemoveInput": {
  12611. "type": "object",
  12612. "properties": {
  12613. "directory": {
  12614. "type": "string"
  12615. }
  12616. },
  12617. "required": ["directory"],
  12618. "additionalProperties": false
  12619. },
  12620. "WorktreeResetInput": {
  12621. "type": "object",
  12622. "properties": {
  12623. "directory": {
  12624. "type": "string"
  12625. }
  12626. },
  12627. "required": ["directory"],
  12628. "additionalProperties": false
  12629. },
  12630. "ProjectSummary": {
  12631. "type": "object",
  12632. "properties": {
  12633. "id": {
  12634. "type": "string"
  12635. },
  12636. "name": {
  12637. "type": "string"
  12638. },
  12639. "worktree": {
  12640. "type": "string"
  12641. }
  12642. },
  12643. "required": ["id", "worktree"],
  12644. "additionalProperties": false
  12645. },
  12646. "GlobalSession": {
  12647. "type": "object",
  12648. "properties": {
  12649. "id": {
  12650. "type": "string"
  12651. },
  12652. "slug": {
  12653. "type": "string"
  12654. },
  12655. "projectID": {
  12656. "type": "string"
  12657. },
  12658. "workspaceID": {
  12659. "type": "string"
  12660. },
  12661. "directory": {
  12662. "type": "string"
  12663. },
  12664. "path": {
  12665. "type": "string"
  12666. },
  12667. "parentID": {
  12668. "type": "string"
  12669. },
  12670. "summary": {
  12671. "type": "object",
  12672. "properties": {
  12673. "additions": {
  12674. "type": "integer",
  12675. "minimum": 0
  12676. },
  12677. "deletions": {
  12678. "type": "integer",
  12679. "minimum": 0
  12680. },
  12681. "files": {
  12682. "type": "integer",
  12683. "minimum": 0
  12684. },
  12685. "diffs": {
  12686. "type": "array",
  12687. "items": {
  12688. "$ref": "#/components/schemas/SnapshotFileDiff"
  12689. }
  12690. }
  12691. },
  12692. "required": ["additions", "deletions", "files"],
  12693. "additionalProperties": false
  12694. },
  12695. "share": {
  12696. "type": "object",
  12697. "properties": {
  12698. "url": {
  12699. "type": "string"
  12700. }
  12701. },
  12702. "required": ["url"],
  12703. "additionalProperties": false
  12704. },
  12705. "title": {
  12706. "type": "string"
  12707. },
  12708. "agent": {
  12709. "type": "string"
  12710. },
  12711. "model": {
  12712. "type": "object",
  12713. "properties": {
  12714. "id": {
  12715. "type": "string"
  12716. },
  12717. "providerID": {
  12718. "type": "string"
  12719. },
  12720. "variant": {
  12721. "type": "string"
  12722. }
  12723. },
  12724. "required": ["id", "providerID"],
  12725. "additionalProperties": false
  12726. },
  12727. "version": {
  12728. "type": "string"
  12729. },
  12730. "time": {
  12731. "type": "object",
  12732. "properties": {
  12733. "created": {
  12734. "type": "integer",
  12735. "minimum": 0
  12736. },
  12737. "updated": {
  12738. "type": "integer",
  12739. "minimum": 0
  12740. },
  12741. "compacting": {
  12742. "type": "integer",
  12743. "minimum": 0
  12744. },
  12745. "archived": {
  12746. "type": "number"
  12747. }
  12748. },
  12749. "required": ["created", "updated"],
  12750. "additionalProperties": false
  12751. },
  12752. "permission": {
  12753. "$ref": "#/components/schemas/PermissionRuleset"
  12754. },
  12755. "revert": {
  12756. "type": "object",
  12757. "properties": {
  12758. "messageID": {
  12759. "type": "string"
  12760. },
  12761. "partID": {
  12762. "type": "string"
  12763. },
  12764. "snapshot": {
  12765. "type": "string"
  12766. },
  12767. "diff": {
  12768. "type": "string"
  12769. }
  12770. },
  12771. "required": ["messageID"],
  12772. "additionalProperties": false
  12773. },
  12774. "project": {
  12775. "anyOf": [
  12776. {
  12777. "$ref": "#/components/schemas/ProjectSummary"
  12778. },
  12779. {
  12780. "type": "null"
  12781. }
  12782. ]
  12783. }
  12784. },
  12785. "required": ["id", "slug", "projectID", "directory", "title", "version", "time", "project"],
  12786. "additionalProperties": false
  12787. },
  12788. "McpResource": {
  12789. "type": "object",
  12790. "properties": {
  12791. "name": {
  12792. "type": "string"
  12793. },
  12794. "uri": {
  12795. "type": "string"
  12796. },
  12797. "description": {
  12798. "type": "string"
  12799. },
  12800. "mimeType": {
  12801. "type": "string"
  12802. },
  12803. "client": {
  12804. "type": "string"
  12805. }
  12806. },
  12807. "required": ["name", "uri", "client"],
  12808. "additionalProperties": false
  12809. },
  12810. "Symbol": {
  12811. "type": "object",
  12812. "properties": {
  12813. "name": {
  12814. "type": "string"
  12815. },
  12816. "kind": {
  12817. "type": "integer",
  12818. "minimum": 0
  12819. },
  12820. "location": {
  12821. "type": "object",
  12822. "properties": {
  12823. "uri": {
  12824. "type": "string"
  12825. },
  12826. "range": {
  12827. "$ref": "#/components/schemas/Range"
  12828. }
  12829. },
  12830. "required": ["uri", "range"],
  12831. "additionalProperties": false
  12832. }
  12833. },
  12834. "required": ["name", "kind", "location"],
  12835. "additionalProperties": false
  12836. },
  12837. "FileNode": {
  12838. "type": "object",
  12839. "properties": {
  12840. "name": {
  12841. "type": "string"
  12842. },
  12843. "path": {
  12844. "type": "string"
  12845. },
  12846. "absolute": {
  12847. "type": "string"
  12848. },
  12849. "type": {
  12850. "type": "string",
  12851. "enum": ["file", "directory"]
  12852. },
  12853. "ignored": {
  12854. "type": "boolean"
  12855. }
  12856. },
  12857. "required": ["name", "path", "absolute", "type", "ignored"],
  12858. "additionalProperties": false
  12859. },
  12860. "FileContent": {
  12861. "type": "object",
  12862. "properties": {
  12863. "type": {
  12864. "type": "string",
  12865. "enum": ["text", "binary"]
  12866. },
  12867. "content": {
  12868. "type": "string"
  12869. },
  12870. "diff": {
  12871. "type": "string"
  12872. },
  12873. "patch": {
  12874. "type": "object",
  12875. "properties": {
  12876. "oldFileName": {
  12877. "type": "string"
  12878. },
  12879. "newFileName": {
  12880. "type": "string"
  12881. },
  12882. "oldHeader": {
  12883. "type": "string"
  12884. },
  12885. "newHeader": {
  12886. "type": "string"
  12887. },
  12888. "hunks": {
  12889. "type": "array",
  12890. "items": {
  12891. "type": "object",
  12892. "properties": {
  12893. "oldStart": {
  12894. "type": "integer",
  12895. "minimum": 0
  12896. },
  12897. "oldLines": {
  12898. "type": "integer",
  12899. "minimum": 0
  12900. },
  12901. "newStart": {
  12902. "type": "integer",
  12903. "minimum": 0
  12904. },
  12905. "newLines": {
  12906. "type": "integer",
  12907. "minimum": 0
  12908. },
  12909. "lines": {
  12910. "type": "array",
  12911. "items": {
  12912. "type": "string"
  12913. }
  12914. }
  12915. },
  12916. "required": ["oldStart", "oldLines", "newStart", "newLines", "lines"],
  12917. "additionalProperties": false
  12918. }
  12919. },
  12920. "index": {
  12921. "type": "string"
  12922. }
  12923. },
  12924. "required": ["oldFileName", "newFileName", "hunks"],
  12925. "additionalProperties": false
  12926. },
  12927. "encoding": {
  12928. "type": "string",
  12929. "enum": ["base64"]
  12930. },
  12931. "mimeType": {
  12932. "type": "string"
  12933. }
  12934. },
  12935. "required": ["type", "content"],
  12936. "additionalProperties": false
  12937. },
  12938. "File": {
  12939. "type": "object",
  12940. "properties": {
  12941. "path": {
  12942. "type": "string"
  12943. },
  12944. "added": {
  12945. "type": "integer",
  12946. "minimum": 0
  12947. },
  12948. "removed": {
  12949. "type": "integer",
  12950. "minimum": 0
  12951. },
  12952. "status": {
  12953. "type": "string",
  12954. "enum": ["added", "deleted", "modified"]
  12955. }
  12956. },
  12957. "required": ["path", "added", "removed", "status"],
  12958. "additionalProperties": false
  12959. },
  12960. "Path": {
  12961. "type": "object",
  12962. "properties": {
  12963. "home": {
  12964. "type": "string"
  12965. },
  12966. "state": {
  12967. "type": "string"
  12968. },
  12969. "config": {
  12970. "type": "string"
  12971. },
  12972. "worktree": {
  12973. "type": "string"
  12974. },
  12975. "directory": {
  12976. "type": "string"
  12977. }
  12978. },
  12979. "required": ["home", "state", "config", "worktree", "directory"],
  12980. "additionalProperties": false
  12981. },
  12982. "VcsInfo": {
  12983. "type": "object",
  12984. "properties": {
  12985. "branch": {
  12986. "type": "string"
  12987. },
  12988. "default_branch": {
  12989. "type": "string"
  12990. }
  12991. },
  12992. "additionalProperties": false
  12993. },
  12994. "VcsFileStatus": {
  12995. "type": "object",
  12996. "properties": {
  12997. "file": {
  12998. "type": "string"
  12999. },
  13000. "additions": {
  13001. "type": "integer",
  13002. "minimum": 0
  13003. },
  13004. "deletions": {
  13005. "type": "integer",
  13006. "minimum": 0
  13007. },
  13008. "status": {
  13009. "type": "string",
  13010. "enum": ["added", "deleted", "modified"]
  13011. }
  13012. },
  13013. "required": ["file", "additions", "deletions", "status"],
  13014. "additionalProperties": false
  13015. },
  13016. "VcsFileDiff": {
  13017. "type": "object",
  13018. "properties": {
  13019. "file": {
  13020. "type": "string"
  13021. },
  13022. "patch": {
  13023. "type": "string"
  13024. },
  13025. "additions": {
  13026. "type": "integer",
  13027. "minimum": 0
  13028. },
  13029. "deletions": {
  13030. "type": "integer",
  13031. "minimum": 0
  13032. },
  13033. "status": {
  13034. "type": "string",
  13035. "enum": ["added", "deleted", "modified"]
  13036. }
  13037. },
  13038. "required": ["file", "patch", "additions", "deletions"],
  13039. "additionalProperties": false
  13040. },
  13041. "VcsApplyError": {
  13042. "type": "object",
  13043. "properties": {
  13044. "name": {
  13045. "type": "string",
  13046. "enum": ["VcsApplyError"]
  13047. },
  13048. "data": {
  13049. "type": "object",
  13050. "properties": {
  13051. "message": {
  13052. "type": "string"
  13053. },
  13054. "reason": {
  13055. "type": "string",
  13056. "enum": ["non-git", "not-clean"]
  13057. }
  13058. },
  13059. "required": ["message", "reason"],
  13060. "additionalProperties": false
  13061. }
  13062. },
  13063. "required": ["name", "data"],
  13064. "additionalProperties": false
  13065. },
  13066. "Command": {
  13067. "type": "object",
  13068. "properties": {
  13069. "name": {
  13070. "type": "string"
  13071. },
  13072. "description": {
  13073. "type": "string"
  13074. },
  13075. "agent": {
  13076. "type": "string"
  13077. },
  13078. "model": {
  13079. "type": "string"
  13080. },
  13081. "source": {
  13082. "type": "string",
  13083. "enum": ["command", "mcp", "skill"]
  13084. },
  13085. "template": {
  13086. "type": "string"
  13087. },
  13088. "subtask": {
  13089. "type": "boolean"
  13090. },
  13091. "hints": {
  13092. "type": "array",
  13093. "items": {
  13094. "type": "string"
  13095. }
  13096. }
  13097. },
  13098. "required": ["name", "template", "hints"],
  13099. "additionalProperties": false
  13100. },
  13101. "Agent": {
  13102. "type": "object",
  13103. "properties": {
  13104. "name": {
  13105. "type": "string"
  13106. },
  13107. "description": {
  13108. "type": "string"
  13109. },
  13110. "mode": {
  13111. "type": "string",
  13112. "enum": ["subagent", "primary", "all"]
  13113. },
  13114. "native": {
  13115. "type": "boolean"
  13116. },
  13117. "hidden": {
  13118. "type": "boolean"
  13119. },
  13120. "topP": {
  13121. "type": "number"
  13122. },
  13123. "temperature": {
  13124. "type": "number"
  13125. },
  13126. "color": {
  13127. "type": "string"
  13128. },
  13129. "permission": {
  13130. "$ref": "#/components/schemas/PermissionRuleset"
  13131. },
  13132. "model": {
  13133. "type": "object",
  13134. "properties": {
  13135. "modelID": {
  13136. "type": "string"
  13137. },
  13138. "providerID": {
  13139. "type": "string"
  13140. }
  13141. },
  13142. "required": ["modelID", "providerID"],
  13143. "additionalProperties": false
  13144. },
  13145. "variant": {
  13146. "type": "string"
  13147. },
  13148. "prompt": {
  13149. "type": "string"
  13150. },
  13151. "options": {
  13152. "type": "object"
  13153. },
  13154. "steps": {
  13155. "type": "number"
  13156. }
  13157. },
  13158. "required": ["name", "mode", "permission", "options"],
  13159. "additionalProperties": false
  13160. },
  13161. "LSPStatus": {
  13162. "type": "object",
  13163. "properties": {
  13164. "id": {
  13165. "type": "string"
  13166. },
  13167. "name": {
  13168. "type": "string"
  13169. },
  13170. "root": {
  13171. "type": "string"
  13172. },
  13173. "status": {
  13174. "type": "string",
  13175. "enum": ["connected", "error"]
  13176. }
  13177. },
  13178. "required": ["id", "name", "root", "status"],
  13179. "additionalProperties": false
  13180. },
  13181. "FormatterStatus": {
  13182. "type": "object",
  13183. "properties": {
  13184. "name": {
  13185. "type": "string"
  13186. },
  13187. "extensions": {
  13188. "type": "array",
  13189. "items": {
  13190. "type": "string"
  13191. }
  13192. },
  13193. "enabled": {
  13194. "type": "boolean"
  13195. }
  13196. },
  13197. "required": ["name", "extensions", "enabled"],
  13198. "additionalProperties": false
  13199. },
  13200. "MCPStatusConnected": {
  13201. "type": "object",
  13202. "properties": {
  13203. "status": {
  13204. "type": "string",
  13205. "enum": ["connected"]
  13206. }
  13207. },
  13208. "required": ["status"],
  13209. "additionalProperties": false
  13210. },
  13211. "MCPStatusDisabled": {
  13212. "type": "object",
  13213. "properties": {
  13214. "status": {
  13215. "type": "string",
  13216. "enum": ["disabled"]
  13217. }
  13218. },
  13219. "required": ["status"],
  13220. "additionalProperties": false
  13221. },
  13222. "MCPStatusFailed": {
  13223. "type": "object",
  13224. "properties": {
  13225. "status": {
  13226. "type": "string",
  13227. "enum": ["failed"]
  13228. },
  13229. "error": {
  13230. "type": "string"
  13231. }
  13232. },
  13233. "required": ["status", "error"],
  13234. "additionalProperties": false
  13235. },
  13236. "MCPStatusNeedsAuth": {
  13237. "type": "object",
  13238. "properties": {
  13239. "status": {
  13240. "type": "string",
  13241. "enum": ["needs_auth"]
  13242. }
  13243. },
  13244. "required": ["status"],
  13245. "additionalProperties": false
  13246. },
  13247. "MCPStatusNeedsClientRegistration": {
  13248. "type": "object",
  13249. "properties": {
  13250. "status": {
  13251. "type": "string",
  13252. "enum": ["needs_client_registration"]
  13253. },
  13254. "error": {
  13255. "type": "string"
  13256. }
  13257. },
  13258. "required": ["status", "error"],
  13259. "additionalProperties": false
  13260. },
  13261. "MCPStatus": {
  13262. "anyOf": [
  13263. {
  13264. "$ref": "#/components/schemas/MCPStatusConnected"
  13265. },
  13266. {
  13267. "$ref": "#/components/schemas/MCPStatusDisabled"
  13268. },
  13269. {
  13270. "$ref": "#/components/schemas/MCPStatusFailed"
  13271. },
  13272. {
  13273. "$ref": "#/components/schemas/MCPStatusNeedsAuth"
  13274. },
  13275. {
  13276. "$ref": "#/components/schemas/MCPStatusNeedsClientRegistration"
  13277. }
  13278. ]
  13279. },
  13280. "McpUnsupportedOAuthError": {
  13281. "type": "object",
  13282. "properties": {
  13283. "error": {
  13284. "type": "string"
  13285. }
  13286. },
  13287. "required": ["error"],
  13288. "additionalProperties": false
  13289. },
  13290. "NotFoundError": {
  13291. "type": "object",
  13292. "required": ["name", "data"],
  13293. "properties": {
  13294. "name": {
  13295. "type": "string",
  13296. "enum": ["NotFoundError"]
  13297. },
  13298. "data": {
  13299. "type": "object",
  13300. "required": ["message"],
  13301. "properties": {
  13302. "message": {
  13303. "type": "string"
  13304. }
  13305. }
  13306. }
  13307. }
  13308. },
  13309. "effect_HttpApiError_Forbidden": {
  13310. "type": "object",
  13311. "properties": {
  13312. "_tag": {
  13313. "type": "string",
  13314. "enum": ["Forbidden"]
  13315. }
  13316. },
  13317. "required": ["_tag"],
  13318. "additionalProperties": false
  13319. },
  13320. "ProviderAuthMethod": {
  13321. "type": "object",
  13322. "properties": {
  13323. "type": {
  13324. "type": "string",
  13325. "enum": ["oauth", "api"]
  13326. },
  13327. "label": {
  13328. "type": "string"
  13329. },
  13330. "prompts": {
  13331. "type": "array",
  13332. "items": {
  13333. "anyOf": [
  13334. {
  13335. "type": "object",
  13336. "properties": {
  13337. "type": {
  13338. "type": "string",
  13339. "enum": ["text"]
  13340. },
  13341. "key": {
  13342. "type": "string"
  13343. },
  13344. "message": {
  13345. "type": "string"
  13346. },
  13347. "placeholder": {
  13348. "type": "string"
  13349. },
  13350. "when": {
  13351. "type": "object",
  13352. "properties": {
  13353. "key": {
  13354. "type": "string"
  13355. },
  13356. "op": {
  13357. "type": "string",
  13358. "enum": ["eq", "neq"]
  13359. },
  13360. "value": {
  13361. "type": "string"
  13362. }
  13363. },
  13364. "required": ["key", "op", "value"],
  13365. "additionalProperties": false
  13366. }
  13367. },
  13368. "required": ["type", "key", "message"],
  13369. "additionalProperties": false
  13370. },
  13371. {
  13372. "type": "object",
  13373. "properties": {
  13374. "type": {
  13375. "type": "string",
  13376. "enum": ["select"]
  13377. },
  13378. "key": {
  13379. "type": "string"
  13380. },
  13381. "message": {
  13382. "type": "string"
  13383. },
  13384. "options": {
  13385. "type": "array",
  13386. "items": {
  13387. "type": "object",
  13388. "properties": {
  13389. "label": {
  13390. "type": "string"
  13391. },
  13392. "value": {
  13393. "type": "string"
  13394. },
  13395. "hint": {
  13396. "type": "string"
  13397. }
  13398. },
  13399. "required": ["label", "value"],
  13400. "additionalProperties": false
  13401. }
  13402. },
  13403. "when": {
  13404. "type": "object",
  13405. "properties": {
  13406. "key": {
  13407. "type": "string"
  13408. },
  13409. "op": {
  13410. "type": "string",
  13411. "enum": ["eq", "neq"]
  13412. },
  13413. "value": {
  13414. "type": "string"
  13415. }
  13416. },
  13417. "required": ["key", "op", "value"],
  13418. "additionalProperties": false
  13419. }
  13420. },
  13421. "required": ["type", "key", "message", "options"],
  13422. "additionalProperties": false
  13423. }
  13424. ]
  13425. }
  13426. }
  13427. },
  13428. "required": ["type", "label"],
  13429. "additionalProperties": false
  13430. },
  13431. "ProviderAuthAuthorization": {
  13432. "type": "object",
  13433. "properties": {
  13434. "url": {
  13435. "type": "string"
  13436. },
  13437. "method": {
  13438. "type": "string",
  13439. "enum": ["auto", "code"]
  13440. },
  13441. "instructions": {
  13442. "type": "string"
  13443. }
  13444. },
  13445. "required": ["url", "method", "instructions"],
  13446. "additionalProperties": false
  13447. },
  13448. "TextPartInput": {
  13449. "type": "object",
  13450. "properties": {
  13451. "id": {
  13452. "type": "string"
  13453. },
  13454. "type": {
  13455. "type": "string",
  13456. "enum": ["text"]
  13457. },
  13458. "text": {
  13459. "type": "string"
  13460. },
  13461. "synthetic": {
  13462. "type": "boolean"
  13463. },
  13464. "ignored": {
  13465. "type": "boolean"
  13466. },
  13467. "time": {
  13468. "type": "object",
  13469. "properties": {
  13470. "start": {
  13471. "type": "integer",
  13472. "minimum": 0
  13473. },
  13474. "end": {
  13475. "type": "integer",
  13476. "minimum": 0
  13477. }
  13478. },
  13479. "required": ["start"],
  13480. "additionalProperties": false
  13481. },
  13482. "metadata": {
  13483. "type": "object"
  13484. }
  13485. },
  13486. "required": ["type", "text"],
  13487. "additionalProperties": false
  13488. },
  13489. "FilePartInput": {
  13490. "type": "object",
  13491. "properties": {
  13492. "id": {
  13493. "type": "string"
  13494. },
  13495. "type": {
  13496. "type": "string",
  13497. "enum": ["file"]
  13498. },
  13499. "mime": {
  13500. "type": "string"
  13501. },
  13502. "filename": {
  13503. "type": "string"
  13504. },
  13505. "url": {
  13506. "type": "string"
  13507. },
  13508. "source": {
  13509. "$ref": "#/components/schemas/FilePartSource"
  13510. }
  13511. },
  13512. "required": ["type", "mime", "url"],
  13513. "additionalProperties": false
  13514. },
  13515. "AgentPartInput": {
  13516. "type": "object",
  13517. "properties": {
  13518. "id": {
  13519. "type": "string"
  13520. },
  13521. "type": {
  13522. "type": "string",
  13523. "enum": ["agent"]
  13524. },
  13525. "name": {
  13526. "type": "string"
  13527. },
  13528. "source": {
  13529. "type": "object",
  13530. "properties": {
  13531. "value": {
  13532. "type": "string"
  13533. },
  13534. "start": {
  13535. "type": "integer",
  13536. "minimum": 0
  13537. },
  13538. "end": {
  13539. "type": "integer",
  13540. "minimum": 0
  13541. }
  13542. },
  13543. "required": ["value", "start", "end"],
  13544. "additionalProperties": false
  13545. }
  13546. },
  13547. "required": ["type", "name"],
  13548. "additionalProperties": false
  13549. },
  13550. "SubtaskPartInput": {
  13551. "type": "object",
  13552. "properties": {
  13553. "id": {
  13554. "type": "string"
  13555. },
  13556. "type": {
  13557. "type": "string",
  13558. "enum": ["subtask"]
  13559. },
  13560. "prompt": {
  13561. "type": "string"
  13562. },
  13563. "description": {
  13564. "type": "string"
  13565. },
  13566. "agent": {
  13567. "type": "string"
  13568. },
  13569. "model": {
  13570. "type": "object",
  13571. "properties": {
  13572. "providerID": {
  13573. "type": "string"
  13574. },
  13575. "modelID": {
  13576. "type": "string"
  13577. }
  13578. },
  13579. "required": ["providerID", "modelID"],
  13580. "additionalProperties": false
  13581. },
  13582. "command": {
  13583. "type": "string"
  13584. }
  13585. },
  13586. "required": ["type", "prompt", "description", "agent"],
  13587. "additionalProperties": false
  13588. },
  13589. "V2SessionsResponse": {
  13590. "type": "object",
  13591. "properties": {
  13592. "items": {
  13593. "type": "array",
  13594. "items": {
  13595. "$ref": "#/components/schemas/SessionInfo"
  13596. }
  13597. },
  13598. "cursor": {
  13599. "type": "object",
  13600. "properties": {
  13601. "previous": {
  13602. "type": "string"
  13603. },
  13604. "next": {
  13605. "type": "string"
  13606. }
  13607. },
  13608. "additionalProperties": false
  13609. }
  13610. },
  13611. "required": ["items", "cursor"],
  13612. "additionalProperties": false
  13613. },
  13614. "V2SessionMessagesResponse": {
  13615. "type": "object",
  13616. "properties": {
  13617. "items": {
  13618. "type": "array",
  13619. "items": {
  13620. "$ref": "#/components/schemas/SessionMessage"
  13621. }
  13622. },
  13623. "cursor": {
  13624. "type": "object",
  13625. "properties": {
  13626. "previous": {
  13627. "type": "string"
  13628. },
  13629. "next": {
  13630. "type": "string"
  13631. }
  13632. },
  13633. "additionalProperties": false
  13634. }
  13635. },
  13636. "required": ["items", "cursor"],
  13637. "additionalProperties": false
  13638. },
  13639. "EventTuiPromptAppend": {
  13640. "type": "object",
  13641. "properties": {
  13642. "type": {
  13643. "type": "string",
  13644. "enum": ["tui.prompt.append"]
  13645. },
  13646. "properties": {
  13647. "type": "object",
  13648. "properties": {
  13649. "text": {
  13650. "type": "string"
  13651. }
  13652. },
  13653. "required": ["text"],
  13654. "additionalProperties": false
  13655. }
  13656. },
  13657. "required": ["type", "properties"],
  13658. "additionalProperties": false
  13659. },
  13660. "EventTuiCommandExecute": {
  13661. "type": "object",
  13662. "properties": {
  13663. "type": {
  13664. "type": "string",
  13665. "enum": ["tui.command.execute"]
  13666. },
  13667. "properties": {
  13668. "type": "object",
  13669. "properties": {
  13670. "command": {
  13671. "anyOf": [
  13672. {
  13673. "type": "string",
  13674. "enum": [
  13675. "session.list",
  13676. "session.new",
  13677. "session.share",
  13678. "session.interrupt",
  13679. "session.compact",
  13680. "session.page.up",
  13681. "session.page.down",
  13682. "session.line.up",
  13683. "session.line.down",
  13684. "session.half.page.up",
  13685. "session.half.page.down",
  13686. "session.first",
  13687. "session.last",
  13688. "prompt.clear",
  13689. "prompt.submit",
  13690. "agent.cycle"
  13691. ]
  13692. },
  13693. {
  13694. "type": "string"
  13695. }
  13696. ]
  13697. }
  13698. },
  13699. "required": ["command"],
  13700. "additionalProperties": false
  13701. }
  13702. },
  13703. "required": ["type", "properties"],
  13704. "additionalProperties": false
  13705. },
  13706. "EventTuiToastShow": {
  13707. "type": "object",
  13708. "properties": {
  13709. "type": {
  13710. "type": "string",
  13711. "enum": ["tui.toast.show"]
  13712. },
  13713. "properties": {
  13714. "type": "object",
  13715. "properties": {
  13716. "title": {
  13717. "type": "string"
  13718. },
  13719. "message": {
  13720. "type": "string"
  13721. },
  13722. "variant": {
  13723. "type": "string",
  13724. "enum": ["info", "success", "warning", "error"]
  13725. },
  13726. "duration": {
  13727. "type": "integer",
  13728. "exclusiveMinimum": 0
  13729. }
  13730. },
  13731. "required": ["message", "variant"],
  13732. "additionalProperties": false
  13733. }
  13734. },
  13735. "required": ["type", "properties"],
  13736. "additionalProperties": false
  13737. },
  13738. "EventTuiSessionSelect": {
  13739. "type": "object",
  13740. "properties": {
  13741. "type": {
  13742. "type": "string",
  13743. "enum": ["tui.session.select"]
  13744. },
  13745. "properties": {
  13746. "type": "object",
  13747. "properties": {
  13748. "sessionID": {
  13749. "type": "string",
  13750. "description": "Session ID to navigate to"
  13751. }
  13752. },
  13753. "required": ["sessionID"],
  13754. "additionalProperties": false
  13755. }
  13756. },
  13757. "required": ["type", "properties"],
  13758. "additionalProperties": false
  13759. },
  13760. "Workspace": {
  13761. "type": "object",
  13762. "properties": {
  13763. "id": {
  13764. "type": "string"
  13765. },
  13766. "type": {
  13767. "type": "string"
  13768. },
  13769. "name": {
  13770. "type": "string"
  13771. },
  13772. "branch": {
  13773. "anyOf": [
  13774. {
  13775. "type": "string"
  13776. },
  13777. {
  13778. "type": "null"
  13779. }
  13780. ]
  13781. },
  13782. "directory": {
  13783. "anyOf": [
  13784. {
  13785. "type": "string"
  13786. },
  13787. {
  13788. "type": "null"
  13789. }
  13790. ]
  13791. },
  13792. "extra": {
  13793. "anyOf": [
  13794. {},
  13795. {
  13796. "type": "null"
  13797. }
  13798. ]
  13799. },
  13800. "projectID": {
  13801. "type": "string"
  13802. },
  13803. "timeUsed": {
  13804. "anyOf": [
  13805. {
  13806. "type": "number"
  13807. },
  13808. {
  13809. "type": "string",
  13810. "enum": ["NaN"]
  13811. },
  13812. {
  13813. "type": "string",
  13814. "enum": ["Infinity"]
  13815. },
  13816. {
  13817. "type": "string",
  13818. "enum": ["-Infinity"]
  13819. },
  13820. {
  13821. "type": "string",
  13822. "enum": ["Infinity", "-Infinity", "NaN"]
  13823. }
  13824. ]
  13825. }
  13826. },
  13827. "required": ["id", "type", "name", "branch", "directory", "extra", "projectID", "timeUsed"],
  13828. "additionalProperties": false
  13829. },
  13830. "WorkspaceWarpError": {
  13831. "type": "object",
  13832. "properties": {
  13833. "name": {
  13834. "type": "string",
  13835. "enum": ["WorkspaceWarpError"]
  13836. },
  13837. "data": {
  13838. "type": "object",
  13839. "properties": {
  13840. "message": {
  13841. "type": "string"
  13842. }
  13843. },
  13844. "required": ["message"],
  13845. "additionalProperties": false
  13846. }
  13847. },
  13848. "required": ["name", "data"],
  13849. "additionalProperties": false
  13850. },
  13851. "SyncEventMessageUpdated": {
  13852. "type": "object",
  13853. "properties": {
  13854. "type": {
  13855. "type": "string",
  13856. "enum": ["sync"]
  13857. },
  13858. "name": {
  13859. "type": "string",
  13860. "enum": ["message.updated.1"]
  13861. },
  13862. "id": {
  13863. "type": "string"
  13864. },
  13865. "seq": {
  13866. "type": "number"
  13867. },
  13868. "aggregateID": {
  13869. "type": "string",
  13870. "enum": ["sessionID"]
  13871. },
  13872. "data": {
  13873. "type": "object",
  13874. "properties": {
  13875. "sessionID": {
  13876. "type": "string"
  13877. },
  13878. "info": {
  13879. "$ref": "#/components/schemas/Message"
  13880. }
  13881. },
  13882. "required": ["sessionID", "info"],
  13883. "additionalProperties": false
  13884. }
  13885. },
  13886. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  13887. "additionalProperties": false
  13888. },
  13889. "SyncEventMessageRemoved": {
  13890. "type": "object",
  13891. "properties": {
  13892. "type": {
  13893. "type": "string",
  13894. "enum": ["sync"]
  13895. },
  13896. "name": {
  13897. "type": "string",
  13898. "enum": ["message.removed.1"]
  13899. },
  13900. "id": {
  13901. "type": "string"
  13902. },
  13903. "seq": {
  13904. "type": "number"
  13905. },
  13906. "aggregateID": {
  13907. "type": "string",
  13908. "enum": ["sessionID"]
  13909. },
  13910. "data": {
  13911. "type": "object",
  13912. "properties": {
  13913. "sessionID": {
  13914. "type": "string"
  13915. },
  13916. "messageID": {
  13917. "type": "string"
  13918. }
  13919. },
  13920. "required": ["sessionID", "messageID"],
  13921. "additionalProperties": false
  13922. }
  13923. },
  13924. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  13925. "additionalProperties": false
  13926. },
  13927. "SyncEventMessagePartUpdated": {
  13928. "type": "object",
  13929. "properties": {
  13930. "type": {
  13931. "type": "string",
  13932. "enum": ["sync"]
  13933. },
  13934. "name": {
  13935. "type": "string",
  13936. "enum": ["message.part.updated.1"]
  13937. },
  13938. "id": {
  13939. "type": "string"
  13940. },
  13941. "seq": {
  13942. "type": "number"
  13943. },
  13944. "aggregateID": {
  13945. "type": "string",
  13946. "enum": ["sessionID"]
  13947. },
  13948. "data": {
  13949. "type": "object",
  13950. "properties": {
  13951. "sessionID": {
  13952. "type": "string"
  13953. },
  13954. "part": {
  13955. "$ref": "#/components/schemas/Part"
  13956. },
  13957. "time": {
  13958. "type": "integer",
  13959. "minimum": 0
  13960. }
  13961. },
  13962. "required": ["sessionID", "part", "time"],
  13963. "additionalProperties": false
  13964. }
  13965. },
  13966. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  13967. "additionalProperties": false
  13968. },
  13969. "SyncEventMessagePartRemoved": {
  13970. "type": "object",
  13971. "properties": {
  13972. "type": {
  13973. "type": "string",
  13974. "enum": ["sync"]
  13975. },
  13976. "name": {
  13977. "type": "string",
  13978. "enum": ["message.part.removed.1"]
  13979. },
  13980. "id": {
  13981. "type": "string"
  13982. },
  13983. "seq": {
  13984. "type": "number"
  13985. },
  13986. "aggregateID": {
  13987. "type": "string",
  13988. "enum": ["sessionID"]
  13989. },
  13990. "data": {
  13991. "type": "object",
  13992. "properties": {
  13993. "sessionID": {
  13994. "type": "string"
  13995. },
  13996. "messageID": {
  13997. "type": "string"
  13998. },
  13999. "partID": {
  14000. "type": "string"
  14001. }
  14002. },
  14003. "required": ["sessionID", "messageID", "partID"],
  14004. "additionalProperties": false
  14005. }
  14006. },
  14007. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14008. "additionalProperties": false
  14009. },
  14010. "SyncEventSessionCreated": {
  14011. "type": "object",
  14012. "properties": {
  14013. "type": {
  14014. "type": "string",
  14015. "enum": ["sync"]
  14016. },
  14017. "name": {
  14018. "type": "string",
  14019. "enum": ["session.created.1"]
  14020. },
  14021. "id": {
  14022. "type": "string"
  14023. },
  14024. "seq": {
  14025. "type": "number"
  14026. },
  14027. "aggregateID": {
  14028. "type": "string",
  14029. "enum": ["sessionID"]
  14030. },
  14031. "data": {
  14032. "type": "object",
  14033. "properties": {
  14034. "sessionID": {
  14035. "type": "string"
  14036. },
  14037. "info": {
  14038. "$ref": "#/components/schemas/Session"
  14039. }
  14040. },
  14041. "required": ["sessionID", "info"],
  14042. "additionalProperties": false
  14043. }
  14044. },
  14045. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14046. "additionalProperties": false
  14047. },
  14048. "SyncEventSessionUpdated": {
  14049. "type": "object",
  14050. "properties": {
  14051. "type": {
  14052. "type": "string",
  14053. "enum": ["sync"]
  14054. },
  14055. "name": {
  14056. "type": "string",
  14057. "enum": ["session.updated.1"]
  14058. },
  14059. "id": {
  14060. "type": "string"
  14061. },
  14062. "seq": {
  14063. "type": "number"
  14064. },
  14065. "aggregateID": {
  14066. "type": "string",
  14067. "enum": ["sessionID"]
  14068. },
  14069. "data": {
  14070. "type": "object",
  14071. "properties": {
  14072. "sessionID": {
  14073. "type": "string"
  14074. },
  14075. "info": {
  14076. "type": "object",
  14077. "properties": {
  14078. "id": {
  14079. "anyOf": [
  14080. {
  14081. "type": "string"
  14082. },
  14083. {
  14084. "type": "null"
  14085. }
  14086. ]
  14087. },
  14088. "slug": {
  14089. "anyOf": [
  14090. {
  14091. "type": "string"
  14092. },
  14093. {
  14094. "type": "null"
  14095. }
  14096. ]
  14097. },
  14098. "projectID": {
  14099. "anyOf": [
  14100. {
  14101. "type": "string"
  14102. },
  14103. {
  14104. "type": "null"
  14105. }
  14106. ]
  14107. },
  14108. "workspaceID": {
  14109. "anyOf": [
  14110. {
  14111. "type": "string"
  14112. },
  14113. {
  14114. "type": "null"
  14115. }
  14116. ]
  14117. },
  14118. "directory": {
  14119. "anyOf": [
  14120. {
  14121. "type": "string"
  14122. },
  14123. {
  14124. "type": "null"
  14125. }
  14126. ]
  14127. },
  14128. "path": {
  14129. "anyOf": [
  14130. {
  14131. "type": "string"
  14132. },
  14133. {
  14134. "type": "null"
  14135. }
  14136. ]
  14137. },
  14138. "parentID": {
  14139. "anyOf": [
  14140. {
  14141. "type": "string"
  14142. },
  14143. {
  14144. "type": "null"
  14145. }
  14146. ]
  14147. },
  14148. "summary": {
  14149. "anyOf": [
  14150. {
  14151. "type": "object",
  14152. "properties": {
  14153. "additions": {
  14154. "type": "integer",
  14155. "minimum": 0
  14156. },
  14157. "deletions": {
  14158. "type": "integer",
  14159. "minimum": 0
  14160. },
  14161. "files": {
  14162. "type": "integer",
  14163. "minimum": 0
  14164. },
  14165. "diffs": {
  14166. "type": "array",
  14167. "items": {
  14168. "$ref": "#/components/schemas/SnapshotFileDiff"
  14169. }
  14170. }
  14171. },
  14172. "required": ["additions", "deletions", "files"],
  14173. "additionalProperties": false
  14174. },
  14175. {
  14176. "type": "null"
  14177. }
  14178. ]
  14179. },
  14180. "share": {
  14181. "type": "object",
  14182. "properties": {
  14183. "url": {
  14184. "anyOf": [
  14185. {
  14186. "type": "string"
  14187. },
  14188. {
  14189. "type": "null"
  14190. }
  14191. ]
  14192. }
  14193. },
  14194. "additionalProperties": false
  14195. },
  14196. "title": {
  14197. "anyOf": [
  14198. {
  14199. "type": "string"
  14200. },
  14201. {
  14202. "type": "null"
  14203. }
  14204. ]
  14205. },
  14206. "agent": {
  14207. "anyOf": [
  14208. {
  14209. "type": "string"
  14210. },
  14211. {
  14212. "type": "null"
  14213. }
  14214. ]
  14215. },
  14216. "model": {
  14217. "anyOf": [
  14218. {
  14219. "type": "object",
  14220. "properties": {
  14221. "id": {
  14222. "type": "string"
  14223. },
  14224. "providerID": {
  14225. "type": "string"
  14226. },
  14227. "variant": {
  14228. "type": "string"
  14229. }
  14230. },
  14231. "required": ["id", "providerID"],
  14232. "additionalProperties": false
  14233. },
  14234. {
  14235. "type": "null"
  14236. }
  14237. ]
  14238. },
  14239. "version": {
  14240. "anyOf": [
  14241. {
  14242. "type": "string"
  14243. },
  14244. {
  14245. "type": "null"
  14246. }
  14247. ]
  14248. },
  14249. "time": {
  14250. "type": "object",
  14251. "properties": {
  14252. "created": {
  14253. "anyOf": [
  14254. {
  14255. "type": "integer",
  14256. "minimum": 0
  14257. },
  14258. {
  14259. "type": "null"
  14260. }
  14261. ]
  14262. },
  14263. "updated": {
  14264. "anyOf": [
  14265. {
  14266. "type": "integer",
  14267. "minimum": 0
  14268. },
  14269. {
  14270. "type": "null"
  14271. }
  14272. ]
  14273. },
  14274. "compacting": {
  14275. "anyOf": [
  14276. {
  14277. "type": "integer",
  14278. "minimum": 0
  14279. },
  14280. {
  14281. "type": "null"
  14282. }
  14283. ]
  14284. },
  14285. "archived": {
  14286. "anyOf": [
  14287. {
  14288. "type": "number"
  14289. },
  14290. {
  14291. "type": "null"
  14292. }
  14293. ]
  14294. }
  14295. },
  14296. "additionalProperties": false
  14297. },
  14298. "permission": {
  14299. "anyOf": [
  14300. {
  14301. "$ref": "#/components/schemas/PermissionRuleset"
  14302. },
  14303. {
  14304. "type": "null"
  14305. }
  14306. ]
  14307. },
  14308. "revert": {
  14309. "anyOf": [
  14310. {
  14311. "type": "object",
  14312. "properties": {
  14313. "messageID": {
  14314. "type": "string"
  14315. },
  14316. "partID": {
  14317. "type": "string"
  14318. },
  14319. "snapshot": {
  14320. "type": "string"
  14321. },
  14322. "diff": {
  14323. "type": "string"
  14324. }
  14325. },
  14326. "required": ["messageID"],
  14327. "additionalProperties": false
  14328. },
  14329. {
  14330. "type": "null"
  14331. }
  14332. ]
  14333. }
  14334. },
  14335. "additionalProperties": false
  14336. }
  14337. },
  14338. "required": ["sessionID", "info"],
  14339. "additionalProperties": false
  14340. }
  14341. },
  14342. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14343. "additionalProperties": false
  14344. },
  14345. "SyncEventSessionDeleted": {
  14346. "type": "object",
  14347. "properties": {
  14348. "type": {
  14349. "type": "string",
  14350. "enum": ["sync"]
  14351. },
  14352. "name": {
  14353. "type": "string",
  14354. "enum": ["session.deleted.1"]
  14355. },
  14356. "id": {
  14357. "type": "string"
  14358. },
  14359. "seq": {
  14360. "type": "number"
  14361. },
  14362. "aggregateID": {
  14363. "type": "string",
  14364. "enum": ["sessionID"]
  14365. },
  14366. "data": {
  14367. "type": "object",
  14368. "properties": {
  14369. "sessionID": {
  14370. "type": "string"
  14371. },
  14372. "info": {
  14373. "$ref": "#/components/schemas/Session"
  14374. }
  14375. },
  14376. "required": ["sessionID", "info"],
  14377. "additionalProperties": false
  14378. }
  14379. },
  14380. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14381. "additionalProperties": false
  14382. },
  14383. "SyncEventSessionNextAgentSwitched": {
  14384. "type": "object",
  14385. "properties": {
  14386. "type": {
  14387. "type": "string",
  14388. "enum": ["sync"]
  14389. },
  14390. "name": {
  14391. "type": "string",
  14392. "enum": ["session.next.agent.switched.1"]
  14393. },
  14394. "id": {
  14395. "type": "string"
  14396. },
  14397. "seq": {
  14398. "type": "number"
  14399. },
  14400. "aggregateID": {
  14401. "type": "string",
  14402. "enum": ["sessionID"]
  14403. },
  14404. "data": {
  14405. "type": "object",
  14406. "properties": {
  14407. "timestamp": {
  14408. "type": "number"
  14409. },
  14410. "sessionID": {
  14411. "type": "string"
  14412. },
  14413. "agent": {
  14414. "type": "string"
  14415. }
  14416. },
  14417. "required": ["timestamp", "sessionID", "agent"],
  14418. "additionalProperties": false
  14419. }
  14420. },
  14421. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14422. "additionalProperties": false
  14423. },
  14424. "SyncEventSessionNextModelSwitched": {
  14425. "type": "object",
  14426. "properties": {
  14427. "type": {
  14428. "type": "string",
  14429. "enum": ["sync"]
  14430. },
  14431. "name": {
  14432. "type": "string",
  14433. "enum": ["session.next.model.switched.1"]
  14434. },
  14435. "id": {
  14436. "type": "string"
  14437. },
  14438. "seq": {
  14439. "type": "number"
  14440. },
  14441. "aggregateID": {
  14442. "type": "string",
  14443. "enum": ["sessionID"]
  14444. },
  14445. "data": {
  14446. "type": "object",
  14447. "properties": {
  14448. "timestamp": {
  14449. "type": "number"
  14450. },
  14451. "sessionID": {
  14452. "type": "string"
  14453. },
  14454. "model": {
  14455. "type": "object",
  14456. "properties": {
  14457. "id": {
  14458. "type": "string"
  14459. },
  14460. "providerID": {
  14461. "type": "string"
  14462. },
  14463. "variant": {
  14464. "type": "string"
  14465. }
  14466. },
  14467. "required": ["id", "providerID", "variant"],
  14468. "additionalProperties": false
  14469. }
  14470. },
  14471. "required": ["timestamp", "sessionID", "model"],
  14472. "additionalProperties": false
  14473. }
  14474. },
  14475. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14476. "additionalProperties": false
  14477. },
  14478. "SyncEventSessionNextPrompted": {
  14479. "type": "object",
  14480. "properties": {
  14481. "type": {
  14482. "type": "string",
  14483. "enum": ["sync"]
  14484. },
  14485. "name": {
  14486. "type": "string",
  14487. "enum": ["session.next.prompted.1"]
  14488. },
  14489. "id": {
  14490. "type": "string"
  14491. },
  14492. "seq": {
  14493. "type": "number"
  14494. },
  14495. "aggregateID": {
  14496. "type": "string",
  14497. "enum": ["sessionID"]
  14498. },
  14499. "data": {
  14500. "type": "object",
  14501. "properties": {
  14502. "timestamp": {
  14503. "type": "number"
  14504. },
  14505. "sessionID": {
  14506. "type": "string"
  14507. },
  14508. "prompt": {
  14509. "$ref": "#/components/schemas/Prompt"
  14510. }
  14511. },
  14512. "required": ["timestamp", "sessionID", "prompt"],
  14513. "additionalProperties": false
  14514. }
  14515. },
  14516. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14517. "additionalProperties": false
  14518. },
  14519. "SyncEventSessionNextSynthetic": {
  14520. "type": "object",
  14521. "properties": {
  14522. "type": {
  14523. "type": "string",
  14524. "enum": ["sync"]
  14525. },
  14526. "name": {
  14527. "type": "string",
  14528. "enum": ["session.next.synthetic.1"]
  14529. },
  14530. "id": {
  14531. "type": "string"
  14532. },
  14533. "seq": {
  14534. "type": "number"
  14535. },
  14536. "aggregateID": {
  14537. "type": "string",
  14538. "enum": ["sessionID"]
  14539. },
  14540. "data": {
  14541. "type": "object",
  14542. "properties": {
  14543. "timestamp": {
  14544. "type": "number"
  14545. },
  14546. "sessionID": {
  14547. "type": "string"
  14548. },
  14549. "text": {
  14550. "type": "string"
  14551. }
  14552. },
  14553. "required": ["timestamp", "sessionID", "text"],
  14554. "additionalProperties": false
  14555. }
  14556. },
  14557. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14558. "additionalProperties": false
  14559. },
  14560. "SyncEventSessionNextShellStarted": {
  14561. "type": "object",
  14562. "properties": {
  14563. "type": {
  14564. "type": "string",
  14565. "enum": ["sync"]
  14566. },
  14567. "name": {
  14568. "type": "string",
  14569. "enum": ["session.next.shell.started.1"]
  14570. },
  14571. "id": {
  14572. "type": "string"
  14573. },
  14574. "seq": {
  14575. "type": "number"
  14576. },
  14577. "aggregateID": {
  14578. "type": "string",
  14579. "enum": ["sessionID"]
  14580. },
  14581. "data": {
  14582. "type": "object",
  14583. "properties": {
  14584. "timestamp": {
  14585. "type": "number"
  14586. },
  14587. "sessionID": {
  14588. "type": "string"
  14589. },
  14590. "callID": {
  14591. "type": "string"
  14592. },
  14593. "command": {
  14594. "type": "string"
  14595. }
  14596. },
  14597. "required": ["timestamp", "sessionID", "callID", "command"],
  14598. "additionalProperties": false
  14599. }
  14600. },
  14601. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14602. "additionalProperties": false
  14603. },
  14604. "SyncEventSessionNextShellEnded": {
  14605. "type": "object",
  14606. "properties": {
  14607. "type": {
  14608. "type": "string",
  14609. "enum": ["sync"]
  14610. },
  14611. "name": {
  14612. "type": "string",
  14613. "enum": ["session.next.shell.ended.1"]
  14614. },
  14615. "id": {
  14616. "type": "string"
  14617. },
  14618. "seq": {
  14619. "type": "number"
  14620. },
  14621. "aggregateID": {
  14622. "type": "string",
  14623. "enum": ["sessionID"]
  14624. },
  14625. "data": {
  14626. "type": "object",
  14627. "properties": {
  14628. "timestamp": {
  14629. "type": "number"
  14630. },
  14631. "sessionID": {
  14632. "type": "string"
  14633. },
  14634. "callID": {
  14635. "type": "string"
  14636. },
  14637. "output": {
  14638. "type": "string"
  14639. }
  14640. },
  14641. "required": ["timestamp", "sessionID", "callID", "output"],
  14642. "additionalProperties": false
  14643. }
  14644. },
  14645. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14646. "additionalProperties": false
  14647. },
  14648. "SyncEventSessionNextStepStarted": {
  14649. "type": "object",
  14650. "properties": {
  14651. "type": {
  14652. "type": "string",
  14653. "enum": ["sync"]
  14654. },
  14655. "name": {
  14656. "type": "string",
  14657. "enum": ["session.next.step.started.1"]
  14658. },
  14659. "id": {
  14660. "type": "string"
  14661. },
  14662. "seq": {
  14663. "type": "number"
  14664. },
  14665. "aggregateID": {
  14666. "type": "string",
  14667. "enum": ["sessionID"]
  14668. },
  14669. "data": {
  14670. "type": "object",
  14671. "properties": {
  14672. "timestamp": {
  14673. "type": "number"
  14674. },
  14675. "sessionID": {
  14676. "type": "string"
  14677. },
  14678. "agent": {
  14679. "type": "string"
  14680. },
  14681. "model": {
  14682. "type": "object",
  14683. "properties": {
  14684. "id": {
  14685. "type": "string"
  14686. },
  14687. "providerID": {
  14688. "type": "string"
  14689. },
  14690. "variant": {
  14691. "type": "string"
  14692. }
  14693. },
  14694. "required": ["id", "providerID", "variant"],
  14695. "additionalProperties": false
  14696. },
  14697. "snapshot": {
  14698. "type": "string"
  14699. }
  14700. },
  14701. "required": ["timestamp", "sessionID", "agent", "model"],
  14702. "additionalProperties": false
  14703. }
  14704. },
  14705. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14706. "additionalProperties": false
  14707. },
  14708. "SyncEventSessionNextStepEnded": {
  14709. "type": "object",
  14710. "properties": {
  14711. "type": {
  14712. "type": "string",
  14713. "enum": ["sync"]
  14714. },
  14715. "name": {
  14716. "type": "string",
  14717. "enum": ["session.next.step.ended.1"]
  14718. },
  14719. "id": {
  14720. "type": "string"
  14721. },
  14722. "seq": {
  14723. "type": "number"
  14724. },
  14725. "aggregateID": {
  14726. "type": "string",
  14727. "enum": ["sessionID"]
  14728. },
  14729. "data": {
  14730. "type": "object",
  14731. "properties": {
  14732. "timestamp": {
  14733. "type": "number"
  14734. },
  14735. "sessionID": {
  14736. "type": "string"
  14737. },
  14738. "finish": {
  14739. "type": "string"
  14740. },
  14741. "cost": {
  14742. "type": "number"
  14743. },
  14744. "tokens": {
  14745. "type": "object",
  14746. "properties": {
  14747. "input": {
  14748. "type": "integer",
  14749. "minimum": 0
  14750. },
  14751. "output": {
  14752. "type": "integer",
  14753. "minimum": 0
  14754. },
  14755. "reasoning": {
  14756. "type": "integer",
  14757. "minimum": 0
  14758. },
  14759. "cache": {
  14760. "type": "object",
  14761. "properties": {
  14762. "read": {
  14763. "type": "integer",
  14764. "minimum": 0
  14765. },
  14766. "write": {
  14767. "type": "integer",
  14768. "minimum": 0
  14769. }
  14770. },
  14771. "required": ["read", "write"],
  14772. "additionalProperties": false
  14773. }
  14774. },
  14775. "required": ["input", "output", "reasoning", "cache"],
  14776. "additionalProperties": false
  14777. },
  14778. "snapshot": {
  14779. "type": "string"
  14780. }
  14781. },
  14782. "required": ["timestamp", "sessionID", "finish", "cost", "tokens"],
  14783. "additionalProperties": false
  14784. }
  14785. },
  14786. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14787. "additionalProperties": false
  14788. },
  14789. "SyncEventSessionNextStepFailed": {
  14790. "type": "object",
  14791. "properties": {
  14792. "type": {
  14793. "type": "string",
  14794. "enum": ["sync"]
  14795. },
  14796. "name": {
  14797. "type": "string",
  14798. "enum": ["session.next.step.failed.1"]
  14799. },
  14800. "id": {
  14801. "type": "string"
  14802. },
  14803. "seq": {
  14804. "type": "number"
  14805. },
  14806. "aggregateID": {
  14807. "type": "string",
  14808. "enum": ["sessionID"]
  14809. },
  14810. "data": {
  14811. "type": "object",
  14812. "properties": {
  14813. "timestamp": {
  14814. "type": "number"
  14815. },
  14816. "sessionID": {
  14817. "type": "string"
  14818. },
  14819. "error": {
  14820. "$ref": "#/components/schemas/SessionErrorUnknown"
  14821. }
  14822. },
  14823. "required": ["timestamp", "sessionID", "error"],
  14824. "additionalProperties": false
  14825. }
  14826. },
  14827. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14828. "additionalProperties": false
  14829. },
  14830. "SyncEventSessionNextTextStarted": {
  14831. "type": "object",
  14832. "properties": {
  14833. "type": {
  14834. "type": "string",
  14835. "enum": ["sync"]
  14836. },
  14837. "name": {
  14838. "type": "string",
  14839. "enum": ["session.next.text.started.1"]
  14840. },
  14841. "id": {
  14842. "type": "string"
  14843. },
  14844. "seq": {
  14845. "type": "number"
  14846. },
  14847. "aggregateID": {
  14848. "type": "string",
  14849. "enum": ["sessionID"]
  14850. },
  14851. "data": {
  14852. "type": "object",
  14853. "properties": {
  14854. "timestamp": {
  14855. "type": "number"
  14856. },
  14857. "sessionID": {
  14858. "type": "string"
  14859. }
  14860. },
  14861. "required": ["timestamp", "sessionID"],
  14862. "additionalProperties": false
  14863. }
  14864. },
  14865. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14866. "additionalProperties": false
  14867. },
  14868. "SyncEventSessionNextTextDelta": {
  14869. "type": "object",
  14870. "properties": {
  14871. "type": {
  14872. "type": "string",
  14873. "enum": ["sync"]
  14874. },
  14875. "name": {
  14876. "type": "string",
  14877. "enum": ["session.next.text.delta.1"]
  14878. },
  14879. "id": {
  14880. "type": "string"
  14881. },
  14882. "seq": {
  14883. "type": "number"
  14884. },
  14885. "aggregateID": {
  14886. "type": "string",
  14887. "enum": ["sessionID"]
  14888. },
  14889. "data": {
  14890. "type": "object",
  14891. "properties": {
  14892. "timestamp": {
  14893. "type": "number"
  14894. },
  14895. "sessionID": {
  14896. "type": "string"
  14897. },
  14898. "delta": {
  14899. "type": "string"
  14900. }
  14901. },
  14902. "required": ["timestamp", "sessionID", "delta"],
  14903. "additionalProperties": false
  14904. }
  14905. },
  14906. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14907. "additionalProperties": false
  14908. },
  14909. "SyncEventSessionNextTextEnded": {
  14910. "type": "object",
  14911. "properties": {
  14912. "type": {
  14913. "type": "string",
  14914. "enum": ["sync"]
  14915. },
  14916. "name": {
  14917. "type": "string",
  14918. "enum": ["session.next.text.ended.1"]
  14919. },
  14920. "id": {
  14921. "type": "string"
  14922. },
  14923. "seq": {
  14924. "type": "number"
  14925. },
  14926. "aggregateID": {
  14927. "type": "string",
  14928. "enum": ["sessionID"]
  14929. },
  14930. "data": {
  14931. "type": "object",
  14932. "properties": {
  14933. "timestamp": {
  14934. "type": "number"
  14935. },
  14936. "sessionID": {
  14937. "type": "string"
  14938. },
  14939. "text": {
  14940. "type": "string"
  14941. }
  14942. },
  14943. "required": ["timestamp", "sessionID", "text"],
  14944. "additionalProperties": false
  14945. }
  14946. },
  14947. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14948. "additionalProperties": false
  14949. },
  14950. "SyncEventSessionNextReasoningStarted": {
  14951. "type": "object",
  14952. "properties": {
  14953. "type": {
  14954. "type": "string",
  14955. "enum": ["sync"]
  14956. },
  14957. "name": {
  14958. "type": "string",
  14959. "enum": ["session.next.reasoning.started.1"]
  14960. },
  14961. "id": {
  14962. "type": "string"
  14963. },
  14964. "seq": {
  14965. "type": "number"
  14966. },
  14967. "aggregateID": {
  14968. "type": "string",
  14969. "enum": ["sessionID"]
  14970. },
  14971. "data": {
  14972. "type": "object",
  14973. "properties": {
  14974. "timestamp": {
  14975. "type": "number"
  14976. },
  14977. "sessionID": {
  14978. "type": "string"
  14979. },
  14980. "reasoningID": {
  14981. "type": "string"
  14982. }
  14983. },
  14984. "required": ["timestamp", "sessionID", "reasoningID"],
  14985. "additionalProperties": false
  14986. }
  14987. },
  14988. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14989. "additionalProperties": false
  14990. },
  14991. "SyncEventSessionNextReasoningDelta": {
  14992. "type": "object",
  14993. "properties": {
  14994. "type": {
  14995. "type": "string",
  14996. "enum": ["sync"]
  14997. },
  14998. "name": {
  14999. "type": "string",
  15000. "enum": ["session.next.reasoning.delta.1"]
  15001. },
  15002. "id": {
  15003. "type": "string"
  15004. },
  15005. "seq": {
  15006. "type": "number"
  15007. },
  15008. "aggregateID": {
  15009. "type": "string",
  15010. "enum": ["sessionID"]
  15011. },
  15012. "data": {
  15013. "type": "object",
  15014. "properties": {
  15015. "timestamp": {
  15016. "type": "number"
  15017. },
  15018. "sessionID": {
  15019. "type": "string"
  15020. },
  15021. "reasoningID": {
  15022. "type": "string"
  15023. },
  15024. "delta": {
  15025. "type": "string"
  15026. }
  15027. },
  15028. "required": ["timestamp", "sessionID", "reasoningID", "delta"],
  15029. "additionalProperties": false
  15030. }
  15031. },
  15032. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15033. "additionalProperties": false
  15034. },
  15035. "SyncEventSessionNextReasoningEnded": {
  15036. "type": "object",
  15037. "properties": {
  15038. "type": {
  15039. "type": "string",
  15040. "enum": ["sync"]
  15041. },
  15042. "name": {
  15043. "type": "string",
  15044. "enum": ["session.next.reasoning.ended.1"]
  15045. },
  15046. "id": {
  15047. "type": "string"
  15048. },
  15049. "seq": {
  15050. "type": "number"
  15051. },
  15052. "aggregateID": {
  15053. "type": "string",
  15054. "enum": ["sessionID"]
  15055. },
  15056. "data": {
  15057. "type": "object",
  15058. "properties": {
  15059. "timestamp": {
  15060. "type": "number"
  15061. },
  15062. "sessionID": {
  15063. "type": "string"
  15064. },
  15065. "reasoningID": {
  15066. "type": "string"
  15067. },
  15068. "text": {
  15069. "type": "string"
  15070. }
  15071. },
  15072. "required": ["timestamp", "sessionID", "reasoningID", "text"],
  15073. "additionalProperties": false
  15074. }
  15075. },
  15076. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15077. "additionalProperties": false
  15078. },
  15079. "SyncEventSessionNextToolInputStarted": {
  15080. "type": "object",
  15081. "properties": {
  15082. "type": {
  15083. "type": "string",
  15084. "enum": ["sync"]
  15085. },
  15086. "name": {
  15087. "type": "string",
  15088. "enum": ["session.next.tool.input.started.1"]
  15089. },
  15090. "id": {
  15091. "type": "string"
  15092. },
  15093. "seq": {
  15094. "type": "number"
  15095. },
  15096. "aggregateID": {
  15097. "type": "string",
  15098. "enum": ["sessionID"]
  15099. },
  15100. "data": {
  15101. "type": "object",
  15102. "properties": {
  15103. "timestamp": {
  15104. "type": "number"
  15105. },
  15106. "sessionID": {
  15107. "type": "string"
  15108. },
  15109. "callID": {
  15110. "type": "string"
  15111. },
  15112. "name": {
  15113. "type": "string"
  15114. }
  15115. },
  15116. "required": ["timestamp", "sessionID", "callID", "name"],
  15117. "additionalProperties": false
  15118. }
  15119. },
  15120. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15121. "additionalProperties": false
  15122. },
  15123. "SyncEventSessionNextToolInputDelta": {
  15124. "type": "object",
  15125. "properties": {
  15126. "type": {
  15127. "type": "string",
  15128. "enum": ["sync"]
  15129. },
  15130. "name": {
  15131. "type": "string",
  15132. "enum": ["session.next.tool.input.delta.1"]
  15133. },
  15134. "id": {
  15135. "type": "string"
  15136. },
  15137. "seq": {
  15138. "type": "number"
  15139. },
  15140. "aggregateID": {
  15141. "type": "string",
  15142. "enum": ["sessionID"]
  15143. },
  15144. "data": {
  15145. "type": "object",
  15146. "properties": {
  15147. "timestamp": {
  15148. "type": "number"
  15149. },
  15150. "sessionID": {
  15151. "type": "string"
  15152. },
  15153. "callID": {
  15154. "type": "string"
  15155. },
  15156. "delta": {
  15157. "type": "string"
  15158. }
  15159. },
  15160. "required": ["timestamp", "sessionID", "callID", "delta"],
  15161. "additionalProperties": false
  15162. }
  15163. },
  15164. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15165. "additionalProperties": false
  15166. },
  15167. "SyncEventSessionNextToolInputEnded": {
  15168. "type": "object",
  15169. "properties": {
  15170. "type": {
  15171. "type": "string",
  15172. "enum": ["sync"]
  15173. },
  15174. "name": {
  15175. "type": "string",
  15176. "enum": ["session.next.tool.input.ended.1"]
  15177. },
  15178. "id": {
  15179. "type": "string"
  15180. },
  15181. "seq": {
  15182. "type": "number"
  15183. },
  15184. "aggregateID": {
  15185. "type": "string",
  15186. "enum": ["sessionID"]
  15187. },
  15188. "data": {
  15189. "type": "object",
  15190. "properties": {
  15191. "timestamp": {
  15192. "type": "number"
  15193. },
  15194. "sessionID": {
  15195. "type": "string"
  15196. },
  15197. "callID": {
  15198. "type": "string"
  15199. },
  15200. "text": {
  15201. "type": "string"
  15202. }
  15203. },
  15204. "required": ["timestamp", "sessionID", "callID", "text"],
  15205. "additionalProperties": false
  15206. }
  15207. },
  15208. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15209. "additionalProperties": false
  15210. },
  15211. "SyncEventSessionNextToolCalled": {
  15212. "type": "object",
  15213. "properties": {
  15214. "type": {
  15215. "type": "string",
  15216. "enum": ["sync"]
  15217. },
  15218. "name": {
  15219. "type": "string",
  15220. "enum": ["session.next.tool.called.1"]
  15221. },
  15222. "id": {
  15223. "type": "string"
  15224. },
  15225. "seq": {
  15226. "type": "number"
  15227. },
  15228. "aggregateID": {
  15229. "type": "string",
  15230. "enum": ["sessionID"]
  15231. },
  15232. "data": {
  15233. "type": "object",
  15234. "properties": {
  15235. "timestamp": {
  15236. "type": "number"
  15237. },
  15238. "sessionID": {
  15239. "type": "string"
  15240. },
  15241. "callID": {
  15242. "type": "string"
  15243. },
  15244. "tool": {
  15245. "type": "string"
  15246. },
  15247. "input": {
  15248. "type": "object"
  15249. },
  15250. "provider": {
  15251. "type": "object",
  15252. "properties": {
  15253. "executed": {
  15254. "type": "boolean"
  15255. },
  15256. "metadata": {
  15257. "type": "object"
  15258. }
  15259. },
  15260. "required": ["executed"],
  15261. "additionalProperties": false
  15262. }
  15263. },
  15264. "required": ["timestamp", "sessionID", "callID", "tool", "input", "provider"],
  15265. "additionalProperties": false
  15266. }
  15267. },
  15268. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15269. "additionalProperties": false
  15270. },
  15271. "SyncEventSessionNextToolProgress": {
  15272. "type": "object",
  15273. "properties": {
  15274. "type": {
  15275. "type": "string",
  15276. "enum": ["sync"]
  15277. },
  15278. "name": {
  15279. "type": "string",
  15280. "enum": ["session.next.tool.progress.1"]
  15281. },
  15282. "id": {
  15283. "type": "string"
  15284. },
  15285. "seq": {
  15286. "type": "number"
  15287. },
  15288. "aggregateID": {
  15289. "type": "string",
  15290. "enum": ["sessionID"]
  15291. },
  15292. "data": {
  15293. "type": "object",
  15294. "properties": {
  15295. "timestamp": {
  15296. "type": "number"
  15297. },
  15298. "sessionID": {
  15299. "type": "string"
  15300. },
  15301. "callID": {
  15302. "type": "string"
  15303. },
  15304. "structured": {
  15305. "type": "object"
  15306. },
  15307. "content": {
  15308. "type": "array",
  15309. "items": {
  15310. "anyOf": [
  15311. {
  15312. "$ref": "#/components/schemas/ToolTextContent"
  15313. },
  15314. {
  15315. "$ref": "#/components/schemas/ToolFileContent"
  15316. }
  15317. ]
  15318. }
  15319. }
  15320. },
  15321. "required": ["timestamp", "sessionID", "callID", "structured", "content"],
  15322. "additionalProperties": false
  15323. }
  15324. },
  15325. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15326. "additionalProperties": false
  15327. },
  15328. "SyncEventSessionNextToolSuccess": {
  15329. "type": "object",
  15330. "properties": {
  15331. "type": {
  15332. "type": "string",
  15333. "enum": ["sync"]
  15334. },
  15335. "name": {
  15336. "type": "string",
  15337. "enum": ["session.next.tool.success.1"]
  15338. },
  15339. "id": {
  15340. "type": "string"
  15341. },
  15342. "seq": {
  15343. "type": "number"
  15344. },
  15345. "aggregateID": {
  15346. "type": "string",
  15347. "enum": ["sessionID"]
  15348. },
  15349. "data": {
  15350. "type": "object",
  15351. "properties": {
  15352. "timestamp": {
  15353. "type": "number"
  15354. },
  15355. "sessionID": {
  15356. "type": "string"
  15357. },
  15358. "callID": {
  15359. "type": "string"
  15360. },
  15361. "structured": {
  15362. "type": "object"
  15363. },
  15364. "content": {
  15365. "type": "array",
  15366. "items": {
  15367. "anyOf": [
  15368. {
  15369. "$ref": "#/components/schemas/ToolTextContent"
  15370. },
  15371. {
  15372. "$ref": "#/components/schemas/ToolFileContent"
  15373. }
  15374. ]
  15375. }
  15376. },
  15377. "provider": {
  15378. "type": "object",
  15379. "properties": {
  15380. "executed": {
  15381. "type": "boolean"
  15382. },
  15383. "metadata": {
  15384. "type": "object"
  15385. }
  15386. },
  15387. "required": ["executed"],
  15388. "additionalProperties": false
  15389. }
  15390. },
  15391. "required": ["timestamp", "sessionID", "callID", "structured", "content", "provider"],
  15392. "additionalProperties": false
  15393. }
  15394. },
  15395. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15396. "additionalProperties": false
  15397. },
  15398. "SyncEventSessionNextToolFailed": {
  15399. "type": "object",
  15400. "properties": {
  15401. "type": {
  15402. "type": "string",
  15403. "enum": ["sync"]
  15404. },
  15405. "name": {
  15406. "type": "string",
  15407. "enum": ["session.next.tool.failed.1"]
  15408. },
  15409. "id": {
  15410. "type": "string"
  15411. },
  15412. "seq": {
  15413. "type": "number"
  15414. },
  15415. "aggregateID": {
  15416. "type": "string",
  15417. "enum": ["sessionID"]
  15418. },
  15419. "data": {
  15420. "type": "object",
  15421. "properties": {
  15422. "timestamp": {
  15423. "type": "number"
  15424. },
  15425. "sessionID": {
  15426. "type": "string"
  15427. },
  15428. "callID": {
  15429. "type": "string"
  15430. },
  15431. "error": {
  15432. "$ref": "#/components/schemas/SessionErrorUnknown"
  15433. },
  15434. "provider": {
  15435. "type": "object",
  15436. "properties": {
  15437. "executed": {
  15438. "type": "boolean"
  15439. },
  15440. "metadata": {
  15441. "type": "object"
  15442. }
  15443. },
  15444. "required": ["executed"],
  15445. "additionalProperties": false
  15446. }
  15447. },
  15448. "required": ["timestamp", "sessionID", "callID", "error", "provider"],
  15449. "additionalProperties": false
  15450. }
  15451. },
  15452. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15453. "additionalProperties": false
  15454. },
  15455. "SyncEventSessionNextRetried": {
  15456. "type": "object",
  15457. "properties": {
  15458. "type": {
  15459. "type": "string",
  15460. "enum": ["sync"]
  15461. },
  15462. "name": {
  15463. "type": "string",
  15464. "enum": ["session.next.retried.1"]
  15465. },
  15466. "id": {
  15467. "type": "string"
  15468. },
  15469. "seq": {
  15470. "type": "number"
  15471. },
  15472. "aggregateID": {
  15473. "type": "string",
  15474. "enum": ["sessionID"]
  15475. },
  15476. "data": {
  15477. "type": "object",
  15478. "properties": {
  15479. "timestamp": {
  15480. "type": "number"
  15481. },
  15482. "sessionID": {
  15483. "type": "string"
  15484. },
  15485. "attempt": {
  15486. "type": "integer",
  15487. "minimum": 0
  15488. },
  15489. "error": {
  15490. "$ref": "#/components/schemas/SessionNextRetry_error"
  15491. }
  15492. },
  15493. "required": ["timestamp", "sessionID", "attempt", "error"],
  15494. "additionalProperties": false
  15495. }
  15496. },
  15497. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15498. "additionalProperties": false
  15499. },
  15500. "SyncEventSessionNextCompactionStarted": {
  15501. "type": "object",
  15502. "properties": {
  15503. "type": {
  15504. "type": "string",
  15505. "enum": ["sync"]
  15506. },
  15507. "name": {
  15508. "type": "string",
  15509. "enum": ["session.next.compaction.started.1"]
  15510. },
  15511. "id": {
  15512. "type": "string"
  15513. },
  15514. "seq": {
  15515. "type": "number"
  15516. },
  15517. "aggregateID": {
  15518. "type": "string",
  15519. "enum": ["sessionID"]
  15520. },
  15521. "data": {
  15522. "type": "object",
  15523. "properties": {
  15524. "timestamp": {
  15525. "type": "number"
  15526. },
  15527. "sessionID": {
  15528. "type": "string"
  15529. },
  15530. "reason": {
  15531. "type": "string",
  15532. "enum": ["auto", "manual"]
  15533. }
  15534. },
  15535. "required": ["timestamp", "sessionID", "reason"],
  15536. "additionalProperties": false
  15537. }
  15538. },
  15539. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15540. "additionalProperties": false
  15541. },
  15542. "SyncEventSessionNextCompactionDelta": {
  15543. "type": "object",
  15544. "properties": {
  15545. "type": {
  15546. "type": "string",
  15547. "enum": ["sync"]
  15548. },
  15549. "name": {
  15550. "type": "string",
  15551. "enum": ["session.next.compaction.delta.1"]
  15552. },
  15553. "id": {
  15554. "type": "string"
  15555. },
  15556. "seq": {
  15557. "type": "number"
  15558. },
  15559. "aggregateID": {
  15560. "type": "string",
  15561. "enum": ["sessionID"]
  15562. },
  15563. "data": {
  15564. "type": "object",
  15565. "properties": {
  15566. "timestamp": {
  15567. "type": "number"
  15568. },
  15569. "sessionID": {
  15570. "type": "string"
  15571. },
  15572. "text": {
  15573. "type": "string"
  15574. }
  15575. },
  15576. "required": ["timestamp", "sessionID", "text"],
  15577. "additionalProperties": false
  15578. }
  15579. },
  15580. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15581. "additionalProperties": false
  15582. },
  15583. "SyncEventSessionNextCompactionEnded": {
  15584. "type": "object",
  15585. "properties": {
  15586. "type": {
  15587. "type": "string",
  15588. "enum": ["sync"]
  15589. },
  15590. "name": {
  15591. "type": "string",
  15592. "enum": ["session.next.compaction.ended.1"]
  15593. },
  15594. "id": {
  15595. "type": "string"
  15596. },
  15597. "seq": {
  15598. "type": "number"
  15599. },
  15600. "aggregateID": {
  15601. "type": "string",
  15602. "enum": ["sessionID"]
  15603. },
  15604. "data": {
  15605. "type": "object",
  15606. "properties": {
  15607. "timestamp": {
  15608. "type": "number"
  15609. },
  15610. "sessionID": {
  15611. "type": "string"
  15612. },
  15613. "text": {
  15614. "type": "string"
  15615. },
  15616. "include": {
  15617. "type": "string"
  15618. }
  15619. },
  15620. "required": ["timestamp", "sessionID", "text"],
  15621. "additionalProperties": false
  15622. }
  15623. },
  15624. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15625. "additionalProperties": false
  15626. },
  15627. "EventServerInstanceDisposed": {
  15628. "type": "object",
  15629. "properties": {
  15630. "id": {
  15631. "type": "string"
  15632. },
  15633. "type": {
  15634. "type": "string",
  15635. "enum": ["server.instance.disposed"]
  15636. },
  15637. "properties": {
  15638. "type": "object",
  15639. "properties": {
  15640. "directory": {
  15641. "type": "string"
  15642. }
  15643. },
  15644. "required": ["directory"],
  15645. "additionalProperties": false
  15646. }
  15647. },
  15648. "required": ["id", "type", "properties"],
  15649. "additionalProperties": false
  15650. },
  15651. "EventFileEdited": {
  15652. "type": "object",
  15653. "properties": {
  15654. "id": {
  15655. "type": "string"
  15656. },
  15657. "type": {
  15658. "type": "string",
  15659. "enum": ["file.edited"]
  15660. },
  15661. "properties": {
  15662. "type": "object",
  15663. "properties": {
  15664. "file": {
  15665. "type": "string"
  15666. }
  15667. },
  15668. "required": ["file"],
  15669. "additionalProperties": false
  15670. }
  15671. },
  15672. "required": ["id", "type", "properties"],
  15673. "additionalProperties": false
  15674. },
  15675. "EventFileWatcherUpdated": {
  15676. "type": "object",
  15677. "properties": {
  15678. "id": {
  15679. "type": "string"
  15680. },
  15681. "type": {
  15682. "type": "string",
  15683. "enum": ["file.watcher.updated"]
  15684. },
  15685. "properties": {
  15686. "type": "object",
  15687. "properties": {
  15688. "file": {
  15689. "type": "string"
  15690. },
  15691. "event": {
  15692. "type": "string",
  15693. "enum": ["add", "change", "unlink"]
  15694. }
  15695. },
  15696. "required": ["file", "event"],
  15697. "additionalProperties": false
  15698. }
  15699. },
  15700. "required": ["id", "type", "properties"],
  15701. "additionalProperties": false
  15702. },
  15703. "EventLspClientDiagnostics": {
  15704. "type": "object",
  15705. "properties": {
  15706. "id": {
  15707. "type": "string"
  15708. },
  15709. "type": {
  15710. "type": "string",
  15711. "enum": ["lsp.client.diagnostics"]
  15712. },
  15713. "properties": {
  15714. "type": "object",
  15715. "properties": {
  15716. "serverID": {
  15717. "type": "string"
  15718. },
  15719. "path": {
  15720. "type": "string"
  15721. }
  15722. },
  15723. "required": ["serverID", "path"],
  15724. "additionalProperties": false
  15725. }
  15726. },
  15727. "required": ["id", "type", "properties"],
  15728. "additionalProperties": false
  15729. },
  15730. "EventLspUpdated": {
  15731. "type": "object",
  15732. "properties": {
  15733. "id": {
  15734. "type": "string"
  15735. },
  15736. "type": {
  15737. "type": "string",
  15738. "enum": ["lsp.updated"]
  15739. },
  15740. "properties": {
  15741. "type": "object",
  15742. "properties": {}
  15743. }
  15744. },
  15745. "required": ["id", "type", "properties"],
  15746. "additionalProperties": false
  15747. },
  15748. "EventMessagePartDelta": {
  15749. "type": "object",
  15750. "properties": {
  15751. "id": {
  15752. "type": "string"
  15753. },
  15754. "type": {
  15755. "type": "string",
  15756. "enum": ["message.part.delta"]
  15757. },
  15758. "properties": {
  15759. "type": "object",
  15760. "properties": {
  15761. "sessionID": {
  15762. "type": "string"
  15763. },
  15764. "messageID": {
  15765. "type": "string"
  15766. },
  15767. "partID": {
  15768. "type": "string"
  15769. },
  15770. "field": {
  15771. "type": "string"
  15772. },
  15773. "delta": {
  15774. "type": "string"
  15775. }
  15776. },
  15777. "required": ["sessionID", "messageID", "partID", "field", "delta"],
  15778. "additionalProperties": false
  15779. }
  15780. },
  15781. "required": ["id", "type", "properties"],
  15782. "additionalProperties": false
  15783. },
  15784. "EventPermissionAsked": {
  15785. "type": "object",
  15786. "properties": {
  15787. "id": {
  15788. "type": "string"
  15789. },
  15790. "type": {
  15791. "type": "string",
  15792. "enum": ["permission.asked"]
  15793. },
  15794. "properties": {
  15795. "$ref": "#/components/schemas/PermissionRequest"
  15796. }
  15797. },
  15798. "required": ["id", "type", "properties"],
  15799. "additionalProperties": false
  15800. },
  15801. "EventPermissionReplied": {
  15802. "type": "object",
  15803. "properties": {
  15804. "id": {
  15805. "type": "string"
  15806. },
  15807. "type": {
  15808. "type": "string",
  15809. "enum": ["permission.replied"]
  15810. },
  15811. "properties": {
  15812. "type": "object",
  15813. "properties": {
  15814. "sessionID": {
  15815. "type": "string"
  15816. },
  15817. "requestID": {
  15818. "type": "string"
  15819. },
  15820. "reply": {
  15821. "type": "string",
  15822. "enum": ["once", "always", "reject"]
  15823. }
  15824. },
  15825. "required": ["sessionID", "requestID", "reply"],
  15826. "additionalProperties": false
  15827. }
  15828. },
  15829. "required": ["id", "type", "properties"],
  15830. "additionalProperties": false
  15831. },
  15832. "EventSessionDiff": {
  15833. "type": "object",
  15834. "properties": {
  15835. "id": {
  15836. "type": "string"
  15837. },
  15838. "type": {
  15839. "type": "string",
  15840. "enum": ["session.diff"]
  15841. },
  15842. "properties": {
  15843. "type": "object",
  15844. "properties": {
  15845. "sessionID": {
  15846. "type": "string"
  15847. },
  15848. "diff": {
  15849. "type": "array",
  15850. "items": {
  15851. "$ref": "#/components/schemas/SnapshotFileDiff"
  15852. }
  15853. }
  15854. },
  15855. "required": ["sessionID", "diff"],
  15856. "additionalProperties": false
  15857. }
  15858. },
  15859. "required": ["id", "type", "properties"],
  15860. "additionalProperties": false
  15861. },
  15862. "EventSessionError": {
  15863. "type": "object",
  15864. "properties": {
  15865. "id": {
  15866. "type": "string"
  15867. },
  15868. "type": {
  15869. "type": "string",
  15870. "enum": ["session.error"]
  15871. },
  15872. "properties": {
  15873. "type": "object",
  15874. "properties": {
  15875. "sessionID": {
  15876. "type": "string"
  15877. },
  15878. "error": {
  15879. "anyOf": [
  15880. {
  15881. "$ref": "#/components/schemas/ProviderAuthError"
  15882. },
  15883. {
  15884. "$ref": "#/components/schemas/UnknownError"
  15885. },
  15886. {
  15887. "$ref": "#/components/schemas/MessageOutputLengthError"
  15888. },
  15889. {
  15890. "$ref": "#/components/schemas/MessageAbortedError"
  15891. },
  15892. {
  15893. "$ref": "#/components/schemas/StructuredOutputError"
  15894. },
  15895. {
  15896. "$ref": "#/components/schemas/ContextOverflowError"
  15897. },
  15898. {
  15899. "$ref": "#/components/schemas/APIError"
  15900. }
  15901. ]
  15902. }
  15903. },
  15904. "additionalProperties": false
  15905. }
  15906. },
  15907. "required": ["id", "type", "properties"],
  15908. "additionalProperties": false
  15909. },
  15910. "EventInstallationUpdated": {
  15911. "type": "object",
  15912. "properties": {
  15913. "id": {
  15914. "type": "string"
  15915. },
  15916. "type": {
  15917. "type": "string",
  15918. "enum": ["installation.updated"]
  15919. },
  15920. "properties": {
  15921. "type": "object",
  15922. "properties": {
  15923. "version": {
  15924. "type": "string"
  15925. }
  15926. },
  15927. "required": ["version"],
  15928. "additionalProperties": false
  15929. }
  15930. },
  15931. "required": ["id", "type", "properties"],
  15932. "additionalProperties": false
  15933. },
  15934. "EventInstallationUpdate-available": {
  15935. "type": "object",
  15936. "properties": {
  15937. "id": {
  15938. "type": "string"
  15939. },
  15940. "type": {
  15941. "type": "string",
  15942. "enum": ["installation.update-available"]
  15943. },
  15944. "properties": {
  15945. "type": "object",
  15946. "properties": {
  15947. "version": {
  15948. "type": "string"
  15949. }
  15950. },
  15951. "required": ["version"],
  15952. "additionalProperties": false
  15953. }
  15954. },
  15955. "required": ["id", "type", "properties"],
  15956. "additionalProperties": false
  15957. },
  15958. "EventQuestionAsked": {
  15959. "type": "object",
  15960. "properties": {
  15961. "id": {
  15962. "type": "string"
  15963. },
  15964. "type": {
  15965. "type": "string",
  15966. "enum": ["question.asked"]
  15967. },
  15968. "properties": {
  15969. "$ref": "#/components/schemas/QuestionRequest"
  15970. }
  15971. },
  15972. "required": ["id", "type", "properties"],
  15973. "additionalProperties": false
  15974. },
  15975. "EventQuestionReplied": {
  15976. "type": "object",
  15977. "properties": {
  15978. "id": {
  15979. "type": "string"
  15980. },
  15981. "type": {
  15982. "type": "string",
  15983. "enum": ["question.replied"]
  15984. },
  15985. "properties": {
  15986. "$ref": "#/components/schemas/QuestionReplied"
  15987. }
  15988. },
  15989. "required": ["id", "type", "properties"],
  15990. "additionalProperties": false
  15991. },
  15992. "EventQuestionRejected": {
  15993. "type": "object",
  15994. "properties": {
  15995. "id": {
  15996. "type": "string"
  15997. },
  15998. "type": {
  15999. "type": "string",
  16000. "enum": ["question.rejected"]
  16001. },
  16002. "properties": {
  16003. "$ref": "#/components/schemas/QuestionRejected"
  16004. }
  16005. },
  16006. "required": ["id", "type", "properties"],
  16007. "additionalProperties": false
  16008. },
  16009. "EventTodoUpdated": {
  16010. "type": "object",
  16011. "properties": {
  16012. "id": {
  16013. "type": "string"
  16014. },
  16015. "type": {
  16016. "type": "string",
  16017. "enum": ["todo.updated"]
  16018. },
  16019. "properties": {
  16020. "type": "object",
  16021. "properties": {
  16022. "sessionID": {
  16023. "type": "string"
  16024. },
  16025. "todos": {
  16026. "type": "array",
  16027. "items": {
  16028. "$ref": "#/components/schemas/Todo"
  16029. }
  16030. }
  16031. },
  16032. "required": ["sessionID", "todos"],
  16033. "additionalProperties": false
  16034. }
  16035. },
  16036. "required": ["id", "type", "properties"],
  16037. "additionalProperties": false
  16038. },
  16039. "EventSessionStatus": {
  16040. "type": "object",
  16041. "properties": {
  16042. "id": {
  16043. "type": "string"
  16044. },
  16045. "type": {
  16046. "type": "string",
  16047. "enum": ["session.status"]
  16048. },
  16049. "properties": {
  16050. "type": "object",
  16051. "properties": {
  16052. "sessionID": {
  16053. "type": "string"
  16054. },
  16055. "status": {
  16056. "$ref": "#/components/schemas/SessionStatus"
  16057. }
  16058. },
  16059. "required": ["sessionID", "status"],
  16060. "additionalProperties": false
  16061. }
  16062. },
  16063. "required": ["id", "type", "properties"],
  16064. "additionalProperties": false
  16065. },
  16066. "EventSessionIdle": {
  16067. "type": "object",
  16068. "properties": {
  16069. "id": {
  16070. "type": "string"
  16071. },
  16072. "type": {
  16073. "type": "string",
  16074. "enum": ["session.idle"]
  16075. },
  16076. "properties": {
  16077. "type": "object",
  16078. "properties": {
  16079. "sessionID": {
  16080. "type": "string"
  16081. }
  16082. },
  16083. "required": ["sessionID"],
  16084. "additionalProperties": false
  16085. }
  16086. },
  16087. "required": ["id", "type", "properties"],
  16088. "additionalProperties": false
  16089. },
  16090. "EventSessionCompacted": {
  16091. "type": "object",
  16092. "properties": {
  16093. "id": {
  16094. "type": "string"
  16095. },
  16096. "type": {
  16097. "type": "string",
  16098. "enum": ["session.compacted"]
  16099. },
  16100. "properties": {
  16101. "type": "object",
  16102. "properties": {
  16103. "sessionID": {
  16104. "type": "string"
  16105. }
  16106. },
  16107. "required": ["sessionID"],
  16108. "additionalProperties": false
  16109. }
  16110. },
  16111. "required": ["id", "type", "properties"],
  16112. "additionalProperties": false
  16113. },
  16114. "EventMcpToolsChanged": {
  16115. "type": "object",
  16116. "properties": {
  16117. "id": {
  16118. "type": "string"
  16119. },
  16120. "type": {
  16121. "type": "string",
  16122. "enum": ["mcp.tools.changed"]
  16123. },
  16124. "properties": {
  16125. "type": "object",
  16126. "properties": {
  16127. "server": {
  16128. "type": "string"
  16129. }
  16130. },
  16131. "required": ["server"],
  16132. "additionalProperties": false
  16133. }
  16134. },
  16135. "required": ["id", "type", "properties"],
  16136. "additionalProperties": false
  16137. },
  16138. "EventMcpBrowserOpenFailed": {
  16139. "type": "object",
  16140. "properties": {
  16141. "id": {
  16142. "type": "string"
  16143. },
  16144. "type": {
  16145. "type": "string",
  16146. "enum": ["mcp.browser.open.failed"]
  16147. },
  16148. "properties": {
  16149. "type": "object",
  16150. "properties": {
  16151. "mcpName": {
  16152. "type": "string"
  16153. },
  16154. "url": {
  16155. "type": "string"
  16156. }
  16157. },
  16158. "required": ["mcpName", "url"],
  16159. "additionalProperties": false
  16160. }
  16161. },
  16162. "required": ["id", "type", "properties"],
  16163. "additionalProperties": false
  16164. },
  16165. "EventCommandExecuted": {
  16166. "type": "object",
  16167. "properties": {
  16168. "id": {
  16169. "type": "string"
  16170. },
  16171. "type": {
  16172. "type": "string",
  16173. "enum": ["command.executed"]
  16174. },
  16175. "properties": {
  16176. "type": "object",
  16177. "properties": {
  16178. "name": {
  16179. "type": "string"
  16180. },
  16181. "sessionID": {
  16182. "type": "string"
  16183. },
  16184. "arguments": {
  16185. "type": "string"
  16186. },
  16187. "messageID": {
  16188. "type": "string"
  16189. }
  16190. },
  16191. "required": ["name", "sessionID", "arguments", "messageID"],
  16192. "additionalProperties": false
  16193. }
  16194. },
  16195. "required": ["id", "type", "properties"],
  16196. "additionalProperties": false
  16197. },
  16198. "EventProjectUpdated": {
  16199. "type": "object",
  16200. "properties": {
  16201. "id": {
  16202. "type": "string"
  16203. },
  16204. "type": {
  16205. "type": "string",
  16206. "enum": ["project.updated"]
  16207. },
  16208. "properties": {
  16209. "$ref": "#/components/schemas/Project"
  16210. }
  16211. },
  16212. "required": ["id", "type", "properties"],
  16213. "additionalProperties": false
  16214. },
  16215. "EventVcsBranchUpdated": {
  16216. "type": "object",
  16217. "properties": {
  16218. "id": {
  16219. "type": "string"
  16220. },
  16221. "type": {
  16222. "type": "string",
  16223. "enum": ["vcs.branch.updated"]
  16224. },
  16225. "properties": {
  16226. "type": "object",
  16227. "properties": {
  16228. "branch": {
  16229. "type": "string"
  16230. }
  16231. },
  16232. "additionalProperties": false
  16233. }
  16234. },
  16235. "required": ["id", "type", "properties"],
  16236. "additionalProperties": false
  16237. },
  16238. "EventWorkspaceReady": {
  16239. "type": "object",
  16240. "properties": {
  16241. "id": {
  16242. "type": "string"
  16243. },
  16244. "type": {
  16245. "type": "string",
  16246. "enum": ["workspace.ready"]
  16247. },
  16248. "properties": {
  16249. "type": "object",
  16250. "properties": {
  16251. "name": {
  16252. "type": "string"
  16253. }
  16254. },
  16255. "required": ["name"],
  16256. "additionalProperties": false
  16257. }
  16258. },
  16259. "required": ["id", "type", "properties"],
  16260. "additionalProperties": false
  16261. },
  16262. "EventWorkspaceFailed": {
  16263. "type": "object",
  16264. "properties": {
  16265. "id": {
  16266. "type": "string"
  16267. },
  16268. "type": {
  16269. "type": "string",
  16270. "enum": ["workspace.failed"]
  16271. },
  16272. "properties": {
  16273. "type": "object",
  16274. "properties": {
  16275. "message": {
  16276. "type": "string"
  16277. }
  16278. },
  16279. "required": ["message"],
  16280. "additionalProperties": false
  16281. }
  16282. },
  16283. "required": ["id", "type", "properties"],
  16284. "additionalProperties": false
  16285. },
  16286. "EventWorkspaceStatus": {
  16287. "type": "object",
  16288. "properties": {
  16289. "id": {
  16290. "type": "string"
  16291. },
  16292. "type": {
  16293. "type": "string",
  16294. "enum": ["workspace.status"]
  16295. },
  16296. "properties": {
  16297. "type": "object",
  16298. "properties": {
  16299. "workspaceID": {
  16300. "type": "string"
  16301. },
  16302. "status": {
  16303. "type": "string",
  16304. "enum": ["connected", "connecting", "disconnected", "error"]
  16305. }
  16306. },
  16307. "required": ["workspaceID", "status"],
  16308. "additionalProperties": false
  16309. }
  16310. },
  16311. "required": ["id", "type", "properties"],
  16312. "additionalProperties": false
  16313. },
  16314. "EventWorktreeReady": {
  16315. "type": "object",
  16316. "properties": {
  16317. "id": {
  16318. "type": "string"
  16319. },
  16320. "type": {
  16321. "type": "string",
  16322. "enum": ["worktree.ready"]
  16323. },
  16324. "properties": {
  16325. "type": "object",
  16326. "properties": {
  16327. "name": {
  16328. "type": "string"
  16329. },
  16330. "branch": {
  16331. "type": "string"
  16332. }
  16333. },
  16334. "required": ["name", "branch"],
  16335. "additionalProperties": false
  16336. }
  16337. },
  16338. "required": ["id", "type", "properties"],
  16339. "additionalProperties": false
  16340. },
  16341. "EventWorktreeFailed": {
  16342. "type": "object",
  16343. "properties": {
  16344. "id": {
  16345. "type": "string"
  16346. },
  16347. "type": {
  16348. "type": "string",
  16349. "enum": ["worktree.failed"]
  16350. },
  16351. "properties": {
  16352. "type": "object",
  16353. "properties": {
  16354. "message": {
  16355. "type": "string"
  16356. }
  16357. },
  16358. "required": ["message"],
  16359. "additionalProperties": false
  16360. }
  16361. },
  16362. "required": ["id", "type", "properties"],
  16363. "additionalProperties": false
  16364. },
  16365. "EventPtyCreated": {
  16366. "type": "object",
  16367. "properties": {
  16368. "id": {
  16369. "type": "string"
  16370. },
  16371. "type": {
  16372. "type": "string",
  16373. "enum": ["pty.created"]
  16374. },
  16375. "properties": {
  16376. "type": "object",
  16377. "properties": {
  16378. "info": {
  16379. "$ref": "#/components/schemas/Pty"
  16380. }
  16381. },
  16382. "required": ["info"],
  16383. "additionalProperties": false
  16384. }
  16385. },
  16386. "required": ["id", "type", "properties"],
  16387. "additionalProperties": false
  16388. },
  16389. "EventPtyUpdated": {
  16390. "type": "object",
  16391. "properties": {
  16392. "id": {
  16393. "type": "string"
  16394. },
  16395. "type": {
  16396. "type": "string",
  16397. "enum": ["pty.updated"]
  16398. },
  16399. "properties": {
  16400. "type": "object",
  16401. "properties": {
  16402. "info": {
  16403. "$ref": "#/components/schemas/Pty"
  16404. }
  16405. },
  16406. "required": ["info"],
  16407. "additionalProperties": false
  16408. }
  16409. },
  16410. "required": ["id", "type", "properties"],
  16411. "additionalProperties": false
  16412. },
  16413. "EventPtyExited": {
  16414. "type": "object",
  16415. "properties": {
  16416. "id": {
  16417. "type": "string"
  16418. },
  16419. "type": {
  16420. "type": "string",
  16421. "enum": ["pty.exited"]
  16422. },
  16423. "properties": {
  16424. "type": "object",
  16425. "properties": {
  16426. "id": {
  16427. "type": "string"
  16428. },
  16429. "exitCode": {
  16430. "type": "integer",
  16431. "minimum": 0
  16432. }
  16433. },
  16434. "required": ["id", "exitCode"],
  16435. "additionalProperties": false
  16436. }
  16437. },
  16438. "required": ["id", "type", "properties"],
  16439. "additionalProperties": false
  16440. },
  16441. "EventPtyDeleted": {
  16442. "type": "object",
  16443. "properties": {
  16444. "id": {
  16445. "type": "string"
  16446. },
  16447. "type": {
  16448. "type": "string",
  16449. "enum": ["pty.deleted"]
  16450. },
  16451. "properties": {
  16452. "type": "object",
  16453. "properties": {
  16454. "id": {
  16455. "type": "string"
  16456. }
  16457. },
  16458. "required": ["id"],
  16459. "additionalProperties": false
  16460. }
  16461. },
  16462. "required": ["id", "type", "properties"],
  16463. "additionalProperties": false
  16464. },
  16465. "EventMessageUpdated": {
  16466. "type": "object",
  16467. "properties": {
  16468. "id": {
  16469. "type": "string"
  16470. },
  16471. "type": {
  16472. "type": "string",
  16473. "enum": ["message.updated"]
  16474. },
  16475. "properties": {
  16476. "type": "object",
  16477. "properties": {
  16478. "sessionID": {
  16479. "type": "string"
  16480. },
  16481. "info": {
  16482. "$ref": "#/components/schemas/Message"
  16483. }
  16484. },
  16485. "required": ["sessionID", "info"],
  16486. "additionalProperties": false
  16487. }
  16488. },
  16489. "required": ["id", "type", "properties"],
  16490. "additionalProperties": false
  16491. },
  16492. "EventMessageRemoved": {
  16493. "type": "object",
  16494. "properties": {
  16495. "id": {
  16496. "type": "string"
  16497. },
  16498. "type": {
  16499. "type": "string",
  16500. "enum": ["message.removed"]
  16501. },
  16502. "properties": {
  16503. "type": "object",
  16504. "properties": {
  16505. "sessionID": {
  16506. "type": "string"
  16507. },
  16508. "messageID": {
  16509. "type": "string"
  16510. }
  16511. },
  16512. "required": ["sessionID", "messageID"],
  16513. "additionalProperties": false
  16514. }
  16515. },
  16516. "required": ["id", "type", "properties"],
  16517. "additionalProperties": false
  16518. },
  16519. "EventMessagePartUpdated": {
  16520. "type": "object",
  16521. "properties": {
  16522. "id": {
  16523. "type": "string"
  16524. },
  16525. "type": {
  16526. "type": "string",
  16527. "enum": ["message.part.updated"]
  16528. },
  16529. "properties": {
  16530. "type": "object",
  16531. "properties": {
  16532. "sessionID": {
  16533. "type": "string"
  16534. },
  16535. "part": {
  16536. "$ref": "#/components/schemas/Part"
  16537. },
  16538. "time": {
  16539. "type": "integer",
  16540. "minimum": 0
  16541. }
  16542. },
  16543. "required": ["sessionID", "part", "time"],
  16544. "additionalProperties": false
  16545. }
  16546. },
  16547. "required": ["id", "type", "properties"],
  16548. "additionalProperties": false
  16549. },
  16550. "EventMessagePartRemoved": {
  16551. "type": "object",
  16552. "properties": {
  16553. "id": {
  16554. "type": "string"
  16555. },
  16556. "type": {
  16557. "type": "string",
  16558. "enum": ["message.part.removed"]
  16559. },
  16560. "properties": {
  16561. "type": "object",
  16562. "properties": {
  16563. "sessionID": {
  16564. "type": "string"
  16565. },
  16566. "messageID": {
  16567. "type": "string"
  16568. },
  16569. "partID": {
  16570. "type": "string"
  16571. }
  16572. },
  16573. "required": ["sessionID", "messageID", "partID"],
  16574. "additionalProperties": false
  16575. }
  16576. },
  16577. "required": ["id", "type", "properties"],
  16578. "additionalProperties": false
  16579. },
  16580. "EventSessionCreated": {
  16581. "type": "object",
  16582. "properties": {
  16583. "id": {
  16584. "type": "string"
  16585. },
  16586. "type": {
  16587. "type": "string",
  16588. "enum": ["session.created"]
  16589. },
  16590. "properties": {
  16591. "type": "object",
  16592. "properties": {
  16593. "sessionID": {
  16594. "type": "string"
  16595. },
  16596. "info": {
  16597. "$ref": "#/components/schemas/Session"
  16598. }
  16599. },
  16600. "required": ["sessionID", "info"],
  16601. "additionalProperties": false
  16602. }
  16603. },
  16604. "required": ["id", "type", "properties"],
  16605. "additionalProperties": false
  16606. },
  16607. "EventSessionUpdated": {
  16608. "type": "object",
  16609. "properties": {
  16610. "id": {
  16611. "type": "string"
  16612. },
  16613. "type": {
  16614. "type": "string",
  16615. "enum": ["session.updated"]
  16616. },
  16617. "properties": {
  16618. "type": "object",
  16619. "properties": {
  16620. "sessionID": {
  16621. "type": "string"
  16622. },
  16623. "info": {
  16624. "$ref": "#/components/schemas/Session"
  16625. }
  16626. },
  16627. "required": ["sessionID", "info"],
  16628. "additionalProperties": false
  16629. }
  16630. },
  16631. "required": ["id", "type", "properties"],
  16632. "additionalProperties": false
  16633. },
  16634. "EventSessionDeleted": {
  16635. "type": "object",
  16636. "properties": {
  16637. "id": {
  16638. "type": "string"
  16639. },
  16640. "type": {
  16641. "type": "string",
  16642. "enum": ["session.deleted"]
  16643. },
  16644. "properties": {
  16645. "type": "object",
  16646. "properties": {
  16647. "sessionID": {
  16648. "type": "string"
  16649. },
  16650. "info": {
  16651. "$ref": "#/components/schemas/Session"
  16652. }
  16653. },
  16654. "required": ["sessionID", "info"],
  16655. "additionalProperties": false
  16656. }
  16657. },
  16658. "required": ["id", "type", "properties"],
  16659. "additionalProperties": false
  16660. },
  16661. "EventSessionNextAgentSwitched": {
  16662. "type": "object",
  16663. "properties": {
  16664. "id": {
  16665. "type": "string"
  16666. },
  16667. "type": {
  16668. "type": "string",
  16669. "enum": ["session.next.agent.switched"]
  16670. },
  16671. "properties": {
  16672. "type": "object",
  16673. "properties": {
  16674. "timestamp": {
  16675. "type": "number"
  16676. },
  16677. "sessionID": {
  16678. "type": "string"
  16679. },
  16680. "agent": {
  16681. "type": "string"
  16682. }
  16683. },
  16684. "required": ["timestamp", "sessionID", "agent"],
  16685. "additionalProperties": false
  16686. }
  16687. },
  16688. "required": ["id", "type", "properties"],
  16689. "additionalProperties": false
  16690. },
  16691. "EventSessionNextModelSwitched": {
  16692. "type": "object",
  16693. "properties": {
  16694. "id": {
  16695. "type": "string"
  16696. },
  16697. "type": {
  16698. "type": "string",
  16699. "enum": ["session.next.model.switched"]
  16700. },
  16701. "properties": {
  16702. "type": "object",
  16703. "properties": {
  16704. "timestamp": {
  16705. "type": "number"
  16706. },
  16707. "sessionID": {
  16708. "type": "string"
  16709. },
  16710. "model": {
  16711. "type": "object",
  16712. "properties": {
  16713. "id": {
  16714. "type": "string"
  16715. },
  16716. "providerID": {
  16717. "type": "string"
  16718. },
  16719. "variant": {
  16720. "type": "string"
  16721. }
  16722. },
  16723. "required": ["id", "providerID", "variant"],
  16724. "additionalProperties": false
  16725. }
  16726. },
  16727. "required": ["timestamp", "sessionID", "model"],
  16728. "additionalProperties": false
  16729. }
  16730. },
  16731. "required": ["id", "type", "properties"],
  16732. "additionalProperties": false
  16733. },
  16734. "PromptSource": {
  16735. "type": "object",
  16736. "properties": {
  16737. "start": {
  16738. "type": "number"
  16739. },
  16740. "end": {
  16741. "type": "number"
  16742. },
  16743. "text": {
  16744. "type": "string"
  16745. }
  16746. },
  16747. "required": ["start", "end", "text"],
  16748. "additionalProperties": false
  16749. },
  16750. "PromptFileAttachment": {
  16751. "type": "object",
  16752. "properties": {
  16753. "uri": {
  16754. "type": "string"
  16755. },
  16756. "mime": {
  16757. "type": "string"
  16758. },
  16759. "name": {
  16760. "type": "string"
  16761. },
  16762. "description": {
  16763. "type": "string"
  16764. },
  16765. "source": {
  16766. "$ref": "#/components/schemas/PromptSource"
  16767. }
  16768. },
  16769. "required": ["uri", "mime"],
  16770. "additionalProperties": false
  16771. },
  16772. "PromptAgentAttachment": {
  16773. "type": "object",
  16774. "properties": {
  16775. "name": {
  16776. "type": "string"
  16777. },
  16778. "source": {
  16779. "$ref": "#/components/schemas/PromptSource"
  16780. }
  16781. },
  16782. "required": ["name"],
  16783. "additionalProperties": false
  16784. },
  16785. "EventSessionNextPrompted": {
  16786. "type": "object",
  16787. "properties": {
  16788. "id": {
  16789. "type": "string"
  16790. },
  16791. "type": {
  16792. "type": "string",
  16793. "enum": ["session.next.prompted"]
  16794. },
  16795. "properties": {
  16796. "type": "object",
  16797. "properties": {
  16798. "timestamp": {
  16799. "type": "number"
  16800. },
  16801. "sessionID": {
  16802. "type": "string"
  16803. },
  16804. "prompt": {
  16805. "$ref": "#/components/schemas/Prompt"
  16806. }
  16807. },
  16808. "required": ["timestamp", "sessionID", "prompt"],
  16809. "additionalProperties": false
  16810. }
  16811. },
  16812. "required": ["id", "type", "properties"],
  16813. "additionalProperties": false
  16814. },
  16815. "EventSessionNextSynthetic": {
  16816. "type": "object",
  16817. "properties": {
  16818. "id": {
  16819. "type": "string"
  16820. },
  16821. "type": {
  16822. "type": "string",
  16823. "enum": ["session.next.synthetic"]
  16824. },
  16825. "properties": {
  16826. "type": "object",
  16827. "properties": {
  16828. "timestamp": {
  16829. "type": "number"
  16830. },
  16831. "sessionID": {
  16832. "type": "string"
  16833. },
  16834. "text": {
  16835. "type": "string"
  16836. }
  16837. },
  16838. "required": ["timestamp", "sessionID", "text"],
  16839. "additionalProperties": false
  16840. }
  16841. },
  16842. "required": ["id", "type", "properties"],
  16843. "additionalProperties": false
  16844. },
  16845. "EventSessionNextShellStarted": {
  16846. "type": "object",
  16847. "properties": {
  16848. "id": {
  16849. "type": "string"
  16850. },
  16851. "type": {
  16852. "type": "string",
  16853. "enum": ["session.next.shell.started"]
  16854. },
  16855. "properties": {
  16856. "type": "object",
  16857. "properties": {
  16858. "timestamp": {
  16859. "type": "number"
  16860. },
  16861. "sessionID": {
  16862. "type": "string"
  16863. },
  16864. "callID": {
  16865. "type": "string"
  16866. },
  16867. "command": {
  16868. "type": "string"
  16869. }
  16870. },
  16871. "required": ["timestamp", "sessionID", "callID", "command"],
  16872. "additionalProperties": false
  16873. }
  16874. },
  16875. "required": ["id", "type", "properties"],
  16876. "additionalProperties": false
  16877. },
  16878. "EventSessionNextShellEnded": {
  16879. "type": "object",
  16880. "properties": {
  16881. "id": {
  16882. "type": "string"
  16883. },
  16884. "type": {
  16885. "type": "string",
  16886. "enum": ["session.next.shell.ended"]
  16887. },
  16888. "properties": {
  16889. "type": "object",
  16890. "properties": {
  16891. "timestamp": {
  16892. "type": "number"
  16893. },
  16894. "sessionID": {
  16895. "type": "string"
  16896. },
  16897. "callID": {
  16898. "type": "string"
  16899. },
  16900. "output": {
  16901. "type": "string"
  16902. }
  16903. },
  16904. "required": ["timestamp", "sessionID", "callID", "output"],
  16905. "additionalProperties": false
  16906. }
  16907. },
  16908. "required": ["id", "type", "properties"],
  16909. "additionalProperties": false
  16910. },
  16911. "EventSessionNextStepStarted": {
  16912. "type": "object",
  16913. "properties": {
  16914. "id": {
  16915. "type": "string"
  16916. },
  16917. "type": {
  16918. "type": "string",
  16919. "enum": ["session.next.step.started"]
  16920. },
  16921. "properties": {
  16922. "type": "object",
  16923. "properties": {
  16924. "timestamp": {
  16925. "type": "number"
  16926. },
  16927. "sessionID": {
  16928. "type": "string"
  16929. },
  16930. "agent": {
  16931. "type": "string"
  16932. },
  16933. "model": {
  16934. "type": "object",
  16935. "properties": {
  16936. "id": {
  16937. "type": "string"
  16938. },
  16939. "providerID": {
  16940. "type": "string"
  16941. },
  16942. "variant": {
  16943. "type": "string"
  16944. }
  16945. },
  16946. "required": ["id", "providerID", "variant"],
  16947. "additionalProperties": false
  16948. },
  16949. "snapshot": {
  16950. "type": "string"
  16951. }
  16952. },
  16953. "required": ["timestamp", "sessionID", "agent", "model"],
  16954. "additionalProperties": false
  16955. }
  16956. },
  16957. "required": ["id", "type", "properties"],
  16958. "additionalProperties": false
  16959. },
  16960. "EventSessionNextStepEnded": {
  16961. "type": "object",
  16962. "properties": {
  16963. "id": {
  16964. "type": "string"
  16965. },
  16966. "type": {
  16967. "type": "string",
  16968. "enum": ["session.next.step.ended"]
  16969. },
  16970. "properties": {
  16971. "type": "object",
  16972. "properties": {
  16973. "timestamp": {
  16974. "type": "number"
  16975. },
  16976. "sessionID": {
  16977. "type": "string"
  16978. },
  16979. "finish": {
  16980. "type": "string"
  16981. },
  16982. "cost": {
  16983. "type": "number"
  16984. },
  16985. "tokens": {
  16986. "type": "object",
  16987. "properties": {
  16988. "input": {
  16989. "type": "integer",
  16990. "minimum": 0
  16991. },
  16992. "output": {
  16993. "type": "integer",
  16994. "minimum": 0
  16995. },
  16996. "reasoning": {
  16997. "type": "integer",
  16998. "minimum": 0
  16999. },
  17000. "cache": {
  17001. "type": "object",
  17002. "properties": {
  17003. "read": {
  17004. "type": "integer",
  17005. "minimum": 0
  17006. },
  17007. "write": {
  17008. "type": "integer",
  17009. "minimum": 0
  17010. }
  17011. },
  17012. "required": ["read", "write"],
  17013. "additionalProperties": false
  17014. }
  17015. },
  17016. "required": ["input", "output", "reasoning", "cache"],
  17017. "additionalProperties": false
  17018. },
  17019. "snapshot": {
  17020. "type": "string"
  17021. }
  17022. },
  17023. "required": ["timestamp", "sessionID", "finish", "cost", "tokens"],
  17024. "additionalProperties": false
  17025. }
  17026. },
  17027. "required": ["id", "type", "properties"],
  17028. "additionalProperties": false
  17029. },
  17030. "SessionErrorUnknown": {
  17031. "type": "object",
  17032. "properties": {
  17033. "type": {
  17034. "type": "string",
  17035. "enum": ["unknown"]
  17036. },
  17037. "message": {
  17038. "type": "string"
  17039. }
  17040. },
  17041. "required": ["type", "message"],
  17042. "additionalProperties": false
  17043. },
  17044. "EventSessionNextStepFailed": {
  17045. "type": "object",
  17046. "properties": {
  17047. "id": {
  17048. "type": "string"
  17049. },
  17050. "type": {
  17051. "type": "string",
  17052. "enum": ["session.next.step.failed"]
  17053. },
  17054. "properties": {
  17055. "type": "object",
  17056. "properties": {
  17057. "timestamp": {
  17058. "type": "number"
  17059. },
  17060. "sessionID": {
  17061. "type": "string"
  17062. },
  17063. "error": {
  17064. "$ref": "#/components/schemas/SessionErrorUnknown"
  17065. }
  17066. },
  17067. "required": ["timestamp", "sessionID", "error"],
  17068. "additionalProperties": false
  17069. }
  17070. },
  17071. "required": ["id", "type", "properties"],
  17072. "additionalProperties": false
  17073. },
  17074. "EventSessionNextTextStarted": {
  17075. "type": "object",
  17076. "properties": {
  17077. "id": {
  17078. "type": "string"
  17079. },
  17080. "type": {
  17081. "type": "string",
  17082. "enum": ["session.next.text.started"]
  17083. },
  17084. "properties": {
  17085. "type": "object",
  17086. "properties": {
  17087. "timestamp": {
  17088. "type": "number"
  17089. },
  17090. "sessionID": {
  17091. "type": "string"
  17092. }
  17093. },
  17094. "required": ["timestamp", "sessionID"],
  17095. "additionalProperties": false
  17096. }
  17097. },
  17098. "required": ["id", "type", "properties"],
  17099. "additionalProperties": false
  17100. },
  17101. "EventSessionNextTextDelta": {
  17102. "type": "object",
  17103. "properties": {
  17104. "id": {
  17105. "type": "string"
  17106. },
  17107. "type": {
  17108. "type": "string",
  17109. "enum": ["session.next.text.delta"]
  17110. },
  17111. "properties": {
  17112. "type": "object",
  17113. "properties": {
  17114. "timestamp": {
  17115. "type": "number"
  17116. },
  17117. "sessionID": {
  17118. "type": "string"
  17119. },
  17120. "delta": {
  17121. "type": "string"
  17122. }
  17123. },
  17124. "required": ["timestamp", "sessionID", "delta"],
  17125. "additionalProperties": false
  17126. }
  17127. },
  17128. "required": ["id", "type", "properties"],
  17129. "additionalProperties": false
  17130. },
  17131. "EventSessionNextTextEnded": {
  17132. "type": "object",
  17133. "properties": {
  17134. "id": {
  17135. "type": "string"
  17136. },
  17137. "type": {
  17138. "type": "string",
  17139. "enum": ["session.next.text.ended"]
  17140. },
  17141. "properties": {
  17142. "type": "object",
  17143. "properties": {
  17144. "timestamp": {
  17145. "type": "number"
  17146. },
  17147. "sessionID": {
  17148. "type": "string"
  17149. },
  17150. "text": {
  17151. "type": "string"
  17152. }
  17153. },
  17154. "required": ["timestamp", "sessionID", "text"],
  17155. "additionalProperties": false
  17156. }
  17157. },
  17158. "required": ["id", "type", "properties"],
  17159. "additionalProperties": false
  17160. },
  17161. "EventSessionNextReasoningStarted": {
  17162. "type": "object",
  17163. "properties": {
  17164. "id": {
  17165. "type": "string"
  17166. },
  17167. "type": {
  17168. "type": "string",
  17169. "enum": ["session.next.reasoning.started"]
  17170. },
  17171. "properties": {
  17172. "type": "object",
  17173. "properties": {
  17174. "timestamp": {
  17175. "type": "number"
  17176. },
  17177. "sessionID": {
  17178. "type": "string"
  17179. },
  17180. "reasoningID": {
  17181. "type": "string"
  17182. }
  17183. },
  17184. "required": ["timestamp", "sessionID", "reasoningID"],
  17185. "additionalProperties": false
  17186. }
  17187. },
  17188. "required": ["id", "type", "properties"],
  17189. "additionalProperties": false
  17190. },
  17191. "EventSessionNextReasoningDelta": {
  17192. "type": "object",
  17193. "properties": {
  17194. "id": {
  17195. "type": "string"
  17196. },
  17197. "type": {
  17198. "type": "string",
  17199. "enum": ["session.next.reasoning.delta"]
  17200. },
  17201. "properties": {
  17202. "type": "object",
  17203. "properties": {
  17204. "timestamp": {
  17205. "type": "number"
  17206. },
  17207. "sessionID": {
  17208. "type": "string"
  17209. },
  17210. "reasoningID": {
  17211. "type": "string"
  17212. },
  17213. "delta": {
  17214. "type": "string"
  17215. }
  17216. },
  17217. "required": ["timestamp", "sessionID", "reasoningID", "delta"],
  17218. "additionalProperties": false
  17219. }
  17220. },
  17221. "required": ["id", "type", "properties"],
  17222. "additionalProperties": false
  17223. },
  17224. "EventSessionNextReasoningEnded": {
  17225. "type": "object",
  17226. "properties": {
  17227. "id": {
  17228. "type": "string"
  17229. },
  17230. "type": {
  17231. "type": "string",
  17232. "enum": ["session.next.reasoning.ended"]
  17233. },
  17234. "properties": {
  17235. "type": "object",
  17236. "properties": {
  17237. "timestamp": {
  17238. "type": "number"
  17239. },
  17240. "sessionID": {
  17241. "type": "string"
  17242. },
  17243. "reasoningID": {
  17244. "type": "string"
  17245. },
  17246. "text": {
  17247. "type": "string"
  17248. }
  17249. },
  17250. "required": ["timestamp", "sessionID", "reasoningID", "text"],
  17251. "additionalProperties": false
  17252. }
  17253. },
  17254. "required": ["id", "type", "properties"],
  17255. "additionalProperties": false
  17256. },
  17257. "EventSessionNextToolInputStarted": {
  17258. "type": "object",
  17259. "properties": {
  17260. "id": {
  17261. "type": "string"
  17262. },
  17263. "type": {
  17264. "type": "string",
  17265. "enum": ["session.next.tool.input.started"]
  17266. },
  17267. "properties": {
  17268. "type": "object",
  17269. "properties": {
  17270. "timestamp": {
  17271. "type": "number"
  17272. },
  17273. "sessionID": {
  17274. "type": "string"
  17275. },
  17276. "callID": {
  17277. "type": "string"
  17278. },
  17279. "name": {
  17280. "type": "string"
  17281. }
  17282. },
  17283. "required": ["timestamp", "sessionID", "callID", "name"],
  17284. "additionalProperties": false
  17285. }
  17286. },
  17287. "required": ["id", "type", "properties"],
  17288. "additionalProperties": false
  17289. },
  17290. "EventSessionNextToolInputDelta": {
  17291. "type": "object",
  17292. "properties": {
  17293. "id": {
  17294. "type": "string"
  17295. },
  17296. "type": {
  17297. "type": "string",
  17298. "enum": ["session.next.tool.input.delta"]
  17299. },
  17300. "properties": {
  17301. "type": "object",
  17302. "properties": {
  17303. "timestamp": {
  17304. "type": "number"
  17305. },
  17306. "sessionID": {
  17307. "type": "string"
  17308. },
  17309. "callID": {
  17310. "type": "string"
  17311. },
  17312. "delta": {
  17313. "type": "string"
  17314. }
  17315. },
  17316. "required": ["timestamp", "sessionID", "callID", "delta"],
  17317. "additionalProperties": false
  17318. }
  17319. },
  17320. "required": ["id", "type", "properties"],
  17321. "additionalProperties": false
  17322. },
  17323. "EventSessionNextToolInputEnded": {
  17324. "type": "object",
  17325. "properties": {
  17326. "id": {
  17327. "type": "string"
  17328. },
  17329. "type": {
  17330. "type": "string",
  17331. "enum": ["session.next.tool.input.ended"]
  17332. },
  17333. "properties": {
  17334. "type": "object",
  17335. "properties": {
  17336. "timestamp": {
  17337. "type": "number"
  17338. },
  17339. "sessionID": {
  17340. "type": "string"
  17341. },
  17342. "callID": {
  17343. "type": "string"
  17344. },
  17345. "text": {
  17346. "type": "string"
  17347. }
  17348. },
  17349. "required": ["timestamp", "sessionID", "callID", "text"],
  17350. "additionalProperties": false
  17351. }
  17352. },
  17353. "required": ["id", "type", "properties"],
  17354. "additionalProperties": false
  17355. },
  17356. "EventSessionNextToolCalled": {
  17357. "type": "object",
  17358. "properties": {
  17359. "id": {
  17360. "type": "string"
  17361. },
  17362. "type": {
  17363. "type": "string",
  17364. "enum": ["session.next.tool.called"]
  17365. },
  17366. "properties": {
  17367. "type": "object",
  17368. "properties": {
  17369. "timestamp": {
  17370. "type": "number"
  17371. },
  17372. "sessionID": {
  17373. "type": "string"
  17374. },
  17375. "callID": {
  17376. "type": "string"
  17377. },
  17378. "tool": {
  17379. "type": "string"
  17380. },
  17381. "input": {
  17382. "type": "object"
  17383. },
  17384. "provider": {
  17385. "type": "object",
  17386. "properties": {
  17387. "executed": {
  17388. "type": "boolean"
  17389. },
  17390. "metadata": {
  17391. "type": "object"
  17392. }
  17393. },
  17394. "required": ["executed"],
  17395. "additionalProperties": false
  17396. }
  17397. },
  17398. "required": ["timestamp", "sessionID", "callID", "tool", "input", "provider"],
  17399. "additionalProperties": false
  17400. }
  17401. },
  17402. "required": ["id", "type", "properties"],
  17403. "additionalProperties": false
  17404. },
  17405. "ToolTextContent": {
  17406. "type": "object",
  17407. "properties": {
  17408. "type": {
  17409. "type": "string",
  17410. "enum": ["text"]
  17411. },
  17412. "text": {
  17413. "type": "string"
  17414. }
  17415. },
  17416. "required": ["type", "text"],
  17417. "additionalProperties": false
  17418. },
  17419. "ToolFileContent": {
  17420. "type": "object",
  17421. "properties": {
  17422. "type": {
  17423. "type": "string",
  17424. "enum": ["file"]
  17425. },
  17426. "uri": {
  17427. "type": "string"
  17428. },
  17429. "mime": {
  17430. "type": "string"
  17431. },
  17432. "name": {
  17433. "type": "string"
  17434. }
  17435. },
  17436. "required": ["type", "uri", "mime"],
  17437. "additionalProperties": false
  17438. },
  17439. "EventSessionNextToolProgress": {
  17440. "type": "object",
  17441. "properties": {
  17442. "id": {
  17443. "type": "string"
  17444. },
  17445. "type": {
  17446. "type": "string",
  17447. "enum": ["session.next.tool.progress"]
  17448. },
  17449. "properties": {
  17450. "type": "object",
  17451. "properties": {
  17452. "timestamp": {
  17453. "type": "number"
  17454. },
  17455. "sessionID": {
  17456. "type": "string"
  17457. },
  17458. "callID": {
  17459. "type": "string"
  17460. },
  17461. "structured": {
  17462. "type": "object"
  17463. },
  17464. "content": {
  17465. "type": "array",
  17466. "items": {
  17467. "anyOf": [
  17468. {
  17469. "$ref": "#/components/schemas/ToolTextContent"
  17470. },
  17471. {
  17472. "$ref": "#/components/schemas/ToolFileContent"
  17473. }
  17474. ]
  17475. }
  17476. }
  17477. },
  17478. "required": ["timestamp", "sessionID", "callID", "structured", "content"],
  17479. "additionalProperties": false
  17480. }
  17481. },
  17482. "required": ["id", "type", "properties"],
  17483. "additionalProperties": false
  17484. },
  17485. "EventSessionNextToolSuccess": {
  17486. "type": "object",
  17487. "properties": {
  17488. "id": {
  17489. "type": "string"
  17490. },
  17491. "type": {
  17492. "type": "string",
  17493. "enum": ["session.next.tool.success"]
  17494. },
  17495. "properties": {
  17496. "type": "object",
  17497. "properties": {
  17498. "timestamp": {
  17499. "type": "number"
  17500. },
  17501. "sessionID": {
  17502. "type": "string"
  17503. },
  17504. "callID": {
  17505. "type": "string"
  17506. },
  17507. "structured": {
  17508. "type": "object"
  17509. },
  17510. "content": {
  17511. "type": "array",
  17512. "items": {
  17513. "anyOf": [
  17514. {
  17515. "$ref": "#/components/schemas/ToolTextContent"
  17516. },
  17517. {
  17518. "$ref": "#/components/schemas/ToolFileContent"
  17519. }
  17520. ]
  17521. }
  17522. },
  17523. "provider": {
  17524. "type": "object",
  17525. "properties": {
  17526. "executed": {
  17527. "type": "boolean"
  17528. },
  17529. "metadata": {
  17530. "type": "object"
  17531. }
  17532. },
  17533. "required": ["executed"],
  17534. "additionalProperties": false
  17535. }
  17536. },
  17537. "required": ["timestamp", "sessionID", "callID", "structured", "content", "provider"],
  17538. "additionalProperties": false
  17539. }
  17540. },
  17541. "required": ["id", "type", "properties"],
  17542. "additionalProperties": false
  17543. },
  17544. "EventSessionNextToolFailed": {
  17545. "type": "object",
  17546. "properties": {
  17547. "id": {
  17548. "type": "string"
  17549. },
  17550. "type": {
  17551. "type": "string",
  17552. "enum": ["session.next.tool.failed"]
  17553. },
  17554. "properties": {
  17555. "type": "object",
  17556. "properties": {
  17557. "timestamp": {
  17558. "type": "number"
  17559. },
  17560. "sessionID": {
  17561. "type": "string"
  17562. },
  17563. "callID": {
  17564. "type": "string"
  17565. },
  17566. "error": {
  17567. "$ref": "#/components/schemas/SessionErrorUnknown"
  17568. },
  17569. "provider": {
  17570. "type": "object",
  17571. "properties": {
  17572. "executed": {
  17573. "type": "boolean"
  17574. },
  17575. "metadata": {
  17576. "type": "object"
  17577. }
  17578. },
  17579. "required": ["executed"],
  17580. "additionalProperties": false
  17581. }
  17582. },
  17583. "required": ["timestamp", "sessionID", "callID", "error", "provider"],
  17584. "additionalProperties": false
  17585. }
  17586. },
  17587. "required": ["id", "type", "properties"],
  17588. "additionalProperties": false
  17589. },
  17590. "SessionNextRetry_error": {
  17591. "type": "object",
  17592. "properties": {
  17593. "message": {
  17594. "type": "string"
  17595. },
  17596. "statusCode": {
  17597. "type": "integer",
  17598. "minimum": 0
  17599. },
  17600. "isRetryable": {
  17601. "type": "boolean"
  17602. },
  17603. "responseHeaders": {
  17604. "type": "object",
  17605. "additionalProperties": {
  17606. "type": "string"
  17607. }
  17608. },
  17609. "responseBody": {
  17610. "type": "string"
  17611. },
  17612. "metadata": {
  17613. "type": "object",
  17614. "additionalProperties": {
  17615. "type": "string"
  17616. }
  17617. }
  17618. },
  17619. "required": ["message", "isRetryable"],
  17620. "additionalProperties": false
  17621. },
  17622. "EventSessionNextRetried": {
  17623. "type": "object",
  17624. "properties": {
  17625. "id": {
  17626. "type": "string"
  17627. },
  17628. "type": {
  17629. "type": "string",
  17630. "enum": ["session.next.retried"]
  17631. },
  17632. "properties": {
  17633. "type": "object",
  17634. "properties": {
  17635. "timestamp": {
  17636. "type": "number"
  17637. },
  17638. "sessionID": {
  17639. "type": "string"
  17640. },
  17641. "attempt": {
  17642. "type": "integer",
  17643. "minimum": 0
  17644. },
  17645. "error": {
  17646. "$ref": "#/components/schemas/SessionNextRetry_error"
  17647. }
  17648. },
  17649. "required": ["timestamp", "sessionID", "attempt", "error"],
  17650. "additionalProperties": false
  17651. }
  17652. },
  17653. "required": ["id", "type", "properties"],
  17654. "additionalProperties": false
  17655. },
  17656. "EventSessionNextCompactionStarted": {
  17657. "type": "object",
  17658. "properties": {
  17659. "id": {
  17660. "type": "string"
  17661. },
  17662. "type": {
  17663. "type": "string",
  17664. "enum": ["session.next.compaction.started"]
  17665. },
  17666. "properties": {
  17667. "type": "object",
  17668. "properties": {
  17669. "timestamp": {
  17670. "type": "number"
  17671. },
  17672. "sessionID": {
  17673. "type": "string"
  17674. },
  17675. "reason": {
  17676. "type": "string",
  17677. "enum": ["auto", "manual"]
  17678. }
  17679. },
  17680. "required": ["timestamp", "sessionID", "reason"],
  17681. "additionalProperties": false
  17682. }
  17683. },
  17684. "required": ["id", "type", "properties"],
  17685. "additionalProperties": false
  17686. },
  17687. "EventSessionNextCompactionDelta": {
  17688. "type": "object",
  17689. "properties": {
  17690. "id": {
  17691. "type": "string"
  17692. },
  17693. "type": {
  17694. "type": "string",
  17695. "enum": ["session.next.compaction.delta"]
  17696. },
  17697. "properties": {
  17698. "type": "object",
  17699. "properties": {
  17700. "timestamp": {
  17701. "type": "number"
  17702. },
  17703. "sessionID": {
  17704. "type": "string"
  17705. },
  17706. "text": {
  17707. "type": "string"
  17708. }
  17709. },
  17710. "required": ["timestamp", "sessionID", "text"],
  17711. "additionalProperties": false
  17712. }
  17713. },
  17714. "required": ["id", "type", "properties"],
  17715. "additionalProperties": false
  17716. },
  17717. "EventSessionNextCompactionEnded": {
  17718. "type": "object",
  17719. "properties": {
  17720. "id": {
  17721. "type": "string"
  17722. },
  17723. "type": {
  17724. "type": "string",
  17725. "enum": ["session.next.compaction.ended"]
  17726. },
  17727. "properties": {
  17728. "type": "object",
  17729. "properties": {
  17730. "timestamp": {
  17731. "type": "number"
  17732. },
  17733. "sessionID": {
  17734. "type": "string"
  17735. },
  17736. "text": {
  17737. "type": "string"
  17738. },
  17739. "include": {
  17740. "type": "string"
  17741. }
  17742. },
  17743. "required": ["timestamp", "sessionID", "text"],
  17744. "additionalProperties": false
  17745. }
  17746. },
  17747. "required": ["id", "type", "properties"],
  17748. "additionalProperties": false
  17749. },
  17750. "EventServerConnected": {
  17751. "type": "object",
  17752. "properties": {
  17753. "id": {
  17754. "type": "string"
  17755. },
  17756. "type": {
  17757. "type": "string",
  17758. "enum": ["server.connected"]
  17759. },
  17760. "properties": {
  17761. "type": "object",
  17762. "properties": {}
  17763. }
  17764. },
  17765. "required": ["id", "type", "properties"],
  17766. "additionalProperties": false
  17767. },
  17768. "EventGlobalDisposed": {
  17769. "type": "object",
  17770. "properties": {
  17771. "id": {
  17772. "type": "string"
  17773. },
  17774. "type": {
  17775. "type": "string",
  17776. "enum": ["global.disposed"]
  17777. },
  17778. "properties": {
  17779. "type": "object",
  17780. "properties": {}
  17781. }
  17782. },
  17783. "required": ["id", "type", "properties"],
  17784. "additionalProperties": false
  17785. },
  17786. "SessionInfo": {
  17787. "type": "object",
  17788. "properties": {
  17789. "id": {
  17790. "type": "string"
  17791. },
  17792. "parentID": {
  17793. "type": "string"
  17794. },
  17795. "projectID": {
  17796. "type": "string"
  17797. },
  17798. "workspaceID": {
  17799. "type": "string"
  17800. },
  17801. "path": {
  17802. "type": "string"
  17803. },
  17804. "agent": {
  17805. "type": "string"
  17806. },
  17807. "model": {
  17808. "type": "object",
  17809. "properties": {
  17810. "id": {
  17811. "type": "string"
  17812. },
  17813. "providerID": {
  17814. "type": "string"
  17815. },
  17816. "variant": {
  17817. "type": "string"
  17818. }
  17819. },
  17820. "required": ["id", "providerID", "variant"],
  17821. "additionalProperties": false
  17822. },
  17823. "time": {
  17824. "type": "object",
  17825. "properties": {
  17826. "created": {
  17827. "type": "number"
  17828. },
  17829. "updated": {
  17830. "type": "number"
  17831. },
  17832. "archived": {
  17833. "type": "number"
  17834. }
  17835. },
  17836. "required": ["created", "updated"],
  17837. "additionalProperties": false
  17838. },
  17839. "title": {
  17840. "type": "string"
  17841. }
  17842. },
  17843. "required": ["id", "projectID", "time", "title"],
  17844. "additionalProperties": false
  17845. },
  17846. "SessionDelivery": {
  17847. "type": "string",
  17848. "enum": ["immediate", "deferred"]
  17849. },
  17850. "SessionMessageAgentSwitched": {
  17851. "type": "object",
  17852. "properties": {
  17853. "id": {
  17854. "type": "string"
  17855. },
  17856. "metadata": {
  17857. "type": "object"
  17858. },
  17859. "time": {
  17860. "type": "object",
  17861. "properties": {
  17862. "created": {
  17863. "type": "number"
  17864. }
  17865. },
  17866. "required": ["created"],
  17867. "additionalProperties": false
  17868. },
  17869. "type": {
  17870. "type": "string",
  17871. "enum": ["agent-switched"]
  17872. },
  17873. "agent": {
  17874. "type": "string"
  17875. }
  17876. },
  17877. "required": ["id", "time", "type", "agent"],
  17878. "additionalProperties": false
  17879. },
  17880. "SessionMessageModelSwitched": {
  17881. "type": "object",
  17882. "properties": {
  17883. "id": {
  17884. "type": "string"
  17885. },
  17886. "metadata": {
  17887. "type": "object"
  17888. },
  17889. "time": {
  17890. "type": "object",
  17891. "properties": {
  17892. "created": {
  17893. "type": "number"
  17894. }
  17895. },
  17896. "required": ["created"],
  17897. "additionalProperties": false
  17898. },
  17899. "type": {
  17900. "type": "string",
  17901. "enum": ["model-switched"]
  17902. },
  17903. "model": {
  17904. "type": "object",
  17905. "properties": {
  17906. "id": {
  17907. "type": "string"
  17908. },
  17909. "providerID": {
  17910. "type": "string"
  17911. },
  17912. "variant": {
  17913. "type": "string"
  17914. }
  17915. },
  17916. "required": ["id", "providerID", "variant"],
  17917. "additionalProperties": false
  17918. }
  17919. },
  17920. "required": ["id", "time", "type", "model"],
  17921. "additionalProperties": false
  17922. },
  17923. "SessionMessageUser": {
  17924. "type": "object",
  17925. "properties": {
  17926. "id": {
  17927. "type": "string"
  17928. },
  17929. "metadata": {
  17930. "type": "object"
  17931. },
  17932. "time": {
  17933. "type": "object",
  17934. "properties": {
  17935. "created": {
  17936. "type": "number"
  17937. }
  17938. },
  17939. "required": ["created"],
  17940. "additionalProperties": false
  17941. },
  17942. "text": {
  17943. "type": "string"
  17944. },
  17945. "files": {
  17946. "type": "array",
  17947. "items": {
  17948. "$ref": "#/components/schemas/PromptFileAttachment"
  17949. }
  17950. },
  17951. "agents": {
  17952. "type": "array",
  17953. "items": {
  17954. "$ref": "#/components/schemas/PromptAgentAttachment"
  17955. }
  17956. },
  17957. "type": {
  17958. "type": "string",
  17959. "enum": ["user"]
  17960. }
  17961. },
  17962. "required": ["id", "time", "text", "type"],
  17963. "additionalProperties": false
  17964. },
  17965. "SessionMessageSynthetic": {
  17966. "type": "object",
  17967. "properties": {
  17968. "id": {
  17969. "type": "string"
  17970. },
  17971. "metadata": {
  17972. "type": "object"
  17973. },
  17974. "time": {
  17975. "type": "object",
  17976. "properties": {
  17977. "created": {
  17978. "type": "number"
  17979. }
  17980. },
  17981. "required": ["created"],
  17982. "additionalProperties": false
  17983. },
  17984. "sessionID": {
  17985. "type": "string"
  17986. },
  17987. "text": {
  17988. "type": "string"
  17989. },
  17990. "type": {
  17991. "type": "string",
  17992. "enum": ["synthetic"]
  17993. }
  17994. },
  17995. "required": ["id", "time", "sessionID", "text", "type"],
  17996. "additionalProperties": false
  17997. },
  17998. "SessionMessageShell": {
  17999. "type": "object",
  18000. "properties": {
  18001. "id": {
  18002. "type": "string"
  18003. },
  18004. "metadata": {
  18005. "type": "object"
  18006. },
  18007. "time": {
  18008. "type": "object",
  18009. "properties": {
  18010. "created": {
  18011. "type": "number"
  18012. },
  18013. "completed": {
  18014. "type": "number"
  18015. }
  18016. },
  18017. "required": ["created"],
  18018. "additionalProperties": false
  18019. },
  18020. "type": {
  18021. "type": "string",
  18022. "enum": ["shell"]
  18023. },
  18024. "callID": {
  18025. "type": "string"
  18026. },
  18027. "command": {
  18028. "type": "string"
  18029. },
  18030. "output": {
  18031. "type": "string"
  18032. }
  18033. },
  18034. "required": ["id", "time", "type", "callID", "command", "output"],
  18035. "additionalProperties": false
  18036. },
  18037. "SessionMessageAssistantText": {
  18038. "type": "object",
  18039. "properties": {
  18040. "type": {
  18041. "type": "string",
  18042. "enum": ["text"]
  18043. },
  18044. "text": {
  18045. "type": "string"
  18046. }
  18047. },
  18048. "required": ["type", "text"],
  18049. "additionalProperties": false
  18050. },
  18051. "SessionMessageAssistantReasoning": {
  18052. "type": "object",
  18053. "properties": {
  18054. "type": {
  18055. "type": "string",
  18056. "enum": ["reasoning"]
  18057. },
  18058. "id": {
  18059. "type": "string"
  18060. },
  18061. "text": {
  18062. "type": "string"
  18063. }
  18064. },
  18065. "required": ["type", "id", "text"],
  18066. "additionalProperties": false
  18067. },
  18068. "SessionMessageToolStatePending": {
  18069. "type": "object",
  18070. "properties": {
  18071. "status": {
  18072. "type": "string",
  18073. "enum": ["pending"]
  18074. },
  18075. "input": {
  18076. "type": "string"
  18077. }
  18078. },
  18079. "required": ["status", "input"],
  18080. "additionalProperties": false
  18081. },
  18082. "SessionMessageToolStateRunning": {
  18083. "type": "object",
  18084. "properties": {
  18085. "status": {
  18086. "type": "string",
  18087. "enum": ["running"]
  18088. },
  18089. "input": {
  18090. "type": "object"
  18091. },
  18092. "structured": {
  18093. "type": "object"
  18094. },
  18095. "content": {
  18096. "type": "array",
  18097. "items": {
  18098. "anyOf": [
  18099. {
  18100. "$ref": "#/components/schemas/ToolTextContent"
  18101. },
  18102. {
  18103. "$ref": "#/components/schemas/ToolFileContent"
  18104. }
  18105. ]
  18106. }
  18107. }
  18108. },
  18109. "required": ["status", "input", "structured", "content"],
  18110. "additionalProperties": false
  18111. },
  18112. "SessionMessageToolStateCompleted": {
  18113. "type": "object",
  18114. "properties": {
  18115. "status": {
  18116. "type": "string",
  18117. "enum": ["completed"]
  18118. },
  18119. "input": {
  18120. "type": "object"
  18121. },
  18122. "attachments": {
  18123. "type": "array",
  18124. "items": {
  18125. "$ref": "#/components/schemas/PromptFileAttachment"
  18126. }
  18127. },
  18128. "content": {
  18129. "type": "array",
  18130. "items": {
  18131. "anyOf": [
  18132. {
  18133. "$ref": "#/components/schemas/ToolTextContent"
  18134. },
  18135. {
  18136. "$ref": "#/components/schemas/ToolFileContent"
  18137. }
  18138. ]
  18139. }
  18140. },
  18141. "structured": {
  18142. "type": "object"
  18143. }
  18144. },
  18145. "required": ["status", "input", "content", "structured"],
  18146. "additionalProperties": false
  18147. },
  18148. "SessionMessageToolStateError": {
  18149. "type": "object",
  18150. "properties": {
  18151. "status": {
  18152. "type": "string",
  18153. "enum": ["error"]
  18154. },
  18155. "input": {
  18156. "type": "object"
  18157. },
  18158. "content": {
  18159. "type": "array",
  18160. "items": {
  18161. "anyOf": [
  18162. {
  18163. "$ref": "#/components/schemas/ToolTextContent"
  18164. },
  18165. {
  18166. "$ref": "#/components/schemas/ToolFileContent"
  18167. }
  18168. ]
  18169. }
  18170. },
  18171. "structured": {
  18172. "type": "object"
  18173. },
  18174. "error": {
  18175. "$ref": "#/components/schemas/SessionErrorUnknown"
  18176. }
  18177. },
  18178. "required": ["status", "input", "content", "structured", "error"],
  18179. "additionalProperties": false
  18180. },
  18181. "SessionMessageAssistantTool": {
  18182. "type": "object",
  18183. "properties": {
  18184. "type": {
  18185. "type": "string",
  18186. "enum": ["tool"]
  18187. },
  18188. "id": {
  18189. "type": "string"
  18190. },
  18191. "name": {
  18192. "type": "string"
  18193. },
  18194. "provider": {
  18195. "type": "object",
  18196. "properties": {
  18197. "executed": {
  18198. "type": "boolean"
  18199. },
  18200. "metadata": {
  18201. "type": "object"
  18202. }
  18203. },
  18204. "required": ["executed"],
  18205. "additionalProperties": false
  18206. },
  18207. "state": {
  18208. "anyOf": [
  18209. {
  18210. "$ref": "#/components/schemas/SessionMessageToolStatePending"
  18211. },
  18212. {
  18213. "$ref": "#/components/schemas/SessionMessageToolStateRunning"
  18214. },
  18215. {
  18216. "$ref": "#/components/schemas/SessionMessageToolStateCompleted"
  18217. },
  18218. {
  18219. "$ref": "#/components/schemas/SessionMessageToolStateError"
  18220. }
  18221. ]
  18222. },
  18223. "time": {
  18224. "type": "object",
  18225. "properties": {
  18226. "created": {
  18227. "type": "number"
  18228. },
  18229. "ran": {
  18230. "type": "number"
  18231. },
  18232. "completed": {
  18233. "type": "number"
  18234. },
  18235. "pruned": {
  18236. "type": "number"
  18237. }
  18238. },
  18239. "required": ["created"],
  18240. "additionalProperties": false
  18241. }
  18242. },
  18243. "required": ["type", "id", "name", "state", "time"],
  18244. "additionalProperties": false
  18245. },
  18246. "SessionMessageAssistant": {
  18247. "type": "object",
  18248. "properties": {
  18249. "id": {
  18250. "type": "string"
  18251. },
  18252. "metadata": {
  18253. "type": "object"
  18254. },
  18255. "time": {
  18256. "type": "object",
  18257. "properties": {
  18258. "created": {
  18259. "type": "number"
  18260. },
  18261. "completed": {
  18262. "type": "number"
  18263. }
  18264. },
  18265. "required": ["created"],
  18266. "additionalProperties": false
  18267. },
  18268. "type": {
  18269. "type": "string",
  18270. "enum": ["assistant"]
  18271. },
  18272. "agent": {
  18273. "type": "string"
  18274. },
  18275. "model": {
  18276. "type": "object",
  18277. "properties": {
  18278. "id": {
  18279. "type": "string"
  18280. },
  18281. "providerID": {
  18282. "type": "string"
  18283. },
  18284. "variant": {
  18285. "type": "string"
  18286. }
  18287. },
  18288. "required": ["id", "providerID", "variant"],
  18289. "additionalProperties": false
  18290. },
  18291. "content": {
  18292. "type": "array",
  18293. "items": {
  18294. "anyOf": [
  18295. {
  18296. "$ref": "#/components/schemas/SessionMessageAssistantText"
  18297. },
  18298. {
  18299. "$ref": "#/components/schemas/SessionMessageAssistantReasoning"
  18300. },
  18301. {
  18302. "$ref": "#/components/schemas/SessionMessageAssistantTool"
  18303. }
  18304. ]
  18305. }
  18306. },
  18307. "snapshot": {
  18308. "type": "object",
  18309. "properties": {
  18310. "start": {
  18311. "type": "string"
  18312. },
  18313. "end": {
  18314. "type": "string"
  18315. }
  18316. },
  18317. "additionalProperties": false
  18318. },
  18319. "finish": {
  18320. "type": "string"
  18321. },
  18322. "cost": {
  18323. "type": "number"
  18324. },
  18325. "tokens": {
  18326. "type": "object",
  18327. "properties": {
  18328. "input": {
  18329. "type": "number"
  18330. },
  18331. "output": {
  18332. "type": "number"
  18333. },
  18334. "reasoning": {
  18335. "type": "number"
  18336. },
  18337. "cache": {
  18338. "type": "object",
  18339. "properties": {
  18340. "read": {
  18341. "type": "number"
  18342. },
  18343. "write": {
  18344. "type": "number"
  18345. }
  18346. },
  18347. "required": ["read", "write"],
  18348. "additionalProperties": false
  18349. }
  18350. },
  18351. "required": ["input", "output", "reasoning", "cache"],
  18352. "additionalProperties": false
  18353. },
  18354. "error": {
  18355. "$ref": "#/components/schemas/SessionErrorUnknown"
  18356. }
  18357. },
  18358. "required": ["id", "time", "type", "agent", "model", "content"],
  18359. "additionalProperties": false
  18360. },
  18361. "SessionMessageCompaction": {
  18362. "type": "object",
  18363. "properties": {
  18364. "type": {
  18365. "type": "string",
  18366. "enum": ["compaction"]
  18367. },
  18368. "reason": {
  18369. "type": "string",
  18370. "enum": ["auto", "manual"]
  18371. },
  18372. "summary": {
  18373. "type": "string"
  18374. },
  18375. "include": {
  18376. "type": "string"
  18377. },
  18378. "id": {
  18379. "type": "string"
  18380. },
  18381. "metadata": {
  18382. "type": "object"
  18383. },
  18384. "time": {
  18385. "type": "object",
  18386. "properties": {
  18387. "created": {
  18388. "type": "number"
  18389. }
  18390. },
  18391. "required": ["created"],
  18392. "additionalProperties": false
  18393. }
  18394. },
  18395. "required": ["type", "reason", "summary", "id", "time"],
  18396. "additionalProperties": false
  18397. },
  18398. "SessionMessage": {
  18399. "anyOf": [
  18400. {
  18401. "$ref": "#/components/schemas/SessionMessageAgentSwitched"
  18402. },
  18403. {
  18404. "$ref": "#/components/schemas/SessionMessageModelSwitched"
  18405. },
  18406. {
  18407. "$ref": "#/components/schemas/SessionMessageUser"
  18408. },
  18409. {
  18410. "$ref": "#/components/schemas/SessionMessageSynthetic"
  18411. },
  18412. {
  18413. "$ref": "#/components/schemas/SessionMessageShell"
  18414. },
  18415. {
  18416. "$ref": "#/components/schemas/SessionMessageAssistant"
  18417. },
  18418. {
  18419. "$ref": "#/components/schemas/SessionMessageCompaction"
  18420. }
  18421. ]
  18422. },
  18423. "EventTuiToastShow1": {
  18424. "type": "object",
  18425. "properties": {
  18426. "id": {
  18427. "type": "string"
  18428. },
  18429. "type": {
  18430. "type": "string",
  18431. "enum": ["tui.toast.show"]
  18432. },
  18433. "properties": {
  18434. "type": "object",
  18435. "properties": {
  18436. "title": {
  18437. "type": "string"
  18438. },
  18439. "message": {
  18440. "type": "string"
  18441. },
  18442. "variant": {
  18443. "type": "string",
  18444. "enum": ["info", "success", "warning", "error"]
  18445. },
  18446. "duration": {
  18447. "type": "integer",
  18448. "exclusiveMinimum": 0
  18449. }
  18450. },
  18451. "required": ["message", "variant"],
  18452. "additionalProperties": false
  18453. }
  18454. },
  18455. "required": ["id", "type", "properties"],
  18456. "additionalProperties": false
  18457. },
  18458. "BadRequestError": {
  18459. "type": "object",
  18460. "required": ["data", "errors", "success"],
  18461. "properties": {
  18462. "data": {},
  18463. "errors": {
  18464. "type": "array",
  18465. "items": {
  18466. "type": "object",
  18467. "additionalProperties": {}
  18468. }
  18469. },
  18470. "success": {
  18471. "type": "boolean",
  18472. "enum": [false]
  18473. }
  18474. }
  18475. }
  18476. }
  18477. },
  18478. "security": [],
  18479. "tags": [
  18480. {
  18481. "name": "control",
  18482. "description": "Control plane routes."
  18483. },
  18484. {
  18485. "name": "global",
  18486. "description": "Global server routes."
  18487. },
  18488. {
  18489. "name": "event",
  18490. "description": "Instance event stream route."
  18491. },
  18492. {
  18493. "name": "config",
  18494. "description": "Experimental HttpApi config routes."
  18495. },
  18496. {
  18497. "name": "experimental",
  18498. "description": "Experimental HttpApi read-only routes."
  18499. },
  18500. {
  18501. "name": "file",
  18502. "description": "Experimental HttpApi file routes."
  18503. },
  18504. {
  18505. "name": "instance",
  18506. "description": "Experimental HttpApi instance read routes."
  18507. },
  18508. {
  18509. "name": "mcp",
  18510. "description": "Experimental HttpApi MCP routes."
  18511. },
  18512. {
  18513. "name": "project",
  18514. "description": "Experimental HttpApi project routes."
  18515. },
  18516. {
  18517. "name": "pty",
  18518. "description": "Experimental HttpApi PTY routes."
  18519. },
  18520. {
  18521. "name": "question",
  18522. "description": "Question routes."
  18523. },
  18524. {
  18525. "name": "permission",
  18526. "description": "Experimental HttpApi permission routes."
  18527. },
  18528. {
  18529. "name": "provider",
  18530. "description": "Experimental HttpApi provider routes."
  18531. },
  18532. {
  18533. "name": "session",
  18534. "description": "Experimental HttpApi session routes."
  18535. },
  18536. {
  18537. "name": "sync",
  18538. "description": "Experimental HttpApi sync routes."
  18539. },
  18540. {
  18541. "name": "v2",
  18542. "description": "Experimental v2 routes."
  18543. },
  18544. {
  18545. "name": "v2 messages",
  18546. "description": "Experimental v2 message routes."
  18547. },
  18548. {
  18549. "name": "tui",
  18550. "description": "Experimental HttpApi TUI routes."
  18551. },
  18552. {
  18553. "name": "workspace",
  18554. "description": "Experimental HttpApi workspace routes."
  18555. },
  18556. {
  18557. "name": "pty",
  18558. "description": "PTY websocket route."
  18559. }
  18560. ]
  18561. }