/** * CLI-side global error logger. * * Mirrors the MCP server's `errorLogger` (see * `packages/appwrite-utils-mcp/src/utils/errorLogger.ts`) so a crash in the * CLI — including a thrown error inside an inquirer prompt that bypasses our * try/catch blocks — leaves a structured record with cause chain and redacted * args under `~/.appwrite-utils-cli/errors.log`. Without this, the only place * the failure shows up is a raw stack trace on stderr that's gone the next * time the user resizes their terminal. * * Intentional duplication: the redaction patterns + cause walker are * copy-pasted from the MCP errorLogger rather than extracted into * `appwrite-utils-helpers`. When a third consumer shows up, refactor to a * shared module — until then, dual maintenance of ~70 lines of patterns is * cheaper than the shape-design work to make a clean shared API. */ /** * Recursively strip sensitive values from an arbitrary JSON-like structure. * Mirrors the MCP redactor's contract: never mutates, returns a deep copy, * collapses circular references to "[CIRCULAR]". */ export declare function redactArgs(value: unknown, seen?: WeakSet): unknown; export interface CliErrorContext { /** What was being attempted — e.g. ``, `selectFunctions`, or a CLI subcommand name. */ command: string; /** Arbitrary args to redact + log alongside the error. */ args?: unknown; /** The thrown error itself. */ error: unknown; /** Optional cwd/config-path snapshot for triage. */ context?: { cwd?: string; configPath?: string; }; } /** * Append one JSON-line error record to `~/.appwrite-utils-cli/errors.log` (if * writable) and echo a one-liner to stderr via `MessageFormatter.error`. * * Designed to be safe to call from a `process.on('uncaughtException')` handler — * no async, no rejections, swallows file-IO failures and reports them inline. */ export declare function logCliError(ctx: CliErrorContext): void; /** Resolved log file path (creates the directory on first access). */ export declare function getCliLogPath(): string | undefined;