openapi.json 306 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078
  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. "/permission/{requestID}/reply": {
  3307. "post": {
  3308. "operationId": "permission.reply",
  3309. "parameters": [
  3310. {
  3311. "in": "query",
  3312. "name": "directory",
  3313. "schema": {
  3314. "type": "string"
  3315. }
  3316. },
  3317. {
  3318. "in": "path",
  3319. "name": "requestID",
  3320. "schema": {
  3321. "type": "string"
  3322. },
  3323. "required": true
  3324. }
  3325. ],
  3326. "summary": "Respond to permission request",
  3327. "description": "Approve or deny a permission request from the AI assistant.",
  3328. "responses": {
  3329. "200": {
  3330. "description": "Permission processed successfully",
  3331. "content": {
  3332. "application/json": {
  3333. "schema": {
  3334. "type": "boolean"
  3335. }
  3336. }
  3337. }
  3338. },
  3339. "400": {
  3340. "description": "Bad request",
  3341. "content": {
  3342. "application/json": {
  3343. "schema": {
  3344. "$ref": "#/components/schemas/BadRequestError"
  3345. }
  3346. }
  3347. }
  3348. },
  3349. "404": {
  3350. "description": "Not found",
  3351. "content": {
  3352. "application/json": {
  3353. "schema": {
  3354. "$ref": "#/components/schemas/NotFoundError"
  3355. }
  3356. }
  3357. }
  3358. }
  3359. },
  3360. "requestBody": {
  3361. "content": {
  3362. "application/json": {
  3363. "schema": {
  3364. "type": "object",
  3365. "properties": {
  3366. "reply": {
  3367. "type": "string",
  3368. "enum": ["once", "always", "reject"]
  3369. },
  3370. "message": {
  3371. "type": "string"
  3372. }
  3373. },
  3374. "required": ["reply"]
  3375. }
  3376. }
  3377. }
  3378. },
  3379. "x-codeSamples": [
  3380. {
  3381. "lang": "js",
  3382. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.permission.reply({\n ...\n})"
  3383. }
  3384. ]
  3385. }
  3386. },
  3387. "/permission": {
  3388. "get": {
  3389. "operationId": "permission.list",
  3390. "parameters": [
  3391. {
  3392. "in": "query",
  3393. "name": "directory",
  3394. "schema": {
  3395. "type": "string"
  3396. }
  3397. }
  3398. ],
  3399. "summary": "List pending permissions",
  3400. "description": "Get all pending permission requests across all sessions.",
  3401. "responses": {
  3402. "200": {
  3403. "description": "List of pending permissions",
  3404. "content": {
  3405. "application/json": {
  3406. "schema": {
  3407. "type": "array",
  3408. "items": {
  3409. "$ref": "#/components/schemas/PermissionRequest"
  3410. }
  3411. }
  3412. }
  3413. }
  3414. }
  3415. },
  3416. "x-codeSamples": [
  3417. {
  3418. "lang": "js",
  3419. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.permission.list({\n ...\n})"
  3420. }
  3421. ]
  3422. }
  3423. },
  3424. "/question": {
  3425. "get": {
  3426. "operationId": "question.list",
  3427. "parameters": [
  3428. {
  3429. "in": "query",
  3430. "name": "directory",
  3431. "schema": {
  3432. "type": "string"
  3433. }
  3434. }
  3435. ],
  3436. "summary": "List pending questions",
  3437. "description": "Get all pending question requests across all sessions.",
  3438. "responses": {
  3439. "200": {
  3440. "description": "List of pending questions",
  3441. "content": {
  3442. "application/json": {
  3443. "schema": {
  3444. "type": "array",
  3445. "items": {
  3446. "$ref": "#/components/schemas/QuestionRequest"
  3447. }
  3448. }
  3449. }
  3450. }
  3451. }
  3452. },
  3453. "x-codeSamples": [
  3454. {
  3455. "lang": "js",
  3456. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.question.list({\n ...\n})"
  3457. }
  3458. ]
  3459. }
  3460. },
  3461. "/question/{requestID}/reply": {
  3462. "post": {
  3463. "operationId": "question.reply",
  3464. "parameters": [
  3465. {
  3466. "in": "query",
  3467. "name": "directory",
  3468. "schema": {
  3469. "type": "string"
  3470. }
  3471. },
  3472. {
  3473. "in": "path",
  3474. "name": "requestID",
  3475. "schema": {
  3476. "type": "string"
  3477. },
  3478. "required": true
  3479. }
  3480. ],
  3481. "summary": "Reply to question request",
  3482. "description": "Provide answers to a question request from the AI assistant.",
  3483. "responses": {
  3484. "200": {
  3485. "description": "Question answered successfully",
  3486. "content": {
  3487. "application/json": {
  3488. "schema": {
  3489. "type": "boolean"
  3490. }
  3491. }
  3492. }
  3493. },
  3494. "400": {
  3495. "description": "Bad request",
  3496. "content": {
  3497. "application/json": {
  3498. "schema": {
  3499. "$ref": "#/components/schemas/BadRequestError"
  3500. }
  3501. }
  3502. }
  3503. },
  3504. "404": {
  3505. "description": "Not found",
  3506. "content": {
  3507. "application/json": {
  3508. "schema": {
  3509. "$ref": "#/components/schemas/NotFoundError"
  3510. }
  3511. }
  3512. }
  3513. }
  3514. },
  3515. "requestBody": {
  3516. "content": {
  3517. "application/json": {
  3518. "schema": {
  3519. "type": "object",
  3520. "properties": {
  3521. "answers": {
  3522. "description": "User answers in order of questions (each answer is an array of selected labels)",
  3523. "type": "array",
  3524. "items": {
  3525. "$ref": "#/components/schemas/QuestionAnswer"
  3526. }
  3527. }
  3528. },
  3529. "required": ["answers"]
  3530. }
  3531. }
  3532. }
  3533. },
  3534. "x-codeSamples": [
  3535. {
  3536. "lang": "js",
  3537. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.question.reply({\n ...\n})"
  3538. }
  3539. ]
  3540. }
  3541. },
  3542. "/question/{requestID}/reject": {
  3543. "post": {
  3544. "operationId": "question.reject",
  3545. "parameters": [
  3546. {
  3547. "in": "query",
  3548. "name": "directory",
  3549. "schema": {
  3550. "type": "string"
  3551. }
  3552. },
  3553. {
  3554. "in": "path",
  3555. "name": "requestID",
  3556. "schema": {
  3557. "type": "string"
  3558. },
  3559. "required": true
  3560. }
  3561. ],
  3562. "summary": "Reject question request",
  3563. "description": "Reject a question request from the AI assistant.",
  3564. "responses": {
  3565. "200": {
  3566. "description": "Question rejected successfully",
  3567. "content": {
  3568. "application/json": {
  3569. "schema": {
  3570. "type": "boolean"
  3571. }
  3572. }
  3573. }
  3574. },
  3575. "400": {
  3576. "description": "Bad request",
  3577. "content": {
  3578. "application/json": {
  3579. "schema": {
  3580. "$ref": "#/components/schemas/BadRequestError"
  3581. }
  3582. }
  3583. }
  3584. },
  3585. "404": {
  3586. "description": "Not found",
  3587. "content": {
  3588. "application/json": {
  3589. "schema": {
  3590. "$ref": "#/components/schemas/NotFoundError"
  3591. }
  3592. }
  3593. }
  3594. }
  3595. },
  3596. "x-codeSamples": [
  3597. {
  3598. "lang": "js",
  3599. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.question.reject({\n ...\n})"
  3600. }
  3601. ]
  3602. }
  3603. },
  3604. "/provider": {
  3605. "get": {
  3606. "operationId": "provider.list",
  3607. "parameters": [
  3608. {
  3609. "in": "query",
  3610. "name": "directory",
  3611. "schema": {
  3612. "type": "string"
  3613. }
  3614. }
  3615. ],
  3616. "summary": "List providers",
  3617. "description": "Get a list of all available AI providers, including both available and connected ones.",
  3618. "responses": {
  3619. "200": {
  3620. "description": "List of providers",
  3621. "content": {
  3622. "application/json": {
  3623. "schema": {
  3624. "type": "object",
  3625. "properties": {
  3626. "all": {
  3627. "type": "array",
  3628. "items": {
  3629. "type": "object",
  3630. "properties": {
  3631. "api": {
  3632. "type": "string"
  3633. },
  3634. "name": {
  3635. "type": "string"
  3636. },
  3637. "env": {
  3638. "type": "array",
  3639. "items": {
  3640. "type": "string"
  3641. }
  3642. },
  3643. "id": {
  3644. "type": "string"
  3645. },
  3646. "npm": {
  3647. "type": "string"
  3648. },
  3649. "models": {
  3650. "type": "object",
  3651. "propertyNames": {
  3652. "type": "string"
  3653. },
  3654. "additionalProperties": {
  3655. "type": "object",
  3656. "properties": {
  3657. "id": {
  3658. "type": "string"
  3659. },
  3660. "name": {
  3661. "type": "string"
  3662. },
  3663. "family": {
  3664. "type": "string"
  3665. },
  3666. "release_date": {
  3667. "type": "string"
  3668. },
  3669. "attachment": {
  3670. "type": "boolean"
  3671. },
  3672. "reasoning": {
  3673. "type": "boolean"
  3674. },
  3675. "temperature": {
  3676. "type": "boolean"
  3677. },
  3678. "tool_call": {
  3679. "type": "boolean"
  3680. },
  3681. "interleaved": {
  3682. "anyOf": [
  3683. {
  3684. "type": "boolean",
  3685. "const": true
  3686. },
  3687. {
  3688. "type": "object",
  3689. "properties": {
  3690. "field": {
  3691. "type": "string",
  3692. "enum": ["reasoning_content", "reasoning_details"]
  3693. }
  3694. },
  3695. "required": ["field"],
  3696. "additionalProperties": false
  3697. }
  3698. ]
  3699. },
  3700. "cost": {
  3701. "type": "object",
  3702. "properties": {
  3703. "input": {
  3704. "type": "number"
  3705. },
  3706. "output": {
  3707. "type": "number"
  3708. },
  3709. "cache_read": {
  3710. "type": "number"
  3711. },
  3712. "cache_write": {
  3713. "type": "number"
  3714. },
  3715. "context_over_200k": {
  3716. "type": "object",
  3717. "properties": {
  3718. "input": {
  3719. "type": "number"
  3720. },
  3721. "output": {
  3722. "type": "number"
  3723. },
  3724. "cache_read": {
  3725. "type": "number"
  3726. },
  3727. "cache_write": {
  3728. "type": "number"
  3729. }
  3730. },
  3731. "required": ["input", "output"]
  3732. }
  3733. },
  3734. "required": ["input", "output"]
  3735. },
  3736. "limit": {
  3737. "type": "object",
  3738. "properties": {
  3739. "context": {
  3740. "type": "number"
  3741. },
  3742. "input": {
  3743. "type": "number"
  3744. },
  3745. "output": {
  3746. "type": "number"
  3747. }
  3748. },
  3749. "required": ["context", "output"]
  3750. },
  3751. "modalities": {
  3752. "type": "object",
  3753. "properties": {
  3754. "input": {
  3755. "type": "array",
  3756. "items": {
  3757. "type": "string",
  3758. "enum": ["text", "audio", "image", "video", "pdf"]
  3759. }
  3760. },
  3761. "output": {
  3762. "type": "array",
  3763. "items": {
  3764. "type": "string",
  3765. "enum": ["text", "audio", "image", "video", "pdf"]
  3766. }
  3767. }
  3768. },
  3769. "required": ["input", "output"]
  3770. },
  3771. "experimental": {
  3772. "type": "boolean"
  3773. },
  3774. "status": {
  3775. "type": "string",
  3776. "enum": ["alpha", "beta", "deprecated"]
  3777. },
  3778. "options": {
  3779. "type": "object",
  3780. "propertyNames": {
  3781. "type": "string"
  3782. },
  3783. "additionalProperties": {}
  3784. },
  3785. "headers": {
  3786. "type": "object",
  3787. "propertyNames": {
  3788. "type": "string"
  3789. },
  3790. "additionalProperties": {
  3791. "type": "string"
  3792. }
  3793. },
  3794. "provider": {
  3795. "type": "object",
  3796. "properties": {
  3797. "npm": {
  3798. "type": "string"
  3799. },
  3800. "api": {
  3801. "type": "string"
  3802. }
  3803. },
  3804. "required": ["npm", "api"]
  3805. },
  3806. "variants": {
  3807. "type": "object",
  3808. "propertyNames": {
  3809. "type": "string"
  3810. },
  3811. "additionalProperties": {
  3812. "type": "object",
  3813. "propertyNames": {
  3814. "type": "string"
  3815. },
  3816. "additionalProperties": {}
  3817. }
  3818. }
  3819. },
  3820. "required": [
  3821. "id",
  3822. "name",
  3823. "release_date",
  3824. "attachment",
  3825. "reasoning",
  3826. "temperature",
  3827. "tool_call",
  3828. "limit",
  3829. "options"
  3830. ]
  3831. }
  3832. }
  3833. },
  3834. "required": ["name", "env", "id", "models"]
  3835. }
  3836. },
  3837. "default": {
  3838. "type": "object",
  3839. "propertyNames": {
  3840. "type": "string"
  3841. },
  3842. "additionalProperties": {
  3843. "type": "string"
  3844. }
  3845. },
  3846. "connected": {
  3847. "type": "array",
  3848. "items": {
  3849. "type": "string"
  3850. }
  3851. }
  3852. },
  3853. "required": ["all", "default", "connected"]
  3854. }
  3855. }
  3856. }
  3857. }
  3858. },
  3859. "x-codeSamples": [
  3860. {
  3861. "lang": "js",
  3862. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.list({\n ...\n})"
  3863. }
  3864. ]
  3865. }
  3866. },
  3867. "/provider/auth": {
  3868. "get": {
  3869. "operationId": "provider.auth",
  3870. "parameters": [
  3871. {
  3872. "in": "query",
  3873. "name": "directory",
  3874. "schema": {
  3875. "type": "string"
  3876. }
  3877. }
  3878. ],
  3879. "summary": "Get provider auth methods",
  3880. "description": "Retrieve available authentication methods for all AI providers.",
  3881. "responses": {
  3882. "200": {
  3883. "description": "Provider auth methods",
  3884. "content": {
  3885. "application/json": {
  3886. "schema": {
  3887. "type": "object",
  3888. "propertyNames": {
  3889. "type": "string"
  3890. },
  3891. "additionalProperties": {
  3892. "type": "array",
  3893. "items": {
  3894. "$ref": "#/components/schemas/ProviderAuthMethod"
  3895. }
  3896. }
  3897. }
  3898. }
  3899. }
  3900. }
  3901. },
  3902. "x-codeSamples": [
  3903. {
  3904. "lang": "js",
  3905. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.auth({\n ...\n})"
  3906. }
  3907. ]
  3908. }
  3909. },
  3910. "/provider/{providerID}/oauth/authorize": {
  3911. "post": {
  3912. "operationId": "provider.oauth.authorize",
  3913. "parameters": [
  3914. {
  3915. "in": "query",
  3916. "name": "directory",
  3917. "schema": {
  3918. "type": "string"
  3919. }
  3920. },
  3921. {
  3922. "in": "path",
  3923. "name": "providerID",
  3924. "schema": {
  3925. "type": "string"
  3926. },
  3927. "required": true,
  3928. "description": "Provider ID"
  3929. }
  3930. ],
  3931. "summary": "OAuth authorize",
  3932. "description": "Initiate OAuth authorization for a specific AI provider to get an authorization URL.",
  3933. "responses": {
  3934. "200": {
  3935. "description": "Authorization URL and method",
  3936. "content": {
  3937. "application/json": {
  3938. "schema": {
  3939. "$ref": "#/components/schemas/ProviderAuthAuthorization"
  3940. }
  3941. }
  3942. }
  3943. },
  3944. "400": {
  3945. "description": "Bad request",
  3946. "content": {
  3947. "application/json": {
  3948. "schema": {
  3949. "$ref": "#/components/schemas/BadRequestError"
  3950. }
  3951. }
  3952. }
  3953. }
  3954. },
  3955. "requestBody": {
  3956. "content": {
  3957. "application/json": {
  3958. "schema": {
  3959. "type": "object",
  3960. "properties": {
  3961. "method": {
  3962. "description": "Auth method index",
  3963. "type": "number"
  3964. }
  3965. },
  3966. "required": ["method"]
  3967. }
  3968. }
  3969. }
  3970. },
  3971. "x-codeSamples": [
  3972. {
  3973. "lang": "js",
  3974. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.oauth.authorize({\n ...\n})"
  3975. }
  3976. ]
  3977. }
  3978. },
  3979. "/provider/{providerID}/oauth/callback": {
  3980. "post": {
  3981. "operationId": "provider.oauth.callback",
  3982. "parameters": [
  3983. {
  3984. "in": "query",
  3985. "name": "directory",
  3986. "schema": {
  3987. "type": "string"
  3988. }
  3989. },
  3990. {
  3991. "in": "path",
  3992. "name": "providerID",
  3993. "schema": {
  3994. "type": "string"
  3995. },
  3996. "required": true,
  3997. "description": "Provider ID"
  3998. }
  3999. ],
  4000. "summary": "OAuth callback",
  4001. "description": "Handle the OAuth callback from a provider after user authorization.",
  4002. "responses": {
  4003. "200": {
  4004. "description": "OAuth callback processed successfully",
  4005. "content": {
  4006. "application/json": {
  4007. "schema": {
  4008. "type": "boolean"
  4009. }
  4010. }
  4011. }
  4012. },
  4013. "400": {
  4014. "description": "Bad request",
  4015. "content": {
  4016. "application/json": {
  4017. "schema": {
  4018. "$ref": "#/components/schemas/BadRequestError"
  4019. }
  4020. }
  4021. }
  4022. }
  4023. },
  4024. "requestBody": {
  4025. "content": {
  4026. "application/json": {
  4027. "schema": {
  4028. "type": "object",
  4029. "properties": {
  4030. "method": {
  4031. "description": "Auth method index",
  4032. "type": "number"
  4033. },
  4034. "code": {
  4035. "description": "OAuth authorization code",
  4036. "type": "string"
  4037. }
  4038. },
  4039. "required": ["method"]
  4040. }
  4041. }
  4042. }
  4043. },
  4044. "x-codeSamples": [
  4045. {
  4046. "lang": "js",
  4047. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.oauth.callback({\n ...\n})"
  4048. }
  4049. ]
  4050. }
  4051. },
  4052. "/find": {
  4053. "get": {
  4054. "operationId": "find.text",
  4055. "parameters": [
  4056. {
  4057. "in": "query",
  4058. "name": "directory",
  4059. "schema": {
  4060. "type": "string"
  4061. }
  4062. },
  4063. {
  4064. "in": "query",
  4065. "name": "pattern",
  4066. "schema": {
  4067. "type": "string"
  4068. },
  4069. "required": true
  4070. }
  4071. ],
  4072. "summary": "Find text",
  4073. "description": "Search for text patterns across files in the project using ripgrep.",
  4074. "responses": {
  4075. "200": {
  4076. "description": "Matches",
  4077. "content": {
  4078. "application/json": {
  4079. "schema": {
  4080. "type": "array",
  4081. "items": {
  4082. "type": "object",
  4083. "properties": {
  4084. "path": {
  4085. "type": "object",
  4086. "properties": {
  4087. "text": {
  4088. "type": "string"
  4089. }
  4090. },
  4091. "required": ["text"]
  4092. },
  4093. "lines": {
  4094. "type": "object",
  4095. "properties": {
  4096. "text": {
  4097. "type": "string"
  4098. }
  4099. },
  4100. "required": ["text"]
  4101. },
  4102. "line_number": {
  4103. "type": "number"
  4104. },
  4105. "absolute_offset": {
  4106. "type": "number"
  4107. },
  4108. "submatches": {
  4109. "type": "array",
  4110. "items": {
  4111. "type": "object",
  4112. "properties": {
  4113. "match": {
  4114. "type": "object",
  4115. "properties": {
  4116. "text": {
  4117. "type": "string"
  4118. }
  4119. },
  4120. "required": ["text"]
  4121. },
  4122. "start": {
  4123. "type": "number"
  4124. },
  4125. "end": {
  4126. "type": "number"
  4127. }
  4128. },
  4129. "required": ["match", "start", "end"]
  4130. }
  4131. }
  4132. },
  4133. "required": ["path", "lines", "line_number", "absolute_offset", "submatches"]
  4134. }
  4135. }
  4136. }
  4137. }
  4138. }
  4139. },
  4140. "x-codeSamples": [
  4141. {
  4142. "lang": "js",
  4143. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.find.text({\n ...\n})"
  4144. }
  4145. ]
  4146. }
  4147. },
  4148. "/find/file": {
  4149. "get": {
  4150. "operationId": "find.files",
  4151. "parameters": [
  4152. {
  4153. "in": "query",
  4154. "name": "directory",
  4155. "schema": {
  4156. "type": "string"
  4157. }
  4158. },
  4159. {
  4160. "in": "query",
  4161. "name": "query",
  4162. "schema": {
  4163. "type": "string"
  4164. },
  4165. "required": true
  4166. },
  4167. {
  4168. "in": "query",
  4169. "name": "dirs",
  4170. "schema": {
  4171. "type": "string",
  4172. "enum": ["true", "false"]
  4173. }
  4174. },
  4175. {
  4176. "in": "query",
  4177. "name": "type",
  4178. "schema": {
  4179. "type": "string",
  4180. "enum": ["file", "directory"]
  4181. }
  4182. },
  4183. {
  4184. "in": "query",
  4185. "name": "limit",
  4186. "schema": {
  4187. "type": "integer",
  4188. "minimum": 1,
  4189. "maximum": 200
  4190. }
  4191. }
  4192. ],
  4193. "summary": "Find files",
  4194. "description": "Search for files or directories by name or pattern in the project directory.",
  4195. "responses": {
  4196. "200": {
  4197. "description": "File paths",
  4198. "content": {
  4199. "application/json": {
  4200. "schema": {
  4201. "type": "array",
  4202. "items": {
  4203. "type": "string"
  4204. }
  4205. }
  4206. }
  4207. }
  4208. }
  4209. },
  4210. "x-codeSamples": [
  4211. {
  4212. "lang": "js",
  4213. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.find.files({\n ...\n})"
  4214. }
  4215. ]
  4216. }
  4217. },
  4218. "/find/symbol": {
  4219. "get": {
  4220. "operationId": "find.symbols",
  4221. "parameters": [
  4222. {
  4223. "in": "query",
  4224. "name": "directory",
  4225. "schema": {
  4226. "type": "string"
  4227. }
  4228. },
  4229. {
  4230. "in": "query",
  4231. "name": "query",
  4232. "schema": {
  4233. "type": "string"
  4234. },
  4235. "required": true
  4236. }
  4237. ],
  4238. "summary": "Find symbols",
  4239. "description": "Search for workspace symbols like functions, classes, and variables using LSP.",
  4240. "responses": {
  4241. "200": {
  4242. "description": "Symbols",
  4243. "content": {
  4244. "application/json": {
  4245. "schema": {
  4246. "type": "array",
  4247. "items": {
  4248. "$ref": "#/components/schemas/Symbol"
  4249. }
  4250. }
  4251. }
  4252. }
  4253. }
  4254. },
  4255. "x-codeSamples": [
  4256. {
  4257. "lang": "js",
  4258. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.find.symbols({\n ...\n})"
  4259. }
  4260. ]
  4261. }
  4262. },
  4263. "/file": {
  4264. "get": {
  4265. "operationId": "file.list",
  4266. "parameters": [
  4267. {
  4268. "in": "query",
  4269. "name": "directory",
  4270. "schema": {
  4271. "type": "string"
  4272. }
  4273. },
  4274. {
  4275. "in": "query",
  4276. "name": "path",
  4277. "schema": {
  4278. "type": "string"
  4279. },
  4280. "required": true
  4281. }
  4282. ],
  4283. "summary": "List files",
  4284. "description": "List files and directories in a specified path.",
  4285. "responses": {
  4286. "200": {
  4287. "description": "Files and directories",
  4288. "content": {
  4289. "application/json": {
  4290. "schema": {
  4291. "type": "array",
  4292. "items": {
  4293. "$ref": "#/components/schemas/FileNode"
  4294. }
  4295. }
  4296. }
  4297. }
  4298. }
  4299. },
  4300. "x-codeSamples": [
  4301. {
  4302. "lang": "js",
  4303. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.file.list({\n ...\n})"
  4304. }
  4305. ]
  4306. }
  4307. },
  4308. "/file/content": {
  4309. "get": {
  4310. "operationId": "file.read",
  4311. "parameters": [
  4312. {
  4313. "in": "query",
  4314. "name": "directory",
  4315. "schema": {
  4316. "type": "string"
  4317. }
  4318. },
  4319. {
  4320. "in": "query",
  4321. "name": "path",
  4322. "schema": {
  4323. "type": "string"
  4324. },
  4325. "required": true
  4326. }
  4327. ],
  4328. "summary": "Read file",
  4329. "description": "Read the content of a specified file.",
  4330. "responses": {
  4331. "200": {
  4332. "description": "File content",
  4333. "content": {
  4334. "application/json": {
  4335. "schema": {
  4336. "$ref": "#/components/schemas/FileContent"
  4337. }
  4338. }
  4339. }
  4340. }
  4341. },
  4342. "x-codeSamples": [
  4343. {
  4344. "lang": "js",
  4345. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.file.read({\n ...\n})"
  4346. }
  4347. ]
  4348. }
  4349. },
  4350. "/file/status": {
  4351. "get": {
  4352. "operationId": "file.status",
  4353. "parameters": [
  4354. {
  4355. "in": "query",
  4356. "name": "directory",
  4357. "schema": {
  4358. "type": "string"
  4359. }
  4360. }
  4361. ],
  4362. "summary": "Get file status",
  4363. "description": "Get the git status of all files in the project.",
  4364. "responses": {
  4365. "200": {
  4366. "description": "File status",
  4367. "content": {
  4368. "application/json": {
  4369. "schema": {
  4370. "type": "array",
  4371. "items": {
  4372. "$ref": "#/components/schemas/File"
  4373. }
  4374. }
  4375. }
  4376. }
  4377. }
  4378. },
  4379. "x-codeSamples": [
  4380. {
  4381. "lang": "js",
  4382. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.file.status({\n ...\n})"
  4383. }
  4384. ]
  4385. }
  4386. },
  4387. "/mcp": {
  4388. "get": {
  4389. "operationId": "mcp.status",
  4390. "parameters": [
  4391. {
  4392. "in": "query",
  4393. "name": "directory",
  4394. "schema": {
  4395. "type": "string"
  4396. }
  4397. }
  4398. ],
  4399. "summary": "Get MCP status",
  4400. "description": "Get the status of all Model Context Protocol (MCP) servers.",
  4401. "responses": {
  4402. "200": {
  4403. "description": "MCP server status",
  4404. "content": {
  4405. "application/json": {
  4406. "schema": {
  4407. "type": "object",
  4408. "propertyNames": {
  4409. "type": "string"
  4410. },
  4411. "additionalProperties": {
  4412. "$ref": "#/components/schemas/MCPStatus"
  4413. }
  4414. }
  4415. }
  4416. }
  4417. }
  4418. },
  4419. "x-codeSamples": [
  4420. {
  4421. "lang": "js",
  4422. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.status({\n ...\n})"
  4423. }
  4424. ]
  4425. },
  4426. "post": {
  4427. "operationId": "mcp.add",
  4428. "parameters": [
  4429. {
  4430. "in": "query",
  4431. "name": "directory",
  4432. "schema": {
  4433. "type": "string"
  4434. }
  4435. }
  4436. ],
  4437. "summary": "Add MCP server",
  4438. "description": "Dynamically add a new Model Context Protocol (MCP) server to the system.",
  4439. "responses": {
  4440. "200": {
  4441. "description": "MCP server added successfully",
  4442. "content": {
  4443. "application/json": {
  4444. "schema": {
  4445. "type": "object",
  4446. "propertyNames": {
  4447. "type": "string"
  4448. },
  4449. "additionalProperties": {
  4450. "$ref": "#/components/schemas/MCPStatus"
  4451. }
  4452. }
  4453. }
  4454. }
  4455. },
  4456. "400": {
  4457. "description": "Bad request",
  4458. "content": {
  4459. "application/json": {
  4460. "schema": {
  4461. "$ref": "#/components/schemas/BadRequestError"
  4462. }
  4463. }
  4464. }
  4465. }
  4466. },
  4467. "requestBody": {
  4468. "content": {
  4469. "application/json": {
  4470. "schema": {
  4471. "type": "object",
  4472. "properties": {
  4473. "name": {
  4474. "type": "string"
  4475. },
  4476. "config": {
  4477. "anyOf": [
  4478. {
  4479. "$ref": "#/components/schemas/McpLocalConfig"
  4480. },
  4481. {
  4482. "$ref": "#/components/schemas/McpRemoteConfig"
  4483. }
  4484. ]
  4485. }
  4486. },
  4487. "required": ["name", "config"]
  4488. }
  4489. }
  4490. }
  4491. },
  4492. "x-codeSamples": [
  4493. {
  4494. "lang": "js",
  4495. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.add({\n ...\n})"
  4496. }
  4497. ]
  4498. }
  4499. },
  4500. "/mcp/{name}/auth": {
  4501. "post": {
  4502. "operationId": "mcp.auth.start",
  4503. "parameters": [
  4504. {
  4505. "in": "query",
  4506. "name": "directory",
  4507. "schema": {
  4508. "type": "string"
  4509. }
  4510. },
  4511. {
  4512. "schema": {
  4513. "type": "string"
  4514. },
  4515. "in": "path",
  4516. "name": "name",
  4517. "required": true
  4518. }
  4519. ],
  4520. "summary": "Start MCP OAuth",
  4521. "description": "Start OAuth authentication flow for a Model Context Protocol (MCP) server.",
  4522. "responses": {
  4523. "200": {
  4524. "description": "OAuth flow started",
  4525. "content": {
  4526. "application/json": {
  4527. "schema": {
  4528. "type": "object",
  4529. "properties": {
  4530. "authorizationUrl": {
  4531. "description": "URL to open in browser for authorization",
  4532. "type": "string"
  4533. }
  4534. },
  4535. "required": ["authorizationUrl"]
  4536. }
  4537. }
  4538. }
  4539. },
  4540. "400": {
  4541. "description": "Bad request",
  4542. "content": {
  4543. "application/json": {
  4544. "schema": {
  4545. "$ref": "#/components/schemas/BadRequestError"
  4546. }
  4547. }
  4548. }
  4549. },
  4550. "404": {
  4551. "description": "Not found",
  4552. "content": {
  4553. "application/json": {
  4554. "schema": {
  4555. "$ref": "#/components/schemas/NotFoundError"
  4556. }
  4557. }
  4558. }
  4559. }
  4560. },
  4561. "x-codeSamples": [
  4562. {
  4563. "lang": "js",
  4564. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.start({\n ...\n})"
  4565. }
  4566. ]
  4567. },
  4568. "delete": {
  4569. "operationId": "mcp.auth.remove",
  4570. "parameters": [
  4571. {
  4572. "in": "query",
  4573. "name": "directory",
  4574. "schema": {
  4575. "type": "string"
  4576. }
  4577. },
  4578. {
  4579. "schema": {
  4580. "type": "string"
  4581. },
  4582. "in": "path",
  4583. "name": "name",
  4584. "required": true
  4585. }
  4586. ],
  4587. "summary": "Remove MCP OAuth",
  4588. "description": "Remove OAuth credentials for an MCP server",
  4589. "responses": {
  4590. "200": {
  4591. "description": "OAuth credentials removed",
  4592. "content": {
  4593. "application/json": {
  4594. "schema": {
  4595. "type": "object",
  4596. "properties": {
  4597. "success": {
  4598. "type": "boolean",
  4599. "const": true
  4600. }
  4601. },
  4602. "required": ["success"]
  4603. }
  4604. }
  4605. }
  4606. },
  4607. "404": {
  4608. "description": "Not found",
  4609. "content": {
  4610. "application/json": {
  4611. "schema": {
  4612. "$ref": "#/components/schemas/NotFoundError"
  4613. }
  4614. }
  4615. }
  4616. }
  4617. },
  4618. "x-codeSamples": [
  4619. {
  4620. "lang": "js",
  4621. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.remove({\n ...\n})"
  4622. }
  4623. ]
  4624. }
  4625. },
  4626. "/mcp/{name}/auth/callback": {
  4627. "post": {
  4628. "operationId": "mcp.auth.callback",
  4629. "parameters": [
  4630. {
  4631. "in": "query",
  4632. "name": "directory",
  4633. "schema": {
  4634. "type": "string"
  4635. }
  4636. },
  4637. {
  4638. "schema": {
  4639. "type": "string"
  4640. },
  4641. "in": "path",
  4642. "name": "name",
  4643. "required": true
  4644. }
  4645. ],
  4646. "summary": "Complete MCP OAuth",
  4647. "description": "Complete OAuth authentication for a Model Context Protocol (MCP) server using the authorization code.",
  4648. "responses": {
  4649. "200": {
  4650. "description": "OAuth authentication completed",
  4651. "content": {
  4652. "application/json": {
  4653. "schema": {
  4654. "$ref": "#/components/schemas/MCPStatus"
  4655. }
  4656. }
  4657. }
  4658. },
  4659. "400": {
  4660. "description": "Bad request",
  4661. "content": {
  4662. "application/json": {
  4663. "schema": {
  4664. "$ref": "#/components/schemas/BadRequestError"
  4665. }
  4666. }
  4667. }
  4668. },
  4669. "404": {
  4670. "description": "Not found",
  4671. "content": {
  4672. "application/json": {
  4673. "schema": {
  4674. "$ref": "#/components/schemas/NotFoundError"
  4675. }
  4676. }
  4677. }
  4678. }
  4679. },
  4680. "requestBody": {
  4681. "content": {
  4682. "application/json": {
  4683. "schema": {
  4684. "type": "object",
  4685. "properties": {
  4686. "code": {
  4687. "description": "Authorization code from OAuth callback",
  4688. "type": "string"
  4689. }
  4690. },
  4691. "required": ["code"]
  4692. }
  4693. }
  4694. }
  4695. },
  4696. "x-codeSamples": [
  4697. {
  4698. "lang": "js",
  4699. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.callback({\n ...\n})"
  4700. }
  4701. ]
  4702. }
  4703. },
  4704. "/mcp/{name}/auth/authenticate": {
  4705. "post": {
  4706. "operationId": "mcp.auth.authenticate",
  4707. "parameters": [
  4708. {
  4709. "in": "query",
  4710. "name": "directory",
  4711. "schema": {
  4712. "type": "string"
  4713. }
  4714. },
  4715. {
  4716. "schema": {
  4717. "type": "string"
  4718. },
  4719. "in": "path",
  4720. "name": "name",
  4721. "required": true
  4722. }
  4723. ],
  4724. "summary": "Authenticate MCP OAuth",
  4725. "description": "Start OAuth flow and wait for callback (opens browser)",
  4726. "responses": {
  4727. "200": {
  4728. "description": "OAuth authentication completed",
  4729. "content": {
  4730. "application/json": {
  4731. "schema": {
  4732. "$ref": "#/components/schemas/MCPStatus"
  4733. }
  4734. }
  4735. }
  4736. },
  4737. "400": {
  4738. "description": "Bad request",
  4739. "content": {
  4740. "application/json": {
  4741. "schema": {
  4742. "$ref": "#/components/schemas/BadRequestError"
  4743. }
  4744. }
  4745. }
  4746. },
  4747. "404": {
  4748. "description": "Not found",
  4749. "content": {
  4750. "application/json": {
  4751. "schema": {
  4752. "$ref": "#/components/schemas/NotFoundError"
  4753. }
  4754. }
  4755. }
  4756. }
  4757. },
  4758. "x-codeSamples": [
  4759. {
  4760. "lang": "js",
  4761. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.authenticate({\n ...\n})"
  4762. }
  4763. ]
  4764. }
  4765. },
  4766. "/mcp/{name}/connect": {
  4767. "post": {
  4768. "operationId": "mcp.connect",
  4769. "parameters": [
  4770. {
  4771. "in": "query",
  4772. "name": "directory",
  4773. "schema": {
  4774. "type": "string"
  4775. }
  4776. },
  4777. {
  4778. "in": "path",
  4779. "name": "name",
  4780. "schema": {
  4781. "type": "string"
  4782. },
  4783. "required": true
  4784. }
  4785. ],
  4786. "description": "Connect an MCP server",
  4787. "responses": {
  4788. "200": {
  4789. "description": "MCP server connected successfully",
  4790. "content": {
  4791. "application/json": {
  4792. "schema": {
  4793. "type": "boolean"
  4794. }
  4795. }
  4796. }
  4797. }
  4798. },
  4799. "x-codeSamples": [
  4800. {
  4801. "lang": "js",
  4802. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.connect({\n ...\n})"
  4803. }
  4804. ]
  4805. }
  4806. },
  4807. "/mcp/{name}/disconnect": {
  4808. "post": {
  4809. "operationId": "mcp.disconnect",
  4810. "parameters": [
  4811. {
  4812. "in": "query",
  4813. "name": "directory",
  4814. "schema": {
  4815. "type": "string"
  4816. }
  4817. },
  4818. {
  4819. "in": "path",
  4820. "name": "name",
  4821. "schema": {
  4822. "type": "string"
  4823. },
  4824. "required": true
  4825. }
  4826. ],
  4827. "description": "Disconnect an MCP server",
  4828. "responses": {
  4829. "200": {
  4830. "description": "MCP server disconnected successfully",
  4831. "content": {
  4832. "application/json": {
  4833. "schema": {
  4834. "type": "boolean"
  4835. }
  4836. }
  4837. }
  4838. }
  4839. },
  4840. "x-codeSamples": [
  4841. {
  4842. "lang": "js",
  4843. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.disconnect({\n ...\n})"
  4844. }
  4845. ]
  4846. }
  4847. },
  4848. "/tui/append-prompt": {
  4849. "post": {
  4850. "operationId": "tui.appendPrompt",
  4851. "parameters": [
  4852. {
  4853. "in": "query",
  4854. "name": "directory",
  4855. "schema": {
  4856. "type": "string"
  4857. }
  4858. }
  4859. ],
  4860. "summary": "Append TUI prompt",
  4861. "description": "Append prompt to the TUI",
  4862. "responses": {
  4863. "200": {
  4864. "description": "Prompt processed successfully",
  4865. "content": {
  4866. "application/json": {
  4867. "schema": {
  4868. "type": "boolean"
  4869. }
  4870. }
  4871. }
  4872. },
  4873. "400": {
  4874. "description": "Bad request",
  4875. "content": {
  4876. "application/json": {
  4877. "schema": {
  4878. "$ref": "#/components/schemas/BadRequestError"
  4879. }
  4880. }
  4881. }
  4882. }
  4883. },
  4884. "requestBody": {
  4885. "content": {
  4886. "application/json": {
  4887. "schema": {
  4888. "type": "object",
  4889. "properties": {
  4890. "text": {
  4891. "type": "string"
  4892. }
  4893. },
  4894. "required": ["text"]
  4895. }
  4896. }
  4897. }
  4898. },
  4899. "x-codeSamples": [
  4900. {
  4901. "lang": "js",
  4902. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.appendPrompt({\n ...\n})"
  4903. }
  4904. ]
  4905. }
  4906. },
  4907. "/tui/open-help": {
  4908. "post": {
  4909. "operationId": "tui.openHelp",
  4910. "parameters": [
  4911. {
  4912. "in": "query",
  4913. "name": "directory",
  4914. "schema": {
  4915. "type": "string"
  4916. }
  4917. }
  4918. ],
  4919. "summary": "Open help dialog",
  4920. "description": "Open the help dialog in the TUI to display user assistance information.",
  4921. "responses": {
  4922. "200": {
  4923. "description": "Help dialog opened successfully",
  4924. "content": {
  4925. "application/json": {
  4926. "schema": {
  4927. "type": "boolean"
  4928. }
  4929. }
  4930. }
  4931. }
  4932. },
  4933. "x-codeSamples": [
  4934. {
  4935. "lang": "js",
  4936. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openHelp({\n ...\n})"
  4937. }
  4938. ]
  4939. }
  4940. },
  4941. "/tui/open-sessions": {
  4942. "post": {
  4943. "operationId": "tui.openSessions",
  4944. "parameters": [
  4945. {
  4946. "in": "query",
  4947. "name": "directory",
  4948. "schema": {
  4949. "type": "string"
  4950. }
  4951. }
  4952. ],
  4953. "summary": "Open sessions dialog",
  4954. "description": "Open the session dialog",
  4955. "responses": {
  4956. "200": {
  4957. "description": "Session dialog opened successfully",
  4958. "content": {
  4959. "application/json": {
  4960. "schema": {
  4961. "type": "boolean"
  4962. }
  4963. }
  4964. }
  4965. }
  4966. },
  4967. "x-codeSamples": [
  4968. {
  4969. "lang": "js",
  4970. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openSessions({\n ...\n})"
  4971. }
  4972. ]
  4973. }
  4974. },
  4975. "/tui/open-themes": {
  4976. "post": {
  4977. "operationId": "tui.openThemes",
  4978. "parameters": [
  4979. {
  4980. "in": "query",
  4981. "name": "directory",
  4982. "schema": {
  4983. "type": "string"
  4984. }
  4985. }
  4986. ],
  4987. "summary": "Open themes dialog",
  4988. "description": "Open the theme dialog",
  4989. "responses": {
  4990. "200": {
  4991. "description": "Theme dialog opened successfully",
  4992. "content": {
  4993. "application/json": {
  4994. "schema": {
  4995. "type": "boolean"
  4996. }
  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.openThemes({\n ...\n})"
  5005. }
  5006. ]
  5007. }
  5008. },
  5009. "/tui/open-models": {
  5010. "post": {
  5011. "operationId": "tui.openModels",
  5012. "parameters": [
  5013. {
  5014. "in": "query",
  5015. "name": "directory",
  5016. "schema": {
  5017. "type": "string"
  5018. }
  5019. }
  5020. ],
  5021. "summary": "Open models dialog",
  5022. "description": "Open the model dialog",
  5023. "responses": {
  5024. "200": {
  5025. "description": "Model 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.openModels({\n ...\n})"
  5039. }
  5040. ]
  5041. }
  5042. },
  5043. "/tui/submit-prompt": {
  5044. "post": {
  5045. "operationId": "tui.submitPrompt",
  5046. "parameters": [
  5047. {
  5048. "in": "query",
  5049. "name": "directory",
  5050. "schema": {
  5051. "type": "string"
  5052. }
  5053. }
  5054. ],
  5055. "summary": "Submit TUI prompt",
  5056. "description": "Submit the prompt",
  5057. "responses": {
  5058. "200": {
  5059. "description": "Prompt submitted 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.submitPrompt({\n ...\n})"
  5073. }
  5074. ]
  5075. }
  5076. },
  5077. "/tui/clear-prompt": {
  5078. "post": {
  5079. "operationId": "tui.clearPrompt",
  5080. "parameters": [
  5081. {
  5082. "in": "query",
  5083. "name": "directory",
  5084. "schema": {
  5085. "type": "string"
  5086. }
  5087. }
  5088. ],
  5089. "summary": "Clear TUI prompt",
  5090. "description": "Clear the prompt",
  5091. "responses": {
  5092. "200": {
  5093. "description": "Prompt cleared 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.clearPrompt({\n ...\n})"
  5107. }
  5108. ]
  5109. }
  5110. },
  5111. "/tui/execute-command": {
  5112. "post": {
  5113. "operationId": "tui.executeCommand",
  5114. "parameters": [
  5115. {
  5116. "in": "query",
  5117. "name": "directory",
  5118. "schema": {
  5119. "type": "string"
  5120. }
  5121. }
  5122. ],
  5123. "summary": "Execute TUI command",
  5124. "description": "Execute a TUI command (e.g. agent_cycle)",
  5125. "responses": {
  5126. "200": {
  5127. "description": "Command executed successfully",
  5128. "content": {
  5129. "application/json": {
  5130. "schema": {
  5131. "type": "boolean"
  5132. }
  5133. }
  5134. }
  5135. },
  5136. "400": {
  5137. "description": "Bad request",
  5138. "content": {
  5139. "application/json": {
  5140. "schema": {
  5141. "$ref": "#/components/schemas/BadRequestError"
  5142. }
  5143. }
  5144. }
  5145. }
  5146. },
  5147. "requestBody": {
  5148. "content": {
  5149. "application/json": {
  5150. "schema": {
  5151. "type": "object",
  5152. "properties": {
  5153. "command": {
  5154. "type": "string"
  5155. }
  5156. },
  5157. "required": ["command"]
  5158. }
  5159. }
  5160. }
  5161. },
  5162. "x-codeSamples": [
  5163. {
  5164. "lang": "js",
  5165. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.executeCommand({\n ...\n})"
  5166. }
  5167. ]
  5168. }
  5169. },
  5170. "/tui/show-toast": {
  5171. "post": {
  5172. "operationId": "tui.showToast",
  5173. "parameters": [
  5174. {
  5175. "in": "query",
  5176. "name": "directory",
  5177. "schema": {
  5178. "type": "string"
  5179. }
  5180. }
  5181. ],
  5182. "summary": "Show TUI toast",
  5183. "description": "Show a toast notification in the TUI",
  5184. "responses": {
  5185. "200": {
  5186. "description": "Toast notification shown successfully",
  5187. "content": {
  5188. "application/json": {
  5189. "schema": {
  5190. "type": "boolean"
  5191. }
  5192. }
  5193. }
  5194. }
  5195. },
  5196. "requestBody": {
  5197. "content": {
  5198. "application/json": {
  5199. "schema": {
  5200. "type": "object",
  5201. "properties": {
  5202. "title": {
  5203. "type": "string"
  5204. },
  5205. "message": {
  5206. "type": "string"
  5207. },
  5208. "variant": {
  5209. "type": "string",
  5210. "enum": ["info", "success", "warning", "error"]
  5211. },
  5212. "duration": {
  5213. "description": "Duration in milliseconds",
  5214. "default": 5000,
  5215. "type": "number"
  5216. }
  5217. },
  5218. "required": ["message", "variant"]
  5219. }
  5220. }
  5221. }
  5222. },
  5223. "x-codeSamples": [
  5224. {
  5225. "lang": "js",
  5226. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.showToast({\n ...\n})"
  5227. }
  5228. ]
  5229. }
  5230. },
  5231. "/tui/publish": {
  5232. "post": {
  5233. "operationId": "tui.publish",
  5234. "parameters": [
  5235. {
  5236. "in": "query",
  5237. "name": "directory",
  5238. "schema": {
  5239. "type": "string"
  5240. }
  5241. }
  5242. ],
  5243. "summary": "Publish TUI event",
  5244. "description": "Publish a TUI event",
  5245. "responses": {
  5246. "200": {
  5247. "description": "Event published successfully",
  5248. "content": {
  5249. "application/json": {
  5250. "schema": {
  5251. "type": "boolean"
  5252. }
  5253. }
  5254. }
  5255. },
  5256. "400": {
  5257. "description": "Bad request",
  5258. "content": {
  5259. "application/json": {
  5260. "schema": {
  5261. "$ref": "#/components/schemas/BadRequestError"
  5262. }
  5263. }
  5264. }
  5265. }
  5266. },
  5267. "requestBody": {
  5268. "content": {
  5269. "application/json": {
  5270. "schema": {
  5271. "anyOf": [
  5272. {
  5273. "$ref": "#/components/schemas/Event.tui.prompt.append"
  5274. },
  5275. {
  5276. "$ref": "#/components/schemas/Event.tui.command.execute"
  5277. },
  5278. {
  5279. "$ref": "#/components/schemas/Event.tui.toast.show"
  5280. },
  5281. {
  5282. "$ref": "#/components/schemas/Event.tui.session.select"
  5283. }
  5284. ]
  5285. }
  5286. }
  5287. }
  5288. },
  5289. "x-codeSamples": [
  5290. {
  5291. "lang": "js",
  5292. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.publish({\n ...\n})"
  5293. }
  5294. ]
  5295. }
  5296. },
  5297. "/tui/select-session": {
  5298. "post": {
  5299. "operationId": "tui.selectSession",
  5300. "parameters": [
  5301. {
  5302. "in": "query",
  5303. "name": "directory",
  5304. "schema": {
  5305. "type": "string"
  5306. }
  5307. }
  5308. ],
  5309. "summary": "Select session",
  5310. "description": "Navigate the TUI to display the specified session.",
  5311. "responses": {
  5312. "200": {
  5313. "description": "Session selected successfully",
  5314. "content": {
  5315. "application/json": {
  5316. "schema": {
  5317. "type": "boolean"
  5318. }
  5319. }
  5320. }
  5321. },
  5322. "400": {
  5323. "description": "Bad request",
  5324. "content": {
  5325. "application/json": {
  5326. "schema": {
  5327. "$ref": "#/components/schemas/BadRequestError"
  5328. }
  5329. }
  5330. }
  5331. },
  5332. "404": {
  5333. "description": "Not found",
  5334. "content": {
  5335. "application/json": {
  5336. "schema": {
  5337. "$ref": "#/components/schemas/NotFoundError"
  5338. }
  5339. }
  5340. }
  5341. }
  5342. },
  5343. "requestBody": {
  5344. "content": {
  5345. "application/json": {
  5346. "schema": {
  5347. "type": "object",
  5348. "properties": {
  5349. "sessionID": {
  5350. "description": "Session ID to navigate to",
  5351. "type": "string",
  5352. "pattern": "^ses"
  5353. }
  5354. },
  5355. "required": ["sessionID"]
  5356. }
  5357. }
  5358. }
  5359. },
  5360. "x-codeSamples": [
  5361. {
  5362. "lang": "js",
  5363. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.selectSession({\n ...\n})"
  5364. }
  5365. ]
  5366. }
  5367. },
  5368. "/tui/control/next": {
  5369. "get": {
  5370. "operationId": "tui.control.next",
  5371. "parameters": [
  5372. {
  5373. "in": "query",
  5374. "name": "directory",
  5375. "schema": {
  5376. "type": "string"
  5377. }
  5378. }
  5379. ],
  5380. "summary": "Get next TUI request",
  5381. "description": "Retrieve the next TUI (Terminal User Interface) request from the queue for processing.",
  5382. "responses": {
  5383. "200": {
  5384. "description": "Next TUI request",
  5385. "content": {
  5386. "application/json": {
  5387. "schema": {
  5388. "type": "object",
  5389. "properties": {
  5390. "path": {
  5391. "type": "string"
  5392. },
  5393. "body": {}
  5394. },
  5395. "required": ["path", "body"]
  5396. }
  5397. }
  5398. }
  5399. }
  5400. },
  5401. "x-codeSamples": [
  5402. {
  5403. "lang": "js",
  5404. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.control.next({\n ...\n})"
  5405. }
  5406. ]
  5407. }
  5408. },
  5409. "/tui/control/response": {
  5410. "post": {
  5411. "operationId": "tui.control.response",
  5412. "parameters": [
  5413. {
  5414. "in": "query",
  5415. "name": "directory",
  5416. "schema": {
  5417. "type": "string"
  5418. }
  5419. }
  5420. ],
  5421. "summary": "Submit TUI response",
  5422. "description": "Submit a response to the TUI request queue to complete a pending request.",
  5423. "responses": {
  5424. "200": {
  5425. "description": "Response submitted successfully",
  5426. "content": {
  5427. "application/json": {
  5428. "schema": {
  5429. "type": "boolean"
  5430. }
  5431. }
  5432. }
  5433. }
  5434. },
  5435. "requestBody": {
  5436. "content": {
  5437. "application/json": {
  5438. "schema": {}
  5439. }
  5440. }
  5441. },
  5442. "x-codeSamples": [
  5443. {
  5444. "lang": "js",
  5445. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.control.response({\n ...\n})"
  5446. }
  5447. ]
  5448. }
  5449. },
  5450. "/instance/dispose": {
  5451. "post": {
  5452. "operationId": "instance.dispose",
  5453. "parameters": [
  5454. {
  5455. "in": "query",
  5456. "name": "directory",
  5457. "schema": {
  5458. "type": "string"
  5459. }
  5460. }
  5461. ],
  5462. "summary": "Dispose instance",
  5463. "description": "Clean up and dispose the current OpenCode instance, releasing all resources.",
  5464. "responses": {
  5465. "200": {
  5466. "description": "Instance disposed",
  5467. "content": {
  5468. "application/json": {
  5469. "schema": {
  5470. "type": "boolean"
  5471. }
  5472. }
  5473. }
  5474. }
  5475. },
  5476. "x-codeSamples": [
  5477. {
  5478. "lang": "js",
  5479. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.instance.dispose({\n ...\n})"
  5480. }
  5481. ]
  5482. }
  5483. },
  5484. "/path": {
  5485. "get": {
  5486. "operationId": "path.get",
  5487. "parameters": [
  5488. {
  5489. "in": "query",
  5490. "name": "directory",
  5491. "schema": {
  5492. "type": "string"
  5493. }
  5494. }
  5495. ],
  5496. "summary": "Get paths",
  5497. "description": "Retrieve the current working directory and related path information for the OpenCode instance.",
  5498. "responses": {
  5499. "200": {
  5500. "description": "Path",
  5501. "content": {
  5502. "application/json": {
  5503. "schema": {
  5504. "$ref": "#/components/schemas/Path"
  5505. }
  5506. }
  5507. }
  5508. }
  5509. },
  5510. "x-codeSamples": [
  5511. {
  5512. "lang": "js",
  5513. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.path.get({\n ...\n})"
  5514. }
  5515. ]
  5516. }
  5517. },
  5518. "/vcs": {
  5519. "get": {
  5520. "operationId": "vcs.get",
  5521. "parameters": [
  5522. {
  5523. "in": "query",
  5524. "name": "directory",
  5525. "schema": {
  5526. "type": "string"
  5527. }
  5528. }
  5529. ],
  5530. "summary": "Get VCS info",
  5531. "description": "Retrieve version control system (VCS) information for the current project, such as git branch.",
  5532. "responses": {
  5533. "200": {
  5534. "description": "VCS info",
  5535. "content": {
  5536. "application/json": {
  5537. "schema": {
  5538. "$ref": "#/components/schemas/VcsInfo"
  5539. }
  5540. }
  5541. }
  5542. }
  5543. },
  5544. "x-codeSamples": [
  5545. {
  5546. "lang": "js",
  5547. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.vcs.get({\n ...\n})"
  5548. }
  5549. ]
  5550. }
  5551. },
  5552. "/command": {
  5553. "get": {
  5554. "operationId": "command.list",
  5555. "parameters": [
  5556. {
  5557. "in": "query",
  5558. "name": "directory",
  5559. "schema": {
  5560. "type": "string"
  5561. }
  5562. }
  5563. ],
  5564. "summary": "List commands",
  5565. "description": "Get a list of all available commands in the OpenCode system.",
  5566. "responses": {
  5567. "200": {
  5568. "description": "List of commands",
  5569. "content": {
  5570. "application/json": {
  5571. "schema": {
  5572. "type": "array",
  5573. "items": {
  5574. "$ref": "#/components/schemas/Command"
  5575. }
  5576. }
  5577. }
  5578. }
  5579. }
  5580. },
  5581. "x-codeSamples": [
  5582. {
  5583. "lang": "js",
  5584. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.command.list({\n ...\n})"
  5585. }
  5586. ]
  5587. }
  5588. },
  5589. "/log": {
  5590. "post": {
  5591. "operationId": "app.log",
  5592. "parameters": [
  5593. {
  5594. "in": "query",
  5595. "name": "directory",
  5596. "schema": {
  5597. "type": "string"
  5598. }
  5599. }
  5600. ],
  5601. "summary": "Write log",
  5602. "description": "Write a log entry to the server logs with specified level and metadata.",
  5603. "responses": {
  5604. "200": {
  5605. "description": "Log entry written successfully",
  5606. "content": {
  5607. "application/json": {
  5608. "schema": {
  5609. "type": "boolean"
  5610. }
  5611. }
  5612. }
  5613. },
  5614. "400": {
  5615. "description": "Bad request",
  5616. "content": {
  5617. "application/json": {
  5618. "schema": {
  5619. "$ref": "#/components/schemas/BadRequestError"
  5620. }
  5621. }
  5622. }
  5623. }
  5624. },
  5625. "requestBody": {
  5626. "content": {
  5627. "application/json": {
  5628. "schema": {
  5629. "type": "object",
  5630. "properties": {
  5631. "service": {
  5632. "description": "Service name for the log entry",
  5633. "type": "string"
  5634. },
  5635. "level": {
  5636. "description": "Log level",
  5637. "type": "string",
  5638. "enum": ["debug", "info", "error", "warn"]
  5639. },
  5640. "message": {
  5641. "description": "Log message",
  5642. "type": "string"
  5643. },
  5644. "extra": {
  5645. "description": "Additional metadata for the log entry",
  5646. "type": "object",
  5647. "propertyNames": {
  5648. "type": "string"
  5649. },
  5650. "additionalProperties": {}
  5651. }
  5652. },
  5653. "required": ["service", "level", "message"]
  5654. }
  5655. }
  5656. }
  5657. },
  5658. "x-codeSamples": [
  5659. {
  5660. "lang": "js",
  5661. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.app.log({\n ...\n})"
  5662. }
  5663. ]
  5664. }
  5665. },
  5666. "/agent": {
  5667. "get": {
  5668. "operationId": "app.agents",
  5669. "parameters": [
  5670. {
  5671. "in": "query",
  5672. "name": "directory",
  5673. "schema": {
  5674. "type": "string"
  5675. }
  5676. }
  5677. ],
  5678. "summary": "List agents",
  5679. "description": "Get a list of all available AI agents in the OpenCode system.",
  5680. "responses": {
  5681. "200": {
  5682. "description": "List of agents",
  5683. "content": {
  5684. "application/json": {
  5685. "schema": {
  5686. "type": "array",
  5687. "items": {
  5688. "$ref": "#/components/schemas/Agent"
  5689. }
  5690. }
  5691. }
  5692. }
  5693. }
  5694. },
  5695. "x-codeSamples": [
  5696. {
  5697. "lang": "js",
  5698. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.app.agents({\n ...\n})"
  5699. }
  5700. ]
  5701. }
  5702. },
  5703. "/skill": {
  5704. "get": {
  5705. "operationId": "app.skills",
  5706. "parameters": [
  5707. {
  5708. "in": "query",
  5709. "name": "directory",
  5710. "schema": {
  5711. "type": "string"
  5712. }
  5713. }
  5714. ],
  5715. "summary": "List skills",
  5716. "description": "Get a list of all available skills in the OpenCode system.",
  5717. "responses": {
  5718. "200": {
  5719. "description": "List of skills",
  5720. "content": {
  5721. "application/json": {
  5722. "schema": {
  5723. "type": "array",
  5724. "items": {
  5725. "type": "object",
  5726. "properties": {
  5727. "name": {
  5728. "type": "string"
  5729. },
  5730. "description": {
  5731. "type": "string"
  5732. },
  5733. "location": {
  5734. "type": "string"
  5735. },
  5736. "content": {
  5737. "type": "string"
  5738. }
  5739. },
  5740. "required": ["name", "description", "location", "content"]
  5741. }
  5742. }
  5743. }
  5744. }
  5745. }
  5746. },
  5747. "x-codeSamples": [
  5748. {
  5749. "lang": "js",
  5750. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.app.skills({\n ...\n})"
  5751. }
  5752. ]
  5753. }
  5754. },
  5755. "/lsp": {
  5756. "get": {
  5757. "operationId": "lsp.status",
  5758. "parameters": [
  5759. {
  5760. "in": "query",
  5761. "name": "directory",
  5762. "schema": {
  5763. "type": "string"
  5764. }
  5765. }
  5766. ],
  5767. "summary": "Get LSP status",
  5768. "description": "Get LSP server status",
  5769. "responses": {
  5770. "200": {
  5771. "description": "LSP server status",
  5772. "content": {
  5773. "application/json": {
  5774. "schema": {
  5775. "type": "array",
  5776. "items": {
  5777. "$ref": "#/components/schemas/LSPStatus"
  5778. }
  5779. }
  5780. }
  5781. }
  5782. }
  5783. },
  5784. "x-codeSamples": [
  5785. {
  5786. "lang": "js",
  5787. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.lsp.status({\n ...\n})"
  5788. }
  5789. ]
  5790. }
  5791. },
  5792. "/formatter": {
  5793. "get": {
  5794. "operationId": "formatter.status",
  5795. "parameters": [
  5796. {
  5797. "in": "query",
  5798. "name": "directory",
  5799. "schema": {
  5800. "type": "string"
  5801. }
  5802. }
  5803. ],
  5804. "summary": "Get formatter status",
  5805. "description": "Get formatter status",
  5806. "responses": {
  5807. "200": {
  5808. "description": "Formatter status",
  5809. "content": {
  5810. "application/json": {
  5811. "schema": {
  5812. "type": "array",
  5813. "items": {
  5814. "$ref": "#/components/schemas/FormatterStatus"
  5815. }
  5816. }
  5817. }
  5818. }
  5819. }
  5820. },
  5821. "x-codeSamples": [
  5822. {
  5823. "lang": "js",
  5824. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.formatter.status({\n ...\n})"
  5825. }
  5826. ]
  5827. }
  5828. },
  5829. "/event": {
  5830. "get": {
  5831. "operationId": "event.subscribe",
  5832. "parameters": [
  5833. {
  5834. "in": "query",
  5835. "name": "directory",
  5836. "schema": {
  5837. "type": "string"
  5838. }
  5839. }
  5840. ],
  5841. "summary": "Subscribe to events",
  5842. "description": "Get events",
  5843. "responses": {
  5844. "200": {
  5845. "description": "Event stream",
  5846. "content": {
  5847. "text/event-stream": {
  5848. "schema": {
  5849. "$ref": "#/components/schemas/Event"
  5850. }
  5851. }
  5852. }
  5853. }
  5854. },
  5855. "x-codeSamples": [
  5856. {
  5857. "lang": "js",
  5858. "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.event.subscribe({\n ...\n})"
  5859. }
  5860. ]
  5861. }
  5862. }
  5863. },
  5864. "components": {
  5865. "schemas": {
  5866. "Event.installation.updated": {
  5867. "type": "object",
  5868. "properties": {
  5869. "type": {
  5870. "type": "string",
  5871. "const": "installation.updated"
  5872. },
  5873. "properties": {
  5874. "type": "object",
  5875. "properties": {
  5876. "version": {
  5877. "type": "string"
  5878. }
  5879. },
  5880. "required": ["version"]
  5881. }
  5882. },
  5883. "required": ["type", "properties"]
  5884. },
  5885. "Event.installation.update-available": {
  5886. "type": "object",
  5887. "properties": {
  5888. "type": {
  5889. "type": "string",
  5890. "const": "installation.update-available"
  5891. },
  5892. "properties": {
  5893. "type": "object",
  5894. "properties": {
  5895. "version": {
  5896. "type": "string"
  5897. }
  5898. },
  5899. "required": ["version"]
  5900. }
  5901. },
  5902. "required": ["type", "properties"]
  5903. },
  5904. "Project": {
  5905. "type": "object",
  5906. "properties": {
  5907. "id": {
  5908. "type": "string"
  5909. },
  5910. "worktree": {
  5911. "type": "string"
  5912. },
  5913. "vcs": {
  5914. "type": "string",
  5915. "const": "git"
  5916. },
  5917. "name": {
  5918. "type": "string"
  5919. },
  5920. "icon": {
  5921. "type": "object",
  5922. "properties": {
  5923. "url": {
  5924. "type": "string"
  5925. },
  5926. "override": {
  5927. "type": "string"
  5928. },
  5929. "color": {
  5930. "type": "string"
  5931. }
  5932. }
  5933. },
  5934. "commands": {
  5935. "type": "object",
  5936. "properties": {
  5937. "start": {
  5938. "description": "Startup script to run when creating a new workspace (worktree)",
  5939. "type": "string"
  5940. }
  5941. }
  5942. },
  5943. "time": {
  5944. "type": "object",
  5945. "properties": {
  5946. "created": {
  5947. "type": "number"
  5948. },
  5949. "updated": {
  5950. "type": "number"
  5951. },
  5952. "initialized": {
  5953. "type": "number"
  5954. }
  5955. },
  5956. "required": ["created", "updated"]
  5957. },
  5958. "sandboxes": {
  5959. "type": "array",
  5960. "items": {
  5961. "type": "string"
  5962. }
  5963. }
  5964. },
  5965. "required": ["id", "worktree", "time", "sandboxes"]
  5966. },
  5967. "Event.project.updated": {
  5968. "type": "object",
  5969. "properties": {
  5970. "type": {
  5971. "type": "string",
  5972. "const": "project.updated"
  5973. },
  5974. "properties": {
  5975. "$ref": "#/components/schemas/Project"
  5976. }
  5977. },
  5978. "required": ["type", "properties"]
  5979. },
  5980. "Event.server.instance.disposed": {
  5981. "type": "object",
  5982. "properties": {
  5983. "type": {
  5984. "type": "string",
  5985. "const": "server.instance.disposed"
  5986. },
  5987. "properties": {
  5988. "type": "object",
  5989. "properties": {
  5990. "directory": {
  5991. "type": "string"
  5992. }
  5993. },
  5994. "required": ["directory"]
  5995. }
  5996. },
  5997. "required": ["type", "properties"]
  5998. },
  5999. "Event.server.connected": {
  6000. "type": "object",
  6001. "properties": {
  6002. "type": {
  6003. "type": "string",
  6004. "const": "server.connected"
  6005. },
  6006. "properties": {
  6007. "type": "object",
  6008. "properties": {}
  6009. }
  6010. },
  6011. "required": ["type", "properties"]
  6012. },
  6013. "Event.global.disposed": {
  6014. "type": "object",
  6015. "properties": {
  6016. "type": {
  6017. "type": "string",
  6018. "const": "global.disposed"
  6019. },
  6020. "properties": {
  6021. "type": "object",
  6022. "properties": {}
  6023. }
  6024. },
  6025. "required": ["type", "properties"]
  6026. },
  6027. "Event.lsp.client.diagnostics": {
  6028. "type": "object",
  6029. "properties": {
  6030. "type": {
  6031. "type": "string",
  6032. "const": "lsp.client.diagnostics"
  6033. },
  6034. "properties": {
  6035. "type": "object",
  6036. "properties": {
  6037. "serverID": {
  6038. "type": "string"
  6039. },
  6040. "path": {
  6041. "type": "string"
  6042. }
  6043. },
  6044. "required": ["serverID", "path"]
  6045. }
  6046. },
  6047. "required": ["type", "properties"]
  6048. },
  6049. "Event.lsp.updated": {
  6050. "type": "object",
  6051. "properties": {
  6052. "type": {
  6053. "type": "string",
  6054. "const": "lsp.updated"
  6055. },
  6056. "properties": {
  6057. "type": "object",
  6058. "properties": {}
  6059. }
  6060. },
  6061. "required": ["type", "properties"]
  6062. },
  6063. "Event.file.edited": {
  6064. "type": "object",
  6065. "properties": {
  6066. "type": {
  6067. "type": "string",
  6068. "const": "file.edited"
  6069. },
  6070. "properties": {
  6071. "type": "object",
  6072. "properties": {
  6073. "file": {
  6074. "type": "string"
  6075. }
  6076. },
  6077. "required": ["file"]
  6078. }
  6079. },
  6080. "required": ["type", "properties"]
  6081. },
  6082. "OutputFormatText": {
  6083. "type": "object",
  6084. "properties": {
  6085. "type": {
  6086. "type": "string",
  6087. "const": "text"
  6088. }
  6089. },
  6090. "required": ["type"]
  6091. },
  6092. "JSONSchema": {
  6093. "type": "object",
  6094. "propertyNames": {
  6095. "type": "string"
  6096. },
  6097. "additionalProperties": {}
  6098. },
  6099. "OutputFormatJsonSchema": {
  6100. "type": "object",
  6101. "properties": {
  6102. "type": {
  6103. "type": "string",
  6104. "const": "json_schema"
  6105. },
  6106. "schema": {
  6107. "$ref": "#/components/schemas/JSONSchema"
  6108. },
  6109. "retryCount": {
  6110. "default": 2,
  6111. "type": "integer",
  6112. "minimum": 0,
  6113. "maximum": 9007199254740991
  6114. }
  6115. },
  6116. "required": ["type", "schema"]
  6117. },
  6118. "OutputFormat": {
  6119. "anyOf": [
  6120. {
  6121. "$ref": "#/components/schemas/OutputFormatText"
  6122. },
  6123. {
  6124. "$ref": "#/components/schemas/OutputFormatJsonSchema"
  6125. }
  6126. ]
  6127. },
  6128. "FileDiff": {
  6129. "type": "object",
  6130. "properties": {
  6131. "file": {
  6132. "type": "string"
  6133. },
  6134. "before": {
  6135. "type": "string"
  6136. },
  6137. "after": {
  6138. "type": "string"
  6139. },
  6140. "additions": {
  6141. "type": "number"
  6142. },
  6143. "deletions": {
  6144. "type": "number"
  6145. },
  6146. "status": {
  6147. "type": "string",
  6148. "enum": ["added", "deleted", "modified"]
  6149. }
  6150. },
  6151. "required": ["file", "before", "after", "additions", "deletions"]
  6152. },
  6153. "UserMessage": {
  6154. "type": "object",
  6155. "properties": {
  6156. "id": {
  6157. "type": "string"
  6158. },
  6159. "sessionID": {
  6160. "type": "string"
  6161. },
  6162. "role": {
  6163. "type": "string",
  6164. "const": "user"
  6165. },
  6166. "time": {
  6167. "type": "object",
  6168. "properties": {
  6169. "created": {
  6170. "type": "number"
  6171. }
  6172. },
  6173. "required": ["created"]
  6174. },
  6175. "format": {
  6176. "$ref": "#/components/schemas/OutputFormat"
  6177. },
  6178. "summary": {
  6179. "type": "object",
  6180. "properties": {
  6181. "title": {
  6182. "type": "string"
  6183. },
  6184. "body": {
  6185. "type": "string"
  6186. },
  6187. "diffs": {
  6188. "type": "array",
  6189. "items": {
  6190. "$ref": "#/components/schemas/FileDiff"
  6191. }
  6192. }
  6193. },
  6194. "required": ["diffs"]
  6195. },
  6196. "agent": {
  6197. "type": "string"
  6198. },
  6199. "model": {
  6200. "type": "object",
  6201. "properties": {
  6202. "providerID": {
  6203. "type": "string"
  6204. },
  6205. "modelID": {
  6206. "type": "string"
  6207. }
  6208. },
  6209. "required": ["providerID", "modelID"]
  6210. },
  6211. "system": {
  6212. "type": "string"
  6213. },
  6214. "tools": {
  6215. "type": "object",
  6216. "propertyNames": {
  6217. "type": "string"
  6218. },
  6219. "additionalProperties": {
  6220. "type": "boolean"
  6221. }
  6222. },
  6223. "variant": {
  6224. "type": "string"
  6225. }
  6226. },
  6227. "required": ["id", "sessionID", "role", "time", "agent", "model"]
  6228. },
  6229. "ProviderAuthError": {
  6230. "type": "object",
  6231. "properties": {
  6232. "name": {
  6233. "type": "string",
  6234. "const": "ProviderAuthError"
  6235. },
  6236. "data": {
  6237. "type": "object",
  6238. "properties": {
  6239. "providerID": {
  6240. "type": "string"
  6241. },
  6242. "message": {
  6243. "type": "string"
  6244. }
  6245. },
  6246. "required": ["providerID", "message"]
  6247. }
  6248. },
  6249. "required": ["name", "data"]
  6250. },
  6251. "UnknownError": {
  6252. "type": "object",
  6253. "properties": {
  6254. "name": {
  6255. "type": "string",
  6256. "const": "UnknownError"
  6257. },
  6258. "data": {
  6259. "type": "object",
  6260. "properties": {
  6261. "message": {
  6262. "type": "string"
  6263. }
  6264. },
  6265. "required": ["message"]
  6266. }
  6267. },
  6268. "required": ["name", "data"]
  6269. },
  6270. "MessageOutputLengthError": {
  6271. "type": "object",
  6272. "properties": {
  6273. "name": {
  6274. "type": "string",
  6275. "const": "MessageOutputLengthError"
  6276. },
  6277. "data": {
  6278. "type": "object",
  6279. "properties": {}
  6280. }
  6281. },
  6282. "required": ["name", "data"]
  6283. },
  6284. "MessageAbortedError": {
  6285. "type": "object",
  6286. "properties": {
  6287. "name": {
  6288. "type": "string",
  6289. "const": "MessageAbortedError"
  6290. },
  6291. "data": {
  6292. "type": "object",
  6293. "properties": {
  6294. "message": {
  6295. "type": "string"
  6296. }
  6297. },
  6298. "required": ["message"]
  6299. }
  6300. },
  6301. "required": ["name", "data"]
  6302. },
  6303. "StructuredOutputError": {
  6304. "type": "object",
  6305. "properties": {
  6306. "name": {
  6307. "type": "string",
  6308. "const": "StructuredOutputError"
  6309. },
  6310. "data": {
  6311. "type": "object",
  6312. "properties": {
  6313. "message": {
  6314. "type": "string"
  6315. },
  6316. "retries": {
  6317. "type": "number"
  6318. }
  6319. },
  6320. "required": ["message", "retries"]
  6321. }
  6322. },
  6323. "required": ["name", "data"]
  6324. },
  6325. "ContextOverflowError": {
  6326. "type": "object",
  6327. "properties": {
  6328. "name": {
  6329. "type": "string",
  6330. "const": "ContextOverflowError"
  6331. },
  6332. "data": {
  6333. "type": "object",
  6334. "properties": {
  6335. "message": {
  6336. "type": "string"
  6337. },
  6338. "responseBody": {
  6339. "type": "string"
  6340. }
  6341. },
  6342. "required": ["message"]
  6343. }
  6344. },
  6345. "required": ["name", "data"]
  6346. },
  6347. "APIError": {
  6348. "type": "object",
  6349. "properties": {
  6350. "name": {
  6351. "type": "string",
  6352. "const": "APIError"
  6353. },
  6354. "data": {
  6355. "type": "object",
  6356. "properties": {
  6357. "message": {
  6358. "type": "string"
  6359. },
  6360. "statusCode": {
  6361. "type": "number"
  6362. },
  6363. "isRetryable": {
  6364. "type": "boolean"
  6365. },
  6366. "responseHeaders": {
  6367. "type": "object",
  6368. "propertyNames": {
  6369. "type": "string"
  6370. },
  6371. "additionalProperties": {
  6372. "type": "string"
  6373. }
  6374. },
  6375. "responseBody": {
  6376. "type": "string"
  6377. },
  6378. "metadata": {
  6379. "type": "object",
  6380. "propertyNames": {
  6381. "type": "string"
  6382. },
  6383. "additionalProperties": {
  6384. "type": "string"
  6385. }
  6386. }
  6387. },
  6388. "required": ["message", "isRetryable"]
  6389. }
  6390. },
  6391. "required": ["name", "data"]
  6392. },
  6393. "AssistantMessage": {
  6394. "type": "object",
  6395. "properties": {
  6396. "id": {
  6397. "type": "string"
  6398. },
  6399. "sessionID": {
  6400. "type": "string"
  6401. },
  6402. "role": {
  6403. "type": "string",
  6404. "const": "assistant"
  6405. },
  6406. "time": {
  6407. "type": "object",
  6408. "properties": {
  6409. "created": {
  6410. "type": "number"
  6411. },
  6412. "completed": {
  6413. "type": "number"
  6414. }
  6415. },
  6416. "required": ["created"]
  6417. },
  6418. "error": {
  6419. "anyOf": [
  6420. {
  6421. "$ref": "#/components/schemas/ProviderAuthError"
  6422. },
  6423. {
  6424. "$ref": "#/components/schemas/UnknownError"
  6425. },
  6426. {
  6427. "$ref": "#/components/schemas/MessageOutputLengthError"
  6428. },
  6429. {
  6430. "$ref": "#/components/schemas/MessageAbortedError"
  6431. },
  6432. {
  6433. "$ref": "#/components/schemas/StructuredOutputError"
  6434. },
  6435. {
  6436. "$ref": "#/components/schemas/ContextOverflowError"
  6437. },
  6438. {
  6439. "$ref": "#/components/schemas/APIError"
  6440. }
  6441. ]
  6442. },
  6443. "parentID": {
  6444. "type": "string"
  6445. },
  6446. "modelID": {
  6447. "type": "string"
  6448. },
  6449. "providerID": {
  6450. "type": "string"
  6451. },
  6452. "mode": {
  6453. "type": "string"
  6454. },
  6455. "agent": {
  6456. "type": "string"
  6457. },
  6458. "path": {
  6459. "type": "object",
  6460. "properties": {
  6461. "cwd": {
  6462. "type": "string"
  6463. },
  6464. "root": {
  6465. "type": "string"
  6466. }
  6467. },
  6468. "required": ["cwd", "root"]
  6469. },
  6470. "summary": {
  6471. "type": "boolean"
  6472. },
  6473. "cost": {
  6474. "type": "number"
  6475. },
  6476. "tokens": {
  6477. "type": "object",
  6478. "properties": {
  6479. "total": {
  6480. "type": "number"
  6481. },
  6482. "input": {
  6483. "type": "number"
  6484. },
  6485. "output": {
  6486. "type": "number"
  6487. },
  6488. "reasoning": {
  6489. "type": "number"
  6490. },
  6491. "cache": {
  6492. "type": "object",
  6493. "properties": {
  6494. "read": {
  6495. "type": "number"
  6496. },
  6497. "write": {
  6498. "type": "number"
  6499. }
  6500. },
  6501. "required": ["read", "write"]
  6502. }
  6503. },
  6504. "required": ["input", "output", "reasoning", "cache"]
  6505. },
  6506. "structured": {},
  6507. "variant": {
  6508. "type": "string"
  6509. },
  6510. "finish": {
  6511. "type": "string"
  6512. }
  6513. },
  6514. "required": [
  6515. "id",
  6516. "sessionID",
  6517. "role",
  6518. "time",
  6519. "parentID",
  6520. "modelID",
  6521. "providerID",
  6522. "mode",
  6523. "agent",
  6524. "path",
  6525. "cost",
  6526. "tokens"
  6527. ]
  6528. },
  6529. "Message": {
  6530. "anyOf": [
  6531. {
  6532. "$ref": "#/components/schemas/UserMessage"
  6533. },
  6534. {
  6535. "$ref": "#/components/schemas/AssistantMessage"
  6536. }
  6537. ]
  6538. },
  6539. "Event.message.updated": {
  6540. "type": "object",
  6541. "properties": {
  6542. "type": {
  6543. "type": "string",
  6544. "const": "message.updated"
  6545. },
  6546. "properties": {
  6547. "type": "object",
  6548. "properties": {
  6549. "info": {
  6550. "$ref": "#/components/schemas/Message"
  6551. }
  6552. },
  6553. "required": ["info"]
  6554. }
  6555. },
  6556. "required": ["type", "properties"]
  6557. },
  6558. "Event.message.removed": {
  6559. "type": "object",
  6560. "properties": {
  6561. "type": {
  6562. "type": "string",
  6563. "const": "message.removed"
  6564. },
  6565. "properties": {
  6566. "type": "object",
  6567. "properties": {
  6568. "sessionID": {
  6569. "type": "string"
  6570. },
  6571. "messageID": {
  6572. "type": "string"
  6573. }
  6574. },
  6575. "required": ["sessionID", "messageID"]
  6576. }
  6577. },
  6578. "required": ["type", "properties"]
  6579. },
  6580. "TextPart": {
  6581. "type": "object",
  6582. "properties": {
  6583. "id": {
  6584. "type": "string"
  6585. },
  6586. "sessionID": {
  6587. "type": "string"
  6588. },
  6589. "messageID": {
  6590. "type": "string"
  6591. },
  6592. "type": {
  6593. "type": "string",
  6594. "const": "text"
  6595. },
  6596. "text": {
  6597. "type": "string"
  6598. },
  6599. "synthetic": {
  6600. "type": "boolean"
  6601. },
  6602. "ignored": {
  6603. "type": "boolean"
  6604. },
  6605. "time": {
  6606. "type": "object",
  6607. "properties": {
  6608. "start": {
  6609. "type": "number"
  6610. },
  6611. "end": {
  6612. "type": "number"
  6613. }
  6614. },
  6615. "required": ["start"]
  6616. },
  6617. "metadata": {
  6618. "type": "object",
  6619. "propertyNames": {
  6620. "type": "string"
  6621. },
  6622. "additionalProperties": {}
  6623. }
  6624. },
  6625. "required": ["id", "sessionID", "messageID", "type", "text"]
  6626. },
  6627. "SubtaskPart": {
  6628. "type": "object",
  6629. "properties": {
  6630. "id": {
  6631. "type": "string"
  6632. },
  6633. "sessionID": {
  6634. "type": "string"
  6635. },
  6636. "messageID": {
  6637. "type": "string"
  6638. },
  6639. "type": {
  6640. "type": "string",
  6641. "const": "subtask"
  6642. },
  6643. "prompt": {
  6644. "type": "string"
  6645. },
  6646. "description": {
  6647. "type": "string"
  6648. },
  6649. "agent": {
  6650. "type": "string"
  6651. },
  6652. "model": {
  6653. "type": "object",
  6654. "properties": {
  6655. "providerID": {
  6656. "type": "string"
  6657. },
  6658. "modelID": {
  6659. "type": "string"
  6660. }
  6661. },
  6662. "required": ["providerID", "modelID"]
  6663. },
  6664. "command": {
  6665. "type": "string"
  6666. }
  6667. },
  6668. "required": ["id", "sessionID", "messageID", "type", "prompt", "description", "agent"]
  6669. },
  6670. "ReasoningPart": {
  6671. "type": "object",
  6672. "properties": {
  6673. "id": {
  6674. "type": "string"
  6675. },
  6676. "sessionID": {
  6677. "type": "string"
  6678. },
  6679. "messageID": {
  6680. "type": "string"
  6681. },
  6682. "type": {
  6683. "type": "string",
  6684. "const": "reasoning"
  6685. },
  6686. "text": {
  6687. "type": "string"
  6688. },
  6689. "metadata": {
  6690. "type": "object",
  6691. "propertyNames": {
  6692. "type": "string"
  6693. },
  6694. "additionalProperties": {}
  6695. },
  6696. "time": {
  6697. "type": "object",
  6698. "properties": {
  6699. "start": {
  6700. "type": "number"
  6701. },
  6702. "end": {
  6703. "type": "number"
  6704. }
  6705. },
  6706. "required": ["start"]
  6707. }
  6708. },
  6709. "required": ["id", "sessionID", "messageID", "type", "text", "time"]
  6710. },
  6711. "FilePartSourceText": {
  6712. "type": "object",
  6713. "properties": {
  6714. "value": {
  6715. "type": "string"
  6716. },
  6717. "start": {
  6718. "type": "integer",
  6719. "minimum": -9007199254740991,
  6720. "maximum": 9007199254740991
  6721. },
  6722. "end": {
  6723. "type": "integer",
  6724. "minimum": -9007199254740991,
  6725. "maximum": 9007199254740991
  6726. }
  6727. },
  6728. "required": ["value", "start", "end"]
  6729. },
  6730. "FileSource": {
  6731. "type": "object",
  6732. "properties": {
  6733. "text": {
  6734. "$ref": "#/components/schemas/FilePartSourceText"
  6735. },
  6736. "type": {
  6737. "type": "string",
  6738. "const": "file"
  6739. },
  6740. "path": {
  6741. "type": "string"
  6742. }
  6743. },
  6744. "required": ["text", "type", "path"]
  6745. },
  6746. "Range": {
  6747. "type": "object",
  6748. "properties": {
  6749. "start": {
  6750. "type": "object",
  6751. "properties": {
  6752. "line": {
  6753. "type": "number"
  6754. },
  6755. "character": {
  6756. "type": "number"
  6757. }
  6758. },
  6759. "required": ["line", "character"]
  6760. },
  6761. "end": {
  6762. "type": "object",
  6763. "properties": {
  6764. "line": {
  6765. "type": "number"
  6766. },
  6767. "character": {
  6768. "type": "number"
  6769. }
  6770. },
  6771. "required": ["line", "character"]
  6772. }
  6773. },
  6774. "required": ["start", "end"]
  6775. },
  6776. "SymbolSource": {
  6777. "type": "object",
  6778. "properties": {
  6779. "text": {
  6780. "$ref": "#/components/schemas/FilePartSourceText"
  6781. },
  6782. "type": {
  6783. "type": "string",
  6784. "const": "symbol"
  6785. },
  6786. "path": {
  6787. "type": "string"
  6788. },
  6789. "range": {
  6790. "$ref": "#/components/schemas/Range"
  6791. },
  6792. "name": {
  6793. "type": "string"
  6794. },
  6795. "kind": {
  6796. "type": "integer",
  6797. "minimum": -9007199254740991,
  6798. "maximum": 9007199254740991
  6799. }
  6800. },
  6801. "required": ["text", "type", "path", "range", "name", "kind"]
  6802. },
  6803. "ResourceSource": {
  6804. "type": "object",
  6805. "properties": {
  6806. "text": {
  6807. "$ref": "#/components/schemas/FilePartSourceText"
  6808. },
  6809. "type": {
  6810. "type": "string",
  6811. "const": "resource"
  6812. },
  6813. "clientName": {
  6814. "type": "string"
  6815. },
  6816. "uri": {
  6817. "type": "string"
  6818. }
  6819. },
  6820. "required": ["text", "type", "clientName", "uri"]
  6821. },
  6822. "FilePartSource": {
  6823. "anyOf": [
  6824. {
  6825. "$ref": "#/components/schemas/FileSource"
  6826. },
  6827. {
  6828. "$ref": "#/components/schemas/SymbolSource"
  6829. },
  6830. {
  6831. "$ref": "#/components/schemas/ResourceSource"
  6832. }
  6833. ]
  6834. },
  6835. "FilePart": {
  6836. "type": "object",
  6837. "properties": {
  6838. "id": {
  6839. "type": "string"
  6840. },
  6841. "sessionID": {
  6842. "type": "string"
  6843. },
  6844. "messageID": {
  6845. "type": "string"
  6846. },
  6847. "type": {
  6848. "type": "string",
  6849. "const": "file"
  6850. },
  6851. "mime": {
  6852. "type": "string"
  6853. },
  6854. "filename": {
  6855. "type": "string"
  6856. },
  6857. "url": {
  6858. "type": "string"
  6859. },
  6860. "source": {
  6861. "$ref": "#/components/schemas/FilePartSource"
  6862. }
  6863. },
  6864. "required": ["id", "sessionID", "messageID", "type", "mime", "url"]
  6865. },
  6866. "ToolStatePending": {
  6867. "type": "object",
  6868. "properties": {
  6869. "status": {
  6870. "type": "string",
  6871. "const": "pending"
  6872. },
  6873. "input": {
  6874. "type": "object",
  6875. "propertyNames": {
  6876. "type": "string"
  6877. },
  6878. "additionalProperties": {}
  6879. },
  6880. "raw": {
  6881. "type": "string"
  6882. }
  6883. },
  6884. "required": ["status", "input", "raw"]
  6885. },
  6886. "ToolStateRunning": {
  6887. "type": "object",
  6888. "properties": {
  6889. "status": {
  6890. "type": "string",
  6891. "const": "running"
  6892. },
  6893. "input": {
  6894. "type": "object",
  6895. "propertyNames": {
  6896. "type": "string"
  6897. },
  6898. "additionalProperties": {}
  6899. },
  6900. "title": {
  6901. "type": "string"
  6902. },
  6903. "metadata": {
  6904. "type": "object",
  6905. "propertyNames": {
  6906. "type": "string"
  6907. },
  6908. "additionalProperties": {}
  6909. },
  6910. "time": {
  6911. "type": "object",
  6912. "properties": {
  6913. "start": {
  6914. "type": "number"
  6915. }
  6916. },
  6917. "required": ["start"]
  6918. }
  6919. },
  6920. "required": ["status", "input", "time"]
  6921. },
  6922. "ToolStateCompleted": {
  6923. "type": "object",
  6924. "properties": {
  6925. "status": {
  6926. "type": "string",
  6927. "const": "completed"
  6928. },
  6929. "input": {
  6930. "type": "object",
  6931. "propertyNames": {
  6932. "type": "string"
  6933. },
  6934. "additionalProperties": {}
  6935. },
  6936. "output": {
  6937. "type": "string"
  6938. },
  6939. "title": {
  6940. "type": "string"
  6941. },
  6942. "metadata": {
  6943. "type": "object",
  6944. "propertyNames": {
  6945. "type": "string"
  6946. },
  6947. "additionalProperties": {}
  6948. },
  6949. "time": {
  6950. "type": "object",
  6951. "properties": {
  6952. "start": {
  6953. "type": "number"
  6954. },
  6955. "end": {
  6956. "type": "number"
  6957. },
  6958. "compacted": {
  6959. "type": "number"
  6960. }
  6961. },
  6962. "required": ["start", "end"]
  6963. },
  6964. "attachments": {
  6965. "type": "array",
  6966. "items": {
  6967. "$ref": "#/components/schemas/FilePart"
  6968. }
  6969. }
  6970. },
  6971. "required": ["status", "input", "output", "title", "metadata", "time"]
  6972. },
  6973. "ToolStateError": {
  6974. "type": "object",
  6975. "properties": {
  6976. "status": {
  6977. "type": "string",
  6978. "const": "error"
  6979. },
  6980. "input": {
  6981. "type": "object",
  6982. "propertyNames": {
  6983. "type": "string"
  6984. },
  6985. "additionalProperties": {}
  6986. },
  6987. "error": {
  6988. "type": "string"
  6989. },
  6990. "metadata": {
  6991. "type": "object",
  6992. "propertyNames": {
  6993. "type": "string"
  6994. },
  6995. "additionalProperties": {}
  6996. },
  6997. "time": {
  6998. "type": "object",
  6999. "properties": {
  7000. "start": {
  7001. "type": "number"
  7002. },
  7003. "end": {
  7004. "type": "number"
  7005. }
  7006. },
  7007. "required": ["start", "end"]
  7008. }
  7009. },
  7010. "required": ["status", "input", "error", "time"]
  7011. },
  7012. "ToolState": {
  7013. "anyOf": [
  7014. {
  7015. "$ref": "#/components/schemas/ToolStatePending"
  7016. },
  7017. {
  7018. "$ref": "#/components/schemas/ToolStateRunning"
  7019. },
  7020. {
  7021. "$ref": "#/components/schemas/ToolStateCompleted"
  7022. },
  7023. {
  7024. "$ref": "#/components/schemas/ToolStateError"
  7025. }
  7026. ]
  7027. },
  7028. "ToolPart": {
  7029. "type": "object",
  7030. "properties": {
  7031. "id": {
  7032. "type": "string"
  7033. },
  7034. "sessionID": {
  7035. "type": "string"
  7036. },
  7037. "messageID": {
  7038. "type": "string"
  7039. },
  7040. "type": {
  7041. "type": "string",
  7042. "const": "tool"
  7043. },
  7044. "callID": {
  7045. "type": "string"
  7046. },
  7047. "tool": {
  7048. "type": "string"
  7049. },
  7050. "state": {
  7051. "$ref": "#/components/schemas/ToolState"
  7052. },
  7053. "metadata": {
  7054. "type": "object",
  7055. "propertyNames": {
  7056. "type": "string"
  7057. },
  7058. "additionalProperties": {}
  7059. }
  7060. },
  7061. "required": ["id", "sessionID", "messageID", "type", "callID", "tool", "state"]
  7062. },
  7063. "StepStartPart": {
  7064. "type": "object",
  7065. "properties": {
  7066. "id": {
  7067. "type": "string"
  7068. },
  7069. "sessionID": {
  7070. "type": "string"
  7071. },
  7072. "messageID": {
  7073. "type": "string"
  7074. },
  7075. "type": {
  7076. "type": "string",
  7077. "const": "step-start"
  7078. },
  7079. "snapshot": {
  7080. "type": "string"
  7081. }
  7082. },
  7083. "required": ["id", "sessionID", "messageID", "type"]
  7084. },
  7085. "StepFinishPart": {
  7086. "type": "object",
  7087. "properties": {
  7088. "id": {
  7089. "type": "string"
  7090. },
  7091. "sessionID": {
  7092. "type": "string"
  7093. },
  7094. "messageID": {
  7095. "type": "string"
  7096. },
  7097. "type": {
  7098. "type": "string",
  7099. "const": "step-finish"
  7100. },
  7101. "reason": {
  7102. "type": "string"
  7103. },
  7104. "snapshot": {
  7105. "type": "string"
  7106. },
  7107. "cost": {
  7108. "type": "number"
  7109. },
  7110. "tokens": {
  7111. "type": "object",
  7112. "properties": {
  7113. "total": {
  7114. "type": "number"
  7115. },
  7116. "input": {
  7117. "type": "number"
  7118. },
  7119. "output": {
  7120. "type": "number"
  7121. },
  7122. "reasoning": {
  7123. "type": "number"
  7124. },
  7125. "cache": {
  7126. "type": "object",
  7127. "properties": {
  7128. "read": {
  7129. "type": "number"
  7130. },
  7131. "write": {
  7132. "type": "number"
  7133. }
  7134. },
  7135. "required": ["read", "write"]
  7136. }
  7137. },
  7138. "required": ["input", "output", "reasoning", "cache"]
  7139. }
  7140. },
  7141. "required": ["id", "sessionID", "messageID", "type", "reason", "cost", "tokens"]
  7142. },
  7143. "SnapshotPart": {
  7144. "type": "object",
  7145. "properties": {
  7146. "id": {
  7147. "type": "string"
  7148. },
  7149. "sessionID": {
  7150. "type": "string"
  7151. },
  7152. "messageID": {
  7153. "type": "string"
  7154. },
  7155. "type": {
  7156. "type": "string",
  7157. "const": "snapshot"
  7158. },
  7159. "snapshot": {
  7160. "type": "string"
  7161. }
  7162. },
  7163. "required": ["id", "sessionID", "messageID", "type", "snapshot"]
  7164. },
  7165. "PatchPart": {
  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": "patch"
  7180. },
  7181. "hash": {
  7182. "type": "string"
  7183. },
  7184. "files": {
  7185. "type": "array",
  7186. "items": {
  7187. "type": "string"
  7188. }
  7189. }
  7190. },
  7191. "required": ["id", "sessionID", "messageID", "type", "hash", "files"]
  7192. },
  7193. "AgentPart": {
  7194. "type": "object",
  7195. "properties": {
  7196. "id": {
  7197. "type": "string"
  7198. },
  7199. "sessionID": {
  7200. "type": "string"
  7201. },
  7202. "messageID": {
  7203. "type": "string"
  7204. },
  7205. "type": {
  7206. "type": "string",
  7207. "const": "agent"
  7208. },
  7209. "name": {
  7210. "type": "string"
  7211. },
  7212. "source": {
  7213. "type": "object",
  7214. "properties": {
  7215. "value": {
  7216. "type": "string"
  7217. },
  7218. "start": {
  7219. "type": "integer",
  7220. "minimum": -9007199254740991,
  7221. "maximum": 9007199254740991
  7222. },
  7223. "end": {
  7224. "type": "integer",
  7225. "minimum": -9007199254740991,
  7226. "maximum": 9007199254740991
  7227. }
  7228. },
  7229. "required": ["value", "start", "end"]
  7230. }
  7231. },
  7232. "required": ["id", "sessionID", "messageID", "type", "name"]
  7233. },
  7234. "RetryPart": {
  7235. "type": "object",
  7236. "properties": {
  7237. "id": {
  7238. "type": "string"
  7239. },
  7240. "sessionID": {
  7241. "type": "string"
  7242. },
  7243. "messageID": {
  7244. "type": "string"
  7245. },
  7246. "type": {
  7247. "type": "string",
  7248. "const": "retry"
  7249. },
  7250. "attempt": {
  7251. "type": "number"
  7252. },
  7253. "error": {
  7254. "$ref": "#/components/schemas/APIError"
  7255. },
  7256. "time": {
  7257. "type": "object",
  7258. "properties": {
  7259. "created": {
  7260. "type": "number"
  7261. }
  7262. },
  7263. "required": ["created"]
  7264. }
  7265. },
  7266. "required": ["id", "sessionID", "messageID", "type", "attempt", "error", "time"]
  7267. },
  7268. "CompactionPart": {
  7269. "type": "object",
  7270. "properties": {
  7271. "id": {
  7272. "type": "string"
  7273. },
  7274. "sessionID": {
  7275. "type": "string"
  7276. },
  7277. "messageID": {
  7278. "type": "string"
  7279. },
  7280. "type": {
  7281. "type": "string",
  7282. "const": "compaction"
  7283. },
  7284. "auto": {
  7285. "type": "boolean"
  7286. }
  7287. },
  7288. "required": ["id", "sessionID", "messageID", "type", "auto"]
  7289. },
  7290. "Part": {
  7291. "anyOf": [
  7292. {
  7293. "$ref": "#/components/schemas/TextPart"
  7294. },
  7295. {
  7296. "$ref": "#/components/schemas/SubtaskPart"
  7297. },
  7298. {
  7299. "$ref": "#/components/schemas/ReasoningPart"
  7300. },
  7301. {
  7302. "$ref": "#/components/schemas/FilePart"
  7303. },
  7304. {
  7305. "$ref": "#/components/schemas/ToolPart"
  7306. },
  7307. {
  7308. "$ref": "#/components/schemas/StepStartPart"
  7309. },
  7310. {
  7311. "$ref": "#/components/schemas/StepFinishPart"
  7312. },
  7313. {
  7314. "$ref": "#/components/schemas/SnapshotPart"
  7315. },
  7316. {
  7317. "$ref": "#/components/schemas/PatchPart"
  7318. },
  7319. {
  7320. "$ref": "#/components/schemas/AgentPart"
  7321. },
  7322. {
  7323. "$ref": "#/components/schemas/RetryPart"
  7324. },
  7325. {
  7326. "$ref": "#/components/schemas/CompactionPart"
  7327. }
  7328. ]
  7329. },
  7330. "Event.message.part.updated": {
  7331. "type": "object",
  7332. "properties": {
  7333. "type": {
  7334. "type": "string",
  7335. "const": "message.part.updated"
  7336. },
  7337. "properties": {
  7338. "type": "object",
  7339. "properties": {
  7340. "part": {
  7341. "$ref": "#/components/schemas/Part"
  7342. },
  7343. "delta": {
  7344. "type": "string"
  7345. }
  7346. },
  7347. "required": ["part"]
  7348. }
  7349. },
  7350. "required": ["type", "properties"]
  7351. },
  7352. "Event.message.part.removed": {
  7353. "type": "object",
  7354. "properties": {
  7355. "type": {
  7356. "type": "string",
  7357. "const": "message.part.removed"
  7358. },
  7359. "properties": {
  7360. "type": "object",
  7361. "properties": {
  7362. "sessionID": {
  7363. "type": "string"
  7364. },
  7365. "messageID": {
  7366. "type": "string"
  7367. },
  7368. "partID": {
  7369. "type": "string"
  7370. }
  7371. },
  7372. "required": ["sessionID", "messageID", "partID"]
  7373. }
  7374. },
  7375. "required": ["type", "properties"]
  7376. },
  7377. "PermissionRequest": {
  7378. "type": "object",
  7379. "properties": {
  7380. "id": {
  7381. "type": "string",
  7382. "pattern": "^per.*"
  7383. },
  7384. "sessionID": {
  7385. "type": "string",
  7386. "pattern": "^ses.*"
  7387. },
  7388. "permission": {
  7389. "type": "string"
  7390. },
  7391. "patterns": {
  7392. "type": "array",
  7393. "items": {
  7394. "type": "string"
  7395. }
  7396. },
  7397. "metadata": {
  7398. "type": "object",
  7399. "propertyNames": {
  7400. "type": "string"
  7401. },
  7402. "additionalProperties": {}
  7403. },
  7404. "always": {
  7405. "type": "array",
  7406. "items": {
  7407. "type": "string"
  7408. }
  7409. },
  7410. "tool": {
  7411. "type": "object",
  7412. "properties": {
  7413. "messageID": {
  7414. "type": "string"
  7415. },
  7416. "callID": {
  7417. "type": "string"
  7418. }
  7419. },
  7420. "required": ["messageID", "callID"]
  7421. }
  7422. },
  7423. "required": ["id", "sessionID", "permission", "patterns", "metadata", "always"]
  7424. },
  7425. "Event.permission.asked": {
  7426. "type": "object",
  7427. "properties": {
  7428. "type": {
  7429. "type": "string",
  7430. "const": "permission.asked"
  7431. },
  7432. "properties": {
  7433. "$ref": "#/components/schemas/PermissionRequest"
  7434. }
  7435. },
  7436. "required": ["type", "properties"]
  7437. },
  7438. "Event.permission.replied": {
  7439. "type": "object",
  7440. "properties": {
  7441. "type": {
  7442. "type": "string",
  7443. "const": "permission.replied"
  7444. },
  7445. "properties": {
  7446. "type": "object",
  7447. "properties": {
  7448. "sessionID": {
  7449. "type": "string"
  7450. },
  7451. "requestID": {
  7452. "type": "string"
  7453. },
  7454. "reply": {
  7455. "type": "string",
  7456. "enum": ["once", "always", "reject"]
  7457. }
  7458. },
  7459. "required": ["sessionID", "requestID", "reply"]
  7460. }
  7461. },
  7462. "required": ["type", "properties"]
  7463. },
  7464. "SessionStatus": {
  7465. "anyOf": [
  7466. {
  7467. "type": "object",
  7468. "properties": {
  7469. "type": {
  7470. "type": "string",
  7471. "const": "idle"
  7472. }
  7473. },
  7474. "required": ["type"]
  7475. },
  7476. {
  7477. "type": "object",
  7478. "properties": {
  7479. "type": {
  7480. "type": "string",
  7481. "const": "retry"
  7482. },
  7483. "attempt": {
  7484. "type": "number"
  7485. },
  7486. "message": {
  7487. "type": "string"
  7488. },
  7489. "next": {
  7490. "type": "number"
  7491. }
  7492. },
  7493. "required": ["type", "attempt", "message", "next"]
  7494. },
  7495. {
  7496. "type": "object",
  7497. "properties": {
  7498. "type": {
  7499. "type": "string",
  7500. "const": "busy"
  7501. }
  7502. },
  7503. "required": ["type"]
  7504. }
  7505. ]
  7506. },
  7507. "Event.session.status": {
  7508. "type": "object",
  7509. "properties": {
  7510. "type": {
  7511. "type": "string",
  7512. "const": "session.status"
  7513. },
  7514. "properties": {
  7515. "type": "object",
  7516. "properties": {
  7517. "sessionID": {
  7518. "type": "string"
  7519. },
  7520. "status": {
  7521. "$ref": "#/components/schemas/SessionStatus"
  7522. }
  7523. },
  7524. "required": ["sessionID", "status"]
  7525. }
  7526. },
  7527. "required": ["type", "properties"]
  7528. },
  7529. "Event.session.idle": {
  7530. "type": "object",
  7531. "properties": {
  7532. "type": {
  7533. "type": "string",
  7534. "const": "session.idle"
  7535. },
  7536. "properties": {
  7537. "type": "object",
  7538. "properties": {
  7539. "sessionID": {
  7540. "type": "string"
  7541. }
  7542. },
  7543. "required": ["sessionID"]
  7544. }
  7545. },
  7546. "required": ["type", "properties"]
  7547. },
  7548. "QuestionOption": {
  7549. "type": "object",
  7550. "properties": {
  7551. "label": {
  7552. "description": "Display text (1-5 words, concise)",
  7553. "type": "string"
  7554. },
  7555. "description": {
  7556. "description": "Explanation of choice",
  7557. "type": "string"
  7558. }
  7559. },
  7560. "required": ["label", "description"]
  7561. },
  7562. "QuestionInfo": {
  7563. "type": "object",
  7564. "properties": {
  7565. "question": {
  7566. "description": "Complete question",
  7567. "type": "string"
  7568. },
  7569. "header": {
  7570. "description": "Very short label (max 30 chars)",
  7571. "type": "string"
  7572. },
  7573. "options": {
  7574. "description": "Available choices",
  7575. "type": "array",
  7576. "items": {
  7577. "$ref": "#/components/schemas/QuestionOption"
  7578. }
  7579. },
  7580. "multiple": {
  7581. "description": "Allow selecting multiple choices",
  7582. "type": "boolean"
  7583. },
  7584. "custom": {
  7585. "description": "Allow typing a custom answer (default: true)",
  7586. "type": "boolean"
  7587. }
  7588. },
  7589. "required": ["question", "header", "options"]
  7590. },
  7591. "QuestionRequest": {
  7592. "type": "object",
  7593. "properties": {
  7594. "id": {
  7595. "type": "string",
  7596. "pattern": "^que.*"
  7597. },
  7598. "sessionID": {
  7599. "type": "string",
  7600. "pattern": "^ses.*"
  7601. },
  7602. "questions": {
  7603. "description": "Questions to ask",
  7604. "type": "array",
  7605. "items": {
  7606. "$ref": "#/components/schemas/QuestionInfo"
  7607. }
  7608. },
  7609. "tool": {
  7610. "type": "object",
  7611. "properties": {
  7612. "messageID": {
  7613. "type": "string"
  7614. },
  7615. "callID": {
  7616. "type": "string"
  7617. }
  7618. },
  7619. "required": ["messageID", "callID"]
  7620. }
  7621. },
  7622. "required": ["id", "sessionID", "questions"]
  7623. },
  7624. "Event.question.asked": {
  7625. "type": "object",
  7626. "properties": {
  7627. "type": {
  7628. "type": "string",
  7629. "const": "question.asked"
  7630. },
  7631. "properties": {
  7632. "$ref": "#/components/schemas/QuestionRequest"
  7633. }
  7634. },
  7635. "required": ["type", "properties"]
  7636. },
  7637. "QuestionAnswer": {
  7638. "type": "array",
  7639. "items": {
  7640. "type": "string"
  7641. }
  7642. },
  7643. "Event.question.replied": {
  7644. "type": "object",
  7645. "properties": {
  7646. "type": {
  7647. "type": "string",
  7648. "const": "question.replied"
  7649. },
  7650. "properties": {
  7651. "type": "object",
  7652. "properties": {
  7653. "sessionID": {
  7654. "type": "string"
  7655. },
  7656. "requestID": {
  7657. "type": "string"
  7658. },
  7659. "answers": {
  7660. "type": "array",
  7661. "items": {
  7662. "$ref": "#/components/schemas/QuestionAnswer"
  7663. }
  7664. }
  7665. },
  7666. "required": ["sessionID", "requestID", "answers"]
  7667. }
  7668. },
  7669. "required": ["type", "properties"]
  7670. },
  7671. "Event.question.rejected": {
  7672. "type": "object",
  7673. "properties": {
  7674. "type": {
  7675. "type": "string",
  7676. "const": "question.rejected"
  7677. },
  7678. "properties": {
  7679. "type": "object",
  7680. "properties": {
  7681. "sessionID": {
  7682. "type": "string"
  7683. },
  7684. "requestID": {
  7685. "type": "string"
  7686. }
  7687. },
  7688. "required": ["sessionID", "requestID"]
  7689. }
  7690. },
  7691. "required": ["type", "properties"]
  7692. },
  7693. "Event.session.compacted": {
  7694. "type": "object",
  7695. "properties": {
  7696. "type": {
  7697. "type": "string",
  7698. "const": "session.compacted"
  7699. },
  7700. "properties": {
  7701. "type": "object",
  7702. "properties": {
  7703. "sessionID": {
  7704. "type": "string"
  7705. }
  7706. },
  7707. "required": ["sessionID"]
  7708. }
  7709. },
  7710. "required": ["type", "properties"]
  7711. },
  7712. "Event.file.watcher.updated": {
  7713. "type": "object",
  7714. "properties": {
  7715. "type": {
  7716. "type": "string",
  7717. "const": "file.watcher.updated"
  7718. },
  7719. "properties": {
  7720. "type": "object",
  7721. "properties": {
  7722. "file": {
  7723. "type": "string"
  7724. },
  7725. "event": {
  7726. "anyOf": [
  7727. {
  7728. "type": "string",
  7729. "const": "add"
  7730. },
  7731. {
  7732. "type": "string",
  7733. "const": "change"
  7734. },
  7735. {
  7736. "type": "string",
  7737. "const": "unlink"
  7738. }
  7739. ]
  7740. }
  7741. },
  7742. "required": ["file", "event"]
  7743. }
  7744. },
  7745. "required": ["type", "properties"]
  7746. },
  7747. "Todo": {
  7748. "type": "object",
  7749. "properties": {
  7750. "content": {
  7751. "description": "Brief description of the task",
  7752. "type": "string"
  7753. },
  7754. "status": {
  7755. "description": "Current status of the task: pending, in_progress, completed, cancelled",
  7756. "type": "string"
  7757. },
  7758. "priority": {
  7759. "description": "Priority level of the task: high, medium, low",
  7760. "type": "string"
  7761. },
  7762. "id": {
  7763. "description": "Unique identifier for the todo item",
  7764. "type": "string"
  7765. }
  7766. },
  7767. "required": ["content", "status", "priority", "id"]
  7768. },
  7769. "Event.todo.updated": {
  7770. "type": "object",
  7771. "properties": {
  7772. "type": {
  7773. "type": "string",
  7774. "const": "todo.updated"
  7775. },
  7776. "properties": {
  7777. "type": "object",
  7778. "properties": {
  7779. "sessionID": {
  7780. "type": "string"
  7781. },
  7782. "todos": {
  7783. "type": "array",
  7784. "items": {
  7785. "$ref": "#/components/schemas/Todo"
  7786. }
  7787. }
  7788. },
  7789. "required": ["sessionID", "todos"]
  7790. }
  7791. },
  7792. "required": ["type", "properties"]
  7793. },
  7794. "Event.tui.prompt.append": {
  7795. "type": "object",
  7796. "properties": {
  7797. "type": {
  7798. "type": "string",
  7799. "const": "tui.prompt.append"
  7800. },
  7801. "properties": {
  7802. "type": "object",
  7803. "properties": {
  7804. "text": {
  7805. "type": "string"
  7806. }
  7807. },
  7808. "required": ["text"]
  7809. }
  7810. },
  7811. "required": ["type", "properties"]
  7812. },
  7813. "Event.tui.command.execute": {
  7814. "type": "object",
  7815. "properties": {
  7816. "type": {
  7817. "type": "string",
  7818. "const": "tui.command.execute"
  7819. },
  7820. "properties": {
  7821. "type": "object",
  7822. "properties": {
  7823. "command": {
  7824. "anyOf": [
  7825. {
  7826. "type": "string",
  7827. "enum": [
  7828. "session.list",
  7829. "session.new",
  7830. "session.share",
  7831. "session.interrupt",
  7832. "session.compact",
  7833. "session.page.up",
  7834. "session.page.down",
  7835. "session.line.up",
  7836. "session.line.down",
  7837. "session.half.page.up",
  7838. "session.half.page.down",
  7839. "session.first",
  7840. "session.last",
  7841. "prompt.clear",
  7842. "prompt.submit",
  7843. "agent.cycle"
  7844. ]
  7845. },
  7846. {
  7847. "type": "string"
  7848. }
  7849. ]
  7850. }
  7851. },
  7852. "required": ["command"]
  7853. }
  7854. },
  7855. "required": ["type", "properties"]
  7856. },
  7857. "Event.tui.toast.show": {
  7858. "type": "object",
  7859. "properties": {
  7860. "type": {
  7861. "type": "string",
  7862. "const": "tui.toast.show"
  7863. },
  7864. "properties": {
  7865. "type": "object",
  7866. "properties": {
  7867. "title": {
  7868. "type": "string"
  7869. },
  7870. "message": {
  7871. "type": "string"
  7872. },
  7873. "variant": {
  7874. "type": "string",
  7875. "enum": ["info", "success", "warning", "error"]
  7876. },
  7877. "duration": {
  7878. "description": "Duration in milliseconds",
  7879. "default": 5000,
  7880. "type": "number"
  7881. }
  7882. },
  7883. "required": ["message", "variant"]
  7884. }
  7885. },
  7886. "required": ["type", "properties"]
  7887. },
  7888. "Event.tui.session.select": {
  7889. "type": "object",
  7890. "properties": {
  7891. "type": {
  7892. "type": "string",
  7893. "const": "tui.session.select"
  7894. },
  7895. "properties": {
  7896. "type": "object",
  7897. "properties": {
  7898. "sessionID": {
  7899. "description": "Session ID to navigate to",
  7900. "type": "string",
  7901. "pattern": "^ses"
  7902. }
  7903. },
  7904. "required": ["sessionID"]
  7905. }
  7906. },
  7907. "required": ["type", "properties"]
  7908. },
  7909. "Event.mcp.tools.changed": {
  7910. "type": "object",
  7911. "properties": {
  7912. "type": {
  7913. "type": "string",
  7914. "const": "mcp.tools.changed"
  7915. },
  7916. "properties": {
  7917. "type": "object",
  7918. "properties": {
  7919. "server": {
  7920. "type": "string"
  7921. }
  7922. },
  7923. "required": ["server"]
  7924. }
  7925. },
  7926. "required": ["type", "properties"]
  7927. },
  7928. "Event.mcp.browser.open.failed": {
  7929. "type": "object",
  7930. "properties": {
  7931. "type": {
  7932. "type": "string",
  7933. "const": "mcp.browser.open.failed"
  7934. },
  7935. "properties": {
  7936. "type": "object",
  7937. "properties": {
  7938. "mcpName": {
  7939. "type": "string"
  7940. },
  7941. "url": {
  7942. "type": "string"
  7943. }
  7944. },
  7945. "required": ["mcpName", "url"]
  7946. }
  7947. },
  7948. "required": ["type", "properties"]
  7949. },
  7950. "Event.command.executed": {
  7951. "type": "object",
  7952. "properties": {
  7953. "type": {
  7954. "type": "string",
  7955. "const": "command.executed"
  7956. },
  7957. "properties": {
  7958. "type": "object",
  7959. "properties": {
  7960. "name": {
  7961. "type": "string"
  7962. },
  7963. "sessionID": {
  7964. "type": "string",
  7965. "pattern": "^ses.*"
  7966. },
  7967. "arguments": {
  7968. "type": "string"
  7969. },
  7970. "messageID": {
  7971. "type": "string",
  7972. "pattern": "^msg.*"
  7973. }
  7974. },
  7975. "required": ["name", "sessionID", "arguments", "messageID"]
  7976. }
  7977. },
  7978. "required": ["type", "properties"]
  7979. },
  7980. "PermissionAction": {
  7981. "type": "string",
  7982. "enum": ["allow", "deny", "ask"]
  7983. },
  7984. "PermissionRule": {
  7985. "type": "object",
  7986. "properties": {
  7987. "permission": {
  7988. "type": "string"
  7989. },
  7990. "pattern": {
  7991. "type": "string"
  7992. },
  7993. "action": {
  7994. "$ref": "#/components/schemas/PermissionAction"
  7995. }
  7996. },
  7997. "required": ["permission", "pattern", "action"]
  7998. },
  7999. "PermissionRuleset": {
  8000. "type": "array",
  8001. "items": {
  8002. "$ref": "#/components/schemas/PermissionRule"
  8003. }
  8004. },
  8005. "Session": {
  8006. "type": "object",
  8007. "properties": {
  8008. "id": {
  8009. "type": "string",
  8010. "pattern": "^ses.*"
  8011. },
  8012. "slug": {
  8013. "type": "string"
  8014. },
  8015. "projectID": {
  8016. "type": "string"
  8017. },
  8018. "directory": {
  8019. "type": "string"
  8020. },
  8021. "parentID": {
  8022. "type": "string",
  8023. "pattern": "^ses.*"
  8024. },
  8025. "summary": {
  8026. "type": "object",
  8027. "properties": {
  8028. "additions": {
  8029. "type": "number"
  8030. },
  8031. "deletions": {
  8032. "type": "number"
  8033. },
  8034. "files": {
  8035. "type": "number"
  8036. },
  8037. "diffs": {
  8038. "type": "array",
  8039. "items": {
  8040. "$ref": "#/components/schemas/FileDiff"
  8041. }
  8042. }
  8043. },
  8044. "required": ["additions", "deletions", "files"]
  8045. },
  8046. "share": {
  8047. "type": "object",
  8048. "properties": {
  8049. "url": {
  8050. "type": "string"
  8051. }
  8052. },
  8053. "required": ["url"]
  8054. },
  8055. "title": {
  8056. "type": "string"
  8057. },
  8058. "version": {
  8059. "type": "string"
  8060. },
  8061. "time": {
  8062. "type": "object",
  8063. "properties": {
  8064. "created": {
  8065. "type": "number"
  8066. },
  8067. "updated": {
  8068. "type": "number"
  8069. },
  8070. "compacting": {
  8071. "type": "number"
  8072. },
  8073. "archived": {
  8074. "type": "number"
  8075. }
  8076. },
  8077. "required": ["created", "updated"]
  8078. },
  8079. "permission": {
  8080. "$ref": "#/components/schemas/PermissionRuleset"
  8081. },
  8082. "revert": {
  8083. "type": "object",
  8084. "properties": {
  8085. "messageID": {
  8086. "type": "string"
  8087. },
  8088. "partID": {
  8089. "type": "string"
  8090. },
  8091. "snapshot": {
  8092. "type": "string"
  8093. },
  8094. "diff": {
  8095. "type": "string"
  8096. }
  8097. },
  8098. "required": ["messageID"]
  8099. }
  8100. },
  8101. "required": ["id", "slug", "projectID", "directory", "title", "version", "time"]
  8102. },
  8103. "Event.session.created": {
  8104. "type": "object",
  8105. "properties": {
  8106. "type": {
  8107. "type": "string",
  8108. "const": "session.created"
  8109. },
  8110. "properties": {
  8111. "type": "object",
  8112. "properties": {
  8113. "info": {
  8114. "$ref": "#/components/schemas/Session"
  8115. }
  8116. },
  8117. "required": ["info"]
  8118. }
  8119. },
  8120. "required": ["type", "properties"]
  8121. },
  8122. "Event.session.updated": {
  8123. "type": "object",
  8124. "properties": {
  8125. "type": {
  8126. "type": "string",
  8127. "const": "session.updated"
  8128. },
  8129. "properties": {
  8130. "type": "object",
  8131. "properties": {
  8132. "info": {
  8133. "$ref": "#/components/schemas/Session"
  8134. }
  8135. },
  8136. "required": ["info"]
  8137. }
  8138. },
  8139. "required": ["type", "properties"]
  8140. },
  8141. "Event.session.deleted": {
  8142. "type": "object",
  8143. "properties": {
  8144. "type": {
  8145. "type": "string",
  8146. "const": "session.deleted"
  8147. },
  8148. "properties": {
  8149. "type": "object",
  8150. "properties": {
  8151. "info": {
  8152. "$ref": "#/components/schemas/Session"
  8153. }
  8154. },
  8155. "required": ["info"]
  8156. }
  8157. },
  8158. "required": ["type", "properties"]
  8159. },
  8160. "Event.session.diff": {
  8161. "type": "object",
  8162. "properties": {
  8163. "type": {
  8164. "type": "string",
  8165. "const": "session.diff"
  8166. },
  8167. "properties": {
  8168. "type": "object",
  8169. "properties": {
  8170. "sessionID": {
  8171. "type": "string"
  8172. },
  8173. "diff": {
  8174. "type": "array",
  8175. "items": {
  8176. "$ref": "#/components/schemas/FileDiff"
  8177. }
  8178. }
  8179. },
  8180. "required": ["sessionID", "diff"]
  8181. }
  8182. },
  8183. "required": ["type", "properties"]
  8184. },
  8185. "Event.session.error": {
  8186. "type": "object",
  8187. "properties": {
  8188. "type": {
  8189. "type": "string",
  8190. "const": "session.error"
  8191. },
  8192. "properties": {
  8193. "type": "object",
  8194. "properties": {
  8195. "sessionID": {
  8196. "type": "string"
  8197. },
  8198. "error": {
  8199. "anyOf": [
  8200. {
  8201. "$ref": "#/components/schemas/ProviderAuthError"
  8202. },
  8203. {
  8204. "$ref": "#/components/schemas/UnknownError"
  8205. },
  8206. {
  8207. "$ref": "#/components/schemas/MessageOutputLengthError"
  8208. },
  8209. {
  8210. "$ref": "#/components/schemas/MessageAbortedError"
  8211. },
  8212. {
  8213. "$ref": "#/components/schemas/StructuredOutputError"
  8214. },
  8215. {
  8216. "$ref": "#/components/schemas/ContextOverflowError"
  8217. },
  8218. {
  8219. "$ref": "#/components/schemas/APIError"
  8220. }
  8221. ]
  8222. }
  8223. }
  8224. }
  8225. },
  8226. "required": ["type", "properties"]
  8227. },
  8228. "Event.vcs.branch.updated": {
  8229. "type": "object",
  8230. "properties": {
  8231. "type": {
  8232. "type": "string",
  8233. "const": "vcs.branch.updated"
  8234. },
  8235. "properties": {
  8236. "type": "object",
  8237. "properties": {
  8238. "branch": {
  8239. "type": "string"
  8240. }
  8241. }
  8242. }
  8243. },
  8244. "required": ["type", "properties"]
  8245. },
  8246. "Pty": {
  8247. "type": "object",
  8248. "properties": {
  8249. "id": {
  8250. "type": "string",
  8251. "pattern": "^pty.*"
  8252. },
  8253. "title": {
  8254. "type": "string"
  8255. },
  8256. "command": {
  8257. "type": "string"
  8258. },
  8259. "args": {
  8260. "type": "array",
  8261. "items": {
  8262. "type": "string"
  8263. }
  8264. },
  8265. "cwd": {
  8266. "type": "string"
  8267. },
  8268. "status": {
  8269. "type": "string",
  8270. "enum": ["running", "exited"]
  8271. },
  8272. "pid": {
  8273. "type": "number"
  8274. }
  8275. },
  8276. "required": ["id", "title", "command", "args", "cwd", "status", "pid"]
  8277. },
  8278. "Event.pty.created": {
  8279. "type": "object",
  8280. "properties": {
  8281. "type": {
  8282. "type": "string",
  8283. "const": "pty.created"
  8284. },
  8285. "properties": {
  8286. "type": "object",
  8287. "properties": {
  8288. "info": {
  8289. "$ref": "#/components/schemas/Pty"
  8290. }
  8291. },
  8292. "required": ["info"]
  8293. }
  8294. },
  8295. "required": ["type", "properties"]
  8296. },
  8297. "Event.pty.updated": {
  8298. "type": "object",
  8299. "properties": {
  8300. "type": {
  8301. "type": "string",
  8302. "const": "pty.updated"
  8303. },
  8304. "properties": {
  8305. "type": "object",
  8306. "properties": {
  8307. "info": {
  8308. "$ref": "#/components/schemas/Pty"
  8309. }
  8310. },
  8311. "required": ["info"]
  8312. }
  8313. },
  8314. "required": ["type", "properties"]
  8315. },
  8316. "Event.pty.exited": {
  8317. "type": "object",
  8318. "properties": {
  8319. "type": {
  8320. "type": "string",
  8321. "const": "pty.exited"
  8322. },
  8323. "properties": {
  8324. "type": "object",
  8325. "properties": {
  8326. "id": {
  8327. "type": "string",
  8328. "pattern": "^pty.*"
  8329. },
  8330. "exitCode": {
  8331. "type": "number"
  8332. }
  8333. },
  8334. "required": ["id", "exitCode"]
  8335. }
  8336. },
  8337. "required": ["type", "properties"]
  8338. },
  8339. "Event.pty.deleted": {
  8340. "type": "object",
  8341. "properties": {
  8342. "type": {
  8343. "type": "string",
  8344. "const": "pty.deleted"
  8345. },
  8346. "properties": {
  8347. "type": "object",
  8348. "properties": {
  8349. "id": {
  8350. "type": "string",
  8351. "pattern": "^pty.*"
  8352. }
  8353. },
  8354. "required": ["id"]
  8355. }
  8356. },
  8357. "required": ["type", "properties"]
  8358. },
  8359. "Event.worktree.ready": {
  8360. "type": "object",
  8361. "properties": {
  8362. "type": {
  8363. "type": "string",
  8364. "const": "worktree.ready"
  8365. },
  8366. "properties": {
  8367. "type": "object",
  8368. "properties": {
  8369. "name": {
  8370. "type": "string"
  8371. },
  8372. "branch": {
  8373. "type": "string"
  8374. }
  8375. },
  8376. "required": ["name", "branch"]
  8377. }
  8378. },
  8379. "required": ["type", "properties"]
  8380. },
  8381. "Event.worktree.failed": {
  8382. "type": "object",
  8383. "properties": {
  8384. "type": {
  8385. "type": "string",
  8386. "const": "worktree.failed"
  8387. },
  8388. "properties": {
  8389. "type": "object",
  8390. "properties": {
  8391. "message": {
  8392. "type": "string"
  8393. }
  8394. },
  8395. "required": ["message"]
  8396. }
  8397. },
  8398. "required": ["type", "properties"]
  8399. },
  8400. "Event": {
  8401. "anyOf": [
  8402. {
  8403. "$ref": "#/components/schemas/Event.installation.updated"
  8404. },
  8405. {
  8406. "$ref": "#/components/schemas/Event.installation.update-available"
  8407. },
  8408. {
  8409. "$ref": "#/components/schemas/Event.project.updated"
  8410. },
  8411. {
  8412. "$ref": "#/components/schemas/Event.server.instance.disposed"
  8413. },
  8414. {
  8415. "$ref": "#/components/schemas/Event.server.connected"
  8416. },
  8417. {
  8418. "$ref": "#/components/schemas/Event.global.disposed"
  8419. },
  8420. {
  8421. "$ref": "#/components/schemas/Event.lsp.client.diagnostics"
  8422. },
  8423. {
  8424. "$ref": "#/components/schemas/Event.lsp.updated"
  8425. },
  8426. {
  8427. "$ref": "#/components/schemas/Event.file.edited"
  8428. },
  8429. {
  8430. "$ref": "#/components/schemas/Event.message.updated"
  8431. },
  8432. {
  8433. "$ref": "#/components/schemas/Event.message.removed"
  8434. },
  8435. {
  8436. "$ref": "#/components/schemas/Event.message.part.updated"
  8437. },
  8438. {
  8439. "$ref": "#/components/schemas/Event.message.part.removed"
  8440. },
  8441. {
  8442. "$ref": "#/components/schemas/Event.permission.asked"
  8443. },
  8444. {
  8445. "$ref": "#/components/schemas/Event.permission.replied"
  8446. },
  8447. {
  8448. "$ref": "#/components/schemas/Event.session.status"
  8449. },
  8450. {
  8451. "$ref": "#/components/schemas/Event.session.idle"
  8452. },
  8453. {
  8454. "$ref": "#/components/schemas/Event.question.asked"
  8455. },
  8456. {
  8457. "$ref": "#/components/schemas/Event.question.replied"
  8458. },
  8459. {
  8460. "$ref": "#/components/schemas/Event.question.rejected"
  8461. },
  8462. {
  8463. "$ref": "#/components/schemas/Event.session.compacted"
  8464. },
  8465. {
  8466. "$ref": "#/components/schemas/Event.file.watcher.updated"
  8467. },
  8468. {
  8469. "$ref": "#/components/schemas/Event.todo.updated"
  8470. },
  8471. {
  8472. "$ref": "#/components/schemas/Event.tui.prompt.append"
  8473. },
  8474. {
  8475. "$ref": "#/components/schemas/Event.tui.command.execute"
  8476. },
  8477. {
  8478. "$ref": "#/components/schemas/Event.tui.toast.show"
  8479. },
  8480. {
  8481. "$ref": "#/components/schemas/Event.tui.session.select"
  8482. },
  8483. {
  8484. "$ref": "#/components/schemas/Event.mcp.tools.changed"
  8485. },
  8486. {
  8487. "$ref": "#/components/schemas/Event.mcp.browser.open.failed"
  8488. },
  8489. {
  8490. "$ref": "#/components/schemas/Event.command.executed"
  8491. },
  8492. {
  8493. "$ref": "#/components/schemas/Event.session.created"
  8494. },
  8495. {
  8496. "$ref": "#/components/schemas/Event.session.updated"
  8497. },
  8498. {
  8499. "$ref": "#/components/schemas/Event.session.deleted"
  8500. },
  8501. {
  8502. "$ref": "#/components/schemas/Event.session.diff"
  8503. },
  8504. {
  8505. "$ref": "#/components/schemas/Event.session.error"
  8506. },
  8507. {
  8508. "$ref": "#/components/schemas/Event.vcs.branch.updated"
  8509. },
  8510. {
  8511. "$ref": "#/components/schemas/Event.pty.created"
  8512. },
  8513. {
  8514. "$ref": "#/components/schemas/Event.pty.updated"
  8515. },
  8516. {
  8517. "$ref": "#/components/schemas/Event.pty.exited"
  8518. },
  8519. {
  8520. "$ref": "#/components/schemas/Event.pty.deleted"
  8521. },
  8522. {
  8523. "$ref": "#/components/schemas/Event.worktree.ready"
  8524. },
  8525. {
  8526. "$ref": "#/components/schemas/Event.worktree.failed"
  8527. }
  8528. ]
  8529. },
  8530. "GlobalEvent": {
  8531. "type": "object",
  8532. "properties": {
  8533. "directory": {
  8534. "type": "string"
  8535. },
  8536. "payload": {
  8537. "$ref": "#/components/schemas/Event"
  8538. }
  8539. },
  8540. "required": ["directory", "payload"]
  8541. },
  8542. "KeybindsConfig": {
  8543. "description": "Custom keybind configurations",
  8544. "type": "object",
  8545. "properties": {
  8546. "leader": {
  8547. "description": "Leader key for keybind combinations",
  8548. "default": "ctrl+x",
  8549. "type": "string"
  8550. },
  8551. "app_exit": {
  8552. "description": "Exit the application",
  8553. "default": "ctrl+c,ctrl+d,<leader>q",
  8554. "type": "string"
  8555. },
  8556. "editor_open": {
  8557. "description": "Open external editor",
  8558. "default": "<leader>e",
  8559. "type": "string"
  8560. },
  8561. "theme_list": {
  8562. "description": "List available themes",
  8563. "default": "<leader>t",
  8564. "type": "string"
  8565. },
  8566. "sidebar_toggle": {
  8567. "description": "Toggle sidebar",
  8568. "default": "<leader>b",
  8569. "type": "string"
  8570. },
  8571. "scrollbar_toggle": {
  8572. "description": "Toggle session scrollbar",
  8573. "default": "none",
  8574. "type": "string"
  8575. },
  8576. "username_toggle": {
  8577. "description": "Toggle username visibility",
  8578. "default": "none",
  8579. "type": "string"
  8580. },
  8581. "status_view": {
  8582. "description": "View status",
  8583. "default": "<leader>s",
  8584. "type": "string"
  8585. },
  8586. "session_export": {
  8587. "description": "Export session to editor",
  8588. "default": "<leader>x",
  8589. "type": "string"
  8590. },
  8591. "session_new": {
  8592. "description": "Create a new session",
  8593. "default": "<leader>n",
  8594. "type": "string"
  8595. },
  8596. "session_list": {
  8597. "description": "List all sessions",
  8598. "default": "<leader>l",
  8599. "type": "string"
  8600. },
  8601. "session_timeline": {
  8602. "description": "Show session timeline",
  8603. "default": "<leader>g",
  8604. "type": "string"
  8605. },
  8606. "session_fork": {
  8607. "description": "Fork session from message",
  8608. "default": "none",
  8609. "type": "string"
  8610. },
  8611. "session_rename": {
  8612. "description": "Rename session",
  8613. "default": "ctrl+r",
  8614. "type": "string"
  8615. },
  8616. "session_delete": {
  8617. "description": "Delete session",
  8618. "default": "ctrl+d",
  8619. "type": "string"
  8620. },
  8621. "stash_delete": {
  8622. "description": "Delete stash entry",
  8623. "default": "ctrl+d",
  8624. "type": "string"
  8625. },
  8626. "model_provider_list": {
  8627. "description": "Open provider list from model dialog",
  8628. "default": "ctrl+a",
  8629. "type": "string"
  8630. },
  8631. "model_favorite_toggle": {
  8632. "description": "Toggle model favorite status",
  8633. "default": "ctrl+f",
  8634. "type": "string"
  8635. },
  8636. "session_share": {
  8637. "description": "Share current session",
  8638. "default": "none",
  8639. "type": "string"
  8640. },
  8641. "session_unshare": {
  8642. "description": "Unshare current session",
  8643. "default": "none",
  8644. "type": "string"
  8645. },
  8646. "session_interrupt": {
  8647. "description": "Interrupt current session",
  8648. "default": "escape",
  8649. "type": "string"
  8650. },
  8651. "session_compact": {
  8652. "description": "Compact the session",
  8653. "default": "<leader>c",
  8654. "type": "string"
  8655. },
  8656. "messages_page_up": {
  8657. "description": "Scroll messages up by one page",
  8658. "default": "pageup,ctrl+alt+b",
  8659. "type": "string"
  8660. },
  8661. "messages_page_down": {
  8662. "description": "Scroll messages down by one page",
  8663. "default": "pagedown,ctrl+alt+f",
  8664. "type": "string"
  8665. },
  8666. "messages_line_up": {
  8667. "description": "Scroll messages up by one line",
  8668. "default": "ctrl+alt+y",
  8669. "type": "string"
  8670. },
  8671. "messages_line_down": {
  8672. "description": "Scroll messages down by one line",
  8673. "default": "ctrl+alt+e",
  8674. "type": "string"
  8675. },
  8676. "messages_half_page_up": {
  8677. "description": "Scroll messages up by half page",
  8678. "default": "ctrl+alt+u",
  8679. "type": "string"
  8680. },
  8681. "messages_half_page_down": {
  8682. "description": "Scroll messages down by half page",
  8683. "default": "ctrl+alt+d",
  8684. "type": "string"
  8685. },
  8686. "messages_first": {
  8687. "description": "Navigate to first message",
  8688. "default": "ctrl+g,home",
  8689. "type": "string"
  8690. },
  8691. "messages_last": {
  8692. "description": "Navigate to last message",
  8693. "default": "ctrl+alt+g,end",
  8694. "type": "string"
  8695. },
  8696. "messages_next": {
  8697. "description": "Navigate to next message",
  8698. "default": "none",
  8699. "type": "string"
  8700. },
  8701. "messages_previous": {
  8702. "description": "Navigate to previous message",
  8703. "default": "none",
  8704. "type": "string"
  8705. },
  8706. "messages_last_user": {
  8707. "description": "Navigate to last user message",
  8708. "default": "none",
  8709. "type": "string"
  8710. },
  8711. "messages_copy": {
  8712. "description": "Copy message",
  8713. "default": "<leader>y",
  8714. "type": "string"
  8715. },
  8716. "messages_undo": {
  8717. "description": "Undo message",
  8718. "default": "<leader>u",
  8719. "type": "string"
  8720. },
  8721. "messages_redo": {
  8722. "description": "Redo message",
  8723. "default": "<leader>r",
  8724. "type": "string"
  8725. },
  8726. "messages_toggle_conceal": {
  8727. "description": "Toggle code block concealment in messages",
  8728. "default": "<leader>h",
  8729. "type": "string"
  8730. },
  8731. "tool_details": {
  8732. "description": "Toggle tool details visibility",
  8733. "default": "none",
  8734. "type": "string"
  8735. },
  8736. "model_list": {
  8737. "description": "List available models",
  8738. "default": "<leader>m",
  8739. "type": "string"
  8740. },
  8741. "model_cycle_recent": {
  8742. "description": "Next recently used model",
  8743. "default": "f2",
  8744. "type": "string"
  8745. },
  8746. "model_cycle_recent_reverse": {
  8747. "description": "Previous recently used model",
  8748. "default": "shift+f2",
  8749. "type": "string"
  8750. },
  8751. "model_cycle_favorite": {
  8752. "description": "Next favorite model",
  8753. "default": "none",
  8754. "type": "string"
  8755. },
  8756. "model_cycle_favorite_reverse": {
  8757. "description": "Previous favorite model",
  8758. "default": "none",
  8759. "type": "string"
  8760. },
  8761. "command_list": {
  8762. "description": "List available commands",
  8763. "default": "ctrl+p",
  8764. "type": "string"
  8765. },
  8766. "agent_list": {
  8767. "description": "List agents",
  8768. "default": "<leader>a",
  8769. "type": "string"
  8770. },
  8771. "agent_cycle": {
  8772. "description": "Next agent",
  8773. "default": "tab",
  8774. "type": "string"
  8775. },
  8776. "agent_cycle_reverse": {
  8777. "description": "Previous agent",
  8778. "default": "shift+tab",
  8779. "type": "string"
  8780. },
  8781. "variant_cycle": {
  8782. "description": "Cycle model variants",
  8783. "default": "ctrl+t",
  8784. "type": "string"
  8785. },
  8786. "input_clear": {
  8787. "description": "Clear input field",
  8788. "default": "ctrl+c",
  8789. "type": "string"
  8790. },
  8791. "input_paste": {
  8792. "description": "Paste from clipboard",
  8793. "default": "ctrl+v",
  8794. "type": "string"
  8795. },
  8796. "input_submit": {
  8797. "description": "Submit input",
  8798. "default": "return",
  8799. "type": "string"
  8800. },
  8801. "input_newline": {
  8802. "description": "Insert newline in input",
  8803. "default": "shift+return,ctrl+return,alt+return,ctrl+j",
  8804. "type": "string"
  8805. },
  8806. "input_move_left": {
  8807. "description": "Move cursor left in input",
  8808. "default": "left,ctrl+b",
  8809. "type": "string"
  8810. },
  8811. "input_move_right": {
  8812. "description": "Move cursor right in input",
  8813. "default": "right,ctrl+f",
  8814. "type": "string"
  8815. },
  8816. "input_move_up": {
  8817. "description": "Move cursor up in input",
  8818. "default": "up",
  8819. "type": "string"
  8820. },
  8821. "input_move_down": {
  8822. "description": "Move cursor down in input",
  8823. "default": "down",
  8824. "type": "string"
  8825. },
  8826. "input_select_left": {
  8827. "description": "Select left in input",
  8828. "default": "shift+left",
  8829. "type": "string"
  8830. },
  8831. "input_select_right": {
  8832. "description": "Select right in input",
  8833. "default": "shift+right",
  8834. "type": "string"
  8835. },
  8836. "input_select_up": {
  8837. "description": "Select up in input",
  8838. "default": "shift+up",
  8839. "type": "string"
  8840. },
  8841. "input_select_down": {
  8842. "description": "Select down in input",
  8843. "default": "shift+down",
  8844. "type": "string"
  8845. },
  8846. "input_line_home": {
  8847. "description": "Move to start of line in input",
  8848. "default": "ctrl+a",
  8849. "type": "string"
  8850. },
  8851. "input_line_end": {
  8852. "description": "Move to end of line in input",
  8853. "default": "ctrl+e",
  8854. "type": "string"
  8855. },
  8856. "input_select_line_home": {
  8857. "description": "Select to start of line in input",
  8858. "default": "ctrl+shift+a",
  8859. "type": "string"
  8860. },
  8861. "input_select_line_end": {
  8862. "description": "Select to end of line in input",
  8863. "default": "ctrl+shift+e",
  8864. "type": "string"
  8865. },
  8866. "input_visual_line_home": {
  8867. "description": "Move to start of visual line in input",
  8868. "default": "alt+a",
  8869. "type": "string"
  8870. },
  8871. "input_visual_line_end": {
  8872. "description": "Move to end of visual line in input",
  8873. "default": "alt+e",
  8874. "type": "string"
  8875. },
  8876. "input_select_visual_line_home": {
  8877. "description": "Select to start of visual line in input",
  8878. "default": "alt+shift+a",
  8879. "type": "string"
  8880. },
  8881. "input_select_visual_line_end": {
  8882. "description": "Select to end of visual line in input",
  8883. "default": "alt+shift+e",
  8884. "type": "string"
  8885. },
  8886. "input_buffer_home": {
  8887. "description": "Move to start of buffer in input",
  8888. "default": "home",
  8889. "type": "string"
  8890. },
  8891. "input_buffer_end": {
  8892. "description": "Move to end of buffer in input",
  8893. "default": "end",
  8894. "type": "string"
  8895. },
  8896. "input_select_buffer_home": {
  8897. "description": "Select to start of buffer in input",
  8898. "default": "shift+home",
  8899. "type": "string"
  8900. },
  8901. "input_select_buffer_end": {
  8902. "description": "Select to end of buffer in input",
  8903. "default": "shift+end",
  8904. "type": "string"
  8905. },
  8906. "input_delete_line": {
  8907. "description": "Delete line in input",
  8908. "default": "ctrl+shift+d",
  8909. "type": "string"
  8910. },
  8911. "input_delete_to_line_end": {
  8912. "description": "Delete to end of line in input",
  8913. "default": "ctrl+k",
  8914. "type": "string"
  8915. },
  8916. "input_delete_to_line_start": {
  8917. "description": "Delete to start of line in input",
  8918. "default": "ctrl+u",
  8919. "type": "string"
  8920. },
  8921. "input_backspace": {
  8922. "description": "Backspace in input",
  8923. "default": "backspace,shift+backspace",
  8924. "type": "string"
  8925. },
  8926. "input_delete": {
  8927. "description": "Delete character in input",
  8928. "default": "ctrl+d,delete,shift+delete",
  8929. "type": "string"
  8930. },
  8931. "input_undo": {
  8932. "description": "Undo in input",
  8933. "default": "ctrl+-,super+z",
  8934. "type": "string"
  8935. },
  8936. "input_redo": {
  8937. "description": "Redo in input",
  8938. "default": "ctrl+.,super+shift+z",
  8939. "type": "string"
  8940. },
  8941. "input_word_forward": {
  8942. "description": "Move word forward in input",
  8943. "default": "alt+f,alt+right,ctrl+right",
  8944. "type": "string"
  8945. },
  8946. "input_word_backward": {
  8947. "description": "Move word backward in input",
  8948. "default": "alt+b,alt+left,ctrl+left",
  8949. "type": "string"
  8950. },
  8951. "input_select_word_forward": {
  8952. "description": "Select word forward in input",
  8953. "default": "alt+shift+f,alt+shift+right",
  8954. "type": "string"
  8955. },
  8956. "input_select_word_backward": {
  8957. "description": "Select word backward in input",
  8958. "default": "alt+shift+b,alt+shift+left",
  8959. "type": "string"
  8960. },
  8961. "input_delete_word_forward": {
  8962. "description": "Delete word forward in input",
  8963. "default": "alt+d,alt+delete,ctrl+delete",
  8964. "type": "string"
  8965. },
  8966. "input_delete_word_backward": {
  8967. "description": "Delete word backward in input",
  8968. "default": "ctrl+w,ctrl+backspace,alt+backspace",
  8969. "type": "string"
  8970. },
  8971. "history_previous": {
  8972. "description": "Previous history item",
  8973. "default": "up",
  8974. "type": "string"
  8975. },
  8976. "history_next": {
  8977. "description": "Next history item",
  8978. "default": "down",
  8979. "type": "string"
  8980. },
  8981. "session_child_cycle": {
  8982. "description": "Next child session",
  8983. "default": "<leader>right",
  8984. "type": "string"
  8985. },
  8986. "session_child_cycle_reverse": {
  8987. "description": "Previous child session",
  8988. "default": "<leader>left",
  8989. "type": "string"
  8990. },
  8991. "session_parent": {
  8992. "description": "Go to parent session",
  8993. "default": "<leader>up",
  8994. "type": "string"
  8995. },
  8996. "terminal_suspend": {
  8997. "description": "Suspend terminal",
  8998. "default": "ctrl+z",
  8999. "type": "string"
  9000. },
  9001. "terminal_title_toggle": {
  9002. "description": "Toggle terminal title",
  9003. "default": "none",
  9004. "type": "string"
  9005. },
  9006. "tips_toggle": {
  9007. "description": "Toggle tips on home screen",
  9008. "default": "<leader>h",
  9009. "type": "string"
  9010. },
  9011. "display_thinking": {
  9012. "description": "Toggle thinking blocks visibility",
  9013. "default": "none",
  9014. "type": "string"
  9015. }
  9016. },
  9017. "additionalProperties": false
  9018. },
  9019. "LogLevel": {
  9020. "description": "Log level",
  9021. "type": "string",
  9022. "enum": ["DEBUG", "INFO", "WARN", "ERROR"]
  9023. },
  9024. "ServerConfig": {
  9025. "description": "Server configuration for opencode serve and web commands",
  9026. "type": "object",
  9027. "properties": {
  9028. "port": {
  9029. "description": "Port to listen on",
  9030. "type": "integer",
  9031. "exclusiveMinimum": 0,
  9032. "maximum": 9007199254740991
  9033. },
  9034. "hostname": {
  9035. "description": "Hostname to listen on",
  9036. "type": "string"
  9037. },
  9038. "mdns": {
  9039. "description": "Enable mDNS service discovery",
  9040. "type": "boolean"
  9041. },
  9042. "mdnsDomain": {
  9043. "description": "Custom domain name for mDNS service (default: opencode.local)",
  9044. "type": "string"
  9045. },
  9046. "cors": {
  9047. "description": "Additional domains to allow for CORS",
  9048. "type": "array",
  9049. "items": {
  9050. "type": "string"
  9051. }
  9052. }
  9053. },
  9054. "additionalProperties": false
  9055. },
  9056. "PermissionActionConfig": {
  9057. "type": "string",
  9058. "enum": ["ask", "allow", "deny"]
  9059. },
  9060. "PermissionObjectConfig": {
  9061. "type": "object",
  9062. "propertyNames": {
  9063. "type": "string"
  9064. },
  9065. "additionalProperties": {
  9066. "$ref": "#/components/schemas/PermissionActionConfig"
  9067. }
  9068. },
  9069. "PermissionRuleConfig": {
  9070. "anyOf": [
  9071. {
  9072. "$ref": "#/components/schemas/PermissionActionConfig"
  9073. },
  9074. {
  9075. "$ref": "#/components/schemas/PermissionObjectConfig"
  9076. }
  9077. ]
  9078. },
  9079. "PermissionConfig": {
  9080. "anyOf": [
  9081. {
  9082. "type": "object",
  9083. "properties": {
  9084. "__originalKeys": {
  9085. "type": "array",
  9086. "items": {
  9087. "type": "string"
  9088. }
  9089. },
  9090. "read": {
  9091. "$ref": "#/components/schemas/PermissionRuleConfig"
  9092. },
  9093. "edit": {
  9094. "$ref": "#/components/schemas/PermissionRuleConfig"
  9095. },
  9096. "glob": {
  9097. "$ref": "#/components/schemas/PermissionRuleConfig"
  9098. },
  9099. "grep": {
  9100. "$ref": "#/components/schemas/PermissionRuleConfig"
  9101. },
  9102. "list": {
  9103. "$ref": "#/components/schemas/PermissionRuleConfig"
  9104. },
  9105. "bash": {
  9106. "$ref": "#/components/schemas/PermissionRuleConfig"
  9107. },
  9108. "task": {
  9109. "$ref": "#/components/schemas/PermissionRuleConfig"
  9110. },
  9111. "external_directory": {
  9112. "$ref": "#/components/schemas/PermissionRuleConfig"
  9113. },
  9114. "todowrite": {
  9115. "$ref": "#/components/schemas/PermissionActionConfig"
  9116. },
  9117. "todoread": {
  9118. "$ref": "#/components/schemas/PermissionActionConfig"
  9119. },
  9120. "question": {
  9121. "$ref": "#/components/schemas/PermissionActionConfig"
  9122. },
  9123. "webfetch": {
  9124. "$ref": "#/components/schemas/PermissionActionConfig"
  9125. },
  9126. "websearch": {
  9127. "$ref": "#/components/schemas/PermissionActionConfig"
  9128. },
  9129. "codesearch": {
  9130. "$ref": "#/components/schemas/PermissionActionConfig"
  9131. },
  9132. "lsp": {
  9133. "$ref": "#/components/schemas/PermissionRuleConfig"
  9134. },
  9135. "doom_loop": {
  9136. "$ref": "#/components/schemas/PermissionActionConfig"
  9137. },
  9138. "skill": {
  9139. "$ref": "#/components/schemas/PermissionRuleConfig"
  9140. }
  9141. },
  9142. "additionalProperties": {
  9143. "$ref": "#/components/schemas/PermissionRuleConfig"
  9144. }
  9145. },
  9146. {
  9147. "$ref": "#/components/schemas/PermissionActionConfig"
  9148. }
  9149. ]
  9150. },
  9151. "AgentConfig": {
  9152. "type": "object",
  9153. "properties": {
  9154. "model": {
  9155. "type": "string"
  9156. },
  9157. "variant": {
  9158. "description": "Default model variant for this agent (applies only when using the agent's configured model).",
  9159. "type": "string"
  9160. },
  9161. "temperature": {
  9162. "type": "number"
  9163. },
  9164. "top_p": {
  9165. "type": "number"
  9166. },
  9167. "prompt": {
  9168. "type": "string"
  9169. },
  9170. "tools": {
  9171. "description": "@deprecated Use 'permission' field instead",
  9172. "type": "object",
  9173. "propertyNames": {
  9174. "type": "string"
  9175. },
  9176. "additionalProperties": {
  9177. "type": "boolean"
  9178. }
  9179. },
  9180. "disable": {
  9181. "type": "boolean"
  9182. },
  9183. "description": {
  9184. "description": "Description of when to use the agent",
  9185. "type": "string"
  9186. },
  9187. "mode": {
  9188. "type": "string",
  9189. "enum": ["subagent", "primary", "all"]
  9190. },
  9191. "hidden": {
  9192. "description": "Hide this subagent from the @ autocomplete menu (default: false, only applies to mode: subagent)",
  9193. "type": "boolean"
  9194. },
  9195. "options": {
  9196. "type": "object",
  9197. "propertyNames": {
  9198. "type": "string"
  9199. },
  9200. "additionalProperties": {}
  9201. },
  9202. "color": {
  9203. "description": "Hex color code (e.g., #FF5733) or theme color (e.g., primary)",
  9204. "anyOf": [
  9205. {
  9206. "type": "string",
  9207. "pattern": "^#[0-9a-fA-F]{6}$"
  9208. },
  9209. {
  9210. "type": "string",
  9211. "enum": ["primary", "secondary", "accent", "success", "warning", "error", "info"]
  9212. }
  9213. ]
  9214. },
  9215. "steps": {
  9216. "description": "Maximum number of agentic iterations before forcing text-only response",
  9217. "type": "integer",
  9218. "exclusiveMinimum": 0,
  9219. "maximum": 9007199254740991
  9220. },
  9221. "maxSteps": {
  9222. "description": "@deprecated Use 'steps' field instead.",
  9223. "type": "integer",
  9224. "exclusiveMinimum": 0,
  9225. "maximum": 9007199254740991
  9226. },
  9227. "permission": {
  9228. "$ref": "#/components/schemas/PermissionConfig"
  9229. }
  9230. },
  9231. "additionalProperties": {}
  9232. },
  9233. "ProviderConfig": {
  9234. "type": "object",
  9235. "properties": {
  9236. "api": {
  9237. "type": "string"
  9238. },
  9239. "name": {
  9240. "type": "string"
  9241. },
  9242. "env": {
  9243. "type": "array",
  9244. "items": {
  9245. "type": "string"
  9246. }
  9247. },
  9248. "id": {
  9249. "type": "string"
  9250. },
  9251. "npm": {
  9252. "type": "string"
  9253. },
  9254. "models": {
  9255. "type": "object",
  9256. "propertyNames": {
  9257. "type": "string"
  9258. },
  9259. "additionalProperties": {
  9260. "type": "object",
  9261. "properties": {
  9262. "id": {
  9263. "type": "string"
  9264. },
  9265. "name": {
  9266. "type": "string"
  9267. },
  9268. "family": {
  9269. "type": "string"
  9270. },
  9271. "release_date": {
  9272. "type": "string"
  9273. },
  9274. "attachment": {
  9275. "type": "boolean"
  9276. },
  9277. "reasoning": {
  9278. "type": "boolean"
  9279. },
  9280. "temperature": {
  9281. "type": "boolean"
  9282. },
  9283. "tool_call": {
  9284. "type": "boolean"
  9285. },
  9286. "interleaved": {
  9287. "anyOf": [
  9288. {
  9289. "type": "boolean",
  9290. "const": true
  9291. },
  9292. {
  9293. "type": "object",
  9294. "properties": {
  9295. "field": {
  9296. "type": "string",
  9297. "enum": ["reasoning_content", "reasoning_details"]
  9298. }
  9299. },
  9300. "required": ["field"],
  9301. "additionalProperties": false
  9302. }
  9303. ]
  9304. },
  9305. "cost": {
  9306. "type": "object",
  9307. "properties": {
  9308. "input": {
  9309. "type": "number"
  9310. },
  9311. "output": {
  9312. "type": "number"
  9313. },
  9314. "cache_read": {
  9315. "type": "number"
  9316. },
  9317. "cache_write": {
  9318. "type": "number"
  9319. },
  9320. "context_over_200k": {
  9321. "type": "object",
  9322. "properties": {
  9323. "input": {
  9324. "type": "number"
  9325. },
  9326. "output": {
  9327. "type": "number"
  9328. },
  9329. "cache_read": {
  9330. "type": "number"
  9331. },
  9332. "cache_write": {
  9333. "type": "number"
  9334. }
  9335. },
  9336. "required": ["input", "output"]
  9337. }
  9338. },
  9339. "required": ["input", "output"]
  9340. },
  9341. "limit": {
  9342. "type": "object",
  9343. "properties": {
  9344. "context": {
  9345. "type": "number"
  9346. },
  9347. "input": {
  9348. "type": "number"
  9349. },
  9350. "output": {
  9351. "type": "number"
  9352. }
  9353. },
  9354. "required": ["context", "output"]
  9355. },
  9356. "modalities": {
  9357. "type": "object",
  9358. "properties": {
  9359. "input": {
  9360. "type": "array",
  9361. "items": {
  9362. "type": "string",
  9363. "enum": ["text", "audio", "image", "video", "pdf"]
  9364. }
  9365. },
  9366. "output": {
  9367. "type": "array",
  9368. "items": {
  9369. "type": "string",
  9370. "enum": ["text", "audio", "image", "video", "pdf"]
  9371. }
  9372. }
  9373. },
  9374. "required": ["input", "output"]
  9375. },
  9376. "experimental": {
  9377. "type": "boolean"
  9378. },
  9379. "status": {
  9380. "type": "string",
  9381. "enum": ["alpha", "beta", "deprecated"]
  9382. },
  9383. "options": {
  9384. "type": "object",
  9385. "propertyNames": {
  9386. "type": "string"
  9387. },
  9388. "additionalProperties": {}
  9389. },
  9390. "headers": {
  9391. "type": "object",
  9392. "propertyNames": {
  9393. "type": "string"
  9394. },
  9395. "additionalProperties": {
  9396. "type": "string"
  9397. }
  9398. },
  9399. "provider": {
  9400. "type": "object",
  9401. "properties": {
  9402. "npm": {
  9403. "type": "string"
  9404. },
  9405. "api": {
  9406. "type": "string"
  9407. }
  9408. },
  9409. "required": ["npm", "api"]
  9410. },
  9411. "variants": {
  9412. "description": "Variant-specific configuration",
  9413. "type": "object",
  9414. "propertyNames": {
  9415. "type": "string"
  9416. },
  9417. "additionalProperties": {
  9418. "type": "object",
  9419. "properties": {
  9420. "disabled": {
  9421. "description": "Disable this variant for the model",
  9422. "type": "boolean"
  9423. }
  9424. },
  9425. "additionalProperties": {}
  9426. }
  9427. }
  9428. }
  9429. }
  9430. },
  9431. "whitelist": {
  9432. "type": "array",
  9433. "items": {
  9434. "type": "string"
  9435. }
  9436. },
  9437. "blacklist": {
  9438. "type": "array",
  9439. "items": {
  9440. "type": "string"
  9441. }
  9442. },
  9443. "options": {
  9444. "type": "object",
  9445. "properties": {
  9446. "apiKey": {
  9447. "type": "string"
  9448. },
  9449. "baseURL": {
  9450. "type": "string"
  9451. },
  9452. "enterpriseUrl": {
  9453. "description": "GitHub Enterprise URL for copilot authentication",
  9454. "type": "string"
  9455. },
  9456. "setCacheKey": {
  9457. "description": "Enable promptCacheKey for this provider (default false)",
  9458. "type": "boolean"
  9459. },
  9460. "timeout": {
  9461. "description": "Timeout in milliseconds for requests to this provider. Default is 300000 (5 minutes). Set to false to disable timeout.",
  9462. "anyOf": [
  9463. {
  9464. "description": "Timeout in milliseconds for requests to this provider. Default is 300000 (5 minutes). Set to false to disable timeout.",
  9465. "type": "integer",
  9466. "exclusiveMinimum": 0,
  9467. "maximum": 9007199254740991
  9468. },
  9469. {
  9470. "description": "Disable timeout for this provider entirely.",
  9471. "type": "boolean",
  9472. "const": false
  9473. }
  9474. ]
  9475. }
  9476. },
  9477. "additionalProperties": {}
  9478. }
  9479. },
  9480. "additionalProperties": false
  9481. },
  9482. "McpLocalConfig": {
  9483. "type": "object",
  9484. "properties": {
  9485. "type": {
  9486. "description": "Type of MCP server connection",
  9487. "type": "string",
  9488. "const": "local"
  9489. },
  9490. "command": {
  9491. "description": "Command and arguments to run the MCP server",
  9492. "type": "array",
  9493. "items": {
  9494. "type": "string"
  9495. }
  9496. },
  9497. "environment": {
  9498. "description": "Environment variables to set when running the MCP server",
  9499. "type": "object",
  9500. "propertyNames": {
  9501. "type": "string"
  9502. },
  9503. "additionalProperties": {
  9504. "type": "string"
  9505. }
  9506. },
  9507. "enabled": {
  9508. "description": "Enable or disable the MCP server on startup",
  9509. "type": "boolean"
  9510. },
  9511. "timeout": {
  9512. "description": "Timeout in ms for MCP server requests. Defaults to 5000 (5 seconds) if not specified.",
  9513. "type": "integer",
  9514. "exclusiveMinimum": 0,
  9515. "maximum": 9007199254740991
  9516. }
  9517. },
  9518. "required": ["type", "command"],
  9519. "additionalProperties": false
  9520. },
  9521. "McpOAuthConfig": {
  9522. "type": "object",
  9523. "properties": {
  9524. "clientId": {
  9525. "description": "OAuth client ID. If not provided, dynamic client registration (RFC 7591) will be attempted.",
  9526. "type": "string"
  9527. },
  9528. "clientSecret": {
  9529. "description": "OAuth client secret (if required by the authorization server)",
  9530. "type": "string"
  9531. },
  9532. "scope": {
  9533. "description": "OAuth scopes to request during authorization",
  9534. "type": "string"
  9535. }
  9536. },
  9537. "additionalProperties": false
  9538. },
  9539. "McpRemoteConfig": {
  9540. "type": "object",
  9541. "properties": {
  9542. "type": {
  9543. "description": "Type of MCP server connection",
  9544. "type": "string",
  9545. "const": "remote"
  9546. },
  9547. "url": {
  9548. "description": "URL of the remote MCP server",
  9549. "type": "string"
  9550. },
  9551. "enabled": {
  9552. "description": "Enable or disable the MCP server on startup",
  9553. "type": "boolean"
  9554. },
  9555. "headers": {
  9556. "description": "Headers to send with the request",
  9557. "type": "object",
  9558. "propertyNames": {
  9559. "type": "string"
  9560. },
  9561. "additionalProperties": {
  9562. "type": "string"
  9563. }
  9564. },
  9565. "oauth": {
  9566. "description": "OAuth authentication configuration for the MCP server. Set to false to disable OAuth auto-detection.",
  9567. "anyOf": [
  9568. {
  9569. "$ref": "#/components/schemas/McpOAuthConfig"
  9570. },
  9571. {
  9572. "type": "boolean",
  9573. "const": false
  9574. }
  9575. ]
  9576. },
  9577. "timeout": {
  9578. "description": "Timeout in ms for MCP server requests. Defaults to 5000 (5 seconds) if not specified.",
  9579. "type": "integer",
  9580. "exclusiveMinimum": 0,
  9581. "maximum": 9007199254740991
  9582. }
  9583. },
  9584. "required": ["type", "url"],
  9585. "additionalProperties": false
  9586. },
  9587. "LayoutConfig": {
  9588. "description": "@deprecated Always uses stretch layout.",
  9589. "type": "string",
  9590. "enum": ["auto", "stretch"]
  9591. },
  9592. "Config": {
  9593. "type": "object",
  9594. "properties": {
  9595. "$schema": {
  9596. "description": "JSON schema reference for configuration validation",
  9597. "type": "string"
  9598. },
  9599. "theme": {
  9600. "description": "Theme name to use for the interface",
  9601. "type": "string"
  9602. },
  9603. "keybinds": {
  9604. "$ref": "#/components/schemas/KeybindsConfig"
  9605. },
  9606. "logLevel": {
  9607. "$ref": "#/components/schemas/LogLevel"
  9608. },
  9609. "tui": {
  9610. "description": "TUI specific settings",
  9611. "type": "object",
  9612. "properties": {
  9613. "scroll_speed": {
  9614. "description": "TUI scroll speed",
  9615. "type": "number",
  9616. "minimum": 0.001
  9617. },
  9618. "scroll_acceleration": {
  9619. "description": "Scroll acceleration settings",
  9620. "type": "object",
  9621. "properties": {
  9622. "enabled": {
  9623. "description": "Enable scroll acceleration",
  9624. "type": "boolean"
  9625. }
  9626. },
  9627. "required": ["enabled"]
  9628. },
  9629. "diff_style": {
  9630. "description": "Control diff rendering style: 'auto' adapts to terminal width, 'stacked' always shows single column",
  9631. "type": "string",
  9632. "enum": ["auto", "stacked"]
  9633. }
  9634. }
  9635. },
  9636. "server": {
  9637. "$ref": "#/components/schemas/ServerConfig"
  9638. },
  9639. "command": {
  9640. "description": "Command configuration, see https://opencode.ai/docs/commands",
  9641. "type": "object",
  9642. "propertyNames": {
  9643. "type": "string"
  9644. },
  9645. "additionalProperties": {
  9646. "type": "object",
  9647. "properties": {
  9648. "template": {
  9649. "type": "string"
  9650. },
  9651. "description": {
  9652. "type": "string"
  9653. },
  9654. "agent": {
  9655. "type": "string"
  9656. },
  9657. "model": {
  9658. "type": "string"
  9659. },
  9660. "subtask": {
  9661. "type": "boolean"
  9662. }
  9663. },
  9664. "required": ["template"]
  9665. }
  9666. },
  9667. "skills": {
  9668. "description": "Additional skill folder paths",
  9669. "type": "object",
  9670. "properties": {
  9671. "paths": {
  9672. "description": "Additional paths to skill folders",
  9673. "type": "array",
  9674. "items": {
  9675. "type": "string"
  9676. }
  9677. },
  9678. "urls": {
  9679. "description": "URLs to fetch skills from (e.g., https://example.com/.well-known/skills/)",
  9680. "type": "array",
  9681. "items": {
  9682. "type": "string"
  9683. }
  9684. }
  9685. }
  9686. },
  9687. "watcher": {
  9688. "type": "object",
  9689. "properties": {
  9690. "ignore": {
  9691. "type": "array",
  9692. "items": {
  9693. "type": "string"
  9694. }
  9695. }
  9696. }
  9697. },
  9698. "plugin": {
  9699. "type": "array",
  9700. "items": {
  9701. "type": "string"
  9702. }
  9703. },
  9704. "snapshot": {
  9705. "type": "boolean"
  9706. },
  9707. "share": {
  9708. "description": "Control sharing behavior:'manual' allows manual sharing via commands, 'auto' enables automatic sharing, 'disabled' disables all sharing",
  9709. "type": "string",
  9710. "enum": ["manual", "auto", "disabled"]
  9711. },
  9712. "autoshare": {
  9713. "description": "@deprecated Use 'share' field instead. Share newly created sessions automatically",
  9714. "type": "boolean"
  9715. },
  9716. "autoupdate": {
  9717. "description": "Automatically update to the latest version. Set to true to auto-update, false to disable, or 'notify' to show update notifications",
  9718. "anyOf": [
  9719. {
  9720. "type": "boolean"
  9721. },
  9722. {
  9723. "type": "string",
  9724. "const": "notify"
  9725. }
  9726. ]
  9727. },
  9728. "disabled_providers": {
  9729. "description": "Disable providers that are loaded automatically",
  9730. "type": "array",
  9731. "items": {
  9732. "type": "string"
  9733. }
  9734. },
  9735. "enabled_providers": {
  9736. "description": "When set, ONLY these providers will be enabled. All other providers will be ignored",
  9737. "type": "array",
  9738. "items": {
  9739. "type": "string"
  9740. }
  9741. },
  9742. "model": {
  9743. "description": "Model to use in the format of provider/model, eg anthropic/claude-2",
  9744. "type": "string"
  9745. },
  9746. "small_model": {
  9747. "description": "Small model to use for tasks like title generation in the format of provider/model",
  9748. "type": "string"
  9749. },
  9750. "default_agent": {
  9751. "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.",
  9752. "type": "string"
  9753. },
  9754. "username": {
  9755. "description": "Custom username to display in conversations instead of system username",
  9756. "type": "string"
  9757. },
  9758. "mode": {
  9759. "description": "@deprecated Use `agent` field instead.",
  9760. "type": "object",
  9761. "properties": {
  9762. "build": {
  9763. "$ref": "#/components/schemas/AgentConfig"
  9764. },
  9765. "plan": {
  9766. "$ref": "#/components/schemas/AgentConfig"
  9767. }
  9768. },
  9769. "additionalProperties": {
  9770. "$ref": "#/components/schemas/AgentConfig"
  9771. }
  9772. },
  9773. "agent": {
  9774. "description": "Agent configuration, see https://opencode.ai/docs/agents",
  9775. "type": "object",
  9776. "properties": {
  9777. "plan": {
  9778. "$ref": "#/components/schemas/AgentConfig"
  9779. },
  9780. "build": {
  9781. "$ref": "#/components/schemas/AgentConfig"
  9782. },
  9783. "general": {
  9784. "$ref": "#/components/schemas/AgentConfig"
  9785. },
  9786. "explore": {
  9787. "$ref": "#/components/schemas/AgentConfig"
  9788. },
  9789. "title": {
  9790. "$ref": "#/components/schemas/AgentConfig"
  9791. },
  9792. "summary": {
  9793. "$ref": "#/components/schemas/AgentConfig"
  9794. },
  9795. "compaction": {
  9796. "$ref": "#/components/schemas/AgentConfig"
  9797. }
  9798. },
  9799. "additionalProperties": {
  9800. "$ref": "#/components/schemas/AgentConfig"
  9801. }
  9802. },
  9803. "provider": {
  9804. "description": "Custom provider configurations and model overrides",
  9805. "type": "object",
  9806. "propertyNames": {
  9807. "type": "string"
  9808. },
  9809. "additionalProperties": {
  9810. "$ref": "#/components/schemas/ProviderConfig"
  9811. }
  9812. },
  9813. "mcp": {
  9814. "description": "MCP (Model Context Protocol) server configurations",
  9815. "type": "object",
  9816. "propertyNames": {
  9817. "type": "string"
  9818. },
  9819. "additionalProperties": {
  9820. "anyOf": [
  9821. {
  9822. "anyOf": [
  9823. {
  9824. "$ref": "#/components/schemas/McpLocalConfig"
  9825. },
  9826. {
  9827. "$ref": "#/components/schemas/McpRemoteConfig"
  9828. }
  9829. ]
  9830. },
  9831. {
  9832. "type": "object",
  9833. "properties": {
  9834. "enabled": {
  9835. "type": "boolean"
  9836. }
  9837. },
  9838. "required": ["enabled"],
  9839. "additionalProperties": false
  9840. }
  9841. ]
  9842. }
  9843. },
  9844. "formatter": {
  9845. "anyOf": [
  9846. {
  9847. "type": "boolean",
  9848. "const": false
  9849. },
  9850. {
  9851. "type": "object",
  9852. "propertyNames": {
  9853. "type": "string"
  9854. },
  9855. "additionalProperties": {
  9856. "type": "object",
  9857. "properties": {
  9858. "disabled": {
  9859. "type": "boolean"
  9860. },
  9861. "command": {
  9862. "type": "array",
  9863. "items": {
  9864. "type": "string"
  9865. }
  9866. },
  9867. "environment": {
  9868. "type": "object",
  9869. "propertyNames": {
  9870. "type": "string"
  9871. },
  9872. "additionalProperties": {
  9873. "type": "string"
  9874. }
  9875. },
  9876. "extensions": {
  9877. "type": "array",
  9878. "items": {
  9879. "type": "string"
  9880. }
  9881. }
  9882. }
  9883. }
  9884. }
  9885. ]
  9886. },
  9887. "lsp": {
  9888. "anyOf": [
  9889. {
  9890. "type": "boolean",
  9891. "const": false
  9892. },
  9893. {
  9894. "type": "object",
  9895. "propertyNames": {
  9896. "type": "string"
  9897. },
  9898. "additionalProperties": {
  9899. "anyOf": [
  9900. {
  9901. "type": "object",
  9902. "properties": {
  9903. "disabled": {
  9904. "type": "boolean",
  9905. "const": true
  9906. }
  9907. },
  9908. "required": ["disabled"]
  9909. },
  9910. {
  9911. "type": "object",
  9912. "properties": {
  9913. "command": {
  9914. "type": "array",
  9915. "items": {
  9916. "type": "string"
  9917. }
  9918. },
  9919. "extensions": {
  9920. "type": "array",
  9921. "items": {
  9922. "type": "string"
  9923. }
  9924. },
  9925. "disabled": {
  9926. "type": "boolean"
  9927. },
  9928. "env": {
  9929. "type": "object",
  9930. "propertyNames": {
  9931. "type": "string"
  9932. },
  9933. "additionalProperties": {
  9934. "type": "string"
  9935. }
  9936. },
  9937. "initialization": {
  9938. "type": "object",
  9939. "propertyNames": {
  9940. "type": "string"
  9941. },
  9942. "additionalProperties": {}
  9943. }
  9944. },
  9945. "required": ["command"]
  9946. }
  9947. ]
  9948. }
  9949. }
  9950. ]
  9951. },
  9952. "instructions": {
  9953. "description": "Additional instruction files or patterns to include",
  9954. "type": "array",
  9955. "items": {
  9956. "type": "string"
  9957. }
  9958. },
  9959. "layout": {
  9960. "$ref": "#/components/schemas/LayoutConfig"
  9961. },
  9962. "permission": {
  9963. "$ref": "#/components/schemas/PermissionConfig"
  9964. },
  9965. "tools": {
  9966. "type": "object",
  9967. "propertyNames": {
  9968. "type": "string"
  9969. },
  9970. "additionalProperties": {
  9971. "type": "boolean"
  9972. }
  9973. },
  9974. "enterprise": {
  9975. "type": "object",
  9976. "properties": {
  9977. "url": {
  9978. "description": "Enterprise URL",
  9979. "type": "string"
  9980. }
  9981. }
  9982. },
  9983. "compaction": {
  9984. "type": "object",
  9985. "properties": {
  9986. "auto": {
  9987. "description": "Enable automatic compaction when context is full (default: true)",
  9988. "type": "boolean"
  9989. },
  9990. "prune": {
  9991. "description": "Enable pruning of old tool outputs (default: true)",
  9992. "type": "boolean"
  9993. },
  9994. "reserved": {
  9995. "description": "Token buffer for compaction. Leaves enough window to avoid overflow during compaction.",
  9996. "type": "integer",
  9997. "minimum": 0,
  9998. "maximum": 9007199254740991
  9999. }
  10000. }
  10001. },
  10002. "experimental": {
  10003. "type": "object",
  10004. "properties": {
  10005. "disable_paste_summary": {
  10006. "type": "boolean"
  10007. },
  10008. "batch_tool": {
  10009. "description": "Enable the batch tool",
  10010. "type": "boolean"
  10011. },
  10012. "openTelemetry": {
  10013. "description": "Enable OpenTelemetry spans for AI SDK calls (using the 'experimental_telemetry' flag)",
  10014. "type": "boolean"
  10015. },
  10016. "primary_tools": {
  10017. "description": "Tools that should only be available to primary agents.",
  10018. "type": "array",
  10019. "items": {
  10020. "type": "string"
  10021. }
  10022. },
  10023. "continue_loop_on_deny": {
  10024. "description": "Continue the agent loop when a tool call is denied",
  10025. "type": "boolean"
  10026. },
  10027. "mcp_timeout": {
  10028. "description": "Timeout in milliseconds for model context protocol (MCP) requests",
  10029. "type": "integer",
  10030. "exclusiveMinimum": 0,
  10031. "maximum": 9007199254740991
  10032. }
  10033. }
  10034. }
  10035. },
  10036. "additionalProperties": false
  10037. },
  10038. "BadRequestError": {
  10039. "type": "object",
  10040. "properties": {
  10041. "data": {},
  10042. "errors": {
  10043. "type": "array",
  10044. "items": {
  10045. "type": "object",
  10046. "propertyNames": {
  10047. "type": "string"
  10048. },
  10049. "additionalProperties": {}
  10050. }
  10051. },
  10052. "success": {
  10053. "type": "boolean",
  10054. "const": false
  10055. }
  10056. },
  10057. "required": ["data", "errors", "success"]
  10058. },
  10059. "OAuth": {
  10060. "type": "object",
  10061. "properties": {
  10062. "type": {
  10063. "type": "string",
  10064. "const": "oauth"
  10065. },
  10066. "refresh": {
  10067. "type": "string"
  10068. },
  10069. "access": {
  10070. "type": "string"
  10071. },
  10072. "expires": {
  10073. "type": "number"
  10074. },
  10075. "accountId": {
  10076. "type": "string"
  10077. },
  10078. "enterpriseUrl": {
  10079. "type": "string"
  10080. }
  10081. },
  10082. "required": ["type", "refresh", "access", "expires"]
  10083. },
  10084. "ApiAuth": {
  10085. "type": "object",
  10086. "properties": {
  10087. "type": {
  10088. "type": "string",
  10089. "const": "api"
  10090. },
  10091. "key": {
  10092. "type": "string"
  10093. }
  10094. },
  10095. "required": ["type", "key"]
  10096. },
  10097. "WellKnownAuth": {
  10098. "type": "object",
  10099. "properties": {
  10100. "type": {
  10101. "type": "string",
  10102. "const": "wellknown"
  10103. },
  10104. "key": {
  10105. "type": "string"
  10106. },
  10107. "token": {
  10108. "type": "string"
  10109. }
  10110. },
  10111. "required": ["type", "key", "token"]
  10112. },
  10113. "Auth": {
  10114. "anyOf": [
  10115. {
  10116. "$ref": "#/components/schemas/OAuth"
  10117. },
  10118. {
  10119. "$ref": "#/components/schemas/ApiAuth"
  10120. },
  10121. {
  10122. "$ref": "#/components/schemas/WellKnownAuth"
  10123. }
  10124. ]
  10125. },
  10126. "NotFoundError": {
  10127. "type": "object",
  10128. "properties": {
  10129. "name": {
  10130. "type": "string",
  10131. "const": "NotFoundError"
  10132. },
  10133. "data": {
  10134. "type": "object",
  10135. "properties": {
  10136. "message": {
  10137. "type": "string"
  10138. }
  10139. },
  10140. "required": ["message"]
  10141. }
  10142. },
  10143. "required": ["name", "data"]
  10144. },
  10145. "Model": {
  10146. "type": "object",
  10147. "properties": {
  10148. "id": {
  10149. "type": "string"
  10150. },
  10151. "providerID": {
  10152. "type": "string"
  10153. },
  10154. "api": {
  10155. "type": "object",
  10156. "properties": {
  10157. "id": {
  10158. "type": "string"
  10159. },
  10160. "url": {
  10161. "type": "string"
  10162. },
  10163. "npm": {
  10164. "type": "string"
  10165. }
  10166. },
  10167. "required": ["id", "url", "npm"]
  10168. },
  10169. "name": {
  10170. "type": "string"
  10171. },
  10172. "family": {
  10173. "type": "string"
  10174. },
  10175. "capabilities": {
  10176. "type": "object",
  10177. "properties": {
  10178. "temperature": {
  10179. "type": "boolean"
  10180. },
  10181. "reasoning": {
  10182. "type": "boolean"
  10183. },
  10184. "attachment": {
  10185. "type": "boolean"
  10186. },
  10187. "toolcall": {
  10188. "type": "boolean"
  10189. },
  10190. "input": {
  10191. "type": "object",
  10192. "properties": {
  10193. "text": {
  10194. "type": "boolean"
  10195. },
  10196. "audio": {
  10197. "type": "boolean"
  10198. },
  10199. "image": {
  10200. "type": "boolean"
  10201. },
  10202. "video": {
  10203. "type": "boolean"
  10204. },
  10205. "pdf": {
  10206. "type": "boolean"
  10207. }
  10208. },
  10209. "required": ["text", "audio", "image", "video", "pdf"]
  10210. },
  10211. "output": {
  10212. "type": "object",
  10213. "properties": {
  10214. "text": {
  10215. "type": "boolean"
  10216. },
  10217. "audio": {
  10218. "type": "boolean"
  10219. },
  10220. "image": {
  10221. "type": "boolean"
  10222. },
  10223. "video": {
  10224. "type": "boolean"
  10225. },
  10226. "pdf": {
  10227. "type": "boolean"
  10228. }
  10229. },
  10230. "required": ["text", "audio", "image", "video", "pdf"]
  10231. },
  10232. "interleaved": {
  10233. "anyOf": [
  10234. {
  10235. "type": "boolean"
  10236. },
  10237. {
  10238. "type": "object",
  10239. "properties": {
  10240. "field": {
  10241. "type": "string",
  10242. "enum": ["reasoning_content", "reasoning_details"]
  10243. }
  10244. },
  10245. "required": ["field"]
  10246. }
  10247. ]
  10248. }
  10249. },
  10250. "required": ["temperature", "reasoning", "attachment", "toolcall", "input", "output", "interleaved"]
  10251. },
  10252. "cost": {
  10253. "type": "object",
  10254. "properties": {
  10255. "input": {
  10256. "type": "number"
  10257. },
  10258. "output": {
  10259. "type": "number"
  10260. },
  10261. "cache": {
  10262. "type": "object",
  10263. "properties": {
  10264. "read": {
  10265. "type": "number"
  10266. },
  10267. "write": {
  10268. "type": "number"
  10269. }
  10270. },
  10271. "required": ["read", "write"]
  10272. },
  10273. "experimentalOver200K": {
  10274. "type": "object",
  10275. "properties": {
  10276. "input": {
  10277. "type": "number"
  10278. },
  10279. "output": {
  10280. "type": "number"
  10281. },
  10282. "cache": {
  10283. "type": "object",
  10284. "properties": {
  10285. "read": {
  10286. "type": "number"
  10287. },
  10288. "write": {
  10289. "type": "number"
  10290. }
  10291. },
  10292. "required": ["read", "write"]
  10293. }
  10294. },
  10295. "required": ["input", "output", "cache"]
  10296. }
  10297. },
  10298. "required": ["input", "output", "cache"]
  10299. },
  10300. "limit": {
  10301. "type": "object",
  10302. "properties": {
  10303. "context": {
  10304. "type": "number"
  10305. },
  10306. "input": {
  10307. "type": "number"
  10308. },
  10309. "output": {
  10310. "type": "number"
  10311. }
  10312. },
  10313. "required": ["context", "output"]
  10314. },
  10315. "status": {
  10316. "type": "string",
  10317. "enum": ["alpha", "beta", "deprecated", "active"]
  10318. },
  10319. "options": {
  10320. "type": "object",
  10321. "propertyNames": {
  10322. "type": "string"
  10323. },
  10324. "additionalProperties": {}
  10325. },
  10326. "headers": {
  10327. "type": "object",
  10328. "propertyNames": {
  10329. "type": "string"
  10330. },
  10331. "additionalProperties": {
  10332. "type": "string"
  10333. }
  10334. },
  10335. "release_date": {
  10336. "type": "string"
  10337. },
  10338. "variants": {
  10339. "type": "object",
  10340. "propertyNames": {
  10341. "type": "string"
  10342. },
  10343. "additionalProperties": {
  10344. "type": "object",
  10345. "propertyNames": {
  10346. "type": "string"
  10347. },
  10348. "additionalProperties": {}
  10349. }
  10350. }
  10351. },
  10352. "required": [
  10353. "id",
  10354. "providerID",
  10355. "api",
  10356. "name",
  10357. "capabilities",
  10358. "cost",
  10359. "limit",
  10360. "status",
  10361. "options",
  10362. "headers",
  10363. "release_date"
  10364. ]
  10365. },
  10366. "Provider": {
  10367. "type": "object",
  10368. "properties": {
  10369. "id": {
  10370. "type": "string"
  10371. },
  10372. "name": {
  10373. "type": "string"
  10374. },
  10375. "source": {
  10376. "type": "string",
  10377. "enum": ["env", "config", "custom", "api"]
  10378. },
  10379. "env": {
  10380. "type": "array",
  10381. "items": {
  10382. "type": "string"
  10383. }
  10384. },
  10385. "key": {
  10386. "type": "string"
  10387. },
  10388. "options": {
  10389. "type": "object",
  10390. "propertyNames": {
  10391. "type": "string"
  10392. },
  10393. "additionalProperties": {}
  10394. },
  10395. "models": {
  10396. "type": "object",
  10397. "propertyNames": {
  10398. "type": "string"
  10399. },
  10400. "additionalProperties": {
  10401. "$ref": "#/components/schemas/Model"
  10402. }
  10403. }
  10404. },
  10405. "required": ["id", "name", "source", "env", "options", "models"]
  10406. },
  10407. "ToolIDs": {
  10408. "type": "array",
  10409. "items": {
  10410. "type": "string"
  10411. }
  10412. },
  10413. "ToolListItem": {
  10414. "type": "object",
  10415. "properties": {
  10416. "id": {
  10417. "type": "string"
  10418. },
  10419. "description": {
  10420. "type": "string"
  10421. },
  10422. "parameters": {}
  10423. },
  10424. "required": ["id", "description", "parameters"]
  10425. },
  10426. "ToolList": {
  10427. "type": "array",
  10428. "items": {
  10429. "$ref": "#/components/schemas/ToolListItem"
  10430. }
  10431. },
  10432. "Worktree": {
  10433. "type": "object",
  10434. "properties": {
  10435. "name": {
  10436. "type": "string"
  10437. },
  10438. "branch": {
  10439. "type": "string"
  10440. },
  10441. "directory": {
  10442. "type": "string"
  10443. }
  10444. },
  10445. "required": ["name", "branch", "directory"]
  10446. },
  10447. "WorktreeCreateInput": {
  10448. "type": "object",
  10449. "properties": {
  10450. "name": {
  10451. "type": "string"
  10452. },
  10453. "startCommand": {
  10454. "description": "Additional startup script to run after the project's start command",
  10455. "type": "string"
  10456. }
  10457. }
  10458. },
  10459. "WorktreeRemoveInput": {
  10460. "type": "object",
  10461. "properties": {
  10462. "directory": {
  10463. "type": "string"
  10464. }
  10465. },
  10466. "required": ["directory"]
  10467. },
  10468. "WorktreeResetInput": {
  10469. "type": "object",
  10470. "properties": {
  10471. "directory": {
  10472. "type": "string"
  10473. }
  10474. },
  10475. "required": ["directory"]
  10476. },
  10477. "McpResource": {
  10478. "type": "object",
  10479. "properties": {
  10480. "name": {
  10481. "type": "string"
  10482. },
  10483. "uri": {
  10484. "type": "string"
  10485. },
  10486. "description": {
  10487. "type": "string"
  10488. },
  10489. "mimeType": {
  10490. "type": "string"
  10491. },
  10492. "client": {
  10493. "type": "string"
  10494. }
  10495. },
  10496. "required": ["name", "uri", "client"]
  10497. },
  10498. "TextPartInput": {
  10499. "type": "object",
  10500. "properties": {
  10501. "id": {
  10502. "type": "string"
  10503. },
  10504. "type": {
  10505. "type": "string",
  10506. "const": "text"
  10507. },
  10508. "text": {
  10509. "type": "string"
  10510. },
  10511. "synthetic": {
  10512. "type": "boolean"
  10513. },
  10514. "ignored": {
  10515. "type": "boolean"
  10516. },
  10517. "time": {
  10518. "type": "object",
  10519. "properties": {
  10520. "start": {
  10521. "type": "number"
  10522. },
  10523. "end": {
  10524. "type": "number"
  10525. }
  10526. },
  10527. "required": ["start"]
  10528. },
  10529. "metadata": {
  10530. "type": "object",
  10531. "propertyNames": {
  10532. "type": "string"
  10533. },
  10534. "additionalProperties": {}
  10535. }
  10536. },
  10537. "required": ["type", "text"]
  10538. },
  10539. "FilePartInput": {
  10540. "type": "object",
  10541. "properties": {
  10542. "id": {
  10543. "type": "string"
  10544. },
  10545. "type": {
  10546. "type": "string",
  10547. "const": "file"
  10548. },
  10549. "mime": {
  10550. "type": "string"
  10551. },
  10552. "filename": {
  10553. "type": "string"
  10554. },
  10555. "url": {
  10556. "type": "string"
  10557. },
  10558. "source": {
  10559. "$ref": "#/components/schemas/FilePartSource"
  10560. }
  10561. },
  10562. "required": ["type", "mime", "url"]
  10563. },
  10564. "AgentPartInput": {
  10565. "type": "object",
  10566. "properties": {
  10567. "id": {
  10568. "type": "string"
  10569. },
  10570. "type": {
  10571. "type": "string",
  10572. "const": "agent"
  10573. },
  10574. "name": {
  10575. "type": "string"
  10576. },
  10577. "source": {
  10578. "type": "object",
  10579. "properties": {
  10580. "value": {
  10581. "type": "string"
  10582. },
  10583. "start": {
  10584. "type": "integer",
  10585. "minimum": -9007199254740991,
  10586. "maximum": 9007199254740991
  10587. },
  10588. "end": {
  10589. "type": "integer",
  10590. "minimum": -9007199254740991,
  10591. "maximum": 9007199254740991
  10592. }
  10593. },
  10594. "required": ["value", "start", "end"]
  10595. }
  10596. },
  10597. "required": ["type", "name"]
  10598. },
  10599. "SubtaskPartInput": {
  10600. "type": "object",
  10601. "properties": {
  10602. "id": {
  10603. "type": "string"
  10604. },
  10605. "type": {
  10606. "type": "string",
  10607. "const": "subtask"
  10608. },
  10609. "prompt": {
  10610. "type": "string"
  10611. },
  10612. "description": {
  10613. "type": "string"
  10614. },
  10615. "agent": {
  10616. "type": "string"
  10617. },
  10618. "model": {
  10619. "type": "object",
  10620. "properties": {
  10621. "providerID": {
  10622. "type": "string"
  10623. },
  10624. "modelID": {
  10625. "type": "string"
  10626. }
  10627. },
  10628. "required": ["providerID", "modelID"]
  10629. },
  10630. "command": {
  10631. "type": "string"
  10632. }
  10633. },
  10634. "required": ["type", "prompt", "description", "agent"]
  10635. },
  10636. "ProviderAuthMethod": {
  10637. "type": "object",
  10638. "properties": {
  10639. "type": {
  10640. "anyOf": [
  10641. {
  10642. "type": "string",
  10643. "const": "oauth"
  10644. },
  10645. {
  10646. "type": "string",
  10647. "const": "api"
  10648. }
  10649. ]
  10650. },
  10651. "label": {
  10652. "type": "string"
  10653. }
  10654. },
  10655. "required": ["type", "label"]
  10656. },
  10657. "ProviderAuthAuthorization": {
  10658. "type": "object",
  10659. "properties": {
  10660. "url": {
  10661. "type": "string"
  10662. },
  10663. "method": {
  10664. "anyOf": [
  10665. {
  10666. "type": "string",
  10667. "const": "auto"
  10668. },
  10669. {
  10670. "type": "string",
  10671. "const": "code"
  10672. }
  10673. ]
  10674. },
  10675. "instructions": {
  10676. "type": "string"
  10677. }
  10678. },
  10679. "required": ["url", "method", "instructions"]
  10680. },
  10681. "Symbol": {
  10682. "type": "object",
  10683. "properties": {
  10684. "name": {
  10685. "type": "string"
  10686. },
  10687. "kind": {
  10688. "type": "number"
  10689. },
  10690. "location": {
  10691. "type": "object",
  10692. "properties": {
  10693. "uri": {
  10694. "type": "string"
  10695. },
  10696. "range": {
  10697. "$ref": "#/components/schemas/Range"
  10698. }
  10699. },
  10700. "required": ["uri", "range"]
  10701. }
  10702. },
  10703. "required": ["name", "kind", "location"]
  10704. },
  10705. "FileNode": {
  10706. "type": "object",
  10707. "properties": {
  10708. "name": {
  10709. "type": "string"
  10710. },
  10711. "path": {
  10712. "type": "string"
  10713. },
  10714. "absolute": {
  10715. "type": "string"
  10716. },
  10717. "type": {
  10718. "type": "string",
  10719. "enum": ["file", "directory"]
  10720. },
  10721. "ignored": {
  10722. "type": "boolean"
  10723. }
  10724. },
  10725. "required": ["name", "path", "absolute", "type", "ignored"]
  10726. },
  10727. "FileContent": {
  10728. "type": "object",
  10729. "properties": {
  10730. "type": {
  10731. "type": "string",
  10732. "enum": ["text", "binary"]
  10733. },
  10734. "content": {
  10735. "type": "string"
  10736. },
  10737. "diff": {
  10738. "type": "string"
  10739. },
  10740. "patch": {
  10741. "type": "object",
  10742. "properties": {
  10743. "oldFileName": {
  10744. "type": "string"
  10745. },
  10746. "newFileName": {
  10747. "type": "string"
  10748. },
  10749. "oldHeader": {
  10750. "type": "string"
  10751. },
  10752. "newHeader": {
  10753. "type": "string"
  10754. },
  10755. "hunks": {
  10756. "type": "array",
  10757. "items": {
  10758. "type": "object",
  10759. "properties": {
  10760. "oldStart": {
  10761. "type": "number"
  10762. },
  10763. "oldLines": {
  10764. "type": "number"
  10765. },
  10766. "newStart": {
  10767. "type": "number"
  10768. },
  10769. "newLines": {
  10770. "type": "number"
  10771. },
  10772. "lines": {
  10773. "type": "array",
  10774. "items": {
  10775. "type": "string"
  10776. }
  10777. }
  10778. },
  10779. "required": ["oldStart", "oldLines", "newStart", "newLines", "lines"]
  10780. }
  10781. },
  10782. "index": {
  10783. "type": "string"
  10784. }
  10785. },
  10786. "required": ["oldFileName", "newFileName", "hunks"]
  10787. },
  10788. "encoding": {
  10789. "type": "string",
  10790. "const": "base64"
  10791. },
  10792. "mimeType": {
  10793. "type": "string"
  10794. }
  10795. },
  10796. "required": ["type", "content"]
  10797. },
  10798. "File": {
  10799. "type": "object",
  10800. "properties": {
  10801. "path": {
  10802. "type": "string"
  10803. },
  10804. "added": {
  10805. "type": "integer",
  10806. "minimum": -9007199254740991,
  10807. "maximum": 9007199254740991
  10808. },
  10809. "removed": {
  10810. "type": "integer",
  10811. "minimum": -9007199254740991,
  10812. "maximum": 9007199254740991
  10813. },
  10814. "status": {
  10815. "type": "string",
  10816. "enum": ["added", "deleted", "modified"]
  10817. }
  10818. },
  10819. "required": ["path", "added", "removed", "status"]
  10820. },
  10821. "MCPStatusConnected": {
  10822. "type": "object",
  10823. "properties": {
  10824. "status": {
  10825. "type": "string",
  10826. "const": "connected"
  10827. }
  10828. },
  10829. "required": ["status"]
  10830. },
  10831. "MCPStatusDisabled": {
  10832. "type": "object",
  10833. "properties": {
  10834. "status": {
  10835. "type": "string",
  10836. "const": "disabled"
  10837. }
  10838. },
  10839. "required": ["status"]
  10840. },
  10841. "MCPStatusFailed": {
  10842. "type": "object",
  10843. "properties": {
  10844. "status": {
  10845. "type": "string",
  10846. "const": "failed"
  10847. },
  10848. "error": {
  10849. "type": "string"
  10850. }
  10851. },
  10852. "required": ["status", "error"]
  10853. },
  10854. "MCPStatusNeedsAuth": {
  10855. "type": "object",
  10856. "properties": {
  10857. "status": {
  10858. "type": "string",
  10859. "const": "needs_auth"
  10860. }
  10861. },
  10862. "required": ["status"]
  10863. },
  10864. "MCPStatusNeedsClientRegistration": {
  10865. "type": "object",
  10866. "properties": {
  10867. "status": {
  10868. "type": "string",
  10869. "const": "needs_client_registration"
  10870. },
  10871. "error": {
  10872. "type": "string"
  10873. }
  10874. },
  10875. "required": ["status", "error"]
  10876. },
  10877. "MCPStatus": {
  10878. "anyOf": [
  10879. {
  10880. "$ref": "#/components/schemas/MCPStatusConnected"
  10881. },
  10882. {
  10883. "$ref": "#/components/schemas/MCPStatusDisabled"
  10884. },
  10885. {
  10886. "$ref": "#/components/schemas/MCPStatusFailed"
  10887. },
  10888. {
  10889. "$ref": "#/components/schemas/MCPStatusNeedsAuth"
  10890. },
  10891. {
  10892. "$ref": "#/components/schemas/MCPStatusNeedsClientRegistration"
  10893. }
  10894. ]
  10895. },
  10896. "Path": {
  10897. "type": "object",
  10898. "properties": {
  10899. "home": {
  10900. "type": "string"
  10901. },
  10902. "state": {
  10903. "type": "string"
  10904. },
  10905. "config": {
  10906. "type": "string"
  10907. },
  10908. "worktree": {
  10909. "type": "string"
  10910. },
  10911. "directory": {
  10912. "type": "string"
  10913. }
  10914. },
  10915. "required": ["home", "state", "config", "worktree", "directory"]
  10916. },
  10917. "VcsInfo": {
  10918. "type": "object",
  10919. "properties": {
  10920. "branch": {
  10921. "type": "string"
  10922. }
  10923. },
  10924. "required": ["branch"]
  10925. },
  10926. "Command": {
  10927. "type": "object",
  10928. "properties": {
  10929. "name": {
  10930. "type": "string"
  10931. },
  10932. "description": {
  10933. "type": "string"
  10934. },
  10935. "agent": {
  10936. "type": "string"
  10937. },
  10938. "model": {
  10939. "type": "string"
  10940. },
  10941. "source": {
  10942. "type": "string",
  10943. "enum": ["command", "mcp", "skill"]
  10944. },
  10945. "template": {
  10946. "anyOf": [
  10947. {
  10948. "type": "string"
  10949. },
  10950. {
  10951. "type": "string"
  10952. }
  10953. ]
  10954. },
  10955. "subtask": {
  10956. "type": "boolean"
  10957. },
  10958. "hints": {
  10959. "type": "array",
  10960. "items": {
  10961. "type": "string"
  10962. }
  10963. }
  10964. },
  10965. "required": ["name", "template", "hints"]
  10966. },
  10967. "Agent": {
  10968. "type": "object",
  10969. "properties": {
  10970. "name": {
  10971. "type": "string"
  10972. },
  10973. "description": {
  10974. "type": "string"
  10975. },
  10976. "mode": {
  10977. "type": "string",
  10978. "enum": ["subagent", "primary", "all"]
  10979. },
  10980. "native": {
  10981. "type": "boolean"
  10982. },
  10983. "hidden": {
  10984. "type": "boolean"
  10985. },
  10986. "topP": {
  10987. "type": "number"
  10988. },
  10989. "temperature": {
  10990. "type": "number"
  10991. },
  10992. "color": {
  10993. "type": "string"
  10994. },
  10995. "permission": {
  10996. "$ref": "#/components/schemas/PermissionRuleset"
  10997. },
  10998. "model": {
  10999. "type": "object",
  11000. "properties": {
  11001. "modelID": {
  11002. "type": "string"
  11003. },
  11004. "providerID": {
  11005. "type": "string"
  11006. }
  11007. },
  11008. "required": ["modelID", "providerID"]
  11009. },
  11010. "variant": {
  11011. "type": "string"
  11012. },
  11013. "prompt": {
  11014. "type": "string"
  11015. },
  11016. "options": {
  11017. "type": "object",
  11018. "propertyNames": {
  11019. "type": "string"
  11020. },
  11021. "additionalProperties": {}
  11022. },
  11023. "steps": {
  11024. "type": "integer",
  11025. "exclusiveMinimum": 0,
  11026. "maximum": 9007199254740991
  11027. }
  11028. },
  11029. "required": ["name", "mode", "permission", "options"]
  11030. },
  11031. "LSPStatus": {
  11032. "type": "object",
  11033. "properties": {
  11034. "id": {
  11035. "type": "string"
  11036. },
  11037. "name": {
  11038. "type": "string"
  11039. },
  11040. "root": {
  11041. "type": "string"
  11042. },
  11043. "status": {
  11044. "anyOf": [
  11045. {
  11046. "type": "string",
  11047. "const": "connected"
  11048. },
  11049. {
  11050. "type": "string",
  11051. "const": "error"
  11052. }
  11053. ]
  11054. }
  11055. },
  11056. "required": ["id", "name", "root", "status"]
  11057. },
  11058. "FormatterStatus": {
  11059. "type": "object",
  11060. "properties": {
  11061. "name": {
  11062. "type": "string"
  11063. },
  11064. "extensions": {
  11065. "type": "array",
  11066. "items": {
  11067. "type": "string"
  11068. }
  11069. },
  11070. "enabled": {
  11071. "type": "boolean"
  11072. }
  11073. },
  11074. "required": ["name", "extensions", "enabled"]
  11075. }
  11076. }
  11077. }
  11078. }