openapi.json 354 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088
  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. "/project": {
  419. "get": {
  420. "operationId": "project.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 all projects",
  438. "description": "Get a list of projects that have been opened with OpenCode.",
  439. "responses": {
  440. "200": {
  441. "description": "List of projects",
  442. "content": {
  443. "application/json": {
  444. "schema": {
  445. "type": "array",
  446. "items": {
  447. "$ref": "#/components/schemas/Project"
  448. }
  449. }
  450. }
  451. }
  452. }
  453. },
  454. "x-codeSamples": [
  455. {
  456. "lang": "js",
  457. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.list({\n ...\n})"
  458. }
  459. ]
  460. }
  461. },
  462. "/project/current": {
  463. "get": {
  464. "operationId": "project.current",
  465. "parameters": [
  466. {
  467. "in": "query",
  468. "name": "directory",
  469. "schema": {
  470. "type": "string"
  471. }
  472. },
  473. {
  474. "in": "query",
  475. "name": "workspace",
  476. "schema": {
  477. "type": "string"
  478. }
  479. }
  480. ],
  481. "summary": "Get current project",
  482. "description": "Retrieve the currently active project that OpenCode is working with.",
  483. "responses": {
  484. "200": {
  485. "description": "Current project information",
  486. "content": {
  487. "application/json": {
  488. "schema": {
  489. "$ref": "#/components/schemas/Project"
  490. }
  491. }
  492. }
  493. }
  494. },
  495. "x-codeSamples": [
  496. {
  497. "lang": "js",
  498. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.current({\n ...\n})"
  499. }
  500. ]
  501. }
  502. },
  503. "/project/git/init": {
  504. "post": {
  505. "operationId": "project.initGit",
  506. "parameters": [
  507. {
  508. "in": "query",
  509. "name": "directory",
  510. "schema": {
  511. "type": "string"
  512. }
  513. },
  514. {
  515. "in": "query",
  516. "name": "workspace",
  517. "schema": {
  518. "type": "string"
  519. }
  520. }
  521. ],
  522. "summary": "Initialize git repository",
  523. "description": "Create a git repository for the current project and return the refreshed project info.",
  524. "responses": {
  525. "200": {
  526. "description": "Project information after git initialization",
  527. "content": {
  528. "application/json": {
  529. "schema": {
  530. "$ref": "#/components/schemas/Project"
  531. }
  532. }
  533. }
  534. }
  535. },
  536. "x-codeSamples": [
  537. {
  538. "lang": "js",
  539. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.initGit({\n ...\n})"
  540. }
  541. ]
  542. }
  543. },
  544. "/project/{projectID}": {
  545. "patch": {
  546. "operationId": "project.update",
  547. "parameters": [
  548. {
  549. "in": "query",
  550. "name": "directory",
  551. "schema": {
  552. "type": "string"
  553. }
  554. },
  555. {
  556. "in": "query",
  557. "name": "workspace",
  558. "schema": {
  559. "type": "string"
  560. }
  561. },
  562. {
  563. "in": "path",
  564. "name": "projectID",
  565. "schema": {
  566. "type": "string"
  567. },
  568. "required": true
  569. }
  570. ],
  571. "summary": "Update project",
  572. "description": "Update project properties such as name, icon, and commands.",
  573. "responses": {
  574. "200": {
  575. "description": "Updated project information",
  576. "content": {
  577. "application/json": {
  578. "schema": {
  579. "$ref": "#/components/schemas/Project"
  580. }
  581. }
  582. }
  583. },
  584. "400": {
  585. "description": "Bad request",
  586. "content": {
  587. "application/json": {
  588. "schema": {
  589. "$ref": "#/components/schemas/BadRequestError"
  590. }
  591. }
  592. }
  593. },
  594. "404": {
  595. "description": "Not found",
  596. "content": {
  597. "application/json": {
  598. "schema": {
  599. "$ref": "#/components/schemas/NotFoundError"
  600. }
  601. }
  602. }
  603. }
  604. },
  605. "requestBody": {
  606. "content": {
  607. "application/json": {
  608. "schema": {
  609. "type": "object",
  610. "properties": {
  611. "name": {
  612. "type": "string"
  613. },
  614. "icon": {
  615. "type": "object",
  616. "properties": {
  617. "url": {
  618. "type": "string"
  619. },
  620. "override": {
  621. "type": "string"
  622. },
  623. "color": {
  624. "type": "string"
  625. }
  626. }
  627. },
  628. "commands": {
  629. "type": "object",
  630. "properties": {
  631. "start": {
  632. "description": "Startup script to run when creating a new workspace (worktree)",
  633. "type": "string"
  634. }
  635. }
  636. }
  637. }
  638. }
  639. }
  640. }
  641. },
  642. "x-codeSamples": [
  643. {
  644. "lang": "js",
  645. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.update({\n ...\n})"
  646. }
  647. ]
  648. }
  649. },
  650. "/pty": {
  651. "get": {
  652. "operationId": "pty.list",
  653. "parameters": [
  654. {
  655. "in": "query",
  656. "name": "directory",
  657. "schema": {
  658. "type": "string"
  659. }
  660. },
  661. {
  662. "in": "query",
  663. "name": "workspace",
  664. "schema": {
  665. "type": "string"
  666. }
  667. }
  668. ],
  669. "summary": "List PTY sessions",
  670. "description": "Get a list of all active pseudo-terminal (PTY) sessions managed by OpenCode.",
  671. "responses": {
  672. "200": {
  673. "description": "List of sessions",
  674. "content": {
  675. "application/json": {
  676. "schema": {
  677. "type": "array",
  678. "items": {
  679. "$ref": "#/components/schemas/Pty"
  680. }
  681. }
  682. }
  683. }
  684. }
  685. },
  686. "x-codeSamples": [
  687. {
  688. "lang": "js",
  689. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.list({\n ...\n})"
  690. }
  691. ]
  692. },
  693. "post": {
  694. "operationId": "pty.create",
  695. "parameters": [
  696. {
  697. "in": "query",
  698. "name": "directory",
  699. "schema": {
  700. "type": "string"
  701. }
  702. },
  703. {
  704. "in": "query",
  705. "name": "workspace",
  706. "schema": {
  707. "type": "string"
  708. }
  709. }
  710. ],
  711. "summary": "Create PTY session",
  712. "description": "Create a new pseudo-terminal (PTY) session for running shell commands and processes.",
  713. "responses": {
  714. "200": {
  715. "description": "Created session",
  716. "content": {
  717. "application/json": {
  718. "schema": {
  719. "$ref": "#/components/schemas/Pty"
  720. }
  721. }
  722. }
  723. },
  724. "400": {
  725. "description": "Bad request",
  726. "content": {
  727. "application/json": {
  728. "schema": {
  729. "$ref": "#/components/schemas/BadRequestError"
  730. }
  731. }
  732. }
  733. }
  734. },
  735. "requestBody": {
  736. "content": {
  737. "application/json": {
  738. "schema": {
  739. "type": "object",
  740. "properties": {
  741. "command": {
  742. "type": "string"
  743. },
  744. "args": {
  745. "type": "array",
  746. "items": {
  747. "type": "string"
  748. }
  749. },
  750. "cwd": {
  751. "type": "string"
  752. },
  753. "title": {
  754. "type": "string"
  755. },
  756. "env": {
  757. "type": "object",
  758. "propertyNames": {
  759. "type": "string"
  760. },
  761. "additionalProperties": {
  762. "type": "string"
  763. }
  764. }
  765. }
  766. }
  767. }
  768. }
  769. },
  770. "x-codeSamples": [
  771. {
  772. "lang": "js",
  773. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.create({\n ...\n})"
  774. }
  775. ]
  776. }
  777. },
  778. "/pty/{ptyID}": {
  779. "get": {
  780. "operationId": "pty.get",
  781. "parameters": [
  782. {
  783. "in": "query",
  784. "name": "directory",
  785. "schema": {
  786. "type": "string"
  787. }
  788. },
  789. {
  790. "in": "query",
  791. "name": "workspace",
  792. "schema": {
  793. "type": "string"
  794. }
  795. },
  796. {
  797. "in": "path",
  798. "name": "ptyID",
  799. "schema": {
  800. "type": "string",
  801. "pattern": "^pty.*"
  802. },
  803. "required": true
  804. }
  805. ],
  806. "summary": "Get PTY session",
  807. "description": "Retrieve detailed information about a specific pseudo-terminal (PTY) session.",
  808. "responses": {
  809. "200": {
  810. "description": "Session info",
  811. "content": {
  812. "application/json": {
  813. "schema": {
  814. "$ref": "#/components/schemas/Pty"
  815. }
  816. }
  817. }
  818. },
  819. "404": {
  820. "description": "Not found",
  821. "content": {
  822. "application/json": {
  823. "schema": {
  824. "$ref": "#/components/schemas/NotFoundError"
  825. }
  826. }
  827. }
  828. }
  829. },
  830. "x-codeSamples": [
  831. {
  832. "lang": "js",
  833. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.get({\n ...\n})"
  834. }
  835. ]
  836. },
  837. "put": {
  838. "operationId": "pty.update",
  839. "parameters": [
  840. {
  841. "in": "query",
  842. "name": "directory",
  843. "schema": {
  844. "type": "string"
  845. }
  846. },
  847. {
  848. "in": "query",
  849. "name": "workspace",
  850. "schema": {
  851. "type": "string"
  852. }
  853. },
  854. {
  855. "in": "path",
  856. "name": "ptyID",
  857. "schema": {
  858. "type": "string",
  859. "pattern": "^pty.*"
  860. },
  861. "required": true
  862. }
  863. ],
  864. "summary": "Update PTY session",
  865. "description": "Update properties of an existing pseudo-terminal (PTY) session.",
  866. "responses": {
  867. "200": {
  868. "description": "Updated session",
  869. "content": {
  870. "application/json": {
  871. "schema": {
  872. "$ref": "#/components/schemas/Pty"
  873. }
  874. }
  875. }
  876. },
  877. "400": {
  878. "description": "Bad request",
  879. "content": {
  880. "application/json": {
  881. "schema": {
  882. "$ref": "#/components/schemas/BadRequestError"
  883. }
  884. }
  885. }
  886. }
  887. },
  888. "requestBody": {
  889. "content": {
  890. "application/json": {
  891. "schema": {
  892. "type": "object",
  893. "properties": {
  894. "title": {
  895. "type": "string"
  896. },
  897. "size": {
  898. "type": "object",
  899. "properties": {
  900. "rows": {
  901. "type": "number"
  902. },
  903. "cols": {
  904. "type": "number"
  905. }
  906. },
  907. "required": ["rows", "cols"]
  908. }
  909. }
  910. }
  911. }
  912. }
  913. },
  914. "x-codeSamples": [
  915. {
  916. "lang": "js",
  917. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.update({\n ...\n})"
  918. }
  919. ]
  920. },
  921. "delete": {
  922. "operationId": "pty.remove",
  923. "parameters": [
  924. {
  925. "in": "query",
  926. "name": "directory",
  927. "schema": {
  928. "type": "string"
  929. }
  930. },
  931. {
  932. "in": "query",
  933. "name": "workspace",
  934. "schema": {
  935. "type": "string"
  936. }
  937. },
  938. {
  939. "in": "path",
  940. "name": "ptyID",
  941. "schema": {
  942. "type": "string",
  943. "pattern": "^pty.*"
  944. },
  945. "required": true
  946. }
  947. ],
  948. "summary": "Remove PTY session",
  949. "description": "Remove and terminate a specific pseudo-terminal (PTY) session.",
  950. "responses": {
  951. "200": {
  952. "description": "Session removed",
  953. "content": {
  954. "application/json": {
  955. "schema": {
  956. "type": "boolean"
  957. }
  958. }
  959. }
  960. },
  961. "404": {
  962. "description": "Not found",
  963. "content": {
  964. "application/json": {
  965. "schema": {
  966. "$ref": "#/components/schemas/NotFoundError"
  967. }
  968. }
  969. }
  970. }
  971. },
  972. "x-codeSamples": [
  973. {
  974. "lang": "js",
  975. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.remove({\n ...\n})"
  976. }
  977. ]
  978. }
  979. },
  980. "/pty/{ptyID}/connect": {
  981. "get": {
  982. "operationId": "pty.connect",
  983. "parameters": [
  984. {
  985. "in": "query",
  986. "name": "directory",
  987. "schema": {
  988. "type": "string"
  989. }
  990. },
  991. {
  992. "in": "query",
  993. "name": "workspace",
  994. "schema": {
  995. "type": "string"
  996. }
  997. },
  998. {
  999. "in": "path",
  1000. "name": "ptyID",
  1001. "schema": {
  1002. "type": "string",
  1003. "pattern": "^pty.*"
  1004. },
  1005. "required": true
  1006. }
  1007. ],
  1008. "summary": "Connect to PTY session",
  1009. "description": "Establish a WebSocket connection to interact with a pseudo-terminal (PTY) session in real-time.",
  1010. "responses": {
  1011. "200": {
  1012. "description": "Connected session",
  1013. "content": {
  1014. "application/json": {
  1015. "schema": {
  1016. "type": "boolean"
  1017. }
  1018. }
  1019. }
  1020. },
  1021. "404": {
  1022. "description": "Not found",
  1023. "content": {
  1024. "application/json": {
  1025. "schema": {
  1026. "$ref": "#/components/schemas/NotFoundError"
  1027. }
  1028. }
  1029. }
  1030. }
  1031. },
  1032. "x-codeSamples": [
  1033. {
  1034. "lang": "js",
  1035. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.connect({\n ...\n})"
  1036. }
  1037. ]
  1038. }
  1039. },
  1040. "/config": {
  1041. "get": {
  1042. "operationId": "config.get",
  1043. "parameters": [
  1044. {
  1045. "in": "query",
  1046. "name": "directory",
  1047. "schema": {
  1048. "type": "string"
  1049. }
  1050. },
  1051. {
  1052. "in": "query",
  1053. "name": "workspace",
  1054. "schema": {
  1055. "type": "string"
  1056. }
  1057. }
  1058. ],
  1059. "summary": "Get configuration",
  1060. "description": "Retrieve the current OpenCode configuration settings and preferences.",
  1061. "responses": {
  1062. "200": {
  1063. "description": "Get config info",
  1064. "content": {
  1065. "application/json": {
  1066. "schema": {
  1067. "$ref": "#/components/schemas/Config"
  1068. }
  1069. }
  1070. }
  1071. }
  1072. },
  1073. "x-codeSamples": [
  1074. {
  1075. "lang": "js",
  1076. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.config.get({\n ...\n})"
  1077. }
  1078. ]
  1079. },
  1080. "patch": {
  1081. "operationId": "config.update",
  1082. "parameters": [
  1083. {
  1084. "in": "query",
  1085. "name": "directory",
  1086. "schema": {
  1087. "type": "string"
  1088. }
  1089. },
  1090. {
  1091. "in": "query",
  1092. "name": "workspace",
  1093. "schema": {
  1094. "type": "string"
  1095. }
  1096. }
  1097. ],
  1098. "summary": "Update configuration",
  1099. "description": "Update OpenCode configuration settings and preferences.",
  1100. "responses": {
  1101. "200": {
  1102. "description": "Successfully updated config",
  1103. "content": {
  1104. "application/json": {
  1105. "schema": {
  1106. "$ref": "#/components/schemas/Config"
  1107. }
  1108. }
  1109. }
  1110. },
  1111. "400": {
  1112. "description": "Bad request",
  1113. "content": {
  1114. "application/json": {
  1115. "schema": {
  1116. "$ref": "#/components/schemas/BadRequestError"
  1117. }
  1118. }
  1119. }
  1120. }
  1121. },
  1122. "requestBody": {
  1123. "content": {
  1124. "application/json": {
  1125. "schema": {
  1126. "$ref": "#/components/schemas/Config"
  1127. }
  1128. }
  1129. }
  1130. },
  1131. "x-codeSamples": [
  1132. {
  1133. "lang": "js",
  1134. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.config.update({\n ...\n})"
  1135. }
  1136. ]
  1137. }
  1138. },
  1139. "/config/providers": {
  1140. "get": {
  1141. "operationId": "config.providers",
  1142. "parameters": [
  1143. {
  1144. "in": "query",
  1145. "name": "directory",
  1146. "schema": {
  1147. "type": "string"
  1148. }
  1149. },
  1150. {
  1151. "in": "query",
  1152. "name": "workspace",
  1153. "schema": {
  1154. "type": "string"
  1155. }
  1156. }
  1157. ],
  1158. "summary": "List config providers",
  1159. "description": "Get a list of all configured AI providers and their default models.",
  1160. "responses": {
  1161. "200": {
  1162. "description": "List of providers",
  1163. "content": {
  1164. "application/json": {
  1165. "schema": {
  1166. "type": "object",
  1167. "properties": {
  1168. "providers": {
  1169. "type": "array",
  1170. "items": {
  1171. "$ref": "#/components/schemas/Provider"
  1172. }
  1173. },
  1174. "default": {
  1175. "type": "object",
  1176. "propertyNames": {
  1177. "type": "string"
  1178. },
  1179. "additionalProperties": {
  1180. "type": "string"
  1181. }
  1182. }
  1183. },
  1184. "required": ["providers", "default"]
  1185. }
  1186. }
  1187. }
  1188. }
  1189. },
  1190. "x-codeSamples": [
  1191. {
  1192. "lang": "js",
  1193. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.config.providers({\n ...\n})"
  1194. }
  1195. ]
  1196. }
  1197. },
  1198. "/experimental/console": {
  1199. "get": {
  1200. "operationId": "experimental.console.get",
  1201. "parameters": [
  1202. {
  1203. "in": "query",
  1204. "name": "directory",
  1205. "schema": {
  1206. "type": "string"
  1207. }
  1208. },
  1209. {
  1210. "in": "query",
  1211. "name": "workspace",
  1212. "schema": {
  1213. "type": "string"
  1214. }
  1215. }
  1216. ],
  1217. "summary": "Get active Console provider metadata",
  1218. "description": "Get the active Console org name and the set of provider IDs managed by that Console org.",
  1219. "responses": {
  1220. "200": {
  1221. "description": "Active Console provider metadata",
  1222. "content": {
  1223. "application/json": {
  1224. "schema": {
  1225. "type": "object",
  1226. "properties": {
  1227. "consoleManagedProviders": {
  1228. "type": "array",
  1229. "items": {
  1230. "type": "string"
  1231. }
  1232. },
  1233. "activeOrgName": {
  1234. "type": "string"
  1235. },
  1236. "switchableOrgCount": {
  1237. "type": "integer",
  1238. "minimum": 0,
  1239. "maximum": 9007199254740991
  1240. }
  1241. },
  1242. "required": ["consoleManagedProviders", "switchableOrgCount"]
  1243. }
  1244. }
  1245. }
  1246. }
  1247. },
  1248. "x-codeSamples": [
  1249. {
  1250. "lang": "js",
  1251. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.console.get({\n ...\n})"
  1252. }
  1253. ]
  1254. }
  1255. },
  1256. "/experimental/console/orgs": {
  1257. "get": {
  1258. "operationId": "experimental.console.listOrgs",
  1259. "parameters": [
  1260. {
  1261. "in": "query",
  1262. "name": "directory",
  1263. "schema": {
  1264. "type": "string"
  1265. }
  1266. },
  1267. {
  1268. "in": "query",
  1269. "name": "workspace",
  1270. "schema": {
  1271. "type": "string"
  1272. }
  1273. }
  1274. ],
  1275. "summary": "List switchable Console orgs",
  1276. "description": "Get the available Console orgs across logged-in accounts, including the current active org.",
  1277. "responses": {
  1278. "200": {
  1279. "description": "Switchable Console orgs",
  1280. "content": {
  1281. "application/json": {
  1282. "schema": {
  1283. "type": "object",
  1284. "properties": {
  1285. "orgs": {
  1286. "type": "array",
  1287. "items": {
  1288. "type": "object",
  1289. "properties": {
  1290. "accountID": {
  1291. "type": "string"
  1292. },
  1293. "accountEmail": {
  1294. "type": "string"
  1295. },
  1296. "accountUrl": {
  1297. "type": "string"
  1298. },
  1299. "orgID": {
  1300. "type": "string"
  1301. },
  1302. "orgName": {
  1303. "type": "string"
  1304. },
  1305. "active": {
  1306. "type": "boolean"
  1307. }
  1308. },
  1309. "required": ["accountID", "accountEmail", "accountUrl", "orgID", "orgName", "active"]
  1310. }
  1311. }
  1312. },
  1313. "required": ["orgs"]
  1314. }
  1315. }
  1316. }
  1317. }
  1318. },
  1319. "x-codeSamples": [
  1320. {
  1321. "lang": "js",
  1322. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.console.listOrgs({\n ...\n})"
  1323. }
  1324. ]
  1325. }
  1326. },
  1327. "/experimental/console/switch": {
  1328. "post": {
  1329. "operationId": "experimental.console.switchOrg",
  1330. "parameters": [
  1331. {
  1332. "in": "query",
  1333. "name": "directory",
  1334. "schema": {
  1335. "type": "string"
  1336. }
  1337. },
  1338. {
  1339. "in": "query",
  1340. "name": "workspace",
  1341. "schema": {
  1342. "type": "string"
  1343. }
  1344. }
  1345. ],
  1346. "summary": "Switch active Console org",
  1347. "description": "Persist a new active Console account/org selection for the current local OpenCode state.",
  1348. "responses": {
  1349. "200": {
  1350. "description": "Switch success",
  1351. "content": {
  1352. "application/json": {
  1353. "schema": {
  1354. "type": "boolean"
  1355. }
  1356. }
  1357. }
  1358. }
  1359. },
  1360. "requestBody": {
  1361. "content": {
  1362. "application/json": {
  1363. "schema": {
  1364. "type": "object",
  1365. "properties": {
  1366. "accountID": {
  1367. "type": "string"
  1368. },
  1369. "orgID": {
  1370. "type": "string"
  1371. }
  1372. },
  1373. "required": ["accountID", "orgID"]
  1374. }
  1375. }
  1376. }
  1377. },
  1378. "x-codeSamples": [
  1379. {
  1380. "lang": "js",
  1381. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.console.switchOrg({\n ...\n})"
  1382. }
  1383. ]
  1384. }
  1385. },
  1386. "/experimental/tool/ids": {
  1387. "get": {
  1388. "operationId": "tool.ids",
  1389. "parameters": [
  1390. {
  1391. "in": "query",
  1392. "name": "directory",
  1393. "schema": {
  1394. "type": "string"
  1395. }
  1396. },
  1397. {
  1398. "in": "query",
  1399. "name": "workspace",
  1400. "schema": {
  1401. "type": "string"
  1402. }
  1403. }
  1404. ],
  1405. "summary": "List tool IDs",
  1406. "description": "Get a list of all available tool IDs, including both built-in tools and dynamically registered tools.",
  1407. "responses": {
  1408. "200": {
  1409. "description": "Tool IDs",
  1410. "content": {
  1411. "application/json": {
  1412. "schema": {
  1413. "$ref": "#/components/schemas/ToolIDs"
  1414. }
  1415. }
  1416. }
  1417. },
  1418. "400": {
  1419. "description": "Bad request",
  1420. "content": {
  1421. "application/json": {
  1422. "schema": {
  1423. "$ref": "#/components/schemas/BadRequestError"
  1424. }
  1425. }
  1426. }
  1427. }
  1428. },
  1429. "x-codeSamples": [
  1430. {
  1431. "lang": "js",
  1432. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tool.ids({\n ...\n})"
  1433. }
  1434. ]
  1435. }
  1436. },
  1437. "/experimental/tool": {
  1438. "get": {
  1439. "operationId": "tool.list",
  1440. "parameters": [
  1441. {
  1442. "in": "query",
  1443. "name": "directory",
  1444. "schema": {
  1445. "type": "string"
  1446. }
  1447. },
  1448. {
  1449. "in": "query",
  1450. "name": "workspace",
  1451. "schema": {
  1452. "type": "string"
  1453. }
  1454. },
  1455. {
  1456. "in": "query",
  1457. "name": "provider",
  1458. "schema": {
  1459. "type": "string"
  1460. },
  1461. "required": true
  1462. },
  1463. {
  1464. "in": "query",
  1465. "name": "model",
  1466. "schema": {
  1467. "type": "string"
  1468. },
  1469. "required": true
  1470. }
  1471. ],
  1472. "summary": "List tools",
  1473. "description": "Get a list of available tools with their JSON schema parameters for a specific provider and model combination.",
  1474. "responses": {
  1475. "200": {
  1476. "description": "Tools",
  1477. "content": {
  1478. "application/json": {
  1479. "schema": {
  1480. "$ref": "#/components/schemas/ToolList"
  1481. }
  1482. }
  1483. }
  1484. },
  1485. "400": {
  1486. "description": "Bad request",
  1487. "content": {
  1488. "application/json": {
  1489. "schema": {
  1490. "$ref": "#/components/schemas/BadRequestError"
  1491. }
  1492. }
  1493. }
  1494. }
  1495. },
  1496. "x-codeSamples": [
  1497. {
  1498. "lang": "js",
  1499. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tool.list({\n ...\n})"
  1500. }
  1501. ]
  1502. }
  1503. },
  1504. "/experimental/workspace/adaptor": {
  1505. "get": {
  1506. "operationId": "experimental.workspace.adaptor.list",
  1507. "parameters": [
  1508. {
  1509. "in": "query",
  1510. "name": "directory",
  1511. "schema": {
  1512. "type": "string"
  1513. }
  1514. },
  1515. {
  1516. "in": "query",
  1517. "name": "workspace",
  1518. "schema": {
  1519. "type": "string"
  1520. }
  1521. }
  1522. ],
  1523. "summary": "List workspace adaptors",
  1524. "description": "List all available workspace adaptors for the current project.",
  1525. "responses": {
  1526. "200": {
  1527. "description": "Workspace adaptors",
  1528. "content": {
  1529. "application/json": {
  1530. "schema": {
  1531. "type": "array",
  1532. "items": {
  1533. "type": "object",
  1534. "properties": {
  1535. "type": {
  1536. "type": "string"
  1537. },
  1538. "name": {
  1539. "type": "string"
  1540. },
  1541. "description": {
  1542. "type": "string"
  1543. }
  1544. },
  1545. "required": ["type", "name", "description"]
  1546. }
  1547. }
  1548. }
  1549. }
  1550. }
  1551. },
  1552. "x-codeSamples": [
  1553. {
  1554. "lang": "js",
  1555. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.adaptor.list({\n ...\n})"
  1556. }
  1557. ]
  1558. }
  1559. },
  1560. "/experimental/workspace": {
  1561. "post": {
  1562. "operationId": "experimental.workspace.create",
  1563. "parameters": [
  1564. {
  1565. "in": "query",
  1566. "name": "directory",
  1567. "schema": {
  1568. "type": "string"
  1569. }
  1570. },
  1571. {
  1572. "in": "query",
  1573. "name": "workspace",
  1574. "schema": {
  1575. "type": "string"
  1576. }
  1577. }
  1578. ],
  1579. "summary": "Create workspace",
  1580. "description": "Create a workspace for the current project.",
  1581. "responses": {
  1582. "200": {
  1583. "description": "Workspace created",
  1584. "content": {
  1585. "application/json": {
  1586. "schema": {
  1587. "$ref": "#/components/schemas/Workspace"
  1588. }
  1589. }
  1590. }
  1591. },
  1592. "400": {
  1593. "description": "Bad request",
  1594. "content": {
  1595. "application/json": {
  1596. "schema": {
  1597. "$ref": "#/components/schemas/BadRequestError"
  1598. }
  1599. }
  1600. }
  1601. }
  1602. },
  1603. "requestBody": {
  1604. "content": {
  1605. "application/json": {
  1606. "schema": {
  1607. "type": "object",
  1608. "properties": {
  1609. "id": {
  1610. "type": "string",
  1611. "pattern": "^wrk.*"
  1612. },
  1613. "type": {
  1614. "type": "string"
  1615. },
  1616. "branch": {
  1617. "anyOf": [
  1618. {
  1619. "type": "string"
  1620. },
  1621. {
  1622. "type": "null"
  1623. }
  1624. ]
  1625. },
  1626. "extra": {
  1627. "anyOf": [
  1628. {},
  1629. {
  1630. "type": "null"
  1631. }
  1632. ]
  1633. }
  1634. },
  1635. "required": ["type", "branch", "extra"]
  1636. }
  1637. }
  1638. }
  1639. },
  1640. "x-codeSamples": [
  1641. {
  1642. "lang": "js",
  1643. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.create({\n ...\n})"
  1644. }
  1645. ]
  1646. },
  1647. "get": {
  1648. "operationId": "experimental.workspace.list",
  1649. "parameters": [
  1650. {
  1651. "in": "query",
  1652. "name": "directory",
  1653. "schema": {
  1654. "type": "string"
  1655. }
  1656. },
  1657. {
  1658. "in": "query",
  1659. "name": "workspace",
  1660. "schema": {
  1661. "type": "string"
  1662. }
  1663. }
  1664. ],
  1665. "summary": "List workspaces",
  1666. "description": "List all workspaces.",
  1667. "responses": {
  1668. "200": {
  1669. "description": "Workspaces",
  1670. "content": {
  1671. "application/json": {
  1672. "schema": {
  1673. "type": "array",
  1674. "items": {
  1675. "$ref": "#/components/schemas/Workspace"
  1676. }
  1677. }
  1678. }
  1679. }
  1680. }
  1681. },
  1682. "x-codeSamples": [
  1683. {
  1684. "lang": "js",
  1685. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.list({\n ...\n})"
  1686. }
  1687. ]
  1688. }
  1689. },
  1690. "/experimental/workspace/status": {
  1691. "get": {
  1692. "operationId": "experimental.workspace.status",
  1693. "parameters": [
  1694. {
  1695. "in": "query",
  1696. "name": "directory",
  1697. "schema": {
  1698. "type": "string"
  1699. }
  1700. },
  1701. {
  1702. "in": "query",
  1703. "name": "workspace",
  1704. "schema": {
  1705. "type": "string"
  1706. }
  1707. }
  1708. ],
  1709. "summary": "Workspace status",
  1710. "description": "Get connection status for workspaces in the current project.",
  1711. "responses": {
  1712. "200": {
  1713. "description": "Workspace status",
  1714. "content": {
  1715. "application/json": {
  1716. "schema": {
  1717. "type": "array",
  1718. "items": {
  1719. "type": "object",
  1720. "properties": {
  1721. "workspaceID": {
  1722. "type": "string",
  1723. "pattern": "^wrk.*"
  1724. },
  1725. "status": {
  1726. "type": "string",
  1727. "enum": ["connected", "connecting", "disconnected", "error"]
  1728. },
  1729. "error": {
  1730. "type": "string"
  1731. }
  1732. },
  1733. "required": ["workspaceID", "status"]
  1734. }
  1735. }
  1736. }
  1737. }
  1738. }
  1739. },
  1740. "x-codeSamples": [
  1741. {
  1742. "lang": "js",
  1743. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.status({\n ...\n})"
  1744. }
  1745. ]
  1746. }
  1747. },
  1748. "/experimental/workspace/{id}": {
  1749. "delete": {
  1750. "operationId": "experimental.workspace.remove",
  1751. "parameters": [
  1752. {
  1753. "in": "query",
  1754. "name": "directory",
  1755. "schema": {
  1756. "type": "string"
  1757. }
  1758. },
  1759. {
  1760. "in": "query",
  1761. "name": "workspace",
  1762. "schema": {
  1763. "type": "string"
  1764. }
  1765. },
  1766. {
  1767. "in": "path",
  1768. "name": "id",
  1769. "schema": {
  1770. "type": "string",
  1771. "pattern": "^wrk.*"
  1772. },
  1773. "required": true
  1774. }
  1775. ],
  1776. "summary": "Remove workspace",
  1777. "description": "Remove an existing workspace.",
  1778. "responses": {
  1779. "200": {
  1780. "description": "Workspace removed",
  1781. "content": {
  1782. "application/json": {
  1783. "schema": {
  1784. "$ref": "#/components/schemas/Workspace"
  1785. }
  1786. }
  1787. }
  1788. },
  1789. "400": {
  1790. "description": "Bad request",
  1791. "content": {
  1792. "application/json": {
  1793. "schema": {
  1794. "$ref": "#/components/schemas/BadRequestError"
  1795. }
  1796. }
  1797. }
  1798. }
  1799. },
  1800. "x-codeSamples": [
  1801. {
  1802. "lang": "js",
  1803. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.remove({\n ...\n})"
  1804. }
  1805. ]
  1806. }
  1807. },
  1808. "/experimental/worktree": {
  1809. "post": {
  1810. "operationId": "worktree.create",
  1811. "parameters": [
  1812. {
  1813. "in": "query",
  1814. "name": "directory",
  1815. "schema": {
  1816. "type": "string"
  1817. }
  1818. },
  1819. {
  1820. "in": "query",
  1821. "name": "workspace",
  1822. "schema": {
  1823. "type": "string"
  1824. }
  1825. }
  1826. ],
  1827. "summary": "Create worktree",
  1828. "description": "Create a new git worktree for the current project and run any configured startup scripts.",
  1829. "responses": {
  1830. "200": {
  1831. "description": "Worktree created",
  1832. "content": {
  1833. "application/json": {
  1834. "schema": {
  1835. "$ref": "#/components/schemas/Worktree"
  1836. }
  1837. }
  1838. }
  1839. },
  1840. "400": {
  1841. "description": "Bad request",
  1842. "content": {
  1843. "application/json": {
  1844. "schema": {
  1845. "$ref": "#/components/schemas/BadRequestError"
  1846. }
  1847. }
  1848. }
  1849. }
  1850. },
  1851. "requestBody": {
  1852. "content": {
  1853. "application/json": {
  1854. "schema": {
  1855. "$ref": "#/components/schemas/WorktreeCreateInput"
  1856. }
  1857. }
  1858. }
  1859. },
  1860. "x-codeSamples": [
  1861. {
  1862. "lang": "js",
  1863. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.create({\n ...\n})"
  1864. }
  1865. ]
  1866. },
  1867. "get": {
  1868. "operationId": "worktree.list",
  1869. "parameters": [
  1870. {
  1871. "in": "query",
  1872. "name": "directory",
  1873. "schema": {
  1874. "type": "string"
  1875. }
  1876. },
  1877. {
  1878. "in": "query",
  1879. "name": "workspace",
  1880. "schema": {
  1881. "type": "string"
  1882. }
  1883. }
  1884. ],
  1885. "summary": "List worktrees",
  1886. "description": "List all sandbox worktrees for the current project.",
  1887. "responses": {
  1888. "200": {
  1889. "description": "List of worktree directories",
  1890. "content": {
  1891. "application/json": {
  1892. "schema": {
  1893. "type": "array",
  1894. "items": {
  1895. "type": "string"
  1896. }
  1897. }
  1898. }
  1899. }
  1900. }
  1901. },
  1902. "x-codeSamples": [
  1903. {
  1904. "lang": "js",
  1905. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.list({\n ...\n})"
  1906. }
  1907. ]
  1908. },
  1909. "delete": {
  1910. "operationId": "worktree.remove",
  1911. "parameters": [
  1912. {
  1913. "in": "query",
  1914. "name": "directory",
  1915. "schema": {
  1916. "type": "string"
  1917. }
  1918. },
  1919. {
  1920. "in": "query",
  1921. "name": "workspace",
  1922. "schema": {
  1923. "type": "string"
  1924. }
  1925. }
  1926. ],
  1927. "summary": "Remove worktree",
  1928. "description": "Remove a git worktree and delete its branch.",
  1929. "responses": {
  1930. "200": {
  1931. "description": "Worktree removed",
  1932. "content": {
  1933. "application/json": {
  1934. "schema": {
  1935. "type": "boolean"
  1936. }
  1937. }
  1938. }
  1939. },
  1940. "400": {
  1941. "description": "Bad request",
  1942. "content": {
  1943. "application/json": {
  1944. "schema": {
  1945. "$ref": "#/components/schemas/BadRequestError"
  1946. }
  1947. }
  1948. }
  1949. }
  1950. },
  1951. "requestBody": {
  1952. "content": {
  1953. "application/json": {
  1954. "schema": {
  1955. "$ref": "#/components/schemas/WorktreeRemoveInput"
  1956. }
  1957. }
  1958. }
  1959. },
  1960. "x-codeSamples": [
  1961. {
  1962. "lang": "js",
  1963. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.remove({\n ...\n})"
  1964. }
  1965. ]
  1966. }
  1967. },
  1968. "/experimental/worktree/reset": {
  1969. "post": {
  1970. "operationId": "worktree.reset",
  1971. "parameters": [
  1972. {
  1973. "in": "query",
  1974. "name": "directory",
  1975. "schema": {
  1976. "type": "string"
  1977. }
  1978. },
  1979. {
  1980. "in": "query",
  1981. "name": "workspace",
  1982. "schema": {
  1983. "type": "string"
  1984. }
  1985. }
  1986. ],
  1987. "summary": "Reset worktree",
  1988. "description": "Reset a worktree branch to the primary default branch.",
  1989. "responses": {
  1990. "200": {
  1991. "description": "Worktree reset",
  1992. "content": {
  1993. "application/json": {
  1994. "schema": {
  1995. "type": "boolean"
  1996. }
  1997. }
  1998. }
  1999. },
  2000. "400": {
  2001. "description": "Bad request",
  2002. "content": {
  2003. "application/json": {
  2004. "schema": {
  2005. "$ref": "#/components/schemas/BadRequestError"
  2006. }
  2007. }
  2008. }
  2009. }
  2010. },
  2011. "requestBody": {
  2012. "content": {
  2013. "application/json": {
  2014. "schema": {
  2015. "$ref": "#/components/schemas/WorktreeResetInput"
  2016. }
  2017. }
  2018. }
  2019. },
  2020. "x-codeSamples": [
  2021. {
  2022. "lang": "js",
  2023. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.reset({\n ...\n})"
  2024. }
  2025. ]
  2026. }
  2027. },
  2028. "/experimental/session": {
  2029. "get": {
  2030. "operationId": "experimental.session.list",
  2031. "parameters": [
  2032. {
  2033. "in": "query",
  2034. "name": "directory",
  2035. "schema": {
  2036. "type": "string"
  2037. },
  2038. "description": "Filter sessions by project directory"
  2039. },
  2040. {
  2041. "in": "query",
  2042. "name": "workspace",
  2043. "schema": {
  2044. "type": "string"
  2045. }
  2046. },
  2047. {
  2048. "in": "query",
  2049. "name": "roots",
  2050. "schema": {
  2051. "type": "boolean"
  2052. },
  2053. "description": "Only return root sessions (no parentID)"
  2054. },
  2055. {
  2056. "in": "query",
  2057. "name": "start",
  2058. "schema": {
  2059. "type": "number"
  2060. },
  2061. "description": "Filter sessions updated on or after this timestamp (milliseconds since epoch)"
  2062. },
  2063. {
  2064. "in": "query",
  2065. "name": "cursor",
  2066. "schema": {
  2067. "type": "number"
  2068. },
  2069. "description": "Return sessions updated before this timestamp (milliseconds since epoch)"
  2070. },
  2071. {
  2072. "in": "query",
  2073. "name": "search",
  2074. "schema": {
  2075. "type": "string"
  2076. },
  2077. "description": "Filter sessions by title (case-insensitive)"
  2078. },
  2079. {
  2080. "in": "query",
  2081. "name": "limit",
  2082. "schema": {
  2083. "type": "number"
  2084. },
  2085. "description": "Maximum number of sessions to return"
  2086. },
  2087. {
  2088. "in": "query",
  2089. "name": "archived",
  2090. "schema": {
  2091. "type": "boolean"
  2092. },
  2093. "description": "Include archived sessions (default false)"
  2094. }
  2095. ],
  2096. "summary": "List sessions",
  2097. "description": "Get a list of all OpenCode sessions across projects, sorted by most recently updated. Archived sessions are excluded by default.",
  2098. "responses": {
  2099. "200": {
  2100. "description": "List of sessions",
  2101. "content": {
  2102. "application/json": {
  2103. "schema": {
  2104. "type": "array",
  2105. "items": {
  2106. "$ref": "#/components/schemas/GlobalSession"
  2107. }
  2108. }
  2109. }
  2110. }
  2111. }
  2112. },
  2113. "x-codeSamples": [
  2114. {
  2115. "lang": "js",
  2116. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.session.list({\n ...\n})"
  2117. }
  2118. ]
  2119. }
  2120. },
  2121. "/experimental/resource": {
  2122. "get": {
  2123. "operationId": "experimental.resource.list",
  2124. "parameters": [
  2125. {
  2126. "in": "query",
  2127. "name": "directory",
  2128. "schema": {
  2129. "type": "string"
  2130. }
  2131. },
  2132. {
  2133. "in": "query",
  2134. "name": "workspace",
  2135. "schema": {
  2136. "type": "string"
  2137. }
  2138. }
  2139. ],
  2140. "summary": "Get MCP resources",
  2141. "description": "Get all available MCP resources from connected servers. Optionally filter by name.",
  2142. "responses": {
  2143. "200": {
  2144. "description": "MCP resources",
  2145. "content": {
  2146. "application/json": {
  2147. "schema": {
  2148. "type": "object",
  2149. "propertyNames": {
  2150. "type": "string"
  2151. },
  2152. "additionalProperties": {
  2153. "$ref": "#/components/schemas/McpResource"
  2154. }
  2155. }
  2156. }
  2157. }
  2158. }
  2159. },
  2160. "x-codeSamples": [
  2161. {
  2162. "lang": "js",
  2163. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.resource.list({\n ...\n})"
  2164. }
  2165. ]
  2166. }
  2167. },
  2168. "/session": {
  2169. "get": {
  2170. "operationId": "session.list",
  2171. "parameters": [
  2172. {
  2173. "in": "query",
  2174. "name": "directory",
  2175. "schema": {
  2176. "type": "string"
  2177. },
  2178. "description": "Filter sessions by project directory"
  2179. },
  2180. {
  2181. "in": "query",
  2182. "name": "workspace",
  2183. "schema": {
  2184. "type": "string"
  2185. }
  2186. },
  2187. {
  2188. "in": "query",
  2189. "name": "roots",
  2190. "schema": {
  2191. "type": "boolean"
  2192. },
  2193. "description": "Only return root sessions (no parentID)"
  2194. },
  2195. {
  2196. "in": "query",
  2197. "name": "start",
  2198. "schema": {
  2199. "type": "number"
  2200. },
  2201. "description": "Filter sessions updated on or after 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. "summary": "List sessions",
  2221. "description": "Get a list of all OpenCode sessions, sorted by most recently updated.",
  2222. "responses": {
  2223. "200": {
  2224. "description": "List of sessions",
  2225. "content": {
  2226. "application/json": {
  2227. "schema": {
  2228. "type": "array",
  2229. "items": {
  2230. "$ref": "#/components/schemas/Session"
  2231. }
  2232. }
  2233. }
  2234. }
  2235. }
  2236. },
  2237. "x-codeSamples": [
  2238. {
  2239. "lang": "js",
  2240. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.list({\n ...\n})"
  2241. }
  2242. ]
  2243. },
  2244. "post": {
  2245. "operationId": "session.create",
  2246. "parameters": [
  2247. {
  2248. "in": "query",
  2249. "name": "directory",
  2250. "schema": {
  2251. "type": "string"
  2252. }
  2253. },
  2254. {
  2255. "in": "query",
  2256. "name": "workspace",
  2257. "schema": {
  2258. "type": "string"
  2259. }
  2260. }
  2261. ],
  2262. "summary": "Create session",
  2263. "description": "Create a new OpenCode session for interacting with AI assistants and managing conversations.",
  2264. "responses": {
  2265. "200": {
  2266. "description": "Successfully created session",
  2267. "content": {
  2268. "application/json": {
  2269. "schema": {
  2270. "$ref": "#/components/schemas/Session"
  2271. }
  2272. }
  2273. }
  2274. },
  2275. "400": {
  2276. "description": "Bad request",
  2277. "content": {
  2278. "application/json": {
  2279. "schema": {
  2280. "$ref": "#/components/schemas/BadRequestError"
  2281. }
  2282. }
  2283. }
  2284. }
  2285. },
  2286. "requestBody": {
  2287. "content": {
  2288. "application/json": {
  2289. "schema": {
  2290. "type": "object",
  2291. "properties": {
  2292. "parentID": {
  2293. "type": "string",
  2294. "pattern": "^ses.*"
  2295. },
  2296. "title": {
  2297. "type": "string"
  2298. },
  2299. "permission": {
  2300. "$ref": "#/components/schemas/PermissionRuleset"
  2301. },
  2302. "workspaceID": {
  2303. "type": "string",
  2304. "pattern": "^wrk.*"
  2305. }
  2306. }
  2307. }
  2308. }
  2309. }
  2310. },
  2311. "x-codeSamples": [
  2312. {
  2313. "lang": "js",
  2314. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.create({\n ...\n})"
  2315. }
  2316. ]
  2317. }
  2318. },
  2319. "/session/status": {
  2320. "get": {
  2321. "operationId": "session.status",
  2322. "parameters": [
  2323. {
  2324. "in": "query",
  2325. "name": "directory",
  2326. "schema": {
  2327. "type": "string"
  2328. }
  2329. },
  2330. {
  2331. "in": "query",
  2332. "name": "workspace",
  2333. "schema": {
  2334. "type": "string"
  2335. }
  2336. }
  2337. ],
  2338. "summary": "Get session status",
  2339. "description": "Retrieve the current status of all sessions, including active, idle, and completed states.",
  2340. "responses": {
  2341. "200": {
  2342. "description": "Get session status",
  2343. "content": {
  2344. "application/json": {
  2345. "schema": {
  2346. "type": "object",
  2347. "propertyNames": {
  2348. "type": "string"
  2349. },
  2350. "additionalProperties": {
  2351. "$ref": "#/components/schemas/SessionStatus"
  2352. }
  2353. }
  2354. }
  2355. }
  2356. },
  2357. "400": {
  2358. "description": "Bad request",
  2359. "content": {
  2360. "application/json": {
  2361. "schema": {
  2362. "$ref": "#/components/schemas/BadRequestError"
  2363. }
  2364. }
  2365. }
  2366. }
  2367. },
  2368. "x-codeSamples": [
  2369. {
  2370. "lang": "js",
  2371. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.status({\n ...\n})"
  2372. }
  2373. ]
  2374. }
  2375. },
  2376. "/session/{sessionID}": {
  2377. "get": {
  2378. "operationId": "session.get",
  2379. "parameters": [
  2380. {
  2381. "in": "query",
  2382. "name": "directory",
  2383. "schema": {
  2384. "type": "string"
  2385. }
  2386. },
  2387. {
  2388. "in": "query",
  2389. "name": "workspace",
  2390. "schema": {
  2391. "type": "string"
  2392. }
  2393. },
  2394. {
  2395. "in": "path",
  2396. "name": "sessionID",
  2397. "schema": {
  2398. "type": "string",
  2399. "pattern": "^ses.*"
  2400. },
  2401. "required": true
  2402. }
  2403. ],
  2404. "summary": "Get session",
  2405. "description": "Retrieve detailed information about a specific OpenCode session.",
  2406. "tags": ["Session"],
  2407. "responses": {
  2408. "200": {
  2409. "description": "Get session",
  2410. "content": {
  2411. "application/json": {
  2412. "schema": {
  2413. "$ref": "#/components/schemas/Session"
  2414. }
  2415. }
  2416. }
  2417. },
  2418. "400": {
  2419. "description": "Bad request",
  2420. "content": {
  2421. "application/json": {
  2422. "schema": {
  2423. "$ref": "#/components/schemas/BadRequestError"
  2424. }
  2425. }
  2426. }
  2427. },
  2428. "404": {
  2429. "description": "Not found",
  2430. "content": {
  2431. "application/json": {
  2432. "schema": {
  2433. "$ref": "#/components/schemas/NotFoundError"
  2434. }
  2435. }
  2436. }
  2437. }
  2438. },
  2439. "x-codeSamples": [
  2440. {
  2441. "lang": "js",
  2442. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.get({\n ...\n})"
  2443. }
  2444. ]
  2445. },
  2446. "delete": {
  2447. "operationId": "session.delete",
  2448. "parameters": [
  2449. {
  2450. "in": "query",
  2451. "name": "directory",
  2452. "schema": {
  2453. "type": "string"
  2454. }
  2455. },
  2456. {
  2457. "in": "query",
  2458. "name": "workspace",
  2459. "schema": {
  2460. "type": "string"
  2461. }
  2462. },
  2463. {
  2464. "in": "path",
  2465. "name": "sessionID",
  2466. "schema": {
  2467. "type": "string",
  2468. "pattern": "^ses.*"
  2469. },
  2470. "required": true
  2471. }
  2472. ],
  2473. "summary": "Delete session",
  2474. "description": "Delete a session and permanently remove all associated data, including messages and history.",
  2475. "responses": {
  2476. "200": {
  2477. "description": "Successfully deleted session",
  2478. "content": {
  2479. "application/json": {
  2480. "schema": {
  2481. "type": "boolean"
  2482. }
  2483. }
  2484. }
  2485. },
  2486. "400": {
  2487. "description": "Bad request",
  2488. "content": {
  2489. "application/json": {
  2490. "schema": {
  2491. "$ref": "#/components/schemas/BadRequestError"
  2492. }
  2493. }
  2494. }
  2495. },
  2496. "404": {
  2497. "description": "Not found",
  2498. "content": {
  2499. "application/json": {
  2500. "schema": {
  2501. "$ref": "#/components/schemas/NotFoundError"
  2502. }
  2503. }
  2504. }
  2505. }
  2506. },
  2507. "x-codeSamples": [
  2508. {
  2509. "lang": "js",
  2510. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.delete({\n ...\n})"
  2511. }
  2512. ]
  2513. },
  2514. "patch": {
  2515. "operationId": "session.update",
  2516. "parameters": [
  2517. {
  2518. "in": "query",
  2519. "name": "directory",
  2520. "schema": {
  2521. "type": "string"
  2522. }
  2523. },
  2524. {
  2525. "in": "query",
  2526. "name": "workspace",
  2527. "schema": {
  2528. "type": "string"
  2529. }
  2530. },
  2531. {
  2532. "in": "path",
  2533. "name": "sessionID",
  2534. "schema": {
  2535. "type": "string",
  2536. "pattern": "^ses.*"
  2537. },
  2538. "required": true
  2539. }
  2540. ],
  2541. "summary": "Update session",
  2542. "description": "Update properties of an existing session, such as title or other metadata.",
  2543. "responses": {
  2544. "200": {
  2545. "description": "Successfully updated session",
  2546. "content": {
  2547. "application/json": {
  2548. "schema": {
  2549. "$ref": "#/components/schemas/Session"
  2550. }
  2551. }
  2552. }
  2553. },
  2554. "400": {
  2555. "description": "Bad request",
  2556. "content": {
  2557. "application/json": {
  2558. "schema": {
  2559. "$ref": "#/components/schemas/BadRequestError"
  2560. }
  2561. }
  2562. }
  2563. },
  2564. "404": {
  2565. "description": "Not found",
  2566. "content": {
  2567. "application/json": {
  2568. "schema": {
  2569. "$ref": "#/components/schemas/NotFoundError"
  2570. }
  2571. }
  2572. }
  2573. }
  2574. },
  2575. "requestBody": {
  2576. "content": {
  2577. "application/json": {
  2578. "schema": {
  2579. "type": "object",
  2580. "properties": {
  2581. "title": {
  2582. "type": "string"
  2583. },
  2584. "permission": {
  2585. "$ref": "#/components/schemas/PermissionRuleset"
  2586. },
  2587. "time": {
  2588. "type": "object",
  2589. "properties": {
  2590. "archived": {
  2591. "type": "number"
  2592. }
  2593. }
  2594. }
  2595. }
  2596. }
  2597. }
  2598. }
  2599. },
  2600. "x-codeSamples": [
  2601. {
  2602. "lang": "js",
  2603. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.update({\n ...\n})"
  2604. }
  2605. ]
  2606. }
  2607. },
  2608. "/session/{sessionID}/children": {
  2609. "get": {
  2610. "operationId": "session.children",
  2611. "parameters": [
  2612. {
  2613. "in": "query",
  2614. "name": "directory",
  2615. "schema": {
  2616. "type": "string"
  2617. }
  2618. },
  2619. {
  2620. "in": "query",
  2621. "name": "workspace",
  2622. "schema": {
  2623. "type": "string"
  2624. }
  2625. },
  2626. {
  2627. "in": "path",
  2628. "name": "sessionID",
  2629. "schema": {
  2630. "type": "string",
  2631. "pattern": "^ses.*"
  2632. },
  2633. "required": true
  2634. }
  2635. ],
  2636. "summary": "Get session children",
  2637. "tags": ["Session"],
  2638. "description": "Retrieve all child sessions that were forked from the specified parent session.",
  2639. "responses": {
  2640. "200": {
  2641. "description": "List of children",
  2642. "content": {
  2643. "application/json": {
  2644. "schema": {
  2645. "type": "array",
  2646. "items": {
  2647. "$ref": "#/components/schemas/Session"
  2648. }
  2649. }
  2650. }
  2651. }
  2652. },
  2653. "400": {
  2654. "description": "Bad request",
  2655. "content": {
  2656. "application/json": {
  2657. "schema": {
  2658. "$ref": "#/components/schemas/BadRequestError"
  2659. }
  2660. }
  2661. }
  2662. },
  2663. "404": {
  2664. "description": "Not found",
  2665. "content": {
  2666. "application/json": {
  2667. "schema": {
  2668. "$ref": "#/components/schemas/NotFoundError"
  2669. }
  2670. }
  2671. }
  2672. }
  2673. },
  2674. "x-codeSamples": [
  2675. {
  2676. "lang": "js",
  2677. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.children({\n ...\n})"
  2678. }
  2679. ]
  2680. }
  2681. },
  2682. "/session/{sessionID}/todo": {
  2683. "get": {
  2684. "operationId": "session.todo",
  2685. "parameters": [
  2686. {
  2687. "in": "query",
  2688. "name": "directory",
  2689. "schema": {
  2690. "type": "string"
  2691. }
  2692. },
  2693. {
  2694. "in": "query",
  2695. "name": "workspace",
  2696. "schema": {
  2697. "type": "string"
  2698. }
  2699. },
  2700. {
  2701. "in": "path",
  2702. "name": "sessionID",
  2703. "schema": {
  2704. "type": "string",
  2705. "pattern": "^ses.*"
  2706. },
  2707. "required": true
  2708. }
  2709. ],
  2710. "summary": "Get session todos",
  2711. "description": "Retrieve the todo list associated with a specific session, showing tasks and action items.",
  2712. "responses": {
  2713. "200": {
  2714. "description": "Todo list",
  2715. "content": {
  2716. "application/json": {
  2717. "schema": {
  2718. "type": "array",
  2719. "items": {
  2720. "$ref": "#/components/schemas/Todo"
  2721. }
  2722. }
  2723. }
  2724. }
  2725. },
  2726. "400": {
  2727. "description": "Bad request",
  2728. "content": {
  2729. "application/json": {
  2730. "schema": {
  2731. "$ref": "#/components/schemas/BadRequestError"
  2732. }
  2733. }
  2734. }
  2735. },
  2736. "404": {
  2737. "description": "Not found",
  2738. "content": {
  2739. "application/json": {
  2740. "schema": {
  2741. "$ref": "#/components/schemas/NotFoundError"
  2742. }
  2743. }
  2744. }
  2745. }
  2746. },
  2747. "x-codeSamples": [
  2748. {
  2749. "lang": "js",
  2750. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.todo({\n ...\n})"
  2751. }
  2752. ]
  2753. }
  2754. },
  2755. "/session/{sessionID}/init": {
  2756. "post": {
  2757. "operationId": "session.init",
  2758. "parameters": [
  2759. {
  2760. "in": "query",
  2761. "name": "directory",
  2762. "schema": {
  2763. "type": "string"
  2764. }
  2765. },
  2766. {
  2767. "in": "query",
  2768. "name": "workspace",
  2769. "schema": {
  2770. "type": "string"
  2771. }
  2772. },
  2773. {
  2774. "in": "path",
  2775. "name": "sessionID",
  2776. "schema": {
  2777. "type": "string",
  2778. "pattern": "^ses.*"
  2779. },
  2780. "required": true
  2781. }
  2782. ],
  2783. "summary": "Initialize session",
  2784. "description": "Analyze the current application and create an AGENTS.md file with project-specific agent configurations.",
  2785. "responses": {
  2786. "200": {
  2787. "description": "200",
  2788. "content": {
  2789. "application/json": {
  2790. "schema": {
  2791. "type": "boolean"
  2792. }
  2793. }
  2794. }
  2795. },
  2796. "400": {
  2797. "description": "Bad request",
  2798. "content": {
  2799. "application/json": {
  2800. "schema": {
  2801. "$ref": "#/components/schemas/BadRequestError"
  2802. }
  2803. }
  2804. }
  2805. },
  2806. "404": {
  2807. "description": "Not found",
  2808. "content": {
  2809. "application/json": {
  2810. "schema": {
  2811. "$ref": "#/components/schemas/NotFoundError"
  2812. }
  2813. }
  2814. }
  2815. }
  2816. },
  2817. "requestBody": {
  2818. "content": {
  2819. "application/json": {
  2820. "schema": {
  2821. "type": "object",
  2822. "properties": {
  2823. "modelID": {
  2824. "type": "string"
  2825. },
  2826. "providerID": {
  2827. "type": "string"
  2828. },
  2829. "messageID": {
  2830. "type": "string",
  2831. "pattern": "^msg.*"
  2832. }
  2833. },
  2834. "required": ["modelID", "providerID", "messageID"]
  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.init({\n ...\n})"
  2843. }
  2844. ]
  2845. }
  2846. },
  2847. "/session/{sessionID}/fork": {
  2848. "post": {
  2849. "operationId": "session.fork",
  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": "Fork session",
  2876. "description": "Create a new session by forking an existing session at a specific message point.",
  2877. "responses": {
  2878. "200": {
  2879. "description": "200",
  2880. "content": {
  2881. "application/json": {
  2882. "schema": {
  2883. "$ref": "#/components/schemas/Session"
  2884. }
  2885. }
  2886. }
  2887. }
  2888. },
  2889. "requestBody": {
  2890. "content": {
  2891. "application/json": {
  2892. "schema": {
  2893. "type": "object",
  2894. "properties": {
  2895. "messageID": {
  2896. "type": "string",
  2897. "pattern": "^msg.*"
  2898. }
  2899. }
  2900. }
  2901. }
  2902. }
  2903. },
  2904. "x-codeSamples": [
  2905. {
  2906. "lang": "js",
  2907. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.fork({\n ...\n})"
  2908. }
  2909. ]
  2910. }
  2911. },
  2912. "/session/{sessionID}/abort": {
  2913. "post": {
  2914. "operationId": "session.abort",
  2915. "parameters": [
  2916. {
  2917. "in": "query",
  2918. "name": "directory",
  2919. "schema": {
  2920. "type": "string"
  2921. }
  2922. },
  2923. {
  2924. "in": "query",
  2925. "name": "workspace",
  2926. "schema": {
  2927. "type": "string"
  2928. }
  2929. },
  2930. {
  2931. "in": "path",
  2932. "name": "sessionID",
  2933. "schema": {
  2934. "type": "string",
  2935. "pattern": "^ses.*"
  2936. },
  2937. "required": true
  2938. }
  2939. ],
  2940. "summary": "Abort session",
  2941. "description": "Abort an active session and stop any ongoing AI processing or command execution.",
  2942. "responses": {
  2943. "200": {
  2944. "description": "Aborted session",
  2945. "content": {
  2946. "application/json": {
  2947. "schema": {
  2948. "type": "boolean"
  2949. }
  2950. }
  2951. }
  2952. },
  2953. "400": {
  2954. "description": "Bad request",
  2955. "content": {
  2956. "application/json": {
  2957. "schema": {
  2958. "$ref": "#/components/schemas/BadRequestError"
  2959. }
  2960. }
  2961. }
  2962. },
  2963. "404": {
  2964. "description": "Not found",
  2965. "content": {
  2966. "application/json": {
  2967. "schema": {
  2968. "$ref": "#/components/schemas/NotFoundError"
  2969. }
  2970. }
  2971. }
  2972. }
  2973. },
  2974. "x-codeSamples": [
  2975. {
  2976. "lang": "js",
  2977. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.abort({\n ...\n})"
  2978. }
  2979. ]
  2980. }
  2981. },
  2982. "/session/{sessionID}/share": {
  2983. "post": {
  2984. "operationId": "session.share",
  2985. "parameters": [
  2986. {
  2987. "in": "query",
  2988. "name": "directory",
  2989. "schema": {
  2990. "type": "string"
  2991. }
  2992. },
  2993. {
  2994. "in": "query",
  2995. "name": "workspace",
  2996. "schema": {
  2997. "type": "string"
  2998. }
  2999. },
  3000. {
  3001. "in": "path",
  3002. "name": "sessionID",
  3003. "schema": {
  3004. "type": "string",
  3005. "pattern": "^ses.*"
  3006. },
  3007. "required": true
  3008. }
  3009. ],
  3010. "summary": "Share session",
  3011. "description": "Create a shareable link for a session, allowing others to view the conversation.",
  3012. "responses": {
  3013. "200": {
  3014. "description": "Successfully shared session",
  3015. "content": {
  3016. "application/json": {
  3017. "schema": {
  3018. "$ref": "#/components/schemas/Session"
  3019. }
  3020. }
  3021. }
  3022. },
  3023. "400": {
  3024. "description": "Bad request",
  3025. "content": {
  3026. "application/json": {
  3027. "schema": {
  3028. "$ref": "#/components/schemas/BadRequestError"
  3029. }
  3030. }
  3031. }
  3032. },
  3033. "404": {
  3034. "description": "Not found",
  3035. "content": {
  3036. "application/json": {
  3037. "schema": {
  3038. "$ref": "#/components/schemas/NotFoundError"
  3039. }
  3040. }
  3041. }
  3042. }
  3043. },
  3044. "x-codeSamples": [
  3045. {
  3046. "lang": "js",
  3047. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.share({\n ...\n})"
  3048. }
  3049. ]
  3050. },
  3051. "delete": {
  3052. "operationId": "session.unshare",
  3053. "parameters": [
  3054. {
  3055. "in": "query",
  3056. "name": "directory",
  3057. "schema": {
  3058. "type": "string"
  3059. }
  3060. },
  3061. {
  3062. "in": "query",
  3063. "name": "workspace",
  3064. "schema": {
  3065. "type": "string"
  3066. }
  3067. },
  3068. {
  3069. "in": "path",
  3070. "name": "sessionID",
  3071. "schema": {
  3072. "type": "string",
  3073. "pattern": "^ses.*"
  3074. },
  3075. "required": true
  3076. }
  3077. ],
  3078. "summary": "Unshare session",
  3079. "description": "Remove the shareable link for a session, making it private again.",
  3080. "responses": {
  3081. "200": {
  3082. "description": "Successfully unshared session",
  3083. "content": {
  3084. "application/json": {
  3085. "schema": {
  3086. "$ref": "#/components/schemas/Session"
  3087. }
  3088. }
  3089. }
  3090. },
  3091. "400": {
  3092. "description": "Bad request",
  3093. "content": {
  3094. "application/json": {
  3095. "schema": {
  3096. "$ref": "#/components/schemas/BadRequestError"
  3097. }
  3098. }
  3099. }
  3100. },
  3101. "404": {
  3102. "description": "Not found",
  3103. "content": {
  3104. "application/json": {
  3105. "schema": {
  3106. "$ref": "#/components/schemas/NotFoundError"
  3107. }
  3108. }
  3109. }
  3110. }
  3111. },
  3112. "x-codeSamples": [
  3113. {
  3114. "lang": "js",
  3115. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.unshare({\n ...\n})"
  3116. }
  3117. ]
  3118. }
  3119. },
  3120. "/session/{sessionID}/diff": {
  3121. "get": {
  3122. "operationId": "session.diff",
  3123. "parameters": [
  3124. {
  3125. "in": "query",
  3126. "name": "directory",
  3127. "schema": {
  3128. "type": "string"
  3129. }
  3130. },
  3131. {
  3132. "in": "query",
  3133. "name": "workspace",
  3134. "schema": {
  3135. "type": "string"
  3136. }
  3137. },
  3138. {
  3139. "in": "path",
  3140. "name": "sessionID",
  3141. "schema": {
  3142. "type": "string",
  3143. "pattern": "^ses.*"
  3144. },
  3145. "required": true
  3146. },
  3147. {
  3148. "in": "query",
  3149. "name": "messageID",
  3150. "schema": {
  3151. "type": "string",
  3152. "pattern": "^msg.*"
  3153. }
  3154. }
  3155. ],
  3156. "summary": "Get message diff",
  3157. "description": "Get the file changes (diff) that resulted from a specific user message in the session.",
  3158. "responses": {
  3159. "200": {
  3160. "description": "Successfully retrieved diff",
  3161. "content": {
  3162. "application/json": {
  3163. "schema": {
  3164. "type": "array",
  3165. "items": {
  3166. "$ref": "#/components/schemas/SnapshotFileDiff"
  3167. }
  3168. }
  3169. }
  3170. }
  3171. }
  3172. },
  3173. "x-codeSamples": [
  3174. {
  3175. "lang": "js",
  3176. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.diff({\n ...\n})"
  3177. }
  3178. ]
  3179. }
  3180. },
  3181. "/session/{sessionID}/summarize": {
  3182. "post": {
  3183. "operationId": "session.summarize",
  3184. "parameters": [
  3185. {
  3186. "in": "query",
  3187. "name": "directory",
  3188. "schema": {
  3189. "type": "string"
  3190. }
  3191. },
  3192. {
  3193. "in": "query",
  3194. "name": "workspace",
  3195. "schema": {
  3196. "type": "string"
  3197. }
  3198. },
  3199. {
  3200. "in": "path",
  3201. "name": "sessionID",
  3202. "schema": {
  3203. "type": "string",
  3204. "pattern": "^ses.*"
  3205. },
  3206. "required": true
  3207. }
  3208. ],
  3209. "summary": "Summarize session",
  3210. "description": "Generate a concise summary of the session using AI compaction to preserve key information.",
  3211. "responses": {
  3212. "200": {
  3213. "description": "Summarized session",
  3214. "content": {
  3215. "application/json": {
  3216. "schema": {
  3217. "type": "boolean"
  3218. }
  3219. }
  3220. }
  3221. },
  3222. "400": {
  3223. "description": "Bad request",
  3224. "content": {
  3225. "application/json": {
  3226. "schema": {
  3227. "$ref": "#/components/schemas/BadRequestError"
  3228. }
  3229. }
  3230. }
  3231. },
  3232. "404": {
  3233. "description": "Not found",
  3234. "content": {
  3235. "application/json": {
  3236. "schema": {
  3237. "$ref": "#/components/schemas/NotFoundError"
  3238. }
  3239. }
  3240. }
  3241. }
  3242. },
  3243. "requestBody": {
  3244. "content": {
  3245. "application/json": {
  3246. "schema": {
  3247. "type": "object",
  3248. "properties": {
  3249. "providerID": {
  3250. "type": "string"
  3251. },
  3252. "modelID": {
  3253. "type": "string"
  3254. },
  3255. "auto": {
  3256. "default": false,
  3257. "type": "boolean"
  3258. }
  3259. },
  3260. "required": ["providerID", "modelID"]
  3261. }
  3262. }
  3263. }
  3264. },
  3265. "x-codeSamples": [
  3266. {
  3267. "lang": "js",
  3268. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.summarize({\n ...\n})"
  3269. }
  3270. ]
  3271. }
  3272. },
  3273. "/session/{sessionID}/message": {
  3274. "get": {
  3275. "operationId": "session.messages",
  3276. "parameters": [
  3277. {
  3278. "in": "query",
  3279. "name": "directory",
  3280. "schema": {
  3281. "type": "string"
  3282. }
  3283. },
  3284. {
  3285. "in": "query",
  3286. "name": "workspace",
  3287. "schema": {
  3288. "type": "string"
  3289. }
  3290. },
  3291. {
  3292. "in": "path",
  3293. "name": "sessionID",
  3294. "schema": {
  3295. "type": "string",
  3296. "pattern": "^ses.*"
  3297. },
  3298. "required": true
  3299. },
  3300. {
  3301. "in": "query",
  3302. "name": "limit",
  3303. "schema": {
  3304. "type": "integer",
  3305. "minimum": 0,
  3306. "maximum": 9007199254740991
  3307. },
  3308. "description": "Maximum number of messages to return"
  3309. },
  3310. {
  3311. "in": "query",
  3312. "name": "before",
  3313. "schema": {
  3314. "type": "string"
  3315. }
  3316. }
  3317. ],
  3318. "summary": "Get session messages",
  3319. "description": "Retrieve all messages in a session, including user prompts and AI responses.",
  3320. "responses": {
  3321. "200": {
  3322. "description": "List of messages",
  3323. "content": {
  3324. "application/json": {
  3325. "schema": {
  3326. "type": "array",
  3327. "items": {
  3328. "type": "object",
  3329. "properties": {
  3330. "info": {
  3331. "$ref": "#/components/schemas/Message"
  3332. },
  3333. "parts": {
  3334. "type": "array",
  3335. "items": {
  3336. "$ref": "#/components/schemas/Part"
  3337. }
  3338. }
  3339. },
  3340. "required": ["info", "parts"]
  3341. }
  3342. }
  3343. }
  3344. }
  3345. },
  3346. "400": {
  3347. "description": "Bad request",
  3348. "content": {
  3349. "application/json": {
  3350. "schema": {
  3351. "$ref": "#/components/schemas/BadRequestError"
  3352. }
  3353. }
  3354. }
  3355. },
  3356. "404": {
  3357. "description": "Not found",
  3358. "content": {
  3359. "application/json": {
  3360. "schema": {
  3361. "$ref": "#/components/schemas/NotFoundError"
  3362. }
  3363. }
  3364. }
  3365. }
  3366. },
  3367. "x-codeSamples": [
  3368. {
  3369. "lang": "js",
  3370. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.messages({\n ...\n})"
  3371. }
  3372. ]
  3373. },
  3374. "post": {
  3375. "operationId": "session.prompt",
  3376. "parameters": [
  3377. {
  3378. "in": "query",
  3379. "name": "directory",
  3380. "schema": {
  3381. "type": "string"
  3382. }
  3383. },
  3384. {
  3385. "in": "query",
  3386. "name": "workspace",
  3387. "schema": {
  3388. "type": "string"
  3389. }
  3390. },
  3391. {
  3392. "in": "path",
  3393. "name": "sessionID",
  3394. "schema": {
  3395. "type": "string",
  3396. "pattern": "^ses.*"
  3397. },
  3398. "required": true
  3399. }
  3400. ],
  3401. "summary": "Send message",
  3402. "description": "Create and send a new message to a session, streaming the AI response.",
  3403. "responses": {
  3404. "200": {
  3405. "description": "Created message",
  3406. "content": {
  3407. "application/json": {
  3408. "schema": {
  3409. "type": "object",
  3410. "properties": {
  3411. "info": {
  3412. "$ref": "#/components/schemas/AssistantMessage"
  3413. },
  3414. "parts": {
  3415. "type": "array",
  3416. "items": {
  3417. "$ref": "#/components/schemas/Part"
  3418. }
  3419. }
  3420. },
  3421. "required": ["info", "parts"]
  3422. }
  3423. }
  3424. }
  3425. },
  3426. "400": {
  3427. "description": "Bad request",
  3428. "content": {
  3429. "application/json": {
  3430. "schema": {
  3431. "$ref": "#/components/schemas/BadRequestError"
  3432. }
  3433. }
  3434. }
  3435. },
  3436. "404": {
  3437. "description": "Not found",
  3438. "content": {
  3439. "application/json": {
  3440. "schema": {
  3441. "$ref": "#/components/schemas/NotFoundError"
  3442. }
  3443. }
  3444. }
  3445. }
  3446. },
  3447. "requestBody": {
  3448. "content": {
  3449. "application/json": {
  3450. "schema": {
  3451. "type": "object",
  3452. "properties": {
  3453. "messageID": {
  3454. "type": "string",
  3455. "pattern": "^msg.*"
  3456. },
  3457. "model": {
  3458. "type": "object",
  3459. "properties": {
  3460. "providerID": {
  3461. "type": "string"
  3462. },
  3463. "modelID": {
  3464. "type": "string"
  3465. }
  3466. },
  3467. "required": ["providerID", "modelID"]
  3468. },
  3469. "agent": {
  3470. "type": "string"
  3471. },
  3472. "noReply": {
  3473. "type": "boolean"
  3474. },
  3475. "tools": {
  3476. "description": "@deprecated tools and permissions have been merged, you can set permissions on the session itself now",
  3477. "type": "object",
  3478. "propertyNames": {
  3479. "type": "string"
  3480. },
  3481. "additionalProperties": {
  3482. "type": "boolean"
  3483. }
  3484. },
  3485. "format": {
  3486. "$ref": "#/components/schemas/OutputFormat"
  3487. },
  3488. "system": {
  3489. "type": "string"
  3490. },
  3491. "variant": {
  3492. "type": "string"
  3493. },
  3494. "parts": {
  3495. "type": "array",
  3496. "items": {
  3497. "anyOf": [
  3498. {
  3499. "$ref": "#/components/schemas/TextPartInput"
  3500. },
  3501. {
  3502. "$ref": "#/components/schemas/FilePartInput"
  3503. },
  3504. {
  3505. "$ref": "#/components/schemas/AgentPartInput"
  3506. },
  3507. {
  3508. "$ref": "#/components/schemas/SubtaskPartInput"
  3509. }
  3510. ]
  3511. }
  3512. }
  3513. },
  3514. "required": ["parts"]
  3515. }
  3516. }
  3517. }
  3518. },
  3519. "x-codeSamples": [
  3520. {
  3521. "lang": "js",
  3522. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.prompt({\n ...\n})"
  3523. }
  3524. ]
  3525. }
  3526. },
  3527. "/session/{sessionID}/message/{messageID}": {
  3528. "get": {
  3529. "operationId": "session.message",
  3530. "parameters": [
  3531. {
  3532. "in": "query",
  3533. "name": "directory",
  3534. "schema": {
  3535. "type": "string"
  3536. }
  3537. },
  3538. {
  3539. "in": "query",
  3540. "name": "workspace",
  3541. "schema": {
  3542. "type": "string"
  3543. }
  3544. },
  3545. {
  3546. "in": "path",
  3547. "name": "sessionID",
  3548. "schema": {
  3549. "type": "string",
  3550. "pattern": "^ses.*"
  3551. },
  3552. "required": true
  3553. },
  3554. {
  3555. "in": "path",
  3556. "name": "messageID",
  3557. "schema": {
  3558. "type": "string",
  3559. "pattern": "^msg.*"
  3560. },
  3561. "required": true
  3562. }
  3563. ],
  3564. "summary": "Get message",
  3565. "description": "Retrieve a specific message from a session by its message ID.",
  3566. "responses": {
  3567. "200": {
  3568. "description": "Message",
  3569. "content": {
  3570. "application/json": {
  3571. "schema": {
  3572. "type": "object",
  3573. "properties": {
  3574. "info": {
  3575. "$ref": "#/components/schemas/Message"
  3576. },
  3577. "parts": {
  3578. "type": "array",
  3579. "items": {
  3580. "$ref": "#/components/schemas/Part"
  3581. }
  3582. }
  3583. },
  3584. "required": ["info", "parts"]
  3585. }
  3586. }
  3587. }
  3588. },
  3589. "400": {
  3590. "description": "Bad request",
  3591. "content": {
  3592. "application/json": {
  3593. "schema": {
  3594. "$ref": "#/components/schemas/BadRequestError"
  3595. }
  3596. }
  3597. }
  3598. },
  3599. "404": {
  3600. "description": "Not found",
  3601. "content": {
  3602. "application/json": {
  3603. "schema": {
  3604. "$ref": "#/components/schemas/NotFoundError"
  3605. }
  3606. }
  3607. }
  3608. }
  3609. },
  3610. "x-codeSamples": [
  3611. {
  3612. "lang": "js",
  3613. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.message({\n ...\n})"
  3614. }
  3615. ]
  3616. },
  3617. "delete": {
  3618. "operationId": "session.deleteMessage",
  3619. "parameters": [
  3620. {
  3621. "in": "query",
  3622. "name": "directory",
  3623. "schema": {
  3624. "type": "string"
  3625. }
  3626. },
  3627. {
  3628. "in": "query",
  3629. "name": "workspace",
  3630. "schema": {
  3631. "type": "string"
  3632. }
  3633. },
  3634. {
  3635. "in": "path",
  3636. "name": "sessionID",
  3637. "schema": {
  3638. "type": "string",
  3639. "pattern": "^ses.*"
  3640. },
  3641. "required": true
  3642. },
  3643. {
  3644. "in": "path",
  3645. "name": "messageID",
  3646. "schema": {
  3647. "type": "string",
  3648. "pattern": "^msg.*"
  3649. },
  3650. "required": true
  3651. }
  3652. ],
  3653. "summary": "Delete message",
  3654. "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.",
  3655. "responses": {
  3656. "200": {
  3657. "description": "Successfully deleted message",
  3658. "content": {
  3659. "application/json": {
  3660. "schema": {
  3661. "type": "boolean"
  3662. }
  3663. }
  3664. }
  3665. },
  3666. "400": {
  3667. "description": "Bad request",
  3668. "content": {
  3669. "application/json": {
  3670. "schema": {
  3671. "$ref": "#/components/schemas/BadRequestError"
  3672. }
  3673. }
  3674. }
  3675. },
  3676. "404": {
  3677. "description": "Not found",
  3678. "content": {
  3679. "application/json": {
  3680. "schema": {
  3681. "$ref": "#/components/schemas/NotFoundError"
  3682. }
  3683. }
  3684. }
  3685. }
  3686. },
  3687. "x-codeSamples": [
  3688. {
  3689. "lang": "js",
  3690. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.deleteMessage({\n ...\n})"
  3691. }
  3692. ]
  3693. }
  3694. },
  3695. "/session/{sessionID}/message/{messageID}/part/{partID}": {
  3696. "delete": {
  3697. "operationId": "part.delete",
  3698. "parameters": [
  3699. {
  3700. "in": "query",
  3701. "name": "directory",
  3702. "schema": {
  3703. "type": "string"
  3704. }
  3705. },
  3706. {
  3707. "in": "query",
  3708. "name": "workspace",
  3709. "schema": {
  3710. "type": "string"
  3711. }
  3712. },
  3713. {
  3714. "in": "path",
  3715. "name": "sessionID",
  3716. "schema": {
  3717. "type": "string",
  3718. "pattern": "^ses.*"
  3719. },
  3720. "required": true
  3721. },
  3722. {
  3723. "in": "path",
  3724. "name": "messageID",
  3725. "schema": {
  3726. "type": "string",
  3727. "pattern": "^msg.*"
  3728. },
  3729. "required": true
  3730. },
  3731. {
  3732. "in": "path",
  3733. "name": "partID",
  3734. "schema": {
  3735. "type": "string",
  3736. "pattern": "^prt.*"
  3737. },
  3738. "required": true
  3739. }
  3740. ],
  3741. "description": "Delete a part from a message",
  3742. "responses": {
  3743. "200": {
  3744. "description": "Successfully deleted part",
  3745. "content": {
  3746. "application/json": {
  3747. "schema": {
  3748. "type": "boolean"
  3749. }
  3750. }
  3751. }
  3752. },
  3753. "400": {
  3754. "description": "Bad request",
  3755. "content": {
  3756. "application/json": {
  3757. "schema": {
  3758. "$ref": "#/components/schemas/BadRequestError"
  3759. }
  3760. }
  3761. }
  3762. },
  3763. "404": {
  3764. "description": "Not found",
  3765. "content": {
  3766. "application/json": {
  3767. "schema": {
  3768. "$ref": "#/components/schemas/NotFoundError"
  3769. }
  3770. }
  3771. }
  3772. }
  3773. },
  3774. "x-codeSamples": [
  3775. {
  3776. "lang": "js",
  3777. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.part.delete({\n ...\n})"
  3778. }
  3779. ]
  3780. },
  3781. "patch": {
  3782. "operationId": "part.update",
  3783. "parameters": [
  3784. {
  3785. "in": "query",
  3786. "name": "directory",
  3787. "schema": {
  3788. "type": "string"
  3789. }
  3790. },
  3791. {
  3792. "in": "query",
  3793. "name": "workspace",
  3794. "schema": {
  3795. "type": "string"
  3796. }
  3797. },
  3798. {
  3799. "in": "path",
  3800. "name": "sessionID",
  3801. "schema": {
  3802. "type": "string",
  3803. "pattern": "^ses.*"
  3804. },
  3805. "required": true
  3806. },
  3807. {
  3808. "in": "path",
  3809. "name": "messageID",
  3810. "schema": {
  3811. "type": "string",
  3812. "pattern": "^msg.*"
  3813. },
  3814. "required": true
  3815. },
  3816. {
  3817. "in": "path",
  3818. "name": "partID",
  3819. "schema": {
  3820. "type": "string",
  3821. "pattern": "^prt.*"
  3822. },
  3823. "required": true
  3824. }
  3825. ],
  3826. "description": "Update a part in a message",
  3827. "responses": {
  3828. "200": {
  3829. "description": "Successfully updated part",
  3830. "content": {
  3831. "application/json": {
  3832. "schema": {
  3833. "$ref": "#/components/schemas/Part"
  3834. }
  3835. }
  3836. }
  3837. },
  3838. "400": {
  3839. "description": "Bad request",
  3840. "content": {
  3841. "application/json": {
  3842. "schema": {
  3843. "$ref": "#/components/schemas/BadRequestError"
  3844. }
  3845. }
  3846. }
  3847. },
  3848. "404": {
  3849. "description": "Not found",
  3850. "content": {
  3851. "application/json": {
  3852. "schema": {
  3853. "$ref": "#/components/schemas/NotFoundError"
  3854. }
  3855. }
  3856. }
  3857. }
  3858. },
  3859. "requestBody": {
  3860. "content": {
  3861. "application/json": {
  3862. "schema": {
  3863. "$ref": "#/components/schemas/Part"
  3864. }
  3865. }
  3866. }
  3867. },
  3868. "x-codeSamples": [
  3869. {
  3870. "lang": "js",
  3871. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.part.update({\n ...\n})"
  3872. }
  3873. ]
  3874. }
  3875. },
  3876. "/session/{sessionID}/prompt_async": {
  3877. "post": {
  3878. "operationId": "session.prompt_async",
  3879. "parameters": [
  3880. {
  3881. "in": "query",
  3882. "name": "directory",
  3883. "schema": {
  3884. "type": "string"
  3885. }
  3886. },
  3887. {
  3888. "in": "query",
  3889. "name": "workspace",
  3890. "schema": {
  3891. "type": "string"
  3892. }
  3893. },
  3894. {
  3895. "in": "path",
  3896. "name": "sessionID",
  3897. "schema": {
  3898. "type": "string",
  3899. "pattern": "^ses.*"
  3900. },
  3901. "required": true
  3902. }
  3903. ],
  3904. "summary": "Send async message",
  3905. "description": "Create and send a new message to a session asynchronously, starting the session if needed and returning immediately.",
  3906. "responses": {
  3907. "204": {
  3908. "description": "Prompt accepted"
  3909. },
  3910. "400": {
  3911. "description": "Bad request",
  3912. "content": {
  3913. "application/json": {
  3914. "schema": {
  3915. "$ref": "#/components/schemas/BadRequestError"
  3916. }
  3917. }
  3918. }
  3919. },
  3920. "404": {
  3921. "description": "Not found",
  3922. "content": {
  3923. "application/json": {
  3924. "schema": {
  3925. "$ref": "#/components/schemas/NotFoundError"
  3926. }
  3927. }
  3928. }
  3929. }
  3930. },
  3931. "requestBody": {
  3932. "content": {
  3933. "application/json": {
  3934. "schema": {
  3935. "type": "object",
  3936. "properties": {
  3937. "messageID": {
  3938. "type": "string",
  3939. "pattern": "^msg.*"
  3940. },
  3941. "model": {
  3942. "type": "object",
  3943. "properties": {
  3944. "providerID": {
  3945. "type": "string"
  3946. },
  3947. "modelID": {
  3948. "type": "string"
  3949. }
  3950. },
  3951. "required": ["providerID", "modelID"]
  3952. },
  3953. "agent": {
  3954. "type": "string"
  3955. },
  3956. "noReply": {
  3957. "type": "boolean"
  3958. },
  3959. "tools": {
  3960. "description": "@deprecated tools and permissions have been merged, you can set permissions on the session itself now",
  3961. "type": "object",
  3962. "propertyNames": {
  3963. "type": "string"
  3964. },
  3965. "additionalProperties": {
  3966. "type": "boolean"
  3967. }
  3968. },
  3969. "format": {
  3970. "$ref": "#/components/schemas/OutputFormat"
  3971. },
  3972. "system": {
  3973. "type": "string"
  3974. },
  3975. "variant": {
  3976. "type": "string"
  3977. },
  3978. "parts": {
  3979. "type": "array",
  3980. "items": {
  3981. "anyOf": [
  3982. {
  3983. "$ref": "#/components/schemas/TextPartInput"
  3984. },
  3985. {
  3986. "$ref": "#/components/schemas/FilePartInput"
  3987. },
  3988. {
  3989. "$ref": "#/components/schemas/AgentPartInput"
  3990. },
  3991. {
  3992. "$ref": "#/components/schemas/SubtaskPartInput"
  3993. }
  3994. ]
  3995. }
  3996. }
  3997. },
  3998. "required": ["parts"]
  3999. }
  4000. }
  4001. }
  4002. },
  4003. "x-codeSamples": [
  4004. {
  4005. "lang": "js",
  4006. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.prompt_async({\n ...\n})"
  4007. }
  4008. ]
  4009. }
  4010. },
  4011. "/session/{sessionID}/command": {
  4012. "post": {
  4013. "operationId": "session.command",
  4014. "parameters": [
  4015. {
  4016. "in": "query",
  4017. "name": "directory",
  4018. "schema": {
  4019. "type": "string"
  4020. }
  4021. },
  4022. {
  4023. "in": "query",
  4024. "name": "workspace",
  4025. "schema": {
  4026. "type": "string"
  4027. }
  4028. },
  4029. {
  4030. "in": "path",
  4031. "name": "sessionID",
  4032. "schema": {
  4033. "type": "string",
  4034. "pattern": "^ses.*"
  4035. },
  4036. "required": true
  4037. }
  4038. ],
  4039. "summary": "Send command",
  4040. "description": "Send a new command to a session for execution by the AI assistant.",
  4041. "responses": {
  4042. "200": {
  4043. "description": "Created message",
  4044. "content": {
  4045. "application/json": {
  4046. "schema": {
  4047. "type": "object",
  4048. "properties": {
  4049. "info": {
  4050. "$ref": "#/components/schemas/AssistantMessage"
  4051. },
  4052. "parts": {
  4053. "type": "array",
  4054. "items": {
  4055. "$ref": "#/components/schemas/Part"
  4056. }
  4057. }
  4058. },
  4059. "required": ["info", "parts"]
  4060. }
  4061. }
  4062. }
  4063. },
  4064. "400": {
  4065. "description": "Bad request",
  4066. "content": {
  4067. "application/json": {
  4068. "schema": {
  4069. "$ref": "#/components/schemas/BadRequestError"
  4070. }
  4071. }
  4072. }
  4073. },
  4074. "404": {
  4075. "description": "Not found",
  4076. "content": {
  4077. "application/json": {
  4078. "schema": {
  4079. "$ref": "#/components/schemas/NotFoundError"
  4080. }
  4081. }
  4082. }
  4083. }
  4084. },
  4085. "requestBody": {
  4086. "content": {
  4087. "application/json": {
  4088. "schema": {
  4089. "type": "object",
  4090. "properties": {
  4091. "messageID": {
  4092. "type": "string",
  4093. "pattern": "^msg.*"
  4094. },
  4095. "agent": {
  4096. "type": "string"
  4097. },
  4098. "model": {
  4099. "type": "string"
  4100. },
  4101. "arguments": {
  4102. "type": "string"
  4103. },
  4104. "command": {
  4105. "type": "string"
  4106. },
  4107. "variant": {
  4108. "type": "string"
  4109. },
  4110. "parts": {
  4111. "type": "array",
  4112. "items": {
  4113. "anyOf": [
  4114. {
  4115. "type": "object",
  4116. "properties": {
  4117. "id": {
  4118. "type": "string",
  4119. "pattern": "^prt.*"
  4120. },
  4121. "type": {
  4122. "type": "string",
  4123. "const": "file"
  4124. },
  4125. "mime": {
  4126. "type": "string"
  4127. },
  4128. "filename": {
  4129. "type": "string"
  4130. },
  4131. "url": {
  4132. "type": "string"
  4133. },
  4134. "source": {
  4135. "$ref": "#/components/schemas/FilePartSource"
  4136. }
  4137. },
  4138. "required": ["type", "mime", "url"]
  4139. }
  4140. ]
  4141. }
  4142. }
  4143. },
  4144. "required": ["arguments", "command"]
  4145. }
  4146. }
  4147. }
  4148. },
  4149. "x-codeSamples": [
  4150. {
  4151. "lang": "js",
  4152. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.command({\n ...\n})"
  4153. }
  4154. ]
  4155. }
  4156. },
  4157. "/session/{sessionID}/shell": {
  4158. "post": {
  4159. "operationId": "session.shell",
  4160. "parameters": [
  4161. {
  4162. "in": "query",
  4163. "name": "directory",
  4164. "schema": {
  4165. "type": "string"
  4166. }
  4167. },
  4168. {
  4169. "in": "query",
  4170. "name": "workspace",
  4171. "schema": {
  4172. "type": "string"
  4173. }
  4174. },
  4175. {
  4176. "in": "path",
  4177. "name": "sessionID",
  4178. "schema": {
  4179. "type": "string",
  4180. "pattern": "^ses.*"
  4181. },
  4182. "required": true
  4183. }
  4184. ],
  4185. "summary": "Run shell command",
  4186. "description": "Execute a shell command within the session context and return the AI's response.",
  4187. "responses": {
  4188. "200": {
  4189. "description": "Created message",
  4190. "content": {
  4191. "application/json": {
  4192. "schema": {
  4193. "type": "object",
  4194. "properties": {
  4195. "info": {
  4196. "$ref": "#/components/schemas/Message"
  4197. },
  4198. "parts": {
  4199. "type": "array",
  4200. "items": {
  4201. "$ref": "#/components/schemas/Part"
  4202. }
  4203. }
  4204. },
  4205. "required": ["info", "parts"]
  4206. }
  4207. }
  4208. }
  4209. },
  4210. "400": {
  4211. "description": "Bad request",
  4212. "content": {
  4213. "application/json": {
  4214. "schema": {
  4215. "$ref": "#/components/schemas/BadRequestError"
  4216. }
  4217. }
  4218. }
  4219. },
  4220. "404": {
  4221. "description": "Not found",
  4222. "content": {
  4223. "application/json": {
  4224. "schema": {
  4225. "$ref": "#/components/schemas/NotFoundError"
  4226. }
  4227. }
  4228. }
  4229. }
  4230. },
  4231. "requestBody": {
  4232. "content": {
  4233. "application/json": {
  4234. "schema": {
  4235. "type": "object",
  4236. "properties": {
  4237. "messageID": {
  4238. "type": "string",
  4239. "pattern": "^msg.*"
  4240. },
  4241. "agent": {
  4242. "type": "string"
  4243. },
  4244. "model": {
  4245. "type": "object",
  4246. "properties": {
  4247. "providerID": {
  4248. "type": "string"
  4249. },
  4250. "modelID": {
  4251. "type": "string"
  4252. }
  4253. },
  4254. "required": ["providerID", "modelID"]
  4255. },
  4256. "command": {
  4257. "type": "string"
  4258. }
  4259. },
  4260. "required": ["agent", "command"]
  4261. }
  4262. }
  4263. }
  4264. },
  4265. "x-codeSamples": [
  4266. {
  4267. "lang": "js",
  4268. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.shell({\n ...\n})"
  4269. }
  4270. ]
  4271. }
  4272. },
  4273. "/session/{sessionID}/revert": {
  4274. "post": {
  4275. "operationId": "session.revert",
  4276. "parameters": [
  4277. {
  4278. "in": "query",
  4279. "name": "directory",
  4280. "schema": {
  4281. "type": "string"
  4282. }
  4283. },
  4284. {
  4285. "in": "query",
  4286. "name": "workspace",
  4287. "schema": {
  4288. "type": "string"
  4289. }
  4290. },
  4291. {
  4292. "in": "path",
  4293. "name": "sessionID",
  4294. "schema": {
  4295. "type": "string",
  4296. "pattern": "^ses.*"
  4297. },
  4298. "required": true
  4299. }
  4300. ],
  4301. "summary": "Revert message",
  4302. "description": "Revert a specific message in a session, undoing its effects and restoring the previous state.",
  4303. "responses": {
  4304. "200": {
  4305. "description": "Updated session",
  4306. "content": {
  4307. "application/json": {
  4308. "schema": {
  4309. "$ref": "#/components/schemas/Session"
  4310. }
  4311. }
  4312. }
  4313. },
  4314. "400": {
  4315. "description": "Bad request",
  4316. "content": {
  4317. "application/json": {
  4318. "schema": {
  4319. "$ref": "#/components/schemas/BadRequestError"
  4320. }
  4321. }
  4322. }
  4323. },
  4324. "404": {
  4325. "description": "Not found",
  4326. "content": {
  4327. "application/json": {
  4328. "schema": {
  4329. "$ref": "#/components/schemas/NotFoundError"
  4330. }
  4331. }
  4332. }
  4333. }
  4334. },
  4335. "requestBody": {
  4336. "content": {
  4337. "application/json": {
  4338. "schema": {
  4339. "type": "object",
  4340. "properties": {
  4341. "messageID": {
  4342. "type": "string",
  4343. "pattern": "^msg.*"
  4344. },
  4345. "partID": {
  4346. "type": "string",
  4347. "pattern": "^prt.*"
  4348. }
  4349. },
  4350. "required": ["messageID"]
  4351. }
  4352. }
  4353. }
  4354. },
  4355. "x-codeSamples": [
  4356. {
  4357. "lang": "js",
  4358. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.revert({\n ...\n})"
  4359. }
  4360. ]
  4361. }
  4362. },
  4363. "/session/{sessionID}/unrevert": {
  4364. "post": {
  4365. "operationId": "session.unrevert",
  4366. "parameters": [
  4367. {
  4368. "in": "query",
  4369. "name": "directory",
  4370. "schema": {
  4371. "type": "string"
  4372. }
  4373. },
  4374. {
  4375. "in": "query",
  4376. "name": "workspace",
  4377. "schema": {
  4378. "type": "string"
  4379. }
  4380. },
  4381. {
  4382. "in": "path",
  4383. "name": "sessionID",
  4384. "schema": {
  4385. "type": "string",
  4386. "pattern": "^ses.*"
  4387. },
  4388. "required": true
  4389. }
  4390. ],
  4391. "summary": "Restore reverted messages",
  4392. "description": "Restore all previously reverted messages in a session.",
  4393. "responses": {
  4394. "200": {
  4395. "description": "Updated session",
  4396. "content": {
  4397. "application/json": {
  4398. "schema": {
  4399. "$ref": "#/components/schemas/Session"
  4400. }
  4401. }
  4402. }
  4403. },
  4404. "400": {
  4405. "description": "Bad request",
  4406. "content": {
  4407. "application/json": {
  4408. "schema": {
  4409. "$ref": "#/components/schemas/BadRequestError"
  4410. }
  4411. }
  4412. }
  4413. },
  4414. "404": {
  4415. "description": "Not found",
  4416. "content": {
  4417. "application/json": {
  4418. "schema": {
  4419. "$ref": "#/components/schemas/NotFoundError"
  4420. }
  4421. }
  4422. }
  4423. }
  4424. },
  4425. "x-codeSamples": [
  4426. {
  4427. "lang": "js",
  4428. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.unrevert({\n ...\n})"
  4429. }
  4430. ]
  4431. }
  4432. },
  4433. "/session/{sessionID}/permissions/{permissionID}": {
  4434. "post": {
  4435. "operationId": "permission.respond",
  4436. "parameters": [
  4437. {
  4438. "in": "query",
  4439. "name": "directory",
  4440. "schema": {
  4441. "type": "string"
  4442. }
  4443. },
  4444. {
  4445. "in": "query",
  4446. "name": "workspace",
  4447. "schema": {
  4448. "type": "string"
  4449. }
  4450. },
  4451. {
  4452. "in": "path",
  4453. "name": "sessionID",
  4454. "schema": {
  4455. "type": "string",
  4456. "pattern": "^ses.*"
  4457. },
  4458. "required": true
  4459. },
  4460. {
  4461. "in": "path",
  4462. "name": "permissionID",
  4463. "schema": {
  4464. "type": "string",
  4465. "pattern": "^per.*"
  4466. },
  4467. "required": true
  4468. }
  4469. ],
  4470. "summary": "Respond to permission",
  4471. "deprecated": true,
  4472. "description": "Approve or deny a permission request from the AI assistant.",
  4473. "responses": {
  4474. "200": {
  4475. "description": "Permission processed successfully",
  4476. "content": {
  4477. "application/json": {
  4478. "schema": {
  4479. "type": "boolean"
  4480. }
  4481. }
  4482. }
  4483. },
  4484. "400": {
  4485. "description": "Bad request",
  4486. "content": {
  4487. "application/json": {
  4488. "schema": {
  4489. "$ref": "#/components/schemas/BadRequestError"
  4490. }
  4491. }
  4492. }
  4493. },
  4494. "404": {
  4495. "description": "Not found",
  4496. "content": {
  4497. "application/json": {
  4498. "schema": {
  4499. "$ref": "#/components/schemas/NotFoundError"
  4500. }
  4501. }
  4502. }
  4503. }
  4504. },
  4505. "requestBody": {
  4506. "content": {
  4507. "application/json": {
  4508. "schema": {
  4509. "type": "object",
  4510. "properties": {
  4511. "response": {
  4512. "type": "string",
  4513. "enum": ["once", "always", "reject"]
  4514. }
  4515. },
  4516. "required": ["response"]
  4517. }
  4518. }
  4519. }
  4520. },
  4521. "x-codeSamples": [
  4522. {
  4523. "lang": "js",
  4524. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.permission.respond({\n ...\n})"
  4525. }
  4526. ]
  4527. }
  4528. },
  4529. "/permission/{requestID}/reply": {
  4530. "post": {
  4531. "operationId": "permission.reply",
  4532. "parameters": [
  4533. {
  4534. "in": "query",
  4535. "name": "directory",
  4536. "schema": {
  4537. "type": "string"
  4538. }
  4539. },
  4540. {
  4541. "in": "query",
  4542. "name": "workspace",
  4543. "schema": {
  4544. "type": "string"
  4545. }
  4546. },
  4547. {
  4548. "in": "path",
  4549. "name": "requestID",
  4550. "schema": {
  4551. "type": "string",
  4552. "pattern": "^per.*"
  4553. },
  4554. "required": true
  4555. }
  4556. ],
  4557. "summary": "Respond to permission request",
  4558. "description": "Approve or deny a permission request from the AI assistant.",
  4559. "responses": {
  4560. "200": {
  4561. "description": "Permission processed successfully",
  4562. "content": {
  4563. "application/json": {
  4564. "schema": {
  4565. "type": "boolean"
  4566. }
  4567. }
  4568. }
  4569. },
  4570. "400": {
  4571. "description": "Bad request",
  4572. "content": {
  4573. "application/json": {
  4574. "schema": {
  4575. "$ref": "#/components/schemas/BadRequestError"
  4576. }
  4577. }
  4578. }
  4579. },
  4580. "404": {
  4581. "description": "Not found",
  4582. "content": {
  4583. "application/json": {
  4584. "schema": {
  4585. "$ref": "#/components/schemas/NotFoundError"
  4586. }
  4587. }
  4588. }
  4589. }
  4590. },
  4591. "requestBody": {
  4592. "content": {
  4593. "application/json": {
  4594. "schema": {
  4595. "type": "object",
  4596. "properties": {
  4597. "reply": {
  4598. "type": "string",
  4599. "enum": ["once", "always", "reject"]
  4600. },
  4601. "message": {
  4602. "type": "string"
  4603. }
  4604. },
  4605. "required": ["reply"]
  4606. }
  4607. }
  4608. }
  4609. },
  4610. "x-codeSamples": [
  4611. {
  4612. "lang": "js",
  4613. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.permission.reply({\n ...\n})"
  4614. }
  4615. ]
  4616. }
  4617. },
  4618. "/permission": {
  4619. "get": {
  4620. "operationId": "permission.list",
  4621. "parameters": [
  4622. {
  4623. "in": "query",
  4624. "name": "directory",
  4625. "schema": {
  4626. "type": "string"
  4627. }
  4628. },
  4629. {
  4630. "in": "query",
  4631. "name": "workspace",
  4632. "schema": {
  4633. "type": "string"
  4634. }
  4635. }
  4636. ],
  4637. "summary": "List pending permissions",
  4638. "description": "Get all pending permission requests across all sessions.",
  4639. "responses": {
  4640. "200": {
  4641. "description": "List of pending permissions",
  4642. "content": {
  4643. "application/json": {
  4644. "schema": {
  4645. "type": "array",
  4646. "items": {
  4647. "$ref": "#/components/schemas/PermissionRequest"
  4648. }
  4649. }
  4650. }
  4651. }
  4652. }
  4653. },
  4654. "x-codeSamples": [
  4655. {
  4656. "lang": "js",
  4657. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.permission.list({\n ...\n})"
  4658. }
  4659. ]
  4660. }
  4661. },
  4662. "/question": {
  4663. "get": {
  4664. "operationId": "question.list",
  4665. "parameters": [
  4666. {
  4667. "in": "query",
  4668. "name": "directory",
  4669. "schema": {
  4670. "type": "string"
  4671. }
  4672. },
  4673. {
  4674. "in": "query",
  4675. "name": "workspace",
  4676. "schema": {
  4677. "type": "string"
  4678. }
  4679. }
  4680. ],
  4681. "summary": "List pending questions",
  4682. "description": "Get all pending question requests across all sessions.",
  4683. "responses": {
  4684. "200": {
  4685. "description": "List of pending questions",
  4686. "content": {
  4687. "application/json": {
  4688. "schema": {
  4689. "type": "array",
  4690. "items": {
  4691. "$ref": "#/components/schemas/QuestionRequest"
  4692. }
  4693. }
  4694. }
  4695. }
  4696. }
  4697. },
  4698. "x-codeSamples": [
  4699. {
  4700. "lang": "js",
  4701. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.question.list({\n ...\n})"
  4702. }
  4703. ]
  4704. }
  4705. },
  4706. "/question/{requestID}/reply": {
  4707. "post": {
  4708. "operationId": "question.reply",
  4709. "parameters": [
  4710. {
  4711. "in": "query",
  4712. "name": "directory",
  4713. "schema": {
  4714. "type": "string"
  4715. }
  4716. },
  4717. {
  4718. "in": "query",
  4719. "name": "workspace",
  4720. "schema": {
  4721. "type": "string"
  4722. }
  4723. },
  4724. {
  4725. "in": "path",
  4726. "name": "requestID",
  4727. "schema": {
  4728. "type": "string",
  4729. "pattern": "^que.*"
  4730. },
  4731. "required": true
  4732. }
  4733. ],
  4734. "summary": "Reply to question request",
  4735. "description": "Provide answers to a question request from the AI assistant.",
  4736. "responses": {
  4737. "200": {
  4738. "description": "Question answered successfully",
  4739. "content": {
  4740. "application/json": {
  4741. "schema": {
  4742. "type": "boolean"
  4743. }
  4744. }
  4745. }
  4746. },
  4747. "400": {
  4748. "description": "Bad request",
  4749. "content": {
  4750. "application/json": {
  4751. "schema": {
  4752. "$ref": "#/components/schemas/BadRequestError"
  4753. }
  4754. }
  4755. }
  4756. },
  4757. "404": {
  4758. "description": "Not found",
  4759. "content": {
  4760. "application/json": {
  4761. "schema": {
  4762. "$ref": "#/components/schemas/NotFoundError"
  4763. }
  4764. }
  4765. }
  4766. }
  4767. },
  4768. "requestBody": {
  4769. "content": {
  4770. "application/json": {
  4771. "schema": {
  4772. "type": "object",
  4773. "properties": {
  4774. "answers": {
  4775. "description": "User answers in order of questions (each answer is an array of selected labels)",
  4776. "type": "array",
  4777. "items": {
  4778. "$ref": "#/components/schemas/QuestionAnswer"
  4779. }
  4780. }
  4781. },
  4782. "required": ["answers"]
  4783. }
  4784. }
  4785. }
  4786. },
  4787. "x-codeSamples": [
  4788. {
  4789. "lang": "js",
  4790. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.question.reply({\n ...\n})"
  4791. }
  4792. ]
  4793. }
  4794. },
  4795. "/question/{requestID}/reject": {
  4796. "post": {
  4797. "operationId": "question.reject",
  4798. "parameters": [
  4799. {
  4800. "in": "query",
  4801. "name": "directory",
  4802. "schema": {
  4803. "type": "string"
  4804. }
  4805. },
  4806. {
  4807. "in": "query",
  4808. "name": "workspace",
  4809. "schema": {
  4810. "type": "string"
  4811. }
  4812. },
  4813. {
  4814. "in": "path",
  4815. "name": "requestID",
  4816. "schema": {
  4817. "type": "string",
  4818. "pattern": "^que.*"
  4819. },
  4820. "required": true
  4821. }
  4822. ],
  4823. "summary": "Reject question request",
  4824. "description": "Reject a question request from the AI assistant.",
  4825. "responses": {
  4826. "200": {
  4827. "description": "Question rejected successfully",
  4828. "content": {
  4829. "application/json": {
  4830. "schema": {
  4831. "type": "boolean"
  4832. }
  4833. }
  4834. }
  4835. },
  4836. "400": {
  4837. "description": "Bad request",
  4838. "content": {
  4839. "application/json": {
  4840. "schema": {
  4841. "$ref": "#/components/schemas/BadRequestError"
  4842. }
  4843. }
  4844. }
  4845. },
  4846. "404": {
  4847. "description": "Not found",
  4848. "content": {
  4849. "application/json": {
  4850. "schema": {
  4851. "$ref": "#/components/schemas/NotFoundError"
  4852. }
  4853. }
  4854. }
  4855. }
  4856. },
  4857. "x-codeSamples": [
  4858. {
  4859. "lang": "js",
  4860. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.question.reject({\n ...\n})"
  4861. }
  4862. ]
  4863. }
  4864. },
  4865. "/provider": {
  4866. "get": {
  4867. "operationId": "provider.list",
  4868. "parameters": [
  4869. {
  4870. "in": "query",
  4871. "name": "directory",
  4872. "schema": {
  4873. "type": "string"
  4874. }
  4875. },
  4876. {
  4877. "in": "query",
  4878. "name": "workspace",
  4879. "schema": {
  4880. "type": "string"
  4881. }
  4882. }
  4883. ],
  4884. "summary": "List providers",
  4885. "description": "Get a list of all available AI providers, including both available and connected ones.",
  4886. "responses": {
  4887. "200": {
  4888. "description": "List of providers",
  4889. "content": {
  4890. "application/json": {
  4891. "schema": {
  4892. "type": "object",
  4893. "properties": {
  4894. "all": {
  4895. "type": "array",
  4896. "items": {
  4897. "$ref": "#/components/schemas/Provider"
  4898. }
  4899. },
  4900. "default": {
  4901. "type": "object",
  4902. "propertyNames": {
  4903. "type": "string"
  4904. },
  4905. "additionalProperties": {
  4906. "type": "string"
  4907. }
  4908. },
  4909. "connected": {
  4910. "type": "array",
  4911. "items": {
  4912. "type": "string"
  4913. }
  4914. }
  4915. },
  4916. "required": ["all", "default", "connected"]
  4917. }
  4918. }
  4919. }
  4920. }
  4921. },
  4922. "x-codeSamples": [
  4923. {
  4924. "lang": "js",
  4925. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.list({\n ...\n})"
  4926. }
  4927. ]
  4928. }
  4929. },
  4930. "/provider/auth": {
  4931. "get": {
  4932. "operationId": "provider.auth",
  4933. "parameters": [
  4934. {
  4935. "in": "query",
  4936. "name": "directory",
  4937. "schema": {
  4938. "type": "string"
  4939. }
  4940. },
  4941. {
  4942. "in": "query",
  4943. "name": "workspace",
  4944. "schema": {
  4945. "type": "string"
  4946. }
  4947. }
  4948. ],
  4949. "summary": "Get provider auth methods",
  4950. "description": "Retrieve available authentication methods for all AI providers.",
  4951. "responses": {
  4952. "200": {
  4953. "description": "Provider auth methods",
  4954. "content": {
  4955. "application/json": {
  4956. "schema": {
  4957. "type": "object",
  4958. "propertyNames": {
  4959. "type": "string"
  4960. },
  4961. "additionalProperties": {
  4962. "type": "array",
  4963. "items": {
  4964. "$ref": "#/components/schemas/ProviderAuthMethod"
  4965. }
  4966. }
  4967. }
  4968. }
  4969. }
  4970. }
  4971. },
  4972. "x-codeSamples": [
  4973. {
  4974. "lang": "js",
  4975. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.auth({\n ...\n})"
  4976. }
  4977. ]
  4978. }
  4979. },
  4980. "/provider/{providerID}/oauth/authorize": {
  4981. "post": {
  4982. "operationId": "provider.oauth.authorize",
  4983. "parameters": [
  4984. {
  4985. "in": "query",
  4986. "name": "directory",
  4987. "schema": {
  4988. "type": "string"
  4989. }
  4990. },
  4991. {
  4992. "in": "query",
  4993. "name": "workspace",
  4994. "schema": {
  4995. "type": "string"
  4996. }
  4997. },
  4998. {
  4999. "in": "path",
  5000. "name": "providerID",
  5001. "schema": {
  5002. "type": "string"
  5003. },
  5004. "required": true,
  5005. "description": "Provider ID"
  5006. }
  5007. ],
  5008. "summary": "OAuth authorize",
  5009. "description": "Initiate OAuth authorization for a specific AI provider to get an authorization URL.",
  5010. "responses": {
  5011. "200": {
  5012. "description": "Authorization URL and method",
  5013. "content": {
  5014. "application/json": {
  5015. "schema": {
  5016. "$ref": "#/components/schemas/ProviderAuthAuthorization"
  5017. }
  5018. }
  5019. }
  5020. },
  5021. "400": {
  5022. "description": "Bad request",
  5023. "content": {
  5024. "application/json": {
  5025. "schema": {
  5026. "$ref": "#/components/schemas/BadRequestError"
  5027. }
  5028. }
  5029. }
  5030. }
  5031. },
  5032. "requestBody": {
  5033. "content": {
  5034. "application/json": {
  5035. "schema": {
  5036. "type": "object",
  5037. "properties": {
  5038. "method": {
  5039. "description": "Auth method index",
  5040. "type": "number"
  5041. },
  5042. "inputs": {
  5043. "description": "Prompt inputs",
  5044. "type": "object",
  5045. "propertyNames": {
  5046. "type": "string"
  5047. },
  5048. "additionalProperties": {
  5049. "type": "string"
  5050. }
  5051. }
  5052. },
  5053. "required": ["method"]
  5054. }
  5055. }
  5056. }
  5057. },
  5058. "x-codeSamples": [
  5059. {
  5060. "lang": "js",
  5061. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.oauth.authorize({\n ...\n})"
  5062. }
  5063. ]
  5064. }
  5065. },
  5066. "/provider/{providerID}/oauth/callback": {
  5067. "post": {
  5068. "operationId": "provider.oauth.callback",
  5069. "parameters": [
  5070. {
  5071. "in": "query",
  5072. "name": "directory",
  5073. "schema": {
  5074. "type": "string"
  5075. }
  5076. },
  5077. {
  5078. "in": "query",
  5079. "name": "workspace",
  5080. "schema": {
  5081. "type": "string"
  5082. }
  5083. },
  5084. {
  5085. "in": "path",
  5086. "name": "providerID",
  5087. "schema": {
  5088. "type": "string"
  5089. },
  5090. "required": true,
  5091. "description": "Provider ID"
  5092. }
  5093. ],
  5094. "summary": "OAuth callback",
  5095. "description": "Handle the OAuth callback from a provider after user authorization.",
  5096. "responses": {
  5097. "200": {
  5098. "description": "OAuth callback processed successfully",
  5099. "content": {
  5100. "application/json": {
  5101. "schema": {
  5102. "type": "boolean"
  5103. }
  5104. }
  5105. }
  5106. },
  5107. "400": {
  5108. "description": "Bad request",
  5109. "content": {
  5110. "application/json": {
  5111. "schema": {
  5112. "$ref": "#/components/schemas/BadRequestError"
  5113. }
  5114. }
  5115. }
  5116. }
  5117. },
  5118. "requestBody": {
  5119. "content": {
  5120. "application/json": {
  5121. "schema": {
  5122. "type": "object",
  5123. "properties": {
  5124. "method": {
  5125. "description": "Auth method index",
  5126. "type": "number"
  5127. },
  5128. "code": {
  5129. "description": "OAuth authorization code",
  5130. "type": "string"
  5131. }
  5132. },
  5133. "required": ["method"]
  5134. }
  5135. }
  5136. }
  5137. },
  5138. "x-codeSamples": [
  5139. {
  5140. "lang": "js",
  5141. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.oauth.callback({\n ...\n})"
  5142. }
  5143. ]
  5144. }
  5145. },
  5146. "/find": {
  5147. "get": {
  5148. "operationId": "find.text",
  5149. "parameters": [
  5150. {
  5151. "in": "query",
  5152. "name": "directory",
  5153. "schema": {
  5154. "type": "string"
  5155. }
  5156. },
  5157. {
  5158. "in": "query",
  5159. "name": "workspace",
  5160. "schema": {
  5161. "type": "string"
  5162. }
  5163. },
  5164. {
  5165. "in": "query",
  5166. "name": "pattern",
  5167. "schema": {
  5168. "type": "string"
  5169. },
  5170. "required": true
  5171. }
  5172. ],
  5173. "summary": "Find text",
  5174. "description": "Search for text patterns across files in the project using ripgrep.",
  5175. "responses": {
  5176. "200": {
  5177. "description": "Matches",
  5178. "content": {
  5179. "application/json": {
  5180. "schema": {
  5181. "type": "array",
  5182. "items": {
  5183. "type": "object",
  5184. "properties": {
  5185. "path": {
  5186. "type": "object",
  5187. "properties": {
  5188. "text": {
  5189. "type": "string"
  5190. }
  5191. },
  5192. "required": ["text"]
  5193. },
  5194. "lines": {
  5195. "type": "object",
  5196. "properties": {
  5197. "text": {
  5198. "type": "string"
  5199. }
  5200. },
  5201. "required": ["text"]
  5202. },
  5203. "line_number": {
  5204. "type": "number"
  5205. },
  5206. "absolute_offset": {
  5207. "type": "number"
  5208. },
  5209. "submatches": {
  5210. "type": "array",
  5211. "items": {
  5212. "type": "object",
  5213. "properties": {
  5214. "match": {
  5215. "type": "object",
  5216. "properties": {
  5217. "text": {
  5218. "type": "string"
  5219. }
  5220. },
  5221. "required": ["text"]
  5222. },
  5223. "start": {
  5224. "type": "number"
  5225. },
  5226. "end": {
  5227. "type": "number"
  5228. }
  5229. },
  5230. "required": ["match", "start", "end"]
  5231. }
  5232. }
  5233. },
  5234. "required": ["path", "lines", "line_number", "absolute_offset", "submatches"]
  5235. }
  5236. }
  5237. }
  5238. }
  5239. }
  5240. },
  5241. "x-codeSamples": [
  5242. {
  5243. "lang": "js",
  5244. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.find.text({\n ...\n})"
  5245. }
  5246. ]
  5247. }
  5248. },
  5249. "/find/file": {
  5250. "get": {
  5251. "operationId": "find.files",
  5252. "parameters": [
  5253. {
  5254. "in": "query",
  5255. "name": "directory",
  5256. "schema": {
  5257. "type": "string"
  5258. }
  5259. },
  5260. {
  5261. "in": "query",
  5262. "name": "workspace",
  5263. "schema": {
  5264. "type": "string"
  5265. }
  5266. },
  5267. {
  5268. "in": "query",
  5269. "name": "query",
  5270. "schema": {
  5271. "type": "string"
  5272. },
  5273. "required": true
  5274. },
  5275. {
  5276. "in": "query",
  5277. "name": "dirs",
  5278. "schema": {
  5279. "type": "string",
  5280. "enum": ["true", "false"]
  5281. }
  5282. },
  5283. {
  5284. "in": "query",
  5285. "name": "type",
  5286. "schema": {
  5287. "type": "string",
  5288. "enum": ["file", "directory"]
  5289. }
  5290. },
  5291. {
  5292. "in": "query",
  5293. "name": "limit",
  5294. "schema": {
  5295. "type": "integer",
  5296. "minimum": 1,
  5297. "maximum": 200
  5298. }
  5299. }
  5300. ],
  5301. "summary": "Find files",
  5302. "description": "Search for files or directories by name or pattern in the project directory.",
  5303. "responses": {
  5304. "200": {
  5305. "description": "File paths",
  5306. "content": {
  5307. "application/json": {
  5308. "schema": {
  5309. "type": "array",
  5310. "items": {
  5311. "type": "string"
  5312. }
  5313. }
  5314. }
  5315. }
  5316. }
  5317. },
  5318. "x-codeSamples": [
  5319. {
  5320. "lang": "js",
  5321. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.find.files({\n ...\n})"
  5322. }
  5323. ]
  5324. }
  5325. },
  5326. "/find/symbol": {
  5327. "get": {
  5328. "operationId": "find.symbols",
  5329. "parameters": [
  5330. {
  5331. "in": "query",
  5332. "name": "directory",
  5333. "schema": {
  5334. "type": "string"
  5335. }
  5336. },
  5337. {
  5338. "in": "query",
  5339. "name": "workspace",
  5340. "schema": {
  5341. "type": "string"
  5342. }
  5343. },
  5344. {
  5345. "in": "query",
  5346. "name": "query",
  5347. "schema": {
  5348. "type": "string"
  5349. },
  5350. "required": true
  5351. }
  5352. ],
  5353. "summary": "Find symbols",
  5354. "description": "Search for workspace symbols like functions, classes, and variables using LSP.",
  5355. "responses": {
  5356. "200": {
  5357. "description": "Symbols",
  5358. "content": {
  5359. "application/json": {
  5360. "schema": {
  5361. "type": "array",
  5362. "items": {
  5363. "$ref": "#/components/schemas/Symbol"
  5364. }
  5365. }
  5366. }
  5367. }
  5368. }
  5369. },
  5370. "x-codeSamples": [
  5371. {
  5372. "lang": "js",
  5373. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.find.symbols({\n ...\n})"
  5374. }
  5375. ]
  5376. }
  5377. },
  5378. "/file": {
  5379. "get": {
  5380. "operationId": "file.list",
  5381. "parameters": [
  5382. {
  5383. "in": "query",
  5384. "name": "directory",
  5385. "schema": {
  5386. "type": "string"
  5387. }
  5388. },
  5389. {
  5390. "in": "query",
  5391. "name": "workspace",
  5392. "schema": {
  5393. "type": "string"
  5394. }
  5395. },
  5396. {
  5397. "in": "query",
  5398. "name": "path",
  5399. "schema": {
  5400. "type": "string"
  5401. },
  5402. "required": true
  5403. }
  5404. ],
  5405. "summary": "List files",
  5406. "description": "List files and directories in a specified path.",
  5407. "responses": {
  5408. "200": {
  5409. "description": "Files and directories",
  5410. "content": {
  5411. "application/json": {
  5412. "schema": {
  5413. "type": "array",
  5414. "items": {
  5415. "$ref": "#/components/schemas/FileNode"
  5416. }
  5417. }
  5418. }
  5419. }
  5420. }
  5421. },
  5422. "x-codeSamples": [
  5423. {
  5424. "lang": "js",
  5425. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.file.list({\n ...\n})"
  5426. }
  5427. ]
  5428. }
  5429. },
  5430. "/file/content": {
  5431. "get": {
  5432. "operationId": "file.read",
  5433. "parameters": [
  5434. {
  5435. "in": "query",
  5436. "name": "directory",
  5437. "schema": {
  5438. "type": "string"
  5439. }
  5440. },
  5441. {
  5442. "in": "query",
  5443. "name": "workspace",
  5444. "schema": {
  5445. "type": "string"
  5446. }
  5447. },
  5448. {
  5449. "in": "query",
  5450. "name": "path",
  5451. "schema": {
  5452. "type": "string"
  5453. },
  5454. "required": true
  5455. }
  5456. ],
  5457. "summary": "Read file",
  5458. "description": "Read the content of a specified file.",
  5459. "responses": {
  5460. "200": {
  5461. "description": "File content",
  5462. "content": {
  5463. "application/json": {
  5464. "schema": {
  5465. "$ref": "#/components/schemas/FileContent"
  5466. }
  5467. }
  5468. }
  5469. }
  5470. },
  5471. "x-codeSamples": [
  5472. {
  5473. "lang": "js",
  5474. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.file.read({\n ...\n})"
  5475. }
  5476. ]
  5477. }
  5478. },
  5479. "/file/status": {
  5480. "get": {
  5481. "operationId": "file.status",
  5482. "parameters": [
  5483. {
  5484. "in": "query",
  5485. "name": "directory",
  5486. "schema": {
  5487. "type": "string"
  5488. }
  5489. },
  5490. {
  5491. "in": "query",
  5492. "name": "workspace",
  5493. "schema": {
  5494. "type": "string"
  5495. }
  5496. }
  5497. ],
  5498. "summary": "Get file status",
  5499. "description": "Get the git status of all files in the project.",
  5500. "responses": {
  5501. "200": {
  5502. "description": "File status",
  5503. "content": {
  5504. "application/json": {
  5505. "schema": {
  5506. "type": "array",
  5507. "items": {
  5508. "$ref": "#/components/schemas/File"
  5509. }
  5510. }
  5511. }
  5512. }
  5513. }
  5514. },
  5515. "x-codeSamples": [
  5516. {
  5517. "lang": "js",
  5518. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.file.status({\n ...\n})"
  5519. }
  5520. ]
  5521. }
  5522. },
  5523. "/event": {
  5524. "get": {
  5525. "operationId": "event.subscribe",
  5526. "parameters": [
  5527. {
  5528. "in": "query",
  5529. "name": "directory",
  5530. "schema": {
  5531. "type": "string"
  5532. }
  5533. },
  5534. {
  5535. "in": "query",
  5536. "name": "workspace",
  5537. "schema": {
  5538. "type": "string"
  5539. }
  5540. }
  5541. ],
  5542. "summary": "Subscribe to events",
  5543. "description": "Get events",
  5544. "responses": {
  5545. "200": {
  5546. "description": "Event stream",
  5547. "content": {
  5548. "text/event-stream": {
  5549. "schema": {
  5550. "$ref": "#/components/schemas/Event"
  5551. }
  5552. }
  5553. }
  5554. }
  5555. },
  5556. "x-codeSamples": [
  5557. {
  5558. "lang": "js",
  5559. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.event.subscribe({\n ...\n})"
  5560. }
  5561. ]
  5562. }
  5563. },
  5564. "/mcp": {
  5565. "get": {
  5566. "operationId": "mcp.status",
  5567. "parameters": [
  5568. {
  5569. "in": "query",
  5570. "name": "directory",
  5571. "schema": {
  5572. "type": "string"
  5573. }
  5574. },
  5575. {
  5576. "in": "query",
  5577. "name": "workspace",
  5578. "schema": {
  5579. "type": "string"
  5580. }
  5581. }
  5582. ],
  5583. "summary": "Get MCP status",
  5584. "description": "Get the status of all Model Context Protocol (MCP) servers.",
  5585. "responses": {
  5586. "200": {
  5587. "description": "MCP server status",
  5588. "content": {
  5589. "application/json": {
  5590. "schema": {
  5591. "type": "object",
  5592. "propertyNames": {
  5593. "type": "string"
  5594. },
  5595. "additionalProperties": {
  5596. "$ref": "#/components/schemas/MCPStatus"
  5597. }
  5598. }
  5599. }
  5600. }
  5601. }
  5602. },
  5603. "x-codeSamples": [
  5604. {
  5605. "lang": "js",
  5606. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.status({\n ...\n})"
  5607. }
  5608. ]
  5609. },
  5610. "post": {
  5611. "operationId": "mcp.add",
  5612. "parameters": [
  5613. {
  5614. "in": "query",
  5615. "name": "directory",
  5616. "schema": {
  5617. "type": "string"
  5618. }
  5619. },
  5620. {
  5621. "in": "query",
  5622. "name": "workspace",
  5623. "schema": {
  5624. "type": "string"
  5625. }
  5626. }
  5627. ],
  5628. "summary": "Add MCP server",
  5629. "description": "Dynamically add a new Model Context Protocol (MCP) server to the system.",
  5630. "responses": {
  5631. "200": {
  5632. "description": "MCP server added successfully",
  5633. "content": {
  5634. "application/json": {
  5635. "schema": {
  5636. "type": "object",
  5637. "propertyNames": {
  5638. "type": "string"
  5639. },
  5640. "additionalProperties": {
  5641. "$ref": "#/components/schemas/MCPStatus"
  5642. }
  5643. }
  5644. }
  5645. }
  5646. },
  5647. "400": {
  5648. "description": "Bad request",
  5649. "content": {
  5650. "application/json": {
  5651. "schema": {
  5652. "$ref": "#/components/schemas/BadRequestError"
  5653. }
  5654. }
  5655. }
  5656. }
  5657. },
  5658. "requestBody": {
  5659. "content": {
  5660. "application/json": {
  5661. "schema": {
  5662. "type": "object",
  5663. "properties": {
  5664. "name": {
  5665. "type": "string"
  5666. },
  5667. "config": {
  5668. "anyOf": [
  5669. {
  5670. "$ref": "#/components/schemas/McpLocalConfig"
  5671. },
  5672. {
  5673. "$ref": "#/components/schemas/McpRemoteConfig"
  5674. }
  5675. ]
  5676. }
  5677. },
  5678. "required": ["name", "config"]
  5679. }
  5680. }
  5681. }
  5682. },
  5683. "x-codeSamples": [
  5684. {
  5685. "lang": "js",
  5686. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.add({\n ...\n})"
  5687. }
  5688. ]
  5689. }
  5690. },
  5691. "/mcp/{name}/auth": {
  5692. "post": {
  5693. "operationId": "mcp.auth.start",
  5694. "parameters": [
  5695. {
  5696. "in": "query",
  5697. "name": "directory",
  5698. "schema": {
  5699. "type": "string"
  5700. }
  5701. },
  5702. {
  5703. "in": "query",
  5704. "name": "workspace",
  5705. "schema": {
  5706. "type": "string"
  5707. }
  5708. },
  5709. {
  5710. "schema": {
  5711. "type": "string"
  5712. },
  5713. "in": "path",
  5714. "name": "name",
  5715. "required": true
  5716. }
  5717. ],
  5718. "summary": "Start MCP OAuth",
  5719. "description": "Start OAuth authentication flow for a Model Context Protocol (MCP) server.",
  5720. "responses": {
  5721. "200": {
  5722. "description": "OAuth flow started",
  5723. "content": {
  5724. "application/json": {
  5725. "schema": {
  5726. "type": "object",
  5727. "properties": {
  5728. "authorizationUrl": {
  5729. "description": "URL to open in browser for authorization",
  5730. "type": "string"
  5731. }
  5732. },
  5733. "required": ["authorizationUrl"]
  5734. }
  5735. }
  5736. }
  5737. },
  5738. "400": {
  5739. "description": "Bad request",
  5740. "content": {
  5741. "application/json": {
  5742. "schema": {
  5743. "$ref": "#/components/schemas/BadRequestError"
  5744. }
  5745. }
  5746. }
  5747. },
  5748. "404": {
  5749. "description": "Not found",
  5750. "content": {
  5751. "application/json": {
  5752. "schema": {
  5753. "$ref": "#/components/schemas/NotFoundError"
  5754. }
  5755. }
  5756. }
  5757. }
  5758. },
  5759. "x-codeSamples": [
  5760. {
  5761. "lang": "js",
  5762. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.start({\n ...\n})"
  5763. }
  5764. ]
  5765. },
  5766. "delete": {
  5767. "operationId": "mcp.auth.remove",
  5768. "parameters": [
  5769. {
  5770. "in": "query",
  5771. "name": "directory",
  5772. "schema": {
  5773. "type": "string"
  5774. }
  5775. },
  5776. {
  5777. "in": "query",
  5778. "name": "workspace",
  5779. "schema": {
  5780. "type": "string"
  5781. }
  5782. },
  5783. {
  5784. "schema": {
  5785. "type": "string"
  5786. },
  5787. "in": "path",
  5788. "name": "name",
  5789. "required": true
  5790. }
  5791. ],
  5792. "summary": "Remove MCP OAuth",
  5793. "description": "Remove OAuth credentials for an MCP server",
  5794. "responses": {
  5795. "200": {
  5796. "description": "OAuth credentials removed",
  5797. "content": {
  5798. "application/json": {
  5799. "schema": {
  5800. "type": "object",
  5801. "properties": {
  5802. "success": {
  5803. "type": "boolean",
  5804. "const": true
  5805. }
  5806. },
  5807. "required": ["success"]
  5808. }
  5809. }
  5810. }
  5811. },
  5812. "404": {
  5813. "description": "Not found",
  5814. "content": {
  5815. "application/json": {
  5816. "schema": {
  5817. "$ref": "#/components/schemas/NotFoundError"
  5818. }
  5819. }
  5820. }
  5821. }
  5822. },
  5823. "x-codeSamples": [
  5824. {
  5825. "lang": "js",
  5826. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.remove({\n ...\n})"
  5827. }
  5828. ]
  5829. }
  5830. },
  5831. "/mcp/{name}/auth/callback": {
  5832. "post": {
  5833. "operationId": "mcp.auth.callback",
  5834. "parameters": [
  5835. {
  5836. "in": "query",
  5837. "name": "directory",
  5838. "schema": {
  5839. "type": "string"
  5840. }
  5841. },
  5842. {
  5843. "in": "query",
  5844. "name": "workspace",
  5845. "schema": {
  5846. "type": "string"
  5847. }
  5848. },
  5849. {
  5850. "schema": {
  5851. "type": "string"
  5852. },
  5853. "in": "path",
  5854. "name": "name",
  5855. "required": true
  5856. }
  5857. ],
  5858. "summary": "Complete MCP OAuth",
  5859. "description": "Complete OAuth authentication for a Model Context Protocol (MCP) server using the authorization code.",
  5860. "responses": {
  5861. "200": {
  5862. "description": "OAuth authentication completed",
  5863. "content": {
  5864. "application/json": {
  5865. "schema": {
  5866. "$ref": "#/components/schemas/MCPStatus"
  5867. }
  5868. }
  5869. }
  5870. },
  5871. "400": {
  5872. "description": "Bad request",
  5873. "content": {
  5874. "application/json": {
  5875. "schema": {
  5876. "$ref": "#/components/schemas/BadRequestError"
  5877. }
  5878. }
  5879. }
  5880. },
  5881. "404": {
  5882. "description": "Not found",
  5883. "content": {
  5884. "application/json": {
  5885. "schema": {
  5886. "$ref": "#/components/schemas/NotFoundError"
  5887. }
  5888. }
  5889. }
  5890. }
  5891. },
  5892. "requestBody": {
  5893. "content": {
  5894. "application/json": {
  5895. "schema": {
  5896. "type": "object",
  5897. "properties": {
  5898. "code": {
  5899. "description": "Authorization code from OAuth callback",
  5900. "type": "string"
  5901. }
  5902. },
  5903. "required": ["code"]
  5904. }
  5905. }
  5906. }
  5907. },
  5908. "x-codeSamples": [
  5909. {
  5910. "lang": "js",
  5911. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.callback({\n ...\n})"
  5912. }
  5913. ]
  5914. }
  5915. },
  5916. "/mcp/{name}/auth/authenticate": {
  5917. "post": {
  5918. "operationId": "mcp.auth.authenticate",
  5919. "parameters": [
  5920. {
  5921. "in": "query",
  5922. "name": "directory",
  5923. "schema": {
  5924. "type": "string"
  5925. }
  5926. },
  5927. {
  5928. "in": "query",
  5929. "name": "workspace",
  5930. "schema": {
  5931. "type": "string"
  5932. }
  5933. },
  5934. {
  5935. "schema": {
  5936. "type": "string"
  5937. },
  5938. "in": "path",
  5939. "name": "name",
  5940. "required": true
  5941. }
  5942. ],
  5943. "summary": "Authenticate MCP OAuth",
  5944. "description": "Start OAuth flow and wait for callback (opens browser)",
  5945. "responses": {
  5946. "200": {
  5947. "description": "OAuth authentication completed",
  5948. "content": {
  5949. "application/json": {
  5950. "schema": {
  5951. "$ref": "#/components/schemas/MCPStatus"
  5952. }
  5953. }
  5954. }
  5955. },
  5956. "400": {
  5957. "description": "Bad request",
  5958. "content": {
  5959. "application/json": {
  5960. "schema": {
  5961. "$ref": "#/components/schemas/BadRequestError"
  5962. }
  5963. }
  5964. }
  5965. },
  5966. "404": {
  5967. "description": "Not found",
  5968. "content": {
  5969. "application/json": {
  5970. "schema": {
  5971. "$ref": "#/components/schemas/NotFoundError"
  5972. }
  5973. }
  5974. }
  5975. }
  5976. },
  5977. "x-codeSamples": [
  5978. {
  5979. "lang": "js",
  5980. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.authenticate({\n ...\n})"
  5981. }
  5982. ]
  5983. }
  5984. },
  5985. "/mcp/{name}/connect": {
  5986. "post": {
  5987. "operationId": "mcp.connect",
  5988. "parameters": [
  5989. {
  5990. "in": "query",
  5991. "name": "directory",
  5992. "schema": {
  5993. "type": "string"
  5994. }
  5995. },
  5996. {
  5997. "in": "query",
  5998. "name": "workspace",
  5999. "schema": {
  6000. "type": "string"
  6001. }
  6002. },
  6003. {
  6004. "in": "path",
  6005. "name": "name",
  6006. "schema": {
  6007. "type": "string"
  6008. },
  6009. "required": true
  6010. }
  6011. ],
  6012. "description": "Connect an MCP server",
  6013. "responses": {
  6014. "200": {
  6015. "description": "MCP server connected successfully",
  6016. "content": {
  6017. "application/json": {
  6018. "schema": {
  6019. "type": "boolean"
  6020. }
  6021. }
  6022. }
  6023. }
  6024. },
  6025. "x-codeSamples": [
  6026. {
  6027. "lang": "js",
  6028. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.connect({\n ...\n})"
  6029. }
  6030. ]
  6031. }
  6032. },
  6033. "/mcp/{name}/disconnect": {
  6034. "post": {
  6035. "operationId": "mcp.disconnect",
  6036. "parameters": [
  6037. {
  6038. "in": "query",
  6039. "name": "directory",
  6040. "schema": {
  6041. "type": "string"
  6042. }
  6043. },
  6044. {
  6045. "in": "query",
  6046. "name": "workspace",
  6047. "schema": {
  6048. "type": "string"
  6049. }
  6050. },
  6051. {
  6052. "in": "path",
  6053. "name": "name",
  6054. "schema": {
  6055. "type": "string"
  6056. },
  6057. "required": true
  6058. }
  6059. ],
  6060. "description": "Disconnect an MCP server",
  6061. "responses": {
  6062. "200": {
  6063. "description": "MCP server disconnected successfully",
  6064. "content": {
  6065. "application/json": {
  6066. "schema": {
  6067. "type": "boolean"
  6068. }
  6069. }
  6070. }
  6071. }
  6072. },
  6073. "x-codeSamples": [
  6074. {
  6075. "lang": "js",
  6076. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.disconnect({\n ...\n})"
  6077. }
  6078. ]
  6079. }
  6080. },
  6081. "/tui/append-prompt": {
  6082. "post": {
  6083. "operationId": "tui.appendPrompt",
  6084. "parameters": [
  6085. {
  6086. "in": "query",
  6087. "name": "directory",
  6088. "schema": {
  6089. "type": "string"
  6090. }
  6091. },
  6092. {
  6093. "in": "query",
  6094. "name": "workspace",
  6095. "schema": {
  6096. "type": "string"
  6097. }
  6098. }
  6099. ],
  6100. "summary": "Append TUI prompt",
  6101. "description": "Append prompt to the TUI",
  6102. "responses": {
  6103. "200": {
  6104. "description": "Prompt processed successfully",
  6105. "content": {
  6106. "application/json": {
  6107. "schema": {
  6108. "type": "boolean"
  6109. }
  6110. }
  6111. }
  6112. },
  6113. "400": {
  6114. "description": "Bad request",
  6115. "content": {
  6116. "application/json": {
  6117. "schema": {
  6118. "$ref": "#/components/schemas/BadRequestError"
  6119. }
  6120. }
  6121. }
  6122. }
  6123. },
  6124. "requestBody": {
  6125. "content": {
  6126. "application/json": {
  6127. "schema": {
  6128. "type": "object",
  6129. "properties": {
  6130. "text": {
  6131. "type": "string"
  6132. }
  6133. },
  6134. "required": ["text"]
  6135. }
  6136. }
  6137. }
  6138. },
  6139. "x-codeSamples": [
  6140. {
  6141. "lang": "js",
  6142. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.appendPrompt({\n ...\n})"
  6143. }
  6144. ]
  6145. }
  6146. },
  6147. "/tui/open-help": {
  6148. "post": {
  6149. "operationId": "tui.openHelp",
  6150. "parameters": [
  6151. {
  6152. "in": "query",
  6153. "name": "directory",
  6154. "schema": {
  6155. "type": "string"
  6156. }
  6157. },
  6158. {
  6159. "in": "query",
  6160. "name": "workspace",
  6161. "schema": {
  6162. "type": "string"
  6163. }
  6164. }
  6165. ],
  6166. "summary": "Open help dialog",
  6167. "description": "Open the help dialog in the TUI to display user assistance information.",
  6168. "responses": {
  6169. "200": {
  6170. "description": "Help dialog opened successfully",
  6171. "content": {
  6172. "application/json": {
  6173. "schema": {
  6174. "type": "boolean"
  6175. }
  6176. }
  6177. }
  6178. }
  6179. },
  6180. "x-codeSamples": [
  6181. {
  6182. "lang": "js",
  6183. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openHelp({\n ...\n})"
  6184. }
  6185. ]
  6186. }
  6187. },
  6188. "/tui/open-sessions": {
  6189. "post": {
  6190. "operationId": "tui.openSessions",
  6191. "parameters": [
  6192. {
  6193. "in": "query",
  6194. "name": "directory",
  6195. "schema": {
  6196. "type": "string"
  6197. }
  6198. },
  6199. {
  6200. "in": "query",
  6201. "name": "workspace",
  6202. "schema": {
  6203. "type": "string"
  6204. }
  6205. }
  6206. ],
  6207. "summary": "Open sessions dialog",
  6208. "description": "Open the session dialog",
  6209. "responses": {
  6210. "200": {
  6211. "description": "Session dialog opened successfully",
  6212. "content": {
  6213. "application/json": {
  6214. "schema": {
  6215. "type": "boolean"
  6216. }
  6217. }
  6218. }
  6219. }
  6220. },
  6221. "x-codeSamples": [
  6222. {
  6223. "lang": "js",
  6224. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openSessions({\n ...\n})"
  6225. }
  6226. ]
  6227. }
  6228. },
  6229. "/tui/open-themes": {
  6230. "post": {
  6231. "operationId": "tui.openThemes",
  6232. "parameters": [
  6233. {
  6234. "in": "query",
  6235. "name": "directory",
  6236. "schema": {
  6237. "type": "string"
  6238. }
  6239. },
  6240. {
  6241. "in": "query",
  6242. "name": "workspace",
  6243. "schema": {
  6244. "type": "string"
  6245. }
  6246. }
  6247. ],
  6248. "summary": "Open themes dialog",
  6249. "description": "Open the theme dialog",
  6250. "responses": {
  6251. "200": {
  6252. "description": "Theme dialog opened successfully",
  6253. "content": {
  6254. "application/json": {
  6255. "schema": {
  6256. "type": "boolean"
  6257. }
  6258. }
  6259. }
  6260. }
  6261. },
  6262. "x-codeSamples": [
  6263. {
  6264. "lang": "js",
  6265. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openThemes({\n ...\n})"
  6266. }
  6267. ]
  6268. }
  6269. },
  6270. "/tui/open-models": {
  6271. "post": {
  6272. "operationId": "tui.openModels",
  6273. "parameters": [
  6274. {
  6275. "in": "query",
  6276. "name": "directory",
  6277. "schema": {
  6278. "type": "string"
  6279. }
  6280. },
  6281. {
  6282. "in": "query",
  6283. "name": "workspace",
  6284. "schema": {
  6285. "type": "string"
  6286. }
  6287. }
  6288. ],
  6289. "summary": "Open models dialog",
  6290. "description": "Open the model dialog",
  6291. "responses": {
  6292. "200": {
  6293. "description": "Model dialog opened successfully",
  6294. "content": {
  6295. "application/json": {
  6296. "schema": {
  6297. "type": "boolean"
  6298. }
  6299. }
  6300. }
  6301. }
  6302. },
  6303. "x-codeSamples": [
  6304. {
  6305. "lang": "js",
  6306. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openModels({\n ...\n})"
  6307. }
  6308. ]
  6309. }
  6310. },
  6311. "/tui/submit-prompt": {
  6312. "post": {
  6313. "operationId": "tui.submitPrompt",
  6314. "parameters": [
  6315. {
  6316. "in": "query",
  6317. "name": "directory",
  6318. "schema": {
  6319. "type": "string"
  6320. }
  6321. },
  6322. {
  6323. "in": "query",
  6324. "name": "workspace",
  6325. "schema": {
  6326. "type": "string"
  6327. }
  6328. }
  6329. ],
  6330. "summary": "Submit TUI prompt",
  6331. "description": "Submit the prompt",
  6332. "responses": {
  6333. "200": {
  6334. "description": "Prompt submitted successfully",
  6335. "content": {
  6336. "application/json": {
  6337. "schema": {
  6338. "type": "boolean"
  6339. }
  6340. }
  6341. }
  6342. }
  6343. },
  6344. "x-codeSamples": [
  6345. {
  6346. "lang": "js",
  6347. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.submitPrompt({\n ...\n})"
  6348. }
  6349. ]
  6350. }
  6351. },
  6352. "/tui/clear-prompt": {
  6353. "post": {
  6354. "operationId": "tui.clearPrompt",
  6355. "parameters": [
  6356. {
  6357. "in": "query",
  6358. "name": "directory",
  6359. "schema": {
  6360. "type": "string"
  6361. }
  6362. },
  6363. {
  6364. "in": "query",
  6365. "name": "workspace",
  6366. "schema": {
  6367. "type": "string"
  6368. }
  6369. }
  6370. ],
  6371. "summary": "Clear TUI prompt",
  6372. "description": "Clear the prompt",
  6373. "responses": {
  6374. "200": {
  6375. "description": "Prompt cleared successfully",
  6376. "content": {
  6377. "application/json": {
  6378. "schema": {
  6379. "type": "boolean"
  6380. }
  6381. }
  6382. }
  6383. }
  6384. },
  6385. "x-codeSamples": [
  6386. {
  6387. "lang": "js",
  6388. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.clearPrompt({\n ...\n})"
  6389. }
  6390. ]
  6391. }
  6392. },
  6393. "/tui/execute-command": {
  6394. "post": {
  6395. "operationId": "tui.executeCommand",
  6396. "parameters": [
  6397. {
  6398. "in": "query",
  6399. "name": "directory",
  6400. "schema": {
  6401. "type": "string"
  6402. }
  6403. },
  6404. {
  6405. "in": "query",
  6406. "name": "workspace",
  6407. "schema": {
  6408. "type": "string"
  6409. }
  6410. }
  6411. ],
  6412. "summary": "Execute TUI command",
  6413. "description": "Execute a TUI command (e.g. agent_cycle)",
  6414. "responses": {
  6415. "200": {
  6416. "description": "Command executed successfully",
  6417. "content": {
  6418. "application/json": {
  6419. "schema": {
  6420. "type": "boolean"
  6421. }
  6422. }
  6423. }
  6424. },
  6425. "400": {
  6426. "description": "Bad request",
  6427. "content": {
  6428. "application/json": {
  6429. "schema": {
  6430. "$ref": "#/components/schemas/BadRequestError"
  6431. }
  6432. }
  6433. }
  6434. }
  6435. },
  6436. "requestBody": {
  6437. "content": {
  6438. "application/json": {
  6439. "schema": {
  6440. "type": "object",
  6441. "properties": {
  6442. "command": {
  6443. "type": "string"
  6444. }
  6445. },
  6446. "required": ["command"]
  6447. }
  6448. }
  6449. }
  6450. },
  6451. "x-codeSamples": [
  6452. {
  6453. "lang": "js",
  6454. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.executeCommand({\n ...\n})"
  6455. }
  6456. ]
  6457. }
  6458. },
  6459. "/tui/show-toast": {
  6460. "post": {
  6461. "operationId": "tui.showToast",
  6462. "parameters": [
  6463. {
  6464. "in": "query",
  6465. "name": "directory",
  6466. "schema": {
  6467. "type": "string"
  6468. }
  6469. },
  6470. {
  6471. "in": "query",
  6472. "name": "workspace",
  6473. "schema": {
  6474. "type": "string"
  6475. }
  6476. }
  6477. ],
  6478. "summary": "Show TUI toast",
  6479. "description": "Show a toast notification in the TUI",
  6480. "responses": {
  6481. "200": {
  6482. "description": "Toast notification shown successfully",
  6483. "content": {
  6484. "application/json": {
  6485. "schema": {
  6486. "type": "boolean"
  6487. }
  6488. }
  6489. }
  6490. }
  6491. },
  6492. "requestBody": {
  6493. "content": {
  6494. "application/json": {
  6495. "schema": {
  6496. "type": "object",
  6497. "properties": {
  6498. "title": {
  6499. "type": "string"
  6500. },
  6501. "message": {
  6502. "type": "string"
  6503. },
  6504. "variant": {
  6505. "type": "string",
  6506. "enum": ["info", "success", "warning", "error"]
  6507. },
  6508. "duration": {
  6509. "description": "Duration in milliseconds",
  6510. "default": 5000,
  6511. "type": "number"
  6512. }
  6513. },
  6514. "required": ["message", "variant"]
  6515. }
  6516. }
  6517. }
  6518. },
  6519. "x-codeSamples": [
  6520. {
  6521. "lang": "js",
  6522. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.showToast({\n ...\n})"
  6523. }
  6524. ]
  6525. }
  6526. },
  6527. "/tui/publish": {
  6528. "post": {
  6529. "operationId": "tui.publish",
  6530. "parameters": [
  6531. {
  6532. "in": "query",
  6533. "name": "directory",
  6534. "schema": {
  6535. "type": "string"
  6536. }
  6537. },
  6538. {
  6539. "in": "query",
  6540. "name": "workspace",
  6541. "schema": {
  6542. "type": "string"
  6543. }
  6544. }
  6545. ],
  6546. "summary": "Publish TUI event",
  6547. "description": "Publish a TUI event",
  6548. "responses": {
  6549. "200": {
  6550. "description": "Event published successfully",
  6551. "content": {
  6552. "application/json": {
  6553. "schema": {
  6554. "type": "boolean"
  6555. }
  6556. }
  6557. }
  6558. },
  6559. "400": {
  6560. "description": "Bad request",
  6561. "content": {
  6562. "application/json": {
  6563. "schema": {
  6564. "$ref": "#/components/schemas/BadRequestError"
  6565. }
  6566. }
  6567. }
  6568. }
  6569. },
  6570. "requestBody": {
  6571. "content": {
  6572. "application/json": {
  6573. "schema": {
  6574. "anyOf": [
  6575. {
  6576. "$ref": "#/components/schemas/Event.tui.prompt.append"
  6577. },
  6578. {
  6579. "$ref": "#/components/schemas/Event.tui.command.execute"
  6580. },
  6581. {
  6582. "$ref": "#/components/schemas/Event.tui.toast.show"
  6583. },
  6584. {
  6585. "$ref": "#/components/schemas/Event.tui.session.select"
  6586. }
  6587. ]
  6588. }
  6589. }
  6590. }
  6591. },
  6592. "x-codeSamples": [
  6593. {
  6594. "lang": "js",
  6595. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.publish({\n ...\n})"
  6596. }
  6597. ]
  6598. }
  6599. },
  6600. "/tui/select-session": {
  6601. "post": {
  6602. "operationId": "tui.selectSession",
  6603. "parameters": [
  6604. {
  6605. "in": "query",
  6606. "name": "directory",
  6607. "schema": {
  6608. "type": "string"
  6609. }
  6610. },
  6611. {
  6612. "in": "query",
  6613. "name": "workspace",
  6614. "schema": {
  6615. "type": "string"
  6616. }
  6617. }
  6618. ],
  6619. "summary": "Select session",
  6620. "description": "Navigate the TUI to display the specified session.",
  6621. "responses": {
  6622. "200": {
  6623. "description": "Session selected successfully",
  6624. "content": {
  6625. "application/json": {
  6626. "schema": {
  6627. "type": "boolean"
  6628. }
  6629. }
  6630. }
  6631. },
  6632. "400": {
  6633. "description": "Bad request",
  6634. "content": {
  6635. "application/json": {
  6636. "schema": {
  6637. "$ref": "#/components/schemas/BadRequestError"
  6638. }
  6639. }
  6640. }
  6641. },
  6642. "404": {
  6643. "description": "Not found",
  6644. "content": {
  6645. "application/json": {
  6646. "schema": {
  6647. "$ref": "#/components/schemas/NotFoundError"
  6648. }
  6649. }
  6650. }
  6651. }
  6652. },
  6653. "requestBody": {
  6654. "content": {
  6655. "application/json": {
  6656. "schema": {
  6657. "type": "object",
  6658. "properties": {
  6659. "sessionID": {
  6660. "description": "Session ID to navigate to",
  6661. "type": "string",
  6662. "pattern": "^ses.*"
  6663. }
  6664. },
  6665. "required": ["sessionID"]
  6666. }
  6667. }
  6668. }
  6669. },
  6670. "x-codeSamples": [
  6671. {
  6672. "lang": "js",
  6673. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.selectSession({\n ...\n})"
  6674. }
  6675. ]
  6676. }
  6677. },
  6678. "/tui/control/next": {
  6679. "get": {
  6680. "operationId": "tui.control.next",
  6681. "parameters": [
  6682. {
  6683. "in": "query",
  6684. "name": "directory",
  6685. "schema": {
  6686. "type": "string"
  6687. }
  6688. },
  6689. {
  6690. "in": "query",
  6691. "name": "workspace",
  6692. "schema": {
  6693. "type": "string"
  6694. }
  6695. }
  6696. ],
  6697. "summary": "Get next TUI request",
  6698. "description": "Retrieve the next TUI (Terminal User Interface) request from the queue for processing.",
  6699. "responses": {
  6700. "200": {
  6701. "description": "Next TUI request",
  6702. "content": {
  6703. "application/json": {
  6704. "schema": {
  6705. "type": "object",
  6706. "properties": {
  6707. "path": {
  6708. "type": "string"
  6709. },
  6710. "body": {}
  6711. },
  6712. "required": ["path", "body"]
  6713. }
  6714. }
  6715. }
  6716. }
  6717. },
  6718. "x-codeSamples": [
  6719. {
  6720. "lang": "js",
  6721. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.control.next({\n ...\n})"
  6722. }
  6723. ]
  6724. }
  6725. },
  6726. "/tui/control/response": {
  6727. "post": {
  6728. "operationId": "tui.control.response",
  6729. "parameters": [
  6730. {
  6731. "in": "query",
  6732. "name": "directory",
  6733. "schema": {
  6734. "type": "string"
  6735. }
  6736. },
  6737. {
  6738. "in": "query",
  6739. "name": "workspace",
  6740. "schema": {
  6741. "type": "string"
  6742. }
  6743. }
  6744. ],
  6745. "summary": "Submit TUI response",
  6746. "description": "Submit a response to the TUI request queue to complete a pending request.",
  6747. "responses": {
  6748. "200": {
  6749. "description": "Response submitted successfully",
  6750. "content": {
  6751. "application/json": {
  6752. "schema": {
  6753. "type": "boolean"
  6754. }
  6755. }
  6756. }
  6757. }
  6758. },
  6759. "requestBody": {
  6760. "content": {
  6761. "application/json": {
  6762. "schema": {}
  6763. }
  6764. }
  6765. },
  6766. "x-codeSamples": [
  6767. {
  6768. "lang": "js",
  6769. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.control.response({\n ...\n})"
  6770. }
  6771. ]
  6772. }
  6773. },
  6774. "/instance/dispose": {
  6775. "post": {
  6776. "operationId": "instance.dispose",
  6777. "parameters": [
  6778. {
  6779. "in": "query",
  6780. "name": "directory",
  6781. "schema": {
  6782. "type": "string"
  6783. }
  6784. },
  6785. {
  6786. "in": "query",
  6787. "name": "workspace",
  6788. "schema": {
  6789. "type": "string"
  6790. }
  6791. }
  6792. ],
  6793. "summary": "Dispose instance",
  6794. "description": "Clean up and dispose the current OpenCode instance, releasing all resources.",
  6795. "responses": {
  6796. "200": {
  6797. "description": "Instance disposed",
  6798. "content": {
  6799. "application/json": {
  6800. "schema": {
  6801. "type": "boolean"
  6802. }
  6803. }
  6804. }
  6805. }
  6806. },
  6807. "x-codeSamples": [
  6808. {
  6809. "lang": "js",
  6810. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.instance.dispose({\n ...\n})"
  6811. }
  6812. ]
  6813. }
  6814. },
  6815. "/path": {
  6816. "get": {
  6817. "operationId": "path.get",
  6818. "parameters": [
  6819. {
  6820. "in": "query",
  6821. "name": "directory",
  6822. "schema": {
  6823. "type": "string"
  6824. }
  6825. },
  6826. {
  6827. "in": "query",
  6828. "name": "workspace",
  6829. "schema": {
  6830. "type": "string"
  6831. }
  6832. }
  6833. ],
  6834. "summary": "Get paths",
  6835. "description": "Retrieve the current working directory and related path information for the OpenCode instance.",
  6836. "responses": {
  6837. "200": {
  6838. "description": "Path",
  6839. "content": {
  6840. "application/json": {
  6841. "schema": {
  6842. "$ref": "#/components/schemas/Path"
  6843. }
  6844. }
  6845. }
  6846. }
  6847. },
  6848. "x-codeSamples": [
  6849. {
  6850. "lang": "js",
  6851. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.path.get({\n ...\n})"
  6852. }
  6853. ]
  6854. }
  6855. },
  6856. "/vcs": {
  6857. "get": {
  6858. "operationId": "vcs.get",
  6859. "parameters": [
  6860. {
  6861. "in": "query",
  6862. "name": "directory",
  6863. "schema": {
  6864. "type": "string"
  6865. }
  6866. },
  6867. {
  6868. "in": "query",
  6869. "name": "workspace",
  6870. "schema": {
  6871. "type": "string"
  6872. }
  6873. }
  6874. ],
  6875. "summary": "Get VCS info",
  6876. "description": "Retrieve version control system (VCS) information for the current project, such as git branch.",
  6877. "responses": {
  6878. "200": {
  6879. "description": "VCS info",
  6880. "content": {
  6881. "application/json": {
  6882. "schema": {
  6883. "$ref": "#/components/schemas/VcsInfo"
  6884. }
  6885. }
  6886. }
  6887. }
  6888. },
  6889. "x-codeSamples": [
  6890. {
  6891. "lang": "js",
  6892. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.vcs.get({\n ...\n})"
  6893. }
  6894. ]
  6895. }
  6896. },
  6897. "/vcs/diff": {
  6898. "get": {
  6899. "operationId": "vcs.diff",
  6900. "parameters": [
  6901. {
  6902. "in": "query",
  6903. "name": "directory",
  6904. "schema": {
  6905. "type": "string"
  6906. }
  6907. },
  6908. {
  6909. "in": "query",
  6910. "name": "workspace",
  6911. "schema": {
  6912. "type": "string"
  6913. }
  6914. },
  6915. {
  6916. "in": "query",
  6917. "name": "mode",
  6918. "schema": {
  6919. "type": "string",
  6920. "enum": ["git", "branch"]
  6921. },
  6922. "required": true
  6923. }
  6924. ],
  6925. "summary": "Get VCS diff",
  6926. "description": "Retrieve the current git diff for the working tree or against the default branch.",
  6927. "responses": {
  6928. "200": {
  6929. "description": "VCS diff",
  6930. "content": {
  6931. "application/json": {
  6932. "schema": {
  6933. "type": "array",
  6934. "items": {
  6935. "$ref": "#/components/schemas/VcsFileDiff"
  6936. }
  6937. }
  6938. }
  6939. }
  6940. }
  6941. },
  6942. "x-codeSamples": [
  6943. {
  6944. "lang": "js",
  6945. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.vcs.diff({\n ...\n})"
  6946. }
  6947. ]
  6948. }
  6949. },
  6950. "/command": {
  6951. "get": {
  6952. "operationId": "command.list",
  6953. "parameters": [
  6954. {
  6955. "in": "query",
  6956. "name": "directory",
  6957. "schema": {
  6958. "type": "string"
  6959. }
  6960. },
  6961. {
  6962. "in": "query",
  6963. "name": "workspace",
  6964. "schema": {
  6965. "type": "string"
  6966. }
  6967. }
  6968. ],
  6969. "summary": "List commands",
  6970. "description": "Get a list of all available commands in the OpenCode system.",
  6971. "responses": {
  6972. "200": {
  6973. "description": "List of commands",
  6974. "content": {
  6975. "application/json": {
  6976. "schema": {
  6977. "type": "array",
  6978. "items": {
  6979. "$ref": "#/components/schemas/Command"
  6980. }
  6981. }
  6982. }
  6983. }
  6984. }
  6985. },
  6986. "x-codeSamples": [
  6987. {
  6988. "lang": "js",
  6989. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.command.list({\n ...\n})"
  6990. }
  6991. ]
  6992. }
  6993. },
  6994. "/agent": {
  6995. "get": {
  6996. "operationId": "app.agents",
  6997. "parameters": [
  6998. {
  6999. "in": "query",
  7000. "name": "directory",
  7001. "schema": {
  7002. "type": "string"
  7003. }
  7004. },
  7005. {
  7006. "in": "query",
  7007. "name": "workspace",
  7008. "schema": {
  7009. "type": "string"
  7010. }
  7011. }
  7012. ],
  7013. "summary": "List agents",
  7014. "description": "Get a list of all available AI agents in the OpenCode system.",
  7015. "responses": {
  7016. "200": {
  7017. "description": "List of agents",
  7018. "content": {
  7019. "application/json": {
  7020. "schema": {
  7021. "type": "array",
  7022. "items": {
  7023. "$ref": "#/components/schemas/Agent"
  7024. }
  7025. }
  7026. }
  7027. }
  7028. }
  7029. },
  7030. "x-codeSamples": [
  7031. {
  7032. "lang": "js",
  7033. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.app.agents({\n ...\n})"
  7034. }
  7035. ]
  7036. }
  7037. },
  7038. "/skill": {
  7039. "get": {
  7040. "operationId": "app.skills",
  7041. "parameters": [
  7042. {
  7043. "in": "query",
  7044. "name": "directory",
  7045. "schema": {
  7046. "type": "string"
  7047. }
  7048. },
  7049. {
  7050. "in": "query",
  7051. "name": "workspace",
  7052. "schema": {
  7053. "type": "string"
  7054. }
  7055. }
  7056. ],
  7057. "summary": "List skills",
  7058. "description": "Get a list of all available skills in the OpenCode system.",
  7059. "responses": {
  7060. "200": {
  7061. "description": "List of skills",
  7062. "content": {
  7063. "application/json": {
  7064. "schema": {
  7065. "type": "array",
  7066. "items": {
  7067. "type": "object",
  7068. "properties": {
  7069. "name": {
  7070. "type": "string"
  7071. },
  7072. "description": {
  7073. "type": "string"
  7074. },
  7075. "location": {
  7076. "type": "string"
  7077. },
  7078. "content": {
  7079. "type": "string"
  7080. }
  7081. },
  7082. "required": ["name", "description", "location", "content"]
  7083. }
  7084. }
  7085. }
  7086. }
  7087. }
  7088. },
  7089. "x-codeSamples": [
  7090. {
  7091. "lang": "js",
  7092. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.app.skills({\n ...\n})"
  7093. }
  7094. ]
  7095. }
  7096. },
  7097. "/lsp": {
  7098. "get": {
  7099. "operationId": "lsp.status",
  7100. "parameters": [
  7101. {
  7102. "in": "query",
  7103. "name": "directory",
  7104. "schema": {
  7105. "type": "string"
  7106. }
  7107. },
  7108. {
  7109. "in": "query",
  7110. "name": "workspace",
  7111. "schema": {
  7112. "type": "string"
  7113. }
  7114. }
  7115. ],
  7116. "summary": "Get LSP status",
  7117. "description": "Get LSP server status",
  7118. "responses": {
  7119. "200": {
  7120. "description": "LSP server status",
  7121. "content": {
  7122. "application/json": {
  7123. "schema": {
  7124. "type": "array",
  7125. "items": {
  7126. "$ref": "#/components/schemas/LSPStatus"
  7127. }
  7128. }
  7129. }
  7130. }
  7131. }
  7132. },
  7133. "x-codeSamples": [
  7134. {
  7135. "lang": "js",
  7136. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.lsp.status({\n ...\n})"
  7137. }
  7138. ]
  7139. }
  7140. },
  7141. "/formatter": {
  7142. "get": {
  7143. "operationId": "formatter.status",
  7144. "parameters": [
  7145. {
  7146. "in": "query",
  7147. "name": "directory",
  7148. "schema": {
  7149. "type": "string"
  7150. }
  7151. },
  7152. {
  7153. "in": "query",
  7154. "name": "workspace",
  7155. "schema": {
  7156. "type": "string"
  7157. }
  7158. }
  7159. ],
  7160. "summary": "Get formatter status",
  7161. "description": "Get formatter status",
  7162. "responses": {
  7163. "200": {
  7164. "description": "Formatter status",
  7165. "content": {
  7166. "application/json": {
  7167. "schema": {
  7168. "type": "array",
  7169. "items": {
  7170. "$ref": "#/components/schemas/FormatterStatus"
  7171. }
  7172. }
  7173. }
  7174. }
  7175. }
  7176. },
  7177. "x-codeSamples": [
  7178. {
  7179. "lang": "js",
  7180. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.formatter.status({\n ...\n})"
  7181. }
  7182. ]
  7183. }
  7184. }
  7185. },
  7186. "components": {
  7187. "schemas": {
  7188. "Project": {
  7189. "type": "object",
  7190. "properties": {
  7191. "id": {
  7192. "type": "string"
  7193. },
  7194. "worktree": {
  7195. "type": "string"
  7196. },
  7197. "vcs": {
  7198. "type": "string",
  7199. "const": "git"
  7200. },
  7201. "name": {
  7202. "type": "string"
  7203. },
  7204. "icon": {
  7205. "type": "object",
  7206. "properties": {
  7207. "url": {
  7208. "type": "string"
  7209. },
  7210. "override": {
  7211. "type": "string"
  7212. },
  7213. "color": {
  7214. "type": "string"
  7215. }
  7216. }
  7217. },
  7218. "commands": {
  7219. "type": "object",
  7220. "properties": {
  7221. "start": {
  7222. "description": "Startup script to run when creating a new workspace (worktree)",
  7223. "type": "string"
  7224. }
  7225. }
  7226. },
  7227. "time": {
  7228. "type": "object",
  7229. "properties": {
  7230. "created": {
  7231. "type": "number"
  7232. },
  7233. "updated": {
  7234. "type": "number"
  7235. },
  7236. "initialized": {
  7237. "type": "number"
  7238. }
  7239. },
  7240. "required": ["created", "updated"]
  7241. },
  7242. "sandboxes": {
  7243. "type": "array",
  7244. "items": {
  7245. "type": "string"
  7246. }
  7247. }
  7248. },
  7249. "required": ["id", "worktree", "time", "sandboxes"]
  7250. },
  7251. "Event.project.updated": {
  7252. "type": "object",
  7253. "properties": {
  7254. "type": {
  7255. "type": "string",
  7256. "const": "project.updated"
  7257. },
  7258. "properties": {
  7259. "$ref": "#/components/schemas/Project"
  7260. }
  7261. },
  7262. "required": ["type", "properties"]
  7263. },
  7264. "Event.server.instance.disposed": {
  7265. "type": "object",
  7266. "properties": {
  7267. "type": {
  7268. "type": "string",
  7269. "const": "server.instance.disposed"
  7270. },
  7271. "properties": {
  7272. "type": "object",
  7273. "properties": {
  7274. "directory": {
  7275. "type": "string"
  7276. }
  7277. },
  7278. "required": ["directory"]
  7279. }
  7280. },
  7281. "required": ["type", "properties"]
  7282. },
  7283. "Event.installation.updated": {
  7284. "type": "object",
  7285. "properties": {
  7286. "type": {
  7287. "type": "string",
  7288. "const": "installation.updated"
  7289. },
  7290. "properties": {
  7291. "type": "object",
  7292. "properties": {
  7293. "version": {
  7294. "type": "string"
  7295. }
  7296. },
  7297. "required": ["version"]
  7298. }
  7299. },
  7300. "required": ["type", "properties"]
  7301. },
  7302. "Event.installation.update-available": {
  7303. "type": "object",
  7304. "properties": {
  7305. "type": {
  7306. "type": "string",
  7307. "const": "installation.update-available"
  7308. },
  7309. "properties": {
  7310. "type": "object",
  7311. "properties": {
  7312. "version": {
  7313. "type": "string"
  7314. }
  7315. },
  7316. "required": ["version"]
  7317. }
  7318. },
  7319. "required": ["type", "properties"]
  7320. },
  7321. "Event.server.connected": {
  7322. "type": "object",
  7323. "properties": {
  7324. "type": {
  7325. "type": "string",
  7326. "const": "server.connected"
  7327. },
  7328. "properties": {
  7329. "type": "object",
  7330. "properties": {}
  7331. }
  7332. },
  7333. "required": ["type", "properties"]
  7334. },
  7335. "Event.global.disposed": {
  7336. "type": "object",
  7337. "properties": {
  7338. "type": {
  7339. "type": "string",
  7340. "const": "global.disposed"
  7341. },
  7342. "properties": {
  7343. "type": "object",
  7344. "properties": {}
  7345. }
  7346. },
  7347. "required": ["type", "properties"]
  7348. },
  7349. "Event.file.edited": {
  7350. "type": "object",
  7351. "properties": {
  7352. "type": {
  7353. "type": "string",
  7354. "const": "file.edited"
  7355. },
  7356. "properties": {
  7357. "type": "object",
  7358. "properties": {
  7359. "file": {
  7360. "type": "string"
  7361. }
  7362. },
  7363. "required": ["file"]
  7364. }
  7365. },
  7366. "required": ["type", "properties"]
  7367. },
  7368. "Event.file.watcher.updated": {
  7369. "type": "object",
  7370. "properties": {
  7371. "type": {
  7372. "type": "string",
  7373. "const": "file.watcher.updated"
  7374. },
  7375. "properties": {
  7376. "type": "object",
  7377. "properties": {
  7378. "file": {
  7379. "type": "string"
  7380. },
  7381. "event": {
  7382. "anyOf": [
  7383. {
  7384. "type": "string",
  7385. "const": "add"
  7386. },
  7387. {
  7388. "type": "string",
  7389. "const": "change"
  7390. },
  7391. {
  7392. "type": "string",
  7393. "const": "unlink"
  7394. }
  7395. ]
  7396. }
  7397. },
  7398. "required": ["file", "event"]
  7399. }
  7400. },
  7401. "required": ["type", "properties"]
  7402. },
  7403. "Event.lsp.client.diagnostics": {
  7404. "type": "object",
  7405. "properties": {
  7406. "type": {
  7407. "type": "string",
  7408. "const": "lsp.client.diagnostics"
  7409. },
  7410. "properties": {
  7411. "type": "object",
  7412. "properties": {
  7413. "serverID": {
  7414. "type": "string"
  7415. },
  7416. "path": {
  7417. "type": "string"
  7418. }
  7419. },
  7420. "required": ["serverID", "path"]
  7421. }
  7422. },
  7423. "required": ["type", "properties"]
  7424. },
  7425. "Event.lsp.updated": {
  7426. "type": "object",
  7427. "properties": {
  7428. "type": {
  7429. "type": "string",
  7430. "const": "lsp.updated"
  7431. },
  7432. "properties": {
  7433. "type": "object",
  7434. "properties": {}
  7435. }
  7436. },
  7437. "required": ["type", "properties"]
  7438. },
  7439. "Event.message.part.delta": {
  7440. "type": "object",
  7441. "properties": {
  7442. "type": {
  7443. "type": "string",
  7444. "const": "message.part.delta"
  7445. },
  7446. "properties": {
  7447. "type": "object",
  7448. "properties": {
  7449. "sessionID": {
  7450. "type": "string",
  7451. "pattern": "^ses.*"
  7452. },
  7453. "messageID": {
  7454. "type": "string",
  7455. "pattern": "^msg.*"
  7456. },
  7457. "partID": {
  7458. "type": "string",
  7459. "pattern": "^prt.*"
  7460. },
  7461. "field": {
  7462. "type": "string"
  7463. },
  7464. "delta": {
  7465. "type": "string"
  7466. }
  7467. },
  7468. "required": ["sessionID", "messageID", "partID", "field", "delta"]
  7469. }
  7470. },
  7471. "required": ["type", "properties"]
  7472. },
  7473. "PermissionRequest": {
  7474. "type": "object",
  7475. "properties": {
  7476. "id": {
  7477. "type": "string",
  7478. "pattern": "^per.*"
  7479. },
  7480. "sessionID": {
  7481. "type": "string",
  7482. "pattern": "^ses.*"
  7483. },
  7484. "permission": {
  7485. "type": "string"
  7486. },
  7487. "patterns": {
  7488. "type": "array",
  7489. "items": {
  7490. "type": "string"
  7491. }
  7492. },
  7493. "metadata": {
  7494. "type": "object",
  7495. "propertyNames": {
  7496. "type": "string"
  7497. },
  7498. "additionalProperties": {}
  7499. },
  7500. "always": {
  7501. "type": "array",
  7502. "items": {
  7503. "type": "string"
  7504. }
  7505. },
  7506. "tool": {
  7507. "type": "object",
  7508. "properties": {
  7509. "messageID": {
  7510. "type": "string",
  7511. "pattern": "^msg.*"
  7512. },
  7513. "callID": {
  7514. "type": "string"
  7515. }
  7516. },
  7517. "required": ["messageID", "callID"]
  7518. }
  7519. },
  7520. "required": ["id", "sessionID", "permission", "patterns", "metadata", "always"]
  7521. },
  7522. "Event.permission.asked": {
  7523. "type": "object",
  7524. "properties": {
  7525. "type": {
  7526. "type": "string",
  7527. "const": "permission.asked"
  7528. },
  7529. "properties": {
  7530. "$ref": "#/components/schemas/PermissionRequest"
  7531. }
  7532. },
  7533. "required": ["type", "properties"]
  7534. },
  7535. "Event.permission.replied": {
  7536. "type": "object",
  7537. "properties": {
  7538. "type": {
  7539. "type": "string",
  7540. "const": "permission.replied"
  7541. },
  7542. "properties": {
  7543. "type": "object",
  7544. "properties": {
  7545. "sessionID": {
  7546. "type": "string",
  7547. "pattern": "^ses.*"
  7548. },
  7549. "requestID": {
  7550. "type": "string",
  7551. "pattern": "^per.*"
  7552. },
  7553. "reply": {
  7554. "type": "string",
  7555. "enum": ["once", "always", "reject"]
  7556. }
  7557. },
  7558. "required": ["sessionID", "requestID", "reply"]
  7559. }
  7560. },
  7561. "required": ["type", "properties"]
  7562. },
  7563. "SnapshotFileDiff": {
  7564. "type": "object",
  7565. "properties": {
  7566. "file": {
  7567. "type": "string"
  7568. },
  7569. "patch": {
  7570. "type": "string"
  7571. },
  7572. "additions": {
  7573. "type": "number"
  7574. },
  7575. "deletions": {
  7576. "type": "number"
  7577. },
  7578. "status": {
  7579. "type": "string",
  7580. "enum": ["added", "deleted", "modified"]
  7581. }
  7582. },
  7583. "required": ["file", "patch", "additions", "deletions"]
  7584. },
  7585. "Event.session.diff": {
  7586. "type": "object",
  7587. "properties": {
  7588. "type": {
  7589. "type": "string",
  7590. "const": "session.diff"
  7591. },
  7592. "properties": {
  7593. "type": "object",
  7594. "properties": {
  7595. "sessionID": {
  7596. "type": "string",
  7597. "pattern": "^ses.*"
  7598. },
  7599. "diff": {
  7600. "type": "array",
  7601. "items": {
  7602. "$ref": "#/components/schemas/SnapshotFileDiff"
  7603. }
  7604. }
  7605. },
  7606. "required": ["sessionID", "diff"]
  7607. }
  7608. },
  7609. "required": ["type", "properties"]
  7610. },
  7611. "ProviderAuthError": {
  7612. "type": "object",
  7613. "properties": {
  7614. "name": {
  7615. "type": "string",
  7616. "const": "ProviderAuthError"
  7617. },
  7618. "data": {
  7619. "type": "object",
  7620. "properties": {
  7621. "providerID": {
  7622. "type": "string"
  7623. },
  7624. "message": {
  7625. "type": "string"
  7626. }
  7627. },
  7628. "required": ["providerID", "message"]
  7629. }
  7630. },
  7631. "required": ["name", "data"]
  7632. },
  7633. "UnknownError": {
  7634. "type": "object",
  7635. "properties": {
  7636. "name": {
  7637. "type": "string",
  7638. "const": "UnknownError"
  7639. },
  7640. "data": {
  7641. "type": "object",
  7642. "properties": {
  7643. "message": {
  7644. "type": "string"
  7645. }
  7646. },
  7647. "required": ["message"]
  7648. }
  7649. },
  7650. "required": ["name", "data"]
  7651. },
  7652. "MessageOutputLengthError": {
  7653. "type": "object",
  7654. "properties": {
  7655. "name": {
  7656. "type": "string",
  7657. "const": "MessageOutputLengthError"
  7658. },
  7659. "data": {
  7660. "type": "object",
  7661. "properties": {}
  7662. }
  7663. },
  7664. "required": ["name", "data"]
  7665. },
  7666. "MessageAbortedError": {
  7667. "type": "object",
  7668. "properties": {
  7669. "name": {
  7670. "type": "string",
  7671. "const": "MessageAbortedError"
  7672. },
  7673. "data": {
  7674. "type": "object",
  7675. "properties": {
  7676. "message": {
  7677. "type": "string"
  7678. }
  7679. },
  7680. "required": ["message"]
  7681. }
  7682. },
  7683. "required": ["name", "data"]
  7684. },
  7685. "StructuredOutputError": {
  7686. "type": "object",
  7687. "properties": {
  7688. "name": {
  7689. "type": "string",
  7690. "const": "StructuredOutputError"
  7691. },
  7692. "data": {
  7693. "type": "object",
  7694. "properties": {
  7695. "message": {
  7696. "type": "string"
  7697. },
  7698. "retries": {
  7699. "type": "number"
  7700. }
  7701. },
  7702. "required": ["message", "retries"]
  7703. }
  7704. },
  7705. "required": ["name", "data"]
  7706. },
  7707. "ContextOverflowError": {
  7708. "type": "object",
  7709. "properties": {
  7710. "name": {
  7711. "type": "string",
  7712. "const": "ContextOverflowError"
  7713. },
  7714. "data": {
  7715. "type": "object",
  7716. "properties": {
  7717. "message": {
  7718. "type": "string"
  7719. },
  7720. "responseBody": {
  7721. "type": "string"
  7722. }
  7723. },
  7724. "required": ["message"]
  7725. }
  7726. },
  7727. "required": ["name", "data"]
  7728. },
  7729. "APIError": {
  7730. "type": "object",
  7731. "properties": {
  7732. "name": {
  7733. "type": "string",
  7734. "const": "APIError"
  7735. },
  7736. "data": {
  7737. "type": "object",
  7738. "properties": {
  7739. "message": {
  7740. "type": "string"
  7741. },
  7742. "statusCode": {
  7743. "type": "number"
  7744. },
  7745. "isRetryable": {
  7746. "type": "boolean"
  7747. },
  7748. "responseHeaders": {
  7749. "type": "object",
  7750. "propertyNames": {
  7751. "type": "string"
  7752. },
  7753. "additionalProperties": {
  7754. "type": "string"
  7755. }
  7756. },
  7757. "responseBody": {
  7758. "type": "string"
  7759. },
  7760. "metadata": {
  7761. "type": "object",
  7762. "propertyNames": {
  7763. "type": "string"
  7764. },
  7765. "additionalProperties": {
  7766. "type": "string"
  7767. }
  7768. }
  7769. },
  7770. "required": ["message", "isRetryable"]
  7771. }
  7772. },
  7773. "required": ["name", "data"]
  7774. },
  7775. "Event.session.error": {
  7776. "type": "object",
  7777. "properties": {
  7778. "type": {
  7779. "type": "string",
  7780. "const": "session.error"
  7781. },
  7782. "properties": {
  7783. "type": "object",
  7784. "properties": {
  7785. "sessionID": {
  7786. "type": "string",
  7787. "pattern": "^ses.*"
  7788. },
  7789. "error": {
  7790. "anyOf": [
  7791. {
  7792. "$ref": "#/components/schemas/ProviderAuthError"
  7793. },
  7794. {
  7795. "$ref": "#/components/schemas/UnknownError"
  7796. },
  7797. {
  7798. "$ref": "#/components/schemas/MessageOutputLengthError"
  7799. },
  7800. {
  7801. "$ref": "#/components/schemas/MessageAbortedError"
  7802. },
  7803. {
  7804. "$ref": "#/components/schemas/StructuredOutputError"
  7805. },
  7806. {
  7807. "$ref": "#/components/schemas/ContextOverflowError"
  7808. },
  7809. {
  7810. "$ref": "#/components/schemas/APIError"
  7811. }
  7812. ]
  7813. }
  7814. }
  7815. }
  7816. },
  7817. "required": ["type", "properties"]
  7818. },
  7819. "QuestionOption": {
  7820. "type": "object",
  7821. "properties": {
  7822. "label": {
  7823. "description": "Display text (1-5 words, concise)",
  7824. "type": "string"
  7825. },
  7826. "description": {
  7827. "description": "Explanation of choice",
  7828. "type": "string"
  7829. }
  7830. },
  7831. "required": ["label", "description"]
  7832. },
  7833. "QuestionInfo": {
  7834. "type": "object",
  7835. "properties": {
  7836. "question": {
  7837. "description": "Complete question",
  7838. "type": "string"
  7839. },
  7840. "header": {
  7841. "description": "Very short label (max 30 chars)",
  7842. "type": "string"
  7843. },
  7844. "options": {
  7845. "description": "Available choices",
  7846. "type": "array",
  7847. "items": {
  7848. "$ref": "#/components/schemas/QuestionOption"
  7849. }
  7850. },
  7851. "multiple": {
  7852. "description": "Allow selecting multiple choices",
  7853. "type": "boolean"
  7854. },
  7855. "custom": {
  7856. "description": "Allow typing a custom answer (default: true)",
  7857. "type": "boolean"
  7858. }
  7859. },
  7860. "required": ["question", "header", "options"]
  7861. },
  7862. "QuestionRequest": {
  7863. "type": "object",
  7864. "properties": {
  7865. "id": {
  7866. "type": "string",
  7867. "pattern": "^que.*"
  7868. },
  7869. "sessionID": {
  7870. "type": "string",
  7871. "pattern": "^ses.*"
  7872. },
  7873. "questions": {
  7874. "description": "Questions to ask",
  7875. "type": "array",
  7876. "items": {
  7877. "$ref": "#/components/schemas/QuestionInfo"
  7878. }
  7879. },
  7880. "tool": {
  7881. "type": "object",
  7882. "properties": {
  7883. "messageID": {
  7884. "type": "string",
  7885. "pattern": "^msg.*"
  7886. },
  7887. "callID": {
  7888. "type": "string"
  7889. }
  7890. },
  7891. "required": ["messageID", "callID"]
  7892. }
  7893. },
  7894. "required": ["id", "sessionID", "questions"]
  7895. },
  7896. "Event.question.asked": {
  7897. "type": "object",
  7898. "properties": {
  7899. "type": {
  7900. "type": "string",
  7901. "const": "question.asked"
  7902. },
  7903. "properties": {
  7904. "$ref": "#/components/schemas/QuestionRequest"
  7905. }
  7906. },
  7907. "required": ["type", "properties"]
  7908. },
  7909. "QuestionAnswer": {
  7910. "type": "array",
  7911. "items": {
  7912. "type": "string"
  7913. }
  7914. },
  7915. "Event.question.replied": {
  7916. "type": "object",
  7917. "properties": {
  7918. "type": {
  7919. "type": "string",
  7920. "const": "question.replied"
  7921. },
  7922. "properties": {
  7923. "type": "object",
  7924. "properties": {
  7925. "sessionID": {
  7926. "type": "string",
  7927. "pattern": "^ses.*"
  7928. },
  7929. "requestID": {
  7930. "type": "string",
  7931. "pattern": "^que.*"
  7932. },
  7933. "answers": {
  7934. "type": "array",
  7935. "items": {
  7936. "$ref": "#/components/schemas/QuestionAnswer"
  7937. }
  7938. }
  7939. },
  7940. "required": ["sessionID", "requestID", "answers"]
  7941. }
  7942. },
  7943. "required": ["type", "properties"]
  7944. },
  7945. "Event.question.rejected": {
  7946. "type": "object",
  7947. "properties": {
  7948. "type": {
  7949. "type": "string",
  7950. "const": "question.rejected"
  7951. },
  7952. "properties": {
  7953. "type": "object",
  7954. "properties": {
  7955. "sessionID": {
  7956. "type": "string",
  7957. "pattern": "^ses.*"
  7958. },
  7959. "requestID": {
  7960. "type": "string",
  7961. "pattern": "^que.*"
  7962. }
  7963. },
  7964. "required": ["sessionID", "requestID"]
  7965. }
  7966. },
  7967. "required": ["type", "properties"]
  7968. },
  7969. "Todo": {
  7970. "type": "object",
  7971. "properties": {
  7972. "content": {
  7973. "description": "Brief description of the task",
  7974. "type": "string"
  7975. },
  7976. "status": {
  7977. "description": "Current status of the task: pending, in_progress, completed, cancelled",
  7978. "type": "string"
  7979. },
  7980. "priority": {
  7981. "description": "Priority level of the task: high, medium, low",
  7982. "type": "string"
  7983. }
  7984. },
  7985. "required": ["content", "status", "priority"]
  7986. },
  7987. "Event.todo.updated": {
  7988. "type": "object",
  7989. "properties": {
  7990. "type": {
  7991. "type": "string",
  7992. "const": "todo.updated"
  7993. },
  7994. "properties": {
  7995. "type": "object",
  7996. "properties": {
  7997. "sessionID": {
  7998. "type": "string",
  7999. "pattern": "^ses.*"
  8000. },
  8001. "todos": {
  8002. "type": "array",
  8003. "items": {
  8004. "$ref": "#/components/schemas/Todo"
  8005. }
  8006. }
  8007. },
  8008. "required": ["sessionID", "todos"]
  8009. }
  8010. },
  8011. "required": ["type", "properties"]
  8012. },
  8013. "SessionStatus": {
  8014. "anyOf": [
  8015. {
  8016. "type": "object",
  8017. "properties": {
  8018. "type": {
  8019. "type": "string",
  8020. "const": "idle"
  8021. }
  8022. },
  8023. "required": ["type"]
  8024. },
  8025. {
  8026. "type": "object",
  8027. "properties": {
  8028. "type": {
  8029. "type": "string",
  8030. "const": "retry"
  8031. },
  8032. "attempt": {
  8033. "type": "number"
  8034. },
  8035. "message": {
  8036. "type": "string"
  8037. },
  8038. "next": {
  8039. "type": "number"
  8040. }
  8041. },
  8042. "required": ["type", "attempt", "message", "next"]
  8043. },
  8044. {
  8045. "type": "object",
  8046. "properties": {
  8047. "type": {
  8048. "type": "string",
  8049. "const": "busy"
  8050. }
  8051. },
  8052. "required": ["type"]
  8053. }
  8054. ]
  8055. },
  8056. "Event.session.status": {
  8057. "type": "object",
  8058. "properties": {
  8059. "type": {
  8060. "type": "string",
  8061. "const": "session.status"
  8062. },
  8063. "properties": {
  8064. "type": "object",
  8065. "properties": {
  8066. "sessionID": {
  8067. "type": "string",
  8068. "pattern": "^ses.*"
  8069. },
  8070. "status": {
  8071. "$ref": "#/components/schemas/SessionStatus"
  8072. }
  8073. },
  8074. "required": ["sessionID", "status"]
  8075. }
  8076. },
  8077. "required": ["type", "properties"]
  8078. },
  8079. "Event.session.idle": {
  8080. "type": "object",
  8081. "properties": {
  8082. "type": {
  8083. "type": "string",
  8084. "const": "session.idle"
  8085. },
  8086. "properties": {
  8087. "type": "object",
  8088. "properties": {
  8089. "sessionID": {
  8090. "type": "string",
  8091. "pattern": "^ses.*"
  8092. }
  8093. },
  8094. "required": ["sessionID"]
  8095. }
  8096. },
  8097. "required": ["type", "properties"]
  8098. },
  8099. "Event.session.compacted": {
  8100. "type": "object",
  8101. "properties": {
  8102. "type": {
  8103. "type": "string",
  8104. "const": "session.compacted"
  8105. },
  8106. "properties": {
  8107. "type": "object",
  8108. "properties": {
  8109. "sessionID": {
  8110. "type": "string",
  8111. "pattern": "^ses.*"
  8112. }
  8113. },
  8114. "required": ["sessionID"]
  8115. }
  8116. },
  8117. "required": ["type", "properties"]
  8118. },
  8119. "Event.tui.prompt.append": {
  8120. "type": "object",
  8121. "properties": {
  8122. "type": {
  8123. "type": "string",
  8124. "const": "tui.prompt.append"
  8125. },
  8126. "properties": {
  8127. "type": "object",
  8128. "properties": {
  8129. "text": {
  8130. "type": "string"
  8131. }
  8132. },
  8133. "required": ["text"]
  8134. }
  8135. },
  8136. "required": ["type", "properties"]
  8137. },
  8138. "Event.tui.command.execute": {
  8139. "type": "object",
  8140. "properties": {
  8141. "type": {
  8142. "type": "string",
  8143. "const": "tui.command.execute"
  8144. },
  8145. "properties": {
  8146. "type": "object",
  8147. "properties": {
  8148. "command": {
  8149. "anyOf": [
  8150. {
  8151. "type": "string",
  8152. "enum": [
  8153. "session.list",
  8154. "session.new",
  8155. "session.share",
  8156. "session.interrupt",
  8157. "session.compact",
  8158. "session.page.up",
  8159. "session.page.down",
  8160. "session.line.up",
  8161. "session.line.down",
  8162. "session.half.page.up",
  8163. "session.half.page.down",
  8164. "session.first",
  8165. "session.last",
  8166. "prompt.clear",
  8167. "prompt.submit",
  8168. "agent.cycle"
  8169. ]
  8170. },
  8171. {
  8172. "type": "string"
  8173. }
  8174. ]
  8175. }
  8176. },
  8177. "required": ["command"]
  8178. }
  8179. },
  8180. "required": ["type", "properties"]
  8181. },
  8182. "Event.tui.toast.show": {
  8183. "type": "object",
  8184. "properties": {
  8185. "type": {
  8186. "type": "string",
  8187. "const": "tui.toast.show"
  8188. },
  8189. "properties": {
  8190. "type": "object",
  8191. "properties": {
  8192. "title": {
  8193. "type": "string"
  8194. },
  8195. "message": {
  8196. "type": "string"
  8197. },
  8198. "variant": {
  8199. "type": "string",
  8200. "enum": ["info", "success", "warning", "error"]
  8201. },
  8202. "duration": {
  8203. "description": "Duration in milliseconds",
  8204. "default": 5000,
  8205. "type": "number"
  8206. }
  8207. },
  8208. "required": ["message", "variant"]
  8209. }
  8210. },
  8211. "required": ["type", "properties"]
  8212. },
  8213. "Event.tui.session.select": {
  8214. "type": "object",
  8215. "properties": {
  8216. "type": {
  8217. "type": "string",
  8218. "const": "tui.session.select"
  8219. },
  8220. "properties": {
  8221. "type": "object",
  8222. "properties": {
  8223. "sessionID": {
  8224. "description": "Session ID to navigate to",
  8225. "type": "string",
  8226. "pattern": "^ses.*"
  8227. }
  8228. },
  8229. "required": ["sessionID"]
  8230. }
  8231. },
  8232. "required": ["type", "properties"]
  8233. },
  8234. "Event.mcp.tools.changed": {
  8235. "type": "object",
  8236. "properties": {
  8237. "type": {
  8238. "type": "string",
  8239. "const": "mcp.tools.changed"
  8240. },
  8241. "properties": {
  8242. "type": "object",
  8243. "properties": {
  8244. "server": {
  8245. "type": "string"
  8246. }
  8247. },
  8248. "required": ["server"]
  8249. }
  8250. },
  8251. "required": ["type", "properties"]
  8252. },
  8253. "Event.mcp.browser.open.failed": {
  8254. "type": "object",
  8255. "properties": {
  8256. "type": {
  8257. "type": "string",
  8258. "const": "mcp.browser.open.failed"
  8259. },
  8260. "properties": {
  8261. "type": "object",
  8262. "properties": {
  8263. "mcpName": {
  8264. "type": "string"
  8265. },
  8266. "url": {
  8267. "type": "string"
  8268. }
  8269. },
  8270. "required": ["mcpName", "url"]
  8271. }
  8272. },
  8273. "required": ["type", "properties"]
  8274. },
  8275. "Event.command.executed": {
  8276. "type": "object",
  8277. "properties": {
  8278. "type": {
  8279. "type": "string",
  8280. "const": "command.executed"
  8281. },
  8282. "properties": {
  8283. "type": "object",
  8284. "properties": {
  8285. "name": {
  8286. "type": "string"
  8287. },
  8288. "sessionID": {
  8289. "type": "string",
  8290. "pattern": "^ses.*"
  8291. },
  8292. "arguments": {
  8293. "type": "string"
  8294. },
  8295. "messageID": {
  8296. "type": "string",
  8297. "pattern": "^msg.*"
  8298. }
  8299. },
  8300. "required": ["name", "sessionID", "arguments", "messageID"]
  8301. }
  8302. },
  8303. "required": ["type", "properties"]
  8304. },
  8305. "Event.vcs.branch.updated": {
  8306. "type": "object",
  8307. "properties": {
  8308. "type": {
  8309. "type": "string",
  8310. "const": "vcs.branch.updated"
  8311. },
  8312. "properties": {
  8313. "type": "object",
  8314. "properties": {
  8315. "branch": {
  8316. "type": "string"
  8317. }
  8318. }
  8319. }
  8320. },
  8321. "required": ["type", "properties"]
  8322. },
  8323. "Event.worktree.ready": {
  8324. "type": "object",
  8325. "properties": {
  8326. "type": {
  8327. "type": "string",
  8328. "const": "worktree.ready"
  8329. },
  8330. "properties": {
  8331. "type": "object",
  8332. "properties": {
  8333. "name": {
  8334. "type": "string"
  8335. },
  8336. "branch": {
  8337. "type": "string"
  8338. }
  8339. },
  8340. "required": ["name", "branch"]
  8341. }
  8342. },
  8343. "required": ["type", "properties"]
  8344. },
  8345. "Event.worktree.failed": {
  8346. "type": "object",
  8347. "properties": {
  8348. "type": {
  8349. "type": "string",
  8350. "const": "worktree.failed"
  8351. },
  8352. "properties": {
  8353. "type": "object",
  8354. "properties": {
  8355. "message": {
  8356. "type": "string"
  8357. }
  8358. },
  8359. "required": ["message"]
  8360. }
  8361. },
  8362. "required": ["type", "properties"]
  8363. },
  8364. "Pty": {
  8365. "type": "object",
  8366. "properties": {
  8367. "id": {
  8368. "type": "string",
  8369. "pattern": "^pty.*"
  8370. },
  8371. "title": {
  8372. "type": "string"
  8373. },
  8374. "command": {
  8375. "type": "string"
  8376. },
  8377. "args": {
  8378. "type": "array",
  8379. "items": {
  8380. "type": "string"
  8381. }
  8382. },
  8383. "cwd": {
  8384. "type": "string"
  8385. },
  8386. "status": {
  8387. "type": "string",
  8388. "enum": ["running", "exited"]
  8389. },
  8390. "pid": {
  8391. "type": "number"
  8392. }
  8393. },
  8394. "required": ["id", "title", "command", "args", "cwd", "status", "pid"]
  8395. },
  8396. "Event.pty.created": {
  8397. "type": "object",
  8398. "properties": {
  8399. "type": {
  8400. "type": "string",
  8401. "const": "pty.created"
  8402. },
  8403. "properties": {
  8404. "type": "object",
  8405. "properties": {
  8406. "info": {
  8407. "$ref": "#/components/schemas/Pty"
  8408. }
  8409. },
  8410. "required": ["info"]
  8411. }
  8412. },
  8413. "required": ["type", "properties"]
  8414. },
  8415. "Event.pty.updated": {
  8416. "type": "object",
  8417. "properties": {
  8418. "type": {
  8419. "type": "string",
  8420. "const": "pty.updated"
  8421. },
  8422. "properties": {
  8423. "type": "object",
  8424. "properties": {
  8425. "info": {
  8426. "$ref": "#/components/schemas/Pty"
  8427. }
  8428. },
  8429. "required": ["info"]
  8430. }
  8431. },
  8432. "required": ["type", "properties"]
  8433. },
  8434. "Event.pty.exited": {
  8435. "type": "object",
  8436. "properties": {
  8437. "type": {
  8438. "type": "string",
  8439. "const": "pty.exited"
  8440. },
  8441. "properties": {
  8442. "type": "object",
  8443. "properties": {
  8444. "id": {
  8445. "type": "string",
  8446. "pattern": "^pty.*"
  8447. },
  8448. "exitCode": {
  8449. "type": "number"
  8450. }
  8451. },
  8452. "required": ["id", "exitCode"]
  8453. }
  8454. },
  8455. "required": ["type", "properties"]
  8456. },
  8457. "Event.pty.deleted": {
  8458. "type": "object",
  8459. "properties": {
  8460. "type": {
  8461. "type": "string",
  8462. "const": "pty.deleted"
  8463. },
  8464. "properties": {
  8465. "type": "object",
  8466. "properties": {
  8467. "id": {
  8468. "type": "string",
  8469. "pattern": "^pty.*"
  8470. }
  8471. },
  8472. "required": ["id"]
  8473. }
  8474. },
  8475. "required": ["type", "properties"]
  8476. },
  8477. "Event.workspace.ready": {
  8478. "type": "object",
  8479. "properties": {
  8480. "type": {
  8481. "type": "string",
  8482. "const": "workspace.ready"
  8483. },
  8484. "properties": {
  8485. "type": "object",
  8486. "properties": {
  8487. "name": {
  8488. "type": "string"
  8489. }
  8490. },
  8491. "required": ["name"]
  8492. }
  8493. },
  8494. "required": ["type", "properties"]
  8495. },
  8496. "Event.workspace.failed": {
  8497. "type": "object",
  8498. "properties": {
  8499. "type": {
  8500. "type": "string",
  8501. "const": "workspace.failed"
  8502. },
  8503. "properties": {
  8504. "type": "object",
  8505. "properties": {
  8506. "message": {
  8507. "type": "string"
  8508. }
  8509. },
  8510. "required": ["message"]
  8511. }
  8512. },
  8513. "required": ["type", "properties"]
  8514. },
  8515. "Event.workspace.status": {
  8516. "type": "object",
  8517. "properties": {
  8518. "type": {
  8519. "type": "string",
  8520. "const": "workspace.status"
  8521. },
  8522. "properties": {
  8523. "type": "object",
  8524. "properties": {
  8525. "workspaceID": {
  8526. "type": "string",
  8527. "pattern": "^wrk.*"
  8528. },
  8529. "status": {
  8530. "type": "string",
  8531. "enum": ["connected", "connecting", "disconnected", "error"]
  8532. },
  8533. "error": {
  8534. "type": "string"
  8535. }
  8536. },
  8537. "required": ["workspaceID", "status"]
  8538. }
  8539. },
  8540. "required": ["type", "properties"]
  8541. },
  8542. "OutputFormatText": {
  8543. "type": "object",
  8544. "properties": {
  8545. "type": {
  8546. "type": "string",
  8547. "const": "text"
  8548. }
  8549. },
  8550. "required": ["type"]
  8551. },
  8552. "JSONSchema": {
  8553. "type": "object",
  8554. "propertyNames": {
  8555. "type": "string"
  8556. },
  8557. "additionalProperties": {}
  8558. },
  8559. "OutputFormatJsonSchema": {
  8560. "type": "object",
  8561. "properties": {
  8562. "type": {
  8563. "type": "string",
  8564. "const": "json_schema"
  8565. },
  8566. "schema": {
  8567. "$ref": "#/components/schemas/JSONSchema"
  8568. },
  8569. "retryCount": {
  8570. "default": 2,
  8571. "type": "integer",
  8572. "minimum": 0,
  8573. "maximum": 9007199254740991
  8574. }
  8575. },
  8576. "required": ["type", "schema"]
  8577. },
  8578. "OutputFormat": {
  8579. "anyOf": [
  8580. {
  8581. "$ref": "#/components/schemas/OutputFormatText"
  8582. },
  8583. {
  8584. "$ref": "#/components/schemas/OutputFormatJsonSchema"
  8585. }
  8586. ]
  8587. },
  8588. "UserMessage": {
  8589. "type": "object",
  8590. "properties": {
  8591. "id": {
  8592. "type": "string",
  8593. "pattern": "^msg.*"
  8594. },
  8595. "sessionID": {
  8596. "type": "string",
  8597. "pattern": "^ses.*"
  8598. },
  8599. "role": {
  8600. "type": "string",
  8601. "const": "user"
  8602. },
  8603. "time": {
  8604. "type": "object",
  8605. "properties": {
  8606. "created": {
  8607. "type": "number"
  8608. }
  8609. },
  8610. "required": ["created"]
  8611. },
  8612. "format": {
  8613. "$ref": "#/components/schemas/OutputFormat"
  8614. },
  8615. "summary": {
  8616. "type": "object",
  8617. "properties": {
  8618. "title": {
  8619. "type": "string"
  8620. },
  8621. "body": {
  8622. "type": "string"
  8623. },
  8624. "diffs": {
  8625. "type": "array",
  8626. "items": {
  8627. "$ref": "#/components/schemas/SnapshotFileDiff"
  8628. }
  8629. }
  8630. },
  8631. "required": ["diffs"]
  8632. },
  8633. "agent": {
  8634. "type": "string"
  8635. },
  8636. "model": {
  8637. "type": "object",
  8638. "properties": {
  8639. "providerID": {
  8640. "type": "string"
  8641. },
  8642. "modelID": {
  8643. "type": "string"
  8644. },
  8645. "variant": {
  8646. "type": "string"
  8647. }
  8648. },
  8649. "required": ["providerID", "modelID"]
  8650. },
  8651. "system": {
  8652. "type": "string"
  8653. },
  8654. "tools": {
  8655. "type": "object",
  8656. "propertyNames": {
  8657. "type": "string"
  8658. },
  8659. "additionalProperties": {
  8660. "type": "boolean"
  8661. }
  8662. }
  8663. },
  8664. "required": ["id", "sessionID", "role", "time", "agent", "model"]
  8665. },
  8666. "AssistantMessage": {
  8667. "type": "object",
  8668. "properties": {
  8669. "id": {
  8670. "type": "string",
  8671. "pattern": "^msg.*"
  8672. },
  8673. "sessionID": {
  8674. "type": "string",
  8675. "pattern": "^ses.*"
  8676. },
  8677. "role": {
  8678. "type": "string",
  8679. "const": "assistant"
  8680. },
  8681. "time": {
  8682. "type": "object",
  8683. "properties": {
  8684. "created": {
  8685. "type": "number"
  8686. },
  8687. "completed": {
  8688. "type": "number"
  8689. }
  8690. },
  8691. "required": ["created"]
  8692. },
  8693. "error": {
  8694. "anyOf": [
  8695. {
  8696. "$ref": "#/components/schemas/ProviderAuthError"
  8697. },
  8698. {
  8699. "$ref": "#/components/schemas/UnknownError"
  8700. },
  8701. {
  8702. "$ref": "#/components/schemas/MessageOutputLengthError"
  8703. },
  8704. {
  8705. "$ref": "#/components/schemas/MessageAbortedError"
  8706. },
  8707. {
  8708. "$ref": "#/components/schemas/StructuredOutputError"
  8709. },
  8710. {
  8711. "$ref": "#/components/schemas/ContextOverflowError"
  8712. },
  8713. {
  8714. "$ref": "#/components/schemas/APIError"
  8715. }
  8716. ]
  8717. },
  8718. "parentID": {
  8719. "type": "string",
  8720. "pattern": "^msg.*"
  8721. },
  8722. "modelID": {
  8723. "type": "string"
  8724. },
  8725. "providerID": {
  8726. "type": "string"
  8727. },
  8728. "mode": {
  8729. "type": "string"
  8730. },
  8731. "agent": {
  8732. "type": "string"
  8733. },
  8734. "path": {
  8735. "type": "object",
  8736. "properties": {
  8737. "cwd": {
  8738. "type": "string"
  8739. },
  8740. "root": {
  8741. "type": "string"
  8742. }
  8743. },
  8744. "required": ["cwd", "root"]
  8745. },
  8746. "summary": {
  8747. "type": "boolean"
  8748. },
  8749. "cost": {
  8750. "type": "number"
  8751. },
  8752. "tokens": {
  8753. "type": "object",
  8754. "properties": {
  8755. "total": {
  8756. "type": "number"
  8757. },
  8758. "input": {
  8759. "type": "number"
  8760. },
  8761. "output": {
  8762. "type": "number"
  8763. },
  8764. "reasoning": {
  8765. "type": "number"
  8766. },
  8767. "cache": {
  8768. "type": "object",
  8769. "properties": {
  8770. "read": {
  8771. "type": "number"
  8772. },
  8773. "write": {
  8774. "type": "number"
  8775. }
  8776. },
  8777. "required": ["read", "write"]
  8778. }
  8779. },
  8780. "required": ["input", "output", "reasoning", "cache"]
  8781. },
  8782. "structured": {},
  8783. "variant": {
  8784. "type": "string"
  8785. },
  8786. "finish": {
  8787. "type": "string"
  8788. }
  8789. },
  8790. "required": [
  8791. "id",
  8792. "sessionID",
  8793. "role",
  8794. "time",
  8795. "parentID",
  8796. "modelID",
  8797. "providerID",
  8798. "mode",
  8799. "agent",
  8800. "path",
  8801. "cost",
  8802. "tokens"
  8803. ]
  8804. },
  8805. "Message": {
  8806. "anyOf": [
  8807. {
  8808. "$ref": "#/components/schemas/UserMessage"
  8809. },
  8810. {
  8811. "$ref": "#/components/schemas/AssistantMessage"
  8812. }
  8813. ]
  8814. },
  8815. "Event.message.updated": {
  8816. "type": "object",
  8817. "properties": {
  8818. "type": {
  8819. "type": "string",
  8820. "const": "message.updated"
  8821. },
  8822. "properties": {
  8823. "type": "object",
  8824. "properties": {
  8825. "sessionID": {
  8826. "type": "string",
  8827. "pattern": "^ses.*"
  8828. },
  8829. "info": {
  8830. "$ref": "#/components/schemas/Message"
  8831. }
  8832. },
  8833. "required": ["sessionID", "info"]
  8834. }
  8835. },
  8836. "required": ["type", "properties"]
  8837. },
  8838. "Event.message.removed": {
  8839. "type": "object",
  8840. "properties": {
  8841. "type": {
  8842. "type": "string",
  8843. "const": "message.removed"
  8844. },
  8845. "properties": {
  8846. "type": "object",
  8847. "properties": {
  8848. "sessionID": {
  8849. "type": "string",
  8850. "pattern": "^ses.*"
  8851. },
  8852. "messageID": {
  8853. "type": "string",
  8854. "pattern": "^msg.*"
  8855. }
  8856. },
  8857. "required": ["sessionID", "messageID"]
  8858. }
  8859. },
  8860. "required": ["type", "properties"]
  8861. },
  8862. "TextPart": {
  8863. "type": "object",
  8864. "properties": {
  8865. "id": {
  8866. "type": "string",
  8867. "pattern": "^prt.*"
  8868. },
  8869. "sessionID": {
  8870. "type": "string",
  8871. "pattern": "^ses.*"
  8872. },
  8873. "messageID": {
  8874. "type": "string",
  8875. "pattern": "^msg.*"
  8876. },
  8877. "type": {
  8878. "type": "string",
  8879. "const": "text"
  8880. },
  8881. "text": {
  8882. "type": "string"
  8883. },
  8884. "synthetic": {
  8885. "type": "boolean"
  8886. },
  8887. "ignored": {
  8888. "type": "boolean"
  8889. },
  8890. "time": {
  8891. "type": "object",
  8892. "properties": {
  8893. "start": {
  8894. "type": "number"
  8895. },
  8896. "end": {
  8897. "type": "number"
  8898. }
  8899. },
  8900. "required": ["start"]
  8901. },
  8902. "metadata": {
  8903. "type": "object",
  8904. "propertyNames": {
  8905. "type": "string"
  8906. },
  8907. "additionalProperties": {}
  8908. }
  8909. },
  8910. "required": ["id", "sessionID", "messageID", "type", "text"]
  8911. },
  8912. "SubtaskPart": {
  8913. "type": "object",
  8914. "properties": {
  8915. "id": {
  8916. "type": "string",
  8917. "pattern": "^prt.*"
  8918. },
  8919. "sessionID": {
  8920. "type": "string",
  8921. "pattern": "^ses.*"
  8922. },
  8923. "messageID": {
  8924. "type": "string",
  8925. "pattern": "^msg.*"
  8926. },
  8927. "type": {
  8928. "type": "string",
  8929. "const": "subtask"
  8930. },
  8931. "prompt": {
  8932. "type": "string"
  8933. },
  8934. "description": {
  8935. "type": "string"
  8936. },
  8937. "agent": {
  8938. "type": "string"
  8939. },
  8940. "model": {
  8941. "type": "object",
  8942. "properties": {
  8943. "providerID": {
  8944. "type": "string"
  8945. },
  8946. "modelID": {
  8947. "type": "string"
  8948. }
  8949. },
  8950. "required": ["providerID", "modelID"]
  8951. },
  8952. "command": {
  8953. "type": "string"
  8954. }
  8955. },
  8956. "required": ["id", "sessionID", "messageID", "type", "prompt", "description", "agent"]
  8957. },
  8958. "ReasoningPart": {
  8959. "type": "object",
  8960. "properties": {
  8961. "id": {
  8962. "type": "string",
  8963. "pattern": "^prt.*"
  8964. },
  8965. "sessionID": {
  8966. "type": "string",
  8967. "pattern": "^ses.*"
  8968. },
  8969. "messageID": {
  8970. "type": "string",
  8971. "pattern": "^msg.*"
  8972. },
  8973. "type": {
  8974. "type": "string",
  8975. "const": "reasoning"
  8976. },
  8977. "text": {
  8978. "type": "string"
  8979. },
  8980. "metadata": {
  8981. "type": "object",
  8982. "propertyNames": {
  8983. "type": "string"
  8984. },
  8985. "additionalProperties": {}
  8986. },
  8987. "time": {
  8988. "type": "object",
  8989. "properties": {
  8990. "start": {
  8991. "type": "number"
  8992. },
  8993. "end": {
  8994. "type": "number"
  8995. }
  8996. },
  8997. "required": ["start"]
  8998. }
  8999. },
  9000. "required": ["id", "sessionID", "messageID", "type", "text", "time"]
  9001. },
  9002. "FilePartSourceText": {
  9003. "type": "object",
  9004. "properties": {
  9005. "value": {
  9006. "type": "string"
  9007. },
  9008. "start": {
  9009. "type": "integer",
  9010. "minimum": -9007199254740991,
  9011. "maximum": 9007199254740991
  9012. },
  9013. "end": {
  9014. "type": "integer",
  9015. "minimum": -9007199254740991,
  9016. "maximum": 9007199254740991
  9017. }
  9018. },
  9019. "required": ["value", "start", "end"]
  9020. },
  9021. "FileSource": {
  9022. "type": "object",
  9023. "properties": {
  9024. "text": {
  9025. "$ref": "#/components/schemas/FilePartSourceText"
  9026. },
  9027. "type": {
  9028. "type": "string",
  9029. "const": "file"
  9030. },
  9031. "path": {
  9032. "type": "string"
  9033. }
  9034. },
  9035. "required": ["text", "type", "path"]
  9036. },
  9037. "Range": {
  9038. "type": "object",
  9039. "properties": {
  9040. "start": {
  9041. "type": "object",
  9042. "properties": {
  9043. "line": {
  9044. "type": "number"
  9045. },
  9046. "character": {
  9047. "type": "number"
  9048. }
  9049. },
  9050. "required": ["line", "character"]
  9051. },
  9052. "end": {
  9053. "type": "object",
  9054. "properties": {
  9055. "line": {
  9056. "type": "number"
  9057. },
  9058. "character": {
  9059. "type": "number"
  9060. }
  9061. },
  9062. "required": ["line", "character"]
  9063. }
  9064. },
  9065. "required": ["start", "end"]
  9066. },
  9067. "SymbolSource": {
  9068. "type": "object",
  9069. "properties": {
  9070. "text": {
  9071. "$ref": "#/components/schemas/FilePartSourceText"
  9072. },
  9073. "type": {
  9074. "type": "string",
  9075. "const": "symbol"
  9076. },
  9077. "path": {
  9078. "type": "string"
  9079. },
  9080. "range": {
  9081. "$ref": "#/components/schemas/Range"
  9082. },
  9083. "name": {
  9084. "type": "string"
  9085. },
  9086. "kind": {
  9087. "type": "integer",
  9088. "minimum": -9007199254740991,
  9089. "maximum": 9007199254740991
  9090. }
  9091. },
  9092. "required": ["text", "type", "path", "range", "name", "kind"]
  9093. },
  9094. "ResourceSource": {
  9095. "type": "object",
  9096. "properties": {
  9097. "text": {
  9098. "$ref": "#/components/schemas/FilePartSourceText"
  9099. },
  9100. "type": {
  9101. "type": "string",
  9102. "const": "resource"
  9103. },
  9104. "clientName": {
  9105. "type": "string"
  9106. },
  9107. "uri": {
  9108. "type": "string"
  9109. }
  9110. },
  9111. "required": ["text", "type", "clientName", "uri"]
  9112. },
  9113. "FilePartSource": {
  9114. "anyOf": [
  9115. {
  9116. "$ref": "#/components/schemas/FileSource"
  9117. },
  9118. {
  9119. "$ref": "#/components/schemas/SymbolSource"
  9120. },
  9121. {
  9122. "$ref": "#/components/schemas/ResourceSource"
  9123. }
  9124. ]
  9125. },
  9126. "FilePart": {
  9127. "type": "object",
  9128. "properties": {
  9129. "id": {
  9130. "type": "string",
  9131. "pattern": "^prt.*"
  9132. },
  9133. "sessionID": {
  9134. "type": "string",
  9135. "pattern": "^ses.*"
  9136. },
  9137. "messageID": {
  9138. "type": "string",
  9139. "pattern": "^msg.*"
  9140. },
  9141. "type": {
  9142. "type": "string",
  9143. "const": "file"
  9144. },
  9145. "mime": {
  9146. "type": "string"
  9147. },
  9148. "filename": {
  9149. "type": "string"
  9150. },
  9151. "url": {
  9152. "type": "string"
  9153. },
  9154. "source": {
  9155. "$ref": "#/components/schemas/FilePartSource"
  9156. }
  9157. },
  9158. "required": ["id", "sessionID", "messageID", "type", "mime", "url"]
  9159. },
  9160. "ToolStatePending": {
  9161. "type": "object",
  9162. "properties": {
  9163. "status": {
  9164. "type": "string",
  9165. "const": "pending"
  9166. },
  9167. "input": {
  9168. "type": "object",
  9169. "propertyNames": {
  9170. "type": "string"
  9171. },
  9172. "additionalProperties": {}
  9173. },
  9174. "raw": {
  9175. "type": "string"
  9176. }
  9177. },
  9178. "required": ["status", "input", "raw"]
  9179. },
  9180. "ToolStateRunning": {
  9181. "type": "object",
  9182. "properties": {
  9183. "status": {
  9184. "type": "string",
  9185. "const": "running"
  9186. },
  9187. "input": {
  9188. "type": "object",
  9189. "propertyNames": {
  9190. "type": "string"
  9191. },
  9192. "additionalProperties": {}
  9193. },
  9194. "title": {
  9195. "type": "string"
  9196. },
  9197. "metadata": {
  9198. "type": "object",
  9199. "propertyNames": {
  9200. "type": "string"
  9201. },
  9202. "additionalProperties": {}
  9203. },
  9204. "time": {
  9205. "type": "object",
  9206. "properties": {
  9207. "start": {
  9208. "type": "number"
  9209. }
  9210. },
  9211. "required": ["start"]
  9212. }
  9213. },
  9214. "required": ["status", "input", "time"]
  9215. },
  9216. "ToolStateCompleted": {
  9217. "type": "object",
  9218. "properties": {
  9219. "status": {
  9220. "type": "string",
  9221. "const": "completed"
  9222. },
  9223. "input": {
  9224. "type": "object",
  9225. "propertyNames": {
  9226. "type": "string"
  9227. },
  9228. "additionalProperties": {}
  9229. },
  9230. "output": {
  9231. "type": "string"
  9232. },
  9233. "title": {
  9234. "type": "string"
  9235. },
  9236. "metadata": {
  9237. "type": "object",
  9238. "propertyNames": {
  9239. "type": "string"
  9240. },
  9241. "additionalProperties": {}
  9242. },
  9243. "time": {
  9244. "type": "object",
  9245. "properties": {
  9246. "start": {
  9247. "type": "number"
  9248. },
  9249. "end": {
  9250. "type": "number"
  9251. },
  9252. "compacted": {
  9253. "type": "number"
  9254. }
  9255. },
  9256. "required": ["start", "end"]
  9257. },
  9258. "attachments": {
  9259. "type": "array",
  9260. "items": {
  9261. "$ref": "#/components/schemas/FilePart"
  9262. }
  9263. }
  9264. },
  9265. "required": ["status", "input", "output", "title", "metadata", "time"]
  9266. },
  9267. "ToolStateError": {
  9268. "type": "object",
  9269. "properties": {
  9270. "status": {
  9271. "type": "string",
  9272. "const": "error"
  9273. },
  9274. "input": {
  9275. "type": "object",
  9276. "propertyNames": {
  9277. "type": "string"
  9278. },
  9279. "additionalProperties": {}
  9280. },
  9281. "error": {
  9282. "type": "string"
  9283. },
  9284. "metadata": {
  9285. "type": "object",
  9286. "propertyNames": {
  9287. "type": "string"
  9288. },
  9289. "additionalProperties": {}
  9290. },
  9291. "time": {
  9292. "type": "object",
  9293. "properties": {
  9294. "start": {
  9295. "type": "number"
  9296. },
  9297. "end": {
  9298. "type": "number"
  9299. }
  9300. },
  9301. "required": ["start", "end"]
  9302. }
  9303. },
  9304. "required": ["status", "input", "error", "time"]
  9305. },
  9306. "ToolState": {
  9307. "anyOf": [
  9308. {
  9309. "$ref": "#/components/schemas/ToolStatePending"
  9310. },
  9311. {
  9312. "$ref": "#/components/schemas/ToolStateRunning"
  9313. },
  9314. {
  9315. "$ref": "#/components/schemas/ToolStateCompleted"
  9316. },
  9317. {
  9318. "$ref": "#/components/schemas/ToolStateError"
  9319. }
  9320. ]
  9321. },
  9322. "ToolPart": {
  9323. "type": "object",
  9324. "properties": {
  9325. "id": {
  9326. "type": "string",
  9327. "pattern": "^prt.*"
  9328. },
  9329. "sessionID": {
  9330. "type": "string",
  9331. "pattern": "^ses.*"
  9332. },
  9333. "messageID": {
  9334. "type": "string",
  9335. "pattern": "^msg.*"
  9336. },
  9337. "type": {
  9338. "type": "string",
  9339. "const": "tool"
  9340. },
  9341. "callID": {
  9342. "type": "string"
  9343. },
  9344. "tool": {
  9345. "type": "string"
  9346. },
  9347. "state": {
  9348. "$ref": "#/components/schemas/ToolState"
  9349. },
  9350. "metadata": {
  9351. "type": "object",
  9352. "propertyNames": {
  9353. "type": "string"
  9354. },
  9355. "additionalProperties": {}
  9356. }
  9357. },
  9358. "required": ["id", "sessionID", "messageID", "type", "callID", "tool", "state"]
  9359. },
  9360. "StepStartPart": {
  9361. "type": "object",
  9362. "properties": {
  9363. "id": {
  9364. "type": "string",
  9365. "pattern": "^prt.*"
  9366. },
  9367. "sessionID": {
  9368. "type": "string",
  9369. "pattern": "^ses.*"
  9370. },
  9371. "messageID": {
  9372. "type": "string",
  9373. "pattern": "^msg.*"
  9374. },
  9375. "type": {
  9376. "type": "string",
  9377. "const": "step-start"
  9378. },
  9379. "snapshot": {
  9380. "type": "string"
  9381. }
  9382. },
  9383. "required": ["id", "sessionID", "messageID", "type"]
  9384. },
  9385. "StepFinishPart": {
  9386. "type": "object",
  9387. "properties": {
  9388. "id": {
  9389. "type": "string",
  9390. "pattern": "^prt.*"
  9391. },
  9392. "sessionID": {
  9393. "type": "string",
  9394. "pattern": "^ses.*"
  9395. },
  9396. "messageID": {
  9397. "type": "string",
  9398. "pattern": "^msg.*"
  9399. },
  9400. "type": {
  9401. "type": "string",
  9402. "const": "step-finish"
  9403. },
  9404. "reason": {
  9405. "type": "string"
  9406. },
  9407. "snapshot": {
  9408. "type": "string"
  9409. },
  9410. "cost": {
  9411. "type": "number"
  9412. },
  9413. "tokens": {
  9414. "type": "object",
  9415. "properties": {
  9416. "total": {
  9417. "type": "number"
  9418. },
  9419. "input": {
  9420. "type": "number"
  9421. },
  9422. "output": {
  9423. "type": "number"
  9424. },
  9425. "reasoning": {
  9426. "type": "number"
  9427. },
  9428. "cache": {
  9429. "type": "object",
  9430. "properties": {
  9431. "read": {
  9432. "type": "number"
  9433. },
  9434. "write": {
  9435. "type": "number"
  9436. }
  9437. },
  9438. "required": ["read", "write"]
  9439. }
  9440. },
  9441. "required": ["input", "output", "reasoning", "cache"]
  9442. }
  9443. },
  9444. "required": ["id", "sessionID", "messageID", "type", "reason", "cost", "tokens"]
  9445. },
  9446. "SnapshotPart": {
  9447. "type": "object",
  9448. "properties": {
  9449. "id": {
  9450. "type": "string",
  9451. "pattern": "^prt.*"
  9452. },
  9453. "sessionID": {
  9454. "type": "string",
  9455. "pattern": "^ses.*"
  9456. },
  9457. "messageID": {
  9458. "type": "string",
  9459. "pattern": "^msg.*"
  9460. },
  9461. "type": {
  9462. "type": "string",
  9463. "const": "snapshot"
  9464. },
  9465. "snapshot": {
  9466. "type": "string"
  9467. }
  9468. },
  9469. "required": ["id", "sessionID", "messageID", "type", "snapshot"]
  9470. },
  9471. "PatchPart": {
  9472. "type": "object",
  9473. "properties": {
  9474. "id": {
  9475. "type": "string",
  9476. "pattern": "^prt.*"
  9477. },
  9478. "sessionID": {
  9479. "type": "string",
  9480. "pattern": "^ses.*"
  9481. },
  9482. "messageID": {
  9483. "type": "string",
  9484. "pattern": "^msg.*"
  9485. },
  9486. "type": {
  9487. "type": "string",
  9488. "const": "patch"
  9489. },
  9490. "hash": {
  9491. "type": "string"
  9492. },
  9493. "files": {
  9494. "type": "array",
  9495. "items": {
  9496. "type": "string"
  9497. }
  9498. }
  9499. },
  9500. "required": ["id", "sessionID", "messageID", "type", "hash", "files"]
  9501. },
  9502. "AgentPart": {
  9503. "type": "object",
  9504. "properties": {
  9505. "id": {
  9506. "type": "string",
  9507. "pattern": "^prt.*"
  9508. },
  9509. "sessionID": {
  9510. "type": "string",
  9511. "pattern": "^ses.*"
  9512. },
  9513. "messageID": {
  9514. "type": "string",
  9515. "pattern": "^msg.*"
  9516. },
  9517. "type": {
  9518. "type": "string",
  9519. "const": "agent"
  9520. },
  9521. "name": {
  9522. "type": "string"
  9523. },
  9524. "source": {
  9525. "type": "object",
  9526. "properties": {
  9527. "value": {
  9528. "type": "string"
  9529. },
  9530. "start": {
  9531. "type": "integer",
  9532. "minimum": -9007199254740991,
  9533. "maximum": 9007199254740991
  9534. },
  9535. "end": {
  9536. "type": "integer",
  9537. "minimum": -9007199254740991,
  9538. "maximum": 9007199254740991
  9539. }
  9540. },
  9541. "required": ["value", "start", "end"]
  9542. }
  9543. },
  9544. "required": ["id", "sessionID", "messageID", "type", "name"]
  9545. },
  9546. "RetryPart": {
  9547. "type": "object",
  9548. "properties": {
  9549. "id": {
  9550. "type": "string",
  9551. "pattern": "^prt.*"
  9552. },
  9553. "sessionID": {
  9554. "type": "string",
  9555. "pattern": "^ses.*"
  9556. },
  9557. "messageID": {
  9558. "type": "string",
  9559. "pattern": "^msg.*"
  9560. },
  9561. "type": {
  9562. "type": "string",
  9563. "const": "retry"
  9564. },
  9565. "attempt": {
  9566. "type": "number"
  9567. },
  9568. "error": {
  9569. "$ref": "#/components/schemas/APIError"
  9570. },
  9571. "time": {
  9572. "type": "object",
  9573. "properties": {
  9574. "created": {
  9575. "type": "number"
  9576. }
  9577. },
  9578. "required": ["created"]
  9579. }
  9580. },
  9581. "required": ["id", "sessionID", "messageID", "type", "attempt", "error", "time"]
  9582. },
  9583. "CompactionPart": {
  9584. "type": "object",
  9585. "properties": {
  9586. "id": {
  9587. "type": "string",
  9588. "pattern": "^prt.*"
  9589. },
  9590. "sessionID": {
  9591. "type": "string",
  9592. "pattern": "^ses.*"
  9593. },
  9594. "messageID": {
  9595. "type": "string",
  9596. "pattern": "^msg.*"
  9597. },
  9598. "type": {
  9599. "type": "string",
  9600. "const": "compaction"
  9601. },
  9602. "auto": {
  9603. "type": "boolean"
  9604. },
  9605. "overflow": {
  9606. "type": "boolean"
  9607. }
  9608. },
  9609. "required": ["id", "sessionID", "messageID", "type", "auto"]
  9610. },
  9611. "Part": {
  9612. "anyOf": [
  9613. {
  9614. "$ref": "#/components/schemas/TextPart"
  9615. },
  9616. {
  9617. "$ref": "#/components/schemas/SubtaskPart"
  9618. },
  9619. {
  9620. "$ref": "#/components/schemas/ReasoningPart"
  9621. },
  9622. {
  9623. "$ref": "#/components/schemas/FilePart"
  9624. },
  9625. {
  9626. "$ref": "#/components/schemas/ToolPart"
  9627. },
  9628. {
  9629. "$ref": "#/components/schemas/StepStartPart"
  9630. },
  9631. {
  9632. "$ref": "#/components/schemas/StepFinishPart"
  9633. },
  9634. {
  9635. "$ref": "#/components/schemas/SnapshotPart"
  9636. },
  9637. {
  9638. "$ref": "#/components/schemas/PatchPart"
  9639. },
  9640. {
  9641. "$ref": "#/components/schemas/AgentPart"
  9642. },
  9643. {
  9644. "$ref": "#/components/schemas/RetryPart"
  9645. },
  9646. {
  9647. "$ref": "#/components/schemas/CompactionPart"
  9648. }
  9649. ]
  9650. },
  9651. "Event.message.part.updated": {
  9652. "type": "object",
  9653. "properties": {
  9654. "type": {
  9655. "type": "string",
  9656. "const": "message.part.updated"
  9657. },
  9658. "properties": {
  9659. "type": "object",
  9660. "properties": {
  9661. "sessionID": {
  9662. "type": "string",
  9663. "pattern": "^ses.*"
  9664. },
  9665. "part": {
  9666. "$ref": "#/components/schemas/Part"
  9667. },
  9668. "time": {
  9669. "type": "number"
  9670. }
  9671. },
  9672. "required": ["sessionID", "part", "time"]
  9673. }
  9674. },
  9675. "required": ["type", "properties"]
  9676. },
  9677. "Event.message.part.removed": {
  9678. "type": "object",
  9679. "properties": {
  9680. "type": {
  9681. "type": "string",
  9682. "const": "message.part.removed"
  9683. },
  9684. "properties": {
  9685. "type": "object",
  9686. "properties": {
  9687. "sessionID": {
  9688. "type": "string",
  9689. "pattern": "^ses.*"
  9690. },
  9691. "messageID": {
  9692. "type": "string",
  9693. "pattern": "^msg.*"
  9694. },
  9695. "partID": {
  9696. "type": "string",
  9697. "pattern": "^prt.*"
  9698. }
  9699. },
  9700. "required": ["sessionID", "messageID", "partID"]
  9701. }
  9702. },
  9703. "required": ["type", "properties"]
  9704. },
  9705. "PermissionAction": {
  9706. "type": "string",
  9707. "enum": ["allow", "deny", "ask"]
  9708. },
  9709. "PermissionRule": {
  9710. "type": "object",
  9711. "properties": {
  9712. "permission": {
  9713. "type": "string"
  9714. },
  9715. "pattern": {
  9716. "type": "string"
  9717. },
  9718. "action": {
  9719. "$ref": "#/components/schemas/PermissionAction"
  9720. }
  9721. },
  9722. "required": ["permission", "pattern", "action"]
  9723. },
  9724. "PermissionRuleset": {
  9725. "type": "array",
  9726. "items": {
  9727. "$ref": "#/components/schemas/PermissionRule"
  9728. }
  9729. },
  9730. "Session": {
  9731. "type": "object",
  9732. "properties": {
  9733. "id": {
  9734. "type": "string",
  9735. "pattern": "^ses.*"
  9736. },
  9737. "slug": {
  9738. "type": "string"
  9739. },
  9740. "projectID": {
  9741. "type": "string"
  9742. },
  9743. "workspaceID": {
  9744. "type": "string",
  9745. "pattern": "^wrk.*"
  9746. },
  9747. "directory": {
  9748. "type": "string"
  9749. },
  9750. "parentID": {
  9751. "type": "string",
  9752. "pattern": "^ses.*"
  9753. },
  9754. "summary": {
  9755. "type": "object",
  9756. "properties": {
  9757. "additions": {
  9758. "type": "number"
  9759. },
  9760. "deletions": {
  9761. "type": "number"
  9762. },
  9763. "files": {
  9764. "type": "number"
  9765. },
  9766. "diffs": {
  9767. "type": "array",
  9768. "items": {
  9769. "$ref": "#/components/schemas/SnapshotFileDiff"
  9770. }
  9771. }
  9772. },
  9773. "required": ["additions", "deletions", "files"]
  9774. },
  9775. "share": {
  9776. "type": "object",
  9777. "properties": {
  9778. "url": {
  9779. "type": "string"
  9780. }
  9781. },
  9782. "required": ["url"]
  9783. },
  9784. "title": {
  9785. "type": "string"
  9786. },
  9787. "version": {
  9788. "type": "string"
  9789. },
  9790. "time": {
  9791. "type": "object",
  9792. "properties": {
  9793. "created": {
  9794. "type": "number"
  9795. },
  9796. "updated": {
  9797. "type": "number"
  9798. },
  9799. "compacting": {
  9800. "type": "number"
  9801. },
  9802. "archived": {
  9803. "type": "number"
  9804. }
  9805. },
  9806. "required": ["created", "updated"]
  9807. },
  9808. "permission": {
  9809. "$ref": "#/components/schemas/PermissionRuleset"
  9810. },
  9811. "revert": {
  9812. "type": "object",
  9813. "properties": {
  9814. "messageID": {
  9815. "type": "string",
  9816. "pattern": "^msg.*"
  9817. },
  9818. "partID": {
  9819. "type": "string",
  9820. "pattern": "^prt.*"
  9821. },
  9822. "snapshot": {
  9823. "type": "string"
  9824. },
  9825. "diff": {
  9826. "type": "string"
  9827. }
  9828. },
  9829. "required": ["messageID"]
  9830. }
  9831. },
  9832. "required": ["id", "slug", "projectID", "directory", "title", "version", "time"]
  9833. },
  9834. "Event.session.created": {
  9835. "type": "object",
  9836. "properties": {
  9837. "type": {
  9838. "type": "string",
  9839. "const": "session.created"
  9840. },
  9841. "properties": {
  9842. "type": "object",
  9843. "properties": {
  9844. "sessionID": {
  9845. "type": "string",
  9846. "pattern": "^ses.*"
  9847. },
  9848. "info": {
  9849. "$ref": "#/components/schemas/Session"
  9850. }
  9851. },
  9852. "required": ["sessionID", "info"]
  9853. }
  9854. },
  9855. "required": ["type", "properties"]
  9856. },
  9857. "Event.session.updated": {
  9858. "type": "object",
  9859. "properties": {
  9860. "type": {
  9861. "type": "string",
  9862. "const": "session.updated"
  9863. },
  9864. "properties": {
  9865. "type": "object",
  9866. "properties": {
  9867. "sessionID": {
  9868. "type": "string",
  9869. "pattern": "^ses.*"
  9870. },
  9871. "info": {
  9872. "$ref": "#/components/schemas/Session"
  9873. }
  9874. },
  9875. "required": ["sessionID", "info"]
  9876. }
  9877. },
  9878. "required": ["type", "properties"]
  9879. },
  9880. "Event.session.deleted": {
  9881. "type": "object",
  9882. "properties": {
  9883. "type": {
  9884. "type": "string",
  9885. "const": "session.deleted"
  9886. },
  9887. "properties": {
  9888. "type": "object",
  9889. "properties": {
  9890. "sessionID": {
  9891. "type": "string",
  9892. "pattern": "^ses.*"
  9893. },
  9894. "info": {
  9895. "$ref": "#/components/schemas/Session"
  9896. }
  9897. },
  9898. "required": ["sessionID", "info"]
  9899. }
  9900. },
  9901. "required": ["type", "properties"]
  9902. },
  9903. "SyncEvent.message.updated": {
  9904. "type": "object",
  9905. "properties": {
  9906. "type": {
  9907. "type": "string",
  9908. "const": "sync"
  9909. },
  9910. "name": {
  9911. "type": "string",
  9912. "const": "message.updated.1"
  9913. },
  9914. "id": {
  9915. "type": "string"
  9916. },
  9917. "seq": {
  9918. "type": "number"
  9919. },
  9920. "aggregateID": {
  9921. "type": "string",
  9922. "const": "sessionID"
  9923. },
  9924. "data": {
  9925. "type": "object",
  9926. "properties": {
  9927. "sessionID": {
  9928. "type": "string",
  9929. "pattern": "^ses.*"
  9930. },
  9931. "info": {
  9932. "$ref": "#/components/schemas/Message"
  9933. }
  9934. },
  9935. "required": ["sessionID", "info"]
  9936. }
  9937. },
  9938. "required": ["type", "name", "id", "seq", "aggregateID", "data"]
  9939. },
  9940. "SyncEvent.message.removed": {
  9941. "type": "object",
  9942. "properties": {
  9943. "type": {
  9944. "type": "string",
  9945. "const": "sync"
  9946. },
  9947. "name": {
  9948. "type": "string",
  9949. "const": "message.removed.1"
  9950. },
  9951. "id": {
  9952. "type": "string"
  9953. },
  9954. "seq": {
  9955. "type": "number"
  9956. },
  9957. "aggregateID": {
  9958. "type": "string",
  9959. "const": "sessionID"
  9960. },
  9961. "data": {
  9962. "type": "object",
  9963. "properties": {
  9964. "sessionID": {
  9965. "type": "string",
  9966. "pattern": "^ses.*"
  9967. },
  9968. "messageID": {
  9969. "type": "string",
  9970. "pattern": "^msg.*"
  9971. }
  9972. },
  9973. "required": ["sessionID", "messageID"]
  9974. }
  9975. },
  9976. "required": ["type", "name", "id", "seq", "aggregateID", "data"]
  9977. },
  9978. "SyncEvent.message.part.updated": {
  9979. "type": "object",
  9980. "properties": {
  9981. "type": {
  9982. "type": "string",
  9983. "const": "sync"
  9984. },
  9985. "name": {
  9986. "type": "string",
  9987. "const": "message.part.updated.1"
  9988. },
  9989. "id": {
  9990. "type": "string"
  9991. },
  9992. "seq": {
  9993. "type": "number"
  9994. },
  9995. "aggregateID": {
  9996. "type": "string",
  9997. "const": "sessionID"
  9998. },
  9999. "data": {
  10000. "type": "object",
  10001. "properties": {
  10002. "sessionID": {
  10003. "type": "string",
  10004. "pattern": "^ses.*"
  10005. },
  10006. "part": {
  10007. "$ref": "#/components/schemas/Part"
  10008. },
  10009. "time": {
  10010. "type": "number"
  10011. }
  10012. },
  10013. "required": ["sessionID", "part", "time"]
  10014. }
  10015. },
  10016. "required": ["type", "name", "id", "seq", "aggregateID", "data"]
  10017. },
  10018. "SyncEvent.message.part.removed": {
  10019. "type": "object",
  10020. "properties": {
  10021. "type": {
  10022. "type": "string",
  10023. "const": "sync"
  10024. },
  10025. "name": {
  10026. "type": "string",
  10027. "const": "message.part.removed.1"
  10028. },
  10029. "id": {
  10030. "type": "string"
  10031. },
  10032. "seq": {
  10033. "type": "number"
  10034. },
  10035. "aggregateID": {
  10036. "type": "string",
  10037. "const": "sessionID"
  10038. },
  10039. "data": {
  10040. "type": "object",
  10041. "properties": {
  10042. "sessionID": {
  10043. "type": "string",
  10044. "pattern": "^ses.*"
  10045. },
  10046. "messageID": {
  10047. "type": "string",
  10048. "pattern": "^msg.*"
  10049. },
  10050. "partID": {
  10051. "type": "string",
  10052. "pattern": "^prt.*"
  10053. }
  10054. },
  10055. "required": ["sessionID", "messageID", "partID"]
  10056. }
  10057. },
  10058. "required": ["type", "name", "id", "seq", "aggregateID", "data"]
  10059. },
  10060. "SyncEvent.session.created": {
  10061. "type": "object",
  10062. "properties": {
  10063. "type": {
  10064. "type": "string",
  10065. "const": "sync"
  10066. },
  10067. "name": {
  10068. "type": "string",
  10069. "const": "session.created.1"
  10070. },
  10071. "id": {
  10072. "type": "string"
  10073. },
  10074. "seq": {
  10075. "type": "number"
  10076. },
  10077. "aggregateID": {
  10078. "type": "string",
  10079. "const": "sessionID"
  10080. },
  10081. "data": {
  10082. "type": "object",
  10083. "properties": {
  10084. "sessionID": {
  10085. "type": "string",
  10086. "pattern": "^ses.*"
  10087. },
  10088. "info": {
  10089. "$ref": "#/components/schemas/Session"
  10090. }
  10091. },
  10092. "required": ["sessionID", "info"]
  10093. }
  10094. },
  10095. "required": ["type", "name", "id", "seq", "aggregateID", "data"]
  10096. },
  10097. "SyncEvent.session.updated": {
  10098. "type": "object",
  10099. "properties": {
  10100. "type": {
  10101. "type": "string",
  10102. "const": "sync"
  10103. },
  10104. "name": {
  10105. "type": "string",
  10106. "const": "session.updated.1"
  10107. },
  10108. "id": {
  10109. "type": "string"
  10110. },
  10111. "seq": {
  10112. "type": "number"
  10113. },
  10114. "aggregateID": {
  10115. "type": "string",
  10116. "const": "sessionID"
  10117. },
  10118. "data": {
  10119. "type": "object",
  10120. "properties": {
  10121. "sessionID": {
  10122. "type": "string",
  10123. "pattern": "^ses.*"
  10124. },
  10125. "info": {
  10126. "type": "object",
  10127. "properties": {
  10128. "id": {
  10129. "anyOf": [
  10130. {
  10131. "type": "string",
  10132. "pattern": "^ses.*"
  10133. },
  10134. {
  10135. "type": "null"
  10136. }
  10137. ]
  10138. },
  10139. "slug": {
  10140. "anyOf": [
  10141. {
  10142. "type": "string"
  10143. },
  10144. {
  10145. "type": "null"
  10146. }
  10147. ]
  10148. },
  10149. "projectID": {
  10150. "anyOf": [
  10151. {
  10152. "type": "string"
  10153. },
  10154. {
  10155. "type": "null"
  10156. }
  10157. ]
  10158. },
  10159. "workspaceID": {
  10160. "anyOf": [
  10161. {
  10162. "type": "string",
  10163. "pattern": "^wrk.*"
  10164. },
  10165. {
  10166. "type": "null"
  10167. }
  10168. ]
  10169. },
  10170. "directory": {
  10171. "anyOf": [
  10172. {
  10173. "type": "string"
  10174. },
  10175. {
  10176. "type": "null"
  10177. }
  10178. ]
  10179. },
  10180. "parentID": {
  10181. "anyOf": [
  10182. {
  10183. "type": "string",
  10184. "pattern": "^ses.*"
  10185. },
  10186. {
  10187. "type": "null"
  10188. }
  10189. ]
  10190. },
  10191. "summary": {
  10192. "anyOf": [
  10193. {
  10194. "type": "object",
  10195. "properties": {
  10196. "additions": {
  10197. "type": "number"
  10198. },
  10199. "deletions": {
  10200. "type": "number"
  10201. },
  10202. "files": {
  10203. "type": "number"
  10204. },
  10205. "diffs": {
  10206. "type": "array",
  10207. "items": {
  10208. "$ref": "#/components/schemas/SnapshotFileDiff"
  10209. }
  10210. }
  10211. },
  10212. "required": ["additions", "deletions", "files"]
  10213. },
  10214. {
  10215. "type": "null"
  10216. }
  10217. ]
  10218. },
  10219. "share": {
  10220. "type": "object",
  10221. "properties": {
  10222. "url": {
  10223. "anyOf": [
  10224. {
  10225. "type": "string"
  10226. },
  10227. {
  10228. "type": "null"
  10229. }
  10230. ]
  10231. }
  10232. },
  10233. "required": ["url"]
  10234. },
  10235. "title": {
  10236. "anyOf": [
  10237. {
  10238. "type": "string"
  10239. },
  10240. {
  10241. "type": "null"
  10242. }
  10243. ]
  10244. },
  10245. "version": {
  10246. "anyOf": [
  10247. {
  10248. "type": "string"
  10249. },
  10250. {
  10251. "type": "null"
  10252. }
  10253. ]
  10254. },
  10255. "time": {
  10256. "type": "object",
  10257. "properties": {
  10258. "created": {
  10259. "anyOf": [
  10260. {
  10261. "type": "number"
  10262. },
  10263. {
  10264. "type": "null"
  10265. }
  10266. ]
  10267. },
  10268. "updated": {
  10269. "anyOf": [
  10270. {
  10271. "type": "number"
  10272. },
  10273. {
  10274. "type": "null"
  10275. }
  10276. ]
  10277. },
  10278. "compacting": {
  10279. "anyOf": [
  10280. {
  10281. "type": "number"
  10282. },
  10283. {
  10284. "type": "null"
  10285. }
  10286. ]
  10287. },
  10288. "archived": {
  10289. "anyOf": [
  10290. {
  10291. "type": "number"
  10292. },
  10293. {
  10294. "type": "null"
  10295. }
  10296. ]
  10297. }
  10298. },
  10299. "required": ["created", "updated", "compacting", "archived"]
  10300. },
  10301. "permission": {
  10302. "anyOf": [
  10303. {
  10304. "$ref": "#/components/schemas/PermissionRuleset"
  10305. },
  10306. {
  10307. "type": "null"
  10308. }
  10309. ]
  10310. },
  10311. "revert": {
  10312. "anyOf": [
  10313. {
  10314. "type": "object",
  10315. "properties": {
  10316. "messageID": {
  10317. "type": "string",
  10318. "pattern": "^msg.*"
  10319. },
  10320. "partID": {
  10321. "type": "string",
  10322. "pattern": "^prt.*"
  10323. },
  10324. "snapshot": {
  10325. "type": "string"
  10326. },
  10327. "diff": {
  10328. "type": "string"
  10329. }
  10330. },
  10331. "required": ["messageID"]
  10332. },
  10333. {
  10334. "type": "null"
  10335. }
  10336. ]
  10337. }
  10338. },
  10339. "required": [
  10340. "id",
  10341. "slug",
  10342. "projectID",
  10343. "workspaceID",
  10344. "directory",
  10345. "parentID",
  10346. "summary",
  10347. "title",
  10348. "version",
  10349. "permission",
  10350. "revert"
  10351. ]
  10352. }
  10353. },
  10354. "required": ["sessionID", "info"]
  10355. }
  10356. },
  10357. "required": ["type", "name", "id", "seq", "aggregateID", "data"]
  10358. },
  10359. "SyncEvent.session.deleted": {
  10360. "type": "object",
  10361. "properties": {
  10362. "type": {
  10363. "type": "string",
  10364. "const": "sync"
  10365. },
  10366. "name": {
  10367. "type": "string",
  10368. "const": "session.deleted.1"
  10369. },
  10370. "id": {
  10371. "type": "string"
  10372. },
  10373. "seq": {
  10374. "type": "number"
  10375. },
  10376. "aggregateID": {
  10377. "type": "string",
  10378. "const": "sessionID"
  10379. },
  10380. "data": {
  10381. "type": "object",
  10382. "properties": {
  10383. "sessionID": {
  10384. "type": "string",
  10385. "pattern": "^ses.*"
  10386. },
  10387. "info": {
  10388. "$ref": "#/components/schemas/Session"
  10389. }
  10390. },
  10391. "required": ["sessionID", "info"]
  10392. }
  10393. },
  10394. "required": ["type", "name", "id", "seq", "aggregateID", "data"]
  10395. },
  10396. "GlobalEvent": {
  10397. "type": "object",
  10398. "properties": {
  10399. "directory": {
  10400. "type": "string"
  10401. },
  10402. "project": {
  10403. "type": "string"
  10404. },
  10405. "workspace": {
  10406. "type": "string"
  10407. },
  10408. "payload": {
  10409. "anyOf": [
  10410. {
  10411. "$ref": "#/components/schemas/Event.project.updated"
  10412. },
  10413. {
  10414. "$ref": "#/components/schemas/Event.server.instance.disposed"
  10415. },
  10416. {
  10417. "$ref": "#/components/schemas/Event.installation.updated"
  10418. },
  10419. {
  10420. "$ref": "#/components/schemas/Event.installation.update-available"
  10421. },
  10422. {
  10423. "$ref": "#/components/schemas/Event.server.connected"
  10424. },
  10425. {
  10426. "$ref": "#/components/schemas/Event.global.disposed"
  10427. },
  10428. {
  10429. "$ref": "#/components/schemas/Event.file.edited"
  10430. },
  10431. {
  10432. "$ref": "#/components/schemas/Event.file.watcher.updated"
  10433. },
  10434. {
  10435. "$ref": "#/components/schemas/Event.lsp.client.diagnostics"
  10436. },
  10437. {
  10438. "$ref": "#/components/schemas/Event.lsp.updated"
  10439. },
  10440. {
  10441. "$ref": "#/components/schemas/Event.message.part.delta"
  10442. },
  10443. {
  10444. "$ref": "#/components/schemas/Event.permission.asked"
  10445. },
  10446. {
  10447. "$ref": "#/components/schemas/Event.permission.replied"
  10448. },
  10449. {
  10450. "$ref": "#/components/schemas/Event.session.diff"
  10451. },
  10452. {
  10453. "$ref": "#/components/schemas/Event.session.error"
  10454. },
  10455. {
  10456. "$ref": "#/components/schemas/Event.question.asked"
  10457. },
  10458. {
  10459. "$ref": "#/components/schemas/Event.question.replied"
  10460. },
  10461. {
  10462. "$ref": "#/components/schemas/Event.question.rejected"
  10463. },
  10464. {
  10465. "$ref": "#/components/schemas/Event.todo.updated"
  10466. },
  10467. {
  10468. "$ref": "#/components/schemas/Event.session.status"
  10469. },
  10470. {
  10471. "$ref": "#/components/schemas/Event.session.idle"
  10472. },
  10473. {
  10474. "$ref": "#/components/schemas/Event.session.compacted"
  10475. },
  10476. {
  10477. "$ref": "#/components/schemas/Event.tui.prompt.append"
  10478. },
  10479. {
  10480. "$ref": "#/components/schemas/Event.tui.command.execute"
  10481. },
  10482. {
  10483. "$ref": "#/components/schemas/Event.tui.toast.show"
  10484. },
  10485. {
  10486. "$ref": "#/components/schemas/Event.tui.session.select"
  10487. },
  10488. {
  10489. "$ref": "#/components/schemas/Event.mcp.tools.changed"
  10490. },
  10491. {
  10492. "$ref": "#/components/schemas/Event.mcp.browser.open.failed"
  10493. },
  10494. {
  10495. "$ref": "#/components/schemas/Event.command.executed"
  10496. },
  10497. {
  10498. "$ref": "#/components/schemas/Event.vcs.branch.updated"
  10499. },
  10500. {
  10501. "$ref": "#/components/schemas/Event.worktree.ready"
  10502. },
  10503. {
  10504. "$ref": "#/components/schemas/Event.worktree.failed"
  10505. },
  10506. {
  10507. "$ref": "#/components/schemas/Event.pty.created"
  10508. },
  10509. {
  10510. "$ref": "#/components/schemas/Event.pty.updated"
  10511. },
  10512. {
  10513. "$ref": "#/components/schemas/Event.pty.exited"
  10514. },
  10515. {
  10516. "$ref": "#/components/schemas/Event.pty.deleted"
  10517. },
  10518. {
  10519. "$ref": "#/components/schemas/Event.workspace.ready"
  10520. },
  10521. {
  10522. "$ref": "#/components/schemas/Event.workspace.failed"
  10523. },
  10524. {
  10525. "$ref": "#/components/schemas/Event.workspace.status"
  10526. },
  10527. {
  10528. "$ref": "#/components/schemas/Event.message.updated"
  10529. },
  10530. {
  10531. "$ref": "#/components/schemas/Event.message.removed"
  10532. },
  10533. {
  10534. "$ref": "#/components/schemas/Event.message.part.updated"
  10535. },
  10536. {
  10537. "$ref": "#/components/schemas/Event.message.part.removed"
  10538. },
  10539. {
  10540. "$ref": "#/components/schemas/Event.session.created"
  10541. },
  10542. {
  10543. "$ref": "#/components/schemas/Event.session.updated"
  10544. },
  10545. {
  10546. "$ref": "#/components/schemas/Event.session.deleted"
  10547. },
  10548. {
  10549. "$ref": "#/components/schemas/SyncEvent.message.updated"
  10550. },
  10551. {
  10552. "$ref": "#/components/schemas/SyncEvent.message.removed"
  10553. },
  10554. {
  10555. "$ref": "#/components/schemas/SyncEvent.message.part.updated"
  10556. },
  10557. {
  10558. "$ref": "#/components/schemas/SyncEvent.message.part.removed"
  10559. },
  10560. {
  10561. "$ref": "#/components/schemas/SyncEvent.session.created"
  10562. },
  10563. {
  10564. "$ref": "#/components/schemas/SyncEvent.session.updated"
  10565. },
  10566. {
  10567. "$ref": "#/components/schemas/SyncEvent.session.deleted"
  10568. }
  10569. ]
  10570. }
  10571. },
  10572. "required": ["directory", "payload"]
  10573. },
  10574. "LogLevel": {
  10575. "description": "Log level",
  10576. "type": "string",
  10577. "enum": ["DEBUG", "INFO", "WARN", "ERROR"]
  10578. },
  10579. "ServerConfig": {
  10580. "description": "Server configuration for opencode serve and web commands",
  10581. "type": "object",
  10582. "properties": {
  10583. "port": {
  10584. "description": "Port to listen on",
  10585. "type": "integer",
  10586. "exclusiveMinimum": 0,
  10587. "maximum": 9007199254740991
  10588. },
  10589. "hostname": {
  10590. "description": "Hostname to listen on",
  10591. "type": "string"
  10592. },
  10593. "mdns": {
  10594. "description": "Enable mDNS service discovery",
  10595. "type": "boolean"
  10596. },
  10597. "mdnsDomain": {
  10598. "description": "Custom domain name for mDNS service (default: opencode.local)",
  10599. "type": "string"
  10600. },
  10601. "cors": {
  10602. "description": "Additional domains to allow for CORS",
  10603. "type": "array",
  10604. "items": {
  10605. "type": "string"
  10606. }
  10607. }
  10608. },
  10609. "additionalProperties": false
  10610. },
  10611. "PermissionActionConfig": {
  10612. "type": "string",
  10613. "enum": ["ask", "allow", "deny"]
  10614. },
  10615. "PermissionObjectConfig": {
  10616. "type": "object",
  10617. "propertyNames": {
  10618. "type": "string"
  10619. },
  10620. "additionalProperties": {
  10621. "$ref": "#/components/schemas/PermissionActionConfig"
  10622. }
  10623. },
  10624. "PermissionRuleConfig": {
  10625. "anyOf": [
  10626. {
  10627. "$ref": "#/components/schemas/PermissionActionConfig"
  10628. },
  10629. {
  10630. "$ref": "#/components/schemas/PermissionObjectConfig"
  10631. }
  10632. ]
  10633. },
  10634. "PermissionConfig": {
  10635. "anyOf": [
  10636. {
  10637. "type": "object",
  10638. "properties": {
  10639. "__originalKeys": {
  10640. "type": "array",
  10641. "items": {
  10642. "type": "string"
  10643. }
  10644. },
  10645. "read": {
  10646. "$ref": "#/components/schemas/PermissionRuleConfig"
  10647. },
  10648. "edit": {
  10649. "$ref": "#/components/schemas/PermissionRuleConfig"
  10650. },
  10651. "glob": {
  10652. "$ref": "#/components/schemas/PermissionRuleConfig"
  10653. },
  10654. "grep": {
  10655. "$ref": "#/components/schemas/PermissionRuleConfig"
  10656. },
  10657. "list": {
  10658. "$ref": "#/components/schemas/PermissionRuleConfig"
  10659. },
  10660. "bash": {
  10661. "$ref": "#/components/schemas/PermissionRuleConfig"
  10662. },
  10663. "task": {
  10664. "$ref": "#/components/schemas/PermissionRuleConfig"
  10665. },
  10666. "external_directory": {
  10667. "$ref": "#/components/schemas/PermissionRuleConfig"
  10668. },
  10669. "todowrite": {
  10670. "$ref": "#/components/schemas/PermissionActionConfig"
  10671. },
  10672. "question": {
  10673. "$ref": "#/components/schemas/PermissionActionConfig"
  10674. },
  10675. "webfetch": {
  10676. "$ref": "#/components/schemas/PermissionActionConfig"
  10677. },
  10678. "websearch": {
  10679. "$ref": "#/components/schemas/PermissionActionConfig"
  10680. },
  10681. "codesearch": {
  10682. "$ref": "#/components/schemas/PermissionActionConfig"
  10683. },
  10684. "lsp": {
  10685. "$ref": "#/components/schemas/PermissionRuleConfig"
  10686. },
  10687. "doom_loop": {
  10688. "$ref": "#/components/schemas/PermissionActionConfig"
  10689. },
  10690. "skill": {
  10691. "$ref": "#/components/schemas/PermissionRuleConfig"
  10692. }
  10693. },
  10694. "additionalProperties": {
  10695. "$ref": "#/components/schemas/PermissionRuleConfig"
  10696. }
  10697. },
  10698. {
  10699. "$ref": "#/components/schemas/PermissionActionConfig"
  10700. }
  10701. ]
  10702. },
  10703. "AgentConfig": {
  10704. "type": "object",
  10705. "properties": {
  10706. "model": {
  10707. "type": "string"
  10708. },
  10709. "variant": {
  10710. "description": "Default model variant for this agent (applies only when using the agent's configured model).",
  10711. "type": "string"
  10712. },
  10713. "temperature": {
  10714. "type": "number"
  10715. },
  10716. "top_p": {
  10717. "type": "number"
  10718. },
  10719. "prompt": {
  10720. "type": "string"
  10721. },
  10722. "tools": {
  10723. "description": "@deprecated Use 'permission' field instead",
  10724. "type": "object",
  10725. "propertyNames": {
  10726. "type": "string"
  10727. },
  10728. "additionalProperties": {
  10729. "type": "boolean"
  10730. }
  10731. },
  10732. "disable": {
  10733. "type": "boolean"
  10734. },
  10735. "description": {
  10736. "description": "Description of when to use the agent",
  10737. "type": "string"
  10738. },
  10739. "mode": {
  10740. "type": "string",
  10741. "enum": ["subagent", "primary", "all"]
  10742. },
  10743. "hidden": {
  10744. "description": "Hide this subagent from the @ autocomplete menu (default: false, only applies to mode: subagent)",
  10745. "type": "boolean"
  10746. },
  10747. "options": {
  10748. "type": "object",
  10749. "propertyNames": {
  10750. "type": "string"
  10751. },
  10752. "additionalProperties": {}
  10753. },
  10754. "color": {
  10755. "description": "Hex color code (e.g., #FF5733) or theme color (e.g., primary)",
  10756. "anyOf": [
  10757. {
  10758. "type": "string",
  10759. "pattern": "^#[0-9a-fA-F]{6}$"
  10760. },
  10761. {
  10762. "type": "string",
  10763. "enum": ["primary", "secondary", "accent", "success", "warning", "error", "info"]
  10764. }
  10765. ]
  10766. },
  10767. "steps": {
  10768. "description": "Maximum number of agentic iterations before forcing text-only response",
  10769. "type": "integer",
  10770. "exclusiveMinimum": 0,
  10771. "maximum": 9007199254740991
  10772. },
  10773. "maxSteps": {
  10774. "description": "@deprecated Use 'steps' field instead.",
  10775. "type": "integer",
  10776. "exclusiveMinimum": 0,
  10777. "maximum": 9007199254740991
  10778. },
  10779. "permission": {
  10780. "$ref": "#/components/schemas/PermissionConfig"
  10781. }
  10782. },
  10783. "additionalProperties": {}
  10784. },
  10785. "ProviderConfig": {
  10786. "type": "object",
  10787. "properties": {
  10788. "api": {
  10789. "type": "string"
  10790. },
  10791. "name": {
  10792. "type": "string"
  10793. },
  10794. "env": {
  10795. "type": "array",
  10796. "items": {
  10797. "type": "string"
  10798. }
  10799. },
  10800. "id": {
  10801. "type": "string"
  10802. },
  10803. "npm": {
  10804. "type": "string"
  10805. },
  10806. "whitelist": {
  10807. "type": "array",
  10808. "items": {
  10809. "type": "string"
  10810. }
  10811. },
  10812. "blacklist": {
  10813. "type": "array",
  10814. "items": {
  10815. "type": "string"
  10816. }
  10817. },
  10818. "options": {
  10819. "type": "object",
  10820. "properties": {
  10821. "apiKey": {
  10822. "type": "string"
  10823. },
  10824. "baseURL": {
  10825. "type": "string"
  10826. },
  10827. "enterpriseUrl": {
  10828. "description": "GitHub Enterprise URL for copilot authentication",
  10829. "type": "string"
  10830. },
  10831. "setCacheKey": {
  10832. "description": "Enable promptCacheKey for this provider (default false)",
  10833. "type": "boolean"
  10834. },
  10835. "timeout": {
  10836. "description": "Timeout in milliseconds for requests to this provider. Default is 300000 (5 minutes). Set to false to disable timeout.",
  10837. "anyOf": [
  10838. {
  10839. "description": "Timeout in milliseconds for requests to this provider. Default is 300000 (5 minutes). Set to false to disable timeout.",
  10840. "type": "integer",
  10841. "exclusiveMinimum": 0,
  10842. "maximum": 9007199254740991
  10843. },
  10844. {
  10845. "description": "Disable timeout for this provider entirely.",
  10846. "type": "boolean",
  10847. "const": false
  10848. }
  10849. ]
  10850. },
  10851. "chunkTimeout": {
  10852. "description": "Timeout in milliseconds between streamed SSE chunks for this provider. If no chunk arrives within this window, the request is aborted.",
  10853. "type": "integer",
  10854. "exclusiveMinimum": 0,
  10855. "maximum": 9007199254740991
  10856. }
  10857. },
  10858. "additionalProperties": {}
  10859. },
  10860. "models": {
  10861. "type": "object",
  10862. "propertyNames": {
  10863. "type": "string"
  10864. },
  10865. "additionalProperties": {
  10866. "type": "object",
  10867. "properties": {
  10868. "id": {
  10869. "type": "string"
  10870. },
  10871. "name": {
  10872. "type": "string"
  10873. },
  10874. "family": {
  10875. "type": "string"
  10876. },
  10877. "release_date": {
  10878. "type": "string"
  10879. },
  10880. "attachment": {
  10881. "type": "boolean"
  10882. },
  10883. "reasoning": {
  10884. "type": "boolean"
  10885. },
  10886. "temperature": {
  10887. "type": "boolean"
  10888. },
  10889. "tool_call": {
  10890. "type": "boolean"
  10891. },
  10892. "interleaved": {
  10893. "anyOf": [
  10894. {
  10895. "type": "boolean",
  10896. "const": true
  10897. },
  10898. {
  10899. "type": "object",
  10900. "properties": {
  10901. "field": {
  10902. "type": "string",
  10903. "enum": ["reasoning_content", "reasoning_details"]
  10904. }
  10905. },
  10906. "required": ["field"],
  10907. "additionalProperties": false
  10908. }
  10909. ]
  10910. },
  10911. "cost": {
  10912. "type": "object",
  10913. "properties": {
  10914. "input": {
  10915. "type": "number"
  10916. },
  10917. "output": {
  10918. "type": "number"
  10919. },
  10920. "cache_read": {
  10921. "type": "number"
  10922. },
  10923. "cache_write": {
  10924. "type": "number"
  10925. },
  10926. "context_over_200k": {
  10927. "type": "object",
  10928. "properties": {
  10929. "input": {
  10930. "type": "number"
  10931. },
  10932. "output": {
  10933. "type": "number"
  10934. },
  10935. "cache_read": {
  10936. "type": "number"
  10937. },
  10938. "cache_write": {
  10939. "type": "number"
  10940. }
  10941. },
  10942. "required": ["input", "output"]
  10943. }
  10944. },
  10945. "required": ["input", "output"]
  10946. },
  10947. "limit": {
  10948. "type": "object",
  10949. "properties": {
  10950. "context": {
  10951. "type": "number"
  10952. },
  10953. "input": {
  10954. "type": "number"
  10955. },
  10956. "output": {
  10957. "type": "number"
  10958. }
  10959. },
  10960. "required": ["context", "output"]
  10961. },
  10962. "modalities": {
  10963. "type": "object",
  10964. "properties": {
  10965. "input": {
  10966. "type": "array",
  10967. "items": {
  10968. "type": "string",
  10969. "enum": ["text", "audio", "image", "video", "pdf"]
  10970. }
  10971. },
  10972. "output": {
  10973. "type": "array",
  10974. "items": {
  10975. "type": "string",
  10976. "enum": ["text", "audio", "image", "video", "pdf"]
  10977. }
  10978. }
  10979. },
  10980. "required": ["input", "output"]
  10981. },
  10982. "experimental": {
  10983. "type": "boolean"
  10984. },
  10985. "status": {
  10986. "type": "string",
  10987. "enum": ["alpha", "beta", "deprecated"]
  10988. },
  10989. "provider": {
  10990. "type": "object",
  10991. "properties": {
  10992. "npm": {
  10993. "type": "string"
  10994. },
  10995. "api": {
  10996. "type": "string"
  10997. }
  10998. }
  10999. },
  11000. "options": {
  11001. "type": "object",
  11002. "propertyNames": {
  11003. "type": "string"
  11004. },
  11005. "additionalProperties": {}
  11006. },
  11007. "headers": {
  11008. "type": "object",
  11009. "propertyNames": {
  11010. "type": "string"
  11011. },
  11012. "additionalProperties": {
  11013. "type": "string"
  11014. }
  11015. },
  11016. "variants": {
  11017. "description": "Variant-specific configuration",
  11018. "type": "object",
  11019. "propertyNames": {
  11020. "type": "string"
  11021. },
  11022. "additionalProperties": {
  11023. "type": "object",
  11024. "properties": {
  11025. "disabled": {
  11026. "description": "Disable this variant for the model",
  11027. "type": "boolean"
  11028. }
  11029. },
  11030. "additionalProperties": {}
  11031. }
  11032. }
  11033. }
  11034. }
  11035. }
  11036. },
  11037. "additionalProperties": false
  11038. },
  11039. "McpLocalConfig": {
  11040. "type": "object",
  11041. "properties": {
  11042. "type": {
  11043. "description": "Type of MCP server connection",
  11044. "type": "string",
  11045. "const": "local"
  11046. },
  11047. "command": {
  11048. "description": "Command and arguments to run the MCP server",
  11049. "type": "array",
  11050. "items": {
  11051. "type": "string"
  11052. }
  11053. },
  11054. "environment": {
  11055. "description": "Environment variables to set when running the MCP server",
  11056. "type": "object",
  11057. "propertyNames": {
  11058. "type": "string"
  11059. },
  11060. "additionalProperties": {
  11061. "type": "string"
  11062. }
  11063. },
  11064. "enabled": {
  11065. "description": "Enable or disable the MCP server on startup",
  11066. "type": "boolean"
  11067. },
  11068. "timeout": {
  11069. "description": "Timeout in ms for MCP server requests. Defaults to 5000 (5 seconds) if not specified.",
  11070. "type": "integer",
  11071. "exclusiveMinimum": 0,
  11072. "maximum": 9007199254740991
  11073. }
  11074. },
  11075. "required": ["type", "command"],
  11076. "additionalProperties": false
  11077. },
  11078. "McpOAuthConfig": {
  11079. "type": "object",
  11080. "properties": {
  11081. "clientId": {
  11082. "description": "OAuth client ID. If not provided, dynamic client registration (RFC 7591) will be attempted.",
  11083. "type": "string"
  11084. },
  11085. "clientSecret": {
  11086. "description": "OAuth client secret (if required by the authorization server)",
  11087. "type": "string"
  11088. },
  11089. "scope": {
  11090. "description": "OAuth scopes to request during authorization",
  11091. "type": "string"
  11092. },
  11093. "redirectUri": {
  11094. "description": "OAuth redirect URI (default: http://127.0.0.1:19876/mcp/oauth/callback).",
  11095. "type": "string"
  11096. }
  11097. },
  11098. "additionalProperties": false
  11099. },
  11100. "McpRemoteConfig": {
  11101. "type": "object",
  11102. "properties": {
  11103. "type": {
  11104. "description": "Type of MCP server connection",
  11105. "type": "string",
  11106. "const": "remote"
  11107. },
  11108. "url": {
  11109. "description": "URL of the remote MCP server",
  11110. "type": "string"
  11111. },
  11112. "enabled": {
  11113. "description": "Enable or disable the MCP server on startup",
  11114. "type": "boolean"
  11115. },
  11116. "headers": {
  11117. "description": "Headers to send with the request",
  11118. "type": "object",
  11119. "propertyNames": {
  11120. "type": "string"
  11121. },
  11122. "additionalProperties": {
  11123. "type": "string"
  11124. }
  11125. },
  11126. "oauth": {
  11127. "description": "OAuth authentication configuration for the MCP server. Set to false to disable OAuth auto-detection.",
  11128. "anyOf": [
  11129. {
  11130. "$ref": "#/components/schemas/McpOAuthConfig"
  11131. },
  11132. {
  11133. "type": "boolean",
  11134. "const": false
  11135. }
  11136. ]
  11137. },
  11138. "timeout": {
  11139. "description": "Timeout in ms for MCP server requests. Defaults to 5000 (5 seconds) if not specified.",
  11140. "type": "integer",
  11141. "exclusiveMinimum": 0,
  11142. "maximum": 9007199254740991
  11143. }
  11144. },
  11145. "required": ["type", "url"],
  11146. "additionalProperties": false
  11147. },
  11148. "LayoutConfig": {
  11149. "description": "@deprecated Always uses stretch layout.",
  11150. "type": "string",
  11151. "enum": ["auto", "stretch"]
  11152. },
  11153. "Config": {
  11154. "type": "object",
  11155. "properties": {
  11156. "$schema": {
  11157. "description": "JSON schema reference for configuration validation",
  11158. "type": "string"
  11159. },
  11160. "logLevel": {
  11161. "$ref": "#/components/schemas/LogLevel"
  11162. },
  11163. "server": {
  11164. "$ref": "#/components/schemas/ServerConfig"
  11165. },
  11166. "command": {
  11167. "description": "Command configuration, see https://opencode.ai/docs/commands",
  11168. "type": "object",
  11169. "propertyNames": {
  11170. "type": "string"
  11171. },
  11172. "additionalProperties": {
  11173. "type": "object",
  11174. "properties": {
  11175. "template": {
  11176. "type": "string"
  11177. },
  11178. "description": {
  11179. "type": "string"
  11180. },
  11181. "agent": {
  11182. "type": "string"
  11183. },
  11184. "model": {
  11185. "type": "string"
  11186. },
  11187. "subtask": {
  11188. "type": "boolean"
  11189. }
  11190. },
  11191. "required": ["template"]
  11192. }
  11193. },
  11194. "skills": {
  11195. "description": "Additional skill folder paths",
  11196. "type": "object",
  11197. "properties": {
  11198. "paths": {
  11199. "description": "Additional paths to skill folders",
  11200. "type": "array",
  11201. "items": {
  11202. "type": "string"
  11203. }
  11204. },
  11205. "urls": {
  11206. "description": "URLs to fetch skills from (e.g., https://example.com/.well-known/skills/)",
  11207. "type": "array",
  11208. "items": {
  11209. "type": "string"
  11210. }
  11211. }
  11212. }
  11213. },
  11214. "watcher": {
  11215. "type": "object",
  11216. "properties": {
  11217. "ignore": {
  11218. "type": "array",
  11219. "items": {
  11220. "type": "string"
  11221. }
  11222. }
  11223. }
  11224. },
  11225. "snapshot": {
  11226. "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.",
  11227. "type": "boolean"
  11228. },
  11229. "plugin": {
  11230. "type": "array",
  11231. "items": {
  11232. "anyOf": [
  11233. {
  11234. "type": "string"
  11235. },
  11236. {
  11237. "type": "array",
  11238. "prefixItems": [
  11239. {
  11240. "type": "string"
  11241. },
  11242. {
  11243. "type": "object",
  11244. "propertyNames": {
  11245. "type": "string"
  11246. },
  11247. "additionalProperties": {}
  11248. }
  11249. ]
  11250. }
  11251. ]
  11252. }
  11253. },
  11254. "share": {
  11255. "description": "Control sharing behavior:'manual' allows manual sharing via commands, 'auto' enables automatic sharing, 'disabled' disables all sharing",
  11256. "type": "string",
  11257. "enum": ["manual", "auto", "disabled"]
  11258. },
  11259. "autoshare": {
  11260. "description": "@deprecated Use 'share' field instead. Share newly created sessions automatically",
  11261. "type": "boolean"
  11262. },
  11263. "autoupdate": {
  11264. "description": "Automatically update to the latest version. Set to true to auto-update, false to disable, or 'notify' to show update notifications",
  11265. "anyOf": [
  11266. {
  11267. "type": "boolean"
  11268. },
  11269. {
  11270. "type": "string",
  11271. "const": "notify"
  11272. }
  11273. ]
  11274. },
  11275. "disabled_providers": {
  11276. "description": "Disable providers that are loaded automatically",
  11277. "type": "array",
  11278. "items": {
  11279. "type": "string"
  11280. }
  11281. },
  11282. "enabled_providers": {
  11283. "description": "When set, ONLY these providers will be enabled. All other providers will be ignored",
  11284. "type": "array",
  11285. "items": {
  11286. "type": "string"
  11287. }
  11288. },
  11289. "model": {
  11290. "description": "Model to use in the format of provider/model, eg anthropic/claude-2",
  11291. "type": "string"
  11292. },
  11293. "small_model": {
  11294. "description": "Small model to use for tasks like title generation in the format of provider/model",
  11295. "type": "string"
  11296. },
  11297. "default_agent": {
  11298. "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.",
  11299. "type": "string"
  11300. },
  11301. "username": {
  11302. "description": "Custom username to display in conversations instead of system username",
  11303. "type": "string"
  11304. },
  11305. "mode": {
  11306. "description": "@deprecated Use `agent` field instead.",
  11307. "type": "object",
  11308. "properties": {
  11309. "build": {
  11310. "$ref": "#/components/schemas/AgentConfig"
  11311. },
  11312. "plan": {
  11313. "$ref": "#/components/schemas/AgentConfig"
  11314. }
  11315. },
  11316. "additionalProperties": {
  11317. "$ref": "#/components/schemas/AgentConfig"
  11318. }
  11319. },
  11320. "agent": {
  11321. "description": "Agent configuration, see https://opencode.ai/docs/agents",
  11322. "type": "object",
  11323. "properties": {
  11324. "plan": {
  11325. "$ref": "#/components/schemas/AgentConfig"
  11326. },
  11327. "build": {
  11328. "$ref": "#/components/schemas/AgentConfig"
  11329. },
  11330. "general": {
  11331. "$ref": "#/components/schemas/AgentConfig"
  11332. },
  11333. "explore": {
  11334. "$ref": "#/components/schemas/AgentConfig"
  11335. },
  11336. "title": {
  11337. "$ref": "#/components/schemas/AgentConfig"
  11338. },
  11339. "summary": {
  11340. "$ref": "#/components/schemas/AgentConfig"
  11341. },
  11342. "compaction": {
  11343. "$ref": "#/components/schemas/AgentConfig"
  11344. }
  11345. },
  11346. "additionalProperties": {
  11347. "$ref": "#/components/schemas/AgentConfig"
  11348. }
  11349. },
  11350. "provider": {
  11351. "description": "Custom provider configurations and model overrides",
  11352. "type": "object",
  11353. "propertyNames": {
  11354. "type": "string"
  11355. },
  11356. "additionalProperties": {
  11357. "$ref": "#/components/schemas/ProviderConfig"
  11358. }
  11359. },
  11360. "mcp": {
  11361. "description": "MCP (Model Context Protocol) server configurations",
  11362. "type": "object",
  11363. "propertyNames": {
  11364. "type": "string"
  11365. },
  11366. "additionalProperties": {
  11367. "anyOf": [
  11368. {
  11369. "anyOf": [
  11370. {
  11371. "$ref": "#/components/schemas/McpLocalConfig"
  11372. },
  11373. {
  11374. "$ref": "#/components/schemas/McpRemoteConfig"
  11375. }
  11376. ]
  11377. },
  11378. {
  11379. "type": "object",
  11380. "properties": {
  11381. "enabled": {
  11382. "type": "boolean"
  11383. }
  11384. },
  11385. "required": ["enabled"],
  11386. "additionalProperties": false
  11387. }
  11388. ]
  11389. }
  11390. },
  11391. "formatter": {
  11392. "anyOf": [
  11393. {
  11394. "type": "boolean",
  11395. "const": false
  11396. },
  11397. {
  11398. "type": "object",
  11399. "propertyNames": {
  11400. "type": "string"
  11401. },
  11402. "additionalProperties": {
  11403. "type": "object",
  11404. "properties": {
  11405. "disabled": {
  11406. "type": "boolean"
  11407. },
  11408. "command": {
  11409. "type": "array",
  11410. "items": {
  11411. "type": "string"
  11412. }
  11413. },
  11414. "environment": {
  11415. "type": "object",
  11416. "propertyNames": {
  11417. "type": "string"
  11418. },
  11419. "additionalProperties": {
  11420. "type": "string"
  11421. }
  11422. },
  11423. "extensions": {
  11424. "type": "array",
  11425. "items": {
  11426. "type": "string"
  11427. }
  11428. }
  11429. }
  11430. }
  11431. }
  11432. ]
  11433. },
  11434. "lsp": {
  11435. "anyOf": [
  11436. {
  11437. "type": "boolean",
  11438. "const": false
  11439. },
  11440. {
  11441. "type": "object",
  11442. "propertyNames": {
  11443. "type": "string"
  11444. },
  11445. "additionalProperties": {
  11446. "anyOf": [
  11447. {
  11448. "type": "object",
  11449. "properties": {
  11450. "disabled": {
  11451. "type": "boolean",
  11452. "const": true
  11453. }
  11454. },
  11455. "required": ["disabled"]
  11456. },
  11457. {
  11458. "type": "object",
  11459. "properties": {
  11460. "command": {
  11461. "type": "array",
  11462. "items": {
  11463. "type": "string"
  11464. }
  11465. },
  11466. "extensions": {
  11467. "type": "array",
  11468. "items": {
  11469. "type": "string"
  11470. }
  11471. },
  11472. "disabled": {
  11473. "type": "boolean"
  11474. },
  11475. "env": {
  11476. "type": "object",
  11477. "propertyNames": {
  11478. "type": "string"
  11479. },
  11480. "additionalProperties": {
  11481. "type": "string"
  11482. }
  11483. },
  11484. "initialization": {
  11485. "type": "object",
  11486. "propertyNames": {
  11487. "type": "string"
  11488. },
  11489. "additionalProperties": {}
  11490. }
  11491. },
  11492. "required": ["command"]
  11493. }
  11494. ]
  11495. }
  11496. }
  11497. ]
  11498. },
  11499. "instructions": {
  11500. "description": "Additional instruction files or patterns to include",
  11501. "type": "array",
  11502. "items": {
  11503. "type": "string"
  11504. }
  11505. },
  11506. "layout": {
  11507. "$ref": "#/components/schemas/LayoutConfig"
  11508. },
  11509. "permission": {
  11510. "$ref": "#/components/schemas/PermissionConfig"
  11511. },
  11512. "tools": {
  11513. "type": "object",
  11514. "propertyNames": {
  11515. "type": "string"
  11516. },
  11517. "additionalProperties": {
  11518. "type": "boolean"
  11519. }
  11520. },
  11521. "enterprise": {
  11522. "type": "object",
  11523. "properties": {
  11524. "url": {
  11525. "description": "Enterprise URL",
  11526. "type": "string"
  11527. }
  11528. }
  11529. },
  11530. "compaction": {
  11531. "type": "object",
  11532. "properties": {
  11533. "auto": {
  11534. "description": "Enable automatic compaction when context is full (default: true)",
  11535. "type": "boolean"
  11536. },
  11537. "prune": {
  11538. "description": "Enable pruning of old tool outputs (default: true)",
  11539. "type": "boolean"
  11540. },
  11541. "reserved": {
  11542. "description": "Token buffer for compaction. Leaves enough window to avoid overflow during compaction.",
  11543. "type": "integer",
  11544. "minimum": 0,
  11545. "maximum": 9007199254740991
  11546. }
  11547. }
  11548. },
  11549. "experimental": {
  11550. "type": "object",
  11551. "properties": {
  11552. "disable_paste_summary": {
  11553. "type": "boolean"
  11554. },
  11555. "batch_tool": {
  11556. "description": "Enable the batch tool",
  11557. "type": "boolean"
  11558. },
  11559. "openTelemetry": {
  11560. "description": "Enable OpenTelemetry spans for AI SDK calls (using the 'experimental_telemetry' flag)",
  11561. "type": "boolean"
  11562. },
  11563. "primary_tools": {
  11564. "description": "Tools that should only be available to primary agents.",
  11565. "type": "array",
  11566. "items": {
  11567. "type": "string"
  11568. }
  11569. },
  11570. "continue_loop_on_deny": {
  11571. "description": "Continue the agent loop when a tool call is denied",
  11572. "type": "boolean"
  11573. },
  11574. "mcp_timeout": {
  11575. "description": "Timeout in milliseconds for model context protocol (MCP) requests",
  11576. "type": "integer",
  11577. "exclusiveMinimum": 0,
  11578. "maximum": 9007199254740991
  11579. }
  11580. }
  11581. }
  11582. },
  11583. "additionalProperties": false
  11584. },
  11585. "BadRequestError": {
  11586. "type": "object",
  11587. "properties": {
  11588. "data": {},
  11589. "errors": {
  11590. "type": "array",
  11591. "items": {
  11592. "type": "object",
  11593. "propertyNames": {
  11594. "type": "string"
  11595. },
  11596. "additionalProperties": {}
  11597. }
  11598. },
  11599. "success": {
  11600. "type": "boolean",
  11601. "const": false
  11602. }
  11603. },
  11604. "required": ["data", "errors", "success"]
  11605. },
  11606. "OAuth": {
  11607. "type": "object",
  11608. "properties": {
  11609. "type": {
  11610. "type": "string",
  11611. "const": "oauth"
  11612. },
  11613. "refresh": {
  11614. "type": "string"
  11615. },
  11616. "access": {
  11617. "type": "string"
  11618. },
  11619. "expires": {
  11620. "type": "number"
  11621. },
  11622. "accountId": {
  11623. "type": "string"
  11624. },
  11625. "enterpriseUrl": {
  11626. "type": "string"
  11627. }
  11628. },
  11629. "required": ["type", "refresh", "access", "expires"]
  11630. },
  11631. "ApiAuth": {
  11632. "type": "object",
  11633. "properties": {
  11634. "type": {
  11635. "type": "string",
  11636. "const": "api"
  11637. },
  11638. "key": {
  11639. "type": "string"
  11640. },
  11641. "metadata": {
  11642. "type": "object",
  11643. "propertyNames": {
  11644. "type": "string"
  11645. },
  11646. "additionalProperties": {
  11647. "type": "string"
  11648. }
  11649. }
  11650. },
  11651. "required": ["type", "key"]
  11652. },
  11653. "WellKnownAuth": {
  11654. "type": "object",
  11655. "properties": {
  11656. "type": {
  11657. "type": "string",
  11658. "const": "wellknown"
  11659. },
  11660. "key": {
  11661. "type": "string"
  11662. },
  11663. "token": {
  11664. "type": "string"
  11665. }
  11666. },
  11667. "required": ["type", "key", "token"]
  11668. },
  11669. "Auth": {
  11670. "anyOf": [
  11671. {
  11672. "$ref": "#/components/schemas/OAuth"
  11673. },
  11674. {
  11675. "$ref": "#/components/schemas/ApiAuth"
  11676. },
  11677. {
  11678. "$ref": "#/components/schemas/WellKnownAuth"
  11679. }
  11680. ]
  11681. },
  11682. "NotFoundError": {
  11683. "type": "object",
  11684. "properties": {
  11685. "name": {
  11686. "type": "string",
  11687. "const": "NotFoundError"
  11688. },
  11689. "data": {
  11690. "type": "object",
  11691. "properties": {
  11692. "message": {
  11693. "type": "string"
  11694. }
  11695. },
  11696. "required": ["message"]
  11697. }
  11698. },
  11699. "required": ["name", "data"]
  11700. },
  11701. "Model": {
  11702. "type": "object",
  11703. "properties": {
  11704. "id": {
  11705. "type": "string"
  11706. },
  11707. "providerID": {
  11708. "type": "string"
  11709. },
  11710. "api": {
  11711. "type": "object",
  11712. "properties": {
  11713. "id": {
  11714. "type": "string"
  11715. },
  11716. "url": {
  11717. "type": "string"
  11718. },
  11719. "npm": {
  11720. "type": "string"
  11721. }
  11722. },
  11723. "required": ["id", "url", "npm"]
  11724. },
  11725. "name": {
  11726. "type": "string"
  11727. },
  11728. "family": {
  11729. "type": "string"
  11730. },
  11731. "capabilities": {
  11732. "type": "object",
  11733. "properties": {
  11734. "temperature": {
  11735. "type": "boolean"
  11736. },
  11737. "reasoning": {
  11738. "type": "boolean"
  11739. },
  11740. "attachment": {
  11741. "type": "boolean"
  11742. },
  11743. "toolcall": {
  11744. "type": "boolean"
  11745. },
  11746. "input": {
  11747. "type": "object",
  11748. "properties": {
  11749. "text": {
  11750. "type": "boolean"
  11751. },
  11752. "audio": {
  11753. "type": "boolean"
  11754. },
  11755. "image": {
  11756. "type": "boolean"
  11757. },
  11758. "video": {
  11759. "type": "boolean"
  11760. },
  11761. "pdf": {
  11762. "type": "boolean"
  11763. }
  11764. },
  11765. "required": ["text", "audio", "image", "video", "pdf"]
  11766. },
  11767. "output": {
  11768. "type": "object",
  11769. "properties": {
  11770. "text": {
  11771. "type": "boolean"
  11772. },
  11773. "audio": {
  11774. "type": "boolean"
  11775. },
  11776. "image": {
  11777. "type": "boolean"
  11778. },
  11779. "video": {
  11780. "type": "boolean"
  11781. },
  11782. "pdf": {
  11783. "type": "boolean"
  11784. }
  11785. },
  11786. "required": ["text", "audio", "image", "video", "pdf"]
  11787. },
  11788. "interleaved": {
  11789. "anyOf": [
  11790. {
  11791. "type": "boolean"
  11792. },
  11793. {
  11794. "type": "object",
  11795. "properties": {
  11796. "field": {
  11797. "type": "string",
  11798. "enum": ["reasoning_content", "reasoning_details"]
  11799. }
  11800. },
  11801. "required": ["field"]
  11802. }
  11803. ]
  11804. }
  11805. },
  11806. "required": ["temperature", "reasoning", "attachment", "toolcall", "input", "output", "interleaved"]
  11807. },
  11808. "cost": {
  11809. "type": "object",
  11810. "properties": {
  11811. "input": {
  11812. "type": "number"
  11813. },
  11814. "output": {
  11815. "type": "number"
  11816. },
  11817. "cache": {
  11818. "type": "object",
  11819. "properties": {
  11820. "read": {
  11821. "type": "number"
  11822. },
  11823. "write": {
  11824. "type": "number"
  11825. }
  11826. },
  11827. "required": ["read", "write"]
  11828. },
  11829. "experimentalOver200K": {
  11830. "type": "object",
  11831. "properties": {
  11832. "input": {
  11833. "type": "number"
  11834. },
  11835. "output": {
  11836. "type": "number"
  11837. },
  11838. "cache": {
  11839. "type": "object",
  11840. "properties": {
  11841. "read": {
  11842. "type": "number"
  11843. },
  11844. "write": {
  11845. "type": "number"
  11846. }
  11847. },
  11848. "required": ["read", "write"]
  11849. }
  11850. },
  11851. "required": ["input", "output", "cache"]
  11852. }
  11853. },
  11854. "required": ["input", "output", "cache"]
  11855. },
  11856. "limit": {
  11857. "type": "object",
  11858. "properties": {
  11859. "context": {
  11860. "type": "number"
  11861. },
  11862. "input": {
  11863. "type": "number"
  11864. },
  11865. "output": {
  11866. "type": "number"
  11867. }
  11868. },
  11869. "required": ["context", "output"]
  11870. },
  11871. "status": {
  11872. "type": "string",
  11873. "enum": ["alpha", "beta", "deprecated", "active"]
  11874. },
  11875. "options": {
  11876. "type": "object",
  11877. "propertyNames": {
  11878. "type": "string"
  11879. },
  11880. "additionalProperties": {}
  11881. },
  11882. "headers": {
  11883. "type": "object",
  11884. "propertyNames": {
  11885. "type": "string"
  11886. },
  11887. "additionalProperties": {
  11888. "type": "string"
  11889. }
  11890. },
  11891. "release_date": {
  11892. "type": "string"
  11893. },
  11894. "variants": {
  11895. "type": "object",
  11896. "propertyNames": {
  11897. "type": "string"
  11898. },
  11899. "additionalProperties": {
  11900. "type": "object",
  11901. "propertyNames": {
  11902. "type": "string"
  11903. },
  11904. "additionalProperties": {}
  11905. }
  11906. }
  11907. },
  11908. "required": [
  11909. "id",
  11910. "providerID",
  11911. "api",
  11912. "name",
  11913. "capabilities",
  11914. "cost",
  11915. "limit",
  11916. "status",
  11917. "options",
  11918. "headers",
  11919. "release_date"
  11920. ]
  11921. },
  11922. "Provider": {
  11923. "type": "object",
  11924. "properties": {
  11925. "id": {
  11926. "type": "string"
  11927. },
  11928. "name": {
  11929. "type": "string"
  11930. },
  11931. "source": {
  11932. "type": "string",
  11933. "enum": ["env", "config", "custom", "api"]
  11934. },
  11935. "env": {
  11936. "type": "array",
  11937. "items": {
  11938. "type": "string"
  11939. }
  11940. },
  11941. "key": {
  11942. "type": "string"
  11943. },
  11944. "options": {
  11945. "type": "object",
  11946. "propertyNames": {
  11947. "type": "string"
  11948. },
  11949. "additionalProperties": {}
  11950. },
  11951. "models": {
  11952. "type": "object",
  11953. "propertyNames": {
  11954. "type": "string"
  11955. },
  11956. "additionalProperties": {
  11957. "$ref": "#/components/schemas/Model"
  11958. }
  11959. }
  11960. },
  11961. "required": ["id", "name", "source", "env", "options", "models"]
  11962. },
  11963. "ToolIDs": {
  11964. "type": "array",
  11965. "items": {
  11966. "type": "string"
  11967. }
  11968. },
  11969. "ToolListItem": {
  11970. "type": "object",
  11971. "properties": {
  11972. "id": {
  11973. "type": "string"
  11974. },
  11975. "description": {
  11976. "type": "string"
  11977. },
  11978. "parameters": {}
  11979. },
  11980. "required": ["id", "description", "parameters"]
  11981. },
  11982. "ToolList": {
  11983. "type": "array",
  11984. "items": {
  11985. "$ref": "#/components/schemas/ToolListItem"
  11986. }
  11987. },
  11988. "Workspace": {
  11989. "type": "object",
  11990. "properties": {
  11991. "id": {
  11992. "type": "string",
  11993. "pattern": "^wrk.*"
  11994. },
  11995. "type": {
  11996. "type": "string"
  11997. },
  11998. "name": {
  11999. "type": "string"
  12000. },
  12001. "branch": {
  12002. "anyOf": [
  12003. {
  12004. "type": "string"
  12005. },
  12006. {
  12007. "type": "null"
  12008. }
  12009. ]
  12010. },
  12011. "directory": {
  12012. "anyOf": [
  12013. {
  12014. "type": "string"
  12015. },
  12016. {
  12017. "type": "null"
  12018. }
  12019. ]
  12020. },
  12021. "extra": {
  12022. "anyOf": [
  12023. {},
  12024. {
  12025. "type": "null"
  12026. }
  12027. ]
  12028. },
  12029. "projectID": {
  12030. "type": "string"
  12031. }
  12032. },
  12033. "required": ["id", "type", "name", "branch", "directory", "extra", "projectID"]
  12034. },
  12035. "Worktree": {
  12036. "type": "object",
  12037. "properties": {
  12038. "name": {
  12039. "type": "string"
  12040. },
  12041. "branch": {
  12042. "type": "string"
  12043. },
  12044. "directory": {
  12045. "type": "string"
  12046. }
  12047. },
  12048. "required": ["name", "branch", "directory"]
  12049. },
  12050. "WorktreeCreateInput": {
  12051. "type": "object",
  12052. "properties": {
  12053. "name": {
  12054. "type": "string"
  12055. },
  12056. "startCommand": {
  12057. "description": "Additional startup script to run after the project's start command",
  12058. "type": "string"
  12059. }
  12060. }
  12061. },
  12062. "WorktreeRemoveInput": {
  12063. "type": "object",
  12064. "properties": {
  12065. "directory": {
  12066. "type": "string"
  12067. }
  12068. },
  12069. "required": ["directory"]
  12070. },
  12071. "WorktreeResetInput": {
  12072. "type": "object",
  12073. "properties": {
  12074. "directory": {
  12075. "type": "string"
  12076. }
  12077. },
  12078. "required": ["directory"]
  12079. },
  12080. "ProjectSummary": {
  12081. "type": "object",
  12082. "properties": {
  12083. "id": {
  12084. "type": "string"
  12085. },
  12086. "name": {
  12087. "type": "string"
  12088. },
  12089. "worktree": {
  12090. "type": "string"
  12091. }
  12092. },
  12093. "required": ["id", "worktree"]
  12094. },
  12095. "GlobalSession": {
  12096. "type": "object",
  12097. "properties": {
  12098. "id": {
  12099. "type": "string",
  12100. "pattern": "^ses.*"
  12101. },
  12102. "slug": {
  12103. "type": "string"
  12104. },
  12105. "projectID": {
  12106. "type": "string"
  12107. },
  12108. "workspaceID": {
  12109. "type": "string",
  12110. "pattern": "^wrk.*"
  12111. },
  12112. "directory": {
  12113. "type": "string"
  12114. },
  12115. "parentID": {
  12116. "type": "string",
  12117. "pattern": "^ses.*"
  12118. },
  12119. "summary": {
  12120. "type": "object",
  12121. "properties": {
  12122. "additions": {
  12123. "type": "number"
  12124. },
  12125. "deletions": {
  12126. "type": "number"
  12127. },
  12128. "files": {
  12129. "type": "number"
  12130. },
  12131. "diffs": {
  12132. "type": "array",
  12133. "items": {
  12134. "$ref": "#/components/schemas/SnapshotFileDiff"
  12135. }
  12136. }
  12137. },
  12138. "required": ["additions", "deletions", "files"]
  12139. },
  12140. "share": {
  12141. "type": "object",
  12142. "properties": {
  12143. "url": {
  12144. "type": "string"
  12145. }
  12146. },
  12147. "required": ["url"]
  12148. },
  12149. "title": {
  12150. "type": "string"
  12151. },
  12152. "version": {
  12153. "type": "string"
  12154. },
  12155. "time": {
  12156. "type": "object",
  12157. "properties": {
  12158. "created": {
  12159. "type": "number"
  12160. },
  12161. "updated": {
  12162. "type": "number"
  12163. },
  12164. "compacting": {
  12165. "type": "number"
  12166. },
  12167. "archived": {
  12168. "type": "number"
  12169. }
  12170. },
  12171. "required": ["created", "updated"]
  12172. },
  12173. "permission": {
  12174. "$ref": "#/components/schemas/PermissionRuleset"
  12175. },
  12176. "revert": {
  12177. "type": "object",
  12178. "properties": {
  12179. "messageID": {
  12180. "type": "string",
  12181. "pattern": "^msg.*"
  12182. },
  12183. "partID": {
  12184. "type": "string",
  12185. "pattern": "^prt.*"
  12186. },
  12187. "snapshot": {
  12188. "type": "string"
  12189. },
  12190. "diff": {
  12191. "type": "string"
  12192. }
  12193. },
  12194. "required": ["messageID"]
  12195. },
  12196. "project": {
  12197. "anyOf": [
  12198. {
  12199. "$ref": "#/components/schemas/ProjectSummary"
  12200. },
  12201. {
  12202. "type": "null"
  12203. }
  12204. ]
  12205. }
  12206. },
  12207. "required": ["id", "slug", "projectID", "directory", "title", "version", "time", "project"]
  12208. },
  12209. "McpResource": {
  12210. "type": "object",
  12211. "properties": {
  12212. "name": {
  12213. "type": "string"
  12214. },
  12215. "uri": {
  12216. "type": "string"
  12217. },
  12218. "description": {
  12219. "type": "string"
  12220. },
  12221. "mimeType": {
  12222. "type": "string"
  12223. },
  12224. "client": {
  12225. "type": "string"
  12226. }
  12227. },
  12228. "required": ["name", "uri", "client"]
  12229. },
  12230. "TextPartInput": {
  12231. "type": "object",
  12232. "properties": {
  12233. "id": {
  12234. "type": "string",
  12235. "pattern": "^prt.*"
  12236. },
  12237. "type": {
  12238. "type": "string",
  12239. "const": "text"
  12240. },
  12241. "text": {
  12242. "type": "string"
  12243. },
  12244. "synthetic": {
  12245. "type": "boolean"
  12246. },
  12247. "ignored": {
  12248. "type": "boolean"
  12249. },
  12250. "time": {
  12251. "type": "object",
  12252. "properties": {
  12253. "start": {
  12254. "type": "number"
  12255. },
  12256. "end": {
  12257. "type": "number"
  12258. }
  12259. },
  12260. "required": ["start"]
  12261. },
  12262. "metadata": {
  12263. "type": "object",
  12264. "propertyNames": {
  12265. "type": "string"
  12266. },
  12267. "additionalProperties": {}
  12268. }
  12269. },
  12270. "required": ["type", "text"]
  12271. },
  12272. "FilePartInput": {
  12273. "type": "object",
  12274. "properties": {
  12275. "id": {
  12276. "type": "string",
  12277. "pattern": "^prt.*"
  12278. },
  12279. "type": {
  12280. "type": "string",
  12281. "const": "file"
  12282. },
  12283. "mime": {
  12284. "type": "string"
  12285. },
  12286. "filename": {
  12287. "type": "string"
  12288. },
  12289. "url": {
  12290. "type": "string"
  12291. },
  12292. "source": {
  12293. "$ref": "#/components/schemas/FilePartSource"
  12294. }
  12295. },
  12296. "required": ["type", "mime", "url"]
  12297. },
  12298. "AgentPartInput": {
  12299. "type": "object",
  12300. "properties": {
  12301. "id": {
  12302. "type": "string",
  12303. "pattern": "^prt.*"
  12304. },
  12305. "type": {
  12306. "type": "string",
  12307. "const": "agent"
  12308. },
  12309. "name": {
  12310. "type": "string"
  12311. },
  12312. "source": {
  12313. "type": "object",
  12314. "properties": {
  12315. "value": {
  12316. "type": "string"
  12317. },
  12318. "start": {
  12319. "type": "integer",
  12320. "minimum": -9007199254740991,
  12321. "maximum": 9007199254740991
  12322. },
  12323. "end": {
  12324. "type": "integer",
  12325. "minimum": -9007199254740991,
  12326. "maximum": 9007199254740991
  12327. }
  12328. },
  12329. "required": ["value", "start", "end"]
  12330. }
  12331. },
  12332. "required": ["type", "name"]
  12333. },
  12334. "SubtaskPartInput": {
  12335. "type": "object",
  12336. "properties": {
  12337. "id": {
  12338. "type": "string",
  12339. "pattern": "^prt.*"
  12340. },
  12341. "type": {
  12342. "type": "string",
  12343. "const": "subtask"
  12344. },
  12345. "prompt": {
  12346. "type": "string"
  12347. },
  12348. "description": {
  12349. "type": "string"
  12350. },
  12351. "agent": {
  12352. "type": "string"
  12353. },
  12354. "model": {
  12355. "type": "object",
  12356. "properties": {
  12357. "providerID": {
  12358. "type": "string"
  12359. },
  12360. "modelID": {
  12361. "type": "string"
  12362. }
  12363. },
  12364. "required": ["providerID", "modelID"]
  12365. },
  12366. "command": {
  12367. "type": "string"
  12368. }
  12369. },
  12370. "required": ["type", "prompt", "description", "agent"]
  12371. },
  12372. "ProviderAuthMethod": {
  12373. "type": "object",
  12374. "properties": {
  12375. "type": {
  12376. "anyOf": [
  12377. {
  12378. "type": "string",
  12379. "const": "oauth"
  12380. },
  12381. {
  12382. "type": "string",
  12383. "const": "api"
  12384. }
  12385. ]
  12386. },
  12387. "label": {
  12388. "type": "string"
  12389. },
  12390. "prompts": {
  12391. "type": "array",
  12392. "items": {
  12393. "anyOf": [
  12394. {
  12395. "type": "object",
  12396. "properties": {
  12397. "type": {
  12398. "type": "string",
  12399. "const": "text"
  12400. },
  12401. "key": {
  12402. "type": "string"
  12403. },
  12404. "message": {
  12405. "type": "string"
  12406. },
  12407. "placeholder": {
  12408. "type": "string"
  12409. },
  12410. "when": {
  12411. "type": "object",
  12412. "properties": {
  12413. "key": {
  12414. "type": "string"
  12415. },
  12416. "op": {
  12417. "anyOf": [
  12418. {
  12419. "type": "string",
  12420. "const": "eq"
  12421. },
  12422. {
  12423. "type": "string",
  12424. "const": "neq"
  12425. }
  12426. ]
  12427. },
  12428. "value": {
  12429. "type": "string"
  12430. }
  12431. },
  12432. "required": ["key", "op", "value"]
  12433. }
  12434. },
  12435. "required": ["type", "key", "message"]
  12436. },
  12437. {
  12438. "type": "object",
  12439. "properties": {
  12440. "type": {
  12441. "type": "string",
  12442. "const": "select"
  12443. },
  12444. "key": {
  12445. "type": "string"
  12446. },
  12447. "message": {
  12448. "type": "string"
  12449. },
  12450. "options": {
  12451. "type": "array",
  12452. "items": {
  12453. "type": "object",
  12454. "properties": {
  12455. "label": {
  12456. "type": "string"
  12457. },
  12458. "value": {
  12459. "type": "string"
  12460. },
  12461. "hint": {
  12462. "type": "string"
  12463. }
  12464. },
  12465. "required": ["label", "value"]
  12466. }
  12467. },
  12468. "when": {
  12469. "type": "object",
  12470. "properties": {
  12471. "key": {
  12472. "type": "string"
  12473. },
  12474. "op": {
  12475. "anyOf": [
  12476. {
  12477. "type": "string",
  12478. "const": "eq"
  12479. },
  12480. {
  12481. "type": "string",
  12482. "const": "neq"
  12483. }
  12484. ]
  12485. },
  12486. "value": {
  12487. "type": "string"
  12488. }
  12489. },
  12490. "required": ["key", "op", "value"]
  12491. }
  12492. },
  12493. "required": ["type", "key", "message", "options"]
  12494. }
  12495. ]
  12496. }
  12497. }
  12498. },
  12499. "required": ["type", "label"]
  12500. },
  12501. "ProviderAuthAuthorization": {
  12502. "type": "object",
  12503. "properties": {
  12504. "url": {
  12505. "type": "string"
  12506. },
  12507. "method": {
  12508. "anyOf": [
  12509. {
  12510. "type": "string",
  12511. "const": "auto"
  12512. },
  12513. {
  12514. "type": "string",
  12515. "const": "code"
  12516. }
  12517. ]
  12518. },
  12519. "instructions": {
  12520. "type": "string"
  12521. }
  12522. },
  12523. "required": ["url", "method", "instructions"]
  12524. },
  12525. "Symbol": {
  12526. "type": "object",
  12527. "properties": {
  12528. "name": {
  12529. "type": "string"
  12530. },
  12531. "kind": {
  12532. "type": "number"
  12533. },
  12534. "location": {
  12535. "type": "object",
  12536. "properties": {
  12537. "uri": {
  12538. "type": "string"
  12539. },
  12540. "range": {
  12541. "$ref": "#/components/schemas/Range"
  12542. }
  12543. },
  12544. "required": ["uri", "range"]
  12545. }
  12546. },
  12547. "required": ["name", "kind", "location"]
  12548. },
  12549. "FileNode": {
  12550. "type": "object",
  12551. "properties": {
  12552. "name": {
  12553. "type": "string"
  12554. },
  12555. "path": {
  12556. "type": "string"
  12557. },
  12558. "absolute": {
  12559. "type": "string"
  12560. },
  12561. "type": {
  12562. "type": "string",
  12563. "enum": ["file", "directory"]
  12564. },
  12565. "ignored": {
  12566. "type": "boolean"
  12567. }
  12568. },
  12569. "required": ["name", "path", "absolute", "type", "ignored"]
  12570. },
  12571. "FileContent": {
  12572. "type": "object",
  12573. "properties": {
  12574. "type": {
  12575. "type": "string",
  12576. "enum": ["text", "binary"]
  12577. },
  12578. "content": {
  12579. "type": "string"
  12580. },
  12581. "diff": {
  12582. "type": "string"
  12583. },
  12584. "patch": {
  12585. "type": "object",
  12586. "properties": {
  12587. "oldFileName": {
  12588. "type": "string"
  12589. },
  12590. "newFileName": {
  12591. "type": "string"
  12592. },
  12593. "oldHeader": {
  12594. "type": "string"
  12595. },
  12596. "newHeader": {
  12597. "type": "string"
  12598. },
  12599. "hunks": {
  12600. "type": "array",
  12601. "items": {
  12602. "type": "object",
  12603. "properties": {
  12604. "oldStart": {
  12605. "type": "number"
  12606. },
  12607. "oldLines": {
  12608. "type": "number"
  12609. },
  12610. "newStart": {
  12611. "type": "number"
  12612. },
  12613. "newLines": {
  12614. "type": "number"
  12615. },
  12616. "lines": {
  12617. "type": "array",
  12618. "items": {
  12619. "type": "string"
  12620. }
  12621. }
  12622. },
  12623. "required": ["oldStart", "oldLines", "newStart", "newLines", "lines"]
  12624. }
  12625. },
  12626. "index": {
  12627. "type": "string"
  12628. }
  12629. },
  12630. "required": ["oldFileName", "newFileName", "hunks"]
  12631. },
  12632. "encoding": {
  12633. "type": "string",
  12634. "const": "base64"
  12635. },
  12636. "mimeType": {
  12637. "type": "string"
  12638. }
  12639. },
  12640. "required": ["type", "content"]
  12641. },
  12642. "File": {
  12643. "type": "object",
  12644. "properties": {
  12645. "path": {
  12646. "type": "string"
  12647. },
  12648. "added": {
  12649. "type": "integer",
  12650. "minimum": -9007199254740991,
  12651. "maximum": 9007199254740991
  12652. },
  12653. "removed": {
  12654. "type": "integer",
  12655. "minimum": -9007199254740991,
  12656. "maximum": 9007199254740991
  12657. },
  12658. "status": {
  12659. "type": "string",
  12660. "enum": ["added", "deleted", "modified"]
  12661. }
  12662. },
  12663. "required": ["path", "added", "removed", "status"]
  12664. },
  12665. "Event": {
  12666. "anyOf": [
  12667. {
  12668. "$ref": "#/components/schemas/Event.project.updated"
  12669. },
  12670. {
  12671. "$ref": "#/components/schemas/Event.server.instance.disposed"
  12672. },
  12673. {
  12674. "$ref": "#/components/schemas/Event.installation.updated"
  12675. },
  12676. {
  12677. "$ref": "#/components/schemas/Event.installation.update-available"
  12678. },
  12679. {
  12680. "$ref": "#/components/schemas/Event.server.connected"
  12681. },
  12682. {
  12683. "$ref": "#/components/schemas/Event.global.disposed"
  12684. },
  12685. {
  12686. "$ref": "#/components/schemas/Event.file.edited"
  12687. },
  12688. {
  12689. "$ref": "#/components/schemas/Event.file.watcher.updated"
  12690. },
  12691. {
  12692. "$ref": "#/components/schemas/Event.lsp.client.diagnostics"
  12693. },
  12694. {
  12695. "$ref": "#/components/schemas/Event.lsp.updated"
  12696. },
  12697. {
  12698. "$ref": "#/components/schemas/Event.message.part.delta"
  12699. },
  12700. {
  12701. "$ref": "#/components/schemas/Event.permission.asked"
  12702. },
  12703. {
  12704. "$ref": "#/components/schemas/Event.permission.replied"
  12705. },
  12706. {
  12707. "$ref": "#/components/schemas/Event.session.diff"
  12708. },
  12709. {
  12710. "$ref": "#/components/schemas/Event.session.error"
  12711. },
  12712. {
  12713. "$ref": "#/components/schemas/Event.question.asked"
  12714. },
  12715. {
  12716. "$ref": "#/components/schemas/Event.question.replied"
  12717. },
  12718. {
  12719. "$ref": "#/components/schemas/Event.question.rejected"
  12720. },
  12721. {
  12722. "$ref": "#/components/schemas/Event.todo.updated"
  12723. },
  12724. {
  12725. "$ref": "#/components/schemas/Event.session.status"
  12726. },
  12727. {
  12728. "$ref": "#/components/schemas/Event.session.idle"
  12729. },
  12730. {
  12731. "$ref": "#/components/schemas/Event.session.compacted"
  12732. },
  12733. {
  12734. "$ref": "#/components/schemas/Event.tui.prompt.append"
  12735. },
  12736. {
  12737. "$ref": "#/components/schemas/Event.tui.command.execute"
  12738. },
  12739. {
  12740. "$ref": "#/components/schemas/Event.tui.toast.show"
  12741. },
  12742. {
  12743. "$ref": "#/components/schemas/Event.tui.session.select"
  12744. },
  12745. {
  12746. "$ref": "#/components/schemas/Event.mcp.tools.changed"
  12747. },
  12748. {
  12749. "$ref": "#/components/schemas/Event.mcp.browser.open.failed"
  12750. },
  12751. {
  12752. "$ref": "#/components/schemas/Event.command.executed"
  12753. },
  12754. {
  12755. "$ref": "#/components/schemas/Event.vcs.branch.updated"
  12756. },
  12757. {
  12758. "$ref": "#/components/schemas/Event.worktree.ready"
  12759. },
  12760. {
  12761. "$ref": "#/components/schemas/Event.worktree.failed"
  12762. },
  12763. {
  12764. "$ref": "#/components/schemas/Event.pty.created"
  12765. },
  12766. {
  12767. "$ref": "#/components/schemas/Event.pty.updated"
  12768. },
  12769. {
  12770. "$ref": "#/components/schemas/Event.pty.exited"
  12771. },
  12772. {
  12773. "$ref": "#/components/schemas/Event.pty.deleted"
  12774. },
  12775. {
  12776. "$ref": "#/components/schemas/Event.workspace.ready"
  12777. },
  12778. {
  12779. "$ref": "#/components/schemas/Event.workspace.failed"
  12780. },
  12781. {
  12782. "$ref": "#/components/schemas/Event.workspace.status"
  12783. },
  12784. {
  12785. "$ref": "#/components/schemas/Event.message.updated"
  12786. },
  12787. {
  12788. "$ref": "#/components/schemas/Event.message.removed"
  12789. },
  12790. {
  12791. "$ref": "#/components/schemas/Event.message.part.updated"
  12792. },
  12793. {
  12794. "$ref": "#/components/schemas/Event.message.part.removed"
  12795. },
  12796. {
  12797. "$ref": "#/components/schemas/Event.session.created"
  12798. },
  12799. {
  12800. "$ref": "#/components/schemas/Event.session.updated"
  12801. },
  12802. {
  12803. "$ref": "#/components/schemas/Event.session.deleted"
  12804. }
  12805. ]
  12806. },
  12807. "MCPStatusConnected": {
  12808. "type": "object",
  12809. "properties": {
  12810. "status": {
  12811. "type": "string",
  12812. "const": "connected"
  12813. }
  12814. },
  12815. "required": ["status"]
  12816. },
  12817. "MCPStatusDisabled": {
  12818. "type": "object",
  12819. "properties": {
  12820. "status": {
  12821. "type": "string",
  12822. "const": "disabled"
  12823. }
  12824. },
  12825. "required": ["status"]
  12826. },
  12827. "MCPStatusFailed": {
  12828. "type": "object",
  12829. "properties": {
  12830. "status": {
  12831. "type": "string",
  12832. "const": "failed"
  12833. },
  12834. "error": {
  12835. "type": "string"
  12836. }
  12837. },
  12838. "required": ["status", "error"]
  12839. },
  12840. "MCPStatusNeedsAuth": {
  12841. "type": "object",
  12842. "properties": {
  12843. "status": {
  12844. "type": "string",
  12845. "const": "needs_auth"
  12846. }
  12847. },
  12848. "required": ["status"]
  12849. },
  12850. "MCPStatusNeedsClientRegistration": {
  12851. "type": "object",
  12852. "properties": {
  12853. "status": {
  12854. "type": "string",
  12855. "const": "needs_client_registration"
  12856. },
  12857. "error": {
  12858. "type": "string"
  12859. }
  12860. },
  12861. "required": ["status", "error"]
  12862. },
  12863. "MCPStatus": {
  12864. "anyOf": [
  12865. {
  12866. "$ref": "#/components/schemas/MCPStatusConnected"
  12867. },
  12868. {
  12869. "$ref": "#/components/schemas/MCPStatusDisabled"
  12870. },
  12871. {
  12872. "$ref": "#/components/schemas/MCPStatusFailed"
  12873. },
  12874. {
  12875. "$ref": "#/components/schemas/MCPStatusNeedsAuth"
  12876. },
  12877. {
  12878. "$ref": "#/components/schemas/MCPStatusNeedsClientRegistration"
  12879. }
  12880. ]
  12881. },
  12882. "Path": {
  12883. "type": "object",
  12884. "properties": {
  12885. "home": {
  12886. "type": "string"
  12887. },
  12888. "state": {
  12889. "type": "string"
  12890. },
  12891. "config": {
  12892. "type": "string"
  12893. },
  12894. "worktree": {
  12895. "type": "string"
  12896. },
  12897. "directory": {
  12898. "type": "string"
  12899. }
  12900. },
  12901. "required": ["home", "state", "config", "worktree", "directory"]
  12902. },
  12903. "VcsInfo": {
  12904. "type": "object",
  12905. "properties": {
  12906. "branch": {
  12907. "type": "string"
  12908. },
  12909. "default_branch": {
  12910. "type": "string"
  12911. }
  12912. }
  12913. },
  12914. "VcsFileDiff": {
  12915. "type": "object",
  12916. "properties": {
  12917. "file": {
  12918. "type": "string"
  12919. },
  12920. "patch": {
  12921. "type": "string"
  12922. },
  12923. "additions": {
  12924. "type": "number"
  12925. },
  12926. "deletions": {
  12927. "type": "number"
  12928. },
  12929. "status": {
  12930. "type": "string",
  12931. "enum": ["added", "deleted", "modified"]
  12932. }
  12933. },
  12934. "required": ["file", "patch", "additions", "deletions"]
  12935. },
  12936. "Command": {
  12937. "type": "object",
  12938. "properties": {
  12939. "name": {
  12940. "type": "string"
  12941. },
  12942. "description": {
  12943. "type": "string"
  12944. },
  12945. "agent": {
  12946. "type": "string"
  12947. },
  12948. "model": {
  12949. "type": "string"
  12950. },
  12951. "source": {
  12952. "type": "string",
  12953. "enum": ["command", "mcp", "skill"]
  12954. },
  12955. "template": {
  12956. "anyOf": [
  12957. {
  12958. "type": "string"
  12959. },
  12960. {
  12961. "type": "string"
  12962. }
  12963. ]
  12964. },
  12965. "subtask": {
  12966. "type": "boolean"
  12967. },
  12968. "hints": {
  12969. "type": "array",
  12970. "items": {
  12971. "type": "string"
  12972. }
  12973. }
  12974. },
  12975. "required": ["name", "template", "hints"]
  12976. },
  12977. "Agent": {
  12978. "type": "object",
  12979. "properties": {
  12980. "name": {
  12981. "type": "string"
  12982. },
  12983. "description": {
  12984. "type": "string"
  12985. },
  12986. "mode": {
  12987. "type": "string",
  12988. "enum": ["subagent", "primary", "all"]
  12989. },
  12990. "native": {
  12991. "type": "boolean"
  12992. },
  12993. "hidden": {
  12994. "type": "boolean"
  12995. },
  12996. "topP": {
  12997. "type": "number"
  12998. },
  12999. "temperature": {
  13000. "type": "number"
  13001. },
  13002. "color": {
  13003. "type": "string"
  13004. },
  13005. "permission": {
  13006. "$ref": "#/components/schemas/PermissionRuleset"
  13007. },
  13008. "model": {
  13009. "type": "object",
  13010. "properties": {
  13011. "modelID": {
  13012. "type": "string"
  13013. },
  13014. "providerID": {
  13015. "type": "string"
  13016. }
  13017. },
  13018. "required": ["modelID", "providerID"]
  13019. },
  13020. "variant": {
  13021. "type": "string"
  13022. },
  13023. "prompt": {
  13024. "type": "string"
  13025. },
  13026. "options": {
  13027. "type": "object",
  13028. "propertyNames": {
  13029. "type": "string"
  13030. },
  13031. "additionalProperties": {}
  13032. },
  13033. "steps": {
  13034. "type": "integer",
  13035. "exclusiveMinimum": 0,
  13036. "maximum": 9007199254740991
  13037. }
  13038. },
  13039. "required": ["name", "mode", "permission", "options"]
  13040. },
  13041. "LSPStatus": {
  13042. "type": "object",
  13043. "properties": {
  13044. "id": {
  13045. "type": "string"
  13046. },
  13047. "name": {
  13048. "type": "string"
  13049. },
  13050. "root": {
  13051. "type": "string"
  13052. },
  13053. "status": {
  13054. "anyOf": [
  13055. {
  13056. "type": "string",
  13057. "const": "connected"
  13058. },
  13059. {
  13060. "type": "string",
  13061. "const": "error"
  13062. }
  13063. ]
  13064. }
  13065. },
  13066. "required": ["id", "name", "root", "status"]
  13067. },
  13068. "FormatterStatus": {
  13069. "type": "object",
  13070. "properties": {
  13071. "name": {
  13072. "type": "string"
  13073. },
  13074. "extensions": {
  13075. "type": "array",
  13076. "items": {
  13077. "type": "string"
  13078. }
  13079. },
  13080. "enabled": {
  13081. "type": "boolean"
  13082. }
  13083. },
  13084. "required": ["name", "extensions", "enabled"]
  13085. }
  13086. }
  13087. }
  13088. }