/** * Workspace write guard + catastrophic-command guard. * * Enforced in code (not just prompt): write/edit targets outside the * allow-listed roots are blocked with an instructive tool error unless the * user opted in via the `allowOutsideWorkspaceWrites` setting. The bash tool * additionally refuses a tiny set of unambiguous filesystem disasters * (recursive force-remove of /, ~, $HOME, the workspace root, a bare drive * root, and mirror force-pushes) until the user explicitly confirms. * * Deliberately narrow: ordinary `rm -rf node_modules`, `git reset --hard`, * etc. stay instructional (ask-first at the prompt level), exactly as today. */ export interface WriteGuardSettings { allowOutsideWorkspaceWrites?: boolean; /** Extra workspace roots added at runtime via `/add-dir`. */ additionalRoots?: string[]; } export interface WriteGuardResult { allowed: boolean; reason?: string; } /** * Decide whether a resolved write/edit target path is allowed. * Allowed by default: under `cwd`, under the OS temp dir, and under the * agent's own state dir (~/.gg) — sessions/plans/settings must keep working. */ export declare function resolveWriteGuard(cwd: string, resolvedPath: string, settings?: WriteGuardSettings): WriteGuardResult; /** * Match only the unambiguous disasters: * - `rm -rf` (any flag spelling including -r -f, -fr, --recursive --force) * targeting /, ~, $HOME, the workspace root, or a bare drive root * - Windows `rd /s /q C:\` (or `rmdir`) * - `git push --force --mirror` (mirror force-push rewrites every ref) * * Returns an error string telling the model to get explicit user confirmation, * or null when the command is not catastrophic. */ export declare function isCatastrophicCommand(command: string, cwd: string): string | null; //# sourceMappingURL=workspace-guard.d.ts.map