openapi.json 277 KB

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