openapi.json 291 KB

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