import type { Tool } from '@wrongstack/core/types'; import { type DangerAssessment } from './_danger-detect.js'; /** * Apply the configured exec command policy. Recomputes the effective allowlist * as `DEFAULT ∪ allow − deny`. Call once at boot from * `config.tools.exec.{allow,deny}`. Idempotent (always rebuilt from defaults). * * SECURITY: `allow` must originate from TRUSTED config only — the config loader * strips `tools.exec.allow` from the untrusted in-project repo config before it * reaches here. `deny` is safe from any source (it only narrows). */ export declare function configureExecPolicy(opts?: { allow?: readonly string[] | undefined; deny?: readonly string[] | undefined; }): void; /** Reset the exec allowlist to the built-in defaults (tests / re-init). */ export declare function resetExecPolicy(): void; /** * Apply the configured danger-bypass policy. Each id in `bypass` is * added to the effective skip set; duplicates are fine. Idempotent. * * Call once at boot from `config.tools.exec.danger.bypass`. */ export declare function configureDangerBypass(opts?: { bypass?: readonly string[] | undefined; }): void; /** Reset the danger-bypass set to empty (tests / re-init). */ export declare function resetDangerBypass(): void; /** * Read-only view of the active bypass set. `detectDanger()` takes a * `bypass` argument directly, so consumers should prefer passing this * rather than reading the set and matching themselves. */ export declare function getDangerBypass(): ReadonlySet; /** Whether `cmd` is currently in the effective exec allowlist. */ export declare function isExecCommandAllowed(cmd: string): boolean; /** Snapshot of the effective allowlist (sorted) — for tests / diagnostics. */ export declare function getExecAllowlist(): string[]; export interface ExecInput { command: string; args?: string[] | undefined; cwd?: string | undefined; timeout?: number | undefined; } export interface ExecOutput { command: string; args: string[]; stdout: string; stderr: string; exitCode: number; truncated: boolean; /** * Always true on a returned result: refusals (allowlist miss, blocked args, * kill guard, cwd containment, circuit breaker) THROW instead, so the * executor records them as failed calls. Kept for output-shape stability. */ allowed: boolean; /** * Heuristic danger assessment of the (cmd, args) pair. Populated for every * call that ran so the UI/TUI can render a banner when the level is * 'caution' or 'destructive'. See `_danger-detect.ts` for the rule set. */ danger: DangerAssessment; } export declare const execTool: Tool; //# sourceMappingURL=exec.d.ts.map