/** Permission bits for `~/.auden/` and other auden-owned directories. */ export declare const AUDEN_DIR_MODE = 448; /** Permission bits for `~/.auden/config.json` — it holds a bearer token. */ export declare const AUDEN_CONFIG_MODE = 384; /** * Create `dir` (and parents) with owner-only permissions, tightening an * existing directory's mode too — `mkdir`'s `mode` option only applies to * newly-created directories, so a pre-existing `~/.auden` from an older * version (or a permissive umask) would otherwise stay world-readable. */ export declare function ensureAudenDir(dir: string): Promise; /** * Baked-in fallback when the config file has no `dashboardUrl`. Build-time * constant so a stripped-down `auden` binary (no config, no flags) still * talks to prod. */ export declare const DEFAULT_DASHBOARD_URL = "https://app.auden.to"; /** * Normalize a candidate dashboard URL to its origin (scheme + host + port). * Returns '' when the input is empty, whitespace-only, unparseable, or has a * non-http(s) protocol. Centralized here so reads, writes, the resolve * helper, and the `auden init` flag-validation path all agree on what counts * as a valid URL and what gets stripped (paths, queries, fragments, trailing * whitespace). */ export declare function normalizeDashboardUrl(value: string): string; /** * Delete the obsolete `eval` section from the config, if it is there. * * Returns true when a section was removed, so the caller can say so — a * credential disappearing from a file the user wrote must not be silent. * * Local grading is gone (docs/plans/cli-local-grading-removal-plan.md) and * nothing reads this section any more, but "unread" is not "harmless": the * block could hold `eval.apiKey`, a live third-party LLM credential the CLI * asked the user to store and now has no reason to keep. Leaving it would make * "the CLI holds no provider credentials" true of the code and false of the * disk. The rest of the file — token, dashboardUrl, and any field a newer CLI * wrote — is preserved by the same read-modify-write every other writer uses. * * Silent no-op on a malformed config: this is housekeeping running inside * `auden init`, and refusing to proceed over a stale key the user cannot see * would block the setup they actually asked for. */ export declare function removeConfigEvalSection(configPath?: string): Promise; /** * Environment variable holding the dashboard API token. Ephemeral cloud * environments (Claude Code on the web, CI runners, devcontainers) inject * secrets as env vars and have nowhere to run an interactive `auden init * --token`, so the env var is the setup-script-friendly path to a credential. */ export declare const AUDEN_TOKEN_ENV = "AUDEN_TOKEN"; /** * Environment variable holding the dashboard base URL. Same rationale as * AUDEN_TOKEN_ENV: it lets one environment (say, a staging container) point * the CLI elsewhere without a per-command flag or a baked-in config file. */ export declare const AUDEN_DASHBOARD_URL_ENV = "AUDEN_DASHBOARD_URL"; /** * Read the stored API token (persisted by `auden init --token` or the first * successful `auden sync --token`). Returns '' if absent or unreadable. * * Config file only — callers that should also honour `$AUDEN_TOKEN` want * `resolveToken`. Kept separate so `auden sync` can compare a `--token` flag * against what is actually *on disk* before deciding to persist it. */ export declare function readConfigToken(configPath?: string): Promise; /** * Read the API token from the environment. Returns '' when unset or * whitespace-only, so an exported-but-empty `AUDEN_TOKEN=` behaves like * "no token" rather than shadowing a valid stored one. */ export declare function readEnvToken(env?: NodeJS.ProcessEnv): string; /** * Read the dashboard base URL from the environment, normalized to an origin. * * Throws when the variable is set to something that isn't a valid http(s) * URL. A silent fallback would send a staging container's verdicts to prod — * the same reasoning that makes `--dashboard-url` strict, applied to the env * var that stands in for it in scripted setups. */ export declare function readEnvDashboardUrl(env?: NodeJS.ProcessEnv): string; /** * Resolve which API token a command should use. Precedence: * 1. Explicit `--token` flag (`flag` arg, when non-empty) * 2. `$AUDEN_TOKEN` in the environment * 3. `token` field in ~/.auden/config.json * * Env beats config so a container that inherited a stale `config.json` from a * baked image layer still syncs with the credential its environment supplies. * An env-supplied token is deliberately never written to disk — the * environment owns it, and persisting it would outlive the environment that * granted it. */ export declare function resolveToken(flag?: string, configPath?: string, env?: NodeJS.ProcessEnv): Promise; /** * Persist the API token while preserving any other fields already in the * config file. Same malformed-config guard as the other writers — refuses to * overwrite a broken file. Throws on an empty/whitespace token so callers * can't silently wipe a working credential. */ export declare function writeConfigToken(value: string, configPath?: string): Promise; /** * Read the `discoverGlobal` flag. When true, `auden import` extends its * default scan to `~/.claude/CLAUDE.md`. Defaults to false on missing or * malformed config. */ export declare function readConfigDiscoverGlobal(configPath?: string): Promise; /** * Persist `discoverGlobal` while preserving any other fields already in the * config file. Creates the parent directory if needed. * * Throws when the existing config file is present but malformed, rather than * silently overwriting it — callers must surface the error so the user can * fix or remove the file before retrying. */ export declare function writeConfigDiscoverGlobal(value: boolean, configPath?: string): Promise; /** * Read the `updateCheck` flag. When explicitly `false`, the CLI never * contacts the npm registry to see whether a newer release exists. Defaults * to `true` on a missing, malformed, or absent value — the check is * advisory, TTY-only, and cached for a day, so the default-on posture costs * an interactive user at most one small request per day. */ export declare function readConfigUpdateCheck(configPath?: string): Promise; /** * Read the MCP bundle allowlist. When set to a non-empty array of slugs, * `auden mcp` only exposes those bundles; when absent, empty, or malformed it * returns `null`, meaning "no restriction" (all of the caller's bundles are * reachable). A `--bundles` flag overrides this per invocation. */ export declare function readConfigMcpBundles(configPath?: string): Promise; /** * Read whether `auden mcp` may perform writes (push/update/archive). Defaults * to `true` — writes are enabled unless the config explicitly sets * `mcp.write: false` or the caller passes `--read-only`. Returns `true` on a * missing or malformed config so a fresh install is fully functional. */ export declare function readConfigMcpWrite(configPath?: string): Promise; /** * Read the configured dashboard base URL. Returns '' when absent, malformed, * not a string, or not a valid http(s) URL. Always normalized to origin so * callers can concatenate `${url}/api/...` without thinking about paths, * trailing slashes, or stray whitespace from hand-edited configs. */ export declare function readConfigDashboardUrl(configPath?: string): Promise; /** * Persist the dashboard URL. Same malformed-config guard as * writeConfigDiscoverGlobal — refuses to overwrite a broken file. Throws * when the value isn't a valid http(s) URL so callers can't silently store * garbage that fails later at fetch time. */ export declare function writeConfigDashboardUrl(value: string, configPath?: string): Promise; /** * Resolve which dashboard URL a command should hit. Precedence: * 1. Explicit `--dashboard-url` flag (`flag` arg, when non-empty and valid) * 2. `$AUDEN_DASHBOARD_URL` in the environment * 3. `dashboardUrl` field in ~/.auden/config.json * 4. DEFAULT_DASHBOARD_URL baked into the build * * Throws when the flag or the env var was supplied but isn't a valid http(s) * URL — silent fallback would let `auden sync --dashboard-url htps://typo` * hit prod instead of the intended override. Matches `auden init`'s * strictness. * * The result is always a bare origin (no path, no trailing slash) so * `${resolved}/api/sync` works. */ export declare function resolveDashboardUrl(flag?: string, configPath?: string, env?: NodeJS.ProcessEnv): Promise; /** * Repo ids the user has switched transcript narration off for. * * The per-repo opt-out `transcript-content-classes-plan.md` requires, for "the * user who wants today's metadata-only behaviour". Keyed by `repoId` — the * one-way digest already computed per checkout (`./repo-id.ts`) and already * carried on every action as `metadata.repoId` — so the opt-out needs no new * file format and no second notion of what a repo is. * * **The opt-out is exact, not reduced fidelity.** An action from a listed repo * is built with no `narration` key at all, which is byte-for-byte the payload * every shipped CLI sends today. That is the promise the plan makes, and it is * asserted rather than described (`action-queue.test.ts`). * * **Absent means on; malformed means off.** Those are different states and an * earlier version of this collapsed them, returning an empty set either way — * which turned a user's broken opt-out into transcript uploads, the one * direction this setting must never fail in. An absent key is the disclosed * default (the founder's call for a fresh install). A key that is present but * not a list of strings is someone trying to switch narration off and getting * it wrong, so it disables narration for every repo until they fix it. * * `null` distinguishes the two for the caller; `readConfigNarrationDisabled` * below is the form most callers want. */ export declare function readConfigNarrationDisabledRepos(configPath?: string): Promise | null>; /** Persist the narration opt-out list, preserving the rest of the config. */ export declare function writeConfigNarrationDisabledRepos(repoIds: readonly string[], configPath?: string): Promise; //# sourceMappingURL=config.d.ts.map