openapi.json 373 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694
  1. {
  2. "openapi": "3.1.1",
  3. "info": {
  4. "title": "opencode",
  5. "description": "opencode api",
  6. "version": "1.0.0"
  7. },
  8. "paths": {
  9. "/global/health": {
  10. "get": {
  11. "operationId": "global.health",
  12. "summary": "Get health",
  13. "description": "Get health information about the OpenCode server.",
  14. "responses": {
  15. "200": {
  16. "description": "Health information",
  17. "content": {
  18. "application/json": {
  19. "schema": {
  20. "type": "object",
  21. "properties": {
  22. "healthy": {
  23. "type": "boolean",
  24. "const": true
  25. },
  26. "version": {
  27. "type": "string"
  28. }
  29. },
  30. "required": ["healthy", "version"]
  31. }
  32. }
  33. }
  34. }
  35. },
  36. "x-codeSamples": [
  37. {
  38. "lang": "js",
  39. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.health({\n ...\n})"
  40. }
  41. ]
  42. }
  43. },
  44. "/global/event": {
  45. "get": {
  46. "operationId": "global.event",
  47. "summary": "Get global events",
  48. "description": "Subscribe to global events from the OpenCode system using server-sent events.",
  49. "responses": {
  50. "200": {
  51. "description": "Event stream",
  52. "content": {
  53. "text/event-stream": {
  54. "schema": {
  55. "$ref": "#/components/schemas/GlobalEvent"
  56. }
  57. }
  58. }
  59. }
  60. },
  61. "x-codeSamples": [
  62. {
  63. "lang": "js",
  64. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.event({\n ...\n})"
  65. }
  66. ]
  67. }
  68. },
  69. "/global/config": {
  70. "get": {
  71. "operationId": "global.config.get",
  72. "summary": "Get global configuration",
  73. "description": "Retrieve the current global OpenCode configuration settings and preferences.",
  74. "responses": {
  75. "200": {
  76. "description": "Get global config info",
  77. "content": {
  78. "application/json": {
  79. "schema": {
  80. "$ref": "#/components/schemas/Config"
  81. }
  82. }
  83. }
  84. }
  85. },
  86. "x-codeSamples": [
  87. {
  88. "lang": "js",
  89. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.config.get({\n ...\n})"
  90. }
  91. ]
  92. },
  93. "patch": {
  94. "operationId": "global.config.update",
  95. "summary": "Update global configuration",
  96. "description": "Update global OpenCode configuration settings and preferences.",
  97. "responses": {
  98. "200": {
  99. "description": "Successfully updated global config",
  100. "content": {
  101. "application/json": {
  102. "schema": {
  103. "$ref": "#/components/schemas/Config"
  104. }
  105. }
  106. }
  107. },
  108. "400": {
  109. "description": "Bad request",
  110. "content": {
  111. "application/json": {
  112. "schema": {
  113. "$ref": "#/components/schemas/BadRequestError"
  114. }
  115. }
  116. }
  117. }
  118. },
  119. "requestBody": {
  120. "content": {
  121. "application/json": {
  122. "schema": {
  123. "$ref": "#/components/schemas/Config"
  124. }
  125. }
  126. }
  127. },
  128. "x-codeSamples": [
  129. {
  130. "lang": "js",
  131. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.config.update({\n ...\n})"
  132. }
  133. ]
  134. }
  135. },
  136. "/global/dispose": {
  137. "post": {
  138. "operationId": "global.dispose",
  139. "summary": "Dispose instance",
  140. "description": "Clean up and dispose all OpenCode instances, releasing all resources.",
  141. "responses": {
  142. "200": {
  143. "description": "Global disposed",
  144. "content": {
  145. "application/json": {
  146. "schema": {
  147. "type": "boolean"
  148. }
  149. }
  150. }
  151. }
  152. },
  153. "x-codeSamples": [
  154. {
  155. "lang": "js",
  156. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.dispose({\n ...\n})"
  157. }
  158. ]
  159. }
  160. },
  161. "/global/upgrade": {
  162. "post": {
  163. "operationId": "global.upgrade",
  164. "summary": "Upgrade opencode",
  165. "description": "Upgrade opencode to the specified version or latest if not specified.",
  166. "responses": {
  167. "200": {
  168. "description": "Upgrade result",
  169. "content": {
  170. "application/json": {
  171. "schema": {
  172. "anyOf": [
  173. {
  174. "type": "object",
  175. "properties": {
  176. "success": {
  177. "type": "boolean",
  178. "const": true
  179. },
  180. "version": {
  181. "type": "string"
  182. }
  183. },
  184. "required": ["success", "version"]
  185. },
  186. {
  187. "type": "object",
  188. "properties": {
  189. "success": {
  190. "type": "boolean",
  191. "const": false
  192. },
  193. "error": {
  194. "type": "string"
  195. }
  196. },
  197. "required": ["success", "error"]
  198. }
  199. ]
  200. }
  201. }
  202. }
  203. },
  204. "400": {
  205. "description": "Bad request",
  206. "content": {
  207. "application/json": {
  208. "schema": {
  209. "$ref": "#/components/schemas/BadRequestError"
  210. }
  211. }
  212. }
  213. }
  214. },
  215. "requestBody": {
  216. "content": {
  217. "application/json": {
  218. "schema": {
  219. "type": "object",
  220. "properties": {
  221. "target": {
  222. "type": "string"
  223. }
  224. }
  225. }
  226. }
  227. }
  228. },
  229. "x-codeSamples": [
  230. {
  231. "lang": "js",
  232. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.upgrade({\n ...\n})"
  233. }
  234. ]
  235. }
  236. },
  237. "/auth/{providerID}": {
  238. "put": {
  239. "operationId": "auth.set",
  240. "summary": "Set auth credentials",
  241. "description": "Set authentication credentials",
  242. "responses": {
  243. "200": {
  244. "description": "Successfully set authentication credentials",
  245. "content": {
  246. "application/json": {
  247. "schema": {
  248. "type": "boolean"
  249. }
  250. }
  251. }
  252. },
  253. "400": {
  254. "description": "Bad request",
  255. "content": {
  256. "application/json": {
  257. "schema": {
  258. "$ref": "#/components/schemas/BadRequestError"
  259. }
  260. }
  261. }
  262. }
  263. },
  264. "parameters": [
  265. {
  266. "in": "path",
  267. "name": "providerID",
  268. "schema": {
  269. "type": "string"
  270. },
  271. "required": true
  272. }
  273. ],
  274. "requestBody": {
  275. "content": {
  276. "application/json": {
  277. "schema": {
  278. "$ref": "#/components/schemas/Auth"
  279. }
  280. }
  281. }
  282. },
  283. "x-codeSamples": [
  284. {
  285. "lang": "js",
  286. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.auth.set({\n ...\n})"
  287. }
  288. ]
  289. },
  290. "delete": {
  291. "operationId": "auth.remove",
  292. "summary": "Remove auth credentials",
  293. "description": "Remove authentication credentials",
  294. "responses": {
  295. "200": {
  296. "description": "Successfully removed authentication credentials",
  297. "content": {
  298. "application/json": {
  299. "schema": {
  300. "type": "boolean"
  301. }
  302. }
  303. }
  304. },
  305. "400": {
  306. "description": "Bad request",
  307. "content": {
  308. "application/json": {
  309. "schema": {
  310. "$ref": "#/components/schemas/BadRequestError"
  311. }
  312. }
  313. }
  314. }
  315. },
  316. "parameters": [
  317. {
  318. "in": "path",
  319. "name": "providerID",
  320. "schema": {
  321. "type": "string"
  322. },
  323. "required": true
  324. }
  325. ],
  326. "x-codeSamples": [
  327. {
  328. "lang": "js",
  329. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.auth.remove({\n ...\n})"
  330. }
  331. ]
  332. }
  333. },
  334. "/log": {
  335. "post": {
  336. "operationId": "app.log",
  337. "parameters": [
  338. {
  339. "in": "query",
  340. "name": "directory",
  341. "schema": {
  342. "type": "string"
  343. }
  344. },
  345. {
  346. "in": "query",
  347. "name": "workspace",
  348. "schema": {
  349. "type": "string"
  350. }
  351. }
  352. ],
  353. "summary": "Write log",
  354. "description": "Write a log entry to the server logs with specified level and metadata.",
  355. "responses": {
  356. "200": {
  357. "description": "Log entry written successfully",
  358. "content": {
  359. "application/json": {
  360. "schema": {
  361. "type": "boolean"
  362. }
  363. }
  364. }
  365. },
  366. "400": {
  367. "description": "Bad request",
  368. "content": {
  369. "application/json": {
  370. "schema": {
  371. "$ref": "#/components/schemas/BadRequestError"
  372. }
  373. }
  374. }
  375. }
  376. },
  377. "requestBody": {
  378. "content": {
  379. "application/json": {
  380. "schema": {
  381. "type": "object",
  382. "properties": {
  383. "service": {
  384. "description": "Service name for the log entry",
  385. "type": "string"
  386. },
  387. "level": {
  388. "description": "Log level",
  389. "type": "string",
  390. "enum": ["debug", "info", "error", "warn"]
  391. },
  392. "message": {
  393. "description": "Log message",
  394. "type": "string"
  395. },
  396. "extra": {
  397. "description": "Additional metadata for the log entry",
  398. "type": "object",
  399. "propertyNames": {
  400. "type": "string"
  401. },
  402. "additionalProperties": {}
  403. }
  404. },
  405. "required": ["service", "level", "message"]
  406. }
  407. }
  408. }
  409. },
  410. "x-codeSamples": [
  411. {
  412. "lang": "js",
  413. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.app.log({\n ...\n})"
  414. }
  415. ]
  416. }
  417. },
  418. "/experimental/workspace/adaptor": {
  419. "get": {
  420. "operationId": "experimental.workspace.adaptor.list",
  421. "parameters": [
  422. {
  423. "in": "query",
  424. "name": "directory",
  425. "schema": {
  426. "type": "string"
  427. }
  428. },
  429. {
  430. "in": "query",
  431. "name": "workspace",
  432. "schema": {
  433. "type": "string"
  434. }
  435. }
  436. ],
  437. "summary": "List workspace adaptors",
  438. "description": "List all available workspace adaptors for the current project.",
  439. "responses": {
  440. "200": {
  441. "description": "Workspace adaptors",
  442. "content": {
  443. "application/json": {
  444. "schema": {
  445. "type": "array",
  446. "items": {
  447. "type": "object",
  448. "properties": {
  449. "type": {
  450. "type": "string"
  451. },
  452. "name": {
  453. "type": "string"
  454. },
  455. "description": {
  456. "type": "string"
  457. }
  458. },
  459. "required": ["type", "name", "description"]
  460. }
  461. }
  462. }
  463. }
  464. }
  465. },
  466. "x-codeSamples": [
  467. {
  468. "lang": "js",
  469. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.adaptor.list({\n ...\n})"
  470. }
  471. ]
  472. }
  473. },
  474. "/experimental/workspace": {
  475. "post": {
  476. "operationId": "experimental.workspace.create",
  477. "parameters": [
  478. {
  479. "in": "query",
  480. "name": "directory",
  481. "schema": {
  482. "type": "string"
  483. }
  484. },
  485. {
  486. "in": "query",
  487. "name": "workspace",
  488. "schema": {
  489. "type": "string"
  490. }
  491. }
  492. ],
  493. "summary": "Create workspace",
  494. "description": "Create a workspace for the current project.",
  495. "responses": {
  496. "200": {
  497. "description": "Workspace created",
  498. "content": {
  499. "application/json": {
  500. "schema": {
  501. "$ref": "#/components/schemas/Workspace"
  502. }
  503. }
  504. }
  505. },
  506. "400": {
  507. "description": "Bad request",
  508. "content": {
  509. "application/json": {
  510. "schema": {
  511. "$ref": "#/components/schemas/BadRequestError"
  512. }
  513. }
  514. }
  515. }
  516. },
  517. "requestBody": {
  518. "content": {
  519. "application/json": {
  520. "schema": {
  521. "type": "object",
  522. "properties": {
  523. "id": {
  524. "type": "string",
  525. "pattern": "^wrk.*"
  526. },
  527. "type": {
  528. "type": "string"
  529. },
  530. "branch": {
  531. "anyOf": [
  532. {
  533. "type": "string"
  534. },
  535. {
  536. "type": "null"
  537. }
  538. ]
  539. },
  540. "extra": {
  541. "anyOf": [
  542. {},
  543. {
  544. "type": "null"
  545. }
  546. ]
  547. }
  548. },
  549. "required": ["type", "branch", "extra"]
  550. }
  551. }
  552. }
  553. },
  554. "x-codeSamples": [
  555. {
  556. "lang": "js",
  557. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.create({\n ...\n})"
  558. }
  559. ]
  560. },
  561. "get": {
  562. "operationId": "experimental.workspace.list",
  563. "parameters": [
  564. {
  565. "in": "query",
  566. "name": "directory",
  567. "schema": {
  568. "type": "string"
  569. }
  570. },
  571. {
  572. "in": "query",
  573. "name": "workspace",
  574. "schema": {
  575. "type": "string"
  576. }
  577. }
  578. ],
  579. "summary": "List workspaces",
  580. "description": "List all workspaces.",
  581. "responses": {
  582. "200": {
  583. "description": "Workspaces",
  584. "content": {
  585. "application/json": {
  586. "schema": {
  587. "type": "array",
  588. "items": {
  589. "$ref": "#/components/schemas/Workspace"
  590. }
  591. }
  592. }
  593. }
  594. }
  595. },
  596. "x-codeSamples": [
  597. {
  598. "lang": "js",
  599. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.list({\n ...\n})"
  600. }
  601. ]
  602. }
  603. },
  604. "/experimental/workspace/status": {
  605. "get": {
  606. "operationId": "experimental.workspace.status",
  607. "parameters": [
  608. {
  609. "in": "query",
  610. "name": "directory",
  611. "schema": {
  612. "type": "string"
  613. }
  614. },
  615. {
  616. "in": "query",
  617. "name": "workspace",
  618. "schema": {
  619. "type": "string"
  620. }
  621. }
  622. ],
  623. "summary": "Workspace status",
  624. "description": "Get connection status for workspaces in the current project.",
  625. "responses": {
  626. "200": {
  627. "description": "Workspace status",
  628. "content": {
  629. "application/json": {
  630. "schema": {
  631. "type": "array",
  632. "items": {
  633. "type": "object",
  634. "properties": {
  635. "workspaceID": {
  636. "type": "string",
  637. "pattern": "^wrk.*"
  638. },
  639. "status": {
  640. "type": "string",
  641. "enum": ["connected", "connecting", "disconnected", "error"]
  642. }
  643. },
  644. "required": ["workspaceID", "status"]
  645. }
  646. }
  647. }
  648. }
  649. }
  650. },
  651. "x-codeSamples": [
  652. {
  653. "lang": "js",
  654. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.status({\n ...\n})"
  655. }
  656. ]
  657. }
  658. },
  659. "/experimental/workspace/{id}": {
  660. "delete": {
  661. "operationId": "experimental.workspace.remove",
  662. "parameters": [
  663. {
  664. "in": "query",
  665. "name": "directory",
  666. "schema": {
  667. "type": "string"
  668. }
  669. },
  670. {
  671. "in": "query",
  672. "name": "workspace",
  673. "schema": {
  674. "type": "string"
  675. }
  676. },
  677. {
  678. "in": "path",
  679. "name": "id",
  680. "schema": {
  681. "type": "string",
  682. "pattern": "^wrk.*"
  683. },
  684. "required": true
  685. }
  686. ],
  687. "summary": "Remove workspace",
  688. "description": "Remove an existing workspace.",
  689. "responses": {
  690. "200": {
  691. "description": "Workspace removed",
  692. "content": {
  693. "application/json": {
  694. "schema": {
  695. "$ref": "#/components/schemas/Workspace"
  696. }
  697. }
  698. }
  699. },
  700. "400": {
  701. "description": "Bad request",
  702. "content": {
  703. "application/json": {
  704. "schema": {
  705. "$ref": "#/components/schemas/BadRequestError"
  706. }
  707. }
  708. }
  709. }
  710. },
  711. "x-codeSamples": [
  712. {
  713. "lang": "js",
  714. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.remove({\n ...\n})"
  715. }
  716. ]
  717. }
  718. },
  719. "/experimental/workspace/{id}/session-restore": {
  720. "post": {
  721. "operationId": "experimental.workspace.sessionRestore",
  722. "parameters": [
  723. {
  724. "in": "query",
  725. "name": "directory",
  726. "schema": {
  727. "type": "string"
  728. }
  729. },
  730. {
  731. "in": "query",
  732. "name": "workspace",
  733. "schema": {
  734. "type": "string"
  735. }
  736. },
  737. {
  738. "in": "path",
  739. "name": "id",
  740. "schema": {
  741. "type": "string",
  742. "pattern": "^wrk.*"
  743. },
  744. "required": true
  745. }
  746. ],
  747. "summary": "Restore session into workspace",
  748. "description": "Replay a session's sync events into the target workspace in batches.",
  749. "responses": {
  750. "200": {
  751. "description": "Session replay started",
  752. "content": {
  753. "application/json": {
  754. "schema": {
  755. "type": "object",
  756. "properties": {
  757. "total": {
  758. "type": "integer",
  759. "minimum": 0,
  760. "maximum": 9007199254740991
  761. }
  762. },
  763. "required": ["total"]
  764. }
  765. }
  766. }
  767. },
  768. "400": {
  769. "description": "Bad request",
  770. "content": {
  771. "application/json": {
  772. "schema": {
  773. "$ref": "#/components/schemas/BadRequestError"
  774. }
  775. }
  776. }
  777. }
  778. },
  779. "requestBody": {
  780. "content": {
  781. "application/json": {
  782. "schema": {
  783. "type": "object",
  784. "properties": {
  785. "sessionID": {
  786. "type": "string",
  787. "pattern": "^ses.*"
  788. }
  789. },
  790. "required": ["sessionID"]
  791. }
  792. }
  793. }
  794. },
  795. "x-codeSamples": [
  796. {
  797. "lang": "js",
  798. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.sessionRestore({\n ...\n})"
  799. }
  800. ]
  801. }
  802. },
  803. "/project": {
  804. "get": {
  805. "operationId": "project.list",
  806. "parameters": [
  807. {
  808. "in": "query",
  809. "name": "directory",
  810. "schema": {
  811. "type": "string"
  812. }
  813. },
  814. {
  815. "in": "query",
  816. "name": "workspace",
  817. "schema": {
  818. "type": "string"
  819. }
  820. }
  821. ],
  822. "summary": "List all projects",
  823. "description": "Get a list of projects that have been opened with OpenCode.",
  824. "responses": {
  825. "200": {
  826. "description": "List of projects",
  827. "content": {
  828. "application/json": {
  829. "schema": {
  830. "type": "array",
  831. "items": {
  832. "$ref": "#/components/schemas/Project"
  833. }
  834. }
  835. }
  836. }
  837. }
  838. },
  839. "x-codeSamples": [
  840. {
  841. "lang": "js",
  842. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.list({\n ...\n})"
  843. }
  844. ]
  845. }
  846. },
  847. "/project/current": {
  848. "get": {
  849. "operationId": "project.current",
  850. "parameters": [
  851. {
  852. "in": "query",
  853. "name": "directory",
  854. "schema": {
  855. "type": "string"
  856. }
  857. },
  858. {
  859. "in": "query",
  860. "name": "workspace",
  861. "schema": {
  862. "type": "string"
  863. }
  864. }
  865. ],
  866. "summary": "Get current project",
  867. "description": "Retrieve the currently active project that OpenCode is working with.",
  868. "responses": {
  869. "200": {
  870. "description": "Current project information",
  871. "content": {
  872. "application/json": {
  873. "schema": {
  874. "$ref": "#/components/schemas/Project"
  875. }
  876. }
  877. }
  878. }
  879. },
  880. "x-codeSamples": [
  881. {
  882. "lang": "js",
  883. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.current({\n ...\n})"
  884. }
  885. ]
  886. }
  887. },
  888. "/project/git/init": {
  889. "post": {
  890. "operationId": "project.initGit",
  891. "parameters": [
  892. {
  893. "in": "query",
  894. "name": "directory",
  895. "schema": {
  896. "type": "string"
  897. }
  898. },
  899. {
  900. "in": "query",
  901. "name": "workspace",
  902. "schema": {
  903. "type": "string"
  904. }
  905. }
  906. ],
  907. "summary": "Initialize git repository",
  908. "description": "Create a git repository for the current project and return the refreshed project info.",
  909. "responses": {
  910. "200": {
  911. "description": "Project information after git initialization",
  912. "content": {
  913. "application/json": {
  914. "schema": {
  915. "$ref": "#/components/schemas/Project"
  916. }
  917. }
  918. }
  919. }
  920. },
  921. "x-codeSamples": [
  922. {
  923. "lang": "js",
  924. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.initGit({\n ...\n})"
  925. }
  926. ]
  927. }
  928. },
  929. "/project/{projectID}": {
  930. "patch": {
  931. "operationId": "project.update",
  932. "parameters": [
  933. {
  934. "in": "query",
  935. "name": "directory",
  936. "schema": {
  937. "type": "string"
  938. }
  939. },
  940. {
  941. "in": "query",
  942. "name": "workspace",
  943. "schema": {
  944. "type": "string"
  945. }
  946. },
  947. {
  948. "in": "path",
  949. "name": "projectID",
  950. "schema": {
  951. "type": "string"
  952. },
  953. "required": true
  954. }
  955. ],
  956. "summary": "Update project",
  957. "description": "Update project properties such as name, icon, and commands.",
  958. "responses": {
  959. "200": {
  960. "description": "Updated project information",
  961. "content": {
  962. "application/json": {
  963. "schema": {
  964. "$ref": "#/components/schemas/Project"
  965. }
  966. }
  967. }
  968. },
  969. "400": {
  970. "description": "Bad request",
  971. "content": {
  972. "application/json": {
  973. "schema": {
  974. "$ref": "#/components/schemas/BadRequestError"
  975. }
  976. }
  977. }
  978. },
  979. "404": {
  980. "description": "Not found",
  981. "content": {
  982. "application/json": {
  983. "schema": {
  984. "$ref": "#/components/schemas/NotFoundError"
  985. }
  986. }
  987. }
  988. }
  989. },
  990. "requestBody": {
  991. "content": {
  992. "application/json": {
  993. "schema": {
  994. "type": "object",
  995. "properties": {
  996. "name": {
  997. "type": "string"
  998. },
  999. "icon": {
  1000. "type": "object",
  1001. "properties": {
  1002. "url": {
  1003. "type": "string"
  1004. },
  1005. "override": {
  1006. "type": "string"
  1007. },
  1008. "color": {
  1009. "type": "string"
  1010. }
  1011. }
  1012. },
  1013. "commands": {
  1014. "type": "object",
  1015. "properties": {
  1016. "start": {
  1017. "description": "Startup script to run when creating a new workspace (worktree)",
  1018. "type": "string"
  1019. }
  1020. }
  1021. }
  1022. }
  1023. }
  1024. }
  1025. }
  1026. },
  1027. "x-codeSamples": [
  1028. {
  1029. "lang": "js",
  1030. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.update({\n ...\n})"
  1031. }
  1032. ]
  1033. }
  1034. },
  1035. "/pty/shells": {
  1036. "get": {
  1037. "operationId": "pty.shells",
  1038. "parameters": [
  1039. {
  1040. "in": "query",
  1041. "name": "directory",
  1042. "schema": {
  1043. "type": "string"
  1044. }
  1045. },
  1046. {
  1047. "in": "query",
  1048. "name": "workspace",
  1049. "schema": {
  1050. "type": "string"
  1051. }
  1052. }
  1053. ],
  1054. "summary": "List available shells",
  1055. "description": "Get a list of available shells on the system.",
  1056. "responses": {
  1057. "200": {
  1058. "description": "List of shells",
  1059. "content": {
  1060. "application/json": {
  1061. "schema": {
  1062. "type": "array",
  1063. "items": {
  1064. "type": "object",
  1065. "properties": {
  1066. "path": {
  1067. "type": "string"
  1068. },
  1069. "name": {
  1070. "type": "string"
  1071. },
  1072. "acceptable": {
  1073. "type": "boolean"
  1074. }
  1075. },
  1076. "required": ["path", "name", "acceptable"]
  1077. }
  1078. }
  1079. }
  1080. }
  1081. }
  1082. },
  1083. "x-codeSamples": [
  1084. {
  1085. "lang": "js",
  1086. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.shells({\n ...\n})"
  1087. }
  1088. ]
  1089. }
  1090. },
  1091. "/pty": {
  1092. "get": {
  1093. "operationId": "pty.list",
  1094. "parameters": [
  1095. {
  1096. "in": "query",
  1097. "name": "directory",
  1098. "schema": {
  1099. "type": "string"
  1100. }
  1101. },
  1102. {
  1103. "in": "query",
  1104. "name": "workspace",
  1105. "schema": {
  1106. "type": "string"
  1107. }
  1108. }
  1109. ],
  1110. "summary": "List PTY sessions",
  1111. "description": "Get a list of all active pseudo-terminal (PTY) sessions managed by OpenCode.",
  1112. "responses": {
  1113. "200": {
  1114. "description": "List of sessions",
  1115. "content": {
  1116. "application/json": {
  1117. "schema": {
  1118. "type": "array",
  1119. "items": {
  1120. "$ref": "#/components/schemas/Pty"
  1121. }
  1122. }
  1123. }
  1124. }
  1125. }
  1126. },
  1127. "x-codeSamples": [
  1128. {
  1129. "lang": "js",
  1130. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.list({\n ...\n})"
  1131. }
  1132. ]
  1133. },
  1134. "post": {
  1135. "operationId": "pty.create",
  1136. "parameters": [
  1137. {
  1138. "in": "query",
  1139. "name": "directory",
  1140. "schema": {
  1141. "type": "string"
  1142. }
  1143. },
  1144. {
  1145. "in": "query",
  1146. "name": "workspace",
  1147. "schema": {
  1148. "type": "string"
  1149. }
  1150. }
  1151. ],
  1152. "summary": "Create PTY session",
  1153. "description": "Create a new pseudo-terminal (PTY) session for running shell commands and processes.",
  1154. "responses": {
  1155. "200": {
  1156. "description": "Created session",
  1157. "content": {
  1158. "application/json": {
  1159. "schema": {
  1160. "$ref": "#/components/schemas/Pty"
  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. "requestBody": {
  1177. "content": {
  1178. "application/json": {
  1179. "schema": {
  1180. "type": "object",
  1181. "properties": {
  1182. "command": {
  1183. "type": "string"
  1184. },
  1185. "args": {
  1186. "type": "array",
  1187. "items": {
  1188. "type": "string"
  1189. }
  1190. },
  1191. "cwd": {
  1192. "type": "string"
  1193. },
  1194. "title": {
  1195. "type": "string"
  1196. },
  1197. "env": {
  1198. "type": "object",
  1199. "propertyNames": {
  1200. "type": "string"
  1201. },
  1202. "additionalProperties": {
  1203. "type": "string"
  1204. }
  1205. }
  1206. }
  1207. }
  1208. }
  1209. }
  1210. },
  1211. "x-codeSamples": [
  1212. {
  1213. "lang": "js",
  1214. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.create({\n ...\n})"
  1215. }
  1216. ]
  1217. }
  1218. },
  1219. "/pty/{ptyID}": {
  1220. "get": {
  1221. "operationId": "pty.get",
  1222. "parameters": [
  1223. {
  1224. "in": "query",
  1225. "name": "directory",
  1226. "schema": {
  1227. "type": "string"
  1228. }
  1229. },
  1230. {
  1231. "in": "query",
  1232. "name": "workspace",
  1233. "schema": {
  1234. "type": "string"
  1235. }
  1236. },
  1237. {
  1238. "in": "path",
  1239. "name": "ptyID",
  1240. "schema": {
  1241. "type": "string",
  1242. "pattern": "^pty.*"
  1243. },
  1244. "required": true
  1245. }
  1246. ],
  1247. "summary": "Get PTY session",
  1248. "description": "Retrieve detailed information about a specific pseudo-terminal (PTY) session.",
  1249. "responses": {
  1250. "200": {
  1251. "description": "Session info",
  1252. "content": {
  1253. "application/json": {
  1254. "schema": {
  1255. "$ref": "#/components/schemas/Pty"
  1256. }
  1257. }
  1258. }
  1259. },
  1260. "404": {
  1261. "description": "Not found",
  1262. "content": {
  1263. "application/json": {
  1264. "schema": {
  1265. "$ref": "#/components/schemas/NotFoundError"
  1266. }
  1267. }
  1268. }
  1269. }
  1270. },
  1271. "x-codeSamples": [
  1272. {
  1273. "lang": "js",
  1274. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.get({\n ...\n})"
  1275. }
  1276. ]
  1277. },
  1278. "put": {
  1279. "operationId": "pty.update",
  1280. "parameters": [
  1281. {
  1282. "in": "query",
  1283. "name": "directory",
  1284. "schema": {
  1285. "type": "string"
  1286. }
  1287. },
  1288. {
  1289. "in": "query",
  1290. "name": "workspace",
  1291. "schema": {
  1292. "type": "string"
  1293. }
  1294. },
  1295. {
  1296. "in": "path",
  1297. "name": "ptyID",
  1298. "schema": {
  1299. "type": "string",
  1300. "pattern": "^pty.*"
  1301. },
  1302. "required": true
  1303. }
  1304. ],
  1305. "summary": "Update PTY session",
  1306. "description": "Update properties of an existing pseudo-terminal (PTY) session.",
  1307. "responses": {
  1308. "200": {
  1309. "description": "Updated session",
  1310. "content": {
  1311. "application/json": {
  1312. "schema": {
  1313. "$ref": "#/components/schemas/Pty"
  1314. }
  1315. }
  1316. }
  1317. },
  1318. "400": {
  1319. "description": "Bad request",
  1320. "content": {
  1321. "application/json": {
  1322. "schema": {
  1323. "$ref": "#/components/schemas/BadRequestError"
  1324. }
  1325. }
  1326. }
  1327. }
  1328. },
  1329. "requestBody": {
  1330. "content": {
  1331. "application/json": {
  1332. "schema": {
  1333. "type": "object",
  1334. "properties": {
  1335. "title": {
  1336. "type": "string"
  1337. },
  1338. "size": {
  1339. "type": "object",
  1340. "properties": {
  1341. "rows": {
  1342. "type": "integer",
  1343. "exclusiveMinimum": 0,
  1344. "maximum": 9007199254740991
  1345. },
  1346. "cols": {
  1347. "type": "integer",
  1348. "exclusiveMinimum": 0,
  1349. "maximum": 9007199254740991
  1350. }
  1351. },
  1352. "required": ["rows", "cols"]
  1353. }
  1354. }
  1355. }
  1356. }
  1357. }
  1358. },
  1359. "x-codeSamples": [
  1360. {
  1361. "lang": "js",
  1362. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.update({\n ...\n})"
  1363. }
  1364. ]
  1365. },
  1366. "delete": {
  1367. "operationId": "pty.remove",
  1368. "parameters": [
  1369. {
  1370. "in": "query",
  1371. "name": "directory",
  1372. "schema": {
  1373. "type": "string"
  1374. }
  1375. },
  1376. {
  1377. "in": "query",
  1378. "name": "workspace",
  1379. "schema": {
  1380. "type": "string"
  1381. }
  1382. },
  1383. {
  1384. "in": "path",
  1385. "name": "ptyID",
  1386. "schema": {
  1387. "type": "string",
  1388. "pattern": "^pty.*"
  1389. },
  1390. "required": true
  1391. }
  1392. ],
  1393. "summary": "Remove PTY session",
  1394. "description": "Remove and terminate a specific pseudo-terminal (PTY) session.",
  1395. "responses": {
  1396. "200": {
  1397. "description": "Session removed",
  1398. "content": {
  1399. "application/json": {
  1400. "schema": {
  1401. "type": "boolean"
  1402. }
  1403. }
  1404. }
  1405. },
  1406. "404": {
  1407. "description": "Not found",
  1408. "content": {
  1409. "application/json": {
  1410. "schema": {
  1411. "$ref": "#/components/schemas/NotFoundError"
  1412. }
  1413. }
  1414. }
  1415. }
  1416. },
  1417. "x-codeSamples": [
  1418. {
  1419. "lang": "js",
  1420. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.remove({\n ...\n})"
  1421. }
  1422. ]
  1423. }
  1424. },
  1425. "/pty/{ptyID}/connect": {
  1426. "get": {
  1427. "operationId": "pty.connect",
  1428. "parameters": [
  1429. {
  1430. "in": "query",
  1431. "name": "directory",
  1432. "schema": {
  1433. "type": "string"
  1434. }
  1435. },
  1436. {
  1437. "in": "query",
  1438. "name": "workspace",
  1439. "schema": {
  1440. "type": "string"
  1441. }
  1442. },
  1443. {
  1444. "in": "path",
  1445. "name": "ptyID",
  1446. "schema": {
  1447. "type": "string",
  1448. "pattern": "^pty.*"
  1449. },
  1450. "required": true
  1451. }
  1452. ],
  1453. "summary": "Connect to PTY session",
  1454. "description": "Establish a WebSocket connection to interact with a pseudo-terminal (PTY) session in real-time.",
  1455. "responses": {
  1456. "200": {
  1457. "description": "Connected session",
  1458. "content": {
  1459. "application/json": {
  1460. "schema": {
  1461. "type": "boolean"
  1462. }
  1463. }
  1464. }
  1465. },
  1466. "404": {
  1467. "description": "Not found",
  1468. "content": {
  1469. "application/json": {
  1470. "schema": {
  1471. "$ref": "#/components/schemas/NotFoundError"
  1472. }
  1473. }
  1474. }
  1475. }
  1476. },
  1477. "x-codeSamples": [
  1478. {
  1479. "lang": "js",
  1480. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.connect({\n ...\n})"
  1481. }
  1482. ]
  1483. }
  1484. },
  1485. "/config": {
  1486. "get": {
  1487. "operationId": "config.get",
  1488. "parameters": [
  1489. {
  1490. "in": "query",
  1491. "name": "directory",
  1492. "schema": {
  1493. "type": "string"
  1494. }
  1495. },
  1496. {
  1497. "in": "query",
  1498. "name": "workspace",
  1499. "schema": {
  1500. "type": "string"
  1501. }
  1502. }
  1503. ],
  1504. "summary": "Get configuration",
  1505. "description": "Retrieve the current OpenCode configuration settings and preferences.",
  1506. "responses": {
  1507. "200": {
  1508. "description": "Get config info",
  1509. "content": {
  1510. "application/json": {
  1511. "schema": {
  1512. "$ref": "#/components/schemas/Config"
  1513. }
  1514. }
  1515. }
  1516. }
  1517. },
  1518. "x-codeSamples": [
  1519. {
  1520. "lang": "js",
  1521. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.config.get({\n ...\n})"
  1522. }
  1523. ]
  1524. },
  1525. "patch": {
  1526. "operationId": "config.update",
  1527. "parameters": [
  1528. {
  1529. "in": "query",
  1530. "name": "directory",
  1531. "schema": {
  1532. "type": "string"
  1533. }
  1534. },
  1535. {
  1536. "in": "query",
  1537. "name": "workspace",
  1538. "schema": {
  1539. "type": "string"
  1540. }
  1541. }
  1542. ],
  1543. "summary": "Update configuration",
  1544. "description": "Update OpenCode configuration settings and preferences.",
  1545. "responses": {
  1546. "200": {
  1547. "description": "Successfully updated config",
  1548. "content": {
  1549. "application/json": {
  1550. "schema": {
  1551. "$ref": "#/components/schemas/Config"
  1552. }
  1553. }
  1554. }
  1555. },
  1556. "400": {
  1557. "description": "Bad request",
  1558. "content": {
  1559. "application/json": {
  1560. "schema": {
  1561. "$ref": "#/components/schemas/BadRequestError"
  1562. }
  1563. }
  1564. }
  1565. }
  1566. },
  1567. "requestBody": {
  1568. "content": {
  1569. "application/json": {
  1570. "schema": {
  1571. "$ref": "#/components/schemas/Config"
  1572. }
  1573. }
  1574. }
  1575. },
  1576. "x-codeSamples": [
  1577. {
  1578. "lang": "js",
  1579. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.config.update({\n ...\n})"
  1580. }
  1581. ]
  1582. }
  1583. },
  1584. "/config/providers": {
  1585. "get": {
  1586. "operationId": "config.providers",
  1587. "parameters": [
  1588. {
  1589. "in": "query",
  1590. "name": "directory",
  1591. "schema": {
  1592. "type": "string"
  1593. }
  1594. },
  1595. {
  1596. "in": "query",
  1597. "name": "workspace",
  1598. "schema": {
  1599. "type": "string"
  1600. }
  1601. }
  1602. ],
  1603. "summary": "List config providers",
  1604. "description": "Get a list of all configured AI providers and their default models.",
  1605. "responses": {
  1606. "200": {
  1607. "description": "List of providers",
  1608. "content": {
  1609. "application/json": {
  1610. "schema": {
  1611. "type": "object",
  1612. "properties": {
  1613. "providers": {
  1614. "type": "array",
  1615. "items": {
  1616. "$ref": "#/components/schemas/Provider"
  1617. }
  1618. },
  1619. "default": {
  1620. "type": "object",
  1621. "propertyNames": {
  1622. "type": "string"
  1623. },
  1624. "additionalProperties": {
  1625. "type": "string"
  1626. }
  1627. }
  1628. },
  1629. "required": ["providers", "default"]
  1630. }
  1631. }
  1632. }
  1633. }
  1634. },
  1635. "x-codeSamples": [
  1636. {
  1637. "lang": "js",
  1638. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.config.providers({\n ...\n})"
  1639. }
  1640. ]
  1641. }
  1642. },
  1643. "/experimental/console": {
  1644. "get": {
  1645. "operationId": "experimental.console.get",
  1646. "parameters": [
  1647. {
  1648. "in": "query",
  1649. "name": "directory",
  1650. "schema": {
  1651. "type": "string"
  1652. }
  1653. },
  1654. {
  1655. "in": "query",
  1656. "name": "workspace",
  1657. "schema": {
  1658. "type": "string"
  1659. }
  1660. }
  1661. ],
  1662. "summary": "Get active Console provider metadata",
  1663. "description": "Get the active Console org name and the set of provider IDs managed by that Console org.",
  1664. "responses": {
  1665. "200": {
  1666. "description": "Active Console provider metadata",
  1667. "content": {
  1668. "application/json": {
  1669. "schema": {
  1670. "$ref": "#/components/schemas/ConsoleState"
  1671. }
  1672. }
  1673. }
  1674. }
  1675. },
  1676. "x-codeSamples": [
  1677. {
  1678. "lang": "js",
  1679. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.console.get({\n ...\n})"
  1680. }
  1681. ]
  1682. }
  1683. },
  1684. "/experimental/console/orgs": {
  1685. "get": {
  1686. "operationId": "experimental.console.listOrgs",
  1687. "parameters": [
  1688. {
  1689. "in": "query",
  1690. "name": "directory",
  1691. "schema": {
  1692. "type": "string"
  1693. }
  1694. },
  1695. {
  1696. "in": "query",
  1697. "name": "workspace",
  1698. "schema": {
  1699. "type": "string"
  1700. }
  1701. }
  1702. ],
  1703. "summary": "List switchable Console orgs",
  1704. "description": "Get the available Console orgs across logged-in accounts, including the current active org.",
  1705. "responses": {
  1706. "200": {
  1707. "description": "Switchable Console orgs",
  1708. "content": {
  1709. "application/json": {
  1710. "schema": {
  1711. "type": "object",
  1712. "properties": {
  1713. "orgs": {
  1714. "type": "array",
  1715. "items": {
  1716. "type": "object",
  1717. "properties": {
  1718. "accountID": {
  1719. "type": "string"
  1720. },
  1721. "accountEmail": {
  1722. "type": "string"
  1723. },
  1724. "accountUrl": {
  1725. "type": "string"
  1726. },
  1727. "orgID": {
  1728. "type": "string"
  1729. },
  1730. "orgName": {
  1731. "type": "string"
  1732. },
  1733. "active": {
  1734. "type": "boolean"
  1735. }
  1736. },
  1737. "required": ["accountID", "accountEmail", "accountUrl", "orgID", "orgName", "active"]
  1738. }
  1739. }
  1740. },
  1741. "required": ["orgs"]
  1742. }
  1743. }
  1744. }
  1745. }
  1746. },
  1747. "x-codeSamples": [
  1748. {
  1749. "lang": "js",
  1750. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.console.listOrgs({\n ...\n})"
  1751. }
  1752. ]
  1753. }
  1754. },
  1755. "/experimental/console/switch": {
  1756. "post": {
  1757. "operationId": "experimental.console.switchOrg",
  1758. "parameters": [
  1759. {
  1760. "in": "query",
  1761. "name": "directory",
  1762. "schema": {
  1763. "type": "string"
  1764. }
  1765. },
  1766. {
  1767. "in": "query",
  1768. "name": "workspace",
  1769. "schema": {
  1770. "type": "string"
  1771. }
  1772. }
  1773. ],
  1774. "summary": "Switch active Console org",
  1775. "description": "Persist a new active Console account/org selection for the current local OpenCode state.",
  1776. "responses": {
  1777. "200": {
  1778. "description": "Switch success",
  1779. "content": {
  1780. "application/json": {
  1781. "schema": {
  1782. "type": "boolean"
  1783. }
  1784. }
  1785. }
  1786. }
  1787. },
  1788. "requestBody": {
  1789. "content": {
  1790. "application/json": {
  1791. "schema": {
  1792. "type": "object",
  1793. "properties": {
  1794. "accountID": {
  1795. "type": "string"
  1796. },
  1797. "orgID": {
  1798. "type": "string"
  1799. }
  1800. },
  1801. "required": ["accountID", "orgID"]
  1802. }
  1803. }
  1804. }
  1805. },
  1806. "x-codeSamples": [
  1807. {
  1808. "lang": "js",
  1809. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.console.switchOrg({\n ...\n})"
  1810. }
  1811. ]
  1812. }
  1813. },
  1814. "/experimental/tool/ids": {
  1815. "get": {
  1816. "operationId": "tool.ids",
  1817. "parameters": [
  1818. {
  1819. "in": "query",
  1820. "name": "directory",
  1821. "schema": {
  1822. "type": "string"
  1823. }
  1824. },
  1825. {
  1826. "in": "query",
  1827. "name": "workspace",
  1828. "schema": {
  1829. "type": "string"
  1830. }
  1831. }
  1832. ],
  1833. "summary": "List tool IDs",
  1834. "description": "Get a list of all available tool IDs, including both built-in tools and dynamically registered tools.",
  1835. "responses": {
  1836. "200": {
  1837. "description": "Tool IDs",
  1838. "content": {
  1839. "application/json": {
  1840. "schema": {
  1841. "$ref": "#/components/schemas/ToolIDs"
  1842. }
  1843. }
  1844. }
  1845. },
  1846. "400": {
  1847. "description": "Bad request",
  1848. "content": {
  1849. "application/json": {
  1850. "schema": {
  1851. "$ref": "#/components/schemas/BadRequestError"
  1852. }
  1853. }
  1854. }
  1855. }
  1856. },
  1857. "x-codeSamples": [
  1858. {
  1859. "lang": "js",
  1860. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tool.ids({\n ...\n})"
  1861. }
  1862. ]
  1863. }
  1864. },
  1865. "/experimental/tool": {
  1866. "get": {
  1867. "operationId": "tool.list",
  1868. "parameters": [
  1869. {
  1870. "in": "query",
  1871. "name": "directory",
  1872. "schema": {
  1873. "type": "string"
  1874. }
  1875. },
  1876. {
  1877. "in": "query",
  1878. "name": "workspace",
  1879. "schema": {
  1880. "type": "string"
  1881. }
  1882. },
  1883. {
  1884. "in": "query",
  1885. "name": "provider",
  1886. "schema": {
  1887. "type": "string"
  1888. },
  1889. "required": true
  1890. },
  1891. {
  1892. "in": "query",
  1893. "name": "model",
  1894. "schema": {
  1895. "type": "string"
  1896. },
  1897. "required": true
  1898. }
  1899. ],
  1900. "summary": "List tools",
  1901. "description": "Get a list of available tools with their JSON schema parameters for a specific provider and model combination.",
  1902. "responses": {
  1903. "200": {
  1904. "description": "Tools",
  1905. "content": {
  1906. "application/json": {
  1907. "schema": {
  1908. "$ref": "#/components/schemas/ToolList"
  1909. }
  1910. }
  1911. }
  1912. },
  1913. "400": {
  1914. "description": "Bad request",
  1915. "content": {
  1916. "application/json": {
  1917. "schema": {
  1918. "$ref": "#/components/schemas/BadRequestError"
  1919. }
  1920. }
  1921. }
  1922. }
  1923. },
  1924. "x-codeSamples": [
  1925. {
  1926. "lang": "js",
  1927. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tool.list({\n ...\n})"
  1928. }
  1929. ]
  1930. }
  1931. },
  1932. "/experimental/worktree": {
  1933. "post": {
  1934. "operationId": "worktree.create",
  1935. "parameters": [
  1936. {
  1937. "in": "query",
  1938. "name": "directory",
  1939. "schema": {
  1940. "type": "string"
  1941. }
  1942. },
  1943. {
  1944. "in": "query",
  1945. "name": "workspace",
  1946. "schema": {
  1947. "type": "string"
  1948. }
  1949. }
  1950. ],
  1951. "summary": "Create worktree",
  1952. "description": "Create a new git worktree for the current project and run any configured startup scripts.",
  1953. "responses": {
  1954. "200": {
  1955. "description": "Worktree created",
  1956. "content": {
  1957. "application/json": {
  1958. "schema": {
  1959. "$ref": "#/components/schemas/Worktree"
  1960. }
  1961. }
  1962. }
  1963. },
  1964. "400": {
  1965. "description": "Bad request",
  1966. "content": {
  1967. "application/json": {
  1968. "schema": {
  1969. "$ref": "#/components/schemas/BadRequestError"
  1970. }
  1971. }
  1972. }
  1973. }
  1974. },
  1975. "requestBody": {
  1976. "content": {
  1977. "application/json": {
  1978. "schema": {
  1979. "$ref": "#/components/schemas/WorktreeCreateInput"
  1980. }
  1981. }
  1982. }
  1983. },
  1984. "x-codeSamples": [
  1985. {
  1986. "lang": "js",
  1987. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.create({\n ...\n})"
  1988. }
  1989. ]
  1990. },
  1991. "get": {
  1992. "operationId": "worktree.list",
  1993. "parameters": [
  1994. {
  1995. "in": "query",
  1996. "name": "directory",
  1997. "schema": {
  1998. "type": "string"
  1999. }
  2000. },
  2001. {
  2002. "in": "query",
  2003. "name": "workspace",
  2004. "schema": {
  2005. "type": "string"
  2006. }
  2007. }
  2008. ],
  2009. "summary": "List worktrees",
  2010. "description": "List all sandbox worktrees for the current project.",
  2011. "responses": {
  2012. "200": {
  2013. "description": "List of worktree directories",
  2014. "content": {
  2015. "application/json": {
  2016. "schema": {
  2017. "type": "array",
  2018. "items": {
  2019. "type": "string"
  2020. }
  2021. }
  2022. }
  2023. }
  2024. }
  2025. },
  2026. "x-codeSamples": [
  2027. {
  2028. "lang": "js",
  2029. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.list({\n ...\n})"
  2030. }
  2031. ]
  2032. },
  2033. "delete": {
  2034. "operationId": "worktree.remove",
  2035. "parameters": [
  2036. {
  2037. "in": "query",
  2038. "name": "directory",
  2039. "schema": {
  2040. "type": "string"
  2041. }
  2042. },
  2043. {
  2044. "in": "query",
  2045. "name": "workspace",
  2046. "schema": {
  2047. "type": "string"
  2048. }
  2049. }
  2050. ],
  2051. "summary": "Remove worktree",
  2052. "description": "Remove a git worktree and delete its branch.",
  2053. "responses": {
  2054. "200": {
  2055. "description": "Worktree removed",
  2056. "content": {
  2057. "application/json": {
  2058. "schema": {
  2059. "type": "boolean"
  2060. }
  2061. }
  2062. }
  2063. },
  2064. "400": {
  2065. "description": "Bad request",
  2066. "content": {
  2067. "application/json": {
  2068. "schema": {
  2069. "$ref": "#/components/schemas/BadRequestError"
  2070. }
  2071. }
  2072. }
  2073. }
  2074. },
  2075. "requestBody": {
  2076. "content": {
  2077. "application/json": {
  2078. "schema": {
  2079. "$ref": "#/components/schemas/WorktreeRemoveInput"
  2080. }
  2081. }
  2082. }
  2083. },
  2084. "x-codeSamples": [
  2085. {
  2086. "lang": "js",
  2087. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.remove({\n ...\n})"
  2088. }
  2089. ]
  2090. }
  2091. },
  2092. "/experimental/worktree/reset": {
  2093. "post": {
  2094. "operationId": "worktree.reset",
  2095. "parameters": [
  2096. {
  2097. "in": "query",
  2098. "name": "directory",
  2099. "schema": {
  2100. "type": "string"
  2101. }
  2102. },
  2103. {
  2104. "in": "query",
  2105. "name": "workspace",
  2106. "schema": {
  2107. "type": "string"
  2108. }
  2109. }
  2110. ],
  2111. "summary": "Reset worktree",
  2112. "description": "Reset a worktree branch to the primary default branch.",
  2113. "responses": {
  2114. "200": {
  2115. "description": "Worktree reset",
  2116. "content": {
  2117. "application/json": {
  2118. "schema": {
  2119. "type": "boolean"
  2120. }
  2121. }
  2122. }
  2123. },
  2124. "400": {
  2125. "description": "Bad request",
  2126. "content": {
  2127. "application/json": {
  2128. "schema": {
  2129. "$ref": "#/components/schemas/BadRequestError"
  2130. }
  2131. }
  2132. }
  2133. }
  2134. },
  2135. "requestBody": {
  2136. "content": {
  2137. "application/json": {
  2138. "schema": {
  2139. "$ref": "#/components/schemas/WorktreeResetInput"
  2140. }
  2141. }
  2142. }
  2143. },
  2144. "x-codeSamples": [
  2145. {
  2146. "lang": "js",
  2147. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.reset({\n ...\n})"
  2148. }
  2149. ]
  2150. }
  2151. },
  2152. "/experimental/session": {
  2153. "get": {
  2154. "operationId": "experimental.session.list",
  2155. "parameters": [
  2156. {
  2157. "in": "query",
  2158. "name": "directory",
  2159. "schema": {
  2160. "type": "string"
  2161. },
  2162. "description": "Filter sessions by project directory"
  2163. },
  2164. {
  2165. "in": "query",
  2166. "name": "workspace",
  2167. "schema": {
  2168. "type": "string"
  2169. }
  2170. },
  2171. {
  2172. "in": "query",
  2173. "name": "roots",
  2174. "schema": {
  2175. "anyOf": [
  2176. {
  2177. "type": "boolean"
  2178. },
  2179. {
  2180. "type": "string",
  2181. "enum": ["true", "false"]
  2182. }
  2183. ]
  2184. },
  2185. "description": "Only return root sessions (no parentID)"
  2186. },
  2187. {
  2188. "in": "query",
  2189. "name": "start",
  2190. "schema": {
  2191. "type": "number"
  2192. },
  2193. "description": "Filter sessions updated on or after this timestamp (milliseconds since epoch)"
  2194. },
  2195. {
  2196. "in": "query",
  2197. "name": "cursor",
  2198. "schema": {
  2199. "type": "number"
  2200. },
  2201. "description": "Return sessions updated before this timestamp (milliseconds since epoch)"
  2202. },
  2203. {
  2204. "in": "query",
  2205. "name": "search",
  2206. "schema": {
  2207. "type": "string"
  2208. },
  2209. "description": "Filter sessions by title (case-insensitive)"
  2210. },
  2211. {
  2212. "in": "query",
  2213. "name": "limit",
  2214. "schema": {
  2215. "type": "number"
  2216. },
  2217. "description": "Maximum number of sessions to return"
  2218. },
  2219. {
  2220. "in": "query",
  2221. "name": "archived",
  2222. "schema": {
  2223. "anyOf": [
  2224. {
  2225. "type": "boolean"
  2226. },
  2227. {
  2228. "type": "string",
  2229. "enum": ["true", "false"]
  2230. }
  2231. ]
  2232. },
  2233. "description": "Include archived sessions (default false)"
  2234. }
  2235. ],
  2236. "summary": "List sessions",
  2237. "description": "Get a list of all OpenCode sessions across projects, sorted by most recently updated. Archived sessions are excluded by default.",
  2238. "responses": {
  2239. "200": {
  2240. "description": "List of sessions",
  2241. "content": {
  2242. "application/json": {
  2243. "schema": {
  2244. "type": "array",
  2245. "items": {
  2246. "$ref": "#/components/schemas/GlobalSession"
  2247. }
  2248. }
  2249. }
  2250. }
  2251. }
  2252. },
  2253. "x-codeSamples": [
  2254. {
  2255. "lang": "js",
  2256. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.session.list({\n ...\n})"
  2257. }
  2258. ]
  2259. }
  2260. },
  2261. "/experimental/resource": {
  2262. "get": {
  2263. "operationId": "experimental.resource.list",
  2264. "parameters": [
  2265. {
  2266. "in": "query",
  2267. "name": "directory",
  2268. "schema": {
  2269. "type": "string"
  2270. }
  2271. },
  2272. {
  2273. "in": "query",
  2274. "name": "workspace",
  2275. "schema": {
  2276. "type": "string"
  2277. }
  2278. }
  2279. ],
  2280. "summary": "Get MCP resources",
  2281. "description": "Get all available MCP resources from connected servers. Optionally filter by name.",
  2282. "responses": {
  2283. "200": {
  2284. "description": "MCP resources",
  2285. "content": {
  2286. "application/json": {
  2287. "schema": {
  2288. "type": "object",
  2289. "propertyNames": {
  2290. "type": "string"
  2291. },
  2292. "additionalProperties": {
  2293. "$ref": "#/components/schemas/McpResource"
  2294. }
  2295. }
  2296. }
  2297. }
  2298. }
  2299. },
  2300. "x-codeSamples": [
  2301. {
  2302. "lang": "js",
  2303. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.resource.list({\n ...\n})"
  2304. }
  2305. ]
  2306. }
  2307. },
  2308. "/session": {
  2309. "get": {
  2310. "operationId": "session.list",
  2311. "parameters": [
  2312. {
  2313. "in": "query",
  2314. "name": "directory",
  2315. "schema": {
  2316. "type": "string"
  2317. },
  2318. "description": "Filter sessions by directory"
  2319. },
  2320. {
  2321. "in": "query",
  2322. "name": "workspace",
  2323. "schema": {
  2324. "type": "string"
  2325. }
  2326. },
  2327. {
  2328. "in": "query",
  2329. "name": "scope",
  2330. "schema": {
  2331. "type": "string",
  2332. "enum": ["project"]
  2333. },
  2334. "description": "List all sessions for the current project"
  2335. },
  2336. {
  2337. "in": "query",
  2338. "name": "path",
  2339. "schema": {
  2340. "type": "string"
  2341. },
  2342. "description": "Filter sessions by project-relative path"
  2343. },
  2344. {
  2345. "in": "query",
  2346. "name": "roots",
  2347. "schema": {
  2348. "anyOf": [
  2349. {
  2350. "type": "boolean"
  2351. },
  2352. {
  2353. "type": "string",
  2354. "enum": ["true", "false"]
  2355. }
  2356. ]
  2357. },
  2358. "description": "Only return root sessions (no parentID)"
  2359. },
  2360. {
  2361. "in": "query",
  2362. "name": "start",
  2363. "schema": {
  2364. "type": "number"
  2365. },
  2366. "description": "Filter sessions updated on or after this timestamp (milliseconds since epoch)"
  2367. },
  2368. {
  2369. "in": "query",
  2370. "name": "search",
  2371. "schema": {
  2372. "type": "string"
  2373. },
  2374. "description": "Filter sessions by title (case-insensitive)"
  2375. },
  2376. {
  2377. "in": "query",
  2378. "name": "limit",
  2379. "schema": {
  2380. "type": "number"
  2381. },
  2382. "description": "Maximum number of sessions to return"
  2383. }
  2384. ],
  2385. "summary": "List sessions",
  2386. "description": "Get a list of all OpenCode sessions, sorted by most recently updated.",
  2387. "responses": {
  2388. "200": {
  2389. "description": "List of sessions",
  2390. "content": {
  2391. "application/json": {
  2392. "schema": {
  2393. "type": "array",
  2394. "items": {
  2395. "$ref": "#/components/schemas/Session"
  2396. }
  2397. }
  2398. }
  2399. }
  2400. }
  2401. },
  2402. "x-codeSamples": [
  2403. {
  2404. "lang": "js",
  2405. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.list({\n ...\n})"
  2406. }
  2407. ]
  2408. },
  2409. "post": {
  2410. "operationId": "session.create",
  2411. "parameters": [
  2412. {
  2413. "in": "query",
  2414. "name": "directory",
  2415. "schema": {
  2416. "type": "string"
  2417. }
  2418. },
  2419. {
  2420. "in": "query",
  2421. "name": "workspace",
  2422. "schema": {
  2423. "type": "string"
  2424. }
  2425. }
  2426. ],
  2427. "summary": "Create session",
  2428. "description": "Create a new OpenCode session for interacting with AI assistants and managing conversations.",
  2429. "responses": {
  2430. "200": {
  2431. "description": "Successfully created session",
  2432. "content": {
  2433. "application/json": {
  2434. "schema": {
  2435. "$ref": "#/components/schemas/Session"
  2436. }
  2437. }
  2438. }
  2439. },
  2440. "400": {
  2441. "description": "Bad request",
  2442. "content": {
  2443. "application/json": {
  2444. "schema": {
  2445. "$ref": "#/components/schemas/BadRequestError"
  2446. }
  2447. }
  2448. }
  2449. }
  2450. },
  2451. "requestBody": {
  2452. "content": {
  2453. "application/json": {
  2454. "schema": {
  2455. "type": "object",
  2456. "properties": {
  2457. "parentID": {
  2458. "type": "string",
  2459. "pattern": "^ses.*"
  2460. },
  2461. "title": {
  2462. "type": "string"
  2463. },
  2464. "permission": {
  2465. "$ref": "#/components/schemas/PermissionRuleset"
  2466. },
  2467. "workspaceID": {
  2468. "type": "string",
  2469. "pattern": "^wrk.*"
  2470. }
  2471. }
  2472. }
  2473. }
  2474. }
  2475. },
  2476. "x-codeSamples": [
  2477. {
  2478. "lang": "js",
  2479. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.create({\n ...\n})"
  2480. }
  2481. ]
  2482. }
  2483. },
  2484. "/session/status": {
  2485. "get": {
  2486. "operationId": "session.status",
  2487. "parameters": [
  2488. {
  2489. "in": "query",
  2490. "name": "directory",
  2491. "schema": {
  2492. "type": "string"
  2493. }
  2494. },
  2495. {
  2496. "in": "query",
  2497. "name": "workspace",
  2498. "schema": {
  2499. "type": "string"
  2500. }
  2501. }
  2502. ],
  2503. "summary": "Get session status",
  2504. "description": "Retrieve the current status of all sessions, including active, idle, and completed states.",
  2505. "responses": {
  2506. "200": {
  2507. "description": "Get session status",
  2508. "content": {
  2509. "application/json": {
  2510. "schema": {
  2511. "type": "object",
  2512. "propertyNames": {
  2513. "type": "string"
  2514. },
  2515. "additionalProperties": {
  2516. "$ref": "#/components/schemas/SessionStatus"
  2517. }
  2518. }
  2519. }
  2520. }
  2521. },
  2522. "400": {
  2523. "description": "Bad request",
  2524. "content": {
  2525. "application/json": {
  2526. "schema": {
  2527. "$ref": "#/components/schemas/BadRequestError"
  2528. }
  2529. }
  2530. }
  2531. }
  2532. },
  2533. "x-codeSamples": [
  2534. {
  2535. "lang": "js",
  2536. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.status({\n ...\n})"
  2537. }
  2538. ]
  2539. }
  2540. },
  2541. "/session/{sessionID}": {
  2542. "get": {
  2543. "operationId": "session.get",
  2544. "parameters": [
  2545. {
  2546. "in": "query",
  2547. "name": "directory",
  2548. "schema": {
  2549. "type": "string"
  2550. }
  2551. },
  2552. {
  2553. "in": "query",
  2554. "name": "workspace",
  2555. "schema": {
  2556. "type": "string"
  2557. }
  2558. },
  2559. {
  2560. "in": "path",
  2561. "name": "sessionID",
  2562. "schema": {
  2563. "type": "string",
  2564. "pattern": "^ses.*"
  2565. },
  2566. "required": true
  2567. }
  2568. ],
  2569. "summary": "Get session",
  2570. "description": "Retrieve detailed information about a specific OpenCode session.",
  2571. "tags": ["Session"],
  2572. "responses": {
  2573. "200": {
  2574. "description": "Get session",
  2575. "content": {
  2576. "application/json": {
  2577. "schema": {
  2578. "$ref": "#/components/schemas/Session"
  2579. }
  2580. }
  2581. }
  2582. },
  2583. "400": {
  2584. "description": "Bad request",
  2585. "content": {
  2586. "application/json": {
  2587. "schema": {
  2588. "$ref": "#/components/schemas/BadRequestError"
  2589. }
  2590. }
  2591. }
  2592. },
  2593. "404": {
  2594. "description": "Not found",
  2595. "content": {
  2596. "application/json": {
  2597. "schema": {
  2598. "$ref": "#/components/schemas/NotFoundError"
  2599. }
  2600. }
  2601. }
  2602. }
  2603. },
  2604. "x-codeSamples": [
  2605. {
  2606. "lang": "js",
  2607. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.get({\n ...\n})"
  2608. }
  2609. ]
  2610. },
  2611. "delete": {
  2612. "operationId": "session.delete",
  2613. "parameters": [
  2614. {
  2615. "in": "query",
  2616. "name": "directory",
  2617. "schema": {
  2618. "type": "string"
  2619. }
  2620. },
  2621. {
  2622. "in": "query",
  2623. "name": "workspace",
  2624. "schema": {
  2625. "type": "string"
  2626. }
  2627. },
  2628. {
  2629. "in": "path",
  2630. "name": "sessionID",
  2631. "schema": {
  2632. "type": "string",
  2633. "pattern": "^ses.*"
  2634. },
  2635. "required": true
  2636. }
  2637. ],
  2638. "summary": "Delete session",
  2639. "description": "Delete a session and permanently remove all associated data, including messages and history.",
  2640. "responses": {
  2641. "200": {
  2642. "description": "Successfully deleted session",
  2643. "content": {
  2644. "application/json": {
  2645. "schema": {
  2646. "type": "boolean"
  2647. }
  2648. }
  2649. }
  2650. },
  2651. "400": {
  2652. "description": "Bad request",
  2653. "content": {
  2654. "application/json": {
  2655. "schema": {
  2656. "$ref": "#/components/schemas/BadRequestError"
  2657. }
  2658. }
  2659. }
  2660. },
  2661. "404": {
  2662. "description": "Not found",
  2663. "content": {
  2664. "application/json": {
  2665. "schema": {
  2666. "$ref": "#/components/schemas/NotFoundError"
  2667. }
  2668. }
  2669. }
  2670. }
  2671. },
  2672. "x-codeSamples": [
  2673. {
  2674. "lang": "js",
  2675. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.delete({\n ...\n})"
  2676. }
  2677. ]
  2678. },
  2679. "patch": {
  2680. "operationId": "session.update",
  2681. "parameters": [
  2682. {
  2683. "in": "query",
  2684. "name": "directory",
  2685. "schema": {
  2686. "type": "string"
  2687. }
  2688. },
  2689. {
  2690. "in": "query",
  2691. "name": "workspace",
  2692. "schema": {
  2693. "type": "string"
  2694. }
  2695. },
  2696. {
  2697. "in": "path",
  2698. "name": "sessionID",
  2699. "schema": {
  2700. "type": "string",
  2701. "pattern": "^ses.*"
  2702. },
  2703. "required": true
  2704. }
  2705. ],
  2706. "summary": "Update session",
  2707. "description": "Update properties of an existing session, such as title or other metadata.",
  2708. "responses": {
  2709. "200": {
  2710. "description": "Successfully updated session",
  2711. "content": {
  2712. "application/json": {
  2713. "schema": {
  2714. "$ref": "#/components/schemas/Session"
  2715. }
  2716. }
  2717. }
  2718. },
  2719. "400": {
  2720. "description": "Bad request",
  2721. "content": {
  2722. "application/json": {
  2723. "schema": {
  2724. "$ref": "#/components/schemas/BadRequestError"
  2725. }
  2726. }
  2727. }
  2728. },
  2729. "404": {
  2730. "description": "Not found",
  2731. "content": {
  2732. "application/json": {
  2733. "schema": {
  2734. "$ref": "#/components/schemas/NotFoundError"
  2735. }
  2736. }
  2737. }
  2738. }
  2739. },
  2740. "requestBody": {
  2741. "content": {
  2742. "application/json": {
  2743. "schema": {
  2744. "type": "object",
  2745. "properties": {
  2746. "title": {
  2747. "type": "string"
  2748. },
  2749. "permission": {
  2750. "$ref": "#/components/schemas/PermissionRuleset"
  2751. },
  2752. "time": {
  2753. "type": "object",
  2754. "properties": {
  2755. "archived": {
  2756. "type": "number"
  2757. }
  2758. }
  2759. }
  2760. }
  2761. }
  2762. }
  2763. }
  2764. },
  2765. "x-codeSamples": [
  2766. {
  2767. "lang": "js",
  2768. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.update({\n ...\n})"
  2769. }
  2770. ]
  2771. }
  2772. },
  2773. "/session/{sessionID}/children": {
  2774. "get": {
  2775. "operationId": "session.children",
  2776. "parameters": [
  2777. {
  2778. "in": "query",
  2779. "name": "directory",
  2780. "schema": {
  2781. "type": "string"
  2782. }
  2783. },
  2784. {
  2785. "in": "query",
  2786. "name": "workspace",
  2787. "schema": {
  2788. "type": "string"
  2789. }
  2790. },
  2791. {
  2792. "in": "path",
  2793. "name": "sessionID",
  2794. "schema": {
  2795. "type": "string",
  2796. "pattern": "^ses.*"
  2797. },
  2798. "required": true
  2799. }
  2800. ],
  2801. "summary": "Get session children",
  2802. "tags": ["Session"],
  2803. "description": "Retrieve all child sessions that were forked from the specified parent session.",
  2804. "responses": {
  2805. "200": {
  2806. "description": "List of children",
  2807. "content": {
  2808. "application/json": {
  2809. "schema": {
  2810. "type": "array",
  2811. "items": {
  2812. "$ref": "#/components/schemas/Session"
  2813. }
  2814. }
  2815. }
  2816. }
  2817. },
  2818. "400": {
  2819. "description": "Bad request",
  2820. "content": {
  2821. "application/json": {
  2822. "schema": {
  2823. "$ref": "#/components/schemas/BadRequestError"
  2824. }
  2825. }
  2826. }
  2827. },
  2828. "404": {
  2829. "description": "Not found",
  2830. "content": {
  2831. "application/json": {
  2832. "schema": {
  2833. "$ref": "#/components/schemas/NotFoundError"
  2834. }
  2835. }
  2836. }
  2837. }
  2838. },
  2839. "x-codeSamples": [
  2840. {
  2841. "lang": "js",
  2842. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.children({\n ...\n})"
  2843. }
  2844. ]
  2845. }
  2846. },
  2847. "/session/{sessionID}/todo": {
  2848. "get": {
  2849. "operationId": "session.todo",
  2850. "parameters": [
  2851. {
  2852. "in": "query",
  2853. "name": "directory",
  2854. "schema": {
  2855. "type": "string"
  2856. }
  2857. },
  2858. {
  2859. "in": "query",
  2860. "name": "workspace",
  2861. "schema": {
  2862. "type": "string"
  2863. }
  2864. },
  2865. {
  2866. "in": "path",
  2867. "name": "sessionID",
  2868. "schema": {
  2869. "type": "string",
  2870. "pattern": "^ses.*"
  2871. },
  2872. "required": true
  2873. }
  2874. ],
  2875. "summary": "Get session todos",
  2876. "description": "Retrieve the todo list associated with a specific session, showing tasks and action items.",
  2877. "responses": {
  2878. "200": {
  2879. "description": "Todo list",
  2880. "content": {
  2881. "application/json": {
  2882. "schema": {
  2883. "type": "array",
  2884. "items": {
  2885. "$ref": "#/components/schemas/Todo"
  2886. }
  2887. }
  2888. }
  2889. }
  2890. },
  2891. "400": {
  2892. "description": "Bad request",
  2893. "content": {
  2894. "application/json": {
  2895. "schema": {
  2896. "$ref": "#/components/schemas/BadRequestError"
  2897. }
  2898. }
  2899. }
  2900. },
  2901. "404": {
  2902. "description": "Not found",
  2903. "content": {
  2904. "application/json": {
  2905. "schema": {
  2906. "$ref": "#/components/schemas/NotFoundError"
  2907. }
  2908. }
  2909. }
  2910. }
  2911. },
  2912. "x-codeSamples": [
  2913. {
  2914. "lang": "js",
  2915. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.todo({\n ...\n})"
  2916. }
  2917. ]
  2918. }
  2919. },
  2920. "/session/{sessionID}/init": {
  2921. "post": {
  2922. "operationId": "session.init",
  2923. "parameters": [
  2924. {
  2925. "in": "query",
  2926. "name": "directory",
  2927. "schema": {
  2928. "type": "string"
  2929. }
  2930. },
  2931. {
  2932. "in": "query",
  2933. "name": "workspace",
  2934. "schema": {
  2935. "type": "string"
  2936. }
  2937. },
  2938. {
  2939. "in": "path",
  2940. "name": "sessionID",
  2941. "schema": {
  2942. "type": "string",
  2943. "pattern": "^ses.*"
  2944. },
  2945. "required": true
  2946. }
  2947. ],
  2948. "summary": "Initialize session",
  2949. "description": "Analyze the current application and create an AGENTS.md file with project-specific agent configurations.",
  2950. "responses": {
  2951. "200": {
  2952. "description": "200",
  2953. "content": {
  2954. "application/json": {
  2955. "schema": {
  2956. "type": "boolean"
  2957. }
  2958. }
  2959. }
  2960. },
  2961. "400": {
  2962. "description": "Bad request",
  2963. "content": {
  2964. "application/json": {
  2965. "schema": {
  2966. "$ref": "#/components/schemas/BadRequestError"
  2967. }
  2968. }
  2969. }
  2970. },
  2971. "404": {
  2972. "description": "Not found",
  2973. "content": {
  2974. "application/json": {
  2975. "schema": {
  2976. "$ref": "#/components/schemas/NotFoundError"
  2977. }
  2978. }
  2979. }
  2980. }
  2981. },
  2982. "requestBody": {
  2983. "content": {
  2984. "application/json": {
  2985. "schema": {
  2986. "type": "object",
  2987. "properties": {
  2988. "modelID": {
  2989. "type": "string"
  2990. },
  2991. "providerID": {
  2992. "type": "string"
  2993. },
  2994. "messageID": {
  2995. "type": "string",
  2996. "pattern": "^msg.*"
  2997. }
  2998. },
  2999. "required": ["modelID", "providerID", "messageID"]
  3000. }
  3001. }
  3002. }
  3003. },
  3004. "x-codeSamples": [
  3005. {
  3006. "lang": "js",
  3007. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.init({\n ...\n})"
  3008. }
  3009. ]
  3010. }
  3011. },
  3012. "/session/{sessionID}/fork": {
  3013. "post": {
  3014. "operationId": "session.fork",
  3015. "parameters": [
  3016. {
  3017. "in": "query",
  3018. "name": "directory",
  3019. "schema": {
  3020. "type": "string"
  3021. }
  3022. },
  3023. {
  3024. "in": "query",
  3025. "name": "workspace",
  3026. "schema": {
  3027. "type": "string"
  3028. }
  3029. },
  3030. {
  3031. "in": "path",
  3032. "name": "sessionID",
  3033. "schema": {
  3034. "type": "string",
  3035. "pattern": "^ses.*"
  3036. },
  3037. "required": true
  3038. }
  3039. ],
  3040. "summary": "Fork session",
  3041. "description": "Create a new session by forking an existing session at a specific message point.",
  3042. "responses": {
  3043. "200": {
  3044. "description": "200",
  3045. "content": {
  3046. "application/json": {
  3047. "schema": {
  3048. "$ref": "#/components/schemas/Session"
  3049. }
  3050. }
  3051. }
  3052. }
  3053. },
  3054. "requestBody": {
  3055. "content": {
  3056. "application/json": {
  3057. "schema": {
  3058. "type": "object",
  3059. "properties": {
  3060. "messageID": {
  3061. "type": "string",
  3062. "pattern": "^msg.*"
  3063. }
  3064. }
  3065. }
  3066. }
  3067. }
  3068. },
  3069. "x-codeSamples": [
  3070. {
  3071. "lang": "js",
  3072. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.fork({\n ...\n})"
  3073. }
  3074. ]
  3075. }
  3076. },
  3077. "/session/{sessionID}/abort": {
  3078. "post": {
  3079. "operationId": "session.abort",
  3080. "parameters": [
  3081. {
  3082. "in": "query",
  3083. "name": "directory",
  3084. "schema": {
  3085. "type": "string"
  3086. }
  3087. },
  3088. {
  3089. "in": "query",
  3090. "name": "workspace",
  3091. "schema": {
  3092. "type": "string"
  3093. }
  3094. },
  3095. {
  3096. "in": "path",
  3097. "name": "sessionID",
  3098. "schema": {
  3099. "type": "string",
  3100. "pattern": "^ses.*"
  3101. },
  3102. "required": true
  3103. }
  3104. ],
  3105. "summary": "Abort session",
  3106. "description": "Abort an active session and stop any ongoing AI processing or command execution.",
  3107. "responses": {
  3108. "200": {
  3109. "description": "Aborted session",
  3110. "content": {
  3111. "application/json": {
  3112. "schema": {
  3113. "type": "boolean"
  3114. }
  3115. }
  3116. }
  3117. },
  3118. "400": {
  3119. "description": "Bad request",
  3120. "content": {
  3121. "application/json": {
  3122. "schema": {
  3123. "$ref": "#/components/schemas/BadRequestError"
  3124. }
  3125. }
  3126. }
  3127. },
  3128. "404": {
  3129. "description": "Not found",
  3130. "content": {
  3131. "application/json": {
  3132. "schema": {
  3133. "$ref": "#/components/schemas/NotFoundError"
  3134. }
  3135. }
  3136. }
  3137. }
  3138. },
  3139. "x-codeSamples": [
  3140. {
  3141. "lang": "js",
  3142. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.abort({\n ...\n})"
  3143. }
  3144. ]
  3145. }
  3146. },
  3147. "/session/{sessionID}/share": {
  3148. "post": {
  3149. "operationId": "session.share",
  3150. "parameters": [
  3151. {
  3152. "in": "query",
  3153. "name": "directory",
  3154. "schema": {
  3155. "type": "string"
  3156. }
  3157. },
  3158. {
  3159. "in": "query",
  3160. "name": "workspace",
  3161. "schema": {
  3162. "type": "string"
  3163. }
  3164. },
  3165. {
  3166. "in": "path",
  3167. "name": "sessionID",
  3168. "schema": {
  3169. "type": "string",
  3170. "pattern": "^ses.*"
  3171. },
  3172. "required": true
  3173. }
  3174. ],
  3175. "summary": "Share session",
  3176. "description": "Create a shareable link for a session, allowing others to view the conversation.",
  3177. "responses": {
  3178. "200": {
  3179. "description": "Successfully shared session",
  3180. "content": {
  3181. "application/json": {
  3182. "schema": {
  3183. "$ref": "#/components/schemas/Session"
  3184. }
  3185. }
  3186. }
  3187. },
  3188. "400": {
  3189. "description": "Bad request",
  3190. "content": {
  3191. "application/json": {
  3192. "schema": {
  3193. "$ref": "#/components/schemas/BadRequestError"
  3194. }
  3195. }
  3196. }
  3197. },
  3198. "404": {
  3199. "description": "Not found",
  3200. "content": {
  3201. "application/json": {
  3202. "schema": {
  3203. "$ref": "#/components/schemas/NotFoundError"
  3204. }
  3205. }
  3206. }
  3207. }
  3208. },
  3209. "x-codeSamples": [
  3210. {
  3211. "lang": "js",
  3212. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.share({\n ...\n})"
  3213. }
  3214. ]
  3215. },
  3216. "delete": {
  3217. "operationId": "session.unshare",
  3218. "parameters": [
  3219. {
  3220. "in": "query",
  3221. "name": "directory",
  3222. "schema": {
  3223. "type": "string"
  3224. }
  3225. },
  3226. {
  3227. "in": "query",
  3228. "name": "workspace",
  3229. "schema": {
  3230. "type": "string"
  3231. }
  3232. },
  3233. {
  3234. "in": "path",
  3235. "name": "sessionID",
  3236. "schema": {
  3237. "type": "string",
  3238. "pattern": "^ses.*"
  3239. },
  3240. "required": true
  3241. }
  3242. ],
  3243. "summary": "Unshare session",
  3244. "description": "Remove the shareable link for a session, making it private again.",
  3245. "responses": {
  3246. "200": {
  3247. "description": "Successfully unshared session",
  3248. "content": {
  3249. "application/json": {
  3250. "schema": {
  3251. "$ref": "#/components/schemas/Session"
  3252. }
  3253. }
  3254. }
  3255. },
  3256. "400": {
  3257. "description": "Bad request",
  3258. "content": {
  3259. "application/json": {
  3260. "schema": {
  3261. "$ref": "#/components/schemas/BadRequestError"
  3262. }
  3263. }
  3264. }
  3265. },
  3266. "404": {
  3267. "description": "Not found",
  3268. "content": {
  3269. "application/json": {
  3270. "schema": {
  3271. "$ref": "#/components/schemas/NotFoundError"
  3272. }
  3273. }
  3274. }
  3275. }
  3276. },
  3277. "x-codeSamples": [
  3278. {
  3279. "lang": "js",
  3280. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.unshare({\n ...\n})"
  3281. }
  3282. ]
  3283. }
  3284. },
  3285. "/session/{sessionID}/diff": {
  3286. "get": {
  3287. "operationId": "session.diff",
  3288. "parameters": [
  3289. {
  3290. "in": "query",
  3291. "name": "directory",
  3292. "schema": {
  3293. "type": "string"
  3294. }
  3295. },
  3296. {
  3297. "in": "query",
  3298. "name": "workspace",
  3299. "schema": {
  3300. "type": "string"
  3301. }
  3302. },
  3303. {
  3304. "in": "path",
  3305. "name": "sessionID",
  3306. "schema": {
  3307. "type": "string",
  3308. "pattern": "^ses.*"
  3309. },
  3310. "required": true
  3311. },
  3312. {
  3313. "in": "query",
  3314. "name": "messageID",
  3315. "schema": {
  3316. "type": "string",
  3317. "pattern": "^msg.*"
  3318. }
  3319. }
  3320. ],
  3321. "summary": "Get message diff",
  3322. "description": "Get the file changes (diff) that resulted from a specific user message in the session.",
  3323. "responses": {
  3324. "200": {
  3325. "description": "Successfully retrieved diff",
  3326. "content": {
  3327. "application/json": {
  3328. "schema": {
  3329. "type": "array",
  3330. "items": {
  3331. "$ref": "#/components/schemas/SnapshotFileDiff"
  3332. }
  3333. }
  3334. }
  3335. }
  3336. }
  3337. },
  3338. "x-codeSamples": [
  3339. {
  3340. "lang": "js",
  3341. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.diff({\n ...\n})"
  3342. }
  3343. ]
  3344. }
  3345. },
  3346. "/session/{sessionID}/summarize": {
  3347. "post": {
  3348. "operationId": "session.summarize",
  3349. "parameters": [
  3350. {
  3351. "in": "query",
  3352. "name": "directory",
  3353. "schema": {
  3354. "type": "string"
  3355. }
  3356. },
  3357. {
  3358. "in": "query",
  3359. "name": "workspace",
  3360. "schema": {
  3361. "type": "string"
  3362. }
  3363. },
  3364. {
  3365. "in": "path",
  3366. "name": "sessionID",
  3367. "schema": {
  3368. "type": "string",
  3369. "pattern": "^ses.*"
  3370. },
  3371. "required": true
  3372. }
  3373. ],
  3374. "summary": "Summarize session",
  3375. "description": "Generate a concise summary of the session using AI compaction to preserve key information.",
  3376. "responses": {
  3377. "200": {
  3378. "description": "Summarized session",
  3379. "content": {
  3380. "application/json": {
  3381. "schema": {
  3382. "type": "boolean"
  3383. }
  3384. }
  3385. }
  3386. },
  3387. "400": {
  3388. "description": "Bad request",
  3389. "content": {
  3390. "application/json": {
  3391. "schema": {
  3392. "$ref": "#/components/schemas/BadRequestError"
  3393. }
  3394. }
  3395. }
  3396. },
  3397. "404": {
  3398. "description": "Not found",
  3399. "content": {
  3400. "application/json": {
  3401. "schema": {
  3402. "$ref": "#/components/schemas/NotFoundError"
  3403. }
  3404. }
  3405. }
  3406. }
  3407. },
  3408. "requestBody": {
  3409. "content": {
  3410. "application/json": {
  3411. "schema": {
  3412. "type": "object",
  3413. "properties": {
  3414. "providerID": {
  3415. "type": "string"
  3416. },
  3417. "modelID": {
  3418. "type": "string"
  3419. },
  3420. "auto": {
  3421. "default": false,
  3422. "type": "boolean"
  3423. }
  3424. },
  3425. "required": ["providerID", "modelID"]
  3426. }
  3427. }
  3428. }
  3429. },
  3430. "x-codeSamples": [
  3431. {
  3432. "lang": "js",
  3433. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.summarize({\n ...\n})"
  3434. }
  3435. ]
  3436. }
  3437. },
  3438. "/session/{sessionID}/message": {
  3439. "get": {
  3440. "operationId": "session.messages",
  3441. "parameters": [
  3442. {
  3443. "in": "query",
  3444. "name": "directory",
  3445. "schema": {
  3446. "type": "string"
  3447. }
  3448. },
  3449. {
  3450. "in": "query",
  3451. "name": "workspace",
  3452. "schema": {
  3453. "type": "string"
  3454. }
  3455. },
  3456. {
  3457. "in": "path",
  3458. "name": "sessionID",
  3459. "schema": {
  3460. "type": "string",
  3461. "pattern": "^ses.*"
  3462. },
  3463. "required": true
  3464. },
  3465. {
  3466. "in": "query",
  3467. "name": "limit",
  3468. "schema": {
  3469. "type": "integer",
  3470. "minimum": 0,
  3471. "maximum": 9007199254740991
  3472. },
  3473. "description": "Maximum number of messages to return"
  3474. },
  3475. {
  3476. "in": "query",
  3477. "name": "before",
  3478. "schema": {
  3479. "type": "string"
  3480. }
  3481. }
  3482. ],
  3483. "summary": "Get session messages",
  3484. "description": "Retrieve all messages in a session, including user prompts and AI responses.",
  3485. "responses": {
  3486. "200": {
  3487. "description": "List of messages",
  3488. "content": {
  3489. "application/json": {
  3490. "schema": {
  3491. "type": "array",
  3492. "items": {
  3493. "type": "object",
  3494. "properties": {
  3495. "info": {
  3496. "$ref": "#/components/schemas/Message"
  3497. },
  3498. "parts": {
  3499. "type": "array",
  3500. "items": {
  3501. "$ref": "#/components/schemas/Part"
  3502. }
  3503. }
  3504. },
  3505. "required": ["info", "parts"]
  3506. }
  3507. }
  3508. }
  3509. }
  3510. },
  3511. "400": {
  3512. "description": "Bad request",
  3513. "content": {
  3514. "application/json": {
  3515. "schema": {
  3516. "$ref": "#/components/schemas/BadRequestError"
  3517. }
  3518. }
  3519. }
  3520. },
  3521. "404": {
  3522. "description": "Not found",
  3523. "content": {
  3524. "application/json": {
  3525. "schema": {
  3526. "$ref": "#/components/schemas/NotFoundError"
  3527. }
  3528. }
  3529. }
  3530. }
  3531. },
  3532. "x-codeSamples": [
  3533. {
  3534. "lang": "js",
  3535. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.messages({\n ...\n})"
  3536. }
  3537. ]
  3538. },
  3539. "post": {
  3540. "operationId": "session.prompt",
  3541. "parameters": [
  3542. {
  3543. "in": "query",
  3544. "name": "directory",
  3545. "schema": {
  3546. "type": "string"
  3547. }
  3548. },
  3549. {
  3550. "in": "query",
  3551. "name": "workspace",
  3552. "schema": {
  3553. "type": "string"
  3554. }
  3555. },
  3556. {
  3557. "in": "path",
  3558. "name": "sessionID",
  3559. "schema": {
  3560. "type": "string",
  3561. "pattern": "^ses.*"
  3562. },
  3563. "required": true
  3564. }
  3565. ],
  3566. "summary": "Send message",
  3567. "description": "Create and send a new message to a session, streaming the AI response.",
  3568. "responses": {
  3569. "200": {
  3570. "description": "Created message",
  3571. "content": {
  3572. "application/json": {
  3573. "schema": {
  3574. "type": "object",
  3575. "properties": {
  3576. "info": {
  3577. "$ref": "#/components/schemas/AssistantMessage"
  3578. },
  3579. "parts": {
  3580. "type": "array",
  3581. "items": {
  3582. "$ref": "#/components/schemas/Part"
  3583. }
  3584. }
  3585. },
  3586. "required": ["info", "parts"]
  3587. }
  3588. }
  3589. }
  3590. },
  3591. "400": {
  3592. "description": "Bad request",
  3593. "content": {
  3594. "application/json": {
  3595. "schema": {
  3596. "$ref": "#/components/schemas/BadRequestError"
  3597. }
  3598. }
  3599. }
  3600. },
  3601. "404": {
  3602. "description": "Not found",
  3603. "content": {
  3604. "application/json": {
  3605. "schema": {
  3606. "$ref": "#/components/schemas/NotFoundError"
  3607. }
  3608. }
  3609. }
  3610. }
  3611. },
  3612. "requestBody": {
  3613. "content": {
  3614. "application/json": {
  3615. "schema": {
  3616. "type": "object",
  3617. "properties": {
  3618. "messageID": {
  3619. "type": "string",
  3620. "pattern": "^msg.*"
  3621. },
  3622. "model": {
  3623. "type": "object",
  3624. "properties": {
  3625. "providerID": {
  3626. "type": "string"
  3627. },
  3628. "modelID": {
  3629. "type": "string"
  3630. }
  3631. },
  3632. "required": ["providerID", "modelID"]
  3633. },
  3634. "agent": {
  3635. "type": "string"
  3636. },
  3637. "noReply": {
  3638. "type": "boolean"
  3639. },
  3640. "tools": {
  3641. "description": "@deprecated tools and permissions have been merged, you can set permissions on the session itself now",
  3642. "type": "object",
  3643. "propertyNames": {
  3644. "type": "string"
  3645. },
  3646. "additionalProperties": {
  3647. "type": "boolean"
  3648. }
  3649. },
  3650. "format": {
  3651. "$ref": "#/components/schemas/OutputFormat"
  3652. },
  3653. "system": {
  3654. "type": "string"
  3655. },
  3656. "variant": {
  3657. "type": "string"
  3658. },
  3659. "parts": {
  3660. "type": "array",
  3661. "items": {
  3662. "anyOf": [
  3663. {
  3664. "$ref": "#/components/schemas/TextPartInput"
  3665. },
  3666. {
  3667. "$ref": "#/components/schemas/FilePartInput"
  3668. },
  3669. {
  3670. "$ref": "#/components/schemas/AgentPartInput"
  3671. },
  3672. {
  3673. "$ref": "#/components/schemas/SubtaskPartInput"
  3674. }
  3675. ]
  3676. }
  3677. }
  3678. },
  3679. "required": ["parts"]
  3680. }
  3681. }
  3682. }
  3683. },
  3684. "x-codeSamples": [
  3685. {
  3686. "lang": "js",
  3687. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.prompt({\n ...\n})"
  3688. }
  3689. ]
  3690. }
  3691. },
  3692. "/session/{sessionID}/message/{messageID}": {
  3693. "get": {
  3694. "operationId": "session.message",
  3695. "parameters": [
  3696. {
  3697. "in": "query",
  3698. "name": "directory",
  3699. "schema": {
  3700. "type": "string"
  3701. }
  3702. },
  3703. {
  3704. "in": "query",
  3705. "name": "workspace",
  3706. "schema": {
  3707. "type": "string"
  3708. }
  3709. },
  3710. {
  3711. "in": "path",
  3712. "name": "sessionID",
  3713. "schema": {
  3714. "type": "string",
  3715. "pattern": "^ses.*"
  3716. },
  3717. "required": true
  3718. },
  3719. {
  3720. "in": "path",
  3721. "name": "messageID",
  3722. "schema": {
  3723. "type": "string",
  3724. "pattern": "^msg.*"
  3725. },
  3726. "required": true
  3727. }
  3728. ],
  3729. "summary": "Get message",
  3730. "description": "Retrieve a specific message from a session by its message ID.",
  3731. "responses": {
  3732. "200": {
  3733. "description": "Message",
  3734. "content": {
  3735. "application/json": {
  3736. "schema": {
  3737. "type": "object",
  3738. "properties": {
  3739. "info": {
  3740. "$ref": "#/components/schemas/Message"
  3741. },
  3742. "parts": {
  3743. "type": "array",
  3744. "items": {
  3745. "$ref": "#/components/schemas/Part"
  3746. }
  3747. }
  3748. },
  3749. "required": ["info", "parts"]
  3750. }
  3751. }
  3752. }
  3753. },
  3754. "400": {
  3755. "description": "Bad request",
  3756. "content": {
  3757. "application/json": {
  3758. "schema": {
  3759. "$ref": "#/components/schemas/BadRequestError"
  3760. }
  3761. }
  3762. }
  3763. },
  3764. "404": {
  3765. "description": "Not found",
  3766. "content": {
  3767. "application/json": {
  3768. "schema": {
  3769. "$ref": "#/components/schemas/NotFoundError"
  3770. }
  3771. }
  3772. }
  3773. }
  3774. },
  3775. "x-codeSamples": [
  3776. {
  3777. "lang": "js",
  3778. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.message({\n ...\n})"
  3779. }
  3780. ]
  3781. },
  3782. "delete": {
  3783. "operationId": "session.deleteMessage",
  3784. "parameters": [
  3785. {
  3786. "in": "query",
  3787. "name": "directory",
  3788. "schema": {
  3789. "type": "string"
  3790. }
  3791. },
  3792. {
  3793. "in": "query",
  3794. "name": "workspace",
  3795. "schema": {
  3796. "type": "string"
  3797. }
  3798. },
  3799. {
  3800. "in": "path",
  3801. "name": "sessionID",
  3802. "schema": {
  3803. "type": "string",
  3804. "pattern": "^ses.*"
  3805. },
  3806. "required": true
  3807. },
  3808. {
  3809. "in": "path",
  3810. "name": "messageID",
  3811. "schema": {
  3812. "type": "string",
  3813. "pattern": "^msg.*"
  3814. },
  3815. "required": true
  3816. }
  3817. ],
  3818. "summary": "Delete message",
  3819. "description": "Permanently delete a specific message (and all of its parts) from a session. This does not revert any file changes that may have been made while processing the message.",
  3820. "responses": {
  3821. "200": {
  3822. "description": "Successfully deleted message",
  3823. "content": {
  3824. "application/json": {
  3825. "schema": {
  3826. "type": "boolean"
  3827. }
  3828. }
  3829. }
  3830. },
  3831. "400": {
  3832. "description": "Bad request",
  3833. "content": {
  3834. "application/json": {
  3835. "schema": {
  3836. "$ref": "#/components/schemas/BadRequestError"
  3837. }
  3838. }
  3839. }
  3840. },
  3841. "404": {
  3842. "description": "Not found",
  3843. "content": {
  3844. "application/json": {
  3845. "schema": {
  3846. "$ref": "#/components/schemas/NotFoundError"
  3847. }
  3848. }
  3849. }
  3850. }
  3851. },
  3852. "x-codeSamples": [
  3853. {
  3854. "lang": "js",
  3855. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.deleteMessage({\n ...\n})"
  3856. }
  3857. ]
  3858. }
  3859. },
  3860. "/session/{sessionID}/message/{messageID}/part/{partID}": {
  3861. "delete": {
  3862. "operationId": "part.delete",
  3863. "parameters": [
  3864. {
  3865. "in": "query",
  3866. "name": "directory",
  3867. "schema": {
  3868. "type": "string"
  3869. }
  3870. },
  3871. {
  3872. "in": "query",
  3873. "name": "workspace",
  3874. "schema": {
  3875. "type": "string"
  3876. }
  3877. },
  3878. {
  3879. "in": "path",
  3880. "name": "sessionID",
  3881. "schema": {
  3882. "type": "string",
  3883. "pattern": "^ses.*"
  3884. },
  3885. "required": true
  3886. },
  3887. {
  3888. "in": "path",
  3889. "name": "messageID",
  3890. "schema": {
  3891. "type": "string",
  3892. "pattern": "^msg.*"
  3893. },
  3894. "required": true
  3895. },
  3896. {
  3897. "in": "path",
  3898. "name": "partID",
  3899. "schema": {
  3900. "type": "string",
  3901. "pattern": "^prt.*"
  3902. },
  3903. "required": true
  3904. }
  3905. ],
  3906. "description": "Delete a part from a message",
  3907. "responses": {
  3908. "200": {
  3909. "description": "Successfully deleted part",
  3910. "content": {
  3911. "application/json": {
  3912. "schema": {
  3913. "type": "boolean"
  3914. }
  3915. }
  3916. }
  3917. },
  3918. "400": {
  3919. "description": "Bad request",
  3920. "content": {
  3921. "application/json": {
  3922. "schema": {
  3923. "$ref": "#/components/schemas/BadRequestError"
  3924. }
  3925. }
  3926. }
  3927. },
  3928. "404": {
  3929. "description": "Not found",
  3930. "content": {
  3931. "application/json": {
  3932. "schema": {
  3933. "$ref": "#/components/schemas/NotFoundError"
  3934. }
  3935. }
  3936. }
  3937. }
  3938. },
  3939. "x-codeSamples": [
  3940. {
  3941. "lang": "js",
  3942. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.part.delete({\n ...\n})"
  3943. }
  3944. ]
  3945. },
  3946. "patch": {
  3947. "operationId": "part.update",
  3948. "parameters": [
  3949. {
  3950. "in": "query",
  3951. "name": "directory",
  3952. "schema": {
  3953. "type": "string"
  3954. }
  3955. },
  3956. {
  3957. "in": "query",
  3958. "name": "workspace",
  3959. "schema": {
  3960. "type": "string"
  3961. }
  3962. },
  3963. {
  3964. "in": "path",
  3965. "name": "sessionID",
  3966. "schema": {
  3967. "type": "string",
  3968. "pattern": "^ses.*"
  3969. },
  3970. "required": true
  3971. },
  3972. {
  3973. "in": "path",
  3974. "name": "messageID",
  3975. "schema": {
  3976. "type": "string",
  3977. "pattern": "^msg.*"
  3978. },
  3979. "required": true
  3980. },
  3981. {
  3982. "in": "path",
  3983. "name": "partID",
  3984. "schema": {
  3985. "type": "string",
  3986. "pattern": "^prt.*"
  3987. },
  3988. "required": true
  3989. }
  3990. ],
  3991. "description": "Update a part in a message",
  3992. "responses": {
  3993. "200": {
  3994. "description": "Successfully updated part",
  3995. "content": {
  3996. "application/json": {
  3997. "schema": {
  3998. "$ref": "#/components/schemas/Part"
  3999. }
  4000. }
  4001. }
  4002. },
  4003. "400": {
  4004. "description": "Bad request",
  4005. "content": {
  4006. "application/json": {
  4007. "schema": {
  4008. "$ref": "#/components/schemas/BadRequestError"
  4009. }
  4010. }
  4011. }
  4012. },
  4013. "404": {
  4014. "description": "Not found",
  4015. "content": {
  4016. "application/json": {
  4017. "schema": {
  4018. "$ref": "#/components/schemas/NotFoundError"
  4019. }
  4020. }
  4021. }
  4022. }
  4023. },
  4024. "requestBody": {
  4025. "content": {
  4026. "application/json": {
  4027. "schema": {
  4028. "$ref": "#/components/schemas/Part"
  4029. }
  4030. }
  4031. }
  4032. },
  4033. "x-codeSamples": [
  4034. {
  4035. "lang": "js",
  4036. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.part.update({\n ...\n})"
  4037. }
  4038. ]
  4039. }
  4040. },
  4041. "/session/{sessionID}/prompt_async": {
  4042. "post": {
  4043. "operationId": "session.prompt_async",
  4044. "parameters": [
  4045. {
  4046. "in": "query",
  4047. "name": "directory",
  4048. "schema": {
  4049. "type": "string"
  4050. }
  4051. },
  4052. {
  4053. "in": "query",
  4054. "name": "workspace",
  4055. "schema": {
  4056. "type": "string"
  4057. }
  4058. },
  4059. {
  4060. "in": "path",
  4061. "name": "sessionID",
  4062. "schema": {
  4063. "type": "string",
  4064. "pattern": "^ses.*"
  4065. },
  4066. "required": true
  4067. }
  4068. ],
  4069. "summary": "Send async message",
  4070. "description": "Create and send a new message to a session asynchronously, starting the session if needed and returning immediately.",
  4071. "responses": {
  4072. "204": {
  4073. "description": "Prompt accepted"
  4074. },
  4075. "400": {
  4076. "description": "Bad request",
  4077. "content": {
  4078. "application/json": {
  4079. "schema": {
  4080. "$ref": "#/components/schemas/BadRequestError"
  4081. }
  4082. }
  4083. }
  4084. },
  4085. "404": {
  4086. "description": "Not found",
  4087. "content": {
  4088. "application/json": {
  4089. "schema": {
  4090. "$ref": "#/components/schemas/NotFoundError"
  4091. }
  4092. }
  4093. }
  4094. }
  4095. },
  4096. "requestBody": {
  4097. "content": {
  4098. "application/json": {
  4099. "schema": {
  4100. "type": "object",
  4101. "properties": {
  4102. "messageID": {
  4103. "type": "string",
  4104. "pattern": "^msg.*"
  4105. },
  4106. "model": {
  4107. "type": "object",
  4108. "properties": {
  4109. "providerID": {
  4110. "type": "string"
  4111. },
  4112. "modelID": {
  4113. "type": "string"
  4114. }
  4115. },
  4116. "required": ["providerID", "modelID"]
  4117. },
  4118. "agent": {
  4119. "type": "string"
  4120. },
  4121. "noReply": {
  4122. "type": "boolean"
  4123. },
  4124. "tools": {
  4125. "description": "@deprecated tools and permissions have been merged, you can set permissions on the session itself now",
  4126. "type": "object",
  4127. "propertyNames": {
  4128. "type": "string"
  4129. },
  4130. "additionalProperties": {
  4131. "type": "boolean"
  4132. }
  4133. },
  4134. "format": {
  4135. "$ref": "#/components/schemas/OutputFormat"
  4136. },
  4137. "system": {
  4138. "type": "string"
  4139. },
  4140. "variant": {
  4141. "type": "string"
  4142. },
  4143. "parts": {
  4144. "type": "array",
  4145. "items": {
  4146. "anyOf": [
  4147. {
  4148. "$ref": "#/components/schemas/TextPartInput"
  4149. },
  4150. {
  4151. "$ref": "#/components/schemas/FilePartInput"
  4152. },
  4153. {
  4154. "$ref": "#/components/schemas/AgentPartInput"
  4155. },
  4156. {
  4157. "$ref": "#/components/schemas/SubtaskPartInput"
  4158. }
  4159. ]
  4160. }
  4161. }
  4162. },
  4163. "required": ["parts"]
  4164. }
  4165. }
  4166. }
  4167. },
  4168. "x-codeSamples": [
  4169. {
  4170. "lang": "js",
  4171. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.prompt_async({\n ...\n})"
  4172. }
  4173. ]
  4174. }
  4175. },
  4176. "/session/{sessionID}/command": {
  4177. "post": {
  4178. "operationId": "session.command",
  4179. "parameters": [
  4180. {
  4181. "in": "query",
  4182. "name": "directory",
  4183. "schema": {
  4184. "type": "string"
  4185. }
  4186. },
  4187. {
  4188. "in": "query",
  4189. "name": "workspace",
  4190. "schema": {
  4191. "type": "string"
  4192. }
  4193. },
  4194. {
  4195. "in": "path",
  4196. "name": "sessionID",
  4197. "schema": {
  4198. "type": "string",
  4199. "pattern": "^ses.*"
  4200. },
  4201. "required": true
  4202. }
  4203. ],
  4204. "summary": "Send command",
  4205. "description": "Send a new command to a session for execution by the AI assistant.",
  4206. "responses": {
  4207. "200": {
  4208. "description": "Created message",
  4209. "content": {
  4210. "application/json": {
  4211. "schema": {
  4212. "type": "object",
  4213. "properties": {
  4214. "info": {
  4215. "$ref": "#/components/schemas/AssistantMessage"
  4216. },
  4217. "parts": {
  4218. "type": "array",
  4219. "items": {
  4220. "$ref": "#/components/schemas/Part"
  4221. }
  4222. }
  4223. },
  4224. "required": ["info", "parts"]
  4225. }
  4226. }
  4227. }
  4228. },
  4229. "400": {
  4230. "description": "Bad request",
  4231. "content": {
  4232. "application/json": {
  4233. "schema": {
  4234. "$ref": "#/components/schemas/BadRequestError"
  4235. }
  4236. }
  4237. }
  4238. },
  4239. "404": {
  4240. "description": "Not found",
  4241. "content": {
  4242. "application/json": {
  4243. "schema": {
  4244. "$ref": "#/components/schemas/NotFoundError"
  4245. }
  4246. }
  4247. }
  4248. }
  4249. },
  4250. "requestBody": {
  4251. "content": {
  4252. "application/json": {
  4253. "schema": {
  4254. "type": "object",
  4255. "properties": {
  4256. "messageID": {
  4257. "type": "string",
  4258. "pattern": "^msg.*"
  4259. },
  4260. "agent": {
  4261. "type": "string"
  4262. },
  4263. "model": {
  4264. "type": "string"
  4265. },
  4266. "arguments": {
  4267. "type": "string"
  4268. },
  4269. "command": {
  4270. "type": "string"
  4271. },
  4272. "variant": {
  4273. "type": "string"
  4274. },
  4275. "parts": {
  4276. "type": "array",
  4277. "items": {
  4278. "type": "object",
  4279. "properties": {
  4280. "id": {
  4281. "type": "string",
  4282. "pattern": "^prt.*"
  4283. },
  4284. "type": {
  4285. "type": "string",
  4286. "const": "file"
  4287. },
  4288. "mime": {
  4289. "type": "string"
  4290. },
  4291. "filename": {
  4292. "type": "string"
  4293. },
  4294. "url": {
  4295. "type": "string"
  4296. },
  4297. "source": {
  4298. "$ref": "#/components/schemas/FilePartSource"
  4299. }
  4300. },
  4301. "required": ["type", "mime", "url"]
  4302. }
  4303. }
  4304. },
  4305. "required": ["arguments", "command"]
  4306. }
  4307. }
  4308. }
  4309. },
  4310. "x-codeSamples": [
  4311. {
  4312. "lang": "js",
  4313. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.command({\n ...\n})"
  4314. }
  4315. ]
  4316. }
  4317. },
  4318. "/session/{sessionID}/shell": {
  4319. "post": {
  4320. "operationId": "session.shell",
  4321. "parameters": [
  4322. {
  4323. "in": "query",
  4324. "name": "directory",
  4325. "schema": {
  4326. "type": "string"
  4327. }
  4328. },
  4329. {
  4330. "in": "query",
  4331. "name": "workspace",
  4332. "schema": {
  4333. "type": "string"
  4334. }
  4335. },
  4336. {
  4337. "in": "path",
  4338. "name": "sessionID",
  4339. "schema": {
  4340. "type": "string",
  4341. "pattern": "^ses.*"
  4342. },
  4343. "required": true
  4344. }
  4345. ],
  4346. "summary": "Run shell command",
  4347. "description": "Execute a shell command within the session context and return the AI's response.",
  4348. "responses": {
  4349. "200": {
  4350. "description": "Created message",
  4351. "content": {
  4352. "application/json": {
  4353. "schema": {
  4354. "type": "object",
  4355. "properties": {
  4356. "info": {
  4357. "$ref": "#/components/schemas/Message"
  4358. },
  4359. "parts": {
  4360. "type": "array",
  4361. "items": {
  4362. "$ref": "#/components/schemas/Part"
  4363. }
  4364. }
  4365. },
  4366. "required": ["info", "parts"]
  4367. }
  4368. }
  4369. }
  4370. },
  4371. "400": {
  4372. "description": "Bad request",
  4373. "content": {
  4374. "application/json": {
  4375. "schema": {
  4376. "$ref": "#/components/schemas/BadRequestError"
  4377. }
  4378. }
  4379. }
  4380. },
  4381. "404": {
  4382. "description": "Not found",
  4383. "content": {
  4384. "application/json": {
  4385. "schema": {
  4386. "$ref": "#/components/schemas/NotFoundError"
  4387. }
  4388. }
  4389. }
  4390. }
  4391. },
  4392. "requestBody": {
  4393. "content": {
  4394. "application/json": {
  4395. "schema": {
  4396. "type": "object",
  4397. "properties": {
  4398. "messageID": {
  4399. "type": "string",
  4400. "pattern": "^msg.*"
  4401. },
  4402. "agent": {
  4403. "type": "string"
  4404. },
  4405. "model": {
  4406. "type": "object",
  4407. "properties": {
  4408. "providerID": {
  4409. "type": "string"
  4410. },
  4411. "modelID": {
  4412. "type": "string"
  4413. }
  4414. },
  4415. "required": ["providerID", "modelID"]
  4416. },
  4417. "command": {
  4418. "type": "string"
  4419. }
  4420. },
  4421. "required": ["agent", "command"]
  4422. }
  4423. }
  4424. }
  4425. },
  4426. "x-codeSamples": [
  4427. {
  4428. "lang": "js",
  4429. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.shell({\n ...\n})"
  4430. }
  4431. ]
  4432. }
  4433. },
  4434. "/session/{sessionID}/revert": {
  4435. "post": {
  4436. "operationId": "session.revert",
  4437. "parameters": [
  4438. {
  4439. "in": "query",
  4440. "name": "directory",
  4441. "schema": {
  4442. "type": "string"
  4443. }
  4444. },
  4445. {
  4446. "in": "query",
  4447. "name": "workspace",
  4448. "schema": {
  4449. "type": "string"
  4450. }
  4451. },
  4452. {
  4453. "in": "path",
  4454. "name": "sessionID",
  4455. "schema": {
  4456. "type": "string",
  4457. "pattern": "^ses.*"
  4458. },
  4459. "required": true
  4460. }
  4461. ],
  4462. "summary": "Revert message",
  4463. "description": "Revert a specific message in a session, undoing its effects and restoring the previous state.",
  4464. "responses": {
  4465. "200": {
  4466. "description": "Updated session",
  4467. "content": {
  4468. "application/json": {
  4469. "schema": {
  4470. "$ref": "#/components/schemas/Session"
  4471. }
  4472. }
  4473. }
  4474. },
  4475. "400": {
  4476. "description": "Bad request",
  4477. "content": {
  4478. "application/json": {
  4479. "schema": {
  4480. "$ref": "#/components/schemas/BadRequestError"
  4481. }
  4482. }
  4483. }
  4484. },
  4485. "404": {
  4486. "description": "Not found",
  4487. "content": {
  4488. "application/json": {
  4489. "schema": {
  4490. "$ref": "#/components/schemas/NotFoundError"
  4491. }
  4492. }
  4493. }
  4494. }
  4495. },
  4496. "requestBody": {
  4497. "content": {
  4498. "application/json": {
  4499. "schema": {
  4500. "type": "object",
  4501. "properties": {
  4502. "messageID": {
  4503. "type": "string",
  4504. "pattern": "^msg.*"
  4505. },
  4506. "partID": {
  4507. "type": "string",
  4508. "pattern": "^prt.*"
  4509. }
  4510. },
  4511. "required": ["messageID"]
  4512. }
  4513. }
  4514. }
  4515. },
  4516. "x-codeSamples": [
  4517. {
  4518. "lang": "js",
  4519. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.revert({\n ...\n})"
  4520. }
  4521. ]
  4522. }
  4523. },
  4524. "/session/{sessionID}/unrevert": {
  4525. "post": {
  4526. "operationId": "session.unrevert",
  4527. "parameters": [
  4528. {
  4529. "in": "query",
  4530. "name": "directory",
  4531. "schema": {
  4532. "type": "string"
  4533. }
  4534. },
  4535. {
  4536. "in": "query",
  4537. "name": "workspace",
  4538. "schema": {
  4539. "type": "string"
  4540. }
  4541. },
  4542. {
  4543. "in": "path",
  4544. "name": "sessionID",
  4545. "schema": {
  4546. "type": "string",
  4547. "pattern": "^ses.*"
  4548. },
  4549. "required": true
  4550. }
  4551. ],
  4552. "summary": "Restore reverted messages",
  4553. "description": "Restore all previously reverted messages in a session.",
  4554. "responses": {
  4555. "200": {
  4556. "description": "Updated session",
  4557. "content": {
  4558. "application/json": {
  4559. "schema": {
  4560. "$ref": "#/components/schemas/Session"
  4561. }
  4562. }
  4563. }
  4564. },
  4565. "400": {
  4566. "description": "Bad request",
  4567. "content": {
  4568. "application/json": {
  4569. "schema": {
  4570. "$ref": "#/components/schemas/BadRequestError"
  4571. }
  4572. }
  4573. }
  4574. },
  4575. "404": {
  4576. "description": "Not found",
  4577. "content": {
  4578. "application/json": {
  4579. "schema": {
  4580. "$ref": "#/components/schemas/NotFoundError"
  4581. }
  4582. }
  4583. }
  4584. }
  4585. },
  4586. "x-codeSamples": [
  4587. {
  4588. "lang": "js",
  4589. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.unrevert({\n ...\n})"
  4590. }
  4591. ]
  4592. }
  4593. },
  4594. "/session/{sessionID}/permissions/{permissionID}": {
  4595. "post": {
  4596. "operationId": "permission.respond",
  4597. "parameters": [
  4598. {
  4599. "in": "query",
  4600. "name": "directory",
  4601. "schema": {
  4602. "type": "string"
  4603. }
  4604. },
  4605. {
  4606. "in": "query",
  4607. "name": "workspace",
  4608. "schema": {
  4609. "type": "string"
  4610. }
  4611. },
  4612. {
  4613. "in": "path",
  4614. "name": "sessionID",
  4615. "schema": {
  4616. "type": "string",
  4617. "pattern": "^ses.*"
  4618. },
  4619. "required": true
  4620. },
  4621. {
  4622. "in": "path",
  4623. "name": "permissionID",
  4624. "schema": {
  4625. "type": "string",
  4626. "pattern": "^per.*"
  4627. },
  4628. "required": true
  4629. }
  4630. ],
  4631. "summary": "Respond to permission",
  4632. "deprecated": true,
  4633. "description": "Approve or deny a permission request from the AI assistant.",
  4634. "responses": {
  4635. "200": {
  4636. "description": "Permission processed successfully",
  4637. "content": {
  4638. "application/json": {
  4639. "schema": {
  4640. "type": "boolean"
  4641. }
  4642. }
  4643. }
  4644. },
  4645. "400": {
  4646. "description": "Bad request",
  4647. "content": {
  4648. "application/json": {
  4649. "schema": {
  4650. "$ref": "#/components/schemas/BadRequestError"
  4651. }
  4652. }
  4653. }
  4654. },
  4655. "404": {
  4656. "description": "Not found",
  4657. "content": {
  4658. "application/json": {
  4659. "schema": {
  4660. "$ref": "#/components/schemas/NotFoundError"
  4661. }
  4662. }
  4663. }
  4664. }
  4665. },
  4666. "requestBody": {
  4667. "content": {
  4668. "application/json": {
  4669. "schema": {
  4670. "type": "object",
  4671. "properties": {
  4672. "response": {
  4673. "type": "string",
  4674. "enum": ["once", "always", "reject"]
  4675. }
  4676. },
  4677. "required": ["response"]
  4678. }
  4679. }
  4680. }
  4681. },
  4682. "x-codeSamples": [
  4683. {
  4684. "lang": "js",
  4685. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.permission.respond({\n ...\n})"
  4686. }
  4687. ]
  4688. }
  4689. },
  4690. "/permission/{requestID}/reply": {
  4691. "post": {
  4692. "operationId": "permission.reply",
  4693. "parameters": [
  4694. {
  4695. "in": "query",
  4696. "name": "directory",
  4697. "schema": {
  4698. "type": "string"
  4699. }
  4700. },
  4701. {
  4702. "in": "query",
  4703. "name": "workspace",
  4704. "schema": {
  4705. "type": "string"
  4706. }
  4707. },
  4708. {
  4709. "in": "path",
  4710. "name": "requestID",
  4711. "schema": {
  4712. "type": "string",
  4713. "pattern": "^per.*"
  4714. },
  4715. "required": true
  4716. }
  4717. ],
  4718. "summary": "Respond to permission request",
  4719. "description": "Approve or deny a permission request from the AI assistant.",
  4720. "responses": {
  4721. "200": {
  4722. "description": "Permission processed successfully",
  4723. "content": {
  4724. "application/json": {
  4725. "schema": {
  4726. "type": "boolean"
  4727. }
  4728. }
  4729. }
  4730. },
  4731. "400": {
  4732. "description": "Bad request",
  4733. "content": {
  4734. "application/json": {
  4735. "schema": {
  4736. "$ref": "#/components/schemas/BadRequestError"
  4737. }
  4738. }
  4739. }
  4740. },
  4741. "404": {
  4742. "description": "Not found",
  4743. "content": {
  4744. "application/json": {
  4745. "schema": {
  4746. "$ref": "#/components/schemas/NotFoundError"
  4747. }
  4748. }
  4749. }
  4750. }
  4751. },
  4752. "requestBody": {
  4753. "content": {
  4754. "application/json": {
  4755. "schema": {
  4756. "type": "object",
  4757. "properties": {
  4758. "reply": {
  4759. "type": "string",
  4760. "enum": ["once", "always", "reject"]
  4761. },
  4762. "message": {
  4763. "type": "string"
  4764. }
  4765. },
  4766. "required": ["reply"]
  4767. }
  4768. }
  4769. }
  4770. },
  4771. "x-codeSamples": [
  4772. {
  4773. "lang": "js",
  4774. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.permission.reply({\n ...\n})"
  4775. }
  4776. ]
  4777. }
  4778. },
  4779. "/permission": {
  4780. "get": {
  4781. "operationId": "permission.list",
  4782. "parameters": [
  4783. {
  4784. "in": "query",
  4785. "name": "directory",
  4786. "schema": {
  4787. "type": "string"
  4788. }
  4789. },
  4790. {
  4791. "in": "query",
  4792. "name": "workspace",
  4793. "schema": {
  4794. "type": "string"
  4795. }
  4796. }
  4797. ],
  4798. "summary": "List pending permissions",
  4799. "description": "Get all pending permission requests across all sessions.",
  4800. "responses": {
  4801. "200": {
  4802. "description": "List of pending permissions",
  4803. "content": {
  4804. "application/json": {
  4805. "schema": {
  4806. "type": "array",
  4807. "items": {
  4808. "$ref": "#/components/schemas/PermissionRequest"
  4809. }
  4810. }
  4811. }
  4812. }
  4813. }
  4814. },
  4815. "x-codeSamples": [
  4816. {
  4817. "lang": "js",
  4818. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.permission.list({\n ...\n})"
  4819. }
  4820. ]
  4821. }
  4822. },
  4823. "/question": {
  4824. "get": {
  4825. "operationId": "question.list",
  4826. "parameters": [
  4827. {
  4828. "in": "query",
  4829. "name": "directory",
  4830. "schema": {
  4831. "type": "string"
  4832. }
  4833. },
  4834. {
  4835. "in": "query",
  4836. "name": "workspace",
  4837. "schema": {
  4838. "type": "string"
  4839. }
  4840. }
  4841. ],
  4842. "summary": "List pending questions",
  4843. "description": "Get all pending question requests across all sessions.",
  4844. "responses": {
  4845. "200": {
  4846. "description": "List of pending questions",
  4847. "content": {
  4848. "application/json": {
  4849. "schema": {
  4850. "type": "array",
  4851. "items": {
  4852. "$ref": "#/components/schemas/QuestionRequest"
  4853. }
  4854. }
  4855. }
  4856. }
  4857. }
  4858. },
  4859. "x-codeSamples": [
  4860. {
  4861. "lang": "js",
  4862. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.question.list({\n ...\n})"
  4863. }
  4864. ]
  4865. }
  4866. },
  4867. "/question/{requestID}/reply": {
  4868. "post": {
  4869. "operationId": "question.reply",
  4870. "parameters": [
  4871. {
  4872. "in": "query",
  4873. "name": "directory",
  4874. "schema": {
  4875. "type": "string"
  4876. }
  4877. },
  4878. {
  4879. "in": "query",
  4880. "name": "workspace",
  4881. "schema": {
  4882. "type": "string"
  4883. }
  4884. },
  4885. {
  4886. "in": "path",
  4887. "name": "requestID",
  4888. "schema": {
  4889. "type": "string",
  4890. "pattern": "^que.*"
  4891. },
  4892. "required": true
  4893. }
  4894. ],
  4895. "summary": "Reply to question request",
  4896. "description": "Provide answers to a question request from the AI assistant.",
  4897. "responses": {
  4898. "200": {
  4899. "description": "Question answered successfully",
  4900. "content": {
  4901. "application/json": {
  4902. "schema": {
  4903. "type": "boolean"
  4904. }
  4905. }
  4906. }
  4907. },
  4908. "400": {
  4909. "description": "Bad request",
  4910. "content": {
  4911. "application/json": {
  4912. "schema": {
  4913. "$ref": "#/components/schemas/BadRequestError"
  4914. }
  4915. }
  4916. }
  4917. },
  4918. "404": {
  4919. "description": "Not found",
  4920. "content": {
  4921. "application/json": {
  4922. "schema": {
  4923. "$ref": "#/components/schemas/NotFoundError"
  4924. }
  4925. }
  4926. }
  4927. }
  4928. },
  4929. "requestBody": {
  4930. "content": {
  4931. "application/json": {
  4932. "schema": {
  4933. "type": "object",
  4934. "properties": {
  4935. "answers": {
  4936. "description": "User answers in order of questions (each answer is an array of selected labels)",
  4937. "type": "array",
  4938. "items": {
  4939. "$ref": "#/components/schemas/QuestionAnswer"
  4940. }
  4941. }
  4942. },
  4943. "required": ["answers"]
  4944. }
  4945. }
  4946. }
  4947. },
  4948. "x-codeSamples": [
  4949. {
  4950. "lang": "js",
  4951. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.question.reply({\n ...\n})"
  4952. }
  4953. ]
  4954. }
  4955. },
  4956. "/question/{requestID}/reject": {
  4957. "post": {
  4958. "operationId": "question.reject",
  4959. "parameters": [
  4960. {
  4961. "in": "query",
  4962. "name": "directory",
  4963. "schema": {
  4964. "type": "string"
  4965. }
  4966. },
  4967. {
  4968. "in": "query",
  4969. "name": "workspace",
  4970. "schema": {
  4971. "type": "string"
  4972. }
  4973. },
  4974. {
  4975. "in": "path",
  4976. "name": "requestID",
  4977. "schema": {
  4978. "type": "string",
  4979. "pattern": "^que.*"
  4980. },
  4981. "required": true
  4982. }
  4983. ],
  4984. "summary": "Reject question request",
  4985. "description": "Reject a question request from the AI assistant.",
  4986. "responses": {
  4987. "200": {
  4988. "description": "Question rejected successfully",
  4989. "content": {
  4990. "application/json": {
  4991. "schema": {
  4992. "type": "boolean"
  4993. }
  4994. }
  4995. }
  4996. },
  4997. "400": {
  4998. "description": "Bad request",
  4999. "content": {
  5000. "application/json": {
  5001. "schema": {
  5002. "$ref": "#/components/schemas/BadRequestError"
  5003. }
  5004. }
  5005. }
  5006. },
  5007. "404": {
  5008. "description": "Not found",
  5009. "content": {
  5010. "application/json": {
  5011. "schema": {
  5012. "$ref": "#/components/schemas/NotFoundError"
  5013. }
  5014. }
  5015. }
  5016. }
  5017. },
  5018. "x-codeSamples": [
  5019. {
  5020. "lang": "js",
  5021. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.question.reject({\n ...\n})"
  5022. }
  5023. ]
  5024. }
  5025. },
  5026. "/provider": {
  5027. "get": {
  5028. "operationId": "provider.list",
  5029. "parameters": [
  5030. {
  5031. "in": "query",
  5032. "name": "directory",
  5033. "schema": {
  5034. "type": "string"
  5035. }
  5036. },
  5037. {
  5038. "in": "query",
  5039. "name": "workspace",
  5040. "schema": {
  5041. "type": "string"
  5042. }
  5043. }
  5044. ],
  5045. "summary": "List providers",
  5046. "description": "Get a list of all available AI providers, including both available and connected ones.",
  5047. "responses": {
  5048. "200": {
  5049. "description": "List of providers",
  5050. "content": {
  5051. "application/json": {
  5052. "schema": {
  5053. "type": "object",
  5054. "properties": {
  5055. "all": {
  5056. "type": "array",
  5057. "items": {
  5058. "$ref": "#/components/schemas/Provider"
  5059. }
  5060. },
  5061. "default": {
  5062. "type": "object",
  5063. "propertyNames": {
  5064. "type": "string"
  5065. },
  5066. "additionalProperties": {
  5067. "type": "string"
  5068. }
  5069. },
  5070. "connected": {
  5071. "type": "array",
  5072. "items": {
  5073. "type": "string"
  5074. }
  5075. }
  5076. },
  5077. "required": ["all", "default", "connected"]
  5078. }
  5079. }
  5080. }
  5081. }
  5082. },
  5083. "x-codeSamples": [
  5084. {
  5085. "lang": "js",
  5086. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.list({\n ...\n})"
  5087. }
  5088. ]
  5089. }
  5090. },
  5091. "/provider/auth": {
  5092. "get": {
  5093. "operationId": "provider.auth",
  5094. "parameters": [
  5095. {
  5096. "in": "query",
  5097. "name": "directory",
  5098. "schema": {
  5099. "type": "string"
  5100. }
  5101. },
  5102. {
  5103. "in": "query",
  5104. "name": "workspace",
  5105. "schema": {
  5106. "type": "string"
  5107. }
  5108. }
  5109. ],
  5110. "summary": "Get provider auth methods",
  5111. "description": "Retrieve available authentication methods for all AI providers.",
  5112. "responses": {
  5113. "200": {
  5114. "description": "Provider auth methods",
  5115. "content": {
  5116. "application/json": {
  5117. "schema": {
  5118. "type": "object",
  5119. "propertyNames": {
  5120. "type": "string"
  5121. },
  5122. "additionalProperties": {
  5123. "type": "array",
  5124. "items": {
  5125. "$ref": "#/components/schemas/ProviderAuthMethod"
  5126. }
  5127. }
  5128. }
  5129. }
  5130. }
  5131. }
  5132. },
  5133. "x-codeSamples": [
  5134. {
  5135. "lang": "js",
  5136. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.auth({\n ...\n})"
  5137. }
  5138. ]
  5139. }
  5140. },
  5141. "/provider/{providerID}/oauth/authorize": {
  5142. "post": {
  5143. "operationId": "provider.oauth.authorize",
  5144. "parameters": [
  5145. {
  5146. "in": "query",
  5147. "name": "directory",
  5148. "schema": {
  5149. "type": "string"
  5150. }
  5151. },
  5152. {
  5153. "in": "query",
  5154. "name": "workspace",
  5155. "schema": {
  5156. "type": "string"
  5157. }
  5158. },
  5159. {
  5160. "in": "path",
  5161. "name": "providerID",
  5162. "schema": {
  5163. "type": "string"
  5164. },
  5165. "required": true,
  5166. "description": "Provider ID"
  5167. }
  5168. ],
  5169. "summary": "OAuth authorize",
  5170. "description": "Initiate OAuth authorization for a specific AI provider to get an authorization URL.",
  5171. "responses": {
  5172. "200": {
  5173. "description": "Authorization URL and method",
  5174. "content": {
  5175. "application/json": {
  5176. "schema": {
  5177. "$ref": "#/components/schemas/ProviderAuthAuthorization"
  5178. }
  5179. }
  5180. }
  5181. },
  5182. "400": {
  5183. "description": "Bad request",
  5184. "content": {
  5185. "application/json": {
  5186. "schema": {
  5187. "$ref": "#/components/schemas/BadRequestError"
  5188. }
  5189. }
  5190. }
  5191. }
  5192. },
  5193. "requestBody": {
  5194. "content": {
  5195. "application/json": {
  5196. "schema": {
  5197. "type": "object",
  5198. "properties": {
  5199. "method": {
  5200. "description": "Auth method index",
  5201. "type": "number"
  5202. },
  5203. "inputs": {
  5204. "description": "Prompt inputs",
  5205. "type": "object",
  5206. "propertyNames": {
  5207. "type": "string"
  5208. },
  5209. "additionalProperties": {
  5210. "type": "string"
  5211. }
  5212. }
  5213. },
  5214. "required": ["method"]
  5215. }
  5216. }
  5217. }
  5218. },
  5219. "x-codeSamples": [
  5220. {
  5221. "lang": "js",
  5222. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.oauth.authorize({\n ...\n})"
  5223. }
  5224. ]
  5225. }
  5226. },
  5227. "/provider/{providerID}/oauth/callback": {
  5228. "post": {
  5229. "operationId": "provider.oauth.callback",
  5230. "parameters": [
  5231. {
  5232. "in": "query",
  5233. "name": "directory",
  5234. "schema": {
  5235. "type": "string"
  5236. }
  5237. },
  5238. {
  5239. "in": "query",
  5240. "name": "workspace",
  5241. "schema": {
  5242. "type": "string"
  5243. }
  5244. },
  5245. {
  5246. "in": "path",
  5247. "name": "providerID",
  5248. "schema": {
  5249. "type": "string"
  5250. },
  5251. "required": true,
  5252. "description": "Provider ID"
  5253. }
  5254. ],
  5255. "summary": "OAuth callback",
  5256. "description": "Handle the OAuth callback from a provider after user authorization.",
  5257. "responses": {
  5258. "200": {
  5259. "description": "OAuth callback processed successfully",
  5260. "content": {
  5261. "application/json": {
  5262. "schema": {
  5263. "type": "boolean"
  5264. }
  5265. }
  5266. }
  5267. },
  5268. "400": {
  5269. "description": "Bad request",
  5270. "content": {
  5271. "application/json": {
  5272. "schema": {
  5273. "$ref": "#/components/schemas/BadRequestError"
  5274. }
  5275. }
  5276. }
  5277. }
  5278. },
  5279. "requestBody": {
  5280. "content": {
  5281. "application/json": {
  5282. "schema": {
  5283. "type": "object",
  5284. "properties": {
  5285. "method": {
  5286. "description": "Auth method index",
  5287. "type": "number"
  5288. },
  5289. "code": {
  5290. "description": "OAuth authorization code",
  5291. "type": "string"
  5292. }
  5293. },
  5294. "required": ["method"]
  5295. }
  5296. }
  5297. }
  5298. },
  5299. "x-codeSamples": [
  5300. {
  5301. "lang": "js",
  5302. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.oauth.callback({\n ...\n})"
  5303. }
  5304. ]
  5305. }
  5306. },
  5307. "/sync/start": {
  5308. "post": {
  5309. "operationId": "sync.start",
  5310. "parameters": [
  5311. {
  5312. "in": "query",
  5313. "name": "directory",
  5314. "schema": {
  5315. "type": "string"
  5316. }
  5317. },
  5318. {
  5319. "in": "query",
  5320. "name": "workspace",
  5321. "schema": {
  5322. "type": "string"
  5323. }
  5324. }
  5325. ],
  5326. "summary": "Start workspace sync",
  5327. "description": "Start sync loops for workspaces in the current project that have active sessions.",
  5328. "responses": {
  5329. "200": {
  5330. "description": "Workspace sync started",
  5331. "content": {
  5332. "application/json": {
  5333. "schema": {
  5334. "type": "boolean"
  5335. }
  5336. }
  5337. }
  5338. }
  5339. },
  5340. "x-codeSamples": [
  5341. {
  5342. "lang": "js",
  5343. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.sync.start({\n ...\n})"
  5344. }
  5345. ]
  5346. }
  5347. },
  5348. "/sync/replay": {
  5349. "post": {
  5350. "operationId": "sync.replay",
  5351. "parameters": [
  5352. {
  5353. "in": "query",
  5354. "name": "directory",
  5355. "schema": {
  5356. "type": "string"
  5357. }
  5358. },
  5359. {
  5360. "in": "query",
  5361. "name": "workspace",
  5362. "schema": {
  5363. "type": "string"
  5364. }
  5365. }
  5366. ],
  5367. "summary": "Replay sync events",
  5368. "description": "Validate and replay a complete sync event history.",
  5369. "responses": {
  5370. "200": {
  5371. "description": "Replayed sync events",
  5372. "content": {
  5373. "application/json": {
  5374. "schema": {
  5375. "type": "object",
  5376. "properties": {
  5377. "sessionID": {
  5378. "type": "string"
  5379. }
  5380. },
  5381. "required": ["sessionID"]
  5382. }
  5383. }
  5384. }
  5385. },
  5386. "400": {
  5387. "description": "Bad request",
  5388. "content": {
  5389. "application/json": {
  5390. "schema": {
  5391. "$ref": "#/components/schemas/BadRequestError"
  5392. }
  5393. }
  5394. }
  5395. }
  5396. },
  5397. "requestBody": {
  5398. "content": {
  5399. "application/json": {
  5400. "schema": {
  5401. "type": "object",
  5402. "properties": {
  5403. "directory": {
  5404. "type": "string"
  5405. },
  5406. "events": {
  5407. "minItems": 1,
  5408. "type": "array",
  5409. "items": {
  5410. "type": "object",
  5411. "properties": {
  5412. "id": {
  5413. "type": "string"
  5414. },
  5415. "aggregateID": {
  5416. "type": "string"
  5417. },
  5418. "seq": {
  5419. "type": "integer",
  5420. "minimum": 0,
  5421. "maximum": 9007199254740991
  5422. },
  5423. "type": {
  5424. "type": "string"
  5425. },
  5426. "data": {
  5427. "type": "object",
  5428. "propertyNames": {
  5429. "type": "string"
  5430. },
  5431. "additionalProperties": {}
  5432. }
  5433. },
  5434. "required": ["id", "aggregateID", "seq", "type", "data"]
  5435. }
  5436. }
  5437. },
  5438. "required": ["directory", "events"]
  5439. }
  5440. }
  5441. }
  5442. },
  5443. "x-codeSamples": [
  5444. {
  5445. "lang": "js",
  5446. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.sync.replay({\n ...\n})"
  5447. }
  5448. ]
  5449. }
  5450. },
  5451. "/sync/history": {
  5452. "post": {
  5453. "operationId": "sync.history.list",
  5454. "parameters": [
  5455. {
  5456. "in": "query",
  5457. "name": "directory",
  5458. "schema": {
  5459. "type": "string"
  5460. }
  5461. },
  5462. {
  5463. "in": "query",
  5464. "name": "workspace",
  5465. "schema": {
  5466. "type": "string"
  5467. }
  5468. }
  5469. ],
  5470. "summary": "List sync events",
  5471. "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.",
  5472. "responses": {
  5473. "200": {
  5474. "description": "Sync events",
  5475. "content": {
  5476. "application/json": {
  5477. "schema": {
  5478. "type": "array",
  5479. "items": {
  5480. "type": "object",
  5481. "properties": {
  5482. "id": {
  5483. "type": "string"
  5484. },
  5485. "aggregate_id": {
  5486. "type": "string"
  5487. },
  5488. "seq": {
  5489. "type": "number"
  5490. },
  5491. "type": {
  5492. "type": "string"
  5493. },
  5494. "data": {
  5495. "type": "object",
  5496. "propertyNames": {
  5497. "type": "string"
  5498. },
  5499. "additionalProperties": {}
  5500. }
  5501. },
  5502. "required": ["id", "aggregate_id", "seq", "type", "data"]
  5503. }
  5504. }
  5505. }
  5506. }
  5507. },
  5508. "400": {
  5509. "description": "Bad request",
  5510. "content": {
  5511. "application/json": {
  5512. "schema": {
  5513. "$ref": "#/components/schemas/BadRequestError"
  5514. }
  5515. }
  5516. }
  5517. }
  5518. },
  5519. "requestBody": {
  5520. "content": {
  5521. "application/json": {
  5522. "schema": {
  5523. "type": "object",
  5524. "propertyNames": {
  5525. "type": "string"
  5526. },
  5527. "additionalProperties": {
  5528. "type": "integer",
  5529. "minimum": 0,
  5530. "maximum": 9007199254740991
  5531. }
  5532. }
  5533. }
  5534. }
  5535. },
  5536. "x-codeSamples": [
  5537. {
  5538. "lang": "js",
  5539. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.sync.history.list({\n ...\n})"
  5540. }
  5541. ]
  5542. }
  5543. },
  5544. "/find": {
  5545. "get": {
  5546. "operationId": "find.text",
  5547. "parameters": [
  5548. {
  5549. "in": "query",
  5550. "name": "directory",
  5551. "schema": {
  5552. "type": "string"
  5553. }
  5554. },
  5555. {
  5556. "in": "query",
  5557. "name": "workspace",
  5558. "schema": {
  5559. "type": "string"
  5560. }
  5561. },
  5562. {
  5563. "in": "query",
  5564. "name": "pattern",
  5565. "schema": {
  5566. "type": "string"
  5567. },
  5568. "required": true
  5569. }
  5570. ],
  5571. "summary": "Find text",
  5572. "description": "Search for text patterns across files in the project using ripgrep.",
  5573. "responses": {
  5574. "200": {
  5575. "description": "Matches",
  5576. "content": {
  5577. "application/json": {
  5578. "schema": {
  5579. "type": "array",
  5580. "items": {
  5581. "type": "object",
  5582. "properties": {
  5583. "path": {
  5584. "type": "object",
  5585. "properties": {
  5586. "text": {
  5587. "type": "string"
  5588. }
  5589. },
  5590. "required": ["text"]
  5591. },
  5592. "lines": {
  5593. "type": "object",
  5594. "properties": {
  5595. "text": {
  5596. "type": "string"
  5597. }
  5598. },
  5599. "required": ["text"]
  5600. },
  5601. "line_number": {
  5602. "type": "integer",
  5603. "minimum": 0,
  5604. "maximum": 9007199254740991
  5605. },
  5606. "absolute_offset": {
  5607. "type": "integer",
  5608. "minimum": 0,
  5609. "maximum": 9007199254740991
  5610. },
  5611. "submatches": {
  5612. "type": "array",
  5613. "items": {
  5614. "type": "object",
  5615. "properties": {
  5616. "match": {
  5617. "type": "object",
  5618. "properties": {
  5619. "text": {
  5620. "type": "string"
  5621. }
  5622. },
  5623. "required": ["text"]
  5624. },
  5625. "start": {
  5626. "type": "integer",
  5627. "minimum": 0,
  5628. "maximum": 9007199254740991
  5629. },
  5630. "end": {
  5631. "type": "integer",
  5632. "minimum": 0,
  5633. "maximum": 9007199254740991
  5634. }
  5635. },
  5636. "required": ["match", "start", "end"]
  5637. }
  5638. }
  5639. },
  5640. "required": ["path", "lines", "line_number", "absolute_offset", "submatches"]
  5641. }
  5642. }
  5643. }
  5644. }
  5645. }
  5646. },
  5647. "x-codeSamples": [
  5648. {
  5649. "lang": "js",
  5650. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.find.text({\n ...\n})"
  5651. }
  5652. ]
  5653. }
  5654. },
  5655. "/find/file": {
  5656. "get": {
  5657. "operationId": "find.files",
  5658. "parameters": [
  5659. {
  5660. "in": "query",
  5661. "name": "directory",
  5662. "schema": {
  5663. "type": "string"
  5664. }
  5665. },
  5666. {
  5667. "in": "query",
  5668. "name": "workspace",
  5669. "schema": {
  5670. "type": "string"
  5671. }
  5672. },
  5673. {
  5674. "in": "query",
  5675. "name": "query",
  5676. "schema": {
  5677. "type": "string"
  5678. },
  5679. "required": true
  5680. },
  5681. {
  5682. "in": "query",
  5683. "name": "dirs",
  5684. "schema": {
  5685. "type": "string",
  5686. "enum": ["true", "false"]
  5687. }
  5688. },
  5689. {
  5690. "in": "query",
  5691. "name": "type",
  5692. "schema": {
  5693. "type": "string",
  5694. "enum": ["file", "directory"]
  5695. }
  5696. },
  5697. {
  5698. "in": "query",
  5699. "name": "limit",
  5700. "schema": {
  5701. "type": "integer",
  5702. "minimum": 1,
  5703. "maximum": 200
  5704. }
  5705. }
  5706. ],
  5707. "summary": "Find files",
  5708. "description": "Search for files or directories by name or pattern in the project directory.",
  5709. "responses": {
  5710. "200": {
  5711. "description": "File paths",
  5712. "content": {
  5713. "application/json": {
  5714. "schema": {
  5715. "type": "array",
  5716. "items": {
  5717. "type": "string"
  5718. }
  5719. }
  5720. }
  5721. }
  5722. }
  5723. },
  5724. "x-codeSamples": [
  5725. {
  5726. "lang": "js",
  5727. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.find.files({\n ...\n})"
  5728. }
  5729. ]
  5730. }
  5731. },
  5732. "/find/symbol": {
  5733. "get": {
  5734. "operationId": "find.symbols",
  5735. "parameters": [
  5736. {
  5737. "in": "query",
  5738. "name": "directory",
  5739. "schema": {
  5740. "type": "string"
  5741. }
  5742. },
  5743. {
  5744. "in": "query",
  5745. "name": "workspace",
  5746. "schema": {
  5747. "type": "string"
  5748. }
  5749. },
  5750. {
  5751. "in": "query",
  5752. "name": "query",
  5753. "schema": {
  5754. "type": "string"
  5755. },
  5756. "required": true
  5757. }
  5758. ],
  5759. "summary": "Find symbols",
  5760. "description": "Search for workspace symbols like functions, classes, and variables using LSP.",
  5761. "responses": {
  5762. "200": {
  5763. "description": "Symbols",
  5764. "content": {
  5765. "application/json": {
  5766. "schema": {
  5767. "type": "array",
  5768. "items": {
  5769. "$ref": "#/components/schemas/Symbol"
  5770. }
  5771. }
  5772. }
  5773. }
  5774. }
  5775. },
  5776. "x-codeSamples": [
  5777. {
  5778. "lang": "js",
  5779. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.find.symbols({\n ...\n})"
  5780. }
  5781. ]
  5782. }
  5783. },
  5784. "/file": {
  5785. "get": {
  5786. "operationId": "file.list",
  5787. "parameters": [
  5788. {
  5789. "in": "query",
  5790. "name": "directory",
  5791. "schema": {
  5792. "type": "string"
  5793. }
  5794. },
  5795. {
  5796. "in": "query",
  5797. "name": "workspace",
  5798. "schema": {
  5799. "type": "string"
  5800. }
  5801. },
  5802. {
  5803. "in": "query",
  5804. "name": "path",
  5805. "schema": {
  5806. "type": "string"
  5807. },
  5808. "required": true
  5809. }
  5810. ],
  5811. "summary": "List files",
  5812. "description": "List files and directories in a specified path.",
  5813. "responses": {
  5814. "200": {
  5815. "description": "Files and directories",
  5816. "content": {
  5817. "application/json": {
  5818. "schema": {
  5819. "type": "array",
  5820. "items": {
  5821. "$ref": "#/components/schemas/FileNode"
  5822. }
  5823. }
  5824. }
  5825. }
  5826. }
  5827. },
  5828. "x-codeSamples": [
  5829. {
  5830. "lang": "js",
  5831. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.file.list({\n ...\n})"
  5832. }
  5833. ]
  5834. }
  5835. },
  5836. "/file/content": {
  5837. "get": {
  5838. "operationId": "file.read",
  5839. "parameters": [
  5840. {
  5841. "in": "query",
  5842. "name": "directory",
  5843. "schema": {
  5844. "type": "string"
  5845. }
  5846. },
  5847. {
  5848. "in": "query",
  5849. "name": "workspace",
  5850. "schema": {
  5851. "type": "string"
  5852. }
  5853. },
  5854. {
  5855. "in": "query",
  5856. "name": "path",
  5857. "schema": {
  5858. "type": "string"
  5859. },
  5860. "required": true
  5861. }
  5862. ],
  5863. "summary": "Read file",
  5864. "description": "Read the content of a specified file.",
  5865. "responses": {
  5866. "200": {
  5867. "description": "File content",
  5868. "content": {
  5869. "application/json": {
  5870. "schema": {
  5871. "$ref": "#/components/schemas/FileContent"
  5872. }
  5873. }
  5874. }
  5875. }
  5876. },
  5877. "x-codeSamples": [
  5878. {
  5879. "lang": "js",
  5880. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.file.read({\n ...\n})"
  5881. }
  5882. ]
  5883. }
  5884. },
  5885. "/file/status": {
  5886. "get": {
  5887. "operationId": "file.status",
  5888. "parameters": [
  5889. {
  5890. "in": "query",
  5891. "name": "directory",
  5892. "schema": {
  5893. "type": "string"
  5894. }
  5895. },
  5896. {
  5897. "in": "query",
  5898. "name": "workspace",
  5899. "schema": {
  5900. "type": "string"
  5901. }
  5902. }
  5903. ],
  5904. "summary": "Get file status",
  5905. "description": "Get the git status of all files in the project.",
  5906. "responses": {
  5907. "200": {
  5908. "description": "File status",
  5909. "content": {
  5910. "application/json": {
  5911. "schema": {
  5912. "type": "array",
  5913. "items": {
  5914. "$ref": "#/components/schemas/File"
  5915. }
  5916. }
  5917. }
  5918. }
  5919. }
  5920. },
  5921. "x-codeSamples": [
  5922. {
  5923. "lang": "js",
  5924. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.file.status({\n ...\n})"
  5925. }
  5926. ]
  5927. }
  5928. },
  5929. "/event": {
  5930. "get": {
  5931. "operationId": "event.subscribe",
  5932. "parameters": [
  5933. {
  5934. "in": "query",
  5935. "name": "directory",
  5936. "schema": {
  5937. "type": "string"
  5938. }
  5939. },
  5940. {
  5941. "in": "query",
  5942. "name": "workspace",
  5943. "schema": {
  5944. "type": "string"
  5945. }
  5946. }
  5947. ],
  5948. "summary": "Subscribe to events",
  5949. "description": "Get events",
  5950. "responses": {
  5951. "200": {
  5952. "description": "Event stream",
  5953. "content": {
  5954. "text/event-stream": {
  5955. "schema": {
  5956. "$ref": "#/components/schemas/Event"
  5957. }
  5958. }
  5959. }
  5960. }
  5961. },
  5962. "x-codeSamples": [
  5963. {
  5964. "lang": "js",
  5965. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.event.subscribe({\n ...\n})"
  5966. }
  5967. ]
  5968. }
  5969. },
  5970. "/mcp": {
  5971. "get": {
  5972. "operationId": "mcp.status",
  5973. "parameters": [
  5974. {
  5975. "in": "query",
  5976. "name": "directory",
  5977. "schema": {
  5978. "type": "string"
  5979. }
  5980. },
  5981. {
  5982. "in": "query",
  5983. "name": "workspace",
  5984. "schema": {
  5985. "type": "string"
  5986. }
  5987. }
  5988. ],
  5989. "summary": "Get MCP status",
  5990. "description": "Get the status of all Model Context Protocol (MCP) servers.",
  5991. "responses": {
  5992. "200": {
  5993. "description": "MCP server status",
  5994. "content": {
  5995. "application/json": {
  5996. "schema": {
  5997. "type": "object",
  5998. "propertyNames": {
  5999. "type": "string"
  6000. },
  6001. "additionalProperties": {
  6002. "$ref": "#/components/schemas/MCPStatus"
  6003. }
  6004. }
  6005. }
  6006. }
  6007. }
  6008. },
  6009. "x-codeSamples": [
  6010. {
  6011. "lang": "js",
  6012. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.status({\n ...\n})"
  6013. }
  6014. ]
  6015. },
  6016. "post": {
  6017. "operationId": "mcp.add",
  6018. "parameters": [
  6019. {
  6020. "in": "query",
  6021. "name": "directory",
  6022. "schema": {
  6023. "type": "string"
  6024. }
  6025. },
  6026. {
  6027. "in": "query",
  6028. "name": "workspace",
  6029. "schema": {
  6030. "type": "string"
  6031. }
  6032. }
  6033. ],
  6034. "summary": "Add MCP server",
  6035. "description": "Dynamically add a new Model Context Protocol (MCP) server to the system.",
  6036. "responses": {
  6037. "200": {
  6038. "description": "MCP server added successfully",
  6039. "content": {
  6040. "application/json": {
  6041. "schema": {
  6042. "type": "object",
  6043. "propertyNames": {
  6044. "type": "string"
  6045. },
  6046. "additionalProperties": {
  6047. "$ref": "#/components/schemas/MCPStatus"
  6048. }
  6049. }
  6050. }
  6051. }
  6052. },
  6053. "400": {
  6054. "description": "Bad request",
  6055. "content": {
  6056. "application/json": {
  6057. "schema": {
  6058. "$ref": "#/components/schemas/BadRequestError"
  6059. }
  6060. }
  6061. }
  6062. }
  6063. },
  6064. "requestBody": {
  6065. "content": {
  6066. "application/json": {
  6067. "schema": {
  6068. "type": "object",
  6069. "properties": {
  6070. "name": {
  6071. "type": "string"
  6072. },
  6073. "config": {
  6074. "anyOf": [
  6075. {
  6076. "$ref": "#/components/schemas/McpLocalConfig"
  6077. },
  6078. {
  6079. "$ref": "#/components/schemas/McpRemoteConfig"
  6080. }
  6081. ]
  6082. }
  6083. },
  6084. "required": ["name", "config"]
  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.mcp.add({\n ...\n})"
  6093. }
  6094. ]
  6095. }
  6096. },
  6097. "/mcp/{name}/auth": {
  6098. "post": {
  6099. "operationId": "mcp.auth.start",
  6100. "parameters": [
  6101. {
  6102. "in": "query",
  6103. "name": "directory",
  6104. "schema": {
  6105. "type": "string"
  6106. }
  6107. },
  6108. {
  6109. "in": "query",
  6110. "name": "workspace",
  6111. "schema": {
  6112. "type": "string"
  6113. }
  6114. },
  6115. {
  6116. "schema": {
  6117. "type": "string"
  6118. },
  6119. "in": "path",
  6120. "name": "name",
  6121. "required": true
  6122. }
  6123. ],
  6124. "summary": "Start MCP OAuth",
  6125. "description": "Start OAuth authentication flow for a Model Context Protocol (MCP) server.",
  6126. "responses": {
  6127. "200": {
  6128. "description": "OAuth flow started",
  6129. "content": {
  6130. "application/json": {
  6131. "schema": {
  6132. "type": "object",
  6133. "properties": {
  6134. "authorizationUrl": {
  6135. "description": "URL to open in browser for authorization",
  6136. "type": "string"
  6137. }
  6138. },
  6139. "required": ["authorizationUrl"]
  6140. }
  6141. }
  6142. }
  6143. },
  6144. "400": {
  6145. "description": "MCP server does not support OAuth",
  6146. "content": {
  6147. "application/json": {
  6148. "schema": {
  6149. "$ref": "#/components/schemas/McpUnsupportedOAuthError"
  6150. }
  6151. }
  6152. }
  6153. },
  6154. "404": {
  6155. "description": "Not found",
  6156. "content": {
  6157. "application/json": {
  6158. "schema": {
  6159. "$ref": "#/components/schemas/NotFoundError"
  6160. }
  6161. }
  6162. }
  6163. }
  6164. },
  6165. "x-codeSamples": [
  6166. {
  6167. "lang": "js",
  6168. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.start({\n ...\n})"
  6169. }
  6170. ]
  6171. },
  6172. "delete": {
  6173. "operationId": "mcp.auth.remove",
  6174. "parameters": [
  6175. {
  6176. "in": "query",
  6177. "name": "directory",
  6178. "schema": {
  6179. "type": "string"
  6180. }
  6181. },
  6182. {
  6183. "in": "query",
  6184. "name": "workspace",
  6185. "schema": {
  6186. "type": "string"
  6187. }
  6188. },
  6189. {
  6190. "schema": {
  6191. "type": "string"
  6192. },
  6193. "in": "path",
  6194. "name": "name",
  6195. "required": true
  6196. }
  6197. ],
  6198. "summary": "Remove MCP OAuth",
  6199. "description": "Remove OAuth credentials for an MCP server",
  6200. "responses": {
  6201. "200": {
  6202. "description": "OAuth credentials removed",
  6203. "content": {
  6204. "application/json": {
  6205. "schema": {
  6206. "type": "object",
  6207. "properties": {
  6208. "success": {
  6209. "type": "boolean",
  6210. "const": true
  6211. }
  6212. },
  6213. "required": ["success"]
  6214. }
  6215. }
  6216. }
  6217. },
  6218. "404": {
  6219. "description": "Not found",
  6220. "content": {
  6221. "application/json": {
  6222. "schema": {
  6223. "$ref": "#/components/schemas/NotFoundError"
  6224. }
  6225. }
  6226. }
  6227. }
  6228. },
  6229. "x-codeSamples": [
  6230. {
  6231. "lang": "js",
  6232. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.remove({\n ...\n})"
  6233. }
  6234. ]
  6235. }
  6236. },
  6237. "/mcp/{name}/auth/callback": {
  6238. "post": {
  6239. "operationId": "mcp.auth.callback",
  6240. "parameters": [
  6241. {
  6242. "in": "query",
  6243. "name": "directory",
  6244. "schema": {
  6245. "type": "string"
  6246. }
  6247. },
  6248. {
  6249. "in": "query",
  6250. "name": "workspace",
  6251. "schema": {
  6252. "type": "string"
  6253. }
  6254. },
  6255. {
  6256. "schema": {
  6257. "type": "string"
  6258. },
  6259. "in": "path",
  6260. "name": "name",
  6261. "required": true
  6262. }
  6263. ],
  6264. "summary": "Complete MCP OAuth",
  6265. "description": "Complete OAuth authentication for a Model Context Protocol (MCP) server using the authorization code.",
  6266. "responses": {
  6267. "200": {
  6268. "description": "OAuth authentication completed",
  6269. "content": {
  6270. "application/json": {
  6271. "schema": {
  6272. "$ref": "#/components/schemas/MCPStatus"
  6273. }
  6274. }
  6275. }
  6276. },
  6277. "400": {
  6278. "description": "Bad request",
  6279. "content": {
  6280. "application/json": {
  6281. "schema": {
  6282. "$ref": "#/components/schemas/BadRequestError"
  6283. }
  6284. }
  6285. }
  6286. },
  6287. "404": {
  6288. "description": "Not found",
  6289. "content": {
  6290. "application/json": {
  6291. "schema": {
  6292. "$ref": "#/components/schemas/NotFoundError"
  6293. }
  6294. }
  6295. }
  6296. }
  6297. },
  6298. "requestBody": {
  6299. "content": {
  6300. "application/json": {
  6301. "schema": {
  6302. "type": "object",
  6303. "properties": {
  6304. "code": {
  6305. "description": "Authorization code from OAuth callback",
  6306. "type": "string"
  6307. }
  6308. },
  6309. "required": ["code"]
  6310. }
  6311. }
  6312. }
  6313. },
  6314. "x-codeSamples": [
  6315. {
  6316. "lang": "js",
  6317. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.callback({\n ...\n})"
  6318. }
  6319. ]
  6320. }
  6321. },
  6322. "/mcp/{name}/auth/authenticate": {
  6323. "post": {
  6324. "operationId": "mcp.auth.authenticate",
  6325. "parameters": [
  6326. {
  6327. "in": "query",
  6328. "name": "directory",
  6329. "schema": {
  6330. "type": "string"
  6331. }
  6332. },
  6333. {
  6334. "in": "query",
  6335. "name": "workspace",
  6336. "schema": {
  6337. "type": "string"
  6338. }
  6339. },
  6340. {
  6341. "schema": {
  6342. "type": "string"
  6343. },
  6344. "in": "path",
  6345. "name": "name",
  6346. "required": true
  6347. }
  6348. ],
  6349. "summary": "Authenticate MCP OAuth",
  6350. "description": "Start OAuth flow and wait for callback (opens browser)",
  6351. "responses": {
  6352. "200": {
  6353. "description": "OAuth authentication completed",
  6354. "content": {
  6355. "application/json": {
  6356. "schema": {
  6357. "$ref": "#/components/schemas/MCPStatus"
  6358. }
  6359. }
  6360. }
  6361. },
  6362. "400": {
  6363. "description": "MCP server does not support OAuth",
  6364. "content": {
  6365. "application/json": {
  6366. "schema": {
  6367. "$ref": "#/components/schemas/McpUnsupportedOAuthError"
  6368. }
  6369. }
  6370. }
  6371. },
  6372. "404": {
  6373. "description": "Not found",
  6374. "content": {
  6375. "application/json": {
  6376. "schema": {
  6377. "$ref": "#/components/schemas/NotFoundError"
  6378. }
  6379. }
  6380. }
  6381. }
  6382. },
  6383. "x-codeSamples": [
  6384. {
  6385. "lang": "js",
  6386. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.authenticate({\n ...\n})"
  6387. }
  6388. ]
  6389. }
  6390. },
  6391. "/mcp/{name}/connect": {
  6392. "post": {
  6393. "operationId": "mcp.connect",
  6394. "parameters": [
  6395. {
  6396. "in": "query",
  6397. "name": "directory",
  6398. "schema": {
  6399. "type": "string"
  6400. }
  6401. },
  6402. {
  6403. "in": "query",
  6404. "name": "workspace",
  6405. "schema": {
  6406. "type": "string"
  6407. }
  6408. },
  6409. {
  6410. "in": "path",
  6411. "name": "name",
  6412. "schema": {
  6413. "type": "string"
  6414. },
  6415. "required": true
  6416. }
  6417. ],
  6418. "description": "Connect an MCP server",
  6419. "responses": {
  6420. "200": {
  6421. "description": "MCP server connected successfully",
  6422. "content": {
  6423. "application/json": {
  6424. "schema": {
  6425. "type": "boolean"
  6426. }
  6427. }
  6428. }
  6429. }
  6430. },
  6431. "x-codeSamples": [
  6432. {
  6433. "lang": "js",
  6434. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.connect({\n ...\n})"
  6435. }
  6436. ]
  6437. }
  6438. },
  6439. "/mcp/{name}/disconnect": {
  6440. "post": {
  6441. "operationId": "mcp.disconnect",
  6442. "parameters": [
  6443. {
  6444. "in": "query",
  6445. "name": "directory",
  6446. "schema": {
  6447. "type": "string"
  6448. }
  6449. },
  6450. {
  6451. "in": "query",
  6452. "name": "workspace",
  6453. "schema": {
  6454. "type": "string"
  6455. }
  6456. },
  6457. {
  6458. "in": "path",
  6459. "name": "name",
  6460. "schema": {
  6461. "type": "string"
  6462. },
  6463. "required": true
  6464. }
  6465. ],
  6466. "description": "Disconnect an MCP server",
  6467. "responses": {
  6468. "200": {
  6469. "description": "MCP server disconnected successfully",
  6470. "content": {
  6471. "application/json": {
  6472. "schema": {
  6473. "type": "boolean"
  6474. }
  6475. }
  6476. }
  6477. }
  6478. },
  6479. "x-codeSamples": [
  6480. {
  6481. "lang": "js",
  6482. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.disconnect({\n ...\n})"
  6483. }
  6484. ]
  6485. }
  6486. },
  6487. "/tui/append-prompt": {
  6488. "post": {
  6489. "operationId": "tui.appendPrompt",
  6490. "parameters": [
  6491. {
  6492. "in": "query",
  6493. "name": "directory",
  6494. "schema": {
  6495. "type": "string"
  6496. }
  6497. },
  6498. {
  6499. "in": "query",
  6500. "name": "workspace",
  6501. "schema": {
  6502. "type": "string"
  6503. }
  6504. }
  6505. ],
  6506. "summary": "Append TUI prompt",
  6507. "description": "Append prompt to the TUI",
  6508. "responses": {
  6509. "200": {
  6510. "description": "Prompt processed successfully",
  6511. "content": {
  6512. "application/json": {
  6513. "schema": {
  6514. "type": "boolean"
  6515. }
  6516. }
  6517. }
  6518. },
  6519. "400": {
  6520. "description": "Bad request",
  6521. "content": {
  6522. "application/json": {
  6523. "schema": {
  6524. "$ref": "#/components/schemas/BadRequestError"
  6525. }
  6526. }
  6527. }
  6528. }
  6529. },
  6530. "requestBody": {
  6531. "content": {
  6532. "application/json": {
  6533. "schema": {
  6534. "type": "object",
  6535. "properties": {
  6536. "text": {
  6537. "type": "string"
  6538. }
  6539. },
  6540. "required": ["text"]
  6541. }
  6542. }
  6543. }
  6544. },
  6545. "x-codeSamples": [
  6546. {
  6547. "lang": "js",
  6548. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.appendPrompt({\n ...\n})"
  6549. }
  6550. ]
  6551. }
  6552. },
  6553. "/tui/open-help": {
  6554. "post": {
  6555. "operationId": "tui.openHelp",
  6556. "parameters": [
  6557. {
  6558. "in": "query",
  6559. "name": "directory",
  6560. "schema": {
  6561. "type": "string"
  6562. }
  6563. },
  6564. {
  6565. "in": "query",
  6566. "name": "workspace",
  6567. "schema": {
  6568. "type": "string"
  6569. }
  6570. }
  6571. ],
  6572. "summary": "Open help dialog",
  6573. "description": "Open the help dialog in the TUI to display user assistance information.",
  6574. "responses": {
  6575. "200": {
  6576. "description": "Help dialog opened successfully",
  6577. "content": {
  6578. "application/json": {
  6579. "schema": {
  6580. "type": "boolean"
  6581. }
  6582. }
  6583. }
  6584. }
  6585. },
  6586. "x-codeSamples": [
  6587. {
  6588. "lang": "js",
  6589. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openHelp({\n ...\n})"
  6590. }
  6591. ]
  6592. }
  6593. },
  6594. "/tui/open-sessions": {
  6595. "post": {
  6596. "operationId": "tui.openSessions",
  6597. "parameters": [
  6598. {
  6599. "in": "query",
  6600. "name": "directory",
  6601. "schema": {
  6602. "type": "string"
  6603. }
  6604. },
  6605. {
  6606. "in": "query",
  6607. "name": "workspace",
  6608. "schema": {
  6609. "type": "string"
  6610. }
  6611. }
  6612. ],
  6613. "summary": "Open sessions dialog",
  6614. "description": "Open the session dialog",
  6615. "responses": {
  6616. "200": {
  6617. "description": "Session dialog opened successfully",
  6618. "content": {
  6619. "application/json": {
  6620. "schema": {
  6621. "type": "boolean"
  6622. }
  6623. }
  6624. }
  6625. }
  6626. },
  6627. "x-codeSamples": [
  6628. {
  6629. "lang": "js",
  6630. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openSessions({\n ...\n})"
  6631. }
  6632. ]
  6633. }
  6634. },
  6635. "/tui/open-themes": {
  6636. "post": {
  6637. "operationId": "tui.openThemes",
  6638. "parameters": [
  6639. {
  6640. "in": "query",
  6641. "name": "directory",
  6642. "schema": {
  6643. "type": "string"
  6644. }
  6645. },
  6646. {
  6647. "in": "query",
  6648. "name": "workspace",
  6649. "schema": {
  6650. "type": "string"
  6651. }
  6652. }
  6653. ],
  6654. "summary": "Open themes dialog",
  6655. "description": "Open the theme dialog",
  6656. "responses": {
  6657. "200": {
  6658. "description": "Theme dialog opened successfully",
  6659. "content": {
  6660. "application/json": {
  6661. "schema": {
  6662. "type": "boolean"
  6663. }
  6664. }
  6665. }
  6666. }
  6667. },
  6668. "x-codeSamples": [
  6669. {
  6670. "lang": "js",
  6671. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openThemes({\n ...\n})"
  6672. }
  6673. ]
  6674. }
  6675. },
  6676. "/tui/open-models": {
  6677. "post": {
  6678. "operationId": "tui.openModels",
  6679. "parameters": [
  6680. {
  6681. "in": "query",
  6682. "name": "directory",
  6683. "schema": {
  6684. "type": "string"
  6685. }
  6686. },
  6687. {
  6688. "in": "query",
  6689. "name": "workspace",
  6690. "schema": {
  6691. "type": "string"
  6692. }
  6693. }
  6694. ],
  6695. "summary": "Open models dialog",
  6696. "description": "Open the model dialog",
  6697. "responses": {
  6698. "200": {
  6699. "description": "Model dialog opened successfully",
  6700. "content": {
  6701. "application/json": {
  6702. "schema": {
  6703. "type": "boolean"
  6704. }
  6705. }
  6706. }
  6707. }
  6708. },
  6709. "x-codeSamples": [
  6710. {
  6711. "lang": "js",
  6712. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openModels({\n ...\n})"
  6713. }
  6714. ]
  6715. }
  6716. },
  6717. "/tui/submit-prompt": {
  6718. "post": {
  6719. "operationId": "tui.submitPrompt",
  6720. "parameters": [
  6721. {
  6722. "in": "query",
  6723. "name": "directory",
  6724. "schema": {
  6725. "type": "string"
  6726. }
  6727. },
  6728. {
  6729. "in": "query",
  6730. "name": "workspace",
  6731. "schema": {
  6732. "type": "string"
  6733. }
  6734. }
  6735. ],
  6736. "summary": "Submit TUI prompt",
  6737. "description": "Submit the prompt",
  6738. "responses": {
  6739. "200": {
  6740. "description": "Prompt submitted successfully",
  6741. "content": {
  6742. "application/json": {
  6743. "schema": {
  6744. "type": "boolean"
  6745. }
  6746. }
  6747. }
  6748. }
  6749. },
  6750. "x-codeSamples": [
  6751. {
  6752. "lang": "js",
  6753. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.submitPrompt({\n ...\n})"
  6754. }
  6755. ]
  6756. }
  6757. },
  6758. "/tui/clear-prompt": {
  6759. "post": {
  6760. "operationId": "tui.clearPrompt",
  6761. "parameters": [
  6762. {
  6763. "in": "query",
  6764. "name": "directory",
  6765. "schema": {
  6766. "type": "string"
  6767. }
  6768. },
  6769. {
  6770. "in": "query",
  6771. "name": "workspace",
  6772. "schema": {
  6773. "type": "string"
  6774. }
  6775. }
  6776. ],
  6777. "summary": "Clear TUI prompt",
  6778. "description": "Clear the prompt",
  6779. "responses": {
  6780. "200": {
  6781. "description": "Prompt cleared successfully",
  6782. "content": {
  6783. "application/json": {
  6784. "schema": {
  6785. "type": "boolean"
  6786. }
  6787. }
  6788. }
  6789. }
  6790. },
  6791. "x-codeSamples": [
  6792. {
  6793. "lang": "js",
  6794. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.clearPrompt({\n ...\n})"
  6795. }
  6796. ]
  6797. }
  6798. },
  6799. "/tui/execute-command": {
  6800. "post": {
  6801. "operationId": "tui.executeCommand",
  6802. "parameters": [
  6803. {
  6804. "in": "query",
  6805. "name": "directory",
  6806. "schema": {
  6807. "type": "string"
  6808. }
  6809. },
  6810. {
  6811. "in": "query",
  6812. "name": "workspace",
  6813. "schema": {
  6814. "type": "string"
  6815. }
  6816. }
  6817. ],
  6818. "summary": "Execute TUI command",
  6819. "description": "Execute a TUI command (e.g. agent_cycle)",
  6820. "responses": {
  6821. "200": {
  6822. "description": "Command executed successfully",
  6823. "content": {
  6824. "application/json": {
  6825. "schema": {
  6826. "type": "boolean"
  6827. }
  6828. }
  6829. }
  6830. },
  6831. "400": {
  6832. "description": "Bad request",
  6833. "content": {
  6834. "application/json": {
  6835. "schema": {
  6836. "$ref": "#/components/schemas/BadRequestError"
  6837. }
  6838. }
  6839. }
  6840. }
  6841. },
  6842. "requestBody": {
  6843. "content": {
  6844. "application/json": {
  6845. "schema": {
  6846. "type": "object",
  6847. "properties": {
  6848. "command": {
  6849. "type": "string"
  6850. }
  6851. },
  6852. "required": ["command"]
  6853. }
  6854. }
  6855. }
  6856. },
  6857. "x-codeSamples": [
  6858. {
  6859. "lang": "js",
  6860. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.executeCommand({\n ...\n})"
  6861. }
  6862. ]
  6863. }
  6864. },
  6865. "/tui/show-toast": {
  6866. "post": {
  6867. "operationId": "tui.showToast",
  6868. "parameters": [
  6869. {
  6870. "in": "query",
  6871. "name": "directory",
  6872. "schema": {
  6873. "type": "string"
  6874. }
  6875. },
  6876. {
  6877. "in": "query",
  6878. "name": "workspace",
  6879. "schema": {
  6880. "type": "string"
  6881. }
  6882. }
  6883. ],
  6884. "summary": "Show TUI toast",
  6885. "description": "Show a toast notification in the TUI",
  6886. "responses": {
  6887. "200": {
  6888. "description": "Toast notification shown successfully",
  6889. "content": {
  6890. "application/json": {
  6891. "schema": {
  6892. "type": "boolean"
  6893. }
  6894. }
  6895. }
  6896. }
  6897. },
  6898. "requestBody": {
  6899. "content": {
  6900. "application/json": {
  6901. "schema": {
  6902. "type": "object",
  6903. "properties": {
  6904. "title": {
  6905. "type": "string"
  6906. },
  6907. "message": {
  6908. "type": "string"
  6909. },
  6910. "variant": {
  6911. "type": "string",
  6912. "enum": ["info", "success", "warning", "error"]
  6913. },
  6914. "duration": {
  6915. "description": "Duration in milliseconds",
  6916. "type": "integer",
  6917. "exclusiveMinimum": 0,
  6918. "maximum": 9007199254740991
  6919. }
  6920. },
  6921. "required": ["message", "variant"]
  6922. }
  6923. }
  6924. }
  6925. },
  6926. "x-codeSamples": [
  6927. {
  6928. "lang": "js",
  6929. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.showToast({\n ...\n})"
  6930. }
  6931. ]
  6932. }
  6933. },
  6934. "/tui/publish": {
  6935. "post": {
  6936. "operationId": "tui.publish",
  6937. "parameters": [
  6938. {
  6939. "in": "query",
  6940. "name": "directory",
  6941. "schema": {
  6942. "type": "string"
  6943. }
  6944. },
  6945. {
  6946. "in": "query",
  6947. "name": "workspace",
  6948. "schema": {
  6949. "type": "string"
  6950. }
  6951. }
  6952. ],
  6953. "summary": "Publish TUI event",
  6954. "description": "Publish a TUI event",
  6955. "responses": {
  6956. "200": {
  6957. "description": "Event published successfully",
  6958. "content": {
  6959. "application/json": {
  6960. "schema": {
  6961. "type": "boolean"
  6962. }
  6963. }
  6964. }
  6965. },
  6966. "400": {
  6967. "description": "Bad request",
  6968. "content": {
  6969. "application/json": {
  6970. "schema": {
  6971. "$ref": "#/components/schemas/BadRequestError"
  6972. }
  6973. }
  6974. }
  6975. }
  6976. },
  6977. "requestBody": {
  6978. "content": {
  6979. "application/json": {
  6980. "schema": {
  6981. "anyOf": [
  6982. {
  6983. "$ref": "#/components/schemas/Event.tui.prompt.append"
  6984. },
  6985. {
  6986. "$ref": "#/components/schemas/Event.tui.command.execute"
  6987. },
  6988. {
  6989. "$ref": "#/components/schemas/Event.tui.toast.show"
  6990. },
  6991. {
  6992. "$ref": "#/components/schemas/Event.tui.session.select"
  6993. }
  6994. ]
  6995. }
  6996. }
  6997. }
  6998. },
  6999. "x-codeSamples": [
  7000. {
  7001. "lang": "js",
  7002. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.publish({\n ...\n})"
  7003. }
  7004. ]
  7005. }
  7006. },
  7007. "/tui/select-session": {
  7008. "post": {
  7009. "operationId": "tui.selectSession",
  7010. "parameters": [
  7011. {
  7012. "in": "query",
  7013. "name": "directory",
  7014. "schema": {
  7015. "type": "string"
  7016. }
  7017. },
  7018. {
  7019. "in": "query",
  7020. "name": "workspace",
  7021. "schema": {
  7022. "type": "string"
  7023. }
  7024. }
  7025. ],
  7026. "summary": "Select session",
  7027. "description": "Navigate the TUI to display the specified session.",
  7028. "responses": {
  7029. "200": {
  7030. "description": "Session selected successfully",
  7031. "content": {
  7032. "application/json": {
  7033. "schema": {
  7034. "type": "boolean"
  7035. }
  7036. }
  7037. }
  7038. },
  7039. "400": {
  7040. "description": "Bad request",
  7041. "content": {
  7042. "application/json": {
  7043. "schema": {
  7044. "$ref": "#/components/schemas/BadRequestError"
  7045. }
  7046. }
  7047. }
  7048. },
  7049. "404": {
  7050. "description": "Not found",
  7051. "content": {
  7052. "application/json": {
  7053. "schema": {
  7054. "$ref": "#/components/schemas/NotFoundError"
  7055. }
  7056. }
  7057. }
  7058. }
  7059. },
  7060. "requestBody": {
  7061. "content": {
  7062. "application/json": {
  7063. "schema": {
  7064. "type": "object",
  7065. "properties": {
  7066. "sessionID": {
  7067. "description": "Session ID to navigate to",
  7068. "type": "string",
  7069. "pattern": "^ses.*"
  7070. }
  7071. },
  7072. "required": ["sessionID"]
  7073. }
  7074. }
  7075. }
  7076. },
  7077. "x-codeSamples": [
  7078. {
  7079. "lang": "js",
  7080. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.selectSession({\n ...\n})"
  7081. }
  7082. ]
  7083. }
  7084. },
  7085. "/tui/control/next": {
  7086. "get": {
  7087. "operationId": "tui.control.next",
  7088. "parameters": [
  7089. {
  7090. "in": "query",
  7091. "name": "directory",
  7092. "schema": {
  7093. "type": "string"
  7094. }
  7095. },
  7096. {
  7097. "in": "query",
  7098. "name": "workspace",
  7099. "schema": {
  7100. "type": "string"
  7101. }
  7102. }
  7103. ],
  7104. "summary": "Get next TUI request",
  7105. "description": "Retrieve the next TUI (Terminal User Interface) request from the queue for processing.",
  7106. "responses": {
  7107. "200": {
  7108. "description": "Next TUI request",
  7109. "content": {
  7110. "application/json": {
  7111. "schema": {
  7112. "type": "object",
  7113. "properties": {
  7114. "path": {
  7115. "type": "string"
  7116. },
  7117. "body": {}
  7118. },
  7119. "required": ["path", "body"]
  7120. }
  7121. }
  7122. }
  7123. }
  7124. },
  7125. "x-codeSamples": [
  7126. {
  7127. "lang": "js",
  7128. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.control.next({\n ...\n})"
  7129. }
  7130. ]
  7131. }
  7132. },
  7133. "/tui/control/response": {
  7134. "post": {
  7135. "operationId": "tui.control.response",
  7136. "parameters": [
  7137. {
  7138. "in": "query",
  7139. "name": "directory",
  7140. "schema": {
  7141. "type": "string"
  7142. }
  7143. },
  7144. {
  7145. "in": "query",
  7146. "name": "workspace",
  7147. "schema": {
  7148. "type": "string"
  7149. }
  7150. }
  7151. ],
  7152. "summary": "Submit TUI response",
  7153. "description": "Submit a response to the TUI request queue to complete a pending request.",
  7154. "responses": {
  7155. "200": {
  7156. "description": "Response submitted successfully",
  7157. "content": {
  7158. "application/json": {
  7159. "schema": {
  7160. "type": "boolean"
  7161. }
  7162. }
  7163. }
  7164. }
  7165. },
  7166. "requestBody": {
  7167. "content": {
  7168. "application/json": {
  7169. "schema": {}
  7170. }
  7171. }
  7172. },
  7173. "x-codeSamples": [
  7174. {
  7175. "lang": "js",
  7176. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.control.response({\n ...\n})"
  7177. }
  7178. ]
  7179. }
  7180. },
  7181. "/instance/dispose": {
  7182. "post": {
  7183. "operationId": "instance.dispose",
  7184. "parameters": [
  7185. {
  7186. "in": "query",
  7187. "name": "directory",
  7188. "schema": {
  7189. "type": "string"
  7190. }
  7191. },
  7192. {
  7193. "in": "query",
  7194. "name": "workspace",
  7195. "schema": {
  7196. "type": "string"
  7197. }
  7198. }
  7199. ],
  7200. "summary": "Dispose instance",
  7201. "description": "Clean up and dispose the current OpenCode instance, releasing all resources.",
  7202. "responses": {
  7203. "200": {
  7204. "description": "Instance disposed",
  7205. "content": {
  7206. "application/json": {
  7207. "schema": {
  7208. "type": "boolean"
  7209. }
  7210. }
  7211. }
  7212. }
  7213. },
  7214. "x-codeSamples": [
  7215. {
  7216. "lang": "js",
  7217. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.instance.dispose({\n ...\n})"
  7218. }
  7219. ]
  7220. }
  7221. },
  7222. "/path": {
  7223. "get": {
  7224. "operationId": "path.get",
  7225. "parameters": [
  7226. {
  7227. "in": "query",
  7228. "name": "directory",
  7229. "schema": {
  7230. "type": "string"
  7231. }
  7232. },
  7233. {
  7234. "in": "query",
  7235. "name": "workspace",
  7236. "schema": {
  7237. "type": "string"
  7238. }
  7239. }
  7240. ],
  7241. "summary": "Get paths",
  7242. "description": "Retrieve the current working directory and related path information for the OpenCode instance.",
  7243. "responses": {
  7244. "200": {
  7245. "description": "Path",
  7246. "content": {
  7247. "application/json": {
  7248. "schema": {
  7249. "$ref": "#/components/schemas/Path"
  7250. }
  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.path.get({\n ...\n})"
  7259. }
  7260. ]
  7261. }
  7262. },
  7263. "/vcs": {
  7264. "get": {
  7265. "operationId": "vcs.get",
  7266. "parameters": [
  7267. {
  7268. "in": "query",
  7269. "name": "directory",
  7270. "schema": {
  7271. "type": "string"
  7272. }
  7273. },
  7274. {
  7275. "in": "query",
  7276. "name": "workspace",
  7277. "schema": {
  7278. "type": "string"
  7279. }
  7280. }
  7281. ],
  7282. "summary": "Get VCS info",
  7283. "description": "Retrieve version control system (VCS) information for the current project, such as git branch.",
  7284. "responses": {
  7285. "200": {
  7286. "description": "VCS info",
  7287. "content": {
  7288. "application/json": {
  7289. "schema": {
  7290. "$ref": "#/components/schemas/VcsInfo"
  7291. }
  7292. }
  7293. }
  7294. }
  7295. },
  7296. "x-codeSamples": [
  7297. {
  7298. "lang": "js",
  7299. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.vcs.get({\n ...\n})"
  7300. }
  7301. ]
  7302. }
  7303. },
  7304. "/vcs/diff": {
  7305. "get": {
  7306. "operationId": "vcs.diff",
  7307. "parameters": [
  7308. {
  7309. "in": "query",
  7310. "name": "directory",
  7311. "schema": {
  7312. "type": "string"
  7313. }
  7314. },
  7315. {
  7316. "in": "query",
  7317. "name": "workspace",
  7318. "schema": {
  7319. "type": "string"
  7320. }
  7321. },
  7322. {
  7323. "in": "query",
  7324. "name": "mode",
  7325. "schema": {
  7326. "type": "string",
  7327. "enum": ["git", "branch"]
  7328. },
  7329. "required": true
  7330. }
  7331. ],
  7332. "summary": "Get VCS diff",
  7333. "description": "Retrieve the current git diff for the working tree or against the default branch.",
  7334. "responses": {
  7335. "200": {
  7336. "description": "VCS diff",
  7337. "content": {
  7338. "application/json": {
  7339. "schema": {
  7340. "type": "array",
  7341. "items": {
  7342. "$ref": "#/components/schemas/VcsFileDiff"
  7343. }
  7344. }
  7345. }
  7346. }
  7347. }
  7348. },
  7349. "x-codeSamples": [
  7350. {
  7351. "lang": "js",
  7352. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.vcs.diff({\n ...\n})"
  7353. }
  7354. ]
  7355. }
  7356. },
  7357. "/command": {
  7358. "get": {
  7359. "operationId": "command.list",
  7360. "parameters": [
  7361. {
  7362. "in": "query",
  7363. "name": "directory",
  7364. "schema": {
  7365. "type": "string"
  7366. }
  7367. },
  7368. {
  7369. "in": "query",
  7370. "name": "workspace",
  7371. "schema": {
  7372. "type": "string"
  7373. }
  7374. }
  7375. ],
  7376. "summary": "List commands",
  7377. "description": "Get a list of all available commands in the OpenCode system.",
  7378. "responses": {
  7379. "200": {
  7380. "description": "List of commands",
  7381. "content": {
  7382. "application/json": {
  7383. "schema": {
  7384. "type": "array",
  7385. "items": {
  7386. "$ref": "#/components/schemas/Command"
  7387. }
  7388. }
  7389. }
  7390. }
  7391. }
  7392. },
  7393. "x-codeSamples": [
  7394. {
  7395. "lang": "js",
  7396. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.command.list({\n ...\n})"
  7397. }
  7398. ]
  7399. }
  7400. },
  7401. "/agent": {
  7402. "get": {
  7403. "operationId": "app.agents",
  7404. "parameters": [
  7405. {
  7406. "in": "query",
  7407. "name": "directory",
  7408. "schema": {
  7409. "type": "string"
  7410. }
  7411. },
  7412. {
  7413. "in": "query",
  7414. "name": "workspace",
  7415. "schema": {
  7416. "type": "string"
  7417. }
  7418. }
  7419. ],
  7420. "summary": "List agents",
  7421. "description": "Get a list of all available AI agents in the OpenCode system.",
  7422. "responses": {
  7423. "200": {
  7424. "description": "List of agents",
  7425. "content": {
  7426. "application/json": {
  7427. "schema": {
  7428. "type": "array",
  7429. "items": {
  7430. "$ref": "#/components/schemas/Agent"
  7431. }
  7432. }
  7433. }
  7434. }
  7435. }
  7436. },
  7437. "x-codeSamples": [
  7438. {
  7439. "lang": "js",
  7440. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.app.agents({\n ...\n})"
  7441. }
  7442. ]
  7443. }
  7444. },
  7445. "/skill": {
  7446. "get": {
  7447. "operationId": "app.skills",
  7448. "parameters": [
  7449. {
  7450. "in": "query",
  7451. "name": "directory",
  7452. "schema": {
  7453. "type": "string"
  7454. }
  7455. },
  7456. {
  7457. "in": "query",
  7458. "name": "workspace",
  7459. "schema": {
  7460. "type": "string"
  7461. }
  7462. }
  7463. ],
  7464. "summary": "List skills",
  7465. "description": "Get a list of all available skills in the OpenCode system.",
  7466. "responses": {
  7467. "200": {
  7468. "description": "List of skills",
  7469. "content": {
  7470. "application/json": {
  7471. "schema": {
  7472. "type": "array",
  7473. "items": {
  7474. "type": "object",
  7475. "properties": {
  7476. "name": {
  7477. "type": "string"
  7478. },
  7479. "description": {
  7480. "type": "string"
  7481. },
  7482. "location": {
  7483. "type": "string"
  7484. },
  7485. "content": {
  7486. "type": "string"
  7487. }
  7488. },
  7489. "required": ["name", "description", "location", "content"]
  7490. }
  7491. }
  7492. }
  7493. }
  7494. }
  7495. },
  7496. "x-codeSamples": [
  7497. {
  7498. "lang": "js",
  7499. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.app.skills({\n ...\n})"
  7500. }
  7501. ]
  7502. }
  7503. },
  7504. "/lsp": {
  7505. "get": {
  7506. "operationId": "lsp.status",
  7507. "parameters": [
  7508. {
  7509. "in": "query",
  7510. "name": "directory",
  7511. "schema": {
  7512. "type": "string"
  7513. }
  7514. },
  7515. {
  7516. "in": "query",
  7517. "name": "workspace",
  7518. "schema": {
  7519. "type": "string"
  7520. }
  7521. }
  7522. ],
  7523. "summary": "Get LSP status",
  7524. "description": "Get LSP server status",
  7525. "responses": {
  7526. "200": {
  7527. "description": "LSP server status",
  7528. "content": {
  7529. "application/json": {
  7530. "schema": {
  7531. "type": "array",
  7532. "items": {
  7533. "$ref": "#/components/schemas/LSPStatus"
  7534. }
  7535. }
  7536. }
  7537. }
  7538. }
  7539. },
  7540. "x-codeSamples": [
  7541. {
  7542. "lang": "js",
  7543. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.lsp.status({\n ...\n})"
  7544. }
  7545. ]
  7546. }
  7547. },
  7548. "/formatter": {
  7549. "get": {
  7550. "operationId": "formatter.status",
  7551. "parameters": [
  7552. {
  7553. "in": "query",
  7554. "name": "directory",
  7555. "schema": {
  7556. "type": "string"
  7557. }
  7558. },
  7559. {
  7560. "in": "query",
  7561. "name": "workspace",
  7562. "schema": {
  7563. "type": "string"
  7564. }
  7565. }
  7566. ],
  7567. "summary": "Get formatter status",
  7568. "description": "Get formatter status",
  7569. "responses": {
  7570. "200": {
  7571. "description": "Formatter status",
  7572. "content": {
  7573. "application/json": {
  7574. "schema": {
  7575. "type": "array",
  7576. "items": {
  7577. "$ref": "#/components/schemas/FormatterStatus"
  7578. }
  7579. }
  7580. }
  7581. }
  7582. }
  7583. },
  7584. "x-codeSamples": [
  7585. {
  7586. "lang": "js",
  7587. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.formatter.status({\n ...\n})"
  7588. }
  7589. ]
  7590. }
  7591. }
  7592. },
  7593. "components": {
  7594. "schemas": {
  7595. "Project": {
  7596. "type": "object",
  7597. "properties": {
  7598. "id": {
  7599. "type": "string"
  7600. },
  7601. "worktree": {
  7602. "type": "string"
  7603. },
  7604. "vcs": {
  7605. "type": "string",
  7606. "const": "git"
  7607. },
  7608. "name": {
  7609. "type": "string"
  7610. },
  7611. "icon": {
  7612. "type": "object",
  7613. "properties": {
  7614. "url": {
  7615. "type": "string"
  7616. },
  7617. "override": {
  7618. "type": "string"
  7619. },
  7620. "color": {
  7621. "type": "string"
  7622. }
  7623. }
  7624. },
  7625. "commands": {
  7626. "type": "object",
  7627. "properties": {
  7628. "start": {
  7629. "description": "Startup script to run when creating a new workspace (worktree)",
  7630. "type": "string"
  7631. }
  7632. }
  7633. },
  7634. "time": {
  7635. "type": "object",
  7636. "properties": {
  7637. "created": {
  7638. "type": "integer",
  7639. "minimum": 0,
  7640. "maximum": 9007199254740991
  7641. },
  7642. "updated": {
  7643. "type": "integer",
  7644. "minimum": 0,
  7645. "maximum": 9007199254740991
  7646. },
  7647. "initialized": {
  7648. "type": "integer",
  7649. "minimum": 0,
  7650. "maximum": 9007199254740991
  7651. }
  7652. },
  7653. "required": ["created", "updated"]
  7654. },
  7655. "sandboxes": {
  7656. "type": "array",
  7657. "items": {
  7658. "type": "string"
  7659. }
  7660. }
  7661. },
  7662. "required": ["id", "worktree", "time", "sandboxes"]
  7663. },
  7664. "Event.project.updated": {
  7665. "type": "object",
  7666. "properties": {
  7667. "type": {
  7668. "type": "string",
  7669. "const": "project.updated"
  7670. },
  7671. "properties": {
  7672. "$ref": "#/components/schemas/Project"
  7673. }
  7674. },
  7675. "required": ["type", "properties"]
  7676. },
  7677. "Event.server.instance.disposed": {
  7678. "type": "object",
  7679. "properties": {
  7680. "type": {
  7681. "type": "string",
  7682. "const": "server.instance.disposed"
  7683. },
  7684. "properties": {
  7685. "type": "object",
  7686. "properties": {
  7687. "directory": {
  7688. "type": "string"
  7689. }
  7690. },
  7691. "required": ["directory"]
  7692. }
  7693. },
  7694. "required": ["type", "properties"]
  7695. },
  7696. "Event.server.connected": {
  7697. "type": "object",
  7698. "properties": {
  7699. "type": {
  7700. "type": "string",
  7701. "const": "server.connected"
  7702. },
  7703. "properties": {
  7704. "type": "object",
  7705. "properties": {}
  7706. }
  7707. },
  7708. "required": ["type", "properties"]
  7709. },
  7710. "Event.global.disposed": {
  7711. "type": "object",
  7712. "properties": {
  7713. "type": {
  7714. "type": "string",
  7715. "const": "global.disposed"
  7716. },
  7717. "properties": {
  7718. "type": "object",
  7719. "properties": {}
  7720. }
  7721. },
  7722. "required": ["type", "properties"]
  7723. },
  7724. "Event.file.edited": {
  7725. "type": "object",
  7726. "properties": {
  7727. "type": {
  7728. "type": "string",
  7729. "const": "file.edited"
  7730. },
  7731. "properties": {
  7732. "type": "object",
  7733. "properties": {
  7734. "file": {
  7735. "type": "string"
  7736. }
  7737. },
  7738. "required": ["file"]
  7739. }
  7740. },
  7741. "required": ["type", "properties"]
  7742. },
  7743. "Event.file.watcher.updated": {
  7744. "type": "object",
  7745. "properties": {
  7746. "type": {
  7747. "type": "string",
  7748. "const": "file.watcher.updated"
  7749. },
  7750. "properties": {
  7751. "type": "object",
  7752. "properties": {
  7753. "file": {
  7754. "type": "string"
  7755. },
  7756. "event": {
  7757. "type": "string",
  7758. "enum": ["add", "change", "unlink"]
  7759. }
  7760. },
  7761. "required": ["file", "event"]
  7762. }
  7763. },
  7764. "required": ["type", "properties"]
  7765. },
  7766. "Event.lsp.client.diagnostics": {
  7767. "type": "object",
  7768. "properties": {
  7769. "type": {
  7770. "type": "string",
  7771. "const": "lsp.client.diagnostics"
  7772. },
  7773. "properties": {
  7774. "type": "object",
  7775. "properties": {
  7776. "serverID": {
  7777. "type": "string"
  7778. },
  7779. "path": {
  7780. "type": "string"
  7781. }
  7782. },
  7783. "required": ["serverID", "path"]
  7784. }
  7785. },
  7786. "required": ["type", "properties"]
  7787. },
  7788. "Event.lsp.updated": {
  7789. "type": "object",
  7790. "properties": {
  7791. "type": {
  7792. "type": "string",
  7793. "const": "lsp.updated"
  7794. },
  7795. "properties": {
  7796. "type": "object",
  7797. "properties": {}
  7798. }
  7799. },
  7800. "required": ["type", "properties"]
  7801. },
  7802. "Event.message.part.delta": {
  7803. "type": "object",
  7804. "properties": {
  7805. "type": {
  7806. "type": "string",
  7807. "const": "message.part.delta"
  7808. },
  7809. "properties": {
  7810. "type": "object",
  7811. "properties": {
  7812. "sessionID": {
  7813. "type": "string",
  7814. "pattern": "^ses.*"
  7815. },
  7816. "messageID": {
  7817. "type": "string",
  7818. "pattern": "^msg.*"
  7819. },
  7820. "partID": {
  7821. "type": "string",
  7822. "pattern": "^prt.*"
  7823. },
  7824. "field": {
  7825. "type": "string"
  7826. },
  7827. "delta": {
  7828. "type": "string"
  7829. }
  7830. },
  7831. "required": ["sessionID", "messageID", "partID", "field", "delta"]
  7832. }
  7833. },
  7834. "required": ["type", "properties"]
  7835. },
  7836. "PermissionRequest": {
  7837. "type": "object",
  7838. "properties": {
  7839. "id": {
  7840. "type": "string",
  7841. "pattern": "^per.*"
  7842. },
  7843. "sessionID": {
  7844. "type": "string",
  7845. "pattern": "^ses.*"
  7846. },
  7847. "permission": {
  7848. "type": "string"
  7849. },
  7850. "patterns": {
  7851. "type": "array",
  7852. "items": {
  7853. "type": "string"
  7854. }
  7855. },
  7856. "metadata": {
  7857. "type": "object",
  7858. "propertyNames": {
  7859. "type": "string"
  7860. },
  7861. "additionalProperties": {}
  7862. },
  7863. "always": {
  7864. "type": "array",
  7865. "items": {
  7866. "type": "string"
  7867. }
  7868. },
  7869. "tool": {
  7870. "type": "object",
  7871. "properties": {
  7872. "messageID": {
  7873. "type": "string",
  7874. "pattern": "^msg.*"
  7875. },
  7876. "callID": {
  7877. "type": "string"
  7878. }
  7879. },
  7880. "required": ["messageID", "callID"]
  7881. }
  7882. },
  7883. "required": ["id", "sessionID", "permission", "patterns", "metadata", "always"]
  7884. },
  7885. "Event.permission.asked": {
  7886. "type": "object",
  7887. "properties": {
  7888. "type": {
  7889. "type": "string",
  7890. "const": "permission.asked"
  7891. },
  7892. "properties": {
  7893. "$ref": "#/components/schemas/PermissionRequest"
  7894. }
  7895. },
  7896. "required": ["type", "properties"]
  7897. },
  7898. "Event.permission.replied": {
  7899. "type": "object",
  7900. "properties": {
  7901. "type": {
  7902. "type": "string",
  7903. "const": "permission.replied"
  7904. },
  7905. "properties": {
  7906. "type": "object",
  7907. "properties": {
  7908. "sessionID": {
  7909. "type": "string",
  7910. "pattern": "^ses.*"
  7911. },
  7912. "requestID": {
  7913. "type": "string",
  7914. "pattern": "^per.*"
  7915. },
  7916. "reply": {
  7917. "type": "string",
  7918. "enum": ["once", "always", "reject"]
  7919. }
  7920. },
  7921. "required": ["sessionID", "requestID", "reply"]
  7922. }
  7923. },
  7924. "required": ["type", "properties"]
  7925. },
  7926. "SnapshotFileDiff": {
  7927. "type": "object",
  7928. "properties": {
  7929. "file": {
  7930. "type": "string"
  7931. },
  7932. "patch": {
  7933. "type": "string"
  7934. },
  7935. "additions": {
  7936. "type": "integer",
  7937. "minimum": 0,
  7938. "maximum": 9007199254740991
  7939. },
  7940. "deletions": {
  7941. "type": "integer",
  7942. "minimum": 0,
  7943. "maximum": 9007199254740991
  7944. },
  7945. "status": {
  7946. "type": "string",
  7947. "enum": ["added", "deleted", "modified"]
  7948. }
  7949. },
  7950. "required": ["file", "patch", "additions", "deletions"]
  7951. },
  7952. "Event.session.diff": {
  7953. "type": "object",
  7954. "properties": {
  7955. "type": {
  7956. "type": "string",
  7957. "const": "session.diff"
  7958. },
  7959. "properties": {
  7960. "type": "object",
  7961. "properties": {
  7962. "sessionID": {
  7963. "type": "string",
  7964. "pattern": "^ses.*"
  7965. },
  7966. "diff": {
  7967. "type": "array",
  7968. "items": {
  7969. "$ref": "#/components/schemas/SnapshotFileDiff"
  7970. }
  7971. }
  7972. },
  7973. "required": ["sessionID", "diff"]
  7974. }
  7975. },
  7976. "required": ["type", "properties"]
  7977. },
  7978. "ProviderAuthError": {
  7979. "type": "object",
  7980. "properties": {
  7981. "name": {
  7982. "type": "string",
  7983. "const": "ProviderAuthError"
  7984. },
  7985. "data": {
  7986. "type": "object",
  7987. "properties": {
  7988. "providerID": {
  7989. "type": "string"
  7990. },
  7991. "message": {
  7992. "type": "string"
  7993. }
  7994. },
  7995. "required": ["providerID", "message"]
  7996. }
  7997. },
  7998. "required": ["name", "data"]
  7999. },
  8000. "UnknownError": {
  8001. "type": "object",
  8002. "properties": {
  8003. "name": {
  8004. "type": "string",
  8005. "const": "UnknownError"
  8006. },
  8007. "data": {
  8008. "type": "object",
  8009. "properties": {
  8010. "message": {
  8011. "type": "string"
  8012. }
  8013. },
  8014. "required": ["message"]
  8015. }
  8016. },
  8017. "required": ["name", "data"]
  8018. },
  8019. "MessageOutputLengthError": {
  8020. "type": "object",
  8021. "properties": {
  8022. "name": {
  8023. "type": "string",
  8024. "const": "MessageOutputLengthError"
  8025. },
  8026. "data": {
  8027. "type": "object",
  8028. "properties": {}
  8029. }
  8030. },
  8031. "required": ["name", "data"]
  8032. },
  8033. "MessageAbortedError": {
  8034. "type": "object",
  8035. "properties": {
  8036. "name": {
  8037. "type": "string",
  8038. "const": "MessageAbortedError"
  8039. },
  8040. "data": {
  8041. "type": "object",
  8042. "properties": {
  8043. "message": {
  8044. "type": "string"
  8045. }
  8046. },
  8047. "required": ["message"]
  8048. }
  8049. },
  8050. "required": ["name", "data"]
  8051. },
  8052. "StructuredOutputError": {
  8053. "type": "object",
  8054. "properties": {
  8055. "name": {
  8056. "type": "string",
  8057. "const": "StructuredOutputError"
  8058. },
  8059. "data": {
  8060. "type": "object",
  8061. "properties": {
  8062. "message": {
  8063. "type": "string"
  8064. },
  8065. "retries": {
  8066. "type": "integer",
  8067. "minimum": 0,
  8068. "maximum": 9007199254740991
  8069. }
  8070. },
  8071. "required": ["message", "retries"]
  8072. }
  8073. },
  8074. "required": ["name", "data"]
  8075. },
  8076. "ContextOverflowError": {
  8077. "type": "object",
  8078. "properties": {
  8079. "name": {
  8080. "type": "string",
  8081. "const": "ContextOverflowError"
  8082. },
  8083. "data": {
  8084. "type": "object",
  8085. "properties": {
  8086. "message": {
  8087. "type": "string"
  8088. },
  8089. "responseBody": {
  8090. "type": "string"
  8091. }
  8092. },
  8093. "required": ["message"]
  8094. }
  8095. },
  8096. "required": ["name", "data"]
  8097. },
  8098. "APIError": {
  8099. "type": "object",
  8100. "properties": {
  8101. "name": {
  8102. "type": "string",
  8103. "const": "APIError"
  8104. },
  8105. "data": {
  8106. "type": "object",
  8107. "properties": {
  8108. "message": {
  8109. "type": "string"
  8110. },
  8111. "statusCode": {
  8112. "type": "integer",
  8113. "minimum": 0,
  8114. "maximum": 9007199254740991
  8115. },
  8116. "isRetryable": {
  8117. "type": "boolean"
  8118. },
  8119. "responseHeaders": {
  8120. "type": "object",
  8121. "propertyNames": {
  8122. "type": "string"
  8123. },
  8124. "additionalProperties": {
  8125. "type": "string"
  8126. }
  8127. },
  8128. "responseBody": {
  8129. "type": "string"
  8130. },
  8131. "metadata": {
  8132. "type": "object",
  8133. "propertyNames": {
  8134. "type": "string"
  8135. },
  8136. "additionalProperties": {
  8137. "type": "string"
  8138. }
  8139. }
  8140. },
  8141. "required": ["message", "isRetryable"]
  8142. }
  8143. },
  8144. "required": ["name", "data"]
  8145. },
  8146. "Event.session.error": {
  8147. "type": "object",
  8148. "properties": {
  8149. "type": {
  8150. "type": "string",
  8151. "const": "session.error"
  8152. },
  8153. "properties": {
  8154. "type": "object",
  8155. "properties": {
  8156. "sessionID": {
  8157. "type": "string",
  8158. "pattern": "^ses.*"
  8159. },
  8160. "error": {
  8161. "anyOf": [
  8162. {
  8163. "$ref": "#/components/schemas/ProviderAuthError"
  8164. },
  8165. {
  8166. "$ref": "#/components/schemas/UnknownError"
  8167. },
  8168. {
  8169. "$ref": "#/components/schemas/MessageOutputLengthError"
  8170. },
  8171. {
  8172. "$ref": "#/components/schemas/MessageAbortedError"
  8173. },
  8174. {
  8175. "$ref": "#/components/schemas/StructuredOutputError"
  8176. },
  8177. {
  8178. "$ref": "#/components/schemas/ContextOverflowError"
  8179. },
  8180. {
  8181. "$ref": "#/components/schemas/APIError"
  8182. }
  8183. ]
  8184. }
  8185. }
  8186. }
  8187. },
  8188. "required": ["type", "properties"]
  8189. },
  8190. "Event.installation.updated": {
  8191. "type": "object",
  8192. "properties": {
  8193. "type": {
  8194. "type": "string",
  8195. "const": "installation.updated"
  8196. },
  8197. "properties": {
  8198. "type": "object",
  8199. "properties": {
  8200. "version": {
  8201. "type": "string"
  8202. }
  8203. },
  8204. "required": ["version"]
  8205. }
  8206. },
  8207. "required": ["type", "properties"]
  8208. },
  8209. "Event.installation.update-available": {
  8210. "type": "object",
  8211. "properties": {
  8212. "type": {
  8213. "type": "string",
  8214. "const": "installation.update-available"
  8215. },
  8216. "properties": {
  8217. "type": "object",
  8218. "properties": {
  8219. "version": {
  8220. "type": "string"
  8221. }
  8222. },
  8223. "required": ["version"]
  8224. }
  8225. },
  8226. "required": ["type", "properties"]
  8227. },
  8228. "QuestionOption": {
  8229. "type": "object",
  8230. "properties": {
  8231. "label": {
  8232. "description": "Display text (1-5 words, concise)",
  8233. "type": "string"
  8234. },
  8235. "description": {
  8236. "description": "Explanation of choice",
  8237. "type": "string"
  8238. }
  8239. },
  8240. "required": ["label", "description"]
  8241. },
  8242. "QuestionInfo": {
  8243. "type": "object",
  8244. "properties": {
  8245. "question": {
  8246. "description": "Complete question",
  8247. "type": "string"
  8248. },
  8249. "header": {
  8250. "description": "Very short label (max 30 chars)",
  8251. "type": "string"
  8252. },
  8253. "options": {
  8254. "description": "Available choices",
  8255. "type": "array",
  8256. "items": {
  8257. "$ref": "#/components/schemas/QuestionOption"
  8258. }
  8259. },
  8260. "multiple": {
  8261. "description": "Allow selecting multiple choices",
  8262. "type": "boolean"
  8263. },
  8264. "custom": {
  8265. "description": "Allow typing a custom answer (default: true)",
  8266. "type": "boolean"
  8267. }
  8268. },
  8269. "required": ["question", "header", "options"]
  8270. },
  8271. "QuestionTool": {
  8272. "type": "object",
  8273. "properties": {
  8274. "messageID": {
  8275. "type": "string",
  8276. "pattern": "^msg.*"
  8277. },
  8278. "callID": {
  8279. "type": "string"
  8280. }
  8281. },
  8282. "required": ["messageID", "callID"]
  8283. },
  8284. "QuestionRequest": {
  8285. "type": "object",
  8286. "properties": {
  8287. "id": {
  8288. "type": "string",
  8289. "pattern": "^que.*"
  8290. },
  8291. "sessionID": {
  8292. "type": "string",
  8293. "pattern": "^ses.*"
  8294. },
  8295. "questions": {
  8296. "description": "Questions to ask",
  8297. "type": "array",
  8298. "items": {
  8299. "$ref": "#/components/schemas/QuestionInfo"
  8300. }
  8301. },
  8302. "tool": {
  8303. "$ref": "#/components/schemas/QuestionTool"
  8304. }
  8305. },
  8306. "required": ["id", "sessionID", "questions"]
  8307. },
  8308. "Event.question.asked": {
  8309. "type": "object",
  8310. "properties": {
  8311. "type": {
  8312. "type": "string",
  8313. "const": "question.asked"
  8314. },
  8315. "properties": {
  8316. "$ref": "#/components/schemas/QuestionRequest"
  8317. }
  8318. },
  8319. "required": ["type", "properties"]
  8320. },
  8321. "QuestionAnswer": {
  8322. "type": "array",
  8323. "items": {
  8324. "type": "string"
  8325. }
  8326. },
  8327. "QuestionReplied": {
  8328. "type": "object",
  8329. "properties": {
  8330. "sessionID": {
  8331. "type": "string",
  8332. "pattern": "^ses.*"
  8333. },
  8334. "requestID": {
  8335. "type": "string",
  8336. "pattern": "^que.*"
  8337. },
  8338. "answers": {
  8339. "type": "array",
  8340. "items": {
  8341. "$ref": "#/components/schemas/QuestionAnswer"
  8342. }
  8343. }
  8344. },
  8345. "required": ["sessionID", "requestID", "answers"]
  8346. },
  8347. "Event.question.replied": {
  8348. "type": "object",
  8349. "properties": {
  8350. "type": {
  8351. "type": "string",
  8352. "const": "question.replied"
  8353. },
  8354. "properties": {
  8355. "$ref": "#/components/schemas/QuestionReplied"
  8356. }
  8357. },
  8358. "required": ["type", "properties"]
  8359. },
  8360. "QuestionRejected": {
  8361. "type": "object",
  8362. "properties": {
  8363. "sessionID": {
  8364. "type": "string",
  8365. "pattern": "^ses.*"
  8366. },
  8367. "requestID": {
  8368. "type": "string",
  8369. "pattern": "^que.*"
  8370. }
  8371. },
  8372. "required": ["sessionID", "requestID"]
  8373. },
  8374. "Event.question.rejected": {
  8375. "type": "object",
  8376. "properties": {
  8377. "type": {
  8378. "type": "string",
  8379. "const": "question.rejected"
  8380. },
  8381. "properties": {
  8382. "$ref": "#/components/schemas/QuestionRejected"
  8383. }
  8384. },
  8385. "required": ["type", "properties"]
  8386. },
  8387. "Todo": {
  8388. "type": "object",
  8389. "properties": {
  8390. "content": {
  8391. "description": "Brief description of the task",
  8392. "type": "string"
  8393. },
  8394. "status": {
  8395. "description": "Current status of the task: pending, in_progress, completed, cancelled",
  8396. "type": "string"
  8397. },
  8398. "priority": {
  8399. "description": "Priority level of the task: high, medium, low",
  8400. "type": "string"
  8401. }
  8402. },
  8403. "required": ["content", "status", "priority"]
  8404. },
  8405. "Event.todo.updated": {
  8406. "type": "object",
  8407. "properties": {
  8408. "type": {
  8409. "type": "string",
  8410. "const": "todo.updated"
  8411. },
  8412. "properties": {
  8413. "type": "object",
  8414. "properties": {
  8415. "sessionID": {
  8416. "type": "string",
  8417. "pattern": "^ses.*"
  8418. },
  8419. "todos": {
  8420. "type": "array",
  8421. "items": {
  8422. "$ref": "#/components/schemas/Todo"
  8423. }
  8424. }
  8425. },
  8426. "required": ["sessionID", "todos"]
  8427. }
  8428. },
  8429. "required": ["type", "properties"]
  8430. },
  8431. "SessionStatus": {
  8432. "anyOf": [
  8433. {
  8434. "type": "object",
  8435. "properties": {
  8436. "type": {
  8437. "type": "string",
  8438. "const": "idle"
  8439. }
  8440. },
  8441. "required": ["type"]
  8442. },
  8443. {
  8444. "type": "object",
  8445. "properties": {
  8446. "type": {
  8447. "type": "string",
  8448. "const": "retry"
  8449. },
  8450. "attempt": {
  8451. "type": "integer",
  8452. "minimum": 0,
  8453. "maximum": 9007199254740991
  8454. },
  8455. "message": {
  8456. "type": "string"
  8457. },
  8458. "next": {
  8459. "type": "integer",
  8460. "minimum": 0,
  8461. "maximum": 9007199254740991
  8462. }
  8463. },
  8464. "required": ["type", "attempt", "message", "next"]
  8465. },
  8466. {
  8467. "type": "object",
  8468. "properties": {
  8469. "type": {
  8470. "type": "string",
  8471. "const": "busy"
  8472. }
  8473. },
  8474. "required": ["type"]
  8475. }
  8476. ]
  8477. },
  8478. "Event.session.status": {
  8479. "type": "object",
  8480. "properties": {
  8481. "type": {
  8482. "type": "string",
  8483. "const": "session.status"
  8484. },
  8485. "properties": {
  8486. "type": "object",
  8487. "properties": {
  8488. "sessionID": {
  8489. "type": "string",
  8490. "pattern": "^ses.*"
  8491. },
  8492. "status": {
  8493. "$ref": "#/components/schemas/SessionStatus"
  8494. }
  8495. },
  8496. "required": ["sessionID", "status"]
  8497. }
  8498. },
  8499. "required": ["type", "properties"]
  8500. },
  8501. "Event.session.idle": {
  8502. "type": "object",
  8503. "properties": {
  8504. "type": {
  8505. "type": "string",
  8506. "const": "session.idle"
  8507. },
  8508. "properties": {
  8509. "type": "object",
  8510. "properties": {
  8511. "sessionID": {
  8512. "type": "string",
  8513. "pattern": "^ses.*"
  8514. }
  8515. },
  8516. "required": ["sessionID"]
  8517. }
  8518. },
  8519. "required": ["type", "properties"]
  8520. },
  8521. "Event.session.compacted": {
  8522. "type": "object",
  8523. "properties": {
  8524. "type": {
  8525. "type": "string",
  8526. "const": "session.compacted"
  8527. },
  8528. "properties": {
  8529. "type": "object",
  8530. "properties": {
  8531. "sessionID": {
  8532. "type": "string",
  8533. "pattern": "^ses.*"
  8534. }
  8535. },
  8536. "required": ["sessionID"]
  8537. }
  8538. },
  8539. "required": ["type", "properties"]
  8540. },
  8541. "Event.tui.prompt.append": {
  8542. "type": "object",
  8543. "properties": {
  8544. "type": {
  8545. "type": "string",
  8546. "const": "tui.prompt.append"
  8547. },
  8548. "properties": {
  8549. "type": "object",
  8550. "properties": {
  8551. "text": {
  8552. "type": "string"
  8553. }
  8554. },
  8555. "required": ["text"]
  8556. }
  8557. },
  8558. "required": ["type", "properties"]
  8559. },
  8560. "Event.tui.command.execute": {
  8561. "type": "object",
  8562. "properties": {
  8563. "type": {
  8564. "type": "string",
  8565. "const": "tui.command.execute"
  8566. },
  8567. "properties": {
  8568. "type": "object",
  8569. "properties": {
  8570. "command": {
  8571. "anyOf": [
  8572. {
  8573. "type": "string",
  8574. "enum": [
  8575. "session.list",
  8576. "session.new",
  8577. "session.share",
  8578. "session.interrupt",
  8579. "session.compact",
  8580. "session.page.up",
  8581. "session.page.down",
  8582. "session.line.up",
  8583. "session.line.down",
  8584. "session.half.page.up",
  8585. "session.half.page.down",
  8586. "session.first",
  8587. "session.last",
  8588. "prompt.clear",
  8589. "prompt.submit",
  8590. "agent.cycle"
  8591. ]
  8592. },
  8593. {
  8594. "type": "string"
  8595. }
  8596. ]
  8597. }
  8598. },
  8599. "required": ["command"]
  8600. }
  8601. },
  8602. "required": ["type", "properties"]
  8603. },
  8604. "Event.tui.toast.show": {
  8605. "type": "object",
  8606. "properties": {
  8607. "type": {
  8608. "type": "string",
  8609. "const": "tui.toast.show"
  8610. },
  8611. "properties": {
  8612. "type": "object",
  8613. "properties": {
  8614. "title": {
  8615. "type": "string"
  8616. },
  8617. "message": {
  8618. "type": "string"
  8619. },
  8620. "variant": {
  8621. "type": "string",
  8622. "enum": ["info", "success", "warning", "error"]
  8623. },
  8624. "duration": {
  8625. "description": "Duration in milliseconds",
  8626. "type": "integer",
  8627. "exclusiveMinimum": 0,
  8628. "maximum": 9007199254740991
  8629. }
  8630. },
  8631. "required": ["message", "variant"]
  8632. }
  8633. },
  8634. "required": ["type", "properties"]
  8635. },
  8636. "Event.tui.session.select": {
  8637. "type": "object",
  8638. "properties": {
  8639. "type": {
  8640. "type": "string",
  8641. "const": "tui.session.select"
  8642. },
  8643. "properties": {
  8644. "type": "object",
  8645. "properties": {
  8646. "sessionID": {
  8647. "description": "Session ID to navigate to",
  8648. "type": "string",
  8649. "pattern": "^ses.*"
  8650. }
  8651. },
  8652. "required": ["sessionID"]
  8653. }
  8654. },
  8655. "required": ["type", "properties"]
  8656. },
  8657. "Event.mcp.tools.changed": {
  8658. "type": "object",
  8659. "properties": {
  8660. "type": {
  8661. "type": "string",
  8662. "const": "mcp.tools.changed"
  8663. },
  8664. "properties": {
  8665. "type": "object",
  8666. "properties": {
  8667. "server": {
  8668. "type": "string"
  8669. }
  8670. },
  8671. "required": ["server"]
  8672. }
  8673. },
  8674. "required": ["type", "properties"]
  8675. },
  8676. "Event.mcp.browser.open.failed": {
  8677. "type": "object",
  8678. "properties": {
  8679. "type": {
  8680. "type": "string",
  8681. "const": "mcp.browser.open.failed"
  8682. },
  8683. "properties": {
  8684. "type": "object",
  8685. "properties": {
  8686. "mcpName": {
  8687. "type": "string"
  8688. },
  8689. "url": {
  8690. "type": "string"
  8691. }
  8692. },
  8693. "required": ["mcpName", "url"]
  8694. }
  8695. },
  8696. "required": ["type", "properties"]
  8697. },
  8698. "Event.command.executed": {
  8699. "type": "object",
  8700. "properties": {
  8701. "type": {
  8702. "type": "string",
  8703. "const": "command.executed"
  8704. },
  8705. "properties": {
  8706. "type": "object",
  8707. "properties": {
  8708. "name": {
  8709. "type": "string"
  8710. },
  8711. "sessionID": {
  8712. "type": "string",
  8713. "pattern": "^ses.*"
  8714. },
  8715. "arguments": {
  8716. "type": "string"
  8717. },
  8718. "messageID": {
  8719. "type": "string",
  8720. "pattern": "^msg.*"
  8721. }
  8722. },
  8723. "required": ["name", "sessionID", "arguments", "messageID"]
  8724. }
  8725. },
  8726. "required": ["type", "properties"]
  8727. },
  8728. "Event.vcs.branch.updated": {
  8729. "type": "object",
  8730. "properties": {
  8731. "type": {
  8732. "type": "string",
  8733. "const": "vcs.branch.updated"
  8734. },
  8735. "properties": {
  8736. "type": "object",
  8737. "properties": {
  8738. "branch": {
  8739. "type": "string"
  8740. }
  8741. }
  8742. }
  8743. },
  8744. "required": ["type", "properties"]
  8745. },
  8746. "Event.worktree.ready": {
  8747. "type": "object",
  8748. "properties": {
  8749. "type": {
  8750. "type": "string",
  8751. "const": "worktree.ready"
  8752. },
  8753. "properties": {
  8754. "type": "object",
  8755. "properties": {
  8756. "name": {
  8757. "type": "string"
  8758. },
  8759. "branch": {
  8760. "type": "string"
  8761. }
  8762. },
  8763. "required": ["name", "branch"]
  8764. }
  8765. },
  8766. "required": ["type", "properties"]
  8767. },
  8768. "Event.worktree.failed": {
  8769. "type": "object",
  8770. "properties": {
  8771. "type": {
  8772. "type": "string",
  8773. "const": "worktree.failed"
  8774. },
  8775. "properties": {
  8776. "type": "object",
  8777. "properties": {
  8778. "message": {
  8779. "type": "string"
  8780. }
  8781. },
  8782. "required": ["message"]
  8783. }
  8784. },
  8785. "required": ["type", "properties"]
  8786. },
  8787. "Pty": {
  8788. "type": "object",
  8789. "properties": {
  8790. "id": {
  8791. "type": "string",
  8792. "pattern": "^pty.*"
  8793. },
  8794. "title": {
  8795. "type": "string"
  8796. },
  8797. "command": {
  8798. "type": "string"
  8799. },
  8800. "args": {
  8801. "type": "array",
  8802. "items": {
  8803. "type": "string"
  8804. }
  8805. },
  8806. "cwd": {
  8807. "type": "string"
  8808. },
  8809. "status": {
  8810. "type": "string",
  8811. "enum": ["running", "exited"]
  8812. },
  8813. "pid": {
  8814. "type": "integer",
  8815. "exclusiveMinimum": 0,
  8816. "maximum": 9007199254740991
  8817. }
  8818. },
  8819. "required": ["id", "title", "command", "args", "cwd", "status", "pid"]
  8820. },
  8821. "Event.pty.created": {
  8822. "type": "object",
  8823. "properties": {
  8824. "type": {
  8825. "type": "string",
  8826. "const": "pty.created"
  8827. },
  8828. "properties": {
  8829. "type": "object",
  8830. "properties": {
  8831. "info": {
  8832. "$ref": "#/components/schemas/Pty"
  8833. }
  8834. },
  8835. "required": ["info"]
  8836. }
  8837. },
  8838. "required": ["type", "properties"]
  8839. },
  8840. "Event.pty.updated": {
  8841. "type": "object",
  8842. "properties": {
  8843. "type": {
  8844. "type": "string",
  8845. "const": "pty.updated"
  8846. },
  8847. "properties": {
  8848. "type": "object",
  8849. "properties": {
  8850. "info": {
  8851. "$ref": "#/components/schemas/Pty"
  8852. }
  8853. },
  8854. "required": ["info"]
  8855. }
  8856. },
  8857. "required": ["type", "properties"]
  8858. },
  8859. "Event.pty.exited": {
  8860. "type": "object",
  8861. "properties": {
  8862. "type": {
  8863. "type": "string",
  8864. "const": "pty.exited"
  8865. },
  8866. "properties": {
  8867. "type": "object",
  8868. "properties": {
  8869. "id": {
  8870. "type": "string",
  8871. "pattern": "^pty.*"
  8872. },
  8873. "exitCode": {
  8874. "type": "integer",
  8875. "minimum": 0,
  8876. "maximum": 9007199254740991
  8877. }
  8878. },
  8879. "required": ["id", "exitCode"]
  8880. }
  8881. },
  8882. "required": ["type", "properties"]
  8883. },
  8884. "Event.pty.deleted": {
  8885. "type": "object",
  8886. "properties": {
  8887. "type": {
  8888. "type": "string",
  8889. "const": "pty.deleted"
  8890. },
  8891. "properties": {
  8892. "type": "object",
  8893. "properties": {
  8894. "id": {
  8895. "type": "string",
  8896. "pattern": "^pty.*"
  8897. }
  8898. },
  8899. "required": ["id"]
  8900. }
  8901. },
  8902. "required": ["type", "properties"]
  8903. },
  8904. "Event.workspace.ready": {
  8905. "type": "object",
  8906. "properties": {
  8907. "type": {
  8908. "type": "string",
  8909. "const": "workspace.ready"
  8910. },
  8911. "properties": {
  8912. "type": "object",
  8913. "properties": {
  8914. "name": {
  8915. "type": "string"
  8916. }
  8917. },
  8918. "required": ["name"]
  8919. }
  8920. },
  8921. "required": ["type", "properties"]
  8922. },
  8923. "Event.workspace.failed": {
  8924. "type": "object",
  8925. "properties": {
  8926. "type": {
  8927. "type": "string",
  8928. "const": "workspace.failed"
  8929. },
  8930. "properties": {
  8931. "type": "object",
  8932. "properties": {
  8933. "message": {
  8934. "type": "string"
  8935. }
  8936. },
  8937. "required": ["message"]
  8938. }
  8939. },
  8940. "required": ["type", "properties"]
  8941. },
  8942. "Event.workspace.restore": {
  8943. "type": "object",
  8944. "properties": {
  8945. "type": {
  8946. "type": "string",
  8947. "const": "workspace.restore"
  8948. },
  8949. "properties": {
  8950. "type": "object",
  8951. "properties": {
  8952. "workspaceID": {
  8953. "type": "string",
  8954. "pattern": "^wrk.*"
  8955. },
  8956. "sessionID": {
  8957. "type": "string",
  8958. "pattern": "^ses.*"
  8959. },
  8960. "total": {
  8961. "type": "integer",
  8962. "minimum": 0,
  8963. "maximum": 9007199254740991
  8964. },
  8965. "step": {
  8966. "type": "integer",
  8967. "minimum": 0,
  8968. "maximum": 9007199254740991
  8969. }
  8970. },
  8971. "required": ["workspaceID", "sessionID", "total", "step"]
  8972. }
  8973. },
  8974. "required": ["type", "properties"]
  8975. },
  8976. "Event.workspace.status": {
  8977. "type": "object",
  8978. "properties": {
  8979. "type": {
  8980. "type": "string",
  8981. "const": "workspace.status"
  8982. },
  8983. "properties": {
  8984. "type": "object",
  8985. "properties": {
  8986. "workspaceID": {
  8987. "type": "string",
  8988. "pattern": "^wrk.*"
  8989. },
  8990. "status": {
  8991. "type": "string",
  8992. "enum": ["connected", "connecting", "disconnected", "error"]
  8993. }
  8994. },
  8995. "required": ["workspaceID", "status"]
  8996. }
  8997. },
  8998. "required": ["type", "properties"]
  8999. },
  9000. "OutputFormatText": {
  9001. "type": "object",
  9002. "properties": {
  9003. "type": {
  9004. "type": "string",
  9005. "const": "text"
  9006. }
  9007. },
  9008. "required": ["type"]
  9009. },
  9010. "JSONSchema": {
  9011. "type": "object",
  9012. "propertyNames": {
  9013. "type": "string"
  9014. },
  9015. "additionalProperties": {}
  9016. },
  9017. "OutputFormatJsonSchema": {
  9018. "type": "object",
  9019. "properties": {
  9020. "type": {
  9021. "type": "string",
  9022. "const": "json_schema"
  9023. },
  9024. "schema": {
  9025. "$ref": "#/components/schemas/JSONSchema"
  9026. },
  9027. "retryCount": {
  9028. "default": 2,
  9029. "type": "integer",
  9030. "minimum": 0,
  9031. "maximum": 9007199254740991
  9032. }
  9033. },
  9034. "required": ["type", "schema"]
  9035. },
  9036. "OutputFormat": {
  9037. "anyOf": [
  9038. {
  9039. "$ref": "#/components/schemas/OutputFormatText"
  9040. },
  9041. {
  9042. "$ref": "#/components/schemas/OutputFormatJsonSchema"
  9043. }
  9044. ]
  9045. },
  9046. "UserMessage": {
  9047. "type": "object",
  9048. "properties": {
  9049. "id": {
  9050. "type": "string",
  9051. "pattern": "^msg.*"
  9052. },
  9053. "sessionID": {
  9054. "type": "string",
  9055. "pattern": "^ses.*"
  9056. },
  9057. "role": {
  9058. "type": "string",
  9059. "const": "user"
  9060. },
  9061. "time": {
  9062. "type": "object",
  9063. "properties": {
  9064. "created": {
  9065. "type": "integer",
  9066. "minimum": 0,
  9067. "maximum": 9007199254740991
  9068. }
  9069. },
  9070. "required": ["created"]
  9071. },
  9072. "format": {
  9073. "$ref": "#/components/schemas/OutputFormat"
  9074. },
  9075. "summary": {
  9076. "type": "object",
  9077. "properties": {
  9078. "title": {
  9079. "type": "string"
  9080. },
  9081. "body": {
  9082. "type": "string"
  9083. },
  9084. "diffs": {
  9085. "type": "array",
  9086. "items": {
  9087. "$ref": "#/components/schemas/SnapshotFileDiff"
  9088. }
  9089. }
  9090. },
  9091. "required": ["diffs"]
  9092. },
  9093. "agent": {
  9094. "type": "string"
  9095. },
  9096. "model": {
  9097. "type": "object",
  9098. "properties": {
  9099. "providerID": {
  9100. "type": "string"
  9101. },
  9102. "modelID": {
  9103. "type": "string"
  9104. },
  9105. "variant": {
  9106. "type": "string"
  9107. }
  9108. },
  9109. "required": ["providerID", "modelID"]
  9110. },
  9111. "system": {
  9112. "type": "string"
  9113. },
  9114. "tools": {
  9115. "type": "object",
  9116. "propertyNames": {
  9117. "type": "string"
  9118. },
  9119. "additionalProperties": {
  9120. "type": "boolean"
  9121. }
  9122. }
  9123. },
  9124. "required": ["id", "sessionID", "role", "time", "agent", "model"]
  9125. },
  9126. "AssistantMessage": {
  9127. "type": "object",
  9128. "properties": {
  9129. "id": {
  9130. "type": "string",
  9131. "pattern": "^msg.*"
  9132. },
  9133. "sessionID": {
  9134. "type": "string",
  9135. "pattern": "^ses.*"
  9136. },
  9137. "role": {
  9138. "type": "string",
  9139. "const": "assistant"
  9140. },
  9141. "time": {
  9142. "type": "object",
  9143. "properties": {
  9144. "created": {
  9145. "type": "integer",
  9146. "minimum": 0,
  9147. "maximum": 9007199254740991
  9148. },
  9149. "completed": {
  9150. "type": "integer",
  9151. "minimum": 0,
  9152. "maximum": 9007199254740991
  9153. }
  9154. },
  9155. "required": ["created"]
  9156. },
  9157. "error": {
  9158. "anyOf": [
  9159. {
  9160. "$ref": "#/components/schemas/ProviderAuthError"
  9161. },
  9162. {
  9163. "$ref": "#/components/schemas/UnknownError"
  9164. },
  9165. {
  9166. "$ref": "#/components/schemas/MessageOutputLengthError"
  9167. },
  9168. {
  9169. "$ref": "#/components/schemas/MessageAbortedError"
  9170. },
  9171. {
  9172. "$ref": "#/components/schemas/StructuredOutputError"
  9173. },
  9174. {
  9175. "$ref": "#/components/schemas/ContextOverflowError"
  9176. },
  9177. {
  9178. "$ref": "#/components/schemas/APIError"
  9179. }
  9180. ]
  9181. },
  9182. "parentID": {
  9183. "type": "string",
  9184. "pattern": "^msg.*"
  9185. },
  9186. "modelID": {
  9187. "type": "string"
  9188. },
  9189. "providerID": {
  9190. "type": "string"
  9191. },
  9192. "mode": {
  9193. "type": "string"
  9194. },
  9195. "agent": {
  9196. "type": "string"
  9197. },
  9198. "path": {
  9199. "type": "object",
  9200. "properties": {
  9201. "cwd": {
  9202. "type": "string"
  9203. },
  9204. "root": {
  9205. "type": "string"
  9206. }
  9207. },
  9208. "required": ["cwd", "root"]
  9209. },
  9210. "summary": {
  9211. "type": "boolean"
  9212. },
  9213. "cost": {
  9214. "type": "number"
  9215. },
  9216. "tokens": {
  9217. "type": "object",
  9218. "properties": {
  9219. "total": {
  9220. "type": "integer",
  9221. "minimum": 0,
  9222. "maximum": 9007199254740991
  9223. },
  9224. "input": {
  9225. "type": "integer",
  9226. "minimum": 0,
  9227. "maximum": 9007199254740991
  9228. },
  9229. "output": {
  9230. "type": "integer",
  9231. "minimum": 0,
  9232. "maximum": 9007199254740991
  9233. },
  9234. "reasoning": {
  9235. "type": "integer",
  9236. "minimum": 0,
  9237. "maximum": 9007199254740991
  9238. },
  9239. "cache": {
  9240. "type": "object",
  9241. "properties": {
  9242. "read": {
  9243. "type": "integer",
  9244. "minimum": 0,
  9245. "maximum": 9007199254740991
  9246. },
  9247. "write": {
  9248. "type": "integer",
  9249. "minimum": 0,
  9250. "maximum": 9007199254740991
  9251. }
  9252. },
  9253. "required": ["read", "write"]
  9254. }
  9255. },
  9256. "required": ["input", "output", "reasoning", "cache"]
  9257. },
  9258. "structured": {},
  9259. "variant": {
  9260. "type": "string"
  9261. },
  9262. "finish": {
  9263. "type": "string"
  9264. }
  9265. },
  9266. "required": [
  9267. "id",
  9268. "sessionID",
  9269. "role",
  9270. "time",
  9271. "parentID",
  9272. "modelID",
  9273. "providerID",
  9274. "mode",
  9275. "agent",
  9276. "path",
  9277. "cost",
  9278. "tokens"
  9279. ]
  9280. },
  9281. "Message": {
  9282. "anyOf": [
  9283. {
  9284. "$ref": "#/components/schemas/UserMessage"
  9285. },
  9286. {
  9287. "$ref": "#/components/schemas/AssistantMessage"
  9288. }
  9289. ]
  9290. },
  9291. "Event.message.updated": {
  9292. "type": "object",
  9293. "properties": {
  9294. "type": {
  9295. "type": "string",
  9296. "const": "message.updated"
  9297. },
  9298. "properties": {
  9299. "type": "object",
  9300. "properties": {
  9301. "sessionID": {
  9302. "type": "string",
  9303. "pattern": "^ses.*"
  9304. },
  9305. "info": {
  9306. "$ref": "#/components/schemas/Message"
  9307. }
  9308. },
  9309. "required": ["sessionID", "info"]
  9310. }
  9311. },
  9312. "required": ["type", "properties"]
  9313. },
  9314. "Event.message.removed": {
  9315. "type": "object",
  9316. "properties": {
  9317. "type": {
  9318. "type": "string",
  9319. "const": "message.removed"
  9320. },
  9321. "properties": {
  9322. "type": "object",
  9323. "properties": {
  9324. "sessionID": {
  9325. "type": "string",
  9326. "pattern": "^ses.*"
  9327. },
  9328. "messageID": {
  9329. "type": "string",
  9330. "pattern": "^msg.*"
  9331. }
  9332. },
  9333. "required": ["sessionID", "messageID"]
  9334. }
  9335. },
  9336. "required": ["type", "properties"]
  9337. },
  9338. "TextPart": {
  9339. "type": "object",
  9340. "properties": {
  9341. "id": {
  9342. "type": "string",
  9343. "pattern": "^prt.*"
  9344. },
  9345. "sessionID": {
  9346. "type": "string",
  9347. "pattern": "^ses.*"
  9348. },
  9349. "messageID": {
  9350. "type": "string",
  9351. "pattern": "^msg.*"
  9352. },
  9353. "type": {
  9354. "type": "string",
  9355. "const": "text"
  9356. },
  9357. "text": {
  9358. "type": "string"
  9359. },
  9360. "synthetic": {
  9361. "type": "boolean"
  9362. },
  9363. "ignored": {
  9364. "type": "boolean"
  9365. },
  9366. "time": {
  9367. "type": "object",
  9368. "properties": {
  9369. "start": {
  9370. "type": "integer",
  9371. "minimum": 0,
  9372. "maximum": 9007199254740991
  9373. },
  9374. "end": {
  9375. "type": "integer",
  9376. "minimum": 0,
  9377. "maximum": 9007199254740991
  9378. }
  9379. },
  9380. "required": ["start"]
  9381. },
  9382. "metadata": {
  9383. "type": "object",
  9384. "propertyNames": {
  9385. "type": "string"
  9386. },
  9387. "additionalProperties": {}
  9388. }
  9389. },
  9390. "required": ["id", "sessionID", "messageID", "type", "text"]
  9391. },
  9392. "SubtaskPart": {
  9393. "type": "object",
  9394. "properties": {
  9395. "id": {
  9396. "type": "string",
  9397. "pattern": "^prt.*"
  9398. },
  9399. "sessionID": {
  9400. "type": "string",
  9401. "pattern": "^ses.*"
  9402. },
  9403. "messageID": {
  9404. "type": "string",
  9405. "pattern": "^msg.*"
  9406. },
  9407. "type": {
  9408. "type": "string",
  9409. "const": "subtask"
  9410. },
  9411. "prompt": {
  9412. "type": "string"
  9413. },
  9414. "description": {
  9415. "type": "string"
  9416. },
  9417. "agent": {
  9418. "type": "string"
  9419. },
  9420. "model": {
  9421. "type": "object",
  9422. "properties": {
  9423. "providerID": {
  9424. "type": "string"
  9425. },
  9426. "modelID": {
  9427. "type": "string"
  9428. }
  9429. },
  9430. "required": ["providerID", "modelID"]
  9431. },
  9432. "command": {
  9433. "type": "string"
  9434. }
  9435. },
  9436. "required": ["id", "sessionID", "messageID", "type", "prompt", "description", "agent"]
  9437. },
  9438. "ReasoningPart": {
  9439. "type": "object",
  9440. "properties": {
  9441. "id": {
  9442. "type": "string",
  9443. "pattern": "^prt.*"
  9444. },
  9445. "sessionID": {
  9446. "type": "string",
  9447. "pattern": "^ses.*"
  9448. },
  9449. "messageID": {
  9450. "type": "string",
  9451. "pattern": "^msg.*"
  9452. },
  9453. "type": {
  9454. "type": "string",
  9455. "const": "reasoning"
  9456. },
  9457. "text": {
  9458. "type": "string"
  9459. },
  9460. "metadata": {
  9461. "type": "object",
  9462. "propertyNames": {
  9463. "type": "string"
  9464. },
  9465. "additionalProperties": {}
  9466. },
  9467. "time": {
  9468. "type": "object",
  9469. "properties": {
  9470. "start": {
  9471. "type": "integer",
  9472. "minimum": 0,
  9473. "maximum": 9007199254740991
  9474. },
  9475. "end": {
  9476. "type": "integer",
  9477. "minimum": 0,
  9478. "maximum": 9007199254740991
  9479. }
  9480. },
  9481. "required": ["start"]
  9482. }
  9483. },
  9484. "required": ["id", "sessionID", "messageID", "type", "text", "time"]
  9485. },
  9486. "FilePartSourceText": {
  9487. "type": "object",
  9488. "properties": {
  9489. "value": {
  9490. "type": "string"
  9491. },
  9492. "start": {
  9493. "type": "integer",
  9494. "minimum": 0,
  9495. "maximum": 9007199254740991
  9496. },
  9497. "end": {
  9498. "type": "integer",
  9499. "minimum": 0,
  9500. "maximum": 9007199254740991
  9501. }
  9502. },
  9503. "required": ["value", "start", "end"]
  9504. },
  9505. "FileSource": {
  9506. "type": "object",
  9507. "properties": {
  9508. "text": {
  9509. "$ref": "#/components/schemas/FilePartSourceText"
  9510. },
  9511. "type": {
  9512. "type": "string",
  9513. "const": "file"
  9514. },
  9515. "path": {
  9516. "type": "string"
  9517. }
  9518. },
  9519. "required": ["text", "type", "path"]
  9520. },
  9521. "Range": {
  9522. "type": "object",
  9523. "properties": {
  9524. "start": {
  9525. "type": "object",
  9526. "properties": {
  9527. "line": {
  9528. "type": "integer",
  9529. "minimum": 0,
  9530. "maximum": 9007199254740991
  9531. },
  9532. "character": {
  9533. "type": "integer",
  9534. "minimum": 0,
  9535. "maximum": 9007199254740991
  9536. }
  9537. },
  9538. "required": ["line", "character"]
  9539. },
  9540. "end": {
  9541. "type": "object",
  9542. "properties": {
  9543. "line": {
  9544. "type": "integer",
  9545. "minimum": 0,
  9546. "maximum": 9007199254740991
  9547. },
  9548. "character": {
  9549. "type": "integer",
  9550. "minimum": 0,
  9551. "maximum": 9007199254740991
  9552. }
  9553. },
  9554. "required": ["line", "character"]
  9555. }
  9556. },
  9557. "required": ["start", "end"]
  9558. },
  9559. "SymbolSource": {
  9560. "type": "object",
  9561. "properties": {
  9562. "text": {
  9563. "$ref": "#/components/schemas/FilePartSourceText"
  9564. },
  9565. "type": {
  9566. "type": "string",
  9567. "const": "symbol"
  9568. },
  9569. "path": {
  9570. "type": "string"
  9571. },
  9572. "range": {
  9573. "$ref": "#/components/schemas/Range"
  9574. },
  9575. "name": {
  9576. "type": "string"
  9577. },
  9578. "kind": {
  9579. "type": "integer",
  9580. "minimum": 0,
  9581. "maximum": 9007199254740991
  9582. }
  9583. },
  9584. "required": ["text", "type", "path", "range", "name", "kind"]
  9585. },
  9586. "ResourceSource": {
  9587. "type": "object",
  9588. "properties": {
  9589. "text": {
  9590. "$ref": "#/components/schemas/FilePartSourceText"
  9591. },
  9592. "type": {
  9593. "type": "string",
  9594. "const": "resource"
  9595. },
  9596. "clientName": {
  9597. "type": "string"
  9598. },
  9599. "uri": {
  9600. "type": "string"
  9601. }
  9602. },
  9603. "required": ["text", "type", "clientName", "uri"]
  9604. },
  9605. "FilePartSource": {
  9606. "anyOf": [
  9607. {
  9608. "$ref": "#/components/schemas/FileSource"
  9609. },
  9610. {
  9611. "$ref": "#/components/schemas/SymbolSource"
  9612. },
  9613. {
  9614. "$ref": "#/components/schemas/ResourceSource"
  9615. }
  9616. ]
  9617. },
  9618. "FilePart": {
  9619. "type": "object",
  9620. "properties": {
  9621. "id": {
  9622. "type": "string",
  9623. "pattern": "^prt.*"
  9624. },
  9625. "sessionID": {
  9626. "type": "string",
  9627. "pattern": "^ses.*"
  9628. },
  9629. "messageID": {
  9630. "type": "string",
  9631. "pattern": "^msg.*"
  9632. },
  9633. "type": {
  9634. "type": "string",
  9635. "const": "file"
  9636. },
  9637. "mime": {
  9638. "type": "string"
  9639. },
  9640. "filename": {
  9641. "type": "string"
  9642. },
  9643. "url": {
  9644. "type": "string"
  9645. },
  9646. "source": {
  9647. "$ref": "#/components/schemas/FilePartSource"
  9648. }
  9649. },
  9650. "required": ["id", "sessionID", "messageID", "type", "mime", "url"]
  9651. },
  9652. "ToolStatePending": {
  9653. "type": "object",
  9654. "properties": {
  9655. "status": {
  9656. "type": "string",
  9657. "const": "pending"
  9658. },
  9659. "input": {
  9660. "type": "object",
  9661. "propertyNames": {
  9662. "type": "string"
  9663. },
  9664. "additionalProperties": {}
  9665. },
  9666. "raw": {
  9667. "type": "string"
  9668. }
  9669. },
  9670. "required": ["status", "input", "raw"]
  9671. },
  9672. "ToolStateRunning": {
  9673. "type": "object",
  9674. "properties": {
  9675. "status": {
  9676. "type": "string",
  9677. "const": "running"
  9678. },
  9679. "input": {
  9680. "type": "object",
  9681. "propertyNames": {
  9682. "type": "string"
  9683. },
  9684. "additionalProperties": {}
  9685. },
  9686. "title": {
  9687. "type": "string"
  9688. },
  9689. "metadata": {
  9690. "type": "object",
  9691. "propertyNames": {
  9692. "type": "string"
  9693. },
  9694. "additionalProperties": {}
  9695. },
  9696. "time": {
  9697. "type": "object",
  9698. "properties": {
  9699. "start": {
  9700. "type": "integer",
  9701. "minimum": 0,
  9702. "maximum": 9007199254740991
  9703. }
  9704. },
  9705. "required": ["start"]
  9706. }
  9707. },
  9708. "required": ["status", "input", "time"]
  9709. },
  9710. "ToolStateCompleted": {
  9711. "type": "object",
  9712. "properties": {
  9713. "status": {
  9714. "type": "string",
  9715. "const": "completed"
  9716. },
  9717. "input": {
  9718. "type": "object",
  9719. "propertyNames": {
  9720. "type": "string"
  9721. },
  9722. "additionalProperties": {}
  9723. },
  9724. "output": {
  9725. "type": "string"
  9726. },
  9727. "title": {
  9728. "type": "string"
  9729. },
  9730. "metadata": {
  9731. "type": "object",
  9732. "propertyNames": {
  9733. "type": "string"
  9734. },
  9735. "additionalProperties": {}
  9736. },
  9737. "time": {
  9738. "type": "object",
  9739. "properties": {
  9740. "start": {
  9741. "type": "integer",
  9742. "minimum": 0,
  9743. "maximum": 9007199254740991
  9744. },
  9745. "end": {
  9746. "type": "integer",
  9747. "minimum": 0,
  9748. "maximum": 9007199254740991
  9749. },
  9750. "compacted": {
  9751. "type": "integer",
  9752. "minimum": 0,
  9753. "maximum": 9007199254740991
  9754. }
  9755. },
  9756. "required": ["start", "end"]
  9757. },
  9758. "attachments": {
  9759. "type": "array",
  9760. "items": {
  9761. "$ref": "#/components/schemas/FilePart"
  9762. }
  9763. }
  9764. },
  9765. "required": ["status", "input", "output", "title", "metadata", "time"]
  9766. },
  9767. "ToolStateError": {
  9768. "type": "object",
  9769. "properties": {
  9770. "status": {
  9771. "type": "string",
  9772. "const": "error"
  9773. },
  9774. "input": {
  9775. "type": "object",
  9776. "propertyNames": {
  9777. "type": "string"
  9778. },
  9779. "additionalProperties": {}
  9780. },
  9781. "error": {
  9782. "type": "string"
  9783. },
  9784. "metadata": {
  9785. "type": "object",
  9786. "propertyNames": {
  9787. "type": "string"
  9788. },
  9789. "additionalProperties": {}
  9790. },
  9791. "time": {
  9792. "type": "object",
  9793. "properties": {
  9794. "start": {
  9795. "type": "integer",
  9796. "minimum": 0,
  9797. "maximum": 9007199254740991
  9798. },
  9799. "end": {
  9800. "type": "integer",
  9801. "minimum": 0,
  9802. "maximum": 9007199254740991
  9803. }
  9804. },
  9805. "required": ["start", "end"]
  9806. }
  9807. },
  9808. "required": ["status", "input", "error", "time"]
  9809. },
  9810. "ToolState": {
  9811. "anyOf": [
  9812. {
  9813. "$ref": "#/components/schemas/ToolStatePending"
  9814. },
  9815. {
  9816. "$ref": "#/components/schemas/ToolStateRunning"
  9817. },
  9818. {
  9819. "$ref": "#/components/schemas/ToolStateCompleted"
  9820. },
  9821. {
  9822. "$ref": "#/components/schemas/ToolStateError"
  9823. }
  9824. ]
  9825. },
  9826. "ToolPart": {
  9827. "type": "object",
  9828. "properties": {
  9829. "id": {
  9830. "type": "string",
  9831. "pattern": "^prt.*"
  9832. },
  9833. "sessionID": {
  9834. "type": "string",
  9835. "pattern": "^ses.*"
  9836. },
  9837. "messageID": {
  9838. "type": "string",
  9839. "pattern": "^msg.*"
  9840. },
  9841. "type": {
  9842. "type": "string",
  9843. "const": "tool"
  9844. },
  9845. "callID": {
  9846. "type": "string"
  9847. },
  9848. "tool": {
  9849. "type": "string"
  9850. },
  9851. "state": {
  9852. "$ref": "#/components/schemas/ToolState"
  9853. },
  9854. "metadata": {
  9855. "type": "object",
  9856. "propertyNames": {
  9857. "type": "string"
  9858. },
  9859. "additionalProperties": {}
  9860. }
  9861. },
  9862. "required": ["id", "sessionID", "messageID", "type", "callID", "tool", "state"]
  9863. },
  9864. "StepStartPart": {
  9865. "type": "object",
  9866. "properties": {
  9867. "id": {
  9868. "type": "string",
  9869. "pattern": "^prt.*"
  9870. },
  9871. "sessionID": {
  9872. "type": "string",
  9873. "pattern": "^ses.*"
  9874. },
  9875. "messageID": {
  9876. "type": "string",
  9877. "pattern": "^msg.*"
  9878. },
  9879. "type": {
  9880. "type": "string",
  9881. "const": "step-start"
  9882. },
  9883. "snapshot": {
  9884. "type": "string"
  9885. }
  9886. },
  9887. "required": ["id", "sessionID", "messageID", "type"]
  9888. },
  9889. "StepFinishPart": {
  9890. "type": "object",
  9891. "properties": {
  9892. "id": {
  9893. "type": "string",
  9894. "pattern": "^prt.*"
  9895. },
  9896. "sessionID": {
  9897. "type": "string",
  9898. "pattern": "^ses.*"
  9899. },
  9900. "messageID": {
  9901. "type": "string",
  9902. "pattern": "^msg.*"
  9903. },
  9904. "type": {
  9905. "type": "string",
  9906. "const": "step-finish"
  9907. },
  9908. "reason": {
  9909. "type": "string"
  9910. },
  9911. "snapshot": {
  9912. "type": "string"
  9913. },
  9914. "cost": {
  9915. "type": "number"
  9916. },
  9917. "tokens": {
  9918. "type": "object",
  9919. "properties": {
  9920. "total": {
  9921. "type": "integer",
  9922. "minimum": 0,
  9923. "maximum": 9007199254740991
  9924. },
  9925. "input": {
  9926. "type": "integer",
  9927. "minimum": 0,
  9928. "maximum": 9007199254740991
  9929. },
  9930. "output": {
  9931. "type": "integer",
  9932. "minimum": 0,
  9933. "maximum": 9007199254740991
  9934. },
  9935. "reasoning": {
  9936. "type": "integer",
  9937. "minimum": 0,
  9938. "maximum": 9007199254740991
  9939. },
  9940. "cache": {
  9941. "type": "object",
  9942. "properties": {
  9943. "read": {
  9944. "type": "integer",
  9945. "minimum": 0,
  9946. "maximum": 9007199254740991
  9947. },
  9948. "write": {
  9949. "type": "integer",
  9950. "minimum": 0,
  9951. "maximum": 9007199254740991
  9952. }
  9953. },
  9954. "required": ["read", "write"]
  9955. }
  9956. },
  9957. "required": ["input", "output", "reasoning", "cache"]
  9958. }
  9959. },
  9960. "required": ["id", "sessionID", "messageID", "type", "reason", "cost", "tokens"]
  9961. },
  9962. "SnapshotPart": {
  9963. "type": "object",
  9964. "properties": {
  9965. "id": {
  9966. "type": "string",
  9967. "pattern": "^prt.*"
  9968. },
  9969. "sessionID": {
  9970. "type": "string",
  9971. "pattern": "^ses.*"
  9972. },
  9973. "messageID": {
  9974. "type": "string",
  9975. "pattern": "^msg.*"
  9976. },
  9977. "type": {
  9978. "type": "string",
  9979. "const": "snapshot"
  9980. },
  9981. "snapshot": {
  9982. "type": "string"
  9983. }
  9984. },
  9985. "required": ["id", "sessionID", "messageID", "type", "snapshot"]
  9986. },
  9987. "PatchPart": {
  9988. "type": "object",
  9989. "properties": {
  9990. "id": {
  9991. "type": "string",
  9992. "pattern": "^prt.*"
  9993. },
  9994. "sessionID": {
  9995. "type": "string",
  9996. "pattern": "^ses.*"
  9997. },
  9998. "messageID": {
  9999. "type": "string",
  10000. "pattern": "^msg.*"
  10001. },
  10002. "type": {
  10003. "type": "string",
  10004. "const": "patch"
  10005. },
  10006. "hash": {
  10007. "type": "string"
  10008. },
  10009. "files": {
  10010. "type": "array",
  10011. "items": {
  10012. "type": "string"
  10013. }
  10014. }
  10015. },
  10016. "required": ["id", "sessionID", "messageID", "type", "hash", "files"]
  10017. },
  10018. "AgentPart": {
  10019. "type": "object",
  10020. "properties": {
  10021. "id": {
  10022. "type": "string",
  10023. "pattern": "^prt.*"
  10024. },
  10025. "sessionID": {
  10026. "type": "string",
  10027. "pattern": "^ses.*"
  10028. },
  10029. "messageID": {
  10030. "type": "string",
  10031. "pattern": "^msg.*"
  10032. },
  10033. "type": {
  10034. "type": "string",
  10035. "const": "agent"
  10036. },
  10037. "name": {
  10038. "type": "string"
  10039. },
  10040. "source": {
  10041. "type": "object",
  10042. "properties": {
  10043. "value": {
  10044. "type": "string"
  10045. },
  10046. "start": {
  10047. "type": "integer",
  10048. "minimum": 0,
  10049. "maximum": 9007199254740991
  10050. },
  10051. "end": {
  10052. "type": "integer",
  10053. "minimum": 0,
  10054. "maximum": 9007199254740991
  10055. }
  10056. },
  10057. "required": ["value", "start", "end"]
  10058. }
  10059. },
  10060. "required": ["id", "sessionID", "messageID", "type", "name"]
  10061. },
  10062. "RetryPart": {
  10063. "type": "object",
  10064. "properties": {
  10065. "id": {
  10066. "type": "string",
  10067. "pattern": "^prt.*"
  10068. },
  10069. "sessionID": {
  10070. "type": "string",
  10071. "pattern": "^ses.*"
  10072. },
  10073. "messageID": {
  10074. "type": "string",
  10075. "pattern": "^msg.*"
  10076. },
  10077. "type": {
  10078. "type": "string",
  10079. "const": "retry"
  10080. },
  10081. "attempt": {
  10082. "type": "integer",
  10083. "minimum": 0,
  10084. "maximum": 9007199254740991
  10085. },
  10086. "error": {
  10087. "$ref": "#/components/schemas/APIError"
  10088. },
  10089. "time": {
  10090. "type": "object",
  10091. "properties": {
  10092. "created": {
  10093. "type": "integer",
  10094. "minimum": 0,
  10095. "maximum": 9007199254740991
  10096. }
  10097. },
  10098. "required": ["created"]
  10099. }
  10100. },
  10101. "required": ["id", "sessionID", "messageID", "type", "attempt", "error", "time"]
  10102. },
  10103. "CompactionPart": {
  10104. "type": "object",
  10105. "properties": {
  10106. "id": {
  10107. "type": "string",
  10108. "pattern": "^prt.*"
  10109. },
  10110. "sessionID": {
  10111. "type": "string",
  10112. "pattern": "^ses.*"
  10113. },
  10114. "messageID": {
  10115. "type": "string",
  10116. "pattern": "^msg.*"
  10117. },
  10118. "type": {
  10119. "type": "string",
  10120. "const": "compaction"
  10121. },
  10122. "auto": {
  10123. "type": "boolean"
  10124. },
  10125. "overflow": {
  10126. "type": "boolean"
  10127. },
  10128. "tail_start_id": {
  10129. "type": "string",
  10130. "pattern": "^msg.*"
  10131. }
  10132. },
  10133. "required": ["id", "sessionID", "messageID", "type", "auto"]
  10134. },
  10135. "Part": {
  10136. "anyOf": [
  10137. {
  10138. "$ref": "#/components/schemas/TextPart"
  10139. },
  10140. {
  10141. "$ref": "#/components/schemas/SubtaskPart"
  10142. },
  10143. {
  10144. "$ref": "#/components/schemas/ReasoningPart"
  10145. },
  10146. {
  10147. "$ref": "#/components/schemas/FilePart"
  10148. },
  10149. {
  10150. "$ref": "#/components/schemas/ToolPart"
  10151. },
  10152. {
  10153. "$ref": "#/components/schemas/StepStartPart"
  10154. },
  10155. {
  10156. "$ref": "#/components/schemas/StepFinishPart"
  10157. },
  10158. {
  10159. "$ref": "#/components/schemas/SnapshotPart"
  10160. },
  10161. {
  10162. "$ref": "#/components/schemas/PatchPart"
  10163. },
  10164. {
  10165. "$ref": "#/components/schemas/AgentPart"
  10166. },
  10167. {
  10168. "$ref": "#/components/schemas/RetryPart"
  10169. },
  10170. {
  10171. "$ref": "#/components/schemas/CompactionPart"
  10172. }
  10173. ]
  10174. },
  10175. "Event.message.part.updated": {
  10176. "type": "object",
  10177. "properties": {
  10178. "type": {
  10179. "type": "string",
  10180. "const": "message.part.updated"
  10181. },
  10182. "properties": {
  10183. "type": "object",
  10184. "properties": {
  10185. "sessionID": {
  10186. "type": "string",
  10187. "pattern": "^ses.*"
  10188. },
  10189. "part": {
  10190. "$ref": "#/components/schemas/Part"
  10191. },
  10192. "time": {
  10193. "type": "integer",
  10194. "minimum": 0,
  10195. "maximum": 9007199254740991
  10196. }
  10197. },
  10198. "required": ["sessionID", "part", "time"]
  10199. }
  10200. },
  10201. "required": ["type", "properties"]
  10202. },
  10203. "Event.message.part.removed": {
  10204. "type": "object",
  10205. "properties": {
  10206. "type": {
  10207. "type": "string",
  10208. "const": "message.part.removed"
  10209. },
  10210. "properties": {
  10211. "type": "object",
  10212. "properties": {
  10213. "sessionID": {
  10214. "type": "string",
  10215. "pattern": "^ses.*"
  10216. },
  10217. "messageID": {
  10218. "type": "string",
  10219. "pattern": "^msg.*"
  10220. },
  10221. "partID": {
  10222. "type": "string",
  10223. "pattern": "^prt.*"
  10224. }
  10225. },
  10226. "required": ["sessionID", "messageID", "partID"]
  10227. }
  10228. },
  10229. "required": ["type", "properties"]
  10230. },
  10231. "PermissionAction": {
  10232. "type": "string",
  10233. "enum": ["allow", "deny", "ask"]
  10234. },
  10235. "PermissionRule": {
  10236. "type": "object",
  10237. "properties": {
  10238. "permission": {
  10239. "type": "string"
  10240. },
  10241. "pattern": {
  10242. "type": "string"
  10243. },
  10244. "action": {
  10245. "$ref": "#/components/schemas/PermissionAction"
  10246. }
  10247. },
  10248. "required": ["permission", "pattern", "action"]
  10249. },
  10250. "PermissionRuleset": {
  10251. "type": "array",
  10252. "items": {
  10253. "$ref": "#/components/schemas/PermissionRule"
  10254. }
  10255. },
  10256. "Session": {
  10257. "type": "object",
  10258. "properties": {
  10259. "id": {
  10260. "type": "string",
  10261. "pattern": "^ses.*"
  10262. },
  10263. "slug": {
  10264. "type": "string"
  10265. },
  10266. "projectID": {
  10267. "type": "string"
  10268. },
  10269. "workspaceID": {
  10270. "type": "string",
  10271. "pattern": "^wrk.*"
  10272. },
  10273. "directory": {
  10274. "type": "string"
  10275. },
  10276. "path": {
  10277. "type": "string"
  10278. },
  10279. "parentID": {
  10280. "type": "string",
  10281. "pattern": "^ses.*"
  10282. },
  10283. "summary": {
  10284. "type": "object",
  10285. "properties": {
  10286. "additions": {
  10287. "type": "integer",
  10288. "minimum": 0,
  10289. "maximum": 9007199254740991
  10290. },
  10291. "deletions": {
  10292. "type": "integer",
  10293. "minimum": 0,
  10294. "maximum": 9007199254740991
  10295. },
  10296. "files": {
  10297. "type": "integer",
  10298. "minimum": 0,
  10299. "maximum": 9007199254740991
  10300. },
  10301. "diffs": {
  10302. "type": "array",
  10303. "items": {
  10304. "$ref": "#/components/schemas/SnapshotFileDiff"
  10305. }
  10306. }
  10307. },
  10308. "required": ["additions", "deletions", "files"]
  10309. },
  10310. "share": {
  10311. "type": "object",
  10312. "properties": {
  10313. "url": {
  10314. "type": "string"
  10315. }
  10316. },
  10317. "required": ["url"]
  10318. },
  10319. "title": {
  10320. "type": "string"
  10321. },
  10322. "version": {
  10323. "type": "string"
  10324. },
  10325. "time": {
  10326. "type": "object",
  10327. "properties": {
  10328. "created": {
  10329. "type": "integer",
  10330. "minimum": 0,
  10331. "maximum": 9007199254740991
  10332. },
  10333. "updated": {
  10334. "type": "integer",
  10335. "minimum": 0,
  10336. "maximum": 9007199254740991
  10337. },
  10338. "compacting": {
  10339. "type": "integer",
  10340. "minimum": 0,
  10341. "maximum": 9007199254740991
  10342. },
  10343. "archived": {
  10344. "type": "integer",
  10345. "minimum": 0,
  10346. "maximum": 9007199254740991
  10347. }
  10348. },
  10349. "required": ["created", "updated"]
  10350. },
  10351. "permission": {
  10352. "$ref": "#/components/schemas/PermissionRuleset"
  10353. },
  10354. "revert": {
  10355. "type": "object",
  10356. "properties": {
  10357. "messageID": {
  10358. "type": "string",
  10359. "pattern": "^msg.*"
  10360. },
  10361. "partID": {
  10362. "type": "string",
  10363. "pattern": "^prt.*"
  10364. },
  10365. "snapshot": {
  10366. "type": "string"
  10367. },
  10368. "diff": {
  10369. "type": "string"
  10370. }
  10371. },
  10372. "required": ["messageID"]
  10373. }
  10374. },
  10375. "required": ["id", "slug", "projectID", "directory", "title", "version", "time"]
  10376. },
  10377. "Event.session.created": {
  10378. "type": "object",
  10379. "properties": {
  10380. "type": {
  10381. "type": "string",
  10382. "const": "session.created"
  10383. },
  10384. "properties": {
  10385. "type": "object",
  10386. "properties": {
  10387. "sessionID": {
  10388. "type": "string",
  10389. "pattern": "^ses.*"
  10390. },
  10391. "info": {
  10392. "$ref": "#/components/schemas/Session"
  10393. }
  10394. },
  10395. "required": ["sessionID", "info"]
  10396. }
  10397. },
  10398. "required": ["type", "properties"]
  10399. },
  10400. "Event.session.updated": {
  10401. "type": "object",
  10402. "properties": {
  10403. "type": {
  10404. "type": "string",
  10405. "const": "session.updated"
  10406. },
  10407. "properties": {
  10408. "type": "object",
  10409. "properties": {
  10410. "sessionID": {
  10411. "type": "string",
  10412. "pattern": "^ses.*"
  10413. },
  10414. "info": {
  10415. "$ref": "#/components/schemas/Session"
  10416. }
  10417. },
  10418. "required": ["sessionID", "info"]
  10419. }
  10420. },
  10421. "required": ["type", "properties"]
  10422. },
  10423. "Event.session.deleted": {
  10424. "type": "object",
  10425. "properties": {
  10426. "type": {
  10427. "type": "string",
  10428. "const": "session.deleted"
  10429. },
  10430. "properties": {
  10431. "type": "object",
  10432. "properties": {
  10433. "sessionID": {
  10434. "type": "string",
  10435. "pattern": "^ses.*"
  10436. },
  10437. "info": {
  10438. "$ref": "#/components/schemas/Session"
  10439. }
  10440. },
  10441. "required": ["sessionID", "info"]
  10442. }
  10443. },
  10444. "required": ["type", "properties"]
  10445. },
  10446. "SyncEvent.message.updated": {
  10447. "type": "object",
  10448. "properties": {
  10449. "type": {
  10450. "type": "string",
  10451. "const": "sync"
  10452. },
  10453. "name": {
  10454. "type": "string",
  10455. "const": "message.updated.1"
  10456. },
  10457. "id": {
  10458. "type": "string"
  10459. },
  10460. "seq": {
  10461. "type": "number"
  10462. },
  10463. "aggregateID": {
  10464. "type": "string",
  10465. "const": "sessionID"
  10466. },
  10467. "data": {
  10468. "type": "object",
  10469. "properties": {
  10470. "sessionID": {
  10471. "type": "string",
  10472. "pattern": "^ses.*"
  10473. },
  10474. "info": {
  10475. "$ref": "#/components/schemas/Message"
  10476. }
  10477. },
  10478. "required": ["sessionID", "info"]
  10479. }
  10480. },
  10481. "required": ["type", "name", "id", "seq", "aggregateID", "data"]
  10482. },
  10483. "SyncEvent.message.removed": {
  10484. "type": "object",
  10485. "properties": {
  10486. "type": {
  10487. "type": "string",
  10488. "const": "sync"
  10489. },
  10490. "name": {
  10491. "type": "string",
  10492. "const": "message.removed.1"
  10493. },
  10494. "id": {
  10495. "type": "string"
  10496. },
  10497. "seq": {
  10498. "type": "number"
  10499. },
  10500. "aggregateID": {
  10501. "type": "string",
  10502. "const": "sessionID"
  10503. },
  10504. "data": {
  10505. "type": "object",
  10506. "properties": {
  10507. "sessionID": {
  10508. "type": "string",
  10509. "pattern": "^ses.*"
  10510. },
  10511. "messageID": {
  10512. "type": "string",
  10513. "pattern": "^msg.*"
  10514. }
  10515. },
  10516. "required": ["sessionID", "messageID"]
  10517. }
  10518. },
  10519. "required": ["type", "name", "id", "seq", "aggregateID", "data"]
  10520. },
  10521. "SyncEvent.message.part.updated": {
  10522. "type": "object",
  10523. "properties": {
  10524. "type": {
  10525. "type": "string",
  10526. "const": "sync"
  10527. },
  10528. "name": {
  10529. "type": "string",
  10530. "const": "message.part.updated.1"
  10531. },
  10532. "id": {
  10533. "type": "string"
  10534. },
  10535. "seq": {
  10536. "type": "number"
  10537. },
  10538. "aggregateID": {
  10539. "type": "string",
  10540. "const": "sessionID"
  10541. },
  10542. "data": {
  10543. "type": "object",
  10544. "properties": {
  10545. "sessionID": {
  10546. "type": "string",
  10547. "pattern": "^ses.*"
  10548. },
  10549. "part": {
  10550. "$ref": "#/components/schemas/Part"
  10551. },
  10552. "time": {
  10553. "type": "integer",
  10554. "minimum": 0,
  10555. "maximum": 9007199254740991
  10556. }
  10557. },
  10558. "required": ["sessionID", "part", "time"]
  10559. }
  10560. },
  10561. "required": ["type", "name", "id", "seq", "aggregateID", "data"]
  10562. },
  10563. "SyncEvent.message.part.removed": {
  10564. "type": "object",
  10565. "properties": {
  10566. "type": {
  10567. "type": "string",
  10568. "const": "sync"
  10569. },
  10570. "name": {
  10571. "type": "string",
  10572. "const": "message.part.removed.1"
  10573. },
  10574. "id": {
  10575. "type": "string"
  10576. },
  10577. "seq": {
  10578. "type": "number"
  10579. },
  10580. "aggregateID": {
  10581. "type": "string",
  10582. "const": "sessionID"
  10583. },
  10584. "data": {
  10585. "type": "object",
  10586. "properties": {
  10587. "sessionID": {
  10588. "type": "string",
  10589. "pattern": "^ses.*"
  10590. },
  10591. "messageID": {
  10592. "type": "string",
  10593. "pattern": "^msg.*"
  10594. },
  10595. "partID": {
  10596. "type": "string",
  10597. "pattern": "^prt.*"
  10598. }
  10599. },
  10600. "required": ["sessionID", "messageID", "partID"]
  10601. }
  10602. },
  10603. "required": ["type", "name", "id", "seq", "aggregateID", "data"]
  10604. },
  10605. "SyncEvent.session.created": {
  10606. "type": "object",
  10607. "properties": {
  10608. "type": {
  10609. "type": "string",
  10610. "const": "sync"
  10611. },
  10612. "name": {
  10613. "type": "string",
  10614. "const": "session.created.1"
  10615. },
  10616. "id": {
  10617. "type": "string"
  10618. },
  10619. "seq": {
  10620. "type": "number"
  10621. },
  10622. "aggregateID": {
  10623. "type": "string",
  10624. "const": "sessionID"
  10625. },
  10626. "data": {
  10627. "type": "object",
  10628. "properties": {
  10629. "sessionID": {
  10630. "type": "string",
  10631. "pattern": "^ses.*"
  10632. },
  10633. "info": {
  10634. "$ref": "#/components/schemas/Session"
  10635. }
  10636. },
  10637. "required": ["sessionID", "info"]
  10638. }
  10639. },
  10640. "required": ["type", "name", "id", "seq", "aggregateID", "data"]
  10641. },
  10642. "SyncEvent.session.updated": {
  10643. "type": "object",
  10644. "properties": {
  10645. "type": {
  10646. "type": "string",
  10647. "const": "sync"
  10648. },
  10649. "name": {
  10650. "type": "string",
  10651. "const": "session.updated.1"
  10652. },
  10653. "id": {
  10654. "type": "string"
  10655. },
  10656. "seq": {
  10657. "type": "number"
  10658. },
  10659. "aggregateID": {
  10660. "type": "string",
  10661. "const": "sessionID"
  10662. },
  10663. "data": {
  10664. "type": "object",
  10665. "properties": {
  10666. "sessionID": {
  10667. "type": "string",
  10668. "pattern": "^ses.*"
  10669. },
  10670. "info": {
  10671. "type": "object",
  10672. "properties": {
  10673. "id": {
  10674. "anyOf": [
  10675. {
  10676. "type": "string",
  10677. "pattern": "^ses.*"
  10678. },
  10679. {
  10680. "type": "null"
  10681. }
  10682. ]
  10683. },
  10684. "slug": {
  10685. "anyOf": [
  10686. {
  10687. "type": "string"
  10688. },
  10689. {
  10690. "type": "null"
  10691. }
  10692. ]
  10693. },
  10694. "projectID": {
  10695. "anyOf": [
  10696. {
  10697. "type": "string"
  10698. },
  10699. {
  10700. "type": "null"
  10701. }
  10702. ]
  10703. },
  10704. "workspaceID": {
  10705. "anyOf": [
  10706. {
  10707. "type": "string",
  10708. "pattern": "^wrk.*"
  10709. },
  10710. {
  10711. "type": "null"
  10712. }
  10713. ]
  10714. },
  10715. "directory": {
  10716. "anyOf": [
  10717. {
  10718. "type": "string"
  10719. },
  10720. {
  10721. "type": "null"
  10722. }
  10723. ]
  10724. },
  10725. "path": {
  10726. "anyOf": [
  10727. {
  10728. "type": "string"
  10729. },
  10730. {
  10731. "type": "null"
  10732. }
  10733. ]
  10734. },
  10735. "parentID": {
  10736. "anyOf": [
  10737. {
  10738. "type": "string",
  10739. "pattern": "^ses.*"
  10740. },
  10741. {
  10742. "type": "null"
  10743. }
  10744. ]
  10745. },
  10746. "summary": {
  10747. "anyOf": [
  10748. {
  10749. "type": "object",
  10750. "properties": {
  10751. "additions": {
  10752. "type": "integer",
  10753. "minimum": 0,
  10754. "maximum": 9007199254740991
  10755. },
  10756. "deletions": {
  10757. "type": "integer",
  10758. "minimum": 0,
  10759. "maximum": 9007199254740991
  10760. },
  10761. "files": {
  10762. "type": "integer",
  10763. "minimum": 0,
  10764. "maximum": 9007199254740991
  10765. },
  10766. "diffs": {
  10767. "type": "array",
  10768. "items": {
  10769. "$ref": "#/components/schemas/SnapshotFileDiff"
  10770. }
  10771. }
  10772. },
  10773. "required": ["additions", "deletions", "files"]
  10774. },
  10775. {
  10776. "type": "null"
  10777. }
  10778. ]
  10779. },
  10780. "share": {
  10781. "type": "object",
  10782. "properties": {
  10783. "url": {
  10784. "anyOf": [
  10785. {
  10786. "type": "string"
  10787. },
  10788. {
  10789. "type": "null"
  10790. }
  10791. ]
  10792. }
  10793. }
  10794. },
  10795. "title": {
  10796. "anyOf": [
  10797. {
  10798. "type": "string"
  10799. },
  10800. {
  10801. "type": "null"
  10802. }
  10803. ]
  10804. },
  10805. "version": {
  10806. "anyOf": [
  10807. {
  10808. "type": "string"
  10809. },
  10810. {
  10811. "type": "null"
  10812. }
  10813. ]
  10814. },
  10815. "time": {
  10816. "type": "object",
  10817. "properties": {
  10818. "created": {
  10819. "anyOf": [
  10820. {
  10821. "type": "integer",
  10822. "minimum": 0,
  10823. "maximum": 9007199254740991
  10824. },
  10825. {
  10826. "type": "null"
  10827. }
  10828. ]
  10829. },
  10830. "updated": {
  10831. "anyOf": [
  10832. {
  10833. "type": "integer",
  10834. "minimum": 0,
  10835. "maximum": 9007199254740991
  10836. },
  10837. {
  10838. "type": "null"
  10839. }
  10840. ]
  10841. },
  10842. "compacting": {
  10843. "anyOf": [
  10844. {
  10845. "type": "integer",
  10846. "minimum": 0,
  10847. "maximum": 9007199254740991
  10848. },
  10849. {
  10850. "type": "null"
  10851. }
  10852. ]
  10853. },
  10854. "archived": {
  10855. "anyOf": [
  10856. {
  10857. "type": "integer",
  10858. "minimum": 0,
  10859. "maximum": 9007199254740991
  10860. },
  10861. {
  10862. "type": "null"
  10863. }
  10864. ]
  10865. }
  10866. }
  10867. },
  10868. "permission": {
  10869. "anyOf": [
  10870. {
  10871. "$ref": "#/components/schemas/PermissionRuleset"
  10872. },
  10873. {
  10874. "type": "null"
  10875. }
  10876. ]
  10877. },
  10878. "revert": {
  10879. "anyOf": [
  10880. {
  10881. "type": "object",
  10882. "properties": {
  10883. "messageID": {
  10884. "type": "string",
  10885. "pattern": "^msg.*"
  10886. },
  10887. "partID": {
  10888. "type": "string",
  10889. "pattern": "^prt.*"
  10890. },
  10891. "snapshot": {
  10892. "type": "string"
  10893. },
  10894. "diff": {
  10895. "type": "string"
  10896. }
  10897. },
  10898. "required": ["messageID"]
  10899. },
  10900. {
  10901. "type": "null"
  10902. }
  10903. ]
  10904. }
  10905. }
  10906. }
  10907. },
  10908. "required": ["sessionID", "info"]
  10909. }
  10910. },
  10911. "required": ["type", "name", "id", "seq", "aggregateID", "data"]
  10912. },
  10913. "SyncEvent.session.deleted": {
  10914. "type": "object",
  10915. "properties": {
  10916. "type": {
  10917. "type": "string",
  10918. "const": "sync"
  10919. },
  10920. "name": {
  10921. "type": "string",
  10922. "const": "session.deleted.1"
  10923. },
  10924. "id": {
  10925. "type": "string"
  10926. },
  10927. "seq": {
  10928. "type": "number"
  10929. },
  10930. "aggregateID": {
  10931. "type": "string",
  10932. "const": "sessionID"
  10933. },
  10934. "data": {
  10935. "type": "object",
  10936. "properties": {
  10937. "sessionID": {
  10938. "type": "string",
  10939. "pattern": "^ses.*"
  10940. },
  10941. "info": {
  10942. "$ref": "#/components/schemas/Session"
  10943. }
  10944. },
  10945. "required": ["sessionID", "info"]
  10946. }
  10947. },
  10948. "required": ["type", "name", "id", "seq", "aggregateID", "data"]
  10949. },
  10950. "GlobalEvent": {
  10951. "type": "object",
  10952. "properties": {
  10953. "directory": {
  10954. "type": "string"
  10955. },
  10956. "project": {
  10957. "type": "string"
  10958. },
  10959. "workspace": {
  10960. "type": "string"
  10961. },
  10962. "payload": {
  10963. "anyOf": [
  10964. {
  10965. "$ref": "#/components/schemas/Event.project.updated"
  10966. },
  10967. {
  10968. "$ref": "#/components/schemas/Event.server.instance.disposed"
  10969. },
  10970. {
  10971. "$ref": "#/components/schemas/Event.server.connected"
  10972. },
  10973. {
  10974. "$ref": "#/components/schemas/Event.global.disposed"
  10975. },
  10976. {
  10977. "$ref": "#/components/schemas/Event.file.edited"
  10978. },
  10979. {
  10980. "$ref": "#/components/schemas/Event.file.watcher.updated"
  10981. },
  10982. {
  10983. "$ref": "#/components/schemas/Event.lsp.client.diagnostics"
  10984. },
  10985. {
  10986. "$ref": "#/components/schemas/Event.lsp.updated"
  10987. },
  10988. {
  10989. "$ref": "#/components/schemas/Event.message.part.delta"
  10990. },
  10991. {
  10992. "$ref": "#/components/schemas/Event.permission.asked"
  10993. },
  10994. {
  10995. "$ref": "#/components/schemas/Event.permission.replied"
  10996. },
  10997. {
  10998. "$ref": "#/components/schemas/Event.session.diff"
  10999. },
  11000. {
  11001. "$ref": "#/components/schemas/Event.session.error"
  11002. },
  11003. {
  11004. "$ref": "#/components/schemas/Event.installation.updated"
  11005. },
  11006. {
  11007. "$ref": "#/components/schemas/Event.installation.update-available"
  11008. },
  11009. {
  11010. "$ref": "#/components/schemas/Event.question.asked"
  11011. },
  11012. {
  11013. "$ref": "#/components/schemas/Event.question.replied"
  11014. },
  11015. {
  11016. "$ref": "#/components/schemas/Event.question.rejected"
  11017. },
  11018. {
  11019. "$ref": "#/components/schemas/Event.todo.updated"
  11020. },
  11021. {
  11022. "$ref": "#/components/schemas/Event.session.status"
  11023. },
  11024. {
  11025. "$ref": "#/components/schemas/Event.session.idle"
  11026. },
  11027. {
  11028. "$ref": "#/components/schemas/Event.session.compacted"
  11029. },
  11030. {
  11031. "$ref": "#/components/schemas/Event.tui.prompt.append"
  11032. },
  11033. {
  11034. "$ref": "#/components/schemas/Event.tui.command.execute"
  11035. },
  11036. {
  11037. "$ref": "#/components/schemas/Event.tui.toast.show"
  11038. },
  11039. {
  11040. "$ref": "#/components/schemas/Event.tui.session.select"
  11041. },
  11042. {
  11043. "$ref": "#/components/schemas/Event.mcp.tools.changed"
  11044. },
  11045. {
  11046. "$ref": "#/components/schemas/Event.mcp.browser.open.failed"
  11047. },
  11048. {
  11049. "$ref": "#/components/schemas/Event.command.executed"
  11050. },
  11051. {
  11052. "$ref": "#/components/schemas/Event.vcs.branch.updated"
  11053. },
  11054. {
  11055. "$ref": "#/components/schemas/Event.worktree.ready"
  11056. },
  11057. {
  11058. "$ref": "#/components/schemas/Event.worktree.failed"
  11059. },
  11060. {
  11061. "$ref": "#/components/schemas/Event.pty.created"
  11062. },
  11063. {
  11064. "$ref": "#/components/schemas/Event.pty.updated"
  11065. },
  11066. {
  11067. "$ref": "#/components/schemas/Event.pty.exited"
  11068. },
  11069. {
  11070. "$ref": "#/components/schemas/Event.pty.deleted"
  11071. },
  11072. {
  11073. "$ref": "#/components/schemas/Event.workspace.ready"
  11074. },
  11075. {
  11076. "$ref": "#/components/schemas/Event.workspace.failed"
  11077. },
  11078. {
  11079. "$ref": "#/components/schemas/Event.workspace.restore"
  11080. },
  11081. {
  11082. "$ref": "#/components/schemas/Event.workspace.status"
  11083. },
  11084. {
  11085. "$ref": "#/components/schemas/Event.message.updated"
  11086. },
  11087. {
  11088. "$ref": "#/components/schemas/Event.message.removed"
  11089. },
  11090. {
  11091. "$ref": "#/components/schemas/Event.message.part.updated"
  11092. },
  11093. {
  11094. "$ref": "#/components/schemas/Event.message.part.removed"
  11095. },
  11096. {
  11097. "$ref": "#/components/schemas/Event.session.created"
  11098. },
  11099. {
  11100. "$ref": "#/components/schemas/Event.session.updated"
  11101. },
  11102. {
  11103. "$ref": "#/components/schemas/Event.session.deleted"
  11104. },
  11105. {
  11106. "$ref": "#/components/schemas/SyncEvent.message.updated"
  11107. },
  11108. {
  11109. "$ref": "#/components/schemas/SyncEvent.message.removed"
  11110. },
  11111. {
  11112. "$ref": "#/components/schemas/SyncEvent.message.part.updated"
  11113. },
  11114. {
  11115. "$ref": "#/components/schemas/SyncEvent.message.part.removed"
  11116. },
  11117. {
  11118. "$ref": "#/components/schemas/SyncEvent.session.created"
  11119. },
  11120. {
  11121. "$ref": "#/components/schemas/SyncEvent.session.updated"
  11122. },
  11123. {
  11124. "$ref": "#/components/schemas/SyncEvent.session.deleted"
  11125. }
  11126. ]
  11127. }
  11128. },
  11129. "required": ["directory", "payload"]
  11130. },
  11131. "LogLevel": {
  11132. "description": "Log level",
  11133. "type": "string",
  11134. "enum": ["DEBUG", "INFO", "WARN", "ERROR"]
  11135. },
  11136. "ServerConfig": {
  11137. "description": "Server configuration for opencode serve and web commands",
  11138. "type": "object",
  11139. "properties": {
  11140. "port": {
  11141. "description": "Port to listen on",
  11142. "type": "integer",
  11143. "exclusiveMinimum": 0,
  11144. "maximum": 9007199254740991
  11145. },
  11146. "hostname": {
  11147. "description": "Hostname to listen on",
  11148. "type": "string"
  11149. },
  11150. "mdns": {
  11151. "description": "Enable mDNS service discovery",
  11152. "type": "boolean"
  11153. },
  11154. "mdnsDomain": {
  11155. "description": "Custom domain name for mDNS service (default: opencode.local)",
  11156. "type": "string"
  11157. },
  11158. "cors": {
  11159. "description": "Additional domains to allow for CORS",
  11160. "type": "array",
  11161. "items": {
  11162. "type": "string"
  11163. }
  11164. }
  11165. }
  11166. },
  11167. "PermissionActionConfig": {
  11168. "type": "string",
  11169. "enum": ["ask", "allow", "deny"]
  11170. },
  11171. "PermissionObjectConfig": {
  11172. "type": "object",
  11173. "propertyNames": {
  11174. "type": "string"
  11175. },
  11176. "additionalProperties": {
  11177. "$ref": "#/components/schemas/PermissionActionConfig"
  11178. }
  11179. },
  11180. "PermissionRuleConfig": {
  11181. "anyOf": [
  11182. {
  11183. "$ref": "#/components/schemas/PermissionActionConfig"
  11184. },
  11185. {
  11186. "$ref": "#/components/schemas/PermissionObjectConfig"
  11187. }
  11188. ]
  11189. },
  11190. "PermissionConfig": {
  11191. "anyOf": [
  11192. {
  11193. "$ref": "#/components/schemas/PermissionActionConfig"
  11194. },
  11195. {
  11196. "type": "object",
  11197. "properties": {
  11198. "read": {
  11199. "$ref": "#/components/schemas/PermissionRuleConfig"
  11200. },
  11201. "edit": {
  11202. "$ref": "#/components/schemas/PermissionRuleConfig"
  11203. },
  11204. "glob": {
  11205. "$ref": "#/components/schemas/PermissionRuleConfig"
  11206. },
  11207. "grep": {
  11208. "$ref": "#/components/schemas/PermissionRuleConfig"
  11209. },
  11210. "list": {
  11211. "$ref": "#/components/schemas/PermissionRuleConfig"
  11212. },
  11213. "bash": {
  11214. "$ref": "#/components/schemas/PermissionRuleConfig"
  11215. },
  11216. "task": {
  11217. "$ref": "#/components/schemas/PermissionRuleConfig"
  11218. },
  11219. "external_directory": {
  11220. "$ref": "#/components/schemas/PermissionRuleConfig"
  11221. },
  11222. "todowrite": {
  11223. "$ref": "#/components/schemas/PermissionActionConfig"
  11224. },
  11225. "question": {
  11226. "$ref": "#/components/schemas/PermissionActionConfig"
  11227. },
  11228. "webfetch": {
  11229. "$ref": "#/components/schemas/PermissionActionConfig"
  11230. },
  11231. "websearch": {
  11232. "$ref": "#/components/schemas/PermissionActionConfig"
  11233. },
  11234. "lsp": {
  11235. "$ref": "#/components/schemas/PermissionRuleConfig"
  11236. },
  11237. "doom_loop": {
  11238. "$ref": "#/components/schemas/PermissionActionConfig"
  11239. },
  11240. "skill": {
  11241. "$ref": "#/components/schemas/PermissionRuleConfig"
  11242. }
  11243. },
  11244. "additionalProperties": {
  11245. "$ref": "#/components/schemas/PermissionRuleConfig"
  11246. }
  11247. }
  11248. ]
  11249. },
  11250. "AgentConfig": {
  11251. "type": "object",
  11252. "properties": {
  11253. "model": {
  11254. "type": "string"
  11255. },
  11256. "variant": {
  11257. "description": "Default model variant for this agent (applies only when using the agent's configured model).",
  11258. "type": "string"
  11259. },
  11260. "temperature": {
  11261. "type": "number"
  11262. },
  11263. "top_p": {
  11264. "type": "number"
  11265. },
  11266. "prompt": {
  11267. "type": "string"
  11268. },
  11269. "tools": {
  11270. "description": "@deprecated Use 'permission' field instead",
  11271. "type": "object",
  11272. "propertyNames": {
  11273. "type": "string"
  11274. },
  11275. "additionalProperties": {
  11276. "type": "boolean"
  11277. }
  11278. },
  11279. "disable": {
  11280. "type": "boolean"
  11281. },
  11282. "description": {
  11283. "description": "Description of when to use the agent",
  11284. "type": "string"
  11285. },
  11286. "mode": {
  11287. "type": "string",
  11288. "enum": ["subagent", "primary", "all"]
  11289. },
  11290. "hidden": {
  11291. "description": "Hide this subagent from the @ autocomplete menu (default: false, only applies to mode: subagent)",
  11292. "type": "boolean"
  11293. },
  11294. "options": {
  11295. "type": "object",
  11296. "propertyNames": {
  11297. "type": "string"
  11298. },
  11299. "additionalProperties": {}
  11300. },
  11301. "color": {
  11302. "description": "Hex color code (e.g., #FF5733) or theme color (e.g., primary)",
  11303. "anyOf": [
  11304. {
  11305. "type": "string",
  11306. "pattern": "^#[0-9a-fA-F]{6}$"
  11307. },
  11308. {
  11309. "type": "string",
  11310. "enum": ["primary", "secondary", "accent", "success", "warning", "error", "info"]
  11311. }
  11312. ]
  11313. },
  11314. "steps": {
  11315. "description": "Maximum number of agentic iterations before forcing text-only response",
  11316. "type": "integer",
  11317. "exclusiveMinimum": 0,
  11318. "maximum": 9007199254740991
  11319. },
  11320. "maxSteps": {
  11321. "description": "@deprecated Use 'steps' field instead.",
  11322. "type": "integer",
  11323. "exclusiveMinimum": 0,
  11324. "maximum": 9007199254740991
  11325. },
  11326. "permission": {
  11327. "$ref": "#/components/schemas/PermissionConfig"
  11328. }
  11329. },
  11330. "additionalProperties": {}
  11331. },
  11332. "ProviderConfig": {
  11333. "type": "object",
  11334. "properties": {
  11335. "api": {
  11336. "type": "string"
  11337. },
  11338. "name": {
  11339. "type": "string"
  11340. },
  11341. "env": {
  11342. "type": "array",
  11343. "items": {
  11344. "type": "string"
  11345. }
  11346. },
  11347. "id": {
  11348. "type": "string"
  11349. },
  11350. "npm": {
  11351. "type": "string"
  11352. },
  11353. "whitelist": {
  11354. "type": "array",
  11355. "items": {
  11356. "type": "string"
  11357. }
  11358. },
  11359. "blacklist": {
  11360. "type": "array",
  11361. "items": {
  11362. "type": "string"
  11363. }
  11364. },
  11365. "options": {
  11366. "type": "object",
  11367. "properties": {
  11368. "apiKey": {
  11369. "type": "string"
  11370. },
  11371. "baseURL": {
  11372. "type": "string"
  11373. },
  11374. "enterpriseUrl": {
  11375. "description": "GitHub Enterprise URL for copilot authentication",
  11376. "type": "string"
  11377. },
  11378. "setCacheKey": {
  11379. "description": "Enable promptCacheKey for this provider (default false)",
  11380. "type": "boolean"
  11381. },
  11382. "timeout": {
  11383. "description": "Timeout in milliseconds for requests to this provider. Default is 300000 (5 minutes). Set to false to disable timeout.",
  11384. "anyOf": [
  11385. {
  11386. "type": "integer",
  11387. "exclusiveMinimum": 0,
  11388. "maximum": 9007199254740991
  11389. },
  11390. {
  11391. "type": "boolean",
  11392. "const": false
  11393. }
  11394. ]
  11395. },
  11396. "chunkTimeout": {
  11397. "description": "Timeout in milliseconds between streamed SSE chunks for this provider. If no chunk arrives within this window, the request is aborted.",
  11398. "type": "integer",
  11399. "exclusiveMinimum": 0,
  11400. "maximum": 9007199254740991
  11401. }
  11402. },
  11403. "additionalProperties": {}
  11404. },
  11405. "models": {
  11406. "type": "object",
  11407. "propertyNames": {
  11408. "type": "string"
  11409. },
  11410. "additionalProperties": {
  11411. "type": "object",
  11412. "properties": {
  11413. "id": {
  11414. "type": "string"
  11415. },
  11416. "name": {
  11417. "type": "string"
  11418. },
  11419. "family": {
  11420. "type": "string"
  11421. },
  11422. "release_date": {
  11423. "type": "string"
  11424. },
  11425. "attachment": {
  11426. "type": "boolean"
  11427. },
  11428. "reasoning": {
  11429. "type": "boolean"
  11430. },
  11431. "temperature": {
  11432. "type": "boolean"
  11433. },
  11434. "tool_call": {
  11435. "type": "boolean"
  11436. },
  11437. "interleaved": {
  11438. "anyOf": [
  11439. {
  11440. "type": "boolean",
  11441. "const": true
  11442. },
  11443. {
  11444. "type": "object",
  11445. "properties": {
  11446. "field": {
  11447. "type": "string",
  11448. "enum": ["reasoning_content", "reasoning_details"]
  11449. }
  11450. },
  11451. "required": ["field"]
  11452. }
  11453. ]
  11454. },
  11455. "cost": {
  11456. "type": "object",
  11457. "properties": {
  11458. "input": {
  11459. "type": "number"
  11460. },
  11461. "output": {
  11462. "type": "number"
  11463. },
  11464. "cache_read": {
  11465. "type": "number"
  11466. },
  11467. "cache_write": {
  11468. "type": "number"
  11469. },
  11470. "context_over_200k": {
  11471. "type": "object",
  11472. "properties": {
  11473. "input": {
  11474. "type": "number"
  11475. },
  11476. "output": {
  11477. "type": "number"
  11478. },
  11479. "cache_read": {
  11480. "type": "number"
  11481. },
  11482. "cache_write": {
  11483. "type": "number"
  11484. }
  11485. },
  11486. "required": ["input", "output"]
  11487. }
  11488. },
  11489. "required": ["input", "output"]
  11490. },
  11491. "limit": {
  11492. "type": "object",
  11493. "properties": {
  11494. "context": {
  11495. "type": "number"
  11496. },
  11497. "input": {
  11498. "type": "number"
  11499. },
  11500. "output": {
  11501. "type": "number"
  11502. }
  11503. },
  11504. "required": ["context", "output"]
  11505. },
  11506. "modalities": {
  11507. "type": "object",
  11508. "properties": {
  11509. "input": {
  11510. "type": "array",
  11511. "items": {
  11512. "type": "string",
  11513. "enum": ["text", "audio", "image", "video", "pdf"]
  11514. }
  11515. },
  11516. "output": {
  11517. "type": "array",
  11518. "items": {
  11519. "type": "string",
  11520. "enum": ["text", "audio", "image", "video", "pdf"]
  11521. }
  11522. }
  11523. },
  11524. "required": ["input", "output"]
  11525. },
  11526. "experimental": {
  11527. "type": "boolean"
  11528. },
  11529. "status": {
  11530. "type": "string",
  11531. "enum": ["alpha", "beta", "deprecated"]
  11532. },
  11533. "provider": {
  11534. "type": "object",
  11535. "properties": {
  11536. "npm": {
  11537. "type": "string"
  11538. },
  11539. "api": {
  11540. "type": "string"
  11541. }
  11542. }
  11543. },
  11544. "options": {
  11545. "type": "object",
  11546. "propertyNames": {
  11547. "type": "string"
  11548. },
  11549. "additionalProperties": {}
  11550. },
  11551. "headers": {
  11552. "type": "object",
  11553. "propertyNames": {
  11554. "type": "string"
  11555. },
  11556. "additionalProperties": {
  11557. "type": "string"
  11558. }
  11559. },
  11560. "variants": {
  11561. "description": "Variant-specific configuration",
  11562. "type": "object",
  11563. "propertyNames": {
  11564. "type": "string"
  11565. },
  11566. "additionalProperties": {
  11567. "type": "object",
  11568. "properties": {
  11569. "disabled": {
  11570. "description": "Disable this variant for the model",
  11571. "type": "boolean"
  11572. }
  11573. },
  11574. "additionalProperties": {}
  11575. }
  11576. }
  11577. }
  11578. }
  11579. }
  11580. }
  11581. },
  11582. "McpLocalConfig": {
  11583. "type": "object",
  11584. "properties": {
  11585. "type": {
  11586. "description": "Type of MCP server connection",
  11587. "type": "string",
  11588. "const": "local"
  11589. },
  11590. "command": {
  11591. "description": "Command and arguments to run the MCP server",
  11592. "type": "array",
  11593. "items": {
  11594. "type": "string"
  11595. }
  11596. },
  11597. "environment": {
  11598. "description": "Environment variables to set when running the MCP server",
  11599. "type": "object",
  11600. "propertyNames": {
  11601. "type": "string"
  11602. },
  11603. "additionalProperties": {
  11604. "type": "string"
  11605. }
  11606. },
  11607. "enabled": {
  11608. "description": "Enable or disable the MCP server on startup",
  11609. "type": "boolean"
  11610. },
  11611. "timeout": {
  11612. "description": "Timeout in ms for MCP server requests. Defaults to 5000 (5 seconds) if not specified.",
  11613. "type": "integer",
  11614. "exclusiveMinimum": 0,
  11615. "maximum": 9007199254740991
  11616. }
  11617. },
  11618. "required": ["type", "command"]
  11619. },
  11620. "McpOAuthConfig": {
  11621. "type": "object",
  11622. "properties": {
  11623. "clientId": {
  11624. "description": "OAuth client ID. If not provided, dynamic client registration (RFC 7591) will be attempted.",
  11625. "type": "string"
  11626. },
  11627. "clientSecret": {
  11628. "description": "OAuth client secret (if required by the authorization server)",
  11629. "type": "string"
  11630. },
  11631. "scope": {
  11632. "description": "OAuth scopes to request during authorization",
  11633. "type": "string"
  11634. },
  11635. "redirectUri": {
  11636. "description": "OAuth redirect URI (default: http://127.0.0.1:19876/mcp/oauth/callback).",
  11637. "type": "string"
  11638. }
  11639. }
  11640. },
  11641. "McpRemoteConfig": {
  11642. "type": "object",
  11643. "properties": {
  11644. "type": {
  11645. "description": "Type of MCP server connection",
  11646. "type": "string",
  11647. "const": "remote"
  11648. },
  11649. "url": {
  11650. "description": "URL of the remote MCP server",
  11651. "type": "string"
  11652. },
  11653. "enabled": {
  11654. "description": "Enable or disable the MCP server on startup",
  11655. "type": "boolean"
  11656. },
  11657. "headers": {
  11658. "description": "Headers to send with the request",
  11659. "type": "object",
  11660. "propertyNames": {
  11661. "type": "string"
  11662. },
  11663. "additionalProperties": {
  11664. "type": "string"
  11665. }
  11666. },
  11667. "oauth": {
  11668. "description": "OAuth authentication configuration for the MCP server. Set to false to disable OAuth auto-detection.",
  11669. "anyOf": [
  11670. {
  11671. "$ref": "#/components/schemas/McpOAuthConfig"
  11672. },
  11673. {
  11674. "type": "boolean",
  11675. "const": false
  11676. }
  11677. ]
  11678. },
  11679. "timeout": {
  11680. "description": "Timeout in ms for MCP server requests. Defaults to 5000 (5 seconds) if not specified.",
  11681. "type": "integer",
  11682. "exclusiveMinimum": 0,
  11683. "maximum": 9007199254740991
  11684. }
  11685. },
  11686. "required": ["type", "url"]
  11687. },
  11688. "LayoutConfig": {
  11689. "description": "@deprecated Always uses stretch layout.",
  11690. "type": "string",
  11691. "enum": ["auto", "stretch"]
  11692. },
  11693. "Config": {
  11694. "type": "object",
  11695. "properties": {
  11696. "$schema": {
  11697. "description": "JSON schema reference for configuration validation",
  11698. "type": "string"
  11699. },
  11700. "shell": {
  11701. "description": "Default shell to use for terminal and bash tool",
  11702. "type": "string"
  11703. },
  11704. "logLevel": {
  11705. "$ref": "#/components/schemas/LogLevel"
  11706. },
  11707. "server": {
  11708. "$ref": "#/components/schemas/ServerConfig"
  11709. },
  11710. "command": {
  11711. "description": "Command configuration, see https://opencode.ai/docs/commands",
  11712. "type": "object",
  11713. "propertyNames": {
  11714. "type": "string"
  11715. },
  11716. "additionalProperties": {
  11717. "type": "object",
  11718. "properties": {
  11719. "template": {
  11720. "type": "string"
  11721. },
  11722. "description": {
  11723. "type": "string"
  11724. },
  11725. "agent": {
  11726. "type": "string"
  11727. },
  11728. "model": {
  11729. "type": "string"
  11730. },
  11731. "subtask": {
  11732. "type": "boolean"
  11733. }
  11734. },
  11735. "required": ["template"]
  11736. }
  11737. },
  11738. "skills": {
  11739. "description": "Additional skill folder paths",
  11740. "type": "object",
  11741. "properties": {
  11742. "paths": {
  11743. "description": "Additional paths to skill folders",
  11744. "type": "array",
  11745. "items": {
  11746. "type": "string"
  11747. }
  11748. },
  11749. "urls": {
  11750. "description": "URLs to fetch skills from (e.g., https://example.com/.well-known/skills/)",
  11751. "type": "array",
  11752. "items": {
  11753. "type": "string"
  11754. }
  11755. }
  11756. }
  11757. },
  11758. "watcher": {
  11759. "type": "object",
  11760. "properties": {
  11761. "ignore": {
  11762. "type": "array",
  11763. "items": {
  11764. "type": "string"
  11765. }
  11766. }
  11767. }
  11768. },
  11769. "snapshot": {
  11770. "description": "Enable or disable snapshot tracking. When false, filesystem snapshots are not recorded and undoing or reverting will not undo/redo file changes. Defaults to true.",
  11771. "type": "boolean"
  11772. },
  11773. "plugin": {
  11774. "type": "array",
  11775. "items": {
  11776. "anyOf": [
  11777. {
  11778. "type": "string"
  11779. },
  11780. {
  11781. "type": "array",
  11782. "prefixItems": [
  11783. {
  11784. "type": "string"
  11785. },
  11786. {
  11787. "type": "object",
  11788. "propertyNames": {
  11789. "type": "string"
  11790. },
  11791. "additionalProperties": {}
  11792. }
  11793. ]
  11794. }
  11795. ]
  11796. }
  11797. },
  11798. "share": {
  11799. "description": "Control sharing behavior:'manual' allows manual sharing via commands, 'auto' enables automatic sharing, 'disabled' disables all sharing",
  11800. "type": "string",
  11801. "enum": ["manual", "auto", "disabled"]
  11802. },
  11803. "autoshare": {
  11804. "description": "@deprecated Use 'share' field instead. Share newly created sessions automatically",
  11805. "type": "boolean"
  11806. },
  11807. "autoupdate": {
  11808. "description": "Automatically update to the latest version. Set to true to auto-update, false to disable, or 'notify' to show update notifications",
  11809. "anyOf": [
  11810. {
  11811. "type": "boolean"
  11812. },
  11813. {
  11814. "type": "string",
  11815. "const": "notify"
  11816. }
  11817. ]
  11818. },
  11819. "disabled_providers": {
  11820. "description": "Disable providers that are loaded automatically",
  11821. "type": "array",
  11822. "items": {
  11823. "type": "string"
  11824. }
  11825. },
  11826. "enabled_providers": {
  11827. "description": "When set, ONLY these providers will be enabled. All other providers will be ignored",
  11828. "type": "array",
  11829. "items": {
  11830. "type": "string"
  11831. }
  11832. },
  11833. "model": {
  11834. "description": "Model to use in the format of provider/model, eg anthropic/claude-2",
  11835. "type": "string"
  11836. },
  11837. "small_model": {
  11838. "description": "Small model to use for tasks like title generation in the format of provider/model",
  11839. "type": "string"
  11840. },
  11841. "default_agent": {
  11842. "description": "Default agent to use when none is specified. Must be a primary agent. Falls back to 'build' if not set or if the specified agent is invalid.",
  11843. "type": "string"
  11844. },
  11845. "username": {
  11846. "description": "Custom username to display in conversations instead of system username",
  11847. "type": "string"
  11848. },
  11849. "mode": {
  11850. "description": "@deprecated Use `agent` field instead.",
  11851. "type": "object",
  11852. "properties": {
  11853. "build": {
  11854. "$ref": "#/components/schemas/AgentConfig"
  11855. },
  11856. "plan": {
  11857. "$ref": "#/components/schemas/AgentConfig"
  11858. }
  11859. },
  11860. "additionalProperties": {
  11861. "$ref": "#/components/schemas/AgentConfig"
  11862. }
  11863. },
  11864. "agent": {
  11865. "description": "Agent configuration, see https://opencode.ai/docs/agents",
  11866. "type": "object",
  11867. "properties": {
  11868. "plan": {
  11869. "$ref": "#/components/schemas/AgentConfig"
  11870. },
  11871. "build": {
  11872. "$ref": "#/components/schemas/AgentConfig"
  11873. },
  11874. "general": {
  11875. "$ref": "#/components/schemas/AgentConfig"
  11876. },
  11877. "explore": {
  11878. "$ref": "#/components/schemas/AgentConfig"
  11879. },
  11880. "title": {
  11881. "$ref": "#/components/schemas/AgentConfig"
  11882. },
  11883. "summary": {
  11884. "$ref": "#/components/schemas/AgentConfig"
  11885. },
  11886. "compaction": {
  11887. "$ref": "#/components/schemas/AgentConfig"
  11888. }
  11889. },
  11890. "additionalProperties": {
  11891. "$ref": "#/components/schemas/AgentConfig"
  11892. }
  11893. },
  11894. "provider": {
  11895. "description": "Custom provider configurations and model overrides",
  11896. "type": "object",
  11897. "propertyNames": {
  11898. "type": "string"
  11899. },
  11900. "additionalProperties": {
  11901. "$ref": "#/components/schemas/ProviderConfig"
  11902. }
  11903. },
  11904. "mcp": {
  11905. "description": "MCP (Model Context Protocol) server configurations",
  11906. "type": "object",
  11907. "propertyNames": {
  11908. "type": "string"
  11909. },
  11910. "additionalProperties": {
  11911. "anyOf": [
  11912. {
  11913. "anyOf": [
  11914. {
  11915. "$ref": "#/components/schemas/McpLocalConfig"
  11916. },
  11917. {
  11918. "$ref": "#/components/schemas/McpRemoteConfig"
  11919. }
  11920. ]
  11921. },
  11922. {
  11923. "type": "object",
  11924. "properties": {
  11925. "enabled": {
  11926. "type": "boolean"
  11927. }
  11928. },
  11929. "required": ["enabled"]
  11930. }
  11931. ]
  11932. }
  11933. },
  11934. "formatter": {
  11935. "anyOf": [
  11936. {
  11937. "type": "boolean"
  11938. },
  11939. {
  11940. "type": "object",
  11941. "propertyNames": {
  11942. "type": "string"
  11943. },
  11944. "additionalProperties": {
  11945. "type": "object",
  11946. "properties": {
  11947. "disabled": {
  11948. "type": "boolean"
  11949. },
  11950. "command": {
  11951. "type": "array",
  11952. "items": {
  11953. "type": "string"
  11954. }
  11955. },
  11956. "environment": {
  11957. "type": "object",
  11958. "propertyNames": {
  11959. "type": "string"
  11960. },
  11961. "additionalProperties": {
  11962. "type": "string"
  11963. }
  11964. },
  11965. "extensions": {
  11966. "type": "array",
  11967. "items": {
  11968. "type": "string"
  11969. }
  11970. }
  11971. }
  11972. }
  11973. }
  11974. ]
  11975. },
  11976. "lsp": {
  11977. "anyOf": [
  11978. {
  11979. "type": "boolean"
  11980. },
  11981. {
  11982. "type": "object",
  11983. "propertyNames": {
  11984. "type": "string"
  11985. },
  11986. "additionalProperties": {
  11987. "anyOf": [
  11988. {
  11989. "type": "object",
  11990. "properties": {
  11991. "disabled": {
  11992. "type": "boolean",
  11993. "const": true
  11994. }
  11995. },
  11996. "required": ["disabled"]
  11997. },
  11998. {
  11999. "type": "object",
  12000. "properties": {
  12001. "command": {
  12002. "type": "array",
  12003. "items": {
  12004. "type": "string"
  12005. }
  12006. },
  12007. "extensions": {
  12008. "type": "array",
  12009. "items": {
  12010. "type": "string"
  12011. }
  12012. },
  12013. "disabled": {
  12014. "type": "boolean"
  12015. },
  12016. "env": {
  12017. "type": "object",
  12018. "propertyNames": {
  12019. "type": "string"
  12020. },
  12021. "additionalProperties": {
  12022. "type": "string"
  12023. }
  12024. },
  12025. "initialization": {
  12026. "type": "object",
  12027. "propertyNames": {
  12028. "type": "string"
  12029. },
  12030. "additionalProperties": {}
  12031. }
  12032. },
  12033. "required": ["command"]
  12034. }
  12035. ]
  12036. }
  12037. }
  12038. ]
  12039. },
  12040. "instructions": {
  12041. "description": "Additional instruction files or patterns to include",
  12042. "type": "array",
  12043. "items": {
  12044. "type": "string"
  12045. }
  12046. },
  12047. "layout": {
  12048. "$ref": "#/components/schemas/LayoutConfig"
  12049. },
  12050. "permission": {
  12051. "$ref": "#/components/schemas/PermissionConfig"
  12052. },
  12053. "tools": {
  12054. "type": "object",
  12055. "propertyNames": {
  12056. "type": "string"
  12057. },
  12058. "additionalProperties": {
  12059. "type": "boolean"
  12060. }
  12061. },
  12062. "enterprise": {
  12063. "type": "object",
  12064. "properties": {
  12065. "url": {
  12066. "description": "Enterprise URL",
  12067. "type": "string"
  12068. }
  12069. }
  12070. },
  12071. "tool_output": {
  12072. "description": "Thresholds for truncating tool output. When output exceeds either limit, the full text is written to the truncation directory and a preview is returned.",
  12073. "type": "object",
  12074. "properties": {
  12075. "max_lines": {
  12076. "description": "Maximum lines of tool output before it is truncated and saved to disk (default: 2000)",
  12077. "type": "integer",
  12078. "exclusiveMinimum": 0,
  12079. "maximum": 9007199254740991
  12080. },
  12081. "max_bytes": {
  12082. "description": "Maximum bytes of tool output before it is truncated and saved to disk (default: 51200)",
  12083. "type": "integer",
  12084. "exclusiveMinimum": 0,
  12085. "maximum": 9007199254740991
  12086. }
  12087. }
  12088. },
  12089. "compaction": {
  12090. "type": "object",
  12091. "properties": {
  12092. "auto": {
  12093. "description": "Enable automatic compaction when context is full (default: true)",
  12094. "type": "boolean"
  12095. },
  12096. "prune": {
  12097. "description": "Enable pruning of old tool outputs (default: true)",
  12098. "type": "boolean"
  12099. },
  12100. "tail_turns": {
  12101. "description": "Number of recent user turns, including their following assistant/tool responses, to keep verbatim during compaction (default: 2)",
  12102. "type": "integer",
  12103. "minimum": 0,
  12104. "maximum": 9007199254740991
  12105. },
  12106. "preserve_recent_tokens": {
  12107. "description": "Maximum number of tokens from recent turns to preserve verbatim after compaction",
  12108. "type": "integer",
  12109. "minimum": 0,
  12110. "maximum": 9007199254740991
  12111. },
  12112. "reserved": {
  12113. "description": "Token buffer for compaction. Leaves enough window to avoid overflow during compaction.",
  12114. "type": "integer",
  12115. "minimum": 0,
  12116. "maximum": 9007199254740991
  12117. }
  12118. }
  12119. },
  12120. "experimental": {
  12121. "type": "object",
  12122. "properties": {
  12123. "disable_paste_summary": {
  12124. "type": "boolean"
  12125. },
  12126. "batch_tool": {
  12127. "description": "Enable the batch tool",
  12128. "type": "boolean"
  12129. },
  12130. "openTelemetry": {
  12131. "description": "Enable OpenTelemetry spans for AI SDK calls (using the 'experimental_telemetry' flag)",
  12132. "type": "boolean"
  12133. },
  12134. "primary_tools": {
  12135. "description": "Tools that should only be available to primary agents.",
  12136. "type": "array",
  12137. "items": {
  12138. "type": "string"
  12139. }
  12140. },
  12141. "continue_loop_on_deny": {
  12142. "description": "Continue the agent loop when a tool call is denied",
  12143. "type": "boolean"
  12144. },
  12145. "mcp_timeout": {
  12146. "description": "Timeout in milliseconds for model context protocol (MCP) requests",
  12147. "type": "integer",
  12148. "exclusiveMinimum": 0,
  12149. "maximum": 9007199254740991
  12150. }
  12151. }
  12152. }
  12153. },
  12154. "additionalProperties": false
  12155. },
  12156. "BadRequestError": {
  12157. "type": "object",
  12158. "properties": {
  12159. "data": {},
  12160. "errors": {
  12161. "type": "array",
  12162. "items": {
  12163. "type": "object",
  12164. "propertyNames": {
  12165. "type": "string"
  12166. },
  12167. "additionalProperties": {}
  12168. }
  12169. },
  12170. "success": {
  12171. "type": "boolean",
  12172. "const": false
  12173. }
  12174. },
  12175. "required": ["data", "errors", "success"]
  12176. },
  12177. "OAuth": {
  12178. "type": "object",
  12179. "properties": {
  12180. "type": {
  12181. "type": "string",
  12182. "const": "oauth"
  12183. },
  12184. "refresh": {
  12185. "type": "string"
  12186. },
  12187. "access": {
  12188. "type": "string"
  12189. },
  12190. "expires": {
  12191. "type": "integer",
  12192. "minimum": 0,
  12193. "maximum": 9007199254740991
  12194. },
  12195. "accountId": {
  12196. "type": "string"
  12197. },
  12198. "enterpriseUrl": {
  12199. "type": "string"
  12200. }
  12201. },
  12202. "required": ["type", "refresh", "access", "expires"]
  12203. },
  12204. "ApiAuth": {
  12205. "type": "object",
  12206. "properties": {
  12207. "type": {
  12208. "type": "string",
  12209. "const": "api"
  12210. },
  12211. "key": {
  12212. "type": "string"
  12213. },
  12214. "metadata": {
  12215. "type": "object",
  12216. "propertyNames": {
  12217. "type": "string"
  12218. },
  12219. "additionalProperties": {
  12220. "type": "string"
  12221. }
  12222. }
  12223. },
  12224. "required": ["type", "key"]
  12225. },
  12226. "WellKnownAuth": {
  12227. "type": "object",
  12228. "properties": {
  12229. "type": {
  12230. "type": "string",
  12231. "const": "wellknown"
  12232. },
  12233. "key": {
  12234. "type": "string"
  12235. },
  12236. "token": {
  12237. "type": "string"
  12238. }
  12239. },
  12240. "required": ["type", "key", "token"]
  12241. },
  12242. "Auth": {
  12243. "anyOf": [
  12244. {
  12245. "$ref": "#/components/schemas/OAuth"
  12246. },
  12247. {
  12248. "$ref": "#/components/schemas/ApiAuth"
  12249. },
  12250. {
  12251. "$ref": "#/components/schemas/WellKnownAuth"
  12252. }
  12253. ]
  12254. },
  12255. "Workspace": {
  12256. "type": "object",
  12257. "properties": {
  12258. "id": {
  12259. "type": "string",
  12260. "pattern": "^wrk.*"
  12261. },
  12262. "type": {
  12263. "type": "string"
  12264. },
  12265. "name": {
  12266. "type": "string"
  12267. },
  12268. "branch": {
  12269. "anyOf": [
  12270. {
  12271. "type": "string"
  12272. },
  12273. {
  12274. "type": "null"
  12275. }
  12276. ]
  12277. },
  12278. "directory": {
  12279. "anyOf": [
  12280. {
  12281. "type": "string"
  12282. },
  12283. {
  12284. "type": "null"
  12285. }
  12286. ]
  12287. },
  12288. "extra": {
  12289. "anyOf": [
  12290. {},
  12291. {
  12292. "type": "null"
  12293. }
  12294. ]
  12295. },
  12296. "projectID": {
  12297. "type": "string"
  12298. }
  12299. },
  12300. "required": ["id", "type", "name", "branch", "directory", "extra", "projectID"]
  12301. },
  12302. "NotFoundError": {
  12303. "type": "object",
  12304. "properties": {
  12305. "name": {
  12306. "type": "string",
  12307. "const": "NotFoundError"
  12308. },
  12309. "data": {
  12310. "type": "object",
  12311. "properties": {
  12312. "message": {
  12313. "type": "string"
  12314. }
  12315. },
  12316. "required": ["message"]
  12317. }
  12318. },
  12319. "required": ["name", "data"]
  12320. },
  12321. "Model": {
  12322. "type": "object",
  12323. "properties": {
  12324. "id": {
  12325. "type": "string"
  12326. },
  12327. "providerID": {
  12328. "type": "string"
  12329. },
  12330. "api": {
  12331. "type": "object",
  12332. "properties": {
  12333. "id": {
  12334. "type": "string"
  12335. },
  12336. "url": {
  12337. "type": "string"
  12338. },
  12339. "npm": {
  12340. "type": "string"
  12341. }
  12342. },
  12343. "required": ["id", "url", "npm"]
  12344. },
  12345. "name": {
  12346. "type": "string"
  12347. },
  12348. "family": {
  12349. "type": "string"
  12350. },
  12351. "capabilities": {
  12352. "type": "object",
  12353. "properties": {
  12354. "temperature": {
  12355. "type": "boolean"
  12356. },
  12357. "reasoning": {
  12358. "type": "boolean"
  12359. },
  12360. "attachment": {
  12361. "type": "boolean"
  12362. },
  12363. "toolcall": {
  12364. "type": "boolean"
  12365. },
  12366. "input": {
  12367. "type": "object",
  12368. "properties": {
  12369. "text": {
  12370. "type": "boolean"
  12371. },
  12372. "audio": {
  12373. "type": "boolean"
  12374. },
  12375. "image": {
  12376. "type": "boolean"
  12377. },
  12378. "video": {
  12379. "type": "boolean"
  12380. },
  12381. "pdf": {
  12382. "type": "boolean"
  12383. }
  12384. },
  12385. "required": ["text", "audio", "image", "video", "pdf"]
  12386. },
  12387. "output": {
  12388. "type": "object",
  12389. "properties": {
  12390. "text": {
  12391. "type": "boolean"
  12392. },
  12393. "audio": {
  12394. "type": "boolean"
  12395. },
  12396. "image": {
  12397. "type": "boolean"
  12398. },
  12399. "video": {
  12400. "type": "boolean"
  12401. },
  12402. "pdf": {
  12403. "type": "boolean"
  12404. }
  12405. },
  12406. "required": ["text", "audio", "image", "video", "pdf"]
  12407. },
  12408. "interleaved": {
  12409. "anyOf": [
  12410. {
  12411. "type": "boolean"
  12412. },
  12413. {
  12414. "type": "object",
  12415. "properties": {
  12416. "field": {
  12417. "type": "string",
  12418. "enum": ["reasoning_content", "reasoning_details"]
  12419. }
  12420. },
  12421. "required": ["field"]
  12422. }
  12423. ]
  12424. }
  12425. },
  12426. "required": ["temperature", "reasoning", "attachment", "toolcall", "input", "output", "interleaved"]
  12427. },
  12428. "cost": {
  12429. "type": "object",
  12430. "properties": {
  12431. "input": {
  12432. "type": "number"
  12433. },
  12434. "output": {
  12435. "type": "number"
  12436. },
  12437. "cache": {
  12438. "type": "object",
  12439. "properties": {
  12440. "read": {
  12441. "type": "number"
  12442. },
  12443. "write": {
  12444. "type": "number"
  12445. }
  12446. },
  12447. "required": ["read", "write"]
  12448. },
  12449. "experimentalOver200K": {
  12450. "type": "object",
  12451. "properties": {
  12452. "input": {
  12453. "type": "number"
  12454. },
  12455. "output": {
  12456. "type": "number"
  12457. },
  12458. "cache": {
  12459. "type": "object",
  12460. "properties": {
  12461. "read": {
  12462. "type": "number"
  12463. },
  12464. "write": {
  12465. "type": "number"
  12466. }
  12467. },
  12468. "required": ["read", "write"]
  12469. }
  12470. },
  12471. "required": ["input", "output", "cache"]
  12472. }
  12473. },
  12474. "required": ["input", "output", "cache"]
  12475. },
  12476. "limit": {
  12477. "type": "object",
  12478. "properties": {
  12479. "context": {
  12480. "type": "number"
  12481. },
  12482. "input": {
  12483. "type": "number"
  12484. },
  12485. "output": {
  12486. "type": "number"
  12487. }
  12488. },
  12489. "required": ["context", "output"]
  12490. },
  12491. "status": {
  12492. "type": "string",
  12493. "enum": ["alpha", "beta", "deprecated", "active"]
  12494. },
  12495. "options": {
  12496. "type": "object",
  12497. "propertyNames": {
  12498. "type": "string"
  12499. },
  12500. "additionalProperties": {}
  12501. },
  12502. "headers": {
  12503. "type": "object",
  12504. "propertyNames": {
  12505. "type": "string"
  12506. },
  12507. "additionalProperties": {
  12508. "type": "string"
  12509. }
  12510. },
  12511. "release_date": {
  12512. "type": "string"
  12513. },
  12514. "variants": {
  12515. "type": "object",
  12516. "propertyNames": {
  12517. "type": "string"
  12518. },
  12519. "additionalProperties": {
  12520. "type": "object",
  12521. "propertyNames": {
  12522. "type": "string"
  12523. },
  12524. "additionalProperties": {}
  12525. }
  12526. }
  12527. },
  12528. "required": [
  12529. "id",
  12530. "providerID",
  12531. "api",
  12532. "name",
  12533. "capabilities",
  12534. "cost",
  12535. "limit",
  12536. "status",
  12537. "options",
  12538. "headers",
  12539. "release_date"
  12540. ]
  12541. },
  12542. "Provider": {
  12543. "type": "object",
  12544. "properties": {
  12545. "id": {
  12546. "type": "string"
  12547. },
  12548. "name": {
  12549. "type": "string"
  12550. },
  12551. "source": {
  12552. "type": "string",
  12553. "enum": ["env", "config", "custom", "api"]
  12554. },
  12555. "env": {
  12556. "type": "array",
  12557. "items": {
  12558. "type": "string"
  12559. }
  12560. },
  12561. "key": {
  12562. "type": "string"
  12563. },
  12564. "options": {
  12565. "type": "object",
  12566. "propertyNames": {
  12567. "type": "string"
  12568. },
  12569. "additionalProperties": {}
  12570. },
  12571. "models": {
  12572. "type": "object",
  12573. "propertyNames": {
  12574. "type": "string"
  12575. },
  12576. "additionalProperties": {
  12577. "$ref": "#/components/schemas/Model"
  12578. }
  12579. }
  12580. },
  12581. "required": ["id", "name", "source", "env", "options", "models"]
  12582. },
  12583. "ConsoleState": {
  12584. "type": "object",
  12585. "properties": {
  12586. "consoleManagedProviders": {
  12587. "type": "array",
  12588. "items": {
  12589. "type": "string"
  12590. }
  12591. },
  12592. "activeOrgName": {
  12593. "type": "string"
  12594. },
  12595. "switchableOrgCount": {
  12596. "type": "integer",
  12597. "minimum": 0,
  12598. "maximum": 9007199254740991
  12599. }
  12600. },
  12601. "required": ["consoleManagedProviders", "switchableOrgCount"]
  12602. },
  12603. "ToolIDs": {
  12604. "type": "array",
  12605. "items": {
  12606. "type": "string"
  12607. }
  12608. },
  12609. "ToolListItem": {
  12610. "type": "object",
  12611. "properties": {
  12612. "id": {
  12613. "type": "string"
  12614. },
  12615. "description": {
  12616. "type": "string"
  12617. },
  12618. "parameters": {}
  12619. },
  12620. "required": ["id", "description", "parameters"]
  12621. },
  12622. "ToolList": {
  12623. "type": "array",
  12624. "items": {
  12625. "$ref": "#/components/schemas/ToolListItem"
  12626. }
  12627. },
  12628. "Worktree": {
  12629. "type": "object",
  12630. "properties": {
  12631. "name": {
  12632. "type": "string"
  12633. },
  12634. "branch": {
  12635. "type": "string"
  12636. },
  12637. "directory": {
  12638. "type": "string"
  12639. }
  12640. },
  12641. "required": ["name", "branch", "directory"]
  12642. },
  12643. "WorktreeCreateInput": {
  12644. "type": "object",
  12645. "properties": {
  12646. "name": {
  12647. "type": "string"
  12648. },
  12649. "startCommand": {
  12650. "description": "Additional startup script to run after the project's start command",
  12651. "type": "string"
  12652. }
  12653. }
  12654. },
  12655. "WorktreeRemoveInput": {
  12656. "type": "object",
  12657. "properties": {
  12658. "directory": {
  12659. "type": "string"
  12660. }
  12661. },
  12662. "required": ["directory"]
  12663. },
  12664. "WorktreeResetInput": {
  12665. "type": "object",
  12666. "properties": {
  12667. "directory": {
  12668. "type": "string"
  12669. }
  12670. },
  12671. "required": ["directory"]
  12672. },
  12673. "ProjectSummary": {
  12674. "type": "object",
  12675. "properties": {
  12676. "id": {
  12677. "type": "string"
  12678. },
  12679. "name": {
  12680. "type": "string"
  12681. },
  12682. "worktree": {
  12683. "type": "string"
  12684. }
  12685. },
  12686. "required": ["id", "worktree"]
  12687. },
  12688. "GlobalSession": {
  12689. "type": "object",
  12690. "properties": {
  12691. "id": {
  12692. "type": "string",
  12693. "pattern": "^ses.*"
  12694. },
  12695. "slug": {
  12696. "type": "string"
  12697. },
  12698. "projectID": {
  12699. "type": "string"
  12700. },
  12701. "workspaceID": {
  12702. "type": "string",
  12703. "pattern": "^wrk.*"
  12704. },
  12705. "directory": {
  12706. "type": "string"
  12707. },
  12708. "path": {
  12709. "type": "string"
  12710. },
  12711. "parentID": {
  12712. "type": "string",
  12713. "pattern": "^ses.*"
  12714. },
  12715. "summary": {
  12716. "type": "object",
  12717. "properties": {
  12718. "additions": {
  12719. "type": "integer",
  12720. "minimum": 0,
  12721. "maximum": 9007199254740991
  12722. },
  12723. "deletions": {
  12724. "type": "integer",
  12725. "minimum": 0,
  12726. "maximum": 9007199254740991
  12727. },
  12728. "files": {
  12729. "type": "integer",
  12730. "minimum": 0,
  12731. "maximum": 9007199254740991
  12732. },
  12733. "diffs": {
  12734. "type": "array",
  12735. "items": {
  12736. "$ref": "#/components/schemas/SnapshotFileDiff"
  12737. }
  12738. }
  12739. },
  12740. "required": ["additions", "deletions", "files"]
  12741. },
  12742. "share": {
  12743. "type": "object",
  12744. "properties": {
  12745. "url": {
  12746. "type": "string"
  12747. }
  12748. },
  12749. "required": ["url"]
  12750. },
  12751. "title": {
  12752. "type": "string"
  12753. },
  12754. "version": {
  12755. "type": "string"
  12756. },
  12757. "time": {
  12758. "type": "object",
  12759. "properties": {
  12760. "created": {
  12761. "type": "integer",
  12762. "minimum": 0,
  12763. "maximum": 9007199254740991
  12764. },
  12765. "updated": {
  12766. "type": "integer",
  12767. "minimum": 0,
  12768. "maximum": 9007199254740991
  12769. },
  12770. "compacting": {
  12771. "type": "integer",
  12772. "minimum": 0,
  12773. "maximum": 9007199254740991
  12774. },
  12775. "archived": {
  12776. "type": "integer",
  12777. "minimum": 0,
  12778. "maximum": 9007199254740991
  12779. }
  12780. },
  12781. "required": ["created", "updated"]
  12782. },
  12783. "permission": {
  12784. "$ref": "#/components/schemas/PermissionRuleset"
  12785. },
  12786. "revert": {
  12787. "type": "object",
  12788. "properties": {
  12789. "messageID": {
  12790. "type": "string",
  12791. "pattern": "^msg.*"
  12792. },
  12793. "partID": {
  12794. "type": "string",
  12795. "pattern": "^prt.*"
  12796. },
  12797. "snapshot": {
  12798. "type": "string"
  12799. },
  12800. "diff": {
  12801. "type": "string"
  12802. }
  12803. },
  12804. "required": ["messageID"]
  12805. },
  12806. "project": {
  12807. "anyOf": [
  12808. {
  12809. "$ref": "#/components/schemas/ProjectSummary"
  12810. },
  12811. {
  12812. "type": "null"
  12813. }
  12814. ]
  12815. }
  12816. },
  12817. "required": ["id", "slug", "projectID", "directory", "title", "version", "time", "project"]
  12818. },
  12819. "McpResource": {
  12820. "type": "object",
  12821. "properties": {
  12822. "name": {
  12823. "type": "string"
  12824. },
  12825. "uri": {
  12826. "type": "string"
  12827. },
  12828. "description": {
  12829. "type": "string"
  12830. },
  12831. "mimeType": {
  12832. "type": "string"
  12833. },
  12834. "client": {
  12835. "type": "string"
  12836. }
  12837. },
  12838. "required": ["name", "uri", "client"]
  12839. },
  12840. "TextPartInput": {
  12841. "type": "object",
  12842. "properties": {
  12843. "id": {
  12844. "type": "string",
  12845. "pattern": "^prt.*"
  12846. },
  12847. "type": {
  12848. "type": "string",
  12849. "const": "text"
  12850. },
  12851. "text": {
  12852. "type": "string"
  12853. },
  12854. "synthetic": {
  12855. "type": "boolean"
  12856. },
  12857. "ignored": {
  12858. "type": "boolean"
  12859. },
  12860. "time": {
  12861. "type": "object",
  12862. "properties": {
  12863. "start": {
  12864. "type": "integer",
  12865. "minimum": 0,
  12866. "maximum": 9007199254740991
  12867. },
  12868. "end": {
  12869. "type": "integer",
  12870. "minimum": 0,
  12871. "maximum": 9007199254740991
  12872. }
  12873. },
  12874. "required": ["start"]
  12875. },
  12876. "metadata": {
  12877. "type": "object",
  12878. "propertyNames": {
  12879. "type": "string"
  12880. },
  12881. "additionalProperties": {}
  12882. }
  12883. },
  12884. "required": ["type", "text"]
  12885. },
  12886. "FilePartInput": {
  12887. "type": "object",
  12888. "properties": {
  12889. "id": {
  12890. "type": "string",
  12891. "pattern": "^prt.*"
  12892. },
  12893. "type": {
  12894. "type": "string",
  12895. "const": "file"
  12896. },
  12897. "mime": {
  12898. "type": "string"
  12899. },
  12900. "filename": {
  12901. "type": "string"
  12902. },
  12903. "url": {
  12904. "type": "string"
  12905. },
  12906. "source": {
  12907. "$ref": "#/components/schemas/FilePartSource"
  12908. }
  12909. },
  12910. "required": ["type", "mime", "url"]
  12911. },
  12912. "AgentPartInput": {
  12913. "type": "object",
  12914. "properties": {
  12915. "id": {
  12916. "type": "string",
  12917. "pattern": "^prt.*"
  12918. },
  12919. "type": {
  12920. "type": "string",
  12921. "const": "agent"
  12922. },
  12923. "name": {
  12924. "type": "string"
  12925. },
  12926. "source": {
  12927. "type": "object",
  12928. "properties": {
  12929. "value": {
  12930. "type": "string"
  12931. },
  12932. "start": {
  12933. "type": "integer",
  12934. "minimum": 0,
  12935. "maximum": 9007199254740991
  12936. },
  12937. "end": {
  12938. "type": "integer",
  12939. "minimum": 0,
  12940. "maximum": 9007199254740991
  12941. }
  12942. },
  12943. "required": ["value", "start", "end"]
  12944. }
  12945. },
  12946. "required": ["type", "name"]
  12947. },
  12948. "SubtaskPartInput": {
  12949. "type": "object",
  12950. "properties": {
  12951. "id": {
  12952. "type": "string",
  12953. "pattern": "^prt.*"
  12954. },
  12955. "type": {
  12956. "type": "string",
  12957. "const": "subtask"
  12958. },
  12959. "prompt": {
  12960. "type": "string"
  12961. },
  12962. "description": {
  12963. "type": "string"
  12964. },
  12965. "agent": {
  12966. "type": "string"
  12967. },
  12968. "model": {
  12969. "type": "object",
  12970. "properties": {
  12971. "providerID": {
  12972. "type": "string"
  12973. },
  12974. "modelID": {
  12975. "type": "string"
  12976. }
  12977. },
  12978. "required": ["providerID", "modelID"]
  12979. },
  12980. "command": {
  12981. "type": "string"
  12982. }
  12983. },
  12984. "required": ["type", "prompt", "description", "agent"]
  12985. },
  12986. "ProviderAuthMethod": {
  12987. "type": "object",
  12988. "properties": {
  12989. "type": {
  12990. "type": "string",
  12991. "enum": ["oauth", "api"]
  12992. },
  12993. "label": {
  12994. "type": "string"
  12995. },
  12996. "prompts": {
  12997. "type": "array",
  12998. "items": {
  12999. "anyOf": [
  13000. {
  13001. "type": "object",
  13002. "properties": {
  13003. "type": {
  13004. "type": "string",
  13005. "const": "text"
  13006. },
  13007. "key": {
  13008. "type": "string"
  13009. },
  13010. "message": {
  13011. "type": "string"
  13012. },
  13013. "placeholder": {
  13014. "type": "string"
  13015. },
  13016. "when": {
  13017. "type": "object",
  13018. "properties": {
  13019. "key": {
  13020. "type": "string"
  13021. },
  13022. "op": {
  13023. "type": "string",
  13024. "enum": ["eq", "neq"]
  13025. },
  13026. "value": {
  13027. "type": "string"
  13028. }
  13029. },
  13030. "required": ["key", "op", "value"]
  13031. }
  13032. },
  13033. "required": ["type", "key", "message"]
  13034. },
  13035. {
  13036. "type": "object",
  13037. "properties": {
  13038. "type": {
  13039. "type": "string",
  13040. "const": "select"
  13041. },
  13042. "key": {
  13043. "type": "string"
  13044. },
  13045. "message": {
  13046. "type": "string"
  13047. },
  13048. "options": {
  13049. "type": "array",
  13050. "items": {
  13051. "type": "object",
  13052. "properties": {
  13053. "label": {
  13054. "type": "string"
  13055. },
  13056. "value": {
  13057. "type": "string"
  13058. },
  13059. "hint": {
  13060. "type": "string"
  13061. }
  13062. },
  13063. "required": ["label", "value"]
  13064. }
  13065. },
  13066. "when": {
  13067. "type": "object",
  13068. "properties": {
  13069. "key": {
  13070. "type": "string"
  13071. },
  13072. "op": {
  13073. "type": "string",
  13074. "enum": ["eq", "neq"]
  13075. },
  13076. "value": {
  13077. "type": "string"
  13078. }
  13079. },
  13080. "required": ["key", "op", "value"]
  13081. }
  13082. },
  13083. "required": ["type", "key", "message", "options"]
  13084. }
  13085. ]
  13086. }
  13087. }
  13088. },
  13089. "required": ["type", "label"]
  13090. },
  13091. "ProviderAuthAuthorization": {
  13092. "type": "object",
  13093. "properties": {
  13094. "url": {
  13095. "type": "string"
  13096. },
  13097. "method": {
  13098. "type": "string",
  13099. "enum": ["auto", "code"]
  13100. },
  13101. "instructions": {
  13102. "type": "string"
  13103. }
  13104. },
  13105. "required": ["url", "method", "instructions"]
  13106. },
  13107. "Symbol": {
  13108. "type": "object",
  13109. "properties": {
  13110. "name": {
  13111. "type": "string"
  13112. },
  13113. "kind": {
  13114. "type": "integer",
  13115. "minimum": 0,
  13116. "maximum": 9007199254740991
  13117. },
  13118. "location": {
  13119. "type": "object",
  13120. "properties": {
  13121. "uri": {
  13122. "type": "string"
  13123. },
  13124. "range": {
  13125. "$ref": "#/components/schemas/Range"
  13126. }
  13127. },
  13128. "required": ["uri", "range"]
  13129. }
  13130. },
  13131. "required": ["name", "kind", "location"]
  13132. },
  13133. "FileNode": {
  13134. "type": "object",
  13135. "properties": {
  13136. "name": {
  13137. "type": "string"
  13138. },
  13139. "path": {
  13140. "type": "string"
  13141. },
  13142. "absolute": {
  13143. "type": "string"
  13144. },
  13145. "type": {
  13146. "type": "string",
  13147. "enum": ["file", "directory"]
  13148. },
  13149. "ignored": {
  13150. "type": "boolean"
  13151. }
  13152. },
  13153. "required": ["name", "path", "absolute", "type", "ignored"]
  13154. },
  13155. "FileContent": {
  13156. "type": "object",
  13157. "properties": {
  13158. "type": {
  13159. "type": "string",
  13160. "enum": ["text", "binary"]
  13161. },
  13162. "content": {
  13163. "type": "string"
  13164. },
  13165. "diff": {
  13166. "type": "string"
  13167. },
  13168. "patch": {
  13169. "type": "object",
  13170. "properties": {
  13171. "oldFileName": {
  13172. "type": "string"
  13173. },
  13174. "newFileName": {
  13175. "type": "string"
  13176. },
  13177. "oldHeader": {
  13178. "type": "string"
  13179. },
  13180. "newHeader": {
  13181. "type": "string"
  13182. },
  13183. "hunks": {
  13184. "type": "array",
  13185. "items": {
  13186. "type": "object",
  13187. "properties": {
  13188. "oldStart": {
  13189. "type": "integer",
  13190. "minimum": 0,
  13191. "maximum": 9007199254740991
  13192. },
  13193. "oldLines": {
  13194. "type": "integer",
  13195. "minimum": 0,
  13196. "maximum": 9007199254740991
  13197. },
  13198. "newStart": {
  13199. "type": "integer",
  13200. "minimum": 0,
  13201. "maximum": 9007199254740991
  13202. },
  13203. "newLines": {
  13204. "type": "integer",
  13205. "minimum": 0,
  13206. "maximum": 9007199254740991
  13207. },
  13208. "lines": {
  13209. "type": "array",
  13210. "items": {
  13211. "type": "string"
  13212. }
  13213. }
  13214. },
  13215. "required": ["oldStart", "oldLines", "newStart", "newLines", "lines"]
  13216. }
  13217. },
  13218. "index": {
  13219. "type": "string"
  13220. }
  13221. },
  13222. "required": ["oldFileName", "newFileName", "hunks"]
  13223. },
  13224. "encoding": {
  13225. "type": "string",
  13226. "const": "base64"
  13227. },
  13228. "mimeType": {
  13229. "type": "string"
  13230. }
  13231. },
  13232. "required": ["type", "content"]
  13233. },
  13234. "File": {
  13235. "type": "object",
  13236. "properties": {
  13237. "path": {
  13238. "type": "string"
  13239. },
  13240. "added": {
  13241. "type": "integer",
  13242. "minimum": 0,
  13243. "maximum": 9007199254740991
  13244. },
  13245. "removed": {
  13246. "type": "integer",
  13247. "minimum": 0,
  13248. "maximum": 9007199254740991
  13249. },
  13250. "status": {
  13251. "type": "string",
  13252. "enum": ["added", "deleted", "modified"]
  13253. }
  13254. },
  13255. "required": ["path", "added", "removed", "status"]
  13256. },
  13257. "Event": {
  13258. "anyOf": [
  13259. {
  13260. "$ref": "#/components/schemas/Event.project.updated"
  13261. },
  13262. {
  13263. "$ref": "#/components/schemas/Event.server.instance.disposed"
  13264. },
  13265. {
  13266. "$ref": "#/components/schemas/Event.server.connected"
  13267. },
  13268. {
  13269. "$ref": "#/components/schemas/Event.global.disposed"
  13270. },
  13271. {
  13272. "$ref": "#/components/schemas/Event.file.edited"
  13273. },
  13274. {
  13275. "$ref": "#/components/schemas/Event.file.watcher.updated"
  13276. },
  13277. {
  13278. "$ref": "#/components/schemas/Event.lsp.client.diagnostics"
  13279. },
  13280. {
  13281. "$ref": "#/components/schemas/Event.lsp.updated"
  13282. },
  13283. {
  13284. "$ref": "#/components/schemas/Event.message.part.delta"
  13285. },
  13286. {
  13287. "$ref": "#/components/schemas/Event.permission.asked"
  13288. },
  13289. {
  13290. "$ref": "#/components/schemas/Event.permission.replied"
  13291. },
  13292. {
  13293. "$ref": "#/components/schemas/Event.session.diff"
  13294. },
  13295. {
  13296. "$ref": "#/components/schemas/Event.session.error"
  13297. },
  13298. {
  13299. "$ref": "#/components/schemas/Event.installation.updated"
  13300. },
  13301. {
  13302. "$ref": "#/components/schemas/Event.installation.update-available"
  13303. },
  13304. {
  13305. "$ref": "#/components/schemas/Event.question.asked"
  13306. },
  13307. {
  13308. "$ref": "#/components/schemas/Event.question.replied"
  13309. },
  13310. {
  13311. "$ref": "#/components/schemas/Event.question.rejected"
  13312. },
  13313. {
  13314. "$ref": "#/components/schemas/Event.todo.updated"
  13315. },
  13316. {
  13317. "$ref": "#/components/schemas/Event.session.status"
  13318. },
  13319. {
  13320. "$ref": "#/components/schemas/Event.session.idle"
  13321. },
  13322. {
  13323. "$ref": "#/components/schemas/Event.session.compacted"
  13324. },
  13325. {
  13326. "$ref": "#/components/schemas/Event.tui.prompt.append"
  13327. },
  13328. {
  13329. "$ref": "#/components/schemas/Event.tui.command.execute"
  13330. },
  13331. {
  13332. "$ref": "#/components/schemas/Event.tui.toast.show"
  13333. },
  13334. {
  13335. "$ref": "#/components/schemas/Event.tui.session.select"
  13336. },
  13337. {
  13338. "$ref": "#/components/schemas/Event.mcp.tools.changed"
  13339. },
  13340. {
  13341. "$ref": "#/components/schemas/Event.mcp.browser.open.failed"
  13342. },
  13343. {
  13344. "$ref": "#/components/schemas/Event.command.executed"
  13345. },
  13346. {
  13347. "$ref": "#/components/schemas/Event.vcs.branch.updated"
  13348. },
  13349. {
  13350. "$ref": "#/components/schemas/Event.worktree.ready"
  13351. },
  13352. {
  13353. "$ref": "#/components/schemas/Event.worktree.failed"
  13354. },
  13355. {
  13356. "$ref": "#/components/schemas/Event.pty.created"
  13357. },
  13358. {
  13359. "$ref": "#/components/schemas/Event.pty.updated"
  13360. },
  13361. {
  13362. "$ref": "#/components/schemas/Event.pty.exited"
  13363. },
  13364. {
  13365. "$ref": "#/components/schemas/Event.pty.deleted"
  13366. },
  13367. {
  13368. "$ref": "#/components/schemas/Event.workspace.ready"
  13369. },
  13370. {
  13371. "$ref": "#/components/schemas/Event.workspace.failed"
  13372. },
  13373. {
  13374. "$ref": "#/components/schemas/Event.workspace.restore"
  13375. },
  13376. {
  13377. "$ref": "#/components/schemas/Event.workspace.status"
  13378. },
  13379. {
  13380. "$ref": "#/components/schemas/Event.message.updated"
  13381. },
  13382. {
  13383. "$ref": "#/components/schemas/Event.message.removed"
  13384. },
  13385. {
  13386. "$ref": "#/components/schemas/Event.message.part.updated"
  13387. },
  13388. {
  13389. "$ref": "#/components/schemas/Event.message.part.removed"
  13390. },
  13391. {
  13392. "$ref": "#/components/schemas/Event.session.created"
  13393. },
  13394. {
  13395. "$ref": "#/components/schemas/Event.session.updated"
  13396. },
  13397. {
  13398. "$ref": "#/components/schemas/Event.session.deleted"
  13399. }
  13400. ]
  13401. },
  13402. "MCPStatusConnected": {
  13403. "type": "object",
  13404. "properties": {
  13405. "status": {
  13406. "type": "string",
  13407. "const": "connected"
  13408. }
  13409. },
  13410. "required": ["status"]
  13411. },
  13412. "MCPStatusDisabled": {
  13413. "type": "object",
  13414. "properties": {
  13415. "status": {
  13416. "type": "string",
  13417. "const": "disabled"
  13418. }
  13419. },
  13420. "required": ["status"]
  13421. },
  13422. "MCPStatusFailed": {
  13423. "type": "object",
  13424. "properties": {
  13425. "status": {
  13426. "type": "string",
  13427. "const": "failed"
  13428. },
  13429. "error": {
  13430. "type": "string"
  13431. }
  13432. },
  13433. "required": ["status", "error"]
  13434. },
  13435. "MCPStatusNeedsAuth": {
  13436. "type": "object",
  13437. "properties": {
  13438. "status": {
  13439. "type": "string",
  13440. "const": "needs_auth"
  13441. }
  13442. },
  13443. "required": ["status"]
  13444. },
  13445. "MCPStatusNeedsClientRegistration": {
  13446. "type": "object",
  13447. "properties": {
  13448. "status": {
  13449. "type": "string",
  13450. "const": "needs_client_registration"
  13451. },
  13452. "error": {
  13453. "type": "string"
  13454. }
  13455. },
  13456. "required": ["status", "error"]
  13457. },
  13458. "MCPStatus": {
  13459. "anyOf": [
  13460. {
  13461. "$ref": "#/components/schemas/MCPStatusConnected"
  13462. },
  13463. {
  13464. "$ref": "#/components/schemas/MCPStatusDisabled"
  13465. },
  13466. {
  13467. "$ref": "#/components/schemas/MCPStatusFailed"
  13468. },
  13469. {
  13470. "$ref": "#/components/schemas/MCPStatusNeedsAuth"
  13471. },
  13472. {
  13473. "$ref": "#/components/schemas/MCPStatusNeedsClientRegistration"
  13474. }
  13475. ]
  13476. },
  13477. "McpUnsupportedOAuthError": {
  13478. "type": "object",
  13479. "properties": {
  13480. "error": {
  13481. "type": "string"
  13482. }
  13483. },
  13484. "required": ["error"]
  13485. },
  13486. "Path": {
  13487. "type": "object",
  13488. "properties": {
  13489. "home": {
  13490. "type": "string"
  13491. },
  13492. "state": {
  13493. "type": "string"
  13494. },
  13495. "config": {
  13496. "type": "string"
  13497. },
  13498. "worktree": {
  13499. "type": "string"
  13500. },
  13501. "directory": {
  13502. "type": "string"
  13503. }
  13504. },
  13505. "required": ["home", "state", "config", "worktree", "directory"]
  13506. },
  13507. "VcsInfo": {
  13508. "type": "object",
  13509. "properties": {
  13510. "branch": {
  13511. "type": "string"
  13512. },
  13513. "default_branch": {
  13514. "type": "string"
  13515. }
  13516. }
  13517. },
  13518. "VcsFileDiff": {
  13519. "type": "object",
  13520. "properties": {
  13521. "file": {
  13522. "type": "string"
  13523. },
  13524. "patch": {
  13525. "type": "string"
  13526. },
  13527. "additions": {
  13528. "type": "integer",
  13529. "minimum": 0,
  13530. "maximum": 9007199254740991
  13531. },
  13532. "deletions": {
  13533. "type": "integer",
  13534. "minimum": 0,
  13535. "maximum": 9007199254740991
  13536. },
  13537. "status": {
  13538. "type": "string",
  13539. "enum": ["added", "deleted", "modified"]
  13540. }
  13541. },
  13542. "required": ["file", "patch", "additions", "deletions"]
  13543. },
  13544. "Command": {
  13545. "type": "object",
  13546. "properties": {
  13547. "name": {
  13548. "type": "string"
  13549. },
  13550. "description": {
  13551. "type": "string"
  13552. },
  13553. "agent": {
  13554. "type": "string"
  13555. },
  13556. "model": {
  13557. "type": "string"
  13558. },
  13559. "source": {
  13560. "type": "string",
  13561. "enum": ["command", "mcp", "skill"]
  13562. },
  13563. "template": {
  13564. "anyOf": [
  13565. {
  13566. "type": "string"
  13567. },
  13568. {
  13569. "type": "string"
  13570. }
  13571. ]
  13572. },
  13573. "subtask": {
  13574. "type": "boolean"
  13575. },
  13576. "hints": {
  13577. "type": "array",
  13578. "items": {
  13579. "type": "string"
  13580. }
  13581. }
  13582. },
  13583. "required": ["name", "template", "hints"]
  13584. },
  13585. "Agent": {
  13586. "type": "object",
  13587. "properties": {
  13588. "name": {
  13589. "type": "string"
  13590. },
  13591. "description": {
  13592. "type": "string"
  13593. },
  13594. "mode": {
  13595. "type": "string",
  13596. "enum": ["subagent", "primary", "all"]
  13597. },
  13598. "native": {
  13599. "type": "boolean"
  13600. },
  13601. "hidden": {
  13602. "type": "boolean"
  13603. },
  13604. "topP": {
  13605. "type": "number"
  13606. },
  13607. "temperature": {
  13608. "type": "number"
  13609. },
  13610. "color": {
  13611. "type": "string"
  13612. },
  13613. "permission": {
  13614. "$ref": "#/components/schemas/PermissionRuleset"
  13615. },
  13616. "model": {
  13617. "type": "object",
  13618. "properties": {
  13619. "modelID": {
  13620. "type": "string"
  13621. },
  13622. "providerID": {
  13623. "type": "string"
  13624. }
  13625. },
  13626. "required": ["modelID", "providerID"]
  13627. },
  13628. "variant": {
  13629. "type": "string"
  13630. },
  13631. "prompt": {
  13632. "type": "string"
  13633. },
  13634. "options": {
  13635. "type": "object",
  13636. "propertyNames": {
  13637. "type": "string"
  13638. },
  13639. "additionalProperties": {}
  13640. },
  13641. "steps": {
  13642. "type": "number"
  13643. }
  13644. },
  13645. "required": ["name", "mode", "permission", "options"]
  13646. },
  13647. "LSPStatus": {
  13648. "type": "object",
  13649. "properties": {
  13650. "id": {
  13651. "type": "string"
  13652. },
  13653. "name": {
  13654. "type": "string"
  13655. },
  13656. "root": {
  13657. "type": "string"
  13658. },
  13659. "status": {
  13660. "anyOf": [
  13661. {
  13662. "type": "string",
  13663. "const": "connected"
  13664. },
  13665. {
  13666. "type": "string",
  13667. "const": "error"
  13668. }
  13669. ]
  13670. }
  13671. },
  13672. "required": ["id", "name", "root", "status"]
  13673. },
  13674. "FormatterStatus": {
  13675. "type": "object",
  13676. "properties": {
  13677. "name": {
  13678. "type": "string"
  13679. },
  13680. "extensions": {
  13681. "type": "array",
  13682. "items": {
  13683. "type": "string"
  13684. }
  13685. },
  13686. "enabled": {
  13687. "type": "boolean"
  13688. }
  13689. },
  13690. "required": ["name", "extensions", "enabled"]
  13691. }
  13692. }
  13693. }
  13694. }