@seedcord/errors 0.14.0 → 0.15.0-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -101,6 +101,12 @@ let SeedcordErrorCode = /* @__PURE__ */ function(SeedcordErrorCode) {
101
101
  SeedcordErrorCode[SeedcordErrorCode["CoreDirectoryNotListed"] = 1230] = "CoreDirectoryNotListed";
102
102
  /** A folder is inside one that `seedcord build` skips, like a dot-folder, `node_modules`, `outDir` or the logs folder. */
103
103
  SeedcordErrorCode[SeedcordErrorCode["CoreDirectorySkipped"] = 1231] = "CoreDirectorySkipped";
104
+ /** `collection.entries()` ran on a Keyv store in `config.kv` that can't list its keys. */
105
+ SeedcordErrorCode[SeedcordErrorCode["CoreKvKeysUnsupported"] = 1232] = "CoreKvKeysUnsupported";
106
+ /** A plugin built with `new` outside `attach()` read `this.kv`. */
107
+ SeedcordErrorCode[SeedcordErrorCode["CorePluginKvOutsideAttach"] = 1233] = "CorePluginKvOutsideAttach";
108
+ /** The driver in `config.kv` threw, or reported a write as failed. */
109
+ SeedcordErrorCode[SeedcordErrorCode["CoreKvDriverFailed"] = 1234] = "CoreKvDriverFailed";
104
110
  /** A command class carries `@RegisterCommand` twice. */
105
111
  SeedcordErrorCode[SeedcordErrorCode["DecoratorCommandAlreadyRegistered"] = 1301] = "DecoratorCommandAlreadyRegistered";
106
112
  /** `@RegisterCommand('global')` was given guild ids. */
@@ -137,9 +143,9 @@ let SeedcordErrorCode = /* @__PURE__ */ function(SeedcordErrorCode) {
137
143
  SeedcordErrorCode[SeedcordErrorCode["CustomIdWireTooLong"] = 1606] = "CustomIdWireTooLong";
138
144
  /** A component handler is missing the route decorator that matches its base. */
139
145
  SeedcordErrorCode[SeedcordErrorCode["CustomIdHandlerRouteMissing"] = 1607] = "CustomIdHandlerRouteMissing";
140
- /** A handler's `match()` has no arm for the route, field, event, or command that fired. */
146
+ /** A handler's `match()` has no arm for the current route, field, event, or command. */
141
147
  SeedcordErrorCode[SeedcordErrorCode["MatchArmMissing"] = 1608] = "MatchArmMissing";
142
- /** An event handler or middleware read the fired event's name but was constructed without one. */
148
+ /** An event handler or middleware read the event name but was constructed without one. */
143
149
  SeedcordErrorCode[SeedcordErrorCode["EventNameUnavailable"] = 1609] = "EventNameUnavailable";
144
150
  /** Discord sent an autocomplete payload with no focused option. */
145
151
  SeedcordErrorCode[SeedcordErrorCode["AutocompleteNoFocusedOption"] = 1610] = "AutocompleteNoFocusedOption";
@@ -289,6 +295,14 @@ let SeedcordErrorCode = /* @__PURE__ */ function(SeedcordErrorCode) {
289
295
  SeedcordErrorCode[SeedcordErrorCode["CliDevAlreadyRunning"] = 3141] = "CliDevAlreadyRunning";
290
296
  /** The folder that holds the dev session locks belongs to another user. */
291
297
  SeedcordErrorCode[SeedcordErrorCode["CliDevLockFolderNotOwned"] = 3142] = "CliDevLockFolderNotOwned";
298
+ /** A plugin's `codegen()` threw. */
299
+ SeedcordErrorCode[SeedcordErrorCode["CliPluginCodegenThrew"] = 3143] = "CliPluginCodegenThrew";
300
+ /** A plugin class with a `codegen()` is missing its `static readonly id`. */
301
+ SeedcordErrorCode[SeedcordErrorCode["CliPluginCodegenNoId"] = 3144] = "CliPluginCodegenNoId";
302
+ /** A plugin's `codegen()` returned a value that codegen can't write as a type. */
303
+ SeedcordErrorCode[SeedcordErrorCode["CliPluginCodegenValue"] = 3145] = "CliPluginCodegenValue";
304
+ /** Two attachments of one plugin class returned different values at one key from `codegen()`. */
305
+ SeedcordErrorCode[SeedcordErrorCode["CliPluginCodegenConflict"] = 3146] = "CliPluginCodegenConflict";
292
306
  /** A flag answers a question that the earlier answers skip. */
293
307
  SeedcordErrorCode[SeedcordErrorCode["CreateFlagNotApplicable"] = 3201] = "CreateFlagNotApplicable";
294
308
  /** A flag has a value its question rejects. */
@@ -299,9 +313,60 @@ let SeedcordErrorCode = /* @__PURE__ */ function(SeedcordErrorCode) {
299
313
  SeedcordErrorCode[SeedcordErrorCode["CreateTargetNotEmpty"] = 3204] = "CreateTargetNotEmpty";
300
314
  /** A command that create-seedcord ran exited non-zero. */
301
315
  SeedcordErrorCode[SeedcordErrorCode["CreateStepFailed"] = 3205] = "CreateStepFailed";
316
+ /** The name given to `seedcord make` can't become a file name. */
317
+ SeedcordErrorCode[SeedcordErrorCode["MakeInvalidName"] = 3301] = "MakeInvalidName";
318
+ /** A template calls `importOf` on a folder that doesn't hold exactly one template file. */
319
+ SeedcordErrorCode[SeedcordErrorCode["MakeImportOfUnmatched"] = 3302] = "MakeImportOfUnmatched";
320
+ /** A template uses one value as two of text, a list, and an entry with fields. */
321
+ SeedcordErrorCode[SeedcordErrorCode["MakeValueUsedTwoWays"] = 3303] = "MakeValueUsedTwoWays";
322
+ /** Handlebars could not parse or render a template file. */
323
+ SeedcordErrorCode[SeedcordErrorCode["MakeTemplateFailed"] = 3304] = "MakeTemplateFailed";
324
+ /** A template calls `lookup` with a key that isn't quoted text. */
325
+ SeedcordErrorCode[SeedcordErrorCode["MakeLookupDynamicKey"] = 3305] = "MakeLookupDynamicKey";
326
+ /** `seedcord make` ran without a terminal to ask its questions in. */
327
+ SeedcordErrorCode[SeedcordErrorCode["MakeNeedsTerminal"] = 3306] = "MakeNeedsTerminal";
328
+ /** `seedcord make` found no templates in the bot or its plugins. */
329
+ SeedcordErrorCode[SeedcordErrorCode["MakeNoTemplates"] = 3307] = "MakeNoTemplates";
330
+ /** A path `seedcord make` would write to is taken, by a file on disk or by another file of the same template. */
331
+ SeedcordErrorCode[SeedcordErrorCode["MakePathTaken"] = 3308] = "MakePathTaken";
332
+ /** A template's partial calls itself, so `seedcord make` can't tell how many levels to ask for. */
333
+ SeedcordErrorCode[SeedcordErrorCode["MakePartialCallsItself"] = 3309] = "MakePartialCallsItself";
302
334
  return SeedcordErrorCode;
303
335
  }({});
304
336
 
337
+ //#endregion
338
+ //#region ../../tooling/brand/dist/index.mjs
339
+ const BRAND_COLORS = {
340
+ pith: "#f8f6e8",
341
+ seedDark: "#2d3328",
342
+ flesh: "#f04e36",
343
+ fleshDeep: "#c8341f",
344
+ rind: "#6fab49",
345
+ rindDeep: "#4d7d33"
346
+ };
347
+ var SiteAddress = class {
348
+ url;
349
+ constructor(url) {
350
+ this.url = url.replace(/\/+$/, "");
351
+ }
352
+ get label() {
353
+ return this.url.replace(/^[a-z]+:\/\//, "");
354
+ }
355
+ get path() {
356
+ return new URL(this.url).pathname.replace(/\/$/, "");
357
+ }
358
+ at(path) {
359
+ if (path === "") return this.url;
360
+ return `${this.url}/${path.replace(/^\/+/, "")}`;
361
+ }
362
+ };
363
+ const PRODUCTION_ORIGIN = "https://seedcord.org";
364
+ const PRODUCTION_SITES = {
365
+ home: new SiteAddress(PRODUCTION_ORIGIN),
366
+ guide: new SiteAddress(`${PRODUCTION_ORIGIN}/guide`),
367
+ docs: new SiteAddress(`${PRODUCTION_ORIGIN}/docs`)
368
+ };
369
+
305
370
  //#endregion
306
371
  //#region src/displayPath.ts
307
372
  function displayPath(rawPath, { prefix } = {}) {
@@ -317,11 +382,6 @@ function forwardSlashes(path) {
317
382
 
318
383
  //#endregion
319
384
  //#region src/palette.ts
320
- const BRAND = {
321
- flesh: "#f04e36",
322
- rind: "#6fab49",
323
- pith: "#f8f6e8"
324
- };
325
385
  function setColorLevel(level) {
326
386
  chalk.level = level;
327
387
  }
@@ -344,13 +404,13 @@ const paint = {
344
404
  return chalk.hex("#ff6b85");
345
405
  },
346
406
  get flesh() {
347
- return chalk.hex(BRAND.flesh);
407
+ return chalk.hex(BRAND_COLORS.flesh);
348
408
  },
349
409
  get rind() {
350
- return chalk.hex(BRAND.rind);
410
+ return chalk.hex(BRAND_COLORS.rind);
351
411
  },
352
412
  get pith() {
353
- return chalk.hex(BRAND.pith);
413
+ return chalk.hex(BRAND_COLORS.pith);
354
414
  },
355
415
  mute: chalk.dim,
356
416
  check: "✔︎",
@@ -362,27 +422,7 @@ const paint = {
362
422
  const WORDMARK = `${paint.flesh.bold("seed")}${paint.rind.bold("cord")}`;
363
423
 
364
424
  //#endregion
365
- //#region src/messageText.ts
366
- function sentence(text) {
367
- if (text.includes("\n")) return text;
368
- return /[.!?]$/.test(text) ? text : `${text}.`;
369
- }
370
- function reasonThen(reason, next) {
371
- return `${sentence(reason)}${reason.includes("\n") ? "\n" : " "}${next}`;
372
- }
373
- const plurals = new Intl.PluralRules("en");
374
- const allOf = new Intl.ListFormat("en", { type: "conjunction" });
375
- const oneOf = new Intl.ListFormat("en", { type: "disjunction" });
376
- function isOne(count) {
377
- return plurals.select(count) === "one";
378
- }
379
- function counted(count, one, many) {
380
- return `${count} ${isOne(count) ? one : many}`;
381
- }
382
- const quoted = (value) => paint.sky(JSON.stringify(value));
383
-
384
- //#endregion
385
- //#region src/ErrorMessages.ts
425
+ //#region src/messageParts.ts
386
426
  function placeText(hook, loading) {
387
427
  const inHook = `in its ${paint.bold(hook)} hook`;
388
428
  if (loading === void 0) return inHook;
@@ -405,6 +445,29 @@ function deployFix(status, otherwise) {
405
445
  if (status === BAD_REQUEST) return "Check that each command's name, description and options are valid.";
406
446
  return otherwise;
407
447
  }
448
+
449
+ //#endregion
450
+ //#region src/messageText.ts
451
+ function sentence(text) {
452
+ if (text.includes("\n")) return text;
453
+ return /[.!?]$/.test(text) ? text : `${text}.`;
454
+ }
455
+ function reasonThen(reason, next) {
456
+ return `${sentence(reason)}${reason.includes("\n") ? "\n" : " "}${next}`;
457
+ }
458
+ const plurals = new Intl.PluralRules("en");
459
+ const allOf = new Intl.ListFormat("en", { type: "conjunction" });
460
+ const oneOf = new Intl.ListFormat("en", { type: "disjunction" });
461
+ function isOne(count) {
462
+ return plurals.select(count) === "one";
463
+ }
464
+ function counted(count, one, many) {
465
+ return `${count} ${isOne(count) ? one : many}`;
466
+ }
467
+ const quoted = (value) => paint.sky(JSON.stringify(value));
468
+
469
+ //#endregion
470
+ //#region src/ErrorMessages.ts
408
471
  /** @internal */
409
472
  const messages = {
410
473
  [1001]: (count) => `${paint.iris(count)} configured emojis could not be resolved. Each one is listed below.`,
@@ -433,10 +496,13 @@ const messages = {
433
496
  [1229]: (plugin, place, configFile, reason) => place.hook === void 0 ? `${paint.sky(plugin)} in ${paint.path(configFile)} failed when seedcord called ${paint.bold("vitePlugins")}. ${reasonThen(reason, "Check that the package is installed and that its import resolves.")}` : `The Vite plugin ${paint.sky(plugin)} from ${paint.bold("vitePlugins")} in ${paint.path(configFile)} threw ${placeText(place.hook, place.loading)}. ${reasonThen(reason, vitePluginFix(place))}`,
434
497
  [1207]: (path, reason) => `Could not read ${paint.path(path)}. ${reasonThen(reason, "Check that it exists and that this process can read it.")}`,
435
498
  [1219]: (path, root) => `${paint.path(path)} is outside ${paint.bold("root")} (${paint.path(root)}). ${paint.bold("seedcord build")} bundles only the files under ${paint.bold("root")}. Move it under ${paint.bold("root")}, or set ${paint.bold("root")} in seedcord.config.ts to a folder that holds it.`,
436
- [1223]: (dir) => `${paint.path(dir)} is relative to ${paint.bold("root")}, but nothing set ${paint.bold("root")} in this process. ${paint.bold("seedcord codegen")}, ${paint.bold("build")}, and ${paint.bold("commands")} import bot.ts without starting it, so read the folder in a startup task or a plugin's init(). In a test or a script, pass an absolute path like ${paint.sky(`resolve(import.meta.dirname, '${dir}')`)}.`,
499
+ [1223]: (dir) => `${paint.path(dir)} is relative to ${paint.bold("root")}, but nothing set ${paint.bold("root")} in this process. The ${paint.bold("seedcord")} CLI sets it, but a plain script or a test doesn't. Pass an absolute path there, like ${paint.sky(`resolve(import.meta.dirname, '${dir}')`)}.`,
437
500
  [1225]: (dir, root) => `${paint.path(dir)} was not a folder under ${paint.bold("root")} (${paint.path(root)}) or in ${paint.bold("files")} when ${paint.bold("seedcord build")} ran, so the build holds none of its files. Create the folder, then build again.`,
438
501
  [1230]: (dir) => `${paint.bold("readFiles")} was called on ${paint.path(dir)}, which is outside every folder in ${paint.bold("files")} in seedcord.config.ts. ${paint.bold("seedcord build")} bundles non-code files from only those folders. Add it to ${paint.bold("files")}, like ${paint.sky("files: ['./locales']")}.`,
439
502
  [1231]: (dir) => `${paint.path(dir)} is in a folder ${paint.bold("seedcord build")} skips, so a built bot holds none of its files. The build skips dot-folders, node_modules, outDir, the logs folder beside seedcord.config.ts and project files like package.json. Move the files to a folder outside those.`,
503
+ [1232]: () => `${paint.bold("collection.entries()")} reads the key list of the Keyv store in ${paint.bold("config.kv")}, but that store can't list its keys. Cache adapters like ${paint.bold("@keyv/memcache")} never can. Pass an adapter that can, like ${paint.bold("@keyv/redis")} or ${paint.bold("@keyv/sqlite")}.`,
504
+ [1234]: (operation, key) => `The driver in ${paint.bold("config.kv")} failed to ${operation} ${paint.sky(key)}. Check that the storage it connects to is reachable.`,
505
+ [1233]: (plugin) => `${paint.bold(plugin)} read ${paint.bold("this.kv")} on an instance that ${paint.bold("attach()")} didn't build. ${paint.bold("this.kv")} stores a plugin's records under its attach key, which only ${paint.bold("attach()")} gives it. Attach the class with ${paint.bold(`seedcord.attach('key', ${plugin})`)}.`,
440
506
  [1215]: (head, key) => `${paint.bold(head)} is already taken on this bot, so ${paint.sky(key)} cannot nest under it. Pick another group name.`,
441
507
  [1217]: (key, reason) => `${paint.sky(key)} ${reason} Write a group and a plugin name around one dot, like 'services.users'.`,
442
508
  [1218]: (plugin) => `${paint.sky(plugin)} doesn't extend the ${paint.bold("Plugin")} class your bot uses. That usually means two copies of ${paint.bold("@seedcord/core")} are installed. Update the plugin and your ${paint.bold("@seedcord")} packages to versions that need the same ${paint.bold("@seedcord/core")}. Your package manager can list each installed copy and the package that pulled it in.`,
@@ -474,7 +540,7 @@ const messages = {
474
540
  [1606]: (prefix, length) => `A customId encoded by ${quoted(prefix)} is ${length} characters, but Discord allows at most 100. Shorten the prefix, or move a field out of the customId.`,
475
541
  [1607]: (className) => `${paint.sky(className)} is missing its route decorator. Add the one that matches its base, for example ${paint.bold("@ButtonRoute")} or ${paint.bold("@UserMenuRoute")}.`,
476
542
  [1608]: (handler, kind, value) => `${paint.bold(handler)}'s match() has no arm for the ${kind} ${quoted(value)}. Add one to the object you pass to match().`,
477
- [1609]: (handler, read) => `${paint.sky(handler)} read ${paint.bold(read)}, but it was constructed without the name of the event that fired. The event controller passes that name. A handler or middleware you construct yourself takes it as the fourth constructor argument.`,
543
+ [1609]: (handler, read) => `${paint.sky(handler)} read ${paint.bold(read)}, but it was constructed without an event name. The event controller passes that name. A handler or middleware you construct yourself takes it as the fourth constructor argument.`,
478
544
  [1610]: () => "Discord sent an autocomplete payload with no focused option.",
479
545
  [1611]: (customId) => `The submitted modal carries no field with the custom id ${quoted(customId)}. Check it against the id you gave the component when you built the modal.`,
480
546
  [1612]: (customId, kind, getter) => getter ? `The modal field ${quoted(customId)} holds ${kind}. Read it with ${paint.bold(`${getter}()`)}.` : `The modal field ${quoted(customId)} holds ${kind}, but none of the getters read that kind.`,
@@ -535,6 +601,10 @@ const messages = {
535
601
  [3140]: (folder, problem) => `${paint.bold("files")} in seedcord.config.ts lists ${paint.path(folder)}, ${listedFolderProblems[problem]}`,
536
602
  [3141]: (configDir, pid, startedAt, lockFile) => `Another ${paint.bold("seedcord dev")} is running this bot's application from ${paint.path(configDir)} (pid ${pid}, started ${startedAt}). Two dev sessions on one application overwrite each other's commands and interactions endpoint. Press ${paint.bold("q")} in that session, or delete ${paint.path(lockFile)} if it is no longer running.`,
537
603
  [3142]: (folder) => `Another user owns ${paint.path(folder)}, the folder ${paint.bold("seedcord dev")} writes its session locks to. That account could write a lock there that blocks your dev sessions. Ask that user or an admin to delete the folder, then start ${paint.bold("seedcord dev")} again.`,
604
+ [3143]: (plugin, key, reason) => `The ${paint.bold("codegen()")} of the plugin attached at ${paint.sky(key)} (${paint.sky(plugin)}) threw. ${sentence(reason)} ${paint.bold("seedcord codegen")} calls ${paint.bold("codegen()")} without running ${paint.bold("init()")} first, so read only constructor state and files in it.`,
605
+ [3144]: (plugin, key) => `The plugin attached at ${paint.sky(key)} (${paint.sky(plugin)}) needs an id because it has a ${paint.bold("codegen()")}. Add ${paint.bold("static readonly id = '<your package name>'")} to the class.`,
606
+ [3145]: (id, key, path, value) => `The ${paint.bold("codegen()")} of the plugin attached at ${paint.sky(key)} (${paint.sky(id)}) returned ${value} at ${paint.bold(path)}. Codegen can't write that value as a type. It writes plain data, and classes or objects that a project file or the plugin's package exports. Export the value from a file, or return plain data.`,
607
+ [3146]: (id, first, second, path) => `The plugins attached at ${paint.sky(first)} and ${paint.sky(second)} are both ${paint.bold(id)}, and their ${paint.bold("codegen()")} results differ at ${paint.bold(path)}. Every attachment of one plugin shares one type, so both have to return the same value there. Change that value in the files one of them reads, or attach the plugin once.`,
538
608
  [3119]: (outputPath) => `${paint.path(outputPath)} is out of date. Run ${paint.bold("seedcord codegen")} and commit it.`,
539
609
  [3121]: (cloudflareConfig, tsconfig) => `${paint.path(cloudflareConfig)} makes this an edge bot, but ${paint.path(tsconfig)} leaves out ${paint.bold("\"customConditions\": [\"workerd\"]")}. Add it to compilerOptions for an edge bot, or set ${paint.bold("build.tsconfig")} to the tsconfig that holds it. For a node bot, move ${paint.path(cloudflareConfig)} out of this folder.`,
540
610
  [3122]: (tsconfig, configDir) => `${paint.path(tsconfig)} sets the ${paint.bold("workerd")} condition, which only an edge bot uses, but ${paint.path(configDir)} has no ${paint.path("cloudflare.config.ts")}. Add one for an edge bot. For a node bot, remove ${paint.bold("\"workerd\"")} from customConditions.`,
@@ -553,7 +623,23 @@ const messages = {
553
623
  [3202]: (flag, reason) => `--${flag}: ${reason}`,
554
624
  [3203]: (reason) => `${reason}\nRun with --help for the flag list.`,
555
625
  [3204]: (target) => `${paint.path(target)} already has files in it. Pick an empty directory or a name that does not exist yet.`,
556
- [3205]: (command, reason) => `${paint.bold(command)} failed.\n${reason}`
626
+ [3205]: (command, reason) => `${paint.bold(command)} failed.\n${reason}`,
627
+ [3301]: (name) => `${paint.bold(JSON.stringify(name))} can't be a file name. Start it with a letter and use only letters, digits, spaces, - and _, like ${paint.bold("RollDice")}. Put folders in front with /, like ${paint.bold("fun/RollDice")}.`,
628
+ [3302]: (template, folder, count) => `${paint.bold(`importOf "${folder}"`)} in the ${paint.bold(template)} template needs exactly one ${paint.path(".hbs")} file in the template's ${paint.path(folder)} folder. That folder holds ${count}. Point importOf at a folder with one template file.`,
629
+ [3303]: (template, value, first, second) => {
630
+ const uses = {
631
+ text: "prints it",
632
+ list: `loops over it with ${paint.bold("#each")}`,
633
+ object: `reads a field from it, like ${paint.bold(`${value}.name`)}`
634
+ };
635
+ return `The ${paint.bold(template)} template uses ${paint.bold(value)} two ways. It ${uses[first]}, and it also ${uses[second]}. Give one of the two uses its own name.`;
636
+ },
637
+ [3304]: (file, from, reason) => `Handlebars could not render ${paint.path(file)} from ${paint.bold(from)}.\n${reason}\nFix that template file.`,
638
+ [3305]: (template, value) => `The ${paint.bold(template)} template calls ${paint.bold("lookup")} on ${paint.bold(value)} without a quoted key. seedcord make can't tell which field of ${paint.bold(value)} to ask for. Give lookup a quoted key like ${paint.bold(`{{lookup ${value} "title"}}`)}, or map the value in a helper under ${paint.bold("make.helpers")} in seedcord.config.ts.`,
639
+ [3306]: () => `${paint.bold("seedcord make")} asks for a template, a name and each value in a terminal. Run it from a terminal with ${paint.bold("CI")} unset.`,
640
+ [3307]: (folder) => `Found no templates in ${paint.path(folder)} or in the installed plugins. Each folder inside ${paint.path(folder)} is one template. ${paint.sky(PRODUCTION_SITES.guide.at("tooling/make"))} shows how to write one and where to copy the starters from.`,
641
+ [3308]: (path, takenByTemplate) => takenByTemplate === void 0 ? `${paint.path(path)} already exists. Pick another name, or delete that file first.` : `Two files of the ${paint.bold(takenByTemplate)} template would both be written to ${paint.path(path)}. Pick a name that keeps them apart, or give the files different names in the template.`,
642
+ [3309]: (template, partial) => `The ${paint.bold(partial)} partial in the ${paint.bold(template)} template calls itself. seedcord make asks for every value before it writes a file, and it can't tell how many levels a partial that calls itself goes down. Write out each level the template needs.`
557
643
  };
558
644
  /** @internal */
559
645
  function formatSeedcordErrorMessage(code, args) {
@@ -672,5 +758,5 @@ function isSeedcordError(error, type, code) {
672
758
  }
673
759
 
674
760
  //#endregion
675
- export { isSeedcordError as a, paint as c, SeedcordErrorCode as d, SeedcordTypeError as i, setColorLevel as l, SeedcordError as n, BRAND as o, SeedcordRangeError as r, WORDMARK as s, SeedcordAggregateError as t, displayPath as u };
676
- //# sourceMappingURL=SeedcordError-D9SmwpVL.mjs.map
761
+ export { isSeedcordError as a, setColorLevel as c, SeedcordTypeError as i, displayPath as l, SeedcordError as n, WORDMARK as o, SeedcordRangeError as r, paint as s, SeedcordAggregateError as t, SeedcordErrorCode as u };
762
+ //# sourceMappingURL=SeedcordError-BvEoyypY.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SeedcordError-BvEoyypY.mjs","names":[],"sources":["../src/ErrorCodes.ts","../../../tooling/brand/dist/index.mjs","../src/displayPath.ts","../src/palette.ts","../src/messageParts.ts","../src/messageText.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 /** Two or more configured emojis failed to resolve at startup. */\n ConfigEmojiUnresolved = 1001,\n /** A configured emoji is neither a name nor a `[name, guildId]` pair. */\n ConfigEmojiInvalid = 1002,\n /** The application or guild a configured emoji points at has no emoji with that name. */\n ConfigEmojiNotFound = 1003,\n /** Reading the emojis of the application or guild a configured emoji points at failed. */\n ConfigEmojiSourceUnreadable = 1004,\n /** Discord has no webhook at a configured URL, because it was deleted or the id or token is wrong. */\n ConfigWebhookNotFound = 1005,\n /** A required environment variable is unset. */\n ConfigMissingEnv = 1006,\n /** An environment variable is set to a value seedcord cannot use. */\n ConfigInvalidEnv = 1007,\n /** A command that runs in guilds is registered without the `Guilds` intent, so discord.js caches no guild. */\n MissingGuildsIntent = 1008,\n /** The running Node or Bun is older than the range seedcord declares in `engines`. */\n UnsupportedRuntimeVersion = 1009,\n /** An edge config sets a REST sweeper interval. */\n ConfigEdgeRestSweeper = 1010,\n /** Another process already listens on the port seedcord tries to listen on. */\n PortInUse = 1011,\n\n /** A startup task was added or removed while startup ran, or added after it finished. */\n LifecycleTaskChangeRejected = 1101,\n /** A lifecycle call got a phase that is not a member of `StartupPhase` or `ShutdownPhase`. */\n LifecycleUnknownPhase = 1102,\n /** One or more tasks failed during a startup phase. */\n LifecyclePhaseFailures = 1103,\n /** A lifecycle task ran past its timeout. */\n LifecycleTaskTimeout = 1104,\n /** A host whose startup failed was started again. */\n LifecycleRestartAfterFailure = 1105,\n /** A shutdown deadline or a plugin's lifecycle timeout is zero, negative, or not finite. */\n LifecycleInvalidTimeout = 1106,\n\n /** A second Seedcord instance was constructed while one already exists. */\n CoreSingletonViolation = 1201,\n /** A plugin was attached after the bot started. */\n CorePluginAfterInit = 1202,\n /** A plugin was attached under a key another plugin already uses. */\n CorePluginKeyExists = 1203,\n /** The bot's own role is missing from the guild's role cache. */\n CoreBotRoleMissing = 1204,\n /** A bot controller was constructed without the folder that holds its handlers. */\n CoreControllerPathMissing = 1205,\n /** seedcord could not import a file in the bot or in the CLI. */\n CoreImportFailed = 1206,\n /** A file or folder that seedcord reads could not be read. */\n CorePathUnreadable = 1207,\n /** A plugin was attached under a key that the framework logs on. */\n CorePluginReservedChannel = 1208,\n /** The application id was read before startup resolved it. */\n CoreApplicationUnavailable = 1209,\n /** A generated accessor like `Emojis` or `Commands` was read for a key that has no value yet. */\n CoreAccessorUnresolved = 1210,\n /** A shutdown task was added on an edge bot. Cloudflare stops an isolate without a shutdown hook. */\n CoreLifecycleUnavailable = 1211,\n /** `emit` was called on the bus. It calls the listeners and skips every subscriber. */\n CoreBusEmitUnavailable = 1212,\n /** A command registers to the `'config'` guilds while `commands.guilds` is empty. */\n CoreCommandGuildsEmpty = 1213,\n /** Discord refused the command deploy for one guild. */\n CoreCommandGuildDeployFailed = 1214,\n /** A plugin was attached under a group name the bot already uses. */\n CorePluginGroupTaken = 1215,\n /** A plugin was attached at a name that holds a group of plugins. */\n CorePluginKeyHoldsGroup = 1216,\n /** A plugin key is empty, has an empty part, or has more than one dot. */\n CorePluginKeyMalformed = 1217,\n /** An attached plugin extends the `Plugin` class of a different copy of `@seedcord/core`. */\n CorePluginFromOtherCore = 1218,\n /** A folder or the `build.start` file is outside `root`. */\n CorePathOutsideRoot = 1219,\n /** A plugin declares a transport or runtime the bot doesn't use. */\n CorePluginScopeMismatch = 1220,\n /** A node http bot got a request through `fetch` before `start()` was called. */\n CoreFetchBeforeStart = 1221,\n /** An edge worker got a POST without the ids that `seedcord build` writes into it. */\n CoreEdgeUnbuilt = 1222,\n /** A relative folder was read in a process that never got the bot's `root`. */\n CoreDirectoryRootUnknown = 1223,\n /** Discord refused the global command deploy. */\n CoreCommandGlobalDeployFailed = 1224,\n /** A built bot read a folder that did not exist under `root` when `seedcord build` ran. */\n CoreDirectoryNotBuilt = 1225,\n /** A webhook sender was constructed with a URL that is not a Discord webhook URL. */\n CoreWebhookUrlInvalid = 1226,\n /** Reading from Discord with `DISCORD_BOT_TOKEN` failed, like the application, its public key, or its commands. */\n CoreDiscordReadFailed = 1227,\n /** Two routes, commands, migrations, or customId fields have the same name, or two code files build to the same file. */\n CoreDuplicateName = 1228,\n /** A Vite plugin from `vitePlugins` threw while Vite started or loaded a file, or failed when seedcord called `vitePlugins`. */\n CoreVitePluginThrew = 1229,\n /** `readFiles` read a folder that `files` in `seedcord.config.ts` leaves out. */\n CoreDirectoryNotListed = 1230,\n /** A folder is inside one that `seedcord build` skips, like a dot-folder, `node_modules`, `outDir` or the logs folder. */\n CoreDirectorySkipped = 1231,\n /** `collection.entries()` ran on a Keyv store in `config.kv` that can't list its keys. */\n CoreKvKeysUnsupported = 1232,\n /** A plugin built with `new` outside `attach()` read `this.kv`. */\n CorePluginKvOutsideAttach = 1233,\n /** The driver in `config.kv` threw, or reported a write as failed. */\n CoreKvDriverFailed = 1234,\n\n /** A command class carries `@RegisterCommand` twice. */\n DecoratorCommandAlreadyRegistered = 1301,\n /** `@RegisterCommand('global')` was given guild ids. */\n DecoratorCommandGlobalWithGuilds = 1302,\n /** `@RegisterCommand('guild')` was given no guild ids. */\n DecoratorCommandGuildWithoutGuilds = 1303,\n /** A middleware decorator sets a priority that is not a finite number. */\n DecoratorInvalidMiddlewarePriority = 1304,\n /** A `WebhookLog` subclass is missing its `@WebhookUrl` decorator. */\n DecoratorWebhookUrlMissing = 1305,\n /** A middleware decorator got an empty filter array. */\n DecoratorEmptyMiddlewareFilter = 1306,\n\n /** A reply method was called in an ack state where Discord rejects it. */\n ReplyIllegalAckState = 1501,\n /** A reply component threw while seedcord serialized it. */\n ReplyComponentSerialization = 1502,\n /** `edit()` got a message that the interaction did not send. */\n ReplyForeignEditTarget = 1503,\n /** `update()` or `deferUpdate()` was called on a modal that has no source message. */\n ReplyUpdateWithoutSource = 1504,\n /** Discord's response to a `withResponse` callback has no message in it. */\n ReplyCallbackMissingMessage = 1505,\n\n /** A customId prefix is empty, or holds a colon or a control character. */\n CustomIdInvalidPrefix = 1601,\n /** A customId field name looks like an integer. JS reorders integer keys. */\n CustomIdReservedFieldName = 1602,\n /** A `oneOf()` or `someOf()` field was declared with no choices. */\n CustomIdEmptyChoices = 1603,\n /** An `int()` field was declared with a min greater than its max. */\n CustomIdInvalidBounds = 1604,\n /** `encode()` got a value that doesn't fit its field. */\n CustomIdValueRejected = 1605,\n /** An encoded customId is longer than the 100 characters Discord allows. */\n CustomIdWireTooLong = 1606,\n /** A component handler is missing the route decorator that matches its base. */\n CustomIdHandlerRouteMissing = 1607,\n /** A handler's `match()` has no arm for the current route, field, event, or command. */\n MatchArmMissing = 1608,\n /** An event handler or middleware read the event name but was constructed without one. */\n EventNameUnavailable = 1609,\n /** Discord sent an autocomplete payload with no focused option. */\n AutocompleteNoFocusedOption = 1610,\n /** The submitted modal has no field with the requested custom id. */\n ModalFieldNotFound = 1611,\n /** A modal field getter was called on a field of another kind. */\n ModalFieldWrongKind = 1612,\n /** A modal field read as required has nothing picked. */\n ModalFieldEmpty = 1613,\n /** A channel select returned a channel whose type the `getSelectedChannels()` call excludes. */\n ModalFieldChannelType = 1614,\n /** A customId was encoded under an older shape of the same definition. */\n CustomIdWireStale = 1615,\n /** A customId is corrupt, truncated, or was encoded by a different definition. */\n CustomIdWireInvalid = 1616,\n /** `dispatch.require()` was called for a key that nothing set on this dispatch. */\n DispatchStateMissing = 1617,\n\n /** A `Cooldown` gate got a duration that doesn't parse, or one of zero or less. */\n GateInvalidCooldownDuration = 1701,\n\n /** A paginator got a `perPage` that is not a positive integer. */\n PaginationInvalidPerPage = 1801,\n /** A control row has no controls, or more than the five buttons Discord allows. */\n PaginationControlCount = 1802,\n /** A control row lists the same control twice. Its two buttons would share a custom_id. */\n PaginationDuplicateControls = 1803,\n\n /** A color value doesn't resolve to a Discord color integer. */\n ColorUnresolvable = 1901,\n /** A resolved color is outside Discord's range of 0x000000 to 0xffffff. */\n ColorOutOfRange = 1902,\n\n /** `renderTable` got a `maxWidth` or `padding` outside the values it accepts. */\n UtilTableOptionInvalid = 1951,\n /** `assertNever` ran with a value that its types ruled out. */\n UtilUnhandledUnionMember = 1952,\n\n /** `WinstonFileSink` got a `filename` with a folder in it. File logs always go in the logs folder. */\n LoggerFileNameHasFolder = 1971,\n\n /** A plugin's constructor called `rejectOptions` on the options it got. */\n PluginOptionsRejected = 2001,\n /** Two or more plugins threw while disposing. */\n PluginDisposeFailures = 2002,\n /** A plugin service class is missing the decorator that registers it. */\n PluginServiceDecoratorMissing = 2003,\n /** A plugin's `services` was read before the plugin finished `init()`. */\n PluginServicesNotReady = 2004,\n /** A plugin could not connect to the service it wraps. */\n PluginConnectionFailed = 2005,\n /** A plugin could not close its connection cleanly during shutdown. */\n PluginDisconnectFailed = 2006,\n\n /** Mongoose threw while building a model, usually for a duplicate model name or a missing schema. */\n PluginMongooseModelCreationFailed = 2101,\n /** A mongoose service was registered with an empty model name. */\n PluginMongooseModelNameMissing = 2102,\n\n /** A kysely service class has no table. */\n PluginKyselyServiceTableMissing = 2201,\n /** A migration run got a step count that is not a non-negative integer. */\n PluginKyselyInvalidStepCount = 2202,\n /** A migration run got a direction other than `up` or `down`. */\n PluginKyselyUnknownDirection = 2203,\n /** A file in the migrations folder has no `up` function. */\n PluginKyselyInvalidMigrationModule = 2204,\n /** A migration failed with a thrown value that is not an `Error`. */\n PluginKyselyNonErrorFailure = 2205,\n /** Creating the target Postgres database failed. */\n PluginKyselyBootstrapFailed = 2206,\n\n /** Someone pressed Ctrl-C at a prompt in `seedcord` or `create-seedcord`. */\n CliCancelled = 3001,\n\n /** The seedcord config file's default export is not an object. */\n CliConfigInvalidExport = 3101,\n /** No seedcord config file exists in the folder the CLI searched. */\n CliConfigNotFound = 3102,\n /** The file that `instance` or `build.start` in the seedcord config points at does not exist. */\n CliFileNotFound = 3103,\n /** The instance file's default export is not a constructed `Seedcord`. */\n CliInstanceInvalid = 3104,\n /** The bot threw during startup. */\n CliStartFailed = 3105,\n /** `build.tsconfig` points at a missing file, or it is unset and the config's folder has no `tsconfig.json`. */\n CliTsconfigNotFound = 3106,\n /** `seedcord build` found type errors. */\n CliBuildFailed = 3107,\n /** `commands clean` or `commands purge` ran without a flag that picks where it deletes. */\n CliNoScopeGiven = 3108,\n /** cloudflared never reported a quick tunnel hostname. */\n CliTunnelUrlUnavailable = 3109,\n /** Discord rejected the tunnel URL as an interactions endpoint. */\n CliTunnelNotVerified = 3110,\n /** The tunnel URL never answered its health probe. */\n CliTunnelUnreachable = 3111,\n /** A field in the seedcord config is missing or has the wrong shape. */\n CliConfigInvalidField = 3112,\n /** A class carrying `@RegisterCommand` threw while seedcord constructed it. */\n CliCommandConstructorThrew = 3113,\n /** Vite threw while bundling the bot. */\n CliBundleFailed = 3114,\n /** `build.outDir` is `root` or a folder that contains it. */\n CliConfigOutDirDeletesRoot = 3115,\n /** The project is missing a dev dependency the CLI runs, like `typescript` or `@cloudflare/vite-plugin`. */\n CliDependencyMissing = 3116,\n /** `build.outDir` already has other files in it. */\n CliBuildOutDirNotEmpty = 3117,\n /** One CLI step found two or more problems. Each one is in the error's `errors`. */\n CliProblems = 3118,\n /** `seedcord codegen --check` found the committed augmentations out of date. */\n CliCodegenOutOfDate = 3119,\n /** A file or folder in the project has a `#` in its path. */\n CliPathHasHash = 3120,\n /** An edge bot's tsconfig is missing the `workerd` condition. */\n CliEdgeWithoutWorkerdCondition = 3121,\n /** A bot with no `cloudflare.config.ts` sets the `workerd` condition in its tsconfig. */\n CliWorkerdConditionWithoutCloudflareConfig = 3122,\n /** TypeScript could not read the project's tsconfig, or Cloudflare's config loader could not read `cloudflare.config.ts`. */\n CliConfigFileUnreadable = 3123,\n /** The CLI could not start the TypeScript compiler. */\n CliTypescriptNotStarted = 3124,\n /** A config file sets a field this bot can't set, like `entrypoint` in an edge bot's `cloudflare.config.ts`. */\n CliConfigFieldUnused = 3125,\n /** An edge bot's `compatibilityDate` is older than Cloudflare's Node compat default, and no flag turns it on. */\n CliEdgeCompatDateTooOld = 3126,\n /** An edge bot sets `no_nodejs_compat`. */\n CliEdgeNodeCompatOff = 3127,\n /** The build could not start the edge worker in workerd. */\n CliEdgeBootFailed = 3128,\n /** An edge bot's `root` holds its seedcord config. */\n CliEdgeRootHoldsConfig = 3129,\n /** An edge build found commands in code that have no deployed id on Discord. */\n CliEdgeCommandsNotDeployed = 3130,\n /** Something called the dev runtime before `start()` finished or after `stop()`. This is a bug in seedcord. */\n CliDevRuntimeNotRunning = 3131,\n /** `seedcord commands deploy` ran on a bot whose `commands.path` is `null`. */\n CliDeployNoCommandsFolder = 3132,\n /** `seedcord commands deploy` ran without `--yes` where it cannot ask first. */\n CliDeployNeedsYes = 3133,\n /** A class carrying `@RegisterCommand` builds a component that is not a command or a context menu. */\n CliCommandNotACommand = 3134,\n /** `seedcord commands clean` or `purge` could not delete some of the commands it picked. */\n CliCommandsNotDeleted = 3135,\n /** The CLI ran on Bun for an edge bot. */\n CliEdgeOnBun = 3136,\n /** An edge bot's `cloudflare.config.ts` sets no `worker`. */\n CliEdgeNoWorker = 3137,\n /** The running `seedcord` is a different install from the project's own. */\n CliNotProjectInstall = 3138,\n /** Vite's environments leave out the one seedcord runs the bot in. */\n CliViteEnvironmentMissing = 3139,\n /** A folder that `files` in `seedcord.config.ts` lists is missing or is a file. */\n CliListedFolderUnusable = 3140,\n /** Another `seedcord dev` already runs a bot on the same Discord application. */\n CliDevAlreadyRunning = 3141,\n /** The folder that holds the dev session locks belongs to another user. */\n CliDevLockFolderNotOwned = 3142,\n /** A plugin's `codegen()` threw. */\n CliPluginCodegenThrew = 3143,\n /** A plugin class with a `codegen()` is missing its `static readonly id`. */\n CliPluginCodegenNoId = 3144,\n /** A plugin's `codegen()` returned a value that codegen can't write as a type. */\n CliPluginCodegenValue = 3145,\n /** Two attachments of one plugin class returned different values at one key from `codegen()`. */\n CliPluginCodegenConflict = 3146,\n\n /** A flag answers a question that the earlier answers skip. */\n CreateFlagNotApplicable = 3201,\n /** A flag has a value its question rejects. */\n CreateInvalidAnswer = 3202,\n /** The command line did not parse. */\n CreateBadUsage = 3203,\n /** The target path already has files in it. */\n CreateTargetNotEmpty = 3204,\n /** A command that create-seedcord ran exited non-zero. */\n CreateStepFailed = 3205,\n\n /** The name given to `seedcord make` can't become a file name. */\n MakeInvalidName = 3301,\n /** A template calls `importOf` on a folder that doesn't hold exactly one template file. */\n MakeImportOfUnmatched = 3302,\n /** A template uses one value as two of text, a list, and an entry with fields. */\n MakeValueUsedTwoWays = 3303,\n /** Handlebars could not parse or render a template file. */\n MakeTemplateFailed = 3304,\n /** A template calls `lookup` with a key that isn't quoted text. */\n MakeLookupDynamicKey = 3305,\n /** `seedcord make` ran without a terminal to ask its questions in. */\n MakeNeedsTerminal = 3306,\n /** `seedcord make` found no templates in the bot or its plugins. */\n MakeNoTemplates = 3307,\n /** A path `seedcord make` would write to is taken, by a file on disk or by another file of the same template. */\n MakePathTaken = 3308,\n /** A template's partial calls itself, so `seedcord make` can't tell how many levels to ask for. */\n MakePartialCallsItself = 3309\n}\n","//#region src/colors.ts\nconst BRAND_COLORS = {\n\tpith: \"#f8f6e8\",\n\tseedDark: \"#2d3328\",\n\tflesh: \"#f04e36\",\n\tfleshDeep: \"#c8341f\",\n\trind: \"#6fab49\",\n\trindDeep: \"#4d7d33\"\n};\n\n//#endregion\n//#region src/sites.ts\nvar SiteAddress = class {\n\turl;\n\tconstructor(url) {\n\t\tthis.url = url.replace(/\\/+$/, \"\");\n\t}\n\tget label() {\n\t\treturn this.url.replace(/^[a-z]+:\\/\\//, \"\");\n\t}\n\tget path() {\n\t\treturn new URL(this.url).pathname.replace(/\\/$/, \"\");\n\t}\n\tat(path) {\n\t\tif (path === \"\") return this.url;\n\t\treturn `${this.url}/${path.replace(/^\\/+/, \"\")}`;\n\t}\n};\nconst PRODUCTION_ORIGIN = \"https://seedcord.org\";\nconst PRODUCTION_SITES = {\n\thome: new SiteAddress(PRODUCTION_ORIGIN),\n\tguide: new SiteAddress(`${PRODUCTION_ORIGIN}/guide`),\n\tdocs: new SiteAddress(`${PRODUCTION_ORIGIN}/docs`)\n};\n\n//#endregion\nexport { BRAND_COLORS, PRODUCTION_ORIGIN, PRODUCTION_SITES, SiteAddress };\n//# sourceMappingURL=index.mjs.map","interface DisplayPathOptions {\n // without one, the working directory itself prints as ./\n prefix?: string;\n}\n\n// the edge build of this package can't import node:path\nexport function displayPath(rawPath: string, { prefix }: DisplayPathOptions = {}): string {\n const path = forwardSlashes(rawPath.length > 1 ? rawPath.replace(/[/\\\\]+$/, '') : rawPath);\n if (typeof process === 'undefined' || typeof process.cwd !== 'function') return path;\n\n const cwd = forwardSlashes(process.cwd());\n\n if (path === cwd) return prefix ?? './';\n return path.startsWith(`${cwd}/`) ? `${prefix ?? ''}${path.slice(cwd.length + 1)}` : path;\n}\n\nfunction forwardSlashes(path: string): string {\n return path.replaceAll('\\\\', '/');\n}\n","import { BRAND_COLORS } from '@seedcord/brand';\nimport chalk from 'chalk';\n\nimport { displayPath } from './displayPath';\n\nimport type { ColorSupportLevel } from 'chalk';\n\n// chalk turns color on only for a chromium user agent outside node\nexport function setColorLevel(level: ColorSupportLevel): void {\n chalk.level = level;\n}\n\nconst SKY = '#8fc7ff';\n\n// truecolor because a terminal theme remaps chalk's 16-color names (blue turns orange in monokai)\n// chalk.hex reads the color level once, when it runs. a getter picks up a level set later, like the edge worker's\nexport const paint = {\n // what the line is about, one per line\n get sky() {\n return chalk.hex(SKY);\n },\n path: (path: string) => chalk.hex(SKY)(displayPath(path)),\n // a count\n get iris() {\n return chalk.hex('#e29bff');\n },\n // success\n get mint() {\n return chalk.hex('#66d98a');\n },\n // go do something about this\n get amber() {\n return chalk.hex('#ffc061');\n },\n // failure\n get coral() {\n return chalk.hex('#ff6b85');\n },\n // brand marks\n get flesh() {\n return chalk.hex(BRAND_COLORS.flesh);\n },\n get rind() {\n return chalk.hex(BRAND_COLORS.rind);\n },\n get pith() {\n return chalk.hex(BRAND_COLORS.pith);\n },\n // context around the subject\n mute: chalk.dim,\n\n check: '✔︎', // U+FE0E to prevent emoji font\n cross: '✘',\n\n // weight and shape\n bold: chalk.bold,\n italic: chalk.italic,\n underline: chalk.underline\n} as const;\n\nexport const WORDMARK = `${paint.flesh.bold('seed')}${paint.rind.bold('cord')}`;\n","import { paint } from './palette';\n\nexport interface VitePluginPlace {\n hook?: string | undefined;\n // only load and transform run on a module\n loading?: { kind: 'file'; path: string } | { kind: 'virtual'; id: string } | undefined;\n}\n\nexport function placeText(hook: string, loading: VitePluginPlace['loading']): string {\n const inHook = `in its ${paint.bold(hook)} hook`;\n if (loading === undefined) return inHook;\n const shown = loading.kind === 'file' ? paint.path(loading.path) : paint.bold(loading.id);\n return `${inHook} while loading ${shown}`;\n}\n\nexport function vitePluginFix({ loading }: VitePluginPlace): string {\n if (loading?.kind !== 'file') return 'Check the options you pass the plugin.';\n return `Fix ${paint.path(loading.path)}, or check the options you pass the plugin if that file looks right.`;\n}\n\nexport const listedFolderProblems = {\n missing: `which does not exist. Create it, or take it out of ${paint.bold('files')}.`,\n file: `which is a file. ${paint.bold('files')} takes folders. List the folder that holds it.`,\n outsideProject: `which is outside the folder that holds seedcord.config.ts. Move it into that folder and list its new path.`\n};\n\n// the edge worker sets chalk's color level after this module loads\nexport const token = (): string => paint.bold('DISCORD_BOT_TOKEN');\n\nconst BAD_REQUEST = 400;\nconst UNAUTHORIZED = 401;\n\nexport function deployFix(status: number | undefined, otherwise: string): string {\n if (status === UNAUTHORIZED) return `Check that ${token()} is still valid.`;\n if (status === BAD_REQUEST) return \"Check that each command's name, description and options are valid.\";\n return otherwise;\n}\n","import { paint } from './palette';\n\n// a reason from a caught error may or may not end in a period\nexport function sentence(text: string): string {\n // a multi-line reason usually ends in a code frame\n if (text.includes('\\n')) return text;\n return /[.!?]$/.test(text) ? text : `${text}.`;\n}\n\nexport function reasonThen(reason: string, next: string): string {\n return `${sentence(reason)}${reason.includes('\\n') ? '\\n' : ' '}${next}`;\n}\n\n// @seedcord/utils depends on this package, so its pluralize is out of reach here\nconst plurals = new Intl.PluralRules('en');\nexport const allOf = new Intl.ListFormat('en', { type: 'conjunction' });\nexport const oneOf = new Intl.ListFormat('en', { type: 'disjunction' });\n\nexport function isOne(count: number): boolean {\n return plurals.select(count) === 'one';\n}\n\nexport function counted(count: number, one: string, many: string): string {\n return `${count} ${isOne(count) ? one : many}`;\n}\n\nexport const quoted = (value: string): string => paint.sky(JSON.stringify(value));\n","/* eslint-disable max-lines -- the satisfies check below covers every code only while all messages are in one map */\nimport { PRODUCTION_SITES } from '@seedcord/brand';\n\nimport { SeedcordErrorCode } from './ErrorCodes';\nimport { deployFix, listedFolderProblems, placeText, token, vitePluginFix } from './messageParts';\nimport { allOf, counted, isOne, oneOf, quoted, reasonThen, sentence } from './messageText';\nimport { paint } from './palette';\n\nimport type { VitePluginPlace } from './messageParts';\n\n/** @internal */\nconst messages = {\n [SeedcordErrorCode.ConfigEmojiUnresolved]: (count: number) =>\n `${paint.iris(count)} configured emojis could not be resolved. Each one is listed below.`,\n [SeedcordErrorCode.ConfigEmojiInvalid]: (key: string) =>\n `The emoji ${paint.sky(key)} in ${paint.bold('bot.emojis')} has a value seedcord cannot read. Set it to the emoji's name, or to a ${paint.bold('[name, guildId]')} pair for a guild emoji.`,\n [SeedcordErrorCode.ConfigEmojiNotFound]: (key: string, name: string, where: string) =>\n `The emoji ${paint.sky(key)} points at ${paint.bold(name)}, but ${where} has no emoji with that name. Check the spelling, or upload the emoji there.`,\n [SeedcordErrorCode.ConfigEmojiSourceUnreadable]: (\n key: string,\n name: string,\n where: string,\n reason: string,\n fix: string\n ) =>\n `Could not read the emojis in ${where} to resolve ${paint.sky(key)} (${paint.bold(name)}). ${reasonThen(reason, fix)}`,\n [SeedcordErrorCode.ConfigWebhookNotFound]: (envKey: string) =>\n `Discord has no webhook at the URL in ${paint.bold(envKey)}. Someone deleted it, or the id or token in the URL is wrong. Create a webhook and copy its URL.`,\n [SeedcordErrorCode.ConfigMissingEnv]: (name: string) =>\n `${paint.bold(name)} is not set. Add it to your environment or your .env file.`,\n [SeedcordErrorCode.ConfigInvalidEnv]: (name: string, expected: string, why?: string) =>\n `${paint.bold(name)} has a value seedcord cannot use.${why ? ` ${why}` : ''} Set it to ${expected}.`,\n [SeedcordErrorCode.MissingGuildsIntent]: (commands: readonly string[]) =>\n `Add GatewayIntentBits.Guilds to clientOptions.intents. Without it discord.js doesn't cache any guild, so interaction.guild is null inside the ${isOne(commands.length) ? 'command' : 'commands'} ${allOf.format(commands.map((name) => paint.sky(name)))}.`,\n [SeedcordErrorCode.UnsupportedRuntimeVersion]: (runtime: string, required: string, running: string) =>\n `seedcord requires ${runtime} ${required}, but this process runs ${running}. Upgrade ${runtime} before starting the bot.`,\n [SeedcordErrorCode.ConfigEdgeRestSweeper]: (key: string) =>\n `Remove ${paint.sky(`bot.restOptions.${key}`)} from your edge config. A sweeper interval starts a timer at the worker's global scope, where workerd throws.`,\n [SeedcordErrorCode.PortInUse]: (port: number, setting: string, configFile?: string) =>\n `Another process already listens on port ${port}. Stop it, or set ${paint.bold(setting)} in ${configFile ? paint.path(configFile) : 'your Seedcord config'} to a free port.`,\n\n [SeedcordErrorCode.LifecycleTaskChangeRejected]: (action: 'add' | 'remove', startup: 'running' | 'finished') =>\n `${startup === 'running' ? 'Startup is running, so its tasks cannot change.' : 'Startup already finished, so this task would never run.'} ${action === 'add' ? 'Add' : 'Remove'} startup tasks before you call ${paint.bold('start()')}.`,\n [SeedcordErrorCode.LifecycleUnknownPhase]: (phase: unknown) =>\n `${paint.sky(String(phase))} is not a lifecycle phase. Pass a member of ${paint.bold('StartupPhase')} or ${paint.bold('ShutdownPhase')}.`,\n [SeedcordErrorCode.LifecyclePhaseFailures]: (phase: string, failures: number) =>\n `${counted(failures, 'task', 'tasks')} failed in the ${phase} phase. Each one is listed below.`,\n [SeedcordErrorCode.LifecycleTaskTimeout]: (taskName: string, timeout: number) =>\n `Task \"${taskName}\" timed out after ${timeout}ms. Check what it waits on, or give it a longer timeout.`,\n [SeedcordErrorCode.LifecycleRestartAfterFailure]: () =>\n 'Startup failed, so this host cannot start again. Construct a new instance.',\n [SeedcordErrorCode.LifecycleInvalidTimeout]: (setting: string, value: number) =>\n `${paint.bold(setting)} is ${value}. Pass a positive number of milliseconds, or leave it out for the default.`,\n\n [SeedcordErrorCode.CoreSingletonViolation]: () =>\n 'Seedcord can only be constructed once per process. Use the instance you already have.',\n [SeedcordErrorCode.CorePluginAfterInit]: () =>\n 'Cannot attach a plugin once the bot has started. Attach every plugin before start(), or before the first request on an edge bot.',\n [SeedcordErrorCode.CorePluginKeyExists]: (key: string) =>\n `A plugin is already attached at ${paint.sky(key)}. Attach this one under another key.`,\n [SeedcordErrorCode.CoreBotRoleMissing]: (guildId?: string) =>\n `The role cache of ${guildId ? `guild ${paint.sky(guildId)}` : 'this guild'} has no role for the bot. discord.js fills that cache through the Guilds intent, so check that clientOptions.intents includes GatewayIntentBits.Guilds.`,\n [SeedcordErrorCode.CoreControllerPathMissing]: (controllerName: string, pathKind: string) =>\n `${paint.sky(controllerName)} was constructed without a ${pathKind} path. This is a bug in seedcord.`,\n [SeedcordErrorCode.CoreImportFailed]: (file: string, reason: string) =>\n `Could not import ${paint.path(file)}. ${sentence(reason)}`,\n [SeedcordErrorCode.CoreVitePluginThrew]: (\n plugin: string,\n place: VitePluginPlace,\n configFile: string,\n reason: string\n ) =>\n place.hook === undefined\n ? `${paint.sky(plugin)} in ${paint.path(configFile)} failed when seedcord called ${paint.bold('vitePlugins')}. ${reasonThen(reason, 'Check that the package is installed and that its import resolves.')}`\n : `The Vite plugin ${paint.sky(plugin)} from ${paint.bold('vitePlugins')} in ${paint.path(configFile)} threw ${placeText(place.hook, place.loading)}. ${reasonThen(reason, vitePluginFix(place))}`,\n [SeedcordErrorCode.CorePathUnreadable]: (path: string, reason: string) =>\n `Could not read ${paint.path(path)}. ${reasonThen(reason, 'Check that it exists and that this process can read it.')}`,\n [SeedcordErrorCode.CorePathOutsideRoot]: (path: string, root: string) =>\n `${paint.path(path)} is outside ${paint.bold('root')} (${paint.path(root)}). ${paint.bold('seedcord build')} bundles only the files under ${paint.bold('root')}. Move it under ${paint.bold('root')}, or set ${paint.bold('root')} in seedcord.config.ts to a folder that holds it.`,\n [SeedcordErrorCode.CoreDirectoryRootUnknown]: (dir: string) =>\n `${paint.path(dir)} is relative to ${paint.bold('root')}, but nothing set ${paint.bold('root')} in this process. The ${paint.bold('seedcord')} CLI sets it, but a plain script or a test doesn't. Pass an absolute path there, like ${paint.sky(`resolve(import.meta.dirname, '${dir}')`)}.`,\n [SeedcordErrorCode.CoreDirectoryNotBuilt]: (dir: string, root: string) =>\n `${paint.path(dir)} was not a folder under ${paint.bold('root')} (${paint.path(root)}) or in ${paint.bold('files')} when ${paint.bold('seedcord build')} ran, so the build holds none of its files. Create the folder, then build again.`,\n [SeedcordErrorCode.CoreDirectoryNotListed]: (dir: string) =>\n `${paint.bold('readFiles')} was called on ${paint.path(dir)}, which is outside every folder in ${paint.bold('files')} in seedcord.config.ts. ${paint.bold('seedcord build')} bundles non-code files from only those folders. Add it to ${paint.bold('files')}, like ${paint.sky(\"files: ['./locales']\")}.`,\n [SeedcordErrorCode.CoreDirectorySkipped]: (dir: string) =>\n `${paint.path(dir)} is in a folder ${paint.bold('seedcord build')} skips, so a built bot holds none of its files. The build skips dot-folders, node_modules, outDir, the logs folder beside seedcord.config.ts and project files like package.json. Move the files to a folder outside those.`,\n [SeedcordErrorCode.CoreKvKeysUnsupported]: () =>\n `${paint.bold('collection.entries()')} reads the key list of the Keyv store in ${paint.bold('config.kv')}, but that store can't list its keys. Cache adapters like ${paint.bold('@keyv/memcache')} never can. Pass an adapter that can, like ${paint.bold('@keyv/redis')} or ${paint.bold('@keyv/sqlite')}.`,\n [SeedcordErrorCode.CoreKvDriverFailed]: (operation: 'read' | 'write' | 'delete' | 'list', key: string) =>\n `The driver in ${paint.bold('config.kv')} failed to ${operation} ${paint.sky(key)}. Check that the storage it connects to is reachable.`,\n [SeedcordErrorCode.CorePluginKvOutsideAttach]: (plugin: string) =>\n `${paint.bold(plugin)} read ${paint.bold('this.kv')} on an instance that ${paint.bold('attach()')} didn't build. ${paint.bold('this.kv')} stores a plugin's records under its attach key, which only ${paint.bold('attach()')} gives it. Attach the class with ${paint.bold(`seedcord.attach('key', ${plugin})`)}.`,\n [SeedcordErrorCode.CorePluginGroupTaken]: (head: string, key: string) =>\n `${paint.bold(head)} is already taken on this bot, so ${paint.sky(key)} cannot nest under it. Pick another group name.`,\n [SeedcordErrorCode.CorePluginKeyMalformed]: (key: string, reason: string) =>\n `${paint.sky(key)} ${reason} Write a group and a plugin name around one dot, like 'services.users'.`,\n [SeedcordErrorCode.CorePluginFromOtherCore]: (plugin: string) =>\n `${paint.sky(plugin)} doesn't extend the ${paint.bold('Plugin')} class your bot uses. That usually means two copies of ${paint.bold('@seedcord/core')} are installed. Update the plugin and your ${paint.bold('@seedcord')} packages to versions that need the same ${paint.bold('@seedcord/core')}. Your package manager can list each installed copy and the package that pulled it in.`,\n [SeedcordErrorCode.CorePluginScopeMismatch]: (plugin: string, axis: string, declared: string, host: string) =>\n `${paint.sky(plugin)} only runs on the ${paint.bold(declared)} ${axis}, but this bot uses the ${paint.bold(host)} ${axis}. Remove the ${paint.bold('attach')} call, or move the bot to the ${paint.bold(declared)} ${axis}.`,\n [SeedcordErrorCode.CorePluginKeyHoldsGroup]: (key: string) =>\n `${paint.sky(key)} already holds a group of plugins. Attach this one under a name of its own.`,\n [SeedcordErrorCode.CorePluginReservedChannel]: (key: string) =>\n `${paint.sky(key)} is a channel the framework logs on. Attach the plugin under another key.`,\n [SeedcordErrorCode.CoreApplicationUnavailable]: () =>\n \"The bot's application id resolves during startup. You read it before that. Read it inside a handler, inside a plugin's ready(), or after start() resolves. An edge bot resolves it on its first request.\",\n [SeedcordErrorCode.CoreEdgeUnbuilt]: () =>\n `This worker has no public key or command ids. ${paint.bold('seedcord build')} reads them from Discord and writes them into the worker it builds. Deploy that build.`,\n [SeedcordErrorCode.CoreFetchBeforeStart]: () =>\n `${paint.bold('fetch()')} ran before ${paint.bold('start()')}. Call ${paint.bold('await seedcord.start()')} before your server passes requests to ${paint.bold('fetch()')}.`,\n [SeedcordErrorCode.CoreAccessorUnresolved]: (accessor: string, key: string) =>\n `${paint.sky(`${accessor}.${key}`)} has no value yet. ${accessor} fills during startup, but a read at the top of a file runs before that. Read it inside a handler, or after start() resolves.`,\n [SeedcordErrorCode.CoreLifecycleUnavailable]: () =>\n `core.shutdown.addTask() does not work on an edge bot. Cloudflare stops an isolate with no shutdown hook, so a shutdown task would never run. To use shutdown tasks, run the bot on node with new Seedcord(config).start().`,\n [SeedcordErrorCode.CoreBusEmitUnavailable]: (event: string) =>\n `core.bus.emit('${event}') would reach your on() listeners but skip every Subscriber class. Call core.bus.publish('${event}', data) to run both.`,\n [SeedcordErrorCode.CoreCommandGuildsEmpty]: (commandName: string) =>\n `${paint.sky(commandName)} registers to the 'config' guilds while commands.guilds is empty.\\nList the ids under commands.guilds, or pass them to @RegisterCommand('guild', [...]).`,\n [SeedcordErrorCode.CoreCommandGuildDeployFailed]: (guildId: string, reason: string, status?: number) =>\n `Discord refused the command deploy for guild ${paint.sky(guildId)}. ${reasonThen(reason, deployFix(status, 'Check that the id is right, and that your bot is in that server.'))}`,\n [SeedcordErrorCode.CoreCommandGlobalDeployFailed]: (reason: string, status?: number) =>\n `Discord refused the global command deploy. ${reasonThen(reason, deployFix(status, 'Try again, and check discordstatus.com if it keeps failing.'))}`,\n [SeedcordErrorCode.CoreWebhookUrlInvalid]: (className: string) =>\n `${paint.sky(className)} was given a URL that is not a Discord webhook URL. Pass the URL from the channel's Integrations settings, which looks like ${paint.bold('https://discord.com/api/webhooks/<id>/<token>')}.`,\n [SeedcordErrorCode.CoreDiscordReadFailed]: (what: string, reason: string, fix?: string) =>\n `Could not read ${what} from Discord (${reason}). ${fix ?? `Check that ${token()} is still valid.`}`,\n [SeedcordErrorCode.CoreDuplicateName]: (\n kind: string,\n name: string,\n sources: readonly string[] = [],\n note?: string\n ) =>\n `${sources.length > 0 ? `${allOf.format(sources)} define the ${kind} ${quoted(name)}.` : `The ${kind} ${quoted(name)} is defined twice.`}${note ? ` ${note}` : ''} Rename one.`,\n\n [SeedcordErrorCode.DecoratorCommandAlreadyRegistered]: (\n commandName: string,\n existingCall: string,\n requestedCall: string\n ) =>\n `${paint.sky(commandName)} is registered twice, first with ${existingCall}, then with ${requestedCall}. Keep one.`,\n [SeedcordErrorCode.DecoratorCommandGlobalWithGuilds]: (className: string) =>\n `${paint.sky(className)} passes guild ids to ${paint.bold(\"@RegisterCommand('global')\")}. Remove them, or register it with ${paint.bold(\"@RegisterCommand('guild', [...])\")}.`,\n [SeedcordErrorCode.DecoratorCommandGuildWithoutGuilds]: (className: string) =>\n `${paint.sky(className)} uses ${paint.bold(\"@RegisterCommand('guild')\")} with an empty guild list. Pass the guild ids as the second argument.`,\n [SeedcordErrorCode.DecoratorInvalidMiddlewarePriority]: (className: string, priority: string) =>\n `${paint.sky(className)} sets its middleware priority to ${priority}. Pass a finite number.`,\n [SeedcordErrorCode.DecoratorWebhookUrlMissing]: (className: string) =>\n `${paint.sky(className)} extends WebhookLog without a ${paint.bold('@WebhookUrl')} decorator. Add one with the name of the env var that holds the webhook URL.`,\n [SeedcordErrorCode.DecoratorEmptyMiddlewareFilter]: (className: string, key: string) =>\n `${paint.sky(className)} passes an empty array as ${paint.bold(key)}. Remove the key to run the middleware on everything.`,\n\n [SeedcordErrorCode.ReplyIllegalAckState]: (method: string, reason: string, alternative: string, routeId: string) =>\n `${paint.sky(`${method}()`)} was called when ${reason}.\\n${alternative} (route ${paint.mute(routeId)})`,\n [SeedcordErrorCode.ReplyComponentSerialization]: (\n componentClass: string,\n index: number,\n detail: string,\n routeId: string\n ) =>\n `${paint.sky(componentClass)} at components[${index}] failed to serialize: ${detail.replace(/\\.$/, '')}. (route ${paint.mute(routeId)})`,\n [SeedcordErrorCode.ReplyForeignEditTarget]: (method: string, targetId: string, routeId: string) =>\n `${paint.sky(`${method}()`)} was passed message ${targetId}, which this interaction did not send.\\nPass a message this interaction sent, returned by reply(), followUp(), edit(), or update(). (route ${paint.mute(routeId)})`,\n [SeedcordErrorCode.ReplyUpdateWithoutSource]: (method: string, routeId: string) =>\n `${paint.sky(`${method}()`)} was called on a modal opened from a command, which has no source message.\\nUse reply() or defer(). (route ${paint.mute(routeId)})`,\n [SeedcordErrorCode.ReplyCallbackMissingMessage]: (method: string, routeId: string) =>\n `Discord's interaction callback for ${paint.sky(`${method}()`)} returned no message. (route ${paint.mute(routeId)})`,\n\n [SeedcordErrorCode.CustomIdInvalidPrefix]: (prefix: string) =>\n `The customId prefix ${quoted(prefix)} is empty or holds a colon or a control character. Pick a prefix without them.`,\n [SeedcordErrorCode.CustomIdReservedFieldName]: (field: string) =>\n `The customId field name ${quoted(field)} looks like an integer. JS reorders integer keys, which would scramble the field order. Give it a name that is not a number.`,\n [SeedcordErrorCode.CustomIdEmptyChoices]: (field: string, method: string) =>\n `The customId field ${quoted(field)} uses ${method}() with no choices. Give it at least one choice, or make the field nullable.`,\n [SeedcordErrorCode.CustomIdInvalidBounds]: (field: string, min: number, max: number) =>\n `The customId field ${quoted(field)} has min ${min}, which is greater than max ${max}. Swap them, or fix the one that is wrong.`,\n [SeedcordErrorCode.CustomIdValueRejected]: (field: string, expected: string, value: string) =>\n `The customId field ${quoted(field)} expects ${expected}, but encode() got ${value}.`,\n [SeedcordErrorCode.CustomIdWireTooLong]: (prefix: string, length: number) =>\n `A customId encoded by ${quoted(prefix)} is ${length} characters, but Discord allows at most 100. Shorten the prefix, or move a field out of the customId.`,\n [SeedcordErrorCode.CustomIdHandlerRouteMissing]: (className: string) =>\n `${paint.sky(className)} is missing its route decorator. Add the one that matches its base, for example ${paint.bold('@ButtonRoute')} or ${paint.bold('@UserMenuRoute')}.`,\n [SeedcordErrorCode.MatchArmMissing]: (handler: string, kind: string, value: string) =>\n `${paint.bold(handler)}'s match() has no arm for the ${kind} ${quoted(value)}. Add one to the object you pass to match().`,\n [SeedcordErrorCode.EventNameUnavailable]: (handler: string, read: string) =>\n `${paint.sky(handler)} read ${paint.bold(read)}, but it was constructed without an event name. The event controller passes that name. A handler or middleware you construct yourself takes it as the fourth constructor argument.`,\n [SeedcordErrorCode.AutocompleteNoFocusedOption]: () =>\n 'Discord sent an autocomplete payload with no focused option.',\n [SeedcordErrorCode.ModalFieldNotFound]: (customId: string) =>\n `The submitted modal carries no field with the custom id ${quoted(customId)}. Check it against the id you gave the component when you built the modal.`,\n [SeedcordErrorCode.ModalFieldWrongKind]: (customId: string, kind: string, getter?: string) =>\n getter\n ? `The modal field ${quoted(customId)} holds ${kind}. Read it with ${paint.bold(`${getter}()`)}.`\n : `The modal field ${quoted(customId)} holds ${kind}, but none of the getters read that kind.`,\n [SeedcordErrorCode.ModalFieldEmpty]: (customId: string) =>\n `The modal field ${quoted(customId)} has nothing picked. Build the component as required, or read it without the required argument.`,\n [SeedcordErrorCode.ModalFieldChannelType]: (customId: string, picked: string, allowed: readonly string[]) =>\n `The modal field ${quoted(customId)} picked a ${picked} channel, but this read allows ${oneOf.format(allowed)}. Give the channel select the same channel types.`,\n [SeedcordErrorCode.CustomIdWireStale]: (prefix: string) =>\n `The customId ${quoted(prefix)} was encoded under an older shape of this definition. Adding, removing, changing, or moving a field changes the layout hash.`,\n [SeedcordErrorCode.CustomIdWireInvalid]: (detail: string) =>\n `The customId could not be decoded. ${sentence(detail)}`,\n [SeedcordErrorCode.DispatchStateMissing]: (key: string) =>\n `Nothing set ${paint.sky(key)} on this dispatch. Check that the middleware writing it is registered and that its filter covers this dispatch.`,\n\n [SeedcordErrorCode.GateInvalidCooldownDuration]: (input: string) =>\n `The cooldown duration ${quoted(input)} is not valid. Pass a positive number of seconds, or a duration string like '30m', '24h', or '500ms'.`,\n\n [SeedcordErrorCode.PaginationInvalidPerPage]: (perPage: number) =>\n `perPage is ${perPage}. Pass a positive integer.`,\n [SeedcordErrorCode.PaginationControlCount]: (count: number, max: number) =>\n `This control row has ${counted(count, 'button', 'buttons')}. Pass 1 to ${max}, the most Discord allows in one row.`,\n [SeedcordErrorCode.PaginationDuplicateControls]: (key: string) =>\n `This control row repeats the ${paint.sky(key)} control. Each control can appear once in a row.`,\n\n [SeedcordErrorCode.ColorUnresolvable]: (value: string) =>\n `Cannot convert ${value} into a color. Pass a hex string like '#5865f2', a number, an [r, g, b] tuple, or a color name from the palette.`,\n [SeedcordErrorCode.ColorOutOfRange]: (value: number) =>\n `${value} is outside Discord's color range, 0 to 16777215 (0xffffff).`,\n\n [SeedcordErrorCode.UtilTableOptionInvalid]: (option: string, expected: string, value: number) =>\n `renderTable's ${paint.bold(option)} is ${value}. Pass ${expected}.`,\n [SeedcordErrorCode.UtilUnhandledUnionMember]: (value: string) =>\n `assertNever() ran with ${value}, which its types ruled out. Something passed a value outside the union.`,\n [SeedcordErrorCode.LoggerFileNameHasFolder]: (filename: string, logsFolder: string) =>\n `${paint.bold('WinstonFileSink')} got ${paint.path(filename)} as its ${paint.bold('filename')}, which has a folder in it. File logs always go in ${paint.path(logsFolder)}. Pass only the file name, like ${paint.sky(\"'bot-{date}.log'\")}.`,\n\n [SeedcordErrorCode.PluginOptionsRejected]: (pluginName: string, reason: string) =>\n `${paint.sky(pluginName)} rejected its options. ${sentence(reason.charAt(0).toUpperCase() + reason.slice(1))}`,\n [SeedcordErrorCode.PluginDisposeFailures]: (count: number) =>\n `${paint.iris(count)} plugins failed to dispose. Each one is listed below.`,\n [SeedcordErrorCode.PluginServiceDecoratorMissing]: (decorator: string, className: string) =>\n `${paint.sky(className)} is missing ${paint.bold(decorator)}. Add it to the class to register the service.`,\n [SeedcordErrorCode.PluginServicesNotReady]: (pluginName: string) =>\n `${paint.sky(`${pluginName}.services`)} was read before the plugin finished ${paint.bold('init()')}. Read it inside a handler, or after start() resolves.`,\n [SeedcordErrorCode.PluginConnectionFailed]: (service: string, target?: string) =>\n `Could not connect to ${paint.bold(service)}${target ? ` (${paint.sky(target)})` : ''}. Check that it is running and that the connection string is right.`,\n [SeedcordErrorCode.PluginDisconnectFailed]: (service: string) =>\n `Could not close the ${paint.bold(service)} connection cleanly during shutdown.`,\n\n [SeedcordErrorCode.PluginMongooseModelCreationFailed]: (modelName: string, className: string) =>\n `Could not build the mongoose model ${paint.sky(modelName)} for ${paint.bold(className)}. Check for another model with that name, and that the class has a schema.`,\n [SeedcordErrorCode.PluginMongooseModelNameMissing]: (className: string) =>\n `${paint.sky(className)} passes an empty model name to ${paint.bold('@RegisterMongooseService()')}. Pass a non-empty modelName.`,\n\n [SeedcordErrorCode.PluginKyselyServiceTableMissing]: (className: string) =>\n `${paint.sky(className)} has no table. Pass one to ${paint.bold('@RegisterKyselyService()')}.`,\n [SeedcordErrorCode.PluginKyselyInvalidStepCount]: (steps: number) =>\n `The migration step count is ${steps}. Pass zero or a positive integer.`,\n [SeedcordErrorCode.PluginKyselyUnknownDirection]: (direction: unknown) =>\n `${paint.sky(String(direction))} is not a migration direction. Pass 'up' or 'down'.`,\n [SeedcordErrorCode.PluginKyselyInvalidMigrationModule]: (filePath: string) =>\n `${paint.path(filePath)} needs an up function because it is in the migrations folder. Export up, and down if you need it, by name or on a default export object. Move a helper file out of the folder.`,\n [SeedcordErrorCode.PluginKyselyNonErrorFailure]: (message: string) =>\n `A migration failed with a value that is not an Error: ${message}.`,\n [SeedcordErrorCode.PluginKyselyBootstrapFailed]: (databaseName: string) =>\n `Could not create the database ${paint.sky(databaseName)}. Check that the database user may create databases, or create it yourself.`,\n\n [SeedcordErrorCode.CliCancelled]: () => 'Cancelled.',\n\n [SeedcordErrorCode.CliConfigInvalidExport]: () =>\n `The seedcord config file must default export an object, like ${paint.bold('export default defineConfig({ ... })')}.`,\n [SeedcordErrorCode.CliConfigNotFound]: (baseDir: string, candidates: readonly string[]) =>\n `Searched ${paint.path(baseDir)} for ${oneOf.format(candidates)} and found none. Run the command from your bot's folder, or create a ${paint.sky('seedcord.config.ts')} there.`,\n [SeedcordErrorCode.CliConfigInvalidField]: (field: string, expected: string) =>\n `${paint.bold(field)} in the seedcord config must be ${expected}.`,\n [SeedcordErrorCode.CliFileNotFound]: (path: string, field: string) =>\n `Cannot find ${paint.path(path)}. Point ${paint.bold(field)} in the seedcord config at a file that exists.`,\n [SeedcordErrorCode.CliInstanceInvalid]: (instancePath: string) =>\n `${paint.path(instancePath)} must default export the bot, a ${paint.bold('new Seedcord(...)')}, from ${paint.bold('@seedcord/gateway')} or ${paint.bold('@seedcord/http')}.`,\n [SeedcordErrorCode.CliStartFailed]: (instancePath: string, reason: string) =>\n `Failed to start the bot from ${paint.path(instancePath)}: ${reason}`,\n [SeedcordErrorCode.CliTsconfigNotFound]: (configDir: string, configured?: string) =>\n configured\n ? `${paint.bold('build.tsconfig')} points at ${paint.path(configured)}, which does not exist. Fix the path, or remove it to use the ${paint.sky('tsconfig.json')} in ${paint.path(configDir)}.`\n : `${paint.path(configDir)} does not contain a ${paint.sky('tsconfig.json')}. Add one there, or set ${paint.bold('build.tsconfig')} in the seedcord config.`,\n [SeedcordErrorCode.CliDependencyMissing]: (packages: readonly string[], projectDir: string, why: string) =>\n `Add ${allOf.format(packages.map((name) => paint.bold(name)))} to ${paint.path(projectDir)} as ${isOne(packages.length) ? 'a dev dependency' : 'dev dependencies'}. ${why}`,\n [SeedcordErrorCode.CliBuildFailed]: (diagnostics: string) => `Type check failed:\\n${diagnostics}`,\n [SeedcordErrorCode.CliBundleFailed]: (reason: string) => `Vite could not bundle the bot:\\n${reason}`,\n [SeedcordErrorCode.CliConfigOutDirDeletesRoot]: (outDir: string, root: string) =>\n `${paint.bold('build.outDir')} is ${paint.path(outDir)}, which contains ${paint.bold('root')} (${paint.path(root)}). ${paint.bold('seedcord build')} empties ${paint.bold('outDir')} before it writes. Point it at a folder of its own, like ${paint.sky('./dist')}.`,\n [SeedcordErrorCode.CliBuildOutDirNotEmpty]: (outDir: string) =>\n `${paint.bold('build.outDir')} is ${paint.path(outDir)}, which already contains other files. ${paint.bold('seedcord build')} empties ${paint.bold('outDir')} before it writes. Point it at an empty folder, or delete what is in it.`,\n [SeedcordErrorCode.CliProblems]: (count: number) =>\n `${paint.iris(count)} problems need fixing. Each one is listed below.`,\n [SeedcordErrorCode.CliEdgeCommandsNotDeployed]: (lines: readonly string[]) =>\n `${paint.iris(lines.length)} ${isOne(lines.length) ? 'command is' : 'commands are'} in your code with no deployed id on Discord, so the build cannot link ${isOne(lines.length) ? 'it' : 'them'}. Deploy with ${paint.bold('seedcord commands deploy')}, then build again.\\n${lines.join('\\n')}`,\n [SeedcordErrorCode.CliDevRuntimeNotRunning]: (method: string) =>\n `${paint.bold('seedcord dev')} called ${paint.bold(method)} while the dev runtime was not running. This is a bug in seedcord.`,\n [SeedcordErrorCode.CliDeployNoCommandsFolder]: (instance: string) =>\n `${paint.path(instance)} sets ${paint.bold('bot.commands.path')} to ${paint.bold('null')}. Point it at the folder that holds your commands to deploy them.`,\n [SeedcordErrorCode.CliDeployNeedsYes]: () =>\n `${paint.bold('seedcord commands deploy')} asks before it deploys, but it can only ask in a terminal with ${paint.bold('CI')} unset. Pass ${paint.bold('--yes')} to deploy without asking.`,\n [SeedcordErrorCode.CliNoScopeGiven]: (flags: readonly string[], note?: string) =>\n `No scope given. Pass ${oneOf.format(flags.map((flag) => paint.bold(flag)))}.${note ? ` ${note}` : ''}`,\n [SeedcordErrorCode.CliCommandConstructorThrew]: (name: string, file: string, reason: string) =>\n `${paint.sky(name)} threw while seedcord constructed it. Fix its constructor in ${paint.path(file)}. ${reason}`,\n [SeedcordErrorCode.CliCommandNotACommand]: (name: string, file: string) =>\n `${paint.bold(name)} in ${paint.path(file)} carries ${paint.bold('@RegisterCommand')}, but its component is not a slash command or a context menu. Extend ${paint.bold(\"BuilderComponent<'command'>\")} or ${paint.bold(\"BuilderComponent<'context_menu'>\")}.`,\n [SeedcordErrorCode.CliCommandsNotDeleted]: () =>\n 'Some commands could not be deleted. The warnings above give the reason for each one.',\n [SeedcordErrorCode.CliEdgeOnBun]: () =>\n `seedcord loads ${paint.path('cloudflare.config.ts')} through Cloudflare's config loader, which throws on Bun. Run the CLI on Node by leaving out ${paint.bold('--bun')}, as in ${paint.bold('bun run dev')}.`,\n [SeedcordErrorCode.CliEdgeNoWorker]: (cloudflareConfig: string) =>\n `${paint.path(cloudflareConfig)} sets no ${paint.bold('worker')}. Add a ${paint.bold('worker')} with your worker's ${paint.bold('name')} and ${paint.bold('compatibilityDate')}.`,\n [SeedcordErrorCode.CliNotProjectInstall]: (cliDir: string, projectInstall: string) =>\n `This ${paint.bold('seedcord')} runs from ${paint.path(cliDir)}, but the project installs its own at ${paint.path(projectInstall)}. The CLI and the bot must load the same seedcord packages. Run the command through a script in the project's ${paint.path('package.json')}.`,\n [SeedcordErrorCode.CliViteEnvironmentMissing]: (name: string, created: readonly string[]) =>\n `seedcord runs the bot in Vite's ${paint.bold(name)} environment. Vite created only ${allOf.format(created.map((environment) => paint.bold(environment)))}. Look in ${paint.bold('vitePlugins')} for a plugin whose ${paint.bold('config')} hook rewrites ${paint.bold('environments')}.`,\n [SeedcordErrorCode.CliListedFolderUnusable]: (folder: string, problem: keyof typeof listedFolderProblems) =>\n `${paint.bold('files')} in seedcord.config.ts lists ${paint.path(folder)}, ${listedFolderProblems[problem]}`,\n [SeedcordErrorCode.CliDevAlreadyRunning]: (configDir: string, pid: number, startedAt: string, lockFile: string) =>\n `Another ${paint.bold('seedcord dev')} is running this bot's application from ${paint.path(configDir)} (pid ${pid}, started ${startedAt}). Two dev sessions on one application overwrite each other's commands and interactions endpoint. Press ${paint.bold('q')} in that session, or delete ${paint.path(lockFile)} if it is no longer running.`,\n [SeedcordErrorCode.CliDevLockFolderNotOwned]: (folder: string) =>\n `Another user owns ${paint.path(folder)}, the folder ${paint.bold('seedcord dev')} writes its session locks to. That account could write a lock there that blocks your dev sessions. Ask that user or an admin to delete the folder, then start ${paint.bold('seedcord dev')} again.`,\n [SeedcordErrorCode.CliPluginCodegenThrew]: (plugin: string, key: string, reason: string) =>\n `The ${paint.bold('codegen()')} of the plugin attached at ${paint.sky(key)} (${paint.sky(plugin)}) threw. ${sentence(reason)} ${paint.bold('seedcord codegen')} calls ${paint.bold('codegen()')} without running ${paint.bold('init()')} first, so read only constructor state and files in it.`,\n [SeedcordErrorCode.CliPluginCodegenNoId]: (plugin: string, key: string) =>\n `The plugin attached at ${paint.sky(key)} (${paint.sky(plugin)}) needs an id because it has a ${paint.bold('codegen()')}. Add ${paint.bold(\"static readonly id = '<your package name>'\")} to the class.`,\n [SeedcordErrorCode.CliPluginCodegenValue]: (id: string, key: string, path: string, value: string) =>\n `The ${paint.bold('codegen()')} of the plugin attached at ${paint.sky(key)} (${paint.sky(id)}) returned ${value} at ${paint.bold(path)}. Codegen can't write that value as a type. It writes plain data, and classes or objects that a project file or the plugin's package exports. Export the value from a file, or return plain data.`,\n [SeedcordErrorCode.CliPluginCodegenConflict]: (id: string, first: string, second: string, path: string) =>\n `The plugins attached at ${paint.sky(first)} and ${paint.sky(second)} are both ${paint.bold(id)}, and their ${paint.bold('codegen()')} results differ at ${paint.bold(path)}. Every attachment of one plugin shares one type, so both have to return the same value there. Change that value in the files one of them reads, or attach the plugin once.`,\n [SeedcordErrorCode.CliCodegenOutOfDate]: (outputPath: string) =>\n `${paint.path(outputPath)} is out of date. Run ${paint.bold('seedcord codegen')} and commit it.`,\n [SeedcordErrorCode.CliEdgeWithoutWorkerdCondition]: (cloudflareConfig: string, tsconfig: string) =>\n `${paint.path(cloudflareConfig)} makes this an edge bot, but ${paint.path(tsconfig)} leaves out ${paint.bold('\"customConditions\": [\"workerd\"]')}. Add it to compilerOptions for an edge bot, or set ${paint.bold('build.tsconfig')} to the tsconfig that holds it. For a node bot, move ${paint.path(cloudflareConfig)} out of this folder.`,\n [SeedcordErrorCode.CliWorkerdConditionWithoutCloudflareConfig]: (tsconfig: string, configDir: string) =>\n `${paint.path(tsconfig)} sets the ${paint.bold('workerd')} condition, which only an edge bot uses, but ${paint.path(configDir)} has no ${paint.path('cloudflare.config.ts')}. Add one for an edge bot. For a node bot, remove ${paint.bold('\"workerd\"')} from customConditions.`,\n [SeedcordErrorCode.CliConfigFileUnreadable]: (tool: string, file: string, output: string) =>\n `${tool} could not read ${paint.path(file)}. Fix the problem it reports:\\n${output}`,\n [SeedcordErrorCode.CliConfigFieldUnused]: (field: string, file: string, why: string) =>\n `${paint.path(file)} sets ${paint.bold(field)}. ${why} Remove ${paint.bold(field)} from ${paint.path(file)}.`,\n [SeedcordErrorCode.CliEdgeCompatDateTooOld]: (cloudflareConfig: string, date: string, firstDate: string) =>\n `A seedcord edge bot needs Cloudflare's Node compat. ${paint.path(cloudflareConfig)} sets ${paint.bold('compatibilityDate')} to ${date}, but Cloudflare turns Node compat on by default only from ${firstDate}. Set the date to ${firstDate} or later, or add ${paint.bold(\"'nodejs_compat'\")} to ${paint.bold('compatibilityFlags')}.`,\n [SeedcordErrorCode.CliEdgeNodeCompatOff]: (cloudflareConfig: string) =>\n `A seedcord edge bot needs Cloudflare's Node compat, but ${paint.path(cloudflareConfig)} turns it off with ${paint.bold(\"'no_nodejs_compat'\")}. Remove that flag from ${paint.bold('compatibilityFlags')}.`,\n [SeedcordErrorCode.CliEdgeBootFailed]: (reason: string) =>\n `The build could not start the worker in workerd, the runtime Cloudflare runs it on.\\n${reason}`,\n [SeedcordErrorCode.CliEdgeRootHoldsConfig]: (configFile: string, root: string) =>\n `An edge build bundles every file under ${paint.bold('root')}. ${paint.path(configFile)} sets ${paint.bold('root')} to ${paint.path(root)}, so the bundle would pull in that config file and tool configs like ${paint.sky('eslint.config.ts')}. Those break the bundle. Set ${paint.bold('root')} to the folder that holds the bot's code, like ${paint.sky(\"'./src'\")}.`,\n [SeedcordErrorCode.CliTypescriptNotStarted]: (tsc: string, reason: string) =>\n `Could not start TypeScript at ${paint.path(tsc)}: ${reason}`,\n [SeedcordErrorCode.CliPathHasHash]: (path: string) =>\n `${paint.path(path)} has a ${paint.bold('#')} in its path. Vite cuts a path at its first ${paint.bold('#')}, so rename it, or move the project to a folder without one.`,\n [SeedcordErrorCode.CliTunnelUrlUnavailable]: (seconds: number) =>\n `cloudflared did not report a tunnel URL within ${seconds}s. Check that the binary runs and that the network allows it.`,\n [SeedcordErrorCode.CliTunnelNotVerified]: (url: string) =>\n `Discord rejected ${paint.sky(url)} as an interactions endpoint. Discord checks the endpoint by sending it a signed request, so check that ${paint.bold('DISCORD_PUBLIC_KEY')} matches your application.`,\n [SeedcordErrorCode.CliTunnelUnreachable]: (url: string, seconds: number) =>\n `${paint.sky(url)} did not answer within ${seconds}s, so nothing was PATCHed to Discord.`,\n\n [SeedcordErrorCode.CreateFlagNotApplicable]: (flag: string) =>\n `The --${flag} flag does not apply to the answers you gave.`,\n [SeedcordErrorCode.CreateInvalidAnswer]: (flag: string, reason: string) => `--${flag}: ${reason}`,\n // node's parseArgs message ends on an unclosed quote\n [SeedcordErrorCode.CreateBadUsage]: (reason: string) => `${reason}\\nRun with --help for the flag list.`,\n [SeedcordErrorCode.CreateTargetNotEmpty]: (target: string) =>\n `${paint.path(target)} already has files in it. Pick an empty directory or a name that does not exist yet.`,\n [SeedcordErrorCode.CreateStepFailed]: (command: string, reason: string) =>\n `${paint.bold(command)} failed.\\n${reason}`,\n\n [SeedcordErrorCode.MakeInvalidName]: (name: string) =>\n `${paint.bold(JSON.stringify(name))} can't be a file name. Start it with a letter and use only letters, digits, spaces, - and _, like ${paint.bold('RollDice')}. Put folders in front with /, like ${paint.bold('fun/RollDice')}.`,\n [SeedcordErrorCode.MakeImportOfUnmatched]: (template: string, folder: string, count: number) =>\n `${paint.bold(`importOf \"${folder}\"`)} in the ${paint.bold(template)} template needs exactly one ${paint.path('.hbs')} file in the template's ${paint.path(folder)} folder. That folder holds ${count}. Point importOf at a folder with one template file.`,\n [SeedcordErrorCode.MakeValueUsedTwoWays]: (\n template: string,\n value: string,\n first: 'text' | 'list' | 'object',\n second: 'text' | 'list' | 'object'\n ) => {\n const uses = {\n text: 'prints it',\n list: `loops over it with ${paint.bold('#each')}`,\n object: `reads a field from it, like ${paint.bold(`${value}.name`)}`\n };\n return `The ${paint.bold(template)} template uses ${paint.bold(value)} two ways. It ${uses[first]}, and it also ${uses[second]}. Give one of the two uses its own name.`;\n },\n [SeedcordErrorCode.MakeTemplateFailed]: (file: string, from: string, reason: string) =>\n `Handlebars could not render ${paint.path(file)} from ${paint.bold(from)}.\\n${reason}\\nFix that template file.`,\n [SeedcordErrorCode.MakeLookupDynamicKey]: (template: string, value: string) =>\n `The ${paint.bold(template)} template calls ${paint.bold('lookup')} on ${paint.bold(value)} without a quoted key. seedcord make can't tell which field of ${paint.bold(value)} to ask for. Give lookup a quoted key like ${paint.bold(`{{lookup ${value} \"title\"}}`)}, or map the value in a helper under ${paint.bold('make.helpers')} in seedcord.config.ts.`,\n [SeedcordErrorCode.MakeNeedsTerminal]: () =>\n `${paint.bold('seedcord make')} asks for a template, a name and each value in a terminal. Run it from a terminal with ${paint.bold('CI')} unset.`,\n [SeedcordErrorCode.MakeNoTemplates]: (folder: string) =>\n `Found no templates in ${paint.path(folder)} or in the installed plugins. Each folder inside ${paint.path(folder)} is one template. ${paint.sky(PRODUCTION_SITES.guide.at('tooling/make'))} shows how to write one and where to copy the starters from.`,\n [SeedcordErrorCode.MakePathTaken]: (path: string, takenByTemplate?: string) =>\n takenByTemplate === undefined\n ? `${paint.path(path)} already exists. Pick another name, or delete that file first.`\n : `Two files of the ${paint.bold(takenByTemplate)} template would both be written to ${paint.path(path)}. Pick a name that keeps them apart, or give the files different names in the template.`,\n [SeedcordErrorCode.MakePartialCallsItself]: (template: string, partial: string) =>\n `The ${paint.bold(partial)} partial in the ${paint.bold(template)} template calls itself. seedcord make asks for every value before it writes a file, and it can't tell how many levels a partial that calls itself goes down. Write out each level the template needs.`\n} satisfies Record<SeedcordErrorCode, (...args: never[]) => string>;\n\n/** @internal */\nexport type SeedcordErrorArguments<Code extends SeedcordErrorCode> = Parameters<(typeof messages)[Code]>;\n\n/** @internal */\nexport function formatSeedcordErrorMessage<Code extends SeedcordErrorCode>(\n code: Code,\n args?: SeedcordErrorArguments<Code>\n): string {\n const formatter = messages[code];\n const resolvedArgs = (args ?? []) as unknown[];\n return (formatter as (...params: unknown[]) => string)(...resolvedArgs);\n}\n","import { SeedcordErrorCode } from './ErrorCodes';\nimport { formatSeedcordErrorMessage, type SeedcordErrorArguments } from './ErrorMessages';\nimport { paint } from './palette';\n\n/**\n * String literal type for Seedcord error identifiers.\n *\n * @internal\n */\ntype SeedcordErrorIdentifier = keyof typeof SeedcordErrorCode;\n\n/**\n * Options for Seedcord errors.\n *\n * @internal\n */\ninterface SeedcordErrorOptions extends ErrorOptions {}\n\nfunction resolveIdentifier(code: SeedcordErrorCode): SeedcordErrorIdentifier {\n return SeedcordErrorCode[code] as SeedcordErrorIdentifier;\n}\n\ntype SeedcordErrorPayload<Code extends SeedcordErrorCode> = SeedcordErrorArguments<Code> | undefined;\n\ntype SeedcordErrorCtorRest<Code extends SeedcordErrorCode> =\n SeedcordErrorArguments<Code> extends []\n ? [options?: SeedcordErrorOptions]\n : [args: SeedcordErrorArguments<Code>, options?: SeedcordErrorOptions];\n\nfunction resolveCtorInputs<Code extends SeedcordErrorCode>(\n rest: SeedcordErrorCtorRest<Code>\n): { args: SeedcordErrorPayload<Code>; options?: SeedcordErrorOptions } {\n const [maybeArgsOrOptions, maybeOptions] = rest;\n if (Array.isArray(maybeArgsOrOptions)) {\n const result: { args: SeedcordErrorPayload<Code>; options?: SeedcordErrorOptions } = {\n args: maybeArgsOrOptions\n };\n\n if (maybeOptions !== undefined) {\n result.options = maybeOptions;\n }\n\n return result;\n }\n\n const result: { args: SeedcordErrorPayload<Code>; options?: SeedcordErrorOptions } = {\n args: undefined\n };\n\n if (maybeArgsOrOptions !== undefined) {\n result.options = maybeArgsOrOptions;\n }\n\n return result;\n}\n\nfunction resolveMessage<Code extends SeedcordErrorCode>(code: Code, args: SeedcordErrorPayload<Code>): string {\n return formatSeedcordErrorMessage(code, args);\n}\n\nfunction formatErrorName(name: string, _identifier: SeedcordErrorIdentifier, code: SeedcordErrorCode): string {\n return `${paint.coral.bold(name)}[${paint.mute(code)}]`;\n}\n\n/**\n * The Seedcord error class names as string literals. {@link isSeedcordError} takes one as its `type`\n * argument.\n */\nexport type SeedcordErrorTypeString = `Seedcord${'Error' | 'TypeError' | 'RangeError' | 'AggregateError'}`;\n\n// Symbol.for so two installed copies read the same slot\nconst kIdentifier: unique symbol = Symbol.for('seedcord:errors:identifier');\n\ninterface BaseSeedcordError {\n readonly code: SeedcordErrorCode;\n readonly [kIdentifier]: SeedcordErrorIdentifier;\n readonly type: SeedcordErrorTypeString;\n}\n\n// instanceof fails across two installed copies of this package\nconst CODED = Symbol.for('seedcord:errors:coded');\n\nfunction brand(prototype: object): void {\n Object.defineProperty(prototype, CODED, { value: true });\n}\n\nfunction isCoded(error: unknown): error is BaseSeedcordError {\n return typeof error === 'object' && error !== null && CODED in error;\n}\n\nexport class SeedcordError<Code extends SeedcordErrorCode = SeedcordErrorCode>\n extends Error\n implements BaseSeedcordError\n{\n public readonly code: Code;\n readonly [kIdentifier]: SeedcordErrorIdentifier;\n public readonly type = 'SeedcordError';\n\n constructor(code: Code, ...rest: SeedcordErrorCtorRest<Code>) {\n const { args, options } = resolveCtorInputs(rest);\n const message = resolveMessage(code, args);\n super(message, options);\n this.code = code;\n this[kIdentifier] = resolveIdentifier(code);\n this.name = formatErrorName(new.target.name, this[kIdentifier], this.code);\n Object.setPrototypeOf(this, new.target.prototype);\n if (typeof Error.captureStackTrace === 'function') {\n Error.captureStackTrace(this, new.target);\n }\n }\n}\n\nbrand(SeedcordError.prototype);\n\nexport class SeedcordTypeError<Code extends SeedcordErrorCode = SeedcordErrorCode>\n extends TypeError\n implements BaseSeedcordError\n{\n public readonly code: Code;\n readonly [kIdentifier]: SeedcordErrorIdentifier;\n public readonly type = 'SeedcordTypeError';\n\n constructor(code: Code, ...rest: SeedcordErrorCtorRest<Code>) {\n const { args, options } = resolveCtorInputs(rest);\n const message = resolveMessage(code, args);\n super(message, options);\n this.code = code;\n this[kIdentifier] = resolveIdentifier(code);\n this.name = formatErrorName(new.target.name, this[kIdentifier], this.code);\n Object.setPrototypeOf(this, new.target.prototype);\n if (typeof Error.captureStackTrace === 'function') {\n Error.captureStackTrace(this, new.target);\n }\n }\n}\n\nbrand(SeedcordTypeError.prototype);\n\nexport class SeedcordRangeError<Code extends SeedcordErrorCode = SeedcordErrorCode>\n extends RangeError\n implements BaseSeedcordError\n{\n public readonly code: Code;\n readonly [kIdentifier]: SeedcordErrorIdentifier;\n public readonly type = 'SeedcordRangeError';\n\n constructor(code: Code, ...rest: SeedcordErrorCtorRest<Code>) {\n const { args, options } = resolveCtorInputs(rest);\n const message = resolveMessage(code, args);\n super(message, options);\n this.code = code;\n this[kIdentifier] = resolveIdentifier(code);\n this.name = formatErrorName(new.target.name, this[kIdentifier], this.code);\n Object.setPrototypeOf(this, new.target.prototype);\n if (typeof Error.captureStackTrace === 'function') {\n Error.captureStackTrace(this, new.target);\n }\n }\n}\n\nbrand(SeedcordRangeError.prototype);\n\nexport class SeedcordAggregateError<Code extends SeedcordErrorCode = SeedcordErrorCode>\n extends AggregateError\n implements BaseSeedcordError\n{\n public readonly code: Code;\n readonly [kIdentifier]: SeedcordErrorIdentifier;\n public readonly type = 'SeedcordAggregateError';\n\n constructor(code: Code, errors: readonly unknown[], ...rest: SeedcordErrorCtorRest<Code>) {\n const { args, options } = resolveCtorInputs(rest);\n const message = resolveMessage(code, args);\n super(errors, message, options);\n this.code = code;\n this[kIdentifier] = resolveIdentifier(code);\n this.name = formatErrorName(new.target.name, this[kIdentifier], this.code);\n Object.setPrototypeOf(this, new.target.prototype);\n if (typeof Error.captureStackTrace === 'function') {\n Error.captureStackTrace(this, new.target);\n }\n }\n}\n\nbrand(SeedcordAggregateError.prototype);\n\n/**\n * Variant type for Seedcord error classes.\n *\n * @internal\n */\ntype SeedcordErrorVariant<\n Type extends SeedcordErrorTypeString,\n Code extends SeedcordErrorCode\n> = Type extends 'SeedcordError'\n ? SeedcordError<Code>\n : Type extends 'SeedcordTypeError'\n ? SeedcordTypeError<Code>\n : Type extends 'SeedcordRangeError'\n ? SeedcordRangeError<Code>\n : SeedcordAggregateError<Code>;\n\n/**\n * Union type of all Seedcord error variants for a specific error code.\n *\n * @internal\n */\ntype AnySeedcordErrorForCode<Code extends SeedcordErrorCode> = {\n [Variant in SeedcordErrorTypeString]: SeedcordErrorVariant<Variant, Code>;\n}[SeedcordErrorTypeString];\n\n/**\n * Union type of all Seedcord errors filtered by error class.\n *\n * @internal\n */\ntype ErrorTypeFilter<Type extends SeedcordErrorTypeString | undefined> = Type extends SeedcordErrorTypeString\n ? {\n [Code in SeedcordErrorCode]: SeedcordErrorVariant<Type, Code>;\n }[SeedcordErrorCode]\n : AnySeedcordErrorForCode<SeedcordErrorCode>;\n\n/**\n * Union type of all Seedcord errors filtered by error class and error code.\n *\n * @internal\n */\nexport type ErrorCodeFilter<\n Type extends SeedcordErrorTypeString | undefined,\n Code extends SeedcordErrorCode | undefined\n> = Code extends SeedcordErrorCode\n ? Type extends SeedcordErrorTypeString\n ? SeedcordErrorVariant<Type, Code>\n : AnySeedcordErrorForCode<Code>\n : ErrorTypeFilter<Type>;\n\n/**\n * Determines whether an unknown value is a Seedcord error, with optional narrowing by class and error code.\n *\n * @param error - The value to inspect.\n * @param type - Optional error class discriminator.\n * @param code - Optional {@link SeedcordErrorCode} discriminator to narrow by code.\n * @typeParam Type - What kind of {@link SeedcordErrorTypeString} to filter by.\n * @typeParam Code - The specific {@link SeedcordErrorCode} to filter by.\n */\nexport function isSeedcordError<\n Type extends SeedcordErrorTypeString | undefined,\n Code extends SeedcordErrorCode | undefined\n>(error: unknown, type?: Type, code?: Code): error is ErrorCodeFilter<Type, Code> {\n if (!isCoded(error)) return false;\n if (type && error.type !== type) return false;\n if (code === undefined) return true;\n // another copy of this package may number the same identifier differently\n return error[kIdentifier] === resolveIdentifier(code);\n}\n"],"mappings":";;;;;;AAKA,IAAY,oBAAL;;CAEH;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAGA;;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;;CAEA;;CAEA;;CAEA;;CAGA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAGA;;CAEA;;CAEA;;CAEA;;CAEA;;CAGA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAGA;;CAGA;;CAEA;;CAEA;;CAGA;;CAEA;;CAGA;;CAEA;;CAGA;;CAGA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAGA;;CAEA;;CAGA;;CA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AM,KAAK,cAAc,KAAK,IAAI;EACzE,OAAO,eAAe,MAAM,WAAW,SAAS;EAChD,IAAI,OAAO,MAAM,sBAAsB,YACnC,MAAM,kBAAkB,MAAM,UAAU;CAEhD;AACJ;AAEA,MAAM,uBAAuB,SAAS;;;;;;;;;;AA6DtC,SAAgB,gBAGd,OAAgB,MAAa,MAAmD;CAC9E,IAAI,CAAC,QAAQ,KAAK,GAAG,OAAO;CAC5B,IAAI,QAAQ,MAAM,SAAS,MAAM,OAAO;CACxC,IAAI,SAAS,QAAW,OAAO;CAE/B,OAAO,MAAM,iBAAiB,kBAAkB,IAAI;AACxD"}
@@ -100,6 +100,12 @@ declare enum SeedcordErrorCode {
100
100
  CoreDirectoryNotListed = 1230,
101
101
  /** A folder is inside one that `seedcord build` skips, like a dot-folder, `node_modules`, `outDir` or the logs folder. */
102
102
  CoreDirectorySkipped = 1231,
103
+ /** `collection.entries()` ran on a Keyv store in `config.kv` that can't list its keys. */
104
+ CoreKvKeysUnsupported = 1232,
105
+ /** A plugin built with `new` outside `attach()` read `this.kv`. */
106
+ CorePluginKvOutsideAttach = 1233,
107
+ /** The driver in `config.kv` threw, or reported a write as failed. */
108
+ CoreKvDriverFailed = 1234,
103
109
  /** A command class carries `@RegisterCommand` twice. */
104
110
  DecoratorCommandAlreadyRegistered = 1301,
105
111
  /** `@RegisterCommand('global')` was given guild ids. */
@@ -136,9 +142,9 @@ declare enum SeedcordErrorCode {
136
142
  CustomIdWireTooLong = 1606,
137
143
  /** A component handler is missing the route decorator that matches its base. */
138
144
  CustomIdHandlerRouteMissing = 1607,
139
- /** A handler's `match()` has no arm for the route, field, event, or command that fired. */
145
+ /** A handler's `match()` has no arm for the current route, field, event, or command. */
140
146
  MatchArmMissing = 1608,
141
- /** An event handler or middleware read the fired event's name but was constructed without one. */
147
+ /** An event handler or middleware read the event name but was constructed without one. */
142
148
  EventNameUnavailable = 1609,
143
149
  /** Discord sent an autocomplete payload with no focused option. */
144
150
  AutocompleteNoFocusedOption = 1610,
@@ -288,6 +294,14 @@ declare enum SeedcordErrorCode {
288
294
  CliDevAlreadyRunning = 3141,
289
295
  /** The folder that holds the dev session locks belongs to another user. */
290
296
  CliDevLockFolderNotOwned = 3142,
297
+ /** A plugin's `codegen()` threw. */
298
+ CliPluginCodegenThrew = 3143,
299
+ /** A plugin class with a `codegen()` is missing its `static readonly id`. */
300
+ CliPluginCodegenNoId = 3144,
301
+ /** A plugin's `codegen()` returned a value that codegen can't write as a type. */
302
+ CliPluginCodegenValue = 3145,
303
+ /** Two attachments of one plugin class returned different values at one key from `codegen()`. */
304
+ CliPluginCodegenConflict = 3146,
291
305
  /** A flag answers a question that the earlier answers skip. */
292
306
  CreateFlagNotApplicable = 3201,
293
307
  /** A flag has a value its question rejects. */
@@ -297,15 +311,28 @@ declare enum SeedcordErrorCode {
297
311
  /** The target path already has files in it. */
298
312
  CreateTargetNotEmpty = 3204,
299
313
  /** A command that create-seedcord ran exited non-zero. */
300
- CreateStepFailed = 3205
314
+ CreateStepFailed = 3205,
315
+ /** The name given to `seedcord make` can't become a file name. */
316
+ MakeInvalidName = 3301,
317
+ /** A template calls `importOf` on a folder that doesn't hold exactly one template file. */
318
+ MakeImportOfUnmatched = 3302,
319
+ /** A template uses one value as two of text, a list, and an entry with fields. */
320
+ MakeValueUsedTwoWays = 3303,
321
+ /** Handlebars could not parse or render a template file. */
322
+ MakeTemplateFailed = 3304,
323
+ /** A template calls `lookup` with a key that isn't quoted text. */
324
+ MakeLookupDynamicKey = 3305,
325
+ /** `seedcord make` ran without a terminal to ask its questions in. */
326
+ MakeNeedsTerminal = 3306,
327
+ /** `seedcord make` found no templates in the bot or its plugins. */
328
+ MakeNoTemplates = 3307,
329
+ /** A path `seedcord make` would write to is taken, by a file on disk or by another file of the same template. */
330
+ MakePathTaken = 3308,
331
+ /** A template's partial calls itself, so `seedcord make` can't tell how many levels to ask for. */
332
+ MakePartialCallsItself = 3309
301
333
  }
302
334
  //#endregion
303
335
  //#region src/palette.d.ts
304
- declare const BRAND: {
305
- readonly flesh: "#f04e36";
306
- readonly rind: "#6fab49";
307
- readonly pith: "#f8f6e8";
308
- };
309
336
  declare function setColorLevel(level: ColorSupportLevel): void;
310
337
  declare const paint: {
311
338
  readonly sky: import("chalk").ChalkInstance;
@@ -326,7 +353,7 @@ declare const paint: {
326
353
  };
327
354
  declare const WORDMARK: string;
328
355
  //#endregion
329
- //#region src/ErrorMessages.d.ts
356
+ //#region src/messageParts.d.ts
330
357
  interface VitePluginPlace {
331
358
  hook?: string | undefined;
332
359
  loading?: {
@@ -342,6 +369,8 @@ declare const listedFolderProblems: {
342
369
  file: string;
343
370
  outsideProject: string;
344
371
  };
372
+ //#endregion
373
+ //#region src/ErrorMessages.d.ts
345
374
  /** @internal */
346
375
  declare const messages: {
347
376
  1001: (count: number) => string;
@@ -374,6 +403,9 @@ declare const messages: {
374
403
  1225: (dir: string, root: string) => string;
375
404
  1230: (dir: string) => string;
376
405
  1231: (dir: string) => string;
406
+ 1232: () => string;
407
+ 1234: (operation: "read" | "write" | "delete" | "list", key: string) => string;
408
+ 1233: (plugin: string) => string;
377
409
  1215: (head: string, key: string) => string;
378
410
  1217: (key: string, reason: string) => string;
379
411
  1218: (plugin: string) => string;
@@ -472,6 +504,10 @@ declare const messages: {
472
504
  3140: (folder: string, problem: keyof typeof listedFolderProblems) => string;
473
505
  3141: (configDir: string, pid: number, startedAt: string, lockFile: string) => string;
474
506
  3142: (folder: string) => string;
507
+ 3143: (plugin: string, key: string, reason: string) => string;
508
+ 3144: (plugin: string, key: string) => string;
509
+ 3145: (id: string, key: string, path: string, value: string) => string;
510
+ 3146: (id: string, first: string, second: string, path: string) => string;
475
511
  3119: (outputPath: string) => string;
476
512
  3121: (cloudflareConfig: string, tsconfig: string) => string;
477
513
  3122: (tsconfig: string, configDir: string) => string;
@@ -491,6 +527,15 @@ declare const messages: {
491
527
  3203: (reason: string) => string;
492
528
  3204: (target: string) => string;
493
529
  3205: (command: string, reason: string) => string;
530
+ 3301: (name: string) => string;
531
+ 3302: (template: string, folder: string, count: number) => string;
532
+ 3303: (template: string, value: string, first: "text" | "list" | "object", second: "text" | "list" | "object") => string;
533
+ 3304: (file: string, from: string, reason: string) => string;
534
+ 3305: (template: string, value: string) => string;
535
+ 3306: () => string;
536
+ 3307: (folder: string) => string;
537
+ 3308: (path: string, takenByTemplate?: string) => string;
538
+ 3309: (template: string, partial: string) => string;
494
539
  };
495
540
  /** @internal */
496
541
  type SeedcordErrorArguments<Code extends SeedcordErrorCode> = Parameters<(typeof messages)[Code]>;
@@ -510,8 +555,8 @@ type SeedcordErrorIdentifier = keyof typeof SeedcordErrorCode;
510
555
  interface SeedcordErrorOptions extends ErrorOptions {}
511
556
  type SeedcordErrorCtorRest<Code extends SeedcordErrorCode> = SeedcordErrorArguments<Code> extends [] ? [options?: SeedcordErrorOptions] : [args: SeedcordErrorArguments<Code>, options?: SeedcordErrorOptions];
512
557
  /**
513
- * String literal type for Seedcord error class names. Names the `type` argument of
514
- * {@link isSeedcordError}.
558
+ * The Seedcord error class names as string literals. {@link isSeedcordError} takes one as its `type`
559
+ * argument.
515
560
  */
516
561
  type SeedcordErrorTypeString = `Seedcord${'Error' | 'TypeError' | 'RangeError' | 'AggregateError'}`;
517
562
  declare const kIdentifier: unique symbol;
@@ -579,5 +624,5 @@ type ErrorCodeFilter<Type extends SeedcordErrorTypeString | undefined, Code exte
579
624
  */
580
625
  declare function isSeedcordError<Type extends SeedcordErrorTypeString | undefined, Code extends SeedcordErrorCode | undefined>(error: unknown, type?: Type, code?: Code): error is ErrorCodeFilter<Type, Code>;
581
626
  //#endregion
582
- export { SeedcordTypeError as a, VitePluginPlace as c, paint as d, setColorLevel as f, SeedcordRangeError as i, BRAND as l, SeedcordError as n, isSeedcordError as o, SeedcordErrorCode as p, SeedcordErrorTypeString as r, SeedcordErrorArguments as s, SeedcordAggregateError as t, WORDMARK as u };
583
- //# sourceMappingURL=SeedcordError-Cce9qKW3.d.mts.map
627
+ export { SeedcordTypeError as a, VitePluginPlace as c, setColorLevel as d, SeedcordErrorCode as f, SeedcordRangeError as i, WORDMARK as l, SeedcordError as n, isSeedcordError as o, SeedcordErrorTypeString as r, SeedcordErrorArguments as s, SeedcordAggregateError as t, paint as u };
628
+ //# sourceMappingURL=SeedcordError-CUDze2Ar.d.mts.map
package/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { d as paint, o as isSeedcordError, p as SeedcordErrorCode, r as SeedcordErrorTypeString } from "./SeedcordError-Cce9qKW3.mjs";
1
+ import { f as SeedcordErrorCode, o as isSeedcordError, r as SeedcordErrorTypeString, u as paint } from "./SeedcordError-CUDze2Ar.mjs";
2
2
  //#region src/index.d.ts
3
3
  /** Package version */
4
4
  export declare const version: string;
package/dist/index.mjs CHANGED
@@ -1,8 +1,8 @@
1
- import { a as isSeedcordError, c as paint, d as SeedcordErrorCode } from "./SeedcordError-D9SmwpVL.mjs";
1
+ import { a as isSeedcordError, s as paint, u as SeedcordErrorCode } from "./SeedcordError-BvEoyypY.mjs";
2
2
 
3
3
  //#region src/index.ts
4
4
  /** Package version */
5
- const version = "0.14.0";
5
+ const version = "0.15.0-next.0";
6
6
 
7
7
  //#endregion
8
8
  export { SeedcordErrorCode, isSeedcordError, paint, version };
@@ -1,4 +1,4 @@
1
- import { a as SeedcordTypeError, c as VitePluginPlace, f as setColorLevel, i as SeedcordRangeError, l as BRAND, n as SeedcordError, p as SeedcordErrorCode, s as SeedcordErrorArguments, t as SeedcordAggregateError, u as WORDMARK } from "./SeedcordError-Cce9qKW3.mjs";
1
+ import { a as SeedcordTypeError, c as VitePluginPlace, d as setColorLevel, f as SeedcordErrorCode, i as SeedcordRangeError, l as WORDMARK, n as SeedcordError, s as SeedcordErrorArguments, t as SeedcordAggregateError } from "./SeedcordError-CUDze2Ar.mjs";
2
2
  //#region src/throwSingleOrAggregate.d.ts
3
3
  type CountCode = { [Code in SeedcordErrorCode]: SeedcordErrorArguments<Code> extends [count: number] ? Code : never; }[SeedcordErrorCode];
4
4
  export declare function throwSingleOrAggregate(problems: readonly unknown[], code: CountCode): void;
@@ -20,5 +20,5 @@ interface BotToken {
20
20
  /** @internal */
21
21
  export declare function validateDiscordToken(raw: unknown): BotToken;
22
22
  //#endregion
23
- export { BRAND, type BotToken, SeedcordAggregateError, SeedcordError, type SeedcordErrorArguments, SeedcordRangeError, SeedcordTypeError, type VitePluginPlace, WORDMARK, setColorLevel };
23
+ export { type BotToken, SeedcordAggregateError, SeedcordError, type SeedcordErrorArguments, SeedcordRangeError, SeedcordTypeError, type VitePluginPlace, WORDMARK, setColorLevel };
24
24
  //# sourceMappingURL=internal.index.d.mts.map
@@ -1,4 +1,4 @@
1
- import { d as SeedcordErrorCode, i as SeedcordTypeError, l as setColorLevel, n as SeedcordError, o as BRAND, r as SeedcordRangeError, s as WORDMARK, t as SeedcordAggregateError, u as displayPath } from "./SeedcordError-D9SmwpVL.mjs";
1
+ import { c as setColorLevel, i as SeedcordTypeError, l as displayPath, n as SeedcordError, o as WORDMARK, r as SeedcordRangeError, t as SeedcordAggregateError, u as SeedcordErrorCode } from "./SeedcordError-BvEoyypY.mjs";
2
2
 
3
3
  //#region src/throwSingleOrAggregate.ts
4
4
  function throwSingleOrAggregate(problems, code) {
@@ -61,5 +61,5 @@ function validateDiscordToken(raw) {
61
61
  }
62
62
 
63
63
  //#endregion
64
- export { BRAND, SeedcordAggregateError, SeedcordError, SeedcordRangeError, SeedcordTypeError, WORDMARK, displayPath, isSnowflake, setColorLevel, throwSingleOrAggregate, validateDiscordToken };
64
+ export { SeedcordAggregateError, SeedcordError, SeedcordRangeError, SeedcordTypeError, WORDMARK, displayPath, isSnowflake, setColorLevel, throwSingleOrAggregate, validateDiscordToken };
65
65
  //# sourceMappingURL=internal.index.mjs.map
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@seedcord/errors",
3
3
  "type": "module",
4
- "version": "0.14.0",
4
+ "version": "0.15.0-next.0",
5
5
  "engines": {
6
6
  "node": "^24.22.1 || >=26.12.1",
7
7
  "bun": ">=1.4.2"
@@ -51,7 +51,8 @@
51
51
  "chalk": "^6.0.0"
52
52
  },
53
53
  "devDependencies": {
54
- "@seedcord/eslint-config": "^3.0.0",
54
+ "@seedcord/brand": "^0.0.0",
55
+ "@seedcord/eslint-config": "^3.0.1-next.0",
55
56
  "@seedcord/tsconfig": "^3.0.0",
56
57
  "@seedcord/tsdown-config": "^2.0.1",
57
58
  "@seedcord/vitest-config": "^0.0.1"
@@ -1 +0,0 @@
1
- {"version":3,"file":"SeedcordError-D9SmwpVL.mjs","names":[],"sources":["../src/ErrorCodes.ts","../src/displayPath.ts","../src/palette.ts","../src/messageText.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 /** Two or more configured emojis failed to resolve at startup. */\n ConfigEmojiUnresolved = 1001,\n /** A configured emoji is neither a name nor a `[name, guildId]` pair. */\n ConfigEmojiInvalid = 1002,\n /** The application or guild a configured emoji points at has no emoji with that name. */\n ConfigEmojiNotFound = 1003,\n /** Reading the emojis of the application or guild a configured emoji points at failed. */\n ConfigEmojiSourceUnreadable = 1004,\n /** Discord has no webhook at a configured URL, because it was deleted or the id or token is wrong. */\n ConfigWebhookNotFound = 1005,\n /** A required environment variable is unset. */\n ConfigMissingEnv = 1006,\n /** An environment variable is set to a value seedcord cannot use. */\n ConfigInvalidEnv = 1007,\n /** A command that runs in guilds is registered without the `Guilds` intent, so discord.js caches no guild. */\n MissingGuildsIntent = 1008,\n /** The running Node or Bun is older than the range seedcord declares in `engines`. */\n UnsupportedRuntimeVersion = 1009,\n /** An edge config sets a REST sweeper interval. */\n ConfigEdgeRestSweeper = 1010,\n /** Another process already listens on the port seedcord tries to listen on. */\n PortInUse = 1011,\n\n /** A startup task was added or removed while startup ran, or added after it finished. */\n LifecycleTaskChangeRejected = 1101,\n /** A lifecycle call got a phase that is not a member of `StartupPhase` or `ShutdownPhase`. */\n LifecycleUnknownPhase = 1102,\n /** One or more tasks failed during a startup phase. */\n LifecyclePhaseFailures = 1103,\n /** A lifecycle task ran past its timeout. */\n LifecycleTaskTimeout = 1104,\n /** A host whose startup failed was started again. */\n LifecycleRestartAfterFailure = 1105,\n /** A shutdown deadline or a plugin's lifecycle timeout is zero, negative, or not finite. */\n LifecycleInvalidTimeout = 1106,\n\n /** A second Seedcord instance was constructed while one already exists. */\n CoreSingletonViolation = 1201,\n /** A plugin was attached after the bot started. */\n CorePluginAfterInit = 1202,\n /** A plugin was attached under a key another plugin already uses. */\n CorePluginKeyExists = 1203,\n /** The bot's own role is missing from the guild's role cache. */\n CoreBotRoleMissing = 1204,\n /** A bot controller was constructed without the folder that holds its handlers. */\n CoreControllerPathMissing = 1205,\n /** seedcord could not import a file in the bot or in the CLI. */\n CoreImportFailed = 1206,\n /** A file or folder that seedcord reads could not be read. */\n CorePathUnreadable = 1207,\n /** A plugin was attached under a key that the framework logs on. */\n CorePluginReservedChannel = 1208,\n /** The application id was read before startup resolved it. */\n CoreApplicationUnavailable = 1209,\n /** A generated accessor like `Emojis` or `Commands` was read for a key that has no value yet. */\n CoreAccessorUnresolved = 1210,\n /** A shutdown task was added on an edge bot. Cloudflare stops an isolate without a shutdown hook. */\n CoreLifecycleUnavailable = 1211,\n /** `emit` was called on the bus. It calls the listeners and skips every subscriber. */\n CoreBusEmitUnavailable = 1212,\n /** A command registers to the `'config'` guilds while `commands.guilds` is empty. */\n CoreCommandGuildsEmpty = 1213,\n /** Discord refused the command deploy for one guild. */\n CoreCommandGuildDeployFailed = 1214,\n /** A plugin was attached under a group name the bot already uses. */\n CorePluginGroupTaken = 1215,\n /** A plugin was attached at a name that holds a group of plugins. */\n CorePluginKeyHoldsGroup = 1216,\n /** A plugin key is empty, has an empty part, or has more than one dot. */\n CorePluginKeyMalformed = 1217,\n /** An attached plugin extends the `Plugin` class of a different copy of `@seedcord/core`. */\n CorePluginFromOtherCore = 1218,\n /** A folder or the `build.start` file is outside `root`. */\n CorePathOutsideRoot = 1219,\n /** A plugin declares a transport or runtime the bot doesn't use. */\n CorePluginScopeMismatch = 1220,\n /** A node http bot got a request through `fetch` before `start()` was called. */\n CoreFetchBeforeStart = 1221,\n /** An edge worker got a POST without the ids that `seedcord build` writes into it. */\n CoreEdgeUnbuilt = 1222,\n /** A relative folder was read in a process that never got the bot's `root`. */\n CoreDirectoryRootUnknown = 1223,\n /** Discord refused the global command deploy. */\n CoreCommandGlobalDeployFailed = 1224,\n /** A built bot read a folder that did not exist under `root` when `seedcord build` ran. */\n CoreDirectoryNotBuilt = 1225,\n /** A webhook sender was constructed with a URL that is not a Discord webhook URL. */\n CoreWebhookUrlInvalid = 1226,\n /** Reading from Discord with `DISCORD_BOT_TOKEN` failed, like the application, its public key, or its commands. */\n CoreDiscordReadFailed = 1227,\n /** Two routes, commands, migrations, or customId fields have the same name, or two code files build to the same file. */\n CoreDuplicateName = 1228,\n /** A Vite plugin from `vitePlugins` threw while Vite started or loaded a file, or failed when seedcord called `vitePlugins`. */\n CoreVitePluginThrew = 1229,\n /** `readFiles` read a folder that `files` in `seedcord.config.ts` leaves out. */\n CoreDirectoryNotListed = 1230,\n /** A folder is inside one that `seedcord build` skips, like a dot-folder, `node_modules`, `outDir` or the logs folder. */\n CoreDirectorySkipped = 1231,\n\n /** A command class carries `@RegisterCommand` twice. */\n DecoratorCommandAlreadyRegistered = 1301,\n /** `@RegisterCommand('global')` was given guild ids. */\n DecoratorCommandGlobalWithGuilds = 1302,\n /** `@RegisterCommand('guild')` was given no guild ids. */\n DecoratorCommandGuildWithoutGuilds = 1303,\n /** A middleware decorator sets a priority that is not a finite number. */\n DecoratorInvalidMiddlewarePriority = 1304,\n /** A `WebhookLog` subclass is missing its `@WebhookUrl` decorator. */\n DecoratorWebhookUrlMissing = 1305,\n /** A middleware decorator got an empty filter array. */\n DecoratorEmptyMiddlewareFilter = 1306,\n\n /** A reply method was called in an ack state where Discord rejects it. */\n ReplyIllegalAckState = 1501,\n /** A reply component threw while seedcord serialized it. */\n ReplyComponentSerialization = 1502,\n /** `edit()` got a message that the interaction did not send. */\n ReplyForeignEditTarget = 1503,\n /** `update()` or `deferUpdate()` was called on a modal that has no source message. */\n ReplyUpdateWithoutSource = 1504,\n /** Discord's response to a `withResponse` callback has no message in it. */\n ReplyCallbackMissingMessage = 1505,\n\n /** A customId prefix is empty, or holds a colon or a control character. */\n CustomIdInvalidPrefix = 1601,\n /** A customId field name looks like an integer. JS reorders integer keys. */\n CustomIdReservedFieldName = 1602,\n /** A `oneOf()` or `someOf()` field was declared with no choices. */\n CustomIdEmptyChoices = 1603,\n /** An `int()` field was declared with a min greater than its max. */\n CustomIdInvalidBounds = 1604,\n /** `encode()` got a value that doesn't fit its field. */\n CustomIdValueRejected = 1605,\n /** An encoded customId is longer than the 100 characters Discord allows. */\n CustomIdWireTooLong = 1606,\n /** A component handler is missing the route decorator that matches its base. */\n CustomIdHandlerRouteMissing = 1607,\n /** A handler's `match()` has no arm for the route, field, event, or command that fired. */\n MatchArmMissing = 1608,\n /** An event handler or middleware read the fired event's name but was constructed without one. */\n EventNameUnavailable = 1609,\n /** Discord sent an autocomplete payload with no focused option. */\n AutocompleteNoFocusedOption = 1610,\n /** The submitted modal has no field with the requested custom id. */\n ModalFieldNotFound = 1611,\n /** A modal field getter was called on a field of another kind. */\n ModalFieldWrongKind = 1612,\n /** A modal field read as required has nothing picked. */\n ModalFieldEmpty = 1613,\n /** A channel select returned a channel whose type the `getSelectedChannels()` call excludes. */\n ModalFieldChannelType = 1614,\n /** A customId was encoded under an older shape of the same definition. */\n CustomIdWireStale = 1615,\n /** A customId is corrupt, truncated, or was encoded by a different definition. */\n CustomIdWireInvalid = 1616,\n /** `dispatch.require()` was called for a key that nothing set on this dispatch. */\n DispatchStateMissing = 1617,\n\n /** A `Cooldown` gate got a duration that doesn't parse, or one of zero or less. */\n GateInvalidCooldownDuration = 1701,\n\n /** A paginator got a `perPage` that is not a positive integer. */\n PaginationInvalidPerPage = 1801,\n /** A control row has no controls, or more than the five buttons Discord allows. */\n PaginationControlCount = 1802,\n /** A control row lists the same control twice. Its two buttons would share a custom_id. */\n PaginationDuplicateControls = 1803,\n\n /** A color value doesn't resolve to a Discord color integer. */\n ColorUnresolvable = 1901,\n /** A resolved color is outside Discord's range of 0x000000 to 0xffffff. */\n ColorOutOfRange = 1902,\n\n /** `renderTable` got a `maxWidth` or `padding` outside the values it accepts. */\n UtilTableOptionInvalid = 1951,\n /** `assertNever` ran with a value that its types ruled out. */\n UtilUnhandledUnionMember = 1952,\n\n /** `WinstonFileSink` got a `filename` with a folder in it. File logs always go in the logs folder. */\n LoggerFileNameHasFolder = 1971,\n\n /** A plugin's constructor called `rejectOptions` on the options it got. */\n PluginOptionsRejected = 2001,\n /** Two or more plugins threw while disposing. */\n PluginDisposeFailures = 2002,\n /** A plugin service class is missing the decorator that registers it. */\n PluginServiceDecoratorMissing = 2003,\n /** A plugin's `services` was read before the plugin finished `init()`. */\n PluginServicesNotReady = 2004,\n /** A plugin could not connect to the service it wraps. */\n PluginConnectionFailed = 2005,\n /** A plugin could not close its connection cleanly during shutdown. */\n PluginDisconnectFailed = 2006,\n\n /** Mongoose threw while building a model, usually for a duplicate model name or a missing schema. */\n PluginMongooseModelCreationFailed = 2101,\n /** A mongoose service was registered with an empty model name. */\n PluginMongooseModelNameMissing = 2102,\n\n /** A kysely service class has no table. */\n PluginKyselyServiceTableMissing = 2201,\n /** A migration run got a step count that is not a non-negative integer. */\n PluginKyselyInvalidStepCount = 2202,\n /** A migration run got a direction other than `up` or `down`. */\n PluginKyselyUnknownDirection = 2203,\n /** A file in the migrations folder has no `up` function. */\n PluginKyselyInvalidMigrationModule = 2204,\n /** A migration failed with a thrown value that is not an `Error`. */\n PluginKyselyNonErrorFailure = 2205,\n /** Creating the target Postgres database failed. */\n PluginKyselyBootstrapFailed = 2206,\n\n /** Someone pressed Ctrl-C at a prompt in `seedcord` or `create-seedcord`. */\n CliCancelled = 3001,\n\n /** The seedcord config file's default export is not an object. */\n CliConfigInvalidExport = 3101,\n /** No seedcord config file exists in the folder the CLI searched. */\n CliConfigNotFound = 3102,\n /** The file that `instance` or `build.start` in the seedcord config points at does not exist. */\n CliFileNotFound = 3103,\n /** The instance file's default export is not a constructed `Seedcord`. */\n CliInstanceInvalid = 3104,\n /** The bot threw during startup. */\n CliStartFailed = 3105,\n /** `build.tsconfig` points at a missing file, or it is unset and the config's folder has no `tsconfig.json`. */\n CliTsconfigNotFound = 3106,\n /** `seedcord build` found type errors. */\n CliBuildFailed = 3107,\n /** `commands clean` or `commands purge` ran without a flag that picks where it deletes. */\n CliNoScopeGiven = 3108,\n /** cloudflared never reported a quick tunnel hostname. */\n CliTunnelUrlUnavailable = 3109,\n /** Discord rejected the tunnel URL as an interactions endpoint. */\n CliTunnelNotVerified = 3110,\n /** The tunnel URL never answered its health probe. */\n CliTunnelUnreachable = 3111,\n /** A field in the seedcord config is missing or has the wrong shape. */\n CliConfigInvalidField = 3112,\n /** A class carrying `@RegisterCommand` threw while seedcord constructed it. */\n CliCommandConstructorThrew = 3113,\n /** Vite threw while bundling the bot. */\n CliBundleFailed = 3114,\n /** `build.outDir` is `root` or a folder that contains it. */\n CliConfigOutDirDeletesRoot = 3115,\n /** The project is missing a dev dependency the CLI runs, like `typescript` or `@cloudflare/vite-plugin`. */\n CliDependencyMissing = 3116,\n /** `build.outDir` already has other files in it. */\n CliBuildOutDirNotEmpty = 3117,\n /** One CLI step found two or more problems. Each one is in the error's `errors`. */\n CliProblems = 3118,\n /** `seedcord codegen --check` found the committed augmentations out of date. */\n CliCodegenOutOfDate = 3119,\n /** A file or folder in the project has a `#` in its path. */\n CliPathHasHash = 3120,\n /** An edge bot's tsconfig is missing the `workerd` condition. */\n CliEdgeWithoutWorkerdCondition = 3121,\n /** A bot with no `cloudflare.config.ts` sets the `workerd` condition in its tsconfig. */\n CliWorkerdConditionWithoutCloudflareConfig = 3122,\n /** TypeScript could not read the project's tsconfig, or Cloudflare's config loader could not read `cloudflare.config.ts`. */\n CliConfigFileUnreadable = 3123,\n /** The CLI could not start the TypeScript compiler. */\n CliTypescriptNotStarted = 3124,\n /** A config file sets a field this bot can't set, like `entrypoint` in an edge bot's `cloudflare.config.ts`. */\n CliConfigFieldUnused = 3125,\n /** An edge bot's `compatibilityDate` is older than Cloudflare's Node compat default, and no flag turns it on. */\n CliEdgeCompatDateTooOld = 3126,\n /** An edge bot sets `no_nodejs_compat`. */\n CliEdgeNodeCompatOff = 3127,\n /** The build could not start the edge worker in workerd. */\n CliEdgeBootFailed = 3128,\n /** An edge bot's `root` holds its seedcord config. */\n CliEdgeRootHoldsConfig = 3129,\n /** An edge build found commands in code that have no deployed id on Discord. */\n CliEdgeCommandsNotDeployed = 3130,\n /** Something called the dev runtime before `start()` finished or after `stop()`. This is a bug in seedcord. */\n CliDevRuntimeNotRunning = 3131,\n /** `seedcord commands deploy` ran on a bot whose `commands.path` is `null`. */\n CliDeployNoCommandsFolder = 3132,\n /** `seedcord commands deploy` ran without `--yes` where it cannot ask first. */\n CliDeployNeedsYes = 3133,\n /** A class carrying `@RegisterCommand` builds a component that is not a command or a context menu. */\n CliCommandNotACommand = 3134,\n /** `seedcord commands clean` or `purge` could not delete some of the commands it picked. */\n CliCommandsNotDeleted = 3135,\n /** The CLI ran on Bun for an edge bot. */\n CliEdgeOnBun = 3136,\n /** An edge bot's `cloudflare.config.ts` sets no `worker`. */\n CliEdgeNoWorker = 3137,\n /** The running `seedcord` is a different install from the project's own. */\n CliNotProjectInstall = 3138,\n /** Vite's environments leave out the one seedcord runs the bot in. */\n CliViteEnvironmentMissing = 3139,\n /** A folder that `files` in `seedcord.config.ts` lists is missing or is a file. */\n CliListedFolderUnusable = 3140,\n /** Another `seedcord dev` already runs a bot on the same Discord application. */\n CliDevAlreadyRunning = 3141,\n /** The folder that holds the dev session locks belongs to another user. */\n CliDevLockFolderNotOwned = 3142,\n\n /** A flag answers a question that the earlier answers skip. */\n CreateFlagNotApplicable = 3201,\n /** A flag has a value its question rejects. */\n CreateInvalidAnswer = 3202,\n /** The command line did not parse. */\n CreateBadUsage = 3203,\n /** The target path already has files in it. */\n CreateTargetNotEmpty = 3204,\n /** A command that create-seedcord ran exited non-zero. */\n CreateStepFailed = 3205\n}\n","interface DisplayPathOptions {\n // without one, the working directory itself prints as ./\n prefix?: string;\n}\n\n// the edge build of this package can't import node:path\nexport function displayPath(rawPath: string, { prefix }: DisplayPathOptions = {}): string {\n const path = forwardSlashes(rawPath.length > 1 ? rawPath.replace(/[/\\\\]+$/, '') : rawPath);\n if (typeof process === 'undefined' || typeof process.cwd !== 'function') return path;\n\n const cwd = forwardSlashes(process.cwd());\n\n if (path === cwd) return prefix ?? './';\n return path.startsWith(`${cwd}/`) ? `${prefix ?? ''}${path.slice(cwd.length + 1)}` : path;\n}\n\nfunction forwardSlashes(path: string): string {\n return path.replaceAll('\\\\', '/');\n}\n","import chalk from 'chalk';\n\nimport { displayPath } from './displayPath';\n\nimport type { ColorSupportLevel } from 'chalk';\n\n// @seedcord/ui carries the same three for the web\nexport const BRAND = {\n flesh: '#f04e36',\n rind: '#6fab49',\n pith: '#f8f6e8'\n} as const;\n\n// chalk turns color on only for a chromium user agent outside node\nexport function setColorLevel(level: ColorSupportLevel): void {\n chalk.level = level;\n}\n\nconst SKY = '#8fc7ff';\n\n// truecolor because a terminal theme remaps chalk's 16-color names (blue turns orange in monokai)\n// chalk.hex reads the color level once, when it runs. a getter picks up a level set later, like the edge worker's\nexport const paint = {\n // what the line is about, one per line\n get sky() {\n return chalk.hex(SKY);\n },\n path: (path: string) => chalk.hex(SKY)(displayPath(path)),\n // a count\n get iris() {\n return chalk.hex('#e29bff');\n },\n // success\n get mint() {\n return chalk.hex('#66d98a');\n },\n // go do something about this\n get amber() {\n return chalk.hex('#ffc061');\n },\n // failure\n get coral() {\n return chalk.hex('#ff6b85');\n },\n // brand marks\n get flesh() {\n return chalk.hex(BRAND.flesh);\n },\n get rind() {\n return chalk.hex(BRAND.rind);\n },\n get pith() {\n return chalk.hex(BRAND.pith);\n },\n // context around the subject\n mute: chalk.dim,\n\n check: '✔︎', // U+FE0E to prevent emoji font\n cross: '✘',\n\n // weight and shape\n bold: chalk.bold,\n italic: chalk.italic,\n underline: chalk.underline\n} as const;\n\nexport const WORDMARK = `${paint.flesh.bold('seed')}${paint.rind.bold('cord')}`;\n","import { paint } from './palette';\n\n// a reason from a caught error may or may not end in a period\nexport function sentence(text: string): string {\n // a multi-line reason usually ends in a code frame\n if (text.includes('\\n')) return text;\n return /[.!?]$/.test(text) ? text : `${text}.`;\n}\n\nexport function reasonThen(reason: string, next: string): string {\n return `${sentence(reason)}${reason.includes('\\n') ? '\\n' : ' '}${next}`;\n}\n\n// @seedcord/utils depends on this package, so its pluralize is out of reach here\nconst plurals = new Intl.PluralRules('en');\nexport const allOf = new Intl.ListFormat('en', { type: 'conjunction' });\nexport const oneOf = new Intl.ListFormat('en', { type: 'disjunction' });\n\nexport function isOne(count: number): boolean {\n return plurals.select(count) === 'one';\n}\n\nexport function counted(count: number, one: string, many: string): string {\n return `${count} ${isOne(count) ? one : many}`;\n}\n\nexport const quoted = (value: string): string => paint.sky(JSON.stringify(value));\n","import { SeedcordErrorCode } from './ErrorCodes';\nimport { allOf, counted, isOne, oneOf, quoted, reasonThen, sentence } from './messageText';\nimport { paint } from './palette';\n\nexport interface VitePluginPlace {\n hook?: string | undefined;\n // only load and transform run on a module\n loading?: { kind: 'file'; path: string } | { kind: 'virtual'; id: string } | undefined;\n}\n\nfunction placeText(hook: string, loading: VitePluginPlace['loading']): string {\n const inHook = `in its ${paint.bold(hook)} hook`;\n if (loading === undefined) return inHook;\n const shown = loading.kind === 'file' ? paint.path(loading.path) : paint.bold(loading.id);\n return `${inHook} while loading ${shown}`;\n}\n\nfunction vitePluginFix({ loading }: VitePluginPlace): string {\n if (loading?.kind !== 'file') return 'Check the options you pass the plugin.';\n return `Fix ${paint.path(loading.path)}, or check the options you pass the plugin if that file looks right.`;\n}\n\nconst listedFolderProblems = {\n missing: `which does not exist. Create it, or take it out of ${paint.bold('files')}.`,\n file: `which is a file. ${paint.bold('files')} takes folders. List the folder that holds it.`,\n outsideProject: `which is outside the folder that holds seedcord.config.ts. Move it into that folder and list its new path.`\n};\n\n// the edge worker sets chalk's color level after this module loads\nconst token = (): string => paint.bold('DISCORD_BOT_TOKEN');\n\nconst BAD_REQUEST = 400;\nconst UNAUTHORIZED = 401;\n\nfunction deployFix(status: number | undefined, otherwise: string): string {\n if (status === UNAUTHORIZED) return `Check that ${token()} is still valid.`;\n if (status === BAD_REQUEST) return \"Check that each command's name, description and options are valid.\";\n return otherwise;\n}\n\n/** @internal */\nconst messages = {\n [SeedcordErrorCode.ConfigEmojiUnresolved]: (count: number) =>\n `${paint.iris(count)} configured emojis could not be resolved. Each one is listed below.`,\n [SeedcordErrorCode.ConfigEmojiInvalid]: (key: string) =>\n `The emoji ${paint.sky(key)} in ${paint.bold('bot.emojis')} has a value seedcord cannot read. Set it to the emoji's name, or to a ${paint.bold('[name, guildId]')} pair for a guild emoji.`,\n [SeedcordErrorCode.ConfigEmojiNotFound]: (key: string, name: string, where: string) =>\n `The emoji ${paint.sky(key)} points at ${paint.bold(name)}, but ${where} has no emoji with that name. Check the spelling, or upload the emoji there.`,\n [SeedcordErrorCode.ConfigEmojiSourceUnreadable]: (\n key: string,\n name: string,\n where: string,\n reason: string,\n fix: string\n ) =>\n `Could not read the emojis in ${where} to resolve ${paint.sky(key)} (${paint.bold(name)}). ${reasonThen(reason, fix)}`,\n [SeedcordErrorCode.ConfigWebhookNotFound]: (envKey: string) =>\n `Discord has no webhook at the URL in ${paint.bold(envKey)}. Someone deleted it, or the id or token in the URL is wrong. Create a webhook and copy its URL.`,\n [SeedcordErrorCode.ConfigMissingEnv]: (name: string) =>\n `${paint.bold(name)} is not set. Add it to your environment or your .env file.`,\n [SeedcordErrorCode.ConfigInvalidEnv]: (name: string, expected: string, why?: string) =>\n `${paint.bold(name)} has a value seedcord cannot use.${why ? ` ${why}` : ''} Set it to ${expected}.`,\n [SeedcordErrorCode.MissingGuildsIntent]: (commands: readonly string[]) =>\n `Add GatewayIntentBits.Guilds to clientOptions.intents. Without it discord.js doesn't cache any guild, so interaction.guild is null inside the ${isOne(commands.length) ? 'command' : 'commands'} ${allOf.format(commands.map((name) => paint.sky(name)))}.`,\n [SeedcordErrorCode.UnsupportedRuntimeVersion]: (runtime: string, required: string, running: string) =>\n `seedcord requires ${runtime} ${required}, but this process runs ${running}. Upgrade ${runtime} before starting the bot.`,\n [SeedcordErrorCode.ConfigEdgeRestSweeper]: (key: string) =>\n `Remove ${paint.sky(`bot.restOptions.${key}`)} from your edge config. A sweeper interval starts a timer at the worker's global scope, where workerd throws.`,\n [SeedcordErrorCode.PortInUse]: (port: number, setting: string, configFile?: string) =>\n `Another process already listens on port ${port}. Stop it, or set ${paint.bold(setting)} in ${configFile ? paint.path(configFile) : 'your Seedcord config'} to a free port.`,\n\n [SeedcordErrorCode.LifecycleTaskChangeRejected]: (action: 'add' | 'remove', startup: 'running' | 'finished') =>\n `${startup === 'running' ? 'Startup is running, so its tasks cannot change.' : 'Startup already finished, so this task would never run.'} ${action === 'add' ? 'Add' : 'Remove'} startup tasks before you call ${paint.bold('start()')}.`,\n [SeedcordErrorCode.LifecycleUnknownPhase]: (phase: unknown) =>\n `${paint.sky(String(phase))} is not a lifecycle phase. Pass a member of ${paint.bold('StartupPhase')} or ${paint.bold('ShutdownPhase')}.`,\n [SeedcordErrorCode.LifecyclePhaseFailures]: (phase: string, failures: number) =>\n `${counted(failures, 'task', 'tasks')} failed in the ${phase} phase. Each one is listed below.`,\n [SeedcordErrorCode.LifecycleTaskTimeout]: (taskName: string, timeout: number) =>\n `Task \"${taskName}\" timed out after ${timeout}ms. Check what it waits on, or give it a longer timeout.`,\n [SeedcordErrorCode.LifecycleRestartAfterFailure]: () =>\n 'Startup failed, so this host cannot start again. Construct a new instance.',\n [SeedcordErrorCode.LifecycleInvalidTimeout]: (setting: string, value: number) =>\n `${paint.bold(setting)} is ${value}. Pass a positive number of milliseconds, or leave it out for the default.`,\n\n [SeedcordErrorCode.CoreSingletonViolation]: () =>\n 'Seedcord can only be constructed once per process. Use the instance you already have.',\n [SeedcordErrorCode.CorePluginAfterInit]: () =>\n 'Cannot attach a plugin once the bot has started. Attach every plugin before start(), or before the first request on an edge bot.',\n [SeedcordErrorCode.CorePluginKeyExists]: (key: string) =>\n `A plugin is already attached at ${paint.sky(key)}. Attach this one under another key.`,\n [SeedcordErrorCode.CoreBotRoleMissing]: (guildId?: string) =>\n `The role cache of ${guildId ? `guild ${paint.sky(guildId)}` : 'this guild'} has no role for the bot. discord.js fills that cache through the Guilds intent, so check that clientOptions.intents includes GatewayIntentBits.Guilds.`,\n [SeedcordErrorCode.CoreControllerPathMissing]: (controllerName: string, pathKind: string) =>\n `${paint.sky(controllerName)} was constructed without a ${pathKind} path. This is a bug in seedcord.`,\n [SeedcordErrorCode.CoreImportFailed]: (file: string, reason: string) =>\n `Could not import ${paint.path(file)}. ${sentence(reason)}`,\n [SeedcordErrorCode.CoreVitePluginThrew]: (\n plugin: string,\n place: VitePluginPlace,\n configFile: string,\n reason: string\n ) =>\n place.hook === undefined\n ? `${paint.sky(plugin)} in ${paint.path(configFile)} failed when seedcord called ${paint.bold('vitePlugins')}. ${reasonThen(reason, 'Check that the package is installed and that its import resolves.')}`\n : `The Vite plugin ${paint.sky(plugin)} from ${paint.bold('vitePlugins')} in ${paint.path(configFile)} threw ${placeText(place.hook, place.loading)}. ${reasonThen(reason, vitePluginFix(place))}`,\n [SeedcordErrorCode.CorePathUnreadable]: (path: string, reason: string) =>\n `Could not read ${paint.path(path)}. ${reasonThen(reason, 'Check that it exists and that this process can read it.')}`,\n [SeedcordErrorCode.CorePathOutsideRoot]: (path: string, root: string) =>\n `${paint.path(path)} is outside ${paint.bold('root')} (${paint.path(root)}). ${paint.bold('seedcord build')} bundles only the files under ${paint.bold('root')}. Move it under ${paint.bold('root')}, or set ${paint.bold('root')} in seedcord.config.ts to a folder that holds it.`,\n [SeedcordErrorCode.CoreDirectoryRootUnknown]: (dir: string) =>\n `${paint.path(dir)} is relative to ${paint.bold('root')}, but nothing set ${paint.bold('root')} in this process. ${paint.bold('seedcord codegen')}, ${paint.bold('build')}, and ${paint.bold('commands')} import bot.ts without starting it, so read the folder in a startup task or a plugin's init(). In a test or a script, pass an absolute path like ${paint.sky(`resolve(import.meta.dirname, '${dir}')`)}.`,\n [SeedcordErrorCode.CoreDirectoryNotBuilt]: (dir: string, root: string) =>\n `${paint.path(dir)} was not a folder under ${paint.bold('root')} (${paint.path(root)}) or in ${paint.bold('files')} when ${paint.bold('seedcord build')} ran, so the build holds none of its files. Create the folder, then build again.`,\n [SeedcordErrorCode.CoreDirectoryNotListed]: (dir: string) =>\n `${paint.bold('readFiles')} was called on ${paint.path(dir)}, which is outside every folder in ${paint.bold('files')} in seedcord.config.ts. ${paint.bold('seedcord build')} bundles non-code files from only those folders. Add it to ${paint.bold('files')}, like ${paint.sky(\"files: ['./locales']\")}.`,\n [SeedcordErrorCode.CoreDirectorySkipped]: (dir: string) =>\n `${paint.path(dir)} is in a folder ${paint.bold('seedcord build')} skips, so a built bot holds none of its files. The build skips dot-folders, node_modules, outDir, the logs folder beside seedcord.config.ts and project files like package.json. Move the files to a folder outside those.`,\n [SeedcordErrorCode.CorePluginGroupTaken]: (head: string, key: string) =>\n `${paint.bold(head)} is already taken on this bot, so ${paint.sky(key)} cannot nest under it. Pick another group name.`,\n [SeedcordErrorCode.CorePluginKeyMalformed]: (key: string, reason: string) =>\n `${paint.sky(key)} ${reason} Write a group and a plugin name around one dot, like 'services.users'.`,\n [SeedcordErrorCode.CorePluginFromOtherCore]: (plugin: string) =>\n `${paint.sky(plugin)} doesn't extend the ${paint.bold('Plugin')} class your bot uses. That usually means two copies of ${paint.bold('@seedcord/core')} are installed. Update the plugin and your ${paint.bold('@seedcord')} packages to versions that need the same ${paint.bold('@seedcord/core')}. Your package manager can list each installed copy and the package that pulled it in.`,\n [SeedcordErrorCode.CorePluginScopeMismatch]: (plugin: string, axis: string, declared: string, host: string) =>\n `${paint.sky(plugin)} only runs on the ${paint.bold(declared)} ${axis}, but this bot uses the ${paint.bold(host)} ${axis}. Remove the ${paint.bold('attach')} call, or move the bot to the ${paint.bold(declared)} ${axis}.`,\n [SeedcordErrorCode.CorePluginKeyHoldsGroup]: (key: string) =>\n `${paint.sky(key)} already holds a group of plugins. Attach this one under a name of its own.`,\n [SeedcordErrorCode.CorePluginReservedChannel]: (key: string) =>\n `${paint.sky(key)} is a channel the framework logs on. Attach the plugin under another key.`,\n [SeedcordErrorCode.CoreApplicationUnavailable]: () =>\n \"The bot's application id resolves during startup. You read it before that. Read it inside a handler, inside a plugin's ready(), or after start() resolves. An edge bot resolves it on its first request.\",\n [SeedcordErrorCode.CoreEdgeUnbuilt]: () =>\n `This worker has no public key or command ids. ${paint.bold('seedcord build')} reads them from Discord and writes them into the worker it builds. Deploy that build.`,\n [SeedcordErrorCode.CoreFetchBeforeStart]: () =>\n `${paint.bold('fetch()')} ran before ${paint.bold('start()')}. Call ${paint.bold('await seedcord.start()')} before your server passes requests to ${paint.bold('fetch()')}.`,\n [SeedcordErrorCode.CoreAccessorUnresolved]: (accessor: string, key: string) =>\n `${paint.sky(`${accessor}.${key}`)} has no value yet. ${accessor} fills during startup, but a read at the top of a file runs before that. Read it inside a handler, or after start() resolves.`,\n [SeedcordErrorCode.CoreLifecycleUnavailable]: () =>\n `core.shutdown.addTask() does not work on an edge bot. Cloudflare stops an isolate with no shutdown hook, so a shutdown task would never run. To use shutdown tasks, run the bot on node with new Seedcord(config).start().`,\n [SeedcordErrorCode.CoreBusEmitUnavailable]: (event: string) =>\n `core.bus.emit('${event}') would reach your on() listeners but skip every Subscriber class. Call core.bus.publish('${event}', data) to run both.`,\n [SeedcordErrorCode.CoreCommandGuildsEmpty]: (commandName: string) =>\n `${paint.sky(commandName)} registers to the 'config' guilds while commands.guilds is empty.\\nList the ids under commands.guilds, or pass them to @RegisterCommand('guild', [...]).`,\n [SeedcordErrorCode.CoreCommandGuildDeployFailed]: (guildId: string, reason: string, status?: number) =>\n `Discord refused the command deploy for guild ${paint.sky(guildId)}. ${reasonThen(reason, deployFix(status, 'Check that the id is right, and that your bot is in that server.'))}`,\n [SeedcordErrorCode.CoreCommandGlobalDeployFailed]: (reason: string, status?: number) =>\n `Discord refused the global command deploy. ${reasonThen(reason, deployFix(status, 'Try again, and check discordstatus.com if it keeps failing.'))}`,\n [SeedcordErrorCode.CoreWebhookUrlInvalid]: (className: string) =>\n `${paint.sky(className)} was given a URL that is not a Discord webhook URL. Pass the URL from the channel's Integrations settings, which looks like ${paint.bold('https://discord.com/api/webhooks/<id>/<token>')}.`,\n [SeedcordErrorCode.CoreDiscordReadFailed]: (what: string, reason: string, fix?: string) =>\n `Could not read ${what} from Discord (${reason}). ${fix ?? `Check that ${token()} is still valid.`}`,\n [SeedcordErrorCode.CoreDuplicateName]: (\n kind: string,\n name: string,\n sources: readonly string[] = [],\n note?: string\n ) =>\n `${sources.length > 0 ? `${allOf.format(sources)} define the ${kind} ${quoted(name)}.` : `The ${kind} ${quoted(name)} is defined twice.`}${note ? ` ${note}` : ''} Rename one.`,\n\n [SeedcordErrorCode.DecoratorCommandAlreadyRegistered]: (\n commandName: string,\n existingCall: string,\n requestedCall: string\n ) =>\n `${paint.sky(commandName)} is registered twice, first with ${existingCall}, then with ${requestedCall}. Keep one.`,\n [SeedcordErrorCode.DecoratorCommandGlobalWithGuilds]: (className: string) =>\n `${paint.sky(className)} passes guild ids to ${paint.bold(\"@RegisterCommand('global')\")}. Remove them, or register it with ${paint.bold(\"@RegisterCommand('guild', [...])\")}.`,\n [SeedcordErrorCode.DecoratorCommandGuildWithoutGuilds]: (className: string) =>\n `${paint.sky(className)} uses ${paint.bold(\"@RegisterCommand('guild')\")} with an empty guild list. Pass the guild ids as the second argument.`,\n [SeedcordErrorCode.DecoratorInvalidMiddlewarePriority]: (className: string, priority: string) =>\n `${paint.sky(className)} sets its middleware priority to ${priority}. Pass a finite number.`,\n [SeedcordErrorCode.DecoratorWebhookUrlMissing]: (className: string) =>\n `${paint.sky(className)} extends WebhookLog without a ${paint.bold('@WebhookUrl')} decorator. Add one with the name of the env var that holds the webhook URL.`,\n [SeedcordErrorCode.DecoratorEmptyMiddlewareFilter]: (className: string, key: string) =>\n `${paint.sky(className)} passes an empty array as ${paint.bold(key)}. Remove the key to run the middleware on everything.`,\n\n [SeedcordErrorCode.ReplyIllegalAckState]: (method: string, reason: string, alternative: string, routeId: string) =>\n `${paint.sky(`${method}()`)} was called when ${reason}.\\n${alternative} (route ${paint.mute(routeId)})`,\n [SeedcordErrorCode.ReplyComponentSerialization]: (\n componentClass: string,\n index: number,\n detail: string,\n routeId: string\n ) =>\n `${paint.sky(componentClass)} at components[${index}] failed to serialize: ${detail.replace(/\\.$/, '')}. (route ${paint.mute(routeId)})`,\n [SeedcordErrorCode.ReplyForeignEditTarget]: (method: string, targetId: string, routeId: string) =>\n `${paint.sky(`${method}()`)} was passed message ${targetId}, which this interaction did not send.\\nPass a message this interaction sent, returned by reply(), followUp(), edit(), or update(). (route ${paint.mute(routeId)})`,\n [SeedcordErrorCode.ReplyUpdateWithoutSource]: (method: string, routeId: string) =>\n `${paint.sky(`${method}()`)} was called on a modal opened from a command, which has no source message.\\nUse reply() or defer(). (route ${paint.mute(routeId)})`,\n [SeedcordErrorCode.ReplyCallbackMissingMessage]: (method: string, routeId: string) =>\n `Discord's interaction callback for ${paint.sky(`${method}()`)} returned no message. (route ${paint.mute(routeId)})`,\n\n [SeedcordErrorCode.CustomIdInvalidPrefix]: (prefix: string) =>\n `The customId prefix ${quoted(prefix)} is empty or holds a colon or a control character. Pick a prefix without them.`,\n [SeedcordErrorCode.CustomIdReservedFieldName]: (field: string) =>\n `The customId field name ${quoted(field)} looks like an integer. JS reorders integer keys, which would scramble the field order. Give it a name that is not a number.`,\n [SeedcordErrorCode.CustomIdEmptyChoices]: (field: string, method: string) =>\n `The customId field ${quoted(field)} uses ${method}() with no choices. Give it at least one choice, or make the field nullable.`,\n [SeedcordErrorCode.CustomIdInvalidBounds]: (field: string, min: number, max: number) =>\n `The customId field ${quoted(field)} has min ${min}, which is greater than max ${max}. Swap them, or fix the one that is wrong.`,\n [SeedcordErrorCode.CustomIdValueRejected]: (field: string, expected: string, value: string) =>\n `The customId field ${quoted(field)} expects ${expected}, but encode() got ${value}.`,\n [SeedcordErrorCode.CustomIdWireTooLong]: (prefix: string, length: number) =>\n `A customId encoded by ${quoted(prefix)} is ${length} characters, but Discord allows at most 100. Shorten the prefix, or move a field out of the customId.`,\n [SeedcordErrorCode.CustomIdHandlerRouteMissing]: (className: string) =>\n `${paint.sky(className)} is missing its route decorator. Add the one that matches its base, for example ${paint.bold('@ButtonRoute')} or ${paint.bold('@UserMenuRoute')}.`,\n [SeedcordErrorCode.MatchArmMissing]: (handler: string, kind: string, value: string) =>\n `${paint.bold(handler)}'s match() has no arm for the ${kind} ${quoted(value)}. Add one to the object you pass to match().`,\n [SeedcordErrorCode.EventNameUnavailable]: (handler: string, read: string) =>\n `${paint.sky(handler)} read ${paint.bold(read)}, but it was constructed without the name of the event that fired. The event controller passes that name. A handler or middleware you construct yourself takes it as the fourth constructor argument.`,\n [SeedcordErrorCode.AutocompleteNoFocusedOption]: () =>\n 'Discord sent an autocomplete payload with no focused option.',\n [SeedcordErrorCode.ModalFieldNotFound]: (customId: string) =>\n `The submitted modal carries no field with the custom id ${quoted(customId)}. Check it against the id you gave the component when you built the modal.`,\n [SeedcordErrorCode.ModalFieldWrongKind]: (customId: string, kind: string, getter?: string) =>\n getter\n ? `The modal field ${quoted(customId)} holds ${kind}. Read it with ${paint.bold(`${getter}()`)}.`\n : `The modal field ${quoted(customId)} holds ${kind}, but none of the getters read that kind.`,\n [SeedcordErrorCode.ModalFieldEmpty]: (customId: string) =>\n `The modal field ${quoted(customId)} has nothing picked. Build the component as required, or read it without the required argument.`,\n [SeedcordErrorCode.ModalFieldChannelType]: (customId: string, picked: string, allowed: readonly string[]) =>\n `The modal field ${quoted(customId)} picked a ${picked} channel, but this read allows ${oneOf.format(allowed)}. Give the channel select the same channel types.`,\n [SeedcordErrorCode.CustomIdWireStale]: (prefix: string) =>\n `The customId ${quoted(prefix)} was encoded under an older shape of this definition. Adding, removing, changing, or moving a field changes the layout hash.`,\n [SeedcordErrorCode.CustomIdWireInvalid]: (detail: string) =>\n `The customId could not be decoded. ${sentence(detail)}`,\n [SeedcordErrorCode.DispatchStateMissing]: (key: string) =>\n `Nothing set ${paint.sky(key)} on this dispatch. Check that the middleware writing it is registered and that its filter covers this dispatch.`,\n\n [SeedcordErrorCode.GateInvalidCooldownDuration]: (input: string) =>\n `The cooldown duration ${quoted(input)} is not valid. Pass a positive number of seconds, or a duration string like '30m', '24h', or '500ms'.`,\n\n [SeedcordErrorCode.PaginationInvalidPerPage]: (perPage: number) =>\n `perPage is ${perPage}. Pass a positive integer.`,\n [SeedcordErrorCode.PaginationControlCount]: (count: number, max: number) =>\n `This control row has ${counted(count, 'button', 'buttons')}. Pass 1 to ${max}, the most Discord allows in one row.`,\n [SeedcordErrorCode.PaginationDuplicateControls]: (key: string) =>\n `This control row repeats the ${paint.sky(key)} control. Each control can appear once in a row.`,\n\n [SeedcordErrorCode.ColorUnresolvable]: (value: string) =>\n `Cannot convert ${value} into a color. Pass a hex string like '#5865f2', a number, an [r, g, b] tuple, or a color name from the palette.`,\n [SeedcordErrorCode.ColorOutOfRange]: (value: number) =>\n `${value} is outside Discord's color range, 0 to 16777215 (0xffffff).`,\n\n [SeedcordErrorCode.UtilTableOptionInvalid]: (option: string, expected: string, value: number) =>\n `renderTable's ${paint.bold(option)} is ${value}. Pass ${expected}.`,\n [SeedcordErrorCode.UtilUnhandledUnionMember]: (value: string) =>\n `assertNever() ran with ${value}, which its types ruled out. Something passed a value outside the union.`,\n [SeedcordErrorCode.LoggerFileNameHasFolder]: (filename: string, logsFolder: string) =>\n `${paint.bold('WinstonFileSink')} got ${paint.path(filename)} as its ${paint.bold('filename')}, which has a folder in it. File logs always go in ${paint.path(logsFolder)}. Pass only the file name, like ${paint.sky(\"'bot-{date}.log'\")}.`,\n\n [SeedcordErrorCode.PluginOptionsRejected]: (pluginName: string, reason: string) =>\n `${paint.sky(pluginName)} rejected its options. ${sentence(reason.charAt(0).toUpperCase() + reason.slice(1))}`,\n [SeedcordErrorCode.PluginDisposeFailures]: (count: number) =>\n `${paint.iris(count)} plugins failed to dispose. Each one is listed below.`,\n [SeedcordErrorCode.PluginServiceDecoratorMissing]: (decorator: string, className: string) =>\n `${paint.sky(className)} is missing ${paint.bold(decorator)}. Add it to the class to register the service.`,\n [SeedcordErrorCode.PluginServicesNotReady]: (pluginName: string) =>\n `${paint.sky(`${pluginName}.services`)} was read before the plugin finished ${paint.bold('init()')}. Read it inside a handler, or after start() resolves.`,\n [SeedcordErrorCode.PluginConnectionFailed]: (service: string, target?: string) =>\n `Could not connect to ${paint.bold(service)}${target ? ` (${paint.sky(target)})` : ''}. Check that it is running and that the connection string is right.`,\n [SeedcordErrorCode.PluginDisconnectFailed]: (service: string) =>\n `Could not close the ${paint.bold(service)} connection cleanly during shutdown.`,\n\n [SeedcordErrorCode.PluginMongooseModelCreationFailed]: (modelName: string, className: string) =>\n `Could not build the mongoose model ${paint.sky(modelName)} for ${paint.bold(className)}. Check for another model with that name, and that the class has a schema.`,\n [SeedcordErrorCode.PluginMongooseModelNameMissing]: (className: string) =>\n `${paint.sky(className)} passes an empty model name to ${paint.bold('@RegisterMongooseService()')}. Pass a non-empty modelName.`,\n\n [SeedcordErrorCode.PluginKyselyServiceTableMissing]: (className: string) =>\n `${paint.sky(className)} has no table. Pass one to ${paint.bold('@RegisterKyselyService()')}.`,\n [SeedcordErrorCode.PluginKyselyInvalidStepCount]: (steps: number) =>\n `The migration step count is ${steps}. Pass zero or a positive integer.`,\n [SeedcordErrorCode.PluginKyselyUnknownDirection]: (direction: unknown) =>\n `${paint.sky(String(direction))} is not a migration direction. Pass 'up' or 'down'.`,\n [SeedcordErrorCode.PluginKyselyInvalidMigrationModule]: (filePath: string) =>\n `${paint.path(filePath)} needs an up function because it is in the migrations folder. Export up, and down if you need it, by name or on a default export object. Move a helper file out of the folder.`,\n [SeedcordErrorCode.PluginKyselyNonErrorFailure]: (message: string) =>\n `A migration failed with a value that is not an Error: ${message}.`,\n [SeedcordErrorCode.PluginKyselyBootstrapFailed]: (databaseName: string) =>\n `Could not create the database ${paint.sky(databaseName)}. Check that the database user may create databases, or create it yourself.`,\n\n [SeedcordErrorCode.CliCancelled]: () => 'Cancelled.',\n\n [SeedcordErrorCode.CliConfigInvalidExport]: () =>\n `The seedcord config file must default export an object, like ${paint.bold('export default defineConfig({ ... })')}.`,\n [SeedcordErrorCode.CliConfigNotFound]: (baseDir: string, candidates: readonly string[]) =>\n `Searched ${paint.path(baseDir)} for ${oneOf.format(candidates)} and found none. Run the command from your bot's folder, or create a ${paint.sky('seedcord.config.ts')} there.`,\n [SeedcordErrorCode.CliConfigInvalidField]: (field: string, expected: string) =>\n `${paint.bold(field)} in the seedcord config must be ${expected}.`,\n [SeedcordErrorCode.CliFileNotFound]: (path: string, field: string) =>\n `Cannot find ${paint.path(path)}. Point ${paint.bold(field)} in the seedcord config at a file that exists.`,\n [SeedcordErrorCode.CliInstanceInvalid]: (instancePath: string) =>\n `${paint.path(instancePath)} must default export the bot, a ${paint.bold('new Seedcord(...)')}, from ${paint.bold('@seedcord/gateway')} or ${paint.bold('@seedcord/http')}.`,\n [SeedcordErrorCode.CliStartFailed]: (instancePath: string, reason: string) =>\n `Failed to start the bot from ${paint.path(instancePath)}: ${reason}`,\n [SeedcordErrorCode.CliTsconfigNotFound]: (configDir: string, configured?: string) =>\n configured\n ? `${paint.bold('build.tsconfig')} points at ${paint.path(configured)}, which does not exist. Fix the path, or remove it to use the ${paint.sky('tsconfig.json')} in ${paint.path(configDir)}.`\n : `${paint.path(configDir)} does not contain a ${paint.sky('tsconfig.json')}. Add one there, or set ${paint.bold('build.tsconfig')} in the seedcord config.`,\n [SeedcordErrorCode.CliDependencyMissing]: (packages: readonly string[], projectDir: string, why: string) =>\n `Add ${allOf.format(packages.map((name) => paint.bold(name)))} to ${paint.path(projectDir)} as ${isOne(packages.length) ? 'a dev dependency' : 'dev dependencies'}. ${why}`,\n [SeedcordErrorCode.CliBuildFailed]: (diagnostics: string) => `Type check failed:\\n${diagnostics}`,\n [SeedcordErrorCode.CliBundleFailed]: (reason: string) => `Vite could not bundle the bot:\\n${reason}`,\n [SeedcordErrorCode.CliConfigOutDirDeletesRoot]: (outDir: string, root: string) =>\n `${paint.bold('build.outDir')} is ${paint.path(outDir)}, which contains ${paint.bold('root')} (${paint.path(root)}). ${paint.bold('seedcord build')} empties ${paint.bold('outDir')} before it writes. Point it at a folder of its own, like ${paint.sky('./dist')}.`,\n [SeedcordErrorCode.CliBuildOutDirNotEmpty]: (outDir: string) =>\n `${paint.bold('build.outDir')} is ${paint.path(outDir)}, which already contains other files. ${paint.bold('seedcord build')} empties ${paint.bold('outDir')} before it writes. Point it at an empty folder, or delete what is in it.`,\n [SeedcordErrorCode.CliProblems]: (count: number) =>\n `${paint.iris(count)} problems need fixing. Each one is listed below.`,\n [SeedcordErrorCode.CliEdgeCommandsNotDeployed]: (lines: readonly string[]) =>\n `${paint.iris(lines.length)} ${isOne(lines.length) ? 'command is' : 'commands are'} in your code with no deployed id on Discord, so the build cannot link ${isOne(lines.length) ? 'it' : 'them'}. Deploy with ${paint.bold('seedcord commands deploy')}, then build again.\\n${lines.join('\\n')}`,\n [SeedcordErrorCode.CliDevRuntimeNotRunning]: (method: string) =>\n `${paint.bold('seedcord dev')} called ${paint.bold(method)} while the dev runtime was not running. This is a bug in seedcord.`,\n [SeedcordErrorCode.CliDeployNoCommandsFolder]: (instance: string) =>\n `${paint.path(instance)} sets ${paint.bold('bot.commands.path')} to ${paint.bold('null')}. Point it at the folder that holds your commands to deploy them.`,\n [SeedcordErrorCode.CliDeployNeedsYes]: () =>\n `${paint.bold('seedcord commands deploy')} asks before it deploys, but it can only ask in a terminal with ${paint.bold('CI')} unset. Pass ${paint.bold('--yes')} to deploy without asking.`,\n [SeedcordErrorCode.CliNoScopeGiven]: (flags: readonly string[], note?: string) =>\n `No scope given. Pass ${oneOf.format(flags.map((flag) => paint.bold(flag)))}.${note ? ` ${note}` : ''}`,\n [SeedcordErrorCode.CliCommandConstructorThrew]: (name: string, file: string, reason: string) =>\n `${paint.sky(name)} threw while seedcord constructed it. Fix its constructor in ${paint.path(file)}. ${reason}`,\n [SeedcordErrorCode.CliCommandNotACommand]: (name: string, file: string) =>\n `${paint.bold(name)} in ${paint.path(file)} carries ${paint.bold('@RegisterCommand')}, but its component is not a slash command or a context menu. Extend ${paint.bold(\"BuilderComponent<'command'>\")} or ${paint.bold(\"BuilderComponent<'context_menu'>\")}.`,\n [SeedcordErrorCode.CliCommandsNotDeleted]: () =>\n 'Some commands could not be deleted. The warnings above give the reason for each one.',\n [SeedcordErrorCode.CliEdgeOnBun]: () =>\n `seedcord loads ${paint.path('cloudflare.config.ts')} through Cloudflare's config loader, which throws on Bun. Run the CLI on Node by leaving out ${paint.bold('--bun')}, as in ${paint.bold('bun run dev')}.`,\n [SeedcordErrorCode.CliEdgeNoWorker]: (cloudflareConfig: string) =>\n `${paint.path(cloudflareConfig)} sets no ${paint.bold('worker')}. Add a ${paint.bold('worker')} with your worker's ${paint.bold('name')} and ${paint.bold('compatibilityDate')}.`,\n [SeedcordErrorCode.CliNotProjectInstall]: (cliDir: string, projectInstall: string) =>\n `This ${paint.bold('seedcord')} runs from ${paint.path(cliDir)}, but the project installs its own at ${paint.path(projectInstall)}. The CLI and the bot must load the same seedcord packages. Run the command through a script in the project's ${paint.path('package.json')}.`,\n [SeedcordErrorCode.CliViteEnvironmentMissing]: (name: string, created: readonly string[]) =>\n `seedcord runs the bot in Vite's ${paint.bold(name)} environment. Vite created only ${allOf.format(created.map((environment) => paint.bold(environment)))}. Look in ${paint.bold('vitePlugins')} for a plugin whose ${paint.bold('config')} hook rewrites ${paint.bold('environments')}.`,\n [SeedcordErrorCode.CliListedFolderUnusable]: (folder: string, problem: keyof typeof listedFolderProblems) =>\n `${paint.bold('files')} in seedcord.config.ts lists ${paint.path(folder)}, ${listedFolderProblems[problem]}`,\n [SeedcordErrorCode.CliDevAlreadyRunning]: (configDir: string, pid: number, startedAt: string, lockFile: string) =>\n `Another ${paint.bold('seedcord dev')} is running this bot's application from ${paint.path(configDir)} (pid ${pid}, started ${startedAt}). Two dev sessions on one application overwrite each other's commands and interactions endpoint. Press ${paint.bold('q')} in that session, or delete ${paint.path(lockFile)} if it is no longer running.`,\n [SeedcordErrorCode.CliDevLockFolderNotOwned]: (folder: string) =>\n `Another user owns ${paint.path(folder)}, the folder ${paint.bold('seedcord dev')} writes its session locks to. That account could write a lock there that blocks your dev sessions. Ask that user or an admin to delete the folder, then start ${paint.bold('seedcord dev')} again.`,\n [SeedcordErrorCode.CliCodegenOutOfDate]: (outputPath: string) =>\n `${paint.path(outputPath)} is out of date. Run ${paint.bold('seedcord codegen')} and commit it.`,\n [SeedcordErrorCode.CliEdgeWithoutWorkerdCondition]: (cloudflareConfig: string, tsconfig: string) =>\n `${paint.path(cloudflareConfig)} makes this an edge bot, but ${paint.path(tsconfig)} leaves out ${paint.bold('\"customConditions\": [\"workerd\"]')}. Add it to compilerOptions for an edge bot, or set ${paint.bold('build.tsconfig')} to the tsconfig that holds it. For a node bot, move ${paint.path(cloudflareConfig)} out of this folder.`,\n [SeedcordErrorCode.CliWorkerdConditionWithoutCloudflareConfig]: (tsconfig: string, configDir: string) =>\n `${paint.path(tsconfig)} sets the ${paint.bold('workerd')} condition, which only an edge bot uses, but ${paint.path(configDir)} has no ${paint.path('cloudflare.config.ts')}. Add one for an edge bot. For a node bot, remove ${paint.bold('\"workerd\"')} from customConditions.`,\n [SeedcordErrorCode.CliConfigFileUnreadable]: (tool: string, file: string, output: string) =>\n `${tool} could not read ${paint.path(file)}. Fix the problem it reports:\\n${output}`,\n [SeedcordErrorCode.CliConfigFieldUnused]: (field: string, file: string, why: string) =>\n `${paint.path(file)} sets ${paint.bold(field)}. ${why} Remove ${paint.bold(field)} from ${paint.path(file)}.`,\n [SeedcordErrorCode.CliEdgeCompatDateTooOld]: (cloudflareConfig: string, date: string, firstDate: string) =>\n `A seedcord edge bot needs Cloudflare's Node compat. ${paint.path(cloudflareConfig)} sets ${paint.bold('compatibilityDate')} to ${date}, but Cloudflare turns Node compat on by default only from ${firstDate}. Set the date to ${firstDate} or later, or add ${paint.bold(\"'nodejs_compat'\")} to ${paint.bold('compatibilityFlags')}.`,\n [SeedcordErrorCode.CliEdgeNodeCompatOff]: (cloudflareConfig: string) =>\n `A seedcord edge bot needs Cloudflare's Node compat, but ${paint.path(cloudflareConfig)} turns it off with ${paint.bold(\"'no_nodejs_compat'\")}. Remove that flag from ${paint.bold('compatibilityFlags')}.`,\n [SeedcordErrorCode.CliEdgeBootFailed]: (reason: string) =>\n `The build could not start the worker in workerd, the runtime Cloudflare runs it on.\\n${reason}`,\n [SeedcordErrorCode.CliEdgeRootHoldsConfig]: (configFile: string, root: string) =>\n `An edge build bundles every file under ${paint.bold('root')}. ${paint.path(configFile)} sets ${paint.bold('root')} to ${paint.path(root)}, so the bundle would pull in that config file and tool configs like ${paint.sky('eslint.config.ts')}. Those break the bundle. Set ${paint.bold('root')} to the folder that holds the bot's code, like ${paint.sky(\"'./src'\")}.`,\n [SeedcordErrorCode.CliTypescriptNotStarted]: (tsc: string, reason: string) =>\n `Could not start TypeScript at ${paint.path(tsc)}: ${reason}`,\n [SeedcordErrorCode.CliPathHasHash]: (path: string) =>\n `${paint.path(path)} has a ${paint.bold('#')} in its path. Vite cuts a path at its first ${paint.bold('#')}, so rename it, or move the project to a folder without one.`,\n [SeedcordErrorCode.CliTunnelUrlUnavailable]: (seconds: number) =>\n `cloudflared did not report a tunnel URL within ${seconds}s. Check that the binary runs and that the network allows it.`,\n [SeedcordErrorCode.CliTunnelNotVerified]: (url: string) =>\n `Discord rejected ${paint.sky(url)} as an interactions endpoint. Discord checks the endpoint by sending it a signed request, so check that ${paint.bold('DISCORD_PUBLIC_KEY')} matches your application.`,\n [SeedcordErrorCode.CliTunnelUnreachable]: (url: string, seconds: number) =>\n `${paint.sky(url)} did not answer within ${seconds}s, so nothing was PATCHed to Discord.`,\n\n [SeedcordErrorCode.CreateFlagNotApplicable]: (flag: string) =>\n `The --${flag} flag does not apply to the answers you gave.`,\n [SeedcordErrorCode.CreateInvalidAnswer]: (flag: string, reason: string) => `--${flag}: ${reason}`,\n // node's parseArgs message ends on an unclosed quote\n [SeedcordErrorCode.CreateBadUsage]: (reason: string) => `${reason}\\nRun with --help for the flag list.`,\n [SeedcordErrorCode.CreateTargetNotEmpty]: (target: string) =>\n `${paint.path(target)} already has files in it. Pick an empty directory or a name that does not exist yet.`,\n [SeedcordErrorCode.CreateStepFailed]: (command: string, reason: string) =>\n `${paint.bold(command)} failed.\\n${reason}`\n} satisfies Record<SeedcordErrorCode, (...args: never[]) => string>;\n\n/** @internal */\nexport type SeedcordErrorArguments<Code extends SeedcordErrorCode> = Parameters<(typeof messages)[Code]>;\n\n/** @internal */\nexport function formatSeedcordErrorMessage<Code extends SeedcordErrorCode>(\n code: Code,\n args?: SeedcordErrorArguments<Code>\n): string {\n const formatter = messages[code];\n const resolvedArgs = (args ?? []) as unknown[];\n return (formatter as (...params: unknown[]) => string)(...resolvedArgs);\n}\n","import { SeedcordErrorCode } from './ErrorCodes';\nimport { formatSeedcordErrorMessage, type SeedcordErrorArguments } from './ErrorMessages';\nimport { paint } from './palette';\n\n/**\n * String literal type for Seedcord error identifiers.\n *\n * @internal\n */\ntype SeedcordErrorIdentifier = keyof typeof SeedcordErrorCode;\n\n/**\n * Options for Seedcord errors.\n *\n * @internal\n */\ninterface SeedcordErrorOptions extends ErrorOptions {}\n\nfunction resolveIdentifier(code: SeedcordErrorCode): SeedcordErrorIdentifier {\n return SeedcordErrorCode[code] as SeedcordErrorIdentifier;\n}\n\ntype SeedcordErrorPayload<Code extends SeedcordErrorCode> = SeedcordErrorArguments<Code> | undefined;\n\ntype SeedcordErrorCtorRest<Code extends SeedcordErrorCode> =\n SeedcordErrorArguments<Code> extends []\n ? [options?: SeedcordErrorOptions]\n : [args: SeedcordErrorArguments<Code>, options?: SeedcordErrorOptions];\n\nfunction resolveCtorInputs<Code extends SeedcordErrorCode>(\n rest: SeedcordErrorCtorRest<Code>\n): { args: SeedcordErrorPayload<Code>; options?: SeedcordErrorOptions } {\n const [maybeArgsOrOptions, maybeOptions] = rest;\n if (Array.isArray(maybeArgsOrOptions)) {\n const result: { args: SeedcordErrorPayload<Code>; options?: SeedcordErrorOptions } = {\n args: maybeArgsOrOptions\n };\n\n if (maybeOptions !== undefined) {\n result.options = maybeOptions;\n }\n\n return result;\n }\n\n const result: { args: SeedcordErrorPayload<Code>; options?: SeedcordErrorOptions } = {\n args: undefined\n };\n\n if (maybeArgsOrOptions !== undefined) {\n result.options = maybeArgsOrOptions;\n }\n\n return result;\n}\n\nfunction resolveMessage<Code extends SeedcordErrorCode>(code: Code, args: SeedcordErrorPayload<Code>): string {\n return formatSeedcordErrorMessage(code, args);\n}\n\nfunction formatErrorName(name: string, _identifier: SeedcordErrorIdentifier, code: SeedcordErrorCode): string {\n return `${paint.coral.bold(name)}[${paint.mute(code)}]`;\n}\n\n/**\n * String literal type for Seedcord error class names. Names the `type` argument of\n * {@link isSeedcordError}.\n */\nexport type SeedcordErrorTypeString = `Seedcord${'Error' | 'TypeError' | 'RangeError' | 'AggregateError'}`;\n\n// Symbol.for so two installed copies read the same slot\nconst kIdentifier: unique symbol = Symbol.for('seedcord:errors:identifier');\n\ninterface BaseSeedcordError {\n readonly code: SeedcordErrorCode;\n readonly [kIdentifier]: SeedcordErrorIdentifier;\n readonly type: SeedcordErrorTypeString;\n}\n\n// instanceof fails across two installed copies of this package\nconst CODED = Symbol.for('seedcord:errors:coded');\n\nfunction brand(prototype: object): void {\n Object.defineProperty(prototype, CODED, { value: true });\n}\n\nfunction isCoded(error: unknown): error is BaseSeedcordError {\n return typeof error === 'object' && error !== null && CODED in error;\n}\n\nexport class SeedcordError<Code extends SeedcordErrorCode = SeedcordErrorCode>\n extends Error\n implements BaseSeedcordError\n{\n public readonly code: Code;\n readonly [kIdentifier]: SeedcordErrorIdentifier;\n public readonly type = 'SeedcordError';\n\n constructor(code: Code, ...rest: SeedcordErrorCtorRest<Code>) {\n const { args, options } = resolveCtorInputs(rest);\n const message = resolveMessage(code, args);\n super(message, options);\n this.code = code;\n this[kIdentifier] = resolveIdentifier(code);\n this.name = formatErrorName(new.target.name, this[kIdentifier], this.code);\n Object.setPrototypeOf(this, new.target.prototype);\n if (typeof Error.captureStackTrace === 'function') {\n Error.captureStackTrace(this, new.target);\n }\n }\n}\n\nbrand(SeedcordError.prototype);\n\nexport class SeedcordTypeError<Code extends SeedcordErrorCode = SeedcordErrorCode>\n extends TypeError\n implements BaseSeedcordError\n{\n public readonly code: Code;\n readonly [kIdentifier]: SeedcordErrorIdentifier;\n public readonly type = 'SeedcordTypeError';\n\n constructor(code: Code, ...rest: SeedcordErrorCtorRest<Code>) {\n const { args, options } = resolveCtorInputs(rest);\n const message = resolveMessage(code, args);\n super(message, options);\n this.code = code;\n this[kIdentifier] = resolveIdentifier(code);\n this.name = formatErrorName(new.target.name, this[kIdentifier], this.code);\n Object.setPrototypeOf(this, new.target.prototype);\n if (typeof Error.captureStackTrace === 'function') {\n Error.captureStackTrace(this, new.target);\n }\n }\n}\n\nbrand(SeedcordTypeError.prototype);\n\nexport class SeedcordRangeError<Code extends SeedcordErrorCode = SeedcordErrorCode>\n extends RangeError\n implements BaseSeedcordError\n{\n public readonly code: Code;\n readonly [kIdentifier]: SeedcordErrorIdentifier;\n public readonly type = 'SeedcordRangeError';\n\n constructor(code: Code, ...rest: SeedcordErrorCtorRest<Code>) {\n const { args, options } = resolveCtorInputs(rest);\n const message = resolveMessage(code, args);\n super(message, options);\n this.code = code;\n this[kIdentifier] = resolveIdentifier(code);\n this.name = formatErrorName(new.target.name, this[kIdentifier], this.code);\n Object.setPrototypeOf(this, new.target.prototype);\n if (typeof Error.captureStackTrace === 'function') {\n Error.captureStackTrace(this, new.target);\n }\n }\n}\n\nbrand(SeedcordRangeError.prototype);\n\nexport class SeedcordAggregateError<Code extends SeedcordErrorCode = SeedcordErrorCode>\n extends AggregateError\n implements BaseSeedcordError\n{\n public readonly code: Code;\n readonly [kIdentifier]: SeedcordErrorIdentifier;\n public readonly type = 'SeedcordAggregateError';\n\n constructor(code: Code, errors: readonly unknown[], ...rest: SeedcordErrorCtorRest<Code>) {\n const { args, options } = resolveCtorInputs(rest);\n const message = resolveMessage(code, args);\n super(errors, message, options);\n this.code = code;\n this[kIdentifier] = resolveIdentifier(code);\n this.name = formatErrorName(new.target.name, this[kIdentifier], this.code);\n Object.setPrototypeOf(this, new.target.prototype);\n if (typeof Error.captureStackTrace === 'function') {\n Error.captureStackTrace(this, new.target);\n }\n }\n}\n\nbrand(SeedcordAggregateError.prototype);\n\n/**\n * Variant type for Seedcord error classes.\n *\n * @internal\n */\ntype SeedcordErrorVariant<\n Type extends SeedcordErrorTypeString,\n Code extends SeedcordErrorCode\n> = Type extends 'SeedcordError'\n ? SeedcordError<Code>\n : Type extends 'SeedcordTypeError'\n ? SeedcordTypeError<Code>\n : Type extends 'SeedcordRangeError'\n ? SeedcordRangeError<Code>\n : SeedcordAggregateError<Code>;\n\n/**\n * Union type of all Seedcord error variants for a specific error code.\n *\n * @internal\n */\ntype AnySeedcordErrorForCode<Code extends SeedcordErrorCode> = {\n [Variant in SeedcordErrorTypeString]: SeedcordErrorVariant<Variant, Code>;\n}[SeedcordErrorTypeString];\n\n/**\n * Union type of all Seedcord errors filtered by error class.\n *\n * @internal\n */\ntype ErrorTypeFilter<Type extends SeedcordErrorTypeString | undefined> = Type extends SeedcordErrorTypeString\n ? {\n [Code in SeedcordErrorCode]: SeedcordErrorVariant<Type, Code>;\n }[SeedcordErrorCode]\n : AnySeedcordErrorForCode<SeedcordErrorCode>;\n\n/**\n * Union type of all Seedcord errors filtered by error class and error code.\n *\n * @internal\n */\nexport type ErrorCodeFilter<\n Type extends SeedcordErrorTypeString | undefined,\n Code extends SeedcordErrorCode | undefined\n> = Code extends SeedcordErrorCode\n ? Type extends SeedcordErrorTypeString\n ? SeedcordErrorVariant<Type, Code>\n : AnySeedcordErrorForCode<Code>\n : ErrorTypeFilter<Type>;\n\n/**\n * Determines whether an unknown value is a Seedcord error, with optional narrowing by class and error code.\n *\n * @param error - The value to inspect.\n * @param type - Optional error class discriminator.\n * @param code - Optional {@link SeedcordErrorCode} discriminator to narrow by code.\n * @typeParam Type - What kind of {@link SeedcordErrorTypeString} to filter by.\n * @typeParam Code - The specific {@link SeedcordErrorCode} to filter by.\n */\nexport function isSeedcordError<\n Type extends SeedcordErrorTypeString | undefined,\n Code extends SeedcordErrorCode | undefined\n>(error: unknown, type?: Type, code?: Code): error is ErrorCodeFilter<Type, Code> {\n if (!isCoded(error)) return false;\n if (type && error.type !== type) return false;\n if (code === undefined) return true;\n // another copy of this package may number the same identifier differently\n return error[kIdentifier] === resolveIdentifier(code);\n}\n"],"mappings":";;;;;;AAKA,IAAY,oBAAL;;CAEH;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAGA;;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;;CAGA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAGA;;CAEA;;CAEA;;CAEA;;CAEA;;CAGA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA;;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