(targetPath, mode)
| 38 | global.rpcEmit = rpcEmit; |
| 39 | |
| 40 | function isPathAllowed(targetPath, mode) { |
| 41 | if (!policy.fs) return false; |
| 42 | const resolved = path.resolve(targetPath); |
| 43 | const scopes = mode === 'write' ? (policy.fs.write || []) : (policy.fs.read || []); |
| 44 | return scopes.some((scope) => resolved.startsWith(path.resolve(scope))); |
| 45 | } |
| 46 | |
| 47 | function loadStorage() { |
| 48 | try { |