@cannbot-plugin/cannbot-harness 0.3.4 → 0.3.5

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 CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  CANNBot Harness 是安装在原版 DeepSeek Harness(DSH)中的独立插件,支持 Windows 桌面端与 Linux Web 端,不修改 DSH 核心。
4
4
 
5
- 当前源码版本为 **0.3.4**。本仓库包含主插件、`packages/short` 短包和 `packages/install` 一键安装器的完整源码;目录结构、构建与检查步骤见 [DEVELOPMENT.md](DEVELOPMENT.md)。
5
+ 当前源码版本为 **0.3.5**。本仓库包含主插件、`packages/short` 短包和 `packages/install` 一键安装器的完整源码;目录结构、构建与检查步骤见 [DEVELOPMENT.md](DEVELOPMENT.md)。
6
6
 
7
7
  ## CANNBot 工作台
8
8
 
@@ -44,10 +44,10 @@ node dsh/scripts/install-source.mjs --repository https://gitcode.com/cann/cannbo
44
44
  在 DSH **插件 → 添加插件** 中输入:
45
45
 
46
46
  ```text
47
- cannbot-harness@0.3.4
47
+ cannbot-harness@0.3.5
48
48
  ```
49
49
 
50
- 完整包名为 `@cannbot-plugin/cannbot-harness@0.3.4`。请只选择一种入口安装。
50
+ 完整包名为 `@cannbot-plugin/cannbot-harness@0.3.5`。请只选择一种入口安装。
51
51
  兼容范围保持 DSH `>=0.1.1-rc.1 <0.3.0`,Node.js 24.9 或更新版本;图形包管理依赖 DSH 提供官方认证 Fetch 路由与插件管理接口。
52
52
 
53
53
  从 0.2.6 起,目录包将默认工作流声明为标准 npm 必需依赖。DSH 的安装过程会一次下载主插件、目录包与全部 3 个默认工作流包,目前提供 53 个 Skills;任一依赖下载失败,安装阶段就会报错。首次启用只准备本地已安装资源,全部准备完成后插件才启用,不再后台补装子包。首次安装需要网络;安装完成后可离线加载。
@@ -55,7 +55,7 @@ cannbot-harness@0.3.4
55
55
  Linux 可使用同一个包:
56
56
 
57
57
  ```sh
58
- dsh plugin --profile web add cannbot-harness@0.3.4
58
+ dsh plugin --profile web add cannbot-harness@0.3.5
59
59
  dsh web
60
60
  ```
61
61
 
package/lib/index.js CHANGED
@@ -757,15 +757,20 @@ var ContentManager = class {
757
757
  const baseline = catalog.cannbotWorkflowCatalog.workflows.map(checkedEntry).filter((item) => this.shipped.has(item.id));
758
758
  if (!baseline.length || new Set(baseline.map((item) => item.id)).size !== baseline.length) throw new Error("Invalid installed workflow entries");
759
759
  const newerCatalog = !replaceFromSource && this.index.catalogVersion && newerVersion(this.index.catalogVersion, catalog.version);
760
- const entries = newerCatalog ? [...this.index.entries] : [...baseline];
761
- for (const old of this.index.entries) if (!entries.some((item) => item.id === old.id)) entries.push(old);
760
+ const entries = (newerCatalog ? [...this.index.entries] : [...baseline]).filter((item) => this.shipped.has(item.id));
761
+ for (const old of this.index.entries) if (this.shipped.has(old.id) && !entries.some((item) => item.id === old.id)) entries.push(old);
762
762
  const next = {
763
763
  ...this.index,
764
764
  entries,
765
765
  catalogVersion: newerCatalog ? this.index.catalogVersion : catalog.version,
766
766
  records: { ...this.index.records },
767
+ history: { ...this.index.history },
767
768
  pinned: [...this.index.pinned]
768
769
  };
770
+ const dropped = Object.keys(next.records).filter((id) => !this.shipped.has(id));
771
+ for (const id of dropped) delete next.records[id];
772
+ for (const id of Object.keys(next.history)) if (!this.shipped.has(id)) delete next.history[id];
773
+ next.pinned = next.pinned.filter((id) => this.shipped.has(id));
769
774
  for (const entry of baseline.filter((item) => item.default)) {
770
775
  if (!replaceFromSource && this.index.records[entry.id]) continue;
771
776
  if (!catalog.dependencies?.[entry.package]) throw new Error(`Workflow dependency missing: ${entry.package}`);
@@ -802,6 +807,10 @@ var ContentManager = class {
802
807
  if (replaceFromSource) next.pinned = next.pinned.filter((id) => id !== entry.id);
803
808
  }
804
809
  await this.save(next);
810
+ for (const id of dropped) await rm(join(this.root, "packages", id), {
811
+ recursive: true,
812
+ force: true
813
+ }).catch(() => {});
805
814
  this.publish({
806
815
  phase: "ready",
807
816
  message: "Installed workflow dependencies are ready."
@@ -819,7 +828,7 @@ var ContentManager = class {
819
828
  if (catalog.name !== "@cannbot-plugin/workflow-catalog" || !validVersion(catalog.version) || catalog.cannbotWorkflowCatalog?.schemaVersion !== 1 || !Array.isArray(catalog.cannbotWorkflowCatalog.workflows)) throw new Error("Unsupported workflow catalog");
820
829
  const entries = catalog.cannbotWorkflowCatalog.workflows.map(checkedEntry).filter((item) => this.shipped.has(item.id));
821
830
  if (!entries.length || new Set(entries.map((item) => item.id)).size !== entries.length) throw new Error("Invalid workflow catalog");
822
- for (const old of this.index.entries) if (this.index.records[old.id] && !entries.some((item) => item.id === old.id)) entries.push(old);
831
+ for (const old of this.index.entries) if (this.shipped.has(old.id) && this.index.records[old.id] && !entries.some((item) => item.id === old.id)) entries.push(old);
823
832
  await this.save({
824
833
  ...this.index,
825
834
  entries,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cannbot-plugin/cannbot-harness",
3
- "version": "0.3.4",
3
+ "version": "0.3.5",
4
4
  "description": "CANNBot Harness: Ascend development workbench with independently versioned workflow packages",
5
5
  "type": "module",
6
6
  "license": "SEE LICENSE IN LICENSE",
@@ -63,7 +63,7 @@
63
63
  },
64
64
  "dependencies": {
65
65
  "pacote": "^21.0.3",
66
- "@cannbot-plugin/workflow-catalog": "^1.0.2"
66
+ "@cannbot-plugin/workflow-catalog": "^1.0.3"
67
67
  },
68
68
  "devDependencies": {
69
69
  "yaml": "^2.4.2"