openapi.json 277 KB

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