openapi.json 291 KB

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