import { ConfigDiagnosticCode, ResolvedStarsConfig, configDiagnostics, loadStarsConfig } from "@wolfstar/schema"; //#region src/run.d.ts export declare function runMain(argv?: string[]): Promise; //#endregion //#region src/utils/errors.d.ts export declare const ExitCode: { readonly Ok: 0; readonly Error: 1; readonly InvalidConfig: 2; readonly BuildFailed: 3; readonly Interrupted: 130; readonly Terminated: 143; }; export type ExitCode = (typeof ExitCode)[keyof typeof ExitCode]; /** * Formats an error for the terminal: a `Diagnostic` (from `stars.config.*` validation, via * `@wolfstar/schema`'s `configDiagnostics`, or from the CLI's own `cliDiagnostics`) renders through * nostics' own ANSI formatter — message, `fix`, `sources` and `docs` — everything else falls back to a crash report. */ export declare function formatError(error: unknown): Promise; export declare function exitCodeOf(error: unknown): ExitCode; //#endregion //#region src/utils/diagnostics.d.ts /** * Structured, stable diagnostic codes for everything `@wolfstar/cli` itself rejects (as opposed to `stars.config.*` * validation, which is `@wolfstar/http-framework`'s own {@link import('@wolfstar/schema').configDiagnostics}). * * `reporters` stays empty: `runMain` (`src/run.ts`) is the single place that renders a caught `Diagnostic` to the * terminal (`formatError`) and picks its exit code (`exitCodeOf`), so nothing here should print on its own — a * command that calls e.g. `runBuild` directly (as the test suite does) gets a plain thrown value instead of stray * console output. * * `why` and `fix` are always given the same, fully-typed params object, even when one of them ignores part of it or * neither takes any: a bare `() => value` next to a typed sibling loses nostics' param-type inference (a zero-arg * function widens to `unknown` params, erasing the sibling's fields from the merged type). */ export declare const cliDiagnostics: import("nostics").Diagnostics<{ readonly PREPARE_OUTDATED: { why: (_p: {}) => string; }; readonly TSCONFIG_LEGACY_EXTENDS: { why: (p: { file: string; }) => string; fix: (_p: { file: string; }) => string; }; readonly TYPECHECK_FAILED: { why: (p: { projects: string; }) => string; }; readonly TYPECHECK_NO_PROJECT: { why: (p: { root: string; }) => string; fix: (_p: { root: string; }) => string; }; readonly DISCORD_TOKEN_MISSING: { why: (_p: {}) => string; fix: (_p: {}) => string; }; readonly DISCORD_APPLICATION_ID_MISSING: { why: (_p: {}) => string; fix: (_p: {}) => string; }; readonly NGROK_AUTHTOKEN_MISSING: { why: (_p: {}) => string; fix: (_p: {}) => string; }; readonly DISCORD_REQUEST_FAILED: { why: (p: { status: number; detail: string; }) => string; fix: (p: { status: number; detail: string; }) => "Check DISCORD_TOKEN." | "Check the application id and the bot permissions."; }; readonly BUILD_FAILED: { why: (p: { message: string; }) => string; }; readonly COMMAND_NOT_FOUND: { why: (p: { names: string; }) => string; fix: (_p: { names: string; }) => string; }; readonly ABORTED: { why: (_p: {}) => string; }; readonly CONFIRMATION_REQUIRED: { why: (_p: {}) => string; fix: (_p: {}) => string; }; readonly DEPLOY_CONFIRMATION_REQUIRED: { why: (_p: {}) => string; fix: (_p: {}) => string; }; readonly COMMANDS_DIFFER: { why: (p: { count: number; }) => string; fix: (_p: { count: number; }) => string; }; readonly LOCAL_COMMANDS_UNAVAILABLE: { why: (p: { reason: string; fix: string; }) => string; fix: (p: { reason: string; fix: string; }) => string; }; readonly DOCTOR_FAILED: { why: (p: { count: number; }) => string; }; readonly UNKNOWN_SHELL: { why: (p: { shell: string; }) => string; fix: (_p: { shell: string; }) => string; }; readonly INVALID_THEME: { why: (p: { theme: string; themes: string; }) => string; fix: (p: { theme: string; themes: string; }) => string; }; readonly PORT_IN_USE: { why: (p: { url: string; }) => string; fix: (_p: { url: string; }) => string; }; readonly PORT_CHECK_FAILED: { why: (p: { host: string; port: number; reason: string; }) => string; fix: (_p: { host: string; port: number; reason: string; }) => string; }; readonly NO_AVAILABLE_PORT: { why: (p: { first: number; last: number; }) => string; fix: (_p: { first: number; last: number; }) => string; }; readonly DEV_DIRECTORY_UNWRITABLE: { why: (p: { path: string; reason: string; }) => string; fix: (_p: { path: string; reason: string; }) => string; }; readonly INVALID_OPTION: { why: (p: { option: string; value: string; allowed: string; }) => string; fix: (p: { option: string; value: string; allowed: string; }) => string; }; readonly CODEGEN_OUTDATED: { why: (_p: {}) => string; }; readonly CODEGEN_GENERATOR_DISABLED: { why: (p: { generator: string; }) => string; fix: (p: { generator: string; }) => string; }; readonly DEPENDENCY_MISSING: { why: (p: { name: string; root: string; hint: string; }) => string; fix: (p: { name: string; root: string; hint: string; }) => string; }; readonly MODULE_FAILED: { why: (p: { module: string; reason: string; message: string; }) => string; fix: (p: { module: string; reason: string; message: string; }) => string; }; readonly MODULES_PRELOAD_REQUIRED: { why: (p: { tool: string; modules: string; }) => string; fix: (_p: { tool: string; modules: string; }) => string; }; readonly PLUGINS_NOT_REGISTERED: { why: (p: { plugins: string; }) => string; fix: (_p: { plugins: string; }) => string; }; readonly VARLOCK_LOADER_IMPLICIT: { why: (_p: {}) => string; fix: (_p: {}) => string; }; readonly VARLOCK_NOT_INSTALLED: { why: (_p: {}) => string; fix: (_p: {}) => string; }; readonly CODEGEN_FAILED: { why: (p: { code: number | null; stderr: string; }) => string; }; }, readonly [], never>; type CliDiagnosticCode = keyof typeof cliDiagnostics; //#endregion //#region src/utils/output-mode.d.ts type OutputMode = 'tui' | 'plain'; interface ResolveOutputModeOptions { /** `--no-tui` (`tui: false`) or `--tui` (`tui: true`) from the command line. */ tui?: boolean; /** Configured presentation, unless overridden by a command-line layout. */ style?: 'nuxt-style' | 'dashboard' | 'none'; env?: NodeJS.ProcessEnv; /** Whether stdout is an interactive terminal. */ isTTY?: boolean; /** Raw-key input requires a terminal too, even when the output is a TTY. */ isInputTTY?: boolean; columns?: number; rows?: number; /** Whether the process runs in a CI environment. */ isCI?: boolean; } /** * Decides between the interactive TUI and plain line output. * * Precedence: `--no-tui` › `STARS_TUI=plain` › non-interactive stdout, CI or `TERM=dumb`. */ export declare function resolveOutputMode(options?: ResolveOutputModeOptions): OutputMode; export declare function isCIEnvironment(env?: NodeJS.ProcessEnv): boolean; /** * Whether colours should be emitted, honouring `NO_COLOR` and `FORCE_COLOR`. */ export declare function shouldUseColor(env?: NodeJS.ProcessEnv, isTTY?: boolean): boolean; /** * Whether animations (spinners, blinking status) should be avoided. */ export declare function prefersReducedMotion(env?: NodeJS.ProcessEnv): boolean; //#endregion //#region src/utils/theme.d.ts /** Every theme a user can pick, in the order the picker lists them. `auto` follows the terminal background. */ export declare const THEME_SETTINGS: readonly ['auto', 'dark', 'light', 'dark-daltonized', 'light-daltonized', 'dark-ansi', 'light-ansi']; type ThemeSetting = (typeof THEME_SETTINGS)[number]; type ThemeName = Exclude; /** * Semantic colour roles the TUI paints with, instead of hardcoded colour names. `undefined` leaves the terminal's own * foreground colour, which is the only legible choice for body text on both dark and light backgrounds. */ interface Theme { /** The wordmark, progress bar and selection marker. */ brand: string; url: string; tunnel: string; /** Something is still building or starting. */ busy: string; success: string; warning: string; error: string; /** The `info`, `debug` and `trace` level badges of the dashboard's log stream. */ info: string; debug: string; trace: string; /** Names worth finding in a log line: a command, a piece, a channel that is switched on. */ accent: string; text: string | undefined; /** Foreground of a badge painted on `success`, `warning` or `busy`. */ onBright: string; /** Foreground of a badge painted on `error`. */ onError: string; } type ThemeToken = keyof Theme; export declare const THEMES: Readonly>; export declare function resolveTheme(setting: ThemeSetting, env?: NodeJS.ProcessEnv): ThemeName; interface ThemeSettingSources { /** `--theme`. */ flag?: string; env?: NodeJS.ProcessEnv; /** The theme saved by the picker. */ saved?: ThemeSetting; } /** * Precedence: `--theme` › `STARS_THEME` › the saved preference › `auto`. An unknown `STARS_THEME` is ignored, since an * environment variable should not stop the dev server; an unknown `--theme` is the caller's to reject. */ export declare function resolveThemeSetting({ flag, env, saved }: ThemeSettingSources): ThemeSetting; //#endregion export { type CliDiagnosticCode, type ConfigDiagnosticCode, type OutputMode, type ResolveOutputModeOptions, type ResolvedStarsConfig, type Theme, type ThemeName, type ThemeSetting, type ThemeToken, configDiagnostics, loadStarsConfig }; //# sourceMappingURL=index.d.ts.map