auto-permission-system 3.20.3 → 3.20.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "auto-permission-system",
3
- "version": "3.20.3",
3
+ "version": "3.20.4",
4
4
  "description": "Claude auto mode for Pi & security for Pi. A zero-trust permission system for Pi coding agent powered by Advanced Secure mode to scan files, content, and tools to prevent data breaches.",
5
5
  "type": "module",
6
6
  "author": "Navin Kumar",
@@ -1,4 +1,4 @@
1
- import { existsSync, readdirSync, rmdirSync, statSync, unlinkSync, type Stats } from "node:fs";
1
+ import { existsSync, readdirSync, statSync, unlinkSync, type Stats } from "node:fs";
2
2
  import { join } from "node:path";
3
3
 
4
4
  const BWRAP_READ_ONLY_BIND_PATTERN = /--ro-bind\s+('[^']+'|"[^"]+"|\S+)\s+('[^']+'|"[^"]+"|\S+)/g;
@@ -28,14 +28,6 @@ function removeOrphanedDevice(devicePath: string): void {
28
28
  }
29
29
  }
30
30
 
31
- function removeEmptyDirectory(directoryPath: string): void {
32
- try {
33
- rmdirSync(directoryPath);
34
- } catch {
35
- // safe fallback
36
- }
37
- }
38
-
39
31
  function processDirectoryEntry(entryPath: string, currentDepth: number): void {
40
32
  let entryStats: Stats;
41
33
 
@@ -50,9 +42,8 @@ function processDirectoryEntry(entryPath: string, currentDepth: number): void {
50
42
  return;
51
43
  }
52
44
 
53
- if (entryStats.isDirectory()) {
45
+ if (entryStats.isDirectory() && currentDepth < MAXIMUM_ARTIFACT_CLEANUP_DEPTH) {
54
46
  cleanupWorkspaceArtifacts(entryPath, currentDepth + 1);
55
- removeEmptyDirectory(entryPath);
56
47
  }
57
48
  }
58
49
 
@@ -167,7 +167,6 @@ export function createSandboxedBashOps(options?: SandboxedBashOptions): BashOper
167
167
 
168
168
  cleanupBridges();
169
169
  SandboxManager.cleanupAfterCommand();
170
- cleanupWorkspaceArtifacts(workingDirectory);
171
170
  reject(error);
172
171
  });
173
172
 
@@ -194,7 +193,6 @@ export function createSandboxedBashOps(options?: SandboxedBashOptions): BashOper
194
193
  cleanupBridges();
195
194
 
196
195
  SandboxManager.cleanupAfterCommand();
197
- cleanupWorkspaceArtifacts(workingDirectory);
198
196
 
199
197
  const outcome = await handleBlockedBashExecution({
200
198
  exitCode,