openapi.json 244 KB

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