@suifei/dsh-ai-team 0.4.59 → 0.4.61
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 +25 -0
- package/index.js +12 -3
- package/lib/diaglog.js +7 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.4.61 - 2026-11-12
|
|
4
|
+
|
|
5
|
+
**诊断目录跟随 `DSH_HOME` + 关闭句柄的 flush 不再报错**
|
|
6
|
+
|
|
7
|
+
0.4.60 真机日志里混进了测试的痕迹(`E:/definitely-not-existing-dir-xyz`、`memberId: a1`、`boot.refused`):`defaultDiagDir()` 用的是 `homedir()`,而插件数据目录用的是 `dshHome()`(尊重 `DSH_HOME`)。于是任何把 `DSH_HOME` 指到临时目录的隔离实例(测试、临时 profile)都会把诊断行写进**生产日志**。
|
|
8
|
+
|
|
9
|
+
- `defaultDiagDir()` 改为 `join(dshHome(), 'ai-team')`:未设置 `DSH_HOME` 时行为不变(仍是 `~/.dsh/ai-team`),设置后与数据目录同源;空白值按未设置处理。
|
|
10
|
+
- `flush on a closed handle` 降级为 `session.flush.skipped`(不属于错误事件):`turn/end` 之后句柄已关闭,flush 失败属正常,记成 `.fail` 会让发布默认级别的日志看起来一直在出错。真正的 flush 失败仍记 `session.flush.fail`。
|
|
11
|
+
- 测试:`node --test` **261 通过 / 1 跳过**(新增 `diaglog` 2 例:`DSH_HOME` 跟随与空白值、`session.flush.skipped` 不在错误白名单)。
|
|
12
|
+
|
|
13
|
+
## 0.4.60 - 2026-11-12
|
|
14
|
+
|
|
15
|
+
**`DSH_HOME` 被搬迁时也不能把真实 profile 目录当建议工作目录**
|
|
16
|
+
|
|
17
|
+
0.4.59 的干跑(隔离实例把 `DSH_HOME` 指到临时目录)里,`suggested` 又变回了
|
|
18
|
+
`C:\Users\SuiFei\.dsh\profiles\desktop`:此时 `dshHome()` 指向临时目录,不再覆盖真实的
|
|
19
|
+
`~/.dsh`,于是桌面 profile 目录重新成为候选。(真机不受影响——0.4.57 在真实 `DSH_HOME`
|
|
20
|
+
下已返回过 `C:\Users\SuiFei`。)
|
|
21
|
+
|
|
22
|
+
- 排除根改为 `[dshHome(), join(homedir(), '.dsh')]` 去重,搬迁场景与真机场景同时成立。
|
|
23
|
+
- 端到端复现真机条件(`cwd` = profile 目录、`DSH_HOME` = 临时目录):`suggested` =
|
|
24
|
+
**`C:\Users\SuiFei\works`**。
|
|
25
|
+
- 测试:`node --test` **259 通过 / 1 跳过**(`default-workspace` 7 例;新增「只排除搬迁根时
|
|
26
|
+
真实 profile 目录仍会被选中」的反向断言,证明这条测试真能抓到该缺陷)。
|
|
27
|
+
|
|
3
28
|
## 0.4.59 - 2026-11-12
|
|
4
29
|
|
|
5
30
|
**默认工作目录改成 `~/works` 子目录(不再用主目录根)**
|
package/index.js
CHANGED
|
@@ -191,7 +191,9 @@ async function boot(diag, config = {}) {
|
|
|
191
191
|
home: homedir(),
|
|
192
192
|
dataDir,
|
|
193
193
|
// 整个 ~/.dsh 都不能当工作目录(桌面启动器的 cwd 就是 profile 目录)。
|
|
194
|
-
|
|
194
|
+
// 同时排除**真实** home 下的 `.dsh`:`DSH_HOME` 被改到别处时(测试、隔离实例),
|
|
195
|
+
// dshHome() 不再覆盖桌面 profile 目录,那条路径仍可能被当成建议值。
|
|
196
|
+
excludeRoots: [...new Set([dshHome(), join(homedir(), '.dsh')])],
|
|
195
197
|
});
|
|
196
198
|
// 兜底建议是 `~/works`:它可能还不存在,而 `project.workspace.update` 只接受
|
|
197
199
|
// 已存在的目录。用户确认的就是这个子目录,所以在这里建出来(失败则不提供建议)。
|
|
@@ -534,8 +536,15 @@ export function apply(ctx, config = {}) {
|
|
|
534
536
|
try {
|
|
535
537
|
await sessions?.flush?.(session);
|
|
536
538
|
} catch (error) {
|
|
537
|
-
|
|
538
|
-
|
|
539
|
+
const message = error?.message ?? String(error);
|
|
540
|
+
// 回合结束时句柄可能已经关闭(turn/end 之后会话被回收):这不是缺陷,
|
|
541
|
+
// 记成 `.fail` 会让发布默认的 errors 级别日志看起来一直在出错。
|
|
542
|
+
if (/closed handle/i.test(message)) {
|
|
543
|
+
diag.append({ ev: 'session.flush.skipped', sessionId: session?.id ?? null, message });
|
|
544
|
+
} else {
|
|
545
|
+
diag.append({ ev: 'session.flush.fail', sessionId: session?.id ?? null, message });
|
|
546
|
+
console.warn('[ai-team] member session flush failed:', message);
|
|
547
|
+
}
|
|
539
548
|
}
|
|
540
549
|
// 回合结局必须全部可见:`blocked` 表示回合在发出模型请求前就被拒绝
|
|
541
550
|
// (典型原因:会话或血缘祖先被归档),`error` 表示模型/工具链失败。
|
package/lib/diaglog.js
CHANGED
|
@@ -16,7 +16,13 @@ export function diagFileName(date = new Date()) {
|
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
export function defaultDiagDir() {
|
|
19
|
-
|
|
19
|
+
// 必须与插件数据目录同源(`dshHome()`):否则设置了 `DSH_HOME` 的隔离实例
|
|
20
|
+
// (测试、临时 profile)会把诊断行写进**真实**的 `~/.dsh/ai-team`,污染生产日志
|
|
21
|
+
// ——实机上就混进过 `E:/definitely-not-existing-dir-xyz` 这类测试夹具的行。
|
|
22
|
+
const home = typeof process.env.DSH_HOME === 'string' && process.env.DSH_HOME.trim() !== ''
|
|
23
|
+
? process.env.DSH_HOME
|
|
24
|
+
: join(homedir(), '.dsh');
|
|
25
|
+
return join(home, 'ai-team');
|
|
20
26
|
}
|
|
21
27
|
|
|
22
28
|
/** Rows worth keeping when the logger runs in `errors` mode. */
|
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.61",
|
|
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",
|