waypoint-codex 1.0.4 → 1.0.5
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
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import { existsSync, mkdirSync, readFileSync, readdirSync, realpathSync, statSync, writeFileSync } from "node:fs";
|
|
3
|
+
import { existsSync, lstatSync, mkdirSync, readFileSync, readdirSync, realpathSync, statSync, writeFileSync } from "node:fs";
|
|
4
4
|
import { execFileSync } from "node:child_process";
|
|
5
5
|
import os from "node:os";
|
|
6
6
|
import path from "node:path";
|
|
@@ -172,19 +172,29 @@ function isWithinPath(childPath, parentPath) {
|
|
|
172
172
|
|
|
173
173
|
function collectSessionFiles(rootDir) {
|
|
174
174
|
const files = [];
|
|
175
|
+
const visitedDirs = new Set();
|
|
175
176
|
|
|
176
177
|
function walk(currentDir) {
|
|
177
178
|
if (!existsSync(currentDir)) {
|
|
178
179
|
return;
|
|
179
180
|
}
|
|
181
|
+
const resolvedCurrentDir = safeRealpath(currentDir);
|
|
182
|
+
if (!resolvedCurrentDir || visitedDirs.has(resolvedCurrentDir)) {
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
visitedDirs.add(resolvedCurrentDir);
|
|
186
|
+
|
|
180
187
|
for (const entry of readdirSync(currentDir)) {
|
|
181
188
|
const fullPath = path.join(currentDir, entry);
|
|
182
189
|
let stats;
|
|
183
190
|
try {
|
|
184
|
-
stats =
|
|
191
|
+
stats = lstatSync(fullPath);
|
|
185
192
|
} catch {
|
|
186
193
|
continue;
|
|
187
194
|
}
|
|
195
|
+
if (stats.isSymbolicLink()) {
|
|
196
|
+
continue;
|
|
197
|
+
}
|
|
188
198
|
if (stats.isDirectory()) {
|
|
189
199
|
walk(fullPath);
|
|
190
200
|
} else if (entry.endsWith(".jsonl")) {
|