@seedcord/errors 0.11.1 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/{SeedcordError-BfC-202u.mjs → SeedcordError-CFERGyXK.mjs} +7 -10
- package/dist/SeedcordError-CFERGyXK.mjs.map +1 -0
- package/dist/{SeedcordError-Dv5fkEzH.d.mts → SeedcordError-DOERCvXL.d.mts} +7 -10
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +2 -2
- package/dist/internal.index.d.mts +4 -4
- package/dist/internal.index.mjs +1 -1
- package/package.json +5 -5
- package/dist/SeedcordError-BfC-202u.mjs.map +0 -1
package/README.md
CHANGED
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
<div align="center">
|
|
9
9
|
<h3>The whole Discord bot, typed end to end</h3>
|
|
10
10
|
<a href="https://seedcord.org">Website</a> ·
|
|
11
|
-
<a href="https://
|
|
12
|
-
<a href="https://
|
|
11
|
+
<a href="https://seedcord.org/guide">Guide</a> ·
|
|
12
|
+
<a href="https://seedcord.org/docs">Reference</a> ·
|
|
13
13
|
<a href="https://discord.gg/DzFxY58WXf">Discord</a>
|
|
14
14
|
</div>
|
|
15
15
|
|
|
@@ -91,12 +91,10 @@ let SeedcordErrorCode = /* @__PURE__ */ function(SeedcordErrorCode) {
|
|
|
91
91
|
SeedcordErrorCode[SeedcordErrorCode["InteractionDuplicateRoute"] = 1401] = "InteractionDuplicateRoute";
|
|
92
92
|
/** Two different middleware classes share a class name. */
|
|
93
93
|
SeedcordErrorCode[SeedcordErrorCode["DuplicateMiddleware"] = 1402] = "DuplicateMiddleware";
|
|
94
|
-
/** A
|
|
95
|
-
SeedcordErrorCode[SeedcordErrorCode["
|
|
96
|
-
/** A
|
|
97
|
-
SeedcordErrorCode[SeedcordErrorCode["
|
|
98
|
-
/** A manifest row's module threw while importing. */
|
|
99
|
-
SeedcordErrorCode[SeedcordErrorCode["RouteModuleLoadFailed"] = 1405] = "RouteModuleLoadFailed";
|
|
94
|
+
/** A manifest array lists a class that does not extend the base for that array. */
|
|
95
|
+
SeedcordErrorCode[SeedcordErrorCode["ManifestEntryWrongClass"] = 1403] = "ManifestEntryWrongClass";
|
|
96
|
+
/** A manifest array lists a class whose decorator is missing. Nothing registered. */
|
|
97
|
+
SeedcordErrorCode[SeedcordErrorCode["ManifestEntryNoRoutes"] = 1404] = "ManifestEntryNoRoutes";
|
|
100
98
|
/** A reply method was called in an ack state where it is illegal. */
|
|
101
99
|
SeedcordErrorCode[SeedcordErrorCode["ReplyIllegalAckState"] = 1501] = "ReplyIllegalAckState";
|
|
102
100
|
/** A reply component failed to serialize to raw API data. */
|
|
@@ -345,9 +343,8 @@ const messages = {
|
|
|
345
343
|
[1306]: (key) => `\`${key}\` was given an empty array. Drop the key to run the middleware on everything.`,
|
|
346
344
|
[1401]: (route, first, second) => `Two interaction handlers resolve to the same route \`${route}\`. Registered by ${first} and ${second}. Rename one.`,
|
|
347
345
|
[1402]: (name) => `Two different middleware classes share the name \`${name}\`. Rename one so they do not collide.`,
|
|
348
|
-
[1403]: (
|
|
349
|
-
[1404]: (
|
|
350
|
-
[1405]: (route, from) => `Route \`${route}\` failed to import ${from}.`,
|
|
346
|
+
[1403]: (array, className, base) => `The manifest lists \`${className}\` under \`${array}\`, but \`${className}\` doesn't extend ${base}. Move it to the array for its own base, or drop it.`,
|
|
347
|
+
[1404]: (array, className, decorator) => `The manifest lists \`${className}\` under \`${array}\`, but \`${className}\` carries no ${decorator}. Add the decorator, or drop the entry.`,
|
|
351
348
|
[1501]: (method, reason, alternative, routeId) => `${paint.sky(`${method}()`)} was called when ${reason}.\n${alternative} (route ${paint.mute(routeId)})`,
|
|
352
349
|
[1502]: (componentClass, index, detail, routeId) => `${paint.sky(componentClass)} at components[${index}] failed to serialize: ${detail.replace(/\.$/, "")}. (route ${paint.mute(routeId)})`,
|
|
353
350
|
[1503]: (method, targetId, routeId) => `${paint.sky(`${method}()`)} was passed message ${targetId}, which this interaction did not send.\nPass a message this interaction sent, returned by reply(), followUp(), edit(), or update(). (route ${paint.mute(routeId)})`,
|
|
@@ -555,4 +552,4 @@ function isSeedcordError(error, type, code) {
|
|
|
555
552
|
|
|
556
553
|
//#endregion
|
|
557
554
|
export { isSeedcordError as a, SeedcordErrorCode as c, SeedcordTypeError as i, SeedcordError as n, BRAND as o, SeedcordRangeError as r, paint as s, SeedcordAggregateError as t };
|
|
558
|
-
//# sourceMappingURL=SeedcordError-
|
|
555
|
+
//# sourceMappingURL=SeedcordError-CFERGyXK.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SeedcordError-CFERGyXK.mjs","names":[],"sources":["../src/ErrorCodes.ts","../src/palette.ts","../src/ErrorMessages.ts","../src/SeedcordError.ts"],"sourcesContent":["/* eslint-disable no-magic-numbers */\n\n/**\n * All Seedcord error codes.\n */\nexport enum SeedcordErrorCode {\n /** One or more configured emojis could not be resolved at startup. */\n ConfigEmojiUnresolved = 1001,\n /** A webhook reporter's env var is set but fails webhook URL validation. */\n ConfigWebhookUrlInvalid = 1002,\n /** A configured webhook does not exist on Discord (deleted, or a wrong id or token). */\n ConfigWebhookNotFound = 1003,\n /** The generated route manifest was imported before `seedcord build` generated it. */\n ConfigManifestNotGenerated = 1004,\n /** A required environment variable is not present. */\n ConfigMissingEnv = 1005,\n /** An environment variable is present and fails validation. */\n ConfigInvalidEnv = 1006,\n /** A command usable in a guild is registered without the `Guilds` intent that caches guilds. */\n MissingGuildsIntent = 1007,\n /** The running Node version is below the range seedcord declares in `engines`. */\n UnsupportedNodeVersion = 1008,\n /** `DISCORD_BOT_TOKEN` passed its shape check and carries no readable application id. */\n ConfigTokenUnreadable = 1009,\n\n /** Attempted to add lifecycle tasks after startup already completed. */\n LifecycleAddAfterCompletion = 1101,\n /** Attempted to add lifecycle tasks while startup is still running. */\n LifecycleAddDuringRun = 1102,\n /** Attempted to remove lifecycle tasks while startup is still running. */\n LifecycleRemoveDuringRun = 1103,\n /** Provided lifecycle phase identifier is not recognized. */\n LifecycleUnknownPhase = 1104,\n /** Startup phase completed with one or more task failures. */\n LifecyclePhaseFailures = 1105,\n /** A lifecycle task exceeded its configured timeout. */\n LifecycleTaskTimeout = 1106,\n /** A host whose startup failed was started again. */\n LifecycleRestartAfterFailure = 1107,\n /** The configured shutdown deadline is zero, negative, or not finite. */\n LifecycleInvalidShutdownDeadline = 1108,\n\n /** Multiple Seedcord instances were created simultaneously. */\n CoreSingletonViolation = 1201,\n /** Plugins cannot be mutated after the core has finished initializing. */\n CorePluginAfterInit = 1202,\n /** A plugin tried to register with a key that already exists. */\n CorePluginKeyExists = 1203,\n /** Bot role lookup failed within the provided guild. */\n CoreBotRoleMissing = 1204,\n /** A bot controller was constructed without its required handlers directory. */\n CoreControllerPathMissing = 1205,\n /** A file in a scanned directory threw while being imported. */\n CoreDirectoryImportFailed = 1206,\n /** A scanned directory could not be read. */\n CoreDirectoryUnreadable = 1207,\n /** A plugin was attached under a key the framework logs on. */\n CorePluginReservedChannel = 1208,\n /** The application id was read before startup resolved it. */\n CoreApplicationUnavailable = 1209,\n /** A generated accessor was read before startup resolved its values. */\n CoreAccessorUnresolved = 1210,\n /** A startup or shutdown task was added to a core built by `createSeedcord`. */\n CoreLifecycleUnavailable = 1211,\n /** `emit` was called on the bus. It reaches listeners and skips every subscriber. */\n CoreBusEmitUnavailable = 1212,\n /** A command decorator passed `'config'` while `commands.guilds` is empty. */\n CoreCommandGuildsEmpty = 1213,\n /** Discord refused the command deploy for one guild. */\n CoreCommandGuildDeployFailed = 1214,\n /** A plugin was attached under a group name the bot already uses. */\n CorePluginGroupTaken = 1215,\n /** A plugin was attached at a name that holds a group of plugins. */\n CorePluginKeyHoldsGroup = 1216,\n /** A plugin key is empty, has an empty part, or carries more than one dot. */\n CorePluginKeyMalformed = 1217,\n /** An attached plugin doesn't extend the `Plugin` class of the bot's `@seedcord/core`. */\n CorePluginFromOtherCore = 1218,\n\n /** A command decorator attempted to re-register an existing command scope. */\n DecoratorCommandAlreadyRegistered = 1301,\n /** A global command decorator specified guild IDs, which is not allowed. */\n DecoratorCommandGlobalWithGuilds = 1302,\n /** A guild command decorator omitted the required guild ID list. */\n DecoratorCommandGuildWithoutGuilds = 1303,\n /** Middleware priority provided by the decorator was not a finite number. */\n DecoratorInvalidMiddlewarePriority = 1304,\n /** A WebhookLog subclass is missing its `@WebhookUrl` decorator. */\n DecoratorWebhookUrlMissing = 1305,\n /** A middleware decorator was given an empty filter array. */\n DecoratorEmptyMiddlewareFilter = 1306,\n\n /** Two interaction handlers registered the same route within a scope. */\n InteractionDuplicateRoute = 1401,\n /** Two different middleware classes share a class name. */\n DuplicateMiddleware = 1402,\n /** A manifest array lists a class that does not extend the base for that array. */\n ManifestEntryWrongClass = 1403,\n /** A manifest array lists a class whose decorator is missing. Nothing registered. */\n ManifestEntryNoRoutes = 1404,\n\n /** A reply method was called in an ack state where it is illegal. */\n ReplyIllegalAckState = 1501,\n /** A reply component failed to serialize to raw API data. */\n ReplyComponentSerialization = 1502,\n /** edit() was passed a message the interaction did not send. */\n ReplyForeignEditTarget = 1503,\n /** update() or deferUpdate() was called on a modal with no source message. */\n ReplyUpdateWithoutSource = 1504,\n /** A withResponse interaction callback returned no created message. */\n ReplyCallbackMissingMessage = 1505,\n\n /** A customId definition prefix contains a reserved character (a colon or a control char). */\n CustomIdInvalidPrefix = 1601,\n /** A customId field name is integer-like, which JS would silently reorder. */\n CustomIdReservedFieldName = 1602,\n /** A oneOf() or someOf() field was declared with no choices. */\n CustomIdEmptyChoices = 1603,\n /** An int() field was declared with min greater than max. */\n CustomIdInvalidBounds = 1604,\n /** A field rejected the value given to encode(). */\n CustomIdValueRejected = 1605,\n /** An encoded customId exceeds Discord's 100-character limit. */\n CustomIdWireTooLong = 1606,\n /** A field name is declared more than once in the same customId chain. */\n CustomIdDuplicateFieldName = 1607,\n /** A component handler is missing the route decorator that matches its base. */\n CustomIdHandlerRouteMissing = 1608,\n /** match() received a decoded route with no matching arm. */\n CustomIdMatchArmMissing = 1609,\n /** A slash handler's match() has no arm for the command route that fired. */\n SlashMatchArmMissing = 1610,\n /** An autocomplete handler's match() has no arm for the focused field that fired. */\n AutocompleteMatchArmMissing = 1611,\n /** An event handler's match() has no arm for the event name that fired. */\n EventMatchArmMissing = 1612,\n /** Event middleware read `this.eventName` but was constructed without a fired event name. */\n EventMiddlewareNameUnavailable = 1613,\n /** An autocomplete payload carried no focused option. */\n AutocompleteNoFocusedOption = 1614,\n /** A context menu handler's match() has no arm for the command name that fired. */\n ContextMenuMatchArmMissing = 1615,\n /** No field in the submitted modal carries the requested custom id. */\n ModalFieldNotFound = 1616,\n /** A modal field getter was called on a field of another kind. */\n ModalFieldWrongKind = 1617,\n /** Nothing was picked in a modal field read as required. */\n ModalFieldEmpty = 1618,\n /** A channel select field picked a channel outside the types getSelectedChannels() allows. */\n ModalFieldChannelType = 1619,\n /** A customId was minted under an older shape of the same definition. */\n CustomIdWireStale = 1620,\n /** A customId wire is corrupt, truncated, or was minted by a different definition. */\n CustomIdWireInvalid = 1621,\n /** `dispatch.require()` was called for a key nothing wrote on this dispatch. */\n DispatchStateMissing = 1622,\n\n /** A Cooldown gate was given a duration string that is not a well-formed positive duration. */\n GateInvalidCooldownDuration = 1701,\n\n /** A paginator source was given a perPage that is not a positive integer. */\n PaginationInvalidPerPage = 1801,\n /** A control row was assembled with more than the five buttons Discord allows. */\n PaginationTooManyControls = 1802,\n /** A control row was assembled with no controls. */\n PaginationEmptyControls = 1803,\n /** A control row repeats the same control, which would collide the custom_ids. */\n PaginationDuplicateControls = 1804,\n\n /** A color value could not be resolved to a Discord color integer. */\n ColorUnresolvable = 1901,\n /** A resolved color fell outside Discord's 0x000000 to 0xffffff range. */\n ColorOutOfRange = 1902,\n\n /** A plugin's constructor rejected its options through `rejectOptions`. */\n PluginOptionsRejected = 2001,\n /** Two or more plugins threw while disposing. */\n PluginDisposeFailures = 2002,\n /** A plugin declared a lifecycle timeout that is not a positive, finite number of milliseconds. */\n PluginInvalidLifecycleTimeout = 2003,\n\n /** Mongoose service class is missing the `@RegisterMongooseService` decorator. */\n PluginMongooseServiceDecoratorMissing = 2101,\n /** Mongoose client failed to establish a connection. */\n PluginMongooseConnectionFailed = 2102,\n /** Mongoose client failed to disconnect cleanly during shutdown. */\n PluginMongooseDisconnectFailed = 2103,\n /** Mongoose `services` was accessed before the plugin finished initializing. */\n PluginMongooseServicesNotReady = 2104,\n /** Mongoose rejected the model, usually a duplicate model name or an absent schema. */\n PluginMongooseModelCreationFailed = 2105,\n /** A mongoose service was registered with an empty model name override. */\n PluginMongooseModelNameMissing = 2106,\n\n /** Kysely service class is missing the `@RegisterKyselyService` decorator. */\n PluginKyselyServiceDecoratorMissing = 2201,\n /** Kysely service class is missing its table metadata. */\n PluginKyselyServiceTableMissing = 2202,\n /** Migration manager received an invalid step count. */\n PluginKyselyInvalidStepCount = 2203,\n /** Migration direction was not recognized. */\n PluginKyselyUnknownDirection = 2204,\n /** Provided migrations path could not be resolved. */\n PluginKyselyUnresolvedMigrationsPath = 2205,\n /** No migration files were found for execution. */\n PluginKyselyNoMigrationFiles = 2206,\n /** A migration module failed to export the expected functions. */\n PluginKyselyInvalidMigrationModule = 2207,\n /** An arbitrary (non-Error) failure was reported by a migration. */\n PluginKyselyNonErrorFailure = 2208,\n /** Postgres pool failed to close cleanly during shutdown. */\n PluginKyselyDisconnectFailed = 2209,\n /** Kysely `services` was accessed before the plugin finished initializing. */\n PluginKyselyServicesNotReady = 2210,\n /** Postgres pool failed to establish a connection. */\n PluginKyselyConnectionFailed = 2211,\n /** Bootstrapper failed to ensure the target Postgres database exists. */\n PluginKyselyBootstrapFailed = 2212,\n\n /** Config file default export was not an object. */\n CliConfigInvalidExport = 3101,\n /** Config is missing the required instance string. */\n CliConfigMissingInstance = 3102,\n /** Unable to locate a Seedcord config file. */\n CliConfigNotFound = 3103,\n /** CLI entry file does not exist. */\n CliEntryNotFound = 3104,\n /** Failed to import a TypeScript entry file. */\n CliTsImportFailed = 3105,\n /** Native import and jiti fallback both failed. */\n CliImportFailed = 3106,\n /** Seedcord instance export is missing a start() method. */\n CliInstanceInvalid = 3107,\n /** Seedcord instance threw during startup. */\n CliStartFailed = 3108,\n /** Config is missing the required entry string. */\n CliConfigMissingEntry = 3109,\n /** Entry file must be inside the configured root directory. */\n CliConfigEntryOutsideRoot = 3110,\n /** Unable to locate a TypeScript config file for builds. */\n CliBuildTsconfigNotFound = 3111,\n /** TypeScript reported diagnostics during emit. */\n CliBuildFailed = 3112,\n /** Unable to write the generated bootstrap file. */\n CliBootstrapWriteFailed = 3113,\n /** Two commands resolve to the same slash route during codegen. */\n CliCodegenDuplicateRoute = 3114,\n /** The commands directory could not be read during codegen. */\n CliCodegenCommandsDirUnreadable = 3115,\n /** Two context-menu commands of the same kind share a name during codegen. */\n CliCodegenDuplicateContextMenu = 3116,\n /** Could not resolve the application from the bot token during `commands --clean`. */\n CliCleanAppFetchFailed = 3117,\n /** `commands --clean` ran with neither --guild nor --all-guilds. */\n CliCleanNoGuilds = 3118,\n /** `commands --clean` combined --purge with --all-guilds, which would wipe every guild. */\n CliCleanPurgeAllGuilds = 3119,\n /** An interactive prompt was cancelled (Ctrl-C), so the command aborts without changes. */\n CliCancelled = 3120,\n /** `commands --clean --all-guilds` matched more guilds than the safety threshold without `--yes`. */\n CliCleanLargeBotUnconfirmed = 3121,\n /** `commands --clean --apply` ran in a non-interactive environment without `--yes`, where it cannot prompt. */\n CliCleanApplyNeedsYes = 3122,\n /** The cloudflared metrics server never reported a quick-tunnel hostname. */\n CliTunnelUrlUnavailable = 3123,\n /** Discord rejected the tunnel URL as an interactions endpoint. */\n CliTunnelNotVerified = 3124,\n /** The tunnel URL never answered its health probe. */\n CliTunnelUnreachable = 3125,\n /** A config field is present with the wrong shape. */\n CliConfigInvalidField = 3126,\n /** A class carrying `@RegisterCommand` threw while codegen constructed it. */\n CliCodegenCommandConstructorThrew = 3127,\n\n /** A create prompt was cancelled (Ctrl-C), and nothing has been written yet. */\n CreateCancelled = 3201,\n /** A flag supplied an answer for a question the earlier answers skip. */\n CreateFlagNotApplicable = 3202,\n /** A flag carried a value its question rejects. */\n CreateInvalidAnswer = 3203,\n /** The command line did not parse. */\n CreateBadUsage = 3204,\n /** The target path already holds something. */\n CreateTargetNotEmpty = 3205,\n /** A command the scaffolder shelled out to exited non-zero. */\n CreateStepFailed = 3206\n}\n","import chalk from 'chalk';\n\n// @seedcord/ui carries the same three for the web\nexport const BRAND = {\n flesh: '#f04e36',\n rind: '#6fab49',\n pith: '#f8f6e8'\n} as const;\n\n// truecolor because a terminal theme remaps chalk's 16-color names (blue turns orange in monokai)\nexport const paint = {\n sky: chalk.hex('#8fc7ff'), // what the line is about, one per line\n iris: chalk.hex('#e29bff'), // a count\n mint: chalk.hex('#66d98a'), // success\n amber: chalk.hex('#ffc061'), // go do something about this\n coral: chalk.hex('#ff6b85'), // failure\n // brand marks\n flesh: chalk.hex(BRAND.flesh),\n rind: chalk.hex(BRAND.rind),\n pith: chalk.hex(BRAND.pith),\n mute: chalk.dim, // context around the subject\n // weight and shape\n bold: chalk.bold,\n italic: chalk.italic,\n underline: chalk.underline\n} as const;\n","import { SeedcordErrorCode } from './ErrorCodes';\nimport { paint } from './palette';\n\n/** @internal */\nconst messages = {\n [SeedcordErrorCode.ConfigMissingEnv]: (name: string) => `Missing ${name} environment variable.`,\n [SeedcordErrorCode.ConfigInvalidEnv]: (name: string, expected?: string) =>\n expected ? `Invalid ${name} value. Expected ${expected}.` : `Invalid ${name} value.`,\n [SeedcordErrorCode.ConfigManifestNotGenerated]: () =>\n 'The route manifest is generated by `seedcord build`. Run the build before importing it.',\n [SeedcordErrorCode.ConfigWebhookUrlInvalid]: (envKey: string) =>\n `${envKey} is not a well-formed Discord webhook url.`,\n [SeedcordErrorCode.ConfigWebhookNotFound]: (envKey: string) =>\n `The webhook behind ${envKey} does not exist on Discord.`,\n [SeedcordErrorCode.ConfigEmojiUnresolved]: (count: number, failures: string) =>\n `Could not resolve ${count} configured emoji${count === 1 ? '' : 's'} at startup.\\n${failures}`,\n [SeedcordErrorCode.ConfigTokenUnreadable]: () =>\n \"DISCORD_BOT_TOKEN carries no readable application id. Discord builds the first part of a bot token from that id, so a token failing here is truncated or mistyped. Copy it again from your application's Bot page.\",\n [SeedcordErrorCode.MissingGuildsIntent]: (commands: string) =>\n `Add GatewayIntentBits.Guilds to clientOptions.intents. Without it discord.js doesn't cache any guild, so interaction.guild is null inside these commands: ${commands}.`,\n [SeedcordErrorCode.UnsupportedNodeVersion]: (required: string, running: string) =>\n `seedcord requires Node ${required} and this process runs ${running}. Upgrade Node before starting the bot.`,\n\n [SeedcordErrorCode.LifecycleAddAfterCompletion]: () =>\n 'Cannot add tasks after startup sequence has already completed.',\n [SeedcordErrorCode.LifecycleAddDuringRun]: () => 'Cannot add tasks while startup sequence is in progress.',\n [SeedcordErrorCode.LifecycleRemoveDuringRun]: () => 'Cannot remove tasks while startup sequence is in progress.',\n [SeedcordErrorCode.LifecycleUnknownPhase]: (phase: unknown) => `Unknown phase: ${String(phase)}.`,\n [SeedcordErrorCode.LifecyclePhaseFailures]: (phase: string, failures: number) =>\n `Phase ${phase} completed with ${failures} failed task${failures === 1 ? '' : 's'}.`,\n [SeedcordErrorCode.LifecycleTaskTimeout]: (taskName: string, timeout: number) =>\n `Task \"${taskName}\" timed out after ${timeout}ms.`,\n [SeedcordErrorCode.LifecycleRestartAfterFailure]: () =>\n 'Startup failed and this host cannot start again. Construct a new instance.',\n [SeedcordErrorCode.LifecycleInvalidShutdownDeadline]: (declared: number) =>\n `lifecycle.shutdownDeadline is ${declared}. Pass a positive number of milliseconds, or omit it for the default.`,\n\n [SeedcordErrorCode.CoreSingletonViolation]: () =>\n 'Seedcord can only be instantiated once. Use the existing instance instead.',\n [SeedcordErrorCode.CorePluginAfterInit]: () => 'Cannot attach a plugin after initialization.',\n [SeedcordErrorCode.CorePluginKeyExists]: (key: string) => `Plugin with key \"${key}\" already exists.`,\n [SeedcordErrorCode.CoreBotRoleMissing]: (guildId?: string) =>\n guildId ? `Bot role not found in guild ${guildId}.` : 'Bot role not found in guild.',\n [SeedcordErrorCode.CoreControllerPathMissing]: (controllerName: string, pathKind: string) =>\n `${controllerName} was instantiated without a ${pathKind} path.`,\n [SeedcordErrorCode.CoreDirectoryImportFailed]: (file: string) => `${file} threw while importing.`,\n [SeedcordErrorCode.CoreDirectoryUnreadable]: (dir: string) => `${dir} could not be read.`,\n [SeedcordErrorCode.CorePluginGroupTaken]: (head: string, key: string) =>\n `${paint.sky(head)} is already taken on this bot, so ${paint.sky(key)} cannot nest under it. Pick another group name.`,\n [SeedcordErrorCode.CorePluginKeyMalformed]: (key: string, reason: string) =>\n `${paint.sky(key)} ${reason} Write a group and a plugin name around one dot, like 'services.users'.`,\n [SeedcordErrorCode.CorePluginFromOtherCore]: (plugin: string) =>\n `${paint.sky(plugin)} doesn't extend the ${paint.bold('Plugin')} class your bot uses. That usually means two copies of ${paint.bold('@seedcord/core')} are installed. Update the plugin and your ${paint.bold('@seedcord')} packages to versions that need the same ${paint.bold('@seedcord/core')}. Your package manager can list each installed copy and the package that pulled it in.`,\n [SeedcordErrorCode.CorePluginKeyHoldsGroup]: (key: string) =>\n `${paint.sky(key)} already holds a group of plugins. Attach this one under a name of its own.`,\n [SeedcordErrorCode.CorePluginReservedChannel]: (key: string) =>\n `Plugin key \"${key}\" is a channel the framework logs on. Pick another key.`,\n [SeedcordErrorCode.CoreApplicationUnavailable]: () =>\n \"The bot's application id resolves during startup. You read it before that. Read it inside a handler, inside a plugin's ready(), or after start() resolves.\",\n [SeedcordErrorCode.CoreAccessorUnresolved]: (accessor: string, key: string) =>\n `${accessor}.${key} has no value yet. ${accessor} fills during startup, and a read at the top of a file runs before that.`,\n [SeedcordErrorCode.CoreLifecycleUnavailable]: (accessor: string) =>\n `core.${accessor}.addTask() does not work here. This bot was built with createSeedcord() whose build never runs startup or shutdown. Your task would never run. Do the work inside your handler instead. To use startup and shutdown, run the bot on node with new Seedcord(config).start().`,\n [SeedcordErrorCode.CoreBusEmitUnavailable]: (event: string) =>\n `core.bus.emit('${event}') would reach your on() listeners and skip every Subscriber class. Call core.bus.publish('${event}', data) to run both.`,\n\n [SeedcordErrorCode.CoreCommandGuildsEmpty]: (commandName: string) =>\n `${paint.sky(commandName)} registers to the 'config' guilds while commands.guilds is empty.\\nList the ids under commands.guilds, or pass them to @RegisterCommand('guild', [...]).`,\n\n [SeedcordErrorCode.CoreCommandGuildDeployFailed]: (guildId: string) =>\n `Discord refused the command deploy for guild ${paint.sky(guildId)}.\\nCheck that the id is right, and that your bot is in that server.`,\n\n [SeedcordErrorCode.DecoratorCommandAlreadyRegistered]: (\n commandName: string,\n existingCall: string,\n requestedCall: string\n ) =>\n `${paint.sky(commandName)} is registered twice, first with ${existingCall}, then with ${requestedCall}. Keep one.`,\n [SeedcordErrorCode.DecoratorCommandGlobalWithGuilds]: () =>\n 'RegisterCommand(\"global\") cannot have guilds specified.',\n [SeedcordErrorCode.DecoratorCommandGuildWithoutGuilds]: () =>\n 'RegisterCommand(\"guild\") requires a non-empty guilds array.',\n [SeedcordErrorCode.DecoratorInvalidMiddlewarePriority]: () => 'Middleware priority must be a finite number.',\n [SeedcordErrorCode.DecoratorWebhookUrlMissing]: (className: string) =>\n `${className} extends WebhookLog and needs a @WebhookUrl decorator naming its env var.`,\n\n [SeedcordErrorCode.DecoratorEmptyMiddlewareFilter]: (key: string) =>\n `\\`${key}\\` was given an empty array. Drop the key to run the middleware on everything.`,\n [SeedcordErrorCode.InteractionDuplicateRoute]: (route: string, first: string, second: string) =>\n `Two interaction handlers resolve to the same route \\`${route}\\`. Registered by ${first} and ${second}. Rename one.`,\n [SeedcordErrorCode.DuplicateMiddleware]: (name: string) =>\n `Two different middleware classes share the name \\`${name}\\`. Rename one so they do not collide.`,\n [SeedcordErrorCode.ManifestEntryWrongClass]: (array: string, className: string, base: string) =>\n `The manifest lists \\`${className}\\` under \\`${array}\\`, but \\`${className}\\` doesn't extend ${base}. Move it to the array for its own base, or drop it.`,\n [SeedcordErrorCode.ManifestEntryNoRoutes]: (array: string, className: string, decorator: string) =>\n `The manifest lists \\`${className}\\` under \\`${array}\\`, but \\`${className}\\` carries no ${decorator}. Add the decorator, or drop the entry.`,\n\n [SeedcordErrorCode.ReplyIllegalAckState]: (method: string, reason: string, alternative: string, routeId: string) =>\n `${paint.sky(`${method}()`)} was called when ${reason}.\\n${alternative} (route ${paint.mute(routeId)})`,\n [SeedcordErrorCode.ReplyComponentSerialization]: (\n componentClass: string,\n index: number,\n detail: string,\n routeId: string\n ) =>\n `${paint.sky(componentClass)} at components[${index}] failed to serialize: ${detail.replace(/\\.$/, '')}. (route ${paint.mute(routeId)})`,\n [SeedcordErrorCode.ReplyForeignEditTarget]: (method: string, targetId: string, routeId: string) =>\n `${paint.sky(`${method}()`)} was passed message ${targetId}, which this interaction did not send.\\nPass a message this interaction sent, returned by reply(), followUp(), edit(), or update(). (route ${paint.mute(routeId)})`,\n [SeedcordErrorCode.ReplyUpdateWithoutSource]: (method: string, routeId: string) =>\n `${paint.sky(`${method}()`)} was called on a modal opened from a command, which has no source message.\\nUse reply() or defer() instead. (route ${paint.mute(routeId)})`,\n [SeedcordErrorCode.ReplyCallbackMissingMessage]: (method: string, routeId: string) =>\n `The interaction callback for ${paint.sky(`${method}()`)} returned no message. (route ${paint.mute(routeId)})`,\n\n [SeedcordErrorCode.CustomIdInvalidPrefix]: (prefix: string) =>\n `customId prefix ${JSON.stringify(prefix)} must be a non-empty string without a colon or control character.`,\n [SeedcordErrorCode.CustomIdReservedFieldName]: (field: string) =>\n `customId field name ${JSON.stringify(field)} is integer-like, which JS reorders. Use a non-numeric name.`,\n [SeedcordErrorCode.CustomIdEmptyChoices]: (field: string, method: string) =>\n `customId field ${JSON.stringify(field)} uses ${method}() with no choices. Make the field nullable or provide at least one choice.`,\n [SeedcordErrorCode.CustomIdInvalidBounds]: (field: string, min: number, max: number) =>\n `customId field ${JSON.stringify(field)} has min ${min} greater than max ${max}.`,\n [SeedcordErrorCode.CustomIdValueRejected]: (field: string, expected: string, value: string) =>\n `customId field ${JSON.stringify(field)} expects ${expected}, got ${value}.`,\n [SeedcordErrorCode.CustomIdWireTooLong]: (length: number) =>\n `Encoded customId is ${length} characters, Discord allows at most 100.`,\n [SeedcordErrorCode.CustomIdDuplicateFieldName]: (field: string) =>\n `customId field ${JSON.stringify(field)} is already defined in this chain.`,\n [SeedcordErrorCode.CustomIdHandlerRouteMissing]: (className: string) =>\n `${className} is missing its route decorator. Add the one that matches its base, for example @ButtonRoute or @UserMenuRoute.`,\n [SeedcordErrorCode.CustomIdMatchArmMissing]: (prefix: string) =>\n `match() has no arm for the decoded route ${JSON.stringify(prefix)}.`,\n [SeedcordErrorCode.CustomIdWireStale]: (prefix: string) =>\n `customId ${JSON.stringify(prefix)} was minted under an older shape of this definition. Adding, removing, changing, or moving a field changes the layout hash.`,\n [SeedcordErrorCode.CustomIdWireInvalid]: (detail: string) => `customId could not be decoded. ${detail}.`,\n [SeedcordErrorCode.SlashMatchArmMissing]: (route: string) =>\n `match() has no arm for the command route ${JSON.stringify(route)}.`,\n [SeedcordErrorCode.AutocompleteMatchArmMissing]: (field: string) =>\n `match() has no arm for the focused field ${JSON.stringify(field)}.`,\n [SeedcordErrorCode.EventMatchArmMissing]: (event: string) =>\n `match() has no arm for the event ${JSON.stringify(event)}.`,\n [SeedcordErrorCode.ContextMenuMatchArmMissing]: (name: string) =>\n `match() has no arm for the context menu command ${JSON.stringify(name)}.`,\n [SeedcordErrorCode.EventMiddlewareNameUnavailable]: () =>\n `this.eventName is only available on middleware the controller constructed with a fired event name.`,\n [SeedcordErrorCode.AutocompleteNoFocusedOption]: () => `Autocomplete payload has no focused option.`,\n [SeedcordErrorCode.ModalFieldNotFound]: (customId: string) =>\n `The submitted modal carries no field with the custom id ${JSON.stringify(customId)}. Check it against the id you gave the component when you built the modal.`,\n [SeedcordErrorCode.ModalFieldWrongKind]: (customId: string, kind: string, getter?: string) =>\n getter\n ? `Modal field ${JSON.stringify(customId)} holds ${kind}. Read it with ${getter}().`\n : `Modal field ${JSON.stringify(customId)} holds ${kind}. No getter reads that kind.`,\n [SeedcordErrorCode.ModalFieldEmpty]: (customId: string) =>\n `Modal field ${JSON.stringify(customId)} carries no selection. Build the component as required, or read it without the required argument.`,\n [SeedcordErrorCode.ModalFieldChannelType]: (customId: string, picked: string, allowed: string) =>\n `Modal field ${JSON.stringify(customId)} picked a ${picked} channel. This read allows ${allowed}.`,\n [SeedcordErrorCode.DispatchStateMissing]: (key: string) =>\n `Nothing set \\`${key}\\` on this dispatch. Check that the middleware writing it is registered and that its filter covers this dispatch.`,\n\n [SeedcordErrorCode.GateInvalidCooldownDuration]: (input: string) =>\n `Cooldown duration ${JSON.stringify(input)} is not valid. Pass a number of seconds or a duration string like '30m', '24h', or '500ms'.`,\n\n [SeedcordErrorCode.PaginationInvalidPerPage]: (perPage: number) =>\n `perPage must be a positive integer, got ${perPage}.`,\n [SeedcordErrorCode.PaginationTooManyControls]: (count: number) =>\n `A control row holds at most 5 buttons, got ${count}.`,\n [SeedcordErrorCode.PaginationEmptyControls]: () => `A control row must hold at least one control.`,\n [SeedcordErrorCode.PaginationDuplicateControls]: (key: string) =>\n `A control row cannot repeat the '${key}' control.`,\n\n [SeedcordErrorCode.ColorUnresolvable]: (value: string) => `Cannot convert ${value} into a color.`,\n [SeedcordErrorCode.ColorOutOfRange]: () => 'Color must be within the range 0 to 16777215 (0xffffff).',\n\n [SeedcordErrorCode.PluginOptionsRejected]: (pluginName: string, reason: string) =>\n `${pluginName} rejected its options, ${reason.replace(/\\.$/, '')}.`,\n [SeedcordErrorCode.PluginDisposeFailures]: (count: number) => `${count} plugins failed to dispose.`,\n [SeedcordErrorCode.PluginInvalidLifecycleTimeout]: (pluginName: string, field: string, declared: number) =>\n `${pluginName} declared lifecycle ${field}.timeout as ${declared}. Pass a positive number of milliseconds, or omit it for the default.`,\n\n [SeedcordErrorCode.PluginMongooseServiceDecoratorMissing]: (className: string) =>\n `Missing @RegisterMongooseService on ${className}.`,\n [SeedcordErrorCode.PluginMongooseConnectionFailed]: (databaseName?: string) =>\n databaseName ? `Could not connect to MongoDB (${databaseName}).` : 'Could not connect to MongoDB.',\n [SeedcordErrorCode.PluginMongooseDisconnectFailed]: () =>\n 'Failed to disconnect from MongoDB cleanly during shutdown.',\n [SeedcordErrorCode.PluginMongooseServicesNotReady]: () =>\n 'Mongoose services accessed before the plugin finished initializing.',\n [SeedcordErrorCode.PluginMongooseModelCreationFailed]: (modelName: string, className: string) =>\n `Could not build the mongoose model ${modelName} for ${className}.`,\n [SeedcordErrorCode.PluginMongooseModelNameMissing]: (className: string) =>\n `Empty model name on ${className}. Provide a non-empty modelName via @RegisterMongooseService().`,\n\n [SeedcordErrorCode.PluginKyselyServiceDecoratorMissing]: (className: string) =>\n `Missing @RegisterKyselyService on ${className}.`,\n [SeedcordErrorCode.PluginKyselyServiceTableMissing]: (className: string) =>\n `Missing table metadata for ${className}. Provide a table via @RegisterKyselyService().`,\n [SeedcordErrorCode.PluginKyselyInvalidStepCount]: () => 'Migration step count must be a non-negative integer.',\n [SeedcordErrorCode.PluginKyselyUnknownDirection]: (direction: unknown) =>\n `Unknown migration direction: ${String(direction)}.`,\n [SeedcordErrorCode.PluginKyselyUnresolvedMigrationsPath]: (label: string) =>\n `Unable to resolve migrations at path: ${label}.`,\n [SeedcordErrorCode.PluginKyselyNoMigrationFiles]: () => 'No migration files provided.',\n [SeedcordErrorCode.PluginKyselyInvalidMigrationModule]: (filePath: string) =>\n `Migration file ${filePath} must export async functions up and down.`,\n [SeedcordErrorCode.PluginKyselyNonErrorFailure]: (message: string) => `Migration failure: ${message}.`,\n [SeedcordErrorCode.PluginKyselyDisconnectFailed]: () =>\n 'Failed to close the Postgres pool cleanly during shutdown.',\n [SeedcordErrorCode.PluginKyselyServicesNotReady]: () =>\n 'Kysely services accessed before the plugin finished initializing.',\n [SeedcordErrorCode.PluginKyselyConnectionFailed]: (databaseName?: string) =>\n databaseName ? `Could not connect to Postgres (${databaseName}).` : 'Could not connect to Postgres.',\n [SeedcordErrorCode.PluginKyselyBootstrapFailed]: (databaseName: string) =>\n `Failed to ensure database ${databaseName} exists.`,\n\n [SeedcordErrorCode.CliConfigInvalidExport]: () => 'Config file must default export an object.',\n [SeedcordErrorCode.CliConfigMissingInstance]: () =>\n 'Config must include an `instance` string that points to your Seedcord default export.',\n [SeedcordErrorCode.CliConfigNotFound]: (baseDir: string, candidates: readonly string[]) =>\n `Unable to locate a Seedcord config in ${baseDir}. Searched for ${candidates.join(', ')}.`,\n [SeedcordErrorCode.CliConfigMissingEntry]: () =>\n 'Config must include an `entry` string that points to your startup script.',\n [SeedcordErrorCode.CliConfigEntryOutsideRoot]: (entryPath: string, root: string) =>\n `Entry file ${entryPath} must reside inside configured root ${root}.`,\n [SeedcordErrorCode.CliEntryNotFound]: (entryPath: string) => `Cannot find entry file at ${entryPath}.`,\n [SeedcordErrorCode.CliTsImportFailed]: (entryPath: string, reason: string) =>\n `Failed to import TypeScript file ${entryPath}: ${reason}`,\n [SeedcordErrorCode.CliImportFailed]: (entryPath: string, nativeReason: string, fallbackReason: string) =>\n `Failed to import ${entryPath}: ${nativeReason} (the jiti fallback also failed: ${fallbackReason})`,\n [SeedcordErrorCode.CliInstanceInvalid]: () =>\n 'Seedcord instance must default export an object with a start() method.',\n [SeedcordErrorCode.CliStartFailed]: (instancePath: string, reason: string) =>\n `Failed to start Seedcord from ${instancePath}: ${reason}`,\n [SeedcordErrorCode.CliBuildTsconfigNotFound]: (hint: string) =>\n `Unable to resolve a tsconfig for builds (${hint}). Provide build.tsconfig or add tsconfig.build.json / tsconfig.json.`,\n [SeedcordErrorCode.CliBuildFailed]: (diagnostics: string) => `TypeScript build failed:\\n${diagnostics}`,\n [SeedcordErrorCode.CliBootstrapWriteFailed]: (targetPath: string, reason: string) =>\n `Failed to write bootstrap file at ${targetPath}: ${reason}`,\n [SeedcordErrorCode.CliCodegenDuplicateRoute]: (route: string, firstFile: string, secondFile: string) =>\n `Two commands resolve to the same slash route \\`${route}\\`. Defined in ${firstFile} and ${secondFile}. Rename one.`,\n [SeedcordErrorCode.CliCodegenCommandsDirUnreadable]: (dir: string, reason: string) =>\n `Could not read the commands directory ${dir} during codegen. ${reason}`,\n [SeedcordErrorCode.CliCodegenCommandConstructorThrew]: (name: string, file: string, reason: string) =>\n `${name} threw while codegen constructed it. Fix its constructor in ${file}. ${reason}`,\n [SeedcordErrorCode.CliCodegenDuplicateContextMenu]: (\n kind: string,\n name: string,\n firstFile: string,\n secondFile: string\n ) =>\n `Two ${kind} context-menu commands share the name \\`${name}\\`. Defined in ${firstFile} and ${secondFile}. Rename one.`,\n [SeedcordErrorCode.CliCleanAppFetchFailed]: (reason: string) =>\n `Could not resolve the application from the bot token. ${reason}`,\n [SeedcordErrorCode.CliCleanNoGuilds]: () =>\n 'No guilds given. Pass --guild <ids...> or --all-guilds. Global commands are never touched.',\n [SeedcordErrorCode.CliCleanPurgeAllGuilds]: () =>\n '--purge cannot be combined with --all-guilds. Use --guild <ids> to purge specific guilds.',\n [SeedcordErrorCode.CliCancelled]: () => 'Cancelled.',\n [SeedcordErrorCode.CliCleanLargeBotUnconfirmed]: (count: number) =>\n `Refusing to scan ${count} guilds without confirmation. Re-run with --yes, or name specific guilds with --guild <ids>.`,\n [SeedcordErrorCode.CliCleanApplyNeedsYes]: () =>\n 'Refusing to delete without confirmation in a non-interactive environment. Re-run with --yes.',\n [SeedcordErrorCode.CliTunnelUrlUnavailable]: (seconds: number) =>\n `cloudflared did not report a tunnel URL within ${seconds}s. Check that the binary runs and that the network allows it.`,\n [SeedcordErrorCode.CliTunnelNotVerified]: (url: string) => `Discord rejected ${url} as an interactions endpoint.`,\n [SeedcordErrorCode.CliTunnelUnreachable]: (url: string, seconds: number) =>\n `${url} did not answer within ${seconds}s, so nothing was PATCHed to Discord.`,\n [SeedcordErrorCode.CliConfigInvalidField]: (field: string, expected: string) =>\n `Config \\`${field}\\` must be ${expected} when provided.`,\n [SeedcordErrorCode.CreateCancelled]: () => 'Cancelled.',\n [SeedcordErrorCode.CreateFlagNotApplicable]: (flag: string) =>\n `The --${flag} flag does not apply to the answers you gave.`,\n [SeedcordErrorCode.CreateInvalidAnswer]: (flag: string, reason: string) => `--${flag}: ${reason}`,\n // node's parseArgs message ends on an unclosed quote\n [SeedcordErrorCode.CreateBadUsage]: (reason: string) => `${reason}\\nRun with --help for the flag list.`,\n [SeedcordErrorCode.CreateTargetNotEmpty]: (target: string) =>\n `${target} already has files in it. Pick an empty directory or a name that does not exist yet.`,\n [SeedcordErrorCode.CreateStepFailed]: (command: string, reason: string) => `\\`${command}\\` failed.\\n${reason}`\n} satisfies Record<SeedcordErrorCode, (...args: never[]) => string>;\n\n/** @internal */\nexport type SeedcordErrorArguments<Code extends SeedcordErrorCode> = Parameters<(typeof messages)[Code]>;\n\n/** @internal */\nexport function formatSeedcordErrorMessage<Code extends SeedcordErrorCode>(\n code: Code,\n args?: SeedcordErrorArguments<Code>\n): string {\n const formatter = messages[code];\n const resolvedArgs = (args ?? []) as unknown[];\n return (formatter as (...params: unknown[]) => string)(...resolvedArgs);\n}\n","import { SeedcordErrorCode } from './ErrorCodes';\nimport { formatSeedcordErrorMessage, type SeedcordErrorArguments } from './ErrorMessages';\nimport { paint } from './palette';\n\n/**\n * String literal type for Seedcord error identifiers.\n *\n * @internal\n */\ntype SeedcordErrorIdentifier = keyof typeof SeedcordErrorCode;\n\n/**\n * Options for Seedcord errors.\n *\n * @internal\n */\ninterface SeedcordErrorOptions extends ErrorOptions {}\n\nfunction resolveIdentifier(code: SeedcordErrorCode): SeedcordErrorIdentifier {\n return SeedcordErrorCode[code] as SeedcordErrorIdentifier;\n}\n\ntype SeedcordErrorPayload<Code extends SeedcordErrorCode> = SeedcordErrorArguments<Code> | undefined;\n\ntype SeedcordErrorCtorRest<Code extends SeedcordErrorCode> =\n SeedcordErrorArguments<Code> extends []\n ? [options?: SeedcordErrorOptions]\n : [args: SeedcordErrorArguments<Code>, options?: SeedcordErrorOptions];\n\nfunction resolveCtorInputs<Code extends SeedcordErrorCode>(\n rest: SeedcordErrorCtorRest<Code>\n): { args: SeedcordErrorPayload<Code>; options?: SeedcordErrorOptions } {\n const [maybeArgsOrOptions, maybeOptions] = rest;\n if (Array.isArray(maybeArgsOrOptions)) {\n const result: { args: SeedcordErrorPayload<Code>; options?: SeedcordErrorOptions } = {\n args: maybeArgsOrOptions\n };\n\n if (maybeOptions !== undefined) {\n result.options = maybeOptions;\n }\n\n return result;\n }\n\n const result: { args: SeedcordErrorPayload<Code>; options?: SeedcordErrorOptions } = {\n args: undefined\n };\n\n if (maybeArgsOrOptions !== undefined) {\n result.options = maybeArgsOrOptions;\n }\n\n return result;\n}\n\nfunction resolveMessage<Code extends SeedcordErrorCode>(code: Code, args: SeedcordErrorPayload<Code>): string {\n return formatSeedcordErrorMessage(code, args);\n}\n\nfunction formatErrorName(name: string, _identifier: SeedcordErrorIdentifier, code: SeedcordErrorCode): string {\n return `${paint.coral.bold(name)}[${paint.mute(code)}]`;\n}\n\n/**\n * String literal type for Seedcord error class names. Names the `type` argument of\n * {@link isSeedcordError}.\n */\nexport type SeedcordErrorTypeString = `Seedcord${'Error' | 'TypeError' | 'RangeError' | 'AggregateError'}`;\n\n// Symbol.for so two installed copies read the same slot\nconst kIdentifier: unique symbol = Symbol.for('seedcord:errors:identifier');\n\ninterface BaseSeedcordError {\n readonly code: SeedcordErrorCode;\n readonly [kIdentifier]: SeedcordErrorIdentifier;\n readonly type: SeedcordErrorTypeString;\n}\n\n// instanceof fails across two installed copies of this package\nconst CODED = Symbol.for('seedcord:errors:coded');\n\nfunction brand(prototype: object): void {\n Object.defineProperty(prototype, CODED, { value: true });\n}\n\nfunction isCoded(error: unknown): error is BaseSeedcordError {\n return typeof error === 'object' && error !== null && CODED in error;\n}\n\nexport class SeedcordError<Code extends SeedcordErrorCode = SeedcordErrorCode>\n extends Error\n implements BaseSeedcordError\n{\n public readonly code: Code;\n readonly [kIdentifier]: SeedcordErrorIdentifier;\n public readonly type = 'SeedcordError';\n\n constructor(code: Code, ...rest: SeedcordErrorCtorRest<Code>) {\n const { args, options } = resolveCtorInputs(rest);\n const message = resolveMessage(code, args);\n super(message, options);\n this.code = code;\n this[kIdentifier] = resolveIdentifier(code);\n this.name = formatErrorName(new.target.name, this[kIdentifier], this.code);\n Object.setPrototypeOf(this, new.target.prototype);\n if (typeof Error.captureStackTrace === 'function') {\n Error.captureStackTrace(this, new.target);\n }\n }\n}\n\nbrand(SeedcordError.prototype);\n\nexport class SeedcordTypeError<Code extends SeedcordErrorCode = SeedcordErrorCode>\n extends TypeError\n implements BaseSeedcordError\n{\n public readonly code: Code;\n readonly [kIdentifier]: SeedcordErrorIdentifier;\n public readonly type = 'SeedcordTypeError';\n\n constructor(code: Code, ...rest: SeedcordErrorCtorRest<Code>) {\n const { args, options } = resolveCtorInputs(rest);\n const message = resolveMessage(code, args);\n super(message, options);\n this.code = code;\n this[kIdentifier] = resolveIdentifier(code);\n this.name = formatErrorName(new.target.name, this[kIdentifier], this.code);\n Object.setPrototypeOf(this, new.target.prototype);\n if (typeof Error.captureStackTrace === 'function') {\n Error.captureStackTrace(this, new.target);\n }\n }\n}\n\nbrand(SeedcordTypeError.prototype);\n\nexport class SeedcordRangeError<Code extends SeedcordErrorCode = SeedcordErrorCode>\n extends RangeError\n implements BaseSeedcordError\n{\n public readonly code: Code;\n readonly [kIdentifier]: SeedcordErrorIdentifier;\n public readonly type = 'SeedcordRangeError';\n\n constructor(code: Code, ...rest: SeedcordErrorCtorRest<Code>) {\n const { args, options } = resolveCtorInputs(rest);\n const message = resolveMessage(code, args);\n super(message, options);\n this.code = code;\n this[kIdentifier] = resolveIdentifier(code);\n this.name = formatErrorName(new.target.name, this[kIdentifier], this.code);\n Object.setPrototypeOf(this, new.target.prototype);\n if (typeof Error.captureStackTrace === 'function') {\n Error.captureStackTrace(this, new.target);\n }\n }\n}\n\nbrand(SeedcordRangeError.prototype);\n\nexport class SeedcordAggregateError<Code extends SeedcordErrorCode = SeedcordErrorCode>\n extends AggregateError\n implements BaseSeedcordError\n{\n public readonly code: Code;\n readonly [kIdentifier]: SeedcordErrorIdentifier;\n public readonly type = 'SeedcordAggregateError';\n\n constructor(code: Code, errors: readonly unknown[], ...rest: SeedcordErrorCtorRest<Code>) {\n const { args, options } = resolveCtorInputs(rest);\n const message = resolveMessage(code, args);\n super(errors, message, options);\n this.code = code;\n this[kIdentifier] = resolveIdentifier(code);\n this.name = formatErrorName(new.target.name, this[kIdentifier], this.code);\n Object.setPrototypeOf(this, new.target.prototype);\n if (typeof Error.captureStackTrace === 'function') {\n Error.captureStackTrace(this, new.target);\n }\n }\n}\n\nbrand(SeedcordAggregateError.prototype);\n\n/**\n * Variant type for Seedcord error classes.\n *\n * @internal\n */\ntype SeedcordErrorVariant<\n Type extends SeedcordErrorTypeString,\n Code extends SeedcordErrorCode\n> = Type extends 'SeedcordError'\n ? SeedcordError<Code>\n : Type extends 'SeedcordTypeError'\n ? SeedcordTypeError<Code>\n : Type extends 'SeedcordRangeError'\n ? SeedcordRangeError<Code>\n : SeedcordAggregateError<Code>;\n\n/**\n * Union type of all Seedcord error variants for a specific error code.\n *\n * @internal\n */\ntype AnySeedcordErrorForCode<Code extends SeedcordErrorCode> = {\n [Variant in SeedcordErrorTypeString]: SeedcordErrorVariant<Variant, Code>;\n}[SeedcordErrorTypeString];\n\n/**\n * Union type of all Seedcord errors filtered by error class.\n *\n * @internal\n */\ntype ErrorTypeFilter<Type extends SeedcordErrorTypeString | undefined> = Type extends SeedcordErrorTypeString\n ? {\n [Code in SeedcordErrorCode]: SeedcordErrorVariant<Type, Code>;\n }[SeedcordErrorCode]\n : AnySeedcordErrorForCode<SeedcordErrorCode>;\n\n/**\n * Union type of all Seedcord errors filtered by error class and error code.\n *\n * @internal\n */\nexport type ErrorCodeFilter<\n Type extends SeedcordErrorTypeString | undefined,\n Code extends SeedcordErrorCode | undefined\n> = Code extends SeedcordErrorCode\n ? Type extends SeedcordErrorTypeString\n ? SeedcordErrorVariant<Type, Code>\n : AnySeedcordErrorForCode<Code>\n : ErrorTypeFilter<Type>;\n\n/**\n * Determines whether an unknown value is a Seedcord error, with optional narrowing by class and error code.\n *\n * @param error - The value to inspect.\n * @param type - Optional error class discriminator.\n * @param code - Optional {@link SeedcordErrorCode} discriminator to narrow by code.\n * @typeParam Type - What kind of {@link SeedcordErrorTypeString} to filter by.\n * @typeParam Code - The specific {@link SeedcordErrorCode} to filter by.\n */\nexport function isSeedcordError<\n Type extends SeedcordErrorTypeString | undefined,\n Code extends SeedcordErrorCode | undefined\n>(error: unknown, type?: Type, code?: Code): error is ErrorCodeFilter<Type, Code> {\n if (!isCoded(error)) return false;\n if (type && error.type !== type) return false;\n if (code === undefined) return true;\n // another copy of this package may number the same identifier differently\n return error[kIdentifier] === resolveIdentifier(code);\n}\n"],"mappings":";;;;;;AAKA,IAAY,oBAAL;;CAEH;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAGA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAGA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAGA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAGA;;CAEA;;CAEA;;CAEA;;CAGA;;CAEA;;CAEA;;CAEA;;CAEA;;CAGA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAGA;;CAGA;;CAEA;;CAEA;;CAEA;;CAGA;;CAEA;;CAGA;;CAEA;;CAEA;;CAGA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAGA;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,MAAM,sBAAsB,YACnC,MAAM,kBAAkB,MAAM,UAAU;CAEhD;AACJ;AAEA,MAAM,uBAAuB,SAAS;;;;;;;;;;AA6DtC,SAAgB,gBAGd,OAAgB,MAAa,MAAmD;CAC9E,IAAI,CAAC,QAAQ,KAAK,GAAG,OAAO;CAC5B,IAAI,QAAQ,MAAM,SAAS,MAAM,OAAO;CACxC,IAAI,SAAS,QAAW,OAAO;CAE/B,OAAO,MAAM,iBAAiB,kBAAkB,IAAI;AACxD"}
|
|
@@ -89,12 +89,10 @@ declare enum SeedcordErrorCode {
|
|
|
89
89
|
InteractionDuplicateRoute = 1401,
|
|
90
90
|
/** Two different middleware classes share a class name. */
|
|
91
91
|
DuplicateMiddleware = 1402,
|
|
92
|
-
/** A
|
|
93
|
-
|
|
94
|
-
/** A
|
|
95
|
-
|
|
96
|
-
/** A manifest row's module threw while importing. */
|
|
97
|
-
RouteModuleLoadFailed = 1405,
|
|
92
|
+
/** A manifest array lists a class that does not extend the base for that array. */
|
|
93
|
+
ManifestEntryWrongClass = 1403,
|
|
94
|
+
/** A manifest array lists a class whose decorator is missing. Nothing registered. */
|
|
95
|
+
ManifestEntryNoRoutes = 1404,
|
|
98
96
|
/** A reply method was called in an ack state where it is illegal. */
|
|
99
97
|
ReplyIllegalAckState = 1501,
|
|
100
98
|
/** A reply component failed to serialize to raw API data. */
|
|
@@ -340,9 +338,8 @@ declare const messages: {
|
|
|
340
338
|
1306: (key: string) => string;
|
|
341
339
|
1401: (route: string, first: string, second: string) => string;
|
|
342
340
|
1402: (name: string) => string;
|
|
343
|
-
1403: (
|
|
344
|
-
1404: (
|
|
345
|
-
1405: (route: string, from: string) => string;
|
|
341
|
+
1403: (array: string, className: string, base: string) => string;
|
|
342
|
+
1404: (array: string, className: string, decorator: string) => string;
|
|
346
343
|
1501: (method: string, reason: string, alternative: string, routeId: string) => string;
|
|
347
344
|
1502: (componentClass: string, index: number, detail: string, routeId: string) => string;
|
|
348
345
|
1503: (method: string, targetId: string, routeId: string) => string;
|
|
@@ -520,4 +517,4 @@ type ErrorCodeFilter<Type extends SeedcordErrorTypeString | undefined, Code exte
|
|
|
520
517
|
declare function isSeedcordError<Type extends SeedcordErrorTypeString | undefined, Code extends SeedcordErrorCode | undefined>(error: unknown, type?: Type, code?: Code): error is ErrorCodeFilter<Type, Code>;
|
|
521
518
|
//#endregion
|
|
522
519
|
export { SeedcordTypeError as a, paint as c, SeedcordRangeError as i, SeedcordErrorCode as l, SeedcordError as n, isSeedcordError as o, SeedcordErrorTypeString as r, BRAND as s, SeedcordAggregateError as t };
|
|
523
|
-
//# sourceMappingURL=SeedcordError-
|
|
520
|
+
//# sourceMappingURL=SeedcordError-DOERCvXL.d.mts.map
|
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { c as paint, l as SeedcordErrorCode, o as isSeedcordError, r as SeedcordErrorTypeString } from "./SeedcordError-
|
|
1
|
+
import { c as paint, l as SeedcordErrorCode, o as isSeedcordError, r as SeedcordErrorTypeString } from "./SeedcordError-DOERCvXL.mjs";
|
|
2
2
|
//#region src/index.d.ts
|
|
3
3
|
/** Package version */
|
|
4
|
-
declare const version: string;
|
|
4
|
+
export declare const version: string;
|
|
5
5
|
//#endregion
|
|
6
|
-
export { SeedcordErrorCode, type SeedcordErrorTypeString, isSeedcordError, paint
|
|
6
|
+
export { SeedcordErrorCode, type SeedcordErrorTypeString, isSeedcordError, paint };
|
|
7
7
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { a as isSeedcordError, c as SeedcordErrorCode, s as paint } from "./SeedcordError-
|
|
1
|
+
import { a as isSeedcordError, c as SeedcordErrorCode, s as paint } from "./SeedcordError-CFERGyXK.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/index.ts
|
|
4
4
|
/** Package version */
|
|
5
|
-
const version = "0.
|
|
5
|
+
const version = "0.12.0";
|
|
6
6
|
|
|
7
7
|
//#endregion
|
|
8
8
|
export { SeedcordErrorCode, isSeedcordError, paint, version };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { a as SeedcordTypeError, i as SeedcordRangeError, n as SeedcordError, s as BRAND, t as SeedcordAggregateError } from "./SeedcordError-
|
|
1
|
+
import { a as SeedcordTypeError, i as SeedcordRangeError, n as SeedcordError, s as BRAND, t as SeedcordAggregateError } from "./SeedcordError-DOERCvXL.mjs";
|
|
2
2
|
//#region src/validateDiscordToken.d.ts
|
|
3
3
|
/** @internal */
|
|
4
|
-
declare function validateDiscordToken(raw: unknown): string;
|
|
4
|
+
export declare function validateDiscordToken(raw: unknown): string;
|
|
5
5
|
//#endregion
|
|
6
6
|
//#region src/applicationIdFromToken.d.ts
|
|
7
|
-
declare function applicationIdFromToken(token: string): string;
|
|
7
|
+
export declare function applicationIdFromToken(token: string): string;
|
|
8
8
|
//#endregion
|
|
9
|
-
export { BRAND, SeedcordAggregateError, SeedcordError, SeedcordRangeError, SeedcordTypeError
|
|
9
|
+
export { BRAND, SeedcordAggregateError, SeedcordError, SeedcordRangeError, SeedcordTypeError };
|
|
10
10
|
//# sourceMappingURL=internal.index.d.mts.map
|
package/dist/internal.index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as SeedcordErrorCode, i as SeedcordTypeError, n as SeedcordError, o as BRAND, r as SeedcordRangeError, t as SeedcordAggregateError } from "./SeedcordError-
|
|
1
|
+
import { c as SeedcordErrorCode, i as SeedcordTypeError, n as SeedcordError, o as BRAND, r as SeedcordRangeError, t as SeedcordAggregateError } from "./SeedcordError-CFERGyXK.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/validateDiscordToken.ts
|
|
4
4
|
const ENV_NAME = "DISCORD_BOT_TOKEN";
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seedcord/errors",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.12.0",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=24.11"
|
|
7
7
|
},
|
|
@@ -44,14 +44,14 @@
|
|
|
44
44
|
"LICENSE"
|
|
45
45
|
],
|
|
46
46
|
"peerDependencies": {
|
|
47
|
-
"typescript": "^6.0.
|
|
47
|
+
"typescript": "^5.9.3 || ^6.0.0 || ^7.0.0"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"chalk": "^6.0.0"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"@seedcord/eslint-config": "^2.
|
|
54
|
-
"@seedcord/tsconfig": "^2.0.
|
|
53
|
+
"@seedcord/eslint-config": "^2.3.0",
|
|
54
|
+
"@seedcord/tsconfig": "^2.0.5",
|
|
55
55
|
"@seedcord/tsdown-config": "^2.0.1",
|
|
56
56
|
"@seedcord/vitest-config": "^0.0.1"
|
|
57
57
|
},
|
|
@@ -71,5 +71,5 @@
|
|
|
71
71
|
"test:watch": "vitest dev",
|
|
72
72
|
"coverage": "vitest run --coverage"
|
|
73
73
|
},
|
|
74
|
-
"readme": "<div align=\"center\">\n <picture>\n <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://cdn.seedcord.org/assets/wordmark-dark.webp\" />\n <img src=\"https://cdn.seedcord.org/assets/wordmark-light.webp\" alt=\"seedcord\" width=\"440\" />\n </picture>\n</div>\n\n<div align=\"center\">\n <h3>The whole Discord bot, typed end to end</h3>\n <a href=\"https://seedcord.org\">Website</a> ·\n <a href=\"https://
|
|
74
|
+
"readme": "<div align=\"center\">\n <picture>\n <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://cdn.seedcord.org/assets/wordmark-dark.webp\" />\n <img src=\"https://cdn.seedcord.org/assets/wordmark-light.webp\" alt=\"seedcord\" width=\"440\" />\n </picture>\n</div>\n\n<div align=\"center\">\n <h3>The whole Discord bot, typed end to end</h3>\n <a href=\"https://seedcord.org\">Website</a> ·\n <a href=\"https://seedcord.org/guide\">Guide</a> ·\n <a href=\"https://seedcord.org/docs\">Reference</a> ·\n <a href=\"https://discord.gg/DzFxY58WXf\">Discord</a>\n</div>\n\n<br />\n\n<div align=\"center\">\n\n[](https://www.npmjs.com/package/@seedcord/errors) [](https://nodejs.org) [](LICENSE)\n\n</div>\n\n## About\n\n`@seedcord/errors` holds every error seedcord throws. Each one carries a registered code from `SeedcordErrorCode`, so a caller can branch on one specific failure.\n\nFramework code never throws a raw `Error`. A third-party throw may be translated into one of these before you catch it.\n\nUntil v1.0.0, minor versions can break.\n\n## Installation\n\nYour transport already re-exports this.\n\n```sh\npnpm add @seedcord/errors\n```\n\n## Usage\n\n`isSeedcordError` narrows on the class and the code together:\n\n```ts\nimport { isSeedcordError, SeedcordErrorCode } from '@seedcord/errors';\n\ntry {\n await run();\n} catch (error) {\n if (isSeedcordError(error, 'SeedcordError', SeedcordErrorCode.CliCancelled)) return;\n throw error;\n}\n```\n\nCalled with one argument it narrows to any seedcord error.\n"
|
|
75
75
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SeedcordError-BfC-202u.mjs","names":[],"sources":["../src/ErrorCodes.ts","../src/palette.ts","../src/ErrorMessages.ts","../src/SeedcordError.ts"],"sourcesContent":["/* eslint-disable no-magic-numbers */\n\n/**\n * All Seedcord error codes.\n */\nexport enum SeedcordErrorCode {\n /** One or more configured emojis could not be resolved at startup. */\n ConfigEmojiUnresolved = 1001,\n /** A webhook reporter's env var is set but fails webhook URL validation. */\n ConfigWebhookUrlInvalid = 1002,\n /** A configured webhook does not exist on Discord (deleted, or a wrong id or token). */\n ConfigWebhookNotFound = 1003,\n /** The generated route manifest was imported before `seedcord build` generated it. */\n ConfigManifestNotGenerated = 1004,\n /** A required environment variable is not present. */\n ConfigMissingEnv = 1005,\n /** An environment variable is present and fails validation. */\n ConfigInvalidEnv = 1006,\n /** A command usable in a guild is registered without the `Guilds` intent that caches guilds. */\n MissingGuildsIntent = 1007,\n /** The running Node version is below the range seedcord declares in `engines`. */\n UnsupportedNodeVersion = 1008,\n /** `DISCORD_BOT_TOKEN` passed its shape check and carries no readable application id. */\n ConfigTokenUnreadable = 1009,\n\n /** Attempted to add lifecycle tasks after startup already completed. */\n LifecycleAddAfterCompletion = 1101,\n /** Attempted to add lifecycle tasks while startup is still running. */\n LifecycleAddDuringRun = 1102,\n /** Attempted to remove lifecycle tasks while startup is still running. */\n LifecycleRemoveDuringRun = 1103,\n /** Provided lifecycle phase identifier is not recognized. */\n LifecycleUnknownPhase = 1104,\n /** Startup phase completed with one or more task failures. */\n LifecyclePhaseFailures = 1105,\n /** A lifecycle task exceeded its configured timeout. */\n LifecycleTaskTimeout = 1106,\n /** A host whose startup failed was started again. */\n LifecycleRestartAfterFailure = 1107,\n /** The configured shutdown deadline is zero, negative, or not finite. */\n LifecycleInvalidShutdownDeadline = 1108,\n\n /** Multiple Seedcord instances were created simultaneously. */\n CoreSingletonViolation = 1201,\n /** Plugins cannot be mutated after the core has finished initializing. */\n CorePluginAfterInit = 1202,\n /** A plugin tried to register with a key that already exists. */\n CorePluginKeyExists = 1203,\n /** Bot role lookup failed within the provided guild. */\n CoreBotRoleMissing = 1204,\n /** A bot controller was constructed without its required handlers directory. */\n CoreControllerPathMissing = 1205,\n /** A file in a scanned directory threw while being imported. */\n CoreDirectoryImportFailed = 1206,\n /** A scanned directory could not be read. */\n CoreDirectoryUnreadable = 1207,\n /** A plugin was attached under a key the framework logs on. */\n CorePluginReservedChannel = 1208,\n /** The application id was read before startup resolved it. */\n CoreApplicationUnavailable = 1209,\n /** A generated accessor was read before startup resolved its values. */\n CoreAccessorUnresolved = 1210,\n /** A startup or shutdown task was added to a core built by `createSeedcord`. */\n CoreLifecycleUnavailable = 1211,\n /** `emit` was called on the bus. It reaches listeners and skips every subscriber. */\n CoreBusEmitUnavailable = 1212,\n /** A command decorator passed `'config'` while `commands.guilds` is empty. */\n CoreCommandGuildsEmpty = 1213,\n /** Discord refused the command deploy for one guild. */\n CoreCommandGuildDeployFailed = 1214,\n /** A plugin was attached under a group name the bot already uses. */\n CorePluginGroupTaken = 1215,\n /** A plugin was attached at a name that holds a group of plugins. */\n CorePluginKeyHoldsGroup = 1216,\n /** A plugin key is empty, has an empty part, or carries more than one dot. */\n CorePluginKeyMalformed = 1217,\n /** An attached plugin doesn't extend the `Plugin` class of the bot's `@seedcord/core`. */\n CorePluginFromOtherCore = 1218,\n\n /** A command decorator attempted to re-register an existing command scope. */\n DecoratorCommandAlreadyRegistered = 1301,\n /** A global command decorator specified guild IDs, which is not allowed. */\n DecoratorCommandGlobalWithGuilds = 1302,\n /** A guild command decorator omitted the required guild ID list. */\n DecoratorCommandGuildWithoutGuilds = 1303,\n /** Middleware priority provided by the decorator was not a finite number. */\n DecoratorInvalidMiddlewarePriority = 1304,\n /** A WebhookLog subclass is missing its `@WebhookUrl` decorator. */\n DecoratorWebhookUrlMissing = 1305,\n /** A middleware decorator was given an empty filter array. */\n DecoratorEmptyMiddlewareFilter = 1306,\n\n /** Two interaction handlers registered the same route within a scope. */\n InteractionDuplicateRoute = 1401,\n /** Two different middleware classes share a class name. */\n DuplicateMiddleware = 1402,\n /** A route manifest row gives an export name its module does not have. */\n InteractionRouteExportMissing = 1403,\n /** A subscriber manifest row specifies an export that does not extend `Subscriber`. */\n SubscriberRouteNotASubscriber = 1404,\n /** A manifest row's module threw while importing. */\n RouteModuleLoadFailed = 1405,\n\n /** A reply method was called in an ack state where it is illegal. */\n ReplyIllegalAckState = 1501,\n /** A reply component failed to serialize to raw API data. */\n ReplyComponentSerialization = 1502,\n /** edit() was passed a message the interaction did not send. */\n ReplyForeignEditTarget = 1503,\n /** update() or deferUpdate() was called on a modal with no source message. */\n ReplyUpdateWithoutSource = 1504,\n /** A withResponse interaction callback returned no created message. */\n ReplyCallbackMissingMessage = 1505,\n\n /** A customId definition prefix contains a reserved character (a colon or a control char). */\n CustomIdInvalidPrefix = 1601,\n /** A customId field name is integer-like, which JS would silently reorder. */\n CustomIdReservedFieldName = 1602,\n /** A oneOf() or someOf() field was declared with no choices. */\n CustomIdEmptyChoices = 1603,\n /** An int() field was declared with min greater than max. */\n CustomIdInvalidBounds = 1604,\n /** A field rejected the value given to encode(). */\n CustomIdValueRejected = 1605,\n /** An encoded customId exceeds Discord's 100-character limit. */\n CustomIdWireTooLong = 1606,\n /** A field name is declared more than once in the same customId chain. */\n CustomIdDuplicateFieldName = 1607,\n /** A component handler is missing the route decorator that matches its base. */\n CustomIdHandlerRouteMissing = 1608,\n /** match() received a decoded route with no matching arm. */\n CustomIdMatchArmMissing = 1609,\n /** A slash handler's match() has no arm for the command route that fired. */\n SlashMatchArmMissing = 1610,\n /** An autocomplete handler's match() has no arm for the focused field that fired. */\n AutocompleteMatchArmMissing = 1611,\n /** An event handler's match() has no arm for the event name that fired. */\n EventMatchArmMissing = 1612,\n /** Event middleware read `this.eventName` but was constructed without a fired event name. */\n EventMiddlewareNameUnavailable = 1613,\n /** An autocomplete payload carried no focused option. */\n AutocompleteNoFocusedOption = 1614,\n /** A context menu handler's match() has no arm for the command name that fired. */\n ContextMenuMatchArmMissing = 1615,\n /** No field in the submitted modal carries the requested custom id. */\n ModalFieldNotFound = 1616,\n /** A modal field getter was called on a field of another kind. */\n ModalFieldWrongKind = 1617,\n /** Nothing was picked in a modal field read as required. */\n ModalFieldEmpty = 1618,\n /** A channel select field picked a channel outside the types getSelectedChannels() allows. */\n ModalFieldChannelType = 1619,\n /** A customId was minted under an older shape of the same definition. */\n CustomIdWireStale = 1620,\n /** A customId wire is corrupt, truncated, or was minted by a different definition. */\n CustomIdWireInvalid = 1621,\n /** `dispatch.require()` was called for a key nothing wrote on this dispatch. */\n DispatchStateMissing = 1622,\n\n /** A Cooldown gate was given a duration string that is not a well-formed positive duration. */\n GateInvalidCooldownDuration = 1701,\n\n /** A paginator source was given a perPage that is not a positive integer. */\n PaginationInvalidPerPage = 1801,\n /** A control row was assembled with more than the five buttons Discord allows. */\n PaginationTooManyControls = 1802,\n /** A control row was assembled with no controls. */\n PaginationEmptyControls = 1803,\n /** A control row repeats the same control, which would collide the custom_ids. */\n PaginationDuplicateControls = 1804,\n\n /** A color value could not be resolved to a Discord color integer. */\n ColorUnresolvable = 1901,\n /** A resolved color fell outside Discord's 0x000000 to 0xffffff range. */\n ColorOutOfRange = 1902,\n\n /** A plugin's constructor rejected its options through `rejectOptions`. */\n PluginOptionsRejected = 2001,\n /** Two or more plugins threw while disposing. */\n PluginDisposeFailures = 2002,\n /** A plugin declared a lifecycle timeout that is not a positive, finite number of milliseconds. */\n PluginInvalidLifecycleTimeout = 2003,\n\n /** Mongoose service class is missing the `@RegisterMongooseService` decorator. */\n PluginMongooseServiceDecoratorMissing = 2101,\n /** Mongoose client failed to establish a connection. */\n PluginMongooseConnectionFailed = 2102,\n /** Mongoose client failed to disconnect cleanly during shutdown. */\n PluginMongooseDisconnectFailed = 2103,\n /** Mongoose `services` was accessed before the plugin finished initializing. */\n PluginMongooseServicesNotReady = 2104,\n /** Mongoose rejected the model, usually a duplicate model name or an absent schema. */\n PluginMongooseModelCreationFailed = 2105,\n /** A mongoose service was registered with an empty model name override. */\n PluginMongooseModelNameMissing = 2106,\n\n /** Kysely service class is missing the `@RegisterKyselyService` decorator. */\n PluginKyselyServiceDecoratorMissing = 2201,\n /** Kysely service class is missing its table metadata. */\n PluginKyselyServiceTableMissing = 2202,\n /** Migration manager received an invalid step count. */\n PluginKyselyInvalidStepCount = 2203,\n /** Migration direction was not recognized. */\n PluginKyselyUnknownDirection = 2204,\n /** Provided migrations path could not be resolved. */\n PluginKyselyUnresolvedMigrationsPath = 2205,\n /** No migration files were found for execution. */\n PluginKyselyNoMigrationFiles = 2206,\n /** A migration module failed to export the expected functions. */\n PluginKyselyInvalidMigrationModule = 2207,\n /** An arbitrary (non-Error) failure was reported by a migration. */\n PluginKyselyNonErrorFailure = 2208,\n /** Postgres pool failed to close cleanly during shutdown. */\n PluginKyselyDisconnectFailed = 2209,\n /** Kysely `services` was accessed before the plugin finished initializing. */\n PluginKyselyServicesNotReady = 2210,\n /** Postgres pool failed to establish a connection. */\n PluginKyselyConnectionFailed = 2211,\n /** Bootstrapper failed to ensure the target Postgres database exists. */\n PluginKyselyBootstrapFailed = 2212,\n\n /** Config file default export was not an object. */\n CliConfigInvalidExport = 3101,\n /** Config is missing the required instance string. */\n CliConfigMissingInstance = 3102,\n /** Unable to locate a Seedcord config file. */\n CliConfigNotFound = 3103,\n /** CLI entry file does not exist. */\n CliEntryNotFound = 3104,\n /** Failed to import a TypeScript entry file. */\n CliTsImportFailed = 3105,\n /** Native import and jiti fallback both failed. */\n CliImportFailed = 3106,\n /** Seedcord instance export is missing a start() method. */\n CliInstanceInvalid = 3107,\n /** Seedcord instance threw during startup. */\n CliStartFailed = 3108,\n /** Config is missing the required entry string. */\n CliConfigMissingEntry = 3109,\n /** Entry file must be inside the configured root directory. */\n CliConfigEntryOutsideRoot = 3110,\n /** Unable to locate a TypeScript config file for builds. */\n CliBuildTsconfigNotFound = 3111,\n /** TypeScript reported diagnostics during emit. */\n CliBuildFailed = 3112,\n /** Unable to write the generated bootstrap file. */\n CliBootstrapWriteFailed = 3113,\n /** Two commands resolve to the same slash route during codegen. */\n CliCodegenDuplicateRoute = 3114,\n /** The commands directory could not be read during codegen. */\n CliCodegenCommandsDirUnreadable = 3115,\n /** Two context-menu commands of the same kind share a name during codegen. */\n CliCodegenDuplicateContextMenu = 3116,\n /** Could not resolve the application from the bot token during `commands --clean`. */\n CliCleanAppFetchFailed = 3117,\n /** `commands --clean` ran with neither --guild nor --all-guilds. */\n CliCleanNoGuilds = 3118,\n /** `commands --clean` combined --purge with --all-guilds, which would wipe every guild. */\n CliCleanPurgeAllGuilds = 3119,\n /** An interactive prompt was cancelled (Ctrl-C), so the command aborts without changes. */\n CliCancelled = 3120,\n /** `commands --clean --all-guilds` matched more guilds than the safety threshold without `--yes`. */\n CliCleanLargeBotUnconfirmed = 3121,\n /** `commands --clean --apply` ran in a non-interactive environment without `--yes`, where it cannot prompt. */\n CliCleanApplyNeedsYes = 3122,\n /** The cloudflared metrics server never reported a quick-tunnel hostname. */\n CliTunnelUrlUnavailable = 3123,\n /** Discord rejected the tunnel URL as an interactions endpoint. */\n CliTunnelNotVerified = 3124,\n /** The tunnel URL never answered its health probe. */\n CliTunnelUnreachable = 3125,\n /** A config field is present with the wrong shape. */\n CliConfigInvalidField = 3126,\n /** A class carrying `@RegisterCommand` threw while codegen constructed it. */\n CliCodegenCommandConstructorThrew = 3127,\n\n /** A create prompt was cancelled (Ctrl-C), and nothing has been written yet. */\n CreateCancelled = 3201,\n /** A flag supplied an answer for a question the earlier answers skip. */\n CreateFlagNotApplicable = 3202,\n /** A flag carried a value its question rejects. */\n CreateInvalidAnswer = 3203,\n /** The command line did not parse. */\n CreateBadUsage = 3204,\n /** The target path already holds something. */\n CreateTargetNotEmpty = 3205,\n /** A command the scaffolder shelled out to exited non-zero. */\n CreateStepFailed = 3206\n}\n","import chalk from 'chalk';\n\n// @seedcord/ui carries the same three for the web\nexport const BRAND = {\n flesh: '#f04e36',\n rind: '#6fab49',\n pith: '#f8f6e8'\n} as const;\n\n// truecolor because a terminal theme remaps chalk's 16-color names (blue turns orange in monokai)\nexport const paint = {\n sky: chalk.hex('#8fc7ff'), // what the line is about, one per line\n iris: chalk.hex('#e29bff'), // a count\n mint: chalk.hex('#66d98a'), // success\n amber: chalk.hex('#ffc061'), // go do something about this\n coral: chalk.hex('#ff6b85'), // failure\n // brand marks\n flesh: chalk.hex(BRAND.flesh),\n rind: chalk.hex(BRAND.rind),\n pith: chalk.hex(BRAND.pith),\n mute: chalk.dim, // context around the subject\n // weight and shape\n bold: chalk.bold,\n italic: chalk.italic,\n underline: chalk.underline\n} as const;\n","import { SeedcordErrorCode } from './ErrorCodes';\nimport { paint } from './palette';\n\n/** @internal */\nconst messages = {\n [SeedcordErrorCode.ConfigMissingEnv]: (name: string) => `Missing ${name} environment variable.`,\n [SeedcordErrorCode.ConfigInvalidEnv]: (name: string, expected?: string) =>\n expected ? `Invalid ${name} value. Expected ${expected}.` : `Invalid ${name} value.`,\n [SeedcordErrorCode.ConfigManifestNotGenerated]: () =>\n 'The route manifest is generated by `seedcord build`. Run the build before importing it.',\n [SeedcordErrorCode.ConfigWebhookUrlInvalid]: (envKey: string) =>\n `${envKey} is not a well-formed Discord webhook url.`,\n [SeedcordErrorCode.ConfigWebhookNotFound]: (envKey: string) =>\n `The webhook behind ${envKey} does not exist on Discord.`,\n [SeedcordErrorCode.ConfigEmojiUnresolved]: (count: number, failures: string) =>\n `Could not resolve ${count} configured emoji${count === 1 ? '' : 's'} at startup.\\n${failures}`,\n [SeedcordErrorCode.ConfigTokenUnreadable]: () =>\n \"DISCORD_BOT_TOKEN carries no readable application id. Discord builds the first part of a bot token from that id, so a token failing here is truncated or mistyped. Copy it again from your application's Bot page.\",\n [SeedcordErrorCode.MissingGuildsIntent]: (commands: string) =>\n `Add GatewayIntentBits.Guilds to clientOptions.intents. Without it discord.js doesn't cache any guild, so interaction.guild is null inside these commands: ${commands}.`,\n [SeedcordErrorCode.UnsupportedNodeVersion]: (required: string, running: string) =>\n `seedcord requires Node ${required} and this process runs ${running}. Upgrade Node before starting the bot.`,\n\n [SeedcordErrorCode.LifecycleAddAfterCompletion]: () =>\n 'Cannot add tasks after startup sequence has already completed.',\n [SeedcordErrorCode.LifecycleAddDuringRun]: () => 'Cannot add tasks while startup sequence is in progress.',\n [SeedcordErrorCode.LifecycleRemoveDuringRun]: () => 'Cannot remove tasks while startup sequence is in progress.',\n [SeedcordErrorCode.LifecycleUnknownPhase]: (phase: unknown) => `Unknown phase: ${String(phase)}.`,\n [SeedcordErrorCode.LifecyclePhaseFailures]: (phase: string, failures: number) =>\n `Phase ${phase} completed with ${failures} failed task${failures === 1 ? '' : 's'}.`,\n [SeedcordErrorCode.LifecycleTaskTimeout]: (taskName: string, timeout: number) =>\n `Task \"${taskName}\" timed out after ${timeout}ms.`,\n [SeedcordErrorCode.LifecycleRestartAfterFailure]: () =>\n 'Startup failed and this host cannot start again. Construct a new instance.',\n [SeedcordErrorCode.LifecycleInvalidShutdownDeadline]: (declared: number) =>\n `lifecycle.shutdownDeadline is ${declared}. Pass a positive number of milliseconds, or omit it for the default.`,\n\n [SeedcordErrorCode.CoreSingletonViolation]: () =>\n 'Seedcord can only be instantiated once. Use the existing instance instead.',\n [SeedcordErrorCode.CorePluginAfterInit]: () => 'Cannot attach a plugin after initialization.',\n [SeedcordErrorCode.CorePluginKeyExists]: (key: string) => `Plugin with key \"${key}\" already exists.`,\n [SeedcordErrorCode.CoreBotRoleMissing]: (guildId?: string) =>\n guildId ? `Bot role not found in guild ${guildId}.` : 'Bot role not found in guild.',\n [SeedcordErrorCode.CoreControllerPathMissing]: (controllerName: string, pathKind: string) =>\n `${controllerName} was instantiated without a ${pathKind} path.`,\n [SeedcordErrorCode.CoreDirectoryImportFailed]: (file: string) => `${file} threw while importing.`,\n [SeedcordErrorCode.CoreDirectoryUnreadable]: (dir: string) => `${dir} could not be read.`,\n [SeedcordErrorCode.CorePluginGroupTaken]: (head: string, key: string) =>\n `${paint.sky(head)} is already taken on this bot, so ${paint.sky(key)} cannot nest under it. Pick another group name.`,\n [SeedcordErrorCode.CorePluginKeyMalformed]: (key: string, reason: string) =>\n `${paint.sky(key)} ${reason} Write a group and a plugin name around one dot, like 'services.users'.`,\n [SeedcordErrorCode.CorePluginFromOtherCore]: (plugin: string) =>\n `${paint.sky(plugin)} doesn't extend the ${paint.bold('Plugin')} class your bot uses. That usually means two copies of ${paint.bold('@seedcord/core')} are installed. Update the plugin and your ${paint.bold('@seedcord')} packages to versions that need the same ${paint.bold('@seedcord/core')}. Your package manager can list each installed copy and the package that pulled it in.`,\n [SeedcordErrorCode.CorePluginKeyHoldsGroup]: (key: string) =>\n `${paint.sky(key)} already holds a group of plugins. Attach this one under a name of its own.`,\n [SeedcordErrorCode.CorePluginReservedChannel]: (key: string) =>\n `Plugin key \"${key}\" is a channel the framework logs on. Pick another key.`,\n [SeedcordErrorCode.CoreApplicationUnavailable]: () =>\n \"The bot's application id resolves during startup. You read it before that. Read it inside a handler, inside a plugin's ready(), or after start() resolves.\",\n [SeedcordErrorCode.CoreAccessorUnresolved]: (accessor: string, key: string) =>\n `${accessor}.${key} has no value yet. ${accessor} fills during startup, and a read at the top of a file runs before that.`,\n [SeedcordErrorCode.CoreLifecycleUnavailable]: (accessor: string) =>\n `core.${accessor}.addTask() does not work here. This bot was built with createSeedcord() whose build never runs startup or shutdown. Your task would never run. Do the work inside your handler instead. To use startup and shutdown, run the bot on node with new Seedcord(config).start().`,\n [SeedcordErrorCode.CoreBusEmitUnavailable]: (event: string) =>\n `core.bus.emit('${event}') would reach your on() listeners and skip every Subscriber class. Call core.bus.publish('${event}', data) to run both.`,\n\n [SeedcordErrorCode.CoreCommandGuildsEmpty]: (commandName: string) =>\n `${paint.sky(commandName)} registers to the 'config' guilds while commands.guilds is empty.\\nList the ids under commands.guilds, or pass them to @RegisterCommand('guild', [...]).`,\n\n [SeedcordErrorCode.CoreCommandGuildDeployFailed]: (guildId: string) =>\n `Discord refused the command deploy for guild ${paint.sky(guildId)}.\\nCheck that the id is right, and that your bot is in that server.`,\n\n [SeedcordErrorCode.DecoratorCommandAlreadyRegistered]: (\n commandName: string,\n existingCall: string,\n requestedCall: string\n ) =>\n `${paint.sky(commandName)} is registered twice, first with ${existingCall}, then with ${requestedCall}. Keep one.`,\n [SeedcordErrorCode.DecoratorCommandGlobalWithGuilds]: () =>\n 'RegisterCommand(\"global\") cannot have guilds specified.',\n [SeedcordErrorCode.DecoratorCommandGuildWithoutGuilds]: () =>\n 'RegisterCommand(\"guild\") requires a non-empty guilds array.',\n [SeedcordErrorCode.DecoratorInvalidMiddlewarePriority]: () => 'Middleware priority must be a finite number.',\n [SeedcordErrorCode.DecoratorWebhookUrlMissing]: (className: string) =>\n `${className} extends WebhookLog and needs a @WebhookUrl decorator naming its env var.`,\n\n [SeedcordErrorCode.DecoratorEmptyMiddlewareFilter]: (key: string) =>\n `\\`${key}\\` was given an empty array. Drop the key to run the middleware on everything.`,\n [SeedcordErrorCode.InteractionDuplicateRoute]: (route: string, first: string, second: string) =>\n `Two interaction handlers resolve to the same route \\`${route}\\`. Registered by ${first} and ${second}. Rename one.`,\n [SeedcordErrorCode.DuplicateMiddleware]: (name: string) =>\n `Two different middleware classes share the name \\`${name}\\`. Rename one so they do not collide.`,\n [SeedcordErrorCode.InteractionRouteExportMissing]: (route: string, exportName: string, from: string) =>\n `Route \\`${route}\\` loads \\`${exportName}\\` from ${from}, which exports no such name.`,\n [SeedcordErrorCode.SubscriberRouteNotASubscriber]: (keys: string, exportName: string, from: string) =>\n `Subscriber row for \\`${keys}\\` loads \\`${exportName}\\` from ${from}, which does not extend Subscriber.`,\n [SeedcordErrorCode.RouteModuleLoadFailed]: (route: string, from: string) =>\n `Route \\`${route}\\` failed to import ${from}.`,\n\n [SeedcordErrorCode.ReplyIllegalAckState]: (method: string, reason: string, alternative: string, routeId: string) =>\n `${paint.sky(`${method}()`)} was called when ${reason}.\\n${alternative} (route ${paint.mute(routeId)})`,\n [SeedcordErrorCode.ReplyComponentSerialization]: (\n componentClass: string,\n index: number,\n detail: string,\n routeId: string\n ) =>\n `${paint.sky(componentClass)} at components[${index}] failed to serialize: ${detail.replace(/\\.$/, '')}. (route ${paint.mute(routeId)})`,\n [SeedcordErrorCode.ReplyForeignEditTarget]: (method: string, targetId: string, routeId: string) =>\n `${paint.sky(`${method}()`)} was passed message ${targetId}, which this interaction did not send.\\nPass a message this interaction sent, returned by reply(), followUp(), edit(), or update(). (route ${paint.mute(routeId)})`,\n [SeedcordErrorCode.ReplyUpdateWithoutSource]: (method: string, routeId: string) =>\n `${paint.sky(`${method}()`)} was called on a modal opened from a command, which has no source message.\\nUse reply() or defer() instead. (route ${paint.mute(routeId)})`,\n [SeedcordErrorCode.ReplyCallbackMissingMessage]: (method: string, routeId: string) =>\n `The interaction callback for ${paint.sky(`${method}()`)} returned no message. (route ${paint.mute(routeId)})`,\n\n [SeedcordErrorCode.CustomIdInvalidPrefix]: (prefix: string) =>\n `customId prefix ${JSON.stringify(prefix)} must be a non-empty string without a colon or control character.`,\n [SeedcordErrorCode.CustomIdReservedFieldName]: (field: string) =>\n `customId field name ${JSON.stringify(field)} is integer-like, which JS reorders. Use a non-numeric name.`,\n [SeedcordErrorCode.CustomIdEmptyChoices]: (field: string, method: string) =>\n `customId field ${JSON.stringify(field)} uses ${method}() with no choices. Make the field nullable or provide at least one choice.`,\n [SeedcordErrorCode.CustomIdInvalidBounds]: (field: string, min: number, max: number) =>\n `customId field ${JSON.stringify(field)} has min ${min} greater than max ${max}.`,\n [SeedcordErrorCode.CustomIdValueRejected]: (field: string, expected: string, value: string) =>\n `customId field ${JSON.stringify(field)} expects ${expected}, got ${value}.`,\n [SeedcordErrorCode.CustomIdWireTooLong]: (length: number) =>\n `Encoded customId is ${length} characters, Discord allows at most 100.`,\n [SeedcordErrorCode.CustomIdDuplicateFieldName]: (field: string) =>\n `customId field ${JSON.stringify(field)} is already defined in this chain.`,\n [SeedcordErrorCode.CustomIdHandlerRouteMissing]: (className: string) =>\n `${className} is missing its route decorator. Add the one that matches its base, for example @ButtonRoute or @UserMenuRoute.`,\n [SeedcordErrorCode.CustomIdMatchArmMissing]: (prefix: string) =>\n `match() has no arm for the decoded route ${JSON.stringify(prefix)}.`,\n [SeedcordErrorCode.CustomIdWireStale]: (prefix: string) =>\n `customId ${JSON.stringify(prefix)} was minted under an older shape of this definition. Adding, removing, changing, or moving a field changes the layout hash.`,\n [SeedcordErrorCode.CustomIdWireInvalid]: (detail: string) => `customId could not be decoded. ${detail}.`,\n [SeedcordErrorCode.SlashMatchArmMissing]: (route: string) =>\n `match() has no arm for the command route ${JSON.stringify(route)}.`,\n [SeedcordErrorCode.AutocompleteMatchArmMissing]: (field: string) =>\n `match() has no arm for the focused field ${JSON.stringify(field)}.`,\n [SeedcordErrorCode.EventMatchArmMissing]: (event: string) =>\n `match() has no arm for the event ${JSON.stringify(event)}.`,\n [SeedcordErrorCode.ContextMenuMatchArmMissing]: (name: string) =>\n `match() has no arm for the context menu command ${JSON.stringify(name)}.`,\n [SeedcordErrorCode.EventMiddlewareNameUnavailable]: () =>\n `this.eventName is only available on middleware the controller constructed with a fired event name.`,\n [SeedcordErrorCode.AutocompleteNoFocusedOption]: () => `Autocomplete payload has no focused option.`,\n [SeedcordErrorCode.ModalFieldNotFound]: (customId: string) =>\n `The submitted modal carries no field with the custom id ${JSON.stringify(customId)}. Check it against the id you gave the component when you built the modal.`,\n [SeedcordErrorCode.ModalFieldWrongKind]: (customId: string, kind: string, getter?: string) =>\n getter\n ? `Modal field ${JSON.stringify(customId)} holds ${kind}. Read it with ${getter}().`\n : `Modal field ${JSON.stringify(customId)} holds ${kind}. No getter reads that kind.`,\n [SeedcordErrorCode.ModalFieldEmpty]: (customId: string) =>\n `Modal field ${JSON.stringify(customId)} carries no selection. Build the component as required, or read it without the required argument.`,\n [SeedcordErrorCode.ModalFieldChannelType]: (customId: string, picked: string, allowed: string) =>\n `Modal field ${JSON.stringify(customId)} picked a ${picked} channel. This read allows ${allowed}.`,\n [SeedcordErrorCode.DispatchStateMissing]: (key: string) =>\n `Nothing set \\`${key}\\` on this dispatch. Check that the middleware writing it is registered and that its filter covers this dispatch.`,\n\n [SeedcordErrorCode.GateInvalidCooldownDuration]: (input: string) =>\n `Cooldown duration ${JSON.stringify(input)} is not valid. Pass a number of seconds or a duration string like '30m', '24h', or '500ms'.`,\n\n [SeedcordErrorCode.PaginationInvalidPerPage]: (perPage: number) =>\n `perPage must be a positive integer, got ${perPage}.`,\n [SeedcordErrorCode.PaginationTooManyControls]: (count: number) =>\n `A control row holds at most 5 buttons, got ${count}.`,\n [SeedcordErrorCode.PaginationEmptyControls]: () => `A control row must hold at least one control.`,\n [SeedcordErrorCode.PaginationDuplicateControls]: (key: string) =>\n `A control row cannot repeat the '${key}' control.`,\n\n [SeedcordErrorCode.ColorUnresolvable]: (value: string) => `Cannot convert ${value} into a color.`,\n [SeedcordErrorCode.ColorOutOfRange]: () => 'Color must be within the range 0 to 16777215 (0xffffff).',\n\n [SeedcordErrorCode.PluginOptionsRejected]: (pluginName: string, reason: string) =>\n `${pluginName} rejected its options, ${reason.replace(/\\.$/, '')}.`,\n [SeedcordErrorCode.PluginDisposeFailures]: (count: number) => `${count} plugins failed to dispose.`,\n [SeedcordErrorCode.PluginInvalidLifecycleTimeout]: (pluginName: string, field: string, declared: number) =>\n `${pluginName} declared lifecycle ${field}.timeout as ${declared}. Pass a positive number of milliseconds, or omit it for the default.`,\n\n [SeedcordErrorCode.PluginMongooseServiceDecoratorMissing]: (className: string) =>\n `Missing @RegisterMongooseService on ${className}.`,\n [SeedcordErrorCode.PluginMongooseConnectionFailed]: (databaseName?: string) =>\n databaseName ? `Could not connect to MongoDB (${databaseName}).` : 'Could not connect to MongoDB.',\n [SeedcordErrorCode.PluginMongooseDisconnectFailed]: () =>\n 'Failed to disconnect from MongoDB cleanly during shutdown.',\n [SeedcordErrorCode.PluginMongooseServicesNotReady]: () =>\n 'Mongoose services accessed before the plugin finished initializing.',\n [SeedcordErrorCode.PluginMongooseModelCreationFailed]: (modelName: string, className: string) =>\n `Could not build the mongoose model ${modelName} for ${className}.`,\n [SeedcordErrorCode.PluginMongooseModelNameMissing]: (className: string) =>\n `Empty model name on ${className}. Provide a non-empty modelName via @RegisterMongooseService().`,\n\n [SeedcordErrorCode.PluginKyselyServiceDecoratorMissing]: (className: string) =>\n `Missing @RegisterKyselyService on ${className}.`,\n [SeedcordErrorCode.PluginKyselyServiceTableMissing]: (className: string) =>\n `Missing table metadata for ${className}. Provide a table via @RegisterKyselyService().`,\n [SeedcordErrorCode.PluginKyselyInvalidStepCount]: () => 'Migration step count must be a non-negative integer.',\n [SeedcordErrorCode.PluginKyselyUnknownDirection]: (direction: unknown) =>\n `Unknown migration direction: ${String(direction)}.`,\n [SeedcordErrorCode.PluginKyselyUnresolvedMigrationsPath]: (label: string) =>\n `Unable to resolve migrations at path: ${label}.`,\n [SeedcordErrorCode.PluginKyselyNoMigrationFiles]: () => 'No migration files provided.',\n [SeedcordErrorCode.PluginKyselyInvalidMigrationModule]: (filePath: string) =>\n `Migration file ${filePath} must export async functions up and down.`,\n [SeedcordErrorCode.PluginKyselyNonErrorFailure]: (message: string) => `Migration failure: ${message}.`,\n [SeedcordErrorCode.PluginKyselyDisconnectFailed]: () =>\n 'Failed to close the Postgres pool cleanly during shutdown.',\n [SeedcordErrorCode.PluginKyselyServicesNotReady]: () =>\n 'Kysely services accessed before the plugin finished initializing.',\n [SeedcordErrorCode.PluginKyselyConnectionFailed]: (databaseName?: string) =>\n databaseName ? `Could not connect to Postgres (${databaseName}).` : 'Could not connect to Postgres.',\n [SeedcordErrorCode.PluginKyselyBootstrapFailed]: (databaseName: string) =>\n `Failed to ensure database ${databaseName} exists.`,\n\n [SeedcordErrorCode.CliConfigInvalidExport]: () => 'Config file must default export an object.',\n [SeedcordErrorCode.CliConfigMissingInstance]: () =>\n 'Config must include an `instance` string that points to your Seedcord default export.',\n [SeedcordErrorCode.CliConfigNotFound]: (baseDir: string, candidates: readonly string[]) =>\n `Unable to locate a Seedcord config in ${baseDir}. Searched for ${candidates.join(', ')}.`,\n [SeedcordErrorCode.CliConfigMissingEntry]: () =>\n 'Config must include an `entry` string that points to your startup script.',\n [SeedcordErrorCode.CliConfigEntryOutsideRoot]: (entryPath: string, root: string) =>\n `Entry file ${entryPath} must reside inside configured root ${root}.`,\n [SeedcordErrorCode.CliEntryNotFound]: (entryPath: string) => `Cannot find entry file at ${entryPath}.`,\n [SeedcordErrorCode.CliTsImportFailed]: (entryPath: string, reason: string) =>\n `Failed to import TypeScript file ${entryPath}: ${reason}`,\n [SeedcordErrorCode.CliImportFailed]: (entryPath: string, nativeReason: string, fallbackReason: string) =>\n `Failed to import ${entryPath}: ${nativeReason} (the jiti fallback also failed: ${fallbackReason})`,\n [SeedcordErrorCode.CliInstanceInvalid]: () =>\n 'Seedcord instance must default export an object with a start() method.',\n [SeedcordErrorCode.CliStartFailed]: (instancePath: string, reason: string) =>\n `Failed to start Seedcord from ${instancePath}: ${reason}`,\n [SeedcordErrorCode.CliBuildTsconfigNotFound]: (hint: string) =>\n `Unable to resolve a tsconfig for builds (${hint}). Provide build.tsconfig or add tsconfig.build.json / tsconfig.json.`,\n [SeedcordErrorCode.CliBuildFailed]: (diagnostics: string) => `TypeScript build failed:\\n${diagnostics}`,\n [SeedcordErrorCode.CliBootstrapWriteFailed]: (targetPath: string, reason: string) =>\n `Failed to write bootstrap file at ${targetPath}: ${reason}`,\n [SeedcordErrorCode.CliCodegenDuplicateRoute]: (route: string, firstFile: string, secondFile: string) =>\n `Two commands resolve to the same slash route \\`${route}\\`. Defined in ${firstFile} and ${secondFile}. Rename one.`,\n [SeedcordErrorCode.CliCodegenCommandsDirUnreadable]: (dir: string, reason: string) =>\n `Could not read the commands directory ${dir} during codegen. ${reason}`,\n [SeedcordErrorCode.CliCodegenCommandConstructorThrew]: (name: string, file: string, reason: string) =>\n `${name} threw while codegen constructed it. Fix its constructor in ${file}. ${reason}`,\n [SeedcordErrorCode.CliCodegenDuplicateContextMenu]: (\n kind: string,\n name: string,\n firstFile: string,\n secondFile: string\n ) =>\n `Two ${kind} context-menu commands share the name \\`${name}\\`. Defined in ${firstFile} and ${secondFile}. Rename one.`,\n [SeedcordErrorCode.CliCleanAppFetchFailed]: (reason: string) =>\n `Could not resolve the application from the bot token. ${reason}`,\n [SeedcordErrorCode.CliCleanNoGuilds]: () =>\n 'No guilds given. Pass --guild <ids...> or --all-guilds. Global commands are never touched.',\n [SeedcordErrorCode.CliCleanPurgeAllGuilds]: () =>\n '--purge cannot be combined with --all-guilds. Use --guild <ids> to purge specific guilds.',\n [SeedcordErrorCode.CliCancelled]: () => 'Cancelled.',\n [SeedcordErrorCode.CliCleanLargeBotUnconfirmed]: (count: number) =>\n `Refusing to scan ${count} guilds without confirmation. Re-run with --yes, or name specific guilds with --guild <ids>.`,\n [SeedcordErrorCode.CliCleanApplyNeedsYes]: () =>\n 'Refusing to delete without confirmation in a non-interactive environment. Re-run with --yes.',\n [SeedcordErrorCode.CliTunnelUrlUnavailable]: (seconds: number) =>\n `cloudflared did not report a tunnel URL within ${seconds}s. Check that the binary runs and that the network allows it.`,\n [SeedcordErrorCode.CliTunnelNotVerified]: (url: string) => `Discord rejected ${url} as an interactions endpoint.`,\n [SeedcordErrorCode.CliTunnelUnreachable]: (url: string, seconds: number) =>\n `${url} did not answer within ${seconds}s, so nothing was PATCHed to Discord.`,\n [SeedcordErrorCode.CliConfigInvalidField]: (field: string, expected: string) =>\n `Config \\`${field}\\` must be ${expected} when provided.`,\n [SeedcordErrorCode.CreateCancelled]: () => 'Cancelled.',\n [SeedcordErrorCode.CreateFlagNotApplicable]: (flag: string) =>\n `The --${flag} flag does not apply to the answers you gave.`,\n [SeedcordErrorCode.CreateInvalidAnswer]: (flag: string, reason: string) => `--${flag}: ${reason}`,\n // node's parseArgs message ends on an unclosed quote\n [SeedcordErrorCode.CreateBadUsage]: (reason: string) => `${reason}\\nRun with --help for the flag list.`,\n [SeedcordErrorCode.CreateTargetNotEmpty]: (target: string) =>\n `${target} already has files in it. Pick an empty directory or a name that does not exist yet.`,\n [SeedcordErrorCode.CreateStepFailed]: (command: string, reason: string) => `\\`${command}\\` failed.\\n${reason}`\n} satisfies Record<SeedcordErrorCode, (...args: never[]) => string>;\n\n/** @internal */\nexport type SeedcordErrorArguments<Code extends SeedcordErrorCode> = Parameters<(typeof messages)[Code]>;\n\n/** @internal */\nexport function formatSeedcordErrorMessage<Code extends SeedcordErrorCode>(\n code: Code,\n args?: SeedcordErrorArguments<Code>\n): string {\n const formatter = messages[code];\n const resolvedArgs = (args ?? []) as unknown[];\n return (formatter as (...params: unknown[]) => string)(...resolvedArgs);\n}\n","import { SeedcordErrorCode } from './ErrorCodes';\nimport { formatSeedcordErrorMessage, type SeedcordErrorArguments } from './ErrorMessages';\nimport { paint } from './palette';\n\n/**\n * String literal type for Seedcord error identifiers.\n *\n * @internal\n */\ntype SeedcordErrorIdentifier = keyof typeof SeedcordErrorCode;\n\n/**\n * Options for Seedcord errors.\n *\n * @internal\n */\ninterface SeedcordErrorOptions extends ErrorOptions {}\n\nfunction resolveIdentifier(code: SeedcordErrorCode): SeedcordErrorIdentifier {\n return SeedcordErrorCode[code] as SeedcordErrorIdentifier;\n}\n\ntype SeedcordErrorPayload<Code extends SeedcordErrorCode> = SeedcordErrorArguments<Code> | undefined;\n\ntype SeedcordErrorCtorRest<Code extends SeedcordErrorCode> =\n SeedcordErrorArguments<Code> extends []\n ? [options?: SeedcordErrorOptions]\n : [args: SeedcordErrorArguments<Code>, options?: SeedcordErrorOptions];\n\nfunction resolveCtorInputs<Code extends SeedcordErrorCode>(\n rest: SeedcordErrorCtorRest<Code>\n): { args: SeedcordErrorPayload<Code>; options?: SeedcordErrorOptions } {\n const [maybeArgsOrOptions, maybeOptions] = rest;\n if (Array.isArray(maybeArgsOrOptions)) {\n const result: { args: SeedcordErrorPayload<Code>; options?: SeedcordErrorOptions } = {\n args: maybeArgsOrOptions\n };\n\n if (maybeOptions !== undefined) {\n result.options = maybeOptions;\n }\n\n return result;\n }\n\n const result: { args: SeedcordErrorPayload<Code>; options?: SeedcordErrorOptions } = {\n args: undefined\n };\n\n if (maybeArgsOrOptions !== undefined) {\n result.options = maybeArgsOrOptions;\n }\n\n return result;\n}\n\nfunction resolveMessage<Code extends SeedcordErrorCode>(code: Code, args: SeedcordErrorPayload<Code>): string {\n return formatSeedcordErrorMessage(code, args);\n}\n\nfunction formatErrorName(name: string, _identifier: SeedcordErrorIdentifier, code: SeedcordErrorCode): string {\n return `${paint.coral.bold(name)}[${paint.mute(code)}]`;\n}\n\n/**\n * String literal type for Seedcord error class names. Names the `type` argument of\n * {@link isSeedcordError}.\n */\nexport type SeedcordErrorTypeString = `Seedcord${'Error' | 'TypeError' | 'RangeError' | 'AggregateError'}`;\n\n// Symbol.for so two installed copies read the same slot\nconst kIdentifier: unique symbol = Symbol.for('seedcord:errors:identifier');\n\ninterface BaseSeedcordError {\n readonly code: SeedcordErrorCode;\n readonly [kIdentifier]: SeedcordErrorIdentifier;\n readonly type: SeedcordErrorTypeString;\n}\n\n// instanceof fails across two installed copies of this package\nconst CODED = Symbol.for('seedcord:errors:coded');\n\nfunction brand(prototype: object): void {\n Object.defineProperty(prototype, CODED, { value: true });\n}\n\nfunction isCoded(error: unknown): error is BaseSeedcordError {\n return typeof error === 'object' && error !== null && CODED in error;\n}\n\nexport class SeedcordError<Code extends SeedcordErrorCode = SeedcordErrorCode>\n extends Error\n implements BaseSeedcordError\n{\n public readonly code: Code;\n readonly [kIdentifier]: SeedcordErrorIdentifier;\n public readonly type = 'SeedcordError';\n\n constructor(code: Code, ...rest: SeedcordErrorCtorRest<Code>) {\n const { args, options } = resolveCtorInputs(rest);\n const message = resolveMessage(code, args);\n super(message, options);\n this.code = code;\n this[kIdentifier] = resolveIdentifier(code);\n this.name = formatErrorName(new.target.name, this[kIdentifier], this.code);\n Object.setPrototypeOf(this, new.target.prototype);\n if (typeof Error.captureStackTrace === 'function') {\n Error.captureStackTrace(this, new.target);\n }\n }\n}\n\nbrand(SeedcordError.prototype);\n\nexport class SeedcordTypeError<Code extends SeedcordErrorCode = SeedcordErrorCode>\n extends TypeError\n implements BaseSeedcordError\n{\n public readonly code: Code;\n readonly [kIdentifier]: SeedcordErrorIdentifier;\n public readonly type = 'SeedcordTypeError';\n\n constructor(code: Code, ...rest: SeedcordErrorCtorRest<Code>) {\n const { args, options } = resolveCtorInputs(rest);\n const message = resolveMessage(code, args);\n super(message, options);\n this.code = code;\n this[kIdentifier] = resolveIdentifier(code);\n this.name = formatErrorName(new.target.name, this[kIdentifier], this.code);\n Object.setPrototypeOf(this, new.target.prototype);\n if (typeof Error.captureStackTrace === 'function') {\n Error.captureStackTrace(this, new.target);\n }\n }\n}\n\nbrand(SeedcordTypeError.prototype);\n\nexport class SeedcordRangeError<Code extends SeedcordErrorCode = SeedcordErrorCode>\n extends RangeError\n implements BaseSeedcordError\n{\n public readonly code: Code;\n readonly [kIdentifier]: SeedcordErrorIdentifier;\n public readonly type = 'SeedcordRangeError';\n\n constructor(code: Code, ...rest: SeedcordErrorCtorRest<Code>) {\n const { args, options } = resolveCtorInputs(rest);\n const message = resolveMessage(code, args);\n super(message, options);\n this.code = code;\n this[kIdentifier] = resolveIdentifier(code);\n this.name = formatErrorName(new.target.name, this[kIdentifier], this.code);\n Object.setPrototypeOf(this, new.target.prototype);\n if (typeof Error.captureStackTrace === 'function') {\n Error.captureStackTrace(this, new.target);\n }\n }\n}\n\nbrand(SeedcordRangeError.prototype);\n\nexport class SeedcordAggregateError<Code extends SeedcordErrorCode = SeedcordErrorCode>\n extends AggregateError\n implements BaseSeedcordError\n{\n public readonly code: Code;\n readonly [kIdentifier]: SeedcordErrorIdentifier;\n public readonly type = 'SeedcordAggregateError';\n\n constructor(code: Code, errors: readonly unknown[], ...rest: SeedcordErrorCtorRest<Code>) {\n const { args, options } = resolveCtorInputs(rest);\n const message = resolveMessage(code, args);\n super(errors, message, options);\n this.code = code;\n this[kIdentifier] = resolveIdentifier(code);\n this.name = formatErrorName(new.target.name, this[kIdentifier], this.code);\n Object.setPrototypeOf(this, new.target.prototype);\n if (typeof Error.captureStackTrace === 'function') {\n Error.captureStackTrace(this, new.target);\n }\n }\n}\n\nbrand(SeedcordAggregateError.prototype);\n\n/**\n * Variant type for Seedcord error classes.\n *\n * @internal\n */\ntype SeedcordErrorVariant<\n Type extends SeedcordErrorTypeString,\n Code extends SeedcordErrorCode\n> = Type extends 'SeedcordError'\n ? SeedcordError<Code>\n : Type extends 'SeedcordTypeError'\n ? SeedcordTypeError<Code>\n : Type extends 'SeedcordRangeError'\n ? SeedcordRangeError<Code>\n : SeedcordAggregateError<Code>;\n\n/**\n * Union type of all Seedcord error variants for a specific error code.\n *\n * @internal\n */\ntype AnySeedcordErrorForCode<Code extends SeedcordErrorCode> = {\n [Variant in SeedcordErrorTypeString]: SeedcordErrorVariant<Variant, Code>;\n}[SeedcordErrorTypeString];\n\n/**\n * Union type of all Seedcord errors filtered by error class.\n *\n * @internal\n */\ntype ErrorTypeFilter<Type extends SeedcordErrorTypeString | undefined> = Type extends SeedcordErrorTypeString\n ? {\n [Code in SeedcordErrorCode]: SeedcordErrorVariant<Type, Code>;\n }[SeedcordErrorCode]\n : AnySeedcordErrorForCode<SeedcordErrorCode>;\n\n/**\n * Union type of all Seedcord errors filtered by error class and error code.\n *\n * @internal\n */\nexport type ErrorCodeFilter<\n Type extends SeedcordErrorTypeString | undefined,\n Code extends SeedcordErrorCode | undefined\n> = Code extends SeedcordErrorCode\n ? Type extends SeedcordErrorTypeString\n ? SeedcordErrorVariant<Type, Code>\n : AnySeedcordErrorForCode<Code>\n : ErrorTypeFilter<Type>;\n\n/**\n * Determines whether an unknown value is a Seedcord error, with optional narrowing by class and error code.\n *\n * @param error - The value to inspect.\n * @param type - Optional error class discriminator.\n * @param code - Optional {@link SeedcordErrorCode} discriminator to narrow by code.\n * @typeParam Type - What kind of {@link SeedcordErrorTypeString} to filter by.\n * @typeParam Code - The specific {@link SeedcordErrorCode} to filter by.\n */\nexport function isSeedcordError<\n Type extends SeedcordErrorTypeString | undefined,\n Code extends SeedcordErrorCode | undefined\n>(error: unknown, type?: Type, code?: Code): error is ErrorCodeFilter<Type, Code> {\n if (!isCoded(error)) return false;\n if (type && error.type !== type) return false;\n if (code === undefined) return true;\n // another copy of this package may number the same identifier differently\n return error[kIdentifier] === resolveIdentifier(code);\n}\n"],"mappings":";;;;;;AAKA,IAAY,oBAAL;;CAEH;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAGA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAGA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAGA;;CAEA;;CAEA;;CAEA;;CAE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