@yangdcm/dsh-expert-team 1.2.0 → 1.2.1

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
@@ -3,6 +3,15 @@
3
3
  本包遵循[语义化版本](https://semver.org/lang/zh-CN/)。dsh 宿主版本线的对应关系写在
4
4
  `package.json` 的 `engines.dsh` 与 `dsh.compatibility` 里,插件市场按它判断"这个插件跟你的宿主兼不兼容"。
5
5
 
6
+ ## 1.2.1
7
+
8
+ **卸载回收覆盖历史副本**(1.2.0 的补丁)
9
+
10
+ - `/team uninstall` 此前只遍历登记清单,而 **1.2.0 之前铺下的 skill/preset 没有登记过**
11
+ (那时还没有清单)—— 从 1.1.x 升上来的用户跑它只会得到"没有需要回收的副本",
12
+ 而 `$DSH_HOME/skills/expert-team` 里的旧副本仍在(`gate:sync` 会一直报漂移)。
13
+ 现在除清单外还会看两个众所周知的自举落点,判据仍是"有戳或身份对得上",
14
+ 用户自己写的同名内容照样不动。
6
15
  ## 1.2.0
7
16
 
8
17
  **安全加固(本机来源守卫)+ 自举安装收口 + 设置接进宿主命名空间**
package/lib/command.js CHANGED
@@ -849,16 +849,32 @@ async function uninstallInstalled() {
849
849
  const rec = await readInstalled();
850
850
  const removed = [];
851
851
  const skipped = [];
852
- for (const [kind, info] of Object.entries(rec)) {
853
- const dir = info && info.path;
854
- if (!dir) continue;
855
- if (await pathExists(dir) && await isOwnedCopy(dir, kind)) {
852
+ const seen = new Set();
853
+ /**
854
+ * 回收一个候选目录(幂等;只删"本插件的副本")。
855
+ * 为什么要 `seen`:清单里的路径与下面两个**历史默认路径**可能重合,重复 rm 会把
856
+ * "已回收"报两遍,也会让第二次那条 `pathExists` 失败被误记成"保留"。
857
+ */
858
+ const reclaim = async (kind, dir) => {
859
+ if (!dir || seen.has(dir)) return;
860
+ seen.add(dir);
861
+ if (!(await pathExists(dir))) return;
862
+ if (await isOwnedCopy(dir, kind)) {
856
863
  try { await rm(dir, { recursive: true, force: true }); removed.push(`${kind}:${dir}`); }
857
864
  catch (e) { skipped.push(`${kind}:${dir}(删除失败:${String(e && e.message ? e.message : e)})`); }
858
- } else if (await pathExists(dir)) {
865
+ } else {
859
866
  skipped.push(`${kind}:${dir}(不是本插件的副本 ⇒ 保留)`);
860
867
  }
861
- }
868
+ };
869
+
870
+ for (const [kind, info] of Object.entries(rec)) await reclaim(kind, info && info.path);
871
+
872
+ // 1.2.0 之前的副本**没有登记过**(那时还没有清单)—— 而它们恰恰是这个命令最该处理的历史遗留。
873
+ // 所以除了清单,还要看两个众所周知的自举落点;判据仍是 `isOwnedCopy`(无戳时按身份判定),
874
+ // 用户自己写的同名 skill/preset 依旧不会被删。
875
+ await reclaim('skill', join(dshHome(), 'skills', 'expert-team'));
876
+ await reclaim('preset', join(dshHome(), '.agent-presets', 'expert-team'));
877
+
862
878
  try { await rm(installedManifestPath(), { force: true }); } catch { /* 清单删不掉就留着 */ }
863
879
  const lines = ['# /team uninstall', ''];
864
880
  lines.push(removed.length ? '已回收:' : '没有需要回收的副本。');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yangdcm/dsh-expert-team",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "description": "dsh「专家团」bundle:一句自然语言自动组建/持久化一支 12 角色多智能体团队,共享工作区协议 + 阶段门控编排 + 结构化交接 + 质量门禁/自动调度,实现者直接改代码并产出持久工件;带 live 团队浮层(质量门禁/覆盖率/工件预览)。 · Role-based multi-agent expert team for DeepSeek Harness: one sentence in, a staged and gated team delivery out.",
5
5
  "type": "module",
6
6
  "license": "MIT",