@kangyishuai/dsh-session-delete 0.5.0 → 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.
- package/README.md +33 -25
- package/README.zh-CN.md +25 -17
- package/lib/agent-tool.js +39 -3
- package/lib/audit.js +1 -1
- package/lib/client.js +1061 -153
- package/lib/operations.js +496 -147
- package/lib/recovery.js +477 -0
- package/lib/refs.js +217 -6
- package/lib/restore.js +187 -0
- package/lib/service.js +105 -0
- package/lib/trash.js +157 -14
- package/lib/workspace-state.js +63 -0
- package/locale/en.json +23 -2
- package/locale/zh.json +23 -2
- package/package.json +1 -1
package/lib/trash.js
CHANGED
|
@@ -2,7 +2,17 @@
|
|
|
2
2
|
// 回收站:原子移动 + meta.json + 恢复 + 彻底删除。
|
|
3
3
|
// 回收站目录固定放在数据根下(同卷,rename 才是 O(1)),陌生条目一律保留并告警。
|
|
4
4
|
import { randomUUID } from "node:crypto";
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
cp,
|
|
7
|
+
mkdir,
|
|
8
|
+
readdir,
|
|
9
|
+
readFile,
|
|
10
|
+
readlink,
|
|
11
|
+
rename,
|
|
12
|
+
rm,
|
|
13
|
+
stat,
|
|
14
|
+
writeFile,
|
|
15
|
+
} from "node:fs/promises";
|
|
6
16
|
import { dirname, join } from "node:path";
|
|
7
17
|
import { isInside, requireInside, requireSessionId, trashRoot } from "./paths.js";
|
|
8
18
|
|
|
@@ -75,23 +85,147 @@ export function entryMetaPath(dataRoot, entryId) {
|
|
|
75
85
|
}
|
|
76
86
|
|
|
77
87
|
/**
|
|
78
|
-
*
|
|
88
|
+
* 把一棵目录树读成「相对路径 → 条目指纹」的表,用来逐项比对 cp 的结果。
|
|
89
|
+
* 指纹包含类型与大小;符号链接比对链接文本,不跟随(cp 默认也不跟随)。
|
|
90
|
+
* @param {string} root
|
|
91
|
+
* @returns {Promise<Map<string, string>>}
|
|
92
|
+
*/
|
|
93
|
+
async function treeFingerprints(root) {
|
|
94
|
+
/** @type {Map<string, string>} */
|
|
95
|
+
const out = new Map();
|
|
96
|
+
/** @type {{ dir: string, prefix: string }[]} */
|
|
97
|
+
const stack = [{ dir: root, prefix: "" }];
|
|
98
|
+
while (stack.length > 0) {
|
|
99
|
+
const next = /** @type {{ dir: string, prefix: string }} */ (stack.pop());
|
|
100
|
+
let entries;
|
|
101
|
+
try {
|
|
102
|
+
entries = await readdir(next.dir, { withFileTypes: true });
|
|
103
|
+
} catch (error) {
|
|
104
|
+
out.set(
|
|
105
|
+
`${next.prefix || "."}/`,
|
|
106
|
+
`unreadable:${/** @type {any} */ (error)?.code ?? "error"}`,
|
|
107
|
+
);
|
|
108
|
+
continue;
|
|
109
|
+
}
|
|
110
|
+
for (const entry of entries) {
|
|
111
|
+
const rel = next.prefix ? `${next.prefix}/${entry.name}` : entry.name;
|
|
112
|
+
const full = join(next.dir, entry.name);
|
|
113
|
+
if (entry.isSymbolicLink()) {
|
|
114
|
+
const target = await readlink(full).catch(() => "?");
|
|
115
|
+
out.set(rel, `link:${target}`);
|
|
116
|
+
} else if (entry.isDirectory()) {
|
|
117
|
+
stack.push({ dir: full, prefix: rel });
|
|
118
|
+
} else if (entry.isFile()) {
|
|
119
|
+
const info = await stat(full).catch(() => null);
|
|
120
|
+
out.set(rel, `file:${info?.size ?? -1}`);
|
|
121
|
+
} else {
|
|
122
|
+
out.set(rel, "other");
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
return out;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* 校验「目标目录是源目录的完整副本」:条目集合、每项类型/大小、总字节数都要一致。
|
|
131
|
+
* 跨卷回退在删源之前必须过这一关——只判断「目标是目录」等于没有校验。
|
|
79
132
|
* @param {string} source
|
|
80
133
|
* @param {string} target
|
|
134
|
+
* @returns {Promise<{ ok: boolean, sourceFiles: number, targetFiles: number, sourceBytes: number,
|
|
135
|
+
* targetBytes: number, missing: string[], extra: string[], differing: string[] }>}
|
|
136
|
+
*/
|
|
137
|
+
export async function verifyDirectoryCopy(source, target) {
|
|
138
|
+
const [sourceTree, targetTree] = await Promise.all([
|
|
139
|
+
treeFingerprints(source),
|
|
140
|
+
treeFingerprints(target),
|
|
141
|
+
]);
|
|
142
|
+
/** @type {string[]} */
|
|
143
|
+
const missing = [];
|
|
144
|
+
/** @type {string[]} */
|
|
145
|
+
const extra = [];
|
|
146
|
+
/** @type {string[]} */
|
|
147
|
+
const differing = [];
|
|
148
|
+
/** @param {string} fingerprint */
|
|
149
|
+
const sizeOf = (fingerprint) => {
|
|
150
|
+
const match = /^file:(\d+)$/u.exec(fingerprint);
|
|
151
|
+
return match ? Number(match[1]) : 0;
|
|
152
|
+
};
|
|
153
|
+
let sourceBytes = 0;
|
|
154
|
+
let sourceFiles = 0;
|
|
155
|
+
let targetBytes = 0;
|
|
156
|
+
let targetFiles = 0;
|
|
157
|
+
for (const [rel, fingerprint] of sourceTree) {
|
|
158
|
+
if (fingerprint.startsWith("file:")) {
|
|
159
|
+
sourceFiles += 1;
|
|
160
|
+
sourceBytes += sizeOf(fingerprint);
|
|
161
|
+
}
|
|
162
|
+
if (!targetTree.has(rel)) missing.push(rel);
|
|
163
|
+
else if (targetTree.get(rel) !== fingerprint) differing.push(rel);
|
|
164
|
+
}
|
|
165
|
+
for (const [rel, fingerprint] of targetTree) {
|
|
166
|
+
if (fingerprint.startsWith("file:")) {
|
|
167
|
+
targetFiles += 1;
|
|
168
|
+
targetBytes += sizeOf(fingerprint);
|
|
169
|
+
}
|
|
170
|
+
if (!sourceTree.has(rel)) extra.push(rel);
|
|
171
|
+
}
|
|
172
|
+
return {
|
|
173
|
+
ok: missing.length === 0 && extra.length === 0 && differing.length === 0,
|
|
174
|
+
sourceFiles,
|
|
175
|
+
targetFiles,
|
|
176
|
+
sourceBytes,
|
|
177
|
+
targetBytes,
|
|
178
|
+
missing,
|
|
179
|
+
extra,
|
|
180
|
+
differing,
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* 原子移动目录。同卷 rename;跨卷(EXDEV)退化为 cp → **逐项校验** → 删源。
|
|
186
|
+
* 校验不过就不删源:宁可留下「源还在、目标副本不完整」,也不能制造唯一副本不完整的状态。
|
|
187
|
+
* @param {string} source
|
|
188
|
+
* @param {string} target
|
|
189
|
+
* @param {{ renameImpl?: (source: string, target: string) => Promise<void>,
|
|
190
|
+
* cpImpl?: (source: string, target: string, options?: any) => Promise<void> }} [deps]
|
|
191
|
+
* 仅供单测注入(跨卷路径无法在本机复现)。
|
|
81
192
|
* @returns {Promise<void>}
|
|
82
193
|
*/
|
|
83
|
-
async function moveDirectory(source, target) {
|
|
194
|
+
export async function moveDirectory(source, target, deps = {}) {
|
|
195
|
+
const renameImpl = deps.renameImpl ?? rename;
|
|
196
|
+
const cpImpl = deps.cpImpl ?? cp;
|
|
84
197
|
try {
|
|
85
|
-
await
|
|
198
|
+
await renameImpl(source, target);
|
|
86
199
|
return;
|
|
87
200
|
} catch (error) {
|
|
88
201
|
const code = /** @type {any} */ (error)?.code;
|
|
89
202
|
if (code !== "EXDEV") throw error;
|
|
90
203
|
}
|
|
91
|
-
await
|
|
92
|
-
const
|
|
93
|
-
if (!
|
|
94
|
-
|
|
204
|
+
await cpImpl(source, target, { recursive: true, errorOnExist: true, force: false });
|
|
205
|
+
const verified = await verifyDirectoryCopy(source, target);
|
|
206
|
+
if (!verified.ok) {
|
|
207
|
+
// 目标副本是本次调用新造的(调用方都先确认过目标不存在),删掉它只是恢复原状;
|
|
208
|
+
// 源始终是权威副本,任何情况下都不删。清理失败就写进错误里,不当静默成功。
|
|
209
|
+
/** @type {string | null} */
|
|
210
|
+
let cleanupError = null;
|
|
211
|
+
try {
|
|
212
|
+
await rm(target, { recursive: true, force: true });
|
|
213
|
+
} catch (error) {
|
|
214
|
+
cleanupError = error instanceof Error ? error.message : String(error);
|
|
215
|
+
}
|
|
216
|
+
throw Object.assign(
|
|
217
|
+
new Error(
|
|
218
|
+
`cross-device copy verification failed: ${verified.missing.length} missing, ` +
|
|
219
|
+
`${verified.extra.length} extra, ${verified.differing.length} differing ` +
|
|
220
|
+
`(${verified.sourceFiles} files / ${verified.sourceBytes} B expected, ` +
|
|
221
|
+
`got ${verified.targetFiles} files / ${verified.targetBytes} B)`,
|
|
222
|
+
),
|
|
223
|
+
{
|
|
224
|
+
code: "session-delete/copy-verify-failed",
|
|
225
|
+
details: { ...verified, cleanupError },
|
|
226
|
+
},
|
|
227
|
+
);
|
|
228
|
+
}
|
|
95
229
|
await rm(source, { recursive: true, force: false });
|
|
96
230
|
}
|
|
97
231
|
|
|
@@ -218,20 +352,29 @@ export async function restoreEntry({ dataRoot, entryId, destinationDir }) {
|
|
|
218
352
|
|
|
219
353
|
await mkdir(dirname(destination), { recursive: true });
|
|
220
354
|
await moveDirectory(dataDir, destination);
|
|
355
|
+
await finalizeRestoreEntry({ dataRoot, entryId, meta, restoredTo: destination });
|
|
356
|
+
return { meta, restoredTo: destination };
|
|
357
|
+
}
|
|
221
358
|
|
|
359
|
+
/**
|
|
360
|
+
* 恢复的收尾:写一份历史记录(条目被清掉后仍可查),再删除回收站条目目录。
|
|
361
|
+
* 单独抽出来是因为「数据已搬回、条目还没删」正是崩溃后需要补做的那一步。
|
|
362
|
+
* @param {object} options
|
|
363
|
+
* @param {string} options.dataRoot
|
|
364
|
+
* @param {string} options.entryId
|
|
365
|
+
* @param {TrashMeta} options.meta
|
|
366
|
+
* @param {string} options.restoredTo
|
|
367
|
+
* @returns {Promise<void>}
|
|
368
|
+
*/
|
|
369
|
+
export async function finalizeRestoreEntry({ dataRoot, entryId, meta, restoredTo }) {
|
|
222
370
|
const historyDir = join(trashRoot(dataRoot), ".history");
|
|
223
371
|
await mkdir(historyDir, { recursive: true });
|
|
224
372
|
await writeFile(
|
|
225
373
|
join(historyDir, `${entryId}.json`),
|
|
226
|
-
JSON.stringify(
|
|
227
|
-
{ ...meta, restoredAt: new Date().toISOString(), restoredTo: destination },
|
|
228
|
-
null,
|
|
229
|
-
2,
|
|
230
|
-
),
|
|
374
|
+
JSON.stringify({ ...meta, restoredAt: new Date().toISOString(), restoredTo }, null, 2),
|
|
231
375
|
"utf8",
|
|
232
376
|
);
|
|
233
377
|
await rm(entryDir(dataRoot, entryId), { recursive: true, force: true });
|
|
234
|
-
return { meta, restoredTo: destination };
|
|
235
378
|
}
|
|
236
379
|
|
|
237
380
|
/**
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
// 工作区存储的只读快照。归档/置顶集合**没有公开的读接口**,只能读 storages/workspace.json:
|
|
3
|
+
// 这是文件级兜底,不是宿主契约(见 docs/runtime 里 workspaceRegistry 一节)。
|
|
4
|
+
// 只读、绝不手改;读不到就如实返回 ok:false,调用方据此降级为「状态未知」。
|
|
5
|
+
import { readFile } from "node:fs/promises";
|
|
6
|
+
import { join } from "node:path";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @typedef {object} WorkspaceState
|
|
10
|
+
* @property {boolean} ok
|
|
11
|
+
* @property {string} [reason]
|
|
12
|
+
* @property {string[]} archivedIds
|
|
13
|
+
* @property {string[]} pinnedIds
|
|
14
|
+
* @property {{ id: string, sessionIds: string[] }[]} workspaces
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* @param {string} dataRoot
|
|
19
|
+
* @returns {Promise<WorkspaceState>}
|
|
20
|
+
*/
|
|
21
|
+
export async function readWorkspaceState(dataRoot) {
|
|
22
|
+
const file = join(dataRoot, "storages", "workspace.json");
|
|
23
|
+
let parsed;
|
|
24
|
+
try {
|
|
25
|
+
parsed = JSON.parse(await readFile(file, "utf8"));
|
|
26
|
+
} catch (error) {
|
|
27
|
+
return {
|
|
28
|
+
ok: false,
|
|
29
|
+
reason: `无法读取 ${file}:${error instanceof Error ? error.message : String(error)}`,
|
|
30
|
+
archivedIds: [],
|
|
31
|
+
pinnedIds: [],
|
|
32
|
+
workspaces: [],
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
const global = parsed?.global ?? {};
|
|
36
|
+
const tables = parsed?.tables ?? {};
|
|
37
|
+
const workspaces = Object.entries(tables.workspaces ?? {}).map(([id, value]) => ({
|
|
38
|
+
id,
|
|
39
|
+
sessionIds: Array.isArray(/** @type {any} */ (value)?.sessionIds)
|
|
40
|
+
? /** @type {any} */ (value).sessionIds.map(String)
|
|
41
|
+
: [],
|
|
42
|
+
}));
|
|
43
|
+
return {
|
|
44
|
+
ok: true,
|
|
45
|
+
archivedIds: Array.isArray(global.archivedSessionIds)
|
|
46
|
+
? global.archivedSessionIds.map(String)
|
|
47
|
+
: [],
|
|
48
|
+
pinnedIds: Array.isArray(global.pinnedSessionIds) ? global.pinnedSessionIds.map(String) : [],
|
|
49
|
+
workspaces,
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* 会话是否在置顶集合里。读不到存储时返回 null(未知 ≠ 未置顶)。
|
|
55
|
+
* @param {string} dataRoot
|
|
56
|
+
* @param {string} sessionId
|
|
57
|
+
* @returns {Promise<boolean | null>}
|
|
58
|
+
*/
|
|
59
|
+
export async function readPinnedFlag(dataRoot, sessionId) {
|
|
60
|
+
const state = await readWorkspaceState(dataRoot);
|
|
61
|
+
if (!state.ok) return null;
|
|
62
|
+
return state.pinnedIds.includes(sessionId);
|
|
63
|
+
}
|
package/locale/en.json
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
"sessionDelete": {
|
|
3
3
|
"batch.done": "Done: {ok}/{total} succeeded",
|
|
4
4
|
"batch.failed": "{n} failed; kept selected",
|
|
5
|
+
"batch.partial": "{n} restored with incomplete references",
|
|
5
6
|
"batch.progress": "{done}/{total} done",
|
|
6
7
|
"batch.stop": "Stop",
|
|
7
8
|
"confirm.blocked": "Cannot delete right now: {reason}",
|
|
@@ -37,7 +38,7 @@
|
|
|
37
38
|
"panel.cancelConfirm": "Cancel",
|
|
38
39
|
"panel.close": "Close",
|
|
39
40
|
"panel.empty": "The trash is empty.",
|
|
40
|
-
"panel.pending": "{n} unfinished operation(s)",
|
|
41
|
+
"panel.pending": "{n} unfinished operation(s) (reconciled on next start; leftovers need review)",
|
|
41
42
|
"panel.purge": "Delete for good",
|
|
42
43
|
"panel.purgeConfirm": "Cannot be undone — confirm",
|
|
43
44
|
"panel.readOnly": "Read-only: this DSH version is missing required APIs; deletion is disabled.",
|
|
@@ -46,6 +47,18 @@
|
|
|
46
47
|
"panel.title": "Session trash",
|
|
47
48
|
"panel.trashedAt": "{time}",
|
|
48
49
|
"panel.unknown": "{n} unrecognized director(ies) kept",
|
|
50
|
+
"receipt.refs": "References",
|
|
51
|
+
"receipt.checks": "Checks",
|
|
52
|
+
"receipt.removed": "References cleaned",
|
|
53
|
+
"receipt.summary.ok": "all passed",
|
|
54
|
+
"receipt.summary.partial": "{n} did not pass",
|
|
55
|
+
"restore.busyHint": "If sending is rejected (session/agent-busy), the host still marks this session busy: restart DSH, or continue in a new session.",
|
|
56
|
+
"restore.detail.retried": "retried once automatically",
|
|
57
|
+
"restore.detail.retry": "Retry the failed references",
|
|
58
|
+
"restore.detail.retrying": "Retrying…",
|
|
59
|
+
"restore.detail.title": "References and checks that did not pass",
|
|
60
|
+
"restore.retry.ok": "Re-check passed: every reference and check recovered",
|
|
61
|
+
"restore.retry.partial": "{n} still did not pass after the re-check",
|
|
49
62
|
"settings.audit.empty": "No audit entries yet.",
|
|
50
63
|
"settings.audit.path": "Log file: {path}",
|
|
51
64
|
"settings.audit.title": "Audit log",
|
|
@@ -59,9 +72,11 @@
|
|
|
59
72
|
"settings.health.clean": "Clean {n}",
|
|
60
73
|
"settings.health.cleanConfirm": "Clean {n} dangling reference(s)? Bookkeeping only.",
|
|
61
74
|
"settings.health.cleaned": "Cleaned {n}",
|
|
62
|
-
"settings.health.desc": "Checks bookkeeping that points at sessions that no longer exist (read-only).",
|
|
75
|
+
"settings.health.desc": "Checks bookkeeping that points at sessions that no longer exist (read-only; run it on demand).",
|
|
76
|
+
"settings.health.idle": "No check yet. Run it to scan the whole library (read-only).",
|
|
63
77
|
"settings.health.items": "{n} to clean",
|
|
64
78
|
"settings.health.ok": "No dangling references found.",
|
|
79
|
+
"settings.health.run": "Run check",
|
|
65
80
|
"settings.health.title": "Health",
|
|
66
81
|
"settings.health.unavailable": "Cannot run the check: {reason}",
|
|
67
82
|
"settings.loading": "Loading…",
|
|
@@ -75,6 +90,12 @@
|
|
|
75
90
|
"shortcut.noSession": "No current session to delete",
|
|
76
91
|
"shortcut.workspace": "Delete every session in the current workspace…",
|
|
77
92
|
"toast.failed": "Operation failed: {message}",
|
|
93
|
+
"toast.restorePartial": "Session restored, but {n} reference/check(s) did not pass (see the receipt)",
|
|
94
|
+
"toast.restoredMany": "Restored {n} session(s); refreshing the list",
|
|
95
|
+
"toast.restored": "Session restored — reopening it",
|
|
96
|
+
"toast.trashedCurrent": "Moved to the trash — restore it from there",
|
|
97
|
+
"toast.trashPartial": "Moved to the trash, but cleanup did not finish: {message} (the session is restorable)",
|
|
98
|
+
"toast.undoFailed": "Undo failed: {message}",
|
|
78
99
|
"toast.workspace.done": "Moved {ok}/{total} session(s) to the trash",
|
|
79
100
|
"trash.purgeMany": "Delete {n} permanently",
|
|
80
101
|
"trash.purgeManyConfirm": "Permanently delete {n}? This cannot be undone",
|
package/locale/zh.json
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
"sessionDelete": {
|
|
3
3
|
"batch.done": "完成:{ok}/{total} 成功",
|
|
4
4
|
"batch.failed": "{n} 个失败,已保留选中",
|
|
5
|
+
"batch.partial": "其中 {n} 条引用未还原",
|
|
5
6
|
"batch.progress": "处理中 {done}/{total}",
|
|
6
7
|
"batch.stop": "停止",
|
|
7
8
|
"confirm.blocked": "暂时无法删除:{reason}",
|
|
@@ -37,7 +38,7 @@
|
|
|
37
38
|
"panel.cancelConfirm": "取消",
|
|
38
39
|
"panel.close": "关闭",
|
|
39
40
|
"panel.empty": "回收站是空的。",
|
|
40
|
-
"panel.pending": "{n}
|
|
41
|
+
"panel.pending": "{n} 个未完成的操作(重启后自动对账;仍未处理需人工核对)",
|
|
41
42
|
"panel.purge": "彻底删除",
|
|
42
43
|
"panel.purgeConfirm": "不可恢复,确认",
|
|
43
44
|
"panel.readOnly": "只读模式:当前 DSH 版本缺少依赖接口,删除功能已禁用。",
|
|
@@ -46,6 +47,18 @@
|
|
|
46
47
|
"panel.title": "会话回收站",
|
|
47
48
|
"panel.trashedAt": "{time}",
|
|
48
49
|
"panel.unknown": "{n} 个无法识别的目录已保留",
|
|
50
|
+
"receipt.refs": "引用",
|
|
51
|
+
"receipt.checks": "校验",
|
|
52
|
+
"receipt.removed": "已清理的引用",
|
|
53
|
+
"receipt.summary.ok": "全部通过",
|
|
54
|
+
"receipt.summary.partial": "{n} 处未通过",
|
|
55
|
+
"restore.busyHint": "若发送被拒(提示 session/agent-busy),说明宿主还把这个会话标记为忙碌:重启 DSH,或新建会话继续。",
|
|
56
|
+
"restore.detail.retried": "已自动重试一次",
|
|
57
|
+
"restore.detail.retry": "重试未通过的引用",
|
|
58
|
+
"restore.detail.retrying": "正在重试…",
|
|
59
|
+
"restore.detail.title": "未通过的引用与校验",
|
|
60
|
+
"restore.retry.ok": "重检通过:引用与校验全部恢复",
|
|
61
|
+
"restore.retry.partial": "重检后仍有 {n} 处未通过",
|
|
49
62
|
"settings.audit.empty": "还没有审计记录。",
|
|
50
63
|
"settings.audit.path": "日志文件:{path}",
|
|
51
64
|
"settings.audit.title": "审计日志",
|
|
@@ -59,9 +72,11 @@
|
|
|
59
72
|
"settings.health.clean": "清理 {n} 条",
|
|
60
73
|
"settings.health.cleanConfirm": "确认清理 {n} 条?只动登记表,不碰会话文件",
|
|
61
74
|
"settings.health.cleaned": "已清理 {n} 条",
|
|
62
|
-
"settings.health.desc": "
|
|
75
|
+
"settings.health.desc": "检查指向已不存在会话的登记条目(只读;需要时手动运行)。",
|
|
76
|
+
"settings.health.idle": "尚未体检。点「运行体检」会扫描全库会话(只读)。",
|
|
63
77
|
"settings.health.items": "{n} 条待清理",
|
|
64
78
|
"settings.health.ok": "未发现失效引用。",
|
|
79
|
+
"settings.health.run": "运行体检",
|
|
65
80
|
"settings.health.title": "体检",
|
|
66
81
|
"settings.health.unavailable": "无法体检:{reason}",
|
|
67
82
|
"settings.loading": "读取中…",
|
|
@@ -75,6 +90,12 @@
|
|
|
75
90
|
"shortcut.noSession": "没有可以删除的当前会话",
|
|
76
91
|
"shortcut.workspace": "删除当前工作区的全部会话…",
|
|
77
92
|
"toast.failed": "操作失败:{message}",
|
|
93
|
+
"toast.restorePartial": "会话已恢复,但 {n} 处引用/校验未通过(详见操作回执)",
|
|
94
|
+
"toast.restoredMany": "已恢复 {n} 个会话,正在刷新列表",
|
|
95
|
+
"toast.restored": "会话已恢复,正在重新打开",
|
|
96
|
+
"toast.trashedCurrent": "已移入回收站,可在回收站恢复",
|
|
97
|
+
"toast.trashPartial": "已移入回收站,但收尾未完成:{message}(会话可在回收站恢复)",
|
|
98
|
+
"toast.undoFailed": "撤销失败:{message}",
|
|
78
99
|
"toast.workspace.done": "已移入回收站 {ok}/{total} 个会话",
|
|
79
100
|
"trash.purgeMany": "彻底删除({n})",
|
|
80
101
|
"trash.purgeManyConfirm": "彻底删除 {n} 个?不可恢复",
|