openapi.json 345 KB

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