@mmmbuto/nexuscli 0.5.9 → 0.6.0
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.
|
@@ -58,6 +58,26 @@ class SessionManager {
|
|
|
58
58
|
return true; // Always trust DB for exec-mode CLI sessions
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
+
// For Claude: search ALL project folders (session might be in different workspace)
|
|
62
|
+
if (normalizedEngine === 'claude') {
|
|
63
|
+
try {
|
|
64
|
+
const projectsDir = SESSION_DIRS.claude;
|
|
65
|
+
if (fs.existsSync(projectsDir)) {
|
|
66
|
+
const dirs = fs.readdirSync(projectsDir);
|
|
67
|
+
for (const dir of dirs) {
|
|
68
|
+
const sessionFile = path.join(projectsDir, dir, `${sessionId}.jsonl`);
|
|
69
|
+
if (fs.existsSync(sessionFile)) {
|
|
70
|
+
console.log(`[SessionManager] Claude session found: ${sessionFile}`);
|
|
71
|
+
return true;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
} catch (err) {
|
|
76
|
+
console.warn(`[SessionManager] Claude session lookup failed:`, err.message);
|
|
77
|
+
}
|
|
78
|
+
return false;
|
|
79
|
+
}
|
|
80
|
+
|
|
61
81
|
try {
|
|
62
82
|
const sessionPath = this.getSessionFilePath(sessionId, engine, workspacePath);
|
|
63
83
|
if (!sessionPath) return false;
|
|
@@ -165,12 +185,13 @@ class SessionManager {
|
|
|
165
185
|
}
|
|
166
186
|
|
|
167
187
|
// 2. Check DB for existing session mapping
|
|
188
|
+
// Note: Frontend may send sessionId as conversationId, so check both columns
|
|
168
189
|
try {
|
|
169
190
|
const stmt = prepare(`
|
|
170
191
|
SELECT id, workspace_path FROM sessions
|
|
171
|
-
WHERE conversation_id = ? AND engine = ?
|
|
192
|
+
WHERE (conversation_id = ? OR id = ?) AND engine = ?
|
|
172
193
|
`);
|
|
173
|
-
const row = stmt.get(conversationId, normalizedEngine);
|
|
194
|
+
const row = stmt.get(conversationId, conversationId, normalizedEngine);
|
|
174
195
|
|
|
175
196
|
if (row) {
|
|
176
197
|
// 3. Verify session file exists on filesystem
|