@suifei/dsh-ai-team 0.4.55 → 0.4.57

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 CHANGED
@@ -1,5 +1,30 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.4.57 - 2026-11-12
4
+
5
+ **修 0.4.56 真机暴露的默认目录建议错误:整个 `~/.dsh` 都排除**
6
+
7
+ 重启后实测 `bootstrap.defaultWorkspace` 返回 `C:\Users\SuiFei\.dsh\profiles\desktop`——桌面启动器的宿主进程 cwd 就是 profile 目录,它不等于插件数据目录(`…\.dsh\ai-team\desktop`),于是通过了 0.4.50 的排除规则,被当成「建议工作目录」。把 profile 目录当项目工作区显然是错的。
8
+
9
+ - `resolveDefaultWorkspace` 新增 `excludeRoots`;`boot` 传入 `[dshHome()]`,整棵 `~/.dsh` 都不再作为建议目录。
10
+ - 实测(本机真实路径):`cwd=…\.dsh\profiles\desktop` → 建议退到 `C:\Users\SuiFei`;不传 `excludeRoots` 时仍返回 profile 目录(对照)。
11
+ - 测试:`node --test` **256 通过 / 1 跳过**(新增 1 例:profile 目录被跳过、`~/.dsh` 内无可用目录时返回空、显式配置会被拒绝并继续尝试后续候选)。
12
+
13
+ ## 0.4.56 - 2026-11-12
14
+
15
+ **0.4.55 被 npm 暂存审查卡住,改用新版本号发布同一份代码**
16
+
17
+ 第一次发布 0.4.55 时 npm 返回 409:
18
+
19
+ ```
20
+ npm error 409 Conflict - Cannot publish over previously staged version "0.4.55".
21
+ ```
22
+
23
+ 也就是说 `+ @suifei/dsh-ai-team@0.4.55` 这行只表示「已进入暂存队列」,**并不等于已上架**;registry 的 `latest` 一直是 0.4.54,版本端点 404。以后发布必须用**版本端点**(`/@scope%2Fname/<version>`)核实,而不是看 `+` 那一行。
24
+
25
+ - 内容与 0.4.55 完全相同(仅版本号),没有代码改动。
26
+ - 另外本轮用**已安装产物**在真实账本副本上做了干跑验证:`version=0.4.56`、两个项目都能打开(23 / 54 个任务)、`project.repair` 报 `1..1208` 无缺口、新建项目不带目录返回 400。
27
+
3
28
  ## 0.4.55 - 2026-11-12
4
29
 
5
30
  **批 19:为「库失败进诊断」补端到端验证**
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();
@@ -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 candidates = [explicit, cwd, home];
28
- for (const raw of candidates) {
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.55",
3
+ "version": "0.4.57",
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",