feat(policy): repurpose "Always Allow" persistence to workspace level (#19707)

This commit is contained in:
Abhijit Balaji
2026-02-20 14:07:20 -08:00
committed by GitHub
parent b48970da15
commit c5baf39dbd
6 changed files with 113 additions and 58 deletions
+9
View File
@@ -23,6 +23,8 @@ const TMP_DIR_NAME = 'tmp';
const BIN_DIR_NAME = 'bin';
const AGENTS_DIR_NAME = '.agents';
export const AUTO_SAVED_POLICY_FILENAME = 'auto-saved.toml';
export class Storage {
private readonly targetDir: string;
private readonly sessionId: string | undefined;
@@ -154,6 +156,13 @@ export class Storage {
return path.join(this.getGeminiDir(), 'policies');
}
getAutoSavedPolicyPath(): string {
return path.join(
this.getWorkspacePoliciesDir(),
AUTO_SAVED_POLICY_FILENAME,
);
}
ensureProjectTempDirExists(): void {
fs.mkdirSync(this.getProjectTempDir(), { recursive: true });
}