@suifei/dsh-ai-team 0.4.56 → 0.4.58
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 +20 -0
- package/index.js +9 -0
- package/lib/diaglog.js +5 -2
- package/lib/host/default-workspace.js +16 -5
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.4.58 - 2026-11-12
|
|
4
|
+
|
|
5
|
+
**让「归档修复跑没跑」可判定:`host.repair.ok` 进 errors 白名单**
|
|
6
|
+
|
|
7
|
+
真机 0.4.57 启动后,诊断日志(发布默认 `errors` 级)里**只有**一行 `host.repair.deferred.fail`(boot 瞬间 `workspaceRegistry` 未就绪)。修复后来到底成功没有,`errors` 级看不到——成功行被级别过滤掉了,等于这个关键修复永远处于「不知是否生效」的状态。
|
|
8
|
+
|
|
9
|
+
- 新增成功行 `host.repair.ok`(带 `archived` 数量与前 5 个 sessionId),并在 `isErrorEvent` 白名单里登记,**发布默认级别即落盘**。
|
|
10
|
+
- 端到端验证(`.ptc/rounds/dryrun-real-ledger.mjs`,仓库源码 + 模拟 registry 就绪 + `diagLevel: errors`):日志里只有 `host.repair.ok` 与 `skillopt.skip.fail` 两行,`deferred.fail` 消失。
|
|
11
|
+
- 测试:`node --test` **257 通过 / 1 跳过**(新增 1 例:`isErrorEvent('host.repair.ok')` 为真)。
|
|
12
|
+
|
|
13
|
+
## 0.4.57 - 2026-11-12
|
|
14
|
+
|
|
15
|
+
**修 0.4.56 真机暴露的默认目录建议错误:整个 `~/.dsh` 都排除**
|
|
16
|
+
|
|
17
|
+
重启后实测 `bootstrap.defaultWorkspace` 返回 `C:\Users\SuiFei\.dsh\profiles\desktop`——桌面启动器的宿主进程 cwd 就是 profile 目录,它不等于插件数据目录(`…\.dsh\ai-team\desktop`),于是通过了 0.4.50 的排除规则,被当成「建议工作目录」。把 profile 目录当项目工作区显然是错的。
|
|
18
|
+
|
|
19
|
+
- `resolveDefaultWorkspace` 新增 `excludeRoots`;`boot` 传入 `[dshHome()]`,整棵 `~/.dsh` 都不再作为建议目录。
|
|
20
|
+
- 实测(本机真实路径):`cwd=…\.dsh\profiles\desktop` → 建议退到 `C:\Users\SuiFei`;不传 `excludeRoots` 时仍返回 profile 目录(对照)。
|
|
21
|
+
- 测试:`node --test` **256 通过 / 1 跳过**(新增 1 例:profile 目录被跳过、`~/.dsh` 内无可用目录时返回空、显式配置会被拒绝并继续尝试后续候选)。
|
|
22
|
+
|
|
3
23
|
## 0.4.56 - 2026-11-12
|
|
4
24
|
|
|
5
25
|
**0.4.55 被 npm 暂存审查卡住,改用新版本号发布同一份代码**
|
package/index.js
CHANGED
|
@@ -190,6 +190,8 @@ async function boot(diag, config = {}) {
|
|
|
190
190
|
cwd: process.cwd(),
|
|
191
191
|
home: homedir(),
|
|
192
192
|
dataDir,
|
|
193
|
+
// 整个 ~/.dsh 都不能当工作目录(桌面启动器的 cwd 就是 profile 目录)。
|
|
194
|
+
excludeRoots: [dshHome()],
|
|
193
195
|
});
|
|
194
196
|
const registry = ProjectRegistry.load(dataDir, { defaultWorkspacePath: defaultWorkspace });
|
|
195
197
|
const runtimes = new Map();
|
|
@@ -1486,6 +1488,13 @@ export function apply(ctx, config = {}) {
|
|
|
1486
1488
|
return;
|
|
1487
1489
|
}
|
|
1488
1490
|
hostRepaired = true;
|
|
1491
|
+
// 成功行必须留在 errors 级别:否则「归档修复有没有跑过」永远无法判定
|
|
1492
|
+
// (只有 boot 瞬间那一行 deferred.fail 可见,见 lib/diaglog.js 白名单)。
|
|
1493
|
+
diag.append({
|
|
1494
|
+
ev: 'host.repair.ok',
|
|
1495
|
+
archived: Array.isArray(repaired) ? repaired.length : 0,
|
|
1496
|
+
sessionIds: Array.isArray(repaired) ? repaired.slice(0, 5) : [],
|
|
1497
|
+
});
|
|
1489
1498
|
} catch (error) {
|
|
1490
1499
|
hostRepaired = true;
|
|
1491
1500
|
diag.append({ ev: 'host.unarchive.sweep.fail', error: error?.message ?? String(error) });
|
package/lib/diaglog.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
2
|
* Plugin-owned diagnostic log: one JSONL file per day, appended serially,
|
|
3
3
|
* rotated at a byte cap, and readable back through tail(). Both the Host
|
|
4
4
|
* (boot, dispatch, wake, PMO, member failure/recovery) and the Client half
|
|
@@ -22,7 +22,10 @@ export function defaultDiagDir() {
|
|
|
22
22
|
/** Rows worth keeping when the logger runs in `errors` mode. */
|
|
23
23
|
export function isErrorEvent(ev) {
|
|
24
24
|
return typeof ev === 'string'
|
|
25
|
-
&& (ev.endsWith('.fail') || ev === 'boot.refused' || ev === 'route.reject' || ev === 'ledger.repair'
|
|
25
|
+
&& (ev.endsWith('.fail') || ev === 'boot.refused' || ev === 'route.reject' || ev === 'ledger.repair'
|
|
26
|
+
// 归档修复的**成功**行必须留在 `errors` 级别:否则「修没修」永远无法
|
|
27
|
+
// 判定(只有 boot 瞬间那一行 deferred.fail 可见)。
|
|
28
|
+
|| ev === 'host.repair.ok');
|
|
26
29
|
}
|
|
27
30
|
|
|
28
31
|
/**
|
|
@@ -22,14 +22,25 @@ const isDirectory = (value) => {
|
|
|
22
22
|
* @param {{ configured?: string, cwd?: string, home?: string, dataDir?: string }} input
|
|
23
23
|
* @returns {string} 绝对目录,找不到任何可用目录时返回空串
|
|
24
24
|
*/
|
|
25
|
-
export function resolveDefaultWorkspace({ configured = '', cwd = '', home = '', dataDir = '' } = {}) {
|
|
25
|
+
export function resolveDefaultWorkspace({ configured = '', cwd = '', home = '', dataDir = '', excludeRoots = [] } = {}) {
|
|
26
26
|
const explicit = typeof configured === 'string' ? configured.trim() : '';
|
|
27
|
-
const
|
|
28
|
-
|
|
27
|
+
const under = (value, root) => {
|
|
28
|
+
if (typeof root !== 'string' || root === '') return false;
|
|
29
|
+
const resolvedRoot = root.replace(/[\\/]+$/, '');
|
|
30
|
+
return value === resolvedRoot || value.startsWith(`${resolvedRoot}${sep}`) || value.startsWith(`${resolvedRoot}/`);
|
|
31
|
+
};
|
|
32
|
+
const excluded = (value) => {
|
|
33
|
+
// 插件数据目录永远不能当工作目录。
|
|
34
|
+
if (under(value, dataDir)) return true;
|
|
35
|
+
// `~/.dsh` 整棵树都不能当工作目录:桌面启动器的 cwd 就是 profile 目录
|
|
36
|
+
// (`…\.dsh\profiles\desktop`),把它当项目工作区是错的。
|
|
37
|
+
for (const root of excludeRoots) if (under(value, root)) return true;
|
|
38
|
+
return false;
|
|
39
|
+
};
|
|
40
|
+
for (const raw of [explicit, cwd, home]) {
|
|
29
41
|
if (typeof raw !== 'string' || raw === '') continue;
|
|
30
42
|
if (!isDirectory(raw)) continue;
|
|
31
|
-
|
|
32
|
-
if (dataDir !== '' && (raw === dataDir || raw.startsWith(`${dataDir}${sep}`))) continue;
|
|
43
|
+
if (excluded(raw)) continue;
|
|
33
44
|
// 显式配置的目录由用户负责;自动探测到的系统目录一律跳过。
|
|
34
45
|
if (raw !== explicit && SYSTEM_DIR.test(raw)) continue;
|
|
35
46
|
return raw;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@suifei/dsh-ai-team",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.58",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "文渊阁 (Wenyuan Pavilion) — AI Team mode for DeepSeek Harness: concurrent projects, owned tasks, threads, inbox and an append-only team ledger",
|
|
6
6
|
"license": "MIT",
|