getprismo 0.1.1 → 0.1.2
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/lib/prismo-dev-scan.js +19 -6
- package/package.json +1 -1
package/lib/prismo-dev-scan.js
CHANGED
|
@@ -1835,15 +1835,27 @@ function getCodexSessionFiles() {
|
|
|
1835
1835
|
|
|
1836
1836
|
function getClaudeSessionFiles(cwd = process.cwd()) {
|
|
1837
1837
|
const claudeHome = process.env.PRISMO_CLAUDE_HOME || path.join(os.homedir(), ".claude");
|
|
1838
|
-
const
|
|
1839
|
-
|
|
1840
|
-
|
|
1838
|
+
const candidates = [cwd];
|
|
1839
|
+
try {
|
|
1840
|
+
candidates.push(fs.realpathSync(cwd));
|
|
1841
|
+
} catch {
|
|
1842
|
+
// Keep the original cwd candidate when realpath is unavailable.
|
|
1843
|
+
}
|
|
1844
|
+
const files = [];
|
|
1845
|
+
for (const candidate of Array.from(new Set(candidates))) {
|
|
1846
|
+
const safeProject = candidate.replace(/[\/\\:]/g, "-").replace(/^-/, "-");
|
|
1847
|
+
const projectDir = path.join(claudeHome, "projects", safeProject);
|
|
1848
|
+
files.push(...listFilesRecursive(projectDir, (file) => file.endsWith(".jsonl"), 200));
|
|
1849
|
+
}
|
|
1850
|
+
return Array.from(new Set(files));
|
|
1841
1851
|
}
|
|
1842
1852
|
|
|
1843
1853
|
function sameResolvedPath(a, b) {
|
|
1844
1854
|
if (!a || !b) return false;
|
|
1845
1855
|
try {
|
|
1846
|
-
|
|
1856
|
+
const resolvedA = fs.existsSync(a) ? fs.realpathSync(a) : path.resolve(a);
|
|
1857
|
+
const resolvedB = fs.existsSync(b) ? fs.realpathSync(b) : path.resolve(b);
|
|
1858
|
+
return resolvedA === resolvedB;
|
|
1847
1859
|
} catch {
|
|
1848
1860
|
return false;
|
|
1849
1861
|
}
|
|
@@ -2101,10 +2113,11 @@ function runDevFlow(rootDir = process.cwd(), options = {}) {
|
|
|
2101
2113
|
const scanDone = printStep("Scanning repo and local usage", options.json);
|
|
2102
2114
|
const scan = scanRepo(root, { includeUsage: true, usageLimit: options.limit || 3 });
|
|
2103
2115
|
scanDone();
|
|
2116
|
+
const initialContext = createOptimizeContext(root);
|
|
2117
|
+
const scope = initialContext.frameworks.some((name) => ["Next.js", "React", "Vite"].includes(name)) ? "frontend" : null;
|
|
2104
2118
|
const optimizeDone = printStep("Generating compact context files", options.json);
|
|
2105
|
-
const optimize = runOptimize(root);
|
|
2119
|
+
const optimize = runOptimize(root, { scope });
|
|
2106
2120
|
optimizeDone();
|
|
2107
|
-
const scope = optimize.frameworks.some((name) => ["Next.js", "React", "Vite"].includes(name)) ? "frontend" : null;
|
|
2108
2121
|
const ctx = createOptimizeContext(root, scope);
|
|
2109
2122
|
const prompt = renderContextCommand(ctx, scope);
|
|
2110
2123
|
return {
|