oh-my-adhd 0.2.28 → 0.2.30
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/dist/mcp/lib/brain.js +7 -4
- package/package.json +1 -1
package/dist/mcp/lib/brain.js
CHANGED
|
@@ -14,11 +14,14 @@ export const SCHEMA_VERSION = 1;
|
|
|
14
14
|
export const UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
15
15
|
export const SENSITIVE_DIRS = [".ssh", ".aws", ".gnupg", ".kube", ".docker",
|
|
16
16
|
path.join(".config", "git"), path.join(".config", "gh")];
|
|
17
|
-
// Absolute system paths that are sensitive regardless of home dir location
|
|
18
|
-
|
|
17
|
+
// Absolute system paths/dirs that are sensitive regardless of home dir location.
|
|
18
|
+
// Includes both directories (e.g. /etc/ssh) and file paths (e.g. /etc/shadow) —
|
|
19
|
+
// dirname-based matching means a file entry blocks writes to non-existent subdirs of it.
|
|
20
|
+
// macOS /private/etc/* entries handle APFS realpath resolution of /etc/* symlinks.
|
|
21
|
+
const SYSTEM_SENSITIVE_PATHS = [
|
|
19
22
|
"/root/.ssh", "/root/.aws", "/root/.gnupg", "/root/.kube", "/root/.docker",
|
|
20
23
|
"/etc/ssh", "/etc/ssl", "/etc/shadow", "/etc/sudoers",
|
|
21
|
-
"/private/etc/ssh", "/private/etc/ssl",
|
|
24
|
+
"/private/etc/ssh", "/private/etc/ssl", "/private/etc/shadow", "/private/etc/sudoers",
|
|
22
25
|
];
|
|
23
26
|
export async function isSensitivePath(filePath) {
|
|
24
27
|
const homeDir = os.homedir();
|
|
@@ -34,7 +37,7 @@ export async function isSensitivePath(filePath) {
|
|
|
34
37
|
return true;
|
|
35
38
|
// Absolute denylist for paths outside home — case-folded for macOS APFS compatibility
|
|
36
39
|
const realDirLower = realDir.toLowerCase();
|
|
37
|
-
if (
|
|
40
|
+
if (SYSTEM_SENSITIVE_PATHS.some(d => realDirLower === d || realDirLower.startsWith(d + path.posix.sep)))
|
|
38
41
|
return true;
|
|
39
42
|
return false;
|
|
40
43
|
}
|
package/package.json
CHANGED