dsh-recall-plugin 2.4.6 → 2.4.7
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/CHANGELOG.md +28 -0
- package/README.en.md +12 -2
- package/README.md +12 -2
- package/lib/client.js +770 -199
- package/lib/config.js +11 -4
- package/lib/errors.js +3 -0
- package/lib/exclude-patterns.js +2 -1
- package/lib/index.js +31 -4
- package/lib/intent-journal.js +108 -0
- package/lib/maintenance.js +9 -4
- package/lib/routes-core.js +23 -6
- package/lib/routes-manage.js +24 -6
- package/lib/scripts.posix.js +4 -0
- package/lib/scripts.pwsh.js +4 -0
- package/lib/snapshots.js +74 -4
- package/lib/store.js +7 -5
- package/package.json +8 -2
package/lib/store.js
CHANGED
|
@@ -29,7 +29,7 @@ async function resolvePosixHomeBase(deps, inputs) {
|
|
|
29
29
|
}
|
|
30
30
|
function parseCleanupResult(out) {
|
|
31
31
|
const m = String(out || "").match(/CLEANUP_OTHER_INSTANCE\s+(\d+)/);
|
|
32
|
-
if (m) return { otherPid: parseInt(m[1], 10), skippedFresh: false };
|
|
32
|
+
if (m) return { otherPid: parseInt(m[1] ?? "", 10), skippedFresh: false };
|
|
33
33
|
if (String(out || "").indexOf("CLEANUP_SKIPPED_FRESH_LOCK") >= 0) return { otherPid: null, skippedFresh: true };
|
|
34
34
|
return { otherPid: null, skippedFresh: false };
|
|
35
35
|
}
|
|
@@ -84,8 +84,10 @@ async function runViaSpawn(spawn, req) {
|
|
|
84
84
|
const buf = Buffer.isBuffer(chunk) ? chunk : Buffer.from(String(chunk));
|
|
85
85
|
chunks.push(buf);
|
|
86
86
|
total += buf.length;
|
|
87
|
-
while (chunks.length > 1
|
|
88
|
-
|
|
87
|
+
while (chunks.length > 1) {
|
|
88
|
+
const head = chunks[0];
|
|
89
|
+
if (!head || total - head.length <= maxBytes) break;
|
|
90
|
+
total -= head.length;
|
|
89
91
|
chunks.shift();
|
|
90
92
|
}
|
|
91
93
|
},
|
|
@@ -275,7 +277,7 @@ function createRuntime(ctx, config, deps) {
|
|
|
275
277
|
}
|
|
276
278
|
function extractGitDir(command) {
|
|
277
279
|
const m = String(command).match(/(?:^|\n)[ \t]*(?:\$g|g)[ \t]*=[ \t]*'([^']+)/);
|
|
278
|
-
return m ? m[1] : null;
|
|
280
|
+
return m ? m[1] ?? null : null;
|
|
279
281
|
}
|
|
280
282
|
async function cleanupAfterGitFailure(command) {
|
|
281
283
|
if (!command || String(command).indexOf("RECALL_CLEANUP") >= 0) return;
|
|
@@ -487,7 +489,7 @@ function createRuntime(ctx, config, deps) {
|
|
|
487
489
|
const out = scripts.stripBom(await runShell(scripts.ensureGitScript(store, gitExe, config.baseExcludes), { stdoutMaxBytes: 4096 }));
|
|
488
490
|
state.gitReady.add(store.git);
|
|
489
491
|
const m = out.match(/GIT_OK\s+(\d+)/);
|
|
490
|
-
state.gcLastAt.set(store.git, m ? parseInt(m[1], 10) * 1e3 : Date.now());
|
|
492
|
+
state.gcLastAt.set(store.git, m ? parseInt(m[1] ?? "", 10) * 1e3 : Date.now());
|
|
491
493
|
return { ok: true };
|
|
492
494
|
} catch (error) {
|
|
493
495
|
recordError("recall ensureGit failed: " + String(error));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-recall-plugin",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.7",
|
|
4
4
|
"description": "在 DSH 中撤回自己发过的消息:工作区文件与对话历史一起回到那条消息发出之前,消息的文本与附件自动放回输入框,改完即可重发。文件走独立影子 git 快照(不碰项目自身的 git),对话走官方 sessions.fork,原会话归档可找回。",
|
|
5
5
|
"icon": "assets/icon.svg",
|
|
6
6
|
"type": "module",
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
"check:upgrade": "node scripts/check-upgrade.mjs",
|
|
35
35
|
"build": "node scripts/build-host.mjs && node scripts/build-client.mjs",
|
|
36
36
|
"test": "vitest run tests/unit",
|
|
37
|
+
"test:client": "vitest run --config vitest.client.config.ts",
|
|
37
38
|
"test:probe": "vitest run tests/probe",
|
|
38
39
|
"verify:host": "node scripts/verify-host.mjs",
|
|
39
40
|
"typecheck": "tsc --noEmit"
|
|
@@ -65,7 +66,8 @@
|
|
|
65
66
|
"0.1.7-alpha.2": "compatible",
|
|
66
67
|
"0.1.7-rc.1": "compatible",
|
|
67
68
|
"0.1.7-rc.2": "compatible",
|
|
68
|
-
"0.2.0-rc.1": "compatible"
|
|
69
|
+
"0.2.0-rc.1": "compatible",
|
|
70
|
+
"0.2.0-rc.2": "compatible"
|
|
69
71
|
}
|
|
70
72
|
}
|
|
71
73
|
},
|
|
@@ -90,7 +92,11 @@
|
|
|
90
92
|
"@deepseek-ai/schemastery": "^3.18.4",
|
|
91
93
|
"@types/node": "^20.19.43",
|
|
92
94
|
"@types/react": "^18.3.31",
|
|
95
|
+
"@types/react-dom": "^18.3.7",
|
|
93
96
|
"esbuild": "^0.28.1",
|
|
97
|
+
"jsdom": "^29.1.1",
|
|
98
|
+
"react": "^18.3.1",
|
|
99
|
+
"react-dom": "^18.3.1",
|
|
94
100
|
"typescript": "^5.9.3",
|
|
95
101
|
"vitest": "^4.1.11"
|
|
96
102
|
}
|