@aiplumber/session-recall 1.9.2 → 1.9.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/package.json +1 -1
- package/session-recall +26 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aiplumber/session-recall",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.3",
|
|
4
4
|
"description": "Pull context from previous Claude Code sessions. Sessions end, context resets - this tool lets you continue where you left off.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"session-recall": "./session-recall"
|
package/session-recall
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
const VERSION = '1.9.
|
|
3
|
+
const VERSION = '1.9.3';
|
|
4
4
|
|
|
5
5
|
const fs = require('fs');
|
|
6
6
|
const path = require('path');
|
|
@@ -1336,9 +1336,32 @@ async function cmdLast(arg1, arg2, opts) {
|
|
|
1336
1336
|
|
|
1337
1337
|
// Handle --compactions mode: show last N compaction phases instead of sessions
|
|
1338
1338
|
if (opts.compactionPhases) {
|
|
1339
|
-
|
|
1339
|
+
let session = selected[0]; // Use only the most recent session
|
|
1340
1340
|
// Use pre-scanned markers if available (for large files), otherwise scan now
|
|
1341
|
-
|
|
1341
|
+
let compactions = session.compactionMarkers || scanCompactionMarkers(session.msgs);
|
|
1342
|
+
|
|
1343
|
+
// If no compactions in current session, check previous session (new session fallback)
|
|
1344
|
+
if (compactions.length === 0 && inactiveSessions.length > 1) {
|
|
1345
|
+
const prevSession = inactiveSessions[1];
|
|
1346
|
+
// Load previous session if not already loaded
|
|
1347
|
+
if (!prevSession.msgs) {
|
|
1348
|
+
const stats = fs.statSync(prevSession.filePath);
|
|
1349
|
+
const sizeMB = stats.size / (1024 * 1024);
|
|
1350
|
+
if (sizeMB > 100) {
|
|
1351
|
+
prevSession.compactionMarkers = await streamScanCompactions(prevSession.filePath);
|
|
1352
|
+
prevSession.msgs = await streamReadJsonl(prevSession.filePath);
|
|
1353
|
+
} else {
|
|
1354
|
+
prevSession.msgs = readJsonl(prevSession.filePath);
|
|
1355
|
+
}
|
|
1356
|
+
}
|
|
1357
|
+
const prevCompactions = prevSession.compactionMarkers || scanCompactionMarkers(prevSession.msgs);
|
|
1358
|
+
if (prevCompactions.length > 0) {
|
|
1359
|
+
console.log('[session-recall v' + VERSION + '] No compactions in current session - using previous session');
|
|
1360
|
+
console.log('---');
|
|
1361
|
+
session = prevSession;
|
|
1362
|
+
compactions = prevCompactions;
|
|
1363
|
+
}
|
|
1364
|
+
}
|
|
1342
1365
|
|
|
1343
1366
|
if (compactions.length === 0) {
|
|
1344
1367
|
console.log('[session-recall v' + VERSION + '] No compaction events found - showing full session as single phase');
|