@wolfstar/http-framework 3.6.0 → 4.0.0-next-20260913191701

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -470,10 +470,7 @@ configuration without pulling in `@wolfstar/cli`.
470
470
  // stars.config.ts
471
471
  import { defineConfig } from '@wolfstar/http-framework/config';
472
472
 
473
- export default defineConfig({
474
- entry: 'src/main.ts',
475
- build: { tool: 'tsdown' }
476
- });
473
+ export default defineConfig({});
477
474
  ```
478
475
 
479
476
  `@wolfstar/http-framework/config` has no side effects — importing it (or a `stars.config.ts` that imports it) never
@@ -481,7 +478,7 @@ starts the bot. `loadStarsConfig` discovers `stars.config.{ts,mts,cts,js,mjs,cjs
481
478
  validates every option and resolves all paths to absolute ones.
482
479
 
483
480
  `dev.url`, the URL `stars dev` shows and health-checks the bot on, needs no configuration either: it is detected the
484
- way Vite's and Nuxt's dev servers are, from `HTTP_PORT` (env var, `.env.local`/`.env`, or `dev.env`) or `3000`, and
481
+ way Vite's and Nuxt's dev servers are, from `HTTP_PORT` (env var, `src/.env*`/`.env*`, or `dev.env`) or `3000`, and
485
482
  `localhost` is swapped for `127.0.0.1` at runtime if that is what is actually reachable. Set `dev.url` explicitly only
486
483
  to override it, e.g. for a LAN address: `dev: { url: 'http://192.168.1.5:3000' }`.
487
484
 
@@ -489,12 +486,11 @@ to override it, e.g. for a LAN address: `dev: { url: 'http://192.168.1.5:3000' }
489
486
  example `dev: { banner: ['★ STARYL', 'Twitch notifications'] }`, or `false` to hide it. Up to four lines fit the
490
487
  compact panel. Application logs and standalone banners are available behind `l`, not printed over the dev panel.
491
488
 
492
- `dev` also carries the three options that round out the dev loop:
489
+ `dev` also carries optional overrides for the dev loop. Press `t` in the TUI to toggle a quick tunnel without any
490
+ configuration:
493
491
 
494
492
  ```typescript
495
493
  export default defineConfig({
496
- entry: 'src/main.ts',
497
- build: { tool: 'tsdown' },
498
494
  dev: {
499
495
  // A type checker next to the bot, reported on the dev UI's `tsc` channel. Never blocks a build.
500
496
  // `checker` is 'tsc' | 'golar' | 'tsz' | 'auto' (default: golar when installed, tsc otherwise).
@@ -516,10 +512,7 @@ because it edits a live application, and needs `DISCORD_TOKEN` in the environmen
516
512
  project configures nothing at all — this is a complete build:
517
513
 
518
514
  ```typescript
519
- export default defineConfig({
520
- entry: 'src/main.ts',
521
- future: { compatibilityVersion: 4 }
522
- });
515
+ export default defineConfig({});
523
516
  ```
524
517
 
525
518
  The defaults are the configuration a bot would otherwise write out by hand:
@@ -566,19 +559,18 @@ A project's own `tsdown.alias` is added to these rather than replacing them, and
566
559
  (`'./src/lib'`) is resolved against the project root, the way every other path in `stars.config` is — a module id
567
560
  (`'preact/compat'`) is left alone.
568
561
 
569
- So the block is for what the defaults cannot know — a plugin that copies assets, an extra alias, a target:
562
+ So the block is for what the defaults cannot know — an extra alias, declaration output, or a target. Conventional
563
+ `src/locales` assets are copied to `dist/locales` automatically by the CLI:
570
564
 
571
565
  ```typescript
572
566
  export default defineConfig({
573
- entry: 'src/main.ts',
574
- future: { compatibilityVersion: 4 },
575
- tsdown: { plugins: [alias({ entries: aliasEntries }), copyLocales()] }
567
+ tsdown: { alias: { '#shared': './src/shared' }, dts: true }
576
568
  });
577
569
  ```
578
570
 
579
571
  Anything in `tsdown` wins over the defaults, and `plugins` are appended rather than replaced.
580
572
 
581
- With `future.compatibilityVersion: 3` (today's default) a `tsdown.config.*` in the project root is still loaded and
573
+ With `future.compatibilityVersion: 3` (legacy mode) a `tsdown.config.*` in the project root is still loaded and
582
574
  `tsdown` is merged over it, so a project can move its options across one at a time. With `4` the block is the whole
583
575
  configuration, and a leftover `tsdown.config.*` is reported instead of being silently ignored.
584
576
 
@@ -587,21 +579,18 @@ into the project's own `vite.config.*`, the way `vite: {}` in a Nuxt config is.
587
579
 
588
580
  ### Compatibility version
589
581
 
590
- `future` carries the defaults of the next major, the way Nuxt's own `future.compatibilityVersion` does: a project
591
- opts into them one major early, and they become the default when that major ships. Where `experimental` guards work
592
- that is still landing, everything here is already decided.
582
+ `future.compatibilityVersion` selects the build-default generation. Version 4 is the default; version 3 remains as
583
+ an explicit migration mode for projects that still have a standalone `tsdown.config.*`.
593
584
 
594
585
  ```typescript
595
586
  export default defineConfig({
596
- entry: 'src/main.ts',
597
587
  future: {
598
- // 3 (the default today) or 4 (the next major's defaults).
599
- compatibilityVersion: 4
588
+ compatibilityVersion: 3
600
589
  }
601
590
  });
602
591
  ```
603
592
 
604
- `4` changes three things:
593
+ The default version 4 provides three things:
605
594
 
606
595
  - **Auto imports are on** with the `tsdown` build tool, and the `autoImports()` plugin is wired into the build by
607
596
  `stars` itself instead of by the project's own configuration file — the framework's exports and the project's
@@ -1,4 +1,4 @@
1
- import { l as ResolvedImportsConfig } from "./resolve-C9o9kAhT.js";
1
+ import { l as ResolvedImportsConfig } from "./resolve-CBovxOO3.js";
2
2
  //#region src/auto-imports.d.ts
3
3
  interface AutoImportsPluginOptions extends Pick<ResolvedImportsConfig, 'dirs' | 'presets' | 'exclude' | 'dts'> {
4
4
  /** Absolute project root, used to resolve `presets` against the project's own `node_modules`. */
@@ -1,2 +1,2 @@
1
- import { A as StarsTypecheckConfig, B as LoadConfigFileOptions, C as StarsExperimentalConfig, D as StarsNitroConfig, E as StarsImportsConfig, F as loadStarsConfig, H as discoverConfigFile, I as ConfigError, L as ConfigErrorOptions, M as StarsViteConfig, N as defineConfig, O as StarsTsdownConfig, P as LoadStarsConfigOptions, R as CONFIG_EXTENSIONS, S as StarsDevConfig, T as StarsI18nCodegenConfig, U as loadConfigFile, V as LoadedConfigFile, _ as StarsBuildConfig, a as ResolvedDevConfig, b as StarsCompatibilityVersion, c as ResolvedI18nCodegenConfig, d as ResolvedStarsConfig, f as ResolvedTunnelConfig, g as resolveStarsConfig, h as readProjectEnvFiles, i as ResolvedCodegenConfig, j as StarsTypechecker, k as StarsTunnelConfig, l as ResolvedImportsConfig, m as displayPath, n as ResolveConfigOptions, o as ResolvedExperimentalConfig, p as ResolvedTypecheckConfig, r as ResolvedBuildConfig, s as ResolvedFutureConfig, t as PackageJsonLike, u as ResolvedNitroConfig, v as StarsBuildTool, w as StarsFutureConfig, x as StarsConfig, y as StarsCodegenConfig, z as CONFIG_FILE_NAMES } from "./resolve-C9o9kAhT.js";
1
+ import { A as StarsTypecheckConfig, B as LoadConfigFileOptions, C as StarsExperimentalConfig, D as StarsNitroConfig, E as StarsImportsConfig, F as loadStarsConfig, H as discoverConfigFile, I as ConfigError, L as ConfigErrorOptions, M as StarsViteConfig, N as defineConfig, O as StarsTsdownConfig, P as LoadStarsConfigOptions, R as CONFIG_EXTENSIONS, S as StarsDevConfig, T as StarsI18nCodegenConfig, U as loadConfigFile, V as LoadedConfigFile, _ as StarsBuildConfig, a as ResolvedDevConfig, b as StarsCompatibilityVersion, c as ResolvedI18nCodegenConfig, d as ResolvedStarsConfig, f as ResolvedTunnelConfig, g as resolveStarsConfig, h as readProjectEnvFiles, i as ResolvedCodegenConfig, j as StarsTypechecker, k as StarsTunnelConfig, l as ResolvedImportsConfig, m as displayPath, n as ResolveConfigOptions, o as ResolvedExperimentalConfig, p as ResolvedTypecheckConfig, r as ResolvedBuildConfig, s as ResolvedFutureConfig, t as PackageJsonLike, u as ResolvedNitroConfig, v as StarsBuildTool, w as StarsFutureConfig, x as StarsConfig, y as StarsCodegenConfig, z as CONFIG_FILE_NAMES } from "./resolve-CBovxOO3.js";
2
2
  export { CONFIG_EXTENSIONS, CONFIG_FILE_NAMES, ConfigError, type ConfigErrorOptions, type LoadConfigFileOptions, LoadStarsConfigOptions, type LoadedConfigFile, type PackageJsonLike, type ResolveConfigOptions, type ResolvedBuildConfig, type ResolvedCodegenConfig, type ResolvedDevConfig, type ResolvedExperimentalConfig, type ResolvedFutureConfig, type ResolvedI18nCodegenConfig, type ResolvedImportsConfig, type ResolvedNitroConfig, type ResolvedStarsConfig, type ResolvedTunnelConfig, type ResolvedTypecheckConfig, StarsBuildConfig, StarsBuildTool, StarsCodegenConfig, StarsCompatibilityVersion, StarsConfig, StarsDevConfig, StarsExperimentalConfig, StarsFutureConfig, StarsI18nCodegenConfig, StarsImportsConfig, StarsNitroConfig, StarsTsdownConfig, StarsTunnelConfig, StarsTypecheckConfig, StarsTypechecker, StarsViteConfig, defineConfig, discoverConfigFile, displayPath, loadConfigFile, loadStarsConfig, readProjectEnvFiles, resolveStarsConfig };
@@ -132,7 +132,8 @@ const DEFAULT_IMPORTS_PRESETS = ["@wolfstar/http-framework", "@wolfstar/env-util
132
132
  const DEFAULT_IMPORTS_DTS = ".stars/imports.d.ts";
133
133
  const DEFAULT_DEV_LOG_FILE = ".stars/dev.log";
134
134
  const DEFAULT_TUNNEL_PATH = "/";
135
- const DEFAULT_COMPATIBILITY_VERSION = 3;
135
+ const DEFAULT_COMPATIBILITY_VERSION = 4;
136
+ const LEGACY_COMPATIBILITY_VERSION = 3;
136
137
  const LATEST_COMPATIBILITY_VERSION = 4;
137
138
  const COMPATIBILITY_VERSIONS = /* @__PURE__ */ new Set([3, 4]);
138
139
  const BUILD_TOOLS = /* @__PURE__ */ new Set([
@@ -297,16 +298,14 @@ function detectBuildTool(root, packageJson, isTypeScriptEntry, experimental, fut
297
298
  return "none";
298
299
  }
299
300
  /**
300
- * Resolves the `future` block. It carries the defaults of the next major, the way Nuxt's own
301
- * `future.compatibilityVersion` does: a project opts into them one major early, and they become the default when
302
- * that major ships.
301
+ * Resolves the Nuxt-style compatibility block. Version 4 is the default; version 3 remains an explicit legacy mode.
303
302
  */
304
303
  function resolveFuture(config, validator) {
305
304
  if (config === null || typeof config !== "object" || Array.isArray(config)) throw validator.error("`future` must be an object", "future", "INVALID_TYPE", "Use `{ compatibilityVersion }`.");
306
305
  validator.knownKeys(config, "future", ["compatibilityVersion"]);
307
306
  const version = config.compatibilityVersion;
308
- if (version === void 0) return { compatibilityVersion: 3 };
309
- if (typeof version !== "number" || !COMPATIBILITY_VERSIONS.has(version)) throw validator.error(`Unknown compatibility version ${describe(version)}`, "future.compatibilityVersion", "INVALID_COMPATIBILITY_VERSION", `Use ${3} (today's defaults) or ${4} (the next major's).`);
307
+ if (version === void 0) return { compatibilityVersion: 4 };
308
+ if (typeof version !== "number" || !COMPATIBILITY_VERSIONS.has(version)) throw validator.error(`Unknown compatibility version ${describe(version)}`, "future.compatibilityVersion", "INVALID_COMPATIBILITY_VERSION", `Use ${3} for the legacy build pipeline or ${4} for today's defaults.`);
310
309
  return { compatibilityVersion: version };
311
310
  }
312
311
  /**
@@ -344,18 +343,24 @@ function resolveBuildOutput(root, entry, outDir, packageJson) {
344
343
  const outputExtension = extension === ".mts" ? ".mjs" : extension === ".cts" ? ".cjs" : ".js";
345
344
  return join(outDir, `${basename(entry, extension)}${outputExtension}`);
346
345
  }
347
- const ENV_FILES = [".env.local", ".env"];
348
346
  const ENV_PORT_KEYS = ["HTTP_PORT", "PORT"];
349
347
  /**
350
- * Reads the project's `.env.local`/`.env` into a plain object, the way `stars dev` and `stars commands` need it:
348
+ * Reads the project's environment layers from `src/.env*` and `.env*` into a plain object, the way `stars dev` and
349
+ * `stars commands` need it:
351
350
  * these files are only loaded into `process.env` by the bot itself once it starts (see `@wolfstar/env-utilities`),
352
351
  * so by the time the CLI runs they are not there yet. This is a minimal line reader, not a full dotenv
353
352
  * implementation — quoting is stripped, but expansion (`dotenv-expand`) is not. Earlier files win, matching
354
353
  * dotenv's own precedence.
355
354
  */
356
- function readProjectEnvFiles(root) {
355
+ function readProjectEnvFiles(root, environment = "development") {
357
356
  const result = {};
358
- for (const file of ENV_FILES) {
357
+ const files = [
358
+ `.${environment}.local`,
359
+ ...environment === "test" ? [] : [".local"],
360
+ `.${environment}`,
361
+ ""
362
+ ].flatMap((suffix) => [join("src", `.env${suffix}`), `.env${suffix}`]);
363
+ for (const file of files) {
359
364
  const path = join(root, file);
360
365
  if (!isFile(path)) continue;
361
366
  let contents;
@@ -374,8 +379,8 @@ function readProjectEnvFiles(root) {
374
379
  }
375
380
  return result;
376
381
  }
377
- function readDevPortFromEnvFile(root) {
378
- const values = readProjectEnvFiles(root);
382
+ function readDevPortFromEnvFile(root, environment) {
383
+ const values = readProjectEnvFiles(root, environment);
379
384
  for (const key of ENV_PORT_KEYS) if (values[key]) return values[key];
380
385
  return null;
381
386
  }
@@ -410,7 +415,7 @@ function resolveDev(root, entry, packageJson, config, env, validator) {
410
415
  throw validator.error(`Invalid URL "${url}"`, "dev.url", "INVALID_URL", "Use an absolute URL such as http://localhost:3000.");
411
416
  }
412
417
  else {
413
- const port = devEnv.HTTP_PORT ?? env.HTTP_PORT ?? readDevPortFromEnvFile(root) ?? String(3e3);
418
+ const port = devEnv.HTTP_PORT ?? env.HTTP_PORT ?? readDevPortFromEnvFile(root, env.NODE_ENV ?? "development") ?? String(3e3);
414
419
  url = /^\d+$/.test(port) ? `http://localhost:${port}` : `http://localhost:${DEFAULT_DEV_PORT}`;
415
420
  }
416
421
  const typecheck = resolveTypecheck(root, packageJson, config.typecheck, validator);
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","names":["isFile"],"sources":["../../src/lib/config/errors.ts","../../src/lib/config/load.ts","../../src/lib/config/resolve.ts","../../src/lib/config/index.ts","../../src/config.ts"],"sourcesContent":["export interface ConfigErrorOptions {\n\t/** A stable, machine readable code, e.g. `INVALID_TYPE`. */\n\tcode: string;\n\t/** A short, actionable suggestion. */\n\thint?: string;\n\t/** The dotted path of the offending option, e.g. `dev.debounce`. */\n\tpath?: string;\n\t/** The configuration file the error originates from. */\n\tfile?: string | null;\n\tcause?: unknown;\n}\n\n/**\n * A `stars.config.*` error: an invalid option, or a file that failed to load or parse.\n *\n * This is a plain data error (no exit code or terminal formatting) so it stays meaningful outside a CLI, e.g. for a\n * dashboard or test that calls {@link loadStarsConfig} directly. `@wolfstar/cli` maps it to exit code `2` and renders\n * `message`, `path`, `file` and `hint` for the terminal.\n */\nexport class ConfigError extends Error {\n\tpublic readonly code: string;\n\tpublic readonly hint: string | null;\n\tpublic readonly path: string | null;\n\tpublic readonly file: string | null;\n\n\tpublic constructor(message: string, options: ConfigErrorOptions) {\n\t\tsuper(message, options.cause === undefined ? undefined : { cause: options.cause });\n\t\tthis.name = 'ConfigError';\n\t\tthis.code = options.code;\n\t\tthis.hint = options.hint ?? null;\n\t\tthis.path = options.path ?? null;\n\t\tthis.file = options.file ?? null;\n\t}\n}\n","import { existsSync, statSync } from 'node:fs';\nimport { basename, dirname, join, resolve } from 'node:path';\nimport type { StarsConfig } from '../../config.js';\nimport { ConfigError } from './errors.js';\n\nexport const CONFIG_EXTENSIONS = ['ts', 'mts', 'cts', 'js', 'mjs', 'cjs'] as const;\nexport const CONFIG_FILE_NAMES = CONFIG_EXTENSIONS.map((extension) => `stars.config.${extension}`);\n\nexport interface LoadConfigFileOptions {\n\t/** The directory to discover the configuration file from. */\n\tcwd: string;\n\t/** An explicit configuration file (`--config`), resolved from `cwd`. */\n\tconfigFile?: string | null;\n}\n\nexport interface LoadedConfigFile {\n\t/** The absolute path of the loaded file, `null` when running on defaults. */\n\tconfigFile: string | null;\n\tconfig: StarsConfig;\n}\n\n/**\n * Finds the first `stars.config.*` file in `cwd`, in {@link CONFIG_FILE_NAMES} order.\n */\nexport function discoverConfigFile(cwd: string): string | null {\n\tfor (const name of CONFIG_FILE_NAMES) {\n\t\tconst candidate = join(cwd, name);\n\t\tif (isFile(candidate)) return candidate;\n\t}\n\n\treturn null;\n}\n\n/**\n * Loads the raw configuration object. The loader (`c12`) is imported lazily so\n * commands that never touch the configuration stay fast.\n */\nexport async function loadConfigFile(options: LoadConfigFileOptions): Promise<LoadedConfigFile> {\n\tconst cwd = resolve(options.cwd);\n\tlet file: string | null;\n\n\tif (options.configFile) {\n\t\tfile = resolve(cwd, options.configFile);\n\t\tif (!isFile(file)) {\n\t\t\tthrow new ConfigError(`Configuration file not found: ${file}`, {\n\t\t\t\tcode: 'CONFIG_NOT_FOUND',\n\t\t\t\thint: `Pass an existing file to --config, or create one of ${CONFIG_FILE_NAMES.join(', ')} in ${cwd}.`\n\t\t\t});\n\t\t}\n\t} else {\n\t\tfile = discoverConfigFile(cwd);\n\t\tif (!file) return { configFile: null, config: {} };\n\t}\n\n\tconst { loadConfig } = await import('c12');\n\n\tlet loaded: unknown;\n\ttry {\n\t\tconst result = await loadConfig<StarsConfig>({\n\t\t\tname: 'stars',\n\t\t\tcwd: dirname(file),\n\t\t\tconfigFile: basename(file),\n\t\t\trcFile: false,\n\t\t\tglobalRc: false,\n\t\t\tdotenv: false,\n\t\t\tpackageJson: false,\n\t\t\tdefaults: {}\n\t\t});\n\t\t// c12 merges every layer with the defaults, which turns non-object exports into `{}`: inspect the raw layer.\n\t\tconst layer = result.layers?.find(\n\t\t\t(candidate) => candidate.configFile && resolve(candidate.cwd ?? dirname(file), candidate.configFile) === file\n\t\t);\n\t\tloaded = layer ? layer.config : result.config;\n\t} catch (error) {\n\t\tconst message = error instanceof Error ? error.message : String(error);\n\t\tthrow new ConfigError(`Failed to load the configuration: ${message}`, {\n\t\t\tcode: 'CONFIG_LOAD_FAILED',\n\t\t\tfile,\n\t\t\thint: 'The file must be valid TypeScript/JavaScript and export the configuration as its default export.',\n\t\t\tcause: error\n\t\t});\n\t}\n\n\tif (loaded === null || typeof loaded !== 'object' || Array.isArray(loaded)) {\n\t\tthrow new ConfigError('The configuration file must export an object as its default export.', {\n\t\t\tcode: 'CONFIG_NOT_OBJECT',\n\t\t\tfile,\n\t\t\thint: \"Use `export default defineConfig({ ... })` from '@wolfstar/http-framework/config'.\"\n\t\t});\n\t}\n\n\treturn { configFile: file, config: loaded as StarsConfig };\n}\n\nfunction isFile(path: string): boolean {\n\ttry {\n\t\treturn existsSync(path) && statSync(path).isFile();\n\t} catch {\n\t\treturn false;\n\t}\n}\n","import { existsSync, readFileSync, statSync } from 'node:fs';\nimport { basename, dirname, extname, isAbsolute, join, relative, resolve } from 'node:path';\nimport type {\n\tStarsBuildTool,\n\tStarsCompatibilityVersion,\n\tStarsConfig,\n\tStarsDevConfig,\n\tStarsExperimentalConfig,\n\tStarsFutureConfig,\n\tStarsTypechecker\n} from '../../config.js';\nimport { ConfigError } from './errors.js';\n\nexport interface PackageJsonLike {\n\tname?: string;\n\t/** `tsdown` reads its options from here as well as from a `tsdown.config.*`. */\n\ttsdown?: unknown;\n\tversion?: string;\n\tmain?: string;\n\ttype?: string;\n\tscripts?: Record<string, string>;\n\tdependencies?: Record<string, string>;\n\tdevDependencies?: Record<string, string>;\n}\n\nexport interface ResolvedBuildConfig {\n\treadonly tool: StarsBuildTool;\n\t/** Absolute output directory. */\n\treadonly outDir: string;\n\t/** Absolute `tsconfig.json` used by `tsc`, `null` for the other tools. */\n\treadonly tsconfig: string | null;\n\t/** Absolute path of the file `node` runs, i.e. the built entry (or the entry itself when `tool` is `none`). */\n\treadonly output: string;\n\t/**\n\t * Absolute path of the build tool's own configuration file (`tsdown.config.*`, `vite.config.*`), `null` when the\n\t * tool has none — which is always the case for `tsdown` with `future.compatibilityVersion` 4, where the build is\n\t * configured from `stars.config` alone.\n\t */\n\treadonly configFile: string | null;\n}\n\nexport interface ResolvedTypecheckConfig {\n\treadonly enabled: boolean;\n\t/** Absolute `tsconfig.json` the type checker runs against, `null` when it could not be found. */\n\treadonly tsconfig: string | null;\n\t/** The type checker to run, with `'auto'` already resolved. */\n\treadonly checker: StarsTypechecker;\n}\n\nexport type ResolvedTunnelConfig =\n\t| { readonly mode: 'off' }\n\t/** A `cloudflared` quick tunnel, whose hostname is only known once it is up. */\n\t| { readonly mode: 'quick'; readonly path: string; readonly updateEndpoint: boolean }\n\t/** An https URL the user already serves. */\n\t| { readonly mode: 'url'; readonly url: string; readonly path: string; readonly updateEndpoint: boolean };\n\nexport interface ResolvedDevConfig {\n\treadonly banner: readonly string[] | false | null;\n\treadonly watch: readonly string[];\n\treadonly ignore: readonly string[];\n\treadonly debounce: number;\n\treadonly env: Readonly<Record<string, string>>;\n\treadonly nodeArgs: readonly string[];\n\treadonly args: readonly string[];\n\treadonly url: string | null;\n\treadonly health: string | null;\n\treadonly killTimeout: number;\n\treadonly typecheck: ResolvedTypecheckConfig;\n\treadonly tunnel: ResolvedTunnelConfig;\n\t/** Absolute path of the file the dev session's logs are mirrored into, `null` when disabled. */\n\treadonly logFile: string | null;\n}\n\nexport interface ResolvedNitroConfig {\n\treadonly preset: string;\n}\n\nexport interface ResolvedExperimentalConfig {\n\treadonly enableVite: boolean;\n\treadonly enableExternalVite: boolean;\n\treadonly enableNitro: boolean;\n\treadonly nitro: ResolvedNitroConfig;\n}\n\nexport interface ResolvedFutureConfig {\n\treadonly compatibilityVersion: StarsCompatibilityVersion;\n}\n\nexport interface ResolvedImportsConfig {\n\treadonly enabled: boolean;\n\t/** Directory glob patterns, relative to the project root (the way `unimport` scans them). */\n\treadonly dirs: readonly string[];\n\treadonly presets: readonly string[];\n\treadonly exclude: readonly string[];\n\t/** Absolute path of the generated declaration file. */\n\treadonly dts: string;\n}\n\nexport interface ResolvedI18nCodegenConfig {\n\treadonly locales: string;\n\treadonly output: string;\n}\n\nexport interface ResolvedCodegenConfig {\n\treadonly i18n: ResolvedI18nCodegenConfig | null;\n}\n\nexport interface ResolvedStarsConfig {\n\t/** Absolute path of the configuration file, `null` when running on defaults. */\n\treadonly configFile: string | null;\n\t/** The directory the CLI was invoked from. */\n\treadonly cwd: string;\n\t/** Absolute project root. */\n\treadonly root: string;\n\treadonly packageJson: PackageJsonLike | null;\n\t/** Absolute source entry. */\n\treadonly entry: string;\n\treadonly build: ResolvedBuildConfig;\n\treadonly dev: ResolvedDevConfig;\n\treadonly codegen: ResolvedCodegenConfig;\n\treadonly imports: ResolvedImportsConfig;\n\treadonly experimental: ResolvedExperimentalConfig;\n\treadonly future: ResolvedFutureConfig;\n\t/** Raw options merged into `vite.config.*`. */\n\treadonly vite: Readonly<Record<string, unknown>>;\n\t/** The `tsdown` build's options: merged over `tsdown.config.*` at compatibility version 3, the whole build at 4. */\n\treadonly tsdown: Readonly<Record<string, unknown>>;\n}\n\nexport interface ResolveConfigOptions {\n\tcwd: string;\n\tconfigFile: string | null;\n\tconfig: StarsConfig;\n\tenv?: NodeJS.ProcessEnv;\n}\n\nexport const DEFAULT_ENTRIES = ['src/main.ts', 'src/main.js', 'src/index.ts', 'src/index.js'] as const;\nexport const DEFAULT_IGNORE = ['**/node_modules/**', '**/dist/**', '**/.git/**'] as const;\nexport const DEFAULT_DEBOUNCE = 150;\nexport const DEFAULT_KILL_TIMEOUT = 5000;\nexport const DEFAULT_NODE_ARGS = ['--enable-source-maps'] as const;\nexport const DEFAULT_DEV_PORT = 3000;\nexport const DEFAULT_I18N_LOCALES = 'src/locales/en-US';\nexport const DEFAULT_I18N_OUTPUT = 'src/@types/i18next.d.ts';\nexport const DEFAULT_IMPORTS_DIRS = ['src/lib/**', 'src/utils/**'] as const;\nexport const DEFAULT_IMPORTS_PRESETS = ['@wolfstar/http-framework', '@wolfstar/env-utilities'] as const;\nexport const DEFAULT_IMPORTS_DTS = '.stars/imports.d.ts';\nexport const DEFAULT_DEV_LOG_FILE = '.stars/dev.log';\nexport const DEFAULT_TUNNEL_PATH = '/';\n\nexport const DEFAULT_COMPATIBILITY_VERSION = 3;\nexport const LATEST_COMPATIBILITY_VERSION = 4;\n\nconst COMPATIBILITY_VERSIONS = new Set<number>([DEFAULT_COMPATIBILITY_VERSION, LATEST_COMPATIBILITY_VERSION]);\nconst BUILD_TOOLS = new Set<string>(['tsdown', 'tsc', 'none', 'vite', 'auto']);\nconst TYPECHECKERS = new Set<string>(['tsc', 'golar', 'tsz', 'auto']);\nconst VITE_CONFIG_FILES = ['vite.config.ts', 'vite.config.mts', 'vite.config.cts', 'vite.config.js', 'vite.config.mjs', 'vite.config.cjs'];\nconst TSDOWN_CONFIG_FILES = [\n\t'tsdown.config.ts',\n\t'tsdown.config.mts',\n\t'tsdown.config.cts',\n\t'tsdown.config.js',\n\t'tsdown.config.mjs',\n\t'tsdown.config.cjs',\n\t'tsdown.config.json'\n];\nconst TYPESCRIPT_EXTENSIONS = new Set(['.ts', '.mts', '.cts']);\n\n/**\n * Applies defaults, validates every option and resolves all paths to absolute ones.\n *\n * @throws {ConfigError} with an actionable `hint` on the first invalid option.\n */\nexport function resolveStarsConfig(options: ResolveConfigOptions): ResolvedStarsConfig {\n\tconst cwd = resolve(options.cwd);\n\tconst env = options.env ?? process.env;\n\tconst file = options.configFile;\n\tconst config = options.config;\n\tconst validator = new Validator(file);\n\n\tvalidator.knownKeys(config, '', ['root', 'entry', 'build', 'dev', 'codegen', 'imports', 'experimental', 'future', 'vite', 'tsdown']);\n\tconst baseDirectory = file ? dirname(file) : cwd;\n\n\tconst root = resolve(baseDirectory, validator.string(config.root, 'root') ?? '.');\n\tif (!isDirectory(root)) {\n\t\tthrow validator.error(\n\t\t\t`The project root does not exist: ${root}`,\n\t\t\t'root',\n\t\t\t'ROOT_NOT_FOUND',\n\t\t\t'Point `root` to an existing directory, relative to the configuration file.'\n\t\t);\n\t}\n\n\tconst packageJson = readPackageJson(root);\n\tconst experimental = resolveExperimental(config.experimental ?? {}, validator);\n\tconst future = resolveFuture(config.future ?? {}, validator);\n\tconst entry = resolveEntry(root, validator.string(config.entry, 'entry'), validator);\n\t// The tool-specific blocks are read before the build so a project that only declares `tsdown: {}` still resolves\n\t// `build.tool: 'auto'` to `tsdown`: configuring a tool is as clear a signal as depending on it.\n\tconst vite = validator.plainObject(config.vite, 'vite') ?? {};\n\tconst tsdown = validator.plainObject(config.tsdown, 'tsdown') ?? {};\n\tconst build = resolveBuild(root, entry, packageJson, config.build ?? {}, experimental, future, Object.keys(tsdown).length > 0, validator);\n\tconst dev = resolveDev(root, entry, packageJson, config.dev ?? {}, env, validator);\n\tconst codegen = resolveCodegen(root, config.codegen ?? {}, validator);\n\tconst imports = resolveImports(root, build.tool, future, config.imports, validator);\n\n\tif (Object.keys(tsdown).length > 0 && build.tool !== 'tsdown') {\n\t\tthrow validator.error(\n\t\t\t'`tsdown` options need the `tsdown` build tool',\n\t\t\t'tsdown',\n\t\t\t'TSDOWN_OPTIONS_REQUIRE_TSDOWN',\n\t\t\t`Set \\`build.tool\\` to 'tsdown', or remove \\`tsdown\\` (the build tool is '${build.tool}').`\n\t\t);\n\t}\n\n\tif (Object.keys(vite).length > 0 && build.tool !== 'vite') {\n\t\tthrow validator.error(\n\t\t\t'`vite` options need the `vite` build tool',\n\t\t\t'vite',\n\t\t\t'VITE_OPTIONS_REQUIRE_VITE',\n\t\t\t`Set \\`build.tool\\` to 'vite' with \\`experimental.enableVite\\`, or remove \\`vite\\` (the build tool is '${build.tool}').`\n\t\t);\n\t}\n\n\treturn { configFile: file, cwd, root, packageJson, entry, build, dev, codegen, imports, experimental, future, vite, tsdown };\n}\n\n/**\n * Presents an absolute path relative to `root` when possible, for display purposes.\n */\nexport function displayPath(root: string, path: string): string {\n\tconst rel = relative(root, path);\n\tif (!rel) return '.';\n\treturn rel.startsWith('..') || isAbsolute(rel) ? path : rel;\n}\n\nfunction resolveEntry(root: string, configured: string | undefined, validator: Validator): string {\n\tif (configured !== undefined) {\n\t\tconst entry = resolve(root, configured);\n\t\tif (!isFile(entry)) {\n\t\t\tthrow validator.error(\n\t\t\t\t`The entry file does not exist: ${entry}`,\n\t\t\t\t'entry',\n\t\t\t\t'ENTRY_NOT_FOUND',\n\t\t\t\t'Point `entry` to the file that starts the bot, relative to the project root.'\n\t\t\t);\n\t\t}\n\t\treturn entry;\n\t}\n\n\tfor (const candidate of DEFAULT_ENTRIES) {\n\t\tconst entry = join(root, candidate);\n\t\tif (isFile(entry)) return entry;\n\t}\n\n\tthrow validator.error(\n\t\t`Could not find the entry file in ${root}`,\n\t\t'entry',\n\t\t'ENTRY_NOT_FOUND',\n\t\t`Set \\`entry\\` in the configuration, or create one of ${DEFAULT_ENTRIES.join(', ')}.`\n\t);\n}\n\nfunction resolveBuild(\n\troot: string,\n\tentry: string,\n\tpackageJson: PackageJsonLike | null,\n\tconfig: NonNullable<StarsConfig['build']>,\n\texperimental: ResolvedExperimentalConfig,\n\tfuture: ResolvedFutureConfig,\n\thasTsdownOptions: boolean,\n\tvalidator: Validator\n): ResolvedBuildConfig {\n\tvalidator.knownKeys(config, 'build', ['tool', 'outDir', 'tsconfig']);\n\n\tconst requested = validator.string(config.tool, 'build.tool') ?? 'auto';\n\tif (!BUILD_TOOLS.has(requested)) {\n\t\tthrow validator.error(\n\t\t\t`Unknown build tool \"${requested}\"`,\n\t\t\t'build.tool',\n\t\t\t'INVALID_BUILD_TOOL',\n\t\t\t\"Use one of 'tsdown', 'tsc', 'vite', 'none' or 'auto'.\"\n\t\t);\n\t}\n\n\tif (requested === 'vite' && !experimental.enableVite) {\n\t\tthrow validator.error(\n\t\t\t\"The 'vite' build tool is experimental\",\n\t\t\t'build.tool',\n\t\t\t'EXPERIMENT_REQUIRED',\n\t\t\t'Set `experimental.enableVite` to true to use it.'\n\t\t);\n\t}\n\n\tconst isTypeScriptEntry = TYPESCRIPT_EXTENSIONS.has(extname(entry));\n\tconst tool: StarsBuildTool =\n\t\trequested === 'auto'\n\t\t\t? detectBuildTool(root, packageJson, isTypeScriptEntry, experimental, future, hasTsdownOptions)\n\t\t\t: (requested as StarsBuildTool);\n\n\tif (tool === 'none' && isTypeScriptEntry) {\n\t\tthrow validator.error(\n\t\t\t`The entry ${displayPath(root, entry)} is TypeScript but the build tool is 'none'`,\n\t\t\t'build.tool',\n\t\t\t'BUILD_TOOL_REQUIRED',\n\t\t\t\"Set `build.tool` to 'tsdown' or 'tsc', or point `entry` to a JavaScript file.\"\n\t\t);\n\t}\n\n\t// Nitro owns its own output layout; anything else keeps the plain `dist` convention.\n\tconst defaultOutDir = experimental.enableNitro ? '.output' : 'dist';\n\tconst outDir = resolve(root, validator.string(config.outDir, 'build.outDir') ?? defaultOutDir);\n\n\tlet tsconfig: string | null = null;\n\tconst configuredTsconfig = validator.string(config.tsconfig, 'build.tsconfig');\n\tif (configuredTsconfig !== undefined) {\n\t\ttsconfig = resolve(root, configuredTsconfig);\n\t\tif (!isFile(tsconfig)) {\n\t\t\tthrow validator.error(\n\t\t\t\t`The tsconfig file does not exist: ${tsconfig}`,\n\t\t\t\t'build.tsconfig',\n\t\t\t\t'TSCONFIG_NOT_FOUND',\n\t\t\t\t'Point `build.tsconfig` to an existing tsconfig.json, relative to the project root.'\n\t\t\t);\n\t\t}\n\t} else if (tool === 'tsc' || tool === 'tsdown') {\n\t\t// `tsdown` only looks for a `tsconfig.json` next to the project root, so a bot keeping its sources' one in\n\t\t// `src/` (the layout both the scaffold and the examples use) would silently build without its paths and\n\t\t// target. Resolving it here is what makes the `tsdown` build need no configuration of its own.\n\t\ttsconfig = [join(root, 'src', 'tsconfig.json'), join(root, 'tsconfig.json')].find((candidate) => isFile(candidate)) ?? null;\n\t\tif (!tsconfig && tool === 'tsc') {\n\t\t\tthrow validator.error(\n\t\t\t\t`Could not find a tsconfig.json in ${root}`,\n\t\t\t\t'build.tsconfig',\n\t\t\t\t'TSCONFIG_NOT_FOUND',\n\t\t\t\t'Create src/tsconfig.json or tsconfig.json, or set `build.tsconfig`.'\n\t\t\t);\n\t\t}\n\t}\n\n\t// Nitro always writes its server entry to `<outDir>/server/index.mjs`, regardless of the project's own entry\n\t// file name or `package.json#main` — it is Nitro's output, not a build of the project's own entry file.\n\tconst output = experimental.enableNitro\n\t\t? join(outDir, 'server', 'index.mjs')\n\t\t: tool === 'none'\n\t\t\t? entry\n\t\t\t: resolveBuildOutput(root, entry, outDir, packageJson);\n\n\tlet configFile = findConfigFile(root, tool === 'tsdown' ? TSDOWN_CONFIG_FILES : tool === 'vite' ? VITE_CONFIG_FILES : []);\n\t// `tsdown` reads `package.json#tsdown` when no configuration file is around, so it counts as one here.\n\tif (tool === 'tsdown' && configFile === null && packageJson?.tsdown !== undefined) configFile = join(root, 'package.json');\n\n\t// Compatibility version 4 builds `tsdown` from this file alone. A `tsdown.config.*` left behind would keep the\n\t// plugins and entry points it declares out of the build, so it is reported rather than quietly ignored.\n\tif (tool === 'tsdown' && configFile !== null && future.compatibilityVersion >= LATEST_COMPATIBILITY_VERSION) {\n\t\tthrow validator.error(\n\t\t\t`\\`${displayPath(root, configFile)}\\` is not used with compatibility version ${future.compatibilityVersion}`,\n\t\t\t'tsdown',\n\t\t\t'TSDOWN_CONFIG_FILE_UNSUPPORTED',\n\t\t\t`Move its options into \\`tsdown\\` here, drop the ${displayPath(root, configFile)} configuration, or set \\`future.compatibilityVersion\\` to ${DEFAULT_COMPATIBILITY_VERSION}.`\n\t\t);\n\t}\n\n\treturn { tool, outDir, tsconfig, output, configFile };\n}\n\nfunction findConfigFile(root: string, names: readonly string[]): string | null {\n\tfor (const name of names) {\n\t\tconst candidate = join(root, name);\n\t\tif (isFile(candidate)) return candidate;\n\t}\n\n\treturn null;\n}\n\nfunction detectBuildTool(\n\troot: string,\n\tpackageJson: PackageJsonLike | null,\n\tisTypeScriptEntry: boolean,\n\texperimental: ResolvedExperimentalConfig,\n\tfuture: ResolvedFutureConfig,\n\thasTsdownOptions: boolean\n): StarsBuildTool {\n\t// Vite only wins the detection once the project opted into it; without the flag a `vite.config.*` is somebody\n\t// else's (a dashboard, a docs site) and must not take the bot's build over.\n\tif (experimental.enableVite) {\n\t\tconst hasVite = VITE_CONFIG_FILES.some((name) => isFile(join(root, name))) || hasDependency(packageJson, 'vite');\n\t\tif (hasVite) return 'vite';\n\t}\n\n\tif (hasTsdownOptions) return 'tsdown';\n\n\t// From compatibility version 4 on, `tsdown` is the build of a TypeScript project rather than one of the options:\n\t// there is no `tsdown.config.*` left to detect it from, and a missing dependency is reported by the builder with\n\t// an install hint instead of silently falling back to `tsc`.\n\tif (future.compatibilityVersion >= LATEST_COMPATIBILITY_VERSION) return isTypeScriptEntry ? 'tsdown' : 'none';\n\n\tconst hasTsdown = TSDOWN_CONFIG_FILES.some((name) => isFile(join(root, name))) || hasDependency(packageJson, 'tsdown');\n\tif (hasTsdown) return 'tsdown';\n\tif (isTypeScriptEntry) return 'tsc';\n\treturn 'none';\n}\n\n/**\n * Resolves the `future` block. It carries the defaults of the next major, the way Nuxt's own\n * `future.compatibilityVersion` does: a project opts into them one major early, and they become the default when\n * that major ships.\n */\nfunction resolveFuture(config: StarsFutureConfig, validator: Validator): ResolvedFutureConfig {\n\tif (config === null || typeof config !== 'object' || Array.isArray(config)) {\n\t\tthrow validator.error('`future` must be an object', 'future', 'INVALID_TYPE', 'Use `{ compatibilityVersion }`.');\n\t}\n\n\tvalidator.knownKeys(config, 'future', ['compatibilityVersion']);\n\tconst version = config.compatibilityVersion;\n\tif (version === undefined) return { compatibilityVersion: DEFAULT_COMPATIBILITY_VERSION };\n\n\tif (typeof version !== 'number' || !COMPATIBILITY_VERSIONS.has(version)) {\n\t\tthrow validator.error(\n\t\t\t`Unknown compatibility version ${describe(version)}`,\n\t\t\t'future.compatibilityVersion',\n\t\t\t'INVALID_COMPATIBILITY_VERSION',\n\t\t\t`Use ${DEFAULT_COMPATIBILITY_VERSION} (today's defaults) or ${LATEST_COMPATIBILITY_VERSION} (the next major's).`\n\t\t);\n\t}\n\n\treturn { compatibilityVersion: version as StarsCompatibilityVersion };\n}\n\n/**\n * Resolves the `experimental` block. Every flag is a boolean defaulting to `false`, the way Nuxt's own experimental\n * flags are declared, and the ones that build on each other are checked here rather than surfacing later as a\n * confusing runtime failure.\n */\nfunction resolveExperimental(config: StarsExperimentalConfig, validator: Validator): ResolvedExperimentalConfig {\n\tif (config === null || typeof config !== 'object' || Array.isArray(config)) {\n\t\tthrow validator.error(\n\t\t\t'`experimental` must be an object',\n\t\t\t'experimental',\n\t\t\t'INVALID_TYPE',\n\t\t\t'Use `{ enableVite, enableExternalVite, enableNitro, nitro }`.'\n\t\t);\n\t}\n\n\tvalidator.knownKeys(config, 'experimental', ['enableVite', 'enableExternalVite', 'enableNitro', 'nitro']);\n\tconst enableVite = validator.boolean(config.enableVite, 'experimental.enableVite') ?? false;\n\tconst enableExternalVite = validator.boolean(config.enableExternalVite, 'experimental.enableExternalVite') ?? false;\n\tconst enableNitro = validator.boolean(config.enableNitro, 'experimental.enableNitro') ?? false;\n\n\tif (enableExternalVite && !enableVite) {\n\t\tthrow validator.error(\n\t\t\t'`experimental.enableExternalVite` needs `experimental.enableVite`',\n\t\t\t'experimental.enableExternalVite',\n\t\t\t'EXPERIMENT_REQUIRED',\n\t\t\t'Set `experimental.enableVite` to true as well, or drop `enableExternalVite`.'\n\t\t);\n\t}\n\n\tif (enableNitro && !enableVite) {\n\t\tthrow validator.error(\n\t\t\t'`experimental.enableNitro` needs `experimental.enableVite`',\n\t\t\t'experimental.enableNitro',\n\t\t\t'EXPERIMENT_REQUIRED',\n\t\t\t'Set `experimental.enableVite` to true as well, or drop `enableNitro`.'\n\t\t);\n\t}\n\n\tconst rawNitro = 'nitro' in config ? config.nitro : undefined;\n\tif (rawNitro !== undefined && !enableNitro) {\n\t\tthrow validator.error(\n\t\t\t'`experimental.nitro` needs `experimental.enableNitro`',\n\t\t\t'experimental.nitro',\n\t\t\t'EXPERIMENT_REQUIRED',\n\t\t\t'Set `experimental.enableNitro` to true as well, or drop `nitro`.'\n\t\t);\n\t}\n\tif (rawNitro !== undefined && (rawNitro === null || typeof rawNitro !== 'object' || Array.isArray(rawNitro))) {\n\t\tthrow validator.error('`experimental.nitro` must be an object', 'experimental.nitro', 'INVALID_TYPE', 'Use `{ preset }`.');\n\t}\n\tif (rawNitro) validator.knownKeys(rawNitro, 'experimental.nitro', ['preset']);\n\tconst preset = validator.string(rawNitro?.preset, 'experimental.nitro.preset') ?? 'node-server';\n\n\treturn { enableVite, enableExternalVite, enableNitro, nitro: { preset } };\n}\n\nfunction resolveBuildOutput(root: string, entry: string, outDir: string, packageJson: PackageJsonLike | null): string {\n\tif (packageJson?.main) return resolve(root, packageJson.main);\n\n\tconst extension = extname(entry);\n\tconst outputExtension = extension === '.mts' ? '.mjs' : extension === '.cts' ? '.cjs' : '.js';\n\treturn join(outDir, `${basename(entry, extension)}${outputExtension}`);\n}\n\nconst ENV_FILES = ['.env.local', '.env'] as const;\nconst ENV_PORT_KEYS = ['HTTP_PORT', 'PORT'] as const;\n\n/**\n * Reads the project's `.env.local`/`.env` into a plain object, the way `stars dev` and `stars commands` need it:\n * these files are only loaded into `process.env` by the bot itself once it starts (see `@wolfstar/env-utilities`),\n * so by the time the CLI runs they are not there yet. This is a minimal line reader, not a full dotenv\n * implementation — quoting is stripped, but expansion (`dotenv-expand`) is not. Earlier files win, matching\n * dotenv's own precedence.\n */\nexport function readProjectEnvFiles(root: string): Record<string, string> {\n\tconst result: Record<string, string> = {};\n\n\tfor (const file of ENV_FILES) {\n\t\tconst path = join(root, file);\n\t\tif (!isFile(path)) continue;\n\n\t\tlet contents: string;\n\t\ttry {\n\t\t\tcontents = readFileSync(path, 'utf-8');\n\t\t} catch {\n\t\t\tcontinue;\n\t\t}\n\n\t\tfor (const line of contents.split(/\\r?\\n/)) {\n\t\t\tconst match = /^\\s*(?:export\\s+)?([A-Za-z_][A-Za-z0-9_]*)\\s*=\\s*(.*)$/.exec(line);\n\t\t\tif (!match) continue;\n\n\t\t\tconst key = match[1]!;\n\t\t\tif (key in result) continue;\n\t\t\tresult[key] = match[2]!.trim().replace(/^['\"]|['\"]$/g, '');\n\t\t}\n\t}\n\n\treturn result;\n}\n\nfunction readDevPortFromEnvFile(root: string): string | null {\n\tconst values = readProjectEnvFiles(root);\n\tfor (const key of ENV_PORT_KEYS) {\n\t\tif (values[key]) return values[key];\n\t}\n\n\treturn null;\n}\n\nfunction resolveDev(\n\troot: string,\n\tentry: string,\n\tpackageJson: PackageJsonLike | null,\n\tconfig: NonNullable<StarsConfig['dev']>,\n\tenv: NodeJS.ProcessEnv,\n\tvalidator: Validator\n): ResolvedDevConfig {\n\tvalidator.knownKeys(config, 'dev', [\n\t\t'banner',\n\t\t'watch',\n\t\t'ignore',\n\t\t'debounce',\n\t\t'env',\n\t\t'nodeArgs',\n\t\t'args',\n\t\t'url',\n\t\t'health',\n\t\t'killTimeout',\n\t\t'typecheck',\n\t\t'tunnel',\n\t\t'logFile'\n\t]);\n\n\tconst watch = (validator.stringArray(config.watch, 'dev.watch') ?? [displayPath(root, dirname(entry))]).map((path) => resolve(root, path));\n\tconst ignore = validator.stringArray(config.ignore, 'dev.ignore') ?? [...DEFAULT_IGNORE];\n\tconst debounce = validator.nonNegativeNumber(config.debounce, 'dev.debounce') ?? DEFAULT_DEBOUNCE;\n\tconst devEnv = validator.stringRecord(config.env, 'dev.env') ?? {};\n\tconst nodeArgs = validator.stringArray(config.nodeArgs, 'dev.nodeArgs') ?? [...DEFAULT_NODE_ARGS];\n\tconst args = validator.stringArray(config.args, 'dev.args') ?? [];\n\tconst killTimeout = validator.nonNegativeNumber(config.killTimeout, 'dev.killTimeout') ?? DEFAULT_KILL_TIMEOUT;\n\tconst health = validator.string(config.health, 'dev.health') ?? null;\n\n\tlet url = validator.string(config.url, 'dev.url') ?? null;\n\tif (url !== null) {\n\t\ttry {\n\t\t\tnew URL(url);\n\t\t} catch {\n\t\t\tthrow validator.error(`Invalid URL \"${url}\"`, 'dev.url', 'INVALID_URL', 'Use an absolute URL such as http://localhost:3000.');\n\t\t}\n\t} else {\n\t\t// Mirrors Vite's and Nuxt's own dev servers: a URL is shown without any configuration. The exact host\n\t\t// (`localhost` vs `127.0.0.1`) is resolved at runtime by `stars dev`, once it knows which one is actually reachable.\n\t\tconst port = devEnv.HTTP_PORT ?? env.HTTP_PORT ?? readDevPortFromEnvFile(root) ?? String(DEFAULT_DEV_PORT);\n\t\turl = /^\\d+$/.test(port) ? `http://localhost:${port}` : `http://localhost:${DEFAULT_DEV_PORT}`;\n\t}\n\n\tconst typecheck = resolveTypecheck(root, packageJson, config.typecheck, validator);\n\tconst tunnel = resolveTunnel(config.tunnel, validator);\n\tconst logFile = config.logFile === false ? null : resolve(root, validator.string(config.logFile, 'dev.logFile') ?? DEFAULT_DEV_LOG_FILE);\n\tconst banner =\n\t\tconfig.banner === false\n\t\t\t? false\n\t\t\t: typeof config.banner === 'string'\n\t\t\t\t? config.banner.split('\\n')\n\t\t\t\t: (validator.stringArray(config.banner, 'dev.banner') ?? null);\n\n\treturn { watch, ignore, debounce, env: devEnv, nodeArgs, args, url, health, killTimeout, typecheck, tunnel, logFile, banner };\n}\n\n/**\n * Resolves `dev.typecheck`. The tsconfig is looked up the same way the `tsc` build tool looks up its own, so a\n * project building with `tsdown` still gets `tsc --watch --noEmit` on the right project file.\n */\nfunction resolveTypecheck(\n\troot: string,\n\tpackageJson: PackageJsonLike | null,\n\tconfig: StarsDevConfig['typecheck'],\n\tvalidator: Validator\n): ResolvedTypecheckConfig {\n\tif (config === undefined || config === false) return { enabled: false, tsconfig: null, checker: detectTypechecker(packageJson) };\n\n\tlet configured: string | undefined;\n\tlet requestedChecker = 'auto';\n\tif (config !== true) {\n\t\tif (config === null || typeof config !== 'object' || Array.isArray(config)) {\n\t\t\tthrow validator.error(\n\t\t\t\t'`dev.typecheck` must be a boolean or an object',\n\t\t\t\t'dev.typecheck',\n\t\t\t\t'INVALID_TYPE',\n\t\t\t\t'Use `true` to type-check with the project tsconfig, `{ tsconfig }` to pick one, or `false` to disable it.'\n\t\t\t);\n\t\t}\n\n\t\tvalidator.knownKeys(config, 'dev.typecheck', ['tsconfig', 'checker']);\n\t\tconfigured = validator.string(config.tsconfig, 'dev.typecheck.tsconfig');\n\t\trequestedChecker = validator.string(config.checker, 'dev.typecheck.checker') ?? 'auto';\n\t\tif (!TYPECHECKERS.has(requestedChecker)) {\n\t\t\tthrow validator.error(\n\t\t\t\t`Unknown type checker \"${requestedChecker}\"`,\n\t\t\t\t'dev.typecheck.checker',\n\t\t\t\t'INVALID_TYPECHECKER',\n\t\t\t\t\"Use one of 'tsc', 'golar', 'tsz' or 'auto'.\"\n\t\t\t);\n\t\t}\n\t}\n\n\tconst checker: StarsTypechecker = requestedChecker === 'auto' ? detectTypechecker(packageJson) : (requestedChecker as StarsTypechecker);\n\n\tif (configured !== undefined) {\n\t\tconst tsconfig = resolve(root, configured);\n\t\tif (!isFile(tsconfig)) {\n\t\t\tthrow validator.error(\n\t\t\t\t`The tsconfig file does not exist: ${tsconfig}`,\n\t\t\t\t'dev.typecheck.tsconfig',\n\t\t\t\t'TSCONFIG_NOT_FOUND',\n\t\t\t\t'Point `dev.typecheck.tsconfig` to an existing tsconfig.json, relative to the project root.'\n\t\t\t);\n\t\t}\n\t\treturn { enabled: true, tsconfig, checker };\n\t}\n\n\tconst found = [join(root, 'src', 'tsconfig.json'), join(root, 'tsconfig.json')].find((candidate) => isFile(candidate)) ?? null;\n\tif (!found) {\n\t\tthrow validator.error(\n\t\t\t`Could not find a tsconfig.json in ${root}`,\n\t\t\t'dev.typecheck',\n\t\t\t'TSCONFIG_NOT_FOUND',\n\t\t\t'Create src/tsconfig.json or tsconfig.json, or set `dev.typecheck.tsconfig`.'\n\t\t);\n\t}\n\n\treturn { enabled: true, tsconfig: found, checker };\n}\n\n/**\n * Picks the type checker when `dev.typecheck.checker` is `auto`: `golar` when the project already depends on it\n * (it wraps TypeScript and is what this repository's own `typecheck` scripts run), `tsc` otherwise. `tsz` is never\n * picked automatically — it is an early, tsc-compatible alternative a project opts into.\n */\nfunction detectTypechecker(packageJson: PackageJsonLike | null): StarsTypechecker {\n\treturn hasDependency(packageJson, 'golar') ? 'golar' : 'tsc';\n}\n\n/**\n * Resolves `dev.tunnel`: `true` (or `{}`) opens a `cloudflared` quick tunnel, a string (or `{ url }`) is an https\n * URL the user already serves and the CLI only checks.\n */\nfunction resolveTunnel(config: StarsDevConfig['tunnel'], validator: Validator): ResolvedTunnelConfig {\n\tif (config === undefined || config === false) return { mode: 'off' };\n\n\tlet url: string | undefined;\n\tlet updateEndpoint = false;\n\tlet path = DEFAULT_TUNNEL_PATH;\n\n\tif (typeof config === 'string') {\n\t\turl = config;\n\t} else if (config !== true) {\n\t\tif (config === null || typeof config !== 'object' || Array.isArray(config)) {\n\t\t\tthrow validator.error(\n\t\t\t\t'`dev.tunnel` must be a boolean, an https URL or an object',\n\t\t\t\t'dev.tunnel',\n\t\t\t\t'INVALID_TYPE',\n\t\t\t\t'Use `true` for a cloudflared quick tunnel, an https URL you already serve, or `false` to disable it.'\n\t\t\t);\n\t\t}\n\n\t\tvalidator.knownKeys(config, 'dev.tunnel', ['url', 'updateEndpoint', 'path']);\n\t\turl = validator.string(config.url, 'dev.tunnel.url');\n\t\tupdateEndpoint = validator.boolean(config.updateEndpoint, 'dev.tunnel.updateEndpoint') ?? false;\n\t\tpath = validator.string(config.path, 'dev.tunnel.path') ?? DEFAULT_TUNNEL_PATH;\n\t}\n\n\tif (url === undefined) return { mode: 'quick', path, updateEndpoint };\n\n\t// Discord only accepts an https interactions endpoint.\n\tlet parsed: URL;\n\ttry {\n\t\tparsed = new URL(url);\n\t} catch {\n\t\tthrow validator.error(`Invalid URL \"${url}\"`, 'dev.tunnel', 'INVALID_URL', 'Use an absolute https URL such as https://bot.example.com.');\n\t}\n\n\tif (parsed.protocol !== 'https:') {\n\t\tthrow validator.error(\n\t\t\t`The tunnel URL must be https, received \"${url}\"`,\n\t\t\t'dev.tunnel',\n\t\t\t'INVALID_URL',\n\t\t\t'Discord only accepts an https interactions endpoint.'\n\t\t);\n\t}\n\n\treturn { mode: 'url', url, path, updateEndpoint };\n}\n\nfunction resolveCodegen(root: string, config: NonNullable<StarsConfig['codegen']>, validator: Validator): ResolvedCodegenConfig {\n\tvalidator.knownKeys(config, 'codegen', ['i18n']);\n\n\tif (config.i18n === false) return { i18n: null };\n\n\tif (config.i18n === undefined) {\n\t\tconst locales = join(root, DEFAULT_I18N_LOCALES);\n\t\treturn { i18n: isDirectory(locales) ? { locales, output: join(root, DEFAULT_I18N_OUTPUT) } : null };\n\t}\n\n\tif (config.i18n === null || typeof config.i18n !== 'object') {\n\t\tthrow validator.error(\n\t\t\t'`codegen.i18n` must be an object or `false`',\n\t\t\t'codegen.i18n',\n\t\t\t'INVALID_TYPE',\n\t\t\t'Use `{ locales, output }` to configure it or `false` to disable it.'\n\t\t);\n\t}\n\n\tvalidator.knownKeys(config.i18n, 'codegen.i18n', ['locales', 'output']);\n\tconst locales = resolve(root, validator.string(config.i18n.locales, 'codegen.i18n.locales') ?? DEFAULT_I18N_LOCALES);\n\tif (!isDirectory(locales)) {\n\t\tthrow validator.error(\n\t\t\t`The locales directory does not exist: ${locales}`,\n\t\t\t'codegen.i18n.locales',\n\t\t\t'LOCALES_NOT_FOUND',\n\t\t\t'Point `codegen.i18n.locales` to the base locale directory, relative to the project root.'\n\t\t);\n\t}\n\n\tconst output = resolve(root, validator.string(config.i18n.output, 'codegen.i18n.output') ?? DEFAULT_I18N_OUTPUT);\n\treturn { i18n: { locales, output } };\n}\n\n/**\n * The transform that injects auto imports (`@wolfstar/http-framework/auto-imports`) only runs through `tsdown`'s\n * rolldown pipeline, the same way Nuxt's own auto imports only run through its Vite/webpack build: `tsc` and `none`\n * have no transform step to hook into. `tsdown` is picked as `build.tool` first (see {@link detectBuildTool}) for the\n * same reason — it is the only tool this feature, and this build config in general, treats as the default choice.\n *\n * They are on by default from compatibility version 4 on, where `stars` wires the plugin into the build itself. At 3\n * the plugin is the project's to add, so defaulting them on would promise imports that never get injected.\n */\nfunction resolveImports(\n\troot: string,\n\tbuildTool: StarsBuildTool,\n\tfuture: ResolvedFutureConfig,\n\tconfig: StarsConfig['imports'],\n\tvalidator: Validator\n): ResolvedImportsConfig {\n\tconst defaultDirs = DEFAULT_IMPORTS_DIRS.map((dir) => resolve(root, dir));\n\tconst defaultPresets = [...DEFAULT_IMPORTS_PRESETS];\n\tconst defaultDts = resolve(root, DEFAULT_IMPORTS_DTS);\n\n\tif (config === false) {\n\t\treturn { enabled: false, dirs: defaultDirs, presets: defaultPresets, exclude: [], dts: defaultDts };\n\t}\n\n\tconst forcedOn = config === true;\n\tconst options = forcedOn || config === undefined ? {} : config;\n\tif (typeof options !== 'object' || options === null || Array.isArray(options)) {\n\t\tthrow validator.error(\n\t\t\t'`imports` must be an object, `true` or `false`',\n\t\t\t'imports',\n\t\t\t'INVALID_TYPE',\n\t\t\t'Use `{ dirs, presets, exclude, dts }`, `true` to enable with defaults, or `false` to disable.'\n\t\t);\n\t}\n\n\tvalidator.knownKeys(options, 'imports', ['enabled', 'dirs', 'presets', 'exclude', 'dts']);\n\n\tconst requestedOn = forcedOn || validator.boolean(options.enabled, 'imports.enabled');\n\tif (requestedOn && buildTool !== 'tsdown') {\n\t\tthrow validator.error(\n\t\t\t'`imports` requires the `tsdown` build tool',\n\t\t\t'imports.enabled',\n\t\t\t'IMPORTS_REQUIRE_TSDOWN',\n\t\t\t\"Set `build.tool` to 'tsdown', or remove `imports`/set it to `false`.\"\n\t\t);\n\t}\n\n\tconst dirs = (validator.stringArray(options.dirs, 'imports.dirs') ?? [...DEFAULT_IMPORTS_DIRS]).map((dir) => resolve(root, dir));\n\tconst presets = validator.stringArray(options.presets, 'imports.presets') ?? defaultPresets;\n\tconst exclude = validator.stringArray(options.exclude, 'imports.exclude') ?? [];\n\tconst dts = resolve(root, validator.string(options.dts, 'imports.dts') ?? DEFAULT_IMPORTS_DTS);\n\n\tconst enabledByDefault = buildTool === 'tsdown' && future.compatibilityVersion >= LATEST_COMPATIBILITY_VERSION;\n\treturn { enabled: requestedOn ?? enabledByDefault, dirs, presets, exclude, dts };\n}\n\nclass Validator {\n\tpublic constructor(private readonly file: string | null) {}\n\n\tpublic error(message: string, path: string, code: string, hint: string): ConfigError {\n\t\treturn new ConfigError(message, { code, path, hint, file: this.file });\n\t}\n\n\tpublic knownKeys(value: object, path: string, keys: readonly string[]): void {\n\t\tfor (const key of Object.keys(value)) {\n\t\t\tif (keys.includes(key)) continue;\n\t\t\tconst fullPath = path ? `${path}.${key}` : key;\n\t\t\tthrow this.error(\n\t\t\t\t`Unknown option \\`${fullPath}\\``,\n\t\t\t\tfullPath,\n\t\t\t\t'UNKNOWN_OPTION',\n\t\t\t\t`Known options${path ? ` of \\`${path}\\`` : ''}: ${keys.join(', ')}.`\n\t\t\t);\n\t\t}\n\t}\n\n\tpublic string(value: unknown, path: string): string | undefined {\n\t\tif (value === undefined) return undefined;\n\t\tif (typeof value !== 'string' || value.length === 0) throw this.typeError(path, 'a non-empty string', value);\n\t\treturn value;\n\t}\n\n\tpublic boolean(value: unknown, path: string): boolean | undefined {\n\t\tif (value === undefined) return undefined;\n\t\tif (typeof value !== 'boolean') throw this.typeError(path, 'a boolean', value);\n\t\treturn value;\n\t}\n\n\t/** A plain object passed through as-is (e.g. raw `vite`/`tsdown` config merged into the project's own). */\n\tpublic plainObject(value: unknown, path: string): Record<string, unknown> | undefined {\n\t\tif (value === undefined) return undefined;\n\t\tif (value === null || typeof value !== 'object' || Array.isArray(value)) throw this.typeError(path, 'an object', value);\n\t\treturn value as Record<string, unknown>;\n\t}\n\n\tpublic stringArray(value: unknown, path: string): string[] | undefined {\n\t\tif (value === undefined) return undefined;\n\t\tif (!Array.isArray(value) || !value.every((item) => typeof item === 'string')) throw this.typeError(path, 'an array of strings', value);\n\t\treturn value;\n\t}\n\n\tpublic nonNegativeNumber(value: unknown, path: string): number | undefined {\n\t\tif (value === undefined) return undefined;\n\t\tif (typeof value !== 'number' || !Number.isFinite(value) || value < 0) throw this.typeError(path, 'a non-negative number', value);\n\t\treturn value;\n\t}\n\n\tpublic stringRecord(value: unknown, path: string): Record<string, string> | undefined {\n\t\tif (value === undefined) return undefined;\n\t\tif (value === null || typeof value !== 'object' || Array.isArray(value) || !Object.values(value).every((item) => typeof item === 'string')) {\n\t\t\tthrow this.typeError(path, 'an object of string values', value);\n\t\t}\n\t\treturn value as Record<string, string>;\n\t}\n\n\tprivate typeError(path: string, expected: string, value: unknown): ConfigError {\n\t\treturn this.error(\n\t\t\t`\\`${path}\\` must be ${expected}, received ${describe(value)}`,\n\t\t\tpath,\n\t\t\t'INVALID_TYPE',\n\t\t\t`Set \\`${path}\\` to ${expected} or remove it to use the default.`\n\t\t);\n\t}\n}\n\nfunction describe(value: unknown): string {\n\tif (value === null) return 'null';\n\tif (Array.isArray(value)) return 'an array';\n\tif (typeof value === 'string') return `\"${value}\"`;\n\treturn typeof value === 'object' ? 'an object' : `${typeof value} ${String(value)}`;\n}\n\nfunction hasDependency(packageJson: PackageJsonLike | null, name: string): boolean {\n\treturn Boolean(packageJson?.dependencies?.[name] ?? packageJson?.devDependencies?.[name]);\n}\n\nfunction readPackageJson(root: string): PackageJsonLike | null {\n\tconst file = join(root, 'package.json');\n\tif (!isFile(file)) return null;\n\n\ttry {\n\t\tconst parsed: unknown = JSON.parse(readFileSync(file, 'utf-8'));\n\t\treturn parsed !== null && typeof parsed === 'object' ? (parsed as PackageJsonLike) : null;\n\t} catch (error) {\n\t\tthrow new ConfigError(`Failed to parse ${file}: ${error instanceof Error ? error.message : String(error)}`, {\n\t\t\tcode: 'PACKAGE_JSON_INVALID',\n\t\t\thint: 'Fix the JSON syntax of the package.json file.',\n\t\t\tcause: error\n\t\t});\n\t}\n}\n\nfunction isFile(path: string): boolean {\n\ttry {\n\t\treturn existsSync(path) && statSync(path).isFile();\n\t} catch {\n\t\treturn false;\n\t}\n}\n\nfunction isDirectory(path: string): boolean {\n\ttry {\n\t\treturn existsSync(path) && statSync(path).isDirectory();\n\t} catch {\n\t\treturn false;\n\t}\n}\n","import { loadConfigFile } from './load.js';\nimport { resolveStarsConfig, type ResolvedStarsConfig } from './resolve.js';\n\nexport interface LoadStarsConfigOptions {\n\t/**\n\t * The directory to discover `stars.config.*` from.\n\t * @default process.cwd()\n\t */\n\tcwd?: string;\n\t/** An explicit configuration file, resolved from `cwd`. */\n\tconfigFile?: string | null;\n\t/**\n\t * Environment used for defaults such as `HTTP_PORT`.\n\t * @default process.env\n\t */\n\tenv?: NodeJS.ProcessEnv;\n}\n\n/**\n * Loads, validates and resolves a project's `stars.config.*`.\n *\n * @throws {ConfigError} when the configuration file cannot be loaded or contains an invalid option.\n */\nexport async function loadStarsConfig(options: LoadStarsConfigOptions = {}): Promise<ResolvedStarsConfig> {\n\tconst cwd = options.cwd ?? process.cwd();\n\tconst loaded = await loadConfigFile({ cwd, configFile: options.configFile });\n\treturn resolveStarsConfig({ cwd, configFile: loaded.configFile, config: loaded.config, env: options.env });\n}\n\nexport { CONFIG_EXTENSIONS, CONFIG_FILE_NAMES, discoverConfigFile, loadConfigFile } from './load.js';\nexport type { LoadConfigFileOptions, LoadedConfigFile } from './load.js';\nexport { ConfigError } from './errors.js';\nexport type { ConfigErrorOptions } from './errors.js';\nexport { displayPath, readProjectEnvFiles, resolveStarsConfig } from './resolve.js';\nexport type {\n\tPackageJsonLike,\n\tResolveConfigOptions,\n\tResolvedBuildConfig,\n\tResolvedCodegenConfig,\n\tResolvedDevConfig,\n\tResolvedExperimentalConfig,\n\tResolvedFutureConfig,\n\tResolvedNitroConfig,\n\tResolvedI18nCodegenConfig,\n\tResolvedImportsConfig,\n\tResolvedStarsConfig,\n\tResolvedTunnelConfig,\n\tResolvedTypecheckConfig\n} from './resolve.js';\n","/**\n * Public, side-effect free configuration surface of `@wolfstar/cli`.\n *\n * This module is intentionally tiny: importing it from a `stars.config.ts`\n * file must never start the bot nor pull the heavy runtime of the CLI.\n *\n * @module @wolfstar/http-framework/config\n */\n\n/**\n * The build tool used to turn the project sources into runnable JavaScript.\n *\n * - `tsdown`: run the project's own `tsdown` programmatically, configured from {@link StarsConfig.tsdown} (and, with\n * {@link StarsFutureConfig.compatibilityVersion} `3`, from the project's `tsdown.config.*` too).\n * - `tsc`: run the project's `tsc -b` on the configured `tsconfig`.\n * - `vite`: run the project's own `vite` (configuration file included), requires `experimental.enableVite`.\n * - `none`: the entry is runnable as-is (JavaScript projects), no build step.\n * - `auto`: detect from the project (default).\n */\nexport type StarsBuildTool = 'tsdown' | 'tsc' | 'none' | 'vite';\n\nexport interface StarsBuildConfig {\n\t/**\n\t * The build tool to use.\n\t * @default 'auto'\n\t */\n\ttool?: StarsBuildTool | 'auto';\n\t/**\n\t * The directory, relative to {@link StarsConfig.root}, the build writes into.\n\t * @default 'dist', or '.output' when `experimental.enableNitro` is on (Nitro's own convention)\n\t */\n\toutDir?: string;\n\t/**\n\t * The `tsconfig.json` the `tsc` and `tsdown` build tools use, relative to {@link StarsConfig.root}.\n\t * @default 'src/tsconfig.json' when it exists, 'tsconfig.json' otherwise\n\t */\n\ttsconfig?: string;\n}\n\n/**\n * Raw options merged into the project's own `vite.config.*`, the way `vite: {}` in a Nuxt config is merged into\n * Nuxt's own Vite config. Kept as `unknown` here (the CLI, not the framework, depends on `vite`'s types) and passed\n * to Vite's `mergeConfig` as-is.\n */\nexport type StarsViteConfig = Record<string, unknown>;\n\n/**\n * Options for `tsdown`, the bundler `stars build` uses by default.\n *\n * With {@link StarsFutureConfig.compatibilityVersion} `4` these replace `tsdown.config.*` outright: the build is\n * derived from `stars.config` (the entry's directory, `build.outDir`, `build.tsconfig`) and these options are layered\n * on top, so a project keeps one configuration file instead of two. With `3` the project's own `tsdown.config.*` is\n * still loaded and these are merged over it, the way `vite: {}` in a Nuxt config is merged into the project's own\n * Vite config: values here win, and `plugins` are appended rather than replaced.\n *\n * The options named below are the ones a bot usually reaches for. Every other `tsdown` option is accepted as-is —\n * the framework does not depend on `tsdown`, so they stay loosely typed here and `tsdown`'s own `UserConfig` is the\n * reference.\n */\nexport interface StarsTsdownConfig {\n\t/** Entry files or glob patterns, relative to the project root. Defaults to every source file next to `entry`. */\n\tentry?: string | readonly string[] | Record<string, string>;\n\t/** @default 'esm' */\n\tformat?: 'esm' | 'cjs' | 'iife' | 'umd' | readonly string[] | Record<string, unknown>;\n\t/** @default 'node' */\n\tplatform?: 'node' | 'neutral' | 'browser';\n\ttarget?: string | readonly string[] | false;\n\t/**\n\t * Emits one output file per source file instead of a single bundle, so pieces stay loadable from `dist/commands`\n\t * and friends at runtime.\n\t * @default true\n\t */\n\tunbundle?: boolean;\n\t/** Rolldown plugins. Appended to the ones `stars` adds (auto imports) and to those of a `tsdown.config.*`. */\n\tplugins?: readonly unknown[];\n\talias?: Record<string, string>;\n\tdefine?: Record<string, string>;\n\texternal?: unknown;\n\tnoExternal?: unknown;\n\tdeps?: Record<string, unknown>;\n\t/** @default () => ({ js: extname(build.output) }) */\n\toutExtensions?: unknown;\n\t/** @default true */\n\tsourcemap?: boolean | 'inline' | 'hidden';\n\tminify?: unknown;\n\t/** @default false — a bot is not a library, so no declaration files are emitted. */\n\tdts?: boolean | Record<string, unknown>;\n\t/** @default true */\n\tclean?: boolean | readonly string[];\n\ttreeshake?: boolean;\n\tcopy?: unknown;\n\thooks?: Record<string, unknown>;\n\t[option: string]: unknown;\n}\n\n/**\n * The `stars` major version whose defaults the project runs on, the way Nuxt's own `future.compatibilityVersion`\n * makes the next major's defaults available one major early.\n */\nexport type StarsCompatibilityVersion = 3 | 4;\n\n/**\n * Nuxt-style `future` block: defaults that are already decided for the next major, available today. Where\n * `experimental` guards work that is still landing and may change shape, everything here is settled — it only waits\n * for a major to become the default.\n */\nexport interface StarsFutureConfig {\n\t/**\n\t * The major whose defaults apply.\n\t *\n\t * `4` turns on the next major's build pipeline:\n\t * - auto imports are on by default with the `tsdown` build tool ({@link StarsImportsConfig}), and the\n\t * `autoImports()` plugin is wired into the build by `stars` itself.\n\t * - `tsdown` is configured from {@link StarsConfig.tsdown} only. A `tsdown.config.*` in the project root is\n\t * rejected rather than silently ignored, so a build never loses the plugins it declares.\n\t * - `build.tool: 'auto'` resolves to `tsdown` for any TypeScript entry, without looking for a `tsdown.config.*`\n\t * or a `tsdown` dependency first.\n\t *\n\t * `3` keeps today's behaviour: auto imports off unless asked for, and a `tsdown.config.*` loaded and merged with\n\t * {@link StarsConfig.tsdown}.\n\t * @default 3\n\t */\n\tcompatibilityVersion?: StarsCompatibilityVersion;\n}\n\n/**\n * The type checker `stars dev` runs next to the bot.\n *\n * - `tsc`: the project's own TypeScript, in watch mode.\n * - `golar`: the project's `golar`, forwarding to TypeScript (`golar tsc`), in watch mode.\n * - `tsz`: the project's `tsz` (or `try-tsz`). It has no watch mode, so it is re-run after every build instead.\n * - `auto`: `golar` when the project depends on it, `tsc` otherwise (default).\n */\nexport type StarsTypechecker = 'tsc' | 'golar' | 'tsz';\n\nexport interface StarsTypecheckConfig {\n\t/**\n\t * The `tsconfig.json` the type checker runs against, relative to {@link StarsConfig.root}.\n\t * @default the build tool's tsconfig, 'src/tsconfig.json' or 'tsconfig.json'\n\t */\n\ttsconfig?: string;\n\t/**\n\t * Which type checker to run.\n\t * @default 'auto'\n\t */\n\tchecker?: StarsTypechecker | 'auto';\n}\n\nexport interface StarsTunnelConfig {\n\t/**\n\t * An https URL you already serve; when unset a `cloudflared` quick tunnel is opened instead.\n\t */\n\turl?: string;\n\t/**\n\t * Writes the tunnel's URL to the Discord application's `interactions_endpoint_url` when it changes.\n\t *\n\t * This edits a live Discord application, so it is opt-in: it needs `DISCORD_TOKEN` and `DISCORD_APPLICATION_ID`\n\t * (or `APPLICATION_ID`) in the environment or the project's `.env`.\n\t * @default false\n\t */\n\tupdateEndpoint?: boolean;\n\t/**\n\t * The path the interactions endpoint is served on, appended to the tunnel URL.\n\t * @default '/'\n\t */\n\tpath?: string;\n}\n\nexport interface StarsDevConfig {\n\t/** Custom terminal wordmark (one or more lines), or `false` to hide it. Defaults to the Stars wordmark. */\n\tbanner?: string | readonly string[] | false;\n\t/**\n\t * Extra paths to watch, relative to {@link StarsConfig.root}. Only used when\n\t * the build tool is `none`; `tsdown` and `tsc` watch through their own build.\n\t * @default [dirname(entry)]\n\t */\n\twatch?: string[];\n\t/**\n\t * Glob patterns or paths to ignore while watching, relative to {@link StarsConfig.root}.\n\t * @default ['**\\/node_modules/**', '**\\/dist/**', '**\\/.git/**']\n\t */\n\tignore?: string[];\n\t/**\n\t * Milliseconds to wait after a change before restarting the bot.\n\t * @default 150\n\t */\n\tdebounce?: number;\n\t/**\n\t * Environment variables added to the bot process.\n\t */\n\tenv?: Record<string, string>;\n\t/**\n\t * Arguments passed to `node` before the entry file.\n\t * @default ['--enable-source-maps']\n\t */\n\tnodeArgs?: string[];\n\t/**\n\t * Arguments passed to the bot after the entry file.\n\t * @default []\n\t */\n\targs?: string[];\n\t/**\n\t * The URL the bot listens on, shown in the dev UI's status line and used for {@link StarsDevConfig.health}.\n\t *\n\t * Resolved automatically, the way Vite's and Nuxt's dev servers do, from (in order) `dev.env.HTTP_PORT`, the\n\t * process's `HTTP_PORT`, the project's `.env.local`/`.env` (`HTTP_PORT` or `PORT`), or `3000`. `stars dev` also\n\t * resolves whether `localhost` should be shown as `127.0.0.1` instead, the same DNS-order check Vite does, so the\n\t * printed URL is always the one that is actually reachable.\n\t * @default `http://localhost:3000` (or whichever port is found)\n\t */\n\turl?: string;\n\t/**\n\t * A path, relative to {@link StarsDevConfig.url}, polled to report the bot's health in the dev UI.\n\t * When unset the dev UI only reports process state.\n\t */\n\thealth?: string;\n\t/**\n\t * Milliseconds to wait for the bot to exit after `SIGTERM` before killing it.\n\t * @default 5000\n\t */\n\tkillTimeout?: number;\n\t/**\n\t * Runs a type checker next to the bot and reports type errors on the dev UI's `tsc` channel, without blocking\n\t * builds or restarts. `true` uses the project's own tsconfig and type checker, an object picks either\n\t * ({@link StarsTypecheckConfig.checker}).\n\t * @default false\n\t */\n\ttypecheck?: boolean | StarsTypecheckConfig;\n\t/**\n\t * Exposes the bot's HTTP interactions endpoint publicly while `stars dev` runs, so Discord can reach it.\n\t *\n\t * `true` opens a `cloudflared` quick tunnel (its hostname changes on every run), a string is an https URL you\n\t * already serve yourself (named tunnel, reverse proxy, …) that the CLI only checks for reachability.\n\t * @default false\n\t */\n\ttunnel?: boolean | string | StarsTunnelConfig;\n\t/**\n\t * The file `stars dev` mirrors its logs into, relative to {@link StarsConfig.root}, so a session can be read back\n\t * after the terminal UI is gone. `false` disables it.\n\t * @default '.stars/dev.log'\n\t */\n\tlogFile?: string | false;\n}\n\nexport interface StarsI18nCodegenConfig {\n\t/**\n\t * The base locale directory, relative to {@link StarsConfig.root}.\n\t * @default 'src/locales/en-US'\n\t */\n\tlocales?: string;\n\t/**\n\t * The generated declaration file, relative to {@link StarsConfig.root}.\n\t * @default 'src/@types/i18next.d.ts'\n\t */\n\toutput?: string;\n}\n\nexport interface StarsCodegenConfig {\n\t/**\n\t * i18next type generation through `@wolfstar/i18next-type-generator`.\n\t * `false` disables it, an object enables it, unset auto-detects from the presence of the locales directory.\n\t */\n\ti18n?: StarsI18nCodegenConfig | false;\n}\n\nexport interface StarsImportsConfig {\n\t/**\n\t * Whether auto imports are enabled. Requires the `tsdown` build tool: the imports are injected at build time by\n\t * the `autoImports()` plugin from `@wolfstar/http-framework/auto-imports`, which the other tools cannot run.\n\t * @default true when the build tool is 'tsdown', false otherwise\n\t */\n\tenabled?: boolean;\n\t/**\n\t * Directories, relative to {@link StarsConfig.root}, whose exported values are auto-importable. Entries are glob\n\t * path patterns: `'src/lib'` scans only the files directly inside it, `'src/lib/**'` scans recursively.\n\t * @default ['src/lib/**', 'src/utils/**']\n\t */\n\tdirs?: string[];\n\t/**\n\t * Packages whose exports are auto-importable. Packages that are not installed are skipped.\n\t * @default ['@wolfstar/http-framework', '@wolfstar/env-utilities']\n\t */\n\tpresets?: string[];\n\t/**\n\t * Export names excluded from auto imports, e.g. to avoid clashes with project-local names.\n\t * @default []\n\t */\n\texclude?: string[];\n\t/**\n\t * The generated declaration file that types the auto imports, relative to {@link StarsConfig.root}.\n\t * Include it in the project's tsconfig and add its directory to .gitignore.\n\t * @default '.stars/imports.d.ts'\n\t */\n\tdts?: string;\n}\n\n/**\n * The [Nitro preset](https://nitro.build/deploy) `stars build` targets, only reachable once\n * {@link StarsExperimentalConfig.enableNitro} (itself gated on {@link StarsExperimentalConfig.enableVite}) is `true`\n * — see {@link StarsExperimentalConfig}.\n */\nexport interface StarsNitroConfig {\n\t/**\n\t * `'node-server'` (the default, runs locally with plain `node`), `'cloudflare-module'`, `'aws-lambda'`,\n\t * `'vercel'`, `'netlify'`, `'bun'`, `'deno-deploy'`, and more — see Nitro's own preset list.\n\t * @default 'node-server'\n\t */\n\tpreset?: string;\n}\n\n/**\n * Opt-in flags for work that is still landing, in the shape Nuxt's own `experimental` block has: every flag is a\n * boolean, defaults to `false`, and is documented with what it changes and what it still needs. A flag stays here\n * until the behaviour it guards is the default (or is dropped), so enabling one is a statement that breakage is\n * acceptable in exchange for the feature.\n *\n * `enableExternalVite`, `enableNitro` and `nitro` build on `enableVite` (and `nitro` on `enableNitro` too): the type\n * only accepts them once their prerequisite is `true`, so turning one on without the other is a type error here\n * instead of a `ConfigError` at load time.\n */\nexport type StarsExperimentalConfig =\n\t| { enableVite?: false; enableExternalVite?: false; enableNitro?: false }\n\t| {\n\t\t\t/**\n\t\t\t * Uses Vite as the project's build tool, in place of `tsdown`. `build.tool` may then be set to `'vite'`\n\t\t\t * (and `'auto'` detects a `vite.config.*`); the bot keeps calling `client.listen()` and running as a\n\t\t\t * plain `node:http` process, restarted on every change — this only swaps the bundler.\n\t\t\t */\n\t\t\tenableVite: true;\n\t\t\t/**\n\t\t\t * Runs the bot through Vite itself, the way `nuxt dev` runs on Vite's own dev server: instead of\n\t\t\t * building then restarting a child `node` process on every change, `stars dev` loads the entry through\n\t\t\t * Vite's SSR module graph and serves it — through `@wolfstar/http-framework/fetch`'s\n\t\t\t * `createFetchHandler` — from one long-lived process, invalidating and re-evaluating just the entry's\n\t\t\t * module graph on a change instead of restarting.\n\t\t\t *\n\t\t\t * With this on, the entry's default export must be the `Client` instance (already `load()`ed, not\n\t\t\t * `listen()`ed) rather than a script that calls `client.listen()` itself — `stars dev` owns the socket.\n\t\t\t * @default false\n\t\t\t */\n\t\t\tenableExternalVite?: boolean;\n\t\t\tenableNitro?: false;\n\t }\n\t| {\n\t\t\tenableVite: true;\n\t\t\tenableExternalVite?: boolean;\n\t\t\t/**\n\t\t\t * Builds the bot through [Nitro](https://nitro.build) instead of a `node:http` server, so `stars build`\n\t\t\t * produces a server deployable to any of Nitro's presets (`node-server` locally, `cloudflare-module`,\n\t\t\t * `aws-lambda`, `vercel`, `netlify`, `bun`, `deno-deploy`, and more) from the same\n\t\t\t * `@wolfstar/http-framework/fetch` handler `enableExternalVite` already runs in dev — no per-platform\n\t\t\t * adapter to maintain.\n\t\t\t *\n\t\t\t * Output goes to `.output/` (Nitro's own convention) instead of `build.outDir`. The entry's default\n\t\t\t * export must be the `Client` instance, the same as `enableExternalVite`.\n\t\t\t */\n\t\t\tenableNitro: true;\n\t\t\t/** Nitro-specific options, reachable only with `enableNitro: true`. */\n\t\t\tnitro?: StarsNitroConfig;\n\t };\n\nexport interface StarsConfig {\n\t/**\n\t * The project root. Relative paths are resolved from the configuration file.\n\t * @default dirname(configFile)\n\t */\n\troot?: string;\n\t/**\n\t * The source entry point of the bot, relative to {@link StarsConfig.root}.\n\t * @default the first of 'src/main.ts', 'src/main.js', 'src/index.ts', 'src/index.js' that exists\n\t */\n\tentry?: string;\n\tbuild?: StarsBuildConfig;\n\tdev?: StarsDevConfig;\n\tcodegen?: StarsCodegenConfig;\n\t/**\n\t * Nuxt-style auto imports of the framework's exports and the project's own modules.\n\t * `false` disables them, `true` forces them on (requires the `tsdown` build tool). On by default with\n\t * `future.compatibilityVersion: 4`.\n\t */\n\timports?: StarsImportsConfig | boolean;\n\t/** Opt-in flags for behaviour that is still landing. */\n\texperimental?: StarsExperimentalConfig;\n\t/** The next major's defaults, available today. */\n\tfuture?: StarsFutureConfig;\n\t/**\n\t * Raw options merged into `vite.config.*`, the way `vite: {}` in a Nuxt config is merged into Nuxt's own Vite\n\t * config. Only used with `build.tool: 'vite'` (see `experimental.enableVite`).\n\t */\n\tvite?: StarsViteConfig;\n\t/**\n\t * The project's `tsdown` build. Replaces `tsdown.config.*` with `future.compatibilityVersion: 4`, and is merged\n\t * over it with `3`. Only used with `build.tool: 'tsdown'`.\n\t */\n\ttsdown?: StarsTsdownConfig;\n}\n\n/**\n * Typed helper for `stars.config.{ts,mts,cts,js,mjs,cjs}` files.\n *\n * @example\n * ```ts\n * import { defineConfig } from '@wolfstar/http-framework/config';\n *\n * export default defineConfig({\n * \tentry: 'src/main.ts',\n * \tbuild: { tool: 'tsdown' }\n * });\n * ```\n */\nexport function defineConfig(config: StarsConfig): StarsConfig {\n\treturn config;\n}\n\nexport * from './lib/config/index.js';\n"],"mappings":";;;;;;;;;;;;AAmBA,IAAa,cAAb,cAAiC,MAAM;CAMtC,AAAO,YA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AAK,MAAM,aAAa,MAAM,OAAO,CAAC;EAC9D,OAAO,WAAW,QAAQ,OAAO,WAAW,WAAY,SAA6B;CACtF,SAAS,OAAO;EACf,MAAM,IAAI,YAAY,mBAAmB,KAAK,IAAI,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,KAAK;GAC3G,MAAM;GACN,MAAM;GACN,OAAO;EACR,CAAC;CACF;AACD;AAEA,SAAS,OAAO,MAAuB;CACtC,IAAI;EACH,OAAO,WAAW,IAAI,KAAK,SAAS,IAAI,CAAC,CAAC,OAAO;CAClD,QAAQ;EACP,OAAO;CACR;AACD;AAEA,SAAS,YAAY,MAAuB;CAC3C,IAAI;EACH,OAAO,WAAW,IAAI,KAAK,SAAS,IAAI,CAAC,CAAC,YAAY;CACvD,QAAQ;EACP,OAAO;CACR;AACD;;;;;;;;;ACr4BA,eAAsB,gBAAgB,UAAkC,CAAC,GAAiC;CACzG,MAAM,MAAM,QAAQ,OAAO,QAAQ,IAAI;CACvC,MAAM,SAAS,MAAM,eAAe;EAAE;EAAK,YAAY,QAAQ;CAAW,CAAC;CAC3E,OAAO,mBAAmB;EAAE;EAAK,YAAY,OAAO;EAAY,QAAQ,OAAO;EAAQ,KAAK,QAAQ;CAAI,CAAC;AAC1G;;;;;;;;;;;;;;;;;AC+XA,SAAgB,aAAa,QAAkC;CAC9D,OAAO;AACR"}
1
+ {"version":3,"file":"config.js","names":["isFile"],"sources":["../../src/lib/config/errors.ts","../../src/lib/config/load.ts","../../src/lib/config/resolve.ts","../../src/lib/config/index.ts","../../src/config.ts"],"sourcesContent":["export interface ConfigErrorOptions {\n\t/** A stable, machine readable code, e.g. `INVALID_TYPE`. */\n\tcode: string;\n\t/** A short, actionable suggestion. */\n\thint?: string;\n\t/** The dotted path of the offending option, e.g. `dev.debounce`. */\n\tpath?: string;\n\t/** The configuration file the error originates from. */\n\tfile?: string | null;\n\tcause?: unknown;\n}\n\n/**\n * A `stars.config.*` error: an invalid option, or a file that failed to load or parse.\n *\n * This is a plain data error (no exit code or terminal formatting) so it stays meaningful outside a CLI, e.g. for a\n * dashboard or test that calls {@link loadStarsConfig} directly. `@wolfstar/cli` maps it to exit code `2` and renders\n * `message`, `path`, `file` and `hint` for the terminal.\n */\nexport class ConfigError extends Error {\n\tpublic readonly code: string;\n\tpublic readonly hint: string | null;\n\tpublic readonly path: string | null;\n\tpublic readonly file: string | null;\n\n\tpublic constructor(message: string, options: ConfigErrorOptions) {\n\t\tsuper(message, options.cause === undefined ? undefined : { cause: options.cause });\n\t\tthis.name = 'ConfigError';\n\t\tthis.code = options.code;\n\t\tthis.hint = options.hint ?? null;\n\t\tthis.path = options.path ?? null;\n\t\tthis.file = options.file ?? null;\n\t}\n}\n","import { existsSync, statSync } from 'node:fs';\nimport { basename, dirname, join, resolve } from 'node:path';\nimport type { StarsConfig } from '../../config.js';\nimport { ConfigError } from './errors.js';\n\nexport const CONFIG_EXTENSIONS = ['ts', 'mts', 'cts', 'js', 'mjs', 'cjs'] as const;\nexport const CONFIG_FILE_NAMES = CONFIG_EXTENSIONS.map((extension) => `stars.config.${extension}`);\n\nexport interface LoadConfigFileOptions {\n\t/** The directory to discover the configuration file from. */\n\tcwd: string;\n\t/** An explicit configuration file (`--config`), resolved from `cwd`. */\n\tconfigFile?: string | null;\n}\n\nexport interface LoadedConfigFile {\n\t/** The absolute path of the loaded file, `null` when running on defaults. */\n\tconfigFile: string | null;\n\tconfig: StarsConfig;\n}\n\n/**\n * Finds the first `stars.config.*` file in `cwd`, in {@link CONFIG_FILE_NAMES} order.\n */\nexport function discoverConfigFile(cwd: string): string | null {\n\tfor (const name of CONFIG_FILE_NAMES) {\n\t\tconst candidate = join(cwd, name);\n\t\tif (isFile(candidate)) return candidate;\n\t}\n\n\treturn null;\n}\n\n/**\n * Loads the raw configuration object. The loader (`c12`) is imported lazily so\n * commands that never touch the configuration stay fast.\n */\nexport async function loadConfigFile(options: LoadConfigFileOptions): Promise<LoadedConfigFile> {\n\tconst cwd = resolve(options.cwd);\n\tlet file: string | null;\n\n\tif (options.configFile) {\n\t\tfile = resolve(cwd, options.configFile);\n\t\tif (!isFile(file)) {\n\t\t\tthrow new ConfigError(`Configuration file not found: ${file}`, {\n\t\t\t\tcode: 'CONFIG_NOT_FOUND',\n\t\t\t\thint: `Pass an existing file to --config, or create one of ${CONFIG_FILE_NAMES.join(', ')} in ${cwd}.`\n\t\t\t});\n\t\t}\n\t} else {\n\t\tfile = discoverConfigFile(cwd);\n\t\tif (!file) return { configFile: null, config: {} };\n\t}\n\n\tconst { loadConfig } = await import('c12');\n\n\tlet loaded: unknown;\n\ttry {\n\t\tconst result = await loadConfig<StarsConfig>({\n\t\t\tname: 'stars',\n\t\t\tcwd: dirname(file),\n\t\t\tconfigFile: basename(file),\n\t\t\trcFile: false,\n\t\t\tglobalRc: false,\n\t\t\tdotenv: false,\n\t\t\tpackageJson: false,\n\t\t\tdefaults: {}\n\t\t});\n\t\t// c12 merges every layer with the defaults, which turns non-object exports into `{}`: inspect the raw layer.\n\t\tconst layer = result.layers?.find(\n\t\t\t(candidate) => candidate.configFile && resolve(candidate.cwd ?? dirname(file), candidate.configFile) === file\n\t\t);\n\t\tloaded = layer ? layer.config : result.config;\n\t} catch (error) {\n\t\tconst message = error instanceof Error ? error.message : String(error);\n\t\tthrow new ConfigError(`Failed to load the configuration: ${message}`, {\n\t\t\tcode: 'CONFIG_LOAD_FAILED',\n\t\t\tfile,\n\t\t\thint: 'The file must be valid TypeScript/JavaScript and export the configuration as its default export.',\n\t\t\tcause: error\n\t\t});\n\t}\n\n\tif (loaded === null || typeof loaded !== 'object' || Array.isArray(loaded)) {\n\t\tthrow new ConfigError('The configuration file must export an object as its default export.', {\n\t\t\tcode: 'CONFIG_NOT_OBJECT',\n\t\t\tfile,\n\t\t\thint: \"Use `export default defineConfig({ ... })` from '@wolfstar/http-framework/config'.\"\n\t\t});\n\t}\n\n\treturn { configFile: file, config: loaded as StarsConfig };\n}\n\nfunction isFile(path: string): boolean {\n\ttry {\n\t\treturn existsSync(path) && statSync(path).isFile();\n\t} catch {\n\t\treturn false;\n\t}\n}\n","import { existsSync, readFileSync, statSync } from 'node:fs';\nimport { basename, dirname, extname, isAbsolute, join, relative, resolve } from 'node:path';\nimport type {\n\tStarsBuildTool,\n\tStarsCompatibilityVersion,\n\tStarsConfig,\n\tStarsDevConfig,\n\tStarsExperimentalConfig,\n\tStarsFutureConfig,\n\tStarsTypechecker\n} from '../../config.js';\nimport { ConfigError } from './errors.js';\n\nexport interface PackageJsonLike {\n\tname?: string;\n\t/** `tsdown` reads its options from here as well as from a `tsdown.config.*`. */\n\ttsdown?: unknown;\n\tversion?: string;\n\tmain?: string;\n\ttype?: string;\n\tscripts?: Record<string, string>;\n\tdependencies?: Record<string, string>;\n\tdevDependencies?: Record<string, string>;\n}\n\nexport interface ResolvedBuildConfig {\n\treadonly tool: StarsBuildTool;\n\t/** Absolute output directory. */\n\treadonly outDir: string;\n\t/** Absolute `tsconfig.json` used by `tsc`, `null` for the other tools. */\n\treadonly tsconfig: string | null;\n\t/** Absolute path of the file `node` runs, i.e. the built entry (or the entry itself when `tool` is `none`). */\n\treadonly output: string;\n\t/**\n\t * Absolute path of the build tool's own configuration file (`tsdown.config.*`, `vite.config.*`), `null` when the\n\t * tool has none — which is always the case for `tsdown` with `future.compatibilityVersion` 4, where the build is\n\t * configured from `stars.config` alone.\n\t */\n\treadonly configFile: string | null;\n}\n\nexport interface ResolvedTypecheckConfig {\n\treadonly enabled: boolean;\n\t/** Absolute `tsconfig.json` the type checker runs against, `null` when it could not be found. */\n\treadonly tsconfig: string | null;\n\t/** The type checker to run, with `'auto'` already resolved. */\n\treadonly checker: StarsTypechecker;\n}\n\nexport type ResolvedTunnelConfig =\n\t| { readonly mode: 'off' }\n\t/** A `cloudflared` quick tunnel, whose hostname is only known once it is up. */\n\t| { readonly mode: 'quick'; readonly path: string; readonly updateEndpoint: boolean }\n\t/** An https URL the user already serves. */\n\t| { readonly mode: 'url'; readonly url: string; readonly path: string; readonly updateEndpoint: boolean };\n\nexport interface ResolvedDevConfig {\n\treadonly banner: readonly string[] | false | null;\n\treadonly watch: readonly string[];\n\treadonly ignore: readonly string[];\n\treadonly debounce: number;\n\treadonly env: Readonly<Record<string, string>>;\n\treadonly nodeArgs: readonly string[];\n\treadonly args: readonly string[];\n\treadonly url: string | null;\n\treadonly health: string | null;\n\treadonly killTimeout: number;\n\treadonly typecheck: ResolvedTypecheckConfig;\n\treadonly tunnel: ResolvedTunnelConfig;\n\t/** Absolute path of the file the dev session's logs are mirrored into, `null` when disabled. */\n\treadonly logFile: string | null;\n}\n\nexport interface ResolvedNitroConfig {\n\treadonly preset: string;\n}\n\nexport interface ResolvedExperimentalConfig {\n\treadonly enableVite: boolean;\n\treadonly enableExternalVite: boolean;\n\treadonly enableNitro: boolean;\n\treadonly nitro: ResolvedNitroConfig;\n}\n\nexport interface ResolvedFutureConfig {\n\treadonly compatibilityVersion: StarsCompatibilityVersion;\n}\n\nexport interface ResolvedImportsConfig {\n\treadonly enabled: boolean;\n\t/** Directory glob patterns, relative to the project root (the way `unimport` scans them). */\n\treadonly dirs: readonly string[];\n\treadonly presets: readonly string[];\n\treadonly exclude: readonly string[];\n\t/** Absolute path of the generated declaration file. */\n\treadonly dts: string;\n}\n\nexport interface ResolvedI18nCodegenConfig {\n\treadonly locales: string;\n\treadonly output: string;\n}\n\nexport interface ResolvedCodegenConfig {\n\treadonly i18n: ResolvedI18nCodegenConfig | null;\n}\n\nexport interface ResolvedStarsConfig {\n\t/** Absolute path of the configuration file, `null` when running on defaults. */\n\treadonly configFile: string | null;\n\t/** The directory the CLI was invoked from. */\n\treadonly cwd: string;\n\t/** Absolute project root. */\n\treadonly root: string;\n\treadonly packageJson: PackageJsonLike | null;\n\t/** Absolute source entry. */\n\treadonly entry: string;\n\treadonly build: ResolvedBuildConfig;\n\treadonly dev: ResolvedDevConfig;\n\treadonly codegen: ResolvedCodegenConfig;\n\treadonly imports: ResolvedImportsConfig;\n\treadonly experimental: ResolvedExperimentalConfig;\n\treadonly future: ResolvedFutureConfig;\n\t/** Raw options merged into `vite.config.*`. */\n\treadonly vite: Readonly<Record<string, unknown>>;\n\t/** The `tsdown` build's options: merged over `tsdown.config.*` at compatibility version 3, the whole build at 4. */\n\treadonly tsdown: Readonly<Record<string, unknown>>;\n}\n\nexport interface ResolveConfigOptions {\n\tcwd: string;\n\tconfigFile: string | null;\n\tconfig: StarsConfig;\n\tenv?: NodeJS.ProcessEnv;\n}\n\nexport const DEFAULT_ENTRIES = ['src/main.ts', 'src/main.js', 'src/index.ts', 'src/index.js'] as const;\nexport const DEFAULT_IGNORE = ['**/node_modules/**', '**/dist/**', '**/.git/**'] as const;\nexport const DEFAULT_DEBOUNCE = 150;\nexport const DEFAULT_KILL_TIMEOUT = 5000;\nexport const DEFAULT_NODE_ARGS = ['--enable-source-maps'] as const;\nexport const DEFAULT_DEV_PORT = 3000;\nexport const DEFAULT_I18N_LOCALES = 'src/locales/en-US';\nexport const DEFAULT_I18N_OUTPUT = 'src/@types/i18next.d.ts';\nexport const DEFAULT_IMPORTS_DIRS = ['src/lib/**', 'src/utils/**'] as const;\nexport const DEFAULT_IMPORTS_PRESETS = ['@wolfstar/http-framework', '@wolfstar/env-utilities'] as const;\nexport const DEFAULT_IMPORTS_DTS = '.stars/imports.d.ts';\nexport const DEFAULT_DEV_LOG_FILE = '.stars/dev.log';\nexport const DEFAULT_TUNNEL_PATH = '/';\n\nexport const DEFAULT_COMPATIBILITY_VERSION = 4;\nexport const LEGACY_COMPATIBILITY_VERSION = 3;\nexport const LATEST_COMPATIBILITY_VERSION = 4;\n\nconst COMPATIBILITY_VERSIONS = new Set<number>([LEGACY_COMPATIBILITY_VERSION, LATEST_COMPATIBILITY_VERSION]);\nconst BUILD_TOOLS = new Set<string>(['tsdown', 'tsc', 'none', 'vite', 'auto']);\nconst TYPECHECKERS = new Set<string>(['tsc', 'golar', 'tsz', 'auto']);\nconst VITE_CONFIG_FILES = ['vite.config.ts', 'vite.config.mts', 'vite.config.cts', 'vite.config.js', 'vite.config.mjs', 'vite.config.cjs'];\nconst TSDOWN_CONFIG_FILES = [\n\t'tsdown.config.ts',\n\t'tsdown.config.mts',\n\t'tsdown.config.cts',\n\t'tsdown.config.js',\n\t'tsdown.config.mjs',\n\t'tsdown.config.cjs',\n\t'tsdown.config.json'\n];\nconst TYPESCRIPT_EXTENSIONS = new Set(['.ts', '.mts', '.cts']);\n\n/**\n * Applies defaults, validates every option and resolves all paths to absolute ones.\n *\n * @throws {ConfigError} with an actionable `hint` on the first invalid option.\n */\nexport function resolveStarsConfig(options: ResolveConfigOptions): ResolvedStarsConfig {\n\tconst cwd = resolve(options.cwd);\n\tconst env = options.env ?? process.env;\n\tconst file = options.configFile;\n\tconst config = options.config;\n\tconst validator = new Validator(file);\n\n\tvalidator.knownKeys(config, '', ['root', 'entry', 'build', 'dev', 'codegen', 'imports', 'experimental', 'future', 'vite', 'tsdown']);\n\tconst baseDirectory = file ? dirname(file) : cwd;\n\n\tconst root = resolve(baseDirectory, validator.string(config.root, 'root') ?? '.');\n\tif (!isDirectory(root)) {\n\t\tthrow validator.error(\n\t\t\t`The project root does not exist: ${root}`,\n\t\t\t'root',\n\t\t\t'ROOT_NOT_FOUND',\n\t\t\t'Point `root` to an existing directory, relative to the configuration file.'\n\t\t);\n\t}\n\n\tconst packageJson = readPackageJson(root);\n\tconst experimental = resolveExperimental(config.experimental ?? {}, validator);\n\tconst future = resolveFuture(config.future ?? {}, validator);\n\tconst entry = resolveEntry(root, validator.string(config.entry, 'entry'), validator);\n\t// The tool-specific blocks are read before the build so a project that only declares `tsdown: {}` still resolves\n\t// `build.tool: 'auto'` to `tsdown`: configuring a tool is as clear a signal as depending on it.\n\tconst vite = validator.plainObject(config.vite, 'vite') ?? {};\n\tconst tsdown = validator.plainObject(config.tsdown, 'tsdown') ?? {};\n\tconst build = resolveBuild(root, entry, packageJson, config.build ?? {}, experimental, future, Object.keys(tsdown).length > 0, validator);\n\tconst dev = resolveDev(root, entry, packageJson, config.dev ?? {}, env, validator);\n\tconst codegen = resolveCodegen(root, config.codegen ?? {}, validator);\n\tconst imports = resolveImports(root, build.tool, future, config.imports, validator);\n\n\tif (Object.keys(tsdown).length > 0 && build.tool !== 'tsdown') {\n\t\tthrow validator.error(\n\t\t\t'`tsdown` options need the `tsdown` build tool',\n\t\t\t'tsdown',\n\t\t\t'TSDOWN_OPTIONS_REQUIRE_TSDOWN',\n\t\t\t`Set \\`build.tool\\` to 'tsdown', or remove \\`tsdown\\` (the build tool is '${build.tool}').`\n\t\t);\n\t}\n\n\tif (Object.keys(vite).length > 0 && build.tool !== 'vite') {\n\t\tthrow validator.error(\n\t\t\t'`vite` options need the `vite` build tool',\n\t\t\t'vite',\n\t\t\t'VITE_OPTIONS_REQUIRE_VITE',\n\t\t\t`Set \\`build.tool\\` to 'vite' with \\`experimental.enableVite\\`, or remove \\`vite\\` (the build tool is '${build.tool}').`\n\t\t);\n\t}\n\n\treturn { configFile: file, cwd, root, packageJson, entry, build, dev, codegen, imports, experimental, future, vite, tsdown };\n}\n\n/**\n * Presents an absolute path relative to `root` when possible, for display purposes.\n */\nexport function displayPath(root: string, path: string): string {\n\tconst rel = relative(root, path);\n\tif (!rel) return '.';\n\treturn rel.startsWith('..') || isAbsolute(rel) ? path : rel;\n}\n\nfunction resolveEntry(root: string, configured: string | undefined, validator: Validator): string {\n\tif (configured !== undefined) {\n\t\tconst entry = resolve(root, configured);\n\t\tif (!isFile(entry)) {\n\t\t\tthrow validator.error(\n\t\t\t\t`The entry file does not exist: ${entry}`,\n\t\t\t\t'entry',\n\t\t\t\t'ENTRY_NOT_FOUND',\n\t\t\t\t'Point `entry` to the file that starts the bot, relative to the project root.'\n\t\t\t);\n\t\t}\n\t\treturn entry;\n\t}\n\n\tfor (const candidate of DEFAULT_ENTRIES) {\n\t\tconst entry = join(root, candidate);\n\t\tif (isFile(entry)) return entry;\n\t}\n\n\tthrow validator.error(\n\t\t`Could not find the entry file in ${root}`,\n\t\t'entry',\n\t\t'ENTRY_NOT_FOUND',\n\t\t`Set \\`entry\\` in the configuration, or create one of ${DEFAULT_ENTRIES.join(', ')}.`\n\t);\n}\n\nfunction resolveBuild(\n\troot: string,\n\tentry: string,\n\tpackageJson: PackageJsonLike | null,\n\tconfig: NonNullable<StarsConfig['build']>,\n\texperimental: ResolvedExperimentalConfig,\n\tfuture: ResolvedFutureConfig,\n\thasTsdownOptions: boolean,\n\tvalidator: Validator\n): ResolvedBuildConfig {\n\tvalidator.knownKeys(config, 'build', ['tool', 'outDir', 'tsconfig']);\n\n\tconst requested = validator.string(config.tool, 'build.tool') ?? 'auto';\n\tif (!BUILD_TOOLS.has(requested)) {\n\t\tthrow validator.error(\n\t\t\t`Unknown build tool \"${requested}\"`,\n\t\t\t'build.tool',\n\t\t\t'INVALID_BUILD_TOOL',\n\t\t\t\"Use one of 'tsdown', 'tsc', 'vite', 'none' or 'auto'.\"\n\t\t);\n\t}\n\n\tif (requested === 'vite' && !experimental.enableVite) {\n\t\tthrow validator.error(\n\t\t\t\"The 'vite' build tool is experimental\",\n\t\t\t'build.tool',\n\t\t\t'EXPERIMENT_REQUIRED',\n\t\t\t'Set `experimental.enableVite` to true to use it.'\n\t\t);\n\t}\n\n\tconst isTypeScriptEntry = TYPESCRIPT_EXTENSIONS.has(extname(entry));\n\tconst tool: StarsBuildTool =\n\t\trequested === 'auto'\n\t\t\t? detectBuildTool(root, packageJson, isTypeScriptEntry, experimental, future, hasTsdownOptions)\n\t\t\t: (requested as StarsBuildTool);\n\n\tif (tool === 'none' && isTypeScriptEntry) {\n\t\tthrow validator.error(\n\t\t\t`The entry ${displayPath(root, entry)} is TypeScript but the build tool is 'none'`,\n\t\t\t'build.tool',\n\t\t\t'BUILD_TOOL_REQUIRED',\n\t\t\t\"Set `build.tool` to 'tsdown' or 'tsc', or point `entry` to a JavaScript file.\"\n\t\t);\n\t}\n\n\t// Nitro owns its own output layout; anything else keeps the plain `dist` convention.\n\tconst defaultOutDir = experimental.enableNitro ? '.output' : 'dist';\n\tconst outDir = resolve(root, validator.string(config.outDir, 'build.outDir') ?? defaultOutDir);\n\n\tlet tsconfig: string | null = null;\n\tconst configuredTsconfig = validator.string(config.tsconfig, 'build.tsconfig');\n\tif (configuredTsconfig !== undefined) {\n\t\ttsconfig = resolve(root, configuredTsconfig);\n\t\tif (!isFile(tsconfig)) {\n\t\t\tthrow validator.error(\n\t\t\t\t`The tsconfig file does not exist: ${tsconfig}`,\n\t\t\t\t'build.tsconfig',\n\t\t\t\t'TSCONFIG_NOT_FOUND',\n\t\t\t\t'Point `build.tsconfig` to an existing tsconfig.json, relative to the project root.'\n\t\t\t);\n\t\t}\n\t} else if (tool === 'tsc' || tool === 'tsdown') {\n\t\t// `tsdown` only looks for a `tsconfig.json` next to the project root, so a bot keeping its sources' one in\n\t\t// `src/` (the layout both the scaffold and the examples use) would silently build without its paths and\n\t\t// target. Resolving it here is what makes the `tsdown` build need no configuration of its own.\n\t\ttsconfig = [join(root, 'src', 'tsconfig.json'), join(root, 'tsconfig.json')].find((candidate) => isFile(candidate)) ?? null;\n\t\tif (!tsconfig && tool === 'tsc') {\n\t\t\tthrow validator.error(\n\t\t\t\t`Could not find a tsconfig.json in ${root}`,\n\t\t\t\t'build.tsconfig',\n\t\t\t\t'TSCONFIG_NOT_FOUND',\n\t\t\t\t'Create src/tsconfig.json or tsconfig.json, or set `build.tsconfig`.'\n\t\t\t);\n\t\t}\n\t}\n\n\t// Nitro always writes its server entry to `<outDir>/server/index.mjs`, regardless of the project's own entry\n\t// file name or `package.json#main` — it is Nitro's output, not a build of the project's own entry file.\n\tconst output = experimental.enableNitro\n\t\t? join(outDir, 'server', 'index.mjs')\n\t\t: tool === 'none'\n\t\t\t? entry\n\t\t\t: resolveBuildOutput(root, entry, outDir, packageJson);\n\n\tlet configFile = findConfigFile(root, tool === 'tsdown' ? TSDOWN_CONFIG_FILES : tool === 'vite' ? VITE_CONFIG_FILES : []);\n\t// `tsdown` reads `package.json#tsdown` when no configuration file is around, so it counts as one here.\n\tif (tool === 'tsdown' && configFile === null && packageJson?.tsdown !== undefined) configFile = join(root, 'package.json');\n\n\t// Compatibility version 4 builds `tsdown` from this file alone. A `tsdown.config.*` left behind would keep the\n\t// plugins and entry points it declares out of the build, so it is reported rather than quietly ignored.\n\tif (tool === 'tsdown' && configFile !== null && future.compatibilityVersion >= LATEST_COMPATIBILITY_VERSION) {\n\t\tthrow validator.error(\n\t\t\t`\\`${displayPath(root, configFile)}\\` is not used with compatibility version ${future.compatibilityVersion}`,\n\t\t\t'tsdown',\n\t\t\t'TSDOWN_CONFIG_FILE_UNSUPPORTED',\n\t\t\t`Move its options into \\`tsdown\\` here, drop the ${displayPath(root, configFile)} configuration, or set \\`future.compatibilityVersion\\` to ${LEGACY_COMPATIBILITY_VERSION}.`\n\t\t);\n\t}\n\n\treturn { tool, outDir, tsconfig, output, configFile };\n}\n\nfunction findConfigFile(root: string, names: readonly string[]): string | null {\n\tfor (const name of names) {\n\t\tconst candidate = join(root, name);\n\t\tif (isFile(candidate)) return candidate;\n\t}\n\n\treturn null;\n}\n\nfunction detectBuildTool(\n\troot: string,\n\tpackageJson: PackageJsonLike | null,\n\tisTypeScriptEntry: boolean,\n\texperimental: ResolvedExperimentalConfig,\n\tfuture: ResolvedFutureConfig,\n\thasTsdownOptions: boolean\n): StarsBuildTool {\n\t// Vite only wins the detection once the project opted into it; without the flag a `vite.config.*` is somebody\n\t// else's (a dashboard, a docs site) and must not take the bot's build over.\n\tif (experimental.enableVite) {\n\t\tconst hasVite = VITE_CONFIG_FILES.some((name) => isFile(join(root, name))) || hasDependency(packageJson, 'vite');\n\t\tif (hasVite) return 'vite';\n\t}\n\n\tif (hasTsdownOptions) return 'tsdown';\n\n\t// From compatibility version 4 on, `tsdown` is the build of a TypeScript project rather than one of the options:\n\t// there is no `tsdown.config.*` left to detect it from, and a missing dependency is reported by the builder with\n\t// an install hint instead of silently falling back to `tsc`.\n\tif (future.compatibilityVersion >= LATEST_COMPATIBILITY_VERSION) return isTypeScriptEntry ? 'tsdown' : 'none';\n\n\tconst hasTsdown = TSDOWN_CONFIG_FILES.some((name) => isFile(join(root, name))) || hasDependency(packageJson, 'tsdown');\n\tif (hasTsdown) return 'tsdown';\n\tif (isTypeScriptEntry) return 'tsc';\n\treturn 'none';\n}\n\n/**\n * Resolves the Nuxt-style compatibility block. Version 4 is the default; version 3 remains an explicit legacy mode.\n */\nfunction resolveFuture(config: StarsFutureConfig, validator: Validator): ResolvedFutureConfig {\n\tif (config === null || typeof config !== 'object' || Array.isArray(config)) {\n\t\tthrow validator.error('`future` must be an object', 'future', 'INVALID_TYPE', 'Use `{ compatibilityVersion }`.');\n\t}\n\n\tvalidator.knownKeys(config, 'future', ['compatibilityVersion']);\n\tconst version = config.compatibilityVersion;\n\tif (version === undefined) return { compatibilityVersion: DEFAULT_COMPATIBILITY_VERSION };\n\n\tif (typeof version !== 'number' || !COMPATIBILITY_VERSIONS.has(version)) {\n\t\tthrow validator.error(\n\t\t\t`Unknown compatibility version ${describe(version)}`,\n\t\t\t'future.compatibilityVersion',\n\t\t\t'INVALID_COMPATIBILITY_VERSION',\n\t\t\t`Use ${LEGACY_COMPATIBILITY_VERSION} for the legacy build pipeline or ${LATEST_COMPATIBILITY_VERSION} for today's defaults.`\n\t\t);\n\t}\n\n\treturn { compatibilityVersion: version as StarsCompatibilityVersion };\n}\n\n/**\n * Resolves the `experimental` block. Every flag is a boolean defaulting to `false`, the way Nuxt's own experimental\n * flags are declared, and the ones that build on each other are checked here rather than surfacing later as a\n * confusing runtime failure.\n */\nfunction resolveExperimental(config: StarsExperimentalConfig, validator: Validator): ResolvedExperimentalConfig {\n\tif (config === null || typeof config !== 'object' || Array.isArray(config)) {\n\t\tthrow validator.error(\n\t\t\t'`experimental` must be an object',\n\t\t\t'experimental',\n\t\t\t'INVALID_TYPE',\n\t\t\t'Use `{ enableVite, enableExternalVite, enableNitro, nitro }`.'\n\t\t);\n\t}\n\n\tvalidator.knownKeys(config, 'experimental', ['enableVite', 'enableExternalVite', 'enableNitro', 'nitro']);\n\tconst enableVite = validator.boolean(config.enableVite, 'experimental.enableVite') ?? false;\n\tconst enableExternalVite = validator.boolean(config.enableExternalVite, 'experimental.enableExternalVite') ?? false;\n\tconst enableNitro = validator.boolean(config.enableNitro, 'experimental.enableNitro') ?? false;\n\n\tif (enableExternalVite && !enableVite) {\n\t\tthrow validator.error(\n\t\t\t'`experimental.enableExternalVite` needs `experimental.enableVite`',\n\t\t\t'experimental.enableExternalVite',\n\t\t\t'EXPERIMENT_REQUIRED',\n\t\t\t'Set `experimental.enableVite` to true as well, or drop `enableExternalVite`.'\n\t\t);\n\t}\n\n\tif (enableNitro && !enableVite) {\n\t\tthrow validator.error(\n\t\t\t'`experimental.enableNitro` needs `experimental.enableVite`',\n\t\t\t'experimental.enableNitro',\n\t\t\t'EXPERIMENT_REQUIRED',\n\t\t\t'Set `experimental.enableVite` to true as well, or drop `enableNitro`.'\n\t\t);\n\t}\n\n\tconst rawNitro = 'nitro' in config ? config.nitro : undefined;\n\tif (rawNitro !== undefined && !enableNitro) {\n\t\tthrow validator.error(\n\t\t\t'`experimental.nitro` needs `experimental.enableNitro`',\n\t\t\t'experimental.nitro',\n\t\t\t'EXPERIMENT_REQUIRED',\n\t\t\t'Set `experimental.enableNitro` to true as well, or drop `nitro`.'\n\t\t);\n\t}\n\tif (rawNitro !== undefined && (rawNitro === null || typeof rawNitro !== 'object' || Array.isArray(rawNitro))) {\n\t\tthrow validator.error('`experimental.nitro` must be an object', 'experimental.nitro', 'INVALID_TYPE', 'Use `{ preset }`.');\n\t}\n\tif (rawNitro) validator.knownKeys(rawNitro, 'experimental.nitro', ['preset']);\n\tconst preset = validator.string(rawNitro?.preset, 'experimental.nitro.preset') ?? 'node-server';\n\n\treturn { enableVite, enableExternalVite, enableNitro, nitro: { preset } };\n}\n\nfunction resolveBuildOutput(root: string, entry: string, outDir: string, packageJson: PackageJsonLike | null): string {\n\tif (packageJson?.main) return resolve(root, packageJson.main);\n\n\tconst extension = extname(entry);\n\tconst outputExtension = extension === '.mts' ? '.mjs' : extension === '.cts' ? '.cjs' : '.js';\n\treturn join(outDir, `${basename(entry, extension)}${outputExtension}`);\n}\n\nconst ENV_PORT_KEYS = ['HTTP_PORT', 'PORT'] as const;\n\n/**\n * Reads the project's environment layers from `src/.env*` and `.env*` into a plain object, the way `stars dev` and\n * `stars commands` need it:\n * these files are only loaded into `process.env` by the bot itself once it starts (see `@wolfstar/env-utilities`),\n * so by the time the CLI runs they are not there yet. This is a minimal line reader, not a full dotenv\n * implementation — quoting is stripped, but expansion (`dotenv-expand`) is not. Earlier files win, matching\n * dotenv's own precedence.\n */\nexport function readProjectEnvFiles(root: string, environment = 'development'): Record<string, string> {\n\tconst result: Record<string, string> = {};\n\tconst suffixes = [`.${environment}.local`, ...(environment === 'test' ? [] : ['.local']), `.${environment}`, ''];\n\tconst files = suffixes.flatMap((suffix) => [join('src', `.env${suffix}`), `.env${suffix}`]);\n\n\tfor (const file of files) {\n\t\tconst path = join(root, file);\n\t\tif (!isFile(path)) continue;\n\n\t\tlet contents: string;\n\t\ttry {\n\t\t\tcontents = readFileSync(path, 'utf-8');\n\t\t} catch {\n\t\t\tcontinue;\n\t\t}\n\n\t\tfor (const line of contents.split(/\\r?\\n/)) {\n\t\t\tconst match = /^\\s*(?:export\\s+)?([A-Za-z_][A-Za-z0-9_]*)\\s*=\\s*(.*)$/.exec(line);\n\t\t\tif (!match) continue;\n\n\t\t\tconst key = match[1]!;\n\t\t\tif (key in result) continue;\n\t\t\tresult[key] = match[2]!.trim().replace(/^['\"]|['\"]$/g, '');\n\t\t}\n\t}\n\n\treturn result;\n}\n\nfunction readDevPortFromEnvFile(root: string, environment: string): string | null {\n\tconst values = readProjectEnvFiles(root, environment);\n\tfor (const key of ENV_PORT_KEYS) {\n\t\tif (values[key]) return values[key];\n\t}\n\n\treturn null;\n}\n\nfunction resolveDev(\n\troot: string,\n\tentry: string,\n\tpackageJson: PackageJsonLike | null,\n\tconfig: NonNullable<StarsConfig['dev']>,\n\tenv: NodeJS.ProcessEnv,\n\tvalidator: Validator\n): ResolvedDevConfig {\n\tvalidator.knownKeys(config, 'dev', [\n\t\t'banner',\n\t\t'watch',\n\t\t'ignore',\n\t\t'debounce',\n\t\t'env',\n\t\t'nodeArgs',\n\t\t'args',\n\t\t'url',\n\t\t'health',\n\t\t'killTimeout',\n\t\t'typecheck',\n\t\t'tunnel',\n\t\t'logFile'\n\t]);\n\n\tconst watch = (validator.stringArray(config.watch, 'dev.watch') ?? [displayPath(root, dirname(entry))]).map((path) => resolve(root, path));\n\tconst ignore = validator.stringArray(config.ignore, 'dev.ignore') ?? [...DEFAULT_IGNORE];\n\tconst debounce = validator.nonNegativeNumber(config.debounce, 'dev.debounce') ?? DEFAULT_DEBOUNCE;\n\tconst devEnv = validator.stringRecord(config.env, 'dev.env') ?? {};\n\tconst nodeArgs = validator.stringArray(config.nodeArgs, 'dev.nodeArgs') ?? [...DEFAULT_NODE_ARGS];\n\tconst args = validator.stringArray(config.args, 'dev.args') ?? [];\n\tconst killTimeout = validator.nonNegativeNumber(config.killTimeout, 'dev.killTimeout') ?? DEFAULT_KILL_TIMEOUT;\n\tconst health = validator.string(config.health, 'dev.health') ?? null;\n\n\tlet url = validator.string(config.url, 'dev.url') ?? null;\n\tif (url !== null) {\n\t\ttry {\n\t\t\tnew URL(url);\n\t\t} catch {\n\t\t\tthrow validator.error(`Invalid URL \"${url}\"`, 'dev.url', 'INVALID_URL', 'Use an absolute URL such as http://localhost:3000.');\n\t\t}\n\t} else {\n\t\t// Mirrors Vite's and Nuxt's own dev servers: a URL is shown without any configuration. The exact host\n\t\t// (`localhost` vs `127.0.0.1`) is resolved at runtime by `stars dev`, once it knows which one is actually reachable.\n\t\tconst port = devEnv.HTTP_PORT ?? env.HTTP_PORT ?? readDevPortFromEnvFile(root, env.NODE_ENV ?? 'development') ?? String(DEFAULT_DEV_PORT);\n\t\turl = /^\\d+$/.test(port) ? `http://localhost:${port}` : `http://localhost:${DEFAULT_DEV_PORT}`;\n\t}\n\n\tconst typecheck = resolveTypecheck(root, packageJson, config.typecheck, validator);\n\tconst tunnel = resolveTunnel(config.tunnel, validator);\n\tconst logFile = config.logFile === false ? null : resolve(root, validator.string(config.logFile, 'dev.logFile') ?? DEFAULT_DEV_LOG_FILE);\n\tconst banner =\n\t\tconfig.banner === false\n\t\t\t? false\n\t\t\t: typeof config.banner === 'string'\n\t\t\t\t? config.banner.split('\\n')\n\t\t\t\t: (validator.stringArray(config.banner, 'dev.banner') ?? null);\n\n\treturn { watch, ignore, debounce, env: devEnv, nodeArgs, args, url, health, killTimeout, typecheck, tunnel, logFile, banner };\n}\n\n/**\n * Resolves `dev.typecheck`. The tsconfig is looked up the same way the `tsc` build tool looks up its own, so a\n * project building with `tsdown` still gets `tsc --watch --noEmit` on the right project file.\n */\nfunction resolveTypecheck(\n\troot: string,\n\tpackageJson: PackageJsonLike | null,\n\tconfig: StarsDevConfig['typecheck'],\n\tvalidator: Validator\n): ResolvedTypecheckConfig {\n\tif (config === undefined || config === false) return { enabled: false, tsconfig: null, checker: detectTypechecker(packageJson) };\n\n\tlet configured: string | undefined;\n\tlet requestedChecker = 'auto';\n\tif (config !== true) {\n\t\tif (config === null || typeof config !== 'object' || Array.isArray(config)) {\n\t\t\tthrow validator.error(\n\t\t\t\t'`dev.typecheck` must be a boolean or an object',\n\t\t\t\t'dev.typecheck',\n\t\t\t\t'INVALID_TYPE',\n\t\t\t\t'Use `true` to type-check with the project tsconfig, `{ tsconfig }` to pick one, or `false` to disable it.'\n\t\t\t);\n\t\t}\n\n\t\tvalidator.knownKeys(config, 'dev.typecheck', ['tsconfig', 'checker']);\n\t\tconfigured = validator.string(config.tsconfig, 'dev.typecheck.tsconfig');\n\t\trequestedChecker = validator.string(config.checker, 'dev.typecheck.checker') ?? 'auto';\n\t\tif (!TYPECHECKERS.has(requestedChecker)) {\n\t\t\tthrow validator.error(\n\t\t\t\t`Unknown type checker \"${requestedChecker}\"`,\n\t\t\t\t'dev.typecheck.checker',\n\t\t\t\t'INVALID_TYPECHECKER',\n\t\t\t\t\"Use one of 'tsc', 'golar', 'tsz' or 'auto'.\"\n\t\t\t);\n\t\t}\n\t}\n\n\tconst checker: StarsTypechecker = requestedChecker === 'auto' ? detectTypechecker(packageJson) : (requestedChecker as StarsTypechecker);\n\n\tif (configured !== undefined) {\n\t\tconst tsconfig = resolve(root, configured);\n\t\tif (!isFile(tsconfig)) {\n\t\t\tthrow validator.error(\n\t\t\t\t`The tsconfig file does not exist: ${tsconfig}`,\n\t\t\t\t'dev.typecheck.tsconfig',\n\t\t\t\t'TSCONFIG_NOT_FOUND',\n\t\t\t\t'Point `dev.typecheck.tsconfig` to an existing tsconfig.json, relative to the project root.'\n\t\t\t);\n\t\t}\n\t\treturn { enabled: true, tsconfig, checker };\n\t}\n\n\tconst found = [join(root, 'src', 'tsconfig.json'), join(root, 'tsconfig.json')].find((candidate) => isFile(candidate)) ?? null;\n\tif (!found) {\n\t\tthrow validator.error(\n\t\t\t`Could not find a tsconfig.json in ${root}`,\n\t\t\t'dev.typecheck',\n\t\t\t'TSCONFIG_NOT_FOUND',\n\t\t\t'Create src/tsconfig.json or tsconfig.json, or set `dev.typecheck.tsconfig`.'\n\t\t);\n\t}\n\n\treturn { enabled: true, tsconfig: found, checker };\n}\n\n/**\n * Picks the type checker when `dev.typecheck.checker` is `auto`: `golar` when the project already depends on it\n * (it wraps TypeScript and is what this repository's own `typecheck` scripts run), `tsc` otherwise. `tsz` is never\n * picked automatically — it is an early, tsc-compatible alternative a project opts into.\n */\nfunction detectTypechecker(packageJson: PackageJsonLike | null): StarsTypechecker {\n\treturn hasDependency(packageJson, 'golar') ? 'golar' : 'tsc';\n}\n\n/**\n * Resolves `dev.tunnel`: `true` (or `{}`) opens a `cloudflared` quick tunnel, a string (or `{ url }`) is an https\n * URL the user already serves and the CLI only checks.\n */\nfunction resolveTunnel(config: StarsDevConfig['tunnel'], validator: Validator): ResolvedTunnelConfig {\n\tif (config === undefined || config === false) return { mode: 'off' };\n\n\tlet url: string | undefined;\n\tlet updateEndpoint = false;\n\tlet path = DEFAULT_TUNNEL_PATH;\n\n\tif (typeof config === 'string') {\n\t\turl = config;\n\t} else if (config !== true) {\n\t\tif (config === null || typeof config !== 'object' || Array.isArray(config)) {\n\t\t\tthrow validator.error(\n\t\t\t\t'`dev.tunnel` must be a boolean, an https URL or an object',\n\t\t\t\t'dev.tunnel',\n\t\t\t\t'INVALID_TYPE',\n\t\t\t\t'Use `true` for a cloudflared quick tunnel, an https URL you already serve, or `false` to disable it.'\n\t\t\t);\n\t\t}\n\n\t\tvalidator.knownKeys(config, 'dev.tunnel', ['url', 'updateEndpoint', 'path']);\n\t\turl = validator.string(config.url, 'dev.tunnel.url');\n\t\tupdateEndpoint = validator.boolean(config.updateEndpoint, 'dev.tunnel.updateEndpoint') ?? false;\n\t\tpath = validator.string(config.path, 'dev.tunnel.path') ?? DEFAULT_TUNNEL_PATH;\n\t}\n\n\tif (url === undefined) return { mode: 'quick', path, updateEndpoint };\n\n\t// Discord only accepts an https interactions endpoint.\n\tlet parsed: URL;\n\ttry {\n\t\tparsed = new URL(url);\n\t} catch {\n\t\tthrow validator.error(`Invalid URL \"${url}\"`, 'dev.tunnel', 'INVALID_URL', 'Use an absolute https URL such as https://bot.example.com.');\n\t}\n\n\tif (parsed.protocol !== 'https:') {\n\t\tthrow validator.error(\n\t\t\t`The tunnel URL must be https, received \"${url}\"`,\n\t\t\t'dev.tunnel',\n\t\t\t'INVALID_URL',\n\t\t\t'Discord only accepts an https interactions endpoint.'\n\t\t);\n\t}\n\n\treturn { mode: 'url', url, path, updateEndpoint };\n}\n\nfunction resolveCodegen(root: string, config: NonNullable<StarsConfig['codegen']>, validator: Validator): ResolvedCodegenConfig {\n\tvalidator.knownKeys(config, 'codegen', ['i18n']);\n\n\tif (config.i18n === false) return { i18n: null };\n\n\tif (config.i18n === undefined) {\n\t\tconst locales = join(root, DEFAULT_I18N_LOCALES);\n\t\treturn { i18n: isDirectory(locales) ? { locales, output: join(root, DEFAULT_I18N_OUTPUT) } : null };\n\t}\n\n\tif (config.i18n === null || typeof config.i18n !== 'object') {\n\t\tthrow validator.error(\n\t\t\t'`codegen.i18n` must be an object or `false`',\n\t\t\t'codegen.i18n',\n\t\t\t'INVALID_TYPE',\n\t\t\t'Use `{ locales, output }` to configure it or `false` to disable it.'\n\t\t);\n\t}\n\n\tvalidator.knownKeys(config.i18n, 'codegen.i18n', ['locales', 'output']);\n\tconst locales = resolve(root, validator.string(config.i18n.locales, 'codegen.i18n.locales') ?? DEFAULT_I18N_LOCALES);\n\tif (!isDirectory(locales)) {\n\t\tthrow validator.error(\n\t\t\t`The locales directory does not exist: ${locales}`,\n\t\t\t'codegen.i18n.locales',\n\t\t\t'LOCALES_NOT_FOUND',\n\t\t\t'Point `codegen.i18n.locales` to the base locale directory, relative to the project root.'\n\t\t);\n\t}\n\n\tconst output = resolve(root, validator.string(config.i18n.output, 'codegen.i18n.output') ?? DEFAULT_I18N_OUTPUT);\n\treturn { i18n: { locales, output } };\n}\n\n/**\n * The transform that injects auto imports (`@wolfstar/http-framework/auto-imports`) only runs through `tsdown`'s\n * rolldown pipeline, the same way Nuxt's own auto imports only run through its Vite/webpack build: `tsc` and `none`\n * have no transform step to hook into. `tsdown` is picked as `build.tool` first (see {@link detectBuildTool}) for the\n * same reason — it is the only tool this feature, and this build config in general, treats as the default choice.\n *\n * They are on by default from compatibility version 4 on, where `stars` wires the plugin into the build itself. At 3\n * the plugin is the project's to add, so defaulting them on would promise imports that never get injected.\n */\nfunction resolveImports(\n\troot: string,\n\tbuildTool: StarsBuildTool,\n\tfuture: ResolvedFutureConfig,\n\tconfig: StarsConfig['imports'],\n\tvalidator: Validator\n): ResolvedImportsConfig {\n\tconst defaultDirs = DEFAULT_IMPORTS_DIRS.map((dir) => resolve(root, dir));\n\tconst defaultPresets = [...DEFAULT_IMPORTS_PRESETS];\n\tconst defaultDts = resolve(root, DEFAULT_IMPORTS_DTS);\n\n\tif (config === false) {\n\t\treturn { enabled: false, dirs: defaultDirs, presets: defaultPresets, exclude: [], dts: defaultDts };\n\t}\n\n\tconst forcedOn = config === true;\n\tconst options = forcedOn || config === undefined ? {} : config;\n\tif (typeof options !== 'object' || options === null || Array.isArray(options)) {\n\t\tthrow validator.error(\n\t\t\t'`imports` must be an object, `true` or `false`',\n\t\t\t'imports',\n\t\t\t'INVALID_TYPE',\n\t\t\t'Use `{ dirs, presets, exclude, dts }`, `true` to enable with defaults, or `false` to disable.'\n\t\t);\n\t}\n\n\tvalidator.knownKeys(options, 'imports', ['enabled', 'dirs', 'presets', 'exclude', 'dts']);\n\n\tconst requestedOn = forcedOn || validator.boolean(options.enabled, 'imports.enabled');\n\tif (requestedOn && buildTool !== 'tsdown') {\n\t\tthrow validator.error(\n\t\t\t'`imports` requires the `tsdown` build tool',\n\t\t\t'imports.enabled',\n\t\t\t'IMPORTS_REQUIRE_TSDOWN',\n\t\t\t\"Set `build.tool` to 'tsdown', or remove `imports`/set it to `false`.\"\n\t\t);\n\t}\n\n\tconst dirs = (validator.stringArray(options.dirs, 'imports.dirs') ?? [...DEFAULT_IMPORTS_DIRS]).map((dir) => resolve(root, dir));\n\tconst presets = validator.stringArray(options.presets, 'imports.presets') ?? defaultPresets;\n\tconst exclude = validator.stringArray(options.exclude, 'imports.exclude') ?? [];\n\tconst dts = resolve(root, validator.string(options.dts, 'imports.dts') ?? DEFAULT_IMPORTS_DTS);\n\n\tconst enabledByDefault = buildTool === 'tsdown' && future.compatibilityVersion >= LATEST_COMPATIBILITY_VERSION;\n\treturn { enabled: requestedOn ?? enabledByDefault, dirs, presets, exclude, dts };\n}\n\nclass Validator {\n\tpublic constructor(private readonly file: string | null) {}\n\n\tpublic error(message: string, path: string, code: string, hint: string): ConfigError {\n\t\treturn new ConfigError(message, { code, path, hint, file: this.file });\n\t}\n\n\tpublic knownKeys(value: object, path: string, keys: readonly string[]): void {\n\t\tfor (const key of Object.keys(value)) {\n\t\t\tif (keys.includes(key)) continue;\n\t\t\tconst fullPath = path ? `${path}.${key}` : key;\n\t\t\tthrow this.error(\n\t\t\t\t`Unknown option \\`${fullPath}\\``,\n\t\t\t\tfullPath,\n\t\t\t\t'UNKNOWN_OPTION',\n\t\t\t\t`Known options${path ? ` of \\`${path}\\`` : ''}: ${keys.join(', ')}.`\n\t\t\t);\n\t\t}\n\t}\n\n\tpublic string(value: unknown, path: string): string | undefined {\n\t\tif (value === undefined) return undefined;\n\t\tif (typeof value !== 'string' || value.length === 0) throw this.typeError(path, 'a non-empty string', value);\n\t\treturn value;\n\t}\n\n\tpublic boolean(value: unknown, path: string): boolean | undefined {\n\t\tif (value === undefined) return undefined;\n\t\tif (typeof value !== 'boolean') throw this.typeError(path, 'a boolean', value);\n\t\treturn value;\n\t}\n\n\t/** A plain object passed through as-is (e.g. raw `vite`/`tsdown` config merged into the project's own). */\n\tpublic plainObject(value: unknown, path: string): Record<string, unknown> | undefined {\n\t\tif (value === undefined) return undefined;\n\t\tif (value === null || typeof value !== 'object' || Array.isArray(value)) throw this.typeError(path, 'an object', value);\n\t\treturn value as Record<string, unknown>;\n\t}\n\n\tpublic stringArray(value: unknown, path: string): string[] | undefined {\n\t\tif (value === undefined) return undefined;\n\t\tif (!Array.isArray(value) || !value.every((item) => typeof item === 'string')) throw this.typeError(path, 'an array of strings', value);\n\t\treturn value;\n\t}\n\n\tpublic nonNegativeNumber(value: unknown, path: string): number | undefined {\n\t\tif (value === undefined) return undefined;\n\t\tif (typeof value !== 'number' || !Number.isFinite(value) || value < 0) throw this.typeError(path, 'a non-negative number', value);\n\t\treturn value;\n\t}\n\n\tpublic stringRecord(value: unknown, path: string): Record<string, string> | undefined {\n\t\tif (value === undefined) return undefined;\n\t\tif (value === null || typeof value !== 'object' || Array.isArray(value) || !Object.values(value).every((item) => typeof item === 'string')) {\n\t\t\tthrow this.typeError(path, 'an object of string values', value);\n\t\t}\n\t\treturn value as Record<string, string>;\n\t}\n\n\tprivate typeError(path: string, expected: string, value: unknown): ConfigError {\n\t\treturn this.error(\n\t\t\t`\\`${path}\\` must be ${expected}, received ${describe(value)}`,\n\t\t\tpath,\n\t\t\t'INVALID_TYPE',\n\t\t\t`Set \\`${path}\\` to ${expected} or remove it to use the default.`\n\t\t);\n\t}\n}\n\nfunction describe(value: unknown): string {\n\tif (value === null) return 'null';\n\tif (Array.isArray(value)) return 'an array';\n\tif (typeof value === 'string') return `\"${value}\"`;\n\treturn typeof value === 'object' ? 'an object' : `${typeof value} ${String(value)}`;\n}\n\nfunction hasDependency(packageJson: PackageJsonLike | null, name: string): boolean {\n\treturn Boolean(packageJson?.dependencies?.[name] ?? packageJson?.devDependencies?.[name]);\n}\n\nfunction readPackageJson(root: string): PackageJsonLike | null {\n\tconst file = join(root, 'package.json');\n\tif (!isFile(file)) return null;\n\n\ttry {\n\t\tconst parsed: unknown = JSON.parse(readFileSync(file, 'utf-8'));\n\t\treturn parsed !== null && typeof parsed === 'object' ? (parsed as PackageJsonLike) : null;\n\t} catch (error) {\n\t\tthrow new ConfigError(`Failed to parse ${file}: ${error instanceof Error ? error.message : String(error)}`, {\n\t\t\tcode: 'PACKAGE_JSON_INVALID',\n\t\t\thint: 'Fix the JSON syntax of the package.json file.',\n\t\t\tcause: error\n\t\t});\n\t}\n}\n\nfunction isFile(path: string): boolean {\n\ttry {\n\t\treturn existsSync(path) && statSync(path).isFile();\n\t} catch {\n\t\treturn false;\n\t}\n}\n\nfunction isDirectory(path: string): boolean {\n\ttry {\n\t\treturn existsSync(path) && statSync(path).isDirectory();\n\t} catch {\n\t\treturn false;\n\t}\n}\n","import { loadConfigFile } from './load.js';\nimport { resolveStarsConfig, type ResolvedStarsConfig } from './resolve.js';\n\nexport interface LoadStarsConfigOptions {\n\t/**\n\t * The directory to discover `stars.config.*` from.\n\t * @default process.cwd()\n\t */\n\tcwd?: string;\n\t/** An explicit configuration file, resolved from `cwd`. */\n\tconfigFile?: string | null;\n\t/**\n\t * Environment used for defaults such as `HTTP_PORT`.\n\t * @default process.env\n\t */\n\tenv?: NodeJS.ProcessEnv;\n}\n\n/**\n * Loads, validates and resolves a project's `stars.config.*`.\n *\n * @throws {ConfigError} when the configuration file cannot be loaded or contains an invalid option.\n */\nexport async function loadStarsConfig(options: LoadStarsConfigOptions = {}): Promise<ResolvedStarsConfig> {\n\tconst cwd = options.cwd ?? process.cwd();\n\tconst loaded = await loadConfigFile({ cwd, configFile: options.configFile });\n\treturn resolveStarsConfig({ cwd, configFile: loaded.configFile, config: loaded.config, env: options.env });\n}\n\nexport { CONFIG_EXTENSIONS, CONFIG_FILE_NAMES, discoverConfigFile, loadConfigFile } from './load.js';\nexport type { LoadConfigFileOptions, LoadedConfigFile } from './load.js';\nexport { ConfigError } from './errors.js';\nexport type { ConfigErrorOptions } from './errors.js';\nexport { displayPath, readProjectEnvFiles, resolveStarsConfig } from './resolve.js';\nexport type {\n\tPackageJsonLike,\n\tResolveConfigOptions,\n\tResolvedBuildConfig,\n\tResolvedCodegenConfig,\n\tResolvedDevConfig,\n\tResolvedExperimentalConfig,\n\tResolvedFutureConfig,\n\tResolvedNitroConfig,\n\tResolvedI18nCodegenConfig,\n\tResolvedImportsConfig,\n\tResolvedStarsConfig,\n\tResolvedTunnelConfig,\n\tResolvedTypecheckConfig\n} from './resolve.js';\n","/**\n * Public, side-effect free configuration surface of `@wolfstar/cli`.\n *\n * This module is intentionally tiny: importing it from a `stars.config.ts`\n * file must never start the bot nor pull the heavy runtime of the CLI.\n *\n * @module @wolfstar/http-framework/config\n */\n\n/**\n * The build tool used to turn the project sources into runnable JavaScript.\n *\n * - `tsdown`: run the project's own `tsdown` programmatically, configured from {@link StarsConfig.tsdown} (and, with\n * {@link StarsFutureConfig.compatibilityVersion} `3`, from the project's `tsdown.config.*` too).\n * - `tsc`: run the project's `tsc -b` on the configured `tsconfig`.\n * - `vite`: run the project's own `vite` (configuration file included), requires `experimental.enableVite`.\n * - `none`: the entry is runnable as-is (JavaScript projects), no build step.\n * - `auto`: detect from the project (default).\n */\nexport type StarsBuildTool = 'tsdown' | 'tsc' | 'none' | 'vite';\n\nexport interface StarsBuildConfig {\n\t/**\n\t * The build tool to use.\n\t * @default 'auto'\n\t */\n\ttool?: StarsBuildTool | 'auto';\n\t/**\n\t * The directory, relative to {@link StarsConfig.root}, the build writes into.\n\t * @default 'dist', or '.output' when `experimental.enableNitro` is on (Nitro's own convention)\n\t */\n\toutDir?: string;\n\t/**\n\t * The `tsconfig.json` the `tsc` and `tsdown` build tools use, relative to {@link StarsConfig.root}.\n\t * @default 'src/tsconfig.json' when it exists, 'tsconfig.json' otherwise\n\t */\n\ttsconfig?: string;\n}\n\n/**\n * Raw options merged into the project's own `vite.config.*`, the way `vite: {}` in a Nuxt config is merged into\n * Nuxt's own Vite config. Kept as `unknown` here (the CLI, not the framework, depends on `vite`'s types) and passed\n * to Vite's `mergeConfig` as-is.\n */\nexport type StarsViteConfig = Record<string, unknown>;\n\n/**\n * Options for `tsdown`, the bundler `stars build` uses by default.\n *\n * With {@link StarsFutureConfig.compatibilityVersion} `4` these replace `tsdown.config.*` outright: the build is\n * derived from `stars.config` (the entry's directory, `build.outDir`, `build.tsconfig`) and these options are layered\n * on top, so a project keeps one configuration file instead of two. With `3` the project's own `tsdown.config.*` is\n * still loaded and these are merged over it, the way `vite: {}` in a Nuxt config is merged into the project's own\n * Vite config: values here win, and `plugins` are appended rather than replaced.\n *\n * The options named below are the ones a bot usually reaches for. Every other `tsdown` option is accepted as-is —\n * the framework does not depend on `tsdown`, so they stay loosely typed here and `tsdown`'s own `UserConfig` is the\n * reference.\n */\nexport interface StarsTsdownConfig {\n\t/** Entry files or glob patterns, relative to the project root. Defaults to every source file next to `entry`. */\n\tentry?: string | readonly string[] | Record<string, string>;\n\t/** @default 'esm' */\n\tformat?: 'esm' | 'cjs' | 'iife' | 'umd' | readonly string[] | Record<string, unknown>;\n\t/** @default 'node' */\n\tplatform?: 'node' | 'neutral' | 'browser';\n\ttarget?: string | readonly string[] | false;\n\t/**\n\t * Emits one output file per source file instead of a single bundle, so pieces stay loadable from `dist/commands`\n\t * and friends at runtime.\n\t * @default true\n\t */\n\tunbundle?: boolean;\n\t/** Rolldown plugins. Appended to the ones `stars` adds (auto imports) and to those of a `tsdown.config.*`. */\n\tplugins?: readonly unknown[];\n\talias?: Record<string, string>;\n\tdefine?: Record<string, string>;\n\texternal?: unknown;\n\tnoExternal?: unknown;\n\tdeps?: Record<string, unknown>;\n\t/** @default () => ({ js: extname(build.output) }) */\n\toutExtensions?: unknown;\n\t/** @default true */\n\tsourcemap?: boolean | 'inline' | 'hidden';\n\tminify?: unknown;\n\t/** @default false — a bot is not a library, so no declaration files are emitted. */\n\tdts?: boolean | Record<string, unknown>;\n\t/** @default true */\n\tclean?: boolean | readonly string[];\n\ttreeshake?: boolean;\n\tcopy?: unknown;\n\thooks?: Record<string, unknown>;\n\t[option: string]: unknown;\n}\n\n/**\n * The build-default generation the project runs on. Version 4 is current; version 3 remains available for projects\n * that still load a standalone `tsdown.config.*`.\n */\nexport type StarsCompatibilityVersion = 3 | 4;\n\n/**\n * Nuxt-style compatibility block. New projects need not set it; version 3 is retained as an explicit migration\n * escape hatch for projects that still use a standalone `tsdown.config.*`.\n */\nexport interface StarsFutureConfig {\n\t/**\n\t * The major whose defaults apply.\n\t *\n\t * `4` is the default build pipeline:\n\t * - auto imports are on by default with the `tsdown` build tool ({@link StarsImportsConfig}), and the\n\t * `autoImports()` plugin is wired into the build by `stars` itself.\n\t * - `tsdown` is configured from {@link StarsConfig.tsdown} only. A `tsdown.config.*` in the project root is\n\t * rejected rather than silently ignored, so a build never loses the plugins it declares.\n\t * - `build.tool: 'auto'` resolves to `tsdown` for any TypeScript entry, without looking for a `tsdown.config.*`\n\t * or a `tsdown` dependency first.\n\t *\n\t * `3` keeps the legacy behaviour: auto imports off unless asked for, and a `tsdown.config.*` loaded and merged with\n\t * {@link StarsConfig.tsdown}.\n\t * @default 4\n\t */\n\tcompatibilityVersion?: StarsCompatibilityVersion;\n}\n\n/**\n * The type checker `stars dev` runs next to the bot.\n *\n * - `tsc`: the project's own TypeScript, in watch mode.\n * - `golar`: the project's `golar`, forwarding to TypeScript (`golar tsc`), in watch mode.\n * - `tsz`: the project's `tsz` (or `try-tsz`). It has no watch mode, so it is re-run after every build instead.\n * - `auto`: `golar` when the project depends on it, `tsc` otherwise (default).\n */\nexport type StarsTypechecker = 'tsc' | 'golar' | 'tsz';\n\nexport interface StarsTypecheckConfig {\n\t/**\n\t * The `tsconfig.json` the type checker runs against, relative to {@link StarsConfig.root}.\n\t * @default the build tool's tsconfig, 'src/tsconfig.json' or 'tsconfig.json'\n\t */\n\ttsconfig?: string;\n\t/**\n\t * Which type checker to run.\n\t * @default 'auto'\n\t */\n\tchecker?: StarsTypechecker | 'auto';\n}\n\nexport interface StarsTunnelConfig {\n\t/**\n\t * An https URL you already serve; when unset a `cloudflared` quick tunnel is opened instead.\n\t */\n\turl?: string;\n\t/**\n\t * Writes the tunnel's URL to the Discord application's `interactions_endpoint_url` when it changes.\n\t *\n\t * This edits a live Discord application, so it is opt-in: it needs `DISCORD_TOKEN` and `DISCORD_APPLICATION_ID`\n\t * (or `APPLICATION_ID`) in the environment or the project's `.env`.\n\t * @default false\n\t */\n\tupdateEndpoint?: boolean;\n\t/**\n\t * The path the interactions endpoint is served on, appended to the tunnel URL.\n\t * @default '/'\n\t */\n\tpath?: string;\n}\n\nexport interface StarsDevConfig {\n\t/** Custom terminal wordmark (one or more lines), or `false` to hide it. Defaults to the Stars wordmark. */\n\tbanner?: string | readonly string[] | false;\n\t/**\n\t * Extra paths to watch, relative to {@link StarsConfig.root}. Only used when\n\t * the build tool is `none`; `tsdown` and `tsc` watch through their own build.\n\t * @default [dirname(entry)]\n\t */\n\twatch?: string[];\n\t/**\n\t * Glob patterns or paths to ignore while watching, relative to {@link StarsConfig.root}.\n\t * @default ['**\\/node_modules/**', '**\\/dist/**', '**\\/.git/**']\n\t */\n\tignore?: string[];\n\t/**\n\t * Milliseconds to wait after a change before restarting the bot.\n\t * @default 150\n\t */\n\tdebounce?: number;\n\t/**\n\t * Environment variables added to the bot process.\n\t */\n\tenv?: Record<string, string>;\n\t/**\n\t * Arguments passed to `node` before the entry file.\n\t * @default ['--enable-source-maps']\n\t */\n\tnodeArgs?: string[];\n\t/**\n\t * Arguments passed to the bot after the entry file.\n\t * @default []\n\t */\n\targs?: string[];\n\t/**\n\t * The URL the bot listens on, shown in the dev UI's status line and used for {@link StarsDevConfig.health}.\n\t *\n\t * Resolved automatically, the way Vite's and Nuxt's dev servers do, from (in order) `dev.env.HTTP_PORT`, the\n\t * process's `HTTP_PORT`, the project's `src/.env*`/`.env*` (`HTTP_PORT` or `PORT`), or `3000`. `stars dev` also\n\t * resolves whether `localhost` should be shown as `127.0.0.1` instead, the same DNS-order check Vite does, so the\n\t * printed URL is always the one that is actually reachable.\n\t * @default `http://localhost:3000` (or whichever port is found)\n\t */\n\turl?: string;\n\t/**\n\t * A path, relative to {@link StarsDevConfig.url}, polled to report the bot's health in the dev UI.\n\t * When unset the dev UI only reports process state.\n\t */\n\thealth?: string;\n\t/**\n\t * Milliseconds to wait for the bot to exit after `SIGTERM` before killing it.\n\t * @default 5000\n\t */\n\tkillTimeout?: number;\n\t/**\n\t * Runs a type checker next to the bot and reports type errors on the dev UI's `tsc` channel, without blocking\n\t * builds or restarts. `true` uses the project's own tsconfig and type checker, an object picks either\n\t * ({@link StarsTypecheckConfig.checker}).\n\t * @default false\n\t */\n\ttypecheck?: boolean | StarsTypecheckConfig;\n\t/**\n\t * Exposes the bot's HTTP interactions endpoint publicly while `stars dev` runs, so Discord can reach it.\n\t *\n\t * `true` opens a `cloudflared` quick tunnel (its hostname changes on every run), a string is an https URL you\n\t * already serve yourself (named tunnel, reverse proxy, …) that the CLI only checks for reachability.\n\t * @default false\n\t */\n\ttunnel?: boolean | string | StarsTunnelConfig;\n\t/**\n\t * The file `stars dev` mirrors its logs into, relative to {@link StarsConfig.root}, so a session can be read back\n\t * after the terminal UI is gone. `false` disables it.\n\t * @default '.stars/dev.log'\n\t */\n\tlogFile?: string | false;\n}\n\nexport interface StarsI18nCodegenConfig {\n\t/**\n\t * The base locale directory, relative to {@link StarsConfig.root}.\n\t * @default 'src/locales/en-US'\n\t */\n\tlocales?: string;\n\t/**\n\t * The generated declaration file, relative to {@link StarsConfig.root}.\n\t * @default 'src/@types/i18next.d.ts'\n\t */\n\toutput?: string;\n}\n\nexport interface StarsCodegenConfig {\n\t/**\n\t * i18next type generation through `@wolfstar/i18next-type-generator`.\n\t * `false` disables it, an object enables it, unset auto-detects from the presence of the locales directory.\n\t */\n\ti18n?: StarsI18nCodegenConfig | false;\n}\n\nexport interface StarsImportsConfig {\n\t/**\n\t * Whether auto imports are enabled. Requires the `tsdown` build tool: the imports are injected at build time by\n\t * the `autoImports()` plugin from `@wolfstar/http-framework/auto-imports`, which the other tools cannot run.\n\t * @default true when the build tool is 'tsdown', false otherwise\n\t */\n\tenabled?: boolean;\n\t/**\n\t * Directories, relative to {@link StarsConfig.root}, whose exported values are auto-importable. Entries are glob\n\t * path patterns: `'src/lib'` scans only the files directly inside it, `'src/lib/**'` scans recursively.\n\t * @default ['src/lib/**', 'src/utils/**']\n\t */\n\tdirs?: string[];\n\t/**\n\t * Packages whose exports are auto-importable. Packages that are not installed are skipped.\n\t * @default ['@wolfstar/http-framework', '@wolfstar/env-utilities']\n\t */\n\tpresets?: string[];\n\t/**\n\t * Export names excluded from auto imports, e.g. to avoid clashes with project-local names.\n\t * @default []\n\t */\n\texclude?: string[];\n\t/**\n\t * The generated declaration file that types the auto imports, relative to {@link StarsConfig.root}.\n\t * Include it in the project's tsconfig and add its directory to .gitignore.\n\t * @default '.stars/imports.d.ts'\n\t */\n\tdts?: string;\n}\n\n/**\n * The [Nitro preset](https://nitro.build/deploy) `stars build` targets, only reachable once\n * {@link StarsExperimentalConfig.enableNitro} (itself gated on {@link StarsExperimentalConfig.enableVite}) is `true`\n * — see {@link StarsExperimentalConfig}.\n */\nexport interface StarsNitroConfig {\n\t/**\n\t * `'node-server'` (the default, runs locally with plain `node`), `'cloudflare-module'`, `'aws-lambda'`,\n\t * `'vercel'`, `'netlify'`, `'bun'`, `'deno-deploy'`, and more — see Nitro's own preset list.\n\t * @default 'node-server'\n\t */\n\tpreset?: string;\n}\n\n/**\n * Opt-in flags for work that is still landing, in the shape Nuxt's own `experimental` block has: every flag is a\n * boolean, defaults to `false`, and is documented with what it changes and what it still needs. A flag stays here\n * until the behaviour it guards is the default (or is dropped), so enabling one is a statement that breakage is\n * acceptable in exchange for the feature.\n *\n * `enableExternalVite`, `enableNitro` and `nitro` build on `enableVite` (and `nitro` on `enableNitro` too): the type\n * only accepts them once their prerequisite is `true`, so turning one on without the other is a type error here\n * instead of a `ConfigError` at load time.\n */\nexport type StarsExperimentalConfig =\n\t| { enableVite?: false; enableExternalVite?: false; enableNitro?: false }\n\t| {\n\t\t\t/**\n\t\t\t * Uses Vite as the project's build tool, in place of `tsdown`. `build.tool` may then be set to `'vite'`\n\t\t\t * (and `'auto'` detects a `vite.config.*`); the bot keeps calling `client.listen()` and running as a\n\t\t\t * plain `node:http` process, restarted on every change — this only swaps the bundler.\n\t\t\t */\n\t\t\tenableVite: true;\n\t\t\t/**\n\t\t\t * Runs the bot through Vite itself, the way `nuxt dev` runs on Vite's own dev server: instead of\n\t\t\t * building then restarting a child `node` process on every change, `stars dev` loads the entry through\n\t\t\t * Vite's SSR module graph and serves it — through `@wolfstar/http-framework/fetch`'s\n\t\t\t * `createFetchHandler` — from one long-lived process, invalidating and re-evaluating just the entry's\n\t\t\t * module graph on a change instead of restarting.\n\t\t\t *\n\t\t\t * With this on, the entry's default export must be the `Client` instance (already `load()`ed, not\n\t\t\t * `listen()`ed) rather than a script that calls `client.listen()` itself — `stars dev` owns the socket.\n\t\t\t * @default false\n\t\t\t */\n\t\t\tenableExternalVite?: boolean;\n\t\t\tenableNitro?: false;\n\t }\n\t| {\n\t\t\tenableVite: true;\n\t\t\tenableExternalVite?: boolean;\n\t\t\t/**\n\t\t\t * Builds the bot through [Nitro](https://nitro.build) instead of a `node:http` server, so `stars build`\n\t\t\t * produces a server deployable to any of Nitro's presets (`node-server` locally, `cloudflare-module`,\n\t\t\t * `aws-lambda`, `vercel`, `netlify`, `bun`, `deno-deploy`, and more) from the same\n\t\t\t * `@wolfstar/http-framework/fetch` handler `enableExternalVite` already runs in dev — no per-platform\n\t\t\t * adapter to maintain.\n\t\t\t *\n\t\t\t * Output goes to `.output/` (Nitro's own convention) instead of `build.outDir`. The entry's default\n\t\t\t * export must be the `Client` instance, the same as `enableExternalVite`.\n\t\t\t */\n\t\t\tenableNitro: true;\n\t\t\t/** Nitro-specific options, reachable only with `enableNitro: true`. */\n\t\t\tnitro?: StarsNitroConfig;\n\t };\n\nexport interface StarsConfig {\n\t/**\n\t * The project root. Relative paths are resolved from the configuration file.\n\t * @default dirname(configFile)\n\t */\n\troot?: string;\n\t/**\n\t * The source entry point of the bot, relative to {@link StarsConfig.root}.\n\t * @default the first of 'src/main.ts', 'src/main.js', 'src/index.ts', 'src/index.js' that exists\n\t */\n\tentry?: string;\n\tbuild?: StarsBuildConfig;\n\tdev?: StarsDevConfig;\n\tcodegen?: StarsCodegenConfig;\n\t/**\n\t * Nuxt-style auto imports of the framework's exports and the project's own modules.\n\t * `false` disables them, `true` forces them on (requires the `tsdown` build tool). On by default with\n\t * `future.compatibilityVersion: 4`.\n\t */\n\timports?: StarsImportsConfig | boolean;\n\t/** Opt-in flags for behaviour that is still landing. */\n\texperimental?: StarsExperimentalConfig;\n\t/** Build-default compatibility. Omit for version 4; set version 3 only while migrating a standalone tsdown config. */\n\tfuture?: StarsFutureConfig;\n\t/**\n\t * Raw options merged into `vite.config.*`, the way `vite: {}` in a Nuxt config is merged into Nuxt's own Vite\n\t * config. Only used with `build.tool: 'vite'` (see `experimental.enableVite`).\n\t */\n\tvite?: StarsViteConfig;\n\t/**\n\t * The project's `tsdown` build. Replaces `tsdown.config.*` with `future.compatibilityVersion: 4`, and is merged\n\t * over it with `3`. Only used with `build.tool: 'tsdown'`.\n\t */\n\ttsdown?: StarsTsdownConfig;\n}\n\n/**\n * Typed helper for `stars.config.{ts,mts,cts,js,mjs,cjs}` files.\n *\n * @example\n * ```ts\n * import { defineConfig } from '@wolfstar/http-framework/config';\n *\n * export default defineConfig({\n * \tentry: 'src/main.ts',\n * \tbuild: { tool: 'tsdown' }\n * });\n * ```\n */\nexport function defineConfig(config: StarsConfig): StarsConfig {\n\treturn config;\n}\n\nexport * from './lib/config/index.js';\n"],"mappings":";;;;;;;;;;;;AAmBA,IAAa,cAAb,cAAiC,MAAM;CAMtC,AAAO,YAAY,SAAiB,SAA6B;EAChE,MAAM,SAAS,QAAQ,UAAU,SAAY,SAAY,EAAE,OAAO,QAAQ,MAAM,CAAC;wBANlE;wBACA;wBACA;wBACA;EAIf,KAAK,OAAO;EACZ,KAAK,OAAO,QAAQ;EACpB,KAAK,OAAO,QAAQ,QAAQ;EAC5B,KAAK,OAAO,QAAQ,QAAQ;EAC5B,KAAK,OAAO,QAAQ,QAAQ;CAC7B;AACD;;;;AC5BA,MAAa,oBAAoB;CAAC;CAAM;CAAO;CAAO;CAAM;CAAO;AAAK;AACxE,MAAa,oBAAoB,kBAAkB,KAAK,cAAc,gBAAgB,WAAW;;;;AAkBjG,SAAgB,mBAAmB,KAA4B;CAC9D,KAAK,MAAM,QAAQ,mBAAmB;EACrC,MAAM,YAAY,KAAK,KAAK,IAAI;EAChC,IAAIA,SAAO,SAAS,GAAG,OAAO;CAC/B;CAEA,OAAO;AACR;;;;;AAMA,eAAsB,eAAe,SAA2D;CAC/F,MAAM,MAAM,QAAQ,QAAQ,GAAG;CAC/B,IAAI;CAEJ,IAAI,QAAQ,YAAY;EACvB,OAAO,QAAQ,KAAK,QAAQ,UAAU;EACtC,IAAI,CAACA,SAAO,IAAI,GACf,MAAM,IAAI,YAAY,iCAAiC,QAAQ;GAC9D,MAAM;GACN,MAAM,uDAAuD,kBAAkB,KAAK,IAAI,EAAE,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AS,MAAM,eAAe;EAAE;EAAK,YAAY,QAAQ;CAAW,CAAC;CAC3E,OAAO,mBAAmB;EAAE;EAAK,YAAY,OAAO;EAAY,QAAQ,OAAO;EAAQ,KAAK,QAAQ;CAAI,CAAC;AAC1G;;;;;;;;;;;;;;;;;AC8XA,SAAgB,aAAa,QAAkC;CAC9D,OAAO;AACR"}
@@ -163,20 +163,19 @@ interface StarsTsdownConfig {
163
163
  [option: string]: unknown;
164
164
  }
165
165
  /**
166
- * The `stars` major version whose defaults the project runs on, the way Nuxt's own `future.compatibilityVersion`
167
- * makes the next major's defaults available one major early.
166
+ * The build-default generation the project runs on. Version 4 is current; version 3 remains available for projects
167
+ * that still load a standalone `tsdown.config.*`.
168
168
  */
169
169
  type StarsCompatibilityVersion = 3 | 4;
170
170
  /**
171
- * Nuxt-style `future` block: defaults that are already decided for the next major, available today. Where
172
- * `experimental` guards work that is still landing and may change shape, everything here is settled — it only waits
173
- * for a major to become the default.
171
+ * Nuxt-style compatibility block. New projects need not set it; version 3 is retained as an explicit migration
172
+ * escape hatch for projects that still use a standalone `tsdown.config.*`.
174
173
  */
175
174
  interface StarsFutureConfig {
176
175
  /**
177
176
  * The major whose defaults apply.
178
177
  *
179
- * `4` turns on the next major's build pipeline:
178
+ * `4` is the default build pipeline:
180
179
  * - auto imports are on by default with the `tsdown` build tool ({@link StarsImportsConfig}), and the
181
180
  * `autoImports()` plugin is wired into the build by `stars` itself.
182
181
  * - `tsdown` is configured from {@link StarsConfig.tsdown} only. A `tsdown.config.*` in the project root is
@@ -184,9 +183,9 @@ interface StarsFutureConfig {
184
183
  * - `build.tool: 'auto'` resolves to `tsdown` for any TypeScript entry, without looking for a `tsdown.config.*`
185
184
  * or a `tsdown` dependency first.
186
185
  *
187
- * `3` keeps today's behaviour: auto imports off unless asked for, and a `tsdown.config.*` loaded and merged with
186
+ * `3` keeps the legacy behaviour: auto imports off unless asked for, and a `tsdown.config.*` loaded and merged with
188
187
  * {@link StarsConfig.tsdown}.
189
- * @default 3
188
+ * @default 4
190
189
  */
191
190
  compatibilityVersion?: StarsCompatibilityVersion;
192
191
  }
@@ -267,7 +266,7 @@ interface StarsDevConfig {
267
266
  * The URL the bot listens on, shown in the dev UI's status line and used for {@link StarsDevConfig.health}.
268
267
  *
269
268
  * Resolved automatically, the way Vite's and Nuxt's dev servers do, from (in order) `dev.env.HTTP_PORT`, the
270
- * process's `HTTP_PORT`, the project's `.env.local`/`.env` (`HTTP_PORT` or `PORT`), or `3000`. `stars dev` also
269
+ * process's `HTTP_PORT`, the project's `src/.env*`/`.env*` (`HTTP_PORT` or `PORT`), or `3000`. `stars dev` also
271
270
  * resolves whether `localhost` should be shown as `127.0.0.1` instead, the same DNS-order check Vite does, so the
272
271
  * printed URL is always the one that is actually reachable.
273
272
  * @default `http://localhost:3000` (or whichever port is found)
@@ -440,7 +439,7 @@ interface StarsConfig {
440
439
  imports?: StarsImportsConfig | boolean;
441
440
  /** Opt-in flags for behaviour that is still landing. */
442
441
  experimental?: StarsExperimentalConfig;
443
- /** The next major's defaults, available today. */
442
+ /** Build-default compatibility. Omit for version 4; set version 3 only while migrating a standalone tsdown config. */
444
443
  future?: StarsFutureConfig;
445
444
  /**
446
445
  * Raw options merged into `vite.config.*`, the way `vite: {}` in a Nuxt config is merged into Nuxt's own Vite
@@ -600,13 +599,14 @@ declare function resolveStarsConfig(options: ResolveConfigOptions): ResolvedStar
600
599
  */
601
600
  declare function displayPath(root: string, path: string): string;
602
601
  /**
603
- * Reads the project's `.env.local`/`.env` into a plain object, the way `stars dev` and `stars commands` need it:
602
+ * Reads the project's environment layers from `src/.env*` and `.env*` into a plain object, the way `stars dev` and
603
+ * `stars commands` need it:
604
604
  * these files are only loaded into `process.env` by the bot itself once it starts (see `@wolfstar/env-utilities`),
605
605
  * so by the time the CLI runs they are not there yet. This is a minimal line reader, not a full dotenv
606
606
  * implementation — quoting is stripped, but expansion (`dotenv-expand`) is not. Earlier files win, matching
607
607
  * dotenv's own precedence.
608
608
  */
609
- declare function readProjectEnvFiles(root: string): Record<string, string>;
609
+ declare function readProjectEnvFiles(root: string, environment?: string): Record<string, string>;
610
610
  //#endregion
611
611
  export { StarsTypecheckConfig as A, LoadConfigFileOptions as B, StarsExperimentalConfig as C, StarsNitroConfig as D, StarsImportsConfig as E, loadStarsConfig as F, discoverConfigFile as H, ConfigError as I, ConfigErrorOptions as L, StarsViteConfig as M, defineConfig as N, StarsTsdownConfig as O, LoadStarsConfigOptions as P, CONFIG_EXTENSIONS as R, StarsDevConfig as S, StarsI18nCodegenConfig as T, loadConfigFile as U, LoadedConfigFile as V, StarsBuildConfig as _, ResolvedDevConfig as a, StarsCompatibilityVersion as b, ResolvedI18nCodegenConfig as c, ResolvedStarsConfig as d, ResolvedTunnelConfig as f, resolveStarsConfig as g, readProjectEnvFiles as h, ResolvedCodegenConfig as i, StarsTypechecker as j, StarsTunnelConfig as k, ResolvedImportsConfig as l, displayPath as m, ResolveConfigOptions as n, ResolvedExperimentalConfig as o, ResolvedTypecheckConfig as p, ResolvedBuildConfig as r, ResolvedFutureConfig as s, PackageJsonLike as t, ResolvedNitroConfig as u, StarsBuildTool as v, StarsFutureConfig as w, StarsConfig as x, StarsCodegenConfig as y, CONFIG_FILE_NAMES as z };
612
- //# sourceMappingURL=resolve-C9o9kAhT.d.ts.map
612
+ //# sourceMappingURL=resolve-CBovxOO3.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolve-CBovxOO3.d.ts","names":[],"sources":["../../src/lib/config/load.ts","../../src/lib/config/errors.ts","../../src/lib/config/index.ts","../../src/config.ts","../../src/lib/config/resolve.ts"],"mappings":";cAKa;cACA;UAEI;;EAEhB;;EAEA;;UAGgB;;EAEhB;EACA,QAAQ;;;;;iBAMO,mBAAmB;;;;;iBAab,eAAe,SAAS,wBAAwB,QAAQ;;;UCrC7D;;EAEhB;;EAEA;;EAEA;;EAEA;EACA;;;;;;;;;cAUY,oBAAoB;WAChB;WACA;WACA;WACA;EAEhB,YAAmB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AEA;EACA;EACA;EACA;EACA,UAAU;EACV,eAAe;EACf,kBAAkB;;UAGF;WACP,MAAM;;WAEN;;WAEA;;WAEA;;;;;;WAMA;;UAGO;WACP;;WAEA;;WAEA,SAAS;;KAGP;WACE;;;;WAEA;WAAwB;WAAuB;;;;WAE/C;WAAsB;WAAsB;WAAuB;;UAEhE;WACP;WACA;WACA;WACA;WACA,KAAK,SAAS;WACd;WACA;WACA;WACA;WACA;WACA,WAAW;WACX,QAAQ;;WAER;;UAGO;WACP;;UAGO;WACP;WACA;WACA;WACA,OAAO;;UAGA;WACP,sBAAsB;;UAGf;WACP;;WAEA;WACA;WACA;;WAEA;;UAGO;WACP;WACA;;UAGO;WACP,MAAM;;UAGC;;WAEP;;WAEA;;WAEA;WACA,aAAa;;WAEb;WACA,OAAO;WACP,KAAK;WACL,SAAS;WACT,SAAS;WACT,cAAc;WACd,QAAQ;;WAER,MAAM,SAAS;;WAEf,QAAQ,SAAS;;UAGV;EAChB;EACA;EACA,QAAQ;EACR,MAAM,OAAO;;;;;;;iBAyCE,mBAAmB,SAAS,uBAAuB;;;;iBAyDnD,YAAY,cAAc;;;;;;;;;iBA+Q1B,oBAAoB,cAAc,uBAA8B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wolfstar/http-framework",
3
- "version": "3.6.0",
3
+ "version": "4.0.0-next-20260913191701",
4
4
  "description": "The framework for Star Network's HTTP-only bots",
5
5
  "keywords": [
6
6
  "api",
@@ -1 +0,0 @@
1
- {"version":3,"file":"resolve-C9o9kAhT.d.ts","names":[],"sources":["../../src/lib/config/load.ts","../../src/lib/config/errors.ts","../../src/lib/config/index.ts","../../src/config.ts","../../src/lib/config/resolve.ts"],"mappings":";cAKa;cACA;UAEI;;EAEhB;;EAEA;;UAGgB;;EAEhB;EACA,QAAQ;;;;;iBAMO,mBAAmB;;;;;iBAab,eAAe,SAAS,wBAAwB,QAAQ;;;UCrC7D;;EAEhB;;EAEA;;EAEA;;EA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