openapi.json 503 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530
  1. {
  2. "openapi": "3.1.0",
  3. "info": {
  4. "title": "opencode",
  5. "version": "1.0.0",
  6. "description": "opencode api"
  7. },
  8. "paths": {
  9. "/auth/{providerID}": {
  10. "put": {
  11. "tags": ["control"],
  12. "operationId": "auth.set",
  13. "parameters": [
  14. {
  15. "name": "providerID",
  16. "in": "path",
  17. "schema": {
  18. "type": "string"
  19. },
  20. "required": true
  21. }
  22. ],
  23. "responses": {
  24. "200": {
  25. "description": "Successfully set authentication credentials",
  26. "content": {
  27. "application/json": {
  28. "schema": {
  29. "type": "boolean",
  30. "description": "Successfully set authentication credentials"
  31. }
  32. }
  33. }
  34. },
  35. "400": {
  36. "description": "Bad request",
  37. "content": {
  38. "application/json": {
  39. "schema": {
  40. "$ref": "#/components/schemas/BadRequestError"
  41. }
  42. }
  43. }
  44. }
  45. },
  46. "description": "Set authentication credentials",
  47. "summary": "Set auth credentials",
  48. "requestBody": {
  49. "content": {
  50. "application/json": {
  51. "schema": {
  52. "$ref": "#/components/schemas/Auth"
  53. }
  54. }
  55. }
  56. },
  57. "x-codeSamples": [
  58. {
  59. "lang": "js",
  60. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.auth.set({\n ...\n})"
  61. }
  62. ]
  63. },
  64. "delete": {
  65. "tags": ["control"],
  66. "operationId": "auth.remove",
  67. "parameters": [
  68. {
  69. "name": "providerID",
  70. "in": "path",
  71. "schema": {
  72. "type": "string"
  73. },
  74. "required": true
  75. }
  76. ],
  77. "responses": {
  78. "200": {
  79. "description": "Successfully removed authentication credentials",
  80. "content": {
  81. "application/json": {
  82. "schema": {
  83. "type": "boolean",
  84. "description": "Successfully removed authentication credentials"
  85. }
  86. }
  87. }
  88. },
  89. "400": {
  90. "description": "Bad request",
  91. "content": {
  92. "application/json": {
  93. "schema": {
  94. "$ref": "#/components/schemas/BadRequestError"
  95. }
  96. }
  97. }
  98. }
  99. },
  100. "description": "Remove authentication credentials",
  101. "summary": "Remove auth credentials",
  102. "x-codeSamples": [
  103. {
  104. "lang": "js",
  105. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.auth.remove({\n ...\n})"
  106. }
  107. ]
  108. }
  109. },
  110. "/log": {
  111. "post": {
  112. "tags": ["control"],
  113. "operationId": "app.log",
  114. "parameters": [
  115. {
  116. "name": "directory",
  117. "in": "query",
  118. "required": false,
  119. "schema": {
  120. "type": "string"
  121. }
  122. },
  123. {
  124. "name": "workspace",
  125. "in": "query",
  126. "required": false,
  127. "schema": {
  128. "type": "string"
  129. }
  130. }
  131. ],
  132. "responses": {
  133. "200": {
  134. "description": "Log entry written successfully",
  135. "content": {
  136. "application/json": {
  137. "schema": {
  138. "type": "boolean",
  139. "description": "Log entry written successfully"
  140. }
  141. }
  142. }
  143. },
  144. "400": {
  145. "description": "Bad request",
  146. "content": {
  147. "application/json": {
  148. "schema": {
  149. "$ref": "#/components/schemas/BadRequestError"
  150. }
  151. }
  152. }
  153. }
  154. },
  155. "description": "Write a log entry to the server logs with specified level and metadata.",
  156. "summary": "Write log",
  157. "requestBody": {
  158. "content": {
  159. "application/json": {
  160. "schema": {
  161. "type": "object",
  162. "properties": {
  163. "service": {
  164. "type": "string",
  165. "description": "Service name for the log entry"
  166. },
  167. "level": {
  168. "type": "string",
  169. "enum": ["debug", "info", "error", "warn"],
  170. "description": "Log level"
  171. },
  172. "message": {
  173. "type": "string",
  174. "description": "Log message"
  175. },
  176. "extra": {
  177. "type": "object"
  178. }
  179. },
  180. "required": ["service", "level", "message"],
  181. "additionalProperties": false
  182. }
  183. }
  184. }
  185. },
  186. "x-codeSamples": [
  187. {
  188. "lang": "js",
  189. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.app.log({\n ...\n})"
  190. }
  191. ]
  192. }
  193. },
  194. "/global/health": {
  195. "get": {
  196. "tags": ["global"],
  197. "operationId": "global.health",
  198. "parameters": [],
  199. "responses": {
  200. "200": {
  201. "description": "Health information",
  202. "content": {
  203. "application/json": {
  204. "schema": {
  205. "type": "object",
  206. "properties": {
  207. "healthy": {
  208. "type": "boolean",
  209. "enum": [true]
  210. },
  211. "version": {
  212. "type": "string"
  213. }
  214. },
  215. "required": ["healthy", "version"],
  216. "additionalProperties": false,
  217. "description": "Health information"
  218. }
  219. }
  220. }
  221. }
  222. },
  223. "description": "Get health information about the OpenCode server.",
  224. "summary": "Get health",
  225. "x-codeSamples": [
  226. {
  227. "lang": "js",
  228. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.health({\n ...\n})"
  229. }
  230. ]
  231. }
  232. },
  233. "/global/event": {
  234. "get": {
  235. "tags": ["global"],
  236. "operationId": "global.event",
  237. "parameters": [],
  238. "responses": {
  239. "200": {
  240. "description": "Event stream",
  241. "content": {
  242. "text/event-stream": {
  243. "schema": {
  244. "$ref": "#/components/schemas/GlobalEvent"
  245. }
  246. }
  247. }
  248. }
  249. },
  250. "description": "Subscribe to global events from the OpenCode system using server-sent events.",
  251. "summary": "Get global events",
  252. "x-codeSamples": [
  253. {
  254. "lang": "js",
  255. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.event({\n ...\n})"
  256. }
  257. ]
  258. }
  259. },
  260. "/global/config": {
  261. "get": {
  262. "tags": ["global"],
  263. "operationId": "global.config.get",
  264. "parameters": [],
  265. "responses": {
  266. "200": {
  267. "description": "Get global config info",
  268. "content": {
  269. "application/json": {
  270. "schema": {
  271. "$ref": "#/components/schemas/Config"
  272. }
  273. }
  274. }
  275. }
  276. },
  277. "description": "Retrieve the current global OpenCode configuration settings and preferences.",
  278. "summary": "Get global configuration",
  279. "x-codeSamples": [
  280. {
  281. "lang": "js",
  282. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.config.get({\n ...\n})"
  283. }
  284. ]
  285. },
  286. "patch": {
  287. "tags": ["global"],
  288. "operationId": "global.config.update",
  289. "parameters": [],
  290. "responses": {
  291. "200": {
  292. "description": "Successfully updated global config",
  293. "content": {
  294. "application/json": {
  295. "schema": {
  296. "$ref": "#/components/schemas/Config"
  297. }
  298. }
  299. }
  300. },
  301. "400": {
  302. "description": "Bad request",
  303. "content": {
  304. "application/json": {
  305. "schema": {
  306. "$ref": "#/components/schemas/BadRequestError"
  307. }
  308. }
  309. }
  310. }
  311. },
  312. "description": "Update global OpenCode configuration settings and preferences.",
  313. "summary": "Update global configuration",
  314. "requestBody": {
  315. "content": {
  316. "application/json": {
  317. "schema": {
  318. "$ref": "#/components/schemas/Config"
  319. }
  320. }
  321. }
  322. },
  323. "x-codeSamples": [
  324. {
  325. "lang": "js",
  326. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.config.update({\n ...\n})"
  327. }
  328. ]
  329. }
  330. },
  331. "/global/dispose": {
  332. "post": {
  333. "tags": ["global"],
  334. "operationId": "global.dispose",
  335. "parameters": [],
  336. "responses": {
  337. "200": {
  338. "description": "Global disposed",
  339. "content": {
  340. "application/json": {
  341. "schema": {
  342. "type": "boolean",
  343. "description": "Global disposed"
  344. }
  345. }
  346. }
  347. }
  348. },
  349. "description": "Clean up and dispose all OpenCode instances, releasing all resources.",
  350. "summary": "Dispose instance",
  351. "x-codeSamples": [
  352. {
  353. "lang": "js",
  354. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.dispose({\n ...\n})"
  355. }
  356. ]
  357. }
  358. },
  359. "/global/upgrade": {
  360. "post": {
  361. "tags": ["global"],
  362. "operationId": "global.upgrade",
  363. "parameters": [],
  364. "responses": {
  365. "200": {
  366. "description": "Upgrade result",
  367. "content": {
  368. "application/json": {
  369. "schema": {
  370. "anyOf": [
  371. {
  372. "type": "object",
  373. "properties": {
  374. "success": {
  375. "type": "boolean",
  376. "enum": [true]
  377. },
  378. "version": {
  379. "type": "string"
  380. }
  381. },
  382. "required": ["success", "version"],
  383. "additionalProperties": false
  384. },
  385. {
  386. "type": "object",
  387. "properties": {
  388. "success": {
  389. "type": "boolean",
  390. "enum": [false]
  391. },
  392. "error": {
  393. "type": "string"
  394. }
  395. },
  396. "required": ["success", "error"],
  397. "additionalProperties": false
  398. }
  399. ],
  400. "description": "Upgrade result"
  401. }
  402. }
  403. }
  404. },
  405. "400": {
  406. "description": "Bad request",
  407. "content": {
  408. "application/json": {
  409. "schema": {
  410. "$ref": "#/components/schemas/BadRequestError"
  411. }
  412. }
  413. }
  414. }
  415. },
  416. "description": "Upgrade opencode to the specified version or latest if not specified.",
  417. "summary": "Upgrade opencode",
  418. "requestBody": {
  419. "content": {
  420. "application/json": {
  421. "schema": {
  422. "type": "object",
  423. "properties": {
  424. "target": {
  425. "type": "string"
  426. }
  427. },
  428. "additionalProperties": false
  429. }
  430. }
  431. }
  432. },
  433. "x-codeSamples": [
  434. {
  435. "lang": "js",
  436. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.upgrade({\n ...\n})"
  437. }
  438. ]
  439. }
  440. },
  441. "/event": {
  442. "get": {
  443. "tags": ["event"],
  444. "operationId": "event.subscribe",
  445. "parameters": [
  446. {
  447. "name": "directory",
  448. "in": "query",
  449. "required": false,
  450. "schema": {
  451. "type": "string"
  452. }
  453. },
  454. {
  455. "name": "workspace",
  456. "in": "query",
  457. "required": false,
  458. "schema": {
  459. "type": "string"
  460. }
  461. }
  462. ],
  463. "responses": {
  464. "200": {
  465. "description": "Event stream",
  466. "content": {
  467. "text/event-stream": {
  468. "schema": {
  469. "$ref": "#/components/schemas/Event"
  470. }
  471. }
  472. }
  473. }
  474. },
  475. "description": "Get events",
  476. "summary": "Subscribe to events",
  477. "x-codeSamples": [
  478. {
  479. "lang": "js",
  480. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.event.subscribe({\n ...\n})"
  481. }
  482. ]
  483. }
  484. },
  485. "/config": {
  486. "get": {
  487. "tags": ["config"],
  488. "operationId": "config.get",
  489. "parameters": [
  490. {
  491. "name": "directory",
  492. "in": "query",
  493. "required": false,
  494. "schema": {
  495. "type": "string"
  496. }
  497. },
  498. {
  499. "name": "workspace",
  500. "in": "query",
  501. "required": false,
  502. "schema": {
  503. "type": "string"
  504. }
  505. }
  506. ],
  507. "responses": {
  508. "200": {
  509. "description": "Get config info",
  510. "content": {
  511. "application/json": {
  512. "schema": {
  513. "$ref": "#/components/schemas/Config"
  514. }
  515. }
  516. }
  517. }
  518. },
  519. "description": "Retrieve the current OpenCode configuration settings and preferences.",
  520. "summary": "Get configuration",
  521. "x-codeSamples": [
  522. {
  523. "lang": "js",
  524. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.config.get({\n ...\n})"
  525. }
  526. ]
  527. },
  528. "patch": {
  529. "tags": ["config"],
  530. "operationId": "config.update",
  531. "parameters": [
  532. {
  533. "name": "directory",
  534. "in": "query",
  535. "required": false,
  536. "schema": {
  537. "type": "string"
  538. }
  539. },
  540. {
  541. "name": "workspace",
  542. "in": "query",
  543. "required": false,
  544. "schema": {
  545. "type": "string"
  546. }
  547. }
  548. ],
  549. "responses": {
  550. "200": {
  551. "description": "Successfully updated config",
  552. "content": {
  553. "application/json": {
  554. "schema": {
  555. "$ref": "#/components/schemas/Config"
  556. }
  557. }
  558. }
  559. },
  560. "400": {
  561. "description": "Bad request",
  562. "content": {
  563. "application/json": {
  564. "schema": {
  565. "$ref": "#/components/schemas/BadRequestError"
  566. }
  567. }
  568. }
  569. }
  570. },
  571. "description": "Update OpenCode configuration settings and preferences.",
  572. "summary": "Update configuration",
  573. "requestBody": {
  574. "content": {
  575. "application/json": {
  576. "schema": {
  577. "$ref": "#/components/schemas/Config"
  578. }
  579. }
  580. }
  581. },
  582. "x-codeSamples": [
  583. {
  584. "lang": "js",
  585. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.config.update({\n ...\n})"
  586. }
  587. ]
  588. }
  589. },
  590. "/config/providers": {
  591. "get": {
  592. "tags": ["config"],
  593. "operationId": "config.providers",
  594. "parameters": [
  595. {
  596. "name": "directory",
  597. "in": "query",
  598. "required": false,
  599. "schema": {
  600. "type": "string"
  601. }
  602. },
  603. {
  604. "name": "workspace",
  605. "in": "query",
  606. "required": false,
  607. "schema": {
  608. "type": "string"
  609. }
  610. }
  611. ],
  612. "responses": {
  613. "200": {
  614. "description": "List of providers",
  615. "content": {
  616. "application/json": {
  617. "schema": {
  618. "type": "object",
  619. "properties": {
  620. "providers": {
  621. "type": "array",
  622. "items": {
  623. "$ref": "#/components/schemas/Provider"
  624. }
  625. },
  626. "default": {
  627. "type": "object",
  628. "additionalProperties": {
  629. "type": "string"
  630. }
  631. }
  632. },
  633. "required": ["providers", "default"],
  634. "additionalProperties": false,
  635. "description": "List of providers"
  636. }
  637. }
  638. }
  639. }
  640. },
  641. "description": "Get a list of all configured AI providers and their default models.",
  642. "summary": "List config providers",
  643. "x-codeSamples": [
  644. {
  645. "lang": "js",
  646. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.config.providers({\n ...\n})"
  647. }
  648. ]
  649. }
  650. },
  651. "/experimental/console": {
  652. "get": {
  653. "tags": ["experimental"],
  654. "operationId": "experimental.console.get",
  655. "parameters": [
  656. {
  657. "name": "directory",
  658. "in": "query",
  659. "required": false,
  660. "schema": {
  661. "type": "string"
  662. }
  663. },
  664. {
  665. "name": "workspace",
  666. "in": "query",
  667. "required": false,
  668. "schema": {
  669. "type": "string"
  670. }
  671. }
  672. ],
  673. "responses": {
  674. "200": {
  675. "description": "Active Console provider metadata",
  676. "content": {
  677. "application/json": {
  678. "schema": {
  679. "$ref": "#/components/schemas/ConsoleState"
  680. }
  681. }
  682. }
  683. }
  684. },
  685. "description": "Get the active Console org name and the set of provider IDs managed by that Console org.",
  686. "summary": "Get active Console provider metadata",
  687. "x-codeSamples": [
  688. {
  689. "lang": "js",
  690. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.console.get({\n ...\n})"
  691. }
  692. ]
  693. }
  694. },
  695. "/experimental/console/orgs": {
  696. "get": {
  697. "tags": ["experimental"],
  698. "operationId": "experimental.console.listOrgs",
  699. "parameters": [
  700. {
  701. "name": "directory",
  702. "in": "query",
  703. "required": false,
  704. "schema": {
  705. "type": "string"
  706. }
  707. },
  708. {
  709. "name": "workspace",
  710. "in": "query",
  711. "required": false,
  712. "schema": {
  713. "type": "string"
  714. }
  715. }
  716. ],
  717. "responses": {
  718. "200": {
  719. "description": "Switchable Console orgs",
  720. "content": {
  721. "application/json": {
  722. "schema": {
  723. "type": "object",
  724. "properties": {
  725. "orgs": {
  726. "type": "array",
  727. "items": {
  728. "type": "object",
  729. "properties": {
  730. "accountID": {
  731. "type": "string"
  732. },
  733. "accountEmail": {
  734. "type": "string"
  735. },
  736. "accountUrl": {
  737. "type": "string"
  738. },
  739. "orgID": {
  740. "type": "string"
  741. },
  742. "orgName": {
  743. "type": "string"
  744. },
  745. "active": {
  746. "type": "boolean"
  747. }
  748. },
  749. "required": ["accountID", "accountEmail", "accountUrl", "orgID", "orgName", "active"],
  750. "additionalProperties": false
  751. }
  752. }
  753. },
  754. "required": ["orgs"],
  755. "additionalProperties": false,
  756. "description": "Switchable Console orgs"
  757. }
  758. }
  759. }
  760. }
  761. },
  762. "description": "Get the available Console orgs across logged-in accounts, including the current active org.",
  763. "summary": "List switchable Console orgs",
  764. "x-codeSamples": [
  765. {
  766. "lang": "js",
  767. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.console.listOrgs({\n ...\n})"
  768. }
  769. ]
  770. }
  771. },
  772. "/experimental/console/switch": {
  773. "post": {
  774. "tags": ["experimental"],
  775. "operationId": "experimental.console.switchOrg",
  776. "parameters": [
  777. {
  778. "name": "directory",
  779. "in": "query",
  780. "required": false,
  781. "schema": {
  782. "type": "string"
  783. }
  784. },
  785. {
  786. "name": "workspace",
  787. "in": "query",
  788. "required": false,
  789. "schema": {
  790. "type": "string"
  791. }
  792. }
  793. ],
  794. "responses": {
  795. "200": {
  796. "description": "Switch success",
  797. "content": {
  798. "application/json": {
  799. "schema": {
  800. "type": "boolean",
  801. "description": "Switch success"
  802. }
  803. }
  804. }
  805. }
  806. },
  807. "description": "Persist a new active Console account/org selection for the current local OpenCode state.",
  808. "summary": "Switch active Console org",
  809. "requestBody": {
  810. "content": {
  811. "application/json": {
  812. "schema": {
  813. "type": "object",
  814. "properties": {
  815. "accountID": {
  816. "type": "string"
  817. },
  818. "orgID": {
  819. "type": "string"
  820. }
  821. },
  822. "required": ["accountID", "orgID"],
  823. "additionalProperties": false
  824. }
  825. }
  826. }
  827. },
  828. "x-codeSamples": [
  829. {
  830. "lang": "js",
  831. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.console.switchOrg({\n ...\n})"
  832. }
  833. ]
  834. }
  835. },
  836. "/experimental/tool": {
  837. "get": {
  838. "tags": ["experimental"],
  839. "operationId": "tool.list",
  840. "parameters": [
  841. {
  842. "name": "directory",
  843. "in": "query",
  844. "required": false,
  845. "schema": {
  846. "type": "string"
  847. }
  848. },
  849. {
  850. "name": "workspace",
  851. "in": "query",
  852. "required": false,
  853. "schema": {
  854. "type": "string"
  855. }
  856. },
  857. {
  858. "name": "provider",
  859. "in": "query",
  860. "schema": {
  861. "type": "string"
  862. },
  863. "required": true
  864. },
  865. {
  866. "name": "model",
  867. "in": "query",
  868. "schema": {
  869. "type": "string"
  870. },
  871. "required": true
  872. }
  873. ],
  874. "responses": {
  875. "200": {
  876. "description": "Tools",
  877. "content": {
  878. "application/json": {
  879. "schema": {
  880. "$ref": "#/components/schemas/ToolList"
  881. }
  882. }
  883. }
  884. },
  885. "400": {
  886. "description": "Bad request",
  887. "content": {
  888. "application/json": {
  889. "schema": {
  890. "$ref": "#/components/schemas/BadRequestError"
  891. }
  892. }
  893. }
  894. }
  895. },
  896. "description": "Get a list of available tools with their JSON schema parameters for a specific provider and model combination.",
  897. "summary": "List tools",
  898. "x-codeSamples": [
  899. {
  900. "lang": "js",
  901. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tool.list({\n ...\n})"
  902. }
  903. ]
  904. }
  905. },
  906. "/experimental/tool/ids": {
  907. "get": {
  908. "tags": ["experimental"],
  909. "operationId": "tool.ids",
  910. "parameters": [
  911. {
  912. "name": "directory",
  913. "in": "query",
  914. "required": false,
  915. "schema": {
  916. "type": "string"
  917. }
  918. },
  919. {
  920. "name": "workspace",
  921. "in": "query",
  922. "required": false,
  923. "schema": {
  924. "type": "string"
  925. }
  926. }
  927. ],
  928. "responses": {
  929. "200": {
  930. "description": "Tool IDs",
  931. "content": {
  932. "application/json": {
  933. "schema": {
  934. "$ref": "#/components/schemas/ToolIDs"
  935. }
  936. }
  937. }
  938. },
  939. "400": {
  940. "description": "Bad request",
  941. "content": {
  942. "application/json": {
  943. "schema": {
  944. "$ref": "#/components/schemas/BadRequestError"
  945. }
  946. }
  947. }
  948. }
  949. },
  950. "description": "Get a list of all available tool IDs, including both built-in tools and dynamically registered tools.",
  951. "summary": "List tool IDs",
  952. "x-codeSamples": [
  953. {
  954. "lang": "js",
  955. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tool.ids({\n ...\n})"
  956. }
  957. ]
  958. }
  959. },
  960. "/experimental/worktree": {
  961. "get": {
  962. "tags": ["experimental"],
  963. "operationId": "worktree.list",
  964. "parameters": [
  965. {
  966. "name": "directory",
  967. "in": "query",
  968. "required": false,
  969. "schema": {
  970. "type": "string"
  971. }
  972. },
  973. {
  974. "name": "workspace",
  975. "in": "query",
  976. "required": false,
  977. "schema": {
  978. "type": "string"
  979. }
  980. }
  981. ],
  982. "responses": {
  983. "200": {
  984. "description": "List of worktree directories",
  985. "content": {
  986. "application/json": {
  987. "schema": {
  988. "type": "array",
  989. "items": {
  990. "type": "string"
  991. },
  992. "description": "List of worktree directories"
  993. }
  994. }
  995. }
  996. }
  997. },
  998. "description": "List all sandbox worktrees for the current project.",
  999. "summary": "List worktrees",
  1000. "x-codeSamples": [
  1001. {
  1002. "lang": "js",
  1003. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.list({\n ...\n})"
  1004. }
  1005. ]
  1006. },
  1007. "post": {
  1008. "tags": ["experimental"],
  1009. "operationId": "worktree.create",
  1010. "parameters": [
  1011. {
  1012. "name": "directory",
  1013. "in": "query",
  1014. "required": false,
  1015. "schema": {
  1016. "type": "string"
  1017. }
  1018. },
  1019. {
  1020. "name": "workspace",
  1021. "in": "query",
  1022. "required": false,
  1023. "schema": {
  1024. "type": "string"
  1025. }
  1026. }
  1027. ],
  1028. "responses": {
  1029. "200": {
  1030. "description": "Worktree created",
  1031. "content": {
  1032. "application/json": {
  1033. "schema": {
  1034. "$ref": "#/components/schemas/Worktree"
  1035. }
  1036. }
  1037. }
  1038. },
  1039. "400": {
  1040. "description": "Bad request",
  1041. "content": {
  1042. "application/json": {
  1043. "schema": {
  1044. "$ref": "#/components/schemas/BadRequestError"
  1045. }
  1046. }
  1047. }
  1048. }
  1049. },
  1050. "description": "Create a new git worktree for the current project and run any configured startup scripts.",
  1051. "summary": "Create worktree",
  1052. "requestBody": {
  1053. "content": {
  1054. "application/json": {
  1055. "schema": {
  1056. "$ref": "#/components/schemas/WorktreeCreateInput"
  1057. }
  1058. }
  1059. }
  1060. },
  1061. "x-codeSamples": [
  1062. {
  1063. "lang": "js",
  1064. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.create({\n ...\n})"
  1065. }
  1066. ]
  1067. },
  1068. "delete": {
  1069. "tags": ["experimental"],
  1070. "operationId": "worktree.remove",
  1071. "parameters": [
  1072. {
  1073. "name": "directory",
  1074. "in": "query",
  1075. "required": false,
  1076. "schema": {
  1077. "type": "string"
  1078. }
  1079. },
  1080. {
  1081. "name": "workspace",
  1082. "in": "query",
  1083. "required": false,
  1084. "schema": {
  1085. "type": "string"
  1086. }
  1087. }
  1088. ],
  1089. "responses": {
  1090. "200": {
  1091. "description": "Worktree removed",
  1092. "content": {
  1093. "application/json": {
  1094. "schema": {
  1095. "type": "boolean",
  1096. "description": "Worktree removed"
  1097. }
  1098. }
  1099. }
  1100. },
  1101. "400": {
  1102. "description": "Bad request",
  1103. "content": {
  1104. "application/json": {
  1105. "schema": {
  1106. "$ref": "#/components/schemas/BadRequestError"
  1107. }
  1108. }
  1109. }
  1110. }
  1111. },
  1112. "description": "Remove a git worktree and delete its branch.",
  1113. "summary": "Remove worktree",
  1114. "requestBody": {
  1115. "content": {
  1116. "application/json": {
  1117. "schema": {
  1118. "$ref": "#/components/schemas/WorktreeRemoveInput"
  1119. }
  1120. }
  1121. }
  1122. },
  1123. "x-codeSamples": [
  1124. {
  1125. "lang": "js",
  1126. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.remove({\n ...\n})"
  1127. }
  1128. ]
  1129. }
  1130. },
  1131. "/experimental/worktree/reset": {
  1132. "post": {
  1133. "tags": ["experimental"],
  1134. "operationId": "worktree.reset",
  1135. "parameters": [
  1136. {
  1137. "name": "directory",
  1138. "in": "query",
  1139. "required": false,
  1140. "schema": {
  1141. "type": "string"
  1142. }
  1143. },
  1144. {
  1145. "name": "workspace",
  1146. "in": "query",
  1147. "required": false,
  1148. "schema": {
  1149. "type": "string"
  1150. }
  1151. }
  1152. ],
  1153. "responses": {
  1154. "200": {
  1155. "description": "Worktree reset",
  1156. "content": {
  1157. "application/json": {
  1158. "schema": {
  1159. "type": "boolean",
  1160. "description": "Worktree reset"
  1161. }
  1162. }
  1163. }
  1164. },
  1165. "400": {
  1166. "description": "Bad request",
  1167. "content": {
  1168. "application/json": {
  1169. "schema": {
  1170. "$ref": "#/components/schemas/BadRequestError"
  1171. }
  1172. }
  1173. }
  1174. }
  1175. },
  1176. "description": "Reset a worktree branch to the primary default branch.",
  1177. "summary": "Reset worktree",
  1178. "requestBody": {
  1179. "content": {
  1180. "application/json": {
  1181. "schema": {
  1182. "$ref": "#/components/schemas/WorktreeResetInput"
  1183. }
  1184. }
  1185. }
  1186. },
  1187. "x-codeSamples": [
  1188. {
  1189. "lang": "js",
  1190. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.reset({\n ...\n})"
  1191. }
  1192. ]
  1193. }
  1194. },
  1195. "/experimental/session": {
  1196. "get": {
  1197. "tags": ["experimental"],
  1198. "operationId": "experimental.session.list",
  1199. "parameters": [
  1200. {
  1201. "name": "directory",
  1202. "in": "query",
  1203. "required": false,
  1204. "schema": {
  1205. "type": "string"
  1206. }
  1207. },
  1208. {
  1209. "name": "workspace",
  1210. "in": "query",
  1211. "required": false,
  1212. "schema": {
  1213. "type": "string"
  1214. }
  1215. },
  1216. {
  1217. "name": "roots",
  1218. "in": "query",
  1219. "schema": {
  1220. "anyOf": [
  1221. {
  1222. "type": "boolean"
  1223. },
  1224. {
  1225. "type": "string",
  1226. "enum": ["true", "false"]
  1227. }
  1228. ]
  1229. },
  1230. "required": false
  1231. },
  1232. {
  1233. "name": "start",
  1234. "in": "query",
  1235. "schema": {
  1236. "type": "number"
  1237. },
  1238. "required": false
  1239. },
  1240. {
  1241. "name": "cursor",
  1242. "in": "query",
  1243. "schema": {
  1244. "type": "number"
  1245. },
  1246. "required": false
  1247. },
  1248. {
  1249. "name": "search",
  1250. "in": "query",
  1251. "schema": {
  1252. "type": "string"
  1253. },
  1254. "required": false
  1255. },
  1256. {
  1257. "name": "limit",
  1258. "in": "query",
  1259. "schema": {
  1260. "type": "number"
  1261. },
  1262. "required": false
  1263. },
  1264. {
  1265. "name": "archived",
  1266. "in": "query",
  1267. "schema": {
  1268. "anyOf": [
  1269. {
  1270. "type": "boolean"
  1271. },
  1272. {
  1273. "type": "string",
  1274. "enum": ["true", "false"]
  1275. }
  1276. ]
  1277. },
  1278. "required": false
  1279. }
  1280. ],
  1281. "responses": {
  1282. "200": {
  1283. "description": "List of sessions",
  1284. "content": {
  1285. "application/json": {
  1286. "schema": {
  1287. "type": "array",
  1288. "items": {
  1289. "$ref": "#/components/schemas/GlobalSession"
  1290. },
  1291. "description": "List of sessions"
  1292. }
  1293. }
  1294. }
  1295. }
  1296. },
  1297. "description": "Get a list of all OpenCode sessions across projects, sorted by most recently updated. Archived sessions are excluded by default.",
  1298. "summary": "List sessions",
  1299. "x-codeSamples": [
  1300. {
  1301. "lang": "js",
  1302. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.session.list({\n ...\n})"
  1303. }
  1304. ]
  1305. }
  1306. },
  1307. "/experimental/resource": {
  1308. "get": {
  1309. "tags": ["experimental"],
  1310. "operationId": "experimental.resource.list",
  1311. "parameters": [
  1312. {
  1313. "name": "directory",
  1314. "in": "query",
  1315. "required": false,
  1316. "schema": {
  1317. "type": "string"
  1318. }
  1319. },
  1320. {
  1321. "name": "workspace",
  1322. "in": "query",
  1323. "required": false,
  1324. "schema": {
  1325. "type": "string"
  1326. }
  1327. }
  1328. ],
  1329. "responses": {
  1330. "200": {
  1331. "description": "MCP resources",
  1332. "content": {
  1333. "application/json": {
  1334. "schema": {
  1335. "type": "object",
  1336. "additionalProperties": {
  1337. "$ref": "#/components/schemas/McpResource"
  1338. },
  1339. "description": "MCP resources"
  1340. }
  1341. }
  1342. }
  1343. }
  1344. },
  1345. "description": "Get all available MCP resources from connected servers. Optionally filter by name.",
  1346. "summary": "Get MCP resources",
  1347. "x-codeSamples": [
  1348. {
  1349. "lang": "js",
  1350. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.resource.list({\n ...\n})"
  1351. }
  1352. ]
  1353. }
  1354. },
  1355. "/find": {
  1356. "get": {
  1357. "tags": ["file"],
  1358. "operationId": "find.text",
  1359. "parameters": [
  1360. {
  1361. "name": "directory",
  1362. "in": "query",
  1363. "required": false,
  1364. "schema": {
  1365. "type": "string"
  1366. }
  1367. },
  1368. {
  1369. "name": "workspace",
  1370. "in": "query",
  1371. "required": false,
  1372. "schema": {
  1373. "type": "string"
  1374. }
  1375. },
  1376. {
  1377. "name": "pattern",
  1378. "in": "query",
  1379. "schema": {
  1380. "type": "string"
  1381. },
  1382. "required": true
  1383. }
  1384. ],
  1385. "responses": {
  1386. "200": {
  1387. "description": "Matches",
  1388. "content": {
  1389. "application/json": {
  1390. "schema": {
  1391. "type": "array",
  1392. "items": {
  1393. "type": "object",
  1394. "properties": {
  1395. "path": {
  1396. "type": "object",
  1397. "properties": {
  1398. "text": {
  1399. "type": "string"
  1400. }
  1401. },
  1402. "required": ["text"],
  1403. "additionalProperties": false
  1404. },
  1405. "lines": {
  1406. "type": "object",
  1407. "properties": {
  1408. "text": {
  1409. "type": "string"
  1410. }
  1411. },
  1412. "required": ["text"],
  1413. "additionalProperties": false
  1414. },
  1415. "line_number": {
  1416. "type": "integer",
  1417. "minimum": 0
  1418. },
  1419. "absolute_offset": {
  1420. "type": "integer",
  1421. "minimum": 0
  1422. },
  1423. "submatches": {
  1424. "type": "array",
  1425. "items": {
  1426. "type": "object",
  1427. "properties": {
  1428. "match": {
  1429. "type": "object",
  1430. "properties": {
  1431. "text": {
  1432. "type": "string"
  1433. }
  1434. },
  1435. "required": ["text"],
  1436. "additionalProperties": false
  1437. },
  1438. "start": {
  1439. "type": "integer",
  1440. "minimum": 0
  1441. },
  1442. "end": {
  1443. "type": "integer",
  1444. "minimum": 0
  1445. }
  1446. },
  1447. "required": ["match", "start", "end"],
  1448. "additionalProperties": false
  1449. }
  1450. }
  1451. },
  1452. "required": ["path", "lines", "line_number", "absolute_offset", "submatches"],
  1453. "additionalProperties": false
  1454. },
  1455. "description": "Matches"
  1456. }
  1457. }
  1458. }
  1459. }
  1460. },
  1461. "description": "Search for text patterns across files in the project using ripgrep.",
  1462. "summary": "Find text",
  1463. "x-codeSamples": [
  1464. {
  1465. "lang": "js",
  1466. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.find.text({\n ...\n})"
  1467. }
  1468. ]
  1469. }
  1470. },
  1471. "/find/file": {
  1472. "get": {
  1473. "tags": ["file"],
  1474. "operationId": "find.files",
  1475. "parameters": [
  1476. {
  1477. "name": "directory",
  1478. "in": "query",
  1479. "required": false,
  1480. "schema": {
  1481. "type": "string"
  1482. }
  1483. },
  1484. {
  1485. "name": "workspace",
  1486. "in": "query",
  1487. "required": false,
  1488. "schema": {
  1489. "type": "string"
  1490. }
  1491. },
  1492. {
  1493. "name": "query",
  1494. "in": "query",
  1495. "schema": {
  1496. "type": "string"
  1497. },
  1498. "required": true
  1499. },
  1500. {
  1501. "name": "dirs",
  1502. "in": "query",
  1503. "schema": {
  1504. "type": "string",
  1505. "enum": ["true", "false"]
  1506. },
  1507. "required": false
  1508. },
  1509. {
  1510. "name": "type",
  1511. "in": "query",
  1512. "schema": {
  1513. "type": "string",
  1514. "enum": ["file", "directory"]
  1515. },
  1516. "required": false
  1517. },
  1518. {
  1519. "name": "limit",
  1520. "in": "query",
  1521. "schema": {
  1522. "type": "integer",
  1523. "minimum": 1,
  1524. "maximum": 200
  1525. },
  1526. "required": false
  1527. }
  1528. ],
  1529. "responses": {
  1530. "200": {
  1531. "description": "File paths",
  1532. "content": {
  1533. "application/json": {
  1534. "schema": {
  1535. "type": "array",
  1536. "items": {
  1537. "type": "string"
  1538. },
  1539. "description": "File paths"
  1540. }
  1541. }
  1542. }
  1543. }
  1544. },
  1545. "description": "Search for files or directories by name or pattern in the project directory.",
  1546. "summary": "Find files",
  1547. "x-codeSamples": [
  1548. {
  1549. "lang": "js",
  1550. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.find.files({\n ...\n})"
  1551. }
  1552. ]
  1553. }
  1554. },
  1555. "/find/symbol": {
  1556. "get": {
  1557. "tags": ["file"],
  1558. "operationId": "find.symbols",
  1559. "parameters": [
  1560. {
  1561. "name": "directory",
  1562. "in": "query",
  1563. "required": false,
  1564. "schema": {
  1565. "type": "string"
  1566. }
  1567. },
  1568. {
  1569. "name": "workspace",
  1570. "in": "query",
  1571. "required": false,
  1572. "schema": {
  1573. "type": "string"
  1574. }
  1575. },
  1576. {
  1577. "name": "query",
  1578. "in": "query",
  1579. "schema": {
  1580. "type": "string"
  1581. },
  1582. "required": true
  1583. }
  1584. ],
  1585. "responses": {
  1586. "200": {
  1587. "description": "Symbols",
  1588. "content": {
  1589. "application/json": {
  1590. "schema": {
  1591. "type": "array",
  1592. "items": {
  1593. "$ref": "#/components/schemas/Symbol"
  1594. },
  1595. "description": "Symbols"
  1596. }
  1597. }
  1598. }
  1599. }
  1600. },
  1601. "description": "Search for workspace symbols like functions, classes, and variables using LSP.",
  1602. "summary": "Find symbols",
  1603. "x-codeSamples": [
  1604. {
  1605. "lang": "js",
  1606. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.find.symbols({\n ...\n})"
  1607. }
  1608. ]
  1609. }
  1610. },
  1611. "/file": {
  1612. "get": {
  1613. "tags": ["file"],
  1614. "operationId": "file.list",
  1615. "parameters": [
  1616. {
  1617. "name": "directory",
  1618. "in": "query",
  1619. "required": false,
  1620. "schema": {
  1621. "type": "string"
  1622. }
  1623. },
  1624. {
  1625. "name": "workspace",
  1626. "in": "query",
  1627. "required": false,
  1628. "schema": {
  1629. "type": "string"
  1630. }
  1631. },
  1632. {
  1633. "name": "path",
  1634. "in": "query",
  1635. "schema": {
  1636. "type": "string"
  1637. },
  1638. "required": true
  1639. }
  1640. ],
  1641. "responses": {
  1642. "200": {
  1643. "description": "Files and directories",
  1644. "content": {
  1645. "application/json": {
  1646. "schema": {
  1647. "type": "array",
  1648. "items": {
  1649. "$ref": "#/components/schemas/FileNode"
  1650. },
  1651. "description": "Files and directories"
  1652. }
  1653. }
  1654. }
  1655. }
  1656. },
  1657. "description": "List files and directories in a specified path.",
  1658. "summary": "List files",
  1659. "x-codeSamples": [
  1660. {
  1661. "lang": "js",
  1662. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.file.list({\n ...\n})"
  1663. }
  1664. ]
  1665. }
  1666. },
  1667. "/file/content": {
  1668. "get": {
  1669. "tags": ["file"],
  1670. "operationId": "file.read",
  1671. "parameters": [
  1672. {
  1673. "name": "directory",
  1674. "in": "query",
  1675. "required": false,
  1676. "schema": {
  1677. "type": "string"
  1678. }
  1679. },
  1680. {
  1681. "name": "workspace",
  1682. "in": "query",
  1683. "required": false,
  1684. "schema": {
  1685. "type": "string"
  1686. }
  1687. },
  1688. {
  1689. "name": "path",
  1690. "in": "query",
  1691. "schema": {
  1692. "type": "string"
  1693. },
  1694. "required": true
  1695. }
  1696. ],
  1697. "responses": {
  1698. "200": {
  1699. "description": "File content",
  1700. "content": {
  1701. "application/json": {
  1702. "schema": {
  1703. "$ref": "#/components/schemas/FileContent"
  1704. }
  1705. }
  1706. }
  1707. }
  1708. },
  1709. "description": "Read the content of a specified file.",
  1710. "summary": "Read file",
  1711. "x-codeSamples": [
  1712. {
  1713. "lang": "js",
  1714. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.file.read({\n ...\n})"
  1715. }
  1716. ]
  1717. }
  1718. },
  1719. "/file/status": {
  1720. "get": {
  1721. "tags": ["file"],
  1722. "operationId": "file.status",
  1723. "parameters": [
  1724. {
  1725. "name": "directory",
  1726. "in": "query",
  1727. "required": false,
  1728. "schema": {
  1729. "type": "string"
  1730. }
  1731. },
  1732. {
  1733. "name": "workspace",
  1734. "in": "query",
  1735. "required": false,
  1736. "schema": {
  1737. "type": "string"
  1738. }
  1739. }
  1740. ],
  1741. "responses": {
  1742. "200": {
  1743. "description": "File status",
  1744. "content": {
  1745. "application/json": {
  1746. "schema": {
  1747. "type": "array",
  1748. "items": {
  1749. "$ref": "#/components/schemas/File"
  1750. },
  1751. "description": "File status"
  1752. }
  1753. }
  1754. }
  1755. }
  1756. },
  1757. "description": "Get the git status of all files in the project.",
  1758. "summary": "Get file status",
  1759. "x-codeSamples": [
  1760. {
  1761. "lang": "js",
  1762. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.file.status({\n ...\n})"
  1763. }
  1764. ]
  1765. }
  1766. },
  1767. "/instance/dispose": {
  1768. "post": {
  1769. "tags": ["instance"],
  1770. "operationId": "instance.dispose",
  1771. "parameters": [
  1772. {
  1773. "name": "directory",
  1774. "in": "query",
  1775. "required": false,
  1776. "schema": {
  1777. "type": "string"
  1778. }
  1779. },
  1780. {
  1781. "name": "workspace",
  1782. "in": "query",
  1783. "required": false,
  1784. "schema": {
  1785. "type": "string"
  1786. }
  1787. }
  1788. ],
  1789. "responses": {
  1790. "200": {
  1791. "description": "Instance disposed",
  1792. "content": {
  1793. "application/json": {
  1794. "schema": {
  1795. "type": "boolean",
  1796. "description": "Instance disposed"
  1797. }
  1798. }
  1799. }
  1800. }
  1801. },
  1802. "description": "Clean up and dispose the current OpenCode instance, releasing all resources.",
  1803. "summary": "Dispose instance",
  1804. "x-codeSamples": [
  1805. {
  1806. "lang": "js",
  1807. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.instance.dispose({\n ...\n})"
  1808. }
  1809. ]
  1810. }
  1811. },
  1812. "/path": {
  1813. "get": {
  1814. "tags": ["instance"],
  1815. "operationId": "path.get",
  1816. "parameters": [
  1817. {
  1818. "name": "directory",
  1819. "in": "query",
  1820. "required": false,
  1821. "schema": {
  1822. "type": "string"
  1823. }
  1824. },
  1825. {
  1826. "name": "workspace",
  1827. "in": "query",
  1828. "required": false,
  1829. "schema": {
  1830. "type": "string"
  1831. }
  1832. }
  1833. ],
  1834. "responses": {
  1835. "200": {
  1836. "description": "Path",
  1837. "content": {
  1838. "application/json": {
  1839. "schema": {
  1840. "$ref": "#/components/schemas/Path"
  1841. }
  1842. }
  1843. }
  1844. }
  1845. },
  1846. "description": "Retrieve the current working directory and related path information for the OpenCode instance.",
  1847. "summary": "Get paths",
  1848. "x-codeSamples": [
  1849. {
  1850. "lang": "js",
  1851. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.path.get({\n ...\n})"
  1852. }
  1853. ]
  1854. }
  1855. },
  1856. "/vcs": {
  1857. "get": {
  1858. "tags": ["instance"],
  1859. "operationId": "vcs.get",
  1860. "parameters": [
  1861. {
  1862. "name": "directory",
  1863. "in": "query",
  1864. "required": false,
  1865. "schema": {
  1866. "type": "string"
  1867. }
  1868. },
  1869. {
  1870. "name": "workspace",
  1871. "in": "query",
  1872. "required": false,
  1873. "schema": {
  1874. "type": "string"
  1875. }
  1876. }
  1877. ],
  1878. "responses": {
  1879. "200": {
  1880. "description": "VCS info",
  1881. "content": {
  1882. "application/json": {
  1883. "schema": {
  1884. "$ref": "#/components/schemas/VcsInfo"
  1885. }
  1886. }
  1887. }
  1888. }
  1889. },
  1890. "description": "Retrieve version control system (VCS) information for the current project, such as git branch.",
  1891. "summary": "Get VCS info",
  1892. "x-codeSamples": [
  1893. {
  1894. "lang": "js",
  1895. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.vcs.get({\n ...\n})"
  1896. }
  1897. ]
  1898. }
  1899. },
  1900. "/vcs/status": {
  1901. "get": {
  1902. "tags": ["instance"],
  1903. "operationId": "vcs.status",
  1904. "parameters": [
  1905. {
  1906. "name": "directory",
  1907. "in": "query",
  1908. "required": false,
  1909. "schema": {
  1910. "type": "string"
  1911. }
  1912. },
  1913. {
  1914. "name": "workspace",
  1915. "in": "query",
  1916. "required": false,
  1917. "schema": {
  1918. "type": "string"
  1919. }
  1920. }
  1921. ],
  1922. "responses": {
  1923. "200": {
  1924. "description": "VCS status",
  1925. "content": {
  1926. "application/json": {
  1927. "schema": {
  1928. "type": "array",
  1929. "items": {
  1930. "$ref": "#/components/schemas/VcsFileStatus"
  1931. },
  1932. "description": "VCS status"
  1933. }
  1934. }
  1935. }
  1936. }
  1937. },
  1938. "description": "Retrieve changed files in the current working tree without patches.",
  1939. "summary": "Get VCS status",
  1940. "x-codeSamples": [
  1941. {
  1942. "lang": "js",
  1943. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.vcs.status({\n ...\n})"
  1944. }
  1945. ]
  1946. }
  1947. },
  1948. "/vcs/diff": {
  1949. "get": {
  1950. "tags": ["instance"],
  1951. "operationId": "vcs.diff",
  1952. "parameters": [
  1953. {
  1954. "name": "directory",
  1955. "in": "query",
  1956. "required": false,
  1957. "schema": {
  1958. "type": "string"
  1959. }
  1960. },
  1961. {
  1962. "name": "workspace",
  1963. "in": "query",
  1964. "required": false,
  1965. "schema": {
  1966. "type": "string"
  1967. }
  1968. },
  1969. {
  1970. "name": "mode",
  1971. "in": "query",
  1972. "schema": {
  1973. "type": "string",
  1974. "enum": ["git", "branch"]
  1975. },
  1976. "required": true
  1977. }
  1978. ],
  1979. "responses": {
  1980. "200": {
  1981. "description": "VCS diff",
  1982. "content": {
  1983. "application/json": {
  1984. "schema": {
  1985. "type": "array",
  1986. "items": {
  1987. "$ref": "#/components/schemas/VcsFileDiff"
  1988. },
  1989. "description": "VCS diff"
  1990. }
  1991. }
  1992. }
  1993. }
  1994. },
  1995. "description": "Retrieve the current git diff for the working tree or against the default branch.",
  1996. "summary": "Get VCS diff",
  1997. "x-codeSamples": [
  1998. {
  1999. "lang": "js",
  2000. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.vcs.diff({\n ...\n})"
  2001. }
  2002. ]
  2003. }
  2004. },
  2005. "/vcs/diff/raw": {
  2006. "get": {
  2007. "tags": ["instance"],
  2008. "operationId": "vcs.diff.raw",
  2009. "parameters": [
  2010. {
  2011. "name": "directory",
  2012. "in": "query",
  2013. "required": false,
  2014. "schema": {
  2015. "type": "string"
  2016. }
  2017. },
  2018. {
  2019. "name": "workspace",
  2020. "in": "query",
  2021. "required": false,
  2022. "schema": {
  2023. "type": "string"
  2024. }
  2025. }
  2026. ],
  2027. "responses": {
  2028. "200": {
  2029. "description": "Raw VCS diff",
  2030. "content": {
  2031. "text/x-diff; charset=utf-8": {
  2032. "schema": {
  2033. "type": "string"
  2034. }
  2035. }
  2036. }
  2037. }
  2038. },
  2039. "description": "Retrieve a raw patch for current uncommitted changes.",
  2040. "summary": "Get raw VCS diff",
  2041. "x-codeSamples": [
  2042. {
  2043. "lang": "js",
  2044. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.vcs.diff.raw({\n ...\n})"
  2045. }
  2046. ]
  2047. }
  2048. },
  2049. "/vcs/apply": {
  2050. "post": {
  2051. "tags": ["instance"],
  2052. "operationId": "vcs.apply",
  2053. "parameters": [
  2054. {
  2055. "name": "directory",
  2056. "in": "query",
  2057. "required": false,
  2058. "schema": {
  2059. "type": "string"
  2060. }
  2061. },
  2062. {
  2063. "name": "workspace",
  2064. "in": "query",
  2065. "required": false,
  2066. "schema": {
  2067. "type": "string"
  2068. }
  2069. }
  2070. ],
  2071. "responses": {
  2072. "200": {
  2073. "description": "VCS patch applied",
  2074. "content": {
  2075. "application/json": {
  2076. "schema": {
  2077. "type": "object",
  2078. "properties": {
  2079. "applied": {
  2080. "type": "boolean"
  2081. }
  2082. },
  2083. "required": ["applied"],
  2084. "additionalProperties": false,
  2085. "description": "VCS patch applied"
  2086. }
  2087. }
  2088. }
  2089. },
  2090. "400": {
  2091. "description": "VcsApplyError",
  2092. "content": {
  2093. "application/json": {
  2094. "schema": {
  2095. "$ref": "#/components/schemas/VcsApplyError"
  2096. }
  2097. }
  2098. }
  2099. }
  2100. },
  2101. "description": "Apply a raw patch to the current working tree.",
  2102. "summary": "Apply VCS patch",
  2103. "requestBody": {
  2104. "content": {
  2105. "application/json": {
  2106. "schema": {
  2107. "type": "object",
  2108. "properties": {
  2109. "patch": {
  2110. "type": "string"
  2111. }
  2112. },
  2113. "required": ["patch"],
  2114. "additionalProperties": false
  2115. }
  2116. }
  2117. }
  2118. },
  2119. "x-codeSamples": [
  2120. {
  2121. "lang": "js",
  2122. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.vcs.apply({\n ...\n})"
  2123. }
  2124. ]
  2125. }
  2126. },
  2127. "/command": {
  2128. "get": {
  2129. "tags": ["instance"],
  2130. "operationId": "command.list",
  2131. "parameters": [
  2132. {
  2133. "name": "directory",
  2134. "in": "query",
  2135. "required": false,
  2136. "schema": {
  2137. "type": "string"
  2138. }
  2139. },
  2140. {
  2141. "name": "workspace",
  2142. "in": "query",
  2143. "required": false,
  2144. "schema": {
  2145. "type": "string"
  2146. }
  2147. }
  2148. ],
  2149. "responses": {
  2150. "200": {
  2151. "description": "List of commands",
  2152. "content": {
  2153. "application/json": {
  2154. "schema": {
  2155. "type": "array",
  2156. "items": {
  2157. "$ref": "#/components/schemas/Command"
  2158. },
  2159. "description": "List of commands"
  2160. }
  2161. }
  2162. }
  2163. }
  2164. },
  2165. "description": "Get a list of all available commands in the OpenCode system.",
  2166. "summary": "List commands",
  2167. "x-codeSamples": [
  2168. {
  2169. "lang": "js",
  2170. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.command.list({\n ...\n})"
  2171. }
  2172. ]
  2173. }
  2174. },
  2175. "/agent": {
  2176. "get": {
  2177. "tags": ["instance"],
  2178. "operationId": "app.agents",
  2179. "parameters": [
  2180. {
  2181. "name": "directory",
  2182. "in": "query",
  2183. "required": false,
  2184. "schema": {
  2185. "type": "string"
  2186. }
  2187. },
  2188. {
  2189. "name": "workspace",
  2190. "in": "query",
  2191. "required": false,
  2192. "schema": {
  2193. "type": "string"
  2194. }
  2195. }
  2196. ],
  2197. "responses": {
  2198. "200": {
  2199. "description": "List of agents",
  2200. "content": {
  2201. "application/json": {
  2202. "schema": {
  2203. "type": "array",
  2204. "items": {
  2205. "$ref": "#/components/schemas/Agent"
  2206. },
  2207. "description": "List of agents"
  2208. }
  2209. }
  2210. }
  2211. }
  2212. },
  2213. "description": "Get a list of all available AI agents in the OpenCode system.",
  2214. "summary": "List agents",
  2215. "x-codeSamples": [
  2216. {
  2217. "lang": "js",
  2218. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.app.agents({\n ...\n})"
  2219. }
  2220. ]
  2221. }
  2222. },
  2223. "/skill": {
  2224. "get": {
  2225. "tags": ["instance"],
  2226. "operationId": "app.skills",
  2227. "parameters": [
  2228. {
  2229. "name": "directory",
  2230. "in": "query",
  2231. "required": false,
  2232. "schema": {
  2233. "type": "string"
  2234. }
  2235. },
  2236. {
  2237. "name": "workspace",
  2238. "in": "query",
  2239. "required": false,
  2240. "schema": {
  2241. "type": "string"
  2242. }
  2243. }
  2244. ],
  2245. "responses": {
  2246. "200": {
  2247. "description": "List of skills",
  2248. "content": {
  2249. "application/json": {
  2250. "schema": {
  2251. "type": "array",
  2252. "items": {
  2253. "type": "object",
  2254. "properties": {
  2255. "name": {
  2256. "type": "string"
  2257. },
  2258. "description": {
  2259. "type": "string"
  2260. },
  2261. "location": {
  2262. "type": "string"
  2263. },
  2264. "content": {
  2265. "type": "string"
  2266. }
  2267. },
  2268. "required": ["name", "location", "content"],
  2269. "additionalProperties": false
  2270. },
  2271. "description": "List of skills"
  2272. }
  2273. }
  2274. }
  2275. }
  2276. },
  2277. "description": "Get a list of all available skills in the OpenCode system.",
  2278. "summary": "List skills",
  2279. "x-codeSamples": [
  2280. {
  2281. "lang": "js",
  2282. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.app.skills({\n ...\n})"
  2283. }
  2284. ]
  2285. }
  2286. },
  2287. "/lsp": {
  2288. "get": {
  2289. "tags": ["instance"],
  2290. "operationId": "lsp.status",
  2291. "parameters": [
  2292. {
  2293. "name": "directory",
  2294. "in": "query",
  2295. "required": false,
  2296. "schema": {
  2297. "type": "string"
  2298. }
  2299. },
  2300. {
  2301. "name": "workspace",
  2302. "in": "query",
  2303. "required": false,
  2304. "schema": {
  2305. "type": "string"
  2306. }
  2307. }
  2308. ],
  2309. "responses": {
  2310. "200": {
  2311. "description": "LSP server status",
  2312. "content": {
  2313. "application/json": {
  2314. "schema": {
  2315. "type": "array",
  2316. "items": {
  2317. "$ref": "#/components/schemas/LSPStatus"
  2318. },
  2319. "description": "LSP server status"
  2320. }
  2321. }
  2322. }
  2323. }
  2324. },
  2325. "description": "Get LSP server status",
  2326. "summary": "Get LSP status",
  2327. "x-codeSamples": [
  2328. {
  2329. "lang": "js",
  2330. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.lsp.status({\n ...\n})"
  2331. }
  2332. ]
  2333. }
  2334. },
  2335. "/formatter": {
  2336. "get": {
  2337. "tags": ["instance"],
  2338. "operationId": "formatter.status",
  2339. "parameters": [
  2340. {
  2341. "name": "directory",
  2342. "in": "query",
  2343. "required": false,
  2344. "schema": {
  2345. "type": "string"
  2346. }
  2347. },
  2348. {
  2349. "name": "workspace",
  2350. "in": "query",
  2351. "required": false,
  2352. "schema": {
  2353. "type": "string"
  2354. }
  2355. }
  2356. ],
  2357. "responses": {
  2358. "200": {
  2359. "description": "Formatter status",
  2360. "content": {
  2361. "application/json": {
  2362. "schema": {
  2363. "type": "array",
  2364. "items": {
  2365. "$ref": "#/components/schemas/FormatterStatus"
  2366. },
  2367. "description": "Formatter status"
  2368. }
  2369. }
  2370. }
  2371. }
  2372. },
  2373. "description": "Get formatter status",
  2374. "summary": "Get formatter status",
  2375. "x-codeSamples": [
  2376. {
  2377. "lang": "js",
  2378. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.formatter.status({\n ...\n})"
  2379. }
  2380. ]
  2381. }
  2382. },
  2383. "/mcp": {
  2384. "get": {
  2385. "tags": ["mcp"],
  2386. "operationId": "mcp.status",
  2387. "parameters": [
  2388. {
  2389. "name": "directory",
  2390. "in": "query",
  2391. "required": false,
  2392. "schema": {
  2393. "type": "string"
  2394. }
  2395. },
  2396. {
  2397. "name": "workspace",
  2398. "in": "query",
  2399. "required": false,
  2400. "schema": {
  2401. "type": "string"
  2402. }
  2403. }
  2404. ],
  2405. "responses": {
  2406. "200": {
  2407. "description": "MCP server status",
  2408. "content": {
  2409. "application/json": {
  2410. "schema": {
  2411. "type": "object",
  2412. "additionalProperties": {
  2413. "$ref": "#/components/schemas/MCPStatus"
  2414. },
  2415. "description": "MCP server status"
  2416. }
  2417. }
  2418. }
  2419. }
  2420. },
  2421. "description": "Get the status of all Model Context Protocol (MCP) servers.",
  2422. "summary": "Get MCP status",
  2423. "x-codeSamples": [
  2424. {
  2425. "lang": "js",
  2426. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.status({\n ...\n})"
  2427. }
  2428. ]
  2429. },
  2430. "post": {
  2431. "tags": ["mcp"],
  2432. "operationId": "mcp.add",
  2433. "parameters": [
  2434. {
  2435. "name": "directory",
  2436. "in": "query",
  2437. "required": false,
  2438. "schema": {
  2439. "type": "string"
  2440. }
  2441. },
  2442. {
  2443. "name": "workspace",
  2444. "in": "query",
  2445. "required": false,
  2446. "schema": {
  2447. "type": "string"
  2448. }
  2449. }
  2450. ],
  2451. "responses": {
  2452. "200": {
  2453. "description": "MCP server added successfully",
  2454. "content": {
  2455. "application/json": {
  2456. "schema": {
  2457. "type": "object",
  2458. "additionalProperties": {
  2459. "$ref": "#/components/schemas/MCPStatus"
  2460. },
  2461. "description": "MCP server added successfully"
  2462. }
  2463. }
  2464. }
  2465. },
  2466. "400": {
  2467. "description": "Bad request",
  2468. "content": {
  2469. "application/json": {
  2470. "schema": {
  2471. "$ref": "#/components/schemas/BadRequestError"
  2472. }
  2473. }
  2474. }
  2475. }
  2476. },
  2477. "description": "Dynamically add a new Model Context Protocol (MCP) server to the system.",
  2478. "summary": "Add MCP server",
  2479. "requestBody": {
  2480. "content": {
  2481. "application/json": {
  2482. "schema": {
  2483. "type": "object",
  2484. "properties": {
  2485. "name": {
  2486. "type": "string"
  2487. },
  2488. "config": {
  2489. "anyOf": [
  2490. {
  2491. "$ref": "#/components/schemas/McpLocalConfig"
  2492. },
  2493. {
  2494. "$ref": "#/components/schemas/McpRemoteConfig"
  2495. }
  2496. ]
  2497. }
  2498. },
  2499. "required": ["name", "config"],
  2500. "additionalProperties": false
  2501. }
  2502. }
  2503. }
  2504. },
  2505. "x-codeSamples": [
  2506. {
  2507. "lang": "js",
  2508. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.add({\n ...\n})"
  2509. }
  2510. ]
  2511. }
  2512. },
  2513. "/mcp/{name}/auth": {
  2514. "post": {
  2515. "tags": ["mcp"],
  2516. "operationId": "mcp.auth.start",
  2517. "parameters": [
  2518. {
  2519. "name": "directory",
  2520. "in": "query",
  2521. "required": false,
  2522. "schema": {
  2523. "type": "string"
  2524. }
  2525. },
  2526. {
  2527. "name": "workspace",
  2528. "in": "query",
  2529. "required": false,
  2530. "schema": {
  2531. "type": "string"
  2532. }
  2533. },
  2534. {
  2535. "name": "name",
  2536. "in": "path",
  2537. "schema": {
  2538. "type": "string"
  2539. },
  2540. "required": true
  2541. }
  2542. ],
  2543. "responses": {
  2544. "200": {
  2545. "description": "OAuth flow started",
  2546. "content": {
  2547. "application/json": {
  2548. "schema": {
  2549. "type": "object",
  2550. "properties": {
  2551. "authorizationUrl": {
  2552. "type": "string"
  2553. },
  2554. "oauthState": {
  2555. "type": "string"
  2556. }
  2557. },
  2558. "required": ["authorizationUrl", "oauthState"],
  2559. "additionalProperties": false,
  2560. "description": "OAuth flow started"
  2561. }
  2562. }
  2563. }
  2564. },
  2565. "400": {
  2566. "description": "McpUnsupportedOAuthError",
  2567. "content": {
  2568. "application/json": {
  2569. "schema": {
  2570. "$ref": "#/components/schemas/McpUnsupportedOAuthError"
  2571. }
  2572. }
  2573. }
  2574. },
  2575. "404": {
  2576. "description": "Not found",
  2577. "content": {
  2578. "application/json": {
  2579. "schema": {
  2580. "$ref": "#/components/schemas/NotFoundError"
  2581. }
  2582. }
  2583. }
  2584. }
  2585. },
  2586. "description": "Start OAuth authentication flow for a Model Context Protocol (MCP) server.",
  2587. "summary": "Start MCP OAuth",
  2588. "x-codeSamples": [
  2589. {
  2590. "lang": "js",
  2591. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.start({\n ...\n})"
  2592. }
  2593. ]
  2594. },
  2595. "delete": {
  2596. "tags": ["mcp"],
  2597. "operationId": "mcp.auth.remove",
  2598. "parameters": [
  2599. {
  2600. "name": "directory",
  2601. "in": "query",
  2602. "required": false,
  2603. "schema": {
  2604. "type": "string"
  2605. }
  2606. },
  2607. {
  2608. "name": "workspace",
  2609. "in": "query",
  2610. "required": false,
  2611. "schema": {
  2612. "type": "string"
  2613. }
  2614. },
  2615. {
  2616. "name": "name",
  2617. "in": "path",
  2618. "schema": {
  2619. "type": "string"
  2620. },
  2621. "required": true
  2622. }
  2623. ],
  2624. "responses": {
  2625. "200": {
  2626. "description": "OAuth credentials removed",
  2627. "content": {
  2628. "application/json": {
  2629. "schema": {
  2630. "type": "object",
  2631. "properties": {
  2632. "success": {
  2633. "type": "boolean",
  2634. "enum": [true]
  2635. }
  2636. },
  2637. "required": ["success"],
  2638. "additionalProperties": false,
  2639. "description": "OAuth credentials removed"
  2640. }
  2641. }
  2642. }
  2643. },
  2644. "404": {
  2645. "description": "Not found",
  2646. "content": {
  2647. "application/json": {
  2648. "schema": {
  2649. "$ref": "#/components/schemas/NotFoundError"
  2650. }
  2651. }
  2652. }
  2653. }
  2654. },
  2655. "description": "Remove OAuth credentials for an MCP server.",
  2656. "summary": "Remove MCP OAuth",
  2657. "x-codeSamples": [
  2658. {
  2659. "lang": "js",
  2660. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.remove({\n ...\n})"
  2661. }
  2662. ]
  2663. }
  2664. },
  2665. "/mcp/{name}/auth/callback": {
  2666. "post": {
  2667. "tags": ["mcp"],
  2668. "operationId": "mcp.auth.callback",
  2669. "parameters": [
  2670. {
  2671. "name": "directory",
  2672. "in": "query",
  2673. "required": false,
  2674. "schema": {
  2675. "type": "string"
  2676. }
  2677. },
  2678. {
  2679. "name": "workspace",
  2680. "in": "query",
  2681. "required": false,
  2682. "schema": {
  2683. "type": "string"
  2684. }
  2685. },
  2686. {
  2687. "name": "name",
  2688. "in": "path",
  2689. "schema": {
  2690. "type": "string"
  2691. },
  2692. "required": true
  2693. }
  2694. ],
  2695. "responses": {
  2696. "200": {
  2697. "description": "OAuth authentication completed",
  2698. "content": {
  2699. "application/json": {
  2700. "schema": {
  2701. "$ref": "#/components/schemas/MCPStatus"
  2702. }
  2703. }
  2704. }
  2705. },
  2706. "400": {
  2707. "description": "Bad request",
  2708. "content": {
  2709. "application/json": {
  2710. "schema": {
  2711. "$ref": "#/components/schemas/BadRequestError"
  2712. }
  2713. }
  2714. }
  2715. },
  2716. "404": {
  2717. "description": "Not found",
  2718. "content": {
  2719. "application/json": {
  2720. "schema": {
  2721. "$ref": "#/components/schemas/NotFoundError"
  2722. }
  2723. }
  2724. }
  2725. }
  2726. },
  2727. "description": "Complete OAuth authentication for a Model Context Protocol (MCP) server using the authorization code.",
  2728. "summary": "Complete MCP OAuth",
  2729. "requestBody": {
  2730. "content": {
  2731. "application/json": {
  2732. "schema": {
  2733. "type": "object",
  2734. "properties": {
  2735. "code": {
  2736. "type": "string"
  2737. }
  2738. },
  2739. "required": ["code"],
  2740. "additionalProperties": false
  2741. }
  2742. }
  2743. }
  2744. },
  2745. "x-codeSamples": [
  2746. {
  2747. "lang": "js",
  2748. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.callback({\n ...\n})"
  2749. }
  2750. ]
  2751. }
  2752. },
  2753. "/mcp/{name}/auth/authenticate": {
  2754. "post": {
  2755. "tags": ["mcp"],
  2756. "operationId": "mcp.auth.authenticate",
  2757. "parameters": [
  2758. {
  2759. "name": "directory",
  2760. "in": "query",
  2761. "required": false,
  2762. "schema": {
  2763. "type": "string"
  2764. }
  2765. },
  2766. {
  2767. "name": "workspace",
  2768. "in": "query",
  2769. "required": false,
  2770. "schema": {
  2771. "type": "string"
  2772. }
  2773. },
  2774. {
  2775. "name": "name",
  2776. "in": "path",
  2777. "schema": {
  2778. "type": "string"
  2779. },
  2780. "required": true
  2781. }
  2782. ],
  2783. "responses": {
  2784. "200": {
  2785. "description": "OAuth authentication completed",
  2786. "content": {
  2787. "application/json": {
  2788. "schema": {
  2789. "$ref": "#/components/schemas/MCPStatus"
  2790. }
  2791. }
  2792. }
  2793. },
  2794. "400": {
  2795. "description": "McpUnsupportedOAuthError",
  2796. "content": {
  2797. "application/json": {
  2798. "schema": {
  2799. "$ref": "#/components/schemas/McpUnsupportedOAuthError"
  2800. }
  2801. }
  2802. }
  2803. },
  2804. "404": {
  2805. "description": "Not found",
  2806. "content": {
  2807. "application/json": {
  2808. "schema": {
  2809. "$ref": "#/components/schemas/NotFoundError"
  2810. }
  2811. }
  2812. }
  2813. }
  2814. },
  2815. "description": "Start OAuth flow and wait for callback (opens browser).",
  2816. "summary": "Authenticate MCP OAuth",
  2817. "x-codeSamples": [
  2818. {
  2819. "lang": "js",
  2820. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.authenticate({\n ...\n})"
  2821. }
  2822. ]
  2823. }
  2824. },
  2825. "/mcp/{name}/connect": {
  2826. "post": {
  2827. "tags": ["mcp"],
  2828. "operationId": "mcp.connect",
  2829. "parameters": [
  2830. {
  2831. "name": "directory",
  2832. "in": "query",
  2833. "required": false,
  2834. "schema": {
  2835. "type": "string"
  2836. }
  2837. },
  2838. {
  2839. "name": "workspace",
  2840. "in": "query",
  2841. "required": false,
  2842. "schema": {
  2843. "type": "string"
  2844. }
  2845. },
  2846. {
  2847. "name": "name",
  2848. "in": "path",
  2849. "schema": {
  2850. "type": "string"
  2851. },
  2852. "required": true
  2853. }
  2854. ],
  2855. "responses": {
  2856. "200": {
  2857. "description": "MCP server connected successfully",
  2858. "content": {
  2859. "application/json": {
  2860. "schema": {
  2861. "type": "boolean",
  2862. "description": "MCP server connected successfully"
  2863. }
  2864. }
  2865. }
  2866. }
  2867. },
  2868. "description": "Connect an MCP server.",
  2869. "x-codeSamples": [
  2870. {
  2871. "lang": "js",
  2872. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.connect({\n ...\n})"
  2873. }
  2874. ]
  2875. }
  2876. },
  2877. "/mcp/{name}/disconnect": {
  2878. "post": {
  2879. "tags": ["mcp"],
  2880. "operationId": "mcp.disconnect",
  2881. "parameters": [
  2882. {
  2883. "name": "directory",
  2884. "in": "query",
  2885. "required": false,
  2886. "schema": {
  2887. "type": "string"
  2888. }
  2889. },
  2890. {
  2891. "name": "workspace",
  2892. "in": "query",
  2893. "required": false,
  2894. "schema": {
  2895. "type": "string"
  2896. }
  2897. },
  2898. {
  2899. "name": "name",
  2900. "in": "path",
  2901. "schema": {
  2902. "type": "string"
  2903. },
  2904. "required": true
  2905. }
  2906. ],
  2907. "responses": {
  2908. "200": {
  2909. "description": "MCP server disconnected successfully",
  2910. "content": {
  2911. "application/json": {
  2912. "schema": {
  2913. "type": "boolean",
  2914. "description": "MCP server disconnected successfully"
  2915. }
  2916. }
  2917. }
  2918. }
  2919. },
  2920. "description": "Disconnect an MCP server.",
  2921. "x-codeSamples": [
  2922. {
  2923. "lang": "js",
  2924. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.disconnect({\n ...\n})"
  2925. }
  2926. ]
  2927. }
  2928. },
  2929. "/project": {
  2930. "get": {
  2931. "tags": ["project"],
  2932. "operationId": "project.list",
  2933. "parameters": [
  2934. {
  2935. "name": "directory",
  2936. "in": "query",
  2937. "required": false,
  2938. "schema": {
  2939. "type": "string"
  2940. }
  2941. },
  2942. {
  2943. "name": "workspace",
  2944. "in": "query",
  2945. "required": false,
  2946. "schema": {
  2947. "type": "string"
  2948. }
  2949. }
  2950. ],
  2951. "responses": {
  2952. "200": {
  2953. "description": "List of projects",
  2954. "content": {
  2955. "application/json": {
  2956. "schema": {
  2957. "type": "array",
  2958. "items": {
  2959. "$ref": "#/components/schemas/Project"
  2960. },
  2961. "description": "List of projects"
  2962. }
  2963. }
  2964. }
  2965. }
  2966. },
  2967. "description": "Get a list of projects that have been opened with OpenCode.",
  2968. "summary": "List all projects",
  2969. "x-codeSamples": [
  2970. {
  2971. "lang": "js",
  2972. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.list({\n ...\n})"
  2973. }
  2974. ]
  2975. }
  2976. },
  2977. "/project/current": {
  2978. "get": {
  2979. "tags": ["project"],
  2980. "operationId": "project.current",
  2981. "parameters": [
  2982. {
  2983. "name": "directory",
  2984. "in": "query",
  2985. "required": false,
  2986. "schema": {
  2987. "type": "string"
  2988. }
  2989. },
  2990. {
  2991. "name": "workspace",
  2992. "in": "query",
  2993. "required": false,
  2994. "schema": {
  2995. "type": "string"
  2996. }
  2997. }
  2998. ],
  2999. "responses": {
  3000. "200": {
  3001. "description": "Current project information",
  3002. "content": {
  3003. "application/json": {
  3004. "schema": {
  3005. "$ref": "#/components/schemas/Project"
  3006. }
  3007. }
  3008. }
  3009. }
  3010. },
  3011. "description": "Retrieve the currently active project that OpenCode is working with.",
  3012. "summary": "Get current project",
  3013. "x-codeSamples": [
  3014. {
  3015. "lang": "js",
  3016. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.current({\n ...\n})"
  3017. }
  3018. ]
  3019. }
  3020. },
  3021. "/project/git/init": {
  3022. "post": {
  3023. "tags": ["project"],
  3024. "operationId": "project.initGit",
  3025. "parameters": [
  3026. {
  3027. "name": "directory",
  3028. "in": "query",
  3029. "required": false,
  3030. "schema": {
  3031. "type": "string"
  3032. }
  3033. },
  3034. {
  3035. "name": "workspace",
  3036. "in": "query",
  3037. "required": false,
  3038. "schema": {
  3039. "type": "string"
  3040. }
  3041. }
  3042. ],
  3043. "responses": {
  3044. "200": {
  3045. "description": "Project information after git initialization",
  3046. "content": {
  3047. "application/json": {
  3048. "schema": {
  3049. "$ref": "#/components/schemas/Project"
  3050. }
  3051. }
  3052. }
  3053. }
  3054. },
  3055. "description": "Create a git repository for the current project and return the refreshed project info.",
  3056. "summary": "Initialize git repository",
  3057. "x-codeSamples": [
  3058. {
  3059. "lang": "js",
  3060. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.initGit({\n ...\n})"
  3061. }
  3062. ]
  3063. }
  3064. },
  3065. "/project/{projectID}": {
  3066. "patch": {
  3067. "tags": ["project"],
  3068. "operationId": "project.update",
  3069. "parameters": [
  3070. {
  3071. "name": "directory",
  3072. "in": "query",
  3073. "required": false,
  3074. "schema": {
  3075. "type": "string"
  3076. }
  3077. },
  3078. {
  3079. "name": "workspace",
  3080. "in": "query",
  3081. "required": false,
  3082. "schema": {
  3083. "type": "string"
  3084. }
  3085. },
  3086. {
  3087. "name": "projectID",
  3088. "in": "path",
  3089. "schema": {
  3090. "type": "string"
  3091. },
  3092. "required": true
  3093. }
  3094. ],
  3095. "responses": {
  3096. "200": {
  3097. "description": "Updated project information",
  3098. "content": {
  3099. "application/json": {
  3100. "schema": {
  3101. "$ref": "#/components/schemas/Project"
  3102. }
  3103. }
  3104. }
  3105. },
  3106. "400": {
  3107. "description": "Bad request",
  3108. "content": {
  3109. "application/json": {
  3110. "schema": {
  3111. "$ref": "#/components/schemas/BadRequestError"
  3112. }
  3113. }
  3114. }
  3115. },
  3116. "404": {
  3117. "description": "Not found",
  3118. "content": {
  3119. "application/json": {
  3120. "schema": {
  3121. "$ref": "#/components/schemas/NotFoundError"
  3122. }
  3123. }
  3124. }
  3125. }
  3126. },
  3127. "description": "Update project properties such as name, icon, and commands.",
  3128. "summary": "Update project",
  3129. "requestBody": {
  3130. "content": {
  3131. "application/json": {
  3132. "schema": {
  3133. "type": "object",
  3134. "properties": {
  3135. "name": {
  3136. "type": "string"
  3137. },
  3138. "icon": {
  3139. "type": "object",
  3140. "properties": {
  3141. "url": {
  3142. "type": "string"
  3143. },
  3144. "override": {
  3145. "type": "string"
  3146. },
  3147. "color": {
  3148. "type": "string"
  3149. }
  3150. },
  3151. "additionalProperties": false
  3152. },
  3153. "commands": {
  3154. "type": "object",
  3155. "properties": {
  3156. "start": {
  3157. "type": "string",
  3158. "description": "Startup script to run when creating a new workspace (worktree)"
  3159. }
  3160. },
  3161. "additionalProperties": false
  3162. }
  3163. },
  3164. "additionalProperties": false
  3165. }
  3166. }
  3167. }
  3168. },
  3169. "x-codeSamples": [
  3170. {
  3171. "lang": "js",
  3172. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.update({\n ...\n})"
  3173. }
  3174. ]
  3175. }
  3176. },
  3177. "/pty/shells": {
  3178. "get": {
  3179. "tags": ["pty"],
  3180. "operationId": "pty.shells",
  3181. "parameters": [
  3182. {
  3183. "name": "directory",
  3184. "in": "query",
  3185. "required": false,
  3186. "schema": {
  3187. "type": "string"
  3188. }
  3189. },
  3190. {
  3191. "name": "workspace",
  3192. "in": "query",
  3193. "required": false,
  3194. "schema": {
  3195. "type": "string"
  3196. }
  3197. }
  3198. ],
  3199. "responses": {
  3200. "200": {
  3201. "description": "List of shells",
  3202. "content": {
  3203. "application/json": {
  3204. "schema": {
  3205. "type": "array",
  3206. "items": {
  3207. "type": "object",
  3208. "properties": {
  3209. "path": {
  3210. "type": "string"
  3211. },
  3212. "name": {
  3213. "type": "string"
  3214. },
  3215. "acceptable": {
  3216. "type": "boolean"
  3217. }
  3218. },
  3219. "required": ["path", "name", "acceptable"],
  3220. "additionalProperties": false
  3221. },
  3222. "description": "List of shells"
  3223. }
  3224. }
  3225. }
  3226. }
  3227. },
  3228. "description": "Get a list of available shells on the system.",
  3229. "summary": "List available shells",
  3230. "x-codeSamples": [
  3231. {
  3232. "lang": "js",
  3233. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.shells({\n ...\n})"
  3234. }
  3235. ]
  3236. }
  3237. },
  3238. "/pty": {
  3239. "get": {
  3240. "tags": ["pty"],
  3241. "operationId": "pty.list",
  3242. "parameters": [
  3243. {
  3244. "name": "directory",
  3245. "in": "query",
  3246. "required": false,
  3247. "schema": {
  3248. "type": "string"
  3249. }
  3250. },
  3251. {
  3252. "name": "workspace",
  3253. "in": "query",
  3254. "required": false,
  3255. "schema": {
  3256. "type": "string"
  3257. }
  3258. }
  3259. ],
  3260. "responses": {
  3261. "200": {
  3262. "description": "List of sessions",
  3263. "content": {
  3264. "application/json": {
  3265. "schema": {
  3266. "type": "array",
  3267. "items": {
  3268. "$ref": "#/components/schemas/Pty"
  3269. },
  3270. "description": "List of sessions"
  3271. }
  3272. }
  3273. }
  3274. }
  3275. },
  3276. "description": "Get a list of all active pseudo-terminal (PTY) sessions managed by OpenCode.",
  3277. "summary": "List PTY sessions",
  3278. "x-codeSamples": [
  3279. {
  3280. "lang": "js",
  3281. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.list({\n ...\n})"
  3282. }
  3283. ]
  3284. },
  3285. "post": {
  3286. "tags": ["pty"],
  3287. "operationId": "pty.create",
  3288. "parameters": [
  3289. {
  3290. "name": "directory",
  3291. "in": "query",
  3292. "required": false,
  3293. "schema": {
  3294. "type": "string"
  3295. }
  3296. },
  3297. {
  3298. "name": "workspace",
  3299. "in": "query",
  3300. "required": false,
  3301. "schema": {
  3302. "type": "string"
  3303. }
  3304. }
  3305. ],
  3306. "responses": {
  3307. "200": {
  3308. "description": "Created session",
  3309. "content": {
  3310. "application/json": {
  3311. "schema": {
  3312. "$ref": "#/components/schemas/Pty"
  3313. }
  3314. }
  3315. }
  3316. },
  3317. "400": {
  3318. "description": "Bad request",
  3319. "content": {
  3320. "application/json": {
  3321. "schema": {
  3322. "$ref": "#/components/schemas/BadRequestError"
  3323. }
  3324. }
  3325. }
  3326. }
  3327. },
  3328. "description": "Create a new pseudo-terminal (PTY) session for running shell commands and processes.",
  3329. "summary": "Create PTY session",
  3330. "requestBody": {
  3331. "content": {
  3332. "application/json": {
  3333. "schema": {
  3334. "type": "object",
  3335. "properties": {
  3336. "command": {
  3337. "type": "string"
  3338. },
  3339. "args": {
  3340. "type": "array",
  3341. "items": {
  3342. "type": "string"
  3343. }
  3344. },
  3345. "cwd": {
  3346. "type": "string"
  3347. },
  3348. "title": {
  3349. "type": "string"
  3350. },
  3351. "env": {
  3352. "type": "object",
  3353. "additionalProperties": {
  3354. "type": "string"
  3355. }
  3356. }
  3357. },
  3358. "additionalProperties": false
  3359. }
  3360. }
  3361. }
  3362. },
  3363. "x-codeSamples": [
  3364. {
  3365. "lang": "js",
  3366. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.create({\n ...\n})"
  3367. }
  3368. ]
  3369. }
  3370. },
  3371. "/pty/{ptyID}": {
  3372. "get": {
  3373. "tags": ["pty"],
  3374. "operationId": "pty.get",
  3375. "parameters": [
  3376. {
  3377. "name": "directory",
  3378. "in": "query",
  3379. "required": false,
  3380. "schema": {
  3381. "type": "string"
  3382. }
  3383. },
  3384. {
  3385. "name": "workspace",
  3386. "in": "query",
  3387. "required": false,
  3388. "schema": {
  3389. "type": "string"
  3390. }
  3391. },
  3392. {
  3393. "name": "ptyID",
  3394. "in": "path",
  3395. "schema": {
  3396. "type": "string",
  3397. "pattern": "^pty.*"
  3398. },
  3399. "required": true
  3400. }
  3401. ],
  3402. "responses": {
  3403. "200": {
  3404. "description": "Session info",
  3405. "content": {
  3406. "application/json": {
  3407. "schema": {
  3408. "$ref": "#/components/schemas/Pty"
  3409. }
  3410. }
  3411. }
  3412. },
  3413. "404": {
  3414. "description": "NotFoundError",
  3415. "content": {
  3416. "application/json": {
  3417. "schema": {
  3418. "$ref": "#/components/schemas/NotFoundError"
  3419. }
  3420. }
  3421. }
  3422. }
  3423. },
  3424. "description": "Retrieve detailed information about a specific pseudo-terminal (PTY) session.",
  3425. "summary": "Get PTY session",
  3426. "x-codeSamples": [
  3427. {
  3428. "lang": "js",
  3429. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.get({\n ...\n})"
  3430. }
  3431. ]
  3432. },
  3433. "put": {
  3434. "tags": ["pty"],
  3435. "operationId": "pty.update",
  3436. "parameters": [
  3437. {
  3438. "name": "directory",
  3439. "in": "query",
  3440. "required": false,
  3441. "schema": {
  3442. "type": "string"
  3443. }
  3444. },
  3445. {
  3446. "name": "workspace",
  3447. "in": "query",
  3448. "required": false,
  3449. "schema": {
  3450. "type": "string"
  3451. }
  3452. },
  3453. {
  3454. "name": "ptyID",
  3455. "in": "path",
  3456. "schema": {
  3457. "type": "string",
  3458. "pattern": "^pty.*"
  3459. },
  3460. "required": true
  3461. }
  3462. ],
  3463. "responses": {
  3464. "200": {
  3465. "description": "Updated session",
  3466. "content": {
  3467. "application/json": {
  3468. "schema": {
  3469. "$ref": "#/components/schemas/Pty"
  3470. }
  3471. }
  3472. }
  3473. },
  3474. "400": {
  3475. "description": "Bad request",
  3476. "content": {
  3477. "application/json": {
  3478. "schema": {
  3479. "$ref": "#/components/schemas/BadRequestError"
  3480. }
  3481. }
  3482. }
  3483. }
  3484. },
  3485. "description": "Update properties of an existing pseudo-terminal (PTY) session.",
  3486. "summary": "Update PTY session",
  3487. "requestBody": {
  3488. "content": {
  3489. "application/json": {
  3490. "schema": {
  3491. "type": "object",
  3492. "properties": {
  3493. "title": {
  3494. "type": "string"
  3495. },
  3496. "size": {
  3497. "type": "object",
  3498. "properties": {
  3499. "rows": {
  3500. "type": "integer",
  3501. "exclusiveMinimum": 0
  3502. },
  3503. "cols": {
  3504. "type": "integer",
  3505. "exclusiveMinimum": 0
  3506. }
  3507. },
  3508. "required": ["rows", "cols"],
  3509. "additionalProperties": false
  3510. }
  3511. },
  3512. "additionalProperties": false
  3513. }
  3514. }
  3515. }
  3516. },
  3517. "x-codeSamples": [
  3518. {
  3519. "lang": "js",
  3520. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.update({\n ...\n})"
  3521. }
  3522. ]
  3523. },
  3524. "delete": {
  3525. "tags": ["pty"],
  3526. "operationId": "pty.remove",
  3527. "parameters": [
  3528. {
  3529. "name": "directory",
  3530. "in": "query",
  3531. "required": false,
  3532. "schema": {
  3533. "type": "string"
  3534. }
  3535. },
  3536. {
  3537. "name": "workspace",
  3538. "in": "query",
  3539. "required": false,
  3540. "schema": {
  3541. "type": "string"
  3542. }
  3543. },
  3544. {
  3545. "name": "ptyID",
  3546. "in": "path",
  3547. "schema": {
  3548. "type": "string",
  3549. "pattern": "^pty.*"
  3550. },
  3551. "required": true
  3552. }
  3553. ],
  3554. "responses": {
  3555. "200": {
  3556. "description": "Session removed",
  3557. "content": {
  3558. "application/json": {
  3559. "schema": {
  3560. "type": "boolean",
  3561. "description": "Session removed"
  3562. }
  3563. }
  3564. }
  3565. },
  3566. "404": {
  3567. "description": "NotFoundError",
  3568. "content": {
  3569. "application/json": {
  3570. "schema": {
  3571. "$ref": "#/components/schemas/NotFoundError"
  3572. }
  3573. }
  3574. }
  3575. }
  3576. },
  3577. "description": "Remove and terminate a specific pseudo-terminal (PTY) session.",
  3578. "summary": "Remove PTY session",
  3579. "x-codeSamples": [
  3580. {
  3581. "lang": "js",
  3582. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.remove({\n ...\n})"
  3583. }
  3584. ]
  3585. }
  3586. },
  3587. "/pty/{ptyID}/connect-token": {
  3588. "post": {
  3589. "tags": ["pty"],
  3590. "operationId": "pty.connectToken",
  3591. "parameters": [
  3592. {
  3593. "name": "directory",
  3594. "in": "query",
  3595. "required": false,
  3596. "schema": {
  3597. "type": "string"
  3598. }
  3599. },
  3600. {
  3601. "name": "workspace",
  3602. "in": "query",
  3603. "required": false,
  3604. "schema": {
  3605. "type": "string"
  3606. }
  3607. },
  3608. {
  3609. "name": "ptyID",
  3610. "in": "path",
  3611. "schema": {
  3612. "type": "string",
  3613. "pattern": "^pty.*"
  3614. },
  3615. "required": true
  3616. }
  3617. ],
  3618. "responses": {
  3619. "200": {
  3620. "description": "WebSocket connect token",
  3621. "content": {
  3622. "application/json": {
  3623. "schema": {
  3624. "type": "object",
  3625. "properties": {
  3626. "ticket": {
  3627. "type": "string"
  3628. },
  3629. "expires_in": {
  3630. "type": "integer",
  3631. "exclusiveMinimum": 0
  3632. }
  3633. },
  3634. "required": ["ticket", "expires_in"],
  3635. "additionalProperties": false,
  3636. "description": "WebSocket connect token"
  3637. }
  3638. }
  3639. }
  3640. },
  3641. "403": {
  3642. "description": "Forbidden",
  3643. "content": {
  3644. "application/json": {
  3645. "schema": {
  3646. "$ref": "#/components/schemas/effect_HttpApiError_Forbidden"
  3647. }
  3648. }
  3649. }
  3650. },
  3651. "404": {
  3652. "description": "NotFoundError",
  3653. "content": {
  3654. "application/json": {
  3655. "schema": {
  3656. "$ref": "#/components/schemas/NotFoundError"
  3657. }
  3658. }
  3659. }
  3660. }
  3661. },
  3662. "description": "Create a short-lived ticket for opening a PTY WebSocket connection.",
  3663. "summary": "Create PTY WebSocket token",
  3664. "x-codeSamples": [
  3665. {
  3666. "lang": "js",
  3667. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.connectToken({\n ...\n})"
  3668. }
  3669. ]
  3670. }
  3671. },
  3672. "/question": {
  3673. "get": {
  3674. "tags": ["question"],
  3675. "operationId": "question.list",
  3676. "parameters": [
  3677. {
  3678. "name": "directory",
  3679. "in": "query",
  3680. "required": false,
  3681. "schema": {
  3682. "type": "string"
  3683. }
  3684. },
  3685. {
  3686. "name": "workspace",
  3687. "in": "query",
  3688. "required": false,
  3689. "schema": {
  3690. "type": "string"
  3691. }
  3692. }
  3693. ],
  3694. "responses": {
  3695. "200": {
  3696. "description": "List of pending questions",
  3697. "content": {
  3698. "application/json": {
  3699. "schema": {
  3700. "type": "array",
  3701. "items": {
  3702. "$ref": "#/components/schemas/QuestionRequest"
  3703. },
  3704. "description": "List of pending questions"
  3705. }
  3706. }
  3707. }
  3708. }
  3709. },
  3710. "description": "Get all pending question requests across all sessions.",
  3711. "summary": "List pending questions",
  3712. "x-codeSamples": [
  3713. {
  3714. "lang": "js",
  3715. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.question.list({\n ...\n})"
  3716. }
  3717. ]
  3718. }
  3719. },
  3720. "/question/{requestID}/reply": {
  3721. "post": {
  3722. "tags": ["question"],
  3723. "operationId": "question.reply",
  3724. "parameters": [
  3725. {
  3726. "name": "directory",
  3727. "in": "query",
  3728. "required": false,
  3729. "schema": {
  3730. "type": "string"
  3731. }
  3732. },
  3733. {
  3734. "name": "workspace",
  3735. "in": "query",
  3736. "required": false,
  3737. "schema": {
  3738. "type": "string"
  3739. }
  3740. },
  3741. {
  3742. "name": "requestID",
  3743. "in": "path",
  3744. "schema": {
  3745. "type": "string",
  3746. "pattern": "^que.*"
  3747. },
  3748. "required": true
  3749. }
  3750. ],
  3751. "responses": {
  3752. "200": {
  3753. "description": "Question answered successfully",
  3754. "content": {
  3755. "application/json": {
  3756. "schema": {
  3757. "type": "boolean",
  3758. "description": "Question answered successfully"
  3759. }
  3760. }
  3761. }
  3762. },
  3763. "400": {
  3764. "description": "Bad request",
  3765. "content": {
  3766. "application/json": {
  3767. "schema": {
  3768. "$ref": "#/components/schemas/BadRequestError"
  3769. }
  3770. }
  3771. }
  3772. },
  3773. "404": {
  3774. "description": "Not found",
  3775. "content": {
  3776. "application/json": {
  3777. "schema": {
  3778. "$ref": "#/components/schemas/NotFoundError"
  3779. }
  3780. }
  3781. }
  3782. }
  3783. },
  3784. "description": "Provide answers to a question request from the AI assistant.",
  3785. "summary": "Reply to question request",
  3786. "requestBody": {
  3787. "content": {
  3788. "application/json": {
  3789. "schema": {
  3790. "type": "object",
  3791. "properties": {
  3792. "answers": {
  3793. "type": "array",
  3794. "items": {
  3795. "$ref": "#/components/schemas/QuestionAnswer"
  3796. },
  3797. "description": "User answers in order of questions (each answer is an array of selected labels)"
  3798. }
  3799. },
  3800. "required": ["answers"],
  3801. "additionalProperties": false
  3802. }
  3803. }
  3804. }
  3805. },
  3806. "x-codeSamples": [
  3807. {
  3808. "lang": "js",
  3809. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.question.reply({\n ...\n})"
  3810. }
  3811. ]
  3812. }
  3813. },
  3814. "/question/{requestID}/reject": {
  3815. "post": {
  3816. "tags": ["question"],
  3817. "operationId": "question.reject",
  3818. "parameters": [
  3819. {
  3820. "name": "directory",
  3821. "in": "query",
  3822. "required": false,
  3823. "schema": {
  3824. "type": "string"
  3825. }
  3826. },
  3827. {
  3828. "name": "workspace",
  3829. "in": "query",
  3830. "required": false,
  3831. "schema": {
  3832. "type": "string"
  3833. }
  3834. },
  3835. {
  3836. "name": "requestID",
  3837. "in": "path",
  3838. "schema": {
  3839. "type": "string",
  3840. "pattern": "^que.*"
  3841. },
  3842. "required": true
  3843. }
  3844. ],
  3845. "responses": {
  3846. "200": {
  3847. "description": "Question rejected successfully",
  3848. "content": {
  3849. "application/json": {
  3850. "schema": {
  3851. "type": "boolean",
  3852. "description": "Question rejected successfully"
  3853. }
  3854. }
  3855. }
  3856. },
  3857. "400": {
  3858. "description": "Bad request",
  3859. "content": {
  3860. "application/json": {
  3861. "schema": {
  3862. "$ref": "#/components/schemas/BadRequestError"
  3863. }
  3864. }
  3865. }
  3866. },
  3867. "404": {
  3868. "description": "Not found",
  3869. "content": {
  3870. "application/json": {
  3871. "schema": {
  3872. "$ref": "#/components/schemas/NotFoundError"
  3873. }
  3874. }
  3875. }
  3876. }
  3877. },
  3878. "description": "Reject a question request from the AI assistant.",
  3879. "summary": "Reject question request",
  3880. "x-codeSamples": [
  3881. {
  3882. "lang": "js",
  3883. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.question.reject({\n ...\n})"
  3884. }
  3885. ]
  3886. }
  3887. },
  3888. "/permission": {
  3889. "get": {
  3890. "tags": ["permission"],
  3891. "operationId": "permission.list",
  3892. "parameters": [
  3893. {
  3894. "name": "directory",
  3895. "in": "query",
  3896. "required": false,
  3897. "schema": {
  3898. "type": "string"
  3899. }
  3900. },
  3901. {
  3902. "name": "workspace",
  3903. "in": "query",
  3904. "required": false,
  3905. "schema": {
  3906. "type": "string"
  3907. }
  3908. }
  3909. ],
  3910. "responses": {
  3911. "200": {
  3912. "description": "List of pending permissions",
  3913. "content": {
  3914. "application/json": {
  3915. "schema": {
  3916. "type": "array",
  3917. "items": {
  3918. "$ref": "#/components/schemas/PermissionRequest"
  3919. },
  3920. "description": "List of pending permissions"
  3921. }
  3922. }
  3923. }
  3924. }
  3925. },
  3926. "description": "Get all pending permission requests across all sessions.",
  3927. "summary": "List pending permissions",
  3928. "x-codeSamples": [
  3929. {
  3930. "lang": "js",
  3931. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.permission.list({\n ...\n})"
  3932. }
  3933. ]
  3934. }
  3935. },
  3936. "/permission/{requestID}/reply": {
  3937. "post": {
  3938. "tags": ["permission"],
  3939. "operationId": "permission.reply",
  3940. "parameters": [
  3941. {
  3942. "name": "directory",
  3943. "in": "query",
  3944. "required": false,
  3945. "schema": {
  3946. "type": "string"
  3947. }
  3948. },
  3949. {
  3950. "name": "workspace",
  3951. "in": "query",
  3952. "required": false,
  3953. "schema": {
  3954. "type": "string"
  3955. }
  3956. },
  3957. {
  3958. "name": "requestID",
  3959. "in": "path",
  3960. "schema": {
  3961. "type": "string",
  3962. "pattern": "^per.*"
  3963. },
  3964. "required": true
  3965. }
  3966. ],
  3967. "responses": {
  3968. "200": {
  3969. "description": "Permission processed successfully",
  3970. "content": {
  3971. "application/json": {
  3972. "schema": {
  3973. "type": "boolean",
  3974. "description": "Permission processed successfully"
  3975. }
  3976. }
  3977. }
  3978. },
  3979. "400": {
  3980. "description": "Bad request",
  3981. "content": {
  3982. "application/json": {
  3983. "schema": {
  3984. "$ref": "#/components/schemas/BadRequestError"
  3985. }
  3986. }
  3987. }
  3988. },
  3989. "404": {
  3990. "description": "Not found",
  3991. "content": {
  3992. "application/json": {
  3993. "schema": {
  3994. "$ref": "#/components/schemas/NotFoundError"
  3995. }
  3996. }
  3997. }
  3998. }
  3999. },
  4000. "description": "Approve or deny a permission request from the AI assistant.",
  4001. "summary": "Respond to permission request",
  4002. "requestBody": {
  4003. "content": {
  4004. "application/json": {
  4005. "schema": {
  4006. "type": "object",
  4007. "properties": {
  4008. "reply": {
  4009. "type": "string",
  4010. "enum": ["once", "always", "reject"]
  4011. },
  4012. "message": {
  4013. "type": "string"
  4014. }
  4015. },
  4016. "required": ["reply"],
  4017. "additionalProperties": false
  4018. }
  4019. }
  4020. }
  4021. },
  4022. "x-codeSamples": [
  4023. {
  4024. "lang": "js",
  4025. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.permission.reply({\n ...\n})"
  4026. }
  4027. ]
  4028. }
  4029. },
  4030. "/provider": {
  4031. "get": {
  4032. "tags": ["provider"],
  4033. "operationId": "provider.list",
  4034. "parameters": [
  4035. {
  4036. "name": "directory",
  4037. "in": "query",
  4038. "required": false,
  4039. "schema": {
  4040. "type": "string"
  4041. }
  4042. },
  4043. {
  4044. "name": "workspace",
  4045. "in": "query",
  4046. "required": false,
  4047. "schema": {
  4048. "type": "string"
  4049. }
  4050. }
  4051. ],
  4052. "responses": {
  4053. "200": {
  4054. "description": "List of providers",
  4055. "content": {
  4056. "application/json": {
  4057. "schema": {
  4058. "type": "object",
  4059. "properties": {
  4060. "all": {
  4061. "type": "array",
  4062. "items": {
  4063. "$ref": "#/components/schemas/Provider"
  4064. }
  4065. },
  4066. "default": {
  4067. "type": "object",
  4068. "additionalProperties": {
  4069. "type": "string"
  4070. }
  4071. },
  4072. "connected": {
  4073. "type": "array",
  4074. "items": {
  4075. "type": "string"
  4076. }
  4077. }
  4078. },
  4079. "required": ["all", "default", "connected"],
  4080. "additionalProperties": false,
  4081. "description": "List of providers"
  4082. }
  4083. }
  4084. }
  4085. }
  4086. },
  4087. "description": "Get a list of all available AI providers, including both available and connected ones.",
  4088. "summary": "List providers",
  4089. "x-codeSamples": [
  4090. {
  4091. "lang": "js",
  4092. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.list({\n ...\n})"
  4093. }
  4094. ]
  4095. }
  4096. },
  4097. "/provider/auth": {
  4098. "get": {
  4099. "tags": ["provider"],
  4100. "operationId": "provider.auth",
  4101. "parameters": [
  4102. {
  4103. "name": "directory",
  4104. "in": "query",
  4105. "required": false,
  4106. "schema": {
  4107. "type": "string"
  4108. }
  4109. },
  4110. {
  4111. "name": "workspace",
  4112. "in": "query",
  4113. "required": false,
  4114. "schema": {
  4115. "type": "string"
  4116. }
  4117. }
  4118. ],
  4119. "responses": {
  4120. "200": {
  4121. "description": "Provider auth methods",
  4122. "content": {
  4123. "application/json": {
  4124. "schema": {
  4125. "type": "object",
  4126. "additionalProperties": {
  4127. "type": "array",
  4128. "items": {
  4129. "$ref": "#/components/schemas/ProviderAuthMethod"
  4130. }
  4131. },
  4132. "description": "Provider auth methods"
  4133. }
  4134. }
  4135. }
  4136. }
  4137. },
  4138. "description": "Retrieve available authentication methods for all AI providers.",
  4139. "summary": "Get provider auth methods",
  4140. "x-codeSamples": [
  4141. {
  4142. "lang": "js",
  4143. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.auth({\n ...\n})"
  4144. }
  4145. ]
  4146. }
  4147. },
  4148. "/provider/{providerID}/oauth/authorize": {
  4149. "post": {
  4150. "tags": ["provider"],
  4151. "operationId": "provider.oauth.authorize",
  4152. "parameters": [
  4153. {
  4154. "name": "directory",
  4155. "in": "query",
  4156. "required": false,
  4157. "schema": {
  4158. "type": "string"
  4159. }
  4160. },
  4161. {
  4162. "name": "workspace",
  4163. "in": "query",
  4164. "required": false,
  4165. "schema": {
  4166. "type": "string"
  4167. }
  4168. },
  4169. {
  4170. "name": "providerID",
  4171. "in": "path",
  4172. "schema": {
  4173. "type": "string"
  4174. },
  4175. "required": true
  4176. }
  4177. ],
  4178. "responses": {
  4179. "200": {
  4180. "description": "Authorization URL and method",
  4181. "content": {
  4182. "application/json": {
  4183. "schema": {
  4184. "$ref": "#/components/schemas/ProviderAuthAuthorization"
  4185. }
  4186. }
  4187. }
  4188. },
  4189. "400": {
  4190. "description": "Bad request",
  4191. "content": {
  4192. "application/json": {
  4193. "schema": {
  4194. "$ref": "#/components/schemas/BadRequestError"
  4195. }
  4196. }
  4197. }
  4198. }
  4199. },
  4200. "description": "Start the OAuth authorization flow for a provider.",
  4201. "summary": "Start OAuth authorization",
  4202. "requestBody": {
  4203. "content": {
  4204. "application/json": {
  4205. "schema": {
  4206. "type": "object",
  4207. "properties": {
  4208. "method": {
  4209. "type": "number",
  4210. "description": "Auth method index"
  4211. },
  4212. "inputs": {
  4213. "type": "object",
  4214. "additionalProperties": {
  4215. "type": "string"
  4216. }
  4217. }
  4218. },
  4219. "required": ["method"],
  4220. "additionalProperties": false
  4221. }
  4222. }
  4223. }
  4224. },
  4225. "x-codeSamples": [
  4226. {
  4227. "lang": "js",
  4228. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.oauth.authorize({\n ...\n})"
  4229. }
  4230. ]
  4231. }
  4232. },
  4233. "/provider/{providerID}/oauth/callback": {
  4234. "post": {
  4235. "tags": ["provider"],
  4236. "operationId": "provider.oauth.callback",
  4237. "parameters": [
  4238. {
  4239. "name": "directory",
  4240. "in": "query",
  4241. "required": false,
  4242. "schema": {
  4243. "type": "string"
  4244. }
  4245. },
  4246. {
  4247. "name": "workspace",
  4248. "in": "query",
  4249. "required": false,
  4250. "schema": {
  4251. "type": "string"
  4252. }
  4253. },
  4254. {
  4255. "name": "providerID",
  4256. "in": "path",
  4257. "schema": {
  4258. "type": "string"
  4259. },
  4260. "required": true
  4261. }
  4262. ],
  4263. "responses": {
  4264. "200": {
  4265. "description": "OAuth callback processed successfully",
  4266. "content": {
  4267. "application/json": {
  4268. "schema": {
  4269. "type": "boolean",
  4270. "description": "OAuth callback processed successfully"
  4271. }
  4272. }
  4273. }
  4274. },
  4275. "400": {
  4276. "description": "Bad request",
  4277. "content": {
  4278. "application/json": {
  4279. "schema": {
  4280. "$ref": "#/components/schemas/BadRequestError"
  4281. }
  4282. }
  4283. }
  4284. }
  4285. },
  4286. "description": "Handle the OAuth callback from a provider after user authorization.",
  4287. "summary": "Handle OAuth callback",
  4288. "requestBody": {
  4289. "content": {
  4290. "application/json": {
  4291. "schema": {
  4292. "type": "object",
  4293. "properties": {
  4294. "method": {
  4295. "type": "number",
  4296. "description": "Auth method index"
  4297. },
  4298. "code": {
  4299. "type": "string"
  4300. }
  4301. },
  4302. "required": ["method"],
  4303. "additionalProperties": false
  4304. }
  4305. }
  4306. }
  4307. },
  4308. "x-codeSamples": [
  4309. {
  4310. "lang": "js",
  4311. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.oauth.callback({\n ...\n})"
  4312. }
  4313. ]
  4314. }
  4315. },
  4316. "/session": {
  4317. "get": {
  4318. "tags": ["session"],
  4319. "operationId": "session.list",
  4320. "parameters": [
  4321. {
  4322. "name": "directory",
  4323. "in": "query",
  4324. "required": false,
  4325. "schema": {
  4326. "type": "string"
  4327. }
  4328. },
  4329. {
  4330. "name": "workspace",
  4331. "in": "query",
  4332. "required": false,
  4333. "schema": {
  4334. "type": "string"
  4335. }
  4336. },
  4337. {
  4338. "name": "scope",
  4339. "in": "query",
  4340. "schema": {
  4341. "type": "string",
  4342. "enum": ["project"]
  4343. },
  4344. "required": false
  4345. },
  4346. {
  4347. "name": "path",
  4348. "in": "query",
  4349. "schema": {
  4350. "type": "string"
  4351. },
  4352. "required": false
  4353. },
  4354. {
  4355. "name": "roots",
  4356. "in": "query",
  4357. "schema": {
  4358. "anyOf": [
  4359. {
  4360. "type": "boolean"
  4361. },
  4362. {
  4363. "type": "string",
  4364. "enum": ["true", "false"]
  4365. }
  4366. ]
  4367. },
  4368. "required": false
  4369. },
  4370. {
  4371. "name": "start",
  4372. "in": "query",
  4373. "schema": {
  4374. "type": "number"
  4375. },
  4376. "required": false
  4377. },
  4378. {
  4379. "name": "search",
  4380. "in": "query",
  4381. "schema": {
  4382. "type": "string"
  4383. },
  4384. "required": false
  4385. },
  4386. {
  4387. "name": "limit",
  4388. "in": "query",
  4389. "schema": {
  4390. "type": "number"
  4391. },
  4392. "required": false
  4393. }
  4394. ],
  4395. "responses": {
  4396. "200": {
  4397. "description": "List of sessions",
  4398. "content": {
  4399. "application/json": {
  4400. "schema": {
  4401. "type": "array",
  4402. "items": {
  4403. "$ref": "#/components/schemas/Session"
  4404. },
  4405. "description": "List of sessions"
  4406. }
  4407. }
  4408. }
  4409. }
  4410. },
  4411. "description": "Get a list of all OpenCode sessions, sorted by most recently updated.",
  4412. "summary": "List sessions",
  4413. "x-codeSamples": [
  4414. {
  4415. "lang": "js",
  4416. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.list({\n ...\n})"
  4417. }
  4418. ]
  4419. },
  4420. "post": {
  4421. "tags": ["session"],
  4422. "operationId": "session.create",
  4423. "parameters": [
  4424. {
  4425. "name": "directory",
  4426. "in": "query",
  4427. "required": false,
  4428. "schema": {
  4429. "type": "string"
  4430. }
  4431. },
  4432. {
  4433. "name": "workspace",
  4434. "in": "query",
  4435. "required": false,
  4436. "schema": {
  4437. "type": "string"
  4438. }
  4439. }
  4440. ],
  4441. "responses": {
  4442. "200": {
  4443. "description": "Successfully created session",
  4444. "content": {
  4445. "application/json": {
  4446. "schema": {
  4447. "$ref": "#/components/schemas/Session"
  4448. }
  4449. }
  4450. }
  4451. },
  4452. "400": {
  4453. "description": "Bad request",
  4454. "content": {
  4455. "application/json": {
  4456. "schema": {
  4457. "$ref": "#/components/schemas/BadRequestError"
  4458. }
  4459. }
  4460. }
  4461. }
  4462. },
  4463. "description": "Create a new OpenCode session for interacting with AI assistants and managing conversations.",
  4464. "summary": "Create session",
  4465. "requestBody": {
  4466. "content": {
  4467. "application/json": {
  4468. "schema": {
  4469. "type": "object",
  4470. "properties": {
  4471. "parentID": {
  4472. "type": "string"
  4473. },
  4474. "title": {
  4475. "type": "string"
  4476. },
  4477. "agent": {
  4478. "type": "string"
  4479. },
  4480. "model": {
  4481. "type": "object",
  4482. "properties": {
  4483. "id": {
  4484. "type": "string"
  4485. },
  4486. "providerID": {
  4487. "type": "string"
  4488. },
  4489. "variant": {
  4490. "type": "string"
  4491. }
  4492. },
  4493. "required": ["id", "providerID"],
  4494. "additionalProperties": false
  4495. },
  4496. "permission": {
  4497. "$ref": "#/components/schemas/PermissionRuleset"
  4498. },
  4499. "workspaceID": {
  4500. "type": "string"
  4501. }
  4502. },
  4503. "additionalProperties": false
  4504. }
  4505. }
  4506. }
  4507. },
  4508. "x-codeSamples": [
  4509. {
  4510. "lang": "js",
  4511. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.create({\n ...\n})"
  4512. }
  4513. ]
  4514. }
  4515. },
  4516. "/session/status": {
  4517. "get": {
  4518. "tags": ["session"],
  4519. "operationId": "session.status",
  4520. "parameters": [
  4521. {
  4522. "name": "directory",
  4523. "in": "query",
  4524. "required": false,
  4525. "schema": {
  4526. "type": "string"
  4527. }
  4528. },
  4529. {
  4530. "name": "workspace",
  4531. "in": "query",
  4532. "required": false,
  4533. "schema": {
  4534. "type": "string"
  4535. }
  4536. }
  4537. ],
  4538. "responses": {
  4539. "200": {
  4540. "description": "Get session status",
  4541. "content": {
  4542. "application/json": {
  4543. "schema": {
  4544. "type": "object",
  4545. "additionalProperties": {
  4546. "$ref": "#/components/schemas/SessionStatus"
  4547. },
  4548. "description": "Get session status"
  4549. }
  4550. }
  4551. }
  4552. },
  4553. "400": {
  4554. "description": "Bad request",
  4555. "content": {
  4556. "application/json": {
  4557. "schema": {
  4558. "$ref": "#/components/schemas/BadRequestError"
  4559. }
  4560. }
  4561. }
  4562. }
  4563. },
  4564. "description": "Retrieve the current status of all sessions, including active, idle, and completed states.",
  4565. "summary": "Get session status",
  4566. "x-codeSamples": [
  4567. {
  4568. "lang": "js",
  4569. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.status({\n ...\n})"
  4570. }
  4571. ]
  4572. }
  4573. },
  4574. "/session/{sessionID}": {
  4575. "get": {
  4576. "tags": ["session"],
  4577. "operationId": "session.get",
  4578. "parameters": [
  4579. {
  4580. "name": "directory",
  4581. "in": "query",
  4582. "required": false,
  4583. "schema": {
  4584. "type": "string"
  4585. }
  4586. },
  4587. {
  4588. "name": "workspace",
  4589. "in": "query",
  4590. "required": false,
  4591. "schema": {
  4592. "type": "string"
  4593. }
  4594. },
  4595. {
  4596. "name": "sessionID",
  4597. "in": "path",
  4598. "schema": {
  4599. "type": "string",
  4600. "pattern": "^ses.*"
  4601. },
  4602. "required": true
  4603. }
  4604. ],
  4605. "responses": {
  4606. "200": {
  4607. "description": "Get session",
  4608. "content": {
  4609. "application/json": {
  4610. "schema": {
  4611. "$ref": "#/components/schemas/Session"
  4612. }
  4613. }
  4614. }
  4615. },
  4616. "400": {
  4617. "description": "Bad request",
  4618. "content": {
  4619. "application/json": {
  4620. "schema": {
  4621. "$ref": "#/components/schemas/BadRequestError"
  4622. }
  4623. }
  4624. }
  4625. },
  4626. "404": {
  4627. "description": "NotFoundError",
  4628. "content": {
  4629. "application/json": {
  4630. "schema": {
  4631. "$ref": "#/components/schemas/NotFoundError"
  4632. }
  4633. }
  4634. }
  4635. }
  4636. },
  4637. "description": "Retrieve detailed information about a specific OpenCode session.",
  4638. "summary": "Get session",
  4639. "x-codeSamples": [
  4640. {
  4641. "lang": "js",
  4642. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.get({\n ...\n})"
  4643. }
  4644. ]
  4645. },
  4646. "delete": {
  4647. "tags": ["session"],
  4648. "operationId": "session.delete",
  4649. "parameters": [
  4650. {
  4651. "name": "directory",
  4652. "in": "query",
  4653. "required": false,
  4654. "schema": {
  4655. "type": "string"
  4656. }
  4657. },
  4658. {
  4659. "name": "workspace",
  4660. "in": "query",
  4661. "required": false,
  4662. "schema": {
  4663. "type": "string"
  4664. }
  4665. },
  4666. {
  4667. "name": "sessionID",
  4668. "in": "path",
  4669. "schema": {
  4670. "type": "string",
  4671. "pattern": "^ses.*"
  4672. },
  4673. "required": true
  4674. }
  4675. ],
  4676. "responses": {
  4677. "200": {
  4678. "description": "Successfully deleted session",
  4679. "content": {
  4680. "application/json": {
  4681. "schema": {
  4682. "type": "boolean",
  4683. "description": "Successfully deleted session"
  4684. }
  4685. }
  4686. }
  4687. },
  4688. "400": {
  4689. "description": "Bad request",
  4690. "content": {
  4691. "application/json": {
  4692. "schema": {
  4693. "$ref": "#/components/schemas/BadRequestError"
  4694. }
  4695. }
  4696. }
  4697. },
  4698. "404": {
  4699. "description": "NotFoundError",
  4700. "content": {
  4701. "application/json": {
  4702. "schema": {
  4703. "$ref": "#/components/schemas/NotFoundError"
  4704. }
  4705. }
  4706. }
  4707. }
  4708. },
  4709. "description": "Delete a session and permanently remove all associated data, including messages and history.",
  4710. "summary": "Delete session",
  4711. "x-codeSamples": [
  4712. {
  4713. "lang": "js",
  4714. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.delete({\n ...\n})"
  4715. }
  4716. ]
  4717. },
  4718. "patch": {
  4719. "tags": ["session"],
  4720. "operationId": "session.update",
  4721. "parameters": [
  4722. {
  4723. "name": "directory",
  4724. "in": "query",
  4725. "required": false,
  4726. "schema": {
  4727. "type": "string"
  4728. }
  4729. },
  4730. {
  4731. "name": "workspace",
  4732. "in": "query",
  4733. "required": false,
  4734. "schema": {
  4735. "type": "string"
  4736. }
  4737. },
  4738. {
  4739. "name": "sessionID",
  4740. "in": "path",
  4741. "schema": {
  4742. "type": "string",
  4743. "pattern": "^ses.*"
  4744. },
  4745. "required": true
  4746. }
  4747. ],
  4748. "responses": {
  4749. "200": {
  4750. "description": "Successfully updated session",
  4751. "content": {
  4752. "application/json": {
  4753. "schema": {
  4754. "$ref": "#/components/schemas/Session"
  4755. }
  4756. }
  4757. }
  4758. },
  4759. "400": {
  4760. "description": "Bad request",
  4761. "content": {
  4762. "application/json": {
  4763. "schema": {
  4764. "$ref": "#/components/schemas/BadRequestError"
  4765. }
  4766. }
  4767. }
  4768. },
  4769. "404": {
  4770. "description": "NotFoundError",
  4771. "content": {
  4772. "application/json": {
  4773. "schema": {
  4774. "$ref": "#/components/schemas/NotFoundError"
  4775. }
  4776. }
  4777. }
  4778. }
  4779. },
  4780. "description": "Update properties of an existing session, such as title or other metadata.",
  4781. "summary": "Update session",
  4782. "requestBody": {
  4783. "content": {
  4784. "application/json": {
  4785. "schema": {
  4786. "type": "object",
  4787. "properties": {
  4788. "title": {
  4789. "type": "string"
  4790. },
  4791. "permission": {
  4792. "$ref": "#/components/schemas/PermissionRuleset"
  4793. },
  4794. "time": {
  4795. "type": "object",
  4796. "properties": {
  4797. "archived": {
  4798. "type": "number"
  4799. }
  4800. },
  4801. "additionalProperties": false
  4802. }
  4803. },
  4804. "additionalProperties": false
  4805. }
  4806. }
  4807. }
  4808. },
  4809. "x-codeSamples": [
  4810. {
  4811. "lang": "js",
  4812. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.update({\n ...\n})"
  4813. }
  4814. ]
  4815. }
  4816. },
  4817. "/session/{sessionID}/children": {
  4818. "get": {
  4819. "tags": ["session"],
  4820. "operationId": "session.children",
  4821. "parameters": [
  4822. {
  4823. "name": "directory",
  4824. "in": "query",
  4825. "required": false,
  4826. "schema": {
  4827. "type": "string"
  4828. }
  4829. },
  4830. {
  4831. "name": "workspace",
  4832. "in": "query",
  4833. "required": false,
  4834. "schema": {
  4835. "type": "string"
  4836. }
  4837. },
  4838. {
  4839. "name": "sessionID",
  4840. "in": "path",
  4841. "schema": {
  4842. "type": "string",
  4843. "pattern": "^ses.*"
  4844. },
  4845. "required": true
  4846. }
  4847. ],
  4848. "responses": {
  4849. "200": {
  4850. "description": "List of children",
  4851. "content": {
  4852. "application/json": {
  4853. "schema": {
  4854. "type": "array",
  4855. "items": {
  4856. "$ref": "#/components/schemas/Session"
  4857. },
  4858. "description": "List of children"
  4859. }
  4860. }
  4861. }
  4862. },
  4863. "400": {
  4864. "description": "Bad request",
  4865. "content": {
  4866. "application/json": {
  4867. "schema": {
  4868. "$ref": "#/components/schemas/BadRequestError"
  4869. }
  4870. }
  4871. }
  4872. },
  4873. "404": {
  4874. "description": "Not found",
  4875. "content": {
  4876. "application/json": {
  4877. "schema": {
  4878. "$ref": "#/components/schemas/NotFoundError"
  4879. }
  4880. }
  4881. }
  4882. }
  4883. },
  4884. "description": "Retrieve all child sessions that were forked from the specified parent session.",
  4885. "summary": "Get session children",
  4886. "x-codeSamples": [
  4887. {
  4888. "lang": "js",
  4889. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.children({\n ...\n})"
  4890. }
  4891. ]
  4892. }
  4893. },
  4894. "/session/{sessionID}/todo": {
  4895. "get": {
  4896. "tags": ["session"],
  4897. "operationId": "session.todo",
  4898. "parameters": [
  4899. {
  4900. "name": "directory",
  4901. "in": "query",
  4902. "required": false,
  4903. "schema": {
  4904. "type": "string"
  4905. }
  4906. },
  4907. {
  4908. "name": "workspace",
  4909. "in": "query",
  4910. "required": false,
  4911. "schema": {
  4912. "type": "string"
  4913. }
  4914. },
  4915. {
  4916. "name": "sessionID",
  4917. "in": "path",
  4918. "schema": {
  4919. "type": "string",
  4920. "pattern": "^ses.*"
  4921. },
  4922. "required": true
  4923. }
  4924. ],
  4925. "responses": {
  4926. "200": {
  4927. "description": "Todo list",
  4928. "content": {
  4929. "application/json": {
  4930. "schema": {
  4931. "type": "array",
  4932. "items": {
  4933. "$ref": "#/components/schemas/Todo"
  4934. },
  4935. "description": "Todo list"
  4936. }
  4937. }
  4938. }
  4939. },
  4940. "400": {
  4941. "description": "Bad request",
  4942. "content": {
  4943. "application/json": {
  4944. "schema": {
  4945. "$ref": "#/components/schemas/BadRequestError"
  4946. }
  4947. }
  4948. }
  4949. },
  4950. "404": {
  4951. "description": "Not found",
  4952. "content": {
  4953. "application/json": {
  4954. "schema": {
  4955. "$ref": "#/components/schemas/NotFoundError"
  4956. }
  4957. }
  4958. }
  4959. }
  4960. },
  4961. "description": "Retrieve the todo list associated with a specific session, showing tasks and action items.",
  4962. "summary": "Get session todos",
  4963. "x-codeSamples": [
  4964. {
  4965. "lang": "js",
  4966. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.todo({\n ...\n})"
  4967. }
  4968. ]
  4969. }
  4970. },
  4971. "/session/{sessionID}/diff": {
  4972. "get": {
  4973. "tags": ["session"],
  4974. "operationId": "session.diff",
  4975. "parameters": [
  4976. {
  4977. "name": "directory",
  4978. "in": "query",
  4979. "required": false,
  4980. "schema": {
  4981. "type": "string"
  4982. }
  4983. },
  4984. {
  4985. "name": "workspace",
  4986. "in": "query",
  4987. "required": false,
  4988. "schema": {
  4989. "type": "string"
  4990. }
  4991. },
  4992. {
  4993. "name": "sessionID",
  4994. "in": "path",
  4995. "schema": {
  4996. "type": "string",
  4997. "pattern": "^ses.*"
  4998. },
  4999. "required": true
  5000. },
  5001. {
  5002. "name": "messageID",
  5003. "in": "query",
  5004. "schema": {
  5005. "type": "string",
  5006. "pattern": "^msg.*"
  5007. },
  5008. "required": false
  5009. }
  5010. ],
  5011. "responses": {
  5012. "200": {
  5013. "description": "Successfully retrieved diff",
  5014. "content": {
  5015. "application/json": {
  5016. "schema": {
  5017. "type": "array",
  5018. "items": {
  5019. "$ref": "#/components/schemas/SnapshotFileDiff"
  5020. },
  5021. "description": "Successfully retrieved diff"
  5022. }
  5023. }
  5024. }
  5025. }
  5026. },
  5027. "description": "Get the file changes (diff) that resulted from a specific user message in the session.",
  5028. "summary": "Get message diff",
  5029. "x-codeSamples": [
  5030. {
  5031. "lang": "js",
  5032. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.diff({\n ...\n})"
  5033. }
  5034. ]
  5035. }
  5036. },
  5037. "/session/{sessionID}/message": {
  5038. "get": {
  5039. "tags": ["session"],
  5040. "operationId": "session.messages",
  5041. "parameters": [
  5042. {
  5043. "name": "directory",
  5044. "in": "query",
  5045. "required": false,
  5046. "schema": {
  5047. "type": "string"
  5048. }
  5049. },
  5050. {
  5051. "name": "workspace",
  5052. "in": "query",
  5053. "required": false,
  5054. "schema": {
  5055. "type": "string"
  5056. }
  5057. },
  5058. {
  5059. "name": "sessionID",
  5060. "in": "path",
  5061. "schema": {
  5062. "type": "string",
  5063. "pattern": "^ses.*"
  5064. },
  5065. "required": true
  5066. },
  5067. {
  5068. "name": "limit",
  5069. "in": "query",
  5070. "schema": {
  5071. "type": "integer",
  5072. "minimum": 0,
  5073. "maximum": 9007199254740991
  5074. },
  5075. "required": false
  5076. },
  5077. {
  5078. "name": "before",
  5079. "in": "query",
  5080. "schema": {
  5081. "type": "string"
  5082. },
  5083. "required": false
  5084. }
  5085. ],
  5086. "responses": {
  5087. "200": {
  5088. "description": "List of messages",
  5089. "content": {
  5090. "application/json": {
  5091. "schema": {
  5092. "type": "array",
  5093. "items": {
  5094. "type": "object",
  5095. "properties": {
  5096. "info": {
  5097. "$ref": "#/components/schemas/Message"
  5098. },
  5099. "parts": {
  5100. "type": "array",
  5101. "items": {
  5102. "$ref": "#/components/schemas/Part"
  5103. }
  5104. }
  5105. },
  5106. "required": ["info", "parts"],
  5107. "additionalProperties": false
  5108. },
  5109. "description": "List of messages"
  5110. }
  5111. }
  5112. }
  5113. },
  5114. "400": {
  5115. "description": "Bad request",
  5116. "content": {
  5117. "application/json": {
  5118. "schema": {
  5119. "$ref": "#/components/schemas/BadRequestError"
  5120. }
  5121. }
  5122. }
  5123. },
  5124. "404": {
  5125. "description": "NotFoundError",
  5126. "content": {
  5127. "application/json": {
  5128. "schema": {
  5129. "$ref": "#/components/schemas/NotFoundError"
  5130. }
  5131. }
  5132. }
  5133. }
  5134. },
  5135. "description": "Retrieve all messages in a session, including user prompts and AI responses.",
  5136. "summary": "Get session messages",
  5137. "x-codeSamples": [
  5138. {
  5139. "lang": "js",
  5140. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.messages({\n ...\n})"
  5141. }
  5142. ]
  5143. },
  5144. "post": {
  5145. "tags": ["session"],
  5146. "operationId": "session.prompt",
  5147. "parameters": [
  5148. {
  5149. "name": "directory",
  5150. "in": "query",
  5151. "required": false,
  5152. "schema": {
  5153. "type": "string"
  5154. }
  5155. },
  5156. {
  5157. "name": "workspace",
  5158. "in": "query",
  5159. "required": false,
  5160. "schema": {
  5161. "type": "string"
  5162. }
  5163. },
  5164. {
  5165. "name": "sessionID",
  5166. "in": "path",
  5167. "schema": {
  5168. "type": "string",
  5169. "pattern": "^ses.*"
  5170. },
  5171. "required": true
  5172. }
  5173. ],
  5174. "responses": {
  5175. "200": {
  5176. "description": "Created message",
  5177. "content": {
  5178. "application/json": {
  5179. "schema": {
  5180. "type": "object",
  5181. "required": ["info", "parts"],
  5182. "properties": {
  5183. "info": {
  5184. "$ref": "#/components/schemas/AssistantMessage"
  5185. },
  5186. "parts": {
  5187. "type": "array",
  5188. "items": {
  5189. "$ref": "#/components/schemas/Part"
  5190. }
  5191. }
  5192. }
  5193. }
  5194. }
  5195. }
  5196. },
  5197. "400": {
  5198. "description": "Bad request",
  5199. "content": {
  5200. "application/json": {
  5201. "schema": {
  5202. "$ref": "#/components/schemas/BadRequestError"
  5203. }
  5204. }
  5205. }
  5206. },
  5207. "404": {
  5208. "description": "Not found",
  5209. "content": {
  5210. "application/json": {
  5211. "schema": {
  5212. "$ref": "#/components/schemas/NotFoundError"
  5213. }
  5214. }
  5215. }
  5216. }
  5217. },
  5218. "description": "Create and send a new message to a session, streaming the AI response.",
  5219. "summary": "Send message",
  5220. "requestBody": {
  5221. "content": {
  5222. "application/json": {
  5223. "schema": {
  5224. "type": "object",
  5225. "properties": {
  5226. "messageID": {
  5227. "type": "string"
  5228. },
  5229. "model": {
  5230. "type": "object",
  5231. "properties": {
  5232. "providerID": {
  5233. "type": "string"
  5234. },
  5235. "modelID": {
  5236. "type": "string"
  5237. }
  5238. },
  5239. "required": ["providerID", "modelID"],
  5240. "additionalProperties": false
  5241. },
  5242. "agent": {
  5243. "type": "string"
  5244. },
  5245. "noReply": {
  5246. "type": "boolean"
  5247. },
  5248. "tools": {
  5249. "type": "object",
  5250. "additionalProperties": {
  5251. "type": "boolean"
  5252. }
  5253. },
  5254. "format": {
  5255. "$ref": "#/components/schemas/OutputFormat"
  5256. },
  5257. "system": {
  5258. "type": "string"
  5259. },
  5260. "variant": {
  5261. "type": "string"
  5262. },
  5263. "parts": {
  5264. "type": "array",
  5265. "items": {
  5266. "anyOf": [
  5267. {
  5268. "$ref": "#/components/schemas/TextPartInput"
  5269. },
  5270. {
  5271. "$ref": "#/components/schemas/FilePartInput"
  5272. },
  5273. {
  5274. "$ref": "#/components/schemas/AgentPartInput"
  5275. },
  5276. {
  5277. "$ref": "#/components/schemas/SubtaskPartInput"
  5278. }
  5279. ]
  5280. }
  5281. }
  5282. },
  5283. "required": ["parts"],
  5284. "additionalProperties": false
  5285. }
  5286. }
  5287. }
  5288. },
  5289. "x-codeSamples": [
  5290. {
  5291. "lang": "js",
  5292. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.prompt({\n ...\n})"
  5293. }
  5294. ]
  5295. }
  5296. },
  5297. "/session/{sessionID}/message/{messageID}": {
  5298. "get": {
  5299. "tags": ["session"],
  5300. "operationId": "session.message",
  5301. "parameters": [
  5302. {
  5303. "name": "directory",
  5304. "in": "query",
  5305. "required": false,
  5306. "schema": {
  5307. "type": "string"
  5308. }
  5309. },
  5310. {
  5311. "name": "workspace",
  5312. "in": "query",
  5313. "required": false,
  5314. "schema": {
  5315. "type": "string"
  5316. }
  5317. },
  5318. {
  5319. "name": "sessionID",
  5320. "in": "path",
  5321. "schema": {
  5322. "type": "string",
  5323. "pattern": "^ses.*"
  5324. },
  5325. "required": true
  5326. },
  5327. {
  5328. "name": "messageID",
  5329. "in": "path",
  5330. "schema": {
  5331. "type": "string",
  5332. "pattern": "^msg.*"
  5333. },
  5334. "required": true
  5335. }
  5336. ],
  5337. "responses": {
  5338. "200": {
  5339. "description": "Message",
  5340. "content": {
  5341. "application/json": {
  5342. "schema": {
  5343. "type": "object",
  5344. "properties": {
  5345. "info": {
  5346. "$ref": "#/components/schemas/Message"
  5347. },
  5348. "parts": {
  5349. "type": "array",
  5350. "items": {
  5351. "$ref": "#/components/schemas/Part"
  5352. }
  5353. }
  5354. },
  5355. "required": ["info", "parts"],
  5356. "additionalProperties": false,
  5357. "description": "Message"
  5358. }
  5359. }
  5360. }
  5361. },
  5362. "400": {
  5363. "description": "Bad request",
  5364. "content": {
  5365. "application/json": {
  5366. "schema": {
  5367. "$ref": "#/components/schemas/BadRequestError"
  5368. }
  5369. }
  5370. }
  5371. },
  5372. "404": {
  5373. "description": "NotFoundError",
  5374. "content": {
  5375. "application/json": {
  5376. "schema": {
  5377. "$ref": "#/components/schemas/NotFoundError"
  5378. }
  5379. }
  5380. }
  5381. }
  5382. },
  5383. "description": "Retrieve a specific message from a session by its message ID.",
  5384. "summary": "Get message",
  5385. "x-codeSamples": [
  5386. {
  5387. "lang": "js",
  5388. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.message({\n ...\n})"
  5389. }
  5390. ]
  5391. },
  5392. "delete": {
  5393. "tags": ["session"],
  5394. "operationId": "session.deleteMessage",
  5395. "parameters": [
  5396. {
  5397. "name": "directory",
  5398. "in": "query",
  5399. "required": false,
  5400. "schema": {
  5401. "type": "string"
  5402. }
  5403. },
  5404. {
  5405. "name": "workspace",
  5406. "in": "query",
  5407. "required": false,
  5408. "schema": {
  5409. "type": "string"
  5410. }
  5411. },
  5412. {
  5413. "name": "sessionID",
  5414. "in": "path",
  5415. "schema": {
  5416. "type": "string",
  5417. "pattern": "^ses.*"
  5418. },
  5419. "required": true
  5420. },
  5421. {
  5422. "name": "messageID",
  5423. "in": "path",
  5424. "schema": {
  5425. "type": "string",
  5426. "pattern": "^msg.*"
  5427. },
  5428. "required": true
  5429. }
  5430. ],
  5431. "responses": {
  5432. "200": {
  5433. "description": "Successfully deleted message",
  5434. "content": {
  5435. "application/json": {
  5436. "schema": {
  5437. "type": "boolean",
  5438. "description": "Successfully deleted message"
  5439. }
  5440. }
  5441. }
  5442. },
  5443. "400": {
  5444. "description": "Bad request",
  5445. "content": {
  5446. "application/json": {
  5447. "schema": {
  5448. "$ref": "#/components/schemas/BadRequestError"
  5449. }
  5450. }
  5451. }
  5452. },
  5453. "404": {
  5454. "description": "Not found",
  5455. "content": {
  5456. "application/json": {
  5457. "schema": {
  5458. "$ref": "#/components/schemas/NotFoundError"
  5459. }
  5460. }
  5461. }
  5462. }
  5463. },
  5464. "description": "Permanently delete a specific message and all of its parts from a session without reverting file changes.",
  5465. "summary": "Delete message",
  5466. "x-codeSamples": [
  5467. {
  5468. "lang": "js",
  5469. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.deleteMessage({\n ...\n})"
  5470. }
  5471. ]
  5472. }
  5473. },
  5474. "/session/{sessionID}/fork": {
  5475. "post": {
  5476. "tags": ["session"],
  5477. "operationId": "session.fork",
  5478. "parameters": [
  5479. {
  5480. "name": "directory",
  5481. "in": "query",
  5482. "required": false,
  5483. "schema": {
  5484. "type": "string"
  5485. }
  5486. },
  5487. {
  5488. "name": "workspace",
  5489. "in": "query",
  5490. "required": false,
  5491. "schema": {
  5492. "type": "string"
  5493. }
  5494. },
  5495. {
  5496. "name": "sessionID",
  5497. "in": "path",
  5498. "schema": {
  5499. "type": "string",
  5500. "pattern": "^ses.*"
  5501. },
  5502. "required": true
  5503. }
  5504. ],
  5505. "responses": {
  5506. "200": {
  5507. "description": "200",
  5508. "content": {
  5509. "application/json": {
  5510. "schema": {
  5511. "$ref": "#/components/schemas/Session"
  5512. }
  5513. }
  5514. }
  5515. },
  5516. "404": {
  5517. "description": "NotFoundError",
  5518. "content": {
  5519. "application/json": {
  5520. "schema": {
  5521. "$ref": "#/components/schemas/NotFoundError"
  5522. }
  5523. }
  5524. }
  5525. }
  5526. },
  5527. "description": "Create a new session by forking an existing session at a specific message point.",
  5528. "summary": "Fork session",
  5529. "requestBody": {
  5530. "content": {
  5531. "application/json": {
  5532. "schema": {
  5533. "type": "object",
  5534. "properties": {
  5535. "messageID": {
  5536. "type": "string"
  5537. }
  5538. },
  5539. "additionalProperties": false
  5540. }
  5541. }
  5542. }
  5543. },
  5544. "x-codeSamples": [
  5545. {
  5546. "lang": "js",
  5547. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.fork({\n ...\n})"
  5548. }
  5549. ]
  5550. }
  5551. },
  5552. "/session/{sessionID}/abort": {
  5553. "post": {
  5554. "tags": ["session"],
  5555. "operationId": "session.abort",
  5556. "parameters": [
  5557. {
  5558. "name": "directory",
  5559. "in": "query",
  5560. "required": false,
  5561. "schema": {
  5562. "type": "string"
  5563. }
  5564. },
  5565. {
  5566. "name": "workspace",
  5567. "in": "query",
  5568. "required": false,
  5569. "schema": {
  5570. "type": "string"
  5571. }
  5572. },
  5573. {
  5574. "name": "sessionID",
  5575. "in": "path",
  5576. "schema": {
  5577. "type": "string",
  5578. "pattern": "^ses.*"
  5579. },
  5580. "required": true
  5581. }
  5582. ],
  5583. "responses": {
  5584. "200": {
  5585. "description": "Aborted session",
  5586. "content": {
  5587. "application/json": {
  5588. "schema": {
  5589. "type": "boolean",
  5590. "description": "Aborted session"
  5591. }
  5592. }
  5593. }
  5594. },
  5595. "400": {
  5596. "description": "Bad request",
  5597. "content": {
  5598. "application/json": {
  5599. "schema": {
  5600. "$ref": "#/components/schemas/BadRequestError"
  5601. }
  5602. }
  5603. }
  5604. },
  5605. "404": {
  5606. "description": "Not found",
  5607. "content": {
  5608. "application/json": {
  5609. "schema": {
  5610. "$ref": "#/components/schemas/NotFoundError"
  5611. }
  5612. }
  5613. }
  5614. }
  5615. },
  5616. "description": "Abort an active session and stop any ongoing AI processing or command execution.",
  5617. "summary": "Abort session",
  5618. "x-codeSamples": [
  5619. {
  5620. "lang": "js",
  5621. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.abort({\n ...\n})"
  5622. }
  5623. ]
  5624. }
  5625. },
  5626. "/session/{sessionID}/init": {
  5627. "post": {
  5628. "tags": ["session"],
  5629. "operationId": "session.init",
  5630. "parameters": [
  5631. {
  5632. "name": "directory",
  5633. "in": "query",
  5634. "required": false,
  5635. "schema": {
  5636. "type": "string"
  5637. }
  5638. },
  5639. {
  5640. "name": "workspace",
  5641. "in": "query",
  5642. "required": false,
  5643. "schema": {
  5644. "type": "string"
  5645. }
  5646. },
  5647. {
  5648. "name": "sessionID",
  5649. "in": "path",
  5650. "schema": {
  5651. "type": "string",
  5652. "pattern": "^ses.*"
  5653. },
  5654. "required": true
  5655. }
  5656. ],
  5657. "responses": {
  5658. "200": {
  5659. "description": "200",
  5660. "content": {
  5661. "application/json": {
  5662. "schema": {
  5663. "type": "boolean",
  5664. "description": "200"
  5665. }
  5666. }
  5667. }
  5668. },
  5669. "400": {
  5670. "description": "Bad request",
  5671. "content": {
  5672. "application/json": {
  5673. "schema": {
  5674. "$ref": "#/components/schemas/BadRequestError"
  5675. }
  5676. }
  5677. }
  5678. },
  5679. "404": {
  5680. "description": "Not found",
  5681. "content": {
  5682. "application/json": {
  5683. "schema": {
  5684. "$ref": "#/components/schemas/NotFoundError"
  5685. }
  5686. }
  5687. }
  5688. }
  5689. },
  5690. "description": "Analyze the current application and create an AGENTS.md file with project-specific agent configurations.",
  5691. "summary": "Initialize session",
  5692. "requestBody": {
  5693. "content": {
  5694. "application/json": {
  5695. "schema": {
  5696. "type": "object",
  5697. "properties": {
  5698. "modelID": {
  5699. "type": "string"
  5700. },
  5701. "providerID": {
  5702. "type": "string"
  5703. },
  5704. "messageID": {
  5705. "type": "string"
  5706. }
  5707. },
  5708. "required": ["modelID", "providerID", "messageID"],
  5709. "additionalProperties": false
  5710. }
  5711. }
  5712. }
  5713. },
  5714. "x-codeSamples": [
  5715. {
  5716. "lang": "js",
  5717. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.init({\n ...\n})"
  5718. }
  5719. ]
  5720. }
  5721. },
  5722. "/session/{sessionID}/share": {
  5723. "post": {
  5724. "tags": ["session"],
  5725. "operationId": "session.share",
  5726. "parameters": [
  5727. {
  5728. "name": "directory",
  5729. "in": "query",
  5730. "required": false,
  5731. "schema": {
  5732. "type": "string"
  5733. }
  5734. },
  5735. {
  5736. "name": "workspace",
  5737. "in": "query",
  5738. "required": false,
  5739. "schema": {
  5740. "type": "string"
  5741. }
  5742. },
  5743. {
  5744. "name": "sessionID",
  5745. "in": "path",
  5746. "schema": {
  5747. "type": "string",
  5748. "pattern": "^ses.*"
  5749. },
  5750. "required": true
  5751. }
  5752. ],
  5753. "responses": {
  5754. "200": {
  5755. "description": "Successfully shared session",
  5756. "content": {
  5757. "application/json": {
  5758. "schema": {
  5759. "$ref": "#/components/schemas/Session"
  5760. }
  5761. }
  5762. }
  5763. },
  5764. "400": {
  5765. "description": "Bad request",
  5766. "content": {
  5767. "application/json": {
  5768. "schema": {
  5769. "$ref": "#/components/schemas/BadRequestError"
  5770. }
  5771. }
  5772. }
  5773. },
  5774. "404": {
  5775. "description": "NotFoundError",
  5776. "content": {
  5777. "application/json": {
  5778. "schema": {
  5779. "$ref": "#/components/schemas/NotFoundError"
  5780. }
  5781. }
  5782. }
  5783. }
  5784. },
  5785. "description": "Create a shareable link for a session, allowing others to view the conversation.",
  5786. "summary": "Share session",
  5787. "x-codeSamples": [
  5788. {
  5789. "lang": "js",
  5790. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.share({\n ...\n})"
  5791. }
  5792. ]
  5793. },
  5794. "delete": {
  5795. "tags": ["session"],
  5796. "operationId": "session.unshare",
  5797. "parameters": [
  5798. {
  5799. "name": "directory",
  5800. "in": "query",
  5801. "required": false,
  5802. "schema": {
  5803. "type": "string"
  5804. }
  5805. },
  5806. {
  5807. "name": "workspace",
  5808. "in": "query",
  5809. "required": false,
  5810. "schema": {
  5811. "type": "string"
  5812. }
  5813. },
  5814. {
  5815. "name": "sessionID",
  5816. "in": "path",
  5817. "schema": {
  5818. "type": "string",
  5819. "pattern": "^ses.*"
  5820. },
  5821. "required": true
  5822. }
  5823. ],
  5824. "responses": {
  5825. "200": {
  5826. "description": "Successfully unshared session",
  5827. "content": {
  5828. "application/json": {
  5829. "schema": {
  5830. "$ref": "#/components/schemas/Session"
  5831. }
  5832. }
  5833. }
  5834. },
  5835. "400": {
  5836. "description": "Bad request",
  5837. "content": {
  5838. "application/json": {
  5839. "schema": {
  5840. "$ref": "#/components/schemas/BadRequestError"
  5841. }
  5842. }
  5843. }
  5844. },
  5845. "404": {
  5846. "description": "NotFoundError",
  5847. "content": {
  5848. "application/json": {
  5849. "schema": {
  5850. "$ref": "#/components/schemas/NotFoundError"
  5851. }
  5852. }
  5853. }
  5854. }
  5855. },
  5856. "description": "Remove the shareable link for a session, making it private again.",
  5857. "summary": "Unshare session",
  5858. "x-codeSamples": [
  5859. {
  5860. "lang": "js",
  5861. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.unshare({\n ...\n})"
  5862. }
  5863. ]
  5864. }
  5865. },
  5866. "/session/{sessionID}/summarize": {
  5867. "post": {
  5868. "tags": ["session"],
  5869. "operationId": "session.summarize",
  5870. "parameters": [
  5871. {
  5872. "name": "directory",
  5873. "in": "query",
  5874. "required": false,
  5875. "schema": {
  5876. "type": "string"
  5877. }
  5878. },
  5879. {
  5880. "name": "workspace",
  5881. "in": "query",
  5882. "required": false,
  5883. "schema": {
  5884. "type": "string"
  5885. }
  5886. },
  5887. {
  5888. "name": "sessionID",
  5889. "in": "path",
  5890. "schema": {
  5891. "type": "string",
  5892. "pattern": "^ses.*"
  5893. },
  5894. "required": true
  5895. }
  5896. ],
  5897. "responses": {
  5898. "200": {
  5899. "description": "Summarized session",
  5900. "content": {
  5901. "application/json": {
  5902. "schema": {
  5903. "type": "boolean",
  5904. "description": "Summarized session"
  5905. }
  5906. }
  5907. }
  5908. },
  5909. "400": {
  5910. "description": "Bad request",
  5911. "content": {
  5912. "application/json": {
  5913. "schema": {
  5914. "$ref": "#/components/schemas/BadRequestError"
  5915. }
  5916. }
  5917. }
  5918. },
  5919. "404": {
  5920. "description": "NotFoundError",
  5921. "content": {
  5922. "application/json": {
  5923. "schema": {
  5924. "$ref": "#/components/schemas/NotFoundError"
  5925. }
  5926. }
  5927. }
  5928. }
  5929. },
  5930. "description": "Generate a concise summary of the session using AI compaction to preserve key information.",
  5931. "summary": "Summarize session",
  5932. "requestBody": {
  5933. "content": {
  5934. "application/json": {
  5935. "schema": {
  5936. "type": "object",
  5937. "properties": {
  5938. "providerID": {
  5939. "type": "string"
  5940. },
  5941. "modelID": {
  5942. "type": "string"
  5943. },
  5944. "auto": {
  5945. "type": "boolean"
  5946. }
  5947. },
  5948. "required": ["providerID", "modelID"],
  5949. "additionalProperties": false
  5950. }
  5951. }
  5952. }
  5953. },
  5954. "x-codeSamples": [
  5955. {
  5956. "lang": "js",
  5957. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.summarize({\n ...\n})"
  5958. }
  5959. ]
  5960. }
  5961. },
  5962. "/session/{sessionID}/prompt_async": {
  5963. "post": {
  5964. "tags": ["session"],
  5965. "operationId": "session.prompt_async",
  5966. "parameters": [
  5967. {
  5968. "name": "directory",
  5969. "in": "query",
  5970. "required": false,
  5971. "schema": {
  5972. "type": "string"
  5973. }
  5974. },
  5975. {
  5976. "name": "workspace",
  5977. "in": "query",
  5978. "required": false,
  5979. "schema": {
  5980. "type": "string"
  5981. }
  5982. },
  5983. {
  5984. "name": "sessionID",
  5985. "in": "path",
  5986. "schema": {
  5987. "type": "string",
  5988. "pattern": "^ses.*"
  5989. },
  5990. "required": true
  5991. }
  5992. ],
  5993. "responses": {
  5994. "204": {
  5995. "description": "Prompt accepted"
  5996. },
  5997. "400": {
  5998. "description": "Bad request",
  5999. "content": {
  6000. "application/json": {
  6001. "schema": {
  6002. "$ref": "#/components/schemas/BadRequestError"
  6003. }
  6004. }
  6005. }
  6006. },
  6007. "404": {
  6008. "description": "Not found",
  6009. "content": {
  6010. "application/json": {
  6011. "schema": {
  6012. "$ref": "#/components/schemas/NotFoundError"
  6013. }
  6014. }
  6015. }
  6016. }
  6017. },
  6018. "description": "Create and send a new message to a session asynchronously, starting the session if needed and returning immediately.",
  6019. "summary": "Send async message",
  6020. "requestBody": {
  6021. "content": {
  6022. "application/json": {
  6023. "schema": {
  6024. "type": "object",
  6025. "properties": {
  6026. "messageID": {
  6027. "type": "string"
  6028. },
  6029. "model": {
  6030. "type": "object",
  6031. "properties": {
  6032. "providerID": {
  6033. "type": "string"
  6034. },
  6035. "modelID": {
  6036. "type": "string"
  6037. }
  6038. },
  6039. "required": ["providerID", "modelID"],
  6040. "additionalProperties": false
  6041. },
  6042. "agent": {
  6043. "type": "string"
  6044. },
  6045. "noReply": {
  6046. "type": "boolean"
  6047. },
  6048. "tools": {
  6049. "type": "object",
  6050. "additionalProperties": {
  6051. "type": "boolean"
  6052. }
  6053. },
  6054. "format": {
  6055. "$ref": "#/components/schemas/OutputFormat"
  6056. },
  6057. "system": {
  6058. "type": "string"
  6059. },
  6060. "variant": {
  6061. "type": "string"
  6062. },
  6063. "parts": {
  6064. "type": "array",
  6065. "items": {
  6066. "anyOf": [
  6067. {
  6068. "$ref": "#/components/schemas/TextPartInput"
  6069. },
  6070. {
  6071. "$ref": "#/components/schemas/FilePartInput"
  6072. },
  6073. {
  6074. "$ref": "#/components/schemas/AgentPartInput"
  6075. },
  6076. {
  6077. "$ref": "#/components/schemas/SubtaskPartInput"
  6078. }
  6079. ]
  6080. }
  6081. }
  6082. },
  6083. "required": ["parts"],
  6084. "additionalProperties": false
  6085. }
  6086. }
  6087. }
  6088. },
  6089. "x-codeSamples": [
  6090. {
  6091. "lang": "js",
  6092. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.prompt_async({\n ...\n})"
  6093. }
  6094. ]
  6095. }
  6096. },
  6097. "/session/{sessionID}/command": {
  6098. "post": {
  6099. "tags": ["session"],
  6100. "operationId": "session.command",
  6101. "parameters": [
  6102. {
  6103. "name": "directory",
  6104. "in": "query",
  6105. "required": false,
  6106. "schema": {
  6107. "type": "string"
  6108. }
  6109. },
  6110. {
  6111. "name": "workspace",
  6112. "in": "query",
  6113. "required": false,
  6114. "schema": {
  6115. "type": "string"
  6116. }
  6117. },
  6118. {
  6119. "name": "sessionID",
  6120. "in": "path",
  6121. "schema": {
  6122. "type": "string",
  6123. "pattern": "^ses.*"
  6124. },
  6125. "required": true
  6126. }
  6127. ],
  6128. "responses": {
  6129. "200": {
  6130. "description": "Created message",
  6131. "content": {
  6132. "application/json": {
  6133. "schema": {
  6134. "type": "object",
  6135. "required": ["info", "parts"],
  6136. "properties": {
  6137. "info": {
  6138. "$ref": "#/components/schemas/AssistantMessage"
  6139. },
  6140. "parts": {
  6141. "type": "array",
  6142. "items": {
  6143. "$ref": "#/components/schemas/Part"
  6144. }
  6145. }
  6146. }
  6147. }
  6148. }
  6149. }
  6150. },
  6151. "400": {
  6152. "description": "Bad request",
  6153. "content": {
  6154. "application/json": {
  6155. "schema": {
  6156. "$ref": "#/components/schemas/BadRequestError"
  6157. }
  6158. }
  6159. }
  6160. },
  6161. "404": {
  6162. "description": "Not found",
  6163. "content": {
  6164. "application/json": {
  6165. "schema": {
  6166. "$ref": "#/components/schemas/NotFoundError"
  6167. }
  6168. }
  6169. }
  6170. }
  6171. },
  6172. "description": "Send a new command to a session for execution by the AI assistant.",
  6173. "summary": "Send command",
  6174. "requestBody": {
  6175. "content": {
  6176. "application/json": {
  6177. "schema": {
  6178. "type": "object",
  6179. "properties": {
  6180. "messageID": {
  6181. "type": "string"
  6182. },
  6183. "agent": {
  6184. "type": "string"
  6185. },
  6186. "model": {
  6187. "type": "string"
  6188. },
  6189. "arguments": {
  6190. "type": "string"
  6191. },
  6192. "command": {
  6193. "type": "string"
  6194. },
  6195. "variant": {
  6196. "type": "string"
  6197. },
  6198. "parts": {
  6199. "type": "array",
  6200. "items": {
  6201. "type": "object",
  6202. "properties": {
  6203. "id": {
  6204. "type": "string"
  6205. },
  6206. "type": {
  6207. "type": "string",
  6208. "enum": ["file"]
  6209. },
  6210. "mime": {
  6211. "type": "string"
  6212. },
  6213. "filename": {
  6214. "type": "string"
  6215. },
  6216. "url": {
  6217. "type": "string"
  6218. },
  6219. "source": {
  6220. "$ref": "#/components/schemas/FilePartSource"
  6221. }
  6222. },
  6223. "required": ["type", "mime", "url"],
  6224. "additionalProperties": false
  6225. }
  6226. }
  6227. },
  6228. "required": ["arguments", "command"],
  6229. "additionalProperties": false
  6230. }
  6231. }
  6232. }
  6233. },
  6234. "x-codeSamples": [
  6235. {
  6236. "lang": "js",
  6237. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.command({\n ...\n})"
  6238. }
  6239. ]
  6240. }
  6241. },
  6242. "/session/{sessionID}/shell": {
  6243. "post": {
  6244. "tags": ["session"],
  6245. "operationId": "session.shell",
  6246. "parameters": [
  6247. {
  6248. "name": "directory",
  6249. "in": "query",
  6250. "required": false,
  6251. "schema": {
  6252. "type": "string"
  6253. }
  6254. },
  6255. {
  6256. "name": "workspace",
  6257. "in": "query",
  6258. "required": false,
  6259. "schema": {
  6260. "type": "string"
  6261. }
  6262. },
  6263. {
  6264. "name": "sessionID",
  6265. "in": "path",
  6266. "schema": {
  6267. "type": "string",
  6268. "pattern": "^ses.*"
  6269. },
  6270. "required": true
  6271. }
  6272. ],
  6273. "responses": {
  6274. "200": {
  6275. "description": "Created message",
  6276. "content": {
  6277. "application/json": {
  6278. "schema": {
  6279. "type": "object",
  6280. "properties": {
  6281. "info": {
  6282. "$ref": "#/components/schemas/Message"
  6283. },
  6284. "parts": {
  6285. "type": "array",
  6286. "items": {
  6287. "$ref": "#/components/schemas/Part"
  6288. }
  6289. }
  6290. },
  6291. "required": ["info", "parts"],
  6292. "additionalProperties": false,
  6293. "description": "Created message"
  6294. }
  6295. }
  6296. }
  6297. },
  6298. "400": {
  6299. "description": "Bad request",
  6300. "content": {
  6301. "application/json": {
  6302. "schema": {
  6303. "$ref": "#/components/schemas/BadRequestError"
  6304. }
  6305. }
  6306. }
  6307. },
  6308. "404": {
  6309. "description": "Not found",
  6310. "content": {
  6311. "application/json": {
  6312. "schema": {
  6313. "$ref": "#/components/schemas/NotFoundError"
  6314. }
  6315. }
  6316. }
  6317. }
  6318. },
  6319. "description": "Execute a shell command within the session context and return the AI's response.",
  6320. "summary": "Run shell command",
  6321. "requestBody": {
  6322. "content": {
  6323. "application/json": {
  6324. "schema": {
  6325. "type": "object",
  6326. "properties": {
  6327. "messageID": {
  6328. "type": "string"
  6329. },
  6330. "agent": {
  6331. "type": "string"
  6332. },
  6333. "model": {
  6334. "type": "object",
  6335. "properties": {
  6336. "providerID": {
  6337. "type": "string"
  6338. },
  6339. "modelID": {
  6340. "type": "string"
  6341. }
  6342. },
  6343. "required": ["providerID", "modelID"],
  6344. "additionalProperties": false
  6345. },
  6346. "command": {
  6347. "type": "string"
  6348. }
  6349. },
  6350. "required": ["agent", "command"],
  6351. "additionalProperties": false
  6352. }
  6353. }
  6354. }
  6355. },
  6356. "x-codeSamples": [
  6357. {
  6358. "lang": "js",
  6359. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.shell({\n ...\n})"
  6360. }
  6361. ]
  6362. }
  6363. },
  6364. "/session/{sessionID}/revert": {
  6365. "post": {
  6366. "tags": ["session"],
  6367. "operationId": "session.revert",
  6368. "parameters": [
  6369. {
  6370. "name": "directory",
  6371. "in": "query",
  6372. "required": false,
  6373. "schema": {
  6374. "type": "string"
  6375. }
  6376. },
  6377. {
  6378. "name": "workspace",
  6379. "in": "query",
  6380. "required": false,
  6381. "schema": {
  6382. "type": "string"
  6383. }
  6384. },
  6385. {
  6386. "name": "sessionID",
  6387. "in": "path",
  6388. "schema": {
  6389. "type": "string",
  6390. "pattern": "^ses.*"
  6391. },
  6392. "required": true
  6393. }
  6394. ],
  6395. "responses": {
  6396. "200": {
  6397. "description": "Updated session",
  6398. "content": {
  6399. "application/json": {
  6400. "schema": {
  6401. "$ref": "#/components/schemas/Session"
  6402. }
  6403. }
  6404. }
  6405. },
  6406. "400": {
  6407. "description": "Bad request",
  6408. "content": {
  6409. "application/json": {
  6410. "schema": {
  6411. "$ref": "#/components/schemas/BadRequestError"
  6412. }
  6413. }
  6414. }
  6415. },
  6416. "404": {
  6417. "description": "Not found",
  6418. "content": {
  6419. "application/json": {
  6420. "schema": {
  6421. "$ref": "#/components/schemas/NotFoundError"
  6422. }
  6423. }
  6424. }
  6425. }
  6426. },
  6427. "description": "Revert a specific message in a session, undoing its effects and restoring the previous state.",
  6428. "summary": "Revert message",
  6429. "requestBody": {
  6430. "content": {
  6431. "application/json": {
  6432. "schema": {
  6433. "type": "object",
  6434. "properties": {
  6435. "messageID": {
  6436. "type": "string"
  6437. },
  6438. "partID": {
  6439. "type": "string"
  6440. }
  6441. },
  6442. "required": ["messageID"],
  6443. "additionalProperties": false
  6444. }
  6445. }
  6446. }
  6447. },
  6448. "x-codeSamples": [
  6449. {
  6450. "lang": "js",
  6451. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.revert({\n ...\n})"
  6452. }
  6453. ]
  6454. }
  6455. },
  6456. "/session/{sessionID}/unrevert": {
  6457. "post": {
  6458. "tags": ["session"],
  6459. "operationId": "session.unrevert",
  6460. "parameters": [
  6461. {
  6462. "name": "directory",
  6463. "in": "query",
  6464. "required": false,
  6465. "schema": {
  6466. "type": "string"
  6467. }
  6468. },
  6469. {
  6470. "name": "workspace",
  6471. "in": "query",
  6472. "required": false,
  6473. "schema": {
  6474. "type": "string"
  6475. }
  6476. },
  6477. {
  6478. "name": "sessionID",
  6479. "in": "path",
  6480. "schema": {
  6481. "type": "string",
  6482. "pattern": "^ses.*"
  6483. },
  6484. "required": true
  6485. }
  6486. ],
  6487. "responses": {
  6488. "200": {
  6489. "description": "Updated session",
  6490. "content": {
  6491. "application/json": {
  6492. "schema": {
  6493. "$ref": "#/components/schemas/Session"
  6494. }
  6495. }
  6496. }
  6497. },
  6498. "400": {
  6499. "description": "Bad request",
  6500. "content": {
  6501. "application/json": {
  6502. "schema": {
  6503. "$ref": "#/components/schemas/BadRequestError"
  6504. }
  6505. }
  6506. }
  6507. },
  6508. "404": {
  6509. "description": "Not found",
  6510. "content": {
  6511. "application/json": {
  6512. "schema": {
  6513. "$ref": "#/components/schemas/NotFoundError"
  6514. }
  6515. }
  6516. }
  6517. }
  6518. },
  6519. "description": "Restore all previously reverted messages in a session.",
  6520. "summary": "Restore reverted messages",
  6521. "x-codeSamples": [
  6522. {
  6523. "lang": "js",
  6524. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.unrevert({\n ...\n})"
  6525. }
  6526. ]
  6527. }
  6528. },
  6529. "/session/{sessionID}/permissions/{permissionID}": {
  6530. "post": {
  6531. "tags": ["session"],
  6532. "operationId": "permission.respond",
  6533. "parameters": [
  6534. {
  6535. "name": "directory",
  6536. "in": "query",
  6537. "required": false,
  6538. "schema": {
  6539. "type": "string"
  6540. }
  6541. },
  6542. {
  6543. "name": "workspace",
  6544. "in": "query",
  6545. "required": false,
  6546. "schema": {
  6547. "type": "string"
  6548. }
  6549. },
  6550. {
  6551. "name": "sessionID",
  6552. "in": "path",
  6553. "schema": {
  6554. "type": "string",
  6555. "pattern": "^ses.*"
  6556. },
  6557. "required": true
  6558. },
  6559. {
  6560. "name": "permissionID",
  6561. "in": "path",
  6562. "schema": {
  6563. "type": "string",
  6564. "pattern": "^per.*"
  6565. },
  6566. "required": true
  6567. }
  6568. ],
  6569. "responses": {
  6570. "200": {
  6571. "description": "Permission processed successfully",
  6572. "content": {
  6573. "application/json": {
  6574. "schema": {
  6575. "type": "boolean",
  6576. "description": "Permission processed successfully"
  6577. }
  6578. }
  6579. }
  6580. },
  6581. "400": {
  6582. "description": "Bad request",
  6583. "content": {
  6584. "application/json": {
  6585. "schema": {
  6586. "$ref": "#/components/schemas/BadRequestError"
  6587. }
  6588. }
  6589. }
  6590. },
  6591. "404": {
  6592. "description": "Not found",
  6593. "content": {
  6594. "application/json": {
  6595. "schema": {
  6596. "$ref": "#/components/schemas/NotFoundError"
  6597. }
  6598. }
  6599. }
  6600. }
  6601. },
  6602. "description": "Approve or deny a permission request from the AI assistant.",
  6603. "summary": "Respond to permission",
  6604. "deprecated": true,
  6605. "requestBody": {
  6606. "content": {
  6607. "application/json": {
  6608. "schema": {
  6609. "type": "object",
  6610. "properties": {
  6611. "response": {
  6612. "type": "string",
  6613. "enum": ["once", "always", "reject"]
  6614. }
  6615. },
  6616. "required": ["response"],
  6617. "additionalProperties": false
  6618. }
  6619. }
  6620. }
  6621. },
  6622. "x-codeSamples": [
  6623. {
  6624. "lang": "js",
  6625. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.permission.respond({\n ...\n})"
  6626. }
  6627. ]
  6628. }
  6629. },
  6630. "/session/{sessionID}/message/{messageID}/part/{partID}": {
  6631. "delete": {
  6632. "tags": ["session"],
  6633. "operationId": "part.delete",
  6634. "parameters": [
  6635. {
  6636. "name": "directory",
  6637. "in": "query",
  6638. "required": false,
  6639. "schema": {
  6640. "type": "string"
  6641. }
  6642. },
  6643. {
  6644. "name": "workspace",
  6645. "in": "query",
  6646. "required": false,
  6647. "schema": {
  6648. "type": "string"
  6649. }
  6650. },
  6651. {
  6652. "name": "sessionID",
  6653. "in": "path",
  6654. "schema": {
  6655. "type": "string",
  6656. "pattern": "^ses.*"
  6657. },
  6658. "required": true
  6659. },
  6660. {
  6661. "name": "messageID",
  6662. "in": "path",
  6663. "schema": {
  6664. "type": "string",
  6665. "pattern": "^msg.*"
  6666. },
  6667. "required": true
  6668. },
  6669. {
  6670. "name": "partID",
  6671. "in": "path",
  6672. "schema": {
  6673. "type": "string",
  6674. "pattern": "^prt.*"
  6675. },
  6676. "required": true
  6677. }
  6678. ],
  6679. "responses": {
  6680. "200": {
  6681. "description": "Successfully deleted part",
  6682. "content": {
  6683. "application/json": {
  6684. "schema": {
  6685. "type": "boolean",
  6686. "description": "Successfully deleted part"
  6687. }
  6688. }
  6689. }
  6690. },
  6691. "400": {
  6692. "description": "Bad request",
  6693. "content": {
  6694. "application/json": {
  6695. "schema": {
  6696. "$ref": "#/components/schemas/BadRequestError"
  6697. }
  6698. }
  6699. }
  6700. },
  6701. "404": {
  6702. "description": "Not found",
  6703. "content": {
  6704. "application/json": {
  6705. "schema": {
  6706. "$ref": "#/components/schemas/NotFoundError"
  6707. }
  6708. }
  6709. }
  6710. }
  6711. },
  6712. "description": "Delete a part from a message.",
  6713. "x-codeSamples": [
  6714. {
  6715. "lang": "js",
  6716. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.part.delete({\n ...\n})"
  6717. }
  6718. ]
  6719. },
  6720. "patch": {
  6721. "tags": ["session"],
  6722. "operationId": "part.update",
  6723. "parameters": [
  6724. {
  6725. "name": "directory",
  6726. "in": "query",
  6727. "required": false,
  6728. "schema": {
  6729. "type": "string"
  6730. }
  6731. },
  6732. {
  6733. "name": "workspace",
  6734. "in": "query",
  6735. "required": false,
  6736. "schema": {
  6737. "type": "string"
  6738. }
  6739. },
  6740. {
  6741. "name": "sessionID",
  6742. "in": "path",
  6743. "schema": {
  6744. "type": "string",
  6745. "pattern": "^ses.*"
  6746. },
  6747. "required": true
  6748. },
  6749. {
  6750. "name": "messageID",
  6751. "in": "path",
  6752. "schema": {
  6753. "type": "string",
  6754. "pattern": "^msg.*"
  6755. },
  6756. "required": true
  6757. },
  6758. {
  6759. "name": "partID",
  6760. "in": "path",
  6761. "schema": {
  6762. "type": "string",
  6763. "pattern": "^prt.*"
  6764. },
  6765. "required": true
  6766. }
  6767. ],
  6768. "responses": {
  6769. "200": {
  6770. "description": "Successfully updated part",
  6771. "content": {
  6772. "application/json": {
  6773. "schema": {
  6774. "$ref": "#/components/schemas/Part"
  6775. }
  6776. }
  6777. }
  6778. },
  6779. "400": {
  6780. "description": "Bad request",
  6781. "content": {
  6782. "application/json": {
  6783. "schema": {
  6784. "$ref": "#/components/schemas/BadRequestError"
  6785. }
  6786. }
  6787. }
  6788. },
  6789. "404": {
  6790. "description": "Not found",
  6791. "content": {
  6792. "application/json": {
  6793. "schema": {
  6794. "$ref": "#/components/schemas/NotFoundError"
  6795. }
  6796. }
  6797. }
  6798. }
  6799. },
  6800. "description": "Update a part in a message.",
  6801. "requestBody": {
  6802. "content": {
  6803. "application/json": {
  6804. "schema": {
  6805. "$ref": "#/components/schemas/Part"
  6806. }
  6807. }
  6808. }
  6809. },
  6810. "x-codeSamples": [
  6811. {
  6812. "lang": "js",
  6813. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.part.update({\n ...\n})"
  6814. }
  6815. ]
  6816. }
  6817. },
  6818. "/sync/start": {
  6819. "post": {
  6820. "tags": ["sync"],
  6821. "operationId": "sync.start",
  6822. "parameters": [
  6823. {
  6824. "name": "directory",
  6825. "in": "query",
  6826. "required": false,
  6827. "schema": {
  6828. "type": "string"
  6829. }
  6830. },
  6831. {
  6832. "name": "workspace",
  6833. "in": "query",
  6834. "required": false,
  6835. "schema": {
  6836. "type": "string"
  6837. }
  6838. }
  6839. ],
  6840. "responses": {
  6841. "200": {
  6842. "description": "Workspace sync started",
  6843. "content": {
  6844. "application/json": {
  6845. "schema": {
  6846. "type": "boolean",
  6847. "description": "Workspace sync started"
  6848. }
  6849. }
  6850. }
  6851. }
  6852. },
  6853. "description": "Start sync loops for workspaces in the current project that have active sessions.",
  6854. "summary": "Start workspace sync",
  6855. "x-codeSamples": [
  6856. {
  6857. "lang": "js",
  6858. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.sync.start({\n ...\n})"
  6859. }
  6860. ]
  6861. }
  6862. },
  6863. "/sync/replay": {
  6864. "post": {
  6865. "tags": ["sync"],
  6866. "operationId": "sync.replay",
  6867. "parameters": [
  6868. {
  6869. "name": "directory",
  6870. "in": "query",
  6871. "required": false,
  6872. "schema": {
  6873. "type": "string"
  6874. }
  6875. },
  6876. {
  6877. "name": "workspace",
  6878. "in": "query",
  6879. "required": false,
  6880. "schema": {
  6881. "type": "string"
  6882. }
  6883. }
  6884. ],
  6885. "responses": {
  6886. "200": {
  6887. "description": "Replayed sync events",
  6888. "content": {
  6889. "application/json": {
  6890. "schema": {
  6891. "type": "object",
  6892. "properties": {
  6893. "sessionID": {
  6894. "type": "string"
  6895. }
  6896. },
  6897. "required": ["sessionID"],
  6898. "additionalProperties": false,
  6899. "description": "Replayed sync events"
  6900. }
  6901. }
  6902. }
  6903. },
  6904. "400": {
  6905. "description": "Bad request",
  6906. "content": {
  6907. "application/json": {
  6908. "schema": {
  6909. "$ref": "#/components/schemas/BadRequestError"
  6910. }
  6911. }
  6912. }
  6913. }
  6914. },
  6915. "description": "Validate and replay a complete sync event history.",
  6916. "summary": "Replay sync events",
  6917. "requestBody": {
  6918. "content": {
  6919. "application/json": {
  6920. "schema": {
  6921. "type": "object",
  6922. "properties": {
  6923. "directory": {
  6924. "type": "string"
  6925. },
  6926. "events": {
  6927. "type": "array",
  6928. "minItems": 1,
  6929. "items": {
  6930. "type": "object",
  6931. "properties": {
  6932. "id": {
  6933. "type": "string"
  6934. },
  6935. "aggregateID": {
  6936. "type": "string"
  6937. },
  6938. "seq": {
  6939. "type": "integer",
  6940. "minimum": 0
  6941. },
  6942. "type": {
  6943. "type": "string"
  6944. },
  6945. "data": {
  6946. "type": "object"
  6947. }
  6948. },
  6949. "required": ["id", "aggregateID", "seq", "type", "data"],
  6950. "additionalProperties": false
  6951. }
  6952. }
  6953. },
  6954. "required": ["directory", "events"],
  6955. "additionalProperties": false
  6956. }
  6957. }
  6958. }
  6959. },
  6960. "x-codeSamples": [
  6961. {
  6962. "lang": "js",
  6963. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.sync.replay({\n ...\n})"
  6964. }
  6965. ]
  6966. }
  6967. },
  6968. "/sync/steal": {
  6969. "post": {
  6970. "tags": ["sync"],
  6971. "operationId": "sync.steal",
  6972. "parameters": [
  6973. {
  6974. "name": "directory",
  6975. "in": "query",
  6976. "required": false,
  6977. "schema": {
  6978. "type": "string"
  6979. }
  6980. },
  6981. {
  6982. "name": "workspace",
  6983. "in": "query",
  6984. "required": false,
  6985. "schema": {
  6986. "type": "string"
  6987. }
  6988. }
  6989. ],
  6990. "responses": {
  6991. "200": {
  6992. "description": "Session stolen into workspace",
  6993. "content": {
  6994. "application/json": {
  6995. "schema": {
  6996. "type": "object",
  6997. "properties": {
  6998. "sessionID": {
  6999. "type": "string"
  7000. }
  7001. },
  7002. "required": ["sessionID"],
  7003. "additionalProperties": false,
  7004. "description": "Session stolen into workspace"
  7005. }
  7006. }
  7007. }
  7008. },
  7009. "400": {
  7010. "description": "Bad request",
  7011. "content": {
  7012. "application/json": {
  7013. "schema": {
  7014. "$ref": "#/components/schemas/BadRequestError"
  7015. }
  7016. }
  7017. }
  7018. }
  7019. },
  7020. "description": "Update a session to belong to the current workspace through the sync event system.",
  7021. "summary": "Steal session into workspace",
  7022. "requestBody": {
  7023. "content": {
  7024. "application/json": {
  7025. "schema": {
  7026. "type": "object",
  7027. "properties": {
  7028. "sessionID": {
  7029. "type": "string"
  7030. }
  7031. },
  7032. "required": ["sessionID"],
  7033. "additionalProperties": false
  7034. }
  7035. }
  7036. }
  7037. },
  7038. "x-codeSamples": [
  7039. {
  7040. "lang": "js",
  7041. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.sync.steal({\n ...\n})"
  7042. }
  7043. ]
  7044. }
  7045. },
  7046. "/sync/history": {
  7047. "post": {
  7048. "tags": ["sync"],
  7049. "operationId": "sync.history.list",
  7050. "parameters": [
  7051. {
  7052. "name": "directory",
  7053. "in": "query",
  7054. "required": false,
  7055. "schema": {
  7056. "type": "string"
  7057. }
  7058. },
  7059. {
  7060. "name": "workspace",
  7061. "in": "query",
  7062. "required": false,
  7063. "schema": {
  7064. "type": "string"
  7065. }
  7066. }
  7067. ],
  7068. "responses": {
  7069. "200": {
  7070. "description": "Sync events",
  7071. "content": {
  7072. "application/json": {
  7073. "schema": {
  7074. "type": "array",
  7075. "items": {
  7076. "type": "object",
  7077. "properties": {
  7078. "id": {
  7079. "type": "string"
  7080. },
  7081. "aggregate_id": {
  7082. "type": "string"
  7083. },
  7084. "seq": {
  7085. "type": "integer",
  7086. "minimum": 0
  7087. },
  7088. "type": {
  7089. "type": "string"
  7090. },
  7091. "data": {
  7092. "type": "object"
  7093. }
  7094. },
  7095. "required": ["id", "aggregate_id", "seq", "type", "data"],
  7096. "additionalProperties": false
  7097. },
  7098. "description": "Sync events"
  7099. }
  7100. }
  7101. }
  7102. },
  7103. "400": {
  7104. "description": "Bad request",
  7105. "content": {
  7106. "application/json": {
  7107. "schema": {
  7108. "$ref": "#/components/schemas/BadRequestError"
  7109. }
  7110. }
  7111. }
  7112. }
  7113. },
  7114. "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.",
  7115. "summary": "List sync events",
  7116. "requestBody": {
  7117. "content": {
  7118. "application/json": {
  7119. "schema": {
  7120. "type": "object",
  7121. "additionalProperties": {
  7122. "type": "integer",
  7123. "minimum": 0
  7124. }
  7125. }
  7126. }
  7127. }
  7128. },
  7129. "x-codeSamples": [
  7130. {
  7131. "lang": "js",
  7132. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.sync.history.list({\n ...\n})"
  7133. }
  7134. ]
  7135. }
  7136. },
  7137. "/api/session": {
  7138. "get": {
  7139. "tags": ["v2"],
  7140. "operationId": "v2.session.list",
  7141. "parameters": [
  7142. {
  7143. "name": "directory",
  7144. "in": "query",
  7145. "required": false,
  7146. "schema": {
  7147. "type": "string"
  7148. }
  7149. },
  7150. {
  7151. "name": "workspace",
  7152. "in": "query",
  7153. "required": false,
  7154. "schema": {
  7155. "type": "string"
  7156. }
  7157. }
  7158. ],
  7159. "responses": {
  7160. "200": {
  7161. "description": "V2SessionsResponse",
  7162. "content": {
  7163. "application/json": {
  7164. "schema": {
  7165. "$ref": "#/components/schemas/V2SessionsResponse"
  7166. }
  7167. }
  7168. }
  7169. },
  7170. "400": {
  7171. "description": "Bad request",
  7172. "content": {
  7173. "application/json": {
  7174. "schema": {
  7175. "$ref": "#/components/schemas/BadRequestError"
  7176. }
  7177. }
  7178. }
  7179. }
  7180. },
  7181. "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.",
  7182. "summary": "List v2 sessions",
  7183. "x-codeSamples": [
  7184. {
  7185. "lang": "js",
  7186. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.list({\n ...\n})"
  7187. }
  7188. ]
  7189. }
  7190. },
  7191. "/api/session/{sessionID}/prompt": {
  7192. "post": {
  7193. "tags": ["v2"],
  7194. "operationId": "v2.session.prompt",
  7195. "parameters": [
  7196. {
  7197. "name": "directory",
  7198. "in": "query",
  7199. "required": false,
  7200. "schema": {
  7201. "type": "string"
  7202. }
  7203. },
  7204. {
  7205. "name": "workspace",
  7206. "in": "query",
  7207. "required": false,
  7208. "schema": {
  7209. "type": "string"
  7210. }
  7211. },
  7212. {
  7213. "name": "sessionID",
  7214. "in": "path",
  7215. "schema": {
  7216. "type": "string",
  7217. "pattern": "^ses.*"
  7218. },
  7219. "required": true
  7220. }
  7221. ],
  7222. "responses": {
  7223. "200": {
  7224. "description": "Session.Message",
  7225. "content": {
  7226. "application/json": {
  7227. "schema": {
  7228. "$ref": "#/components/schemas/SessionMessage"
  7229. }
  7230. }
  7231. }
  7232. }
  7233. },
  7234. "description": "Create a v2 session message and queue it for the agent loop.",
  7235. "summary": "Send v2 message",
  7236. "requestBody": {
  7237. "content": {
  7238. "application/json": {
  7239. "schema": {
  7240. "type": "object",
  7241. "properties": {
  7242. "prompt": {
  7243. "$ref": "#/components/schemas/Prompt"
  7244. },
  7245. "delivery": {
  7246. "$ref": "#/components/schemas/SessionDelivery"
  7247. }
  7248. },
  7249. "required": ["prompt"],
  7250. "additionalProperties": false
  7251. }
  7252. }
  7253. }
  7254. },
  7255. "x-codeSamples": [
  7256. {
  7257. "lang": "js",
  7258. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.prompt({\n ...\n})"
  7259. }
  7260. ]
  7261. }
  7262. },
  7263. "/api/session/{sessionID}/compact": {
  7264. "post": {
  7265. "tags": ["v2"],
  7266. "operationId": "v2.session.compact",
  7267. "parameters": [
  7268. {
  7269. "name": "directory",
  7270. "in": "query",
  7271. "required": false,
  7272. "schema": {
  7273. "type": "string"
  7274. }
  7275. },
  7276. {
  7277. "name": "workspace",
  7278. "in": "query",
  7279. "required": false,
  7280. "schema": {
  7281. "type": "string"
  7282. }
  7283. },
  7284. {
  7285. "name": "sessionID",
  7286. "in": "path",
  7287. "schema": {
  7288. "type": "string",
  7289. "pattern": "^ses.*"
  7290. },
  7291. "required": true
  7292. }
  7293. ],
  7294. "responses": {
  7295. "204": {
  7296. "description": "<No Content>"
  7297. }
  7298. },
  7299. "description": "Compact a v2 session conversation.",
  7300. "summary": "Compact v2 session",
  7301. "x-codeSamples": [
  7302. {
  7303. "lang": "js",
  7304. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.compact({\n ...\n})"
  7305. }
  7306. ]
  7307. }
  7308. },
  7309. "/api/session/{sessionID}/wait": {
  7310. "post": {
  7311. "tags": ["v2"],
  7312. "operationId": "v2.session.wait",
  7313. "parameters": [
  7314. {
  7315. "name": "directory",
  7316. "in": "query",
  7317. "required": false,
  7318. "schema": {
  7319. "type": "string"
  7320. }
  7321. },
  7322. {
  7323. "name": "workspace",
  7324. "in": "query",
  7325. "required": false,
  7326. "schema": {
  7327. "type": "string"
  7328. }
  7329. },
  7330. {
  7331. "name": "sessionID",
  7332. "in": "path",
  7333. "schema": {
  7334. "type": "string",
  7335. "pattern": "^ses.*"
  7336. },
  7337. "required": true
  7338. }
  7339. ],
  7340. "responses": {
  7341. "204": {
  7342. "description": "<No Content>"
  7343. }
  7344. },
  7345. "description": "Wait for a v2 session agent loop to become idle.",
  7346. "summary": "Wait for v2 session",
  7347. "x-codeSamples": [
  7348. {
  7349. "lang": "js",
  7350. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.wait({\n ...\n})"
  7351. }
  7352. ]
  7353. }
  7354. },
  7355. "/api/session/{sessionID}/context": {
  7356. "get": {
  7357. "tags": ["v2"],
  7358. "operationId": "v2.session.context",
  7359. "parameters": [
  7360. {
  7361. "name": "directory",
  7362. "in": "query",
  7363. "required": false,
  7364. "schema": {
  7365. "type": "string"
  7366. }
  7367. },
  7368. {
  7369. "name": "workspace",
  7370. "in": "query",
  7371. "required": false,
  7372. "schema": {
  7373. "type": "string"
  7374. }
  7375. },
  7376. {
  7377. "name": "sessionID",
  7378. "in": "path",
  7379. "schema": {
  7380. "type": "string",
  7381. "pattern": "^ses.*"
  7382. },
  7383. "required": true
  7384. }
  7385. ],
  7386. "responses": {
  7387. "200": {
  7388. "description": "Success",
  7389. "content": {
  7390. "application/json": {
  7391. "schema": {
  7392. "type": "array",
  7393. "items": {
  7394. "$ref": "#/components/schemas/SessionMessage"
  7395. }
  7396. }
  7397. }
  7398. }
  7399. }
  7400. },
  7401. "description": "Retrieve the active context messages for a v2 session (all messages after the last compaction).",
  7402. "summary": "Get v2 session context",
  7403. "x-codeSamples": [
  7404. {
  7405. "lang": "js",
  7406. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.context({\n ...\n})"
  7407. }
  7408. ]
  7409. }
  7410. },
  7411. "/api/session/{sessionID}/message": {
  7412. "get": {
  7413. "tags": ["v2 messages"],
  7414. "operationId": "v2.session.messages",
  7415. "parameters": [
  7416. {
  7417. "name": "directory",
  7418. "in": "query",
  7419. "required": false,
  7420. "schema": {
  7421. "type": "string"
  7422. }
  7423. },
  7424. {
  7425. "name": "workspace",
  7426. "in": "query",
  7427. "required": false,
  7428. "schema": {
  7429. "type": "string"
  7430. }
  7431. },
  7432. {
  7433. "name": "sessionID",
  7434. "in": "path",
  7435. "schema": {
  7436. "type": "string",
  7437. "pattern": "^ses.*"
  7438. },
  7439. "required": true
  7440. }
  7441. ],
  7442. "responses": {
  7443. "200": {
  7444. "description": "V2SessionMessagesResponse",
  7445. "content": {
  7446. "application/json": {
  7447. "schema": {
  7448. "$ref": "#/components/schemas/V2SessionMessagesResponse"
  7449. }
  7450. }
  7451. }
  7452. },
  7453. "400": {
  7454. "description": "Bad request",
  7455. "content": {
  7456. "application/json": {
  7457. "schema": {
  7458. "$ref": "#/components/schemas/BadRequestError"
  7459. }
  7460. }
  7461. }
  7462. }
  7463. },
  7464. "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.",
  7465. "summary": "Get v2 session messages",
  7466. "x-codeSamples": [
  7467. {
  7468. "lang": "js",
  7469. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.messages({\n ...\n})"
  7470. }
  7471. ]
  7472. }
  7473. },
  7474. "/tui/append-prompt": {
  7475. "post": {
  7476. "tags": ["tui"],
  7477. "operationId": "tui.appendPrompt",
  7478. "parameters": [
  7479. {
  7480. "name": "directory",
  7481. "in": "query",
  7482. "required": false,
  7483. "schema": {
  7484. "type": "string"
  7485. }
  7486. },
  7487. {
  7488. "name": "workspace",
  7489. "in": "query",
  7490. "required": false,
  7491. "schema": {
  7492. "type": "string"
  7493. }
  7494. }
  7495. ],
  7496. "responses": {
  7497. "200": {
  7498. "description": "Prompt processed successfully",
  7499. "content": {
  7500. "application/json": {
  7501. "schema": {
  7502. "type": "boolean",
  7503. "description": "Prompt processed successfully"
  7504. }
  7505. }
  7506. }
  7507. },
  7508. "400": {
  7509. "description": "Bad request",
  7510. "content": {
  7511. "application/json": {
  7512. "schema": {
  7513. "$ref": "#/components/schemas/BadRequestError"
  7514. }
  7515. }
  7516. }
  7517. }
  7518. },
  7519. "description": "Append prompt to the TUI.",
  7520. "summary": "Append TUI prompt",
  7521. "requestBody": {
  7522. "content": {
  7523. "application/json": {
  7524. "schema": {
  7525. "type": "object",
  7526. "properties": {
  7527. "text": {
  7528. "type": "string"
  7529. }
  7530. },
  7531. "required": ["text"],
  7532. "additionalProperties": false
  7533. }
  7534. }
  7535. }
  7536. },
  7537. "x-codeSamples": [
  7538. {
  7539. "lang": "js",
  7540. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.appendPrompt({\n ...\n})"
  7541. }
  7542. ]
  7543. }
  7544. },
  7545. "/tui/open-help": {
  7546. "post": {
  7547. "tags": ["tui"],
  7548. "operationId": "tui.openHelp",
  7549. "parameters": [
  7550. {
  7551. "name": "directory",
  7552. "in": "query",
  7553. "required": false,
  7554. "schema": {
  7555. "type": "string"
  7556. }
  7557. },
  7558. {
  7559. "name": "workspace",
  7560. "in": "query",
  7561. "required": false,
  7562. "schema": {
  7563. "type": "string"
  7564. }
  7565. }
  7566. ],
  7567. "responses": {
  7568. "200": {
  7569. "description": "Help dialog opened successfully",
  7570. "content": {
  7571. "application/json": {
  7572. "schema": {
  7573. "type": "boolean",
  7574. "description": "Help dialog opened successfully"
  7575. }
  7576. }
  7577. }
  7578. }
  7579. },
  7580. "description": "Open the help dialog in the TUI to display user assistance information.",
  7581. "summary": "Open help dialog",
  7582. "x-codeSamples": [
  7583. {
  7584. "lang": "js",
  7585. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openHelp({\n ...\n})"
  7586. }
  7587. ]
  7588. }
  7589. },
  7590. "/tui/open-sessions": {
  7591. "post": {
  7592. "tags": ["tui"],
  7593. "operationId": "tui.openSessions",
  7594. "parameters": [
  7595. {
  7596. "name": "directory",
  7597. "in": "query",
  7598. "required": false,
  7599. "schema": {
  7600. "type": "string"
  7601. }
  7602. },
  7603. {
  7604. "name": "workspace",
  7605. "in": "query",
  7606. "required": false,
  7607. "schema": {
  7608. "type": "string"
  7609. }
  7610. }
  7611. ],
  7612. "responses": {
  7613. "200": {
  7614. "description": "Session dialog opened successfully",
  7615. "content": {
  7616. "application/json": {
  7617. "schema": {
  7618. "type": "boolean",
  7619. "description": "Session dialog opened successfully"
  7620. }
  7621. }
  7622. }
  7623. }
  7624. },
  7625. "description": "Open the session dialog.",
  7626. "summary": "Open sessions dialog",
  7627. "x-codeSamples": [
  7628. {
  7629. "lang": "js",
  7630. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openSessions({\n ...\n})"
  7631. }
  7632. ]
  7633. }
  7634. },
  7635. "/tui/open-themes": {
  7636. "post": {
  7637. "tags": ["tui"],
  7638. "operationId": "tui.openThemes",
  7639. "parameters": [
  7640. {
  7641. "name": "directory",
  7642. "in": "query",
  7643. "required": false,
  7644. "schema": {
  7645. "type": "string"
  7646. }
  7647. },
  7648. {
  7649. "name": "workspace",
  7650. "in": "query",
  7651. "required": false,
  7652. "schema": {
  7653. "type": "string"
  7654. }
  7655. }
  7656. ],
  7657. "responses": {
  7658. "200": {
  7659. "description": "Theme dialog opened successfully",
  7660. "content": {
  7661. "application/json": {
  7662. "schema": {
  7663. "type": "boolean",
  7664. "description": "Theme dialog opened successfully"
  7665. }
  7666. }
  7667. }
  7668. }
  7669. },
  7670. "description": "Open the theme dialog.",
  7671. "summary": "Open themes dialog",
  7672. "x-codeSamples": [
  7673. {
  7674. "lang": "js",
  7675. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openThemes({\n ...\n})"
  7676. }
  7677. ]
  7678. }
  7679. },
  7680. "/tui/open-models": {
  7681. "post": {
  7682. "tags": ["tui"],
  7683. "operationId": "tui.openModels",
  7684. "parameters": [
  7685. {
  7686. "name": "directory",
  7687. "in": "query",
  7688. "required": false,
  7689. "schema": {
  7690. "type": "string"
  7691. }
  7692. },
  7693. {
  7694. "name": "workspace",
  7695. "in": "query",
  7696. "required": false,
  7697. "schema": {
  7698. "type": "string"
  7699. }
  7700. }
  7701. ],
  7702. "responses": {
  7703. "200": {
  7704. "description": "Model dialog opened successfully",
  7705. "content": {
  7706. "application/json": {
  7707. "schema": {
  7708. "type": "boolean",
  7709. "description": "Model dialog opened successfully"
  7710. }
  7711. }
  7712. }
  7713. }
  7714. },
  7715. "description": "Open the model dialog.",
  7716. "summary": "Open models dialog",
  7717. "x-codeSamples": [
  7718. {
  7719. "lang": "js",
  7720. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openModels({\n ...\n})"
  7721. }
  7722. ]
  7723. }
  7724. },
  7725. "/tui/submit-prompt": {
  7726. "post": {
  7727. "tags": ["tui"],
  7728. "operationId": "tui.submitPrompt",
  7729. "parameters": [
  7730. {
  7731. "name": "directory",
  7732. "in": "query",
  7733. "required": false,
  7734. "schema": {
  7735. "type": "string"
  7736. }
  7737. },
  7738. {
  7739. "name": "workspace",
  7740. "in": "query",
  7741. "required": false,
  7742. "schema": {
  7743. "type": "string"
  7744. }
  7745. }
  7746. ],
  7747. "responses": {
  7748. "200": {
  7749. "description": "Prompt submitted successfully",
  7750. "content": {
  7751. "application/json": {
  7752. "schema": {
  7753. "type": "boolean",
  7754. "description": "Prompt submitted successfully"
  7755. }
  7756. }
  7757. }
  7758. }
  7759. },
  7760. "description": "Submit the prompt.",
  7761. "summary": "Submit TUI prompt",
  7762. "x-codeSamples": [
  7763. {
  7764. "lang": "js",
  7765. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.submitPrompt({\n ...\n})"
  7766. }
  7767. ]
  7768. }
  7769. },
  7770. "/tui/clear-prompt": {
  7771. "post": {
  7772. "tags": ["tui"],
  7773. "operationId": "tui.clearPrompt",
  7774. "parameters": [
  7775. {
  7776. "name": "directory",
  7777. "in": "query",
  7778. "required": false,
  7779. "schema": {
  7780. "type": "string"
  7781. }
  7782. },
  7783. {
  7784. "name": "workspace",
  7785. "in": "query",
  7786. "required": false,
  7787. "schema": {
  7788. "type": "string"
  7789. }
  7790. }
  7791. ],
  7792. "responses": {
  7793. "200": {
  7794. "description": "Prompt cleared successfully",
  7795. "content": {
  7796. "application/json": {
  7797. "schema": {
  7798. "type": "boolean",
  7799. "description": "Prompt cleared successfully"
  7800. }
  7801. }
  7802. }
  7803. }
  7804. },
  7805. "description": "Clear the prompt.",
  7806. "summary": "Clear TUI prompt",
  7807. "x-codeSamples": [
  7808. {
  7809. "lang": "js",
  7810. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.clearPrompt({\n ...\n})"
  7811. }
  7812. ]
  7813. }
  7814. },
  7815. "/tui/execute-command": {
  7816. "post": {
  7817. "tags": ["tui"],
  7818. "operationId": "tui.executeCommand",
  7819. "parameters": [
  7820. {
  7821. "name": "directory",
  7822. "in": "query",
  7823. "required": false,
  7824. "schema": {
  7825. "type": "string"
  7826. }
  7827. },
  7828. {
  7829. "name": "workspace",
  7830. "in": "query",
  7831. "required": false,
  7832. "schema": {
  7833. "type": "string"
  7834. }
  7835. }
  7836. ],
  7837. "responses": {
  7838. "200": {
  7839. "description": "Command executed successfully",
  7840. "content": {
  7841. "application/json": {
  7842. "schema": {
  7843. "type": "boolean",
  7844. "description": "Command executed successfully"
  7845. }
  7846. }
  7847. }
  7848. },
  7849. "400": {
  7850. "description": "Bad request",
  7851. "content": {
  7852. "application/json": {
  7853. "schema": {
  7854. "$ref": "#/components/schemas/BadRequestError"
  7855. }
  7856. }
  7857. }
  7858. }
  7859. },
  7860. "description": "Execute a TUI command.",
  7861. "summary": "Execute TUI command",
  7862. "requestBody": {
  7863. "content": {
  7864. "application/json": {
  7865. "schema": {
  7866. "type": "object",
  7867. "properties": {
  7868. "command": {
  7869. "type": "string"
  7870. }
  7871. },
  7872. "required": ["command"],
  7873. "additionalProperties": false
  7874. }
  7875. }
  7876. }
  7877. },
  7878. "x-codeSamples": [
  7879. {
  7880. "lang": "js",
  7881. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.executeCommand({\n ...\n})"
  7882. }
  7883. ]
  7884. }
  7885. },
  7886. "/tui/show-toast": {
  7887. "post": {
  7888. "tags": ["tui"],
  7889. "operationId": "tui.showToast",
  7890. "parameters": [
  7891. {
  7892. "name": "directory",
  7893. "in": "query",
  7894. "required": false,
  7895. "schema": {
  7896. "type": "string"
  7897. }
  7898. },
  7899. {
  7900. "name": "workspace",
  7901. "in": "query",
  7902. "required": false,
  7903. "schema": {
  7904. "type": "string"
  7905. }
  7906. }
  7907. ],
  7908. "responses": {
  7909. "200": {
  7910. "description": "Toast notification shown successfully",
  7911. "content": {
  7912. "application/json": {
  7913. "schema": {
  7914. "type": "boolean",
  7915. "description": "Toast notification shown successfully"
  7916. }
  7917. }
  7918. }
  7919. }
  7920. },
  7921. "description": "Show a toast notification in the TUI.",
  7922. "summary": "Show TUI toast",
  7923. "requestBody": {
  7924. "content": {
  7925. "application/json": {
  7926. "schema": {
  7927. "type": "object",
  7928. "properties": {
  7929. "title": {
  7930. "type": "string"
  7931. },
  7932. "message": {
  7933. "type": "string"
  7934. },
  7935. "variant": {
  7936. "type": "string",
  7937. "enum": ["info", "success", "warning", "error"]
  7938. },
  7939. "duration": {
  7940. "type": "integer",
  7941. "exclusiveMinimum": 0
  7942. }
  7943. },
  7944. "required": ["message", "variant"],
  7945. "additionalProperties": false
  7946. }
  7947. }
  7948. }
  7949. },
  7950. "x-codeSamples": [
  7951. {
  7952. "lang": "js",
  7953. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.showToast({\n ...\n})"
  7954. }
  7955. ]
  7956. }
  7957. },
  7958. "/tui/publish": {
  7959. "post": {
  7960. "tags": ["tui"],
  7961. "operationId": "tui.publish",
  7962. "parameters": [
  7963. {
  7964. "name": "directory",
  7965. "in": "query",
  7966. "required": false,
  7967. "schema": {
  7968. "type": "string"
  7969. }
  7970. },
  7971. {
  7972. "name": "workspace",
  7973. "in": "query",
  7974. "required": false,
  7975. "schema": {
  7976. "type": "string"
  7977. }
  7978. }
  7979. ],
  7980. "responses": {
  7981. "200": {
  7982. "description": "Event published successfully",
  7983. "content": {
  7984. "application/json": {
  7985. "schema": {
  7986. "type": "boolean",
  7987. "description": "Event published successfully"
  7988. }
  7989. }
  7990. }
  7991. },
  7992. "400": {
  7993. "description": "Bad request",
  7994. "content": {
  7995. "application/json": {
  7996. "schema": {
  7997. "$ref": "#/components/schemas/BadRequestError"
  7998. }
  7999. }
  8000. }
  8001. }
  8002. },
  8003. "description": "Publish a TUI event.",
  8004. "summary": "Publish TUI event",
  8005. "requestBody": {
  8006. "content": {
  8007. "application/json": {
  8008. "schema": {
  8009. "anyOf": [
  8010. {
  8011. "$ref": "#/components/schemas/EventTuiPromptAppend"
  8012. },
  8013. {
  8014. "$ref": "#/components/schemas/EventTuiCommandExecute"
  8015. },
  8016. {
  8017. "$ref": "#/components/schemas/EventTuiToastShow"
  8018. },
  8019. {
  8020. "$ref": "#/components/schemas/EventTuiSessionSelect"
  8021. }
  8022. ]
  8023. }
  8024. }
  8025. }
  8026. },
  8027. "x-codeSamples": [
  8028. {
  8029. "lang": "js",
  8030. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.publish({\n ...\n})"
  8031. }
  8032. ]
  8033. }
  8034. },
  8035. "/tui/select-session": {
  8036. "post": {
  8037. "tags": ["tui"],
  8038. "operationId": "tui.selectSession",
  8039. "parameters": [
  8040. {
  8041. "name": "directory",
  8042. "in": "query",
  8043. "required": false,
  8044. "schema": {
  8045. "type": "string"
  8046. }
  8047. },
  8048. {
  8049. "name": "workspace",
  8050. "in": "query",
  8051. "required": false,
  8052. "schema": {
  8053. "type": "string"
  8054. }
  8055. }
  8056. ],
  8057. "responses": {
  8058. "200": {
  8059. "description": "Session selected successfully",
  8060. "content": {
  8061. "application/json": {
  8062. "schema": {
  8063. "type": "boolean",
  8064. "description": "Session selected successfully"
  8065. }
  8066. }
  8067. }
  8068. },
  8069. "400": {
  8070. "description": "Bad request",
  8071. "content": {
  8072. "application/json": {
  8073. "schema": {
  8074. "$ref": "#/components/schemas/BadRequestError"
  8075. }
  8076. }
  8077. }
  8078. },
  8079. "404": {
  8080. "description": "NotFoundError",
  8081. "content": {
  8082. "application/json": {
  8083. "schema": {
  8084. "$ref": "#/components/schemas/NotFoundError"
  8085. }
  8086. }
  8087. }
  8088. }
  8089. },
  8090. "description": "Navigate the TUI to display the specified session.",
  8091. "summary": "Select session",
  8092. "requestBody": {
  8093. "content": {
  8094. "application/json": {
  8095. "schema": {
  8096. "type": "object",
  8097. "properties": {
  8098. "sessionID": {
  8099. "type": "string",
  8100. "description": "Session ID to navigate to"
  8101. }
  8102. },
  8103. "required": ["sessionID"],
  8104. "additionalProperties": false
  8105. }
  8106. }
  8107. }
  8108. },
  8109. "x-codeSamples": [
  8110. {
  8111. "lang": "js",
  8112. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.selectSession({\n ...\n})"
  8113. }
  8114. ]
  8115. }
  8116. },
  8117. "/tui/control/next": {
  8118. "get": {
  8119. "tags": ["tui"],
  8120. "operationId": "tui.control.next",
  8121. "parameters": [
  8122. {
  8123. "name": "directory",
  8124. "in": "query",
  8125. "required": false,
  8126. "schema": {
  8127. "type": "string"
  8128. }
  8129. },
  8130. {
  8131. "name": "workspace",
  8132. "in": "query",
  8133. "required": false,
  8134. "schema": {
  8135. "type": "string"
  8136. }
  8137. }
  8138. ],
  8139. "responses": {
  8140. "200": {
  8141. "description": "Next TUI request",
  8142. "content": {
  8143. "application/json": {
  8144. "schema": {
  8145. "type": "object",
  8146. "properties": {
  8147. "path": {
  8148. "type": "string"
  8149. },
  8150. "body": {}
  8151. },
  8152. "required": ["path", "body"],
  8153. "additionalProperties": false,
  8154. "description": "Next TUI request"
  8155. }
  8156. }
  8157. }
  8158. }
  8159. },
  8160. "description": "Retrieve the next TUI request from the queue for processing.",
  8161. "summary": "Get next TUI request",
  8162. "x-codeSamples": [
  8163. {
  8164. "lang": "js",
  8165. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.control.next({\n ...\n})"
  8166. }
  8167. ]
  8168. }
  8169. },
  8170. "/tui/control/response": {
  8171. "post": {
  8172. "tags": ["tui"],
  8173. "operationId": "tui.control.response",
  8174. "parameters": [
  8175. {
  8176. "name": "directory",
  8177. "in": "query",
  8178. "required": false,
  8179. "schema": {
  8180. "type": "string"
  8181. }
  8182. },
  8183. {
  8184. "name": "workspace",
  8185. "in": "query",
  8186. "required": false,
  8187. "schema": {
  8188. "type": "string"
  8189. }
  8190. }
  8191. ],
  8192. "responses": {
  8193. "200": {
  8194. "description": "Response submitted successfully",
  8195. "content": {
  8196. "application/json": {
  8197. "schema": {
  8198. "type": "boolean",
  8199. "description": "Response submitted successfully"
  8200. }
  8201. }
  8202. }
  8203. }
  8204. },
  8205. "description": "Submit a response to the TUI request queue to complete a pending request.",
  8206. "summary": "Submit TUI response",
  8207. "requestBody": {
  8208. "content": {
  8209. "application/json": {
  8210. "schema": {}
  8211. }
  8212. }
  8213. },
  8214. "x-codeSamples": [
  8215. {
  8216. "lang": "js",
  8217. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.control.response({\n ...\n})"
  8218. }
  8219. ]
  8220. }
  8221. },
  8222. "/experimental/workspace/adapter": {
  8223. "get": {
  8224. "tags": ["workspace"],
  8225. "operationId": "experimental.workspace.adapter.list",
  8226. "parameters": [
  8227. {
  8228. "name": "directory",
  8229. "in": "query",
  8230. "required": false,
  8231. "schema": {
  8232. "type": "string"
  8233. }
  8234. },
  8235. {
  8236. "name": "workspace",
  8237. "in": "query",
  8238. "required": false,
  8239. "schema": {
  8240. "type": "string"
  8241. }
  8242. }
  8243. ],
  8244. "responses": {
  8245. "200": {
  8246. "description": "Workspace adapters",
  8247. "content": {
  8248. "application/json": {
  8249. "schema": {
  8250. "type": "array",
  8251. "items": {
  8252. "type": "object",
  8253. "properties": {
  8254. "type": {
  8255. "type": "string"
  8256. },
  8257. "name": {
  8258. "type": "string"
  8259. },
  8260. "description": {
  8261. "type": "string"
  8262. }
  8263. },
  8264. "required": ["type", "name", "description"],
  8265. "additionalProperties": false
  8266. },
  8267. "description": "Workspace adapters"
  8268. }
  8269. }
  8270. }
  8271. }
  8272. },
  8273. "description": "List all available workspace adapters for the current project.",
  8274. "summary": "List workspace adapters",
  8275. "x-codeSamples": [
  8276. {
  8277. "lang": "js",
  8278. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.adapter.list({\n ...\n})"
  8279. }
  8280. ]
  8281. }
  8282. },
  8283. "/experimental/workspace": {
  8284. "get": {
  8285. "tags": ["workspace"],
  8286. "operationId": "experimental.workspace.list",
  8287. "parameters": [
  8288. {
  8289. "name": "directory",
  8290. "in": "query",
  8291. "required": false,
  8292. "schema": {
  8293. "type": "string"
  8294. }
  8295. },
  8296. {
  8297. "name": "workspace",
  8298. "in": "query",
  8299. "required": false,
  8300. "schema": {
  8301. "type": "string"
  8302. }
  8303. }
  8304. ],
  8305. "responses": {
  8306. "200": {
  8307. "description": "Workspaces",
  8308. "content": {
  8309. "application/json": {
  8310. "schema": {
  8311. "type": "array",
  8312. "items": {
  8313. "$ref": "#/components/schemas/Workspace"
  8314. },
  8315. "description": "Workspaces"
  8316. }
  8317. }
  8318. }
  8319. }
  8320. },
  8321. "description": "List all workspaces.",
  8322. "summary": "List workspaces",
  8323. "x-codeSamples": [
  8324. {
  8325. "lang": "js",
  8326. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.list({\n ...\n})"
  8327. }
  8328. ]
  8329. },
  8330. "post": {
  8331. "tags": ["workspace"],
  8332. "operationId": "experimental.workspace.create",
  8333. "parameters": [
  8334. {
  8335. "name": "directory",
  8336. "in": "query",
  8337. "required": false,
  8338. "schema": {
  8339. "type": "string"
  8340. }
  8341. },
  8342. {
  8343. "name": "workspace",
  8344. "in": "query",
  8345. "required": false,
  8346. "schema": {
  8347. "type": "string"
  8348. }
  8349. }
  8350. ],
  8351. "responses": {
  8352. "200": {
  8353. "description": "Workspace created",
  8354. "content": {
  8355. "application/json": {
  8356. "schema": {
  8357. "$ref": "#/components/schemas/Workspace"
  8358. }
  8359. }
  8360. }
  8361. },
  8362. "400": {
  8363. "description": "Bad request",
  8364. "content": {
  8365. "application/json": {
  8366. "schema": {
  8367. "$ref": "#/components/schemas/BadRequestError"
  8368. }
  8369. }
  8370. }
  8371. }
  8372. },
  8373. "description": "Create a workspace for the current project.",
  8374. "summary": "Create workspace",
  8375. "requestBody": {
  8376. "content": {
  8377. "application/json": {
  8378. "schema": {
  8379. "type": "object",
  8380. "properties": {
  8381. "id": {
  8382. "type": "string"
  8383. },
  8384. "type": {
  8385. "type": "string"
  8386. },
  8387. "branch": {
  8388. "anyOf": [
  8389. {
  8390. "type": "string"
  8391. },
  8392. {
  8393. "type": "null"
  8394. }
  8395. ]
  8396. },
  8397. "extra": {
  8398. "anyOf": [
  8399. {},
  8400. {
  8401. "type": "null"
  8402. }
  8403. ]
  8404. }
  8405. },
  8406. "required": ["type", "branch"],
  8407. "additionalProperties": false
  8408. }
  8409. }
  8410. }
  8411. },
  8412. "x-codeSamples": [
  8413. {
  8414. "lang": "js",
  8415. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.create({\n ...\n})"
  8416. }
  8417. ]
  8418. }
  8419. },
  8420. "/experimental/workspace/sync-list": {
  8421. "post": {
  8422. "tags": ["workspace"],
  8423. "operationId": "experimental.workspace.syncList",
  8424. "parameters": [
  8425. {
  8426. "name": "directory",
  8427. "in": "query",
  8428. "required": false,
  8429. "schema": {
  8430. "type": "string"
  8431. }
  8432. },
  8433. {
  8434. "name": "workspace",
  8435. "in": "query",
  8436. "required": false,
  8437. "schema": {
  8438. "type": "string"
  8439. }
  8440. }
  8441. ],
  8442. "responses": {
  8443. "204": {
  8444. "description": "Workspace list synced"
  8445. }
  8446. },
  8447. "description": "Register missing workspaces returned by workspace adapters.",
  8448. "summary": "Sync workspace list",
  8449. "x-codeSamples": [
  8450. {
  8451. "lang": "js",
  8452. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.syncList({\n ...\n})"
  8453. }
  8454. ]
  8455. }
  8456. },
  8457. "/experimental/workspace/status": {
  8458. "get": {
  8459. "tags": ["workspace"],
  8460. "operationId": "experimental.workspace.status",
  8461. "parameters": [
  8462. {
  8463. "name": "directory",
  8464. "in": "query",
  8465. "required": false,
  8466. "schema": {
  8467. "type": "string"
  8468. }
  8469. },
  8470. {
  8471. "name": "workspace",
  8472. "in": "query",
  8473. "required": false,
  8474. "schema": {
  8475. "type": "string"
  8476. }
  8477. }
  8478. ],
  8479. "responses": {
  8480. "200": {
  8481. "description": "Workspace status",
  8482. "content": {
  8483. "application/json": {
  8484. "schema": {
  8485. "type": "array",
  8486. "items": {
  8487. "type": "object",
  8488. "properties": {
  8489. "workspaceID": {
  8490. "type": "string"
  8491. },
  8492. "status": {
  8493. "type": "string",
  8494. "enum": ["connected", "connecting", "disconnected", "error"]
  8495. }
  8496. },
  8497. "required": ["workspaceID", "status"],
  8498. "additionalProperties": false
  8499. },
  8500. "description": "Workspace status"
  8501. }
  8502. }
  8503. }
  8504. }
  8505. },
  8506. "description": "Get connection status for workspaces in the current project.",
  8507. "summary": "Workspace status",
  8508. "x-codeSamples": [
  8509. {
  8510. "lang": "js",
  8511. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.status({\n ...\n})"
  8512. }
  8513. ]
  8514. }
  8515. },
  8516. "/experimental/workspace/{id}": {
  8517. "delete": {
  8518. "tags": ["workspace"],
  8519. "operationId": "experimental.workspace.remove",
  8520. "parameters": [
  8521. {
  8522. "name": "directory",
  8523. "in": "query",
  8524. "required": false,
  8525. "schema": {
  8526. "type": "string"
  8527. }
  8528. },
  8529. {
  8530. "name": "workspace",
  8531. "in": "query",
  8532. "required": false,
  8533. "schema": {
  8534. "type": "string"
  8535. }
  8536. },
  8537. {
  8538. "name": "id",
  8539. "in": "path",
  8540. "schema": {
  8541. "type": "string",
  8542. "pattern": "^wrk.*"
  8543. },
  8544. "required": true
  8545. }
  8546. ],
  8547. "responses": {
  8548. "200": {
  8549. "description": "Workspace removed",
  8550. "content": {
  8551. "application/json": {
  8552. "schema": {
  8553. "$ref": "#/components/schemas/Workspace"
  8554. }
  8555. }
  8556. }
  8557. },
  8558. "400": {
  8559. "description": "Bad request",
  8560. "content": {
  8561. "application/json": {
  8562. "schema": {
  8563. "$ref": "#/components/schemas/BadRequestError"
  8564. }
  8565. }
  8566. }
  8567. }
  8568. },
  8569. "description": "Remove an existing workspace.",
  8570. "summary": "Remove workspace",
  8571. "x-codeSamples": [
  8572. {
  8573. "lang": "js",
  8574. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.remove({\n ...\n})"
  8575. }
  8576. ]
  8577. }
  8578. },
  8579. "/experimental/workspace/warp": {
  8580. "post": {
  8581. "tags": ["workspace"],
  8582. "operationId": "experimental.workspace.warp",
  8583. "parameters": [
  8584. {
  8585. "name": "directory",
  8586. "in": "query",
  8587. "required": false,
  8588. "schema": {
  8589. "type": "string"
  8590. }
  8591. },
  8592. {
  8593. "name": "workspace",
  8594. "in": "query",
  8595. "required": false,
  8596. "schema": {
  8597. "type": "string"
  8598. }
  8599. }
  8600. ],
  8601. "responses": {
  8602. "204": {
  8603. "description": "Session warped"
  8604. },
  8605. "400": {
  8606. "description": "WorkspaceWarpError | VcsApplyError",
  8607. "content": {
  8608. "application/json": {
  8609. "schema": {
  8610. "anyOf": [
  8611. {
  8612. "$ref": "#/components/schemas/WorkspaceWarpError"
  8613. },
  8614. {
  8615. "$ref": "#/components/schemas/VcsApplyError"
  8616. }
  8617. ]
  8618. }
  8619. }
  8620. }
  8621. }
  8622. },
  8623. "description": "Move a session's sync history into the target workspace, or detach it to the local project.",
  8624. "summary": "Warp session into workspace",
  8625. "requestBody": {
  8626. "content": {
  8627. "application/json": {
  8628. "schema": {
  8629. "type": "object",
  8630. "properties": {
  8631. "id": {
  8632. "anyOf": [
  8633. {
  8634. "type": "string"
  8635. },
  8636. {
  8637. "type": "null"
  8638. }
  8639. ]
  8640. },
  8641. "sessionID": {
  8642. "type": "string"
  8643. },
  8644. "copyChanges": {
  8645. "type": "boolean"
  8646. }
  8647. },
  8648. "required": ["id", "sessionID"],
  8649. "additionalProperties": false
  8650. }
  8651. }
  8652. }
  8653. },
  8654. "x-codeSamples": [
  8655. {
  8656. "lang": "js",
  8657. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.warp({\n ...\n})"
  8658. }
  8659. ]
  8660. }
  8661. },
  8662. "/pty/{ptyID}/connect": {
  8663. "get": {
  8664. "tags": ["pty"],
  8665. "operationId": "pty.connect",
  8666. "parameters": [
  8667. {
  8668. "name": "directory",
  8669. "in": "query",
  8670. "required": false,
  8671. "schema": {
  8672. "type": "string"
  8673. }
  8674. },
  8675. {
  8676. "name": "workspace",
  8677. "in": "query",
  8678. "required": false,
  8679. "schema": {
  8680. "type": "string"
  8681. }
  8682. },
  8683. {
  8684. "name": "ptyID",
  8685. "in": "path",
  8686. "schema": {
  8687. "type": "string",
  8688. "pattern": "^pty.*"
  8689. },
  8690. "required": true
  8691. }
  8692. ],
  8693. "responses": {
  8694. "200": {
  8695. "description": "Connected session",
  8696. "content": {
  8697. "application/json": {
  8698. "schema": {
  8699. "type": "boolean",
  8700. "description": "Connected session"
  8701. }
  8702. }
  8703. }
  8704. },
  8705. "403": {
  8706. "description": "Forbidden",
  8707. "content": {
  8708. "application/json": {
  8709. "schema": {
  8710. "$ref": "#/components/schemas/effect_HttpApiError_Forbidden"
  8711. }
  8712. }
  8713. }
  8714. },
  8715. "404": {
  8716. "description": "Not found",
  8717. "content": {
  8718. "application/json": {
  8719. "schema": {
  8720. "$ref": "#/components/schemas/NotFoundError"
  8721. }
  8722. }
  8723. }
  8724. }
  8725. },
  8726. "description": "Establish a WebSocket connection to interact with a pseudo-terminal (PTY) session in real-time.",
  8727. "summary": "Connect to PTY session",
  8728. "x-codeSamples": [
  8729. {
  8730. "lang": "js",
  8731. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.connect({\n ...\n})"
  8732. }
  8733. ]
  8734. }
  8735. }
  8736. },
  8737. "components": {
  8738. "schemas": {
  8739. "Event": {
  8740. "anyOf": [
  8741. {
  8742. "$ref": "#/components/schemas/EventServerInstanceDisposed"
  8743. },
  8744. {
  8745. "$ref": "#/components/schemas/EventFileEdited"
  8746. },
  8747. {
  8748. "$ref": "#/components/schemas/EventFileWatcherUpdated"
  8749. },
  8750. {
  8751. "$ref": "#/components/schemas/EventLspClientDiagnostics"
  8752. },
  8753. {
  8754. "$ref": "#/components/schemas/EventLspUpdated"
  8755. },
  8756. {
  8757. "$ref": "#/components/schemas/EventMessagePartDelta"
  8758. },
  8759. {
  8760. "$ref": "#/components/schemas/EventPermissionAsked"
  8761. },
  8762. {
  8763. "$ref": "#/components/schemas/EventPermissionReplied"
  8764. },
  8765. {
  8766. "$ref": "#/components/schemas/EventSessionDiff"
  8767. },
  8768. {
  8769. "$ref": "#/components/schemas/EventSessionError"
  8770. },
  8771. {
  8772. "$ref": "#/components/schemas/EventInstallationUpdated"
  8773. },
  8774. {
  8775. "$ref": "#/components/schemas/EventInstallationUpdate-available"
  8776. },
  8777. {
  8778. "$ref": "#/components/schemas/EventQuestionAsked"
  8779. },
  8780. {
  8781. "$ref": "#/components/schemas/EventQuestionReplied"
  8782. },
  8783. {
  8784. "$ref": "#/components/schemas/EventQuestionRejected"
  8785. },
  8786. {
  8787. "$ref": "#/components/schemas/EventTodoUpdated"
  8788. },
  8789. {
  8790. "$ref": "#/components/schemas/EventSessionStatus"
  8791. },
  8792. {
  8793. "$ref": "#/components/schemas/EventSessionIdle"
  8794. },
  8795. {
  8796. "$ref": "#/components/schemas/EventSessionCompacted"
  8797. },
  8798. {
  8799. "$ref": "#/components/schemas/Event.tui.prompt.append"
  8800. },
  8801. {
  8802. "$ref": "#/components/schemas/Event.tui.command.execute"
  8803. },
  8804. {
  8805. "$ref": "#/components/schemas/EventTuiToastShow1"
  8806. },
  8807. {
  8808. "$ref": "#/components/schemas/Event.tui.session.select"
  8809. },
  8810. {
  8811. "$ref": "#/components/schemas/EventMcpToolsChanged"
  8812. },
  8813. {
  8814. "$ref": "#/components/schemas/EventMcpBrowserOpenFailed"
  8815. },
  8816. {
  8817. "$ref": "#/components/schemas/EventCommandExecuted"
  8818. },
  8819. {
  8820. "$ref": "#/components/schemas/EventProjectUpdated"
  8821. },
  8822. {
  8823. "$ref": "#/components/schemas/EventVcsBranchUpdated"
  8824. },
  8825. {
  8826. "$ref": "#/components/schemas/EventWorkspaceReady"
  8827. },
  8828. {
  8829. "$ref": "#/components/schemas/EventWorkspaceFailed"
  8830. },
  8831. {
  8832. "$ref": "#/components/schemas/EventWorkspaceStatus"
  8833. },
  8834. {
  8835. "$ref": "#/components/schemas/EventWorktreeReady"
  8836. },
  8837. {
  8838. "$ref": "#/components/schemas/EventWorktreeFailed"
  8839. },
  8840. {
  8841. "$ref": "#/components/schemas/EventPtyCreated"
  8842. },
  8843. {
  8844. "$ref": "#/components/schemas/EventPtyUpdated"
  8845. },
  8846. {
  8847. "$ref": "#/components/schemas/EventPtyExited"
  8848. },
  8849. {
  8850. "$ref": "#/components/schemas/EventPtyDeleted"
  8851. },
  8852. {
  8853. "$ref": "#/components/schemas/EventMessageUpdated"
  8854. },
  8855. {
  8856. "$ref": "#/components/schemas/EventMessageRemoved"
  8857. },
  8858. {
  8859. "$ref": "#/components/schemas/EventMessagePartUpdated"
  8860. },
  8861. {
  8862. "$ref": "#/components/schemas/EventMessagePartRemoved"
  8863. },
  8864. {
  8865. "$ref": "#/components/schemas/EventSessionCreated"
  8866. },
  8867. {
  8868. "$ref": "#/components/schemas/EventSessionUpdated"
  8869. },
  8870. {
  8871. "$ref": "#/components/schemas/EventSessionDeleted"
  8872. },
  8873. {
  8874. "$ref": "#/components/schemas/EventSessionNextAgentSwitched"
  8875. },
  8876. {
  8877. "$ref": "#/components/schemas/EventSessionNextModelSwitched"
  8878. },
  8879. {
  8880. "$ref": "#/components/schemas/EventSessionNextPrompted"
  8881. },
  8882. {
  8883. "$ref": "#/components/schemas/EventSessionNextSynthetic"
  8884. },
  8885. {
  8886. "$ref": "#/components/schemas/EventSessionNextShellStarted"
  8887. },
  8888. {
  8889. "$ref": "#/components/schemas/EventSessionNextShellEnded"
  8890. },
  8891. {
  8892. "$ref": "#/components/schemas/EventSessionNextStepStarted"
  8893. },
  8894. {
  8895. "$ref": "#/components/schemas/EventSessionNextStepEnded"
  8896. },
  8897. {
  8898. "$ref": "#/components/schemas/EventSessionNextStepFailed"
  8899. },
  8900. {
  8901. "$ref": "#/components/schemas/EventSessionNextTextStarted"
  8902. },
  8903. {
  8904. "$ref": "#/components/schemas/EventSessionNextTextDelta"
  8905. },
  8906. {
  8907. "$ref": "#/components/schemas/EventSessionNextTextEnded"
  8908. },
  8909. {
  8910. "$ref": "#/components/schemas/EventSessionNextReasoningStarted"
  8911. },
  8912. {
  8913. "$ref": "#/components/schemas/EventSessionNextReasoningDelta"
  8914. },
  8915. {
  8916. "$ref": "#/components/schemas/EventSessionNextReasoningEnded"
  8917. },
  8918. {
  8919. "$ref": "#/components/schemas/EventSessionNextToolInputStarted"
  8920. },
  8921. {
  8922. "$ref": "#/components/schemas/EventSessionNextToolInputDelta"
  8923. },
  8924. {
  8925. "$ref": "#/components/schemas/EventSessionNextToolInputEnded"
  8926. },
  8927. {
  8928. "$ref": "#/components/schemas/EventSessionNextToolCalled"
  8929. },
  8930. {
  8931. "$ref": "#/components/schemas/EventSessionNextToolProgress"
  8932. },
  8933. {
  8934. "$ref": "#/components/schemas/EventSessionNextToolSuccess"
  8935. },
  8936. {
  8937. "$ref": "#/components/schemas/EventSessionNextToolFailed"
  8938. },
  8939. {
  8940. "$ref": "#/components/schemas/EventSessionNextRetried"
  8941. },
  8942. {
  8943. "$ref": "#/components/schemas/EventSessionNextCompactionStarted"
  8944. },
  8945. {
  8946. "$ref": "#/components/schemas/EventSessionNextCompactionDelta"
  8947. },
  8948. {
  8949. "$ref": "#/components/schemas/EventSessionNextCompactionEnded"
  8950. },
  8951. {
  8952. "$ref": "#/components/schemas/EventServerConnected"
  8953. },
  8954. {
  8955. "$ref": "#/components/schemas/EventGlobalDisposed"
  8956. }
  8957. ]
  8958. },
  8959. "OAuth": {
  8960. "type": "object",
  8961. "properties": {
  8962. "type": {
  8963. "type": "string",
  8964. "enum": ["oauth"]
  8965. },
  8966. "refresh": {
  8967. "type": "string"
  8968. },
  8969. "access": {
  8970. "type": "string"
  8971. },
  8972. "expires": {
  8973. "type": "integer",
  8974. "minimum": 0
  8975. },
  8976. "accountId": {
  8977. "type": "string"
  8978. },
  8979. "enterpriseUrl": {
  8980. "type": "string"
  8981. }
  8982. },
  8983. "required": ["type", "refresh", "access", "expires"],
  8984. "additionalProperties": false
  8985. },
  8986. "ApiAuth": {
  8987. "type": "object",
  8988. "properties": {
  8989. "type": {
  8990. "type": "string",
  8991. "enum": ["api"]
  8992. },
  8993. "key": {
  8994. "type": "string"
  8995. },
  8996. "metadata": {
  8997. "type": "object",
  8998. "additionalProperties": {
  8999. "type": "string"
  9000. }
  9001. }
  9002. },
  9003. "required": ["type", "key"],
  9004. "additionalProperties": false
  9005. },
  9006. "WellKnownAuth": {
  9007. "type": "object",
  9008. "properties": {
  9009. "type": {
  9010. "type": "string",
  9011. "enum": ["wellknown"]
  9012. },
  9013. "key": {
  9014. "type": "string"
  9015. },
  9016. "token": {
  9017. "type": "string"
  9018. }
  9019. },
  9020. "required": ["type", "key", "token"],
  9021. "additionalProperties": false
  9022. },
  9023. "Auth": {
  9024. "anyOf": [
  9025. {
  9026. "$ref": "#/components/schemas/OAuth"
  9027. },
  9028. {
  9029. "$ref": "#/components/schemas/ApiAuth"
  9030. },
  9031. {
  9032. "$ref": "#/components/schemas/WellKnownAuth"
  9033. }
  9034. ]
  9035. },
  9036. "PermissionRequest": {
  9037. "type": "object",
  9038. "properties": {
  9039. "id": {
  9040. "type": "string"
  9041. },
  9042. "sessionID": {
  9043. "type": "string"
  9044. },
  9045. "permission": {
  9046. "type": "string"
  9047. },
  9048. "patterns": {
  9049. "type": "array",
  9050. "items": {
  9051. "type": "string"
  9052. }
  9053. },
  9054. "metadata": {
  9055. "type": "object"
  9056. },
  9057. "always": {
  9058. "type": "array",
  9059. "items": {
  9060. "type": "string"
  9061. }
  9062. },
  9063. "tool": {
  9064. "type": "object",
  9065. "properties": {
  9066. "messageID": {
  9067. "type": "string"
  9068. },
  9069. "callID": {
  9070. "type": "string"
  9071. }
  9072. },
  9073. "required": ["messageID", "callID"],
  9074. "additionalProperties": false
  9075. }
  9076. },
  9077. "required": ["id", "sessionID", "permission", "patterns", "metadata", "always"],
  9078. "additionalProperties": false
  9079. },
  9080. "SnapshotFileDiff": {
  9081. "type": "object",
  9082. "properties": {
  9083. "file": {
  9084. "type": "string"
  9085. },
  9086. "patch": {
  9087. "type": "string"
  9088. },
  9089. "additions": {
  9090. "type": "integer",
  9091. "minimum": 0
  9092. },
  9093. "deletions": {
  9094. "type": "integer",
  9095. "minimum": 0
  9096. },
  9097. "status": {
  9098. "type": "string",
  9099. "enum": ["added", "deleted", "modified"]
  9100. }
  9101. },
  9102. "required": ["file", "patch", "additions", "deletions"],
  9103. "additionalProperties": false
  9104. },
  9105. "ProviderAuthError": {
  9106. "type": "object",
  9107. "properties": {
  9108. "name": {
  9109. "type": "string",
  9110. "enum": ["ProviderAuthError"]
  9111. },
  9112. "data": {
  9113. "type": "object",
  9114. "properties": {
  9115. "providerID": {
  9116. "type": "string"
  9117. },
  9118. "message": {
  9119. "type": "string"
  9120. }
  9121. },
  9122. "required": ["providerID", "message"],
  9123. "additionalProperties": false
  9124. }
  9125. },
  9126. "required": ["name", "data"],
  9127. "additionalProperties": false
  9128. },
  9129. "UnknownError": {
  9130. "type": "object",
  9131. "properties": {
  9132. "name": {
  9133. "type": "string",
  9134. "enum": ["UnknownError"]
  9135. },
  9136. "data": {
  9137. "type": "object",
  9138. "properties": {
  9139. "message": {
  9140. "type": "string"
  9141. }
  9142. },
  9143. "required": ["message"],
  9144. "additionalProperties": false
  9145. }
  9146. },
  9147. "required": ["name", "data"],
  9148. "additionalProperties": false
  9149. },
  9150. "MessageOutputLengthError": {
  9151. "type": "object",
  9152. "properties": {
  9153. "name": {
  9154. "type": "string",
  9155. "enum": ["MessageOutputLengthError"]
  9156. },
  9157. "data": {
  9158. "type": "object",
  9159. "properties": {}
  9160. }
  9161. },
  9162. "required": ["name", "data"],
  9163. "additionalProperties": false
  9164. },
  9165. "MessageAbortedError": {
  9166. "type": "object",
  9167. "properties": {
  9168. "name": {
  9169. "type": "string",
  9170. "enum": ["MessageAbortedError"]
  9171. },
  9172. "data": {
  9173. "type": "object",
  9174. "properties": {
  9175. "message": {
  9176. "type": "string"
  9177. }
  9178. },
  9179. "required": ["message"],
  9180. "additionalProperties": false
  9181. }
  9182. },
  9183. "required": ["name", "data"],
  9184. "additionalProperties": false
  9185. },
  9186. "StructuredOutputError": {
  9187. "type": "object",
  9188. "properties": {
  9189. "name": {
  9190. "type": "string",
  9191. "enum": ["StructuredOutputError"]
  9192. },
  9193. "data": {
  9194. "type": "object",
  9195. "properties": {
  9196. "message": {
  9197. "type": "string"
  9198. },
  9199. "retries": {
  9200. "type": "integer",
  9201. "minimum": 0
  9202. }
  9203. },
  9204. "required": ["message", "retries"],
  9205. "additionalProperties": false
  9206. }
  9207. },
  9208. "required": ["name", "data"],
  9209. "additionalProperties": false
  9210. },
  9211. "ContextOverflowError": {
  9212. "type": "object",
  9213. "properties": {
  9214. "name": {
  9215. "type": "string",
  9216. "enum": ["ContextOverflowError"]
  9217. },
  9218. "data": {
  9219. "type": "object",
  9220. "properties": {
  9221. "message": {
  9222. "type": "string"
  9223. },
  9224. "responseBody": {
  9225. "type": "string"
  9226. }
  9227. },
  9228. "required": ["message"],
  9229. "additionalProperties": false
  9230. }
  9231. },
  9232. "required": ["name", "data"],
  9233. "additionalProperties": false
  9234. },
  9235. "APIError": {
  9236. "type": "object",
  9237. "properties": {
  9238. "name": {
  9239. "type": "string",
  9240. "enum": ["APIError"]
  9241. },
  9242. "data": {
  9243. "type": "object",
  9244. "properties": {
  9245. "message": {
  9246. "type": "string"
  9247. },
  9248. "statusCode": {
  9249. "type": "integer",
  9250. "minimum": 0
  9251. },
  9252. "isRetryable": {
  9253. "type": "boolean"
  9254. },
  9255. "responseHeaders": {
  9256. "type": "object",
  9257. "additionalProperties": {
  9258. "type": "string"
  9259. }
  9260. },
  9261. "responseBody": {
  9262. "type": "string"
  9263. },
  9264. "metadata": {
  9265. "type": "object",
  9266. "additionalProperties": {
  9267. "type": "string"
  9268. }
  9269. }
  9270. },
  9271. "required": ["message", "isRetryable"],
  9272. "additionalProperties": false
  9273. }
  9274. },
  9275. "required": ["name", "data"],
  9276. "additionalProperties": false
  9277. },
  9278. "QuestionOption": {
  9279. "type": "object",
  9280. "properties": {
  9281. "label": {
  9282. "type": "string",
  9283. "description": "Display text (1-5 words, concise)"
  9284. },
  9285. "description": {
  9286. "type": "string",
  9287. "description": "Explanation of choice"
  9288. }
  9289. },
  9290. "required": ["label", "description"],
  9291. "additionalProperties": false
  9292. },
  9293. "QuestionInfo": {
  9294. "type": "object",
  9295. "properties": {
  9296. "question": {
  9297. "type": "string",
  9298. "description": "Complete question"
  9299. },
  9300. "header": {
  9301. "type": "string",
  9302. "description": "Very short label (max 30 chars)"
  9303. },
  9304. "options": {
  9305. "type": "array",
  9306. "items": {
  9307. "$ref": "#/components/schemas/QuestionOption"
  9308. },
  9309. "description": "Available choices"
  9310. },
  9311. "multiple": {
  9312. "type": "boolean"
  9313. },
  9314. "custom": {
  9315. "type": "boolean"
  9316. }
  9317. },
  9318. "required": ["question", "header", "options"],
  9319. "additionalProperties": false
  9320. },
  9321. "QuestionTool": {
  9322. "type": "object",
  9323. "properties": {
  9324. "messageID": {
  9325. "type": "string"
  9326. },
  9327. "callID": {
  9328. "type": "string"
  9329. }
  9330. },
  9331. "required": ["messageID", "callID"],
  9332. "additionalProperties": false
  9333. },
  9334. "QuestionRequest": {
  9335. "type": "object",
  9336. "properties": {
  9337. "id": {
  9338. "type": "string"
  9339. },
  9340. "sessionID": {
  9341. "type": "string"
  9342. },
  9343. "questions": {
  9344. "type": "array",
  9345. "items": {
  9346. "$ref": "#/components/schemas/QuestionInfo"
  9347. },
  9348. "description": "Questions to ask"
  9349. },
  9350. "tool": {
  9351. "$ref": "#/components/schemas/QuestionTool"
  9352. }
  9353. },
  9354. "required": ["id", "sessionID", "questions"],
  9355. "additionalProperties": false
  9356. },
  9357. "QuestionAnswer": {
  9358. "type": "array",
  9359. "items": {
  9360. "type": "string"
  9361. }
  9362. },
  9363. "QuestionReplied": {
  9364. "type": "object",
  9365. "properties": {
  9366. "sessionID": {
  9367. "type": "string"
  9368. },
  9369. "requestID": {
  9370. "type": "string"
  9371. },
  9372. "answers": {
  9373. "type": "array",
  9374. "items": {
  9375. "$ref": "#/components/schemas/QuestionAnswer"
  9376. }
  9377. }
  9378. },
  9379. "required": ["sessionID", "requestID", "answers"],
  9380. "additionalProperties": false
  9381. },
  9382. "QuestionRejected": {
  9383. "type": "object",
  9384. "properties": {
  9385. "sessionID": {
  9386. "type": "string"
  9387. },
  9388. "requestID": {
  9389. "type": "string"
  9390. }
  9391. },
  9392. "required": ["sessionID", "requestID"],
  9393. "additionalProperties": false
  9394. },
  9395. "Todo": {
  9396. "type": "object",
  9397. "properties": {
  9398. "content": {
  9399. "type": "string",
  9400. "description": "Brief description of the task"
  9401. },
  9402. "status": {
  9403. "type": "string",
  9404. "description": "Current status of the task: pending, in_progress, completed, cancelled"
  9405. },
  9406. "priority": {
  9407. "type": "string",
  9408. "description": "Priority level of the task: high, medium, low"
  9409. }
  9410. },
  9411. "required": ["content", "status", "priority"],
  9412. "additionalProperties": false
  9413. },
  9414. "SessionStatus": {
  9415. "anyOf": [
  9416. {
  9417. "type": "object",
  9418. "properties": {
  9419. "type": {
  9420. "type": "string",
  9421. "enum": ["idle"]
  9422. }
  9423. },
  9424. "required": ["type"],
  9425. "additionalProperties": false
  9426. },
  9427. {
  9428. "type": "object",
  9429. "properties": {
  9430. "type": {
  9431. "type": "string",
  9432. "enum": ["retry"]
  9433. },
  9434. "attempt": {
  9435. "type": "integer",
  9436. "minimum": 0
  9437. },
  9438. "message": {
  9439. "type": "string"
  9440. },
  9441. "action": {
  9442. "type": "object",
  9443. "properties": {
  9444. "reason": {
  9445. "type": "string"
  9446. },
  9447. "provider": {
  9448. "type": "string"
  9449. },
  9450. "title": {
  9451. "type": "string"
  9452. },
  9453. "message": {
  9454. "type": "string"
  9455. },
  9456. "label": {
  9457. "type": "string"
  9458. },
  9459. "link": {
  9460. "type": "string"
  9461. }
  9462. },
  9463. "required": ["reason", "provider", "title", "message", "label"],
  9464. "additionalProperties": false
  9465. },
  9466. "next": {
  9467. "type": "integer",
  9468. "minimum": 0
  9469. }
  9470. },
  9471. "required": ["type", "attempt", "message", "next"],
  9472. "additionalProperties": false
  9473. },
  9474. {
  9475. "type": "object",
  9476. "properties": {
  9477. "type": {
  9478. "type": "string",
  9479. "enum": ["busy"]
  9480. }
  9481. },
  9482. "required": ["type"],
  9483. "additionalProperties": false
  9484. }
  9485. ]
  9486. },
  9487. "Event.tui.prompt.append": {
  9488. "type": "object",
  9489. "properties": {
  9490. "id": {
  9491. "type": "string"
  9492. },
  9493. "type": {
  9494. "type": "string",
  9495. "enum": ["tui.prompt.append"]
  9496. },
  9497. "properties": {
  9498. "type": "object",
  9499. "properties": {
  9500. "text": {
  9501. "type": "string"
  9502. }
  9503. },
  9504. "required": ["text"],
  9505. "additionalProperties": false
  9506. }
  9507. },
  9508. "required": ["id", "type", "properties"],
  9509. "additionalProperties": false
  9510. },
  9511. "Event.tui.command.execute": {
  9512. "type": "object",
  9513. "properties": {
  9514. "id": {
  9515. "type": "string"
  9516. },
  9517. "type": {
  9518. "type": "string",
  9519. "enum": ["tui.command.execute"]
  9520. },
  9521. "properties": {
  9522. "type": "object",
  9523. "properties": {
  9524. "command": {
  9525. "anyOf": [
  9526. {
  9527. "type": "string",
  9528. "enum": [
  9529. "session.list",
  9530. "session.new",
  9531. "session.share",
  9532. "session.interrupt",
  9533. "session.compact",
  9534. "session.page.up",
  9535. "session.page.down",
  9536. "session.line.up",
  9537. "session.line.down",
  9538. "session.half.page.up",
  9539. "session.half.page.down",
  9540. "session.first",
  9541. "session.last",
  9542. "prompt.clear",
  9543. "prompt.submit",
  9544. "agent.cycle"
  9545. ]
  9546. },
  9547. {
  9548. "type": "string"
  9549. }
  9550. ]
  9551. }
  9552. },
  9553. "required": ["command"],
  9554. "additionalProperties": false
  9555. }
  9556. },
  9557. "required": ["id", "type", "properties"],
  9558. "additionalProperties": false
  9559. },
  9560. "Event.tui.toast.show": {
  9561. "type": "object",
  9562. "properties": {
  9563. "id": {
  9564. "type": "string"
  9565. },
  9566. "type": {
  9567. "type": "string",
  9568. "enum": ["tui.toast.show"]
  9569. },
  9570. "properties": {
  9571. "type": "object",
  9572. "properties": {
  9573. "title": {
  9574. "type": "string"
  9575. },
  9576. "message": {
  9577. "type": "string"
  9578. },
  9579. "variant": {
  9580. "type": "string",
  9581. "enum": ["info", "success", "warning", "error"]
  9582. },
  9583. "duration": {
  9584. "type": "integer",
  9585. "exclusiveMinimum": 0
  9586. }
  9587. },
  9588. "required": ["message", "variant"],
  9589. "additionalProperties": false
  9590. }
  9591. },
  9592. "required": ["id", "type", "properties"],
  9593. "additionalProperties": false
  9594. },
  9595. "Event.tui.session.select": {
  9596. "type": "object",
  9597. "properties": {
  9598. "id": {
  9599. "type": "string"
  9600. },
  9601. "type": {
  9602. "type": "string",
  9603. "enum": ["tui.session.select"]
  9604. },
  9605. "properties": {
  9606. "type": "object",
  9607. "properties": {
  9608. "sessionID": {
  9609. "type": "string",
  9610. "description": "Session ID to navigate to"
  9611. }
  9612. },
  9613. "required": ["sessionID"],
  9614. "additionalProperties": false
  9615. }
  9616. },
  9617. "required": ["id", "type", "properties"],
  9618. "additionalProperties": false
  9619. },
  9620. "Project": {
  9621. "type": "object",
  9622. "properties": {
  9623. "id": {
  9624. "type": "string"
  9625. },
  9626. "worktree": {
  9627. "type": "string"
  9628. },
  9629. "vcs": {
  9630. "type": "string",
  9631. "enum": ["git"]
  9632. },
  9633. "name": {
  9634. "type": "string"
  9635. },
  9636. "icon": {
  9637. "type": "object",
  9638. "properties": {
  9639. "url": {
  9640. "type": "string"
  9641. },
  9642. "override": {
  9643. "type": "string"
  9644. },
  9645. "color": {
  9646. "type": "string"
  9647. }
  9648. },
  9649. "additionalProperties": false
  9650. },
  9651. "commands": {
  9652. "type": "object",
  9653. "properties": {
  9654. "start": {
  9655. "type": "string",
  9656. "description": "Startup script to run when creating a new workspace (worktree)"
  9657. }
  9658. },
  9659. "additionalProperties": false
  9660. },
  9661. "time": {
  9662. "type": "object",
  9663. "properties": {
  9664. "created": {
  9665. "type": "integer",
  9666. "minimum": 0
  9667. },
  9668. "updated": {
  9669. "type": "integer",
  9670. "minimum": 0
  9671. },
  9672. "initialized": {
  9673. "type": "integer",
  9674. "minimum": 0
  9675. }
  9676. },
  9677. "required": ["created", "updated"],
  9678. "additionalProperties": false
  9679. },
  9680. "sandboxes": {
  9681. "type": "array",
  9682. "items": {
  9683. "type": "string"
  9684. }
  9685. }
  9686. },
  9687. "required": ["id", "worktree", "time", "sandboxes"],
  9688. "additionalProperties": false
  9689. },
  9690. "Pty": {
  9691. "type": "object",
  9692. "properties": {
  9693. "id": {
  9694. "type": "string"
  9695. },
  9696. "title": {
  9697. "type": "string"
  9698. },
  9699. "command": {
  9700. "type": "string"
  9701. },
  9702. "args": {
  9703. "type": "array",
  9704. "items": {
  9705. "type": "string"
  9706. }
  9707. },
  9708. "cwd": {
  9709. "type": "string"
  9710. },
  9711. "status": {
  9712. "type": "string",
  9713. "enum": ["running", "exited"]
  9714. },
  9715. "pid": {
  9716. "type": "integer",
  9717. "exclusiveMinimum": 0
  9718. }
  9719. },
  9720. "required": ["id", "title", "command", "args", "cwd", "status", "pid"],
  9721. "additionalProperties": false
  9722. },
  9723. "OutputFormatText": {
  9724. "type": "object",
  9725. "properties": {
  9726. "type": {
  9727. "type": "string",
  9728. "enum": ["text"]
  9729. }
  9730. },
  9731. "required": ["type"],
  9732. "additionalProperties": false
  9733. },
  9734. "JSONSchema": {
  9735. "type": "object"
  9736. },
  9737. "OutputFormatJsonSchema": {
  9738. "type": "object",
  9739. "properties": {
  9740. "type": {
  9741. "type": "string",
  9742. "enum": ["json_schema"]
  9743. },
  9744. "schema": {
  9745. "$ref": "#/components/schemas/JSONSchema"
  9746. },
  9747. "retryCount": {
  9748. "type": "integer",
  9749. "minimum": 0
  9750. }
  9751. },
  9752. "required": ["type", "schema"],
  9753. "additionalProperties": false
  9754. },
  9755. "OutputFormat": {
  9756. "anyOf": [
  9757. {
  9758. "$ref": "#/components/schemas/OutputFormatText"
  9759. },
  9760. {
  9761. "$ref": "#/components/schemas/OutputFormatJsonSchema"
  9762. }
  9763. ]
  9764. },
  9765. "UserMessage": {
  9766. "type": "object",
  9767. "properties": {
  9768. "id": {
  9769. "type": "string"
  9770. },
  9771. "sessionID": {
  9772. "type": "string"
  9773. },
  9774. "role": {
  9775. "type": "string",
  9776. "enum": ["user"]
  9777. },
  9778. "time": {
  9779. "type": "object",
  9780. "properties": {
  9781. "created": {
  9782. "type": "integer",
  9783. "minimum": 0
  9784. }
  9785. },
  9786. "required": ["created"],
  9787. "additionalProperties": false
  9788. },
  9789. "format": {
  9790. "$ref": "#/components/schemas/OutputFormat"
  9791. },
  9792. "summary": {
  9793. "type": "object",
  9794. "properties": {
  9795. "title": {
  9796. "type": "string"
  9797. },
  9798. "body": {
  9799. "type": "string"
  9800. },
  9801. "diffs": {
  9802. "type": "array",
  9803. "items": {
  9804. "$ref": "#/components/schemas/SnapshotFileDiff"
  9805. }
  9806. }
  9807. },
  9808. "required": ["diffs"],
  9809. "additionalProperties": false
  9810. },
  9811. "agent": {
  9812. "type": "string"
  9813. },
  9814. "model": {
  9815. "type": "object",
  9816. "properties": {
  9817. "providerID": {
  9818. "type": "string"
  9819. },
  9820. "modelID": {
  9821. "type": "string"
  9822. },
  9823. "variant": {
  9824. "type": "string"
  9825. }
  9826. },
  9827. "required": ["providerID", "modelID"],
  9828. "additionalProperties": false
  9829. },
  9830. "system": {
  9831. "type": "string"
  9832. },
  9833. "tools": {
  9834. "type": "object",
  9835. "additionalProperties": {
  9836. "type": "boolean"
  9837. }
  9838. }
  9839. },
  9840. "required": ["id", "sessionID", "role", "time", "agent", "model"],
  9841. "additionalProperties": false
  9842. },
  9843. "AssistantMessage": {
  9844. "type": "object",
  9845. "properties": {
  9846. "id": {
  9847. "type": "string"
  9848. },
  9849. "sessionID": {
  9850. "type": "string"
  9851. },
  9852. "role": {
  9853. "type": "string",
  9854. "enum": ["assistant"]
  9855. },
  9856. "time": {
  9857. "type": "object",
  9858. "properties": {
  9859. "created": {
  9860. "type": "integer",
  9861. "minimum": 0
  9862. },
  9863. "completed": {
  9864. "type": "integer",
  9865. "minimum": 0
  9866. }
  9867. },
  9868. "required": ["created"],
  9869. "additionalProperties": false
  9870. },
  9871. "error": {
  9872. "anyOf": [
  9873. {
  9874. "$ref": "#/components/schemas/ProviderAuthError"
  9875. },
  9876. {
  9877. "$ref": "#/components/schemas/UnknownError"
  9878. },
  9879. {
  9880. "$ref": "#/components/schemas/MessageOutputLengthError"
  9881. },
  9882. {
  9883. "$ref": "#/components/schemas/MessageAbortedError"
  9884. },
  9885. {
  9886. "$ref": "#/components/schemas/StructuredOutputError"
  9887. },
  9888. {
  9889. "$ref": "#/components/schemas/ContextOverflowError"
  9890. },
  9891. {
  9892. "$ref": "#/components/schemas/APIError"
  9893. }
  9894. ]
  9895. },
  9896. "parentID": {
  9897. "type": "string"
  9898. },
  9899. "modelID": {
  9900. "type": "string"
  9901. },
  9902. "providerID": {
  9903. "type": "string"
  9904. },
  9905. "mode": {
  9906. "type": "string"
  9907. },
  9908. "agent": {
  9909. "type": "string"
  9910. },
  9911. "path": {
  9912. "type": "object",
  9913. "properties": {
  9914. "cwd": {
  9915. "type": "string"
  9916. },
  9917. "root": {
  9918. "type": "string"
  9919. }
  9920. },
  9921. "required": ["cwd", "root"],
  9922. "additionalProperties": false
  9923. },
  9924. "summary": {
  9925. "type": "boolean"
  9926. },
  9927. "cost": {
  9928. "type": "number"
  9929. },
  9930. "tokens": {
  9931. "type": "object",
  9932. "properties": {
  9933. "total": {
  9934. "type": "integer",
  9935. "minimum": 0
  9936. },
  9937. "input": {
  9938. "type": "integer",
  9939. "minimum": 0
  9940. },
  9941. "output": {
  9942. "type": "integer",
  9943. "minimum": 0
  9944. },
  9945. "reasoning": {
  9946. "type": "integer",
  9947. "minimum": 0
  9948. },
  9949. "cache": {
  9950. "type": "object",
  9951. "properties": {
  9952. "read": {
  9953. "type": "integer",
  9954. "minimum": 0
  9955. },
  9956. "write": {
  9957. "type": "integer",
  9958. "minimum": 0
  9959. }
  9960. },
  9961. "required": ["read", "write"],
  9962. "additionalProperties": false
  9963. }
  9964. },
  9965. "required": ["input", "output", "reasoning", "cache"],
  9966. "additionalProperties": false
  9967. },
  9968. "structured": {},
  9969. "variant": {
  9970. "type": "string"
  9971. },
  9972. "finish": {
  9973. "type": "string"
  9974. }
  9975. },
  9976. "required": [
  9977. "id",
  9978. "sessionID",
  9979. "role",
  9980. "time",
  9981. "parentID",
  9982. "modelID",
  9983. "providerID",
  9984. "mode",
  9985. "agent",
  9986. "path",
  9987. "cost",
  9988. "tokens"
  9989. ],
  9990. "additionalProperties": false
  9991. },
  9992. "Message": {
  9993. "anyOf": [
  9994. {
  9995. "$ref": "#/components/schemas/UserMessage"
  9996. },
  9997. {
  9998. "$ref": "#/components/schemas/AssistantMessage"
  9999. }
  10000. ]
  10001. },
  10002. "TextPart": {
  10003. "type": "object",
  10004. "properties": {
  10005. "id": {
  10006. "type": "string"
  10007. },
  10008. "sessionID": {
  10009. "type": "string"
  10010. },
  10011. "messageID": {
  10012. "type": "string"
  10013. },
  10014. "type": {
  10015. "type": "string",
  10016. "enum": ["text"]
  10017. },
  10018. "text": {
  10019. "type": "string"
  10020. },
  10021. "synthetic": {
  10022. "type": "boolean"
  10023. },
  10024. "ignored": {
  10025. "type": "boolean"
  10026. },
  10027. "time": {
  10028. "type": "object",
  10029. "properties": {
  10030. "start": {
  10031. "type": "integer",
  10032. "minimum": 0
  10033. },
  10034. "end": {
  10035. "type": "integer",
  10036. "minimum": 0
  10037. }
  10038. },
  10039. "required": ["start"],
  10040. "additionalProperties": false
  10041. },
  10042. "metadata": {
  10043. "type": "object"
  10044. }
  10045. },
  10046. "required": ["id", "sessionID", "messageID", "type", "text"],
  10047. "additionalProperties": false
  10048. },
  10049. "SubtaskPart": {
  10050. "type": "object",
  10051. "properties": {
  10052. "id": {
  10053. "type": "string"
  10054. },
  10055. "sessionID": {
  10056. "type": "string"
  10057. },
  10058. "messageID": {
  10059. "type": "string"
  10060. },
  10061. "type": {
  10062. "type": "string",
  10063. "enum": ["subtask"]
  10064. },
  10065. "prompt": {
  10066. "type": "string"
  10067. },
  10068. "description": {
  10069. "type": "string"
  10070. },
  10071. "agent": {
  10072. "type": "string"
  10073. },
  10074. "model": {
  10075. "type": "object",
  10076. "properties": {
  10077. "providerID": {
  10078. "type": "string"
  10079. },
  10080. "modelID": {
  10081. "type": "string"
  10082. }
  10083. },
  10084. "required": ["providerID", "modelID"],
  10085. "additionalProperties": false
  10086. },
  10087. "command": {
  10088. "type": "string"
  10089. }
  10090. },
  10091. "required": ["id", "sessionID", "messageID", "type", "prompt", "description", "agent"],
  10092. "additionalProperties": false
  10093. },
  10094. "ReasoningPart": {
  10095. "type": "object",
  10096. "properties": {
  10097. "id": {
  10098. "type": "string"
  10099. },
  10100. "sessionID": {
  10101. "type": "string"
  10102. },
  10103. "messageID": {
  10104. "type": "string"
  10105. },
  10106. "type": {
  10107. "type": "string",
  10108. "enum": ["reasoning"]
  10109. },
  10110. "text": {
  10111. "type": "string"
  10112. },
  10113. "metadata": {
  10114. "type": "object"
  10115. },
  10116. "time": {
  10117. "type": "object",
  10118. "properties": {
  10119. "start": {
  10120. "type": "integer",
  10121. "minimum": 0
  10122. },
  10123. "end": {
  10124. "type": "integer",
  10125. "minimum": 0
  10126. }
  10127. },
  10128. "required": ["start"],
  10129. "additionalProperties": false
  10130. }
  10131. },
  10132. "required": ["id", "sessionID", "messageID", "type", "text", "time"],
  10133. "additionalProperties": false
  10134. },
  10135. "FilePartSourceText": {
  10136. "type": "object",
  10137. "properties": {
  10138. "value": {
  10139. "type": "string"
  10140. },
  10141. "start": {
  10142. "type": "integer",
  10143. "minimum": 0
  10144. },
  10145. "end": {
  10146. "type": "integer",
  10147. "minimum": 0
  10148. }
  10149. },
  10150. "required": ["value", "start", "end"],
  10151. "additionalProperties": false
  10152. },
  10153. "FileSource": {
  10154. "type": "object",
  10155. "properties": {
  10156. "text": {
  10157. "$ref": "#/components/schemas/FilePartSourceText"
  10158. },
  10159. "type": {
  10160. "type": "string",
  10161. "enum": ["file"]
  10162. },
  10163. "path": {
  10164. "type": "string"
  10165. }
  10166. },
  10167. "required": ["text", "type", "path"],
  10168. "additionalProperties": false
  10169. },
  10170. "Range": {
  10171. "type": "object",
  10172. "properties": {
  10173. "start": {
  10174. "type": "object",
  10175. "properties": {
  10176. "line": {
  10177. "type": "integer",
  10178. "minimum": 0
  10179. },
  10180. "character": {
  10181. "type": "integer",
  10182. "minimum": 0
  10183. }
  10184. },
  10185. "required": ["line", "character"],
  10186. "additionalProperties": false
  10187. },
  10188. "end": {
  10189. "type": "object",
  10190. "properties": {
  10191. "line": {
  10192. "type": "integer",
  10193. "minimum": 0
  10194. },
  10195. "character": {
  10196. "type": "integer",
  10197. "minimum": 0
  10198. }
  10199. },
  10200. "required": ["line", "character"],
  10201. "additionalProperties": false
  10202. }
  10203. },
  10204. "required": ["start", "end"],
  10205. "additionalProperties": false
  10206. },
  10207. "SymbolSource": {
  10208. "type": "object",
  10209. "properties": {
  10210. "text": {
  10211. "$ref": "#/components/schemas/FilePartSourceText"
  10212. },
  10213. "type": {
  10214. "type": "string",
  10215. "enum": ["symbol"]
  10216. },
  10217. "path": {
  10218. "type": "string"
  10219. },
  10220. "range": {
  10221. "$ref": "#/components/schemas/Range"
  10222. },
  10223. "name": {
  10224. "type": "string"
  10225. },
  10226. "kind": {
  10227. "type": "integer",
  10228. "minimum": 0
  10229. }
  10230. },
  10231. "required": ["text", "type", "path", "range", "name", "kind"],
  10232. "additionalProperties": false
  10233. },
  10234. "ResourceSource": {
  10235. "type": "object",
  10236. "properties": {
  10237. "text": {
  10238. "$ref": "#/components/schemas/FilePartSourceText"
  10239. },
  10240. "type": {
  10241. "type": "string",
  10242. "enum": ["resource"]
  10243. },
  10244. "clientName": {
  10245. "type": "string"
  10246. },
  10247. "uri": {
  10248. "type": "string"
  10249. }
  10250. },
  10251. "required": ["text", "type", "clientName", "uri"],
  10252. "additionalProperties": false
  10253. },
  10254. "FilePartSource": {
  10255. "anyOf": [
  10256. {
  10257. "$ref": "#/components/schemas/FileSource"
  10258. },
  10259. {
  10260. "$ref": "#/components/schemas/SymbolSource"
  10261. },
  10262. {
  10263. "$ref": "#/components/schemas/ResourceSource"
  10264. }
  10265. ]
  10266. },
  10267. "FilePart": {
  10268. "type": "object",
  10269. "properties": {
  10270. "id": {
  10271. "type": "string"
  10272. },
  10273. "sessionID": {
  10274. "type": "string"
  10275. },
  10276. "messageID": {
  10277. "type": "string"
  10278. },
  10279. "type": {
  10280. "type": "string",
  10281. "enum": ["file"]
  10282. },
  10283. "mime": {
  10284. "type": "string"
  10285. },
  10286. "filename": {
  10287. "type": "string"
  10288. },
  10289. "url": {
  10290. "type": "string"
  10291. },
  10292. "source": {
  10293. "$ref": "#/components/schemas/FilePartSource"
  10294. }
  10295. },
  10296. "required": ["id", "sessionID", "messageID", "type", "mime", "url"],
  10297. "additionalProperties": false
  10298. },
  10299. "ToolStatePending": {
  10300. "type": "object",
  10301. "properties": {
  10302. "status": {
  10303. "type": "string",
  10304. "enum": ["pending"]
  10305. },
  10306. "input": {
  10307. "type": "object"
  10308. },
  10309. "raw": {
  10310. "type": "string"
  10311. }
  10312. },
  10313. "required": ["status", "input", "raw"],
  10314. "additionalProperties": false
  10315. },
  10316. "ToolStateRunning": {
  10317. "type": "object",
  10318. "properties": {
  10319. "status": {
  10320. "type": "string",
  10321. "enum": ["running"]
  10322. },
  10323. "input": {
  10324. "type": "object"
  10325. },
  10326. "title": {
  10327. "type": "string"
  10328. },
  10329. "metadata": {
  10330. "type": "object"
  10331. },
  10332. "time": {
  10333. "type": "object",
  10334. "properties": {
  10335. "start": {
  10336. "type": "integer",
  10337. "minimum": 0
  10338. }
  10339. },
  10340. "required": ["start"],
  10341. "additionalProperties": false
  10342. }
  10343. },
  10344. "required": ["status", "input", "time"],
  10345. "additionalProperties": false
  10346. },
  10347. "ToolStateCompleted": {
  10348. "type": "object",
  10349. "properties": {
  10350. "status": {
  10351. "type": "string",
  10352. "enum": ["completed"]
  10353. },
  10354. "input": {
  10355. "type": "object"
  10356. },
  10357. "output": {
  10358. "type": "string"
  10359. },
  10360. "title": {
  10361. "type": "string"
  10362. },
  10363. "metadata": {
  10364. "type": "object"
  10365. },
  10366. "time": {
  10367. "type": "object",
  10368. "properties": {
  10369. "start": {
  10370. "type": "integer",
  10371. "minimum": 0
  10372. },
  10373. "end": {
  10374. "type": "integer",
  10375. "minimum": 0
  10376. },
  10377. "compacted": {
  10378. "type": "integer",
  10379. "minimum": 0
  10380. }
  10381. },
  10382. "required": ["start", "end"],
  10383. "additionalProperties": false
  10384. },
  10385. "attachments": {
  10386. "type": "array",
  10387. "items": {
  10388. "$ref": "#/components/schemas/FilePart"
  10389. }
  10390. }
  10391. },
  10392. "required": ["status", "input", "output", "title", "metadata", "time"],
  10393. "additionalProperties": false
  10394. },
  10395. "ToolStateError": {
  10396. "type": "object",
  10397. "properties": {
  10398. "status": {
  10399. "type": "string",
  10400. "enum": ["error"]
  10401. },
  10402. "input": {
  10403. "type": "object"
  10404. },
  10405. "error": {
  10406. "type": "string"
  10407. },
  10408. "metadata": {
  10409. "type": "object"
  10410. },
  10411. "time": {
  10412. "type": "object",
  10413. "properties": {
  10414. "start": {
  10415. "type": "integer",
  10416. "minimum": 0
  10417. },
  10418. "end": {
  10419. "type": "integer",
  10420. "minimum": 0
  10421. }
  10422. },
  10423. "required": ["start", "end"],
  10424. "additionalProperties": false
  10425. }
  10426. },
  10427. "required": ["status", "input", "error", "time"],
  10428. "additionalProperties": false
  10429. },
  10430. "ToolState": {
  10431. "anyOf": [
  10432. {
  10433. "$ref": "#/components/schemas/ToolStatePending"
  10434. },
  10435. {
  10436. "$ref": "#/components/schemas/ToolStateRunning"
  10437. },
  10438. {
  10439. "$ref": "#/components/schemas/ToolStateCompleted"
  10440. },
  10441. {
  10442. "$ref": "#/components/schemas/ToolStateError"
  10443. }
  10444. ]
  10445. },
  10446. "ToolPart": {
  10447. "type": "object",
  10448. "properties": {
  10449. "id": {
  10450. "type": "string"
  10451. },
  10452. "sessionID": {
  10453. "type": "string"
  10454. },
  10455. "messageID": {
  10456. "type": "string"
  10457. },
  10458. "type": {
  10459. "type": "string",
  10460. "enum": ["tool"]
  10461. },
  10462. "callID": {
  10463. "type": "string"
  10464. },
  10465. "tool": {
  10466. "type": "string"
  10467. },
  10468. "state": {
  10469. "$ref": "#/components/schemas/ToolState"
  10470. },
  10471. "metadata": {
  10472. "type": "object"
  10473. }
  10474. },
  10475. "required": ["id", "sessionID", "messageID", "type", "callID", "tool", "state"],
  10476. "additionalProperties": false
  10477. },
  10478. "StepStartPart": {
  10479. "type": "object",
  10480. "properties": {
  10481. "id": {
  10482. "type": "string"
  10483. },
  10484. "sessionID": {
  10485. "type": "string"
  10486. },
  10487. "messageID": {
  10488. "type": "string"
  10489. },
  10490. "type": {
  10491. "type": "string",
  10492. "enum": ["step-start"]
  10493. },
  10494. "snapshot": {
  10495. "type": "string"
  10496. }
  10497. },
  10498. "required": ["id", "sessionID", "messageID", "type"],
  10499. "additionalProperties": false
  10500. },
  10501. "StepFinishPart": {
  10502. "type": "object",
  10503. "properties": {
  10504. "id": {
  10505. "type": "string"
  10506. },
  10507. "sessionID": {
  10508. "type": "string"
  10509. },
  10510. "messageID": {
  10511. "type": "string"
  10512. },
  10513. "type": {
  10514. "type": "string",
  10515. "enum": ["step-finish"]
  10516. },
  10517. "reason": {
  10518. "type": "string"
  10519. },
  10520. "snapshot": {
  10521. "type": "string"
  10522. },
  10523. "cost": {
  10524. "type": "number"
  10525. },
  10526. "tokens": {
  10527. "type": "object",
  10528. "properties": {
  10529. "total": {
  10530. "type": "integer",
  10531. "minimum": 0
  10532. },
  10533. "input": {
  10534. "type": "integer",
  10535. "minimum": 0
  10536. },
  10537. "output": {
  10538. "type": "integer",
  10539. "minimum": 0
  10540. },
  10541. "reasoning": {
  10542. "type": "integer",
  10543. "minimum": 0
  10544. },
  10545. "cache": {
  10546. "type": "object",
  10547. "properties": {
  10548. "read": {
  10549. "type": "integer",
  10550. "minimum": 0
  10551. },
  10552. "write": {
  10553. "type": "integer",
  10554. "minimum": 0
  10555. }
  10556. },
  10557. "required": ["read", "write"],
  10558. "additionalProperties": false
  10559. }
  10560. },
  10561. "required": ["input", "output", "reasoning", "cache"],
  10562. "additionalProperties": false
  10563. }
  10564. },
  10565. "required": ["id", "sessionID", "messageID", "type", "reason", "cost", "tokens"],
  10566. "additionalProperties": false
  10567. },
  10568. "SnapshotPart": {
  10569. "type": "object",
  10570. "properties": {
  10571. "id": {
  10572. "type": "string"
  10573. },
  10574. "sessionID": {
  10575. "type": "string"
  10576. },
  10577. "messageID": {
  10578. "type": "string"
  10579. },
  10580. "type": {
  10581. "type": "string",
  10582. "enum": ["snapshot"]
  10583. },
  10584. "snapshot": {
  10585. "type": "string"
  10586. }
  10587. },
  10588. "required": ["id", "sessionID", "messageID", "type", "snapshot"],
  10589. "additionalProperties": false
  10590. },
  10591. "PatchPart": {
  10592. "type": "object",
  10593. "properties": {
  10594. "id": {
  10595. "type": "string"
  10596. },
  10597. "sessionID": {
  10598. "type": "string"
  10599. },
  10600. "messageID": {
  10601. "type": "string"
  10602. },
  10603. "type": {
  10604. "type": "string",
  10605. "enum": ["patch"]
  10606. },
  10607. "hash": {
  10608. "type": "string"
  10609. },
  10610. "files": {
  10611. "type": "array",
  10612. "items": {
  10613. "type": "string"
  10614. }
  10615. }
  10616. },
  10617. "required": ["id", "sessionID", "messageID", "type", "hash", "files"],
  10618. "additionalProperties": false
  10619. },
  10620. "AgentPart": {
  10621. "type": "object",
  10622. "properties": {
  10623. "id": {
  10624. "type": "string"
  10625. },
  10626. "sessionID": {
  10627. "type": "string"
  10628. },
  10629. "messageID": {
  10630. "type": "string"
  10631. },
  10632. "type": {
  10633. "type": "string",
  10634. "enum": ["agent"]
  10635. },
  10636. "name": {
  10637. "type": "string"
  10638. },
  10639. "source": {
  10640. "type": "object",
  10641. "properties": {
  10642. "value": {
  10643. "type": "string"
  10644. },
  10645. "start": {
  10646. "type": "integer",
  10647. "minimum": 0
  10648. },
  10649. "end": {
  10650. "type": "integer",
  10651. "minimum": 0
  10652. }
  10653. },
  10654. "required": ["value", "start", "end"],
  10655. "additionalProperties": false
  10656. }
  10657. },
  10658. "required": ["id", "sessionID", "messageID", "type", "name"],
  10659. "additionalProperties": false
  10660. },
  10661. "RetryPart": {
  10662. "type": "object",
  10663. "properties": {
  10664. "id": {
  10665. "type": "string"
  10666. },
  10667. "sessionID": {
  10668. "type": "string"
  10669. },
  10670. "messageID": {
  10671. "type": "string"
  10672. },
  10673. "type": {
  10674. "type": "string",
  10675. "enum": ["retry"]
  10676. },
  10677. "attempt": {
  10678. "type": "integer",
  10679. "minimum": 0
  10680. },
  10681. "error": {
  10682. "$ref": "#/components/schemas/APIError"
  10683. },
  10684. "time": {
  10685. "type": "object",
  10686. "properties": {
  10687. "created": {
  10688. "type": "integer",
  10689. "minimum": 0
  10690. }
  10691. },
  10692. "required": ["created"],
  10693. "additionalProperties": false
  10694. }
  10695. },
  10696. "required": ["id", "sessionID", "messageID", "type", "attempt", "error", "time"],
  10697. "additionalProperties": false
  10698. },
  10699. "CompactionPart": {
  10700. "type": "object",
  10701. "properties": {
  10702. "id": {
  10703. "type": "string"
  10704. },
  10705. "sessionID": {
  10706. "type": "string"
  10707. },
  10708. "messageID": {
  10709. "type": "string"
  10710. },
  10711. "type": {
  10712. "type": "string",
  10713. "enum": ["compaction"]
  10714. },
  10715. "auto": {
  10716. "type": "boolean"
  10717. },
  10718. "overflow": {
  10719. "type": "boolean"
  10720. },
  10721. "tail_start_id": {
  10722. "type": "string"
  10723. }
  10724. },
  10725. "required": ["id", "sessionID", "messageID", "type", "auto"],
  10726. "additionalProperties": false
  10727. },
  10728. "Part": {
  10729. "anyOf": [
  10730. {
  10731. "$ref": "#/components/schemas/TextPart"
  10732. },
  10733. {
  10734. "$ref": "#/components/schemas/SubtaskPart"
  10735. },
  10736. {
  10737. "$ref": "#/components/schemas/ReasoningPart"
  10738. },
  10739. {
  10740. "$ref": "#/components/schemas/FilePart"
  10741. },
  10742. {
  10743. "$ref": "#/components/schemas/ToolPart"
  10744. },
  10745. {
  10746. "$ref": "#/components/schemas/StepStartPart"
  10747. },
  10748. {
  10749. "$ref": "#/components/schemas/StepFinishPart"
  10750. },
  10751. {
  10752. "$ref": "#/components/schemas/SnapshotPart"
  10753. },
  10754. {
  10755. "$ref": "#/components/schemas/PatchPart"
  10756. },
  10757. {
  10758. "$ref": "#/components/schemas/AgentPart"
  10759. },
  10760. {
  10761. "$ref": "#/components/schemas/RetryPart"
  10762. },
  10763. {
  10764. "$ref": "#/components/schemas/CompactionPart"
  10765. }
  10766. ]
  10767. },
  10768. "PermissionAction": {
  10769. "type": "string",
  10770. "enum": ["allow", "deny", "ask"]
  10771. },
  10772. "PermissionRule": {
  10773. "type": "object",
  10774. "properties": {
  10775. "permission": {
  10776. "type": "string"
  10777. },
  10778. "pattern": {
  10779. "type": "string"
  10780. },
  10781. "action": {
  10782. "$ref": "#/components/schemas/PermissionAction"
  10783. }
  10784. },
  10785. "required": ["permission", "pattern", "action"],
  10786. "additionalProperties": false
  10787. },
  10788. "PermissionRuleset": {
  10789. "type": "array",
  10790. "items": {
  10791. "$ref": "#/components/schemas/PermissionRule"
  10792. }
  10793. },
  10794. "Session": {
  10795. "type": "object",
  10796. "properties": {
  10797. "id": {
  10798. "type": "string"
  10799. },
  10800. "slug": {
  10801. "type": "string"
  10802. },
  10803. "projectID": {
  10804. "type": "string"
  10805. },
  10806. "workspaceID": {
  10807. "type": "string"
  10808. },
  10809. "directory": {
  10810. "type": "string"
  10811. },
  10812. "path": {
  10813. "type": "string"
  10814. },
  10815. "parentID": {
  10816. "type": "string"
  10817. },
  10818. "summary": {
  10819. "type": "object",
  10820. "properties": {
  10821. "additions": {
  10822. "type": "integer",
  10823. "minimum": 0
  10824. },
  10825. "deletions": {
  10826. "type": "integer",
  10827. "minimum": 0
  10828. },
  10829. "files": {
  10830. "type": "integer",
  10831. "minimum": 0
  10832. },
  10833. "diffs": {
  10834. "type": "array",
  10835. "items": {
  10836. "$ref": "#/components/schemas/SnapshotFileDiff"
  10837. }
  10838. }
  10839. },
  10840. "required": ["additions", "deletions", "files"],
  10841. "additionalProperties": false
  10842. },
  10843. "share": {
  10844. "type": "object",
  10845. "properties": {
  10846. "url": {
  10847. "type": "string"
  10848. }
  10849. },
  10850. "required": ["url"],
  10851. "additionalProperties": false
  10852. },
  10853. "title": {
  10854. "type": "string"
  10855. },
  10856. "agent": {
  10857. "type": "string"
  10858. },
  10859. "model": {
  10860. "type": "object",
  10861. "properties": {
  10862. "id": {
  10863. "type": "string"
  10864. },
  10865. "providerID": {
  10866. "type": "string"
  10867. },
  10868. "variant": {
  10869. "type": "string"
  10870. }
  10871. },
  10872. "required": ["id", "providerID"],
  10873. "additionalProperties": false
  10874. },
  10875. "version": {
  10876. "type": "string"
  10877. },
  10878. "time": {
  10879. "type": "object",
  10880. "properties": {
  10881. "created": {
  10882. "type": "integer",
  10883. "minimum": 0
  10884. },
  10885. "updated": {
  10886. "type": "integer",
  10887. "minimum": 0
  10888. },
  10889. "compacting": {
  10890. "type": "integer",
  10891. "minimum": 0
  10892. },
  10893. "archived": {
  10894. "type": "number"
  10895. }
  10896. },
  10897. "required": ["created", "updated"],
  10898. "additionalProperties": false
  10899. },
  10900. "permission": {
  10901. "$ref": "#/components/schemas/PermissionRuleset"
  10902. },
  10903. "revert": {
  10904. "type": "object",
  10905. "properties": {
  10906. "messageID": {
  10907. "type": "string"
  10908. },
  10909. "partID": {
  10910. "type": "string"
  10911. },
  10912. "snapshot": {
  10913. "type": "string"
  10914. },
  10915. "diff": {
  10916. "type": "string"
  10917. }
  10918. },
  10919. "required": ["messageID"],
  10920. "additionalProperties": false
  10921. }
  10922. },
  10923. "required": ["id", "slug", "projectID", "directory", "title", "version", "time"],
  10924. "additionalProperties": false
  10925. },
  10926. "Prompt": {
  10927. "type": "object",
  10928. "properties": {
  10929. "text": {
  10930. "type": "string"
  10931. },
  10932. "files": {
  10933. "type": "array",
  10934. "items": {
  10935. "$ref": "#/components/schemas/PromptFileAttachment"
  10936. }
  10937. },
  10938. "agents": {
  10939. "type": "array",
  10940. "items": {
  10941. "$ref": "#/components/schemas/PromptAgentAttachment"
  10942. }
  10943. }
  10944. },
  10945. "required": ["text"],
  10946. "additionalProperties": false
  10947. },
  10948. "GlobalEvent": {
  10949. "type": "object",
  10950. "properties": {
  10951. "directory": {
  10952. "type": "string"
  10953. },
  10954. "project": {
  10955. "type": "string"
  10956. },
  10957. "workspace": {
  10958. "type": "string"
  10959. },
  10960. "payload": {
  10961. "anyOf": [
  10962. {
  10963. "$ref": "#/components/schemas/EventServerInstanceDisposed"
  10964. },
  10965. {
  10966. "$ref": "#/components/schemas/EventFileEdited"
  10967. },
  10968. {
  10969. "$ref": "#/components/schemas/EventFileWatcherUpdated"
  10970. },
  10971. {
  10972. "$ref": "#/components/schemas/EventLspClientDiagnostics"
  10973. },
  10974. {
  10975. "$ref": "#/components/schemas/EventLspUpdated"
  10976. },
  10977. {
  10978. "$ref": "#/components/schemas/EventMessagePartDelta"
  10979. },
  10980. {
  10981. "$ref": "#/components/schemas/EventPermissionAsked"
  10982. },
  10983. {
  10984. "$ref": "#/components/schemas/EventPermissionReplied"
  10985. },
  10986. {
  10987. "$ref": "#/components/schemas/EventSessionDiff"
  10988. },
  10989. {
  10990. "$ref": "#/components/schemas/EventSessionError"
  10991. },
  10992. {
  10993. "$ref": "#/components/schemas/EventInstallationUpdated"
  10994. },
  10995. {
  10996. "$ref": "#/components/schemas/EventInstallationUpdate-available"
  10997. },
  10998. {
  10999. "$ref": "#/components/schemas/EventQuestionAsked"
  11000. },
  11001. {
  11002. "$ref": "#/components/schemas/EventQuestionReplied"
  11003. },
  11004. {
  11005. "$ref": "#/components/schemas/EventQuestionRejected"
  11006. },
  11007. {
  11008. "$ref": "#/components/schemas/EventTodoUpdated"
  11009. },
  11010. {
  11011. "$ref": "#/components/schemas/EventSessionStatus"
  11012. },
  11013. {
  11014. "$ref": "#/components/schemas/EventSessionIdle"
  11015. },
  11016. {
  11017. "$ref": "#/components/schemas/EventSessionCompacted"
  11018. },
  11019. {
  11020. "$ref": "#/components/schemas/Event.tui.prompt.append"
  11021. },
  11022. {
  11023. "$ref": "#/components/schemas/Event.tui.command.execute"
  11024. },
  11025. {
  11026. "$ref": "#/components/schemas/Event.tui.toast.show"
  11027. },
  11028. {
  11029. "$ref": "#/components/schemas/Event.tui.session.select"
  11030. },
  11031. {
  11032. "$ref": "#/components/schemas/EventMcpToolsChanged"
  11033. },
  11034. {
  11035. "$ref": "#/components/schemas/EventMcpBrowserOpenFailed"
  11036. },
  11037. {
  11038. "$ref": "#/components/schemas/EventCommandExecuted"
  11039. },
  11040. {
  11041. "$ref": "#/components/schemas/EventProjectUpdated"
  11042. },
  11043. {
  11044. "$ref": "#/components/schemas/EventVcsBranchUpdated"
  11045. },
  11046. {
  11047. "$ref": "#/components/schemas/EventWorkspaceReady"
  11048. },
  11049. {
  11050. "$ref": "#/components/schemas/EventWorkspaceFailed"
  11051. },
  11052. {
  11053. "$ref": "#/components/schemas/EventWorkspaceStatus"
  11054. },
  11055. {
  11056. "$ref": "#/components/schemas/EventWorktreeReady"
  11057. },
  11058. {
  11059. "$ref": "#/components/schemas/EventWorktreeFailed"
  11060. },
  11061. {
  11062. "$ref": "#/components/schemas/EventPtyCreated"
  11063. },
  11064. {
  11065. "$ref": "#/components/schemas/EventPtyUpdated"
  11066. },
  11067. {
  11068. "$ref": "#/components/schemas/EventPtyExited"
  11069. },
  11070. {
  11071. "$ref": "#/components/schemas/EventPtyDeleted"
  11072. },
  11073. {
  11074. "$ref": "#/components/schemas/EventMessageUpdated"
  11075. },
  11076. {
  11077. "$ref": "#/components/schemas/EventMessageRemoved"
  11078. },
  11079. {
  11080. "$ref": "#/components/schemas/EventMessagePartUpdated"
  11081. },
  11082. {
  11083. "$ref": "#/components/schemas/EventMessagePartRemoved"
  11084. },
  11085. {
  11086. "$ref": "#/components/schemas/EventSessionCreated"
  11087. },
  11088. {
  11089. "$ref": "#/components/schemas/EventSessionUpdated"
  11090. },
  11091. {
  11092. "$ref": "#/components/schemas/EventSessionDeleted"
  11093. },
  11094. {
  11095. "$ref": "#/components/schemas/EventSessionNextAgentSwitched"
  11096. },
  11097. {
  11098. "$ref": "#/components/schemas/EventSessionNextModelSwitched"
  11099. },
  11100. {
  11101. "$ref": "#/components/schemas/EventSessionNextPrompted"
  11102. },
  11103. {
  11104. "$ref": "#/components/schemas/EventSessionNextSynthetic"
  11105. },
  11106. {
  11107. "$ref": "#/components/schemas/EventSessionNextShellStarted"
  11108. },
  11109. {
  11110. "$ref": "#/components/schemas/EventSessionNextShellEnded"
  11111. },
  11112. {
  11113. "$ref": "#/components/schemas/EventSessionNextStepStarted"
  11114. },
  11115. {
  11116. "$ref": "#/components/schemas/EventSessionNextStepEnded"
  11117. },
  11118. {
  11119. "$ref": "#/components/schemas/EventSessionNextStepFailed"
  11120. },
  11121. {
  11122. "$ref": "#/components/schemas/EventSessionNextTextStarted"
  11123. },
  11124. {
  11125. "$ref": "#/components/schemas/EventSessionNextTextDelta"
  11126. },
  11127. {
  11128. "$ref": "#/components/schemas/EventSessionNextTextEnded"
  11129. },
  11130. {
  11131. "$ref": "#/components/schemas/EventSessionNextReasoningStarted"
  11132. },
  11133. {
  11134. "$ref": "#/components/schemas/EventSessionNextReasoningDelta"
  11135. },
  11136. {
  11137. "$ref": "#/components/schemas/EventSessionNextReasoningEnded"
  11138. },
  11139. {
  11140. "$ref": "#/components/schemas/EventSessionNextToolInputStarted"
  11141. },
  11142. {
  11143. "$ref": "#/components/schemas/EventSessionNextToolInputDelta"
  11144. },
  11145. {
  11146. "$ref": "#/components/schemas/EventSessionNextToolInputEnded"
  11147. },
  11148. {
  11149. "$ref": "#/components/schemas/EventSessionNextToolCalled"
  11150. },
  11151. {
  11152. "$ref": "#/components/schemas/EventSessionNextToolProgress"
  11153. },
  11154. {
  11155. "$ref": "#/components/schemas/EventSessionNextToolSuccess"
  11156. },
  11157. {
  11158. "$ref": "#/components/schemas/EventSessionNextToolFailed"
  11159. },
  11160. {
  11161. "$ref": "#/components/schemas/EventSessionNextRetried"
  11162. },
  11163. {
  11164. "$ref": "#/components/schemas/EventSessionNextCompactionStarted"
  11165. },
  11166. {
  11167. "$ref": "#/components/schemas/EventSessionNextCompactionDelta"
  11168. },
  11169. {
  11170. "$ref": "#/components/schemas/EventSessionNextCompactionEnded"
  11171. },
  11172. {
  11173. "$ref": "#/components/schemas/EventServerConnected"
  11174. },
  11175. {
  11176. "$ref": "#/components/schemas/EventGlobalDisposed"
  11177. },
  11178. {
  11179. "$ref": "#/components/schemas/SyncEventMessageUpdated"
  11180. },
  11181. {
  11182. "$ref": "#/components/schemas/SyncEventMessageRemoved"
  11183. },
  11184. {
  11185. "$ref": "#/components/schemas/SyncEventMessagePartUpdated"
  11186. },
  11187. {
  11188. "$ref": "#/components/schemas/SyncEventMessagePartRemoved"
  11189. },
  11190. {
  11191. "$ref": "#/components/schemas/SyncEventSessionCreated"
  11192. },
  11193. {
  11194. "$ref": "#/components/schemas/SyncEventSessionUpdated"
  11195. },
  11196. {
  11197. "$ref": "#/components/schemas/SyncEventSessionDeleted"
  11198. },
  11199. {
  11200. "$ref": "#/components/schemas/SyncEventSessionNextAgentSwitched"
  11201. },
  11202. {
  11203. "$ref": "#/components/schemas/SyncEventSessionNextModelSwitched"
  11204. },
  11205. {
  11206. "$ref": "#/components/schemas/SyncEventSessionNextPrompted"
  11207. },
  11208. {
  11209. "$ref": "#/components/schemas/SyncEventSessionNextSynthetic"
  11210. },
  11211. {
  11212. "$ref": "#/components/schemas/SyncEventSessionNextShellStarted"
  11213. },
  11214. {
  11215. "$ref": "#/components/schemas/SyncEventSessionNextShellEnded"
  11216. },
  11217. {
  11218. "$ref": "#/components/schemas/SyncEventSessionNextStepStarted"
  11219. },
  11220. {
  11221. "$ref": "#/components/schemas/SyncEventSessionNextStepEnded"
  11222. },
  11223. {
  11224. "$ref": "#/components/schemas/SyncEventSessionNextStepFailed"
  11225. },
  11226. {
  11227. "$ref": "#/components/schemas/SyncEventSessionNextTextStarted"
  11228. },
  11229. {
  11230. "$ref": "#/components/schemas/SyncEventSessionNextTextDelta"
  11231. },
  11232. {
  11233. "$ref": "#/components/schemas/SyncEventSessionNextTextEnded"
  11234. },
  11235. {
  11236. "$ref": "#/components/schemas/SyncEventSessionNextReasoningStarted"
  11237. },
  11238. {
  11239. "$ref": "#/components/schemas/SyncEventSessionNextReasoningDelta"
  11240. },
  11241. {
  11242. "$ref": "#/components/schemas/SyncEventSessionNextReasoningEnded"
  11243. },
  11244. {
  11245. "$ref": "#/components/schemas/SyncEventSessionNextToolInputStarted"
  11246. },
  11247. {
  11248. "$ref": "#/components/schemas/SyncEventSessionNextToolInputDelta"
  11249. },
  11250. {
  11251. "$ref": "#/components/schemas/SyncEventSessionNextToolInputEnded"
  11252. },
  11253. {
  11254. "$ref": "#/components/schemas/SyncEventSessionNextToolCalled"
  11255. },
  11256. {
  11257. "$ref": "#/components/schemas/SyncEventSessionNextToolProgress"
  11258. },
  11259. {
  11260. "$ref": "#/components/schemas/SyncEventSessionNextToolSuccess"
  11261. },
  11262. {
  11263. "$ref": "#/components/schemas/SyncEventSessionNextToolFailed"
  11264. },
  11265. {
  11266. "$ref": "#/components/schemas/SyncEventSessionNextRetried"
  11267. },
  11268. {
  11269. "$ref": "#/components/schemas/SyncEventSessionNextCompactionStarted"
  11270. },
  11271. {
  11272. "$ref": "#/components/schemas/SyncEventSessionNextCompactionDelta"
  11273. },
  11274. {
  11275. "$ref": "#/components/schemas/SyncEventSessionNextCompactionEnded"
  11276. }
  11277. ]
  11278. }
  11279. },
  11280. "required": ["directory", "payload"],
  11281. "additionalProperties": false
  11282. },
  11283. "LogLevel": {
  11284. "type": "string",
  11285. "enum": ["DEBUG", "INFO", "WARN", "ERROR"],
  11286. "description": "Log level"
  11287. },
  11288. "ServerConfig": {
  11289. "type": "object",
  11290. "properties": {
  11291. "port": {
  11292. "type": "integer",
  11293. "exclusiveMinimum": 0
  11294. },
  11295. "hostname": {
  11296. "type": "string"
  11297. },
  11298. "mdns": {
  11299. "type": "boolean"
  11300. },
  11301. "mdnsDomain": {
  11302. "type": "string"
  11303. },
  11304. "cors": {
  11305. "type": "array",
  11306. "items": {
  11307. "type": "string"
  11308. }
  11309. }
  11310. },
  11311. "additionalProperties": false,
  11312. "description": "Server configuration for opencode serve and web commands"
  11313. },
  11314. "ReferenceConfigEntry": {
  11315. "anyOf": [
  11316. {
  11317. "type": "string"
  11318. },
  11319. {
  11320. "type": "object",
  11321. "properties": {
  11322. "repository": {
  11323. "type": "string",
  11324. "description": "Git repository URL, host/path reference, or GitHub owner/repo shorthand"
  11325. },
  11326. "branch": {
  11327. "type": "string"
  11328. }
  11329. },
  11330. "required": ["repository"],
  11331. "additionalProperties": false
  11332. },
  11333. {
  11334. "type": "object",
  11335. "properties": {
  11336. "path": {
  11337. "type": "string",
  11338. "description": "Absolute path, ~/ path, or workspace-relative path to a local reference directory"
  11339. }
  11340. },
  11341. "required": ["path"],
  11342. "additionalProperties": false
  11343. }
  11344. ]
  11345. },
  11346. "ReferenceConfig": {
  11347. "type": "object",
  11348. "additionalProperties": {
  11349. "$ref": "#/components/schemas/ReferenceConfigEntry"
  11350. }
  11351. },
  11352. "PermissionActionConfig": {
  11353. "type": "string",
  11354. "enum": ["ask", "allow", "deny"]
  11355. },
  11356. "PermissionObjectConfig": {
  11357. "type": "object",
  11358. "additionalProperties": {
  11359. "$ref": "#/components/schemas/PermissionActionConfig"
  11360. }
  11361. },
  11362. "PermissionRuleConfig": {
  11363. "anyOf": [
  11364. {
  11365. "$ref": "#/components/schemas/PermissionActionConfig"
  11366. },
  11367. {
  11368. "$ref": "#/components/schemas/PermissionObjectConfig"
  11369. }
  11370. ]
  11371. },
  11372. "PermissionConfig": {
  11373. "anyOf": [
  11374. {
  11375. "$ref": "#/components/schemas/PermissionActionConfig"
  11376. },
  11377. {
  11378. "type": "object",
  11379. "properties": {
  11380. "read": {
  11381. "$ref": "#/components/schemas/PermissionRuleConfig"
  11382. },
  11383. "edit": {
  11384. "$ref": "#/components/schemas/PermissionRuleConfig"
  11385. },
  11386. "glob": {
  11387. "$ref": "#/components/schemas/PermissionRuleConfig"
  11388. },
  11389. "grep": {
  11390. "$ref": "#/components/schemas/PermissionRuleConfig"
  11391. },
  11392. "list": {
  11393. "$ref": "#/components/schemas/PermissionRuleConfig"
  11394. },
  11395. "bash": {
  11396. "$ref": "#/components/schemas/PermissionRuleConfig"
  11397. },
  11398. "task": {
  11399. "$ref": "#/components/schemas/PermissionRuleConfig"
  11400. },
  11401. "external_directory": {
  11402. "$ref": "#/components/schemas/PermissionRuleConfig"
  11403. },
  11404. "todowrite": {
  11405. "$ref": "#/components/schemas/PermissionActionConfig"
  11406. },
  11407. "question": {
  11408. "$ref": "#/components/schemas/PermissionActionConfig"
  11409. },
  11410. "webfetch": {
  11411. "$ref": "#/components/schemas/PermissionActionConfig"
  11412. },
  11413. "websearch": {
  11414. "$ref": "#/components/schemas/PermissionActionConfig"
  11415. },
  11416. "codesearch": {
  11417. "$ref": "#/components/schemas/PermissionActionConfig"
  11418. },
  11419. "repo_clone": {
  11420. "$ref": "#/components/schemas/PermissionRuleConfig"
  11421. },
  11422. "repo_overview": {
  11423. "$ref": "#/components/schemas/PermissionRuleConfig"
  11424. },
  11425. "lsp": {
  11426. "$ref": "#/components/schemas/PermissionRuleConfig"
  11427. },
  11428. "doom_loop": {
  11429. "$ref": "#/components/schemas/PermissionActionConfig"
  11430. },
  11431. "skill": {
  11432. "$ref": "#/components/schemas/PermissionRuleConfig"
  11433. }
  11434. },
  11435. "additionalProperties": {
  11436. "$ref": "#/components/schemas/PermissionRuleConfig"
  11437. }
  11438. }
  11439. ]
  11440. },
  11441. "AgentConfig": {
  11442. "type": "object",
  11443. "properties": {
  11444. "model": {
  11445. "type": "string"
  11446. },
  11447. "variant": {
  11448. "type": "string"
  11449. },
  11450. "temperature": {
  11451. "type": "number"
  11452. },
  11453. "top_p": {
  11454. "type": "number"
  11455. },
  11456. "prompt": {
  11457. "type": "string"
  11458. },
  11459. "tools": {
  11460. "type": "object",
  11461. "additionalProperties": {
  11462. "type": "boolean"
  11463. }
  11464. },
  11465. "disable": {
  11466. "type": "boolean"
  11467. },
  11468. "description": {
  11469. "type": "string"
  11470. },
  11471. "mode": {
  11472. "type": "string",
  11473. "enum": ["subagent", "primary", "all"]
  11474. },
  11475. "hidden": {
  11476. "type": "boolean"
  11477. },
  11478. "options": {
  11479. "type": "object"
  11480. },
  11481. "color": {
  11482. "anyOf": [
  11483. {
  11484. "type": "string",
  11485. "pattern": "^#[0-9a-fA-F]{6}$"
  11486. },
  11487. {
  11488. "type": "string",
  11489. "enum": ["primary", "secondary", "accent", "success", "warning", "error", "info"]
  11490. }
  11491. ],
  11492. "description": "Hex color code (e.g., #FF5733) or theme color (e.g., primary)"
  11493. },
  11494. "steps": {
  11495. "type": "integer",
  11496. "exclusiveMinimum": 0
  11497. },
  11498. "maxSteps": {
  11499. "type": "integer",
  11500. "exclusiveMinimum": 0
  11501. },
  11502. "permission": {
  11503. "$ref": "#/components/schemas/PermissionConfig"
  11504. }
  11505. },
  11506. "additionalProperties": {}
  11507. },
  11508. "ProviderConfig": {
  11509. "type": "object",
  11510. "properties": {
  11511. "api": {
  11512. "type": "string"
  11513. },
  11514. "name": {
  11515. "type": "string"
  11516. },
  11517. "env": {
  11518. "type": "array",
  11519. "items": {
  11520. "type": "string"
  11521. }
  11522. },
  11523. "id": {
  11524. "type": "string"
  11525. },
  11526. "npm": {
  11527. "type": "string"
  11528. },
  11529. "whitelist": {
  11530. "type": "array",
  11531. "items": {
  11532. "type": "string"
  11533. }
  11534. },
  11535. "blacklist": {
  11536. "type": "array",
  11537. "items": {
  11538. "type": "string"
  11539. }
  11540. },
  11541. "options": {
  11542. "type": "object",
  11543. "properties": {
  11544. "apiKey": {
  11545. "type": "string"
  11546. },
  11547. "baseURL": {
  11548. "type": "string"
  11549. },
  11550. "enterpriseUrl": {
  11551. "type": "string"
  11552. },
  11553. "setCacheKey": {
  11554. "type": "boolean"
  11555. },
  11556. "timeout": {
  11557. "anyOf": [
  11558. {
  11559. "type": "integer",
  11560. "exclusiveMinimum": 0
  11561. },
  11562. {
  11563. "type": "boolean",
  11564. "enum": [false]
  11565. }
  11566. ],
  11567. "description": "Timeout in milliseconds for requests to this provider. Default is 300000 (5 minutes). Set to false to disable timeout."
  11568. },
  11569. "chunkTimeout": {
  11570. "type": "integer",
  11571. "exclusiveMinimum": 0
  11572. }
  11573. },
  11574. "additionalProperties": {}
  11575. },
  11576. "models": {
  11577. "type": "object",
  11578. "additionalProperties": {
  11579. "type": "object",
  11580. "properties": {
  11581. "id": {
  11582. "type": "string"
  11583. },
  11584. "name": {
  11585. "type": "string"
  11586. },
  11587. "family": {
  11588. "type": "string"
  11589. },
  11590. "release_date": {
  11591. "type": "string"
  11592. },
  11593. "attachment": {
  11594. "type": "boolean"
  11595. },
  11596. "reasoning": {
  11597. "type": "boolean"
  11598. },
  11599. "temperature": {
  11600. "type": "boolean"
  11601. },
  11602. "tool_call": {
  11603. "type": "boolean"
  11604. },
  11605. "interleaved": {
  11606. "anyOf": [
  11607. {
  11608. "type": "boolean",
  11609. "enum": [true]
  11610. },
  11611. {
  11612. "type": "object",
  11613. "properties": {
  11614. "field": {
  11615. "type": "string",
  11616. "enum": ["reasoning_content", "reasoning_details"]
  11617. }
  11618. },
  11619. "required": ["field"],
  11620. "additionalProperties": false
  11621. }
  11622. ]
  11623. },
  11624. "cost": {
  11625. "type": "object",
  11626. "properties": {
  11627. "input": {
  11628. "type": "number"
  11629. },
  11630. "output": {
  11631. "type": "number"
  11632. },
  11633. "cache_read": {
  11634. "type": "number"
  11635. },
  11636. "cache_write": {
  11637. "type": "number"
  11638. },
  11639. "context_over_200k": {
  11640. "type": "object",
  11641. "properties": {
  11642. "input": {
  11643. "type": "number"
  11644. },
  11645. "output": {
  11646. "type": "number"
  11647. },
  11648. "cache_read": {
  11649. "type": "number"
  11650. },
  11651. "cache_write": {
  11652. "type": "number"
  11653. }
  11654. },
  11655. "required": ["input", "output"],
  11656. "additionalProperties": false
  11657. }
  11658. },
  11659. "required": ["input", "output"],
  11660. "additionalProperties": false
  11661. },
  11662. "limit": {
  11663. "type": "object",
  11664. "properties": {
  11665. "context": {
  11666. "type": "number"
  11667. },
  11668. "input": {
  11669. "type": "number"
  11670. },
  11671. "output": {
  11672. "type": "number"
  11673. }
  11674. },
  11675. "required": ["context", "output"],
  11676. "additionalProperties": false
  11677. },
  11678. "modalities": {
  11679. "type": "object",
  11680. "properties": {
  11681. "input": {
  11682. "type": "array",
  11683. "items": {
  11684. "type": "string",
  11685. "enum": ["text", "audio", "image", "video", "pdf"]
  11686. }
  11687. },
  11688. "output": {
  11689. "type": "array",
  11690. "items": {
  11691. "type": "string",
  11692. "enum": ["text", "audio", "image", "video", "pdf"]
  11693. }
  11694. }
  11695. },
  11696. "required": ["input", "output"],
  11697. "additionalProperties": false
  11698. },
  11699. "experimental": {
  11700. "type": "boolean"
  11701. },
  11702. "status": {
  11703. "type": "string",
  11704. "enum": ["alpha", "beta", "deprecated"]
  11705. },
  11706. "provider": {
  11707. "type": "object",
  11708. "properties": {
  11709. "npm": {
  11710. "type": "string"
  11711. },
  11712. "api": {
  11713. "type": "string"
  11714. }
  11715. },
  11716. "additionalProperties": false
  11717. },
  11718. "options": {
  11719. "type": "object"
  11720. },
  11721. "headers": {
  11722. "type": "object",
  11723. "additionalProperties": {
  11724. "type": "string"
  11725. }
  11726. },
  11727. "variants": {
  11728. "type": "object",
  11729. "additionalProperties": {
  11730. "type": "object",
  11731. "properties": {
  11732. "disabled": {
  11733. "type": "boolean"
  11734. }
  11735. },
  11736. "additionalProperties": {}
  11737. },
  11738. "description": "Variant-specific configuration"
  11739. }
  11740. },
  11741. "additionalProperties": false
  11742. }
  11743. }
  11744. },
  11745. "additionalProperties": false
  11746. },
  11747. "McpLocalConfig": {
  11748. "type": "object",
  11749. "properties": {
  11750. "type": {
  11751. "type": "string",
  11752. "enum": ["local"],
  11753. "description": "Type of MCP server connection"
  11754. },
  11755. "command": {
  11756. "type": "array",
  11757. "items": {
  11758. "type": "string"
  11759. },
  11760. "description": "Command and arguments to run the MCP server"
  11761. },
  11762. "environment": {
  11763. "type": "object",
  11764. "additionalProperties": {
  11765. "type": "string"
  11766. }
  11767. },
  11768. "enabled": {
  11769. "type": "boolean"
  11770. },
  11771. "timeout": {
  11772. "type": "integer",
  11773. "exclusiveMinimum": 0
  11774. }
  11775. },
  11776. "required": ["type", "command"],
  11777. "additionalProperties": false
  11778. },
  11779. "McpOAuthConfig": {
  11780. "type": "object",
  11781. "properties": {
  11782. "clientId": {
  11783. "type": "string"
  11784. },
  11785. "clientSecret": {
  11786. "type": "string"
  11787. },
  11788. "scope": {
  11789. "type": "string"
  11790. },
  11791. "redirectUri": {
  11792. "type": "string"
  11793. }
  11794. },
  11795. "additionalProperties": false
  11796. },
  11797. "McpRemoteConfig": {
  11798. "type": "object",
  11799. "properties": {
  11800. "type": {
  11801. "type": "string",
  11802. "enum": ["remote"],
  11803. "description": "Type of MCP server connection"
  11804. },
  11805. "url": {
  11806. "type": "string",
  11807. "description": "URL of the remote MCP server"
  11808. },
  11809. "enabled": {
  11810. "type": "boolean"
  11811. },
  11812. "headers": {
  11813. "type": "object",
  11814. "additionalProperties": {
  11815. "type": "string"
  11816. }
  11817. },
  11818. "oauth": {
  11819. "anyOf": [
  11820. {
  11821. "$ref": "#/components/schemas/McpOAuthConfig"
  11822. },
  11823. {
  11824. "type": "boolean",
  11825. "enum": [false]
  11826. }
  11827. ],
  11828. "description": "OAuth authentication configuration for the MCP server. Set to false to disable OAuth auto-detection."
  11829. },
  11830. "timeout": {
  11831. "type": "integer",
  11832. "exclusiveMinimum": 0
  11833. }
  11834. },
  11835. "required": ["type", "url"],
  11836. "additionalProperties": false
  11837. },
  11838. "LayoutConfig": {
  11839. "type": "string",
  11840. "enum": ["auto", "stretch"],
  11841. "description": "@deprecated Always uses stretch layout."
  11842. },
  11843. "Config": {
  11844. "type": "object",
  11845. "properties": {
  11846. "$schema": {
  11847. "type": "string"
  11848. },
  11849. "shell": {
  11850. "type": "string"
  11851. },
  11852. "logLevel": {
  11853. "$ref": "#/components/schemas/LogLevel"
  11854. },
  11855. "server": {
  11856. "$ref": "#/components/schemas/ServerConfig"
  11857. },
  11858. "command": {
  11859. "type": "object",
  11860. "additionalProperties": {
  11861. "type": "object",
  11862. "properties": {
  11863. "template": {
  11864. "type": "string"
  11865. },
  11866. "description": {
  11867. "type": "string"
  11868. },
  11869. "agent": {
  11870. "type": "string"
  11871. },
  11872. "model": {
  11873. "type": "string"
  11874. },
  11875. "subtask": {
  11876. "type": "boolean"
  11877. }
  11878. },
  11879. "required": ["template"],
  11880. "additionalProperties": false
  11881. }
  11882. },
  11883. "skills": {
  11884. "type": "object",
  11885. "properties": {
  11886. "paths": {
  11887. "type": "array",
  11888. "items": {
  11889. "type": "string"
  11890. }
  11891. },
  11892. "urls": {
  11893. "type": "array",
  11894. "items": {
  11895. "type": "string"
  11896. }
  11897. }
  11898. },
  11899. "additionalProperties": false
  11900. },
  11901. "reference": {
  11902. "$ref": "#/components/schemas/ReferenceConfig"
  11903. },
  11904. "watcher": {
  11905. "type": "object",
  11906. "properties": {
  11907. "ignore": {
  11908. "type": "array",
  11909. "items": {
  11910. "type": "string"
  11911. }
  11912. }
  11913. },
  11914. "additionalProperties": false
  11915. },
  11916. "snapshot": {
  11917. "type": "boolean"
  11918. },
  11919. "plugin": {
  11920. "type": "array",
  11921. "items": {
  11922. "anyOf": [
  11923. {
  11924. "type": "string"
  11925. },
  11926. {
  11927. "type": "array",
  11928. "prefixItems": [
  11929. {
  11930. "type": "string"
  11931. },
  11932. {
  11933. "type": "object"
  11934. }
  11935. ],
  11936. "maxItems": 2,
  11937. "minItems": 2
  11938. }
  11939. ]
  11940. }
  11941. },
  11942. "share": {
  11943. "type": "string",
  11944. "enum": ["manual", "auto", "disabled"]
  11945. },
  11946. "autoshare": {
  11947. "type": "boolean"
  11948. },
  11949. "autoupdate": {
  11950. "anyOf": [
  11951. {
  11952. "type": "boolean"
  11953. },
  11954. {
  11955. "type": "string",
  11956. "enum": ["notify"]
  11957. }
  11958. ],
  11959. "description": "Automatically update to the latest version. Set to true to auto-update, false to disable, or 'notify' to show update notifications"
  11960. },
  11961. "disabled_providers": {
  11962. "type": "array",
  11963. "items": {
  11964. "type": "string"
  11965. }
  11966. },
  11967. "enabled_providers": {
  11968. "type": "array",
  11969. "items": {
  11970. "type": "string"
  11971. }
  11972. },
  11973. "model": {
  11974. "type": "string"
  11975. },
  11976. "small_model": {
  11977. "type": "string"
  11978. },
  11979. "default_agent": {
  11980. "type": "string"
  11981. },
  11982. "username": {
  11983. "type": "string"
  11984. },
  11985. "mode": {
  11986. "type": "object",
  11987. "properties": {
  11988. "build": {
  11989. "$ref": "#/components/schemas/AgentConfig"
  11990. },
  11991. "plan": {
  11992. "$ref": "#/components/schemas/AgentConfig"
  11993. }
  11994. },
  11995. "additionalProperties": {
  11996. "$ref": "#/components/schemas/AgentConfig"
  11997. }
  11998. },
  11999. "agent": {
  12000. "type": "object",
  12001. "properties": {
  12002. "plan": {
  12003. "$ref": "#/components/schemas/AgentConfig"
  12004. },
  12005. "build": {
  12006. "$ref": "#/components/schemas/AgentConfig"
  12007. },
  12008. "general": {
  12009. "$ref": "#/components/schemas/AgentConfig"
  12010. },
  12011. "explore": {
  12012. "$ref": "#/components/schemas/AgentConfig"
  12013. },
  12014. "scout": {
  12015. "$ref": "#/components/schemas/AgentConfig"
  12016. },
  12017. "title": {
  12018. "$ref": "#/components/schemas/AgentConfig"
  12019. },
  12020. "summary": {
  12021. "$ref": "#/components/schemas/AgentConfig"
  12022. },
  12023. "compaction": {
  12024. "$ref": "#/components/schemas/AgentConfig"
  12025. }
  12026. },
  12027. "additionalProperties": {
  12028. "$ref": "#/components/schemas/AgentConfig"
  12029. }
  12030. },
  12031. "provider": {
  12032. "type": "object",
  12033. "additionalProperties": {
  12034. "$ref": "#/components/schemas/ProviderConfig"
  12035. }
  12036. },
  12037. "mcp": {
  12038. "type": "object",
  12039. "additionalProperties": {
  12040. "anyOf": [
  12041. {
  12042. "$ref": "#/components/schemas/McpLocalConfig"
  12043. },
  12044. {
  12045. "$ref": "#/components/schemas/McpRemoteConfig"
  12046. },
  12047. {
  12048. "type": "object",
  12049. "properties": {
  12050. "enabled": {
  12051. "type": "boolean"
  12052. }
  12053. },
  12054. "required": ["enabled"],
  12055. "additionalProperties": false
  12056. }
  12057. ]
  12058. }
  12059. },
  12060. "formatter": {
  12061. "anyOf": [
  12062. {
  12063. "type": "boolean"
  12064. },
  12065. {
  12066. "type": "object",
  12067. "additionalProperties": {
  12068. "type": "object",
  12069. "properties": {
  12070. "disabled": {
  12071. "type": "boolean"
  12072. },
  12073. "command": {
  12074. "type": "array",
  12075. "items": {
  12076. "type": "string"
  12077. }
  12078. },
  12079. "environment": {
  12080. "type": "object",
  12081. "additionalProperties": {
  12082. "type": "string"
  12083. }
  12084. },
  12085. "extensions": {
  12086. "type": "array",
  12087. "items": {
  12088. "type": "string"
  12089. }
  12090. }
  12091. },
  12092. "additionalProperties": false
  12093. }
  12094. }
  12095. ],
  12096. "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."
  12097. },
  12098. "lsp": {
  12099. "anyOf": [
  12100. {
  12101. "type": "boolean"
  12102. },
  12103. {
  12104. "type": "object",
  12105. "additionalProperties": {
  12106. "anyOf": [
  12107. {
  12108. "type": "object",
  12109. "properties": {
  12110. "disabled": {
  12111. "type": "boolean",
  12112. "enum": [true]
  12113. }
  12114. },
  12115. "required": ["disabled"],
  12116. "additionalProperties": false
  12117. },
  12118. {
  12119. "type": "object",
  12120. "properties": {
  12121. "command": {
  12122. "type": "array",
  12123. "items": {
  12124. "type": "string"
  12125. }
  12126. },
  12127. "extensions": {
  12128. "type": "array",
  12129. "items": {
  12130. "type": "string"
  12131. }
  12132. },
  12133. "disabled": {
  12134. "type": "boolean"
  12135. },
  12136. "env": {
  12137. "type": "object",
  12138. "additionalProperties": {
  12139. "type": "string"
  12140. }
  12141. },
  12142. "initialization": {
  12143. "type": "object"
  12144. }
  12145. },
  12146. "required": ["command"],
  12147. "additionalProperties": false
  12148. }
  12149. ]
  12150. }
  12151. }
  12152. ],
  12153. "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."
  12154. },
  12155. "instructions": {
  12156. "type": "array",
  12157. "items": {
  12158. "type": "string"
  12159. }
  12160. },
  12161. "layout": {
  12162. "$ref": "#/components/schemas/LayoutConfig"
  12163. },
  12164. "permission": {
  12165. "$ref": "#/components/schemas/PermissionConfig"
  12166. },
  12167. "tools": {
  12168. "type": "object",
  12169. "additionalProperties": {
  12170. "type": "boolean"
  12171. }
  12172. },
  12173. "enterprise": {
  12174. "type": "object",
  12175. "properties": {
  12176. "url": {
  12177. "type": "string"
  12178. }
  12179. },
  12180. "additionalProperties": false
  12181. },
  12182. "tool_output": {
  12183. "type": "object",
  12184. "properties": {
  12185. "max_lines": {
  12186. "type": "integer",
  12187. "exclusiveMinimum": 0
  12188. },
  12189. "max_bytes": {
  12190. "type": "integer",
  12191. "exclusiveMinimum": 0
  12192. }
  12193. },
  12194. "additionalProperties": false
  12195. },
  12196. "compaction": {
  12197. "type": "object",
  12198. "properties": {
  12199. "auto": {
  12200. "type": "boolean"
  12201. },
  12202. "prune": {
  12203. "type": "boolean"
  12204. },
  12205. "tail_turns": {
  12206. "type": "integer",
  12207. "minimum": 0
  12208. },
  12209. "preserve_recent_tokens": {
  12210. "type": "integer",
  12211. "minimum": 0
  12212. },
  12213. "reserved": {
  12214. "type": "integer",
  12215. "minimum": 0
  12216. }
  12217. },
  12218. "additionalProperties": false
  12219. },
  12220. "experimental": {
  12221. "type": "object",
  12222. "properties": {
  12223. "disable_paste_summary": {
  12224. "type": "boolean"
  12225. },
  12226. "batch_tool": {
  12227. "type": "boolean"
  12228. },
  12229. "openTelemetry": {
  12230. "type": "boolean"
  12231. },
  12232. "primary_tools": {
  12233. "type": "array",
  12234. "items": {
  12235. "type": "string"
  12236. }
  12237. },
  12238. "continue_loop_on_deny": {
  12239. "type": "boolean"
  12240. },
  12241. "mcp_timeout": {
  12242. "type": "integer",
  12243. "exclusiveMinimum": 0
  12244. }
  12245. },
  12246. "additionalProperties": false
  12247. }
  12248. },
  12249. "additionalProperties": false
  12250. },
  12251. "Model": {
  12252. "type": "object",
  12253. "properties": {
  12254. "id": {
  12255. "type": "string"
  12256. },
  12257. "providerID": {
  12258. "type": "string"
  12259. },
  12260. "api": {
  12261. "type": "object",
  12262. "properties": {
  12263. "id": {
  12264. "type": "string"
  12265. },
  12266. "url": {
  12267. "type": "string"
  12268. },
  12269. "npm": {
  12270. "type": "string"
  12271. }
  12272. },
  12273. "required": ["id", "url", "npm"],
  12274. "additionalProperties": false
  12275. },
  12276. "name": {
  12277. "type": "string"
  12278. },
  12279. "family": {
  12280. "type": "string"
  12281. },
  12282. "capabilities": {
  12283. "type": "object",
  12284. "properties": {
  12285. "temperature": {
  12286. "type": "boolean"
  12287. },
  12288. "reasoning": {
  12289. "type": "boolean"
  12290. },
  12291. "attachment": {
  12292. "type": "boolean"
  12293. },
  12294. "toolcall": {
  12295. "type": "boolean"
  12296. },
  12297. "input": {
  12298. "type": "object",
  12299. "properties": {
  12300. "text": {
  12301. "type": "boolean"
  12302. },
  12303. "audio": {
  12304. "type": "boolean"
  12305. },
  12306. "image": {
  12307. "type": "boolean"
  12308. },
  12309. "video": {
  12310. "type": "boolean"
  12311. },
  12312. "pdf": {
  12313. "type": "boolean"
  12314. }
  12315. },
  12316. "required": ["text", "audio", "image", "video", "pdf"],
  12317. "additionalProperties": false
  12318. },
  12319. "output": {
  12320. "type": "object",
  12321. "properties": {
  12322. "text": {
  12323. "type": "boolean"
  12324. },
  12325. "audio": {
  12326. "type": "boolean"
  12327. },
  12328. "image": {
  12329. "type": "boolean"
  12330. },
  12331. "video": {
  12332. "type": "boolean"
  12333. },
  12334. "pdf": {
  12335. "type": "boolean"
  12336. }
  12337. },
  12338. "required": ["text", "audio", "image", "video", "pdf"],
  12339. "additionalProperties": false
  12340. },
  12341. "interleaved": {
  12342. "anyOf": [
  12343. {
  12344. "type": "boolean"
  12345. },
  12346. {
  12347. "type": "object",
  12348. "properties": {
  12349. "field": {
  12350. "type": "string",
  12351. "enum": ["reasoning_content", "reasoning_details"]
  12352. }
  12353. },
  12354. "required": ["field"],
  12355. "additionalProperties": false
  12356. }
  12357. ]
  12358. }
  12359. },
  12360. "required": ["temperature", "reasoning", "attachment", "toolcall", "input", "output", "interleaved"],
  12361. "additionalProperties": false
  12362. },
  12363. "cost": {
  12364. "type": "object",
  12365. "properties": {
  12366. "input": {
  12367. "type": "number"
  12368. },
  12369. "output": {
  12370. "type": "number"
  12371. },
  12372. "cache": {
  12373. "type": "object",
  12374. "properties": {
  12375. "read": {
  12376. "type": "number"
  12377. },
  12378. "write": {
  12379. "type": "number"
  12380. }
  12381. },
  12382. "required": ["read", "write"],
  12383. "additionalProperties": false
  12384. },
  12385. "experimentalOver200K": {
  12386. "type": "object",
  12387. "properties": {
  12388. "input": {
  12389. "type": "number"
  12390. },
  12391. "output": {
  12392. "type": "number"
  12393. },
  12394. "cache": {
  12395. "type": "object",
  12396. "properties": {
  12397. "read": {
  12398. "type": "number"
  12399. },
  12400. "write": {
  12401. "type": "number"
  12402. }
  12403. },
  12404. "required": ["read", "write"],
  12405. "additionalProperties": false
  12406. }
  12407. },
  12408. "required": ["input", "output", "cache"],
  12409. "additionalProperties": false
  12410. }
  12411. },
  12412. "required": ["input", "output", "cache"],
  12413. "additionalProperties": false
  12414. },
  12415. "limit": {
  12416. "type": "object",
  12417. "properties": {
  12418. "context": {
  12419. "type": "number"
  12420. },
  12421. "input": {
  12422. "type": "number"
  12423. },
  12424. "output": {
  12425. "type": "number"
  12426. }
  12427. },
  12428. "required": ["context", "output"],
  12429. "additionalProperties": false
  12430. },
  12431. "status": {
  12432. "type": "string",
  12433. "enum": ["alpha", "beta", "deprecated", "active"]
  12434. },
  12435. "options": {
  12436. "type": "object"
  12437. },
  12438. "headers": {
  12439. "type": "object",
  12440. "additionalProperties": {
  12441. "type": "string"
  12442. }
  12443. },
  12444. "release_date": {
  12445. "type": "string"
  12446. },
  12447. "variants": {
  12448. "type": "object",
  12449. "additionalProperties": {
  12450. "type": "object"
  12451. }
  12452. }
  12453. },
  12454. "required": [
  12455. "id",
  12456. "providerID",
  12457. "api",
  12458. "name",
  12459. "capabilities",
  12460. "cost",
  12461. "limit",
  12462. "status",
  12463. "options",
  12464. "headers",
  12465. "release_date"
  12466. ],
  12467. "additionalProperties": false
  12468. },
  12469. "Provider": {
  12470. "type": "object",
  12471. "properties": {
  12472. "id": {
  12473. "type": "string"
  12474. },
  12475. "name": {
  12476. "type": "string"
  12477. },
  12478. "source": {
  12479. "type": "string",
  12480. "enum": ["env", "config", "custom", "api"]
  12481. },
  12482. "env": {
  12483. "type": "array",
  12484. "items": {
  12485. "type": "string"
  12486. }
  12487. },
  12488. "key": {
  12489. "type": "string"
  12490. },
  12491. "options": {
  12492. "type": "object"
  12493. },
  12494. "models": {
  12495. "type": "object",
  12496. "additionalProperties": {
  12497. "$ref": "#/components/schemas/Model"
  12498. }
  12499. }
  12500. },
  12501. "required": ["id", "name", "source", "env", "options", "models"],
  12502. "additionalProperties": false
  12503. },
  12504. "ConsoleState": {
  12505. "type": "object",
  12506. "properties": {
  12507. "consoleManagedProviders": {
  12508. "type": "array",
  12509. "items": {
  12510. "type": "string"
  12511. }
  12512. },
  12513. "activeOrgName": {
  12514. "type": "string"
  12515. },
  12516. "switchableOrgCount": {
  12517. "type": "integer",
  12518. "minimum": 0
  12519. }
  12520. },
  12521. "required": ["consoleManagedProviders", "switchableOrgCount"],
  12522. "additionalProperties": false
  12523. },
  12524. "ToolListItem": {
  12525. "type": "object",
  12526. "properties": {
  12527. "id": {
  12528. "type": "string"
  12529. },
  12530. "description": {
  12531. "type": "string"
  12532. },
  12533. "parameters": {}
  12534. },
  12535. "required": ["id", "description", "parameters"],
  12536. "additionalProperties": false
  12537. },
  12538. "ToolList": {
  12539. "type": "array",
  12540. "items": {
  12541. "$ref": "#/components/schemas/ToolListItem"
  12542. }
  12543. },
  12544. "ToolIDs": {
  12545. "type": "array",
  12546. "items": {
  12547. "type": "string"
  12548. }
  12549. },
  12550. "WorktreeCreateInput": {
  12551. "type": "object",
  12552. "properties": {
  12553. "name": {
  12554. "type": "string"
  12555. },
  12556. "startCommand": {
  12557. "type": "string",
  12558. "description": "Additional startup script to run after the project's start command"
  12559. }
  12560. },
  12561. "additionalProperties": false
  12562. },
  12563. "Worktree": {
  12564. "type": "object",
  12565. "properties": {
  12566. "name": {
  12567. "type": "string"
  12568. },
  12569. "branch": {
  12570. "type": "string"
  12571. },
  12572. "directory": {
  12573. "type": "string"
  12574. }
  12575. },
  12576. "required": ["name", "branch", "directory"],
  12577. "additionalProperties": false
  12578. },
  12579. "WorktreeRemoveInput": {
  12580. "type": "object",
  12581. "properties": {
  12582. "directory": {
  12583. "type": "string"
  12584. }
  12585. },
  12586. "required": ["directory"],
  12587. "additionalProperties": false
  12588. },
  12589. "WorktreeResetInput": {
  12590. "type": "object",
  12591. "properties": {
  12592. "directory": {
  12593. "type": "string"
  12594. }
  12595. },
  12596. "required": ["directory"],
  12597. "additionalProperties": false
  12598. },
  12599. "ProjectSummary": {
  12600. "type": "object",
  12601. "properties": {
  12602. "id": {
  12603. "type": "string"
  12604. },
  12605. "name": {
  12606. "type": "string"
  12607. },
  12608. "worktree": {
  12609. "type": "string"
  12610. }
  12611. },
  12612. "required": ["id", "worktree"],
  12613. "additionalProperties": false
  12614. },
  12615. "GlobalSession": {
  12616. "type": "object",
  12617. "properties": {
  12618. "id": {
  12619. "type": "string"
  12620. },
  12621. "slug": {
  12622. "type": "string"
  12623. },
  12624. "projectID": {
  12625. "type": "string"
  12626. },
  12627. "workspaceID": {
  12628. "type": "string"
  12629. },
  12630. "directory": {
  12631. "type": "string"
  12632. },
  12633. "path": {
  12634. "type": "string"
  12635. },
  12636. "parentID": {
  12637. "type": "string"
  12638. },
  12639. "summary": {
  12640. "type": "object",
  12641. "properties": {
  12642. "additions": {
  12643. "type": "integer",
  12644. "minimum": 0
  12645. },
  12646. "deletions": {
  12647. "type": "integer",
  12648. "minimum": 0
  12649. },
  12650. "files": {
  12651. "type": "integer",
  12652. "minimum": 0
  12653. },
  12654. "diffs": {
  12655. "type": "array",
  12656. "items": {
  12657. "$ref": "#/components/schemas/SnapshotFileDiff"
  12658. }
  12659. }
  12660. },
  12661. "required": ["additions", "deletions", "files"],
  12662. "additionalProperties": false
  12663. },
  12664. "share": {
  12665. "type": "object",
  12666. "properties": {
  12667. "url": {
  12668. "type": "string"
  12669. }
  12670. },
  12671. "required": ["url"],
  12672. "additionalProperties": false
  12673. },
  12674. "title": {
  12675. "type": "string"
  12676. },
  12677. "agent": {
  12678. "type": "string"
  12679. },
  12680. "model": {
  12681. "type": "object",
  12682. "properties": {
  12683. "id": {
  12684. "type": "string"
  12685. },
  12686. "providerID": {
  12687. "type": "string"
  12688. },
  12689. "variant": {
  12690. "type": "string"
  12691. }
  12692. },
  12693. "required": ["id", "providerID"],
  12694. "additionalProperties": false
  12695. },
  12696. "version": {
  12697. "type": "string"
  12698. },
  12699. "time": {
  12700. "type": "object",
  12701. "properties": {
  12702. "created": {
  12703. "type": "integer",
  12704. "minimum": 0
  12705. },
  12706. "updated": {
  12707. "type": "integer",
  12708. "minimum": 0
  12709. },
  12710. "compacting": {
  12711. "type": "integer",
  12712. "minimum": 0
  12713. },
  12714. "archived": {
  12715. "type": "number"
  12716. }
  12717. },
  12718. "required": ["created", "updated"],
  12719. "additionalProperties": false
  12720. },
  12721. "permission": {
  12722. "$ref": "#/components/schemas/PermissionRuleset"
  12723. },
  12724. "revert": {
  12725. "type": "object",
  12726. "properties": {
  12727. "messageID": {
  12728. "type": "string"
  12729. },
  12730. "partID": {
  12731. "type": "string"
  12732. },
  12733. "snapshot": {
  12734. "type": "string"
  12735. },
  12736. "diff": {
  12737. "type": "string"
  12738. }
  12739. },
  12740. "required": ["messageID"],
  12741. "additionalProperties": false
  12742. },
  12743. "project": {
  12744. "anyOf": [
  12745. {
  12746. "$ref": "#/components/schemas/ProjectSummary"
  12747. },
  12748. {
  12749. "type": "null"
  12750. }
  12751. ]
  12752. }
  12753. },
  12754. "required": ["id", "slug", "projectID", "directory", "title", "version", "time", "project"],
  12755. "additionalProperties": false
  12756. },
  12757. "McpResource": {
  12758. "type": "object",
  12759. "properties": {
  12760. "name": {
  12761. "type": "string"
  12762. },
  12763. "uri": {
  12764. "type": "string"
  12765. },
  12766. "description": {
  12767. "type": "string"
  12768. },
  12769. "mimeType": {
  12770. "type": "string"
  12771. },
  12772. "client": {
  12773. "type": "string"
  12774. }
  12775. },
  12776. "required": ["name", "uri", "client"],
  12777. "additionalProperties": false
  12778. },
  12779. "Symbol": {
  12780. "type": "object",
  12781. "properties": {
  12782. "name": {
  12783. "type": "string"
  12784. },
  12785. "kind": {
  12786. "type": "integer",
  12787. "minimum": 0
  12788. },
  12789. "location": {
  12790. "type": "object",
  12791. "properties": {
  12792. "uri": {
  12793. "type": "string"
  12794. },
  12795. "range": {
  12796. "$ref": "#/components/schemas/Range"
  12797. }
  12798. },
  12799. "required": ["uri", "range"],
  12800. "additionalProperties": false
  12801. }
  12802. },
  12803. "required": ["name", "kind", "location"],
  12804. "additionalProperties": false
  12805. },
  12806. "FileNode": {
  12807. "type": "object",
  12808. "properties": {
  12809. "name": {
  12810. "type": "string"
  12811. },
  12812. "path": {
  12813. "type": "string"
  12814. },
  12815. "absolute": {
  12816. "type": "string"
  12817. },
  12818. "type": {
  12819. "type": "string",
  12820. "enum": ["file", "directory"]
  12821. },
  12822. "ignored": {
  12823. "type": "boolean"
  12824. }
  12825. },
  12826. "required": ["name", "path", "absolute", "type", "ignored"],
  12827. "additionalProperties": false
  12828. },
  12829. "FileContent": {
  12830. "type": "object",
  12831. "properties": {
  12832. "type": {
  12833. "type": "string",
  12834. "enum": ["text", "binary"]
  12835. },
  12836. "content": {
  12837. "type": "string"
  12838. },
  12839. "diff": {
  12840. "type": "string"
  12841. },
  12842. "patch": {
  12843. "type": "object",
  12844. "properties": {
  12845. "oldFileName": {
  12846. "type": "string"
  12847. },
  12848. "newFileName": {
  12849. "type": "string"
  12850. },
  12851. "oldHeader": {
  12852. "type": "string"
  12853. },
  12854. "newHeader": {
  12855. "type": "string"
  12856. },
  12857. "hunks": {
  12858. "type": "array",
  12859. "items": {
  12860. "type": "object",
  12861. "properties": {
  12862. "oldStart": {
  12863. "type": "integer",
  12864. "minimum": 0
  12865. },
  12866. "oldLines": {
  12867. "type": "integer",
  12868. "minimum": 0
  12869. },
  12870. "newStart": {
  12871. "type": "integer",
  12872. "minimum": 0
  12873. },
  12874. "newLines": {
  12875. "type": "integer",
  12876. "minimum": 0
  12877. },
  12878. "lines": {
  12879. "type": "array",
  12880. "items": {
  12881. "type": "string"
  12882. }
  12883. }
  12884. },
  12885. "required": ["oldStart", "oldLines", "newStart", "newLines", "lines"],
  12886. "additionalProperties": false
  12887. }
  12888. },
  12889. "index": {
  12890. "type": "string"
  12891. }
  12892. },
  12893. "required": ["oldFileName", "newFileName", "hunks"],
  12894. "additionalProperties": false
  12895. },
  12896. "encoding": {
  12897. "type": "string",
  12898. "enum": ["base64"]
  12899. },
  12900. "mimeType": {
  12901. "type": "string"
  12902. }
  12903. },
  12904. "required": ["type", "content"],
  12905. "additionalProperties": false
  12906. },
  12907. "File": {
  12908. "type": "object",
  12909. "properties": {
  12910. "path": {
  12911. "type": "string"
  12912. },
  12913. "added": {
  12914. "type": "integer",
  12915. "minimum": 0
  12916. },
  12917. "removed": {
  12918. "type": "integer",
  12919. "minimum": 0
  12920. },
  12921. "status": {
  12922. "type": "string",
  12923. "enum": ["added", "deleted", "modified"]
  12924. }
  12925. },
  12926. "required": ["path", "added", "removed", "status"],
  12927. "additionalProperties": false
  12928. },
  12929. "Path": {
  12930. "type": "object",
  12931. "properties": {
  12932. "home": {
  12933. "type": "string"
  12934. },
  12935. "state": {
  12936. "type": "string"
  12937. },
  12938. "config": {
  12939. "type": "string"
  12940. },
  12941. "worktree": {
  12942. "type": "string"
  12943. },
  12944. "directory": {
  12945. "type": "string"
  12946. }
  12947. },
  12948. "required": ["home", "state", "config", "worktree", "directory"],
  12949. "additionalProperties": false
  12950. },
  12951. "VcsInfo": {
  12952. "type": "object",
  12953. "properties": {
  12954. "branch": {
  12955. "type": "string"
  12956. },
  12957. "default_branch": {
  12958. "type": "string"
  12959. }
  12960. },
  12961. "additionalProperties": false
  12962. },
  12963. "VcsFileStatus": {
  12964. "type": "object",
  12965. "properties": {
  12966. "file": {
  12967. "type": "string"
  12968. },
  12969. "additions": {
  12970. "type": "integer",
  12971. "minimum": 0
  12972. },
  12973. "deletions": {
  12974. "type": "integer",
  12975. "minimum": 0
  12976. },
  12977. "status": {
  12978. "type": "string",
  12979. "enum": ["added", "deleted", "modified"]
  12980. }
  12981. },
  12982. "required": ["file", "additions", "deletions", "status"],
  12983. "additionalProperties": false
  12984. },
  12985. "VcsFileDiff": {
  12986. "type": "object",
  12987. "properties": {
  12988. "file": {
  12989. "type": "string"
  12990. },
  12991. "patch": {
  12992. "type": "string"
  12993. },
  12994. "additions": {
  12995. "type": "integer",
  12996. "minimum": 0
  12997. },
  12998. "deletions": {
  12999. "type": "integer",
  13000. "minimum": 0
  13001. },
  13002. "status": {
  13003. "type": "string",
  13004. "enum": ["added", "deleted", "modified"]
  13005. }
  13006. },
  13007. "required": ["file", "patch", "additions", "deletions"],
  13008. "additionalProperties": false
  13009. },
  13010. "VcsApplyError": {
  13011. "type": "object",
  13012. "properties": {
  13013. "name": {
  13014. "type": "string",
  13015. "enum": ["VcsApplyError"]
  13016. },
  13017. "data": {
  13018. "type": "object",
  13019. "properties": {
  13020. "message": {
  13021. "type": "string"
  13022. },
  13023. "reason": {
  13024. "type": "string",
  13025. "enum": ["non-git", "not-clean"]
  13026. }
  13027. },
  13028. "required": ["message", "reason"],
  13029. "additionalProperties": false
  13030. }
  13031. },
  13032. "required": ["name", "data"],
  13033. "additionalProperties": false
  13034. },
  13035. "Command": {
  13036. "type": "object",
  13037. "properties": {
  13038. "name": {
  13039. "type": "string"
  13040. },
  13041. "description": {
  13042. "type": "string"
  13043. },
  13044. "agent": {
  13045. "type": "string"
  13046. },
  13047. "model": {
  13048. "type": "string"
  13049. },
  13050. "source": {
  13051. "type": "string",
  13052. "enum": ["command", "mcp", "skill"]
  13053. },
  13054. "template": {
  13055. "type": "string"
  13056. },
  13057. "subtask": {
  13058. "type": "boolean"
  13059. },
  13060. "hints": {
  13061. "type": "array",
  13062. "items": {
  13063. "type": "string"
  13064. }
  13065. }
  13066. },
  13067. "required": ["name", "template", "hints"],
  13068. "additionalProperties": false
  13069. },
  13070. "Agent": {
  13071. "type": "object",
  13072. "properties": {
  13073. "name": {
  13074. "type": "string"
  13075. },
  13076. "description": {
  13077. "type": "string"
  13078. },
  13079. "mode": {
  13080. "type": "string",
  13081. "enum": ["subagent", "primary", "all"]
  13082. },
  13083. "native": {
  13084. "type": "boolean"
  13085. },
  13086. "hidden": {
  13087. "type": "boolean"
  13088. },
  13089. "topP": {
  13090. "type": "number"
  13091. },
  13092. "temperature": {
  13093. "type": "number"
  13094. },
  13095. "color": {
  13096. "type": "string"
  13097. },
  13098. "permission": {
  13099. "$ref": "#/components/schemas/PermissionRuleset"
  13100. },
  13101. "model": {
  13102. "type": "object",
  13103. "properties": {
  13104. "modelID": {
  13105. "type": "string"
  13106. },
  13107. "providerID": {
  13108. "type": "string"
  13109. }
  13110. },
  13111. "required": ["modelID", "providerID"],
  13112. "additionalProperties": false
  13113. },
  13114. "variant": {
  13115. "type": "string"
  13116. },
  13117. "prompt": {
  13118. "type": "string"
  13119. },
  13120. "options": {
  13121. "type": "object"
  13122. },
  13123. "steps": {
  13124. "type": "number"
  13125. }
  13126. },
  13127. "required": ["name", "mode", "permission", "options"],
  13128. "additionalProperties": false
  13129. },
  13130. "LSPStatus": {
  13131. "type": "object",
  13132. "properties": {
  13133. "id": {
  13134. "type": "string"
  13135. },
  13136. "name": {
  13137. "type": "string"
  13138. },
  13139. "root": {
  13140. "type": "string"
  13141. },
  13142. "status": {
  13143. "type": "string",
  13144. "enum": ["connected", "error"]
  13145. }
  13146. },
  13147. "required": ["id", "name", "root", "status"],
  13148. "additionalProperties": false
  13149. },
  13150. "FormatterStatus": {
  13151. "type": "object",
  13152. "properties": {
  13153. "name": {
  13154. "type": "string"
  13155. },
  13156. "extensions": {
  13157. "type": "array",
  13158. "items": {
  13159. "type": "string"
  13160. }
  13161. },
  13162. "enabled": {
  13163. "type": "boolean"
  13164. }
  13165. },
  13166. "required": ["name", "extensions", "enabled"],
  13167. "additionalProperties": false
  13168. },
  13169. "MCPStatusConnected": {
  13170. "type": "object",
  13171. "properties": {
  13172. "status": {
  13173. "type": "string",
  13174. "enum": ["connected"]
  13175. }
  13176. },
  13177. "required": ["status"],
  13178. "additionalProperties": false
  13179. },
  13180. "MCPStatusDisabled": {
  13181. "type": "object",
  13182. "properties": {
  13183. "status": {
  13184. "type": "string",
  13185. "enum": ["disabled"]
  13186. }
  13187. },
  13188. "required": ["status"],
  13189. "additionalProperties": false
  13190. },
  13191. "MCPStatusFailed": {
  13192. "type": "object",
  13193. "properties": {
  13194. "status": {
  13195. "type": "string",
  13196. "enum": ["failed"]
  13197. },
  13198. "error": {
  13199. "type": "string"
  13200. }
  13201. },
  13202. "required": ["status", "error"],
  13203. "additionalProperties": false
  13204. },
  13205. "MCPStatusNeedsAuth": {
  13206. "type": "object",
  13207. "properties": {
  13208. "status": {
  13209. "type": "string",
  13210. "enum": ["needs_auth"]
  13211. }
  13212. },
  13213. "required": ["status"],
  13214. "additionalProperties": false
  13215. },
  13216. "MCPStatusNeedsClientRegistration": {
  13217. "type": "object",
  13218. "properties": {
  13219. "status": {
  13220. "type": "string",
  13221. "enum": ["needs_client_registration"]
  13222. },
  13223. "error": {
  13224. "type": "string"
  13225. }
  13226. },
  13227. "required": ["status", "error"],
  13228. "additionalProperties": false
  13229. },
  13230. "MCPStatus": {
  13231. "anyOf": [
  13232. {
  13233. "$ref": "#/components/schemas/MCPStatusConnected"
  13234. },
  13235. {
  13236. "$ref": "#/components/schemas/MCPStatusDisabled"
  13237. },
  13238. {
  13239. "$ref": "#/components/schemas/MCPStatusFailed"
  13240. },
  13241. {
  13242. "$ref": "#/components/schemas/MCPStatusNeedsAuth"
  13243. },
  13244. {
  13245. "$ref": "#/components/schemas/MCPStatusNeedsClientRegistration"
  13246. }
  13247. ]
  13248. },
  13249. "McpUnsupportedOAuthError": {
  13250. "type": "object",
  13251. "properties": {
  13252. "error": {
  13253. "type": "string"
  13254. }
  13255. },
  13256. "required": ["error"],
  13257. "additionalProperties": false
  13258. },
  13259. "NotFoundError": {
  13260. "type": "object",
  13261. "required": ["name", "data"],
  13262. "properties": {
  13263. "name": {
  13264. "type": "string",
  13265. "enum": ["NotFoundError"]
  13266. },
  13267. "data": {
  13268. "type": "object",
  13269. "required": ["message"],
  13270. "properties": {
  13271. "message": {
  13272. "type": "string"
  13273. }
  13274. }
  13275. }
  13276. }
  13277. },
  13278. "effect_HttpApiError_Forbidden": {
  13279. "type": "object",
  13280. "properties": {
  13281. "_tag": {
  13282. "type": "string",
  13283. "enum": ["Forbidden"]
  13284. }
  13285. },
  13286. "required": ["_tag"],
  13287. "additionalProperties": false
  13288. },
  13289. "ProviderAuthMethod": {
  13290. "type": "object",
  13291. "properties": {
  13292. "type": {
  13293. "type": "string",
  13294. "enum": ["oauth", "api"]
  13295. },
  13296. "label": {
  13297. "type": "string"
  13298. },
  13299. "prompts": {
  13300. "type": "array",
  13301. "items": {
  13302. "anyOf": [
  13303. {
  13304. "type": "object",
  13305. "properties": {
  13306. "type": {
  13307. "type": "string",
  13308. "enum": ["text"]
  13309. },
  13310. "key": {
  13311. "type": "string"
  13312. },
  13313. "message": {
  13314. "type": "string"
  13315. },
  13316. "placeholder": {
  13317. "type": "string"
  13318. },
  13319. "when": {
  13320. "type": "object",
  13321. "properties": {
  13322. "key": {
  13323. "type": "string"
  13324. },
  13325. "op": {
  13326. "type": "string",
  13327. "enum": ["eq", "neq"]
  13328. },
  13329. "value": {
  13330. "type": "string"
  13331. }
  13332. },
  13333. "required": ["key", "op", "value"],
  13334. "additionalProperties": false
  13335. }
  13336. },
  13337. "required": ["type", "key", "message"],
  13338. "additionalProperties": false
  13339. },
  13340. {
  13341. "type": "object",
  13342. "properties": {
  13343. "type": {
  13344. "type": "string",
  13345. "enum": ["select"]
  13346. },
  13347. "key": {
  13348. "type": "string"
  13349. },
  13350. "message": {
  13351. "type": "string"
  13352. },
  13353. "options": {
  13354. "type": "array",
  13355. "items": {
  13356. "type": "object",
  13357. "properties": {
  13358. "label": {
  13359. "type": "string"
  13360. },
  13361. "value": {
  13362. "type": "string"
  13363. },
  13364. "hint": {
  13365. "type": "string"
  13366. }
  13367. },
  13368. "required": ["label", "value"],
  13369. "additionalProperties": false
  13370. }
  13371. },
  13372. "when": {
  13373. "type": "object",
  13374. "properties": {
  13375. "key": {
  13376. "type": "string"
  13377. },
  13378. "op": {
  13379. "type": "string",
  13380. "enum": ["eq", "neq"]
  13381. },
  13382. "value": {
  13383. "type": "string"
  13384. }
  13385. },
  13386. "required": ["key", "op", "value"],
  13387. "additionalProperties": false
  13388. }
  13389. },
  13390. "required": ["type", "key", "message", "options"],
  13391. "additionalProperties": false
  13392. }
  13393. ]
  13394. }
  13395. }
  13396. },
  13397. "required": ["type", "label"],
  13398. "additionalProperties": false
  13399. },
  13400. "ProviderAuthAuthorization": {
  13401. "type": "object",
  13402. "properties": {
  13403. "url": {
  13404. "type": "string"
  13405. },
  13406. "method": {
  13407. "type": "string",
  13408. "enum": ["auto", "code"]
  13409. },
  13410. "instructions": {
  13411. "type": "string"
  13412. }
  13413. },
  13414. "required": ["url", "method", "instructions"],
  13415. "additionalProperties": false
  13416. },
  13417. "TextPartInput": {
  13418. "type": "object",
  13419. "properties": {
  13420. "id": {
  13421. "type": "string"
  13422. },
  13423. "type": {
  13424. "type": "string",
  13425. "enum": ["text"]
  13426. },
  13427. "text": {
  13428. "type": "string"
  13429. },
  13430. "synthetic": {
  13431. "type": "boolean"
  13432. },
  13433. "ignored": {
  13434. "type": "boolean"
  13435. },
  13436. "time": {
  13437. "type": "object",
  13438. "properties": {
  13439. "start": {
  13440. "type": "integer",
  13441. "minimum": 0
  13442. },
  13443. "end": {
  13444. "type": "integer",
  13445. "minimum": 0
  13446. }
  13447. },
  13448. "required": ["start"],
  13449. "additionalProperties": false
  13450. },
  13451. "metadata": {
  13452. "type": "object"
  13453. }
  13454. },
  13455. "required": ["type", "text"],
  13456. "additionalProperties": false
  13457. },
  13458. "FilePartInput": {
  13459. "type": "object",
  13460. "properties": {
  13461. "id": {
  13462. "type": "string"
  13463. },
  13464. "type": {
  13465. "type": "string",
  13466. "enum": ["file"]
  13467. },
  13468. "mime": {
  13469. "type": "string"
  13470. },
  13471. "filename": {
  13472. "type": "string"
  13473. },
  13474. "url": {
  13475. "type": "string"
  13476. },
  13477. "source": {
  13478. "$ref": "#/components/schemas/FilePartSource"
  13479. }
  13480. },
  13481. "required": ["type", "mime", "url"],
  13482. "additionalProperties": false
  13483. },
  13484. "AgentPartInput": {
  13485. "type": "object",
  13486. "properties": {
  13487. "id": {
  13488. "type": "string"
  13489. },
  13490. "type": {
  13491. "type": "string",
  13492. "enum": ["agent"]
  13493. },
  13494. "name": {
  13495. "type": "string"
  13496. },
  13497. "source": {
  13498. "type": "object",
  13499. "properties": {
  13500. "value": {
  13501. "type": "string"
  13502. },
  13503. "start": {
  13504. "type": "integer",
  13505. "minimum": 0
  13506. },
  13507. "end": {
  13508. "type": "integer",
  13509. "minimum": 0
  13510. }
  13511. },
  13512. "required": ["value", "start", "end"],
  13513. "additionalProperties": false
  13514. }
  13515. },
  13516. "required": ["type", "name"],
  13517. "additionalProperties": false
  13518. },
  13519. "SubtaskPartInput": {
  13520. "type": "object",
  13521. "properties": {
  13522. "id": {
  13523. "type": "string"
  13524. },
  13525. "type": {
  13526. "type": "string",
  13527. "enum": ["subtask"]
  13528. },
  13529. "prompt": {
  13530. "type": "string"
  13531. },
  13532. "description": {
  13533. "type": "string"
  13534. },
  13535. "agent": {
  13536. "type": "string"
  13537. },
  13538. "model": {
  13539. "type": "object",
  13540. "properties": {
  13541. "providerID": {
  13542. "type": "string"
  13543. },
  13544. "modelID": {
  13545. "type": "string"
  13546. }
  13547. },
  13548. "required": ["providerID", "modelID"],
  13549. "additionalProperties": false
  13550. },
  13551. "command": {
  13552. "type": "string"
  13553. }
  13554. },
  13555. "required": ["type", "prompt", "description", "agent"],
  13556. "additionalProperties": false
  13557. },
  13558. "V2SessionsResponse": {
  13559. "type": "object",
  13560. "properties": {
  13561. "items": {
  13562. "type": "array",
  13563. "items": {
  13564. "$ref": "#/components/schemas/SessionInfo"
  13565. }
  13566. },
  13567. "cursor": {
  13568. "type": "object",
  13569. "properties": {
  13570. "previous": {
  13571. "type": "string"
  13572. },
  13573. "next": {
  13574. "type": "string"
  13575. }
  13576. },
  13577. "additionalProperties": false
  13578. }
  13579. },
  13580. "required": ["items", "cursor"],
  13581. "additionalProperties": false
  13582. },
  13583. "V2SessionMessagesResponse": {
  13584. "type": "object",
  13585. "properties": {
  13586. "items": {
  13587. "type": "array",
  13588. "items": {
  13589. "$ref": "#/components/schemas/SessionMessage"
  13590. }
  13591. },
  13592. "cursor": {
  13593. "type": "object",
  13594. "properties": {
  13595. "previous": {
  13596. "type": "string"
  13597. },
  13598. "next": {
  13599. "type": "string"
  13600. }
  13601. },
  13602. "additionalProperties": false
  13603. }
  13604. },
  13605. "required": ["items", "cursor"],
  13606. "additionalProperties": false
  13607. },
  13608. "EventTuiPromptAppend": {
  13609. "type": "object",
  13610. "properties": {
  13611. "type": {
  13612. "type": "string",
  13613. "enum": ["tui.prompt.append"]
  13614. },
  13615. "properties": {
  13616. "type": "object",
  13617. "properties": {
  13618. "text": {
  13619. "type": "string"
  13620. }
  13621. },
  13622. "required": ["text"],
  13623. "additionalProperties": false
  13624. }
  13625. },
  13626. "required": ["type", "properties"],
  13627. "additionalProperties": false
  13628. },
  13629. "EventTuiCommandExecute": {
  13630. "type": "object",
  13631. "properties": {
  13632. "type": {
  13633. "type": "string",
  13634. "enum": ["tui.command.execute"]
  13635. },
  13636. "properties": {
  13637. "type": "object",
  13638. "properties": {
  13639. "command": {
  13640. "anyOf": [
  13641. {
  13642. "type": "string",
  13643. "enum": [
  13644. "session.list",
  13645. "session.new",
  13646. "session.share",
  13647. "session.interrupt",
  13648. "session.compact",
  13649. "session.page.up",
  13650. "session.page.down",
  13651. "session.line.up",
  13652. "session.line.down",
  13653. "session.half.page.up",
  13654. "session.half.page.down",
  13655. "session.first",
  13656. "session.last",
  13657. "prompt.clear",
  13658. "prompt.submit",
  13659. "agent.cycle"
  13660. ]
  13661. },
  13662. {
  13663. "type": "string"
  13664. }
  13665. ]
  13666. }
  13667. },
  13668. "required": ["command"],
  13669. "additionalProperties": false
  13670. }
  13671. },
  13672. "required": ["type", "properties"],
  13673. "additionalProperties": false
  13674. },
  13675. "EventTuiToastShow": {
  13676. "type": "object",
  13677. "properties": {
  13678. "type": {
  13679. "type": "string",
  13680. "enum": ["tui.toast.show"]
  13681. },
  13682. "properties": {
  13683. "type": "object",
  13684. "properties": {
  13685. "title": {
  13686. "type": "string"
  13687. },
  13688. "message": {
  13689. "type": "string"
  13690. },
  13691. "variant": {
  13692. "type": "string",
  13693. "enum": ["info", "success", "warning", "error"]
  13694. },
  13695. "duration": {
  13696. "type": "integer",
  13697. "exclusiveMinimum": 0
  13698. }
  13699. },
  13700. "required": ["message", "variant"],
  13701. "additionalProperties": false
  13702. }
  13703. },
  13704. "required": ["type", "properties"],
  13705. "additionalProperties": false
  13706. },
  13707. "EventTuiSessionSelect": {
  13708. "type": "object",
  13709. "properties": {
  13710. "type": {
  13711. "type": "string",
  13712. "enum": ["tui.session.select"]
  13713. },
  13714. "properties": {
  13715. "type": "object",
  13716. "properties": {
  13717. "sessionID": {
  13718. "type": "string",
  13719. "description": "Session ID to navigate to"
  13720. }
  13721. },
  13722. "required": ["sessionID"],
  13723. "additionalProperties": false
  13724. }
  13725. },
  13726. "required": ["type", "properties"],
  13727. "additionalProperties": false
  13728. },
  13729. "Workspace": {
  13730. "type": "object",
  13731. "properties": {
  13732. "id": {
  13733. "type": "string"
  13734. },
  13735. "type": {
  13736. "type": "string"
  13737. },
  13738. "name": {
  13739. "type": "string"
  13740. },
  13741. "branch": {
  13742. "anyOf": [
  13743. {
  13744. "type": "string"
  13745. },
  13746. {
  13747. "type": "null"
  13748. }
  13749. ]
  13750. },
  13751. "directory": {
  13752. "anyOf": [
  13753. {
  13754. "type": "string"
  13755. },
  13756. {
  13757. "type": "null"
  13758. }
  13759. ]
  13760. },
  13761. "extra": {
  13762. "anyOf": [
  13763. {},
  13764. {
  13765. "type": "null"
  13766. }
  13767. ]
  13768. },
  13769. "projectID": {
  13770. "type": "string"
  13771. },
  13772. "timeUsed": {
  13773. "anyOf": [
  13774. {
  13775. "type": "number"
  13776. },
  13777. {
  13778. "type": "string",
  13779. "enum": ["NaN"]
  13780. },
  13781. {
  13782. "type": "string",
  13783. "enum": ["Infinity"]
  13784. },
  13785. {
  13786. "type": "string",
  13787. "enum": ["-Infinity"]
  13788. },
  13789. {
  13790. "type": "string",
  13791. "enum": ["Infinity", "-Infinity", "NaN"]
  13792. }
  13793. ]
  13794. }
  13795. },
  13796. "required": ["id", "type", "name", "branch", "directory", "extra", "projectID", "timeUsed"],
  13797. "additionalProperties": false
  13798. },
  13799. "WorkspaceWarpError": {
  13800. "type": "object",
  13801. "properties": {
  13802. "name": {
  13803. "type": "string",
  13804. "enum": ["WorkspaceWarpError"]
  13805. },
  13806. "data": {
  13807. "type": "object",
  13808. "properties": {
  13809. "message": {
  13810. "type": "string"
  13811. }
  13812. },
  13813. "required": ["message"],
  13814. "additionalProperties": false
  13815. }
  13816. },
  13817. "required": ["name", "data"],
  13818. "additionalProperties": false
  13819. },
  13820. "SyncEventMessageUpdated": {
  13821. "type": "object",
  13822. "properties": {
  13823. "type": {
  13824. "type": "string",
  13825. "enum": ["sync"]
  13826. },
  13827. "name": {
  13828. "type": "string",
  13829. "enum": ["message.updated.1"]
  13830. },
  13831. "id": {
  13832. "type": "string"
  13833. },
  13834. "seq": {
  13835. "type": "number"
  13836. },
  13837. "aggregateID": {
  13838. "type": "string",
  13839. "enum": ["sessionID"]
  13840. },
  13841. "data": {
  13842. "type": "object",
  13843. "properties": {
  13844. "sessionID": {
  13845. "type": "string"
  13846. },
  13847. "info": {
  13848. "$ref": "#/components/schemas/Message"
  13849. }
  13850. },
  13851. "required": ["sessionID", "info"],
  13852. "additionalProperties": false
  13853. }
  13854. },
  13855. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  13856. "additionalProperties": false
  13857. },
  13858. "SyncEventMessageRemoved": {
  13859. "type": "object",
  13860. "properties": {
  13861. "type": {
  13862. "type": "string",
  13863. "enum": ["sync"]
  13864. },
  13865. "name": {
  13866. "type": "string",
  13867. "enum": ["message.removed.1"]
  13868. },
  13869. "id": {
  13870. "type": "string"
  13871. },
  13872. "seq": {
  13873. "type": "number"
  13874. },
  13875. "aggregateID": {
  13876. "type": "string",
  13877. "enum": ["sessionID"]
  13878. },
  13879. "data": {
  13880. "type": "object",
  13881. "properties": {
  13882. "sessionID": {
  13883. "type": "string"
  13884. },
  13885. "messageID": {
  13886. "type": "string"
  13887. }
  13888. },
  13889. "required": ["sessionID", "messageID"],
  13890. "additionalProperties": false
  13891. }
  13892. },
  13893. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  13894. "additionalProperties": false
  13895. },
  13896. "SyncEventMessagePartUpdated": {
  13897. "type": "object",
  13898. "properties": {
  13899. "type": {
  13900. "type": "string",
  13901. "enum": ["sync"]
  13902. },
  13903. "name": {
  13904. "type": "string",
  13905. "enum": ["message.part.updated.1"]
  13906. },
  13907. "id": {
  13908. "type": "string"
  13909. },
  13910. "seq": {
  13911. "type": "number"
  13912. },
  13913. "aggregateID": {
  13914. "type": "string",
  13915. "enum": ["sessionID"]
  13916. },
  13917. "data": {
  13918. "type": "object",
  13919. "properties": {
  13920. "sessionID": {
  13921. "type": "string"
  13922. },
  13923. "part": {
  13924. "$ref": "#/components/schemas/Part"
  13925. },
  13926. "time": {
  13927. "type": "integer",
  13928. "minimum": 0
  13929. }
  13930. },
  13931. "required": ["sessionID", "part", "time"],
  13932. "additionalProperties": false
  13933. }
  13934. },
  13935. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  13936. "additionalProperties": false
  13937. },
  13938. "SyncEventMessagePartRemoved": {
  13939. "type": "object",
  13940. "properties": {
  13941. "type": {
  13942. "type": "string",
  13943. "enum": ["sync"]
  13944. },
  13945. "name": {
  13946. "type": "string",
  13947. "enum": ["message.part.removed.1"]
  13948. },
  13949. "id": {
  13950. "type": "string"
  13951. },
  13952. "seq": {
  13953. "type": "number"
  13954. },
  13955. "aggregateID": {
  13956. "type": "string",
  13957. "enum": ["sessionID"]
  13958. },
  13959. "data": {
  13960. "type": "object",
  13961. "properties": {
  13962. "sessionID": {
  13963. "type": "string"
  13964. },
  13965. "messageID": {
  13966. "type": "string"
  13967. },
  13968. "partID": {
  13969. "type": "string"
  13970. }
  13971. },
  13972. "required": ["sessionID", "messageID", "partID"],
  13973. "additionalProperties": false
  13974. }
  13975. },
  13976. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  13977. "additionalProperties": false
  13978. },
  13979. "SyncEventSessionCreated": {
  13980. "type": "object",
  13981. "properties": {
  13982. "type": {
  13983. "type": "string",
  13984. "enum": ["sync"]
  13985. },
  13986. "name": {
  13987. "type": "string",
  13988. "enum": ["session.created.1"]
  13989. },
  13990. "id": {
  13991. "type": "string"
  13992. },
  13993. "seq": {
  13994. "type": "number"
  13995. },
  13996. "aggregateID": {
  13997. "type": "string",
  13998. "enum": ["sessionID"]
  13999. },
  14000. "data": {
  14001. "type": "object",
  14002. "properties": {
  14003. "sessionID": {
  14004. "type": "string"
  14005. },
  14006. "info": {
  14007. "$ref": "#/components/schemas/Session"
  14008. }
  14009. },
  14010. "required": ["sessionID", "info"],
  14011. "additionalProperties": false
  14012. }
  14013. },
  14014. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14015. "additionalProperties": false
  14016. },
  14017. "SyncEventSessionUpdated": {
  14018. "type": "object",
  14019. "properties": {
  14020. "type": {
  14021. "type": "string",
  14022. "enum": ["sync"]
  14023. },
  14024. "name": {
  14025. "type": "string",
  14026. "enum": ["session.updated.1"]
  14027. },
  14028. "id": {
  14029. "type": "string"
  14030. },
  14031. "seq": {
  14032. "type": "number"
  14033. },
  14034. "aggregateID": {
  14035. "type": "string",
  14036. "enum": ["sessionID"]
  14037. },
  14038. "data": {
  14039. "type": "object",
  14040. "properties": {
  14041. "sessionID": {
  14042. "type": "string"
  14043. },
  14044. "info": {
  14045. "type": "object",
  14046. "properties": {
  14047. "id": {
  14048. "anyOf": [
  14049. {
  14050. "type": "string"
  14051. },
  14052. {
  14053. "type": "null"
  14054. }
  14055. ]
  14056. },
  14057. "slug": {
  14058. "anyOf": [
  14059. {
  14060. "type": "string"
  14061. },
  14062. {
  14063. "type": "null"
  14064. }
  14065. ]
  14066. },
  14067. "projectID": {
  14068. "anyOf": [
  14069. {
  14070. "type": "string"
  14071. },
  14072. {
  14073. "type": "null"
  14074. }
  14075. ]
  14076. },
  14077. "workspaceID": {
  14078. "anyOf": [
  14079. {
  14080. "type": "string"
  14081. },
  14082. {
  14083. "type": "null"
  14084. }
  14085. ]
  14086. },
  14087. "directory": {
  14088. "anyOf": [
  14089. {
  14090. "type": "string"
  14091. },
  14092. {
  14093. "type": "null"
  14094. }
  14095. ]
  14096. },
  14097. "path": {
  14098. "anyOf": [
  14099. {
  14100. "type": "string"
  14101. },
  14102. {
  14103. "type": "null"
  14104. }
  14105. ]
  14106. },
  14107. "parentID": {
  14108. "anyOf": [
  14109. {
  14110. "type": "string"
  14111. },
  14112. {
  14113. "type": "null"
  14114. }
  14115. ]
  14116. },
  14117. "summary": {
  14118. "anyOf": [
  14119. {
  14120. "type": "object",
  14121. "properties": {
  14122. "additions": {
  14123. "type": "integer",
  14124. "minimum": 0
  14125. },
  14126. "deletions": {
  14127. "type": "integer",
  14128. "minimum": 0
  14129. },
  14130. "files": {
  14131. "type": "integer",
  14132. "minimum": 0
  14133. },
  14134. "diffs": {
  14135. "type": "array",
  14136. "items": {
  14137. "$ref": "#/components/schemas/SnapshotFileDiff"
  14138. }
  14139. }
  14140. },
  14141. "required": ["additions", "deletions", "files"],
  14142. "additionalProperties": false
  14143. },
  14144. {
  14145. "type": "null"
  14146. }
  14147. ]
  14148. },
  14149. "share": {
  14150. "type": "object",
  14151. "properties": {
  14152. "url": {
  14153. "anyOf": [
  14154. {
  14155. "type": "string"
  14156. },
  14157. {
  14158. "type": "null"
  14159. }
  14160. ]
  14161. }
  14162. },
  14163. "additionalProperties": false
  14164. },
  14165. "title": {
  14166. "anyOf": [
  14167. {
  14168. "type": "string"
  14169. },
  14170. {
  14171. "type": "null"
  14172. }
  14173. ]
  14174. },
  14175. "agent": {
  14176. "anyOf": [
  14177. {
  14178. "type": "string"
  14179. },
  14180. {
  14181. "type": "null"
  14182. }
  14183. ]
  14184. },
  14185. "model": {
  14186. "anyOf": [
  14187. {
  14188. "type": "object",
  14189. "properties": {
  14190. "id": {
  14191. "type": "string"
  14192. },
  14193. "providerID": {
  14194. "type": "string"
  14195. },
  14196. "variant": {
  14197. "type": "string"
  14198. }
  14199. },
  14200. "required": ["id", "providerID"],
  14201. "additionalProperties": false
  14202. },
  14203. {
  14204. "type": "null"
  14205. }
  14206. ]
  14207. },
  14208. "version": {
  14209. "anyOf": [
  14210. {
  14211. "type": "string"
  14212. },
  14213. {
  14214. "type": "null"
  14215. }
  14216. ]
  14217. },
  14218. "time": {
  14219. "type": "object",
  14220. "properties": {
  14221. "created": {
  14222. "anyOf": [
  14223. {
  14224. "type": "integer",
  14225. "minimum": 0
  14226. },
  14227. {
  14228. "type": "null"
  14229. }
  14230. ]
  14231. },
  14232. "updated": {
  14233. "anyOf": [
  14234. {
  14235. "type": "integer",
  14236. "minimum": 0
  14237. },
  14238. {
  14239. "type": "null"
  14240. }
  14241. ]
  14242. },
  14243. "compacting": {
  14244. "anyOf": [
  14245. {
  14246. "type": "integer",
  14247. "minimum": 0
  14248. },
  14249. {
  14250. "type": "null"
  14251. }
  14252. ]
  14253. },
  14254. "archived": {
  14255. "anyOf": [
  14256. {
  14257. "type": "number"
  14258. },
  14259. {
  14260. "type": "null"
  14261. }
  14262. ]
  14263. }
  14264. },
  14265. "additionalProperties": false
  14266. },
  14267. "permission": {
  14268. "anyOf": [
  14269. {
  14270. "$ref": "#/components/schemas/PermissionRuleset"
  14271. },
  14272. {
  14273. "type": "null"
  14274. }
  14275. ]
  14276. },
  14277. "revert": {
  14278. "anyOf": [
  14279. {
  14280. "type": "object",
  14281. "properties": {
  14282. "messageID": {
  14283. "type": "string"
  14284. },
  14285. "partID": {
  14286. "type": "string"
  14287. },
  14288. "snapshot": {
  14289. "type": "string"
  14290. },
  14291. "diff": {
  14292. "type": "string"
  14293. }
  14294. },
  14295. "required": ["messageID"],
  14296. "additionalProperties": false
  14297. },
  14298. {
  14299. "type": "null"
  14300. }
  14301. ]
  14302. }
  14303. },
  14304. "additionalProperties": false
  14305. }
  14306. },
  14307. "required": ["sessionID", "info"],
  14308. "additionalProperties": false
  14309. }
  14310. },
  14311. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14312. "additionalProperties": false
  14313. },
  14314. "SyncEventSessionDeleted": {
  14315. "type": "object",
  14316. "properties": {
  14317. "type": {
  14318. "type": "string",
  14319. "enum": ["sync"]
  14320. },
  14321. "name": {
  14322. "type": "string",
  14323. "enum": ["session.deleted.1"]
  14324. },
  14325. "id": {
  14326. "type": "string"
  14327. },
  14328. "seq": {
  14329. "type": "number"
  14330. },
  14331. "aggregateID": {
  14332. "type": "string",
  14333. "enum": ["sessionID"]
  14334. },
  14335. "data": {
  14336. "type": "object",
  14337. "properties": {
  14338. "sessionID": {
  14339. "type": "string"
  14340. },
  14341. "info": {
  14342. "$ref": "#/components/schemas/Session"
  14343. }
  14344. },
  14345. "required": ["sessionID", "info"],
  14346. "additionalProperties": false
  14347. }
  14348. },
  14349. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14350. "additionalProperties": false
  14351. },
  14352. "SyncEventSessionNextAgentSwitched": {
  14353. "type": "object",
  14354. "properties": {
  14355. "type": {
  14356. "type": "string",
  14357. "enum": ["sync"]
  14358. },
  14359. "name": {
  14360. "type": "string",
  14361. "enum": ["session.next.agent.switched.1"]
  14362. },
  14363. "id": {
  14364. "type": "string"
  14365. },
  14366. "seq": {
  14367. "type": "number"
  14368. },
  14369. "aggregateID": {
  14370. "type": "string",
  14371. "enum": ["sessionID"]
  14372. },
  14373. "data": {
  14374. "type": "object",
  14375. "properties": {
  14376. "timestamp": {
  14377. "type": "number"
  14378. },
  14379. "sessionID": {
  14380. "type": "string"
  14381. },
  14382. "agent": {
  14383. "type": "string"
  14384. }
  14385. },
  14386. "required": ["timestamp", "sessionID", "agent"],
  14387. "additionalProperties": false
  14388. }
  14389. },
  14390. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14391. "additionalProperties": false
  14392. },
  14393. "SyncEventSessionNextModelSwitched": {
  14394. "type": "object",
  14395. "properties": {
  14396. "type": {
  14397. "type": "string",
  14398. "enum": ["sync"]
  14399. },
  14400. "name": {
  14401. "type": "string",
  14402. "enum": ["session.next.model.switched.1"]
  14403. },
  14404. "id": {
  14405. "type": "string"
  14406. },
  14407. "seq": {
  14408. "type": "number"
  14409. },
  14410. "aggregateID": {
  14411. "type": "string",
  14412. "enum": ["sessionID"]
  14413. },
  14414. "data": {
  14415. "type": "object",
  14416. "properties": {
  14417. "timestamp": {
  14418. "type": "number"
  14419. },
  14420. "sessionID": {
  14421. "type": "string"
  14422. },
  14423. "model": {
  14424. "type": "object",
  14425. "properties": {
  14426. "id": {
  14427. "type": "string"
  14428. },
  14429. "providerID": {
  14430. "type": "string"
  14431. },
  14432. "variant": {
  14433. "type": "string"
  14434. }
  14435. },
  14436. "required": ["id", "providerID", "variant"],
  14437. "additionalProperties": false
  14438. }
  14439. },
  14440. "required": ["timestamp", "sessionID", "model"],
  14441. "additionalProperties": false
  14442. }
  14443. },
  14444. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14445. "additionalProperties": false
  14446. },
  14447. "SyncEventSessionNextPrompted": {
  14448. "type": "object",
  14449. "properties": {
  14450. "type": {
  14451. "type": "string",
  14452. "enum": ["sync"]
  14453. },
  14454. "name": {
  14455. "type": "string",
  14456. "enum": ["session.next.prompted.1"]
  14457. },
  14458. "id": {
  14459. "type": "string"
  14460. },
  14461. "seq": {
  14462. "type": "number"
  14463. },
  14464. "aggregateID": {
  14465. "type": "string",
  14466. "enum": ["sessionID"]
  14467. },
  14468. "data": {
  14469. "type": "object",
  14470. "properties": {
  14471. "timestamp": {
  14472. "type": "number"
  14473. },
  14474. "sessionID": {
  14475. "type": "string"
  14476. },
  14477. "prompt": {
  14478. "$ref": "#/components/schemas/Prompt"
  14479. }
  14480. },
  14481. "required": ["timestamp", "sessionID", "prompt"],
  14482. "additionalProperties": false
  14483. }
  14484. },
  14485. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14486. "additionalProperties": false
  14487. },
  14488. "SyncEventSessionNextSynthetic": {
  14489. "type": "object",
  14490. "properties": {
  14491. "type": {
  14492. "type": "string",
  14493. "enum": ["sync"]
  14494. },
  14495. "name": {
  14496. "type": "string",
  14497. "enum": ["session.next.synthetic.1"]
  14498. },
  14499. "id": {
  14500. "type": "string"
  14501. },
  14502. "seq": {
  14503. "type": "number"
  14504. },
  14505. "aggregateID": {
  14506. "type": "string",
  14507. "enum": ["sessionID"]
  14508. },
  14509. "data": {
  14510. "type": "object",
  14511. "properties": {
  14512. "timestamp": {
  14513. "type": "number"
  14514. },
  14515. "sessionID": {
  14516. "type": "string"
  14517. },
  14518. "text": {
  14519. "type": "string"
  14520. }
  14521. },
  14522. "required": ["timestamp", "sessionID", "text"],
  14523. "additionalProperties": false
  14524. }
  14525. },
  14526. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14527. "additionalProperties": false
  14528. },
  14529. "SyncEventSessionNextShellStarted": {
  14530. "type": "object",
  14531. "properties": {
  14532. "type": {
  14533. "type": "string",
  14534. "enum": ["sync"]
  14535. },
  14536. "name": {
  14537. "type": "string",
  14538. "enum": ["session.next.shell.started.1"]
  14539. },
  14540. "id": {
  14541. "type": "string"
  14542. },
  14543. "seq": {
  14544. "type": "number"
  14545. },
  14546. "aggregateID": {
  14547. "type": "string",
  14548. "enum": ["sessionID"]
  14549. },
  14550. "data": {
  14551. "type": "object",
  14552. "properties": {
  14553. "timestamp": {
  14554. "type": "number"
  14555. },
  14556. "sessionID": {
  14557. "type": "string"
  14558. },
  14559. "callID": {
  14560. "type": "string"
  14561. },
  14562. "command": {
  14563. "type": "string"
  14564. }
  14565. },
  14566. "required": ["timestamp", "sessionID", "callID", "command"],
  14567. "additionalProperties": false
  14568. }
  14569. },
  14570. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14571. "additionalProperties": false
  14572. },
  14573. "SyncEventSessionNextShellEnded": {
  14574. "type": "object",
  14575. "properties": {
  14576. "type": {
  14577. "type": "string",
  14578. "enum": ["sync"]
  14579. },
  14580. "name": {
  14581. "type": "string",
  14582. "enum": ["session.next.shell.ended.1"]
  14583. },
  14584. "id": {
  14585. "type": "string"
  14586. },
  14587. "seq": {
  14588. "type": "number"
  14589. },
  14590. "aggregateID": {
  14591. "type": "string",
  14592. "enum": ["sessionID"]
  14593. },
  14594. "data": {
  14595. "type": "object",
  14596. "properties": {
  14597. "timestamp": {
  14598. "type": "number"
  14599. },
  14600. "sessionID": {
  14601. "type": "string"
  14602. },
  14603. "callID": {
  14604. "type": "string"
  14605. },
  14606. "output": {
  14607. "type": "string"
  14608. }
  14609. },
  14610. "required": ["timestamp", "sessionID", "callID", "output"],
  14611. "additionalProperties": false
  14612. }
  14613. },
  14614. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14615. "additionalProperties": false
  14616. },
  14617. "SyncEventSessionNextStepStarted": {
  14618. "type": "object",
  14619. "properties": {
  14620. "type": {
  14621. "type": "string",
  14622. "enum": ["sync"]
  14623. },
  14624. "name": {
  14625. "type": "string",
  14626. "enum": ["session.next.step.started.1"]
  14627. },
  14628. "id": {
  14629. "type": "string"
  14630. },
  14631. "seq": {
  14632. "type": "number"
  14633. },
  14634. "aggregateID": {
  14635. "type": "string",
  14636. "enum": ["sessionID"]
  14637. },
  14638. "data": {
  14639. "type": "object",
  14640. "properties": {
  14641. "timestamp": {
  14642. "type": "number"
  14643. },
  14644. "sessionID": {
  14645. "type": "string"
  14646. },
  14647. "agent": {
  14648. "type": "string"
  14649. },
  14650. "model": {
  14651. "type": "object",
  14652. "properties": {
  14653. "id": {
  14654. "type": "string"
  14655. },
  14656. "providerID": {
  14657. "type": "string"
  14658. },
  14659. "variant": {
  14660. "type": "string"
  14661. }
  14662. },
  14663. "required": ["id", "providerID", "variant"],
  14664. "additionalProperties": false
  14665. },
  14666. "snapshot": {
  14667. "type": "string"
  14668. }
  14669. },
  14670. "required": ["timestamp", "sessionID", "agent", "model"],
  14671. "additionalProperties": false
  14672. }
  14673. },
  14674. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14675. "additionalProperties": false
  14676. },
  14677. "SyncEventSessionNextStepEnded": {
  14678. "type": "object",
  14679. "properties": {
  14680. "type": {
  14681. "type": "string",
  14682. "enum": ["sync"]
  14683. },
  14684. "name": {
  14685. "type": "string",
  14686. "enum": ["session.next.step.ended.1"]
  14687. },
  14688. "id": {
  14689. "type": "string"
  14690. },
  14691. "seq": {
  14692. "type": "number"
  14693. },
  14694. "aggregateID": {
  14695. "type": "string",
  14696. "enum": ["sessionID"]
  14697. },
  14698. "data": {
  14699. "type": "object",
  14700. "properties": {
  14701. "timestamp": {
  14702. "type": "number"
  14703. },
  14704. "sessionID": {
  14705. "type": "string"
  14706. },
  14707. "finish": {
  14708. "type": "string"
  14709. },
  14710. "cost": {
  14711. "type": "number"
  14712. },
  14713. "tokens": {
  14714. "type": "object",
  14715. "properties": {
  14716. "input": {
  14717. "type": "integer",
  14718. "minimum": 0
  14719. },
  14720. "output": {
  14721. "type": "integer",
  14722. "minimum": 0
  14723. },
  14724. "reasoning": {
  14725. "type": "integer",
  14726. "minimum": 0
  14727. },
  14728. "cache": {
  14729. "type": "object",
  14730. "properties": {
  14731. "read": {
  14732. "type": "integer",
  14733. "minimum": 0
  14734. },
  14735. "write": {
  14736. "type": "integer",
  14737. "minimum": 0
  14738. }
  14739. },
  14740. "required": ["read", "write"],
  14741. "additionalProperties": false
  14742. }
  14743. },
  14744. "required": ["input", "output", "reasoning", "cache"],
  14745. "additionalProperties": false
  14746. },
  14747. "snapshot": {
  14748. "type": "string"
  14749. }
  14750. },
  14751. "required": ["timestamp", "sessionID", "finish", "cost", "tokens"],
  14752. "additionalProperties": false
  14753. }
  14754. },
  14755. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14756. "additionalProperties": false
  14757. },
  14758. "SyncEventSessionNextStepFailed": {
  14759. "type": "object",
  14760. "properties": {
  14761. "type": {
  14762. "type": "string",
  14763. "enum": ["sync"]
  14764. },
  14765. "name": {
  14766. "type": "string",
  14767. "enum": ["session.next.step.failed.1"]
  14768. },
  14769. "id": {
  14770. "type": "string"
  14771. },
  14772. "seq": {
  14773. "type": "number"
  14774. },
  14775. "aggregateID": {
  14776. "type": "string",
  14777. "enum": ["sessionID"]
  14778. },
  14779. "data": {
  14780. "type": "object",
  14781. "properties": {
  14782. "timestamp": {
  14783. "type": "number"
  14784. },
  14785. "sessionID": {
  14786. "type": "string"
  14787. },
  14788. "error": {
  14789. "$ref": "#/components/schemas/SessionErrorUnknown"
  14790. }
  14791. },
  14792. "required": ["timestamp", "sessionID", "error"],
  14793. "additionalProperties": false
  14794. }
  14795. },
  14796. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14797. "additionalProperties": false
  14798. },
  14799. "SyncEventSessionNextTextStarted": {
  14800. "type": "object",
  14801. "properties": {
  14802. "type": {
  14803. "type": "string",
  14804. "enum": ["sync"]
  14805. },
  14806. "name": {
  14807. "type": "string",
  14808. "enum": ["session.next.text.started.1"]
  14809. },
  14810. "id": {
  14811. "type": "string"
  14812. },
  14813. "seq": {
  14814. "type": "number"
  14815. },
  14816. "aggregateID": {
  14817. "type": "string",
  14818. "enum": ["sessionID"]
  14819. },
  14820. "data": {
  14821. "type": "object",
  14822. "properties": {
  14823. "timestamp": {
  14824. "type": "number"
  14825. },
  14826. "sessionID": {
  14827. "type": "string"
  14828. }
  14829. },
  14830. "required": ["timestamp", "sessionID"],
  14831. "additionalProperties": false
  14832. }
  14833. },
  14834. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14835. "additionalProperties": false
  14836. },
  14837. "SyncEventSessionNextTextDelta": {
  14838. "type": "object",
  14839. "properties": {
  14840. "type": {
  14841. "type": "string",
  14842. "enum": ["sync"]
  14843. },
  14844. "name": {
  14845. "type": "string",
  14846. "enum": ["session.next.text.delta.1"]
  14847. },
  14848. "id": {
  14849. "type": "string"
  14850. },
  14851. "seq": {
  14852. "type": "number"
  14853. },
  14854. "aggregateID": {
  14855. "type": "string",
  14856. "enum": ["sessionID"]
  14857. },
  14858. "data": {
  14859. "type": "object",
  14860. "properties": {
  14861. "timestamp": {
  14862. "type": "number"
  14863. },
  14864. "sessionID": {
  14865. "type": "string"
  14866. },
  14867. "delta": {
  14868. "type": "string"
  14869. }
  14870. },
  14871. "required": ["timestamp", "sessionID", "delta"],
  14872. "additionalProperties": false
  14873. }
  14874. },
  14875. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14876. "additionalProperties": false
  14877. },
  14878. "SyncEventSessionNextTextEnded": {
  14879. "type": "object",
  14880. "properties": {
  14881. "type": {
  14882. "type": "string",
  14883. "enum": ["sync"]
  14884. },
  14885. "name": {
  14886. "type": "string",
  14887. "enum": ["session.next.text.ended.1"]
  14888. },
  14889. "id": {
  14890. "type": "string"
  14891. },
  14892. "seq": {
  14893. "type": "number"
  14894. },
  14895. "aggregateID": {
  14896. "type": "string",
  14897. "enum": ["sessionID"]
  14898. },
  14899. "data": {
  14900. "type": "object",
  14901. "properties": {
  14902. "timestamp": {
  14903. "type": "number"
  14904. },
  14905. "sessionID": {
  14906. "type": "string"
  14907. },
  14908. "text": {
  14909. "type": "string"
  14910. }
  14911. },
  14912. "required": ["timestamp", "sessionID", "text"],
  14913. "additionalProperties": false
  14914. }
  14915. },
  14916. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14917. "additionalProperties": false
  14918. },
  14919. "SyncEventSessionNextReasoningStarted": {
  14920. "type": "object",
  14921. "properties": {
  14922. "type": {
  14923. "type": "string",
  14924. "enum": ["sync"]
  14925. },
  14926. "name": {
  14927. "type": "string",
  14928. "enum": ["session.next.reasoning.started.1"]
  14929. },
  14930. "id": {
  14931. "type": "string"
  14932. },
  14933. "seq": {
  14934. "type": "number"
  14935. },
  14936. "aggregateID": {
  14937. "type": "string",
  14938. "enum": ["sessionID"]
  14939. },
  14940. "data": {
  14941. "type": "object",
  14942. "properties": {
  14943. "timestamp": {
  14944. "type": "number"
  14945. },
  14946. "sessionID": {
  14947. "type": "string"
  14948. },
  14949. "reasoningID": {
  14950. "type": "string"
  14951. }
  14952. },
  14953. "required": ["timestamp", "sessionID", "reasoningID"],
  14954. "additionalProperties": false
  14955. }
  14956. },
  14957. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14958. "additionalProperties": false
  14959. },
  14960. "SyncEventSessionNextReasoningDelta": {
  14961. "type": "object",
  14962. "properties": {
  14963. "type": {
  14964. "type": "string",
  14965. "enum": ["sync"]
  14966. },
  14967. "name": {
  14968. "type": "string",
  14969. "enum": ["session.next.reasoning.delta.1"]
  14970. },
  14971. "id": {
  14972. "type": "string"
  14973. },
  14974. "seq": {
  14975. "type": "number"
  14976. },
  14977. "aggregateID": {
  14978. "type": "string",
  14979. "enum": ["sessionID"]
  14980. },
  14981. "data": {
  14982. "type": "object",
  14983. "properties": {
  14984. "timestamp": {
  14985. "type": "number"
  14986. },
  14987. "sessionID": {
  14988. "type": "string"
  14989. },
  14990. "reasoningID": {
  14991. "type": "string"
  14992. },
  14993. "delta": {
  14994. "type": "string"
  14995. }
  14996. },
  14997. "required": ["timestamp", "sessionID", "reasoningID", "delta"],
  14998. "additionalProperties": false
  14999. }
  15000. },
  15001. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15002. "additionalProperties": false
  15003. },
  15004. "SyncEventSessionNextReasoningEnded": {
  15005. "type": "object",
  15006. "properties": {
  15007. "type": {
  15008. "type": "string",
  15009. "enum": ["sync"]
  15010. },
  15011. "name": {
  15012. "type": "string",
  15013. "enum": ["session.next.reasoning.ended.1"]
  15014. },
  15015. "id": {
  15016. "type": "string"
  15017. },
  15018. "seq": {
  15019. "type": "number"
  15020. },
  15021. "aggregateID": {
  15022. "type": "string",
  15023. "enum": ["sessionID"]
  15024. },
  15025. "data": {
  15026. "type": "object",
  15027. "properties": {
  15028. "timestamp": {
  15029. "type": "number"
  15030. },
  15031. "sessionID": {
  15032. "type": "string"
  15033. },
  15034. "reasoningID": {
  15035. "type": "string"
  15036. },
  15037. "text": {
  15038. "type": "string"
  15039. }
  15040. },
  15041. "required": ["timestamp", "sessionID", "reasoningID", "text"],
  15042. "additionalProperties": false
  15043. }
  15044. },
  15045. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15046. "additionalProperties": false
  15047. },
  15048. "SyncEventSessionNextToolInputStarted": {
  15049. "type": "object",
  15050. "properties": {
  15051. "type": {
  15052. "type": "string",
  15053. "enum": ["sync"]
  15054. },
  15055. "name": {
  15056. "type": "string",
  15057. "enum": ["session.next.tool.input.started.1"]
  15058. },
  15059. "id": {
  15060. "type": "string"
  15061. },
  15062. "seq": {
  15063. "type": "number"
  15064. },
  15065. "aggregateID": {
  15066. "type": "string",
  15067. "enum": ["sessionID"]
  15068. },
  15069. "data": {
  15070. "type": "object",
  15071. "properties": {
  15072. "timestamp": {
  15073. "type": "number"
  15074. },
  15075. "sessionID": {
  15076. "type": "string"
  15077. },
  15078. "callID": {
  15079. "type": "string"
  15080. },
  15081. "name": {
  15082. "type": "string"
  15083. }
  15084. },
  15085. "required": ["timestamp", "sessionID", "callID", "name"],
  15086. "additionalProperties": false
  15087. }
  15088. },
  15089. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15090. "additionalProperties": false
  15091. },
  15092. "SyncEventSessionNextToolInputDelta": {
  15093. "type": "object",
  15094. "properties": {
  15095. "type": {
  15096. "type": "string",
  15097. "enum": ["sync"]
  15098. },
  15099. "name": {
  15100. "type": "string",
  15101. "enum": ["session.next.tool.input.delta.1"]
  15102. },
  15103. "id": {
  15104. "type": "string"
  15105. },
  15106. "seq": {
  15107. "type": "number"
  15108. },
  15109. "aggregateID": {
  15110. "type": "string",
  15111. "enum": ["sessionID"]
  15112. },
  15113. "data": {
  15114. "type": "object",
  15115. "properties": {
  15116. "timestamp": {
  15117. "type": "number"
  15118. },
  15119. "sessionID": {
  15120. "type": "string"
  15121. },
  15122. "callID": {
  15123. "type": "string"
  15124. },
  15125. "delta": {
  15126. "type": "string"
  15127. }
  15128. },
  15129. "required": ["timestamp", "sessionID", "callID", "delta"],
  15130. "additionalProperties": false
  15131. }
  15132. },
  15133. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15134. "additionalProperties": false
  15135. },
  15136. "SyncEventSessionNextToolInputEnded": {
  15137. "type": "object",
  15138. "properties": {
  15139. "type": {
  15140. "type": "string",
  15141. "enum": ["sync"]
  15142. },
  15143. "name": {
  15144. "type": "string",
  15145. "enum": ["session.next.tool.input.ended.1"]
  15146. },
  15147. "id": {
  15148. "type": "string"
  15149. },
  15150. "seq": {
  15151. "type": "number"
  15152. },
  15153. "aggregateID": {
  15154. "type": "string",
  15155. "enum": ["sessionID"]
  15156. },
  15157. "data": {
  15158. "type": "object",
  15159. "properties": {
  15160. "timestamp": {
  15161. "type": "number"
  15162. },
  15163. "sessionID": {
  15164. "type": "string"
  15165. },
  15166. "callID": {
  15167. "type": "string"
  15168. },
  15169. "text": {
  15170. "type": "string"
  15171. }
  15172. },
  15173. "required": ["timestamp", "sessionID", "callID", "text"],
  15174. "additionalProperties": false
  15175. }
  15176. },
  15177. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15178. "additionalProperties": false
  15179. },
  15180. "SyncEventSessionNextToolCalled": {
  15181. "type": "object",
  15182. "properties": {
  15183. "type": {
  15184. "type": "string",
  15185. "enum": ["sync"]
  15186. },
  15187. "name": {
  15188. "type": "string",
  15189. "enum": ["session.next.tool.called.1"]
  15190. },
  15191. "id": {
  15192. "type": "string"
  15193. },
  15194. "seq": {
  15195. "type": "number"
  15196. },
  15197. "aggregateID": {
  15198. "type": "string",
  15199. "enum": ["sessionID"]
  15200. },
  15201. "data": {
  15202. "type": "object",
  15203. "properties": {
  15204. "timestamp": {
  15205. "type": "number"
  15206. },
  15207. "sessionID": {
  15208. "type": "string"
  15209. },
  15210. "callID": {
  15211. "type": "string"
  15212. },
  15213. "tool": {
  15214. "type": "string"
  15215. },
  15216. "input": {
  15217. "type": "object"
  15218. },
  15219. "provider": {
  15220. "type": "object",
  15221. "properties": {
  15222. "executed": {
  15223. "type": "boolean"
  15224. },
  15225. "metadata": {
  15226. "type": "object"
  15227. }
  15228. },
  15229. "required": ["executed"],
  15230. "additionalProperties": false
  15231. }
  15232. },
  15233. "required": ["timestamp", "sessionID", "callID", "tool", "input", "provider"],
  15234. "additionalProperties": false
  15235. }
  15236. },
  15237. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15238. "additionalProperties": false
  15239. },
  15240. "SyncEventSessionNextToolProgress": {
  15241. "type": "object",
  15242. "properties": {
  15243. "type": {
  15244. "type": "string",
  15245. "enum": ["sync"]
  15246. },
  15247. "name": {
  15248. "type": "string",
  15249. "enum": ["session.next.tool.progress.1"]
  15250. },
  15251. "id": {
  15252. "type": "string"
  15253. },
  15254. "seq": {
  15255. "type": "number"
  15256. },
  15257. "aggregateID": {
  15258. "type": "string",
  15259. "enum": ["sessionID"]
  15260. },
  15261. "data": {
  15262. "type": "object",
  15263. "properties": {
  15264. "timestamp": {
  15265. "type": "number"
  15266. },
  15267. "sessionID": {
  15268. "type": "string"
  15269. },
  15270. "callID": {
  15271. "type": "string"
  15272. },
  15273. "structured": {
  15274. "type": "object"
  15275. },
  15276. "content": {
  15277. "type": "array",
  15278. "items": {
  15279. "anyOf": [
  15280. {
  15281. "$ref": "#/components/schemas/ToolTextContent"
  15282. },
  15283. {
  15284. "$ref": "#/components/schemas/ToolFileContent"
  15285. }
  15286. ]
  15287. }
  15288. }
  15289. },
  15290. "required": ["timestamp", "sessionID", "callID", "structured", "content"],
  15291. "additionalProperties": false
  15292. }
  15293. },
  15294. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15295. "additionalProperties": false
  15296. },
  15297. "SyncEventSessionNextToolSuccess": {
  15298. "type": "object",
  15299. "properties": {
  15300. "type": {
  15301. "type": "string",
  15302. "enum": ["sync"]
  15303. },
  15304. "name": {
  15305. "type": "string",
  15306. "enum": ["session.next.tool.success.1"]
  15307. },
  15308. "id": {
  15309. "type": "string"
  15310. },
  15311. "seq": {
  15312. "type": "number"
  15313. },
  15314. "aggregateID": {
  15315. "type": "string",
  15316. "enum": ["sessionID"]
  15317. },
  15318. "data": {
  15319. "type": "object",
  15320. "properties": {
  15321. "timestamp": {
  15322. "type": "number"
  15323. },
  15324. "sessionID": {
  15325. "type": "string"
  15326. },
  15327. "callID": {
  15328. "type": "string"
  15329. },
  15330. "structured": {
  15331. "type": "object"
  15332. },
  15333. "content": {
  15334. "type": "array",
  15335. "items": {
  15336. "anyOf": [
  15337. {
  15338. "$ref": "#/components/schemas/ToolTextContent"
  15339. },
  15340. {
  15341. "$ref": "#/components/schemas/ToolFileContent"
  15342. }
  15343. ]
  15344. }
  15345. },
  15346. "provider": {
  15347. "type": "object",
  15348. "properties": {
  15349. "executed": {
  15350. "type": "boolean"
  15351. },
  15352. "metadata": {
  15353. "type": "object"
  15354. }
  15355. },
  15356. "required": ["executed"],
  15357. "additionalProperties": false
  15358. }
  15359. },
  15360. "required": ["timestamp", "sessionID", "callID", "structured", "content", "provider"],
  15361. "additionalProperties": false
  15362. }
  15363. },
  15364. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15365. "additionalProperties": false
  15366. },
  15367. "SyncEventSessionNextToolFailed": {
  15368. "type": "object",
  15369. "properties": {
  15370. "type": {
  15371. "type": "string",
  15372. "enum": ["sync"]
  15373. },
  15374. "name": {
  15375. "type": "string",
  15376. "enum": ["session.next.tool.failed.1"]
  15377. },
  15378. "id": {
  15379. "type": "string"
  15380. },
  15381. "seq": {
  15382. "type": "number"
  15383. },
  15384. "aggregateID": {
  15385. "type": "string",
  15386. "enum": ["sessionID"]
  15387. },
  15388. "data": {
  15389. "type": "object",
  15390. "properties": {
  15391. "timestamp": {
  15392. "type": "number"
  15393. },
  15394. "sessionID": {
  15395. "type": "string"
  15396. },
  15397. "callID": {
  15398. "type": "string"
  15399. },
  15400. "error": {
  15401. "$ref": "#/components/schemas/SessionErrorUnknown"
  15402. },
  15403. "provider": {
  15404. "type": "object",
  15405. "properties": {
  15406. "executed": {
  15407. "type": "boolean"
  15408. },
  15409. "metadata": {
  15410. "type": "object"
  15411. }
  15412. },
  15413. "required": ["executed"],
  15414. "additionalProperties": false
  15415. }
  15416. },
  15417. "required": ["timestamp", "sessionID", "callID", "error", "provider"],
  15418. "additionalProperties": false
  15419. }
  15420. },
  15421. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15422. "additionalProperties": false
  15423. },
  15424. "SyncEventSessionNextRetried": {
  15425. "type": "object",
  15426. "properties": {
  15427. "type": {
  15428. "type": "string",
  15429. "enum": ["sync"]
  15430. },
  15431. "name": {
  15432. "type": "string",
  15433. "enum": ["session.next.retried.1"]
  15434. },
  15435. "id": {
  15436. "type": "string"
  15437. },
  15438. "seq": {
  15439. "type": "number"
  15440. },
  15441. "aggregateID": {
  15442. "type": "string",
  15443. "enum": ["sessionID"]
  15444. },
  15445. "data": {
  15446. "type": "object",
  15447. "properties": {
  15448. "timestamp": {
  15449. "type": "number"
  15450. },
  15451. "sessionID": {
  15452. "type": "string"
  15453. },
  15454. "attempt": {
  15455. "type": "integer",
  15456. "minimum": 0
  15457. },
  15458. "error": {
  15459. "$ref": "#/components/schemas/SessionNextRetry_error"
  15460. }
  15461. },
  15462. "required": ["timestamp", "sessionID", "attempt", "error"],
  15463. "additionalProperties": false
  15464. }
  15465. },
  15466. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15467. "additionalProperties": false
  15468. },
  15469. "SyncEventSessionNextCompactionStarted": {
  15470. "type": "object",
  15471. "properties": {
  15472. "type": {
  15473. "type": "string",
  15474. "enum": ["sync"]
  15475. },
  15476. "name": {
  15477. "type": "string",
  15478. "enum": ["session.next.compaction.started.1"]
  15479. },
  15480. "id": {
  15481. "type": "string"
  15482. },
  15483. "seq": {
  15484. "type": "number"
  15485. },
  15486. "aggregateID": {
  15487. "type": "string",
  15488. "enum": ["sessionID"]
  15489. },
  15490. "data": {
  15491. "type": "object",
  15492. "properties": {
  15493. "timestamp": {
  15494. "type": "number"
  15495. },
  15496. "sessionID": {
  15497. "type": "string"
  15498. },
  15499. "reason": {
  15500. "type": "string",
  15501. "enum": ["auto", "manual"]
  15502. }
  15503. },
  15504. "required": ["timestamp", "sessionID", "reason"],
  15505. "additionalProperties": false
  15506. }
  15507. },
  15508. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15509. "additionalProperties": false
  15510. },
  15511. "SyncEventSessionNextCompactionDelta": {
  15512. "type": "object",
  15513. "properties": {
  15514. "type": {
  15515. "type": "string",
  15516. "enum": ["sync"]
  15517. },
  15518. "name": {
  15519. "type": "string",
  15520. "enum": ["session.next.compaction.delta.1"]
  15521. },
  15522. "id": {
  15523. "type": "string"
  15524. },
  15525. "seq": {
  15526. "type": "number"
  15527. },
  15528. "aggregateID": {
  15529. "type": "string",
  15530. "enum": ["sessionID"]
  15531. },
  15532. "data": {
  15533. "type": "object",
  15534. "properties": {
  15535. "timestamp": {
  15536. "type": "number"
  15537. },
  15538. "sessionID": {
  15539. "type": "string"
  15540. },
  15541. "text": {
  15542. "type": "string"
  15543. }
  15544. },
  15545. "required": ["timestamp", "sessionID", "text"],
  15546. "additionalProperties": false
  15547. }
  15548. },
  15549. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15550. "additionalProperties": false
  15551. },
  15552. "SyncEventSessionNextCompactionEnded": {
  15553. "type": "object",
  15554. "properties": {
  15555. "type": {
  15556. "type": "string",
  15557. "enum": ["sync"]
  15558. },
  15559. "name": {
  15560. "type": "string",
  15561. "enum": ["session.next.compaction.ended.1"]
  15562. },
  15563. "id": {
  15564. "type": "string"
  15565. },
  15566. "seq": {
  15567. "type": "number"
  15568. },
  15569. "aggregateID": {
  15570. "type": "string",
  15571. "enum": ["sessionID"]
  15572. },
  15573. "data": {
  15574. "type": "object",
  15575. "properties": {
  15576. "timestamp": {
  15577. "type": "number"
  15578. },
  15579. "sessionID": {
  15580. "type": "string"
  15581. },
  15582. "text": {
  15583. "type": "string"
  15584. },
  15585. "include": {
  15586. "type": "string"
  15587. }
  15588. },
  15589. "required": ["timestamp", "sessionID", "text"],
  15590. "additionalProperties": false
  15591. }
  15592. },
  15593. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15594. "additionalProperties": false
  15595. },
  15596. "EventServerInstanceDisposed": {
  15597. "type": "object",
  15598. "properties": {
  15599. "id": {
  15600. "type": "string"
  15601. },
  15602. "type": {
  15603. "type": "string",
  15604. "enum": ["server.instance.disposed"]
  15605. },
  15606. "properties": {
  15607. "type": "object",
  15608. "properties": {
  15609. "directory": {
  15610. "type": "string"
  15611. }
  15612. },
  15613. "required": ["directory"],
  15614. "additionalProperties": false
  15615. }
  15616. },
  15617. "required": ["id", "type", "properties"],
  15618. "additionalProperties": false
  15619. },
  15620. "EventFileEdited": {
  15621. "type": "object",
  15622. "properties": {
  15623. "id": {
  15624. "type": "string"
  15625. },
  15626. "type": {
  15627. "type": "string",
  15628. "enum": ["file.edited"]
  15629. },
  15630. "properties": {
  15631. "type": "object",
  15632. "properties": {
  15633. "file": {
  15634. "type": "string"
  15635. }
  15636. },
  15637. "required": ["file"],
  15638. "additionalProperties": false
  15639. }
  15640. },
  15641. "required": ["id", "type", "properties"],
  15642. "additionalProperties": false
  15643. },
  15644. "EventFileWatcherUpdated": {
  15645. "type": "object",
  15646. "properties": {
  15647. "id": {
  15648. "type": "string"
  15649. },
  15650. "type": {
  15651. "type": "string",
  15652. "enum": ["file.watcher.updated"]
  15653. },
  15654. "properties": {
  15655. "type": "object",
  15656. "properties": {
  15657. "file": {
  15658. "type": "string"
  15659. },
  15660. "event": {
  15661. "type": "string",
  15662. "enum": ["add", "change", "unlink"]
  15663. }
  15664. },
  15665. "required": ["file", "event"],
  15666. "additionalProperties": false
  15667. }
  15668. },
  15669. "required": ["id", "type", "properties"],
  15670. "additionalProperties": false
  15671. },
  15672. "EventLspClientDiagnostics": {
  15673. "type": "object",
  15674. "properties": {
  15675. "id": {
  15676. "type": "string"
  15677. },
  15678. "type": {
  15679. "type": "string",
  15680. "enum": ["lsp.client.diagnostics"]
  15681. },
  15682. "properties": {
  15683. "type": "object",
  15684. "properties": {
  15685. "serverID": {
  15686. "type": "string"
  15687. },
  15688. "path": {
  15689. "type": "string"
  15690. }
  15691. },
  15692. "required": ["serverID", "path"],
  15693. "additionalProperties": false
  15694. }
  15695. },
  15696. "required": ["id", "type", "properties"],
  15697. "additionalProperties": false
  15698. },
  15699. "EventLspUpdated": {
  15700. "type": "object",
  15701. "properties": {
  15702. "id": {
  15703. "type": "string"
  15704. },
  15705. "type": {
  15706. "type": "string",
  15707. "enum": ["lsp.updated"]
  15708. },
  15709. "properties": {
  15710. "type": "object",
  15711. "properties": {}
  15712. }
  15713. },
  15714. "required": ["id", "type", "properties"],
  15715. "additionalProperties": false
  15716. },
  15717. "EventMessagePartDelta": {
  15718. "type": "object",
  15719. "properties": {
  15720. "id": {
  15721. "type": "string"
  15722. },
  15723. "type": {
  15724. "type": "string",
  15725. "enum": ["message.part.delta"]
  15726. },
  15727. "properties": {
  15728. "type": "object",
  15729. "properties": {
  15730. "sessionID": {
  15731. "type": "string"
  15732. },
  15733. "messageID": {
  15734. "type": "string"
  15735. },
  15736. "partID": {
  15737. "type": "string"
  15738. },
  15739. "field": {
  15740. "type": "string"
  15741. },
  15742. "delta": {
  15743. "type": "string"
  15744. }
  15745. },
  15746. "required": ["sessionID", "messageID", "partID", "field", "delta"],
  15747. "additionalProperties": false
  15748. }
  15749. },
  15750. "required": ["id", "type", "properties"],
  15751. "additionalProperties": false
  15752. },
  15753. "EventPermissionAsked": {
  15754. "type": "object",
  15755. "properties": {
  15756. "id": {
  15757. "type": "string"
  15758. },
  15759. "type": {
  15760. "type": "string",
  15761. "enum": ["permission.asked"]
  15762. },
  15763. "properties": {
  15764. "$ref": "#/components/schemas/PermissionRequest"
  15765. }
  15766. },
  15767. "required": ["id", "type", "properties"],
  15768. "additionalProperties": false
  15769. },
  15770. "EventPermissionReplied": {
  15771. "type": "object",
  15772. "properties": {
  15773. "id": {
  15774. "type": "string"
  15775. },
  15776. "type": {
  15777. "type": "string",
  15778. "enum": ["permission.replied"]
  15779. },
  15780. "properties": {
  15781. "type": "object",
  15782. "properties": {
  15783. "sessionID": {
  15784. "type": "string"
  15785. },
  15786. "requestID": {
  15787. "type": "string"
  15788. },
  15789. "reply": {
  15790. "type": "string",
  15791. "enum": ["once", "always", "reject"]
  15792. }
  15793. },
  15794. "required": ["sessionID", "requestID", "reply"],
  15795. "additionalProperties": false
  15796. }
  15797. },
  15798. "required": ["id", "type", "properties"],
  15799. "additionalProperties": false
  15800. },
  15801. "EventSessionDiff": {
  15802. "type": "object",
  15803. "properties": {
  15804. "id": {
  15805. "type": "string"
  15806. },
  15807. "type": {
  15808. "type": "string",
  15809. "enum": ["session.diff"]
  15810. },
  15811. "properties": {
  15812. "type": "object",
  15813. "properties": {
  15814. "sessionID": {
  15815. "type": "string"
  15816. },
  15817. "diff": {
  15818. "type": "array",
  15819. "items": {
  15820. "$ref": "#/components/schemas/SnapshotFileDiff"
  15821. }
  15822. }
  15823. },
  15824. "required": ["sessionID", "diff"],
  15825. "additionalProperties": false
  15826. }
  15827. },
  15828. "required": ["id", "type", "properties"],
  15829. "additionalProperties": false
  15830. },
  15831. "EventSessionError": {
  15832. "type": "object",
  15833. "properties": {
  15834. "id": {
  15835. "type": "string"
  15836. },
  15837. "type": {
  15838. "type": "string",
  15839. "enum": ["session.error"]
  15840. },
  15841. "properties": {
  15842. "type": "object",
  15843. "properties": {
  15844. "sessionID": {
  15845. "type": "string"
  15846. },
  15847. "error": {
  15848. "anyOf": [
  15849. {
  15850. "$ref": "#/components/schemas/ProviderAuthError"
  15851. },
  15852. {
  15853. "$ref": "#/components/schemas/UnknownError"
  15854. },
  15855. {
  15856. "$ref": "#/components/schemas/MessageOutputLengthError"
  15857. },
  15858. {
  15859. "$ref": "#/components/schemas/MessageAbortedError"
  15860. },
  15861. {
  15862. "$ref": "#/components/schemas/StructuredOutputError"
  15863. },
  15864. {
  15865. "$ref": "#/components/schemas/ContextOverflowError"
  15866. },
  15867. {
  15868. "$ref": "#/components/schemas/APIError"
  15869. }
  15870. ]
  15871. }
  15872. },
  15873. "additionalProperties": false
  15874. }
  15875. },
  15876. "required": ["id", "type", "properties"],
  15877. "additionalProperties": false
  15878. },
  15879. "EventInstallationUpdated": {
  15880. "type": "object",
  15881. "properties": {
  15882. "id": {
  15883. "type": "string"
  15884. },
  15885. "type": {
  15886. "type": "string",
  15887. "enum": ["installation.updated"]
  15888. },
  15889. "properties": {
  15890. "type": "object",
  15891. "properties": {
  15892. "version": {
  15893. "type": "string"
  15894. }
  15895. },
  15896. "required": ["version"],
  15897. "additionalProperties": false
  15898. }
  15899. },
  15900. "required": ["id", "type", "properties"],
  15901. "additionalProperties": false
  15902. },
  15903. "EventInstallationUpdate-available": {
  15904. "type": "object",
  15905. "properties": {
  15906. "id": {
  15907. "type": "string"
  15908. },
  15909. "type": {
  15910. "type": "string",
  15911. "enum": ["installation.update-available"]
  15912. },
  15913. "properties": {
  15914. "type": "object",
  15915. "properties": {
  15916. "version": {
  15917. "type": "string"
  15918. }
  15919. },
  15920. "required": ["version"],
  15921. "additionalProperties": false
  15922. }
  15923. },
  15924. "required": ["id", "type", "properties"],
  15925. "additionalProperties": false
  15926. },
  15927. "EventQuestionAsked": {
  15928. "type": "object",
  15929. "properties": {
  15930. "id": {
  15931. "type": "string"
  15932. },
  15933. "type": {
  15934. "type": "string",
  15935. "enum": ["question.asked"]
  15936. },
  15937. "properties": {
  15938. "$ref": "#/components/schemas/QuestionRequest"
  15939. }
  15940. },
  15941. "required": ["id", "type", "properties"],
  15942. "additionalProperties": false
  15943. },
  15944. "EventQuestionReplied": {
  15945. "type": "object",
  15946. "properties": {
  15947. "id": {
  15948. "type": "string"
  15949. },
  15950. "type": {
  15951. "type": "string",
  15952. "enum": ["question.replied"]
  15953. },
  15954. "properties": {
  15955. "$ref": "#/components/schemas/QuestionReplied"
  15956. }
  15957. },
  15958. "required": ["id", "type", "properties"],
  15959. "additionalProperties": false
  15960. },
  15961. "EventQuestionRejected": {
  15962. "type": "object",
  15963. "properties": {
  15964. "id": {
  15965. "type": "string"
  15966. },
  15967. "type": {
  15968. "type": "string",
  15969. "enum": ["question.rejected"]
  15970. },
  15971. "properties": {
  15972. "$ref": "#/components/schemas/QuestionRejected"
  15973. }
  15974. },
  15975. "required": ["id", "type", "properties"],
  15976. "additionalProperties": false
  15977. },
  15978. "EventTodoUpdated": {
  15979. "type": "object",
  15980. "properties": {
  15981. "id": {
  15982. "type": "string"
  15983. },
  15984. "type": {
  15985. "type": "string",
  15986. "enum": ["todo.updated"]
  15987. },
  15988. "properties": {
  15989. "type": "object",
  15990. "properties": {
  15991. "sessionID": {
  15992. "type": "string"
  15993. },
  15994. "todos": {
  15995. "type": "array",
  15996. "items": {
  15997. "$ref": "#/components/schemas/Todo"
  15998. }
  15999. }
  16000. },
  16001. "required": ["sessionID", "todos"],
  16002. "additionalProperties": false
  16003. }
  16004. },
  16005. "required": ["id", "type", "properties"],
  16006. "additionalProperties": false
  16007. },
  16008. "EventSessionStatus": {
  16009. "type": "object",
  16010. "properties": {
  16011. "id": {
  16012. "type": "string"
  16013. },
  16014. "type": {
  16015. "type": "string",
  16016. "enum": ["session.status"]
  16017. },
  16018. "properties": {
  16019. "type": "object",
  16020. "properties": {
  16021. "sessionID": {
  16022. "type": "string"
  16023. },
  16024. "status": {
  16025. "$ref": "#/components/schemas/SessionStatus"
  16026. }
  16027. },
  16028. "required": ["sessionID", "status"],
  16029. "additionalProperties": false
  16030. }
  16031. },
  16032. "required": ["id", "type", "properties"],
  16033. "additionalProperties": false
  16034. },
  16035. "EventSessionIdle": {
  16036. "type": "object",
  16037. "properties": {
  16038. "id": {
  16039. "type": "string"
  16040. },
  16041. "type": {
  16042. "type": "string",
  16043. "enum": ["session.idle"]
  16044. },
  16045. "properties": {
  16046. "type": "object",
  16047. "properties": {
  16048. "sessionID": {
  16049. "type": "string"
  16050. }
  16051. },
  16052. "required": ["sessionID"],
  16053. "additionalProperties": false
  16054. }
  16055. },
  16056. "required": ["id", "type", "properties"],
  16057. "additionalProperties": false
  16058. },
  16059. "EventSessionCompacted": {
  16060. "type": "object",
  16061. "properties": {
  16062. "id": {
  16063. "type": "string"
  16064. },
  16065. "type": {
  16066. "type": "string",
  16067. "enum": ["session.compacted"]
  16068. },
  16069. "properties": {
  16070. "type": "object",
  16071. "properties": {
  16072. "sessionID": {
  16073. "type": "string"
  16074. }
  16075. },
  16076. "required": ["sessionID"],
  16077. "additionalProperties": false
  16078. }
  16079. },
  16080. "required": ["id", "type", "properties"],
  16081. "additionalProperties": false
  16082. },
  16083. "EventMcpToolsChanged": {
  16084. "type": "object",
  16085. "properties": {
  16086. "id": {
  16087. "type": "string"
  16088. },
  16089. "type": {
  16090. "type": "string",
  16091. "enum": ["mcp.tools.changed"]
  16092. },
  16093. "properties": {
  16094. "type": "object",
  16095. "properties": {
  16096. "server": {
  16097. "type": "string"
  16098. }
  16099. },
  16100. "required": ["server"],
  16101. "additionalProperties": false
  16102. }
  16103. },
  16104. "required": ["id", "type", "properties"],
  16105. "additionalProperties": false
  16106. },
  16107. "EventMcpBrowserOpenFailed": {
  16108. "type": "object",
  16109. "properties": {
  16110. "id": {
  16111. "type": "string"
  16112. },
  16113. "type": {
  16114. "type": "string",
  16115. "enum": ["mcp.browser.open.failed"]
  16116. },
  16117. "properties": {
  16118. "type": "object",
  16119. "properties": {
  16120. "mcpName": {
  16121. "type": "string"
  16122. },
  16123. "url": {
  16124. "type": "string"
  16125. }
  16126. },
  16127. "required": ["mcpName", "url"],
  16128. "additionalProperties": false
  16129. }
  16130. },
  16131. "required": ["id", "type", "properties"],
  16132. "additionalProperties": false
  16133. },
  16134. "EventCommandExecuted": {
  16135. "type": "object",
  16136. "properties": {
  16137. "id": {
  16138. "type": "string"
  16139. },
  16140. "type": {
  16141. "type": "string",
  16142. "enum": ["command.executed"]
  16143. },
  16144. "properties": {
  16145. "type": "object",
  16146. "properties": {
  16147. "name": {
  16148. "type": "string"
  16149. },
  16150. "sessionID": {
  16151. "type": "string"
  16152. },
  16153. "arguments": {
  16154. "type": "string"
  16155. },
  16156. "messageID": {
  16157. "type": "string"
  16158. }
  16159. },
  16160. "required": ["name", "sessionID", "arguments", "messageID"],
  16161. "additionalProperties": false
  16162. }
  16163. },
  16164. "required": ["id", "type", "properties"],
  16165. "additionalProperties": false
  16166. },
  16167. "EventProjectUpdated": {
  16168. "type": "object",
  16169. "properties": {
  16170. "id": {
  16171. "type": "string"
  16172. },
  16173. "type": {
  16174. "type": "string",
  16175. "enum": ["project.updated"]
  16176. },
  16177. "properties": {
  16178. "$ref": "#/components/schemas/Project"
  16179. }
  16180. },
  16181. "required": ["id", "type", "properties"],
  16182. "additionalProperties": false
  16183. },
  16184. "EventVcsBranchUpdated": {
  16185. "type": "object",
  16186. "properties": {
  16187. "id": {
  16188. "type": "string"
  16189. },
  16190. "type": {
  16191. "type": "string",
  16192. "enum": ["vcs.branch.updated"]
  16193. },
  16194. "properties": {
  16195. "type": "object",
  16196. "properties": {
  16197. "branch": {
  16198. "type": "string"
  16199. }
  16200. },
  16201. "additionalProperties": false
  16202. }
  16203. },
  16204. "required": ["id", "type", "properties"],
  16205. "additionalProperties": false
  16206. },
  16207. "EventWorkspaceReady": {
  16208. "type": "object",
  16209. "properties": {
  16210. "id": {
  16211. "type": "string"
  16212. },
  16213. "type": {
  16214. "type": "string",
  16215. "enum": ["workspace.ready"]
  16216. },
  16217. "properties": {
  16218. "type": "object",
  16219. "properties": {
  16220. "name": {
  16221. "type": "string"
  16222. }
  16223. },
  16224. "required": ["name"],
  16225. "additionalProperties": false
  16226. }
  16227. },
  16228. "required": ["id", "type", "properties"],
  16229. "additionalProperties": false
  16230. },
  16231. "EventWorkspaceFailed": {
  16232. "type": "object",
  16233. "properties": {
  16234. "id": {
  16235. "type": "string"
  16236. },
  16237. "type": {
  16238. "type": "string",
  16239. "enum": ["workspace.failed"]
  16240. },
  16241. "properties": {
  16242. "type": "object",
  16243. "properties": {
  16244. "message": {
  16245. "type": "string"
  16246. }
  16247. },
  16248. "required": ["message"],
  16249. "additionalProperties": false
  16250. }
  16251. },
  16252. "required": ["id", "type", "properties"],
  16253. "additionalProperties": false
  16254. },
  16255. "EventWorkspaceStatus": {
  16256. "type": "object",
  16257. "properties": {
  16258. "id": {
  16259. "type": "string"
  16260. },
  16261. "type": {
  16262. "type": "string",
  16263. "enum": ["workspace.status"]
  16264. },
  16265. "properties": {
  16266. "type": "object",
  16267. "properties": {
  16268. "workspaceID": {
  16269. "type": "string"
  16270. },
  16271. "status": {
  16272. "type": "string",
  16273. "enum": ["connected", "connecting", "disconnected", "error"]
  16274. }
  16275. },
  16276. "required": ["workspaceID", "status"],
  16277. "additionalProperties": false
  16278. }
  16279. },
  16280. "required": ["id", "type", "properties"],
  16281. "additionalProperties": false
  16282. },
  16283. "EventWorktreeReady": {
  16284. "type": "object",
  16285. "properties": {
  16286. "id": {
  16287. "type": "string"
  16288. },
  16289. "type": {
  16290. "type": "string",
  16291. "enum": ["worktree.ready"]
  16292. },
  16293. "properties": {
  16294. "type": "object",
  16295. "properties": {
  16296. "name": {
  16297. "type": "string"
  16298. },
  16299. "branch": {
  16300. "type": "string"
  16301. }
  16302. },
  16303. "required": ["name", "branch"],
  16304. "additionalProperties": false
  16305. }
  16306. },
  16307. "required": ["id", "type", "properties"],
  16308. "additionalProperties": false
  16309. },
  16310. "EventWorktreeFailed": {
  16311. "type": "object",
  16312. "properties": {
  16313. "id": {
  16314. "type": "string"
  16315. },
  16316. "type": {
  16317. "type": "string",
  16318. "enum": ["worktree.failed"]
  16319. },
  16320. "properties": {
  16321. "type": "object",
  16322. "properties": {
  16323. "message": {
  16324. "type": "string"
  16325. }
  16326. },
  16327. "required": ["message"],
  16328. "additionalProperties": false
  16329. }
  16330. },
  16331. "required": ["id", "type", "properties"],
  16332. "additionalProperties": false
  16333. },
  16334. "EventPtyCreated": {
  16335. "type": "object",
  16336. "properties": {
  16337. "id": {
  16338. "type": "string"
  16339. },
  16340. "type": {
  16341. "type": "string",
  16342. "enum": ["pty.created"]
  16343. },
  16344. "properties": {
  16345. "type": "object",
  16346. "properties": {
  16347. "info": {
  16348. "$ref": "#/components/schemas/Pty"
  16349. }
  16350. },
  16351. "required": ["info"],
  16352. "additionalProperties": false
  16353. }
  16354. },
  16355. "required": ["id", "type", "properties"],
  16356. "additionalProperties": false
  16357. },
  16358. "EventPtyUpdated": {
  16359. "type": "object",
  16360. "properties": {
  16361. "id": {
  16362. "type": "string"
  16363. },
  16364. "type": {
  16365. "type": "string",
  16366. "enum": ["pty.updated"]
  16367. },
  16368. "properties": {
  16369. "type": "object",
  16370. "properties": {
  16371. "info": {
  16372. "$ref": "#/components/schemas/Pty"
  16373. }
  16374. },
  16375. "required": ["info"],
  16376. "additionalProperties": false
  16377. }
  16378. },
  16379. "required": ["id", "type", "properties"],
  16380. "additionalProperties": false
  16381. },
  16382. "EventPtyExited": {
  16383. "type": "object",
  16384. "properties": {
  16385. "id": {
  16386. "type": "string"
  16387. },
  16388. "type": {
  16389. "type": "string",
  16390. "enum": ["pty.exited"]
  16391. },
  16392. "properties": {
  16393. "type": "object",
  16394. "properties": {
  16395. "id": {
  16396. "type": "string"
  16397. },
  16398. "exitCode": {
  16399. "type": "integer",
  16400. "minimum": 0
  16401. }
  16402. },
  16403. "required": ["id", "exitCode"],
  16404. "additionalProperties": false
  16405. }
  16406. },
  16407. "required": ["id", "type", "properties"],
  16408. "additionalProperties": false
  16409. },
  16410. "EventPtyDeleted": {
  16411. "type": "object",
  16412. "properties": {
  16413. "id": {
  16414. "type": "string"
  16415. },
  16416. "type": {
  16417. "type": "string",
  16418. "enum": ["pty.deleted"]
  16419. },
  16420. "properties": {
  16421. "type": "object",
  16422. "properties": {
  16423. "id": {
  16424. "type": "string"
  16425. }
  16426. },
  16427. "required": ["id"],
  16428. "additionalProperties": false
  16429. }
  16430. },
  16431. "required": ["id", "type", "properties"],
  16432. "additionalProperties": false
  16433. },
  16434. "EventMessageUpdated": {
  16435. "type": "object",
  16436. "properties": {
  16437. "id": {
  16438. "type": "string"
  16439. },
  16440. "type": {
  16441. "type": "string",
  16442. "enum": ["message.updated"]
  16443. },
  16444. "properties": {
  16445. "type": "object",
  16446. "properties": {
  16447. "sessionID": {
  16448. "type": "string"
  16449. },
  16450. "info": {
  16451. "$ref": "#/components/schemas/Message"
  16452. }
  16453. },
  16454. "required": ["sessionID", "info"],
  16455. "additionalProperties": false
  16456. }
  16457. },
  16458. "required": ["id", "type", "properties"],
  16459. "additionalProperties": false
  16460. },
  16461. "EventMessageRemoved": {
  16462. "type": "object",
  16463. "properties": {
  16464. "id": {
  16465. "type": "string"
  16466. },
  16467. "type": {
  16468. "type": "string",
  16469. "enum": ["message.removed"]
  16470. },
  16471. "properties": {
  16472. "type": "object",
  16473. "properties": {
  16474. "sessionID": {
  16475. "type": "string"
  16476. },
  16477. "messageID": {
  16478. "type": "string"
  16479. }
  16480. },
  16481. "required": ["sessionID", "messageID"],
  16482. "additionalProperties": false
  16483. }
  16484. },
  16485. "required": ["id", "type", "properties"],
  16486. "additionalProperties": false
  16487. },
  16488. "EventMessagePartUpdated": {
  16489. "type": "object",
  16490. "properties": {
  16491. "id": {
  16492. "type": "string"
  16493. },
  16494. "type": {
  16495. "type": "string",
  16496. "enum": ["message.part.updated"]
  16497. },
  16498. "properties": {
  16499. "type": "object",
  16500. "properties": {
  16501. "sessionID": {
  16502. "type": "string"
  16503. },
  16504. "part": {
  16505. "$ref": "#/components/schemas/Part"
  16506. },
  16507. "time": {
  16508. "type": "integer",
  16509. "minimum": 0
  16510. }
  16511. },
  16512. "required": ["sessionID", "part", "time"],
  16513. "additionalProperties": false
  16514. }
  16515. },
  16516. "required": ["id", "type", "properties"],
  16517. "additionalProperties": false
  16518. },
  16519. "EventMessagePartRemoved": {
  16520. "type": "object",
  16521. "properties": {
  16522. "id": {
  16523. "type": "string"
  16524. },
  16525. "type": {
  16526. "type": "string",
  16527. "enum": ["message.part.removed"]
  16528. },
  16529. "properties": {
  16530. "type": "object",
  16531. "properties": {
  16532. "sessionID": {
  16533. "type": "string"
  16534. },
  16535. "messageID": {
  16536. "type": "string"
  16537. },
  16538. "partID": {
  16539. "type": "string"
  16540. }
  16541. },
  16542. "required": ["sessionID", "messageID", "partID"],
  16543. "additionalProperties": false
  16544. }
  16545. },
  16546. "required": ["id", "type", "properties"],
  16547. "additionalProperties": false
  16548. },
  16549. "EventSessionCreated": {
  16550. "type": "object",
  16551. "properties": {
  16552. "id": {
  16553. "type": "string"
  16554. },
  16555. "type": {
  16556. "type": "string",
  16557. "enum": ["session.created"]
  16558. },
  16559. "properties": {
  16560. "type": "object",
  16561. "properties": {
  16562. "sessionID": {
  16563. "type": "string"
  16564. },
  16565. "info": {
  16566. "$ref": "#/components/schemas/Session"
  16567. }
  16568. },
  16569. "required": ["sessionID", "info"],
  16570. "additionalProperties": false
  16571. }
  16572. },
  16573. "required": ["id", "type", "properties"],
  16574. "additionalProperties": false
  16575. },
  16576. "EventSessionUpdated": {
  16577. "type": "object",
  16578. "properties": {
  16579. "id": {
  16580. "type": "string"
  16581. },
  16582. "type": {
  16583. "type": "string",
  16584. "enum": ["session.updated"]
  16585. },
  16586. "properties": {
  16587. "type": "object",
  16588. "properties": {
  16589. "sessionID": {
  16590. "type": "string"
  16591. },
  16592. "info": {
  16593. "$ref": "#/components/schemas/Session"
  16594. }
  16595. },
  16596. "required": ["sessionID", "info"],
  16597. "additionalProperties": false
  16598. }
  16599. },
  16600. "required": ["id", "type", "properties"],
  16601. "additionalProperties": false
  16602. },
  16603. "EventSessionDeleted": {
  16604. "type": "object",
  16605. "properties": {
  16606. "id": {
  16607. "type": "string"
  16608. },
  16609. "type": {
  16610. "type": "string",
  16611. "enum": ["session.deleted"]
  16612. },
  16613. "properties": {
  16614. "type": "object",
  16615. "properties": {
  16616. "sessionID": {
  16617. "type": "string"
  16618. },
  16619. "info": {
  16620. "$ref": "#/components/schemas/Session"
  16621. }
  16622. },
  16623. "required": ["sessionID", "info"],
  16624. "additionalProperties": false
  16625. }
  16626. },
  16627. "required": ["id", "type", "properties"],
  16628. "additionalProperties": false
  16629. },
  16630. "EventSessionNextAgentSwitched": {
  16631. "type": "object",
  16632. "properties": {
  16633. "id": {
  16634. "type": "string"
  16635. },
  16636. "type": {
  16637. "type": "string",
  16638. "enum": ["session.next.agent.switched"]
  16639. },
  16640. "properties": {
  16641. "type": "object",
  16642. "properties": {
  16643. "timestamp": {
  16644. "type": "number"
  16645. },
  16646. "sessionID": {
  16647. "type": "string"
  16648. },
  16649. "agent": {
  16650. "type": "string"
  16651. }
  16652. },
  16653. "required": ["timestamp", "sessionID", "agent"],
  16654. "additionalProperties": false
  16655. }
  16656. },
  16657. "required": ["id", "type", "properties"],
  16658. "additionalProperties": false
  16659. },
  16660. "EventSessionNextModelSwitched": {
  16661. "type": "object",
  16662. "properties": {
  16663. "id": {
  16664. "type": "string"
  16665. },
  16666. "type": {
  16667. "type": "string",
  16668. "enum": ["session.next.model.switched"]
  16669. },
  16670. "properties": {
  16671. "type": "object",
  16672. "properties": {
  16673. "timestamp": {
  16674. "type": "number"
  16675. },
  16676. "sessionID": {
  16677. "type": "string"
  16678. },
  16679. "model": {
  16680. "type": "object",
  16681. "properties": {
  16682. "id": {
  16683. "type": "string"
  16684. },
  16685. "providerID": {
  16686. "type": "string"
  16687. },
  16688. "variant": {
  16689. "type": "string"
  16690. }
  16691. },
  16692. "required": ["id", "providerID", "variant"],
  16693. "additionalProperties": false
  16694. }
  16695. },
  16696. "required": ["timestamp", "sessionID", "model"],
  16697. "additionalProperties": false
  16698. }
  16699. },
  16700. "required": ["id", "type", "properties"],
  16701. "additionalProperties": false
  16702. },
  16703. "PromptSource": {
  16704. "type": "object",
  16705. "properties": {
  16706. "start": {
  16707. "type": "number"
  16708. },
  16709. "end": {
  16710. "type": "number"
  16711. },
  16712. "text": {
  16713. "type": "string"
  16714. }
  16715. },
  16716. "required": ["start", "end", "text"],
  16717. "additionalProperties": false
  16718. },
  16719. "PromptFileAttachment": {
  16720. "type": "object",
  16721. "properties": {
  16722. "uri": {
  16723. "type": "string"
  16724. },
  16725. "mime": {
  16726. "type": "string"
  16727. },
  16728. "name": {
  16729. "type": "string"
  16730. },
  16731. "description": {
  16732. "type": "string"
  16733. },
  16734. "source": {
  16735. "$ref": "#/components/schemas/PromptSource"
  16736. }
  16737. },
  16738. "required": ["uri", "mime"],
  16739. "additionalProperties": false
  16740. },
  16741. "PromptAgentAttachment": {
  16742. "type": "object",
  16743. "properties": {
  16744. "name": {
  16745. "type": "string"
  16746. },
  16747. "source": {
  16748. "$ref": "#/components/schemas/PromptSource"
  16749. }
  16750. },
  16751. "required": ["name"],
  16752. "additionalProperties": false
  16753. },
  16754. "EventSessionNextPrompted": {
  16755. "type": "object",
  16756. "properties": {
  16757. "id": {
  16758. "type": "string"
  16759. },
  16760. "type": {
  16761. "type": "string",
  16762. "enum": ["session.next.prompted"]
  16763. },
  16764. "properties": {
  16765. "type": "object",
  16766. "properties": {
  16767. "timestamp": {
  16768. "type": "number"
  16769. },
  16770. "sessionID": {
  16771. "type": "string"
  16772. },
  16773. "prompt": {
  16774. "$ref": "#/components/schemas/Prompt"
  16775. }
  16776. },
  16777. "required": ["timestamp", "sessionID", "prompt"],
  16778. "additionalProperties": false
  16779. }
  16780. },
  16781. "required": ["id", "type", "properties"],
  16782. "additionalProperties": false
  16783. },
  16784. "EventSessionNextSynthetic": {
  16785. "type": "object",
  16786. "properties": {
  16787. "id": {
  16788. "type": "string"
  16789. },
  16790. "type": {
  16791. "type": "string",
  16792. "enum": ["session.next.synthetic"]
  16793. },
  16794. "properties": {
  16795. "type": "object",
  16796. "properties": {
  16797. "timestamp": {
  16798. "type": "number"
  16799. },
  16800. "sessionID": {
  16801. "type": "string"
  16802. },
  16803. "text": {
  16804. "type": "string"
  16805. }
  16806. },
  16807. "required": ["timestamp", "sessionID", "text"],
  16808. "additionalProperties": false
  16809. }
  16810. },
  16811. "required": ["id", "type", "properties"],
  16812. "additionalProperties": false
  16813. },
  16814. "EventSessionNextShellStarted": {
  16815. "type": "object",
  16816. "properties": {
  16817. "id": {
  16818. "type": "string"
  16819. },
  16820. "type": {
  16821. "type": "string",
  16822. "enum": ["session.next.shell.started"]
  16823. },
  16824. "properties": {
  16825. "type": "object",
  16826. "properties": {
  16827. "timestamp": {
  16828. "type": "number"
  16829. },
  16830. "sessionID": {
  16831. "type": "string"
  16832. },
  16833. "callID": {
  16834. "type": "string"
  16835. },
  16836. "command": {
  16837. "type": "string"
  16838. }
  16839. },
  16840. "required": ["timestamp", "sessionID", "callID", "command"],
  16841. "additionalProperties": false
  16842. }
  16843. },
  16844. "required": ["id", "type", "properties"],
  16845. "additionalProperties": false
  16846. },
  16847. "EventSessionNextShellEnded": {
  16848. "type": "object",
  16849. "properties": {
  16850. "id": {
  16851. "type": "string"
  16852. },
  16853. "type": {
  16854. "type": "string",
  16855. "enum": ["session.next.shell.ended"]
  16856. },
  16857. "properties": {
  16858. "type": "object",
  16859. "properties": {
  16860. "timestamp": {
  16861. "type": "number"
  16862. },
  16863. "sessionID": {
  16864. "type": "string"
  16865. },
  16866. "callID": {
  16867. "type": "string"
  16868. },
  16869. "output": {
  16870. "type": "string"
  16871. }
  16872. },
  16873. "required": ["timestamp", "sessionID", "callID", "output"],
  16874. "additionalProperties": false
  16875. }
  16876. },
  16877. "required": ["id", "type", "properties"],
  16878. "additionalProperties": false
  16879. },
  16880. "EventSessionNextStepStarted": {
  16881. "type": "object",
  16882. "properties": {
  16883. "id": {
  16884. "type": "string"
  16885. },
  16886. "type": {
  16887. "type": "string",
  16888. "enum": ["session.next.step.started"]
  16889. },
  16890. "properties": {
  16891. "type": "object",
  16892. "properties": {
  16893. "timestamp": {
  16894. "type": "number"
  16895. },
  16896. "sessionID": {
  16897. "type": "string"
  16898. },
  16899. "agent": {
  16900. "type": "string"
  16901. },
  16902. "model": {
  16903. "type": "object",
  16904. "properties": {
  16905. "id": {
  16906. "type": "string"
  16907. },
  16908. "providerID": {
  16909. "type": "string"
  16910. },
  16911. "variant": {
  16912. "type": "string"
  16913. }
  16914. },
  16915. "required": ["id", "providerID", "variant"],
  16916. "additionalProperties": false
  16917. },
  16918. "snapshot": {
  16919. "type": "string"
  16920. }
  16921. },
  16922. "required": ["timestamp", "sessionID", "agent", "model"],
  16923. "additionalProperties": false
  16924. }
  16925. },
  16926. "required": ["id", "type", "properties"],
  16927. "additionalProperties": false
  16928. },
  16929. "EventSessionNextStepEnded": {
  16930. "type": "object",
  16931. "properties": {
  16932. "id": {
  16933. "type": "string"
  16934. },
  16935. "type": {
  16936. "type": "string",
  16937. "enum": ["session.next.step.ended"]
  16938. },
  16939. "properties": {
  16940. "type": "object",
  16941. "properties": {
  16942. "timestamp": {
  16943. "type": "number"
  16944. },
  16945. "sessionID": {
  16946. "type": "string"
  16947. },
  16948. "finish": {
  16949. "type": "string"
  16950. },
  16951. "cost": {
  16952. "type": "number"
  16953. },
  16954. "tokens": {
  16955. "type": "object",
  16956. "properties": {
  16957. "input": {
  16958. "type": "integer",
  16959. "minimum": 0
  16960. },
  16961. "output": {
  16962. "type": "integer",
  16963. "minimum": 0
  16964. },
  16965. "reasoning": {
  16966. "type": "integer",
  16967. "minimum": 0
  16968. },
  16969. "cache": {
  16970. "type": "object",
  16971. "properties": {
  16972. "read": {
  16973. "type": "integer",
  16974. "minimum": 0
  16975. },
  16976. "write": {
  16977. "type": "integer",
  16978. "minimum": 0
  16979. }
  16980. },
  16981. "required": ["read", "write"],
  16982. "additionalProperties": false
  16983. }
  16984. },
  16985. "required": ["input", "output", "reasoning", "cache"],
  16986. "additionalProperties": false
  16987. },
  16988. "snapshot": {
  16989. "type": "string"
  16990. }
  16991. },
  16992. "required": ["timestamp", "sessionID", "finish", "cost", "tokens"],
  16993. "additionalProperties": false
  16994. }
  16995. },
  16996. "required": ["id", "type", "properties"],
  16997. "additionalProperties": false
  16998. },
  16999. "SessionErrorUnknown": {
  17000. "type": "object",
  17001. "properties": {
  17002. "type": {
  17003. "type": "string",
  17004. "enum": ["unknown"]
  17005. },
  17006. "message": {
  17007. "type": "string"
  17008. }
  17009. },
  17010. "required": ["type", "message"],
  17011. "additionalProperties": false
  17012. },
  17013. "EventSessionNextStepFailed": {
  17014. "type": "object",
  17015. "properties": {
  17016. "id": {
  17017. "type": "string"
  17018. },
  17019. "type": {
  17020. "type": "string",
  17021. "enum": ["session.next.step.failed"]
  17022. },
  17023. "properties": {
  17024. "type": "object",
  17025. "properties": {
  17026. "timestamp": {
  17027. "type": "number"
  17028. },
  17029. "sessionID": {
  17030. "type": "string"
  17031. },
  17032. "error": {
  17033. "$ref": "#/components/schemas/SessionErrorUnknown"
  17034. }
  17035. },
  17036. "required": ["timestamp", "sessionID", "error"],
  17037. "additionalProperties": false
  17038. }
  17039. },
  17040. "required": ["id", "type", "properties"],
  17041. "additionalProperties": false
  17042. },
  17043. "EventSessionNextTextStarted": {
  17044. "type": "object",
  17045. "properties": {
  17046. "id": {
  17047. "type": "string"
  17048. },
  17049. "type": {
  17050. "type": "string",
  17051. "enum": ["session.next.text.started"]
  17052. },
  17053. "properties": {
  17054. "type": "object",
  17055. "properties": {
  17056. "timestamp": {
  17057. "type": "number"
  17058. },
  17059. "sessionID": {
  17060. "type": "string"
  17061. }
  17062. },
  17063. "required": ["timestamp", "sessionID"],
  17064. "additionalProperties": false
  17065. }
  17066. },
  17067. "required": ["id", "type", "properties"],
  17068. "additionalProperties": false
  17069. },
  17070. "EventSessionNextTextDelta": {
  17071. "type": "object",
  17072. "properties": {
  17073. "id": {
  17074. "type": "string"
  17075. },
  17076. "type": {
  17077. "type": "string",
  17078. "enum": ["session.next.text.delta"]
  17079. },
  17080. "properties": {
  17081. "type": "object",
  17082. "properties": {
  17083. "timestamp": {
  17084. "type": "number"
  17085. },
  17086. "sessionID": {
  17087. "type": "string"
  17088. },
  17089. "delta": {
  17090. "type": "string"
  17091. }
  17092. },
  17093. "required": ["timestamp", "sessionID", "delta"],
  17094. "additionalProperties": false
  17095. }
  17096. },
  17097. "required": ["id", "type", "properties"],
  17098. "additionalProperties": false
  17099. },
  17100. "EventSessionNextTextEnded": {
  17101. "type": "object",
  17102. "properties": {
  17103. "id": {
  17104. "type": "string"
  17105. },
  17106. "type": {
  17107. "type": "string",
  17108. "enum": ["session.next.text.ended"]
  17109. },
  17110. "properties": {
  17111. "type": "object",
  17112. "properties": {
  17113. "timestamp": {
  17114. "type": "number"
  17115. },
  17116. "sessionID": {
  17117. "type": "string"
  17118. },
  17119. "text": {
  17120. "type": "string"
  17121. }
  17122. },
  17123. "required": ["timestamp", "sessionID", "text"],
  17124. "additionalProperties": false
  17125. }
  17126. },
  17127. "required": ["id", "type", "properties"],
  17128. "additionalProperties": false
  17129. },
  17130. "EventSessionNextReasoningStarted": {
  17131. "type": "object",
  17132. "properties": {
  17133. "id": {
  17134. "type": "string"
  17135. },
  17136. "type": {
  17137. "type": "string",
  17138. "enum": ["session.next.reasoning.started"]
  17139. },
  17140. "properties": {
  17141. "type": "object",
  17142. "properties": {
  17143. "timestamp": {
  17144. "type": "number"
  17145. },
  17146. "sessionID": {
  17147. "type": "string"
  17148. },
  17149. "reasoningID": {
  17150. "type": "string"
  17151. }
  17152. },
  17153. "required": ["timestamp", "sessionID", "reasoningID"],
  17154. "additionalProperties": false
  17155. }
  17156. },
  17157. "required": ["id", "type", "properties"],
  17158. "additionalProperties": false
  17159. },
  17160. "EventSessionNextReasoningDelta": {
  17161. "type": "object",
  17162. "properties": {
  17163. "id": {
  17164. "type": "string"
  17165. },
  17166. "type": {
  17167. "type": "string",
  17168. "enum": ["session.next.reasoning.delta"]
  17169. },
  17170. "properties": {
  17171. "type": "object",
  17172. "properties": {
  17173. "timestamp": {
  17174. "type": "number"
  17175. },
  17176. "sessionID": {
  17177. "type": "string"
  17178. },
  17179. "reasoningID": {
  17180. "type": "string"
  17181. },
  17182. "delta": {
  17183. "type": "string"
  17184. }
  17185. },
  17186. "required": ["timestamp", "sessionID", "reasoningID", "delta"],
  17187. "additionalProperties": false
  17188. }
  17189. },
  17190. "required": ["id", "type", "properties"],
  17191. "additionalProperties": false
  17192. },
  17193. "EventSessionNextReasoningEnded": {
  17194. "type": "object",
  17195. "properties": {
  17196. "id": {
  17197. "type": "string"
  17198. },
  17199. "type": {
  17200. "type": "string",
  17201. "enum": ["session.next.reasoning.ended"]
  17202. },
  17203. "properties": {
  17204. "type": "object",
  17205. "properties": {
  17206. "timestamp": {
  17207. "type": "number"
  17208. },
  17209. "sessionID": {
  17210. "type": "string"
  17211. },
  17212. "reasoningID": {
  17213. "type": "string"
  17214. },
  17215. "text": {
  17216. "type": "string"
  17217. }
  17218. },
  17219. "required": ["timestamp", "sessionID", "reasoningID", "text"],
  17220. "additionalProperties": false
  17221. }
  17222. },
  17223. "required": ["id", "type", "properties"],
  17224. "additionalProperties": false
  17225. },
  17226. "EventSessionNextToolInputStarted": {
  17227. "type": "object",
  17228. "properties": {
  17229. "id": {
  17230. "type": "string"
  17231. },
  17232. "type": {
  17233. "type": "string",
  17234. "enum": ["session.next.tool.input.started"]
  17235. },
  17236. "properties": {
  17237. "type": "object",
  17238. "properties": {
  17239. "timestamp": {
  17240. "type": "number"
  17241. },
  17242. "sessionID": {
  17243. "type": "string"
  17244. },
  17245. "callID": {
  17246. "type": "string"
  17247. },
  17248. "name": {
  17249. "type": "string"
  17250. }
  17251. },
  17252. "required": ["timestamp", "sessionID", "callID", "name"],
  17253. "additionalProperties": false
  17254. }
  17255. },
  17256. "required": ["id", "type", "properties"],
  17257. "additionalProperties": false
  17258. },
  17259. "EventSessionNextToolInputDelta": {
  17260. "type": "object",
  17261. "properties": {
  17262. "id": {
  17263. "type": "string"
  17264. },
  17265. "type": {
  17266. "type": "string",
  17267. "enum": ["session.next.tool.input.delta"]
  17268. },
  17269. "properties": {
  17270. "type": "object",
  17271. "properties": {
  17272. "timestamp": {
  17273. "type": "number"
  17274. },
  17275. "sessionID": {
  17276. "type": "string"
  17277. },
  17278. "callID": {
  17279. "type": "string"
  17280. },
  17281. "delta": {
  17282. "type": "string"
  17283. }
  17284. },
  17285. "required": ["timestamp", "sessionID", "callID", "delta"],
  17286. "additionalProperties": false
  17287. }
  17288. },
  17289. "required": ["id", "type", "properties"],
  17290. "additionalProperties": false
  17291. },
  17292. "EventSessionNextToolInputEnded": {
  17293. "type": "object",
  17294. "properties": {
  17295. "id": {
  17296. "type": "string"
  17297. },
  17298. "type": {
  17299. "type": "string",
  17300. "enum": ["session.next.tool.input.ended"]
  17301. },
  17302. "properties": {
  17303. "type": "object",
  17304. "properties": {
  17305. "timestamp": {
  17306. "type": "number"
  17307. },
  17308. "sessionID": {
  17309. "type": "string"
  17310. },
  17311. "callID": {
  17312. "type": "string"
  17313. },
  17314. "text": {
  17315. "type": "string"
  17316. }
  17317. },
  17318. "required": ["timestamp", "sessionID", "callID", "text"],
  17319. "additionalProperties": false
  17320. }
  17321. },
  17322. "required": ["id", "type", "properties"],
  17323. "additionalProperties": false
  17324. },
  17325. "EventSessionNextToolCalled": {
  17326. "type": "object",
  17327. "properties": {
  17328. "id": {
  17329. "type": "string"
  17330. },
  17331. "type": {
  17332. "type": "string",
  17333. "enum": ["session.next.tool.called"]
  17334. },
  17335. "properties": {
  17336. "type": "object",
  17337. "properties": {
  17338. "timestamp": {
  17339. "type": "number"
  17340. },
  17341. "sessionID": {
  17342. "type": "string"
  17343. },
  17344. "callID": {
  17345. "type": "string"
  17346. },
  17347. "tool": {
  17348. "type": "string"
  17349. },
  17350. "input": {
  17351. "type": "object"
  17352. },
  17353. "provider": {
  17354. "type": "object",
  17355. "properties": {
  17356. "executed": {
  17357. "type": "boolean"
  17358. },
  17359. "metadata": {
  17360. "type": "object"
  17361. }
  17362. },
  17363. "required": ["executed"],
  17364. "additionalProperties": false
  17365. }
  17366. },
  17367. "required": ["timestamp", "sessionID", "callID", "tool", "input", "provider"],
  17368. "additionalProperties": false
  17369. }
  17370. },
  17371. "required": ["id", "type", "properties"],
  17372. "additionalProperties": false
  17373. },
  17374. "ToolTextContent": {
  17375. "type": "object",
  17376. "properties": {
  17377. "type": {
  17378. "type": "string",
  17379. "enum": ["text"]
  17380. },
  17381. "text": {
  17382. "type": "string"
  17383. }
  17384. },
  17385. "required": ["type", "text"],
  17386. "additionalProperties": false
  17387. },
  17388. "ToolFileContent": {
  17389. "type": "object",
  17390. "properties": {
  17391. "type": {
  17392. "type": "string",
  17393. "enum": ["file"]
  17394. },
  17395. "uri": {
  17396. "type": "string"
  17397. },
  17398. "mime": {
  17399. "type": "string"
  17400. },
  17401. "name": {
  17402. "type": "string"
  17403. }
  17404. },
  17405. "required": ["type", "uri", "mime"],
  17406. "additionalProperties": false
  17407. },
  17408. "EventSessionNextToolProgress": {
  17409. "type": "object",
  17410. "properties": {
  17411. "id": {
  17412. "type": "string"
  17413. },
  17414. "type": {
  17415. "type": "string",
  17416. "enum": ["session.next.tool.progress"]
  17417. },
  17418. "properties": {
  17419. "type": "object",
  17420. "properties": {
  17421. "timestamp": {
  17422. "type": "number"
  17423. },
  17424. "sessionID": {
  17425. "type": "string"
  17426. },
  17427. "callID": {
  17428. "type": "string"
  17429. },
  17430. "structured": {
  17431. "type": "object"
  17432. },
  17433. "content": {
  17434. "type": "array",
  17435. "items": {
  17436. "anyOf": [
  17437. {
  17438. "$ref": "#/components/schemas/ToolTextContent"
  17439. },
  17440. {
  17441. "$ref": "#/components/schemas/ToolFileContent"
  17442. }
  17443. ]
  17444. }
  17445. }
  17446. },
  17447. "required": ["timestamp", "sessionID", "callID", "structured", "content"],
  17448. "additionalProperties": false
  17449. }
  17450. },
  17451. "required": ["id", "type", "properties"],
  17452. "additionalProperties": false
  17453. },
  17454. "EventSessionNextToolSuccess": {
  17455. "type": "object",
  17456. "properties": {
  17457. "id": {
  17458. "type": "string"
  17459. },
  17460. "type": {
  17461. "type": "string",
  17462. "enum": ["session.next.tool.success"]
  17463. },
  17464. "properties": {
  17465. "type": "object",
  17466. "properties": {
  17467. "timestamp": {
  17468. "type": "number"
  17469. },
  17470. "sessionID": {
  17471. "type": "string"
  17472. },
  17473. "callID": {
  17474. "type": "string"
  17475. },
  17476. "structured": {
  17477. "type": "object"
  17478. },
  17479. "content": {
  17480. "type": "array",
  17481. "items": {
  17482. "anyOf": [
  17483. {
  17484. "$ref": "#/components/schemas/ToolTextContent"
  17485. },
  17486. {
  17487. "$ref": "#/components/schemas/ToolFileContent"
  17488. }
  17489. ]
  17490. }
  17491. },
  17492. "provider": {
  17493. "type": "object",
  17494. "properties": {
  17495. "executed": {
  17496. "type": "boolean"
  17497. },
  17498. "metadata": {
  17499. "type": "object"
  17500. }
  17501. },
  17502. "required": ["executed"],
  17503. "additionalProperties": false
  17504. }
  17505. },
  17506. "required": ["timestamp", "sessionID", "callID", "structured", "content", "provider"],
  17507. "additionalProperties": false
  17508. }
  17509. },
  17510. "required": ["id", "type", "properties"],
  17511. "additionalProperties": false
  17512. },
  17513. "EventSessionNextToolFailed": {
  17514. "type": "object",
  17515. "properties": {
  17516. "id": {
  17517. "type": "string"
  17518. },
  17519. "type": {
  17520. "type": "string",
  17521. "enum": ["session.next.tool.failed"]
  17522. },
  17523. "properties": {
  17524. "type": "object",
  17525. "properties": {
  17526. "timestamp": {
  17527. "type": "number"
  17528. },
  17529. "sessionID": {
  17530. "type": "string"
  17531. },
  17532. "callID": {
  17533. "type": "string"
  17534. },
  17535. "error": {
  17536. "$ref": "#/components/schemas/SessionErrorUnknown"
  17537. },
  17538. "provider": {
  17539. "type": "object",
  17540. "properties": {
  17541. "executed": {
  17542. "type": "boolean"
  17543. },
  17544. "metadata": {
  17545. "type": "object"
  17546. }
  17547. },
  17548. "required": ["executed"],
  17549. "additionalProperties": false
  17550. }
  17551. },
  17552. "required": ["timestamp", "sessionID", "callID", "error", "provider"],
  17553. "additionalProperties": false
  17554. }
  17555. },
  17556. "required": ["id", "type", "properties"],
  17557. "additionalProperties": false
  17558. },
  17559. "SessionNextRetry_error": {
  17560. "type": "object",
  17561. "properties": {
  17562. "message": {
  17563. "type": "string"
  17564. },
  17565. "statusCode": {
  17566. "type": "integer",
  17567. "minimum": 0
  17568. },
  17569. "isRetryable": {
  17570. "type": "boolean"
  17571. },
  17572. "responseHeaders": {
  17573. "type": "object",
  17574. "additionalProperties": {
  17575. "type": "string"
  17576. }
  17577. },
  17578. "responseBody": {
  17579. "type": "string"
  17580. },
  17581. "metadata": {
  17582. "type": "object",
  17583. "additionalProperties": {
  17584. "type": "string"
  17585. }
  17586. }
  17587. },
  17588. "required": ["message", "isRetryable"],
  17589. "additionalProperties": false
  17590. },
  17591. "EventSessionNextRetried": {
  17592. "type": "object",
  17593. "properties": {
  17594. "id": {
  17595. "type": "string"
  17596. },
  17597. "type": {
  17598. "type": "string",
  17599. "enum": ["session.next.retried"]
  17600. },
  17601. "properties": {
  17602. "type": "object",
  17603. "properties": {
  17604. "timestamp": {
  17605. "type": "number"
  17606. },
  17607. "sessionID": {
  17608. "type": "string"
  17609. },
  17610. "attempt": {
  17611. "type": "integer",
  17612. "minimum": 0
  17613. },
  17614. "error": {
  17615. "$ref": "#/components/schemas/SessionNextRetry_error"
  17616. }
  17617. },
  17618. "required": ["timestamp", "sessionID", "attempt", "error"],
  17619. "additionalProperties": false
  17620. }
  17621. },
  17622. "required": ["id", "type", "properties"],
  17623. "additionalProperties": false
  17624. },
  17625. "EventSessionNextCompactionStarted": {
  17626. "type": "object",
  17627. "properties": {
  17628. "id": {
  17629. "type": "string"
  17630. },
  17631. "type": {
  17632. "type": "string",
  17633. "enum": ["session.next.compaction.started"]
  17634. },
  17635. "properties": {
  17636. "type": "object",
  17637. "properties": {
  17638. "timestamp": {
  17639. "type": "number"
  17640. },
  17641. "sessionID": {
  17642. "type": "string"
  17643. },
  17644. "reason": {
  17645. "type": "string",
  17646. "enum": ["auto", "manual"]
  17647. }
  17648. },
  17649. "required": ["timestamp", "sessionID", "reason"],
  17650. "additionalProperties": false
  17651. }
  17652. },
  17653. "required": ["id", "type", "properties"],
  17654. "additionalProperties": false
  17655. },
  17656. "EventSessionNextCompactionDelta": {
  17657. "type": "object",
  17658. "properties": {
  17659. "id": {
  17660. "type": "string"
  17661. },
  17662. "type": {
  17663. "type": "string",
  17664. "enum": ["session.next.compaction.delta"]
  17665. },
  17666. "properties": {
  17667. "type": "object",
  17668. "properties": {
  17669. "timestamp": {
  17670. "type": "number"
  17671. },
  17672. "sessionID": {
  17673. "type": "string"
  17674. },
  17675. "text": {
  17676. "type": "string"
  17677. }
  17678. },
  17679. "required": ["timestamp", "sessionID", "text"],
  17680. "additionalProperties": false
  17681. }
  17682. },
  17683. "required": ["id", "type", "properties"],
  17684. "additionalProperties": false
  17685. },
  17686. "EventSessionNextCompactionEnded": {
  17687. "type": "object",
  17688. "properties": {
  17689. "id": {
  17690. "type": "string"
  17691. },
  17692. "type": {
  17693. "type": "string",
  17694. "enum": ["session.next.compaction.ended"]
  17695. },
  17696. "properties": {
  17697. "type": "object",
  17698. "properties": {
  17699. "timestamp": {
  17700. "type": "number"
  17701. },
  17702. "sessionID": {
  17703. "type": "string"
  17704. },
  17705. "text": {
  17706. "type": "string"
  17707. },
  17708. "include": {
  17709. "type": "string"
  17710. }
  17711. },
  17712. "required": ["timestamp", "sessionID", "text"],
  17713. "additionalProperties": false
  17714. }
  17715. },
  17716. "required": ["id", "type", "properties"],
  17717. "additionalProperties": false
  17718. },
  17719. "EventServerConnected": {
  17720. "type": "object",
  17721. "properties": {
  17722. "id": {
  17723. "type": "string"
  17724. },
  17725. "type": {
  17726. "type": "string",
  17727. "enum": ["server.connected"]
  17728. },
  17729. "properties": {
  17730. "type": "object",
  17731. "properties": {}
  17732. }
  17733. },
  17734. "required": ["id", "type", "properties"],
  17735. "additionalProperties": false
  17736. },
  17737. "EventGlobalDisposed": {
  17738. "type": "object",
  17739. "properties": {
  17740. "id": {
  17741. "type": "string"
  17742. },
  17743. "type": {
  17744. "type": "string",
  17745. "enum": ["global.disposed"]
  17746. },
  17747. "properties": {
  17748. "type": "object",
  17749. "properties": {}
  17750. }
  17751. },
  17752. "required": ["id", "type", "properties"],
  17753. "additionalProperties": false
  17754. },
  17755. "SessionInfo": {
  17756. "type": "object",
  17757. "properties": {
  17758. "id": {
  17759. "type": "string"
  17760. },
  17761. "parentID": {
  17762. "type": "string"
  17763. },
  17764. "projectID": {
  17765. "type": "string"
  17766. },
  17767. "workspaceID": {
  17768. "type": "string"
  17769. },
  17770. "path": {
  17771. "type": "string"
  17772. },
  17773. "agent": {
  17774. "type": "string"
  17775. },
  17776. "model": {
  17777. "type": "object",
  17778. "properties": {
  17779. "id": {
  17780. "type": "string"
  17781. },
  17782. "providerID": {
  17783. "type": "string"
  17784. },
  17785. "variant": {
  17786. "type": "string"
  17787. }
  17788. },
  17789. "required": ["id", "providerID", "variant"],
  17790. "additionalProperties": false
  17791. },
  17792. "time": {
  17793. "type": "object",
  17794. "properties": {
  17795. "created": {
  17796. "type": "number"
  17797. },
  17798. "updated": {
  17799. "type": "number"
  17800. },
  17801. "archived": {
  17802. "type": "number"
  17803. }
  17804. },
  17805. "required": ["created", "updated"],
  17806. "additionalProperties": false
  17807. },
  17808. "title": {
  17809. "type": "string"
  17810. }
  17811. },
  17812. "required": ["id", "projectID", "time", "title"],
  17813. "additionalProperties": false
  17814. },
  17815. "SessionDelivery": {
  17816. "type": "string",
  17817. "enum": ["immediate", "deferred"]
  17818. },
  17819. "SessionMessageAgentSwitched": {
  17820. "type": "object",
  17821. "properties": {
  17822. "id": {
  17823. "type": "string"
  17824. },
  17825. "metadata": {
  17826. "type": "object"
  17827. },
  17828. "time": {
  17829. "type": "object",
  17830. "properties": {
  17831. "created": {
  17832. "type": "number"
  17833. }
  17834. },
  17835. "required": ["created"],
  17836. "additionalProperties": false
  17837. },
  17838. "type": {
  17839. "type": "string",
  17840. "enum": ["agent-switched"]
  17841. },
  17842. "agent": {
  17843. "type": "string"
  17844. }
  17845. },
  17846. "required": ["id", "time", "type", "agent"],
  17847. "additionalProperties": false
  17848. },
  17849. "SessionMessageModelSwitched": {
  17850. "type": "object",
  17851. "properties": {
  17852. "id": {
  17853. "type": "string"
  17854. },
  17855. "metadata": {
  17856. "type": "object"
  17857. },
  17858. "time": {
  17859. "type": "object",
  17860. "properties": {
  17861. "created": {
  17862. "type": "number"
  17863. }
  17864. },
  17865. "required": ["created"],
  17866. "additionalProperties": false
  17867. },
  17868. "type": {
  17869. "type": "string",
  17870. "enum": ["model-switched"]
  17871. },
  17872. "model": {
  17873. "type": "object",
  17874. "properties": {
  17875. "id": {
  17876. "type": "string"
  17877. },
  17878. "providerID": {
  17879. "type": "string"
  17880. },
  17881. "variant": {
  17882. "type": "string"
  17883. }
  17884. },
  17885. "required": ["id", "providerID", "variant"],
  17886. "additionalProperties": false
  17887. }
  17888. },
  17889. "required": ["id", "time", "type", "model"],
  17890. "additionalProperties": false
  17891. },
  17892. "SessionMessageUser": {
  17893. "type": "object",
  17894. "properties": {
  17895. "id": {
  17896. "type": "string"
  17897. },
  17898. "metadata": {
  17899. "type": "object"
  17900. },
  17901. "time": {
  17902. "type": "object",
  17903. "properties": {
  17904. "created": {
  17905. "type": "number"
  17906. }
  17907. },
  17908. "required": ["created"],
  17909. "additionalProperties": false
  17910. },
  17911. "text": {
  17912. "type": "string"
  17913. },
  17914. "files": {
  17915. "type": "array",
  17916. "items": {
  17917. "$ref": "#/components/schemas/PromptFileAttachment"
  17918. }
  17919. },
  17920. "agents": {
  17921. "type": "array",
  17922. "items": {
  17923. "$ref": "#/components/schemas/PromptAgentAttachment"
  17924. }
  17925. },
  17926. "type": {
  17927. "type": "string",
  17928. "enum": ["user"]
  17929. }
  17930. },
  17931. "required": ["id", "time", "text", "type"],
  17932. "additionalProperties": false
  17933. },
  17934. "SessionMessageSynthetic": {
  17935. "type": "object",
  17936. "properties": {
  17937. "id": {
  17938. "type": "string"
  17939. },
  17940. "metadata": {
  17941. "type": "object"
  17942. },
  17943. "time": {
  17944. "type": "object",
  17945. "properties": {
  17946. "created": {
  17947. "type": "number"
  17948. }
  17949. },
  17950. "required": ["created"],
  17951. "additionalProperties": false
  17952. },
  17953. "sessionID": {
  17954. "type": "string"
  17955. },
  17956. "text": {
  17957. "type": "string"
  17958. },
  17959. "type": {
  17960. "type": "string",
  17961. "enum": ["synthetic"]
  17962. }
  17963. },
  17964. "required": ["id", "time", "sessionID", "text", "type"],
  17965. "additionalProperties": false
  17966. },
  17967. "SessionMessageShell": {
  17968. "type": "object",
  17969. "properties": {
  17970. "id": {
  17971. "type": "string"
  17972. },
  17973. "metadata": {
  17974. "type": "object"
  17975. },
  17976. "time": {
  17977. "type": "object",
  17978. "properties": {
  17979. "created": {
  17980. "type": "number"
  17981. },
  17982. "completed": {
  17983. "type": "number"
  17984. }
  17985. },
  17986. "required": ["created"],
  17987. "additionalProperties": false
  17988. },
  17989. "type": {
  17990. "type": "string",
  17991. "enum": ["shell"]
  17992. },
  17993. "callID": {
  17994. "type": "string"
  17995. },
  17996. "command": {
  17997. "type": "string"
  17998. },
  17999. "output": {
  18000. "type": "string"
  18001. }
  18002. },
  18003. "required": ["id", "time", "type", "callID", "command", "output"],
  18004. "additionalProperties": false
  18005. },
  18006. "SessionMessageAssistantText": {
  18007. "type": "object",
  18008. "properties": {
  18009. "type": {
  18010. "type": "string",
  18011. "enum": ["text"]
  18012. },
  18013. "text": {
  18014. "type": "string"
  18015. }
  18016. },
  18017. "required": ["type", "text"],
  18018. "additionalProperties": false
  18019. },
  18020. "SessionMessageAssistantReasoning": {
  18021. "type": "object",
  18022. "properties": {
  18023. "type": {
  18024. "type": "string",
  18025. "enum": ["reasoning"]
  18026. },
  18027. "id": {
  18028. "type": "string"
  18029. },
  18030. "text": {
  18031. "type": "string"
  18032. }
  18033. },
  18034. "required": ["type", "id", "text"],
  18035. "additionalProperties": false
  18036. },
  18037. "SessionMessageToolStatePending": {
  18038. "type": "object",
  18039. "properties": {
  18040. "status": {
  18041. "type": "string",
  18042. "enum": ["pending"]
  18043. },
  18044. "input": {
  18045. "type": "string"
  18046. }
  18047. },
  18048. "required": ["status", "input"],
  18049. "additionalProperties": false
  18050. },
  18051. "SessionMessageToolStateRunning": {
  18052. "type": "object",
  18053. "properties": {
  18054. "status": {
  18055. "type": "string",
  18056. "enum": ["running"]
  18057. },
  18058. "input": {
  18059. "type": "object"
  18060. },
  18061. "structured": {
  18062. "type": "object"
  18063. },
  18064. "content": {
  18065. "type": "array",
  18066. "items": {
  18067. "anyOf": [
  18068. {
  18069. "$ref": "#/components/schemas/ToolTextContent"
  18070. },
  18071. {
  18072. "$ref": "#/components/schemas/ToolFileContent"
  18073. }
  18074. ]
  18075. }
  18076. }
  18077. },
  18078. "required": ["status", "input", "structured", "content"],
  18079. "additionalProperties": false
  18080. },
  18081. "SessionMessageToolStateCompleted": {
  18082. "type": "object",
  18083. "properties": {
  18084. "status": {
  18085. "type": "string",
  18086. "enum": ["completed"]
  18087. },
  18088. "input": {
  18089. "type": "object"
  18090. },
  18091. "attachments": {
  18092. "type": "array",
  18093. "items": {
  18094. "$ref": "#/components/schemas/PromptFileAttachment"
  18095. }
  18096. },
  18097. "content": {
  18098. "type": "array",
  18099. "items": {
  18100. "anyOf": [
  18101. {
  18102. "$ref": "#/components/schemas/ToolTextContent"
  18103. },
  18104. {
  18105. "$ref": "#/components/schemas/ToolFileContent"
  18106. }
  18107. ]
  18108. }
  18109. },
  18110. "structured": {
  18111. "type": "object"
  18112. }
  18113. },
  18114. "required": ["status", "input", "content", "structured"],
  18115. "additionalProperties": false
  18116. },
  18117. "SessionMessageToolStateError": {
  18118. "type": "object",
  18119. "properties": {
  18120. "status": {
  18121. "type": "string",
  18122. "enum": ["error"]
  18123. },
  18124. "input": {
  18125. "type": "object"
  18126. },
  18127. "content": {
  18128. "type": "array",
  18129. "items": {
  18130. "anyOf": [
  18131. {
  18132. "$ref": "#/components/schemas/ToolTextContent"
  18133. },
  18134. {
  18135. "$ref": "#/components/schemas/ToolFileContent"
  18136. }
  18137. ]
  18138. }
  18139. },
  18140. "structured": {
  18141. "type": "object"
  18142. },
  18143. "error": {
  18144. "$ref": "#/components/schemas/SessionErrorUnknown"
  18145. }
  18146. },
  18147. "required": ["status", "input", "content", "structured", "error"],
  18148. "additionalProperties": false
  18149. },
  18150. "SessionMessageAssistantTool": {
  18151. "type": "object",
  18152. "properties": {
  18153. "type": {
  18154. "type": "string",
  18155. "enum": ["tool"]
  18156. },
  18157. "id": {
  18158. "type": "string"
  18159. },
  18160. "name": {
  18161. "type": "string"
  18162. },
  18163. "provider": {
  18164. "type": "object",
  18165. "properties": {
  18166. "executed": {
  18167. "type": "boolean"
  18168. },
  18169. "metadata": {
  18170. "type": "object"
  18171. }
  18172. },
  18173. "required": ["executed"],
  18174. "additionalProperties": false
  18175. },
  18176. "state": {
  18177. "anyOf": [
  18178. {
  18179. "$ref": "#/components/schemas/SessionMessageToolStatePending"
  18180. },
  18181. {
  18182. "$ref": "#/components/schemas/SessionMessageToolStateRunning"
  18183. },
  18184. {
  18185. "$ref": "#/components/schemas/SessionMessageToolStateCompleted"
  18186. },
  18187. {
  18188. "$ref": "#/components/schemas/SessionMessageToolStateError"
  18189. }
  18190. ]
  18191. },
  18192. "time": {
  18193. "type": "object",
  18194. "properties": {
  18195. "created": {
  18196. "type": "number"
  18197. },
  18198. "ran": {
  18199. "type": "number"
  18200. },
  18201. "completed": {
  18202. "type": "number"
  18203. },
  18204. "pruned": {
  18205. "type": "number"
  18206. }
  18207. },
  18208. "required": ["created"],
  18209. "additionalProperties": false
  18210. }
  18211. },
  18212. "required": ["type", "id", "name", "state", "time"],
  18213. "additionalProperties": false
  18214. },
  18215. "SessionMessageAssistant": {
  18216. "type": "object",
  18217. "properties": {
  18218. "id": {
  18219. "type": "string"
  18220. },
  18221. "metadata": {
  18222. "type": "object"
  18223. },
  18224. "time": {
  18225. "type": "object",
  18226. "properties": {
  18227. "created": {
  18228. "type": "number"
  18229. },
  18230. "completed": {
  18231. "type": "number"
  18232. }
  18233. },
  18234. "required": ["created"],
  18235. "additionalProperties": false
  18236. },
  18237. "type": {
  18238. "type": "string",
  18239. "enum": ["assistant"]
  18240. },
  18241. "agent": {
  18242. "type": "string"
  18243. },
  18244. "model": {
  18245. "type": "object",
  18246. "properties": {
  18247. "id": {
  18248. "type": "string"
  18249. },
  18250. "providerID": {
  18251. "type": "string"
  18252. },
  18253. "variant": {
  18254. "type": "string"
  18255. }
  18256. },
  18257. "required": ["id", "providerID", "variant"],
  18258. "additionalProperties": false
  18259. },
  18260. "content": {
  18261. "type": "array",
  18262. "items": {
  18263. "anyOf": [
  18264. {
  18265. "$ref": "#/components/schemas/SessionMessageAssistantText"
  18266. },
  18267. {
  18268. "$ref": "#/components/schemas/SessionMessageAssistantReasoning"
  18269. },
  18270. {
  18271. "$ref": "#/components/schemas/SessionMessageAssistantTool"
  18272. }
  18273. ]
  18274. }
  18275. },
  18276. "snapshot": {
  18277. "type": "object",
  18278. "properties": {
  18279. "start": {
  18280. "type": "string"
  18281. },
  18282. "end": {
  18283. "type": "string"
  18284. }
  18285. },
  18286. "additionalProperties": false
  18287. },
  18288. "finish": {
  18289. "type": "string"
  18290. },
  18291. "cost": {
  18292. "type": "number"
  18293. },
  18294. "tokens": {
  18295. "type": "object",
  18296. "properties": {
  18297. "input": {
  18298. "type": "number"
  18299. },
  18300. "output": {
  18301. "type": "number"
  18302. },
  18303. "reasoning": {
  18304. "type": "number"
  18305. },
  18306. "cache": {
  18307. "type": "object",
  18308. "properties": {
  18309. "read": {
  18310. "type": "number"
  18311. },
  18312. "write": {
  18313. "type": "number"
  18314. }
  18315. },
  18316. "required": ["read", "write"],
  18317. "additionalProperties": false
  18318. }
  18319. },
  18320. "required": ["input", "output", "reasoning", "cache"],
  18321. "additionalProperties": false
  18322. },
  18323. "error": {
  18324. "$ref": "#/components/schemas/SessionErrorUnknown"
  18325. }
  18326. },
  18327. "required": ["id", "time", "type", "agent", "model", "content"],
  18328. "additionalProperties": false
  18329. },
  18330. "SessionMessageCompaction": {
  18331. "type": "object",
  18332. "properties": {
  18333. "type": {
  18334. "type": "string",
  18335. "enum": ["compaction"]
  18336. },
  18337. "reason": {
  18338. "type": "string",
  18339. "enum": ["auto", "manual"]
  18340. },
  18341. "summary": {
  18342. "type": "string"
  18343. },
  18344. "include": {
  18345. "type": "string"
  18346. },
  18347. "id": {
  18348. "type": "string"
  18349. },
  18350. "metadata": {
  18351. "type": "object"
  18352. },
  18353. "time": {
  18354. "type": "object",
  18355. "properties": {
  18356. "created": {
  18357. "type": "number"
  18358. }
  18359. },
  18360. "required": ["created"],
  18361. "additionalProperties": false
  18362. }
  18363. },
  18364. "required": ["type", "reason", "summary", "id", "time"],
  18365. "additionalProperties": false
  18366. },
  18367. "SessionMessage": {
  18368. "anyOf": [
  18369. {
  18370. "$ref": "#/components/schemas/SessionMessageAgentSwitched"
  18371. },
  18372. {
  18373. "$ref": "#/components/schemas/SessionMessageModelSwitched"
  18374. },
  18375. {
  18376. "$ref": "#/components/schemas/SessionMessageUser"
  18377. },
  18378. {
  18379. "$ref": "#/components/schemas/SessionMessageSynthetic"
  18380. },
  18381. {
  18382. "$ref": "#/components/schemas/SessionMessageShell"
  18383. },
  18384. {
  18385. "$ref": "#/components/schemas/SessionMessageAssistant"
  18386. },
  18387. {
  18388. "$ref": "#/components/schemas/SessionMessageCompaction"
  18389. }
  18390. ]
  18391. },
  18392. "EventTuiToastShow1": {
  18393. "type": "object",
  18394. "properties": {
  18395. "id": {
  18396. "type": "string"
  18397. },
  18398. "type": {
  18399. "type": "string",
  18400. "enum": ["tui.toast.show"]
  18401. },
  18402. "properties": {
  18403. "type": "object",
  18404. "properties": {
  18405. "title": {
  18406. "type": "string"
  18407. },
  18408. "message": {
  18409. "type": "string"
  18410. },
  18411. "variant": {
  18412. "type": "string",
  18413. "enum": ["info", "success", "warning", "error"]
  18414. },
  18415. "duration": {
  18416. "type": "integer",
  18417. "exclusiveMinimum": 0
  18418. }
  18419. },
  18420. "required": ["message", "variant"],
  18421. "additionalProperties": false
  18422. }
  18423. },
  18424. "required": ["id", "type", "properties"],
  18425. "additionalProperties": false
  18426. },
  18427. "BadRequestError": {
  18428. "type": "object",
  18429. "required": ["data", "errors", "success"],
  18430. "properties": {
  18431. "data": {},
  18432. "errors": {
  18433. "type": "array",
  18434. "items": {
  18435. "type": "object",
  18436. "additionalProperties": {}
  18437. }
  18438. },
  18439. "success": {
  18440. "type": "boolean",
  18441. "enum": [false]
  18442. }
  18443. }
  18444. }
  18445. }
  18446. },
  18447. "security": [],
  18448. "tags": [
  18449. {
  18450. "name": "control",
  18451. "description": "Control plane routes."
  18452. },
  18453. {
  18454. "name": "global",
  18455. "description": "Global server routes."
  18456. },
  18457. {
  18458. "name": "event",
  18459. "description": "Instance event stream route."
  18460. },
  18461. {
  18462. "name": "config",
  18463. "description": "Experimental HttpApi config routes."
  18464. },
  18465. {
  18466. "name": "experimental",
  18467. "description": "Experimental HttpApi read-only routes."
  18468. },
  18469. {
  18470. "name": "file",
  18471. "description": "Experimental HttpApi file routes."
  18472. },
  18473. {
  18474. "name": "instance",
  18475. "description": "Experimental HttpApi instance read routes."
  18476. },
  18477. {
  18478. "name": "mcp",
  18479. "description": "Experimental HttpApi MCP routes."
  18480. },
  18481. {
  18482. "name": "project",
  18483. "description": "Experimental HttpApi project routes."
  18484. },
  18485. {
  18486. "name": "pty",
  18487. "description": "Experimental HttpApi PTY routes."
  18488. },
  18489. {
  18490. "name": "question",
  18491. "description": "Question routes."
  18492. },
  18493. {
  18494. "name": "permission",
  18495. "description": "Experimental HttpApi permission routes."
  18496. },
  18497. {
  18498. "name": "provider",
  18499. "description": "Experimental HttpApi provider routes."
  18500. },
  18501. {
  18502. "name": "session",
  18503. "description": "Experimental HttpApi session routes."
  18504. },
  18505. {
  18506. "name": "sync",
  18507. "description": "Experimental HttpApi sync routes."
  18508. },
  18509. {
  18510. "name": "v2",
  18511. "description": "Experimental v2 routes."
  18512. },
  18513. {
  18514. "name": "v2 messages",
  18515. "description": "Experimental v2 message routes."
  18516. },
  18517. {
  18518. "name": "tui",
  18519. "description": "Experimental HttpApi TUI routes."
  18520. },
  18521. {
  18522. "name": "workspace",
  18523. "description": "Experimental HttpApi workspace routes."
  18524. },
  18525. {
  18526. "name": "pty",
  18527. "description": "PTY websocket route."
  18528. }
  18529. ]
  18530. }