pi-agent-squad 0.8.1 → 0.8.3
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/message.ts +6 -18
- package/package.json +1 -1
package/message.ts
CHANGED
|
@@ -117,24 +117,12 @@ function replyPath(dir: string, id: string): string {
|
|
|
117
117
|
}
|
|
118
118
|
|
|
119
119
|
export function ensureDir(dir: string): void {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
const st = fs.lstatSync(current);
|
|
127
|
-
if (st.isSymbolicLink() || !st.isDirectory()) {
|
|
128
|
-
throw new Error(`Message channel path is not a real directory: ${current}`);
|
|
129
|
-
}
|
|
130
|
-
} catch (error) {
|
|
131
|
-
if ((error as NodeJS.ErrnoException).code !== "ENOENT") throw error;
|
|
132
|
-
fs.mkdirSync(current, { mode: 0o700 });
|
|
133
|
-
const created = fs.lstatSync(current);
|
|
134
|
-
if (created.isSymbolicLink() || !created.isDirectory()) {
|
|
135
|
-
throw new Error(`Message channel path is not a real directory: ${current}`);
|
|
136
|
-
}
|
|
137
|
-
}
|
|
120
|
+
// macOS commonly exposes /var as a system symlink (/private/var), so
|
|
121
|
+
// validating every ancestor would reject otherwise safe channel paths.
|
|
122
|
+
fs.mkdirSync(dir, { recursive: true, mode: 0o700 });
|
|
123
|
+
const st = fs.lstatSync(dir);
|
|
124
|
+
if (st.isSymbolicLink() || !st.isDirectory()) {
|
|
125
|
+
throw new Error(`Message channel path is not a real directory: ${dir}`);
|
|
138
126
|
}
|
|
139
127
|
}
|
|
140
128
|
|