export interface SessionPolicy { /** Tools the user authorized once during this REPL session. Not persisted. */ allow: Set; /** Mutable flag so the runner can flip pentest auth for this session only. */ pentestAuthorized: { value: boolean; }; /** Stable id used to scope the session's plan/tasks in the plan store. */ sessionId: string; /** When true, the agent must follow its approved plan (set by /implement). */ planApproved: { value: boolean; }; /** Signature of a multi-task update awaiting the model's re-issue to confirm. */ pendingTaskBatch: { value: string | undefined; }; /** Signature of an early task-open (unmet dependencies) awaiting confirmation. */ pendingDependency: { value: string | undefined; }; } export declare function createSessionPolicy(sessionId?: string): SessionPolicy; export declare function isPreApprovalAllowedTool(name: string): boolean; /** True when the tool is allowed in plan mode (gather-only). */ export declare function isPlanModeAllowedTool(name: string): boolean; /** * Shell commands blocked in plan mode: project scaffold/mutate and active * exploit/C2. Recon, enum, fuzz, long nmap, installs of scanners are allowed. */ export declare function isPlanModeAllowedShellCommand(command: string): boolean; /** * A plan's persisted status is the durable source of truth for "has this * plan been approved" — session.planApproved is in-memory only and resets to * false on every fresh SessionPolicy (a /history resume, or a new policy * created after context compaction). Without re-deriving from the plan's own * status, a resumed session for an already-approved/executed/completed plan * would re-block every tool call behind the "awaiting approval" gate even * though /implement already ran before the app was closed. */ export declare function isPlanApprovedByStatus(status: PlanStatusLike): boolean; /** * Whether a plan still has work left to force via the "act, don't narrate" * nudge. A plan whose persisted status is "completed" should be treated like * having no active plan for that purpose — otherwise a plain follow-up * question after the plan finished (e.g. "what do you know so far") keeps * getting pushed to emit another tool call instead of being answered. */ export declare function planHasOpenWork(status: PlanStatusLike | undefined): boolean; /** Subset of PlanStatus this module needs, kept local to avoid a store import. */ type PlanStatusLike = "draft" | "approved" | "in_progress" | "completed" | "abandoned"; export declare function isAbortError(error: unknown, signal?: AbortSignal): boolean; export declare function shouldEnableImageOcr(prompt: string, hasAttachedImages: boolean, visionProven?: boolean): boolean; export {};