openapi.json 263 KB

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