openapi.json 312 KB

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