openapi.json 281 KB

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