openapi.json 290 KB

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