import type { SecretScrubber } from '../types/secret-scrubber.js'; export declare const INPUT_HISTORY_DEFAULT_MAX = 100; /** * Per-project TUI prompt input history. * * Backed by a single JSON file at `~/.wrongstack/projects//input- * history.json`. Entries are newest-first, capped at `maxEntries`. Before * any entry is written to disk it is passed through a `SecretScrubber` and * dropped if it still contains a redacted marker — leaking a pasted API * key into a history file would be a real incident, so the scrubber is * mandatory, not optional. * * The store is intentionally small and synchronous-ish (load once at TUI * boot, save debounced on change). It mirrors PromptUsageStore's shape so * the two read as a family. */ export declare class InputHistoryStore { private readonly file; private readonly scrubber; private readonly maxEntries; /** * @param file Absolute path to the per-project input-history.json. * @param scrubber SecretScrubber used to filter secrets before write. * @param maxEntries Cap on the number of entries persisted. Default 100. */ constructor(file: string, scrubber: SecretScrubber, maxEntries?: number); /** * Load the persisted entries. Missing or corrupt file → empty list * (never throws — history is best-effort). */ load(): Promise; /** * Persist `entries` to disk after scrubbing each one. Entries that still * contain a redaction marker AFTER scrubbing are dropped — a half-scrubbed * prompt like "export API_KEY=***REDACTED***" is useless as history and * keeping it risks confusing the agent. Dedup is the caller's job (the * reducer already dedups); this method only scrubs, caps, and writes. */ save(entries: string[]): Promise; /** Truncate the file to an empty entry list (used by /clear). */ clear(): Promise; /** * Run each entry through the scrubber and drop any that still contain a * redaction marker. Internal so the test suite can pin the policy. */ private scrubAndFilter; /** * Heuristic: did the scrubber actually redact anything? DefaultSecretScrubber * replaces matches with "***REDACTED***", so a residual marker means a secret * was detected. Subclasses of SecretScrubber that use a different sentinel * can be accommodated by widening this check in the future; for now the * marker check covers the shipped scrubber. */ private looksRedacted; } //# sourceMappingURL=input-history-store.d.ts.map