openapi.json 305 KB

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