openapi.json 300 KB

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