import { type CommandRunner, type ExecutableProbe, type ShellPolicy } from "../process/shell.js"; import { type TemplateConfigPaths } from "../process/templates.js"; /** Bytes of output one process task keeps before the cap stops it. */ export declare const DEFAULT_OUTPUT_CAP_BYTES: number; /** Bytes of output one process task keeps; see `docs/configuration.md`. */ export declare const OUTPUT_CAP_ENV = "PI_PRETTY_TASK_OUTPUT_CAP_BYTES"; /** Whether an ending task may raise a terminal notification: `on` or `off`. */ export declare const NOTIFY_ENV = "PI_PRETTY_TASK_NOTIFY"; /** Days a finished session's records and output are kept before they are reclaimed. */ export declare const DEFAULT_RETENTION_DAYS = 7; /** The retention window in whole days; see `docs/configuration.md`. */ export declare const RETENTION_DAYS_ENV = "PI_PRETTY_TASK_RETENTION_DAYS"; /** Process tasks one session may run at once; the promise `docs/scope-v1.md` makes. */ export declare const DEFAULT_MAX_RUNNING_TASKS = 20; /** The running-task cap in whole tasks; see `docs/configuration.md`. */ export declare const MAX_RUNNING_TASKS_ENV = "PI_PRETTY_TASK_MAX_RUNNING_TASKS"; /** Whether the built-in shell tools and `!` commands are taken over: `on` or `off`. */ export declare const ADOPT_FOREGROUND_ENV = "PI_PRETTY_TASK_ADOPT_FOREGROUND"; /** Seconds a foreground run may hold the turn before it detaches; `0` keeps waiting. */ export declare const DEFAULT_FOREGROUND_TIMEOUT_SECONDS = 0; /** The foreground detach timeout in whole seconds; see `docs/configuration.md`. */ export declare const FOREGROUND_TIMEOUT_ENV = "PI_PRETTY_TASK_FOREGROUND_TIMEOUT"; /** Longest detach delay `setTimeout` counts, in whole seconds; a longer one fires at once. */ export declare const MAX_FOREGROUND_TIMEOUT_SECONDS: number; /** pi's own settings directory; `pretty-task.json` is read from it. */ export declare const AGENT_DIR_ENV = "PI_CODING_AGENT_DIR"; /** The whole configuration, as one value handed down from the entry point. */ export interface Settings { /** Bytes of output a process task keeps before the cap stops it. */ readonly outputCapBytes: number; /** The shell a process task runs in, resolved once so a bad value fails the load. */ readonly shellPolicy: ShellPolicy; /** Whether an ending task may write a terminal notification. */ readonly notify: boolean; /** Days a finished session is kept before pruning reclaims it; never zero. */ readonly retentionDays: number; /** * How many process tasks this session may run at once, children included: a * fire and a chain step are processes too, so they count against the same * ceiling (ADR-0014). */ readonly maxRunningTasks: number; /** * Whether the built-in `bash`/`powershell` tools and `!` commands are taken * over. Only a process this extension spawned carries a handle that can be let * go, so without the takeover there is nothing to detach (ADR-0020). */ readonly adoptForeground: boolean; /** * Milliseconds a foreground run may hold the turn before it detaches to a * task; `0` never detaches, which is the default. The tool's own `timeout` * parameter is a different thing: that one kills. */ readonly foregroundTimeoutMs: number; /** Where the named templates are read from: the project first, then the agent dir. */ readonly templatePaths: TemplateConfigPaths; } /** Where a `Settings` is built from; every field has a production default. */ export interface SettingsOptions { /** The environment to read; defaults to `process.env`. */ readonly env?: NodeJS.ProcessEnv; /** Project root holding `.pi/pretty-task.json`; defaults to the working directory. */ readonly projectDir?: string; /** Agent settings directory; defaults to `AGENT_DIR_ENV` or pi's own default. */ readonly agentDir?: string; /** Test seams forwarded to the shell policy: which platform, what is executable, and what `where`/`reg` report. */ readonly platform?: NodeJS.Platform; readonly probe?: ExecutableProbe; readonly run?: CommandRunner; } /** * Read the whole configuration. Throws on the first value that cannot be * honoured, so a bad environment stops the extension from loading rather than * every task it would have started. */ export declare function readSettings(options?: SettingsOptions): Settings; /** * The output byte cap. * * An absent key means the default, and every other value must be a positive whole * number of bytes: the thrown error is the user-facing report, so it names the * key, what is accepted and what was found — a failed extension load then says * exactly what to fix. `Number()` on a typo yields `NaN`, and a `NaN` cap compares * false against every byte count, so the first chunk of every task would look like * the cap and every task would die at once. */ export declare function parseOutputCapBytes(env: NodeJS.ProcessEnv): number;