openapi.json 309 KB

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