@seedcord/errors 0.3.0-next.3 → 0.3.0-next.4

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.
@@ -9,16 +9,16 @@ let SeedcordErrorCode = /* @__PURE__ */ function(SeedcordErrorCode) {
9
9
  SeedcordErrorCode[SeedcordErrorCode["ConfigMissingDiscordToken"] = 1001] = "ConfigMissingDiscordToken";
10
10
  /** DISCORD_BOT_TOKEN is present but fails validation. */
11
11
  SeedcordErrorCode[SeedcordErrorCode["ConfigIncorrectDiscordToken"] = 1004] = "ConfigIncorrectDiscordToken";
12
- /** UNKNOWN_EXCEPTION_WEBHOOK_URL is missing when configuring the reporter. */
13
- SeedcordErrorCode[SeedcordErrorCode["ConfigUnknownExceptionWebhookMissing"] = 1002] = "ConfigUnknownExceptionWebhookMissing";
14
- /** UNKNOWN_EXCEPTION_WEBHOOK_URL is present but fails URL validation. */
15
- SeedcordErrorCode[SeedcordErrorCode["ConfigUnknownExceptionWebhookInvalid"] = 1003] = "ConfigUnknownExceptionWebhookInvalid";
16
- /** HANDLED_EXCEPTION_WEBHOOK_URL is missing when configuring the reporter. */
17
- SeedcordErrorCode[SeedcordErrorCode["ConfigHandledExceptionWebhookMissing"] = 1005] = "ConfigHandledExceptionWebhookMissing";
18
- /** HANDLED_EXCEPTION_WEBHOOK_URL is present but fails URL validation. */
19
- SeedcordErrorCode[SeedcordErrorCode["ConfigHandledExceptionWebhookInvalid"] = 1006] = "ConfigHandledExceptionWebhookInvalid";
20
12
  /** One or more configured emojis could not be resolved at startup. */
21
- SeedcordErrorCode[SeedcordErrorCode["ConfigEmojiUnresolved"] = 1007] = "ConfigEmojiUnresolved";
13
+ SeedcordErrorCode[SeedcordErrorCode["ConfigEmojiUnresolved"] = 1005] = "ConfigEmojiUnresolved";
14
+ /** A webhook reporter's env var is set but fails webhook URL validation. */
15
+ SeedcordErrorCode[SeedcordErrorCode["ConfigWebhookUrlInvalid"] = 1006] = "ConfigWebhookUrlInvalid";
16
+ /** A configured webhook does not exist on Discord (deleted, or a wrong id or token). */
17
+ SeedcordErrorCode[SeedcordErrorCode["ConfigWebhookNotFound"] = 1007] = "ConfigWebhookNotFound";
18
+ /** DISCORD_PUBLIC_KEY is not present in the environment. */
19
+ SeedcordErrorCode[SeedcordErrorCode["ConfigMissingPublicKey"] = 1008] = "ConfigMissingPublicKey";
20
+ /** DISCORD_PUBLIC_KEY is present but fails validation. */
21
+ SeedcordErrorCode[SeedcordErrorCode["ConfigIncorrectPublicKey"] = 1009] = "ConfigIncorrectPublicKey";
22
22
  /** Attempted to add lifecycle tasks after startup already completed. */
23
23
  SeedcordErrorCode[SeedcordErrorCode["LifecycleAddAfterCompletion"] = 1101] = "LifecycleAddAfterCompletion";
24
24
  /** Attempted to add lifecycle tasks while startup is still running. */
@@ -53,10 +53,22 @@ let SeedcordErrorCode = /* @__PURE__ */ function(SeedcordErrorCode) {
53
53
  SeedcordErrorCode[SeedcordErrorCode["DecoratorCommandGuildWithoutGuilds"] = 1305] = "DecoratorCommandGuildWithoutGuilds";
54
54
  /** Middleware priority provided by the decorator was not a finite number. */
55
55
  SeedcordErrorCode[SeedcordErrorCode["DecoratorInvalidMiddlewarePriority"] = 1306] = "DecoratorInvalidMiddlewarePriority";
56
+ /** A WebhookLog subclass is missing its `@WebhookUrl` decorator. */
57
+ SeedcordErrorCode[SeedcordErrorCode["DecoratorWebhookUrlMissing"] = 1307] = "DecoratorWebhookUrlMissing";
56
58
  /** Two interaction handlers registered the same route within a scope. */
57
59
  SeedcordErrorCode[SeedcordErrorCode["InteractionDuplicateRoute"] = 1401] = "InteractionDuplicateRoute";
58
60
  /** Two different interaction middleware classes share a class name. */
59
61
  SeedcordErrorCode[SeedcordErrorCode["InteractionDuplicateMiddleware"] = 1402] = "InteractionDuplicateMiddleware";
62
+ /** A reply method was called in an ack state where it is illegal. */
63
+ SeedcordErrorCode[SeedcordErrorCode["ReplyIllegalAckState"] = 1501] = "ReplyIllegalAckState";
64
+ /** A reply component failed to serialize to raw API data. */
65
+ SeedcordErrorCode[SeedcordErrorCode["ReplyComponentSerialization"] = 1502] = "ReplyComponentSerialization";
66
+ /** edit() was passed a message the interaction did not send. */
67
+ SeedcordErrorCode[SeedcordErrorCode["ReplyForeignEditTarget"] = 1503] = "ReplyForeignEditTarget";
68
+ /** update() or deferUpdate() was called on a modal with no source message. */
69
+ SeedcordErrorCode[SeedcordErrorCode["ReplyUpdateWithoutSource"] = 1504] = "ReplyUpdateWithoutSource";
70
+ /** A withResponse interaction callback returned no created message. */
71
+ SeedcordErrorCode[SeedcordErrorCode["ReplyCallbackMissingMessage"] = 1505] = "ReplyCallbackMissingMessage";
60
72
  /** A customId definition prefix contains a reserved character (a colon or a control char). */
61
73
  SeedcordErrorCode[SeedcordErrorCode["CustomIdInvalidPrefix"] = 1601] = "CustomIdInvalidPrefix";
62
74
  /** A customId field name is integer-like, which JS would silently reorder. */
@@ -83,6 +95,8 @@ let SeedcordErrorCode = /* @__PURE__ */ function(SeedcordErrorCode) {
83
95
  SeedcordErrorCode[SeedcordErrorCode["EventMatchArmMissing"] = 1612] = "EventMatchArmMissing";
84
96
  /** Event middleware read `this.eventName` but was constructed without a fired event name. */
85
97
  SeedcordErrorCode[SeedcordErrorCode["EventMiddlewareNameUnavailable"] = 1613] = "EventMiddlewareNameUnavailable";
98
+ /** An autocomplete payload carried no focused option. */
99
+ SeedcordErrorCode[SeedcordErrorCode["AutocompleteNoFocusedOption"] = 1614] = "AutocompleteNoFocusedOption";
86
100
  /** A Cooldown gate was given a duration string that is not a well-formed positive duration. */
87
101
  SeedcordErrorCode[SeedcordErrorCode["GateInvalidCooldownDuration"] = 1701] = "GateInvalidCooldownDuration";
88
102
  /** A paginator source was given a perPage that is not a positive integer. */
@@ -198,11 +212,11 @@ let SeedcordErrorCode = /* @__PURE__ */ function(SeedcordErrorCode) {
198
212
  const messages = {
199
213
  [1001]: () => "Missing DISCORD_BOT_TOKEN environment variable.",
200
214
  [1004]: () => "Invalid DISCORD_BOT_TOKEN value.",
201
- [1002]: () => "Missing UNKNOWN_EXCEPTION_WEBHOOK_URL environment variable.",
202
- [1003]: () => "Invalid UNKNOWN_EXCEPTION_WEBHOOK_URL value.",
203
- [1005]: () => "Missing HANDLED_EXCEPTION_WEBHOOK_URL environment variable.",
204
- [1006]: () => "Invalid HANDLED_EXCEPTION_WEBHOOK_URL value.",
205
- [1007]: (count, failures) => `Could not resolve ${count} configured emoji${count === 1 ? "" : "s"} at startup.\n${failures}`,
215
+ [1008]: () => "Missing DISCORD_PUBLIC_KEY environment variable.",
216
+ [1009]: () => "Invalid DISCORD_PUBLIC_KEY value. Expected 64 hex characters.",
217
+ [1006]: (envKey) => `${envKey} is not a well-formed Discord webhook url.`,
218
+ [1007]: (envKey) => `The webhook behind ${envKey} does not exist on Discord.`,
219
+ [1005]: (count, failures) => `Could not resolve ${count} configured emoji${count === 1 ? "" : "s"} at startup.\n${failures}`,
206
220
  [1101]: () => "Cannot add tasks after startup sequence has already completed.",
207
221
  [1102]: () => "Cannot add tasks while startup sequence is in progress.",
208
222
  [1103]: () => "Cannot remove tasks while startup sequence is in progress.",
@@ -220,8 +234,14 @@ const messages = {
220
234
  [1304]: () => "RegisterCommand(\"global\") cannot have guilds specified.",
221
235
  [1305]: () => "RegisterCommand(\"guild\") requires a non-empty guilds array.",
222
236
  [1306]: () => "Middleware priority must be a finite number.",
237
+ [1307]: (className) => `${className} extends WebhookLog and needs a @WebhookUrl decorator naming its env var.`,
223
238
  [1401]: (route, firstClass, secondClass) => `Two interaction handlers resolve to the same route \`${route}\`. Registered by ${firstClass} and ${secondClass}. Rename one.`,
224
239
  [1402]: (name) => `Two different interaction middleware classes share the name \`${name}\`. Rename one so they do not collide.`,
240
+ [1501]: (method, reason, alternative, routeId) => `${chalk.cyan(`${method}()`)} was called when ${reason}.\n${alternative} (route ${chalk.cyan(routeId)})`,
241
+ [1502]: (componentClass, index, detail, routeId) => `${chalk.cyan(componentClass)} at components[${index}] failed to serialize: ${detail.replace(/\.$/, "")}. (route ${chalk.cyan(routeId)})`,
242
+ [1503]: (method, targetId, routeId) => `${chalk.cyan(`${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 ${chalk.cyan(routeId)})`,
243
+ [1504]: (method, routeId) => `${chalk.cyan(`${method}()`)} was called on a modal opened from a command, which has no source message.\nUse reply() or defer() instead. (route ${chalk.cyan(routeId)})`,
244
+ [1505]: (method, routeId) => `The interaction callback for ${chalk.cyan(`${method}()`)} returned no message. (route ${chalk.cyan(routeId)})`,
225
245
  [1601]: (prefix) => `customId prefix ${JSON.stringify(prefix)} must be a non-empty string without a colon or control character.`,
226
246
  [1602]: (field) => `customId field name ${JSON.stringify(field)} is integer-like, which JS reorders. Use a non-numeric name.`,
227
247
  [1603]: (field) => `customId field ${JSON.stringify(field)} uses oneOf() with no choices.`,
@@ -235,6 +255,7 @@ const messages = {
235
255
  [1611]: (field) => `match() has no arm for the focused field ${JSON.stringify(field)}.`,
236
256
  [1612]: (event) => `match() has no arm for the event ${JSON.stringify(event)}.`,
237
257
  [1613]: () => `this.eventName is only available on middleware the controller constructed with a fired event name.`,
258
+ [1614]: () => `Autocomplete payload has no focused option.`,
238
259
  [1701]: (input) => `Cooldown duration ${JSON.stringify(input)} is not valid. Pass a number of seconds or a duration string like '30m', '24h', or '500ms'.`,
239
260
  [1801]: (perPage) => `perPage must be a positive integer, got ${perPage}.`,
240
261
  [1802]: (count) => `A control row holds at most 5 buttons, got ${count}.`,
@@ -392,4 +413,4 @@ function isSeedcordError(error, type, code) {
392
413
 
393
414
  //#endregion
394
415
  export { SeedcordErrorCode as a, isSeedcordError as i, SeedcordRangeError as n, SeedcordTypeError as r, SeedcordError as t };
395
- //# sourceMappingURL=SeedcordError-BSoo1HKt.mjs.map
416
+ //# sourceMappingURL=SeedcordError-BjNR7jkv.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SeedcordError-BjNR7jkv.mjs","names":[],"sources":["../src/ErrorCodes.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 /** DISCORD_BOT_TOKEN is not present in the environment. */\n ConfigMissingDiscordToken = 1001,\n /** DISCORD_BOT_TOKEN is present but fails validation. */\n ConfigIncorrectDiscordToken = 1004,\n /** One or more configured emojis could not be resolved at startup. */\n ConfigEmojiUnresolved = 1005,\n /** A webhook reporter's env var is set but fails webhook URL validation. */\n ConfigWebhookUrlInvalid = 1006,\n /** A configured webhook does not exist on Discord (deleted, or a wrong id or token). */\n ConfigWebhookNotFound = 1007,\n /** DISCORD_PUBLIC_KEY is not present in the environment. */\n ConfigMissingPublicKey = 1008,\n /** DISCORD_PUBLIC_KEY is present but fails validation. */\n ConfigIncorrectPublicKey = 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\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\n /** Interaction middleware decorated with disallowed event filters. */\n DecoratorInteractionEventFilter = 1301,\n /** A decorator could not find the original method being decorated. */\n DecoratorMethodNotFound = 1302,\n /** A command decorator attempted to re-register an existing command scope. */\n DecoratorCommandAlreadyRegistered = 1303,\n /** A global command decorator specified guild IDs, which is not allowed. */\n DecoratorCommandGlobalWithGuilds = 1304,\n /** A guild command decorator omitted the required guild ID list. */\n DecoratorCommandGuildWithoutGuilds = 1305,\n /** Middleware priority provided by the decorator was not a finite number. */\n DecoratorInvalidMiddlewarePriority = 1306,\n /** A WebhookLog subclass is missing its `@WebhookUrl` decorator. */\n DecoratorWebhookUrlMissing = 1307,\n\n /** Two interaction handlers registered the same route within a scope. */\n InteractionDuplicateRoute = 1401,\n /** Two different interaction middleware classes share a class name. */\n InteractionDuplicateMiddleware = 1402,\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() 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 value passed to encode() is outside its field's allowed range. */\n CustomIdValueOutOfRange = 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 its route decorator (\\@ButtonRoute / \\@ModalRoute / \\@SelectMenuRoute). */\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\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 /** Mongo service class is missing the `@RegisterMongoService` decorator. */\n PluginMongoServiceDecoratorMissing = 2101,\n /** Mongo model class is missing the `@RegisterMongoModel` decorator. */\n PluginMongoModelDecoratorMissing = 2102,\n /** Mongo client failed to establish a connection. */\n PluginMongoConnectionFailed = 2103,\n /** Mongo client failed to disconnect cleanly during shutdown. */\n PluginMongoDisconnectFailed = 2104,\n /** Mongo `services` was accessed before the plugin finished initializing. */\n PluginMongoServicesNotReady = 2105,\n\n /** KPG service class is missing the `@RegisterKpgService` decorator. */\n PluginKpgServiceDecoratorMissing = 2201,\n /** KPG service class is missing its table metadata. */\n PluginKpgServiceTableMissing = 2202,\n /** Migration manager received an invalid step count. */\n PluginKpgInvalidStepCount = 2203,\n /** Migration direction was not recognized. */\n PluginKpgUnknownDirection = 2204,\n /** Provided migrations path could not be resolved. */\n PluginKpgUnresolvedMigrationsPath = 2205,\n /** No migration files were found for execution. */\n PluginKpgNoMigrationFiles = 2206,\n /** A migration module failed to export the expected functions. */\n PluginKpgInvalidMigrationModule = 2207,\n /** An arbitrary (non-Error) failure was reported by a migration. */\n PluginKpgNonErrorFailure = 2208,\n /** Postgres pool failed to close cleanly during shutdown. */\n PluginKpgDisconnectFailed = 2209,\n /** KPG `services` was accessed before the plugin finished initializing. */\n PluginKpgServicesNotReady = 2210,\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 /** Config root was provided but not a string. */\n CliConfigInvalidRoot = 3103,\n /** Unable to locate a Seedcord config file. */\n CliConfigNotFound = 3104,\n /** CLI entry file does not exist. */\n CliEntryNotFound = 3105,\n /** tsx failed to import the provided entry file. */\n CliTsxImportFailed = 3106,\n /** Native import and jiti fallback both failed. */\n CliImportFailed = 3107,\n /** Seedcord instance export is missing a start() method. */\n CliInstanceInvalid = 3108,\n /** Seedcord instance threw during startup. */\n CliStartFailed = 3109,\n /** Config is missing the required entry string. */\n CliConfigMissingEntry = 3110,\n /** Config build options must be an object when provided. */\n CliConfigInvalidBuild = 3111,\n /** Config build outDir must be a string when provided. */\n CliConfigInvalidBuildOutDir = 3112,\n /** Config build tsconfig must be a string when provided. */\n CliConfigInvalidBuildTsconfig = 3113,\n /** Config build bootstrap must be a string when provided. */\n CliConfigInvalidBuildBootstrap = 3114,\n /** Entry file must be inside the configured root directory. */\n CliConfigEntryOutsideRoot = 3115,\n /** Unable to locate a TypeScript config file for builds. */\n CliBuildTsconfigNotFound = 3116,\n /** TypeScript reported diagnostics during emit. */\n CliBuildFailed = 3117,\n /** Unable to write the generated bootstrap file. */\n CliBootstrapWriteFailed = 3118,\n /** Config tsconfig must be a string when provided. */\n CliConfigInvalidTsconfig = 3119,\n /** Config hmr options must be an object when provided. */\n CliConfigInvalidHmr = 3120,\n /** Config hmr restart patterns must be an array of strings when provided. */\n CliConfigInvalidHmrRestart = 3121,\n /** Two commands resolve to the same slash route during codegen. */\n CliCodegenDuplicateRoute = 3122,\n /** The commands directory could not be read during codegen. */\n CliCodegenCommandsDirUnreadable = 3123,\n /** Two context-menu commands of the same kind share a name during codegen. */\n CliCodegenDuplicateContextMenu = 3124,\n /** Could not resolve the application from the bot token during `commands --clean`. */\n CliCleanAppFetchFailed = 3126,\n /** `commands --clean` ran with neither --guild nor --all-guilds, so there is nothing to scan. */\n CliCleanNoGuilds = 3127,\n /** `commands --clean` combined --purge with --all-guilds, which would wipe every guild. */\n CliCleanPurgeAllGuilds = 3128,\n /** An interactive prompt was cancelled (Ctrl-C), so the command aborts without changes. */\n CliCancelled = 3129,\n /** `commands --clean --all-guilds` matched more guilds than the safety threshold without `--yes`. */\n CliCleanLargeBotUnconfirmed = 3130,\n /** `commands --clean --apply` ran in a non-interactive environment without `--yes`, where it cannot prompt. */\n CliCleanApplyNeedsYes = 3131,\n /** Config hmr rollback flag must be a boolean when provided. */\n CliConfigInvalidHmrRollback = 3132\n}\n","import chalk from 'chalk';\n\nimport { SeedcordErrorCode } from './ErrorCodes';\n\n/** @internal */\nconst messages = {\n [SeedcordErrorCode.ConfigMissingDiscordToken]: () => 'Missing DISCORD_BOT_TOKEN environment variable.',\n [SeedcordErrorCode.ConfigIncorrectDiscordToken]: () => 'Invalid DISCORD_BOT_TOKEN value.',\n [SeedcordErrorCode.ConfigMissingPublicKey]: () => 'Missing DISCORD_PUBLIC_KEY environment variable.',\n [SeedcordErrorCode.ConfigIncorrectPublicKey]: () => 'Invalid DISCORD_PUBLIC_KEY value. Expected 64 hex characters.',\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\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\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\n [SeedcordErrorCode.DecoratorInteractionEventFilter]: () => 'Interaction middleware cannot specify event filters.',\n [SeedcordErrorCode.DecoratorMethodNotFound]: () =>\n 'Decorator could not locate the original method. Ensure the method exists before applying the decorator.',\n [SeedcordErrorCode.DecoratorCommandAlreadyRegistered]: (\n commandName: string,\n existingScope: string,\n requestedScope: string\n ) =>\n `Command \"${commandName}\" is already registered as a \"${existingScope}\" command and cannot be re-registered as a \"${requestedScope}\" command.`,\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.InteractionDuplicateRoute]: (route: string, firstClass: string, secondClass: string) =>\n `Two interaction handlers resolve to the same route \\`${route}\\`. Registered by ${firstClass} and ${secondClass}. Rename one.`,\n [SeedcordErrorCode.InteractionDuplicateMiddleware]: (name: string) =>\n `Two different interaction middleware classes share the name \\`${name}\\`. Rename one so they do not collide.`,\n\n [SeedcordErrorCode.ReplyIllegalAckState]: (method: string, reason: string, alternative: string, routeId: string) =>\n `${chalk.cyan(`${method}()`)} was called when ${reason}.\\n${alternative} (route ${chalk.cyan(routeId)})`,\n [SeedcordErrorCode.ReplyComponentSerialization]: (\n componentClass: string,\n index: number,\n detail: string,\n routeId: string\n ) =>\n `${chalk.cyan(componentClass)} at components[${index}] failed to serialize: ${detail.replace(/\\.$/, '')}. (route ${chalk.cyan(routeId)})`,\n [SeedcordErrorCode.ReplyForeignEditTarget]: (method: string, targetId: string, routeId: string) =>\n `${chalk.cyan(`${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 ${chalk.cyan(routeId)})`,\n [SeedcordErrorCode.ReplyUpdateWithoutSource]: (method: string, routeId: string) =>\n `${chalk.cyan(`${method}()`)} was called on a modal opened from a command, which has no source message.\\nUse reply() or defer() instead. (route ${chalk.cyan(routeId)})`,\n [SeedcordErrorCode.ReplyCallbackMissingMessage]: (method: string, routeId: string) =>\n `The interaction callback for ${chalk.cyan(`${method}()`)} returned no message. (route ${chalk.cyan(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) =>\n `customId field ${JSON.stringify(field)} uses oneOf() with no choices.`,\n [SeedcordErrorCode.CustomIdInvalidBounds]: (field: string, min: number, max: number) =>\n `customId field ${JSON.stringify(field)} has min ${min} greater than max ${max}.`,\n [SeedcordErrorCode.CustomIdValueOutOfRange]: (field: string, value: string) =>\n `customId field ${JSON.stringify(field)} got value ${value} outside its allowed range.`,\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 (@ButtonRoute, @ModalRoute, or @SelectMenuRoute).`,\n [SeedcordErrorCode.CustomIdMatchArmMissing]: (prefix: string) =>\n `match() has no arm for the decoded route ${JSON.stringify(prefix)}.`,\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.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\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.PluginMongoServiceDecoratorMissing]: (className: string) =>\n `Missing @RegisterMongoService on ${className}.`,\n [SeedcordErrorCode.PluginMongoModelDecoratorMissing]: (className: string) =>\n `Missing @RegisterMongoModel on ${className}.`,\n [SeedcordErrorCode.PluginMongoConnectionFailed]: (databaseName?: string) =>\n databaseName ? `Could not connect to MongoDB (${databaseName}).` : 'Could not connect to MongoDB.',\n [SeedcordErrorCode.PluginMongoDisconnectFailed]: () => 'Failed to disconnect from MongoDB cleanly during shutdown.',\n [SeedcordErrorCode.PluginMongoServicesNotReady]: () =>\n 'Mongo services accessed before the plugin finished initializing.',\n\n [SeedcordErrorCode.PluginKpgServiceDecoratorMissing]: (className: string) =>\n `Missing @RegisterKpgService on ${className}.`,\n [SeedcordErrorCode.PluginKpgServiceTableMissing]: (className: string) =>\n `Missing table metadata for ${className}. Provide a table via @RegisterKpgService().`,\n [SeedcordErrorCode.PluginKpgInvalidStepCount]: () => 'Migration step count must be a non-negative integer.',\n [SeedcordErrorCode.PluginKpgUnknownDirection]: (direction: unknown) =>\n `Unknown migration direction: ${String(direction)}.`,\n [SeedcordErrorCode.PluginKpgUnresolvedMigrationsPath]: (label: string) =>\n `Unable to resolve migrations at path: ${label}.`,\n [SeedcordErrorCode.PluginKpgNoMigrationFiles]: () => 'No migration files provided.',\n [SeedcordErrorCode.PluginKpgInvalidMigrationModule]: (filePath: string) =>\n `Migration file ${filePath} must export async functions up and down.`,\n [SeedcordErrorCode.PluginKpgNonErrorFailure]: (message: string) => `Migration failure: ${message}.`,\n [SeedcordErrorCode.PluginKpgDisconnectFailed]: () => 'Failed to close the Postgres pool cleanly during shutdown.',\n [SeedcordErrorCode.PluginKpgServicesNotReady]: () =>\n 'KPG services accessed before the plugin finished initializing.',\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.CliConfigInvalidRoot]: () => 'Config `root` must be a string when provided.',\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.CliConfigInvalidBuild]: () => 'Config `build` must be an object when provided.',\n [SeedcordErrorCode.CliConfigInvalidBuildOutDir]: () => 'Config `build.outDir` must be a string when provided.',\n [SeedcordErrorCode.CliConfigInvalidBuildTsconfig]: () => 'Config `build.tsconfig` must be a string when provided.',\n [SeedcordErrorCode.CliConfigInvalidBuildBootstrap]: () =>\n 'Config `build.bootstrap` must be a string when provided.',\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.CliTsxImportFailed]: (entryPath: string, reason: string) =>\n `Failed to import ${entryPath} via tsx: ${reason}.`,\n [SeedcordErrorCode.CliImportFailed]: (entryPath: string, nativeReason: string, fallbackReason: string) =>\n `Failed to import ${entryPath}: ${nativeReason}. Fallback via jiti 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.CliConfigInvalidTsconfig]: () => 'Config `tsconfig` must be a string when provided.',\n [SeedcordErrorCode.CliConfigInvalidHmr]: () => 'Config `hmr` must be an object when provided.',\n [SeedcordErrorCode.CliConfigInvalidHmrRestart]: () =>\n 'Config `hmr.restart` must be an array of strings when provided.',\n [SeedcordErrorCode.CliConfigInvalidHmrRollback]: () => 'Config `hmr.rollback` must be a boolean when provided.',\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.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} 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","/* eslint-disable @typescript-eslint/no-unnecessary-condition */\nimport chalk from 'chalk';\n\nimport { SeedcordErrorCode } from './ErrorCodes';\nimport { formatSeedcordErrorMessage, type SeedcordErrorArguments } from './ErrorMessages';\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 `${chalk.bold.red(name)}[${chalk.gray(code)}]`;\n}\n\n/**\n * String literal type for Seedcord error class names.\n *\n * @internal\n */\nexport type SeedcordErrorTypeString = `Seedcord${'Error' | 'TypeError' | 'RangeError'}`;\n\ninterface BaseSeedcordError {\n readonly code: SeedcordErrorCode;\n readonly identifier: SeedcordErrorIdentifier;\n readonly type: SeedcordErrorTypeString;\n}\n\n/**\n * Base class for Seedcord errors.\n */\nexport class SeedcordError<Code extends SeedcordErrorCode = SeedcordErrorCode>\n extends Error\n implements BaseSeedcordError\n{\n public readonly code: Code;\n public readonly identifier: 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.identifier = resolveIdentifier(code);\n this.name = formatErrorName(new.target.name, this.identifier, 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\n/**\n * TypeError class for Seedcord errors.\n */\nexport class SeedcordTypeError<Code extends SeedcordErrorCode = SeedcordErrorCode>\n extends TypeError\n implements BaseSeedcordError\n{\n public readonly code: Code;\n public readonly identifier: 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.identifier = resolveIdentifier(code);\n this.name = formatErrorName(new.target.name, this.identifier, 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\n/**\n * RangeError class for Seedcord errors.\n */\nexport class SeedcordRangeError<Code extends SeedcordErrorCode = SeedcordErrorCode>\n extends RangeError\n implements BaseSeedcordError\n{\n public readonly code: Code;\n public readonly identifier: 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.identifier = resolveIdentifier(code);\n this.name = formatErrorName(new.target.name, this.identifier, 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\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 : SeedcordRangeError<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 (Error, TypeError, or RangeError).\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 const isSeedcordErrorInstance = error instanceof SeedcordError && error.type === 'SeedcordError';\n const isSeedcordTypeErrorInstance = error instanceof SeedcordTypeError && error.type === 'SeedcordTypeError';\n const isSeedcordRangeErrorInstance = error instanceof SeedcordRangeError && error.type === 'SeedcordRangeError';\n\n if (!isSeedcordErrorInstance && !isSeedcordTypeErrorInstance && !isSeedcordRangeErrorInstance) {\n return false;\n }\n\n const matchesType = type\n ? (type === 'SeedcordError' && isSeedcordErrorInstance) ||\n (type === 'SeedcordTypeError' && isSeedcordTypeErrorInstance) ||\n (type === 'SeedcordRangeError' && isSeedcordRangeErrorInstance)\n : true;\n\n if (!matchesType) return false;\n if (code === undefined) return true;\n return error.code === code;\n}\n"],"mappings":";;;;;;AAKA,IAAY,oBAAL;;CAEH;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAGA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAGA;;CAEA;;CAEA;;CAEA;;CAEA;;CAGA;;CAEA;;CAEA;;CAEA;;CAE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MissingDiscordToken = 1001,
8
8
  /** DISCORD_BOT_TOKEN is present but fails validation. */
9
9
  ConfigIncorrectDiscordToken = 1004,
10
- /** UNKNOWN_EXCEPTION_WEBHOOK_URL is missing when configuring the reporter. */
11
- ConfigUnknownExceptionWebhookMissing = 1002,
12
- /** UNKNOWN_EXCEPTION_WEBHOOK_URL is present but fails URL validation. */
13
- ConfigUnknownExceptionWebhookInvalid = 1003,
14
- /** HANDLED_EXCEPTION_WEBHOOK_URL is missing when configuring the reporter. */
15
- ConfigHandledExceptionWebhookMissing = 1005,
16
- /** HANDLED_EXCEPTION_WEBHOOK_URL is present but fails URL validation. */
17
- ConfigHandledExceptionWebhookInvalid = 1006,
18
10
  /** One or more configured emojis could not be resolved at startup. */
19
- ConfigEmojiUnresolved = 1007,
11
+ ConfigEmojiUnresolved = 1005,
12
+ /** A webhook reporter's env var is set but fails webhook URL validation. */
13
+ ConfigWebhookUrlInvalid = 1006,
14
+ /** A configured webhook does not exist on Discord (deleted, or a wrong id or token). */
15
+ ConfigWebhookNotFound = 1007,
16
+ /** DISCORD_PUBLIC_KEY is not present in the environment. */
17
+ ConfigMissingPublicKey = 1008,
18
+ /** DISCORD_PUBLIC_KEY is present but fails validation. */
19
+ ConfigIncorrectPublicKey = 1009,
20
20
  /** Attempted to add lifecycle tasks after startup already completed. */
21
21
  LifecycleAddAfterCompletion = 1101,
22
22
  /** Attempted to add lifecycle tasks while startup is still running. */
@@ -51,10 +51,22 @@ declare enum SeedcordErrorCode {
51
51
  DecoratorCommandGuildWithoutGuilds = 1305,
52
52
  /** Middleware priority provided by the decorator was not a finite number. */
53
53
  DecoratorInvalidMiddlewarePriority = 1306,
54
+ /** A WebhookLog subclass is missing its `@WebhookUrl` decorator. */
55
+ DecoratorWebhookUrlMissing = 1307,
54
56
  /** Two interaction handlers registered the same route within a scope. */
55
57
  InteractionDuplicateRoute = 1401,
56
58
  /** Two different interaction middleware classes share a class name. */
57
59
  InteractionDuplicateMiddleware = 1402,
60
+ /** A reply method was called in an ack state where it is illegal. */
61
+ ReplyIllegalAckState = 1501,
62
+ /** A reply component failed to serialize to raw API data. */
63
+ ReplyComponentSerialization = 1502,
64
+ /** edit() was passed a message the interaction did not send. */
65
+ ReplyForeignEditTarget = 1503,
66
+ /** update() or deferUpdate() was called on a modal with no source message. */
67
+ ReplyUpdateWithoutSource = 1504,
68
+ /** A withResponse interaction callback returned no created message. */
69
+ ReplyCallbackMissingMessage = 1505,
58
70
  /** A customId definition prefix contains a reserved character (a colon or a control char). */
59
71
  CustomIdInvalidPrefix = 1601,
60
72
  /** A customId field name is integer-like, which JS would silently reorder. */
@@ -81,6 +93,8 @@ declare enum SeedcordErrorCode {
81
93
  EventMatchArmMissing = 1612,
82
94
  /** Event middleware read `this.eventName` but was constructed without a fired event name. */
83
95
  EventMiddlewareNameUnavailable = 1613,
96
+ /** An autocomplete payload carried no focused option. */
97
+ AutocompleteNoFocusedOption = 1614,
84
98
  /** A Cooldown gate was given a duration string that is not a well-formed positive duration. */
85
99
  GateInvalidCooldownDuration = 1701,
86
100
  /** A paginator source was given a perPage that is not a positive integer. */
@@ -194,11 +208,11 @@ declare enum SeedcordErrorCode {
194
208
  declare const messages: {
195
209
  1001: () => string;
196
210
  1004: () => string;
197
- 1002: () => string;
198
- 1003: () => string;
199
- 1005: () => string;
200
- 1006: () => string;
201
- 1007: (count: number, failures: string) => string;
211
+ 1008: () => string;
212
+ 1009: () => string;
213
+ 1006: (envKey: string) => string;
214
+ 1007: (envKey: string) => string;
215
+ 1005: (count: number, failures: string) => string;
202
216
  1101: () => string;
203
217
  1102: () => string;
204
218
  1103: () => string;
@@ -216,8 +230,14 @@ declare const messages: {
216
230
  1304: () => string;
217
231
  1305: () => string;
218
232
  1306: () => string;
233
+ 1307: (className: string) => string;
219
234
  1401: (route: string, firstClass: string, secondClass: string) => string;
220
235
  1402: (name: string) => string;
236
+ 1501: (method: string, reason: string, alternative: string, routeId: string) => string;
237
+ 1502: (componentClass: string, index: number, detail: string, routeId: string) => string;
238
+ 1503: (method: string, targetId: string, routeId: string) => string;
239
+ 1504: (method: string, routeId: string) => string;
240
+ 1505: (method: string, routeId: string) => string;
221
241
  1601: (prefix: string) => string;
222
242
  1602: (field: string) => string;
223
243
  1603: (field: string) => string;
@@ -231,6 +251,7 @@ declare const messages: {
231
251
  1611: (field: string) => string;
232
252
  1612: (event: string) => string;
233
253
  1613: () => string;
254
+ 1614: () => string;
234
255
  1701: (input: string) => string;
235
256
  1801: (perPage: number) => string;
236
257
  1802: (count: number) => string;
@@ -376,4 +397,4 @@ type ErrorCodeFilter<Type extends SeedcordErrorTypeString | undefined, Code exte
376
397
  declare function isSeedcordError<Type extends SeedcordErrorTypeString | undefined, Code extends SeedcordErrorCode | undefined>(error: unknown, type?: Type, code?: Code): error is ErrorCodeFilter<Type, Code>;
377
398
  //#endregion
378
399
  export { isSeedcordError as a, SeedcordTypeError as i, SeedcordErrorTypeString as n, SeedcordErrorCode as o, SeedcordRangeError as r, SeedcordError as t };
379
- //# sourceMappingURL=SeedcordError-DusvByCw.d.mts.map
400
+ //# sourceMappingURL=SeedcordError-DJOVXxn_.d.mts.map
@@ -37,16 +37,16 @@ let SeedcordErrorCode = /* @__PURE__ */ function(SeedcordErrorCode) {
37
37
  SeedcordErrorCode[SeedcordErrorCode["ConfigMissingDiscordToken"] = 1001] = "ConfigMissingDiscordToken";
38
38
  /** DISCORD_BOT_TOKEN is present but fails validation. */
39
39
  SeedcordErrorCode[SeedcordErrorCode["ConfigIncorrectDiscordToken"] = 1004] = "ConfigIncorrectDiscordToken";
40
- /** UNKNOWN_EXCEPTION_WEBHOOK_URL is missing when configuring the reporter. */
41
- SeedcordErrorCode[SeedcordErrorCode["ConfigUnknownExceptionWebhookMissing"] = 1002] = "ConfigUnknownExceptionWebhookMissing";
42
- /** UNKNOWN_EXCEPTION_WEBHOOK_URL is present but fails URL validation. */
43
- SeedcordErrorCode[SeedcordErrorCode["ConfigUnknownExceptionWebhookInvalid"] = 1003] = "ConfigUnknownExceptionWebhookInvalid";
44
- /** HANDLED_EXCEPTION_WEBHOOK_URL is missing when configuring the reporter. */
45
- SeedcordErrorCode[SeedcordErrorCode["ConfigHandledExceptionWebhookMissing"] = 1005] = "ConfigHandledExceptionWebhookMissing";
46
- /** HANDLED_EXCEPTION_WEBHOOK_URL is present but fails URL validation. */
47
- SeedcordErrorCode[SeedcordErrorCode["ConfigHandledExceptionWebhookInvalid"] = 1006] = "ConfigHandledExceptionWebhookInvalid";
48
40
  /** One or more configured emojis could not be resolved at startup. */
49
- SeedcordErrorCode[SeedcordErrorCode["ConfigEmojiUnresolved"] = 1007] = "ConfigEmojiUnresolved";
41
+ SeedcordErrorCode[SeedcordErrorCode["ConfigEmojiUnresolved"] = 1005] = "ConfigEmojiUnresolved";
42
+ /** A webhook reporter's env var is set but fails webhook URL validation. */
43
+ SeedcordErrorCode[SeedcordErrorCode["ConfigWebhookUrlInvalid"] = 1006] = "ConfigWebhookUrlInvalid";
44
+ /** A configured webhook does not exist on Discord (deleted, or a wrong id or token). */
45
+ SeedcordErrorCode[SeedcordErrorCode["ConfigWebhookNotFound"] = 1007] = "ConfigWebhookNotFound";
46
+ /** DISCORD_PUBLIC_KEY is not present in the environment. */
47
+ SeedcordErrorCode[SeedcordErrorCode["ConfigMissingPublicKey"] = 1008] = "ConfigMissingPublicKey";
48
+ /** DISCORD_PUBLIC_KEY is present but fails validation. */
49
+ SeedcordErrorCode[SeedcordErrorCode["ConfigIncorrectPublicKey"] = 1009] = "ConfigIncorrectPublicKey";
50
50
  /** Attempted to add lifecycle tasks after startup already completed. */
51
51
  SeedcordErrorCode[SeedcordErrorCode["LifecycleAddAfterCompletion"] = 1101] = "LifecycleAddAfterCompletion";
52
52
  /** Attempted to add lifecycle tasks while startup is still running. */
@@ -81,10 +81,22 @@ let SeedcordErrorCode = /* @__PURE__ */ function(SeedcordErrorCode) {
81
81
  SeedcordErrorCode[SeedcordErrorCode["DecoratorCommandGuildWithoutGuilds"] = 1305] = "DecoratorCommandGuildWithoutGuilds";
82
82
  /** Middleware priority provided by the decorator was not a finite number. */
83
83
  SeedcordErrorCode[SeedcordErrorCode["DecoratorInvalidMiddlewarePriority"] = 1306] = "DecoratorInvalidMiddlewarePriority";
84
+ /** A WebhookLog subclass is missing its `@WebhookUrl` decorator. */
85
+ SeedcordErrorCode[SeedcordErrorCode["DecoratorWebhookUrlMissing"] = 1307] = "DecoratorWebhookUrlMissing";
84
86
  /** Two interaction handlers registered the same route within a scope. */
85
87
  SeedcordErrorCode[SeedcordErrorCode["InteractionDuplicateRoute"] = 1401] = "InteractionDuplicateRoute";
86
88
  /** Two different interaction middleware classes share a class name. */
87
89
  SeedcordErrorCode[SeedcordErrorCode["InteractionDuplicateMiddleware"] = 1402] = "InteractionDuplicateMiddleware";
90
+ /** A reply method was called in an ack state where it is illegal. */
91
+ SeedcordErrorCode[SeedcordErrorCode["ReplyIllegalAckState"] = 1501] = "ReplyIllegalAckState";
92
+ /** A reply component failed to serialize to raw API data. */
93
+ SeedcordErrorCode[SeedcordErrorCode["ReplyComponentSerialization"] = 1502] = "ReplyComponentSerialization";
94
+ /** edit() was passed a message the interaction did not send. */
95
+ SeedcordErrorCode[SeedcordErrorCode["ReplyForeignEditTarget"] = 1503] = "ReplyForeignEditTarget";
96
+ /** update() or deferUpdate() was called on a modal with no source message. */
97
+ SeedcordErrorCode[SeedcordErrorCode["ReplyUpdateWithoutSource"] = 1504] = "ReplyUpdateWithoutSource";
98
+ /** A withResponse interaction callback returned no created message. */
99
+ SeedcordErrorCode[SeedcordErrorCode["ReplyCallbackMissingMessage"] = 1505] = "ReplyCallbackMissingMessage";
88
100
  /** A customId definition prefix contains a reserved character (a colon or a control char). */
89
101
  SeedcordErrorCode[SeedcordErrorCode["CustomIdInvalidPrefix"] = 1601] = "CustomIdInvalidPrefix";
90
102
  /** A customId field name is integer-like, which JS would silently reorder. */
@@ -111,6 +123,8 @@ let SeedcordErrorCode = /* @__PURE__ */ function(SeedcordErrorCode) {
111
123
  SeedcordErrorCode[SeedcordErrorCode["EventMatchArmMissing"] = 1612] = "EventMatchArmMissing";
112
124
  /** Event middleware read `this.eventName` but was constructed without a fired event name. */
113
125
  SeedcordErrorCode[SeedcordErrorCode["EventMiddlewareNameUnavailable"] = 1613] = "EventMiddlewareNameUnavailable";
126
+ /** An autocomplete payload carried no focused option. */
127
+ SeedcordErrorCode[SeedcordErrorCode["AutocompleteNoFocusedOption"] = 1614] = "AutocompleteNoFocusedOption";
114
128
  /** A Cooldown gate was given a duration string that is not a well-formed positive duration. */
115
129
  SeedcordErrorCode[SeedcordErrorCode["GateInvalidCooldownDuration"] = 1701] = "GateInvalidCooldownDuration";
116
130
  /** A paginator source was given a perPage that is not a positive integer. */
@@ -226,11 +240,11 @@ let SeedcordErrorCode = /* @__PURE__ */ function(SeedcordErrorCode) {
226
240
  const messages = {
227
241
  [1001]: () => "Missing DISCORD_BOT_TOKEN environment variable.",
228
242
  [1004]: () => "Invalid DISCORD_BOT_TOKEN value.",
229
- [1002]: () => "Missing UNKNOWN_EXCEPTION_WEBHOOK_URL environment variable.",
230
- [1003]: () => "Invalid UNKNOWN_EXCEPTION_WEBHOOK_URL value.",
231
- [1005]: () => "Missing HANDLED_EXCEPTION_WEBHOOK_URL environment variable.",
232
- [1006]: () => "Invalid HANDLED_EXCEPTION_WEBHOOK_URL value.",
233
- [1007]: (count, failures) => `Could not resolve ${count} configured emoji${count === 1 ? "" : "s"} at startup.\n${failures}`,
243
+ [1008]: () => "Missing DISCORD_PUBLIC_KEY environment variable.",
244
+ [1009]: () => "Invalid DISCORD_PUBLIC_KEY value. Expected 64 hex characters.",
245
+ [1006]: (envKey) => `${envKey} is not a well-formed Discord webhook url.`,
246
+ [1007]: (envKey) => `The webhook behind ${envKey} does not exist on Discord.`,
247
+ [1005]: (count, failures) => `Could not resolve ${count} configured emoji${count === 1 ? "" : "s"} at startup.\n${failures}`,
234
248
  [1101]: () => "Cannot add tasks after startup sequence has already completed.",
235
249
  [1102]: () => "Cannot add tasks while startup sequence is in progress.",
236
250
  [1103]: () => "Cannot remove tasks while startup sequence is in progress.",
@@ -248,8 +262,14 @@ const messages = {
248
262
  [1304]: () => "RegisterCommand(\"global\") cannot have guilds specified.",
249
263
  [1305]: () => "RegisterCommand(\"guild\") requires a non-empty guilds array.",
250
264
  [1306]: () => "Middleware priority must be a finite number.",
265
+ [1307]: (className) => `${className} extends WebhookLog and needs a @WebhookUrl decorator naming its env var.`,
251
266
  [1401]: (route, firstClass, secondClass) => `Two interaction handlers resolve to the same route \`${route}\`. Registered by ${firstClass} and ${secondClass}. Rename one.`,
252
267
  [1402]: (name) => `Two different interaction middleware classes share the name \`${name}\`. Rename one so they do not collide.`,
268
+ [1501]: (method, reason, alternative, routeId) => `${chalk.default.cyan(`${method}()`)} was called when ${reason}.\n${alternative} (route ${chalk.default.cyan(routeId)})`,
269
+ [1502]: (componentClass, index, detail, routeId) => `${chalk.default.cyan(componentClass)} at components[${index}] failed to serialize: ${detail.replace(/\.$/, "")}. (route ${chalk.default.cyan(routeId)})`,
270
+ [1503]: (method, targetId, routeId) => `${chalk.default.cyan(`${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 ${chalk.default.cyan(routeId)})`,
271
+ [1504]: (method, routeId) => `${chalk.default.cyan(`${method}()`)} was called on a modal opened from a command, which has no source message.\nUse reply() or defer() instead. (route ${chalk.default.cyan(routeId)})`,
272
+ [1505]: (method, routeId) => `The interaction callback for ${chalk.default.cyan(`${method}()`)} returned no message. (route ${chalk.default.cyan(routeId)})`,
253
273
  [1601]: (prefix) => `customId prefix ${JSON.stringify(prefix)} must be a non-empty string without a colon or control character.`,
254
274
  [1602]: (field) => `customId field name ${JSON.stringify(field)} is integer-like, which JS reorders. Use a non-numeric name.`,
255
275
  [1603]: (field) => `customId field ${JSON.stringify(field)} uses oneOf() with no choices.`,
@@ -263,6 +283,7 @@ const messages = {
263
283
  [1611]: (field) => `match() has no arm for the focused field ${JSON.stringify(field)}.`,
264
284
  [1612]: (event) => `match() has no arm for the event ${JSON.stringify(event)}.`,
265
285
  [1613]: () => `this.eventName is only available on middleware the controller constructed with a fired event name.`,
286
+ [1614]: () => `Autocomplete payload has no focused option.`,
266
287
  [1701]: (input) => `Cooldown duration ${JSON.stringify(input)} is not valid. Pass a number of seconds or a duration string like '30m', '24h', or '500ms'.`,
267
288
  [1801]: (perPage) => `perPage must be a positive integer, got ${perPage}.`,
268
289
  [1802]: (count) => `A control row holds at most 5 buttons, got ${count}.`,
@@ -449,4 +470,4 @@ Object.defineProperty(exports, 'isSeedcordError', {
449
470
  return isSeedcordError;
450
471
  }
451
472
  });
452
- //# sourceMappingURL=SeedcordError-B7YI3bbX.cjs.map
473
+ //# sourceMappingURL=SeedcordError-DRCE9RFI.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SeedcordError-DRCE9RFI.cjs","names":[],"sources":["../src/ErrorCodes.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 /** DISCORD_BOT_TOKEN is not present in the environment. */\n ConfigMissingDiscordToken = 1001,\n /** DISCORD_BOT_TOKEN is present but fails validation. */\n ConfigIncorrectDiscordToken = 1004,\n /** One or more configured emojis could not be resolved at startup. */\n ConfigEmojiUnresolved = 1005,\n /** A webhook reporter's env var is set but fails webhook URL validation. */\n ConfigWebhookUrlInvalid = 1006,\n /** A configured webhook does not exist on Discord (deleted, or a wrong id or token). */\n ConfigWebhookNotFound = 1007,\n /** DISCORD_PUBLIC_KEY is not present in the environment. */\n ConfigMissingPublicKey = 1008,\n /** DISCORD_PUBLIC_KEY is present but fails validation. */\n ConfigIncorrectPublicKey = 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\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\n /** Interaction middleware decorated with disallowed event filters. */\n DecoratorInteractionEventFilter = 1301,\n /** A decorator could not find the original method being decorated. */\n DecoratorMethodNotFound = 1302,\n /** A command decorator attempted to re-register an existing command scope. */\n DecoratorCommandAlreadyRegistered = 1303,\n /** A global command decorator specified guild IDs, which is not allowed. */\n DecoratorCommandGlobalWithGuilds = 1304,\n /** A guild command decorator omitted the required guild ID list. */\n DecoratorCommandGuildWithoutGuilds = 1305,\n /** Middleware priority provided by the decorator was not a finite number. */\n DecoratorInvalidMiddlewarePriority = 1306,\n /** A WebhookLog subclass is missing its `@WebhookUrl` decorator. */\n DecoratorWebhookUrlMissing = 1307,\n\n /** Two interaction handlers registered the same route within a scope. */\n InteractionDuplicateRoute = 1401,\n /** Two different interaction middleware classes share a class name. */\n InteractionDuplicateMiddleware = 1402,\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() 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 value passed to encode() is outside its field's allowed range. */\n CustomIdValueOutOfRange = 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 its route decorator (\\@ButtonRoute / \\@ModalRoute / \\@SelectMenuRoute). */\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\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 /** Mongo service class is missing the `@RegisterMongoService` decorator. */\n PluginMongoServiceDecoratorMissing = 2101,\n /** Mongo model class is missing the `@RegisterMongoModel` decorator. */\n PluginMongoModelDecoratorMissing = 2102,\n /** Mongo client failed to establish a connection. */\n PluginMongoConnectionFailed = 2103,\n /** Mongo client failed to disconnect cleanly during shutdown. */\n PluginMongoDisconnectFailed = 2104,\n /** Mongo `services` was accessed before the plugin finished initializing. */\n PluginMongoServicesNotReady = 2105,\n\n /** KPG service class is missing the `@RegisterKpgService` decorator. */\n PluginKpgServiceDecoratorMissing = 2201,\n /** KPG service class is missing its table metadata. */\n PluginKpgServiceTableMissing = 2202,\n /** Migration manager received an invalid step count. */\n PluginKpgInvalidStepCount = 2203,\n /** Migration direction was not recognized. */\n PluginKpgUnknownDirection = 2204,\n /** Provided migrations path could not be resolved. */\n PluginKpgUnresolvedMigrationsPath = 2205,\n /** No migration files were found for execution. */\n PluginKpgNoMigrationFiles = 2206,\n /** A migration module failed to export the expected functions. */\n PluginKpgInvalidMigrationModule = 2207,\n /** An arbitrary (non-Error) failure was reported by a migration. */\n PluginKpgNonErrorFailure = 2208,\n /** Postgres pool failed to close cleanly during shutdown. */\n PluginKpgDisconnectFailed = 2209,\n /** KPG `services` was accessed before the plugin finished initializing. */\n PluginKpgServicesNotReady = 2210,\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 /** Config root was provided but not a string. */\n CliConfigInvalidRoot = 3103,\n /** Unable to locate a Seedcord config file. */\n CliConfigNotFound = 3104,\n /** CLI entry file does not exist. */\n CliEntryNotFound = 3105,\n /** tsx failed to import the provided entry file. */\n CliTsxImportFailed = 3106,\n /** Native import and jiti fallback both failed. */\n CliImportFailed = 3107,\n /** Seedcord instance export is missing a start() method. */\n CliInstanceInvalid = 3108,\n /** Seedcord instance threw during startup. */\n CliStartFailed = 3109,\n /** Config is missing the required entry string. */\n CliConfigMissingEntry = 3110,\n /** Config build options must be an object when provided. */\n CliConfigInvalidBuild = 3111,\n /** Config build outDir must be a string when provided. */\n CliConfigInvalidBuildOutDir = 3112,\n /** Config build tsconfig must be a string when provided. */\n CliConfigInvalidBuildTsconfig = 3113,\n /** Config build bootstrap must be a string when provided. */\n CliConfigInvalidBuildBootstrap = 3114,\n /** Entry file must be inside the configured root directory. */\n CliConfigEntryOutsideRoot = 3115,\n /** Unable to locate a TypeScript config file for builds. */\n CliBuildTsconfigNotFound = 3116,\n /** TypeScript reported diagnostics during emit. */\n CliBuildFailed = 3117,\n /** Unable to write the generated bootstrap file. */\n CliBootstrapWriteFailed = 3118,\n /** Config tsconfig must be a string when provided. */\n CliConfigInvalidTsconfig = 3119,\n /** Config hmr options must be an object when provided. */\n CliConfigInvalidHmr = 3120,\n /** Config hmr restart patterns must be an array of strings when provided. */\n CliConfigInvalidHmrRestart = 3121,\n /** Two commands resolve to the same slash route during codegen. */\n CliCodegenDuplicateRoute = 3122,\n /** The commands directory could not be read during codegen. */\n CliCodegenCommandsDirUnreadable = 3123,\n /** Two context-menu commands of the same kind share a name during codegen. */\n CliCodegenDuplicateContextMenu = 3124,\n /** Could not resolve the application from the bot token during `commands --clean`. */\n CliCleanAppFetchFailed = 3126,\n /** `commands --clean` ran with neither --guild nor --all-guilds, so there is nothing to scan. */\n CliCleanNoGuilds = 3127,\n /** `commands --clean` combined --purge with --all-guilds, which would wipe every guild. */\n CliCleanPurgeAllGuilds = 3128,\n /** An interactive prompt was cancelled (Ctrl-C), so the command aborts without changes. */\n CliCancelled = 3129,\n /** `commands --clean --all-guilds` matched more guilds than the safety threshold without `--yes`. */\n CliCleanLargeBotUnconfirmed = 3130,\n /** `commands --clean --apply` ran in a non-interactive environment without `--yes`, where it cannot prompt. */\n CliCleanApplyNeedsYes = 3131,\n /** Config hmr rollback flag must be a boolean when provided. */\n CliConfigInvalidHmrRollback = 3132\n}\n","import chalk from 'chalk';\n\nimport { SeedcordErrorCode } from './ErrorCodes';\n\n/** @internal */\nconst messages = {\n [SeedcordErrorCode.ConfigMissingDiscordToken]: () => 'Missing DISCORD_BOT_TOKEN environment variable.',\n [SeedcordErrorCode.ConfigIncorrectDiscordToken]: () => 'Invalid DISCORD_BOT_TOKEN value.',\n [SeedcordErrorCode.ConfigMissingPublicKey]: () => 'Missing DISCORD_PUBLIC_KEY environment variable.',\n [SeedcordErrorCode.ConfigIncorrectPublicKey]: () => 'Invalid DISCORD_PUBLIC_KEY value. Expected 64 hex characters.',\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\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\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\n [SeedcordErrorCode.DecoratorInteractionEventFilter]: () => 'Interaction middleware cannot specify event filters.',\n [SeedcordErrorCode.DecoratorMethodNotFound]: () =>\n 'Decorator could not locate the original method. Ensure the method exists before applying the decorator.',\n [SeedcordErrorCode.DecoratorCommandAlreadyRegistered]: (\n commandName: string,\n existingScope: string,\n requestedScope: string\n ) =>\n `Command \"${commandName}\" is already registered as a \"${existingScope}\" command and cannot be re-registered as a \"${requestedScope}\" command.`,\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.InteractionDuplicateRoute]: (route: string, firstClass: string, secondClass: string) =>\n `Two interaction handlers resolve to the same route \\`${route}\\`. Registered by ${firstClass} and ${secondClass}. Rename one.`,\n [SeedcordErrorCode.InteractionDuplicateMiddleware]: (name: string) =>\n `Two different interaction middleware classes share the name \\`${name}\\`. Rename one so they do not collide.`,\n\n [SeedcordErrorCode.ReplyIllegalAckState]: (method: string, reason: string, alternative: string, routeId: string) =>\n `${chalk.cyan(`${method}()`)} was called when ${reason}.\\n${alternative} (route ${chalk.cyan(routeId)})`,\n [SeedcordErrorCode.ReplyComponentSerialization]: (\n componentClass: string,\n index: number,\n detail: string,\n routeId: string\n ) =>\n `${chalk.cyan(componentClass)} at components[${index}] failed to serialize: ${detail.replace(/\\.$/, '')}. (route ${chalk.cyan(routeId)})`,\n [SeedcordErrorCode.ReplyForeignEditTarget]: (method: string, targetId: string, routeId: string) =>\n `${chalk.cyan(`${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 ${chalk.cyan(routeId)})`,\n [SeedcordErrorCode.ReplyUpdateWithoutSource]: (method: string, routeId: string) =>\n `${chalk.cyan(`${method}()`)} was called on a modal opened from a command, which has no source message.\\nUse reply() or defer() instead. (route ${chalk.cyan(routeId)})`,\n [SeedcordErrorCode.ReplyCallbackMissingMessage]: (method: string, routeId: string) =>\n `The interaction callback for ${chalk.cyan(`${method}()`)} returned no message. (route ${chalk.cyan(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) =>\n `customId field ${JSON.stringify(field)} uses oneOf() with no choices.`,\n [SeedcordErrorCode.CustomIdInvalidBounds]: (field: string, min: number, max: number) =>\n `customId field ${JSON.stringify(field)} has min ${min} greater than max ${max}.`,\n [SeedcordErrorCode.CustomIdValueOutOfRange]: (field: string, value: string) =>\n `customId field ${JSON.stringify(field)} got value ${value} outside its allowed range.`,\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 (@ButtonRoute, @ModalRoute, or @SelectMenuRoute).`,\n [SeedcordErrorCode.CustomIdMatchArmMissing]: (prefix: string) =>\n `match() has no arm for the decoded route ${JSON.stringify(prefix)}.`,\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.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\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.PluginMongoServiceDecoratorMissing]: (className: string) =>\n `Missing @RegisterMongoService on ${className}.`,\n [SeedcordErrorCode.PluginMongoModelDecoratorMissing]: (className: string) =>\n `Missing @RegisterMongoModel on ${className}.`,\n [SeedcordErrorCode.PluginMongoConnectionFailed]: (databaseName?: string) =>\n databaseName ? `Could not connect to MongoDB (${databaseName}).` : 'Could not connect to MongoDB.',\n [SeedcordErrorCode.PluginMongoDisconnectFailed]: () => 'Failed to disconnect from MongoDB cleanly during shutdown.',\n [SeedcordErrorCode.PluginMongoServicesNotReady]: () =>\n 'Mongo services accessed before the plugin finished initializing.',\n\n [SeedcordErrorCode.PluginKpgServiceDecoratorMissing]: (className: string) =>\n `Missing @RegisterKpgService on ${className}.`,\n [SeedcordErrorCode.PluginKpgServiceTableMissing]: (className: string) =>\n `Missing table metadata for ${className}. Provide a table via @RegisterKpgService().`,\n [SeedcordErrorCode.PluginKpgInvalidStepCount]: () => 'Migration step count must be a non-negative integer.',\n [SeedcordErrorCode.PluginKpgUnknownDirection]: (direction: unknown) =>\n `Unknown migration direction: ${String(direction)}.`,\n [SeedcordErrorCode.PluginKpgUnresolvedMigrationsPath]: (label: string) =>\n `Unable to resolve migrations at path: ${label}.`,\n [SeedcordErrorCode.PluginKpgNoMigrationFiles]: () => 'No migration files provided.',\n [SeedcordErrorCode.PluginKpgInvalidMigrationModule]: (filePath: string) =>\n `Migration file ${filePath} must export async functions up and down.`,\n [SeedcordErrorCode.PluginKpgNonErrorFailure]: (message: string) => `Migration failure: ${message}.`,\n [SeedcordErrorCode.PluginKpgDisconnectFailed]: () => 'Failed to close the Postgres pool cleanly during shutdown.',\n [SeedcordErrorCode.PluginKpgServicesNotReady]: () =>\n 'KPG services accessed before the plugin finished initializing.',\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.CliConfigInvalidRoot]: () => 'Config `root` must be a string when provided.',\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.CliConfigInvalidBuild]: () => 'Config `build` must be an object when provided.',\n [SeedcordErrorCode.CliConfigInvalidBuildOutDir]: () => 'Config `build.outDir` must be a string when provided.',\n [SeedcordErrorCode.CliConfigInvalidBuildTsconfig]: () => 'Config `build.tsconfig` must be a string when provided.',\n [SeedcordErrorCode.CliConfigInvalidBuildBootstrap]: () =>\n 'Config `build.bootstrap` must be a string when provided.',\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.CliTsxImportFailed]: (entryPath: string, reason: string) =>\n `Failed to import ${entryPath} via tsx: ${reason}.`,\n [SeedcordErrorCode.CliImportFailed]: (entryPath: string, nativeReason: string, fallbackReason: string) =>\n `Failed to import ${entryPath}: ${nativeReason}. Fallback via jiti 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.CliConfigInvalidTsconfig]: () => 'Config `tsconfig` must be a string when provided.',\n [SeedcordErrorCode.CliConfigInvalidHmr]: () => 'Config `hmr` must be an object when provided.',\n [SeedcordErrorCode.CliConfigInvalidHmrRestart]: () =>\n 'Config `hmr.restart` must be an array of strings when provided.',\n [SeedcordErrorCode.CliConfigInvalidHmrRollback]: () => 'Config `hmr.rollback` must be a boolean when provided.',\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.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} 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","/* eslint-disable @typescript-eslint/no-unnecessary-condition */\nimport chalk from 'chalk';\n\nimport { SeedcordErrorCode } from './ErrorCodes';\nimport { formatSeedcordErrorMessage, type SeedcordErrorArguments } from './ErrorMessages';\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 `${chalk.bold.red(name)}[${chalk.gray(code)}]`;\n}\n\n/**\n * String literal type for Seedcord error class names.\n *\n * @internal\n */\nexport type SeedcordErrorTypeString = `Seedcord${'Error' | 'TypeError' | 'RangeError'}`;\n\ninterface BaseSeedcordError {\n readonly code: SeedcordErrorCode;\n readonly identifier: SeedcordErrorIdentifier;\n readonly type: SeedcordErrorTypeString;\n}\n\n/**\n * Base class for Seedcord errors.\n */\nexport class SeedcordError<Code extends SeedcordErrorCode = SeedcordErrorCode>\n extends Error\n implements BaseSeedcordError\n{\n public readonly code: Code;\n public readonly identifier: 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.identifier = resolveIdentifier(code);\n this.name = formatErrorName(new.target.name, this.identifier, 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\n/**\n * TypeError class for Seedcord errors.\n */\nexport class SeedcordTypeError<Code extends SeedcordErrorCode = SeedcordErrorCode>\n extends TypeError\n implements BaseSeedcordError\n{\n public readonly code: Code;\n public readonly identifier: 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.identifier = resolveIdentifier(code);\n this.name = formatErrorName(new.target.name, this.identifier, 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\n/**\n * RangeError class for Seedcord errors.\n */\nexport class SeedcordRangeError<Code extends SeedcordErrorCode = SeedcordErrorCode>\n extends RangeError\n implements BaseSeedcordError\n{\n public readonly code: Code;\n public readonly identifier: 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.identifier = resolveIdentifier(code);\n this.name = formatErrorName(new.target.name, this.identifier, 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\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 : SeedcordRangeError<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 (Error, TypeError, or RangeError).\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 const isSeedcordErrorInstance = error instanceof SeedcordError && error.type === 'SeedcordError';\n const isSeedcordTypeErrorInstance = error instanceof SeedcordTypeError && error.type === 'SeedcordTypeError';\n const isSeedcordRangeErrorInstance = error instanceof SeedcordRangeError && error.type === 'SeedcordRangeError';\n\n if (!isSeedcordErrorInstance && !isSeedcordTypeErrorInstance && !isSeedcordRangeErrorInstance) {\n return false;\n }\n\n const matchesType = type\n ? (type === 'SeedcordError' && isSeedcordErrorInstance) ||\n (type === 'SeedcordTypeError' && isSeedcordTypeErrorInstance) ||\n (type === 'SeedcordRangeError' && isSeedcordRangeErrorInstance)\n : true;\n\n if (!matchesType) return false;\n if (code === undefined) return true;\n return error.code === code;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,IAAY,oBAAL;;CAEH;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAGA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAGA;;CAEA;;CAEA;;CAEA;;CAEA;;CAGA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAGA;;CAEA;;CAGA;;CAEA;;CAEA;;CAEA;;CAEA;;CAGA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAGA;;CAGA;;CAEA;;CAEA;;CAEA;;CAGA;;CAEA;;CAGA;;CAEA;;CAEA;;CAEA;;CAEA;;CAGA;;CAEA;;CAEA;;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;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;AACJ;;;;;ACnNA,MAAM,WAAW;eACwC;eACE;eACL;eACE;UACN,WAC1C,GAAG,OAAO;UAC8B,WACxC,sBA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,MAAM,IAAI,OAAO,SAAS;EAChD,IAAI,OAAO,MAAM,sBAAsB,YACnC,MAAM,kBAAkB,MAAM,IAAI,MAAM;CAEhD;AACJ;;;;;;;;;;AA2DA,SAAgB,gBAGd,OAAgB,MAAa,MAAmD;CAC9E,MAAM,0BAA0B,iBAAiB,iBAAiB,MAAM,SAAS;CACjF,MAAM,8BAA8B,iBAAiB,qBAAqB,MAAM,SAAS;CACzF,MAAM,+BAA+B,iBAAiB,sBAAsB,MAAM,SAAS;CAE3F,IAAI,CAAC,2BAA2B,CAAC,+BAA+B,CAAC,8BAC7D,OAAO;CASX,IAAI,EANgB,OACb,SAAS,mBAAmB,2BAC5B,SAAS,uBAAuB,+BAChC,SAAS,wBAAwB,+BAClC,OAEY,OAAO;CACzB,IAAI,SAAS,QAAW,OAAO;CAC/B,OAAO,MAAM,SAAS;AAC1B"}
package/dist/index.cjs CHANGED
@@ -1,9 +1,9 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_SeedcordError = require('./SeedcordError-B7YI3bbX.cjs');
2
+ const require_SeedcordError = require('./SeedcordError-DRCE9RFI.cjs');
3
3
 
4
4
  //#region src/index.ts
5
5
  /** Package version */
6
- const version = "0.3.0-next.3";
6
+ const version = "0.3.0-next.4";
7
7
 
8
8
  //#endregion
9
9
  exports.SeedcordErrorCode = require_SeedcordError.SeedcordErrorCode;
package/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { a as isSeedcordError, n as SeedcordErrorTypeString, o as SeedcordErrorCode } from "./SeedcordError-DusvByCw.mjs";
1
+ import { a as isSeedcordError, n as SeedcordErrorTypeString, o as SeedcordErrorCode } from "./SeedcordError-DJOVXxn_.mjs";
2
2
 
3
3
  //#region src/index.d.ts
4
4
  /** Package version */
package/dist/index.mjs CHANGED
@@ -1,8 +1,8 @@
1
- import { a as SeedcordErrorCode, i as isSeedcordError } from "./SeedcordError-BSoo1HKt.mjs";
1
+ import { a as SeedcordErrorCode, i as isSeedcordError } from "./SeedcordError-BjNR7jkv.mjs";
2
2
 
3
3
  //#region src/index.ts
4
4
  /** Package version */
5
- const version = "0.3.0-next.3";
5
+ const version = "0.3.0-next.4";
6
6
 
7
7
  //#endregion
8
8
  export { SeedcordErrorCode, isSeedcordError, version };
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_SeedcordError = require('./SeedcordError-B7YI3bbX.cjs');
2
+ const require_SeedcordError = require('./SeedcordError-DRCE9RFI.cjs');
3
3
 
4
4
  //#region src/validateDiscordToken.ts
5
5
  /** @internal */
@@ -1,4 +1,4 @@
1
- import { i as SeedcordTypeError, r as SeedcordRangeError, t as SeedcordError } from "./SeedcordError-DusvByCw.mjs";
1
+ import { i as SeedcordTypeError, r as SeedcordRangeError, t as SeedcordError } from "./SeedcordError-DJOVXxn_.mjs";
2
2
 
3
3
  //#region src/validateDiscordToken.d.ts
4
4
  /** @internal */
@@ -1,4 +1,4 @@
1
- import { a as SeedcordErrorCode, n as SeedcordRangeError, r as SeedcordTypeError, t as SeedcordError } from "./SeedcordError-BSoo1HKt.mjs";
1
+ import { a as SeedcordErrorCode, n as SeedcordRangeError, r as SeedcordTypeError, t as SeedcordError } from "./SeedcordError-BjNR7jkv.mjs";
2
2
 
3
3
  //#region src/validateDiscordToken.ts
4
4
  /** @internal */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@seedcord/errors",
3
3
  "type": "module",
4
- "version": "0.3.0-next.3",
4
+ "version": "0.3.0-next.4",
5
5
  "engines": {
6
6
  "node": ">=24.3"
7
7
  },
@@ -47,7 +47,7 @@
47
47
  "chalk": "^5.6.2"
48
48
  },
49
49
  "devDependencies": {
50
- "@seedcord/eslint-config": "1.5.0-next.3",
50
+ "@seedcord/eslint-config": "1.5.0-next.4",
51
51
  "@seedcord/tsconfig": "2.0.1",
52
52
  "@seedcord/tsdown-config": "2.0.1"
53
53
  },
@@ -1 +0,0 @@
1
- {"version":3,"file":"SeedcordError-B7YI3bbX.cjs","names":[],"sources":["../src/ErrorCodes.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 /** DISCORD_BOT_TOKEN is not present in the environment. */\n ConfigMissingDiscordToken = 1001,\n /** DISCORD_BOT_TOKEN is present but fails validation. */\n ConfigIncorrectDiscordToken = 1004,\n /** UNKNOWN_EXCEPTION_WEBHOOK_URL is missing when configuring the reporter. */\n ConfigUnknownExceptionWebhookMissing = 1002,\n /** UNKNOWN_EXCEPTION_WEBHOOK_URL is present but fails URL validation. */\n ConfigUnknownExceptionWebhookInvalid = 1003,\n /** HANDLED_EXCEPTION_WEBHOOK_URL is missing when configuring the reporter. */\n ConfigHandledExceptionWebhookMissing = 1005,\n /** HANDLED_EXCEPTION_WEBHOOK_URL is present but fails URL validation. */\n ConfigHandledExceptionWebhookInvalid = 1006,\n /** One or more configured emojis could not be resolved at startup. */\n ConfigEmojiUnresolved = 1007,\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\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\n /** Interaction middleware decorated with disallowed event filters. */\n DecoratorInteractionEventFilter = 1301,\n /** A decorator could not find the original method being decorated. */\n DecoratorMethodNotFound = 1302,\n /** A command decorator attempted to re-register an existing command scope. */\n DecoratorCommandAlreadyRegistered = 1303,\n /** A global command decorator specified guild IDs, which is not allowed. */\n DecoratorCommandGlobalWithGuilds = 1304,\n /** A guild command decorator omitted the required guild ID list. */\n DecoratorCommandGuildWithoutGuilds = 1305,\n /** Middleware priority provided by the decorator was not a finite number. */\n DecoratorInvalidMiddlewarePriority = 1306,\n\n /** Two interaction handlers registered the same route within a scope. */\n InteractionDuplicateRoute = 1401,\n /** Two different interaction middleware classes share a class name. */\n InteractionDuplicateMiddleware = 1402,\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() 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 value passed to encode() is outside its field's allowed range. */\n CustomIdValueOutOfRange = 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 its route decorator (\\@ButtonRoute / \\@ModalRoute / \\@SelectMenuRoute). */\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\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 /** Mongo service class is missing the `@RegisterMongoService` decorator. */\n PluginMongoServiceDecoratorMissing = 2101,\n /** Mongo model class is missing the `@RegisterMongoModel` decorator. */\n PluginMongoModelDecoratorMissing = 2102,\n /** Mongo client failed to establish a connection. */\n PluginMongoConnectionFailed = 2103,\n /** Mongo client failed to disconnect cleanly during shutdown. */\n PluginMongoDisconnectFailed = 2104,\n /** Mongo `services` was accessed before the plugin finished initializing. */\n PluginMongoServicesNotReady = 2105,\n\n /** KPG service class is missing the `@RegisterKpgService` decorator. */\n PluginKpgServiceDecoratorMissing = 2201,\n /** KPG service class is missing its table metadata. */\n PluginKpgServiceTableMissing = 2202,\n /** Migration manager received an invalid step count. */\n PluginKpgInvalidStepCount = 2203,\n /** Migration direction was not recognized. */\n PluginKpgUnknownDirection = 2204,\n /** Provided migrations path could not be resolved. */\n PluginKpgUnresolvedMigrationsPath = 2205,\n /** No migration files were found for execution. */\n PluginKpgNoMigrationFiles = 2206,\n /** A migration module failed to export the expected functions. */\n PluginKpgInvalidMigrationModule = 2207,\n /** An arbitrary (non-Error) failure was reported by a migration. */\n PluginKpgNonErrorFailure = 2208,\n /** Postgres pool failed to close cleanly during shutdown. */\n PluginKpgDisconnectFailed = 2209,\n /** KPG `services` was accessed before the plugin finished initializing. */\n PluginKpgServicesNotReady = 2210,\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 /** Config root was provided but not a string. */\n CliConfigInvalidRoot = 3103,\n /** Unable to locate a Seedcord config file. */\n CliConfigNotFound = 3104,\n /** CLI entry file does not exist. */\n CliEntryNotFound = 3105,\n /** tsx failed to import the provided entry file. */\n CliTsxImportFailed = 3106,\n /** Native import and jiti fallback both failed. */\n CliImportFailed = 3107,\n /** Seedcord instance export is missing a start() method. */\n CliInstanceInvalid = 3108,\n /** Seedcord instance threw during startup. */\n CliStartFailed = 3109,\n /** Config is missing the required entry string. */\n CliConfigMissingEntry = 3110,\n /** Config build options must be an object when provided. */\n CliConfigInvalidBuild = 3111,\n /** Config build outDir must be a string when provided. */\n CliConfigInvalidBuildOutDir = 3112,\n /** Config build tsconfig must be a string when provided. */\n CliConfigInvalidBuildTsconfig = 3113,\n /** Config build bootstrap must be a string when provided. */\n CliConfigInvalidBuildBootstrap = 3114,\n /** Entry file must be inside the configured root directory. */\n CliConfigEntryOutsideRoot = 3115,\n /** Unable to locate a TypeScript config file for builds. */\n CliBuildTsconfigNotFound = 3116,\n /** TypeScript reported diagnostics during emit. */\n CliBuildFailed = 3117,\n /** Unable to write the generated bootstrap file. */\n CliBootstrapWriteFailed = 3118,\n /** Config tsconfig must be a string when provided. */\n CliConfigInvalidTsconfig = 3119,\n /** Config hmr options must be an object when provided. */\n CliConfigInvalidHmr = 3120,\n /** Config hmr restart patterns must be an array of strings when provided. */\n CliConfigInvalidHmrRestart = 3121,\n /** Two commands resolve to the same slash route during codegen. */\n CliCodegenDuplicateRoute = 3122,\n /** The commands directory could not be read during codegen. */\n CliCodegenCommandsDirUnreadable = 3123,\n /** Two context-menu commands of the same kind share a name during codegen. */\n CliCodegenDuplicateContextMenu = 3124,\n /** Could not resolve the application from the bot token during `commands --clean`. */\n CliCleanAppFetchFailed = 3126,\n /** `commands --clean` ran with neither --guild nor --all-guilds, so there is nothing to scan. */\n CliCleanNoGuilds = 3127,\n /** `commands --clean` combined --purge with --all-guilds, which would wipe every guild. */\n CliCleanPurgeAllGuilds = 3128,\n /** An interactive prompt was cancelled (Ctrl-C), so the command aborts without changes. */\n CliCancelled = 3129,\n /** `commands --clean --all-guilds` matched more guilds than the safety threshold without `--yes`. */\n CliCleanLargeBotUnconfirmed = 3130,\n /** `commands --clean --apply` ran in a non-interactive environment without `--yes`, where it cannot prompt. */\n CliCleanApplyNeedsYes = 3131,\n /** Config hmr rollback flag must be a boolean when provided. */\n CliConfigInvalidHmrRollback = 3132\n}\n","import { SeedcordErrorCode } from './ErrorCodes';\n\n/** @internal */\nconst messages = {\n [SeedcordErrorCode.ConfigMissingDiscordToken]: () => 'Missing DISCORD_BOT_TOKEN environment variable.',\n [SeedcordErrorCode.ConfigIncorrectDiscordToken]: () => 'Invalid DISCORD_BOT_TOKEN value.',\n [SeedcordErrorCode.ConfigUnknownExceptionWebhookMissing]: () =>\n 'Missing UNKNOWN_EXCEPTION_WEBHOOK_URL environment variable.',\n [SeedcordErrorCode.ConfigUnknownExceptionWebhookInvalid]: () => 'Invalid UNKNOWN_EXCEPTION_WEBHOOK_URL value.',\n [SeedcordErrorCode.ConfigHandledExceptionWebhookMissing]: () =>\n 'Missing HANDLED_EXCEPTION_WEBHOOK_URL environment variable.',\n [SeedcordErrorCode.ConfigHandledExceptionWebhookInvalid]: () => 'Invalid HANDLED_EXCEPTION_WEBHOOK_URL value.',\n [SeedcordErrorCode.ConfigEmojiUnresolved]: (count: number, failures: string) =>\n `Could not resolve ${count} configured emoji${count === 1 ? '' : 's'} at startup.\\n${failures}`,\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\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\n [SeedcordErrorCode.DecoratorInteractionEventFilter]: () => 'Interaction middleware cannot specify event filters.',\n [SeedcordErrorCode.DecoratorMethodNotFound]: () =>\n 'Decorator could not locate the original method. Ensure the method exists before applying the decorator.',\n [SeedcordErrorCode.DecoratorCommandAlreadyRegistered]: (\n commandName: string,\n existingScope: string,\n requestedScope: string\n ) =>\n `Command \"${commandName}\" is already registered as a \"${existingScope}\" command and cannot be re-registered as a \"${requestedScope}\" command.`,\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\n [SeedcordErrorCode.InteractionDuplicateRoute]: (route: string, firstClass: string, secondClass: string) =>\n `Two interaction handlers resolve to the same route \\`${route}\\`. Registered by ${firstClass} and ${secondClass}. Rename one.`,\n [SeedcordErrorCode.InteractionDuplicateMiddleware]: (name: string) =>\n `Two different interaction middleware classes share the name \\`${name}\\`. Rename one so they do not collide.`,\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) =>\n `customId field ${JSON.stringify(field)} uses oneOf() with no choices.`,\n [SeedcordErrorCode.CustomIdInvalidBounds]: (field: string, min: number, max: number) =>\n `customId field ${JSON.stringify(field)} has min ${min} greater than max ${max}.`,\n [SeedcordErrorCode.CustomIdValueOutOfRange]: (field: string, value: string) =>\n `customId field ${JSON.stringify(field)} got value ${value} outside its allowed range.`,\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 (@ButtonRoute, @ModalRoute, or @SelectMenuRoute).`,\n [SeedcordErrorCode.CustomIdMatchArmMissing]: (prefix: string) =>\n `match() has no arm for the decoded route ${JSON.stringify(prefix)}.`,\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.EventMiddlewareNameUnavailable]: () =>\n `this.eventName is only available on middleware the controller constructed with a fired event name.`,\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.PluginMongoServiceDecoratorMissing]: (className: string) =>\n `Missing @RegisterMongoService on ${className}.`,\n [SeedcordErrorCode.PluginMongoModelDecoratorMissing]: (className: string) =>\n `Missing @RegisterMongoModel on ${className}.`,\n [SeedcordErrorCode.PluginMongoConnectionFailed]: (databaseName?: string) =>\n databaseName ? `Could not connect to MongoDB (${databaseName}).` : 'Could not connect to MongoDB.',\n [SeedcordErrorCode.PluginMongoDisconnectFailed]: () => 'Failed to disconnect from MongoDB cleanly during shutdown.',\n [SeedcordErrorCode.PluginMongoServicesNotReady]: () =>\n 'Mongo services accessed before the plugin finished initializing.',\n\n [SeedcordErrorCode.PluginKpgServiceDecoratorMissing]: (className: string) =>\n `Missing @RegisterKpgService on ${className}.`,\n [SeedcordErrorCode.PluginKpgServiceTableMissing]: (className: string) =>\n `Missing table metadata for ${className}. Provide a table via @RegisterKpgService().`,\n [SeedcordErrorCode.PluginKpgInvalidStepCount]: () => 'Migration step count must be a non-negative integer.',\n [SeedcordErrorCode.PluginKpgUnknownDirection]: (direction: unknown) =>\n `Unknown migration direction: ${String(direction)}.`,\n [SeedcordErrorCode.PluginKpgUnresolvedMigrationsPath]: (label: string) =>\n `Unable to resolve migrations at path: ${label}.`,\n [SeedcordErrorCode.PluginKpgNoMigrationFiles]: () => 'No migration files provided.',\n [SeedcordErrorCode.PluginKpgInvalidMigrationModule]: (filePath: string) =>\n `Migration file ${filePath} must export async functions up and down.`,\n [SeedcordErrorCode.PluginKpgNonErrorFailure]: (message: string) => `Migration failure: ${message}.`,\n [SeedcordErrorCode.PluginKpgDisconnectFailed]: () => 'Failed to close the Postgres pool cleanly during shutdown.',\n [SeedcordErrorCode.PluginKpgServicesNotReady]: () =>\n 'KPG services accessed before the plugin finished initializing.',\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.CliConfigInvalidRoot]: () => 'Config `root` must be a string when provided.',\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.CliConfigInvalidBuild]: () => 'Config `build` must be an object when provided.',\n [SeedcordErrorCode.CliConfigInvalidBuildOutDir]: () => 'Config `build.outDir` must be a string when provided.',\n [SeedcordErrorCode.CliConfigInvalidBuildTsconfig]: () => 'Config `build.tsconfig` must be a string when provided.',\n [SeedcordErrorCode.CliConfigInvalidBuildBootstrap]: () =>\n 'Config `build.bootstrap` must be a string when provided.',\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.CliTsxImportFailed]: (entryPath: string, reason: string) =>\n `Failed to import ${entryPath} via tsx: ${reason}.`,\n [SeedcordErrorCode.CliImportFailed]: (entryPath: string, nativeReason: string, fallbackReason: string) =>\n `Failed to import ${entryPath}: ${nativeReason}. Fallback via jiti 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.CliConfigInvalidTsconfig]: () => 'Config `tsconfig` must be a string when provided.',\n [SeedcordErrorCode.CliConfigInvalidHmr]: () => 'Config `hmr` must be an object when provided.',\n [SeedcordErrorCode.CliConfigInvalidHmrRestart]: () =>\n 'Config `hmr.restart` must be an array of strings when provided.',\n [SeedcordErrorCode.CliConfigInvalidHmrRollback]: () => 'Config `hmr.rollback` must be a boolean when provided.',\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.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} 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","/* eslint-disable @typescript-eslint/no-unnecessary-condition */\nimport chalk from 'chalk';\n\nimport { SeedcordErrorCode } from './ErrorCodes';\nimport { formatSeedcordErrorMessage, type SeedcordErrorArguments } from './ErrorMessages';\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 `${chalk.bold.red(name)}[${chalk.gray(code)}]`;\n}\n\n/**\n * String literal type for Seedcord error class names.\n *\n * @internal\n */\nexport type SeedcordErrorTypeString = `Seedcord${'Error' | 'TypeError' | 'RangeError'}`;\n\ninterface BaseSeedcordError {\n readonly code: SeedcordErrorCode;\n readonly identifier: SeedcordErrorIdentifier;\n readonly type: SeedcordErrorTypeString;\n}\n\n/**\n * Base class for Seedcord errors.\n */\nexport class SeedcordError<Code extends SeedcordErrorCode = SeedcordErrorCode>\n extends Error\n implements BaseSeedcordError\n{\n public readonly code: Code;\n public readonly identifier: 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.identifier = resolveIdentifier(code);\n this.name = formatErrorName(new.target.name, this.identifier, 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\n/**\n * TypeError class for Seedcord errors.\n */\nexport class SeedcordTypeError<Code extends SeedcordErrorCode = SeedcordErrorCode>\n extends TypeError\n implements BaseSeedcordError\n{\n public readonly code: Code;\n public readonly identifier: 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.identifier = resolveIdentifier(code);\n this.name = formatErrorName(new.target.name, this.identifier, 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\n/**\n * RangeError class for Seedcord errors.\n */\nexport class SeedcordRangeError<Code extends SeedcordErrorCode = SeedcordErrorCode>\n extends RangeError\n implements BaseSeedcordError\n{\n public readonly code: Code;\n public readonly identifier: 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.identifier = resolveIdentifier(code);\n this.name = formatErrorName(new.target.name, this.identifier, 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\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 : SeedcordRangeError<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 (Error, TypeError, or RangeError).\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 const isSeedcordErrorInstance = error instanceof SeedcordError && error.type === 'SeedcordError';\n const isSeedcordTypeErrorInstance = error instanceof SeedcordTypeError && error.type === 'SeedcordTypeError';\n const isSeedcordRangeErrorInstance = error instanceof SeedcordRangeError && error.type === 'SeedcordRangeError';\n\n if (!isSeedcordErrorInstance && !isSeedcordTypeErrorInstance && !isSeedcordRangeErrorInstance) {\n return false;\n }\n\n const matchesType = type\n ? (type === 'SeedcordError' && isSeedcordErrorInstance) ||\n (type === 'SeedcordTypeError' && isSeedcordTypeErrorInstance) ||\n (type === 'SeedcordRangeError' && isSeedcordRangeErrorInstance)\n : true;\n\n if (!matchesType) return false;\n if (code === undefined) return true;\n return error.code === code;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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KAAK,OAAO;EACZ,KAAK,aAAa,kBAAkB,IAAI;EACxC,KAAK,OAAO,gBAAgB,IAAI,OAAO,MAAM,KAAK,YAAY,KAAK,IAAI;EACvE,OAAO,eAAe,MAAM,IAAI,OAAO,SAAS;EAChD,IAAI,OAAO,MAAM,sBAAsB,YACnC,MAAM,kBAAkB,MAAM,IAAI,MAAM;CAEhD;AACJ;;;;;;;;;;AA2DA,SAAgB,gBAGd,OAAgB,MAAa,MAAmD;CAC9E,MAAM,0BAA0B,iBAAiB,iBAAiB,MAAM,SAAS;CACjF,MAAM,8BAA8B,iBAAiB,qBAAqB,MAAM,SAAS;CACzF,MAAM,+BAA+B,iBAAiB,sBAAsB,MAAM,SAAS;CAE3F,IAAI,CAAC,2BAA2B,CAAC,+BAA+B,CAAC,8BAC7D,OAAO;CASX,IAAI,EANgB,OACb,SAAS,mBAAmB,2BAC5B,SAAS,uBAAuB,+BAChC,SAAS,wBAAwB,+BAClC,OAEY,OAAO;CACzB,IAAI,SAAS,QAAW,OAAO;CAC/B,OAAO,MAAM,SAAS;AAC1B"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"SeedcordError-BSoo1HKt.mjs","names":[],"sources":["../src/ErrorCodes.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 /** DISCORD_BOT_TOKEN is not present in the environment. */\n ConfigMissingDiscordToken = 1001,\n /** DISCORD_BOT_TOKEN is present but fails validation. */\n ConfigIncorrectDiscordToken = 1004,\n /** UNKNOWN_EXCEPTION_WEBHOOK_URL is missing when configuring the reporter. */\n ConfigUnknownExceptionWebhookMissing = 1002,\n /** UNKNOWN_EXCEPTION_WEBHOOK_URL is present but fails URL validation. */\n ConfigUnknownExceptionWebhookInvalid = 1003,\n /** HANDLED_EXCEPTION_WEBHOOK_URL is missing when configuring the reporter. */\n ConfigHandledExceptionWebhookMissing = 1005,\n /** HANDLED_EXCEPTION_WEBHOOK_URL is present but fails URL validation. */\n ConfigHandledExceptionWebhookInvalid = 1006,\n /** One or more configured emojis could not be resolved at startup. */\n ConfigEmojiUnresolved = 1007,\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\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\n /** Interaction middleware decorated with disallowed event filters. */\n DecoratorInteractionEventFilter = 1301,\n /** A decorator could not find the original method being decorated. */\n DecoratorMethodNotFound = 1302,\n /** A command decorator attempted to re-register an existing command scope. */\n DecoratorCommandAlreadyRegistered = 1303,\n /** A global command decorator specified guild IDs, which is not allowed. */\n DecoratorCommandGlobalWithGuilds = 1304,\n /** A guild command decorator omitted the required guild ID list. */\n DecoratorCommandGuildWithoutGuilds = 1305,\n /** Middleware priority provided by the decorator was not a finite number. */\n DecoratorInvalidMiddlewarePriority = 1306,\n\n /** Two interaction handlers registered the same route within a scope. */\n InteractionDuplicateRoute = 1401,\n /** Two different interaction middleware classes share a class name. */\n InteractionDuplicateMiddleware = 1402,\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() 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 value passed to encode() is outside its field's allowed range. */\n CustomIdValueOutOfRange = 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 its route decorator (\\@ButtonRoute / \\@ModalRoute / \\@SelectMenuRoute). */\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\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 /** Mongo service class is missing the `@RegisterMongoService` decorator. */\n PluginMongoServiceDecoratorMissing = 2101,\n /** Mongo model class is missing the `@RegisterMongoModel` decorator. */\n PluginMongoModelDecoratorMissing = 2102,\n /** Mongo client failed to establish a connection. */\n PluginMongoConnectionFailed = 2103,\n /** Mongo client failed to disconnect cleanly during shutdown. */\n PluginMongoDisconnectFailed = 2104,\n /** Mongo `services` was accessed before the plugin finished initializing. */\n PluginMongoServicesNotReady = 2105,\n\n /** KPG service class is missing the `@RegisterKpgService` decorator. */\n PluginKpgServiceDecoratorMissing = 2201,\n /** KPG service class is missing its table metadata. */\n PluginKpgServiceTableMissing = 2202,\n /** Migration manager received an invalid step count. */\n PluginKpgInvalidStepCount = 2203,\n /** Migration direction was not recognized. */\n PluginKpgUnknownDirection = 2204,\n /** Provided migrations path could not be resolved. */\n PluginKpgUnresolvedMigrationsPath = 2205,\n /** No migration files were found for execution. */\n PluginKpgNoMigrationFiles = 2206,\n /** A migration module failed to export the expected functions. */\n PluginKpgInvalidMigrationModule = 2207,\n /** An arbitrary (non-Error) failure was reported by a migration. */\n PluginKpgNonErrorFailure = 2208,\n /** Postgres pool failed to close cleanly during shutdown. */\n PluginKpgDisconnectFailed = 2209,\n /** KPG `services` was accessed before the plugin finished initializing. */\n PluginKpgServicesNotReady = 2210,\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 /** Config root was provided but not a string. */\n CliConfigInvalidRoot = 3103,\n /** Unable to locate a Seedcord config file. */\n CliConfigNotFound = 3104,\n /** CLI entry file does not exist. */\n CliEntryNotFound = 3105,\n /** tsx failed to import the provided entry file. */\n CliTsxImportFailed = 3106,\n /** Native import and jiti fallback both failed. */\n CliImportFailed = 3107,\n /** Seedcord instance export is missing a start() method. */\n CliInstanceInvalid = 3108,\n /** Seedcord instance threw during startup. */\n CliStartFailed = 3109,\n /** Config is missing the required entry string. */\n CliConfigMissingEntry = 3110,\n /** Config build options must be an object when provided. */\n CliConfigInvalidBuild = 3111,\n /** Config build outDir must be a string when provided. */\n CliConfigInvalidBuildOutDir = 3112,\n /** Config build tsconfig must be a string when provided. */\n CliConfigInvalidBuildTsconfig = 3113,\n /** Config build bootstrap must be a string when provided. */\n CliConfigInvalidBuildBootstrap = 3114,\n /** Entry file must be inside the configured root directory. */\n CliConfigEntryOutsideRoot = 3115,\n /** Unable to locate a TypeScript config file for builds. */\n CliBuildTsconfigNotFound = 3116,\n /** TypeScript reported diagnostics during emit. */\n CliBuildFailed = 3117,\n /** Unable to write the generated bootstrap file. */\n CliBootstrapWriteFailed = 3118,\n /** Config tsconfig must be a string when provided. */\n CliConfigInvalidTsconfig = 3119,\n /** Config hmr options must be an object when provided. */\n CliConfigInvalidHmr = 3120,\n /** Config hmr restart patterns must be an array of strings when provided. */\n CliConfigInvalidHmrRestart = 3121,\n /** Two commands resolve to the same slash route during codegen. */\n CliCodegenDuplicateRoute = 3122,\n /** The commands directory could not be read during codegen. */\n CliCodegenCommandsDirUnreadable = 3123,\n /** Two context-menu commands of the same kind share a name during codegen. */\n CliCodegenDuplicateContextMenu = 3124,\n /** Could not resolve the application from the bot token during `commands --clean`. */\n CliCleanAppFetchFailed = 3126,\n /** `commands --clean` ran with neither --guild nor --all-guilds, so there is nothing to scan. */\n CliCleanNoGuilds = 3127,\n /** `commands --clean` combined --purge with --all-guilds, which would wipe every guild. */\n CliCleanPurgeAllGuilds = 3128,\n /** An interactive prompt was cancelled (Ctrl-C), so the command aborts without changes. */\n CliCancelled = 3129,\n /** `commands --clean --all-guilds` matched more guilds than the safety threshold without `--yes`. */\n CliCleanLargeBotUnconfirmed = 3130,\n /** `commands --clean --apply` ran in a non-interactive environment without `--yes`, where it cannot prompt. */\n CliCleanApplyNeedsYes = 3131,\n /** Config hmr rollback flag must be a boolean when provided. */\n CliConfigInvalidHmrRollback = 3132\n}\n","import { SeedcordErrorCode } from './ErrorCodes';\n\n/** @internal */\nconst messages = {\n [SeedcordErrorCode.ConfigMissingDiscordToken]: () => 'Missing DISCORD_BOT_TOKEN environment variable.',\n [SeedcordErrorCode.ConfigIncorrectDiscordToken]: () => 'Invalid DISCORD_BOT_TOKEN value.',\n [SeedcordErrorCode.ConfigUnknownExceptionWebhookMissing]: () =>\n 'Missing UNKNOWN_EXCEPTION_WEBHOOK_URL environment variable.',\n [SeedcordErrorCode.ConfigUnknownExceptionWebhookInvalid]: () => 'Invalid UNKNOWN_EXCEPTION_WEBHOOK_URL value.',\n [SeedcordErrorCode.ConfigHandledExceptionWebhookMissing]: () =>\n 'Missing HANDLED_EXCEPTION_WEBHOOK_URL environment variable.',\n [SeedcordErrorCode.ConfigHandledExceptionWebhookInvalid]: () => 'Invalid HANDLED_EXCEPTION_WEBHOOK_URL value.',\n [SeedcordErrorCode.ConfigEmojiUnresolved]: (count: number, failures: string) =>\n `Could not resolve ${count} configured emoji${count === 1 ? '' : 's'} at startup.\\n${failures}`,\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\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\n [SeedcordErrorCode.DecoratorInteractionEventFilter]: () => 'Interaction middleware cannot specify event filters.',\n [SeedcordErrorCode.DecoratorMethodNotFound]: () =>\n 'Decorator could not locate the original method. Ensure the method exists before applying the decorator.',\n [SeedcordErrorCode.DecoratorCommandAlreadyRegistered]: (\n commandName: string,\n existingScope: string,\n requestedScope: string\n ) =>\n `Command \"${commandName}\" is already registered as a \"${existingScope}\" command and cannot be re-registered as a \"${requestedScope}\" command.`,\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\n [SeedcordErrorCode.InteractionDuplicateRoute]: (route: string, firstClass: string, secondClass: string) =>\n `Two interaction handlers resolve to the same route \\`${route}\\`. Registered by ${firstClass} and ${secondClass}. Rename one.`,\n [SeedcordErrorCode.InteractionDuplicateMiddleware]: (name: string) =>\n `Two different interaction middleware classes share the name \\`${name}\\`. Rename one so they do not collide.`,\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) =>\n `customId field ${JSON.stringify(field)} uses oneOf() with no choices.`,\n [SeedcordErrorCode.CustomIdInvalidBounds]: (field: string, min: number, max: number) =>\n `customId field ${JSON.stringify(field)} has min ${min} greater than max ${max}.`,\n [SeedcordErrorCode.CustomIdValueOutOfRange]: (field: string, value: string) =>\n `customId field ${JSON.stringify(field)} got value ${value} outside its allowed range.`,\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 (@ButtonRoute, @ModalRoute, or @SelectMenuRoute).`,\n [SeedcordErrorCode.CustomIdMatchArmMissing]: (prefix: string) =>\n `match() has no arm for the decoded route ${JSON.stringify(prefix)}.`,\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.EventMiddlewareNameUnavailable]: () =>\n `this.eventName is only available on middleware the controller constructed with a fired event name.`,\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.PluginMongoServiceDecoratorMissing]: (className: string) =>\n `Missing @RegisterMongoService on ${className}.`,\n [SeedcordErrorCode.PluginMongoModelDecoratorMissing]: (className: string) =>\n `Missing @RegisterMongoModel on ${className}.`,\n [SeedcordErrorCode.PluginMongoConnectionFailed]: (databaseName?: string) =>\n databaseName ? `Could not connect to MongoDB (${databaseName}).` : 'Could not connect to MongoDB.',\n [SeedcordErrorCode.PluginMongoDisconnectFailed]: () => 'Failed to disconnect from MongoDB cleanly during shutdown.',\n [SeedcordErrorCode.PluginMongoServicesNotReady]: () =>\n 'Mongo services accessed before the plugin finished initializing.',\n\n [SeedcordErrorCode.PluginKpgServiceDecoratorMissing]: (className: string) =>\n `Missing @RegisterKpgService on ${className}.`,\n [SeedcordErrorCode.PluginKpgServiceTableMissing]: (className: string) =>\n `Missing table metadata for ${className}. Provide a table via @RegisterKpgService().`,\n [SeedcordErrorCode.PluginKpgInvalidStepCount]: () => 'Migration step count must be a non-negative integer.',\n [SeedcordErrorCode.PluginKpgUnknownDirection]: (direction: unknown) =>\n `Unknown migration direction: ${String(direction)}.`,\n [SeedcordErrorCode.PluginKpgUnresolvedMigrationsPath]: (label: string) =>\n `Unable to resolve migrations at path: ${label}.`,\n [SeedcordErrorCode.PluginKpgNoMigrationFiles]: () => 'No migration files provided.',\n [SeedcordErrorCode.PluginKpgInvalidMigrationModule]: (filePath: string) =>\n `Migration file ${filePath} must export async functions up and down.`,\n [SeedcordErrorCode.PluginKpgNonErrorFailure]: (message: string) => `Migration failure: ${message}.`,\n [SeedcordErrorCode.PluginKpgDisconnectFailed]: () => 'Failed to close the Postgres pool cleanly during shutdown.',\n [SeedcordErrorCode.PluginKpgServicesNotReady]: () =>\n 'KPG services accessed before the plugin finished initializing.',\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.CliConfigInvalidRoot]: () => 'Config `root` must be a string when provided.',\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.CliConfigInvalidBuild]: () => 'Config `build` must be an object when provided.',\n [SeedcordErrorCode.CliConfigInvalidBuildOutDir]: () => 'Config `build.outDir` must be a string when provided.',\n [SeedcordErrorCode.CliConfigInvalidBuildTsconfig]: () => 'Config `build.tsconfig` must be a string when provided.',\n [SeedcordErrorCode.CliConfigInvalidBuildBootstrap]: () =>\n 'Config `build.bootstrap` must be a string when provided.',\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.CliTsxImportFailed]: (entryPath: string, reason: string) =>\n `Failed to import ${entryPath} via tsx: ${reason}.`,\n [SeedcordErrorCode.CliImportFailed]: (entryPath: string, nativeReason: string, fallbackReason: string) =>\n `Failed to import ${entryPath}: ${nativeReason}. Fallback via jiti 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.CliConfigInvalidTsconfig]: () => 'Config `tsconfig` must be a string when provided.',\n [SeedcordErrorCode.CliConfigInvalidHmr]: () => 'Config `hmr` must be an object when provided.',\n [SeedcordErrorCode.CliConfigInvalidHmrRestart]: () =>\n 'Config `hmr.restart` must be an array of strings when provided.',\n [SeedcordErrorCode.CliConfigInvalidHmrRollback]: () => 'Config `hmr.rollback` must be a boolean when provided.',\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.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} 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","/* eslint-disable @typescript-eslint/no-unnecessary-condition */\nimport chalk from 'chalk';\n\nimport { SeedcordErrorCode } from './ErrorCodes';\nimport { formatSeedcordErrorMessage, type SeedcordErrorArguments } from './ErrorMessages';\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 `${chalk.bold.red(name)}[${chalk.gray(code)}]`;\n}\n\n/**\n * String literal type for Seedcord error class names.\n *\n * @internal\n */\nexport type SeedcordErrorTypeString = `Seedcord${'Error' | 'TypeError' | 'RangeError'}`;\n\ninterface BaseSeedcordError {\n readonly code: SeedcordErrorCode;\n readonly identifier: SeedcordErrorIdentifier;\n readonly type: SeedcordErrorTypeString;\n}\n\n/**\n * Base class for Seedcord errors.\n */\nexport class SeedcordError<Code extends SeedcordErrorCode = SeedcordErrorCode>\n extends Error\n implements BaseSeedcordError\n{\n public readonly code: Code;\n public readonly identifier: 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.identifier = resolveIdentifier(code);\n this.name = formatErrorName(new.target.name, this.identifier, 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\n/**\n * TypeError class for Seedcord errors.\n */\nexport class SeedcordTypeError<Code extends SeedcordErrorCode = SeedcordErrorCode>\n extends TypeError\n implements BaseSeedcordError\n{\n public readonly code: Code;\n public readonly identifier: 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.identifier = resolveIdentifier(code);\n this.name = formatErrorName(new.target.name, this.identifier, 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\n/**\n * RangeError class for Seedcord errors.\n */\nexport class SeedcordRangeError<Code extends SeedcordErrorCode = SeedcordErrorCode>\n extends RangeError\n implements BaseSeedcordError\n{\n public readonly code: Code;\n public readonly identifier: 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.identifier = resolveIdentifier(code);\n this.name = formatErrorName(new.target.name, this.identifier, 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\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 : SeedcordRangeError<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 (Error, TypeError, or RangeError).\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 const isSeedcordErrorInstance = error instanceof SeedcordError && error.type === 'SeedcordError';\n const isSeedcordTypeErrorInstance = error instanceof SeedcordTypeError && error.type === 'SeedcordTypeError';\n const isSeedcordRangeErrorInstance = error instanceof SeedcordRangeError && error.type === 'SeedcordRangeError';\n\n if (!isSeedcordErrorInstance && !isSeedcordTypeErrorInstance && !isSeedcordRangeErrorInstance) {\n return false;\n }\n\n const matchesType = type\n ? (type === 'SeedcordError' && isSeedcordErrorInstance) ||\n (type === 'SeedcordTypeError' && isSeedcordTypeErrorInstance) ||\n (type === 'SeedcordRangeError' && isSeedcordRangeErrorInstance)\n : true;\n\n if (!matchesType) return false;\n if (code === undefined) return true;\n return error.code === code;\n}\n"],"mappings":";;;;;;AAKA,IAAY,oBAAL;;CAEH;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAGA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAGA;;CAEA;;CAEA;;CAEA;;CAEA;;CAGA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAGA;;CAEA;;CAGA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAGA;;CAGA;;CAEA;;CAEA;;CAEA;;CAGA;;CAEA;;CAGA;;CAEA;;CAEA;;CAEA;;CAEA;;CAGA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAGA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CA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