openapi.json 298 KB

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