@cannbot-plugin/cannbot-harness 0.3.2 → 0.3.4
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/LICENSE +38 -0
- package/README.md +37 -8
- package/THIRD_PARTY_NOTICES.md +9 -7
- package/WORKFLOW_PUBLISHING.md +5 -1
- package/icon.svg +1 -1
- package/lib/client.js +550 -434
- package/lib/client.js.map +1 -1
- package/lib/index.js +1067 -147
- package/official-plugins.json +45 -11
- package/package.json +10 -7
- package/workflow-defaults.json +23 -59
- package/runtime/initializer-compat.cjs +0 -25
- package/upstream.json +0 -61
package/LICENSE
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
CANN Open Software License Agreement Version 2.0
|
|
2
|
+
|
|
3
|
+
This CANN Open Software License Agreement Version 2.0 (hereinafter referred to as this "Agreement") is a legal agreement between you and Huawei, and it governs your use, modification, or distribution of CANN Open Software (hereinafter referred to as "Software"). Please read this Agreement carefully.
|
|
4
|
+
|
|
5
|
+
If you are entering into this Agreement on behalf of a company or other legal entity, you represent that you have the legal authority to bind that entity to this Agreement, in which case "you" will mean the entity you represent.
|
|
6
|
+
|
|
7
|
+
BY DOWNLOADING, INSTALLING, OR USING THE SOFTWARE, YOU AGREE YOU HAVE FULLY UNDERSTOOD AND ACCEPTED THE TERMS CONTAINED HEREIN. IF YOU DO NOT AGREE TO ANY OF THE TERMS OF THIS AGREEMENT, OR IF YOU DO NOT QUALIFY FOR AGREEING TO THIS AGREEMENT, YOU ARE NOT AUTHORIZED TO AND SHALL NOT DOWNLOAD, INSTALL, OR MAKE ANY USE OF THE SOFTWARE.
|
|
8
|
+
|
|
9
|
+
1. Definition
|
|
10
|
+
|
|
11
|
+
1.1 Software means the APIs, source code files, binaries, and related documents of Compute Architecture for Neural Networks("CANN") that are licensable by Huawei, and provided and licensed under this Agreement.
|
|
12
|
+
|
|
13
|
+
1.2 Huawei AI Processors mean AI chipsets (i) branded with "Ascend", "Kirin"," Yueying" or other brands owned or controlled by Huawei; or (ii) manufactured (including have manufactured), supplied (including have supplied) or designed (including have designed) by Huawei.
|
|
14
|
+
|
|
15
|
+
2. Grant of Intellectual Property Rights
|
|
16
|
+
2.1 Subject to the terms and conditions of this Agreement, including your full compliance thereof, Huawei hereby grants you a limited, worldwide, royalty-free, non-transferable, non-sublicensable, and revocable license for you to (i) download, use, modify, integrate, and distribute the Software or its derivative works for the purpose of developing software solely for use in systems with Huawei AI Processors and/or Software, and (ii) distribute any software developed based upon Software and/or its derivative works solely for use in systems with Huawei AI Processors and/or Software.
|
|
17
|
+
|
|
18
|
+
3. Restrictions
|
|
19
|
+
3.1 You are not authorized to, and shall not use, modify, or distribute this Software or its derivative works for any other purposes than those expressly permitted by this Agreement. You shall not make any use of the Software or its derivative works to develop or distribute any software for use in systems with processors other than Huawei AI Processors. All rights not expressly granted herein are expressly reserved by Huawei.
|
|
20
|
+
|
|
21
|
+
3.2 You are not authorized to, and shall not remove, obscure, or alter any copyright or other notices in this Software or any part of it.
|
|
22
|
+
|
|
23
|
+
3.3 Distribution Restrictions
|
|
24
|
+
You may distribute the Software or its derivative works in any medium, whether in source or executable forms, for the purpose stipulated in Section 2; provided that you provide recipients with a copy of this Agreement, and retain all notices in the Software.
|
|
25
|
+
|
|
26
|
+
4. Disclaimer of Warranty and Limitation of Liability
|
|
27
|
+
THE SOFTWARE IS PROVIDED WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED. IN NO EVENT SHALL HUAWEI OR ANY OTHER COPYRIGHT HOLDER BE LIABLE TO YOU FOR ANY DAMAGES, INCLUDING, BUT NOT LIMITED TO ANY DIRECT, OR INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING FROM YOUR USE OR INABILITY TO USE THE SOFTWARE, IN WHOLE OR IN PART, NO MATTER HOW IT IS CAUSED OR THE LEGAL THEORY IT IS BASED ON, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
|
28
|
+
|
|
29
|
+
5. Termination
|
|
30
|
+
5.1 This Agreement will continue to apply until terminated by either you or Huawei as described below:
|
|
31
|
+
a.You may terminate this Agreement by ceasing your use of the Software;
|
|
32
|
+
b. Huawei may at any time, terminate this Agreement if: (i) you fail to comply with any term of this Agreement; or (ii) you directly or indirectly initiate any legal proceeding against any individual or entity by alleging that the Software or any part of it infringes your intellectual property rights.
|
|
33
|
+
5.2 By termination, all the rights granted to you under this Agreement are terminated, and you shall cease to use and delete this Software or any derivative works immediately. All rights granted to you under this Agreement shall hereby be void ab initio in the event of termination in accordance with Section 5.1. b above. Huawei reserves the right to pursue any and all legal remedies available to enforce the terms and conditions of this Agreement or to protect Huawei’s intellectual property rights for such breach or violation. All provisions shall survive the termination of this Agreement except for Section 2 and Section 3.3.
|
|
34
|
+
|
|
35
|
+
6. MISCELLANEOUS
|
|
36
|
+
If the application of any provision of this Agreement to any particular facts or circumstances is held to be invalid or unenforceable by a court of competent jurisdiction, then (a) the validity and enforceability of such provision as applied to any other particular facts or circumstances and the validity of other provisions of this Agreement shall not in any way be affected or impaired thereby and (b) such provision shall be enforced to the maximum extent possible so as to affect the intent of the you and Huawei and reformed without further action by you and Huawei to the extent necessary to make such provision valid and enforceable.
|
|
37
|
+
|
|
38
|
+
END OF THE TERMS AND CONDITIONS
|
package/README.md
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
CANNBot Harness 是安装在原版 DeepSeek Harness(DSH)中的独立插件,支持 Windows 桌面端与 Linux Web 端,不修改 DSH 核心。
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
当前源码版本为 **0.3.4**。本仓库包含主插件、`packages/short` 短包和 `packages/install` 一键安装器的完整源码;目录结构、构建与检查步骤见 [DEVELOPMENT.md](DEVELOPMENT.md)。
|
|
6
6
|
|
|
7
7
|
## CANNBot 工作台
|
|
8
8
|
|
|
9
|
-
`0.3.0` 提供 CANNBot
|
|
9
|
+
`0.3.0` 提供 CANNBot 定制工作台,包含三个工作流入口(算子开发、Ascend C Flash 核函数开发、ACLNN / GEIR 注册算子开发)、工作区继承与路径展示、文件输入及原生对话衔接。也可在 DSH 的“插件 → 添加插件 → 本地安装包”中选择对应 `.tgz` 文件;请勿同时安装短包和完整包两个入口。
|
|
10
10
|
|
|
11
|
-
启用 CANNBot Harness 后,左侧新增“CANNBot
|
|
11
|
+
启用 CANNBot Harness 后,左侧新增“CANNBot工作台”,首页不再显示“管理工作流”按钮。工作台沿用当前对话所属的工作区并展示真实路径,手动选择优先;无法识别当前工作区时要求明确选择,避免默认使用列表第一项。“选择工作区”使用 DSH 的目录浏览接口,可浏览 Host 目录或输入完整路径;已登记的目录直接复用,选择和取消均不启动任务。目录读取或登记失败在选择窗口内显示并重试。点击工作流卡片会勾选并聚焦输入框,保留已有文字与文件。首页已移除额外输入提示、自动应用说明和工作流数量,正常待机时不展示准备状态。
|
|
12
12
|
|
|
13
13
|
点击“开始”后按实际进展显示工作区准备、工作流依赖准备、文件上传与进入对话;没有文件时跳过上传步骤。准备失败时保留需求和文件,可展开原因并重试。发送后的模型运行错误由原生 DSH 展示,需求保留在草稿或对话记录中。工作流的独立更新、回退及日志仍在“插件 → CANNBot Harness”中管理。
|
|
14
14
|
|
|
@@ -16,23 +16,46 @@ CANNBot Harness 是安装在原版 DeepSeek Harness(DSH)中的独立插件
|
|
|
16
16
|
|
|
17
17
|
从 **0.2.5** 起,主程序与工作流包分开发布:主程序负责品牌界面、动态菜单和包管理;每个工作流自己的 npm 包包含 Skills、agents、模板、脚本及初始化入口。更新某个工作流不必更新主程序。
|
|
18
18
|
|
|
19
|
+
## 从本仓库安装(实时读取源码)
|
|
20
|
+
|
|
21
|
+
在仓库根目录执行(Node.js >=24.9,先按 DEVELOPMENT.md 配置 DSH 构建依赖):
|
|
22
|
+
|
|
23
|
+
```sh
|
|
24
|
+
npm --prefix dsh run install:source
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
每次安装直接读取当前仓库的 `plugins-official/`、`harness/` 和 `vendor/cannbot-skills/`,包含未提交的内容修改。`dsh/` 不保存这些目录的资源副本。工作流在系统临时目录装配、校验后复制到 `$DSH_HOME/cannbot-harness-workflows`(默认 `~/.dsh/cannbot-harness-workflows`),临时文件随后清理。
|
|
28
|
+
|
|
29
|
+
更新源码后重新执行此命令即可,不需要手工同步资源或发布工作流 npm 包。内容散列决定是否刷新缓存及工作区初始化;同版本内容修改也会生效。明确执行源码安装会替换对应工作流的旧缓存及回退固定状态,全部资源校验成功后一次切换;缺少依赖则报错并保留原工作流。
|
|
30
|
+
|
|
31
|
+
也可以指定其他本地源码,或在安装时获取远端仓库当前 HEAD 及其声明的子模块:
|
|
32
|
+
|
|
33
|
+
```sh
|
|
34
|
+
node dsh/scripts/install-source.mjs --source /path/to/cannbot
|
|
35
|
+
node dsh/scripts/install-source.mjs --repository https://gitcode.com/cann/cannbot.git
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
本地安装要求共享 Skills 已满足源码声明;不会切换用户工作区的子模块版本。安装后重启 DSH。直接安装主插件 `.tgz` 或 npm 包使用下面的已发布工作流依赖机制,不会读取本地源码。
|
|
39
|
+
|
|
19
40
|
## 安装
|
|
20
41
|
|
|
42
|
+
以下 npm 安装方式需对应版本已发布;本地源码安装使用上面的 `install:source` 命令。
|
|
43
|
+
|
|
21
44
|
在 DSH **插件 → 添加插件** 中输入:
|
|
22
45
|
|
|
23
46
|
```text
|
|
24
|
-
cannbot-harness@0.3.
|
|
47
|
+
cannbot-harness@0.3.4
|
|
25
48
|
```
|
|
26
49
|
|
|
27
|
-
完整包名为 `@cannbot-plugin/cannbot-harness@0.3.
|
|
50
|
+
完整包名为 `@cannbot-plugin/cannbot-harness@0.3.4`。请只选择一种入口安装。
|
|
28
51
|
兼容范围保持 DSH `>=0.1.1-rc.1 <0.3.0`,Node.js 24.9 或更新版本;图形包管理依赖 DSH 提供官方认证 Fetch 路由与插件管理接口。
|
|
29
52
|
|
|
30
|
-
从 0.2.6 起,目录包将默认工作流声明为标准 npm 必需依赖。DSH 的安装过程会一次下载主插件、目录包与全部
|
|
53
|
+
从 0.2.6 起,目录包将默认工作流声明为标准 npm 必需依赖。DSH 的安装过程会一次下载主插件、目录包与全部 3 个默认工作流包,目前提供 53 个 Skills;任一依赖下载失败,安装阶段就会报错。首次启用只准备本地已安装资源,全部准备完成后插件才启用,不再后台补装子包。首次安装需要网络;安装完成后可离线加载。
|
|
31
54
|
|
|
32
55
|
Linux 可使用同一个包:
|
|
33
56
|
|
|
34
57
|
```sh
|
|
35
|
-
dsh plugin --profile web add cannbot-harness@0.3.
|
|
58
|
+
dsh plugin --profile web add cannbot-harness@0.3.4
|
|
36
59
|
dsh web
|
|
37
60
|
```
|
|
38
61
|
|
|
@@ -41,7 +64,7 @@ dsh web
|
|
|
41
64
|
插件详情页的 **工作流管理** 为每个工作流显示包名、已安装版本和最新版本,可逐项安装、更新、回退,也可 **更新全部工作流**。
|
|
42
65
|
程序启用时加载已经安装的工作流;下载新版本通过详情页明确触发。回退后固定该版本,批量更新不会将它升回去;主动更新这一项即可恢复跟随最新版。
|
|
43
66
|
|
|
44
|
-
目录包是 `@cannbot-plugin/workflow-catalog`;工作流包统一为 `@cannbot-plugin/workflow-<ID
|
|
67
|
+
目录包是 `@cannbot-plugin/workflow-catalog`;工作流包统一为 `@cannbot-plugin/workflow-<ID>`。默认工作流集合由 `dsh/workflow-defaults.json` 决定,未列入的工作流不会被打包,也不会出现在目录包中;「检查更新」同样只保留该集合内的工作流。发布已有工作流的新版本只需更新对应小包;新增工作流先发布内容包,再更新小型目录包,无需发布主程序。维护者操作见 [独立工作流发布说明](WORKFLOW_PUBLISHING.md)。
|
|
45
68
|
|
|
46
69
|
主程序自己的 **检查更新** 按钮仍保留。0.2.4 起支持 Host 后台一键升级,使用 DSH 官方更新接口;旧版 DSH 通过官方安装、卸载接口串联,失败时尝试恢复原版本。
|
|
47
70
|
|
|
@@ -65,3 +88,9 @@ dsh web
|
|
|
65
88
|
|
|
66
89
|
主程序复用官方 DSH 开源仓库的 Client 构建预设,通过 `DSH_SOURCE` 或开发配置指定官方源码目录,然后运行 `npm run build`、`npm test`、`npm run pack:plugin`。不修改上游核心。
|
|
67
90
|
工作流小包可使用标准 Node.js/npm 构建与发布,具体命令和包格式见 [WORKFLOW_PUBLISHING.md](WORKFLOW_PUBLISHING.md)。
|
|
91
|
+
|
|
92
|
+
## Python 编排与 DSH 原生执行
|
|
93
|
+
|
|
94
|
+
使用 `harness/workflow-orchestrator` 的工作流通过 `cannbot_workflow_run` 启动:传入工作流包 ID、YAML、需求和可选工作目录。Python 保留依赖调度、并发、重试、回退和裁决逻辑;每个节点由 DSH 原生子 Agent loop 执行并继承会话模型,无需选择 Coding Agent CLI provider。用 `cannbot_workflow_status` 查询,用 `cannbot_workflow_cancel` 停止;审批仍使用 Python 工作流的审批脚本。
|
|
95
|
+
|
|
96
|
+
插件通过 `python3 -c` 导入工作流资源中的 `orchestrator.py`,向其通用函数接口注入执行回调;管道适配代码随插件编译,不增加 Python 入口文件或编排器命令行参数。安装时获取 Python 编排器,`dsh/` 不保存其副本。运行要求 Python 3 和 PyYAML,以及 DSH 的原生 spawn 子 Agent 能力。
|
package/THIRD_PARTY_NOTICES.md
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
# Third-party notices
|
|
2
2
|
|
|
3
|
-
CANNBot Harness
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
CANNBot Harness contains the DSH adapter and installation code. Official workflow
|
|
4
|
+
resources are copied from the selected CANNBot source and its declared shared
|
|
5
|
+
Skills during source installation or workflow-package construction. This source
|
|
6
|
+
tree does not retain copies of those resources.
|
|
7
|
+
Each generated workflow package retains its CANN Open Software License Agreement
|
|
8
|
+
Version 2.0 and shared Skill license in resources/LICENSE and SKILLS_LICENSE.
|
|
9
|
+
Its workflow.json records the actual source revisions and content hashes.
|
|
10
|
+
Local uncommitted changes are included; revision identifiers alone do not identify
|
|
11
|
+
those changes. Published npm installations obtain resources from workflow packages.
|
|
10
12
|
|
|
11
13
|
Source-declared symlinks are materialized for portable installation. The upstream
|
|
12
14
|
bundler's model-invocation normalization is retained unless the plugin declares
|
package/WORKFLOW_PUBLISHING.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
## 更新已有工作流
|
|
8
8
|
|
|
9
|
-
先在 CANNBot
|
|
9
|
+
先在 CANNBot 源码仓修改内容,准备该源码仓声明的共享 Skills。构建器每次直接读取指定工作区(包含未提交修改),在系统临时目录装配,不维护 `dsh/assets` 副本。正式发布前应提交源码以便追溯。只构建目标工作流:
|
|
10
10
|
|
|
11
11
|
```sh
|
|
12
12
|
node scripts/build-workflow-packages.mjs --source /path/to/cannbot --id ops-direct-invoke --version 1.0.1
|
|
@@ -55,3 +55,7 @@ node <工作流包>/upstream/bin/cannbot.js install <ID> --tool dsh --target <
|
|
|
55
55
|
目录包的 `dependencies` 声明全部默认工作流,版本使用 `>=1.0.0`,让新用户在 DSH 标准 npm 安装阶段一次获取当时可解析的最新稳定包,并排除历史占位版本。主插件依赖目录包 `^1.0.2`。发布目录包前必须确保所有工作流已公开;新增默认工作流同时加入目录及其 `dependencies`。已有工作流发布新版本仍不必重发目录包或主插件。
|
|
56
56
|
|
|
57
57
|
启用时仅从 npm 已安装的依赖准备本地缓存,等待全部完成后才注册工作流能力,不运行 npm 安装脚本,不覆盖缓存内独立升级或固定回退的版本。新版本下载由用户在工作流管理中明确触发。项目级外部依赖依然在选择工作流时按需初始化,不能在未选择项目时提前运行。
|
|
58
|
+
|
|
59
|
+
## 无需发布的源码安装
|
|
60
|
+
|
|
61
|
+
在 `dsh/` 执行 `npm run install:source`,安装器会实时复制父仓库源码到 DSH 工作流缓存。它使用与发布相同的装配、许可证保留和校验逻辑,但跳过工作流 npm 打包与发布。重新安装以内容散列刷新缓存,无需修改版本号。`--repository <GitURL>` 会在本次安装中获取远端源码。
|
package/icon.svg
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="1024" height="1024" viewBox="0 0 1024 1024"><rect width="1024" height="1024" rx="256" fill="#da203e"/><path d="M690 300a270 270 0 1 0 0 424" fill="none" stroke="#fff" stroke-width="100" stroke-linecap="round"/></svg>
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="1024" height="1024" viewBox="0 0 1024 1024"><rect width="1024" height="1024" rx="256" fill="#da203e"/><path d="M690 300a270 270 0 1 0 0 424" fill="none" stroke="#fff" stroke-width="100" stroke-linecap="round"/></svg>
|