openapi.json 295 KB

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