openapi.json 501 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477
  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", "description", "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. "PermissionActionConfig": {
  11315. "type": "string",
  11316. "enum": ["ask", "allow", "deny"]
  11317. },
  11318. "PermissionObjectConfig": {
  11319. "type": "object",
  11320. "additionalProperties": {
  11321. "$ref": "#/components/schemas/PermissionActionConfig"
  11322. }
  11323. },
  11324. "PermissionRuleConfig": {
  11325. "anyOf": [
  11326. {
  11327. "$ref": "#/components/schemas/PermissionActionConfig"
  11328. },
  11329. {
  11330. "$ref": "#/components/schemas/PermissionObjectConfig"
  11331. }
  11332. ]
  11333. },
  11334. "PermissionConfig": {
  11335. "anyOf": [
  11336. {
  11337. "$ref": "#/components/schemas/PermissionActionConfig"
  11338. },
  11339. {
  11340. "type": "object",
  11341. "properties": {
  11342. "read": {
  11343. "$ref": "#/components/schemas/PermissionRuleConfig"
  11344. },
  11345. "edit": {
  11346. "$ref": "#/components/schemas/PermissionRuleConfig"
  11347. },
  11348. "glob": {
  11349. "$ref": "#/components/schemas/PermissionRuleConfig"
  11350. },
  11351. "grep": {
  11352. "$ref": "#/components/schemas/PermissionRuleConfig"
  11353. },
  11354. "list": {
  11355. "$ref": "#/components/schemas/PermissionRuleConfig"
  11356. },
  11357. "bash": {
  11358. "$ref": "#/components/schemas/PermissionRuleConfig"
  11359. },
  11360. "task": {
  11361. "$ref": "#/components/schemas/PermissionRuleConfig"
  11362. },
  11363. "external_directory": {
  11364. "$ref": "#/components/schemas/PermissionRuleConfig"
  11365. },
  11366. "todowrite": {
  11367. "$ref": "#/components/schemas/PermissionActionConfig"
  11368. },
  11369. "question": {
  11370. "$ref": "#/components/schemas/PermissionActionConfig"
  11371. },
  11372. "webfetch": {
  11373. "$ref": "#/components/schemas/PermissionActionConfig"
  11374. },
  11375. "websearch": {
  11376. "$ref": "#/components/schemas/PermissionActionConfig"
  11377. },
  11378. "lsp": {
  11379. "$ref": "#/components/schemas/PermissionRuleConfig"
  11380. },
  11381. "doom_loop": {
  11382. "$ref": "#/components/schemas/PermissionActionConfig"
  11383. },
  11384. "skill": {
  11385. "$ref": "#/components/schemas/PermissionRuleConfig"
  11386. }
  11387. },
  11388. "additionalProperties": {
  11389. "$ref": "#/components/schemas/PermissionRuleConfig"
  11390. }
  11391. }
  11392. ]
  11393. },
  11394. "AgentConfig": {
  11395. "type": "object",
  11396. "properties": {
  11397. "model": {
  11398. "type": "string"
  11399. },
  11400. "variant": {
  11401. "type": "string"
  11402. },
  11403. "temperature": {
  11404. "type": "number"
  11405. },
  11406. "top_p": {
  11407. "type": "number"
  11408. },
  11409. "prompt": {
  11410. "type": "string"
  11411. },
  11412. "tools": {
  11413. "type": "object",
  11414. "additionalProperties": {
  11415. "type": "boolean"
  11416. }
  11417. },
  11418. "disable": {
  11419. "type": "boolean"
  11420. },
  11421. "description": {
  11422. "type": "string"
  11423. },
  11424. "mode": {
  11425. "type": "string",
  11426. "enum": ["subagent", "primary", "all"]
  11427. },
  11428. "hidden": {
  11429. "type": "boolean"
  11430. },
  11431. "options": {
  11432. "type": "object"
  11433. },
  11434. "color": {
  11435. "anyOf": [
  11436. {
  11437. "type": "string",
  11438. "pattern": "^#[0-9a-fA-F]{6}$"
  11439. },
  11440. {
  11441. "type": "string",
  11442. "enum": ["primary", "secondary", "accent", "success", "warning", "error", "info"]
  11443. }
  11444. ],
  11445. "description": "Hex color code (e.g., #FF5733) or theme color (e.g., primary)"
  11446. },
  11447. "steps": {
  11448. "type": "integer",
  11449. "exclusiveMinimum": 0
  11450. },
  11451. "maxSteps": {
  11452. "type": "integer",
  11453. "exclusiveMinimum": 0
  11454. },
  11455. "permission": {
  11456. "$ref": "#/components/schemas/PermissionConfig"
  11457. }
  11458. },
  11459. "additionalProperties": {}
  11460. },
  11461. "ProviderConfig": {
  11462. "type": "object",
  11463. "properties": {
  11464. "api": {
  11465. "type": "string"
  11466. },
  11467. "name": {
  11468. "type": "string"
  11469. },
  11470. "env": {
  11471. "type": "array",
  11472. "items": {
  11473. "type": "string"
  11474. }
  11475. },
  11476. "id": {
  11477. "type": "string"
  11478. },
  11479. "npm": {
  11480. "type": "string"
  11481. },
  11482. "whitelist": {
  11483. "type": "array",
  11484. "items": {
  11485. "type": "string"
  11486. }
  11487. },
  11488. "blacklist": {
  11489. "type": "array",
  11490. "items": {
  11491. "type": "string"
  11492. }
  11493. },
  11494. "options": {
  11495. "type": "object",
  11496. "properties": {
  11497. "apiKey": {
  11498. "type": "string"
  11499. },
  11500. "baseURL": {
  11501. "type": "string"
  11502. },
  11503. "enterpriseUrl": {
  11504. "type": "string"
  11505. },
  11506. "setCacheKey": {
  11507. "type": "boolean"
  11508. },
  11509. "timeout": {
  11510. "anyOf": [
  11511. {
  11512. "type": "integer",
  11513. "exclusiveMinimum": 0
  11514. },
  11515. {
  11516. "type": "boolean",
  11517. "enum": [false]
  11518. }
  11519. ],
  11520. "description": "Timeout in milliseconds for requests to this provider. Default is 300000 (5 minutes). Set to false to disable timeout."
  11521. },
  11522. "chunkTimeout": {
  11523. "type": "integer",
  11524. "exclusiveMinimum": 0
  11525. }
  11526. },
  11527. "additionalProperties": {}
  11528. },
  11529. "models": {
  11530. "type": "object",
  11531. "additionalProperties": {
  11532. "type": "object",
  11533. "properties": {
  11534. "id": {
  11535. "type": "string"
  11536. },
  11537. "name": {
  11538. "type": "string"
  11539. },
  11540. "family": {
  11541. "type": "string"
  11542. },
  11543. "release_date": {
  11544. "type": "string"
  11545. },
  11546. "attachment": {
  11547. "type": "boolean"
  11548. },
  11549. "reasoning": {
  11550. "type": "boolean"
  11551. },
  11552. "temperature": {
  11553. "type": "boolean"
  11554. },
  11555. "tool_call": {
  11556. "type": "boolean"
  11557. },
  11558. "interleaved": {
  11559. "anyOf": [
  11560. {
  11561. "type": "boolean",
  11562. "enum": [true]
  11563. },
  11564. {
  11565. "type": "object",
  11566. "properties": {
  11567. "field": {
  11568. "type": "string",
  11569. "enum": ["reasoning_content", "reasoning_details"]
  11570. }
  11571. },
  11572. "required": ["field"],
  11573. "additionalProperties": false
  11574. }
  11575. ]
  11576. },
  11577. "cost": {
  11578. "type": "object",
  11579. "properties": {
  11580. "input": {
  11581. "type": "number"
  11582. },
  11583. "output": {
  11584. "type": "number"
  11585. },
  11586. "cache_read": {
  11587. "type": "number"
  11588. },
  11589. "cache_write": {
  11590. "type": "number"
  11591. },
  11592. "context_over_200k": {
  11593. "type": "object",
  11594. "properties": {
  11595. "input": {
  11596. "type": "number"
  11597. },
  11598. "output": {
  11599. "type": "number"
  11600. },
  11601. "cache_read": {
  11602. "type": "number"
  11603. },
  11604. "cache_write": {
  11605. "type": "number"
  11606. }
  11607. },
  11608. "required": ["input", "output"],
  11609. "additionalProperties": false
  11610. }
  11611. },
  11612. "required": ["input", "output"],
  11613. "additionalProperties": false
  11614. },
  11615. "limit": {
  11616. "type": "object",
  11617. "properties": {
  11618. "context": {
  11619. "type": "number"
  11620. },
  11621. "input": {
  11622. "type": "number"
  11623. },
  11624. "output": {
  11625. "type": "number"
  11626. }
  11627. },
  11628. "required": ["context", "output"],
  11629. "additionalProperties": false
  11630. },
  11631. "modalities": {
  11632. "type": "object",
  11633. "properties": {
  11634. "input": {
  11635. "type": "array",
  11636. "items": {
  11637. "type": "string",
  11638. "enum": ["text", "audio", "image", "video", "pdf"]
  11639. }
  11640. },
  11641. "output": {
  11642. "type": "array",
  11643. "items": {
  11644. "type": "string",
  11645. "enum": ["text", "audio", "image", "video", "pdf"]
  11646. }
  11647. }
  11648. },
  11649. "required": ["input", "output"],
  11650. "additionalProperties": false
  11651. },
  11652. "experimental": {
  11653. "type": "boolean"
  11654. },
  11655. "status": {
  11656. "type": "string",
  11657. "enum": ["alpha", "beta", "deprecated"]
  11658. },
  11659. "provider": {
  11660. "type": "object",
  11661. "properties": {
  11662. "npm": {
  11663. "type": "string"
  11664. },
  11665. "api": {
  11666. "type": "string"
  11667. }
  11668. },
  11669. "additionalProperties": false
  11670. },
  11671. "options": {
  11672. "type": "object"
  11673. },
  11674. "headers": {
  11675. "type": "object",
  11676. "additionalProperties": {
  11677. "type": "string"
  11678. }
  11679. },
  11680. "variants": {
  11681. "type": "object",
  11682. "additionalProperties": {
  11683. "type": "object",
  11684. "properties": {
  11685. "disabled": {
  11686. "type": "boolean"
  11687. }
  11688. },
  11689. "additionalProperties": {}
  11690. },
  11691. "description": "Variant-specific configuration"
  11692. }
  11693. },
  11694. "additionalProperties": false
  11695. }
  11696. }
  11697. },
  11698. "additionalProperties": false
  11699. },
  11700. "McpLocalConfig": {
  11701. "type": "object",
  11702. "properties": {
  11703. "type": {
  11704. "type": "string",
  11705. "enum": ["local"],
  11706. "description": "Type of MCP server connection"
  11707. },
  11708. "command": {
  11709. "type": "array",
  11710. "items": {
  11711. "type": "string"
  11712. },
  11713. "description": "Command and arguments to run the MCP server"
  11714. },
  11715. "environment": {
  11716. "type": "object",
  11717. "additionalProperties": {
  11718. "type": "string"
  11719. }
  11720. },
  11721. "enabled": {
  11722. "type": "boolean"
  11723. },
  11724. "timeout": {
  11725. "type": "integer",
  11726. "exclusiveMinimum": 0
  11727. }
  11728. },
  11729. "required": ["type", "command"],
  11730. "additionalProperties": false
  11731. },
  11732. "McpOAuthConfig": {
  11733. "type": "object",
  11734. "properties": {
  11735. "clientId": {
  11736. "type": "string"
  11737. },
  11738. "clientSecret": {
  11739. "type": "string"
  11740. },
  11741. "scope": {
  11742. "type": "string"
  11743. },
  11744. "redirectUri": {
  11745. "type": "string"
  11746. }
  11747. },
  11748. "additionalProperties": false
  11749. },
  11750. "McpRemoteConfig": {
  11751. "type": "object",
  11752. "properties": {
  11753. "type": {
  11754. "type": "string",
  11755. "enum": ["remote"],
  11756. "description": "Type of MCP server connection"
  11757. },
  11758. "url": {
  11759. "type": "string",
  11760. "description": "URL of the remote MCP server"
  11761. },
  11762. "enabled": {
  11763. "type": "boolean"
  11764. },
  11765. "headers": {
  11766. "type": "object",
  11767. "additionalProperties": {
  11768. "type": "string"
  11769. }
  11770. },
  11771. "oauth": {
  11772. "anyOf": [
  11773. {
  11774. "$ref": "#/components/schemas/McpOAuthConfig"
  11775. },
  11776. {
  11777. "type": "boolean",
  11778. "enum": [false]
  11779. }
  11780. ],
  11781. "description": "OAuth authentication configuration for the MCP server. Set to false to disable OAuth auto-detection."
  11782. },
  11783. "timeout": {
  11784. "type": "integer",
  11785. "exclusiveMinimum": 0
  11786. }
  11787. },
  11788. "required": ["type", "url"],
  11789. "additionalProperties": false
  11790. },
  11791. "LayoutConfig": {
  11792. "type": "string",
  11793. "enum": ["auto", "stretch"],
  11794. "description": "@deprecated Always uses stretch layout."
  11795. },
  11796. "Config": {
  11797. "type": "object",
  11798. "properties": {
  11799. "$schema": {
  11800. "type": "string"
  11801. },
  11802. "shell": {
  11803. "type": "string"
  11804. },
  11805. "logLevel": {
  11806. "$ref": "#/components/schemas/LogLevel"
  11807. },
  11808. "server": {
  11809. "$ref": "#/components/schemas/ServerConfig"
  11810. },
  11811. "command": {
  11812. "type": "object",
  11813. "additionalProperties": {
  11814. "type": "object",
  11815. "properties": {
  11816. "template": {
  11817. "type": "string"
  11818. },
  11819. "description": {
  11820. "type": "string"
  11821. },
  11822. "agent": {
  11823. "type": "string"
  11824. },
  11825. "model": {
  11826. "type": "string"
  11827. },
  11828. "subtask": {
  11829. "type": "boolean"
  11830. }
  11831. },
  11832. "required": ["template"],
  11833. "additionalProperties": false
  11834. }
  11835. },
  11836. "skills": {
  11837. "type": "object",
  11838. "properties": {
  11839. "paths": {
  11840. "type": "array",
  11841. "items": {
  11842. "type": "string"
  11843. }
  11844. },
  11845. "urls": {
  11846. "type": "array",
  11847. "items": {
  11848. "type": "string"
  11849. }
  11850. }
  11851. },
  11852. "additionalProperties": false
  11853. },
  11854. "watcher": {
  11855. "type": "object",
  11856. "properties": {
  11857. "ignore": {
  11858. "type": "array",
  11859. "items": {
  11860. "type": "string"
  11861. }
  11862. }
  11863. },
  11864. "additionalProperties": false
  11865. },
  11866. "snapshot": {
  11867. "type": "boolean"
  11868. },
  11869. "plugin": {
  11870. "type": "array",
  11871. "items": {
  11872. "anyOf": [
  11873. {
  11874. "type": "string"
  11875. },
  11876. {
  11877. "type": "array",
  11878. "prefixItems": [
  11879. {
  11880. "type": "string"
  11881. },
  11882. {
  11883. "type": "object"
  11884. }
  11885. ],
  11886. "maxItems": 2,
  11887. "minItems": 2
  11888. }
  11889. ]
  11890. }
  11891. },
  11892. "share": {
  11893. "type": "string",
  11894. "enum": ["manual", "auto", "disabled"]
  11895. },
  11896. "autoshare": {
  11897. "type": "boolean"
  11898. },
  11899. "autoupdate": {
  11900. "anyOf": [
  11901. {
  11902. "type": "boolean"
  11903. },
  11904. {
  11905. "type": "string",
  11906. "enum": ["notify"]
  11907. }
  11908. ],
  11909. "description": "Automatically update to the latest version. Set to true to auto-update, false to disable, or 'notify' to show update notifications"
  11910. },
  11911. "disabled_providers": {
  11912. "type": "array",
  11913. "items": {
  11914. "type": "string"
  11915. }
  11916. },
  11917. "enabled_providers": {
  11918. "type": "array",
  11919. "items": {
  11920. "type": "string"
  11921. }
  11922. },
  11923. "model": {
  11924. "type": "string"
  11925. },
  11926. "small_model": {
  11927. "type": "string"
  11928. },
  11929. "default_agent": {
  11930. "type": "string"
  11931. },
  11932. "username": {
  11933. "type": "string"
  11934. },
  11935. "mode": {
  11936. "type": "object",
  11937. "properties": {
  11938. "build": {
  11939. "$ref": "#/components/schemas/AgentConfig"
  11940. },
  11941. "plan": {
  11942. "$ref": "#/components/schemas/AgentConfig"
  11943. }
  11944. },
  11945. "additionalProperties": {
  11946. "$ref": "#/components/schemas/AgentConfig"
  11947. }
  11948. },
  11949. "agent": {
  11950. "type": "object",
  11951. "properties": {
  11952. "plan": {
  11953. "$ref": "#/components/schemas/AgentConfig"
  11954. },
  11955. "build": {
  11956. "$ref": "#/components/schemas/AgentConfig"
  11957. },
  11958. "general": {
  11959. "$ref": "#/components/schemas/AgentConfig"
  11960. },
  11961. "explore": {
  11962. "$ref": "#/components/schemas/AgentConfig"
  11963. },
  11964. "title": {
  11965. "$ref": "#/components/schemas/AgentConfig"
  11966. },
  11967. "summary": {
  11968. "$ref": "#/components/schemas/AgentConfig"
  11969. },
  11970. "compaction": {
  11971. "$ref": "#/components/schemas/AgentConfig"
  11972. }
  11973. },
  11974. "additionalProperties": {
  11975. "$ref": "#/components/schemas/AgentConfig"
  11976. }
  11977. },
  11978. "provider": {
  11979. "type": "object",
  11980. "additionalProperties": {
  11981. "$ref": "#/components/schemas/ProviderConfig"
  11982. }
  11983. },
  11984. "mcp": {
  11985. "type": "object",
  11986. "additionalProperties": {
  11987. "anyOf": [
  11988. {
  11989. "$ref": "#/components/schemas/McpLocalConfig"
  11990. },
  11991. {
  11992. "$ref": "#/components/schemas/McpRemoteConfig"
  11993. },
  11994. {
  11995. "type": "object",
  11996. "properties": {
  11997. "enabled": {
  11998. "type": "boolean"
  11999. }
  12000. },
  12001. "required": ["enabled"],
  12002. "additionalProperties": false
  12003. }
  12004. ]
  12005. }
  12006. },
  12007. "formatter": {
  12008. "anyOf": [
  12009. {
  12010. "type": "boolean"
  12011. },
  12012. {
  12013. "type": "object",
  12014. "additionalProperties": {
  12015. "type": "object",
  12016. "properties": {
  12017. "disabled": {
  12018. "type": "boolean"
  12019. },
  12020. "command": {
  12021. "type": "array",
  12022. "items": {
  12023. "type": "string"
  12024. }
  12025. },
  12026. "environment": {
  12027. "type": "object",
  12028. "additionalProperties": {
  12029. "type": "string"
  12030. }
  12031. },
  12032. "extensions": {
  12033. "type": "array",
  12034. "items": {
  12035. "type": "string"
  12036. }
  12037. }
  12038. },
  12039. "additionalProperties": false
  12040. }
  12041. }
  12042. ],
  12043. "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."
  12044. },
  12045. "lsp": {
  12046. "anyOf": [
  12047. {
  12048. "type": "boolean"
  12049. },
  12050. {
  12051. "type": "object",
  12052. "additionalProperties": {
  12053. "anyOf": [
  12054. {
  12055. "type": "object",
  12056. "properties": {
  12057. "disabled": {
  12058. "type": "boolean",
  12059. "enum": [true]
  12060. }
  12061. },
  12062. "required": ["disabled"],
  12063. "additionalProperties": false
  12064. },
  12065. {
  12066. "type": "object",
  12067. "properties": {
  12068. "command": {
  12069. "type": "array",
  12070. "items": {
  12071. "type": "string"
  12072. }
  12073. },
  12074. "extensions": {
  12075. "type": "array",
  12076. "items": {
  12077. "type": "string"
  12078. }
  12079. },
  12080. "disabled": {
  12081. "type": "boolean"
  12082. },
  12083. "env": {
  12084. "type": "object",
  12085. "additionalProperties": {
  12086. "type": "string"
  12087. }
  12088. },
  12089. "initialization": {
  12090. "type": "object"
  12091. }
  12092. },
  12093. "required": ["command"],
  12094. "additionalProperties": false
  12095. }
  12096. ]
  12097. }
  12098. }
  12099. ],
  12100. "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."
  12101. },
  12102. "instructions": {
  12103. "type": "array",
  12104. "items": {
  12105. "type": "string"
  12106. }
  12107. },
  12108. "layout": {
  12109. "$ref": "#/components/schemas/LayoutConfig"
  12110. },
  12111. "permission": {
  12112. "$ref": "#/components/schemas/PermissionConfig"
  12113. },
  12114. "tools": {
  12115. "type": "object",
  12116. "additionalProperties": {
  12117. "type": "boolean"
  12118. }
  12119. },
  12120. "enterprise": {
  12121. "type": "object",
  12122. "properties": {
  12123. "url": {
  12124. "type": "string"
  12125. }
  12126. },
  12127. "additionalProperties": false
  12128. },
  12129. "tool_output": {
  12130. "type": "object",
  12131. "properties": {
  12132. "max_lines": {
  12133. "type": "integer",
  12134. "exclusiveMinimum": 0
  12135. },
  12136. "max_bytes": {
  12137. "type": "integer",
  12138. "exclusiveMinimum": 0
  12139. }
  12140. },
  12141. "additionalProperties": false
  12142. },
  12143. "compaction": {
  12144. "type": "object",
  12145. "properties": {
  12146. "auto": {
  12147. "type": "boolean"
  12148. },
  12149. "prune": {
  12150. "type": "boolean"
  12151. },
  12152. "tail_turns": {
  12153. "type": "integer",
  12154. "minimum": 0
  12155. },
  12156. "preserve_recent_tokens": {
  12157. "type": "integer",
  12158. "minimum": 0
  12159. },
  12160. "reserved": {
  12161. "type": "integer",
  12162. "minimum": 0
  12163. }
  12164. },
  12165. "additionalProperties": false
  12166. },
  12167. "experimental": {
  12168. "type": "object",
  12169. "properties": {
  12170. "disable_paste_summary": {
  12171. "type": "boolean"
  12172. },
  12173. "batch_tool": {
  12174. "type": "boolean"
  12175. },
  12176. "openTelemetry": {
  12177. "type": "boolean"
  12178. },
  12179. "primary_tools": {
  12180. "type": "array",
  12181. "items": {
  12182. "type": "string"
  12183. }
  12184. },
  12185. "continue_loop_on_deny": {
  12186. "type": "boolean"
  12187. },
  12188. "mcp_timeout": {
  12189. "type": "integer",
  12190. "exclusiveMinimum": 0
  12191. }
  12192. },
  12193. "additionalProperties": false
  12194. }
  12195. },
  12196. "additionalProperties": false
  12197. },
  12198. "Model": {
  12199. "type": "object",
  12200. "properties": {
  12201. "id": {
  12202. "type": "string"
  12203. },
  12204. "providerID": {
  12205. "type": "string"
  12206. },
  12207. "api": {
  12208. "type": "object",
  12209. "properties": {
  12210. "id": {
  12211. "type": "string"
  12212. },
  12213. "url": {
  12214. "type": "string"
  12215. },
  12216. "npm": {
  12217. "type": "string"
  12218. }
  12219. },
  12220. "required": ["id", "url", "npm"],
  12221. "additionalProperties": false
  12222. },
  12223. "name": {
  12224. "type": "string"
  12225. },
  12226. "family": {
  12227. "type": "string"
  12228. },
  12229. "capabilities": {
  12230. "type": "object",
  12231. "properties": {
  12232. "temperature": {
  12233. "type": "boolean"
  12234. },
  12235. "reasoning": {
  12236. "type": "boolean"
  12237. },
  12238. "attachment": {
  12239. "type": "boolean"
  12240. },
  12241. "toolcall": {
  12242. "type": "boolean"
  12243. },
  12244. "input": {
  12245. "type": "object",
  12246. "properties": {
  12247. "text": {
  12248. "type": "boolean"
  12249. },
  12250. "audio": {
  12251. "type": "boolean"
  12252. },
  12253. "image": {
  12254. "type": "boolean"
  12255. },
  12256. "video": {
  12257. "type": "boolean"
  12258. },
  12259. "pdf": {
  12260. "type": "boolean"
  12261. }
  12262. },
  12263. "required": ["text", "audio", "image", "video", "pdf"],
  12264. "additionalProperties": false
  12265. },
  12266. "output": {
  12267. "type": "object",
  12268. "properties": {
  12269. "text": {
  12270. "type": "boolean"
  12271. },
  12272. "audio": {
  12273. "type": "boolean"
  12274. },
  12275. "image": {
  12276. "type": "boolean"
  12277. },
  12278. "video": {
  12279. "type": "boolean"
  12280. },
  12281. "pdf": {
  12282. "type": "boolean"
  12283. }
  12284. },
  12285. "required": ["text", "audio", "image", "video", "pdf"],
  12286. "additionalProperties": false
  12287. },
  12288. "interleaved": {
  12289. "anyOf": [
  12290. {
  12291. "type": "boolean"
  12292. },
  12293. {
  12294. "type": "object",
  12295. "properties": {
  12296. "field": {
  12297. "type": "string",
  12298. "enum": ["reasoning_content", "reasoning_details"]
  12299. }
  12300. },
  12301. "required": ["field"],
  12302. "additionalProperties": false
  12303. }
  12304. ]
  12305. }
  12306. },
  12307. "required": ["temperature", "reasoning", "attachment", "toolcall", "input", "output", "interleaved"],
  12308. "additionalProperties": false
  12309. },
  12310. "cost": {
  12311. "type": "object",
  12312. "properties": {
  12313. "input": {
  12314. "type": "number"
  12315. },
  12316. "output": {
  12317. "type": "number"
  12318. },
  12319. "cache": {
  12320. "type": "object",
  12321. "properties": {
  12322. "read": {
  12323. "type": "number"
  12324. },
  12325. "write": {
  12326. "type": "number"
  12327. }
  12328. },
  12329. "required": ["read", "write"],
  12330. "additionalProperties": false
  12331. },
  12332. "experimentalOver200K": {
  12333. "type": "object",
  12334. "properties": {
  12335. "input": {
  12336. "type": "number"
  12337. },
  12338. "output": {
  12339. "type": "number"
  12340. },
  12341. "cache": {
  12342. "type": "object",
  12343. "properties": {
  12344. "read": {
  12345. "type": "number"
  12346. },
  12347. "write": {
  12348. "type": "number"
  12349. }
  12350. },
  12351. "required": ["read", "write"],
  12352. "additionalProperties": false
  12353. }
  12354. },
  12355. "required": ["input", "output", "cache"],
  12356. "additionalProperties": false
  12357. }
  12358. },
  12359. "required": ["input", "output", "cache"],
  12360. "additionalProperties": false
  12361. },
  12362. "limit": {
  12363. "type": "object",
  12364. "properties": {
  12365. "context": {
  12366. "type": "number"
  12367. },
  12368. "input": {
  12369. "type": "number"
  12370. },
  12371. "output": {
  12372. "type": "number"
  12373. }
  12374. },
  12375. "required": ["context", "output"],
  12376. "additionalProperties": false
  12377. },
  12378. "status": {
  12379. "type": "string",
  12380. "enum": ["alpha", "beta", "deprecated", "active"]
  12381. },
  12382. "options": {
  12383. "type": "object"
  12384. },
  12385. "headers": {
  12386. "type": "object",
  12387. "additionalProperties": {
  12388. "type": "string"
  12389. }
  12390. },
  12391. "release_date": {
  12392. "type": "string"
  12393. },
  12394. "variants": {
  12395. "type": "object",
  12396. "additionalProperties": {
  12397. "type": "object"
  12398. }
  12399. }
  12400. },
  12401. "required": [
  12402. "id",
  12403. "providerID",
  12404. "api",
  12405. "name",
  12406. "capabilities",
  12407. "cost",
  12408. "limit",
  12409. "status",
  12410. "options",
  12411. "headers",
  12412. "release_date"
  12413. ],
  12414. "additionalProperties": false
  12415. },
  12416. "Provider": {
  12417. "type": "object",
  12418. "properties": {
  12419. "id": {
  12420. "type": "string"
  12421. },
  12422. "name": {
  12423. "type": "string"
  12424. },
  12425. "source": {
  12426. "type": "string",
  12427. "enum": ["env", "config", "custom", "api"]
  12428. },
  12429. "env": {
  12430. "type": "array",
  12431. "items": {
  12432. "type": "string"
  12433. }
  12434. },
  12435. "key": {
  12436. "type": "string"
  12437. },
  12438. "options": {
  12439. "type": "object"
  12440. },
  12441. "models": {
  12442. "type": "object",
  12443. "additionalProperties": {
  12444. "$ref": "#/components/schemas/Model"
  12445. }
  12446. }
  12447. },
  12448. "required": ["id", "name", "source", "env", "options", "models"],
  12449. "additionalProperties": false
  12450. },
  12451. "ConsoleState": {
  12452. "type": "object",
  12453. "properties": {
  12454. "consoleManagedProviders": {
  12455. "type": "array",
  12456. "items": {
  12457. "type": "string"
  12458. }
  12459. },
  12460. "activeOrgName": {
  12461. "type": "string"
  12462. },
  12463. "switchableOrgCount": {
  12464. "type": "integer",
  12465. "minimum": 0
  12466. }
  12467. },
  12468. "required": ["consoleManagedProviders", "switchableOrgCount"],
  12469. "additionalProperties": false
  12470. },
  12471. "ToolListItem": {
  12472. "type": "object",
  12473. "properties": {
  12474. "id": {
  12475. "type": "string"
  12476. },
  12477. "description": {
  12478. "type": "string"
  12479. },
  12480. "parameters": {}
  12481. },
  12482. "required": ["id", "description", "parameters"],
  12483. "additionalProperties": false
  12484. },
  12485. "ToolList": {
  12486. "type": "array",
  12487. "items": {
  12488. "$ref": "#/components/schemas/ToolListItem"
  12489. }
  12490. },
  12491. "ToolIDs": {
  12492. "type": "array",
  12493. "items": {
  12494. "type": "string"
  12495. }
  12496. },
  12497. "WorktreeCreateInput": {
  12498. "type": "object",
  12499. "properties": {
  12500. "name": {
  12501. "type": "string"
  12502. },
  12503. "startCommand": {
  12504. "type": "string",
  12505. "description": "Additional startup script to run after the project's start command"
  12506. }
  12507. },
  12508. "additionalProperties": false
  12509. },
  12510. "Worktree": {
  12511. "type": "object",
  12512. "properties": {
  12513. "name": {
  12514. "type": "string"
  12515. },
  12516. "branch": {
  12517. "type": "string"
  12518. },
  12519. "directory": {
  12520. "type": "string"
  12521. }
  12522. },
  12523. "required": ["name", "branch", "directory"],
  12524. "additionalProperties": false
  12525. },
  12526. "WorktreeRemoveInput": {
  12527. "type": "object",
  12528. "properties": {
  12529. "directory": {
  12530. "type": "string"
  12531. }
  12532. },
  12533. "required": ["directory"],
  12534. "additionalProperties": false
  12535. },
  12536. "WorktreeResetInput": {
  12537. "type": "object",
  12538. "properties": {
  12539. "directory": {
  12540. "type": "string"
  12541. }
  12542. },
  12543. "required": ["directory"],
  12544. "additionalProperties": false
  12545. },
  12546. "ProjectSummary": {
  12547. "type": "object",
  12548. "properties": {
  12549. "id": {
  12550. "type": "string"
  12551. },
  12552. "name": {
  12553. "type": "string"
  12554. },
  12555. "worktree": {
  12556. "type": "string"
  12557. }
  12558. },
  12559. "required": ["id", "worktree"],
  12560. "additionalProperties": false
  12561. },
  12562. "GlobalSession": {
  12563. "type": "object",
  12564. "properties": {
  12565. "id": {
  12566. "type": "string"
  12567. },
  12568. "slug": {
  12569. "type": "string"
  12570. },
  12571. "projectID": {
  12572. "type": "string"
  12573. },
  12574. "workspaceID": {
  12575. "type": "string"
  12576. },
  12577. "directory": {
  12578. "type": "string"
  12579. },
  12580. "path": {
  12581. "type": "string"
  12582. },
  12583. "parentID": {
  12584. "type": "string"
  12585. },
  12586. "summary": {
  12587. "type": "object",
  12588. "properties": {
  12589. "additions": {
  12590. "type": "integer",
  12591. "minimum": 0
  12592. },
  12593. "deletions": {
  12594. "type": "integer",
  12595. "minimum": 0
  12596. },
  12597. "files": {
  12598. "type": "integer",
  12599. "minimum": 0
  12600. },
  12601. "diffs": {
  12602. "type": "array",
  12603. "items": {
  12604. "$ref": "#/components/schemas/SnapshotFileDiff"
  12605. }
  12606. }
  12607. },
  12608. "required": ["additions", "deletions", "files"],
  12609. "additionalProperties": false
  12610. },
  12611. "share": {
  12612. "type": "object",
  12613. "properties": {
  12614. "url": {
  12615. "type": "string"
  12616. }
  12617. },
  12618. "required": ["url"],
  12619. "additionalProperties": false
  12620. },
  12621. "title": {
  12622. "type": "string"
  12623. },
  12624. "agent": {
  12625. "type": "string"
  12626. },
  12627. "model": {
  12628. "type": "object",
  12629. "properties": {
  12630. "id": {
  12631. "type": "string"
  12632. },
  12633. "providerID": {
  12634. "type": "string"
  12635. },
  12636. "variant": {
  12637. "type": "string"
  12638. }
  12639. },
  12640. "required": ["id", "providerID"],
  12641. "additionalProperties": false
  12642. },
  12643. "version": {
  12644. "type": "string"
  12645. },
  12646. "time": {
  12647. "type": "object",
  12648. "properties": {
  12649. "created": {
  12650. "type": "integer",
  12651. "minimum": 0
  12652. },
  12653. "updated": {
  12654. "type": "integer",
  12655. "minimum": 0
  12656. },
  12657. "compacting": {
  12658. "type": "integer",
  12659. "minimum": 0
  12660. },
  12661. "archived": {
  12662. "type": "number"
  12663. }
  12664. },
  12665. "required": ["created", "updated"],
  12666. "additionalProperties": false
  12667. },
  12668. "permission": {
  12669. "$ref": "#/components/schemas/PermissionRuleset"
  12670. },
  12671. "revert": {
  12672. "type": "object",
  12673. "properties": {
  12674. "messageID": {
  12675. "type": "string"
  12676. },
  12677. "partID": {
  12678. "type": "string"
  12679. },
  12680. "snapshot": {
  12681. "type": "string"
  12682. },
  12683. "diff": {
  12684. "type": "string"
  12685. }
  12686. },
  12687. "required": ["messageID"],
  12688. "additionalProperties": false
  12689. },
  12690. "project": {
  12691. "anyOf": [
  12692. {
  12693. "$ref": "#/components/schemas/ProjectSummary"
  12694. },
  12695. {
  12696. "type": "null"
  12697. }
  12698. ]
  12699. }
  12700. },
  12701. "required": ["id", "slug", "projectID", "directory", "title", "version", "time", "project"],
  12702. "additionalProperties": false
  12703. },
  12704. "McpResource": {
  12705. "type": "object",
  12706. "properties": {
  12707. "name": {
  12708. "type": "string"
  12709. },
  12710. "uri": {
  12711. "type": "string"
  12712. },
  12713. "description": {
  12714. "type": "string"
  12715. },
  12716. "mimeType": {
  12717. "type": "string"
  12718. },
  12719. "client": {
  12720. "type": "string"
  12721. }
  12722. },
  12723. "required": ["name", "uri", "client"],
  12724. "additionalProperties": false
  12725. },
  12726. "Symbol": {
  12727. "type": "object",
  12728. "properties": {
  12729. "name": {
  12730. "type": "string"
  12731. },
  12732. "kind": {
  12733. "type": "integer",
  12734. "minimum": 0
  12735. },
  12736. "location": {
  12737. "type": "object",
  12738. "properties": {
  12739. "uri": {
  12740. "type": "string"
  12741. },
  12742. "range": {
  12743. "$ref": "#/components/schemas/Range"
  12744. }
  12745. },
  12746. "required": ["uri", "range"],
  12747. "additionalProperties": false
  12748. }
  12749. },
  12750. "required": ["name", "kind", "location"],
  12751. "additionalProperties": false
  12752. },
  12753. "FileNode": {
  12754. "type": "object",
  12755. "properties": {
  12756. "name": {
  12757. "type": "string"
  12758. },
  12759. "path": {
  12760. "type": "string"
  12761. },
  12762. "absolute": {
  12763. "type": "string"
  12764. },
  12765. "type": {
  12766. "type": "string",
  12767. "enum": ["file", "directory"]
  12768. },
  12769. "ignored": {
  12770. "type": "boolean"
  12771. }
  12772. },
  12773. "required": ["name", "path", "absolute", "type", "ignored"],
  12774. "additionalProperties": false
  12775. },
  12776. "FileContent": {
  12777. "type": "object",
  12778. "properties": {
  12779. "type": {
  12780. "type": "string",
  12781. "enum": ["text", "binary"]
  12782. },
  12783. "content": {
  12784. "type": "string"
  12785. },
  12786. "diff": {
  12787. "type": "string"
  12788. },
  12789. "patch": {
  12790. "type": "object",
  12791. "properties": {
  12792. "oldFileName": {
  12793. "type": "string"
  12794. },
  12795. "newFileName": {
  12796. "type": "string"
  12797. },
  12798. "oldHeader": {
  12799. "type": "string"
  12800. },
  12801. "newHeader": {
  12802. "type": "string"
  12803. },
  12804. "hunks": {
  12805. "type": "array",
  12806. "items": {
  12807. "type": "object",
  12808. "properties": {
  12809. "oldStart": {
  12810. "type": "integer",
  12811. "minimum": 0
  12812. },
  12813. "oldLines": {
  12814. "type": "integer",
  12815. "minimum": 0
  12816. },
  12817. "newStart": {
  12818. "type": "integer",
  12819. "minimum": 0
  12820. },
  12821. "newLines": {
  12822. "type": "integer",
  12823. "minimum": 0
  12824. },
  12825. "lines": {
  12826. "type": "array",
  12827. "items": {
  12828. "type": "string"
  12829. }
  12830. }
  12831. },
  12832. "required": ["oldStart", "oldLines", "newStart", "newLines", "lines"],
  12833. "additionalProperties": false
  12834. }
  12835. },
  12836. "index": {
  12837. "type": "string"
  12838. }
  12839. },
  12840. "required": ["oldFileName", "newFileName", "hunks"],
  12841. "additionalProperties": false
  12842. },
  12843. "encoding": {
  12844. "type": "string",
  12845. "enum": ["base64"]
  12846. },
  12847. "mimeType": {
  12848. "type": "string"
  12849. }
  12850. },
  12851. "required": ["type", "content"],
  12852. "additionalProperties": false
  12853. },
  12854. "File": {
  12855. "type": "object",
  12856. "properties": {
  12857. "path": {
  12858. "type": "string"
  12859. },
  12860. "added": {
  12861. "type": "integer",
  12862. "minimum": 0
  12863. },
  12864. "removed": {
  12865. "type": "integer",
  12866. "minimum": 0
  12867. },
  12868. "status": {
  12869. "type": "string",
  12870. "enum": ["added", "deleted", "modified"]
  12871. }
  12872. },
  12873. "required": ["path", "added", "removed", "status"],
  12874. "additionalProperties": false
  12875. },
  12876. "Path": {
  12877. "type": "object",
  12878. "properties": {
  12879. "home": {
  12880. "type": "string"
  12881. },
  12882. "state": {
  12883. "type": "string"
  12884. },
  12885. "config": {
  12886. "type": "string"
  12887. },
  12888. "worktree": {
  12889. "type": "string"
  12890. },
  12891. "directory": {
  12892. "type": "string"
  12893. }
  12894. },
  12895. "required": ["home", "state", "config", "worktree", "directory"],
  12896. "additionalProperties": false
  12897. },
  12898. "VcsInfo": {
  12899. "type": "object",
  12900. "properties": {
  12901. "branch": {
  12902. "type": "string"
  12903. },
  12904. "default_branch": {
  12905. "type": "string"
  12906. }
  12907. },
  12908. "additionalProperties": false
  12909. },
  12910. "VcsFileStatus": {
  12911. "type": "object",
  12912. "properties": {
  12913. "file": {
  12914. "type": "string"
  12915. },
  12916. "additions": {
  12917. "type": "integer",
  12918. "minimum": 0
  12919. },
  12920. "deletions": {
  12921. "type": "integer",
  12922. "minimum": 0
  12923. },
  12924. "status": {
  12925. "type": "string",
  12926. "enum": ["added", "deleted", "modified"]
  12927. }
  12928. },
  12929. "required": ["file", "additions", "deletions", "status"],
  12930. "additionalProperties": false
  12931. },
  12932. "VcsFileDiff": {
  12933. "type": "object",
  12934. "properties": {
  12935. "file": {
  12936. "type": "string"
  12937. },
  12938. "patch": {
  12939. "type": "string"
  12940. },
  12941. "additions": {
  12942. "type": "integer",
  12943. "minimum": 0
  12944. },
  12945. "deletions": {
  12946. "type": "integer",
  12947. "minimum": 0
  12948. },
  12949. "status": {
  12950. "type": "string",
  12951. "enum": ["added", "deleted", "modified"]
  12952. }
  12953. },
  12954. "required": ["file", "patch", "additions", "deletions"],
  12955. "additionalProperties": false
  12956. },
  12957. "VcsApplyError": {
  12958. "type": "object",
  12959. "properties": {
  12960. "name": {
  12961. "type": "string",
  12962. "enum": ["VcsApplyError"]
  12963. },
  12964. "data": {
  12965. "type": "object",
  12966. "properties": {
  12967. "message": {
  12968. "type": "string"
  12969. },
  12970. "reason": {
  12971. "type": "string",
  12972. "enum": ["non-git", "not-clean"]
  12973. }
  12974. },
  12975. "required": ["message", "reason"],
  12976. "additionalProperties": false
  12977. }
  12978. },
  12979. "required": ["name", "data"],
  12980. "additionalProperties": false
  12981. },
  12982. "Command": {
  12983. "type": "object",
  12984. "properties": {
  12985. "name": {
  12986. "type": "string"
  12987. },
  12988. "description": {
  12989. "type": "string"
  12990. },
  12991. "agent": {
  12992. "type": "string"
  12993. },
  12994. "model": {
  12995. "type": "string"
  12996. },
  12997. "source": {
  12998. "type": "string",
  12999. "enum": ["command", "mcp", "skill"]
  13000. },
  13001. "template": {
  13002. "type": "string"
  13003. },
  13004. "subtask": {
  13005. "type": "boolean"
  13006. },
  13007. "hints": {
  13008. "type": "array",
  13009. "items": {
  13010. "type": "string"
  13011. }
  13012. }
  13013. },
  13014. "required": ["name", "template", "hints"],
  13015. "additionalProperties": false
  13016. },
  13017. "Agent": {
  13018. "type": "object",
  13019. "properties": {
  13020. "name": {
  13021. "type": "string"
  13022. },
  13023. "description": {
  13024. "type": "string"
  13025. },
  13026. "mode": {
  13027. "type": "string",
  13028. "enum": ["subagent", "primary", "all"]
  13029. },
  13030. "native": {
  13031. "type": "boolean"
  13032. },
  13033. "hidden": {
  13034. "type": "boolean"
  13035. },
  13036. "topP": {
  13037. "type": "number"
  13038. },
  13039. "temperature": {
  13040. "type": "number"
  13041. },
  13042. "color": {
  13043. "type": "string"
  13044. },
  13045. "permission": {
  13046. "$ref": "#/components/schemas/PermissionRuleset"
  13047. },
  13048. "model": {
  13049. "type": "object",
  13050. "properties": {
  13051. "modelID": {
  13052. "type": "string"
  13053. },
  13054. "providerID": {
  13055. "type": "string"
  13056. }
  13057. },
  13058. "required": ["modelID", "providerID"],
  13059. "additionalProperties": false
  13060. },
  13061. "variant": {
  13062. "type": "string"
  13063. },
  13064. "prompt": {
  13065. "type": "string"
  13066. },
  13067. "options": {
  13068. "type": "object"
  13069. },
  13070. "steps": {
  13071. "type": "number"
  13072. }
  13073. },
  13074. "required": ["name", "mode", "permission", "options"],
  13075. "additionalProperties": false
  13076. },
  13077. "LSPStatus": {
  13078. "type": "object",
  13079. "properties": {
  13080. "id": {
  13081. "type": "string"
  13082. },
  13083. "name": {
  13084. "type": "string"
  13085. },
  13086. "root": {
  13087. "type": "string"
  13088. },
  13089. "status": {
  13090. "type": "string",
  13091. "enum": ["connected", "error"]
  13092. }
  13093. },
  13094. "required": ["id", "name", "root", "status"],
  13095. "additionalProperties": false
  13096. },
  13097. "FormatterStatus": {
  13098. "type": "object",
  13099. "properties": {
  13100. "name": {
  13101. "type": "string"
  13102. },
  13103. "extensions": {
  13104. "type": "array",
  13105. "items": {
  13106. "type": "string"
  13107. }
  13108. },
  13109. "enabled": {
  13110. "type": "boolean"
  13111. }
  13112. },
  13113. "required": ["name", "extensions", "enabled"],
  13114. "additionalProperties": false
  13115. },
  13116. "MCPStatusConnected": {
  13117. "type": "object",
  13118. "properties": {
  13119. "status": {
  13120. "type": "string",
  13121. "enum": ["connected"]
  13122. }
  13123. },
  13124. "required": ["status"],
  13125. "additionalProperties": false
  13126. },
  13127. "MCPStatusDisabled": {
  13128. "type": "object",
  13129. "properties": {
  13130. "status": {
  13131. "type": "string",
  13132. "enum": ["disabled"]
  13133. }
  13134. },
  13135. "required": ["status"],
  13136. "additionalProperties": false
  13137. },
  13138. "MCPStatusFailed": {
  13139. "type": "object",
  13140. "properties": {
  13141. "status": {
  13142. "type": "string",
  13143. "enum": ["failed"]
  13144. },
  13145. "error": {
  13146. "type": "string"
  13147. }
  13148. },
  13149. "required": ["status", "error"],
  13150. "additionalProperties": false
  13151. },
  13152. "MCPStatusNeedsAuth": {
  13153. "type": "object",
  13154. "properties": {
  13155. "status": {
  13156. "type": "string",
  13157. "enum": ["needs_auth"]
  13158. }
  13159. },
  13160. "required": ["status"],
  13161. "additionalProperties": false
  13162. },
  13163. "MCPStatusNeedsClientRegistration": {
  13164. "type": "object",
  13165. "properties": {
  13166. "status": {
  13167. "type": "string",
  13168. "enum": ["needs_client_registration"]
  13169. },
  13170. "error": {
  13171. "type": "string"
  13172. }
  13173. },
  13174. "required": ["status", "error"],
  13175. "additionalProperties": false
  13176. },
  13177. "MCPStatus": {
  13178. "anyOf": [
  13179. {
  13180. "$ref": "#/components/schemas/MCPStatusConnected"
  13181. },
  13182. {
  13183. "$ref": "#/components/schemas/MCPStatusDisabled"
  13184. },
  13185. {
  13186. "$ref": "#/components/schemas/MCPStatusFailed"
  13187. },
  13188. {
  13189. "$ref": "#/components/schemas/MCPStatusNeedsAuth"
  13190. },
  13191. {
  13192. "$ref": "#/components/schemas/MCPStatusNeedsClientRegistration"
  13193. }
  13194. ]
  13195. },
  13196. "McpUnsupportedOAuthError": {
  13197. "type": "object",
  13198. "properties": {
  13199. "error": {
  13200. "type": "string"
  13201. }
  13202. },
  13203. "required": ["error"],
  13204. "additionalProperties": false
  13205. },
  13206. "NotFoundError": {
  13207. "type": "object",
  13208. "required": ["name", "data"],
  13209. "properties": {
  13210. "name": {
  13211. "type": "string",
  13212. "enum": ["NotFoundError"]
  13213. },
  13214. "data": {
  13215. "type": "object",
  13216. "required": ["message"],
  13217. "properties": {
  13218. "message": {
  13219. "type": "string"
  13220. }
  13221. }
  13222. }
  13223. }
  13224. },
  13225. "effect_HttpApiError_Forbidden": {
  13226. "type": "object",
  13227. "properties": {
  13228. "_tag": {
  13229. "type": "string",
  13230. "enum": ["Forbidden"]
  13231. }
  13232. },
  13233. "required": ["_tag"],
  13234. "additionalProperties": false
  13235. },
  13236. "ProviderAuthMethod": {
  13237. "type": "object",
  13238. "properties": {
  13239. "type": {
  13240. "type": "string",
  13241. "enum": ["oauth", "api"]
  13242. },
  13243. "label": {
  13244. "type": "string"
  13245. },
  13246. "prompts": {
  13247. "type": "array",
  13248. "items": {
  13249. "anyOf": [
  13250. {
  13251. "type": "object",
  13252. "properties": {
  13253. "type": {
  13254. "type": "string",
  13255. "enum": ["text"]
  13256. },
  13257. "key": {
  13258. "type": "string"
  13259. },
  13260. "message": {
  13261. "type": "string"
  13262. },
  13263. "placeholder": {
  13264. "type": "string"
  13265. },
  13266. "when": {
  13267. "type": "object",
  13268. "properties": {
  13269. "key": {
  13270. "type": "string"
  13271. },
  13272. "op": {
  13273. "type": "string",
  13274. "enum": ["eq", "neq"]
  13275. },
  13276. "value": {
  13277. "type": "string"
  13278. }
  13279. },
  13280. "required": ["key", "op", "value"],
  13281. "additionalProperties": false
  13282. }
  13283. },
  13284. "required": ["type", "key", "message"],
  13285. "additionalProperties": false
  13286. },
  13287. {
  13288. "type": "object",
  13289. "properties": {
  13290. "type": {
  13291. "type": "string",
  13292. "enum": ["select"]
  13293. },
  13294. "key": {
  13295. "type": "string"
  13296. },
  13297. "message": {
  13298. "type": "string"
  13299. },
  13300. "options": {
  13301. "type": "array",
  13302. "items": {
  13303. "type": "object",
  13304. "properties": {
  13305. "label": {
  13306. "type": "string"
  13307. },
  13308. "value": {
  13309. "type": "string"
  13310. },
  13311. "hint": {
  13312. "type": "string"
  13313. }
  13314. },
  13315. "required": ["label", "value"],
  13316. "additionalProperties": false
  13317. }
  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", "options"],
  13338. "additionalProperties": false
  13339. }
  13340. ]
  13341. }
  13342. }
  13343. },
  13344. "required": ["type", "label"],
  13345. "additionalProperties": false
  13346. },
  13347. "ProviderAuthAuthorization": {
  13348. "type": "object",
  13349. "properties": {
  13350. "url": {
  13351. "type": "string"
  13352. },
  13353. "method": {
  13354. "type": "string",
  13355. "enum": ["auto", "code"]
  13356. },
  13357. "instructions": {
  13358. "type": "string"
  13359. }
  13360. },
  13361. "required": ["url", "method", "instructions"],
  13362. "additionalProperties": false
  13363. },
  13364. "TextPartInput": {
  13365. "type": "object",
  13366. "properties": {
  13367. "id": {
  13368. "type": "string"
  13369. },
  13370. "type": {
  13371. "type": "string",
  13372. "enum": ["text"]
  13373. },
  13374. "text": {
  13375. "type": "string"
  13376. },
  13377. "synthetic": {
  13378. "type": "boolean"
  13379. },
  13380. "ignored": {
  13381. "type": "boolean"
  13382. },
  13383. "time": {
  13384. "type": "object",
  13385. "properties": {
  13386. "start": {
  13387. "type": "integer",
  13388. "minimum": 0
  13389. },
  13390. "end": {
  13391. "type": "integer",
  13392. "minimum": 0
  13393. }
  13394. },
  13395. "required": ["start"],
  13396. "additionalProperties": false
  13397. },
  13398. "metadata": {
  13399. "type": "object"
  13400. }
  13401. },
  13402. "required": ["type", "text"],
  13403. "additionalProperties": false
  13404. },
  13405. "FilePartInput": {
  13406. "type": "object",
  13407. "properties": {
  13408. "id": {
  13409. "type": "string"
  13410. },
  13411. "type": {
  13412. "type": "string",
  13413. "enum": ["file"]
  13414. },
  13415. "mime": {
  13416. "type": "string"
  13417. },
  13418. "filename": {
  13419. "type": "string"
  13420. },
  13421. "url": {
  13422. "type": "string"
  13423. },
  13424. "source": {
  13425. "$ref": "#/components/schemas/FilePartSource"
  13426. }
  13427. },
  13428. "required": ["type", "mime", "url"],
  13429. "additionalProperties": false
  13430. },
  13431. "AgentPartInput": {
  13432. "type": "object",
  13433. "properties": {
  13434. "id": {
  13435. "type": "string"
  13436. },
  13437. "type": {
  13438. "type": "string",
  13439. "enum": ["agent"]
  13440. },
  13441. "name": {
  13442. "type": "string"
  13443. },
  13444. "source": {
  13445. "type": "object",
  13446. "properties": {
  13447. "value": {
  13448. "type": "string"
  13449. },
  13450. "start": {
  13451. "type": "integer",
  13452. "minimum": 0
  13453. },
  13454. "end": {
  13455. "type": "integer",
  13456. "minimum": 0
  13457. }
  13458. },
  13459. "required": ["value", "start", "end"],
  13460. "additionalProperties": false
  13461. }
  13462. },
  13463. "required": ["type", "name"],
  13464. "additionalProperties": false
  13465. },
  13466. "SubtaskPartInput": {
  13467. "type": "object",
  13468. "properties": {
  13469. "id": {
  13470. "type": "string"
  13471. },
  13472. "type": {
  13473. "type": "string",
  13474. "enum": ["subtask"]
  13475. },
  13476. "prompt": {
  13477. "type": "string"
  13478. },
  13479. "description": {
  13480. "type": "string"
  13481. },
  13482. "agent": {
  13483. "type": "string"
  13484. },
  13485. "model": {
  13486. "type": "object",
  13487. "properties": {
  13488. "providerID": {
  13489. "type": "string"
  13490. },
  13491. "modelID": {
  13492. "type": "string"
  13493. }
  13494. },
  13495. "required": ["providerID", "modelID"],
  13496. "additionalProperties": false
  13497. },
  13498. "command": {
  13499. "type": "string"
  13500. }
  13501. },
  13502. "required": ["type", "prompt", "description", "agent"],
  13503. "additionalProperties": false
  13504. },
  13505. "V2SessionsResponse": {
  13506. "type": "object",
  13507. "properties": {
  13508. "items": {
  13509. "type": "array",
  13510. "items": {
  13511. "$ref": "#/components/schemas/SessionInfo"
  13512. }
  13513. },
  13514. "cursor": {
  13515. "type": "object",
  13516. "properties": {
  13517. "previous": {
  13518. "type": "string"
  13519. },
  13520. "next": {
  13521. "type": "string"
  13522. }
  13523. },
  13524. "additionalProperties": false
  13525. }
  13526. },
  13527. "required": ["items", "cursor"],
  13528. "additionalProperties": false
  13529. },
  13530. "V2SessionMessagesResponse": {
  13531. "type": "object",
  13532. "properties": {
  13533. "items": {
  13534. "type": "array",
  13535. "items": {
  13536. "$ref": "#/components/schemas/SessionMessage"
  13537. }
  13538. },
  13539. "cursor": {
  13540. "type": "object",
  13541. "properties": {
  13542. "previous": {
  13543. "type": "string"
  13544. },
  13545. "next": {
  13546. "type": "string"
  13547. }
  13548. },
  13549. "additionalProperties": false
  13550. }
  13551. },
  13552. "required": ["items", "cursor"],
  13553. "additionalProperties": false
  13554. },
  13555. "EventTuiPromptAppend": {
  13556. "type": "object",
  13557. "properties": {
  13558. "type": {
  13559. "type": "string",
  13560. "enum": ["tui.prompt.append"]
  13561. },
  13562. "properties": {
  13563. "type": "object",
  13564. "properties": {
  13565. "text": {
  13566. "type": "string"
  13567. }
  13568. },
  13569. "required": ["text"],
  13570. "additionalProperties": false
  13571. }
  13572. },
  13573. "required": ["type", "properties"],
  13574. "additionalProperties": false
  13575. },
  13576. "EventTuiCommandExecute": {
  13577. "type": "object",
  13578. "properties": {
  13579. "type": {
  13580. "type": "string",
  13581. "enum": ["tui.command.execute"]
  13582. },
  13583. "properties": {
  13584. "type": "object",
  13585. "properties": {
  13586. "command": {
  13587. "anyOf": [
  13588. {
  13589. "type": "string",
  13590. "enum": [
  13591. "session.list",
  13592. "session.new",
  13593. "session.share",
  13594. "session.interrupt",
  13595. "session.compact",
  13596. "session.page.up",
  13597. "session.page.down",
  13598. "session.line.up",
  13599. "session.line.down",
  13600. "session.half.page.up",
  13601. "session.half.page.down",
  13602. "session.first",
  13603. "session.last",
  13604. "prompt.clear",
  13605. "prompt.submit",
  13606. "agent.cycle"
  13607. ]
  13608. },
  13609. {
  13610. "type": "string"
  13611. }
  13612. ]
  13613. }
  13614. },
  13615. "required": ["command"],
  13616. "additionalProperties": false
  13617. }
  13618. },
  13619. "required": ["type", "properties"],
  13620. "additionalProperties": false
  13621. },
  13622. "EventTuiToastShow": {
  13623. "type": "object",
  13624. "properties": {
  13625. "type": {
  13626. "type": "string",
  13627. "enum": ["tui.toast.show"]
  13628. },
  13629. "properties": {
  13630. "type": "object",
  13631. "properties": {
  13632. "title": {
  13633. "type": "string"
  13634. },
  13635. "message": {
  13636. "type": "string"
  13637. },
  13638. "variant": {
  13639. "type": "string",
  13640. "enum": ["info", "success", "warning", "error"]
  13641. },
  13642. "duration": {
  13643. "type": "integer",
  13644. "exclusiveMinimum": 0
  13645. }
  13646. },
  13647. "required": ["message", "variant"],
  13648. "additionalProperties": false
  13649. }
  13650. },
  13651. "required": ["type", "properties"],
  13652. "additionalProperties": false
  13653. },
  13654. "EventTuiSessionSelect": {
  13655. "type": "object",
  13656. "properties": {
  13657. "type": {
  13658. "type": "string",
  13659. "enum": ["tui.session.select"]
  13660. },
  13661. "properties": {
  13662. "type": "object",
  13663. "properties": {
  13664. "sessionID": {
  13665. "type": "string",
  13666. "description": "Session ID to navigate to"
  13667. }
  13668. },
  13669. "required": ["sessionID"],
  13670. "additionalProperties": false
  13671. }
  13672. },
  13673. "required": ["type", "properties"],
  13674. "additionalProperties": false
  13675. },
  13676. "Workspace": {
  13677. "type": "object",
  13678. "properties": {
  13679. "id": {
  13680. "type": "string"
  13681. },
  13682. "type": {
  13683. "type": "string"
  13684. },
  13685. "name": {
  13686. "type": "string"
  13687. },
  13688. "branch": {
  13689. "anyOf": [
  13690. {
  13691. "type": "string"
  13692. },
  13693. {
  13694. "type": "null"
  13695. }
  13696. ]
  13697. },
  13698. "directory": {
  13699. "anyOf": [
  13700. {
  13701. "type": "string"
  13702. },
  13703. {
  13704. "type": "null"
  13705. }
  13706. ]
  13707. },
  13708. "extra": {
  13709. "anyOf": [
  13710. {},
  13711. {
  13712. "type": "null"
  13713. }
  13714. ]
  13715. },
  13716. "projectID": {
  13717. "type": "string"
  13718. },
  13719. "timeUsed": {
  13720. "anyOf": [
  13721. {
  13722. "type": "number"
  13723. },
  13724. {
  13725. "type": "string",
  13726. "enum": ["NaN"]
  13727. },
  13728. {
  13729. "type": "string",
  13730. "enum": ["Infinity"]
  13731. },
  13732. {
  13733. "type": "string",
  13734. "enum": ["-Infinity"]
  13735. },
  13736. {
  13737. "type": "string",
  13738. "enum": ["Infinity", "-Infinity", "NaN"]
  13739. }
  13740. ]
  13741. }
  13742. },
  13743. "required": ["id", "type", "name", "branch", "directory", "extra", "projectID", "timeUsed"],
  13744. "additionalProperties": false
  13745. },
  13746. "WorkspaceWarpError": {
  13747. "type": "object",
  13748. "properties": {
  13749. "name": {
  13750. "type": "string",
  13751. "enum": ["WorkspaceWarpError"]
  13752. },
  13753. "data": {
  13754. "type": "object",
  13755. "properties": {
  13756. "message": {
  13757. "type": "string"
  13758. }
  13759. },
  13760. "required": ["message"],
  13761. "additionalProperties": false
  13762. }
  13763. },
  13764. "required": ["name", "data"],
  13765. "additionalProperties": false
  13766. },
  13767. "SyncEventMessageUpdated": {
  13768. "type": "object",
  13769. "properties": {
  13770. "type": {
  13771. "type": "string",
  13772. "enum": ["sync"]
  13773. },
  13774. "name": {
  13775. "type": "string",
  13776. "enum": ["message.updated.1"]
  13777. },
  13778. "id": {
  13779. "type": "string"
  13780. },
  13781. "seq": {
  13782. "type": "number"
  13783. },
  13784. "aggregateID": {
  13785. "type": "string",
  13786. "enum": ["sessionID"]
  13787. },
  13788. "data": {
  13789. "type": "object",
  13790. "properties": {
  13791. "sessionID": {
  13792. "type": "string"
  13793. },
  13794. "info": {
  13795. "$ref": "#/components/schemas/Message"
  13796. }
  13797. },
  13798. "required": ["sessionID", "info"],
  13799. "additionalProperties": false
  13800. }
  13801. },
  13802. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  13803. "additionalProperties": false
  13804. },
  13805. "SyncEventMessageRemoved": {
  13806. "type": "object",
  13807. "properties": {
  13808. "type": {
  13809. "type": "string",
  13810. "enum": ["sync"]
  13811. },
  13812. "name": {
  13813. "type": "string",
  13814. "enum": ["message.removed.1"]
  13815. },
  13816. "id": {
  13817. "type": "string"
  13818. },
  13819. "seq": {
  13820. "type": "number"
  13821. },
  13822. "aggregateID": {
  13823. "type": "string",
  13824. "enum": ["sessionID"]
  13825. },
  13826. "data": {
  13827. "type": "object",
  13828. "properties": {
  13829. "sessionID": {
  13830. "type": "string"
  13831. },
  13832. "messageID": {
  13833. "type": "string"
  13834. }
  13835. },
  13836. "required": ["sessionID", "messageID"],
  13837. "additionalProperties": false
  13838. }
  13839. },
  13840. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  13841. "additionalProperties": false
  13842. },
  13843. "SyncEventMessagePartUpdated": {
  13844. "type": "object",
  13845. "properties": {
  13846. "type": {
  13847. "type": "string",
  13848. "enum": ["sync"]
  13849. },
  13850. "name": {
  13851. "type": "string",
  13852. "enum": ["message.part.updated.1"]
  13853. },
  13854. "id": {
  13855. "type": "string"
  13856. },
  13857. "seq": {
  13858. "type": "number"
  13859. },
  13860. "aggregateID": {
  13861. "type": "string",
  13862. "enum": ["sessionID"]
  13863. },
  13864. "data": {
  13865. "type": "object",
  13866. "properties": {
  13867. "sessionID": {
  13868. "type": "string"
  13869. },
  13870. "part": {
  13871. "$ref": "#/components/schemas/Part"
  13872. },
  13873. "time": {
  13874. "type": "integer",
  13875. "minimum": 0
  13876. }
  13877. },
  13878. "required": ["sessionID", "part", "time"],
  13879. "additionalProperties": false
  13880. }
  13881. },
  13882. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  13883. "additionalProperties": false
  13884. },
  13885. "SyncEventMessagePartRemoved": {
  13886. "type": "object",
  13887. "properties": {
  13888. "type": {
  13889. "type": "string",
  13890. "enum": ["sync"]
  13891. },
  13892. "name": {
  13893. "type": "string",
  13894. "enum": ["message.part.removed.1"]
  13895. },
  13896. "id": {
  13897. "type": "string"
  13898. },
  13899. "seq": {
  13900. "type": "number"
  13901. },
  13902. "aggregateID": {
  13903. "type": "string",
  13904. "enum": ["sessionID"]
  13905. },
  13906. "data": {
  13907. "type": "object",
  13908. "properties": {
  13909. "sessionID": {
  13910. "type": "string"
  13911. },
  13912. "messageID": {
  13913. "type": "string"
  13914. },
  13915. "partID": {
  13916. "type": "string"
  13917. }
  13918. },
  13919. "required": ["sessionID", "messageID", "partID"],
  13920. "additionalProperties": false
  13921. }
  13922. },
  13923. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  13924. "additionalProperties": false
  13925. },
  13926. "SyncEventSessionCreated": {
  13927. "type": "object",
  13928. "properties": {
  13929. "type": {
  13930. "type": "string",
  13931. "enum": ["sync"]
  13932. },
  13933. "name": {
  13934. "type": "string",
  13935. "enum": ["session.created.1"]
  13936. },
  13937. "id": {
  13938. "type": "string"
  13939. },
  13940. "seq": {
  13941. "type": "number"
  13942. },
  13943. "aggregateID": {
  13944. "type": "string",
  13945. "enum": ["sessionID"]
  13946. },
  13947. "data": {
  13948. "type": "object",
  13949. "properties": {
  13950. "sessionID": {
  13951. "type": "string"
  13952. },
  13953. "info": {
  13954. "$ref": "#/components/schemas/Session"
  13955. }
  13956. },
  13957. "required": ["sessionID", "info"],
  13958. "additionalProperties": false
  13959. }
  13960. },
  13961. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  13962. "additionalProperties": false
  13963. },
  13964. "SyncEventSessionUpdated": {
  13965. "type": "object",
  13966. "properties": {
  13967. "type": {
  13968. "type": "string",
  13969. "enum": ["sync"]
  13970. },
  13971. "name": {
  13972. "type": "string",
  13973. "enum": ["session.updated.1"]
  13974. },
  13975. "id": {
  13976. "type": "string"
  13977. },
  13978. "seq": {
  13979. "type": "number"
  13980. },
  13981. "aggregateID": {
  13982. "type": "string",
  13983. "enum": ["sessionID"]
  13984. },
  13985. "data": {
  13986. "type": "object",
  13987. "properties": {
  13988. "sessionID": {
  13989. "type": "string"
  13990. },
  13991. "info": {
  13992. "type": "object",
  13993. "properties": {
  13994. "id": {
  13995. "anyOf": [
  13996. {
  13997. "type": "string"
  13998. },
  13999. {
  14000. "type": "null"
  14001. }
  14002. ]
  14003. },
  14004. "slug": {
  14005. "anyOf": [
  14006. {
  14007. "type": "string"
  14008. },
  14009. {
  14010. "type": "null"
  14011. }
  14012. ]
  14013. },
  14014. "projectID": {
  14015. "anyOf": [
  14016. {
  14017. "type": "string"
  14018. },
  14019. {
  14020. "type": "null"
  14021. }
  14022. ]
  14023. },
  14024. "workspaceID": {
  14025. "anyOf": [
  14026. {
  14027. "type": "string"
  14028. },
  14029. {
  14030. "type": "null"
  14031. }
  14032. ]
  14033. },
  14034. "directory": {
  14035. "anyOf": [
  14036. {
  14037. "type": "string"
  14038. },
  14039. {
  14040. "type": "null"
  14041. }
  14042. ]
  14043. },
  14044. "path": {
  14045. "anyOf": [
  14046. {
  14047. "type": "string"
  14048. },
  14049. {
  14050. "type": "null"
  14051. }
  14052. ]
  14053. },
  14054. "parentID": {
  14055. "anyOf": [
  14056. {
  14057. "type": "string"
  14058. },
  14059. {
  14060. "type": "null"
  14061. }
  14062. ]
  14063. },
  14064. "summary": {
  14065. "anyOf": [
  14066. {
  14067. "type": "object",
  14068. "properties": {
  14069. "additions": {
  14070. "type": "integer",
  14071. "minimum": 0
  14072. },
  14073. "deletions": {
  14074. "type": "integer",
  14075. "minimum": 0
  14076. },
  14077. "files": {
  14078. "type": "integer",
  14079. "minimum": 0
  14080. },
  14081. "diffs": {
  14082. "type": "array",
  14083. "items": {
  14084. "$ref": "#/components/schemas/SnapshotFileDiff"
  14085. }
  14086. }
  14087. },
  14088. "required": ["additions", "deletions", "files"],
  14089. "additionalProperties": false
  14090. },
  14091. {
  14092. "type": "null"
  14093. }
  14094. ]
  14095. },
  14096. "share": {
  14097. "type": "object",
  14098. "properties": {
  14099. "url": {
  14100. "anyOf": [
  14101. {
  14102. "type": "string"
  14103. },
  14104. {
  14105. "type": "null"
  14106. }
  14107. ]
  14108. }
  14109. },
  14110. "additionalProperties": false
  14111. },
  14112. "title": {
  14113. "anyOf": [
  14114. {
  14115. "type": "string"
  14116. },
  14117. {
  14118. "type": "null"
  14119. }
  14120. ]
  14121. },
  14122. "agent": {
  14123. "anyOf": [
  14124. {
  14125. "type": "string"
  14126. },
  14127. {
  14128. "type": "null"
  14129. }
  14130. ]
  14131. },
  14132. "model": {
  14133. "anyOf": [
  14134. {
  14135. "type": "object",
  14136. "properties": {
  14137. "id": {
  14138. "type": "string"
  14139. },
  14140. "providerID": {
  14141. "type": "string"
  14142. },
  14143. "variant": {
  14144. "type": "string"
  14145. }
  14146. },
  14147. "required": ["id", "providerID"],
  14148. "additionalProperties": false
  14149. },
  14150. {
  14151. "type": "null"
  14152. }
  14153. ]
  14154. },
  14155. "version": {
  14156. "anyOf": [
  14157. {
  14158. "type": "string"
  14159. },
  14160. {
  14161. "type": "null"
  14162. }
  14163. ]
  14164. },
  14165. "time": {
  14166. "type": "object",
  14167. "properties": {
  14168. "created": {
  14169. "anyOf": [
  14170. {
  14171. "type": "integer",
  14172. "minimum": 0
  14173. },
  14174. {
  14175. "type": "null"
  14176. }
  14177. ]
  14178. },
  14179. "updated": {
  14180. "anyOf": [
  14181. {
  14182. "type": "integer",
  14183. "minimum": 0
  14184. },
  14185. {
  14186. "type": "null"
  14187. }
  14188. ]
  14189. },
  14190. "compacting": {
  14191. "anyOf": [
  14192. {
  14193. "type": "integer",
  14194. "minimum": 0
  14195. },
  14196. {
  14197. "type": "null"
  14198. }
  14199. ]
  14200. },
  14201. "archived": {
  14202. "anyOf": [
  14203. {
  14204. "type": "number"
  14205. },
  14206. {
  14207. "type": "null"
  14208. }
  14209. ]
  14210. }
  14211. },
  14212. "additionalProperties": false
  14213. },
  14214. "permission": {
  14215. "anyOf": [
  14216. {
  14217. "$ref": "#/components/schemas/PermissionRuleset"
  14218. },
  14219. {
  14220. "type": "null"
  14221. }
  14222. ]
  14223. },
  14224. "revert": {
  14225. "anyOf": [
  14226. {
  14227. "type": "object",
  14228. "properties": {
  14229. "messageID": {
  14230. "type": "string"
  14231. },
  14232. "partID": {
  14233. "type": "string"
  14234. },
  14235. "snapshot": {
  14236. "type": "string"
  14237. },
  14238. "diff": {
  14239. "type": "string"
  14240. }
  14241. },
  14242. "required": ["messageID"],
  14243. "additionalProperties": false
  14244. },
  14245. {
  14246. "type": "null"
  14247. }
  14248. ]
  14249. }
  14250. },
  14251. "additionalProperties": false
  14252. }
  14253. },
  14254. "required": ["sessionID", "info"],
  14255. "additionalProperties": false
  14256. }
  14257. },
  14258. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14259. "additionalProperties": false
  14260. },
  14261. "SyncEventSessionDeleted": {
  14262. "type": "object",
  14263. "properties": {
  14264. "type": {
  14265. "type": "string",
  14266. "enum": ["sync"]
  14267. },
  14268. "name": {
  14269. "type": "string",
  14270. "enum": ["session.deleted.1"]
  14271. },
  14272. "id": {
  14273. "type": "string"
  14274. },
  14275. "seq": {
  14276. "type": "number"
  14277. },
  14278. "aggregateID": {
  14279. "type": "string",
  14280. "enum": ["sessionID"]
  14281. },
  14282. "data": {
  14283. "type": "object",
  14284. "properties": {
  14285. "sessionID": {
  14286. "type": "string"
  14287. },
  14288. "info": {
  14289. "$ref": "#/components/schemas/Session"
  14290. }
  14291. },
  14292. "required": ["sessionID", "info"],
  14293. "additionalProperties": false
  14294. }
  14295. },
  14296. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14297. "additionalProperties": false
  14298. },
  14299. "SyncEventSessionNextAgentSwitched": {
  14300. "type": "object",
  14301. "properties": {
  14302. "type": {
  14303. "type": "string",
  14304. "enum": ["sync"]
  14305. },
  14306. "name": {
  14307. "type": "string",
  14308. "enum": ["session.next.agent.switched.1"]
  14309. },
  14310. "id": {
  14311. "type": "string"
  14312. },
  14313. "seq": {
  14314. "type": "number"
  14315. },
  14316. "aggregateID": {
  14317. "type": "string",
  14318. "enum": ["sessionID"]
  14319. },
  14320. "data": {
  14321. "type": "object",
  14322. "properties": {
  14323. "timestamp": {
  14324. "type": "number"
  14325. },
  14326. "sessionID": {
  14327. "type": "string"
  14328. },
  14329. "agent": {
  14330. "type": "string"
  14331. }
  14332. },
  14333. "required": ["timestamp", "sessionID", "agent"],
  14334. "additionalProperties": false
  14335. }
  14336. },
  14337. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14338. "additionalProperties": false
  14339. },
  14340. "SyncEventSessionNextModelSwitched": {
  14341. "type": "object",
  14342. "properties": {
  14343. "type": {
  14344. "type": "string",
  14345. "enum": ["sync"]
  14346. },
  14347. "name": {
  14348. "type": "string",
  14349. "enum": ["session.next.model.switched.1"]
  14350. },
  14351. "id": {
  14352. "type": "string"
  14353. },
  14354. "seq": {
  14355. "type": "number"
  14356. },
  14357. "aggregateID": {
  14358. "type": "string",
  14359. "enum": ["sessionID"]
  14360. },
  14361. "data": {
  14362. "type": "object",
  14363. "properties": {
  14364. "timestamp": {
  14365. "type": "number"
  14366. },
  14367. "sessionID": {
  14368. "type": "string"
  14369. },
  14370. "model": {
  14371. "type": "object",
  14372. "properties": {
  14373. "id": {
  14374. "type": "string"
  14375. },
  14376. "providerID": {
  14377. "type": "string"
  14378. },
  14379. "variant": {
  14380. "type": "string"
  14381. }
  14382. },
  14383. "required": ["id", "providerID", "variant"],
  14384. "additionalProperties": false
  14385. }
  14386. },
  14387. "required": ["timestamp", "sessionID", "model"],
  14388. "additionalProperties": false
  14389. }
  14390. },
  14391. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14392. "additionalProperties": false
  14393. },
  14394. "SyncEventSessionNextPrompted": {
  14395. "type": "object",
  14396. "properties": {
  14397. "type": {
  14398. "type": "string",
  14399. "enum": ["sync"]
  14400. },
  14401. "name": {
  14402. "type": "string",
  14403. "enum": ["session.next.prompted.1"]
  14404. },
  14405. "id": {
  14406. "type": "string"
  14407. },
  14408. "seq": {
  14409. "type": "number"
  14410. },
  14411. "aggregateID": {
  14412. "type": "string",
  14413. "enum": ["sessionID"]
  14414. },
  14415. "data": {
  14416. "type": "object",
  14417. "properties": {
  14418. "timestamp": {
  14419. "type": "number"
  14420. },
  14421. "sessionID": {
  14422. "type": "string"
  14423. },
  14424. "prompt": {
  14425. "$ref": "#/components/schemas/Prompt"
  14426. }
  14427. },
  14428. "required": ["timestamp", "sessionID", "prompt"],
  14429. "additionalProperties": false
  14430. }
  14431. },
  14432. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14433. "additionalProperties": false
  14434. },
  14435. "SyncEventSessionNextSynthetic": {
  14436. "type": "object",
  14437. "properties": {
  14438. "type": {
  14439. "type": "string",
  14440. "enum": ["sync"]
  14441. },
  14442. "name": {
  14443. "type": "string",
  14444. "enum": ["session.next.synthetic.1"]
  14445. },
  14446. "id": {
  14447. "type": "string"
  14448. },
  14449. "seq": {
  14450. "type": "number"
  14451. },
  14452. "aggregateID": {
  14453. "type": "string",
  14454. "enum": ["sessionID"]
  14455. },
  14456. "data": {
  14457. "type": "object",
  14458. "properties": {
  14459. "timestamp": {
  14460. "type": "number"
  14461. },
  14462. "sessionID": {
  14463. "type": "string"
  14464. },
  14465. "text": {
  14466. "type": "string"
  14467. }
  14468. },
  14469. "required": ["timestamp", "sessionID", "text"],
  14470. "additionalProperties": false
  14471. }
  14472. },
  14473. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14474. "additionalProperties": false
  14475. },
  14476. "SyncEventSessionNextShellStarted": {
  14477. "type": "object",
  14478. "properties": {
  14479. "type": {
  14480. "type": "string",
  14481. "enum": ["sync"]
  14482. },
  14483. "name": {
  14484. "type": "string",
  14485. "enum": ["session.next.shell.started.1"]
  14486. },
  14487. "id": {
  14488. "type": "string"
  14489. },
  14490. "seq": {
  14491. "type": "number"
  14492. },
  14493. "aggregateID": {
  14494. "type": "string",
  14495. "enum": ["sessionID"]
  14496. },
  14497. "data": {
  14498. "type": "object",
  14499. "properties": {
  14500. "timestamp": {
  14501. "type": "number"
  14502. },
  14503. "sessionID": {
  14504. "type": "string"
  14505. },
  14506. "callID": {
  14507. "type": "string"
  14508. },
  14509. "command": {
  14510. "type": "string"
  14511. }
  14512. },
  14513. "required": ["timestamp", "sessionID", "callID", "command"],
  14514. "additionalProperties": false
  14515. }
  14516. },
  14517. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14518. "additionalProperties": false
  14519. },
  14520. "SyncEventSessionNextShellEnded": {
  14521. "type": "object",
  14522. "properties": {
  14523. "type": {
  14524. "type": "string",
  14525. "enum": ["sync"]
  14526. },
  14527. "name": {
  14528. "type": "string",
  14529. "enum": ["session.next.shell.ended.1"]
  14530. },
  14531. "id": {
  14532. "type": "string"
  14533. },
  14534. "seq": {
  14535. "type": "number"
  14536. },
  14537. "aggregateID": {
  14538. "type": "string",
  14539. "enum": ["sessionID"]
  14540. },
  14541. "data": {
  14542. "type": "object",
  14543. "properties": {
  14544. "timestamp": {
  14545. "type": "number"
  14546. },
  14547. "sessionID": {
  14548. "type": "string"
  14549. },
  14550. "callID": {
  14551. "type": "string"
  14552. },
  14553. "output": {
  14554. "type": "string"
  14555. }
  14556. },
  14557. "required": ["timestamp", "sessionID", "callID", "output"],
  14558. "additionalProperties": false
  14559. }
  14560. },
  14561. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14562. "additionalProperties": false
  14563. },
  14564. "SyncEventSessionNextStepStarted": {
  14565. "type": "object",
  14566. "properties": {
  14567. "type": {
  14568. "type": "string",
  14569. "enum": ["sync"]
  14570. },
  14571. "name": {
  14572. "type": "string",
  14573. "enum": ["session.next.step.started.1"]
  14574. },
  14575. "id": {
  14576. "type": "string"
  14577. },
  14578. "seq": {
  14579. "type": "number"
  14580. },
  14581. "aggregateID": {
  14582. "type": "string",
  14583. "enum": ["sessionID"]
  14584. },
  14585. "data": {
  14586. "type": "object",
  14587. "properties": {
  14588. "timestamp": {
  14589. "type": "number"
  14590. },
  14591. "sessionID": {
  14592. "type": "string"
  14593. },
  14594. "agent": {
  14595. "type": "string"
  14596. },
  14597. "model": {
  14598. "type": "object",
  14599. "properties": {
  14600. "id": {
  14601. "type": "string"
  14602. },
  14603. "providerID": {
  14604. "type": "string"
  14605. },
  14606. "variant": {
  14607. "type": "string"
  14608. }
  14609. },
  14610. "required": ["id", "providerID", "variant"],
  14611. "additionalProperties": false
  14612. },
  14613. "snapshot": {
  14614. "type": "string"
  14615. }
  14616. },
  14617. "required": ["timestamp", "sessionID", "agent", "model"],
  14618. "additionalProperties": false
  14619. }
  14620. },
  14621. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14622. "additionalProperties": false
  14623. },
  14624. "SyncEventSessionNextStepEnded": {
  14625. "type": "object",
  14626. "properties": {
  14627. "type": {
  14628. "type": "string",
  14629. "enum": ["sync"]
  14630. },
  14631. "name": {
  14632. "type": "string",
  14633. "enum": ["session.next.step.ended.1"]
  14634. },
  14635. "id": {
  14636. "type": "string"
  14637. },
  14638. "seq": {
  14639. "type": "number"
  14640. },
  14641. "aggregateID": {
  14642. "type": "string",
  14643. "enum": ["sessionID"]
  14644. },
  14645. "data": {
  14646. "type": "object",
  14647. "properties": {
  14648. "timestamp": {
  14649. "type": "number"
  14650. },
  14651. "sessionID": {
  14652. "type": "string"
  14653. },
  14654. "finish": {
  14655. "type": "string"
  14656. },
  14657. "cost": {
  14658. "type": "number"
  14659. },
  14660. "tokens": {
  14661. "type": "object",
  14662. "properties": {
  14663. "input": {
  14664. "type": "integer",
  14665. "minimum": 0
  14666. },
  14667. "output": {
  14668. "type": "integer",
  14669. "minimum": 0
  14670. },
  14671. "reasoning": {
  14672. "type": "integer",
  14673. "minimum": 0
  14674. },
  14675. "cache": {
  14676. "type": "object",
  14677. "properties": {
  14678. "read": {
  14679. "type": "integer",
  14680. "minimum": 0
  14681. },
  14682. "write": {
  14683. "type": "integer",
  14684. "minimum": 0
  14685. }
  14686. },
  14687. "required": ["read", "write"],
  14688. "additionalProperties": false
  14689. }
  14690. },
  14691. "required": ["input", "output", "reasoning", "cache"],
  14692. "additionalProperties": false
  14693. },
  14694. "snapshot": {
  14695. "type": "string"
  14696. }
  14697. },
  14698. "required": ["timestamp", "sessionID", "finish", "cost", "tokens"],
  14699. "additionalProperties": false
  14700. }
  14701. },
  14702. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14703. "additionalProperties": false
  14704. },
  14705. "SyncEventSessionNextStepFailed": {
  14706. "type": "object",
  14707. "properties": {
  14708. "type": {
  14709. "type": "string",
  14710. "enum": ["sync"]
  14711. },
  14712. "name": {
  14713. "type": "string",
  14714. "enum": ["session.next.step.failed.1"]
  14715. },
  14716. "id": {
  14717. "type": "string"
  14718. },
  14719. "seq": {
  14720. "type": "number"
  14721. },
  14722. "aggregateID": {
  14723. "type": "string",
  14724. "enum": ["sessionID"]
  14725. },
  14726. "data": {
  14727. "type": "object",
  14728. "properties": {
  14729. "timestamp": {
  14730. "type": "number"
  14731. },
  14732. "sessionID": {
  14733. "type": "string"
  14734. },
  14735. "error": {
  14736. "$ref": "#/components/schemas/SessionErrorUnknown"
  14737. }
  14738. },
  14739. "required": ["timestamp", "sessionID", "error"],
  14740. "additionalProperties": false
  14741. }
  14742. },
  14743. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14744. "additionalProperties": false
  14745. },
  14746. "SyncEventSessionNextTextStarted": {
  14747. "type": "object",
  14748. "properties": {
  14749. "type": {
  14750. "type": "string",
  14751. "enum": ["sync"]
  14752. },
  14753. "name": {
  14754. "type": "string",
  14755. "enum": ["session.next.text.started.1"]
  14756. },
  14757. "id": {
  14758. "type": "string"
  14759. },
  14760. "seq": {
  14761. "type": "number"
  14762. },
  14763. "aggregateID": {
  14764. "type": "string",
  14765. "enum": ["sessionID"]
  14766. },
  14767. "data": {
  14768. "type": "object",
  14769. "properties": {
  14770. "timestamp": {
  14771. "type": "number"
  14772. },
  14773. "sessionID": {
  14774. "type": "string"
  14775. }
  14776. },
  14777. "required": ["timestamp", "sessionID"],
  14778. "additionalProperties": false
  14779. }
  14780. },
  14781. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14782. "additionalProperties": false
  14783. },
  14784. "SyncEventSessionNextTextDelta": {
  14785. "type": "object",
  14786. "properties": {
  14787. "type": {
  14788. "type": "string",
  14789. "enum": ["sync"]
  14790. },
  14791. "name": {
  14792. "type": "string",
  14793. "enum": ["session.next.text.delta.1"]
  14794. },
  14795. "id": {
  14796. "type": "string"
  14797. },
  14798. "seq": {
  14799. "type": "number"
  14800. },
  14801. "aggregateID": {
  14802. "type": "string",
  14803. "enum": ["sessionID"]
  14804. },
  14805. "data": {
  14806. "type": "object",
  14807. "properties": {
  14808. "timestamp": {
  14809. "type": "number"
  14810. },
  14811. "sessionID": {
  14812. "type": "string"
  14813. },
  14814. "delta": {
  14815. "type": "string"
  14816. }
  14817. },
  14818. "required": ["timestamp", "sessionID", "delta"],
  14819. "additionalProperties": false
  14820. }
  14821. },
  14822. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14823. "additionalProperties": false
  14824. },
  14825. "SyncEventSessionNextTextEnded": {
  14826. "type": "object",
  14827. "properties": {
  14828. "type": {
  14829. "type": "string",
  14830. "enum": ["sync"]
  14831. },
  14832. "name": {
  14833. "type": "string",
  14834. "enum": ["session.next.text.ended.1"]
  14835. },
  14836. "id": {
  14837. "type": "string"
  14838. },
  14839. "seq": {
  14840. "type": "number"
  14841. },
  14842. "aggregateID": {
  14843. "type": "string",
  14844. "enum": ["sessionID"]
  14845. },
  14846. "data": {
  14847. "type": "object",
  14848. "properties": {
  14849. "timestamp": {
  14850. "type": "number"
  14851. },
  14852. "sessionID": {
  14853. "type": "string"
  14854. },
  14855. "text": {
  14856. "type": "string"
  14857. }
  14858. },
  14859. "required": ["timestamp", "sessionID", "text"],
  14860. "additionalProperties": false
  14861. }
  14862. },
  14863. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14864. "additionalProperties": false
  14865. },
  14866. "SyncEventSessionNextReasoningStarted": {
  14867. "type": "object",
  14868. "properties": {
  14869. "type": {
  14870. "type": "string",
  14871. "enum": ["sync"]
  14872. },
  14873. "name": {
  14874. "type": "string",
  14875. "enum": ["session.next.reasoning.started.1"]
  14876. },
  14877. "id": {
  14878. "type": "string"
  14879. },
  14880. "seq": {
  14881. "type": "number"
  14882. },
  14883. "aggregateID": {
  14884. "type": "string",
  14885. "enum": ["sessionID"]
  14886. },
  14887. "data": {
  14888. "type": "object",
  14889. "properties": {
  14890. "timestamp": {
  14891. "type": "number"
  14892. },
  14893. "sessionID": {
  14894. "type": "string"
  14895. },
  14896. "reasoningID": {
  14897. "type": "string"
  14898. }
  14899. },
  14900. "required": ["timestamp", "sessionID", "reasoningID"],
  14901. "additionalProperties": false
  14902. }
  14903. },
  14904. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14905. "additionalProperties": false
  14906. },
  14907. "SyncEventSessionNextReasoningDelta": {
  14908. "type": "object",
  14909. "properties": {
  14910. "type": {
  14911. "type": "string",
  14912. "enum": ["sync"]
  14913. },
  14914. "name": {
  14915. "type": "string",
  14916. "enum": ["session.next.reasoning.delta.1"]
  14917. },
  14918. "id": {
  14919. "type": "string"
  14920. },
  14921. "seq": {
  14922. "type": "number"
  14923. },
  14924. "aggregateID": {
  14925. "type": "string",
  14926. "enum": ["sessionID"]
  14927. },
  14928. "data": {
  14929. "type": "object",
  14930. "properties": {
  14931. "timestamp": {
  14932. "type": "number"
  14933. },
  14934. "sessionID": {
  14935. "type": "string"
  14936. },
  14937. "reasoningID": {
  14938. "type": "string"
  14939. },
  14940. "delta": {
  14941. "type": "string"
  14942. }
  14943. },
  14944. "required": ["timestamp", "sessionID", "reasoningID", "delta"],
  14945. "additionalProperties": false
  14946. }
  14947. },
  14948. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14949. "additionalProperties": false
  14950. },
  14951. "SyncEventSessionNextReasoningEnded": {
  14952. "type": "object",
  14953. "properties": {
  14954. "type": {
  14955. "type": "string",
  14956. "enum": ["sync"]
  14957. },
  14958. "name": {
  14959. "type": "string",
  14960. "enum": ["session.next.reasoning.ended.1"]
  14961. },
  14962. "id": {
  14963. "type": "string"
  14964. },
  14965. "seq": {
  14966. "type": "number"
  14967. },
  14968. "aggregateID": {
  14969. "type": "string",
  14970. "enum": ["sessionID"]
  14971. },
  14972. "data": {
  14973. "type": "object",
  14974. "properties": {
  14975. "timestamp": {
  14976. "type": "number"
  14977. },
  14978. "sessionID": {
  14979. "type": "string"
  14980. },
  14981. "reasoningID": {
  14982. "type": "string"
  14983. },
  14984. "text": {
  14985. "type": "string"
  14986. }
  14987. },
  14988. "required": ["timestamp", "sessionID", "reasoningID", "text"],
  14989. "additionalProperties": false
  14990. }
  14991. },
  14992. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  14993. "additionalProperties": false
  14994. },
  14995. "SyncEventSessionNextToolInputStarted": {
  14996. "type": "object",
  14997. "properties": {
  14998. "type": {
  14999. "type": "string",
  15000. "enum": ["sync"]
  15001. },
  15002. "name": {
  15003. "type": "string",
  15004. "enum": ["session.next.tool.input.started.1"]
  15005. },
  15006. "id": {
  15007. "type": "string"
  15008. },
  15009. "seq": {
  15010. "type": "number"
  15011. },
  15012. "aggregateID": {
  15013. "type": "string",
  15014. "enum": ["sessionID"]
  15015. },
  15016. "data": {
  15017. "type": "object",
  15018. "properties": {
  15019. "timestamp": {
  15020. "type": "number"
  15021. },
  15022. "sessionID": {
  15023. "type": "string"
  15024. },
  15025. "callID": {
  15026. "type": "string"
  15027. },
  15028. "name": {
  15029. "type": "string"
  15030. }
  15031. },
  15032. "required": ["timestamp", "sessionID", "callID", "name"],
  15033. "additionalProperties": false
  15034. }
  15035. },
  15036. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15037. "additionalProperties": false
  15038. },
  15039. "SyncEventSessionNextToolInputDelta": {
  15040. "type": "object",
  15041. "properties": {
  15042. "type": {
  15043. "type": "string",
  15044. "enum": ["sync"]
  15045. },
  15046. "name": {
  15047. "type": "string",
  15048. "enum": ["session.next.tool.input.delta.1"]
  15049. },
  15050. "id": {
  15051. "type": "string"
  15052. },
  15053. "seq": {
  15054. "type": "number"
  15055. },
  15056. "aggregateID": {
  15057. "type": "string",
  15058. "enum": ["sessionID"]
  15059. },
  15060. "data": {
  15061. "type": "object",
  15062. "properties": {
  15063. "timestamp": {
  15064. "type": "number"
  15065. },
  15066. "sessionID": {
  15067. "type": "string"
  15068. },
  15069. "callID": {
  15070. "type": "string"
  15071. },
  15072. "delta": {
  15073. "type": "string"
  15074. }
  15075. },
  15076. "required": ["timestamp", "sessionID", "callID", "delta"],
  15077. "additionalProperties": false
  15078. }
  15079. },
  15080. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15081. "additionalProperties": false
  15082. },
  15083. "SyncEventSessionNextToolInputEnded": {
  15084. "type": "object",
  15085. "properties": {
  15086. "type": {
  15087. "type": "string",
  15088. "enum": ["sync"]
  15089. },
  15090. "name": {
  15091. "type": "string",
  15092. "enum": ["session.next.tool.input.ended.1"]
  15093. },
  15094. "id": {
  15095. "type": "string"
  15096. },
  15097. "seq": {
  15098. "type": "number"
  15099. },
  15100. "aggregateID": {
  15101. "type": "string",
  15102. "enum": ["sessionID"]
  15103. },
  15104. "data": {
  15105. "type": "object",
  15106. "properties": {
  15107. "timestamp": {
  15108. "type": "number"
  15109. },
  15110. "sessionID": {
  15111. "type": "string"
  15112. },
  15113. "callID": {
  15114. "type": "string"
  15115. },
  15116. "text": {
  15117. "type": "string"
  15118. }
  15119. },
  15120. "required": ["timestamp", "sessionID", "callID", "text"],
  15121. "additionalProperties": false
  15122. }
  15123. },
  15124. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15125. "additionalProperties": false
  15126. },
  15127. "SyncEventSessionNextToolCalled": {
  15128. "type": "object",
  15129. "properties": {
  15130. "type": {
  15131. "type": "string",
  15132. "enum": ["sync"]
  15133. },
  15134. "name": {
  15135. "type": "string",
  15136. "enum": ["session.next.tool.called.1"]
  15137. },
  15138. "id": {
  15139. "type": "string"
  15140. },
  15141. "seq": {
  15142. "type": "number"
  15143. },
  15144. "aggregateID": {
  15145. "type": "string",
  15146. "enum": ["sessionID"]
  15147. },
  15148. "data": {
  15149. "type": "object",
  15150. "properties": {
  15151. "timestamp": {
  15152. "type": "number"
  15153. },
  15154. "sessionID": {
  15155. "type": "string"
  15156. },
  15157. "callID": {
  15158. "type": "string"
  15159. },
  15160. "tool": {
  15161. "type": "string"
  15162. },
  15163. "input": {
  15164. "type": "object"
  15165. },
  15166. "provider": {
  15167. "type": "object",
  15168. "properties": {
  15169. "executed": {
  15170. "type": "boolean"
  15171. },
  15172. "metadata": {
  15173. "type": "object"
  15174. }
  15175. },
  15176. "required": ["executed"],
  15177. "additionalProperties": false
  15178. }
  15179. },
  15180. "required": ["timestamp", "sessionID", "callID", "tool", "input", "provider"],
  15181. "additionalProperties": false
  15182. }
  15183. },
  15184. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15185. "additionalProperties": false
  15186. },
  15187. "SyncEventSessionNextToolProgress": {
  15188. "type": "object",
  15189. "properties": {
  15190. "type": {
  15191. "type": "string",
  15192. "enum": ["sync"]
  15193. },
  15194. "name": {
  15195. "type": "string",
  15196. "enum": ["session.next.tool.progress.1"]
  15197. },
  15198. "id": {
  15199. "type": "string"
  15200. },
  15201. "seq": {
  15202. "type": "number"
  15203. },
  15204. "aggregateID": {
  15205. "type": "string",
  15206. "enum": ["sessionID"]
  15207. },
  15208. "data": {
  15209. "type": "object",
  15210. "properties": {
  15211. "timestamp": {
  15212. "type": "number"
  15213. },
  15214. "sessionID": {
  15215. "type": "string"
  15216. },
  15217. "callID": {
  15218. "type": "string"
  15219. },
  15220. "structured": {
  15221. "type": "object"
  15222. },
  15223. "content": {
  15224. "type": "array",
  15225. "items": {
  15226. "anyOf": [
  15227. {
  15228. "$ref": "#/components/schemas/ToolTextContent"
  15229. },
  15230. {
  15231. "$ref": "#/components/schemas/ToolFileContent"
  15232. }
  15233. ]
  15234. }
  15235. }
  15236. },
  15237. "required": ["timestamp", "sessionID", "callID", "structured", "content"],
  15238. "additionalProperties": false
  15239. }
  15240. },
  15241. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15242. "additionalProperties": false
  15243. },
  15244. "SyncEventSessionNextToolSuccess": {
  15245. "type": "object",
  15246. "properties": {
  15247. "type": {
  15248. "type": "string",
  15249. "enum": ["sync"]
  15250. },
  15251. "name": {
  15252. "type": "string",
  15253. "enum": ["session.next.tool.success.1"]
  15254. },
  15255. "id": {
  15256. "type": "string"
  15257. },
  15258. "seq": {
  15259. "type": "number"
  15260. },
  15261. "aggregateID": {
  15262. "type": "string",
  15263. "enum": ["sessionID"]
  15264. },
  15265. "data": {
  15266. "type": "object",
  15267. "properties": {
  15268. "timestamp": {
  15269. "type": "number"
  15270. },
  15271. "sessionID": {
  15272. "type": "string"
  15273. },
  15274. "callID": {
  15275. "type": "string"
  15276. },
  15277. "structured": {
  15278. "type": "object"
  15279. },
  15280. "content": {
  15281. "type": "array",
  15282. "items": {
  15283. "anyOf": [
  15284. {
  15285. "$ref": "#/components/schemas/ToolTextContent"
  15286. },
  15287. {
  15288. "$ref": "#/components/schemas/ToolFileContent"
  15289. }
  15290. ]
  15291. }
  15292. },
  15293. "provider": {
  15294. "type": "object",
  15295. "properties": {
  15296. "executed": {
  15297. "type": "boolean"
  15298. },
  15299. "metadata": {
  15300. "type": "object"
  15301. }
  15302. },
  15303. "required": ["executed"],
  15304. "additionalProperties": false
  15305. }
  15306. },
  15307. "required": ["timestamp", "sessionID", "callID", "structured", "content", "provider"],
  15308. "additionalProperties": false
  15309. }
  15310. },
  15311. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15312. "additionalProperties": false
  15313. },
  15314. "SyncEventSessionNextToolFailed": {
  15315. "type": "object",
  15316. "properties": {
  15317. "type": {
  15318. "type": "string",
  15319. "enum": ["sync"]
  15320. },
  15321. "name": {
  15322. "type": "string",
  15323. "enum": ["session.next.tool.failed.1"]
  15324. },
  15325. "id": {
  15326. "type": "string"
  15327. },
  15328. "seq": {
  15329. "type": "number"
  15330. },
  15331. "aggregateID": {
  15332. "type": "string",
  15333. "enum": ["sessionID"]
  15334. },
  15335. "data": {
  15336. "type": "object",
  15337. "properties": {
  15338. "timestamp": {
  15339. "type": "number"
  15340. },
  15341. "sessionID": {
  15342. "type": "string"
  15343. },
  15344. "callID": {
  15345. "type": "string"
  15346. },
  15347. "error": {
  15348. "$ref": "#/components/schemas/SessionErrorUnknown"
  15349. },
  15350. "provider": {
  15351. "type": "object",
  15352. "properties": {
  15353. "executed": {
  15354. "type": "boolean"
  15355. },
  15356. "metadata": {
  15357. "type": "object"
  15358. }
  15359. },
  15360. "required": ["executed"],
  15361. "additionalProperties": false
  15362. }
  15363. },
  15364. "required": ["timestamp", "sessionID", "callID", "error", "provider"],
  15365. "additionalProperties": false
  15366. }
  15367. },
  15368. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15369. "additionalProperties": false
  15370. },
  15371. "SyncEventSessionNextRetried": {
  15372. "type": "object",
  15373. "properties": {
  15374. "type": {
  15375. "type": "string",
  15376. "enum": ["sync"]
  15377. },
  15378. "name": {
  15379. "type": "string",
  15380. "enum": ["session.next.retried.1"]
  15381. },
  15382. "id": {
  15383. "type": "string"
  15384. },
  15385. "seq": {
  15386. "type": "number"
  15387. },
  15388. "aggregateID": {
  15389. "type": "string",
  15390. "enum": ["sessionID"]
  15391. },
  15392. "data": {
  15393. "type": "object",
  15394. "properties": {
  15395. "timestamp": {
  15396. "type": "number"
  15397. },
  15398. "sessionID": {
  15399. "type": "string"
  15400. },
  15401. "attempt": {
  15402. "type": "integer",
  15403. "minimum": 0
  15404. },
  15405. "error": {
  15406. "$ref": "#/components/schemas/SessionNextRetry_error"
  15407. }
  15408. },
  15409. "required": ["timestamp", "sessionID", "attempt", "error"],
  15410. "additionalProperties": false
  15411. }
  15412. },
  15413. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15414. "additionalProperties": false
  15415. },
  15416. "SyncEventSessionNextCompactionStarted": {
  15417. "type": "object",
  15418. "properties": {
  15419. "type": {
  15420. "type": "string",
  15421. "enum": ["sync"]
  15422. },
  15423. "name": {
  15424. "type": "string",
  15425. "enum": ["session.next.compaction.started.1"]
  15426. },
  15427. "id": {
  15428. "type": "string"
  15429. },
  15430. "seq": {
  15431. "type": "number"
  15432. },
  15433. "aggregateID": {
  15434. "type": "string",
  15435. "enum": ["sessionID"]
  15436. },
  15437. "data": {
  15438. "type": "object",
  15439. "properties": {
  15440. "timestamp": {
  15441. "type": "number"
  15442. },
  15443. "sessionID": {
  15444. "type": "string"
  15445. },
  15446. "reason": {
  15447. "type": "string",
  15448. "enum": ["auto", "manual"]
  15449. }
  15450. },
  15451. "required": ["timestamp", "sessionID", "reason"],
  15452. "additionalProperties": false
  15453. }
  15454. },
  15455. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15456. "additionalProperties": false
  15457. },
  15458. "SyncEventSessionNextCompactionDelta": {
  15459. "type": "object",
  15460. "properties": {
  15461. "type": {
  15462. "type": "string",
  15463. "enum": ["sync"]
  15464. },
  15465. "name": {
  15466. "type": "string",
  15467. "enum": ["session.next.compaction.delta.1"]
  15468. },
  15469. "id": {
  15470. "type": "string"
  15471. },
  15472. "seq": {
  15473. "type": "number"
  15474. },
  15475. "aggregateID": {
  15476. "type": "string",
  15477. "enum": ["sessionID"]
  15478. },
  15479. "data": {
  15480. "type": "object",
  15481. "properties": {
  15482. "timestamp": {
  15483. "type": "number"
  15484. },
  15485. "sessionID": {
  15486. "type": "string"
  15487. },
  15488. "text": {
  15489. "type": "string"
  15490. }
  15491. },
  15492. "required": ["timestamp", "sessionID", "text"],
  15493. "additionalProperties": false
  15494. }
  15495. },
  15496. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15497. "additionalProperties": false
  15498. },
  15499. "SyncEventSessionNextCompactionEnded": {
  15500. "type": "object",
  15501. "properties": {
  15502. "type": {
  15503. "type": "string",
  15504. "enum": ["sync"]
  15505. },
  15506. "name": {
  15507. "type": "string",
  15508. "enum": ["session.next.compaction.ended.1"]
  15509. },
  15510. "id": {
  15511. "type": "string"
  15512. },
  15513. "seq": {
  15514. "type": "number"
  15515. },
  15516. "aggregateID": {
  15517. "type": "string",
  15518. "enum": ["sessionID"]
  15519. },
  15520. "data": {
  15521. "type": "object",
  15522. "properties": {
  15523. "timestamp": {
  15524. "type": "number"
  15525. },
  15526. "sessionID": {
  15527. "type": "string"
  15528. },
  15529. "text": {
  15530. "type": "string"
  15531. },
  15532. "include": {
  15533. "type": "string"
  15534. }
  15535. },
  15536. "required": ["timestamp", "sessionID", "text"],
  15537. "additionalProperties": false
  15538. }
  15539. },
  15540. "required": ["type", "name", "id", "seq", "aggregateID", "data"],
  15541. "additionalProperties": false
  15542. },
  15543. "EventServerInstanceDisposed": {
  15544. "type": "object",
  15545. "properties": {
  15546. "id": {
  15547. "type": "string"
  15548. },
  15549. "type": {
  15550. "type": "string",
  15551. "enum": ["server.instance.disposed"]
  15552. },
  15553. "properties": {
  15554. "type": "object",
  15555. "properties": {
  15556. "directory": {
  15557. "type": "string"
  15558. }
  15559. },
  15560. "required": ["directory"],
  15561. "additionalProperties": false
  15562. }
  15563. },
  15564. "required": ["id", "type", "properties"],
  15565. "additionalProperties": false
  15566. },
  15567. "EventFileEdited": {
  15568. "type": "object",
  15569. "properties": {
  15570. "id": {
  15571. "type": "string"
  15572. },
  15573. "type": {
  15574. "type": "string",
  15575. "enum": ["file.edited"]
  15576. },
  15577. "properties": {
  15578. "type": "object",
  15579. "properties": {
  15580. "file": {
  15581. "type": "string"
  15582. }
  15583. },
  15584. "required": ["file"],
  15585. "additionalProperties": false
  15586. }
  15587. },
  15588. "required": ["id", "type", "properties"],
  15589. "additionalProperties": false
  15590. },
  15591. "EventFileWatcherUpdated": {
  15592. "type": "object",
  15593. "properties": {
  15594. "id": {
  15595. "type": "string"
  15596. },
  15597. "type": {
  15598. "type": "string",
  15599. "enum": ["file.watcher.updated"]
  15600. },
  15601. "properties": {
  15602. "type": "object",
  15603. "properties": {
  15604. "file": {
  15605. "type": "string"
  15606. },
  15607. "event": {
  15608. "type": "string",
  15609. "enum": ["add", "change", "unlink"]
  15610. }
  15611. },
  15612. "required": ["file", "event"],
  15613. "additionalProperties": false
  15614. }
  15615. },
  15616. "required": ["id", "type", "properties"],
  15617. "additionalProperties": false
  15618. },
  15619. "EventLspClientDiagnostics": {
  15620. "type": "object",
  15621. "properties": {
  15622. "id": {
  15623. "type": "string"
  15624. },
  15625. "type": {
  15626. "type": "string",
  15627. "enum": ["lsp.client.diagnostics"]
  15628. },
  15629. "properties": {
  15630. "type": "object",
  15631. "properties": {
  15632. "serverID": {
  15633. "type": "string"
  15634. },
  15635. "path": {
  15636. "type": "string"
  15637. }
  15638. },
  15639. "required": ["serverID", "path"],
  15640. "additionalProperties": false
  15641. }
  15642. },
  15643. "required": ["id", "type", "properties"],
  15644. "additionalProperties": false
  15645. },
  15646. "EventLspUpdated": {
  15647. "type": "object",
  15648. "properties": {
  15649. "id": {
  15650. "type": "string"
  15651. },
  15652. "type": {
  15653. "type": "string",
  15654. "enum": ["lsp.updated"]
  15655. },
  15656. "properties": {
  15657. "type": "object",
  15658. "properties": {}
  15659. }
  15660. },
  15661. "required": ["id", "type", "properties"],
  15662. "additionalProperties": false
  15663. },
  15664. "EventMessagePartDelta": {
  15665. "type": "object",
  15666. "properties": {
  15667. "id": {
  15668. "type": "string"
  15669. },
  15670. "type": {
  15671. "type": "string",
  15672. "enum": ["message.part.delta"]
  15673. },
  15674. "properties": {
  15675. "type": "object",
  15676. "properties": {
  15677. "sessionID": {
  15678. "type": "string"
  15679. },
  15680. "messageID": {
  15681. "type": "string"
  15682. },
  15683. "partID": {
  15684. "type": "string"
  15685. },
  15686. "field": {
  15687. "type": "string"
  15688. },
  15689. "delta": {
  15690. "type": "string"
  15691. }
  15692. },
  15693. "required": ["sessionID", "messageID", "partID", "field", "delta"],
  15694. "additionalProperties": false
  15695. }
  15696. },
  15697. "required": ["id", "type", "properties"],
  15698. "additionalProperties": false
  15699. },
  15700. "EventPermissionAsked": {
  15701. "type": "object",
  15702. "properties": {
  15703. "id": {
  15704. "type": "string"
  15705. },
  15706. "type": {
  15707. "type": "string",
  15708. "enum": ["permission.asked"]
  15709. },
  15710. "properties": {
  15711. "$ref": "#/components/schemas/PermissionRequest"
  15712. }
  15713. },
  15714. "required": ["id", "type", "properties"],
  15715. "additionalProperties": false
  15716. },
  15717. "EventPermissionReplied": {
  15718. "type": "object",
  15719. "properties": {
  15720. "id": {
  15721. "type": "string"
  15722. },
  15723. "type": {
  15724. "type": "string",
  15725. "enum": ["permission.replied"]
  15726. },
  15727. "properties": {
  15728. "type": "object",
  15729. "properties": {
  15730. "sessionID": {
  15731. "type": "string"
  15732. },
  15733. "requestID": {
  15734. "type": "string"
  15735. },
  15736. "reply": {
  15737. "type": "string",
  15738. "enum": ["once", "always", "reject"]
  15739. }
  15740. },
  15741. "required": ["sessionID", "requestID", "reply"],
  15742. "additionalProperties": false
  15743. }
  15744. },
  15745. "required": ["id", "type", "properties"],
  15746. "additionalProperties": false
  15747. },
  15748. "EventSessionDiff": {
  15749. "type": "object",
  15750. "properties": {
  15751. "id": {
  15752. "type": "string"
  15753. },
  15754. "type": {
  15755. "type": "string",
  15756. "enum": ["session.diff"]
  15757. },
  15758. "properties": {
  15759. "type": "object",
  15760. "properties": {
  15761. "sessionID": {
  15762. "type": "string"
  15763. },
  15764. "diff": {
  15765. "type": "array",
  15766. "items": {
  15767. "$ref": "#/components/schemas/SnapshotFileDiff"
  15768. }
  15769. }
  15770. },
  15771. "required": ["sessionID", "diff"],
  15772. "additionalProperties": false
  15773. }
  15774. },
  15775. "required": ["id", "type", "properties"],
  15776. "additionalProperties": false
  15777. },
  15778. "EventSessionError": {
  15779. "type": "object",
  15780. "properties": {
  15781. "id": {
  15782. "type": "string"
  15783. },
  15784. "type": {
  15785. "type": "string",
  15786. "enum": ["session.error"]
  15787. },
  15788. "properties": {
  15789. "type": "object",
  15790. "properties": {
  15791. "sessionID": {
  15792. "type": "string"
  15793. },
  15794. "error": {
  15795. "anyOf": [
  15796. {
  15797. "$ref": "#/components/schemas/ProviderAuthError"
  15798. },
  15799. {
  15800. "$ref": "#/components/schemas/UnknownError"
  15801. },
  15802. {
  15803. "$ref": "#/components/schemas/MessageOutputLengthError"
  15804. },
  15805. {
  15806. "$ref": "#/components/schemas/MessageAbortedError"
  15807. },
  15808. {
  15809. "$ref": "#/components/schemas/StructuredOutputError"
  15810. },
  15811. {
  15812. "$ref": "#/components/schemas/ContextOverflowError"
  15813. },
  15814. {
  15815. "$ref": "#/components/schemas/APIError"
  15816. }
  15817. ]
  15818. }
  15819. },
  15820. "additionalProperties": false
  15821. }
  15822. },
  15823. "required": ["id", "type", "properties"],
  15824. "additionalProperties": false
  15825. },
  15826. "EventInstallationUpdated": {
  15827. "type": "object",
  15828. "properties": {
  15829. "id": {
  15830. "type": "string"
  15831. },
  15832. "type": {
  15833. "type": "string",
  15834. "enum": ["installation.updated"]
  15835. },
  15836. "properties": {
  15837. "type": "object",
  15838. "properties": {
  15839. "version": {
  15840. "type": "string"
  15841. }
  15842. },
  15843. "required": ["version"],
  15844. "additionalProperties": false
  15845. }
  15846. },
  15847. "required": ["id", "type", "properties"],
  15848. "additionalProperties": false
  15849. },
  15850. "EventInstallationUpdate-available": {
  15851. "type": "object",
  15852. "properties": {
  15853. "id": {
  15854. "type": "string"
  15855. },
  15856. "type": {
  15857. "type": "string",
  15858. "enum": ["installation.update-available"]
  15859. },
  15860. "properties": {
  15861. "type": "object",
  15862. "properties": {
  15863. "version": {
  15864. "type": "string"
  15865. }
  15866. },
  15867. "required": ["version"],
  15868. "additionalProperties": false
  15869. }
  15870. },
  15871. "required": ["id", "type", "properties"],
  15872. "additionalProperties": false
  15873. },
  15874. "EventQuestionAsked": {
  15875. "type": "object",
  15876. "properties": {
  15877. "id": {
  15878. "type": "string"
  15879. },
  15880. "type": {
  15881. "type": "string",
  15882. "enum": ["question.asked"]
  15883. },
  15884. "properties": {
  15885. "$ref": "#/components/schemas/QuestionRequest"
  15886. }
  15887. },
  15888. "required": ["id", "type", "properties"],
  15889. "additionalProperties": false
  15890. },
  15891. "EventQuestionReplied": {
  15892. "type": "object",
  15893. "properties": {
  15894. "id": {
  15895. "type": "string"
  15896. },
  15897. "type": {
  15898. "type": "string",
  15899. "enum": ["question.replied"]
  15900. },
  15901. "properties": {
  15902. "$ref": "#/components/schemas/QuestionReplied"
  15903. }
  15904. },
  15905. "required": ["id", "type", "properties"],
  15906. "additionalProperties": false
  15907. },
  15908. "EventQuestionRejected": {
  15909. "type": "object",
  15910. "properties": {
  15911. "id": {
  15912. "type": "string"
  15913. },
  15914. "type": {
  15915. "type": "string",
  15916. "enum": ["question.rejected"]
  15917. },
  15918. "properties": {
  15919. "$ref": "#/components/schemas/QuestionRejected"
  15920. }
  15921. },
  15922. "required": ["id", "type", "properties"],
  15923. "additionalProperties": false
  15924. },
  15925. "EventTodoUpdated": {
  15926. "type": "object",
  15927. "properties": {
  15928. "id": {
  15929. "type": "string"
  15930. },
  15931. "type": {
  15932. "type": "string",
  15933. "enum": ["todo.updated"]
  15934. },
  15935. "properties": {
  15936. "type": "object",
  15937. "properties": {
  15938. "sessionID": {
  15939. "type": "string"
  15940. },
  15941. "todos": {
  15942. "type": "array",
  15943. "items": {
  15944. "$ref": "#/components/schemas/Todo"
  15945. }
  15946. }
  15947. },
  15948. "required": ["sessionID", "todos"],
  15949. "additionalProperties": false
  15950. }
  15951. },
  15952. "required": ["id", "type", "properties"],
  15953. "additionalProperties": false
  15954. },
  15955. "EventSessionStatus": {
  15956. "type": "object",
  15957. "properties": {
  15958. "id": {
  15959. "type": "string"
  15960. },
  15961. "type": {
  15962. "type": "string",
  15963. "enum": ["session.status"]
  15964. },
  15965. "properties": {
  15966. "type": "object",
  15967. "properties": {
  15968. "sessionID": {
  15969. "type": "string"
  15970. },
  15971. "status": {
  15972. "$ref": "#/components/schemas/SessionStatus"
  15973. }
  15974. },
  15975. "required": ["sessionID", "status"],
  15976. "additionalProperties": false
  15977. }
  15978. },
  15979. "required": ["id", "type", "properties"],
  15980. "additionalProperties": false
  15981. },
  15982. "EventSessionIdle": {
  15983. "type": "object",
  15984. "properties": {
  15985. "id": {
  15986. "type": "string"
  15987. },
  15988. "type": {
  15989. "type": "string",
  15990. "enum": ["session.idle"]
  15991. },
  15992. "properties": {
  15993. "type": "object",
  15994. "properties": {
  15995. "sessionID": {
  15996. "type": "string"
  15997. }
  15998. },
  15999. "required": ["sessionID"],
  16000. "additionalProperties": false
  16001. }
  16002. },
  16003. "required": ["id", "type", "properties"],
  16004. "additionalProperties": false
  16005. },
  16006. "EventSessionCompacted": {
  16007. "type": "object",
  16008. "properties": {
  16009. "id": {
  16010. "type": "string"
  16011. },
  16012. "type": {
  16013. "type": "string",
  16014. "enum": ["session.compacted"]
  16015. },
  16016. "properties": {
  16017. "type": "object",
  16018. "properties": {
  16019. "sessionID": {
  16020. "type": "string"
  16021. }
  16022. },
  16023. "required": ["sessionID"],
  16024. "additionalProperties": false
  16025. }
  16026. },
  16027. "required": ["id", "type", "properties"],
  16028. "additionalProperties": false
  16029. },
  16030. "EventMcpToolsChanged": {
  16031. "type": "object",
  16032. "properties": {
  16033. "id": {
  16034. "type": "string"
  16035. },
  16036. "type": {
  16037. "type": "string",
  16038. "enum": ["mcp.tools.changed"]
  16039. },
  16040. "properties": {
  16041. "type": "object",
  16042. "properties": {
  16043. "server": {
  16044. "type": "string"
  16045. }
  16046. },
  16047. "required": ["server"],
  16048. "additionalProperties": false
  16049. }
  16050. },
  16051. "required": ["id", "type", "properties"],
  16052. "additionalProperties": false
  16053. },
  16054. "EventMcpBrowserOpenFailed": {
  16055. "type": "object",
  16056. "properties": {
  16057. "id": {
  16058. "type": "string"
  16059. },
  16060. "type": {
  16061. "type": "string",
  16062. "enum": ["mcp.browser.open.failed"]
  16063. },
  16064. "properties": {
  16065. "type": "object",
  16066. "properties": {
  16067. "mcpName": {
  16068. "type": "string"
  16069. },
  16070. "url": {
  16071. "type": "string"
  16072. }
  16073. },
  16074. "required": ["mcpName", "url"],
  16075. "additionalProperties": false
  16076. }
  16077. },
  16078. "required": ["id", "type", "properties"],
  16079. "additionalProperties": false
  16080. },
  16081. "EventCommandExecuted": {
  16082. "type": "object",
  16083. "properties": {
  16084. "id": {
  16085. "type": "string"
  16086. },
  16087. "type": {
  16088. "type": "string",
  16089. "enum": ["command.executed"]
  16090. },
  16091. "properties": {
  16092. "type": "object",
  16093. "properties": {
  16094. "name": {
  16095. "type": "string"
  16096. },
  16097. "sessionID": {
  16098. "type": "string"
  16099. },
  16100. "arguments": {
  16101. "type": "string"
  16102. },
  16103. "messageID": {
  16104. "type": "string"
  16105. }
  16106. },
  16107. "required": ["name", "sessionID", "arguments", "messageID"],
  16108. "additionalProperties": false
  16109. }
  16110. },
  16111. "required": ["id", "type", "properties"],
  16112. "additionalProperties": false
  16113. },
  16114. "EventProjectUpdated": {
  16115. "type": "object",
  16116. "properties": {
  16117. "id": {
  16118. "type": "string"
  16119. },
  16120. "type": {
  16121. "type": "string",
  16122. "enum": ["project.updated"]
  16123. },
  16124. "properties": {
  16125. "$ref": "#/components/schemas/Project"
  16126. }
  16127. },
  16128. "required": ["id", "type", "properties"],
  16129. "additionalProperties": false
  16130. },
  16131. "EventVcsBranchUpdated": {
  16132. "type": "object",
  16133. "properties": {
  16134. "id": {
  16135. "type": "string"
  16136. },
  16137. "type": {
  16138. "type": "string",
  16139. "enum": ["vcs.branch.updated"]
  16140. },
  16141. "properties": {
  16142. "type": "object",
  16143. "properties": {
  16144. "branch": {
  16145. "type": "string"
  16146. }
  16147. },
  16148. "additionalProperties": false
  16149. }
  16150. },
  16151. "required": ["id", "type", "properties"],
  16152. "additionalProperties": false
  16153. },
  16154. "EventWorkspaceReady": {
  16155. "type": "object",
  16156. "properties": {
  16157. "id": {
  16158. "type": "string"
  16159. },
  16160. "type": {
  16161. "type": "string",
  16162. "enum": ["workspace.ready"]
  16163. },
  16164. "properties": {
  16165. "type": "object",
  16166. "properties": {
  16167. "name": {
  16168. "type": "string"
  16169. }
  16170. },
  16171. "required": ["name"],
  16172. "additionalProperties": false
  16173. }
  16174. },
  16175. "required": ["id", "type", "properties"],
  16176. "additionalProperties": false
  16177. },
  16178. "EventWorkspaceFailed": {
  16179. "type": "object",
  16180. "properties": {
  16181. "id": {
  16182. "type": "string"
  16183. },
  16184. "type": {
  16185. "type": "string",
  16186. "enum": ["workspace.failed"]
  16187. },
  16188. "properties": {
  16189. "type": "object",
  16190. "properties": {
  16191. "message": {
  16192. "type": "string"
  16193. }
  16194. },
  16195. "required": ["message"],
  16196. "additionalProperties": false
  16197. }
  16198. },
  16199. "required": ["id", "type", "properties"],
  16200. "additionalProperties": false
  16201. },
  16202. "EventWorkspaceStatus": {
  16203. "type": "object",
  16204. "properties": {
  16205. "id": {
  16206. "type": "string"
  16207. },
  16208. "type": {
  16209. "type": "string",
  16210. "enum": ["workspace.status"]
  16211. },
  16212. "properties": {
  16213. "type": "object",
  16214. "properties": {
  16215. "workspaceID": {
  16216. "type": "string"
  16217. },
  16218. "status": {
  16219. "type": "string",
  16220. "enum": ["connected", "connecting", "disconnected", "error"]
  16221. }
  16222. },
  16223. "required": ["workspaceID", "status"],
  16224. "additionalProperties": false
  16225. }
  16226. },
  16227. "required": ["id", "type", "properties"],
  16228. "additionalProperties": false
  16229. },
  16230. "EventWorktreeReady": {
  16231. "type": "object",
  16232. "properties": {
  16233. "id": {
  16234. "type": "string"
  16235. },
  16236. "type": {
  16237. "type": "string",
  16238. "enum": ["worktree.ready"]
  16239. },
  16240. "properties": {
  16241. "type": "object",
  16242. "properties": {
  16243. "name": {
  16244. "type": "string"
  16245. },
  16246. "branch": {
  16247. "type": "string"
  16248. }
  16249. },
  16250. "required": ["name", "branch"],
  16251. "additionalProperties": false
  16252. }
  16253. },
  16254. "required": ["id", "type", "properties"],
  16255. "additionalProperties": false
  16256. },
  16257. "EventWorktreeFailed": {
  16258. "type": "object",
  16259. "properties": {
  16260. "id": {
  16261. "type": "string"
  16262. },
  16263. "type": {
  16264. "type": "string",
  16265. "enum": ["worktree.failed"]
  16266. },
  16267. "properties": {
  16268. "type": "object",
  16269. "properties": {
  16270. "message": {
  16271. "type": "string"
  16272. }
  16273. },
  16274. "required": ["message"],
  16275. "additionalProperties": false
  16276. }
  16277. },
  16278. "required": ["id", "type", "properties"],
  16279. "additionalProperties": false
  16280. },
  16281. "EventPtyCreated": {
  16282. "type": "object",
  16283. "properties": {
  16284. "id": {
  16285. "type": "string"
  16286. },
  16287. "type": {
  16288. "type": "string",
  16289. "enum": ["pty.created"]
  16290. },
  16291. "properties": {
  16292. "type": "object",
  16293. "properties": {
  16294. "info": {
  16295. "$ref": "#/components/schemas/Pty"
  16296. }
  16297. },
  16298. "required": ["info"],
  16299. "additionalProperties": false
  16300. }
  16301. },
  16302. "required": ["id", "type", "properties"],
  16303. "additionalProperties": false
  16304. },
  16305. "EventPtyUpdated": {
  16306. "type": "object",
  16307. "properties": {
  16308. "id": {
  16309. "type": "string"
  16310. },
  16311. "type": {
  16312. "type": "string",
  16313. "enum": ["pty.updated"]
  16314. },
  16315. "properties": {
  16316. "type": "object",
  16317. "properties": {
  16318. "info": {
  16319. "$ref": "#/components/schemas/Pty"
  16320. }
  16321. },
  16322. "required": ["info"],
  16323. "additionalProperties": false
  16324. }
  16325. },
  16326. "required": ["id", "type", "properties"],
  16327. "additionalProperties": false
  16328. },
  16329. "EventPtyExited": {
  16330. "type": "object",
  16331. "properties": {
  16332. "id": {
  16333. "type": "string"
  16334. },
  16335. "type": {
  16336. "type": "string",
  16337. "enum": ["pty.exited"]
  16338. },
  16339. "properties": {
  16340. "type": "object",
  16341. "properties": {
  16342. "id": {
  16343. "type": "string"
  16344. },
  16345. "exitCode": {
  16346. "type": "integer",
  16347. "minimum": 0
  16348. }
  16349. },
  16350. "required": ["id", "exitCode"],
  16351. "additionalProperties": false
  16352. }
  16353. },
  16354. "required": ["id", "type", "properties"],
  16355. "additionalProperties": false
  16356. },
  16357. "EventPtyDeleted": {
  16358. "type": "object",
  16359. "properties": {
  16360. "id": {
  16361. "type": "string"
  16362. },
  16363. "type": {
  16364. "type": "string",
  16365. "enum": ["pty.deleted"]
  16366. },
  16367. "properties": {
  16368. "type": "object",
  16369. "properties": {
  16370. "id": {
  16371. "type": "string"
  16372. }
  16373. },
  16374. "required": ["id"],
  16375. "additionalProperties": false
  16376. }
  16377. },
  16378. "required": ["id", "type", "properties"],
  16379. "additionalProperties": false
  16380. },
  16381. "EventMessageUpdated": {
  16382. "type": "object",
  16383. "properties": {
  16384. "id": {
  16385. "type": "string"
  16386. },
  16387. "type": {
  16388. "type": "string",
  16389. "enum": ["message.updated"]
  16390. },
  16391. "properties": {
  16392. "type": "object",
  16393. "properties": {
  16394. "sessionID": {
  16395. "type": "string"
  16396. },
  16397. "info": {
  16398. "$ref": "#/components/schemas/Message"
  16399. }
  16400. },
  16401. "required": ["sessionID", "info"],
  16402. "additionalProperties": false
  16403. }
  16404. },
  16405. "required": ["id", "type", "properties"],
  16406. "additionalProperties": false
  16407. },
  16408. "EventMessageRemoved": {
  16409. "type": "object",
  16410. "properties": {
  16411. "id": {
  16412. "type": "string"
  16413. },
  16414. "type": {
  16415. "type": "string",
  16416. "enum": ["message.removed"]
  16417. },
  16418. "properties": {
  16419. "type": "object",
  16420. "properties": {
  16421. "sessionID": {
  16422. "type": "string"
  16423. },
  16424. "messageID": {
  16425. "type": "string"
  16426. }
  16427. },
  16428. "required": ["sessionID", "messageID"],
  16429. "additionalProperties": false
  16430. }
  16431. },
  16432. "required": ["id", "type", "properties"],
  16433. "additionalProperties": false
  16434. },
  16435. "EventMessagePartUpdated": {
  16436. "type": "object",
  16437. "properties": {
  16438. "id": {
  16439. "type": "string"
  16440. },
  16441. "type": {
  16442. "type": "string",
  16443. "enum": ["message.part.updated"]
  16444. },
  16445. "properties": {
  16446. "type": "object",
  16447. "properties": {
  16448. "sessionID": {
  16449. "type": "string"
  16450. },
  16451. "part": {
  16452. "$ref": "#/components/schemas/Part"
  16453. },
  16454. "time": {
  16455. "type": "integer",
  16456. "minimum": 0
  16457. }
  16458. },
  16459. "required": ["sessionID", "part", "time"],
  16460. "additionalProperties": false
  16461. }
  16462. },
  16463. "required": ["id", "type", "properties"],
  16464. "additionalProperties": false
  16465. },
  16466. "EventMessagePartRemoved": {
  16467. "type": "object",
  16468. "properties": {
  16469. "id": {
  16470. "type": "string"
  16471. },
  16472. "type": {
  16473. "type": "string",
  16474. "enum": ["message.part.removed"]
  16475. },
  16476. "properties": {
  16477. "type": "object",
  16478. "properties": {
  16479. "sessionID": {
  16480. "type": "string"
  16481. },
  16482. "messageID": {
  16483. "type": "string"
  16484. },
  16485. "partID": {
  16486. "type": "string"
  16487. }
  16488. },
  16489. "required": ["sessionID", "messageID", "partID"],
  16490. "additionalProperties": false
  16491. }
  16492. },
  16493. "required": ["id", "type", "properties"],
  16494. "additionalProperties": false
  16495. },
  16496. "EventSessionCreated": {
  16497. "type": "object",
  16498. "properties": {
  16499. "id": {
  16500. "type": "string"
  16501. },
  16502. "type": {
  16503. "type": "string",
  16504. "enum": ["session.created"]
  16505. },
  16506. "properties": {
  16507. "type": "object",
  16508. "properties": {
  16509. "sessionID": {
  16510. "type": "string"
  16511. },
  16512. "info": {
  16513. "$ref": "#/components/schemas/Session"
  16514. }
  16515. },
  16516. "required": ["sessionID", "info"],
  16517. "additionalProperties": false
  16518. }
  16519. },
  16520. "required": ["id", "type", "properties"],
  16521. "additionalProperties": false
  16522. },
  16523. "EventSessionUpdated": {
  16524. "type": "object",
  16525. "properties": {
  16526. "id": {
  16527. "type": "string"
  16528. },
  16529. "type": {
  16530. "type": "string",
  16531. "enum": ["session.updated"]
  16532. },
  16533. "properties": {
  16534. "type": "object",
  16535. "properties": {
  16536. "sessionID": {
  16537. "type": "string"
  16538. },
  16539. "info": {
  16540. "$ref": "#/components/schemas/Session"
  16541. }
  16542. },
  16543. "required": ["sessionID", "info"],
  16544. "additionalProperties": false
  16545. }
  16546. },
  16547. "required": ["id", "type", "properties"],
  16548. "additionalProperties": false
  16549. },
  16550. "EventSessionDeleted": {
  16551. "type": "object",
  16552. "properties": {
  16553. "id": {
  16554. "type": "string"
  16555. },
  16556. "type": {
  16557. "type": "string",
  16558. "enum": ["session.deleted"]
  16559. },
  16560. "properties": {
  16561. "type": "object",
  16562. "properties": {
  16563. "sessionID": {
  16564. "type": "string"
  16565. },
  16566. "info": {
  16567. "$ref": "#/components/schemas/Session"
  16568. }
  16569. },
  16570. "required": ["sessionID", "info"],
  16571. "additionalProperties": false
  16572. }
  16573. },
  16574. "required": ["id", "type", "properties"],
  16575. "additionalProperties": false
  16576. },
  16577. "EventSessionNextAgentSwitched": {
  16578. "type": "object",
  16579. "properties": {
  16580. "id": {
  16581. "type": "string"
  16582. },
  16583. "type": {
  16584. "type": "string",
  16585. "enum": ["session.next.agent.switched"]
  16586. },
  16587. "properties": {
  16588. "type": "object",
  16589. "properties": {
  16590. "timestamp": {
  16591. "type": "number"
  16592. },
  16593. "sessionID": {
  16594. "type": "string"
  16595. },
  16596. "agent": {
  16597. "type": "string"
  16598. }
  16599. },
  16600. "required": ["timestamp", "sessionID", "agent"],
  16601. "additionalProperties": false
  16602. }
  16603. },
  16604. "required": ["id", "type", "properties"],
  16605. "additionalProperties": false
  16606. },
  16607. "EventSessionNextModelSwitched": {
  16608. "type": "object",
  16609. "properties": {
  16610. "id": {
  16611. "type": "string"
  16612. },
  16613. "type": {
  16614. "type": "string",
  16615. "enum": ["session.next.model.switched"]
  16616. },
  16617. "properties": {
  16618. "type": "object",
  16619. "properties": {
  16620. "timestamp": {
  16621. "type": "number"
  16622. },
  16623. "sessionID": {
  16624. "type": "string"
  16625. },
  16626. "model": {
  16627. "type": "object",
  16628. "properties": {
  16629. "id": {
  16630. "type": "string"
  16631. },
  16632. "providerID": {
  16633. "type": "string"
  16634. },
  16635. "variant": {
  16636. "type": "string"
  16637. }
  16638. },
  16639. "required": ["id", "providerID", "variant"],
  16640. "additionalProperties": false
  16641. }
  16642. },
  16643. "required": ["timestamp", "sessionID", "model"],
  16644. "additionalProperties": false
  16645. }
  16646. },
  16647. "required": ["id", "type", "properties"],
  16648. "additionalProperties": false
  16649. },
  16650. "PromptSource": {
  16651. "type": "object",
  16652. "properties": {
  16653. "start": {
  16654. "type": "number"
  16655. },
  16656. "end": {
  16657. "type": "number"
  16658. },
  16659. "text": {
  16660. "type": "string"
  16661. }
  16662. },
  16663. "required": ["start", "end", "text"],
  16664. "additionalProperties": false
  16665. },
  16666. "PromptFileAttachment": {
  16667. "type": "object",
  16668. "properties": {
  16669. "uri": {
  16670. "type": "string"
  16671. },
  16672. "mime": {
  16673. "type": "string"
  16674. },
  16675. "name": {
  16676. "type": "string"
  16677. },
  16678. "description": {
  16679. "type": "string"
  16680. },
  16681. "source": {
  16682. "$ref": "#/components/schemas/PromptSource"
  16683. }
  16684. },
  16685. "required": ["uri", "mime"],
  16686. "additionalProperties": false
  16687. },
  16688. "PromptAgentAttachment": {
  16689. "type": "object",
  16690. "properties": {
  16691. "name": {
  16692. "type": "string"
  16693. },
  16694. "source": {
  16695. "$ref": "#/components/schemas/PromptSource"
  16696. }
  16697. },
  16698. "required": ["name"],
  16699. "additionalProperties": false
  16700. },
  16701. "EventSessionNextPrompted": {
  16702. "type": "object",
  16703. "properties": {
  16704. "id": {
  16705. "type": "string"
  16706. },
  16707. "type": {
  16708. "type": "string",
  16709. "enum": ["session.next.prompted"]
  16710. },
  16711. "properties": {
  16712. "type": "object",
  16713. "properties": {
  16714. "timestamp": {
  16715. "type": "number"
  16716. },
  16717. "sessionID": {
  16718. "type": "string"
  16719. },
  16720. "prompt": {
  16721. "$ref": "#/components/schemas/Prompt"
  16722. }
  16723. },
  16724. "required": ["timestamp", "sessionID", "prompt"],
  16725. "additionalProperties": false
  16726. }
  16727. },
  16728. "required": ["id", "type", "properties"],
  16729. "additionalProperties": false
  16730. },
  16731. "EventSessionNextSynthetic": {
  16732. "type": "object",
  16733. "properties": {
  16734. "id": {
  16735. "type": "string"
  16736. },
  16737. "type": {
  16738. "type": "string",
  16739. "enum": ["session.next.synthetic"]
  16740. },
  16741. "properties": {
  16742. "type": "object",
  16743. "properties": {
  16744. "timestamp": {
  16745. "type": "number"
  16746. },
  16747. "sessionID": {
  16748. "type": "string"
  16749. },
  16750. "text": {
  16751. "type": "string"
  16752. }
  16753. },
  16754. "required": ["timestamp", "sessionID", "text"],
  16755. "additionalProperties": false
  16756. }
  16757. },
  16758. "required": ["id", "type", "properties"],
  16759. "additionalProperties": false
  16760. },
  16761. "EventSessionNextShellStarted": {
  16762. "type": "object",
  16763. "properties": {
  16764. "id": {
  16765. "type": "string"
  16766. },
  16767. "type": {
  16768. "type": "string",
  16769. "enum": ["session.next.shell.started"]
  16770. },
  16771. "properties": {
  16772. "type": "object",
  16773. "properties": {
  16774. "timestamp": {
  16775. "type": "number"
  16776. },
  16777. "sessionID": {
  16778. "type": "string"
  16779. },
  16780. "callID": {
  16781. "type": "string"
  16782. },
  16783. "command": {
  16784. "type": "string"
  16785. }
  16786. },
  16787. "required": ["timestamp", "sessionID", "callID", "command"],
  16788. "additionalProperties": false
  16789. }
  16790. },
  16791. "required": ["id", "type", "properties"],
  16792. "additionalProperties": false
  16793. },
  16794. "EventSessionNextShellEnded": {
  16795. "type": "object",
  16796. "properties": {
  16797. "id": {
  16798. "type": "string"
  16799. },
  16800. "type": {
  16801. "type": "string",
  16802. "enum": ["session.next.shell.ended"]
  16803. },
  16804. "properties": {
  16805. "type": "object",
  16806. "properties": {
  16807. "timestamp": {
  16808. "type": "number"
  16809. },
  16810. "sessionID": {
  16811. "type": "string"
  16812. },
  16813. "callID": {
  16814. "type": "string"
  16815. },
  16816. "output": {
  16817. "type": "string"
  16818. }
  16819. },
  16820. "required": ["timestamp", "sessionID", "callID", "output"],
  16821. "additionalProperties": false
  16822. }
  16823. },
  16824. "required": ["id", "type", "properties"],
  16825. "additionalProperties": false
  16826. },
  16827. "EventSessionNextStepStarted": {
  16828. "type": "object",
  16829. "properties": {
  16830. "id": {
  16831. "type": "string"
  16832. },
  16833. "type": {
  16834. "type": "string",
  16835. "enum": ["session.next.step.started"]
  16836. },
  16837. "properties": {
  16838. "type": "object",
  16839. "properties": {
  16840. "timestamp": {
  16841. "type": "number"
  16842. },
  16843. "sessionID": {
  16844. "type": "string"
  16845. },
  16846. "agent": {
  16847. "type": "string"
  16848. },
  16849. "model": {
  16850. "type": "object",
  16851. "properties": {
  16852. "id": {
  16853. "type": "string"
  16854. },
  16855. "providerID": {
  16856. "type": "string"
  16857. },
  16858. "variant": {
  16859. "type": "string"
  16860. }
  16861. },
  16862. "required": ["id", "providerID", "variant"],
  16863. "additionalProperties": false
  16864. },
  16865. "snapshot": {
  16866. "type": "string"
  16867. }
  16868. },
  16869. "required": ["timestamp", "sessionID", "agent", "model"],
  16870. "additionalProperties": false
  16871. }
  16872. },
  16873. "required": ["id", "type", "properties"],
  16874. "additionalProperties": false
  16875. },
  16876. "EventSessionNextStepEnded": {
  16877. "type": "object",
  16878. "properties": {
  16879. "id": {
  16880. "type": "string"
  16881. },
  16882. "type": {
  16883. "type": "string",
  16884. "enum": ["session.next.step.ended"]
  16885. },
  16886. "properties": {
  16887. "type": "object",
  16888. "properties": {
  16889. "timestamp": {
  16890. "type": "number"
  16891. },
  16892. "sessionID": {
  16893. "type": "string"
  16894. },
  16895. "finish": {
  16896. "type": "string"
  16897. },
  16898. "cost": {
  16899. "type": "number"
  16900. },
  16901. "tokens": {
  16902. "type": "object",
  16903. "properties": {
  16904. "input": {
  16905. "type": "integer",
  16906. "minimum": 0
  16907. },
  16908. "output": {
  16909. "type": "integer",
  16910. "minimum": 0
  16911. },
  16912. "reasoning": {
  16913. "type": "integer",
  16914. "minimum": 0
  16915. },
  16916. "cache": {
  16917. "type": "object",
  16918. "properties": {
  16919. "read": {
  16920. "type": "integer",
  16921. "minimum": 0
  16922. },
  16923. "write": {
  16924. "type": "integer",
  16925. "minimum": 0
  16926. }
  16927. },
  16928. "required": ["read", "write"],
  16929. "additionalProperties": false
  16930. }
  16931. },
  16932. "required": ["input", "output", "reasoning", "cache"],
  16933. "additionalProperties": false
  16934. },
  16935. "snapshot": {
  16936. "type": "string"
  16937. }
  16938. },
  16939. "required": ["timestamp", "sessionID", "finish", "cost", "tokens"],
  16940. "additionalProperties": false
  16941. }
  16942. },
  16943. "required": ["id", "type", "properties"],
  16944. "additionalProperties": false
  16945. },
  16946. "SessionErrorUnknown": {
  16947. "type": "object",
  16948. "properties": {
  16949. "type": {
  16950. "type": "string",
  16951. "enum": ["unknown"]
  16952. },
  16953. "message": {
  16954. "type": "string"
  16955. }
  16956. },
  16957. "required": ["type", "message"],
  16958. "additionalProperties": false
  16959. },
  16960. "EventSessionNextStepFailed": {
  16961. "type": "object",
  16962. "properties": {
  16963. "id": {
  16964. "type": "string"
  16965. },
  16966. "type": {
  16967. "type": "string",
  16968. "enum": ["session.next.step.failed"]
  16969. },
  16970. "properties": {
  16971. "type": "object",
  16972. "properties": {
  16973. "timestamp": {
  16974. "type": "number"
  16975. },
  16976. "sessionID": {
  16977. "type": "string"
  16978. },
  16979. "error": {
  16980. "$ref": "#/components/schemas/SessionErrorUnknown"
  16981. }
  16982. },
  16983. "required": ["timestamp", "sessionID", "error"],
  16984. "additionalProperties": false
  16985. }
  16986. },
  16987. "required": ["id", "type", "properties"],
  16988. "additionalProperties": false
  16989. },
  16990. "EventSessionNextTextStarted": {
  16991. "type": "object",
  16992. "properties": {
  16993. "id": {
  16994. "type": "string"
  16995. },
  16996. "type": {
  16997. "type": "string",
  16998. "enum": ["session.next.text.started"]
  16999. },
  17000. "properties": {
  17001. "type": "object",
  17002. "properties": {
  17003. "timestamp": {
  17004. "type": "number"
  17005. },
  17006. "sessionID": {
  17007. "type": "string"
  17008. }
  17009. },
  17010. "required": ["timestamp", "sessionID"],
  17011. "additionalProperties": false
  17012. }
  17013. },
  17014. "required": ["id", "type", "properties"],
  17015. "additionalProperties": false
  17016. },
  17017. "EventSessionNextTextDelta": {
  17018. "type": "object",
  17019. "properties": {
  17020. "id": {
  17021. "type": "string"
  17022. },
  17023. "type": {
  17024. "type": "string",
  17025. "enum": ["session.next.text.delta"]
  17026. },
  17027. "properties": {
  17028. "type": "object",
  17029. "properties": {
  17030. "timestamp": {
  17031. "type": "number"
  17032. },
  17033. "sessionID": {
  17034. "type": "string"
  17035. },
  17036. "delta": {
  17037. "type": "string"
  17038. }
  17039. },
  17040. "required": ["timestamp", "sessionID", "delta"],
  17041. "additionalProperties": false
  17042. }
  17043. },
  17044. "required": ["id", "type", "properties"],
  17045. "additionalProperties": false
  17046. },
  17047. "EventSessionNextTextEnded": {
  17048. "type": "object",
  17049. "properties": {
  17050. "id": {
  17051. "type": "string"
  17052. },
  17053. "type": {
  17054. "type": "string",
  17055. "enum": ["session.next.text.ended"]
  17056. },
  17057. "properties": {
  17058. "type": "object",
  17059. "properties": {
  17060. "timestamp": {
  17061. "type": "number"
  17062. },
  17063. "sessionID": {
  17064. "type": "string"
  17065. },
  17066. "text": {
  17067. "type": "string"
  17068. }
  17069. },
  17070. "required": ["timestamp", "sessionID", "text"],
  17071. "additionalProperties": false
  17072. }
  17073. },
  17074. "required": ["id", "type", "properties"],
  17075. "additionalProperties": false
  17076. },
  17077. "EventSessionNextReasoningStarted": {
  17078. "type": "object",
  17079. "properties": {
  17080. "id": {
  17081. "type": "string"
  17082. },
  17083. "type": {
  17084. "type": "string",
  17085. "enum": ["session.next.reasoning.started"]
  17086. },
  17087. "properties": {
  17088. "type": "object",
  17089. "properties": {
  17090. "timestamp": {
  17091. "type": "number"
  17092. },
  17093. "sessionID": {
  17094. "type": "string"
  17095. },
  17096. "reasoningID": {
  17097. "type": "string"
  17098. }
  17099. },
  17100. "required": ["timestamp", "sessionID", "reasoningID"],
  17101. "additionalProperties": false
  17102. }
  17103. },
  17104. "required": ["id", "type", "properties"],
  17105. "additionalProperties": false
  17106. },
  17107. "EventSessionNextReasoningDelta": {
  17108. "type": "object",
  17109. "properties": {
  17110. "id": {
  17111. "type": "string"
  17112. },
  17113. "type": {
  17114. "type": "string",
  17115. "enum": ["session.next.reasoning.delta"]
  17116. },
  17117. "properties": {
  17118. "type": "object",
  17119. "properties": {
  17120. "timestamp": {
  17121. "type": "number"
  17122. },
  17123. "sessionID": {
  17124. "type": "string"
  17125. },
  17126. "reasoningID": {
  17127. "type": "string"
  17128. },
  17129. "delta": {
  17130. "type": "string"
  17131. }
  17132. },
  17133. "required": ["timestamp", "sessionID", "reasoningID", "delta"],
  17134. "additionalProperties": false
  17135. }
  17136. },
  17137. "required": ["id", "type", "properties"],
  17138. "additionalProperties": false
  17139. },
  17140. "EventSessionNextReasoningEnded": {
  17141. "type": "object",
  17142. "properties": {
  17143. "id": {
  17144. "type": "string"
  17145. },
  17146. "type": {
  17147. "type": "string",
  17148. "enum": ["session.next.reasoning.ended"]
  17149. },
  17150. "properties": {
  17151. "type": "object",
  17152. "properties": {
  17153. "timestamp": {
  17154. "type": "number"
  17155. },
  17156. "sessionID": {
  17157. "type": "string"
  17158. },
  17159. "reasoningID": {
  17160. "type": "string"
  17161. },
  17162. "text": {
  17163. "type": "string"
  17164. }
  17165. },
  17166. "required": ["timestamp", "sessionID", "reasoningID", "text"],
  17167. "additionalProperties": false
  17168. }
  17169. },
  17170. "required": ["id", "type", "properties"],
  17171. "additionalProperties": false
  17172. },
  17173. "EventSessionNextToolInputStarted": {
  17174. "type": "object",
  17175. "properties": {
  17176. "id": {
  17177. "type": "string"
  17178. },
  17179. "type": {
  17180. "type": "string",
  17181. "enum": ["session.next.tool.input.started"]
  17182. },
  17183. "properties": {
  17184. "type": "object",
  17185. "properties": {
  17186. "timestamp": {
  17187. "type": "number"
  17188. },
  17189. "sessionID": {
  17190. "type": "string"
  17191. },
  17192. "callID": {
  17193. "type": "string"
  17194. },
  17195. "name": {
  17196. "type": "string"
  17197. }
  17198. },
  17199. "required": ["timestamp", "sessionID", "callID", "name"],
  17200. "additionalProperties": false
  17201. }
  17202. },
  17203. "required": ["id", "type", "properties"],
  17204. "additionalProperties": false
  17205. },
  17206. "EventSessionNextToolInputDelta": {
  17207. "type": "object",
  17208. "properties": {
  17209. "id": {
  17210. "type": "string"
  17211. },
  17212. "type": {
  17213. "type": "string",
  17214. "enum": ["session.next.tool.input.delta"]
  17215. },
  17216. "properties": {
  17217. "type": "object",
  17218. "properties": {
  17219. "timestamp": {
  17220. "type": "number"
  17221. },
  17222. "sessionID": {
  17223. "type": "string"
  17224. },
  17225. "callID": {
  17226. "type": "string"
  17227. },
  17228. "delta": {
  17229. "type": "string"
  17230. }
  17231. },
  17232. "required": ["timestamp", "sessionID", "callID", "delta"],
  17233. "additionalProperties": false
  17234. }
  17235. },
  17236. "required": ["id", "type", "properties"],
  17237. "additionalProperties": false
  17238. },
  17239. "EventSessionNextToolInputEnded": {
  17240. "type": "object",
  17241. "properties": {
  17242. "id": {
  17243. "type": "string"
  17244. },
  17245. "type": {
  17246. "type": "string",
  17247. "enum": ["session.next.tool.input.ended"]
  17248. },
  17249. "properties": {
  17250. "type": "object",
  17251. "properties": {
  17252. "timestamp": {
  17253. "type": "number"
  17254. },
  17255. "sessionID": {
  17256. "type": "string"
  17257. },
  17258. "callID": {
  17259. "type": "string"
  17260. },
  17261. "text": {
  17262. "type": "string"
  17263. }
  17264. },
  17265. "required": ["timestamp", "sessionID", "callID", "text"],
  17266. "additionalProperties": false
  17267. }
  17268. },
  17269. "required": ["id", "type", "properties"],
  17270. "additionalProperties": false
  17271. },
  17272. "EventSessionNextToolCalled": {
  17273. "type": "object",
  17274. "properties": {
  17275. "id": {
  17276. "type": "string"
  17277. },
  17278. "type": {
  17279. "type": "string",
  17280. "enum": ["session.next.tool.called"]
  17281. },
  17282. "properties": {
  17283. "type": "object",
  17284. "properties": {
  17285. "timestamp": {
  17286. "type": "number"
  17287. },
  17288. "sessionID": {
  17289. "type": "string"
  17290. },
  17291. "callID": {
  17292. "type": "string"
  17293. },
  17294. "tool": {
  17295. "type": "string"
  17296. },
  17297. "input": {
  17298. "type": "object"
  17299. },
  17300. "provider": {
  17301. "type": "object",
  17302. "properties": {
  17303. "executed": {
  17304. "type": "boolean"
  17305. },
  17306. "metadata": {
  17307. "type": "object"
  17308. }
  17309. },
  17310. "required": ["executed"],
  17311. "additionalProperties": false
  17312. }
  17313. },
  17314. "required": ["timestamp", "sessionID", "callID", "tool", "input", "provider"],
  17315. "additionalProperties": false
  17316. }
  17317. },
  17318. "required": ["id", "type", "properties"],
  17319. "additionalProperties": false
  17320. },
  17321. "ToolTextContent": {
  17322. "type": "object",
  17323. "properties": {
  17324. "type": {
  17325. "type": "string",
  17326. "enum": ["text"]
  17327. },
  17328. "text": {
  17329. "type": "string"
  17330. }
  17331. },
  17332. "required": ["type", "text"],
  17333. "additionalProperties": false
  17334. },
  17335. "ToolFileContent": {
  17336. "type": "object",
  17337. "properties": {
  17338. "type": {
  17339. "type": "string",
  17340. "enum": ["file"]
  17341. },
  17342. "uri": {
  17343. "type": "string"
  17344. },
  17345. "mime": {
  17346. "type": "string"
  17347. },
  17348. "name": {
  17349. "type": "string"
  17350. }
  17351. },
  17352. "required": ["type", "uri", "mime"],
  17353. "additionalProperties": false
  17354. },
  17355. "EventSessionNextToolProgress": {
  17356. "type": "object",
  17357. "properties": {
  17358. "id": {
  17359. "type": "string"
  17360. },
  17361. "type": {
  17362. "type": "string",
  17363. "enum": ["session.next.tool.progress"]
  17364. },
  17365. "properties": {
  17366. "type": "object",
  17367. "properties": {
  17368. "timestamp": {
  17369. "type": "number"
  17370. },
  17371. "sessionID": {
  17372. "type": "string"
  17373. },
  17374. "callID": {
  17375. "type": "string"
  17376. },
  17377. "structured": {
  17378. "type": "object"
  17379. },
  17380. "content": {
  17381. "type": "array",
  17382. "items": {
  17383. "anyOf": [
  17384. {
  17385. "$ref": "#/components/schemas/ToolTextContent"
  17386. },
  17387. {
  17388. "$ref": "#/components/schemas/ToolFileContent"
  17389. }
  17390. ]
  17391. }
  17392. }
  17393. },
  17394. "required": ["timestamp", "sessionID", "callID", "structured", "content"],
  17395. "additionalProperties": false
  17396. }
  17397. },
  17398. "required": ["id", "type", "properties"],
  17399. "additionalProperties": false
  17400. },
  17401. "EventSessionNextToolSuccess": {
  17402. "type": "object",
  17403. "properties": {
  17404. "id": {
  17405. "type": "string"
  17406. },
  17407. "type": {
  17408. "type": "string",
  17409. "enum": ["session.next.tool.success"]
  17410. },
  17411. "properties": {
  17412. "type": "object",
  17413. "properties": {
  17414. "timestamp": {
  17415. "type": "number"
  17416. },
  17417. "sessionID": {
  17418. "type": "string"
  17419. },
  17420. "callID": {
  17421. "type": "string"
  17422. },
  17423. "structured": {
  17424. "type": "object"
  17425. },
  17426. "content": {
  17427. "type": "array",
  17428. "items": {
  17429. "anyOf": [
  17430. {
  17431. "$ref": "#/components/schemas/ToolTextContent"
  17432. },
  17433. {
  17434. "$ref": "#/components/schemas/ToolFileContent"
  17435. }
  17436. ]
  17437. }
  17438. },
  17439. "provider": {
  17440. "type": "object",
  17441. "properties": {
  17442. "executed": {
  17443. "type": "boolean"
  17444. },
  17445. "metadata": {
  17446. "type": "object"
  17447. }
  17448. },
  17449. "required": ["executed"],
  17450. "additionalProperties": false
  17451. }
  17452. },
  17453. "required": ["timestamp", "sessionID", "callID", "structured", "content", "provider"],
  17454. "additionalProperties": false
  17455. }
  17456. },
  17457. "required": ["id", "type", "properties"],
  17458. "additionalProperties": false
  17459. },
  17460. "EventSessionNextToolFailed": {
  17461. "type": "object",
  17462. "properties": {
  17463. "id": {
  17464. "type": "string"
  17465. },
  17466. "type": {
  17467. "type": "string",
  17468. "enum": ["session.next.tool.failed"]
  17469. },
  17470. "properties": {
  17471. "type": "object",
  17472. "properties": {
  17473. "timestamp": {
  17474. "type": "number"
  17475. },
  17476. "sessionID": {
  17477. "type": "string"
  17478. },
  17479. "callID": {
  17480. "type": "string"
  17481. },
  17482. "error": {
  17483. "$ref": "#/components/schemas/SessionErrorUnknown"
  17484. },
  17485. "provider": {
  17486. "type": "object",
  17487. "properties": {
  17488. "executed": {
  17489. "type": "boolean"
  17490. },
  17491. "metadata": {
  17492. "type": "object"
  17493. }
  17494. },
  17495. "required": ["executed"],
  17496. "additionalProperties": false
  17497. }
  17498. },
  17499. "required": ["timestamp", "sessionID", "callID", "error", "provider"],
  17500. "additionalProperties": false
  17501. }
  17502. },
  17503. "required": ["id", "type", "properties"],
  17504. "additionalProperties": false
  17505. },
  17506. "SessionNextRetry_error": {
  17507. "type": "object",
  17508. "properties": {
  17509. "message": {
  17510. "type": "string"
  17511. },
  17512. "statusCode": {
  17513. "type": "integer",
  17514. "minimum": 0
  17515. },
  17516. "isRetryable": {
  17517. "type": "boolean"
  17518. },
  17519. "responseHeaders": {
  17520. "type": "object",
  17521. "additionalProperties": {
  17522. "type": "string"
  17523. }
  17524. },
  17525. "responseBody": {
  17526. "type": "string"
  17527. },
  17528. "metadata": {
  17529. "type": "object",
  17530. "additionalProperties": {
  17531. "type": "string"
  17532. }
  17533. }
  17534. },
  17535. "required": ["message", "isRetryable"],
  17536. "additionalProperties": false
  17537. },
  17538. "EventSessionNextRetried": {
  17539. "type": "object",
  17540. "properties": {
  17541. "id": {
  17542. "type": "string"
  17543. },
  17544. "type": {
  17545. "type": "string",
  17546. "enum": ["session.next.retried"]
  17547. },
  17548. "properties": {
  17549. "type": "object",
  17550. "properties": {
  17551. "timestamp": {
  17552. "type": "number"
  17553. },
  17554. "sessionID": {
  17555. "type": "string"
  17556. },
  17557. "attempt": {
  17558. "type": "integer",
  17559. "minimum": 0
  17560. },
  17561. "error": {
  17562. "$ref": "#/components/schemas/SessionNextRetry_error"
  17563. }
  17564. },
  17565. "required": ["timestamp", "sessionID", "attempt", "error"],
  17566. "additionalProperties": false
  17567. }
  17568. },
  17569. "required": ["id", "type", "properties"],
  17570. "additionalProperties": false
  17571. },
  17572. "EventSessionNextCompactionStarted": {
  17573. "type": "object",
  17574. "properties": {
  17575. "id": {
  17576. "type": "string"
  17577. },
  17578. "type": {
  17579. "type": "string",
  17580. "enum": ["session.next.compaction.started"]
  17581. },
  17582. "properties": {
  17583. "type": "object",
  17584. "properties": {
  17585. "timestamp": {
  17586. "type": "number"
  17587. },
  17588. "sessionID": {
  17589. "type": "string"
  17590. },
  17591. "reason": {
  17592. "type": "string",
  17593. "enum": ["auto", "manual"]
  17594. }
  17595. },
  17596. "required": ["timestamp", "sessionID", "reason"],
  17597. "additionalProperties": false
  17598. }
  17599. },
  17600. "required": ["id", "type", "properties"],
  17601. "additionalProperties": false
  17602. },
  17603. "EventSessionNextCompactionDelta": {
  17604. "type": "object",
  17605. "properties": {
  17606. "id": {
  17607. "type": "string"
  17608. },
  17609. "type": {
  17610. "type": "string",
  17611. "enum": ["session.next.compaction.delta"]
  17612. },
  17613. "properties": {
  17614. "type": "object",
  17615. "properties": {
  17616. "timestamp": {
  17617. "type": "number"
  17618. },
  17619. "sessionID": {
  17620. "type": "string"
  17621. },
  17622. "text": {
  17623. "type": "string"
  17624. }
  17625. },
  17626. "required": ["timestamp", "sessionID", "text"],
  17627. "additionalProperties": false
  17628. }
  17629. },
  17630. "required": ["id", "type", "properties"],
  17631. "additionalProperties": false
  17632. },
  17633. "EventSessionNextCompactionEnded": {
  17634. "type": "object",
  17635. "properties": {
  17636. "id": {
  17637. "type": "string"
  17638. },
  17639. "type": {
  17640. "type": "string",
  17641. "enum": ["session.next.compaction.ended"]
  17642. },
  17643. "properties": {
  17644. "type": "object",
  17645. "properties": {
  17646. "timestamp": {
  17647. "type": "number"
  17648. },
  17649. "sessionID": {
  17650. "type": "string"
  17651. },
  17652. "text": {
  17653. "type": "string"
  17654. },
  17655. "include": {
  17656. "type": "string"
  17657. }
  17658. },
  17659. "required": ["timestamp", "sessionID", "text"],
  17660. "additionalProperties": false
  17661. }
  17662. },
  17663. "required": ["id", "type", "properties"],
  17664. "additionalProperties": false
  17665. },
  17666. "EventServerConnected": {
  17667. "type": "object",
  17668. "properties": {
  17669. "id": {
  17670. "type": "string"
  17671. },
  17672. "type": {
  17673. "type": "string",
  17674. "enum": ["server.connected"]
  17675. },
  17676. "properties": {
  17677. "type": "object",
  17678. "properties": {}
  17679. }
  17680. },
  17681. "required": ["id", "type", "properties"],
  17682. "additionalProperties": false
  17683. },
  17684. "EventGlobalDisposed": {
  17685. "type": "object",
  17686. "properties": {
  17687. "id": {
  17688. "type": "string"
  17689. },
  17690. "type": {
  17691. "type": "string",
  17692. "enum": ["global.disposed"]
  17693. },
  17694. "properties": {
  17695. "type": "object",
  17696. "properties": {}
  17697. }
  17698. },
  17699. "required": ["id", "type", "properties"],
  17700. "additionalProperties": false
  17701. },
  17702. "SessionInfo": {
  17703. "type": "object",
  17704. "properties": {
  17705. "id": {
  17706. "type": "string"
  17707. },
  17708. "parentID": {
  17709. "type": "string"
  17710. },
  17711. "projectID": {
  17712. "type": "string"
  17713. },
  17714. "workspaceID": {
  17715. "type": "string"
  17716. },
  17717. "path": {
  17718. "type": "string"
  17719. },
  17720. "agent": {
  17721. "type": "string"
  17722. },
  17723. "model": {
  17724. "type": "object",
  17725. "properties": {
  17726. "id": {
  17727. "type": "string"
  17728. },
  17729. "providerID": {
  17730. "type": "string"
  17731. },
  17732. "variant": {
  17733. "type": "string"
  17734. }
  17735. },
  17736. "required": ["id", "providerID", "variant"],
  17737. "additionalProperties": false
  17738. },
  17739. "time": {
  17740. "type": "object",
  17741. "properties": {
  17742. "created": {
  17743. "type": "number"
  17744. },
  17745. "updated": {
  17746. "type": "number"
  17747. },
  17748. "archived": {
  17749. "type": "number"
  17750. }
  17751. },
  17752. "required": ["created", "updated"],
  17753. "additionalProperties": false
  17754. },
  17755. "title": {
  17756. "type": "string"
  17757. }
  17758. },
  17759. "required": ["id", "projectID", "time", "title"],
  17760. "additionalProperties": false
  17761. },
  17762. "SessionDelivery": {
  17763. "type": "string",
  17764. "enum": ["immediate", "deferred"]
  17765. },
  17766. "SessionMessageAgentSwitched": {
  17767. "type": "object",
  17768. "properties": {
  17769. "id": {
  17770. "type": "string"
  17771. },
  17772. "metadata": {
  17773. "type": "object"
  17774. },
  17775. "time": {
  17776. "type": "object",
  17777. "properties": {
  17778. "created": {
  17779. "type": "number"
  17780. }
  17781. },
  17782. "required": ["created"],
  17783. "additionalProperties": false
  17784. },
  17785. "type": {
  17786. "type": "string",
  17787. "enum": ["agent-switched"]
  17788. },
  17789. "agent": {
  17790. "type": "string"
  17791. }
  17792. },
  17793. "required": ["id", "time", "type", "agent"],
  17794. "additionalProperties": false
  17795. },
  17796. "SessionMessageModelSwitched": {
  17797. "type": "object",
  17798. "properties": {
  17799. "id": {
  17800. "type": "string"
  17801. },
  17802. "metadata": {
  17803. "type": "object"
  17804. },
  17805. "time": {
  17806. "type": "object",
  17807. "properties": {
  17808. "created": {
  17809. "type": "number"
  17810. }
  17811. },
  17812. "required": ["created"],
  17813. "additionalProperties": false
  17814. },
  17815. "type": {
  17816. "type": "string",
  17817. "enum": ["model-switched"]
  17818. },
  17819. "model": {
  17820. "type": "object",
  17821. "properties": {
  17822. "id": {
  17823. "type": "string"
  17824. },
  17825. "providerID": {
  17826. "type": "string"
  17827. },
  17828. "variant": {
  17829. "type": "string"
  17830. }
  17831. },
  17832. "required": ["id", "providerID", "variant"],
  17833. "additionalProperties": false
  17834. }
  17835. },
  17836. "required": ["id", "time", "type", "model"],
  17837. "additionalProperties": false
  17838. },
  17839. "SessionMessageUser": {
  17840. "type": "object",
  17841. "properties": {
  17842. "id": {
  17843. "type": "string"
  17844. },
  17845. "metadata": {
  17846. "type": "object"
  17847. },
  17848. "time": {
  17849. "type": "object",
  17850. "properties": {
  17851. "created": {
  17852. "type": "number"
  17853. }
  17854. },
  17855. "required": ["created"],
  17856. "additionalProperties": false
  17857. },
  17858. "text": {
  17859. "type": "string"
  17860. },
  17861. "files": {
  17862. "type": "array",
  17863. "items": {
  17864. "$ref": "#/components/schemas/PromptFileAttachment"
  17865. }
  17866. },
  17867. "agents": {
  17868. "type": "array",
  17869. "items": {
  17870. "$ref": "#/components/schemas/PromptAgentAttachment"
  17871. }
  17872. },
  17873. "type": {
  17874. "type": "string",
  17875. "enum": ["user"]
  17876. }
  17877. },
  17878. "required": ["id", "time", "text", "type"],
  17879. "additionalProperties": false
  17880. },
  17881. "SessionMessageSynthetic": {
  17882. "type": "object",
  17883. "properties": {
  17884. "id": {
  17885. "type": "string"
  17886. },
  17887. "metadata": {
  17888. "type": "object"
  17889. },
  17890. "time": {
  17891. "type": "object",
  17892. "properties": {
  17893. "created": {
  17894. "type": "number"
  17895. }
  17896. },
  17897. "required": ["created"],
  17898. "additionalProperties": false
  17899. },
  17900. "sessionID": {
  17901. "type": "string"
  17902. },
  17903. "text": {
  17904. "type": "string"
  17905. },
  17906. "type": {
  17907. "type": "string",
  17908. "enum": ["synthetic"]
  17909. }
  17910. },
  17911. "required": ["id", "time", "sessionID", "text", "type"],
  17912. "additionalProperties": false
  17913. },
  17914. "SessionMessageShell": {
  17915. "type": "object",
  17916. "properties": {
  17917. "id": {
  17918. "type": "string"
  17919. },
  17920. "metadata": {
  17921. "type": "object"
  17922. },
  17923. "time": {
  17924. "type": "object",
  17925. "properties": {
  17926. "created": {
  17927. "type": "number"
  17928. },
  17929. "completed": {
  17930. "type": "number"
  17931. }
  17932. },
  17933. "required": ["created"],
  17934. "additionalProperties": false
  17935. },
  17936. "type": {
  17937. "type": "string",
  17938. "enum": ["shell"]
  17939. },
  17940. "callID": {
  17941. "type": "string"
  17942. },
  17943. "command": {
  17944. "type": "string"
  17945. },
  17946. "output": {
  17947. "type": "string"
  17948. }
  17949. },
  17950. "required": ["id", "time", "type", "callID", "command", "output"],
  17951. "additionalProperties": false
  17952. },
  17953. "SessionMessageAssistantText": {
  17954. "type": "object",
  17955. "properties": {
  17956. "type": {
  17957. "type": "string",
  17958. "enum": ["text"]
  17959. },
  17960. "text": {
  17961. "type": "string"
  17962. }
  17963. },
  17964. "required": ["type", "text"],
  17965. "additionalProperties": false
  17966. },
  17967. "SessionMessageAssistantReasoning": {
  17968. "type": "object",
  17969. "properties": {
  17970. "type": {
  17971. "type": "string",
  17972. "enum": ["reasoning"]
  17973. },
  17974. "id": {
  17975. "type": "string"
  17976. },
  17977. "text": {
  17978. "type": "string"
  17979. }
  17980. },
  17981. "required": ["type", "id", "text"],
  17982. "additionalProperties": false
  17983. },
  17984. "SessionMessageToolStatePending": {
  17985. "type": "object",
  17986. "properties": {
  17987. "status": {
  17988. "type": "string",
  17989. "enum": ["pending"]
  17990. },
  17991. "input": {
  17992. "type": "string"
  17993. }
  17994. },
  17995. "required": ["status", "input"],
  17996. "additionalProperties": false
  17997. },
  17998. "SessionMessageToolStateRunning": {
  17999. "type": "object",
  18000. "properties": {
  18001. "status": {
  18002. "type": "string",
  18003. "enum": ["running"]
  18004. },
  18005. "input": {
  18006. "type": "object"
  18007. },
  18008. "structured": {
  18009. "type": "object"
  18010. },
  18011. "content": {
  18012. "type": "array",
  18013. "items": {
  18014. "anyOf": [
  18015. {
  18016. "$ref": "#/components/schemas/ToolTextContent"
  18017. },
  18018. {
  18019. "$ref": "#/components/schemas/ToolFileContent"
  18020. }
  18021. ]
  18022. }
  18023. }
  18024. },
  18025. "required": ["status", "input", "structured", "content"],
  18026. "additionalProperties": false
  18027. },
  18028. "SessionMessageToolStateCompleted": {
  18029. "type": "object",
  18030. "properties": {
  18031. "status": {
  18032. "type": "string",
  18033. "enum": ["completed"]
  18034. },
  18035. "input": {
  18036. "type": "object"
  18037. },
  18038. "attachments": {
  18039. "type": "array",
  18040. "items": {
  18041. "$ref": "#/components/schemas/PromptFileAttachment"
  18042. }
  18043. },
  18044. "content": {
  18045. "type": "array",
  18046. "items": {
  18047. "anyOf": [
  18048. {
  18049. "$ref": "#/components/schemas/ToolTextContent"
  18050. },
  18051. {
  18052. "$ref": "#/components/schemas/ToolFileContent"
  18053. }
  18054. ]
  18055. }
  18056. },
  18057. "structured": {
  18058. "type": "object"
  18059. }
  18060. },
  18061. "required": ["status", "input", "content", "structured"],
  18062. "additionalProperties": false
  18063. },
  18064. "SessionMessageToolStateError": {
  18065. "type": "object",
  18066. "properties": {
  18067. "status": {
  18068. "type": "string",
  18069. "enum": ["error"]
  18070. },
  18071. "input": {
  18072. "type": "object"
  18073. },
  18074. "content": {
  18075. "type": "array",
  18076. "items": {
  18077. "anyOf": [
  18078. {
  18079. "$ref": "#/components/schemas/ToolTextContent"
  18080. },
  18081. {
  18082. "$ref": "#/components/schemas/ToolFileContent"
  18083. }
  18084. ]
  18085. }
  18086. },
  18087. "structured": {
  18088. "type": "object"
  18089. },
  18090. "error": {
  18091. "$ref": "#/components/schemas/SessionErrorUnknown"
  18092. }
  18093. },
  18094. "required": ["status", "input", "content", "structured", "error"],
  18095. "additionalProperties": false
  18096. },
  18097. "SessionMessageAssistantTool": {
  18098. "type": "object",
  18099. "properties": {
  18100. "type": {
  18101. "type": "string",
  18102. "enum": ["tool"]
  18103. },
  18104. "id": {
  18105. "type": "string"
  18106. },
  18107. "name": {
  18108. "type": "string"
  18109. },
  18110. "provider": {
  18111. "type": "object",
  18112. "properties": {
  18113. "executed": {
  18114. "type": "boolean"
  18115. },
  18116. "metadata": {
  18117. "type": "object"
  18118. }
  18119. },
  18120. "required": ["executed"],
  18121. "additionalProperties": false
  18122. },
  18123. "state": {
  18124. "anyOf": [
  18125. {
  18126. "$ref": "#/components/schemas/SessionMessageToolStatePending"
  18127. },
  18128. {
  18129. "$ref": "#/components/schemas/SessionMessageToolStateRunning"
  18130. },
  18131. {
  18132. "$ref": "#/components/schemas/SessionMessageToolStateCompleted"
  18133. },
  18134. {
  18135. "$ref": "#/components/schemas/SessionMessageToolStateError"
  18136. }
  18137. ]
  18138. },
  18139. "time": {
  18140. "type": "object",
  18141. "properties": {
  18142. "created": {
  18143. "type": "number"
  18144. },
  18145. "ran": {
  18146. "type": "number"
  18147. },
  18148. "completed": {
  18149. "type": "number"
  18150. },
  18151. "pruned": {
  18152. "type": "number"
  18153. }
  18154. },
  18155. "required": ["created"],
  18156. "additionalProperties": false
  18157. }
  18158. },
  18159. "required": ["type", "id", "name", "state", "time"],
  18160. "additionalProperties": false
  18161. },
  18162. "SessionMessageAssistant": {
  18163. "type": "object",
  18164. "properties": {
  18165. "id": {
  18166. "type": "string"
  18167. },
  18168. "metadata": {
  18169. "type": "object"
  18170. },
  18171. "time": {
  18172. "type": "object",
  18173. "properties": {
  18174. "created": {
  18175. "type": "number"
  18176. },
  18177. "completed": {
  18178. "type": "number"
  18179. }
  18180. },
  18181. "required": ["created"],
  18182. "additionalProperties": false
  18183. },
  18184. "type": {
  18185. "type": "string",
  18186. "enum": ["assistant"]
  18187. },
  18188. "agent": {
  18189. "type": "string"
  18190. },
  18191. "model": {
  18192. "type": "object",
  18193. "properties": {
  18194. "id": {
  18195. "type": "string"
  18196. },
  18197. "providerID": {
  18198. "type": "string"
  18199. },
  18200. "variant": {
  18201. "type": "string"
  18202. }
  18203. },
  18204. "required": ["id", "providerID", "variant"],
  18205. "additionalProperties": false
  18206. },
  18207. "content": {
  18208. "type": "array",
  18209. "items": {
  18210. "anyOf": [
  18211. {
  18212. "$ref": "#/components/schemas/SessionMessageAssistantText"
  18213. },
  18214. {
  18215. "$ref": "#/components/schemas/SessionMessageAssistantReasoning"
  18216. },
  18217. {
  18218. "$ref": "#/components/schemas/SessionMessageAssistantTool"
  18219. }
  18220. ]
  18221. }
  18222. },
  18223. "snapshot": {
  18224. "type": "object",
  18225. "properties": {
  18226. "start": {
  18227. "type": "string"
  18228. },
  18229. "end": {
  18230. "type": "string"
  18231. }
  18232. },
  18233. "additionalProperties": false
  18234. },
  18235. "finish": {
  18236. "type": "string"
  18237. },
  18238. "cost": {
  18239. "type": "number"
  18240. },
  18241. "tokens": {
  18242. "type": "object",
  18243. "properties": {
  18244. "input": {
  18245. "type": "number"
  18246. },
  18247. "output": {
  18248. "type": "number"
  18249. },
  18250. "reasoning": {
  18251. "type": "number"
  18252. },
  18253. "cache": {
  18254. "type": "object",
  18255. "properties": {
  18256. "read": {
  18257. "type": "number"
  18258. },
  18259. "write": {
  18260. "type": "number"
  18261. }
  18262. },
  18263. "required": ["read", "write"],
  18264. "additionalProperties": false
  18265. }
  18266. },
  18267. "required": ["input", "output", "reasoning", "cache"],
  18268. "additionalProperties": false
  18269. },
  18270. "error": {
  18271. "$ref": "#/components/schemas/SessionErrorUnknown"
  18272. }
  18273. },
  18274. "required": ["id", "time", "type", "agent", "model", "content"],
  18275. "additionalProperties": false
  18276. },
  18277. "SessionMessageCompaction": {
  18278. "type": "object",
  18279. "properties": {
  18280. "type": {
  18281. "type": "string",
  18282. "enum": ["compaction"]
  18283. },
  18284. "reason": {
  18285. "type": "string",
  18286. "enum": ["auto", "manual"]
  18287. },
  18288. "summary": {
  18289. "type": "string"
  18290. },
  18291. "include": {
  18292. "type": "string"
  18293. },
  18294. "id": {
  18295. "type": "string"
  18296. },
  18297. "metadata": {
  18298. "type": "object"
  18299. },
  18300. "time": {
  18301. "type": "object",
  18302. "properties": {
  18303. "created": {
  18304. "type": "number"
  18305. }
  18306. },
  18307. "required": ["created"],
  18308. "additionalProperties": false
  18309. }
  18310. },
  18311. "required": ["type", "reason", "summary", "id", "time"],
  18312. "additionalProperties": false
  18313. },
  18314. "SessionMessage": {
  18315. "anyOf": [
  18316. {
  18317. "$ref": "#/components/schemas/SessionMessageAgentSwitched"
  18318. },
  18319. {
  18320. "$ref": "#/components/schemas/SessionMessageModelSwitched"
  18321. },
  18322. {
  18323. "$ref": "#/components/schemas/SessionMessageUser"
  18324. },
  18325. {
  18326. "$ref": "#/components/schemas/SessionMessageSynthetic"
  18327. },
  18328. {
  18329. "$ref": "#/components/schemas/SessionMessageShell"
  18330. },
  18331. {
  18332. "$ref": "#/components/schemas/SessionMessageAssistant"
  18333. },
  18334. {
  18335. "$ref": "#/components/schemas/SessionMessageCompaction"
  18336. }
  18337. ]
  18338. },
  18339. "EventTuiToastShow1": {
  18340. "type": "object",
  18341. "properties": {
  18342. "id": {
  18343. "type": "string"
  18344. },
  18345. "type": {
  18346. "type": "string",
  18347. "enum": ["tui.toast.show"]
  18348. },
  18349. "properties": {
  18350. "type": "object",
  18351. "properties": {
  18352. "title": {
  18353. "type": "string"
  18354. },
  18355. "message": {
  18356. "type": "string"
  18357. },
  18358. "variant": {
  18359. "type": "string",
  18360. "enum": ["info", "success", "warning", "error"]
  18361. },
  18362. "duration": {
  18363. "type": "integer",
  18364. "exclusiveMinimum": 0
  18365. }
  18366. },
  18367. "required": ["message", "variant"],
  18368. "additionalProperties": false
  18369. }
  18370. },
  18371. "required": ["id", "type", "properties"],
  18372. "additionalProperties": false
  18373. },
  18374. "BadRequestError": {
  18375. "type": "object",
  18376. "required": ["data", "errors", "success"],
  18377. "properties": {
  18378. "data": {},
  18379. "errors": {
  18380. "type": "array",
  18381. "items": {
  18382. "type": "object",
  18383. "additionalProperties": {}
  18384. }
  18385. },
  18386. "success": {
  18387. "type": "boolean",
  18388. "enum": [false]
  18389. }
  18390. }
  18391. }
  18392. }
  18393. },
  18394. "security": [],
  18395. "tags": [
  18396. {
  18397. "name": "control",
  18398. "description": "Control plane routes."
  18399. },
  18400. {
  18401. "name": "global",
  18402. "description": "Global server routes."
  18403. },
  18404. {
  18405. "name": "event",
  18406. "description": "Instance event stream route."
  18407. },
  18408. {
  18409. "name": "config",
  18410. "description": "Experimental HttpApi config routes."
  18411. },
  18412. {
  18413. "name": "experimental",
  18414. "description": "Experimental HttpApi read-only routes."
  18415. },
  18416. {
  18417. "name": "file",
  18418. "description": "Experimental HttpApi file routes."
  18419. },
  18420. {
  18421. "name": "instance",
  18422. "description": "Experimental HttpApi instance read routes."
  18423. },
  18424. {
  18425. "name": "mcp",
  18426. "description": "Experimental HttpApi MCP routes."
  18427. },
  18428. {
  18429. "name": "project",
  18430. "description": "Experimental HttpApi project routes."
  18431. },
  18432. {
  18433. "name": "pty",
  18434. "description": "Experimental HttpApi PTY routes."
  18435. },
  18436. {
  18437. "name": "question",
  18438. "description": "Question routes."
  18439. },
  18440. {
  18441. "name": "permission",
  18442. "description": "Experimental HttpApi permission routes."
  18443. },
  18444. {
  18445. "name": "provider",
  18446. "description": "Experimental HttpApi provider routes."
  18447. },
  18448. {
  18449. "name": "session",
  18450. "description": "Experimental HttpApi session routes."
  18451. },
  18452. {
  18453. "name": "sync",
  18454. "description": "Experimental HttpApi sync routes."
  18455. },
  18456. {
  18457. "name": "v2",
  18458. "description": "Experimental v2 routes."
  18459. },
  18460. {
  18461. "name": "v2 messages",
  18462. "description": "Experimental v2 message routes."
  18463. },
  18464. {
  18465. "name": "tui",
  18466. "description": "Experimental HttpApi TUI routes."
  18467. },
  18468. {
  18469. "name": "workspace",
  18470. "description": "Experimental HttpApi workspace routes."
  18471. },
  18472. {
  18473. "name": "pty",
  18474. "description": "PTY websocket route."
  18475. }
  18476. ]
  18477. }