@gavinc-cn/dsh-plugins-runtime 0.0.0-stage → 0.1.0
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 +21 -0
- package/README.md +83 -2
- package/cordis.patch.yml +71 -0
- package/lib/index.js +3 -0
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +52 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 @gavinc-cn
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,84 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @gavinc-cn/dsh-plugins-runtime
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
把**宿主(node)侧运行**的自研插件收成一个可安装单位的 bundle 包:装上它,Plugins 面板里多出
|
|
4
|
+
一张「自研插件 · 运行时」卡片;卡片里的每个**组件**(组合行)= 一个**独立开关**。
|
|
5
|
+
|
|
6
|
+
- **一个包 = 面板一张卡片**:包名出现在 profile 的 `dsh.profile.bundles` 里,本包的
|
|
7
|
+
`cordis.patch.yml` 就会被当作一个配置层叠加进组合树。
|
|
8
|
+
- **组件 = 行 = 开关**:本包每条 `- insert:` 声明一个组件;行状态(`disabled`)由各 profile
|
|
9
|
+
的 `cordis.patch.yml` 覆盖行持有,面板里拨开关就是往那里写回。
|
|
10
|
+
- **整包开关**:包名在不在 `dsh.profile.bundles`(改它要重启宿主)。
|
|
11
|
+
|
|
12
|
+
## 归属判据
|
|
13
|
+
|
|
14
|
+
包内组件的 `package.json` 里**没有** `dsh.client` 声明 —— 即运行体在宿主(node)侧。
|
|
15
|
+
声明了 `dsh.client.platform: "web"` 的纯 UI 组件在
|
|
16
|
+
[@gavinc-cn/dsh-plugins-ui](../dsh-plugins-ui/README.md)(两个包合起来 = 拆分前
|
|
17
|
+
`@gavinc-cn/dsh-plugins` 的全部 13 个组件)。
|
|
18
|
+
|
|
19
|
+
特例:`dsh-patch-ask-expand` 的效果在 UI 上(给官方 `dsh-client-ui-tool` 的成品 client bundle
|
|
20
|
+
打幂等文本补丁),但运行体在宿主侧、没有 `dsh.client` ⇒ 按判据归本包。**只装 UI 包不会得到它。**
|
|
21
|
+
|
|
22
|
+
## 安装
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
# 装进某个 profile(pnpm 会把依赖里的 8 个组件包一并装上)
|
|
26
|
+
dsh plugin --profile web add @gavinc-cn/dsh-plugins-runtime
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
- CLI 这条路径会在 pnpm 成功后**自动**把新 bundle 追加进 `dsh.profile.bundles`(装完即启用)。
|
|
30
|
+
- 走 **Plugins 面板**的安装入口则**不会**自动选择 bundle,装完要自己把整包开关打开。
|
|
31
|
+
- **`dsh.profile.bundles` 与 `dependencies` 两处都要有本包名**:前者决定是否作为配置层加载,
|
|
32
|
+
后者决定面板里卡片是否显示(客户端按 `installed` 过滤,只看 `dependencies`)。
|
|
33
|
+
- 改了 `dsh.profile.bundles` 要**重启宿主**才生效(启动时读);profile patch 层是 live 热重载,
|
|
34
|
+
行级开关不需要重启。
|
|
35
|
+
|
|
36
|
+
## 组件(8 个)
|
|
37
|
+
|
|
38
|
+
| 行 id | 包 | 做什么 |
|
|
39
|
+
|---|---|---|
|
|
40
|
+
| `dsh-patch-ask-expand` | `@gavinc-cn/dsh-patch-ask-expand` | 让 Web GUI 里「提问 / 回答」那一行默认展开(对官方 client bundle 打幂等文本补丁) |
|
|
41
|
+
| `dsh-superpowers-priming` | `@gavinc-cn/dsh-superpowers-priming` | 给「重开的会话」补一份 superpowers 开场说明(按会话历史判重,不重复注入) |
|
|
42
|
+
| `dsh-memory` | `@gavinc-cn/dsh-memory` | 跨会话记忆:首轮注入两级记忆索引,回合收尾限流提示写记忆 |
|
|
43
|
+
| `dsh-autocommit` | `@gavinc-cn/dsh-autocommit` | 回合收尾时若本会话还有未提交改动,挡下并提示模型先提交 |
|
|
44
|
+
| `dsh-git-guard` | `@gavinc-cn/dsh-git-guard` | git 操作归属守卫(按提交前缀/分支命名判定,拦下越权 git 写操作) |
|
|
45
|
+
| `dsh-file-guard` | `@gavinc-cn/dsh-file-guard` | 回合收尾比对「本会话写下的文件」与磁盘漂移,只报告不自动改回 |
|
|
46
|
+
| `sandbox-path-allowlist` | `@gavinc-cn/sandbox-path-allowlist` | 沙箱升权白名单:配置目录内的 write/edit 升权请求自动放行(默认 `paths` 为空 = 空转,靠 profile 覆盖行给本机路径) |
|
|
47
|
+
| `dsh-readonly-guard` | `@gavinc-cn/dsh-readonly-guard` | bash 只读闸门:只读命令放行,可能改系统的转 DSH 原生审批。包内默认 `disabled: true` |
|
|
48
|
+
|
|
49
|
+
行 id 的约定是**包名去掉 scope**(`@gavinc-cn/dsh-memory` → `dsh-memory`):profile 覆盖行按它命中,
|
|
50
|
+
面板开关按它写回。要改组件集合,改本包的 `cordis.patch.yml` 即可(**改完 patch 层当场热重载**)。
|
|
51
|
+
|
|
52
|
+
## 机器相关配置不要写进这里
|
|
53
|
+
|
|
54
|
+
本包只下发「有哪些组件 + 默认行为」。只有某台机器才成立的值(本地检出路径、状态目录、日志路径)
|
|
55
|
+
请写在 profile 覆盖层:
|
|
56
|
+
|
|
57
|
+
```yaml
|
|
58
|
+
# ~/.dsh/profiles/<profile>/cordis.patch.yml
|
|
59
|
+
- id: dsh-superpowers-priming
|
|
60
|
+
config:
|
|
61
|
+
skillPath: /path/to/superpowers/skills/using-superpowers/SKILL.md
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
覆盖行只按 `id` 命中,**不要写 `insert`、也不写 `name`**(与官方 `writePluginEnabled()` 同形状)。
|
|
65
|
+
|
|
66
|
+
| 组件 | 可覆盖项 | 默认值 |
|
|
67
|
+
|---|---|---|
|
|
68
|
+
| `dsh-superpowers-priming` | `skillPath`(或 env `SUPERPOWERS_SKILL_PATH`) | `~/superpowers/skills/using-superpowers/SKILL.md`(文件不存在只记日志、不注入) |
|
|
69
|
+
| `dsh-file-guard` | `stateRoot`(或 env `FILE_GUARD_ROOT`) | `~/.orca/file-guard` |
|
|
70
|
+
| `dsh-patch-ask-expand` | `bundlePath` | `~/.dsh/profiles/node_modules/@deepseek-ai/dsh-client-ui-tool/lib/client.js` |
|
|
71
|
+
| `sandbox-path-allowlist` | `paths`(数组,绝对路径)/ `allowShell` | `paths: []` = 不生效(**必须**由覆盖行给本机路径才有作用) |
|
|
72
|
+
| `dsh-readonly-guard` | `enabled` / `dryRun` / `askMode` / `whitelistPath` / `pendingPath` / `logPath` | 行默认 `disabled: true`;`whitelistPath`/`pendingPath` 缺省与 kimi 共用 `~/.kimi-code/readonly_whitelist.json` / `readonly_pending.jsonl` |
|
|
73
|
+
| 各组件 | `logPath` / `enabled` / `dryRun` | 日志在 `~/.kimi-code/hooks/logs/`,默认启用 |
|
|
74
|
+
|
|
75
|
+
## 已知限制
|
|
76
|
+
|
|
77
|
+
- 桌面端(Electron 宿主)改 `dsh.profile.bundles` 后必须**重启 App**;只有 patch 层是 live 热重载。
|
|
78
|
+
- 面板里 node 侧组件的标题/说明来自各组件包自己的 `locale/*.json`;本包的 `locale/*.json` 只提供
|
|
79
|
+
卡片标题与描述。host 启动时缓存行元数据(`pluginPackages.metaOf`)⇒ 运行中新增/改 `locale` 要重启宿主才看到。
|
|
80
|
+
- 某些组件只在特定平台有意义(宿主侧的状态目录、日志目录等按上表各自配置)。
|
|
81
|
+
|
|
82
|
+
## License
|
|
83
|
+
|
|
84
|
+
MIT
|
package/cordis.patch.yml
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# @gavinc-cn/dsh-plugins-runtime —— 「运行时组件」的组合行(2026-10-13 从 @gavinc-cn/dsh-plugins 拆出)。
|
|
2
|
+
#
|
|
3
|
+
# 归属判据:组件包的 package.json 里**没有** `dsh.client` 声明 —— 也就是 node(宿主)侧运行的组件。
|
|
4
|
+
# 与 @gavinc-cn/dsh-plugins-ui 互补(那个包里是 5 个声明了 dsh.client.platform: "web" 的纯 UI 组件),
|
|
5
|
+
# 两个包合起来 = 拆分前 @gavinc-cn/dsh-plugins 的全部 13 个组件,行 id 与行顺序都保持不变。
|
|
6
|
+
#
|
|
7
|
+
# 注意 dsh-patch-ask-expand:它**不是**客户端插件(没有 dsh.client),但它改的是官方
|
|
8
|
+
# @deepseek-ai/dsh-client-ui-tool 的成品 client bundle —— 效果在 UI 上,运行体在宿主侧。
|
|
9
|
+
# 按上面的客观判据它归本包;因此「只装 UI 包」不会得到它。
|
|
10
|
+
#
|
|
11
|
+
# 工作方式(与拆分前一致):
|
|
12
|
+
# * Plugins 面板出现 @gavinc-cn/dsh-plugins-runtime 卡片,卡片内每个行 = 一个组件 = 一个开关;
|
|
13
|
+
# * 行开关写回 profile patch 的 `- id: <行id>` 覆盖行(行状态留在各 profile,可各自独立开关);
|
|
14
|
+
# * 整包开关控制包名在不在 profile 的 dsh.profile.bundles。
|
|
15
|
+
#
|
|
16
|
+
# 行 id 与包名的约定:id = 包名去掉 scope(@gavinc-cn/dsh-memory → dsh-memory),
|
|
17
|
+
# name 才是模块说明符(= 完整包名)。
|
|
18
|
+
#
|
|
19
|
+
# **同一个行 id 在整棵组合树里只能出现一次**:写进本文件的行,profile 侧不要再写同名 insert
|
|
20
|
+
# (同 id 两行会被 dsh-plugin-manager 的 listPlugins() 判成 unaddressable,面板里既没有开关
|
|
21
|
+
# 也拨不动),只写不带 insert 的覆盖行。
|
|
22
|
+
#
|
|
23
|
+
# 机器相关配置(本机检出路径、状态目录、日志路径)**不进本文件**:写在各 profile 的覆盖行里,
|
|
24
|
+
# 例如 `- id: dsh-superpowers-priming` + `config: { skillPath: ... }`。
|
|
25
|
+
#
|
|
26
|
+
# 依赖:本包在 package.json 的 dependencies 里声明下述 8 个组件包 —— 装本包即把它们一并装上。
|
|
27
|
+
# 发布顺序:**8 个组件包先发(其中 @gavinc-cn/dsh-readonly-guard 必须先于本包上 registry),本包最后发**。
|
|
28
|
+
#
|
|
29
|
+
# 改组件集合 = 改本文件(patch 层 live 热重载,不需要重装/重启);改完把仓库真源铺到共享活副本
|
|
30
|
+
# (在仓库根执行:bash scripts/deploy-to-dsh.sh dsh-plugins-runtime)。
|
|
31
|
+
#
|
|
32
|
+
# 注意:别再对 profile 跑 pnpm install —— registry 版会盖住共享活副本里那份(见仓库 README)。
|
|
33
|
+
|
|
34
|
+
# dsh-patch-ask-expand:启动时对官方 dsh-client-ui-tool 的 client bundle 打幂等文本补丁。
|
|
35
|
+
- insert:
|
|
36
|
+
- id: dsh-patch-ask-expand
|
|
37
|
+
name: "@gavinc-cn/dsh-patch-ask-expand"
|
|
38
|
+
|
|
39
|
+
- insert:
|
|
40
|
+
- id: dsh-superpowers-priming
|
|
41
|
+
name: "@gavinc-cn/dsh-superpowers-priming"
|
|
42
|
+
|
|
43
|
+
- insert:
|
|
44
|
+
- id: dsh-memory
|
|
45
|
+
name: "@gavinc-cn/dsh-memory"
|
|
46
|
+
|
|
47
|
+
- insert:
|
|
48
|
+
- id: dsh-autocommit
|
|
49
|
+
name: "@gavinc-cn/dsh-autocommit"
|
|
50
|
+
|
|
51
|
+
- insert:
|
|
52
|
+
- id: dsh-git-guard
|
|
53
|
+
name: "@gavinc-cn/dsh-git-guard"
|
|
54
|
+
|
|
55
|
+
- insert:
|
|
56
|
+
- id: dsh-file-guard
|
|
57
|
+
name: "@gavinc-cn/dsh-file-guard"
|
|
58
|
+
|
|
59
|
+
# sandbox-path-allowlist:沙箱升权白名单。包内默认 paths 为空 = 不生效(安全的空转默认值),
|
|
60
|
+
# 实际路径由 profile 覆盖行给(容器 web 与宿主 desktop 各自给各自的绝对路径)。
|
|
61
|
+
- insert:
|
|
62
|
+
- id: sandbox-path-allowlist
|
|
63
|
+
name: "@gavinc-cn/sandbox-path-allowlist"
|
|
64
|
+
|
|
65
|
+
# dsh-readonly-guard:bash 只读闸门(非只读命令转到 DSH 原生审批)。默认**停用**:
|
|
66
|
+
# 容器 web 侧刻意不挂(与既有 sandbox/approval 分层重叠),宿主 desktop 侧由覆盖行
|
|
67
|
+
# `- id: dsh-readonly-guard` + `disabled: false` 打开(见 desktop 的 cordis.patch.yml)。
|
|
68
|
+
- insert:
|
|
69
|
+
- id: dsh-readonly-guard
|
|
70
|
+
disabled: true
|
|
71
|
+
name: "@gavinc-cn/dsh-readonly-guard"
|
package/lib/index.js
ADDED
package/locale/en.json
ADDED
package/locale/zh.json
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,54 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gavinc-cn/dsh-plugins-runtime",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "DSH 插件组合包(runtime bundle):8 个 node 侧组件(记忆、git/文件守卫、只读闸门、沙箱白名单、重开会话再注入等),每个是一行独立开关;UI 组件见 @gavinc-cn/dsh-plugins-ui。",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/gavinc-cn/dsh-plugins.git",
|
|
9
|
+
"directory": "packages/bundles/dsh-plugins-runtime"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://github.com/gavinc-cn/dsh-plugins/tree/master/packages/bundles/dsh-plugins-runtime#readme",
|
|
12
|
+
"bugs": "https://github.com/gavinc-cn/dsh-plugins/issues",
|
|
13
|
+
"type": "module",
|
|
14
|
+
"main": "./lib/index.js",
|
|
15
|
+
"exports": {
|
|
16
|
+
".": {
|
|
17
|
+
"default": "./lib/index.js"
|
|
18
|
+
},
|
|
19
|
+
"./package.json": "./package.json",
|
|
20
|
+
"./locale/*.json": "./locale/*.json"
|
|
21
|
+
},
|
|
22
|
+
"dsh": {
|
|
23
|
+
"bundle": {
|
|
24
|
+
"patch": "./cordis.patch.yml"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"files": [
|
|
28
|
+
"lib",
|
|
29
|
+
"locale",
|
|
30
|
+
"cordis.patch.yml"
|
|
31
|
+
],
|
|
32
|
+
"keywords": [
|
|
33
|
+
"dsh",
|
|
34
|
+
"deepseek-harness",
|
|
35
|
+
"cordis",
|
|
36
|
+
"bundle",
|
|
37
|
+
"plugin",
|
|
38
|
+
"runtime"
|
|
39
|
+
],
|
|
40
|
+
"publishConfig": {
|
|
41
|
+
"registry": "https://registry.npmjs.org",
|
|
42
|
+
"access": "public"
|
|
43
|
+
},
|
|
44
|
+
"dependencies": {
|
|
45
|
+
"@gavinc-cn/dsh-patch-ask-expand": "^0.1.1",
|
|
46
|
+
"@gavinc-cn/dsh-superpowers-priming": "^0.1.0",
|
|
47
|
+
"@gavinc-cn/dsh-memory": "^0.1.0",
|
|
48
|
+
"@gavinc-cn/dsh-autocommit": "^0.1.1",
|
|
49
|
+
"@gavinc-cn/dsh-git-guard": "^0.1.0",
|
|
50
|
+
"@gavinc-cn/dsh-file-guard": "^0.1.0",
|
|
51
|
+
"@gavinc-cn/sandbox-path-allowlist": "^0.1.1",
|
|
52
|
+
"@gavinc-cn/dsh-readonly-guard": "^0.1.0"
|
|
53
|
+
}
|
|
54
|
+
}
|