openapi.json 319 KB

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